summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-10-19 15:17:25 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-10-20 08:04:35 +0200
commitb225980d2d65694278c9ed89512fbe21b08febd6 (patch)
treeacd7e008fdabbed097fd97f6c4ba8ddc366946bb /sc/source/ui
parent6eefea359fe1e51adfd4a2002614013a7c060a33 (diff)
use tools::Long in sc
Change-Id: I8f37a8d1174ed816df971b8cee036d4e88d4a7fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104526 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/Accessibility/AccessibleCell.cxx2
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocument.cxx4
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx22
-rw-r--r--sc/source/ui/Accessibility/AccessiblePreviewTable.cxx10
-rw-r--r--sc/source/ui/Accessibility/AccessibleText.cxx30
-rw-r--r--sc/source/ui/app/client.cxx10
-rw-r--r--sc/source/ui/app/inputhdl.cxx34
-rw-r--r--sc/source/ui/app/inputwin.cxx46
-rw-r--r--sc/source/ui/app/transobj.cxx20
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.cxx8
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.hxx8
-rw-r--r--sc/source/ui/cctrl/checklistmenu.cxx4
-rw-r--r--sc/source/ui/cctrl/dpcontrol.cxx8
-rw-r--r--sc/source/ui/cctrl/tbzoomsliderctrl.cxx76
-rw-r--r--sc/source/ui/dbgui/pvfundlg.cxx10
-rw-r--r--sc/source/ui/dbgui/tpsort.cxx2
-rw-r--r--sc/source/ui/docshell/dbdocimp.cxx8
-rw-r--r--sc/source/ui/docshell/docfunc.cxx4
-rw-r--r--sc/source/ui/docshell/docsh2.cxx4
-rw-r--r--sc/source/ui/docshell/docsh3.cxx6
-rw-r--r--sc/source/ui/docshell/docsh4.cxx54
-rw-r--r--sc/source/ui/docshell/docsh5.cxx2
-rw-r--r--sc/source/ui/docshell/docsh6.cxx6
-rw-r--r--sc/source/ui/docshell/docsh8.cxx14
-rw-r--r--sc/source/ui/docshell/impex.cxx2
-rw-r--r--sc/source/ui/docshell/pagedata.cxx4
-rw-r--r--sc/source/ui/drawfunc/fuconrec.cxx8
-rw-r--r--sc/source/ui/drawfunc/fudraw.cxx4
-rw-r--r--sc/source/ui/drawfunc/fuins1.cxx4
-rw-r--r--sc/source/ui/drawfunc/fusel2.cxx6
-rw-r--r--sc/source/ui/inc/asciiopt.hxx6
-rw-r--r--sc/source/ui/inc/autofmt.hxx8
-rw-r--r--sc/source/ui/inc/colrowba.hxx8
-rw-r--r--sc/source/ui/inc/dbfunc.hxx4
-rw-r--r--sc/source/ui/inc/gridmerg.hxx22
-rw-r--r--sc/source/ui/inc/gridwin.hxx8
-rw-r--r--sc/source/ui/inc/hdrcont.hxx24
-rw-r--r--sc/source/ui/inc/inputhdl.hxx4
-rw-r--r--sc/source/ui/inc/inputwin.hxx30
-rw-r--r--sc/source/ui/inc/mtrindlg.hxx8
-rw-r--r--sc/source/ui/inc/olinewin.hxx46
-rw-r--r--sc/source/ui/inc/optsolver.hxx2
-rw-r--r--sc/source/ui/inc/output.hxx76
-rw-r--r--sc/source/ui/inc/pagedata.hxx7
-rw-r--r--sc/source/ui/inc/pfuncache.hxx16
-rw-r--r--sc/source/ui/inc/preview.hxx34
-rw-r--r--sc/source/ui/inc/prevloc.hxx10
-rw-r--r--sc/source/ui/inc/prevwsh.hxx2
-rw-r--r--sc/source/ui/inc/printfun.hxx66
-rw-r--r--sc/source/ui/inc/tabview.hxx32
-rw-r--r--sc/source/ui/inc/tabvwsh.hxx4
-rw-r--r--sc/source/ui/inc/tbzoomsliderctrl.hxx4
-rw-r--r--sc/source/ui/inc/viewdata.hxx98
-rw-r--r--sc/source/ui/inc/viewfunc.hxx4
-rw-r--r--sc/source/ui/miscdlgs/crnrdlg.cxx4
-rw-r--r--sc/source/ui/miscdlgs/mtrindlg.cxx8
-rw-r--r--sc/source/ui/miscdlgs/optsolver.cxx22
-rw-r--r--sc/source/ui/sidebar/AlignmentPropertyPanel.cxx2
-rw-r--r--sc/source/ui/sidebar/CellLineStyleValueSet.cxx10
-rw-r--r--sc/source/ui/undo/undoblk.cxx8
-rw-r--r--sc/source/ui/unoobj/ChartTools.cxx4
-rw-r--r--sc/source/ui/unoobj/PivotTableDataProvider.cxx2
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx36
-rw-r--r--sc/source/ui/unoobj/chartuno.cxx8
-rw-r--r--sc/source/ui/unoobj/cursuno.cxx4
-rw-r--r--sc/source/ui/unoobj/dapiuno.cxx6
-rw-r--r--sc/source/ui/unoobj/docuno.cxx40
-rw-r--r--sc/source/ui/unoobj/fmtuno.cxx12
-rw-r--r--sc/source/ui/unoobj/funcuno.cxx40
-rw-r--r--sc/source/ui/unoobj/nameuno.cxx4
-rw-r--r--sc/source/ui/unoobj/viewuno.cxx14
-rw-r--r--sc/source/ui/vba/vbahyperlink.hxx3
-rw-r--r--sc/source/ui/vba/vbarange.cxx10
-rw-r--r--sc/source/ui/vba/vbaworksheets.cxx2
-rw-r--r--sc/source/ui/view/cellsh3.cxx8
-rw-r--r--sc/source/ui/view/colrowba.cxx14
-rw-r--r--sc/source/ui/view/dbfunc3.cxx36
-rw-r--r--sc/source/ui/view/drawutil.cxx12
-rw-r--r--sc/source/ui/view/drawvie4.cxx6
-rw-r--r--sc/source/ui/view/gridmerg.cxx14
-rw-r--r--sc/source/ui/view/gridwin.cxx102
-rw-r--r--sc/source/ui/view/gridwin2.cxx26
-rw-r--r--sc/source/ui/view/gridwin4.cxx110
-rw-r--r--sc/source/ui/view/gridwin_dbgutil.cxx4
-rw-r--r--sc/source/ui/view/hdrcont.cxx62
-rw-r--r--sc/source/ui/view/olinewin.cxx84
-rw-r--r--sc/source/ui/view/output.cxx272
-rw-r--r--sc/source/ui/view/output2.cxx520
-rw-r--r--sc/source/ui/view/output3.cxx18
-rw-r--r--sc/source/ui/view/pfuncache.cxx22
-rw-r--r--sc/source/ui/view/preview.cxx160
-rw-r--r--sc/source/ui/view/prevloc.cxx46
-rw-r--r--sc/source/ui/view/prevwsh.cxx98
-rw-r--r--sc/source/ui/view/printfun.cxx388
-rw-r--r--sc/source/ui/view/reffact.cxx8
-rw-r--r--sc/source/ui/view/select.cxx8
-rw-r--r--sc/source/ui/view/tabsplit.cxx8
-rw-r--r--sc/source/ui/view/tabview.cxx228
-rw-r--r--sc/source/ui/view/tabview2.cxx22
-rw-r--r--sc/source/ui/view/tabview3.cxx70
-rw-r--r--sc/source/ui/view/tabview4.cxx28
-rw-r--r--sc/source/ui/view/tabview5.cxx12
-rw-r--r--sc/source/ui/view/tabvwsh3.cxx2
-rw-r--r--sc/source/ui/view/tabvwsha.cxx4
-rw-r--r--sc/source/ui/view/tabvwshb.cxx4
-rw-r--r--sc/source/ui/view/tabvwshh.cxx4
-rw-r--r--sc/source/ui/view/viewdata.cxx324
-rw-r--r--sc/source/ui/view/viewfun5.cxx4
-rw-r--r--sc/source/ui/view/viewfun7.cxx8
-rw-r--r--sc/source/ui/view/viewfunc.cxx8
110 files changed, 1964 insertions, 1962 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx b/sc/source/ui/Accessibility/AccessibleCell.cxx
index d400e1123c93..61cb5a9b0f12 100644
--- a/sc/source/ui/Accessibility/AccessibleCell.cxx
+++ b/sc/source/ui/Accessibility/AccessibleCell.cxx
@@ -166,7 +166,7 @@ tools::Rectangle ScAccessibleCell::GetBoundingBox() const
tools::Rectangle aCellRect;
if (mpViewShell)
{
- long nSizeX, nSizeY;
+ tools::Long nSizeX, nSizeY;
mpViewShell->GetViewData().GetMergeSizePixel(
maCellAddress.Col(), maCellAddress.Row(), nSizeX, nSizeY);
aCellRect.SetSize(Size(nSizeX, nSizeY));
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index 1efcd4091702..1015063d1ce2 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -215,7 +215,7 @@ public:
virtual bool ReplaceChild (
::accessibility::AccessibleShape* pCurrentChild,
const css::uno::Reference< css::drawing::XShape >& _rxShape,
- const long _nIndex,
+ const tools::Long _nIndex,
const ::accessibility::AccessibleShapeTreeInfo& _rShapeTreeInfo
) override;
@@ -418,7 +418,7 @@ void ScChildrenShapes::Notify(SfxBroadcaster&, const SfxHint& rHint)
bool ScChildrenShapes::ReplaceChild (::accessibility::AccessibleShape* pCurrentChild,
const css::uno::Reference< css::drawing::XShape >& _rxShape,
- const long /*_nIndex*/, const ::accessibility::AccessibleShapeTreeInfo& _rShapeTreeInfo)
+ const tools::Long /*_nIndex*/, const ::accessibility::AccessibleShapeTreeInfo& _rShapeTreeInfo)
{
// create the new child
rtl::Reference< ::accessibility::AccessibleShape > pReplacement(::accessibility::ShapeTypeHandler::Instance().CreateAccessibleObject (
diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
index d7a9ebb5845a..568b4a2c59ee 100644
--- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
@@ -653,7 +653,7 @@ public:
virtual bool ReplaceChild (
::accessibility::AccessibleShape* pCurrentChild,
const css::uno::Reference< css::drawing::XShape >& _rxShape,
- const long _nIndex,
+ const tools::Long _nIndex,
const ::accessibility::AccessibleShapeTreeInfo& _rShapeTreeInfo
) override;
@@ -802,7 +802,7 @@ void ScShapeChildren::VisAreaChanged() const
bool ScShapeChildren::ReplaceChild (::accessibility::AccessibleShape* /* pCurrentChild */,
const css::uno::Reference< css::drawing::XShape >& /* _rxShape */,
- const long /* _nIndex */, const ::accessibility::AccessibleShapeTreeInfo& /* _rShapeTreeInfo */)
+ const tools::Long /* _nIndex */, const ::accessibility::AccessibleShapeTreeInfo& /* _rShapeTreeInfo */)
{
OSL_FAIL("should not be called in the page preview");
return false;
@@ -1079,18 +1079,18 @@ struct ScPagePreviewCountData
// order is background shapes, header, table or notes, footer, foreground shapes, controls
tools::Rectangle aVisRect;
- long nBackShapes;
- long nHeaders;
- long nTables;
- long nNoteParagraphs;
- long nFooters;
- long nForeShapes;
- long nControls;
+ tools::Long nBackShapes;
+ tools::Long nHeaders;
+ tools::Long nTables;
+ tools::Long nNoteParagraphs;
+ tools::Long nFooters;
+ tools::Long nForeShapes;
+ tools::Long nControls;
ScPagePreviewCountData( const ScPreviewLocationData& rData, const vcl::Window* pSizeWindow,
const ScNotesChildren* pNotesChildren, const ScShapeChildren* pShapeChildren );
- long GetTotal() const
+ tools::Long GetTotal() const
{
return nBackShapes + nHeaders + nTables + nNoteParagraphs + nFooters + nForeShapes + nControls;
}
@@ -1347,7 +1347,7 @@ sal_Int32 SAL_CALL ScAccessibleDocumentPagePreview::getAccessibleChildCount()
SolarMutexGuard aGuard;
IsObjectValid();
- long nRet = 0;
+ tools::Long nRet = 0;
if ( mpViewShell )
{
ScPagePreviewCountData aCount( mpViewShell->GetLocationData(), mpViewShell->GetWindow(), GetNotesChildren(), GetShapeChildren() );
diff --git a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
index bd47bf57e40a..5db9a2097972 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
@@ -290,7 +290,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessiblePreviewTable::getAccessibleCe
if ( mpTableInfo && nColumn >= 0 && nRow >= 0 && nColumn < mpTableInfo->GetCols() && nRow < mpTableInfo->GetRows() )
{
// index iterates horizontally
- long nNewIndex = nRow * mpTableInfo->GetCols() + nColumn;
+ tools::Long nNewIndex = nRow * mpTableInfo->GetCols() + nColumn;
const ScPreviewColRowInfo& rColInfo = mpTableInfo->GetColInfo()[nColumn];
const ScPreviewColRowInfo& rRowInfo = mpTableInfo->GetRowInfo()[nRow];
@@ -460,7 +460,7 @@ sal_Int32 SAL_CALL ScAccessiblePreviewTable::getAccessibleChildCount()
FillTableInfo();
- long nRet = 0;
+ tools::Long nRet = 0;
if ( mpTableInfo )
nRet = static_cast<sal_Int32>(mpTableInfo->GetCols()) * mpTableInfo->GetRows();
return nRet;
@@ -476,12 +476,12 @@ uno::Reference< XAccessible > SAL_CALL ScAccessiblePreviewTable::getAccessibleCh
uno::Reference<XAccessible> xRet;
if ( mpTableInfo )
{
- long nColumns = mpTableInfo->GetCols();
+ tools::Long nColumns = mpTableInfo->GetCols();
if ( nColumns > 0 )
{
// nCol, nRow are within the visible table, not the document
- long nCol = nIndex % nColumns;
- long nRow = nIndex / nColumns;
+ tools::Long nCol = nIndex % nColumns;
+ tools::Long nRow = nIndex / nColumns;
xRet = getAccessibleCellAt( nRow, nCol );
}
diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx
index fd43850ce8a5..3166fbd513a4 100644
--- a/sc/source/ui/Accessibility/AccessibleText.cxx
+++ b/sc/source/ui/Accessibility/AccessibleText.cxx
@@ -488,14 +488,14 @@ SvxTextForwarder* ScAccessibleCellTextData::GetTextForwarder()
if ( pDocShell && pEditEngine && mpViewShell )
{
ScDocument& rDoc = pDocShell->GetDocument();
- long nSizeX, nSizeY;
+ tools::Long nSizeX, nSizeY;
mpViewShell->GetViewData().GetMergeSizePixel(
aCellPos.Col(), aCellPos.Row(), nSizeX, nSizeY);
Size aSize(nSizeX, nSizeY);
// #i92143# text getRangeExtents reports incorrect 'x' values for spreadsheet cells
- long nIndent = 0;
+ tools::Long nIndent = 0;
const SvxHorJustifyItem* pHorJustifyItem = rDoc.GetAttr( aCellPos, ATTR_HOR_JUSTIFY );
SvxCellHorJustify eHorJust = pHorJustifyItem ? pHorJustifyItem->GetValue() : SvxCellHorJustify::Standard;
if ( eHorJust == SvxCellHorJustify::Left )
@@ -503,7 +503,7 @@ SvxTextForwarder* ScAccessibleCellTextData::GetTextForwarder()
const ScIndentItem* pIndentItem = rDoc.GetAttr( aCellPos, ATTR_INDENT );
if ( pIndentItem )
{
- nIndent = static_cast< long >( pIndentItem->GetValue() );
+ nIndent = static_cast< tools::Long >( pIndentItem->GetValue() );
}
}
@@ -511,11 +511,11 @@ SvxTextForwarder* ScAccessibleCellTextData::GetTextForwarder()
ScViewData& rViewData = mpViewShell->GetViewData();
double nPPTX = rViewData.GetPPTX();
double nPPTY = rViewData.GetPPTY();
- long nLeftM = ( pMarginItem ? static_cast< long >( ( pMarginItem->GetLeftMargin() + nIndent ) * nPPTX ) : 0 );
- long nTopM = ( pMarginItem ? static_cast< long >( pMarginItem->GetTopMargin() * nPPTY ) : 0 );
- long nRightM = ( pMarginItem ? static_cast< long >( pMarginItem->GetRightMargin() * nPPTX ) : 0 );
- long nBottomM = ( pMarginItem ? static_cast< long >( pMarginItem->GetBottomMargin() * nPPTY ) : 0 );
- long nWidth = aSize.getWidth() - nLeftM - nRightM;
+ tools::Long nLeftM = ( pMarginItem ? static_cast< tools::Long >( ( pMarginItem->GetLeftMargin() + nIndent ) * nPPTX ) : 0 );
+ tools::Long nTopM = ( pMarginItem ? static_cast< tools::Long >( pMarginItem->GetTopMargin() * nPPTY ) : 0 );
+ tools::Long nRightM = ( pMarginItem ? static_cast< tools::Long >( pMarginItem->GetRightMargin() * nPPTX ) : 0 );
+ tools::Long nBottomM = ( pMarginItem ? static_cast< tools::Long >( pMarginItem->GetBottomMargin() * nPPTY ) : 0 );
+ tools::Long nWidth = aSize.getWidth() - nLeftM - nRightM;
aSize.setWidth( nWidth );
aSize.setHeight( aSize.getHeight() - nTopM - nBottomM );
@@ -539,7 +539,7 @@ SvxTextForwarder* ScAccessibleCellTextData::GetTextForwarder()
if( pItem && (pItem->GetValue() != 0) )
{
pEditEngine->SetPaperSize( Size( LONG_MAX, aSize.getHeight() ) );
- long nTxtWidth = static_cast< long >( pEditEngine->CalcTextWidth() );
+ tools::Long nTxtWidth = static_cast< tools::Long >( pEditEngine->CalcTextWidth() );
aSize.setWidth( std::max( aSize.getWidth(), nTxtWidth + 2 ) );
}
else
@@ -549,7 +549,7 @@ SvxTextForwarder* ScAccessibleCellTextData::GetTextForwarder()
bool bLineBreak = ( pLineBreakItem && pLineBreakItem->GetValue() );
if ( !bLineBreak )
{
- long nTxtWidth = static_cast< long >( pEditEngine->CalcTextWidth() );
+ tools::Long nTxtWidth = static_cast< tools::Long >( pEditEngine->CalcTextWidth() );
aSize.setWidth( ::std::max( aSize.getWidth(), nTxtWidth ) );
}
}
@@ -567,11 +567,11 @@ SvxTextForwarder* ScAccessibleCellTextData::GetTextForwarder()
{
aTextSize = pWin->LogicToPixel( Size( pEditEngine->CalcTextWidth(), pEditEngine->GetTextHeight() ), pEditEngine->GetRefMapMode() );
}
- long nTextWidth = aTextSize.Width();
- long nTextHeight = aTextSize.Height();
+ tools::Long nTextWidth = aTextSize.Width();
+ tools::Long nTextHeight = aTextSize.Height();
- long nOffsetX = nLeftM;
- long nDiffX = nTextWidth - nWidth;
+ tools::Long nOffsetX = nLeftM;
+ tools::Long nDiffX = nTextWidth - nWidth;
if ( nDiffX > 0 )
{
switch ( eHorJust )
@@ -593,7 +593,7 @@ SvxTextForwarder* ScAccessibleCellTextData::GetTextForwarder()
}
}
- long nOffsetY = 0;
+ tools::Long nOffsetY = 0;
const SvxVerJustifyItem* pVerJustifyItem = rDoc.GetAttr( aCellPos, ATTR_VER_JUSTIFY );
SvxCellVerJustify eVerJust = ( pVerJustifyItem ? pVerJustifyItem->GetValue() : SvxCellVerJustify::Standard );
switch ( eVerJust )
diff --git a/sc/source/ui/app/client.cxx b/sc/source/ui/app/client.cxx
index a121531c4782..ac6b0e12086b 100644
--- a/sc/source/ui/app/client.cxx
+++ b/sc/source/ui/app/client.cxx
@@ -110,26 +110,26 @@ void ScClient::RequestNewObjectArea( tools::Rectangle& aLogicRect )
if (aLogicRect.Right() > aPageRect.Right())
{
- long nDiff = aLogicRect.Right() - aPageRect.Right();
+ tools::Long nDiff = aLogicRect.Right() - aPageRect.Right();
aLogicRect.AdjustLeft( -nDiff );
aLogicRect.AdjustRight( -nDiff );
}
if (aLogicRect.Bottom() > aPageRect.Bottom())
{
- long nDiff = aLogicRect.Bottom() - aPageRect.Bottom();
+ tools::Long nDiff = aLogicRect.Bottom() - aPageRect.Bottom();
aLogicRect.AdjustTop( -nDiff );
aLogicRect.AdjustBottom( -nDiff );
}
if (aLogicRect.Left() < aPageRect.Left())
{
- long nDiff = aLogicRect.Left() - aPageRect.Left();
+ tools::Long nDiff = aLogicRect.Left() - aPageRect.Left();
aLogicRect.AdjustRight( -nDiff );
aLogicRect.AdjustLeft( -nDiff );
}
if (aLogicRect.Top() < aPageRect.Top())
{
- long nDiff = aLogicRect.Top() - aPageRect.Top();
+ tools::Long nDiff = aLogicRect.Top() - aPageRect.Top();
aLogicRect.AdjustBottom( -nDiff );
aLogicRect.AdjustTop( -nDiff );
}
@@ -206,7 +206,7 @@ void ScClient::ViewChanged()
tools::Rectangle aLogicRect = pDrawObj->GetLogicRect();
Fraction aFractX = GetScaleWidth() * aVisSize.Width();
Fraction aFractY = GetScaleHeight() * aVisSize.Height();
- aVisSize = Size( static_cast<long>(aFractX), static_cast<long>(aFractY) ); // Scaled for Draw model
+ aVisSize = Size( static_cast<tools::Long>(aFractX), static_cast<tools::Long>(aFractY) ); // Scaled for Draw model
// pClientData->SetObjArea before pDrawObj->SetLogicRect, so that we don't
// calculate wrong scalings:
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 2359dc35f1fa..075e012f00a5 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -429,8 +429,8 @@ handle_r1c1:
}
ReferenceMark ScInputHandler::GetReferenceMark( const ScViewData& rViewData, ScDocShell* pDocSh,
- long nX1, long nX2, long nY1, long nY2,
- long nTab, const Color& rColor )
+ tools::Long nX1, tools::Long nX2, tools::Long nY1, tools::Long nY2,
+ tools::Long nTab, const Color& rColor )
{
ScSplitPos eWhich = rViewData.GetActivePart();
@@ -447,15 +447,15 @@ ReferenceMark ScInputHandler::GetReferenceMark( const ScViewData& rViewData, ScD
Point aTopLeft = rViewData.GetPrintTwipsPos(nCol1, nRow1);
Point aBottomRight = rViewData.GetPrintTwipsPos(nCol2 + 1, nRow2 + 1);
- long nSizeX = aBottomRight.X() - aTopLeft.X() - 1;
- long nSizeY = aBottomRight.Y() - aTopLeft.Y() - 1;
+ tools::Long nSizeX = aBottomRight.X() - aTopLeft.X() - 1;
+ tools::Long nSizeY = aBottomRight.Y() - aTopLeft.Y() - 1;
return ReferenceMark(aTopLeft.X(), aTopLeft.Y(), nSizeX, nSizeY, nTab, rColor);
}
Point aScrPos = rViewData.GetScrPos( nX1, nY1, eWhich );
- long nScrX = aScrPos.X();
- long nScrY = aScrPos.Y();
+ tools::Long nScrX = aScrPos.X();
+ tools::Long nScrY = aScrPos.Y();
double nPPTX = rViewData.GetPPTX();
double nPPTY = rViewData.GetPPTY();
@@ -505,11 +505,11 @@ void ScInputHandler::UpdateLokReferenceMarks()
const svtools::ColorConfig& rColorCfg = SC_MOD()->GetColorConfig();
Color aRefColor( rColorCfg.GetColorValue( svtools::CALCREFERENCE ).nColor );
- long nX1 = rViewData.GetRefStartX();
- long nX2 = rViewData.GetRefEndX();
- long nY1 = rViewData.GetRefStartY();
- long nY2 = rViewData.GetRefEndY();
- long nTab = rViewData.GetTabNo();
+ tools::Long nX1 = rViewData.GetRefStartX();
+ tools::Long nX2 = rViewData.GetRefEndX();
+ tools::Long nY1 = rViewData.GetRefStartY();
+ tools::Long nY2 = rViewData.GetRefEndY();
+ tools::Long nTab = rViewData.GetTabNo();
PutInOrder(nX1, nX2);
PutInOrder(nY1, nY2);
@@ -532,11 +532,11 @@ void ScInputHandler::UpdateLokReferenceMarks()
ScRange aRef = rData.aRef;
aRef.PutInOrder();
- long nX1 = aRef.aStart.Col();
- long nX2 = aRef.aEnd.Col();
- long nY1 = aRef.aStart.Row();
- long nY2 = aRef.aEnd.Row();
- long nTab = aRef.aStart.Tab();
+ tools::Long nX1 = aRef.aStart.Col();
+ tools::Long nX2 = aRef.aEnd.Col();
+ tools::Long nY1 = aRef.aStart.Row();
+ tools::Long nY2 = aRef.aEnd.Row();
+ tools::Long nTab = aRef.aStart.Tab();
aReferenceMarks[i + nAdditionalMarks] = ScInputHandler::GetReferenceMark( rViewData, pDocSh,
nX1, nX2, nY1, nY2,
@@ -613,7 +613,7 @@ void ScInputHandler::UpdateRange( sal_uInt16 nIndex, const ScRange& rNew )
DataChanged();
bInRangeUpdate = false;
- long nDiff = aNewStr.getLength() - static_cast<long>(nOldEnd-nOldStart);
+ tools::Long nDiff = aNewStr.getLength() - static_cast<tools::Long>(nOldEnd-nOldStart);
rData.aRef = rNew;
rData.nSelEnd = rData.nSelEnd + nDiff;
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index ea7ba5847bdf..311611678148 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -75,13 +75,13 @@
namespace com::sun::star::accessibility { class XAccessible; }
-const long THESIZE = 1000000; // Should be more than enough!
-const long INPUTLINE_INSET_MARGIN = 2; // Space between border and interior widgets of input line
-const long LEFT_OFFSET = 5; // Left offset of input line
+const tools::Long THESIZE = 1000000; // Should be more than enough!
+const tools::Long INPUTLINE_INSET_MARGIN = 2; // Space between border and interior widgets of input line
+const tools::Long LEFT_OFFSET = 5; // Left offset of input line
//TODO const long BUTTON_OFFSET = 2; // Space between input line and button to expand/collapse
-const long INPUTWIN_MULTILINES = 6; // Initial number of lines within multiline dropdown
-const long TOOLBOX_WINDOW_HEIGHT = 22; // Height of toolbox window in pixels - TODO: The same on all systems?
-const long POSITION_COMBOBOX_WIDTH = 18; // Width of position combobox in characters
+const tools::Long INPUTWIN_MULTILINES = 6; // Initial number of lines within multiline dropdown
+const tools::Long TOOLBOX_WINDOW_HEIGHT = 22; // Height of toolbox window in pixels - TODO: The same on all systems?
+const tools::Long POSITION_COMBOBOX_WIDTH = 18; // Width of position combobox in characters
using com::sun::star::uno::Reference;
using com::sun::star::uno::UNO_QUERY;
@@ -482,7 +482,7 @@ void ScInputWindow::Resize()
Size aSize = GetSizePixel();
//(-10) to allow margin between sidebar and formulabar
- long margin = (comphelper::LibreOfficeKit::isActive()) ? 10 : 0;
+ tools::Long margin = (comphelper::LibreOfficeKit::isActive()) ? 10 : 0;
Size aTextWindowSize(aSize.Width() - mxTextWindow->GetPosPixel().X() - LEFT_OFFSET - margin,
mxTextWindow->GetPixelHeightForLines());
mxTextWindow->SetSizePixel(aTextWindowSize);
@@ -749,7 +749,7 @@ void ScInputWindow::MouseMove( const MouseEvent& rMEvt )
if (bInResize)
{
// detect direction
- long nResizeThreshold = long(TOOLBOX_WINDOW_HEIGHT * 0.7);
+ tools::Long nResizeThreshold = tools::Long(TOOLBOX_WINDOW_HEIGHT * 0.7);
bool bResetPointerPos = false;
// Detect attempt to expand toolbar too much
@@ -1096,8 +1096,8 @@ void ScInputBarGroup::TextGrabFocus()
mxTextWndGroup->TextGrabFocus();
}
-constexpr long gnBorderWidth = INPUTLINE_INSET_MARGIN + 1;
-constexpr long gnBorderHeight = INPUTLINE_INSET_MARGIN + 1;
+constexpr tools::Long gnBorderWidth = INPUTLINE_INSET_MARGIN + 1;
+constexpr tools::Long gnBorderHeight = INPUTLINE_INSET_MARGIN + 1;
ScTextWndGroup::ScTextWndGroup(ScInputBarGroup& rParent, ScTabViewShell* pViewSh)
: mxTextWnd(new ScTextWnd(*this, pViewSh))
@@ -1122,17 +1122,17 @@ EditView* ScTextWndGroup::GetEditView()
return mxTextWnd->GetEditView();
}
-long ScTextWndGroup::GetLastNumExpandedLines() const
+tools::Long ScTextWndGroup::GetLastNumExpandedLines() const
{
return mxTextWnd->GetLastNumExpandedLines();
}
-long ScTextWndGroup::GetNumLines() const
+tools::Long ScTextWndGroup::GetNumLines() const
{
return mxTextWnd->GetNumLines();
}
-int ScTextWndGroup::GetPixelHeightForLines(long nLines)
+int ScTextWndGroup::GetPixelHeightForLines(tools::Long nLines)
{
return mxTextWnd->GetPixelHeightForLines(nLines) + 2 * gnBorderHeight;
}
@@ -1175,7 +1175,7 @@ void ScTextWndGroup::SetScrollPolicy()
mxScrollWin->set_vpolicy(VclPolicyType::NEVER);
}
-void ScTextWndGroup::SetNumLines(long nLines)
+void ScTextWndGroup::SetNumLines(tools::Long nLines)
{
mxTextWnd->SetNumLines(nLines);
}
@@ -1238,14 +1238,14 @@ EditView* ScTextWnd::GetEditView()
bool ScTextWnd::HasEditView() const { return m_xEditView != nullptr; }
-int ScTextWnd::GetPixelHeightForLines(long nLines)
+int ScTextWnd::GetPixelHeightForLines(tools::Long nLines)
{
// add padding (for the borders of the window)
OutputDevice& rDevice = GetDrawingArea()->get_ref_device();
return rDevice.LogicToPixel(Size(0, nLines * rDevice.GetTextHeight())).Height() + 1;
}
-void ScTextWnd::SetNumLines(long nLines)
+void ScTextWnd::SetNumLines(tools::Long nLines)
{
mnLines = nLines;
if ( nLines > 1 )
@@ -1265,7 +1265,7 @@ void ScTextWnd::Resize()
m_xEditView->SetOutputArea( aOutputArea );
// Don't leave an empty area at the bottom if we can move the text down.
- long nMaxVisAreaTop = m_xEditEngine->GetTextHeight() - aOutputArea.GetHeight();
+ tools::Long nMaxVisAreaTop = m_xEditEngine->GetTextHeight() - aOutputArea.GetHeight();
if (m_xEditView->GetVisArea().Top() > nMaxVisAreaTop)
{
m_xEditView->Scroll(0, m_xEditView->GetVisArea().Top() - nMaxVisAreaTop);
@@ -1401,7 +1401,7 @@ static void lcl_ModifyRTLVisArea( EditView* pEditView )
{
tools::Rectangle aVisArea = pEditView->GetVisArea();
Size aPaper = pEditView->GetEditEngine()->GetPaperSize();
- long nDiff = aPaper.Width() - aVisArea.Right();
+ tools::Long nDiff = aPaper.Width() - aVisArea.Right();
aVisArea.AdjustLeft(nDiff );
aVisArea.AdjustRight(nDiff );
pEditView->SetVisArea(aVisArea);
@@ -1851,23 +1851,23 @@ void ScTextWnd::SetTextString( const OUString& rNewString )
}
else
{
- long nTextSize = 0;
+ tools::Long nTextSize = 0;
sal_Int32 nDifPos;
if (rNewString.getLength() > aString.getLength())
nDifPos = findFirstNonMatchingChar(rNewString, aString);
else
nDifPos = findFirstNonMatchingChar(aString, rNewString);
- long nSize1 = GetTextWidth(aString);
- long nSize2 = GetTextWidth(rNewString);
+ tools::Long nSize1 = GetTextWidth(aString);
+ tools::Long nSize2 = GetTextWidth(rNewString);
if ( nSize1>0 && nSize2>0 )
nTextSize = std::max( nSize1, nSize2 );
else
nTextSize = GetOutputSizePixel().Width(); // Overflow
Point aLogicStart = GetDrawingArea()->get_ref_device().PixelToLogic(Point(0,0));
- long nStartPos = aLogicStart.X();
- long nInvPos = nStartPos;
+ tools::Long nStartPos = aLogicStart.X();
+ tools::Long nInvPos = nStartPos;
if (nDifPos)
nInvPos += GetTextWidth(aString.copy(0,nDifPos));
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index ff50f6fc4247..1b11a56aa89c 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -763,36 +763,36 @@ void ScTransferObj::InitDocShell(bool bLimitToPageSize)
// Size
//! get while copying sizes
- long nPosX = 0;
- long nPosY = 0;
+ tools::Long nPosX = 0;
+ tools::Long nPosY = 0;
for (nCol=0; nCol<nStartX; nCol++)
nPosX += rDestDoc.GetColWidth( nCol, 0 );
nPosY += rDestDoc.GetRowHeight( 0, nStartY-1, 0 );
- nPosX = static_cast<long>( nPosX * HMM_PER_TWIPS );
- nPosY = static_cast<long>( nPosY * HMM_PER_TWIPS );
+ nPosX = static_cast<tools::Long>( nPosX * HMM_PER_TWIPS );
+ nPosY = static_cast<tools::Long>( nPosY * HMM_PER_TWIPS );
aPaperSize.setWidth( aPaperSize.Width() * 2 ); // limit OLE object to double of page size
aPaperSize.setHeight( aPaperSize.Height() * 2 );
- long nSizeX = 0;
- long nSizeY = 0;
+ tools::Long nSizeX = 0;
+ tools::Long nSizeY = 0;
for (nCol=nStartX; nCol<=nEndX; nCol++)
{
- long nAdd = rDestDoc.GetColWidth( nCol, 0 );
+ tools::Long nAdd = rDestDoc.GetColWidth( nCol, 0 );
if ( bLimitToPageSize && nSizeX+nAdd > aPaperSize.Width() && nSizeX ) // above limit?
break;
nSizeX += nAdd;
}
for (SCROW nRow=nStartY; nRow<=nEndY; nRow++)
{
- long nAdd = rDestDoc.GetRowHeight( nRow, 0 );
+ tools::Long nAdd = rDestDoc.GetRowHeight( nRow, 0 );
if ( bLimitToPageSize && nSizeY+nAdd > aPaperSize.Height() && nSizeY ) // above limit?
break;
nSizeY += nAdd;
}
- nSizeX = static_cast<long>( nSizeX * HMM_PER_TWIPS );
- nSizeY = static_cast<long>( nSizeY * HMM_PER_TWIPS );
+ nSizeX = static_cast<tools::Long>( nSizeX * HMM_PER_TWIPS );
+ nSizeY = static_cast<tools::Long>( nSizeY * HMM_PER_TWIPS );
// pDocSh->SetVisAreaSize( Size(nSizeX,nSizeY) );
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx
index fc68fdcac16b..40dc203d56c1 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -1063,12 +1063,12 @@ VclPtr<AbstractScLinkedAreaDlg> ScAbstractDialogFactory_Impl::CreateScLinkedArea
VclPtr<AbstractScMetricInputDlg> ScAbstractDialogFactory_Impl::CreateScMetricInputDlg(weld::Window* pParent,
const OString& sDialogName,
- long nCurrent,
- long nDefault,
+ tools::Long nCurrent,
+ tools::Long nDefault,
FieldUnit eFUnit,
sal_uInt16 nDecimals,
- long nMaximum ,
- long nMinimum )
+ tools::Long nMaximum ,
+ tools::Long nMinimum )
{
return VclPtr<AbstractScMetricInputDlg_Impl>::Create(std::make_unique<ScMetricInputDlg>(pParent, sDialogName, nCurrent ,nDefault, eFUnit,
nDecimals, nMaximum , nMinimum));
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx
index fc2e992ee4be..1e3be87c34cc 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -734,12 +734,12 @@ public:
virtual VclPtr<AbstractScMetricInputDlg> CreateScMetricInputDlg(weld::Window* pParent,
const OString& sDialogName,
- long nCurrent,
- long nDefault,
+ tools::Long nCurrent,
+ tools::Long nDefault,
FieldUnit eFUnit,
sal_uInt16 nDecimals,
- long nMaximum,
- long nMinimum = 0 ) override;
+ tools::Long nMaximum,
+ tools::Long nMinimum = 0 ) override;
virtual VclPtr<AbstractScMoveTableDlg> CreateScMoveTableDlg(weld::Window * pParent,
const OUString& rDefault) override;
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index 3d27f8b02d13..07eb9b45b3df 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -1322,7 +1322,7 @@ void ScCheckListMenuControl::launch(const tools::Rectangle& rRect)
if (maConfig.mbRTL)
{
// In RTL mode, the logical "left" is visual "right".
- long nLeft = aRect.Left() - aRect.GetWidth();
+ tools::Long nLeft = aRect.Left() - aRect.GetWidth();
aRect.SetLeft( nLeft );
}
else if (mnWndWidth < aRect.GetWidth())
@@ -1330,7 +1330,7 @@ void ScCheckListMenuControl::launch(const tools::Rectangle& rRect)
// Target rectangle (i.e. cell width) is wider than the window.
// Simulate right-aligned launch by modifying the target rectangle
// size.
- long nDiff = aRect.GetWidth() - mnWndWidth;
+ tools::Long nDiff = aRect.GetWidth() - mnWndWidth;
aRect.AdjustLeft(nDiff );
}
diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx
index 2ca413055000..24620cdbd661 100644
--- a/sc/source/ui/cctrl/dpcontrol.cxx
+++ b/sc/source/ui/cctrl/dpcontrol.cxx
@@ -123,7 +123,7 @@ void ScDPFieldButton::draw()
mpOutDev->SetTextColor(mpStyle->GetButtonTextColor());
Point aTextPos = maPos;
- long nTHeight = mpOutDev->GetTextHeight();
+ tools::Long nTHeight = mpOutDev->GetTextHeight();
aTextPos.setX(maPos.getX() + 2); // 2 = Margin
aTextPos.setY(maPos.getY() + (maSize.Height()-nTHeight)/2);
@@ -141,10 +141,10 @@ void ScDPFieldButton::getPopupBoundingBox(Point& rPos, Size& rSize) const
{
float fScaleFactor = mpOutDev->GetDPIScaleFactor();
- long nMaxSize = 18 * fScaleFactor; // Button max size in either dimension
+ tools::Long nMaxSize = 18 * fScaleFactor; // Button max size in either dimension
- long nW = std::min(maSize.getWidth() / 2, nMaxSize);
- long nH = std::min(maSize.getHeight(), nMaxSize);
+ tools::Long nW = std::min(maSize.getWidth() / 2, nMaxSize);
+ tools::Long nH = std::min(maSize.getHeight(), nMaxSize);
// #i114944# AutoFilter button is left-aligned in RTL.
// DataPilot button is always right-aligned for now, so text output isn't affected.
diff --git a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
index 37335bbca80a..416a2baa66de 100644
--- a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
+++ b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
@@ -116,21 +116,21 @@ struct ScZoomSlider::ScZoomSliderWnd_Impl
constexpr sal_uInt16 gnSliderCenter(100);
-const long nButtonWidth = 10;
-const long nButtonHeight = 10;
-const long nIncDecWidth = 11;
-const long nIncDecHeight = 11;
-const long nSliderHeight = 2;
-const long nSliderWidth = 4;
-const long nSnappingHeight = 4;
-const long nSliderXOffset = 20;
-const long nSnappingEpsilon = 5; // snapping epsilon in pixels
-const long nSnappingPointsMinDist = nSnappingEpsilon; // minimum distance of two adjacent snapping points
-
-sal_uInt16 ScZoomSlider::Offset2Zoom( long nOffset ) const
+const tools::Long nButtonWidth = 10;
+const tools::Long nButtonHeight = 10;
+const tools::Long nIncDecWidth = 11;
+const tools::Long nIncDecHeight = 11;
+const tools::Long nSliderHeight = 2;
+const tools::Long nSliderWidth = 4;
+const tools::Long nSnappingHeight = 4;
+const tools::Long nSliderXOffset = 20;
+const tools::Long nSnappingEpsilon = 5; // snapping epsilon in pixels
+const tools::Long nSnappingPointsMinDist = nSnappingEpsilon; // minimum distance of two adjacent snapping points
+
+sal_uInt16 ScZoomSlider::Offset2Zoom( tools::Long nOffset ) const
{
Size aSliderWindowSize = GetOutputSizePixel();
- const long nControlWidth = aSliderWindowSize.Width();
+ const tools::Long nControlWidth = aSliderWindowSize.Width();
sal_uInt16 nRet = 0;
if( nOffset < nSliderXOffset )
@@ -140,7 +140,7 @@ sal_uInt16 ScZoomSlider::Offset2Zoom( long nOffset ) const
// check for snapping points:
auto aSnappingPointIter = std::find_if(mpImpl->maSnappingPointOffsets.begin(), mpImpl->maSnappingPointOffsets.end(),
- [nOffset](const long nCurrent) { return std::abs(nCurrent - nOffset) < nSnappingEpsilon; });
+ [nOffset](const tools::Long nCurrent) { return std::abs(nCurrent - nOffset) < nSnappingEpsilon; });
if (aSnappingPointIter != mpImpl->maSnappingPointOffsets.end())
{
nOffset = *aSnappingPointIter;
@@ -153,19 +153,19 @@ sal_uInt16 ScZoomSlider::Offset2Zoom( long nOffset ) const
if( nOffset < nControlWidth / 2 )
{
// first half of slider
- const long nFirstHalfRange = gnSliderCenter - mpImpl->mnMinZoom;
- const long nHalfSliderWidth = nControlWidth/2 - nSliderXOffset;
- const long nZoomPerSliderPixel = (1000 * nFirstHalfRange) / nHalfSliderWidth;
- const long nOffsetToSliderLeft = nOffset - nSliderXOffset;
+ const tools::Long nFirstHalfRange = gnSliderCenter - mpImpl->mnMinZoom;
+ const tools::Long nHalfSliderWidth = nControlWidth/2 - nSliderXOffset;
+ const tools::Long nZoomPerSliderPixel = (1000 * nFirstHalfRange) / nHalfSliderWidth;
+ const tools::Long nOffsetToSliderLeft = nOffset - nSliderXOffset;
nRet = mpImpl->mnMinZoom + sal_uInt16( nOffsetToSliderLeft * nZoomPerSliderPixel / 1000 );
}
else
{
// second half of slider
- const long nSecondHalfRange = mpImpl->mnMaxZoom - gnSliderCenter;
- const long nHalfSliderWidth = nControlWidth/2 - nSliderXOffset;
- const long nZoomPerSliderPixel = 1000 * nSecondHalfRange / nHalfSliderWidth;
- const long nOffsetToSliderCenter = nOffset - nControlWidth/2;
+ const tools::Long nSecondHalfRange = mpImpl->mnMaxZoom - gnSliderCenter;
+ const tools::Long nHalfSliderWidth = nControlWidth/2 - nSliderXOffset;
+ const tools::Long nZoomPerSliderPixel = 1000 * nSecondHalfRange / nHalfSliderWidth;
+ const tools::Long nOffsetToSliderCenter = nOffset - nControlWidth/2;
nRet = gnSliderCenter + sal_uInt16( nOffsetToSliderCenter * nZoomPerSliderPixel / 1000 );
}
}
@@ -179,27 +179,27 @@ sal_uInt16 ScZoomSlider::Offset2Zoom( long nOffset ) const
return nRet;
}
-long ScZoomSlider::Zoom2Offset( sal_uInt16 nCurrentZoom ) const
+tools::Long ScZoomSlider::Zoom2Offset( sal_uInt16 nCurrentZoom ) const
{
Size aSliderWindowSize = GetOutputSizePixel();
- const long nControlWidth = aSliderWindowSize.Width();
- long nRect = nSliderXOffset;
+ const tools::Long nControlWidth = aSliderWindowSize.Width();
+ tools::Long nRect = nSliderXOffset;
- const long nHalfSliderWidth = nControlWidth/2 - nSliderXOffset;
+ const tools::Long nHalfSliderWidth = nControlWidth/2 - nSliderXOffset;
if( nCurrentZoom <= gnSliderCenter )
{
nCurrentZoom = nCurrentZoom - mpImpl->mnMinZoom;
- const long nFirstHalfRange = gnSliderCenter - mpImpl->mnMinZoom;
- const long nSliderPixelPerZoomPercent = 1000 * nHalfSliderWidth / nFirstHalfRange;
- const long nOffset = (nSliderPixelPerZoomPercent * nCurrentZoom) / 1000;
+ const tools::Long nFirstHalfRange = gnSliderCenter - mpImpl->mnMinZoom;
+ const tools::Long nSliderPixelPerZoomPercent = 1000 * nHalfSliderWidth / nFirstHalfRange;
+ const tools::Long nOffset = (nSliderPixelPerZoomPercent * nCurrentZoom) / 1000;
nRect += nOffset;
}
else
{
nCurrentZoom = nCurrentZoom - gnSliderCenter;
- const long nSecondHalfRange = mpImpl->mnMaxZoom - gnSliderCenter;
- const long nSliderPixelPerZoomPercent = 1000 * nHalfSliderWidth / nSecondHalfRange;
- const long nOffset = (nSliderPixelPerZoomPercent * nCurrentZoom) / 1000;
+ const tools::Long nSecondHalfRange = mpImpl->mnMaxZoom - gnSliderCenter;
+ const tools::Long nSliderPixelPerZoomPercent = 1000 * nHalfSliderWidth / nSecondHalfRange;
+ const tools::Long nOffset = (nSliderPixelPerZoomPercent * nCurrentZoom) / 1000;
nRect += nHalfSliderWidth + nOffset;
}
return nRect;
@@ -248,10 +248,10 @@ bool ScZoomSlider::MouseButtonDown( const MouseEvent& rMEvt )
const Point aPoint = rMEvt.GetPosPixel();
- const long nButtonLeftOffset = ( nSliderXOffset - nIncDecWidth )/2;
- const long nButtonRightOffset = ( nSliderXOffset + nIncDecWidth )/2;
+ const tools::Long nButtonLeftOffset = ( nSliderXOffset - nIncDecWidth )/2;
+ const tools::Long nButtonRightOffset = ( nSliderXOffset + nIncDecWidth )/2;
- const long nOldZoom = mpImpl->mnCurrentZoom;
+ const tools::Long nOldZoom = mpImpl->mnCurrentZoom;
// click to - button
if ( aPoint.X() >= nButtonLeftOffset && aPoint.X() <= nButtonRightOffset )
@@ -300,7 +300,7 @@ bool ScZoomSlider::MouseButtonDown( const MouseEvent& rMEvt )
bool ScZoomSlider::MouseMove( const MouseEvent& rMEvt )
{
Size aSliderWindowSize = GetOutputSizePixel();
- const long nControlWidth = aSliderWindowSize.Width();
+ const tools::Long nControlWidth = aSliderWindowSize.Width();
const short nButtons = rMEvt.GetButtons();
// check mouse move with button pressed
@@ -364,11 +364,11 @@ void ScZoomSlider::UpdateFromItem(const SvxZoomSliderItem* pZoomSliderItem)
[](const sal_Int32 nSnappingPoint) -> sal_uInt16 { return static_cast<sal_uInt16>(nSnappingPoint); });
// remove snapping points that are too close to each other:
- long nLastOffset = 0;
+ tools::Long nLastOffset = 0;
for ( const sal_uInt16 nCurrent : aTmpSnappingPoints )
{
- const long nCurrentOffset = Zoom2Offset( nCurrent );
+ const tools::Long nCurrentOffset = Zoom2Offset( nCurrent );
if ( nCurrentOffset - nLastOffset >= nSnappingPointsMinDist )
{
diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx
index 2456d40f608a..5af5a68befc7 100644
--- a/sc/source/ui/dbgui/pvfundlg.cxx
+++ b/sc/source/ui/dbgui/pvfundlg.cxx
@@ -131,7 +131,7 @@ const sal_uInt16 SC_BASEITEM_USER_POS = 2;
const sal_uInt16 SC_SORTNAME_POS = 0;
const sal_uInt16 SC_SORTDATA_POS = 1;
-const long SC_SHOW_DEFAULT = 10;
+const tools::Long SC_SHOW_DEFAULT = 10;
} // namespace
@@ -750,7 +750,7 @@ void ScDPSubtotalOptDlg::Init( const ScDPNameVec& rDataFields, bool bEnableLayou
m_xCbShow->connect_clicked( LINK( this, ScDPSubtotalOptDlg, CheckHdl ) );
m_xLbShowFrom->set_active(FromDataPilotFieldShowItemsMode(maLabelData.maShowInfo.ShowItemsMode));
- long nCount = static_cast< long >( maLabelData.maShowInfo.ItemCount );
+ tools::Long nCount = static_cast< tools::Long >( maLabelData.maShowInfo.ItemCount );
if( nCount < 1 )
nCount = SC_SHOW_DEFAULT;
m_xNfShow->set_value( nCount );
@@ -853,8 +853,8 @@ ScDPShowDetailDlg::ScDPShowDetailDlg(weld::Window* pParent, ScDPObject& rDPObj,
, mxLbDims(m_xBuilder->weld_tree_view("dimsTreeview"))
{
ScDPSaveData* pSaveData = rDPObj.GetSaveData();
- long nDimCount = rDPObj.GetDimCount();
- for (long nDim=0; nDim<nDimCount; nDim++)
+ tools::Long nDimCount = rDPObj.GetDimCount();
+ for (tools::Long nDim=0; nDim<nDimCount; nDim++)
{
bool bIsDataLayout;
sal_Int32 nDimFlags = 0;
@@ -900,7 +900,7 @@ OUString ScDPShowDetailDlg::GetDimensionName() const
// This should never happen!
return aSelectedName;
- long nDim = itr->second;
+ tools::Long nDim = itr->second;
bool bIsDataLayout = false;
return mrDPObj.GetDimName(nDim, bIsDataLayout);
}
diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index 462d60efd623..769f92ce277b 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -888,7 +888,7 @@ void ScTabPageSortOptions::FillAlgor()
lang::Locale aLocale( LanguageTag::convertToLocale( eLang ));
const uno::Sequence<OUString> aAlgos = m_xColWrap->listCollatorAlgorithms( aLocale );
- long nCount = aAlgos.getLength();
+ tools::Long nCount = aAlgos.getLength();
for (const OUString& sAlg : aAlgos)
{
OUString sUser = m_xColRes->GetTranslation( sAlg );
diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx
index a49b9257f4f4..7a5036dd9812 100644
--- a/sc/source/ui/docshell/dbdocimp.cxx
+++ b/sc/source/ui/docshell/dbdocimp.cxx
@@ -233,7 +233,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
// get column descriptions
- long nColCount = 0;
+ tools::Long nColCount = 0;
uno::Reference<sdbc::XResultSetMetaData> xMeta;
uno::Reference<sdbc::XResultSetMetaDataSupplier> xMetaSupp( xRowSet, uno::UNO_QUERY );
if ( xMetaSupp.is() )
@@ -267,7 +267,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
uno::Sequence<sal_Bool> aColCurr( nColCount ); // currency flag is not in types
sal_Int32* pTypeArr = aColTypes.getArray();
sal_Bool* pCurrArr = aColCurr.getArray();
- for (long i=0; i<nColCount; i++)
+ for (tools::Long i=0; i<nColCount; i++)
{
pTypeArr[i] = xMeta->getColumnType( i+1 );
pCurrArr[i] = xMeta->isCurrency( i+1 );
@@ -275,7 +275,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
// read column names
nCol = rParam.nCol1;
- for (long i=0; i<nColCount; i++)
+ for (tools::Long i=0; i<nColCount; i++)
{
pImportDoc->SetString( nCol, nRow, nTab,
xMeta->getColumnLabel( i+1 ) );
@@ -328,7 +328,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
if ( rDoc.ValidRow(nRow) )
{
nCol = rParam.nCol1;
- for (long i=0; i<nColCount; i++)
+ for (tools::Long i=0; i<nColCount; i++)
{
ScDatabaseDocUtil::PutData( *pImportDoc, nCol, nRow, nTab,
xRow, i+1, pTypeArr[i], pCurrArr[i] );
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 358fb135d17c..617937cf2231 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -2704,8 +2704,8 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
{
ScRange aRange = qDecreaseRange.back();
- long nDecreaseRowCount = 0;
- long nDecreaseColCount = 0;
+ tools::Long nDecreaseRowCount = 0;
+ tools::Long nDecreaseColCount = 0;
if( eCmd == DelCellCmd::CellsUp || eCmd == DelCellCmd::Rows )
{
if( nStartRow >= aRange.aStart.Row() && nStartRow <= aRange.aEnd.Row() && nEndRow>= aRange.aStart.Row() && nEndRow <= aRange.aEnd.Row() )
diff --git a/sc/source/ui/docshell/docsh2.cxx b/sc/source/ui/docshell/docsh2.cxx
index 1c819a021ae2..0c8da05362b0 100644
--- a/sc/source/ui/docshell/docsh2.cxx
+++ b/sc/source/ui/docshell/docsh2.cxx
@@ -46,8 +46,8 @@ bool ScDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
// Additional tables are created by the first View, if bIsEmpty is still sal_True
if( bRet )
{
- Size aSize( long( STD_COL_WIDTH * HMM_PER_TWIPS * OLE_STD_CELLS_X ),
- static_cast<long>( ScGlobal::nStdRowHeight * HMM_PER_TWIPS * OLE_STD_CELLS_Y ) );
+ Size aSize( tools::Long( STD_COL_WIDTH * HMM_PER_TWIPS * OLE_STD_CELLS_X ),
+ static_cast<tools::Long>( ScGlobal::nStdRowHeight * HMM_PER_TWIPS * OLE_STD_CELLS_Y ) );
// Also adjust start here
SetVisAreaOrSize( tools::Rectangle( Point(), aSize ) );
}
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index 271d630094ae..42f952f5c1a8 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -367,8 +367,8 @@ void ScDocShell::CalcOutputFactor()
OUString aTestString(
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890123456789");
- long nPrinterWidth = 0;
- long nWindowWidth = 0;
+ tools::Long nPrinterWidth = 0;
+ tools::Long nWindowWidth = 0;
const ScPatternAttr* pPattern = &m_aDocument.GetPool()->GetDefaultItem(ATTR_PATTERN);
vcl::Font aDefFont;
@@ -388,7 +388,7 @@ void ScDocShell::CalcOutputFactor()
pPattern->GetFont(aDefFont, SC_AUTOCOL_BLACK, pVirtWindow); // font color doesn't matter here
pVirtWindow->SetFont(aDefFont);
nWindowWidth = pVirtWindow->GetTextWidth(aTestString);
- nWindowWidth = static_cast<long>( nWindowWidth / ScGlobal::nScreenPPTX * HMM_PER_TWIPS );
+ nWindowWidth = static_cast<tools::Long>( nWindowWidth / ScGlobal::nScreenPPTX * HMM_PER_TWIPS );
if (nPrinterWidth && nWindowWidth)
m_nPrtToScreenFactor = nPrinterWidth / static_cast<double>(nWindowWidth);
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index d8ed50e85f3f..c2d1c5047794 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -1651,9 +1651,9 @@ bool ScDocShell::AdjustPrintZoom( const ScRange& rRange )
sal_uInt16 nNewScale = nOldScale;
- long nBlkTwipsX = 0;
+ tools::Long nBlkTwipsX = 0;
if (bHeaders)
- nBlkTwipsX += long(PRINT_HEADER_WIDTH);
+ nBlkTwipsX += tools::Long(PRINT_HEADER_WIDTH);
SCCOL nStartCol = rRange.aStart.Col();
SCCOL nEndCol = rRange.aEnd.Col();
if ( pRepeatCol && nStartCol >= pRepeatCol->aStart.Col() )
@@ -1669,9 +1669,9 @@ bool ScDocShell::AdjustPrintZoom( const ScRange& rRange )
nBlkTwipsX += m_aDocument.GetColWidth( i, nTab );
}
- long nBlkTwipsY = 0;
+ tools::Long nBlkTwipsY = 0;
if (bHeaders)
- nBlkTwipsY += long(PRINT_HEADER_HEIGHT);
+ nBlkTwipsY += tools::Long(PRINT_HEADER_HEIGHT);
SCROW nStartRow = rRange.aStart.Row();
SCROW nEndRow = rRange.aEnd.Row();
if ( pRepeatRow && nStartRow >= pRepeatRow->aStart.Row() )
@@ -1684,7 +1684,7 @@ bool ScDocShell::AdjustPrintZoom( const ScRange& rRange )
nBlkTwipsY += m_aDocument.GetRowHeight( nStartRow, nEndRow, nTab );
Size aPhysPage;
- long nHdr, nFtr;
+ tools::Long nHdr, nFtr;
ScPrintFunc aOldPrFunc( this, GetPrinter(), nTab );
aOldPrFunc.GetScaleData( aPhysPage, nHdr, nFtr );
nBlkTwipsY += nHdr + nFtr;
@@ -1694,11 +1694,11 @@ bool ScDocShell::AdjustPrintZoom( const ScRange& rRange )
if ( nBlkTwipsY == 0 )
nBlkTwipsY = 1;
- long nNeeded = std::min( aPhysPage.Width() * 100 / nBlkTwipsX,
+ tools::Long nNeeded = std::min( aPhysPage.Width() * 100 / nBlkTwipsX,
aPhysPage.Height() * 100 / nBlkTwipsY );
if ( nNeeded < ZOOM_MIN )
nNeeded = ZOOM_MIN; // boundary
- if ( nNeeded < static_cast<long>(nNewScale) )
+ if ( nNeeded < static_cast<tools::Long>(nNewScale) )
nNewScale = static_cast<sal_uInt16>(nNeeded);
bChange = ( nNewScale != nOldScale || nOldPages != 0 );
@@ -2171,8 +2171,8 @@ tools::Rectangle ScDocShell::GetVisArea( sal_uInt16 nAspect ) const
const_cast<ScDocShell*>(this)->m_aDocument.SetVisibleTab(nVisTab);
}
Size aSize = m_aDocument.GetPageSize(nVisTab);
- const long SC_PREVIEW_SIZE_X = 10000;
- const long SC_PREVIEW_SIZE_Y = 12400;
+ const tools::Long SC_PREVIEW_SIZE_X = 10000;
+ const tools::Long SC_PREVIEW_SIZE_Y = 12400;
tools::Rectangle aArea( 0,0, SC_PREVIEW_SIZE_X, SC_PREVIEW_SIZE_Y);
if (aSize.Width() > aSize.Height())
{
@@ -2217,14 +2217,14 @@ tools::Rectangle ScDocShell::GetVisArea( sal_uInt16 nAspect ) const
namespace {
[[nodiscard]]
-long SnapHorizontal( const ScDocument& rDoc, SCTAB nTab, long nVal, SCCOL& rStartCol )
+tools::Long SnapHorizontal( const ScDocument& rDoc, SCTAB nTab, tools::Long nVal, SCCOL& rStartCol )
{
SCCOL nCol = 0;
- long nTwips = static_cast<long>(nVal / HMM_PER_TWIPS);
- long nSnap = 0;
+ tools::Long nTwips = static_cast<tools::Long>(nVal / HMM_PER_TWIPS);
+ tools::Long nSnap = 0;
while ( nCol<rDoc.MaxCol() )
{
- long nAdd = rDoc.GetColWidth(nCol, nTab);
+ tools::Long nAdd = rDoc.GetColWidth(nCol, nTab);
if ( nSnap + nAdd/2 < nTwips || nCol < rStartCol )
{
nSnap += nAdd;
@@ -2233,17 +2233,17 @@ long SnapHorizontal( const ScDocument& rDoc, SCTAB nTab, long nVal, SCCOL& rStar
else
break;
}
- nVal = static_cast<long>( nSnap * HMM_PER_TWIPS );
+ nVal = static_cast<tools::Long>( nSnap * HMM_PER_TWIPS );
rStartCol = nCol;
return nVal;
}
[[nodiscard]]
-long SnapVertical( const ScDocument& rDoc, SCTAB nTab, long nVal, SCROW& rStartRow )
+tools::Long SnapVertical( const ScDocument& rDoc, SCTAB nTab, tools::Long nVal, SCROW& rStartRow )
{
SCROW nRow = 0;
- long nTwips = static_cast<long>(nVal / HMM_PER_TWIPS);
- long nSnap = 0;
+ tools::Long nTwips = static_cast<tools::Long>(nVal / HMM_PER_TWIPS);
+ tools::Long nSnap = 0;
bool bFound = false;
for (SCROW i = nRow; i <= rDoc.MaxRow(); ++i)
@@ -2256,7 +2256,7 @@ long SnapVertical( const ScDocument& rDoc, SCTAB nTab, long nVal, SCROW& rStartR
}
nRow = i;
- long nAdd = rDoc.GetRowHeight(i, nTab);
+ tools::Long nAdd = rDoc.GetRowHeight(i, nTab);
if ( nSnap + nAdd/2 < nTwips || nRow < rStartRow )
{
nSnap += nAdd;
@@ -2271,7 +2271,7 @@ long SnapVertical( const ScDocument& rDoc, SCTAB nTab, long nVal, SCROW& rStartR
if (!bFound)
nRow = rDoc.MaxRow(); // all hidden down to the bottom
- nVal = static_cast<long>( nSnap * HMM_PER_TWIPS );
+ nVal = static_cast<tools::Long>( nSnap * HMM_PER_TWIPS );
rStartRow = nRow;
return nVal;
}
@@ -2281,24 +2281,24 @@ long SnapVertical( const ScDocument& rDoc, SCTAB nTab, long nVal, SCROW& rStartR
void ScDocShell::SnapVisArea( tools::Rectangle& rRect ) const
{
SCTAB nTab = m_aDocument.GetVisibleTab();
- long nOrigTop = rRect.Top();
- long nOrigLeft = rRect.Left();
+ tools::Long nOrigTop = rRect.Top();
+ tools::Long nOrigLeft = rRect.Left();
bool bNegativePage = m_aDocument.IsNegativePage( nTab );
if ( bNegativePage )
ScDrawLayer::MirrorRectRTL( rRect ); // calculate with positive (LTR) values
SCCOL nCol = m_aDocument.GetPosLeft();
- long nSetLeft = SnapHorizontal( m_aDocument, nTab, rRect.Left(), nCol );
+ tools::Long nSetLeft = SnapHorizontal( m_aDocument, nTab, rRect.Left(), nCol );
rRect.SetLeft( nSetLeft );
++nCol; // at least one column
- long nCorrectionLeft = (nOrigLeft == 0 && nCol > 0) ? nSetLeft : 0; // initial correction
+ tools::Long nCorrectionLeft = (nOrigLeft == 0 && nCol > 0) ? nSetLeft : 0; // initial correction
rRect.SetRight( SnapHorizontal( m_aDocument, nTab, rRect.Right() + nCorrectionLeft, nCol ));
SCROW nRow = m_aDocument.GetPosTop();
- long nSetTop = SnapVertical( m_aDocument, nTab, rRect.Top(), nRow );
+ tools::Long nSetTop = SnapVertical( m_aDocument, nTab, rRect.Top(), nRow );
rRect.SetTop( nSetTop );
++nRow; // at least one row
- long nCorrectionTop = (nOrigTop == 0 && nRow > 0) ? nSetTop : 0; // initial correction
+ tools::Long nCorrectionTop = (nOrigTop == 0 && nRow > 0) ? nSetTop : 0; // initial correction
rRect.SetBottom( SnapVertical( m_aDocument, nTab, rRect.Bottom() + nCorrectionTop, nRow ));
if ( bNegativePage )
@@ -2501,7 +2501,7 @@ void ScDocShell::LOKCommentNotify(LOKCommentNotificationType nType, const ScDocu
if (bInPrintTwips)
{
Point aTopLeft = pViewData->GetPrintTwipsPos(rPos.Col(), rPos.Row());
- long nSizeX, nSizeY;
+ tools::Long nSizeX, nSizeY;
pViewData->GetMergeSizePrintTwips(rPos.Col(), rPos.Row(), nSizeX, nSizeY);
aRectString = tools::Rectangle(aTopLeft, Size(nSizeX - 1, nSizeY - 1)).toString();
}
@@ -2509,7 +2509,7 @@ void ScDocShell::LOKCommentNotify(LOKCommentNotificationType nType, const ScDocu
{
Point aTopLeft = pViewData->GetScrPos(rPos.Col(), rPos.Row(),
pViewData->GetActivePart(), true);
- long nSizeXPix, nSizeYPix;
+ tools::Long nSizeXPix, nSizeYPix;
pViewData->GetMergeSizePixel(rPos.Col(), rPos.Row(), nSizeXPix, nSizeYPix);
const double fPPTX = pViewData->GetPPTX();
const double fPPTY = pViewData->GetPPTY();
diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx
index cbdc901fa45c..85e620227705 100644
--- a/sc/source/ui/docshell/docsh5.cxx
+++ b/sc/source/ui/docshell/docsh5.cxx
@@ -295,7 +295,7 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe
pUndoColl.reset( new ScDBCollection( *pColl ) ); // Undo for import range
OUString aImport = ScResId( STR_DBNAME_IMPORT );
- long nCount = 0;
+ tools::Long nCount = 0;
const ScDBData* pDummy = nullptr;
ScDBCollection::NamedDBs& rDBs = pColl->getNamedDBs();
OUString aNewName;
diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx
index f3b1a90b1bce..ac313715160d 100644
--- a/sc/source/ui/docshell/docsh6.cxx
+++ b/sc/source/ui/docshell/docsh6.cxx
@@ -85,15 +85,15 @@ void ScDocShell::SetVisAreaOrSize( const tools::Rectangle& rVisArea )
// Move the VisArea, otherwise only the upper left position would
// be changed in SnapVisArea, and the size would be wrong.
- Point aNewPos( 0, std::max( aArea.Top(), long(0) ) );
+ Point aNewPos( 0, std::max( aArea.Top(), tools::Long(0) ) );
if ( bNegativePage )
{
- aNewPos.setX( std::min( aArea.Right(), long(0) ) );
+ aNewPos.setX( std::min( aArea.Right(), tools::Long(0) ) );
lcl_SetTopRight( aArea, aNewPos );
}
else
{
- aNewPos.setX( std::max( aArea.Left(), long(0) ) );
+ aNewPos.setX( std::max( aArea.Left(), tools::Long(0) ) );
aArea.SetPos( aNewPos );
}
}
diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx
index 9b5ba3f8ffdf..9afb24ebc84c 100644
--- a/sc/source/ui/docshell/docsh8.cxx
+++ b/sc/source/ui/docshell/docsh8.cxx
@@ -286,8 +286,8 @@ ErrCode ScDocShell::DBaseImport( const OUString& rFullFileName, rtl_TextEncoding
try
{
- long i;
- long nColCount = 0;
+ tools::Long i;
+ tools::Long nColCount = 0;
OUString aTabName;
uno::Reference<sdbc::XDriverManager2> xDrvMan;
uno::Reference<sdbc::XConnection> xConnection;
@@ -364,8 +364,8 @@ ErrCode ScDocShell::DBaseImport( const OUString& rFullFileName, rtl_TextEncoding
break;
case sdbc::DataType::DECIMAL:
{
- long nPrec = xMeta->getPrecision( i+1 );
- long nScale = xMeta->getScale( i+1 );
+ tools::Long nPrec = xMeta->getPrecision( i+1 );
+ tools::Long nScale = xMeta->getScale( i+1 );
aHeader += ",N," +
OUString::number(
SvDbaseConverter::ConvertPrecisionToDbase(
@@ -457,7 +457,7 @@ void lcl_GetColumnTypes(
typedef std::unordered_set<OUString> StrSetType;
StrSetType aFieldNames;
- long nField = 0;
+ tools::Long nField = 0;
SCROW nFirstDataRow = ( bHasFieldNames ? nFirstRow + 1 : nFirstRow );
for ( SCCOL nCol = nFirstCol; nCol <= nLastCol; nCol++ )
{
@@ -762,7 +762,7 @@ ErrCode ScDocShell::DBaseExport( const OUString& rFullFileName, rtl_TextEncoding
bHasFieldNames = false;
}
- long nColCount = nLastCol - nFirstCol + 1;
+ tools::Long nColCount = nLastCol - nFirstCol + 1;
uno::Sequence<OUString> aColNames( nColCount );
uno::Sequence<sal_Int32> aColTypes( nColCount );
uno::Sequence<sal_Int32> aColLengths( nColCount );
@@ -838,7 +838,7 @@ ErrCode ScDocShell::DBaseExport( const OUString& rFullFileName, rtl_TextEncoding
const sal_Int32* pColTypes = aColTypes.getConstArray();
const sal_Int32* pColLengths = aColLengths.getConstArray();
const sal_Int32* pColScales = aColScales.getConstArray();
- long nCol;
+ tools::Long nCol;
for (nCol=0; nCol<nColCount; nCol++)
{
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index e13fdb78e459..e737373cae7b 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -1322,7 +1322,7 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm )
sal_uInt16 nInfoCount = pExtOptions->GetInfoCount();
const sal_Int32* pColStart = pExtOptions->GetColStart();
const sal_uInt8* pColFormat = pExtOptions->GetColFormat();
- long nSkipLines = pExtOptions->GetStartRow();
+ tools::Long nSkipLines = pExtOptions->GetStartRow();
LanguageType eDocLang = pExtOptions->GetLanguage();
SvNumberFormatter aNumFormatter( comphelper::getProcessComponentContext(), eDocLang);
diff --git a/sc/source/ui/docshell/pagedata.cxx b/sc/source/ui/docshell/pagedata.cxx
index a7560480ed68..4ab70ed9fea7 100644
--- a/sc/source/ui/docshell/pagedata.cxx
+++ b/sc/source/ui/docshell/pagedata.cxx
@@ -88,10 +88,10 @@ void ScPageBreakData::AddPages()
{
if ( nUsed > 1 )
{
- long nPage = pData[0].GetFirstPage();
+ tools::Long nPage = pData[0].GetFirstPage();
for (size_t i=0; i+1<nUsed; i++)
{
- nPage += static_cast<long>(pData[i].GetPagesX())*pData[i].GetPagesY();
+ nPage += static_cast<tools::Long>(pData[i].GetPagesX())*pData[i].GetPagesY();
pData[i+1].SetFirstPage( nPage );
}
}
diff --git a/sc/source/ui/drawfunc/fuconrec.cxx b/sc/source/ui/drawfunc/fuconrec.cxx
index cc0aaa0f8058..edb82a66d32a 100644
--- a/sc/source/ui/drawfunc/fuconrec.cxx
+++ b/sc/source/ui/drawfunc/fuconrec.cxx
@@ -63,8 +63,8 @@ namespace {
if( pLineEndList.is() )
{
OUString aArrowName( SvxResId(pResId) );
- long nCount = pLineEndList->Count();
- long nIndex;
+ tools::Long nCount = pLineEndList->Count();
+ tools::Long nIndex;
for( nIndex = 0; nIndex < nCount; nIndex++ )
{
const XLineEndEntry* pEntry = pLineEndList->GetLineEnd(nIndex);
@@ -255,12 +255,12 @@ void FuConstRectangle::SetLineEnds(SfxItemSet& rAttr, const SdrObject& rObj, sal
}
SfxItemSet aSet( rModel.GetItemPool() );
- long nWidth = 200; // (1/100th mm)
+ tools::Long nWidth = 200; // (1/100th mm)
// determine line width and calculate with it the line end width
if( aSet.GetItemState( XATTR_LINEWIDTH ) != SfxItemState::DONTCARE )
{
- long nValue = aSet.Get( XATTR_LINEWIDTH ).GetValue();
+ tools::Long nValue = aSet.Get( XATTR_LINEWIDTH ).GetValue();
if( nValue > 0 )
nWidth = nValue * 3;
}
diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx
index 701790120bd6..d71e2ebcf671 100644
--- a/sc/source/ui/drawfunc/fudraw.cxx
+++ b/sc/source/ui/drawfunc/fudraw.cxx
@@ -405,8 +405,8 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt)
break;
}
- long nX = 0;
- long nY = 0;
+ tools::Long nX = 0;
+ tools::Long nY = 0;
sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode();
if (nCode == KEY_UP)
diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx
index bd2bbeb3b3ad..617532f7e434 100644
--- a/sc/source/ui/drawfunc/fuins1.cxx
+++ b/sc/source/ui/drawfunc/fuins1.cxx
@@ -76,12 +76,12 @@ void ScLimitSizeOnDrawPage( Size& rSize, Point& rPos, const Size& rPage )
if ( fX < fY )
{
rSize.setWidth( aPageSize.Width() );
- rSize.setHeight( static_cast<long>( rSize.Height() * fX ) );
+ rSize.setHeight( static_cast<tools::Long>( rSize.Height() * fX ) );
}
else
{
rSize.setHeight( aPageSize.Height() );
- rSize.setWidth( static_cast<long>( rSize.Width() * fY ) );
+ rSize.setWidth( static_cast<tools::Long>( rSize.Width() * fY ) );
}
if (!rSize.Width())
diff --git a/sc/source/ui/drawfunc/fusel2.cxx b/sc/source/ui/drawfunc/fusel2.cxx
index 12024f29da62..cd84fbca9b93 100644
--- a/sc/source/ui/drawfunc/fusel2.cxx
+++ b/sc/source/ui/drawfunc/fusel2.cxx
@@ -32,11 +32,11 @@
#include <drawview.hxx>
#include <svx/sdrhittesthelper.hxx>
-static long Diff( const Point& rP1, const Point& rP2 )
+static tools::Long Diff( const Point& rP1, const Point& rP2 )
{
- long nX = rP1.X() - rP2.X();
+ tools::Long nX = rP1.X() - rP2.X();
if (nX<0) nX = -nX;
- long nY = rP1.Y() - rP2.Y();
+ tools::Long nY = rP1.Y() - rP2.Y();
if (nY<0) nY = -nY;
return nX+nY;
}
diff --git a/sc/source/ui/inc/asciiopt.hxx b/sc/source/ui/inc/asciiopt.hxx
index 3c73ee25327b..ad8b91981792 100644
--- a/sc/source/ui/inc/asciiopt.hxx
+++ b/sc/source/ui/inc/asciiopt.hxx
@@ -41,7 +41,7 @@ private:
rtl_TextEncoding eCharSet;
LanguageType eLang;
bool bCharSetSystem;
- long nStartRow;
+ tools::Long nStartRow;
std::vector<sal_Int32> mvColStart;
std::vector<sal_uInt8> mvColFormat;
@@ -65,7 +65,7 @@ public:
sal_uInt16 GetInfoCount() const { return mvColStart.size(); }
const sal_Int32* GetColStart() const { return mvColStart.data(); }
const sal_uInt8* GetColFormat() const { return mvColFormat.data(); }
- long GetStartRow() const { return nStartRow; }
+ tools::Long GetStartRow() const { return nStartRow; }
LanguageType GetLanguage() const { return eLang; }
void SetCharSet( rtl_TextEncoding eNew ) { eCharSet = eNew; }
@@ -78,7 +78,7 @@ public:
void SetDetectSpecialNumber(bool bSet) { bDetectSpecialNumber = bSet; }
void SetSkipEmptyCells(bool bSet) { bSkipEmptyCells = bSet; }
void SetTextSep( sal_Unicode c ) { cTextSep = c; }
- void SetStartRow( long nRow) { nStartRow= nRow; }
+ void SetStartRow( tools::Long nRow) { nStartRow= nRow; }
void SetLanguage(LanguageType e) { eLang = e; }
void SetColumnInfo( const ScCsvExpDataVec& rDataVec );
diff --git a/sc/source/ui/inc/autofmt.hxx b/sc/source/ui/inc/autofmt.hxx
index 682aa019fecc..37de70ac9d3b 100644
--- a/sc/source/ui/inc/autofmt.hxx
+++ b/sc/source/ui/inc/autofmt.hxx
@@ -55,10 +55,10 @@ private:
svx::frame::Array maArray; /// Implementation to draw the frame borders.
bool mbRTL;
Size aPrvSize;
- long mnLabelColWidth;
- long mnDataColWidth1;
- long mnDataColWidth2;
- long mnRowHeight;
+ tools::Long mnLabelColWidth;
+ tools::Long mnDataColWidth1;
+ tools::Long mnDataColWidth2;
+ tools::Long mnRowHeight;
const OUString aStrJan;
const OUString aStrFeb;
const OUString aStrMar;
diff --git a/sc/source/ui/inc/colrowba.hxx b/sc/source/ui/inc/colrowba.hxx
index bfbb5cb7bb58..dae356f35bbb 100644
--- a/sc/source/ui/inc/colrowba.hxx
+++ b/sc/source/ui/inc/colrowba.hxx
@@ -52,9 +52,9 @@ public:
virtual bool IsDisabled() const override;
virtual bool ResizeAllowed() const override;
- virtual void DrawInvert( long nDragPos ) override;
+ virtual void DrawInvert( tools::Long nDragPos ) override;
- virtual OUString GetDragHelp( long nVal ) override;
+ virtual OUString GetDragHelp( tools::Long nVal ) override;
};
class ScRowBar : public ScHeaderControl
@@ -83,9 +83,9 @@ public:
virtual bool IsDisabled() const override;
virtual bool ResizeAllowed() const override;
- virtual void DrawInvert( long nDragPos ) override;
+ virtual void DrawInvert( tools::Long nDragPos ) override;
- virtual OUString GetDragHelp( long nVal ) override;
+ virtual OUString GetDragHelp( tools::Long nVal ) override;
};
#endif
diff --git a/sc/source/ui/inc/dbfunc.hxx b/sc/source/ui/inc/dbfunc.hxx
index 3ebff62821fd..f7cd3d126653 100644
--- a/sc/source/ui/inc/dbfunc.hxx
+++ b/sc/source/ui/inc/dbfunc.hxx
@@ -35,7 +35,7 @@ struct ScSubTotalParam;
class SAL_DLLPUBLIC_RTTI ScDBFunc : public ScViewFunc
{
private:
- void GetSelectedMemberList(ScDPUniqueStringSet& rEntries, long& rDimension);
+ void GetSelectedMemberList(ScDPUniqueStringSet& rEntries, tools::Long& rDimension);
public:
ScDBFunc( vcl::Window* pParent, ScDocShell& rDocSh, ScTabViewShell* pViewShell );
@@ -81,7 +81,7 @@ public:
void UngroupDataPilot();
void DataPilotInput( const ScAddress& rPos, const OUString& rString );
- void DataPilotSort(ScDPObject* pDPObject, long nDimIndex, bool bAscending, const sal_uInt16* pUserListId = nullptr);
+ void DataPilotSort(ScDPObject* pDPObject, tools::Long nDimIndex, bool bAscending, const sal_uInt16* pUserListId = nullptr);
bool DataPilotMove( const ScRange& rSource, const ScAddress& rDest );
bool HasSelectionForDrillDown( css::sheet::DataPilotFieldOrientation& rOrientation );
diff --git a/sc/source/ui/inc/gridmerg.hxx b/sc/source/ui/inc/gridmerg.hxx
index a6c484afa7f3..82fec233d038 100644
--- a/sc/source/ui/inc/gridmerg.hxx
+++ b/sc/source/ui/inc/gridmerg.hxx
@@ -26,24 +26,24 @@ class ScGridMerger
{
private:
VclPtr<OutputDevice> pDev;
- long nOneX;
- long nOneY;
- long nFixStart;
- long nFixEnd;
- long nVarStart;
- long nVarDiff;
- long nCount;
+ tools::Long nOneX;
+ tools::Long nOneY;
+ tools::Long nFixStart;
+ tools::Long nFixEnd;
+ tools::Long nVarStart;
+ tools::Long nVarDiff;
+ tools::Long nCount;
bool bVertical;
bool bOptimize;
- void AddLine( long nStart, long nEnd, long nPos );
+ void AddLine( tools::Long nStart, tools::Long nEnd, tools::Long nPos );
public:
- ScGridMerger( OutputDevice* pOutDev, long nOnePixelX, long nOnePixelY );
+ ScGridMerger( OutputDevice* pOutDev, tools::Long nOnePixelX, tools::Long nOnePixelY );
~ScGridMerger();
- void AddHorLine(bool bWorksInPixels, long nX1, long nX2, long nY, bool bDashed = false);
- void AddVerLine(bool bWorksInPixels, long nX, long nY1, long nY2, bool bDashed = false);
+ void AddHorLine(bool bWorksInPixels, tools::Long nX1, tools::Long nX2, tools::Long nY, bool bDashed = false);
+ void AddVerLine(bool bWorksInPixels, tools::Long nX, tools::Long nY1, tools::Long nY2, bool bDashed = false);
void Flush();
};
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index 8a5a0a751f2f..74b335653c54 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -169,7 +169,7 @@ class SAL_DLLPUBLIC_RTTI ScGridWindow : public vcl::Window, public DropTargetHel
enum class ScNestedButtonState { NONE, Down, Up };
ScNestedButtonState nNestedButtonState; // track nested button up/down calls
- long nDPField;
+ tools::Long nDPField;
ScDPObject* pDragDPObj; //! name?
sal_uInt16 nRFIndex;
@@ -349,7 +349,7 @@ public:
void PaintTile( VirtualDevice& rDevice,
int nOutputWidth, int nOutputHeight,
int nTilePosX, int nTilePosY,
- long nTileWidth, long nTileHeight );
+ tools::Long nTileWidth, tools::Long nTileHeight );
/// @see Window::LogicInvalidate().
void LogicInvalidate(const tools::Rectangle* pRectangle) override;
@@ -374,7 +374,7 @@ public:
void MoveMouseStatus( ScGridWindow &rDestWin );
- void ScrollPixel( long nDifX, long nDifY );
+ void ScrollPixel( tools::Long nDifX, tools::Long nDifY );
void UpdateEditViewPos();
void UpdateFormulas(SCCOL nX1 = -1, SCROW nY1 = -1, SCCOL nX2 = -1, SCROW nY2 = -1);
@@ -394,7 +394,7 @@ public:
css::sheet::DataPilotFieldOrientation GetDPFieldOrientation( SCCOL nCol, SCROW nRow ) const;
void DPLaunchFieldPopupMenu(const Point& rScrPos, const Size& rScrSize,
- long nDimIndex, ScDPObject* pDPObj);
+ tools::Long nDimIndex, ScDPObject* pDPObj);
void DrawButtons(SCCOL nX1, SCCOL nX2, const ScTableInfo& rTabInfo, OutputDevice* pContentDev);
diff --git a/sc/source/ui/inc/hdrcont.hxx b/sc/source/ui/inc/hdrcont.hxx
index 08be7eba5010..3bb0e4223ce5 100644
--- a/sc/source/ui/inc/hdrcont.hxx
+++ b/sc/source/ui/inc/hdrcont.hxx
@@ -42,9 +42,9 @@ private:
bool bVertical; // Vertical = Row header
- long nWidth;
- long nSmallWidth;
- long nBigWidth;
+ tools::Long nWidth;
+ tools::Long nSmallWidth;
+ tools::Long nBigWidth;
SCCOLROW nSize;
@@ -54,8 +54,8 @@ private:
bool bDragging; // Resizing
SCCOLROW nDragNo;
- long nDragStart;
- long nDragPos;
+ tools::Long nDragStart;
+ tools::Long nDragPos;
void* nTipVisible;
bool bDragMoved;
@@ -63,7 +63,7 @@ private:
bool bInRefMode;
- long GetScrPos( SCCOLROW nEntryNo ) const;
+ tools::Long GetScrPos( SCCOLROW nEntryNo ) const;
SCCOLROW GetMousePos( const MouseEvent& rMEvt, bool& rBorder ) const;
bool IsSelectionAllowed(SCCOLROW nPos) const;
void ShowDragHelp();
@@ -101,9 +101,9 @@ protected:
virtual void SelectWindow();
virtual bool IsDisabled() const;
virtual bool ResizeAllowed() const;
- virtual OUString GetDragHelp( long nVal );
+ virtual OUString GetDragHelp( tools::Long nVal );
- virtual void DrawInvert( long nDragPos );
+ virtual void DrawInvert( tools::Long nDragPos );
virtual void Command( const CommandEvent& rCEvt ) override;
public:
@@ -117,10 +117,10 @@ public:
void SetMark( bool bNewSet, SCCOLROW nNewStart, SCCOLROW nNewEnd );
- long GetWidth() const { return nWidth; }
- long GetSmallWidth() const { return nSmallWidth; }
- long GetBigWidth() const { return nBigWidth; }
- void SetWidth( long nNew );
+ tools::Long GetWidth() const { return nWidth; }
+ tools::Long GetSmallWidth() const { return nSmallWidth; }
+ tools::Long GetBigWidth() const { return nBigWidth; }
+ void SetWidth( tools::Long nNew );
void GetMarkRange(SCCOLROW& rStart, SCCOLROW& rEnd) const;
};
diff --git a/sc/source/ui/inc/inputhdl.hxx b/sc/source/ui/inc/inputhdl.hxx
index b18e111af547..c99589fd70dc 100644
--- a/sc/source/ui/inc/inputhdl.hxx
+++ b/sc/source/ui/inc/inputhdl.hxx
@@ -285,8 +285,8 @@ public:
static void SetAutoComplete(bool bSet) { bAutoComplete = bSet; }
static ReferenceMark GetReferenceMark( const ScViewData& rViewData, ScDocShell* pDocSh,
- long nX1, long nX2, long nY1, long nY2,
- long nTab, const Color& rColor );
+ tools::Long nX1, tools::Long nX2, tools::Long nY1, tools::Long nY2,
+ tools::Long nTab, const Color& rColor );
void LOKPasteFunctionData(const OUString& rFunctionName);
};
diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx
index ccc07b428da3..16468109d435 100644
--- a/sc/source/ui/inc/inputwin.hxx
+++ b/sc/source/ui/inc/inputwin.hxx
@@ -64,7 +64,7 @@ public:
virtual void SetFormulaMode( bool bSet ) = 0;
virtual bool IsInputActive() = 0;
virtual void TextGrabFocus() = 0;
- virtual long GetNumLines() const = 0;
+ virtual tools::Long GetNumLines() const = 0;
virtual ~ScTextWndBase() {}
};
@@ -105,12 +105,12 @@ public:
virtual void Resize() override;
- int GetPixelHeightForLines(long nLines);
+ int GetPixelHeightForLines(tools::Long nLines);
int GetEditEngTxtHeight() const;
- virtual long GetNumLines() const override { return mnLines; }
- void SetNumLines(long nLines);
- long GetLastNumExpandedLines() const { return mnLastExpandedLines; }
+ virtual tools::Long GetNumLines() const override { return mnLines; }
+ void SetNumLines(tools::Long nLines);
+ tools::Long GetLastNumExpandedLines() const { return mnLastExpandedLines; }
void DoScroll();
@@ -158,8 +158,8 @@ private:
ScTabViewShell* mpViewShell;
ScTextWndGroup& mrGroupBar;
- long mnLines;
- long mnLastExpandedLines;
+ tools::Long mnLines;
+ tools::Long mnLastExpandedLines;
bool mbInvalidate;
};
@@ -209,9 +209,9 @@ public:
virtual void InsertAccessibleTextData(ScAccessibleEditLineTextData& rTextData) override;
virtual EditView* GetEditView() override;
- long GetLastNumExpandedLines() const;
- virtual long GetNumLines() const override;
- int GetPixelHeightForLines(long nLines);
+ tools::Long GetLastNumExpandedLines() const;
+ virtual tools::Long GetNumLines() const override;
+ int GetPixelHeightForLines(tools::Long nLines);
weld::ScrolledWindow& GetScrollWin();
virtual const OUString& GetTextString() const override;
virtual bool HasEditView() const override;
@@ -219,7 +219,7 @@ public:
virtual void MakeDialogEditView() override;
virtual void RemoveAccessibleTextData(ScAccessibleEditLineTextData& rTextData) override;
void SetScrollPolicy();
- void SetNumLines(long nLines);
+ void SetNumLines(tools::Long nLines);
virtual void SetFormulaMode(bool bSet) override;
virtual void SetTextString(const OUString& rString) override;
virtual void StartEditEngine() override;
@@ -261,8 +261,8 @@ public:
bool IsInputActive() override;
void IncrementVerticalSize();
void DecrementVerticalSize();
- virtual long GetNumLines() const override { return mxTextWndGroup->GetNumLines(); }
- long GetVertOffset() const { return mnVertOffset; }
+ virtual tools::Long GetNumLines() const override { return mxTextWndGroup->GetNumLines(); }
+ tools::Long GetVertOffset() const { return mnVertOffset; }
int GetPixelHeightForLines() const
{
@@ -278,7 +278,7 @@ private:
std::unique_ptr<ScTextWndGroup> mxTextWndGroup;
std::unique_ptr<weld::Button> mxButtonUp;
std::unique_ptr<weld::Button> mxButtonDown;
- long mnVertOffset;
+ tools::Long mnVertOffset;
DECL_LINK(ClickHdl, weld::Button&, void);
};
@@ -344,7 +344,7 @@ private:
VclPtr<ScInputBarGroup> mxTextWindow;
ScInputHandler* pInputHdl;
ScTabViewShell* mpViewShell;
- long mnMaxY;
+ tools::Long mnMaxY;
bool bIsOkCancelMode;
bool bInResize;
};
diff --git a/sc/source/ui/inc/mtrindlg.hxx b/sc/source/ui/inc/mtrindlg.hxx
index 59b41f225d97..55596d85c4fe 100644
--- a/sc/source/ui/inc/mtrindlg.hxx
+++ b/sc/source/ui/inc/mtrindlg.hxx
@@ -27,12 +27,12 @@ class ScMetricInputDlg : public weld::GenericDialogController
public:
ScMetricInputDlg( weld::Window* pParent,
const OString& sDialogName,
- long nCurrent,
- long nDefault,
+ tools::Long nCurrent,
+ tools::Long nDefault,
FieldUnit eFUnit,
sal_uInt16 nDecimals,
- long nMaximum,
- long nMinimum);
+ tools::Long nMaximum,
+ tools::Long nMinimum);
virtual ~ScMetricInputDlg() override;
int GetInputValue() const;
diff --git a/sc/source/ui/inc/olinewin.hxx b/sc/source/ui/inc/olinewin.hxx
index 9c8e79672727..9a56152ed6cd 100644
--- a/sc/source/ui/inc/olinewin.hxx
+++ b/sc/source/ui/inc/olinewin.hxx
@@ -40,10 +40,10 @@ private:
bool mbMirrorLevels; /// true = mirror the order of levels, including the border
Color maLineColor; /// Line color for expanded groups.
- long mnHeaderSize; /// Size of the header area in entry direction.
- long mnHeaderPos; /// Position of the header area in entry direction.
- long mnMainFirstPos; /// First position of main area in entry direction.
- long mnMainLastPos; /// Last position of main area in entry direction.
+ tools::Long mnHeaderSize; /// Size of the header area in entry direction.
+ tools::Long mnHeaderPos; /// Position of the header area in entry direction.
+ tools::Long mnMainFirstPos; /// First position of main area in entry direction.
+ tools::Long mnMainLastPos; /// Last position of main area in entry direction.
size_t mnMTLevel; /// Mouse tracking: Level of active button.
size_t mnMTEntry; /// Mouse tracking: Entry index of active button.
@@ -65,12 +65,12 @@ public:
virtual void dispose() override;
/** Sets the size of the header area (width/height dep. on window type). */
- void SetHeaderSize( long nNewSize );
+ void SetHeaderSize( tools::Long nNewSize );
/** Returns the width/height the window needs to show all levels. */
- long GetDepthSize() const;
+ tools::Long GetDepthSize() const;
/** Scrolls the window content by the specified amount of pixels. */
- void ScrollPixel( long nDiff );
+ void ScrollPixel( tools::Long nDiff );
using Window::ShowFocus;
@@ -97,33 +97,33 @@ private:
void GetVisibleRange( SCCOLROW& rnColRowStart, SCCOLROW& rnColRowEnd ) const;
/** Returns the point in the window of the specified position. */
- Point GetPoint( long nLevelPos, long nEntryPos ) const;
+ Point GetPoint( tools::Long nLevelPos, tools::Long nEntryPos ) const;
/** Returns the rectangle in the window of the specified position. */
tools::Rectangle GetRectangle(
- long nLevelStart, long nEntryStart,
- long nLevelEnd, long nEntryEnd ) const;
+ tools::Long nLevelStart, tools::Long nEntryStart,
+ tools::Long nLevelEnd, tools::Long nEntryEnd ) const;
/** Returns the window size for the level coordinate. */
- long GetOutputSizeLevel() const;
+ tools::Long GetOutputSizeLevel() const;
/** Returns the window size for the entry coordinate. */
- long GetOutputSizeEntry() const;
+ tools::Long GetOutputSizeEntry() const;
/** Returns the count of levels of the outline array. 0 means no outlines. */
size_t GetLevelCount() const;
/** Returns the pixel position of the specified level. */
- long GetLevelPos( size_t nLevel ) const;
+ tools::Long GetLevelPos( size_t nLevel ) const;
/** Returns the level of the passed pixel position. */
- size_t GetLevelFromPos( long nLevelPos ) const;
+ size_t GetLevelFromPos( tools::Long nLevelPos ) const;
/** Returns the start coordinate of the specified column/row in the window. */
- long GetColRowPos( SCCOLROW nColRowIndex ) const;
+ tools::Long GetColRowPos( SCCOLROW nColRowIndex ) const;
/** Returns the entry position of header images. */
- long GetHeaderEntryPos() const;
+ tools::Long GetHeaderEntryPos() const;
/** Calculates the coordinates the outline entry takes in the window.
@return false = no part of the group is visible (outside window or collapsed by parent group). */
bool GetEntryPos(
size_t nLevel, size_t nEntry,
- long& rnStartPos, long& rnEndPos, long& rnImagePos ) const;
+ tools::Long& rnStartPos, tools::Long& rnEndPos, tools::Long& rnImagePos ) const;
/** Calculates the absolute position of the image of the specified outline entry.
@param nLevel The level of the entry.
@param nEntry The entry index or SC_OL_HEADERENTRY for the header image.
@@ -187,14 +187,14 @@ private:
void SetEntryAreaClipRegion();
/** Converts coordinates to real window points and draws the line. */
void DrawLineRel(
- long nLevelStart, long nEntryStart,
- long nLevelEnd, long nEntryEnd );
+ tools::Long nLevelStart, tools::Long nEntryStart,
+ tools::Long nLevelEnd, tools::Long nEntryEnd );
/** Converts coordinates to real window points and draws the rectangle. */
void DrawRectRel(
- long nLevelStart, long nEntryStart,
- long nLevelEnd, long nEntryEnd );
+ tools::Long nLevelStart, tools::Long nEntryStart,
+ tools::Long nLevelEnd, tools::Long nEntryEnd );
/** Draws the specified image unpressed. */
- void DrawImageRel(long nLevelPos, long nEntryPos, const OUString& rId);
+ void DrawImageRel(tools::Long nLevelPos, tools::Long nEntryPos, const OUString& rId);
/** Draws a pressed or unpressed border. */
void DrawBorderRel(size_t nLevel, size_t nEntry, bool bPressed);
@@ -204,7 +204,7 @@ private:
void HideFocus();
/** Scrolls the specified range of the window in entry-relative direction. */
- void ScrollRel( long nEntryDiff, long nEntryStart, long nEntryEnd );
+ void ScrollRel( tools::Long nEntryDiff, tools::Long nEntryStart, tools::Long nEntryEnd );
protected:
virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
diff --git a/sc/source/ui/inc/optsolver.hxx b/sc/source/ui/inc/optsolver.hxx
index 313a7e23bdf6..ed9860e8b652 100644
--- a/sc/source/ui/inc/optsolver.hxx
+++ b/sc/source/ui/inc/optsolver.hxx
@@ -110,7 +110,7 @@ private:
bool mbDlgLostFocus;
std::vector<ScOptConditionRow> maConditions;
- long nScrollPos;
+ tools::Long nScrollPos;
css::uno::Sequence<OUString> maImplNames;
css::uno::Sequence<OUString> maDescriptions;
diff --git a/sc/source/ui/inc/output.hxx b/sc/source/ui/inc/output.hxx
index 7f84f00d4808..a5de8bbac213 100644
--- a/sc/source/ui/inc/output.hxx
+++ b/sc/source/ui/inc/output.hxx
@@ -60,11 +60,11 @@ typedef std::unique_ptr<ClearableClipRegion, o3tl::default_delete<ClearableClipR
/// Describes reference mark to be drawn, position & size in TWIPs
struct ReferenceMark {
- long nX;
- long nY;
- long nWidth;
- long nHeight;
- long nTab;
+ tools::Long nX;
+ tools::Long nY;
+ tools::Long nWidth;
+ tools::Long nHeight;
+ tools::Long nTab;
Color aColor;
ReferenceMark()
@@ -75,11 +75,11 @@ struct ReferenceMark {
, nTab( 0 )
, aColor( COL_AUTO ) {}
- ReferenceMark( long aX,
- long aY,
- long aWidth,
- long aHeight,
- long aTab,
+ ReferenceMark( tools::Long aX,
+ tools::Long aY,
+ tools::Long aWidth,
+ tools::Long aHeight,
+ tools::Long aTab,
const Color& rColor )
: nX( aX )
, nY( aY )
@@ -100,9 +100,9 @@ private:
{
tools::Rectangle maAlignRect;
tools::Rectangle maClipRect;
- long mnColWidth;
- long mnLeftClipLength; /// length of the string getting cut off on the left.
- long mnRightClipLength; /// length of the string getting cut off on the right.
+ tools::Long mnColWidth;
+ tools::Long mnLeftClipLength; /// length of the string getting cut off on the left.
+ tools::Long mnRightClipLength; /// length of the string getting cut off on the right.
bool mbLeftClip;
bool mbRightClip;
};
@@ -121,9 +121,9 @@ private:
SCCOL mnX;
SCCOL mnCellX;
SCROW mnCellY;
- long mnPosX;
- long mnPosY;
- long mnInitPosX;
+ tools::Long mnPosX;
+ tools::Long mnPosY;
+ tools::Long mnInitPosX;
bool mbBreak:1;
bool mbCellIsValue:1;
bool mbAsianVertical:1;
@@ -144,9 +144,9 @@ private:
bool readCellContent(const ScDocument* pDoc, bool bShowNullValues, bool bShowFormulas, bool bSyntaxMode, bool bUseStyleColor, bool bForceAutoColor, bool& rWrapFields);
void setPatternToEngine(bool bUseStyleColor);
- void calcMargins(long& rTop, long& rLeft, long& rBottom, long& rRight, double nPPTX, double nPPTY) const;
+ void calcMargins(tools::Long& rTop, tools::Long& rLeft, tools::Long& rBottom, tools::Long& rRight, double nPPTX, double nPPTY) const;
void calcPaperSize(Size& rPaperSize, const tools::Rectangle& rAlignRect, double nPPTX, double nPPTY) const;
- void getEngineSize(ScFieldEditEngine* pEngine, long& rWidth, long& rHeight) const;
+ void getEngineSize(ScFieldEditEngine* pEngine, tools::Long& rWidth, tools::Long& rHeight) const;
bool hasLineBreak() const;
bool isHyperlinkCell() const;
@@ -165,7 +165,7 @@ private:
* finished, this parameter will store the new
* position.
*/
- void calcStartPosForVertical(Point& rLogicStart, long nCellWidth, long nEngineWidth, long nTopM, const OutputDevice* pRefDevice);
+ void calcStartPosForVertical(Point& rLogicStart, tools::Long nCellWidth, tools::Long nEngineWidth, tools::Long nTopM, const OutputDevice* pRefDevice);
void setAlignmentToEngine();
bool adjustHorAlignment(ScFieldEditEngine* pEngine);
@@ -180,11 +180,11 @@ private:
SCSIZE nArrCount; // occupied lines in info block
ScDocument* mpDoc; // Document
SCTAB nTab; // sheet
- long nScrX; // Output Startpos. (Pixel)
- long nScrY;
- long nScrW; // Output size (Pixel)
- long nScrH;
- long nMirrorW; // Visible output width for mirroring (default: nScrW)
+ tools::Long nScrX; // Output Startpos. (Pixel)
+ tools::Long nScrY;
+ tools::Long nScrW; // Output size (Pixel)
+ tools::Long nScrH;
+ tools::Long nMirrorW; // Visible output width for mirroring (default: nScrW)
SCCOL nX1; // Start-/End coordinates
SCROW nY1; // ( incl. hidden )
SCCOL nX2;
@@ -246,17 +246,17 @@ private:
bool IsAvailable( SCCOL nX, SCROW nY );
- void GetOutputArea( SCCOL nX, SCSIZE nArrY, long nPosX, long nPosY,
- SCCOL nCellX, SCROW nCellY, long nNeeded,
+ void GetOutputArea( SCCOL nX, SCSIZE nArrY, tools::Long nPosX, tools::Long nPosY,
+ SCCOL nCellX, SCROW nCellY, tools::Long nNeeded,
const ScPatternAttr& rPattern,
sal_uInt16 nHorJustify, bool bCellIsValue,
bool bBreak, bool bOverwrite,
OutputAreaParam& rParam );
void ShrinkEditEngine( EditEngine& rEngine, const tools::Rectangle& rAlignRect,
- long nLeftM, long nTopM, long nRightM, long nBottomM,
- bool bWidth, SvxCellOrientation nOrient, long nAttrRotate, bool bPixelToLogic,
- long& rEngineWidth, long& rEngineHeight, long& rNeededPixel,
+ tools::Long nLeftM, tools::Long nTopM, tools::Long nRightM, tools::Long nBottomM,
+ bool bWidth, SvxCellOrientation nOrient, tools::Long nAttrRotate, bool bPixelToLogic,
+ tools::Long& rEngineWidth, tools::Long& rEngineHeight, tools::Long& rNeededPixel,
bool& rLeftClip, bool& rRightClip );
void SetSyntaxColor( vcl::Font* pFont, const ScRefCellValue& rCell );
@@ -276,15 +276,15 @@ private:
std::unique_ptr<ScFieldEditEngine> CreateOutputEditEngine();
- void ShowClipMarks( DrawEditParam& rParam, long nEngineHeight, const Size& aCellSize,
+ void ShowClipMarks( DrawEditParam& rParam, tools::Long nEngineHeight, const Size& aCellSize,
bool bMerged, OutputAreaParam& aAreaParam );
ClearableClipRegionPtr Clip(DrawEditParam& rParam, const Size& aCellSize, OutputAreaParam& aAreaParam,
- long nEngineHeight, bool bWrapFields);
+ tools::Long nEngineHeight, bool bWrapFields);
bool AdjustAreaParamClipRect(OutputAreaParam& rAreaParam);
- long SetEngineTextAndGetWidth( DrawEditParam& rParam, const OUString& rSetString,
- long& rNeededPixel, long nAddWidthPixels );
+ tools::Long SetEngineTextAndGetWidth( DrawEditParam& rParam, const OUString& rSetString,
+ tools::Long& rNeededPixel, tools::Long nAddWidthPixels );
// Check for and set cell rotations at OutputData to have it available
// in the svx tooling to render the borders. Moved to private section
@@ -300,7 +300,7 @@ public:
*/
ScOutputData( OutputDevice* pNewDev, ScOutputType eNewType,
ScTableInfo& rTabInfo, ScDocument* pNewDoc,
- SCTAB nNewTab, long nNewScrX, long nNewScrY,
+ SCTAB nNewTab, tools::Long nNewScrX, tools::Long nNewScrY,
SCCOL nNewX1, SCROW nNewY1, SCCOL nNewX2, SCROW nNewY2,
double nPixelPerTwipsX, double nPixelPerTwipsY,
const Fraction* pZoomX = nullptr,
@@ -328,9 +328,9 @@ public:
void SetShowNullValues ( bool bSet );
void SetShowFormulas ( bool bSet );
void SetShowSpellErrors( bool bSet );
- void SetMirrorWidth( long nNew );
- long GetScrW() const { return nScrW; }
- long GetScrH() const { return nScrH; }
+ void SetMirrorWidth( tools::Long nNew );
+ tools::Long GetScrW() const { return nScrW; }
+ tools::Long GetScrH() const { return nScrH; }
void SetSnapPixel();
@@ -353,7 +353,7 @@ public:
void DrawClear();
// #i72502# printer only command set
- Point PrePrintDrawingLayer(long nLogStX, long nLogStY );
+ Point PrePrintDrawingLayer(tools::Long nLogStX, tools::Long nLogStY );
void PostPrintDrawingLayer(const Point& rMMOffset); // #i74768# need offset for FormLayer
void PrintDrawingLayer(SdrLayerID nLayer, const Point& rMMOffset);
diff --git a/sc/source/ui/inc/pagedata.hxx b/sc/source/ui/inc/pagedata.hxx
index 81a277c42ac2..14405f0c00e2 100644
--- a/sc/source/ui/inc/pagedata.hxx
+++ b/sc/source/ui/inc/pagedata.hxx
@@ -20,6 +20,7 @@
#ifndef INCLUDED_SC_SOURCE_UI_INC_PAGEDATA_HXX
#define INCLUDED_SC_SOURCE_UI_INC_PAGEDATA_HXX
+#include <tools/long.hxx>
#include <address.hxx>
#include <memory>
#include <vector>
@@ -32,7 +33,7 @@ private:
mvPageEndX;
std::vector<SCROW>
mvPageEndY;
- long nFirstPage;
+ tools::Long nFirstPage;
bool bTopDown;
bool bAutomatic;
@@ -51,8 +52,8 @@ public:
size_t GetPagesY() const { return mvPageEndY.size(); }
const SCROW* GetPageEndY() const { return mvPageEndY.data(); }
- void SetFirstPage( long nNew ) { nFirstPage = nNew; }
- long GetFirstPage() const { return nFirstPage; }
+ void SetFirstPage( tools::Long nNew ) { nFirstPage = nNew; }
+ tools::Long GetFirstPage() const { return nFirstPage; }
void SetTopDown( bool bSet ) { bTopDown = bSet; }
bool IsTopDown() const { return bTopDown; }
void SetAutomatic( bool bSet ) { bAutomatic = bSet; }
diff --git a/sc/source/ui/inc/pfuncache.hxx b/sc/source/ui/inc/pfuncache.hxx
index 762e3464aea5..888c60c0fd4c 100644
--- a/sc/source/ui/inc/pfuncache.hxx
+++ b/sc/source/ui/inc/pfuncache.hxx
@@ -68,14 +68,14 @@ public:
struct ScPrintPageLocation
{
- long nPage;
+ tools::Long nPage;
ScRange aCellRange;
tools::Rectangle aRectangle; // pixels
ScPrintPageLocation() :
nPage(-1) {} // default: invalid
- ScPrintPageLocation( long nP, const ScRange& rRange, const tools::Rectangle& rRect ) :
+ ScPrintPageLocation( tools::Long nP, const ScRange& rRange, const tools::Rectangle& rRect ) :
nPage(nP), aCellRange(rRange), aRectangle(rRect) {}
};
@@ -86,7 +86,7 @@ class ScPrintFuncCache
{
ScPrintSelectionStatus aSelection;
ScDocShell* pDocSh;
- long nTotalPages;
+ tools::Long nTotalPages;
std::vector<long> nPages;
std::vector<long> nFirstAttr;
std::vector<ScPrintPageLocation> aLocations;
@@ -102,11 +102,11 @@ public:
void InitLocations( const ScMarkData& rMark, OutputDevice* pDev );
bool FindLocation( const ScAddress& rCell, ScPrintPageLocation& rLocation ) const;
- long GetPageCount() const { return nTotalPages; }
- long GetFirstAttr( SCTAB nTab ) const { return nFirstAttr[nTab]; }
- SCTAB GetTabForPage( long nPage ) const;
- long GetTabStart( SCTAB nTab ) const;
- long GetDisplayStart( SCTAB nTab ) const;
+ tools::Long GetPageCount() const { return nTotalPages; }
+ tools::Long GetFirstAttr( SCTAB nTab ) const { return nFirstAttr[nTab]; }
+ SCTAB GetTabForPage( tools::Long nPage ) const;
+ tools::Long GetTabStart( SCTAB nTab ) const;
+ tools::Long GetDisplayStart( SCTAB nTab ) const;
};
#endif
diff --git a/sc/source/ui/inc/preview.hxx b/sc/source/ui/inc/preview.hxx
index 5459718f02b7..ecb6a9646106 100644
--- a/sc/source/ui/inc/preview.hxx
+++ b/sc/source/ui/inc/preview.hxx
@@ -34,7 +34,7 @@ class SAL_DLLPUBLIC_RTTI ScPreview : public vcl::Window
private:
ScMarkData::MarkedTabsType maSelectedTabs;
// set:
- long nPageNo; // Pages in document
+ tools::Long nPageNo; // Pages in document
sal_uInt16 nZoom; // set Zoom
Point aOffset; // positive
@@ -44,11 +44,11 @@ private:
std::vector<long> nPages;
std::vector<long> nFirstAttr;
SCTAB nTab; // Sheet
- long nTabPage; // Page of sheet
- long nTabStart; // First (real) page of the sheet
- long nDisplayStart; // same as above, relative to the start of counting
+ tools::Long nTabPage; // Page of sheet
+ tools::Long nTabStart; // First (real) page of the sheet
+ tools::Long nDisplayStart; // same as above, relative to the start of counting
DateTime aDateTime;
- long nTotalPages;
+ tools::Long nTotalPages;
ScPrintState aState;
std::unique_ptr<ScPreviewLocationData> pLocationData; // stores table layout for accessibility API
std::unique_ptr<FmFormView> pDrawView;
@@ -81,14 +81,14 @@ private:
ScRange aPageArea;
std::vector<long> mvRight;
- long nLeftPosition;
- long mnScale;
+ tools::Long nLeftPosition;
+ tools::Long mnScale;
SCCOL nColNumberButtonDown;
Point aButtonDownChangePoint;
Point aButtonDownPt;
Point aButtonUpPt;
- long nHeaderHeight;
- long nFooterHeight;
+ tools::Long nHeaderHeight;
+ tools::Long nFooterHeight;
void TestLastPage();
void CalcPages();
@@ -123,31 +123,31 @@ public:
SC_DLLPUBLIC void DataChanged(bool bNewTime); // Instead of calling Invalidate
void DoInvalidate();
- void SetXOffset( long nX );
- void SetYOffset( long nY );
+ void SetXOffset( tools::Long nX );
+ void SetYOffset( tools::Long nY );
void SetZoom(sal_uInt16 nNewZoom);
- SC_DLLPUBLIC void SetPageNo( long nPage );
+ SC_DLLPUBLIC void SetPageNo( tools::Long nPage );
bool GetPageMargins() const { return bPageMargin; }
void SetPageMargins( bool bVal ) { bPageMargin = bVal; }
- void DrawInvert( long nDragPos, PointerStyle nFlags );
- void DragMove( long nDragMovePos, PointerStyle nFlags );
+ void DrawInvert( tools::Long nDragPos, PointerStyle nFlags );
+ void DragMove( tools::Long nDragMovePos, PointerStyle nFlags );
const ScPreviewLocationData& GetLocationData();
OUString GetPosString();
- long GetPageNo() const { return nPageNo; }
+ tools::Long GetPageNo() const { return nPageNo; }
sal_uInt16 GetZoom() const { return nZoom; }
const Point& GetOffset() const { return aOffset; }
SCTAB GetTab() { if (!bValid) { CalcPages(); RecalcPages(); } return nTab; }
- long GetTotalPages() { if (!bValid) { CalcPages(); RecalcPages(); } return nTotalPages; }
+ tools::Long GetTotalPages() { if (!bValid) { CalcPages(); RecalcPages(); } return nTotalPages; }
bool AllTested() const { return bValid && nTabsTested >= nTabCount; }
sal_uInt16 GetOptimalZoom(bool bWidthOnly);
- SC_DLLPUBLIC long GetFirstPage(SCTAB nTab);
+ SC_DLLPUBLIC tools::Long GetFirstPage(SCTAB nTab);
void CalcAll() { CalcPages(); }
void SetInGetState(bool bSet) { bInGetState = bSet; }
diff --git a/sc/source/ui/inc/prevloc.hxx b/sc/source/ui/inc/prevloc.hxx
index 34aa81b6538a..5aa803364f64 100644
--- a/sc/source/ui/inc/prevloc.hxx
+++ b/sc/source/ui/inc/prevloc.hxx
@@ -45,10 +45,10 @@ struct ScPreviewColRowInfo
{
bool bIsHeader;
SCCOLROW nDocIndex;
- long nPixelStart;
- long nPixelEnd;
+ tools::Long nPixelStart;
+ tools::Long nPixelEnd;
- void Set( bool bHeader, SCCOLROW nIndex, long nStart, long nEnd )
+ void Set( bool bHeader, SCCOLROW nIndex, tools::Long nStart, tools::Long nEnd )
{
bIsHeader = bHeader;
nDocIndex = nIndex;
@@ -128,8 +128,8 @@ public:
bool IsHeaderLeft() const;
bool IsFooterLeft() const;
- long GetNoteCountInRange( const tools::Rectangle& rVisiblePixel, bool bNoteMarks ) const;
- bool GetNoteInRange( const tools::Rectangle& rVisiblePixel, long nIndex, bool bNoteMarks,
+ tools::Long GetNoteCountInRange( const tools::Rectangle& rVisiblePixel, bool bNoteMarks ) const;
+ bool GetNoteInRange( const tools::Rectangle& rVisiblePixel, tools::Long nIndex, bool bNoteMarks,
ScAddress& rCellPos, tools::Rectangle& rNoteRect ) const;
tools::Rectangle GetNoteInRangeOutputRect(const tools::Rectangle& rVisiblePixel, bool bNoteMarks,
const ScAddress& aCellPos) const;
diff --git a/sc/source/ui/inc/prevwsh.hxx b/sc/source/ui/inc/prevwsh.hxx
index 5f2a9e89f027..d23eca09eacb 100644
--- a/sc/source/ui/inc/prevwsh.hxx
+++ b/sc/source/ui/inc/prevwsh.hxx
@@ -49,7 +49,7 @@ class SC_DLLPUBLIC ScPreviewShell: public SfxViewShell
TriState nSourceDesignMode; // form design mode from TabView
SvxZoomType eZoom;
- long nMaxVertPos;
+ tools::Long nMaxVertPos;
std::unique_ptr<SfxBroadcaster> pAccessibilityBroadcaster;
bool GetPageSize( Size& aPageSize );
diff --git a/sc/source/ui/inc/printfun.hxx b/sc/source/ui/inc/printfun.hxx
index 96a8715911df..f59804ebaede 100644
--- a/sc/source/ui/inc/printfun.hxx
+++ b/sc/source/ui/inc/printfun.hxx
@@ -51,8 +51,8 @@ struct ScPrintHFParam
bool bEnable;
bool bDynamic;
bool bShared;
- long nHeight; // in total (height + distance + frames)
- long nManHeight; // set size (min when dynamic)
+ tools::Long nHeight; // in total (height + distance + frames)
+ tools::Long nManHeight; // set size (min when dynamic)
sal_uInt16 nDistance;
sal_uInt16 nLeft; // edges
sal_uInt16 nRight;
@@ -154,10 +154,10 @@ struct ScPrintState // Save Variables from ScPrintFunc
sal_uInt16 nZoom;
size_t nPagesX;
size_t nPagesY;
- long nTabPages;
- long nTotalPages;
- long nPageStart;
- long nDocPages;
+ tools::Long nTabPages;
+ tools::Long nTotalPages;
+ tools::Long nPageStart;
+ tools::Long nDocPages;
// Additional state of page ranges
bool bSavedStateRanges;
@@ -205,8 +205,8 @@ private:
bool bIsRender;
SCTAB nPrintTab;
- long nPageStart; // Offset for the first page
- long nDocPages; // Number of Pages in Document
+ tools::Long nPageStart; // Offset for the first page
+ tools::Long nDocPages; // Number of Pages in Document
const ScRange* pUserArea; // Selection, if set in dialog
@@ -240,8 +240,8 @@ private:
bool bPrintCurrentTable;
bool bMultiArea;
bool mbHasPrintRange;
- long nTabPages;
- long nTotalPages;
+ tools::Long nTabPages;
+ tools::Long nTotalPages;
tools::Rectangle aPageRect; // Document Twips
@@ -275,7 +275,7 @@ private:
public:
ScPrintFunc( ScDocShell* pShell, SfxPrinter* pNewPrinter, SCTAB nTab,
- long nPage = 0, long nDocP = 0,
+ tools::Long nPage = 0, tools::Long nDocP = 0,
const ScRange* pArea = nullptr,
const ScPrintOptions* pOptions = nullptr,
ScPageBreakData* pData = nullptr );
@@ -286,7 +286,7 @@ public:
// ctors for device other than printer - for preview and pdf:
ScPrintFunc( OutputDevice* pOutDev, ScDocShell* pShell, SCTAB nTab,
- long nPage = 0, long nDocP = 0,
+ tools::Long nPage = 0, tools::Long nDocP = 0,
const ScRange* pArea = nullptr,
const ScPrintOptions* pOptions = nullptr );
@@ -314,18 +314,18 @@ public:
bool UpdatePages();
void ApplyPrintSettings(); // Already called from DoPrint()
- long DoPrint( const MultiSelection& rPageRanges,
- long nStartPage, long nDisplayStart, bool bDoPrint,
+ tools::Long DoPrint( const MultiSelection& rPageRanges,
+ tools::Long nStartPage, tools::Long nDisplayStart, bool bDoPrint,
ScPreviewLocationData* pLocationData );
// Query values - immediately
const Size& GetPageSize() const { return aPageSize; }
Size GetDataSize() const;
- void GetScaleData( Size& rPhysSize, long& rDocHdr, long& rDocFtr );
- long GetFirstPageNo() const { return aTableParam.nFirstPageNo; }
+ void GetScaleData( Size& rPhysSize, tools::Long& rDocHdr, tools::Long& rDocFtr );
+ tools::Long GetFirstPageNo() const { return aTableParam.nFirstPageNo; }
- long GetTotalPages() const { return nTotalPages; }
+ tools::Long GetTotalPages() const { return nTotalPages; }
sal_uInt16 GetZoom() const { return nZoom; }
void ResetBreaks( SCTAB nTab );
@@ -346,45 +346,45 @@ private:
void InitParam( const ScPrintOptions* pOptions );
void CalcZoom( sal_uInt16 nRangeNo );
void CalcPages();
- long CountPages();
- long CountNotePages();
+ tools::Long CountPages();
+ tools::Long CountNotePages();
bool AdjustPrintArea( bool bNew );
Size GetDocPageSize();
- long TextHeight( const EditTextObject* pObject );
+ tools::Long TextHeight( const EditTextObject* pObject );
void MakeEditEngine();
void UpdateHFHeight( ScPrintHFParam& rParam );
void InitModes();
- bool IsLeft( long nPageNo );
- bool IsMirror( long nPageNo );
+ bool IsLeft( tools::Long nPageNo );
+ bool IsMirror( tools::Long nPageNo );
void MakeTableString(); // sets aTableStr
- void PrintPage( long nPageNo,
+ void PrintPage( tools::Long nPageNo,
SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
bool bDoPrint, ScPreviewLocationData* pLocationData );
void PrintArea( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
- long nScrX, long nScrY,
+ tools::Long nScrX, tools::Long nScrY,
bool bShLeft, bool bShTop, bool bShRight, bool bShBottom );
void LocateArea( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
- long nScrX, long nScrY, bool bRepCol, bool bRepRow,
+ tools::Long nScrX, tools::Long nScrY, bool bRepCol, bool bRepRow,
ScPreviewLocationData& rLocationData );
- void PrintColHdr( SCCOL nX1, SCCOL nX2, long nScrX, long nScrY );
- void PrintRowHdr( SCROW nY1, SCROW nY2, long nScrX, long nScrY );
- void LocateColHdr( SCCOL nX1, SCCOL nX2, long nScrX, long nScrY,
+ void PrintColHdr( SCCOL nX1, SCCOL nX2, tools::Long nScrX, tools::Long nScrY );
+ void PrintRowHdr( SCROW nY1, SCROW nY2, tools::Long nScrX, tools::Long nScrY );
+ void LocateColHdr( SCCOL nX1, SCCOL nX2, tools::Long nScrX, tools::Long nScrY,
bool bRepCol, ScPreviewLocationData& rLocationData );
- void LocateRowHdr( SCROW nY1, SCROW nY2, long nScrX, long nScrY,
+ void LocateRowHdr( SCROW nY1, SCROW nY2, tools::Long nScrX, tools::Long nScrY,
bool bRepRow, ScPreviewLocationData& rLocationData );
- void PrintHF( long nPageNo, bool bHeader, long nStartY,
+ void PrintHF( tools::Long nPageNo, bool bHeader, tools::Long nStartY,
bool bDoPrint, ScPreviewLocationData* pLocationData );
- long PrintNotes( long nPageNo, long nNoteStart, bool bDoPrint, ScPreviewLocationData* pLocationData );
- long DoNotes( long nNoteStart, bool bDoPrint, ScPreviewLocationData* pLocationData );
+ tools::Long PrintNotes( tools::Long nPageNo, tools::Long nNoteStart, bool bDoPrint, ScPreviewLocationData* pLocationData );
+ tools::Long DoNotes( tools::Long nNoteStart, bool bDoPrint, ScPreviewLocationData* pLocationData );
- void DrawBorder( long nScrX, long nScrY, long nScrW, long nScrH,
+ void DrawBorder( tools::Long nScrX, tools::Long nScrY, tools::Long nScrW, tools::Long nScrH,
const SvxBoxItem* pBorderData,
const SvxBrushItem* pBackground,
const SvxShadowItem* pShadow );
diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index 25e54452b814..97a1edc276b7 100644
--- a/sc/source/ui/inc/tabview.hxx
+++ b/sc/source/ui/inc/tabview.hxx
@@ -176,7 +176,7 @@ private:
OUString sTipString;
VclPtr<vcl::Window> sTopParent;
- long nPrevDragPos;
+ tools::Long nPrevDragPos;
BlockMode meBlockMode; // Marks block
@@ -218,20 +218,20 @@ private:
void DoAddWin( ScGridWindow* pWin );
- void InitScrollBar( ScrollBar& rScrollBar, long nMaxVal );
+ void InitScrollBar( ScrollBar& rScrollBar, tools::Long nMaxVal );
DECL_LINK(ScrollHdl, ScrollBar*, void );
DECL_LINK(EndScrollHdl, ScrollBar*, void );
DECL_LINK(SplitHdl, Splitter*, void);
- void DoHSplit(long nSplitPos);
- void DoVSplit(long nSplitPos);
+ void DoHSplit(tools::Long nSplitPos);
+ void DoVSplit(tools::Long nSplitPos);
DECL_LINK( TimerHdl, Timer*, void );
void UpdateVarZoom();
- static void SetScrollBar( ScrollBar& rScroll, long nRangeMax, long nVisible, long nPos, bool bLayoutRTL );
- static long GetScrollBarPos( const ScrollBar& rScroll );
+ static void SetScrollBar( ScrollBar& rScroll, tools::Long nRangeMax, tools::Long nVisible, tools::Long nPos, bool bLayoutRTL );
+ static tools::Long GetScrollBarPos( const ScrollBar& rScroll );
void GetAreaMoveEndPosition(SCCOL nMovX, SCROW nMovY, ScFollowMode eMode,
SCCOL& rAreaX, SCROW& rAreaY, ScFollowMode& rMode);
@@ -293,7 +293,7 @@ public:
DECL_LINK( TabBarResize, ::TabBar*, void );
/** Sets an absolute tab bar width (in pixels). */
- void SetTabBarWidth( long nNewWidth );
+ void SetTabBarWidth( tools::Long nNewWidth );
/** Sets a relative tab bar width.
@param fRelTabBarWidth Tab bar width relative to frame window width (0.0 ... 1.0). */
SC_DLLPUBLIC void SetRelTabBarWidth( double fRelTabBarWidth );
@@ -301,7 +301,7 @@ public:
@param fRelTabBarWidth Tab bar width relative to frame window width (0.0 ... 1.0). */
void SetPendingRelTabBarWidth( double fRelTabBarWidth );
/** Returns the current tab bar width in pixels. */
- long GetTabBarWidth() const;
+ tools::Long GetTabBarWidth() const;
/** Returns the current tab bar width relative to the frame window width (0.0 ... 1.0). */
SC_DLLPUBLIC static double GetRelTabBarWidth();
/** Returns the pending tab bar width relative to the frame window width (0.0 ... 1.0). */
@@ -386,8 +386,8 @@ public:
void CheckSelectionTransfer();
- void InvertHorizontal( ScVSplitPos eWhich, long nDragPos );
- void InvertVertical( ScHSplitPos eWhich, long nDragPos );
+ void InvertHorizontal( ScVSplitPos eWhich, tools::Long nDragPos );
+ void InvertVertical( ScHSplitPos eWhich, tools::Long nDragPos );
Point GetInsertPos() const;
@@ -448,9 +448,9 @@ public:
void SetTimer( ScGridWindow* pWin, const MouseEvent& rMEvt );
void ResetTimer();
- void ScrollX( long nDeltaX, ScHSplitPos eWhich, bool bUpdBars = true );
- void ScrollY( long nDeltaY, ScVSplitPos eWhich, bool bUpdBars = true );
- SC_DLLPUBLIC void ScrollLines( long nDeltaX, long nDeltaY ); // active
+ void ScrollX( tools::Long nDeltaX, ScHSplitPos eWhich, bool bUpdBars = true );
+ void ScrollY( tools::Long nDeltaY, ScVSplitPos eWhich, bool bUpdBars = true );
+ SC_DLLPUBLIC void ScrollLines( tools::Long nDeltaX, tools::Long nDeltaY ); // active
bool ScrollCommand( const CommandEvent& rCEvt, ScSplitPos ePos );
@@ -486,15 +486,15 @@ public:
void CheckNeedsRepaint();
bool NeedsRepaint();
- void PaintRangeFinder( long nNumber );
+ void PaintRangeFinder( tools::Long nNumber );
void AddHighlightRange( const ScRange& rRange, const Color& rColor );
void ClearHighlightRanges();
void DoChartSelection( const css::uno::Sequence< css::chart2::data::HighlightedRange > & rHilightRanges );
void DoDPFieldPopup(OUString const & rPivotTableName, sal_Int32 nDimensionIndex, Point aPoint, Size aSize);
- long GetGridWidth( ScHSplitPos eWhich );
- long GetGridHeight( ScVSplitPos eWhich );
+ tools::Long GetGridWidth( ScHSplitPos eWhich );
+ tools::Long GetGridHeight( ScVSplitPos eWhich );
void UpdateScrollBars( HeaderType eHeaderType = BOTH_HEADERS );
void SetNewVisArea();
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 3f1342bd8322..02b27c5cd2e3 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -298,7 +298,7 @@ public:
ObjectSelectionType GetCurObjectSelectionType() const { return eCurOST; }
- virtual ErrCode DoVerb(long nVerb) override;
+ virtual ErrCode DoVerb(tools::Long nVerb) override;
void StopEditShell();
bool IsDrawTextShell() const;
@@ -321,7 +321,7 @@ public:
virtual std::unique_ptr<SfxTabPage> CreatePrintOptionsPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet &rOptions) override;
void ConnectObject( const SdrOle2Obj* pObj );
- void ActivateObject( SdrOle2Obj* pObj, long nVerb );
+ void ActivateObject( SdrOle2Obj* pObj, tools::Long nVerb );
void DeactivateOle();
diff --git a/sc/source/ui/inc/tbzoomsliderctrl.hxx b/sc/source/ui/inc/tbzoomsliderctrl.hxx
index bb3660fabe14..944f9c86335e 100644
--- a/sc/source/ui/inc/tbzoomsliderctrl.hxx
+++ b/sc/source/ui/inc/tbzoomsliderctrl.hxx
@@ -47,8 +47,8 @@ private:
std::unique_ptr<ScZoomSliderWnd_Impl> mpImpl;
css::uno::Reference<css::frame::XDispatchProvider> m_xDispatchProvider;
- sal_uInt16 Offset2Zoom(long nOffset) const;
- long Zoom2Offset(sal_uInt16 nZoom) const;
+ sal_uInt16 Offset2Zoom(tools::Long nOffset) const;
+ tools::Long Zoom2Offset(sal_uInt16 nZoom) const;
void DoPaint(vcl::RenderContext& rRenderContext);
public:
diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx
index 2b98731870f2..1895799f7531 100644
--- a/sc/source/ui/inc/viewdata.hxx
+++ b/sc/source/ui/inc/viewdata.hxx
@@ -140,14 +140,14 @@ public:
ScPositionHelper(const ScDocument *pDoc, bool bColumn);
void setDocument(const ScDocument& rDoc, bool bColumn);
- void insert(index_type nIndex, long nPos);
+ void insert(index_type nIndex, tools::Long nPos);
void removeByIndex(index_type nIndex);
void invalidateByIndex(index_type nIndex);
- void invalidateByPosition(long nPos);
+ void invalidateByPosition(tools::Long nPos);
const value_type& getNearestByIndex(index_type nIndex) const;
- const value_type& getNearestByPosition(long nPos) const;
- long getPosition(index_type nIndex) const;
- long computePosition(index_type nIndex, const std::function<long (index_type)>& getSizePx);
+ const value_type& getNearestByPosition(tools::Long nPos) const;
+ tools::Long getPosition(index_type nIndex) const;
+ tools::Long computePosition(index_type nIndex, const std::function<long (index_type)>& getSizePx);
};
class ScBoundsProvider
@@ -164,43 +164,43 @@ class ScBoundsProvider
double mfPPTY;
index_type nFirstIndex;
index_type nSecondIndex;
- long nFirstPositionPx;
- long nSecondPositionPx;
+ tools::Long nFirstPositionPx;
+ tools::Long nSecondPositionPx;
public:
ScBoundsProvider(const ScViewData &rView, SCTAB nT, bool bColumnHeader);
- void GetStartIndexAndPosition(SCCOL& nIndex, long& nPosition) const;
- void GetEndIndexAndPosition(SCCOL& nIndex, long& nPosition) const;
- void GetStartIndexAndPosition(SCROW& nIndex, long& nPosition) const;
- void GetEndIndexAndPosition(SCROW& nIndex, long& nPosition) const;
+ void GetStartIndexAndPosition(SCCOL& nIndex, tools::Long& nPosition) const;
+ void GetEndIndexAndPosition(SCCOL& nIndex, tools::Long& nPosition) const;
+ void GetStartIndexAndPosition(SCROW& nIndex, tools::Long& nPosition) const;
+ void GetEndIndexAndPosition(SCROW& nIndex, tools::Long& nPosition) const;
void Compute(value_type aFirstNearest, value_type aSecondNearest,
- long nFirstBound, long nSecondBound);
+ tools::Long nFirstBound, tools::Long nSecondBound);
- void EnlargeStartBy(long nOffset);
+ void EnlargeStartBy(tools::Long nOffset);
- void EnlargeEndBy(long nOffset);
+ void EnlargeEndBy(tools::Long nOffset);
- void EnlargeBy(long nOffset)
+ void EnlargeBy(tools::Long nOffset)
{
EnlargeStartBy(nOffset);
EnlargeEndBy(nOffset);
}
private:
- long GetSize(index_type nIndex) const;
+ tools::Long GetSize(index_type nIndex) const;
- void GetIndexAndPos(index_type nNearestIndex, long nNearestPosition,
- long nBound, index_type& nFoundIndex, long& nPosition,
- bool bTowards, long nDiff);
+ void GetIndexAndPos(index_type nNearestIndex, tools::Long nNearestPosition,
+ tools::Long nBound, index_type& nFoundIndex, tools::Long& nPosition,
+ bool bTowards, tools::Long nDiff);
- void GeIndexBackwards(index_type nNearestIndex, long nNearestPosition,
- long nBound, index_type& nFoundIndex, long& nPosition,
+ void GeIndexBackwards(index_type nNearestIndex, tools::Long nNearestPosition,
+ tools::Long nBound, index_type& nFoundIndex, tools::Long& nPosition,
bool bTowards);
- void GetIndexTowards(index_type nNearestIndex, long nNearestPosition,
- long nBound, index_type& nFoundIndex, long& nPosition,
+ void GetIndexTowards(index_type nNearestIndex, tools::Long nNearestPosition,
+ tools::Long nBound, index_type& nFoundIndex, tools::Long& nPosition,
bool bTowards);
};
@@ -214,14 +214,14 @@ private:
Fraction aPageZoomX; // zoom in page break preview mode
Fraction aPageZoomY;
- long nTPosX[2]; // MapMode - Offset (Twips)
- long nTPosY[2];
- long nMPosX[2]; // MapMode - Offset (1/100 mm)
- long nMPosY[2];
- long nPixPosX[2]; // Offset in Pixels
- long nPixPosY[2];
- long nHSplitPos;
- long nVSplitPos;
+ tools::Long nTPosX[2]; // MapMode - Offset (Twips)
+ tools::Long nTPosY[2];
+ tools::Long nMPosX[2]; // MapMode - Offset (1/100 mm)
+ tools::Long nMPosY[2];
+ tools::Long nPixPosX[2]; // Offset in Pixels
+ tools::Long nPixPosY[2];
+ tools::Long nHSplitPos;
+ tools::Long nVSplitPos;
ScSplitMode eHSplitMode;
ScSplitMode eVSplitMode;
@@ -331,7 +331,7 @@ private:
bool bGrowing;
- long m_nLOKPageUpDownOffset;
+ tools::Long m_nLOKPageUpDownOffset;
tools::Rectangle maLOKVisibleArea;///< The visible area in the LibreOfficeKit client.
DECL_DLLPRIVATE_LINK( EditEngineHdl, EditStatus&, void );
@@ -404,8 +404,8 @@ public:
SCROW GetCurYForTab( SCTAB nTabIndex ) const;
SCCOL GetOldCurX() const;
SCROW GetOldCurY() const;
- long GetLOKDocWidthPixel() const { return pThisTab->aWidthHelper.getPosition(pThisTab->nMaxTiledCol); }
- long GetLOKDocHeightPixel() const { return pThisTab->aHeightHelper.getPosition(pThisTab->nMaxTiledRow); }
+ tools::Long GetLOKDocWidthPixel() const { return pThisTab->aWidthHelper.getPosition(pThisTab->nMaxTiledCol); }
+ tools::Long GetLOKDocHeightPixel() const { return pThisTab->aHeightHelper.getPosition(pThisTab->nMaxTiledRow); }
ScPositionHelper& GetLOKWidthHelper() { return pThisTab->aWidthHelper; }
ScPositionHelper& GetLOKHeightHelper() { return pThisTab->aHeightHelper; }
@@ -415,8 +415,8 @@ public:
ScSplitMode GetHSplitMode() const { return pThisTab->eHSplitMode; }
ScSplitMode GetVSplitMode() const { return pThisTab->eVSplitMode; }
- long GetHSplitPos() const { return pThisTab->nHSplitPos; }
- long GetVSplitPos() const { return pThisTab->nVSplitPos; }
+ tools::Long GetHSplitPos() const { return pThisTab->nHSplitPos; }
+ tools::Long GetVSplitPos() const { return pThisTab->nVSplitPos; }
SCCOL GetFixPosX() const { return pThisTab->nFixPosX; }
SCROW GetFixPosY() const { return pThisTab->nFixPosY; }
SCCOL GetMaxTiledCol() const { return pThisTab->nMaxTiledCol; }
@@ -437,8 +437,8 @@ public:
void SetHSplitMode( ScSplitMode eMode ) { pThisTab->eHSplitMode = eMode; }
void SetVSplitMode( ScSplitMode eMode ) { pThisTab->eVSplitMode = eMode; }
- void SetHSplitPos( long nPos ) { pThisTab->nHSplitPos = nPos; }
- void SetVSplitPos( long nPos ) { pThisTab->nVSplitPos = nPos; }
+ void SetHSplitPos( tools::Long nPos ) { pThisTab->nHSplitPos = nPos; }
+ void SetVSplitPos( tools::Long nPos ) { pThisTab->nVSplitPos = nPos; }
void SetFixPosX( SCCOL nPos ) { pThisTab->nFixPosX = nPos; }
void SetFixPosY( SCROW nPos ) { pThisTab->nFixPosY = nPos; }
void SetMaxTiledCol( SCCOL nCol );
@@ -502,9 +502,9 @@ public:
void SetEditAdjust( SvxAdjust eNewEditAdjust ) { eEditAdjust = eNewEditAdjust; }
// TRUE: Cell is merged
- bool GetMergeSizePixel( SCCOL nX, SCROW nY, long& rSizeXPix, long& rSizeYPix ) const;
- bool GetMergeSizePrintTwips( SCCOL nX, SCROW nY, long& rSizeXTwips, long& rSizeYTwips ) const;
- void GetPosFromPixel( long nClickX, long nClickY, ScSplitPos eWhich,
+ bool GetMergeSizePixel( SCCOL nX, SCROW nY, tools::Long& rSizeXPix, tools::Long& rSizeYPix ) const;
+ bool GetMergeSizePrintTwips( SCCOL nX, SCROW nY, tools::Long& rSizeXTwips, tools::Long& rSizeYTwips ) const;
+ void GetPosFromPixel( tools::Long nClickX, tools::Long nClickY, ScSplitPos eWhich,
SCCOL& rPosX, SCROW& rPosY,
bool bTestMerge = true, bool bRepair = false, SCTAB nForTab = -1 );
void GetMouseQuadrant( const Point& rClickPos, ScSplitPos eWhich,
@@ -548,8 +548,8 @@ public:
bool IsOutlineMode () const { return maOptions.GetOption(VOPT_OUTLINER); }
/// Force page size for PgUp/PgDown to overwrite the computation based on m_aVisArea.
- void ForcePageUpDownOffset(long nTwips) { m_nLOKPageUpDownOffset = nTwips; }
- long GetPageUpDownOffset() const { return m_nLOKPageUpDownOffset; }
+ void ForcePageUpDownOffset(tools::Long nTwips) { m_nLOKPageUpDownOffset = nTwips; }
+ tools::Long GetPageUpDownOffset() const { return m_nLOKPageUpDownOffset; }
/// The visible area in the client (set by setClientVisibleArea).
const tools::Rectangle& getLOKVisibleArea() const { return maLOKVisibleArea; }
@@ -656,16 +656,16 @@ public:
void DeriveLOKFreezeIfNeeded(SCTAB nForTab);
void OverrideWithLOKFreeze(ScSplitMode& eExHSplitMode, ScSplitMode& eExVSplitMode,
SCCOL& nExFixPosX, SCROW& nExFixPosY,
- long& nExHSplitPos, long& nExVSplitPos, SCTAB nForTab) const;
+ tools::Long& nExHSplitPos, tools::Long& nExVSplitPos, SCTAB nForTab) const;
- static inline long ToPixel( sal_uInt16 nTwips, double nFactor );
+ static inline tools::Long ToPixel( sal_uInt16 nTwips, double nFactor );
/** while (rScrY <= nEndPixels && rPosY <= nEndRow) add pixels of row
heights converted with nPPTY to rScrY, optimized for row height
segments. Upon return rPosY is the last row evaluated <= nEndRow, rScrY
may be > nEndPixels!
*/
- static void AddPixelsWhile( long & rScrY, long nEndPixels,
+ static void AddPixelsWhile( tools::Long & rScrY, tools::Long nEndPixels,
SCROW & rPosY, SCROW nEndRow, double nPPTY,
const ScDocument * pDoc, SCTAB nTabNo );
@@ -674,14 +674,14 @@ public:
segments. Upon return rPosY is the last row evaluated >= nStartRow,
rScrY may be > nEndPixels!
*/
- static void AddPixelsWhileBackward( long & rScrY, long nEndPixels,
+ static void AddPixelsWhileBackward( tools::Long & rScrY, tools::Long nEndPixels,
SCROW & rPosY, SCROW nStartRow, double nPPTY,
const ScDocument * pDoc, SCTAB nTabNo );
};
-inline long ScViewData::ToPixel( sal_uInt16 nTwips, double nFactor )
+inline tools::Long ScViewData::ToPixel( sal_uInt16 nTwips, double nFactor )
{
- long nRet = static_cast<long>( nTwips * nFactor );
+ tools::Long nRet = static_cast<tools::Long>( nTwips * nFactor );
if ( !nRet && nTwips )
nRet = 1;
return nRet;
diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx
index 5a7ad681c628..bb0644ba856b 100644
--- a/sc/source/ui/inc/viewfunc.hxx
+++ b/sc/source/ui/inc/viewfunc.hxx
@@ -338,8 +338,8 @@ public:
sal_uInt16 aColLength);
void UpdateSelectionArea( const ScMarkData& rSel, ScPatternAttr* pAttr = nullptr );
- void OnLOKInsertDeleteColumn(SCCOL nStartCol, long nOffset);
- void OnLOKInsertDeleteRow(SCROW nStartRow, long nOffset);
+ void OnLOKInsertDeleteColumn(SCCOL nStartCol, tools::Long nOffset);
+ void OnLOKInsertDeleteRow(SCROW nStartRow, tools::Long nOffset);
void OnLOKSetWidthOrHeight(SCCOLROW nStart, bool bWidth);
// Internal helper functions
diff --git a/sc/source/ui/miscdlgs/crnrdlg.cxx b/sc/source/ui/miscdlgs/crnrdlg.cxx
index 82f42c15be6e..c037405ef078 100644
--- a/sc/source/ui/miscdlgs/crnrdlg.cxx
+++ b/sc/source/ui/miscdlgs/crnrdlg.cxx
@@ -742,7 +742,7 @@ IMPL_LINK_NOARG(ScColRowNameRangesDlg, ColClickHdl, weld::Button&, void)
m_xEdAssign->SetText( aStr );
}
ScRange aRange( theCurData );
- aRange.aStart.SetRow( std::min( static_cast<long>(theCurArea.aEnd.Row() + 1), static_cast<long>(rDoc.MaxRow()) ) );
+ aRange.aStart.SetRow( std::min( static_cast<tools::Long>(theCurArea.aEnd.Row() + 1), static_cast<tools::Long>(rDoc.MaxRow()) ) );
aRange.aEnd.SetRow( rDoc.MaxRow() );
AdjustColRowData( aRange );
}
@@ -760,7 +760,7 @@ IMPL_LINK_NOARG(ScColRowNameRangesDlg, RowClickHdl, weld::Button&, void)
m_xEdAssign->SetText( aStr );
}
ScRange aRange( theCurData );
- aRange.aStart.SetCol( static_cast<SCCOL>(std::min( static_cast<long>(theCurArea.aEnd.Col() + 1), static_cast<long>(rDoc.MaxCol()) )) );
+ aRange.aStart.SetCol( static_cast<SCCOL>(std::min( static_cast<tools::Long>(theCurArea.aEnd.Col() + 1), static_cast<tools::Long>(rDoc.MaxCol()) )) );
aRange.aEnd.SetCol( rDoc.MaxCol() );
AdjustColRowData( aRange );
}
diff --git a/sc/source/ui/miscdlgs/mtrindlg.cxx b/sc/source/ui/miscdlgs/mtrindlg.cxx
index 3e6aa2d92fec..4226be64eee7 100644
--- a/sc/source/ui/miscdlgs/mtrindlg.cxx
+++ b/sc/source/ui/miscdlgs/mtrindlg.cxx
@@ -23,12 +23,12 @@
ScMetricInputDlg::ScMetricInputDlg( weld::Window* pParent,
const OString& sDialogName,
- long nCurrent,
- long nDefault,
+ tools::Long nCurrent,
+ tools::Long nDefault,
FieldUnit eFUnit,
sal_uInt16 nDecimals,
- long nMaximum,
- long nMinimum)
+ tools::Long nMaximum,
+ tools::Long nMinimum)
: GenericDialogController(pParent, OStringToOUString("modules/scalc/ui/" +
sDialogName.toAsciiLowerCase() + ".ui", RTL_TEXTENCODING_UTF8), sDialogName)
diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx
index 2da4898cfa48..e3c6b1d751e9 100644
--- a/sc/source/ui/miscdlgs/optsolver.cxx
+++ b/sc/source/ui/miscdlgs/optsolver.cxx
@@ -374,11 +374,11 @@ void ScOptSolverDlg::ReadConditions()
aRowEntry.aRightStr = mpRightEdit[nRow]->GetText();
aRowEntry.nOperator = mpOperator[nRow]->get_active();
- long nVecPos = nScrollPos + nRow;
- if ( nVecPos >= static_cast<long>(maConditions.size()) && !aRowEntry.IsDefault() )
+ tools::Long nVecPos = nScrollPos + nRow;
+ if ( nVecPos >= static_cast<tools::Long>(maConditions.size()) && !aRowEntry.IsDefault() )
maConditions.resize( nVecPos + 1 );
- if ( nVecPos < static_cast<long>(maConditions.size()) )
+ if ( nVecPos < static_cast<tools::Long>(maConditions.size()) )
maConditions[nVecPos] = aRowEntry;
// remove default entries at the end
@@ -395,8 +395,8 @@ void ScOptSolverDlg::ShowConditions()
{
ScOptConditionRow aRowEntry;
- long nVecPos = nScrollPos + nRow;
- if ( nVecPos < static_cast<long>(maConditions.size()) )
+ tools::Long nVecPos = nScrollPos + nRow;
+ if ( nVecPos < static_cast<tools::Long>(maConditions.size()) )
aRowEntry = maConditions[nVecPos];
mpLeftEdit[nRow]->SetRefString( aRowEntry.aLeftStr );
@@ -405,8 +405,8 @@ void ScOptSolverDlg::ShowConditions()
}
// allow to scroll one page behind the visible or stored rows
- long nVisible = nScrollPos + EDIT_ROW_COUNT;
- long nMax = std::max( nVisible, static_cast<long>(maConditions.size()) );
+ tools::Long nVisible = nScrollPos + EDIT_ROW_COUNT;
+ tools::Long nMax = std::max( nVisible, static_cast<tools::Long>(maConditions.size()) );
m_xScrollBar->vadjustment_configure(nScrollPos, 0, nMax + EDIT_ROW_COUNT, 1,
EDIT_ROW_COUNT - 1, EDIT_ROW_COUNT);
@@ -417,8 +417,8 @@ void ScOptSolverDlg::EnableButtons()
{
for ( sal_uInt16 nRow = 0; nRow < EDIT_ROW_COUNT; ++nRow )
{
- long nVecPos = nScrollPos + nRow;
- mpDelButton[nRow]->set_sensitive(nVecPos < static_cast<long>(maConditions.size()));
+ tools::Long nVecPos = nScrollPos + nRow;
+ mpDelButton[nRow]->set_sensitive(nVecPos < static_cast<tools::Long>(maConditions.size()));
}
}
@@ -626,8 +626,8 @@ IMPL_LINK(ScOptSolverDlg, DelBtnHdl, weld::Button&, rBtn, void)
bool bHadFocus = rBtn.has_focus();
ReadConditions();
- long nVecPos = nScrollPos + nRow;
- if ( nVecPos < static_cast<long>(maConditions.size()) )
+ tools::Long nVecPos = nScrollPos + nRow;
+ if ( nVecPos < static_cast<tools::Long>(maConditions.size()) )
{
maConditions.erase( maConditions.begin() + nVecPos );
ShowConditions();
diff --git a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
index 90e72f5bf1f8..daae9593b20f 100644
--- a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
+++ b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
@@ -350,7 +350,7 @@ void AlignmentPropertyPanel::NotifyItemUpdate(
case SID_ATTR_ALIGN_DEGREES:
if (eState >= SfxItemState::DEFAULT)
{
- long nTmp = static_cast<const ScRotateValueItem*>(pState)->GetValue();
+ tools::Long nTmp = static_cast<const ScRotateValueItem*>(pState)->GetValue();
mxMtrAngle->set_value(nTmp / 100, FieldUnit::DEGREE);
}
else
diff --git a/sc/source/ui/sidebar/CellLineStyleValueSet.cxx b/sc/source/ui/sidebar/CellLineStyleValueSet.cxx
index 624df4882efd..a47c1d1f0f1d 100644
--- a/sc/source/ui/sidebar/CellLineStyleValueSet.cxx
+++ b/sc/source/ui/sidebar/CellLineStyleValueSet.cxx
@@ -75,8 +75,8 @@ void CellLineStyleValueSet::UserDraw( const UserDrawEvent& rUDEvt )
vcl::RenderContext* pDev = rUDEvt.GetRenderContext();
sal_uInt16 nItemId = rUDEvt.GetItemId();
- long nRectHeight = aRect.GetHeight();
- long nRectWidth = aRect.GetWidth();
+ tools::Long nRectHeight = aRect.GetHeight();
+ tools::Long nRectWidth = aRect.GetWidth();
Point aBLPos = aRect.TopLeft();
vcl::Font aOldFont = pDev->GetFont();
@@ -111,9 +111,9 @@ void CellLineStyleValueSet::UserDraw( const UserDrawEvent& rUDEvt )
aFont.SetColor(rStyleSettings.GetFieldTextColor()); //high contrast
pDev->SetFont(aFont);
- long nTextWidth = pDev->GetTextWidth(maStrUnit[nItemId - 1]);
- long nTLX = aBLPos.X() + 5, nTLY = aBLPos.Y() + ( nRectHeight - nItemId )/2;
- long nTRX = aBLPos.X() + nRectWidth - nTextWidth - 15, nTRY = aBLPos.Y() + ( nRectHeight - nItemId )/2;
+ tools::Long nTextWidth = pDev->GetTextWidth(maStrUnit[nItemId - 1]);
+ tools::Long nTLX = aBLPos.X() + 5, nTLY = aBLPos.Y() + ( nRectHeight - nItemId )/2;
+ tools::Long nTRX = aBLPos.X() + nRectWidth - nTextWidth - 15, nTRY = aBLPos.Y() + ( nRectHeight - nItemId )/2;
Point aStart(aBLPos.X() + nRectWidth - nTextWidth - 5 , aBLPos.Y() + nRectHeight/6);
pDev->DrawText(aStart, maStrUnit[nItemId - 1]); //can't set DrawTextFlags::EndEllipsis here, or the text will disappear
diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index be9e606b4915..f6d2c1bbcbb7 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -172,7 +172,7 @@ void ScUndoInsertCells::DoChange( const bool bUndo )
if (pViewShell)
{
- const long nSign = bUndo ? -1 : 1;
+ const tools::Long nSign = bUndo ? -1 : 1;
pViewShell->OnLOKInsertDeleteRow(aEffRange.aStart.Row(), nSign * (aEffRange.aEnd.Row()-aEffRange.aStart.Row()+1));
}
}
@@ -191,7 +191,7 @@ void ScUndoInsertCells::DoChange( const bool bUndo )
if (pViewShell)
{
- const long nSign = bUndo ? -1 : 1;
+ const tools::Long nSign = bUndo ? -1 : 1;
pViewShell->OnLOKInsertDeleteColumn(aEffRange.aStart.Col(), nSign * (aEffRange.aEnd.Col()-aEffRange.aStart.Col()+1));
}
}
@@ -420,7 +420,7 @@ void ScUndoDeleteCells::DoChange( const bool bUndo )
if (pViewShell)
{
- const long nSign = bUndo ? 1 : -1;
+ const tools::Long nSign = bUndo ? 1 : -1;
pViewShell->OnLOKInsertDeleteRow(aEffRange.aStart.Row(), nSign * (aEffRange.aEnd.Row()-aEffRange.aStart.Row()+1));
}
}
@@ -438,7 +438,7 @@ void ScUndoDeleteCells::DoChange( const bool bUndo )
if (pViewShell)
{
- const long nSign = bUndo ? 1 : -1;
+ const tools::Long nSign = bUndo ? 1 : -1;
pViewShell->OnLOKInsertDeleteColumn(aEffRange.aStart.Col(), nSign * (aEffRange.aEnd.Col()-aEffRange.aStart.Col()+1));
}
}
diff --git a/sc/source/ui/unoobj/ChartTools.cxx b/sc/source/ui/unoobj/ChartTools.cxx
index 5bb960d7491a..b1763699334c 100644
--- a/sc/source/ui/unoobj/ChartTools.cxx
+++ b/sc/source/ui/unoobj/ChartTools.cxx
@@ -117,7 +117,7 @@ SdrOle2Obj* findChartsByName(ScDocShell* pDocShell, SCTAB nTab, OUString const &
return nullptr;
}
-SdrOle2Obj* getChartByIndex(ScDocShell* pDocShell, SCTAB nTab, long nIndex, ChartSourceType eChartSourceType)
+SdrOle2Obj* getChartByIndex(ScDocShell* pDocShell, SCTAB nTab, ::tools::Long nIndex, ChartSourceType eChartSourceType)
{
if (!pDocShell)
return nullptr;
@@ -125,7 +125,7 @@ SdrOle2Obj* getChartByIndex(ScDocShell* pDocShell, SCTAB nTab, long nIndex, Char
ChartIterator aIterator(pDocShell, nTab, eChartSourceType);
SdrOle2Obj* pObject = aIterator.next();
- long i = 0;
+ ::tools::Long i = 0;
while (pObject)
{
if (i == nIndex)
diff --git a/sc/source/ui/unoobj/PivotTableDataProvider.cxx b/sc/source/ui/unoobj/PivotTableDataProvider.cxx
index ae1fb2c73820..8288be2e530b 100644
--- a/sc/source/ui/unoobj/PivotTableDataProvider.cxx
+++ b/sc/source/ui/unoobj/PivotTableDataProvider.cxx
@@ -369,7 +369,7 @@ void PivotTableDataProvider::collectPivotTableData()
uno::Reference<container::XIndexAccess> xLevels = new ScNameToIndexAccess(xLevelsSupplier->getLevels());
- for (long nLevel = 0; nLevel < xLevels->getCount(); nLevel++)
+ for (tools::Long nLevel = 0; nLevel < xLevels->getCount(); nLevel++)
{
uno::Reference<uno::XInterface> xLevel(xLevels->getByIndex(nLevel), uno::UNO_QUERY);
uno::Reference<container::XNamed> xLevelName(xLevel, uno::UNO_QUERY);
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 8e5667800811..f760656f4467 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -1115,8 +1115,8 @@ static bool lcl_PutDataArray( ScDocShell& rDocShell, const ScRange& rRange,
return false;
}
- long nCols = 0;
- long nRows = aData.getLength();
+ tools::Long nCols = 0;
+ tools::Long nRows = aData.getLength();
if ( nRows )
nCols = aData[0].getLength();
@@ -1250,8 +1250,8 @@ static bool lcl_PutFormulaArray( ScDocShell& rDocShell, const ScRange& rRange,
return false;
}
- long nCols = 0;
- long nRows = aData.getLength();
+ tools::Long nCols = 0;
+ tools::Long nRows = aData.getLength();
if ( nRows )
nCols = aData[0].getLength();
@@ -2985,7 +2985,7 @@ uno::Sequence< uno::Sequence<double> > SAL_CALL ScCellRangesBase::getData()
return uno::Sequence< uno::Sequence<double> >(0);
}
-ScRangeListRef ScCellRangesBase::GetLimitedChartRanges_Impl( long nDataColumns, long nDataRows ) const
+ScRangeListRef ScCellRangesBase::GetLimitedChartRanges_Impl( tools::Long nDataColumns, tools::Long nDataRows ) const
{
if ( aRanges.size() == 1 )
{
@@ -2998,13 +2998,13 @@ ScRangeListRef ScCellRangesBase::GetLimitedChartRanges_Impl( long nDataColumns,
SCTAB nTab = rRange.aStart.Tab();
- long nEndColumn = nDataColumns - 1 + ( bChartColAsHdr ? 1 : 0 );
+ tools::Long nEndColumn = nDataColumns - 1 + ( bChartColAsHdr ? 1 : 0 );
if ( nEndColumn < 0 )
nEndColumn = 0;
if ( nEndColumn > rDoc.MaxCol() )
nEndColumn = rDoc.MaxCol();
- long nEndRow = nDataRows - 1 + ( bChartRowAsHdr ? 1 : 0 );
+ tools::Long nEndRow = nDataRows - 1 + ( bChartRowAsHdr ? 1 : 0 );
if ( nEndRow < 0 )
nEndRow = 0;
if ( nEndRow > rDoc.MaxRow() )
@@ -3022,8 +3022,8 @@ void SAL_CALL ScCellRangesBase::setData( const uno::Sequence< uno::Sequence<doub
{
SolarMutexGuard aGuard;
bool bDone = false;
- long nRowCount = aData.getLength();
- long nColCount = nRowCount ? aData[0].getLength() : 0;
+ tools::Long nRowCount = aData.getLength();
+ tools::Long nColCount = nRowCount ? aData[0].getLength() : 0;
ScRangeListRef xChartRanges = GetLimitedChartRanges_Impl( nColCount, nRowCount );
if ( pDocShell && xChartRanges.is() )
{
@@ -3036,12 +3036,12 @@ void SAL_CALL ScCellRangesBase::setData( const uno::Sequence< uno::Sequence<doub
if ( pPosMap->GetColCount() == static_cast<SCCOL>(nColCount) &&
pPosMap->GetRowCount() == static_cast<SCROW>(nRowCount) )
{
- for (long nRow=0; nRow<nRowCount; nRow++)
+ for (tools::Long nRow=0; nRow<nRowCount; nRow++)
{
const uno::Sequence<double>& rRowSeq = aData[nRow];
const double* pArray = rRowSeq.getConstArray();
nColCount = rRowSeq.getLength();
- for (long nCol=0; nCol<nColCount; nCol++)
+ for (tools::Long nCol=0; nCol<nColCount; nCol++)
{
const ScAddress* pPos = pPosMap->GetPosition(
sal::static_int_cast<SCCOL>(nCol),
@@ -3094,7 +3094,7 @@ void SAL_CALL ScCellRangesBase::setRowDescriptions(
bool bDone = false;
if ( bChartColAsHdr )
{
- long nRowCount = aRowDescriptions.getLength();
+ tools::Long nRowCount = aRowDescriptions.getLength();
ScRangeListRef xChartRanges = GetLimitedChartRanges_Impl( 1, nRowCount );
if ( pDocShell && xChartRanges.is() )
{
@@ -3107,7 +3107,7 @@ void SAL_CALL ScCellRangesBase::setRowDescriptions(
if ( pPosMap->GetRowCount() == static_cast<SCROW>(nRowCount) )
{
const OUString* pArray = aRowDescriptions.getConstArray();
- for (long nRow=0; nRow<nRowCount; nRow++)
+ for (tools::Long nRow=0; nRow<nRowCount; nRow++)
{
const ScAddress* pPos = pPosMap->GetRowHeaderPosition(
static_cast<SCSIZE>(nRow) );
@@ -3163,7 +3163,7 @@ void SAL_CALL ScCellRangesBase::setColumnDescriptions(
bool bDone = false;
if ( bChartRowAsHdr )
{
- long nColCount = aColumnDescriptions.getLength();
+ tools::Long nColCount = aColumnDescriptions.getLength();
ScRangeListRef xChartRanges = GetLimitedChartRanges_Impl( nColCount, 1 );
if ( pDocShell && xChartRanges.is() )
{
@@ -3176,7 +3176,7 @@ void SAL_CALL ScCellRangesBase::setColumnDescriptions(
if ( pPosMap->GetColCount() == static_cast<SCCOL>(nColCount) )
{
const OUString* pArray = aColumnDescriptions.getConstArray();
- for (long nCol=0; nCol<nColCount; nCol++)
+ for (tools::Long nCol=0; nCol<nColCount; nCol++)
{
const ScAddress* pPos = pPosMap->GetColHeaderPosition(
sal::static_int_cast<SCCOL>(nCol) );
@@ -8863,7 +8863,7 @@ void ScCellFormatsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
}
-ScCellRangeObj* ScCellFormatsObj::GetObjectByIndex_Impl(long nIndex) const
+ScCellRangeObj* ScCellFormatsObj::GetObjectByIndex_Impl(tools::Long nIndex) const
{
//! access the AttrArrays directly !!!!
@@ -8871,7 +8871,7 @@ ScCellRangeObj* ScCellFormatsObj::GetObjectByIndex_Impl(long nIndex) const
if (pDocShell)
{
ScDocument& rDoc = pDocShell->GetDocument();
- long nPos = 0;
+ tools::Long nPos = 0;
ScAttrRectIterator aIter( rDoc, aTotalRange.aStart.Tab(),
aTotalRange.aStart.Col(), aTotalRange.aStart.Row(),
aTotalRange.aEnd.Col(), aTotalRange.aEnd.Row() );
@@ -8903,7 +8903,7 @@ sal_Int32 SAL_CALL ScCellFormatsObj::getCount()
//! access the AttrArrays directly !!!!
- long nCount = 0;
+ tools::Long nCount = 0;
if (pDocShell)
{
ScDocument& rDoc = pDocShell->GetDocument();
diff --git a/sc/source/ui/unoobj/chartuno.cxx b/sc/source/ui/unoobj/chartuno.cxx
index 419c373d0980..638d517b4083 100644
--- a/sc/source/ui/unoobj/chartuno.cxx
+++ b/sc/source/ui/unoobj/chartuno.cxx
@@ -81,7 +81,7 @@ void ScChartsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
}
-ScChartObj* ScChartsObj::GetObjectByIndex_Impl(long nIndex) const
+ScChartObj* ScChartsObj::GetObjectByIndex_Impl(tools::Long nIndex) const
{
OUString aName;
if ( pDocShell )
@@ -94,7 +94,7 @@ ScChartObj* ScChartsObj::GetObjectByIndex_Impl(long nIndex) const
OSL_ENSURE(pPage, "Page not found");
if (pPage)
{
- long nPos = 0;
+ tools::Long nPos = 0;
SdrObjListIter aIter( pPage, SdrIterMode::DeepNoGroups );
SdrObject* pObject = aIter.Next();
while (pObject)
@@ -354,11 +354,11 @@ uno::Sequence<OUString> SAL_CALL ScChartsObj::getElementNames()
{
ScDocument& rDoc = pDocShell->GetDocument();
- long nCount = getCount();
+ tools::Long nCount = getCount();
uno::Sequence<OUString> aSeq(nCount);
OUString* pAry = aSeq.getArray();
- long nPos = 0;
+ tools::Long nPos = 0;
ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer();
if (pDrawLayer)
{
diff --git a/sc/source/ui/unoobj/cursuno.cxx b/sc/source/ui/unoobj/cursuno.cxx
index c94d9772a203..a301be0ae24f 100644
--- a/sc/source/ui/unoobj/cursuno.cxx
+++ b/sc/source/ui/unoobj/cursuno.cxx
@@ -197,8 +197,8 @@ void SAL_CALL ScCellCursorObj::collapseToSize( sal_Int32 nColumns, sal_Int32 nRo
aNewRange.PutInOrder(); //! really?
const auto & rDoc = GetDocShell()->GetDocument();
- long nEndX = aNewRange.aStart.Col() + nColumns - 1;
- long nEndY = aNewRange.aStart.Row() + nRows - 1;
+ tools::Long nEndX = aNewRange.aStart.Col() + nColumns - 1;
+ tools::Long nEndY = aNewRange.aStart.Row() + nRows - 1;
if ( nEndX < 0 ) nEndX = 0;
if ( nEndX > rDoc.MaxCol() ) nEndX = rDoc.MaxCol();
if ( nEndY < 0 ) nEndY = 0;
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index 2104eecf0565..76ae587cba03 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -2005,7 +2005,7 @@ sal_Int16 ScDataPilotFieldObj::getFunction() const
if( pDim->GetOrientation() != DataPilotFieldOrientation_DATA )
{
// for non-data fields, property Function is the subtotals
- long nSubCount = pDim->GetSubTotalsCount();
+ tools::Long nSubCount = pDim->GetSubTotalsCount();
if ( nSubCount > 0 )
eRet = static_cast<sal_Int16>(pDim->GetSubTotalFunc(0)); // always use the first one
// else keep NONE
@@ -2488,8 +2488,8 @@ Reference< XDataPilotField > SAL_CALL ScDataPilotFieldObj::createNameGroup( cons
//! Also do this when removing groups?
//! Handle this case dynamically with automatic groups?
- long nGroupCount = pBaseGroupDim->GetGroupCount();
- for ( long nGroup = 0; nGroup < nGroupCount; nGroup++ )
+ tools::Long nGroupCount = pBaseGroupDim->GetGroupCount();
+ for ( tools::Long nGroup = 0; nGroup < nGroupCount; nGroup++ )
{
const ScDPSaveGroupItem& rBaseGroup = pBaseGroupDim->GetGroupByIndex( nGroup );
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 55d16e01d411..1fbbf37ac812 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -530,7 +530,7 @@ static ScViewData* lcl_getViewMatchingDocZoomTab(const Fraction& rZoomX,
void ScModelObj::paintTile( VirtualDevice& rDevice,
int nOutputWidth, int nOutputHeight,
int nTilePosX, int nTilePosY,
- long nTileWidth, long nTileHeight )
+ tools::Long nTileWidth, tools::Long nTileHeight )
{
ScTabViewShell* pViewShell = pDocShell->GetBestViewShell(false);
@@ -539,8 +539,8 @@ void ScModelObj::paintTile( VirtualDevice& rDevice,
return;
ScViewData* pActiveViewData = &pViewShell->GetViewData();
- Fraction aFracX(long(nOutputWidth * TWIPS_PER_PIXEL), nTileWidth);
- Fraction aFracY(long(nOutputHeight * TWIPS_PER_PIXEL), nTileHeight);
+ Fraction aFracX(tools::Long(nOutputWidth * TWIPS_PER_PIXEL), nTileWidth);
+ Fraction aFracY(tools::Long(nOutputHeight * TWIPS_PER_PIXEL), nTileHeight);
// Try to find a view that matches the tile-zoom requested by iterating over
// first few shells. This is to avoid switching of zooms in ScGridWindow::PaintTile
@@ -671,8 +671,8 @@ Size ScModelObj::getDocumentSize()
return ScViewData::ToPixel(nSize, fPPTX);
};
- long nDocWidthPixel = pViewData->GetLOKWidthHelper().computePosition(nEndCol, GetColWidthPx);
- long nDocHeightPixel = pThisDoc->GetScaledRowHeight(0, nEndRow, nTab, fPPTY);
+ tools::Long nDocWidthPixel = pViewData->GetLOKWidthHelper().computePosition(nEndCol, GetColWidthPx);
+ tools::Long nDocHeightPixel = pThisDoc->GetScaledRowHeight(0, nEndRow, nTab, fPPTY);
if (nDocWidthPixel > 0 && nDocHeightPixel > 0)
{
@@ -1100,8 +1100,8 @@ void ScModelObj::getPostIts(tools::JsonWriter& rJsonWriter)
SCCOL nX = aNote.maPos.Col();
SCROW nY = aNote.maPos.Row();
Point aScrPos = pViewData->GetScrPos(nX, nY, pViewData->GetActivePart(), true);
- long nSizeXPix;
- long nSizeYPix;
+ tools::Long nSizeXPix;
+ tools::Long nSizeYPix;
pViewData->GetMergeSizePixel(nX, nY, nSizeXPix, nSizeYPix);
double fPPTX = pViewData->GetPPTX();
@@ -1139,8 +1139,8 @@ void ScModelObj::getPostItsPos(tools::JsonWriter& rJsonWriter)
SCCOL nX = aNote.maPos.Col();
SCROW nY = aNote.maPos.Row();
Point aScrPos = pViewData->GetScrPos(nX, nY, pViewData->GetActivePart(), true);
- long nSizeXPix;
- long nSizeYPix;
+ tools::Long nSizeXPix;
+ tools::Long nSizeYPix;
pViewData->GetMergeSizePixel(nX, nY, nSizeXPix, nSizeYPix);
double fPPTX = pViewData->GetPPTX();
@@ -1751,7 +1751,7 @@ uno::Sequence<beans::PropertyValue> SAL_CALL ScModelObj::getRenderer( sal_Int32
ScPrintSelectionStatus aStatus;
OUString aPagesStr;
// #i115266# if FillRenderMarkData fails, keep nTotalPages at 0, but still handle getRenderer(0) below
- long nTotalPages = 0;
+ tools::Long nTotalPages = 0;
bool bRenderToGraphic = false;
bool bSinglePageSheets = false;
if ( FillRenderMarkData( aSelection, rOptions, aMark, aStatus, aPagesStr, bRenderToGraphic ) )
@@ -1934,8 +1934,8 @@ uno::Sequence<beans::PropertyValue> SAL_CALL ScModelObj::getRenderer( sal_Int32
else
aPage.Select( nRenderer+1 );
- long nDisplayStart = pPrintFuncCache->GetDisplayStart( nTab );
- long nTabStart = pPrintFuncCache->GetTabStart( nTab );
+ tools::Long nDisplayStart = pPrintFuncCache->GetDisplayStart( nTab );
+ tools::Long nTabStart = pPrintFuncCache->GetTabStart( nTab );
(void)pPrintFunc->DoPrint( aPage, nTabStart, nDisplayStart, false, nullptr );
@@ -1952,7 +1952,7 @@ uno::Sequence<beans::PropertyValue> SAL_CALL ScModelObj::getRenderer( sal_Int32
aPageSize.Height = TwipsToHMM( aTwips.Height());
}
- long nPropCount = bWasCellRange ? 5 : 4;
+ tools::Long nPropCount = bWasCellRange ? 5 : 4;
uno::Sequence<beans::PropertyValue> aSequence(nPropCount);
beans::PropertyValue* pArray = aSequence.getArray();
pArray[0].Name = SC_UNONAME_PAGESIZE;
@@ -2010,7 +2010,7 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec
{
pPrintFuncCache.reset(new ScPrintFuncCache( pDocShell, aMark, aStatus ));
}
- long nTotalPages = pPrintFuncCache->GetPageCount();
+ tools::Long nTotalPages = pPrintFuncCache->GetPageCount();
for ( const auto& rValue : rOptions)
{
@@ -2167,8 +2167,8 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec
else
aPage.Select( nRenderer+1 );
- long nDisplayStart = pPrintFuncCache->GetDisplayStart( nTab );
- long nTabStart = pPrintFuncCache->GetTabStart( nTab );
+ tools::Long nDisplayStart = pPrintFuncCache->GetDisplayStart( nTab );
+ tools::Long nTabStart = pPrintFuncCache->GetTabStart( nTab );
vcl::PDFExtOutDevData* pPDFData = dynamic_cast< vcl::PDFExtOutDevData* >(pDev->GetExtOutDevData() );
if ( nRenderer == nTabStart )
@@ -2261,10 +2261,10 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec
Fraction aScaleX( aLocationPixel.GetWidth(), aLocationMM.GetWidth() );
Fraction aScaleY( aLocationPixel.GetHeight(), aLocationMM.GetHeight() );
- long nX1 = aLocationPixel.Left() + static_cast<long>( Fraction( aTargetRect.Left() - aLocationMM.Left(), 1 ) * aScaleX );
- long nX2 = aLocationPixel.Left() + static_cast<long>( Fraction( aTargetRect.Right() - aLocationMM.Left(), 1 ) * aScaleX );
- long nY1 = aLocationPixel.Top() + static_cast<long>( Fraction( aTargetRect.Top() - aLocationMM.Top(), 1 ) * aScaleY );
- long nY2 = aLocationPixel.Top() + static_cast<long>( Fraction( aTargetRect.Bottom() - aLocationMM.Top(), 1 ) * aScaleY );
+ tools::Long nX1 = aLocationPixel.Left() + static_cast<tools::Long>( Fraction( aTargetRect.Left() - aLocationMM.Left(), 1 ) * aScaleX );
+ tools::Long nX2 = aLocationPixel.Left() + static_cast<tools::Long>( Fraction( aTargetRect.Right() - aLocationMM.Left(), 1 ) * aScaleX );
+ tools::Long nY1 = aLocationPixel.Top() + static_cast<tools::Long>( Fraction( aTargetRect.Top() - aLocationMM.Top(), 1 ) * aScaleY );
+ tools::Long nY2 = aLocationPixel.Top() + static_cast<tools::Long>( Fraction( aTargetRect.Bottom() - aLocationMM.Top(), 1 ) * aScaleY );
if ( nX1 > aLocationPixel.Right() ) nX1 = aLocationPixel.Right();
if ( nX2 > aLocationPixel.Right() ) nX2 = aLocationPixel.Right();
diff --git a/sc/source/ui/unoobj/fmtuno.cxx b/sc/source/ui/unoobj/fmtuno.cxx
index 48caa4bbacc1..7497cd77892d 100644
--- a/sc/source/ui/unoobj/fmtuno.cxx
+++ b/sc/source/ui/unoobj/fmtuno.cxx
@@ -406,8 +406,8 @@ uno::Any SAL_CALL ScTableConditionalFormat::getByName( const OUString& aName )
SolarMutexGuard aGuard;
uno::Reference<sheet::XSheetConditionalEntry> xEntry;
- long nCount = maEntries.size();
- for (long i=0; i<nCount; i++)
+ tools::Long nCount = maEntries.size();
+ for (tools::Long i=0; i<nCount; i++)
if ( aName == lcl_GetEntryNameFromIndex(i) )
{
xEntry.set(GetObjectByIndex_Impl(static_cast<sal_uInt16>(i)));
@@ -424,10 +424,10 @@ uno::Sequence<OUString> SAL_CALL ScTableConditionalFormat::getElementNames()
{
SolarMutexGuard aGuard;
- long nCount = maEntries.size();
+ tools::Long nCount = maEntries.size();
uno::Sequence<OUString> aNames(nCount);
OUString* pArray = aNames.getArray();
- for (long i=0; i<nCount; i++)
+ for (tools::Long i=0; i<nCount; i++)
pArray[i] = lcl_GetEntryNameFromIndex(i);
return aNames;
@@ -437,8 +437,8 @@ sal_Bool SAL_CALL ScTableConditionalFormat::hasByName( const OUString& aName )
{
SolarMutexGuard aGuard;
- long nCount = maEntries.size();
- for (long i=0; i<nCount; i++)
+ tools::Long nCount = maEntries.size();
+ for (tools::Long i=0; i<nCount; i++)
if ( aName == lcl_GetEntryNameFromIndex(i) )
return true;
diff --git a/sc/source/ui/unoobj/funcuno.cxx b/sc/source/ui/unoobj/funcuno.cxx
index 6f26b0b04c85..34de49629045 100644
--- a/sc/source/ui/unoobj/funcuno.cxx
+++ b/sc/source/ui/unoobj/funcuno.cxx
@@ -309,7 +309,7 @@ static bool lcl_AddFunctionToken( ScTokenArray& rArray, const OUString& rName,co
return false; // no valid function name
}
-static void lcl_AddRef( ScTokenArray& rArray, long nStartRow, long nColCount, long nRowCount )
+static void lcl_AddRef( ScTokenArray& rArray, tools::Long nStartRow, tools::Long nColCount, tools::Long nRowCount )
{
ScComplexRefData aRef;
aRef.InitRange(ScRange(0,nStartRow,0,nColCount-1,nStartRow+nRowCount-1,0));
@@ -332,19 +332,19 @@ public:
// the other types methods are here just to reflect the orig code and for
// completeness.
- void visitElem( long nCol, long nRow, sal_Int16 elem )
+ void visitElem( tools::Long nCol, tools::Long nRow, sal_Int16 elem )
{
mpDoc->SetValue( static_cast<SCCOL>(nCol), static_cast<SCROW>(nRow), 0, elem );
}
- void visitElem( long nCol, long nRow, sal_Int32 elem )
+ void visitElem( tools::Long nCol, tools::Long nRow, sal_Int32 elem )
{
mpDoc->SetValue( static_cast<SCCOL>(nCol), static_cast<SCROW>(nRow), 0, elem );
}
- void visitElem( long nCol, long nRow, const double& elem )
+ void visitElem( tools::Long nCol, tools::Long nRow, const double& elem )
{
mpDoc->SetValue( static_cast<SCCOL>(nCol), static_cast<SCROW>(nRow), 0, elem );
}
- void visitElem( long nCol, long nRow, const OUString& elem )
+ void visitElem( tools::Long nCol, tools::Long nRow, const OUString& elem )
{
if (!elem.isEmpty())
{
@@ -353,7 +353,7 @@ public:
mpDoc->SetString(ScAddress(nCol,nRow,0), elem, &aParam);
}
}
- void visitElem( long nCol, long nRow, const uno::Any& rElement )
+ void visitElem( tools::Long nCol, tools::Long nRow, const uno::Any& rElement )
{
uno::TypeClass eElemClass = rElement.getValueTypeClass();
if ( eElemClass == uno::TypeClass_VOID )
@@ -391,14 +391,14 @@ class SequencesContainer
{
uno::Sequence< uno::Sequence< seq > > maSeq;
- long& mrDocRow;
+ tools::Long& mrDocRow;
bool mbOverflow;
bool mbArgError;
ScDocument* mpDoc;
ScTokenArray& mrTokenArr;
public:
- SequencesContainer( const uno::Any& rArg, ScTokenArray& rTokenArr, long& rDocRow, ScDocument* pDoc ) :
+ SequencesContainer( const uno::Any& rArg, ScTokenArray& rTokenArr, tools::Long& rDocRow, ScDocument* pDoc ) :
mrDocRow( rDocRow ), mbOverflow(false), mbArgError(false), mpDoc( pDoc ), mrTokenArr( rTokenArr )
{
rArg >>= maSeq;
@@ -407,16 +407,16 @@ public:
void process()
{
SimpleVisitor aVisitor(mpDoc);
- long nStartRow = mrDocRow;
- long nRowCount = maSeq.getLength();
- long nMaxColCount = 0;
+ tools::Long nStartRow = mrDocRow;
+ tools::Long nRowCount = maSeq.getLength();
+ tools::Long nMaxColCount = 0;
for ( const uno::Sequence< seq >& rRow : maSeq )
{
- long nColCount = rRow.getLength();
+ tools::Long nColCount = rRow.getLength();
if ( nColCount > nMaxColCount )
nMaxColCount = nColCount;
const seq* pColArr = rRow.getConstArray();
- for (long nCol=0; nCol<nColCount; nCol++)
+ for (tools::Long nCol=0; nCol<nColCount; nCol++)
if ( nCol <= mpDoc->MaxCol() && mrDocRow <= mpDoc->MaxRow() )
aVisitor.visitElem( nCol, mrDocRow, pColArr[ nCol ] );
else
@@ -436,7 +436,7 @@ class ArrayOfArrayProc
{
public:
static void processSequences( ScDocument* pDoc, const uno::Any& rArg, ScTokenArray& rTokenArr,
- long& rDocRow, bool& rArgErr, bool& rOverflow )
+ tools::Long& rDocRow, bool& rArgErr, bool& rOverflow )
{
SequencesContainer< T > aContainer( rArg, rTokenArr, rDocRow, pDoc );
aContainer.process();
@@ -487,13 +487,13 @@ uno::Any SAL_CALL ScFunctionAccess::callFunction( const OUString& aName,
bool bArgErr = false;
bool bOverflow = false;
- long nDocRow = 0;
- long nArgCount = aArguments.getLength();
+ tools::Long nDocRow = 0;
+ tools::Long nArgCount = aArguments.getLength();
const uno::Any* pArgArr = aArguments.getConstArray();
svl::SharedStringPool& rSPool = pDoc->GetSharedStringPool();
aTokenArr.AddOpCode(ocOpen);
- for (long nPos=0; nPos<nArgCount; nPos++)
+ for (tools::Long nPos=0; nPos<nArgCount; nPos++)
{
if ( nPos > 0 )
aTokenArr.AddOpCode(ocSep);
@@ -557,9 +557,9 @@ uno::Any SAL_CALL ScFunctionAccess::callFunction( const OUString& aName,
{
ScRange const & rSrcRange = rRanges[ 0 ];
- long nStartRow = nDocRow;
- long nColCount = rSrcRange.aEnd.Col() - rSrcRange.aStart.Col() + 1;
- long nRowCount = rSrcRange.aEnd.Row() - rSrcRange.aStart.Row() + 1;
+ tools::Long nStartRow = nDocRow;
+ tools::Long nColCount = rSrcRange.aEnd.Col() - rSrcRange.aStart.Col() + 1;
+ tools::Long nRowCount = rSrcRange.aEnd.Row() - rSrcRange.aStart.Row() + 1;
if ( nStartRow + nRowCount > pDoc->GetSheetLimits().GetMaxRowCount() )
bOverflow = true;
diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx
index 4dafd1dc2185..26b16368ef25 100644
--- a/sc/source/ui/unoobj/nameuno.cxx
+++ b/sc/source/ui/unoobj/nameuno.cxx
@@ -579,7 +579,7 @@ uno::Reference<container::XEnumeration> SAL_CALL ScNamedRangesObj::createEnumera
sal_Int32 SAL_CALL ScNamedRangesObj::getCount()
{
SolarMutexGuard aGuard;
- long nRet = 0;
+ tools::Long nRet = 0;
if (pDocShell)
{
ScRangeName* pNames = GetRangeName_Impl();
@@ -662,7 +662,7 @@ uno::Sequence<OUString> SAL_CALL ScNamedRangesObj::getElementNames()
ScRangeName* pNames = GetRangeName_Impl();
if (pNames)
{
- long nVisCount = getCount(); // names with lcl_UserVisibleName
+ tools::Long nVisCount = getCount(); // names with lcl_UserVisibleName
uno::Sequence<OUString> aSeq(nVisCount);
OUString* pAry = aSeq.getArray();
sal_uInt16 nVisPos = 0;
diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx
index 2d63065555ea..feea0f85f567 100644
--- a/sc/source/ui/unoobj/viewuno.cxx
+++ b/sc/source/ui/unoobj/viewuno.cxx
@@ -199,7 +199,7 @@ void SAL_CALL ScViewPaneBase::setFirstVisibleColumn(sal_Int32 nFirstVisibleColum
static_cast<ScSplitPos>(nPane);
ScHSplitPos eWhichH = WhichH( eWhich );
- long nDeltaX = static_cast<long>(nFirstVisibleColumn) - rViewData.GetPosX( eWhichH );
+ tools::Long nDeltaX = static_cast<tools::Long>(nFirstVisibleColumn) - rViewData.GetPosX( eWhichH );
pViewShell->ScrollX( nDeltaX, eWhichH );
}
}
@@ -232,7 +232,7 @@ void SAL_CALL ScViewPaneBase::setFirstVisibleRow( sal_Int32 nFirstVisibleRow )
static_cast<ScSplitPos>(nPane);
ScVSplitPos eWhichV = WhichV( eWhich );
- long nDeltaY = static_cast<long>(nFirstVisibleRow) - rViewData.GetPosY( eWhichV );
+ tools::Long nDeltaY = static_cast<tools::Long>(nFirstVisibleRow) - rViewData.GetPosY( eWhichV );
pViewShell->ScrollY( nDeltaY, eWhichV );
}
}
@@ -766,12 +766,12 @@ sal_Bool SAL_CALL ScTabViewObj::select( const uno::Any& aSelection )
// and select all objects on that sheet
//!?throw exception when objects are on different sheets?
- long nCount = xShapeColl->getCount();
+ tools::Long nCount = xShapeColl->getCount();
if (nCount)
{
SdrPageView* pPV = nullptr;
bool bAllMarked(true);
- for ( long i = 0; i < nCount; i++ )
+ for ( tools::Long i = 0; i < nCount; i++ )
{
uno::Reference<drawing::XShape> xShapeInt(xShapeColl->getByIndex(i), uno::UNO_QUERY);
if (xShapeInt.is())
@@ -1368,7 +1368,7 @@ sal_Int16 ScTabViewObj::GetZoom() const
if (pViewSh)
{
const Fraction& rZoomY = pViewSh->GetViewData().GetZoomY(); // Y will be shown
- return static_cast<sal_Int16>(long( rZoomY * 100 ));
+ return static_cast<sal_Int16>(tools::Long( rZoomY * 100 ));
}
return 0;
}
@@ -1549,7 +1549,7 @@ sal_Int32 SAL_CALL ScTabViewObj::getSplitColumn()
ScViewData& rViewData = pViewSh->GetViewData();
if ( rViewData.GetHSplitMode() != SC_SPLIT_NONE )
{
- long nSplit = rViewData.GetHSplitPos();
+ tools::Long nSplit = rViewData.GetHSplitPos();
ScSplitPos ePos = SC_SPLIT_BOTTOMLEFT;
if ( rViewData.GetVSplitMode() != SC_SPLIT_NONE )
@@ -1574,7 +1574,7 @@ sal_Int32 SAL_CALL ScTabViewObj::getSplitRow()
ScViewData& rViewData = pViewSh->GetViewData();
if ( rViewData.GetVSplitMode() != SC_SPLIT_NONE )
{
- long nSplit = rViewData.GetVSplitPos();
+ tools::Long nSplit = rViewData.GetVSplitPos();
// split vertically
SCCOL nCol;
diff --git a/sc/source/ui/vba/vbahyperlink.hxx b/sc/source/ui/vba/vbahyperlink.hxx
index 93c686ccfbbb..047a5cb69965 100644
--- a/sc/source/ui/vba/vbahyperlink.hxx
+++ b/sc/source/ui/vba/vbahyperlink.hxx
@@ -23,6 +23,7 @@
#include <ooo/vba/excel/XHyperlink.hpp>
#include <vbahelper/vbahelperinterface.hxx>
+#include <tools/long.hxx>
namespace ooo::vba::excel { class XRange; }
namespace com::sun::star::beans { class XPropertySet; }
@@ -80,7 +81,7 @@ private:
css::uno::Reference< css::table::XCell > mxCell;
css::uno::Reference< css::beans::XPropertySet > mxTextField;
OUString maScreenTip;
- long mnType;
+ tools::Long mnType;
};
#endif // INCLUDED_SC_SOURCE_UI_VBA_VBAHYPERLINK_HXX
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index 510a0d428c2b..019a0d8601b9 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -185,7 +185,7 @@ static double lcl_TwipsToPoints( sal_uInt16 nVal )
static double lcl_Round2DecPlaces( double nVal )
{
nVal = (nVal * double(100));
- long tmp = static_cast<long>(nVal);
+ tools::Long tmp = static_cast<tools::Long>(nVal);
if ( ( nVal - tmp ) >= 0.5 )
++tmp;
nVal = double(tmp)/100;
@@ -489,7 +489,7 @@ public:
}
uno::Reference< beans::XPropertySet > getNumberProps()
{
- long nIndexKey = 0;
+ tools::Long nIndexKey = 0;
uno::Any aValue = mxRangeProps->getPropertyValue( "NumberFormat" );
aValue >>= nIndexKey;
@@ -2021,7 +2021,7 @@ ScVbaRange::Characters(const uno::Any& Start, const uno::Any& Length)
return xRange->Characters( Start, Length );
}
- long nIndex = 0, nCount = 0;
+ tools::Long nIndex = 0, nCount = 0;
OUString rString;
uno::Reference< text::XTextRange > xTextRange(mxRange, ::uno::UNO_QUERY_THROW );
rString = xTextRange->getString();
@@ -2591,7 +2591,7 @@ ScVbaRange::getNumberFormat()
uno::Reference< excel::XRange >
ScVbaRange::Resize( const uno::Any &RowSize, const uno::Any &ColumnSize )
{
- long nRowSize = 0, nColumnSize = 0;
+ tools::Long nRowSize = 0, nColumnSize = 0;
bool bIsRowChanged = ( RowSize >>= nRowSize ), bIsColumnChanged = ( ColumnSize >>= nColumnSize );
uno::Reference< table::XColumnRowRange > xColumnRowRange(mxRange, ::uno::UNO_QUERY_THROW);
uno::Reference< sheet::XSheetCellRange > xSheetRange(mxRange, ::uno::UNO_QUERY_THROW);
@@ -3746,7 +3746,7 @@ static double getDefaultCharWidth( ScDocShell* pDocShell )
vcl::Font aDefFont;
pAttr->GetFont( aDefFont, SC_AUTOCOL_BLACK, pRefDevice );
pRefDevice->SetFont( aDefFont );
- long nCharWidth = pRefDevice->GetTextWidth( OUString( '0' ) ); // 1/100th mm
+ tools::Long nCharWidth = pRefDevice->GetTextWidth( OUString( '0' ) ); // 1/100th mm
return lcl_hmmToPoints( nCharWidth );
}
diff --git a/sc/source/ui/vba/vbaworksheets.cxx b/sc/source/ui/vba/vbaworksheets.cxx
index 616440ac0daa..5ff95d735e72 100644
--- a/sc/source/ui/vba/vbaworksheets.cxx
+++ b/sc/source/ui/vba/vbaworksheets.cxx
@@ -523,7 +523,7 @@ void ScVbaWorksheets::PrintPreview( const css::uno::Any& /*EnableChanges*/ )
// force update
pPrvView->DataChanged(false);
// set sensible first page
- long nPage = pPrvView->GetFirstPage( 1 );
+ tools::Long nPage = pPrvView->GetFirstPage( 1 );
pPrvView->SetPageNo( nPage );
WaitUntilPreviewIsClosed( pViewFrame );
// restore old tab selection
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index 538f8a4bb949..924ce27ab5f8 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -704,7 +704,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
if ( pDlg->Execute() == RET_OK )
{
- long nVal = pDlg->GetInputValue();
+ tools::Long nVal = pDlg->GetInputValue();
pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_DIRECT, static_cast<sal_uInt16>(nVal) );
// #101390#; the value of the macro should be in HMM so use TwipsToEvenHMM to convert
@@ -740,7 +740,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
ScGlobal::nLastRowHeightExtra, 0, eMetric, 1, MAX_EXTRA_HEIGHT));
if ( pDlg->Execute() == RET_OK )
{
- long nVal = pDlg->GetInputValue();
+ tools::Long nVal = pDlg->GetInputValue();
pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_OPTIMAL, static_cast<sal_uInt16>(nVal) );
ScGlobal::nLastRowHeightExtra = nVal;
@@ -801,7 +801,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
STD_COL_WIDTH, eMetric, 2, MAX_COL_WIDTH));
if ( pDlg->Execute() == RET_OK )
{
- long nVal = pDlg->GetInputValue();
+ tools::Long nVal = pDlg->GetInputValue();
pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_DIRECT, static_cast<sal_uInt16>(nVal) );
// #101390#; the value of the macro should be in HMM so use TwipsToEvenHMM to convert
@@ -837,7 +837,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
ScGlobal::nLastColWidthExtra, STD_EXTRA_WIDTH, eMetric, 1, MAX_EXTRA_WIDTH));
if ( pDlg->Execute() == RET_OK )
{
- long nVal = pDlg->GetInputValue();
+ tools::Long nVal = pDlg->GetInputValue();
pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_OPTIMAL, static_cast<sal_uInt16>(nVal) );
ScGlobal::nLastColWidthExtra = nVal;
diff --git a/sc/source/ui/view/colrowba.cxx b/sc/source/ui/view/colrowba.cxx
index 69e6118d46ec..f8d711edc3d8 100644
--- a/sc/source/ui/view/colrowba.cxx
+++ b/sc/source/ui/view/colrowba.cxx
@@ -31,7 +31,7 @@
#include <tabview.hxx>
#include <columnspanset.hxx>
-static OUString lcl_MetricString( long nTwips, const OUString& rText )
+static OUString lcl_MetricString( tools::Long nTwips, const OUString& rText )
{
if ( nTwips <= 0 )
return ScResId(STR_TIP_HIDE);
@@ -187,7 +187,7 @@ bool ScColBar::ResizeAllowed() const
return !rViewData.HasEditView( rViewData.GetActivePart() );
}
-void ScColBar::DrawInvert( long nDragPosP )
+void ScColBar::DrawInvert( tools::Long nDragPosP )
{
tools::Rectangle aRect( nDragPosP,0, nDragPosP+HDR_SLIDERSIZE-1,GetOutputSizePixel().Width()-1 );
PaintImmediately();
@@ -196,9 +196,9 @@ void ScColBar::DrawInvert( long nDragPosP )
pTabView->GetViewData().GetView()->InvertVertical(meWhich,nDragPosP);
}
-OUString ScColBar::GetDragHelp( long nVal )
+OUString ScColBar::GetDragHelp( tools::Long nVal )
{
- long nTwips = static_cast<long>( nVal / pTabView->GetViewData().GetPPTX() );
+ tools::Long nTwips = static_cast<tools::Long>( nVal / pTabView->GetViewData().GetPPTX() );
return lcl_MetricString( nTwips, ScResId(STR_TIP_WIDTH) );
}
@@ -347,7 +347,7 @@ bool ScRowBar::ResizeAllowed() const
return !rViewData.HasEditView( rViewData.GetActivePart() );
}
-void ScRowBar::DrawInvert( long nDragPosP )
+void ScRowBar::DrawInvert( tools::Long nDragPosP )
{
tools::Rectangle aRect( 0,nDragPosP, GetOutputSizePixel().Width()-1,nDragPosP+HDR_SLIDERSIZE-1 );
PaintImmediately();
@@ -356,9 +356,9 @@ void ScRowBar::DrawInvert( long nDragPosP )
pTabView->GetViewData().GetView()->InvertHorizontal(meWhich,nDragPosP);
}
-OUString ScRowBar::GetDragHelp( long nVal )
+OUString ScRowBar::GetDragHelp( tools::Long nVal )
{
- long nTwips = static_cast<long>( nVal / pTabView->GetViewData().GetPPTY() );
+ tools::Long nTwips = static_cast<tools::Long>( nVal / pTabView->GetViewData().GetPPTY() );
return lcl_MetricString( nTwips, ScResId(STR_TIP_HEIGHT) );
}
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index 22263116da5b..55b308dfb869 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -739,16 +739,16 @@ void ScDBFunc::RecalcPivotTable()
ErrorMessage(STR_PIVOT_NOTFOUND);
}
-void ScDBFunc::GetSelectedMemberList(ScDPUniqueStringSet& rEntries, long& rDimension)
+void ScDBFunc::GetSelectedMemberList(ScDPUniqueStringSet& rEntries, tools::Long& rDimension)
{
ScDPObject* pDPObj = GetViewData().GetDocument().GetDPAtCursor( GetViewData().GetCurX(),
GetViewData().GetCurY(), GetViewData().GetTabNo() );
if ( !pDPObj )
return;
- long nStartDimension = -1;
- long nStartHierarchy = -1;
- long nStartLevel = -1;
+ tools::Long nStartDimension = -1;
+ tools::Long nStartHierarchy = -1;
+ tools::Long nStartLevel = -1;
ScRangeListRef xRanges;
GetViewData().GetMultiArea( xRanges ); // incl. cursor if nothing is selected
@@ -816,7 +816,7 @@ bool ScDBFunc::HasSelectionForDateGroup( ScDPNumGroupInfo& rOldInfo, sal_Int32&
if ( pDPObj )
{
ScDPUniqueStringSet aEntries;
- long nSelectDimension = -1;
+ tools::Long nSelectDimension = -1;
GetSelectedMemberList( aEntries, nSelectDimension );
if (!aEntries.empty())
@@ -929,7 +929,7 @@ bool ScDBFunc::HasSelectionForNumGroup( ScDPNumGroupInfo& rOldInfo )
if ( pDPObj )
{
ScDPUniqueStringSet aEntries;
- long nSelectDimension = -1;
+ tools::Long nSelectDimension = -1;
GetSelectedMemberList( aEntries, nSelectDimension );
if (!aEntries.empty())
@@ -990,7 +990,7 @@ void ScDBFunc::DateGroupDataPilot( const ScDPNumGroupInfo& rInfo, sal_Int32 nPar
return;
ScDPUniqueStringSet aEntries;
- long nSelectDimension = -1;
+ tools::Long nSelectDimension = -1;
GetSelectedMemberList( aEntries, nSelectDimension );
if (aEntries.empty())
@@ -1088,7 +1088,7 @@ void ScDBFunc::NumGroupDataPilot( const ScDPNumGroupInfo& rInfo )
return;
ScDPUniqueStringSet aEntries;
- long nSelectDimension = -1;
+ tools::Long nSelectDimension = -1;
GetSelectedMemberList( aEntries, nSelectDimension );
if (aEntries.empty())
@@ -1130,7 +1130,7 @@ void ScDBFunc::GroupDataPilot()
return;
ScDPUniqueStringSet aEntries;
- long nSelectDimension = -1;
+ tools::Long nSelectDimension = -1;
GetSelectedMemberList( aEntries, nSelectDimension );
if (aEntries.empty())
@@ -1195,8 +1195,8 @@ void ScDBFunc::GroupDataPilot()
//! Also do this when removing groups?
//! Handle this case dynamically with automatic groups?
- long nGroupCount = pBaseGroupDim->GetGroupCount();
- for ( long nGroup = 0; nGroup < nGroupCount; nGroup++ )
+ tools::Long nGroupCount = pBaseGroupDim->GetGroupCount();
+ for ( tools::Long nGroup = 0; nGroup < nGroupCount; nGroup++ )
{
const ScDPSaveGroupItem& rBaseGroup = pBaseGroupDim->GetGroupByIndex( nGroup );
@@ -1265,7 +1265,7 @@ void ScDBFunc::UngroupDataPilot()
return;
ScDPUniqueStringSet aEntries;
- long nSelectDimension = -1;
+ tools::Long nSelectDimension = -1;
GetSelectedMemberList( aEntries, nSelectDimension );
if (aEntries.empty())
@@ -1402,7 +1402,7 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const OUString& rString )
bool bNeedReloadGroups = false;
DataPilotFieldOrientation nOrient = DataPilotFieldOrientation_HIDDEN;
- long nField = pDPObj->GetHeaderDim( rPos, nOrient );
+ tools::Long nField = pDPObj->GetHeaderDim( rPos, nOrient );
if ( nField >= 0 )
{
// changing a field title
@@ -1534,7 +1534,7 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const OUString& rString )
else if (aPosData.Dimension >= 0 && !aPosData.MemberName.isEmpty())
{
bool bDataLayout = false;
- OUString aDimName = pDPObj->GetDimName(static_cast<long>(aPosData.Dimension), bDataLayout);
+ OUString aDimName = pDPObj->GetDimName(static_cast<tools::Long>(aPosData.Dimension), bDataLayout);
if (bDataLayout)
{
// data dimension
@@ -1688,7 +1688,7 @@ struct ScOUStringCollate
}
-void ScDBFunc::DataPilotSort(ScDPObject* pDPObj, long nDimIndex, bool bAscending, const sal_uInt16* pUserListId)
+void ScDBFunc::DataPilotSort(ScDPObject* pDPObj, tools::Long nDimIndex, bool bAscending, const sal_uInt16* pUserListId)
{
if (!pDPObj)
return;
@@ -1913,7 +1913,7 @@ bool ScDBFunc::HasSelectionForDrillDown( css::sheet::DataPilotFieldOrientation&
if ( pDPObj )
{
ScDPUniqueStringSet aEntries;
- long nSelectDimension = -1;
+ tools::Long nSelectDimension = -1;
GetSelectedMemberList( aEntries, nSelectDimension );
if (!aEntries.empty())
@@ -1949,7 +1949,7 @@ void ScDBFunc::SetDataPilotDetails(bool bShow, const OUString* pNewDimensionName
return;
ScDPUniqueStringSet aEntries;
- long nSelectDimension = -1;
+ tools::Long nSelectDimension = -1;
GetSelectedMemberList( aEntries, nSelectDimension );
if (aEntries.empty())
@@ -1979,7 +1979,7 @@ void ScDBFunc::SetDataPilotDetails(bool bShow, const OUString* pNewDimensionName
css::sheet::DataPilotFieldOrientation nOrientation = pDim->GetOrientation();
pNewDim->SetOrientation( nOrientation );
- long nPosition = LONG_MAX;
+ tools::Long nPosition = LONG_MAX;
aData.SetPosition( pNewDim, nPosition );
ScDPSaveDimension* pDataLayout = aData.GetDataLayoutDimension();
diff --git a/sc/source/ui/view/drawutil.cxx b/sc/source/ui/view/drawutil.cxx
index 52f8c7a259cd..3a6f14561372 100644
--- a/sc/source/ui/view/drawutil.cxx
+++ b/sc/source/ui/view/drawutil.cxx
@@ -31,14 +31,14 @@ void ScDrawUtil::CalcScale( const ScDocument& rDoc, SCTAB nTab,
double nPPTX, double nPPTY,
Fraction& rScaleX, Fraction& rScaleY )
{
- long nPixelX = 0;
- long nTwipsX = 0;
- long nPixelY = 0;
- long nTwipsY = 0;
+ tools::Long nPixelX = 0;
+ tools::Long nTwipsX = 0;
+ tools::Long nPixelY = 0;
+ tools::Long nTwipsY = 0;
for (SCCOL i=nStartCol; i<nEndCol; i++)
{
sal_uInt16 nWidth = rDoc.GetColWidth(i,nTab);
- nTwipsX += static_cast<long>(nWidth);
+ nTwipsX += static_cast<tools::Long>(nWidth);
nPixelX += ScViewData::ToPixel( nWidth, nPPTX );
}
@@ -52,7 +52,7 @@ void ScDrawUtil::CalcScale( const ScDocument& rDoc, SCTAB nTab,
}
sal_uInt16 nHeight = rDoc.GetRowHeight(nRow, nTab);
- nTwipsY += static_cast<long>(nHeight);
+ nTwipsY += static_cast<tools::Long>(nHeight);
nPixelY += ScViewData::ToPixel(nHeight, nPPTY);
}
diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx
index 3584e270e3be..bce240b10b12 100644
--- a/sc/source/ui/view/drawvie4.cxx
+++ b/sc/source/ui/view/drawvie4.cxx
@@ -434,7 +434,7 @@ void ScDrawView::SetMarkedOriginalSize()
std::unique_ptr<SdrUndoGroup> pUndoGroup(new SdrUndoGroup(*GetModel()));
const SdrMarkList& rMarkList = GetMarkedObjectList();
- long nDone = 0;
+ tools::Long nDone = 0;
const size_t nCount = rMarkList.GetMarkCount();
for (size_t i=0; i<nCount; ++i)
{
@@ -553,10 +553,10 @@ void ScDrawView::FitToCellSize()
// For graphic objects, we want to keep the aspect ratio
if (pObj->shouldKeepAspectRatio())
{
- long nWidth = aGraphicRect.GetWidth();
+ tools::Long nWidth = aGraphicRect.GetWidth();
assert(nWidth && "div-by-zero");
double fScaleX = static_cast<double>(aCellRect.GetWidth()) / static_cast<double>(nWidth);
- long nHeight = aGraphicRect.GetHeight();
+ tools::Long nHeight = aGraphicRect.GetHeight();
assert(nHeight && "div-by-zero");
double fScaleY = static_cast<double>(aCellRect.GetHeight()) / static_cast<double>(nHeight);
double fScaleMin = std::min(fScaleX, fScaleY);
diff --git a/sc/source/ui/view/gridmerg.cxx b/sc/source/ui/view/gridmerg.cxx
index a07937207dc4..a21be85fc970 100644
--- a/sc/source/ui/view/gridmerg.cxx
+++ b/sc/source/ui/view/gridmerg.cxx
@@ -28,7 +28,7 @@
#define PAGEBREAK_LINE_DASH_LEN_PIXEL 5
#define PAGEBREAK_LINE_DASH_COUNT 1
-ScGridMerger::ScGridMerger( OutputDevice* pOutDev, long nOnePixelX, long nOnePixelY )
+ScGridMerger::ScGridMerger( OutputDevice* pOutDev, tools::Long nOnePixelX, tools::Long nOnePixelY )
: pDev(pOutDev)
, nOneX(nOnePixelX)
, nOneY(nOnePixelY)
@@ -50,7 +50,7 @@ ScGridMerger::~ScGridMerger()
Flush();
}
-void ScGridMerger::AddLine( long nStart, long nEnd, long nPos )
+void ScGridMerger::AddLine( tools::Long nStart, tools::Long nEnd, tools::Long nPos )
{
if ( nCount )
{
@@ -93,7 +93,7 @@ void ScGridMerger::AddLine( long nStart, long nEnd, long nPos )
}
}
-void ScGridMerger::AddHorLine(bool bWorksInPixels, long nX1, long nX2, long nY, bool bDashed)
+void ScGridMerger::AddHorLine(bool bWorksInPixels, tools::Long nX1, tools::Long nX2, tools::Long nY, bool bDashed)
{
if ( bWorksInPixels )
{
@@ -137,7 +137,7 @@ void ScGridMerger::AddHorLine(bool bWorksInPixels, long nX1, long nX2, long nY,
pDev->DrawLine( Point( nX1, nY ), Point( nX2, nY ) );
}
-void ScGridMerger::AddVerLine(bool bWorksInPixels, long nX, long nY1, long nY2, bool bDashed)
+void ScGridMerger::AddVerLine(bool bWorksInPixels, tools::Long nX, tools::Long nY1, tools::Long nY2, bool bDashed)
{
if (bWorksInPixels)
{
@@ -192,7 +192,7 @@ void ScGridMerger::Flush()
pDev->DrawLine( Point( nVarStart, nFixStart ), Point( nVarStart, nFixEnd ) );
else
{
- long nVarEnd = nVarStart + ( nCount - 1 ) * nVarDiff;
+ tools::Long nVarEnd = nVarStart + ( nCount - 1 ) * nVarDiff;
if ( nVarDiff < 0 )
{
// nVarDiff is negative in RTL layout mode
@@ -200,7 +200,7 @@ void ScGridMerger::Flush()
// (nVarStart / nVarDiff can be modified, aren't used after Flush)
nVarDiff = -nVarDiff;
- long nTemp = nVarStart;
+ tools::Long nTemp = nVarStart;
nVarStart = nVarEnd;
nVarEnd = nTemp;
}
@@ -215,7 +215,7 @@ void ScGridMerger::Flush()
pDev->DrawLine( Point( nFixStart, nVarStart ), Point( nFixEnd, nVarStart ) );
else
{
- long nVarEnd = nVarStart + ( nCount - 1 ) * nVarDiff;
+ tools::Long nVarEnd = nVarStart + ( nCount - 1 ) * nVarDiff;
pDev->DrawGrid( tools::Rectangle( nFixStart, nVarStart, nFixEnd, nVarEnd ),
Size( nFixEnd - nFixStart, nVarDiff ),
DrawGridFlags::HorzLines );
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 291e2106d23a..5c45e2ef53bb 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -648,8 +648,8 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow)
pData->maPos = ScAddress(nCol, nRow, nTab);
Point aPos = mrViewData.GetScrPos(nCol, nRow, eWhich);
- long nSizeX = 0;
- long nSizeY = 0;
+ tools::Long nSizeX = 0;
+ tools::Long nSizeY = 0;
mrViewData.GetMergeSizePixel(nCol, nRow, nSizeX, nSizeY);
if (bLOKActive)
{
@@ -897,7 +897,7 @@ void getCellGeometry(Point& rScrPos, Size& rScrSize, const ScViewData& rViewData
rScrPos = rViewData.GetScrPos(nCol, nRow, eWhich);
// Get the screen size of the cell.
- long nSizeX, nSizeY;
+ tools::Long nSizeX, nSizeY;
rViewData.GetMergeSizePixel(nCol, nRow, nSizeX, nSizeY);
rScrSize = Size(nSizeX-1, nSizeY-1);
}
@@ -941,7 +941,7 @@ void ScGridWindow::ShowFilterMenu(const tools::Rectangle& rCellRect, bool bLayou
// minimum width in pixel
if (comphelper::LibreOfficeKit::isActive())
{
- const long nMinLOKWinWidth = static_cast<long>(1.3 * STD_COL_WIDTH / TWIPS_PER_PIXEL);
+ const tools::Long nMinLOKWinWidth = static_cast<tools::Long>(1.3 * STD_COL_WIDTH / TWIPS_PER_PIXEL);
if (nSizeX < nMinLOKWinWidth)
nSizeX = nMinLOKWinWidth;
}
@@ -968,8 +968,8 @@ void ScGridWindow::ShowFilterMenu(const tools::Rectangle& rCellRect, bool bLayou
if (!bLayoutRTL && aSize.Width() > nSizeX)
{
// move popup position
- long nDiff = aSize.Width() - nSizeX;
- long nNewX = aCellRect.Left() - nDiff;
+ tools::Long nDiff = aSize.Width() - nSizeX;
+ tools::Long nNewX = aCellRect.Left() - nDiff;
if ( nNewX < 0 )
nNewX = 0;
aCellRect.SetLeft( nNewX );
@@ -1003,8 +1003,8 @@ void ScGridWindow::DoScenarioMenu( const ScRange& rScenRange )
SCTAB nTab = mrViewData.GetTabNo();
bool bLayoutRTL = rDoc.IsLayoutRTL( nTab );
- long nSizeX = 0;
- long nSizeY = 0;
+ tools::Long nSizeX = 0;
+ tools::Long nSizeY = 0;
mrViewData.GetMergeSizePixel( nCol, nRow, nSizeX, nSizeY );
// The button height should not use the merged cell height, should still use single row height
nSizeY = ScViewData::ToPixel(rDoc.GetRowHeight(nRow, nTab), mrViewData.GetPPTY());
@@ -1081,8 +1081,8 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow )
SCTAB nTab = mrViewData.GetTabNo();
bool bLayoutRTL = rDoc.IsLayoutRTL( nTab );
- long nSizeX = 0;
- long nSizeY = 0;
+ tools::Long nSizeX = 0;
+ tools::Long nSizeY = 0;
mrViewData.GetMergeSizePixel( nCol, nRow, nSizeX, nSizeY );
Point aPos = mrViewData.GetScrPos( nCol, nRow, eWhich );
bool bLOKActive = comphelper::LibreOfficeKit::isActive();
@@ -1467,7 +1467,7 @@ bool ScGridWindow::IsCellCoveredByText(SCCOL nPosX, SCROW nPosY, SCTAB nTab, SCC
SCROW nTextEndY;
// test the rightmost position of the text bounding box
- long nMiddle = (aRect.Top() + aRect.Bottom()) / 2;
+ tools::Long nMiddle = (aRect.Top() + aRect.Bottom()) / 2;
mrViewData.GetPosFromPixel(aRect.Right(), nMiddle, eWhich, nTextEndX, nTextEndY);
if (nTextEndX >= nPosX)
{
@@ -3005,8 +3005,8 @@ void ScGridWindow::Command( const CommandEvent& rCEvt )
SCCOL nCurX = mrViewData.GetCurX();
SCROW nCurY = mrViewData.GetCurY();
aMenuPos = mrViewData.GetScrPos( nCurX, nCurY, eWhich, true );
- long nSizeXPix;
- long nSizeYPix;
+ tools::Long nSizeXPix;
+ tools::Long nSizeYPix;
mrViewData.GetMergeSizePixel( nCurX, nCurY, nSizeXPix, nSizeYPix );
// fdo#55432 take the correct position for RTL sheet
aMenuPos.AdjustX(bLayoutIsRTL ? -nSizeXPix : nSizeXPix );
@@ -3066,7 +3066,7 @@ void ScGridWindow::SelectForContextMenu( const Point& rPosPixel, SCCOL nCellX, S
if ( pEditEngine->IsVertical() ) // have to manually transform position
{
aTextPos -= aOutputArea.TopRight();
- long nTemp = -aTextPos.X();
+ tools::Long nTemp = -aTextPos.X();
aTextPos.setX( aTextPos.Y() );
aTextPos.setY( nTemp );
}
@@ -3115,7 +3115,7 @@ void ScGridWindow::SelectForContextMenu( const Point& rPosPixel, SCCOL nCellX, S
if ( pOutliner->IsVertical() ) // have to manually transform position
{
aTextPos -= aOutputArea.TopRight();
- long nTemp = -aTextPos.X();
+ tools::Long nTemp = -aTextPos.X();
aTextPos.setX( aTextPos.Y() );
aTextPos.setY( nTemp );
}
@@ -3609,8 +3609,8 @@ sal_Int8 ScGridWindow::AcceptPrivateDrop( const AcceptDropEvent& rEvt )
{
if ( &rThisDoc == pSourceDoc && nTab == aSourceRange.aStart.Tab() )
{
- long nDeltaX = labs( static_cast< long >( nNewDragX - nSourceStartX ) );
- long nDeltaY = labs( static_cast< long >( nNewDragY - nSourceStartY ) );
+ tools::Long nDeltaX = labs( static_cast< tools::Long >( nNewDragX - nSourceStartX ) );
+ tools::Long nDeltaY = labs( static_cast< tools::Long >( nNewDragY - nSourceStartY ) );
if ( nDeltaX <= nDeltaY )
{
eDragInsertMode = INS_CELLSDOWN;
@@ -3637,7 +3637,7 @@ sal_Int8 ScGridWindow::AcceptPrivateDrop( const AcceptDropEvent& rEvt )
}
else
{
- if ( static_cast< long >( nSizeX ) >= static_cast< long >( nSizeY ) )
+ if ( static_cast< tools::Long >( nSizeX ) >= static_cast< tools::Long >( nSizeY ) )
{
eDragInsertMode = INS_CELLSDOWN;
@@ -4523,7 +4523,7 @@ void ScGridWindow::UpdateEditViewPos()
if (bHide)
{
tools::Rectangle aRect = pView->GetOutputArea();
- long nHeight = aRect.Bottom() - aRect.Top();
+ tools::Long nHeight = aRect.Bottom() - aRect.Top();
aRect.SetTop( PixelToLogic(GetOutputSizePixel(), mrViewData.GetLogicMode()).
Height() * 2 );
aRect.SetBottom( aRect.Top() + nHeight );
@@ -4555,7 +4555,7 @@ void ScGridWindow::UpdateEditViewPos()
}
}
-void ScGridWindow::ScrollPixel( long nDifX, long nDifY )
+void ScGridWindow::ScrollPixel( tools::Long nDifX, tools::Long nDifY )
{
ClickExtern();
HideNoteMarker();
@@ -4630,17 +4630,17 @@ void ScGridWindow::UpdateFormulas(SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2)
}
Point aScrPos = mrViewData.GetScrPos( nX1, nY1, eWhich );
- long nMirrorWidth = GetSizePixel().Width();
+ tools::Long nMirrorWidth = GetSizePixel().Width();
bool bLayoutRTL = rDoc.IsLayoutRTL( nTab );
if ( bLayoutRTL )
{
- long nEndPixel = mrViewData.GetScrPos( nX2+1, nPosY, eWhich ).X();
+ tools::Long nEndPixel = mrViewData.GetScrPos( nX2+1, nPosY, eWhich ).X();
nMirrorWidth = aScrPos.X() - nEndPixel;
aScrPos.setX( nEndPixel + 1 );
}
- long nScrX = aScrPos.X();
- long nScrY = aScrPos.Y();
+ tools::Long nScrX = aScrPos.X();
+ tools::Long nScrY = aScrPos.Y();
double nPPTX = mrViewData.GetPPTX();
double nPPTY = mrViewData.GetPPTY();
@@ -4797,7 +4797,7 @@ bool ScGridWindow::HitRangeFinder( const Point& rMouse, RfCorner& rCorner,
ScDocument& rDoc = mrViewData.GetDocument();
SCTAB nTab = mrViewData.GetTabNo();
bool bLayoutRTL = rDoc.IsLayoutRTL( nTab );
- long nLayoutSign = bLayoutRTL ? -1 : 1;
+ tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
SCCOL nPosX;
SCROW nPosY;
@@ -4807,8 +4807,8 @@ bool ScGridWindow::HitRangeFinder( const Point& rMouse, RfCorner& rCorner,
Point aCellStart = mrViewData.GetScrPos( nPosX, nPosY, eWhich, true );
Point aCellEnd = aCellStart;
- long nSizeXPix;
- long nSizeYPix;
+ tools::Long nSizeXPix;
+ tools::Long nSizeYPix;
mrViewData.GetMergeSizePixel( nPosX, nPosY, nSizeXPix, nSizeYPix );
aCellEnd.AdjustX(nSizeXPix * nLayoutSign );
@@ -5114,17 +5114,17 @@ void ScGridWindow::RFMouseMove( const MouseEvent& rMEvt, bool bUp )
else
{
ScDocument& rDoc = mrViewData.GetDocument();
- long nStartX = nPosX - nRFAddX;
+ tools::Long nStartX = nPosX - nRFAddX;
if ( nStartX < 0 ) nStartX = 0;
- long nStartY = nPosY - nRFAddY;
+ tools::Long nStartY = nPosY - nRFAddY;
if ( nStartY < 0 ) nStartY = 0;
- long nEndX = nStartX + aOld.aEnd.Col() - aOld.aStart.Col();
+ tools::Long nEndX = nStartX + aOld.aEnd.Col() - aOld.aStart.Col();
if ( nEndX > rDoc.MaxCol() )
{
nStartX -= ( nEndX - rDoc.MaxRow() );
nEndX = rDoc.MaxCol();
}
- long nEndY = nStartY + aOld.aEnd.Row() - aOld.aStart.Row();
+ tools::Long nEndY = nStartY + aOld.aEnd.Row() - aOld.aStart.Row();
if ( nEndY > rDoc.MaxRow() )
{
nStartY -= ( nEndY - rDoc.MaxRow() );
@@ -5279,12 +5279,12 @@ bool ScGridWindow::GetEditUrl( const Point& rPos,
MapMode aEditMode = mrViewData.GetLogicMode(eWhich); // without draw scaling
tools::Rectangle aLogicEdit = PixelToLogic( aEditRect, aEditMode );
- long nThisColLogic = aLogicEdit.Right() - aLogicEdit.Left() + 1;
+ tools::Long nThisColLogic = aLogicEdit.Right() - aLogicEdit.Left() + 1;
Size aPaperSize( 1000000, 1000000 );
if (aCell.meType == CELLTYPE_FORMULA)
{
- long nSizeX = 0;
- long nSizeY = 0;
+ tools::Long nSizeX = 0;
+ tools::Long nSizeY = 0;
mrViewData.GetMergeSizePixel( nPosX, nPosY, nSizeX, nSizeY );
aPaperSize = Size(nSizeX, nSizeY );
aPaperSize = PixelToLogic(aPaperSize);
@@ -5323,10 +5323,10 @@ bool ScGridWindow::GetEditUrl( const Point& rPos,
pEngine->SetTextCurrentDefaults(*pTextObj);
}
- long nStartX = aLogicEdit.Left();
+ tools::Long nStartX = aLogicEdit.Left();
- long nTextWidth = pEngine->CalcTextWidth();
- long nTextHeight = pEngine->GetTextHeight();
+ tools::Long nTextWidth = pEngine->CalcTextWidth();
+ tools::Long nTextHeight = pEngine->GetTextHeight();
if ( nTextWidth < nThisColLogic )
{
if (eHorJust == SvxCellHorJustify::Right)
@@ -5406,7 +5406,7 @@ bool ScGridWindow::IsSpellErrorAtPos( const Point& rPos, SCCOL nCol1, SCROW nRow
else
pEngine->SetTextCurrentDefaults(aCell.mpString->getString());
- long nTextWidth = static_cast<long>(pEngine->CalcTextWidth());
+ tools::Long nTextWidth = static_cast<tools::Long>(pEngine->CalcTextWidth());
MapMode aEditMode = mrViewData.GetLogicMode(eWhich);
tools::Rectangle aLogicEdit = PixelToLogic(aEditRect, aEditMode);
@@ -5436,11 +5436,11 @@ bool ScGridWindow::HasScenarioButton( const Point& rPosPixel, ScRange& rScenRang
bool bLayoutRTL = rDoc.IsLayoutRTL( nTab );
Size aButSize = mrViewData.GetScenButSize();
- long nBWidth = aButSize.Width();
+ tools::Long nBWidth = aButSize.Width();
if (!nBWidth)
return false; // No Button drawn yet -> there is none
- long nBHeight = aButSize.Height();
- long nHSpace = static_cast<long>( SC_SCENARIO_HSPACE * mrViewData.GetPPTX() );
+ tools::Long nBHeight = aButSize.Height();
+ tools::Long nHSpace = static_cast<tools::Long>( SC_SCENARIO_HSPACE * mrViewData.GetPPTX() );
//! cache the Ranges in Table!!!!
@@ -5926,8 +5926,8 @@ void ScGridWindow::UpdateCopySourceOverlay()
Point aClipStartScrPos = mrViewData.GetScrPos( nClipStartX, nClipStartY, eWhich );
Point aClipEndScrPos = mrViewData.GetScrPos( nClipEndX + 1, nClipEndY + 1, eWhich );
aClipStartScrPos -= Point(1, 1);
- long nSizeXPix = aClipEndScrPos.X() - aClipStartScrPos.X();
- long nSizeYPix = aClipEndScrPos.Y() - aClipStartScrPos.Y();
+ tools::Long nSizeXPix = aClipEndScrPos.X() - aClipStartScrPos.X();
+ tools::Long nSizeYPix = aClipEndScrPos.Y() - aClipStartScrPos.Y();
tools::Rectangle aRect( aClipStartScrPos, Size(nSizeXPix, nSizeYPix) );
@@ -6206,8 +6206,8 @@ void ScGridWindow::UpdateCursorOverlay()
// in the tiled rendering case, don't limit to the screen size
if (bMaybeVisible || comphelper::LibreOfficeKit::isActive())
{
- long nSizeXPix;
- long nSizeYPix;
+ tools::Long nSizeXPix;
+ tools::Long nSizeYPix;
mrViewData.GetMergeSizePixel( nX, nY, nSizeXPix, nSizeYPix );
if (bLayoutRTL)
@@ -6218,7 +6218,7 @@ void ScGridWindow::UpdateCursorOverlay()
float fScaleFactor = GetDPIScaleFactor();
- long aCursorWidth = 1 * fScaleFactor;
+ tools::Long aCursorWidth = 1 * fScaleFactor;
tools::Rectangle aLeft = aRect;
aLeft.AdjustTop( -aCursorWidth );
@@ -6431,8 +6431,8 @@ void ScGridWindow::UpdateAutoFillOverlay()
Size aFillHandleSize(6 * fScaleFactor, 6 * fScaleFactor);
Point aFillPos = mrViewData.GetScrPos( nX, nY, eWhich, true );
- long nSizeXPix;
- long nSizeYPix;
+ tools::Long nSizeXPix;
+ tools::Long nSizeYPix;
mrViewData.GetMergeSizePixel( nX, nY, nSizeXPix, nSizeYPix );
if (bLayoutRTL)
@@ -6519,15 +6519,15 @@ void ScGridWindow::UpdateDragRectOverlay()
Point aScrPos( mrViewData.GetScrPos( nX1, nY1, eWhich ) );
- long nSizeXPix=0;
- long nSizeYPix=0;
+ tools::Long nSizeXPix=0;
+ tools::Long nSizeYPix=0;
ScDocument& rDoc = mrViewData.GetDocument();
double nPPTX = mrViewData.GetPPTX();
double nPPTY = mrViewData.GetPPTY();
SCCOLROW i;
bool bLayoutRTL = rDoc.IsLayoutRTL( nTab );
- long nLayoutSign = bLayoutRTL ? -1 : 1;
+ tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
if (rDoc.ValidCol(nX2) && nX2>=nX1)
for (i=nX1; i<=nX2; i++)
diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index 90c3e08f5781..0d1ef7ea71c9 100644
--- a/sc/source/ui/view/gridwin2.cxx
+++ b/sc/source/ui/view/gridwin2.cxx
@@ -65,7 +65,7 @@ DataPilotFieldOrientation ScGridWindow::GetDPFieldOrientation( SCCOL nCol, SCROW
if (nCol > 0)
{
// look for the dimension header left of the drop-down arrow
- long nField = pDPObj->GetHeaderDim( ScAddress( nCol-1, nRow, nTab ), nOrient );
+ tools::Long nField = pDPObj->GetHeaderDim( ScAddress( nCol-1, nRow, nTab ), nOrient );
if ( nField >= 0 && nOrient == DataPilotFieldOrientation_PAGE )
{
bool bIsDataLayout = false;
@@ -78,7 +78,7 @@ DataPilotFieldOrientation ScGridWindow::GetDPFieldOrientation( SCCOL nCol, SCROW
nOrient = DataPilotFieldOrientation_HIDDEN;
// Now, check for row/column field.
- long nField = pDPObj->GetHeaderDim(ScAddress(nCol, nRow, nTab), nOrient);
+ tools::Long nField = pDPObj->GetHeaderDim(ScAddress(nCol, nRow, nTab), nOrient);
if (nField >= 0 && (nOrient == DataPilotFieldOrientation_COLUMN || nOrient == DataPilotFieldOrientation_ROW) )
{
bool bIsDataLayout = false;
@@ -113,7 +113,7 @@ bool ScGridWindow::DoAutoFilterButton( SCCOL nCol, SCROW nRow, const MouseEvent&
if ( bLayoutRTL )
aDiffPix.setX( -aDiffPix.X() );
- long nSizeX, nSizeY;
+ tools::Long nSizeX, nSizeY;
mrViewData.GetMergeSizePixel( nCol, nRow, nSizeX, nSizeY );
// The button height should not use the merged cell height, should still use single row height
nSizeY = ScViewData::ToPixel(rDoc.GetRowHeight(nRow, nTab), mrViewData.GetPPTY());
@@ -161,7 +161,7 @@ void ScGridWindow::DoPushPivotButton( SCCOL nCol, SCROW nRow, const MouseEvent&
// For page field selection cell, the real field position is to the left.
aDimPos.IncCol(-1);
- long nField = pDPObj->GetHeaderDim(aDimPos, nOrient);
+ tools::Long nField = pDPObj->GetHeaderDim(aDimPos, nOrient);
if ( nField >= 0 )
{
bDPMouse = false;
@@ -273,7 +273,7 @@ void ScGridWindow::DPTestMouse( const MouseEvent& rMEvt, bool bMove )
tools::Rectangle aPosRect;
DataPilotFieldOrientation nOrient;
- long nDimPos;
+ tools::Long nDimPos;
bool bHasRange = pDragDPObj->GetHeaderDrag( aPos, bMouseLeft, bMouseTop, nDPField,
aPosRect, nOrient, nDimPos );
UpdateDragRect( bHasRange && bMove, aPosRect );
@@ -346,7 +346,7 @@ bool ScGridWindow::DPTestFieldPopupArrow(
// Get the geometry of the cell.
Point aScrPos = mrViewData.GetScrPos(rPos.Col(), rPos.Row(), eWhich);
- long nSizeX, nSizeY;
+ tools::Long nSizeX, nSizeY;
mrViewData.GetMergeSizePixel(rPos.Col(), rPos.Row(), nSizeX, nSizeY);
Size aScrSize(nSizeX-1, nSizeY-1);
@@ -374,7 +374,7 @@ struct DPFieldPopupData : public ScCheckListMenuControl::ExtendedData
{
ScDPLabelData maLabels;
ScDPObject* mpDPObj;
- long mnDim;
+ tools::Long mnDim;
};
class DPFieldPopupOKAction : public ScCheckListMenuControl::Action
@@ -396,7 +396,7 @@ class PopupSortAction : public ScCheckListMenuControl::Action
public:
enum SortType { ASCENDING, DESCENDING, CUSTOM };
- explicit PopupSortAction(ScDPObject* pDPObject, long nDimIndex, SortType eType,
+ explicit PopupSortAction(ScDPObject* pDPObject, tools::Long nDimIndex, SortType eType,
sal_uInt16 nUserListIndex, ScTabViewShell* pViewShell)
: mpDPObject(pDPObject)
, mnDimIndex(nDimIndex)
@@ -425,7 +425,7 @@ public:
private:
ScDPObject* mpDPObject;
- long mnDimIndex;
+ tools::Long mnDimIndex;
SortType meType;
sal_uInt16 mnUserListIndex;
ScTabViewShell* mpViewShell;
@@ -437,13 +437,13 @@ void ScGridWindow::DPLaunchFieldPopupMenu(const Point& rScreenPosition, const Si
const ScAddress& rAddress, ScDPObject* pDPObject)
{
DataPilotFieldOrientation nOrient;
- long nDimIndex = pDPObject->GetHeaderDim(rAddress, nOrient);
+ tools::Long nDimIndex = pDPObject->GetHeaderDim(rAddress, nOrient);
DPLaunchFieldPopupMenu(rScreenPosition, rScreenSize, nDimIndex, pDPObject);
}
void ScGridWindow::DPLaunchFieldPopupMenu(const Point& rScrPos, const Size& rScrSize,
- long nDimIndex, ScDPObject* pDPObj)
+ tools::Long nDimIndex, ScDPObject* pDPObj)
{
std::unique_ptr<DPFieldPopupData> pDPData(new DPFieldPopupData);
pDPData->mnDim = nDimIndex;
@@ -704,8 +704,8 @@ sal_uInt16 ScGridWindow::HitPageBreak( const Point& rMouse, ScRange* pSource,
SCCOL nHitX = 0;
SCROW nHitY = 0;
- long nMouseX = rMouse.X();
- long nMouseY = rMouse.Y();
+ tools::Long nMouseX = rMouse.X();
+ tools::Long nMouseY = rMouse.Y();
SCCOL nPosX;
SCROW nPosY;
mrViewData.GetPosFromPixel( nMouseX, nMouseY, eWhich, nPosX, nPosY );
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 724d840ab990..cc3fa9c7ff0b 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -103,8 +103,8 @@ static void lcl_DrawOneFrame( vcl::RenderContext* pDev, const tools::Rectangle&
lcl_LimitRect( aInner, aVisible );
tools::Rectangle aOuter = aInner;
- long nHor = static_cast<long>( SC_SCENARIO_HSPACE * nPPTX );
- long nVer = static_cast<long>( SC_SCENARIO_VSPACE * nPPTY );
+ tools::Long nHor = static_cast<tools::Long>( SC_SCENARIO_HSPACE * nPPTX );
+ tools::Long nVer = static_cast<tools::Long>( SC_SCENARIO_VSPACE * nPPTY );
aOuter.AdjustLeft( -nHor );
aOuter.AdjustRight(nHor );
aOuter.AdjustTop( -nVer );
@@ -137,18 +137,18 @@ static void lcl_DrawOneFrame( vcl::RenderContext* pDev, const tools::Rectangle&
pDev->DrawRect( tools::Rectangle( aInner.Right(), aOuter.Top(), aOuter.Right(), aOuter.Bottom() ) );
pDev->DrawRect( tools::Rectangle( aOuter.Left(), aInner.Bottom(), aOuter.Right(), aOuter.Bottom() ) );
- long nButtonY = bTextBelow ? aInner.Bottom() : aOuter.Top();
+ tools::Long nButtonY = bTextBelow ? aInner.Bottom() : aOuter.Top();
ScDDComboBoxButton aComboButton(pDev);
aComboButton.SetOptSizePixel();
- long nBWidth = long(aComboButton.GetSizePixel().Width() * rZoomY);
- long nBHeight = nVer + aTextSize.Height() + 1;
+ tools::Long nBWidth = tools::Long(aComboButton.GetSizePixel().Width() * rZoomY);
+ tools::Long nBHeight = nVer + aTextSize.Height() + 1;
Size aButSize( nBWidth, nBHeight );
- long nButtonPos = bLayoutRTL ? aOuter.Left() : aOuter.Right()-nBWidth+1;
+ tools::Long nButtonPos = bLayoutRTL ? aOuter.Left() : aOuter.Right()-nBWidth+1;
aComboButton.Draw( Point(nButtonPos, nButtonY), aButSize );
rButtonViewData.SetScenButSize( aButSize );
- long nTextStart = bLayoutRTL ? aInner.Right() - aTextSize.Width() + 1 : aInner.Left();
+ tools::Long nTextStart = bLayoutRTL ? aInner.Right() - aTextSize.Width() + 1 : aInner.Left();
bool bWasClip = false;
vcl::Region aOldClip;
@@ -160,8 +160,8 @@ static void lcl_DrawOneFrame( vcl::RenderContext* pDev, const tools::Rectangle&
bWasClip = true;
aOldClip = pDev->GetActiveClipRegion();
}
- long nClipStartX = bLayoutRTL ? aOuter.Left() + nBWidth : aInner.Left();
- long nClipEndX = bLayoutRTL ? aInner.Right() : aOuter.Right() - nBWidth;
+ tools::Long nClipStartX = bLayoutRTL ? aOuter.Left() + nBWidth : aInner.Left();
+ tools::Long nClipEndX = bLayoutRTL ? aInner.Right() : aOuter.Right() - nBWidth;
pDev->SetClipRegion( vcl::Region(tools::Rectangle( nClipStartX, nButtonY + nVer/2,
nClipEndX, nButtonY + nVer/2 + aTextSize.Height())) );
}
@@ -208,7 +208,7 @@ static void lcl_DrawScenarioFrames( OutputDevice* pDev, ScViewData& rViewData, S
aMarks.FillRangeListWithMarks( xRanges.get(), false );
bool bLayoutRTL = rDoc.IsLayoutRTL( nTab );
- long nLayoutSign = bLayoutRTL ? -1 : 1;
+ tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
for (size_t j = 0, n = xRanges->size(); j < n; ++j)
{
@@ -401,12 +401,12 @@ void ScGridWindow::Paint( vcl::RenderContext& /*rRenderContext*/, const tools::R
if ( rDoc.IsLayoutRTL( nTab ) )
{
// mirror and swap
- long nWidth = GetSizePixel().Width();
+ tools::Long nWidth = GetSizePixel().Width();
aMirroredPixel.SetLeft( nWidth - 1 - aPixRect.Right() );
aMirroredPixel.SetRight( nWidth - 1 - aPixRect.Left() );
}
- long nScrX = ScViewData::ToPixel( rDoc.GetColWidth( nX1, nTab ), nPPTX );
+ tools::Long nScrX = ScViewData::ToPixel( rDoc.GetColWidth( nX1, nTab ), nPPTX );
while ( nScrX <= aMirroredPixel.Left() && nX1 < rDoc.MaxCol() )
{
++nX1;
@@ -419,7 +419,7 @@ void ScGridWindow::Paint( vcl::RenderContext& /*rRenderContext*/, const tools::R
nScrX += ScViewData::ToPixel( rDoc.GetColWidth( nX2, nTab ), nPPTX );
}
- long nScrY = 0;
+ tools::Long nScrY = 0;
ScViewData::AddPixelsWhile( nScrY, aPixRect.Top(), nY1, rDoc.MaxRow(), nPPTY, &rDoc, nTab);
SCROW nY2 = nY1;
if (nScrY <= aPixRect.Bottom() && nY2 < rDoc.MaxRow())
@@ -484,17 +484,17 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
rDoc.ExtendHidden( nX1, nY1, nX2, nY2, nTab );
Point aScrPos = mrViewData.GetScrPos( nX1, nY1, eWhich );
- long nMirrorWidth = GetSizePixel().Width();
+ tools::Long nMirrorWidth = GetSizePixel().Width();
bool bLayoutRTL = rDoc.IsLayoutRTL( nTab );
if ( bLayoutRTL )
{
- long nEndPixel = mrViewData.GetScrPos( nX2+1, maVisibleRange.mnRow1, eWhich ).X();
+ tools::Long nEndPixel = mrViewData.GetScrPos( nX2+1, maVisibleRange.mnRow1, eWhich ).X();
nMirrorWidth = aScrPos.X() - nEndPixel;
aScrPos.setX( nEndPixel + 1 );
}
- long nScrX = aScrPos.X();
- long nScrY = aScrPos.Y();
+ tools::Long nScrX = aScrPos.X();
+ tools::Long nScrY = aScrPos.Y();
SCCOL nCurX = mrViewData.GetCurX();
SCROW nCurY = mrViewData.GetCurY();
@@ -616,8 +616,8 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
SCROW nY1 = aOutputData.nY1;
SCCOL nX2 = aOutputData.nX2;
SCROW nY2 = aOutputData.nY2;
- long nScrX = aOutputData.nScrX;
- long nScrY = aOutputData.nScrY;
+ tools::Long nScrX = aOutputData.nScrX;
+ tools::Long nScrY = aOutputData.nScrY;
const svtools::ColorConfig& rColorCfg = pScMod->GetColorConfig();
Color aGridColor( rColorCfg.GetColorValue( svtools::CALCGRID, false ).nColor );
@@ -1002,8 +1002,8 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
EditView* pOtherEditView = rOtherViewData.GetEditView(eOtherWhich);
if (pOtherEditView)
{
- long nScreenX = aOutputData.nScrX;
- long nScreenY = aOutputData.nScrY;
+ tools::Long nScreenX = aOutputData.nScrX;
+ tools::Long nScreenY = aOutputData.nScrY;
rDevice.SetLineColor();
rDevice.SetFillColor(pOtherEditView->GetBackgroundColor());
@@ -1011,7 +1011,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
Point aEnd = mrViewData.GetScrPos( nCol2+1, nRow2+1, eOtherWhich );
// don't overwrite grid
- long nLayoutSign = bLayoutRTL ? -1 : 1;
+ tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
aEnd.AdjustX( -(2 * nLayoutSign) );
aEnd.AdjustY( -2 );
@@ -1088,7 +1088,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
Point aEnd = mrViewData.GetScrPos( nCol2+1, nRow2+1, eWhich );
// don't overwrite grid
- long nLayoutSign = bLayoutRTL ? -1 : 1;
+ tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
aEnd.AdjustX( -(2 * nLayoutSign) );
aEnd.AdjustY( -2 );
@@ -1222,7 +1222,7 @@ namespace
{
template<typename IndexType>
void lcl_getBoundingRowColumnforTile(ScViewData& rViewData,
- long nTileStartPosPx, long nTileEndPosPx,
+ tools::Long nTileStartPosPx, tools::Long nTileEndPosPx,
sal_Int32& nTopLeftTileOffset, sal_Int32& nTopLeftTileOrigin,
sal_Int32& nTopLeftTileIndex, sal_Int32& nBottomRightTileIndex)
{
@@ -1232,8 +1232,8 @@ namespace
IndexType nStartIndex = -1;
IndexType nEndIndex = -1;
- long nStartPosPx = 0;
- long nEndPosPx = 0;
+ tools::Long nStartPosPx = 0;
+ tools::Long nEndPosPx = 0;
ScPositionHelper& rPositionHelper =
bColumnHeader ? rViewData.GetLOKWidthHelper() : rViewData.GetLOKHeightHelper();
@@ -1312,7 +1312,7 @@ namespace
void ScGridWindow::PaintTile( VirtualDevice& rDevice,
int nOutputWidth, int nOutputHeight,
int nTilePosX, int nTilePosY,
- long nTileWidth, long nTileHeight )
+ tools::Long nTileWidth, tools::Long nTileHeight )
{
Fraction origZoomX = mrViewData.GetZoomX();
Fraction origZoomY = mrViewData.GetZoomY();
@@ -1332,8 +1332,8 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice,
// Similarly to Writer, we should set the mapmode once on the rDevice, and
// not care about any zoom settings.
- Fraction aFracX(long(nOutputWidth * TWIPS_PER_PIXEL), nTileWidth);
- Fraction aFracY(long(nOutputHeight * TWIPS_PER_PIXEL), nTileHeight);
+ Fraction aFracX(tools::Long(nOutputWidth * TWIPS_PER_PIXEL), nTileWidth);
+ Fraction aFracY(tools::Long(nOutputHeight * TWIPS_PER_PIXEL), nTileHeight);
const bool bChangeZoom = (aFracX != origZoomX || aFracY != origZoomY);
@@ -1716,18 +1716,18 @@ void ScGridWindow::DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
Point aPageEnd = mrViewData.GetScrPos(
nPrEndX+1,nPrEndY+1, eWhich, true );
- long nPageNo = rData.GetFirstPage();
+ tools::Long nPageNo = rData.GetFirstPage();
if ( rData.IsTopDown() )
- nPageNo += static_cast<long>(nColPos)*nRowBreaks+nRowPos;
+ nPageNo += static_cast<tools::Long>(nColPos)*nRowBreaks+nRowPos;
else
- nPageNo += static_cast<long>(nRowPos)*nColBreaks+nColPos;
+ nPageNo += static_cast<tools::Long>(nRowPos)*nColBreaks+nColPos;
OUString aThisPageStr = aPageStr.replaceFirst("%1", OUString::number(nPageNo));
if ( pEditEng )
{
// find right font size with EditEngine
- long nHeight = 100;
+ tools::Long nHeight = 100;
pEditEng->SetDefaultItem( SvxFontHeightItem( nHeight, 100, EE_CHAR_FONTHEIGHT ) );
pEditEng->SetDefaultItem( SvxFontHeightItem( nHeight, 100, EE_CHAR_FONTHEIGHT_CJK ) );
pEditEng->SetDefaultItem( SvxFontHeightItem( nHeight, 100, EE_CHAR_FONTHEIGHT_CTL ) );
@@ -1735,8 +1735,8 @@ void ScGridWindow::DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
Size aSize100( pEditEng->CalcTextWidth(), pEditEng->GetTextHeight() );
// 40% of width or 60% of height
- long nSizeX = 40 * ( aPageEnd.X() - aPageStart.X() ) / aSize100.Width();
- long nSizeY = 60 * ( aPageEnd.Y() - aPageStart.Y() ) / aSize100.Height();
+ tools::Long nSizeX = 40 * ( aPageEnd.X() - aPageStart.X() ) / aSize100.Width();
+ tools::Long nSizeY = 60 * ( aPageEnd.Y() - aPageStart.Y() ) / aSize100.Height();
nHeight = std::min(nSizeX,nSizeY);
pEditEng->SetDefaultItem( SvxFontHeightItem( nHeight, 100, EE_CHAR_FONTHEIGHT ) );
pEditEng->SetDefaultItem( SvxFontHeightItem( nHeight, 100, EE_CHAR_FONTHEIGHT_CJK ) );
@@ -1756,8 +1756,8 @@ void ScGridWindow::DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
Size aSize100(rRenderContext.GetTextWidth( aThisPageStr ), rRenderContext.GetTextHeight() );
// 40% of width or 60% of height
- long nSizeX = 40 * ( aPageEnd.X() - aPageStart.X() ) / aSize100.Width();
- long nSizeY = 60 * ( aPageEnd.Y() - aPageStart.Y() ) / aSize100.Height();
+ tools::Long nSizeX = 40 * ( aPageEnd.X() - aPageStart.X() ) / aSize100.Width();
+ tools::Long nSizeY = 60 * ( aPageEnd.Y() - aPageStart.Y() ) / aSize100.Height();
aFont.SetFontSize( Size( 0,std::min(nSizeX,nSizeY) ) );
rRenderContext.SetFont( aFont );
@@ -1863,8 +1863,8 @@ void ScGridWindow::DrawButtons(SCCOL nX1, SCCOL nX2, const ScTableInfo& rTabInfo
}
bool bArrowState = bSimpleQuery && bColumnFound;
- long nSizeX;
- long nSizeY;
+ tools::Long nSizeX;
+ tools::Long nSizeY;
SCCOL nStartCol= nCol;
SCROW nStartRow = nRow;
//if address(nCol,nRow) is not the start pos of the merge area, the value of the nSizeX will be incorrect, it will be the length of the cell.
@@ -1895,11 +1895,11 @@ void ScGridWindow::DrawButtons(SCCOL nX1, SCCOL nX2, const ScTableInfo& rTabInfo
continue;
Point aScrPos = mrViewData.GetScrPos( nCol, nRow, eWhich );
- long nSizeX;
- long nSizeY;
+ tools::Long nSizeX;
+ tools::Long nSizeY;
mrViewData.GetMergeSizePixel( nCol, nRow, nSizeX, nSizeY );
- long nPosX = aScrPos.X();
- long nPosY = aScrPos.Y();
+ tools::Long nPosX = aScrPos.X();
+ tools::Long nPosY = aScrPos.Y();
// bLayoutRTL is handled in setBoundingBox
OUString aStr = rDoc.GetString(nCol, nRow, nTab);
@@ -1935,7 +1935,7 @@ tools::Rectangle ScGridWindow::GetListValButtonRect( const ScAddress& rButtonPos
ScDocument& rDoc = mrViewData.GetDocument();
SCTAB nTab = mrViewData.GetTabNo();
bool bLayoutRTL = rDoc.IsLayoutRTL( nTab );
- long nLayoutSign = bLayoutRTL ? -1 : 1;
+ tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
ScDDComboBoxButton aButton( this ); // for optimal size
Size aBtnSize = aButton.GetSizePixel();
@@ -1943,13 +1943,13 @@ tools::Rectangle ScGridWindow::GetListValButtonRect( const ScAddress& rButtonPos
SCCOL nCol = rButtonPos.Col();
SCROW nRow = rButtonPos.Row();
- long nCellSizeX; // width of this cell, including merged
- long nDummy;
+ tools::Long nCellSizeX; // width of this cell, including merged
+ tools::Long nDummy;
mrViewData.GetMergeSizePixel( nCol, nRow, nCellSizeX, nDummy );
// for height, only the cell's row is used, excluding merged cells
- long nCellSizeY = ScViewData::ToPixel( rDoc.GetRowHeight( nRow, nTab ), mrViewData.GetPPTY() );
- long nAvailable = nCellSizeX;
+ tools::Long nCellSizeY = ScViewData::ToPixel( rDoc.GetRowHeight( nRow, nTab ), mrViewData.GetPPTY() );
+ tools::Long nAvailable = nCellSizeX;
// left edge of next cell if there is a non-hidden next column
SCCOL nNextCol = nCol + 1;
@@ -2045,7 +2045,7 @@ void ScGridWindow::GetRectsAnyFor(const ScMarkData &rMarkData,
SCTAB nTab = mrViewData.GetTabNo();
bool bLayoutRTL = rDoc.IsLayoutRTL( nTab );
- long nLayoutSign = bLayoutRTL ? -1 : 1;
+ tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
if ( !aMultiMark.IsMultiMarked() )
return;
ScRange aMultiRange;
@@ -2113,7 +2113,7 @@ void ScGridWindow::GetRectsAnyFor(const ScMarkData &rMarkData,
Point aScrPos = bInPrintTwips ? mrViewData.GetPrintTwipsPos(nX1, nY1) :
mrViewData.GetScrPos(nX1, nY1, eWhich);
- long nScrY = aScrPos.Y();
+ tools::Long nScrY = aScrPos.Y();
bool bWasHidden = false;
for (SCROW nY=nY1; nY<=nY2; nY++)
{
@@ -2150,19 +2150,19 @@ void ScGridWindow::GetRectsAnyFor(const ScMarkData &rMarkData,
nLoopEndX = nX1;
}
- const long nHeight = bInPrintTwips ?
+ const tools::Long nHeight = bInPrintTwips ?
nHeightTwips : ScViewData::ToPixel(nHeightTwips, nPPTY);
- long nEndY = nScrY + nHeight - 1;
- long nScrX = aScrPos.X();
+ tools::Long nEndY = nScrY + nHeight - 1;
+ tools::Long nScrX = aScrPos.X();
for (SCCOL nX=nX1; nX<=nLoopEndX; nX++)
{
- long nWidth = rDoc.GetColWidth(nX, nTab);
+ tools::Long nWidth = rDoc.GetColWidth(nX, nTab);
if (!bInPrintTwips)
nWidth = ScViewData::ToPixel(nWidth, nPPTX);
if ( nWidth > 0 )
{
- long nEndX = nScrX + ( nWidth - 1 ) * nLayoutSign;
+ tools::Long nEndX = nScrX + ( nWidth - 1 ) * nLayoutSign;
SCROW nThisY = nY;
const ScPatternAttr* pPattern = rDoc.GetPattern( nX, nY, nTab );
diff --git a/sc/source/ui/view/gridwin_dbgutil.cxx b/sc/source/ui/view/gridwin_dbgutil.cxx
index de7ac8abcce2..fe4c6f594d2f 100644
--- a/sc/source/ui/view/gridwin_dbgutil.cxx
+++ b/sc/source/ui/view/gridwin_dbgutil.cxx
@@ -46,7 +46,7 @@ void ScGridWindow::dumpColumnInformationPixel()
for (SCCOL nCol = 0; nCol <= 20; ++nCol)
{
sal_uInt16 nWidth = rDoc.GetColWidth(nCol, nTab);
- long nPixel = LogicToPixel(Point(nWidth, 0), MapMode(MapUnit::MapTwip)).getX();
+ tools::Long nPixel = LogicToPixel(Point(nWidth, 0), MapMode(MapUnit::MapTwip)).getX();
std::cout << "Column: " << nCol << ", Width: " << nPixel << "px" << std::endl;
}
}
@@ -58,7 +58,7 @@ void ScGridWindow::dumpColumnInformationHmm()
for (SCCOL nCol = 0; nCol <= 20; ++nCol)
{
sal_uInt16 nWidth = rDoc.GetColWidth(nCol, nTab);
- long nPixel = LogicToLogic(Point(nWidth, 0), MapMode(MapUnit::MapTwip), MapMode(MapUnit::Map100thMM)).getX();
+ tools::Long nPixel = LogicToLogic(Point(nWidth, 0), MapMode(MapUnit::MapTwip), MapMode(MapUnit::Map100thMM)).getX();
std::cout << "Column: " << nCol << ", Width: " << nPixel << "hmm" << std::endl;
}
}
diff --git a/sc/source/ui/view/hdrcont.cxx b/sc/source/ui/view/hdrcont.cxx
index 85c9e1323eaa..12f4ad7c0a4b 100644
--- a/sc/source/ui/view/hdrcont.cxx
+++ b/sc/source/ui/view/hdrcont.cxx
@@ -91,7 +91,7 @@ ScHeaderControl::ScHeaderControl( vcl::Window* pParent, SelectionEngine* pSelect
SetBackground();
}
-void ScHeaderControl::SetWidth( long nNew )
+void ScHeaderControl::SetWidth( tools::Long nNew )
{
OSL_ENSURE( bVertical, "SetWidth works only on row headers" );
if ( nNew != nWidth )
@@ -112,7 +112,7 @@ ScHeaderControl::~ScHeaderControl()
void ScHeaderControl::DoPaint( SCCOLROW nStart, SCCOLROW nEnd )
{
bool bLayoutRTL = IsLayoutRTL();
- long nLayoutSign = bLayoutRTL ? -1 : 1;
+ tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
tools::Rectangle aRect( Point(0,0), GetOutputSizePixel() );
if ( bVertical )
@@ -171,11 +171,11 @@ void ScHeaderControl::SetMark( bool bNewSet, SCCOLROW nNewStart, SCCOLROW nNewEn
DoPaint( nOldStart, nOldEnd ); // cancel selection
}
-long ScHeaderControl::GetScrPos( SCCOLROW nEntryNo ) const
+tools::Long ScHeaderControl::GetScrPos( SCCOLROW nEntryNo ) const
{
- long nScrPos;
+ tools::Long nScrPos;
- long nMax = ( bVertical ? GetOutputSizePixel().Height() : GetOutputSizePixel().Width() ) + 1;
+ tools::Long nMax = ( bVertical ? GetOutputSizePixel().Height() : GetOutputSizePixel().Width() ) + 1;
if (nEntryNo >= nSize)
nScrPos = nMax;
else
@@ -224,7 +224,7 @@ void ScHeaderControl::Paint( vcl::RenderContext& /*rRenderContext*/, const tools
aSelLineColor.Merge( COL_BLACK, 0xe0 ); // darken just a little bit
bool bLayoutRTL = IsLayoutRTL();
- long nLayoutSign = bLayoutRTL ? -1 : 1;
+ tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
bool bMirrored = IsMirrored();
OUString aString;
@@ -239,16 +239,16 @@ void ScHeaderControl::Paint( vcl::RenderContext& /*rRenderContext*/, const tools
SCCOLROW nPos = GetPos();
- long nPStart = bVertical ? rRect.Top() : rRect.Left();
- long nPEnd = bVertical ? rRect.Bottom() : rRect.Right();
+ tools::Long nPStart = bVertical ? rRect.Top() : rRect.Left();
+ tools::Long nPEnd = bVertical ? rRect.Bottom() : rRect.Right();
- long nTransStart = nPEnd + 1;
- long nTransEnd = 0;
+ tools::Long nTransStart = nPEnd + 1;
+ tools::Long nTransEnd = 0;
- long nInitScrPos = 0;
+ tools::Long nInitScrPos = 0;
if ( bLayoutRTL )
{
- long nTemp = nPStart; // swap nPStart / nPEnd
+ tools::Long nTemp = nPStart; // swap nPStart / nPEnd
nPStart = nPEnd;
nPEnd = nTemp;
nTemp = nTransStart; // swap nTransStart / nTransEnd
@@ -263,7 +263,7 @@ void ScHeaderControl::Paint( vcl::RenderContext& /*rRenderContext*/, const tools
// complete the painting of the outer lines
// first find the end of the last cell
- long nLineEnd = nInitScrPos - nLayoutSign;
+ tools::Long nLineEnd = nInitScrPos - nLayoutSign;
for (SCCOLROW i=nPos; i<nSize; i++)
{
@@ -274,7 +274,7 @@ void ScHeaderControl::Paint( vcl::RenderContext& /*rRenderContext*/, const tools
if ( bMarkRange && i >= nMarkStart && i <= nMarkEnd )
{
- long nLineStart = nLineEnd - ( nSizePix - 1 ) * nLayoutSign;
+ tools::Long nLineStart = nLineEnd - ( nSizePix - 1 ) * nLayoutSign;
if ( nLineStart * nLayoutSign < nTransStart * nLayoutSign )
nTransStart = nLineStart;
if ( nLineEnd * nLayoutSign > nTransEnd * nLayoutSign )
@@ -351,7 +351,7 @@ void ScHeaderControl::Paint( vcl::RenderContext& /*rRenderContext*/, const tools
SetLineColor( rStyleSettings.GetDarkShadowColor() );
if (bVertical)
{
- long nDarkPos = bMirrored ? 0 : nBarSize-1;
+ tools::Long nDarkPos = bMirrored ? 0 : nBarSize-1;
DrawLine( Point( nDarkPos, nPStart ), Point( nDarkPos, nLineEnd ) );
}
else
@@ -363,7 +363,7 @@ void ScHeaderControl::Paint( vcl::RenderContext& /*rRenderContext*/, const tools
SetLineColor( aSelLineColor );
if (bVertical)
{
- long nDarkPos = bMirrored ? 0 : nBarSize-1;
+ tools::Long nDarkPos = bMirrored ? 0 : nBarSize-1;
DrawLine( Point( nDarkPos, nTransStart ), Point( nDarkPos, nTransEnd ) );
}
else
@@ -417,7 +417,7 @@ void ScHeaderControl::Paint( vcl::RenderContext& /*rRenderContext*/, const tools
}
SCCOLROW nCount=0;
- long nScrPos=nInitScrPos;
+ tools::Long nScrPos=nInitScrPos;
do
{
if (bVertical)
@@ -527,15 +527,15 @@ SCCOLROW ScHeaderControl::GetMousePos( const MouseEvent& rMEvt, bool& rBorder )
SCCOLROW nPos = GetPos();
SCCOLROW nHitNo = nPos;
SCCOLROW nEntryNo = 1 + nPos;
- long nScrPos;
- long nMousePos = bVertical ? rMEvt.GetPosPixel().Y() : rMEvt.GetPosPixel().X();
- long nDif;
+ tools::Long nScrPos;
+ tools::Long nMousePos = bVertical ? rMEvt.GetPosPixel().Y() : rMEvt.GetPosPixel().X();
+ tools::Long nDif;
Size aSize = GetOutputSizePixel();
- long nWinSize = bVertical ? aSize.Height() : aSize.Width();
+ tools::Long nWinSize = bVertical ? aSize.Height() : aSize.Width();
bool bLayoutRTL = IsLayoutRTL();
- long nLayoutSign = bLayoutRTL ? -1 : 1;
- long nEndPos = bLayoutRTL ? -1 : nWinSize;
+ tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
+ tools::Long nEndPos = bLayoutRTL ? -1 : nWinSize;
nScrPos = GetScrPos( nPos ) - nLayoutSign;
do
@@ -720,10 +720,10 @@ void ScHeaderControl::MouseButtonUp( const MouseEvent& rMEvt )
}
bDragging = false;
- long nScrPos = GetScrPos( nDragNo );
- long nMousePos = bVertical ? rMEvt.GetPosPixel().Y() : rMEvt.GetPosPixel().X();
+ tools::Long nScrPos = GetScrPos( nDragNo );
+ tools::Long nMousePos = bVertical ? rMEvt.GetPosPixel().Y() : rMEvt.GetPosPixel().X();
bool bLayoutRTL = IsLayoutRTL();
- long nNewWidth = bLayoutRTL ? ( nScrPos - nMousePos + 1 )
+ tools::Long nNewWidth = bLayoutRTL ? ( nScrPos - nMousePos + 1 )
: ( nMousePos + 2 - nScrPos );
if ( nNewWidth < 0 /* && !IsSelected(nDragNo) */ )
@@ -783,7 +783,7 @@ void ScHeaderControl::MouseMove( const MouseEvent& rMEvt )
if ( bDragging )
{
- long nNewPos = bVertical ? rMEvt.GetPosPixel().Y() : rMEvt.GetPosPixel().X();
+ tools::Long nNewPos = bVertical ? rMEvt.GetPosPixel().Y() : rMEvt.GetPosPixel().X();
if ( nNewPos != nDragPos )
{
DrawInvert( nDragPos );
@@ -907,9 +907,9 @@ void ScHeaderControl::ShowDragHelp()
if (!Help::IsQuickHelpEnabled())
return;
- long nScrPos = GetScrPos( nDragNo );
+ tools::Long nScrPos = GetScrPos( nDragNo );
bool bLayoutRTL = IsLayoutRTL();
- long nVal = bLayoutRTL ? ( nScrPos - nDragPos + 1 )
+ tools::Long nVal = bLayoutRTL ? ( nScrPos - nDragPos + 1 )
: ( nDragPos + 2 - nScrPos );
OUString aHelpStr = GetDragHelp( nVal );
@@ -989,11 +989,11 @@ void ScHeaderControl::SelectWindow()
{
}
-void ScHeaderControl::DrawInvert( long /* nDragPos */ )
+void ScHeaderControl::DrawInvert( tools::Long /* nDragPos */ )
{
}
-OUString ScHeaderControl::GetDragHelp( long /* nVal */ )
+OUString ScHeaderControl::GetDragHelp( tools::Long /* nVal */ )
{
return EMPTY_OUSTRING;
}
diff --git a/sc/source/ui/view/olinewin.cxx b/sc/source/ui/view/olinewin.cxx
index 2925f2ded4d3..9bc743e90360 100644
--- a/sc/source/ui/view/olinewin.cxx
+++ b/sc/source/ui/view/olinewin.cxx
@@ -30,8 +30,8 @@
#include <dbfunc.hxx>
#include <bitmaps.hlst>
-const long SC_OL_BITMAPSIZE = 12;
-const long SC_OL_POSOFFSET = 2;
+const tools::Long SC_OL_BITMAPSIZE = 12;
+const tools::Long SC_OL_POSOFFSET = 2;
const size_t SC_OL_NOLEVEL = static_cast< size_t >( -1 );
const size_t SC_OL_HEADERENTRY = static_cast< size_t >( -1 );
@@ -80,7 +80,7 @@ void ScOutlineWindow::dispose()
vcl::Window::dispose();
}
-void ScOutlineWindow::SetHeaderSize( long nNewSize )
+void ScOutlineWindow::SetHeaderSize( tools::Long nNewSize )
{
bool bLayoutRTL = GetDoc().IsLayoutRTL( GetTab() );
mbMirrorEntries = bLayoutRTL && mbHoriz;
@@ -95,23 +95,23 @@ void ScOutlineWindow::SetHeaderSize( long nNewSize )
Invalidate();
}
-long ScOutlineWindow::GetDepthSize() const
+tools::Long ScOutlineWindow::GetDepthSize() const
{
- long nSize = GetLevelCount() * SC_OL_BITMAPSIZE;
+ tools::Long nSize = GetLevelCount() * SC_OL_BITMAPSIZE;
if ( nSize > 0 )
nSize += 2 * SC_OL_POSOFFSET + 1;
return nSize;
}
-void ScOutlineWindow::ScrollPixel( long nDiff )
+void ScOutlineWindow::ScrollPixel( tools::Long nDiff )
{
HideFocus();
mbDontDrawFocus = true;
- long nStart = mnMainFirstPos;
- long nEnd = mnMainLastPos;
+ tools::Long nStart = mnMainFirstPos;
+ tools::Long nEnd = mnMainLastPos;
- long nInvStart, nInvEnd;
+ tools::Long nInvStart, nInvEnd;
if (nDiff < 0)
{
nStart -= nDiff;
@@ -135,7 +135,7 @@ void ScOutlineWindow::ScrollPixel( long nDiff )
ShowFocus();
}
-void ScOutlineWindow::ScrollRel( long nEntryDiff, long nEntryStart, long nEntryEnd )
+void ScOutlineWindow::ScrollRel( tools::Long nEntryDiff, tools::Long nEntryStart, tools::Long nEntryEnd )
{
tools::Rectangle aRect( GetRectangle( 0, nEntryStart, GetOutputSizeLevel() - 1, nEntryEnd ) );
if ( mbHoriz )
@@ -206,24 +206,24 @@ void ScOutlineWindow::GetVisibleRange( SCCOLROW& rnColRowStart, SCCOLROW& rnColR
--rnColRowStart;
}
-Point ScOutlineWindow::GetPoint( long nLevelPos, long nEntryPos ) const
+Point ScOutlineWindow::GetPoint( tools::Long nLevelPos, tools::Long nEntryPos ) const
{
return mbHoriz ? Point( nEntryPos, nLevelPos ) : Point( nLevelPos, nEntryPos );
}
tools::Rectangle ScOutlineWindow::GetRectangle(
- long nLevelStart, long nEntryStart, long nLevelEnd, long nEntryEnd ) const
+ tools::Long nLevelStart, tools::Long nEntryStart, tools::Long nLevelEnd, tools::Long nEntryEnd ) const
{
return tools::Rectangle( GetPoint( nLevelStart, nEntryStart ), GetPoint( nLevelEnd, nEntryEnd ) );
}
-long ScOutlineWindow::GetOutputSizeLevel() const
+tools::Long ScOutlineWindow::GetOutputSizeLevel() const
{
Size aSize( GetOutputSizePixel() );
return mbHoriz ? aSize.Height() : aSize.Width();
}
-long ScOutlineWindow::GetOutputSizeEntry() const
+tools::Long ScOutlineWindow::GetOutputSizeEntry() const
{
Size aSize( GetOutputSizePixel() );
return mbHoriz ? aSize.Width() : aSize.Height();
@@ -236,38 +236,38 @@ size_t ScOutlineWindow::GetLevelCount() const
return nLevelCount ? (nLevelCount + 1) : 0;
}
-long ScOutlineWindow::GetLevelPos( size_t nLevel ) const
+tools::Long ScOutlineWindow::GetLevelPos( size_t nLevel ) const
{
// #i51970# must always return the *left* edge of the area used by a level
- long nPos = static_cast< long >( SC_OL_POSOFFSET + nLevel * SC_OL_BITMAPSIZE );
+ tools::Long nPos = static_cast< tools::Long >( SC_OL_POSOFFSET + nLevel * SC_OL_BITMAPSIZE );
return mbMirrorLevels ? (GetOutputSizeLevel() - nPos - SC_OL_BITMAPSIZE) : nPos;
}
-size_t ScOutlineWindow::GetLevelFromPos( long nLevelPos ) const
+size_t ScOutlineWindow::GetLevelFromPos( tools::Long nLevelPos ) const
{
if( mbMirrorLevels ) nLevelPos = GetOutputSizeLevel() - nLevelPos - 1;
- long nStart = SC_OL_POSOFFSET;
+ tools::Long nStart = SC_OL_POSOFFSET;
if ( nLevelPos < nStart ) return SC_OL_NOLEVEL;
size_t nLevel = static_cast< size_t >( (nLevelPos - nStart) / SC_OL_BITMAPSIZE );
return (nLevel < GetLevelCount()) ? nLevel : SC_OL_NOLEVEL;
}
-long ScOutlineWindow::GetColRowPos( SCCOLROW nColRowIndex ) const
+tools::Long ScOutlineWindow::GetColRowPos( SCCOLROW nColRowIndex ) const
{
- long nDocPos = mbHoriz ?
+ tools::Long nDocPos = mbHoriz ?
mrViewData.GetScrPos( static_cast<SCCOL>(nColRowIndex), 0, meWhich, true ).X() :
mrViewData.GetScrPos( 0, static_cast<SCROW>(nColRowIndex), meWhich, true ).Y();
return mnMainFirstPos + nDocPos;
}
-long ScOutlineWindow::GetHeaderEntryPos() const
+tools::Long ScOutlineWindow::GetHeaderEntryPos() const
{
return mnHeaderPos + (mnHeaderSize - SC_OL_BITMAPSIZE) / 2;
}
bool ScOutlineWindow::GetEntryPos(
size_t nLevel, size_t nEntry,
- long& rnStartPos, long& rnEndPos, long& rnImagePos ) const
+ tools::Long& rnStartPos, tools::Long& rnEndPos, tools::Long& rnImagePos ) const
{
const ScOutlineEntry* pEntry = GetOutlineEntry( nLevel, nEntry );
if ( !pEntry || !pEntry->IsVisible() )
@@ -276,7 +276,7 @@ bool ScOutlineWindow::GetEntryPos(
SCCOLROW nStart = pEntry->GetStart();
SCCOLROW nEnd = pEntry->GetEnd();
- long nEntriesSign = mbMirrorEntries ? -1 : 1;
+ tools::Long nEntriesSign = mbMirrorEntries ? -1 : 1;
// --- common calculation ---
@@ -287,7 +287,7 @@ bool ScOutlineWindow::GetEntryPos(
rnImagePos = bHidden ?
(rnStartPos - ( SC_OL_BITMAPSIZE / 2 ) * nEntriesSign) :
rnStartPos + nEntriesSign;
- long nCenter = (rnStartPos + rnEndPos - SC_OL_BITMAPSIZE * nEntriesSign +
+ tools::Long nCenter = (rnStartPos + rnEndPos - SC_OL_BITMAPSIZE * nEntriesSign +
( mbMirrorEntries ? 1 : 0 )) / 2;
rnImagePos = mbMirrorEntries ? std::max( rnImagePos, nCenter ) : std::min( rnImagePos, nCenter );
@@ -337,12 +337,12 @@ bool ScOutlineWindow::GetImagePos( size_t nLevel, size_t nEntry, Point& rPos ) c
bool bRet = nLevel < GetLevelCount();
if ( bRet )
{
- long nLevelPos = GetLevelPos( nLevel );
+ tools::Long nLevelPos = GetLevelPos( nLevel );
if ( nEntry == SC_OL_HEADERENTRY )
rPos = GetPoint( nLevelPos, GetHeaderEntryPos() );
else
{
- long nStartPos, nEndPos, nImagePos;
+ tools::Long nStartPos, nEndPos, nImagePos;
bRet = GetEntryPos( nLevel, nEntry, nStartPos, nEndPos, nImagePos );
rPos = GetPoint( nLevelPos, nImagePos );
}
@@ -380,13 +380,13 @@ bool ScOutlineWindow::ItemHit( const Point& rPos, size_t& rnLevel, size_t& rnEnt
if ( nLevel == SC_OL_NOLEVEL )
return false;
- long nEntryMousePos = mbHoriz ? rPos.X() : rPos.Y();
+ tools::Long nEntryMousePos = mbHoriz ? rPos.X() : rPos.Y();
// --- level buttons ---
if ( mnHeaderSize > 0 )
{
- long nImagePos = GetHeaderEntryPos();
+ tools::Long nImagePos = GetHeaderEntryPos();
if ( (nImagePos <= nEntryMousePos) && (nEntryMousePos < nImagePos + SC_OL_BITMAPSIZE) )
{
rnLevel = nLevel;
@@ -411,7 +411,7 @@ bool ScOutlineWindow::ItemHit( const Point& rPos, size_t& rnLevel, size_t& rnEnt
if ( (nEnd >= nStartIndex) && (nStart <= nEndIndex) )
{
- long nStartPos, nEndPos, nImagePos;
+ tools::Long nStartPos, nEndPos, nImagePos;
if ( GetEntryPos( nLevel, nEntry, nStartPos, nEndPos, nImagePos ) )
{
rnLevel = nLevel;
@@ -517,13 +517,13 @@ void ScOutlineWindow::SetEntryAreaClipRegion()
}
void ScOutlineWindow::DrawLineRel(
- long nLevelStart, long nEntryStart, long nLevelEnd, long nEntryEnd )
+ tools::Long nLevelStart, tools::Long nEntryStart, tools::Long nLevelEnd, tools::Long nEntryEnd )
{
DrawLine( GetPoint( nLevelStart, nEntryStart ), GetPoint( nLevelEnd, nEntryEnd ) );
}
void ScOutlineWindow::DrawRectRel(
- long nLevelStart, long nEntryStart, long nLevelEnd, long nEntryEnd )
+ tools::Long nLevelStart, tools::Long nEntryStart, tools::Long nLevelEnd, tools::Long nEntryEnd )
{
DrawRect( GetRectangle( nLevelStart, nEntryStart, nLevelEnd, nEntryEnd ) );
}
@@ -536,7 +536,7 @@ namespace
}
}
-void ScOutlineWindow::DrawImageRel(long nLevelPos, long nEntryPos, const OUString& rId)
+void ScOutlineWindow::DrawImageRel(tools::Long nLevelPos, tools::Long nEntryPos, const OUString& rId)
{
const Image& rImage = GetImage(rId);
SetLineColor();
@@ -615,15 +615,15 @@ const std::u16string_view aLevelBmps[]=
void ScOutlineWindow::Paint( vcl::RenderContext& /*rRenderContext*/, const tools::Rectangle& /* rRect */ )
{
- long nEntriesSign = mbMirrorEntries ? -1 : 1;
- long nLevelsSign = mbMirrorLevels ? -1 : 1;
+ tools::Long nEntriesSign = mbMirrorEntries ? -1 : 1;
+ tools::Long nLevelsSign = mbMirrorLevels ? -1 : 1;
Size aSize = GetOutputSizePixel();
- long nLevelEnd = (mbHoriz ? aSize.Height() : aSize.Width()) - 1;
- long nEntryEnd = (mbHoriz ? aSize.Width() : aSize.Height()) - 1;
+ tools::Long nLevelEnd = (mbHoriz ? aSize.Height() : aSize.Width()) - 1;
+ tools::Long nEntryEnd = (mbHoriz ? aSize.Width() : aSize.Height()) - 1;
SetLineColor( maLineColor );
- long nBorderPos = mbMirrorLevels ? 0 : nLevelEnd;
+ tools::Long nBorderPos = mbMirrorLevels ? 0 : nLevelEnd;
DrawLineRel( nBorderPos, 0, nBorderPos, nEntryEnd );
const ScOutlineArray* pArray = GetOutlineArray();
@@ -635,12 +635,12 @@ void ScOutlineWindow::Paint( vcl::RenderContext& /*rRenderContext*/, const tools
if ( mnHeaderSize > 0 )
{
- long nEntryPos = GetHeaderEntryPos();
+ tools::Long nEntryPos = GetHeaderEntryPos();
for ( size_t nLevel = 0; nLevel < nLevelCount; ++nLevel )
DrawImageRel(GetLevelPos(nLevel), nEntryPos, aLevelBmps[nLevel]);
SetLineColor( maLineColor );
- long nLinePos = mnHeaderPos + (mbMirrorEntries ? 0 : (mnHeaderSize - 1));
+ tools::Long nLinePos = mnHeaderPos + (mbMirrorEntries ? 0 : (mnHeaderSize - 1));
DrawLineRel( 0, nLinePos, nLevelEnd, nLinePos );
}
@@ -653,8 +653,8 @@ void ScOutlineWindow::Paint( vcl::RenderContext& /*rRenderContext*/, const tools
for ( size_t nLevel = 0; nLevel + 1 < nLevelCount; ++nLevel )
{
- long nLevelPos = GetLevelPos( nLevel );
- long nEntryPos1 = 0, nEntryPos2 = 0, nImagePos = 0;
+ tools::Long nLevelPos = GetLevelPos( nLevel );
+ tools::Long nEntryPos1 = 0, nEntryPos2 = 0, nImagePos = 0;
size_t nEntryCount = pArray->GetCount( sal::static_int_cast<sal_uInt16>(nLevel) );
size_t nEntry;
@@ -680,7 +680,7 @@ void ScOutlineWindow::Paint( vcl::RenderContext& /*rRenderContext*/, const tools
if ( nStart >= nStartIndex )
nEntryPos1 += nEntriesSign;
nEntryPos2 -= 2 * nEntriesSign;
- long nLinePos = nLevelPos;
+ tools::Long nLinePos = nLevelPos;
if ( mbMirrorLevels )
nLinePos += SC_OL_BITMAPSIZE - 1; // align with right edge of bitmap
DrawRectRel( nLinePos, nEntryPos1, nLinePos + nLevelsSign, nEntryPos2 );
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 584125b5cef8..65e89742b7bc 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -133,7 +133,7 @@ void ScActionColorChanger::Update( const ScChangeAction& rAction )
ScOutputData::ScOutputData( OutputDevice* pNewDev, ScOutputType eNewType,
ScTableInfo& rTabInfo, ScDocument* pNewDoc,
- SCTAB nNewTab, long nNewScrX, long nNewScrY,
+ SCTAB nNewTab, tools::Long nNewScrX, tools::Long nNewScrY,
SCCOL nNewX1, SCROW nNewY1, SCCOL nNewX2, SCROW nNewY2,
double nPixelPerTwipsX, double nPixelPerTwipsY,
const Fraction* pZoomX, const Fraction* pZoomY ) :
@@ -227,7 +227,7 @@ void ScOutputData::SetContentDevice( OutputDevice* pContentDev )
mpDev = pContentDev;
}
-void ScOutputData::SetMirrorWidth( long nNew )
+void ScOutputData::SetMirrorWidth( tools::Long nNew )
{
nMirrorW = nNew;
}
@@ -290,8 +290,8 @@ void ScOutputData::DrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, bool
{
SCCOL nX;
SCROW nY;
- long nPosX;
- long nPosY;
+ tools::Long nPosX;
+ tools::Long nPosY;
SCSIZE nArrY;
ScBreakType nBreak = ScBreakType::NONE;
ScBreakType nBreakOld = ScBreakType::NONE;
@@ -337,8 +337,8 @@ void ScOutputData::DrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, bool
aManualColor = aGridColor;
}
- long nOneX = 1;
- long nOneY = 1;
+ tools::Long nOneX = 1;
+ tools::Long nOneY = 1;
if (!bWorksInPixels)
{
Size aOnePixel = rRenderContext.PixelToLogic(Size(1,1));
@@ -346,8 +346,8 @@ void ScOutputData::DrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, bool
nOneY = aOnePixel.Height();
}
- long nLayoutSign = bLayoutRTL ? -1 : 1;
- long nSignedOneX = nOneX * nLayoutSign;
+ tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
+ tools::Long nSignedOneX = nOneX * nLayoutSign;
rRenderContext.SetLineColor(aGridColor);
ScGridMerger aGrid(&rRenderContext, nOneX, nOneY);
@@ -429,7 +429,7 @@ void ScOutputData::DrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, bool
for (nArrY=1; nArrY+1<nArrCount; nArrY++)
{
RowInfo* pThisRowInfo = &pRowInfo[nArrY];
- const long nNextY = nPosY + pThisRowInfo->nHeight;
+ const tools::Long nNextY = nPosY + pThisRowInfo->nHeight;
bool bHOver = pThisRowInfo->pCellInfo[nXplus1].bHideGrid;
if (!bHOver)
@@ -540,7 +540,7 @@ void ScOutputData::DrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, bool
for (SCCOL i=nX1; i<=nX2; i++)
{
- const long nNextX = nPosX + pRowInfo[0].pCellInfo[i+1].nWidth * nLayoutSign;
+ const tools::Long nNextX = nPosX + pRowInfo[0].pCellInfo[i+1].nWidth * nLayoutSign;
if (nNextX != nPosX) // visible
{
bool bVOver;
@@ -651,7 +651,7 @@ void ScOutputData::SetCellRotations()
if(nTargetX >= 0 && nTargetY >= 0)
{
// add rotation info to Array information
- const long nAttrRotate(pPattern->GetRotateVal(pCondSet));
+ const tools::Long nAttrRotate(pPattern->GetRotateVal(pCondSet));
const SvxRotateMode eRotMode(pPattern->GetItem(ATTR_ROTATE_MODE, pCondSet).GetValue());
const double fOrient((bLayoutRTL ? -1.0 : 1.0) * nAttrRotate * F_PI18000); // 1/100th degrees -> [0..2PI]
svx::frame::Array& rArray = mrTabInfo.maArray;
@@ -672,7 +672,7 @@ static ScRotateDir lcl_GetRotateDir( const ScDocument* pDoc, SCCOL nCol, SCROW n
ScRotateDir nRet = ScRotateDir::NONE;
- long nAttrRotate = pPattern->GetRotateVal( pCondSet );
+ tools::Long nAttrRotate = pPattern->GetRotateVal( pCondSet );
if ( nAttrRotate )
{
SvxRotateMode eRotMode =
@@ -684,7 +684,7 @@ static ScRotateDir lcl_GetRotateDir( const ScDocument* pDoc, SCCOL nCol, SCROW n
nRet = ScRotateDir::Center;
else if ( eRotMode == SVX_ROTATE_MODE_TOP || eRotMode == SVX_ROTATE_MODE_BOTTOM )
{
- long nRot180 = nAttrRotate % 18000; // 1/100 degree
+ tools::Long nRot180 = nAttrRotate % 18000; // 1/100 degree
if ( nRot180 == 9000 )
nRet = ScRotateDir::Center;
else if ( ( eRotMode == SVX_ROTATE_MODE_TOP && nRot180 < 9000 ) ||
@@ -821,9 +821,9 @@ namespace {
const double lclCornerRectTransparency = 40.0;
-void drawDataBars(vcl::RenderContext& rRenderContext, const ScDataBarInfo* pOldDataBarInfo, const tools::Rectangle& rRect, long nOneX, long nOneY)
+void drawDataBars(vcl::RenderContext& rRenderContext, const ScDataBarInfo* pOldDataBarInfo, const tools::Rectangle& rRect, tools::Long nOneX, tools::Long nOneY)
{
- long nPosZero = 0;
+ tools::Long nPosZero = 0;
tools::Rectangle aPaintRect = rRect;
aPaintRect.AdjustTop(2 * nOneY );
aPaintRect.AdjustBottom( -(2 * nOneY) );
@@ -832,8 +832,8 @@ void drawDataBars(vcl::RenderContext& rRenderContext, const ScDataBarInfo* pOldD
if(pOldDataBarInfo->mnZero)
{
// need to calculate null point in cell
- long nLength = aPaintRect.Right() - aPaintRect.Left();
- nPosZero = static_cast<long>(aPaintRect.Left() + nLength*pOldDataBarInfo->mnZero/100.0);
+ tools::Long nLength = aPaintRect.Right() - aPaintRect.Left();
+ nPosZero = static_cast<tools::Long>(aPaintRect.Left() + nLength*pOldDataBarInfo->mnZero/100.0);
}
else
{
@@ -843,14 +843,14 @@ void drawDataBars(vcl::RenderContext& rRenderContext, const ScDataBarInfo* pOldD
if(pOldDataBarInfo->mnLength < 0)
{
aPaintRect.SetRight( nPosZero );
- long nLength = nPosZero - aPaintRect.Left();
- aPaintRect.SetLeft( nPosZero + static_cast<long>(nLength * pOldDataBarInfo->mnLength/100.0) );
+ tools::Long nLength = nPosZero - aPaintRect.Left();
+ aPaintRect.SetLeft( nPosZero + static_cast<tools::Long>(nLength * pOldDataBarInfo->mnLength/100.0) );
}
else if(pOldDataBarInfo->mnLength > 0)
{
aPaintRect.SetLeft( nPosZero );
- long nLength = aPaintRect.Right() - nPosZero;
- aPaintRect.SetRight( nPosZero + static_cast<long>(nLength * pOldDataBarInfo->mnLength/100.0) );
+ tools::Long nLength = aPaintRect.Right() - nPosZero;
+ aPaintRect.SetRight( nPosZero + static_cast<tools::Long>(nLength * pOldDataBarInfo->mnLength/100.0) );
}
else
return;
@@ -898,23 +898,23 @@ const BitmapEx& getIcon(sc::IconSetBitmapMap & rIconSetBitmapMap, ScIconSetType
return ScIconSetFormat::getBitmap(rIconSetBitmapMap, eType, nIndex);
}
-void drawIconSets(vcl::RenderContext& rRenderContext, const ScIconSetInfo* pOldIconSetInfo, const tools::Rectangle& rRect, long nOneX, long nOneY,
+void drawIconSets(vcl::RenderContext& rRenderContext, const ScIconSetInfo* pOldIconSetInfo, const tools::Rectangle& rRect, tools::Long nOneX, tools::Long nOneY,
sc::IconSetBitmapMap & rIconSetBitmapMap)
{
//long nSize = 16;
ScIconSetType eType = pOldIconSetInfo->eIconSetType;
sal_Int32 nIndex = pOldIconSetInfo->nIconIndex;
const BitmapEx& rIcon = getIcon(rIconSetBitmapMap, eType, nIndex);
- long aOrigSize = std::max<long>(0,std::min(rRect.GetSize().getWidth() - 4 * nOneX, rRect.GetSize().getHeight() -4 * nOneY));
+ tools::Long aOrigSize = std::max<long>(0,std::min(rRect.GetSize().getWidth() - 4 * nOneX, rRect.GetSize().getHeight() -4 * nOneY));
rRenderContext.DrawBitmapEx( Point( rRect.Left() + 2 * nOneX, rRect.Top() + 2 * nOneY), Size(aOrigSize, aOrigSize), rIcon );
}
void drawCells(vcl::RenderContext& rRenderContext, std::optional<Color> const & pColor, const SvxBrushItem* pBackground, std::optional<Color>& pOldColor, const SvxBrushItem*& pOldBackground,
- tools::Rectangle& rRect, long nPosX, long nLayoutSign, long nOneX, long nOneY, const ScDataBarInfo* pDataBarInfo, const ScDataBarInfo*& pOldDataBarInfo,
+ tools::Rectangle& rRect, tools::Long nPosX, tools::Long nLayoutSign, tools::Long nOneX, tools::Long nOneY, const ScDataBarInfo* pDataBarInfo, const ScDataBarInfo*& pOldDataBarInfo,
const ScIconSetInfo* pIconSetInfo, const ScIconSetInfo*& pOldIconSetInfo,
sc::IconSetBitmapMap & rIconSetBitmapMap)
{
- long nSignedOneX = nOneX * nLayoutSign;
+ tools::Long nSignedOneX = nOneX * nLayoutSign;
// need to paint if old color scale has been used and now
// we have a different color or a style based background
// we can here fall back to pointer comparison
@@ -990,16 +990,16 @@ void drawCells(vcl::RenderContext& rRenderContext, std::optional<Color> const &
void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext)
{
Size aOnePixel = rRenderContext.PixelToLogic(Size(1,1));
- long nOneXLogic = aOnePixel.Width();
- long nOneYLogic = aOnePixel.Height();
+ tools::Long nOneXLogic = aOnePixel.Width();
+ tools::Long nOneYLogic = aOnePixel.Height();
// See more about bWorksInPixels in ScOutputData::DrawGrid
bool bWorksInPixels = false;
if (eType == OUTTYPE_WINDOW)
bWorksInPixels = true;
- long nOneX = 1;
- long nOneY = 1;
+ tools::Long nOneX = 1;
+ tools::Long nOneY = 1;
if (!bWorksInPixels)
{
nOneX = nOneXLogic;
@@ -1008,7 +1008,7 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext)
tools::Rectangle aRect;
- long nLayoutSign = bLayoutRTL ? -1 : 1;
+ tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
rRenderContext.SetLineColor();
@@ -1018,7 +1018,7 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext)
bool bCellContrast = mbUseStyleColor &&
Application::GetSettings().GetStyleSettings().GetHighContrastMode();
- long nPosY = nScrY;
+ tools::Long nPosY = nScrY;
const svtools::ColorConfig& rColorCfg = SC_MOD()->GetColorConfig();
Color aProtectedColor( rColorCfg.GetColorValue( svtools::CALCPROTECTEDBACKGROUND ).nColor );
@@ -1028,7 +1028,7 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext)
for (SCSIZE nArrY=1; nArrY+1<nArrCount; nArrY++)
{
RowInfo* pThisRowInfo = &pRowInfo[nArrY];
- long nRowHeight = pThisRowInfo->nHeight;
+ tools::Long nRowHeight = pThisRowInfo->nHeight;
if ( pThisRowInfo->bChanged )
{
@@ -1048,7 +1048,7 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext)
nRowHeight += pRowInfo[nArrY+nSkip].nHeight; // after incrementing
}
- long nPosX = nScrX;
+ tools::Long nPosX = nScrX;
if ( bLayoutRTL )
nPosX += nMirrorW - nOneX;
@@ -1108,7 +1108,7 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext)
const ScDataBarInfo* pDataBarInfo = pInfo->pDataBar.get();
const ScIconSetInfo* pIconSetInfo = pInfo->pIconSet.get();
- long nPosXLogic = nPosX;
+ tools::Long nPosXLogic = nPosX;
if (bWorksInPixels)
nPosXLogic = rRenderContext.PixelToLogic(Point(nPosX, 0)).X();
@@ -1132,7 +1132,7 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext)
}
}
- long nPosXLogic = nPosX;
+ tools::Long nPosXLogic = nPosX;
if (bWorksInPixels)
nPosXLogic = rRenderContext.PixelToLogic(Point(nPosX, 0)).X();
@@ -1160,27 +1160,27 @@ void ScOutputData::DrawExtraShadow(bool bLeft, bool bTop, bool bRight, bool bBot
if ( bCellContrast )
aAutoTextColor = SC_MOD()->GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor;
- long nInitPosX = nScrX;
+ tools::Long nInitPosX = nScrX;
if ( bLayoutRTL )
{
Size aOnePixel = mpDev->PixelToLogic(Size(1,1));
- long nOneX = aOnePixel.Width();
+ tools::Long nOneX = aOnePixel.Width();
nInitPosX += nMirrorW - nOneX;
}
- long nLayoutSign = bLayoutRTL ? -1 : 1;
+ tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
- long nPosY = nScrY - pRowInfo[0].nHeight;
+ tools::Long nPosY = nScrY - pRowInfo[0].nHeight;
for (SCSIZE nArrY=0; nArrY<nArrCount; nArrY++)
{
bool bCornerY = ( nArrY == 0 ) || ( nArrY+1 == nArrCount );
bool bSkipY = ( nArrY==0 && !bTop ) || ( nArrY+1 == nArrCount && !bBottom );
RowInfo* pThisRowInfo = &pRowInfo[nArrY];
- long nRowHeight = pThisRowInfo->nHeight;
+ tools::Long nRowHeight = pThisRowInfo->nHeight;
if ( pThisRowInfo->bChanged && !bSkipY )
{
- long nPosX = nInitPosX - pRowInfo[0].pCellInfo[nX1].nWidth * nLayoutSign;
+ tools::Long nPosX = nInitPosX - pRowInfo[0].pCellInfo[nX1].nWidth * nLayoutSign;
for (SCCOL nArrX=nX1; nArrX<=nX2+2; nArrX++)
{
bool bCornerX = ( nArrX==nX1 || nArrX==nX2+2 );
@@ -1204,8 +1204,8 @@ void ScOutputData::DrawExtraShadow(bool bLeft, bool bTop, bool bRight, bool bBot
if (bDo)
{
- long nThisWidth = pRowInfo[0].pCellInfo[nArrX].nWidth;
- long nMaxWidth = nThisWidth;
+ tools::Long nThisWidth = pRowInfo[0].pCellInfo[nArrX].nWidth;
+ tools::Long nMaxWidth = nThisWidth;
if (!nMaxWidth)
{
//! direction must depend on shadow location
@@ -1220,10 +1220,10 @@ void ScOutputData::DrawExtraShadow(bool bLeft, bool bTop, bool bRight, bool bBot
nPosX + ( nThisWidth - 1 ) * nLayoutSign,
nPosY + pRowInfo[nArrY].nHeight - 1 );
- long nSize = pAttr->GetWidth();
- long nSizeX = static_cast<long>(nSize*mnPPTX);
+ tools::Long nSize = pAttr->GetWidth();
+ tools::Long nSizeX = static_cast<tools::Long>(nSize*mnPPTX);
if (nSizeX >= nMaxWidth) nSizeX = nMaxWidth-1;
- long nSizeY = static_cast<long>(nSize*mnPPTY);
+ tools::Long nSizeY = static_cast<tools::Long>(nSize*mnPPTY);
if (nSizeY >= nRowHeight) nSizeY = nRowHeight-1;
nSizeX *= nLayoutSign; // used only to add to rectangle values
@@ -1295,8 +1295,8 @@ void ScOutputData::DrawClear()
{
tools::Rectangle aRect;
Size aOnePixel = mpDev->PixelToLogic(Size(1,1));
- long nOneX = aOnePixel.Width();
- long nOneY = aOnePixel.Height();
+ tools::Long nOneX = aOnePixel.Width();
+ tools::Long nOneY = aOnePixel.Height();
// (called only for ScGridWindow)
Color aBgColor( SC_MOD()->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor );
@@ -1308,11 +1308,11 @@ void ScOutputData::DrawClear()
mpDev->SetFillColor( aBgColor );
- long nPosY = nScrY;
+ tools::Long nPosY = nScrY;
for (SCSIZE nArrY=1; nArrY+1<nArrCount; nArrY++)
{
RowInfo* pThisRowInfo = &pRowInfo[nArrY];
- long nRowHeight = pThisRowInfo->nHeight;
+ tools::Long nRowHeight = pThisRowInfo->nHeight;
if ( pThisRowInfo->bChanged )
{
@@ -1336,12 +1336,12 @@ void ScOutputData::DrawClear()
// Lines
-static long lclGetSnappedX( const OutputDevice& rDev, long nPosX, bool bSnapPixel )
+static tools::Long lclGetSnappedX( const OutputDevice& rDev, tools::Long nPosX, bool bSnapPixel )
{
return (bSnapPixel && nPosX) ? rDev.PixelToLogic( rDev.LogicToPixel( Size( nPosX, 0 ) ) ).Width() : nPosX;
}
-static long lclGetSnappedY( const OutputDevice& rDev, long nPosY, bool bSnapPixel )
+static tools::Long lclGetSnappedY( const OutputDevice& rDev, tools::Long nPosY, bool bSnapPixel )
{
return (bSnapPixel && nPosY) ? rDev.PixelToLogic( rDev.LogicToPixel( Size( 0, nPosY ) ) ).Height() : nPosY;
}
@@ -1390,14 +1390,14 @@ void ScOutputData::DrawFrame(vcl::RenderContext& rRenderContext)
DrawRotatedFrame(rRenderContext); // removes the lines that must not be painted here
}
- long nInitPosX = nScrX;
+ tools::Long nInitPosX = nScrX;
if ( bLayoutRTL )
{
Size aOnePixel = rRenderContext.PixelToLogic(Size(1,1));
- long nOneX = aOnePixel.Width();
+ tools::Long nOneX = aOnePixel.Width();
nInitPosX += nMirrorW - nOneX;
}
- long nLayoutSign = bLayoutRTL ? -1 : 1;
+ tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
// *** set column and row sizes of the frame border array ***
@@ -1409,13 +1409,13 @@ void ScOutputData::DrawFrame(vcl::RenderContext& rRenderContext)
// row 0 is not visible (dummy for borders from top) - subtract its height from initial position
// subtract 1 unit more, because position 0 is first *in* cell, grid line is one unit before
- long nOldPosY = nScrY - 1 - pRowInfo[ 0 ].nHeight;
- long nOldSnapY = lclGetSnappedY( rRenderContext, nOldPosY, bSnapPixel );
+ tools::Long nOldPosY = nScrY - 1 - pRowInfo[ 0 ].nHeight;
+ tools::Long nOldSnapY = lclGetSnappedY( rRenderContext, nOldPosY, bSnapPixel );
rArray.SetYOffset( nOldSnapY );
for( size_t nRow = 0; nRow < nRowCount; ++nRow )
{
- long nNewPosY = nOldPosY + pRowInfo[ nRow ].nHeight;
- long nNewSnapY = lclGetSnappedY( rRenderContext, nNewPosY, bSnapPixel );
+ tools::Long nNewPosY = nOldPosY + pRowInfo[ nRow ].nHeight;
+ tools::Long nNewSnapY = lclGetSnappedY( rRenderContext, nNewPosY, bSnapPixel );
rArray.SetRowHeight( nRow, nNewSnapY - nOldSnapY );
nOldPosY = nNewPosY;
nOldSnapY = nNewSnapY;
@@ -1425,16 +1425,16 @@ void ScOutputData::DrawFrame(vcl::RenderContext& rRenderContext)
// column nX1 is not visible (dummy for borders from left) - subtract its width from initial position
// subtract 1 unit more, because position 0 is first *in* cell, grid line is one unit above
- long nOldPosX = nInitPosX - nLayoutSign * (1 + pRowInfo[ 0 ].pCellInfo[ nX1 ].nWidth);
- long nOldSnapX = lclGetSnappedX( rRenderContext, nOldPosX, bSnapPixel );
+ tools::Long nOldPosX = nInitPosX - nLayoutSign * (1 + pRowInfo[ 0 ].pCellInfo[ nX1 ].nWidth);
+ tools::Long nOldSnapX = lclGetSnappedX( rRenderContext, nOldPosX, bSnapPixel );
// set X offset for left-to-right sheets; for right-to-left sheets this is done after for() loop
if( !bLayoutRTL )
rArray.SetXOffset( nOldSnapX );
for( sal_uInt16 nInfoIdx = nX1; nInfoIdx <= nX2 + 2; ++nInfoIdx )
{
size_t nCol = lclGetArrayColFromCellInfoX( nInfoIdx, nX1, nX2, bLayoutRTL );
- long nNewPosX = nOldPosX + pRowInfo[ 0 ].pCellInfo[ nInfoIdx ].nWidth * nLayoutSign;
- long nNewSnapX = lclGetSnappedX( rRenderContext, nNewPosX, bSnapPixel );
+ tools::Long nNewPosX = nOldPosX + pRowInfo[ 0 ].pCellInfo[ nInfoIdx ].nWidth * nLayoutSign;
+ tools::Long nNewSnapX = lclGetSnappedX( rRenderContext, nNewPosX, bSnapPixel );
rArray.SetColWidth( nCol, std::abs( nNewSnapX - nOldSnapX ) );
nOldPosX = nNewPosX;
nOldSnapX = nNewSnapX;
@@ -1491,14 +1491,14 @@ void ScOutputData::DrawRotatedFrame(vcl::RenderContext& rRenderContext)
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
bool bCellContrast = mbUseStyleColor && rStyleSettings.GetHighContrastMode();
- long nInitPosX = nScrX;
+ tools::Long nInitPosX = nScrX;
if ( bLayoutRTL )
{
Size aOnePixel = rRenderContext.PixelToLogic(Size(1,1));
- long nOneX = aOnePixel.Width();
+ tools::Long nOneX = aOnePixel.Width();
nInitPosX += nMirrorW - nOneX;
}
- long nLayoutSign = bLayoutRTL ? -1 : 1;
+ tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
tools::Rectangle aClipRect( Point(nScrX, nScrY), Size(nScrW, nScrH) );
if (bMetaFile)
@@ -1510,7 +1510,7 @@ void ScOutputData::DrawRotatedFrame(vcl::RenderContext& rRenderContext)
rRenderContext.SetClipRegion( vcl::Region( aClipRect ) );
std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor(CreateProcessor2D( ));
- long nPosY = nScrY;
+ tools::Long nPosY = nScrY;
for (SCSIZE nArrY=1; nArrY<nArrCount; nArrY++)
{
// Rotated is also drawn one line above/below Changed if parts extend into the cell
@@ -1519,13 +1519,13 @@ void ScOutputData::DrawRotatedFrame(vcl::RenderContext& rRenderContext)
RowInfo& rThisRowInfo = pRowInfo[nArrY];
RowInfo& rNextRowInfo = pRowInfo[nArrY+1];
- long nRowHeight = rThisRowInfo.nHeight;
+ tools::Long nRowHeight = rThisRowInfo.nHeight;
if ( rThisRowInfo.nRotMaxCol != SC_ROTMAX_NONE &&
( rThisRowInfo.bChanged || rPrevRowInfo.bChanged ||
( nArrY+1<nArrCount && rNextRowInfo.bChanged ) ) )
{
SCROW nY = rThisRowInfo.nRowNo;
- long nPosX = 0;
+ tools::Long nPosX = 0;
SCCOL nX;
for (nX=0; nX<=nRotMax; nX++)
{
@@ -1534,7 +1534,7 @@ void ScOutputData::DrawRotatedFrame(vcl::RenderContext& rRenderContext)
sal_uInt16 nArrX = nX + 1;
CellInfo* pInfo = &rThisRowInfo.pCellInfo[nArrX];
- long nColWidth = pRowInfo[0].pCellInfo[nArrX].nWidth;
+ tools::Long nColWidth = pRowInfo[0].pCellInfo[nArrX].nWidth;
if ( pInfo->nRotateDir > ScRotateDir::Standard &&
!pInfo->bHOverlapped && !pInfo->bVOverlapped )
{
@@ -1550,7 +1550,7 @@ void ScOutputData::DrawRotatedFrame(vcl::RenderContext& rRenderContext)
//! LastPattern etc.
- long nAttrRotate = pPattern->GetRotateVal( pCondSet );
+ tools::Long nAttrRotate = pPattern->GetRotateVal( pCondSet );
SvxRotateMode eRotMode =
pPattern->GetItem(ATTR_ROTATE_MODE, pCondSet).GetValue();
@@ -1563,19 +1563,19 @@ void ScOutputData::DrawRotatedFrame(vcl::RenderContext& rRenderContext)
while (nCol > nX)
{
--nCol;
- nPosX -= nLayoutSign * static_cast<long>(pRowInfo[0].pCellInfo[nCol + 1].nWidth);
+ nPosX -= nLayoutSign * static_cast<tools::Long>(pRowInfo[0].pCellInfo[nCol + 1].nWidth);
}
}
// start position minus 1 so rotated backgrounds suit the border
// (border is on the grid)
- long nTop = nPosY - 1;
- long nBottom = nPosY + nRowHeight - 1;
- long nTopLeft = nPosX - nLayoutSign;
- long nTopRight = nPosX + (nColWidth - 1) * nLayoutSign;
- long nBotLeft = nTopLeft;
- long nBotRight = nTopRight;
+ tools::Long nTop = nPosY - 1;
+ tools::Long nBottom = nPosY + nRowHeight - 1;
+ tools::Long nTopLeft = nPosX - nLayoutSign;
+ tools::Long nTopRight = nPosX + (nColWidth - 1) * nLayoutSign;
+ tools::Long nBotLeft = nTopLeft;
+ tools::Long nBotRight = nTopRight;
// inclusion of the sign here hasn't been decided yet
// (if not, the extension of the non-rotated background must also be changed)
@@ -1583,7 +1583,7 @@ void ScOutputData::DrawRotatedFrame(vcl::RenderContext& rRenderContext)
double nCos = cos(nRealOrient);
double nSin = sin(nRealOrient);
//! restrict !!!
- long nSkew = static_cast<long>(nRowHeight * nCos / nSin);
+ tools::Long nSkew = static_cast<tools::Long>(nRowHeight * nCos / nSin);
switch (eRotMode)
{
@@ -1706,7 +1706,7 @@ vcl::Region ScOutputData::GetChangedAreaRegion()
vcl::Region aRegion;
tools::Rectangle aDrawingRect;
bool bHad(false);
- long nPosY = nScrY;
+ tools::Long nPosY = nScrY;
SCSIZE nArrY;
aDrawingRect.SetLeft( nScrX );
@@ -1752,7 +1752,7 @@ bool ScOutputData::SetChangedClip()
aDrawingRect.SetRight( nScrX+nScrW-1 );
bool bHad = false;
- long nPosY = nScrY;
+ tools::Long nPosY = nScrY;
SCSIZE nArrY;
for (nArrY=1; nArrY+1<nArrCount; nArrY++)
{
@@ -1893,24 +1893,24 @@ ReferenceMark ScOutputData::FillReferenceMark( SCCOL nRefStartX, SCROW nRefStart
if ( nRefStartX <= nVisX2 && nRefEndX >= nVisX1 &&
nRefStartY <= nVisY2 && nRefEndY >= nVisY1 )
{
- long nMinX = nScrX;
- long nMinY = nScrY;
- long nMaxX = nScrX + nScrW - 1;
- long nMaxY = nScrY + nScrH - 1;
+ tools::Long nMinX = nScrX;
+ tools::Long nMinY = nScrY;
+ tools::Long nMaxX = nScrX + nScrW - 1;
+ tools::Long nMaxY = nScrY + nScrH - 1;
if ( bLayoutRTL )
{
- long nTemp = nMinX;
+ tools::Long nTemp = nMinX;
nMinX = nMaxX;
nMaxX = nTemp;
}
- long nLayoutSign = bLayoutRTL ? -1 : 1;
+ tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
bool bTop = false;
bool bBottom = false;
bool bLeft = false;
bool bRight = false;
- long nPosY = nScrY;
+ tools::Long nPosY = nScrY;
bool bNoStartY = ( nY1 < nRefStartY );
bool bNoEndY = false;
for (SCSIZE nArrY=1; nArrY<nArrCount; nArrY++) // loop to end for bNoEndY check
@@ -1937,7 +1937,7 @@ ReferenceMark ScOutputData::FillReferenceMark( SCCOL nRefStartX, SCROW nRefStart
nPosY += pRowInfo[nArrY].nHeight;
}
- long nPosX = nScrX;
+ tools::Long nPosX = nScrX;
if ( bLayoutRTL )
nPosX += nMirrorW - 1; // always in pixels
@@ -1985,24 +1985,24 @@ void ScOutputData::DrawRefMark( SCCOL nRefStartX, SCROW nRefStartY,
nRefStartY <= nVisY2 && nRefEndY >= nVisY1) )
return;
- long nMinX = nScrX;
- long nMinY = nScrY;
- long nMaxX = nScrX + nScrW - 1;
- long nMaxY = nScrY + nScrH - 1;
+ tools::Long nMinX = nScrX;
+ tools::Long nMinY = nScrY;
+ tools::Long nMaxX = nScrX + nScrW - 1;
+ tools::Long nMaxY = nScrY + nScrH - 1;
if ( bLayoutRTL )
{
- long nTemp = nMinX;
+ tools::Long nTemp = nMinX;
nMinX = nMaxX;
nMaxX = nTemp;
}
- long nLayoutSign = bLayoutRTL ? -1 : 1;
+ tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
bool bTop = false;
bool bBottom = false;
bool bLeft = false;
bool bRight = false;
- long nPosY = nScrY;
+ tools::Long nPosY = nScrY;
bool bNoStartY = ( nY1 < nRefStartY );
bool bNoEndY = false;
for (SCSIZE nArrY=1; nArrY<nArrCount; nArrY++) // loop to end for bNoEndY check
@@ -2029,7 +2029,7 @@ void ScOutputData::DrawRefMark( SCCOL nRefStartX, SCROW nRefStartY,
nPosY += pRowInfo[nArrY].nHeight;
}
- long nPosX = nScrX;
+ tools::Long nPosX = nScrX;
if ( bLayoutRTL )
nPosX += nMirrorW - 1; // always in pixels
@@ -2112,24 +2112,24 @@ void ScOutputData::DrawOneChange( SCCOL nRefStartX, SCROW nRefStartY,
nRefStartY <= nVisY2 + 1 && nRefEndY >= nVisY1) ) // +1 because it touches next cells left/top
return;
- long nMinX = nScrX;
- long nMinY = nScrY;
- long nMaxX = nScrX+nScrW-1;
- long nMaxY = nScrY+nScrH-1;
+ tools::Long nMinX = nScrX;
+ tools::Long nMinY = nScrY;
+ tools::Long nMaxX = nScrX+nScrW-1;
+ tools::Long nMaxY = nScrY+nScrH-1;
if ( bLayoutRTL )
{
- long nTemp = nMinX;
+ tools::Long nTemp = nMinX;
nMinX = nMaxX;
nMaxX = nTemp;
}
- long nLayoutSign = bLayoutRTL ? -1 : 1;
+ tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
bool bTop = false;
bool bBottom = false;
bool bLeft = false;
bool bRight = false;
- long nPosY = nScrY;
+ tools::Long nPosY = nScrY;
bool bNoStartY = ( nY1 < nRefStartY );
bool bNoEndY = false;
for (SCSIZE nArrY=1; nArrY<nArrCount; nArrY++) // loop to end for bNoEndY check
@@ -2156,7 +2156,7 @@ void ScOutputData::DrawOneChange( SCCOL nRefStartX, SCROW nRefStartY,
nPosY += pRowInfo[nArrY].nHeight;
}
- long nPosX = nScrX;
+ tools::Long nPosX = nScrX;
if ( bLayoutRTL )
nPosX += nMirrorW - 1; // always in pixels
@@ -2286,18 +2286,18 @@ void ScOutputData::DrawNoteMarks(vcl::RenderContext& rRenderContext)
bool bFirst = true;
- long nInitPosX = nScrX;
+ tools::Long nInitPosX = nScrX;
if ( bLayoutRTL )
nInitPosX += nMirrorW - 1; // always in pixels
- long nLayoutSign = bLayoutRTL ? -1 : 1;
+ tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
- long nPosY = nScrY;
+ tools::Long nPosY = nScrY;
for (SCSIZE nArrY=1; nArrY+1<nArrCount; nArrY++)
{
RowInfo* pThisRowInfo = &pRowInfo[nArrY];
if ( pThisRowInfo->bChanged )
{
- long nPosX = nInitPosX;
+ tools::Long nPosX = nInitPosX;
for (SCCOL nX=nX1; nX<=nX2; nX++)
{
CellInfo* pInfo = &pThisRowInfo->pCellInfo[nX+1];
@@ -2330,7 +2330,7 @@ void ScOutputData::DrawNoteMarks(vcl::RenderContext& rRenderContext)
bFirst = false;
}
- long nMarkX = nPosX + ( pRowInfo[0].pCellInfo[nX+1].nWidth - 4 ) * nLayoutSign;
+ tools::Long nMarkX = nPosX + ( pRowInfo[0].pCellInfo[nX+1].nWidth - 4 ) * nLayoutSign;
if ( bIsMerged || pInfo->bMerged )
{
// if merged, add widths of all cells
@@ -2358,22 +2358,22 @@ void ScOutputData::AddPDFNotes()
if ( !pPDFData || !pPDFData->GetIsExportNotes() )
return;
- long nInitPosX = nScrX;
+ tools::Long nInitPosX = nScrX;
if ( bLayoutRTL )
{
Size aOnePixel = mpDev->PixelToLogic(Size(1,1));
- long nOneX = aOnePixel.Width();
+ tools::Long nOneX = aOnePixel.Width();
nInitPosX += nMirrorW - nOneX;
}
- long nLayoutSign = bLayoutRTL ? -1 : 1;
+ tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
- long nPosY = nScrY;
+ tools::Long nPosY = nScrY;
for (SCSIZE nArrY=1; nArrY+1<nArrCount; nArrY++)
{
RowInfo* pThisRowInfo = &pRowInfo[nArrY];
if ( pThisRowInfo->bChanged )
{
- long nPosX = nInitPosX;
+ tools::Long nPosX = nInitPosX;
for (SCCOL nX=nX1; nX<=nX2; nX++)
{
CellInfo* pInfo = &pThisRowInfo->pCellInfo[nX+1];
@@ -2393,10 +2393,10 @@ void ScOutputData::AddPDFNotes()
if ( mpDoc->GetNote(nMergeX, nMergeY, nTab) && ( bIsMerged ||
( !pInfo->bHOverlapped && !pInfo->bVOverlapped ) ) )
{
- long nNoteWidth = static_cast<long>( SC_CLIPMARK_SIZE * mnPPTX );
- long nNoteHeight = static_cast<long>( SC_CLIPMARK_SIZE * mnPPTY );
+ tools::Long nNoteWidth = static_cast<tools::Long>( SC_CLIPMARK_SIZE * mnPPTX );
+ tools::Long nNoteHeight = static_cast<tools::Long>( SC_CLIPMARK_SIZE * mnPPTY );
- long nMarkX = nPosX + ( pRowInfo[0].pCellInfo[nX+1].nWidth - nNoteWidth ) * nLayoutSign;
+ tools::Long nMarkX = nPosX + ( pRowInfo[0].pCellInfo[nX+1].nWidth - nNoteWidth ) * nLayoutSign;
if ( bIsMerged || pInfo->bMerged )
{
// if merged, add widths of all cells
@@ -2451,20 +2451,20 @@ void ScOutputData::DrawClipMarks()
aArrowFillCol = SC_MOD()->GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor;
}
- long nInitPosX = nScrX;
+ tools::Long nInitPosX = nScrX;
if ( bLayoutRTL )
nInitPosX += nMirrorW - 1; // always in pixels
- long nLayoutSign = bLayoutRTL ? -1 : 1;
+ tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
tools::Rectangle aCellRect;
- long nPosY = nScrY;
+ tools::Long nPosY = nScrY;
for (SCSIZE nArrY=1; nArrY+1<nArrCount; nArrY++)
{
RowInfo* pThisRowInfo = &pRowInfo[nArrY];
if ( pThisRowInfo->bChanged )
{
SCROW nY = pThisRowInfo->nRowNo;
- long nPosX = nInitPosX;
+ tools::Long nPosX = nInitPosX;
for (SCCOL nX=nX1; nX<=nX2; nX++)
{
CellInfo* pInfo = &pThisRowInfo->pCellInfo[nX+1];
@@ -2476,32 +2476,32 @@ void ScOutputData::DrawClipMarks()
SCCOL nOverX = nX;
SCROW nOverY = nY;
- long nStartPosX = nPosX;
- long nStartPosY = nPosY;
+ tools::Long nStartPosX = nPosX;
+ tools::Long nStartPosY = nPosY;
while ( nOverX > 0 && ( mpDoc->GetAttr(
nOverX, nOverY, nTab, ATTR_MERGE_FLAG )->GetValue() & ScMF::Hor ) )
{
--nOverX;
- nStartPosX -= nLayoutSign * static_cast<long>( mpDoc->GetColWidth(nOverX,nTab) * mnPPTX );
+ nStartPosX -= nLayoutSign * static_cast<tools::Long>( mpDoc->GetColWidth(nOverX,nTab) * mnPPTX );
}
while ( nOverY > 0 && ( mpDoc->GetAttr(
nOverX, nOverY, nTab, ATTR_MERGE_FLAG )->GetValue() & ScMF::Ver ) )
{
--nOverY;
- nStartPosY -= nLayoutSign * static_cast<long>( mpDoc->GetRowHeight(nOverY,nTab) * mnPPTY );
+ nStartPosY -= nLayoutSign * static_cast<tools::Long>( mpDoc->GetRowHeight(nOverY,nTab) * mnPPTY );
}
- long nOutWidth = static_cast<long>( mpDoc->GetColWidth(nOverX,nTab) * mnPPTX );
- long nOutHeight = static_cast<long>( mpDoc->GetRowHeight(nOverY,nTab) * mnPPTY );
+ tools::Long nOutWidth = static_cast<tools::Long>( mpDoc->GetColWidth(nOverX,nTab) * mnPPTX );
+ tools::Long nOutHeight = static_cast<tools::Long>( mpDoc->GetRowHeight(nOverY,nTab) * mnPPTY );
const ScMergeAttr* pMerge = mpDoc->GetAttr( nOverX, nOverY, nTab, ATTR_MERGE );
SCCOL nCountX = pMerge->GetColMerge();
for (SCCOL i=1; i<nCountX; i++)
- nOutWidth += static_cast<long>( mpDoc->GetColWidth(nOverX+i,nTab) * mnPPTX );
+ nOutWidth += static_cast<tools::Long>( mpDoc->GetColWidth(nOverX+i,nTab) * mnPPTX );
SCROW nCountY = pMerge->GetRowMerge();
- nOutHeight += static_cast<long>(mpDoc->GetScaledRowHeight( nOverY+1, nOverY+nCountY-1, nTab, mnPPTY));
+ nOutHeight += static_cast<tools::Long>(mpDoc->GetScaledRowHeight( nOverY+1, nOverY+nCountY-1, nTab, mnPPTY));
if ( bLayoutRTL )
nStartPosX -= nOutWidth - 1;
@@ -2509,8 +2509,8 @@ void ScOutputData::DrawClipMarks()
}
else
{
- long nOutWidth = pRowInfo[0].pCellInfo[nX+1].nWidth;
- long nOutHeight = pThisRowInfo->nHeight;
+ tools::Long nOutWidth = pRowInfo[0].pCellInfo[nX+1].nWidth;
+ tools::Long nOutHeight = pThisRowInfo->nHeight;
if ( pInfo->bMerged && pInfo->pPatternAttr )
{
@@ -2520,12 +2520,12 @@ void ScOutputData::DrawClipMarks()
&pInfo->pPatternAttr->GetItem(ATTR_MERGE);
SCCOL nCountX = pMerge->GetColMerge();
for (SCCOL i=1; i<nCountX; i++)
- nOutWidth += static_cast<long>( mpDoc->GetColWidth(nOverX+i,nTab) * mnPPTX );
+ nOutWidth += static_cast<tools::Long>( mpDoc->GetColWidth(nOverX+i,nTab) * mnPPTX );
SCROW nCountY = pMerge->GetRowMerge();
- nOutHeight += static_cast<long>(mpDoc->GetScaledRowHeight( nOverY+1, nOverY+nCountY-1, nTab, mnPPTY));
+ nOutHeight += static_cast<tools::Long>(mpDoc->GetScaledRowHeight( nOverY+1, nOverY+nCountY-1, nTab, mnPPTY));
}
- long nStartPosX = nPosX;
+ tools::Long nStartPosX = nPosX;
if ( bLayoutRTL )
nStartPosX -= nOutWidth - 1;
// #i80447# create aCellRect from two points in case nOutWidth is 0
@@ -2539,7 +2539,7 @@ void ScOutputData::DrawClipMarks()
else
aCellRect.AdjustRight( -1 );
- long nMarkPixel = static_cast<long>( SC_CLIPMARK_SIZE * mnPPTX );
+ tools::Long nMarkPixel = static_cast<tools::Long>( SC_CLIPMARK_SIZE * mnPPTX );
Size aMarkSize( nMarkPixel, (nMarkPixel-1)*2 );
if ( pInfo->nClipMark & ( bLayoutRTL ? ScClipMark::Right : ScClipMark::Left ) )
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 39aaf01d9957..c25d8abb908f 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -96,7 +96,7 @@ class ScDrawStringsVars
vcl::Font aFont; // created from attributes
FontMetric aMetric;
- long nAscentPixel; // always pixels
+ tools::Long nAscentPixel; // always pixels
SvxCellOrientation eAttrOrient;
SvxCellHorJustify eAttrHorJust;
SvxCellVerJustify eAttrVerJust;
@@ -107,11 +107,11 @@ class ScDrawStringsVars
OUString aString; // contents
Size aTextSize;
- long nOriginalWidth;
- long nMaxDigitWidth;
- long nSignWidth;
- long nDotWidth;
- long nExpWidth;
+ tools::Long nOriginalWidth;
+ tools::Long nMaxDigitWidth;
+ tools::Long nSignWidth;
+ tools::Long nDotWidth;
+ tools::Long nExpWidth;
ScRefCellValue maLastCell;
sal_uLong nValueFormat;
@@ -141,7 +141,7 @@ public:
bool SetText( const ScRefCellValue& rCell ); // TRUE -> drop pOldPattern
void SetHashText();
- void SetTextToWidthOrHash( ScRefCellValue& rCell, long nWidth );
+ void SetTextToWidthOrHash( ScRefCellValue& rCell, tools::Long nWidth );
void SetAutoText( const OUString& rAutoText );
SvxCellOrientation GetOrient() const { return eAttrOrient; }
@@ -155,7 +155,7 @@ public:
const OUString& GetString() const { return aString; }
const Size& GetTextSize() const { return aTextSize; }
- long GetOriginalWidth() const { return nOriginalWidth; }
+ tools::Long GetOriginalWidth() const { return nOriginalWidth; }
// Get the effective number format, including formula result types.
// This assumes that a formula cell has already been calculated.
@@ -164,12 +164,12 @@ public:
bool GetLineBreak() const { return bLineBreak; }
bool IsRepeat() const { return bRepeat; }
bool IsShrink() const { return bShrink; }
- void RepeatToFill( long nColWidth );
+ void RepeatToFill( tools::Long nColWidth );
- long GetAscent() const { return nAscentPixel; }
+ tools::Long GetAscent() const { return nAscentPixel; }
bool IsRotated() const { return bRotated; }
- void SetShrinkScale( long nScale, SvtScriptType nScript );
+ void SetShrinkScale( tools::Long nScale, SvtScriptType nScript );
bool HasCondHeight() const { return pCondSet && SfxItemState::SET ==
pCondSet->GetItemState( ATTR_FONT_HEIGHT ); }
@@ -177,10 +177,10 @@ public:
bool HasEditCharacters() const;
private:
- long GetMaxDigitWidth(); // in logic units
- long GetSignWidth();
- long GetDotWidth();
- long GetExpWidth();
+ tools::Long GetMaxDigitWidth(); // in logic units
+ tools::Long GetSignWidth();
+ tools::Long GetDotWidth();
+ tools::Long GetExpWidth();
void TextChanged();
};
@@ -218,7 +218,7 @@ ScDrawStringsVars::ScDrawStringsVars(ScOutputData* pData, bool bPTL) :
aTextConfigColor = rColorConfig.GetColorValue(svtools::FONTCOLOR).nColor;
}
-void ScDrawStringsVars::SetShrinkScale( long nScale, SvtScriptType nScript )
+void ScDrawStringsVars::SetShrinkScale( tools::Long nScale, SvtScriptType nScript )
{
// text remains valid, size is updated
@@ -233,7 +233,7 @@ void ScDrawStringsVars::SetShrinkScale( long nScale, SvtScriptType nScript )
aFraction *= pOutput->aZoomY;
vcl::Font aTmpFont;
pPattern->GetFont( aTmpFont, SC_AUTOCOL_RAW, pFmtDevice, &aFraction, pCondSet, nScript );
- long nNewHeight = aTmpFont.GetFontHeight();
+ tools::Long nNewHeight = aTmpFont.GetFontHeight();
if ( nNewHeight > 0 )
aFont.SetFontHeight( nNewHeight );
@@ -554,36 +554,36 @@ void ScDrawStringsVars::SetHashText()
SetAutoText("###");
}
-void ScDrawStringsVars::RepeatToFill( long nColWidth )
+void ScDrawStringsVars::RepeatToFill( tools::Long nColWidth )
{
if ( nRepeatPos == -1 || nRepeatPos > aString.getLength() )
return;
- long nCharWidth = pOutput->pFmtDevice->GetTextWidth(OUString(nRepeatChar));
+ tools::Long nCharWidth = pOutput->pFmtDevice->GetTextWidth(OUString(nRepeatChar));
if ( nCharWidth < 1 || (bPixelToLogic && nCharWidth < pOutput->mpRefDevice->PixelToLogic(Size(1,0)).Width()) )
return;
// Are there restrictions on the cell type we should filter out here ?
- long nTextWidth = aTextSize.Width();
+ tools::Long nTextWidth = aTextSize.Width();
if ( bPixelToLogic )
{
nColWidth = pOutput->mpRefDevice->PixelToLogic(Size(nColWidth,0)).Width();
nTextWidth = pOutput->mpRefDevice->PixelToLogic(Size(nTextWidth,0)).Width();
}
- long nSpaceToFill = nColWidth - nTextWidth;
+ tools::Long nSpaceToFill = nColWidth - nTextWidth;
if ( nSpaceToFill <= nCharWidth )
return;
- long nCharsToInsert = nSpaceToFill / nCharWidth;
+ tools::Long nCharsToInsert = nSpaceToFill / nCharWidth;
OUStringBuffer aFill;
comphelper::string::padToLength(aFill, nCharsToInsert, nRepeatChar);
aString = aString.replaceAt( nRepeatPos, 0, aFill.makeStringAndClear() );
TextChanged();
}
-void ScDrawStringsVars::SetTextToWidthOrHash( ScRefCellValue& rCell, long nWidth )
+void ScDrawStringsVars::SetTextToWidthOrHash( ScRefCellValue& rCell, tools::Long nWidth )
{
// #i113045# do the single-character width calculations in logic units
if (bPixelToLogic)
@@ -621,7 +621,7 @@ void ScDrawStringsVars::SetTextToWidthOrHash( ScRefCellValue& rCell, long nWidth
if (!pNumFormat)
return;
- long nMaxDigit = GetMaxDigitWidth();
+ tools::Long nMaxDigit = GetMaxDigitWidth();
if (!nMaxDigit)
return;
@@ -676,7 +676,7 @@ void ScDrawStringsVars::SetTextToWidthOrHash( ScRefCellValue& rCell, long nWidth
aString = sTempOut;
}
- long nActualTextWidth = pOutput->pFmtDevice->GetTextWidth(aString);
+ tools::Long nActualTextWidth = pOutput->pFmtDevice->GetTextWidth(aString);
if (nActualTextWidth > nWidth)
{
// Even after the decimal adjustment the text doesn't fit. Give up.
@@ -700,13 +700,13 @@ void ScDrawStringsVars::SetAutoText( const OUString& rAutoText )
if ( !pRefDevice->GetConnectMetaFile() || pRefDevice->GetOutDevType() == OUTDEV_PRINTER )
{
double fMul = pOutput->GetStretch();
- aTextSize.setWidth( static_cast<long>(aTextSize.Width() / fMul + 0.5) );
+ aTextSize.setWidth( static_cast<tools::Long>(aTextSize.Width() / fMul + 0.5) );
}
aTextSize.setHeight( aMetric.GetAscent() + aMetric.GetDescent() );
if ( GetOrient() != SvxCellOrientation::Standard )
{
- long nTemp = aTextSize.Height();
+ tools::Long nTemp = aTextSize.Height();
aTextSize.setHeight( aTextSize.Width() );
aTextSize.setWidth( nTemp );
}
@@ -718,7 +718,7 @@ void ScDrawStringsVars::SetAutoText( const OUString& rAutoText )
maLastCell.clear(); // the same text may fit in the next cell
}
-long ScDrawStringsVars::GetMaxDigitWidth()
+tools::Long ScDrawStringsVars::GetMaxDigitWidth()
{
if (nMaxDigitWidth > 0)
return nMaxDigitWidth;
@@ -726,13 +726,13 @@ long ScDrawStringsVars::GetMaxDigitWidth()
for (char i = 0; i < 10; ++i)
{
char cDigit = '0' + i;
- long n = pOutput->pFmtDevice->GetTextWidth(OUString(cDigit));
+ tools::Long n = pOutput->pFmtDevice->GetTextWidth(OUString(cDigit));
nMaxDigitWidth = ::std::max(nMaxDigitWidth, n);
}
return nMaxDigitWidth;
}
-long ScDrawStringsVars::GetSignWidth()
+tools::Long ScDrawStringsVars::GetSignWidth()
{
if (nSignWidth > 0)
return nSignWidth;
@@ -741,7 +741,7 @@ long ScDrawStringsVars::GetSignWidth()
return nSignWidth;
}
-long ScDrawStringsVars::GetDotWidth()
+tools::Long ScDrawStringsVars::GetDotWidth()
{
if (nDotWidth > 0)
return nDotWidth;
@@ -751,7 +751,7 @@ long ScDrawStringsVars::GetDotWidth()
return nDotWidth;
}
-long ScDrawStringsVars::GetExpWidth()
+tools::Long ScDrawStringsVars::GetExpWidth()
{
if (nExpWidth > 0)
return nExpWidth;
@@ -770,13 +770,13 @@ void ScDrawStringsVars::TextChanged()
if ( !pRefDevice->GetConnectMetaFile() || pRefDevice->GetOutDevType() == OUTDEV_PRINTER )
{
double fMul = pOutput->GetStretch();
- aTextSize.setWidth( static_cast<long>(aTextSize.Width() / fMul + 0.5) );
+ aTextSize.setWidth( static_cast<tools::Long>(aTextSize.Width() / fMul + 0.5) );
}
aTextSize.setHeight( aMetric.GetAscent() + aMetric.GetDescent() );
if ( GetOrient() != SvxCellOrientation::Standard )
{
- long nTemp = aTextSize.Height();
+ tools::Long nTemp = aTextSize.Height();
aTextSize.setHeight( aTextSize.Width() );
aTextSize.setWidth( nTemp );
}
@@ -1161,8 +1161,8 @@ bool ScOutputData::IsAvailable( SCCOL nX, SCROW nY )
// bOverwrite: if set, also extend into non-empty cells (for rotated text)
// rParam output: various area parameters.
-void ScOutputData::GetOutputArea( SCCOL nX, SCSIZE nArrY, long nPosX, long nPosY,
- SCCOL nCellX, SCROW nCellY, long nNeeded,
+void ScOutputData::GetOutputArea( SCCOL nX, SCSIZE nArrY, tools::Long nPosX, tools::Long nPosY,
+ SCCOL nCellX, SCROW nCellY, tools::Long nNeeded,
const ScPatternAttr& rPattern,
sal_uInt16 nHorJustify, bool bCellIsValue,
bool bBreak, bool bOverwrite,
@@ -1171,29 +1171,29 @@ void ScOutputData::GetOutputArea( SCCOL nX, SCSIZE nArrY, long nPosX, long nPosY
// rThisRowInfo may be for a different row than nCellY, is still used for clip marks
RowInfo& rThisRowInfo = pRowInfo[nArrY];
- long nLayoutSign = bLayoutRTL ? -1 : 1;
+ tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
- long nCellPosX = nPosX; // find nCellX position, starting at nX/nPosX
+ tools::Long nCellPosX = nPosX; // find nCellX position, starting at nX/nPosX
SCCOL nCompCol = nX;
while ( nCellX > nCompCol )
{
//! extra member function for width?
- long nColWidth = ( nCompCol <= nX2 ) ?
+ tools::Long nColWidth = ( nCompCol <= nX2 ) ?
pRowInfo[0].pCellInfo[nCompCol+1].nWidth :
- static_cast<long>( mpDoc->GetColWidth( nCompCol, nTab ) * mnPPTX );
+ static_cast<tools::Long>( mpDoc->GetColWidth( nCompCol, nTab ) * mnPPTX );
nCellPosX += nColWidth * nLayoutSign;
++nCompCol;
}
while ( nCellX < nCompCol )
{
--nCompCol;
- long nColWidth = ( nCompCol <= nX2 ) ?
+ tools::Long nColWidth = ( nCompCol <= nX2 ) ?
pRowInfo[0].pCellInfo[nCompCol+1].nWidth :
- static_cast<long>( mpDoc->GetColWidth( nCompCol, nTab ) * mnPPTX );
+ static_cast<tools::Long>( mpDoc->GetColWidth( nCompCol, nTab ) * mnPPTX );
nCellPosX -= nColWidth * nLayoutSign;
}
- long nCellPosY = nPosY; // find nCellY position, starting at nArrY/nPosY
+ tools::Long nCellPosY = nPosY; // find nCellY position, starting at nArrY/nPosY
SCSIZE nCompArr = nArrY;
SCROW nCompRow = pRowInfo[nCompArr].nRowNo;
while ( nCellY > nCompRow )
@@ -1208,30 +1208,30 @@ void ScOutputData::GetOutputArea( SCCOL nX, SCSIZE nArrY, long nPosX, long nPosY
{
sal_uInt16 nDocHeight = mpDoc->GetRowHeight( nCompRow, nTab );
if ( nDocHeight )
- nCellPosY += static_cast<long>( nDocHeight * mnPPTY );
+ nCellPosY += static_cast<tools::Long>( nDocHeight * mnPPTY );
++nCompRow;
}
}
- nCellPosY -= static_cast<long>(mpDoc->GetScaledRowHeight( nCellY, nCompRow-1, nTab, mnPPTY ));
+ nCellPosY -= static_cast<tools::Long>(mpDoc->GetScaledRowHeight( nCellY, nCompRow-1, nTab, mnPPTY ));
const ScMergeAttr* pMerge = &rPattern.GetItem( ATTR_MERGE );
bool bMerged = pMerge->IsMerged();
- long nMergeCols = pMerge->GetColMerge();
+ tools::Long nMergeCols = pMerge->GetColMerge();
if ( nMergeCols == 0 )
nMergeCols = 1;
- long nMergeRows = pMerge->GetRowMerge();
+ tools::Long nMergeRows = pMerge->GetRowMerge();
if ( nMergeRows == 0 )
nMergeRows = 1;
- long nMergeSizeX = 0;
- for ( long i=0; i<nMergeCols; i++ )
+ tools::Long nMergeSizeX = 0;
+ for ( tools::Long i=0; i<nMergeCols; i++ )
{
- long nColWidth = ( nCellX+i <= nX2 ) ?
+ tools::Long nColWidth = ( nCellX+i <= nX2 ) ?
pRowInfo[0].pCellInfo[nCellX+i+1].nWidth :
- static_cast<long>( mpDoc->GetColWidth( sal::static_int_cast<SCCOL>(nCellX+i), nTab ) * mnPPTX );
+ static_cast<tools::Long>( mpDoc->GetColWidth( sal::static_int_cast<SCCOL>(nCellX+i), nTab ) * mnPPTX );
nMergeSizeX += nColWidth;
}
- long nMergeSizeY = 0;
+ tools::Long nMergeSizeY = 0;
short nDirect = 0;
if ( rThisRowInfo.nRowNo == nCellY )
{
@@ -1240,7 +1240,7 @@ void ScOutputData::GetOutputArea( SCCOL nX, SCSIZE nArrY, long nPosX, long nPosY
nDirect = 1; // skip in loop
}
// following rows always from document
- nMergeSizeY += static_cast<long>(mpDoc->GetScaledRowHeight( nCellY+nDirect, nCellY+nMergeRows-1, nTab, mnPPTY));
+ nMergeSizeY += static_cast<tools::Long>(mpDoc->GetScaledRowHeight( nCellY+nDirect, nCellY+nMergeRows-1, nTab, mnPPTY));
--nMergeSizeX; // leave out the grid horizontally, also for alignment (align between grid lines)
@@ -1264,9 +1264,9 @@ void ScOutputData::GetOutputArea( SCCOL nX, SCSIZE nArrY, long nPosX, long nPosY
{
SvxCellHorJustify eHorJust = static_cast<SvxCellHorJustify>(nHorJustify);
- long nMissing = nNeeded - nMergeSizeX;
- long nLeftMissing = 0;
- long nRightMissing = 0;
+ tools::Long nMissing = nNeeded - nMergeSizeX;
+ tools::Long nLeftMissing = 0;
+ tools::Long nRightMissing = 0;
switch ( eHorJust )
{
case SvxCellHorJustify::Left:
@@ -1298,7 +1298,7 @@ void ScOutputData::GetOutputArea( SCCOL nX, SCSIZE nArrY, long nPosX, long nPosY
while ( nRightMissing > 0 && nRightX < mpDoc->MaxCol() && ( bOverwrite || IsAvailable( nRightX+1, nCellY ) ) )
{
++nRightX;
- long nAdd = static_cast<long>( mpDoc->GetColWidth( nRightX, nTab ) * mnPPTX );
+ tools::Long nAdd = static_cast<tools::Long>( mpDoc->GetColWidth( nRightX, nTab ) * mnPPTX );
nRightMissing -= nAdd;
rParam.maClipRect.AdjustRight(nAdd * nLayoutSign );
@@ -1312,7 +1312,7 @@ void ScOutputData::GetOutputArea( SCCOL nX, SCSIZE nArrY, long nPosX, long nPosY
rThisRowInfo.pCellInfo[nLeftX].bHideGrid = true;
--nLeftX;
- long nAdd = static_cast<long>( mpDoc->GetColWidth( nLeftX, nTab ) * mnPPTX );
+ tools::Long nAdd = static_cast<tools::Long>( mpDoc->GetColWidth( nLeftX, nTab ) * mnPPTX );
nLeftMissing -= nAdd;
rParam.maClipRect.AdjustLeft( -(nAdd * nLayoutSign) );
}
@@ -1324,14 +1324,14 @@ void ScOutputData::GetOutputArea( SCCOL nX, SCSIZE nArrY, long nPosX, long nPosY
{
rThisRowInfo.pCellInfo[nRightX+1].nClipMark |= ScClipMark::Right;
bAnyClipped = true;
- long nMarkPixel = static_cast<long>( SC_CLIPMARK_SIZE * mnPPTX );
+ tools::Long nMarkPixel = static_cast<tools::Long>( SC_CLIPMARK_SIZE * mnPPTX );
rParam.maClipRect.AdjustRight( -(nMarkPixel * nLayoutSign) );
}
if ( nLeftMissing > 0 && bMarkClipped && nLeftX >= nX1 && nLeftX <= nX2 && !bBreak && !bCellIsValue )
{
rThisRowInfo.pCellInfo[nLeftX+1].nClipMark |= ScClipMark::Left;
bAnyClipped = true;
- long nMarkPixel = static_cast<long>( SC_CLIPMARK_SIZE * mnPPTX );
+ tools::Long nMarkPixel = static_cast<tools::Long>( SC_CLIPMARK_SIZE * mnPPTX );
rParam.maClipRect.AdjustLeft(nMarkPixel * nLayoutSign );
}
@@ -1352,7 +1352,7 @@ void ScOutputData::GetOutputArea( SCCOL nX, SCSIZE nArrY, long nPosX, long nPosY
( !bBreak || mpRefDevice == pFmtDevice ) )
{
// filter drop-down width is now independent from row height
- const long nFilter = DROPDOWN_BITMAP_SIZE;
+ const tools::Long nFilter = DROPDOWN_BITMAP_SIZE;
bool bFit = ( nNeeded + nFilter <= nMergeSizeX );
if ( bFit )
{
@@ -1461,10 +1461,10 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co
bool bProgress = false;
- long nInitPosX = nScrX;
+ tools::Long nInitPosX = nScrX;
if ( bLayoutRTL )
nInitPosX += nMirrorW - 1; // pixels
- long nLayoutSign = bLayoutRTL ? -1 : 1;
+ tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
SCCOL nLastContentCol = mpDoc->MaxCol();
if ( nX2 < mpDoc->MaxCol() )
@@ -1477,7 +1477,7 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co
// variables for GetOutputArea
OutputAreaParam aAreaParam;
bool bCellIsValue = false;
- long nNeededWidth = 0;
+ tools::Long nNeededWidth = 0;
const ScPatternAttr* pPattern = nullptr;
const SfxItemSet* pCondSet = nullptr;
const ScPatternAttr* pOldPattern = nullptr;
@@ -1489,14 +1489,14 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co
std::vector<std::unique_ptr<ScPatternAttr> > aAltPatterns;
std::vector<long> aDX;
- long nPosY = nScrY;
+ tools::Long nPosY = nScrY;
for (SCSIZE nArrY=1; nArrY+1<nArrCount; nArrY++)
{
RowInfo* pThisRowInfo = &pRowInfo[nArrY];
SCROW nY = pThisRowInfo->nRowNo;
if ((bPaint && pThisRowInfo->bChanged) || (!bPaint && rAddress.Row() == nY))
{
- long nPosX = nInitPosX;
+ tools::Long nPosX = nInitPosX;
if ( nLoopStartX < nX1 )
nPosX -= pRowInfo[0].pCellInfo[nLoopStartX+1].nWidth * nLayoutSign;
for (SCCOL nX=nLoopStartX; nX<=nX2; nX++)
@@ -1696,7 +1696,7 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co
pOldPattern = nullptr;
bUseEditEngine = aVars.HasEditCharacters() || (bFormulaCell && aCell.mpFormula->IsMultilineResult());
}
- long nTotalMargin = 0;
+ tools::Long nTotalMargin = 0;
SvxCellHorJustify eOutHorJust = SvxCellHorJustify::Standard;
if (bDoCell && !bUseEditEngine)
{
@@ -1723,8 +1723,8 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co
bool bShrink = aVars.IsShrink() && !bBreak && !bRepeat;
nTotalMargin =
- static_cast<long>(aVars.GetLeftTotal() * mnPPTX) +
- static_cast<long>(aVars.GetMargin()->GetRightMargin() * mnPPTX);
+ static_cast<tools::Long>(aVars.GetLeftTotal() * mnPPTX) +
+ static_cast<tools::Long>(aVars.GetMargin()->GetRightMargin() * mnPPTX);
nNeededWidth = aVars.GetTextSize().Width() + nTotalMargin;
@@ -1745,15 +1745,15 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co
}
else if ( aAreaParam.mbLeftClip || aAreaParam.mbRightClip ) // horizontal
{
- long nAvailable = aAreaParam.maAlignRect.GetWidth() - nTotalMargin;
- long nScaleSize = aVars.GetTextSize().Width(); // without margin
+ tools::Long nAvailable = aAreaParam.maAlignRect.GetWidth() - nTotalMargin;
+ tools::Long nScaleSize = aVars.GetTextSize().Width(); // without margin
if ( nAvailable > 0 && nScaleSize > 0 ) // 0 if the text is empty (formulas, number formats)
{
- long nScale = ( nAvailable * 100 ) / nScaleSize;
+ tools::Long nScale = ( nAvailable * 100 ) / nScaleSize;
aVars.SetShrinkScale( nScale, nOldScript );
- long nNewSize = aVars.GetTextSize().Width();
+ tools::Long nNewSize = aVars.GetTextSize().Width();
sal_uInt16 nShrinkAgain = 0;
while ( nNewSize > nAvailable && nShrinkAgain < SC_SHRINKAGAIN_MAX )
@@ -1782,20 +1782,20 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co
if ( bRepeat && !aAreaParam.mbLeftClip && !aAreaParam.mbRightClip )
{
- long nAvailable = aAreaParam.maAlignRect.GetWidth() - nTotalMargin;
- long nRepeatSize = aVars.GetTextSize().Width(); // without margin
+ tools::Long nAvailable = aAreaParam.maAlignRect.GetWidth() - nTotalMargin;
+ tools::Long nRepeatSize = aVars.GetTextSize().Width(); // without margin
// When formatting for the printer, the text sizes don't always add up.
// Round down (too few repetitions) rather than exceeding the cell size then:
if ( pFmtDevice != mpRefDevice )
++nRepeatSize;
if ( nRepeatSize > 0 )
{
- long nRepeatCount = nAvailable / nRepeatSize;
+ tools::Long nRepeatCount = nAvailable / nRepeatSize;
if ( nRepeatCount > 1 )
{
OUString aCellStr = aVars.GetString();
OUStringBuffer aRepeated = aCellStr;
- for ( long nRepeat = 1; nRepeat < nRepeatCount; nRepeat++ )
+ for ( tools::Long nRepeat = 1; nRepeat < nRepeatCount; nRepeat++ )
aRepeated.append(aCellStr);
aVars.SetAutoText( aRepeated.makeStringAndClear() );
}
@@ -1809,9 +1809,9 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co
bUseEditEngine = ( aAreaParam.mbLeftClip || aAreaParam.mbRightClip );
else
{
- long nHeight = aVars.GetTextSize().Height() +
- static_cast<long>(aVars.GetMargin()->GetTopMargin()*mnPPTY) +
- static_cast<long>(aVars.GetMargin()->GetBottomMargin()*mnPPTY);
+ tools::Long nHeight = aVars.GetTextSize().Height() +
+ static_cast<tools::Long>(aVars.GetMargin()->GetTopMargin()*mnPPTY) +
+ static_cast<tools::Long>(aVars.GetMargin()->GetBottomMargin()*mnPPTY);
bUseEditEngine = ( nHeight > aAreaParam.maClipRect.GetHeight() );
}
}
@@ -1843,8 +1843,8 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co
aVars.SetTextToWidthOrHash(aCell, aAreaParam.mnColWidth - nTotalMargin);
nNeededWidth = aVars.GetTextSize().Width() +
- static_cast<long>( aVars.GetLeftTotal() * mnPPTX ) +
- static_cast<long>( aVars.GetMargin()->GetRightMargin() * mnPPTX );
+ static_cast<tools::Long>( aVars.GetLeftTotal() * mnPPTX ) +
+ static_cast<tools::Long>( aVars.GetMargin()->GetRightMargin() * mnPPTX );
if ( nNeededWidth <= aAreaParam.maClipRect.GetWidth() )
{
// Cell value is no longer clipped. Reset relevant parameters.
@@ -1857,10 +1857,10 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co
// The rectangles from the first GetOutputArea call remain valid.
}
- long nJustPosX = aAreaParam.maAlignRect.Left(); // "justified" - effect of alignment will be added
- long nJustPosY = aAreaParam.maAlignRect.Top();
- long nAvailWidth = aAreaParam.maAlignRect.GetWidth();
- long nOutHeight = aAreaParam.maAlignRect.GetHeight();
+ tools::Long nJustPosX = aAreaParam.maAlignRect.Left(); // "justified" - effect of alignment will be added
+ tools::Long nJustPosY = aAreaParam.maAlignRect.Top();
+ tools::Long nAvailWidth = aAreaParam.maAlignRect.GetWidth();
+ tools::Long nOutHeight = aAreaParam.maAlignRect.GetHeight();
bool bOutside = ( aAreaParam.maClipRect.Right() < nScrX || aAreaParam.maClipRect.Left() >= nScrX + nScrW );
// Take adjusted values of aAreaParam.mbLeftClip and aAreaParam.mbRightClip
@@ -1875,17 +1875,17 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co
switch (eOutHorJust)
{
case SvxCellHorJustify::Left:
- nJustPosX += static_cast<long>( aVars.GetLeftTotal() * mnPPTX );
+ nJustPosX += static_cast<tools::Long>( aVars.GetLeftTotal() * mnPPTX );
break;
case SvxCellHorJustify::Right:
nJustPosX += nAvailWidth - aVars.GetTextSize().Width() -
- static_cast<long>( aVars.GetRightTotal() * mnPPTX );
+ static_cast<tools::Long>( aVars.GetRightTotal() * mnPPTX );
bRightAdjusted = true;
break;
case SvxCellHorJustify::Center:
nJustPosX += ( nAvailWidth - aVars.GetTextSize().Width() +
- static_cast<long>( aVars.GetLeftTotal() * mnPPTX ) -
- static_cast<long>( aVars.GetMargin()->GetRightMargin() * mnPPTX ) ) / 2;
+ static_cast<tools::Long>( aVars.GetLeftTotal() * mnPPTX ) -
+ static_cast<tools::Long>( aVars.GetMargin()->GetRightMargin() * mnPPTX ) ) / 2;
break;
default:
{
@@ -1893,28 +1893,28 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co
}
}
- long nTestClipHeight = aVars.GetTextSize().Height();
+ tools::Long nTestClipHeight = aVars.GetTextSize().Height();
switch (aVars.GetVerJust())
{
case SvxCellVerJustify::Top:
case SvxCellVerJustify::Block:
{
- long nTop = static_cast<long>( aVars.GetMargin()->GetTopMargin() * mnPPTY );
+ tools::Long nTop = static_cast<tools::Long>( aVars.GetMargin()->GetTopMargin() * mnPPTY );
nJustPosY += nTop;
nTestClipHeight += nTop;
}
break;
case SvxCellVerJustify::Bottom:
{
- long nBot = static_cast<long>( aVars.GetMargin()->GetBottomMargin() * mnPPTY );
+ tools::Long nBot = static_cast<tools::Long>( aVars.GetMargin()->GetBottomMargin() * mnPPTY );
nJustPosY += nOutHeight - aVars.GetTextSize().Height() - nBot;
nTestClipHeight += nBot;
}
break;
case SvxCellVerJustify::Center:
{
- long nTop = static_cast<long>( aVars.GetMargin()->GetTopMargin() * mnPPTY );
- long nBot = static_cast<long>( aVars.GetMargin()->GetBottomMargin() * mnPPTY );
+ tools::Long nTop = static_cast<tools::Long>( aVars.GetMargin()->GetTopMargin() * mnPPTY );
+ tools::Long nBot = static_cast<tools::Long>( aVars.GetMargin()->GetBottomMargin() * mnPPTY );
nJustPosY += ( nOutHeight + nTop -
aVars.GetTextSize().Height() - nBot ) / 2;
nTestClipHeight += std::abs( nTop - nBot );
@@ -2170,7 +2170,7 @@ static bool lcl_SafeIsValue( ScRefCellValue& rCell )
return false;
}
-static void lcl_ScaleFonts( EditEngine& rEngine, long nPercent )
+static void lcl_ScaleFonts( EditEngine& rEngine, tools::Long nPercent )
{
bool bUpdateMode = rEngine.GetUpdateMode();
if ( bUpdateMode )
@@ -2188,9 +2188,9 @@ static void lcl_ScaleFonts( EditEngine& rEngine, long nPercent )
ESelection aSel( nPar, nStart, nPar, nEnd );
SfxItemSet aAttribs = rEngine.GetAttribs( aSel );
- long nWestern = aAttribs.Get(EE_CHAR_FONTHEIGHT).GetHeight();
- long nCJK = aAttribs.Get(EE_CHAR_FONTHEIGHT_CJK).GetHeight();
- long nCTL = aAttribs.Get(EE_CHAR_FONTHEIGHT_CTL).GetHeight();
+ tools::Long nWestern = aAttribs.Get(EE_CHAR_FONTHEIGHT).GetHeight();
+ tools::Long nCJK = aAttribs.Get(EE_CHAR_FONTHEIGHT_CJK).GetHeight();
+ tools::Long nCTL = aAttribs.Get(EE_CHAR_FONTHEIGHT_CTL).GetHeight();
nWestern = ( nWestern * nPercent ) / 100;
nCJK = ( nCJK * nPercent ) / 100;
@@ -2210,15 +2210,15 @@ static void lcl_ScaleFonts( EditEngine& rEngine, long nPercent )
rEngine.SetUpdateMode( true );
}
-static long lcl_GetEditSize( EditEngine& rEngine, bool bWidth, bool bSwap, long nAttrRotate )
+static tools::Long lcl_GetEditSize( EditEngine& rEngine, bool bWidth, bool bSwap, tools::Long nAttrRotate )
{
if ( bSwap )
bWidth = !bWidth;
if ( nAttrRotate )
{
- long nRealWidth = static_cast<long>(rEngine.CalcTextWidth());
- long nRealHeight = rEngine.GetTextHeight();
+ tools::Long nRealWidth = static_cast<tools::Long>(rEngine.CalcTextWidth());
+ tools::Long nRealHeight = rEngine.GetTextHeight();
// assuming standard mode, otherwise width isn't used
@@ -2226,26 +2226,26 @@ static long lcl_GetEditSize( EditEngine& rEngine, bool bWidth, bool bSwap, long
double nAbsCos = fabs( cos( nRealOrient ) );
double nAbsSin = fabs( sin( nRealOrient ) );
if ( bWidth )
- return static_cast<long>( nRealWidth * nAbsCos + nRealHeight * nAbsSin );
+ return static_cast<tools::Long>( nRealWidth * nAbsCos + nRealHeight * nAbsSin );
else
- return static_cast<long>( nRealHeight * nAbsCos + nRealWidth * nAbsSin );
+ return static_cast<tools::Long>( nRealHeight * nAbsCos + nRealWidth * nAbsSin );
}
else if ( bWidth )
- return static_cast<long>(rEngine.CalcTextWidth());
+ return static_cast<tools::Long>(rEngine.CalcTextWidth());
else
return rEngine.GetTextHeight();
}
void ScOutputData::ShrinkEditEngine( EditEngine& rEngine, const tools::Rectangle& rAlignRect,
- long nLeftM, long nTopM, long nRightM, long nBottomM,
- bool bWidth, SvxCellOrientation nOrient, long nAttrRotate, bool bPixelToLogic,
- long& rEngineWidth, long& rEngineHeight, long& rNeededPixel, bool& rLeftClip, bool& rRightClip )
+ tools::Long nLeftM, tools::Long nTopM, tools::Long nRightM, tools::Long nBottomM,
+ bool bWidth, SvxCellOrientation nOrient, tools::Long nAttrRotate, bool bPixelToLogic,
+ tools::Long& rEngineWidth, tools::Long& rEngineHeight, tools::Long& rNeededPixel, bool& rLeftClip, bool& rRightClip )
{
if ( !bWidth )
{
// vertical
- long nScaleSize = bPixelToLogic ?
+ tools::Long nScaleSize = bPixelToLogic ?
mpRefDevice->LogicToPixel(Size(0,rEngineHeight)).Height() : rEngineHeight;
// Don't scale if it fits already.
@@ -2254,12 +2254,12 @@ void ScOutputData::ShrinkEditEngine( EditEngine& rEngine, const tools::Rectangle
return;
bool bSwap = ( nOrient == SvxCellOrientation::TopBottom || nOrient == SvxCellOrientation::BottomUp );
- long nAvailable = rAlignRect.GetHeight() - nTopM - nBottomM;
- long nScale = ( nAvailable * 100 ) / nScaleSize;
+ tools::Long nAvailable = rAlignRect.GetHeight() - nTopM - nBottomM;
+ tools::Long nScale = ( nAvailable * 100 ) / nScaleSize;
lcl_ScaleFonts( rEngine, nScale );
rEngineHeight = lcl_GetEditSize( rEngine, false, bSwap, nAttrRotate );
- long nNewSize = bPixelToLogic ?
+ tools::Long nNewSize = bPixelToLogic ?
mpRefDevice->LogicToPixel(Size(0,rEngineHeight)).Height() : rEngineHeight;
sal_uInt16 nShrinkAgain = 0;
@@ -2275,7 +2275,7 @@ void ScOutputData::ShrinkEditEngine( EditEngine& rEngine, const tools::Rectangle
// sizes for further processing (alignment etc):
rEngineWidth = lcl_GetEditSize( rEngine, true, bSwap, nAttrRotate );
- long nPixelWidth = bPixelToLogic ?
+ tools::Long nPixelWidth = bPixelToLogic ?
mpRefDevice->LogicToPixel(Size(rEngineWidth,0)).Width() : rEngineWidth;
rNeededPixel = nPixelWidth + nLeftM + nRightM;
}
@@ -2283,17 +2283,17 @@ void ScOutputData::ShrinkEditEngine( EditEngine& rEngine, const tools::Rectangle
{
// horizontal
- long nAvailable = rAlignRect.GetWidth() - nLeftM - nRightM;
- long nScaleSize = rNeededPixel - nLeftM - nRightM; // without margin
+ tools::Long nAvailable = rAlignRect.GetWidth() - nLeftM - nRightM;
+ tools::Long nScaleSize = rNeededPixel - nLeftM - nRightM; // without margin
if ( nScaleSize <= nAvailable )
return;
- long nScale = ( nAvailable * 100 ) / nScaleSize;
+ tools::Long nScale = ( nAvailable * 100 ) / nScaleSize;
lcl_ScaleFonts( rEngine, nScale );
rEngineWidth = lcl_GetEditSize( rEngine, true, false, nAttrRotate );
- long nNewSize = bPixelToLogic ?
+ tools::Long nNewSize = bPixelToLogic ?
mpRefDevice->LogicToPixel(Size(rEngineWidth,0)).Width() : rEngineWidth;
sal_uInt16 nShrinkAgain = 0;
@@ -2450,7 +2450,7 @@ void ScOutputData::DrawEditParam::setPatternToEngine(bool bUseStyleColor)
mpEngine->SetBackgroundColor( aBackCol );
}
-void ScOutputData::DrawEditParam::calcMargins(long& rTopM, long& rLeftM, long& rBottomM, long& rRightM, double nPPTX, double nPPTY) const
+void ScOutputData::DrawEditParam::calcMargins(tools::Long& rTopM, tools::Long& rLeftM, tools::Long& rBottomM, tools::Long& rRightM, double nPPTX, double nPPTY) const
{
const SvxMarginItem& rMargin = mpPattern->GetItem(ATTR_MARGIN, mpCondSet);
@@ -2458,21 +2458,21 @@ void ScOutputData::DrawEditParam::calcMargins(long& rTopM, long& rLeftM, long& r
if (meHorJustAttr == SvxCellHorJustify::Left || meHorJustAttr == SvxCellHorJustify::Right)
nIndent = lcl_GetValue<ScIndentItem, sal_uInt16>(*mpPattern, ATTR_INDENT, mpCondSet);
- rLeftM = static_cast<long>(((rMargin.GetLeftMargin() + nIndent) * nPPTX));
- rTopM = static_cast<long>((rMargin.GetTopMargin() * nPPTY));
- rRightM = static_cast<long>((rMargin.GetRightMargin() * nPPTX));
- rBottomM = static_cast<long>((rMargin.GetBottomMargin() * nPPTY));
+ rLeftM = static_cast<tools::Long>(((rMargin.GetLeftMargin() + nIndent) * nPPTX));
+ rTopM = static_cast<tools::Long>((rMargin.GetTopMargin() * nPPTY));
+ rRightM = static_cast<tools::Long>((rMargin.GetRightMargin() * nPPTX));
+ rBottomM = static_cast<tools::Long>((rMargin.GetBottomMargin() * nPPTY));
if(meHorJustAttr == SvxCellHorJustify::Right)
{
- rLeftM = static_cast<long>((rMargin.GetLeftMargin() * nPPTX));
- rRightM = static_cast<long>(((rMargin.GetRightMargin() + nIndent) * nPPTX));
+ rLeftM = static_cast<tools::Long>((rMargin.GetLeftMargin() * nPPTX));
+ rRightM = static_cast<tools::Long>(((rMargin.GetRightMargin() + nIndent) * nPPTX));
}
}
void ScOutputData::DrawEditParam::calcPaperSize(
Size& rPaperSize, const tools::Rectangle& rAlignRect, double nPPTX, double nPPTY) const
{
- long nTopM, nLeftM, nBottomM, nRightM;
+ tools::Long nTopM, nLeftM, nBottomM, nRightM;
calcMargins(nTopM, nLeftM, nBottomM, nRightM, nPPTX, nPPTY);
if (isVerticallyOriented())
@@ -2496,17 +2496,17 @@ void ScOutputData::DrawEditParam::calcPaperSize(
}
}
-void ScOutputData::DrawEditParam::getEngineSize(ScFieldEditEngine* pEngine, long& rWidth, long& rHeight) const
+void ScOutputData::DrawEditParam::getEngineSize(ScFieldEditEngine* pEngine, tools::Long& rWidth, tools::Long& rHeight) const
{
- long nEngineWidth = 0;
+ tools::Long nEngineWidth = 0;
if (!mbBreak || meOrient == SvxCellOrientation::Stacked || mbAsianVertical)
- nEngineWidth = static_cast<long>(pEngine->CalcTextWidth());
+ nEngineWidth = static_cast<tools::Long>(pEngine->CalcTextWidth());
- long nEngineHeight = pEngine->GetTextHeight();
+ tools::Long nEngineHeight = pEngine->GetTextHeight();
if (isVerticallyOriented())
{
- long nTemp = nEngineWidth;
+ tools::Long nTemp = nEngineWidth;
nEngineWidth = nEngineHeight;
nEngineHeight = nTemp;
}
@@ -2537,7 +2537,7 @@ bool ScOutputData::DrawEditParam::isVerticallyOriented() const
}
void ScOutputData::DrawEditParam::calcStartPosForVertical(
- Point& rLogicStart, long nCellWidth, long nEngineWidth, long nTopM, const OutputDevice* pRefDevice)
+ Point& rLogicStart, tools::Long nCellWidth, tools::Long nEngineWidth, tools::Long nTopM, const OutputDevice* pRefDevice)
{
OSL_ENSURE(isVerticallyOriented(), "Use this only for vertically oriented cell!");
@@ -2697,8 +2697,8 @@ void ScOutputData::DrawEditParam::adjustForHyperlinkInPDF(Point aURLStart, const
if (!bHasURL)
return;
- long nURLWidth = static_cast<long>(mpEngine->CalcTextWidth());
- long nURLHeight = mpEngine->GetTextHeight();
+ tools::Long nURLWidth = static_cast<tools::Long>(mpEngine->CalcTextWidth());
+ tools::Long nURLHeight = mpEngine->GetTextHeight();
if (mbBreak)
{
Size aPaper = mpEngine->GetPaperSize();
@@ -2792,11 +2792,11 @@ private:
};
// Returns needed width in current units; sets rNeededPixel to needed width in pixels
-long ScOutputData::SetEngineTextAndGetWidth( DrawEditParam& rParam, const OUString& rSetString,
- long& rNeededPixel, long nAddWidthPixels )
+tools::Long ScOutputData::SetEngineTextAndGetWidth( DrawEditParam& rParam, const OUString& rSetString,
+ tools::Long& rNeededPixel, tools::Long nAddWidthPixels )
{
rParam.mpEngine->SetTextCurrentDefaults( rSetString );
- long nEngineWidth = static_cast<long>( rParam.mpEngine->CalcTextWidth() );
+ tools::Long nEngineWidth = static_cast<tools::Long>( rParam.mpEngine->CalcTextWidth() );
if ( rParam.mbPixelToLogic )
rNeededPixel = mpRefDevice->LogicToPixel( Size( nEngineWidth, 0 ) ).Width();
else
@@ -2816,7 +2816,7 @@ void ScOutputData::DrawEditStandard(DrawEditParam& rParam)
bool bRepeat = (rParam.meHorJustAttr == SvxCellHorJustify::Repeat && !rParam.mbBreak);
bool bShrink = !rParam.mbBreak && !bRepeat && lcl_GetBoolValue(*rParam.mpPattern, ATTR_SHRINKTOFIT, rParam.mpCondSet);
- long nAttrRotate = lcl_GetValue<ScRotateValueItem, long>(*rParam.mpPattern, ATTR_ROTATE_VALUE, rParam.mpCondSet);
+ tools::Long nAttrRotate = lcl_GetValue<ScRotateValueItem, long>(*rParam.mpPattern, ATTR_ROTATE_VALUE, rParam.mpCondSet);
if ( rParam.meHorJustAttr == SvxCellHorJustify::Repeat )
{
@@ -2843,7 +2843,7 @@ void ScOutputData::DrawEditStandard(DrawEditParam& rParam)
//! mirror margin values for RTL?
//! move margin down to after final GetOutputArea call
- long nTopM, nLeftM, nBottomM, nRightM;
+ tools::Long nTopM, nLeftM, nBottomM, nRightM;
rParam.calcMargins(nTopM, nLeftM, nBottomM, nRightM, mnPPTX, mnPPTY);
SCCOL nXForPos = rParam.mnX;
@@ -2919,10 +2919,10 @@ void ScOutputData::DrawEditStandard(DrawEditParam& rParam)
// Get final output area using the calculated width
- long nEngineWidth, nEngineHeight;
+ tools::Long nEngineWidth, nEngineHeight;
rParam.getEngineSize(rParam.mpEngine, nEngineWidth, nEngineHeight);
- long nNeededPixel = nEngineWidth;
+ tools::Long nNeededPixel = nEngineWidth;
if (rParam.mbPixelToLogic)
nNeededPixel = mpRefDevice->LogicToPixel(Size(nNeededPixel,0)).Width();
nNeededPixel += nLeftM + nRightM;
@@ -2947,24 +2947,24 @@ void ScOutputData::DrawEditStandard(DrawEditParam& rParam)
// First check if twice the space for the formatted text is available
// (otherwise just keep it unchanged).
- long nFormatted = nNeededPixel - nLeftM - nRightM; // without margin
- long nAvailable = aAreaParam.maAlignRect.GetWidth() - nLeftM - nRightM;
+ tools::Long nFormatted = nNeededPixel - nLeftM - nRightM; // without margin
+ tools::Long nAvailable = aAreaParam.maAlignRect.GetWidth() - nLeftM - nRightM;
if ( nAvailable >= 2 * nFormatted )
{
// "repeat" is handled with unformatted text (for performance reasons)
OUString aCellStr = rParam.mpEngine->GetText();
- long nRepeatSize = 0;
+ tools::Long nRepeatSize = 0;
SetEngineTextAndGetWidth( rParam, aCellStr, nRepeatSize, 0 );
if ( pFmtDevice != mpRefDevice )
++nRepeatSize;
if ( nRepeatSize > 0 )
{
- long nRepeatCount = nAvailable / nRepeatSize;
+ tools::Long nRepeatCount = nAvailable / nRepeatSize;
if ( nRepeatCount > 1 )
{
OUStringBuffer aRepeated = aCellStr;
- for ( long nRepeat = 1; nRepeat < nRepeatCount; nRepeat++ )
+ for ( tools::Long nRepeat = 1; nRepeat < nRepeatCount; nRepeat++ )
aRepeated.append(aCellStr);
SetEngineTextAndGetWidth( rParam, aRepeated.makeStringAndClear(),
@@ -2994,11 +2994,11 @@ void ScOutputData::DrawEditStandard(DrawEditParam& rParam)
}
}
- long nStartX = aAreaParam.maAlignRect.Left();
- long nStartY = aAreaParam.maAlignRect.Top();
- long nCellWidth = aAreaParam.maAlignRect.GetWidth();
- long nOutWidth = nCellWidth - 1 - nLeftM - nRightM;
- long nOutHeight = aAreaParam.maAlignRect.GetHeight() - nTopM - nBottomM;
+ tools::Long nStartX = aAreaParam.maAlignRect.Left();
+ tools::Long nStartY = aAreaParam.maAlignRect.Top();
+ tools::Long nCellWidth = aAreaParam.maAlignRect.GetWidth();
+ tools::Long nOutWidth = nCellWidth - 1 - nLeftM - nRightM;
+ tools::Long nOutHeight = aAreaParam.maAlignRect.GetHeight() - nTopM - nBottomM;
if (rParam.mbBreak)
{
@@ -3071,7 +3071,7 @@ void ScOutputData::DrawEditStandard(DrawEditParam& rParam)
pClipMarkCell->nClipMark |= ScClipMark::Right; //! also allow left?
bAnyClipped = true;
- long nMarkPixel = static_cast<long>( SC_CLIPMARK_SIZE * mnPPTX );
+ tools::Long nMarkPixel = static_cast<tools::Long>( SC_CLIPMARK_SIZE * mnPPTX );
if ( aAreaParam.maClipRect.Right() - nMarkPixel > aAreaParam.maClipRect.Left() )
aAreaParam.maClipRect.AdjustRight( -nMarkPixel );
}
@@ -3150,7 +3150,7 @@ void ScOutputData::DrawEditStandard(DrawEditParam& rParam)
rParam.adjustForHyperlinkInPDF(aURLStart, mpDev);
}
-void ScOutputData::ShowClipMarks( DrawEditParam& rParam, long nEngineHeight, const Size& aCellSize,
+void ScOutputData::ShowClipMarks( DrawEditParam& rParam, tools::Long nEngineHeight, const Size& aCellSize,
bool bMerged, OutputAreaParam& aAreaParam)
{
// Show clip marks if height is at least 5pt too small and
@@ -3177,13 +3177,13 @@ void ScOutputData::ShowClipMarks( DrawEditParam& rParam, long nEngineHeight, con
pClipMarkCell->nClipMark |= ScClipMark::Right; //! also allow left?
bAnyClipped = true;
- const long nMarkPixel = static_cast<long>( SC_CLIPMARK_SIZE * mnPPTX );
+ const tools::Long nMarkPixel = static_cast<tools::Long>( SC_CLIPMARK_SIZE * mnPPTX );
if ( aAreaParam.maClipRect.Right() - nMarkPixel > aAreaParam.maClipRect.Left() )
aAreaParam.maClipRect.AdjustRight( -nMarkPixel );
}
ClearableClipRegionPtr ScOutputData::Clip( DrawEditParam& rParam, const Size& aCellSize,
- OutputAreaParam& aAreaParam, long nEngineHeight,
+ OutputAreaParam& aAreaParam, tools::Long nEngineHeight,
bool bWrapFields)
{
// Also take fields in a cell with automatic breaks into account: clip to cell width
@@ -3227,7 +3227,7 @@ void ScOutputData::DrawEditBottomTop(DrawEditParam& rParam)
//! mirror margin values for RTL?
//! move margin down to after final GetOutputArea call
- long nTopM, nLeftM, nBottomM, nRightM;
+ tools::Long nTopM, nLeftM, nBottomM, nRightM;
rParam.calcMargins(nTopM, nLeftM, nBottomM, nRightM, mnPPTX, mnPPTY);
SCCOL nXForPos = rParam.mnX;
@@ -3289,10 +3289,10 @@ void ScOutputData::DrawEditBottomTop(DrawEditParam& rParam)
// Get final output area using the calculated width
- long nEngineWidth, nEngineHeight;
+ tools::Long nEngineWidth, nEngineHeight;
rParam.getEngineSize(rParam.mpEngine, nEngineWidth, nEngineHeight);
- long nNeededPixel = nEngineWidth;
+ tools::Long nNeededPixel = nEngineWidth;
if (rParam.mbPixelToLogic)
nNeededPixel = mpRefDevice->LogicToPixel(Size(nNeededPixel,0)).Width();
nNeededPixel += nLeftM + nRightM;
@@ -3317,24 +3317,24 @@ void ScOutputData::DrawEditBottomTop(DrawEditParam& rParam)
// First check if twice the space for the formatted text is available
// (otherwise just keep it unchanged).
- const long nFormatted = nNeededPixel - nLeftM - nRightM; // without margin
- const long nAvailable = aAreaParam.maAlignRect.GetWidth() - nLeftM - nRightM;
+ const tools::Long nFormatted = nNeededPixel - nLeftM - nRightM; // without margin
+ const tools::Long nAvailable = aAreaParam.maAlignRect.GetWidth() - nLeftM - nRightM;
if ( nAvailable >= 2 * nFormatted )
{
// "repeat" is handled with unformatted text (for performance reasons)
OUString aCellStr = rParam.mpEngine->GetText();
- long nRepeatSize = 0;
+ tools::Long nRepeatSize = 0;
SetEngineTextAndGetWidth( rParam, aCellStr, nRepeatSize, 0 );
if ( pFmtDevice != mpRefDevice )
++nRepeatSize;
if ( nRepeatSize > 0 )
{
- const long nRepeatCount = nAvailable / nRepeatSize;
+ const tools::Long nRepeatCount = nAvailable / nRepeatSize;
if ( nRepeatCount > 1 )
{
OUStringBuffer aRepeated = aCellStr;
- for ( long nRepeat = 1; nRepeat < nRepeatCount; nRepeat++ )
+ for ( tools::Long nRepeat = 1; nRepeat < nRepeatCount; nRepeat++ )
aRepeated.append(aCellStr);
nEngineWidth = SetEngineTextAndGetWidth( rParam, aRepeated.makeStringAndClear(),
@@ -3353,11 +3353,11 @@ void ScOutputData::DrawEditBottomTop(DrawEditParam& rParam)
}
}
- long nStartX = aAreaParam.maAlignRect.Left();
- const long nStartY = aAreaParam.maAlignRect.Top();
- const long nCellWidth = aAreaParam.maAlignRect.GetWidth();
- const long nOutWidth = nCellWidth - 1 - nLeftM - nRightM;
- const long nOutHeight = aAreaParam.maAlignRect.GetHeight() - nTopM - nBottomM;
+ tools::Long nStartX = aAreaParam.maAlignRect.Left();
+ const tools::Long nStartY = aAreaParam.maAlignRect.Top();
+ const tools::Long nCellWidth = aAreaParam.maAlignRect.GetWidth();
+ const tools::Long nOutWidth = nCellWidth - 1 - nLeftM - nRightM;
+ const tools::Long nOutHeight = aAreaParam.maAlignRect.GetHeight() - nTopM - nBottomM;
if (rParam.mbBreak)
{
@@ -3415,8 +3415,8 @@ void ScOutputData::DrawEditBottomTop(DrawEditParam& rParam)
aPSize.setWidth( rParam.mpEngine->CalcTextWidth() );
rParam.mpEngine->SetPaperSize(aPSize);
- long nGap = 0;
- long nTopOffset = 0;
+ tools::Long nGap = 0;
+ tools::Long nTopOffset = 0;
if (rParam.mbPixelToLogic)
{
nGap = mpRefDevice->LogicToPixel(aCellSize).Height() - mpRefDevice->LogicToPixel(aPSize).Width();
@@ -3470,7 +3470,7 @@ void ScOutputData::DrawEditTopBottom(DrawEditParam& rParam)
//! mirror margin values for RTL?
//! move margin down to after final GetOutputArea call
- long nTopM, nLeftM, nBottomM, nRightM;
+ tools::Long nTopM, nLeftM, nBottomM, nRightM;
rParam.calcMargins(nTopM, nLeftM, nBottomM, nRightM, mnPPTX, mnPPTY);
SCCOL nXForPos = rParam.mnX;
@@ -3532,10 +3532,10 @@ void ScOutputData::DrawEditTopBottom(DrawEditParam& rParam)
// Get final output area using the calculated width
- long nEngineWidth, nEngineHeight;
+ tools::Long nEngineWidth, nEngineHeight;
rParam.getEngineSize(rParam.mpEngine, nEngineWidth, nEngineHeight);
- long nNeededPixel = nEngineWidth;
+ tools::Long nNeededPixel = nEngineWidth;
if (rParam.mbPixelToLogic)
nNeededPixel = mpRefDevice->LogicToPixel(Size(nNeededPixel,0)).Width();
nNeededPixel += nLeftM + nRightM;
@@ -3560,25 +3560,25 @@ void ScOutputData::DrawEditTopBottom(DrawEditParam& rParam)
// First check if twice the space for the formatted text is available
// (otherwise just keep it unchanged).
- const long nFormatted = nNeededPixel - nLeftM - nRightM; // without margin
- const long nAvailable = aAreaParam.maAlignRect.GetWidth() - nLeftM - nRightM;
+ const tools::Long nFormatted = nNeededPixel - nLeftM - nRightM; // without margin
+ const tools::Long nAvailable = aAreaParam.maAlignRect.GetWidth() - nLeftM - nRightM;
if ( nAvailable >= 2 * nFormatted )
{
// "repeat" is handled with unformatted text (for performance reasons)
OUString aCellStr = rParam.mpEngine->GetText();
- long nRepeatSize = 0;
+ tools::Long nRepeatSize = 0;
SetEngineTextAndGetWidth( rParam, aCellStr, nRepeatSize, 0 );
if ( pFmtDevice != mpRefDevice )
++nRepeatSize;
if ( nRepeatSize > 0 )
{
- const long nRepeatCount = nAvailable / nRepeatSize;
+ const tools::Long nRepeatCount = nAvailable / nRepeatSize;
if ( nRepeatCount > 1 )
{
OUStringBuffer aRepeated = aCellStr;
- for ( long nRepeat = 1; nRepeat < nRepeatCount; nRepeat++ )
+ for ( tools::Long nRepeat = 1; nRepeat < nRepeatCount; nRepeat++ )
aRepeated.append(aCellStr);
nEngineWidth = SetEngineTextAndGetWidth( rParam, aRepeated.makeStringAndClear(),
@@ -3597,11 +3597,11 @@ void ScOutputData::DrawEditTopBottom(DrawEditParam& rParam)
}
}
- long nStartX = aAreaParam.maAlignRect.Left();
- const long nStartY = aAreaParam.maAlignRect.Top();
- const long nCellWidth = aAreaParam.maAlignRect.GetWidth();
- const long nOutWidth = nCellWidth - 1 - nLeftM - nRightM;
- const long nOutHeight = aAreaParam.maAlignRect.GetHeight() - nTopM - nBottomM;
+ tools::Long nStartX = aAreaParam.maAlignRect.Left();
+ const tools::Long nStartY = aAreaParam.maAlignRect.Top();
+ const tools::Long nCellWidth = aAreaParam.maAlignRect.GetWidth();
+ const tools::Long nOutWidth = nCellWidth - 1 - nLeftM - nRightM;
+ const tools::Long nOutHeight = aAreaParam.maAlignRect.GetHeight() - nTopM - nBottomM;
if (rParam.mbBreak)
{
@@ -3652,8 +3652,8 @@ void ScOutputData::DrawEditTopBottom(DrawEditParam& rParam)
aPSize.setWidth( rParam.mpEngine->CalcTextWidth() );
rParam.mpEngine->SetPaperSize(aPSize);
- long nGap = 0;
- long nTopOffset = 0; // offset by top margin
+ tools::Long nGap = 0;
+ tools::Long nTopOffset = 0; // offset by top margin
if (rParam.mbPixelToLogic)
{
nGap = mpRefDevice->LogicToPixel(aPSize).Width() - mpRefDevice->LogicToPixel(aCellSize).Height();
@@ -3719,7 +3719,7 @@ void ScOutputData::DrawEditStacked(DrawEditParam& rParam)
//! mirror margin values for RTL?
//! move margin down to after final GetOutputArea call
- long nTopM, nLeftM, nBottomM, nRightM;
+ tools::Long nTopM, nLeftM, nBottomM, nRightM;
rParam.calcMargins(nTopM, nLeftM, nBottomM, nRightM, mnPPTX, mnPPTY);
SCCOL nXForPos = rParam.mnX;
@@ -3789,10 +3789,10 @@ void ScOutputData::DrawEditStacked(DrawEditParam& rParam)
// Get final output area using the calculated width
- long nEngineWidth, nEngineHeight;
+ tools::Long nEngineWidth, nEngineHeight;
rParam.getEngineSize(rParam.mpEngine, nEngineWidth, nEngineHeight);
- long nNeededPixel = nEngineWidth;
+ tools::Long nNeededPixel = nEngineWidth;
if (rParam.mbPixelToLogic)
nNeededPixel = mpRefDevice->LogicToPixel(Size(nNeededPixel,0)).Width();
nNeededPixel += nLeftM + nRightM;
@@ -3827,11 +3827,11 @@ void ScOutputData::DrawEditStacked(DrawEditParam& rParam)
}
}
- long nStartX = aAreaParam.maAlignRect.Left();
- long nStartY = aAreaParam.maAlignRect.Top();
- long nCellWidth = aAreaParam.maAlignRect.GetWidth();
- long nOutWidth = nCellWidth - 1 - nLeftM - nRightM;
- long nOutHeight = aAreaParam.maAlignRect.GetHeight() - nTopM - nBottomM;
+ tools::Long nStartX = aAreaParam.maAlignRect.Left();
+ tools::Long nStartY = aAreaParam.maAlignRect.Top();
+ tools::Long nCellWidth = aAreaParam.maAlignRect.GetWidth();
+ tools::Long nOutWidth = nCellWidth - 1 - nLeftM - nRightM;
+ tools::Long nOutHeight = aAreaParam.maAlignRect.GetHeight() - nTopM - nBottomM;
if (rParam.mbBreak)
{
@@ -3904,7 +3904,7 @@ void ScOutputData::DrawEditStacked(DrawEditParam& rParam)
pClipMarkCell->nClipMark |= ScClipMark::Right; //! also allow left?
bAnyClipped = true;
- long nMarkPixel = static_cast<long>( SC_CLIPMARK_SIZE * mnPPTX );
+ tools::Long nMarkPixel = static_cast<tools::Long>( SC_CLIPMARK_SIZE * mnPPTX );
if ( aAreaParam.maClipRect.Right() - nMarkPixel > aAreaParam.maClipRect.Left() )
aAreaParam.maClipRect.AdjustRight( -nMarkPixel );
}
@@ -3991,7 +3991,7 @@ void ScOutputData::DrawEditAsianVertical(DrawEditParam& rParam)
bool bHidden = false;
bool bShrink = !rParam.mbBreak && lcl_GetBoolValue(*rParam.mpPattern, ATTR_SHRINKTOFIT, rParam.mpCondSet);
- long nAttrRotate = lcl_GetValue<ScRotateValueItem, long>(*rParam.mpPattern, ATTR_ROTATE_VALUE, rParam.mpCondSet);
+ tools::Long nAttrRotate = lcl_GetValue<ScRotateValueItem, long>(*rParam.mpPattern, ATTR_ROTATE_VALUE, rParam.mpCondSet);
if (nAttrRotate)
{
@@ -4014,7 +4014,7 @@ void ScOutputData::DrawEditAsianVertical(DrawEditParam& rParam)
//! mirror margin values for RTL?
//! move margin down to after final GetOutputArea call
- long nTopM, nLeftM, nBottomM, nRightM;
+ tools::Long nTopM, nLeftM, nBottomM, nRightM;
rParam.calcMargins(nTopM, nLeftM, nBottomM, nRightM, mnPPTX, mnPPTY);
SCCOL nXForPos = rParam.mnX;
@@ -4088,10 +4088,10 @@ void ScOutputData::DrawEditAsianVertical(DrawEditParam& rParam)
// Get final output area using the calculated width
- long nEngineWidth, nEngineHeight;
+ tools::Long nEngineWidth, nEngineHeight;
rParam.getEngineSize(rParam.mpEngine, nEngineWidth, nEngineHeight);
- long nNeededPixel = nEngineWidth;
+ tools::Long nNeededPixel = nEngineWidth;
if (rParam.mbPixelToLogic)
nNeededPixel = mpRefDevice->LogicToPixel(Size(nNeededPixel,0)).Width();
nNeededPixel += nLeftM + nRightM;
@@ -4125,11 +4125,11 @@ void ScOutputData::DrawEditAsianVertical(DrawEditParam& rParam)
rParam.mpEngine->SetPaperSize(aPaperSize);
}
- long nStartX = aAreaParam.maAlignRect.Left();
- long nStartY = aAreaParam.maAlignRect.Top();
- long nCellWidth = aAreaParam.maAlignRect.GetWidth();
- long nOutWidth = nCellWidth - 1 - nLeftM - nRightM;
- long nOutHeight = aAreaParam.maAlignRect.GetHeight() - nTopM - nBottomM;
+ tools::Long nStartX = aAreaParam.maAlignRect.Left();
+ tools::Long nStartY = aAreaParam.maAlignRect.Top();
+ tools::Long nCellWidth = aAreaParam.maAlignRect.GetWidth();
+ tools::Long nOutWidth = nCellWidth - 1 - nLeftM - nRightM;
+ tools::Long nOutHeight = aAreaParam.maAlignRect.GetHeight() - nTopM - nBottomM;
// text with automatic breaks is aligned only within the
// edit engine's paper size, the output of the whole area
@@ -4191,7 +4191,7 @@ void ScOutputData::DrawEditAsianVertical(DrawEditParam& rParam)
pClipMarkCell->nClipMark |= ScClipMark::Right; //! also allow left?
bAnyClipped = true;
- long nMarkPixel = static_cast<long>( SC_CLIPMARK_SIZE * mnPPTX );
+ tools::Long nMarkPixel = static_cast<tools::Long>( SC_CLIPMARK_SIZE * mnPPTX );
if ( aAreaParam.maClipRect.Right() - nMarkPixel > aAreaParam.maClipRect.Left() )
aAreaParam.maClipRect.AdjustRight( -nMarkPixel );
}
@@ -4209,7 +4209,7 @@ void ScOutputData::DrawEditAsianVertical(DrawEditParam& rParam)
else
aLogicStart = Point(nStartX, nStartY);
- long nAvailWidth = aCellSize.Width();
+ tools::Long nAvailWidth = aCellSize.Width();
// space for AutoFilter is already handled in GetOutputArea
// horizontal alignment
@@ -4252,12 +4252,12 @@ void ScOutputData::DrawEdit(bool bPixelToLogic)
const SfxItemSet* pOldPreviewFontSet = nullptr;
ScRefCellValue aCell;
- long nInitPosX = nScrX;
+ tools::Long nInitPosX = nScrX;
if ( bLayoutRTL )
{
nInitPosX += nMirrorW - 1;
}
- long nLayoutSign = bLayoutRTL ? -1 : 1;
+ tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
//! store nLastContentCol as member!
SCCOL nLastContentCol = mpDoc->MaxCol();
@@ -4265,7 +4265,7 @@ void ScOutputData::DrawEdit(bool bPixelToLogic)
nLastContentCol = sal::static_int_cast<SCCOL>(
nLastContentCol - mpDoc->GetEmptyLinesInBlock( nX2+1, nY1, nTab, mpDoc->MaxCol(), nY2, nTab, DIR_RIGHT ) );
- long nRowPosY = nScrY;
+ tools::Long nRowPosY = nScrY;
for (SCSIZE nArrY=0; nArrY+1<nArrCount; nArrY++) // 0 of the rest of the merged
{
RowInfo* pThisRowInfo = &pRowInfo[nArrY];
@@ -4274,7 +4274,7 @@ void ScOutputData::DrawEdit(bool bPixelToLogic)
if ( pThisRowInfo->bChanged || nArrY==0 )
{
- long nPosX = 0;
+ tools::Long nPosX = 0;
for (SCCOL nX=0; nX<=nX2; nX++) // due to overflow
{
std::unique_ptr< ScPatternAttr > pPreviewPattr;
@@ -4289,7 +4289,7 @@ void ScOutputData::DrawEdit(bool bPixelToLogic)
SCROW nCellY = nY;
bool bDoCell = false;
- long nPosY = nRowPosY;
+ tools::Long nPosY = nRowPosY;
if ( nArrY == 0 )
{
nPosY = nScrY;
@@ -4456,23 +4456,23 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
const SfxItemSet* pOldCondSet = nullptr;
ScRefCellValue aCell;
- long nInitPosX = nScrX;
+ tools::Long nInitPosX = nScrX;
if ( bLayoutRTL )
{
nInitPosX += nMirrorW - 1;
}
- long nLayoutSign = bLayoutRTL ? -1 : 1;
+ tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
- long nRowPosY = nScrY;
+ tools::Long nRowPosY = nScrY;
for (SCSIZE nArrY=0; nArrY+1<nArrCount; nArrY++) // 0 for the rest of the merged
{
RowInfo* pThisRowInfo = &pRowInfo[nArrY];
- long nCellHeight = static_cast<long>(pThisRowInfo->nHeight);
+ tools::Long nCellHeight = static_cast<tools::Long>(pThisRowInfo->nHeight);
if (nArrY==1) nRowPosY = nScrY; // positions before are calculated individually
if ( ( pThisRowInfo->bChanged || nArrY==0 ) && pThisRowInfo->nRotMaxCol != SC_ROTMAX_NONE )
{
- long nPosX = 0;
+ tools::Long nPosX = 0;
for (SCCOL nX=0; nX<=nRotMax; nX++)
{
if (nX==nX1) nPosX = nInitPosX; // positions before nX1 are calculated individually
@@ -4494,7 +4494,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
else
lcl_ClearEdit( *pEngine ); // also calls SetUpdateMode(sal_False)
- long nPosY = nRowPosY;
+ tools::Long nPosY = nRowPosY;
//! rest from merged cells further up do not work!
@@ -4516,7 +4516,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
if (aCell.isEmpty() || IsEmptyCellText(pThisRowInfo, nX, nY))
bHidden = true; // nRotateDir is also set without a cell
- long nCellWidth = static_cast<long>(pRowInfo[0].pCellInfo[nX+1].nWidth);
+ tools::Long nCellWidth = static_cast<tools::Long>(pRowInfo[0].pCellInfo[nX+1].nWidth);
SvxCellHorJustify eHorJust =
pPattern->GetItem(ATTR_HOR_JUSTIFY, pCondSet).GetValue();
@@ -4530,8 +4530,8 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
const ScMergeAttr* pMerge = &pPattern->GetItem(ATTR_MERGE);
bool bMerged = pMerge->GetColMerge() > 1 || pMerge->GetRowMerge() > 1;
- long nStartX = nPosX;
- long nStartY = nPosY;
+ tools::Long nStartX = nPosX;
+ tools::Long nStartY = nPosY;
if (nX<nX1)
{
if ((bBreak || eOrient!=SvxCellOrientation::Standard) && !bMerged)
@@ -4543,26 +4543,26 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
while (nCol > nX)
{
--nCol;
- nStartX -= nLayoutSign * static_cast<long>(pRowInfo[0].pCellInfo[nCol+1].nWidth);
+ nStartX -= nLayoutSign * static_cast<tools::Long>(pRowInfo[0].pCellInfo[nCol+1].nWidth);
}
}
}
- long nCellStartX = nStartX;
+ tools::Long nCellStartX = nStartX;
// omit substitute representation of small text
if (!bHidden)
{
- long nOutWidth = nCellWidth - 1;
- long nOutHeight = nCellHeight;
+ tools::Long nOutWidth = nCellWidth - 1;
+ tools::Long nOutHeight = nCellHeight;
if ( bMerged )
{
SCCOL nCountX = pMerge->GetColMerge();
for (SCCOL i=1; i<nCountX; i++)
- nOutWidth += static_cast<long>( mpDoc->GetColWidth(nX+i,nTab) * mnPPTX );
+ nOutWidth += static_cast<tools::Long>( mpDoc->GetColWidth(nX+i,nTab) * mnPPTX );
SCROW nCountY = pMerge->GetRowMerge();
- nOutHeight += static_cast<long>(mpDoc->GetScaledRowHeight( nY+1, nY+nCountY-1, nTab, mnPPTY));
+ nOutHeight += static_cast<tools::Long>(mpDoc->GetScaledRowHeight( nY+1, nY+nCountY-1, nTab, mnPPTY));
}
SvxCellVerJustify eVerJust =
@@ -4620,21 +4620,21 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
if ( eHorJust == SvxCellHorJustify::Left )
nIndent = pPattern->GetItem(ATTR_INDENT, pCondSet).GetValue();
- long nTotalHeight = nOutHeight; // without subtracting the margin
+ tools::Long nTotalHeight = nOutHeight; // without subtracting the margin
if ( bPixelToLogic )
nTotalHeight = mpRefDevice->PixelToLogic(Size(0,nTotalHeight)).Height();
- long nLeftM = static_cast<long>( (pMargin->GetLeftMargin() + nIndent) * mnPPTX );
- long nTopM = static_cast<long>( pMargin->GetTopMargin() * mnPPTY );
- long nRightM = static_cast<long>( pMargin->GetRightMargin() * mnPPTX );
- long nBottomM = static_cast<long>( pMargin->GetBottomMargin() * mnPPTY );
+ tools::Long nLeftM = static_cast<tools::Long>( (pMargin->GetLeftMargin() + nIndent) * mnPPTX );
+ tools::Long nTopM = static_cast<tools::Long>( pMargin->GetTopMargin() * mnPPTY );
+ tools::Long nRightM = static_cast<tools::Long>( pMargin->GetRightMargin() * mnPPTX );
+ tools::Long nBottomM = static_cast<tools::Long>( pMargin->GetBottomMargin() * mnPPTY );
nStartX += nLeftM;
nStartY += nTopM;
nOutWidth -= nLeftM + nRightM;
nOutHeight -= nTopM + nBottomM;
// rotate here already, to adjust paper size for page breaks
- long nAttrRotate = 0;
+ tools::Long nAttrRotate = 0;
double nSin = 0.0;
double nCos = 1.0;
SvxRotateMode eRotMode = SVX_ROTATE_MODE_STANDARD;
@@ -4669,7 +4669,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
//! of rows, as long as the rows can not be outputted individually
//! offsetted -> therefore unlimited, so no wrapping.
//! With offset rows the following would be correct:
- aPaperSize.setWidth( static_cast<long>(nOutHeight / fabs(nSin)) );
+ aPaperSize.setWidth( static_cast<tools::Long>(nOutHeight / fabs(nSin)) );
}
else if (eOrient == SvxCellOrientation::Standard)
aPaperSize.setWidth( nOutWidth );
@@ -4719,8 +4719,8 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
pEngine->SetUpdateMode( true ); // after SetText, before CalcTextWidth/GetTextHeight
- long nEngineWidth = static_cast<long>(pEngine->CalcTextWidth());
- long nEngineHeight = pEngine->GetTextHeight();
+ tools::Long nEngineWidth = static_cast<tools::Long>(pEngine->CalcTextWidth());
+ tools::Long nEngineHeight = pEngine->GetTextHeight();
if (nAttrRotate && bBreak)
{
@@ -4732,10 +4732,10 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
while (nSteps > 0)
{
// everything is in pixels
- long nEnginePixel = mpRefDevice->LogicToPixel(
+ tools::Long nEnginePixel = mpRefDevice->LogicToPixel(
Size(0,nEngineHeight)).Height();
- long nEffHeight = nOutHeight - static_cast<long>(nEnginePixel * nAbsCos) + 2;
- long nNewWidth = static_cast<long>(nEffHeight / nAbsSin) + 2;
+ tools::Long nEffHeight = nOutHeight - static_cast<tools::Long>(nEnginePixel * nAbsCos) + 2;
+ tools::Long nNewWidth = static_cast<tools::Long>(nEffHeight / nAbsSin) + 2;
bool bFits = ( nNewWidth >= aPaperSize.Width() );
if ( bFits )
nSteps = 0;
@@ -4745,7 +4745,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
{
// can't fit -> fall back to using half height
nEffHeight = nOutHeight / 2;
- nNewWidth = static_cast<long>(nEffHeight / nAbsSin) + 2;
+ nNewWidth = static_cast<tools::Long>(nEffHeight / nAbsSin) + 2;
nSteps = 0;
}
else
@@ -4759,14 +4759,14 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
pEngine->SetPaperSize(aPaperSize); // Scale is always 1
//pEngine->QuickFormatDoc( sal_True );
- nEngineWidth = static_cast<long>(pEngine->CalcTextWidth());
+ nEngineWidth = static_cast<tools::Long>(pEngine->CalcTextWidth());
nEngineHeight = pEngine->GetTextHeight();
}
}
}
- long nRealWidth = nEngineWidth;
- long nRealHeight = nEngineHeight;
+ tools::Long nRealWidth = nEngineWidth;
+ tools::Long nRealHeight = nEngineHeight;
// when rotated, adjust size
if (nAttrRotate)
@@ -4775,13 +4775,13 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
double nAbsSin = fabs( nSin );
if ( eRotMode == SVX_ROTATE_MODE_STANDARD )
- nEngineWidth = static_cast<long>( nRealWidth * nAbsCos +
+ nEngineWidth = static_cast<tools::Long>( nRealWidth * nAbsCos +
nRealHeight * nAbsSin );
else
- nEngineWidth = static_cast<long>( nRealHeight / nAbsSin );
+ nEngineWidth = static_cast<tools::Long>( nRealHeight / nAbsSin );
//! limit !!!
- nEngineHeight = static_cast<long>( nRealHeight * nAbsCos +
+ nEngineHeight = static_cast<tools::Long>( nRealHeight * nAbsCos +
nRealWidth * nAbsSin );
}
@@ -4802,12 +4802,12 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
else
aCellSize = Size( nOutWidth, nOutHeight ); // scale is one
- long nGridWidth = nEngineWidth;
+ tools::Long nGridWidth = nEngineWidth;
bool bNegative = false;
if ( eRotMode != SVX_ROTATE_MODE_STANDARD )
{
nGridWidth = aCellSize.Width() +
- std::abs(static_cast<long>( aCellSize.Height() * nCos / nSin ));
+ std::abs(static_cast<tools::Long>( aCellSize.Height() * nCos / nSin ));
bNegative = ( pInfo->nRotateDir == ScRotateDir::Left );
if ( bLayoutRTL )
bNegative = !bNegative;
@@ -4822,7 +4822,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
SvxCellHorJustify eOutHorJust = eHorJust;
if ( eRotMode != SVX_ROTATE_MODE_STANDARD )
eOutHorJust = bNegative ? SvxCellHorJustify::Right : SvxCellHorJustify::Left;
- long nNeededWidth = nGridWidth; // in pixel for GetOutputArea
+ tools::Long nNeededWidth = nGridWidth; // in pixel for GetOutputArea
if ( bPixelToLogic )
nNeededWidth = mpRefDevice->LogicToPixel(Size(nNeededWidth,0)).Width();
@@ -4832,9 +4832,9 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
if ( bShrink )
{
- long nPixelWidth = bPixelToLogic ?
+ tools::Long nPixelWidth = bPixelToLogic ?
mpRefDevice->LogicToPixel(Size(nEngineWidth,0)).Width() : nEngineWidth;
- long nNeededPixel = nPixelWidth + nLeftM + nRightM;
+ tools::Long nNeededPixel = nPixelWidth + nLeftM + nRightM;
aAreaParam.mbLeftClip = aAreaParam.mbRightClip = true;
@@ -4853,30 +4853,30 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
// nEngineWidth/nEngineHeight is updated in ShrinkEditEngine
// (but width is only valid for standard mode)
- nRealWidth = static_cast<long>(pEngine->CalcTextWidth());
+ nRealWidth = static_cast<tools::Long>(pEngine->CalcTextWidth());
nRealHeight = pEngine->GetTextHeight();
if ( eRotMode != SVX_ROTATE_MODE_STANDARD )
- nEngineWidth = static_cast<long>( nRealHeight / fabs( nSin ) );
+ nEngineWidth = static_cast<tools::Long>( nRealHeight / fabs( nSin ) );
}
- long nClipStartX = nStartX;
+ tools::Long nClipStartX = nStartX;
if (nX<nX1)
{
//! clipping is not needed when on the left side of the window
if (nStartX<nScrX)
{
- long nDif = nScrX - nStartX;
+ tools::Long nDif = nScrX - nStartX;
nClipStartX = nScrX;
aClipSize.AdjustWidth( -nDif );
}
}
- long nClipStartY = nStartY;
+ tools::Long nClipStartY = nStartY;
if (nArrY==0 && nClipStartY < nRowPosY )
{
- long nDif = nRowPosY - nClipStartY;
+ tools::Long nDif = nRowPosY - nClipStartY;
nClipStartY = nRowPosY;
aClipSize.AdjustHeight( -nDif );
}
@@ -4910,7 +4910,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
aLogicStart = Point(nStartX, nStartY);
if ( eOrient!=SvxCellOrientation::Standard || !bBreak )
{
- long nAvailWidth = aCellSize.Width();
+ tools::Long nAvailWidth = aCellSize.Width();
if (eType==OUTTYPE_WINDOW &&
eOrient!=SvxCellOrientation::Stacked &&
pInfo->bAutoFilter)
@@ -4920,7 +4920,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
nAvailWidth -= mpRefDevice->PixelToLogic(Size(0,DROPDOWN_BITMAP_SIZE)).Height();
else
nAvailWidth -= DROPDOWN_BITMAP_SIZE;
- long nComp = nEngineWidth;
+ tools::Long nComp = nEngineWidth;
if (nAvailWidth<nComp) nAvailWidth=nComp;
}
@@ -4999,7 +4999,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
OSL_ENSURE( eOrient == SvxCellOrientation::Standard && nAttrRotate,
"DrawRotated: no rotation" );
- long nOriVal = 0;
+ tools::Long nOriVal = 0;
if ( nAttrRotate )
{
// attribute is 1/100, Font 1/10 Grad
@@ -5032,7 +5032,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
( eRotMode == SVX_ROTATE_MODE_BOTTOM && nSin < 0.0 ) )
nAddX -= nSkew;
- long nUp = 0;
+ tools::Long nUp = 0;
if ( eVerJust == SvxCellVerJustify::Center )
nUp = ( aCellSize.Height() - nEngineHeight ) / 2;
else if ( eVerJust == SvxCellVerJustify::Top )
@@ -5049,8 +5049,8 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
nAddX += ( nUp * nCos / fabs(nSin) );
}
- aLogicStart.AdjustX(static_cast<long>(nAddX) );
- aLogicStart.AdjustY(static_cast<long>(nAddY) );
+ aLogicStart.AdjustX(static_cast<tools::Long>(nAddX) );
+ aLogicStart.AdjustY(static_cast<tools::Long>(nAddY) );
}
// bSimClip is not used here (because nOriVal is set)
diff --git a/sc/source/ui/view/output3.cxx b/sc/source/ui/view/output3.cxx
index 4601d02cb0d2..c4e225a64475 100644
--- a/sc/source/ui/view/output3.cxx
+++ b/sc/source/ui/view/output3.cxx
@@ -31,18 +31,18 @@
#include <svx/fmview.hxx>
// #i72502#
-Point ScOutputData::PrePrintDrawingLayer(long nLogStX, long nLogStY )
+Point ScOutputData::PrePrintDrawingLayer(tools::Long nLogStX, tools::Long nLogStY )
{
tools::Rectangle aRect;
SCCOL nCol;
Point aOffset;
- long nLayoutSign(bLayoutRTL ? -1 : 1);
+ tools::Long nLayoutSign(bLayoutRTL ? -1 : 1);
for (nCol=0; nCol<nX1; nCol++)
aOffset.AdjustX( -(mpDoc->GetColWidth( nCol, nTab ) * nLayoutSign) );
aOffset.AdjustY( -sal_Int32(mpDoc->GetRowHeight( 0, nY1-1, nTab )) );
- long nDataWidth = 0;
+ tools::Long nDataWidth = 0;
for (nCol=nX1; nCol<=nX2; nCol++)
nDataWidth += mpDoc->GetColWidth( nCol, nTab );
@@ -55,8 +55,8 @@ Point ScOutputData::PrePrintDrawingLayer(long nLogStX, long nLogStY )
aRect.SetBottom( -aOffset.Y() );
Point aMMOffset( aOffset );
- aMMOffset.setX( static_cast<long>(aMMOffset.X() * HMM_PER_TWIPS) );
- aMMOffset.setY( static_cast<long>(aMMOffset.Y() * HMM_PER_TWIPS) );
+ aMMOffset.setX( static_cast<tools::Long>(aMMOffset.X() * HMM_PER_TWIPS) );
+ aMMOffset.setY( static_cast<tools::Long>(aMMOffset.Y() * HMM_PER_TWIPS) );
if (!bMetaFile)
aMMOffset += Point( nLogStX, nLogStY );
@@ -65,10 +65,10 @@ Point ScOutputData::PrePrintDrawingLayer(long nLogStX, long nLogStY )
aRect.AdjustRight(mpDoc->GetColWidth( nCol, nTab ) );
aRect.AdjustBottom(mpDoc->GetRowHeight( nY1, nY2, nTab ) );
- aRect.SetLeft( static_cast<long>(aRect.Left() * HMM_PER_TWIPS) );
- aRect.SetTop( static_cast<long>(aRect.Top() * HMM_PER_TWIPS) );
- aRect.SetRight( static_cast<long>(aRect.Right() * HMM_PER_TWIPS) );
- aRect.SetBottom( static_cast<long>(aRect.Bottom() * HMM_PER_TWIPS) );
+ aRect.SetLeft( static_cast<tools::Long>(aRect.Left() * HMM_PER_TWIPS) );
+ aRect.SetTop( static_cast<tools::Long>(aRect.Top() * HMM_PER_TWIPS) );
+ aRect.SetRight( static_cast<tools::Long>(aRect.Right() * HMM_PER_TWIPS) );
+ aRect.SetBottom( static_cast<tools::Long>(aRect.Bottom() * HMM_PER_TWIPS) );
if(pViewShell || pDrawView)
{
diff --git a/sc/source/ui/view/pfuncache.cxx b/sc/source/ui/view/pfuncache.cxx
index 1d56bf3f3dfe..3c1ff3a34015 100644
--- a/sc/source/ui/view/pfuncache.cxx
+++ b/sc/source/ui/view/pfuncache.cxx
@@ -58,9 +58,9 @@ ScPrintFuncCache::ScPrintFuncCache( ScDocShell* pD, const ScMarkData& rMark,
SCTAB nTab;
for ( nTab=0; nTab<nTabCount; nTab++ )
{
- long nAttrPage = nTab > 0 ? nFirstAttr[nTab-1] : 1;
+ tools::Long nAttrPage = nTab > 0 ? nFirstAttr[nTab-1] : 1;
- long nThisTab = 0;
+ tools::Long nThisTab = 0;
if ( rMark.GetTableSelect( nTab ) )
{
ScPrintFunc aFunc( pDocSh, pPrinter, nTab, nAttrPage, 0, pSelRange, &aSelection.GetOptions() );
@@ -92,8 +92,8 @@ void ScPrintFuncCache::InitLocations( const ScMarkData& rMark, OutputDevice* pDe
pSelRange = &aRange;
}
- long nRenderer = 0; // 0-based physical page number across sheets
- long nTabStart = 0;
+ tools::Long nRenderer = 0; // 0-based physical page number across sheets
+ tools::Long nTabStart = 0;
ScDocument& rDoc = pDocSh->GetDocument();
SCTAB nTabCount = rDoc.GetTableCount();
@@ -104,9 +104,9 @@ void ScPrintFuncCache::InitLocations( const ScMarkData& rMark, OutputDevice* pDe
ScPrintFunc aFunc( pDev, pDocSh, nTab, nFirstAttr[nTab], nTotalPages, pSelRange, &aSelection.GetOptions() );
aFunc.SetRenderFlag( true );
- long nDisplayStart = GetDisplayStart( nTab );
+ tools::Long nDisplayStart = GetDisplayStart( nTab );
- for ( long nPage=0; nPage<nPages[nTab]; nPage++ )
+ for ( tools::Long nPage=0; nPage<nPages[nTab]; nPage++ )
{
Range aPageRange( nRenderer+1, nRenderer+1 );
MultiSelection aPage( aPageRange );
@@ -147,7 +147,7 @@ bool ScPrintFuncCache::IsSameSelection( const ScPrintSelectionStatus& rStatus )
return aSelection == rStatus;
}
-SCTAB ScPrintFuncCache::GetTabForPage( long nPage ) const
+SCTAB ScPrintFuncCache::GetTabForPage( tools::Long nPage ) const
{
ScDocument& rDoc = pDocSh->GetDocument();
SCTAB nTabCount = rDoc.GetTableCount();
@@ -159,20 +159,20 @@ SCTAB ScPrintFuncCache::GetTabForPage( long nPage ) const
return nTab;
}
-long ScPrintFuncCache::GetTabStart( SCTAB nTab ) const
+tools::Long ScPrintFuncCache::GetTabStart( SCTAB nTab ) const
{
- long nRet = 0;
+ tools::Long nRet = 0;
const SCTAB maxIndex = std::min(nTab, static_cast<SCTAB>(nPages.size()));
for ( SCTAB i=0; i<maxIndex; i++ )
nRet += nPages[i];
return nRet;
}
-long ScPrintFuncCache::GetDisplayStart( SCTAB nTab ) const
+tools::Long ScPrintFuncCache::GetDisplayStart( SCTAB nTab ) const
{
//! merge with lcl_GetDisplayStart in preview?
- long nDisplayStart = 0;
+ tools::Long nDisplayStart = 0;
ScDocument& rDoc = pDocSh->GetDocument();
for (SCTAB i=0; i<nTab; i++)
{
diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx
index 207d098ca8c5..d2d19f3ff720 100644
--- a/sc/source/ui/view/preview.cxx
+++ b/sc/source/ui/view/preview.cxx
@@ -67,9 +67,9 @@
#define SC_PREVIEW_SHADOWSIZE 2
-static long lcl_GetDisplayStart( SCTAB nTab, const ScDocument* pDoc, std::vector<long>& nPages )
+static tools::Long lcl_GetDisplayStart( SCTAB nTab, const ScDocument* pDoc, std::vector<long>& nPages )
{
- long nDisplayStart = 0;
+ tools::Long nDisplayStart = 0;
for (SCTAB i=0; i<nTab; i++)
{
if ( pDoc->NeedPageResetAfterTab(i) )
@@ -255,11 +255,11 @@ void ScPreview::CalcPages()
continue;
}
- long nAttrPage = i > 0 ? nFirstAttr[i-1] : 1;
+ tools::Long nAttrPage = i > 0 ? nFirstAttr[i-1] : 1;
- long nThisStart = nTotalPages;
+ tools::Long nThisStart = nTotalPages;
ScPrintFunc aPrintFunc( this, pDocShell, i, nAttrPage, 0, nullptr, &aOptions );
- long nThisTab = aPrintFunc.GetTotalPages();
+ tools::Long nThisTab = aPrintFunc.GetTotalPages();
if (!aPrintFunc.HasPrintRange())
mbHasEmptyRangeTable = true;
@@ -307,10 +307,10 @@ void ScPreview::RecalcPages() // only nPageNo is changed
if (!bDone)
{
- long nPartPages = 0;
+ tools::Long nPartPages = 0;
for (SCTAB i=0; i<nTabsTested && nTab < static_cast<SCTAB>(nPages.size()); i++)
{
- long nThisStart = nPartPages;
+ tools::Long nThisStart = nPartPages;
nPartPages += nPages[i];
if (nPageNo>=nThisStart && nPageNo<nPartPages)
@@ -343,7 +343,7 @@ void ScPreview::DoPrint( ScPreviewLocationData* pFillLocation )
}
Fraction aPreviewZoom( nZoom, 100 );
- Fraction aHorPrevZoom( static_cast<long>( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 );
+ Fraction aHorPrevZoom( static_cast<tools::Long>( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 );
MapMode aMMMode( MapUnit::Map100thMM, Point(), aHorPrevZoom, aPreviewZoom );
bool bDoPrint = ( pFillLocation == nullptr );
@@ -366,10 +366,10 @@ void ScPreview::DoPrint( ScPreviewLocationData* pFillLocation )
DrawRect(tools::Rectangle( 0, 0, aWinSize.Width(), -aOffset.Y() ));
}
- long nLeftMargin = 0;
- long nRightMargin = 0;
- long nTopMargin = 0;
- long nBottomMargin = 0;
+ tools::Long nLeftMargin = 0;
+ tools::Long nRightMargin = 0;
+ tools::Long nTopMargin = 0;
+ tools::Long nBottomMargin = 0;
bool bHeaderOn = false;
bool bFooterOn = false;
@@ -401,7 +401,7 @@ void ScPreview::DoPrint( ScPreviewLocationData* pFillLocation )
aPage.SetTotalRange( Range(0,RANGE_MAX) );
aPage.Select( aPageRange );
- long nPrinted = pPrintFunc->DoPrint( aPage, nTabStart, nDisplayStart, bDoPrint, pFillLocation );
+ tools::Long nPrinted = pPrintFunc->DoPrint( aPage, nTabStart, nDisplayStart, bDoPrint, pFillLocation );
OSL_ENSURE(nPrinted<=1, "What is happening?");
SetMapMode(aMMMode);
@@ -452,15 +452,15 @@ void ScPreview::DoPrint( ScPreviewLocationData* pFillLocation )
if (nPrinted) // if not, draw everything grey
{
aLocalPageSize = pPrintFunc->GetPageSize();
- aLocalPageSize.setWidth( static_cast<long>(aLocalPageSize.Width() * HMM_PER_TWIPS ) );
- aLocalPageSize.setHeight( static_cast<long>(aLocalPageSize.Height() * HMM_PER_TWIPS ) );
-
- nLeftMargin = static_cast<long>( nLeftMargin * HMM_PER_TWIPS );
- nRightMargin = static_cast<long>( nRightMargin * HMM_PER_TWIPS );
- nTopMargin = static_cast<long>( nTopMargin * HMM_PER_TWIPS );
- nBottomMargin = static_cast<long>( nBottomMargin * HMM_PER_TWIPS );
- nHeaderHeight = static_cast<long>( nHeaderHeight * HMM_PER_TWIPS * mnScale / 100 + nTopMargin );
- nFooterHeight = static_cast<long>( nFooterHeight * HMM_PER_TWIPS * mnScale / 100 + nBottomMargin );
+ aLocalPageSize.setWidth( static_cast<tools::Long>(aLocalPageSize.Width() * HMM_PER_TWIPS ) );
+ aLocalPageSize.setHeight( static_cast<tools::Long>(aLocalPageSize.Height() * HMM_PER_TWIPS ) );
+
+ nLeftMargin = static_cast<tools::Long>( nLeftMargin * HMM_PER_TWIPS );
+ nRightMargin = static_cast<tools::Long>( nRightMargin * HMM_PER_TWIPS );
+ nTopMargin = static_cast<tools::Long>( nTopMargin * HMM_PER_TWIPS );
+ nBottomMargin = static_cast<tools::Long>( nBottomMargin * HMM_PER_TWIPS );
+ nHeaderHeight = static_cast<tools::Long>( nHeaderHeight * HMM_PER_TWIPS * mnScale / 100 + nTopMargin );
+ nFooterHeight = static_cast<tools::Long>( nFooterHeight * HMM_PER_TWIPS * mnScale / 100 + nBottomMargin );
}
if (!bStateValid)
@@ -474,8 +474,8 @@ void ScPreview::DoPrint( ScPreviewLocationData* pFillLocation )
if ( !bDoPrint )
return;
- long nPageEndX = aLocalPageSize.Width() - aOffset.X();
- long nPageEndY = aLocalPageSize.Height() - aOffset.Y();
+ tools::Long nPageEndX = aLocalPageSize.Width() - aOffset.X();
+ tools::Long nPageEndY = aLocalPageSize.Height() - aOffset.Y();
if ( !bValidPage )
nPageEndX = nPageEndY = 0;
@@ -514,7 +514,7 @@ void ScPreview::DoPrint( ScPreviewLocationData* pFillLocation )
else
aEmptyMsg = ScResId(STR_PRINT_PREVIEW_NODATA);
- long nHeight = 3000;
+ tools::Long nHeight = 3000;
pEditEng->SetDefaultItem(SvxFontHeightItem(nHeight, 100, EE_CHAR_FONTHEIGHT));
pEditEng->SetDefaultItem(SvxFontHeightItem(nHeight, 100, EE_CHAR_FONTHEIGHT_CJK));
pEditEng->SetDefaultItem(SvxFontHeightItem(nHeight, 100, EE_CHAR_FONTHEIGHT_CTL));
@@ -534,10 +534,10 @@ void ScPreview::DoPrint( ScPreviewLocationData* pFillLocation )
{
SetMapMode(aMMMode);
SetLineColor( COL_BLACK );
- DrawInvert( static_cast<long>( nTopMargin - aOffset.Y() ), PointerStyle::VSizeBar );
- DrawInvert( static_cast<long>(nPageEndY - nBottomMargin ), PointerStyle::VSizeBar );
- DrawInvert( static_cast<long>( nLeftMargin - aOffset.X() ), PointerStyle::HSizeBar );
- DrawInvert( static_cast<long>( nPageEndX - nRightMargin ) , PointerStyle::HSizeBar );
+ DrawInvert( static_cast<tools::Long>( nTopMargin - aOffset.Y() ), PointerStyle::VSizeBar );
+ DrawInvert( static_cast<tools::Long>(nPageEndY - nBottomMargin ), PointerStyle::VSizeBar );
+ DrawInvert( static_cast<tools::Long>( nLeftMargin - aOffset.X() ), PointerStyle::HSizeBar );
+ DrawInvert( static_cast<tools::Long>( nPageEndX - nRightMargin ) , PointerStyle::HSizeBar );
if( bHeaderOn )
{
DrawInvert( nHeaderHeight - aOffset.Y(), PointerStyle::VSizeBar );
@@ -726,7 +726,7 @@ void ScPreview::SetZoom(sal_uInt16 nNewZoom)
// apply new MapMode and call UpdateScrollBars to update aOffset
Fraction aPreviewZoom( nZoom, 100 );
- Fraction aHorPrevZoom( static_cast<long>( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 );
+ Fraction aHorPrevZoom( static_cast<tools::Long>( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 );
MapMode aMMMode( MapUnit::Map100thMM, Point(), aHorPrevZoom, aPreviewZoom );
SetMapMode( aMMMode );
@@ -740,7 +740,7 @@ void ScPreview::SetZoom(sal_uInt16 nNewZoom)
Invalidate();
}
-void ScPreview::SetPageNo( long nPage )
+void ScPreview::SetPageNo( tools::Long nPage )
{
nPageNo = nPage;
RecalcPages();
@@ -749,13 +749,13 @@ void ScPreview::SetPageNo( long nPage )
Invalidate();
}
-long ScPreview::GetFirstPage(SCTAB nTabP)
+tools::Long ScPreview::GetFirstPage(SCTAB nTabP)
{
SCTAB nDocTabCount = pDocShell->GetDocument().GetTableCount();
if (nTabP >= nDocTabCount)
nTabP = nDocTabCount-1;
- long nPage = 0;
+ tools::Long nPage = 0;
if (nTabP>0)
{
CalcPages();
@@ -808,10 +808,10 @@ sal_uInt16 ScPreview::GetOptimalZoom(bool bWidthOnly)
Size aLocalPageSize = lcl_GetDocPageSize( &pDocShell->GetDocument(), nTab );
if ( aLocalPageSize.Width() && aLocalPageSize.Height() )
{
- long nZoomX = static_cast<long>( aWinSize.Width() * 100 / ( aLocalPageSize.Width() * nWinScaleX ));
- long nZoomY = static_cast<long>( aWinSize.Height() * 100 / ( aLocalPageSize.Height() * nWinScaleY ));
+ tools::Long nZoomX = static_cast<tools::Long>( aWinSize.Width() * 100 / ( aLocalPageSize.Width() * nWinScaleX ));
+ tools::Long nZoomY = static_cast<tools::Long>( aWinSize.Height() * 100 / ( aLocalPageSize.Height() * nWinScaleY ));
- long nOptimal = nZoomX;
+ tools::Long nOptimal = nZoomX;
if (!bWidthOnly && nZoomY<nOptimal)
nOptimal = nZoomY;
@@ -826,14 +826,14 @@ sal_uInt16 ScPreview::GetOptimalZoom(bool bWidthOnly)
return nZoom;
}
-void ScPreview::SetXOffset( long nX )
+void ScPreview::SetXOffset( tools::Long nX )
{
if ( aOffset.X() == nX )
return;
if (bValid)
{
- long nDif = LogicToPixel(aOffset).X() - LogicToPixel(Point(nX,0)).X();
+ tools::Long nDif = LogicToPixel(aOffset).X() - LogicToPixel(Point(nX,0)).X();
aOffset.setX( nX );
if (nDif && !bInSetZoom)
{
@@ -853,14 +853,14 @@ void ScPreview::SetXOffset( long nX )
Invalidate();
}
-void ScPreview::SetYOffset( long nY )
+void ScPreview::SetYOffset( tools::Long nY )
{
if ( aOffset.Y() == nY )
return;
if (bValid)
{
- long nDif = LogicToPixel(aOffset).Y() - LogicToPixel(Point(0,nY)).Y();
+ tools::Long nDif = LogicToPixel(aOffset).Y() - LogicToPixel(Point(0,nY)).Y();
aOffset.setY( nY );
if (nDif && !bInSetZoom)
{
@@ -953,7 +953,7 @@ void ScPreview::DataChanged( const DataChangedEvent& rDCEvt )
void ScPreview::MouseButtonDown( const MouseEvent& rMEvt )
{
Fraction aPreviewZoom( nZoom, 100 );
- Fraction aHorPrevZoom( static_cast<long>( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 );
+ Fraction aHorPrevZoom( static_cast<tools::Long>( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 );
MapMode aMMMode( MapUnit::Map100thMM, Point(), aHorPrevZoom, aPreviewZoom );
aButtonDownChangePoint = PixelToLogic( rMEvt.GetPosPixel(),aMMMode );
@@ -1036,13 +1036,13 @@ void ScPreview::MouseButtonDown( const MouseEvent& rMEvt )
void ScPreview::MouseButtonUp( const MouseEvent& rMEvt )
{
Fraction aPreviewZoom( nZoom, 100 );
- Fraction aHorPrevZoom( static_cast<long>( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 );
+ Fraction aHorPrevZoom( static_cast<tools::Long>( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 );
MapMode aMMMode( MapUnit::Map100thMM, Point(), aHorPrevZoom, aPreviewZoom );
aButtonUpPt = PixelToLogic( rMEvt.GetPosPixel(),aMMMode );
- long nWidth = lcl_GetDocPageSize(&pDocShell->GetDocument(), nTab).Width();
- long nHeight = lcl_GetDocPageSize(&pDocShell->GetDocument(), nTab).Height();
+ tools::Long nWidth = lcl_GetDocPageSize(&pDocShell->GetDocument(), nTab).Width();
+ tools::Long nHeight = lcl_GetDocPageSize(&pDocShell->GetDocument(), nTab).Height();
if( rMEvt.IsLeft() && GetPointer() == PointerStyle::HSizeBar )
{
@@ -1090,13 +1090,13 @@ void ScPreview::MouseButtonUp( const MouseEvent& rMEvt )
ScDocShellModificator aModificator( *pDocShell );
if( bLeftRulerChange && bLeftRulerMove )
{
- aLRItem.SetLeft( static_cast<long>( aButtonUpPt.X() / HMM_PER_TWIPS + aOffset.X() / HMM_PER_TWIPS ));
+ aLRItem.SetLeft( static_cast<tools::Long>( aButtonUpPt.X() / HMM_PER_TWIPS + aOffset.X() / HMM_PER_TWIPS ));
rStyleSet.Put( aLRItem );
pDocShell->SetModified();
}
else if( bRightRulerChange && bRightRulerMove )
{
- aLRItem.SetRight( static_cast<long>( nWidth - aButtonUpPt.X() / HMM_PER_TWIPS - aOffset.X() / HMM_PER_TWIPS ));
+ aLRItem.SetRight( static_cast<tools::Long>( nWidth - aButtonUpPt.X() / HMM_PER_TWIPS - aOffset.X() / HMM_PER_TWIPS ));
rStyleSet.Put( aLRItem );
pDocShell->SetModified();
}
@@ -1179,7 +1179,7 @@ void ScPreview::MouseButtonUp( const MouseEvent& rMEvt )
{
const SfxItemSet& rHeaderSet = static_cast<const SvxSetItem*>(pItem)->GetItemSet();
Size aHeaderSize = rHeaderSet.Get(ATTR_PAGE_SIZE).GetSize();
- aHeaderSize.setHeight( static_cast<long>( aButtonUpPt.Y() / HMM_PER_TWIPS + aOffset.Y() / HMM_PER_TWIPS - aULItem.GetUpper()) );
+ aHeaderSize.setHeight( static_cast<tools::Long>( aButtonUpPt.Y() / HMM_PER_TWIPS + aOffset.Y() / HMM_PER_TWIPS - aULItem.GetUpper()) );
aHeaderSize.setHeight( aHeaderSize.Height() * 100 / mnScale );
SvxSetItem aNewHeader( rStyleSet.Get(ATTR_PAGE_HEADERSET) );
aNewHeader.GetItemSet().Put( SvxSizeItem( ATTR_PAGE_SIZE, aHeaderSize ) );
@@ -1194,7 +1194,7 @@ void ScPreview::MouseButtonUp( const MouseEvent& rMEvt )
{
const SfxItemSet& rFooterSet = static_cast<const SvxSetItem*>(pItem)->GetItemSet();
Size aFooterSize = rFooterSet.Get(ATTR_PAGE_SIZE).GetSize();
- aFooterSize.setHeight( static_cast<long>( nHeight - aButtonUpPt.Y() / HMM_PER_TWIPS - aOffset.Y() / HMM_PER_TWIPS - aULItem.GetLower() ) );
+ aFooterSize.setHeight( static_cast<tools::Long>( nHeight - aButtonUpPt.Y() / HMM_PER_TWIPS - aOffset.Y() / HMM_PER_TWIPS - aULItem.GetLower() ) );
aFooterSize.setHeight( aFooterSize.Height() * 100 / mnScale );
SvxSetItem aNewFooter( rStyleSet.Get(ATTR_PAGE_FOOTERSET) );
aNewFooter.GetItemSet().Put( SvxSizeItem( ATTR_PAGE_SIZE, aFooterSize ) );
@@ -1249,18 +1249,18 @@ void ScPreview::MouseButtonUp( const MouseEvent& rMEvt )
}
if( bMoveRulerAction )
{
- long nNewColWidth = 0;
+ tools::Long nNewColWidth = 0;
std::vector<sc::ColRowSpan> aCols(1, sc::ColRowSpan(nColNumberButtonDown,nColNumberButtonDown));
if( !bLayoutRTL )
{
- nNewColWidth = static_cast<long>( PixelToLogic( Point( rMEvt.GetPosPixel().X() - mvRight[ nColNumberButtonDown ], 0), aMMMode ).X() / HMM_PER_TWIPS ) * 100 / mnScale;
+ nNewColWidth = static_cast<tools::Long>( PixelToLogic( Point( rMEvt.GetPosPixel().X() - mvRight[ nColNumberButtonDown ], 0), aMMMode ).X() / HMM_PER_TWIPS ) * 100 / mnScale;
nNewColWidth += pDocShell->GetDocument().GetColWidth( nColNumberButtonDown, nTab );
}
else
{
- nNewColWidth = static_cast<long>( PixelToLogic( Point( mvRight[ nColNumberButtonDown ] - rMEvt.GetPosPixel().X(), 0), aMMMode ).X() / HMM_PER_TWIPS ) * 100 / mnScale;
+ nNewColWidth = static_cast<tools::Long>( PixelToLogic( Point( mvRight[ nColNumberButtonDown ] - rMEvt.GetPosPixel().X(), 0), aMMMode ).X() / HMM_PER_TWIPS ) * 100 / mnScale;
nNewColWidth += pDocShell->GetDocument().GetColWidth( nColNumberButtonDown, nTab );
}
@@ -1286,17 +1286,17 @@ void ScPreview::MouseButtonUp( const MouseEvent& rMEvt )
void ScPreview::MouseMove( const MouseEvent& rMEvt )
{
Fraction aPreviewZoom( nZoom, 100 );
- Fraction aHorPrevZoom( static_cast<long>( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 );
+ Fraction aHorPrevZoom( static_cast<tools::Long>( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 );
MapMode aMMMode( MapUnit::Map100thMM, Point(), aHorPrevZoom, aPreviewZoom );
Point aMouseMovePoint = PixelToLogic( rMEvt.GetPosPixel(), aMMMode );
- long nLeftMargin = 0;
- long nRightMargin = 0;
- long nTopMargin = 0;
- long nBottomMargin = 0;
+ tools::Long nLeftMargin = 0;
+ tools::Long nRightMargin = 0;
+ tools::Long nTopMargin = 0;
+ tools::Long nBottomMargin = 0;
- long nWidth = lcl_GetDocPageSize(&pDocShell->GetDocument(), nTab).Width();
- long nHeight = lcl_GetDocPageSize(&pDocShell->GetDocument(), nTab).Height();
+ tools::Long nWidth = lcl_GetDocPageSize(&pDocShell->GetDocument(), nTab).Width();
+ tools::Long nHeight = lcl_GetDocPageSize(&pDocShell->GetDocument(), nTab).Height();
if ( nPageNo < nTotalPages )
{
@@ -1308,30 +1308,30 @@ void ScPreview::MouseMove( const MouseEvent& rMEvt )
else
pPrintFunc.reset(new ScPrintFunc( this, pDocShell, nTab, nFirstAttr[nTab], nTotalPages, nullptr, &aOptions ));
- nLeftMargin = static_cast<long>( pPrintFunc->GetLeftMargin() * HMM_PER_TWIPS - aOffset.X() );
- nRightMargin = static_cast<long>( pPrintFunc->GetRightMargin() * HMM_PER_TWIPS );
- nRightMargin = static_cast<long>( nWidth * HMM_PER_TWIPS - nRightMargin - aOffset.X() );
- nTopMargin = static_cast<long>( pPrintFunc->GetTopMargin() * HMM_PER_TWIPS - aOffset.Y() );
- nBottomMargin = static_cast<long>( pPrintFunc->GetBottomMargin() * HMM_PER_TWIPS );
- nBottomMargin = static_cast<long>( nHeight * HMM_PER_TWIPS - nBottomMargin - aOffset.Y() );
+ nLeftMargin = static_cast<tools::Long>( pPrintFunc->GetLeftMargin() * HMM_PER_TWIPS - aOffset.X() );
+ nRightMargin = static_cast<tools::Long>( pPrintFunc->GetRightMargin() * HMM_PER_TWIPS );
+ nRightMargin = static_cast<tools::Long>( nWidth * HMM_PER_TWIPS - nRightMargin - aOffset.X() );
+ nTopMargin = static_cast<tools::Long>( pPrintFunc->GetTopMargin() * HMM_PER_TWIPS - aOffset.Y() );
+ nBottomMargin = static_cast<tools::Long>( pPrintFunc->GetBottomMargin() * HMM_PER_TWIPS );
+ nBottomMargin = static_cast<tools::Long>( nHeight * HMM_PER_TWIPS - nBottomMargin - aOffset.Y() );
if( mnScale > 0 )
{
- nHeaderHeight = static_cast<long>( nTopMargin + pPrintFunc->GetHeader().nHeight * HMM_PER_TWIPS * mnScale / 100 );
- nFooterHeight = static_cast<long>( nBottomMargin - pPrintFunc->GetFooter().nHeight * HMM_PER_TWIPS * mnScale / 100 );
+ nHeaderHeight = static_cast<tools::Long>( nTopMargin + pPrintFunc->GetHeader().nHeight * HMM_PER_TWIPS * mnScale / 100 );
+ nFooterHeight = static_cast<tools::Long>( nBottomMargin - pPrintFunc->GetFooter().nHeight * HMM_PER_TWIPS * mnScale / 100 );
}
else
{
- nHeaderHeight = static_cast<long>( nTopMargin + pPrintFunc->GetHeader().nHeight * HMM_PER_TWIPS );
- nFooterHeight = static_cast<long>( nBottomMargin - pPrintFunc->GetFooter().nHeight * HMM_PER_TWIPS );
+ nHeaderHeight = static_cast<tools::Long>( nTopMargin + pPrintFunc->GetHeader().nHeight * HMM_PER_TWIPS );
+ nFooterHeight = static_cast<tools::Long>( nBottomMargin - pPrintFunc->GetFooter().nHeight * HMM_PER_TWIPS );
}
}
Point aPixPt( rMEvt.GetPosPixel() );
Point aLeftTop = LogicToPixel( Point( nLeftMargin, -aOffset.Y() ) , aMMMode );
- Point aLeftBottom = LogicToPixel( Point( nLeftMargin ,static_cast<long>(nHeight * HMM_PER_TWIPS - aOffset.Y()) ), aMMMode );
+ Point aLeftBottom = LogicToPixel( Point( nLeftMargin ,static_cast<tools::Long>(nHeight * HMM_PER_TWIPS - aOffset.Y()) ), aMMMode );
Point aRightTop = LogicToPixel( Point( nRightMargin, -aOffset.Y() ), aMMMode );
Point aTopLeft = LogicToPixel( Point( -aOffset.X(), nTopMargin ), aMMMode );
- Point aTopRight = LogicToPixel( Point( static_cast<long>(nWidth * HMM_PER_TWIPS - aOffset.X()), nTopMargin ), aMMMode );
+ Point aTopRight = LogicToPixel( Point( static_cast<tools::Long>(nWidth * HMM_PER_TWIPS - aOffset.X()), nTopMargin ), aMMMode );
Point aBottomLeft = LogicToPixel( Point( -aOffset.X(), nBottomMargin ), aMMMode );
Point aHeaderLeft = LogicToPixel( Point( -aOffset.X(), nHeaderHeight ), aMMMode );
Point aFooderLeft = LogicToPixel( Point( -aOffset.X(), nFooterHeight ), aMMMode );
@@ -1341,8 +1341,8 @@ void ScPreview::MouseMove( const MouseEvent& rMEvt )
for( SCCOL i=aPageArea.aStart.Col(); i<= aPageArea.aEnd.Col(); i++ )
{
Point aColumnTop = LogicToPixel( Point( 0, -aOffset.Y() ) ,aMMMode );
- Point aColumnBottom = LogicToPixel( Point( 0, static_cast<long>( nHeight * HMM_PER_TWIPS - aOffset.Y()) ), aMMMode );
- long nRight = i < static_cast<SCCOL>(mvRight.size()) ? mvRight[i] : 0;
+ Point aColumnBottom = LogicToPixel( Point( 0, static_cast<tools::Long>( nHeight * HMM_PER_TWIPS - aOffset.Y()) ), aMMMode );
+ tools::Long nRight = i < static_cast<SCCOL>(mvRight.size()) ? mvRight[i] : 0;
if( aPixPt.X() < ( nRight + 2 ) && ( aPixPt.X() > ( nRight - 2 ) ) && ( aPixPt.X() < aRightTop.X() ) && ( aPixPt.X() > aLeftTop.X() )
&& ( aPixPt.Y() > aColumnTop.Y() ) && ( aPixPt.Y() < aColumnBottom.Y() ) && !bLeftRulerMove && !bRightRulerMove
&& !bTopRulerMove && !bBottomRulerMove && !bHeaderRulerMove && !bFooterRulerMove )
@@ -1519,13 +1519,13 @@ css::uno::Reference<css::accessibility::XAccessible> ScPreview::CreateAccessible
return xAcc;
}
-void ScPreview::DragMove( long nDragMovePos, PointerStyle nFlags )
+void ScPreview::DragMove( tools::Long nDragMovePos, PointerStyle nFlags )
{
Fraction aPreviewZoom( nZoom, 100 );
- Fraction aHorPrevZoom( static_cast<long>( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 );
+ Fraction aHorPrevZoom( static_cast<tools::Long>( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 );
MapMode aMMMode( MapUnit::Map100thMM, Point(), aHorPrevZoom, aPreviewZoom );
SetMapMode( aMMMode );
- long nPos = nDragMovePos;
+ tools::Long nPos = nDragMovePos;
if( nFlags == PointerStyle::HSizeBar || nFlags == PointerStyle::HSplit )
{
if( nDragMovePos != aButtonDownChangePoint.X() )
@@ -1546,18 +1546,18 @@ void ScPreview::DragMove( long nDragMovePos, PointerStyle nFlags )
}
}
-void ScPreview::DrawInvert( long nDragPos, PointerStyle nFlags )
+void ScPreview::DrawInvert( tools::Long nDragPos, PointerStyle nFlags )
{
- long nHeight = lcl_GetDocPageSize( &pDocShell->GetDocument(), nTab ).Height();
- long nWidth = lcl_GetDocPageSize( &pDocShell->GetDocument(), nTab ).Width();
+ tools::Long nHeight = lcl_GetDocPageSize( &pDocShell->GetDocument(), nTab ).Height();
+ tools::Long nWidth = lcl_GetDocPageSize( &pDocShell->GetDocument(), nTab ).Width();
if( nFlags == PointerStyle::HSizeBar || nFlags == PointerStyle::HSplit )
{
- tools::Rectangle aRect( nDragPos, -aOffset.Y(), nDragPos + 1,static_cast<long>( ( nHeight * HMM_PER_TWIPS ) - aOffset.Y()));
+ tools::Rectangle aRect( nDragPos, -aOffset.Y(), nDragPos + 1,static_cast<tools::Long>( ( nHeight * HMM_PER_TWIPS ) - aOffset.Y()));
Invert( aRect, InvertFlags::N50 );
}
else if( nFlags == PointerStyle::VSizeBar )
{
- tools::Rectangle aRect( -aOffset.X(), nDragPos,static_cast<long>( ( nWidth * HMM_PER_TWIPS ) - aOffset.X() ), nDragPos + 1 );
+ tools::Rectangle aRect( -aOffset.X(), nDragPos,static_cast<tools::Long>( ( nWidth * HMM_PER_TWIPS ) - aOffset.X() ), nDragPos + 1 );
Invert( aRect, InvertFlags::N50 );
}
}
diff --git a/sc/source/ui/view/prevloc.cxx b/sc/source/ui/view/prevloc.cxx
index 668903ed0448..281cc468ab1d 100644
--- a/sc/source/ui/view/prevloc.cxx
+++ b/sc/source/ui/view/prevloc.cxx
@@ -282,20 +282,20 @@ tools::Rectangle ScPreviewLocationData::GetOffsetPixel( const ScAddress& rCellPo
const double nScaleY = HMM_PER_TWIPS;
SCTAB nTab = rRange.aStart.Tab();
- long nPosX = 0;
+ tools::Long nPosX = 0;
SCCOL nEndCol = rCellPos.Col();
for (SCCOL nCol = rRange.aStart.Col(); nCol < nEndCol; nCol++)
{
sal_uInt16 nDocW = pDoc->GetColWidth( nCol, nTab );
if (nDocW)
- nPosX += static_cast<long>(nDocW * nScaleX);
+ nPosX += static_cast<tools::Long>(nDocW * nScaleX);
}
- long nSizeX = static_cast<long>( pDoc->GetColWidth( nEndCol, nTab ) * nScaleX );
+ tools::Long nSizeX = static_cast<tools::Long>( pDoc->GetColWidth( nEndCol, nTab ) * nScaleX );
SCROW nEndRow = rCellPos.Row();
- long nPosY = static_cast<long>(pDoc->GetScaledRowHeight( rRange.aStart.Row(),
+ tools::Long nPosY = static_cast<tools::Long>(pDoc->GetScaledRowHeight( rRange.aStart.Row(),
nEndRow, nTab, nScaleY));
- long nSizeY = static_cast<long>( pDoc->GetRowHeight( nEndRow, nTab ) * nScaleY );
+ tools::Long nSizeY = static_cast<tools::Long>( pDoc->GetRowHeight( nEndRow, nTab ) * nScaleY );
Size aOffsetLogic( nPosX, nPosY );
Size aSizeLogic( nSizeX, nSizeY );
@@ -386,7 +386,7 @@ bool ScPreviewLocationData::IsFooterLeft() const
return false;
}
-long ScPreviewLocationData::GetNoteCountInRange( const tools::Rectangle& rVisiblePixel, bool bNoteMarks ) const
+tools::Long ScPreviewLocationData::GetNoteCountInRange( const tools::Rectangle& rVisiblePixel, bool bNoteMarks ) const
{
ScPreviewLocationType eType = bNoteMarks ? SC_PLOC_NOTEMARK : SC_PLOC_NOTETEXT;
@@ -400,7 +400,7 @@ long ScPreviewLocationData::GetNoteCountInRange( const tools::Rectangle& rVisibl
return nRet;
}
-bool ScPreviewLocationData::GetNoteInRange( const tools::Rectangle& rVisiblePixel, long nIndex, bool bNoteMarks,
+bool ScPreviewLocationData::GetNoteInRange( const tools::Rectangle& rVisiblePixel, tools::Long nIndex, bool bNoteMarks,
ScAddress& rCellPos, tools::Rectangle& rNoteRect ) const
{
ScPreviewLocationType eType = bNoteMarks ? SC_PLOC_NOTEMARK : SC_PLOC_NOTETEXT;
@@ -548,15 +548,15 @@ void ScPreviewLocationData::GetTableInfo( const tools::Rectangle& rVisiblePixel,
}
if ( bHasRepCols )
{
- long nPosX = 0;
+ tools::Long nPosX = 0;
for ( nCol=nRepeatColStart; nCol<=nRepeatColEnd; nCol++ )
if (!pDoc->ColHidden(nCol, nTab))
{
sal_uInt16 nDocW = pDoc->GetColWidth( nCol, nTab );
- long nNextX = nPosX + static_cast<long>(nDocW * nScaleX);
+ tools::Long nNextX = nPosX + static_cast<tools::Long>(nDocW * nScaleX);
- long nPixelStart = pWindow->LogicToPixel( Size( nPosX, 0 ), aCellMapMode ).Width();
- long nPixelEnd = pWindow->LogicToPixel( Size( nNextX, 0 ), aCellMapMode ).Width() - 1;
+ tools::Long nPixelStart = pWindow->LogicToPixel( Size( nPosX, 0 ), aCellMapMode ).Width();
+ tools::Long nPixelEnd = pWindow->LogicToPixel( Size( nNextX, 0 ), aCellMapMode ).Width() - 1;
pColInfo[nColPos].Set( false, nCol,
aRepeatRect.Left() + nPixelStart,
aRepeatRect.Left() + nPixelEnd );
@@ -567,15 +567,15 @@ void ScPreviewLocationData::GetTableInfo( const tools::Rectangle& rVisiblePixel,
}
if ( bHasMainCols )
{
- long nPosX = 0;
+ tools::Long nPosX = 0;
for ( nCol=nMainColStart; nCol<=nMainColEnd; nCol++ )
if (!pDoc->ColHidden(nCol, nTab))
{
sal_uInt16 nDocW = pDoc->GetColWidth( nCol, nTab );
- long nNextX = nPosX + static_cast<long>(nDocW * nScaleX);
+ tools::Long nNextX = nPosX + static_cast<tools::Long>(nDocW * nScaleX);
- long nPixelStart = pWindow->LogicToPixel( Size( nPosX, 0 ), aCellMapMode ).Width();
- long nPixelEnd = pWindow->LogicToPixel( Size( nNextX, 0 ), aCellMapMode ).Width() - 1;
+ tools::Long nPixelStart = pWindow->LogicToPixel( Size( nPosX, 0 ), aCellMapMode ).Width();
+ tools::Long nPixelEnd = pWindow->LogicToPixel( Size( nNextX, 0 ), aCellMapMode ).Width() - 1;
pColInfo[nColPos].Set( false, nCol,
aMainRect.Left() + nPixelStart,
aMainRect.Left() + nPixelEnd );
@@ -611,17 +611,17 @@ void ScPreviewLocationData::GetTableInfo( const tools::Rectangle& rVisiblePixel,
}
if ( bHasRepRows )
{
- long nPosY = 0;
+ tools::Long nPosY = 0;
for (SCROW nRow = nRepeatRowStart; nRow <= nRepeatRowEnd; ++nRow)
{
if (pDoc->RowHidden(nRow, nTab))
continue;
sal_uInt16 nDocH = pDoc->GetOriginalHeight( nRow, nTab );
- long nNextY = nPosY + static_cast<long>(nDocH * nScaleY);
+ tools::Long nNextY = nPosY + static_cast<tools::Long>(nDocH * nScaleY);
- long nPixelStart = pWindow->LogicToPixel( Size( 0, nPosY ), aCellMapMode ).Height();
- long nPixelEnd = pWindow->LogicToPixel( Size( 0, nNextY ), aCellMapMode ).Height() - 1;
+ tools::Long nPixelStart = pWindow->LogicToPixel( Size( 0, nPosY ), aCellMapMode ).Height();
+ tools::Long nPixelEnd = pWindow->LogicToPixel( Size( 0, nNextY ), aCellMapMode ).Height() - 1;
pRowInfo[nRowPos].Set( false, nRow,
aRepeatRect.Top() + nPixelStart,
aRepeatRect.Top() + nPixelEnd );
@@ -632,17 +632,17 @@ void ScPreviewLocationData::GetTableInfo( const tools::Rectangle& rVisiblePixel,
}
if ( bHasMainRows )
{
- long nPosY = 0;
+ tools::Long nPosY = 0;
for (SCROW nRow = nMainRowStart; nRow <= nMainRowEnd; ++nRow)
{
if (pDoc->RowHidden(nRow, nTab))
continue;
sal_uInt16 nDocH = pDoc->GetOriginalHeight( nRow, nTab );
- long nNextY = nPosY + static_cast<long>(nDocH * nScaleY);
+ tools::Long nNextY = nPosY + static_cast<tools::Long>(nDocH * nScaleY);
- long nPixelStart = pWindow->LogicToPixel( Size( 0, nPosY ), aCellMapMode ).Height();
- long nPixelEnd = pWindow->LogicToPixel( Size( 0, nNextY ), aCellMapMode ).Height() - 1;
+ tools::Long nPixelStart = pWindow->LogicToPixel( Size( 0, nPosY ), aCellMapMode ).Height();
+ tools::Long nPixelEnd = pWindow->LogicToPixel( Size( 0, nNextY ), aCellMapMode ).Height() - 1;
pRowInfo[nRowPos].Set( false, nRow,
aMainRect.Top() + nPixelStart,
aMainRect.Top() + nPixelEnd );
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index 1ebc28bc0f1c..c16159c709cc 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -264,8 +264,8 @@ bool ScPreviewShell::GetPageSize( Size& aPageSize )
const SfxItemSet* pParamSet = &pStyleSheet->GetItemSet();
aPageSize = pParamSet->Get(ATTR_PAGE_SIZE).GetSize();
- aPageSize.setWidth( static_cast<long>(aPageSize.Width() * HMM_PER_TWIPS ) );
- aPageSize.setHeight( static_cast<long>(aPageSize.Height() * HMM_PER_TWIPS ) );
+ aPageSize.setWidth( static_cast<tools::Long>(aPageSize.Width() * HMM_PER_TWIPS ) );
+ aPageSize.setHeight( static_cast<tools::Long>(aPageSize.Height() * HMM_PER_TWIPS ) );
return true;
}
@@ -274,11 +274,11 @@ void ScPreviewShell::UpdateNeededScrollBars( bool bFromZoom )
Size aPageSize;
OutputDevice* pDevice = Application::GetDefaultDevice();
- long nBarW = GetViewFrame()->GetWindow().GetSettings().GetStyleSettings().GetScrollBarSize();
- long nBarH = nBarW;
+ tools::Long nBarW = GetViewFrame()->GetWindow().GetSettings().GetStyleSettings().GetScrollBarSize();
+ tools::Long nBarH = nBarW;
- long aHeightOffSet = pDevice ? pDevice->PixelToLogic( Size( nBarW, nBarH ), pPreview->GetMapMode() ).Height() : 0;
- long aWidthOffSet = aHeightOffSet;
+ tools::Long aHeightOffSet = pDevice ? pDevice->PixelToLogic( Size( nBarW, nBarH ), pPreview->GetMapMode() ).Height() : 0;
+ tools::Long aWidthOffSet = aHeightOffSet;
if (!GetPageSize( aPageSize ))
return;
@@ -307,9 +307,9 @@ void ScPreviewShell::UpdateNeededScrollBars( bool bFromZoom )
}
// recalculate any needed scrollbars
- long nMaxWidthPos = aPageSize.Width() - aWindowSize.Width();
+ tools::Long nMaxWidthPos = aPageSize.Width() - aWindowSize.Width();
bHori = nMaxWidthPos >= 0;
- long nMaxHeightPos = aPageSize.Height() - aWindowSize.Height();
+ tools::Long nMaxHeightPos = aPageSize.Height() - aWindowSize.Height();
bVert = nMaxHeightPos >= 0;
// see if having a scroll bar requires the other
@@ -358,7 +358,7 @@ void ScPreviewShell::UpdateScrollBars()
pHorScroll->SetLineSize( aWindowSize.Width() / 16 );
pHorScroll->SetPageSize( aWindowSize.Width() );
pHorScroll->SetVisibleSize( aWindowSize.Width() );
- long nMaxPos = aPageSize.Width() - aWindowSize.Width();
+ tools::Long nMaxPos = aPageSize.Width() - aWindowSize.Width();
if ( nMaxPos<0 )
{
// page smaller than window -> center (but put scrollbar to 0)
@@ -383,8 +383,8 @@ void ScPreviewShell::UpdateScrollBars()
if( !pVerScroll )
return;
- long nPageNo = pPreview->GetPageNo();
- long nTotalPages = pPreview->GetTotalPages();
+ tools::Long nPageNo = pPreview->GetPageNo();
+ tools::Long nTotalPages = pPreview->GetTotalPages();
nMaxVertPos = aPageSize.Height() - aWindowSize.Height();
pVerScroll->SetLineSize( aWindowSize.Height() / 16 );
@@ -418,12 +418,12 @@ void ScPreviewShell::UpdateScrollBars()
IMPL_LINK( ScPreviewShell, ScrollHandler, ScrollBar*, pScroll, void )
{
- long nPos = pScroll->GetThumbPos();
- long nDelta = pScroll->GetDelta();
- long nMaxRange = pScroll->GetRangeMax();
- long nTotalPages = pPreview->GetTotalPages();
- long nPageNo = 0;
- long nPerPageLength = 0;
+ tools::Long nPos = pScroll->GetThumbPos();
+ tools::Long nDelta = pScroll->GetDelta();
+ tools::Long nMaxRange = pScroll->GetRangeMax();
+ tools::Long nTotalPages = pPreview->GetTotalPages();
+ tools::Long nPageNo = 0;
+ tools::Long nPerPageLength = 0;
bool bIsDivide = true;
if( nTotalPages )
@@ -498,12 +498,12 @@ bool ScPreviewShell::ScrollCommand( const CommandEvent& rCEvt )
const CommandWheelData* pData = rCEvt.GetWheelData();
if ( pData && pData->GetMode() == CommandWheelMode::ZOOM )
{
- long nOld = pPreview->GetZoom();
- long nNew;
+ tools::Long nOld = pPreview->GetZoom();
+ tools::Long nNew;
if ( pData->GetDelta() < 0 )
- nNew = std::max( long(MINZOOM), basegfx::zoomtools::zoomOut( nOld ));
+ nNew = std::max( tools::Long(MINZOOM), basegfx::zoomtools::zoomOut( nOld ));
else
- nNew = std::min( long(MAXZOOM), basegfx::zoomtools::zoomIn( nOld ));
+ nNew = std::min( tools::Long(MAXZOOM), basegfx::zoomtools::zoomIn( nOld ));
if ( nNew != nOld )
{
@@ -579,8 +579,8 @@ void ScPreviewShell::Execute( SfxRequest& rReq )
case SID_PREV_TABLE: // Accelerator
case SID_PREVIEW_PREVIOUS:
{
- long nPage = pPreview->GetPageNo();
- long nTotal = pPreview->GetTotalPages();
+ tools::Long nPage = pPreview->GetPageNo();
+ tools::Long nTotal = pPreview->GetTotalPages();
if (nTotal && nPage > 0)
pPreview->SetPageNo( nPage-1 );
}
@@ -589,8 +589,8 @@ void ScPreviewShell::Execute( SfxRequest& rReq )
case SID_PREVIEW_NEXT:
{
bool bAllTested = pPreview->AllTested();
- long nPage = pPreview->GetPageNo();
- long nTotal = pPreview->GetTotalPages();
+ tools::Long nPage = pPreview->GetPageNo();
+ tools::Long nTotal = pPreview->GetTotalPages();
if (nTotal && (nPage+1 < nTotal || !bAllTested))
pPreview->SetPageNo( nPage+1 );
}
@@ -598,8 +598,8 @@ void ScPreviewShell::Execute( SfxRequest& rReq )
case SID_CURSORTOPOFFILE: // Accelerator
case SID_PREVIEW_FIRST:
{
- long nPage = pPreview->GetPageNo();
- long nTotal = pPreview->GetTotalPages();
+ tools::Long nPage = pPreview->GetPageNo();
+ tools::Long nTotal = pPreview->GetTotalPages();
if (nTotal && nPage != 0)
pPreview->SetPageNo( 0 );
}
@@ -610,8 +610,8 @@ void ScPreviewShell::Execute( SfxRequest& rReq )
if (!pPreview->AllTested())
pPreview->CalcAll();
- long nPage = pPreview->GetPageNo();
- long nTotal = pPreview->GetTotalPages();
+ tools::Long nPage = pPreview->GetPageNo();
+ tools::Long nTotal = pPreview->GetTotalPages();
if (nTotal && nPage+1 != nTotal)
pPreview->SetPageNo( nTotal-1 );
}
@@ -771,8 +771,8 @@ void ScPreviewShell::GetState( SfxItemSet& rSet )
pPreview->SetInGetState(true);
SCTAB nTab = pPreview->GetTab();
- long nPage = pPreview->GetPageNo();
- long nTotal = pPreview->GetTotalPages();
+ tools::Long nPage = pPreview->GetPageNo();
+ tools::Long nTotal = pPreview->GetTotalPages();
sal_uInt16 nZoom = pPreview->GetZoom();
bool bAllTested = pPreview->AllTested();
@@ -973,26 +973,26 @@ void ScPreviewShell::DoScroll( sal_uInt16 nMode )
{
Point aCurPos, aPrevPos;
- long nHRange = pHorScroll->GetRange().Max();
- long nHLine = pHorScroll->GetLineSize();
- long nHPage = pHorScroll->GetPageSize();
- long nVRange = pVerScroll->GetRange().Max();
- long nVLine = pVerScroll->GetLineSize();
- long nVPage = pVerScroll->GetPageSize();
+ tools::Long nHRange = pHorScroll->GetRange().Max();
+ tools::Long nHLine = pHorScroll->GetLineSize();
+ tools::Long nHPage = pHorScroll->GetPageSize();
+ tools::Long nVRange = pVerScroll->GetRange().Max();
+ tools::Long nVLine = pVerScroll->GetLineSize();
+ tools::Long nVPage = pVerScroll->GetPageSize();
aCurPos.setX( pHorScroll->GetThumbPos() );
aCurPos.setY( pVerScroll->GetThumbPos() );
aPrevPos = aCurPos;
- long nThumbPos = pVerScroll->GetThumbPos();
- long nRangeMax = pVerScroll->GetRangeMax();
+ tools::Long nThumbPos = pVerScroll->GetThumbPos();
+ tools::Long nRangeMax = pVerScroll->GetRangeMax();
switch( nMode )
{
case SID_CURSORUP:
if( nMaxVertPos<0 )
{
- long nPage = pPreview->GetPageNo();
+ tools::Long nPage = pPreview->GetPageNo();
if( nPage>0 )
{
@@ -1007,8 +1007,8 @@ void ScPreviewShell::DoScroll( sal_uInt16 nMode )
case SID_CURSORDOWN:
if( nMaxVertPos<0 )
{
- long nPage = pPreview->GetPageNo();
- long nTotal = pPreview->GetTotalPages();
+ tools::Long nPage = pPreview->GetPageNo();
+ tools::Long nTotal = pPreview->GetTotalPages();
// before testing for last page, make sure all page counts are calculated
if ( nPage+1 == nTotal && !pPreview->AllTested() )
@@ -1036,7 +1036,7 @@ void ScPreviewShell::DoScroll( sal_uInt16 nMode )
case SID_CURSORPAGEUP:
if( nThumbPos==0 || nMaxVertPos<0 )
{
- long nPage = pPreview->GetPageNo();
+ tools::Long nPage = pPreview->GetPageNo();
if( nPage>0 )
{
@@ -1052,8 +1052,8 @@ void ScPreviewShell::DoScroll( sal_uInt16 nMode )
case SID_CURSORPAGEDOWN:
if( (std::abs(nVPage+nThumbPos-nRangeMax)<10) || nMaxVertPos<0 )
{
- long nPage = pPreview->GetPageNo();
- long nTotal = pPreview->GetTotalPages();
+ tools::Long nPage = pPreview->GetPageNo();
+ tools::Long nTotal = pPreview->GetTotalPages();
// before testing for last page, make sure all page counts are calculated
if ( nPage+1 == nTotal && !pPreview->AllTested() )
@@ -1075,8 +1075,8 @@ void ScPreviewShell::DoScroll( sal_uInt16 nMode )
case SID_CURSORHOME:
if( nMaxVertPos<0 )
{
- long nPage = pPreview->GetPageNo();
- long nTotal = pPreview->GetTotalPages();
+ tools::Long nPage = pPreview->GetPageNo();
+ tools::Long nTotal = pPreview->GetTotalPages();
if( nTotal && nPage != 0 )
{
SfxViewFrame* pSfxViewFrame = GetViewFrame();
@@ -1095,8 +1095,8 @@ void ScPreviewShell::DoScroll( sal_uInt16 nMode )
{
if( !pPreview->AllTested() )
pPreview->CalcAll();
- long nPage = pPreview->GetPageNo();
- long nTotal = pPreview->GetTotalPages();
+ tools::Long nPage = pPreview->GetPageNo();
+ tools::Long nTotal = pPreview->GetTotalPages();
if( nTotal && nPage+1 != nTotal )
{
SfxViewFrame* pSfxViewFrame = GetViewFrame();
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index ec875dea6c36..467ec9f43b73 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -146,7 +146,7 @@ size_t ScPageRowEntry::CountVisible() const
return nPagesX;
}
-static long lcl_LineTotal(const ::editeng::SvxBorderLine* pLine)
+static tools::Long lcl_LineTotal(const ::editeng::SvxBorderLine* pLine)
{
return pLine ? ( pLine->GetScaledWidth() ) : 0;
}
@@ -195,7 +195,7 @@ void ScPrintFunc::Construct( const ScPrintOptions* pOptions )
}
ScPrintFunc::ScPrintFunc( ScDocShell* pShell, SfxPrinter* pNewPrinter, SCTAB nTab,
- long nPage, long nDocP, const ScRange* pArea,
+ tools::Long nPage, tools::Long nDocP, const ScRange* pArea,
const ScPrintOptions* pOptions,
ScPageBreakData* pData )
: pDocShell ( pShell ),
@@ -265,7 +265,7 @@ ScPrintFunc::ScPrintFunc(ScDocShell* pShell, SfxPrinter* pNewPrinter,
}
ScPrintFunc::ScPrintFunc( OutputDevice* pOutDev, ScDocShell* pShell, SCTAB nTab,
- long nPage, long nDocP, const ScRange* pArea,
+ tools::Long nPage, tools::Long nDocP, const ScRange* pArea,
const ScPrintOptions* pOptions )
: pDocShell ( pShell ),
rDoc(pDocShell->GetDocument()),
@@ -507,13 +507,13 @@ void ScPrintFunc::DrawToDev(ScDocument& rDoc, OutputDevice* pDev, double /* nPri
if (nY1 > rDoc.MaxRow()) nY1 = rDoc.MaxRow();
if (nY2 > rDoc.MaxRow()) nY2 = rDoc.MaxRow();
- long nDevSizeX = aRect.Right()-aRect.Left()+1;
- long nDevSizeY = aRect.Bottom()-aRect.Top()+1;
+ tools::Long nDevSizeX = aRect.Right()-aRect.Left()+1;
+ tools::Long nDevSizeY = aRect.Bottom()-aRect.Top()+1;
- long nTwipsSizeX = 0;
+ tools::Long nTwipsSizeX = 0;
for (SCCOL i=nX1; i<=nX2; i++)
nTwipsSizeX += rDoc.GetColWidth( i, nTab );
- long nTwipsSizeY = static_cast<long>(rDoc.GetRowHeight( nY1, nY2, nTab ));
+ tools::Long nTwipsSizeY = static_cast<tools::Long>(rDoc.GetRowHeight( nY1, nY2, nTab ));
// if no lines, still space for the outline frame (20 Twips = 1pt)
// (HasLines initializes aLines to 0,0,0,0)
@@ -542,8 +542,8 @@ void ScPrintFunc::DrawToDev(ScDocument& rDoc, OutputDevice* pDev, double /* nPri
if (bEmbed)
rDoc.SetEmbedded(aERange);
- long nScrX = aRect.Left();
- long nScrY = aRect.Top();
+ tools::Long nScrX = aRect.Left();
+ tools::Long nScrY = aRect.Top();
// If no lines, still leave space for grid lines
// (would be elseways cut away)
@@ -576,8 +576,8 @@ void ScPrintFunc::DrawToDev(ScDocument& rDoc, OutputDevice* pDev, double /* nPri
aOutputData.SetSnapPixel();
Point aLogStart = pDev->PixelToLogic(Point(nScrX, nScrY), MapMode(MapUnit::Map100thMM));
- long nLogStX = aLogStart.X();
- long nLogStY = aLogStart.Y();
+ tools::Long nLogStX = aLogStart.X();
+ tools::Long nLogStY = aLogStart.Y();
//! nZoom for GetFont in OutputData ???
@@ -614,8 +614,8 @@ void ScPrintFunc::DrawToDev(ScDocument& rDoc, OutputDevice* pDev, double /* nPri
Size aOne = pDev->PixelToLogic( Size(1,1) );
if (bMetaFile)
aOne = Size(1,1); // compatible with DrawGrid
- long nRight = nScrX + aOutputData.GetScrW() - aOne.Width();
- long nBottom = nScrY + aOutputData.GetScrH() - aOne.Height();
+ tools::Long nRight = nScrX + aOutputData.GetScrW() - aOne.Width();
+ tools::Long nBottom = nScrY + aOutputData.GetScrH() - aOne.Height();
bool bLayoutRTL = rDoc.IsLayoutRTL( nTab );
@@ -654,7 +654,7 @@ static void lcl_FillHFParam( ScPrintHFParam& rParam, const SfxItemSet* pHFSet )
rParam.bShared = pHFSet->Get(ATTR_PAGE_SHARED).GetValue();
rParam.nHeight = pHFSet->Get(ATTR_PAGE_SIZE).GetSize().Height();
const SvxLRSpaceItem* pHFLR = &pHFSet->Get(ATTR_LRSPACE);
- long nTmp;
+ tools::Long nTmp;
nTmp = pHFLR->GetLeft();
rParam.nLeft = nTmp < 0 ? 0 : sal_uInt16(nTmp);
nTmp = pHFLR->GetRight();
@@ -763,14 +763,14 @@ bool ScPrintFunc::AdjustPrintArea( bool bNew )
return true;
}
-long ScPrintFunc::TextHeight( const EditTextObject* pObject )
+tools::Long ScPrintFunc::TextHeight( const EditTextObject* pObject )
{
if (!pObject)
return 0;
pEditEngine->SetTextNewDefaults( *pObject, *pEditDefaults, false );
- return static_cast<long>(pEditEngine->GetTextHeight());
+ return static_cast<tools::Long>(pEditEngine->GetTextHeight());
}
// nZoom must be set !!!
@@ -786,7 +786,7 @@ void ScPrintFunc::UpdateHFHeight( ScPrintHFParam& rParam )
// calculate nHeight from content
MakeEditEngine();
- long nPaperWidth = ( aPageSize.Width() - nLeftMargin - nRightMargin -
+ tools::Long nPaperWidth = ( aPageSize.Width() - nLeftMargin - nRightMargin -
rParam.nLeft - rParam.nRight ) * 100 / nZoom;
if (rParam.pBorder)
nPaperWidth -= ( rParam.pBorder->GetDistance(SvxBoxItemLine::LEFT) +
@@ -800,7 +800,7 @@ void ScPrintFunc::UpdateHFHeight( ScPrintHFParam& rParam )
pEditEngine->SetPaperSize( Size( nPaperWidth, 10000 ) );
- long nMaxHeight = 0;
+ tools::Long nMaxHeight = 0;
if ( rParam.pLeft )
{
nMaxHeight = std::max( nMaxHeight, TextHeight( rParam.pLeft->GetLeftArea() ) );
@@ -835,7 +835,7 @@ void ScPrintFunc::InitParam( const ScPrintOptions* pOptions )
// TabPage "Page"
const SvxLRSpaceItem* pLRItem = &pParamSet->Get( ATTR_LRSPACE );
- long nTmp;
+ tools::Long nTmp;
nTmp = pLRItem->GetLeft();
nLeftMargin = nTmp < 0 ? 0 : sal_uInt16(nTmp);
nTmp = pLRItem->GetRight();
@@ -1098,7 +1098,7 @@ Size ScPrintFunc::GetDataSize() const
return aSize;
}
-void ScPrintFunc::GetScaleData( Size& rPhysSize, long& rDocHdr, long& rDocFtr )
+void ScPrintFunc::GetScaleData( Size& rPhysSize, tools::Long& rDocHdr, tools::Long& rDocFtr )
{
rPhysSize = aPageSize;
rPhysSize.AdjustWidth( -(nLeftMargin + nRightMargin) );
@@ -1253,7 +1253,7 @@ static void lcl_DrawGraphic( const SvxBrushItem &rBrush, vcl::RenderContext *pOu
// The frame is drawn inwards
-void ScPrintFunc::DrawBorder( long nScrX, long nScrY, long nScrW, long nScrH,
+void ScPrintFunc::DrawBorder( tools::Long nScrX, tools::Long nScrY, tools::Long nScrW, tools::Long nScrH,
const SvxBoxItem* pBorderData, const SvxBrushItem* pBackground,
const SvxShadowItem* pShadow )
{
@@ -1267,18 +1267,18 @@ void ScPrintFunc::DrawBorder( long nScrX, long nScrY, long nScrW, long nScrH,
if (!pBorderData && !pBackground && !pShadow)
return; // nothing to do
- long nLeft = 0;
- long nRight = 0;
- long nTop = 0;
- long nBottom = 0;
+ tools::Long nLeft = 0;
+ tools::Long nRight = 0;
+ tools::Long nTop = 0;
+ tools::Long nBottom = 0;
// aFrameRect - outside around frame, without shadow
if ( pShadow && pShadow->GetLocation() != SvxShadowLocation::NONE )
{
- nLeft += static_cast<long>( pShadow->CalcShadowSpace(SvxShadowItemSide::LEFT) * nScaleX );
- nRight += static_cast<long>( pShadow->CalcShadowSpace(SvxShadowItemSide::RIGHT) * nScaleX );
- nTop += static_cast<long>( pShadow->CalcShadowSpace(SvxShadowItemSide::TOP) * nScaleY );
- nBottom += static_cast<long>( pShadow->CalcShadowSpace(SvxShadowItemSide::BOTTOM) * nScaleY );
+ nLeft += static_cast<tools::Long>( pShadow->CalcShadowSpace(SvxShadowItemSide::LEFT) * nScaleX );
+ nRight += static_cast<tools::Long>( pShadow->CalcShadowSpace(SvxShadowItemSide::RIGHT) * nScaleX );
+ nTop += static_cast<tools::Long>( pShadow->CalcShadowSpace(SvxShadowItemSide::TOP) * nScaleY );
+ nBottom += static_cast<tools::Long>( pShadow->CalcShadowSpace(SvxShadowItemSide::BOTTOM) * nScaleY );
}
tools::Rectangle aFrameRect( Point(nScrX+nLeft, nScrY+nTop),
Size(nScrW-nLeft-nRight, nScrH-nTop-nBottom) );
@@ -1286,13 +1286,13 @@ void ScPrintFunc::DrawBorder( long nScrX, long nScrY, long nScrW, long nScrH,
// center of frame, to paint lines through OutputData
if (pBorderData)
{
- nLeft += static_cast<long>( lcl_LineTotal(pBorderData->GetLeft()) * nScaleX / 2 );
- nRight += static_cast<long>( lcl_LineTotal(pBorderData->GetRight()) * nScaleX / 2 );
- nTop += static_cast<long>( lcl_LineTotal(pBorderData->GetTop()) * nScaleY / 2 );
- nBottom += static_cast<long>( lcl_LineTotal(pBorderData->GetBottom()) * nScaleY / 2 );
+ nLeft += static_cast<tools::Long>( lcl_LineTotal(pBorderData->GetLeft()) * nScaleX / 2 );
+ nRight += static_cast<tools::Long>( lcl_LineTotal(pBorderData->GetRight()) * nScaleX / 2 );
+ nTop += static_cast<tools::Long>( lcl_LineTotal(pBorderData->GetTop()) * nScaleY / 2 );
+ nBottom += static_cast<tools::Long>( lcl_LineTotal(pBorderData->GetBottom()) * nScaleY / 2 );
}
- long nEffHeight = nScrH - nTop - nBottom;
- long nEffWidth = nScrW - nLeft - nRight;
+ tools::Long nEffHeight = nScrH - nTop - nBottom;
+ tools::Long nEffWidth = nScrW - nLeft - nRight;
if (nEffHeight<=0 || nEffWidth<=0)
return; // empty
@@ -1323,8 +1323,8 @@ void ScPrintFunc::DrawBorder( long nScrX, long nScrY, long nScrW, long nScrH,
{
pDev->SetFillColor(pShadow->GetColor());
pDev->SetLineColor();
- long nShadowX = static_cast<long>( pShadow->GetWidth() * nScaleX );
- long nShadowY = static_cast<long>( pShadow->GetWidth() * nScaleY );
+ tools::Long nShadowX = static_cast<tools::Long>( pShadow->GetWidth() * nScaleX );
+ tools::Long nShadowY = static_cast<tools::Long>( pShadow->GetWidth() * nScaleY );
switch (pShadow->GetLocation())
{
case SvxShadowLocation::TopLeft:
@@ -1389,28 +1389,28 @@ void ScPrintFunc::DrawBorder( long nScrX, long nScrY, long nScrW, long nScrH,
aOutputData.DrawFrame(*pDev);
}
-void ScPrintFunc::PrintColHdr( SCCOL nX1, SCCOL nX2, long nScrX, long nScrY )
+void ScPrintFunc::PrintColHdr( SCCOL nX1, SCCOL nX2, tools::Long nScrX, tools::Long nScrY )
{
bool bLayoutRTL = rDoc.IsLayoutRTL( nPrintTab );
- long nLayoutSign = bLayoutRTL ? -1 : 1;
+ tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
Size aOnePixel = pDev->PixelToLogic(Size(1,1));
- long nOneX = aOnePixel.Width();
- long nOneY = aOnePixel.Height();
+ tools::Long nOneX = aOnePixel.Width();
+ tools::Long nOneY = aOnePixel.Height();
SCCOL nCol;
- long nHeight = static_cast<long>(PRINT_HEADER_HEIGHT * nScaleY);
- long nEndY = nScrY + nHeight - nOneY;
+ tools::Long nHeight = static_cast<tools::Long>(PRINT_HEADER_HEIGHT * nScaleY);
+ tools::Long nEndY = nScrY + nHeight - nOneY;
- long nPosX = nScrX;
+ tools::Long nPosX = nScrX;
if ( bLayoutRTL )
{
for (nCol=nX1; nCol<=nX2; nCol++)
- nPosX += static_cast<long>( rDoc.GetColWidth( nCol, nPrintTab ) * nScaleX );
+ nPosX += static_cast<tools::Long>( rDoc.GetColWidth( nCol, nPrintTab ) * nScaleX );
}
else
nPosX -= nOneX;
- long nPosY = nScrY - nOneY;
+ tools::Long nPosY = nScrY - nOneY;
OUString aText;
for (nCol=nX1; nCol<=nX2; nCol++)
@@ -1418,17 +1418,17 @@ void ScPrintFunc::PrintColHdr( SCCOL nX1, SCCOL nX2, long nScrX, long nScrY )
sal_uInt16 nDocW = rDoc.GetColWidth( nCol, nPrintTab );
if (nDocW)
{
- long nWidth = static_cast<long>(nDocW * nScaleX);
- long nEndX = nPosX + nWidth * nLayoutSign;
+ tools::Long nWidth = static_cast<tools::Long>(nDocW * nScaleX);
+ tools::Long nEndX = nPosX + nWidth * nLayoutSign;
pDev->DrawRect( tools::Rectangle( nPosX,nPosY,nEndX,nEndY ) );
aText = ::ScColToAlpha( nCol);
- long nTextWidth = pDev->GetTextWidth(aText);
- long nTextHeight = pDev->GetTextHeight();
- long nAddX = ( nWidth - nTextWidth ) / 2;
- long nAddY = ( nHeight - nTextHeight ) / 2;
- long nTextPosX = nPosX+nAddX;
+ tools::Long nTextWidth = pDev->GetTextWidth(aText);
+ tools::Long nTextHeight = pDev->GetTextHeight();
+ tools::Long nAddX = ( nWidth - nTextWidth ) / 2;
+ tools::Long nAddY = ( nHeight - nTextHeight ) / 2;
+ tools::Long nTextPosX = nPosX+nAddX;
if ( bLayoutRTL )
nTextPosX -= nWidth;
pDev->DrawText( Point( nTextPosX,nPosY+nAddY ), aText );
@@ -1438,23 +1438,23 @@ void ScPrintFunc::PrintColHdr( SCCOL nX1, SCCOL nX2, long nScrX, long nScrY )
}
}
-void ScPrintFunc::PrintRowHdr( SCROW nY1, SCROW nY2, long nScrX, long nScrY )
+void ScPrintFunc::PrintRowHdr( SCROW nY1, SCROW nY2, tools::Long nScrX, tools::Long nScrY )
{
Size aOnePixel = pDev->PixelToLogic(Size(1,1));
- long nOneX = aOnePixel.Width();
- long nOneY = aOnePixel.Height();
+ tools::Long nOneX = aOnePixel.Width();
+ tools::Long nOneY = aOnePixel.Height();
bool bLayoutRTL = rDoc.IsLayoutRTL( nPrintTab );
- long nWidth = static_cast<long>(PRINT_HEADER_WIDTH * nScaleX);
- long nEndX = nScrX + nWidth;
- long nPosX = nScrX;
+ tools::Long nWidth = static_cast<tools::Long>(PRINT_HEADER_WIDTH * nScaleX);
+ tools::Long nEndX = nScrX + nWidth;
+ tools::Long nPosX = nScrX;
if ( !bLayoutRTL )
{
nEndX -= nOneX;
nPosX -= nOneX;
}
- long nPosY = nScrY - nOneY;
+ tools::Long nPosY = nScrY - nOneY;
OUString aText;
for (SCROW nRow=nY1; nRow<=nY2; nRow++)
@@ -1462,16 +1462,16 @@ void ScPrintFunc::PrintRowHdr( SCROW nY1, SCROW nY2, long nScrX, long nScrY )
sal_uInt16 nDocH = rDoc.GetRowHeight( nRow, nPrintTab );
if (nDocH)
{
- long nHeight = static_cast<long>(nDocH * nScaleY);
- long nEndY = nPosY + nHeight;
+ tools::Long nHeight = static_cast<tools::Long>(nDocH * nScaleY);
+ tools::Long nEndY = nPosY + nHeight;
pDev->DrawRect( tools::Rectangle( nPosX,nPosY,nEndX,nEndY ) );
aText = OUString::number( nRow+1 );
- long nTextWidth = pDev->GetTextWidth(aText);
- long nTextHeight = pDev->GetTextHeight();
- long nAddX = ( nWidth - nTextWidth ) / 2;
- long nAddY = ( nHeight - nTextHeight ) / 2;
+ tools::Long nTextWidth = pDev->GetTextWidth(aText);
+ tools::Long nTextHeight = pDev->GetTextHeight();
+ tools::Long nAddX = ( nWidth - nTextWidth ) / 2;
+ tools::Long nAddY = ( nHeight - nTextHeight ) / 2;
pDev->DrawText( Point( nPosX+nAddX,nPosY+nAddY ), aText );
nPosY = nEndY;
@@ -1479,56 +1479,56 @@ void ScPrintFunc::PrintRowHdr( SCROW nY1, SCROW nY2, long nScrX, long nScrY )
}
}
-void ScPrintFunc::LocateColHdr( SCCOL nX1, SCCOL nX2, long nScrX, long nScrY,
+void ScPrintFunc::LocateColHdr( SCCOL nX1, SCCOL nX2, tools::Long nScrX, tools::Long nScrY,
bool bRepCol, ScPreviewLocationData& rLocationData )
{
Size aOnePixel = pDev->PixelToLogic(Size(1,1));
- long nOneX = aOnePixel.Width();
- long nOneY = aOnePixel.Height();
+ tools::Long nOneX = aOnePixel.Width();
+ tools::Long nOneY = aOnePixel.Height();
- long nHeight = static_cast<long>(PRINT_HEADER_HEIGHT * nScaleY);
- long nEndY = nScrY + nHeight - nOneY;
+ tools::Long nHeight = static_cast<tools::Long>(PRINT_HEADER_HEIGHT * nScaleY);
+ tools::Long nEndY = nScrY + nHeight - nOneY;
- long nPosX = nScrX - nOneX;
+ tools::Long nPosX = nScrX - nOneX;
for (SCCOL nCol=nX1; nCol<=nX2; nCol++)
{
sal_uInt16 nDocW = rDoc.GetColWidth( nCol, nPrintTab );
if (nDocW)
- nPosX += static_cast<long>(nDocW * nScaleX);
+ nPosX += static_cast<tools::Long>(nDocW * nScaleX);
}
tools::Rectangle aCellRect( nScrX, nScrY, nPosX, nEndY );
rLocationData.AddColHeaders( aCellRect, nX1, nX2, bRepCol );
}
-void ScPrintFunc::LocateRowHdr( SCROW nY1, SCROW nY2, long nScrX, long nScrY,
+void ScPrintFunc::LocateRowHdr( SCROW nY1, SCROW nY2, tools::Long nScrX, tools::Long nScrY,
bool bRepRow, ScPreviewLocationData& rLocationData )
{
Size aOnePixel = pDev->PixelToLogic(Size(1,1));
- long nOneX = aOnePixel.Width();
- long nOneY = aOnePixel.Height();
+ tools::Long nOneX = aOnePixel.Width();
+ tools::Long nOneY = aOnePixel.Height();
bool bLayoutRTL = rDoc.IsLayoutRTL( nPrintTab );
- long nWidth = static_cast<long>(PRINT_HEADER_WIDTH * nScaleX);
- long nEndX = nScrX + nWidth;
+ tools::Long nWidth = static_cast<tools::Long>(PRINT_HEADER_WIDTH * nScaleX);
+ tools::Long nEndX = nScrX + nWidth;
if ( !bLayoutRTL )
nEndX -= nOneX;
- long nPosY = nScrY - nOneY;
+ tools::Long nPosY = nScrY - nOneY;
nPosY += rDoc.GetScaledRowHeight( nY1, nY2, nPrintTab, nScaleY);
tools::Rectangle aCellRect( nScrX, nScrY, nEndX, nPosY );
rLocationData.AddRowHeaders( aCellRect, nY1, nY2, bRepRow );
}
void ScPrintFunc::LocateArea( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
- long nScrX, long nScrY, bool bRepCol, bool bRepRow,
+ tools::Long nScrX, tools::Long nScrY, bool bRepCol, bool bRepRow,
ScPreviewLocationData& rLocationData )
{
// get MapMode for drawing objects (same MapMode as in ScOutputData::PrintDrawingLayer)
Point aLogPos = OutputDevice::LogicToLogic(Point(nScrX,nScrY), aOffsetMode, aLogicMode);
- long nLogStX = aLogPos.X();
- long nLogStY = aLogPos.Y();
+ tools::Long nLogStX = aLogPos.X();
+ tools::Long nLogStY = aLogPos.Y();
SCCOL nCol;
Point aTwipOffset;
@@ -1537,26 +1537,26 @@ void ScPrintFunc::LocateArea( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
aTwipOffset.AdjustY( -sal_Int32(rDoc.GetRowHeight( 0, nY1-1, nPrintTab )) );
Point aMMOffset( aTwipOffset );
- aMMOffset.setX( static_cast<long>(aMMOffset.X() * HMM_PER_TWIPS) );
- aMMOffset.setY( static_cast<long>(aMMOffset.Y() * HMM_PER_TWIPS) );
+ aMMOffset.setX( static_cast<tools::Long>(aMMOffset.X() * HMM_PER_TWIPS) );
+ aMMOffset.setY( static_cast<tools::Long>(aMMOffset.Y() * HMM_PER_TWIPS) );
aMMOffset += Point( nLogStX, nLogStY );
MapMode aDrawMapMode( MapUnit::Map100thMM, aMMOffset, aLogicMode.GetScaleX(), aLogicMode.GetScaleY() );
// get pixel rectangle
Size aOnePixel = pDev->PixelToLogic(Size(1,1));
- long nOneX = aOnePixel.Width();
- long nOneY = aOnePixel.Height();
+ tools::Long nOneX = aOnePixel.Width();
+ tools::Long nOneY = aOnePixel.Height();
- long nPosX = nScrX - nOneX;
+ tools::Long nPosX = nScrX - nOneX;
for (nCol=nX1; nCol<=nX2; nCol++)
{
sal_uInt16 nDocW = rDoc.GetColWidth( nCol, nPrintTab );
if (nDocW)
- nPosX += static_cast<long>(nDocW * nScaleX);
+ nPosX += static_cast<tools::Long>(nDocW * nScaleX);
}
- long nPosY = nScrY - nOneY;
+ tools::Long nPosY = nScrY - nOneY;
nPosY += rDoc.GetScaledRowHeight( nY1, nY2, nPrintTab, nScaleY);
tools::Rectangle aCellRect( nScrX, nScrY, nPosX, nPosY );
rLocationData.AddCellRange( aCellRect, ScRange( nX1,nY1,nPrintTab, nX2,nY2,nPrintTab ),
@@ -1564,7 +1564,7 @@ void ScPrintFunc::LocateArea( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
}
void ScPrintFunc::PrintArea( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
- long nScrX, long nScrY,
+ tools::Long nScrX, tools::Long nScrY,
bool bShLeft, bool bShTop, bool bShRight, bool bShBottom )
{
// #i47547# nothing to do if the end of the print area is before the end of
@@ -1582,8 +1582,8 @@ void ScPrintFunc::PrintArea( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
}
Point aPos = OutputDevice::LogicToLogic(Point(nScrX,nScrY), aOffsetMode, aLogicMode);
- long nLogStX = aPos.X();
- long nLogStY = aPos.Y();
+ tools::Long nLogStX = aPos.X();
+ tools::Long nLogStY = aPos.Y();
// Assemble data
@@ -1670,12 +1670,12 @@ void ScPrintFunc::PrintArea( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
aOutputData.PostPrintDrawingLayer(aMMOffset); // #i74768#
}
-bool ScPrintFunc::IsMirror( long nPageNo ) // Mirror margins?
+bool ScPrintFunc::IsMirror( tools::Long nPageNo ) // Mirror margins?
{
return nPageUsage == SvxPageUsage::Mirror && (nPageNo & 1);
}
-bool ScPrintFunc::IsLeft( long nPageNo ) // left foot notes?
+bool ScPrintFunc::IsLeft( tools::Long nPageNo ) // left foot notes?
{
bool bLeft;
if (nPageUsage == SvxPageUsage::Left)
@@ -1734,7 +1734,7 @@ void ScPrintFunc::MakeEditEngine()
}
// nStartY = logic
-void ScPrintFunc::PrintHF( long nPageNo, bool bHeader, long nStartY,
+void ScPrintFunc::PrintHF( tools::Long nPageNo, bool bHeader, tools::Long nStartY,
bool bDoPrint, ScPreviewLocationData* pLocationData )
{
const ScPrintHFParam& rParam = bHeader ? aHdr : aFtr;
@@ -1744,9 +1744,9 @@ void ScPrintFunc::PrintHF( long nPageNo, bool bHeader, long nStartY,
bool bLeft = IsLeft(nPageNo) && !rParam.bShared;
const ScPageHFItem* pHFItem = bLeft ? rParam.pLeft : rParam.pRight;
- long nLineStartX = aPageRect.Left() + rParam.nLeft;
- long nLineEndX = aPageRect.Right() - rParam.nRight;
- long nLineWidth = nLineEndX - nLineStartX + 1;
+ tools::Long nLineStartX = aPageRect.Left() + rParam.nLeft;
+ tools::Long nLineEndX = aPageRect.Right() - rParam.nRight;
+ tools::Long nLineWidth = nLineEndX - nLineStartX + 1;
// Edit-Engine
@@ -1754,8 +1754,8 @@ void ScPrintFunc::PrintHF( long nPageNo, bool bHeader, long nStartY,
Size aPaperSize( nLineWidth, rParam.nHeight-rParam.nDistance );
if ( rParam.pBorder )
{
- long nLeft = lcl_LineTotal( rParam.pBorder->GetLeft() ) + rParam.pBorder->GetDistance(SvxBoxItemLine::LEFT);
- long nTop = lcl_LineTotal( rParam.pBorder->GetTop() ) + rParam.pBorder->GetDistance(SvxBoxItemLine::TOP);
+ tools::Long nLeft = lcl_LineTotal( rParam.pBorder->GetLeft() ) + rParam.pBorder->GetDistance(SvxBoxItemLine::LEFT);
+ tools::Long nTop = lcl_LineTotal( rParam.pBorder->GetTop() ) + rParam.pBorder->GetDistance(SvxBoxItemLine::TOP);
aStart.AdjustX(nLeft );
aStart.AdjustY(nTop );
aPaperSize.AdjustWidth( -(nLeft + lcl_LineTotal( rParam.pBorder->GetRight() ) + rParam.pBorder->GetDistance(SvxBoxItemLine::RIGHT)) );
@@ -1764,8 +1764,8 @@ void ScPrintFunc::PrintHF( long nPageNo, bool bHeader, long nStartY,
if ( rParam.pShadow && rParam.pShadow->GetLocation() != SvxShadowLocation::NONE )
{
- long nLeft = rParam.pShadow->CalcShadowSpace(SvxShadowItemSide::LEFT);
- long nTop = rParam.pShadow->CalcShadowSpace(SvxShadowItemSide::TOP);
+ tools::Long nLeft = rParam.pShadow->CalcShadowSpace(SvxShadowItemSide::LEFT);
+ tools::Long nTop = rParam.pShadow->CalcShadowSpace(SvxShadowItemSide::TOP);
aStart.AdjustX(nLeft );
aStart.AdjustY(nTop );
aPaperSize.AdjustWidth( -(nLeft + rParam.pShadow->CalcShadowSpace(SvxShadowItemSide::RIGHT)) );
@@ -1786,7 +1786,7 @@ void ScPrintFunc::PrintHF( long nPageNo, bool bHeader, long nStartY,
// adjust here again, for even/odd head-/footlines
// and probably other breaks by variable (page number etc.)
- long nMaxHeight = 0;
+ tools::Long nMaxHeight = 0;
nMaxHeight = std::max( nMaxHeight, TextHeight( pHFItem->GetLeftArea() ) );
nMaxHeight = std::max( nMaxHeight, TextHeight( pHFItem->GetCenterArea() ) );
nMaxHeight = std::max( nMaxHeight, TextHeight( pHFItem->GetRightArea() ) );
@@ -1827,7 +1827,7 @@ void ScPrintFunc::PrintHF( long nPageNo, bool bHeader, long nStartY,
pEditDefaults->Put( SvxAdjustItem( SvxAdjust::Left, EE_PARA_JUST ) );
pEditEngine->SetTextNewDefaults( *pObject, *pEditDefaults, false );
Point aDraw = aStart;
- long nDif = aPaperSize.Height() - static_cast<long>(pEditEngine->GetTextHeight());
+ tools::Long nDif = aPaperSize.Height() - static_cast<tools::Long>(pEditEngine->GetTextHeight());
if (nDif > 0)
aDraw.AdjustY(nDif / 2 );
pEditEngine->Draw( pDev, aDraw );
@@ -1841,7 +1841,7 @@ void ScPrintFunc::PrintHF( long nPageNo, bool bHeader, long nStartY,
pEditDefaults->Put( SvxAdjustItem( SvxAdjust::Center, EE_PARA_JUST ) );
pEditEngine->SetTextNewDefaults( *pObject, *pEditDefaults, false );
Point aDraw = aStart;
- long nDif = aPaperSize.Height() - static_cast<long>(pEditEngine->GetTextHeight());
+ tools::Long nDif = aPaperSize.Height() - static_cast<tools::Long>(pEditEngine->GetTextHeight());
if (nDif > 0)
aDraw.AdjustY(nDif / 2 );
pEditEngine->Draw( pDev, aDraw );
@@ -1855,7 +1855,7 @@ void ScPrintFunc::PrintHF( long nPageNo, bool bHeader, long nStartY,
pEditDefaults->Put( SvxAdjustItem( SvxAdjust::Right, EE_PARA_JUST ) );
pEditEngine->SetTextNewDefaults( *pObject, *pEditDefaults, false );
Point aDraw = aStart;
- long nDif = aPaperSize.Height() - static_cast<long>(pEditEngine->GetTextHeight());
+ tools::Long nDif = aPaperSize.Height() - static_cast<tools::Long>(pEditEngine->GetTextHeight());
if (nDif > 0)
aDraw.AdjustY(nDif / 2 );
pEditEngine->Draw( pDev, aDraw );
@@ -1871,7 +1871,7 @@ void ScPrintFunc::PrintHF( long nPageNo, bool bHeader, long nStartY,
}
}
-long ScPrintFunc::DoNotes( long nNoteStart, bool bDoPrint, ScPreviewLocationData* pLocationData )
+tools::Long ScPrintFunc::DoNotes( tools::Long nNoteStart, bool bDoPrint, ScPreviewLocationData* pLocationData )
{
if (bDoPrint)
pDev->SetMapMode(aTwipMode);
@@ -1884,7 +1884,7 @@ long ScPrintFunc::DoNotes( long nNoteStart, bool bDoPrint, ScPreviewLocationData
ScAutoFontColorMode eColorMode = bUseStyleColor ? SC_AUTOCOL_DISPLAY : SC_AUTOCOL_PRINT;
rDoc.GetPool()->GetDefaultItem(ATTR_PATTERN).GetFont( aMarkFont, eColorMode );
pDev->SetFont( aMarkFont );
- long nMarkLen = pDev->GetTextWidth("GW99999:");
+ tools::Long nMarkLen = pDev->GetTextWidth("GW99999:");
// without Space-Char, because it rarely arrives there
Size aDataSize = aPageRect.GetSize();
@@ -1893,11 +1893,11 @@ long ScPrintFunc::DoNotes( long nNoteStart, bool bDoPrint, ScPreviewLocationData
aDataSize.AdjustWidth( -nMarkLen );
pEditEngine->SetPaperSize( aDataSize );
- long nPosX = aPageRect.Left() + nMarkLen;
- long nPosY = aPageRect.Top();
+ tools::Long nPosX = aPageRect.Left() + nMarkLen;
+ tools::Long nPosY = aPageRect.Top();
- long nCount = 0;
- long nSize = aNotePosList.size();
+ tools::Long nCount = 0;
+ tools::Long nSize = aNotePosList.size();
bool bOk;
do
{
@@ -1910,7 +1910,7 @@ long ScPrintFunc::DoNotes( long nNoteStart, bool bDoPrint, ScPreviewLocationData
{
if(const EditTextObject *pEditText = pNote->GetEditTextObject())
pEditEngine->SetTextCurrentDefaults(*pEditText);
- long nTextHeight = pEditEngine->GetTextHeight();
+ tools::Long nTextHeight = pEditEngine->GetTextHeight();
if ( nPosY + nTextHeight < aPageRect.Bottom() )
{
if (bDoPrint)
@@ -1945,9 +1945,9 @@ long ScPrintFunc::DoNotes( long nNoteStart, bool bDoPrint, ScPreviewLocationData
return nCount;
}
-long ScPrintFunc::PrintNotes( long nPageNo, long nNoteStart, bool bDoPrint, ScPreviewLocationData* pLocationData )
+tools::Long ScPrintFunc::PrintNotes( tools::Long nPageNo, tools::Long nNoteStart, bool bDoPrint, ScPreviewLocationData* pLocationData )
{
- if ( nNoteStart >= static_cast<long>(aNotePosList.size()) || !aTableParam.bNotes )
+ if ( nNoteStart >= static_cast<tools::Long>(aNotePosList.size()) || !aTableParam.bNotes )
return 0;
if ( bDoPrint && bClearWin )
@@ -1962,8 +1962,8 @@ long ScPrintFunc::PrintNotes( long nPageNo, long nNoteStart, bool bDoPrint, ScPr
pDev->SetLineColor();
pDev->SetFillColor(aBackgroundColor);
pDev->DrawRect(tools::Rectangle(Point(),
- Size(static_cast<long>(aPageSize.Width() * nScaleX * 100 / nZoom),
- static_cast<long>(aPageSize.Height() * nScaleY * 100 / nZoom))));
+ Size(static_cast<tools::Long>(aPageSize.Width() * nScaleX * 100 / nZoom),
+ static_cast<tools::Long>(aPageSize.Height() * nScaleY * 100 / nZoom))));
}
// adjust aPageRect for left/right page
@@ -1991,17 +1991,17 @@ long ScPrintFunc::PrintNotes( long nPageNo, long nNoteStart, bool bDoPrint, ScPr
if (aHdr.bEnable)
{
- long nHeaderY = aPageRect.Top()-aHdr.nHeight;
+ tools::Long nHeaderY = aPageRect.Top()-aHdr.nHeight;
PrintHF( nPageNo, true, nHeaderY, bDoPrint, pLocationData );
}
if (aFtr.bEnable)
{
- long nFooterY = aPageRect.Bottom()+aFtr.nDistance;
+ tools::Long nFooterY = aPageRect.Bottom()+aFtr.nDistance;
PrintHF( nPageNo, false, nFooterY, bDoPrint, pLocationData );
}
}
- long nCount = DoNotes( nNoteStart, bDoPrint, pLocationData );
+ tools::Long nCount = DoNotes( nNoteStart, bDoPrint, pLocationData );
if ( pPrinter && bDoPrint )
{
@@ -2011,11 +2011,11 @@ long ScPrintFunc::PrintNotes( long nPageNo, long nNoteStart, bool bDoPrint, ScPr
return nCount;
}
-void ScPrintFunc::PrintPage( long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
+void ScPrintFunc::PrintPage( tools::Long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
bool bDoPrint, ScPreviewLocationData* pLocationData )
{
bool bLayoutRTL = rDoc.IsLayoutRTL( nPrintTab );
- long nLayoutSign = bLayoutRTL ? -1 : 1;
+ tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
// nPageNo is the page number within all sheets of one "start page" setting
@@ -2031,8 +2031,8 @@ void ScPrintFunc::PrintPage( long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, SCRO
pDev->SetLineColor();
pDev->SetFillColor(aBackgroundColor);
pDev->DrawRect(tools::Rectangle(Point(),
- Size(static_cast<long>(aPageSize.Width() * nScaleX * 100 / nZoom),
- static_cast<long>(aPageSize.Height() * nScaleY * 100 / nZoom))));
+ Size(static_cast<tools::Long>(aPageSize.Width() * nScaleX * 100 / nZoom),
+ static_cast<tools::Long>(aPageSize.Height() * nScaleY * 100 / nZoom))));
}
// adjust aPageRect for left/right page
@@ -2076,22 +2076,22 @@ void ScPrintFunc::PrintPage( long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, SCRO
if (aHdr.bEnable)
{
- long nHeaderY = aPageRect.Top()-aHdr.nHeight;
+ tools::Long nHeaderY = aPageRect.Top()-aHdr.nHeight;
PrintHF( nPageNo, true, nHeaderY, bDoPrint, pLocationData );
}
if (aFtr.bEnable)
{
- long nFooterY = aPageRect.Bottom()+aFtr.nDistance;
+ tools::Long nFooterY = aPageRect.Bottom()+aFtr.nDistance;
PrintHF( nPageNo, false, nFooterY, bDoPrint, pLocationData );
}
// Position ( margins / centering )
- long nLeftSpace = aPageRect.Left(); // Document-Twips
- long nTopSpace = aPageRect.Top();
+ tools::Long nLeftSpace = aPageRect.Left(); // Document-Twips
+ tools::Long nTopSpace = aPageRect.Top();
if ( bCenterHor || bLayoutRTL )
{
- long nDataWidth = 0;
+ tools::Long nDataWidth = 0;
SCCOL i;
for (i=nX1; i<=nX2; i++)
nDataWidth += rDoc.GetColWidth( i,nPrintTab );
@@ -2099,7 +2099,7 @@ void ScPrintFunc::PrintPage( long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, SCRO
for (i=nRepeatStartCol; i<=nRepeatEndCol; i++)
nDataWidth += rDoc.GetColWidth( i,nPrintTab );
if (aTableParam.bHeaders)
- nDataWidth += long(PRINT_HEADER_WIDTH);
+ nDataWidth += tools::Long(PRINT_HEADER_WIDTH);
if (pBorderItem)
nDataWidth += pBorderItem->GetDistance(SvxBoxItemLine::LEFT) +
pBorderItem->GetDistance(SvxBoxItemLine::RIGHT); //! Line width?
@@ -2117,12 +2117,12 @@ void ScPrintFunc::PrintPage( long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, SCRO
}
if ( bCenterVer )
{
- long nDataHeight = rDoc.GetRowHeight( nY1, nY2, nPrintTab);
+ tools::Long nDataHeight = rDoc.GetRowHeight( nY1, nY2, nPrintTab);
if (bDoRepRow)
nDataHeight += rDoc.GetRowHeight( nRepeatStartRow,
nRepeatEndRow, nPrintTab);
if (aTableParam.bHeaders)
- nDataHeight += long(PRINT_HEADER_HEIGHT);
+ nDataHeight += tools::Long(PRINT_HEADER_HEIGHT);
if (pBorderItem)
nDataHeight += pBorderItem->GetDistance(SvxBoxItemLine::TOP) +
pBorderItem->GetDistance(SvxBoxItemLine::BOTTOM); //! Line width?
@@ -2137,45 +2137,45 @@ void ScPrintFunc::PrintPage( long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, SCRO
// calculate sizes of the elements for partitioning
// (header, repeat, data)
- long nHeaderWidth = 0;
- long nHeaderHeight = 0;
- long nRepeatWidth = 0;
- long nRepeatHeight = 0;
- long nContentWidth = 0; // scaled - not the same as nDataWidth above
- long nContentHeight = 0;
+ tools::Long nHeaderWidth = 0;
+ tools::Long nHeaderHeight = 0;
+ tools::Long nRepeatWidth = 0;
+ tools::Long nRepeatHeight = 0;
+ tools::Long nContentWidth = 0; // scaled - not the same as nDataWidth above
+ tools::Long nContentHeight = 0;
if (aTableParam.bHeaders)
{
- nHeaderWidth = static_cast<long>(PRINT_HEADER_WIDTH * nScaleX);
- nHeaderHeight = static_cast<long>(PRINT_HEADER_HEIGHT * nScaleY);
+ nHeaderWidth = static_cast<tools::Long>(PRINT_HEADER_WIDTH * nScaleX);
+ nHeaderHeight = static_cast<tools::Long>(PRINT_HEADER_HEIGHT * nScaleY);
}
if (bDoRepCol)
for (SCCOL i=nRepeatStartCol; i<=nRepeatEndCol; i++)
- nRepeatWidth += static_cast<long>(rDoc.GetColWidth(i,nPrintTab) * nScaleX);
+ nRepeatWidth += static_cast<tools::Long>(rDoc.GetColWidth(i,nPrintTab) * nScaleX);
if (bDoRepRow)
nRepeatHeight += rDoc.GetScaledRowHeight( nRepeatStartRow,
nRepeatEndRow, nPrintTab, nScaleY);
for (SCCOL i=nX1; i<=nX2; i++)
- nContentWidth += static_cast<long>(rDoc.GetColWidth(i,nPrintTab) * nScaleX);
+ nContentWidth += static_cast<tools::Long>(rDoc.GetColWidth(i,nPrintTab) * nScaleX);
nContentHeight += rDoc.GetScaledRowHeight( nY1, nY2, nPrintTab,
nScaleY);
// partition the page
- long nStartX = static_cast<long>( nLeftSpace * nScaleX );
- long nStartY = static_cast<long>( nTopSpace * nScaleY );
- long nInnerStartX = nStartX;
- long nInnerStartY = nStartY;
+ tools::Long nStartX = static_cast<tools::Long>( nLeftSpace * nScaleX );
+ tools::Long nStartY = static_cast<tools::Long>( nTopSpace * nScaleY );
+ tools::Long nInnerStartX = nStartX;
+ tools::Long nInnerStartY = nStartY;
if (pBorderItem)
{
- nInnerStartX += static_cast<long>( ( lcl_LineTotal(pBorderItem->GetLeft()) +
+ nInnerStartX += static_cast<tools::Long>( ( lcl_LineTotal(pBorderItem->GetLeft()) +
pBorderItem->GetDistance(SvxBoxItemLine::LEFT) ) * nScaleX );
- nInnerStartY += static_cast<long>( ( lcl_LineTotal(pBorderItem->GetTop()) +
+ nInnerStartY += static_cast<tools::Long>( ( lcl_LineTotal(pBorderItem->GetTop()) +
pBorderItem->GetDistance(SvxBoxItemLine::TOP) ) * nScaleY );
}
if (pShadowItem && pShadowItem->GetLocation() != SvxShadowLocation::NONE)
{
- nInnerStartX += static_cast<long>( pShadowItem->CalcShadowSpace(SvxShadowItemSide::LEFT) * nScaleX );
- nInnerStartY += static_cast<long>( pShadowItem->CalcShadowSpace(SvxShadowItemSide::TOP) * nScaleY );
+ nInnerStartX += static_cast<tools::Long>( pShadowItem->CalcShadowSpace(SvxShadowItemSide::LEFT) * nScaleX );
+ nInnerStartY += static_cast<tools::Long>( pShadowItem->CalcShadowSpace(SvxShadowItemSide::TOP) * nScaleY );
}
if ( bLayoutRTL )
@@ -2185,21 +2185,21 @@ void ScPrintFunc::PrintPage( long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, SCRO
// make rounding easier so the elements are really next to each other in preview
Size aOffsetOnePixel = pDev->PixelToLogic( Size(1,1), aOffsetMode );
- long nOffsetOneX = aOffsetOnePixel.Width();
+ tools::Long nOffsetOneX = aOffsetOnePixel.Width();
nInnerStartX += nOffsetOneX / 2;
}
- long nFrameStartX = nInnerStartX;
- long nFrameStartY = nInnerStartY;
+ tools::Long nFrameStartX = nInnerStartX;
+ tools::Long nFrameStartY = nInnerStartY;
- long nRepStartX = nInnerStartX + nHeaderWidth * nLayoutSign; // widths/heights are 0 if not used
- long nRepStartY = nInnerStartY + nHeaderHeight;
- long nDataX = nRepStartX + nRepeatWidth * nLayoutSign;
- long nDataY = nRepStartY + nRepeatHeight;
- long nEndX = nDataX + nContentWidth * nLayoutSign;
- long nEndY = nDataY + nContentHeight;
- long nFrameEndX = nEndX;
- long nFrameEndY = nEndY;
+ tools::Long nRepStartX = nInnerStartX + nHeaderWidth * nLayoutSign; // widths/heights are 0 if not used
+ tools::Long nRepStartY = nInnerStartY + nHeaderHeight;
+ tools::Long nDataX = nRepStartX + nRepeatWidth * nLayoutSign;
+ tools::Long nDataY = nRepStartY + nRepeatHeight;
+ tools::Long nEndX = nDataX + nContentWidth * nLayoutSign;
+ tools::Long nEndY = nDataY + nContentHeight;
+ tools::Long nFrameEndX = nEndX;
+ tools::Long nFrameEndY = nEndY;
if ( bLayoutRTL )
{
@@ -2217,19 +2217,19 @@ void ScPrintFunc::PrintPage( long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, SCRO
//! adjust nEndX/Y
- long nBorderEndX = nEndX;
- long nBorderEndY = nEndY;
+ tools::Long nBorderEndX = nEndX;
+ tools::Long nBorderEndY = nEndY;
if (pBorderItem)
{
- nBorderEndX += static_cast<long>( ( lcl_LineTotal(pBorderItem->GetRight()) +
+ nBorderEndX += static_cast<tools::Long>( ( lcl_LineTotal(pBorderItem->GetRight()) +
pBorderItem->GetDistance(SvxBoxItemLine::RIGHT) ) * nScaleX );
- nBorderEndY += static_cast<long>( ( lcl_LineTotal(pBorderItem->GetBottom()) +
+ nBorderEndY += static_cast<tools::Long>( ( lcl_LineTotal(pBorderItem->GetBottom()) +
pBorderItem->GetDistance(SvxBoxItemLine::BOTTOM) ) * nScaleY );
}
if (pShadowItem && pShadowItem->GetLocation() != SvxShadowLocation::NONE)
{
- nBorderEndX += static_cast<long>( pShadowItem->CalcShadowSpace(SvxShadowItemSide::RIGHT) * nScaleX );
- nBorderEndY += static_cast<long>( pShadowItem->CalcShadowSpace(SvxShadowItemSide::BOTTOM) * nScaleY );
+ nBorderEndX += static_cast<tools::Long>( pShadowItem->CalcShadowSpace(SvxShadowItemSide::RIGHT) * nScaleX );
+ nBorderEndY += static_cast<tools::Long>( pShadowItem->CalcShadowSpace(SvxShadowItemSide::BOTTOM) * nScaleY );
}
if ( bDoPrint )
@@ -2329,13 +2329,13 @@ void ScPrintFunc::PrintPage( long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, SCRO
if ( bDoPrint && ( aTableParam.bGrid || aTableParam.bHeaders ) )
{
Size aOnePixel = pDev->PixelToLogic(Size(1,1));
- long nOneX = aOnePixel.Width();
- long nOneY = aOnePixel.Height();
+ tools::Long nOneX = aOnePixel.Width();
+ tools::Long nOneY = aOnePixel.Height();
- long nLeftX = nFrameStartX;
- long nTopY = nFrameStartY - nOneY;
- long nRightX = nFrameEndX;
- long nBottomY = nFrameEndY - nOneY;
+ tools::Long nLeftX = nFrameStartX;
+ tools::Long nTopY = nFrameStartY - nOneY;
+ tools::Long nRightX = nFrameEndX;
+ tools::Long nBottomY = nFrameEndY - nOneY;
if ( !bLayoutRTL )
{
nLeftX -= nOneX;
@@ -2430,7 +2430,7 @@ bool ScPrintFunc::UpdatePages()
return true;
}
-long ScPrintFunc::CountPages() // sets also nPagesX, nPagesY
+tools::Long ScPrintFunc::CountPages() // sets also nPagesX, nPagesY
{
bool bAreaOk = false;
@@ -2461,7 +2461,7 @@ long ScPrintFunc::CountPages() // sets also nPagesX, nP
if (bAreaOk)
{
- long nPages = 0;
+ tools::Long nPages = 0;
size_t nY;
if (bMultiArea)
{
@@ -2476,7 +2476,7 @@ long ScPrintFunc::CountPages() // sets also nPagesX, nP
nPages += m_aRanges.m_aPageRows[nY].CountVisible();
}
else
- nPages += static_cast<long>(m_aRanges.m_nPagesX) * m_aRanges.m_nPagesY;
+ nPages += static_cast<tools::Long>(m_aRanges.m_nPagesX) * m_aRanges.m_nPagesY;
if ( pPageData )
FillPageData();
}
@@ -2491,7 +2491,7 @@ long ScPrintFunc::CountPages() // sets also nPagesX, nP
nPages += m_aRanges.m_aPageRows[nY].CountVisible();
}
else
- nPages += static_cast<long>(m_aRanges.m_nPagesX) * m_aRanges.m_nPagesY;
+ nPages += static_cast<tools::Long>(m_aRanges.m_nPagesX) * m_aRanges.m_nPagesY;
if ( pPageData )
FillPageData();
}
@@ -2504,7 +2504,7 @@ long ScPrintFunc::CountPages() // sets also nPagesX, nP
}
}
-long ScPrintFunc::CountNotePages()
+tools::Long ScPrintFunc::CountNotePages()
{
if ( !aTableParam.bNotes || !bPrintCurrentTable )
return 0;
@@ -2552,9 +2552,9 @@ long ScPrintFunc::CountNotePages()
}
}
- long nPages = 0;
- long nNoteNr = 0;
- long nNoteAdd;
+ tools::Long nPages = 0;
+ tools::Long nNoteNr = 0;
+ tools::Long nNoteAdd;
do
{
nNoteAdd = PrintNotes( nPages, nNoteNr, false, nullptr );
@@ -2573,7 +2573,7 @@ void ScPrintFunc::InitModes() // set MapModes from nZoom etc.
{
aOffset = Point( aSrcOffset.X()*100/nZoom, aSrcOffset.Y()*100/nZoom );
- long nEffZoom = nZoom * static_cast<long>(nManualZoom);
+ tools::Long nEffZoom = nZoom * static_cast<tools::Long>(nManualZoom);
nScaleX = nScaleY = HMM_PER_TWIPS; // output in 1/100 mm
Fraction aZoomFract( nEffZoom,10000 );
@@ -2582,7 +2582,7 @@ void ScPrintFunc::InitModes() // set MapModes from nZoom etc.
if ( !pPrinter && !bIsRender ) // adjust scale for preview
{
double nFact = pDocShell->GetOutputFactor();
- aHorFract = Fraction( static_cast<long>( nEffZoom / nFact ), 10000 );
+ aHorFract = Fraction( static_cast<tools::Long>( nEffZoom / nFact ), 10000 );
}
aLogicMode = MapMode( MapUnit::Map100thMM, Point(), aHorFract, aZoomFract );
@@ -2590,7 +2590,7 @@ void ScPrintFunc::InitModes() // set MapModes from nZoom etc.
Point aLogicOfs( -aOffset.X(), -aOffset.Y() );
aOffsetMode = MapMode( MapUnit::Map100thMM, aLogicOfs, aHorFract, aZoomFract );
- Point aTwipsOfs( static_cast<long>( -aOffset.X() / nScaleX + 0.5 ), static_cast<long>( -aOffset.Y() / nScaleY + 0.5 ) );
+ Point aTwipsOfs( static_cast<tools::Long>( -aOffset.X() / nScaleX + 0.5 ), static_cast<tools::Long>( -aOffset.Y() / nScaleY + 0.5 ) );
aTwipMode = MapMode( MapUnit::MapTwip, aTwipsOfs, aHorFract, aZoomFract );
}
@@ -2609,7 +2609,7 @@ void ScPrintFunc::ApplyPrintSettings()
// landscape is always interpreted as a rotation by 90 degrees !
// this leads to non WYSIWIG but at least it prints!
// #i21775#
- long nTemp = aEnumSize.Width();
+ tools::Long nTemp = aEnumSize.Width();
aEnumSize.setWidth( aEnumSize.Height() );
aEnumSize.setHeight( nTemp );
}
@@ -2633,8 +2633,8 @@ void ScPrintFunc::ApplyPrintSettings()
// nStartPage = rPageRanges starts at nStartPage
// nDisplayStart = continuous number for displaying the page number
-long ScPrintFunc::DoPrint( const MultiSelection& rPageRanges,
- long nStartPage, long nDisplayStart, bool bDoPrint,
+tools::Long ScPrintFunc::DoPrint( const MultiSelection& rPageRanges,
+ tools::Long nStartPage, tools::Long nDisplayStart, bool bDoPrint,
ScPreviewLocationData* pLocationData )
{
OSL_ENSURE(pDev,"Device == NULL");
@@ -2653,9 +2653,9 @@ long ScPrintFunc::DoPrint( const MultiSelection& rPageRanges,
MakeTableString();
- long nPageNo = 0;
- long nPrinted = 0;
- long nEndPage = rPageRanges.GetTotalRange().Max();
+ tools::Long nPageNo = 0;
+ tools::Long nPrinted = 0;
+ tools::Long nEndPage = rPageRanges.GetTotalRange().Max();
sal_uInt16 nRepeats = 1;
if (bMultiArea)
@@ -2731,8 +2731,8 @@ long ScPrintFunc::DoPrint( const MultiSelection& rPageRanges,
aFieldData.aTabName = ScResId( STR_NOTES );
- long nNoteNr = 0;
- long nNoteAdd;
+ tools::Long nNoteNr = 0;
+ tools::Long nNoteAdd;
do
{
if ( nPageNo+nStartPage <= nEndPage )
@@ -2954,8 +2954,8 @@ Size ScPrintFunc::GetDocPageSize()
Size aDocPageSize = aPageRect.GetSize();
if (aTableParam.bHeaders)
{
- aDocPageSize.AdjustWidth( -(long(PRINT_HEADER_WIDTH)) );
- aDocPageSize.AdjustHeight( -(long(PRINT_HEADER_HEIGHT)) );
+ aDocPageSize.AdjustWidth( -(tools::Long(PRINT_HEADER_WIDTH)) );
+ aDocPageSize.AdjustHeight( -(tools::Long(PRINT_HEADER_HEIGHT)) );
}
if (pBorderItem)
{
diff --git a/sc/source/ui/view/reffact.cxx b/sc/source/ui/view/reffact.cxx
index 61db86ea000a..0133a9074a5f 100644
--- a/sc/source/ui/view/reffact.cxx
+++ b/sc/source/ui/view/reffact.cxx
@@ -118,10 +118,10 @@ IMPL_CONTROLLER_CHILD_CTOR( ScFormulaDlgWrapper, SID_OPENDLG_FUNCTION )
// ScSimpleRefDlgWrapper
static bool bScSimpleRefFlag;
-static long nScSimpleRefHeight;
-static long nScSimpleRefWidth;
-static long nScSimpleRefX;
-static long nScSimpleRefY;
+static tools::Long nScSimpleRefHeight;
+static tools::Long nScSimpleRefWidth;
+static tools::Long nScSimpleRefX;
+static tools::Long nScSimpleRefY;
static bool bAutoReOpen = true;
ScSimpleRefDlgWrapper::ScSimpleRefDlgWrapper( vcl::Window* pParentP,
diff --git a/sc/source/ui/view/select.cxx b/sc/source/ui/view/select.cxx
index 464c550909d3..0ef0e2059b2b 100644
--- a/sc/source/ui/view/select.cxx
+++ b/sc/source/ui/view/select.cxx
@@ -502,10 +502,10 @@ bool ScViewFunctionSet::SetCursorAtCell( SCCOL nPosX, SCROW nPosY, bool bScroll
{
// direction (left or top)
- long nSizeX = 0;
+ tools::Long nSizeX = 0;
for (SCCOL i=nPosX+1; i<=nEndX; i++)
nSizeX += rDoc.GetColWidth( i, nTab );
- long nSizeY = static_cast<long>(rDoc.GetRowHeight( nPosY+1, nEndY, nTab ));
+ tools::Long nSizeY = static_cast<tools::Long>(rDoc.GetRowHeight( nPosY+1, nEndY, nTab ));
SCCOL nDelStartX = nStartX;
SCROW nDelStartY = nStartY;
@@ -550,7 +550,7 @@ bool ScViewFunctionSet::SetCursorAtCell( SCCOL nPosX, SCROW nPosY, bool bScroll
bool bNegX = ( nPosX < nStartX );
bool bNegY = ( nPosY < nStartY );
- long nSizeX = 0;
+ tools::Long nSizeX = 0;
if ( bNegX )
{
// in SetCursorAtPoint hidden columns are skipped.
@@ -563,7 +563,7 @@ bool ScViewFunctionSet::SetCursorAtCell( SCCOL nPosX, SCROW nPosY, bool bScroll
for (SCCOL i=nEndX+1; i<=nPosX; i++)
nSizeX += rDoc.GetColWidth( i, nTab );
- long nSizeY = 0;
+ tools::Long nSizeY = 0;
if ( bNegY )
{
// in SetCursorAtPoint hidden rows are skipped.
diff --git a/sc/source/ui/view/tabsplit.cxx b/sc/source/ui/view/tabsplit.cxx
index 797c2e0844c5..8f0bd7a0e5af 100644
--- a/sc/source/ui/view/tabsplit.cxx
+++ b/sc/source/ui/view/tabsplit.cxx
@@ -71,8 +71,8 @@ void ScTabSplitter::Paint( vcl::RenderContext& rRenderContext, const tools::Rect
// Draw handle
rRenderContext.SetLineColor(COL_BLACK);
rRenderContext.SetFillColor(COL_BLACK);
- const long xc = rRect.Right() + rRect.Left();
- const long h4 = rRect.GetHeight() / 4;
+ const tools::Long xc = rRect.Right() + rRect.Left();
+ const tools::Long h4 = rRect.GetHeight() / 4;
// First xc fraction is truncated, second one is rounded. This will draw a centered line
// in handlers with odd width and a centered rectangle in those with even width.
rRenderContext.DrawRect(tools::Rectangle(Point(xc / 2, rRect.Top() + h4),
@@ -102,8 +102,8 @@ void ScTabSplitter::Paint( vcl::RenderContext& rRenderContext, const tools::Rect
// Draw handle
rRenderContext.SetLineColor(COL_BLACK);
rRenderContext.SetFillColor(COL_BLACK);
- const long yc = rRect.Top() + rRect.Bottom();
- const long w4 = rRect.GetWidth() / 4;
+ const tools::Long yc = rRect.Top() + rRect.Bottom();
+ const tools::Long w4 = rRect.GetWidth() / 4;
// First yc fraction is truncated, second one is rounded. This will draw a centered line
// in handlers with odd height and a centered rectangle in those with even height.
DrawRect(tools::Rectangle(Point(rRect.Left() + w4, yc / 2),
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 40a42ea8d86d..b0856d33343a 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -89,13 +89,13 @@ void ScCornerButton::Paint(vcl::RenderContext& rRenderContext, const tools::Rect
SetBackground(rStyleSettings.GetFaceColor());
Size aSize(GetOutputSizePixel());
- long nPosX = aSize.Width() - 1;
- long nPosY = aSize.Height() - 1;
+ tools::Long nPosX = aSize.Width() - 1;
+ tools::Long nPosY = aSize.Height() - 1;
Window::Paint(rRenderContext, rRect);
bool bLayoutRTL = pViewData->GetDocument().IsLayoutRTL( pViewData->GetTabNo() );
- long nDarkX = bLayoutRTL ? 0 : nPosX;
+ tools::Long nDarkX = bLayoutRTL ? 0 : nPosX;
// both buttons have the same look now - only dark right/bottom lines
rRenderContext.SetLineColor(rStyleSettings.GetDarkShadowColor());
@@ -219,7 +219,7 @@ ScTabView::ScTabView( vcl::Window* pParent, ScDocShell& rDocSh, ScTabViewShell*
Init();
}
-void ScTabView::InitScrollBar( ScrollBar& rScrollBar, long nMaxVal )
+void ScTabView::InitScrollBar( ScrollBar& rScrollBar, tools::Long nMaxVal )
{
rScrollBar.SetRange( Range( 0, nMaxVal ) );
rScrollBar.SetLineSize( 1 );
@@ -256,7 +256,7 @@ IMPL_LINK_NOARG(ScTabView, TimerHdl, Timer *, void)
// --- Resize ---------------------------------------------------------------------
static void lcl_SetPosSize( vcl::Window& rWindow, const Point& rPos, const Size& rSize,
- long nTotalWidth, bool bLayoutRTL )
+ tools::Long nTotalWidth, bool bLayoutRTL )
{
Point aNewPos = rPos;
if ( bLayoutRTL )
@@ -281,7 +281,7 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
RemoveHintWindow();
bool bLayoutRTL = aViewData.GetDocument().IsLayoutRTL( aViewData.GetTabNo() );
- long nTotalWidth = rSize.Width();
+ tools::Long nTotalWidth = rSize.Width();
if ( bLayoutRTL )
nTotalWidth += 2*rOffset.X();
@@ -296,17 +296,17 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
if ( aViewData.GetDocShell()->IsPreview() )
bHScroll = bVScroll = bTabControl = bHeaders = bHOutline = bVOutline = false;
- long nBarX = 0;
- long nBarY = 0;
- long nOutlineX = 0;
- long nOutlineY = 0;
- long nOutPosX;
- long nOutPosY;
+ tools::Long nBarX = 0;
+ tools::Long nBarY = 0;
+ tools::Long nOutlineX = 0;
+ tools::Long nOutlineY = 0;
+ tools::Long nOutPosX;
+ tools::Long nOutPosY;
- long nPosX = rOffset.X();
- long nPosY = rOffset.Y();
- long nSizeX = rSize.Width();
- long nSizeY = rSize.Height();
+ tools::Long nPosX = rOffset.X();
+ tools::Long nPosY = rOffset.Y();
+ tools::Long nSizeX = rSize.Width();
+ tools::Long nSizeY = rSize.Height();
bMinimized = ( nSizeX<=SC_ICONSIZE || nSizeY<=SC_ICONSIZE );
if ( bMinimized )
@@ -314,10 +314,10 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
float fScaleFactor = pFrameWin->GetDPIScaleFactor();
- long nSplitSizeX = SPLIT_HANDLE_SIZE * fScaleFactor;
+ tools::Long nSplitSizeX = SPLIT_HANDLE_SIZE * fScaleFactor;
if ( aViewData.GetHSplitMode() == SC_SPLIT_FIX )
nSplitSizeX = 1;
- long nSplitSizeY = SPLIT_HANDLE_SIZE * fScaleFactor;
+ tools::Long nSplitSizeY = SPLIT_HANDLE_SIZE * fScaleFactor;
if ( aViewData.GetVSplitMode() == SC_SPLIT_FIX )
nSplitSizeY = 1;
@@ -357,7 +357,7 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
if (bHScroll || bVScroll) // Scrollbars horizontal or vertical
{
- long nScrollBarSize = rStyleSettings.GetScrollBarSize();
+ tools::Long nScrollBarSize = rStyleSettings.GetScrollBarSize();
if (bVScroll)
{
nBarX = nScrollBarSize;
@@ -379,9 +379,9 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
if (bHScroll) // Scrollbars horizontal
{
- long nSizeLt = 0; // left scroll bar
- long nSizeRt = 0; // right scroll bar
- long nSizeSp = 0; // splitter
+ tools::Long nSizeLt = 0; // left scroll bar
+ tools::Long nSizeRt = 0; // right scroll bar
+ tools::Long nSizeSp = 0; // splitter
switch (aViewData.GetHSplitMode())
{
@@ -400,7 +400,7 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
}
nSizeRt = nSizeX - nSizeLt - nSizeSp;
- long nTabSize = 0;
+ tools::Long nTabSize = 0;
if (bTabControl)
{
@@ -477,9 +477,9 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
if (bVScroll)
{
- long nSizeUp = 0; // upper scroll bar
- long nSizeSp = 0; // splitter
- long nSizeDn; // lower scroll bar
+ tools::Long nSizeUp = 0; // upper scroll bar
+ tools::Long nSizeSp = 0; // splitter
+ tools::Long nSizeDn; // lower scroll bar
switch (aViewData.GetVSplitMode())
{
@@ -523,9 +523,9 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
nBarY = aHScrollLeft->GetSizePixel().Height();
nBarX = aVScrollBottom->GetSizePixel().Width();
- long nSize1 = nSizeX;
+ tools::Long nSize1 = nSizeX;
- long nTabSize = nSize1;
+ tools::Long nTabSize = nSize1;
if (nTabSize < 0) nTabSize = 0;
lcl_SetPosSize( *pTabControl, Point(nPosX, nPosY+nSizeY-nBarY),
@@ -573,16 +573,16 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
// evaluate splitter
- long nLeftSize = nSizeX;
- long nRightSize = 0;
- long nTopSize = 0;
- long nBottomSize = nSizeY;
- long nSplitPosX = nPosX;
- long nSplitPosY = nPosY;
+ tools::Long nLeftSize = nSizeX;
+ tools::Long nRightSize = 0;
+ tools::Long nTopSize = 0;
+ tools::Long nBottomSize = nSizeY;
+ tools::Long nSplitPosX = nPosX;
+ tools::Long nSplitPosY = nPosY;
if ( aViewData.GetHSplitMode() != SC_SPLIT_NONE )
{
- long nSplitHeight = rSize.Height();
+ tools::Long nSplitHeight = rSize.Height();
if ( aViewData.GetHSplitMode() == SC_SPLIT_FIX )
{
// Do not allow freeze splitter to overlap scroll bar/tab bar
@@ -601,7 +601,7 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
}
if ( aViewData.GetVSplitMode() != SC_SPLIT_NONE )
{
- long nSplitWidth = rSize.Width();
+ tools::Long nSplitWidth = rSize.Width();
if ( aViewData.GetVSplitMode() == SC_SPLIT_FIX && bVScroll )
nSplitWidth -= aVScrollBottom->GetSizePixel().Width();
nSplitPosY = aViewData.GetVSplitPos();
@@ -688,7 +688,7 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
if (bInner)
{
- long nInnerPosX = bLayoutRTL ? ( nTotalWidth - nPosX - nLeftSize ) : nPosX;
+ tools::Long nInnerPosX = bLayoutRTL ? ( nTotalWidth - nPosX - nLeftSize ) : nPosX;
pGridWin[SC_SPLIT_BOTTOMLEFT]->SetPosPixel( Point(nInnerPosX,nSplitPosY) );
}
else
@@ -736,7 +736,7 @@ void ScTabView::UpdateVarZoom()
bInZoomUpdate = true;
const Fraction& rOldX = GetViewData().GetZoomX();
const Fraction& rOldY = GetViewData().GetZoomY();
- long nOldPercent = long(rOldY * 100);
+ tools::Long nOldPercent = tools::Long(rOldY * 100);
sal_uInt16 nNewZoom = CalcZoom( eZoomType, static_cast<sal_uInt16>(nOldPercent) );
Fraction aNew( nNewZoom, 100 );
@@ -827,11 +827,11 @@ IMPL_LINK_NOARG(ScTabView, TabBarResize, TabBar*, void)
if (!aViewData.IsHScrollMode())
return;
- long nSize = pTabControl->GetSplitSize();
+ tools::Long nSize = pTabControl->GetSplitSize();
if (aViewData.GetHSplitMode() != SC_SPLIT_FIX)
{
- long nMax = pHSplitter->GetPosPixel().X();
+ tools::Long nMax = pHSplitter->GetPosPixel().X();
if( pTabControl->IsEffectiveRTL() )
nMax = pFrameWin->GetSizePixel().Width() - nMax;
--nMax;
@@ -846,7 +846,7 @@ IMPL_LINK_NOARG(ScTabView, TabBarResize, TabBar*, void)
}
}
-void ScTabView::SetTabBarWidth( long nNewWidth )
+void ScTabView::SetTabBarWidth( tools::Long nNewWidth )
{
Size aSize = pTabControl->GetSizePixel();
@@ -860,8 +860,8 @@ void ScTabView::SetTabBarWidth( long nNewWidth )
void ScTabView::SetRelTabBarWidth( double fRelTabBarWidth )
{
if( (0.0 <= fRelTabBarWidth) && (fRelTabBarWidth <= 1.0) )
- if( long nFrameWidth = pFrameWin->GetSizePixel().Width() )
- SetTabBarWidth( static_cast< long >( fRelTabBarWidth * nFrameWidth + 0.5 ) );
+ if( tools::Long nFrameWidth = pFrameWin->GetSizePixel().Width() )
+ SetTabBarWidth( static_cast< tools::Long >( fRelTabBarWidth * nFrameWidth + 0.5 ) );
}
void ScTabView::SetPendingRelTabBarWidth( double fRelTabBarWidth )
@@ -870,7 +870,7 @@ void ScTabView::SetPendingRelTabBarWidth( double fRelTabBarWidth )
SetRelTabBarWidth( fRelTabBarWidth );
}
-long ScTabView::GetTabBarWidth() const
+tools::Long ScTabView::GetTabBarWidth() const
{
return pTabControl->GetSizePixel().Width();
}
@@ -955,12 +955,12 @@ bool ScTabView::ScrollCommand( const CommandEvent& rCEvt, ScSplitPos ePos )
// and can't be changed directly
const Fraction& rOldY = aViewData.GetZoomY();
- long nOld = static_cast<long>( rOldY * 100 );
- long nNew;
+ tools::Long nOld = static_cast<tools::Long>( rOldY * 100 );
+ tools::Long nNew;
if ( pData->GetDelta() < 0 )
- nNew = std::max( long(MINZOOM), basegfx::zoomtools::zoomOut( nOld ));
+ nNew = std::max( tools::Long(MINZOOM), basegfx::zoomtools::zoomOut( nOld ));
else
- nNew = std::min( long(MAXZOOM), basegfx::zoomtools::zoomIn( nOld ));
+ nNew = std::min( tools::Long(MAXZOOM), basegfx::zoomtools::zoomIn( nOld ));
if ( nNew != nOld )
{
// scroll wheel doesn't set the AppOptions default
@@ -1003,7 +1003,7 @@ IMPL_LINK_NOARG(ScTabView, EndScrollHdl, ScrollBar*, void)
IMPL_LINK( ScTabView, ScrollHdl, ScrollBar*, pScroll, void )
{
bool bHoriz = ( pScroll == aHScrollLeft.get() || pScroll == aHScrollRight.get() );
- long nViewPos;
+ tools::Long nViewPos;
if ( bHoriz )
nViewPos = aViewData.GetPosX( (pScroll == aHScrollLeft.get()) ?
SC_SPLIT_LEFT : SC_SPLIT_RIGHT );
@@ -1044,12 +1044,12 @@ IMPL_LINK( ScTabView, ScrollHdl, ScrollBar*, pScroll, void )
Point aPos = pScroll->OutputToNormalizedScreenPixel( Point() );
// get scrollbar scroll position for help text (row number/column name)
- long nScrollMin = 0; // simulate RangeMin
+ tools::Long nScrollMin = 0; // simulate RangeMin
if ( aViewData.GetHSplitMode()==SC_SPLIT_FIX && pScroll == aHScrollRight.get() )
nScrollMin = aViewData.GetFixPosX();
if ( aViewData.GetVSplitMode()==SC_SPLIT_FIX && pScroll == aVScrollBottom.get() )
nScrollMin = aViewData.GetFixPosY();
- long nScrollPos = GetScrollBarPos( *pScroll ) + nScrollMin;
+ tools::Long nScrollPos = GetScrollBarPos( *pScroll ) + nScrollMin;
OUString aHelpStr;
tools::Rectangle aRect;
@@ -1080,7 +1080,7 @@ IMPL_LINK( ScTabView, ScrollHdl, ScrollBar*, pScroll, void )
}
}
- long nDelta = pScroll->GetDelta();
+ tools::Long nDelta = pScroll->GetDelta();
switch ( eType )
{
case ScrollType::LineUp:
@@ -1090,10 +1090,10 @@ IMPL_LINK( ScTabView, ScrollHdl, ScrollBar*, pScroll, void )
nDelta = 1;
break;
case ScrollType::PageUp:
- if ( pScroll == aHScrollLeft.get() ) nDelta = -static_cast<long>(aViewData.PrevCellsX( SC_SPLIT_LEFT ));
- if ( pScroll == aHScrollRight.get() ) nDelta = -static_cast<long>(aViewData.PrevCellsX( SC_SPLIT_RIGHT ));
- if ( pScroll == aVScrollTop.get() ) nDelta = -static_cast<long>(aViewData.PrevCellsY( SC_SPLIT_TOP ));
- if ( pScroll == aVScrollBottom.get() ) nDelta = -static_cast<long>(aViewData.PrevCellsY( SC_SPLIT_BOTTOM ));
+ if ( pScroll == aHScrollLeft.get() ) nDelta = -static_cast<tools::Long>(aViewData.PrevCellsX( SC_SPLIT_LEFT ));
+ if ( pScroll == aHScrollRight.get() ) nDelta = -static_cast<tools::Long>(aViewData.PrevCellsX( SC_SPLIT_RIGHT ));
+ if ( pScroll == aVScrollTop.get() ) nDelta = -static_cast<tools::Long>(aViewData.PrevCellsY( SC_SPLIT_TOP ));
+ if ( pScroll == aVScrollBottom.get() ) nDelta = -static_cast<tools::Long>(aViewData.PrevCellsY( SC_SPLIT_BOTTOM ));
if (nDelta==0) nDelta=-1;
break;
case ScrollType::PageDown:
@@ -1106,13 +1106,13 @@ IMPL_LINK( ScTabView, ScrollHdl, ScrollBar*, pScroll, void )
case ScrollType::Drag:
{
// only scroll in the correct direction, do not jitter around hidden ranges
- long nScrollMin = 0; // simulate RangeMin
+ tools::Long nScrollMin = 0; // simulate RangeMin
if ( aViewData.GetHSplitMode()==SC_SPLIT_FIX && pScroll == aHScrollRight.get() )
nScrollMin = aViewData.GetFixPosX();
if ( aViewData.GetVSplitMode()==SC_SPLIT_FIX && pScroll == aVScrollBottom.get() )
nScrollMin = aViewData.GetFixPosY();
- long nScrollPos = GetScrollBarPos( *pScroll ) + nScrollMin;
+ tools::Long nScrollPos = GetScrollBarPos( *pScroll ) + nScrollMin;
nDelta = nScrollPos - nViewPos;
if ( nScrollPos > nPrevDragPos )
{
@@ -1143,7 +1143,7 @@ IMPL_LINK( ScTabView, ScrollHdl, ScrollBar*, pScroll, void )
}
}
-void ScTabView::ScrollX( long nDeltaX, ScHSplitPos eWhich, bool bUpdBars )
+void ScTabView::ScrollX( tools::Long nDeltaX, ScHSplitPos eWhich, bool bUpdBars )
{
ScDocument& rDoc = aViewData.GetDocument();
SCCOL nOldX = aViewData.GetPosX(eWhich);
@@ -1194,9 +1194,9 @@ void ScTabView::ScrollX( long nDeltaX, ScHSplitPos eWhich, bool bUpdBars )
if (pColBar[eWhich])
pColBar[eWhich]->PaintImmediately();
- long nOldPos = aViewData.GetScrPos( nTrackX, 0, eWhich ).X();
+ tools::Long nOldPos = aViewData.GetScrPos( nTrackX, 0, eWhich ).X();
aViewData.SetPosX( eWhich, nNewX );
- long nDiff = aViewData.GetScrPos( nTrackX, 0, eWhich ).X() - nOldPos;
+ tools::Long nDiff = aViewData.GetScrPos( nTrackX, 0, eWhich ).X() - nOldPos;
if ( eWhich==SC_SPLIT_LEFT )
{
@@ -1226,7 +1226,7 @@ void ScTabView::ScrollX( long nDeltaX, ScHSplitPos eWhich, bool bUpdBars )
TestHintWindow();
}
-void ScTabView::ScrollY( long nDeltaY, ScVSplitPos eWhich, bool bUpdBars )
+void ScTabView::ScrollY( tools::Long nDeltaY, ScVSplitPos eWhich, bool bUpdBars )
{
ScDocument& rDoc = aViewData.GetDocument();
SCROW nOldY = aViewData.GetPosY(eWhich);
@@ -1278,9 +1278,9 @@ void ScTabView::ScrollY( long nDeltaY, ScVSplitPos eWhich, bool bUpdBars )
if (pRowBar[eWhich])
pRowBar[eWhich]->PaintImmediately();
- long nOldPos = aViewData.GetScrPos( 0, nTrackY, eWhich ).Y();
+ tools::Long nOldPos = aViewData.GetScrPos( 0, nTrackY, eWhich ).Y();
aViewData.SetPosY( eWhich, nNewY );
- long nDiff = aViewData.GetScrPos( 0, nTrackY, eWhich ).Y() - nOldPos;
+ tools::Long nDiff = aViewData.GetScrPos( 0, nTrackY, eWhich ).Y() - nOldPos;
if ( eWhich==SC_SPLIT_TOP )
{
@@ -1310,7 +1310,7 @@ void ScTabView::ScrollY( long nDeltaY, ScVSplitPos eWhich, bool bUpdBars )
TestHintWindow();
}
-void ScTabView::ScrollLines( long nDeltaX, long nDeltaY )
+void ScTabView::ScrollLines( tools::Long nDeltaX, tools::Long nDeltaY )
{
ScSplitPos eWhich = aViewData.GetActivePart();
if (nDeltaX)
@@ -1373,15 +1373,15 @@ void ScTabView::UpdateHeaderWidth( const ScVSplitPos* pWhich, const SCROW* pPosY
}
}
- long nSmall = pRowBar[SC_SPLIT_BOTTOM]->GetSmallWidth();
- long nBig = pRowBar[SC_SPLIT_BOTTOM]->GetBigWidth();
- long nDiff = nBig - nSmall;
+ tools::Long nSmall = pRowBar[SC_SPLIT_BOTTOM]->GetSmallWidth();
+ tools::Long nBig = pRowBar[SC_SPLIT_BOTTOM]->GetBigWidth();
+ tools::Long nDiff = nBig - nSmall;
if (nEndPos>10000)
nEndPos = 10000;
else if (nEndPos<1) // avoid extra step at 0 (when only one row is visible)
nEndPos = 1;
- long nWidth = nBig - ( 10000 - nEndPos ) * nDiff / 10000;
+ tools::Long nWidth = nBig - ( 10000 - nEndPos ) * nDiff / 10000;
if (nWidth == pRowBar[SC_SPLIT_BOTTOM]->GetWidth() || bInUpdateHeader)
return;
@@ -1518,7 +1518,7 @@ IMPL_LINK( ScTabView, SplitHdl, Splitter*, pSplitter, void )
DoResize( aBorderPos, aFrameSize );
}
-void ScTabView::DoHSplit(long nSplitPos)
+void ScTabView::DoHSplit(tools::Long nSplitPos)
{
// nSplitPos is the real pixel position on the frame window,
// mirroring for RTL has to be done here.
@@ -1527,8 +1527,8 @@ void ScTabView::DoHSplit(long nSplitPos)
if ( bLayoutRTL )
nSplitPos = pFrameWin->GetOutputSizePixel().Width() - nSplitPos - 1;
- long nMinPos;
- long nMaxPos;
+ tools::Long nMinPos;
+ tools::Long nMaxPos;
nMinPos = SPLIT_MARGIN;
if ( pRowBar[SC_SPLIT_BOTTOM] && pRowBar[SC_SPLIT_BOTTOM]->GetSizePixel().Width() >= nMinPos )
@@ -1559,7 +1559,7 @@ void ScTabView::DoHSplit(long nSplitPos)
else
{
SCCOL nOldDelta = aViewData.GetPosX( SC_SPLIT_LEFT );
- long nLeftWidth = nSplitPos - pRowBar[SC_SPLIT_BOTTOM]->GetSizePixel().Width();
+ tools::Long nLeftWidth = nSplitPos - pRowBar[SC_SPLIT_BOTTOM]->GetSizePixel().Width();
if ( nLeftWidth < 0 ) nLeftWidth = 0;
SCCOL nNewDelta = nOldDelta + aViewData.CellsAtX( nOldDelta, 1, SC_SPLIT_LEFT,
static_cast<sal_uInt16>(nLeftWidth) );
@@ -1588,10 +1588,10 @@ void ScTabView::DoHSplit(long nSplitPos)
InvalidateSplit();
}
-void ScTabView::DoVSplit(long nSplitPos)
+void ScTabView::DoVSplit(tools::Long nSplitPos)
{
- long nMinPos;
- long nMaxPos;
+ tools::Long nMinPos;
+ tools::Long nMaxPos;
SCROW nOldDelta;
nMinPos = SPLIT_MARGIN;
@@ -1631,7 +1631,7 @@ void ScTabView::DoVSplit(long nSplitPos)
nOldDelta = aViewData.GetPosY( SC_SPLIT_TOP );
aViewData.SetPosY( SC_SPLIT_TOP, nOldDelta );
- long nTopHeight = nSplitPos - pColBar[SC_SPLIT_LEFT]->GetSizePixel().Height();
+ tools::Long nTopHeight = nSplitPos - pColBar[SC_SPLIT_LEFT]->GetSizePixel().Height();
if ( nTopHeight < 0 ) nTopHeight = 0;
SCROW nNewDelta = nOldDelta + aViewData.CellsAtY( nOldDelta, 1, SC_SPLIT_TOP,
static_cast<sal_uInt16>(nTopHeight) );
@@ -1666,23 +1666,23 @@ Point ScTabView::GetInsertPos() const
SCCOL nCol = aViewData.GetCurX();
SCROW nRow = aViewData.GetCurY();
SCTAB nTab = aViewData.GetTabNo();
- long nPosX = 0;
+ tools::Long nPosX = 0;
for (SCCOL i=0; i<nCol; i++)
nPosX += rDoc.GetColWidth(i,nTab);
- nPosX = static_cast<long>(nPosX * HMM_PER_TWIPS);
+ nPosX = static_cast<tools::Long>(nPosX * HMM_PER_TWIPS);
if ( rDoc.IsNegativePage( nTab ) )
nPosX = -nPosX;
- long nPosY = static_cast<long>(rDoc.GetRowHeight( 0, nRow-1, nTab));
- nPosY = static_cast<long>(nPosY * HMM_PER_TWIPS);
+ tools::Long nPosY = static_cast<tools::Long>(rDoc.GetRowHeight( 0, nRow-1, nTab));
+ nPosY = static_cast<tools::Long>(nPosY * HMM_PER_TWIPS);
return Point(nPosX,nPosY);
}
Point ScTabView::GetChartInsertPos( const Size& rSize, const ScRange& rCellRange )
{
Point aInsertPos;
- const long nBorder = 100; // leave 1mm for border
- long nNeededWidth = rSize.Width() + 2 * nBorder;
- long nNeededHeight = rSize.Height() + 2 * nBorder;
+ const tools::Long nBorder = 100; // leave 1mm for border
+ tools::Long nNeededWidth = rSize.Width() + 2 * nBorder;
+ tools::Long nNeededHeight = rSize.Height() + 2 * nBorder;
// use the active window, or lower/right if frozen (as in CalcZoom)
ScSplitPos eUsedPart = aViewData.GetActivePart();
@@ -1705,10 +1705,10 @@ Point ScTabView::GetChartInsertPos( const Size& rSize, const ScRange& rCellRange
ScDocument& rDoc = aViewData.GetDocument();
SCTAB nTab = aViewData.GetTabNo();
bool bLayoutRTL = rDoc.IsLayoutRTL( nTab );
- long nLayoutSign = bLayoutRTL ? -1 : 1;
+ tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
- long nDocX = static_cast<long>( static_cast<double>(rDoc.GetColOffset( rDoc.MaxCol() + 1, nTab )) * HMM_PER_TWIPS ) * nLayoutSign;
- long nDocY = static_cast<long>( static_cast<double>(rDoc.GetRowOffset( rDoc.MaxRow() + 1, nTab )) * HMM_PER_TWIPS );
+ tools::Long nDocX = static_cast<tools::Long>( static_cast<double>(rDoc.GetColOffset( rDoc.MaxCol() + 1, nTab )) * HMM_PER_TWIPS ) * nLayoutSign;
+ tools::Long nDocY = static_cast<tools::Long>( static_cast<double>(rDoc.GetRowOffset( rDoc.MaxRow() + 1, nTab )) * HMM_PER_TWIPS );
if ( aVisible.Left() * nLayoutSign > nDocX * nLayoutSign )
aVisible.SetLeft( nDocX );
@@ -1724,10 +1724,10 @@ Point ScTabView::GetChartInsertPos( const Size& rSize, const ScRange& rCellRange
tools::Rectangle aSelection = rDoc.GetMMRect( rCellRange.aStart.Col(), rCellRange.aStart.Row(),
rCellRange.aEnd.Col(), rCellRange.aEnd.Row(), nTab );
- long nLeftSpace = aSelection.Left() - aVisible.Left();
- long nRightSpace = aVisible.Right() - aSelection.Right();
- long nTopSpace = aSelection.Top() - aVisible.Top();
- long nBottomSpace = aVisible.Bottom() - aSelection.Bottom();
+ tools::Long nLeftSpace = aSelection.Left() - aVisible.Left();
+ tools::Long nRightSpace = aVisible.Right() - aSelection.Right();
+ tools::Long nTopSpace = aSelection.Top() - aVisible.Top();
+ tools::Long nBottomSpace = aVisible.Bottom() - aSelection.Bottom();
bool bFitLeft = ( nLeftSpace >= nNeededWidth );
bool bFitRight = ( nRightSpace >= nNeededWidth );
@@ -1933,7 +1933,7 @@ void ScTabView::FreezeSplitters( bool bFreeze, SplitMethod eSplitMethod, SCCOLRO
if ( eOldH != SC_SPLIT_NONE && (eSplitMethod == SC_SPLIT_METHOD_COL || eSplitMethod == SC_SPLIT_METHOD_CURSOR))
{
- long nSplitPos = aViewData.GetHSplitPos();
+ tools::Long nSplitPos = aViewData.GetHSplitPos();
if ( bLayoutRTL )
nSplitPos = pFrameWin->GetOutputSizePixel().Width() - nSplitPos - 1;
aSplit.setX( nSplitPos - aWinStart.X() );
@@ -2014,7 +2014,7 @@ void ScTabView::FreezeSplitters( bool bFreeze, SplitMethod eSplitMethod, SCCOLRO
aSplit = aViewData.GetScrPos( nPosX, nPosY, ePos, true );
if (nPosX > aViewData.GetPosX(SC_SPLIT_LEFT)) // (aSplit.X() > 0) doesn't work for RTL
{
- long nSplitPos = aSplit.X() + aWinStart.X();
+ tools::Long nSplitPos = aSplit.X() + aWinStart.X();
if ( bLayoutRTL )
nSplitPos = pFrameWin->GetOutputSizePixel().Width() - nSplitPos - 1;
@@ -2283,13 +2283,13 @@ void ScTabView::SetAutoSpellData( SCCOL nPosX, SCROW nPosY, const std::vector<ed
namespace
{
-long lcl_GetRowHeightPx(const ScViewData &rViewData, SCROW nRow, SCTAB nTab)
+tools::Long lcl_GetRowHeightPx(const ScViewData &rViewData, SCROW nRow, SCTAB nTab)
{
const sal_uInt16 nSize = rViewData.GetDocument().GetRowHeight(nRow, nTab);
return ScViewData::ToPixel(nSize, rViewData.GetPPTY());
}
-long lcl_GetColWidthPx(const ScViewData &rViewData, SCCOL nCol, SCTAB nTab)
+tools::Long lcl_GetColWidthPx(const ScViewData &rViewData, SCCOL nCol, SCTAB nTab)
{
const sal_uInt16 nSize = rViewData.GetDocument().GetColWidth(nCol, nTab);
return ScViewData::ToPixel(nSize, rViewData.GetPPTX());
@@ -2359,7 +2359,7 @@ void lcl_getGroupIndexes(const ScOutlineArray& rArray, SCCOLROW nStart, SCCOLROW
}
void lcl_createGroupsData(
- SCCOLROW nHeaderIndex, SCCOLROW nEnd, long nSizePx, long nTotalPx,
+ SCCOLROW nHeaderIndex, SCCOLROW nEnd, tools::Long nSizePx, tools::Long nTotalPx,
const ScOutlineArray& rArray, std::vector<size_t>& rGroupIndexes,
std::vector<long>& rGroupStartPositions, OStringBuffer& rGroupsBuffer)
{
@@ -2452,13 +2452,13 @@ public:
return maRange;
}
- void getColPositions(long& rStartColPos, long& rEndColPos) const
+ void getColPositions(tools::Long& rStartColPos, tools::Long& rEndColPos) const
{
rStartColPos = maBoundPositions.Left();
rEndColPos = maBoundPositions.Right();
}
- void getRowPositions(long& rStartRowPos, long& rEndRowPos) const
+ void getRowPositions(tools::Long& rStartRowPos, tools::Long& rEndRowPos) const
{
rStartRowPos = maBoundPositions.Top();
rEndRowPos = maBoundPositions.Bottom();
@@ -2467,12 +2467,12 @@ public:
private:
void calculateBounds(const tools::Rectangle& rAreaPx)
{
- long nLeftPx = 0, nRightPx = 0;
+ tools::Long nLeftPx = 0, nRightPx = 0;
SCCOLROW nStartCol = -1, nEndCol = -1;
calculateDimensionBounds(rAreaPx.Left(), rAreaPx.Right(), true,
nStartCol, nEndCol, nLeftPx, nRightPx,
mnEnlargeX, mrViewData);
- long nTopPx = 0, nBottomPx = 0;
+ tools::Long nTopPx = 0, nBottomPx = 0;
SCCOLROW nStartRow = -1, nEndRow = -1;
calculateDimensionBounds(rAreaPx.Top(), rAreaPx.Bottom(), false,
nStartRow, nEndRow, nTopPx, nBottomPx,
@@ -2488,10 +2488,10 @@ private:
}
// All positions are in pixels.
- static void calculateDimensionBounds(const long nStartPos, const long nEndPos,
+ static void calculateDimensionBounds(const tools::Long nStartPos, const tools::Long nEndPos,
bool bColumns, SCCOLROW& rStartIndex,
- SCCOLROW& rEndIndex, long& rBoundStart,
- long& rBoundEnd, SCCOLROW nEnlarge,
+ SCCOLROW& rEndIndex, tools::Long& rBoundStart,
+ tools::Long& rBoundEnd, SCCOLROW nEnlarge,
ScViewData& rViewData)
{
ScPositionHelper& rPosHelper = bColumns ? rViewData.GetLOKWidthHelper() :
@@ -2606,10 +2606,10 @@ void ScTabView::getRowColumnHeaders(const tools::Rectangle& rRectangle, tools::J
SCTAB nTab = aViewData.GetTabNo();
SCROW nStartRow = -1;
SCROW nEndRow = -1;
- long nStartHeightPx = 0;
+ tools::Long nStartHeightPx = 0;
SCCOL nStartCol = -1;
SCCOL nEndCol = -1;
- long nStartWidthPx = 0;
+ tools::Long nStartWidthPx = 0;
tools::Rectangle aOldVisArea(
mnLOKStartHeaderCol + 1, mnLOKStartHeaderRow + 1,
@@ -2625,7 +2625,7 @@ void ScTabView::getRowColumnHeaders(const tools::Rectangle& rRectangle, tools::J
if (rRectangle.Top() < rRectangle.Bottom())
{
SAL_INFO("sc.lok.header", "Row Header: compute start/end rows.");
- long nEndHeightPx = 0;
+ tools::Long nEndHeightPx = 0;
nStartRow = rCellRange.aStart.Row();
nEndRow = rCellRange.aEnd.Row();
aRangeProvider.getRowPositions(nStartHeightPx, nEndHeightPx);
@@ -2639,7 +2639,7 @@ void ScTabView::getRowColumnHeaders(const tools::Rectangle& rRectangle, tools::J
mnLOKEndHeaderRow = nEndRow;
}
- long nVisibleRows = nEndRow - nStartRow;
+ tools::Long nVisibleRows = nEndRow - nStartRow;
if (nVisibleRows < 25)
nVisibleRows = 25;
@@ -2666,8 +2666,8 @@ void ScTabView::getRowColumnHeaders(const tools::Rectangle& rRectangle, tools::J
/// 3) create string data for rows
- long nTotalPixels = nStartHeightPx;
- long nPrevSizePx = -1;
+ tools::Long nTotalPixels = nStartHeightPx;
+ tools::Long nPrevSizePx = -1;
OStringBuffer aRowGroupsBuffer = "\"rowGroups\": [\n";
{
auto rowsNode = rJsonWriter.startArray("rows");
@@ -2687,7 +2687,7 @@ void ScTabView::getRowColumnHeaders(const tools::Rectangle& rRectangle, tools::J
for (SCROW nRow = nStartRow + 1; nRow <= nEndRow; ++nRow)
{
// nSize will be 0 for hidden rows.
- const long nSizePx = lcl_GetRowHeightPx(aViewData, nRow, nTab);
+ const tools::Long nSizePx = lcl_GetRowHeightPx(aViewData, nRow, nTab);
nTotalPixels += nSizePx;
if (bRangeHeaderSupport && nRowGroupDepth > 0)
@@ -2723,7 +2723,7 @@ void ScTabView::getRowColumnHeaders(const tools::Rectangle& rRectangle, tools::J
if (rRectangle.Left() < rRectangle.Right())
{
SAL_INFO("sc.lok.header", "Column Header: compute start/end columns.");
- long nEndWidthPx = 0;
+ tools::Long nEndWidthPx = 0;
nStartCol = rCellRange.aStart.Col();
nEndCol = rCellRange.aEnd.Col();
aRangeProvider.getColPositions(nStartWidthPx, nEndWidthPx);
@@ -2737,7 +2737,7 @@ void ScTabView::getRowColumnHeaders(const tools::Rectangle& rRectangle, tools::J
mnLOKEndHeaderCol = nEndCol;
}
- long nVisibleCols = nEndCol - nStartCol;
+ tools::Long nVisibleCols = nEndCol - nStartCol;
if (nVisibleCols < 10)
nVisibleCols = 10;
@@ -2781,7 +2781,7 @@ void ScTabView::getRowColumnHeaders(const tools::Rectangle& rRectangle, tools::J
for (SCCOL nCol = nStartCol + 1; nCol <= nEndCol; ++nCol)
{
// nSize will be 0 for hidden columns.
- const long nSizePx = lcl_GetColWidthPx(aViewData, nCol, nTab);
+ const tools::Long nSizePx = lcl_GetColWidthPx(aViewData, nCol, nTab);
nTotalPixels += nSizePx;
if (bRangeHeaderSupport && nColGroupDepth > 0)
@@ -2923,7 +2923,7 @@ void ScTabView::extendTiledAreaIfNeeded()
const SCROW nEndRow = rCellRange.aEnd.Row();
// Column/Row positions.
- long nStartColPos, nEndColPos, nStartRowPos, nEndRowPos;
+ tools::Long nStartColPos, nEndColPos, nStartRowPos, nEndRowPos;
aRangeProvider.getColPositions(nStartColPos, nEndColPos);
aRangeProvider.getRowPositions(nStartRowPos, nEndRowPos);
diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index 54b42b81d871..ee7be2a2f65c 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -1116,7 +1116,7 @@ void ScTabView::DeselectAllTables()
}
static bool lcl_FitsInWindow( double fScaleX, double fScaleY, sal_uInt16 nZoom,
- long nWindowX, long nWindowY, const ScDocument* pDoc, SCTAB nTab,
+ tools::Long nWindowX, tools::Long nWindowY, const ScDocument* pDoc, SCTAB nTab,
SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
SCCOL nFixPosX, SCROW nFixPosY )
{
@@ -1124,7 +1124,7 @@ static bool lcl_FitsInWindow( double fScaleX, double fScaleY, sal_uInt16 nZoom,
fScaleX *= fZoomFactor;
fScaleY *= fZoomFactor;
- long nBlockX = 0;
+ tools::Long nBlockX = 0;
SCCOL nCol;
for (nCol=0; nCol<nFixPosX; nCol++)
{
@@ -1132,7 +1132,7 @@ static bool lcl_FitsInWindow( double fScaleX, double fScaleY, sal_uInt16 nZoom,
sal_uInt16 nColTwips = pDoc->GetColWidth( nCol, nTab );
if (nColTwips)
{
- nBlockX += static_cast<long>(nColTwips * fScaleX);
+ nBlockX += static_cast<tools::Long>(nColTwips * fScaleX);
if (nBlockX > nWindowX)
return false;
}
@@ -1142,13 +1142,13 @@ static bool lcl_FitsInWindow( double fScaleX, double fScaleY, sal_uInt16 nZoom,
sal_uInt16 nColTwips = pDoc->GetColWidth( nCol, nTab );
if (nColTwips)
{
- nBlockX += static_cast<long>(nColTwips * fScaleX);
+ nBlockX += static_cast<tools::Long>(nColTwips * fScaleX);
if (nBlockX > nWindowX)
return false;
}
}
- long nBlockY = 0;
+ tools::Long nBlockY = 0;
for (SCROW nRow = 0; nRow <= nFixPosY-1; ++nRow)
{
if (pDoc->RowHidden(nRow, nTab))
@@ -1158,7 +1158,7 @@ static bool lcl_FitsInWindow( double fScaleX, double fScaleY, sal_uInt16 nZoom,
sal_uInt16 nRowTwips = pDoc->GetRowHeight(nRow, nTab);
if (nRowTwips)
{
- nBlockY += static_cast<long>(nRowTwips * fScaleY);
+ nBlockY += static_cast<tools::Long>(nRowTwips * fScaleY);
if (nBlockY > nWindowY)
return false;
}
@@ -1168,7 +1168,7 @@ static bool lcl_FitsInWindow( double fScaleX, double fScaleY, sal_uInt16 nZoom,
sal_uInt16 nRowTwips = pDoc->GetRowHeight(nRow, nTab);
if (nRowTwips)
{
- nBlockY += static_cast<long>(nRowTwips * fScaleY);
+ nBlockY += static_cast<tools::Long>(nRowTwips * fScaleY);
if (nBlockY > nWindowY)
return false;
}
@@ -1314,7 +1314,7 @@ sal_uInt16 ScTabView::CalcZoom( SvxZoomType eType, sal_uInt16 nOldZoom )
ScSplitMode eHMode = aViewData.GetHSplitMode();
if ( eHMode != SC_SPLIT_NONE && pGridWin[SC_SPLIT_BOTTOMRIGHT] )
{
- long nOtherWidth = pGridWin[SC_SPLIT_BOTTOMRIGHT]->
+ tools::Long nOtherWidth = pGridWin[SC_SPLIT_BOTTOMRIGHT]->
GetOutputSizePixel().Width();
if ( eHMode == SC_SPLIT_FIX )
{
@@ -1329,7 +1329,7 @@ sal_uInt16 ScTabView::CalcZoom( SvxZoomType eType, sal_uInt16 nOldZoom )
ScSplitMode eVMode = aViewData.GetVSplitMode();
if ( eVMode != SC_SPLIT_NONE && pGridWin[SC_SPLIT_TOPLEFT] )
{
- long nOtherHeight = pGridWin[SC_SPLIT_TOPLEFT]->
+ tools::Long nOtherHeight = pGridWin[SC_SPLIT_TOPLEFT]->
GetOutputSizePixel().Height();
if ( eVMode == SC_SPLIT_FIX )
{
@@ -1345,9 +1345,9 @@ sal_uInt16 ScTabView::CalcZoom( SvxZoomType eType, sal_uInt16 nOldZoom )
double nPPTX = ScGlobal::nScreenPPTX / aViewData.GetDocShell()->GetOutputFactor();
double nPPTY = ScGlobal::nScreenPPTY;
- long nZoomX = static_cast<long>( aWinSize.Width() * 100 /
+ tools::Long nZoomX = static_cast<tools::Long>( aWinSize.Width() * 100 /
( aPageSize.Width() * nPPTX ) );
- long nZoomY = static_cast<long>( aWinSize.Height() * 100 /
+ tools::Long nZoomY = static_cast<tools::Long>( aWinSize.Height() * 100 /
( aPageSize.Height() * nPPTY ) );
if (nZoomX > 0)
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index ace30689b743..ccc47fb2c06b 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -647,12 +647,12 @@ namespace {
Point calcHintWindowPosition(
const Point& rCellPos, const Size& rCellSize, const Size& rFrameWndSize, const Size& rHintWndSize)
{
- const long nMargin = 20;
+ const tools::Long nMargin = 20;
- long nMLeft = rCellPos.X();
- long nMRight = rFrameWndSize.Width() - rCellPos.X() - rCellSize.Width();
- long nMTop = rCellPos.Y();
- long nMBottom = rFrameWndSize.Height() - rCellPos.Y() - rCellSize.Height();
+ tools::Long nMLeft = rCellPos.X();
+ tools::Long nMRight = rFrameWndSize.Width() - rCellPos.X() - rCellSize.Width();
+ tools::Long nMTop = rCellPos.Y();
+ tools::Long nMBottom = rFrameWndSize.Height() - rCellPos.Y() - rCellSize.Height();
// First, see if we can fit the entire hint window in the visible region.
@@ -813,8 +813,8 @@ void ScTabView::TestHintWindow()
mxInputHintOO->append(std::unique_ptr<sdr::overlay::OverlayObject>(pOverlay));
Size aHintWndSize = pOverlay->GetSizePixel();
- long nCellSizeX = 0;
- long nCellSizeY = 0;
+ tools::Long nCellSizeX = 0;
+ tools::Long nCellSizeY = 0;
aViewData.GetMergeSizePixel(nCol, nRow, nCellSizeX, nCellSizeY);
Point aHintPos = calcHintWindowPosition(
@@ -946,15 +946,15 @@ void ScTabView::AlignToCursor( SCCOL nCurX, SCROW nCurY, ScFollowMode eMode,
SCCOL nSizeX = aViewData.VisibleCellsX(eAlignX);
SCROW nSizeY = aViewData.VisibleCellsY(eAlignY);
- long nCellSizeX;
- long nCellSizeY;
+ tools::Long nCellSizeX;
+ tools::Long nCellSizeY;
if ( nCurX >= 0 && nCurY >= 0 )
aViewData.GetMergeSizePixel( nCurX, nCurY, nCellSizeX, nCellSizeY );
else
nCellSizeX = nCellSizeY = 0;
Size aScrSize = aViewData.GetScrSize();
- long nSpaceX = ( aScrSize.Width() - nCellSizeX ) / 2;
- long nSpaceY = ( aScrSize.Height() - nCellSizeY ) / 2;
+ tools::Long nSpaceX = ( aScrSize.Width() - nCellSizeX ) / 2;
+ tools::Long nSpaceY = ( aScrSize.Height() - nCellSizeY ) / 2;
// nSpaceY: desired start position of cell for FOLLOW_JUMP, modified if dialog interferes
bool bForceNew = false; // force new calculation of JUMP position (vertical only)
@@ -990,7 +990,7 @@ void ScTabView::AlignToCursor( SCCOL nCurX, SCROW nCurY, ScFollowMode eMode,
{
// cursor is on the screen
Point aStart = aViewData.GetScrPos( nCurX, nCurY, eAlign );
- long nCSX, nCSY;
+ tools::Long nCSX, nCSY;
aViewData.GetMergeSizePixel( nCurX, nCurY, nCSX, nCSY );
tools::Rectangle aCursor( aStart, Size( nCSX, nCSY ) );
if ( aCursor.IsOver( aDlgPixel ) )
@@ -1002,11 +1002,11 @@ void ScTabView::AlignToCursor( SCCOL nCurX, SCROW nCurY, ScFollowMode eMode,
if (bLimit)
{
bool bBottom = false;
- long nTopSpace = aDlgPixel.Top();
- long nBotSpace = aWinSize.Height() - aDlgPixel.Bottom();
+ tools::Long nTopSpace = aDlgPixel.Top();
+ tools::Long nBotSpace = aWinSize.Height() - aDlgPixel.Bottom();
if ( nBotSpace > 0 && nBotSpace > nTopSpace )
{
- long nDlgBot = aDlgPixel.Bottom();
+ tools::Long nDlgBot = aDlgPixel.Bottom();
SCCOL nWPosX;
SCROW nWPosY;
aViewData.GetPosFromPixel( 0,nDlgBot, eAlign, nWPosX, nWPosY );
@@ -2148,9 +2148,9 @@ void ScTabView::UpdateEditView()
{
EditView* pEditView = aViewData.GetEditView(eCurrent);
- long nRefTabNo = GetViewData().GetRefTabNo();
- long nX = GetViewData().GetCurXForTab(nRefTabNo);
- long nY = GetViewData().GetCurYForTab(nRefTabNo);
+ tools::Long nRefTabNo = GetViewData().GetRefTabNo();
+ tools::Long nX = GetViewData().GetCurXForTab(nRefTabNo);
+ tools::Long nY = GetViewData().GetCurYForTab(nRefTabNo);
aViewData.SetEditEngine(eCurrent,
static_cast<ScEditEngineDefaulter*>(pEditView->GetEditEngine()),
@@ -2368,7 +2368,7 @@ void ScTabView::PaintArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCRO
continue;
bool bLayoutRTL = aViewData.GetDocument().IsLayoutRTL( aViewData.GetTabNo() );
- long nLayoutSign = bLayoutRTL ? -1 : 1;
+ tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
Point aStart = aViewData.GetScrPos( nCol1, nRow1, static_cast<ScSplitPos>(i) );
Point aEnd = aViewData.GetScrPos( nCol2+1, nRow2+1, static_cast<ScSplitPos>(i) );
@@ -2408,7 +2408,7 @@ void ScTabView::PaintArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCRO
//!if ( nCol1 > 0 && !aViewData.GetDocument()->IsBlockEmpty(
//! aViewData.GetTabNo(),
//! 0, nRow1, nCol1-1, nRow2 ) )
- long nMarkPixel = static_cast<long>( SC_CLIPMARK_SIZE * aViewData.GetPPTX() );
+ tools::Long nMarkPixel = static_cast<tools::Long>( SC_CLIPMARK_SIZE * aViewData.GetPPTX() );
aStart.AdjustX( -(nMarkPixel * nLayoutSign) );
}
@@ -2485,7 +2485,7 @@ void ScTabView::PaintRangeFinderEntry (const ScRangeFindData* pData, const SCTAB
PaintArea( nCol1, nRow1, nCol2, nRow2, ScUpdateMode::Marks );
}
-void ScTabView::PaintRangeFinder( long nNumber )
+void ScTabView::PaintRangeFinder( tools::Long nNumber )
{
ScInputHandler* pHdl = SC_MOD()->GetInputHdl( aViewData.GetViewShell() );
if (!pHdl)
@@ -2577,11 +2577,11 @@ void ScTabView::DoChartSelection(
{
aTargetRange.PutInOrder();
- long nX1 = aTargetRange.aStart.Col();
- long nX2 = aTargetRange.aEnd.Col();
- long nY1 = aTargetRange.aStart.Row();
- long nY2 = aTargetRange.aEnd.Row();
- long nTab = aTargetRange.aStart.Tab();
+ tools::Long nX1 = aTargetRange.aStart.Col();
+ tools::Long nX2 = aTargetRange.aEnd.Col();
+ tools::Long nY1 = aTargetRange.aStart.Row();
+ tools::Long nY2 = aTargetRange.aEnd.Row();
+ tools::Long nTab = aTargetRange.aStart.Tab();
aReferenceMarks[nIndex++] = ScInputHandler::GetReferenceMark( aViewData, aViewData.GetDocShell(),
nX1, nX2, nY1, nY2,
@@ -2670,7 +2670,7 @@ void ScTabView::PaintTopArea( SCCOL nStartCol, SCCOL nEndCol )
ScDocument& rDoc = aViewData.GetDocument();
bool bLayoutRTL = rDoc.IsLayoutRTL( aViewData.GetTabNo() );
- long nLayoutSign = bLayoutRTL ? -1 : 1;
+ tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
for (sal_uInt16 i = 0; i < 2; i++)
{
@@ -2678,8 +2678,8 @@ void ScTabView::PaintTopArea( SCCOL nStartCol, SCCOL nEndCol )
if (pColBar[eWhich])
{
Size aWinSize = pColBar[eWhich]->GetSizePixel();
- long nStartX = aViewData.GetScrPos( nStartCol, 0, eWhich ).X();
- long nEndX;
+ tools::Long nStartX = aViewData.GetScrPos( nStartCol, 0, eWhich ).X();
+ tools::Long nEndX;
if (nEndCol >= rDoc.MaxCol())
nEndX = nStartX + (bLayoutRTL ? 0 : ( aWinSize.Width()-1 ));
else
@@ -2731,8 +2731,8 @@ void ScTabView::PaintLeftArea( SCROW nStartRow, SCROW nEndRow )
if (pRowBar[eWhich])
{
Size aWinSize = pRowBar[eWhich]->GetSizePixel();
- long nStartY = aViewData.GetScrPos( 0, nStartRow, eWhich ).Y();
- long nEndY;
+ tools::Long nStartY = aViewData.GetScrPos( 0, nStartRow, eWhich ).Y();
+ tools::Long nEndY;
if (nEndRow >= rDoc.MaxRow())
nEndY = nStartY + aWinSize.Height() - 1;
else
@@ -2918,7 +2918,7 @@ void ScTabView::ActivatePart( ScSplitPos eWhich )
pColBar[eOldH]->SetIgnoreMove(true);
pColBar[eNewH]->SetIgnoreMove(false);
pHdrSelEng->SetWindow( pColBar[eNewH] );
- long nWidth = pColBar[eNewH]->GetOutputSizePixel().Width();
+ tools::Long nWidth = pColBar[eNewH]->GetOutputSizePixel().Width();
pHdrSelEng->SetVisibleArea( tools::Rectangle( 0, LONG_MIN, nWidth-1, LONG_MAX ) );
pColBar[eNewH]->CaptureMouse();
}
@@ -2927,7 +2927,7 @@ void ScTabView::ActivatePart( ScSplitPos eWhich )
pRowBar[eOldV]->SetIgnoreMove(true);
pRowBar[eNewV]->SetIgnoreMove(false);
pHdrSelEng->SetWindow( pRowBar[eNewV] );
- long nHeight = pRowBar[eNewV]->GetOutputSizePixel().Height();
+ tools::Long nHeight = pRowBar[eNewV]->GetOutputSizePixel().Height();
pHdrSelEng->SetVisibleArea( tools::Rectangle( LONG_MIN, 0, LONG_MAX, nHeight-1 ) );
pRowBar[eNewV]->CaptureMouse();
}
@@ -2975,7 +2975,7 @@ void ScTabView::UpdateInputContext()
// GetGridWidth - width of an output range (for ViewData)
-long ScTabView::GetGridWidth( ScHSplitPos eWhich )
+tools::Long ScTabView::GetGridWidth( ScHSplitPos eWhich )
{
ScSplitPos eGridWhich = ( eWhich == SC_SPLIT_LEFT ) ? SC_SPLIT_BOTTOMLEFT : SC_SPLIT_BOTTOMRIGHT;
if (pGridWin[eGridWhich])
@@ -2986,7 +2986,7 @@ long ScTabView::GetGridWidth( ScHSplitPos eWhich )
// GetGridHeight - height of an output range (for ViewData)
-long ScTabView::GetGridHeight( ScVSplitPos eWhich )
+tools::Long ScTabView::GetGridHeight( ScVSplitPos eWhich )
{
ScSplitPos eGridWhich = ( eWhich == SC_SPLIT_TOP ) ? SC_SPLIT_TOPLEFT : SC_SPLIT_BOTTOMLEFT;
if (pGridWin[eGridWhich])
diff --git a/sc/source/ui/view/tabview4.cxx b/sc/source/ui/view/tabview4.cxx
index b8703e22bf62..aa34633397ae 100644
--- a/sc/source/ui/view/tabview4.cxx
+++ b/sc/source/ui/view/tabview4.cxx
@@ -342,7 +342,7 @@ void ScTabView::InitRefMode( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, ScRefType eT
}
}
-void ScTabView::SetScrollBar( ScrollBar& rScroll, long nRangeMax, long nVisible, long nPos, bool bLayoutRTL )
+void ScTabView::SetScrollBar( ScrollBar& rScroll, tools::Long nRangeMax, tools::Long nVisible, tools::Long nPos, bool bLayoutRTL )
{
if ( nVisible == 0 )
nVisible = 1; // #i59893# don't use visible size 0
@@ -354,20 +354,20 @@ void ScTabView::SetScrollBar( ScrollBar& rScroll, long nRangeMax, long nVisible,
rScroll.EnableRTL( bLayoutRTL );
}
-long ScTabView::GetScrollBarPos( const ScrollBar& rScroll )
+tools::Long ScTabView::GetScrollBarPos( const ScrollBar& rScroll )
{
return rScroll.GetThumbPos();
}
// UpdateScrollBars - set visible area and scroll width of scroll bars
-static long lcl_UpdateBar( ScrollBar& rScroll, SCCOLROW nSize ) // Size = (complete) cells
+static tools::Long lcl_UpdateBar( ScrollBar& rScroll, SCCOLROW nSize ) // Size = (complete) cells
{
- long nOldPos;
- long nNewPos;
+ tools::Long nOldPos;
+ tools::Long nNewPos;
nOldPos = rScroll.GetThumbPos();
- rScroll.SetPageSize( static_cast<long>(nSize) );
+ rScroll.SetPageSize( static_cast<tools::Long>(nSize) );
nNewPos = rScroll.GetThumbPos();
#ifndef UNX
rScroll.SetPageSize( 1 ); // always possible !
@@ -376,7 +376,7 @@ static long lcl_UpdateBar( ScrollBar& rScroll, SCCOLROW nSize ) // Size =
return nNewPos - nOldPos;
}
-static long lcl_GetScrollRange( SCCOLROW nDocEnd, SCCOLROW nPos, SCCOLROW nVis, SCCOLROW nMax, SCCOLROW nStart )
+static tools::Long lcl_GetScrollRange( SCCOLROW nDocEnd, SCCOLROW nPos, SCCOLROW nVis, SCCOLROW nMax, SCCOLROW nStart )
{
// get the end (positive) of a scroll bar range that always starts at 0
@@ -393,7 +393,7 @@ void ScTabView::UpdateScrollBars( HeaderType eHeaderType )
{
ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), eHeaderType, GetViewData().GetTabNo());
- long nDiff;
+ tools::Long nDiff;
bool bTop = ( aViewData.GetVSplitMode() != SC_SPLIT_NONE );
bool bRight = ( aViewData.GetHSplitMode() != SC_SPLIT_NONE );
ScDocument& rDoc = aViewData.GetDocument();
@@ -416,24 +416,24 @@ void ScTabView::UpdateScrollBars( HeaderType eHeaderType )
nStartY = aViewData.GetFixPosY();
nVisXL = aViewData.VisibleCellsX( SC_SPLIT_LEFT );
- long nMaxXL = lcl_GetScrollRange( nUsedX, aViewData.GetPosX(SC_SPLIT_LEFT), nVisXL, rDoc.MaxCol(), 0 );
+ tools::Long nMaxXL = lcl_GetScrollRange( nUsedX, aViewData.GetPosX(SC_SPLIT_LEFT), nVisXL, rDoc.MaxCol(), 0 );
SetScrollBar( *aHScrollLeft, nMaxXL, nVisXL, aViewData.GetPosX( SC_SPLIT_LEFT ), bLayoutRTL );
nVisYB = aViewData.VisibleCellsY( SC_SPLIT_BOTTOM );
- long nMaxYB = lcl_GetScrollRange( nUsedY, aViewData.GetPosY(SC_SPLIT_BOTTOM), nVisYB, rDoc.MaxRow(), nStartY );
+ tools::Long nMaxYB = lcl_GetScrollRange( nUsedY, aViewData.GetPosY(SC_SPLIT_BOTTOM), nVisYB, rDoc.MaxRow(), nStartY );
SetScrollBar( *aVScrollBottom, nMaxYB, nVisYB, aViewData.GetPosY( SC_SPLIT_BOTTOM ) - nStartY, bLayoutRTL );
if (bRight)
{
nVisXR = aViewData.VisibleCellsX( SC_SPLIT_RIGHT );
- long nMaxXR = lcl_GetScrollRange( nUsedX, aViewData.GetPosX(SC_SPLIT_RIGHT), nVisXR, rDoc.MaxCol(), nStartX );
+ tools::Long nMaxXR = lcl_GetScrollRange( nUsedX, aViewData.GetPosX(SC_SPLIT_RIGHT), nVisXR, rDoc.MaxCol(), nStartX );
SetScrollBar( *aHScrollRight, nMaxXR, nVisXR, aViewData.GetPosX( SC_SPLIT_RIGHT ) - nStartX, bLayoutRTL );
}
if (bTop)
{
nVisYT = aViewData.VisibleCellsY( SC_SPLIT_TOP );
- long nMaxYT = lcl_GetScrollRange( nUsedY, aViewData.GetPosY(SC_SPLIT_TOP), nVisYT, rDoc.MaxRow(), 0 );
+ tools::Long nMaxYT = lcl_GetScrollRange( nUsedY, aViewData.GetPosY(SC_SPLIT_TOP), nVisYT, rDoc.MaxRow(), 0 );
SetScrollBar( *aVScrollTop, nMaxYT, nVisYT, aViewData.GetPosY( SC_SPLIT_TOP ), bLayoutRTL );
}
@@ -468,7 +468,7 @@ void ScTabView::UpdateScrollBars( HeaderType eHeaderType )
#define HDR_SLIDERSIZE 2
#endif
-void ScTabView::InvertHorizontal( ScVSplitPos eWhich, long nDragPos )
+void ScTabView::InvertHorizontal( ScVSplitPos eWhich, tools::Long nDragPos )
{
for (sal_uInt16 i=0; i<4; i++)
if (WhichV(static_cast<ScSplitPos>(i))==eWhich)
@@ -483,7 +483,7 @@ void ScTabView::InvertHorizontal( ScVSplitPos eWhich, long nDragPos )
}
}
-void ScTabView::InvertVertical( ScHSplitPos eWhich, long nDragPos )
+void ScTabView::InvertVertical( ScHSplitPos eWhich, tools::Long nDragPos )
{
for (sal_uInt16 i=0; i<4; i++)
if (WhichH(static_cast<ScSplitPos>(i))==eWhich)
diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx
index b5ed82510dba..73727a0f13d4 100644
--- a/sc/source/ui/view/tabview5.cxx
+++ b/sc/source/ui/view/tabview5.cxx
@@ -549,7 +549,7 @@ void ScTabView::MakeVisible( const tools::Rectangle& rHMMRect )
tools::Rectangle aRect = pWin->LogicToPixel( rHMMRect );
- long nScrollX=0, nScrollY=0; // pixel
+ tools::Long nScrollX=0, nScrollY=0; // pixel
if ( aRect.Right() >= aWinSize.Width() ) // right out
{
@@ -582,12 +582,12 @@ void ScTabView::MakeVisible( const tools::Rectangle& rHMMRect )
SCCOL nPosX = aViewData.GetPosX(WhichH(eWhich));
SCROW nPosY = aViewData.GetPosY(WhichV(eWhich));
- long nLinesX=0, nLinesY=0; // columns/rows - scroll at least nScrollX/Y
+ tools::Long nLinesX=0, nLinesY=0; // columns/rows - scroll at least nScrollX/Y
if (nScrollX > 0)
while (nScrollX > 0 && nPosX < rDoc.MaxCol())
{
- nScrollX -= static_cast<long>( rDoc.GetColWidth(nPosX, nTab) * nPPTX );
+ nScrollX -= static_cast<tools::Long>( rDoc.GetColWidth(nPosX, nTab) * nPPTX );
++nPosX;
++nLinesX;
}
@@ -595,14 +595,14 @@ void ScTabView::MakeVisible( const tools::Rectangle& rHMMRect )
while (nScrollX < 0 && nPosX > 0)
{
--nPosX;
- nScrollX += static_cast<long>( rDoc.GetColWidth(nPosX, nTab) * nPPTX );
+ nScrollX += static_cast<tools::Long>( rDoc.GetColWidth(nPosX, nTab) * nPPTX );
--nLinesX;
}
if (nScrollY > 0)
while (nScrollY > 0 && nPosY < rDoc.MaxRow())
{
- nScrollY -= static_cast<long>( rDoc.GetRowHeight(nPosY, nTab) * nPPTY );
+ nScrollY -= static_cast<tools::Long>( rDoc.GetRowHeight(nPosY, nTab) * nPPTY );
++nPosY;
++nLinesY;
}
@@ -610,7 +610,7 @@ void ScTabView::MakeVisible( const tools::Rectangle& rHMMRect )
while (nScrollY < 0 && nPosY > 0)
{
--nPosY;
- nScrollY += static_cast<long>( rDoc.GetRowHeight(nPosY, nTab) * nPPTY );
+ nScrollY += static_cast<tools::Long>( rDoc.GetRowHeight(nPosY, nTab) * nPPTY );
--nLinesY;
}
diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx
index cb607ed841f1..5d86c0c41e4d 100644
--- a/sc/source/ui/view/tabvwsh3.cxx
+++ b/sc/source/ui/view/tabvwsh3.cxx
@@ -698,7 +698,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
SvxZoomType eOldZoomType = GetZoomType();
SvxZoomType eNewZoomType = eOldZoomType;
const Fraction& rOldY = GetViewData().GetZoomY(); // Y is shown
- sal_uInt16 nOldZoom = static_cast<sal_uInt16>(long( rOldY * 100 ));
+ sal_uInt16 nOldZoom = static_cast<sal_uInt16>(tools::Long( rOldY * 100 ));
sal_uInt16 nZoom = nOldZoom;
bool bCancel = false;
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index fb8156f5e391..041560a67ff6 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -298,7 +298,7 @@ void ScTabViewShell::GetState( SfxItemSet& rSet )
else
{
const Fraction& rOldY = GetViewData().GetZoomY();
- sal_uInt16 nZoom = static_cast<sal_uInt16>(long( rOldY * 100 ));
+ sal_uInt16 nZoom = static_cast<sal_uInt16>(tools::Long( rOldY * 100 ));
rSet.Put( SvxZoomItem( SvxZoomType::PERCENT, nZoom, nWhich ) );
}
break;
@@ -310,7 +310,7 @@ void ScTabViewShell::GetState( SfxItemSet& rSet )
else
{
const Fraction& rOldY = GetViewData().GetZoomY();
- sal_uInt16 nCurrentZoom = static_cast<sal_uInt16>(long( rOldY * 100 ));
+ sal_uInt16 nCurrentZoom = static_cast<sal_uInt16>(tools::Long( rOldY * 100 ));
if( nCurrentZoom )
{
diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx
index 58d42e311005..cfeedaf81bfc 100644
--- a/sc/source/ui/view/tabvwshb.cxx
+++ b/sc/source/ui/view/tabvwshb.cxx
@@ -141,7 +141,7 @@ public:
}
-void ScTabViewShell::ActivateObject( SdrOle2Obj* pObj, long nVerb )
+void ScTabViewShell::ActivateObject( SdrOle2Obj* pObj, tools::Long nVerb )
{
// Do not leave the hint message box on top of the object
RemoveHintWindow();
@@ -259,7 +259,7 @@ void ScTabViewShell::ActivateObject( SdrOle2Obj* pObj, long nVerb )
//xIPObj->SetDocumentName( GetViewData().GetDocShell()->GetTitle() );
}
-ErrCode ScTabViewShell::DoVerb(long nVerb)
+ErrCode ScTabViewShell::DoVerb(tools::Long nVerb)
{
SdrView* pView = GetScDrawView();
if (!pView)
diff --git a/sc/source/ui/view/tabvwshh.cxx b/sc/source/ui/view/tabvwshh.cxx
index 6a4e8422319c..4a448584aef7 100644
--- a/sc/source/ui/view/tabvwshh.cxx
+++ b/sc/source/ui/view/tabvwshh.cxx
@@ -88,7 +88,7 @@ void ScTabViewShell::ExecuteObject( const SfxRequest& rReq )
const SfxPoolItem* pItem;
if ( pReqArgs && pReqArgs->GetItemState( nSlotId, true, &pItem ) == SfxItemState::SET )
{
- long nNewVal = static_cast<const SfxInt32Item*>(pItem)->GetValue();
+ tools::Long nNewVal = static_cast<const SfxInt32Item*>(pItem)->GetValue();
if ( nNewVal < 0 )
nNewVal = 0;
@@ -182,7 +182,7 @@ void ScTabViewShell::GetObjectState( SfxItemSet& rSet )
SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
tools::Rectangle aRect = pObj->GetLogicRect();
- long nVal;
+ tools::Long nVal;
if ( nWhich == SID_OBJECT_LEFT )
nVal = aRect.Left();
else if ( nWhich == SID_OBJECT_TOP )
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index e3a1e54002bd..2d30a3504f75 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -129,7 +129,7 @@ void ScPositionHelper::setDocument(const ScDocument& rDoc, bool bColumn)
MAX_INDEX = bColumn ? rDoc.MaxCol() : MAXTILEDROW;
}
-void ScPositionHelper::insert(index_type nIndex, long nPos)
+void ScPositionHelper::insert(index_type nIndex, tools::Long nPos)
{
if (nIndex < 0) return;
SAL_INFO("sc.lok.poshelper", "ScPositionHelper::insert: nIndex: "
@@ -169,7 +169,7 @@ void ScPositionHelper::invalidateByIndex(index_type nIndex)
}
}
-void ScPositionHelper::invalidateByPosition(long nPos)
+void ScPositionHelper::invalidateByPosition(tools::Long nPos)
{
SAL_INFO("sc.lok.poshelper", "ScPositionHelper::invalidate: nPos: " << nPos);
if (nPos <= 0)
@@ -202,8 +202,8 @@ ScPositionHelper::getNearestByIndex(index_type nIndex) const
return *posLB;
}
- long nDiffUB = posUB->first - nIndex;
- long nDiffLB = posLB->first - nIndex;
+ tools::Long nDiffUB = posUB->first - nIndex;
+ tools::Long nDiffLB = posLB->first - nIndex;
if (nDiffUB < -nDiffLB)
{
return *posUB;
@@ -215,7 +215,7 @@ ScPositionHelper::getNearestByIndex(index_type nIndex) const
}
const ScPositionHelper::value_type&
-ScPositionHelper::getNearestByPosition(long nPos) const
+ScPositionHelper::getNearestByPosition(tools::Long nPos) const
{
SAL_INFO("sc.lok.poshelper",
"ScPositionHelper::getNearest: nPos: " << nPos << ", size: " << mData.size());
@@ -233,8 +233,8 @@ ScPositionHelper::getNearestByPosition(long nPos) const
return *posLB;
}
- long nDiffUB = posUB->second - nPos;
- long nDiffLB = posLB->second - nPos;
+ tools::Long nDiffUB = posUB->second - nPos;
+ tools::Long nDiffLB = posLB->second - nPos;
if (nDiffUB < -nDiffLB)
{
@@ -246,14 +246,14 @@ ScPositionHelper::getNearestByPosition(long nPos) const
}
}
-long ScPositionHelper::getPosition(index_type nIndex) const
+tools::Long ScPositionHelper::getPosition(index_type nIndex) const
{
auto it = mData.find(std::make_pair(nIndex, 0));
if (it == mData.end()) return -1;
return it->second;
}
-long ScPositionHelper::computePosition(index_type nIndex, const std::function<long (index_type)>& getSizePx)
+tools::Long ScPositionHelper::computePosition(index_type nIndex, const std::function<long (index_type)>& getSizePx)
{
assert(MAX_INDEX > 0);
if (nIndex < 0) nIndex = 0;
@@ -261,7 +261,7 @@ long ScPositionHelper::computePosition(index_type nIndex, const std::function<lo
const auto& rNearest = getNearestByIndex(nIndex);
index_type nStartIndex = rNearest.first;
- long nTotalPixels = rNearest.second;
+ tools::Long nTotalPixels = rNearest.second;
if (nStartIndex < nIndex)
{
@@ -293,43 +293,43 @@ ScBoundsProvider::ScBoundsProvider(const ScViewData &rView, SCTAB nT, bool bColH
, nSecondPositionPx(-1)
{}
-void ScBoundsProvider::GetStartIndexAndPosition(SCCOL& nIndex, long& nPosition) const
+void ScBoundsProvider::GetStartIndexAndPosition(SCCOL& nIndex, tools::Long& nPosition) const
{
assert(bColumnHeader);
nIndex = nFirstIndex;
nPosition = nFirstPositionPx;
}
-void ScBoundsProvider::GetEndIndexAndPosition(SCCOL& nIndex, long& nPosition) const
+void ScBoundsProvider::GetEndIndexAndPosition(SCCOL& nIndex, tools::Long& nPosition) const
{
assert(bColumnHeader);
nIndex = nSecondIndex;
nPosition = nSecondPositionPx;
}
-void ScBoundsProvider::GetStartIndexAndPosition(SCROW& nIndex, long& nPosition) const
+void ScBoundsProvider::GetStartIndexAndPosition(SCROW& nIndex, tools::Long& nPosition) const
{
assert(!bColumnHeader);
nIndex = nFirstIndex;
nPosition = nFirstPositionPx;
}
-void ScBoundsProvider::GetEndIndexAndPosition(SCROW& nIndex, long& nPosition) const
+void ScBoundsProvider::GetEndIndexAndPosition(SCROW& nIndex, tools::Long& nPosition) const
{
assert(!bColumnHeader);
nIndex = nSecondIndex;
nPosition = nSecondPositionPx;
}
-long ScBoundsProvider::GetSize(index_type nIndex) const
+tools::Long ScBoundsProvider::GetSize(index_type nIndex) const
{
const sal_uInt16 nSize = bColumnHeader ? rDoc.GetColWidth(nIndex, nTab) : rDoc.GetRowHeight(nIndex, nTab);
return ScViewData::ToPixel(nSize, bColumnHeader ? mfPPTX : mfPPTY);
}
-void ScBoundsProvider::GetIndexAndPos(index_type nNearestIndex, long nNearestPosition,
- long nBound, index_type& nFoundIndex, long& nPosition,
- bool bTowards, long nDiff)
+void ScBoundsProvider::GetIndexAndPos(index_type nNearestIndex, tools::Long nNearestPosition,
+ tools::Long nBound, index_type& nFoundIndex, tools::Long& nPosition,
+ bool bTowards, tools::Long nDiff)
{
if (nDiff > 0) // nBound < nNearestPosition
GeIndexBackwards(nNearestIndex, nNearestPosition, nBound,
@@ -341,13 +341,13 @@ void ScBoundsProvider::GetIndexAndPos(index_type nNearestIndex, long nNearestPos
void ScBoundsProvider::Compute(
value_type aFirstNearest, value_type aSecondNearest,
- long nFirstBound, long nSecondBound)
+ tools::Long nFirstBound, tools::Long nSecondBound)
{
SAL_INFO("sc.lok.header", "BoundsProvider: nFirstBound: " << nFirstBound
<< ", nSecondBound: " << nSecondBound);
- long nFirstDiff = aFirstNearest.second - nFirstBound;
- long nSecondDiff = aSecondNearest.second - nSecondBound;
+ tools::Long nFirstDiff = aFirstNearest.second - nFirstBound;
+ tools::Long nSecondDiff = aSecondNearest.second - nSecondBound;
SAL_INFO("sc.lok.header", "BoundsProvider: rTopNearest: index: " << aFirstNearest.first
<< ", pos: " << aFirstNearest.second << ", diff: " << nFirstDiff);
SAL_INFO("sc.lok.header", "BoundsProvider: rBottomNearest: index: " << aSecondNearest.first
@@ -363,7 +363,7 @@ void ScBoundsProvider::Compute(
}
index_type nNearestIndex = aFirstNearest.first;
- long nNearestPosition = aFirstNearest.second;
+ tools::Long nNearestPosition = aFirstNearest.second;
SAL_INFO("sc.lok.header", "BoundsProvider: nearest to first bound: nNearestIndex: "
<< nNearestIndex << ", nNearestPosition: " << nNearestPosition);
@@ -399,14 +399,14 @@ void ScBoundsProvider::Compute(
}
}
-void ScBoundsProvider::EnlargeStartBy(long nOffset)
+void ScBoundsProvider::EnlargeStartBy(tools::Long nOffset)
{
const index_type nNewFirstIndex =
std::max(static_cast<index_type>(-1),
static_cast<index_type>(nFirstIndex - nOffset));
for (index_type nIndex = nFirstIndex; nIndex > nNewFirstIndex; --nIndex)
{
- const long nSizePx = GetSize(nIndex);
+ const tools::Long nSizePx = GetSize(nIndex);
nFirstPositionPx -= nSizePx;
}
nFirstIndex = nNewFirstIndex;
@@ -414,12 +414,12 @@ void ScBoundsProvider::EnlargeStartBy(long nOffset)
<< ", nFirstPositionPx: " << nFirstPositionPx);
}
-void ScBoundsProvider::EnlargeEndBy(long nOffset)
+void ScBoundsProvider::EnlargeEndBy(tools::Long nOffset)
{
const index_type nNewSecondIndex = std::min(MAX_INDEX, static_cast<index_type>(nSecondIndex + nOffset));
for (index_type nIndex = nSecondIndex + 1; nIndex <= nNewSecondIndex; ++nIndex)
{
- const long nSizePx = GetSize(nIndex);
+ const tools::Long nSizePx = GetSize(nIndex);
nSecondPositionPx += nSizePx;
}
nSecondIndex = nNewSecondIndex;
@@ -428,8 +428,8 @@ void ScBoundsProvider::EnlargeEndBy(long nOffset)
}
void ScBoundsProvider::GeIndexBackwards(
- index_type nNearestIndex, long nNearestPosition,
- long nBound, index_type& nFoundIndex, long& nPosition, bool bTowards)
+ index_type nNearestIndex, tools::Long nNearestPosition,
+ tools::Long nBound, index_type& nFoundIndex, tools::Long& nPosition, bool bTowards)
{
nFoundIndex = -1;
for (index_type nIndex = nNearestIndex; nIndex >= 0; --nIndex)
@@ -441,7 +441,7 @@ void ScBoundsProvider::GeIndexBackwards(
break;
}
- const long nSizePx = GetSize(nIndex);
+ const tools::Long nSizePx = GetSize(nIndex);
nNearestPosition -= nSizePx;
}
if (!bTowards && nFoundIndex != -1)
@@ -452,13 +452,13 @@ void ScBoundsProvider::GeIndexBackwards(
}
void ScBoundsProvider::GetIndexTowards(
- index_type nNearestIndex, long nNearestPosition,
- long nBound, index_type& nFoundIndex, long& nPosition, bool bTowards)
+ index_type nNearestIndex, tools::Long nNearestPosition,
+ tools::Long nBound, index_type& nFoundIndex, tools::Long& nPosition, bool bTowards)
{
nFoundIndex = -2;
for (index_type nIndex = nNearestIndex + 1; nIndex <= MAX_INDEX; ++nIndex)
{
- const long nSizePx = GetSize(nIndex);
+ const tools::Long nSizePx = GetSize(nIndex);
nNearestPosition += nSizePx;
if (nNearestPosition > nBound)
@@ -529,8 +529,8 @@ void ScViewDataTable::WriteUserDataSequence(uno::Sequence <beans::PropertyValue>
ScSplitMode eExVSplitMode = eVSplitMode;
SCCOL nExFixPosX = nFixPosX;
SCROW nExFixPosY = nFixPosY;
- long nExHSplitPos = nHSplitPos;
- long nExVSplitPos = nVSplitPos;
+ tools::Long nExHSplitPos = nHSplitPos;
+ tools::Long nExVSplitPos = nVSplitPos;
if (comphelper::LibreOfficeKit::isActive())
{
@@ -575,8 +575,8 @@ void ScViewDataTable::WriteUserDataSequence(uno::Sequence <beans::PropertyValue>
pSettings[SC_POSITION_BOTTOM].Name = SC_POSITIONBOTTOM;
pSettings[SC_POSITION_BOTTOM].Value <<= sal_Int32(nPosY[SC_SPLIT_BOTTOM]);
- sal_Int32 nZoomValue = long(aZoomY * 100);
- sal_Int32 nPageZoomValue = long(aPageZoomY * 100);
+ sal_Int32 nZoomValue = tools::Long(aZoomY * 100);
+ sal_Int32 nPageZoomValue = tools::Long(aPageZoomY * 100);
pSettings[SC_TABLE_ZOOM_TYPE].Name = SC_ZOOMTYPE;
pSettings[SC_TABLE_ZOOM_TYPE].Value <<= sal_Int16(eZoomType);
pSettings[SC_TABLE_ZOOM_VALUE].Name = SC_ZOOMVALUE;
@@ -719,12 +719,12 @@ void ScViewDataTable::ReadUserDataSequence(const uno::Sequence <beans::PropertyV
if (eHSplitMode == SC_SPLIT_FIX)
nFixPosX = rViewData.GetDocument().SanitizeCol( static_cast<SCCOL>( bHasHSplitInTwips ? nTempPosHTw : nTempPosH ));
else
- nHSplitPos = bHasHSplitInTwips ? static_cast< long >( nTempPosHTw * rViewData.GetPPTX() ) : nTempPosH;
+ nHSplitPos = bHasHSplitInTwips ? static_cast< tools::Long >( nTempPosHTw * rViewData.GetPPTX() ) : nTempPosH;
if (eVSplitMode == SC_SPLIT_FIX)
nFixPosY = rViewData.GetDocument().SanitizeRow( static_cast<SCROW>( bHasVSplitInTwips ? nTempPosVTw : nTempPosV ));
else
- nVSplitPos = bHasVSplitInTwips ? static_cast< long >( nTempPosVTw * rViewData.GetPPTY() ) : nTempPosV;
+ nVSplitPos = bHasVSplitInTwips ? static_cast< tools::Long >( nTempPosVTw * rViewData.GetPPTY() ) : nTempPosV;
eWhichActive = SanitizeWhichActive();
}
@@ -811,8 +811,8 @@ ScViewData::ScViewData(ScDocument* pDoc, ScDocShell* pDocSh, ScTabViewShell* pVi
assert(bool(pDoc) != bool(pDocSh)); // either one or the other, not both
maMarkData.SelectOneTable(0); // Sync with nTabNo
- aScrSize = Size( long( STD_COL_WIDTH * PIXEL_PER_TWIPS * OLE_STD_CELLS_X ),
- static_cast<long>( ScGlobal::nStdRowHeight * PIXEL_PER_TWIPS * OLE_STD_CELLS_Y ) );
+ aScrSize = Size( tools::Long( STD_COL_WIDTH * PIXEL_PER_TWIPS * OLE_STD_CELLS_X ),
+ static_cast<tools::Long>( ScGlobal::nStdRowHeight * PIXEL_PER_TWIPS * OLE_STD_CELLS_Y ) );
maTabData.emplace_back( new ScViewDataTable(nullptr) );
pThisTab = maTabData[nTabNo].get();
@@ -1405,11 +1405,11 @@ void ScViewData::SetMaxTiledCol( SCCOL nNewMaxCol )
const SCTAB nTab = GetTabNo();
auto GetColWidthPx = [this, nTab](SCCOL nCol) {
const sal_uInt16 nSize = this->mrDoc.GetColWidth(nCol, nTab);
- const long nSizePx = ScViewData::ToPixel(nSize, nPPTX);
+ const tools::Long nSizePx = ScViewData::ToPixel(nSize, nPPTX);
return nSizePx;
};
- long nTotalPixels = GetLOKWidthHelper().computePosition(nNewMaxCol, GetColWidthPx);
+ tools::Long nTotalPixels = GetLOKWidthHelper().computePosition(nNewMaxCol, GetColWidthPx);
SAL_INFO("sc.lok.docsize", "ScViewData::SetMaxTiledCol: nNewMaxCol: "
<< nNewMaxCol << ", nTotalPixels: " << nTotalPixels);
@@ -1430,11 +1430,11 @@ void ScViewData::SetMaxTiledRow( SCROW nNewMaxRow )
const SCTAB nTab = GetTabNo();
auto GetRowHeightPx = [this, nTab](SCROW nRow) {
const sal_uInt16 nSize = this->mrDoc.GetRowHeight(nRow, nTab);
- const long nSizePx = ScViewData::ToPixel(nSize, nPPTY);
+ const tools::Long nSizePx = ScViewData::ToPixel(nSize, nPPTY);
return nSizePx;
};
- long nTotalPixels = GetLOKHeightHelper().computePosition(nNewMaxRow, GetRowHeightPx);
+ tools::Long nTotalPixels = GetLOKHeightHelper().computePosition(nNewMaxRow, GetRowHeightPx);
SAL_INFO("sc.lok.docsize", "ScViewData::SetMaxTiledRow: nNewMaxRow: "
<< nNewMaxRow << ", nTotalPixels: " << nTotalPixels);
@@ -1592,11 +1592,11 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich,
if ( bAsianVertical )
bGrowCentered = bGrowToLeft = false; // keep old behavior for asian mode
- long nSizeXPix, nSizeXPTwips = 0;
+ tools::Long nSizeXPix, nSizeXPTwips = 0;
- const long nGridWidthPx = pView->GetGridWidth(eHWhich);
- const long nGridHeightPx = pView->GetGridHeight(eVWhich);
- long nGridWidthTwips = 0, nGridHeightTwips = 0;
+ const tools::Long nGridWidthPx = pView->GetGridWidth(eHWhich);
+ const tools::Long nGridHeightPx = pView->GetGridHeight(eVWhich);
+ tools::Long nGridWidthTwips = 0, nGridHeightTwips = 0;
if (bLOKPrintTwips)
{
Size aGridSize(nGridWidthPx, nGridHeightPx);
@@ -1622,13 +1622,13 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich,
{
// growing into both directions until one edge is reached
//! should be limited to whole cells in both directions
- long nLeft = aPixRect.Left();
- long nRight = nGridWidthPx - aPixRect.Right();
+ tools::Long nLeft = aPixRect.Left();
+ tools::Long nRight = nGridWidthPx - aPixRect.Right();
nSizeXPix = aPixRect.GetWidth() + 2 * std::min( nLeft, nRight );
if (bLOKPrintTwips)
{
- long nLeftPTwips = aPTwipsRect.Left();
- long nRightPTwips = nGridWidthTwips - aPTwipsRect.Right();
+ tools::Long nLeftPTwips = aPTwipsRect.Left();
+ tools::Long nRightPTwips = nGridWidthTwips - aPTwipsRect.Right();
nSizeXPTwips = aPTwipsRect.GetWidth() + 2 * std::min(nLeftPTwips, nRightPTwips);
}
}
@@ -1653,8 +1653,8 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich,
}
}
OSL_ENSURE(pView,"no View for EditView");
- long nSizeYPix = nGridHeightPx - aPixRect.Top();
- long nSizeYPTwips = bLOKPrintTwips ? (nGridHeightTwips - aPTwipsRect.Top()) : 0;
+ tools::Long nSizeYPix = nGridHeightPx - aPixRect.Top();
+ tools::Long nSizeYPTwips = bLOKPrintTwips ? (nGridHeightTwips - aPTwipsRect.Top()) : 0;
if ( nSizeYPix <= 0 )
{
@@ -1690,8 +1690,8 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich,
if (bLOKPrintTwips)
aVisPTwips = pEditView[eWhich]->GetLOKSpecialVisArea();
- long nDiff = aVis.Right() - aVis.Left();
- long nDiffPTwips = bLOKPrintTwips ? (aVisPTwips.Right() - aVisPTwips.Left()) : 0;
+ tools::Long nDiff = aVis.Right() - aVis.Left();
+ tools::Long nDiffPTwips = bLOKPrintTwips ? (aVisPTwips.Right() - aVisPTwips.Left()) : 0;
if ( GetEditAdjust() == SvxAdjust::Right )
{
aVis.SetRight( aPaper.Width() - 1 );
@@ -1820,10 +1820,10 @@ void ScViewData::EditGrowX()
if (bLOKPrintTwips)
aAreaPTwips = pCurView->GetLOKSpecialOutputArea();
- long nOldRight = aArea.Right();
+ tools::Long nOldRight = aArea.Right();
// Margin is already included in the original width.
- long nTextWidth = pEngine->CalcTextWidth();
+ tools::Long nTextWidth = pEngine->CalcTextWidth();
bool bChanged = false;
bool bAsianVertical = pEngine->IsVertical();
@@ -1844,24 +1844,24 @@ void ScViewData::EditGrowX()
{
while (aArea.GetWidth() + 0 < nTextWidth && ( nEditStartCol > nLeft || nEditEndCol < nRight ) )
{
- long nLogicLeft = 0;
- long nLogicLeftPTwips = 0;
+ tools::Long nLogicLeft = 0;
+ tools::Long nLogicLeftPTwips = 0;
if ( nEditStartCol > nLeft )
{
--nEditStartCol;
- long nColWidth = rLocalDoc.GetColWidth( nEditStartCol, nTabNo );
- long nLeftPix = ToPixel( nColWidth, nPPTX );
+ tools::Long nColWidth = rLocalDoc.GetColWidth( nEditStartCol, nTabNo );
+ tools::Long nLeftPix = ToPixel( nColWidth, nPPTX );
nLogicLeft = pWin->PixelToLogic(Size(nLeftPix,0)).Width();
if (bLOKPrintTwips)
nLogicLeftPTwips = nColWidth;
}
- long nLogicRight = 0;
- long nLogicRightPTwips = 0;
+ tools::Long nLogicRight = 0;
+ tools::Long nLogicRightPTwips = 0;
if ( nEditEndCol < nRight )
{
++nEditEndCol;
- long nColWidth = rLocalDoc.GetColWidth( nEditEndCol, nTabNo );
- long nRightPix = ToPixel( nColWidth, nPPTX );
+ tools::Long nColWidth = rLocalDoc.GetColWidth( nEditEndCol, nTabNo );
+ tools::Long nRightPix = ToPixel( nColWidth, nPPTX );
nLogicRight = pWin->PixelToLogic(Size(nRightPix,0)).Width();
if (bLOKPrintTwips)
nLogicRightPTwips = nColWidth;
@@ -1877,15 +1877,15 @@ void ScViewData::EditGrowX()
if ( aArea.Right() > aArea.Left() + aSize.Width() - 1 )
{
- long nCenter = ( aArea.Left() + aArea.Right() ) / 2;
- long nHalf = aSize.Width() / 2;
+ tools::Long nCenter = ( aArea.Left() + aArea.Right() ) / 2;
+ tools::Long nHalf = aSize.Width() / 2;
aArea.SetLeft( nCenter - nHalf + 1 );
aArea.SetRight( nCenter + aSize.Width() - nHalf - 1 );
if (bLOKPrintTwips)
{
- long nCenterPTwips = ( aAreaPTwips.Left() + aAreaPTwips.Right() ) / 2;
- long nHalfPTwips = aSizePTwips.Width() / 2;
+ tools::Long nCenterPTwips = ( aAreaPTwips.Left() + aAreaPTwips.Right() ) / 2;
+ tools::Long nHalfPTwips = aSizePTwips.Width() / 2;
aAreaPTwips.SetLeft( nCenterPTwips - nHalfPTwips + 1 );
aAreaPTwips.SetRight( nCenterPTwips + aSizePTwips.Width() - nHalfPTwips - 1 );
}
@@ -1901,10 +1901,10 @@ void ScViewData::EditGrowX()
while (aArea.GetWidth() + 0 < nTextWidth && nEditStartCol > nLeft)
{
--nEditStartCol;
- long nColWidth = rLocalDoc.GetColWidth( nEditStartCol, nTabNo );
- long nPix = ToPixel( nColWidth, nPPTX );
- long nLogicWidth = pWin->PixelToLogic(Size(nPix,0)).Width();
- long& nLogicWidthPTwips = nColWidth;
+ tools::Long nColWidth = rLocalDoc.GetColWidth( nEditStartCol, nTabNo );
+ tools::Long nPix = ToPixel( nColWidth, nPPTX );
+ tools::Long nLogicWidth = pWin->PixelToLogic(Size(nPix,0)).Width();
+ tools::Long& nLogicWidthPTwips = nColWidth;
if ( !bLayoutRTL )
{
@@ -1943,10 +1943,10 @@ void ScViewData::EditGrowX()
while (aArea.GetWidth() + 0 < nTextWidth && nEditEndCol < nRight)
{
++nEditEndCol;
- long nColWidth = rLocalDoc.GetColWidth( nEditEndCol, nTabNo );
- long nPix = ToPixel( nColWidth, nPPTX );
- long nLogicWidth = pWin->PixelToLogic(Size(nPix,0)).Width();
- long& nLogicWidthPTwips = nColWidth;
+ tools::Long nColWidth = rLocalDoc.GetColWidth( nEditEndCol, nTabNo );
+ tools::Long nPix = ToPixel( nColWidth, nPPTX );
+ tools::Long nLogicWidth = pWin->PixelToLogic(Size(nPix,0)).Width();
+ tools::Long& nLogicWidthPTwips = nColWidth;
if ( bLayoutRTL )
{
aArea.AdjustLeft( -nLogicWidth );
@@ -1996,15 +1996,15 @@ void ScViewData::EditGrowX()
pEngine->SetDefaultItem( SvxAdjustItem( SvxAdjust::Center, EE_PARA_JUST ) );
- long nCenter = aSize.Width() / 2;
- long nVisSize = aArea.GetWidth();
+ tools::Long nCenter = aSize.Width() / 2;
+ tools::Long nVisSize = aArea.GetWidth();
aVis.SetLeft( nCenter - nVisSize / 2 );
aVis.SetRight( aVis.Left() + nVisSize - 1 );
if (bLOKPrintTwips)
{
- long nCenterPTwips = aSizePTwips.Width() / 2;
- long nVisSizePTwips = aAreaPTwips.GetWidth();
+ tools::Long nCenterPTwips = aSizePTwips.Width() / 2;
+ tools::Long nVisSizePTwips = aAreaPTwips.GetWidth();
aVisPTwips.SetLeft( nCenterPTwips - nVisSizePTwips / 2 );
aVisPTwips.SetRight( aVisPTwips.Left() + nVisSizePTwips - 1 );
}
@@ -2030,13 +2030,13 @@ void ScViewData::EditGrowX()
pEngine->SetDefaultItem( SvxAdjustItem( SvxAdjust::Left, EE_PARA_JUST ) );
- long nMove = aVis.Left();
+ tools::Long nMove = aVis.Left();
aVis.SetLeft( 0 );
aVis.AdjustRight( -nMove );
if (bLOKPrintTwips)
{
- long nMovePTwips = aVisPTwips.Left();
+ tools::Long nMovePTwips = aVisPTwips.Left();
aVisPTwips.SetLeft( 0 );
aVisPTwips.AdjustRight( -nMovePTwips );
}
@@ -2115,13 +2115,13 @@ void ScViewData::EditGrowY( bool bInitial )
aAreaPTwips = pCurView->GetLOKSpecialOutputArea();
}
- long nOldBottom = aArea.Bottom();
- long nTextHeight = pEngine->GetTextHeight();
+ tools::Long nOldBottom = aArea.Bottom();
+ tools::Long nTextHeight = pEngine->GetTextHeight();
// When editing a formula in a cell with optimal height, allow a larger portion
// to be clipped before extending to following rows, to avoid obscuring cells for
// reference input (next row is likely to be useful in formulas).
- long nAllowedExtra = SC_GROWY_SMALL_EXTRA;
+ tools::Long nAllowedExtra = SC_GROWY_SMALL_EXTRA;
if (nEditEndRow == nEditRow && !(mrDoc.GetRowFlags(nEditRow, nTabNo) & CRFlags::ManualSize) &&
pEngine->GetParagraphCount() <= 1 )
{
@@ -2141,8 +2141,8 @@ void ScViewData::EditGrowY( bool bInitial )
{
++nEditEndRow;
ScDocument& rLocalDoc = GetDocument();
- long nRowHeight = rLocalDoc.GetRowHeight( nEditEndRow, nTabNo );
- long nPix = ToPixel( nRowHeight, nPPTY );
+ tools::Long nRowHeight = rLocalDoc.GetRowHeight( nEditEndRow, nTabNo );
+ tools::Long nPix = ToPixel( nRowHeight, nPPTY );
aArea.AdjustBottom(pWin->PixelToLogic(Size(0,nPix)).Height() );
if (bLOKPrintTwips)
aAreaPTwips.AdjustBottom(nRowHeight);
@@ -2358,7 +2358,7 @@ Point ScViewData::GetScrPos( SCCOL nWhereX, SCROW nWhereY, ScSplitPos eWhich,
SCCOL nPosX = GetPosX(eWhichX, nForTab);
- long nScrPosX = 0;
+ tools::Long nScrPosX = 0;
if (bAllowNeg || nWhereX >= nPosX)
{
@@ -2382,7 +2382,7 @@ Point ScViewData::GetScrPos( SCCOL nWhereX, SCROW nWhereY, ScSplitPos eWhich,
nTSize = mrDoc.GetColWidth(nX, nForTab);
if (nTSize)
{
- long nSizeXPix = ToPixel( nTSize, nPPTX );
+ tools::Long nSizeXPix = ToPixel( nTSize, nPPTX );
nScrPosX += nSizeXPix;
}
}
@@ -2396,7 +2396,7 @@ Point ScViewData::GetScrPos( SCCOL nWhereX, SCROW nWhereY, ScSplitPos eWhich,
nTSize = mrDoc.GetColWidth(nX, nForTab);
if (nTSize)
{
- long nSizeXPix = ToPixel( nTSize, nPPTX );
+ tools::Long nSizeXPix = ToPixel( nTSize, nPPTX );
nScrPosX -= nSizeXPix;
}
}
@@ -2406,7 +2406,7 @@ Point ScViewData::GetScrPos( SCCOL nWhereX, SCROW nWhereY, ScSplitPos eWhich,
SCROW nPosY = GetPosY(eWhichY, nForTab);
- long nScrPosY = 0;
+ tools::Long nScrPosY = 0;
if (bAllowNeg || nWhereY >= nPosY)
{
@@ -2446,7 +2446,7 @@ Point ScViewData::GetScrPos( SCCOL nWhereX, SCROW nWhereY, ScSplitPos eWhich,
nTSize = mrDoc.GetRowHeight(nY, nForTab);
if (nTSize)
{
- long nSizeYPix = ToPixel( nTSize, nPPTY );
+ tools::Long nSizeYPix = ToPixel( nTSize, nPPTY );
nScrPosY -= nSizeYPix;
}
}
@@ -2466,9 +2466,9 @@ Point ScViewData::GetPrintTwipsPos(SCCOL nCol, SCROW nRow) const
{
// hidden ones are given 0 sizes by these by default.
// TODO: rewrite this to loop over spans (matters for jumbosheets).
- long nPosX = nCol ? mrDoc.GetColWidth(0, nCol - 1, nTabNo) : 0;
+ tools::Long nPosX = nCol ? mrDoc.GetColWidth(0, nCol - 1, nTabNo) : 0;
// This is now fast as it loops over spans.
- long nPosY = nRow ? mrDoc.GetRowHeight(0, nRow - 1, nTabNo) : 0;
+ tools::Long nPosY = nRow ? mrDoc.GetRowHeight(0, nRow - 1, nTabNo) : 0;
// TODO: adjust for RTL layout case.
return Point(nPosX, nPosY);
@@ -2476,8 +2476,8 @@ Point ScViewData::GetPrintTwipsPos(SCCOL nCol, SCROW nRow) const
Point ScViewData::GetPrintTwipsPosFromTileTwips(const Point& rTileTwipsPos) const
{
- const long nPixelX = static_cast<long>(rTileTwipsPos.X() * nPPTX);
- const long nPixelY = static_cast<long>(rTileTwipsPos.Y() * nPPTY);
+ const tools::Long nPixelX = static_cast<tools::Long>(rTileTwipsPos.X() * nPPTX);
+ const tools::Long nPixelY = static_cast<tools::Long>(rTileTwipsPos.Y() * nPPTY);
SCCOL nCol = 0;
SCROW nRow = 0;
@@ -2495,8 +2495,8 @@ OString ScViewData::describeCellCursorAt(SCCOL nX, SCROW nY, bool bPixelAligned)
Point aCellPos = bPosSizeInPixels ? GetScrPos( nX, nY, SC_SPLIT_BOTTOMRIGHT, true ) :
GetPrintTwipsPos(nX, nY);
- long nSizeX;
- long nSizeY;
+ tools::Long nSizeX;
+ tools::Long nSizeY;
if (bPosSizeInPixels)
GetMergeSizePixel( nX, nY, nSizeX, nSizeY );
else
@@ -2515,11 +2515,11 @@ OString ScViewData::describeCellCursorAt(SCCOL nX, SCROW nY, bool bPixelAligned)
if (nSizeY == 0)
nSizeY = 1;
- long nPosXTw = rtl::math::round(aCellPos.getX() / fPPTX);
- long nPosYTw = rtl::math::round(aCellPos.getY() / fPPTY);
+ tools::Long nPosXTw = rtl::math::round(aCellPos.getX() / fPPTX);
+ tools::Long nPosYTw = rtl::math::round(aCellPos.getY() / fPPTY);
// look at Rectangle( const Point& rLT, const Size& rSize ) for the '- 1'
- long nSizeXTw = rtl::math::round(nSizeX / fPPTX) - 1;
- long nSizeYTw = rtl::math::round(nSizeY / fPPTY) - 1;
+ tools::Long nSizeXTw = rtl::math::round(nSizeX / fPPTX) - 1;
+ tools::Long nSizeYTw = rtl::math::round(nSizeY / fPPTY) - 1;
ss << nPosXTw << ", " << nPosYTw << ", " << nSizeXTw << ", " << nSizeYTw << ", "
<< nX << ", " << nY;
@@ -2567,7 +2567,7 @@ SCCOL ScViewData::CellsAtX( SCCOL nPosX, SCCOL nDir, ScHSplitPos eWhichX, sal_uI
sal_uInt16 nTSize = mrDoc.GetColWidth(nColNo, nTabNo);
if (nTSize)
{
- long nSizeXPix = ToPixel( nTSize, nPPTX );
+ tools::Long nSizeXPix = ToPixel( nTSize, nPPTX );
nScrPosX = sal::static_int_cast<sal_uInt16>( nScrPosX + static_cast<sal_uInt16>(nSizeXPix) );
}
}
@@ -2597,7 +2597,7 @@ SCROW ScViewData::CellsAtY( SCROW nPosY, SCROW nDir, ScVSplitPos eWhichY, sal_uI
{
// forward
nY = nPosY;
- long nScrPosY = 0;
+ tools::Long nScrPosY = 0;
AddPixelsWhile(nScrPosY, nScrSizeY, nY, mrDoc.MaxRow(), nPPTY, &mrDoc, nTabNo);
// Original loop ended on last evaluated +1 or if that was MaxRow even on MaxRow+2.
nY += (nY == mrDoc.MaxRow() ? 2 : 1);
@@ -2607,7 +2607,7 @@ SCROW ScViewData::CellsAtY( SCROW nPosY, SCROW nDir, ScVSplitPos eWhichY, sal_uI
{
// backward
nY = nPosY-1;
- long nScrPosY = 0;
+ tools::Long nScrPosY = 0;
AddPixelsWhileBackward(nScrPosY, nScrSizeY, nY, 0, nPPTY, &mrDoc, nTabNo);
// Original loop ended on last evaluated -1 or if that was 0 even on -2.
nY -= (nY == 0 ? 2 : 1);
@@ -2638,13 +2638,13 @@ SCROW ScViewData::PrevCellsY( ScVSplitPos eWhichY ) const
return CellsAtY( GetPosY( eWhichY ), -1, eWhichY );
}
-bool ScViewData::GetMergeSizePixel( SCCOL nX, SCROW nY, long& rSizeXPix, long& rSizeYPix ) const
+bool ScViewData::GetMergeSizePixel( SCCOL nX, SCROW nY, tools::Long& rSizeXPix, tools::Long& rSizeYPix ) const
{
const ScMergeAttr* pMerge = mrDoc.GetAttr(nX, nY, nTabNo, ATTR_MERGE);
if ( pMerge->GetColMerge() > 1 || pMerge->GetRowMerge() > 1 )
{
- long nOutWidth = 0;
- long nOutHeight = 0;
+ tools::Long nOutWidth = 0;
+ tools::Long nOutHeight = 0;
SCCOL nCountX = pMerge->GetColMerge();
for (SCCOL i=0; i<nCountX; i++)
nOutWidth += ToPixel(mrDoc.GetColWidth(nX + i, nTabNo), nPPTX);
@@ -2675,7 +2675,7 @@ bool ScViewData::GetMergeSizePixel( SCCOL nX, SCROW nY, long& rSizeXPix, long& r
}
}
-bool ScViewData::GetMergeSizePrintTwips(SCCOL nX, SCROW nY, long& rSizeXTwips, long& rSizeYTwips) const
+bool ScViewData::GetMergeSizePrintTwips(SCCOL nX, SCROW nY, tools::Long& rSizeXTwips, tools::Long& rSizeYTwips) const
{
const ScMergeAttr* pMerge = mrDoc.GetAttr(nX, nY, nTabNo, ATTR_MERGE);
SCCOL nCountX = pMerge->GetColMerge();
@@ -2691,7 +2691,7 @@ bool ScViewData::GetMergeSizePrintTwips(SCCOL nX, SCROW nY, long& rSizeXTwips, l
return (nCountX > 1 || nCountY > 1);
}
-void ScViewData::GetPosFromPixel( long nClickX, long nClickY, ScSplitPos eWhich,
+void ScViewData::GetPosFromPixel( tools::Long nClickX, tools::Long nClickY, ScSplitPos eWhich,
SCCOL& rPosX, SCROW& rPosY,
bool bTestMerge, bool bRepair, SCTAB nForTab )
{
@@ -2722,8 +2722,8 @@ void ScViewData::GetPosFromPixel( long nClickX, long nClickY, ScSplitPos eWhich,
SCROW nStartPosY = GetPosY(eVWhich, nForTab);
rPosX = nStartPosX;
rPosY = nStartPosY;
- long nScrX = 0;
- long nScrY = 0;
+ tools::Long nScrX = 0;
+ tools::Long nScrY = 0;
if (nClickX > 0)
{
@@ -2807,11 +2807,11 @@ void ScViewData::GetMouseQuadrant( const Point& rClickPos, ScSplitPos eWhich,
SCCOL nPosX, SCROW nPosY, bool& rLeft, bool& rTop )
{
bool bLayoutRTL = mrDoc.IsLayoutRTL(nTabNo);
- long nLayoutSign = bLayoutRTL ? -1 : 1;
+ tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
Point aCellStart = GetScrPos( nPosX, nPosY, eWhich, true );
- long nSizeX;
- long nSizeY;
+ tools::Long nSizeX;
+ tools::Long nSizeY;
GetMergeSizePixel( nPosX, nPosY, nSizeX, nSizeY );
rLeft = ( rClickPos.X() - aCellStart.X() ) * nLayoutSign <= nSizeX / 2;
rTop = rClickPos.Y() - aCellStart.Y() <= nSizeY / 2;
@@ -2824,27 +2824,27 @@ void ScViewData::SetPosX( ScHSplitPos eWhich, SCCOL nNewPosX )
if (nNewPosX != 0 && !bIsTiledRendering)
{
SCCOL nOldPosX = pThisTab->nPosX[eWhich];
- long nTPosX = pThisTab->nTPosX[eWhich];
- long nPixPosX = pThisTab->nPixPosX[eWhich];
+ tools::Long nTPosX = pThisTab->nTPosX[eWhich];
+ tools::Long nPixPosX = pThisTab->nPixPosX[eWhich];
SCCOL i;
if ( nNewPosX > nOldPosX )
for ( i=nOldPosX; i<nNewPosX; i++ )
{
- long nThis = mrDoc.GetColWidth(i, nTabNo);
+ tools::Long nThis = mrDoc.GetColWidth(i, nTabNo);
nTPosX -= nThis;
nPixPosX -= ToPixel(sal::static_int_cast<sal_uInt16>(nThis), nPPTX);
}
else
for ( i=nNewPosX; i<nOldPosX; i++ )
{
- long nThis = mrDoc.GetColWidth(i, nTabNo);
+ tools::Long nThis = mrDoc.GetColWidth(i, nTabNo);
nTPosX += nThis;
nPixPosX += ToPixel(sal::static_int_cast<sal_uInt16>(nThis), nPPTX);
}
pThisTab->nPosX[eWhich] = nNewPosX;
pThisTab->nTPosX[eWhich] = nTPosX;
- pThisTab->nMPosX[eWhich] = static_cast<long>(nTPosX * HMM_PER_TWIPS);
+ pThisTab->nMPosX[eWhich] = static_cast<tools::Long>(nTPosX * HMM_PER_TWIPS);
pThisTab->nPixPosX[eWhich] = nPixPosX;
}
else
@@ -2863,13 +2863,13 @@ void ScViewData::SetPosY( ScVSplitPos eWhich, SCROW nNewPosY )
if (nNewPosY != 0 && !bIsTiledRendering)
{
SCROW nOldPosY = pThisTab->nPosY[eWhich];
- long nTPosY = pThisTab->nTPosY[eWhich];
- long nPixPosY = pThisTab->nPixPosY[eWhich];
+ tools::Long nTPosY = pThisTab->nTPosY[eWhich];
+ tools::Long nPixPosY = pThisTab->nPixPosY[eWhich];
SCROW i, nHeightEndRow;
if ( nNewPosY > nOldPosY )
for ( i=nOldPosY; i<nNewPosY; i++ )
{
- long nThis = mrDoc.GetRowHeight(i, nTabNo, nullptr, &nHeightEndRow);
+ tools::Long nThis = mrDoc.GetRowHeight(i, nTabNo, nullptr, &nHeightEndRow);
SCROW nRows = std::min( nNewPosY, nHeightEndRow + 1) - i;
i = nHeightEndRow;
nTPosY -= nThis * nRows;
@@ -2878,7 +2878,7 @@ void ScViewData::SetPosY( ScVSplitPos eWhich, SCROW nNewPosY )
else
for ( i=nNewPosY; i<nOldPosY; i++ )
{
- long nThis = mrDoc.GetRowHeight(i, nTabNo, nullptr, &nHeightEndRow);
+ tools::Long nThis = mrDoc.GetRowHeight(i, nTabNo, nullptr, &nHeightEndRow);
SCROW nRows = std::min( nOldPosY, nHeightEndRow + 1) - i;
i = nHeightEndRow;
nTPosY += nThis * nRows;
@@ -2887,7 +2887,7 @@ void ScViewData::SetPosY( ScVSplitPos eWhich, SCROW nNewPosY )
pThisTab->nPosY[eWhich] = nNewPosY;
pThisTab->nTPosY[eWhich] = nTPosY;
- pThisTab->nMPosY[eWhich] = static_cast<long>(nTPosY * HMM_PER_TWIPS);
+ pThisTab->nMPosY[eWhich] = static_cast<tools::Long>(nTPosY * HMM_PER_TWIPS);
pThisTab->nPixPosY[eWhich] = nPixPosY;
}
else
@@ -2903,13 +2903,13 @@ void ScViewData::RecalcPixPos() // after zoom changes
{
for (sal_uInt16 eWhich=0; eWhich<2; eWhich++)
{
- long nPixPosX = 0;
+ tools::Long nPixPosX = 0;
SCCOL nPosX = pThisTab->nPosX[eWhich];
for (SCCOL i=0; i<nPosX; i++)
nPixPosX -= ToPixel(mrDoc.GetColWidth(i, nTabNo), nPPTX);
pThisTab->nPixPosX[eWhich] = nPixPosX;
- long nPixPosY = 0;
+ tools::Long nPixPosY = 0;
SCROW nPosY = pThisTab->nPosY[eWhich];
for (SCROW j=0; j<nPosY; j++)
nPixPosY -= ToPixel(mrDoc.GetRowHeight(j, nTabNo), nPPTY);
@@ -2935,9 +2935,9 @@ void ScViewData::SetScreen( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 )
SCCOL nCol;
SCROW nRow;
sal_uInt16 nTSize;
- long nSizePix;
- long nScrPosX = 0;
- long nScrPosY = 0;
+ tools::Long nSizePix;
+ tools::Long nScrPosX = 0;
+ tools::Long nScrPosY = 0;
SetActivePart( SC_SPLIT_BOTTOMLEFT );
SetPosX( SC_SPLIT_LEFT, nCol1 );
@@ -2968,20 +2968,20 @@ void ScViewData::SetScreen( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 )
void ScViewData::SetScreenPos( const Point& rVisAreaStart )
{
- long nSize;
- long nTwips;
- long nAdd;
+ tools::Long nSize;
+ tools::Long nTwips;
+ tools::Long nAdd;
bool bEnd;
nSize = 0;
- nTwips = static_cast<long>(rVisAreaStart.X() / HMM_PER_TWIPS);
+ nTwips = static_cast<tools::Long>(rVisAreaStart.X() / HMM_PER_TWIPS);
if (mrDoc.IsLayoutRTL(nTabNo))
nTwips = -nTwips;
SCCOL nX1 = 0;
bEnd = false;
while (!bEnd)
{
- nAdd = static_cast<long>(mrDoc.GetColWidth(nX1, nTabNo));
+ nAdd = static_cast<tools::Long>(mrDoc.GetColWidth(nX1, nTabNo));
if (nSize + nAdd <= nTwips + 1 && nX1 < mrDoc.MaxCol())
{
nSize += nAdd;
@@ -2992,12 +2992,12 @@ void ScViewData::SetScreenPos( const Point& rVisAreaStart )
}
nSize = 0;
- nTwips = static_cast<long>(rVisAreaStart.Y() / HMM_PER_TWIPS);
+ nTwips = static_cast<tools::Long>(rVisAreaStart.Y() / HMM_PER_TWIPS);
SCROW nY1 = 0;
bEnd = false;
while (!bEnd)
{
- nAdd = static_cast<long>(mrDoc.GetRowHeight(nY1, nTabNo));
+ nAdd = static_cast<tools::Long>(mrDoc.GetRowHeight(nY1, nTabNo));
if (nSize + nAdd <= nTwips + 1 && nY1 < mrDoc.MaxRow())
{
nSize += nAdd;
@@ -3022,8 +3022,8 @@ void ScViewData::SetScreen( const tools::Rectangle& rVisArea )
// here without GetOutputFactor(), since it's for the output into a Metafile
aScrSize = rVisArea.GetSize();
- aScrSize.setWidth( static_cast<long>( aScrSize.Width() * ScGlobal::nScreenPPTX / HMM_PER_TWIPS ) );
- aScrSize.setHeight( static_cast<long>( aScrSize.Height() * ScGlobal::nScreenPPTY / HMM_PER_TWIPS ) );
+ aScrSize.setWidth( static_cast<tools::Long>( aScrSize.Width() * ScGlobal::nScreenPPTX / HMM_PER_TWIPS ) );
+ aScrSize.setHeight( static_cast<tools::Long>( aScrSize.Height() * ScGlobal::nScreenPPTY / HMM_PER_TWIPS ) );
}
ScDocFunc& ScViewData::GetDocFunc() const
@@ -3098,8 +3098,8 @@ void ScViewData::UpdateScreenZoom( const Fraction& rNewX, const Fraction& rNewY
aHeight *= Fraction( aScrSize.Height(),1 );
aHeight /= aOldY;
- aScrSize.setWidth( static_cast<long>(aWidth) );
- aScrSize.setHeight( static_cast<long>(aHeight) );
+ aScrSize.setWidth( static_cast<tools::Long>(aWidth) );
+ aScrSize.setHeight( static_cast<tools::Long>(aHeight) );
}
void ScViewData::CalcPPT()
@@ -3162,9 +3162,9 @@ void ScViewData::WriteUserData(OUString& rData)
// PosX[left]/PosX[right]/PosY[top]/PosY[bottom]
// when rows bigger than 8192, "+" instead of "/"
- sal_uInt16 nZoom = static_cast<sal_uInt16>(long(pThisTab->aZoomY * 100));
+ sal_uInt16 nZoom = static_cast<sal_uInt16>(tools::Long(pThisTab->aZoomY * 100));
rData = OUString::number( nZoom ) + "/";
- nZoom = static_cast<sal_uInt16>(long(pThisTab->aPageZoomY * 100));
+ nZoom = static_cast<sal_uInt16>(tools::Long(pThisTab->aPageZoomY * 100));
rData += OUString::number( nZoom ) + "/";
if (bPagebreak)
rData += "1";
@@ -3346,8 +3346,8 @@ void ScViewData::WriteExtOptions( ScExtDocOptions& rDocOpt ) const
ScSplitMode eExVSplit = pViewTab->eVSplitMode;
SCCOL nExFixPosX = pViewTab->nFixPosX;
SCROW nExFixPosY = pViewTab->nFixPosY;
- long nExHSplitPos = pViewTab->nHSplitPos;
- long nExVSplitPos = pViewTab->nVSplitPos;
+ tools::Long nExHSplitPos = pViewTab->nHSplitPos;
+ tools::Long nExVSplitPos = pViewTab->nVSplitPos;
if (bLOKActive)
{
@@ -3372,7 +3372,7 @@ void ScViewData::WriteExtOptions( ScExtDocOptions& rDocOpt ) const
rSplitPos = Point( bHSplit ? nExHSplitPos : 0, bVSplit ? nExVSplitPos : 0 );
rSplitPos = Application::GetDefaultDevice()->PixelToLogic( rSplitPos, MapMode( MapUnit::MapTwip ) );
if( pDocShell )
- rSplitPos.setX( static_cast<long>(static_cast<double>(rSplitPos.X()) / pDocShell->GetOutputFactor()) );
+ rSplitPos.setX( static_cast<tools::Long>(static_cast<double>(rSplitPos.X()) / pDocShell->GetOutputFactor()) );
}
else if( bFrozen )
{
@@ -3422,8 +3422,8 @@ void ScViewData::WriteExtOptions( ScExtDocOptions& rDocOpt ) const
// view mode and zoom
rTabSett.mbPageMode = bPagebreak;
- rTabSett.mnNormalZoom = static_cast< long >( pViewTab->aZoomY * Fraction( 100.0 ) );
- rTabSett.mnPageZoom = static_cast< long >( pViewTab->aPageZoomY * Fraction( 100.0 ) );
+ rTabSett.mnNormalZoom = static_cast< tools::Long >( pViewTab->aZoomY * Fraction( 100.0 ) );
+ rTabSett.mnPageZoom = static_cast< tools::Long >( pViewTab->aPageZoomY * Fraction( 100.0 ) );
}
}
}
@@ -3509,7 +3509,7 @@ void ScViewData::ReadExtOptions( const ScExtDocOptions& rDocOpt )
if( pDocShell && SC_MOD()->GetInputOptions().GetTextWysiwyg())
{
double nFactor = pDocShell->GetOutputFactor();
- aPixel.setX( static_cast<long>( aPixel.X() * nFactor + 0.5 ) );
+ aPixel.setX( static_cast<tools::Long>( aPixel.X() * nFactor + 0.5 ) );
}
bHSplit = bHSplit && aPixel.X() > 0;
@@ -3640,8 +3640,8 @@ void ScViewData::WriteUserDataSequence(uno::Sequence <beans::PropertyValue>& rSe
pSettings[SC_ACTIVE_TABLE].Value <<= sName;
pSettings[SC_HORIZONTAL_SCROLL_BAR_WIDTH].Name = SC_HORIZONTALSCROLLBARWIDTH;
pSettings[SC_HORIZONTAL_SCROLL_BAR_WIDTH].Value <<= sal_Int32(pView->GetTabBarWidth());
- sal_Int32 nZoomValue = long(pThisTab->aZoomY * 100);
- sal_Int32 nPageZoomValue = long(pThisTab->aPageZoomY * 100);
+ sal_Int32 nZoomValue = tools::Long(pThisTab->aZoomY * 100);
+ sal_Int32 nPageZoomValue = tools::Long(pThisTab->aPageZoomY * 100);
pSettings[SC_ZOOM_TYPE].Name = SC_ZOOMTYPE;
pSettings[SC_ZOOM_TYPE].Value <<= sal_Int16(pThisTab->eZoomType);
pSettings[SC_ZOOM_VALUE].Name = SC_ZOOMVALUE;
@@ -3916,13 +3916,13 @@ bool ScViewData::UpdateFixX( SCTAB nTab ) // true = value chan
return false;
SCCOL nFix = maTabData[nTab]->nFixPosX;
- long nNewPos = 0;
+ tools::Long nNewPos = 0;
for (SCCOL nX=maTabData[nTab]->nPosX[SC_SPLIT_LEFT]; nX<nFix; nX++)
{
sal_uInt16 nTSize = rLocalDoc.GetColWidth( nX, nTab );
if (nTSize)
{
- long nPix = ToPixel( nTSize, nPPTX );
+ tools::Long nPix = ToPixel( nTSize, nPPTX );
nNewPos += nPix;
}
}
@@ -3951,13 +3951,13 @@ bool ScViewData::UpdateFixY( SCTAB nTab ) // true = value changed
return false;
SCROW nFix = maTabData[nTab]->nFixPosY;
- long nNewPos = 0;
+ tools::Long nNewPos = 0;
for (SCROW nY=maTabData[nTab]->nPosY[SC_SPLIT_TOP]; nY<nFix; nY++)
{
sal_uInt16 nTSize = rLocalDoc.GetRowHeight( nY, nTab );
if (nTSize)
{
- long nPix = ToPixel( nTSize, nPPTY );
+ tools::Long nPix = ToPixel( nTSize, nPPTY );
nNewPos += nPix;
}
}
@@ -4019,7 +4019,7 @@ void ScViewData::SetRefEnd( SCCOL nNewX, SCROW nNewY, SCTAB nNewZ )
nRefEndX = nNewX; nRefEndY = nNewY; nRefEndZ = nNewZ;
}
-void ScViewData::AddPixelsWhile( long & rScrY, long nEndPixels, SCROW & rPosY,
+void ScViewData::AddPixelsWhile( tools::Long & rScrY, tools::Long nEndPixels, SCROW & rPosY,
SCROW nEndRow, double nPPTY, const ScDocument * pDoc, SCTAB nTabNo )
{
SCROW nRow = rPosY;
@@ -4048,7 +4048,7 @@ void ScViewData::AddPixelsWhile( long & rScrY, long nEndPixels, SCROW & rPosY,
nAdd += nPixel;
}
}
- rScrY += static_cast<long>(nAdd);
+ rScrY += static_cast<tools::Long>(nAdd);
nRow += nRows;
}
}
@@ -4057,7 +4057,7 @@ void ScViewData::AddPixelsWhile( long & rScrY, long nEndPixels, SCROW & rPosY,
rPosY = nRow;
}
-void ScViewData::AddPixelsWhileBackward( long & rScrY, long nEndPixels,
+void ScViewData::AddPixelsWhileBackward( tools::Long & rScrY, tools::Long nEndPixels,
SCROW & rPosY, SCROW nStartRow, double nPPTY, const ScDocument * pDoc,
SCTAB nTabNo )
{
@@ -4087,7 +4087,7 @@ void ScViewData::AddPixelsWhileBackward( long & rScrY, long nEndPixels,
nAdd += nPixel;
}
}
- rScrY += static_cast<long>(nAdd);
+ rScrY += static_cast<tools::Long>(nAdd);
nRow -= nRows;
}
}
@@ -4192,7 +4192,7 @@ void ScViewData::DeriveLOKFreezeIfNeeded(SCTAB nForTab)
void ScViewData::OverrideWithLOKFreeze(ScSplitMode& eExHSplitMode, ScSplitMode& eExVSplitMode,
SCCOL& nExFixPosX, SCROW& nExFixPosY,
- long& nExHSplitPos, long& nExVSplitPos, SCTAB nForTab) const
+ tools::Long& nExHSplitPos, tools::Long& nExVSplitPos, SCTAB nForTab) const
{
SCCOL nFreezeCol = mrDoc.GetLOKFreezeCol(nForTab);
SCROW nFreezeRow = mrDoc.GetLOKFreezeRow(nForTab);
diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index 34671477914d..227f53b04a9b 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -93,13 +93,13 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId,
// Window MapMode isn't drawing MapMode if DrawingLayer hasn't been created yet
SCTAB nTab = GetViewData().GetTabNo();
- long nXT = 0;
+ tools::Long nXT = 0;
for (SCCOL i=0; i<nPosX; i++)
nXT += rDoc.GetColWidth(i,nTab);
if (rDoc.IsNegativePage(nTab))
nXT = -nXT;
sal_uLong nYT = rDoc.GetRowHeight( 0, nPosY-1, nTab);
- aPos = Point( static_cast<long>(nXT * HMM_PER_TWIPS), static_cast<long>(nYT * HMM_PER_TWIPS) );
+ aPos = Point( static_cast<tools::Long>(nXT * HMM_PER_TWIPS), static_cast<tools::Long>(nYT * HMM_PER_TWIPS) );
}
}
diff --git a/sc/source/ui/view/viewfun7.cxx b/sc/source/ui/view/viewfun7.cxx
index 659a42141870..a59fa3ab0144 100644
--- a/sc/source/ui/view/viewfun7.cxx
+++ b/sc/source/ui/view/viewfun7.cxx
@@ -58,8 +58,8 @@ static void lcl_AdjustInsertPos( ScViewData& rData, Point& rPos, const Size& rSi
Size aPgSize( pPage->GetSize() );
if (aPgSize.Width() < 0)
aPgSize.setWidth( -aPgSize.Width() );
- long x = aPgSize.Width() - rPos.X() - rSize.Width();
- long y = aPgSize.Height() - rPos.Y() - rSize.Height();
+ tools::Long x = aPgSize.Width() - rPos.X() - rSize.Width();
+ tools::Long y = aPgSize.Height() - rPos.Y() - rSize.Height();
// if necessary: adjustments (80/200) for pixel approx. errors
if( x < 0 )
rPos.AdjustX(x + 80 );
@@ -119,8 +119,8 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel,
// copy locally - incl. charts
Point aSourceStart = pDragEditView->GetAllMarkedRect().TopLeft();
- long nDiffX = aPos.X() - aSourceStart.X();
- long nDiffY = aPos.Y() - aSourceStart.Y();
+ tools::Long nDiffX = aPos.X() - aSourceStart.X();
+ tools::Long nDiffY = aPos.Y() - aSourceStart.Y();
// move within a page?
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index 60674776e7fd..c22effdaa37f 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -1461,7 +1461,7 @@ void ScViewFunc::UpdateStyleSheetInUse( const SfxStyleSheetBase* pStyleSheet )
}
-void ScViewFunc::OnLOKInsertDeleteColumn(SCCOL nStartCol, long nOffset)
+void ScViewFunc::OnLOKInsertDeleteColumn(SCCOL nStartCol, tools::Long nOffset)
{
if (!comphelper::LibreOfficeKit::isActive() || nOffset == 0)
return;
@@ -1517,7 +1517,7 @@ void ScViewFunc::OnLOKInsertDeleteColumn(SCCOL nStartCol, long nOffset)
}
}
-void ScViewFunc::OnLOKInsertDeleteRow(SCROW nStartRow, long nOffset)
+void ScViewFunc::OnLOKInsertDeleteRow(SCROW nStartRow, tools::Long nOffset)
{
if (!comphelper::LibreOfficeKit::isActive() || nOffset == 0)
return;
@@ -2390,7 +2390,7 @@ void ScViewFunc::ModifyCellSize( ScDirection eDir, bool bOptimal )
ScInputHandler* pHdl = pScMod->GetInputHdl( GetViewData().GetViewShell() );
if (pHdl)
{
- long nEdit = pHdl->GetTextSize().Width(); // in 0.01 mm
+ tools::Long nEdit = pHdl->GetTextSize().Width(); // in 0.01 mm
const ScPatternAttr* pPattern = rDoc.GetPattern( nCol, nRow, nTab );
const SvxMarginItem& rMItem = pPattern->GetItem(ATTR_MARGIN);
@@ -2418,7 +2418,7 @@ void ScViewFunc::ModifyCellSize( ScDirection eDir, bool bOptimal )
aZoomX = aZoomY = Fraction( 1, 1 );
}
- long nPixel = rDoc.GetNeededSize( nCol, nRow, nTab, aProv.GetDevice(),
+ tools::Long nPixel = rDoc.GetNeededSize( nCol, nRow, nTab, aProv.GetDevice(),
nPPTX, nPPTY, aZoomX, aZoomY, true );
sal_uInt16 nTwips = static_cast<sal_uInt16>( nPixel / nPPTX );
if (nTwips != 0)