summaryrefslogtreecommitdiff
path: root/sc/source/ui/view
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/view')
-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
36 files changed, 1372 insertions, 1372 deletions
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)