summaryrefslogtreecommitdiffstats
path: root/sw
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 /sw
parentmove MovePoint and MoveRect into Rectangle and Point (diff)
downloadcore-08ab1f46b192a188935fdffbefdc9f3973583cdf.tar.gz
core-08ab1f46b192a188935fdffbefdc9f3973583cdf.zip
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 'sw')
-rw-r--r--sw/source/core/access/acccontext.cxx3
-rw-r--r--sw/source/core/doc/DocumentStylePoolManager.cxx9
-rw-r--r--sw/source/core/frmedt/fefly1.cxx3
-rw-r--r--sw/source/core/text/inftxt.cxx4
-rw-r--r--sw/source/core/txtnode/fntcap.cxx6
-rw-r--r--sw/source/filter/writer/wrtswtbl.cxx3
-rw-r--r--sw/source/filter/ww8/wrtw8sty.cxx2
-rw-r--r--sw/source/filter/ww8/wrtww8gr.cxx6
-rw-r--r--sw/source/filter/ww8/ww8graf.cxx3
-rw-r--r--sw/source/filter/ww8/ww8graf2.cxx3
-rw-r--r--sw/source/uibase/dialog/SignatureLineDialog.cxx2
-rw-r--r--sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx3
-rw-r--r--sw/source/uibase/docvw/edtdd.cxx3
-rw-r--r--sw/source/uibase/shells/annotsh.cxx3
-rw-r--r--sw/source/uibase/shells/drwtxtsh.cxx3
-rw-r--r--sw/source/uibase/uiview/view.cxx2
-rw-r--r--sw/source/uibase/utlui/content.cxx3
-rw-r--r--sw/source/uibase/utlui/glbltree.cxx3
18 files changed, 22 insertions, 42 deletions
diff --git a/sw/source/core/access/acccontext.cxx b/sw/source/core/access/acccontext.cxx
index c0ee49f316a3..9a4c36659c20 100644
--- a/sw/source/core/access/acccontext.cxx
+++ b/sw/source/core/access/acccontext.cxx
@@ -1369,9 +1369,8 @@ bool SwAccessibleContext::Select( SwPaM *pPaM, SdrObject *pObj,
{
if( pFEShell )
{
- Point aDummy;
sal_uInt8 nFlags = bAdd ? SW_ADD_SELECT : 0;
- pFEShell->SelectObj( aDummy, nFlags, pObj );
+ pFEShell->SelectObj( Point(), nFlags, pObj );
bRet = true;
}
}
diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx b/sw/source/core/doc/DocumentStylePoolManager.cxx
index 660e1067e918..aa8d08f6cf3e 100644
--- a/sw/source/core/doc/DocumentStylePoolManager.cxx
+++ b/sw/source/core/doc/DocumentStylePoolManager.cxx
@@ -1504,8 +1504,7 @@ SwFormat* DocumentStylePoolManager::GetFormatFromPool( sal_uInt16 nId )
case RES_POOLCHR_INET_NORMAL:
{
- Color aCol( COL_BLUE );
- aSet.Put( SvxColorItem( aCol, RES_CHRATR_COLOR ) );
+ aSet.Put( SvxColorItem( COL_BLUE, RES_CHRATR_COLOR ) );
aSet.Put( SvxUnderlineItem( LINESTYLE_SINGLE, RES_CHRATR_UNDERLINE ) );
// i40133: patch submitted by rail: set language to 'none' to prevent spell checking:
aSet.Put( SvxLanguageItem( LANGUAGE_NONE, RES_CHRATR_LANGUAGE ) );
@@ -1515,8 +1514,7 @@ SwFormat* DocumentStylePoolManager::GetFormatFromPool( sal_uInt16 nId )
break;
case RES_POOLCHR_INET_VISIT:
{
- Color aCol( COL_RED );
- aSet.Put( SvxColorItem( aCol, RES_CHRATR_COLOR ) );
+ aSet.Put( SvxColorItem( COL_RED, RES_CHRATR_COLOR ) );
aSet.Put( SvxUnderlineItem( LINESTYLE_SINGLE, RES_CHRATR_UNDERLINE ) );
aSet.Put( SvxLanguageItem( LANGUAGE_NONE, RES_CHRATR_LANGUAGE ) );
aSet.Put( SvxLanguageItem( LANGUAGE_NONE, RES_CHRATR_CJK_LANGUAGE ) );
@@ -1525,8 +1523,7 @@ SwFormat* DocumentStylePoolManager::GetFormatFromPool( sal_uInt16 nId )
break;
case RES_POOLCHR_JUMPEDIT:
{
- Color aCol( COL_CYAN );
- aSet.Put( SvxColorItem( aCol, RES_CHRATR_COLOR ) );
+ aSet.Put( SvxColorItem( COL_CYAN, RES_CHRATR_COLOR ) );
aSet.Put( SvxUnderlineItem( LINESTYLE_DOTTED, RES_CHRATR_UNDERLINE ) );
aSet.Put( SvxCaseMapItem( SvxCaseMap::SmallCaps, RES_CHRATR_CASEMAP ) );
}
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index ebd55b4c2da7..92b630350d09 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -1116,8 +1116,7 @@ bool SwFEShell::SetDrawingAttr( SfxItemSet& rSet )
if( GetDoc()->SetFlyFrameAttr( *pFormat, rSet ))
{
bRet = true;
- Point aTmp;
- SelectObj( aTmp, 0, pObj );
+ SelectObj( Point(), 0, pObj );
}
EndAllActionAndCall();
EndUndo();
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index d4cb80f1e17e..ef5e6be5086e 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -993,12 +993,10 @@ void SwTextPaintInfo::DrawRedArrow( const SwLinePortion &rPor ) const
if ( GetTextFrame()->IsVertical() )
GetTextFrame()->SwitchHorizontalToVertical( aRect );
- Color aCol( COL_LIGHTRED );
-
if( aRect.HasArea() )
{
const sal_uInt8 nOptions = 0;
- lcl_DrawSpecial( *this, rPor, aRect, aCol, cChar, nOptions );
+ lcl_DrawSpecial( *this, rPor, aRect, COL_LIGHTRED, cChar, nOptions );
}
}
diff --git a/sw/source/core/txtnode/fntcap.cxx b/sw/source/core/txtnode/fntcap.cxx
index d536051b752a..36aaf7d0f8c6 100644
--- a/sw/source/core/txtnode/fntcap.cxx
+++ b/sw/source/core/txtnode/fntcap.cxx
@@ -134,8 +134,7 @@ Size SwSubFont::GetCapitalSize( SwDrawTextInfo& rInf )
// Start:
const long nOldKern = rInf.GetKern();
rInf.SetKern( CheckKerning() );
- Point aPos;
- rInf.SetPos( aPos );
+ rInf.SetPos( Point() );
rInf.SetSpace( 0 );
rInf.SetDrawSpace( false );
SwDoGetCapitalSize aDo( rInf );
@@ -377,8 +376,7 @@ sal_Int32 SwSubFont::GetCapitalCursorOfst( SwDrawTextInfo& rInf )
const long nOldKern = rInf.GetKern();
rInf.SetKern( CheckKerning() );
SwDoCapitalCursorOfst aDo( rInf, rInf.GetOfst() );
- Point aPos;
- rInf.SetPos( aPos );
+ rInf.SetPos( Point() );
rInf.SetDrawSpace( false );
DoOnCapitals( aDo );
rInf.SetKern( nOldKern );
diff --git a/sw/source/filter/writer/wrtswtbl.cxx b/sw/source/filter/writer/wrtswtbl.cxx
index c92803aa5b30..98bc37956fc3 100644
--- a/sw/source/filter/writer/wrtswtbl.cxx
+++ b/sw/source/filter/writer/wrtswtbl.cxx
@@ -193,8 +193,7 @@ void SwWriteTable::MergeBorders( const SvxBorderLine* pBorderLine,
{
if( sal_uInt32(-1) == m_nBorderColor )
{
- Color aGrayColor( COL_GRAY );
- if( !pBorderLine->GetColor().IsRGBEqual( aGrayColor ) )
+ if( !pBorderLine->GetColor().IsRGBEqual( COL_GRAY ) )
m_nBorderColor = pBorderLine->GetColor().GetColor();
}
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index ccfc366f7843..1b0aefe49c4d 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -674,7 +674,7 @@ void MSWordStyles::OutputStylesTable()
// and refuses to load .docx with more, even though the spec seems to allow that;
// so simply if there are more styles, don't export those
// Implementing check for all exports DOCX, DOC, RTF
- sal_uInt16 nLimit = MSWORD_MAX_STYLES_LIMIT;
+ sal_uInt16 const nLimit = MSWORD_MAX_STYLES_LIMIT;
m_nUsedSlots = std::min(nLimit, m_nUsedSlots);
for ( n = 0; n < m_nUsedSlots; n++ )
diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx
index d51630f76816..4d9ceaa9c00f 100644
--- a/sw/source/filter/ww8/wrtww8gr.cxx
+++ b/sw/source/filter/ww8/wrtww8gr.cxx
@@ -131,17 +131,15 @@ bool WW8Export::TestOleNeedsGraphic(const SwAttrSet& rSet,
{
// bGraphicNeeded set to true is right / fixes #i51670#.
bGraphicNeeded = true;
- Point aTmpPoint;
- tools::Rectangle aRect( aTmpPoint, Size( nX, nY ) );
+ tools::Rectangle aRect( Point(), Size( nX, nY ) );
Graphic aGraph(aWMF);
ErrCode nErr = ERRCODE_NONE;
- tools::Rectangle aVisArea;
sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT;
if ( pOLENd )
nAspect = pOLENd->GetAspect();
SdrOle2Obj *pRet = SvxMSDffManager::CreateSdrOLEFromStorage(
- rStorageName,xObjStg,m_pDoc->GetDocStorage(),aGraph,aRect,aVisArea,nullptr,nErr,0,nAspect, m_pWriter->GetBaseURL());
+ rStorageName,xObjStg,m_pDoc->GetDocStorage(),aGraph,aRect,tools::Rectangle(),nullptr,nErr,0,nAspect, m_pWriter->GetBaseURL());
if (pRet)
{
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 8f7cf453a6c1..037dd4f450a9 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -1783,8 +1783,7 @@ void SwWW8ImplReader::MatchSdrItemsIntoFlySet( SdrObject const * pSdrObj,
rFlySet.Put( aShadow );
}
- Color Temp(COL_WHITE);
- SvxBrushItem aBrushItem(Temp, RES_BACKGROUND);
+ SvxBrushItem aBrushItem(COL_WHITE, RES_BACKGROUND);
bool bBrushItemOk = false;
sal_uInt8 nTrans = 0;
diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx
index a1dbe9fc17e8..023aaabf173f 100644
--- a/sw/source/filter/ww8/ww8graf2.cxx
+++ b/sw/source/filter/ww8/ww8graf2.cxx
@@ -561,10 +561,9 @@ SwFrameFormat* SwWW8ImplReader::ImportGraf(SdrTextObj const * pTextObj,
m_pDataStream->SeekRel( nNameLen );
}
- tools::Rectangle aChildRect;
tools::Rectangle aClientRect( 0,0, aPD.nWidth, aPD.nHeight);
SvxMSDffImportData aData( aClientRect );
- pObject = m_xMSDffManager->ImportObj(*m_pDataStream, &aData, aClientRect, aChildRect, /*nCalledByGroup*/0, /*pShapeId*/nullptr );
+ pObject = m_xMSDffManager->ImportObj(*m_pDataStream, &aData, aClientRect, tools::Rectangle(), /*nCalledByGroup*/0, /*pShapeId*/nullptr );
if (pObject)
{
// for the frame
diff --git a/sw/source/uibase/dialog/SignatureLineDialog.cxx b/sw/source/uibase/dialog/SignatureLineDialog.cxx
index b574a7b455e4..c7832e4078e9 100644
--- a/sw/source/uibase/dialog/SignatureLineDialog.cxx
+++ b/sw/source/uibase/dialog/SignatureLineDialog.cxx
@@ -179,7 +179,7 @@ void SignatureLineDialog::Apply()
OUString SignatureLineDialog::getSignatureImage()
{
- OUString svg(
+ OUString const svg(
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?><svg "
"xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:cc=\"http://creativecommons.org/ns#\" "
"xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" "
diff --git a/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx b/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx
index dd2ee979dad6..0b7daa49b5d7 100644
--- a/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx
+++ b/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx
@@ -774,9 +774,8 @@ bool SwSpellDialogChildWindow::FindNextDrawTextError_Impl(SwWrtShell& rSh)
std::unique_ptr<OutlinerView> pOutlView( new OutlinerView( &aTmpOutliner, &(rView.GetEditWin()) ) );
pOutlView->GetOutliner()->SetRefDevice( rSh.getIDocumentDeviceAccess().getPrinter( false ) );
aTmpOutliner.InsertView( pOutlView.get() );
- Point aPt;
Size aSize(1,1);
- tools::Rectangle aRect( aPt, aSize );
+ tools::Rectangle aRect( Point(), aSize );
pOutlView->SetOutputArea( aRect );
aTmpOutliner.SetText( *pParaObj );
aTmpOutliner.ClearModifyFlag();
diff --git a/sw/source/uibase/docvw/edtdd.cxx b/sw/source/uibase/docvw/edtdd.cxx
index e45561269217..ed773db4b658 100644
--- a/sw/source/uibase/docvw/edtdd.cxx
+++ b/sw/source/uibase/docvw/edtdd.cxx
@@ -338,8 +338,7 @@ sal_Int8 SwEditWin::AcceptDrop( const AcceptDropEvent& rEvt )
// If the cursor is near the inner boundary
// we attempt to scroll towards the desired direction.
- Point aPoint;
- tools::Rectangle aWin(aPoint,GetOutputSizePixel());
+ tools::Rectangle aWin(Point(), GetOutputSizePixel());
const int nMargin = 10;
aWin.AdjustLeft(nMargin );
aWin.AdjustTop(nMargin );
diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx
index da1f9880e303..bc526cb1afb5 100644
--- a/sw/source/uibase/shells/annotsh.cxx
+++ b/sw/source/uibase/shells/annotsh.cxx
@@ -602,9 +602,8 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
aNewAttr.Put(*pNewItem);
}
- tools::Rectangle aNullRect;
tools::Rectangle aOutRect = pOLV->GetOutputArea();
- if (aNullRect != aOutRect)
+ if (tools::Rectangle() != aOutRect)
pOLV->SetAttribs(aNewAttr);
rView.GetViewFrame()->GetBindings().InvalidateAll(false);
diff --git a/sw/source/uibase/shells/drwtxtsh.cxx b/sw/source/uibase/shells/drwtxtsh.cxx
index 603b66ecddba..ef4054229160 100644
--- a/sw/source/uibase/shells/drwtxtsh.cxx
+++ b/sw/source/uibase/shells/drwtxtsh.cxx
@@ -160,11 +160,10 @@ void SwDrawTextShell::StateDisableItems( SfxItemSet &rSet )
void SwDrawTextShell::SetAttrToMarked(const SfxItemSet& rAttr)
{
- tools::Rectangle aNullRect;
OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
tools::Rectangle aOutRect = pOLV->GetOutputArea();
- if (aNullRect != aOutRect)
+ if (tools::Rectangle() != aOutRect)
{
GetShell().GetDrawView()->SetAttributes(rAttr);
}
diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index 2dec6c0c5054..338c4aa8da83 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -1648,7 +1648,7 @@ void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
break;
case SfxHintId::RedlineChanged:
{
- sal_uInt16 aSlotRedLine[] = {
+ static sal_uInt16 const aSlotRedLine[] = {
FN_REDLINE_NEXT_CHANGE,
FN_REDLINE_PREV_CHANGE,
FN_REDLINE_ACCEPT_DIRECT,
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 264cb7245b27..8c451e3a9a97 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -3575,8 +3575,7 @@ void SwContentLBoxString::Paint(const Point& rPos, SvTreeListBox& rDev, vcl::Ren
{
vcl::Font aOldFont(rRenderContext.GetFont());
vcl::Font aFont(aOldFont);
- Color aCol(COL_LIGHTGRAY);
- aFont.SetColor(aCol);
+ aFont.SetColor(COL_LIGHTGRAY);
rRenderContext.SetFont(aFont );
rRenderContext.DrawText(rPos, GetText());
rRenderContext.SetFont(aOldFont);
diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx
index a4aeaf143853..d29d3eb49762 100644
--- a/sw/source/uibase/utlui/glbltree.cxx
+++ b/sw/source/uibase/utlui/glbltree.cxx
@@ -1258,8 +1258,7 @@ void SwLBoxString::Paint(const Point& rPos, SvTreeListBox& rDev, vcl::RenderCont
rRenderContext.Push(PushFlags::FONT);
vcl::Font aOldFont(rRenderContext.GetFont());
vcl::Font aFont(rRenderContext.GetFont());
- Color aCol(COL_LIGHTRED);
- aFont.SetColor(aCol);
+ aFont.SetColor(COL_LIGHTRED);
rRenderContext.SetFont(aFont);
rRenderContext.DrawText(rPos, GetText());
rRenderContext.Pop();