avmedia/source/viewer/mediawindow_impl.cxx | 19 avmedia/source/viewer/mediawindow_impl.hxx | 1 bridges/inc/bridge.hxx | 17 bridges/inc/cppinterfaceproxy.hxx | 3 bridges/inc/unointerfaceproxy.hxx | 12 compilerplugins/clang/salcall.cxx | 370 ++++++++++++++ compilerplugins/clang/singlevalfields.py | 5 compilerplugins/clang/singlevalfields.results | 138 ++--- compilerplugins/clang/test/salcall.cxx | 104 +++ connectivity/source/drivers/odbc/ORealDriver.hxx | 2 cui/source/customize/cfgutil.cxx | 12 cui/source/inc/cfgutil.hxx | 1 desktop/source/deployment/inc/dp_registry.hxx | 2 extensions/source/propctrlr/eventhandler.hxx | 2 extensions/source/propctrlr/genericpropertyhandler.hxx | 2 extensions/source/scanner/scanunx.cxx | 4 filter/source/config/cache/contenthandlerfactory.hxx | 2 filter/source/config/cache/filterfactory.hxx | 2 filter/source/config/cache/frameloaderfactory.hxx | 2 filter/source/config/cache/typedetection.hxx | 2 filter/source/odfflatxml/OdfFlatXml.cxx | 2 forms/source/xforms/binding.hxx | 2 idlc/source/idlcproduce.cxx | 2 include/formula/FormulaOpCodeMapperObj.hxx | 6 sal/osl/unx/file.cxx | 2 sc/source/ui/inc/undodat.hxx | 1 sc/source/ui/undo/undodat.cxx | 4 sd/source/ui/inc/facreg.hxx | 4 solenv/CompilerTest_compilerplugins_clang.mk | 1 svtools/source/uno/fpicker.hxx | 4 sw/source/filter/ww8/ww8graf2.cxx | 4 sw/source/filter/ww8/ww8par2.hxx | 2 sw/source/filter/ww8/ww8par6.cxx | 9 vcl/unx/generic/printer/printerinfomanager.cxx | 2 vcl/unx/gtk/a11y/atklistener.hxx | 4 vcl/unx/gtk/a11y/atkutil.cxx | 4 xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.hxx | 2 xmlsecurity/source/xmlsec/xsec_xmlsec.hxx | 2 38 files changed, 602 insertions(+), 157 deletions(-)
New commits: commit f6b437c57d4b0b032cb7e0838e16572bdf9a05cc Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Fri Dec 1 15:27:21 2017 +0200 loplugin:singlevalfields Change-Id: I521d2efa641f3a14c48561e2e0f6d687e5807d93 Reviewed-on: https://gerrit.libreoffice.org/45662 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/avmedia/source/viewer/mediawindow_impl.cxx b/avmedia/source/viewer/mediawindow_impl.cxx index f5d77615fb1e..e3045a63ece8 100644 --- a/avmedia/source/viewer/mediawindow_impl.cxx +++ b/avmedia/source/viewer/mediawindow_impl.cxx @@ -122,7 +122,6 @@ MediaWindowImpl::MediaWindowImpl(vcl::Window* pParent, MediaWindow* pMediaWindow , DropTargetHelper(this) , DragSourceHelper(this) , mpMediaWindow(pMediaWindow) - , mbEventTransparent(true) , mpMediaWindowControl(bInternalMediaControl ? VclPtr<MediaWindowControl>::Create(this) : nullptr) , mpEmptyBmpEx(nullptr) , mpAudioBmpEx(nullptr) @@ -637,53 +636,53 @@ void MediaWindowImpl::GetFocus() void MediaWindowImpl::MouseMove(const MouseEvent& rMEvt) { - if (mpMediaWindow && mbEventTransparent) + if (mpMediaWindow) mpMediaWindow->MouseMove(rMEvt); } void MediaWindowImpl::MouseButtonDown(const MouseEvent& rMEvt) { - if (mpMediaWindow && mbEventTransparent) + if (mpMediaWindow) mpMediaWindow->MouseButtonDown(rMEvt); } void MediaWindowImpl::MouseButtonUp(const MouseEvent& rMEvt) { - if (mpMediaWindow && mbEventTransparent) + if (mpMediaWindow) mpMediaWindow->MouseButtonUp(rMEvt); } void MediaWindowImpl::KeyInput(const KeyEvent& rKEvt) { - if (mpMediaWindow && mbEventTransparent) + if (mpMediaWindow) mpMediaWindow->KeyInput(rKEvt); } void MediaWindowImpl::KeyUp(const KeyEvent& rKEvt) { - if (mpMediaWindow && mbEventTransparent) + if (mpMediaWindow) mpMediaWindow->KeyUp(rKEvt); } void MediaWindowImpl::Command(const CommandEvent& rCEvt) { - if (mpMediaWindow && mbEventTransparent) + if (mpMediaWindow) mpMediaWindow->Command(rCEvt); } sal_Int8 MediaWindowImpl::AcceptDrop(const AcceptDropEvent& rEvt) { - return (mpMediaWindow && mbEventTransparent ? mpMediaWindow->AcceptDrop(rEvt) : 0); + return (mpMediaWindow ? mpMediaWindow->AcceptDrop(rEvt) : 0); } sal_Int8 MediaWindowImpl::ExecuteDrop(const ExecuteDropEvent& rEvt) { - return (mpMediaWindow && mbEventTransparent ? mpMediaWindow->ExecuteDrop(rEvt) : 0); + return (mpMediaWindow ? mpMediaWindow->ExecuteDrop(rEvt) : 0); } void MediaWindowImpl::StartDrag(sal_Int8 nAction, const Point& rPosPixel) { - if (mpMediaWindow && mbEventTransparent) + if (mpMediaWindow) mpMediaWindow->StartDrag(nAction, rPosPixel); } diff --git a/avmedia/source/viewer/mediawindow_impl.hxx b/avmedia/source/viewer/mediawindow_impl.hxx index 3b100c36e324..bed32852e5ce 100644 --- a/avmedia/source/viewer/mediawindow_impl.hxx +++ b/avmedia/source/viewer/mediawindow_impl.hxx @@ -147,7 +147,6 @@ private: MediaWindow* mpMediaWindow; rtl::Reference<MediaEventListenersImpl> mxEvents; - bool mbEventTransparent; VclPtr<MediaChildWindow> mpChildWindow; VclPtr<MediaWindowControl> mpMediaWindowControl; BitmapEx* mpEmptyBmpEx; diff --git a/compilerplugins/clang/singlevalfields.py b/compilerplugins/clang/singlevalfields.py index 5ed8c939bcea..855f3d5ae58f 100755 --- a/compilerplugins/clang/singlevalfields.py +++ b/compilerplugins/clang/singlevalfields.py @@ -26,7 +26,10 @@ with io.open("loplugin.singlevalfields.log", "rb", buffering=1024*1024) as txt: elif tokens[0] == "asgn:": parentClass = normalizeTypeParams(tokens[1]) fieldName = normalizeTypeParams(tokens[2]) - assignValue = tokens[3] + if len(tokens) > 3: + assignValue = tokens[3] + else: + assignValue = "" fieldInfo = (parentClass, fieldName) if not fieldInfo in fieldAssignDict: fieldAssignDict[fieldInfo] = set() diff --git a/compilerplugins/clang/singlevalfields.results b/compilerplugins/clang/singlevalfields.results index 715700b6f0f3..b99868b50374 100644 --- a/compilerplugins/clang/singlevalfields.results +++ b/compilerplugins/clang/singlevalfields.results @@ -1,4 +1,7 @@ -chart2/source/model/main/DataPoint.hxx:109 +avmedia/source/viewer/mediawindow_impl.hxx:150 + avmedia::priv::MediaWindowImpl mbEventTransparent + 1 +chart2/source/model/main/DataPoint.hxx:107 chart::DataPoint m_bNoParentPropAllowed 0 chart2/source/view/inc/GL3DRenderer.hxx:161 @@ -7,74 +10,62 @@ chart2/source/view/inc/GL3DRenderer.hxx:161 connectivity/source/inc/odbc/OBoundParam.hxx:113 connectivity::odbc::OBoundParam paramLength 0 -connectivity/source/inc/OTypeInfo.hxx:37 - connectivity::OTypeInfo nPrecision +cui/source/inc/cfgutil.hxx:132 + SfxConfigGroupListBox m_pImageProvider 0 -connectivity/source/inc/OTypeInfo.hxx:39 - connectivity::OTypeInfo nMaximumScale +include/basic/sbxvar.hxx:67 + SbxValues::(anonymous) pData 0 -connectivity/source/inc/OTypeInfo.hxx:40 - connectivity::OTypeInfo nMinimumScale +include/o3tl/vector_pool.hxx:93 + o3tl::detail::struct_from_value::type nextFree + -1 +include/svtools/svparser.hxx:74 + SvParser::TokenStackType nTokenValue 0 -connectivity/source/inc/OTypeInfo.hxx:43 - connectivity::OTypeInfo nSearchType - 3 -connectivity/source/inc/OTypeInfo.hxx:44 - connectivity::OTypeInfo nNumPrecRadix +include/svtools/svparser.hxx:75 + SvParser::TokenStackType bTokenHasValue 0 -connectivity/source/inc/OTypeInfo.hxx:46 - connectivity::OTypeInfo bCurrency +include/vcl/field.hxx:99 + PatternFormatter mbInPattKeyInput 0 -connectivity/source/inc/OTypeInfo.hxx:47 - connectivity::OTypeInfo bAutoIncrement +include/vcl/filter/pdfdocument.hxx:173 + vcl::filter::PDFNameElement m_nLength 0 -connectivity/source/inc/OTypeInfo.hxx:48 - connectivity::OTypeInfo bNullable - 1 -connectivity/source/inc/OTypeInfo.hxx:49 - connectivity::OTypeInfo bCaseSensitive +include/vcl/pdfwriter.hxx:549 + vcl::PDFWriter::PDFSignContext m_pDerEncoded 0 -connectivity/source/inc/OTypeInfo.hxx:50 - connectivity::OTypeInfo bUnsigned +include/vcl/pdfwriter.hxx:551 + vcl::PDFWriter::PDFSignContext m_nDerEncoded 0 -include/basic/sbxvar.hxx:67 - SbxValues::(anonymous) pData +include/vcl/pdfwriter.hxx:553 + vcl::PDFWriter::PDFSignContext m_pByteRange1 0 -include/filter/msfilter/dffpropset.hxx:33 - DffPropFlags bSet +include/vcl/pdfwriter.hxx:555 + vcl::PDFWriter::PDFSignContext m_nByteRange1 0 -include/filter/msfilter/dffpropset.hxx:35 - DffPropFlags bBlip - 1 -include/o3tl/vector_pool.hxx:93 - o3tl::detail::struct_from_value::type nextFree - -1 -include/vcl/field.hxx:100 - PatternFormatter mbInPattKeyInput +include/vcl/pdfwriter.hxx:557 + vcl::PDFWriter::PDFSignContext m_pByteRange2 0 -include/vcl/filter/pdfdocument.hxx:174 - vcl::filter::PDFNameElement m_nLength +include/vcl/pdfwriter.hxx:559 + vcl::PDFWriter::PDFSignContext m_nByteRange2 0 -libreofficekit/source/gtk/lokdocview.cxx:85 +libreofficekit/source/gtk/lokdocview.cxx:84 LOKDocViewPrivateImpl m_bIsLoading 0 -opencl/source/opencl_device.cxx:63 - opencl::(anonymous namespace)::LibreOfficeDeviceEvaluationIO inputSize +opencl/source/opencl_device.cxx:53 + (anonymous namespace)::LibreOfficeDeviceEvaluationIO inputSize 15360 -opencl/source/opencl_device.cxx:64 - opencl::(anonymous namespace)::LibreOfficeDeviceEvaluationIO outputSize +opencl/source/opencl_device.cxx:54 + (anonymous namespace)::LibreOfficeDeviceEvaluationIO outputSize 15360 -pyuno/source/module/pyuno_impl.hxx:314 +pyuno/source/module/pyuno_impl.hxx:312 pyuno::RuntimeCargo valid 1 -rsc/inc/rscdef.hxx:55 - RscExpType cUnused - 0 sax/source/tools/fastserializer.hxx:231 sax_fastparser::FastSaxSerializer mbXescape 1 sc/inc/compiler.hxx:108 - ScRawToken::(anonymous union)::(anonymous) bIsInForceArray + ScRawToken::(anonymous union)::(anonymous) eInForceArray 0 sc/inc/recursionhelper.hxx:56 ScRecursionHelper bConverging @@ -82,6 +73,9 @@ sc/inc/recursionhelper.hxx:56 sc/qa/unit/ucalc.hxx:41 Test::RangeNameDef mnIndex 1 +sc/source/ui/inc/undodat.hxx:448 + ScUndoDataForm nEndChangeAction + 0 sd/inc/sdpptwrp.hxx:42 SdPPTFilter pBas 0 @@ -91,22 +85,22 @@ sd/source/filter/html/htmlex.hxx:114 sd/source/ui/remotecontrol/DiscoveryService.hxx:43 sd::DiscoveryService zService 0 -sfx2/source/appl/lnkbase2.cxx:75 +sfx2/source/appl/lnkbase2.cxx:76 sfx2::ImplBaseLinkData::tDDEType pItem 0 -sfx2/source/appl/lnkbase2.cxx:80 +sfx2/source/appl/lnkbase2.cxx:81 sfx2::ImplBaseLinkData::(anonymous) DDEType 0 -sfx2/source/doc/doctemplates.cxx:134 +sfx2/source/doc/doctemplates.cxx:136 (anonymous namespace)::WaitWindow_Impl mnTextStyle 12576 -sfx2/source/view/ipclient.cxx:76 +sfx2/source/view/ipclient.cxx:78 SfxBooleanFlagGuard m_bLifeValue 1 shell/source/sessioninstall/SyncDbusSessionHelper.cxx:26 (anonymous namespace)::GErrorWrapper m_pError 0 -soltools/cpp/cpp.h:121 +soltools/cpp/cpp.h:120 includelist deleted 1 soltools/mkdepend/def.h:130 @@ -115,31 +109,31 @@ soltools/mkdepend/def.h:130 soltools/mkdepend/def.h:132 inclist i_searched 1 -starmath/inc/node.hxx:101 +starmath/inc/node.hxx:104 SmNode mnFlags 0 -stoc/source/inspect/introspection.cxx:1537 +stoc/source/inspect/introspection.cxx:1533 (anonymous namespace)::Cache::Data hits 1 -sw/inc/hints.hxx:196 +sw/inc/hints.hxx:195 SwAttrSetChg m_bDelSet 0 sw/inc/pagepreviewlayout.hxx:49 SwPagePreviewLayout mnYFree 568 -sw/source/core/inc/frmtool.hxx:256 +sw/source/core/inc/frmtool.hxx:260 SwBorderAttrs m_bBorderDist 1 -sw/source/core/inc/swfont.hxx:157 +sw/source/core/inc/swfont.hxx:158 SwFont m_nToxCount 0 -sw/source/core/inc/swfont.hxx:158 +sw/source/core/inc/swfont.hxx:159 SwFont m_nRefCount 0 -sw/source/core/inc/swfont.hxx:159 +sw/source/core/inc/swfont.hxx:160 SwFont m_nMetaCount 0 -sw/source/core/inc/swfont.hxx:160 +sw/source/core/inc/swfont.hxx:161 SwFont m_nInputFieldCount 0 sw/source/core/inc/UndoSort.hxx:38 @@ -157,12 +151,15 @@ sw/source/filter/html/htmlcss1.cxx:78 sw/source/filter/html/htmlcss1.cxx:79 SwCSS1ItemIds nFormatKeep 109 -sw/source/filter/html/svxcss1.hxx:205 +sw/source/filter/html/svxcss1.hxx:199 SvxCSS1Parser nMinFixLineSpace 141 sw/source/filter/inc/rtf.hxx:30 RTFSurround::(anonymous union)::(anonymous) nJunk 0 +sw/source/filter/ww8/ww8par2.hxx:58 + WW8SwFlyPara eAnchor + 0 sw/source/filter/ww8/ww8par.hxx:650 WW8FormulaControl mfUnknown 0 @@ -178,21 +175,18 @@ vcl/inc/salprn.hxx:42 vcl/inc/salprn.hxx:43 SalPrinterQueueInfo mpSysData 0 -vcl/inc/svdata.hxx:253 +vcl/inc/svdata.hxx:267 ImplSVNWFData mnStatusBarLowerRightOffset 0 -vcl/inc/svdata.hxx:269 +vcl/inc/svdata.hxx:283 ImplSVNWFData mbCenteredTabs 0 -vcl/inc/svdata.hxx:270 +vcl/inc/svdata.hxx:284 ImplSVNWFData mbNoActiveTabTextRaise 0 -vcl/inc/svdata.hxx:272 +vcl/inc/svdata.hxx:286 ImplSVNWFData mbProgressNeedsErase 0 -vcl/inc/unx/i18n_cb.hxx:53 - preedit_text_t nCursorPos - 0 vcl/source/edit/textdat2.hxx:53 TETextPortion nWidth -1 @@ -208,15 +202,15 @@ vcl/source/filter/jpeg/transupp.h:129 vcl/source/filter/jpeg/transupp.h:131 (anonymous) crop 0 -vcl/source/font/font.cxx:540 +vcl/source/font/font.cxx:539 (anonymous namespace)::WeightSearchEntry weight 5 -vcl/source/gdi/pdfwriter_impl.hxx:709 +vcl/source/gdi/pdfwriter_impl.hxx:706 vcl::PDFWriterImpl m_nInheritedPageWidth 595 -vcl/source/gdi/pdfwriter_impl.hxx:710 +vcl/source/gdi/pdfwriter_impl.hxx:707 vcl::PDFWriterImpl m_nInheritedPageHeight 842 -writerfilter/source/dmapper/GraphicImport.cxx:229 +writerfilter/source/dmapper/GraphicImport.cxx:223 writerfilter::dmapper::GraphicImport_Impl nCurrentBorderLine 2 diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx index 131930aa6688..e033e155b099 100644 --- a/cui/source/customize/cfgutil.cxx +++ b/cui/source/customize/cfgutil.cxx @@ -396,7 +396,6 @@ SfxConfigGroupListBox::SfxConfigGroupListBox(vcl::Window* pParent, WinBits nStyl : SvTreeListBox(pParent, nStyle) , xImp(new SvxConfigGroupBoxResource_Impl()) , pFunctionListBox(nullptr) - , m_pImageProvider(nullptr) , pStylesInfo(nullptr) { SetStyle( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_HASBUTTONS | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONSATROOT ); @@ -647,16 +646,7 @@ void SfxConfigGroupListBox::FillFunctionsList(const css::uno::Sequence<DispatchI for (const auto & rInfo : xCommands) { OUString sUIName = MapCommand2UIName(rInfo.Command); - Image aImage; - if ( m_pImageProvider ) - aImage = m_pImageProvider->GetImage( rInfo.Command ); - - SvTreeListEntry* pFuncEntry = nullptr; - if ( !!aImage ) - pFuncEntry = pFunctionListBox->InsertEntry( sUIName, aImage, aImage ); - else - pFuncEntry = pFunctionListBox->InsertEntry(sUIName ); - + SvTreeListEntry* pFuncEntry = pFunctionListBox->InsertEntry(sUIName ); aArr.push_back( o3tl::make_unique<SfxGroupInfo_Impl>( SfxCfgKind::FUNCTION_SLOT, 0 ) ); SfxGroupInfo_Impl* pGrpInfo = aArr.back().get(); pGrpInfo->sCommand = rInfo.Command; diff --git a/cui/source/inc/cfgutil.hxx b/cui/source/inc/cfgutil.hxx index 4e7dd97cdcb7..413de4e25c83 100644 --- a/cui/source/inc/cfgutil.hxx +++ b/cui/source/inc/cfgutil.hxx @@ -129,7 +129,6 @@ class SfxConfigGroupListBox : public SvTreeListBox std::unique_ptr<SvxConfigGroupBoxResource_Impl> xImp; VclPtr<SfxConfigFunctionListBox> pFunctionListBox; SfxGroupInfoArr_Impl aArr; - SaveInData* m_pImageProvider; OUString m_sModuleLongName; css::uno::Reference< css::uno::XComponentContext > m_xContext; css::uno::Reference< css::frame::XFrame > m_xFrame; diff --git a/sc/source/ui/inc/undodat.hxx b/sc/source/ui/inc/undodat.hxx index 3b19598eb701..cb9d88135319 100644 --- a/sc/source/ui/inc/undodat.hxx +++ b/sc/source/ui/inc/undodat.hxx @@ -445,7 +445,6 @@ private: std::unique_ptr<ScRefUndoData> xRefUndoData; std::unique_ptr<ScRefUndoData> xRefRedoData; sal_uLong nStartChangeAction; - sal_uLong nEndChangeAction; bool bRedoFilled; void DoChange( const bool bUndo ); diff --git a/sc/source/ui/undo/undodat.cxx b/sc/source/ui/undo/undodat.cxx index b1bb0bbc88f3..0fd7ee5f3b68 100644 --- a/sc/source/ui/undo/undodat.cxx +++ b/sc/source/ui/undo/undodat.cxx @@ -1757,7 +1757,7 @@ OUString ScUndoDataForm::GetComment() const void ScUndoDataForm::SetChangeTrack() { - nStartChangeAction = nEndChangeAction = 0; + nStartChangeAction = 0; } void ScUndoDataForm::Undo() @@ -1849,7 +1849,7 @@ void ScUndoDataForm::DoChange( const bool bUndo ) { ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack(); if ( pChangeTrack ) - pChangeTrack->Undo( nStartChangeAction, nEndChangeAction ); + pChangeTrack->Undo( nStartChangeAction, 0 ); } else SetChangeTrack(); diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx index fde01e6ad296..a2eb61857d7f 100644 --- a/sw/source/filter/ww8/ww8graf2.cxx +++ b/sw/source/filter/ww8/ww8graf2.cxx @@ -362,7 +362,7 @@ SwFlyFrameFormat* SwWW8ImplReader::MakeGrafNotInContent(const WW8PicDesc& rPD, WW8FlySet aFlySet(*this, m_xWFlyPara.get(), m_xSFlyPara.get(), true); - SwFormatAnchor aAnchor(m_xSFlyPara->eAnchor); + SwFormatAnchor aAnchor(WW8SwFlyPara::eAnchor); aAnchor.SetAnchor(m_pPaM->GetPoint()); aFlySet.Put(aAnchor); @@ -598,7 +598,7 @@ SwFrameFormat* SwWW8ImplReader::ImportGraf(SdrTextObj const * pTextObj, { WW8FlySet aFlySet(*this, m_xWFlyPara.get(), m_xSFlyPara.get(), true); - SwFormatAnchor aAnchor(m_xSFlyPara->eAnchor); + SwFormatAnchor aAnchor(WW8SwFlyPara::eAnchor); aAnchor.SetAnchor(m_pPaM->GetPoint()); aFlySet.Put(aAnchor); diff --git a/sw/source/filter/ww8/ww8par2.hxx b/sw/source/filter/ww8/ww8par2.hxx index 11d5a37e9982..b66fc73a9aa0 100644 --- a/sw/source/filter/ww8/ww8par2.hxx +++ b/sw/source/filter/ww8/ww8par2.hxx @@ -55,7 +55,7 @@ struct WW8SwFlyPara sal_Int16 nNetWidth; SwFrameSize eHeightFix; // height fixed or min - RndStdIds eAnchor; // binding + static constexpr RndStdIds eAnchor = RndStdIds::FLY_AT_PARA; // binding short eHRel; // page or page border short eVRel; // page or page border sal_Int16 eVAlign; // up, down, centered diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 4eff211a0ada..d4b17f9b6f81 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -1809,7 +1809,6 @@ nWidth(rWW.nSp28), nHeight(rWW.nSp45), nNetWidth(rWW.nSp28), eHeightFix(ATT_FIX_SIZE), -eAnchor(RndStdIds::FLY_AT_PARA), eHRel(text::RelOrientation::PAGE_FRAME), eVRel(text::RelOrientation::FRAME), eVAlign(text::VertOrientation::NONE), @@ -2097,7 +2096,7 @@ WW8FlySet::WW8FlySet(SwWW8ImplReader& rReader, const WW8FlyPara* pFW, if( !bGraf ) { - Put( SwFormatAnchor(pFS->eAnchor) ); + Put( SwFormatAnchor(WW8SwFlyPara::eAnchor) ); // adjust size //Ordinarily with frames, the border width and spacing is @@ -2390,10 +2389,10 @@ bool SwWW8ImplReader::StartApo(const ApoTestResults &rApo, const WW8_TablePos *p } else { - m_xSFlyPara->pFlyFormat = m_rDoc.MakeFlySection(m_xSFlyPara->eAnchor, + m_xSFlyPara->pFlyFormat = m_rDoc.MakeFlySection(WW8SwFlyPara::eAnchor, m_pPaM->GetPoint(), &aFlySet); OSL_ENSURE(m_xSFlyPara->pFlyFormat->GetAnchor().GetAnchorId() == - m_xSFlyPara->eAnchor, "Not the anchor type requested!"); + WW8SwFlyPara::eAnchor, "Not the anchor type requested!"); } if (m_xSFlyPara->pFlyFormat) @@ -2405,7 +2404,7 @@ bool SwWW8ImplReader::StartApo(const ApoTestResults &rApo, const WW8_TablePos *p m_xWWZOrder->InsertTextLayerObject(pOurNewObject); } - if (RndStdIds::FLY_AS_CHAR != m_xSFlyPara->eAnchor && m_xSFlyPara->pFlyFormat) + if (RndStdIds::FLY_AS_CHAR != WW8SwFlyPara::eAnchor && m_xSFlyPara->pFlyFormat) { m_xAnchorStck->AddAnchor(*m_pPaM->GetPoint(), m_xSFlyPara->pFlyFormat); } commit 68f86457525c60f580954280d1a759aa174e8e96 Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Fri Dec 1 15:24:30 2017 +0200 new loplugin salcall: remove unnecessary SAL_CALL In this first commit, I use the plugin to verify the consistency of our SAL_CALL annotations. The point being to make the next commit more mechanical in nature, purely using the rewriter. There are various chunks of unix-only code that have never had to be compiled by MSVC, hence the inconsistencies. In bridges, I had to inline some typedefs to make the verification code happy, since it cannot see into typedefs. Change-Id: Iec6e274bed857febf7295cfcf5e9f21fe4a34da0 Reviewed-on: https://gerrit.libreoffice.org/45502 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/bridges/inc/bridge.hxx b/bridges/inc/bridge.hxx index bae89b4b1364..d5c3ba9d9b40 100644 --- a/bridges/inc/bridge.hxx +++ b/bridges/inc/bridge.hxx @@ -33,28 +33,21 @@ namespace bridges { namespace cpp_uno { namespace shared { // private: -extern "C" typedef void SAL_CALL FreeMapping(uno_Mapping *); -FreeMapping freeMapping; +extern "C" void SAL_CALL freeMapping(uno_Mapping *); // private: -extern "C" -typedef void SAL_CALL AcquireMapping(uno_Mapping *); -AcquireMapping acquireMapping; +extern "C" void SAL_CALL acquireMapping(uno_Mapping *); // private: -extern "C" -typedef void SAL_CALL ReleaseMapping(uno_Mapping *); -ReleaseMapping releaseMapping; +extern "C" void SAL_CALL releaseMapping(uno_Mapping *); // private: -extern "C" typedef void SAL_CALL Cpp2unoMapping( +extern "C" void SAL_CALL cpp2unoMapping( uno_Mapping *, void **, void *, typelib_InterfaceTypeDescription *); -Cpp2unoMapping cpp2unoMapping; // private: -extern "C" typedef void SAL_CALL Uno2cppMapping( +extern "C" void SAL_CALL uno2cppMapping( uno_Mapping *, void **, void *, typelib_InterfaceTypeDescription *); -Uno2cppMapping uno2cppMapping; /** * Holding environments and mappings. diff --git a/bridges/inc/cppinterfaceproxy.hxx b/bridges/inc/cppinterfaceproxy.hxx index 0b97264e42f0..dfb1bdbf1e2b 100644 --- a/bridges/inc/cppinterfaceproxy.hxx +++ b/bridges/inc/cppinterfaceproxy.hxx @@ -45,9 +45,8 @@ namespace bridges { namespace cpp_uno { namespace shared { class Bridge; -extern "C" typedef void SAL_CALL FreeCppInterfaceProxy( +extern "C" void SAL_CALL freeCppInterfaceProxy( uno_ExtEnvironment * pEnv, void * pInterface); -FreeCppInterfaceProxy freeCppInterfaceProxy; /** * A cpp proxy wrapping a uno interface. diff --git a/bridges/inc/unointerfaceproxy.hxx b/bridges/inc/unointerfaceproxy.hxx index ba3ddcbb5624..77cd8e98a346 100644 --- a/bridges/inc/unointerfaceproxy.hxx +++ b/bridges/inc/unointerfaceproxy.hxx @@ -39,25 +39,21 @@ namespace bridges { namespace cpp_uno { namespace shared { class Bridge; -extern "C" typedef void SAL_CALL FreeUnoInterfaceProxy( +extern "C" void SAL_CALL freeUnoInterfaceProxy( uno_ExtEnvironment * pEnv, void * pProxy); -FreeUnoInterfaceProxy freeUnoInterfaceProxy; // private: -extern "C" typedef void SAL_CALL UnoInterfaceProxyDispatch( +extern "C" void SAL_CALL unoInterfaceProxyDispatch( uno_Interface * pUnoI, typelib_TypeDescription const * pMemberDescr, void * pReturn, void * pArgs[], uno_Any ** ppException); -UnoInterfaceProxyDispatch unoInterfaceProxyDispatch; // this function is not defined in the generic part, but instead has to be // defined individually for each CPP--UNO bridge // private: -extern "C" typedef void SAL_CALL AcquireProxy(uno_Interface *); -AcquireProxy acquireProxy; +extern "C" void SAL_CALL acquireProxy(uno_Interface *); // private: -extern "C" typedef void SAL_CALL ReleaseProxy(uno_Interface *); -ReleaseProxy releaseProxy; +extern "C" void SAL_CALL releaseProxy(uno_Interface *); /** * A uno proxy wrapping a cpp interface. diff --git a/compilerplugins/clang/salcall.cxx b/compilerplugins/clang/salcall.cxx new file mode 100644 index 000000000000..f982d7f41b11 --- /dev/null +++ b/compilerplugins/clang/salcall.cxx @@ -0,0 +1,370 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include "plugin.hxx" +#include "check.hxx" +#include <cassert> +#include <string> +#include <iostream> +#include <fstream> + +// The SAL_CALL function annotation is only necessary on our outward +// facing C++ ABI, anywhere else it is just cargo-cult. +// + +namespace +{ +//static bool startswith(const std::string& rStr, const char* pSubStr) +//{ +// return rStr.compare(0, strlen(pSubStr), pSubStr) == 0; +//} + +class SalCall final : public RecursiveASTVisitor<SalCall>, public loplugin::RewritePlugin +{ +public: + explicit SalCall(loplugin::InstantiationData const& data) + : RewritePlugin(data) + { + } + + virtual void run() override + { + std::string fn(compiler.getSourceManager() + .getFileEntryForID(compiler.getSourceManager().getMainFileID()) + ->getName()); + loplugin::normalizeDotDotInFilePath(fn); + // ignore this one. I can't get accurate source code from getCharacterData() for it. + if (fn == SRCDIR "/sal/rtl/string.cxx") + return; + m_phase = PluginPhase::FindAddressOf; + TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); + m_phase = PluginPhase::Warning; + TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); + } + + bool VisitFunctionDecl(FunctionDecl const*); + bool VisitUnaryAddrOf(UnaryOperator const*); + bool VisitInitListExpr(InitListExpr const*); + bool VisitCallExpr(CallExpr const*); + bool VisitBinAssign(BinaryOperator const*); + bool VisitCXXConstructExpr(CXXConstructExpr const*); + +private: + void checkForFunctionDecl(Expr const*, bool bCheckOnly = false); + bool rewrite(SourceLocation); + bool checkOverlap(SourceRange); + bool isSalCallFunction(FunctionDecl const* functionDecl, SourceLocation* pLoc = nullptr); + + std::set<FunctionDecl const*> m_addressOfSet; + enum class PluginPhase + { + FindAddressOf, + Warning + }; + PluginPhase m_phase; + std::vector<std::pair<char const*, char const*>> mvModifiedRanges; +}; + +bool SalCall::VisitUnaryAddrOf(UnaryOperator const* op) +{ + if (m_phase != PluginPhase::FindAddressOf) + return true; + checkForFunctionDecl(op->getSubExpr()); + return true; +} + +bool SalCall::VisitBinAssign(BinaryOperator const* binaryOperator) +{ + if (m_phase != PluginPhase::FindAddressOf) + return true; + checkForFunctionDecl(binaryOperator->getRHS()); + return true; +} + +bool SalCall::VisitCallExpr(CallExpr const* callExpr) +{ + if (m_phase != PluginPhase::FindAddressOf) + return true; + for (auto arg : callExpr->arguments()) + checkForFunctionDecl(arg); + return true; +} + +bool SalCall::VisitCXXConstructExpr(CXXConstructExpr const* constructExpr) +{ + if (m_phase != PluginPhase::FindAddressOf) + return true; + for (auto arg : constructExpr->arguments()) + checkForFunctionDecl(arg); + return true; +} + +bool SalCall::VisitInitListExpr(InitListExpr const* initListExpr) +{ + if (m_phase != PluginPhase::FindAddressOf) + return true; + for (auto subStmt : *initListExpr) + checkForFunctionDecl(dyn_cast<Expr>(subStmt)); + return true; +} + +void SalCall::checkForFunctionDecl(Expr const* expr, bool bCheckOnly) +{ + auto e1 = expr->IgnoreParenCasts(); + auto declRef = dyn_cast<DeclRefExpr>(e1); + if (!declRef) + return; + auto functionDecl = dyn_cast<FunctionDecl>(declRef->getDecl()); + if (!functionDecl) + return; + if (bCheckOnly) + getParentStmt(expr)->dump(); + else + m_addressOfSet.insert(functionDecl->getCanonicalDecl()); +} + +bool SalCall::VisitFunctionDecl(FunctionDecl const* decl) +{ + if (m_phase != PluginPhase::Warning) + return true; + if (ignoreLocation(decl)) + return true; + + // ignore template stuff + if (decl->getTemplatedKind() != clang::FunctionDecl::TK_NonTemplate) + return true; + auto recordDecl = dyn_cast<CXXRecordDecl>(decl->getDeclContext()); + if (recordDecl + && (recordDecl->getTemplateSpecializationKind() != TSK_Undeclared + || recordDecl->isDependentContext())) + { + return true; + } + + auto canonicalDecl = decl->getCanonicalDecl(); + + // ignore UNO implementations + if (isInUnoIncludeFile( + compiler.getSourceManager().getSpellingLoc(canonicalDecl->getLocation()))) + return true; + + // macros make getCharacterData() extremely unreliable + if (compiler.getSourceManager().isMacroArgExpansion(decl->getLocation()) + || compiler.getSourceManager().isMacroBodyExpansion(decl->getLocation())) + return true; + + SourceLocation rewriteLoc; + SourceLocation rewriteCanonicalLoc; + bool bDeclIsSalCall = isSalCallFunction(decl, &rewriteLoc); + bool bCanonicalDeclIsSalCall = isSalCallFunction(canonicalDecl, &rewriteCanonicalLoc); + + // first, check for consistency, so we don't trip ourselves up on Linux, where we normally run the plugin + if (canonicalDecl != decl) + { + if (bCanonicalDeclIsSalCall) + ; // this is fine, the actual definition have or not have SAL_CALL, and MSVC is fine with it + else if (bDeclIsSalCall) + { + // not fine + report(DiagnosticsEngine::Warning, "SAL_CALL inconsistency", + canonicalDecl->getLocation()) + << canonicalDecl->getSourceRange(); + report(DiagnosticsEngine::Note, "SAL_CALL inconsistency", decl->getLocation()) + << decl->getSourceRange(); + return true; + } + } + auto methodDecl = dyn_cast<CXXMethodDecl>(canonicalDecl); + if (methodDecl) + { + for (auto iter = methodDecl->begin_overridden_methods(); + iter != methodDecl->end_overridden_methods(); ++iter) + { + const CXXMethodDecl* overriddenMethod = (*iter)->getCanonicalDecl(); + if (bCanonicalDeclIsSalCall != isSalCallFunction(overriddenMethod)) + { + report(DiagnosticsEngine::Warning, "SAL_CALL inconsistency", + methodDecl->getLocation()) + << methodDecl->getSourceRange(); + report(DiagnosticsEngine::Note, "SAL_CALL inconsistency", + overriddenMethod->getLocation()) + << overriddenMethod->getSourceRange(); + return true; + } + } + } + + if (!bDeclIsSalCall) + return true; + + // @TODO For now, I am ignore free functions, since those are most likely to have their address taken. + // I'll do these later. They are harder to verify since MSVC does not verify when assigning to function pointers + // that the calling convention of the function matches the calling convention of the function pointer! + if (!methodDecl || methodDecl->isStatic()) + return true; + + // can only check when we have a definition since this is the most likely time + // when the address of the method will be taken + if (!(methodDecl && methodDecl->isPure()) && !decl->isThisDeclarationADefinition()) + return true; + if (m_addressOfSet.find(decl->getCanonicalDecl()) != m_addressOfSet.end()) + return true; + + // ignore extern "C" UNO factory constructor functions + if (decl->isExternC()) + { + if (loplugin::TypeCheck(decl->getReturnType()) + .Pointer() + .Class("XInterface") + .Namespace("uno") + .Namespace("star") + .Namespace("sun") + .Namespace("com") + .GlobalNamespace()) + return true; + if (loplugin::TypeCheck(decl->getReturnType()).Pointer().Void()) + return true; + } + + // some base classes are overridden by sub-classes which override both the base-class and an UNO class + if (recordDecl) + { + if (loplugin::DeclCheck(recordDecl) + .Class("OProxyAggregation") + .Namespace("comphelper") + .GlobalNamespace() + || loplugin::DeclCheck(recordDecl) + .Class("OComponentProxyAggregationHelper") + .Namespace("comphelper") + .GlobalNamespace() + || loplugin::DeclCheck(recordDecl).Class("SvxShapeMaster").GlobalNamespace()) + return true; + } + + if (methodDecl) + { + for (auto iter = methodDecl->begin_overridden_methods(); + iter != methodDecl->end_overridden_methods(); ++iter) + { + const CXXMethodDecl* overriddenMethod = (*iter)->getCanonicalDecl(); + if (isSalCallFunction(overriddenMethod)) + return true; + } + } + + /* + bool bOK = rewrite(rewriteLoc); + if (bOK && canonicalDecl != decl) + { + bOK = rewrite(rewriteCanonicalLoc); + } + if (bOK) + return true; + + //std::cout << "xxx:" << std::string(p1, leftBracket - p1) << std::endl; + report(DiagnosticsEngine::Warning, "SAL_CALL unnecessary here", rewriteLoc) + << decl->getSourceRange(); + if (canonicalDecl != decl) + report(DiagnosticsEngine::Warning, "SAL_CALL unnecessary here", rewriteCanonicalLoc) + << canonicalDecl->getSourceRange(); +*/ + return true; +} + +bool SalCall::isSalCallFunction(FunctionDecl const* functionDecl, SourceLocation* pLoc) +{ + // In certain situations, in header files, clang will return bogus range data + // from decl->getSourceRange(). + // Specifically, for the + // LNG_DLLPUBLIC CapType SAL_CALL capitalType(const OUString&, CharClass const *); + // declaration in + // include/linguistic/misc.hxx + // it looks like it is returning data from definition of the LNG_DLLPUBLIC macro. + // I suspect something inside clang is calling getSpellingLoc() once too often. + // + // So I use getReturnTypeSourceRange() for the start of the range + // instead, and search for the "(" in the function decl. + + SourceRange range = functionDecl->getSourceRange(); + SourceManager& SM = compiler.getSourceManager(); + SourceLocation startLoc = functionDecl->getReturnTypeSourceRange().getBegin(); + SourceLocation endLoc = range.getEnd(); + if (!startLoc.isValid() || !endLoc.isValid()) + return false; + char const* p1 = SM.getCharacterData(startLoc); + char const* p2 = SM.getCharacterData(endLoc); + + // if (functionDecl->getIdentifier() && functionDecl->getName() == "capitalType") + // { + // std::cout << "xxxx " << (long)p1 << " " << (long)p2 << " " << (int)(p2-p1) << std::endl; + // std::cout << " " << std::string(p1, 80) << std::endl; + // report(DiagnosticsEngine::Warning, "jhjkahdashdkash", functionDecl->getLocation()) + // << functionDecl->getSourceRange(); + // } + // + static const char* SAL_CALL = "SAL_CALL"; + + char const* leftBracket = static_cast<char const*>(memchr(p1, '(', p2 - p1)); + if (!leftBracket) + return false; + + char const* found = std::search(p1, leftBracket, SAL_CALL, SAL_CALL + strlen(SAL_CALL)); + + if (found >= leftBracket) + return false; + + if (pLoc) + // the -1 is to remove the space before the SAL_CALL + *pLoc = startLoc.getLocWithOffset(found - p1 - 1); + + return true; +} + +bool SalCall::rewrite(SourceLocation locBegin) +{ + if (!rewriter) + return false; + + auto locEnd = locBegin.getLocWithOffset(8); + + SourceRange range(locBegin, locEnd); + + // If we overlap with a previous area we modified, we cannot perform this change + // without corrupting the source + if (!checkOverlap(range)) + return false; + + if (!replaceText(locBegin, 9, "")) + return false; + + return true; +} + +// If we overlap with a previous area we modified, we cannot perform this change +// without corrupting the source +bool SalCall::checkOverlap(SourceRange range) +{ + SourceManager& SM = compiler.getSourceManager(); + char const* p1 = SM.getCharacterData(range.getBegin()); + char const* p2 = SM.getCharacterData(range.getEnd()); + for (std::pair<char const*, char const*> const& rPair : mvModifiedRanges) + { + if (rPair.first <= p1 && p1 <= rPair.second) + return false; + if (p1 <= rPair.second && rPair.first <= p2) + return false; + } + mvModifiedRanges.emplace_back(p1, p2); + return true; +} + +static loplugin::Plugin::Registration<SalCall> reg("salcall", true); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/compilerplugins/clang/test/salcall.cxx b/compilerplugins/clang/test/salcall.cxx new file mode 100644 index 000000000000..3b05530e8097 --- /dev/null +++ b/compilerplugins/clang/test/salcall.cxx @@ -0,0 +1,104 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <sal/types.h> + +class Class1 +{ + void SAL_CALL method1(); // xxexpected-error {{SAL_CALL unnecessary here [loplugin:salcall]}} +}; +void SAL_CALL Class1::method1() { +} // xxexpected-error {{SAL_CALL unnecessary here [loplugin:salcall]}} + +class Class2 +{ + void method1(); // expected-error {{SAL_CALL inconsistency [loplugin:salcall]}} +}; +void SAL_CALL Class2::method1() {} // expected-note {{SAL_CALL inconsistency [loplugin:salcall]}} + +// no warning, this appears to be legal +class Class3 +{ + void SAL_CALL method1(); +}; +void Class3::method1() {} + +// no warning, normal case for reference +class Class4 +{ + void method1(); +}; +void Class4::method1() {} + +class Class5_1 +{ + virtual void method1(); // expected-note {{SAL_CALL inconsistency [loplugin:salcall]}} + virtual ~Class5_1(); +}; +class Class5_2 +{ + virtual void SAL_CALL method1(); + virtual ~Class5_2(); +}; +class Class5_3 : public Class5_1, public Class5_2 +{ + virtual void SAL_CALL + method1() override; // expected-error {{SAL_CALL inconsistency [loplugin:salcall]}} + virtual ~Class5_3(); +}; + +class Class6_1 +{ + virtual void SAL_CALL method1(); + virtual ~Class6_1(); +}; +class Class6_2 +{ + virtual void SAL_CALL method1(); + virtual ~Class6_2(); +}; +class Class6_3 : public Class6_1, public Class6_2 +{ + virtual void SAL_CALL method1() override; + virtual ~Class6_3(); +}; + +class Class7_1 +{ + virtual void method1(); + virtual ~Class7_1(); +}; +class Class7_2 +{ + virtual void method1(); + virtual ~Class7_2(); +}; +class Class7_3 : public Class7_1, public Class7_2 +{ + virtual void method1() override; + virtual ~Class7_3(); +}; + +class Class8_1 +{ + virtual void method2(); + virtual ~Class8_1(); +}; +class Class8_2 +{ + virtual void SAL_CALL method2(); // expected-note {{SAL_CALL inconsistency [loplugin:salcall]}} + virtual ~Class8_2(); +}; +class Class8_3 : public Class8_1, public Class8_2 +{ + virtual void method2() override; // expected-error {{SAL_CALL inconsistency [loplugin:salcall]}} + virtual ~Class8_3(); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/connectivity/source/drivers/odbc/ORealDriver.hxx b/connectivity/source/drivers/odbc/ORealDriver.hxx index b4b092b87697..5a103d80fec3 100644 --- a/connectivity/source/drivers/odbc/ORealDriver.hxx +++ b/connectivity/source/drivers/odbc/ORealDriver.hxx @@ -33,7 +33,7 @@ namespace com { namespace sun { namespace star { namespace connectivity { namespace odbc { /// @throws css::uno::Exception -css::uno::Reference< css::uno::XInterface > +css::uno::Reference< css::uno::XInterface > SAL_CALL ODBCDriver_CreateInstance( css::uno::Reference< css::lang::XMultiServiceFactory > const & factory); } } diff --git a/desktop/source/deployment/inc/dp_registry.hxx b/desktop/source/deployment/inc/dp_registry.hxx index 43746ddfc642..7a3eda34f08a 100644 --- a/desktop/source/deployment/inc/dp_registry.hxx +++ b/desktop/source/deployment/inc/dp_registry.hxx @@ -32,7 +32,7 @@ namespace com { namespace sun { namespace star { namespace dp_registry { -css::uno::Reference<css::deployment::XPackageRegistry> create( +css::uno::Reference<css::deployment::XPackageRegistry> SAL_CALL create( OUString const & context, OUString const & cachePath, css::uno::Reference<css::uno::XComponentContext> const & xComponentContext); diff --git a/extensions/source/propctrlr/eventhandler.hxx b/extensions/source/propctrlr/eventhandler.hxx index bf6582623dd1..57274d235d75 100644 --- a/extensions/source/propctrlr/eventhandler.hxx +++ b/extensions/source/propctrlr/eventhandler.hxx @@ -100,7 +100,7 @@ namespace pcr static OUString SAL_CALL getImplementationName_static( ); /// @throws css::uno::RuntimeException static css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames_static( ); - static css::uno::Reference< css::uno::XInterface > Create( const css::uno::Reference< css::uno::XComponentContext >& _rxContext ); + static css::uno::Reference< css::uno::XInterface > SAL_CALL Create( const css::uno::Reference< css::uno::XComponentContext >& _rxContext ); private: explicit EventHandler( diff --git a/extensions/source/propctrlr/genericpropertyhandler.hxx b/extensions/source/propctrlr/genericpropertyhandler.hxx index c85732fc412d..51ac2f61e1a2 100644 --- a/extensions/source/propctrlr/genericpropertyhandler.hxx +++ b/extensions/source/propctrlr/genericpropertyhandler.hxx @@ -83,7 +83,7 @@ namespace pcr static OUString SAL_CALL getImplementationName_static( ); /// @throws css::uno::RuntimeException static css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames_static( ); - static css::uno::Reference< css::uno::XInterface > Create( const css::uno::Reference< css::uno::XComponentContext >& _rxContext ); + static css::uno::Reference< css::uno::XInterface > SAL_CALL Create( const css::uno::Reference< css::uno::XComponentContext >& _rxContext ); private: explicit GenericPropertyHandler( diff --git a/extensions/source/scanner/scanunx.cxx b/extensions/source/scanner/scanunx.cxx index 8d38481ba1d9..45015ef127f1 100644 --- a/extensions/source/scanner/scanunx.cxx +++ b/extensions/source/scanner/scanunx.cxx @@ -129,8 +129,8 @@ class ScannerThread : public osl::Thread ScannerManager* m_pManager; // just for the disposing call public: - virtual void run() override; - virtual void onTerminated() override { delete this; } + virtual void SAL_CALL run() override; + virtual void SAL_CALL onTerminated() override { delete this; } public: ScannerThread( const std::shared_ptr<SaneHolder>& pHolder, const Reference< css::lang::XEventListener >& listener, diff --git a/filter/source/config/cache/contenthandlerfactory.hxx b/filter/source/config/cache/contenthandlerfactory.hxx index f684b4048667..82bf415810cc 100644 --- a/filter/source/config/cache/contenthandlerfactory.hxx +++ b/filter/source/config/cache/contenthandlerfactory.hxx @@ -113,7 +113,7 @@ class ContentHandlerFactory : public ::cppu::ImplInheritanceHelper< BaseContaine @return The new instance of this service as an uno reference. */ - static css::uno::Reference< css::uno::XInterface > impl_createInstance(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR); + static css::uno::Reference< css::uno::XInterface > SAL_CALL impl_createInstance(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR); // Overrides to resolve ambiguity diff --git a/filter/source/config/cache/filterfactory.hxx b/filter/source/config/cache/filterfactory.hxx index c0e9a34d5aa3..bf211ac102d9 100644 --- a/filter/source/config/cache/filterfactory.hxx +++ b/filter/source/config/cache/filterfactory.hxx @@ -171,7 +171,7 @@ class FilterFactory : public ::cppu::ImplInheritanceHelper< BaseContainer @return The new instance of this service as an uno reference. */ - static css::uno::Reference< css::uno::XInterface > impl_createInstance(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR); + static css::uno::Reference< css::uno::XInterface > SAL_CALL impl_createInstance(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR); }; } // namespace config diff --git a/filter/source/config/cache/frameloaderfactory.hxx b/filter/source/config/cache/frameloaderfactory.hxx index 7dab5e02b0d9..bf05fc920af3 100644 --- a/filter/source/config/cache/frameloaderfactory.hxx +++ b/filter/source/config/cache/frameloaderfactory.hxx @@ -113,7 +113,7 @@ class FrameLoaderFactory : public ::cppu::ImplInheritanceHelper< BaseContainer @return The new instance of this service as an uno reference. */ - static css::uno::Reference< css::uno::XInterface > impl_createInstance(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR); + static css::uno::Reference< css::uno::XInterface > SAL_CALL impl_createInstance(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR); // Overrides to resolve ambiguity virtual css::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) override diff --git a/filter/source/config/cache/typedetection.hxx b/filter/source/config/cache/typedetection.hxx index 830badc54f63..78f8964e66ea 100644 --- a/filter/source/config/cache/typedetection.hxx +++ b/filter/source/config/cache/typedetection.hxx @@ -368,7 +368,7 @@ public: @return The new instance of this service as an uno reference. */ - static css::uno::Reference< css::uno::XInterface > impl_createInstance(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR); + static css::uno::Reference< css::uno::XInterface > SAL_CALL impl_createInstance(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR); }; class TerminateDetection : public cppu::WeakComponentImplHelper<css::frame::XTerminateListener> diff --git a/filter/source/odfflatxml/OdfFlatXml.cxx b/filter/source/odfflatxml/OdfFlatXml.cxx index 381e8429e612..aab5ec7adec4 100644 --- a/filter/source/odfflatxml/OdfFlatXml.cxx +++ b/filter/source/odfflatxml/OdfFlatXml.cxx @@ -97,7 +97,7 @@ namespace filter { static Sequence< OUString > impl_getSupportedServiceNames(); - static Reference< XInterface > impl_createInstance(const Reference< XMultiServiceFactory >& fact); + static Reference< XInterface > SAL_CALL impl_createInstance(const Reference< XMultiServiceFactory >& fact); }; } } diff --git a/forms/source/xforms/binding.hxx b/forms/source/xforms/binding.hxx index dc6ba779bbc4..1bd019a7d497 100644 --- a/forms/source/xforms/binding.hxx +++ b/forms/source/xforms/binding.hxx @@ -258,7 +258,7 @@ public: // the ID for XUnoTunnel calls static css::uno::Sequence<sal_Int8> getUnoTunnelID(); - static Binding* getBinding( const css::uno::Reference<css::beans::XPropertySet>& ); + static Binding* SAL_CALL getBinding( const css::uno::Reference<css::beans::XPropertySet>& ); private: diff --git a/idlc/source/idlcproduce.cxx b/idlc/source/idlcproduce.cxx index 60c5ff463045..2fa0a3b0317b 100644 --- a/idlc/source/idlcproduce.cxx +++ b/idlc/source/idlcproduce.cxx @@ -121,7 +121,7 @@ void removeIfExists(const OString& pathname) osl::File::remove(OStringToOUString(pathname, RTL_TEXTENCODING_UTF8)); } -sal_Int32 SAL_CALL +sal_Int32 produceFile(const OString& regFileName, sPair_t const*const pDepFile) { Options* pOptions = idlc()->getOptions(); diff --git a/include/formula/FormulaOpCodeMapperObj.hxx b/include/formula/FormulaOpCodeMapperObj.hxx index 36099199e60a..0d3c94330f45 100644 --- a/include/formula/FormulaOpCodeMapperObj.hxx +++ b/include/formula/FormulaOpCodeMapperObj.hxx @@ -52,9 +52,9 @@ class FORMULA_DLLPUBLIC FormulaOpCodeMapperObj : public cppu::WeakImplHelper< { ::std::unique_ptr<FormulaCompiler> m_pCompiler; public: - static OUString getImplementationName_Static(); - static css::uno::Sequence< OUString> getSupportedServiceNames_Static(); - static css::uno::Reference< css::uno::XInterface > create(const css::uno::Reference< css::uno::XComponentContext >& _xContext); + static OUString SAL_CALL getImplementationName_Static(); + static css::uno::Sequence< OUString> SAL_CALL getSupportedServiceNames_Static(); + static css::uno::Reference< css::uno::XInterface > SAL_CALL create(const css::uno::Reference< css::uno::XComponentContext >& _xContext); protected: FormulaOpCodeMapperObj(::std::unique_ptr<FormulaCompiler> && _pCompiler); diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx index 68d384414af3..86d513a73225 100644 --- a/sal/osl/unx/file.cxx +++ b/sal/osl/unx/file.cxx @@ -1056,7 +1056,7 @@ oslFileError SAL_CALL osl_openFile(rtl_uString* ustrFileURL, oslFileHandle* pHan return openFile(ustrFileURL, pHandle, uFlags, mode_t(-1)); } -oslFileError SAL_CALL openFile(rtl_uString* ustrFileURL, oslFileHandle* pHandle, sal_uInt32 uFlags, mode_t mode) +oslFileError openFile(rtl_uString* ustrFileURL, oslFileHandle* pHandle, sal_uInt32 uFlags, mode_t mode) { oslFileError eRet; diff --git a/sd/source/ui/inc/facreg.hxx b/sd/source/ui/inc/facreg.hxx index a235e393818c..58a4903a731b 100644 --- a/sd/source/ui/inc/facreg.hxx +++ b/sd/source/ui/inc/facreg.hxx @@ -30,13 +30,13 @@ namespace com { namespace sun { namespace star { css::uno::Reference< css::uno::XInterface > SAL_CALL SdDrawingDocument_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory > & _rxFactory, SfxModelFlags _nCreationFlags ); /// @throws css::uno::RuntimeException -OUString SdDrawingDocument_getImplementationName(); +OUString SAL_CALL SdDrawingDocument_getImplementationName(); /// @throws css::uno::RuntimeException css::uno::Sequence< OUString > SAL_CALL SdDrawingDocument_getSupportedServiceNames(); css::uno::Reference< css::uno::XInterface > SAL_CALL SdPresentationDocument_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory > & _rxFactory, SfxModelFlags _nCreationFlags ); /// @throws css::uno::RuntimeException -OUString SdPresentationDocument_getImplementationName(); +OUString SAL_CALL SdPresentationDocument_getImplementationName(); /// @throws css::uno::RuntimeException css::uno::Sequence< OUString > SAL_CALL SdPresentationDocument_getSupportedServiceNames(); diff --git a/solenv/CompilerTest_compilerplugins_clang.mk b/solenv/CompilerTest_compilerplugins_clang.mk index c2b78bf8832d..4a98ef996091 100644 --- a/solenv/CompilerTest_compilerplugins_clang.mk +++ b/solenv/CompilerTest_compilerplugins_clang.mk @@ -38,6 +38,7 @@ $(eval $(call gb_CompilerTest_add_exception_objects,compilerplugins_clang, \ compilerplugins/clang/test/redundantpointerops \ compilerplugins/clang/test/refcounting \ compilerplugins/clang/test/salbool \ + compilerplugins/clang/test/salcall \ compilerplugins/clang/test/salunicodeliteral \ compilerplugins/clang/test/simplifybool \ compilerplugins/clang/test/simplifydynamiccast \ diff --git a/svtools/source/uno/fpicker.hxx b/svtools/source/uno/fpicker.hxx index 5042cffe0431..516c56ec667d 100644 --- a/svtools/source/uno/fpicker.hxx +++ b/svtools/source/uno/fpicker.hxx @@ -35,12 +35,12 @@ namespace com { namespace sun { namespace star { css::uno::Reference<css::uno::XInterface> SAL_CALL FilePicker_CreateInstance( css::uno::Reference< css::uno::XComponentContext > const & context); css::uno::Sequence<OUString> FilePicker_getSupportedServiceNames(); -OUString FilePicker_getImplementationName(); +OUString SAL_CALL FilePicker_getImplementationName(); css::uno::Reference<css::uno::XInterface> SAL_CALL FolderPicker_CreateInstance( css::uno::Reference< css::uno::XComponentContext > const & context); css::uno::Sequence<OUString> FolderPicker_getSupportedServiceNames(); -OUString FolderPicker_getImplementationName(); +OUString SAL_CALL FolderPicker_getImplementationName(); #endif diff --git a/vcl/unx/generic/printer/printerinfomanager.cxx b/vcl/unx/generic/printer/printerinfomanager.cxx index f19a45bc2aa0..9a6c7907cd5f 100644 --- a/vcl/unx/generic/printer/printerinfomanager.cxx +++ b/vcl/unx/generic/printer/printerinfomanager.cxx @@ -60,7 +60,7 @@ namespace psp m_aQueues; OUString m_aCommand; - virtual void run() override; + virtual void SAL_CALL run() override; public: SystemQueueInfo(); diff --git a/vcl/unx/gtk/a11y/atklistener.hxx b/vcl/unx/gtk/a11y/atklistener.hxx index 82baf1e72461..58798d4439fb 100644 --- a/vcl/unx/gtk/a11y/atklistener.hxx +++ b/vcl/unx/gtk/a11y/atklistener.hxx @@ -33,10 +33,10 @@ public: explicit AtkListener(AtkObjectWrapper * pWrapper); // XEventListener - virtual void disposing( const css::lang::EventObject& Source ) override; + virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override; // XAccessibleEventListener - virtual void notifyEvent( const css::accessibility::AccessibleEventObject& aEvent ) override; + virtual void SAL_CALL notifyEvent( const css::accessibility::AccessibleEventObject& aEvent ) override; private: diff --git a/vcl/unx/gtk/a11y/atkutil.cxx b/vcl/unx/gtk/a11y/atkutil.cxx index 14bb6045c376..5b7e89bd78af 100644 --- a/vcl/unx/gtk/a11y/atkutil.cxx +++ b/vcl/unx/gtk/a11y/atkutil.cxx @@ -185,10 +185,10 @@ public: static uno::Reference< accessibility::XAccessible > getAccessible(const lang::EventObject& aEvent ); // XEventListener - virtual void disposing( const lang::EventObject& Source ) override; + virtual void SAL_CALL disposing( const lang::EventObject& Source ) override; // XAccessibleEventListener - virtual void notifyEvent( const accessibility::AccessibleEventObject& aEvent ) override; + virtual void SAL_CALL notifyEvent( const accessibility::AccessibleEventObject& aEvent ) override; }; /*****************************************************************************/ diff --git a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.hxx b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.hxx index 8f22a8f37363..d8868884e99a 100644 --- a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.hxx +++ b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.hxx @@ -81,7 +81,7 @@ class X509Certificate_NssImpl : public ::cppu::WeakImplHelper< virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; /// @see xmlsecurity::Certificate::getSHA256Thumbprint(). - virtual css::uno::Sequence<sal_Int8> getSHA256Thumbprint() override; + virtual css::uno::Sequence<sal_Int8> SAL_CALL getSHA256Thumbprint() override; static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId() ; diff --git a/xmlsecurity/source/xmlsec/xsec_xmlsec.hxx b/xmlsecurity/source/xmlsec/xsec_xmlsec.hxx index 5ecdf4e9de68..7db284869e56 100644 --- a/xmlsecurity/source/xmlsec/xsec_xmlsec.hxx +++ b/xmlsecurity/source/xmlsec/xsec_xmlsec.hxx @@ -24,7 +24,7 @@ extern "C" { -void* nss_component_getFactory( const sal_Char*, void*, void* ); +void* SAL_CALL nss_component_getFactory( const sal_Char*, void*, void* ); #if defined( XMLSEC_CRYPTO_MSCRYPTO ) void* mscrypt_component_getFactory( const sal_Char*, void*, void* ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits