summaryrefslogtreecommitdiffstats
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-03-03 14:52:45 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-03-04 06:13:25 +0000
commitf5e131b2bcd2c88a47e5988d5f319bffd767c4dc (patch)
treedfa4853d09b4327c4c812dfbe3b44ec1c6447060 /vcl
parentupload libpagemaker 0.0.3 (diff)
downloadcore-f5e131b2bcd2c88a47e5988d5f319bffd767c4dc.tar.gz
core-f5e131b2bcd2c88a47e5988d5f319bffd767c4dc.zip
loplugin:unuseddefaultparams in vcl and xmloff
and teach the plugin about code that takes the address of a function Change-Id: Ia9d5afef44520aca236659e8176f1e27135ef4fc Reviewed-on: https://gerrit.libreoffice.org/22861 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/listbox.hxx2
-rw-r--r--vcl/inc/salgdi.hxx2
-rw-r--r--vcl/inc/unx/i18n_im.hxx2
-rw-r--r--vcl/source/control/button.cxx8
-rw-r--r--vcl/source/control/combobox.cxx8
-rw-r--r--vcl/source/control/imp_listbox.cxx35
-rw-r--r--vcl/source/edit/texteng.cxx8
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx16
-rw-r--r--vcl/source/gdi/pdfwriter_impl.hxx4
-rw-r--r--vcl/source/gdi/salgdilayout.cxx4
-rw-r--r--vcl/source/outdev/text.cxx17
-rw-r--r--vcl/source/window/menu.cxx4
-rw-r--r--vcl/source/window/toolbox.cxx4
-rw-r--r--vcl/unx/generic/app/i18n_im.cxx4
14 files changed, 45 insertions, 73 deletions
diff --git a/vcl/inc/listbox.hxx b/vcl/inc/listbox.hxx
index 66dac44e5949..262586263be5 100644
--- a/vcl/inc/listbox.hxx
+++ b/vcl/inc/listbox.hxx
@@ -247,7 +247,7 @@ protected:
virtual void LoseFocus() override;
bool SelectEntries( sal_Int32 nSelect, LB_EVENT_TYPE eLET, bool bShift = false, bool bCtrl = false, bool bSelectPosChange = false );
- void ImplPaint(vcl::RenderContext& rRenderContext, sal_Int32 nPos, bool bErase = false, bool bLayout = false);
+ void ImplPaint(vcl::RenderContext& rRenderContext, sal_Int32 nPos, bool bErase = false);
void ImplDoPaint(vcl::RenderContext& rRenderContext, const Rectangle& rRect);
void ImplCalcMetrics();
void ImplUpdateEntryMetrics( ImplEntryType& rEntry );
diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx
index 451be62e2924..00a09214b703 100644
--- a/vcl/inc/salgdi.hxx
+++ b/vcl/inc/salgdi.hxx
@@ -238,7 +238,7 @@ public:
void mirror( ImplControlValue&, const OutputDevice* ) const;
basegfx::B2DPoint mirror( const basegfx::B2DPoint& i_rPoint, const OutputDevice *pOutDev, bool bBack = false ) const;
basegfx::B2DPolygon mirror( const basegfx::B2DPolygon& i_rPoly, const OutputDevice *pOutDev, bool bBack = false ) const;
- basegfx::B2DPolyPolygon mirror( const basegfx::B2DPolyPolygon& i_rPoly, const OutputDevice *pOutDev, bool bBack = false ) const;
+ basegfx::B2DPolyPolygon mirror( const basegfx::B2DPolyPolygon& i_rPoly, const OutputDevice *pOutDev ) const;
// non virtual methods; these do possible coordinate mirroring and
// then delegate to protected virtual methods
diff --git a/vcl/inc/unx/i18n_im.hxx b/vcl/inc/unx/i18n_im.hxx
index b081a55622ce..fa5b3b4a5dcc 100644
--- a/vcl/inc/unx/i18n_im.hxx
+++ b/vcl/inc/unx/i18n_im.hxx
@@ -40,7 +40,7 @@ public:
void HandleDestroyIM();
void CreateMethod( Display *pDisplay );
XIMStyles *GetSupportedStyles() { return mpStyles; }
- void SetLocale( const char* pLocale = "" );
+ void SetLocale();
bool FilterEvent( XEvent *pEvent, ::Window window );
SalI18N_InputMethod();
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 97808a3da623..1671d6caf1f0 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -2017,12 +2017,10 @@ void RadioButton::ImplDrawRadioButtonState(vcl::RenderContext& rRenderContext)
void RadioButton::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags,
const Point& rPos, const Size& rSize,
const Size& rImageSize, Rectangle& rStateRect,
- Rectangle& rMouseRect, bool bLayout )
+ Rectangle& rMouseRect )
{
WinBits nWinStyle = GetStyle();
OUString aText( GetText() );
- MetricVector* pVector = bLayout ? &mpControlData->mpLayoutData->m_aUnicodeBoundRects : nullptr;
- OUString* pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText : nullptr;
pDev->Push( PushFlags::CLIPREGION );
pDev->IntersectClipRegion( Rectangle( rPos, rSize ) );
@@ -2051,7 +2049,7 @@ void RadioButton::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags,
aSize.Height() = rImageSize.Height();
}
- ImplDrawAlignedImage( pDev, aPos, aSize, bLayout, 1,
+ ImplDrawAlignedImage( pDev, aPos, aSize, false/*bLayout*/, 1,
nDrawFlags, nTextStyle );
rMouseRect = Rectangle( aPos, aSize );
@@ -2140,7 +2138,7 @@ void RadioButton::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags,
aTxtPos.X() += aImageRect.Right()+8;
aTxtPos.Y() += (rSize.Height()-nTextHeight)/2;
}
- pDev->DrawCtrlText( aTxtPos, aText, 0, aText.getLength(), DrawTextFlags::Mnemonic, pVector, pDisplayText );
+ pDev->DrawCtrlText( aTxtPos, aText, 0, aText.getLength() );
}
rMouseRect = aImageRect;
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index c474cd350a9d..6b54142519bf 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -1335,14 +1335,14 @@ void ComboBox::SetSeparatorPos( sal_Int32 n )
m_pImpl->m_pImplLB->SetSeparatorPos( n );
}
-void ComboBox::SetMRUEntries( const OUString& rEntries, sal_Unicode cSep )
+void ComboBox::SetMRUEntries( const OUString& rEntries )
{
- m_pImpl->m_pImplLB->SetMRUEntries( rEntries, cSep );
+ m_pImpl->m_pImplLB->SetMRUEntries( rEntries, ';' );
}
-OUString ComboBox::GetMRUEntries( sal_Unicode cSep ) const
+OUString ComboBox::GetMRUEntries() const
{
- return m_pImpl->m_pImplLB ? m_pImpl->m_pImplLB->GetMRUEntries( cSep ) : OUString();
+ return m_pImpl->m_pImplLB ? m_pImpl->m_pImplLB->GetMRUEntries( ';' ) : OUString();
}
void ComboBox::SetMaxMRUCount( sal_Int32 n )
diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx
index e17ba0d3dcea..b9ecd36cba21 100644
--- a/vcl/source/control/imp_listbox.cxx
+++ b/vcl/source/control/imp_listbox.cxx
@@ -1696,7 +1696,7 @@ void ImplListBoxWindow::SelectEntry( vcl::StringEntryIdentifier _entry )
}
}
-void ImplListBoxWindow::ImplPaint(vcl::RenderContext& rRenderContext, sal_Int32 nPos, bool bErase, bool bLayout)
+void ImplListBoxWindow::ImplPaint(vcl::RenderContext& rRenderContext, sal_Int32 nPos, bool bErase)
{
const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
@@ -1708,24 +1708,21 @@ void ImplListBoxWindow::ImplPaint(vcl::RenderContext& rRenderContext, sal_Int32
long nY = mpEntryList->GetAddedHeight(nPos, mnTop);
Rectangle aRect(Point(0, nY), Size(nWidth, pEntry->mnHeight));
- if (!bLayout)
+ if (mpEntryList->IsEntryPosSelected(nPos))
{
- if (mpEntryList->IsEntryPosSelected(nPos))
- {
- rRenderContext.SetTextColor(!IsEnabled() ? rStyleSettings.GetDisableColor() : rStyleSettings.GetHighlightTextColor());
- rRenderContext.SetFillColor(rStyleSettings.GetHighlightColor());
- rRenderContext.SetTextFillColor(rStyleSettings.GetHighlightColor());
- rRenderContext.DrawRect(aRect);
- }
- else
- {
- ApplySettings(rRenderContext);
- if (!IsEnabled())
- rRenderContext.SetTextColor(rStyleSettings.GetDisableColor());
- rRenderContext.SetTextFillColor();
- if (bErase)
- rRenderContext.Erase(aRect);
- }
+ rRenderContext.SetTextColor(!IsEnabled() ? rStyleSettings.GetDisableColor() : rStyleSettings.GetHighlightTextColor());
+ rRenderContext.SetFillColor(rStyleSettings.GetHighlightColor());
+ rRenderContext.SetTextFillColor(rStyleSettings.GetHighlightColor());
+ rRenderContext.DrawRect(aRect);
+ }
+ else
+ {
+ ApplySettings(rRenderContext);
+ if (!IsEnabled())
+ rRenderContext.SetTextColor(rStyleSettings.GetDisableColor());
+ rRenderContext.SetTextFillColor();
+ if (bErase)
+ rRenderContext.Erase(aRect);
}
if (IsUserDrawEnabled())
@@ -1747,7 +1744,7 @@ void ImplListBoxWindow::ImplPaint(vcl::RenderContext& rRenderContext, sal_Int32
}
else
{
- DrawEntry(rRenderContext, nPos, true, true, false, bLayout);
+ DrawEntry(rRenderContext, nPos, true, true);
}
}
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx
index a272be4025ab..592a0e51cd18 100644
--- a/vcl/source/edit/texteng.cxx
+++ b/vcl/source/edit/texteng.cxx
@@ -820,7 +820,7 @@ TextPaM TextEngine::ImpInsertParaBreak( const TextSelection& rCurSel )
return ImpInsertParaBreak( aPaM );
}
-TextPaM TextEngine::ImpInsertParaBreak( const TextPaM& rPaM, bool bKeepEndingAttribs )
+TextPaM TextEngine::ImpInsertParaBreak( const TextPaM& rPaM )
{
if ( IsUndoEnabled() && !IsInUndo() )
InsertUndo( new TextUndoSplitPara( this, rPaM.GetPara(), rPaM.GetIndex() ) );
@@ -828,7 +828,7 @@ TextPaM TextEngine::ImpInsertParaBreak( const TextPaM& rPaM, bool bKeepEndingAtt
TextNode* pNode = mpDoc->GetNodes()[ rPaM.GetPara() ];
bool bFirstParaContentChanged = rPaM.GetIndex() < pNode->GetText().getLength();
- TextPaM aPaM( mpDoc->InsertParaBreak( rPaM, bKeepEndingAttribs ) );
+ TextPaM aPaM( mpDoc->InsertParaBreak( rPaM, true/*bKeepEndingAttribs*/ ) );
TEParaPortion* pPortion = mpTEParaPortions->GetObject( rPaM.GetPara() );
DBG_ASSERT( pPortion, "ImpInsertParaBreak: Hidden Portion" );
@@ -2905,7 +2905,7 @@ void TextEngine::ImpInitWritingDirections( sal_uInt32 nPara )
}
-sal_uInt8 TextEngine::ImpGetRightToLeft( sal_uInt32 nPara, sal_Int32 nPos, sal_Int32* pStart )
+sal_uInt8 TextEngine::ImpGetRightToLeft( sal_uInt32 nPara, sal_Int32 nPos )
{
sal_uInt8 nRightToLeft = 0;
@@ -2922,8 +2922,6 @@ sal_uInt8 TextEngine::ImpGetRightToLeft( sal_uInt32 nPara, sal_Int32 nPos, sal_I
if ( rWritingDirectionInfo.nStartPos <= nPos && rWritingDirectionInfo.nEndPos >= nPos )
{
nRightToLeft = rWritingDirectionInfo.nType;
- if ( pStart )
- *pStart = rWritingDirectionInfo.nStartPos;
break;
}
}
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 0a4d5953a42f..fef99d636d0b 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -1382,17 +1382,8 @@ GEOMETRY lcl_convert( const MapMode& _rSource, const MapMode& _rDest, OutputDevi
}
}
-void PDFWriterImpl::PDFPage::appendPoint( const Point& rPoint, OStringBuffer& rBuffer, bool bNeg, Point* pOutPoint ) const
+void PDFWriterImpl::PDFPage::appendPoint( const Point& rPoint, OStringBuffer& rBuffer, bool bNeg ) const
{
- if( pOutPoint )
- {
- Point aPoint( lcl_convert( m_pWriter->m_aGraphicsStack.front().m_aMapMode,
- m_pWriter->m_aMapMode,
- m_pWriter->getReferenceDevice(),
- rPoint ) );
- *pOutPoint = aPoint;
- }
-
Point aPoint( lcl_convert( m_pWriter->m_aGraphicsStack.front().m_aMapMode,
m_pWriter->m_aMapMode,
m_pWriter->getReferenceDevice(),
@@ -1495,7 +1486,7 @@ void PDFWriterImpl::PDFPage::appendPolygon( const tools::Polygon& rPoly, OString
}
}
-void PDFWriterImpl::PDFPage::appendPolygon( const basegfx::B2DPolygon& rPoly, OStringBuffer& rBuffer, bool bClose ) const
+void PDFWriterImpl::PDFPage::appendPolygon( const basegfx::B2DPolygon& rPoly, OStringBuffer& rBuffer ) const
{
basegfx::B2DPolygon aPoly( lcl_convert( m_pWriter->m_aGraphicsStack.front().m_aMapMode,
m_pWriter->m_aMapMode,
@@ -1566,8 +1557,7 @@ void PDFWriterImpl::PDFPage::appendPolygon( const basegfx::B2DPolygon& rPoly, OS
rBuffer.append( " " );
}
}
- if( bClose )
- rBuffer.append( "h\n" );
+ rBuffer.append( "h\n" );
}
}
diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx
index d0817a124111..6b3b0d10dce7 100644
--- a/vcl/source/gdi/pdfwriter_impl.hxx
+++ b/vcl/source/gdi/pdfwriter_impl.hxx
@@ -139,7 +139,7 @@ public:
// to page (useful for transformation matrices
// if pOutPoint is set it will be updated to the emitted point
// (in PDF map mode, that is 10th of point)
- void appendPoint( const Point& rPoint, OStringBuffer& rBuffer, bool bNeg = false, Point* pOutPoint = nullptr ) const;
+ void appendPoint( const Point& rPoint, OStringBuffer& rBuffer, bool bNeg = false ) const;
// appends a B2DPoint without further transformation
void appendPixelPoint( const basegfx::B2DPoint& rPoint, OStringBuffer& rBuffer ) const;
// appends a rectangle
@@ -149,7 +149,7 @@ public:
// appends a polygon optionally closing it
void appendPolygon( const tools::Polygon& rPoly, OStringBuffer& rBuffer, bool bClose = true ) const;
// appends a polygon optionally closing it
- void appendPolygon( const basegfx::B2DPolygon& rPoly, OStringBuffer& rBuffer, bool bClose = true ) const;
+ void appendPolygon( const basegfx::B2DPolygon& rPoly, OStringBuffer& rBuffer ) const;
// appends a polypolygon optionally closing the subpaths
void appendPolyPolygon( const tools::PolyPolygon& rPolyPoly, OStringBuffer& rBuffer ) const;
// appends a polypolygon optionally closing the subpaths
diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx
index 13c8a1514b34..b4df20fa4c1a 100644
--- a/vcl/source/gdi/salgdilayout.cxx
+++ b/vcl/source/gdi/salgdilayout.cxx
@@ -293,7 +293,7 @@ basegfx::B2DPolygon SalGraphics::mirror( const basegfx::B2DPolygon& i_rPoly, con
return aRet;
}
-basegfx::B2DPolyPolygon SalGraphics::mirror( const basegfx::B2DPolyPolygon& i_rPoly, const OutputDevice *i_pOutDev, bool i_bBack ) const
+basegfx::B2DPolyPolygon SalGraphics::mirror( const basegfx::B2DPolyPolygon& i_rPoly, const OutputDevice *i_pOutDev ) const
{
long w;
if( i_pOutDev && i_pOutDev->GetOutDevType() == OUTDEV_VIRDEV )
@@ -308,7 +308,7 @@ basegfx::B2DPolyPolygon SalGraphics::mirror( const basegfx::B2DPolyPolygon& i_rP
{
sal_Int32 nPoly = i_rPoly.count();
for( sal_Int32 i = 0; i < nPoly; i++ )
- aRet.append( mirror( i_rPoly.getB2DPolygon( i ), i_pOutDev, i_bBack ) );
+ aRet.append( mirror( i_rPoly.getB2DPolygon( i ), i_pOutDev ) );
aRet.setClosed( i_rPoly.isClosed() );
aRet.flip();
}
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index 6ad7eb603715..3a94f8d63cf3 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -1093,7 +1093,7 @@ long OutputDevice::GetTextArray( const OUString& rStr, long* pDXAry,
bool OutputDevice::GetCaretPositions( const OUString& rStr, long* pCaretXArray,
sal_Int32 nIndex, sal_Int32 nLen,
- long* pDXAry, long nLayoutWidth ) const
+ long* pDXAry ) const
{
if( nIndex >= rStr.getLength() )
@@ -1103,7 +1103,7 @@ bool OutputDevice::GetCaretPositions( const OUString& rStr, long* pCaretXArray,
// layout complex text
SalLayout* pSalLayout = ImplLayout( rStr, nIndex, nLen,
- Point(0,0), nLayoutWidth, pDXAry );
+ Point(0,0), 0, pDXAry );
if( !pSalLayout )
return false;
@@ -2283,18 +2283,9 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const OUString& rStr,
}
long OutputDevice::GetCtrlTextWidth( const OUString& rStr,
- sal_Int32 nIndex, sal_Int32 nLen ) const
+ sal_Int32 nIndex ) const
{
- if(nLen == 0x0FFFF)
- {
- SAL_INFO("sal.rtl.xub",
- "GetCtrlTextWidth Suspicious arguments nLen:" << nLen);
- }
- /* defensive code */
- if( (nLen < 0) || (nIndex + nLen >= rStr.getLength()))
- {
- nLen = rStr.getLength() - nIndex;
- }
+ sal_Int32 nLen = rStr.getLength() - nIndex;
sal_Int32 nMnemonicPos;
OUString aStr = GetNonMnemonicString( rStr, nMnemonicPos );
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index d218675f23aa..95f3f4a426ad 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -528,7 +528,7 @@ void Menu::InsertItem( const ResId& rResId )
}
void Menu::InsertItem(const OUString& rCommand, const css::uno::Reference<css::frame::XFrame>& rFrame,
- MenuItemBits nBits, const OString &rIdent)
+ MenuItemBits nBits)
{
OUString aLabel(CommandInfoProvider::Instance().GetPopupLabelForCommand(rCommand, rFrame));
OUString aTooltip(CommandInfoProvider::Instance().GetTooltipForCommand(rCommand, rFrame));
@@ -536,7 +536,7 @@ void Menu::InsertItem(const OUString& rCommand, const css::uno::Reference<css::f
sal_uInt16 nItemId = GetItemCount() + 1;
- InsertItem(nItemId, aLabel, aImage, nBits, rIdent);
+ InsertItem(nItemId, aLabel, aImage, nBits, OString());
SetItemCommand(nItemId, rCommand);
SetHelpText(nItemId, aTooltip);
}
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index df0919243ad3..3037a581cc09 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -4981,12 +4981,10 @@ void ToolBox::LoseFocus()
}
// performs the action associated with an item, ie simulates clicking the item
-void ToolBox::TriggerItem( sal_uInt16 nItemId, bool bShift )
+void ToolBox::TriggerItem( sal_uInt16 nItemId )
{
mnHighItemId = nItemId;
sal_uInt16 nModifier = 0;
- if( bShift )
- nModifier |= KEY_SHIFT;
vcl::KeyCode aKeyCode( 0, nModifier );
ImplActivateItem( aKeyCode );
}
diff --git a/vcl/unx/generic/app/i18n_im.cxx b/vcl/unx/generic/app/i18n_im.cxx
index 4277c8e28f4d..7b88e3327a66 100644
--- a/vcl/unx/generic/app/i18n_im.cxx
+++ b/vcl/unx/generic/app/i18n_im.cxx
@@ -195,13 +195,13 @@ IsXWindowCompatibleLocale( const char* p_locale )
// on Solaris the environment needs to be set equivalent to the locale (#i37047#)
void
-SalI18N_InputMethod::SetLocale( const char* pLocale )
+SalI18N_InputMethod::SetLocale()
{
// check whether we want an Input Method engine, if we don't we
// do not need to set the locale
if ( mbUseable )
{
- char *locale = SetSystemLocale( pLocale );
+ char *locale = SetSystemLocale( "" );
if ( (!IsXWindowCompatibleLocale(locale)) || IsPosixLocale(locale) )
{
osl_setThreadTextEncoding (RTL_TEXTENCODING_ISO_8859_1);