summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-02-24 13:47:25 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-02-26 07:21:04 +0100
commit08ab1f46b192a188935fdffbefdc9f3973583cdf (patch)
tree4c1ecb502f3c3b2a2a8865ea8f84a083b16d310e /sc/source/ui
parent9bc8714308b6f4b85a4c756229ac8b670d009f42 (diff)
loplugin:oncevar extend to tools/gen.hxx types
Change-Id: I5c75875da44334569c02e2ff039b33c38397a0a2 Reviewed-on: https://gerrit.libreoffice.org/50283 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx9
-rw-r--r--sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx3
-rw-r--r--sc/source/ui/Accessibility/AccessiblePreviewTable.cxx3
-rw-r--r--sc/source/ui/Accessibility/AccessibleText.cxx12
-rw-r--r--sc/source/ui/app/drwtrans.cxx3
-rw-r--r--sc/source/ui/app/transobj.cxx3
-rw-r--r--sc/source/ui/dbgui/csvgrid.cxx3
-rw-r--r--sc/source/ui/dbgui/csvruler.cxx3
-rw-r--r--sc/source/ui/miscdlgs/autofmt.cxx3
-rw-r--r--sc/source/ui/sidebar/CellLineStyleValueSet.cxx3
-rw-r--r--sc/source/ui/unoobj/docuno.cxx6
-rw-r--r--sc/source/ui/vba/vbavalidation.cxx3
-rw-r--r--sc/source/ui/view/drawview.cxx3
-rw-r--r--sc/source/ui/view/hdrcont.cxx6
-rw-r--r--sc/source/ui/view/preview.cxx3
15 files changed, 22 insertions, 44 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
index b9f0d3188209..4b7d699ce46e 100644
--- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
@@ -1127,8 +1127,7 @@ ScPagePreviewCountData::ScPagePreviewCountData( const ScPreviewLocationData& rDa
Size aOutputSize;
if ( pSizeWindow )
aOutputSize = pSizeWindow->GetOutputSizePixel();
- Point aPoint;
- aVisRect = tools::Rectangle( aPoint, aOutputSize );
+ aVisRect = tools::Rectangle( Point(), aOutputSize );
tools::Rectangle aObjRect;
@@ -1236,8 +1235,7 @@ void ScAccessibleDocumentPagePreview::Notify( SfxBroadcaster& rBC, const SfxHint
vcl::Window* pSizeWindow = mpViewShell->GetWindow();
if ( pSizeWindow )
aOutputSize = pSizeWindow->GetOutputSizePixel();
- Point aPoint;
- tools::Rectangle aVisRect( aPoint, aOutputSize );
+ tools::Rectangle aVisRect( Point(), aOutputSize );
GetNotesChildren()->DataChanged(aVisRect);
GetShapeChildren()->DataChanged();
@@ -1273,8 +1271,7 @@ void ScAccessibleDocumentPagePreview::Notify( SfxBroadcaster& rBC, const SfxHint
vcl::Window* pSizeWindow = mpViewShell->GetWindow();
if ( pSizeWindow )
aOutputSize = pSizeWindow->GetOutputSizePixel();
- Point aPoint;
- tools::Rectangle aVisRect( aPoint, aOutputSize );
+ tools::Rectangle aVisRect( Point(), aOutputSize );
GetNotesChildren()->DataChanged(aVisRect);
GetShapeChildren()->VisAreaChanged();
diff --git a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
index 6f7a84ae8034..6ba7b9e1e527 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
@@ -405,8 +405,7 @@ void ScAccessiblePreviewHeaderCell::FillTableInfo() const
vcl::Window* pWindow = mpViewShell->GetWindow();
if ( pWindow )
aOutputSize = pWindow->GetOutputSizePixel();
- Point aPoint;
- tools::Rectangle aVisRect( aPoint, aOutputSize );
+ tools::Rectangle aVisRect( Point(), aOutputSize );
mpTableInfo = new ScPreviewTableInfo;
mpViewShell->GetLocationData().GetTableInfo( aVisRect, *mpTableInfo );
diff --git a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
index 912d15af153d..080f2c9c49a8 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
@@ -636,8 +636,7 @@ void ScAccessiblePreviewTable::FillTableInfo() const
vcl::Window* pWindow = mpViewShell->GetWindow();
if ( pWindow )
aOutputSize = pWindow->GetOutputSizePixel();
- Point aPoint;
- tools::Rectangle aVisRect( aPoint, aOutputSize );
+ tools::Rectangle aVisRect( Point(), aOutputSize );
mpTableInfo = new ScPreviewTableInfo;
mpViewShell->GetLocationData().GetTableInfo( aVisRect, *mpTableInfo );
diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx
index e904086483fc..4842d7b211c6 100644
--- a/sc/source/ui/Accessibility/AccessibleText.cxx
+++ b/sc/source/ui/Accessibility/AccessibleText.cxx
@@ -265,9 +265,8 @@ bool ScPreviewViewForwarder::IsValid() const
tools::Rectangle ScPreviewViewForwarder::GetVisArea() const
{
- tools::Rectangle aVisArea;
OSL_FAIL("should be implemented in an abrevated class");
- return aVisArea;
+ return tools::Rectangle();
}
Point ScPreviewViewForwarder::LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const
@@ -325,8 +324,7 @@ tools::Rectangle ScPreviewViewForwarder::GetVisRect() const
vcl::Window* pWindow = mpViewShell->GetWindow();
if ( pWindow )
aOutputSize = pWindow->GetOutputSizePixel();
- Point aPoint;
- tools::Rectangle aVisRect( aPoint, aOutputSize );
+ tools::Rectangle aVisRect( Point(), aOutputSize );
return aVisRect;
}
return tools::Rectangle();
@@ -1274,8 +1272,7 @@ SvxTextForwarder* ScAccessiblePreviewHeaderCellTextData::GetTextForwarder()
vcl::Window* pWindow = mpViewShell->GetWindow();
if ( pWindow )
aOutputSize = pWindow->GetOutputSizePixel();
- Point aPoint;
- tools::Rectangle aVisRect( aPoint, aOutputSize );
+ tools::Rectangle aVisRect( Point(), aOutputSize );
Size aSize(mpViewShell->GetLocationData().GetHeaderCellOutputRect(aVisRect, aCellPos, mbColHeader).GetSize());
if (pWindow)
aSize = pWindow->PixelToLogic(aSize, pEditEngine->GetRefMapMode());
@@ -1501,8 +1498,7 @@ SvxTextForwarder* ScAccessibleNoteTextData::GetTextForwarder()
vcl::Window* pWindow = mpViewShell->GetWindow();
if ( pWindow )
aOutputSize = pWindow->GetOutputSizePixel();
- Point aPoint;
- tools::Rectangle aVisRect( aPoint, aOutputSize );
+ tools::Rectangle aVisRect( Point(), aOutputSize );
Size aSize(mpViewShell->GetLocationData().GetNoteInRangeOutputRect(aVisRect, mbMarkNote, maCellPos).GetSize());
if (pWindow)
aSize = pWindow->PixelToLogic(aSize, mpEditEngine->GetRefMapMode());
diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx
index 6c8863562f66..f379f963fc7f 100644
--- a/sc/source/ui/app/drwtrans.cxx
+++ b/sc/source/ui/app/drwtrans.cxx
@@ -744,8 +744,7 @@ void ScDrawTransferObj::InitDocShell()
}
}
- Point aTmpPoint;
- tools::Rectangle aDestArea( aTmpPoint, aSrcSize );
+ tools::Rectangle aDestArea( Point(), aSrcSize );
pDocSh->SetVisArea( aDestArea );
ScViewOptions aViewOpt( rDestDoc.GetViewOptions() );
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index 0ebf47ef3e7d..0e581e8f10c6 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -102,8 +102,7 @@ void ScTransferObj::PaintToDev( OutputDevice* pDev, ScDocument* pDoc, double nPr
if (!pDoc)
return;
- Point aPoint;
- tools::Rectangle aBound( aPoint, pDev->GetOutputSize() ); //! use size from clip area?
+ tools::Rectangle aBound( Point(), pDev->GetOutputSize() ); //! use size from clip area?
ScViewData aViewData(nullptr,nullptr);
aViewData.InitData( pDoc );
diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx
index 4b7ffb4aabe6..3852ca0f0728 100644
--- a/sc/source/ui/dbgui/csvgrid.cxx
+++ b/sc/source/ui/dbgui/csvgrid.cxx
@@ -988,8 +988,7 @@ void ScCsvGrid::Command( const CommandEvent& rCEvt )
break;
case CommandEventId::Wheel:
{
- Point aPoint;
- tools::Rectangle aRect( aPoint, maWinSize );
+ tools::Rectangle aRect( Point(), maWinSize );
if( aRect.IsInside( rCEvt.GetMousePosPixel() ) )
{
const CommandWheelData* pData = rCEvt.GetWheelData();
diff --git a/sc/source/ui/dbgui/csvruler.cxx b/sc/source/ui/dbgui/csvruler.cxx
index 6087719ab139..6233c6795c03 100644
--- a/sc/source/ui/dbgui/csvruler.cxx
+++ b/sc/source/ui/dbgui/csvruler.cxx
@@ -410,8 +410,7 @@ void ScCsvRuler::MouseMove( const MouseEvent& rMEvt )
}
else
{
- Point aPoint;
- tools::Rectangle aRect( aPoint, maWinSize );
+ tools::Rectangle aRect( Point(), maWinSize );
if( !IsVisibleSplitPos( nPos ) || !aRect.IsInside( rMEvt.GetPosPixel() ) )
// if focused, keep old cursor position for key input
nPos = HasFocus() ? GetRulerCursorPos() : CSV_POS_INVALID;
diff --git a/sc/source/ui/miscdlgs/autofmt.cxx b/sc/source/ui/miscdlgs/autofmt.cxx
index 43a4d0edc146..129cf1df71ce 100644
--- a/sc/source/ui/miscdlgs/autofmt.cxx
+++ b/sc/source/ui/miscdlgs/autofmt.cxx
@@ -507,8 +507,7 @@ void ScAutoFmtPreview::DoPaint(vcl::RenderContext& rRenderContext)
Size aWndSize(GetSizePixel());
vcl::Font aFont(aVD->GetFont());
Color aBackCol(rRenderContext.GetSettings().GetStyleSettings().GetWindowColor());
- Point aTmpPoint;
- tools::Rectangle aRect(aTmpPoint, aWndSize);
+ tools::Rectangle aRect(Point(), aWndSize);
aFont.SetTransparent( true );
aVD->SetFont(aFont);
diff --git a/sc/source/ui/sidebar/CellLineStyleValueSet.cxx b/sc/source/ui/sidebar/CellLineStyleValueSet.cxx
index 27c876e7e7a6..3123a60b3541 100644
--- a/sc/source/ui/sidebar/CellLineStyleValueSet.cxx
+++ b/sc/source/ui/sidebar/CellLineStyleValueSet.cxx
@@ -92,11 +92,10 @@ void CellLineStyleValueSet::UserDraw( const UserDrawEvent& rUDEvt )
if( nSelItem == nItemId )
{
- Color aBackColor(50,107,197);
tools::Rectangle aBackRect = aRect;
aBackRect.AdjustTop(3 );
aBackRect.AdjustBottom( -2 );
- pDev->SetFillColor(aBackColor);
+ pDev->SetFillColor(Color(50,107,197));
pDev->DrawRect(aBackRect);
}
else
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index cd56f7c5872e..a42a0ea3b70c 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -1905,8 +1905,7 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec
{
// Similar to as in and when calling ScTransferObj::PaintToDev()
- Point aPoint;
- tools::Rectangle aBound( aPoint, pDev->GetOutputSize());
+ tools::Rectangle aBound( Point(), pDev->GetOutputSize());
ScViewData aViewData(nullptr,nullptr);
aViewData.InitData( &rDoc );
@@ -4496,11 +4495,10 @@ void SAL_CALL ScScenariosObj::addNewByName( const OUString& aName,
}
}
- Color aColor( COL_LIGHTGRAY ); // Default
ScScenarioFlags const nFlags = ScScenarioFlags::ShowFrame | ScScenarioFlags::PrintFrame
| ScScenarioFlags::TwoWay | ScScenarioFlags::Protected;
- pDocShell->MakeScenario( nTab, aName, aComment, aColor, nFlags, aMarkData );
+ pDocShell->MakeScenario( nTab, aName, aComment, COL_LIGHTGRAY, nFlags, aMarkData );
}
}
diff --git a/sc/source/ui/vba/vbavalidation.cxx b/sc/source/ui/vba/vbavalidation.cxx
index 1be125034e17..a7abaa6921eb 100644
--- a/sc/source/ui/vba/vbavalidation.cxx
+++ b/sc/source/ui/vba/vbavalidation.cxx
@@ -301,7 +301,6 @@ ScVbaValidation::getFormula1()
ScRefFlags nFlags = ScRefFlags::ZERO;
ScRangeList aCellRanges;
- formula::FormulaGrammar::AddressConvention eConv = formula::FormulaGrammar::CONV_XL_A1;
ScDocShell* pDocSh = excel::GetDocShellFromRange( m_xRange );
// in calc validation formula is either a range or formula
@@ -309,7 +308,7 @@ ScVbaValidation::getFormula1()
// In VBA both formula and address can have a leading '='
// in result of getFormula1, however it *seems* that a named range or
// real formula has to (or is expected to) have the '='
- if ( pDocSh && !ScVbaRange::getCellRangesForAddress( nFlags, sString, pDocSh, aCellRanges, eConv, 0 ) )
+ if ( pDocSh && !ScVbaRange::getCellRangesForAddress( nFlags, sString, pDocSh, aCellRanges, formula::FormulaGrammar::CONV_XL_A1, 0 ) )
sString = "=" + sString;
return sString;
}
diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx
index 30c934de4951..47e262ec83f3 100644
--- a/sc/source/ui/view/drawview.cxx
+++ b/sc/source/ui/view/drawview.cxx
@@ -264,9 +264,8 @@ void ScDrawView::UpdateWorkArea()
SdrPage* pPage = GetModel()->GetPage(static_cast<sal_uInt16>(nTab));
if (pPage)
{
- Point aPos;
Size aPageSize( pPage->GetSize() );
- tools::Rectangle aNewArea( aPos, aPageSize );
+ tools::Rectangle aNewArea( Point(), aPageSize );
if ( aPageSize.Width() < 0 )
{
// RTL: from max.negative (left) to zero (right)
diff --git a/sc/source/ui/view/hdrcont.cxx b/sc/source/ui/view/hdrcont.cxx
index 7c0eae5c4306..6a46c87e47a5 100644
--- a/sc/source/ui/view/hdrcont.cxx
+++ b/sc/source/ui/view/hdrcont.cxx
@@ -258,9 +258,8 @@ void ScHeaderControl::Paint( vcl::RenderContext& /*rRenderContext*/, const tools
aBoldFont.SetColor( aSelTextColor );
SetTextColor( ( bBoldSet && !bHighContrast ) ? aSelTextColor : aTextColor );
- Color aBlack( COL_BLACK );
Color aSelLineColor = rStyleSettings.GetHighlightColor();
- aSelLineColor.Merge( aBlack, 0xe0 ); // darken just a little bit
+ aSelLineColor.Merge( COL_BLACK, 0xe0 ); // darken just a little bit
bool bLayoutRTL = IsLayoutRTL();
long nLayoutSign = bLayoutRTL ? -1 : 1;
@@ -707,8 +706,7 @@ void ScHeaderControl::MouseButtonDown( const MouseEvent& rMEvt )
else
{
pSelEngine->SetWindow( this );
- Point aPoint;
- tools::Rectangle aVis( aPoint,GetOutputSizePixel() );
+ tools::Rectangle aVis( Point(), GetOutputSizePixel() );
if (bVertical)
{
aVis.SetLeft( LONG_MIN );
diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx
index f8dc39195800..b3bf1aa0db7e 100644
--- a/sc/source/ui/view/preview.cxx
+++ b/sc/source/ui/view/preview.cxx
@@ -514,8 +514,7 @@ void ScPreview::DoPrint( ScPreviewLocationData* pFillLocation )
rDefPattern.FillEditItemSet(pEditDefaults);
pEditEng->SetDefaults(pEditDefaults);
- Color aTextColor(COL_LIGHTGRAY);
- pEditDefaults->Put(SvxColorItem(aTextColor, EE_CHAR_COLOR));
+ pEditDefaults->Put(SvxColorItem(COL_LIGHTGRAY, EE_CHAR_COLOR));
OUString aEmptyMsg;
if (mbHasEmptyRangeTable)