diff options
787 files changed, 2337 insertions, 1878 deletions
diff --git a/animations/source/animcore/animcore.cxx b/animations/source/animcore/animcore.cxx index 5e0bff6362a8..12ba771046ab 100644 --- a/animations/source/animcore/animcore.cxx +++ b/animations/source/animcore/animcore.cxx @@ -491,112 +491,112 @@ AnimationNode::AnimationNode( const AnimationNode& rNode ) { } -Sequence<OUString> getSupportedServiceNames_PAR() +static Sequence<OUString> getSupportedServiceNames_PAR() { return { "com.sun.star.animations.ParallelTimeContainer" }; } -OUString getImplementationName_PAR() +static OUString getImplementationName_PAR() { return OUString( "animcore::ParallelTimeContainer" ); } -Sequence<OUString> getSupportedServiceNames_SEQ() +static Sequence<OUString> getSupportedServiceNames_SEQ() { return { "com.sun.star.animations.SequenceTimeContainer" }; } -OUString getImplementationName_SEQ() +static OUString getImplementationName_SEQ() { return OUString( "animcore::SequenceTimeContainer" ); } -Sequence<OUString> getSupportedServiceNames_ITERATE() +static Sequence<OUString> getSupportedServiceNames_ITERATE() { return { "com.sun.star.animations.IterateContainer" }; } -OUString getImplementationName_ITERATE() +static OUString getImplementationName_ITERATE() { return OUString( "animcore::IterateContainer" ); } -Sequence<OUString> getSupportedServiceNames_ANIMATE() +static Sequence<OUString> getSupportedServiceNames_ANIMATE() { return { "com.sun.star.animations.Animate" }; } -OUString getImplementationName_ANIMATE() +static OUString getImplementationName_ANIMATE() { return OUString( "animcore::Animate" ); } -Sequence<OUString> getSupportedServiceNames_SET() +static Sequence<OUString> getSupportedServiceNames_SET() { return { "com.sun.star.animations.AnimateSet" }; } -OUString getImplementationName_SET() +static OUString getImplementationName_SET() { return OUString( "animcore::AnimateSet" ); } -Sequence<OUString> getSupportedServiceNames_ANIMATECOLOR() +static Sequence<OUString> getSupportedServiceNames_ANIMATECOLOR() { return { "com.sun.star.animations.AnimateColor" }; } -OUString getImplementationName_ANIMATECOLOR() +static OUString getImplementationName_ANIMATECOLOR() { return OUString( "animcore::AnimateColor" ); } -Sequence<OUString> getSupportedServiceNames_ANIMATEMOTION() +static Sequence<OUString> getSupportedServiceNames_ANIMATEMOTION() { return { "com.sun.star.animations.AnimateMotion" }; } -OUString getImplementationName_ANIMATEMOTION() +static OUString getImplementationName_ANIMATEMOTION() { return OUString( "animcore::AnimateMotion" ); } -Sequence<OUString> getSupportedServiceNames_ANIMATETRANSFORM() +static Sequence<OUString> getSupportedServiceNames_ANIMATETRANSFORM() { return { "com.sun.star.animations.AnimateTransform" }; } -OUString getImplementationName_ANIMATETRANSFORM() +static OUString getImplementationName_ANIMATETRANSFORM() { return OUString( "animcore::AnimateTransform" ); } -Sequence<OUString> getSupportedServiceNames_TRANSITIONFILTER() +static Sequence<OUString> getSupportedServiceNames_TRANSITIONFILTER() { return { "com.sun.star.animations.TransitionFilter" }; } -OUString getImplementationName_TRANSITIONFILTER() +static OUString getImplementationName_TRANSITIONFILTER() { return OUString( "animcore::TransitionFilter" ); } -Sequence<OUString> getSupportedServiceNames_AUDIO() +static Sequence<OUString> getSupportedServiceNames_AUDIO() { return { "com.sun.star.animations.Audio" }; } -OUString getImplementationName_AUDIO() +static OUString getImplementationName_AUDIO() { return OUString( "animcore::Audio" ); } -Sequence<OUString> getSupportedServiceNames_COMMAND() +static Sequence<OUString> getSupportedServiceNames_COMMAND() { return { "com.sun.star.animations.Command" }; } -OUString getImplementationName_COMMAND() +static OUString getImplementationName_COMMAND() { return OUString( "animcore::Command" ); } diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx index dfa698a4a345..1e216698d1d9 100644 --- a/basctl/source/basicide/baside3.cxx +++ b/basctl/source/basicide/baside3.cxx @@ -744,7 +744,7 @@ void DialogWindow::SaveDialog() } } -std::vector< lang::Locale > implGetLanguagesOnlyContainedInFirstSeq +static std::vector< lang::Locale > implGetLanguagesOnlyContainedInFirstSeq ( const Sequence< lang::Locale >& aFirstSeq, const Sequence< lang::Locale >& aSecondSeq ) { std::vector< lang::Locale > avRet; diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx index 47fee717fa00..916b72eca1fb 100644 --- a/basctl/source/basicide/bastypes.cxx +++ b/basctl/source/basicide/bastypes.cxx @@ -707,7 +707,7 @@ LibInfo::Item::Item ( LibInfo::Item::~Item () { } -bool QueryDel(const OUString& rName, const OUString &rStr, weld::Widget* pParent) +static bool QueryDel(const OUString& rName, const OUString &rStr, weld::Widget* pParent) { OUStringBuffer aNameBuf( rName ); aNameBuf.append('\''); diff --git a/basctl/source/basicide/localizationmgr.cxx b/basctl/source/basicide/localizationmgr.cxx index 8822ee21c9ba..743e43089deb 100644 --- a/basctl/source/basicide/localizationmgr.cxx +++ b/basctl/source/basicide/localizationmgr.cxx @@ -97,7 +97,7 @@ void LocalizationMgr::handleTranslationbar () // TODO: -> export from toolkit -bool isLanguageDependentProperty( const OUString& aName ) +static bool isLanguageDependentProperty( const OUString& aName ) { static struct Prop { @@ -160,7 +160,7 @@ void LocalizationMgr::implEnableDisableResourceForAllLibraryDialogs( HandleResou } -OUString implCreatePureResourceId +static OUString implCreatePureResourceId ( const OUString& aDialogName, const OUString& aCtrlName, const OUString& aPropName, const Reference< XStringResourceManager >& xStringResourceManager ) @@ -770,7 +770,7 @@ void LocalizationMgr::handleBasicStopped() } -DialogWindow* FindDialogWindowForEditor( DlgEditor const * pEditor ) +static DialogWindow* FindDialogWindowForEditor( DlgEditor const * pEditor ) { Shell::WindowTable const& aWindowTable = GetShell()->GetWindowTable(); for (auto const& window : aWindowTable) diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx index 1e6b11d53a19..23f41d06e6e9 100644 --- a/basctl/source/dlged/dlged.cxx +++ b/basctl/source/dlged/dlged.cxx @@ -646,7 +646,7 @@ void DlgEditor::Cut() } -void implCopyStreamToByteSequence( const Reference< XInputStream >& xStream, +static void implCopyStreamToByteSequence( const Reference< XInputStream >& xStream, Sequence< sal_Int8 >& bytes ) { xStream->readBytes( bytes, xStream->available() ); @@ -1102,7 +1102,7 @@ namespace Print long const nBorder = 300; } -void lcl_PrintHeader( Printer* pPrinter, const OUString& rTitle ) // not working yet +static void lcl_PrintHeader( Printer* pPrinter, const OUString& rTitle ) // not working yet { pPrinter->Push(); diff --git a/basctl/source/dlged/dlgedview.cxx b/basctl/source/dlged/dlgedview.cxx index 12d2d57bb99a..b1a2603abb30 100644 --- a/basctl/source/dlged/dlgedview.cxx +++ b/basctl/source/dlged/dlgedview.cxx @@ -123,7 +123,7 @@ void DlgEdView::MakeVisible( const tools::Rectangle& rRect, vcl::Window& rWin ) } } -SdrObject* impLocalHitCorrection(SdrObject* pRetval, const Point& rPnt, sal_uInt16 nTol) +static SdrObject* impLocalHitCorrection(SdrObject* pRetval, const Point& rPnt, sal_uInt16 nTol) { DlgEdObj* pDlgEdObj = dynamic_cast< DlgEdObj* >(pRetval); diff --git a/basegfx/source/polygon/b2dpolygonclipper.cxx b/basegfx/source/polygon/b2dpolygonclipper.cxx index 5057fc52d977..f4b26f260972 100644 --- a/basegfx/source/polygon/b2dpolygonclipper.cxx +++ b/basegfx/source/polygon/b2dpolygonclipper.cxx @@ -552,7 +552,7 @@ namespace basegfx * outside |inside |intersect with clip plane follwed by next * */ - sal_uInt32 scissorLineSegment( ::basegfx::B2DPoint *in_vertex, // input buffer + static sal_uInt32 scissorLineSegment( ::basegfx::B2DPoint *in_vertex, // input buffer sal_uInt32 in_count, // number of verts in input buffer ::basegfx::B2DPoint *out_vertex, // output buffer scissor_plane const *pPlane, // scissoring plane diff --git a/basegfx/source/polygon/b2dpolygontools.cxx b/basegfx/source/polygon/b2dpolygontools.cxx index 94590d7483a8..b5d2abf7e4be 100644 --- a/basegfx/source/polygon/b2dpolygontools.cxx +++ b/basegfx/source/polygon/b2dpolygontools.cxx @@ -1654,7 +1654,7 @@ namespace basegfx return createPolygonFromEllipse( rCenter, fRadius, fRadius ); } - B2DPolygon impCreateUnitCircle(sal_uInt32 nStartQuadrant) + static B2DPolygon impCreateUnitCircle(sal_uInt32 nStartQuadrant) { B2DPolygon aUnitCircle; const double fKappa((M_SQRT2 - 1.0) * 4.0 / 3.0); diff --git a/basegfx/source/polygon/b3dpolypolygontools.cxx b/basegfx/source/polygon/b3dpolypolygontools.cxx index 0130dd5d7081..f3975a7a51c0 100644 --- a/basegfx/source/polygon/b3dpolypolygontools.cxx +++ b/basegfx/source/polygon/b3dpolypolygontools.cxx @@ -223,7 +223,7 @@ namespace basegfx // helper for getting the 3D Point from given cartesian coordinates. fHor is defined from // [F_PI2 .. -F_PI2], fVer from [0.0 .. F_2PI] - inline B3DPoint getPointFromCartesian(double fHor, double fVer) + static inline B3DPoint getPointFromCartesian(double fHor, double fVer) { const double fCosVer(cos(fVer)); return B3DPoint(fCosVer * cos(fHor), sin(fVer), fCosVer * -sin(fHor)); diff --git a/basegfx/source/tools/gradienttools.cxx b/basegfx/source/tools/gradienttools.cxx index b05d9b219a53..082f564556a4 100644 --- a/basegfx/source/tools/gradienttools.cxx +++ b/basegfx/source/tools/gradienttools.cxx @@ -45,7 +45,7 @@ namespace basegfx /** Most of the setup for linear & axial gradient is the same, except for the border treatment. Factored out here. */ - ODFGradientInfo init1DGradientInfo( + static ODFGradientInfo init1DGradientInfo( const B2DRange& rTargetRange, sal_uInt32 nSteps, double fBorder, @@ -115,7 +115,7 @@ namespace basegfx /** Most of the setup for radial & ellipsoidal gradient is the same, except for the border treatment. Factored out here. */ - ODFGradientInfo initEllipticalGradientInfo( + static ODFGradientInfo initEllipticalGradientInfo( const B2DRange& rTargetRange, const B2DVector& rOffset, sal_uInt32 nSteps, @@ -184,7 +184,7 @@ namespace basegfx /** Setup for rect & square gradient is exactly the same. Factored out here. */ - ODFGradientInfo initRectGradientInfo( + static ODFGradientInfo initRectGradientInfo( const B2DRange& rTargetRange, const B2DVector& rOffset, sal_uInt32 nSteps, diff --git a/basegfx/source/tools/stringconversiontools.cxx b/basegfx/source/tools/stringconversiontools.cxx index b14fce0fb557..6e48c22b1f89 100644 --- a/basegfx/source/tools/stringconversiontools.cxx +++ b/basegfx/source/tools/stringconversiontools.cxx @@ -35,7 +35,7 @@ namespace basegfx } } - void skipSpacesAndCommas(sal_Int32& io_rPos, + static void skipSpacesAndCommas(sal_Int32& io_rPos, const OUString& rStr, const sal_Int32 nLen) { @@ -46,7 +46,7 @@ namespace basegfx } } - bool getDoubleChar(double& o_fRetval, + static bool getDoubleChar(double& o_fRetval, sal_Int32& io_rPos, const OUString& rStr) { diff --git a/basegfx/test/boxclipper.cxx b/basegfx/test/boxclipper.cxx index f155c6a73b34..49015b66deef 100644 --- a/basegfx/test/boxclipper.cxx +++ b/basegfx/test/boxclipper.cxx @@ -49,7 +49,7 @@ double getRandomOrdinal( const std::size_t n ) return comphelper::rng::uniform_size_distribution(0, n-1); } -inline bool compare(const B2DPoint& left, const B2DPoint& right) +static inline bool compare(const B2DPoint& left, const B2DPoint& right) { return left.getX()<right.getX() || (rtl::math::approxEqual(left.getX(),right.getX()) && left.getY()<right.getY()); diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index 08e13d857eae..c404b7b893c6 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -497,7 +497,7 @@ BasicManager::BasicManager( SotStorage& rStorage, const OUString& rBaseURL, Star } } -void copyToLibraryContainer( StarBASIC* pBasic, const LibraryContainerInfo& rInfo ) +static void copyToLibraryContainer( StarBASIC* pBasic, const LibraryContainerInfo& rInfo ) { uno::Reference< script::XLibraryContainer > xScriptCont( rInfo.mxScriptCont.get() ); if ( !xScriptCont.is() ) @@ -1771,7 +1771,7 @@ void ModuleContainer_Impl::removeByName( const OUString& Name ) } -uno::Sequence< sal_Int8 > implGetDialogData( SbxObject* pDialog ) +static uno::Sequence< sal_Int8 > implGetDialogData( SbxObject* pDialog ) { SvMemoryStream aMemStream; pDialog->Store( aMemStream ); @@ -1784,7 +1784,7 @@ uno::Sequence< sal_Int8 > implGetDialogData( SbxObject* pDialog ) return aData; } -SbxObject* implCreateDialog( const uno::Sequence< sal_Int8 >& aData ) +static SbxObject* implCreateDialog( const uno::Sequence< sal_Int8 >& aData ) { sal_Int8* pData = const_cast< uno::Sequence< sal_Int8 >& >(aData).getArray(); SvMemoryStream aMemStream( pData, aData.getLength(), StreamMode::READ ); diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx index a2a340a84eb4..28667187513e 100644 --- a/basic/source/classes/image.cxx +++ b/basic/source/classes/image.cxx @@ -68,13 +68,13 @@ void SbiImage::Clear() bError = false; } -bool SbiGood( SvStream const & r ) +static bool SbiGood( SvStream const & r ) { return r.good(); } // Open Record -sal_uInt64 SbiOpenRecord( SvStream& r, FileOffset nSignature, sal_uInt16 nElem ) +static sal_uInt64 SbiOpenRecord( SvStream& r, FileOffset nSignature, sal_uInt16 nElem ) { sal_uInt64 nPos = r.Tell(); r.WriteUInt16( static_cast<sal_uInt16>( nSignature ) ) @@ -83,7 +83,7 @@ sal_uInt64 SbiOpenRecord( SvStream& r, FileOffset nSignature, sal_uInt16 nElem ) } // Close Record -void SbiCloseRecord( SvStream& r, sal_uInt64 nOff ) +static void SbiCloseRecord( SvStream& r, sal_uInt64 nOff ) { sal_uInt64 nPos = r.Tell(); r.Seek( nOff + 2 ); diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index a83bcd3c3961..3e9df83c4df7 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -160,14 +160,14 @@ void SetSbUnoObjectDfltPropName( SbxObject* pObj ) } // save CoreReflection statically -Reference< XIdlReflection > getCoreReflection_Impl() +static Reference< XIdlReflection > getCoreReflection_Impl() { return css::reflection::theCoreReflection::get( comphelper::getProcessComponentContext()); } // save CoreReflection statically -Reference< XHierarchicalNameAccess > const & getCoreReflection_HierarchicalNameAccess_Impl() +static Reference< XHierarchicalNameAccess > const & getCoreReflection_HierarchicalNameAccess_Impl() { static Reference< XHierarchicalNameAccess > xCoreReflection_HierarchicalNameAccess; @@ -184,7 +184,7 @@ Reference< XHierarchicalNameAccess > const & getCoreReflection_HierarchicalNameA } // Hold TypeProvider statically -Reference< XHierarchicalNameAccess > const & getTypeProvider_Impl() +static Reference< XHierarchicalNameAccess > const & getTypeProvider_Impl() { static Reference< XHierarchicalNameAccess > xAccess; @@ -210,7 +210,7 @@ Reference< XHierarchicalNameAccess > const & getTypeProvider_Impl() } // Hold TypeConverter statically -Reference< XTypeConverter > const & getTypeConverter_Impl() +static Reference< XTypeConverter > const & getTypeConverter_Impl() { static Reference< XTypeConverter > xTypeConverter; @@ -287,7 +287,7 @@ namespace } } -void implAppendExceptionMsg( OUStringBuffer& _inout_rBuffer, const Exception& _e, const OUString& _rExceptionType, sal_Int32 _nLevel ) +static void implAppendExceptionMsg( OUStringBuffer& _inout_rBuffer, const Exception& _e, const OUString& _rExceptionType, sal_Int32 _nLevel ) { _inout_rBuffer.append( "\n" ); lcl_indent( _inout_rBuffer, _nLevel ); @@ -306,14 +306,14 @@ void implAppendExceptionMsg( OUStringBuffer& _inout_rBuffer, const Exception& _e } // construct an error message for the exception -OUString implGetExceptionMsg( const Exception& e, const OUString& aExceptionType_ ) +static OUString implGetExceptionMsg( const Exception& e, const OUString& aExceptionType_ ) { OUStringBuffer aMessageBuf; implAppendExceptionMsg( aMessageBuf, e, aExceptionType_, 0 ); return aMessageBuf.makeStringAndClear(); } -OUString implGetExceptionMsg( const Any& _rCaughtException ) +static OUString implGetExceptionMsg( const Any& _rCaughtException ) { auto e = o3tl::tryAccess<Exception>(_rCaughtException); OSL_PRECOND( e, "implGetExceptionMsg: illegal argument!" ); @@ -324,7 +324,7 @@ OUString implGetExceptionMsg( const Any& _rCaughtException ) return implGetExceptionMsg( *e, _rCaughtException.getValueTypeName() ); } -Any convertAny( const Any& rVal, const Type& aDestType ) +static Any convertAny( const Any& rVal, const Type& aDestType ) { Any aConvertedVal; Reference< XTypeConverter > xConverter = getTypeConverter_Impl(); @@ -352,25 +352,25 @@ Any convertAny( const Any& rVal, const Type& aDestType ) // TODO: source out later -Reference<XIdlClass> TypeToIdlClass( const Type& rType ) +static Reference<XIdlClass> TypeToIdlClass( const Type& rType ) { return getCoreReflection_Impl()->forName(rType.getTypeName()); } // Exception type unknown template< class EXCEPTION > -OUString implGetExceptionMsg( const EXCEPTION& e ) +static OUString implGetExceptionMsg( const EXCEPTION& e ) { return implGetExceptionMsg( e, cppu::UnoType<decltype(e)>::get().getTypeName() ); } -void implHandleBasicErrorException( BasicErrorException const & e ) +static void implHandleBasicErrorException( BasicErrorException const & e ) { ErrCode nError = StarBASIC::GetSfxFromVBError( static_cast<sal_uInt16>(e.ErrorCode) ); StarBASIC::Error( nError, e.ErrorMessageArgument ); } -void implHandleWrappedTargetException( const Any& _rWrappedTargetException ) +static void implHandleWrappedTargetException( const Any& _rWrappedTargetException ) { Any aExamine( _rWrappedTargetException ); @@ -477,7 +477,7 @@ static SbxObject* lcl_getNativeObject( sal_uInt32 nIndex ) } // convert from Uno to Sbx -SbxDataType unoToSbxType( TypeClass eType ) +static SbxDataType unoToSbxType( TypeClass eType ) { SbxDataType eRetType = SbxVOID; @@ -512,7 +512,7 @@ SbxDataType unoToSbxType( TypeClass eType ) return eRetType; } -SbxDataType unoToSbxType( const Reference< XIdlClass >& xIdlClass ) +static SbxDataType unoToSbxType( const Reference< XIdlClass >& xIdlClass ) { SbxDataType eRetType = SbxVOID; if( xIdlClass.is() ) @@ -812,7 +812,7 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue ) } // Deliver the reflection for Sbx types -Type getUnoTypeForSbxBaseType( SbxDataType eType ) +static Type getUnoTypeForSbxBaseType( SbxDataType eType ) { Type aRetType = cppu::UnoType<void>::get(); switch( eType ) @@ -848,7 +848,7 @@ Type getUnoTypeForSbxBaseType( SbxDataType eType ) } // Converting of Sbx to Uno without a know target class for TypeClass_ANY -Type getUnoTypeForSbxValue( const SbxValue* pVal ) +static Type getUnoTypeForSbxValue( const SbxValue* pVal ) { Type aRetType = cppu::UnoType<void>::get(); if( !pVal ) @@ -973,7 +973,7 @@ Type getUnoTypeForSbxValue( const SbxValue* pVal ) } // converting of Sbx to Uno without known target class for TypeClass_ANY -Any sbxToUnoValueImpl( const SbxValue* pVar, bool bBlockConversionToSmallestType = false ) +static Any sbxToUnoValueImpl( const SbxValue* pVar, bool bBlockConversionToSmallestType = false ) { SbxDataType eBaseType = pVar->SbxValue::GetType(); if( eBaseType == SbxOBJECT ) @@ -1449,7 +1449,7 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property const * pUn return aRetVal; } -void processAutomationParams( SbxArray* pParams, Sequence< Any >& args, sal_uInt32 nParamCount ) +static void processAutomationParams( SbxArray* pParams, Sequence< Any >& args, sal_uInt32 nParamCount ) { AutomationNamedArgsSbxArray* pArgNamesArray = dynamic_cast<AutomationNamedArgsSbxArray*>( pParams ); @@ -1498,7 +1498,7 @@ enum class INVOKETYPE GetProp = 0, Func }; -Any invokeAutomationMethod( const OUString& Name, Sequence< Any > const & args, SbxArray* pParams, sal_uInt32 nParamCount, Reference< XInvocation > const & rxInvocation, INVOKETYPE invokeType ) +static Any invokeAutomationMethod( const OUString& Name, Sequence< Any > const & args, SbxArray* pParams, sal_uInt32 nParamCount, Reference< XInvocation > const & rxInvocation, INVOKETYPE invokeType ) { Sequence< sal_Int16 > OutParamIndex; Sequence< Any > OutParam; @@ -1536,7 +1536,7 @@ Any invokeAutomationMethod( const OUString& Name, Sequence< Any > const & args, } // Debugging help method to readout the imlemented interfaces of an object -OUString Impl_GetInterfaceInfo( const Reference< XInterface >& x, const Reference< XIdlClass >& xClass, sal_uInt16 nRekLevel ) +static OUString Impl_GetInterfaceInfo( const Reference< XInterface >& x, const Reference< XIdlClass >& xClass, sal_uInt16 nRekLevel ) { Type aIfaceType = cppu::UnoType<XInterface>::get(); static Reference< XIdlClass > xIfaceClass = TypeToIdlClass( aIfaceType ); @@ -1572,7 +1572,7 @@ OUString Impl_GetInterfaceInfo( const Reference< XInterface >& x, const Referenc return aRetStr.makeStringAndClear(); } -OUString getDbgObjectNameImpl(SbUnoObject& rUnoObj) +static OUString getDbgObjectNameImpl(SbUnoObject& rUnoObj) { OUString aName = rUnoObj.GetClassName(); if( aName.isEmpty() ) @@ -1589,7 +1589,7 @@ OUString getDbgObjectNameImpl(SbUnoObject& rUnoObj) return aName; } -OUString getDbgObjectName(SbUnoObject& rUnoObj) +static OUString getDbgObjectName(SbUnoObject& rUnoObj) { OUString aName = getDbgObjectNameImpl(rUnoObj); if( aName.isEmpty() ) @@ -1711,7 +1711,7 @@ bool checkUnoObjectType(SbUnoObject& rUnoObj, const OUString& rClass) } // Debugging help method to readout the imlemented interfaces of an object -OUString Impl_GetSupportedInterfaces(SbUnoObject& rUnoObj) +static OUString Impl_GetSupportedInterfaces(SbUnoObject& rUnoObj) { Any aToInspectObj = rUnoObj.getUnoAny(); @@ -1762,7 +1762,7 @@ OUString Impl_GetSupportedInterfaces(SbUnoObject& rUnoObj) // Debugging help method SbxDataType -> String -OUString Dbg_SbxDataType2String( SbxDataType eType ) +static OUString Dbg_SbxDataType2String( SbxDataType eType ) { OUStringBuffer aRet; switch( +eType ) @@ -1806,7 +1806,7 @@ OUString Dbg_SbxDataType2String( SbxDataType eType ) } // Debugging help method to display the properties of a SbUnoObjects -OUString Impl_DumpProperties(SbUnoObject& rUnoObj) +static OUString Impl_DumpProperties(SbUnoObject& rUnoObj) { OUStringBuffer aRet; aRet.append("Properties of object "); @@ -1883,7 +1883,7 @@ OUString Impl_DumpProperties(SbUnoObject& rUnoObj) } // Debugging help method to display the methods of an SbUnoObjects -OUString Impl_DumpMethods(SbUnoObject& rUnoObj) +static OUString Impl_DumpMethods(SbUnoObject& rUnoObj) { OUStringBuffer aRet; aRet.append("Methods of object "); @@ -2826,7 +2826,7 @@ Any SbUnoObject::getUnoAny() } // help method to create an Uno-Struct per CoreReflection -SbUnoObject* Impl_CreateUnoStruct( const OUString& aClassName ) +static SbUnoObject* Impl_CreateUnoStruct( const OUString& aClassName ) { // get CoreReflection Reference< XIdlReflection > xCoreReflection = getCoreReflection_Impl(); @@ -3181,7 +3181,7 @@ void RTL_Impl_EqualUnoObjects( SbxArray& rPar ) // if it fails for whatever reason // returned Reference<> be null e.g. .is() will be false -Reference< XTypeDescriptionEnumeration > getTypeDescriptorEnumeration( const OUString& sSearchRoot, +static Reference< XTypeDescriptionEnumeration > getTypeDescriptorEnumeration( const OUString& sSearchRoot, const Sequence< TypeClass >& types, TypeDescriptionSearchDepth depth ) { @@ -3893,7 +3893,7 @@ private: // Function to replace AllListenerAdapterService::createAllListerAdapter -Reference< XInterface > createAllListenerAdapter +static Reference< XInterface > createAllListenerAdapter ( const Reference< XInvocationAdapterFactory2 >& xInvocationAdapterFactory, const Reference< XIdlClass >& xListenerType, diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 559c1649337f..c9663ef08bd0 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -395,7 +395,7 @@ uno::Reference< frame::XModel > getDocumentModel( StarBASIC* pb ) return xModel; } -uno::Reference< vba::XVBACompatibility > getVBACompatibility( const uno::Reference< frame::XModel >& rxModel ) +static uno::Reference< vba::XVBACompatibility > getVBACompatibility( const uno::Reference< frame::XModel >& rxModel ) { uno::Reference< vba::XVBACompatibility > xVBACompat; try @@ -409,7 +409,7 @@ uno::Reference< vba::XVBACompatibility > getVBACompatibility( const uno::Referen return xVBACompat; } -bool getDefaultVBAMode( StarBASIC* pb ) +static bool getDefaultVBAMode( StarBASIC* pb ) { uno::Reference< frame::XModel > xModel( getDocumentModel( pb ) ); if (!xModel.is()) @@ -929,7 +929,7 @@ static void SendHint( SbxObject* pObj, SfxHintId nId, SbMethod* p ) // #57841 Clear Uno-Objects, which were helt in RTL functions, // at the end of the program, so that nothing were helt. -void ClearUnoObjectsInRTL_Impl_Rek( StarBASIC* pBasic ) +static void ClearUnoObjectsInRTL_Impl_Rek( StarBASIC* pBasic ) { // delete the return value of CreateUnoService SbxVariable* pVar = pBasic->GetRtl()->Find( "CreateUnoService", SbxClassType::Method ); @@ -969,7 +969,7 @@ void ClearUnoObjectsInRTL_Impl_Rek( StarBASIC* pBasic ) } } -void ClearUnoObjectsInRTL_Impl( StarBASIC* pBasic ) +static void ClearUnoObjectsInRTL_Impl( StarBASIC* pBasic ) { // #67781 Delete return values of the Uno-methods clearUnoMethods(); diff --git a/basic/source/comp/parser.cxx b/basic/source/comp/parser.cxx index 553f9707a060..caca02573343 100644 --- a/basic/source/comp/parser.cxx +++ b/basic/source/comp/parser.cxx @@ -830,7 +830,7 @@ void SbiParser::Option() } } -void addStringConst( SbiSymPool& rPool, const OUString& pSym, const OUString& rStr ) +static void addStringConst( SbiSymPool& rPool, const OUString& pSym, const OUString& rStr ) { SbiConstDef* pConst = new SbiConstDef( pSym ); pConst->SetType( SbxSTRING ); diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index b9bdbec05748..629e3728980c 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -327,7 +327,7 @@ void SbRtl_Asc(StarBASIC *, SbxArray & rPar, bool) } } -void implChr( SbxArray& rPar, bool bChrW ) +static void implChr( SbxArray& rPar, bool bChrW ) { if ( rPar.Count() < 2 ) { @@ -631,7 +631,7 @@ void SbRtl_MkDir(StarBASIC * pBasic, SbxArray & rPar, bool bWrite) // In OSL only empty directories can be deleted // so we have to delete all files recursively -void implRemoveDirRecursive( const OUString& aDirPath ) +static void implRemoveDirRecursive( const OUString& aDirPath ) { DirectoryItem aItem; FileBase::RC nRet = DirectoryItem::get( aDirPath, aItem ); @@ -2521,7 +2521,7 @@ void SbRtl_IsMissing(StarBASIC *, SbxArray & rPar, bool) } // Function looks for wildcards, removes them and always returns the pure path -OUString implSetupWildcard( const OUString& rFileParam, SbiRTLData* pRTLData ) +static OUString implSetupWildcard( const OUString& rFileParam, SbiRTLData* pRTLData ) { static sal_Char cDelim1 = '/'; static sal_Char cDelim2 = '\\'; @@ -2587,7 +2587,7 @@ OUString implSetupWildcard( const OUString& rFileParam, SbiRTLData* pRTLData ) return aPathStr; } -inline bool implCheckWildcard( const OUString& rName, SbiRTLData const * pRTLData ) +static inline bool implCheckWildcard( const OUString& rName, SbiRTLData const * pRTLData ) { bool bMatch = true; @@ -2599,7 +2599,7 @@ inline bool implCheckWildcard( const OUString& rName, SbiRTLData const * pRTLDat } -bool isRootDir( const OUString& aDirURLStr ) +static bool isRootDir( const OUString& aDirURLStr ) { INetURLObject aDirURLObj( aDirURLStr ); bool bRoot = false; @@ -3725,7 +3725,7 @@ OUString getBasicTypeName( SbxDataType eType ) return OUString::createFromAscii(pTypeNames[nPos]); } -OUString getObjectTypeName( SbxVariable* pVar ) +static OUString getObjectTypeName( SbxVariable* pVar ) { OUString sRet( "Object" ); if ( pVar ) diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx index 7f5ab0233096..514c8e1e85b0 100644 --- a/basic/source/runtime/methods1.cxx +++ b/basic/source/runtime/methods1.cxx @@ -1127,7 +1127,7 @@ static bool lcl_WriteReadSbxArray( SbxDimArray& rArr, SvStream* pStrm, return true; } -void PutGet( SbxArray& rPar, bool bPut ) +static void PutGet( SbxArray& rPar, bool bPut ) { if ( rPar.Count() != 4 ) { @@ -1802,7 +1802,7 @@ struct IntervalInfo bool mbSimple; }; -IntervalInfo const * getIntervalInfo( const OUString& rStringCode ) +static IntervalInfo const * getIntervalInfo( const OUString& rStringCode ) { static IntervalInfo const aIntervalTable[] = { @@ -1828,7 +1828,7 @@ IntervalInfo const * getIntervalInfo( const OUString& rStringCode ) return nullptr; } -inline void implGetDayMonthYear( sal_Int16& rnYear, sal_Int16& rnMonth, sal_Int16& rnDay, double dDate ) +static inline void implGetDayMonthYear( sal_Int16& rnYear, sal_Int16& rnMonth, sal_Int16& rnDay, double dDate ) { rnDay = implGetDateDay( dDate ); rnMonth = implGetDateMonth( dDate ); @@ -1840,7 +1840,7 @@ inline void implGetDayMonthYear( sal_Int16& rnYear, sal_Int16& rnMonth, sal_Int1 @return the year number, truncated if necessary and in that case also rMonth and rDay adjusted. */ -inline sal_Int16 limitDate( sal_Int32 n32Year, sal_Int16& rMonth, sal_Int16& rDay ) +static inline sal_Int16 limitDate( sal_Int32 n32Year, sal_Int16& rMonth, sal_Int16& rDay ) { if( n32Year > SAL_MAX_INT16 ) { @@ -1957,7 +1957,7 @@ void SbRtl_DateAdd(StarBASIC *, SbxArray & rPar, bool) rPar.Get(0)->PutDate( dNewDate ); } -inline double RoundImpl( double d ) +static inline double RoundImpl( double d ) { return ( d >= 0 ) ? floor( d + 0.5 ) : -floor( -d + 0.5 ); } @@ -2087,7 +2087,7 @@ void SbRtl_DateDiff(StarBASIC *, SbxArray & rPar, bool) rPar.Get(0)->PutDouble( dRet ); } -double implGetDateOfFirstDayInFirstWeek +static double implGetDateOfFirstDayInFirstWeek ( sal_Int16 nYear, sal_Int16& nFirstDay, sal_Int16& nFirstWeek, bool* pbError = nullptr ) { ErrCode nError = ERRCODE_NONE; @@ -2438,7 +2438,7 @@ void SbRtl_Round(StarBASIC *, SbxArray & rPar, bool) rPar.Get(0)->PutDouble( dRes ); } -void CallFunctionAccessFunction( const Sequence< Any >& aArgs, const OUString& sFuncName, SbxVariable* pRet ) +static void CallFunctionAccessFunction( const Sequence< Any >& aArgs, const OUString& sFuncName, SbxVariable* pRet ) { static Reference< XFunctionAccess > xFunc; try diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index eb94a927be03..b8d16c79578e 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -1568,7 +1568,7 @@ void SbiRuntime::StepGET() } // #67607 copy Uno-Structs -inline bool checkUnoStructCopy( bool bVBA, SbxVariableRef const & refVal, SbxVariableRef const & refVar ) +static inline bool checkUnoStructCopy( bool bVBA, SbxVariableRef const & refVal, SbxVariableRef const & refVar ) { SbxDataType eVarType = refVar->GetType(); SbxDataType eValType = refVal->GetType(); @@ -2155,7 +2155,7 @@ void SbiRuntime::StepREDIM() // Helper function for StepREDIMP -void implCopyDimArray( SbxDimArray* pNewArray, SbxDimArray* pOldArray, short nMaxDimIndex, +static void implCopyDimArray( SbxDimArray* pNewArray, SbxDimArray* pOldArray, short nMaxDimIndex, short nActualDim, sal_Int32* pActualIndices, sal_Int32* pLowerBounds, sal_Int32* pUpperBounds ) { sal_Int32& ri = pActualIndices[nActualDim]; @@ -4282,7 +4282,7 @@ void SbiRuntime::StepDCREATE_REDIMP( sal_uInt32 nOp1, sal_uInt32 nOp2 ) // Helper function for StepDCREATE_IMPL / bRedimp = true -void implCopyDimArray_DCREATE( SbxDimArray* pNewArray, SbxDimArray* pOldArray, short nMaxDimIndex, +static void implCopyDimArray_DCREATE( SbxDimArray* pNewArray, SbxDimArray* pOldArray, short nMaxDimIndex, short nActualDim, sal_Int32* pActualIndices, sal_Int32* pLowerBounds, sal_Int32* pUpperBounds ) { sal_Int32& ri = pActualIndices[nActualDim]; diff --git a/basic/source/sbx/sbxform.cxx b/basic/source/sbx/sbxform.cxx index 6e61a9af0ae3..69d917ae3a1f 100644 --- a/basic/source/sbx/sbxform.cxx +++ b/basic/source/sbx/sbxform.cxx @@ -80,7 +80,7 @@ COMMENT: Visual-Basic treats the following (invalid) format-strings // be generated. That's a StarBasic 'extension'. -double get_number_of_digits( double dNumber ) +static double get_number_of_digits( double dNumber ) //double floor_log10_fabs( double dNumber ) { if( dNumber==0.0 ) diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx index 081d5b4735a5..97c52b174ed0 100644 --- a/basic/source/sbx/sbxscan.cxx +++ b/basic/source/sbx/sbxscan.cxx @@ -66,7 +66,7 @@ void ImpGetIntntlSep( sal_Unicode& rcDecimalSep, sal_Unicode& rcThousandSep, sal terminating NULL character to be part of the string and returns bool instead of pointer, if character is 0 returns false. */ -bool ImpStrChr( const sal_Unicode* p, sal_Unicode c ) +static bool ImpStrChr( const sal_Unicode* p, sal_Unicode c ) { if (!c) return false; diff --git a/basic/source/uno/dlgcont.cxx b/basic/source/uno/dlgcont.cxx index 8757f01df6a9..7165a99b4fc0 100644 --- a/basic/source/uno/dlgcont.cxx +++ b/basic/source/uno/dlgcont.cxx @@ -111,7 +111,7 @@ bool SfxDialogLibraryContainer::isLibraryElementValid(const Any& rElement) const return SfxDialogLibrary::containsValidDialog(rElement); } -bool writeOasis2OOoLibraryElement( +static bool writeOasis2OOoLibraryElement( const Reference< XInputStream >& xInput, const Reference< XOutputStream >& xOutput ) { Reference< XComponentContext > xContext( diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx index f72ad68c518e..520318c92e54 100644 --- a/basic/source/uno/scriptcont.cxx +++ b/basic/source/uno/scriptcont.cxx @@ -534,7 +534,7 @@ void SAL_CALL SfxScriptLibraryContainer::changeLibraryPassword( const OUString& } -void setStreamKey( const uno::Reference< io::XStream >& xStream, const OUString& aPass ) +static void setStreamKey( const uno::Reference< io::XStream >& xStream, const OUString& aPass ) { uno::Reference< embed::XEncryptionProtectedSource > xEncrStream( xStream, uno::UNO_QUERY ); if ( xEncrStream.is() ) diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx index 12148904f9fd..6e860ea257ac 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx @@ -400,7 +400,7 @@ const int codeSnippetSize = 24; // Note: The code snippet we build here must not create a stack frame, // otherwise the UNO exceptions stop working thanks to non-existing // unwinding info. -unsigned char * codeSnippet( unsigned char * code, +static unsigned char * codeSnippet( unsigned char * code, sal_Int32 nFunctionIndex, sal_Int32 nVtableOffset, bool bHasHiddenParam ) { diff --git a/bridges/source/jni_uno/jni_bridge.cxx b/bridges/source/jni_uno/jni_bridge.cxx index 7f38d3221420..6ff327a1eb06 100644 --- a/bridges/source/jni_uno/jni_bridge.cxx +++ b/bridges/source/jni_uno/jni_bridge.cxx @@ -422,7 +422,7 @@ using namespace ::jni_uno; extern "C" { -void java_env_dispose(uno_Environment * env) { +static void java_env_dispose(uno_Environment * env) { auto * envData = static_cast<jni_uno::JniUnoEnvironmentData *>(env->pContext); if (envData != nullptr) { @@ -456,7 +456,7 @@ void java_env_dispose(uno_Environment * env) { } } -void java_env_disposing(uno_Environment * env) { +static void java_env_disposing(uno_Environment * env) { java_env_dispose(env); delete static_cast<jni_uno::JniUnoEnvironmentData *>(env->pContext); } diff --git a/bridges/source/jni_uno/jni_data.cxx b/bridges/source/jni_uno/jni_data.cxx index ac86fd391e4f..ebe2ce48cc1d 100644 --- a/bridges/source/jni_uno/jni_data.cxx +++ b/bridges/source/jni_uno/jni_data.cxx @@ -31,7 +31,7 @@ namespace jni_uno { -inline std::unique_ptr<rtl_mem> seq_allocate( +static inline std::unique_ptr<rtl_mem> seq_allocate( sal_Int32 nElements, sal_Int32 nSize ) { std::unique_ptr< rtl_mem > seq( diff --git a/canvas/source/cairo/cairo_canvashelper_text.cxx b/canvas/source/cairo/cairo_canvashelper_text.cxx index b0d07f87cdbe..e7ce4131b251 100644 --- a/canvas/source/cairo/cairo_canvashelper_text.cxx +++ b/canvas/source/cairo/cairo_canvashelper_text.cxx @@ -165,7 +165,7 @@ namespace cairocanvas } }; - bool setupTextOutput( OutputDevice& rOutDev, + static bool setupTextOutput( OutputDevice& rOutDev, const rendering::XCanvas* pOwner, ::Point& o_rOutPos, const rendering::ViewState& viewState, diff --git a/canvas/source/tools/spriteredrawmanager.cxx b/canvas/source/tools/spriteredrawmanager.cxx index 08621b11700e..f24ef41caf53 100644 --- a/canvas/source/tools/spriteredrawmanager.cxx +++ b/canvas/source/tools/spriteredrawmanager.cxx @@ -301,7 +301,7 @@ namespace canvas } #if OSL_DEBUG_LEVEL > 0 - bool impIsEqualB2DRange(const basegfx::B2DRange& rRangeA, const basegfx::B2DRange& rRangeB, double fSmallValue) + static bool impIsEqualB2DRange(const basegfx::B2DRange& rRangeA, const basegfx::B2DRange& rRangeB, double fSmallValue) { return fabs(rRangeB.getMinX() - rRangeA.getMinX()) <= fSmallValue && fabs(rRangeB.getMinY() - rRangeA.getMinY()) <= fSmallValue @@ -309,7 +309,7 @@ namespace canvas && fabs(rRangeB.getMaxY() - rRangeA.getMaxY()) <= fSmallValue; } - bool impIsEqualB2DVector(const basegfx::B2DVector& rVecA, const basegfx::B2DVector& rVecB, double fSmallValue) + static bool impIsEqualB2DVector(const basegfx::B2DVector& rVecA, const basegfx::B2DVector& rVecB, double fSmallValue) { return fabs(rVecB.getX() - rVecA.getX()) <= fSmallValue && fabs(rVecB.getY() - rVecA.getY()) <= fSmallValue; diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index 787760578bc1..590cd377c937 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -181,7 +181,7 @@ private: }; -uno::Reference<drawing::XShape> +static uno::Reference<drawing::XShape> getShapeByName(const uno::Reference<drawing::XShapes>& rShapes, const OUString& rName, const std::function<bool(const uno::Reference<drawing::XShape>&)>& pCondition = nullptr) @@ -348,7 +348,7 @@ void Chart2ImportTest::testSteppedLines() } } -uno::Sequence < OUString > getChartColumnDescriptions( uno::Reference< chart::XChartDocument > const & xChart1Doc) +static uno::Sequence < OUString > getChartColumnDescriptions( uno::Reference< chart::XChartDocument > const & xChart1Doc) { CPPUNIT_ASSERT(xChart1Doc.is()); uno::Reference< chart::XChartDataArray > xChartData ( xChart1Doc->getData(), UNO_QUERY_THROW); diff --git a/chart2/source/controller/dialogs/res_Trendline.cxx b/chart2/source/controller/dialogs/res_Trendline.cxx index a28a9da7f311..f75ce892183e 100644 --- a/chart2/source/controller/dialogs/res_Trendline.cxx +++ b/chart2/source/controller/dialogs/res_Trendline.cxx @@ -32,7 +32,7 @@ namespace chart { -void lcl_setValue( FormattedField& rFmtField, double fValue ) +static void lcl_setValue( FormattedField& rFmtField, double fValue ) { rFmtField.SetValue( fValue ); rFmtField.SetDefaultValue( fValue ); diff --git a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx index ed1f69d808d2..5768c108a8c9 100644 --- a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx @@ -147,7 +147,7 @@ bool AxisItemConverter::GetItemProperty( tWhichIdType nWhichId, tPropertyNameWit return true; } -bool lcl_hasTimeIntervalValue( const uno::Any& rAny ) +static bool lcl_hasTimeIntervalValue( const uno::Any& rAny ) { bool bRet = false; TimeInterval aValue; @@ -439,19 +439,19 @@ void AxisItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutI } } -bool lcl_isDateAxis( const SfxItemSet & rItemSet ) +static bool lcl_isDateAxis( const SfxItemSet & rItemSet ) { sal_Int32 nAxisType = rItemSet.Get( SCHATTR_AXISTYPE ).GetValue();//css::chart2::AxisType return (nAxisType == chart2::AxisType::DATE); } -bool lcl_isAutoMajor( const SfxItemSet & rItemSet ) +static bool lcl_isAutoMajor( const SfxItemSet & rItemSet ) { bool bRet = rItemSet.Get( SCHATTR_AXIS_AUTO_STEP_MAIN ).GetValue(); return bRet; } -bool lcl_isAutoMinor( const SfxItemSet & rItemSet ) +static bool lcl_isAutoMinor( const SfxItemSet & rItemSet ) { bool bRet = rItemSet.Get( SCHATTR_AXIS_AUTO_STEP_HELP ).GetValue(); return bRet; diff --git a/chart2/source/controller/main/ChartController_Position.cxx b/chart2/source/controller/main/ChartController_Position.cxx index 31576ed554d9..37e832977dfb 100644 --- a/chart2/source/controller/main/ChartController_Position.cxx +++ b/chart2/source/controller/main/ChartController_Position.cxx @@ -45,7 +45,7 @@ namespace chart using namespace ::com::sun::star; using namespace ::com::sun::star::chart2; -void lcl_getPositionAndSizeFromItemSet( const SfxItemSet& rItemSet, awt::Rectangle& rPosAndSize, const awt::Size& rOriginalSize ) +static void lcl_getPositionAndSizeFromItemSet( const SfxItemSet& rItemSet, awt::Rectangle& rPosAndSize, const awt::Size& rOriginalSize ) { long nPosX(0); long nPosY(0); diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx index f7e4a415290a..5e307d7a409b 100644 --- a/chart2/source/controller/main/ChartController_Window.cxx +++ b/chart2/source/controller/main/ChartController_Window.cxx @@ -494,7 +494,7 @@ void ChartController::execute_Paint(vcl::RenderContext& rRenderContext, const to } } -bool isDoubleClick( const MouseEvent& rMEvt ) +static bool isDoubleClick( const MouseEvent& rMEvt ) { return rMEvt.GetClicks() == 2 && rMEvt.IsLeft() && !rMEvt.IsMod1() && !rMEvt.IsMod2() && !rMEvt.IsShift(); diff --git a/chart2/source/controller/main/DrawCommandDispatch.cxx b/chart2/source/controller/main/DrawCommandDispatch.cxx index dc6f6f16bf21..73bcc680ff1f 100644 --- a/chart2/source/controller/main/DrawCommandDispatch.cxx +++ b/chart2/source/controller/main/DrawCommandDispatch.cxx @@ -74,7 +74,7 @@ bool DrawCommandDispatch::isFeatureSupported( const OUString& rCommandURL ) return parseCommandURL( rCommandURL, &nFeatureId, &aBaseCommand, &aCustomShapeType ); } -::basegfx::B2DPolyPolygon getPolygon(const char* pResId, const SdrModel& rModel) +static ::basegfx::B2DPolyPolygon getPolygon(const char* pResId, const SdrModel& rModel) { ::basegfx::B2DPolyPolygon aReturn; XLineEndListRef pLineEndList = rModel.GetLineEndList(); diff --git a/chart2/source/controller/main/ElementSelector.cxx b/chart2/source/controller/main/ElementSelector.cxx index f10ae63f92af..3b9b861f1e27 100644 --- a/chart2/source/controller/main/ElementSelector.cxx +++ b/chart2/source/controller/main/ElementSelector.cxx @@ -56,7 +56,7 @@ SelectorListBox::SelectorListBox( vcl::Window* pParent, WinBits nStyle ) { } -void lcl_addObjectsToList( const ObjectHierarchy& rHierarchy, const ObjectIdentifier & rParent, std::vector< ListBoxEntryData >& rEntries +static void lcl_addObjectsToList( const ObjectHierarchy& rHierarchy, const ObjectIdentifier & rParent, std::vector< ListBoxEntryData >& rEntries , const sal_Int32 nHierarchyDepth, const Reference< chart2::XChartDocument >& xChartDoc ) { ObjectHierarchy::tChildContainer aChildren( rHierarchy.getChildren(rParent) ); diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx index 5c8c534fb496..faaf3c1a4fdd 100644 --- a/chart2/source/tools/DiagramHelper.cxx +++ b/chart2/source/tools/DiagramHelper.cxx @@ -926,7 +926,7 @@ Reference< data::XLabeledDataSequence > return xResult; } -void lcl_generateAutomaticCategoriesFromChartType( +static void lcl_generateAutomaticCategoriesFromChartType( Sequence< OUString >& rRet, const Reference< XChartType >& xChartType ) { @@ -1598,7 +1598,7 @@ DiagramPositioningMode DiagramHelper::getDiagramPositioningMode( const uno::Refe return eMode; } -void lcl_ensureRange0to1( double& rValue ) +static void lcl_ensureRange0to1( double& rValue ) { if(rValue<0.0) rValue=0.0; diff --git a/chart2/source/tools/ExplicitCategoriesProvider.cxx b/chart2/source/tools/ExplicitCategoriesProvider.cxx index ced3f5204b10..835f5243488e 100644 --- a/chart2/source/tools/ExplicitCategoriesProvider.cxx +++ b/chart2/source/tools/ExplicitCategoriesProvider.cxx @@ -152,7 +152,7 @@ sal_Int32 ExplicitCategoriesProvider::getCategoryLevelCount() const return nCount; } -std::vector<sal_Int32> lcl_getLimitingBorders( const std::vector< ComplexCategory >& rComplexCategories ) +static std::vector<sal_Int32> lcl_getLimitingBorders( const std::vector< ComplexCategory >& rComplexCategories ) { std::vector<sal_Int32> aLimitingBorders; sal_Int32 nBorderIndex = 0; /*border below the index*/ @@ -250,7 +250,7 @@ uno::Sequence< OUString > SplitCategoriesProvider_ForLabeledDataSequences::getSt return aRet; } -std::vector< ComplexCategory > lcl_DataSequenceToComplexCategoryVector( +static std::vector< ComplexCategory > lcl_DataSequenceToComplexCategoryVector( const uno::Sequence< OUString >& rStrings , const std::vector<sal_Int32>& rLimitingBorders, bool bCreateSingleCategories ) { @@ -290,7 +290,7 @@ std::vector< ComplexCategory > lcl_DataSequenceToComplexCategoryVector( return aResult; } -sal_Int32 lcl_getCategoryCount( std::vector< ComplexCategory >& rComplexCategories ) +static sal_Int32 lcl_getCategoryCount( std::vector< ComplexCategory >& rComplexCategories ) { sal_Int32 nCount = 0; for (auto const& complexCategory : rComplexCategories) @@ -298,7 +298,7 @@ sal_Int32 lcl_getCategoryCount( std::vector< ComplexCategory >& rComplexCategori return nCount; } -Sequence< OUString > lcl_getExplicitSimpleCategories( +static Sequence< OUString > lcl_getExplicitSimpleCategories( const SplitCategoriesProvider& rSplitCategoriesProvider, std::vector< std::vector< ComplexCategory > >& rComplexCats ) { @@ -383,7 +383,7 @@ Sequence< OUString > ExplicitCategoriesProvider::getExplicitSimpleCategories( return lcl_getExplicitSimpleCategories( rSplitCategoriesProvider, aComplexCats ); } -bool lcl_fillDateCategories( const uno::Reference< data::XDataSequence >& xDataSequence, std::vector< double >& rDateCategories, bool bIsAutoDate, ChartModel& rModel ) +static bool lcl_fillDateCategories( const uno::Reference< data::XDataSequence >& xDataSequence, std::vector< double >& rDateCategories, bool bIsAutoDate, ChartModel& rModel ) { bool bOnlyDatesFound = true; bool bAnyDataFound = false; diff --git a/chart2/source/view/axes/ScaleAutomatism.cxx b/chart2/source/view/axes/ScaleAutomatism.cxx index e6f2d4d0192f..5a72a875168b 100644 --- a/chart2/source/view/axes/ScaleAutomatism.cxx +++ b/chart2/source/view/axes/ScaleAutomatism.cxx @@ -40,7 +40,7 @@ using ::com::sun::star::chart::TimeUnit::YEAR; const sal_Int32 MAXIMUM_MANUAL_INCREMENT_COUNT = 500; const sal_Int32 MAXIMUM_SUB_INCREMENT_COUNT = 100; -sal_Int32 lcl_getMaximumAutoIncrementCount( sal_Int32 nAxisType ) +static sal_Int32 lcl_getMaximumAutoIncrementCount( sal_Int32 nAxisType ) { sal_Int32 nMaximumAutoIncrementCount = 10; if( nAxisType==AxisType::DATE ) diff --git a/chart2/source/view/axes/VAxisProperties.cxx b/chart2/source/view/axes/VAxisProperties.cxx index c2385db62631..fd16b851412b 100644 --- a/chart2/source/view/axes/VAxisProperties.cxx +++ b/chart2/source/view/axes/VAxisProperties.cxx @@ -43,7 +43,7 @@ AxisLabelAlignment::AxisLabelAlignment() : mfInnerTickDirection(1.0), meAlignment(LABEL_ALIGN_RIGHT_TOP) {} -sal_Int32 lcl_calcTickLengthForDepth(sal_Int32 nDepth,sal_Int32 nTickmarkStyle) +static sal_Int32 lcl_calcTickLengthForDepth(sal_Int32 nDepth,sal_Int32 nTickmarkStyle) { sal_Int32 const nWidth = AXIS2D_TICKLENGTH; //@maybefuturetodo this length could be offered by the model double fPercent = 1.0; @@ -67,7 +67,7 @@ sal_Int32 lcl_calcTickLengthForDepth(sal_Int32 nDepth,sal_Int32 nTickmarkStyle) return static_cast<sal_Int32>(nWidth*fPercent); } -double lcl_getTickOffset(sal_Int32 nLength,sal_Int32 nTickmarkStyle) +static double lcl_getTickOffset(sal_Int32 nLength,sal_Int32 nTickmarkStyle) { double fPercent = 0.0; //0<=fPercent<=1 //0.0: completely inner @@ -180,7 +180,7 @@ AxisProperties::AxisProperties( const uno::Reference< XAxis >& xAxisModel { } -LabelAlignment lcl_getLabelAlignmentForZAxis( const AxisProperties& rAxisProperties ) +static LabelAlignment lcl_getLabelAlignmentForZAxis( const AxisProperties& rAxisProperties ) { LabelAlignment aRet( LABEL_ALIGN_RIGHT ); if (rAxisProperties.maLabelAlignment.mfLabelDirection < 0) @@ -188,7 +188,7 @@ LabelAlignment lcl_getLabelAlignmentForZAxis( const AxisProperties& rAxisPropert return aRet; } -LabelAlignment lcl_getLabelAlignmentForYAxis( const AxisProperties& rAxisProperties ) +static LabelAlignment lcl_getLabelAlignmentForYAxis( const AxisProperties& rAxisProperties ) { LabelAlignment aRet( LABEL_ALIGN_RIGHT ); if (rAxisProperties.maLabelAlignment.mfLabelDirection < 0) @@ -196,7 +196,7 @@ LabelAlignment lcl_getLabelAlignmentForYAxis( const AxisProperties& rAxisPropert return aRet; } -LabelAlignment lcl_getLabelAlignmentForXAxis( const AxisProperties& rAxisProperties ) +static LabelAlignment lcl_getLabelAlignmentForXAxis( const AxisProperties& rAxisProperties ) { LabelAlignment aRet( LABEL_ALIGN_BOTTOM ); if (rAxisProperties.maLabelAlignment.mfLabelDirection < 0) diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx index a047f7239b59..c6f59216593e 100644 --- a/chart2/source/view/axes/VCartesianAxis.cxx +++ b/chart2/source/view/axes/VCartesianAxis.cxx @@ -76,7 +76,7 @@ VCartesianAxis::~VCartesianAxis() m_pPosHelper = nullptr; } -void lcl_ResizeTextShapeToFitAvailableSpace( Reference< drawing::XShape > const & xShape2DText, +static void lcl_ResizeTextShapeToFitAvailableSpace( Reference< drawing::XShape > const & xShape2DText, const AxisLabelProperties& rAxisLabelProperties, const OUString& rLabel, const tNameSequence& rPropNames, @@ -123,7 +123,7 @@ void lcl_ResizeTextShapeToFitAvailableSpace( Reference< drawing::XShape > const } } -Reference< drawing::XShape > createSingleLabel( +static Reference< drawing::XShape > createSingleLabel( const Reference< lang::XMultiServiceFactory>& xShapeFactory , const Reference< drawing::XShapes >& xTarget , const awt::Point& rAnchorScreenPosition2D @@ -154,7 +154,7 @@ Reference< drawing::XShape > createSingleLabel( return xShape2DText; } -bool lcl_doesShapeOverlapWithTickmark( const Reference< drawing::XShape >& xShape +static bool lcl_doesShapeOverlapWithTickmark( const Reference< drawing::XShape >& xShape , double fRotationAngleDegree , const basegfx::B2DVector& rTickScreenPosition ) { @@ -169,7 +169,7 @@ bool lcl_doesShapeOverlapWithTickmark( const Reference< drawing::XShape >& xShap return aShapeRect.isInside(aPosition); } -void lcl_getRotatedPolygon( B2DPolygon &aPoly, const ::basegfx::B2DRectangle &aRect, const awt::Point &aPos, const double fRotationAngleDegree ) +static void lcl_getRotatedPolygon( B2DPolygon &aPoly, const ::basegfx::B2DRectangle &aRect, const awt::Point &aPos, const double fRotationAngleDegree ) { aPoly = basegfx::utils::createPolygonFromRect( aRect ); @@ -189,7 +189,7 @@ void lcl_getRotatedPolygon( B2DPolygon &aPoly, const ::basegfx::B2DRectangle &aR aPoly.transform( aMatrix ); } -bool doesOverlap( const Reference< drawing::XShape >& xShape1 +static bool doesOverlap( const Reference< drawing::XShape >& xShape1 , const Reference< drawing::XShape >& xShape2 , double fRotationAngleDegree ) { @@ -212,7 +212,7 @@ bool doesOverlap( const Reference< drawing::XShape >& xShape1 return (overlapPoly.count() > 0); } -void removeShapesAtWrongRhythm( TickIter& rIter +static void removeShapesAtWrongRhythm( TickIter& rIter , sal_Int32 nCorrectRhythm , sal_Int32 nMaxTickToCheck , const Reference< drawing::XShapes >& xTarget ) @@ -309,7 +309,7 @@ TickInfo* LabelIterator::nextInfo() return pTickInfo; } -B2DVector lcl_getLabelsDistance( TickIter& rIter, const B2DVector& rDistanceTickToText, double fRotationAngleDegree ) +static B2DVector lcl_getLabelsDistance( TickIter& rIter, const B2DVector& rDistanceTickToText, double fRotationAngleDegree ) { //calculates the height or width of a line of labels //thus a following line of labels can be shifted for that distance @@ -349,7 +349,7 @@ B2DVector lcl_getLabelsDistance( TickIter& rIter, const B2DVector& rDistanceTick return aRet; } -void lcl_shiftLabels( TickIter& rIter, const B2DVector& rStaggerDistance ) +static void lcl_shiftLabels( TickIter& rIter, const B2DVector& rStaggerDistance ) { if(rStaggerDistance.getLength()==0.0) return; @@ -369,7 +369,7 @@ void lcl_shiftLabels( TickIter& rIter, const B2DVector& rStaggerDistance ) } } -bool lcl_hasWordBreak( const Reference<drawing::XShape>& xShape ) +static bool lcl_hasWordBreak( const Reference<drawing::XShape>& xShape ) { if (!xShape.is()) return false; @@ -411,7 +411,7 @@ bool lcl_hasWordBreak( const Reference<drawing::XShape>& xShape ) return false; } -OUString getTextLabelString( +static OUString getTextLabelString( const FixedNumberFormatter& rFixedNumberFormatter, const uno::Sequence<OUString>* pCategories, const TickInfo* pTickInfo, bool bComplexCat, Color& rExtraColor, bool& rHasExtraColor ) { @@ -435,7 +435,7 @@ OUString getTextLabelString( return rFixedNumberFormatter.getFormattedString(pTickInfo->getUnscaledTickValue(), rExtraColor, rHasExtraColor); } -void getAxisLabelProperties( +static void getAxisLabelProperties( tNameSequence& rPropNames, tAnySequence& rPropValues, const AxisProperties& rAxisProp, const AxisLabelProperties& rAxisLabelProp, sal_Int32 nLimitedSpaceForText, bool bLimitedHeight ) @@ -1475,7 +1475,7 @@ TickFactory2D* VCartesianAxis::createTickFactory2D() return new TickFactory2D( m_aScale, m_aIncrement, aStart, aEnd, aLabelLineStart-aStart ); } -void lcl_hideIdenticalScreenValues( TickIter& rTickIter ) +static void lcl_hideIdenticalScreenValues( TickIter& rTickIter ) { TickInfo* pPrevTickInfo = rTickIter.firstInfo(); if (!pPrevTickInfo) diff --git a/chart2/source/view/axes/VCartesianGrid.cxx b/chart2/source/view/axes/VCartesianGrid.cxx index a9df579ac353..df74eeeaf05d 100644 --- a/chart2/source/view/axes/VCartesianGrid.cxx +++ b/chart2/source/view/axes/VCartesianGrid.cxx @@ -135,7 +135,7 @@ void GridLinePoints::update( double fScaledTickValue ) P0[m_nDimensionIndex] = P1[m_nDimensionIndex] = P2[m_nDimensionIndex] = fScaledTickValue; } -void addLine2D( drawing::PointSequenceSequence& rPoints, sal_Int32 nIndex +static void addLine2D( drawing::PointSequenceSequence& rPoints, sal_Int32 nIndex , const GridLinePoints& rScaledLogicPoints , const Reference< XTransformation > & xTransformation ) @@ -150,7 +150,7 @@ void addLine2D( drawing::PointSequenceSequence& rPoints, sal_Int32 nIndex rPoints[nIndex][1].Y = static_cast<sal_Int32>(aPB.PositionY); } -void addLine3D( drawing::PolyPolygonShape3D& rPoints, sal_Int32 nIndex +static void addLine3D( drawing::PolyPolygonShape3D& rPoints, sal_Int32 nIndex , const GridLinePoints& rBasePoints , const Reference< XTransformation > & xTransformation ) { diff --git a/chart2/source/view/charttypes/AreaChart.cxx b/chart2/source/view/charttypes/AreaChart.cxx index 58acc66a749c..005d7c4afba8 100644 --- a/chart2/source/view/charttypes/AreaChart.cxx +++ b/chart2/source/view/charttypes/AreaChart.cxx @@ -162,7 +162,7 @@ void AreaChart::addSeries( std::unique_ptr<VDataSeries> pSeries, sal_Int32 zSlot VSeriesPlotter::addSeries( std::move(pSeries), zSlot, xSlot, ySlot ); } -void lcl_removeDuplicatePoints( drawing::PolyPolygonShape3D& rPolyPoly, PlottingPositionHelper& rPosHelper ) +static void lcl_removeDuplicatePoints( drawing::PolyPolygonShape3D& rPolyPoly, PlottingPositionHelper& rPosHelper ) { sal_Int32 nPolyCount = rPolyPoly.SequenceX.getLength(); if(!nPolyCount) diff --git a/chart2/source/view/charttypes/BarChart.cxx b/chart2/source/view/charttypes/BarChart.cxx index 3d9aae4bf942..f265f27171fe 100644 --- a/chart2/source/view/charttypes/BarChart.cxx +++ b/chart2/source/view/charttypes/BarChart.cxx @@ -432,7 +432,7 @@ void BarChart::adaptOverlapAndGapwidthForGroupBarsPerAxis() } } -E3dScene* lcl_getE3dScene(uno::Reference<uno::XInterface> const & xInterface) +static E3dScene* lcl_getE3dScene(uno::Reference<uno::XInterface> const & xInterface) { E3dScene* pScene = nullptr; diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx index 4b4602af7589..8eab6c1694b1 100644 --- a/chart2/source/view/charttypes/VSeriesPlotter.cxx +++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx @@ -1273,7 +1273,7 @@ void VSeriesPlotter::createRegressionCurvesShapes( VDataSeries const & rVDataSer } } -sal_Int32 lcl_getOUStringMaxLineLength ( OUStringBuffer const & aString ) +static sal_Int32 lcl_getOUStringMaxLineLength ( OUStringBuffer const & aString ) { const sal_Int32 nStringLength = aString.getLength(); sal_Int32 nMaxLineLength = 0; diff --git a/chart2/source/view/diagram/VDiagram.cxx b/chart2/source/view/diagram/VDiagram.cxx index 29a33b248a46..2a72cfbd57dd 100644 --- a/chart2/source/view/diagram/VDiagram.cxx +++ b/chart2/source/view/diagram/VDiagram.cxx @@ -206,7 +206,7 @@ void VDiagram::createShapes_2d() adjustPosAndSize_2d( m_aAvailablePosIncludingAxes, m_aAvailableSizeIncludingAxes ); } -E3dScene* lcl_getE3dScene( const uno::Reference< drawing::XShape >& xShape ) +static E3dScene* lcl_getE3dScene( const uno::Reference< drawing::XShape >& xShape ) { E3dScene* pRet=nullptr; uno::Reference< lang::XUnoTunnel > xUnoTunnel( xShape, uno::UNO_QUERY ); @@ -223,7 +223,7 @@ E3dScene* lcl_getE3dScene( const uno::Reference< drawing::XShape >& xShape ) return pRet; } -void lcl_setLightSources( +static void lcl_setLightSources( const uno::Reference< beans::XPropertySet > & xSource, const uno::Reference< beans::XPropertySet > & xDest ) { diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx index f53fd6b39549..50a619dce5f4 100644 --- a/chart2/source/view/main/ChartView.cxx +++ b/chart2/source/view/main/ChartView.cxx @@ -1280,7 +1280,7 @@ css::uno::Sequence< OUString > SAL_CALL ChartView::getSupportedServiceNames() return { CHART_VIEW_SERVICE_NAME }; } -::basegfx::B3DHomMatrix createTransformationSceneToScreen( +static ::basegfx::B3DHomMatrix createTransformationSceneToScreen( const ::basegfx::B2IRectangle& rDiagramRectangleWithoutAxes ) { ::basegfx::B3DHomMatrix aM; diff --git a/chart2/source/view/main/LabelPositionHelper.cxx b/chart2/source/view/main/LabelPositionHelper.cxx index 377acbff4966..9b36d1435cf3 100644 --- a/chart2/source/view/main/LabelPositionHelper.cxx +++ b/chart2/source/view/main/LabelPositionHelper.cxx @@ -80,7 +80,7 @@ void LabelPositionHelper::changeTextAdjustment( tAnySequence& rPropValues, const } } -void lcl_doDynamicFontResize( uno::Any* pAOldAndNewFontHeightAny +static void lcl_doDynamicFontResize( uno::Any* pAOldAndNewFontHeightAny , const awt::Size& rOldReferenceSize , const awt::Size& rNewReferenceSize ) { diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx index c545cc99ebf3..e9a9e6d5df11 100644 --- a/chart2/source/view/main/ShapeFactory.cxx +++ b/chart2/source/view/main/ShapeFactory.cxx @@ -111,7 +111,7 @@ void ShapeFactory::setPageSize(const uno::Reference<drawing::XShapes>&, const aw // diverse tools::PolyPolygon create methods -uno::Any createPolyPolygon_Cube( +static uno::Any createPolyPolygon_Cube( const drawing::Direction3D& rSize, double fRoundedEdge, bool bRounded ) { OSL_PRECOND(fRoundedEdge>=0, "fRoundedEdge needs to be >= 0"); @@ -200,7 +200,7 @@ uno::Any createPolyPolygon_Cube( return uno::Any( &aPP, cppu::UnoType<drawing::PolyPolygonShape3D>::get()); } -uno::Any createPolyPolygon_Cylinder( +static uno::Any createPolyPolygon_Cylinder( double fHeight , double fRadius , sal_Int32& nVerticalSegmentCount ) @@ -282,7 +282,7 @@ uno::Any createPolyPolygon_Cylinder( return uno::Any( &aPP, cppu::UnoType<drawing::PolyPolygonShape3D>::get()); } -uno::Any createPolyPolygon_Cone( double fHeight, double fRadius, double fTopHeight +static uno::Any createPolyPolygon_Cone( double fHeight, double fRadius, double fTopHeight , sal_Int32& nVerticalSegmentCount ) { OSL_PRECOND(fRadius>0, "The radius of a cone needs to be > 0"); @@ -706,7 +706,7 @@ uno::Reference<drawing::XShape> return xShape; } -void appendAndCloseBezierCoords( drawing::PolyPolygonBezierCoords& rReturn, const drawing::PolyPolygonBezierCoords& rAdd, bool bAppendInverse ) +static void appendAndCloseBezierCoords( drawing::PolyPolygonBezierCoords& rReturn, const drawing::PolyPolygonBezierCoords& rAdd, bool bAppendInverse ) { if(!rAdd.Coordinates.getLength()) return; @@ -731,7 +731,7 @@ void appendAndCloseBezierCoords( drawing::PolyPolygonBezierCoords& rReturn, cons rReturn.Flags[0][nOldCount+nAddCount] = rReturn.Flags[0][0]; } -drawing::PolyPolygonBezierCoords getCircularArcBezierCoords( +static drawing::PolyPolygonBezierCoords getCircularArcBezierCoords( double fStartAngleRadian, double fWidthAngleRadian, double fUnitRadius , const ::basegfx::B2DHomMatrix& rTransformationFromUnitCircle , const double fAngleSubdivisionRadian ) @@ -842,7 +842,7 @@ drawing::PolyPolygonBezierCoords getCircularArcBezierCoords( return aReturn; } -drawing::PolyPolygonBezierCoords getRingBezierCoords( +static drawing::PolyPolygonBezierCoords getRingBezierCoords( double fUnitCircleInnerRadius , double fUnitCircleOuterRadius , double fStartAngleRadian, double fWidthAngleRadian @@ -1156,7 +1156,7 @@ uno::Reference< drawing::XShape > return xShape; } -drawing::PolyPolygonShape3D createPolyPolygon_Symbol( const drawing::Position3D& rPos +static drawing::PolyPolygonShape3D createPolyPolygon_Symbol( const drawing::Position3D& rPos , const drawing::Direction3D& rSize , sal_Int32 nStandardSymbol ) { diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx index 34532c8a824f..20d7ab778ee9 100644 --- a/chart2/source/view/main/VDataSeries.cxx +++ b/chart2/source/view/main/VDataSeries.cxx @@ -766,7 +766,7 @@ double VDataSeries::getYMeanValue() const return m_fYMeanValue; } -std::unique_ptr<Symbol> getSymbolPropertiesFromPropertySet( const uno::Reference< beans::XPropertySet >& xProp ) +static std::unique_ptr<Symbol> getSymbolPropertiesFromPropertySet( const uno::Reference< beans::XPropertySet >& xProp ) { std::unique_ptr< Symbol > apSymbolProps( new Symbol() ); try @@ -912,7 +912,7 @@ uno::Reference<beans::XPropertySet> VDataSeries::getPropertiesOfSeries() const return uno::Reference<css::beans::XPropertySet>(m_xDataSeries, css::uno::UNO_QUERY); } -std::unique_ptr<DataPointLabel> getDataPointLabelFromPropertySet( const uno::Reference< beans::XPropertySet >& xProp ) +static std::unique_ptr<DataPointLabel> getDataPointLabelFromPropertySet( const uno::Reference< beans::XPropertySet >& xProp ) { std::unique_ptr< DataPointLabel > apLabel( new DataPointLabel() ); try diff --git a/codemaker/source/codemaker/global.cxx b/codemaker/source/codemaker/global.cxx index daf031d7728d..8eb506e10e51 100644 --- a/codemaker/source/codemaker/global.cxx +++ b/codemaker/source/codemaker/global.cxx @@ -156,7 +156,7 @@ bool fileExists(const OString& fileName) return false; } -bool checkFileContent(const OString& targetFileName, const OString& tmpFileName) +static bool checkFileContent(const OString& targetFileName, const OString& tmpFileName) { FILE *target = fopen(targetFileName.getStr(), "r"); FILE *tmp = fopen(tmpFileName.getStr(), "r"); diff --git a/comphelper/source/misc/base64.cxx b/comphelper/source/misc/base64.cxx index 4e3a6bc6ef00..8fd02f120f8f 100644 --- a/comphelper/source/misc/base64.cxx +++ b/comphelper/source/misc/base64.cxx @@ -60,7 +60,7 @@ const // p q r s t u v w x y z -void ThreeByteToFourByte(const sal_Int8* pBuffer, const sal_Int32 nStart, const sal_Int32 nFullLen, sal_Char* aCharBuffer) +static void ThreeByteToFourByte(const sal_Int8* pBuffer, const sal_Int32 nStart, const sal_Int32 nFullLen, sal_Char* aCharBuffer) { sal_Int32 nLen(nFullLen - nStart); if (nLen > 3) diff --git a/comphelper/source/misc/mimeconfighelper.cxx b/comphelper/source/misc/mimeconfighelper.cxx index c027bc1ff00f..8a4b002f7d77 100644 --- a/comphelper/source/misc/mimeconfighelper.cxx +++ b/comphelper/source/misc/mimeconfighelper.cxx @@ -66,7 +66,7 @@ OUString MimeConfigurationHelper::GetStringClassIDRepresentation( const uno::Seq } -sal_uInt8 GetDigit_Impl( sal_Char aChar ) +static sal_uInt8 GetDigit_Impl( sal_Char aChar ) { if ( aChar >= '0' && aChar <= '9' ) return aChar - '0'; diff --git a/comphelper/source/misc/syntaxhighlight.cxx b/comphelper/source/misc/syntaxhighlight.cxx index 76c8dfa862d3..3fb5bc057094 100644 --- a/comphelper/source/misc/syntaxhighlight.cxx +++ b/comphelper/source/misc/syntaxhighlight.cxx @@ -246,11 +246,14 @@ static const char* strListSqlKeyWords[] = { }; -extern "C" int compare_strings( const void *arg1, const void *arg2 ) +extern "C" { + +static int compare_strings( const void *arg1, const void *arg2 ) { return strcmp( static_cast<char const *>(arg1), *static_cast<char * const *>(arg2) ); } +} namespace { diff --git a/comphelper/source/processfactory/processfactory.cxx b/comphelper/source/processfactory/processfactory.cxx index 211067a5e75f..f3654a243ca9 100644 --- a/comphelper/source/processfactory/processfactory.cxx +++ b/comphelper/source/processfactory/processfactory.cxx @@ -36,7 +36,7 @@ namespace comphelper This function preserves only that the xProcessFactory variable will not be create when the library is loaded. */ -Reference< XMultiServiceFactory > localProcessFactory( const Reference< XMultiServiceFactory >& xSMgr, bool bSet ) +static Reference< XMultiServiceFactory > localProcessFactory( const Reference< XMultiServiceFactory >& xSMgr, bool bSet ) { Guard< Mutex > aGuard( Mutex::getGlobalMutex() ); diff --git a/comphelper/source/streaming/seekableinput.cxx b/comphelper/source/streaming/seekableinput.cxx index d7f107eae72d..89d887ea3548 100644 --- a/comphelper/source/streaming/seekableinput.cxx +++ b/comphelper/source/streaming/seekableinput.cxx @@ -35,7 +35,7 @@ namespace comphelper const sal_Int32 nConstBufferSize = 32000; -void copyInputToOutput_Impl( const uno::Reference< io::XInputStream >& xIn, +static void copyInputToOutput_Impl( const uno::Reference< io::XInputStream >& xIn, const uno::Reference< io::XOutputStream >& xOut ) { sal_Int32 nRead; diff --git a/compilerplugins/clang/external.cxx b/compilerplugins/clang/external.cxx new file mode 100644 index 000000000000..bb4bcbf36d08 --- /dev/null +++ b/compilerplugins/clang/external.cxx @@ -0,0 +1,323 @@ +/* -*- 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 <algorithm> +#include <cassert> + +#include "clang/Sema/SemaDiagnostic.h" + +#include "check.hxx" +#include "plugin.hxx" + +namespace +{ +// It appears that, given a function declaration, there is no way to determine +// the language linkage of the function's type, only of the function's name +// (via FunctionDecl::isExternC); however, in a case like +// +// extern "C" { static void f(); } +// +// the function's name does not have C language linkage while the function's +// type does (as clarified in C++11 [decl.link]); cf. <http://clang-developers. +// 42468.n3.nabble.com/Language-linkage-of-function-type-tt4037248.html> +// "Language linkage of function type": +bool hasCLanguageLinkageType(FunctionDecl const* decl) +{ + assert(decl != nullptr); + if (decl->isExternC()) + { + return true; + } + if (decl->isInExternCContext()) + { + return true; + } + return false; +} + +bool derivesFromTestFixture(CXXRecordDecl const* decl) +{ + static auto const pred = [](CXXBaseSpecifier const& spec) { + if (auto const t = spec.getType()->getAs<RecordType>()) + { // (may be a template parameter) + return derivesFromTestFixture(dyn_cast<CXXRecordDecl>(t->getDecl())); + } + return false; + }; + return loplugin::DeclCheck(decl).Class("TestFixture").Namespace("CppUnit").GlobalNamespace() + || std::any_of(decl->bases_begin(), decl->bases_end(), pred) + || std::any_of(decl->vbases_begin(), decl->vbases_end(), pred); +} + +class External : public loplugin::FilteringPlugin<External> +{ +public: + explicit External(loplugin::InstantiationData const& data) + : FilteringPlugin(data) + { + } + + void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } + + bool VisitTagDecl(TagDecl const* decl) + { + /*TODO:*/ + return true; // in general, moving classes or enumerations into an unnamed namespace can break ADL + if (isa<ClassTemplateSpecializationDecl>(decl)) + { + return true; + } + if (!decl->isThisDeclarationADefinition()) + { + return true; + } + if (isa<CXXRecordDecl>(decl->getDeclContext())) + { + return true; + } + if (!compiler.getLangOpts().CPlusPlus) + { + return true; + } + if (auto const d = dyn_cast<CXXRecordDecl>(decl)) + { + if (d->getDescribedClassTemplate() != nullptr) + { + return true; + } + if (auto const attr = d->getAttr<VisibilityAttr>()) + { + if (attr->getVisibility() == VisibilityAttr::Default) + { + // If the class definition has explicit default visibility, then assume that it + // needs to be present (e.g., a backwards-compatibility stub like in + // cppuhelper/source/compat.cxx): + return true; + } + } + if (derivesFromTestFixture(d)) + { + // The names of CppUnit tests (that can be specified with CPPUNIT_TEST_NAME) are + // tied to the fully-qualified names of classes derived from CppUnit::TestFixture, + // so avoid unnamed namespaces in those classes' names: + return true; + } + } + return handleDeclaration(decl); + } + + bool VisitFunctionDecl(FunctionDecl const* decl) + { + if (isa<CXXMethodDecl>(decl)) + { + return true; + } + if (decl->getTemplatedKind() != FunctionDecl::TK_NonTemplate) + { + return true; + } + if (!decl->isThisDeclarationADefinition()) + { + return true; + } + if (decl->isMain()) + { + return true; + } + if (auto const attr = decl->getAttr<VisibilityAttr>()) + { + if (attr->getVisibility() == VisibilityAttr::Default) + { + // If the function definition has explicit default visibility, then assume that it + // needs to be present (e.g., only called via dlopen, or a backwards-compatibility + // stub like in sal/osl/all/compat.cxx): + return true; + } + } + auto const canon = decl->getCanonicalDecl(); + if (hasCLanguageLinkageType(canon) + && (canon->hasAttr<ConstructorAttr>() || canon->hasAttr<DestructorAttr>())) + { + return true; + } + if (compiler.getDiagnostics().getDiagnosticLevel(diag::warn_unused_function, + decl->getLocation()) + < DiagnosticsEngine::Warning) + { + // Don't warn about e.g. + // + // G_DEFINE_TYPE (GLOAction, g_lo_action, G_TYPE_OBJECT); + // + // in vcl/unx/gtk/gloactiongroup.cxx (which expands to non-static g_lo_action_get_type + // function definition), which is already wrapped in + // + // #pragma GCC diagnostic ignored "-Wunused-function" + return true; + } + return handleDeclaration(decl); + } + + bool VisitVarDecl(VarDecl const* decl) + { + if (decl->isStaticDataMember()) + { + return true; + } + if (isa<VarTemplateSpecializationDecl>(decl)) + { + return true; + } + if (!decl->isThisDeclarationADefinition()) + { + return true; + } + return handleDeclaration(decl); + } + + bool VisitClassTemplateDecl(ClassTemplateDecl const* decl) + { + /*TODO:*/ + return true; // in general, moving classes or enumerations into an unnamed namespace can break ADL + if (!decl->isThisDeclarationADefinition()) + { + return true; + } + if (isa<CXXRecordDecl>(decl->getDeclContext())) + { + return true; + } + return handleDeclaration(decl); + } + + bool VisitFunctionTemplateDecl(FunctionTemplateDecl const* decl) + { + if (!decl->isThisDeclarationADefinition()) + { + return true; + } + if (isa<CXXRecordDecl>(decl->getDeclContext())) + { + return true; + } + return handleDeclaration(decl); + } + + bool VisitVarTemplateDecl(VarTemplateDecl const* decl) + { + if (!decl->isThisDeclarationADefinition()) + { + return true; + } + return handleDeclaration(decl); + } + +private: + template <typename T> void reportSpecializations(T specializations) + { + for (auto const d : specializations) + { + auto const k = d->getTemplateSpecializationKind(); + if (isTemplateExplicitInstantiationOrSpecialization(k)) + { + report(DiagnosticsEngine::Note, + "explicit %select{instantiation|specialization}0 is here", d->getLocation()) + << (k == TSK_ExplicitSpecialization) << d->getSourceRange(); + } + } + } + + bool handleDeclaration(NamedDecl const* decl) + { + if (ignoreLocation(decl)) + { + return true; + } + if (decl->getLinkageInternal() < +#if CLANG_VERSION >= 40000 + ModuleLinkage +#else + ExternalLinkage +#endif + ) + { + return true; + } + //TODO: in some cases getLinkageInternal() appears to report ExternalLinkage instead of + // UniqueExternalLinkage: + if (decl->isInAnonymousNamespace()) + { + return true; + } + for (Decl const* d = decl; d != nullptr; d = d->getPreviousDecl()) + { + if (!compiler.getSourceManager().isInMainFile(d->getLocation())) + { + return true; + } + } + if (compiler.getSourceManager().isMacroBodyExpansion(decl->getLocation()) + && (Lexer::getImmediateMacroName(decl->getLocation(), compiler.getSourceManager(), + compiler.getLangOpts()) + == "MDDS_MTV_DEFINE_ELEMENT_CALLBACKS")) + { + // Even wrapping in an unnamed namespace or sneaking "static" into the macro wouldn't + // help, as then some of the functions it defines would be flagged as unused: + return true; + } + TypedefNameDecl const* typedefed = nullptr; + if (auto const d = dyn_cast<TagDecl>(decl)) + { + typedefed = d->getTypedefNameForAnonDecl(); + } + bool canStatic; + if (auto const d = dyn_cast<CXXRecordDecl>(decl)) + { + canStatic = d->isUnion() && d->isAnonymousStructOrUnion(); + } + else + { + canStatic = isa<FunctionDecl>(decl) || isa<VarDecl>(decl) + || isa<FunctionTemplateDecl>(decl) || isa<VarTemplateDecl>(decl); + } + auto const canUnnamed = compiler.getLangOpts().CPlusPlus + && !(isa<FunctionDecl>(decl) || isa<FunctionTemplateDecl>(decl)); + // in general, moving functions into an unnamed namespace can break ADL + assert(canStatic || canUnnamed); + report( + DiagnosticsEngine::Warning, + ("externally available%select{| typedef'ed}0 entity %1 is not previously declared in an" + " included file (if it is only used in this translation unit," + " %select{|make it static}2%select{| or }3%select{|put it in an unnamed namespace}4;" + " otherwise, provide a declaration of it in an included file)"), + decl->getLocation()) + << (typedefed != nullptr) << (typedefed == nullptr ? decl : typedefed) << canStatic + << (canStatic && canUnnamed) << canUnnamed << decl->getSourceRange(); + for (auto d = decl->getPreviousDecl(); d != nullptr; d = d->getPreviousDecl()) + { + report(DiagnosticsEngine::Note, "previous declaration is here", d->getLocation()) + << d->getSourceRange(); + } + //TODO: Class template specializations can be in the enclosing namespace, so no need to + // list them here (as they won't need to be put into the unnamed namespace too, unlike for + // specializations of function and variable templates); and explicit function template + // specializations cannot have storage-class specifiers, so as we only suggest to make + // function templates static (but not to move them into an unnamed namespace), no need to + // list function template specializations here, either: + if (auto const d = dyn_cast<VarTemplateDecl>(decl)) + { + reportSpecializations(d->specializations()); + } + return true; + } +}; + +loplugin::Plugin::Registration<External> X("external"); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/connectivity/source/commontools/CommonTools.cxx b/connectivity/source/commontools/CommonTools.cxx index 51d449ad1bb0..61e14b44aee3 100644 --- a/connectivity/source/commontools/CommonTools.cxx +++ b/connectivity/source/commontools/CommonTools.cxx @@ -36,7 +36,7 @@ #include <rtl/process.h> using namespace ::comphelper; -inline sal_Unicode rtl_ascii_toUpperCase( sal_Unicode ch ) +static inline sal_Unicode rtl_ascii_toUpperCase( sal_Unicode ch ) { return ch >= 0x0061 && ch <= 0x007a ? ch + 0x20 : ch; } @@ -168,7 +168,7 @@ namespace connectivity namespace dbtools { -bool isCharOk(sal_Unicode c,const OUString& _rSpecials) +static bool isCharOk(sal_Unicode c,const OUString& _rSpecials) { return ( ((c >= 97) && (c <= 122)) || ((c >= 65) && (c <= 90)) || ((c >= 48) && (c <= 57)) || diff --git a/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx b/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx index bef6e6c5584f..95bae62bed1e 100644 --- a/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx +++ b/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx @@ -871,7 +871,7 @@ void SAL_CALL ODatabaseMetaDataResultSet::initialize( const Sequence< Any >& _aA namespace connectivity { /// @throws Exception - Reference< XInterface > ODatabaseMetaDataResultSet_CreateInstance(const Reference< XComponentContext >& ) + static Reference< XInterface > ODatabaseMetaDataResultSet_CreateInstance(const Reference< XComponentContext >& ) { return *(new ODatabaseMetaDataResultSet()); } diff --git a/connectivity/source/commontools/TKeys.cxx b/connectivity/source/commontools/TKeys.cxx index 81479b491d92..293a0dab4ccf 100644 --- a/connectivity/source/commontools/TKeys.cxx +++ b/connectivity/source/commontools/TKeys.cxx @@ -79,7 +79,7 @@ Reference< XPropertySet > OKeysHelper::createDescriptor() /** returns the keyrule string for the primary key */ -OUString getKeyRuleString(bool _bUpdate,sal_Int32 _nKeyRule) +static OUString getKeyRuleString(bool _bUpdate,sal_Int32 _nKeyRule) { const char* pKeyRule = nullptr; switch ( _nKeyRule ) diff --git a/connectivity/source/commontools/TTableHelper.cxx b/connectivity/source/commontools/TTableHelper.cxx index 92447c8e94db..7b9bb2e52984 100644 --- a/connectivity/source/commontools/TTableHelper.cxx +++ b/connectivity/source/commontools/TTableHelper.cxx @@ -94,7 +94,7 @@ public: } namespace connectivity { - OUString lcl_getServiceNameForSetting(const Reference< css::sdbc::XConnection >& _xConnection,const OUString& i_sSetting) + static OUString lcl_getServiceNameForSetting(const Reference< css::sdbc::XConnection >& _xConnection,const OUString& i_sSetting) { OUString sSupportService; Any aValue; diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx index 2476315bc46c..b8b8a4cdd29b 100644 --- a/connectivity/source/commontools/dbtools.cxx +++ b/connectivity/source/commontools/dbtools.cxx @@ -220,7 +220,7 @@ sal_Int32 getDefaultNumberFormat(sal_Int32 _nDataType, return nFormat; } -Reference< XConnection> findConnection(const Reference< XInterface >& xParent) +static Reference< XConnection> findConnection(const Reference< XInterface >& xParent) { Reference< XConnection> xConnection(xParent, UNO_QUERY); if (!xConnection.is()) @@ -232,7 +232,7 @@ Reference< XConnection> findConnection(const Reference< XInterface >& xParent) return xConnection; } -Reference< XDataSource> getDataSource_allowException( +static Reference< XDataSource> getDataSource_allowException( const OUString& _rsTitleOrPath, const Reference< XComponentContext >& _rxContext ) { @@ -260,7 +260,7 @@ Reference< XDataSource > getDataSource( return xDS; } -Reference< XConnection > getConnection_allowException( +static Reference< XConnection > getConnection_allowException( const OUString& _rsTitleOrPath, const OUString& _rsUser, const OUString& _rsPwd, @@ -337,7 +337,7 @@ Reference< XConnection> getConnection(const Reference< XRowSet>& _rxRowSet) // helper function which allows to implement both the connectRowset and the ensureRowSetConnection semantics // if connectRowset (which is deprecated) is removed, this function and one of its parameters are // not needed anymore, the whole implementation can be moved into ensureRowSetConnection then) -SharedConnection lcl_connectRowSet(const Reference< XRowSet>& _rxRowSet, const Reference< XComponentContext >& _rxContext, +static SharedConnection lcl_connectRowSet(const Reference< XRowSet>& _rxRowSet, const Reference< XComponentContext >& _rxContext, bool _bAttachAutoDisposer ) { SharedConnection xConnection; @@ -1197,7 +1197,7 @@ Reference< XDataSource> findDataSource(const Reference< XInterface >& _xParent) return xDataSource; } -Reference< XSingleSelectQueryComposer > getComposedRowSetStatement( const Reference< XPropertySet >& _rxRowSet, const Reference< XComponentContext >& _rxContext ) +static Reference< XSingleSelectQueryComposer > getComposedRowSetStatement( const Reference< XPropertySet >& _rxRowSet, const Reference< XComponentContext >& _rxContext ) { Reference< XSingleSelectQueryComposer > xComposer; try diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx index d17c96d400ee..b8643e642efd 100644 --- a/connectivity/source/commontools/dbtools2.cxx +++ b/connectivity/source/commontools/dbtools2.cxx @@ -940,17 +940,17 @@ sal_Int32 DBTypeConversion::convertUnicodeStringToLength( const OUString& _rSour return nLen; } -OUString lcl_getReportEngines() +static OUString lcl_getReportEngines() { return OUString("org.openoffice.Office.DataAccess/ReportEngines"); } -OUString lcl_getDefaultReportEngine() +static OUString lcl_getDefaultReportEngine() { return OUString("DefaultReportEngine"); } -OUString lcl_getReportEngineNames() +static OUString lcl_getReportEngineNames() { return OUString("ReportEngineNames"); } diff --git a/connectivity/source/drivers/evoab2/NResultSet.cxx b/connectivity/source/drivers/evoab2/NResultSet.cxx index e852309963ae..79557fd69789 100644 --- a/connectivity/source/drivers/evoab2/NResultSet.cxx +++ b/connectivity/source/drivers/evoab2/NResultSet.cxx @@ -297,8 +297,9 @@ getValue( EContact* pContact, sal_Int32 nColumnNum, GType nType, GValue* pStackV return true; } -extern "C" -int CompareContacts( gconstpointer _lhs, gconstpointer _rhs, gpointer _userData ) +extern "C" { + +static int CompareContacts( gconstpointer _lhs, gconstpointer _rhs, gpointer _userData ) { EContact* lhs = const_cast< gpointer >( _lhs ); EContact* rhs = const_cast< gpointer >( _rhs ); @@ -355,6 +356,8 @@ int CompareContacts( gconstpointer _lhs, gconstpointer _rhs, gpointer _userData return 0; } +} + OString OEvoabVersionHelper::getUserName( EBook *pBook ) { OString aName; diff --git a/connectivity/source/drivers/firebird/Util.cxx b/connectivity/source/drivers/firebird/Util.cxx index 14844cfaaddb..6cc5d16484f9 100644 --- a/connectivity/source/drivers/firebird/Util.cxx +++ b/connectivity/source/drivers/firebird/Util.cxx @@ -67,7 +67,7 @@ void firebird::evaluateStatusVector(const ISC_STATUS_ARRAY& rStatusVector, } } -sal_Int32 lcl_getNumberType( short aType, NumberSubType aSubType ) +static sal_Int32 lcl_getNumberType( short aType, NumberSubType aSubType ) { switch(aSubType) { @@ -92,7 +92,7 @@ sal_Int32 lcl_getNumberType( short aType, NumberSubType aSubType ) } } } -sal_Int32 lcl_getCharColumnType( short aType, const OUString& sCharset ) +static sal_Int32 lcl_getCharColumnType( short aType, const OUString& sCharset ) { switch(aType) { diff --git a/connectivity/source/drivers/hsqldb/HStorageMap.cxx b/connectivity/source/drivers/hsqldb/HStorageMap.cxx index f3214e94359c..04116d02f036 100644 --- a/connectivity/source/drivers/hsqldb/HStorageMap.cxx +++ b/connectivity/source/drivers/hsqldb/HStorageMap.cxx @@ -123,13 +123,13 @@ namespace connectivity } } - TStorages& lcl_getStorageMap() + static TStorages& lcl_getStorageMap() { static TStorages s_aMap; return s_aMap; } - OUString lcl_getNextCount() + static OUString lcl_getNextCount() { static sal_Int32 s_nCount = 0; return OUString::number(s_nCount++); diff --git a/connectivity/source/drivers/jdbc/Object.cxx b/connectivity/source/drivers/jdbc/Object.cxx index 4a9a854d48f7..8fac24980fb7 100644 --- a/connectivity/source/drivers/jdbc/Object.cxx +++ b/connectivity/source/drivers/jdbc/Object.cxx @@ -40,7 +40,7 @@ using namespace ::com::sun::star::container; using namespace ::com::sun::star::lang; -::rtl::Reference< jvmaccess::VirtualMachine > const & getJavaVM2(const ::rtl::Reference< jvmaccess::VirtualMachine >& _rVM = ::rtl::Reference< jvmaccess::VirtualMachine >(), +static ::rtl::Reference< jvmaccess::VirtualMachine > const & getJavaVM2(const ::rtl::Reference< jvmaccess::VirtualMachine >& _rVM = ::rtl::Reference< jvmaccess::VirtualMachine >(), bool _bSet = false) { static ::rtl::Reference< jvmaccess::VirtualMachine > s_VM; @@ -70,7 +70,7 @@ SDBThreadAttach::~SDBThreadAttach() { } -oslInterlockedCount& getJavaVMRefCount() +static oslInterlockedCount& getJavaVMRefCount() { static oslInterlockedCount s_nRefCount = 0; return s_nRefCount; diff --git a/connectivity/source/drivers/mork/MQueryHelper.cxx b/connectivity/source/drivers/mork/MQueryHelper.cxx index 00cdf3df93c0..c2b3ccf5713b 100644 --- a/connectivity/source/drivers/mork/MQueryHelper.cxx +++ b/connectivity/source/drivers/mork/MQueryHelper.cxx @@ -41,7 +41,7 @@ using namespace ::com::sun::star::beans; using namespace ::com::sun::star::sdbc; -extern +static std::vector<bool> entryMatchedByExpression(MQueryHelper* _aQuery, MQueryExpression const * _aExpr, MQueryHelperResultEntry* entry); MQueryHelperResultEntry::MQueryHelperResultEntry() diff --git a/connectivity/source/drivers/mork/mork_helper.cxx b/connectivity/source/drivers/mork/mork_helper.cxx index 07c70a1aa2d6..4cb11864fee5 100644 --- a/connectivity/source/drivers/mork/mork_helper.cxx +++ b/connectivity/source/drivers/mork/mork_helper.cxx @@ -4,7 +4,7 @@ #include <iostream> #include <sal/log.hxx> -bool openAddressBook(const std::string& path) +static bool openAddressBook(const std::string& path) { MorkParser mork; // Open and parse mork file diff --git a/connectivity/source/drivers/mysqlc/mysqlc_databasemetadata.cxx b/connectivity/source/drivers/mysqlc/mysqlc_databasemetadata.cxx index 903481e27fe0..5fb717fe3741 100644 --- a/connectivity/source/drivers/mysqlc/mysqlc_databasemetadata.cxx +++ b/connectivity/source/drivers/mysqlc/mysqlc_databasemetadata.cxx @@ -47,8 +47,8 @@ using namespace com::sun::star::sdbc; static std::string wild("%"); -void lcl_setRows_throw(const Reference<XResultSet>& _xResultSet, sal_Int32 _nType, - const std::vector<std::vector<Any>>& _rRows) +static void lcl_setRows_throw(const Reference<XResultSet>& _xResultSet, sal_Int32 _nType, + const std::vector<std::vector<Any>>& _rRows) { Reference<XInitialization> xIni(_xResultSet, UNO_QUERY); Sequence<Any> aArgs(2); diff --git a/connectivity/source/drivers/odbc/OFunctions.cxx b/connectivity/source/drivers/odbc/OFunctions.cxx index 9e546e389208..f740052325c3 100644 --- a/connectivity/source/drivers/odbc/OFunctions.cxx +++ b/connectivity/source/drivers/odbc/OFunctions.cxx @@ -79,7 +79,7 @@ T3SQLFreeHandle pODBC3SQLFreeHandle; T3SQLGetCursorName pODBC3SQLGetCursorName; T3SQLNativeSql pODBC3SQLNativeSql; -bool LoadFunctions(oslModule pODBCso); +static bool LoadFunctions(oslModule pODBCso); // Take care of Dynamically loading of the DLL/shared lib and Addresses: // Returns sal_True at success diff --git a/connectivity/source/drivers/postgresql/pq_connection.cxx b/connectivity/source/drivers/postgresql/pq_connection.cxx index fe113e0c0585..172c6fc5f130 100644 --- a/connectivity/source/drivers/postgresql/pq_connection.cxx +++ b/connectivity/source/drivers/postgresql/pq_connection.cxx @@ -117,11 +117,11 @@ public: } }; -OUString ConnectionGetImplementationName() +static OUString ConnectionGetImplementationName() { return OUString( "org.openoffice.comp.connectivity.pq.Connection.noext" ); } -css::uno::Sequence<OUString> ConnectionGetSupportedServiceNames() +static css::uno::Sequence<OUString> ConnectionGetSupportedServiceNames() { return Sequence< OUString > { "com.sun.star.sdbc.Connection" }; } @@ -640,7 +640,7 @@ Reference< XNameAccess > Connection::getUsers() } /// @throws Exception -Reference< XInterface > ConnectionCreateInstance( +static Reference< XInterface > ConnectionCreateInstance( const Reference< XComponentContext > & ctx ) { ::rtl::Reference< comphelper::RefCountedMutex > ref = new comphelper::RefCountedMutex; diff --git a/connectivity/source/drivers/postgresql/pq_driver.cxx b/connectivity/source/drivers/postgresql/pq_driver.cxx index a51f69c848e9..a27bd95175d5 100644 --- a/connectivity/source/drivers/postgresql/pq_driver.cxx +++ b/connectivity/source/drivers/postgresql/pq_driver.cxx @@ -70,12 +70,12 @@ using com::sun::star::sdbcx::XTablesSupplier; namespace pq_sdbc_driver { -OUString DriverGetImplementationName() +static OUString DriverGetImplementationName() { return OUString( "org.openoffice.comp.connectivity.pq.Driver.noext" ); } -Sequence< OUString > DriverGetSupportedServiceNames() +static Sequence< OUString > DriverGetSupportedServiceNames() { return Sequence< OUString > { "com.sun.star.sdbc.Driver" }; } @@ -154,7 +154,7 @@ Reference< XTablesSupplier > Driver::getDataDefinitionByURL( } -Reference< XInterface > DriverCreateInstance( const Reference < XComponentContext > & ctx ) +static Reference< XInterface > DriverCreateInstance( const Reference < XComponentContext > & ctx ) { Reference< XInterface > ret = * new Driver( ctx ); return ret; diff --git a/connectivity/source/manager/mdrivermanager.cxx b/connectivity/source/manager/mdrivermanager.cxx index e9fdf9f8ad09..cac14c1d673f 100644 --- a/connectivity/source/manager/mdrivermanager.cxx +++ b/connectivity/source/manager/mdrivermanager.cxx @@ -50,7 +50,7 @@ using namespace ::osl; #define SERVICE_SDBC_DRIVER "com.sun.star.sdbc.Driver" /// @throws NoSuchElementException -void throwNoSuchElementException() +static void throwNoSuchElementException() { throw NoSuchElementException(); } diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx index 2b2a687f6e47..683ac9e3b3c2 100644 --- a/connectivity/source/parse/sqlnode.cxx +++ b/connectivity/source/parse/sqlnode.cxx @@ -1786,7 +1786,7 @@ OSQLParseNode* OSQLParseNode::getByRule(OSQLParseNode::Rule eRule) const return pRetNode; } -OSQLParseNode* MakeANDNode(OSQLParseNode *pLeftLeaf,OSQLParseNode *pRightLeaf) +static OSQLParseNode* MakeANDNode(OSQLParseNode *pLeftLeaf,OSQLParseNode *pRightLeaf) { OSQLParseNode* pNewNode = new OSQLParseNode(OUString(),SQLNodeType::Rule,OSQLParser::RuleID(OSQLParseNode::boolean_term)); pNewNode->append(pLeftLeaf); @@ -1795,7 +1795,7 @@ OSQLParseNode* MakeANDNode(OSQLParseNode *pLeftLeaf,OSQLParseNode *pRightLeaf) return pNewNode; } -OSQLParseNode* MakeORNode(OSQLParseNode *pLeftLeaf,OSQLParseNode *pRightLeaf) +static OSQLParseNode* MakeORNode(OSQLParseNode *pLeftLeaf,OSQLParseNode *pRightLeaf) { OSQLParseNode* pNewNode = new OSQLParseNode(OUString(),SQLNodeType::Rule,OSQLParser::RuleID(OSQLParseNode::search_condition)); pNewNode->append(pLeftLeaf); diff --git a/cppu/qa/cppumaker/test_cppumaker.cxx b/cppu/qa/cppumaker/test_cppumaker.cxx index 3919ed6c17ef..c95c61a905b3 100644 --- a/cppu/qa/cppumaker/test_cppumaker.cxx +++ b/cppu/qa/cppumaker/test_cppumaker.cxx @@ -367,7 +367,7 @@ namespace test { namespace codemaker { namespace cppumaker { -bool operator ==( +static bool operator ==( test::codemaker::cppumaker::TestException1 const & e1, test::codemaker::cppumaker::TestException1 const & e2) { diff --git a/cppu/source/LogBridge/LogBridge.cxx b/cppu/source/LogBridge/LogBridge.cxx index 395d7d8ef164..da8b1e64e702 100644 --- a/cppu/source/LogBridge/LogBridge.cxx +++ b/cppu/source/LogBridge/LogBridge.cxx @@ -189,7 +189,7 @@ bool LogBridge::v_isValid(rtl::OUString * pReason) } } -void LogProbe( +static void LogProbe( bool pre, SAL_UNUSED_PARAMETER void * /*pThis*/, SAL_UNUSED_PARAMETER void * /*pContext*/, diff --git a/cppu/source/threadpool/current.cxx b/cppu/source/threadpool/current.cxx index fa2545d05e1c..b5c839b193cd 100644 --- a/cppu/source/threadpool/current.cxx +++ b/cppu/source/threadpool/current.cxx @@ -134,7 +134,9 @@ public: } }; -extern "C" void delete_IdContainer( void * p ) +extern "C" { + +static void delete_IdContainer( void * p ) { if (p) { @@ -155,6 +157,8 @@ extern "C" void delete_IdContainer( void * p ) } } +} + IdContainer * getIdContainer() { static ThreadKey s_key( delete_IdContainer ); diff --git a/cppuhelper/source/implbase_ex.cxx b/cppuhelper/source/implbase_ex.cxx index 0472cc5dd051..2abad8783bcf 100644 --- a/cppuhelper/source/implbase_ex.cxx +++ b/cppuhelper/source/implbase_ex.cxx @@ -48,7 +48,7 @@ namespace cppu /** Shared mutex for implementation helper initialization. Not for public use. */ -::osl::Mutex & getImplHelperInitMutex() +static ::osl::Mutex & getImplHelperInitMutex() { return theImplHelperInitMutex::get(); } diff --git a/cppuhelper/source/macro_expander.cxx b/cppuhelper/source/macro_expander.cxx index 954258fbfbf5..cfaebecfcc86 100644 --- a/cppuhelper/source/macro_expander.cxx +++ b/cppuhelper/source/macro_expander.cxx @@ -50,7 +50,7 @@ using rtl::OUString; namespace cppu { -Bootstrap const & get_unorc() +static Bootstrap const & get_unorc() { static rtlBootstrapHandle s_bstrap = nullptr; if (! s_bstrap) diff --git a/cppuhelper/source/propshlp.cxx b/cppuhelper/source/propshlp.cxx index 9aceb32a66a0..a8053aac6b61 100644 --- a/cppuhelper/source/propshlp.cxx +++ b/cppuhelper/source/propshlp.cxx @@ -43,15 +43,15 @@ IPropertyArrayHelper::~IPropertyArrayHelper() { } -inline const css::uno::Type & getPropertyTypeIdentifier( ) +static inline const css::uno::Type & getPropertyTypeIdentifier( ) { return cppu::UnoType<XPropertyChangeListener>::get(); } -inline const css::uno::Type & getPropertiesTypeIdentifier() +static inline const css::uno::Type & getPropertiesTypeIdentifier() { return cppu::UnoType<XPropertiesChangeListener>::get(); } -inline const css::uno::Type & getVetoableTypeIdentifier() +static inline const css::uno::Type & getVetoableTypeIdentifier() { return cppu::UnoType<XVetoableChangeListener>::get(); } diff --git a/cpputools/source/unoexe/unoexe.cxx b/cpputools/source/unoexe/unoexe.cxx index cc92cdf355b2..06e6b685ea63 100644 --- a/cpputools/source/unoexe/unoexe.cxx +++ b/cpputools/source/unoexe/unoexe.cxx @@ -140,7 +140,7 @@ static bool readOption( bool * pbOpt, const sal_Char * pOpt, /// @throws Exception template< class T > -void createInstance( +static void createInstance( Reference< T > & rxOut, const Reference< XComponentContext > & xContext, const OUString & rServiceName ) diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index fac9928510cc..d9d2f8dc9468 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -176,27 +176,27 @@ SvxConfigPage::CanConfig( const OUString& aModuleId ) return !(aModuleId == "com.sun.star.script.BasicIDE" || aModuleId == "com.sun.star.frame.Bibliography"); } -VclPtr<SfxTabPage> CreateSvxMenuConfigPage( TabPageParent pParent, const SfxItemSet* rSet ) +static VclPtr<SfxTabPage> CreateSvxMenuConfigPage( TabPageParent pParent, const SfxItemSet* rSet ) { return VclPtr<SvxMenuConfigPage>::Create( pParent.pParent, *rSet ); } -VclPtr<SfxTabPage> CreateSvxContextMenuConfigPage( TabPageParent pParent, const SfxItemSet* rSet ) +static VclPtr<SfxTabPage> CreateSvxContextMenuConfigPage( TabPageParent pParent, const SfxItemSet* rSet ) { return VclPtr<SvxMenuConfigPage>::Create( pParent.pParent, *rSet, false ); } -VclPtr<SfxTabPage> CreateKeyboardConfigPage( TabPageParent pParent, const SfxItemSet* rSet ) +static VclPtr<SfxTabPage> CreateKeyboardConfigPage( TabPageParent pParent, const SfxItemSet* rSet ) { return VclPtr<SfxAcceleratorConfigPage>::Create( pParent.pParent, *rSet ); } -VclPtr<SfxTabPage> CreateSvxToolbarConfigPage( TabPageParent pParent, const SfxItemSet* rSet ) +static VclPtr<SfxTabPage> CreateSvxToolbarConfigPage( TabPageParent pParent, const SfxItemSet* rSet ) { return VclPtr<SvxToolbarConfigPage>::Create( pParent.pParent, *rSet ); } -VclPtr<SfxTabPage> CreateSvxEventConfigPage( TabPageParent pParent, const SfxItemSet* rSet ) +static VclPtr<SfxTabPage> CreateSvxEventConfigPage( TabPageParent pParent, const SfxItemSet* rSet ) { return VclPtr<SvxEventConfigPage>::Create( pParent.pParent, *rSet, SvxEventConfigPage::EarlyInit() ); } diff --git a/cui/source/dialogs/FontFeaturesDialog.cxx b/cui/source/dialogs/FontFeaturesDialog.cxx index 272031bc54a4..67f87b3410aa 100644 --- a/cui/source/dialogs/FontFeaturesDialog.cxx +++ b/cui/source/dialogs/FontFeaturesDialog.cxx @@ -28,8 +28,8 @@ FontFeaturesDialog::FontFeaturesDialog(weld::Window* pParent, OUString const& rF FontFeaturesDialog::~FontFeaturesDialog() {} -void makeEnumComboBox(weld::ComboBoxText& rNameBox, - vcl::font::FeatureDefinition const& rFeatureDefinition) +static void makeEnumComboBox(weld::ComboBoxText& rNameBox, + vcl::font::FeatureDefinition const& rFeatureDefinition) { for (vcl::font::FeatureParameter const& rParameter : rFeatureDefinition.getEnumParameters()) rNameBox.append_text(rParameter.getDescription()); diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx index 7e6d8ac97d0e..40e3cb890687 100644 --- a/cui/source/dialogs/scriptdlg.cxx +++ b/cui/source/dialogs/scriptdlg.cxx @@ -65,7 +65,7 @@ using namespace css::script; using namespace css::frame; using namespace css::document; -void ShowErrorDialog( const Any& aException ) +static void ShowErrorDialog( const Any& aException ) { ScopedVclPtrInstance<SvxScriptErrorDialog> pDlg( aException ); pDlg->Execute(); diff --git a/cui/source/factory/cuiexp.cxx b/cui/source/factory/cuiexp.cxx index c52f11f857be..09cddbf04044 100644 --- a/cui/source/factory/cuiexp.cxx +++ b/cui/source/factory/cuiexp.cxx @@ -56,7 +56,7 @@ namespace cui { static AbstractDialogFactory_Impl* pFactory=nullptr; - AbstractDialogFactory_Impl* GetFactory() + static AbstractDialogFactory_Impl* GetFactory() { if ( !pFactory ) pFactory = new AbstractDialogFactory_Impl; diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx index afd2f4c5de2a..88dd159a9823 100644 --- a/cui/source/options/optlingu.cxx +++ b/cui/source/options/optlingu.cxx @@ -118,7 +118,7 @@ static sal_Int32 lcl_SeqGetEntryPos( return i < nLen ? i : -1; } -bool KillFile_Impl( const OUString& rURL ) +static bool KillFile_Impl( const OUString& rURL ) { bool bRet = true; try diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx index 24f167b94bba..7bfe1219d146 100644 --- a/cui/source/options/optpath.cxx +++ b/cui/source/options/optpath.cxx @@ -168,7 +168,7 @@ static OUString Convert_Impl( const OUString& rValue ) // functions ------------------------------------------------------------- -bool IsMultiPath_Impl( const sal_uInt16 nIndex ) +static bool IsMultiPath_Impl( const sal_uInt16 nIndex ) { #if OSL_DEBUG_LEVEL > 1 return ( SvtPathOptions::PATH_AUTOCORRECT == nIndex || diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx index 55e3c4eef9da..1a80a97b1438 100644 --- a/cui/source/options/optsave.cxx +++ b/cui/source/options/optsave.cxx @@ -348,7 +348,7 @@ bool SvxSaveTabPage::FillItemSet( SfxItemSet* rSet ) return bModified; } -bool isODFFormat( const OUString& sFilter ) +static bool isODFFormat( const OUString& sFilter ) { static const char* aODFFormats[] = { diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index 9452dae091aa..34f3a53aee09 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -280,7 +280,7 @@ void MailMergeCfg_Impl::Notify( const css::uno::Sequence< OUString >& ) } //typedef SfxTabPage* (*FNCreateTabPage)(TabPageParent pParent, const SfxItemSet &rAttrSet); -VclPtr<SfxTabPage> CreateGeneralTabPage(sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet) +static VclPtr<SfxTabPage> CreateGeneralTabPage(sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet) { CreateTabPage fnCreate = nullptr; switch(nId) @@ -1439,7 +1439,7 @@ void OfaTreeOptionsDialog::ApplyLanguageOptions(const SfxItemSet& rSet) } } -OUString getCurrentFactory_Impl( const Reference< XFrame >& _xFrame ) +static OUString getCurrentFactory_Impl( const Reference< XFrame >& _xFrame ) { OUString sIdentifier; Reference < XFrame > xCurrentFrame( _xFrame ); @@ -1739,7 +1739,7 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame ) } } -bool isNodeActive( OptionsNode const * pNode, Module* pModule ) +static bool isNodeActive( OptionsNode const * pNode, Module* pModule ) { if ( pNode ) { diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx index 28b67bd5bcfc..47da6b964256 100644 --- a/cui/source/tabpages/backgrnd.cxx +++ b/cui/source/tabpages/backgrnd.cxx @@ -118,7 +118,7 @@ static void lcl_setFillStyle(ListBox* pLbSelect, drawing::FillStyle eStyle) } } -sal_uInt16 GetItemId_Impl( ValueSet const & rValueSet, const Color& rCol ) +static sal_uInt16 GetItemId_Impl( ValueSet const & rValueSet, const Color& rCol ) { bool bFound = false; sal_uInt16 nCount = rValueSet.GetItemCount(); diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index 06d0137ce366..6358dee9f77a 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -138,7 +138,7 @@ const sal_uInt16 SvxCharTwoLinesPage::pTwoLinesRanges[] = // C-Function ------------------------------------------------------------ -inline bool StateToAttr( TriState aState ) +static inline bool StateToAttr( TriState aState ) { return ( TRISTATE_TRUE == aState ); } diff --git a/cui/source/tabpages/macroass.cxx b/cui/source/tabpages/macroass.cxx index c164baff3f79..eb0dfa26c40a 100644 --- a/cui/source/tabpages/macroass.cxx +++ b/cui/source/tabpages/macroass.cxx @@ -90,7 +90,7 @@ static long const nTabs[] = #define LB_MACROS_ITEMPOS 2 -OUString ConvertToUIName_Impl( SvxMacro const *pMacro ) +static OUString ConvertToUIName_Impl( SvxMacro const *pMacro ) { OUString aName( pMacro->GetMacName() ); OUString aEntry; diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx index 054bc8fb16ed..7776f0027df0 100644 --- a/cui/source/tabpages/page.cxx +++ b/cui/source/tabpages/page.cxx @@ -84,7 +84,7 @@ const SvxPageUsage aArr[] = }; -sal_uInt16 PageUsageToPos_Impl( SvxPageUsage nUsage ) +static sal_uInt16 PageUsageToPos_Impl( SvxPageUsage nUsage ) { for ( sal_uInt16 i = 0; i < SAL_N_ELEMENTS(aArr); ++i ) if ( aArr[i] == nUsage ) @@ -93,7 +93,7 @@ sal_uInt16 PageUsageToPos_Impl( SvxPageUsage nUsage ) } -SvxPageUsage PosToPageUsage_Impl( sal_uInt16 nPos ) +static SvxPageUsage PosToPageUsage_Impl( sal_uInt16 nPos ) { if ( nPos >= SAL_N_ELEMENTS(aArr) ) return SvxPageUsage::NONE; @@ -101,7 +101,7 @@ SvxPageUsage PosToPageUsage_Impl( sal_uInt16 nPos ) } -Size GetMinBorderSpace_Impl( const SvxShadowItem& rShadow, const SvxBoxItem& rBox ) +static Size GetMinBorderSpace_Impl( const SvxShadowItem& rShadow, const SvxBoxItem& rBox ) { Size aSz; aSz.setHeight( rShadow.CalcShadowSpace( SvxShadowItemSide::BOTTOM ) + rBox.CalcLineSpace( SvxBoxItemLine::BOTTOM ) ); @@ -112,12 +112,12 @@ Size GetMinBorderSpace_Impl( const SvxShadowItem& rShadow, const SvxBoxItem& rBo } -long ConvertLong_Impl( const long nIn, MapUnit eUnit ) +static long ConvertLong_Impl( const long nIn, MapUnit eUnit ) { return OutputDevice::LogicToLogic( nIn, eUnit, MapUnit::MapTwip ); } -bool IsEqualSize_Impl( const SvxSizeItem* pSize, const Size& rSize ) +static bool IsEqualSize_Impl( const SvxSizeItem* pSize, const Size& rSize ) { if ( pSize ) { diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx index 5f3af968def6..3e0c7fb9e7a9 100644 --- a/cui/source/tabpages/paragrph.cxx +++ b/cui/source/tabpages/paragrph.cxx @@ -95,7 +95,7 @@ enum LineSpaceList LLINESPACE_FIX = 7 }; -void SetLineSpace_Impl( SvxLineSpacingItem&, int, long lValue = 0 ); +static void SetLineSpace_Impl( SvxLineSpacingItem&, int, long lValue = 0 ); void SetLineSpace_Impl( SvxLineSpacingItem& rLineSpace, int eSpace, long lValue ) @@ -145,7 +145,7 @@ void SetLineSpace_Impl( SvxLineSpacingItem& rLineSpace, } } -sal_uInt16 GetHtmlMode_Impl(const SfxItemSet& rSet) +static sal_uInt16 GetHtmlMode_Impl(const SfxItemSet& rSet) { sal_uInt16 nHtmlMode = 0; const SfxPoolItem* pItem = nullptr; diff --git a/cui/source/tabpages/tabstpge.cxx b/cui/source/tabpages/tabstpge.cxx index e64ab07e82be..9133ad646b55 100644 --- a/cui/source/tabpages/tabstpge.cxx +++ b/cui/source/tabpages/tabstpge.cxx @@ -66,7 +66,7 @@ const sal_uInt16 SvxTabulatorTabPage::pRanges[] = 0 }; -void FillUpWithDefTabs_Impl( long nDefDist, SvxTabStopItem& rTabs ) +static void FillUpWithDefTabs_Impl( long nDefDist, SvxTabStopItem& rTabs ) { if( rTabs.Count() ) return; diff --git a/dbaccess/qa/unit/embeddeddb_performancetest.cxx b/dbaccess/qa/unit/embeddeddb_performancetest.cxx index 444f283d9630..28d8417c1223 100644 --- a/dbaccess/qa/unit/embeddeddb_performancetest.cxx +++ b/dbaccess/qa/unit/embeddeddb_performancetest.cxx @@ -38,13 +38,13 @@ using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::uno; -void normaliseTimeValue(TimeValue* pVal) +static void normaliseTimeValue(TimeValue* pVal) { pVal->Seconds += pVal->Nanosec / 1000000000; pVal->Nanosec %= 1000000000; } -void getTimeDifference(const TimeValue* pTimeStart, +static void getTimeDifference(const TimeValue* pTimeStart, const TimeValue* pTimeEnd, TimeValue* pTimeDifference) { @@ -56,7 +56,7 @@ void getTimeDifference(const TimeValue* pTimeStart, normaliseTimeValue(pTimeDifference); } -OUString getPrintableTimeValue(const TimeValue* pTimeValue) +static OUString getPrintableTimeValue(const TimeValue* pTimeValue) { return OUString::number( (sal_uInt64(pTimeValue->Seconds) * SAL_CONST_UINT64(1000000000) diff --git a/dbaccess/source/core/api/FilteredContainer.cxx b/dbaccess/source/core/api/FilteredContainer.cxx index 5f47da9e9da9..1e75ea7d747b 100644 --- a/dbaccess/source/core/api/FilteredContainer.cxx +++ b/dbaccess/source/core/api/FilteredContainer.cxx @@ -48,7 +48,7 @@ namespace dbaccess /** creates a vector of WildCards and reduce the _rTableFilter of the length of WildsCards */ -sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, std::vector< WildCard >& _rOut) +static sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, std::vector< WildCard >& _rOut) { // for wildcard search : remove all table filters which are a wildcard expression and build a WildCard // for them @@ -75,7 +75,7 @@ sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, std::vector< return nShiftPos; } - bool lcl_isElementAllowed( const OUString& _rName, + static bool lcl_isElementAllowed( const OUString& _rName, const Sequence< OUString >& _rTableFilter, const std::vector< WildCard >& _rWCSearch ) { @@ -124,7 +124,7 @@ sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, std::vector< }; typedef std::vector< TableInfo > TableInfos; - void lcl_ensureComposedName( TableInfo& _io_tableInfo, const Reference< XDatabaseMetaData >& _metaData ) + static void lcl_ensureComposedName( TableInfo& _io_tableInfo, const Reference< XDatabaseMetaData >& _metaData ) { if ( !_metaData.is() ) throw RuntimeException(); @@ -140,7 +140,7 @@ sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, std::vector< } } - void lcl_ensureType( TableInfo& _io_tableInfo, const Reference< XDatabaseMetaData >& _metaData, const Reference< XNameAccess >& _masterContainer ) + static void lcl_ensureType( TableInfo& _io_tableInfo, const Reference< XDatabaseMetaData >& _metaData, const Reference< XNameAccess >& _masterContainer ) { if ( !!_io_tableInfo.sType ) return; @@ -163,7 +163,7 @@ sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, std::vector< _io_tableInfo.sType = OptionalString( sTypeName ); } - ::std::vector< OUString> lcl_filter( const TableInfos& _unfilteredTables, + static ::std::vector< OUString> lcl_filter( const TableInfos& _unfilteredTables, const Sequence< OUString >& _tableFilter, const Sequence< OUString >& _tableTypeFilter, const Reference< XDatabaseMetaData >& _metaData, const Reference< XNameAccess >& _masterContainer ) { diff --git a/dbaccess/source/core/api/View.cxx b/dbaccess/source/core/api/View.cxx index 3207dd5a1188..32bb4fd624f7 100644 --- a/dbaccess/source/core/api/View.cxx +++ b/dbaccess/source/core/api/View.cxx @@ -38,7 +38,7 @@ namespace dbaccess using ::com::sun::star::sdbc::XConnection; using ::com::sun::star::lang::XMultiServiceFactory; - OUString lcl_getServiceNameForSetting(const Reference< css::sdbc::XConnection >& _xConnection,const OUString& i_sSetting) + static OUString lcl_getServiceNameForSetting(const Reference< css::sdbc::XConnection >& _xConnection,const OUString& i_sSetting) { OUString sSupportService; Any aValue; diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx index 6e972e9c0ce0..1229f7a16942 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.cxx +++ b/dbaccess/source/core/dataaccess/databasedocument.cxx @@ -348,7 +348,7 @@ static const char sPictures[] = "Pictures"; // I could check anyway ) /// @throws RuntimeException -void lcl_uglyHackToStoreDialogeEmbedImages( const Reference< XStorageBasedLibraryContainer >& xDlgCont, const Reference< XStorage >& xStorage, const Reference< XModel >& rxModel, const Reference<XComponentContext >& rxContext ) +static void lcl_uglyHackToStoreDialogeEmbedImages( const Reference< XStorageBasedLibraryContainer >& xDlgCont, const Reference< XStorage >& xStorage, const Reference< XModel >& rxModel, const Reference<XComponentContext >& rxContext ) { Sequence< OUString > sLibraries = xDlgCont->getElementNames(); Reference< XStorage > xTmpPic = xStorage->openStorageElement( "tempPictures", ElementModes::READWRITE ); diff --git a/dbaccess/source/filter/xml/xmlExport.cxx b/dbaccess/source/filter/xml/xmlExport.cxx index a2d09c768271..11e3c9768e9f 100644 --- a/dbaccess/source/filter/xml/xmlExport.cxx +++ b/dbaccess/source/filter/xml/xmlExport.cxx @@ -134,7 +134,7 @@ namespace dbaxml return aSupported; } - OUString lcl_implGetPropertyXMLType(const Type& _rType) + static OUString lcl_implGetPropertyXMLType(const Type& _rType) { // possible types we can write (either because we recognize them directly or because we convert _rValue // into one of these types) diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx index 45718f7ee5ae..b99d19d905ee 100644 --- a/dbaccess/source/filter/xml/xmlfilter.cxx +++ b/dbaccess/source/filter/xml/xmlfilter.cxx @@ -77,7 +77,7 @@ namespace dbaxml { using namespace ::com::sun::star::util; /// read a component (file + filter version) -ErrCode ReadThroughComponent( +static ErrCode ReadThroughComponent( const uno::Reference<XInputStream>& xInputStream, const uno::Reference<XComponent>& xModelComponent, const uno::Reference<XComponentContext> & rxContext, @@ -140,7 +140,7 @@ ErrCode ReadThroughComponent( /// read a component (storage version) -ErrCode ReadThroughComponent( +static ErrCode ReadThroughComponent( const uno::Reference< embed::XStorage >& xStorage, const uno::Reference<XComponent>& xModelComponent, const sal_Char* pStreamName, diff --git a/dbaccess/source/filter/xml/xmlservices.cxx b/dbaccess/source/filter/xml/xmlservices.cxx index 7e5051234889..3e52d0ac4fca 100644 --- a/dbaccess/source/filter/xml/xmlservices.cxx +++ b/dbaccess/source/filter/xml/xmlservices.cxx @@ -26,7 +26,9 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::registry; -extern "C" void createRegistryInfo_dbaxml() +extern "C" { + +static void createRegistryInfo_dbaxml() { static bool bInit = false; if (!bInit) @@ -41,6 +43,8 @@ extern "C" void createRegistryInfo_dbaxml() } } +} + extern "C" SAL_DLLPUBLIC_EXPORT void* dbaxml_component_getFactory( const sal_Char* pImplementationName, void* pServiceManager, diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index 2fea1658a8f5..9c34ca666b09 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -166,14 +166,14 @@ namespace dbaui namespace DatabaseObject = css::sdb::application::DatabaseObject; namespace DatabaseObjectContainer = css::sdb::application::DatabaseObjectContainer; -void SafeAddPropertyListener(const Reference< XPropertySet > & xSet, const OUString& rPropName, XPropertyChangeListener* pListener) +static void SafeAddPropertyListener(const Reference< XPropertySet > & xSet, const OUString& rPropName, XPropertyChangeListener* pListener) { Reference< XPropertySetInfo > xInfo = xSet->getPropertySetInfo(); if (xInfo->hasPropertyByName(rPropName)) xSet->addPropertyChangeListener(rPropName, pListener); } -void SafeRemovePropertyListener(const Reference< XPropertySet > & xSet, const OUString& rPropName, XPropertyChangeListener* pListener) +static void SafeRemovePropertyListener(const Reference< XPropertySet > & xSet, const OUString& rPropName, XPropertyChangeListener* pListener) { Reference< XPropertySetInfo > xInfo = xSet->getPropertySetInfo(); if (xInfo->hasPropertyByName(rPropName)) @@ -794,7 +794,7 @@ void SbaTableQueryBrowser::InitializeGridModel(const Reference< css::form::XForm } } -Reference<XPropertySet> getColumnHelper(SvTreeListEntry const * _pCurrentlyDisplayed, const Reference<XPropertySet>& _rxSource) +static Reference<XPropertySet> getColumnHelper(SvTreeListEntry const * _pCurrentlyDisplayed, const Reference<XPropertySet>& _rxSource) { Reference<XPropertySet> xRet; if(_pCurrentlyDisplayed) diff --git a/dbaccess/source/ui/control/RelationControl.cxx b/dbaccess/source/ui/control/RelationControl.cxx index 068db126efff..aea44e1b4bc7 100644 --- a/dbaccess/source/ui/control/RelationControl.cxx +++ b/dbaccess/source/ui/control/RelationControl.cxx @@ -627,7 +627,7 @@ namespace dbaui m_pRC_Tables->m_ops.clear(); } - void fillEntryAndDisable(ListBox& _rListBox,const OUString& _sEntry) + static void fillEntryAndDisable(ListBox& _rListBox,const OUString& _sEntry) { _rListBox.InsertEntry(_sEntry); _rListBox.SelectEntryPos(0); diff --git a/dbaccess/source/ui/control/SqlNameEdit.cxx b/dbaccess/source/ui/control/SqlNameEdit.cxx index 585c4398d1b1..d890a8a476fb 100644 --- a/dbaccess/source/ui/control/SqlNameEdit.cxx +++ b/dbaccess/source/ui/control/SqlNameEdit.cxx @@ -22,7 +22,7 @@ namespace dbaui { - bool isCharOk(sal_Unicode _cChar,bool _bFirstChar, const OUString& _sAllowedChars) + static bool isCharOk(sal_Unicode _cChar,bool _bFirstChar, const OUString& _sAllowedChars) { return ( (_cChar >= 'A' && _cChar <= 'Z') || diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx b/dbaccess/source/ui/control/dbtreelistbox.cxx index d5b169be3feb..580bb79b89bc 100644 --- a/dbaccess/source/ui/control/dbtreelistbox.cxx +++ b/dbaccess/source/ui/control/dbtreelistbox.cxx @@ -385,7 +385,7 @@ bool DBTreeListBox::DoubleClickHdl() return !aDoubleClickHdl.Call( this ); } -void scrollWindow(DBTreeListBox* _pListBox, const Point& _rPos,bool _bUp) +static void scrollWindow(DBTreeListBox* _pListBox, const Point& _rPos,bool _bUp) { SvTreeListEntry* pEntry = _pListBox->GetEntry( _rPos ); if( pEntry && pEntry != _pListBox->Last() ) diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx index bc0f8b4813ee..0ec0c4136eaa 100644 --- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx +++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx @@ -870,7 +870,7 @@ OString ODbDataSourceAdministrationHelper::translatePropertyId( sal_Int32 _nId ) OString aReturn( aString.getStr(), aString.getLength(), RTL_TEXTENCODING_ASCII_US ); return aReturn; } -template<class T> bool checkItemType(const SfxPoolItem* pItem){ return dynamic_cast<const T*>(pItem) != nullptr;} +template<class T> static bool checkItemType(const SfxPoolItem* pItem){ return dynamic_cast<const T*>(pItem) != nullptr;} void ODbDataSourceAdministrationHelper::implTranslateProperty( SfxItemSet& _rSet, sal_Int32 _nId, const Any& _rValue ) { diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx index 864d4c02480e..78c025be49bf 100644 --- a/dbaccess/source/ui/dlg/dbwizsetup.cxx +++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx @@ -274,7 +274,7 @@ IMPL_LINK_NOARG(ODbTypeWizDialogSetup, OnTypeSelected, OGeneralPage&, void) activateDatabasePath(); } -void lcl_removeUnused(const ::comphelper::NamedValueCollection& _aOld,const ::comphelper::NamedValueCollection& _aNew,::comphelper::NamedValueCollection& _rDSInfo) +static void lcl_removeUnused(const ::comphelper::NamedValueCollection& _aOld,const ::comphelper::NamedValueCollection& _aNew,::comphelper::NamedValueCollection& _rDSInfo) { _rDSInfo.merge(_aNew,true); uno::Sequence< beans::NamedValue > aOldValues = _aOld.getNamedValues(); diff --git a/dbaccess/source/ui/dlg/indexdialog.cxx b/dbaccess/source/ui/dlg/indexdialog.cxx index a4a460e6947d..4934f79d886a 100644 --- a/dbaccess/source/ui/dlg/indexdialog.cxx +++ b/dbaccess/source/ui/dlg/indexdialog.cxx @@ -50,18 +50,18 @@ namespace dbaui using namespace ::dbtools; // helper - bool operator ==(const OIndexField& _rLHS, const OIndexField& _rRHS) + static bool operator ==(const OIndexField& _rLHS, const OIndexField& _rRHS) { return (_rLHS.sFieldName == _rRHS.sFieldName) && (_rLHS.bSortAscending == _rRHS.bSortAscending); } - bool operator !=(const OIndexField& _rLHS, const OIndexField& _rRHS) + static bool operator !=(const OIndexField& _rLHS, const OIndexField& _rRHS) { return !(_rLHS == _rRHS); } - bool operator ==(const IndexFields& _rLHS, const IndexFields& _rRHS) + static bool operator ==(const IndexFields& _rLHS, const IndexFields& _rRHS) { if (_rLHS.size() != _rRHS.size()) return false; @@ -77,7 +77,7 @@ namespace dbaui return true; } - bool operator !=(const IndexFields& _rLHS, const IndexFields& _rRHS) + static bool operator !=(const IndexFields& _rLHS, const IndexFields& _rRHS) { return !(_rLHS == _rRHS); } diff --git a/dbaccess/source/ui/dlg/queryfilter.cxx b/dbaccess/source/ui/dlg/queryfilter.cxx index 66f9c8c1d4fd..8b98159dde37 100644 --- a/dbaccess/source/ui/dlg/queryfilter.cxx +++ b/dbaccess/source/ui/dlg/queryfilter.cxx @@ -49,13 +49,13 @@ using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::beans; -void Replace_OS_PlaceHolder(OUString& aString) +static void Replace_OS_PlaceHolder(OUString& aString) { aString = aString.replaceAll( "*", "%" ); aString = aString.replaceAll( "?", "_" ); } -void Replace_SQL_PlaceHolder(OUString& aString) +static void Replace_SQL_PlaceHolder(OUString& aString) { aString = aString.replaceAll( "%", "*" ); aString = aString.replaceAll( "_", "?" ); diff --git a/dbaccess/source/ui/misc/uiservices.cxx b/dbaccess/source/ui/misc/uiservices.cxx index 26eec900d1fd..a3d6c8db83e8 100644 --- a/dbaccess/source/ui/misc/uiservices.cxx +++ b/dbaccess/source/ui/misc/uiservices.cxx @@ -26,7 +26,9 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::registry; -extern "C" void createRegistryInfo_DBU() +extern "C" { + +static void createRegistryInfo_DBU() { static bool bInit = false; if (!bInit) @@ -59,6 +61,8 @@ extern "C" void createRegistryInfo_DBU() } } +} + extern "C" SAL_DLLPUBLIC_EXPORT void* dbu_component_getFactory( const sal_Char* pImplementationName, void* pServiceManager, diff --git a/dbaccess/source/ui/querydesign/ConnectionLine.cxx b/dbaccess/source/ui/querydesign/ConnectionLine.cxx index 158b6c88beea..f9aaceaabdfe 100644 --- a/dbaccess/source/ui/querydesign/ConnectionLine.cxx +++ b/dbaccess/source/ui/querydesign/ConnectionLine.cxx @@ -191,14 +191,14 @@ tools::Rectangle OConnectionLine::GetBoundingRect() return aBoundingRect; } -void calcPointX1(const OTableWindow* _pWin,Point& _rNewConPos,Point& _rNewDescrPos) +static void calcPointX1(const OTableWindow* _pWin,Point& _rNewConPos,Point& _rNewDescrPos) { _rNewConPos.setX( _pWin->GetPosPixel().X() + _pWin->GetSizePixel().Width() ); _rNewDescrPos.setX( _rNewConPos.X() ); _rNewConPos.AdjustX(DESCRIPT_LINE_WIDTH ); } -void calcPointX2(const OTableWindow* _pWin,Point& _rNewConPos,Point& _rNewDescrPos) +static void calcPointX2(const OTableWindow* _pWin,Point& _rNewConPos,Point& _rNewDescrPos) { _rNewConPos.setX( _pWin->GetPosPixel().X() ); _rNewDescrPos.setX( _rNewConPos.X() ); @@ -292,7 +292,7 @@ bool OConnectionLine::IsValid() const return m_pData.is(); } -double dist_Euklid(const Point &p1, const Point& p2,const Point& pM, Point& q) +static double dist_Euklid(const Point &p1, const Point& p2,const Point& pM, Point& q) { Point v(p2 - p1); Point w(pM - p1); diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx b/dbaccess/source/ui/querydesign/QueryTableView.cxx index 58d0fe320cb4..81573f0498a7 100644 --- a/dbaccess/source/ui/querydesign/QueryTableView.cxx +++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx @@ -363,7 +363,7 @@ void OQueryTableView::AddTabWin(const OUString& _rTableName, const OUString& _rA } // find the table which has a foreign key with this referencedTable name -Reference<XPropertySet> getKeyReferencedTo(const Reference<XIndexAccess>& _rxKeys,const OUString& _rReferencedTable) +static Reference<XPropertySet> getKeyReferencedTo(const Reference<XIndexAccess>& _rxKeys,const OUString& _rReferencedTable) { if(!_rxKeys.is()) return Reference<XPropertySet>(); diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx index 2e5596c259ff..a606c589bcc8 100644 --- a/desktop/source/app/officeipcthread.cxx +++ b/desktop/source/app/officeipcthread.cxx @@ -237,7 +237,7 @@ rtl::Reference< RequestHandler > RequestHandler::pGlobal; // Turns a string in aMsg such as file:///home/foo/.libreoffice/3 // Into a hex string of well known length ff132a86... -OUString CreateMD5FromString( const OUString& aMsg ) +static OUString CreateMD5FromString( const OUString& aMsg ) { SAL_INFO("desktop.app", "create md5 from '" << aMsg << "'"); @@ -287,12 +287,12 @@ IMPL_STATIC_LINK( ProcessEventsClass_Impl, ProcessDocumentsEvent, void*, pEvent, delete pDocsRequest; } -void ImplPostForeignAppEvent( ApplicationEvent* pEvent ) +static void ImplPostForeignAppEvent( ApplicationEvent* pEvent ) { Application::PostUserEvent( LINK( nullptr, ProcessEventsClass_Impl, CallEvent ), pEvent ); } -void ImplPostProcessDocumentsEvent( ProcessDocumentsRequest* pEvent ) +static void ImplPostProcessDocumentsEvent( ProcessDocumentsRequest* pEvent ) { Application::PostUserEvent( LINK( nullptr, ProcessEventsClass_Impl, ProcessDocumentsEvent ), pEvent ); } diff --git a/desktop/source/app/opencl.cxx b/desktop/source/app/opencl.cxx index ed58733e8ab6..5c991842b94f 100644 --- a/desktop/source/app/opencl.cxx +++ b/desktop/source/app/opencl.cxx @@ -45,7 +45,7 @@ namespace desktop { #if HAVE_FEATURE_OPENCL -bool testOpenCLCompute(const Reference< XDesktop2 > &xDesktop, const OUString &rURL) +static bool testOpenCLCompute(const Reference< XDesktop2 > &xDesktop, const OUString &rURL) { bool bSuccess = false; css::uno::Reference< css::lang::XComponent > xComponent; diff --git a/desktop/source/deployment/gui/dp_gui_service.cxx b/desktop/source/deployment/gui/dp_gui_service.cxx index 4393029537e8..17bbd81131df 100644 --- a/desktop/source/deployment/gui/dp_gui_service.cxx +++ b/desktop/source/deployment/gui/dp_gui_service.cxx @@ -97,7 +97,7 @@ namespace : public rtl::Static< OUString, Extension > {}; } -OUString ReplaceProductNameHookProc( const OUString& rStr ) +static OUString ReplaceProductNameHookProc( const OUString& rStr ) { if (rStr.indexOf( "%PRODUCT" ) == -1) return rStr; diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx index b231dac760ec..9ccb179747c9 100644 --- a/desktop/source/deployment/misc/dp_misc.cxx +++ b/desktop/source/deployment/misc/dp_misc.cxx @@ -472,7 +472,7 @@ void writeConsoleWithStream(OUString const & sText, HANDLE stream) sText.getLength() * 2, &nWrittenChars, nullptr); } #else -void writeConsoleWithStream(OUString const & sText, FILE * stream) +static void writeConsoleWithStream(OUString const & sText, FILE * stream) { OString s = OUStringToOString(sText, osl_getThreadTextEncoding()); fprintf(stream, "%s", s.getStr()); diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx index 622515d3e179..ce32432e2dcf 100644 --- a/desktop/source/migration/migration.cxx +++ b/desktop/source/migration/migration.cxx @@ -78,7 +78,7 @@ static const char ITEM_DESCRIPTOR_COMMANDURL[] = "CommandURL"; static const char ITEM_DESCRIPTOR_CONTAINER[] = "ItemDescriptorContainer"; static const char ITEM_DESCRIPTOR_LABEL[] = "Label"; -OUString retrieveLabelFromCommand(const OUString& sCommand, const OUString& sModuleIdentifier) +static OUString retrieveLabelFromCommand(const OUString& sCommand, const OUString& sModuleIdentifier) { OUString sLabel; @@ -116,7 +116,7 @@ OUString retrieveLabelFromCommand(const OUString& sCommand, const OUString& sMod return sLabel; } -OUString mapModuleShortNameToIdentifier(const OUString& sShortName) +static OUString mapModuleShortNameToIdentifier(const OUString& sShortName) { OUString sIdentifier; diff --git a/desktop/source/migration/services/wordbookmigration.cxx b/desktop/source/migration/services/wordbookmigration.cxx index 114e36e55325..202b883d11ee 100644 --- a/desktop/source/migration/services/wordbookmigration.cxx +++ b/desktop/source/migration/services/wordbookmigration.cxx @@ -105,7 +105,7 @@ namespace migration } #define MAX_HEADER_LENGTH 16 -bool IsUserWordbook( const OUString& rFile ) +static bool IsUserWordbook( const OUString& rFile ) { bool bRet = false; std::unique_ptr<SvStream> pStream = ::utl::UcbStreamHelper::CreateStream( rFile, StreamMode::STD_READ ); diff --git a/desktop/source/minidump/minidump.cxx b/desktop/source/minidump/minidump.cxx index f3eefd023b75..85b2374e4ad7 100644 --- a/desktop/source/minidump/minidump.cxx +++ b/desktop/source/minidump/minidump.cxx @@ -19,7 +19,7 @@ static const char kUserAgent[] = "Breakpad/1.0 (Linux)"; -std::map<std::string, std::string> readStrings(std::istream& file) +static std::map<std::string, std::string> readStrings(std::istream& file) { std::map<std::string, std::string> parameters; @@ -52,7 +52,7 @@ static size_t WriteCallback(void const *ptr, size_t size, return real_size; } -void getProperty(const std::string& key, std::string& value, +static void getProperty(const std::string& key, std::string& value, std::map<std::string, std::string>& parameters) { auto itr = parameters.find(key); @@ -63,7 +63,7 @@ void getProperty(const std::string& key, std::string& value, } } -std::string generate_json(const std::map<std::string, std::string>& parameters) +static std::string generate_json(const std::map<std::string, std::string>& parameters) { std::ostringstream stream; stream << "{\n"; @@ -82,7 +82,7 @@ std::string generate_json(const std::map<std::string, std::string>& parameters) return stream.str(); } -bool uploadContent(std::map<std::string, std::string>& parameters, std::string& response) +static bool uploadContent(std::map<std::string, std::string>& parameters, std::string& response) { CURL* curl = curl_easy_init(); if (!curl) diff --git a/desktop/source/offacc/acceptor.cxx b/desktop/source/offacc/acceptor.cxx index 11cbe497290b..13d92c6bd216 100644 --- a/desktop/source/offacc/acceptor.cxx +++ b/desktop/source/offacc/acceptor.cxx @@ -37,13 +37,17 @@ using namespace css::uno; namespace desktop { -extern "C" void offacc_workerfunc (void * acc) +extern "C" { + +static void offacc_workerfunc (void * acc) { osl_setThreadName("URP Acceptor"); static_cast<Acceptor*>(acc)->run(); } +} + Acceptor::Acceptor( const Reference< XComponentContext >& rxContext ) : m_thread(nullptr) , m_rContext(rxContext) diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx index 9fb377f2aef0..4adc21b683d8 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx @@ -291,7 +291,7 @@ void printf_package( } // anon namespace -void printf_unaccepted_licenses( +static void printf_unaccepted_licenses( Reference<deployment::XPackage> const & ext) { OUString id( @@ -396,7 +396,7 @@ Reference<XComponentContext> connectToOffice( /** returns the path to the lock file used by unopkg. @return the path. An empty string signifies an error. */ -OUString getLockFilePath() +static OUString getLockFilePath() { OUString ret; OUString sBootstrap("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}"); diff --git a/desktop/unx/source/pagein.c b/desktop/unx/source/pagein.c index a401419fc162..03aa50d99c9d 100644 --- a/desktop/unx/source/pagein.c +++ b/desktop/unx/source/pagein.c @@ -45,7 +45,7 @@ static void do_pagein (const char * filename) file_image_close (&image); } -int isRotational(char const * path) +static int isRotational(char const * path) { int ret = 1; #ifdef LINUX diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c index b32034517318..e3e5441bf97e 100644 --- a/desktop/unx/source/start.c +++ b/desktop/unx/source/start.c @@ -567,7 +567,7 @@ static void system_checks(void) #endif } -void exec_pagein (Args *args) +static void exec_pagein (Args *args) { rtl_String * path = ustr_to_str(args->pAppPath); pagein_execute(rtl_string_getStr(path), "pagein-common"); @@ -714,7 +714,7 @@ static void exec_javaldx(Args *args) // has to be a global :( static oslProcess * volatile g_pProcess = NULL; -void sigterm_handler(int ignored) +static void sigterm_handler(int ignored) { (void) ignored; diff --git a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx index 56a85cd65038..4c7bf9743628 100644 --- a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx @@ -89,7 +89,7 @@ namespace drawinglayer } // helper to add a centered, maybe stroked line primitive to rContainer - void addPolygonStrokePrimitive2D( + static void addPolygonStrokePrimitive2D( Primitive2DContainer& rContainer, const basegfx::B2DPoint& rStart, const basegfx::B2DPoint& rEnd, diff --git a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx index 2350f28699fc..ea2e9c9aede6 100644 --- a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx @@ -28,6 +28,8 @@ #include <com/sun/star/drawing/LineCap.hpp> #include <comphelper/random.hxx> +#include <converters.hxx> + using namespace com::sun::star; using namespace std; diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx index 9d07e1683d2f..ccef3e685cbb 100644 --- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx +++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx @@ -133,7 +133,7 @@ namespace drawinglayer namespace primitive2d { // static methods here - VirtualDevice& acquireGlobalVirtualDevice() + static VirtualDevice& acquireGlobalVirtualDevice() { scoped_timed_RefDev& rStdRefDevice = the_scoped_timed_RefDev::get(); @@ -143,7 +143,7 @@ namespace drawinglayer return rStdRefDevice->acquireVirtualDevice(); } - void releaseGlobalVirtualDevice() + static void releaseGlobalVirtualDevice() { scoped_timed_RefDev& rStdRefDevice = the_scoped_timed_RefDev::get(); diff --git a/drawinglayer/source/tools/wmfemfhelper.cxx b/drawinglayer/source/tools/wmfemfhelper.cxx index 2576bfdf510c..265c7e0d6703 100644 --- a/drawinglayer/source/tools/wmfemfhelper.cxx +++ b/drawinglayer/source/tools/wmfemfhelper.cxx @@ -435,7 +435,7 @@ namespace namespace wmfemfhelper { /** helper to create a PointArrayPrimitive2D based on current context */ - void createPointArrayPrimitive( + static void createPointArrayPrimitive( const std::vector< basegfx::B2DPoint >& rPositions, TargetHolder& rTarget, PropertyHolder const & rProperties, @@ -468,7 +468,7 @@ namespace wmfemfhelper } /** helper to create a PolygonHairlinePrimitive2D based on current context */ - void createHairlinePrimitive( + static void createHairlinePrimitive( const basegfx::B2DPolygon& rLinePolygon, TargetHolder& rTarget, PropertyHolder const & rProperties) @@ -485,7 +485,7 @@ namespace wmfemfhelper } /** helper to create a PolyPolygonColorPrimitive2D based on current context */ - void createFillPrimitive( + static void createFillPrimitive( const basegfx::B2DPolyPolygon& rFillPolyPolygon, TargetHolder& rTarget, PropertyHolder const & rProperties) @@ -502,7 +502,7 @@ namespace wmfemfhelper } /** helper to create a PolygonStrokePrimitive2D based on current context */ - void createLinePrimitive( + static void createLinePrimitive( const basegfx::B2DPolygon& rLinePolygon, const LineInfo& rLineInfo, TargetHolder& rTarget, @@ -569,7 +569,7 @@ namespace wmfemfhelper } /** helper to create needed line and fill primitives based on current context */ - void createHairlineAndFillPrimitive( + static void createHairlineAndFillPrimitive( const basegfx::B2DPolygon& rPolygon, TargetHolder& rTarget, PropertyHolder const & rProperties) @@ -586,7 +586,7 @@ namespace wmfemfhelper } /** helper to create needed line and fill primitives based on current context */ - void createHairlineAndFillPrimitive( + static void createHairlineAndFillPrimitive( const basegfx::B2DPolyPolygon& rPolyPolygon, TargetHolder& rTarget, PropertyHolder const & rProperties) @@ -611,7 +611,7 @@ namespace wmfemfhelper position and size in pixels. At the end it will create a view-dependent transformed embedding of a BitmapPrimitive2D. */ - void createBitmapExPrimitive( + static void createBitmapExPrimitive( const BitmapEx& rBitmapEx, const Point& rPoint, TargetHolder& rTarget, @@ -630,7 +630,7 @@ namespace wmfemfhelper } /** helper to create BitmapPrimitive2D based on current context */ - void createBitmapExPrimitive( + static void createBitmapExPrimitive( const BitmapEx& rBitmapEx, const Point& rPoint, const Size& rSize, @@ -659,7 +659,7 @@ namespace wmfemfhelper which use a bitmap without transparence but define one of the colors as transparent) */ - BitmapEx createMaskBmpEx(const Bitmap& rBitmap, const Color& rMaskColor) + static BitmapEx createMaskBmpEx(const Bitmap& rBitmap, const Color& rMaskColor) { const Color aWhite(COL_WHITE); BitmapPalette aBiLevelPalette(2); @@ -678,7 +678,7 @@ namespace wmfemfhelper /** helper to convert from a VCL Gradient definition to the corresponding data for primitive representation */ - drawinglayer::attribute::FillGradientAttribute createFillGradientAttribute(const Gradient& rGradient) + static drawinglayer::attribute::FillGradientAttribute createFillGradientAttribute(const Gradient& rGradient) { const Color aStartColor(rGradient.GetStartColor()); const sal_uInt16 nStartIntens(rGradient.GetStartIntensity()); @@ -750,7 +750,7 @@ namespace wmfemfhelper /** helper to convert from a VCL Hatch definition to the corresponding data for primitive representation */ - drawinglayer::attribute::FillHatchAttribute createFillHatchAttribute(const Hatch& rHatch) + static drawinglayer::attribute::FillHatchAttribute createFillHatchAttribute(const Hatch& rHatch) { drawinglayer::attribute::HatchStyle aHatchStyle(drawinglayer::attribute::HatchStyle::Single); @@ -870,7 +870,7 @@ namespace wmfemfhelper a changing RasterOp is used. Currently, RasterOp::Xor and RasterOp::Invert are supported using InvertPrimitive2D, and RasterOp::N0 by using a ModifiedColorPrimitive2D to force to black paint */ - void HandleNewRasterOp( + static void HandleNewRasterOp( RasterOp aRasterOp, TargetHolders& rTargetHolders, PropertyHolders& rPropertyHolders) @@ -923,7 +923,7 @@ namespace wmfemfhelper /** helper to create needed data to emulate the VCL Wallpaper Metafile action. It is a quite mighty action. This helper is for simple color filled background. */ - std::unique_ptr<drawinglayer::primitive2d::BasePrimitive2D> CreateColorWallpaper( + static std::unique_ptr<drawinglayer::primitive2d::BasePrimitive2D> CreateColorWallpaper( const basegfx::B2DRange& rRange, const basegfx::BColor& rColor, PropertyHolder const & rPropertyHolder) @@ -939,7 +939,7 @@ namespace wmfemfhelper /** helper to create needed data to emulate the VCL Wallpaper Metafile action. It is a quite mighty action. This helper is for gradient filled background. */ - std::unique_ptr<drawinglayer::primitive2d::BasePrimitive2D> CreateGradientWallpaper( + static std::unique_ptr<drawinglayer::primitive2d::BasePrimitive2D> CreateGradientWallpaper( const basegfx::B2DRange& rRange, const Gradient& rGradient, PropertyHolder const & rPropertyHolder) @@ -979,7 +979,7 @@ namespace wmfemfhelper WallpaperBitmapPrimitive2D. This primitive was created for this purpose and takes over all needed logic of orientations and tiling. */ - void CreateAndAppendBitmapWallpaper( + static void CreateAndAppendBitmapWallpaper( basegfx::B2DRange aWallpaperRange, const Wallpaper& rWallpaper, TargetHolder& rTarget, @@ -1043,7 +1043,7 @@ namespace wmfemfhelper } /** helper to decide UnderlineAbove for text primitives */ - bool isUnderlineAbove(const vcl::Font& rFont) + static bool isUnderlineAbove(const vcl::Font& rFont) { if(!rFont.IsVertical()) { @@ -1059,7 +1059,7 @@ namespace wmfemfhelper return false; } - void createFontAttributeTransformAndAlignment( + static void createFontAttributeTransformAndAlignment( drawinglayer::attribute::FontAttribute& rFontAttribute, basegfx::B2DHomMatrix& rTextTransform, basegfx::B2DVector& rAlignmentOffset, @@ -1106,7 +1106,7 @@ namespace wmfemfhelper /** helper which takes complete care for creating the needed text primitives. It takes care of decorated stuff and all the geometry adaptions needed */ - void processMetaTextAction( + static void processMetaTextAction( const Point& rTextStartPosition, const OUString& rText, sal_uInt16 nTextStart, @@ -1306,7 +1306,7 @@ namespace wmfemfhelper } /** helper which takes complete care for creating the needed textLine primitives */ - void proccessMetaTextLineAction( + static void proccessMetaTextLineAction( const MetaTextLineAction& rAction, TargetHolder& rTarget, PropertyHolder const & rProperty) @@ -1471,7 +1471,7 @@ namespace wmfemfhelper For more comments, see the single action implementations. */ - void implInterpretMetafile( + static void implInterpretMetafile( const GDIMetaFile& rMetaFile, TargetHolders& rTargetHolders, PropertyHolders& rPropertyHolders, diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx index 085f7b3062e6..bb796458482d 100644 --- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx +++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx @@ -83,7 +83,7 @@ using namespace ::com::sun::star::accessibility; namespace accessibility { - const SvxItemPropertySet* ImplGetSvxCharAndParaPropertiesSet() + static const SvxItemPropertySet* ImplGetSvxCharAndParaPropertiesSet() { // PropertyMap for character and paragraph properties static const SfxItemPropertyMapEntry aPropMap[] = diff --git a/editeng/source/accessibility/AccessibleStaticTextBase.cxx b/editeng/source/accessibility/AccessibleStaticTextBase.cxx index e080ae4468af..f8fd3c1a7b24 100644 --- a/editeng/source/accessibility/AccessibleStaticTextBase.cxx +++ b/editeng/source/accessibility/AccessibleStaticTextBase.cxx @@ -83,7 +83,7 @@ namespace accessibility // Static Helper - ESelection MakeSelection( sal_Int32 nStartPara, sal_Int32 nStartIndex, + static ESelection MakeSelection( sal_Int32 nStartPara, sal_Int32 nStartIndex, sal_Int32 nEndPara, sal_Int32 nEndIndex ) { DBG_ASSERT(nStartPara >= 0 && diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx index 0c97c465c441..3c1168901a24 100644 --- a/editeng/source/editeng/editobj.cxx +++ b/editeng/source/editeng/editobj.cxx @@ -60,7 +60,7 @@ using std::endl; using namespace com::sun::star; -std::unique_ptr<XEditAttribute> MakeXEditAttribute( SfxItemPool& rPool, const SfxPoolItem& rItem, sal_Int32 nStart, sal_Int32 nEnd ) +static std::unique_ptr<XEditAttribute> MakeXEditAttribute( SfxItemPool& rPool, const SfxPoolItem& rItem, sal_Int32 nStart, sal_Int32 nEnd ) { // Create thw new attribute in the pool const SfxPoolItem& rNew = rPool.Put( rItem ); @@ -481,7 +481,7 @@ void EditTextObjectImpl::Dump() const } #endif -EditEngineItemPool* getEditEngineItemPool(SfxItemPool* pPool) +static EditEngineItemPool* getEditEngineItemPool(SfxItemPool* pPool) { EditEngineItemPool* pRetval = dynamic_cast< EditEngineItemPool* >(pPool); diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index 818722b34f57..7d14198c67b2 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -155,7 +155,7 @@ void ImpEditView::SetEditSelection( const EditSelection& rEditSelection ) } /// Translate absolute <-> relative twips: LOK wants absolute coordinates as output and gives absolute coordinates as input. -void lcl_translateTwips(vcl::Window const & rParent, vcl::Window& rChild) +static void lcl_translateTwips(vcl::Window const & rParent, vcl::Window& rChild) { // Don't translate if we already have a non-zero origin. // This prevents multiple translate calls that negate diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index b92feac5ea55..d34b797bc7a2 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -1389,7 +1389,7 @@ SvxBoxItem& SvxBoxItem::operator=( const SvxBoxItem& rBox ) } -inline bool CmpBrdLn( const std::unique_ptr<SvxBorderLine> & pBrd1, const SvxBorderLine* pBrd2 ) +static inline bool CmpBrdLn( const std::unique_ptr<SvxBorderLine> & pBrd1, const SvxBorderLine* pBrd2 ) { if( pBrd1.get() == pBrd2 ) return true; diff --git a/editeng/source/items/paperinf.cxx b/editeng/source/items/paperinf.cxx index 63066ed180fd..b528acb693d3 100644 --- a/editeng/source/items/paperinf.cxx +++ b/editeng/source/items/paperinf.cxx @@ -25,7 +25,7 @@ Description: Is the printer valid --------------------------------------------------------------------*/ -inline bool IsValidPrinter( const Printer* pPtr ) +static inline bool IsValidPrinter( const Printer* pPtr ) { return !pPtr->GetName().isEmpty(); } diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 20e64bbadf1c..91b558c756ce 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -104,7 +104,7 @@ static const sal_Char /* also at these ends - Brackets and all kinds of begin characters */ sImplEndSkipChars[] = "\"\')]}\x83\x84\x89\x91\x92\x93\x94"; -OUString EncryptBlockName_Imp(const OUString& rName); +static OUString EncryptBlockName_Imp(const OUString& rName); static inline bool NonFieldWordDelim( const sal_Unicode c ) { @@ -130,7 +130,7 @@ static inline bool IsUpperLetter( sal_Int32 nCharType ) ( css::i18n::KCharacterType::UPPER & nCharType); } -bool lcl_IsUnsupportedUnicodeChar( CharClass const & rCC, const OUString& rTxt, +static bool lcl_IsUnsupportedUnicodeChar( CharClass const & rCC, const OUString& rTxt, sal_Int32 nStt, sal_Int32 nEnd ) { for( ; nStt < nEnd; ++nStt ) diff --git a/editeng/source/rtf/rtfitem.cxx b/editeng/source/rtf/rtfitem.cxx index 8d12c04e0394..ef0586291479 100644 --- a/editeng/source/rtf/rtfitem.cxx +++ b/editeng/source/rtf/rtfitem.cxx @@ -1548,7 +1548,7 @@ void SvxRTFParser::ReadBorderAttr( int nToken, SfxItemSet& rSet, SkipToken(); } -inline sal_uInt32 CalcShading( sal_uInt32 nColor, sal_uInt32 nFillColor, sal_uInt8 nShading ) +static inline sal_uInt32 CalcShading( sal_uInt32 nColor, sal_uInt32 nFillColor, sal_uInt8 nShading ) { nColor = (nColor * nShading) / 100; nFillColor = (nFillColor * ( 100 - nShading )) / 100; diff --git a/editeng/source/uno/unoedprx.cxx b/editeng/source/uno/unoedprx.cxx index f647de146794..6a109d0c19b0 100644 --- a/editeng/source/uno/unoedprx.cxx +++ b/editeng/source/uno/unoedprx.cxx @@ -119,7 +119,7 @@ private: bool mbInBullet; }; -ESelection MakeEESelection( const SvxAccessibleTextIndex& rStart, const SvxAccessibleTextIndex& rEnd ) +static ESelection MakeEESelection( const SvxAccessibleTextIndex& rStart, const SvxAccessibleTextIndex& rEnd ) { // deal with field special case: to really get a field contained // within a selection, the start index must be before or on the @@ -152,7 +152,7 @@ ESelection MakeEESelection( const SvxAccessibleTextIndex& rStart, const SvxAcces rEnd.GetParagraph(), rEnd.GetEEIndex() ); } -ESelection MakeEESelection( const SvxAccessibleTextIndex& rIndex ) +static ESelection MakeEESelection( const SvxAccessibleTextIndex& rIndex ) { return ESelection( rIndex.GetParagraph(), rIndex.GetEEIndex(), rIndex.GetParagraph(), rIndex.GetEEIndex() + 1 ); diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx index 7dacb0625390..0ff93ac2ef83 100644 --- a/editeng/source/uno/unofield.cxx +++ b/editeng/source/uno/unofield.cxx @@ -67,7 +67,7 @@ public: OUString msPresentation; }; -const SfxItemPropertySet* ImplGetFieldItemPropertySet( sal_Int32 mnId ) +static const SfxItemPropertySet* ImplGetFieldItemPropertySet( sal_Int32 mnId ) { static const SfxItemPropertyMapEntry aExDateTimeFieldPropertyMap_Impl[] = { @@ -203,7 +203,7 @@ static util::DateTime getDate( sal_Int32 nDate ) return aDate; } -inline Date setDate( util::DateTime const & rDate ) +static inline Date setDate( util::DateTime const & rDate ) { return Date( rDate.Day, rDate.Month, rDate.Year ); } @@ -222,7 +222,7 @@ static util::DateTime getTime(sal_Int64 const nTime) return aTime; } -inline tools::Time setTime( util::DateTime const & rDate ) +static inline tools::Time setTime( util::DateTime const & rDate ) { return tools::Time( rDate ); } diff --git a/editeng/source/uno/unoipset.cxx b/editeng/source/uno/unoipset.cxx index 320ccc5a9916..456ac6358115 100644 --- a/editeng/source/uno/unoipset.cxx +++ b/editeng/source/uno/unoipset.cxx @@ -79,7 +79,7 @@ void SvxItemPropertySet::ClearAllUsrAny() } -bool SvxUnoCheckForPositiveValue( const uno::Any& rVal ) +static bool SvxUnoCheckForPositiveValue( const uno::Any& rVal ) { bool bConvert = true; // the default is that all metric items must be converted sal_Int32 nValue = 0; diff --git a/editeng/source/uno/unonrule.cxx b/editeng/source/uno/unonrule.cxx index 74ac1596146a..1f5c104fca9f 100644 --- a/editeng/source/uno/unonrule.cxx +++ b/editeng/source/uno/unonrule.cxx @@ -72,13 +72,13 @@ const o3tl::enumarray<SvxAdjust, unsigned short> aSvxToUnoAdjust text::HoriOrientation::LEFT }; -SvxAdjust ConvertUnoAdjust( unsigned short nAdjust ) +static SvxAdjust ConvertUnoAdjust( unsigned short nAdjust ) { DBG_ASSERT( nAdjust <= 7, "Enum has changed! [CL]" ); return aUnoToSvxAdjust[nAdjust]; } -unsigned short ConvertUnoAdjust( SvxAdjust eAdjust ) +static unsigned short ConvertUnoAdjust( SvxAdjust eAdjust ) { DBG_ASSERT( static_cast<int>(eAdjust) <= 6, "Enum has changed! [CL]" ); return aSvxToUnoAdjust[eAdjust]; diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx index 5d105afbdf71..f1b48747669b 100644 --- a/editeng/source/uno/unotext.cxx +++ b/editeng/source/uno/unotext.cxx @@ -100,7 +100,7 @@ const SvxItemPropertySet* ImplGetSvxTextPortionSvxPropertySet() return &aSvxTextPortionPropertySet; } -const SfxItemPropertySet* ImplGetSvxTextPortionSfxPropertySet() +static const SfxItemPropertySet* ImplGetSvxTextPortionSfxPropertySet() { static SfxItemPropertySet aSvxTextPortionSfxPropertySet( ImplGetSvxTextPortionPropertyMap() ); return &aSvxTextPortionSfxPropertySet; @@ -122,7 +122,7 @@ const SfxItemPropertyMapEntry* ImplGetSvxUnoOutlinerTextCursorPropertyMap() return aSvxUnoOutlinerTextCursorPropertyMap; } -const SfxItemPropertySet* ImplGetSvxUnoOutlinerTextCursorSfxPropertySet() +static const SfxItemPropertySet* ImplGetSvxUnoOutlinerTextCursorSfxPropertySet() { static SfxItemPropertySet aTextCursorSfxPropertySet( ImplGetSvxUnoOutlinerTextCursorPropertyMap() ); return &aTextCursorSfxPropertySet; @@ -194,7 +194,7 @@ void CheckSelection( struct ESelection& rSel, SvxTextForwarder const * pForwarde } } -void CheckSelection( struct ESelection& rSel, SvxEditSource *pEdit ) throw() +static void CheckSelection( struct ESelection& rSel, SvxEditSource *pEdit ) throw() { if (!pEdit) return; @@ -1970,7 +1970,7 @@ void SAL_CALL SvxUnoTextBase::moveTextRange( const uno::Reference< text::XTextRa /// @throws lang::IllegalArgumentException /// @throws beans::UnknownPropertyException /// @throws uno::RuntimeException -void SvxPropertyValuesToItemSet( +static void SvxPropertyValuesToItemSet( SfxItemSet &rItemSet, const uno::Sequence< beans::PropertyValue >& rPropertyVaules, const SfxItemPropertySet *pPropSet, diff --git a/embeddedobj/source/commonembedding/inplaceobj.cxx b/embeddedobj/source/commonembedding/inplaceobj.cxx index 9019482a9c97..c58d53358b66 100644 --- a/embeddedobj/source/commonembedding/inplaceobj.cxx +++ b/embeddedobj/source/commonembedding/inplaceobj.cxx @@ -27,7 +27,7 @@ using namespace ::com::sun::star; -bool RectanglesEqual( const awt::Rectangle& aRect1, const awt::Rectangle& aRect2 ) +static bool RectanglesEqual( const awt::Rectangle& aRect1, const awt::Rectangle& aRect2 ) { return ( aRect1.X == aRect2.X && aRect1.Y == aRect2.Y diff --git a/embeddedobj/source/commonembedding/persistence.cxx b/embeddedobj/source/commonembedding/persistence.cxx index e3693cb06c18..06562ac39682 100644 --- a/embeddedobj/source/commonembedding/persistence.cxx +++ b/embeddedobj/source/commonembedding/persistence.cxx @@ -89,7 +89,7 @@ uno::Sequence< beans::PropertyValue > GetValuableArgs_Impl( const uno::Sequence< } -uno::Sequence< beans::PropertyValue > addAsTemplate( const uno::Sequence< beans::PropertyValue >& aOrig ) +static uno::Sequence< beans::PropertyValue > addAsTemplate( const uno::Sequence< beans::PropertyValue >& aOrig ) { bool bAsTemplateSet = false; sal_Int32 nLength = aOrig.getLength(); @@ -118,7 +118,7 @@ uno::Sequence< beans::PropertyValue > addAsTemplate( const uno::Sequence< beans: } -uno::Reference< io::XInputStream > createTempInpStreamFromStor( +static uno::Reference< io::XInputStream > createTempInpStreamFromStor( const uno::Reference< embed::XStorage >& xStorage, const uno::Reference< uno::XComponentContext >& xContext ) { diff --git a/embeddedobj/source/msole/olepersist.cxx b/embeddedobj/source/msole/olepersist.cxx index d9c2e3024fab..8965c478caf1 100644 --- a/embeddedobj/source/msole/olepersist.cxx +++ b/embeddedobj/source/msole/olepersist.cxx @@ -194,7 +194,7 @@ void SetStreamMediaType_Impl( const uno::Reference< io::XStream >& xStream, cons } #endif -void LetCommonStoragePassBeUsed_Impl( const uno::Reference< io::XStream >& xStream ) +static void LetCommonStoragePassBeUsed_Impl( const uno::Reference< io::XStream >& xStream ) { uno::Reference< beans::XPropertySet > xPropSet( xStream, uno::UNO_QUERY_THROW ); xPropSet->setPropertyValue("UseCommonStoragePasswordEncryption", diff --git a/emfio/source/reader/emfreader.cxx b/emfio/source/reader/emfreader.cxx index f1138d39e23a..35587b17b36c 100644 --- a/emfio/source/reader/emfreader.cxx +++ b/emfio/source/reader/emfreader.cxx @@ -457,12 +457,12 @@ namespace emfio } // these are referenced from inside the templates - SvStream& operator >> (SvStream& rStream, sal_Int16 &n) + static SvStream& operator >> (SvStream& rStream, sal_Int16 &n) { return rStream.ReadInt16(n); } - SvStream& operator >> (SvStream& rStream, sal_Int32 &n) + static SvStream& operator >> (SvStream& rStream, sal_Int32 &n) { return rStream.ReadInt32(n); } diff --git a/eventattacher/source/eventattacher.cxx b/eventattacher/source/eventattacher.cxx index 07e7b317728d..3bb55277c966 100644 --- a/eventattacher/source/eventattacher.cxx +++ b/eventattacher/source/eventattacher.cxx @@ -84,7 +84,7 @@ private: // Function to replace AllListenerAdapterService::createAllListerAdapter -Reference< XInterface > createAllListenerAdapter +static Reference< XInterface > createAllListenerAdapter ( const Reference< XInvocationAdapterFactory2 >& xInvocationAdapterFactory, const Reference< XIdlClass >& xListenerType, @@ -276,7 +276,7 @@ EventAttacherImpl::EventAttacherImpl( const Reference< XComponentContext >& rxCo } /// @throws Exception -Reference< XInterface > EventAttacherImpl_CreateInstance( const Reference< XMultiServiceFactory >& rSMgr ) +static Reference< XInterface > EventAttacherImpl_CreateInstance( const Reference< XMultiServiceFactory >& rSMgr ) { XEventAttacher *pEventAttacher = static_cast<XEventAttacher*>(new EventAttacherImpl( comphelper::getComponentContext(rSMgr) )); diff --git a/extensions/source/abpilot/abpfinalpage.cxx b/extensions/source/abpilot/abpfinalpage.cxx index 7bd03896f0c3..1d4b92c48b80 100644 --- a/extensions/source/abpilot/abpfinalpage.cxx +++ b/extensions/source/abpilot/abpfinalpage.cxx @@ -34,7 +34,7 @@ namespace abp using namespace ::svt; using namespace ::utl; - std::shared_ptr<const SfxFilter> lcl_getBaseFilter() + static std::shared_ptr<const SfxFilter> lcl_getBaseFilter() { std::shared_ptr<const SfxFilter> pFilter = SfxFilter::GetFilterByName("StarOffice XML (Base)"); OSL_ENSURE(pFilter,"Filter: StarOffice XML (Base) could not be found!"); diff --git a/extensions/source/abpilot/datasourcehandling.cxx b/extensions/source/abpilot/datasourcehandling.cxx index 06db84fa0d76..da97727d7756 100644 --- a/extensions/source/abpilot/datasourcehandling.cxx +++ b/extensions/source/abpilot/datasourcehandling.cxx @@ -161,7 +161,7 @@ namespace abp return aReturn; } - void lcl_registerDataSource( + static void lcl_registerDataSource( const Reference< XComponentContext >& _rxORB, const OUString& _sName, const OUString& _sURL ) { diff --git a/extensions/source/bibliography/bibload.cxx b/extensions/source/bibliography/bibload.cxx index b9aa15092714..e0bf5b4a2c71 100644 --- a/extensions/source/bibliography/bibload.cxx +++ b/extensions/source/bibliography/bibload.cxx @@ -74,6 +74,8 @@ using namespace ::com::sun::star::form; using namespace ::com::sun::star::container; using namespace ::com::sun::star::frame; +static Reference< XInterface > BibliographyLoader_CreateInstance( const Reference< XMultiServiceFactory > & rSMgr ); + class BibliographyLoader : public cppu::WeakImplHelper < XServiceInfo, XNameAccess, XPropertySet, XFrameLoader > { diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx index 02333733f83d..846cd1ceebbd 100644 --- a/extensions/source/bibliography/datman.cxx +++ b/extensions/source/bibliography/datman.cxx @@ -83,7 +83,7 @@ using namespace ::com::sun::star::form; using namespace ::com::sun::star::frame; using namespace ::com::sun::star::lang; -Reference< XConnection > getConnection(const OUString& _rURL) +static Reference< XConnection > getConnection(const OUString& _rURL) { // first get the sdb::DataSource corresponding to the url Reference< XDataSource > xDataSource; @@ -124,7 +124,7 @@ Reference< XConnection > getConnection(const OUString& _rURL) return xConn; } -Reference< XConnection > getConnection(const Reference< XInterface > & xRowSet) +static Reference< XConnection > getConnection(const Reference< XInterface > & xRowSet) { Reference< XConnection > xConn; try @@ -147,7 +147,7 @@ Reference< XConnection > getConnection(const Reference< XInterface > & xRowSe return xConn; } -Reference< XNameAccess > getColumns(const Reference< XForm > & _rxForm) +static Reference< XNameAccess > getColumns(const Reference< XForm > & _rxForm) { Reference< XNameAccess > xReturn; // check if the form is alive diff --git a/extensions/source/bibliography/framectr.cxx b/extensions/source/bibliography/framectr.cxx index 7f6e188c14bc..b6bd50f6e67b 100644 --- a/extensions/source/bibliography/framectr.cxx +++ b/extensions/source/bibliography/framectr.cxx @@ -100,7 +100,7 @@ static const DispatchInfo SupportedCommandsArray[] = typedef std::unordered_map< OUString, CacheDispatchInfo > CmdToInfoCache; -const CmdToInfoCache& GetCommandToInfoCache() +static const CmdToInfoCache& GetCommandToInfoCache() { static bool bCacheInitialized = false; static CmdToInfoCache aCmdToInfoCache; @@ -318,7 +318,7 @@ uno::Sequence< frame::DispatchInformation > SAL_CALL BibFrameController_Impl::ge return comphelper::containerToSequence( aDispatchInfoVector ); } -bool canInsertRecords(const Reference< beans::XPropertySet>& _rxCursorSet) +static bool canInsertRecords(const Reference< beans::XPropertySet>& _rxCursorSet) { sal_Int32 nPriv = 0; _rxCursorSet->getPropertyValue("Privileges") >>= nPriv; diff --git a/extensions/source/dbpilots/dbpservices.cxx b/extensions/source/dbpilots/dbpservices.cxx index bba456bfa4fd..054924b5aa04 100644 --- a/extensions/source/dbpilots/dbpservices.cxx +++ b/extensions/source/dbpilots/dbpservices.cxx @@ -24,7 +24,9 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::registry; -extern "C" void dbp_initializeModule() +extern "C" { + +static void dbp_initializeModule() { static bool s_bInit = false; if (!s_bInit) @@ -36,6 +38,7 @@ extern "C" void dbp_initializeModule() } } +} extern "C" SAL_DLLPUBLIC_EXPORT void* dbp_component_getFactory( const sal_Char* pImplementationName, diff --git a/extensions/source/propctrlr/pcrservices.cxx b/extensions/source/propctrlr/pcrservices.cxx index 1ef0353ae1c6..eb4368bb7da4 100644 --- a/extensions/source/propctrlr/pcrservices.cxx +++ b/extensions/source/propctrlr/pcrservices.cxx @@ -25,7 +25,9 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::registry; -extern "C" void pcr_initializeModule() +extern "C" { + +static void pcr_initializeModule() { static bool s_bInit = false; if (!s_bInit) @@ -53,6 +55,7 @@ extern "C" void pcr_initializeModule() } } +} extern "C" SAL_DLLPUBLIC_EXPORT void* pcr_component_getFactory( const sal_Char* pImplementationName, diff --git a/extensions/source/propctrlr/propertycomposer.cxx b/extensions/source/propctrlr/propertycomposer.cxx index 5f97a759ef6f..19d5230ee274 100644 --- a/extensions/source/propctrlr/propertycomposer.cxx +++ b/extensions/source/propctrlr/propertycomposer.cxx @@ -250,7 +250,7 @@ namespace pcr } - void uniteStringArrays( const PropertyComposer::HandlerArray& _rHandlers, Sequence< OUString > (SAL_CALL XPropertyHandler::*pGetter)( void ), + static void uniteStringArrays( const PropertyComposer::HandlerArray& _rHandlers, Sequence< OUString > (SAL_CALL XPropertyHandler::*pGetter)( void ), Sequence< OUString >& /* [out] */ _rUnion ) { std::set< OUString > aUnitedBag; diff --git a/extensions/source/propctrlr/stringrepresentation.cxx b/extensions/source/propctrlr/stringrepresentation.cxx index 208a0d27b183..bdca73fe13fc 100644 --- a/extensions/source/propctrlr/stringrepresentation.cxx +++ b/extensions/source/propctrlr/stringrepresentation.cxx @@ -54,9 +54,9 @@ namespace comp_StringRepresentation { using namespace ::com::sun::star; // component and service helper functions: -OUString _getImplementationName(); -uno::Sequence< OUString > _getSupportedServiceNames(); -uno::Reference< uno::XInterface > _create( uno::Reference< uno::XComponentContext > const & context ); +static OUString _getImplementationName(); +static uno::Sequence< OUString > _getSupportedServiceNames(); +static uno::Reference< uno::XInterface > _create( uno::Reference< uno::XComponentContext > const & context ); } // closing component helper namespace diff --git a/extensions/source/propctrlr/xsddatatypes.cxx b/extensions/source/propctrlr/xsddatatypes.cxx index 8334af630701..9403117e685f 100644 --- a/extensions/source/propctrlr/xsddatatypes.cxx +++ b/extensions/source/propctrlr/xsddatatypes.cxx @@ -36,7 +36,7 @@ namespace pcr using namespace ::com::sun::star::beans; template< typename INTERFACE, typename ARGUMENT > - ARGUMENT getSave( INTERFACE* pObject, ARGUMENT ( SAL_CALL INTERFACE::*pGetter )( ) ) + static ARGUMENT getSave( INTERFACE* pObject, ARGUMENT ( SAL_CALL INTERFACE::*pGetter )( ) ) { ARGUMENT aReturn = ARGUMENT(); try diff --git a/extensions/source/scanner/sane.cxx b/extensions/source/scanner/sane.cxx index 0be0c0a19d93..1231037d712d 100644 --- a/extensions/source/scanner/sane.cxx +++ b/extensions/source/scanner/sane.cxx @@ -40,7 +40,7 @@ #else #define dump_state( a, b, c, d ) ; #endif -inline void dbg_msg( const char* pString, ... ) +static inline void dbg_msg( const char* pString, ... ) { #if (OSL_DEBUG_LEVEL > 0) || defined DBG_UTIL va_list ap; diff --git a/extensions/source/update/check/download.cxx b/extensions/source/update/check/download.cxx index 3f137c4c1448..75579ca0f8f2 100644 --- a/extensions/source/update/check/download.cxx +++ b/extensions/source/update/check/download.cxx @@ -203,7 +203,7 @@ Download::getProxyForURL(const OUString& rURL, OString& rHost, sal_Int32& rPort) } -bool curl_run(const OUString& rURL, OutData& out, const OString& aProxyHost, sal_Int32 nProxyPort) +static bool curl_run(const OUString& rURL, OutData& out, const OString& aProxyHost, sal_Int32 nProxyPort) { /* Need to investigate further whether it is necessary to call * curl_global_init or not - leave it for now (as the ftp UCB content diff --git a/filter/source/config/cache/cacheitem.cxx b/filter/source/config/cache/cacheitem.cxx index 1e3b9a42fc6a..a8ac838dee1e 100644 --- a/filter/source/config/cache/cacheitem.cxx +++ b/filter/source/config/cache/cacheitem.cxx @@ -112,7 +112,7 @@ css::uno::Sequence< css::beans::PropertyValue > CacheItem::getAsPackedPropertyVa } -bool isSubSet(const css::uno::Any& aSubSet, +static bool isSubSet(const css::uno::Any& aSubSet, const css::uno::Any& aSet ) { const css::uno::Type& aT1 = aSubSet.getValueType(); diff --git a/filter/source/flash/swffilter.cxx b/filter/source/flash/swffilter.cxx index 8812065fd744..77ba50328163 100644 --- a/filter/source/flash/swffilter.cxx +++ b/filter/source/flash/swffilter.cxx @@ -183,7 +183,7 @@ FlashExportFilter::FlashExportFilter(const Reference< XComponentContext > &rxCon { } -OUString exportBackground(FlashExporter &aFlashExporter, const Reference< XDrawPage >& xDrawPage, const OUString& sPath, sal_uInt32 nPage, const char* suffix) +static OUString exportBackground(FlashExporter &aFlashExporter, const Reference< XDrawPage >& xDrawPage, const OUString& sPath, sal_uInt32 nPage, const char* suffix) { OUString filename = "slide" + OUString::number(nPage+1) + OUString::createFromAscii(suffix) + ".swf"; OUString fullpath = sPath + "/" + filename; @@ -207,7 +207,7 @@ OUString exportBackground(FlashExporter &aFlashExporter, const Reference< XDrawP } template <typename TYPE> -TYPE findPropertyValue(const Sequence< PropertyValue >& aPropertySequence, const sal_Char* name, TYPE def) +static TYPE findPropertyValue(const Sequence< PropertyValue >& aPropertySequence, const sal_Char* name, TYPE def) { TYPE temp = TYPE(); diff --git a/filter/source/flash/swfwriter.cxx b/filter/source/flash/swfwriter.cxx index e2478ffd6b96..6e6ea996b82f 100644 --- a/filter/source/flash/swfwriter.cxx +++ b/filter/source/flash/swfwriter.cxx @@ -94,7 +94,7 @@ Writer::~Writer() } -void ImplCopySvStreamToXOutputStream( SvStream& rIn, Reference< XOutputStream > const &xOut ) +static void ImplCopySvStreamToXOutputStream( SvStream& rIn, Reference< XOutputStream > const &xOut ) { sal_uInt32 nBufferSize = 64*1024; diff --git a/filter/source/flash/swfwriter1.cxx b/filter/source/flash/swfwriter1.cxx index 067f238bd31c..77af4c859fa6 100644 --- a/filter/source/flash/swfwriter1.cxx +++ b/filter/source/flash/swfwriter1.cxx @@ -353,7 +353,7 @@ void Writer::setClipping( const tools::PolyPolygon* pClipPolyPolygon ) // differences in font that actually require different glyphs to be defined, // and some that don't. This function is meant to capture all the differences // that we care about. -bool compare_fonts_for_me(const vcl::Font& rFont1, const vcl::Font& rFont2) +static bool compare_fonts_for_me(const vcl::Font& rFont1, const vcl::Font& rFont2) { return rFont1.GetFamilyName() == rFont2.GetFamilyName() && rFont1.GetWeight() == rFont2.GetWeight() && diff --git a/filter/source/flash/swfwriter2.cxx b/filter/source/flash/swfwriter2.cxx index 512e34654753..2b7a4bbee717 100644 --- a/filter/source/flash/swfwriter2.cxx +++ b/filter/source/flash/swfwriter2.cxx @@ -28,7 +28,7 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::io; -sal_uInt16 getMaxBitsUnsigned( sal_uInt32 nValue ) +static sal_uInt16 getMaxBitsUnsigned( sal_uInt32 nValue ) { sal_uInt16 nBits = 0; @@ -484,7 +484,7 @@ FillStyle::FillStyle( sal_uInt16 nBitmapId, bool bClipped, const ::basegfx::B2DH } -FillStyle::FillStyleType Impl_getFillStyleType( const Gradient& rGradient ) +static FillStyle::FillStyleType Impl_getFillStyleType( const Gradient& rGradient ) { switch( rGradient.GetStyle() ) { diff --git a/filter/source/graphicfilter/idxf/dxfgrprd.cxx b/filter/source/graphicfilter/idxf/dxfgrprd.cxx index 3ae2f7db8b5c..79520d18c655 100644 --- a/filter/source/graphicfilter/idxf/dxfgrprd.cxx +++ b/filter/source/graphicfilter/idxf/dxfgrprd.cxx @@ -27,7 +27,7 @@ // a 0-sign occurs; this function converts 0-signs to blanks and reads // a complete line until a cr/lf is found -OString DXFReadLine(SvStream& rIStm) +static OString DXFReadLine(SvStream& rIStm) { char buf[256 + 1]; bool bEnd = false; @@ -84,7 +84,7 @@ OString DXFReadLine(SvStream& rIStm) return aBuf.makeStringAndClear(); } -void DXFSkipLine(SvStream& rIStm) +static void DXFSkipLine(SvStream& rIStm) { while (rIStm.good()) { diff --git a/filter/source/graphicfilter/ieps/ieps.cxx b/filter/source/graphicfilter/ieps/ieps.cxx index 6b047eef7ed5..cd247a23e110 100644 --- a/filter/source/graphicfilter/ieps/ieps.cxx +++ b/filter/source/graphicfilter/ieps/ieps.cxx @@ -408,7 +408,7 @@ static bool RenderAsBMP(const sal_uInt8* pBuf, sal_uInt32 nBytesRead, Graphic &r // this method adds a replacement action containing the original wmf or tiff replacement, // so the original eps can be written when storing to ODF. -void CreateMtfReplacementAction( GDIMetaFile& rMtf, SvStream& rStrm, sal_uInt32 nOrigPos, sal_uInt32 nPSSize, +static void CreateMtfReplacementAction( GDIMetaFile& rMtf, SvStream& rStrm, sal_uInt32 nOrigPos, sal_uInt32 nPSSize, sal_uInt32 nPosWMF, sal_uInt32 nSizeWMF, sal_uInt32 nPosTIFF, sal_uInt32 nSizeTIFF ) { OString aComment("EPSReplacementGraphic"); @@ -449,7 +449,7 @@ void CreateMtfReplacementAction( GDIMetaFile& rMtf, SvStream& rStrm, sal_uInt32 } //there is no preview -> make a red box -void MakePreview(sal_uInt8* pBuf, sal_uInt32 nBytesRead, +static void MakePreview(sal_uInt8* pBuf, sal_uInt32 nBytesRead, long nWidth, long nHeight, Graphic &rGraphic) { GDIMetaFile aMtf; diff --git a/filter/source/graphicfilter/ipict/shape.cxx b/filter/source/graphicfilter/ipict/shape.cxx index 772632041a51..f9bae2acd4eb 100644 --- a/filter/source/graphicfilter/ipict/shape.cxx +++ b/filter/source/graphicfilter/ipict/shape.cxx @@ -38,7 +38,7 @@ Here, we choose: namespace PictReaderShapePrivate { /** returns an inside rectangle knowing the penSize in order to obtain the ``correct'' position when we draw a frame in wide length*/ - tools::Rectangle contractRectangle(bool drawFrame, tools::Rectangle const &rect, Size const &pSize) { + static tools::Rectangle contractRectangle(bool drawFrame, tools::Rectangle const &rect, Size const &pSize) { if (!drawFrame) return rect; long penSize=(pSize.Width()+pSize.Height())/2; if (2*penSize > rect.Right()-rect.Left()) penSize = (rect.Right()-rect.Left()+1)/2; @@ -51,7 +51,7 @@ namespace PictReaderShapePrivate { namespace PictReaderShape { //--------- draws a horizontal/vertical/small line (by creating a "rectangle/polygon") --------- - bool drawLineHQ(VirtualDevice *dev, Point const &orig, Point const &dest, Size const &pSize) { + static bool drawLineHQ(VirtualDevice *dev, Point const &orig, Point const &dest, Size const &pSize) { long dir[2] = { dest.X()-orig.X(), dest.Y()-orig.Y() }; bool vertic = dir[0] == 0; bool horiz = dir[1] == 0; diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index b5951b441f9c..8eea3a8585ea 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -302,7 +302,9 @@ EscherProperties EscherPropertyContainer::GetOpts() const return aVector; } -extern "C" int EscherPropSortFunc( const void* p1, const void* p2 ) +extern "C" { + +static int EscherPropSortFunc( const void* p1, const void* p2 ) { sal_Int16 nID1 = static_cast<EscherPropSortStruct const *>(p1)->nPropId &~0xc000; sal_Int16 nID2 = static_cast<EscherPropSortStruct const *>(p2)->nPropId &~0xc000; @@ -315,6 +317,8 @@ extern "C" int EscherPropSortFunc( const void* p1, const void* p2 ) return 0; } +} + void EscherPropertyContainer::Commit( SvStream& rSt, sal_uInt16 nVersion, sal_uInt16 nRecType ) { rSt.WriteUInt16( ( nCountCount << 4 ) | ( nVersion & 0xf ) ).WriteUInt16( nRecType ).WriteUInt32( nCountSize ); @@ -1997,7 +2001,7 @@ when save as MS file, the connector must be convert to corresponding type. "standard" <-> "bentConnector2-5" "curve" <-> "curvedConnector2-5" */ -sal_Int32 lcl_GetAdjustValueCount( const XPolygon& rPoly ) +static sal_Int32 lcl_GetAdjustValueCount( const XPolygon& rPoly ) { int nRet = 0; switch ( rPoly.GetSize() ) @@ -2021,7 +2025,7 @@ sal_Int32 lcl_GetAdjustValueCount( const XPolygon& rPoly ) } // Adjust value decide the position which connector should turn a corner -sal_Int32 lcl_GetConnectorAdjustValue ( const XPolygon& rPoly, sal_uInt16 nIndex ) +static sal_Int32 lcl_GetConnectorAdjustValue ( const XPolygon& rPoly, sal_uInt16 nIndex ) { sal_uInt16 k = rPoly.GetSize(); OSL_ASSERT ( k >= ( 3 + nIndex ) ); @@ -2049,7 +2053,7 @@ sal_Int32 lcl_GetConnectorAdjustValue ( const XPolygon& rPoly, sal_uInt16 nIndex } -void lcl_Rotate(sal_Int32 nAngle, Point center, Point& pt) +static void lcl_Rotate(sal_Int32 nAngle, Point center, Point& pt) { nAngle = NormAngle36000(nAngle); @@ -2086,7 +2090,7 @@ void lcl_Rotate(sal_Int32 nAngle, Point center, Point& pt) Generally, draw the connector from top to bottom, from left to right when meet the adjust value, but when (X1>X2 or Y1>Y2),the draw director must be reverse, FlipV or FlipH should be set to true. */ -bool lcl_GetAngle(tools::Polygon &rPoly, ShapeFlag& rShapeFlags,sal_Int32& nAngle ) +static bool lcl_GetAngle(tools::Polygon &rPoly, ShapeFlag& rShapeFlags,sal_Int32& nAngle ) { Point aStart = rPoly[0]; Point aEnd = rPoly[rPoly.GetSize()-1]; @@ -2334,7 +2338,7 @@ sal_Int32 EscherPropertyContainer::GetValueForEnhancedCustomShapeParameter( cons return nValue; } -bool GetValueForEnhancedCustomShapeHandleParameter( sal_Int32& nRetValue, const drawing::EnhancedCustomShapeParameter& rParameter ) +static bool GetValueForEnhancedCustomShapeHandleParameter( sal_Int32& nRetValue, const drawing::EnhancedCustomShapeParameter& rParameter ) { bool bSpecial = false; nRetValue = 0; @@ -2384,7 +2388,7 @@ bool GetValueForEnhancedCustomShapeHandleParameter( sal_Int32& nRetValue, const return bSpecial; } -void ConvertEnhancedCustomShapeEquation( +static void ConvertEnhancedCustomShapeEquation( const SdrObjCustomShape& rSdrObjCustomShape, std::vector< EnhancedCustomShapeEquation >& rEquations, std::vector< sal_Int32 >& rEquationOrder ) diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx index a28d7357bf68..0485d6f55930 100644 --- a/filter/source/msfilter/eschesdo.cxx +++ b/filter/source/msfilter/eschesdo.cxx @@ -1038,7 +1038,7 @@ ImplEESdrObject::~ImplEESdrObject() { } -basegfx::B2DRange getUnrotatedGroupBoundRange(const Reference< XShape >& rxShape) +static basegfx::B2DRange getUnrotatedGroupBoundRange(const Reference< XShape >& rxShape) { basegfx::B2DRange aRetval; diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 4b650c272c70..c484871dfe81 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -380,7 +380,7 @@ DffPropertyReader::~DffPropertyReader() } -SvStream& operator>>( SvStream& rIn, SvxMSDffConnectorRule& rRule ) +static SvStream& operator>>( SvStream& rIn, SvxMSDffConnectorRule& rRule ) { sal_uInt32 nRuleId; rIn.ReadUInt32( nRuleId ) @@ -1065,7 +1065,7 @@ struct ShadeColor ShadeColor( const Color& rC, double fR ) : aColor( rC ), fDist( fR ) {}; }; -void GetShadeColors( const SvxMSDffManager& rManager, const DffPropertyReader& rProperties, SvStream& rIn, std::vector< ShadeColor >& rShadeColors ) +static void GetShadeColors( const SvxMSDffManager& rManager, const DffPropertyReader& rProperties, SvStream& rIn, std::vector< ShadeColor >& rShadeColors ) { sal_uInt32 nPos = rIn.Tell(); if ( rProperties.IsProperty( DFF_Prop_fillShadeColors ) ) @@ -1098,7 +1098,7 @@ void GetShadeColors( const SvxMSDffManager& rManager, const DffPropertyReader& r rIn.Seek( nPos ); } -void ApplyRectangularGradientAsBitmap( const SvxMSDffManager& rManager, SvStream& rIn, SfxItemSet& rSet, const std::vector< ShadeColor >& rShadeColors, const DffObjData& rObjData, sal_Int32 nFix16Angle ) +static void ApplyRectangularGradientAsBitmap( const SvxMSDffManager& rManager, SvStream& rIn, SfxItemSet& rSet, const std::vector< ShadeColor >& rShadeColors, const DffObjData& rObjData, sal_Int32 nFix16Angle ) { Size aBitmapSizePixel( static_cast< sal_Int32 >( ( rObjData.aBoundRect.GetWidth() / 2540.0 ) * 90.0 ), // we will create a bitmap with 90 dpi static_cast< sal_Int32 >( ( rObjData.aBoundRect.GetHeight() / 2540.0 ) * 90.0 ) ); @@ -6927,7 +6927,7 @@ bool SvxMSDffManager::ConvertToOle2( SvStream& rStm, sal_uInt32 nReadLen, return false; } -const char* GetInternalServerName_Impl( const SvGlobalName& aGlobName ) +static const char* GetInternalServerName_Impl( const SvGlobalName& aGlobName ) { if ( aGlobName == SvGlobalName( SO3_SW_OLE_EMBED_CLASSID_60 ) || aGlobName == SvGlobalName( SO3_SW_OLE_EMBED_CLASSID_8 ) ) diff --git a/filter/source/msfilter/msoleexp.cxx b/filter/source/msfilter/msoleexp.cxx index e47470b27603..13b24f80e936 100644 --- a/filter/source/msfilter/msoleexp.cxx +++ b/filter/source/msfilter/msoleexp.cxx @@ -48,7 +48,7 @@ using namespace ::com::sun::star; -SvGlobalName GetEmbeddedVersion( const SvGlobalName& aAppName ) +static SvGlobalName GetEmbeddedVersion( const SvGlobalName& aAppName ) { if ( aAppName == SvGlobalName( SO3_SM_CLASSID_60 ) ) return SvGlobalName( SO3_SM_OLE_EMBED_CLASSID_8 ); @@ -66,7 +66,7 @@ SvGlobalName GetEmbeddedVersion( const SvGlobalName& aAppName ) return SvGlobalName(); } -OUString GetStorageType( const SvGlobalName& aEmbName ) +static OUString GetStorageType( const SvGlobalName& aEmbName ) { if ( aEmbName == SvGlobalName( SO3_SM_OLE_EMBED_CLASSID_8 ) ) return OUString( "LibreOffice.MathDocument.1" ); @@ -83,7 +83,7 @@ OUString GetStorageType( const SvGlobalName& aEmbName ) return OUString(); } -bool UseOldMSExport() +static bool UseOldMSExport() { uno::Reference< lang::XMultiServiceFactory > xProvider( configuration::theDefaultProvider::get( diff --git a/filter/source/msfilter/msvbahelper.cxx b/filter/source/msfilter/msvbahelper.cxx index 92d4b98229d4..6e611824e163 100644 --- a/filter/source/msfilter/msvbahelper.cxx +++ b/filter/source/msfilter/msvbahelper.cxx @@ -68,7 +68,7 @@ OUString extractMacroName( const OUString& rMacroUrl ) return OUString(); } -OUString trimMacroName( const OUString& rMacroName ) +static OUString trimMacroName( const OUString& rMacroName ) { // the name may contain whitespaces and may be enclosed in apostrophs OUString aMacroName = rMacroName.trim(); @@ -78,7 +78,7 @@ OUString trimMacroName( const OUString& rMacroName ) return aMacroName; } -SfxObjectShell* findShellForUrl( const OUString& sMacroURLOrPath ) +static SfxObjectShell* findShellForUrl( const OUString& sMacroURLOrPath ) { SfxObjectShell* pFoundShell=nullptr; SfxObjectShell* pShell = SfxObjectShell::GetFirst(); @@ -173,7 +173,7 @@ SfxObjectShell* findShellForUrl( const OUString& sMacroURLOrPath ) // sMod can be empty ( but we really need the library to search in ) // if sMod is empty and a macro is found then sMod is updated // if sMod is empty, only standard modules will be searched (no class, document, form modules) -bool hasMacro( SfxObjectShell const * pShell, const OUString& sLibrary, OUString& sMod, const OUString& sMacro ) +static bool hasMacro( SfxObjectShell const * pShell, const OUString& sLibrary, OUString& sMod, const OUString& sMacro ) { bool bFound = false; @@ -236,7 +236,7 @@ OUString getDefaultProjectName( SfxObjectShell const * pShell ) return aPrjName; } -void parseMacro( const OUString& sMacro, OUString& sContainer, OUString& sModule, OUString& sProcedure ) +static void parseMacro( const OUString& sMacro, OUString& sContainer, OUString& sModule, OUString& sProcedure ) { sal_Int32 nMacroDot = sMacro.lastIndexOf( '.' ); @@ -603,7 +603,7 @@ OUString SAL_CALL VBAMacroResolver::resolveScriptURLtoVBAMacro( const OUString& throw uno::RuntimeException(); } -bool getModifier( sal_Unicode c, sal_uInt16& mod ) +static bool getModifier( sal_Unicode c, sal_uInt16& mod ) { if ( c == '+' ) { mod |= KEY_SHIFT; @@ -619,7 +619,7 @@ bool getModifier( sal_Unicode c, sal_uInt16& mod ) } /// @throws uno::RuntimeException -sal_uInt16 parseChar( sal_Unicode c ) +static sal_uInt16 parseChar( sal_Unicode c ) { sal_uInt16 nVclKey = 0; // do we care about locale here for letters/digits? probably not diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 6d891d6ad06c..f15f4b245900 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -1766,7 +1766,7 @@ void PPTConvertOCXControls::GetDrawPage() } } -bool SdrPowerPointOLEDecompress( SvStream& rOutput, SvStream& rInput, sal_uInt32 nInputSize ) +static bool SdrPowerPointOLEDecompress( SvStream& rOutput, SvStream& rInput, sal_uInt32 nInputSize ) { sal_uInt32 nOldPos = rInput.Tell(); std::unique_ptr<char[]> pBuf(new char[ nInputSize ]); @@ -2669,7 +2669,7 @@ SdrPage* SdrPowerPointImport::MakeBlancPage( bool bMaster ) const return pRet; } -void ImportComment10( SvxMSDffManager const & rMan, SvStream& rStCtrl, SdrPage* pPage, DffRecordHeader const & rComment10Hd ) +static void ImportComment10( SvxMSDffManager const & rMan, SvStream& rStCtrl, SdrPage* pPage, DffRecordHeader const & rComment10Hd ) { OUString sAuthor; OUString sText; @@ -7144,14 +7144,14 @@ PPTTextObj& PPTTextObj::operator=( PPTTextObj& rTextObj ) return *this; } -bool IsLine( const SdrObject* pObj ) +static bool IsLine( const SdrObject* pObj ) { return dynamic_cast< const SdrPathObj* >(pObj) != nullptr && static_cast<const SdrPathObj*>(pObj)->IsLine() && static_cast<const SdrPathObj*>(pObj)->GetPointCount() == 2; } -bool GetCellPosition( const SdrObject* pObj, const std::set< sal_Int32 >& rRows, const std::set< sal_Int32 >& rColumns, +static bool GetCellPosition( const SdrObject* pObj, const std::set< sal_Int32 >& rRows, const std::set< sal_Int32 >& rColumns, sal_Int32& nTableIndex, sal_Int32& nRow, sal_Int32& nRowCount, sal_Int32& nColumn, sal_Int32& nColumnCount ) { tools::Rectangle aSnapRect( pObj->GetSnapRect() ); @@ -7194,7 +7194,7 @@ bool GetCellPosition( const SdrObject* pObj, const std::set< sal_Int32 >& rRows, #define LinePositionBLTR 0x20000000 -void GetRowPositions( const tools::Rectangle& rSnapRect, const std::set< sal_Int32 >& rRows, +static void GetRowPositions( const tools::Rectangle& rSnapRect, const std::set< sal_Int32 >& rRows, const std::set< sal_Int32 >& rColumns, std::vector< sal_Int32 >& rPositions, sal_Int32 nColumn, sal_Int32 nFlags ) { std::set< sal_Int32 >::const_iterator aRow( rRows.find( rSnapRect.Top() ) ); @@ -7215,7 +7215,7 @@ void GetRowPositions( const tools::Rectangle& rSnapRect, const std::set< sal_Int } -void GetColumnPositions( const tools::Rectangle& rSnapRect, +static void GetColumnPositions( const tools::Rectangle& rSnapRect, const std::set< sal_Int32 >& rColumns, std::vector< sal_Int32 >& rPositions, sal_Int32 nRow, sal_Int32 nFlags ) { std::set< sal_Int32 >::const_iterator aColumn( rColumns.find( rSnapRect.Left() ) ); @@ -7235,7 +7235,7 @@ void GetColumnPositions( const tools::Rectangle& rSnapRect, } } -void GetLinePositions( const SdrObject* pObj, const std::set< sal_Int32 >& rRows, const std::set< sal_Int32 >& rColumns, +static void GetLinePositions( const SdrObject* pObj, const std::set< sal_Int32 >& rRows, const std::set< sal_Int32 >& rColumns, std::vector< sal_Int32 >& rPositions, const tools::Rectangle& rGroupSnap ) { tools::Rectangle aSnapRect( pObj->GetSnapRect() ); @@ -7301,7 +7301,7 @@ void GetLinePositions( const SdrObject* pObj, const std::set< sal_Int32 >& rRows } } -void CreateTableRows( const Reference< XTableRows >& xTableRows, const std::set< sal_Int32 >& rRows, sal_Int32 nTableBottom ) +static void CreateTableRows( const Reference< XTableRows >& xTableRows, const std::set< sal_Int32 >& rRows, sal_Int32 nTableBottom ) { if ( rRows.size() > 1 ) xTableRows->insertByIndex( 0, rRows.size() - 1 ); @@ -7328,7 +7328,7 @@ void CreateTableRows( const Reference< XTableRows >& xTableRows, const std::set< } } -void CreateTableColumns( const Reference< XTableColumns >& xTableColumns, const std::set< sal_Int32 >& rColumns, sal_Int32 nTableRight ) +static void CreateTableColumns( const Reference< XTableColumns >& xTableColumns, const std::set< sal_Int32 >& rColumns, sal_Int32 nTableRight ) { if ( rColumns.size() > 1 ) xTableColumns->insertByIndex( 0, rColumns.size() - 1 ); @@ -7355,7 +7355,7 @@ void CreateTableColumns( const Reference< XTableColumns >& xTableColumns, const } } -void MergeCells( const Reference< XTable >& xTable, sal_Int32 nCol, sal_Int32 nRow, sal_Int32 nColSpan, sal_Int32 nRowSpan ) +static void MergeCells( const Reference< XTable >& xTable, sal_Int32 nCol, sal_Int32 nRow, sal_Int32 nColSpan, sal_Int32 nRowSpan ) { DBG_ASSERT( (nColSpan > 1) || (nRowSpan > 1), "nonsense parameter!!" ); DBG_ASSERT( (nCol >= 0) && (nCol < xTable->getColumnCount()) && (nRow >= 0) && (nRow < xTable->getRowCount()), "the cell does not exists!!" ); @@ -7374,7 +7374,7 @@ void MergeCells( const Reference< XTable >& xTable, sal_Int32 nCol, sal_Int32 nR } } -void ApplyCellAttributes( const SdrObject* pObj, Reference< XCell > const & xCell ) +static void ApplyCellAttributes( const SdrObject* pObj, Reference< XCell > const & xCell ) { try { @@ -7476,7 +7476,7 @@ void ApplyCellAttributes( const SdrObject* pObj, Reference< XCell > const & xCel } } -void ApplyCellLineAttributes( const SdrObject* pLine, Reference< XTable > const & xTable, const std::vector< sal_Int32 >& vPositions, sal_Int32 nColumns ) +static void ApplyCellLineAttributes( const SdrObject* pLine, Reference< XTable > const & xTable, const std::vector< sal_Int32 >& vPositions, sal_Int32 nColumns ) { try { diff --git a/filter/source/msfilter/util.cxx b/filter/source/msfilter/util.cxx index 9335cc4d2b00..2764dfc2fb23 100644 --- a/filter/source/msfilter/util.cxx +++ b/filter/source/msfilter/util.cxx @@ -453,7 +453,7 @@ bool WW8ReadFieldParams::GetTokenSttFromTo(sal_Int32* pFrom, sal_Int32* pTo, sal return nStart && nEnd && (nMax >= nStart) && (nMax >= nEnd); } -EquationResult Read_SubF_Combined(WW8ReadFieldParams& rReadParam) +static EquationResult Read_SubF_Combined(WW8ReadFieldParams& rReadParam) { EquationResult aResult; diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index 59aca05f0efb..bbedad6c6f80 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -43,7 +43,7 @@ #include <com/sun/star/security/DocumentDigitalSignatures.hpp> #include <com/sun/star/security/XCertificate.hpp> -OUString PDFFilterResId(const char* pId) +static OUString PDFFilterResId(const char* pId) { return Translate::get(pId, Translate::Create("flt")); } diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index fa0958decc10..ac9550d7c6ca 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -302,7 +302,7 @@ public: }; -bool operator==( const TextField & aLhsTextField, const TextField & aRhsTextField ) +static bool operator==( const TextField & aLhsTextField, const TextField & aRhsTextField ) { return aLhsTextField.equalTo( aRhsTextField ); } @@ -439,7 +439,7 @@ BitmapChecksum GetBitmapChecksum( const MetaAction* pAction ) } // end anonymous namespace -void MetaBitmapActionGetPoint( const MetaAction* pAction, Point& rPt ) +static void MetaBitmapActionGetPoint( const MetaAction* pAction, Point& rPt ) { const MetaActionType nType = pAction->GetType(); switch( nType ) @@ -878,7 +878,7 @@ bool SVGFilter::implExportDocument() /// Append aField to aFieldSet if it is not already present in the set and create the field id sFieldId template< typename TextFieldType > -OUString implGenerateFieldId( std::vector< TextField* > & aFieldSet, +static OUString implGenerateFieldId( std::vector< TextField* > & aFieldSet, const TextFieldType & aField, const OUString & sOOOElemField, const Reference< css::drawing::XDrawPage >& xMasterPage ) diff --git a/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx b/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx index 0e55cd318141..ffa2eebdcf7b 100644 --- a/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx +++ b/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx @@ -164,20 +164,20 @@ void SAL_CALL XMLFilterDialogComponent::release() throw () } /// @throws RuntimeException -OUString XMLFilterDialogComponent_getImplementationName() +static OUString XMLFilterDialogComponent_getImplementationName() { return OUString( "com.sun.star.comp.ui.XSLTFilterDialog" ); } /// @throws RuntimeException -Sequence< OUString > XMLFilterDialogComponent_getSupportedServiceNames() +static Sequence< OUString > XMLFilterDialogComponent_getSupportedServiceNames() { Sequence< OUString > aSupported { "com.sun.star.ui.dialogs.XSLTFilterDialog" }; return aSupported; } /// @throws Exception -Reference< XInterface > XMLFilterDialogComponent_createInstance( const Reference< XMultiServiceFactory > & rSMgr) +static Reference< XInterface > XMLFilterDialogComponent_createInstance( const Reference< XMultiServiceFactory > & rSMgr) { return static_cast<OWeakObject*>(new XMLFilterDialogComponent( comphelper::getComponentContext(rSMgr) )); } diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx index 3a18e057949f..ea9ce31a0591 100644 --- a/forms/source/component/DatabaseForm.cxx +++ b/forms/source/component/DatabaseForm.cxx @@ -2087,7 +2087,7 @@ void SAL_CALL ODatabaseForm::submit( const Reference<XControl>& Control, } } -void lcl_dispatch(const Reference< XFrame >& xFrame,const Reference<XURLTransformer>& xTransformer,const OUString& aURLStr,const OUString& aReferer,const OUString& aTargetName +static void lcl_dispatch(const Reference< XFrame >& xFrame,const Reference<XURLTransformer>& xTransformer,const OUString& aURLStr,const OUString& aReferer,const OUString& aTargetName ,const OUString& aData,rtl_TextEncoding _eEncoding) { URL aURL; diff --git a/forms/source/misc/InterfaceContainer.cxx b/forms/source/misc/InterfaceContainer.cxx index faa4aec158f4..03de92cdc02a 100644 --- a/forms/source/misc/InterfaceContainer.cxx +++ b/forms/source/misc/InterfaceContainer.cxx @@ -78,7 +78,7 @@ namespace } } -bool +static bool lcl_hasVbaEvents( const Sequence< ScriptEventDescriptor >& sEvents ) { for ( auto const& rDesc : sEvents ) @@ -89,7 +89,7 @@ lcl_hasVbaEvents( const Sequence< ScriptEventDescriptor >& sEvents ) return false; } -Sequence< ScriptEventDescriptor > +static Sequence< ScriptEventDescriptor > lcl_stripVbaEvents( const Sequence< ScriptEventDescriptor >& sEvents ) { Sequence< ScriptEventDescriptor > sStripped( sEvents.getLength() ); diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx index 6580ea898e75..c2a9466ebbb7 100644 --- a/formula/source/core/api/FormulaCompiler.cxx +++ b/formula/source/core/api/FormulaCompiler.cxx @@ -833,7 +833,7 @@ FormulaCompiler::OpCodeMapPtr FormulaCompiler::CreateOpCodeMap( return xMap; } -void lcl_fillNativeSymbols( FormulaCompiler::NonConstOpCodeMapPtr& xMap, bool bDestroy = false ) +static void lcl_fillNativeSymbols( FormulaCompiler::NonConstOpCodeMapPtr& xMap, bool bDestroy = false ) { static OpCodeMapData aSymbolMap; osl::MutexGuard aGuard(&aSymbolMap.maMtx); diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx index 43c152ee7161..84a8e4bc6834 100644 --- a/formula/source/core/api/token.cxx +++ b/formula/source/core/api/token.cxx @@ -43,7 +43,7 @@ namespace formula // --- helpers -------------------------------------------------------------- -inline bool lcl_IsReference( OpCode eOp, StackVar eType ) +static inline bool lcl_IsReference( OpCode eOp, StackVar eType ) { return (eOp == ocPush && (eType == svSingleRef || eType == svDoubleRef)) diff --git a/formula/source/ui/dlg/FormulaHelper.cxx b/formula/source/ui/dlg/FormulaHelper.cxx index 8bcdb516a21a..ed7d28b0612f 100644 --- a/formula/source/ui/dlg/FormulaHelper.cxx +++ b/formula/source/ui/dlg/FormulaHelper.cxx @@ -179,7 +179,7 @@ void FormulaHelper::GetArgStrings( ::std::vector< OUString >& _rArgs, } -inline bool IsFormulaText( const CharClass* _pCharClass,const OUString& rStr, sal_Int32 nPos ) +static inline bool IsFormulaText( const CharClass* _pCharClass,const OUString& rStr, sal_Int32 nPos ) { if( _pCharClass->isLetterNumeric( rStr, nPos ) ) return true; diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index a874b481113d..5242ce8b6fed 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -405,7 +405,7 @@ void RemoteFilesDialog::Show() } } -OUString lcl_GetServiceType( const ServicePtr& pService ) +static OUString lcl_GetServiceType( const ServicePtr& pService ) { INetProtocol aProtocol = pService->GetUrlObject().GetProtocol(); switch( aProtocol ) diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx index 0d931fbc0f66..3fd201ddeaf3 100644 --- a/framework/source/accelerators/acceleratorconfiguration.cxx +++ b/framework/source/accelerators/acceleratorconfiguration.cxx @@ -59,7 +59,7 @@ namespace framework const char CFG_ENTRY_SECONDARY[] = "SecondaryKeys"; const char CFG_PROP_COMMAND[] = "Command"; - OUString lcl_getKeyString(const css::awt::KeyEvent& aKeyEvent) + static OUString lcl_getKeyString(const css::awt::KeyEvent& aKeyEvent) { const sal_Int32 nBeginIndex = 4; // "KEY_" is the prefix of a identifier... OUStringBuffer sKeyBuffer((KeyMapping::get().mapCodeToIdentifier(aKeyEvent.KeyCode)).copy(nBeginIndex)); @@ -664,7 +664,7 @@ css::uno::Sequence< css::awt::KeyEvent > SAL_CALL XCUBasedAcceleratorConfigurati return comphelper::containerToSequence(lKeys); } -AcceleratorCache::TKeyList::const_iterator lcl_getPreferredKey(const AcceleratorCache::TKeyList& lKeys) +static AcceleratorCache::TKeyList::const_iterator lcl_getPreferredKey(const AcceleratorCache::TKeyList& lKeys) { AcceleratorCache::TKeyList::const_iterator pIt; for ( pIt = lKeys.begin (); diff --git a/framework/source/fwe/helper/actiontriggerhelper.cxx b/framework/source/fwe/helper/actiontriggerhelper.cxx index b672a497635e..8d00b23a9e6e 100644 --- a/framework/source/fwe/helper/actiontriggerhelper.cxx +++ b/framework/source/fwe/helper/actiontriggerhelper.cxx @@ -44,7 +44,7 @@ namespace framework // implementation helper ( menu => ActionTrigger ) -bool IsSeparator( const Reference< XPropertySet >& xPropertySet ) +static bool IsSeparator( const Reference< XPropertySet >& xPropertySet ) { Reference< XServiceInfo > xServiceInfo( xPropertySet, UNO_QUERY ); try @@ -58,7 +58,7 @@ bool IsSeparator( const Reference< XPropertySet >& xPropertySet ) return false; } -void GetMenuItemAttributes( const Reference< XPropertySet >& xActionTriggerPropertySet, +static void GetMenuItemAttributes( const Reference< XPropertySet >& xActionTriggerPropertySet, OUString& aMenuLabel, OUString& aCommandURL, OUString& aHelpURL, @@ -94,7 +94,7 @@ void GetMenuItemAttributes( const Reference< XPropertySet >& xActionTriggerPrope } } -void InsertSubMenuItems( Menu* pSubMenu, sal_uInt16& nItemId, const Reference< XIndexContainer >& xActionTriggerContainer ) +static void InsertSubMenuItems( Menu* pSubMenu, sal_uInt16& nItemId, const Reference< XIndexContainer >& xActionTriggerContainer ) { if ( xActionTriggerContainer.is() ) { @@ -236,7 +236,7 @@ void InsertSubMenuItems( Menu* pSubMenu, sal_uInt16& nItemId, const Reference< X // implementation helper ( ActionTrigger => menu ) /// @throws RuntimeException -Reference< XPropertySet > CreateActionTrigger( sal_uInt16 nItemId, const Menu* pMenu, const Reference< XIndexContainer >& rActionTriggerContainer ) +static Reference< XPropertySet > CreateActionTrigger( sal_uInt16 nItemId, const Menu* pMenu, const Reference< XIndexContainer >& rActionTriggerContainer ) { Reference< XPropertySet > xPropSet; @@ -283,7 +283,7 @@ Reference< XPropertySet > CreateActionTrigger( sal_uInt16 nItemId, const Menu* p } /// @throws RuntimeException -Reference< XPropertySet > CreateActionTriggerSeparator( const Reference< XIndexContainer >& rActionTriggerContainer ) +static Reference< XPropertySet > CreateActionTriggerSeparator( const Reference< XIndexContainer >& rActionTriggerContainer ) { Reference< XMultiServiceFactory > xMultiServiceFactory( rActionTriggerContainer, UNO_QUERY ); if ( xMultiServiceFactory.is() ) @@ -297,7 +297,7 @@ Reference< XPropertySet > CreateActionTriggerSeparator( const Reference< XIndexC } /// @throws RuntimeException -Reference< XIndexContainer > CreateActionTriggerContainer( const Reference< XIndexContainer >& rActionTriggerContainer ) +static Reference< XIndexContainer > CreateActionTriggerContainer( const Reference< XIndexContainer >& rActionTriggerContainer ) { Reference< XMultiServiceFactory > xMultiServiceFactory( rActionTriggerContainer, UNO_QUERY ); if ( xMultiServiceFactory.is() ) @@ -310,7 +310,7 @@ Reference< XIndexContainer > CreateActionTriggerContainer( const Reference< XInd return Reference< XIndexContainer >(); } -void FillActionTriggerContainerWithMenu( const Menu* pMenu, Reference< XIndexContainer > const & rActionTriggerContainer ) +static void FillActionTriggerContainerWithMenu( const Menu* pMenu, Reference< XIndexContainer > const & rActionTriggerContainer ) { SolarMutexGuard aGuard; diff --git a/framework/source/jobs/jobdata.cxx b/framework/source/jobs/jobdata.cxx index 7fccf820b0a2..823541875399 100644 --- a/framework/source/jobs/jobdata.cxx +++ b/framework/source/jobs/jobdata.cxx @@ -441,7 +441,7 @@ void JobData::disableJob() aConfig.close(); } -bool isEnabled( const OUString& sAdminTime , +static bool isEnabled( const OUString& sAdminTime , const OUString& sUserTime ) { /*Attention! diff --git a/framework/source/recording/dispatchrecorder.cxx b/framework/source/recording/dispatchrecorder.cxx index 658229302c33..a395cef82978 100644 --- a/framework/source/recording/dispatchrecorder.cxx +++ b/framework/source/recording/dispatchrecorder.cxx @@ -51,7 +51,7 @@ DEFINE_INIT_SERVICE( ) -void flatten_struct_members( +static void flatten_struct_members( ::std::vector< Any > * vec, void const * data, typelib_CompoundTypeDescription * pTD ) { @@ -66,7 +66,7 @@ void flatten_struct_members( } } -Sequence< Any > make_seq_out_of_struct( +static Sequence< Any > make_seq_out_of_struct( Any const & val ) { Type const & type = val.getValueType(); diff --git a/framework/source/services/ContextChangeEventMultiplexer.cxx b/framework/source/services/ContextChangeEventMultiplexer.cxx index f8f68a1c8a14..2ee8a298ed4e 100644 --- a/framework/source/services/ContextChangeEventMultiplexer.cxx +++ b/framework/source/services/ContextChangeEventMultiplexer.cxx @@ -333,7 +333,7 @@ struct Singleton: namespace framework { // right now we assume there's one matching listener -uno::Reference<ui::XContextChangeEventListener> GetFirstListenerWith_ImplImpl( +static uno::Reference<ui::XContextChangeEventListener> GetFirstListenerWith_ImplImpl( uno::Reference<uno::XInterface> const& xEventFocus, std::function<bool (uno::Reference<ui::XContextChangeEventListener> const&)> const& rPredicate) { diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx index fc22ed4cc279..39a4e787cea6 100644 --- a/framework/source/uielement/toolbarsmenucontroller.cxx +++ b/framework/source/uielement/toolbarsmenucontroller.cxx @@ -85,14 +85,14 @@ struct ToolBarEntry const CollatorWrapper* pCollatorWrapper; }; -bool CompareToolBarEntry( const ToolBarEntry& aOne, const ToolBarEntry& aTwo ) +static bool CompareToolBarEntry( const ToolBarEntry& aOne, const ToolBarEntry& aTwo ) { sal_Int32 nComp = aOne.pCollatorWrapper->compareString( aOne.aUIName, aTwo.aUIName ); return nComp < 0; } -Reference< XLayoutManager > getLayoutManagerFromFrame( const Reference< XFrame >& rFrame ) +static Reference< XLayoutManager > getLayoutManagerFromFrame( const Reference< XFrame >& rFrame ) { Reference< XPropertySet > xPropSet( rFrame, UNO_QUERY ); Reference< XLayoutManager > xLayoutManager; diff --git a/framework/source/uifactory/factoryconfiguration.cxx b/framework/source/uifactory/factoryconfiguration.cxx index 778195be2942..c3a2f964b2e2 100644 --- a/framework/source/uifactory/factoryconfiguration.cxx +++ b/framework/source/uifactory/factoryconfiguration.cxx @@ -45,7 +45,7 @@ using namespace com::sun::star::container; namespace framework { -OUString getHashKeyFromStrings( const OUString& aCommandURL, const OUString& aModuleName ) +static OUString getHashKeyFromStrings( const OUString& aCommandURL, const OUString& aModuleName ) { OUStringBuffer aKey( aCommandURL ); aKey.append( "-" ); diff --git a/helpcompiler/source/HelpCompiler.cxx b/helpcompiler/source/HelpCompiler.cxx index 4392328a08a5..d7ce8cfcc5d9 100644 --- a/helpcompiler/source/HelpCompiler.cxx +++ b/helpcompiler/source/HelpCompiler.cxx @@ -287,7 +287,7 @@ std::string myparser::dump(xmlNodePtr node) return app; } -void trim(std::string& str) +static void trim(std::string& str) { std::string::size_type pos = str.find_last_not_of(' '); if(pos != std::string::npos) diff --git a/helpcompiler/source/HelpLinker.cxx b/helpcompiler/source/HelpLinker.cxx index c6a9d5741f52..95bf39d764d1 100644 --- a/helpcompiler/source/HelpLinker.cxx +++ b/helpcompiler/source/HelpLinker.cxx @@ -75,7 +75,7 @@ IndexerPreProcessor::~IndexerPreProcessor() xsltFreeStylesheet( m_xsltStylesheetPtrContent ); } -std::string getEncodedPath( const std::string& Path ) +static std::string getEncodedPath( const std::string& Path ) { OString aOStr_Path( Path.c_str() ); OUString aOUStr_Path( OStringToOUString @@ -146,7 +146,7 @@ struct Data } }; -void writeKeyValue_DBHelp( FILE* pFile, const std::string& aKeyStr, const std::string& aValueStr ) +static void writeKeyValue_DBHelp( FILE* pFile, const std::string& aKeyStr, const std::string& aValueStr ) { if( pFile == nullptr ) return; @@ -813,7 +813,9 @@ void HelpLinker::main( std::vector<std::string> &args, // Variable to set an exception in "C" StructuredXMLErrorFunction static const HelpProcessingException* GpXMLParsingException = nullptr; -extern "C" void StructuredXMLErrorFunction(SAL_UNUSED_PARAMETER void *, xmlErrorPtr error) +extern "C" { + +static void StructuredXMLErrorFunction(SAL_UNUSED_PARAMETER void *, xmlErrorPtr error) { std::string aErrorMsg = error->message; std::string aXMLParsingFile; @@ -827,6 +829,8 @@ extern "C" void StructuredXMLErrorFunction(SAL_UNUSED_PARAMETER void *, xmlError xmlSetStructuredErrorFunc( nullptr, nullptr ); } +} + HelpProcessingErrorInfo& HelpProcessingErrorInfo::operator=( const struct HelpProcessingException& e ) { m_eErrorClass = e.m_eErrorClass; diff --git a/hwpfilter/source/grammar.cxx b/hwpfilter/source/grammar.cxx index d4dd3630b341..8ecb9696fa83 100644 --- a/hwpfilter/source/grammar.cxx +++ b/hwpfilter/source/grammar.cxx @@ -42,7 +42,7 @@ extern "C" { std::vector<Node*> nodelist; -void yyerror(const char *); +static void yyerror(const char *); static Node *top=nullptr; @@ -51,7 +51,7 @@ int Node::count = 0; #ifdef PARSE_DEBUG #define debug printf #else -int debug(const char *format, ...); +static int debug(const char *format, ...); #endif #include <stdio.h> @@ -441,7 +441,7 @@ int yydebug; /* nonzero means print parse trace */ #ifdef YYPARSE_PARAM int yyparse (void *); #else -int yyparse(); +static int yyparse(); #endif #endif diff --git a/hwpfilter/source/hwpeq.cxx b/hwpfilter/source/hwpeq.cxx index 5613a1bd562a..ca42907abd3c 100644 --- a/hwpfilter/source/hwpeq.cxx +++ b/hwpfilter/source/hwpeq.cxx @@ -410,7 +410,7 @@ static const hwpeq *lookup_eqn(char const *str) } /* If only the first character is uppercase or all characters are uppercase, change to lowercase */ -void make_keyword( char *keyword, const char *token) +static void make_keyword( char *keyword, const char *token) { char* ptr; bool result = true; @@ -467,7 +467,7 @@ struct eq_stack { static eq_stack *stk = nullptr; -void push_token(MzString const &white, MzString const &token, istream *strm) +static void push_token(MzString const &white, MzString const &token, istream *strm) { // one time stack assert(stk->token.length() == 0); diff --git a/hwpfilter/source/lexer.cxx b/hwpfilter/source/lexer.cxx index 0439c9933b54..6595a5ae4cb8 100644 --- a/hwpfilter/source/lexer.cxx +++ b/hwpfilter/source/lexer.cxx @@ -188,18 +188,18 @@ static int yy_start = 0; /* start state number */ */ static int yy_did_buffer_switch_on_eof; -void yyrestart YY_PROTO(( FILE *input_file )); +static void yyrestart YY_PROTO(( FILE *input_file )); -void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void yy_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); -void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); +static void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); +static void yy_load_buffer_state YY_PROTO(( void )); +static YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); +static void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); +static void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); +static void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); +static YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); +static YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); +static YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); static void *yy_flex_alloc YY_PROTO(( yy_size_t )); static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); @@ -942,13 +942,13 @@ static char *yytext; extern "C" { #include "grammar.h" -int yywrap(); +static int yywrap(); } #ifdef TOKEN_DEBUG #define token_debug printf #else -int token_debug(const char *format, ...); +static int token_debug(const char *format, ...); #endif /* Macros after this point can all be overridden by user definitions in diff --git a/hwpfilter/source/mzstring.cxx b/hwpfilter/source/mzstring.cxx index dae04be2169b..4327a3315f4d 100644 --- a/hwpfilter/source/mzstring.cxx +++ b/hwpfilter/source/mzstring.cxx @@ -39,7 +39,7 @@ const int AllocSize = 8; -inline int get_alloc_size(int len) +static inline int get_alloc_size(int len) { return (len + AllocSize - 1) / AllocSize * AllocSize; } diff --git a/i18nutil/source/utility/casefolding.cxx b/i18nutil/source/utility/casefolding.cxx index 52a8a2a913b9..421272851f42 100644 --- a/i18nutil/source/utility/casefolding.cxx +++ b/i18nutil/source/utility/casefolding.cxx @@ -120,7 +120,7 @@ Mapping casefolding::getValue(const sal_Unicode* str, sal_Int32 pos, sal_Int32 l return dummy; } -inline bool +static inline bool is_ja_voice_sound_mark(sal_Unicode& current, sal_Unicode next) { sal_Unicode c = 0; diff --git a/i18nutil/source/utility/unicode.cxx b/i18nutil/source/utility/unicode.cxx index 876750d6119d..ce363acbc4e2 100644 --- a/i18nutil/source/utility/unicode.cxx +++ b/i18nutil/source/utility/unicode.cxx @@ -37,7 +37,7 @@ using namespace ::com::sun::star::i18n; template<class L, typename T> -T getScriptType( const sal_Unicode ch, const L* typeList, T unknownType ) { +static T getScriptType( const sal_Unicode ch, const L* typeList, T unknownType ) { sal_Int16 i = 0; css::i18n::UnicodeScript type = typeList[0].to; diff --git a/idl/source/prj/globals.cxx b/idl/source/prj/globals.cxx index a2375a845edf..89bc2e4d0fc0 100644 --- a/idl/source/prj/globals.cxx +++ b/idl/source/prj/globals.cxx @@ -40,7 +40,7 @@ IdlDll::~IdlDll() { } -inline SvStringHashEntry * INS( const OString& rName ) +static inline SvStringHashEntry * INS( const OString& rName ) { sal_uInt32 nIdx; GetIdlApp().pHashTable->Insert( rName, &nIdx ); diff --git a/idl/source/prj/svidl.cxx b/idl/source/prj/svidl.cxx index 4ad781e6c079..97910e3b7f7c 100644 --- a/idl/source/prj/svidl.cxx +++ b/idl/source/prj/svidl.cxx @@ -28,7 +28,7 @@ #include <memory> #define BR 0x8000 -bool FileMove_Impl( const OUString & rFile1, const OUString & rFile2, bool bMoveAlways ) +static bool FileMove_Impl( const OUString & rFile1, const OUString & rFile2, bool bMoveAlways ) { //printf( "Move from %s to %s\n", rFile2.GetStr(), rFile1.GetStr() ); sal_uLong nC1 = 0; @@ -81,7 +81,7 @@ bool FileMove_Impl( const OUString & rFile1, const OUString & rFile2, bool bMove //This function gets a system path to a file [fname], creates a temp file in //the same folder as [fname] and returns the system path of the temp file. -inline OUString tempFileHelper(OUString const & fname) +static inline OUString tempFileHelper(OUString const & fname) { OUString aTmpFile; diff --git a/idlc/source/astscope.cxx b/idlc/source/astscope.cxx index 5fd9d5339d68..5ab066c2ec5f 100644 --- a/idlc/source/astscope.cxx +++ b/idlc/source/astscope.cxx @@ -24,7 +24,7 @@ #include <osl/diagnose.h> -bool isGlobal(const OString& scopedName) +static bool isGlobal(const OString& scopedName) { return scopedName.isEmpty() || scopedName.startsWith(":"); } diff --git a/idlc/source/idlccompile.cxx b/idlc/source/idlccompile.cxx index 3492e899e733..5a16c9fadc49 100644 --- a/idlc/source/idlccompile.cxx +++ b/idlc/source/idlccompile.cxx @@ -114,7 +114,7 @@ OString convertToFileUrl(const OString& fileName) return fileName; } -OString makeTempName(const OString& prefix) +static OString makeTempName(const OString& prefix) { OUString uTmpPath; OString tmpPath; diff --git a/idlc/source/parser.y b/idlc/source/parser.y index 71b88d05c816..9cd8f4465894 100644 --- a/idlc/source/parser.y +++ b/idlc/source/parser.y @@ -64,9 +64,9 @@ using ::rtl::OStringToOUString; using ::rtl::OStringBuffer; extern int yylex(void); -void yyerror(char const *); +static void yyerror(char const *); -void checkIdentifier(::rtl::OString const * id) +static void checkIdentifier(::rtl::OString const * id) { static short check = 0; if (check == 0) { @@ -93,7 +93,7 @@ void checkIdentifier(::rtl::OString const * id) } } -void reportDoubleMemberDeclarations( +static void reportDoubleMemberDeclarations( AstInterface::DoubleMemberDeclarations const & doubleMembers) { for (auto const& doubleMember : doubleMembers) @@ -102,7 +102,7 @@ void reportDoubleMemberDeclarations( } } -void addInheritedInterface( +static void addInheritedInterface( AstInterface * ifc, rtl::OString const & name, bool optional, rtl::OUString const & documentation) { @@ -140,7 +140,7 @@ void addInheritedInterface( } } -AstDeclaration const * createNamedType( +static AstDeclaration const * createNamedType( rtl::OString const * scopedName, DeclList const * typeArgs) { AstDeclaration * decl = idlc()->scopes()->topNonNull()->lookupByName( @@ -179,7 +179,7 @@ AstDeclaration const * createNamedType( return decl; } -bool includes(AstDeclaration const * type1, AstDeclaration const * type2) { +static bool includes(AstDeclaration const * type1, AstDeclaration const * type2) { OSL_ASSERT(type2 != nullptr); if (type1 != nullptr) { if (type1->getNodeType() == NT_instantiated_struct) { diff --git a/io/source/acceptor/acc_socket.cxx b/io/source/acceptor/acc_socket.cxx index b106e8b11526..f34b3635eb7b 100644 --- a/io/source/acceptor/acc_socket.cxx +++ b/io/source/acceptor/acc_socket.cxx @@ -97,7 +97,7 @@ namespace io_acceptor { }; template<class T> - void notifyListeners(SocketConnection * pCon, bool * notified, T t) + static void notifyListeners(SocketConnection * pCon, bool * notified, T t) { XStreamListener_hash_set listeners; diff --git a/io/source/connector/ctr_socket.cxx b/io/source/connector/ctr_socket.cxx index 255c2f0af534..773a378a08ff 100644 --- a/io/source/connector/ctr_socket.cxx +++ b/io/source/connector/ctr_socket.cxx @@ -31,7 +31,7 @@ using namespace ::com::sun::star::connection; namespace stoc_connector { template<class T> - void notifyListeners(SocketConnection * pCon, bool * notified, T t) + static void notifyListeners(SocketConnection * pCon, bool * notified, T t) { XStreamListener_hash_set listeners; diff --git a/javaunohelper/source/bootstrap.cxx b/javaunohelper/source/bootstrap.cxx index fe5b9aa7b3ee..d84e1c56e6c4 100644 --- a/javaunohelper/source/bootstrap.cxx +++ b/javaunohelper/source/bootstrap.cxx @@ -48,7 +48,7 @@ using namespace ::com::sun::star::uno; namespace javaunohelper { -inline OUString jstring_to_oustring( jstring jstr, JNIEnv * jni_env ) +static inline OUString jstring_to_oustring( jstring jstr, JNIEnv * jni_env ) { OSL_ASSERT( sizeof (sal_Unicode) == sizeof (jchar) ); jsize len = jni_env->GetStringLength( jstr ); diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx index 77823293ef83..250a7655ffba 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx @@ -118,7 +118,7 @@ bool getSDKInfoFromRegistry(vector<OUString> & vecHome); bool getJREInfoFromRegistry(vector<OUString>& vecJavaHome); #endif -bool decodeOutput(const OString& s, OUString* out); +static bool decodeOutput(const OString& s, OUString* out); namespace @@ -840,7 +840,7 @@ vector<OUString> getVectorFromCharArray(char const * const * ar, int size) In case of an error the returned string has the length 0. Otherwise the returned string is the "resolved" file URL. */ -OUString resolveDirPath(const OUString & path) +static OUString resolveDirPath(const OUString & path) { OUString ret; salhelper::LinkResolver aResolver(osl_FileStatus_Mask_Type | @@ -862,7 +862,7 @@ OUString resolveDirPath(const OUString & path) /** Checks if the path is a file. If it is a link to a file than it is resolved. */ -OUString resolveFilePath(const OUString & path) +static OUString resolveFilePath(const OUString & path) { OUString ret; salhelper::LinkResolver aResolver(osl_FileStatus_Mask_Type | diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx index 94b0ed7c2f39..b4eb74e03a03 100644 --- a/jvmfwk/source/elements.cxx +++ b/jvmfwk/source/elements.cxx @@ -48,7 +48,7 @@ using namespace osl; namespace jfw { -OString getElement(OString const & docPath, +static OString getElement(OString const & docPath, xmlChar const * pathExpression) { //Prepare the xml document and context diff --git a/l10ntools/source/helpex.cxx b/l10ntools/source/helpex.cxx index 1ceda2f08a18..95b84c23bc78 100644 --- a/l10ntools/source/helpex.cxx +++ b/l10ntools/source/helpex.cxx @@ -32,7 +32,7 @@ #ifndef TESTDRIVER -void WriteUsage() +static void WriteUsage() { std::cout << (" Syntax: Helpex -[m]i FileIn -o FileOut [-m DataBase] [-l Lang]\n" diff --git a/l10ntools/source/treex.cxx b/l10ntools/source/treex.cxx index ba28879760ba..4e8fe0b26414 100644 --- a/l10ntools/source/treex.cxx +++ b/l10ntools/source/treex.cxx @@ -14,7 +14,7 @@ #include <common.hxx> #include <treemerge.hxx> -void WriteUsage() +static void WriteUsage() { std::cout << ("Syntax: Treex [-r Root] -i FileIn -o FileOut" diff --git a/libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx b/libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx index 2657075dd3f6..1987bdc909cf 100644 --- a/libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx +++ b/libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx @@ -81,7 +81,7 @@ gtv_calc_header_bar_finalize(GObject* object) G_OBJECT_CLASS (gtv_calc_header_bar_parent_class)->finalize (object); } -void gtv_calc_header_bar_draw_text(cairo_t* pCairo, const GdkRectangle& rRectangle, const std::string& rText) +static void gtv_calc_header_bar_draw_text(cairo_t* pCairo, const GdkRectangle& rRectangle, const std::string& rText) { cairo_text_extents_t extents; cairo_text_extents(pCairo, rText.c_str(), &extents); @@ -90,7 +90,7 @@ void gtv_calc_header_bar_draw_text(cairo_t* pCairo, const GdkRectangle& rRectang cairo_show_text(pCairo, rText.c_str()); } -gboolean gtv_calc_header_bar_draw_impl(GtkWidget* pWidget, cairo_t* pCairo) +static gboolean gtv_calc_header_bar_draw_impl(GtkWidget* pWidget, cairo_t* pCairo) { GtvCalcHeaderBar* self = GTV_CALC_HEADER_BAR(pWidget); GtvCalcHeaderBarPrivate& priv = getPrivate(GTV_CALC_HEADER_BAR(self)); diff --git a/libreofficekit/qa/tilebench/tilebench.cxx b/libreofficekit/qa/tilebench/tilebench.cxx index 4cb76dd1366e..60a856212c5d 100644 --- a/libreofficekit/qa/tilebench/tilebench.cxx +++ b/libreofficekit/qa/tilebench/tilebench.cxx @@ -103,7 +103,7 @@ static void dumpTile(const int nWidth, const int nHeight, const int mode, const } } -void testTile( Document *pDocument, int max_parts, +static void testTile( Document *pDocument, int max_parts, int max_tiles, bool dump ) { const int mode = pDocument->getTileMode(); @@ -219,7 +219,7 @@ void testTile( Document *pDocument, int max_parts, static std::atomic<bool> bDialogRendered(false); static std::atomic<int> nDialogId(-1); -void kitCallback(int nType, const char* pPayload, void* pData) +static void kitCallback(int nType, const char* pPayload, void* pData) { Document *pDocument = static_cast<Document *>(pData); @@ -261,7 +261,7 @@ void kitCallback(int nType, const char* pPayload, void* pData) } } -void testDialog( Document *pDocument, const char *uno_cmd ) +static void testDialog( Document *pDocument, const char *uno_cmd ) { int view = pDocument->createView(); pDocument->setView(view); diff --git a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx index 422e219a59c9..307a1b61f3ea 100644 --- a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx +++ b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx @@ -701,7 +701,7 @@ OUString Hyphenator::makeInitCap(const OUString& aTerm, CharClass const * pCC) } /// @throws Exception -Reference< XInterface > Hyphenator_CreateInstance( +static Reference< XInterface > Hyphenator_CreateInstance( const Reference< XMultiServiceFactory > & /*rSMgr*/ ) { Reference< XInterface > xService = static_cast<cppu::OWeakObject*>(new Hyphenator); diff --git a/lingucomponent/source/languageguessing/guess.cxx b/lingucomponent/source/languageguessing/guess.cxx index e802c0ed95e1..680aa4fd75ad 100644 --- a/lingucomponent/source/languageguessing/guess.cxx +++ b/lingucomponent/source/languageguessing/guess.cxx @@ -39,7 +39,7 @@ using namespace std; -inline bool isSeparator(const char c){ +static inline bool isSeparator(const char c){ return c == GUESS_SEPARATOR_OPEN || c == GUESS_SEPARATOR_SEP || c == GUESS_SEPARATOR_CLOSE || c == '\0'; } diff --git a/lingucomponent/source/languageguessing/guesslang.cxx b/lingucomponent/source/languageguessing/guesslang.cxx index 3d2107956c7c..8e2fc213d089 100644 --- a/lingucomponent/source/languageguessing/guesslang.cxx +++ b/lingucomponent/source/languageguessing/guesslang.cxx @@ -336,7 +336,7 @@ Sequence<OUString> LangGuess_Impl::getSupportedServiceNames_Static( ) * Function to create a new component instance; is needed by factory helper implementation. * @param xMgr service manager to if the components needs other component instances */ -Reference< XInterface > LangGuess_Impl_create( +static Reference< XInterface > LangGuess_Impl_create( Reference< XComponentContext > const & ) { return static_cast< ::cppu::OWeakObject * >( new LangGuess_Impl ); diff --git a/lingucomponent/source/lingutil/lingutil.cxx b/lingucomponent/source/lingutil/lingutil.cxx index c480df86aa8f..ab36d54f416a 100644 --- a/lingucomponent/source/lingutil/lingutil.cxx +++ b/lingucomponent/source/lingutil/lingutil.cxx @@ -60,7 +60,7 @@ OString Win_AddLongPathPrefix( const OString &rPathName ) #ifdef SYSTEM_DICTS // find old style dictionaries in system directories -void GetOldStyleDicsInDir( +static void GetOldStyleDicsInDir( OUString const & aSystemDir, OUString const & aFormatName, OUString const & aSystemSuffix, OUString const & aSystemPrefix, std::set< OUString >& aDicLangInUse, diff --git a/lingucomponent/source/numbertext/numbertext.cxx b/lingucomponent/source/numbertext/numbertext.cxx index ee3ecbab9818..094920bf5802 100644 --- a/lingucomponent/source/numbertext/numbertext.cxx +++ b/lingucomponent/source/numbertext/numbertext.cxx @@ -180,7 +180,7 @@ Sequence<OUString> NumberText_Impl::getSupportedServiceNames_Static() * Function to create a new component instance; is needed by factory helper implementation. * @param xMgr service manager to if the components needs other component instances */ -Reference<XInterface> NumberText_Impl_create(Reference<XComponentContext> const&) +static Reference<XInterface> NumberText_Impl_create(Reference<XComponentContext> const&) { return static_cast<::cppu::OWeakObject*>(new NumberText_Impl); } diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx index 72019218ccbe..b4bf958a045e 100644 --- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx +++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx @@ -523,7 +523,7 @@ Reference< XSpellAlternatives > SAL_CALL SpellChecker::spell( } /// @throws Exception -Reference< XInterface > SpellChecker_CreateInstance( +static Reference< XInterface > SpellChecker_CreateInstance( const Reference< XMultiServiceFactory > & /*rSMgr*/ ) { diff --git a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx index 6ea501e327df..7936d1f4d642 100644 --- a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx +++ b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx @@ -472,7 +472,7 @@ Sequence < Reference < css::linguistic2::XMeaning > > SAL_CALL Thesaurus::queryM } /// @throws Exception -Reference< XInterface > Thesaurus_CreateInstance( +static Reference< XInterface > Thesaurus_CreateInstance( const Reference< XMultiServiceFactory > & /*rSMgr*/ ) { Reference< XInterface > xService = static_cast<cppu::OWeakObject*>(new Thesaurus); diff --git a/linguistic/source/convdic.cxx b/linguistic/source/convdic.cxx index c29afc0e25b1..6a08b11498d8 100644 --- a/linguistic/source/convdic.cxx +++ b/linguistic/source/convdic.cxx @@ -67,7 +67,7 @@ using namespace linguistic; #define SN_CONV_DICTIONARY "com.sun.star.linguistic2.ConversionDictionary" -void ReadThroughDic( const OUString &rMainURL, ConvDicXMLImport &rImport ) +static void ReadThroughDic( const OUString &rMainURL, ConvDicXMLImport &rImport ) { if (rMainURL.isEmpty()) return; diff --git a/linguistic/source/convdiclist.cxx b/linguistic/source/convdiclist.cxx index 58b7b8bc4a02..589a38aa42fd 100644 --- a/linguistic/source/convdiclist.cxx +++ b/linguistic/source/convdiclist.cxx @@ -62,7 +62,7 @@ using namespace linguistic; #define SN_CONV_DICTIONARY_LIST "com.sun.star.linguistic2.ConversionDictionaryList" -OUString GetConvDicMainURL( const OUString &rDicName, const OUString &rDirectoryURL ) +static OUString GetConvDicMainURL( const OUString &rDicName, const OUString &rDirectoryURL ) { // build URL to use for new (persistent) dictionaries @@ -561,7 +561,7 @@ uno::Sequence< OUString > ConvDicList::getSupportedServiceNames_Static() } /// @throws css::uno::Exception -uno::Reference< uno::XInterface > ConvDicList_CreateInstance( +static uno::Reference< uno::XInterface > ConvDicList_CreateInstance( const uno::Reference< XMultiServiceFactory > & /*rSMgr*/ ) { return StaticConvDicList::get(); diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx index 651cb6ed2731..7f875fc3cc05 100644 --- a/linguistic/source/dlistimp.cxx +++ b/linguistic/source/dlistimp.cxx @@ -364,7 +364,7 @@ sal_Int32 DicList::GetDicPos(const uno::Reference< XDictionary > &xDic) } /// @throws Exception -uno::Reference< XInterface > +static uno::Reference< XInterface > DicList_CreateInstance( const uno::Reference< XMultiServiceFactory > & /*rSMgr*/ ) { uno::Reference< XInterface > xService = static_cast<cppu::OWeakObject *>(new DicList); diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx index c104ee9a4f95..685947c4cdf8 100644 --- a/linguistic/source/gciterator.cxx +++ b/linguistic/source/gciterator.cxx @@ -219,13 +219,17 @@ static sal_Int32 lcl_BacktraceWhiteSpaces( const OUString &rText, sal_Int32 nSta } -extern "C" void lcl_workerfunc (void * gci) +extern "C" { + +static void lcl_workerfunc (void * gci) { osl_setThreadName("GrammarCheckingIterator"); static_cast<GrammarCheckingIterator*>(gci)->DequeueAndCheck(); } +} + static lang::Locale lcl_GetPrimaryLanguageOfSentence( const uno::Reference< text::XFlatParagraph >& xFlatPara, sal_Int32 nStartIndex ) diff --git a/linguistic/source/hhconvdic.cxx b/linguistic/source/hhconvdic.cxx index 2e8969b0dff6..801af0800947 100644 --- a/linguistic/source/hhconvdic.cxx +++ b/linguistic/source/hhconvdic.cxx @@ -56,7 +56,7 @@ using namespace i18n; // from i18npool/source/textconversion/textconversion_ko.cxx /// @throws RuntimeException -sal_Int16 checkScriptType(sal_Unicode c) +static sal_Int16 checkScriptType(sal_Unicode c) { UErrorCode status = U_ZERO_ERROR; @@ -69,7 +69,7 @@ sal_Int16 checkScriptType(sal_Unicode c) } -bool TextIsAllScriptType( const OUString &rTxt, sal_Int16 nScriptType ) +static bool TextIsAllScriptType( const OUString &rTxt, sal_Int16 nScriptType ) { bool bIsAll = true; for (sal_Int32 i = 0; i < rTxt.getLength() && bIsAll; ++i) diff --git a/linguistic/source/lngopt.cxx b/linguistic/source/lngopt.cxx index ec7816cf445c..cf89b437f98c 100644 --- a/linguistic/source/lngopt.cxx +++ b/linguistic/source/lngopt.cxx @@ -210,7 +210,7 @@ void LinguProps::launchEvent( const PropertyChangeEvent &rEvt ) const } /// @throws Exception -Reference< XInterface > LinguProps_CreateInstance( +static Reference< XInterface > LinguProps_CreateInstance( const Reference< XMultiServiceFactory > & /*rSMgr*/ ) { Reference< XInterface > xService = static_cast<cppu::OWeakObject*>(new LinguProps); diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx index b06ac83dfdf5..d62510c0645f 100644 --- a/linguistic/source/lngsvcmgr.cxx +++ b/linguistic/source/lngsvcmgr.cxx @@ -1941,7 +1941,7 @@ uno::Sequence< OUString > LngSvcMgr::getSupportedServiceNames_Static() } /// @throws uno::Exception -uno::Reference< uno::XInterface > LngSvcMgr_CreateInstance( +static uno::Reference< uno::XInterface > LngSvcMgr_CreateInstance( const uno::Reference< lang::XMultiServiceFactory > & /*rSMgr*/ ) { uno::Reference< uno::XInterface > xService = static_cast<cppu::OWeakObject*>(new LngSvcMgr); diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx index 1bf297d4589e..b49e4f555418 100644 --- a/linguistic/source/misc.cxx +++ b/linguistic/source/misc.cxx @@ -590,7 +590,7 @@ static CharClass & lcl_GetCharClass() return aCC; } -osl::Mutex & lcl_GetCharClassMutex() +static osl::Mutex & lcl_GetCharClassMutex() { static osl::Mutex aMutex; return aMutex; diff --git a/linguistic/source/spelldsp.cxx b/linguistic/source/spelldsp.cxx index 104dce04bff6..0251635c3d9f 100644 --- a/linguistic/source/spelldsp.cxx +++ b/linguistic/source/spelldsp.cxx @@ -154,7 +154,7 @@ std::vector< OUString > ProposalList::GetVector() const return aRes; } -bool SvcListHasLanguage( +static bool SvcListHasLanguage( const LangSvcEntries_Spell &rEntry, LanguageType nLanguage ) { diff --git a/linguistic/source/spelldta.cxx b/linguistic/source/spelldta.cxx index ded6f83bf846..7a0bc0f5d183 100644 --- a/linguistic/source/spelldta.cxx +++ b/linguistic/source/spelldta.cxx @@ -43,7 +43,7 @@ namespace linguistic #define MAX_PROPOSALS 40 -bool SeqHasEntry( +static bool SeqHasEntry( const std::vector< OUString > &rSeq, const OUString &rTxt) { diff --git a/lotuswordpro/source/filter/bencont.cxx b/lotuswordpro/source/filter/bencont.cxx index 19c7a446eaba..cb2f97f9d924 100644 --- a/lotuswordpro/source/filter/bencont.cxx +++ b/lotuswordpro/source/filter/bencont.cxx @@ -246,7 +246,7 @@ LtcUtBenValueStream * LtcBenContainer::FindValueStreamWithPropertyName(const cha return FindNextValueStreamWithPropertyName(sPropertyName); } -sal_uInt64 GetSvStreamSize(SvStream * pStream) +static sal_uInt64 GetSvStreamSize(SvStream * pStream) { sal_uInt64 nCurPos = pStream->Tell(); pStream->Seek(STREAM_SEEK_TO_END); diff --git a/lotuswordpro/source/filter/lwpfilter.cxx b/lotuswordpro/source/filter/lwpfilter.cxx index a6ac2ee17caa..afab92eb24ea 100644 --- a/lotuswordpro/source/filter/lwpfilter.cxx +++ b/lotuswordpro/source/filter/lwpfilter.cxx @@ -98,7 +98,7 @@ using namespace ::com::sun::star; #include "bento.hxx" using namespace OpenStormBento; #include "explode.hxx" -bool Decompress(SvStream *pCompressed, SvStream * & pOutDecompressed) +static bool Decompress(SvStream *pCompressed, SvStream * & pOutDecompressed) { pCompressed->Seek(0); std::unique_ptr<SvMemoryStream> aDecompressed(new SvMemoryStream(4096, 4096)); @@ -148,7 +148,7 @@ bool Decompress(SvStream *pCompressed, SvStream * & pOutDecompressed) * @param LwpSvStream * , created inside, deleted outside * @param sal_Bool, sal_True - */ - bool GetLwpSvStream(SvStream *pStream, LwpSvStream * & pLwpSvStream) +static bool GetLwpSvStream(SvStream *pStream, LwpSvStream * & pLwpSvStream) { SvStream * pDecompressed = nullptr; diff --git a/lotuswordpro/source/filter/xfilter/xfbase64.cxx b/lotuswordpro/source/filter/xfilter/xfbase64.cxx index 0a388f7b6a47..226541bf2659 100644 --- a/lotuswordpro/source/filter/xfilter/xfbase64.cxx +++ b/lotuswordpro/source/filter/xfilter/xfbase64.cxx @@ -72,7 +72,7 @@ const sal_Char aBase64EncodeTable[] = * @descr Encode 3 byte to 4 byte. * Please refer to RFC to get the base64 algorithm. */ -inline void Encode_(const sal_uInt8 *src, sal_Char* dest) +static inline void Encode_(const sal_uInt8 *src, sal_Char* dest) { sal_Int32 nBinaer = (src[ 0] << 16) + (src[1] << 8) + diff --git a/odk/source/unoapploader/unx/unoapploader.c b/odk/source/unoapploader/unx/unoapploader.c index 44086d331623..f0e33f817021 100644 --- a/odk/source/unoapploader/unx/unoapploader.c +++ b/odk/source/unoapploader/unx/unoapploader.c @@ -32,8 +32,8 @@ #include <rtl/string.h> #include <sal/types.h> -char* getPath(void); -char* createCommandName( char* argv0 ); +static char* getPath(void); +static char* createCommandName( char* argv0 ); static const int SEPARATOR = '/'; static const char* PATHSEPARATOR = ":"; diff --git a/oox/source/crypto/AgileEngine.cxx b/oox/source/crypto/AgileEngine.cxx index 54a8d952c66d..172f3b1f2120 100644 --- a/oox/source/crypto/AgileEngine.cxx +++ b/oox/source/crypto/AgileEngine.cxx @@ -230,7 +230,7 @@ Crypto::CryptoType AgileEngine::cryptoType(const AgileEncryptionInfo& rInfo) return Crypto::UNKNOWN; } -std::vector<sal_uInt8> calculateIV(comphelper::HashType eType, +static std::vector<sal_uInt8> calculateIV(comphelper::HashType eType, std::vector<sal_uInt8> const & rSalt, std::vector<sal_uInt8> const & rBlock, sal_Int32 nCipherBlockSize) diff --git a/oox/source/drawingml/customshapegeometry.cxx b/oox/source/drawingml/customshapegeometry.cxx index 5726ab425cff..bc4582cb7276 100644 --- a/oox/source/drawingml/customshapegeometry.cxx +++ b/oox/source/drawingml/customshapegeometry.cxx @@ -91,7 +91,7 @@ typedef std::unordered_map< OUString, FormularCommand > FormulaCommandHMap; static const FormulaCommandHMap* pCommandHashMap; -OUString GetFormulaParameter( const EnhancedCustomShapeParameter& rParameter ) +static OUString GetFormulaParameter( const EnhancedCustomShapeParameter& rParameter ) { OUString aRet; switch( rParameter.Type ) diff --git a/oox/source/drawingml/diagram/diagram.cxx b/oox/source/drawingml/diagram/diagram.cxx index 7dbd454f1595..901995bc2039 100644 --- a/oox/source/drawingml/diagram/diagram.cxx +++ b/oox/source/drawingml/diagram/diagram.cxx @@ -344,7 +344,7 @@ uno::Sequence<beans::PropertyValue> Diagram::getDomsAsPropertyValues() const return aValue; } -uno::Reference<xml::dom::XDocument> loadFragment( +static uno::Reference<xml::dom::XDocument> loadFragment( core::XmlFilterBase& rFilter, const OUString& rFragmentPath ) { @@ -353,14 +353,14 @@ uno::Reference<xml::dom::XDocument> loadFragment( return rFilter.importFragment( rFragmentPath ); } -uno::Reference<xml::dom::XDocument> loadFragment( +static uno::Reference<xml::dom::XDocument> loadFragment( core::XmlFilterBase& rFilter, const rtl::Reference< core::FragmentHandler >& rxHandler ) { return loadFragment( rFilter, rxHandler->getFragmentPath() ); } -void importFragment( core::XmlFilterBase& rFilter, +static void importFragment( core::XmlFilterBase& rFilter, const uno::Reference<xml::dom::XDocument>& rXDom, const char* pDocName, const DiagramPtr& pDiagram, diff --git a/oox/source/drawingml/table/tablecell.cxx b/oox/source/drawingml/table/tablecell.cxx index 7639743842b2..bfcf750f51e0 100644 --- a/oox/source/drawingml/table/tablecell.cxx +++ b/oox/source/drawingml/table/tablecell.cxx @@ -69,7 +69,7 @@ TableCell::~TableCell() { } -void applyLineAttributes( const ::oox::core::XmlFilterBase& rFilterBase, +static void applyLineAttributes( const ::oox::core::XmlFilterBase& rFilterBase, Reference< XPropertySet > const & rxPropSet, oox::drawingml::LineProperties& rLineProperties, sal_Int32 nPropId ) { @@ -135,7 +135,7 @@ void applyLineAttributes( const ::oox::core::XmlFilterBase& rFilterBase, aPropSet.setProperty( nPropId, aBorderLine ); } -void applyBorder( const ::oox::core::XmlFilterBase& rFilterBase, TableStylePart& rTableStylePart, sal_Int32 nLineType, oox::drawingml::LineProperties& rLineProperties ) +static void applyBorder( const ::oox::core::XmlFilterBase& rFilterBase, TableStylePart& rTableStylePart, sal_Int32 nLineType, oox::drawingml::LineProperties& rLineProperties ) { std::map < sal_Int32, ::oox::drawingml::LinePropertiesPtr >& rPartLineBorders( rTableStylePart.getLineBorders() ); ::oox::drawingml::ShapeStyleRef& rLineStyleRef = rTableStylePart.getStyleRefs()[ nLineType ]; @@ -153,7 +153,7 @@ void applyBorder( const ::oox::core::XmlFilterBase& rFilterBase, TableStylePart& } } -void applyTableStylePart( const ::oox::core::XmlFilterBase& rFilterBase, +static void applyTableStylePart( const ::oox::core::XmlFilterBase& rFilterBase, oox::drawingml::FillProperties& rFillProperties, TextCharacterProperties& aTextCharProps, oox::drawingml::LineProperties& rLeftBorder, @@ -201,7 +201,7 @@ void applyTableStylePart( const ::oox::core::XmlFilterBase& rFilterBase, aTextCharProps.moItalic = *rTableStylePart.getTextItalicStyle(); } -void applyTableCellProperties( const Reference < css::table::XCell >& rxCell, const TableCell& rTableCell ) +static void applyTableCellProperties( const Reference < css::table::XCell >& rxCell, const TableCell& rTableCell ) { Reference< XPropertySet > xPropSet( rxCell, UNO_QUERY_THROW ); xPropSet->setPropertyValue( "TextUpperDistance", Any( static_cast< sal_Int32 >( rTableCell.getTopMargin() / 360 ) ) ); diff --git a/oox/source/drawingml/table/tableproperties.cxx b/oox/source/drawingml/table/tableproperties.cxx index 00c5b765cfca..3701e1ecac9b 100644 --- a/oox/source/drawingml/table/tableproperties.cxx +++ b/oox/source/drawingml/table/tableproperties.cxx @@ -49,7 +49,7 @@ TableProperties::TableProperties() { } -void CreateTableRows( const uno::Reference< XTableRows >& xTableRows, const std::vector< TableRow >& rvTableRows ) +static void CreateTableRows( const uno::Reference< XTableRows >& xTableRows, const std::vector< TableRow >& rvTableRows ) { if ( rvTableRows.size() > 1 ) xTableRows->insertByIndex( 0, rvTableRows.size() - 1 ); @@ -64,7 +64,7 @@ void CreateTableRows( const uno::Reference< XTableRows >& xTableRows, const std: } } -void CreateTableColumns( const Reference< XTableColumns >& xTableColumns, const std::vector< sal_Int32 >& rvTableGrid ) +static void CreateTableColumns( const Reference< XTableColumns >& xTableColumns, const std::vector< sal_Int32 >& rvTableGrid ) { if ( rvTableGrid.size() > 1 ) xTableColumns->insertByIndex( 0, rvTableGrid.size() - 1 ); @@ -78,7 +78,7 @@ void CreateTableColumns( const Reference< XTableColumns >& xTableColumns, const } } -void MergeCells( const uno::Reference< XTable >& xTable, sal_Int32 nCol, sal_Int32 nRow, sal_Int32 nColSpan, sal_Int32 nRowSpan ) +static void MergeCells( const uno::Reference< XTable >& xTable, sal_Int32 nCol, sal_Int32 nRow, sal_Int32 nColSpan, sal_Int32 nRowSpan ) { if( xTable.is() ) try { @@ -140,7 +140,7 @@ static void SetTableStyleProperties(TableStyle* &pTableStyle , sal_Int32 tblFill pTableStyle->getLastCol().getTextBoldStyle() = textBoldStyle; } -TableStyle* CreateTableStyle(const OUString& styleId) +static TableStyle* CreateTableStyle(const OUString& styleId) { TableStyle* pTableStyle = nullptr; diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx index 77ab07b50423..6443064e40d2 100644 --- a/oox/source/drawingml/textcharacterproperties.cxx +++ b/oox/source/drawingml/textcharacterproperties.cxx @@ -155,7 +155,7 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil // TODO If bUnderlineFillFollowText uFillTx (CT_TextUnderlineFillFollowText) is set, fill color of the underline should be the same color as the text } -void pushToGrabBag( PropertySet& rPropSet, const std::vector<PropertyValue>& aVectorOfProperyValues ) +static void pushToGrabBag( PropertySet& rPropSet, const std::vector<PropertyValue>& aVectorOfProperyValues ) { if (!rPropSet.hasProperty(PROP_CharInteropGrabBag) || aVectorOfProperyValues.empty()) return; diff --git a/oox/source/drawingml/textliststyle.cxx b/oox/source/drawingml/textliststyle.cxx index 879fdea363d2..15475ddcacb0 100644 --- a/oox/source/drawingml/textliststyle.cxx +++ b/oox/source/drawingml/textliststyle.cxx @@ -63,7 +63,7 @@ TextListStyle& TextListStyle::operator=(const TextListStyle& rStyle) return *this; } -void applyStyleList( const TextParagraphPropertiesVector& rSourceListStyle, TextParagraphPropertiesVector& rDestListStyle ) +static void applyStyleList( const TextParagraphPropertiesVector& rSourceListStyle, TextParagraphPropertiesVector& rDestListStyle ) { TextParagraphPropertiesVector::iterator aDestListStyleIter( rDestListStyle.begin() ); for (auto const& elemSource : rSourceListStyle) diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 584774d9bbbc..63958cdb3f7a 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -156,7 +156,7 @@ private: OUString m_aRole; }; -Reference< chart2::data::XLabeledDataSequence > lcl_getCategories( const Reference< chart2::XDiagram > & xDiagram ) +static Reference< chart2::data::XLabeledDataSequence > lcl_getCategories( const Reference< chart2::XDiagram > & xDiagram ) { Reference< chart2::data::XLabeledDataSequence > xResult; try @@ -197,7 +197,7 @@ Reference< chart2::data::XLabeledDataSequence > lcl_getCategories( const Referen return xResult; } -Reference< chart2::data::XLabeledDataSequence > +static Reference< chart2::data::XLabeledDataSequence > lcl_getDataSequenceByRole( const Sequence< Reference< chart2::data::XLabeledDataSequence > > & aLabeledSeq, const OUString & rRole ) @@ -215,7 +215,7 @@ Reference< chart2::data::XLabeledDataSequence > return aNoResult; } -bool lcl_hasCategoryLabels( const Reference< chart2::XChartDocument >& xChartDoc ) +static bool lcl_hasCategoryLabels( const Reference< chart2::XChartDocument >& xChartDoc ) { //categories are always the first sequence Reference< chart2::XDiagram > xDiagram( xChartDoc->getFirstDiagram()); @@ -223,7 +223,7 @@ bool lcl_hasCategoryLabels( const Reference< chart2::XChartDocument >& xChartDoc return xCategories.is(); } -bool lcl_isSeriesAttachedToFirstAxis( +static bool lcl_isSeriesAttachedToFirstAxis( const Reference< chart2::XDataSeries > & xDataSeries ) { bool bResult=true; @@ -243,7 +243,7 @@ bool lcl_isSeriesAttachedToFirstAxis( return bResult; } -OUString lcl_flattenStringSequence( const Sequence< OUString > & rSequence ) +static OUString lcl_flattenStringSequence( const Sequence< OUString > & rSequence ) { OUStringBuffer aResult; bool bPrecedeWithSpace = false; @@ -260,7 +260,7 @@ OUString lcl_flattenStringSequence( const Sequence< OUString > & rSequence ) return aResult.makeStringAndClear(); } -OUString lcl_getLabelString( const Reference< chart2::data::XDataSequence > & xLabelSeq ) +static OUString lcl_getLabelString( const Reference< chart2::data::XDataSequence > & xLabelSeq ) { Sequence< OUString > aLabels; @@ -280,7 +280,7 @@ OUString lcl_getLabelString( const Reference< chart2::data::XDataSequence > & xL return lcl_flattenStringSequence( aLabels ); } -void lcl_fillCategoriesIntoStringVector( +static void lcl_fillCategoriesIntoStringVector( const Reference< chart2::data::XDataSequence > & xCategories, ::std::vector< OUString > & rOutCategories ) { @@ -304,7 +304,7 @@ void lcl_fillCategoriesIntoStringVector( } } -::std::vector< double > lcl_getAllValuesFromSequence( const Reference< chart2::data::XDataSequence > & xSeq ) +static ::std::vector< double > lcl_getAllValuesFromSequence( const Reference< chart2::data::XDataSequence > & xSeq ) { double fNan = 0.0; ::rtl::math::setNan( &fNan ); @@ -327,7 +327,7 @@ void lcl_fillCategoriesIntoStringVector( return aResult; } -sal_Int32 lcl_getChartType( const OUString& sChartType ) +static sal_Int32 lcl_getChartType( const OUString& sChartType ) { chart::TypeId eChartTypeId = chart::TYPEID_UNKNOWN; if( sChartType == "com.sun.star.chart.BarDiagram" @@ -364,7 +364,7 @@ sal_Int32 lcl_getChartType( const OUString& sChartType ) return eChartTypeId; } -sal_Int32 lcl_generateRandomValue() +static sal_Int32 lcl_generateRandomValue() { return comphelper::rng::uniform_int_distribution(0, 100000000-1); } diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index ee6a43b58df5..5824f51e19b6 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -134,7 +134,7 @@ namespace drawingml { #define CGETAD(propName) \ (( bCheckDirect && GetPropertyAndState( rXPropSet, rXPropState, #propName, eState ) && eState == beans::PropertyState_DIRECT_VALUE )||GetProperty( rXPropSet, #propName )) -css::uno::Any getLineDash( const css::uno::Reference<css::frame::XModel>& xModel, const OUString& rDashName ) +static css::uno::Any getLineDash( const css::uno::Reference<css::frame::XModel>& xModel, const OUString& rDashName ) { css::uno::Reference<css::lang::XMultiServiceFactory> xFact(xModel, css::uno::UNO_QUERY); css::uno::Reference<css::container::XNameAccess> xNameAccess( @@ -1908,7 +1908,7 @@ void DrawingML::WriteRun( const Reference< XTextRange >& rRun, } } -OUString GetAutoNumType(SvxNumType nNumberingType, bool bSDot, bool bPBehind, bool bPBoth) +static OUString GetAutoNumType(SvxNumType nNumberingType, bool bSDot, bool bPBehind, bool bPBoth) { OUString sPrefixSuffix; @@ -2597,7 +2597,7 @@ void DrawingML::WritePresetShape( const char* pShape ) mpFS->endElementNS( XML_a, XML_prstGeom ); } -std::map< OString, std::vector<OString> > lcl_getAdjNames() +static std::map< OString, std::vector<OString> > lcl_getAdjNames() { std::map< OString, std::vector<OString> > aRet; @@ -3339,12 +3339,12 @@ void DrawingML::WriteShapeEffect( const OUString& sName, const Sequence< Propert } } -sal_Int32 lcl_CalculateDist(const double dX, const double dY) +static sal_Int32 lcl_CalculateDist(const double dX, const double dY) { return static_cast< sal_Int32 >(sqrt(dX*dX + dY*dY) * 360); } -sal_Int32 lcl_CalculateDir(const double dX, const double dY) +static sal_Int32 lcl_CalculateDir(const double dX, const double dY) { return (static_cast< sal_Int32 >(basegfx::rad2deg(atan2(dY,dX)) * 60000) + 21600000) % 21600000; } diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 6fd56390233c..3f7e0912bf56 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -633,7 +633,7 @@ static bool lcl_IsOnWhitelist(OUString const & rShapeType) return std::find(vWhitelist.begin(), vWhitelist.end(), rShapeType) != vWhitelist.end(); } -bool lcl_GetHandlePosition( sal_Int32 &nValue, const EnhancedCustomShapeParameter &rParam, Sequence< EnhancedCustomShapeAdjustmentValue > &rSeq) +static bool lcl_GetHandlePosition( sal_Int32 &nValue, const EnhancedCustomShapeParameter &rParam, Sequence< EnhancedCustomShapeAdjustmentValue > &rSeq) { bool bAdj = false; if ( rParam.Value.getValueTypeClass() == TypeClass_DOUBLE ) @@ -667,7 +667,7 @@ bool lcl_GetHandlePosition( sal_Int32 &nValue, const EnhancedCustomShapeParamete return bAdj; } -void lcl_AnalyzeHandles( const uno::Sequence<beans::PropertyValues> & rHandles, +static void lcl_AnalyzeHandles( const uno::Sequence<beans::PropertyValues> & rHandles, std::vector< std::pair< sal_Int32, sal_Int32> > &rHandlePositionList, Sequence< EnhancedCustomShapeAdjustmentValue > &rSeq) { @@ -706,12 +706,12 @@ void lcl_AnalyzeHandles( const uno::Sequence<beans::PropertyValues> & rHandles, } } -void lcl_AppendAdjustmentValue( std::vector< std::pair< sal_Int32, sal_Int32> > &rAvList, sal_Int32 nAdjIdx, sal_Int32 nValue ) +static void lcl_AppendAdjustmentValue( std::vector< std::pair< sal_Int32, sal_Int32> > &rAvList, sal_Int32 nAdjIdx, sal_Int32 nValue ) { rAvList.emplace_back( nAdjIdx , nValue ); } -sal_Int32 lcl_NormalizeAngle( sal_Int32 nAngle ) +static sal_Int32 lcl_NormalizeAngle( sal_Int32 nAngle ) { nAngle = nAngle % 360; return nAngle < 0 ? ( nAngle + 360 ) : nAngle ; diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx index e980c9a7d325..ef30786b6f3d 100644 --- a/oox/source/export/vmlexport.cxx +++ b/oox/source/export/vmlexport.cxx @@ -335,14 +335,14 @@ static void impl_AddInt( sax_fastparser::FastAttributeList *pAttrList, sal_Int32 pAttrList->add( nElement, OString::number( nValue ).getStr() ); } -inline sal_uInt16 impl_GetUInt16( const sal_uInt8* &pVal ) +static inline sal_uInt16 impl_GetUInt16( const sal_uInt8* &pVal ) { sal_uInt16 nRet = *pVal++; nRet += ( *pVal++ ) << 8; return nRet; } -inline sal_Int32 impl_GetPointComponent( const sal_uInt8* &pVal, sal_uInt16 nPointSize ) +static inline sal_Int32 impl_GetPointComponent( const sal_uInt8* &pVal, sal_uInt16 nPointSize ) { sal_Int32 nRet = 0; if ( ( nPointSize == 0xfff0 ) || ( nPointSize == 4 ) ) @@ -1104,7 +1104,7 @@ void VMLExport::AddShapeAttribute( sal_Int32 nAttribute, const OString& rValue ) m_pShapeAttrList->add( nAttribute, rValue ); } -std::vector<OString> lcl_getShapeTypes() +static std::vector<OString> lcl_getShapeTypes() { std::vector<OString> aRet; @@ -1125,7 +1125,7 @@ std::vector<OString> lcl_getShapeTypes() return aRet; } -bool lcl_isTextBox(const SdrObject* pSdrObject) +static bool lcl_isTextBox(const SdrObject* pSdrObject) { uno::Reference<beans::XPropertySet> xPropertySet(const_cast<SdrObject*>(pSdrObject)->getUnoShape(), uno::UNO_QUERY); if (xPropertySet.is()) @@ -1136,7 +1136,7 @@ bool lcl_isTextBox(const SdrObject* pSdrObject) return false; } -OUString lcl_getAnchorIdFromGrabBag(const SdrObject* pSdrObject) +static OUString lcl_getAnchorIdFromGrabBag(const SdrObject* pSdrObject) { OUString aResult; diff --git a/oox/source/ole/olehelper.cxx b/oox/source/ole/olehelper.cxx index 640787cdada6..5dd58e5c7de6 100644 --- a/oox/source/ole/olehelper.cxx +++ b/oox/source/ole/olehelper.cxx @@ -315,7 +315,7 @@ bool OleHelper::importStdPic( StreamDataSequence& orGraphicData, BinaryInputStre return !rInStrm.isEof() && (nStdPicId == OLE_STDPIC_ID) && (nBytes > 0) && (rInStrm.readData( orGraphicData, nBytes ) == nBytes); } -Reference< css::frame::XFrame > lcl_getFrame( const Reference< css::frame::XModel >& rxModel ) +static Reference< css::frame::XFrame > lcl_getFrame( const Reference< css::frame::XModel >& rxModel ) { Reference< css::frame::XFrame > xFrame; if ( rxModel.is() ) diff --git a/oox/source/ole/vbaexport.cxx b/oox/source/ole/vbaexport.cxx index 5d0d07be49a4..1dd2b5d25537 100644 --- a/oox/source/ole/vbaexport.cxx +++ b/oox/source/ole/vbaexport.cxx @@ -100,7 +100,7 @@ VBACompressionChunk::VBACompressionChunk(SvStream& rCompressedStream, const sal_ { } -void setUInt16(sal_uInt8* pBuffer, size_t nPos, sal_uInt16 nVal) +static void setUInt16(sal_uInt8* pBuffer, size_t nPos, sal_uInt16 nVal) { pBuffer[nPos] = nVal & 0xFF; pBuffer[nPos+1] = (nVal & 0xFF00) >> 8; diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx index 1ba3cdbd2e7e..bbf725620b76 100644 --- a/oox/source/ppt/presentationfragmenthandler.cxx +++ b/oox/source/ppt/presentationfragmenthandler.cxx @@ -100,7 +100,7 @@ PresentationFragmentHandler::~PresentationFragmentHandler() throw() { } -void ResolveTextFields( XmlFilterBase const & rFilter ) +static void ResolveTextFields( XmlFilterBase const & rFilter ) { const oox::core::TextFieldStack& rTextFields = rFilter.getTextFieldStack(); if ( !rTextFields.empty() ) diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx index f56bee7469a1..010f582b838b 100644 --- a/oox/source/ppt/slidepersist.cxx +++ b/oox/source/ppt/slidepersist.cxx @@ -179,7 +179,7 @@ void SlidePersist::createBackground( const XmlFilterBase& rFilterBase ) } } -void setTextStyle( Reference< beans::XPropertySet > const & rxPropSet, const XmlFilterBase& rFilter, +static void setTextStyle( Reference< beans::XPropertySet > const & rxPropSet, const XmlFilterBase& rFilter, oox::drawingml::TextListStylePtr const & pTextListStylePtr, int nLevel ) { ::oox::drawingml::TextParagraphPropertiesPtr pTextParagraphPropertiesPtr( pTextListStylePtr->getListStyle()[ nLevel ] ); diff --git a/oox/source/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx index 99c95eab372e..cbd40329ffe8 100644 --- a/oox/source/vml/vmlformatting.cxx +++ b/oox/source/vml/vmlformatting.cxx @@ -717,7 +717,7 @@ void FillModel::assignUsed( const FillModel& rSource ) moRotate.assignIfUsed( rSource.moRotate ); } -void lcl_setGradientStop( std::multimap< double, Color >& rMap, const double fKey, const Color& rValue ) { +static void lcl_setGradientStop( std::multimap< double, Color >& rMap, const double fKey, const Color& rValue ) { auto aElement = rMap.find( fKey ); if (aElement != rMap.end()) @@ -883,7 +883,7 @@ TextpathModel::TextpathModel() { } -beans::PropertyValue lcl_createTextpathProps() +static beans::PropertyValue lcl_createTextpathProps() { uno::Sequence<beans::PropertyValue> aTextpathPropSeq( comphelper::InitPropertySequence({ { "TextPath", uno::Any(true) }, diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index ad811a0d3065..ee80a0cfbd98 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -554,7 +554,7 @@ SimpleShape::SimpleShape( Drawing& rDrawing, const OUString& rService ) : { } -void lcl_setSurround(PropertySet& rPropSet, const ShapeTypeModel& rTypeModel, const GraphicHelper& rGraphicHelper) +static void lcl_setSurround(PropertySet& rPropSet, const ShapeTypeModel& rTypeModel, const GraphicHelper& rGraphicHelper) { OUString aWrapType = rTypeModel.moWrapType.get(); @@ -579,7 +579,7 @@ void lcl_setSurround(PropertySet& rPropSet, const ShapeTypeModel& rTypeModel, co rPropSet.setProperty(PROP_Surround, static_cast<sal_Int32>(nSurround)); } -void lcl_SetAnchorType(PropertySet& rPropSet, const ShapeTypeModel& rTypeModel, const GraphicHelper& rGraphicHelper) +static void lcl_SetAnchorType(PropertySet& rPropSet, const ShapeTypeModel& rTypeModel, const GraphicHelper& rGraphicHelper) { if ( rTypeModel.maPosition == "absolute" ) { diff --git a/opencl/source/openclwrapper.cxx b/opencl/source/openclwrapper.cxx index 0f742cf42231..b276197eb93a 100644 --- a/opencl/source/openclwrapper.cxx +++ b/opencl/source/openclwrapper.cxx @@ -109,7 +109,7 @@ OString const & getCacheFolder() } -bool initializeCommandQueue(GPUEnv& aGpuEnv) +static bool initializeCommandQueue(GPUEnv& aGpuEnv) { OpenCLZone zone; diff --git a/package/source/manifest/ManifestReader.cxx b/package/source/manifest/ManifestReader.cxx index 21e662e06baf..27d3ab00fd18 100644 --- a/package/source/manifest/ManifestReader.cxx +++ b/package/source/manifest/ManifestReader.cxx @@ -80,7 +80,7 @@ Sequence< Sequence< PropertyValue > > SAL_CALL ManifestReader::readManifestSeque } // Component functions -Reference < XInterface > ManifestReader_createInstance( Reference< XMultiServiceFactory > const & rServiceFactory ) +static Reference < XInterface > ManifestReader_createInstance( Reference< XMultiServiceFactory > const & rServiceFactory ) { return *new ManifestReader( comphelper::getComponentContext(rServiceFactory) ); } diff --git a/package/source/manifest/ManifestWriter.cxx b/package/source/manifest/ManifestWriter.cxx index 24f4a59c4361..871ed999951a 100644 --- a/package/source/manifest/ManifestWriter.cxx +++ b/package/source/manifest/ManifestWriter.cxx @@ -73,7 +73,7 @@ void SAL_CALL ManifestWriter::writeManifestSequence( const Reference< XOutputStr } // Component methods -Reference < XInterface > ManifestWriter_createInstance( Reference< XMultiServiceFactory > const & rServiceFactory ) +static Reference < XInterface > ManifestWriter_createInstance( Reference< XMultiServiceFactory > const & rServiceFactory ) { return *new ManifestWriter( comphelper::getComponentContext(rServiceFactory) ); } diff --git a/package/source/xstor/xfactory.cxx b/package/source/xstor/xfactory.cxx index 8aeb7979749d..2fec79f49965 100644 --- a/package/source/xstor/xfactory.cxx +++ b/package/source/xstor/xfactory.cxx @@ -45,7 +45,7 @@ using namespace ::com::sun::star; #define THROW_WHERE "" #endif -bool CheckPackageSignature_Impl( const uno::Reference< io::XInputStream >& xInputStream, +static bool CheckPackageSignature_Impl( const uno::Reference< io::XInputStream >& xInputStream, const uno::Reference< io::XSeekable >& xSeekable ) { if ( !xInputStream.is() || !xSeekable.is() ) diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx index adc4a3a2d661..f52fff8c6ea6 100644 --- a/package/source/xstor/xstorage.cxx +++ b/package/source/xstor/xstorage.cxx @@ -143,7 +143,7 @@ void OStorage_Impl::completeStorageStreamCopy_Impl( xDestProps->setPropertyValue( aPropNames[ind], xSourceProps->getPropertyValue( aPropNames[ind] ) ); } -uno::Reference< io::XInputStream > GetSeekableTempCopy( const uno::Reference< io::XInputStream >& xInStream, +static uno::Reference< io::XInputStream > GetSeekableTempCopy( const uno::Reference< io::XInputStream >& xInStream, const uno::Reference< uno::XComponentContext >& xContext ) { uno::Reference < io::XTempFile > xTempFile = io::TempFile::create(xContext); diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index 83ec8bcbcc72..16efa6c4afba 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -1675,7 +1675,7 @@ Sequence< ElementChange > SAL_CALL ZipPackage::getPendingChanges() * Function to create a new component instance; is needed by factory helper implementation. * @param xMgr service manager to if the components needs other component instances */ -uno::Reference < XInterface > ZipPackage_createInstance( +static uno::Reference < XInterface > ZipPackage_createInstance( const uno::Reference< XMultiServiceFactory > & xMgr ) { return uno::Reference< XInterface >( *new ZipPackage( comphelper::getComponentContext(xMgr) ) ); diff --git a/pyuno/source/loader/pyuno_loader.cxx b/pyuno/source/loader/pyuno_loader.cxx index 31b4f8f494f9..d1cbc9156dfc 100644 --- a/pyuno/source/loader/pyuno_loader.cxx +++ b/pyuno/source/loader/pyuno_loader.cxx @@ -106,12 +106,12 @@ static PyRef getObjectFromLoaderModule( const char * func ) return object; } -OUString getImplementationName() +static OUString getImplementationName() { return OUString( "org.openoffice.comp.pyuno.Loader" ); } -Sequence< OUString > getSupportedServiceNames() +static Sequence< OUString > getSupportedServiceNames() { OUString serviceName( "com.sun.star.loader.Python" ); return Sequence< OUString > ( &serviceName, 1 ); @@ -238,7 +238,7 @@ PythonInit() { } }; -Reference<XInterface> CreateInstance(const Reference<XComponentContext> & ctx) +static Reference<XInterface> CreateInstance(const Reference<XComponentContext> & ctx) { // tdf#114815 thread-safe static to init python only once static PythonInit s_Init; diff --git a/pyuno/source/module/pyuno.cxx b/pyuno/source/module/pyuno.cxx index dc73a754609d..434888f59e6e 100644 --- a/pyuno/source/module/pyuno.cxx +++ b/pyuno/source/module/pyuno.cxx @@ -71,9 +71,9 @@ using com::sun::star::container::XNameReplace; namespace pyuno { -PyObject *PyUNO_str( PyObject * self ); +static PyObject *PyUNO_str( PyObject * self ); -void PyUNO_del (PyObject* self) +static void PyUNO_del (PyObject* self) { PyUNO* me = reinterpret_cast< PyUNO* > (self); { @@ -309,7 +309,7 @@ OUString val2str( const void * pVal, typelib_TypeDescriptionReference * pTypeRef return buf.makeStringAndClear(); } -sal_Int32 lcl_PyNumber_AsSal_Int32( PyObject *pObj ) +static sal_Int32 lcl_PyNumber_AsSal_Int32( PyObject *pObj ) { // Check object is an index PyRef rIndex( PyNumber_Index( pObj ), SAL_NO_ACQUIRE ); @@ -333,7 +333,7 @@ sal_Int32 lcl_PyNumber_AsSal_Int32( PyObject *pObj ) return nResult; } -int lcl_PySlice_GetIndicesEx( PyObject *pObject, sal_Int32 nLen, sal_Int32 *nStart, sal_Int32 *nStop, sal_Int32 *nStep, sal_Int32 *nSliceLength ) +static int lcl_PySlice_GetIndicesEx( PyObject *pObject, sal_Int32 nLen, sal_Int32 *nStart, sal_Int32 *nStop, sal_Int32 *nStep, sal_Int32 *nSliceLength ) { Py_ssize_t nStart_ssize, nStop_ssize, nStep_ssize, nSliceLength_ssize; @@ -363,7 +363,7 @@ int lcl_PySlice_GetIndicesEx( PyObject *pObject, sal_Int32 nLen, sal_Int32 *nSta return 0; } -bool lcl_hasInterfaceByName( Any const &object, OUString const & interfaceName ) +static bool lcl_hasInterfaceByName( Any const &object, OUString const & interfaceName ) { Reference< XInterface > xInterface( object, UNO_QUERY ); TypeDescription typeDesc( interfaceName ); @@ -372,12 +372,12 @@ bool lcl_hasInterfaceByName( Any const &object, OUString const & interfaceName ) return aInterface.hasValue(); } -PyObject *PyUNO_repr( PyObject * self ) +static PyObject *PyUNO_repr( PyObject * self ) { return PyUNO_str( self ); } -Py_hash_t PyUNO_hash( PyObject *self ) +static Py_hash_t PyUNO_hash( PyObject *self ) { PyUNO *me = reinterpret_cast<PyUNO *>(self); @@ -476,7 +476,7 @@ PyObject *PyUNO_str( PyObject * self ) return PyStr_FromString( buf.getStr() ); } -PyObject* PyUNO_dir (PyObject* self) +static PyObject* PyUNO_dir (PyObject* self) { PyUNO* me = reinterpret_cast<PyUNO*>(self); @@ -501,7 +501,7 @@ PyObject* PyUNO_dir (PyObject* self) return member_list; } -sal_Int32 lcl_detach_getLength( PyUNO const *me ) +static sal_Int32 lcl_detach_getLength( PyUNO const *me ) { PyThreadDetach antiguard; @@ -527,7 +527,7 @@ sal_Int32 lcl_detach_getLength( PyUNO const *me ) return -1; } -int PyUNO_bool( PyObject* self ) +static int PyUNO_bool( PyObject* self ) { PyUNO* me = reinterpret_cast<PyUNO*>(self); @@ -548,7 +548,7 @@ int PyUNO_bool( PyObject* self ) return -1; } -Py_ssize_t PyUNO_len( PyObject* self ) +static Py_ssize_t PyUNO_len( PyObject* self ) { PyUNO* me = reinterpret_cast<PyUNO*>(self); @@ -568,7 +568,7 @@ Py_ssize_t PyUNO_len( PyObject* self ) return -1; } -void lcl_getRowsColumns( PyUNO const * me, sal_Int32& nRows, sal_Int32& nColumns ) +static void lcl_getRowsColumns( PyUNO const * me, sal_Int32& nRows, sal_Int32& nColumns ) { Sequence<short> aOutParamIndex; Sequence<Any> aOutParam; @@ -583,7 +583,7 @@ void lcl_getRowsColumns( PyUNO const * me, sal_Int32& nRows, sal_Int32& nColumns nColumns = xIndexAccessCols->getCount(); } -PyRef lcl_indexToSlice( const PyRef& rIndex ) +static PyRef lcl_indexToSlice( const PyRef& rIndex ) { Py_ssize_t nIndex = PyNumber_AsSsize_t( rIndex.get(), PyExc_IndexError ); if (nIndex == -1 && PyErr_Occurred()) @@ -596,7 +596,7 @@ PyRef lcl_indexToSlice( const PyRef& rIndex ) return rSlice; } -PyObject* lcl_getitem_XCellRange( PyUNO const * me, PyObject* pKey ) +static PyObject* lcl_getitem_XCellRange( PyUNO const * me, PyObject* pKey ) { Runtime runtime; @@ -717,7 +717,7 @@ PyObject* lcl_getitem_XCellRange( PyUNO const * me, PyObject* pKey ) return nullptr; } -PyObject* lcl_getitem_index( PyUNO const *me, PyObject *pKey, Runtime const & runtime ) +static PyObject* lcl_getitem_index( PyUNO const *me, PyObject *pKey, Runtime const & runtime ) { Any aRet; sal_Int32 nIndex; @@ -746,7 +746,7 @@ PyObject* lcl_getitem_index( PyUNO const *me, PyObject *pKey, Runtime const & ru return nullptr; } -PyObject* lcl_getitem_slice( PyUNO const *me, PyObject *pKey ) +static PyObject* lcl_getitem_slice( PyUNO const *me, PyObject *pKey ) { Runtime runtime; @@ -789,7 +789,7 @@ PyObject* lcl_getitem_slice( PyUNO const *me, PyObject *pKey ) return nullptr; } -PyObject* lcl_getitem_string( PyUNO const *me, PyObject *pKey, Runtime const & runtime ) +static PyObject* lcl_getitem_string( PyUNO const *me, PyObject *pKey, Runtime const & runtime ) { OUString sKey = pyString2ustring( pKey ); Any aRet; @@ -812,7 +812,7 @@ PyObject* lcl_getitem_string( PyUNO const *me, PyObject *pKey, Runtime const & r return nullptr; } -PyObject* PyUNO_getitem( PyObject *self, PyObject *pKey ) +static PyObject* PyUNO_getitem( PyObject *self, PyObject *pKey ) { PyUNO* me = reinterpret_cast<PyUNO*>(self); Runtime runtime; @@ -899,7 +899,7 @@ PyObject* PyUNO_getitem( PyObject *self, PyObject *pKey ) return nullptr; } -int lcl_setitem_index( PyUNO const *me, PyObject *pKey, PyObject *pValue ) +static int lcl_setitem_index( PyUNO const *me, PyObject *pKey, PyObject *pValue ) { Runtime runtime; @@ -967,7 +967,7 @@ int lcl_setitem_index( PyUNO const *me, PyObject *pKey, PyObject *pValue ) return 1; } -int lcl_setitem_slice( PyUNO const *me, PyObject *pKey, PyObject *pValue ) +static int lcl_setitem_slice( PyUNO const *me, PyObject *pKey, PyObject *pValue ) { // XIndexContainer insert/remove/replace by slice Runtime runtime; @@ -1085,7 +1085,7 @@ int lcl_setitem_slice( PyUNO const *me, PyObject *pKey, PyObject *pValue ) return 1; } -int lcl_setitem_string( PyUNO const *me, PyObject *pKey, PyObject *pValue ) +static int lcl_setitem_string( PyUNO const *me, PyObject *pKey, PyObject *pValue ) { Runtime runtime; @@ -1157,7 +1157,7 @@ int lcl_setitem_string( PyUNO const *me, PyObject *pKey, PyObject *pValue ) return 1; } -int PyUNO_setitem( PyObject *self, PyObject *pKey, PyObject *pValue ) +static int PyUNO_setitem( PyObject *self, PyObject *pKey, PyObject *pValue ) { PyUNO* me = reinterpret_cast<PyUNO*>(self); @@ -1210,7 +1210,7 @@ int PyUNO_setitem( PyObject *self, PyObject *pKey, PyObject *pValue ) return 1; } -PyObject* PyUNO_iter( PyObject *self ) +static PyObject* PyUNO_iter( PyObject *self ) { PyUNO* me = reinterpret_cast<PyUNO*>(self); @@ -1286,7 +1286,7 @@ PyObject* PyUNO_iter( PyObject *self ) return nullptr; } -int PyUNO_contains( PyObject *self, PyObject *pKey ) +static int PyUNO_contains( PyObject *self, PyObject *pKey ) { PyUNO* me = reinterpret_cast<PyUNO*>(self); @@ -1375,7 +1375,7 @@ int PyUNO_contains( PyObject *self, PyObject *pKey ) return -1; } -PyObject* PyUNO_getattr (PyObject* self, char* name) +static PyObject* PyUNO_getattr (PyObject* self, char* name) { PyUNO* me; @@ -1455,7 +1455,7 @@ PyObject* PyUNO_getattr (PyObject* self, char* name) return nullptr; } -int PyUNO_setattr (PyObject* self, char* name, PyObject* value) +static int PyUNO_setattr (PyObject* self, char* name, PyObject* value) { PyUNO* me; diff --git a/pyuno/source/module/pyuno_callable.cxx b/pyuno/source/module/pyuno_callable.cxx index 2075fc7e372f..4269b09b21e3 100644 --- a/pyuno/source/module/pyuno_callable.cxx +++ b/pyuno/source/module/pyuno_callable.cxx @@ -43,7 +43,7 @@ typedef struct PyUNO_callable_Internals* members; } PyUNO_callable; -void PyUNO_callable_del (PyObject* self) +static void PyUNO_callable_del (PyObject* self) { PyUNO_callable* me; @@ -52,7 +52,7 @@ void PyUNO_callable_del (PyObject* self) PyObject_Del (self); } -PyObject* PyUNO_callable_call( +static PyObject* PyUNO_callable_call( PyObject* self, PyObject* args, SAL_UNUSED_PARAMETER PyObject*) { PyUNO_callable* me; diff --git a/pyuno/source/module/pyuno_iterator.cxx b/pyuno/source/module/pyuno_iterator.cxx index 5a36a32d516d..5847d881a90e 100644 --- a/pyuno/source/module/pyuno_iterator.cxx +++ b/pyuno/source/module/pyuno_iterator.cxx @@ -40,7 +40,7 @@ using com::sun::star::uno::RuntimeException; namespace pyuno { -void PyUNO_iterator_del( PyObject* self ) +static void PyUNO_iterator_del( PyObject* self ) { PyUNO_iterator* me = reinterpret_cast<PyUNO_iterator*>(self); @@ -51,13 +51,13 @@ void PyUNO_iterator_del( PyObject* self ) PyObject_Del( self ); } -PyObject* PyUNO_iterator_iter( PyObject *self ) +static PyObject* PyUNO_iterator_iter( PyObject *self ) { Py_INCREF( self ); return self; } -PyObject* PyUNO_iterator_next( PyObject *self ) +static PyObject* PyUNO_iterator_next( PyObject *self ) { PyUNO_iterator* me = reinterpret_cast<PyUNO_iterator*>(self); @@ -178,7 +178,7 @@ PyObject* PyUNO_iterator_new( const Reference< XEnumeration >& xEnumeration ) /////////////////////////////////////////////////////////////////////////////// -void PyUNO_list_iterator_del( PyObject* self ) +static void PyUNO_list_iterator_del( PyObject* self ) { PyUNO_list_iterator* me = reinterpret_cast<PyUNO_list_iterator*>(self); @@ -190,7 +190,7 @@ void PyUNO_list_iterator_del( PyObject* self ) } -PyObject* PyUNO_list_iterator_next( PyObject *self ) +static PyObject* PyUNO_list_iterator_next( PyObject *self ) { PyUNO_list_iterator* me = reinterpret_cast<PyUNO_list_iterator*>(self); diff --git a/pyuno/source/module/pyuno_struct.cxx b/pyuno/source/module/pyuno_struct.cxx index 2fbb81350387..35eab1d0ed9e 100644 --- a/pyuno/source/module/pyuno_struct.cxx +++ b/pyuno/source/module/pyuno_struct.cxx @@ -47,7 +47,7 @@ using com::sun::star::beans::XMaterialHolder; namespace pyuno { -void PyUNOStruct_del( PyObject* self ) +static void PyUNOStruct_del( PyObject* self ) { PyUNO *me = reinterpret_cast<PyUNO*>( self ); { @@ -57,7 +57,7 @@ void PyUNOStruct_del( PyObject* self ) PyObject_Del( self ); } -PyObject *PyUNOStruct_str( PyObject *self ) +static PyObject *PyUNOStruct_str( PyObject *self ) { PyUNO *me = reinterpret_cast<PyUNO*>( self ); OStringBuffer buf; @@ -74,7 +74,7 @@ PyObject *PyUNOStruct_str( PyObject *self ) return PyStr_FromString( buf.getStr()); } -PyObject *PyUNOStruct_repr( PyObject *self ) +static PyObject *PyUNOStruct_repr( PyObject *self ) { PyUNO *me = reinterpret_cast<PyUNO*>( self ); PyObject *ret = nullptr; @@ -99,7 +99,7 @@ PyObject *PyUNOStruct_repr( PyObject *self ) return ret; } -PyObject* PyUNOStruct_dir( PyObject *self ) +static PyObject* PyUNOStruct_dir( PyObject *self ) { PyUNO *me = reinterpret_cast<PyUNO*>( self ); @@ -122,7 +122,7 @@ PyObject* PyUNOStruct_dir( PyObject *self ) return member_list; } -PyObject* PyUNOStruct_getattr( PyObject* self, char* name ) +static PyObject* PyUNOStruct_getattr( PyObject* self, char* name ) { PyUNO *me = reinterpret_cast<PyUNO*>( self ); @@ -188,7 +188,7 @@ PyObject* PyUNOStruct_getattr( PyObject* self, char* name ) return nullptr; } -int PyUNOStruct_setattr (PyObject* self, char* name, PyObject* value) +static int PyUNOStruct_setattr (PyObject* self, char* name, PyObject* value) { PyUNO* me; diff --git a/remotebridges/source/unourl_resolver/unourl_resolver.cxx b/remotebridges/source/unourl_resolver/unourl_resolver.cxx index e753a4eb0bd9..18b74f76b2ba 100644 --- a/remotebridges/source/unourl_resolver/unourl_resolver.cxx +++ b/remotebridges/source/unourl_resolver/unourl_resolver.cxx @@ -44,13 +44,13 @@ using namespace com::sun::star::registry; namespace unourl_resolver { -Sequence< OUString > resolver_getSupportedServiceNames() +static Sequence< OUString > resolver_getSupportedServiceNames() { Sequence< OUString > seqNames { "com.sun.star.bridge.UnoUrlResolver" }; return seqNames; } -OUString resolver_getImplementationName() +static OUString resolver_getImplementationName() { return OUString(IMPLNAME); } diff --git a/reportdesign/source/core/api/FixedLine.cxx b/reportdesign/source/core/api/FixedLine.cxx index 1b0b74a7fb78..2d80b075a1df 100644 --- a/reportdesign/source/core/api/FixedLine.cxx +++ b/reportdesign/source/core/api/FixedLine.cxx @@ -35,7 +35,7 @@ namespace reportdesign { using namespace com::sun::star; -uno::Sequence< OUString > lcl_getLineOptionals() +static uno::Sequence< OUString > lcl_getLineOptionals() { OUString pProps[] = { OUString(PROPERTY_DATAFIELD) diff --git a/reportdesign/source/core/api/FixedText.cxx b/reportdesign/source/core/api/FixedText.cxx index f14f113320fb..5a63491dce69 100644 --- a/reportdesign/source/core/api/FixedText.cxx +++ b/reportdesign/source/core/api/FixedText.cxx @@ -34,7 +34,7 @@ namespace reportdesign using namespace com::sun::star; -uno::Sequence< OUString > lcl_getFixedTextOptionals() +static uno::Sequence< OUString > lcl_getFixedTextOptionals() { OUString pProps[] = { OUString(PROPERTY_DATAFIELD),OUString(PROPERTY_MASTERFIELDS),OUString(PROPERTY_DETAILFIELDS) }; return uno::Sequence< OUString >(pProps,SAL_N_ELEMENTS(pProps)); diff --git a/reportdesign/source/core/api/FormattedField.cxx b/reportdesign/source/core/api/FormattedField.cxx index 80068d54bd8b..6ba798b977ba 100644 --- a/reportdesign/source/core/api/FormattedField.cxx +++ b/reportdesign/source/core/api/FormattedField.cxx @@ -42,7 +42,7 @@ uno::Reference< uno::XInterface > OFormattedField::create(uno::Reference< uno::X return *(new OFormattedField(xContext)); } -uno::Sequence< OUString > lcl_getFormattedFieldOptionals() +static uno::Sequence< OUString > lcl_getFormattedFieldOptionals() { OUString pProps[] = { OUString(PROPERTY_MASTERFIELDS),OUString(PROPERTY_DETAILFIELDS) }; return uno::Sequence< OUString >(pProps,SAL_N_ELEMENTS(pProps)); diff --git a/reportdesign/source/core/api/ImageControl.cxx b/reportdesign/source/core/api/ImageControl.cxx index 7d50aab65073..247d1042824f 100644 --- a/reportdesign/source/core/api/ImageControl.cxx +++ b/reportdesign/source/core/api/ImageControl.cxx @@ -34,7 +34,7 @@ namespace reportdesign { using namespace com::sun::star; -uno::Sequence< OUString > lcl_getImageOptionals() +static uno::Sequence< OUString > lcl_getImageOptionals() { OUString pProps[] = { OUString(PROPERTY_CHARCOLOR) diff --git a/reportdesign/source/core/api/ReportComponent.cxx b/reportdesign/source/core/api/ReportComponent.cxx index 2929daec53af..189123e76ad0 100644 --- a/reportdesign/source/core/api/ReportComponent.cxx +++ b/reportdesign/source/core/api/ReportComponent.cxx @@ -44,7 +44,7 @@ namespace reportdesign using namespace com::sun::star; using namespace comphelper; -void lcl_getDefaultFonts( vcl::Font& rLatinFont, vcl::Font& rCJKFont, vcl::Font& rCTLFont, LanguageType _eLatin, LanguageType _eCJK, LanguageType _eCTL ) +static void lcl_getDefaultFonts( vcl::Font& rLatinFont, vcl::Font& rCJKFont, vcl::Font& rCTLFont, LanguageType _eLatin, LanguageType _eCJK, LanguageType _eCTL ) { LanguageType eLatin = _eLatin; diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx index 1b7e66981d55..45dc3857c01c 100644 --- a/reportdesign/source/core/api/ReportDefinition.cxx +++ b/reportdesign/source/core/api/ReportDefinition.cxx @@ -188,7 +188,7 @@ namespace reportdesign using namespace com::sun::star; using namespace rptui; -void lcl_setModelReadOnly(const uno::Reference< embed::XStorage >& _xStorage,std::shared_ptr<rptui::OReportModel> const & _rModel) +static void lcl_setModelReadOnly(const uno::Reference< embed::XStorage >& _xStorage,std::shared_ptr<rptui::OReportModel> const & _rModel) { uno::Reference<beans::XPropertySet> xProp(_xStorage,uno::UNO_QUERY); sal_Int32 nOpenMode = embed::ElementModes::READ; @@ -197,7 +197,7 @@ void lcl_setModelReadOnly(const uno::Reference< embed::XStorage >& _xStorage,std _rModel->SetReadOnly((nOpenMode & embed::ElementModes::WRITE) != embed::ElementModes::WRITE); } -void lcl_stripLoadArguments( utl::MediaDescriptor& _rDescriptor, uno::Sequence< beans::PropertyValue >& _rArgs ) +static void lcl_stripLoadArguments( utl::MediaDescriptor& _rDescriptor, uno::Sequence< beans::PropertyValue >& _rArgs ) { _rDescriptor.erase( OUString( "StatusIndicator" ) ); _rDescriptor.erase( OUString( "InteractionHandler" ) ); @@ -205,7 +205,7 @@ void lcl_stripLoadArguments( utl::MediaDescriptor& _rDescriptor, uno::Sequence< _rDescriptor >> _rArgs; } -void lcl_extractAndStartStatusIndicator( const utl::MediaDescriptor& _rDescriptor, uno::Reference< task::XStatusIndicator >& _rxStatusIndicator, +static void lcl_extractAndStartStatusIndicator( const utl::MediaDescriptor& _rDescriptor, uno::Reference< task::XStatusIndicator >& _rxStatusIndicator, uno::Sequence< uno::Any >& _rCallArgs ) { try diff --git a/reportdesign/source/core/api/Section.cxx b/reportdesign/source/core/api/Section.cxx index 9b497320fbd5..4340b77405b2 100644 --- a/reportdesign/source/core/api/Section.cxx +++ b/reportdesign/source/core/api/Section.cxx @@ -43,7 +43,7 @@ namespace reportdesign using namespace comphelper; -uno::Sequence< OUString> lcl_getGroupAbsent() +static uno::Sequence< OUString> lcl_getGroupAbsent() { const OUString pProps[] = { OUString(PROPERTY_CANGROW) @@ -54,7 +54,7 @@ uno::Sequence< OUString> lcl_getGroupAbsent() } -uno::Sequence< OUString> lcl_getAbsent(bool _bPageSection) +static uno::Sequence< OUString> lcl_getAbsent(bool _bPageSection) { if ( _bPageSection ) { diff --git a/reportdesign/source/core/api/Shape.cxx b/reportdesign/source/core/api/Shape.cxx index 63166492cd37..c948dddb88a4 100644 --- a/reportdesign/source/core/api/Shape.cxx +++ b/reportdesign/source/core/api/Shape.cxx @@ -40,7 +40,7 @@ namespace reportdesign using namespace com::sun::star; using namespace comphelper; -uno::Sequence< OUString > lcl_getShapeOptionals() +static uno::Sequence< OUString > lcl_getShapeOptionals() { const OUString pProps[] = { OUString(PROPERTY_DATAFIELD) diff --git a/reportdesign/source/core/sdr/ReportUndoFactory.cxx b/reportdesign/source/core/sdr/ReportUndoFactory.cxx index ee64aed0e003..b574095953fb 100644 --- a/reportdesign/source/core/sdr/ReportUndoFactory.cxx +++ b/reportdesign/source/core/sdr/ReportUndoFactory.cxx @@ -25,7 +25,7 @@ namespace rptui { using namespace ::com::sun::star; -SdrUndoAction* lcl_createUndo(SdrObject& rObject, Action _eAction, const char* pCommentId) +static SdrUndoAction* lcl_createUndo(SdrObject& rObject, Action _eAction, const char* pCommentId) { OObjectBase* pObj = dynamic_cast<OObjectBase*>(&rObject); if ( !pObj ) diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx index 2ed954af9ead..d363878dd2ad 100644 --- a/reportdesign/source/core/sdr/RptObject.cxx +++ b/reportdesign/source/core/sdr/RptObject.cxx @@ -1075,7 +1075,7 @@ void OOle2Obj::impl_setUnoShape( const uno::Reference< uno::XInterface >& rxUnoS } -uno::Reference< chart2::data::XDatabaseDataProvider > lcl_getDataProvider(const uno::Reference < embed::XEmbeddedObject >& _xObj) +static uno::Reference< chart2::data::XDatabaseDataProvider > lcl_getDataProvider(const uno::Reference < embed::XEmbeddedObject >& _xObj) { uno::Reference< chart2::data::XDatabaseDataProvider > xSource; uno::Reference< embed::XComponentSupplier > xCompSupp(_xObj,uno::UNO_QUERY); diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx index 19bbceca007e..0a7acc361788 100644 --- a/reportdesign/source/filter/xml/xmlExport.cxx +++ b/reportdesign/source/filter/xml/xmlExport.cxx @@ -175,7 +175,7 @@ namespace rptxml } }; -void lcl_adjustColumnSpanOverRows(ORptExport::TSectionsGrid& _rGrid) +static void lcl_adjustColumnSpanOverRows(ORptExport::TSectionsGrid& _rGrid) { ORptExport::TSectionsGrid::iterator aSectionIter = _rGrid.begin(); ORptExport::TSectionsGrid::const_iterator aSectionEnd = _rGrid.end(); @@ -477,7 +477,7 @@ void ORptExport::exportReportElement(const Reference<XReportControlModel>& _xRep exportComponent(_xReportElement.get()); } -void lcl_calculate(const ::std::vector<sal_Int32>& _aPosX,const ::std::vector<sal_Int32>& _aPosY,ORptExport::TGrid& _rColumns) +static void lcl_calculate(const ::std::vector<sal_Int32>& _aPosX,const ::std::vector<sal_Int32>& _aPosY,ORptExport::TGrid& _rColumns) { sal_Int32 nCountX = _aPosX.size() - 1; sal_Int32 nCountY = _aPosY.size() - 1; diff --git a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx index 3d78ed662161..86b29c1f4e99 100644 --- a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx +++ b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx @@ -38,7 +38,7 @@ namespace rptxml using namespace ::com::sun::star; using namespace ::xmloff::token; -void lcl_exportPrettyPrinting(const uno::Reference< xml::sax::XDocumentHandler >& _xDelegatee) +static void lcl_exportPrettyPrinting(const uno::Reference< xml::sax::XDocumentHandler >& _xDelegatee) { SvtSaveOptions aSaveOpt; if ( aSaveOpt.IsPrettyPrinting() ) @@ -57,7 +57,7 @@ OUString lcl_createAttribute(const xmloff::token::XMLTokenEnum& _eNamespace,cons return sQName.makeStringAndClear(); } -void lcl_correctCellAddress(const OUString & _sName, const uno::Reference< xml::sax::XAttributeList > & xAttribs) +static void lcl_correctCellAddress(const OUString & _sName, const uno::Reference< xml::sax::XAttributeList > & xAttribs) { SvXMLAttributeList* pList = SvXMLAttributeList::getImplementation(xAttribs); OUString sCellAddress = pList->getValueByName(_sName); diff --git a/reportdesign/source/filter/xml/xmlGroup.cxx b/reportdesign/source/filter/xml/xmlGroup.cxx index 808d82537b64..c6d623726d15 100644 --- a/reportdesign/source/filter/xml/xmlGroup.cxx +++ b/reportdesign/source/filter/xml/xmlGroup.cxx @@ -37,7 +37,7 @@ namespace rptxml using namespace ::com::sun::star::report; using namespace ::com::sun::star::xml::sax; - sal_Int16 lcl_getKeepTogetherOption(const OUString& _sValue) + static sal_Int16 lcl_getKeepTogetherOption(const OUString& _sValue) { sal_Int16 nRet = report::KeepTogether::NO; const SvXMLEnumMapEntry<sal_Int16>* aXML_EnumMap = OXMLHelper::GetKeepTogetherOptions(); diff --git a/reportdesign/source/filter/xml/xmlSection.cxx b/reportdesign/source/filter/xml/xmlSection.cxx index c2b19775f658..4c398601f03a 100644 --- a/reportdesign/source/filter/xml/xmlSection.cxx +++ b/reportdesign/source/filter/xml/xmlSection.cxx @@ -40,7 +40,7 @@ namespace rptxml using namespace ::com::sun::star::uno; using namespace ::com::sun::star::xml::sax; - sal_Int16 lcl_getReportPrintOption(const OUString& _sValue) + static sal_Int16 lcl_getReportPrintOption(const OUString& _sValue) { sal_Int16 nRet = report::ReportPrintOption::ALL_PAGES; const SvXMLEnumMapEntry<sal_Int16>* aXML_EnumMap = OXMLHelper::GetReportPrintOptions(); diff --git a/reportdesign/source/filter/xml/xmlTable.cxx b/reportdesign/source/filter/xml/xmlTable.cxx index e06c34be6797..dcc0f7078e8d 100644 --- a/reportdesign/source/filter/xml/xmlTable.cxx +++ b/reportdesign/source/filter/xml/xmlTable.cxx @@ -45,7 +45,7 @@ namespace rptxml using namespace ::com::sun::star::xml::sax; using ::com::sun::star::xml::sax::XAttributeList; - sal_Int16 lcl_getForceNewPageOption(const OUString& _sValue) + static sal_Int16 lcl_getForceNewPageOption(const OUString& _sValue) { sal_Int16 nRet = report::ForceNewPage::NONE; const SvXMLEnumMapEntry<sal_Int16>* aXML_EnumMap = OXMLHelper::GetForceNewPageOptions(); diff --git a/reportdesign/source/filter/xml/xmlfilter.cxx b/reportdesign/source/filter/xml/xmlfilter.cxx index 439ec48e7f9d..c2f0ff43eda1 100644 --- a/reportdesign/source/filter/xml/xmlfilter.cxx +++ b/reportdesign/source/filter/xml/xmlfilter.cxx @@ -113,7 +113,7 @@ void RptMLMasterStylesContext_Impl::EndElement() } /// read a component (file + filter version) -ErrCode ReadThroughComponent( +static ErrCode ReadThroughComponent( const uno::Reference<XInputStream>& xInputStream, const uno::Reference<XComponent>& xModelComponent, const uno::Reference<XComponentContext> & rContext, @@ -176,7 +176,7 @@ ErrCode ReadThroughComponent( } /// read a component (storage version) -ErrCode ReadThroughComponent( +static ErrCode ReadThroughComponent( const uno::Reference< embed::XStorage >& xStorage, const uno::Reference<XComponent>& xModelComponent, const sal_Char* pStreamName, diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx index 5858755c9f3e..6e2e741abf8d 100644 --- a/reportdesign/source/ui/dlg/GroupsSorting.cxx +++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx @@ -56,7 +56,7 @@ using namespace ::com::sun::star; using namespace svt; using namespace ::comphelper; - void lcl_addToList_throw( ComboBoxControl& _rListBox, ::std::vector<ColumnInfo>& o_aColumnList,const uno::Reference< container::XNameAccess>& i_xColumns ) + static void lcl_addToList_throw( ComboBoxControl& _rListBox, ::std::vector<ColumnInfo>& o_aColumnList,const uno::Reference< container::XNameAccess>& i_xColumns ) { uno::Sequence< OUString > aEntries = i_xColumns->getElementNames(); const OUString* pEntries = aEntries.getConstArray(); diff --git a/reportdesign/source/ui/dlg/Navigator.cxx b/reportdesign/source/ui/dlg/Navigator.cxx index f960e8236b1b..c03a13fc6505 100644 --- a/reportdesign/source/ui/dlg/Navigator.cxx +++ b/reportdesign/source/ui/dlg/Navigator.cxx @@ -59,7 +59,7 @@ using namespace ::com::sun::star; using namespace utl; using namespace ::comphelper; -OUString lcl_getImageId(const uno::Reference< report::XReportComponent>& _xElement) +static OUString lcl_getImageId(const uno::Reference< report::XReportComponent>& _xElement) { OUString sId; uno::Reference< report::XFixedLine> xFixedLine(_xElement,uno::UNO_QUERY); @@ -76,7 +76,7 @@ OUString lcl_getImageId(const uno::Reference< report::XReportComponent>& _xEleme return sId; } -OUString lcl_getName(const uno::Reference< beans::XPropertySet>& _xElement) +static OUString lcl_getName(const uno::Reference< beans::XPropertySet>& _xElement) { OSL_ENSURE(_xElement.is(),"Found report element which is NULL!"); OUString sTempName; diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx index af753020146d..00fe7ea80bbb 100644 --- a/reportdesign/source/ui/misc/UITools.cxx +++ b/reportdesign/source/ui/misc/UITools.cxx @@ -867,7 +867,7 @@ SdrObject* isOver(const tools::Rectangle& _rRect, SdrPage const & _rPage, SdrVie return pOverlappedObj; } -bool checkArrayForOccurrence(SdrObject const * _pObjToCheck, SdrUnoObj* _pIgnore[], int _nListLength) +static bool checkArrayForOccurrence(SdrObject const * _pObjToCheck, SdrUnoObj* _pIgnore[], int _nListLength) { for(int i=0;i<_nListLength;i++) { diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx index 69129616d46e..8170adbdfe92 100644 --- a/reportdesign/source/ui/report/ReportSection.cxx +++ b/reportdesign/source/ui/report/ReportSection.cxx @@ -69,7 +69,7 @@ namespace rptui using namespace ::com::sun::star; -Color lcl_getOverlappedControlColor(/*const uno::Reference <lang::XMultiServiceFactory> _rxFactory*/) +static Color lcl_getOverlappedControlColor(/*const uno::Reference <lang::XMultiServiceFactory> _rxFactory*/) { svtools::ExtendedColorConfig aConfig; return aConfig.GetColorValue(CFG_REPORTDESIGNER, DBOVERLAPPEDCONTROL).getColor(); diff --git a/reportdesign/source/ui/report/ScrollHelper.cxx b/reportdesign/source/ui/report/ScrollHelper.cxx index aeb340042b0e..dc17b3cf9c29 100644 --- a/reportdesign/source/ui/report/ScrollHelper.cxx +++ b/reportdesign/source/ui/report/ScrollHelper.cxx @@ -34,7 +34,7 @@ namespace rptui using namespace ::com::sun::star; -void lcl_setScrollBar(sal_Int32 _nNewValue,const Point& _aPos,const Size& _aSize,ScrollBar& _rScrollBar) +static void lcl_setScrollBar(sal_Int32 _nNewValue,const Point& _aPos,const Size& _aSize,ScrollBar& _rScrollBar) { _rScrollBar.SetPosSizePixel(_aPos,_aSize); _rScrollBar.SetPageSize( _nNewValue ); diff --git a/reportdesign/source/ui/report/SectionWindow.cxx b/reportdesign/source/ui/report/SectionWindow.cxx index ae30403c5f56..f76f3469ca48 100644 --- a/reportdesign/source/ui/report/SectionWindow.cxx +++ b/reportdesign/source/ui/report/SectionWindow.cxx @@ -358,13 +358,13 @@ IMPL_LINK( OSectionWindow, SplitHdl, Splitter*, _pSplitter, void ) m_aSplitter->SetSplitPosPixel(m_aSplitter->LogicToPixel(Size(0,nSplitPos)).Height()); } -void lcl_scroll(vcl::Window& _rWindow,const Point& _aDelta) +static void lcl_scroll(vcl::Window& _rWindow,const Point& _aDelta) { _rWindow.Scroll(-_aDelta.X(),-_aDelta.Y()); _rWindow.Invalidate(InvalidateFlags::Transparent); } -void lcl_setOrigin(vcl::Window& _rWindow,long _nX, long _nY) +static void lcl_setOrigin(vcl::Window& _rWindow,long _nX, long _nY) { MapMode aMap = _rWindow.GetMapMode(); aMap.SetOrigin( Point(- _nX, - _nY)); diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx index 10af892da2fb..766e2ce045f1 100644 --- a/reportdesign/source/ui/report/ViewsWindow.cxx +++ b/reportdesign/source/ui/report/ViewsWindow.cxx @@ -54,7 +54,7 @@ namespace rptui using namespace ::com::sun::star; using namespace ::comphelper; -bool lcl_getNewRectSize(const tools::Rectangle& _aObjRect,long& _nXMov, long& _nYMov,SdrObject const * _pObj,SdrView const * _pView, ControlModification _nControlModification) +static bool lcl_getNewRectSize(const tools::Rectangle& _aObjRect,long& _nXMov, long& _nYMov,SdrObject const * _pObj,SdrView const * _pView, ControlModification _nControlModification) { bool bMoveAllowed = _nXMov != 0 || _nYMov != 0; if ( bMoveAllowed ) diff --git a/reportdesign/source/ui/report/dlgedfunc.cxx b/reportdesign/source/ui/report/dlgedfunc.cxx index 477abefed1d2..161f28e0b0f0 100644 --- a/reportdesign/source/ui/report/dlgedfunc.cxx +++ b/reportdesign/source/ui/report/dlgedfunc.cxx @@ -130,7 +130,7 @@ void DlgEdFunc::setOverlappedControlColor(Color _nColor) m_nOverlappedControlColor = _nColor; } -Color lcl_setColorOfObject(const uno::Reference< uno::XInterface >& _xObj, Color _nColorTRGB) +static Color lcl_setColorOfObject(const uno::Reference< uno::XInterface >& _xObj, Color _nColorTRGB) { Color nBackColor; try diff --git a/sal/osl/unx/file_path_helper.cxx b/sal/osl/unx/file_path_helper.cxx index a5b5dd985511..cff84e395561 100644 --- a/sal/osl/unx/file_path_helper.cxx +++ b/sal/osl/unx/file_path_helper.cxx @@ -28,13 +28,13 @@ const sal_Unicode FPH_CHAR_PATH_SEPARATOR = '/'; const sal_Unicode FPH_CHAR_DOT = '.'; const sal_Unicode FPH_CHAR_COLON = ':'; -inline const rtl::OUString FPH_PATH_SEPARATOR() +static inline const rtl::OUString FPH_PATH_SEPARATOR() { return rtl::OUString(FPH_CHAR_PATH_SEPARATOR); } -inline const rtl::OUString FPH_LOCAL_DIR_ENTRY() +static inline const rtl::OUString FPH_LOCAL_DIR_ENTRY() { return rtl::OUString(FPH_CHAR_DOT); } -inline const rtl::OUString FPH_PARENT_DIR_ENTRY() +static inline const rtl::OUString FPH_PARENT_DIR_ENTRY() { return rtl::OUString(".."); } void osl_systemPathRemoveSeparator(rtl_uString* pustrPath) diff --git a/sal/osl/unx/pipe.cxx b/sal/osl/unx/pipe.cxx index eb03ff2280c5..1c470b7fe3cd 100644 --- a/sal/osl/unx/pipe.cxx +++ b/sal/osl/unx/pipe.cxx @@ -39,7 +39,7 @@ #define PIPENAMEMASK "OSL_PIPE_%s" #define SECPIPENAMEMASK "OSL_PIPE_%s_%s" -oslPipe osl_psz_createPipe(const sal_Char *pszPipeName, oslPipeOptions Options, oslSecurity Security); +static oslPipe osl_psz_createPipe(const sal_Char *pszPipeName, oslPipeOptions Options, oslSecurity Security); static struct { @@ -158,7 +158,7 @@ cpyBootstrapSocketPath(sal_Char *name, size_t len) return bRet; } -oslPipe osl_psz_createPipe(const sal_Char *pszPipeName, oslPipeOptions Options, +static oslPipe osl_psz_createPipe(const sal_Char *pszPipeName, oslPipeOptions Options, oslSecurity Security) { int Flags; diff --git a/sal/osl/unx/process.cxx b/sal/osl/unx/process.cxx index d52452cd5e38..b88e5246d1a7 100644 --- a/sal/osl/unx/process.cxx +++ b/sal/osl/unx/process.cxx @@ -96,7 +96,7 @@ static oslMutex ChildListMutex; } //Anonymous namespace -oslProcessError osl_psz_executeProcess(sal_Char *pszImageName, +static oslProcessError osl_psz_executeProcess(sal_Char *pszImageName, sal_Char *pszArguments[], oslProcessOption Options, oslSecurity Security, @@ -848,7 +848,7 @@ struct osl_procStat unsigned long vm_lib; /* library size */ }; -bool osl_getProcStat(pid_t pid, struct osl_procStat* procstat) +static bool osl_getProcStat(pid_t pid, struct osl_procStat* procstat) { int fd = 0; bool bRet = false; @@ -904,7 +904,7 @@ bool osl_getProcStat(pid_t pid, struct osl_procStat* procstat) return bRet; } -bool osl_getProcStatus(pid_t pid, struct osl_procStat* procstat) +static bool osl_getProcStatus(pid_t pid, struct osl_procStat* procstat) { int fd = 0; char name[PATH_MAX + 1]; diff --git a/sal/osl/unx/socket.cxx b/sal/osl/unx/socket.cxx index edacf5f5e565..b73ce1966847 100644 --- a/sal/osl/unx/socket.cxx +++ b/sal/osl/unx/socket.cxx @@ -252,34 +252,34 @@ static oslSocketError osl_SocketErrorFromNative(int nativeType) #define ERROR_FROM_NATIVE(y) osl_SocketErrorFromNative(y) -oslSocketAddr osl_psz_createInetSocketAddr ( +static oslSocketAddr osl_psz_createInetSocketAddr ( const sal_Char* pszDottedAddr, sal_Int32 Port); -oslHostAddr osl_psz_createHostAddr ( +static oslHostAddr osl_psz_createHostAddr ( const sal_Char *pszHostname, const oslSocketAddr Addr); -oslHostAddr osl_psz_createHostAddrByName ( +static oslHostAddr osl_psz_createHostAddrByName ( const sal_Char *pszHostname); -const sal_Char* osl_psz_getHostnameOfHostAddr ( +static const sal_Char* osl_psz_getHostnameOfHostAddr ( const oslHostAddr Addr); -oslSocketResult osl_psz_getLocalHostname ( +static oslSocketResult osl_psz_getLocalHostname ( sal_Char *pBuffer, sal_uInt32 nBufLen); -oslSocketAddr osl_psz_resolveHostname ( +static oslSocketAddr osl_psz_resolveHostname ( const sal_Char* pszHostname); -sal_Int32 osl_psz_getServicePort ( +static sal_Int32 osl_psz_getServicePort ( const sal_Char* pszServicename, const sal_Char* pszProtocol); -oslSocketResult osl_psz_getHostnameOfSocketAddr ( +static oslSocketResult osl_psz_getHostnameOfSocketAddr ( oslSocketAddr Addr, sal_Char *pBuffer, sal_uInt32 BufferSize); -oslSocketResult osl_psz_getDottedInetAddrOfSocketAddr ( +static oslSocketResult osl_psz_getDottedInetAddrOfSocketAddr ( oslSocketAddr Addr, sal_Char *pBuffer, sal_uInt32 BufferSize); -void osl_psz_getLastSocketErrorDescription ( +static void osl_psz_getLastSocketErrorDescription ( oslSocket Socket, sal_Char* pBuffer, sal_uInt32 BufferSize); static oslSocket createSocketImpl(int Socket) diff --git a/sal/osl/unx/uunxapi.cxx b/sal/osl/unx/uunxapi.cxx index 3c50a10ac550..a6b80daa9e2a 100644 --- a/sal/osl/unx/uunxapi.cxx +++ b/sal/osl/unx/uunxapi.cxx @@ -29,7 +29,7 @@ #include <osl/detail/android-bootstrap.h> #endif -inline rtl::OString OUStringToOString(const rtl_uString* s) +static inline rtl::OString OUStringToOString(const rtl_uString* s) { return rtl::OUStringToOString(rtl::OUString(const_cast<rtl_uString*>(s)), osl_getThreadTextEncoding()); diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx index e022f02bcb84..bd3729513f7d 100644 --- a/sal/qa/osl/file/osl_File.cxx +++ b/sal/qa/osl/file/osl_File.cxx @@ -43,7 +43,7 @@ using namespace osl; /** detailed wrong message. */ -inline OString errorToString(const osl::FileBase::RC _nError) +static inline OString errorToString(const osl::FileBase::RC _nError) { OString sResult; switch (_nError) { @@ -84,7 +84,7 @@ inline OString errorToString(const osl::FileBase::RC _nError) return sResult; } -OString errorToStr(osl::FileBase::RC const& nError) +static OString errorToStr(osl::FileBase::RC const& nError) { OString suBuf; suBuf += "The returned error is: " ; @@ -103,7 +103,7 @@ OString errorToStr(osl::FileBase::RC const& nError) # define delta 1800 // time precision, 1.8s #endif -inline bool t_compareTime(TimeValue *m_aEndTime, TimeValue *m_aStartTime, sal_Int32 nDelta) +static inline bool t_compareTime(TimeValue *m_aEndTime, TimeValue *m_aStartTime, sal_Int32 nDelta) { sal_Int32 nDeltaSeconds = m_aEndTime->Seconds - m_aStartTime->Seconds; sal_Int32 nDeltaNanoSec = sal_Int32(m_aEndTime->Nanosec) - sal_Int32(m_aStartTime->Nanosec); @@ -119,7 +119,7 @@ inline bool t_compareTime(TimeValue *m_aEndTime, TimeValue *m_aStartTime, sal_I /** compare two OUString file name. */ -inline bool compareFileName(const OUString & ustr1, const OUString & ustr2) +static inline bool compareFileName(const OUString & ustr1, const OUString & ustr2) { bool bOk; // on Windows, the separator is '\', so here change to '/', then compare @@ -145,14 +145,14 @@ inline bool compareFileName(const OUString & ustr1, const OUString & ustr2) /** simple version to judge if a file name or directory name is a URL or a system path, just to see if it is start with "file:///";. */ -inline bool isURL(const OUString& pathname) +static inline bool isURL(const OUString& pathname) { return pathname.startsWith(aPreURL); } /** concat two part to form a URL or system path, add PATH_SEPARATOR between them if necessary, add "file:///" to beginning if necessary. */ -inline void concatURL(OUString & pathname1, const OUString & pathname2) +static inline void concatURL(OUString & pathname1, const OUString & pathname2) { // check if pathname1 is full qualified URL; if (!isURL(pathname1)) @@ -170,7 +170,7 @@ inline void concatURL(OUString & pathname1, const OUString & pathname2) /** create a temp test file using OUString name of full qualified URL or system path. */ -inline void createTestFile(const OUString& filename) +static inline void createTestFile(const OUString& filename) { OUString aPathURL = filename.copy(0); osl::FileBase::RC nError; @@ -189,7 +189,7 @@ inline void createTestFile(const OUString& filename) /** create a temp test file using OUString name of full qualified URL or system path in a base directory. */ -inline void createTestFile(const OUString& basename, const OUString& filename) +static inline void createTestFile(const OUString& basename, const OUString& filename) { OUString aBaseURL = basename.copy(0); @@ -199,7 +199,7 @@ inline void createTestFile(const OUString& basename, const OUString& filename) /** delete a temp test file using OUString name. */ -inline void deleteTestFile(const OUString& filename) +static inline void deleteTestFile(const OUString& filename) { OUString aPathURL = filename.copy(0); osl::FileBase::RC nError; @@ -216,7 +216,7 @@ inline void deleteTestFile(const OUString& filename) /** delete a temp test file using OUString name of full qualified URL or system path in a base directory. */ -inline void deleteTestFile(const OUString& basename, const OUString& filename) +static inline void deleteTestFile(const OUString& basename, const OUString& filename) { OUString aBaseURL = basename.copy(0); @@ -226,7 +226,7 @@ inline void deleteTestFile(const OUString& basename, const OUString& filename) /** create a temp test directory using OUString name of full qualified URL or system path. */ -inline void createTestDirectory(const OUString& dirname) +static inline void createTestDirectory(const OUString& dirname) { OUString aPathURL = dirname.copy(0); osl::FileBase::RC nError; @@ -240,7 +240,7 @@ inline void createTestDirectory(const OUString& dirname) /** create a temp test directory using OUString name of full qualified URL or system path in a base directory. */ -inline void createTestDirectory(const OUString& basename, const OUString& dirname) +static inline void createTestDirectory(const OUString& basename, const OUString& dirname) { OUString aBaseURL = basename.copy(0); @@ -250,7 +250,7 @@ inline void createTestDirectory(const OUString& basename, const OUString& dirnam /** delete a temp test directory using OUString name of full qualified URL or system path. */ -inline void deleteTestDirectory(const OUString& dirname) +static inline void deleteTestDirectory(const OUString& dirname) { OUString aPathURL = dirname.copy(0); osl::FileBase::RC nError; @@ -270,7 +270,7 @@ inline void deleteTestDirectory(const OUString& dirname) /** delete a temp test directory using OUString name of full qualified URL or system path in a base directory. */ -inline void deleteTestDirectory(const OUString& basename, const OUString& dirname) +static inline void deleteTestDirectory(const OUString& basename, const OUString& dirname) { OUString aBaseURL = basename.copy(0); @@ -288,7 +288,7 @@ enum class oslCheckMode { /** check if the file exist */ -inline bool ifFileExist(const OUString & str) +static inline bool ifFileExist(const OUString & str) { File testFile(str); return (testFile.open(osl_File_OpenFlag_Read) == osl::FileBase::E_None); @@ -296,7 +296,7 @@ inline bool ifFileExist(const OUString & str) /** check if the file can be written */ -inline bool ifFileCanWrite(const OUString & str) +static inline bool ifFileCanWrite(const OUString & str) { // on Windows, the file has no write right, but can be written #ifdef _WIN32 @@ -317,7 +317,7 @@ inline bool ifFileCanWrite(const OUString & str) return bCheckResult; } -inline bool checkDirectory(const OUString& str, oslCheckMode nCheckMode) +static inline bool checkDirectory(const OUString& str, oslCheckMode nCheckMode) { OUString aUString; DirectoryItem rItem; @@ -366,7 +366,7 @@ inline bool checkDirectory(const OUString& str, oslCheckMode nCheckMode) /** construct error message */ -inline OString outputError(const OString & returnVal, const OString & rightVal, const sal_Char * msg = "") +static inline OString outputError(const OString & returnVal, const OString & rightVal, const sal_Char * msg = "") { OString aString; if (returnVal == rightVal) @@ -384,7 +384,7 @@ inline OString outputError(const OString & returnVal, const OString & rightVal, /** Change file mode, two version in UNIX and Windows;. */ #if (defined UNX) /* chmod() method is different in Windows */ -inline void changeFileMode(OUString & filepath, sal_Int32 mode) +static inline void changeFileMode(OUString & filepath, sal_Int32 mode) { OString aString; OUString aUStr = filepath.copy(0); @@ -405,7 +405,7 @@ inline void changeFileMode(OUString & filepath, sal_Int32 mode) } #endif -inline OUString getCurrentPID(); +static inline OUString getCurrentPID(); // Beginning of the test cases for osl::FileBase class @@ -4920,7 +4920,7 @@ namespace osl_Directory #define TEST_PATH_POSTFIX "hello/world" - OUString const & get_test_path() + static OUString const & get_test_path() { static OUString test_path; if (test_path.isEmpty()) @@ -4973,7 +4973,7 @@ namespace osl_Directory return test_path; } - void rm_test_path(const OUString& path) + static void rm_test_path(const OUString& path) { sal_Unicode buffer[PATH_BUFFER_SIZE]; memcpy(buffer, path.getStr(), (path.getLength() + 1) * sizeof(sal_Unicode)); diff --git a/sal/qa/osl/module/osl_Module.cxx b/sal/qa/osl/module/osl_Module.cxx index dbc33a215538..04af99487f85 100644 --- a/sal/qa/osl/module/osl_Module.cxx +++ b/sal/qa/osl/module/osl_Module.cxx @@ -27,7 +27,7 @@ using ::rtl::OUString; /** get dll file URL. */ -inline ::rtl::OUString getDllURL() +static inline ::rtl::OUString getDllURL() { #if defined(_WIN32) // lib in Unix and lib in Windows are not same in file name. ::rtl::OUString libPath( "test_Module_DLL.dll" ); diff --git a/sal/qa/osl/mutex/osl_Mutex.cxx b/sal/qa/osl/mutex/osl_Mutex.cxx index c9959038c5ea..701732756c53 100644 --- a/sal/qa/osl/mutex/osl_Mutex.cxx +++ b/sal/qa/osl/mutex/osl_Mutex.cxx @@ -32,11 +32,11 @@ using namespace osl; */ namespace ThreadHelper { - void thread_sleep_tenth_sec(sal_uInt32 _nTenthSec) + static void thread_sleep_tenth_sec(sal_uInt32 _nTenthSec) { osl::Thread::wait(std::chrono::milliseconds(_nTenthSec * 100)); } - void thread_sleep( sal_uInt32 _nSec ) + static void thread_sleep( sal_uInt32 _nSec ) { /// print statement in thread process must use fflush() to force display. // t_print("# wait %d seconds. ", _nSec ); diff --git a/sal/qa/osl/pipe/osl_Pipe.cxx b/sal/qa/osl/pipe/osl_Pipe.cxx index dbd224e50da5..74f45b2faa21 100644 --- a/sal/qa/osl/pipe/osl_Pipe.cxx +++ b/sal/qa/osl/pipe/osl_Pipe.cxx @@ -44,7 +44,7 @@ using ::rtl::OString; /** print last error of pipe system. */ -inline void printPipeError( ::osl::Pipe const & aPipe ) +static inline void printPipeError( ::osl::Pipe const & aPipe ) { oslPipeError nError = aPipe.getError( ); printf("#printPipeError# " ); @@ -738,7 +738,7 @@ namespace osl_StreamPipe /** wait _nSec seconds. */ - void thread_sleep( sal_uInt32 _nSec ) + static void thread_sleep( sal_uInt32 _nSec ) { /// print statement in thread process must use fflush() to force display. fflush(stdout); diff --git a/sal/qa/osl/process/osl_Thread.cxx b/sal/qa/osl/process/osl_Thread.cxx index e5c9680cf35b..4f1df88b337f 100644 --- a/sal/qa/osl/process/osl_Thread.cxx +++ b/sal/qa/osl/process/osl_Thread.cxx @@ -178,12 +178,12 @@ public: namespace ThreadHelper { - void thread_sleep_tenth_sec(sal_Int32 _nTenthSec) + static void thread_sleep_tenth_sec(sal_Int32 _nTenthSec) { osl::Thread::wait(std::chrono::milliseconds(_nTenthSec * 100)); } - void outputPriority(oslThreadPriority const& _aPriority) + static void outputPriority(oslThreadPriority const& _aPriority) { // LLA: output the priority if (_aPriority == osl_Thread_PriorityHighest) @@ -404,7 +404,7 @@ public: namespace osl_Thread { - void resumeAndWaitThread(Thread* _pThread) + static void resumeAndWaitThread(Thread* _pThread) { // This function starts a thread, wait a second and suspends the thread // Due to the fact, that a suspend and never run thread never really exists. @@ -422,7 +422,7 @@ namespace osl_Thread } // kill a running thread and join it, if it has terminated, do nothing - void termAndJoinThread(Thread* _pThread) + static void termAndJoinThread(Thread* _pThread) { _pThread->terminate(); @@ -568,7 +568,7 @@ namespace osl_Thread /** when the count value equal to or more than 3, suspend the thread. */ - void suspendCountThread(OCountThread* _pCountThread) + static void suspendCountThread(OCountThread* _pCountThread) { sal_Int32 nValue = 0; while (true) @@ -1689,7 +1689,7 @@ namespace osl_Thread } // namespace osl_Thread // destroy function when the binding thread terminate -void destroyCallback(void * data) +static void destroyCallback(void * data) { delete[] static_cast<char *>(data); } diff --git a/sal/qa/osl/process/osl_process.cxx b/sal/qa/osl/process/osl_process.cxx index 08b39e1e8357..8b99d7089b99 100644 --- a/sal/qa/osl/process/osl_process.cxx +++ b/sal/qa/osl/process/osl_process.cxx @@ -71,7 +71,7 @@ using ::rtl::OString; /** get binary Path. */ -inline ::rtl::OUString getExecutablePath() +static inline ::rtl::OUString getExecutablePath() { ::rtl::OUString dirPath; osl::Module::getUrlFromAddress( @@ -143,7 +143,7 @@ namespace } } - void read_parent_environment(std::vector<OString>* env_container) + static void read_parent_environment(std::vector<OString>* env_container) { for (int i = 0; environ[i] != nullptr; i++) env_container->push_back(OString(environ[i])); diff --git a/sal/qa/osl/process/osl_process_child.cxx b/sal/qa/osl/process/osl_process_child.cxx index 90d4d6dc4eb0..22c5df241c21 100644 --- a/sal/qa/osl/process/osl_process_child.cxx +++ b/sal/qa/osl/process/osl_process_child.cxx @@ -45,7 +45,7 @@ # define SLEEP(t) (sleep((t))) #endif -void wait_for_seconds(char* time) +static void wait_for_seconds(char* time) { SLEEP(atoi(time)); } @@ -74,7 +74,7 @@ void w_to_a(LPCWSTR strW, LPSTR strA, DWORD size) FreeEnvironmentStringsW(env); } #else - void dump_env(char* file_path) + static void dump_env(char* file_path) { std::ofstream file(file_path); for (int i = 0; environ[i] != nullptr; ++i) diff --git a/sal/qa/osl/security/osl_Security.cxx b/sal/qa/osl/security/osl_Security.cxx index 94a0dcf6a1d1..cba8b125bb17 100644 --- a/sal/qa/osl/security/osl_Security.cxx +++ b/sal/qa/osl/security/osl_Security.cxx @@ -38,7 +38,7 @@ using namespace rtl; /** print a UNI_CODE String. */ -inline void printUString( const ::rtl::OUString & str ) +static inline void printUString( const ::rtl::OUString & str ) { rtl::OString aString; diff --git a/sal/qa/rtl/alloc/rtl_alloc.cxx b/sal/qa/rtl/alloc/rtl_alloc.cxx index f59d78f9fa6c..419a3f3b03ca 100644 --- a/sal/qa/rtl/alloc/rtl_alloc.cxx +++ b/sal/qa/rtl/alloc/rtl_alloc.cxx @@ -33,7 +33,7 @@ namespace rtl_alloc // small memory check routine, which return false, if there is a problem - bool checkMemory(const char* _pMemory, sal_uInt32 _nSize, char _n) + static bool checkMemory(const char* _pMemory, sal_uInt32 _nSize, char _n) { bool bOk = true; diff --git a/sal/qa/rtl/doublelock/rtl_doublelocking.cxx b/sal/qa/rtl/doublelock/rtl_doublelocking.cxx index e37400ba7f8f..befc16f36e92 100644 --- a/sal/qa/rtl/doublelock/rtl_doublelocking.cxx +++ b/sal/qa/rtl/doublelock/rtl_doublelocking.cxx @@ -60,7 +60,7 @@ namespace ThreadHelper // VERBOSE // } eSleepVerboseMode; - void thread_sleep_tenth_sec(sal_Int32 _nTenthSec/*, eSleepVerboseMode nVerbose = VERBOSE*/) + static void thread_sleep_tenth_sec(sal_Int32 _nTenthSec/*, eSleepVerboseMode nVerbose = VERBOSE*/) { // if (nVerbose == VERBOSE) // { diff --git a/sal/qa/rtl/locale/rtl_locale.cxx b/sal/qa/rtl/locale/rtl_locale.cxx index b08011609fb9..80807d9ecffd 100644 --- a/sal/qa/rtl/locale/rtl_locale.cxx +++ b/sal/qa/rtl/locale/rtl_locale.cxx @@ -28,7 +28,7 @@ namespace rtl_locale { // default locale for test purpose - void setDefaultLocale() + static void setDefaultLocale() { rtl_locale_setDefault(rtl::OUString("de").getStr(), rtl::OUString("DE").getStr(), /* rtl::OUString() */ rtl::OUString("hochdeutsch").getStr() ); } diff --git a/sal/qa/rtl/process/rtl_Process.cxx b/sal/qa/rtl/process/rtl_Process.cxx index 4f37f203781d..07c7059bbc56 100644 --- a/sal/qa/rtl/process/rtl_Process.cxx +++ b/sal/qa/rtl/process/rtl_Process.cxx @@ -43,7 +43,7 @@ using ::rtl::OUStringToOString; /** print a UNI_CODE String. And also print some comments of the string. */ -inline void printUString( const ::rtl::OUString & str, const sal_Char * msg ) +static inline void printUString( const ::rtl::OUString & str, const sal_Char * msg ) { if ( msg != nullptr ) { @@ -54,7 +54,7 @@ inline void printUString( const ::rtl::OUString & str, const sal_Char * msg ) printf("%s\n", aString.getStr( ) ); } -inline ::rtl::OUString getModulePath() +static inline ::rtl::OUString getModulePath() { ::rtl::OUString suDirPath; ::osl::Module::getUrlFromAddress( @@ -144,7 +144,7 @@ public: /************************************************************************ * For diagnostics( from sal/test/testuuid.cxx ) ************************************************************************/ -void printUuid( const sal_uInt8 *pNode ) +static void printUuid( const sal_uInt8 *pNode ) { printf("# UUID is: "); for( sal_Int32 i1 = 0 ; i1 < 4 ; i1++ ) @@ -168,7 +168,7 @@ void printUuid( const sal_uInt8 *pNode ) /************************************************************************** * output UUID to a string **************************************************************************/ -void printUuidtoBuffer( const sal_uInt8 *pNode, sal_Char * pBuffer ) +static void printUuidtoBuffer( const sal_uInt8 *pNode, sal_Char * pBuffer ) { sal_Int8 nPtr = 0; for( sal_Int32 i1 = 0 ; i1 < 16 ; i1++ ) diff --git a/sal/qa/rtl/ref/rtl_ref.cxx b/sal/qa/rtl/ref/rtl_ref.cxx index a2c22d2e8da5..2c7d3aae5276 100644 --- a/sal/qa/rtl/ref/rtl_ref.cxx +++ b/sal/qa/rtl/ref/rtl_ref.cxx @@ -45,7 +45,7 @@ public: void set_inc_flag() { m_bIncFlag = true; } }; -rtl::Reference< MoveTestClass > get_reference( MoveTestClass* pcTestClass ) +static rtl::Reference< MoveTestClass > get_reference( MoveTestClass* pcTestClass ) { // constructor will increment the reference count pcTestClass->set_inc_flag(); diff --git a/sal/qa/rtl/strings/test_ostring_concat.cxx b/sal/qa/rtl/strings/test_ostring_concat.cxx index 80fa62df6be5..4f4f2e3f799b 100644 --- a/sal/qa/rtl/strings/test_ostring_concat.cxx +++ b/sal/qa/rtl/strings/test_ostring_concat.cxx @@ -27,7 +27,7 @@ using namespace rtl; namespace std { -template< typename charT, typename traits > std::basic_ostream<charT, traits> & +template< typename charT, typename traits > static std::basic_ostream<charT, traits> & operator <<( std::basic_ostream<charT, traits> & stream, const std::type_info& info ) { diff --git a/sal/qa/rtl/strings/test_oustring_concat.cxx b/sal/qa/rtl/strings/test_oustring_concat.cxx index 1af3f60dd3aa..874666869554 100644 --- a/sal/qa/rtl/strings/test_oustring_concat.cxx +++ b/sal/qa/rtl/strings/test_oustring_concat.cxx @@ -26,7 +26,7 @@ using namespace rtl; namespace std { -template< typename charT, typename traits > std::basic_ostream<charT, traits> & +template< typename charT, typename traits > static std::basic_ostream<charT, traits> & operator <<( std::basic_ostream<charT, traits> & stream, const std::type_info& info ) { diff --git a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx index 687f6b3e5146..a98401351a7f 100644 --- a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx +++ b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx @@ -58,7 +58,7 @@ CPPUNIT_TEST_SUITE_END(); // reset the flag, evaluate the expression and return // whether the string literal ctor was used (i.e. whether the conversion was valid) -template<typename T> bool VALID_CONVERSION( T && expression ) +template<typename T> static bool VALID_CONVERSION( T && expression ) { rtl_string_unittest_invalid_conversion = false; // OK to std::forward expression twice; what is relevant in both ctor calls @@ -68,7 +68,7 @@ template<typename T> bool VALID_CONVERSION( T && expression ) ( void ) rtl::OUStringBuffer( std::forward<T>(expression) ); return !rtl_string_unittest_invalid_conversion; } -template<typename T> bool VALID_CONVERSION_CALL( T f ) +template<typename T> static bool VALID_CONVERSION_CALL( T f ) { rtl_string_unittest_invalid_conversion = false; ( void ) rtl::OUString( f() ); diff --git a/sal/qa/rtl/strings/test_strings_valuex.cxx b/sal/qa/rtl/strings/test_strings_valuex.cxx index 7b879e7c31bf..5253a4b99ddb 100644 --- a/sal/qa/rtl/strings/test_strings_valuex.cxx +++ b/sal/qa/rtl/strings/test_strings_valuex.cxx @@ -57,7 +57,7 @@ void test::strings::valueX::testOUBoolean() { } template< typename T > -void testInt() { +static void testInt() { CPPUNIT_ASSERT_EQUAL( T( "30039062" ), T::number( 30039062 )); // test the overloading resolution @@ -99,7 +99,7 @@ void test::strings::valueX::testOInt() { } template< typename T > -void testFloat() { +static void testFloat() { CPPUNIT_ASSERT_EQUAL( T( "39062.2" ), T::number( 39062.2f )); CPPUNIT_ASSERT_EQUAL( T( "30039062.2" ), T::number( 30039062.2 )); // long double not supported diff --git a/sal/rtl/bootstrap.cxx b/sal/rtl/bootstrap.cxx index ac735caf713b..855beec53348 100644 --- a/sal/rtl/bootstrap.cxx +++ b/sal/rtl/bootstrap.cxx @@ -132,7 +132,7 @@ struct rtl_bootstrap_NameValue typedef std::vector<rtl_bootstrap_NameValue> NameValueVector; -bool find( +static bool find( NameValueVector const & vector, rtl::OUString const & key, rtl::OUString * value) { @@ -300,7 +300,7 @@ static OUString & getIniFileName_Impl() // ensure the given file url has no final slash -inline void EnsureNoFinalSlash (rtl::OUString & url) +static inline void EnsureNoFinalSlash (rtl::OUString & url) { sal_Int32 i = url.getLength(); diff --git a/sal/rtl/hash.cxx b/sal/rtl/hash.cxx index 1599343bde3a..e12095f3d9e5 100644 --- a/sal/rtl/hash.cxx +++ b/sal/rtl/hash.cxx @@ -38,7 +38,7 @@ typedef StringHashTableImpl StringHashTable; static StringHashTable *rtl_str_hash_new(sal_uInt32 nSize); static void rtl_str_hash_free(StringHashTable *pHash); -StringHashTable * getHashTable() +static StringHashTable * getHashTable() { static StringHashTable *pInternPool = nullptr; if (!pInternPool) diff --git a/sal/rtl/string.cxx b/sal/rtl/string.cxx index d9dfd51f4c51..3429154e42ed 100644 --- a/sal/rtl/string.cxx +++ b/sal/rtl/string.cxx @@ -185,7 +185,7 @@ static int rtl_ImplGetFastUTF8ByteLen( const sal_Unicode* pStr, sal_Int32 nLen ) /* ----------------------------------------------------------------------- */ -bool rtl_impl_convertUStringToString(rtl_String ** pTarget, +static bool rtl_impl_convertUStringToString(rtl_String ** pTarget, sal_Unicode const * pSource, sal_Int32 nLength, rtl_TextEncoding nEncoding, diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx index 79f84c09697e..741dcc8b086c 100644 --- a/sax/source/tools/converter.cxx +++ b/sax/source/tools/converter.cxx @@ -475,7 +475,7 @@ void Converter::convertMeasurePx( OUStringBuffer& rBuffer, sal_Int32 nValue ) rBuffer.append( 'x' ); } -int lcl_gethex( int nChar ) +static int lcl_gethex( int nChar ) { if( nChar >= '0' && nChar <= '9' ) return nChar - '0'; diff --git a/sax/source/tools/fastserializer.cxx b/sax/source/tools/fastserializer.cxx index 9356f3e081d1..b232d0b3abf0 100644 --- a/sax/source/tools/fastserializer.cxx +++ b/sax/source/tools/fastserializer.cxx @@ -105,7 +105,7 @@ namespace sax_fastparser { /** Characters not allowed in XML 1.0 XML 1.1 would exclude only U+0000 */ - bool invalidChar( char c ) + static bool invalidChar( char c ) { if (static_cast<unsigned char>(c) >= 0x20) return false; @@ -120,7 +120,7 @@ namespace sax_fastparser { return true; } - bool isHexDigit( char c ) + static bool isHexDigit( char c ) { return ('0' <= c && c <= '9') || ('A' <= c && c <= 'F') || ('a' <= c && c <= 'f'); } diff --git a/sc/qa/extras/new_cond_format.cxx b/sc/qa/extras/new_cond_format.cxx index 60c27979477e..227a26cfb273 100644 --- a/sc/qa/extras/new_cond_format.cxx +++ b/sc/qa/extras/new_cond_format.cxx @@ -23,7 +23,7 @@ using namespace css; -inline std::ostream& operator<<(std::ostream& rStrm, const Color& rColor) +static inline std::ostream& operator<<(std::ostream& rStrm, const Color& rColor) { rStrm << "Color: R:" << static_cast<int>(rColor.GetRed()) << " G:" << static_cast<int>(rColor.GetGreen()) << " B: " << static_cast<int>(rColor.GetBlue()); return rStrm; diff --git a/sc/qa/unit/chart2dataprovider.cxx b/sc/qa/unit/chart2dataprovider.cxx index b25f8aaea7e5..f482283062f9 100644 --- a/sc/qa/unit/chart2dataprovider.cxx +++ b/sc/qa/unit/chart2dataprovider.cxx @@ -43,9 +43,9 @@ private: uno::Reference<uno::XInterface> m_xCalcComponent; }; -void lcl_createAndCheckDataProvider(ScDocument& rDoc, const OUString& cellRange, bool hasCategories, - bool firstCellAsLabel, sal_Int32 expectedRows, - sal_Int32 expectedCols) +static void lcl_createAndCheckDataProvider(ScDocument& rDoc, const OUString& cellRange, + bool hasCategories, bool firstCellAsLabel, + sal_Int32 expectedRows, sal_Int32 expectedCols) { uno::Reference<chart2::data::XDataProvider> xDataProvider = new ScChart2DataProvider(&rDoc); CPPUNIT_ASSERT(xDataProvider.is()); diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx index 1b8b99bda2db..021eeb9e9952 100644 --- a/sc/qa/unit/filters-test.cxx +++ b/sc/qa/unit/filters-test.cxx @@ -447,7 +447,7 @@ void ScFiltersTest::testSheetNamesXLSX() xDocSh->DoClose(); } -void impl_testLegacyCellAnchoredRotatedShape( ScDocument& rDoc, tools::Rectangle& aRect, const ScDrawObjData& aAnchor, long TOLERANCE = 30 /* 30 hmm */ ) +static void impl_testLegacyCellAnchoredRotatedShape( ScDocument& rDoc, tools::Rectangle& aRect, const ScDrawObjData& aAnchor, long TOLERANCE = 30 /* 30 hmm */ ) { ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer(); CPPUNIT_ASSERT_MESSAGE("No drawing layer.", pDrawLayer); @@ -561,7 +561,7 @@ void ScFiltersTest::testLegacyCellAnchoredRotatedShape() } } -void testEnhancedProtectionImpl( const ScDocument& rDoc ) +static void testEnhancedProtectionImpl( const ScDocument& rDoc ) { const ScTableProtection* pProt = rDoc.GetTabProtection(0); diff --git a/sc/qa/unit/parallelism.cxx b/sc/qa/unit/parallelism.cxx index b9ccf7b9cb3c..8c41318a5b1c 100644 --- a/sc/qa/unit/parallelism.cxx +++ b/sc/qa/unit/parallelism.cxx @@ -358,7 +358,7 @@ void ScParallelismTest::testSingleRef() } // Common test setup steps for testSUMIFImplicitRange*() -void lcl_setupCommon(ScDocument* pDoc, size_t nNumRows, size_t nConstCellValue) +static void lcl_setupCommon(ScDocument* pDoc, size_t nNumRows, size_t nConstCellValue) { pDoc->SetValue(3, 0, 0, static_cast<double>(nConstCellValue)); // D1 for (size_t i = 0; i <= (nNumRows*2); ++i) diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index 77f7de435ec1..6c355d1d0e5d 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -2457,7 +2457,7 @@ void ScExportTest::testBordersExchangeXLSX() xDocSh->DoClose(); } -OUString toString( const ScBigRange& rRange ) +static OUString toString( const ScBigRange& rRange ) { OUStringBuffer aBuf; aBuf.append("(columns:"); diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx index 01ac014b173b..829fb379cff1 100644 --- a/sc/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx @@ -49,7 +49,7 @@ using namespace css; -std::ostream& operator<<(std::ostream& os, ViewShellId const & id) +static std::ostream& operator<<(std::ostream& os, ViewShellId const & id) { os << static_cast<sal_Int32>(id); return os; } diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index cd8a87eca658..32ac67b0e44f 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -1667,7 +1667,7 @@ void Test::testCSV() } template<typename Evaluator> -void checkMatrixElements(const ScMatrix& rMat) +static void checkMatrixElements(const ScMatrix& rMat) { SCSIZE nC, nR; rMat.GetDimensions(nC, nR); @@ -5826,7 +5826,7 @@ void Test::testCellTextWidth() m_pDoc->DeleteTab(0); } -bool checkEditTextIterator(sc::EditTextIterator& rIter, const char** pChecks) +static bool checkEditTextIterator(sc::EditTextIterator& rIter, const char** pChecks) { const EditTextObject* pText = rIter.first(); const char* p = *pChecks; diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx index 342ef56f2ce1..96e94f2d42f4 100644 --- a/sc/qa/unit/ucalc_formula.cxx +++ b/sc/qa/unit/ucalc_formula.cxx @@ -5319,7 +5319,7 @@ struct StrStrCheck { }; template<size_t DataSize, size_t FormulaSize, int Type> -void runTestMATCH(ScDocument* pDoc, const char* aData[DataSize], StrStrCheck aChecks[FormulaSize]) +static void runTestMATCH(ScDocument* pDoc, const char* aData[DataSize], StrStrCheck aChecks[FormulaSize]) { size_t nDataSize = DataSize; for (size_t i = 0; i < nDataSize; ++i) @@ -5358,7 +5358,7 @@ void runTestMATCH(ScDocument* pDoc, const char* aData[DataSize], StrStrCheck aCh } template<size_t DataSize, size_t FormulaSize, int Type> -void runTestHorizontalMATCH(ScDocument* pDoc, const char* aData[DataSize], StrStrCheck aChecks[FormulaSize]) +static void runTestHorizontalMATCH(ScDocument* pDoc, const char* aData[DataSize], StrStrCheck aChecks[FormulaSize]) { size_t nDataSize = DataSize; for (size_t i = 0; i < nDataSize; ++i) @@ -6361,7 +6361,7 @@ void Test::testExternalRangeName() m_pDoc->DeleteTab(0); } -void testExtRefFuncT(ScDocument* pDoc, ScDocument& rExtDoc) +static void testExtRefFuncT(ScDocument* pDoc, ScDocument& rExtDoc) { Test::clearRange(pDoc, ScRange(0, 0, 0, 1, 9, 0)); Test::clearRange(&rExtDoc, ScRange(0, 0, 0, 1, 9, 0)); @@ -6382,7 +6382,7 @@ void testExtRefFuncT(ScDocument* pDoc, ScDocument& rExtDoc) CPPUNIT_ASSERT_MESSAGE("Unexpected result with T.", aRes.isEmpty()); } -void testExtRefFuncOFFSET(ScDocument* pDoc, ScDocument& rExtDoc) +static void testExtRefFuncOFFSET(ScDocument* pDoc, ScDocument& rExtDoc) { Test::clearRange(pDoc, ScRange(0, 0, 0, 1, 9, 0)); Test::clearRange(&rExtDoc, ScRange(0, 0, 0, 1, 9, 0)); @@ -6395,7 +6395,7 @@ void testExtRefFuncOFFSET(ScDocument* pDoc, ScDocument& rExtDoc) CPPUNIT_ASSERT_EQUAL(1.2, pDoc->GetValue(ScAddress(0,0,0))); } -void testExtRefFuncVLOOKUP(ScDocument* pDoc, ScDocument& rExtDoc) +static void testExtRefFuncVLOOKUP(ScDocument* pDoc, ScDocument& rExtDoc) { Test::clearRange(pDoc, ScRange(0, 0, 0, 1, 9, 0)); Test::clearRange(&rExtDoc, ScRange(0, 0, 0, 1, 9, 0)); @@ -6426,7 +6426,7 @@ void testExtRefFuncVLOOKUP(ScDocument* pDoc, ScDocument& rExtDoc) CPPUNIT_ASSERT_EQUAL(OUString("B2"), pDoc->GetString(ScAddress(1,0,0))); } -void testExtRefConcat(ScDocument* pDoc, ScDocument& rExtDoc) +static void testExtRefConcat(ScDocument* pDoc, ScDocument& rExtDoc) { Test::clearRange(pDoc, ScRange(0, 0, 0, 1, 9, 0)); Test::clearRange(&rExtDoc, ScRange(0, 0, 0, 1, 9, 0)); diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx index 7f778c9a1327..85e31fcd1a66 100644 --- a/sc/source/core/data/bcaslot.cxx +++ b/sc/source/core/data/bcaslot.cxx @@ -689,7 +689,7 @@ void ScBroadcastAreaSlotMachine::ComputeAreaPoints( const ScRange& rRange, ScAddress( rRange.aStart.Col(), rRange.aEnd.Row(), 0 ) ) - rStart; } -inline void ComputeNextSlot( SCSIZE & nOff, SCSIZE & nBreak, ScBroadcastAreaSlot** & pp, +static inline void ComputeNextSlot( SCSIZE & nOff, SCSIZE & nBreak, ScBroadcastAreaSlot** & pp, SCSIZE & nStart, ScBroadcastAreaSlot** const & ppSlots, SCSIZE nRowBreak ) { if ( nOff < nBreak ) diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index a5083210810a..38fb1edbd64b 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -78,7 +78,7 @@ // factor from font size to optimal cell height (text width) #define SC_ROT_BREAK_FACTOR 6 -inline bool IsAmbiguousScript( SvtScriptType nScript ) +static inline bool IsAmbiguousScript( SvtScriptType nScript ) { //TODO: move to a header file return ( nScript != SvtScriptType::LATIN && diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx index 7a417ec9061f..85db140e11ac 100644 --- a/sc/source/core/data/dociter.cxx +++ b/sc/source/core/data/dociter.cxx @@ -75,7 +75,7 @@ void decBlock(std::pair<Iter, size_t>& rPos) } -void ScAttrArray_IterGetNumberFormat( sal_uInt32& nFormat, const ScAttrArray*& rpArr, +static void ScAttrArray_IterGetNumberFormat( sal_uInt32& nFormat, const ScAttrArray*& rpArr, SCROW& nAttrEndRow, const ScAttrArray* pNewArr, SCROW nRow, const ScDocument* pDoc, ScInterpreterContext* pContext = nullptr ) { @@ -2382,7 +2382,7 @@ const ScPatternAttr* ScHorizontalAttrIterator::GetNext( SCCOL& rCol1, SCCOL& rCo } } -inline bool IsGreater( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 ) +static inline bool IsGreater( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 ) { return ( nRow1 > nRow2 ) || ( nRow1 == nRow2 && nCol1 > nCol2 ); } diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index 068d06b24392..f2b322a4c2d8 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -260,7 +260,7 @@ void DBConnector::getValue(long nCol, ScDPItemData &rData, SvNumFormatType& rNum } -sheet::DataPilotFieldOrientation lcl_GetDataGetOrientation( const uno::Reference<sheet::XDimensionsSupplier>& xSource ) +static sheet::DataPilotFieldOrientation lcl_GetDataGetOrientation( const uno::Reference<sheet::XDimensionsSupplier>& xSource ) { sheet::DataPilotFieldOrientation nRet = sheet::DataPilotFieldOrientation_HIDDEN; if ( xSource.is() ) @@ -2155,7 +2155,7 @@ public: } -void lcl_FillOldFields( ScPivotFieldVector& rFields, +static void lcl_FillOldFields( ScPivotFieldVector& rFields, const uno::Reference<sheet::XDimensionsSupplier>& xSource, sheet::DataPilotFieldOrientation nOrient, bool bAddData ) { diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index 4eb3ff5d3c9e..7fd0e6bd6201 100644 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -206,13 +206,13 @@ ScTabSizeChangedHint::~ScTabSizeChangedHint() #define MAXMM 10000000 -inline long TwipsToHmm (long nVal) +static inline long TwipsToHmm (long nVal) { return static_cast< long >( MetricField::ConvertDoubleValue (static_cast<sal_Int64>(nVal), 0, 0, FUNIT_TWIP, FUNIT_100TH_MM) ); } -inline long HmmToTwips (long nVal) +static inline long HmmToTwips (long nVal) { return static_cast< long > ( MetricField::ConvertDoubleValue (static_cast<sal_Int64>(nVal), 0, 0, FUNIT_100TH_MM, FUNIT_TWIP) ); @@ -511,7 +511,7 @@ void ScDrawLayer::ResetTab( SCTAB nStart, SCTAB nEnd ) } } -inline bool IsInBlock( const ScAddress& rPos, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SCROW nRow2 ) +static inline bool IsInBlock( const ScAddress& rPos, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SCROW nRow2 ) { return rPos.Col() >= nCol1 && rPos.Col() <= nCol2 && rPos.Row() >= nRow1 && rPos.Row() <= nRow2; @@ -1835,7 +1835,7 @@ OUString ScDrawLayer::GetVisibleName( const SdrObject* pObj ) return aName; } -inline bool IsNamedObject( const SdrObject* pObj, const OUString& rName ) +static inline bool IsNamedObject( const SdrObject* pObj, const OUString& rName ) { // sal_True if rName is the object's Name or PersistName // (used to find a named object) diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx index 9dbf1bf83773..2f63a6ebd0b0 100644 --- a/sc/source/core/data/patattr.cxx +++ b/sc/source/core/data/patattr.cxx @@ -113,12 +113,12 @@ SfxPoolItem* ScPatternAttr::Clone( SfxItemPool *pPool ) const return pPattern; } -inline bool StrCmp( const OUString* pStr1, const OUString* pStr2 ) +static inline bool StrCmp( const OUString* pStr1, const OUString* pStr2 ) { return ( pStr1 ? ( pStr2 && ( *pStr1 == *pStr2 ) ) : ( pStr2 == nullptr ) ); } -inline bool EqualPatternSets( const SfxItemSet& rSet1, const SfxItemSet& rSet2 ) +static inline bool EqualPatternSets( const SfxItemSet& rSet1, const SfxItemSet& rSet2 ) { // #i62090# The SfxItemSet in the SfxSetItem base class always has the same ranges // (single range from ATTR_PATTERN_START to ATTR_PATTERN_END), and the items are pooled, @@ -1109,7 +1109,7 @@ bool ScPatternAttr::IsVisible() const return false; } -inline bool OneEqual( const SfxItemSet& rSet1, const SfxItemSet& rSet2, sal_uInt16 nId ) +static inline bool OneEqual( const SfxItemSet& rSet1, const SfxItemSet& rSet2, sal_uInt16 nId ) { const SfxPoolItem* pItem1 = &rSet1.Get(nId); const SfxPoolItem* pItem2 = &rSet2.Get(nId); diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index 05b9a76e89f3..53e9e78d66f0 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -3573,7 +3573,7 @@ void ScTable::StripHidden( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 ) // Auto-Outline template< typename T > -short DiffSign( T a, T b ) +static short DiffSign( T a, T b ) { return (a<b) ? -1 : (a>b) ? 1 : 0; diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index c90f60bb55c1..910e66f20117 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -104,7 +104,7 @@ using namespace ::com::sun::star::i18n; @return Returns TRUE if a numeral element is found in a given string, or FALSE if no numeral element is found. */ -bool SplitString( const OUString &sWhole, +static bool SplitString( const OUString &sWhole, OUString &sPrefix, OUString &sSuffix, double &fNum ) { // Get prefix element, search for any digit and stop. @@ -164,7 +164,7 @@ bool SplitString( const OUString &sWhole, @return Returns 1 if sInput1 is greater, 0 if sInput1 == sInput2, and -1 if sInput2 is greater. */ -short Compare( const OUString &sInput1, const OUString &sInput2, +static short Compare( const OUString &sInput1, const OUString &sInput2, const bool bCaseSens, const ScUserListData* pData, const CollatorWrapper *pCW ) { OUString sStr1( sInput1 ), sStr2( sInput2 ), sPre1, sSuf1, sPre2, sSuf2; diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index 6a365098a5a5..3e61e4283479 100644 --- a/sc/source/core/opencl/formulagroupcl.cxx +++ b/sc/source/core/opencl/formulagroupcl.cxx @@ -2132,7 +2132,7 @@ private: cl_mem mpClmem2; }; -DynamicKernelArgumentRef SoPHelper( const ScCalcConfig& config, +static DynamicKernelArgumentRef SoPHelper( const ScCalcConfig& config, const std::string& ts, const FormulaTreeNodeRef& ft, SlidingFunctionBase* pCodeGen, int nResultSize ) { @@ -2140,7 +2140,7 @@ DynamicKernelArgumentRef SoPHelper( const ScCalcConfig& config, } template<class Base> -DynamicKernelArgument* VectorRefFactory( const ScCalcConfig& config, const std::string& s, +static DynamicKernelArgument* VectorRefFactory( const ScCalcConfig& config, const std::string& s, const FormulaTreeNodeRef& ft, std::shared_ptr<SlidingFunctionBase>& pCodeGen, int index ) diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx index 948d4c12ade0..2f1a9372aaf9 100644 --- a/sc/source/core/tool/addincol.cxx +++ b/sc/source/core/tool/addincol.cxx @@ -624,7 +624,7 @@ bool ScUnoAddInCollection::GetCalcName( const OUString& rExcelName, OUString& rR return false; } -inline bool IsTypeName( const OUString& rName, const uno::Type& rType ) +static inline bool IsTypeName( const OUString& rName, const uno::Type& rType ) { return rName == rType.getTypeName(); } diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index 036ba8376a8d..ae057b346d26 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -1994,7 +1994,7 @@ static inline void lcl_string_append(OStringBuffer &rString, const OUString &sSt rString.append(OUStringToOString( sString, RTL_TEXTENCODING_UTF8 )); } -template<typename T > inline void lcl_Format( T& r, SCTAB nTab, SCROW nRow, SCCOL nCol, ScRefFlags nFlags, +template<typename T > static inline void lcl_Format( T& r, SCTAB nTab, SCROW nRow, SCCOL nCol, ScRefFlags nFlags, const ScDocument* pDoc, const ScAddress::Details& rDetails) { diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx index 4a1d3098a542..222f30cc3758 100644 --- a/sc/source/core/tool/detfunc.cxx +++ b/sc/source/core/tool/detfunc.cxx @@ -273,7 +273,7 @@ void ScDetectiveFunc::Modified() pDoc->SetStreamValid(nTab, false); } -inline bool Intersect( SCCOL nStartCol1, SCROW nStartRow1, SCCOL nEndCol1, SCROW nEndRow1, +static inline bool Intersect( SCCOL nStartCol1, SCROW nStartRow1, SCCOL nEndCol1, SCROW nEndRow1, SCCOL nStartCol2, SCROW nStartRow2, SCCOL nEndCol2, SCROW nEndRow2 ) { return nEndCol1 >= nStartCol2 && nEndCol2 >= nStartCol1 && @@ -711,7 +711,7 @@ void ScDetectiveFunc::DeleteArrowsAt( SCCOL nCol, SCROW nRow, bool bDestPnt ) #define SC_DET_TOLERANCE 50 -inline bool RectIsPoints( const tools::Rectangle& rRect, const Point& rStart, const Point& rEnd ) +static inline bool RectIsPoints( const tools::Rectangle& rRect, const Point& rStart, const Point& rEnd ) { return rRect.Left() >= rStart.X() - SC_DET_TOLERANCE && rRect.Left() <= rStart.X() + SC_DET_TOLERANCE diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index a40a514873c5..9bdc5d1a805a 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -8874,7 +8874,7 @@ static const UBlockScript scriptList[] = { {UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B, UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT}, {UBLOCK_CJK_STROKES, UBLOCK_CJK_STROKES} }; -bool IsDBCS(sal_Unicode currentChar) +static bool IsDBCS(sal_Unicode currentChar) { // for the locale of ja-JP, character U+0x005c and U+0x20ac should be ScriptType::Asian if( (currentChar == 0x005c || currentChar == 0x20ac) && @@ -8889,7 +8889,7 @@ bool IsDBCS(sal_Unicode currentChar) bRet = (i < SAL_N_ELEMENTS(scriptList) && block >= scriptList[i].from); return bRet; } -sal_Int32 lcl_getLengthB( const OUString &str, sal_Int32 nPos ) +static sal_Int32 lcl_getLengthB( const OUString &str, sal_Int32 nPos ) { sal_Int32 index = 0; sal_Int32 length = 0; @@ -8903,7 +8903,7 @@ sal_Int32 lcl_getLengthB( const OUString &str, sal_Int32 nPos ) } return length; } -sal_Int32 getLengthB(const OUString &str) +static sal_Int32 getLengthB(const OUString &str) { if(str.isEmpty()) return 0; @@ -8914,7 +8914,7 @@ void ScInterpreter::ScLenB() { PushDouble( getLengthB(GetString().getString()) ); } -OUString lcl_RightB(const OUString &rStr, sal_Int32 n) +static OUString lcl_RightB(const OUString &rStr, sal_Int32 n) { if( n < getLengthB(rStr) ) { @@ -8965,7 +8965,7 @@ void ScInterpreter::ScRightB() PushString( aStr ); } } -OUString lcl_LeftB(const OUString &rStr, sal_Int32 n) +static OUString lcl_LeftB(const OUString &rStr, sal_Int32 n) { if( n < getLengthB(rStr) ) { diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx index e1d7bf45db8e..1bd355d3af6e 100644 --- a/sc/source/core/tool/interpr3.cxx +++ b/sc/source/core/tool/interpr3.cxx @@ -1245,7 +1245,7 @@ double ScInterpreter::GetBinomDistPMF(double x, double n, double p) } } -double lcl_GetBinomDistRange(double n, double xs,double xe, +static double lcl_GetBinomDistRange(double n, double xs,double xe, double fFactor /* q^n */, double p, double q) //preconditions: 0.0 <= xs < xe <= n; xs,xe,n integral although double { diff --git a/sc/source/core/tool/interpr6.cxx b/sc/source/core/tool/interpr6.cxx index f1eb0713fc2a..f54dacf2b20f 100644 --- a/sc/source/core/tool/interpr6.cxx +++ b/sc/source/core/tool/interpr6.cxx @@ -399,7 +399,7 @@ public: sal_uInt32 getNumberFormat() const { return mnNumFmt; } }; -void IterateMatrix( +static void IterateMatrix( const ScMatrixRef& pMat, ScIterFunc eFunc, bool bTextAsZero, sal_uLong& rCount, SvNumFormatType& rFuncFmtType, double& fRes, double& fMem ) { diff --git a/sc/source/core/tool/prnsave.cxx b/sc/source/core/tool/prnsave.cxx index 97b3ebe09101..035d6810fc64 100644 --- a/sc/source/core/tool/prnsave.cxx +++ b/sc/source/core/tool/prnsave.cxx @@ -48,7 +48,7 @@ void ScPrintSaverTab::SetRepeat( const ScRange* pCol, const ScRange* pRow ) mpRepeatRow.reset(pRow ? new ScRange(*pRow) : nullptr); } -inline bool PtrEqual( const ScRange* p1, const ScRange* p2 ) +static inline bool PtrEqual( const ScRange* p1, const ScRange* p2 ) { return ( !p1 && !p2 ) || ( p1 && p2 && *p1 == *p2 ); } diff --git a/sc/source/core/tool/refupdat.cxx b/sc/source/core/tool/refupdat.cxx index 94a1e091a530..f65c5fe965ee 100644 --- a/sc/source/core/tool/refupdat.cxx +++ b/sc/source/core/tool/refupdat.cxx @@ -131,7 +131,7 @@ static void lcl_MoveItWrap( R& rRef, U nMask ) } template< typename R, typename S, typename U > -bool IsExpand( R n1, R n2, U nStart, S nD ) +static bool IsExpand( R n1, R n2, U nStart, S nD ) { // before normal Move... return nD > 0 // Insert @@ -143,7 +143,7 @@ bool IsExpand( R n1, R n2, U nStart, S nD ) } template< typename R, typename S, typename U > -void Expand( R& n1, R& n2, U nStart, S nD ) +static void Expand( R& n1, R& n2, U nStart, S nD ) { // after normal Move..., only if IsExpand was true before! // first the End if ( n2 + 1 == nStart ) diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx index 469731a65467..ea51929c60b6 100644 --- a/sc/source/filter/excel/xelink.cxx +++ b/sc/source/filter/excel/xelink.cxx @@ -384,7 +384,7 @@ struct XclExpXti { rStrm << mnSupbook << mnFirstSBTab << mnLastSBTab; } }; -inline bool operator==( const XclExpXti& rLeft, const XclExpXti& rRight ) +static inline bool operator==( const XclExpXti& rLeft, const XclExpXti& rRight ) { return (rLeft.mnSupbook == rRight.mnSupbook) && diff --git a/sc/source/filter/excel/xename.cxx b/sc/source/filter/excel/xename.cxx index 62181ef8eee2..6e0ec1372973 100644 --- a/sc/source/filter/excel/xename.cxx +++ b/sc/source/filter/excel/xename.cxx @@ -337,7 +337,7 @@ void XclExpName::WriteBody( XclExpStream& rStrm ) /** Returns true (needed fixing) if FormulaToken was not absolute and 3D. So, regardless of whether the fix was successful or not, true is still returned since a fix was required.*/ -bool lcl_EnsureAbs3DToken( const SCTAB nTab, formula::FormulaToken* pTok, const bool bFix = true ) +static bool lcl_EnsureAbs3DToken( const SCTAB nTab, formula::FormulaToken* pTok, const bool bFix = true ) { bool bFixRequired = false; if ( !pTok || ( pTok->GetType() != formula::svSingleRef && pTok->GetType() != formula::svDoubleRef ) ) diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index c94145737fc9..c73a0a8b42d4 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -1800,7 +1800,7 @@ XclExpDefaultRowData::XclExpDefaultRowData( const XclExpRow& rRow ) : ::set_flag( mnFlags, EXC_DEFROW_UNSYNCED, rRow.IsUnsynced() ); } -bool operator<( const XclExpDefaultRowData& rLeft, const XclExpDefaultRowData& rRight ) +static bool operator<( const XclExpDefaultRowData& rLeft, const XclExpDefaultRowData& rRight ) { return (rLeft.mnHeight < rRight.mnHeight) || ((rLeft.mnHeight == rRight.mnHeight) && (rLeft.mnFlags < rRight.mnFlags)); diff --git a/sc/source/filter/excel/xilink.cxx b/sc/source/filter/excel/xilink.cxx index b5e0b7ecbb99..02f0562f7fec 100644 --- a/sc/source/filter/excel/xilink.cxx +++ b/sc/source/filter/excel/xilink.cxx @@ -147,7 +147,7 @@ struct XclImpXti explicit XclImpXti() : mnSupbook( SAL_MAX_UINT16 ), mnSBTabFirst( SAL_MAX_UINT16 ), mnSBTabLast( SAL_MAX_UINT16 ) {} }; -inline XclImpStream& operator>>( XclImpStream& rStrm, XclImpXti& rXti ) +static inline XclImpStream& operator>>( XclImpStream& rStrm, XclImpXti& rXti ) { rXti.mnSupbook = rStrm.ReaduInt16(); rXti.mnSBTabFirst = rStrm.ReaduInt16(); diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index 401475d9fe0c..ec86f6ec778e 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -1646,7 +1646,7 @@ void ScHTMLLayoutParser::ProcToken( HtmlImportInfo* pInfo ) // HTML DATA QUERY PARSER template< typename Type > -inline Type getLimitedValue( const Type& rValue, const Type& rMin, const Type& rMax ) +static inline Type getLimitedValue( const Type& rValue, const Type& rMin, const Type& rMax ) { return std::max( std::min( rValue, rMax ), rMin ); } ScHTMLEntry::ScHTMLEntry( const SfxItemSet& rItemSet, ScHTMLTableId nTableId ) : diff --git a/sc/source/filter/lotus/filter.cxx b/sc/source/filter/lotus/filter.cxx index ca3a33c4b13b..16ab8fe57bf3 100644 --- a/sc/source/filter/lotus/filter.cxx +++ b/sc/source/filter/lotus/filter.cxx @@ -131,7 +131,7 @@ generate_Opcodes(LotusContext &rContext, SvStream& aStream, return nErr; } -WKTYP ScanVersion(SvStream& aStream) +static WKTYP ScanVersion(SvStream& aStream) { // PREC: pWKFile: pointer to open file // POST: return: type of file diff --git a/sc/source/filter/oox/sheetdatabuffer.cxx b/sc/source/filter/oox/sheetdatabuffer.cxx index a4e764bbe538..cdd4d8ce6e07 100644 --- a/sc/source/filter/oox/sheetdatabuffer.cxx +++ b/sc/source/filter/oox/sheetdatabuffer.cxx @@ -323,7 +323,7 @@ void SheetDataBuffer::setMergedRange( const ScRange& rRange ) typedef std::pair<sal_Int32, sal_Int32> FormatKeyPair; -void addIfNotInMyMap( const StylesBuffer& rStyles, std::map< FormatKeyPair, ScRangeList >& rMap, sal_Int32 nXfId, sal_Int32 nFormatId, const ScRangeList& rRangeList ) +static void addIfNotInMyMap( const StylesBuffer& rStyles, std::map< FormatKeyPair, ScRangeList >& rMap, sal_Int32 nXfId, sal_Int32 nFormatId, const ScRangeList& rRangeList ) { Xf* pXf1 = rStyles.getCellXf( nXfId ).get(); if ( pXf1 ) @@ -718,7 +718,7 @@ void SheetDataBuffer::setCellFormat( const CellModel& rModel ) } } -void lcl_SetBorderLine( ScDocument& rDoc, const ScRange& rRange, SCTAB nScTab, SvxBoxItemLine nLine ) +static void lcl_SetBorderLine( ScDocument& rDoc, const ScRange& rRange, SCTAB nScTab, SvxBoxItemLine nLine ) { SCCOL nFromScCol = (nLine == SvxBoxItemLine::RIGHT) ? rRange.aEnd.Col() : rRange.aStart.Col(); SCROW nFromScRow = (nLine == SvxBoxItemLine::BOTTOM) ? rRange.aEnd.Row() : rRange.aStart.Row(); diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx index b923e3b5d01e..b0ee21d7461a 100644 --- a/sc/source/filter/oox/stylesbuffer.cxx +++ b/sc/source/filter/oox/stylesbuffer.cxx @@ -833,7 +833,7 @@ bool Font::needsRichTextFormat() const return maApiData.mnEscapement != API_ESCAPE_NONE; } -::FontFamily lcl_getFontFamily( sal_Int32 nFamily ) +static ::FontFamily lcl_getFontFamily( sal_Int32 nFamily ) { ::FontFamily eScFamily = FAMILY_DONTKNOW; switch( nFamily ) diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx index 1a707573e78c..9b8c17f1a687 100644 --- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx +++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx @@ -45,7 +45,7 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::accessibility; -bool CompMinCol(const std::pair<sal_uInt16,sal_uInt16> & pc1,const std::pair<sal_uInt16,sal_uInt16> &pc2) +static bool CompMinCol(const std::pair<sal_uInt16,sal_uInt16> & pc1,const std::pair<sal_uInt16,sal_uInt16> &pc2) { return pc1.first < pc2.first; } diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 15a2d21a5d10..cbbc87301491 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -478,7 +478,7 @@ void ScInputHandler::DeleteRangeFinder() } } -inline OUString GetEditText(const EditEngine* pEng) +static inline OUString GetEditText(const EditEngine* pEng) { return ScEditUtil::GetSpaceDelimitedString(*pEng); } diff --git a/sc/source/ui/attrdlg/scuiexp.cxx b/sc/source/ui/attrdlg/scuiexp.cxx index e93b23995c10..d1129fa55cd8 100644 --- a/sc/source/ui/attrdlg/scuiexp.cxx +++ b/sc/source/ui/attrdlg/scuiexp.cxx @@ -56,7 +56,7 @@ namespace scui { static ScAbstractDialogFactory_Impl* pFactory=nullptr; - ScAbstractDialogFactory_Impl* GetFactory() + static ScAbstractDialogFactory_Impl* GetFactory() { if ( !pFactory ) pFactory = new ScAbstractDialogFactory_Impl; diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx index 0679f5853bdc..ac3293403fd5 100644 --- a/sc/source/ui/dbgui/scuiasciiopt.cxx +++ b/sc/source/ui/dbgui/scuiasciiopt.cxx @@ -148,7 +148,7 @@ static sal_Unicode lcl_CharFromCombo( const ComboBox& rCombo, const OUString& rL return c; } -void lcl_CreatePropertiesNames ( OUString& rSepPath, Sequence<OUString>& rNames, ScImportAsciiCall eCall ) +static void lcl_CreatePropertiesNames ( OUString& rSepPath, Sequence<OUString>& rNames, ScImportAsciiCall eCall ) { sal_Int32 nProperties = 0; diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 4b6fbe44e8c5..58b6c92b4ba3 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -3021,7 +3021,7 @@ bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos, return true; } -uno::Reference< uno::XInterface > GetDocModuleObject( const SfxObjectShell& rDocSh, const OUString& sCodeName ) +static uno::Reference< uno::XInterface > GetDocModuleObject( const SfxObjectShell& rDocSh, const OUString& sCodeName ) { uno::Reference< lang::XMultiServiceFactory> xSF(rDocSh.GetModel(), uno::UNO_QUERY); uno::Reference< container::XNameAccess > xVBACodeNamedObjectAccess; @@ -4316,7 +4316,7 @@ bool ScDocFunc::TabOp( const ScRange& rRange, const ScMarkData* pTabMark, return bSuccess; } -inline ScDirection DirFromFillDir( FillDir eDir ) +static inline ScDirection DirFromFillDir( FillDir eDir ) { if (eDir==FILL_TO_BOTTOM) return DIR_BOTTOM; diff --git a/sc/source/ui/drawfunc/fusel2.cxx b/sc/source/ui/drawfunc/fusel2.cxx index a80a993786af..57dcb4dee367 100644 --- a/sc/source/ui/drawfunc/fusel2.cxx +++ b/sc/source/ui/drawfunc/fusel2.cxx @@ -37,7 +37,7 @@ #include <drawview.hxx> #include <svx/sdrhittesthelper.hxx> -inline long Diff( const Point& rP1, const Point& rP2 ) +static inline long Diff( const Point& rP1, const Point& rP2 ) { long nX = rP1.X() - rP2.X(); if (nX<0) nX = -nX; diff --git a/sc/source/ui/miscdlgs/autofmt.cxx b/sc/source/ui/miscdlgs/autofmt.cxx index bf96690b54f6..71e445fba3c2 100644 --- a/sc/source/ui/miscdlgs/autofmt.cxx +++ b/sc/source/ui/miscdlgs/autofmt.cxx @@ -450,7 +450,7 @@ void ScAutoFmtPreview::CalcCellArray( bool bFitWidthP ) aPrvSize.setHeight( maArray.GetHeight() + 4 ); } -inline void lclSetStyleFromBorder( svx::frame::Style& rStyle, const ::editeng::SvxBorderLine* pBorder ) +static inline void lclSetStyleFromBorder( svx::frame::Style& rStyle, const ::editeng::SvxBorderLine* pBorder ) { rStyle.Set( pBorder, 1.0 / TWIPS_PER_POINT, 5 ); } diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx index afb2d471838a..169196304f51 100644 --- a/sc/source/ui/undo/undocell.cxx +++ b/sc/source/ui/undo/undocell.cxx @@ -58,7 +58,7 @@ using std::shared_ptr; namespace HelperNotifyChanges { - void NotifyIfChangesListeners(const ScDocShell& rDocShell, const ScAddress &rPos, + static void NotifyIfChangesListeners(const ScDocShell& rDocShell, const ScAddress &rPos, const ScUndoEnterData::ValuesType &rOldValues) { if (ScModelObj* pModelObj = getMustPropagateChangesModel(rDocShell)) diff --git a/sc/source/ui/unoobj/PivotTableDataSequence.cxx b/sc/source/ui/unoobj/PivotTableDataSequence.cxx index dd7cd0297d2f..ccbcd70dbbe0 100644 --- a/sc/source/ui/unoobj/PivotTableDataSequence.cxx +++ b/sc/source/ui/unoobj/PivotTableDataSequence.cxx @@ -28,7 +28,7 @@ namespace sc SC_SIMPLE_SERVICE_INFO( PivotTableDataSequence, "PivotTableDataSequence", "com.sun.star.chart2.data.DataSequence") -const SfxItemPropertyMapEntry* lcl_GetDataSequencePropertyMap() +static const SfxItemPropertyMapEntry* lcl_GetDataSequencePropertyMap() { static const SfxItemPropertyMapEntry aDataSequencePropertyMap_Impl[] = { diff --git a/sc/source/ui/unoobj/servuno.cxx b/sc/source/ui/unoobj/servuno.cxx index 9bcc3e593298..d64abd57fb53 100644 --- a/sc/source/ui/unoobj/servuno.cxx +++ b/sc/source/ui/unoobj/servuno.cxx @@ -71,7 +71,7 @@ using namespace ::com::sun::star; -bool isInVBAMode( ScDocShell& rDocSh ) +static bool isInVBAMode( ScDocShell& rDocSh ) { uno::Reference<script::XLibraryContainer> xLibContainer = rDocSh.GetBasicContainer(); uno::Reference<script::vba::XVBACompatibility> xVBACompat( xLibContainer, uno::UNO_QUERY ); diff --git a/sc/source/ui/vba/vbaborders.cxx b/sc/source/ui/vba/vbaborders.cxx index b56ceff1c540..46dc73a71611 100644 --- a/sc/source/ui/vba/vbaborders.cxx +++ b/sc/source/ui/vba/vbaborders.cxx @@ -352,7 +352,7 @@ public: } }; -uno::Reference< container::XIndexAccess > +static uno::Reference< container::XIndexAccess > rangeToBorderIndexAccess( const uno::Reference< table::XCellRange >& xRange, const uno::Reference< uno::XComponentContext > & xContext, const ScVbaPalette& rPalette ) { return new RangeBorders( xRange, xContext, rPalette ); diff --git a/sc/source/ui/vba/vbacomments.cxx b/sc/source/ui/vba/vbacomments.cxx index eb493f2c9ebf..537f80290087 100644 --- a/sc/source/ui/vba/vbacomments.cxx +++ b/sc/source/ui/vba/vbacomments.cxx @@ -26,7 +26,7 @@ using namespace ::ooo::vba; using namespace ::com::sun::star; -uno::Any AnnotationToComment( const uno::Any& aSource, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel ) +static uno::Any AnnotationToComment( const uno::Any& aSource, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel ) { uno::Reference< sheet::XSheetAnnotation > xAnno( aSource, uno::UNO_QUERY_THROW ); uno::Reference< container::XChild > xChild( xAnno, uno::UNO_QUERY_THROW ); diff --git a/sc/source/ui/vba/vbapivottables.cxx b/sc/source/ui/vba/vbapivottables.cxx index 13b2b46c0f5f..4c22a93d808f 100644 --- a/sc/source/ui/vba/vbapivottables.cxx +++ b/sc/source/ui/vba/vbapivottables.cxx @@ -24,7 +24,7 @@ using namespace ::com::sun::star; using namespace ::ooo::vba; -uno::Any DataPilotToPivotTable( const uno::Any& aSource, const uno::Reference< uno::XComponentContext > & xContext ) +static uno::Any DataPilotToPivotTable( const uno::Any& aSource, const uno::Reference< uno::XComponentContext > & xContext ) { uno::Reference< sheet::XDataPilotTable > xTable( aSource, uno::UNO_QUERY_THROW ); return uno::makeAny( uno::Reference< excel::XPivotTable > ( new ScVbaPivotTable( xContext, xTable ) ) ); diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index e5ee4af10a19..0dd27507bc96 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -386,7 +386,7 @@ ScVbaRangeAreas::createCollectionObject( const uno::Any& aSource ) // assume that xIf is infact a ScCellRangesBase /// @throws uno::RuntimeException -ScDocShell* +static ScDocShell* getDocShellFromIf( const uno::Reference< uno::XInterface >& xIf ) { ScCellRangesBase* pUno = ScCellRangesBase::getImplementation( xIf ); @@ -396,7 +396,7 @@ getDocShellFromIf( const uno::Reference< uno::XInterface >& xIf ) } /// @throws uno::RuntimeException -ScDocShell* +static ScDocShell* getDocShellFromRange( const uno::Reference< table::XCellRange >& xRange ) { // need the ScCellRangesBase to get docshell @@ -405,7 +405,7 @@ getDocShellFromRange( const uno::Reference< table::XCellRange >& xRange ) } /// @throws uno::RuntimeException -ScDocShell* +static ScDocShell* getDocShellFromRanges( const uno::Reference< sheet::XSheetCellRangeContainer >& xRanges ) { // need the ScCellRangesBase to get docshell @@ -414,21 +414,21 @@ getDocShellFromRanges( const uno::Reference< sheet::XSheetCellRangeContainer >& } /// @throws uno::RuntimeException -uno::Reference< frame::XModel > getModelFromXIf( const uno::Reference< uno::XInterface >& xIf ) +static uno::Reference< frame::XModel > getModelFromXIf( const uno::Reference< uno::XInterface >& xIf ) { ScDocShell* pDocShell = getDocShellFromIf(xIf ); return pDocShell->GetModel(); } /// @throws uno::RuntimeException -uno::Reference< frame::XModel > getModelFromRange( const uno::Reference< table::XCellRange >& xRange ) +static uno::Reference< frame::XModel > getModelFromRange( const uno::Reference< table::XCellRange >& xRange ) { // the XInterface for getImplementation can be any derived interface, no need for queryInterface uno::Reference< uno::XInterface > xIf( xRange ); return getModelFromXIf( xIf ); } -ScDocument& +static ScDocument& getDocumentFromRange( const uno::Reference< table::XCellRange >& xRange ) { ScDocShell* pDocShell = getDocShellFromRange( xRange ); @@ -1230,7 +1230,7 @@ bool getScRangeListForAddress( const OUString& sName, ScDocShell* pDocSh, const } /// @throws uno::RuntimeException -ScVbaRange* +static ScVbaRange* getRangeForName( const uno::Reference< uno::XComponentContext >& xContext, const OUString& sName, ScDocShell* pDocSh, const table::CellRangeAddress& pAddr, formula::FormulaGrammar::AddressConvention eConv = formula::FormulaGrammar::CONV_XL_A1 ) { ScRangeList aCellRanges; @@ -1371,7 +1371,7 @@ ScVbaRange::getRangeObjectForName( } /// @throws uno::RuntimeException -table::CellRangeAddress getCellRangeAddressForVBARange( const uno::Any& aParam, ScDocShell* pDocSh ) +static table::CellRangeAddress getCellRangeAddressForVBARange( const uno::Any& aParam, ScDocShell* pDocSh ) { uno::Reference< table::XCellRange > xRangeParam; switch ( aParam.getValueTypeClass() ) @@ -2263,13 +2263,13 @@ ScVbaRange::Select() } } -bool cellInRange( const table::CellRangeAddress& rAddr, sal_Int32 nCol, sal_Int32 nRow ) +static bool cellInRange( const table::CellRangeAddress& rAddr, sal_Int32 nCol, sal_Int32 nRow ) { return nCol >= rAddr.StartColumn && nCol <= rAddr.EndColumn && nRow >= rAddr.StartRow && nRow <= rAddr.EndRow; } -void setCursor( SCCOL nCol, SCROW nRow, const uno::Reference< frame::XModel >& xModel, bool bInSel = true ) +static void setCursor( SCCOL nCol, SCROW nRow, const uno::Reference< frame::XModel >& xModel, bool bInSel = true ) { ScTabViewShell* pShell = excel::getBestViewShell( xModel ); if ( pShell ) @@ -2953,7 +2953,7 @@ ScVbaRange::getComment() } /// @throws uno::RuntimeException -uno::Reference< beans::XPropertySet > +static uno::Reference< beans::XPropertySet > getRowOrColumnProps( const uno::Reference< table::XCellRange >& xCellRange, bool bRows ) { uno::Reference< table::XColumnRowRange > xColRow( xCellRange, uno::UNO_QUERY_THROW ); @@ -3280,7 +3280,7 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L return uno::Reference< excel::XRange >(); } -uno::Reference< table::XCellRange > processKey( const uno::Any& Key, const uno::Reference< uno::XComponentContext >& xContext, ScDocShell* pDocSh ) +static uno::Reference< table::XCellRange > processKey( const uno::Any& Key, const uno::Reference< uno::XComponentContext >& xContext, ScDocShell* pDocSh ) { uno::Reference< excel::XRange > xKeyRange; if ( Key.getValueType() == cppu::UnoType<excel::XRange>::get() ) @@ -3305,7 +3305,7 @@ uno::Reference< table::XCellRange > processKey( const uno::Any& Key, const uno:: // helper method for Sort /// @throws uno::RuntimeException -sal_Int32 findSortPropertyIndex( const uno::Sequence< beans::PropertyValue >& props, +static sal_Int32 findSortPropertyIndex( const uno::Sequence< beans::PropertyValue >& props, const OUString& sPropName ) { const beans::PropertyValue* pProp = props.getConstArray(); @@ -3322,7 +3322,7 @@ const OUString& sPropName ) // helper method for Sort /// @throws uno::RuntimeException -void updateTableSortField( const uno::Reference< table::XCellRange >& xParentRange, +static void updateTableSortField( const uno::Reference< table::XCellRange >& xParentRange, const uno::Reference< table::XCellRange >& xColRowKey, sal_Int16 nOrder, table::TableSortField& aTableField, bool bIsSortColumn, bool bMatchCase ) { @@ -3744,7 +3744,7 @@ ScVbaRange::getCalcRowHeight(const table::CellRangeAddress& rAddress) } // return Char Width in points -double getDefaultCharWidth( ScDocShell* pDocShell ) +static double getDefaultCharWidth( ScDocShell* pDocShell ) { ScDocument& rDoc = pDocShell->GetDocument(); OutputDevice* pRefDevice = rDoc.GetRefDevice(); @@ -4103,7 +4103,7 @@ ScVbaRange::getTop() return uno::makeAny( lcl_hmmToPoints( aPoint.Y ) ); } -uno::Reference< sheet::XCellRangeReferrer > getNamedRange( const uno::Reference< uno::XInterface >& xIf, const uno::Reference< table::XCellRange >& thisRange ) +static uno::Reference< sheet::XCellRangeReferrer > getNamedRange( const uno::Reference< uno::XInterface >& xIf, const uno::Reference< table::XCellRange >& thisRange ) { uno::Reference< beans::XPropertySet > xProps( xIf, uno::UNO_QUERY_THROW ); uno::Reference< container::XNameAccess > xNameAccess( xProps->getPropertyValue( "NamedRanges" ), uno::UNO_QUERY_THROW ); diff --git a/sc/source/ui/vba/vbawindows.cxx b/sc/source/ui/vba/vbawindows.cxx index 25fc38d5269d..1ed953d9e778 100644 --- a/sc/source/ui/vba/vbawindows.cxx +++ b/sc/source/ui/vba/vbawindows.cxx @@ -40,7 +40,7 @@ static uno::Reference< XHelperInterface > lcl_createWorkbookHIParent( const uno: return new ScVbaWorkbook( uno::Reference< XHelperInterface >( aApplication, uno::UNO_QUERY_THROW ), xContext, xModel ); } -uno::Any ComponentToWindow( const uno::Any& aSource, const uno::Reference< uno::XComponentContext > & xContext, const uno::Any& aApplication ) +static uno::Any ComponentToWindow( const uno::Any& aSource, const uno::Reference< uno::XComponentContext > & xContext, const uno::Any& aApplication ) { uno::Reference< frame::XModel > xModel( aSource, uno::UNO_QUERY_THROW ); // !! TODO !! iterate over all controllers diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index fe9ed2b53448..06c33982ad4d 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -147,7 +147,7 @@ static void lcl_RemoveAttribs( EditView& rEditView ) pEngine->SetUpdateMode(bOld); } -void lclInsertCharacter( EditView* pTableView, EditView* pTopView, sal_Unicode cChar ) +static void lclInsertCharacter( EditView* pTableView, EditView* pTopView, sal_Unicode cChar ) { OUString aString( cChar ); if( pTableView ) diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index 0d8b53edea74..95303e7e7664 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -1346,17 +1346,17 @@ void ScOutputData::DrawClear() // Lines -long lclGetSnappedX( const OutputDevice& rDev, long nPosX, bool bSnapPixel ) +static long lclGetSnappedX( const OutputDevice& rDev, long nPosX, bool bSnapPixel ) { return (bSnapPixel && nPosX) ? rDev.PixelToLogic( rDev.LogicToPixel( Size( nPosX, 0 ) ) ).Width() : nPosX; } -long lclGetSnappedY( const OutputDevice& rDev, long nPosY, bool bSnapPixel ) +static long lclGetSnappedY( const OutputDevice& rDev, long nPosY, bool bSnapPixel ) { return (bSnapPixel && nPosY) ? rDev.PixelToLogic( rDev.LogicToPixel( Size( 0, nPosY ) ) ).Height() : nPosY; } -size_t lclGetArrayColFromCellInfoX( sal_uInt16 nCellInfoX, sal_uInt16 nCellInfoFirstX, sal_uInt16 nCellInfoLastX, bool bRTL ) +static size_t lclGetArrayColFromCellInfoX( sal_uInt16 nCellInfoX, sal_uInt16 nCellInfoFirstX, sal_uInt16 nCellInfoLastX, bool bRTL ) { return static_cast< size_t >( bRTL ? (nCellInfoLastX + 2 - nCellInfoX) : (nCellInfoX - nCellInfoFirstX) ); } diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/out |