diff options
author | Noel Grandin <noel@peralex.com> | 2016-03-03 14:52:45 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-03-04 06:13:25 +0000 |
commit | f5e131b2bcd2c88a47e5988d5f319bffd767c4dc (patch) | |
tree | dfa4853d09b4327c4c812dfbe3b44ec1c6447060 | |
parent | upload libpagemaker 0.0.3 (diff) | |
download | core-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>
27 files changed, 84 insertions, 129 deletions
diff --git a/compilerplugins/clang/unuseddefaultparams.cxx b/compilerplugins/clang/unuseddefaultparams.cxx index 6906a93c2271..a194be26e726 100644 --- a/compilerplugins/clang/unuseddefaultparams.cxx +++ b/compilerplugins/clang/unuseddefaultparams.cxx @@ -68,8 +68,11 @@ public: myfile.close(); } + bool shouldVisitTemplateInstantiations () const { return true; } + bool VisitCallExpr(CallExpr * callExpr); bool VisitFunctionDecl( const FunctionDecl* functionDecl ); + bool VisitDeclRefExpr( const DeclRefExpr* declRefExpr ); private: MyFuncInfo niceName(const FunctionDecl* functionDecl); }; @@ -208,6 +211,18 @@ bool UnusedDefaultParams::VisitFunctionDecl( const FunctionDecl* functionDecl ) return true; } +// this catches places that take the address of a method +bool UnusedDefaultParams::VisitDeclRefExpr( const DeclRefExpr* declRefExpr ) +{ + const Decl* functionDecl = declRefExpr->getDecl(); + if (!isa<FunctionDecl>(functionDecl)) { + return true; + } + MyFuncInfo funcInfo = niceName(dyn_cast<FunctionDecl>(functionDecl)); + callSet.insert(funcInfo); + return true; +} + loplugin::Plugin::Registration< UnusedDefaultParams > X("unuseddefaultparams", false); } diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx index 91ba1e3c7916..bf19a6a9e953 100644 --- a/include/vcl/button.hxx +++ b/include/vcl/button.hxx @@ -297,7 +297,7 @@ private: SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags, const Point& rPos, const Size& rSize, const Size& rImageSize, Rectangle& rStateRect, - Rectangle& rMouseRect, bool bLayout = false ); + Rectangle& rMouseRect ); SAL_DLLPRIVATE void ImplDrawRadioButton(vcl::RenderContext& rRenderContext ); SAL_DLLPRIVATE void ImplUncheckAllOther(); SAL_DLLPRIVATE Size ImplGetRadioImageSize() const; diff --git a/include/vcl/combobox.hxx b/include/vcl/combobox.hxx index 83961566a762..77754b748cba 100644 --- a/include/vcl/combobox.hxx +++ b/include/vcl/combobox.hxx @@ -137,8 +137,8 @@ public: Size CalcBlockSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const; void GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const; - void SetMRUEntries( const OUString& rEntries, sal_Unicode cSep = ';' ); - OUString GetMRUEntries( sal_Unicode cSep = ';' ) const; + void SetMRUEntries( const OUString& rEntries ); + OUString GetMRUEntries() const; void SetMaxMRUCount( sal_Int32 n ); sal_Int32 GetMaxMRUCount() const; void SetEntryData( sal_Int32 nPos, void* pNewData ); diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx index f8d44e0c1567..4b1682f08a59 100644 --- a/include/vcl/menu.hxx +++ b/include/vcl/menu.hxx @@ -251,8 +251,7 @@ public: void InsertItem(const ResId& rResId); void InsertItem(const OUString& rCommand, const css::uno::Reference<css::frame::XFrame>& rFrame, - MenuItemBits nBits = MenuItemBits::NONE, - const OString &rIdent = OString()); + MenuItemBits nBits = MenuItemBits::NONE); void InsertSeparator(const OString &rIdent = OString(), sal_uInt16 nPos = MENU_APPEND); void RemoveItem( sal_uInt16 nPos ); void CopyItem(const Menu& rMenu, sal_uInt16 nPos ); diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index cb9e0da762d3..007c9857c5d3 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -1130,8 +1130,7 @@ public: OUString GetEllipsisString( const OUString& rStr, long nMaxWidth, DrawTextFlags nStyle = DrawTextFlags::EndEllipsis ) const; - long GetCtrlTextWidth( const OUString& rStr, sal_Int32 nIndex = 0, - sal_Int32 nLen = -1 ) const; + long GetCtrlTextWidth( const OUString& rStr, sal_Int32 nIndex = 0 ) const; static OUString GetNonMnemonicString( const OUString& rStr, sal_Int32& rMnemonicPos ); @@ -1197,7 +1196,7 @@ public: bool GetCaretPositions( const OUString&, long* pCaretXArray, sal_Int32 nIndex, sal_Int32 nLen, - long* pDXAry = nullptr, long nWidth = 0 ) const; + long* pDXAry = nullptr ) const; void DrawStretchText( const Point& rStartPt, sal_uLong nWidth, const OUString& rStr, sal_Int32 nIndex = 0, sal_Int32 nLen = -1); diff --git a/include/vcl/texteng.hxx b/include/vcl/texteng.hxx index ec77f0632871..eaaa6213d8fd 100644 --- a/include/vcl/texteng.hxx +++ b/include/vcl/texteng.hxx @@ -149,7 +149,7 @@ protected: TextPaM ImpInsertText( const TextSelection& rSel, sal_Unicode c, bool bOverwrite = false ); TextPaM ImpInsertText( const TextSelection& rSel, const OUString& rText ); TextPaM ImpInsertParaBreak( const TextSelection& rTextSelection ); - TextPaM ImpInsertParaBreak( const TextPaM& rPaM, bool bKeepEndingAttribs = true ); + TextPaM ImpInsertParaBreak( const TextPaM& rPaM ); void ImpRemoveChars( const TextPaM& rPaM, sal_Int32 nChars ); TextPaM ImpConnectParagraphs( sal_uInt32 nLeft, sal_uInt32 nRight ); void ImpRemoveParagraph( sal_uInt32 nPara ); @@ -201,7 +201,7 @@ protected: long ImpGetPortionXOffset( sal_uInt32 nPara, TextLine* pLine, sal_uInt16 nTextPortion ); long ImpGetXPos( sal_uInt32 nPara, TextLine* pLine, sal_Int32 nIndex, bool bPreferPortionStart = false ); long ImpGetOutputOffset( sal_uInt32 nPara, TextLine* pLine, sal_Int32 nIndex, sal_Int32 nIndex2 ); - sal_uInt8 ImpGetRightToLeft( sal_uInt32 nPara, sal_Int32 nPos, sal_Int32* pStart = nullptr ); + sal_uInt8 ImpGetRightToLeft( sal_uInt32 nPara, sal_Int32 nPos ); static void ImpInitLayoutMode( OutputDevice* pOutDev ); TxtAlign ImpGetAlign() const; diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx index 18019e557326..f81673cc2ffd 100644 --- a/include/vcl/toolbox.hxx +++ b/include/vcl/toolbox.hxx @@ -386,7 +386,7 @@ public: void EnableItem( sal_uInt16 nItemId, bool bEnable = true ); bool IsItemEnabled( sal_uInt16 nItemId ) const; - void TriggerItem( sal_uInt16 nItemId, bool bShift = false ); + void TriggerItem( sal_uInt16 nItemId ); /// Shows or hides items. void ShowItem(sal_uInt16 nItemId, bool bVisible = true); diff --git a/include/xmloff/shapeexport.hxx b/include/xmloff/shapeexport.hxx index 795d19c95f2e..97699b86ca14 100644 --- a/include/xmloff/shapeexport.hxx +++ b/include/xmloff/shapeexport.hxx @@ -235,7 +235,7 @@ private: SAL_DLLPRIVATE void ImpExportOLE2Shape(const css::uno::Reference< css::drawing::XShape >& xShape, XmlShapeType eShapeType, XMLShapeExportFlags nFeatures = SEF_DEFAULT, css::awt::Point* pRefPoint = nullptr, SvXMLAttributeList* pAttrList = nullptr ); SAL_DLLPRIVATE void ImpExportPageShape(const css::uno::Reference< css::drawing::XShape >& xShape, XmlShapeType eShapeType, XMLShapeExportFlags nFeatures = SEF_DEFAULT, css::awt::Point* pRefPoint = nullptr ); SAL_DLLPRIVATE void ImpExportCaptionShape(const css::uno::Reference< css::drawing::XShape >& xShape, XmlShapeType eShapeType, XMLShapeExportFlags nFeatures = SEF_DEFAULT, css::awt::Point* pRefPoint = nullptr ); - SAL_DLLPRIVATE void ImpExport3DShape(const css::uno::Reference< css::drawing::XShape >& xShape, XmlShapeType eShapeType, XMLShapeExportFlags nFeatures = SEF_DEFAULT ); + SAL_DLLPRIVATE void ImpExport3DShape(const css::uno::Reference< css::drawing::XShape >& xShape, XmlShapeType eShapeType ); SAL_DLLPRIVATE void ImpExportFrameShape( const css::uno::Reference< css::drawing::XShape >& xShape, XmlShapeType eShapeType, XMLShapeExportFlags nFeatures = SEF_DEFAULT, css::awt::Point* pRefPoint = nullptr ); SAL_DLLPRIVATE void ImpExportPluginShape( const css::uno::Reference< css::drawing::XShape >& xShape, XmlShapeType eShapeType, XMLShapeExportFlags nFeatures = SEF_DEFAULT, css::awt::Point* pRefPoint = nullptr ); SAL_DLLPRIVATE void ImpExportAppletShape( const css::uno::Reference< css::drawing::XShape >& xShape, XmlShapeType eShapeType, XMLShapeExportFlags nFeatures = SEF_DEFAULT, css::awt::Point* pRefPoint = nullptr ); diff --git a/include/xmloff/xmlexp.hxx b/include/xmloff/xmlexp.hxx index 599e3dd6fe39..1ec40d1e4efe 100644 --- a/include/xmloff/xmlexp.hxx +++ b/include/xmloff/xmlexp.hxx @@ -380,8 +380,7 @@ public: instead of Locale. */ void AddLanguageTagAttributes( sal_uInt16 nPrefix, sal_uInt16 nPrefixRfc, - const LanguageTag& rLanguageTag, bool bWriteEmpty, - enum ::xmloff::token::XMLTokenEnum eClass = ::xmloff::token::XML_LANGUAGE ); + const LanguageTag& rLanguageTag, bool bWriteEmpty ); // add several attributes to the common attribute list void AddAttributeList( const css::uno::Reference< 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); diff --git a/xmloff/inc/txtflde.hxx b/xmloff/inc/txtflde.hxx index 00f723e97393..20025a0113f9 100644 --- a/xmloff/inc/txtflde.hxx +++ b/xmloff/inc/txtflde.hxx @@ -267,8 +267,7 @@ protected: void ProcessString( enum ::xmloff::token::XMLTokenEnum eXmlName, /// attribute token (namespace text) sal_uInt16 nValuePrefix, - const OUString& sValue, /// attribute value - bool bOmitEmpty = false); /// omit attribute, if value is empty + const OUString& sValue); /// attribute value /// export a string attribute, omit if default diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index e81167ce9568..9e04ef03cc6a 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -1031,50 +1031,23 @@ void SvXMLExport::AddLanguageTagAttributes( sal_uInt16 nPrefix, sal_uInt16 nPref } void SvXMLExport::AddLanguageTagAttributes( sal_uInt16 nPrefix, sal_uInt16 nPrefixRfc, - const LanguageTag& rLanguageTag, bool bWriteEmpty, xmloff::token::XMLTokenEnum eClass ) -{ - xmloff::token::XMLTokenEnum eLanguage, eScript, eCountry, eRfcLanguageTag; - switch (eClass) - { - default: - case XML_LANGUAGE: - eLanguage = XML_LANGUAGE; - eScript = XML_SCRIPT; - eCountry = XML_COUNTRY; - eRfcLanguageTag = XML_RFC_LANGUAGE_TAG; - break; - case XML_LANGUAGE_ASIAN: - eLanguage = XML_LANGUAGE_ASIAN; - eScript = XML_SCRIPT_ASIAN; - eCountry = XML_COUNTRY_ASIAN; - eRfcLanguageTag = XML_RFC_LANGUAGE_TAG_ASIAN; - if (nPrefix == XML_NAMESPACE_FO) - nPrefix = XML_NAMESPACE_STYLE; - break; - case XML_LANGUAGE_COMPLEX: - eLanguage = XML_LANGUAGE_COMPLEX; - eScript = XML_SCRIPT_COMPLEX; - eCountry = XML_COUNTRY_COMPLEX; - eRfcLanguageTag = XML_RFC_LANGUAGE_TAG_COMPLEX; - if (nPrefix == XML_NAMESPACE_FO) - nPrefix = XML_NAMESPACE_STYLE; - break; - } + const LanguageTag& rLanguageTag, bool bWriteEmpty ) +{ if (rLanguageTag.isIsoODF()) { if (bWriteEmpty || !rLanguageTag.isSystemLocale()) { - AddAttribute( nPrefix, eLanguage, rLanguageTag.getLanguage()); + AddAttribute( nPrefix, XML_LANGUAGE, rLanguageTag.getLanguage()); if (rLanguageTag.hasScript() && getDefaultVersion() >= SvtSaveOptions::ODFVER_012) - AddAttribute( nPrefix, eScript, rLanguageTag.getScript()); + AddAttribute( nPrefix, XML_SCRIPT, rLanguageTag.getScript()); if (bWriteEmpty || !rLanguageTag.getCountry().isEmpty()) - AddAttribute( nPrefix, eCountry, rLanguageTag.getCountry()); + AddAttribute( nPrefix, XML_COUNTRY, rLanguageTag.getCountry()); } } else { if (getDefaultVersion() >= SvtSaveOptions::ODFVER_012) - AddAttribute( nPrefixRfc, eRfcLanguageTag, rLanguageTag.getBcp47()); + AddAttribute( nPrefixRfc, XML_RFC_LANGUAGE_TAG, rLanguageTag.getBcp47()); // Also in case of non-pure-ISO tag store best matching fo: attributes // for consumers not handling *:rfc-language-tag, ensuring that only // valid ISO codes are stored. Here the bWriteEmpty parameter has no @@ -1083,11 +1056,11 @@ void SvXMLExport::AddLanguageTagAttributes( sal_uInt16 nPrefix, sal_uInt16 nPref rLanguageTag.getIsoLanguageScriptCountry( aLanguage, aScript, aCountry); if (!aLanguage.isEmpty()) { - AddAttribute( nPrefix, eLanguage, aLanguage); + AddAttribute( nPrefix, XML_LANGUAGE, aLanguage); if (!aScript.isEmpty() && getDefaultVersion() >= SvtSaveOptions::ODFVER_012) - AddAttribute( nPrefix, eScript, aScript); + AddAttribute( nPrefix, XML_SCRIPT, aScript); if (!aCountry.isEmpty()) - AddAttribute( nPrefix, eCountry, aCountry); + AddAttribute( nPrefix, XML_COUNTRY, aCountry); } } } diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 81b884efec3b..2c71dfa2e380 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -3449,7 +3449,7 @@ void XMLShapeExport::ImpExport3DSceneShape( const uno::Reference< drawing::XShap void XMLShapeExport::ImpExport3DShape( const uno::Reference< drawing::XShape >& xShape, - XmlShapeType eShapeType, XMLShapeExportFlags /* nFeatures = SEF_DEFAULT */) + XmlShapeType eShapeType) { const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY); if(xPropSet.is()) diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx index d0bb1d2d9809..dd9625b1c882 100644 --- a/xmloff/source/text/txtflde.cxx +++ b/xmloff/source/text/txtflde.cxx @@ -2483,12 +2483,11 @@ void XMLTextFieldExport::ProcessString(enum XMLTokenEnum eName, void XMLTextFieldExport::ProcessString(enum XMLTokenEnum eName, sal_uInt16 nValuePrefix, - const OUString& sValue, - bool bOmitEmpty) + const OUString& sValue) { OUString sQValue = GetExport().GetNamespaceMap().GetQNameByKey( nValuePrefix, sValue, false ); - ProcessString( eName, sQValue, bOmitEmpty ); + ProcessString( eName, sQValue ); } /// export a string attribute |