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/output2.cxx index 8b77601bcdf3..522dfba38f0b 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -280,7 +280,7 @@ bool lcl_GetBoolValue(const ScPatternAttr& rPattern, sal_uInt16 nWhich, const Sf } -bool lcl_isNumberFormatText(const ScDocument* pDoc, SCCOL nCellX, SCROW nCellY, SCTAB nTab ) +static bool lcl_isNumberFormatText(const ScDocument* pDoc, SCCOL nCellX, SCROW nCellY, SCTAB nTab ) { sal_uInt32 nCurrentNumberFormat; pDoc->GetNumberFormat( nCellX, nCellY, nTab, nCurrentNumberFormat); @@ -486,7 +486,7 @@ void ScDrawStringsVars::SetPatternSimple( const ScPatternAttr* pNew, const SfxIt bShrink = pPattern->GetItem( ATTR_SHRINKTOFIT, pCondSet ).GetValue(); } -inline bool SameValue( const ScRefCellValue& rCell, const ScRefCellValue& rOldCell ) +static inline bool SameValue( const ScRefCellValue& rCell, const ScRefCellValue& rOldCell ) { return rOldCell.meType == CELLTYPE_VALUE && rCell.meType == CELLTYPE_VALUE && rCell.mfValue == rOldCell.mfValue; @@ -991,7 +991,7 @@ bool ScOutputData::GetMergeOrigin( SCCOL nX, SCROW nY, SCSIZE nArrY, return true; } -inline bool StringDiffer( const ScPatternAttr*& rpOldPattern, const ScPatternAttr* pNewPattern ) +static inline bool StringDiffer( const ScPatternAttr*& rpOldPattern, const ScPatternAttr* pNewPattern ) { OSL_ENSURE( pNewPattern, "pNewPattern" ); @@ -1078,7 +1078,7 @@ static inline void lcl_CreateInterpretProgress( bool& bProgress, ScDocument* pDo } } -inline bool IsAmbiguousScript( SvtScriptType nScript ) +static inline bool IsAmbiguousScript( SvtScriptType nScript ) { return ( nScript != SvtScriptType::LATIN && nScript != SvtScriptType::ASIAN && diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 49db8ee8e720..12e05ed32aaa 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -1426,7 +1426,7 @@ void ScTabView::UpdateHeaderWidth( const ScVSplitPos* pWhich, const SCROW* pPosY } } -inline void ShowHide( vcl::Window* pWin, bool bShow ) +static inline void ShowHide( vcl::Window* pWin, bool bShow ) { OSL_ENSURE(pWin || !bShow, "window is not present"); if (pWin) diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 7aa6fc9a65d9..9361c9b5cc9e 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -317,7 +317,7 @@ static bool lcl_AddFunction( ScAppOptions& rAppOpt, sal_uInt16 nOpCode ) namespace HelperNotifyChanges { - void NotifyIfChangesListeners(const ScDocShell &rDocShell, ScMarkData& rMark, SCCOL nCol, SCROW nRow) + static void NotifyIfChangesListeners(const ScDocShell &rDocShell, ScMarkData& rMark, SCCOL nCol, SCROW nRow) { if (ScModelObj *pModelObj = getMustPropagateChangesModel(rDocShell)) { diff --git a/scaddins/source/analysis/analysishelper.cxx b/scaddins/source/analysis/analysishelper.cxx index 50e1c84720eb..20bd97273fc3 100644 --- a/scaddins/source/analysis/analysishelper.cxx +++ b/scaddins/source/analysis/analysishelper.cxx @@ -769,31 +769,31 @@ double Erfc( double x ) return ::rtl::math::erfc(x); } -inline bool IsNum( sal_Unicode c ) +static inline bool IsNum( sal_Unicode c ) { return c >= '0' && c <= '9'; } -inline bool IsComma( sal_Unicode c ) +static inline bool IsComma( sal_Unicode c ) { return c == '.' || c == ','; } -inline bool IsExpStart( sal_Unicode c ) +static inline bool IsExpStart( sal_Unicode c ) { return c == 'e' || c == 'E'; } -inline bool IsImagUnit( sal_Unicode c ) +static inline bool IsImagUnit( sal_Unicode c ) { return c == 'i' || c == 'j'; } -inline sal_uInt16 GetVal( sal_Unicode c ) +static inline sal_uInt16 GetVal( sal_Unicode c ) { return sal_uInt16( c - '0' ); } diff --git a/scaddins/source/analysis/bessel.cxx b/scaddins/source/analysis/bessel.cxx index 31c092e20c99..ef8cffacbd44 100644 --- a/scaddins/source/analysis/bessel.cxx +++ b/scaddins/source/analysis/bessel.cxx @@ -223,7 +223,7 @@ double BesselI( double x, sal_Int32 n ) /// @throws IllegalArgumentException /// @throws NoConvergenceException -double Besselk0( double fNum ) +static double Besselk0( double fNum ) { double fRet; @@ -250,7 +250,7 @@ double Besselk0( double fNum ) /// @throws IllegalArgumentException /// @throws NoConvergenceException -double Besselk1( double fNum ) +static double Besselk1( double fNum ) { double fRet; @@ -322,7 +322,7 @@ double BesselK( double fNum, sal_Int32 nOrder ) /// @throws IllegalArgumentException /// @throws NoConvergenceException -double Bessely0( double fX ) +static double Bessely0( double fX ) { if (fX <= 0) throw IllegalArgumentException(); @@ -375,7 +375,7 @@ double Bessely0( double fX ) // https://bz.apache.org/ooo/attachment.cgi?id=63609 /// @throws IllegalArgumentException /// @throws NoConvergenceException -double Bessely1( double fX ) +static double Bessely1( double fX ) { if (fX <= 0) throw IllegalArgumentException(); diff --git a/scaddins/source/datefunc/datefunc.cxx b/scaddins/source/datefunc/datefunc.cxx index 407b8425fe10..ae626c9fcaf5 100644 --- a/scaddins/source/datefunc/datefunc.cxx +++ b/scaddins/source/datefunc/datefunc.cxx @@ -81,14 +81,14 @@ sal_uInt16 ScaFuncData::GetStrIndex( sal_uInt16 nParam ) const return (nParam > nParamCount) ? (nParamCount * 2) : (nParam * 2); } -void InitScaFuncDataList(ScaFuncDataList& rList) +static void InitScaFuncDataList(ScaFuncDataList& rList) { for (const auto & nIndex : pFuncDataArr) rList.push_back(ScaFuncData(nIndex)); } // entry points for service registration / instantiation -uno::Reference< uno::XInterface > ScaDateAddIn_CreateInstance( +static uno::Reference< uno::XInterface > ScaDateAddIn_CreateInstance( const uno::Reference< lang::XMultiServiceFactory >& ) { return static_cast<cppu::OWeakObject*>(new ScaDateAddIn()); diff --git a/scaddins/source/pricing/black_scholes.cxx b/scaddins/source/pricing/black_scholes.cxx index fe111f03858a..ff5c5f71cda6 100644 --- a/scaddins/source/pricing/black_scholes.cxx +++ b/scaddins/source/pricing/black_scholes.cxx @@ -86,16 +86,16 @@ namespace bs { // helper functions -inline double sqr(double x) { +static inline double sqr(double x) { return x*x; } // normal density (see also ScInterpreter::phi) -inline double dnorm(double x) { +static inline double dnorm(double x) { //return (1.0/sqrt(2.0*M_PI))*exp(-0.5*x*x); // windows may not have M_PI return 0.39894228040143268*exp(-0.5*x*x); } // cumulative normal distribution (see also ScInterpreter::integralPhi) -inline double pnorm(double x) { +static inline double pnorm(double x) { //return 0.5*(erf(sqrt(0.5)*x)+1.0); // windows may not have erf return 0.5 * ::rtl::math::erfc(-x * 0.7071067811865475); } @@ -293,7 +293,7 @@ double binasset(double S, double vol, double rd, double rf, // one function binary // using bincash() if fd==types::Domestic // using binasset() if fd==types::Foreign -double binary(double S, double vol, double rd, double rf, +static double binary(double S, double vol, double rd, double rf, double tau, double K, types::PutCall pc, types::ForDom fd, types::Greeks greek) { @@ -316,7 +316,7 @@ double binary(double S, double vol, double rd, double rf, // into one function // B1<=0 - it is assumed lower barrier not set // B2<=0 - it is assumed upper barrier not set -double binary(double S, double vol, double rd, double rf, +static double binary(double S, double vol, double rd, double rf, double tau, double B1, double B2, types::ForDom fd, types::Greeks greek) { assert(tau>=0.0); @@ -503,7 +503,7 @@ namespace internal { // going to path-dependent barrier options, // K<0 - assume binary option // K>=0 - assume put/call option -double vanilla(double S, double vol, double rd, double rf, +static double vanilla(double S, double vol, double rd, double rf, double tau, double K, double B1, double B2, types::PutCall pc, types::ForDom fd, types::Greeks greek) { @@ -516,7 +516,7 @@ double vanilla(double S, double vol, double rd, double rf, } return val; } -double vanilla_trunc(double S, double vol, double rd, double rf, +static double vanilla_trunc(double S, double vol, double rd, double rf, double tau, double K, double B1, double B2, types::PutCall pc, types::ForDom fd, types::Greeks greek) { @@ -546,7 +546,7 @@ namespace internal { // with sc=1 and V1() being the price of the respective truncated // vanilla option, V() would be the price of the respective barrier // option if only one barrier is present -double barrier_term(double S, double vol, double rd, double rf, +static double barrier_term(double S, double vol, double rd, double rf, double tau, double K, double B1, double B2, double sc, types::PutCall pc, types::ForDom fd, types::Greeks greek) { @@ -651,7 +651,7 @@ double barrier_term(double S, double vol, double rd, double rf, } // one term of the infinite sum for the valuation of double barriers -double barrier_double_term( double S, double vol, double rd, double rf, +static double barrier_double_term( double S, double vol, double rd, double rf, double tau, double K, double B1, double B2, double fac, double sc, int i, types::PutCall pc, types::ForDom fd, types::Greeks greek) { @@ -709,7 +709,7 @@ double barrier_double_term( double S, double vol, double rd, double rf, // general pricer for any type of options with continuously monitored barriers // allows two, one or zero barriers, only knock-out style // payoff profiles allowed based on vanilla_trunc() -double barrier_ko(double S, double vol, double rd, double rf, +static double barrier_ko(double S, double vol, double rd, double rf, double tau, double K, double B1, double B2, types::PutCall pc, types::ForDom fd, types::Greeks greek) { @@ -784,7 +784,7 @@ double barrier_ko(double S, double vol, double rd, double rf, } // knock-in style barrier -double barrier_ki(double S, double vol, double rd, double rf, +static double barrier_ki(double S, double vol, double rd, double rf, double tau, double K, double B1, double B2, types::PutCall pc, types::ForDom fd, types::Greeks greek) { @@ -793,7 +793,7 @@ double barrier_ki(double S, double vol, double rd, double rf, } // general barrier -double barrier(double S, double vol, double rd, double rf, +static double barrier(double S, double vol, double rd, double rf, double tau, double K, double B1, double B2, types::PutCall pc, types::ForDom fd, types::BarrierKIO kio, types::BarrierActive bcont, diff --git a/scaddins/source/pricing/pricing.cxx b/scaddins/source/pricing/pricing.cxx index eaf76ff60418..51a76f216663 100644 --- a/scaddins/source/pricing/pricing.cxx +++ b/scaddins/source/pricing/pricing.cxx @@ -91,7 +91,7 @@ void sca::pricing::InitScaFuncDataList(ScaFuncDataList& rList) } // entry points for service registration / instantiation -uno::Reference< uno::XInterface > ScaPricingAddIn_CreateInstance( +static uno::Reference< uno::XInterface > ScaPricingAddIn_CreateInstance( const uno::Reference< lang::XMultiServiceFactory >& ) { return static_cast<cppu::OWeakObject*>(new ScaPricingAddIn()); diff --git a/scripting/source/dlgprov/dlgprov.cxx b/scripting/source/dlgprov/dlgprov.cxx index 537499cbd0df..90a28cca56fd 100644 --- a/scripting/source/dlgprov/dlgprov.cxx +++ b/scripting/source/dlgprov/dlgprov.cxx @@ -76,7 +76,7 @@ namespace comp_DialogModelProvider return s; } - uno::Reference< uno::XInterface > _create(const uno::Reference< uno::XComponentContext > & context) + static uno::Reference< uno::XInterface > _create(const uno::Reference< uno::XComponentContext > & context) { return static_cast< ::cppu::OWeakObject * >(new dlgprov::DialogModelProvider(context)); } @@ -205,7 +205,7 @@ namespace dlgprov } - Reference< resource::XStringResourceManager > getStringResourceFromDialogLibrary + static Reference< resource::XStringResourceManager > getStringResourceFromDialogLibrary ( const Reference< container::XNameContainer >& xDialogLib ) { Reference< resource::XStringResourceManager > xStringResourceManager; diff --git a/scripting/source/provider/MasterScriptProvider.cxx b/scripting/source/provider/MasterScriptProvider.cxx index d06833d7a6dd..56082753e864 100644 --- a/scripting/source/provider/MasterScriptProvider.cxx +++ b/scripting/source/provider/MasterScriptProvider.cxx @@ -56,7 +56,7 @@ using namespace ::sf_misc; namespace func_provider { -bool endsWith( const OUString& target, const OUString& item ) +static bool endsWith( const OUString& target, const OUString& item ) { sal_Int32 index = target.indexOf( item ); return index != -1 && @@ -709,14 +709,14 @@ Sequence< OUString > SAL_CALL MasterScriptProvider::getSupportedServiceNames( ) namespace scripting_runtimemgr { -Reference< XInterface > sp_create( +static Reference< XInterface > sp_create( const Reference< XComponentContext > & xCompC ) { return static_cast<cppu::OWeakObject *>(new ::func_provider::MasterScriptProvider( xCompC )); } -Sequence< OUString > sp_getSupportedServiceNames( ) +static Sequence< OUString > sp_getSupportedServiceNames( ) { OUString names[3]; @@ -728,20 +728,20 @@ Sequence< OUString > sp_getSupportedServiceNames( ) } -OUString sp_getImplementationName( ) +static OUString sp_getImplementationName( ) { return OUString( "com.sun.star.script.provider.MasterScriptProvider" ); } // ***** registration or ScriptingFrameworkURIHelper -Reference< XInterface > urihelper_create( +static Reference< XInterface > urihelper_create( const Reference< XComponentContext > & xCompC ) { return static_cast<cppu::OWeakObject *>( new ::func_provider::ScriptingFrameworkURIHelper( xCompC )); } -Sequence< OUString > urihelper_getSupportedServiceNames( ) +static Sequence< OUString > urihelper_getSupportedServiceNames( ) { OUString serviceNameList[] = { OUString( @@ -753,7 +753,7 @@ Sequence< OUString > urihelper_getSupportedServiceNames( ) return serviceNames; } -OUString urihelper_getImplementationName( ) +static OUString urihelper_getImplementationName( ) { return OUString( "com.sun.star.script.provider.ScriptURIHelper"); diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx index 94c7d0ba85f7..faf2fc3193a4 100644 --- a/scripting/source/stringresource/stringresource.cxx +++ b/scripting/source/stringresource/stringresource.cxx @@ -1497,7 +1497,7 @@ void StringResourcePersistenceImpl::importBinary( const Sequence< ::sal_Int8 >& // Private helper methods -bool checkNamingSceme( const OUString& aName, const OUString& aNameBase, +static bool checkNamingSceme( const OUString& aName, const OUString& aNameBase, Locale& aLocale ) { bool bSuccess = false; @@ -1638,7 +1638,7 @@ bool StringResourcePersistenceImpl::implLoadLocale( LocaleItem* ) return false; } -OUString implGetNameScemeForLocaleItem( const LocaleItem* pLocaleItem ) +static OUString implGetNameScemeForLocaleItem( const LocaleItem* pLocaleItem ) { /* FIXME-BCP47: this uses '_' underscore character as separator and * also appends Variant, which can't be blindly changed as it would @@ -1697,7 +1697,7 @@ OUString StringResourcePersistenceImpl::implGetPathForLocaleItem // White space according to Java property files specification in // http://java.sun.com/j2se/1.4.2/docs/api/java/util/Properties.html#load(java.io.InputStream) -inline bool isWhiteSpace( sal_Unicode c ) +static inline bool isWhiteSpace( sal_Unicode c ) { bool bWhite = ( c == 0x0020 || // space c == 0x0009 || // tab @@ -1707,7 +1707,7 @@ inline bool isWhiteSpace( sal_Unicode c ) return bWhite; } -inline void skipWhites( const sal_Unicode* pBuf, sal_Int32 nLen, sal_Int32& ri ) +static inline void skipWhites( const sal_Unicode* pBuf, sal_Int32 nLen, sal_Int32& ri ) { while( ri < nLen ) { @@ -1717,7 +1717,7 @@ inline void skipWhites( const sal_Unicode* pBuf, sal_Int32 nLen, sal_Int32& ri ) } } -inline bool isHexDigit( sal_Unicode c, sal_uInt16& nDigitVal ) +static inline bool isHexDigit( sal_Unicode c, sal_uInt16& nDigitVal ) { bool bRet = true; if( c >= '0' && c <= '9' ) @@ -1731,7 +1731,7 @@ inline bool isHexDigit( sal_Unicode c, sal_uInt16& nDigitVal ) return bRet; } -sal_Unicode getEscapeChar( const sal_Unicode* pBuf, sal_Int32 nLen, sal_Int32& ri ) +static sal_Unicode getEscapeChar( const sal_Unicode* pBuf, sal_Int32 nLen, sal_Int32& ri ) { sal_Int32 i = ri; @@ -1786,7 +1786,7 @@ sal_Unicode getEscapeChar( const sal_Unicode* pBuf, sal_Int32 nLen, sal_Int32& r return cRet; } -void CheckContinueInNextLine( const Reference< io::XTextInputStream2 >& xTextInputStream, +static void CheckContinueInNextLine( const Reference< io::XTextInputStream2 >& xTextInputStream, OUString& aLine, bool& bEscapePending, const sal_Unicode*& pBuf, sal_Int32& nLen, sal_Int32& i ) { @@ -1928,13 +1928,13 @@ bool StringResourcePersistenceImpl::implReadPropertiesFile } -inline sal_Unicode getHexCharForDigit( sal_uInt16 nDigitVal ) +static inline sal_Unicode getHexCharForDigit( sal_uInt16 nDigitVal ) { sal_Unicode cRet = ( nDigitVal < 10 ) ? ('0' + nDigitVal) : ('a' + (nDigitVal-10)); return cRet; } -void implWriteCharToBuffer( OUStringBuffer& aBuf, sal_Unicode cu, bool bKey ) +static void implWriteCharToBuffer( OUStringBuffer& aBuf, sal_Unicode cu, bool bKey ) { if( cu == '\\' ) { @@ -1988,7 +1988,7 @@ void implWriteCharToBuffer( OUStringBuffer& aBuf, sal_Unicode cu, bool bKey ) } } -void implWriteStringWithEncoding( const OUString& aStr, +static void implWriteStringWithEncoding( const OUString& aStr, Reference< io::XTextOutputStream2 > const & xTextOutputStream, bool bKey ) { static sal_Unicode cLineFeed = 0xa; diff --git a/scripting/source/vbaevents/eventhelper.cxx b/scripting/source/vbaevents/eventhelper.cxx index 345c4993b376..3ac632e8c039 100644 --- a/scripting/source/vbaevents/eventhelper.cxx +++ b/scripting/source/vbaevents/eventhelper.cxx @@ -83,17 +83,17 @@ using namespace ::ooo::vba; static const char DELIM[] = "::"; static const sal_Int32 DELIMLEN = strlen(DELIM); -bool isKeyEventOk( awt::KeyEvent& evt, const Sequence< Any >& params ) +static bool isKeyEventOk( awt::KeyEvent& evt, const Sequence< Any >& params ) { return ( params.getLength() > 0 ) && ( params[ 0 ] >>= evt ); } -bool isMouseEventOk( awt::MouseEvent& evt, const Sequence< Any >& params ) +static bool isMouseEventOk( awt::MouseEvent& evt, const Sequence< Any >& params ) { return ( params.getLength() > 0 ) && ( params[ 0 ] >>= evt ); } -Sequence< Any > ooMouseEvtToVBADblClick( const Sequence< Any >& params ) +static Sequence< Any > ooMouseEvtToVBADblClick( const Sequence< Any >& params ) { awt::MouseEvent evt; @@ -104,7 +104,7 @@ Sequence< Any > ooMouseEvtToVBADblClick( const Sequence< Any >& params ) return params; } -Sequence< Any > ooMouseEvtToVBAMouseEvt( const Sequence< Any >& params ) +static Sequence< Any > ooMouseEvtToVBAMouseEvt( const Sequence< Any >& params ) { Sequence< Any > translatedParams; awt::MouseEvent evt; @@ -125,7 +125,7 @@ Sequence< Any > ooMouseEvtToVBAMouseEvt( const Sequence< Any >& params ) return translatedParams; } -Sequence< Any > ooKeyPressedToVBAKeyPressed( const Sequence< Any >& params ) +static Sequence< Any > ooKeyPressedToVBAKeyPressed( const Sequence< Any >& params ) { Sequence< Any > translatedParams; awt::KeyEvent evt; @@ -140,7 +140,7 @@ Sequence< Any > ooKeyPressedToVBAKeyPressed( const Sequence< Any >& params ) return translatedParams; } -Sequence< Any > ooKeyPressedToVBAKeyUpDown( const Sequence< Any >& params ) +static Sequence< Any > ooKeyPressedToVBAKeyUpDown( const Sequence< Any >& params ) { Sequence< Any > translatedParams; awt::KeyEvent evt; @@ -182,10 +182,10 @@ struct TranslatePropMap TranslateInfo aTransInfo; }; -bool ApproveAll(const ScriptEvent& evt, void const * pPara); //allow all types of controls to execute the event -bool ApproveType(const ScriptEvent& evt, void const * pPara); //certain types of controls should execute the event, those types are given by pPara -bool DenyType(const ScriptEvent& evt, void const * pPara); //certain types of controls should not execute the event, those types are given by pPara -bool DenyMouseDrag(const ScriptEvent& evt, void const * pPara); //used for VBA MouseMove event when "Shift" key is pressed +static bool ApproveAll(const ScriptEvent& evt, void const * pPara); //allow all types of controls to execute the event +static bool ApproveType(const ScriptEvent& evt, void const * pPara); //certain types of controls should execute the event, those types are given by pPara +static bool DenyType(const ScriptEvent& evt, void const * pPara); //certain types of controls should not execute the event, those types are given by pPara +static bool DenyMouseDrag(const ScriptEvent& evt, void const * pPara); //used for VBA MouseMove event when "Shift" key is pressed struct TypeList { @@ -254,7 +254,7 @@ static TranslatePropMap aTranslatePropMap_Impl[] = { OUString("keyPressed"), { OUString("_KeyPress"), ooKeyPressedToVBAKeyPressed, ApproveAll, nullptr } } }; -EventInfoHash& getEventTransInfo() +static EventInfoHash& getEventTransInfo() { static bool initialised = false; static EventInfoHash eventTransInfo; @@ -299,7 +299,7 @@ private: bool m_bDispose; }; -bool +static bool eventMethodToDescriptor( const OUString& rEventMethod, ScriptEventDescriptor& evtDesc, const OUString& sCodeName ) { // format of ControlListener is TypeName::methodname e.g. @@ -742,7 +742,7 @@ bool ApproveAll(SAL_UNUSED_PARAMETER const ScriptEvent&, SAL_UNUSED_PARAMETER vo } //for the given control type in evt.Arguments[0], look for if it appears in the type list in pPara -bool FindControl(const ScriptEvent& evt, void const * pPara) +static bool FindControl(const ScriptEvent& evt, void const * pPara) { lang::EventObject aEvent; evt.Arguments[ 0 ] >>= aEvent; diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index c39f13a490d8..046c9f0734a2 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -93,7 +93,7 @@ bool checkBeginWithNumber(const OUString& rStr) #define CPPUNIT_ASSERT_MOTIONPATH(expect, actual) \ assertMotionPath(expect, actual, CPPUNIT_SOURCELINE()) -void assertMotionPath(const OUString &rStr1, const OUString &rStr2, const CppUnit::SourceLine &rSourceLine) +static void assertMotionPath(const OUString &rStr1, const OUString &rStr2, const CppUnit::SourceLine &rSourceLine) { sal_Int32 nIdx1 = 0; sal_Int32 nIdx2 = 0; @@ -496,7 +496,7 @@ void SdOOXMLExportTest2::testTdf91378() xDocShRef->DoClose(); } -bool checkTransitionOnPage(uno::Reference<drawing::XDrawPagesSupplier> const & xDoc, sal_Int32 nSlideNumber, +static bool checkTransitionOnPage(uno::Reference<drawing::XDrawPagesSupplier> const & xDoc, sal_Int32 nSlideNumber, sal_Int16 nExpectedTransitionType, sal_Int16 nExpectedTransitionSubType, bool bExpectedDirection = true) { diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 2427b3dbdc20..cb06f043a0aa 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -93,7 +93,7 @@ using namespace ::com::sun::star; namespace com { namespace sun { namespace star { namespace uno { template<class T> -std::ostream& operator<<(std::ostream& rStrm, const uno::Reference<T>& xRef) +static std::ostream& operator<<(std::ostream& rStrm, const uno::Reference<T>& xRef) { rStrm << xRef.get(); return rStrm; diff --git a/sd/source/core/EffectMigration.cxx b/sd/source/core/EffectMigration.cxx index 369de3136adb..715cf2f6d5a8 100644 --- a/sd/source/core/EffectMigration.cxx +++ b/sd/source/core/EffectMigration.cxx @@ -390,7 +390,7 @@ const deprecated_AnimationEffect_conversion_table[] = { AnimationEffect_NONE, nullptr, nullptr } }; -EffectSequence::iterator ImplFindEffect( MainSequencePtr const & pMainSequence, const Reference< XShape >& rShape, sal_Int16 nSubItem ) +static EffectSequence::iterator ImplFindEffect( MainSequencePtr const & pMainSequence, const Reference< XShape >& rShape, sal_Int16 nSubItem ) { EffectSequence::iterator aIter; @@ -1318,7 +1318,7 @@ void EffectMigration::SetAnimationPath( SvxShape* pShape, SdrPathObj const * pPa } // #i42894# helper which creates the needed XAnimate for changing visibility and all the (currently) needed embeddings -void createVisibilityOnOffNode(Reference< XTimeContainer > const & rxParentContainer, SdrObject& rCandidate, bool bVisible, bool bOnClick, double fDuration) +static void createVisibilityOnOffNode(Reference< XTimeContainer > const & rxParentContainer, SdrObject& rCandidate, bool bVisible, bool bOnClick, double fDuration) { Reference< XMultiServiceFactory > xMsf(::comphelper::getProcessServiceFactory()); diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx index 74373005298a..7173959d0572 100644 --- a/sd/source/core/drawdoc3.cxx +++ b/sd/source/core/drawdoc3.cxx @@ -1340,7 +1340,7 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, bool bOnl * If rLayoutName is empty, the first master page is used. */ // #i121863# factored out functionality -bool isMasterPageLayoutNameUnique(const SdDrawDocument& rDoc, const OUString& rCandidate) +static bool isMasterPageLayoutNameUnique(const SdDrawDocument& rDoc, const OUString& rCandidate) { if (rCandidate.isEmpty()) { @@ -1367,7 +1367,7 @@ bool isMasterPageLayoutNameUnique(const SdDrawDocument& rDoc, const OUString& rC } // #i121863# factored out functinality -OUString createNewMasterPageLayoutName(const SdDrawDocument& rDoc) +static OUString createNewMasterPageLayoutName(const SdDrawDocument& rDoc) { const OUString aBaseName(SdResId(STR_LAYOUT_DEFAULT_NAME)); sal_uInt16 nCount(0); diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index 7f9c18e72978..3901a13c008d 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -1272,7 +1272,7 @@ static const LayoutDescriptor& GetLayoutDescriptor( AutoLayout eLayout ) return aLayouts[ eLayout - AUTOLAYOUT_START ]; } -rtl::OUString enumtoString(AutoLayout aut) +static rtl::OUString enumtoString(AutoLayout aut) { rtl::OUString retstr; switch (aut) @@ -1435,7 +1435,7 @@ static void CalcAutoLayoutRectangles( SdPage const & rPage,::tools::Rectangle* r } } -void findAutoLayoutShapesImpl( SdPage& rPage, const LayoutDescriptor& rDescriptor, std::vector< SdrObject* >& rShapes, bool bInit, bool bSwitchLayout ) +static void findAutoLayoutShapesImpl( SdPage& rPage, const LayoutDescriptor& rDescriptor, std::vector< SdrObject* >& rShapes, bool bInit, bool bSwitchLayout ) { int i; @@ -2074,7 +2074,7 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const ::tools::Rectangle& rN } } -SdrObject* convertPresentationObjectImpl(SdPage& rPage, SdrObject* pSourceObj, PresObjKind& eObjKind, bool bVertical, const ::tools::Rectangle& rRect) +static SdrObject* convertPresentationObjectImpl(SdPage& rPage, SdrObject* pSourceObj, PresObjKind& eObjKind, bool bVertical, const ::tools::Rectangle& rRect) { SdDrawDocument& rModel(static_cast< SdDrawDocument& >(rPage.getSdrModelFromSdrPage())); if( !pSourceObj ) diff --git a/sd/source/core/text/textapi.cxx b/sd/source/core/text/textapi.cxx index 9cfc8dfcdb47..584a84dd3207 100644 --- a/sd/source/core/text/textapi.cxx +++ b/sd/source/core/text/textapi.cxx @@ -105,7 +105,7 @@ public: SdDrawDocument* GetDoc() { return m_xImpl->mpDoc; } }; -const SvxItemPropertySet* ImplGetSdTextPortionPropertyMap() +static const SvxItemPropertySet* ImplGetSdTextPortionPropertyMap() { static const SfxItemPropertyMapEntry aSdTextPortionPropertyEntries[] = { diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx index 1ec8b3d11d75..230797458c05 100644 --- a/sd/source/filter/eppt/eppt.cxx +++ b/sd/source/filter/eppt/eppt.cxx @@ -163,7 +163,7 @@ void PPTWriter::exportPPTPost( ) mbStatus = true; }; -void ImplExportComments( const uno::Reference< drawing::XDrawPage >& xPage, SvMemoryStream& rBinaryTagData10Atom ); +static void ImplExportComments( const uno::Reference< drawing::XDrawPage >& xPage, SvMemoryStream& rBinaryTagData10Atom ); void PPTWriter::ImplWriteSlide( sal_uInt32 nPageNum, sal_uInt32 nMasterNum, sal_uInt16 nMode, bool bHasBackground, Reference< XPropertySet > const & aXBackgroundPropSet ) diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx index 7d5040e8664d..f5df6e331b8a 100644 --- a/sd/source/filter/eppt/epptso.cxx +++ b/sd/source/filter/eppt/epptso.cxx @@ -3008,7 +3008,7 @@ bool PPTWriter::ImplCreateCellBorder( const CellBorder* pCellBorder, sal_Int32 n } //get merged cell's width -sal_Int32 GetCellRight( sal_Int32 nColumn, +static sal_Int32 GetCellRight( sal_Int32 nColumn, ::tools::Rectangle const & rect, std::vector< std::pair< sal_Int32, sal_Int32 > >& aColumns, uno::Reference< table::XMergeableCell > const & xCell ) @@ -3025,7 +3025,7 @@ sal_Int32 GetCellRight( sal_Int32 nColumn, return nRight; } //get merged cell's height -sal_Int32 GetCellBottom( sal_Int32 nRow, +static sal_Int32 GetCellBottom( sal_Int32 nRow, ::tools::Rectangle const & rect, std::vector< std::pair< sal_Int32, sal_Int32 > >& aRows, uno::Reference< table::XMergeableCell > const & xCell ) diff --git a/sd/source/filter/eppt/pptexanimations.cxx b/sd/source/filter/eppt/pptexanimations.cxx index 70a2286eb031..f0211dd9c728 100644 --- a/sd/source/filter/eppt/pptexanimations.cxx +++ b/sd/source/filter/eppt/pptexanimations.cxx @@ -83,7 +83,7 @@ using namespace ::com::sun::star::presentation; namespace ppt { -void ImplTranslateAttribute( OUString& rString, const TranslateMode eTranslateMode ) +static void ImplTranslateAttribute( OUString& rString, const TranslateMode eTranslateMode ) { if ( eTranslateMode != TRANSLATE_NONE ) { diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx index 79df8be785cf..7968a60d0054 100644 --- a/sd/source/filter/html/pubdlg.cxx +++ b/sd/source/filter/html/pubdlg.cxx @@ -77,6 +77,10 @@ const char* const aPageHelpIds[NOOFPAGES] = HID_SD_HTMLEXPORT_PAGE6 }; +static SvStream& operator >> (SvStream& rIn, SdPublishingDesign& rDesign); + +static SvStream& WriteSdPublishingDesign(SvStream& rOut, const SdPublishingDesign& rDesign); + // This class has all the settings for the HTML-export autopilot class SdPublishingDesign { diff --git a/sd/source/filter/ppt/pptinanimations.cxx b/sd/source/filter/ppt/pptinanimations.cxx index 8e553159d968..5c600a3629f0 100644 --- a/sd/source/filter/ppt/pptinanimations.cxx +++ b/sd/source/filter/ppt/pptinanimations.cxx @@ -87,7 +87,7 @@ using namespace ::com::sun::star::presentation; namespace ppt { -SvStream& operator>>(SvStream& rIn, AnimationNode& rNode ) +static SvStream& operator>>(SvStream& rIn, AnimationNode& rNode ) { rIn.ReadInt32( rNode.mnU1 ); rIn.ReadInt32( rNode.mnRestart ); diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx index 687c46591774..eb2a7d2f66db 100644 --- a/sd/source/filter/xml/sdxmlwrp.cxx +++ b/sd/source/filter/xml/sdxmlwrp.cxx @@ -147,7 +147,7 @@ struct XML_SERVICES const sal_Char* mpSettings; }; -XML_SERVICES* getServices( bool bImport, bool bDraw, sal_uLong nStoreVer ) +static XML_SERVICES* getServices( bool bImport, bool bDraw, sal_uLong nStoreVer ) { static XML_SERVICES gServices[] = { @@ -416,7 +416,7 @@ ErrCode ReadThroughComponent( //But there exist documents which were saved previous to that modification //so here we detect such cases and fix them up to ensure the previews //numbering level matches that of the outline level it previews -void fixupOutlinePlaceholderNumberingDepths(SdDrawDocument* pDoc) +static void fixupOutlinePlaceholderNumberingDepths(SdDrawDocument* pDoc) { for (sal_uInt16 i = 0; i < pDoc->GetMasterSdPageCount(PageKind::Standard); ++i) { diff --git a/sd/source/ui/accessibility/SdShapeTypes.cxx b/sd/source/ui/accessibility/SdShapeTypes.cxx index 835ef4a08828..016f6a4a2df5 100644 --- a/sd/source/ui/accessibility/SdShapeTypes.cxx +++ b/sd/source/ui/accessibility/SdShapeTypes.cxx @@ -26,7 +26,7 @@ namespace accessibility { -AccessibleShape* +static AccessibleShape* CreateSdAccessibleShape ( const AccessibleShapeInfo& rShapeInfo, const AccessibleShapeTreeInfo& rShapeTreeInfo, diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx index d759a36a6737..c896d0003587 100644 --- a/sd/source/ui/animations/CustomAnimationList.cxx +++ b/sd/source/ui/animations/CustomAnimationList.cxx @@ -759,7 +759,7 @@ void CustomAnimationList::append( CustomAnimationEffectPtr pEffect ) } } -void selectShape( SvTreeListBox* pTreeList, const Reference< XShape >& xShape ) +static void selectShape( SvTreeListBox* pTreeList, const Reference< XShape >& xShape ) { CustomAnimationListEntry* pEntry = static_cast< CustomAnimationListEntry* >(pTreeList->First()); while( pEntry ) diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index ca2a57dc099a..6fa5f9aefeb0 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -917,7 +917,7 @@ void CustomAnimationPane::UpdateLook() } } -void addValue( std::unique_ptr<STLPropertySet>& pSet, sal_Int32 nHandle, const Any& rValue ) +static void addValue( std::unique_ptr<STLPropertySet>& pSet, sal_Int32 nHandle, const Any& rValue ) { switch( pSet->getPropertyState( nHandle ) ) { @@ -1703,7 +1703,7 @@ void CustomAnimationPane::onChangeCurrentPage() } } -bool getTextSelection( const Any& rSelection, Reference< XShape >& xShape, std::vector< sal_Int16 >& rParaList ) +static bool getTextSelection( const Any& rSelection, Reference< XShape >& xShape, std::vector< sal_Int16 >& rParaList ) { Reference< XTextRange > xSelectedText; rSelection >>= xSelectedText; diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx index e8f518582ef1..d6ddd78d23cd 100644 --- a/sd/source/ui/annotations/annotationwindow.cxx +++ b/sd/source/ui/annotations/annotationwindow.cxx @@ -99,7 +99,7 @@ using namespace ::com::sun::star::text; namespace sd { -Color ColorFromAlphaColor(sal_uInt8 aTransparency, Color const &aFront, Color const &aBack ) +static Color ColorFromAlphaColor(sal_uInt8 aTransparency, Color const &aFront, Color const &aBack ) { return Color(static_cast<sal_uInt8>(aFront.GetRed() * aTransparency/double(255) + aBack.GetRed() * (1-aTransparency/double(255))), static_cast<sal_uInt8>(aFront.GetGreen() * aTransparency/double(255) + aBack.GetGreen() * (1-aTransparency/double(255))), diff --git a/sd/source/ui/app/optsitem.cxx b/sd/source/ui/app/optsitem.cxx index a00c357f7f08..f2c2414fdb46 100644 --- a/sd/source/ui/app/optsitem.cxx +++ b/sd/source/ui/app/optsitem.cxx @@ -34,7 +34,7 @@ using namespace ::utl; using namespace ::com::sun::star::uno; -template< class T > T getSafeValue( const Any& rAny ) +template< class T > static T getSafeValue( const Any& rAny ) { T value = T(); bool bOk = (rAny >>= value); diff --git a/sd/source/ui/controller/slidelayoutcontroller.cxx b/sd/source/ui/controller/slidelayoutcontroller.cxx index 3b9510fc36c2..de4b927bb8a5 100644 --- a/sd/source/ui/controller/slidelayoutcontroller.cxx +++ b/sd/source/ui/controller/slidelayoutcontroller.cxx @@ -304,26 +304,26 @@ void LayoutToolbarMenu::SelectHdl(void const * pControl) } /// @throws css::uno::RuntimeException -OUString SlideLayoutController_getImplementationName() +static OUString SlideLayoutController_getImplementationName() { return OUString( "com.sun.star.comp.sd.SlideLayoutController" ); } /// @throws RuntimeException -Sequence< OUString > SlideLayoutController_getSupportedServiceNames() +static Sequence< OUString > SlideLayoutController_getSupportedServiceNames() { Sequence<OUString> aSNS { "com.sun.star.frame.ToolbarController" }; return aSNS; } /// @throws css::uno::RuntimeException -OUString InsertSlideController_getImplementationName() +static OUString InsertSlideController_getImplementationName() { return OUString( "com.sun.star.comp.sd.InsertSlideController" ); } /// @throws RuntimeException -Sequence< OUString > InsertSlideController_getSupportedServiceNames() +static Sequence< OUString > InsertSlideController_getSupportedServiceNames() { Sequence<OUString> aSNS { "com.sun.star.frame.ToolbarController" }; return aSNS; diff --git a/sd/source/ui/dlg/NavigatorChildWindow.cxx b/sd/source/ui/dlg/NavigatorChildWindow.cxx index 1f15efe8c0bd..2daabfb4cab2 100644 --- a/sd/source/ui/dlg/NavigatorChildWindow.cxx +++ b/sd/source/ui/dlg/NavigatorChildWindow.cxx @@ -30,7 +30,7 @@ namespace sd { SFX_IMPL_CHILDWINDOWCONTEXT(NavigatorChildWindow, SID_NAVIGATOR) -void RequestNavigatorUpdate (SfxBindings const * pBindings) +static void RequestNavigatorUpdate (SfxBindings const * pBindings) { if (pBindings != nullptr && pBindings->GetDispatcher() != nullptr) diff --git a/sd/source/ui/func/fuconrec.cxx b/sd/source/ui/func/fuconrec.cxx index 1cca1e11aa62..bc7c814d562a 100644 --- a/sd/source/ui/func/fuconrec.cxx +++ b/sd/source/ui/func/fuconrec.cxx @@ -501,7 +501,7 @@ void FuConstructRectangle::SetAttributes(SfxItemSet& rAttr, SdrObject* pObj) /** * set line starts and ends for the object to be created */ -::basegfx::B2DPolyPolygon getPolygon(const char* pResId, const SdrModel& rModel) +static ::basegfx::B2DPolyPolygon getPolygon(const char* pResId, const SdrModel& rModel) { ::basegfx::B2DPolyPolygon aRetval; XLineEndListRef pLineEndList(rModel.GetLineEndList()); diff --git a/sd/source/ui/func/fumorph.cxx b/sd/source/ui/func/fumorph.cxx index f05b6055de57..2390e16eb828 100644 --- a/sd/source/ui/func/fumorph.cxx +++ b/sd/source/ui/func/fumorph.cxx @@ -183,7 +183,7 @@ void FuMorph::DoExecute( SfxRequest& ) } } -::basegfx::B2DPolygon ImpGetExpandedPolygon( +static ::basegfx::B2DPolygon ImpGetExpandedPolygon( const ::basegfx::B2DPolygon& rCandidate, sal_uInt32 nNum ) diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx index 5376b61e6588..c5b38dba95be 100644 --- a/sd/source/ui/func/fupage.cxx +++ b/sd/source/ui/func/fupage.cxx @@ -84,7 +84,7 @@ namespace sd { #define MAXWIDTH 28350 -void mergeItemSetsImpl( SfxItemSet& rTarget, const SfxItemSet& rSource ) +static void mergeItemSetsImpl( SfxItemSet& rTarget, const SfxItemSet& rSource ) { const sal_uInt16* pPtr = rSource.GetRanges(); sal_uInt16 p1, p2; diff --git a/sd/source/ui/remotecontrol/BluetoothServer.cxx b/sd/source/ui/remotecontrol/BluetoothServer.cxx index 75896752ca1e..c3cd93d73c6a 100644 --- a/sd/source/ui/remotecontrol/BluetoothServer.cxx +++ b/sd/source/ui/remotecontrol/BluetoothServer.cxx @@ -870,13 +870,13 @@ registerWithDefaultAdapter( DBusConnection *pConnection ) return pService; } -void ProfileUnregisterFunction +static void ProfileUnregisterFunction (DBusConnection *, void *) { // We specifically don't need to do anything here. } -DBusHandlerResult ProfileMessageFunction +static DBusHandlerResult ProfileMessageFunction (DBusConnection *pConnection, DBusMessage *pMessage, void *user_data) { SAL_INFO("sdremote.bluetooth", "ProfileMessageFunction||" << dbus_message_get_interface(pMessage) << "||" << dbus_message_get_member(pMessage)); diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx index f2ae67cb306e..abe81bd05ae3 100644 --- a/sd/source/ui/slideshow/slideshow.cxx +++ b/sd/source/ui/slideshow/slideshow.cxx @@ -94,7 +94,7 @@ namespace { }; } -const SfxItemPropertyMapEntry* ImplGetPresentationPropertyMap() +static const SfxItemPropertyMapEntry* ImplGetPresentationPropertyMap() { // NOTE: First member must be sorted static const SfxItemPropertyMapEntry aPresentationPropertyMap_Impl[] = diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx index 79738a04389d..ba4237082110 100644 --- a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx @@ -665,7 +665,7 @@ void SelectionFunction::ProcessEvent (EventDescriptor& rDescriptor) pModeHandler->ProcessEvent(rDescriptor); } -bool Match ( +static bool Match ( const sal_uInt32 nEventCode, const sal_uInt32 nPositivePattern) { diff --git a/sd/source/ui/slidesorter/view/SlsTheme.cxx b/sd/source/ui/slidesorter/view/SlsTheme.cxx index b2eb097bbad5..736760e7aefb 100644 --- a/sd/source/ui/slidesorter/view/SlsTheme.cxx +++ b/sd/source/ui/slidesorter/view/SlsTheme.cxx @@ -33,7 +33,7 @@ namespace sd { namespace slidesorter { namespace view { const static Color Black = Color(0x000000); const static Color White = Color(0xffffff); -Color ChangeLuminance (Color aColor, const int nValue) +static Color ChangeLuminance (Color aColor, const int nValue) { if (nValue > 0) aColor.IncreaseLuminance(nValue); @@ -42,7 +42,7 @@ Color ChangeLuminance (Color aColor, const int nValue) return aColor; } -Color HGBAdapt ( +static Color HGBAdapt ( const Color aColor, const sal_Int32 nNewSaturation, const sal_Int32 nNewBrightness) diff --git a/sd/source/ui/table/TableDesignPane.cxx b/sd/source/ui/table/TableDesignPane.cxx index a752b7407a70..3c1a0ed4e7a5 100644 --- a/sd/source/ui/table/TableDesignPane.cxx +++ b/sd/source/ui/table/TableDesignPane.cxx @@ -576,7 +576,7 @@ static void FillCellInfoMatrix( const CellInfoVector& rStyle, const TableStyleSe } } -const BitmapEx CreateDesignPreview( const Reference< XIndexAccess >& xTableStyle, const TableStyleSettings& rSettings, bool bIsPageDark ) +static const BitmapEx CreateDesignPreview( const Reference< XIndexAccess >& xTableStyle, const TableStyleSettings& rSettings, bool bIsPageDark ) { CellInfoVector aCellInfoVector(sdr::table::style_count); FillCellInfoVector( xTableStyle, aCellInfoVector ); diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx index 6dc303791f8f..5eec0ffda4c3 100644 --- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx +++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx @@ -149,7 +149,7 @@ enum SdDocumentSettingsPropertyHandles #define MID_PRINTER 1 - rtl::Reference<PropertySetInfo> createSettingsInfoImpl( bool bIsDraw ) + static rtl::Reference<PropertySetInfo> createSettingsInfoImpl( bool bIsDraw ) { static PropertyMapEntry const aImpressSettingsInfoMap[] = { diff --git a/sd/source/ui/unoidl/unolayer.cxx b/sd/source/ui/unoidl/unolayer.cxx index a3ae65fec939..2096f4be704e 100644 --- a/sd/source/ui/unoidl/unolayer.cxx +++ b/sd/source/ui/unoidl/unolayer.cxx @@ -59,7 +59,7 @@ using namespace ::com::sun::star; #define WID_LAYER_TITLE 5 #define WID_LAYER_DESC 6 -const SvxItemPropertySet* ImplGetSdLayerPropertySet() +static const SvxItemPropertySet* ImplGetSdLayerPropertySet() { static const SfxItemPropertyMapEntry aSdLayerPropertyMap_Impl[] = { diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index c1930c454166..2ba00268001c 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -198,7 +198,7 @@ const sal_uInt16 WID_MODEL_DIALOGLIBS = 12; const sal_uInt16 WID_MODEL_FONTS = 13; const sal_uInt16 WID_MODEL_INTEROPGRABBAG = 14; -const SvxItemPropertySet* ImplGetDrawModelPropertySet() +static const SvxItemPropertySet* ImplGetDrawModelPropertySet() { // Attention: the first parameter HAS TO BE sorted!!! const static SfxItemPropertyMapEntry aDrawModelPropertyMap_Impl[] = @@ -1555,7 +1555,7 @@ ImplRenderPaintProc::ImplRenderPaintProc( const SdrLayerAdmin& rLA, SdrPageView* { } -sal_Int32 ImplPDFGetBookmarkPage( const OUString& rBookmark, SdDrawDocument const & rDoc ) +static sal_Int32 ImplPDFGetBookmarkPage( const OUString& rBookmark, SdDrawDocument const & rDoc ) { sal_Int32 nPage = -1; @@ -1581,7 +1581,7 @@ sal_Int32 ImplPDFGetBookmarkPage( const OUString& rBookmark, SdDrawDocument cons return nPage; } -void ImplPDFExportComments( const uno::Reference< drawing::XDrawPage >& xPage, vcl::PDFExtOutDevData& rPDFExtOutDevData ) +static void ImplPDFExportComments( const uno::Reference< drawing::XDrawPage >& xPage, vcl::PDFExtOutDevData& rPDFExtOutDevData ) { try { @@ -1618,7 +1618,7 @@ void ImplPDFExportComments( const uno::Reference< drawing::XDrawPage >& xPage, v } } -void ImplPDFExportShapeInteraction( const uno::Reference< drawing::XShape >& xShape, SdDrawDocument& rDoc, vcl::PDFExtOutDevData& rPDFExtOutDevData ) +static void ImplPDFExportShapeInteraction( const uno::Reference< drawing::XShape >& xShape, SdDrawDocument& rDoc, vcl::PDFExtOutDevData& rPDFExtOutDevData ) { if ( xShape->getShapeType() == "com.sun.star.drawing.GroupShape" ) { diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index f3641695697e..95aec6b9b17e 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -99,7 +99,7 @@ enum WID_PAGE static sal_Char const sEmptyPageName[sizeof("page")] = "page"; // this function stores the property maps for draw pages in impress and draw -const SvxItemPropertySet* ImplGetDrawPagePropertySet( bool bImpress, PageKind ePageKind ) +static const SvxItemPropertySet* ImplGetDrawPagePropertySet( bool bImpress, PageKind ePageKind ) { static const SfxItemPropertyMapEntry aDrawPagePropertyMap_Impl[] = { @@ -255,7 +255,7 @@ const SvxItemPropertySet* ImplGetDrawPagePropertySet( bool bImpress, PageKind eP } /** this function stores the property map for master pages in impress and draw */ -const SvxItemPropertySet* ImplGetMasterPagePropertySet( PageKind ePageKind ) +static const SvxItemPropertySet* ImplGetMasterPagePropertySet( PageKind ePageKind ) { static const SfxItemPropertyMapEntry aMasterPagePropertyMap_Impl[] = { diff --git a/sd/source/ui/unoidl/unopool.cxx b/sd/source/ui/unoidl/unopool.cxx index 33573b3bea49..6b91088aeab2 100644 --- a/sd/source/ui/unoidl/unopool.cxx +++ b/sd/source/ui/unoidl/unopool.cxx @@ -29,7 +29,7 @@ using namespace ::com::sun::star; using namespace ::cppu; using namespace ::comphelper; -LanguageType SdUnoGetLanguage( const lang::Locale& rLocale ) +static LanguageType SdUnoGetLanguage( const lang::Locale& rLocale ) { // empty language -> LANGUAGE_SYSTEM if ( rLocale.Language.getLength() == 0 ) diff --git a/sd/source/ui/unoidl/unosrch.cxx b/sd/source/ui/unoidl/unosrch.cxx index 7233d37d3b77..d4c65435fd1a 100644 --- a/sd/source/ui/unoidl/unosrch.cxx +++ b/sd/source/ui/unoidl/unosrch.cxx @@ -37,7 +37,7 @@ using namespace ::com::sun::star; #define WID_SEARCH_CASE 1 #define WID_SEARCH_WORDS 2 -const SfxItemPropertyMapEntry* ImplGetSearchPropertyMap() +static const SfxItemPropertyMapEntry* ImplGetSearchPropertyMap() { static const SfxItemPropertyMapEntry aSearchPropertyMap_Impl[] = { diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index ce0d879415c8..2ed053c37beb 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -111,7 +111,7 @@ using namespace ::com::sun::star::linguistic2; current clipboard content and the DrawViewShell. The list is stored in a new instance of SvxClipboardFormatItem. */ -::std::unique_ptr<SvxClipboardFormatItem> GetSupportedClipboardFormats ( +static ::std::unique_ptr<SvxClipboardFormatItem> GetSupportedClipboardFormats ( TransferableDataHelper& rDataHelper) { ::std::unique_ptr<SvxClipboardFormatItem> pResult ( diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index 6245206d2c0a..fbd489a74c98 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -105,7 +105,7 @@ namespace sd { // Permanent Functions -void ImpAddPrintableCharactersToTextEdit(SfxRequest const & rReq, ::sd::View* pView) +static void ImpAddPrintableCharactersToTextEdit(SfxRequest const & rReq, ::sd::View* pView) { // evtl. feed characters to activated textedit const SfxItemSet* pSet = rReq.GetArgs(); diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index 1245065e6814..1506542b30c8 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -104,7 +104,7 @@ struct ImpRememberOrigAndClone SdrObject* pClone; }; -SdrObject* ImpGetClone(std::vector<ImpRememberOrigAndClone*>& aConnectorContainer, SdrObject const * pConnObj) +static SdrObject* ImpGetClone(std::vector<ImpRememberOrigAndClone*>& aConnectorContainer, SdrObject const * pConnObj) { for(ImpRememberOrigAndClone* p : aConnectorContainer) { @@ -115,7 +115,7 @@ SdrObject* ImpGetClone(std::vector<ImpRememberOrigAndClone*>& aConnectorContaine } // restrict movement to WorkArea -void ImpCheckInsertPos(Point& rPos, const Size& rSize, const ::tools::Rectangle& rWorkArea) +static void ImpCheckInsertPos(Point& rPos, const Size& rSize, const ::tools::Rectangle& rWorkArea) { if(!rWorkArea.IsEmpty()) { diff --git a/sdext/source/minimizer/graphiccollector.cxx b/sdext/source/minimizer/graphiccollector.cxx index 2e8c129082f9..26ae7fca3555 100644 --- a/sdext/source/minimizer/graphiccollector.cxx +++ b/sdext/source/minimizer/graphiccollector.cxx @@ -58,7 +58,7 @@ const DeviceInfo& GraphicCollector::GetDeviceInfo( const Reference< XComponentCo return aDeviceInfo; } -void ImpAddEntity( std::vector< GraphicCollector::GraphicEntity >& rGraphicEntities, const GraphicSettings& rGraphicSettings, const GraphicCollector::GraphicUser& rUser ) +static void ImpAddEntity( std::vector< GraphicCollector::GraphicEntity >& rGraphicEntities, const GraphicSettings& rGraphicSettings, const GraphicCollector::GraphicUser& rUser ) { if ( rGraphicSettings.mbEmbedLinkedGraphics ) { @@ -84,7 +84,7 @@ void ImpAddEntity( std::vector< GraphicCollector::GraphicEntity >& rGraphicEntit } } -void ImpAddGraphicEntity( const Reference< XComponentContext >& rxMSF, Reference< XShape > const & rxShape, const GraphicSettings& rGraphicSettings, std::vector< GraphicCollector::GraphicEntity >& rGraphicEntities ) +static void ImpAddGraphicEntity( const Reference< XComponentContext >& rxMSF, Reference< XShape > const & rxShape, const GraphicSettings& rGraphicSettings, std::vector< GraphicCollector::GraphicEntity >& rGraphicEntities ) { Reference< XGraphic > xGraphic; Reference< XPropertySet > xShapePropertySet( rxShape, UNO_QUERY_THROW ); @@ -121,7 +121,7 @@ void ImpAddGraphicEntity( const Reference< XComponentContext >& rxMSF, Reference } } -void ImpAddFillBitmapEntity( const Reference< XComponentContext >& rxMSF, const Reference< XPropertySet >& rxPropertySet, const awt::Size& rLogicalSize, +static void ImpAddFillBitmapEntity( const Reference< XComponentContext >& rxMSF, const Reference< XPropertySet >& rxPropertySet, const awt::Size& rLogicalSize, std::vector< GraphicCollector::GraphicEntity >& rGraphicEntities, const GraphicSettings& rGraphicSettings, const Reference< XPropertySet >& rxPagePropertySet ) { try @@ -189,7 +189,7 @@ void ImpAddFillBitmapEntity( const Reference< XComponentContext >& rxMSF, const } } -void ImpCollectBackgroundGraphic( const Reference< XComponentContext >& rxMSF, const Reference< XDrawPage >& rxDrawPage, const GraphicSettings& rGraphicSettings, std::vector< GraphicCollector::GraphicEntity >& rGraphicEntities ) +static void ImpCollectBackgroundGraphic( const Reference< XComponentContext >& rxMSF, const Reference< XDrawPage >& rxDrawPage, const GraphicSettings& rGraphicSettings, std::vector< GraphicCollector::GraphicEntity >& rGraphicEntities ) { try { @@ -207,7 +207,7 @@ void ImpCollectBackgroundGraphic( const Reference< XComponentContext >& rxMSF, c } } -void ImpCollectGraphicObjects( const Reference< XComponentContext >& rxMSF, const Reference< XShapes >& rxShapes, const GraphicSettings& rGraphicSettings, std::vector< GraphicCollector::GraphicEntity >& rGraphicEntities ) +static void ImpCollectGraphicObjects( const Reference< XComponentContext >& rxMSF, const Reference< XShapes >& rxShapes, const GraphicSettings& rGraphicSettings, std::vector< GraphicCollector::GraphicEntity >& rGraphicEntities ) { for ( sal_Int32 i = 0; i < rxShapes->getCount(); i++ ) { @@ -327,7 +327,7 @@ void GraphicCollector::CollectGraphics( const Reference< XComponentContext >& rx } } -void ImpCountGraphicObjects( const Reference< XComponentContext >& rxMSF, const Reference< XShapes >& rxShapes, const GraphicSettings& rGraphicSettings, sal_Int32& rnGraphics ) +static void ImpCountGraphicObjects( const Reference< XComponentContext >& rxMSF, const Reference< XShapes >& rxShapes, const GraphicSettings& rGraphicSettings, sal_Int32& rnGraphics ) { for ( sal_Int32 i = 0; i < rxShapes->getCount(); i++ ) { @@ -364,7 +364,7 @@ void ImpCountGraphicObjects( const Reference< XComponentContext >& rxMSF, const } } -void ImpCountBackgroundGraphic( +static void ImpCountBackgroundGraphic( const Reference< XDrawPage >& rxDrawPage, sal_Int32& rnGraphics ) { try diff --git a/sdext/source/minimizer/impoptimizer.cxx b/sdext/source/minimizer/impoptimizer.cxx index a04cf0f93ebc..15de3f86a8ab 100644 --- a/sdext/source/minimizer/impoptimizer.cxx +++ b/sdext/source/minimizer/impoptimizer.cxx @@ -73,7 +73,7 @@ using namespace ::com::sun::star::document; using namespace ::com::sun::star::container; using namespace ::com::sun::star::presentation; -void ImpExtractCustomShow( const Reference< XModel >& rxModel, const OUString& rCustomShowName ) +static void ImpExtractCustomShow( const Reference< XModel >& rxModel, const OUString& rCustomShowName ) { vector< Reference< XDrawPage > > vNonUsedPageList; try @@ -91,7 +91,7 @@ void ImpExtractCustomShow( const Reference< XModel >& rxModel, const OUString& r } } -void ImpDeleteUnusedMasterPages( const Reference< XModel >& rxModel ) +static void ImpDeleteUnusedMasterPages( const Reference< XModel >& rxModel ) { vector< PageCollector::MasterPageEntity > aMasterPageList; PageCollector::CollectMasterPages( rxModel, aMasterPageList ); @@ -108,7 +108,7 @@ void ImpDeleteUnusedMasterPages( const Reference< XModel >& rxModel ) } } -void ImpDeleteHiddenSlides( const Reference< XModel >& rxModel ) +static void ImpDeleteHiddenSlides( const Reference< XModel >& rxModel ) { try { @@ -135,7 +135,7 @@ void ImpDeleteHiddenSlides( const Reference< XModel >& rxModel ) } } -void ImpDeleteNotesPages( const Reference< XModel >& rxModel ) +static void ImpDeleteNotesPages( const Reference< XModel >& rxModel ) { try { @@ -158,7 +158,7 @@ void ImpDeleteNotesPages( const Reference< XModel >& rxModel ) } } -void ImpConvertOLE( const Reference< XModel >& rxModel, sal_Int32 nOLEOptimizationType ) +static void ImpConvertOLE( const Reference< XModel >& rxModel, sal_Int32 nOLEOptimizationType ) { try { @@ -206,7 +206,7 @@ void ImpConvertOLE( const Reference< XModel >& rxModel, sal_Int32 nOLEOptimizati } } -void ImpCompressGraphic( Reference< XGraphicProvider > const & rxGraphicProvider, const Reference< XGraphic >& rxGraphic, Reference< XOutputStream > const & rxOutputStream, +static void ImpCompressGraphic( Reference< XGraphicProvider > const & rxGraphicProvider, const Reference< XGraphic >& rxGraphic, Reference< XOutputStream > const & rxOutputStream, const OUString& rDestMimeType, const awt::Size& rLogicalSize, sal_Int32 nJPEGQuality, sal_Int32 nImageResolution, bool bRemoveCropping, const text::GraphicCrop& rGraphicCropLogic ) { try @@ -247,7 +247,7 @@ void ImpCompressGraphic( Reference< XGraphicProvider > const & rxGraphicProvider } } -Reference< XGraphic > ImpCompressGraphic( const Reference< XComponentContext >& rxContext, +static Reference< XGraphic > ImpCompressGraphic( const Reference< XComponentContext >& rxContext, const Reference< XGraphic >& xGraphic, const awt::Size& aLogicalSize, const text::GraphicCrop& aGraphicCropLogic, const GraphicSettings& rGraphicSettings ) { @@ -371,7 +371,7 @@ Reference< XGraphic > ImpCompressGraphic( const Reference< XComponentContext >& return xNewGraphic; } -void CompressGraphics( ImpOptimizer& rOptimizer, const Reference< XComponentContext >& rxContext, const GraphicSettings& rGraphicSettings, +static void CompressGraphics( ImpOptimizer& rOptimizer, const Reference< XComponentContext >& rxContext, const GraphicSettings& rGraphicSettings, std::vector< GraphicCollector::GraphicEntity >& rGraphicList ) { try diff --git a/sdext/source/minimizer/optimizerdialogcontrols.cxx b/sdext/source/minimizer/optimizerdialogcontrols.cxx index fdb56af5464e..987557920c58 100644 --- a/sdext/source/minimizer/optimizerdialogcontrols.cxx +++ b/sdext/source/minimizer/optimizerdialogcontrols.cxx @@ -44,7 +44,7 @@ using namespace ::com::sun::star::container; using namespace ::com::sun::star::presentation; -void SetBold( OptimizerDialog& rOptimizerDialog, const OUString& rControl ) +static void SetBold( OptimizerDialog& rOptimizerDialog, const OUString& rControl ) { FontDescriptor aFontDescriptor; if ( rOptimizerDialog.getControlProperty( rControl, "FontDescriptor" ) >>= aFontDescriptor ) @@ -55,7 +55,7 @@ void SetBold( OptimizerDialog& rOptimizerDialog, const OUString& rControl ) } -OUString InsertSeparator( OptimizerDialog& rOptimizerDialog, const OUString& rControlName, sal_Int32 nOrientation, +static OUString InsertSeparator( OptimizerDialog& rOptimizerDialog, const OUString& rControlName, sal_Int32 nOrientation, sal_Int32 nPosX, sal_Int32 nPosY, sal_Int32 nWidth, sal_Int32 nHeight ) { OUString pNames[] = { @@ -85,7 +85,7 @@ OUString InsertSeparator( OptimizerDialog& rOptimizerDialog, const OUString& rCo } -OUString InsertButton( OptimizerDialog& rOptimizerDialog, const OUString& rControlName, Reference< XActionListener > const & xActionListener, +static OUString InsertButton( OptimizerDialog& rOptimizerDialog, const OUString& rControlName, Reference< XActionListener > const & xActionListener, sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int16 nTabIndex, bool bEnabled, PPPOptimizerTokenEnum nResID, css::awt::PushButtonType nPushButtonType ) { sal_Int32 nHeight = BUTTON_HEIGHT; @@ -122,7 +122,7 @@ OUString InsertButton( OptimizerDialog& rOptimizerDialog, const OUString& rContr } -OUString InsertFixedText( OptimizerDialog& rOptimizerDialog, const OUString& rControlName, const OUString& rLabel, +static OUString InsertFixedText( OptimizerDialog& rOptimizerDialog, const OUString& rControlName, const OUString& rLabel, sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int32 nHeight, bool bMultiLine, bool bBold, sal_Int16 nTabIndex ) { OUString pNames[] = { @@ -157,7 +157,7 @@ OUString InsertFixedText( OptimizerDialog& rOptimizerDialog, const OUString& rCo } -OUString InsertCheckBox( OptimizerDialog& rOptimizerDialog, const OUString& rControlName, +static OUString InsertCheckBox( OptimizerDialog& rOptimizerDialog, const OUString& rControlName, const Reference< XItemListener >& xItemListener, const OUString& rLabel, sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int16 nTabIndex ) { @@ -194,7 +194,7 @@ OUString InsertCheckBox( OptimizerDialog& rOptimizerDialog, const OUString& rCon } -OUString InsertFormattedField( OptimizerDialog& rOptimizerDialog, const OUString& rControlName, +static OUString InsertFormattedField( OptimizerDialog& rOptimizerDialog, const OUString& rControlName, const Reference< XTextListener >& xTextListener, const Reference< XSpinListener >& xSpinListener, sal_Int32 nXPos, sal_Int32 nYPos, double fEffectiveMin, double fEffectiveMax, sal_Int16 nTabIndex ) { @@ -242,7 +242,7 @@ OUString InsertFormattedField( OptimizerDialog& rOptimizerDialog, const OUString } -OUString InsertComboBox( OptimizerDialog& rOptimizerDialog, const OUString& rControlName, +static OUString InsertComboBox( OptimizerDialog& rOptimizerDialog, const OUString& rControlName, const Reference< XTextListener >& rTextListener, const bool bEnabled, const Sequence< OUString >& rItemList, sal_Int32 nXPos, sal_Int32 nYPos, sal_Int16 nTabIndex ) { @@ -284,7 +284,7 @@ OUString InsertComboBox( OptimizerDialog& rOptimizerDialog, const OUString& rCon } -OUString InsertRadioButton( OptimizerDialog& rOptimizerDialog, const OUString& rControlName, const Reference< XItemListener >& rItemListener, +static OUString InsertRadioButton( OptimizerDialog& rOptimizerDialog, const OUString& rControlName, const Reference< XItemListener >& rItemListener, const OUString& rLabel, sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int16 nTabIndex ) { sal_Int32 nHeight = 8; @@ -320,7 +320,7 @@ OUString InsertRadioButton( OptimizerDialog& rOptimizerDialog, const OUString& r } -OUString InsertListBox( OptimizerDialog& rOptimizerDialog, const OUString& rControlName, +static OUString InsertListBox( OptimizerDialog& rOptimizerDialog, const OUString& rControlName, const Reference< XActionListener >& rActionListener, const bool bEnabled, const Sequence< OUString >& rItemList, sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int16 nTabIndex ) { diff --git a/sdext/source/pdfimport/test/pdfunzip.cxx b/sdext/source/pdfimport/test/pdfunzip.cxx index 2ccbffb5dcb3..3e5a452dee13 100644 --- a/sdext/source/pdfimport/test/pdfunzip.cxx +++ b/sdext/source/pdfimport/test/pdfunzip.cxx @@ -31,7 +31,7 @@ using namespace pdfparse; -void printHelp( const char* pExe ) +static void printHelp( const char* pExe ) { fprintf( stdout, "USAGE: %s [-h,--help]\n" @@ -212,7 +212,7 @@ unsigned int FileEmitContext::readOrigBytes( unsigned int nOrigOffset, unsigned typedef int(*PDFFileHdl)(const char*, const char*, PDFFile*); -int handleFile( const char* pInFile, const char* pOutFile, const char* pPassword, PDFFileHdl pHdl ) +static int handleFile( const char* pInFile, const char* pOutFile, const char* pPassword, PDFFileHdl pHdl ) { PDFReader aParser; @@ -236,7 +236,7 @@ int handleFile( const char* pInFile, const char* pOutFile, const char* pPassword return nRet; } -int write_unzipFile( const char* pInFile, const char* pOutFile, PDFFile* pPDFFile ) +static int write_unzipFile( const char* pInFile, const char* pOutFile, PDFFile* pPDFFile ) { FileEmitContext aContext( pOutFile, pInFile, pPDFFile ); aContext.m_bDecrypt = pPDFFile->isEncrypted(); @@ -244,7 +244,7 @@ int write_unzipFile( const char* pInFile, const char* pOutFile, PDFFile* pPDFFil return 0; } -int write_addStreamArray( const char* pOutFile, PDFArray* pStreams, PDFFile* pPDFFile, const char* pInFile ) +static int write_addStreamArray( const char* pOutFile, PDFArray* pStreams, PDFFile* pPDFFile, const char* pInFile ) { int nRet = 0; unsigned int nArrayElements = pStreams->m_aSubElements.size(); @@ -285,7 +285,7 @@ int write_addStreamArray( const char* pOutFile, PDFArray* pStreams, PDFFile* pPD return nRet; } -int write_addStreams( const char* pInFile, const char* pOutFile, PDFFile* pPDFFile ) +static int write_addStreams( const char* pInFile, const char* pOutFile, PDFFile* pPDFFile ) { // find all trailers int nRet = 0; @@ -309,7 +309,7 @@ int write_addStreams( const char* pInFile, const char* pOutFile, PDFFile* pPDFFi return nRet; } -int write_fonts( const char* i_pInFile, const char* i_pOutFile, PDFFile* i_pPDFFile ) +static int write_fonts( const char* i_pInFile, const char* i_pOutFile, PDFFile* i_pPDFFile ) { int nRet = 0; unsigned int nElements = i_pPDFFile->m_aSubElements.size(); @@ -395,7 +395,7 @@ int write_fonts( const char* i_pInFile, const char* i_pOutFile, PDFFile* i_pPDFF static std::vector< std::pair< sal_Int32, sal_Int32 > > s_aEmitObjects; -int write_objects( const char* i_pInFile, const char* i_pOutFile, PDFFile* i_pPDFFile ) +static int write_objects( const char* i_pInFile, const char* i_pOutFile, PDFFile* i_pPDFFile ) { int nRet = 0; unsigned int nElements = s_aEmitObjects.size(); diff --git a/sdext/source/pdfimport/tree/drawtreevisiting.cxx b/sdext/source/pdfimport/tree/drawtreevisiting.cxx index b0d51c5cc2b8..d587ac97903e 100644 --- a/sdext/source/pdfimport/tree/drawtreevisiting.cxx +++ b/sdext/source/pdfimport/tree/drawtreevisiting.cxx @@ -648,7 +648,7 @@ void DrawXmlOptimizer::visit( PageElement& elem, const std::list< std::unique_pt elem.applyToChildren(*this); } -bool isSpaces(TextElement* pTextElem) +static bool isSpaces(TextElement* pTextElem) { for (sal_Int32 i = 0; i != pTextElem->Text.getLength(); ++i) { if (pTextElem->Text[i] != ' ') { @@ -658,7 +658,7 @@ bool isSpaces(TextElement* pTextElem) return true; } -bool notTransformed(const GraphicsContext& GC) +static bool notTransformed(const GraphicsContext& GC) { return rtl::math::approxEqual(GC.Transformation.get(0,0), 100.00) && @@ -822,7 +822,7 @@ void DrawXmlFinalizer::visit( HyperlinkElement&, const std::list< std::unique_pt { } -void SetFontsizeProperties(PropertyMap& props, double fontSize) +static void SetFontsizeProperties(PropertyMap& props, double fontSize) { OUStringBuffer aBuf(32); aBuf.append(fontSize * 72 / PDFI_OUTDEV_RESOLUTION); diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx index 06e4faead383..942a5d60cc9f 100644 --- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx +++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx @@ -67,7 +67,7 @@ namespace pdfi { /// cut off very small numbers & clamp value to zero -inline double normalize( double val ) +static inline double normalize( double val ) { return fabs(val) < 0.0000001 ? 0.0 : val; } @@ -118,12 +118,12 @@ std::vector<char> lcl_escapeLineFeeds(const char* const i_pStr) /// for the initial std::vector capacity when copying stream from xpdf #define WRITE_BUFFER_INITIAL_CAPACITY (1024*100) -void initBuf(OutputBuffer& io_rBuffer) +static void initBuf(OutputBuffer& io_rBuffer) { io_rBuffer.reserve(WRITE_BUFFER_INITIAL_CAPACITY); } -void writeBinaryBuffer( const OutputBuffer& rBuffer ) +static void writeBinaryBuffer( const OutputBuffer& rBuffer ) { // ---sync point--- see SYNC STREAMS above fflush(stdout); @@ -138,7 +138,7 @@ void writeBinaryBuffer( const OutputBuffer& rBuffer ) fflush(g_binary_out); } -bool ExtractJpegData(Stream* str, OutputBuffer& outBuf) +static bool ExtractJpegData(Stream* str, OutputBuffer& outBuf) { int bytesToMarker = 0; int bytesToLen = -1; @@ -204,7 +204,7 @@ bool ExtractJpegData(Stream* str, OutputBuffer& outBuf) } } -void writeJpeg_( OutputBuffer& o_rOutputBuf, Stream* str ) +static void writeJpeg_( OutputBuffer& o_rOutputBuf, Stream* str ) { // dump JPEG file as-is #if POPPLER_CHECK_VERSION(0, 17, 3) @@ -223,7 +223,7 @@ void writeJpeg_( OutputBuffer& o_rOutputBuf, Stream* str ) str->close(); } -void writePbm_(OutputBuffer& o_rOutputBuf, Stream* str, int width, int height, bool bInvert ) +static void writePbm_(OutputBuffer& o_rOutputBuf, Stream* str, int width, int height, bool bInvert ) { // write as PBM (char by char, to avoid stdlib lineend messing) o_rOutputBuf.clear(); @@ -265,7 +265,7 @@ void writePbm_(OutputBuffer& o_rOutputBuf, Stream* str, int width, int height, b str->close(); } -void writePpm_( OutputBuffer& o_rOutputBuf, +static void writePpm_( OutputBuffer& o_rOutputBuf, Stream* str, int width, int height, @@ -323,7 +323,7 @@ void writePpm_( OutputBuffer& o_rOutputBuf, } // call this only for 1 bit image streams ! -void writePng_( OutputBuffer& o_rOutputBuf, +static void writePng_( OutputBuffer& o_rOutputBuf, Stream* str, int width, int height, @@ -340,7 +340,7 @@ void writePng_( OutputBuffer& o_rOutputBuf, printf("\n"); } -void writePng_( OutputBuffer& o_rOutputBuf, +static void writePng_( OutputBuffer& o_rOutputBuf, Stream* str, int width, int height, GfxImageColorMap* colorMap, Stream* maskStr, @@ -355,7 +355,7 @@ void writePng_( OutputBuffer& o_rOutputBuf, printf("\n"); } -void writePng_( OutputBuffer& o_rOutputBuf, +static void writePng_( OutputBuffer& o_rOutputBuf, Stream* str, int width, int height, GfxImageColorMap* colorMap, Stream* maskStr, @@ -371,7 +371,7 @@ void writePng_( OutputBuffer& o_rOutputBuf, } // stolen from ImageOutputDev.cc -void writeMask_( OutputBuffer& o_rOutputBuf, Stream* str, int width, int height, bool bInvert ) +static void writeMask_( OutputBuffer& o_rOutputBuf, Stream* str, int width, int height, bool bInvert ) { if( str->getKind() == strDCT ) writeJpeg_(o_rOutputBuf, str); @@ -379,7 +379,7 @@ void writeMask_( OutputBuffer& o_rOutputBuf, Stream* str, int width, int height, writePbm_(o_rOutputBuf, str, width, height, bInvert ); } -void writeImage_( OutputBuffer& o_rOutputBuf, +static void writeImage_( OutputBuffer& o_rOutputBuf, Stream* str, int width, int height, @@ -415,12 +415,12 @@ void writeImage_( OutputBuffer& o_rOutputBuf, // forwarders -inline void writeImageLF( OutputBuffer& o_rOutputBuf, +static inline void writeImageLF( OutputBuffer& o_rOutputBuf, Stream* str, int width, int height, GfxImageColorMap* colorMap ) { writeImage_(o_rOutputBuf,str,width,height,colorMap); } -inline void writeMaskLF( OutputBuffer& o_rOutputBuf, +static inline void writeMaskLF( OutputBuffer& o_rOutputBuf, Stream* str, int width, int height, diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx index c2a91d51283d..5cc4ce4edf16 100644 --- a/sfx2/source/appl/appinit.cxx +++ b/sfx2/source/appl/appinit.cxx @@ -158,7 +158,7 @@ extern "C" bool GetSpecialCharsForEdit( vcl::Window const * i_pParent, const vcl #endif -OUString SfxGetSpecialCharsForEdit(vcl::Window* pParent, const vcl::Font& rFont) +static OUString SfxGetSpecialCharsForEdit(vcl::Window* pParent, const vcl::Font& rFont) { static bool bDetermineFunction = false; static PFunc_getSpecialCharsForEdit pfunc_getSpecialCharsForEdit = nullptr; diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 3b7c6fe3549d..fb111b64a935 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -1225,7 +1225,7 @@ extern "C" rtl_uString* basicide_choose_macro(void*, void*, sal_Bool); #endif -OUString ChooseMacro( const Reference< XModel >& rxLimitToDocument, const Reference< XFrame >& xDocFrame, bool bChooseOnly ) +static OUString ChooseMacro( const Reference< XModel >& rxLimitToDocument, const Reference< XFrame >& xDocFrame, bool bChooseOnly ) { #ifndef DISABLE_DYNLOADING osl::Module aMod; diff --git a/sfx2/source/appl/fileobj.cxx b/sfx2/source/appl/fileobj.cxx index 239614444688..7032dce1e1bc 100644 --- a/sfx2/source/appl/fileobj.cxx +++ b/sfx2/source/appl/fileobj.cxx @@ -201,7 +201,7 @@ bool SvFileObject::LoadFile_Impl() If the URL doesn't denote a valid (existent and accessible) file, the request is silently dropped. */ -OUString impl_getFilter( const OUString& _rURL ) +static OUString impl_getFilter( const OUString& _rURL ) { OUString sFilter; if ( _rURL.isEmpty() ) diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx index b503e06f0cf6..059dcb22a48b 100644 --- a/sfx2/source/appl/linkmgr2.cxx +++ b/sfx2/source/appl/linkmgr2.cxx @@ -556,7 +556,7 @@ bool LinkManager::GetGraphicFromAny(const OUString& rMimeType, return bRet; } -OUString lcl_DDE_RelToAbs( const OUString& rTopic, const OUString& rBaseURL ) +static OUString lcl_DDE_RelToAbs( const OUString& rTopic, const OUString& rBaseURL ) { OUString sRet; INetURLObject aURL( rTopic ); diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index f72a03149d32..f2a28bb418ed 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -196,7 +196,7 @@ namespace sfx2 "text*" | "text*" | "text" "text menu" | "text* menu*" | "text|menu" */ - OUString PrepareSearchString( const OUString& rSearchString, + static OUString PrepareSearchString( const OUString& rSearchString, const Reference< XBreakIterator >& xBreak, bool bForSearch ) { OUStringBuffer sSearchStr; @@ -1114,7 +1114,7 @@ bool SearchTabPage_Impl::OpenKeyword( const OUString& rKeyword ) // class BookmarksTabPage_Impl ------------------------------------------- -void GetBookmarkEntry_Impl +static void GetBookmarkEntry_Impl ( Sequence< PropertyValue >& aBookmarkEntry, OUString& rTitle, diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx index 9f17de32c1a1..8de81b856815 100644 --- a/sfx2/source/appl/opengrf.cxx +++ b/sfx2/source/appl/opengrf.cxx @@ -54,7 +54,7 @@ using namespace ::com::sun::star::ui::dialogs; using namespace ::com::sun::star::uno; using namespace ::cppu; -const char* SvxOpenGrfErr2ResId( ErrCode err ) +static const char* SvxOpenGrfErr2ResId( ErrCode err ) { if (err == ERRCODE_GRFILTER_OPENERROR) return RID_SVXSTR_GRFILTER_OPENERROR; diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 8092367eafce..956c600de6d9 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -294,7 +294,7 @@ void AppendConfigToken( OUStringBuffer& rURL, bool bQuestionMark ) rURL.append(utl::ConfigManager::getProductVersion()); } -bool GetHelpAnchor_Impl( const OUString& _rURL, OUString& _rAnchor ) +static bool GetHelpAnchor_Impl( const OUString& _rURL, OUString& _rAnchor ) { bool bRet = false; OUString sAnchor; @@ -359,7 +359,7 @@ SfxHelp::~SfxHelp() { } -OUString getDefaultModule_Impl() +static OUString getDefaultModule_Impl() { OUString sDefaultModule; SvtModuleOptions aModOpt; @@ -386,7 +386,7 @@ OUString getDefaultModule_Impl() return sDefaultModule; } -OUString getCurrentModuleIdentifier_Impl() +static OUString getCurrentModuleIdentifier_Impl() { OUString sIdentifier; Reference < XComponentContext > xContext = ::comphelper::getProcessComponentContext(); @@ -539,7 +539,7 @@ OUString SfxHelp::CreateHelpURL_Impl( const OUString& aCommandURL, const OUStrin return aHelpURL.makeStringAndClear(); } -SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame2 >& rHelpTask , +static SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame2 >& rHelpTask , Reference< XFrame >& rHelpContent) { Reference < XDesktop2 > xDesktop = Desktop::create( ::comphelper::getProcessComponentContext() ); diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx index af5d0cdb4bbf..b6906eea72ad 100644 --- a/sfx2/source/appl/workwin.cxx +++ b/sfx2/source/appl/workwin.cxx @@ -338,7 +338,7 @@ static OUString GetResourceURLFromToolbarId(ToolbarId eId) return theFilledToolBarResIdToResourceURLMap::get().findURL(eId); } -bool IsAppWorkWinToolbox_Impl( sal_uInt16 nPos ) +static bool IsAppWorkWinToolbox_Impl( sal_uInt16 nPos ) { switch ( nPos ) { @@ -351,7 +351,7 @@ bool IsAppWorkWinToolbox_Impl( sal_uInt16 nPos ) } } -sal_uInt16 TbxMatch( sal_uInt16 nPos ) +static sal_uInt16 TbxMatch( sal_uInt16 nPos ) { switch ( nPos ) { @@ -374,7 +374,7 @@ sal_uInt16 TbxMatch( sal_uInt16 nPos ) } } -sal_uInt16 ChildAlignValue(SfxChildAlignment eAlign) +static sal_uInt16 ChildAlignValue(SfxChildAlignment eAlign) { sal_uInt16 ret = 17; diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx index bc005a0da152..5a67eb969795 100644 --- a/sfx2/source/bastyp/fltfnc.cxx +++ b/sfx2/source/bastyp/fltfnc.cxx @@ -119,7 +119,7 @@ static void CreateFilterArr() theSfxFilterListener::get(); } -inline OUString ToUpper_Impl( const OUString &rStr ) +static inline OUString ToUpper_Impl( const OUString &rStr ) { return SvtSysLocale().GetCharClass().uppercase( rStr ); } @@ -859,7 +859,7 @@ std::shared_ptr<const SfxFilter> SfxFilterMatcherIter::Next() helper to build own formatted string from given stringlist by using given separator ---------------------------------------------------------------*/ -OUString implc_convertStringlistToString( const uno::Sequence< OUString >& lList , +static OUString implc_convertStringlistToString( const uno::Sequence< OUString >& lList , sal_Unicode cSeparator, const OUString& sPrefix ) { diff --git a/sfx2/source/config/evntconf.cxx b/sfx2/source/config/evntconf.cxx index 72fa2f92652f..211b6fd1a774 100644 --- a/sfx2/source/config/evntconf.cxx +++ b/sfx2/source/config/evntconf.cxx @@ -116,7 +116,7 @@ void SfxEventNamesItem::AddEvent( const OUString& rName, const OUString& rUIName } -uno::Any CreateEventData_Impl( const SvxMacro *pMacro ) +static uno::Any CreateEventData_Impl( const SvxMacro *pMacro ) { /* This function converts a SvxMacro into an Any containing three @@ -189,7 +189,7 @@ uno::Any CreateEventData_Impl( const SvxMacro *pMacro ) } -void PropagateEvent_Impl( SfxObjectShell const *pDoc, const OUString& aEventName, const SvxMacro* pMacro ) +static void PropagateEvent_Impl( SfxObjectShell const *pDoc, const OUString& aEventName, const SvxMacro* pMacro ) { uno::Reference < document::XEventsSupplier > xSupplier; if ( pDoc ) diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index efe847cd4a1d..edbb2d2f9387 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -879,7 +879,7 @@ void SfxDispatcher::Execute_(SfxShell& rShell, const SfxSlot& rSlot, /** Helper function to put from rItem below the Which-ID in the pool of the Item Sets rSet. */ -void MappedPut_Impl(SfxAllItemSet &rSet, const SfxPoolItem &rItem) +static void MappedPut_Impl(SfxAllItemSet &rSet, const SfxPoolItem &rItem) { // Put with mapped Which-Id if possible const SfxItemPool *pPool = rSet.GetPool(); @@ -1614,11 +1614,15 @@ void SfxDispatcher::SetSlotFilter(SfxSlotFilterState nEnable, GetBindings()->InvalidateAll(true); } -extern "C" int SfxCompareSIDs_Impl(const void* pSmaller, const void* pBigger) +extern "C" { + +static int SfxCompareSIDs_Impl(const void* pSmaller, const void* pBigger) { return static_cast<long>(*static_cast<sal_uInt16 const *>(pSmaller)) - static_cast<long>(*static_cast<sal_uInt16 const *>(pBigger)); } +} + /** Searches for 'nSID' in the Filter set by <SetSlotFilter()> and returns sal_True, if the SIDis allowed, or sal_False, if it is disabled by the Filter. diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx index 2d8b9b0a707d..c7a7731ba5c7 100644 --- a/sfx2/source/control/shell.cxx +++ b/sfx2/source/control/shell.cxx @@ -401,7 +401,7 @@ bool SfxShell::IsConditionalFastCall( const SfxRequest &rReq ) } -void ShellCall_Impl( void* pObj, void* pArg ) +static void ShellCall_Impl( void* pObj, void* pArg ) { static_cast<SfxShell*>(pObj)->ExecuteSlot( *static_cast<SfxRequest*>(pArg) ); } @@ -514,8 +514,8 @@ const SfxPoolItem* SfxShell::GetSlotState return pTemp; } -SFX_EXEC_STUB(SfxShell, VerbExec) -void SfxStubSfxShellVerbState(SfxShell *, SfxItemSet& rSet) +static SFX_EXEC_STUB(SfxShell, VerbExec) +static void SfxStubSfxShellVerbState(SfxShell *, SfxItemSet& rSet) { SfxShell::VerbState( rSet ); } @@ -653,7 +653,7 @@ bool SfxShell::HasUIFeature(SfxShellFeature) const return false; } -void DispatcherUpdate_Impl( void*, void* pArg ) +static void DispatcherUpdate_Impl( void*, void* pArg ) { static_cast<SfxDispatcher*>(pArg)->Update_Impl( true ); static_cast<SfxDispatcher*>(pArg)->GetBindings()->InvalidateAll(false); diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index b5f132aae9fe..d85b1b38ff6f 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -130,7 +130,7 @@ namespace } } -const OUString* GetLastFilterConfigId( FileDialogHelper::Context _eContext ) +static const OUString* GetLastFilterConfigId( FileDialogHelper::Context _eContext ) { static const OUString aSD_EXPORT_IDENTIFIER("SdExportLastFilter"); static const OUString aSI_EXPORT_IDENTIFIER("SiExportLastFilter"); @@ -149,8 +149,8 @@ const OUString* GetLastFilterConfigId( FileDialogHelper::Context _eContext ) return pRet; } -OUString EncodeSpaces_Impl( const OUString& rSource ); -OUString DecodeSpaces_Impl( const OUString& rSource ); +static OUString EncodeSpaces_Impl( const OUString& rSource ); +static OUString DecodeSpaces_Impl( const OUString& rSource ); // FileDialogHelper_Impl @@ -1328,7 +1328,7 @@ void FileDialogHelper_Impl::implStartExecute() } } -void lcl_saveLastURLs(std::vector<OUString>& rpURLList, +static void lcl_saveLastURLs(std::vector<OUString>& rpURLList, ::std::vector< OUString >& lLastURLs ) { lLastURLs.clear(); diff --git a/sfx2/source/dialog/filtergrouping.cxx b/sfx2/source/dialog/filtergrouping.cxx index a24281ba1454..f5fbc9ec4658 100644 --- a/sfx2/source/dialog/filtergrouping.cxx +++ b/sfx2/source/dialog/filtergrouping.cxx @@ -146,7 +146,7 @@ namespace sfx2 // = reading of configuration data - void lcl_ReadFilterClass( const OConfigurationNode& _rClassesNode, const OUString& _rLogicalClassName, + static void lcl_ReadFilterClass( const OConfigurationNode& _rClassesNode, const OUString& _rLogicalClassName, FilterClass& /* [out] */ _rClass ) { // the description node for the current class @@ -218,7 +218,7 @@ namespace sfx2 }; - void lcl_ReadGlobalFilters( const OConfigurationNode& _rFilterClassification, FilterClassList& _rGlobalClasses, std::vector<OUString>& _rGlobalClassNames ) + static void lcl_ReadGlobalFilters( const OConfigurationNode& _rFilterClassification, FilterClassList& _rGlobalClasses, std::vector<OUString>& _rGlobalClassNames ) { _rGlobalClasses.clear(); _rGlobalClassNames.clear(); @@ -288,7 +288,7 @@ namespace sfx2 }; - void lcl_ReadLocalFilters( const OConfigurationNode& _rFilterClassification, FilterClassList& _rLocalClasses ) + static void lcl_ReadLocalFilters( const OConfigurationNode& _rFilterClassification, FilterClassList& _rLocalClasses ) { _rLocalClasses.clear(); @@ -305,7 +305,7 @@ namespace sfx2 } - void lcl_ReadClassification( FilterClassList& _rGlobalClasses, std::vector<OUString>& _rGlobalClassNames, FilterClassList& _rLocalClasses ) + static void lcl_ReadClassification( FilterClassList& _rGlobalClasses, std::vector<OUString>& _rGlobalClassNames, FilterClassList& _rLocalClasses ) { // open our config node @@ -495,7 +495,7 @@ namespace sfx2 } - void lcl_InitGlobalClasses( GroupedFilterList& _rAllFilters, const FilterClassList& _rGlobalClasses, FilterGroupEntryReferrer& _rGlobalClassesRef ) + static void lcl_InitGlobalClasses( GroupedFilterList& _rAllFilters, const FilterClassList& _rGlobalClasses, FilterGroupEntryReferrer& _rGlobalClassesRef ) { // we need an extra group in our "all filters" container _rAllFilters.push_front( FilterGroup() ); @@ -555,7 +555,7 @@ namespace sfx2 }; - void lcl_GroupAndClassify( TSortedFilterList& _rFilterMatcher, GroupedFilterList& _rAllFilters ) + static void lcl_GroupAndClassify( TSortedFilterList& _rFilterMatcher, GroupedFilterList& _rAllFilters ) { _rAllFilters.clear(); @@ -745,7 +745,7 @@ namespace sfx2 // = handling for the "all files" entry - bool lcl_hasAllFilesFilter( TSortedFilterList& _rFilterMatcher, OUString& /* [out] */ _rAllFilterName ) + static bool lcl_hasAllFilesFilter( TSortedFilterList& _rFilterMatcher, OUString& /* [out] */ _rAllFilterName ) { bool bHasAll = false; _rAllFilterName = SfxResId( STR_SFX_FILTERNAME_ALL ); @@ -761,7 +761,7 @@ namespace sfx2 } - void lcl_EnsureAllFilesEntry( TSortedFilterList& _rFilterMatcher, GroupedFilterList& _rFilters ) + static void lcl_EnsureAllFilesEntry( TSortedFilterList& _rFilterMatcher, GroupedFilterList& _rFilters ) { OUString sAllFilterName; diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 50d6f4764d96..88042ea54ea4 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -521,7 +521,7 @@ public: }; -void MakeTree_Impl(StyleTreeArr_Impl& rArr) +static void MakeTree_Impl(StyleTreeArr_Impl& rArr) { const comphelper::string::NaturalStringSorter aSorter( ::comphelper::getProcessComponentContext(), @@ -564,7 +564,7 @@ void MakeTree_Impl(StyleTreeArr_Impl& rArr) }); } -inline bool IsExpanded_Impl( const std::vector<OUString>& rEntries, +static inline bool IsExpanded_Impl( const std::vector<OUString>& rEntries, const OUString &rStr) { for (const auto & rEntry : rEntries) @@ -575,7 +575,7 @@ inline bool IsExpanded_Impl( const std::vector<OUString>& rEntries, return false; } -SvTreeListEntry* FillBox_Impl(SvTreeListBox* pBox, +static SvTreeListEntry* FillBox_Impl(SvTreeListBox* pBox, StyleTree_Impl* pEntry, const std::vector<OUString>& rEntries, SfxStyleFamily eStyleFamily, @@ -601,7 +601,7 @@ SvTreeListEntry* FillBox_Impl(SvTreeListBox* pBox, namespace SfxTemplate { // converts from SFX_STYLE_FAMILY Ids to 1-6 - sal_uInt16 SfxFamilyIdToNId(SfxStyleFamily nFamily) + static sal_uInt16 SfxFamilyIdToNId(SfxStyleFamily nFamily) { switch ( nFamily ) { @@ -616,7 +616,7 @@ namespace SfxTemplate } // converts from 1-6 to SFX_STYLE_FAMILY Ids - SfxStyleFamily NIdToSfxFamilyId(sal_uInt16 nId) + static SfxStyleFamily NIdToSfxFamilyId(sal_uInt16 nId) { switch (nId) { diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx index d01e5c8c0932..5e903319bb05 100644 --- a/sfx2/source/dialog/versdlg.cxx +++ b/sfx2/source/dialog/versdlg.cxx @@ -242,7 +242,7 @@ SfxVersionDialog::SfxVersionDialog ( SfxViewFrame* pVwFrame, bool bIsSaveVersion m_pVersionBox->setColSizes(); } -OUString ConvertWhiteSpaces_Impl( const OUString& rText ) +static OUString ConvertWhiteSpaces_Impl( const OUString& rText ) { // converted linebreaks and tabs to blanks; it's necessary for the display OUStringBuffer sConverted; diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx index 6ef5a029b3d6..6df5505c2961 100644 --- a/sfx2/source/doc/DocumentMetadataAccess.cxx +++ b/sfx2/source/doc/DocumentMetadataAccess.cxx @@ -206,7 +206,7 @@ struct DocumentMetadataAccess_Impl // this is... a hack. template<sal_Int16 Constant> -/*static*/ uno::Reference<rdf::XURI> const & +static uno::Reference<rdf::XURI> const & getURI(uno::Reference< uno::XComponentContext > const & i_xContext) { static uno::Reference< rdf::XURI > xURI( diff --git a/sfx2/source/doc/Metadatable.cxx b/sfx2/source/doc/Metadatable.cxx index 7d7ac24f658a..65b386640845 100644 --- a/sfx2/source/doc/Metadatable.cxx +++ b/sfx2/source/doc/Metadatable.cxx @@ -378,7 +378,7 @@ XmlIdRegistry::GetXmlIdForElement(const Metadatable& i_rObject) const /// generate unique xml:id template< typename T > -/*static*/ OUString create_id(const +static OUString create_id(const std::unordered_map< OUString, T > & i_rXmlIdMap) { static bool bHack = (getenv("LIBO_ONEWAY_STABLE_ODF_EXPORT") != nullptr); @@ -1302,7 +1302,7 @@ void Metadatable::EnsureMetadataReference() m_pReg = &rReg; } -const ::sfx2::IXmlIdRegistry& GetRegistryConst(Metadatable const& i_rObject) +static const ::sfx2::IXmlIdRegistry& GetRegistryConst(Metadatable const& i_rObject) { return const_cast< Metadatable& >( i_rObject ).GetRegistry(); } diff --git a/sfx2/source/doc/docinsert.cxx b/sfx2/source/doc/docinsert.cxx index 987548f1f80e..d0f2a0df252c 100644 --- a/sfx2/source/doc/docinsert.cxx +++ b/sfx2/source/doc/docinsert.cxx @@ -166,7 +166,7 @@ SfxMediumList* DocumentInserter::CreateMediumList() return pMediumList; } -void impl_FillURLList( sfx2::FileDialogHelper const * _pFileDlg, std::vector<OUString>& _rpURLList ) +static void impl_FillURLList( sfx2::FileDialogHelper const * _pFileDlg, std::vector<OUString>& _rpURLList ) { DBG_ASSERT( _pFileDlg, "DocumentInserter::fillURLList(): invalid file dialog" ); diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index f08529be0ce2..86a94f0d57ba 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -3262,7 +3262,7 @@ bool SfxObjectShell::SaveCompleted( const uno::Reference< embed::XStorage >& xSt return bResult; } -bool StoragesOfUnknownMediaTypeAreCopied_Impl( const uno::Reference< embed::XStorage >& xSource, +static bool StoragesOfUnknownMediaTypeAreCopied_Impl( const uno::Reference< embed::XStorage >& xSource, const uno::Reference< embed::XStorage >& xTarget ) { OSL_ENSURE( xSource.is() && xTarget.is(), "Source and/or target storages are not available!" ); diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx index 1bdf74f8f4e0..522b6db3272b 100644 --- a/sfx2/source/doc/printhelper.cxx +++ b/sfx2/source/doc/printhelper.cxx @@ -79,7 +79,7 @@ struct IMPL_PrintListener_DataContainer : public SfxListener const SfxHint& aHint ) override ; }; -awt::Size impl_Size_Object2Struct( const Size& aSize ) +static awt::Size impl_Size_Object2Struct( const Size& aSize ) { awt::Size aReturnValue; aReturnValue.Width = aSize.Width() ; @@ -87,7 +87,7 @@ awt::Size impl_Size_Object2Struct( const Size& aSize ) return aReturnValue ; } -Size impl_Size_Struct2Object( const awt::Size& aSize ) +static Size impl_Size_Struct2Object( const awt::Size& aSize ) { Size aReturnValue; aReturnValue.setWidth( aSize.Width ) ; diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 3c6e2ae18737..76b24debb328 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -580,7 +580,7 @@ Sequence< sal_Int8 > SAL_CALL SfxBaseModel::getImplementationId() // XStarBasicAccess -Reference< script::XStarBasicAccess > implGetStarBasicAccess( SfxObjectShell const * pObjectShell ) +static Reference< script::XStarBasicAccess > implGetStarBasicAccess( SfxObjectShell const * pObjectShell ) { Reference< script::XStarBasicAccess > xRet; @@ -2631,7 +2631,7 @@ SfxMedium* SfxBaseModel::handleLoadError( ErrCode nError, SfxMedium* pMedium ) // SfxListener -void addTitle_Impl( Sequence < beans::PropertyValue >& rSeq, const OUString& rTitle ) +static void addTitle_Impl( Sequence < beans::PropertyValue >& rSeq, const OUString& rTitle ) { sal_Int32 nCount = rSeq.getLength(); sal_Int32 nArg; diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx index ff481013bfa8..839342506ed7 100644 --- a/sfx2/source/sidebar/Deck.cxx +++ b/sfx2/source/sidebar/Deck.cxx @@ -265,7 +265,7 @@ void Deck::ShowPanel(const Panel& rPanel) } } -const OUString GetWindowClassification(const vcl::Window* pWindow) +static const OUString GetWindowClassification(const vcl::Window* pWindow) { const OUString& rsName (pWindow->GetText()); if (!rsName.isEmpty()) diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index 6c7bc18bb719..a4d268eb134b 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -179,7 +179,7 @@ sal_uInt32 Get10ThSec() static sal_Int32 m_nInReschedule = 0; /// static counter for rescheduling -void reschedule() +static void reschedule() { if ( m_nInReschedule == 0 ) { diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 918cc51edc18..33cd93852e32 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -2201,7 +2201,7 @@ void SfxViewFrame::ExecView_Impl TODO: export special helper "framework::FrameListAnalyzer" within the framework module and use it here. */ -bool impl_maxOpenDocCountReached() +static bool impl_maxOpenDocCountReached() { css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); boost::optional<sal_Int32> x(officecfg::Office::Common::Misc::MaxOpenDocuments::get(xContext)); @@ -2399,7 +2399,7 @@ void SfxViewFrame::Resize( bool bForce ) #define LINE_SEP 0x0A -void CutLines( OUString& rStr, sal_Int32 nStartLine, sal_Int32 nLines ) +static void CutLines( OUString& rStr, sal_Int32 nStartLine, sal_Int32 nLines ) { sal_Int32 nStartPos = 0; sal_Int32 nLine = 0; diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 124ef2bd38e4..f00c976b5e9f 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -296,7 +296,7 @@ enum ETypeFamily E_OOO_DOC }; -OUString impl_searchFormatTypeForApp(const css::uno::Reference< css::frame::XFrame >& xFrame , +static OUString impl_searchFormatTypeForApp(const css::uno::Reference< css::frame::XFrame >& xFrame , ETypeFamily eTypeFamily) { try @@ -1769,7 +1769,7 @@ void SfxViewShell::RemoveContextMenuInterceptor_Impl( const uno::Reference< ui:: pImpl->aInterceptorContainer.removeInterface( xInterceptor ); } -void Change( Menu* pMenu, SfxViewShell* pView ) +static void Change( Menu* pMenu, SfxViewShell* pView ) { SfxDispatcher *pDisp = pView->GetViewFrame()->GetDispatcher(); sal_uInt16 nCount = pMenu->GetItemCount(); diff --git a/slideshow/source/engine/eventmultiplexer.cxx b/slideshow/source/engine/eventmultiplexer.cxx index d93aea365871..fc0ff25803c0 100644 --- a/slideshow/source/engine/eventmultiplexer.cxx +++ b/slideshow/source/engine/eventmultiplexer.cxx @@ -53,7 +53,7 @@ using namespace ::com::sun::star; namespace std { // add operator== for weak_ptr, so we can use std::find over lists of them - template<typename T> bool operator==( weak_ptr<T> const& rLHS, + template<typename T> static bool operator==( weak_ptr<T> const& rLHS, weak_ptr<T> const& rRHS ) { return rLHS.lock().get() == rRHS.lock().get(); diff --git a/slideshow/source/engine/opengl/Operation.cxx b/slideshow/source/engine/opengl/Operation.cxx index a8f5bc892851..674eb0da00d8 100644 --- a/slideshow/source/engine/opengl/Operation.cxx +++ b/slideshow/source/engine/opengl/Operation.cxx @@ -115,7 +115,7 @@ makeRotateAndScaleDepthByHeight(const glm::vec3& Axis,const glm::vec3& Origin,do return std::make_shared<RotateAndScaleDepthByHeight>(Axis, Origin, Angle, bScale, bInter, T0, T1); } -inline double intervalInter(double t, double T0, double T1) +static inline double intervalInter(double t, double T0, double T1) { return ( t - T0 ) / ( T1 - T0 ); } diff --git a/slideshow/source/engine/opengl/TransitionImpl.cxx b/slideshow/source/engine/opengl/TransitionImpl.cxx index f7f694fc26e9..9d6b457ae7f1 100644 --- a/slideshow/source/engine/opengl/TransitionImpl.cxx +++ b/slideshow/source/engine/opengl/TransitionImpl.cxx @@ -923,20 +923,20 @@ std::shared_ptr<OGLTransitionImpl> makeRochade() return makeRochadeTransition(aLeavingSlide, aEnteringSlide, aSettings); } -inline double randFromNeg1to1() +static inline double randFromNeg1to1() { return comphelper::rng::uniform_real_distribution(-1.0, std::nextafter(1.0, DBL_MAX)); } // TODO(Q3): extract to basegfx -inline glm::vec3 randNormVectorInXYPlane() +static inline glm::vec3 randNormVectorInXYPlane() { glm::vec3 toReturn(randFromNeg1to1(),randFromNeg1to1(),0.0); return glm::normalize(toReturn); } template<typename T> -T clamp(const T& rIn) +static T clamp(const T& rIn) { return glm::clamp(rIn, T(-1.0), T(1.0)); } @@ -1085,12 +1085,12 @@ std::shared_ptr<OGLTransitionImpl> makeHelix( sal_uInt16 nRows ) return makeSimpleTransition(aLeavingSlide, aEnteringSlide); } -float fdiv(int a, int b) +static float fdiv(int a, int b) { return static_cast<float>(a)/b; } -glm::vec2 vec(float x, float y, float nx, float ny) +static glm::vec2 vec(float x, float y, float nx, float ny) { x = x < 0.0 ? 0.0 : x; x = std::min(x, nx); @@ -1939,7 +1939,7 @@ std::shared_ptr<OGLTransitionImpl> makeRipple() return makeRippleTransition(aLeavingSlide, aEnteringSlide, aSettings); } -void createHexagon(Primitive& aHexagon, const int x, const int y, const int NX, const int NY) +static void createHexagon(Primitive& aHexagon, const int x, const int y, const int NX, const int NY) { if (y % 4 == 0) { diff --git a/slideshow/source/engine/shapes/gdimtftools.cxx b/slideshow/source/engine/shapes/gdimtftools.cxx index c9b0583fad23..3bce67733f1e 100644 --- a/slideshow/source/engine/shapes/gdimtftools.cxx +++ b/slideshow/source/engine/shapes/gdimtftools.cxx @@ -68,7 +68,7 @@ namespace internal // calling GetBitmapEx on such a Graphic (see below) will // result in one poorly scaled bitmap into another, // somewhat arbitrarily sized bitmap. -bool hasUnsupportedActions( const GDIMetaFile& rMtf ) +static bool hasUnsupportedActions( const GDIMetaFile& rMtf ) { // search metafile for RasterOp action MetaAction* pCurrAct; diff --git a/slideshow/source/engine/slide/layermanager.cxx b/slideshow/source/engine/slide/layermanager.cxx index fd1fbfb5d87e..7667ce8c0194 100644 --- a/slideshow/source/engine/slide/layermanager.cxx +++ b/slideshow/source/engine/slide/layermanager.cxx @@ -36,7 +36,7 @@ using namespace ::com::sun::star; namespace std { // add operator!= for weak_ptr - inline bool operator!=( slideshow::internal::LayerWeakPtr const& rLHS, + static inline bool operator!=( slideshow::internal::LayerWeakPtr const& rLHS, slideshow::internal::LayerWeakPtr const& rRHS ) { return rLHS.lock().get() != rRHS.lock().get(); diff --git a/smoketest/libtest.cxx b/smoketest/libtest.cxx index a7f72e4d158d..6a8554eea66e 100644 --- a/smoketest/libtest.cxx +++ b/smoketest/libtest.cxx @@ -38,14 +38,14 @@ #else #include <sys/time.h> #include <sal/types.h> - long getTimeMS() + static long getTimeMS() { struct timeval t; gettimeofday(&t, nullptr); return t.tv_sec*1000 + t.tv_usec/1000; } - bool IsAbsolutePath(char const *pPath) + static bool IsAbsolutePath(char const *pPath) { if (pPath[0] != '/') { diff --git a/solenv/bin/concat-deps.c b/solenv/bin/concat-deps.c index d02f62c48332..abb743e8efac 100644 --- a/solenv/bin/concat-deps.c +++ b/solenv/bin/concat-deps.c @@ -124,7 +124,7 @@ static int internal_boost = 0; static char* base_dir; static char* work_dir; -size_t work_dir_len; +static size_t work_dir_len; #ifdef __GNUC__ #define clz __builtin_clz diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx index 93215f6ccd0b..cb484cca4215 100644 --- a/sot/source/sdstor/storage.cxx +++ b/sot/source/sdstor/storage.cxx @@ -44,7 +44,7 @@ using namespace ::com::sun::star; -SvLockBytesRef MakeLockBytes_Impl( const OUString & rName, StreamMode nMode ) +static SvLockBytesRef MakeLockBytes_Impl( const OUString & rName, StreamMode nMode ) { SvLockBytesRef xLB; if( !rName.isEmpty() ) diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index d36381c5b8eb..23eeca1d531c 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -303,7 +303,7 @@ void FileStreamWrapper_Impl::checkError() #define COMMIT_RESULT_NOTHING_TO_DO 1 #define COMMIT_RESULT_SUCCESS 2 -SotClipboardFormatId GetFormatId_Impl( const SvGlobalName& aName ) +static SotClipboardFormatId GetFormatId_Impl( const SvGlobalName& aName ) { if ( aName == SvGlobalName( SO3_SW_CLASSID_60 ) ) return SotClipboardFormatId::STARWRITER_60; @@ -335,7 +335,7 @@ SotClipboardFormatId GetFormatId_Impl( const SvGlobalName& aName ) } -SvGlobalName GetClassId_Impl( SotClipboardFormatId nFormat ) +static SvGlobalName GetClassId_Impl( SotClipboardFormatId nFormat ) { switch ( nFormat ) { @@ -1824,7 +1824,7 @@ sal_Int32 UCBStorage_Impl::GetObjectCount() return nCount; } -OUString Find_Impl( const Sequence < Sequence < PropertyValue > >& rSequence, const OUString& rPath ) +static OUString Find_Impl( const Sequence < Sequence < PropertyValue > >& rSequence, const OUString& rPath ) { bool bFound = false; for ( sal_Int32 nSeqs=0; nSeqs<rSequence.getLength(); nSeqs++ ) diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index eea95ab3c490..279f99a5e734 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -126,7 +126,7 @@ const OUString& SmFontStyles::GetStyleName( sal_uInt16 nIdx ) const } } -const SmFontStyles & GetFontStyles() +static const SmFontStyles & GetFontStyles() { static const SmFontStyles aImpl; return aImpl; diff --git a/starmath/source/mathmlattr.cxx b/starmath/source/mathmlattr.cxx index 344c079b35e9..a65e8d3f9a36 100644 --- a/starmath/source/mathmlattr.cxx +++ b/starmath/source/mathmlattr.cxx @@ -12,7 +12,7 @@ #include <cassert> #include <unordered_map> -sal_Int32 ParseMathMLUnsignedNumber(const OUString &rStr, Fraction& rUN) +static sal_Int32 ParseMathMLUnsignedNumber(const OUString &rStr, Fraction& rUN) { auto nLen = rStr.getLength(); sal_Int32 nDecimalPoint = -1; @@ -38,7 +38,7 @@ sal_Int32 ParseMathMLUnsignedNumber(const OUString &rStr, Fraction& rUN) return nIdx; } -sal_Int32 ParseMathMLNumber(const OUString &rStr, Fraction& rN) +static sal_Int32 ParseMathMLNumber(const OUString &rStr, Fraction& rN) { if (rStr.isEmpty()) return -1; diff --git a/stoc/source/invocation/invocation.cxx b/stoc/source/invocation/invocation.cxx index 68caa503d044..3fef7146355a 100644 --- a/stoc/source/invocation/invocation.cxx +++ b/stoc/source/invocation/invocation.cxx @@ -80,7 +80,7 @@ static OUString inv_getImplementationName() } // TODO: Implement centrally -inline Reference<XIdlClass> TypeToIdlClass( const Type& rType, const Reference< XIdlReflection > & xRefl ) +static inline Reference<XIdlClass> TypeToIdlClass( const Type& rType, const Reference< XIdlReflection > & xRefl ) { return xRefl->forName( rType.getTypeName() ); } @@ -1134,7 +1134,7 @@ Reference<XInterface> InvocationService::createInstanceWithArguments( } /// @throws RuntimeException -Reference<XInterface> InvocationService_CreateInstance( const Reference<XComponentContext> & xCtx ) +static Reference<XInterface> InvocationService_CreateInstance( const Reference<XComponentContext> & xCtx ) { Reference<XInterface> xService( *new InvocationService( xCtx ) ); return xService; diff --git a/stoc/source/javaloader/javaloader.cxx b/stoc/source/javaloader/javaloader.cxx index 28aefc9fddf4..34d80b4f3b52 100644 --- a/stoc/source/javaloader/javaloader.cxx +++ b/stoc/source/javaloader/javaloader.cxx @@ -338,7 +338,7 @@ static Mutex & getInitMutex() } /// @throws Exception -css::uno::Reference<XInterface> JavaComponentLoader_CreateInstance(const css::uno::Reference<XComponentContext> & xCtx) +static css::uno::Reference<XInterface> JavaComponentLoader_CreateInstance(const css::uno::Reference<XComponentContext> & xCtx) { css::uno::Reference<XInterface> xRet; diff --git a/svgio/source/svgreader/svgimagenode.cxx b/svgio/source/svgreader/svgimagenode.cxx index b8fe34941005..7224eabb8f2d 100644 --- a/svgio/source/svgreader/svgimagenode.cxx +++ b/svgio/source/svgreader/svgimagenode.cxx @@ -159,7 +159,7 @@ namespace svgio } } - void extractFromGraphic( + static void extractFromGraphic( const Graphic& rGraphic, drawinglayer::primitive2d::Primitive2DContainer& rEmbedded, basegfx::B2DRange& rViewBox, diff --git a/svgio/source/svgreader/svgstyleattributes.cxx b/svgio/source/svgreader/svgstyleattributes.cxx index 5f5d9df13584..3bd5dac3c483 100644 --- a/svgio/source/svgreader/svgstyleattributes.cxx +++ b/svgio/source/svgreader/svgstyleattributes.cxx @@ -49,7 +49,7 @@ namespace svgio { namespace svgreader { - basegfx::B2DLineJoin StrokeLinejoinToB2DLineJoin(StrokeLinejoin aStrokeLinejoin) + static basegfx::B2DLineJoin StrokeLinejoinToB2DLineJoin(StrokeLinejoin aStrokeLinejoin) { if(StrokeLinejoin_round == aStrokeLinejoin) { @@ -63,7 +63,7 @@ namespace svgio return basegfx::B2DLineJoin::Miter; } - css::drawing::LineCap StrokeLinecapToDrawingLineCap(StrokeLinecap aStrokeLinecap) + static css::drawing::LineCap StrokeLinecapToDrawingLineCap(StrokeLinecap aStrokeLinecap) { switch(aStrokeLinecap) { diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx index 6824d15026fe..801e5d3fc405 100644 --- a/svl/qa/unit/svl.cxx +++ b/svl/qa/unit/svl.cxx @@ -43,7 +43,7 @@ using namespace ::com::sun::star; using namespace svl; -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/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index eb77b6c6ce66..a4980e6eb3ee 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -126,7 +126,7 @@ void ImpSvNumberInputScan::Reset() } // native number transliteration if necessary -void TransformInput( SvNumberFormatter const * pFormatter, OUString& rStr ) +static void TransformInput( SvNumberFormatter const * pFormatter, OUString& rStr ) { sal_Int32 nPos, nLen; for ( nPos = 0, nLen = rStr.getLength(); nPos < nLen; ++nPos ) diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 27d9b1322d5b..aef0c17b1691 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -5064,7 +5064,7 @@ static void lcl_SvNumberformat_AddLimitStringImpl( OUString& rStr, rStr += "]"; } -void lcl_insertLCID( OUStringBuffer& rFormatStr, sal_uInt32 nLCID, sal_Int32 nPosInsertLCID, bool bDBNumInserted ) +static void lcl_insertLCID( OUStringBuffer& rFormatStr, sal_uInt32 nLCID, sal_Int32 nPosInsertLCID, bool bDBNumInserted ) { if ( nLCID == 0 ) return; @@ -5090,7 +5090,7 @@ void lcl_insertLCID( OUStringBuffer& rFormatStr, sal_uInt32 nLCID, sal_Int32 nPo * +1 for financial numerals [NatNum2] * +2 for Arabic fullwidth numerals [NatNum3] * */ -void lcl_incrementAlphabetWithNatNum ( sal_uInt32& nAlphabetID, sal_uInt32 nNatNum ) +static void lcl_incrementAlphabetWithNatNum ( sal_uInt32& nAlphabetID, sal_uInt32 nNatNum ) { if ( nNatNum == 2) // financial nAlphabetID += 1; diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx index 09b088f27339..961e1b9af8aa 100644 --- a/svl/source/undo/undo.cxx +++ b/svl/source/undo/undo.cxx @@ -1284,7 +1284,7 @@ void SfxUndoManager::dumpAsXml(xmlTextWriterPtr pWriter) const } /// Returns a JSON representation of pAction. -boost::property_tree::ptree lcl_ActionToJson(size_t nIndex, SfxUndoAction const * pAction) +static boost::property_tree::ptree lcl_ActionToJson(size_t nIndex, SfxUndoAction const * pAction) { boost::property_tree::ptree aRet; aRet.put("index", nIndex); diff --git a/svtools/source/brwbox/brwbox3.cxx b/svtools/source/brwbox/brwbox3.cxx index f4db7a2b29f6..24149788c11f 100644 --- a/svtools/source/brwbox/brwbox3.cxx +++ b/svtools/source/brwbox/brwbox3.cxx @@ -39,7 +39,7 @@ namespace svt using namespace ::com::sun::star::lang; using namespace utl; - Reference< XAccessible > getHeaderCell( BrowseBoxImpl::THeaderCellMap& _raHeaderCells, + static Reference< XAccessible > getHeaderCell( BrowseBoxImpl::THeaderCellMap& _raHeaderCells, sal_Int32 _nPos, AccessibleBrowseBoxObjType _eType, const Reference< XAccessible >& _rParent, diff --git a/svtools/source/config/extcolorcfg.cxx b/svtools/source/config/extcolorcfg.cxx index 867525cf8f77..42b8370cfa08 100644 --- a/svtools/source/config/extcolorcfg.cxx +++ b/svtools/source/config/extcolorcfg.cxx @@ -218,7 +218,7 @@ void ExtendedColorConfig_Impl::EnableBroadcast() ExtendedColorConfig::m_pImpl->m_bIsBroadcastEnabled = true; } -void lcl_addString(uno::Sequence < OUString >& _rSeq,const OUString& _sAdd) +static void lcl_addString(uno::Sequence < OUString >& _rSeq,const OUString& _sAdd) { for(OUString & i : _rSeq) i += _sAdd; diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx index f129b25c12ca..188605a84b0d 100644 --- a/svtools/source/contnr/fileview.cxx +++ b/svtools/source/contnr/fileview.cxx @@ -1927,7 +1927,7 @@ static const CollatorWrapper* pCollatorWrapper = nullptr; /* this function returns true, if aOne is less then aTwo */ -bool CompareSortingData_Impl( std::unique_ptr<SortingData_Impl> const & aOne, std::unique_ptr<SortingData_Impl> const & aTwo ) +static bool CompareSortingData_Impl( std::unique_ptr<SortingData_Impl> const & aOne, std::unique_ptr<SortingData_Impl> const & aTwo ) { DBG_ASSERT( pCollatorWrapper, "*CompareSortingData_Impl(): Can't work this way!" ); diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 33355147da99..530a9a6b95f4 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -275,7 +275,7 @@ SvxBorderLineStyle LineListBox::GetSelectEntryStyle() const } -void lclDrawPolygon( OutputDevice& rDev, const basegfx::B2DPolygon& rPolygon, long nWidth, SvxBorderLineStyle nDashing ) +static void lclDrawPolygon( OutputDevice& rDev, const basegfx::B2DPolygon& rPolygon, long nWidth, SvxBorderLineStyle nDashing ) { AntialiasingFlags nOldAA = rDev.GetAntialiasing(); rDev.SetAntialiasing( nOldAA & ~AntialiasingFlags::EnableB2dDraw ); @@ -316,7 +316,7 @@ namespace svtools { /** * Dashing array must start with a line width and end with a blank width. */ -std::vector<double> GetDashing( SvxBorderLineStyle nDashing ) +static std::vector<double> GetDashing( SvxBorderLineStyle nDashing ) { std::vector<double> aPattern; switch (nDashing) diff --git a/svtools/source/misc/bindablecontrolhelper.cxx b/svtools/source/misc/bindablecontrolhelper.cxx index 18cb421e3caf..7a47ea262e3e 100644 --- a/svtools/source/misc/bindablecontrolhelper.cxx +++ b/svtools/source/misc/bindablecontrolhelper.cxx @@ -38,7 +38,7 @@ namespace svt using namespace ::com::sun::star; -bool lcl_isNamedRange( const OUString& sAddress, const uno::Reference< frame::XModel >& xModel, css::table::CellRangeAddress& aAddress ) +static bool lcl_isNamedRange( const OUString& sAddress, const uno::Reference< frame::XModel >& xModel, css::table::CellRangeAddress& aAddress ) { bool bRes = false; uno::Reference< sheet::XCellRangeReferrer > xReferrer; diff --git a/svtools/source/misc/templatefoldercache.cxx b/svtools/source/misc/templatefoldercache.cxx index f812640956d6..28b547b329c2 100644 --- a/svtools/source/misc/templatefoldercache.cxx +++ b/svtools/source/misc/templatefoldercache.cxx @@ -60,7 +60,7 @@ namespace svt //= helpers - SvStream& WriteDateTime( SvStream& _rStorage, const util::DateTime& _rDate ) + static SvStream& WriteDateTime( SvStream& _rStorage, const util::DateTime& _rDate ) { sal_uInt16 hundredthSeconds = static_cast< sal_uInt16 >( _rDate.NanoSeconds / tools::Time::nanoPerCenti ); _rStorage.WriteUInt16( hundredthSeconds ); @@ -76,7 +76,7 @@ namespace svt } - SvStream& operator >> ( SvStream& _rStorage, util::DateTime& _rDate ) + static SvStream& operator >> ( SvStream& _rStorage, util::DateTime& _rDate ) { sal_uInt16 hundredthSeconds; _rStorage.ReadUInt16( hundredthSeconds ); diff --git a/svtools/source/misc/unitconv.cxx b/svtools/source/misc/unitconv.cxx index 64d1acb75330..6372671718d2 100644 --- a/svtools/source/misc/unitconv.cxx +++ b/svtools/source/misc/unitconv.cxx @@ -383,7 +383,7 @@ long CalcToPoint( long nIn, MapUnit eUnit, sal_uInt16 nFactor ) } -long CMToTwips( long nIn ) +static long CMToTwips( long nIn ) { long nRet = 0; @@ -393,7 +393,7 @@ long CMToTwips( long nIn ) } -long MMToTwips( long nIn ) +static long MMToTwips( long nIn ) { long nRet = 0; @@ -403,7 +403,7 @@ long MMToTwips( long nIn ) } -long InchToTwips( long nIn ) +static long InchToTwips( long nIn ) { long nRet = 0; @@ -423,7 +423,7 @@ long PointToTwips( long nIn ) } -long PicaToTwips( long nIn ) +static long PicaToTwips( long nIn ) { long nRet = 0; @@ -433,14 +433,14 @@ long PicaToTwips( long nIn ) } -long TwipsToCM( long nIn ) +static long TwipsToCM( long nIn ) { long nRet = nIn / 567; return nRet; } -long InchToCM( long nIn ) +static long InchToCM( long nIn ) { long nRet = 0; @@ -450,14 +450,14 @@ long InchToCM( long nIn ) } -long MMToCM( long nIn ) +static long MMToCM( long nIn ) { long nRet = nIn / 10; return nRet; } -long PointToCM( long nIn ) +static long PointToCM( long nIn ) { long nRet = 0; @@ -467,7 +467,7 @@ long PointToCM( long nIn ) } -long PicaToCM( long nIn) +static long PicaToCM( long nIn) { long nRet = 0; @@ -477,7 +477,7 @@ long PicaToCM( long nIn) } -long TwipsToMM( long nIn ) +static long TwipsToMM( long nIn ) { long nRet = 0; @@ -487,7 +487,7 @@ long TwipsToMM( long nIn ) } -long CMToMM( long nIn ) +static long CMToMM( long nIn ) { long nRet = 0; @@ -497,7 +497,7 @@ long CMToMM( long nIn ) } -long InchToMM( long nIn ) +static long InchToMM( long nIn ) { long nRet = 0; @@ -507,7 +507,7 @@ long InchToMM( long nIn ) } -long PointToMM( long nIn ) +static long PointToMM( long nIn ) { long nRet = 0; @@ -517,7 +517,7 @@ long PointToMM( long nIn ) } -long PicaToMM( long nIn ) +static long PicaToMM( long nIn ) { long nRet = 0; @@ -527,14 +527,14 @@ long PicaToMM( long nIn ) } -long TwipsToInch( long nIn ) +static long TwipsToInch( long nIn ) { long nRet = nIn / 1440; return nRet; } -long CMToInch( long nIn ) +static long CMToInch( long nIn ) { long nRet = 0; @@ -544,7 +544,7 @@ long CMToInch( long nIn ) } -long MMToInch( long nIn ) +static long MMToInch( long nIn ) { long nRet = 0; @@ -554,28 +554,28 @@ long MMToInch( long nIn ) } -long PointToInch( long nIn ) +static long PointToInch( long nIn ) { long nRet = nIn / 72; return nRet; } -long PicaToInch( long nIn ) +static long PicaToInch( long nIn ) { long nRet = nIn / 6; return nRet; } -long TwipsToPoint( long nIn ) +static long TwipsToPoint( long nIn ) { long nRet = nIn / 20; return nRet; } -long InchToPoint( long nIn ) +static long InchToPoint( long nIn ) { long nRet = 0; @@ -585,7 +585,7 @@ long InchToPoint( long nIn ) } -long CMToPoint( long nIn ) +static long CMToPoint( long nIn ) { long nRet = 0; @@ -595,7 +595,7 @@ long CMToPoint( long nIn ) } -long MMToPoint( long nIn ) +static long MMToPoint( long nIn ) { long nRet = 0; @@ -605,21 +605,21 @@ long MMToPoint( long nIn ) } -long PicaToPoint( long nIn ) +static long PicaToPoint( long nIn ) { long nRet = nIn / 12; return nRet; } -long TwipsToPica( long nIn ) +static long TwipsToPica( long nIn ) { long nRet = nIn / 240; return nRet; } -long InchToPica( long nIn ) +static long InchToPica( long nIn ) { long nRet = 0; @@ -629,7 +629,7 @@ long InchToPica( long nIn ) } -long PointToPica( long nIn ) +static long PointToPica( long nIn ) { long nRet = 0; @@ -639,7 +639,7 @@ long PointToPica( long nIn ) } -long CMToPica( long nIn ) +static long CMToPica( long nIn ) { long nRet = 0; @@ -649,7 +649,7 @@ long CMToPica( long nIn ) } -long MMToPica( long nIn ) +static long MMToPica( long nIn ) { long nRet = 0; @@ -659,7 +659,7 @@ long MMToPica( long nIn ) } -long Nothing( long nIn ) +static long Nothing( long nIn ) { long nRet = nIn; return nRet; diff --git a/svx/source/accessibility/AccessibleTextHelper.cxx b/svx/source/accessibility/AccessibleTextHelper.cxx index 821c921d6336..9f622b696cd5 100644 --- a/svx/source/accessibility/AccessibleTextHelper.cxx +++ b/svx/source/accessibility/AccessibleTextHelper.cxx @@ -78,7 +78,7 @@ namespace accessibility // AccessibleTextHelper_Impl declaration template < typename first_type, typename second_type > - ::std::pair< first_type, second_type > makeSortedPair( first_type first, + static ::std::pair< first_type, second_type > makeSortedPair( first_type first, second_type second ) { if( first > second ) diff --git a/svx/source/accessibility/ShapeTypeHandler.cxx b/svx/source/accessibility/ShapeTypeHandler.cxx index 376c6e0ad24f..cf0dc4a155d8 100644 --- a/svx/source/accessibility/ShapeTypeHandler.cxx +++ b/svx/source/accessibility/ShapeTypeHandler.cxx @@ -41,7 +41,7 @@ ShapeTypeHandler* ShapeTypeHandler::instance = nullptr; // Create an empty reference to an accessible object. -AccessibleShape* +static AccessibleShape* CreateEmptyShapeReference ( const AccessibleShapeInfo& /*rShapeInfo*/, const AccessibleShapeTreeInfo& /*rShapeTreeInfo*/, diff --git a/svx/source/accessibility/SvxShapeTypes.cxx b/svx/source/accessibility/SvxShapeTypes.cxx index fb53f41c52ed..9677eb869b3f 100644 --- a/svx/source/accessibility/SvxShapeTypes.cxx +++ b/svx/source/accessibility/SvxShapeTypes.cxx @@ -27,7 +27,7 @@ namespace accessibility { -AccessibleShape* CreateSvxAccessibleShape ( +static AccessibleShape* CreateSvxAccessibleShape ( const AccessibleShapeInfo& rShapeInfo, const AccessibleShapeTreeInfo& rShapeTreeInfo, ShapeTypeId nId) diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx index 7e2111f0dc07..0cb389a9d488 100644 --- a/svx/source/customshapes/EnhancedCustomShape2d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx @@ -2049,7 +2049,7 @@ void EnhancedCustomShape2d::CreateSubPath( } } -void CorrectCalloutArrows( +static void CorrectCalloutArrows( MSO_SPT eSpType, sal_uInt32 nLineObjectCount, std::vector< std::pair< SdrPathObj*, double> >& vObjectList ) diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx index 48bbb91e81f5..ac559be40f63 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx @@ -146,7 +146,7 @@ static bool InitializeFontWorkData( return bNoErr; } -double GetLength( const tools::Polygon& rPolygon ) +static double GetLength( const tools::Polygon& rPolygon ) { double fLength = 0; if ( rPolygon.GetSize() > 1 ) @@ -161,7 +161,7 @@ double GetLength( const tools::Polygon& rPolygon ) /* CalculateHorizontalScalingFactor returns the horizontal scaling factor for the whole text object, so that each text will match its corresponding 2d Outline */ -void CalculateHorizontalScalingFactor( +static void CalculateHorizontalScalingFactor( const SdrObjCustomShape& rSdrObjCustomShape, FWData& rFWData, const tools::PolyPolygon& rOutline2d) @@ -259,7 +259,7 @@ void CalculateHorizontalScalingFactor( rFWData.fHorizontalTextScaling = fScalingFactor; } -void GetTextAreaOutline( +static void GetTextAreaOutline( const FWData& rFWData, const SdrObjCustomShape& rSdrObjCustomShape, FWTextArea& rTextArea, @@ -468,7 +468,7 @@ void GetTextAreaOutline( } } -bool GetFontWorkOutline( +static bool GetFontWorkOutline( FWData& rFWData, const SdrObjCustomShape& rSdrObjCustomShape) { @@ -617,7 +617,7 @@ bool GetFontWorkOutline( return true; } -basegfx::B2DPolyPolygon GetOutlinesFromShape2d( const SdrObject* pShape2d ) +static basegfx::B2DPolyPolygon GetOutlinesFromShape2d( const SdrObject* pShape2d ) { basegfx::B2DPolyPolygon aOutlines2d; @@ -639,7 +639,7 @@ basegfx::B2DPolyPolygon GetOutlinesFromShape2d( const SdrObject* pShape2d ) return aOutlines2d; } -void CalcDistances( const tools::Polygon& rPoly, std::vector< double >& rDistances ) +static void CalcDistances( const tools::Polygon& rPoly, std::vector< double >& rDistances ) { sal_uInt16 i, nCount = rPoly.GetSize(); if ( nCount > 1 ) @@ -661,7 +661,7 @@ void CalcDistances( const tools::Polygon& rPoly, std::vector< double >& rDistanc } } -void InsertMissingOutlinePoints( const std::vector< double >& rDistances, +static void InsertMissingOutlinePoints( const std::vector< double >& rDistances, const tools::Rectangle& rTextAreaBoundRect, tools::Polygon& rPoly ) { sal_uInt16 nSize = rPoly.GetSize(); @@ -715,7 +715,7 @@ void InsertMissingOutlinePoints( const std::vector< double >& rDistances, } } -void GetPoint( const tools::Polygon& rPoly, const std::vector< double >& rDistances, const double& fX, double& fx1, double& fy1 ) +static void GetPoint( const tools::Polygon& rPoly, const std::vector< double >& rDistances, const double& fX, double& fx1, double& fy1 ) { fy1 = fx1 = 0.0; if ( rPoly.GetSize() > 1 ) @@ -743,7 +743,7 @@ void GetPoint( const tools::Polygon& rPoly, const std::vector< double >& rDistan } } -void FitTextOutlinesToShapeOutlines( const tools::PolyPolygon& aOutlines2d, FWData& rFWData ) +static void FitTextOutlinesToShapeOutlines( const tools::PolyPolygon& aOutlines2d, FWData& rFWData ) { std::vector< FWTextArea >::iterator aTextAreaIter = rFWData.vTextAreas.begin(); std::vector< FWTextArea >::iterator aTextAreaIEnd = rFWData.vTextAreas.end(); @@ -911,7 +911,7 @@ void FitTextOutlinesToShapeOutlines( const tools::PolyPolygon& aOutlines2d, FWDa } } -SdrObject* CreateSdrObjectFromParagraphOutlines( +static SdrObject* CreateSdrObjectFromParagraphOutlines( const FWData& rFWData, const SdrObjCustomShape& rSdrObjCustomShape) { diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx index 9621a0c03fab..d7265a42447d 100644 --- a/svx/source/dialog/docrecovery.cxx +++ b/svx/source/dialog/docrecovery.cxx @@ -828,7 +828,7 @@ void RecovDocList::InitEntry(SvTreeListEntry* pEntry, } -short impl_askUserForWizardCancel(weld::Widget* pParent, const char* pRes) +static short impl_askUserForWizardCancel(weld::Widget* pParent, const char* pRes) { std::unique_ptr<weld::MessageDialog> xQuery(Application::CreateMessageDialog(pParent, VclMessageType::Question, VclButtonsType::YesNo, SvxResId(pRes))); diff --git a/svx/source/dialog/framelink.cxx b/svx/source/dialog/framelink.cxx index fd5681a634d9..2f069e1dad72 100644 --- a/svx/source/dialog/framelink.cxx +++ b/svx/source/dialog/framelink.cxx @@ -351,7 +351,7 @@ struct ExtendSet ExtendSet() : mfExtLeft(0.0), mfExtRight(0.0) {} }; -void getCutSet( +static void getCutSet( CutSet& rCutSet, const basegfx::B2DPoint& rLeft, const basegfx::B2DPoint& rRight, @@ -393,7 +393,7 @@ void getCutSet( &rCutSet.mfORMR); } -void getExtends( +static void getExtends( std::vector<ExtendSet>& rExtendSet, // target Left/Right values to fill const basegfx::B2DPoint& rOrigin, // own vector start const StyleVectorCombination& rCombination, // own vector and offsets for lines diff --git a/svx/source/dialog/framelinkarray.cxx b/svx/source/dialog/framelinkarray.cxx index 5b24b6d75c45..4a1af71a7dca 100644 --- a/svx/source/dialog/framelinkarray.cxx +++ b/svx/source/dialog/framelinkarray.cxx @@ -147,7 +147,7 @@ void Cell::MirrorSelfX() } -void lclRecalcCoordVec( std::vector<long>& rCoords, const std::vector<long>& rSizes ) +static void lclRecalcCoordVec( std::vector<long>& rCoords, const std::vector<long>& rSizes ) { DBG_ASSERT( rCoords.size() == rSizes.size() + 1, "lclRecalcCoordVec - inconsistent vectors" ); auto aCIt = rCoords.begin(); @@ -158,7 +158,7 @@ void lclRecalcCoordVec( std::vector<long>& rCoords, const std::vector<long>& rSi } } -void lclSetMergedRange( CellVec& rCells, size_t nWidth, size_t nFirstCol, size_t nFirstRow, size_t nLastCol, size_t nLastRow ) +static void lclSetMergedRange( CellVec& rCells, size_t nWidth, size_t nFirstCol, size_t nFirstRow, size_t nLastCol, size_t nLastRow ) { for( size_t nCol = nFirstCol; nCol <= nLastCol; ++nCol ) { @@ -918,7 +918,7 @@ void Array::MirrorSelfX() } // drawing -void HelperCreateHorizontalEntry( +static void HelperCreateHorizontalEntry( const Array& rArray, const Style& rStyle, size_t col, size_t row, const basegfx::B2DPoint& rOrigin, const basegfx::B2DVector& rX, const basegfx::B2DVector& rY, drawinglayer::primitive2d::Primitive2DContainer& rSequence, @@ -966,7 +966,7 @@ void HelperCreateHorizontalEntry( ); } -void HelperCreateVerticalEntry( +static void HelperCreateVerticalEntry( const Array& rArray, const Style& rStyle, size_t col, size_t row, const basegfx::B2DPoint& rOrigin, const basegfx::B2DVector& rX, const basegfx::B2DVector& rY, drawinglayer::primitive2d::Primitive2DContainer& rSequence, diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index bb0f185ad310..109fd7c78d83 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -143,7 +143,7 @@ struct SearchDlg_Impl } }; -void ListToStrArr_Impl( sal_uInt16 nId, std::vector<OUString>& rStrLst, ComboBox& rCBox ) +static void ListToStrArr_Impl( sal_uInt16 nId, std::vector<OUString>& rStrLst, ComboBox& rCBox ) { const SfxStringListItem* pSrchItem = static_cast<const SfxStringListItem*>(SfxGetpApp()->GetItem( nId )); @@ -160,7 +160,7 @@ void ListToStrArr_Impl( sal_uInt16 nId, std::vector<OUString>& rStrLst, ComboBox } } -void StrArrToList_Impl( sal_uInt16 nId, const std::vector<OUString>& rStrLst ) +static void StrArrToList_Impl( sal_uInt16 nId, const std::vector<OUString>& rStrLst ) { DBG_ASSERT( !rStrLst.empty(), "check in advance"); SfxGetpApp()->PutItem( SfxStringListItem( nId, &rStrLst ) ); diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx index 40cf9e9ed43f..f2ed23425d8a 100644 --- a/svx/source/dialog/svxruler.cxx +++ b/svx/source/dialog/svxruler.cxx @@ -1031,7 +1031,7 @@ void SvxRuler::SetDefTabDist(long inDefTabDist) // New distance for DefaultTabs UpdateTabs(); } -sal_uInt16 ToSvTab_Impl(SvxTabAdjust eAdj) +static sal_uInt16 ToSvTab_Impl(SvxTabAdjust eAdj) { /* Internal conversion routine between SV-Tab.-Enum and Svx */ switch(eAdj) { @@ -1045,7 +1045,7 @@ sal_uInt16 ToSvTab_Impl(SvxTabAdjust eAdj) return 0; } -SvxTabAdjust ToAttrTab_Impl(sal_uInt16 eAdj) +static SvxTabAdjust ToAttrTab_Impl(sal_uInt16 eAdj) { switch(eAdj) { case RULER_TAB_LEFT: return SvxTabAdjust::Left ; @@ -1354,7 +1354,7 @@ ADD_DEBUG_TEXT("lDragPos: ", OUString::number(lDragPos)) return lDragPos - lNullPix; } -void ModifyTabs_Impl( sal_uInt16 nCount, // Number of Tabs +static void ModifyTabs_Impl( sal_uInt16 nCount, // Number of Tabs RulerTab* pTabs, // Tab buffer long lDiff) // difference to be added { diff --git a/svx/source/engine3d/helperhittest3d.cxx b/svx/source/engine3d/helperhittest3d.cxx index 329d327b97de..5ffa15457fe4 100644 --- a/svx/source/engine3d/helperhittest3d.cxx +++ b/svx/source/engine3d/helperhittest3d.cxx @@ -55,7 +55,7 @@ public: }; -void getAllHit3DObjectWithRelativePoint( +static void getAllHit3DObjectWithRelativePoint( const basegfx::B3DPoint& rFront, const basegfx::B3DPoint& rBack, const E3dCompoundObject& rObject, diff --git a/svx/source/engine3d/view3d1.cxx b/svx/source/engine3d/view3d1.cxx index 1fe0e022a59c..729d146c742d 100644 --- a/svx/source/engine3d/view3d1.cxx +++ b/svx/source/engine3d/view3d1.cxx @@ -71,7 +71,7 @@ void E3dView::ConvertMarkedToPolyObj() } } -void Imp_E3dView_InorderRun3DObjects(const SdrObject* pObj, sal_uInt32& rMask) +static void Imp_E3dView_InorderRun3DObjects(const SdrObject* pObj, sal_uInt32& rMask) { if(dynamic_cast< const E3dLatheObj* >(pObj) != nullptr) { diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx index 1731bb2a3503..7aa1a207bede 100644 --- a/svx/source/fmcomp/fmgridcl.cxx +++ b/svx/source/fmcomp/fmgridcl.cxx @@ -98,7 +98,7 @@ struct FmGridHeaderData Reference< XInterface > xDroppedResultSet; }; -void SetMenuItem(const OUString& rImgID, const OString &rID, Menu& rMenu, bool bDesignMode) +static void SetMenuItem(const OUString& rImgID, const OString &rID, Menu& rMenu, bool bDesignMode) { BitmapEx aBitmap(rImgID); Image aImage(aBitmap); diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx index 09f76a800c74..30b2aa76cfa3 100644 --- a/svx/source/fmcomp/fmgridif.cxx +++ b/svx/source/fmcomp/fmgridif.cxx @@ -78,7 +78,7 @@ using ::com::sun::star::sdb::XRowSetSupplier; using ::com::sun::star::awt::XVclWindowPeer; -css::awt::FontDescriptor ImplCreateFontDescriptor( const vcl::Font& rFont ) +static css::awt::FontDescriptor ImplCreateFontDescriptor( const vcl::Font& rFont ) { css::awt::FontDescriptor aFD; aFD.Name = rFont.GetFamilyName(); @@ -101,7 +101,7 @@ css::awt::FontDescriptor ImplCreateFontDescriptor( const vcl::Font& rFont ) } -vcl::Font ImplCreateFont( const css::awt::FontDescriptor& rDescr ) +static vcl::Font ImplCreateFont( const css::awt::FontDescriptor& rDescr ) { vcl::Font aFont; aFont.SetFamilyName( rDescr.Name ); @@ -1021,7 +1021,7 @@ void FmXGridPeer::columnChanged() namespace fmgridif { - const OUString getDataModeIdentifier() + static const OUString getDataModeIdentifier() { return OUString("DataMode"); } diff --git a/svx/source/fmcomp/gridcols.cxx b/svx/source/fmcomp/gridcols.cxx index a944957881d6..732699ab8f8b 100644 --- a/svx/source/fmcomp/gridcols.cxx +++ b/svx/source/fmcomp/gridcols.cxx @@ -24,7 +24,7 @@ using namespace ::com::sun::star::uno; -const css::uno::Sequence<OUString>& getColumnTypes() +static const css::uno::Sequence<OUString>& getColumnTypes() { static css::uno::Sequence<OUString> aColumnTypes(10); if (aColumnTypes.getConstArray()[0].isEmpty()) @@ -45,12 +45,16 @@ const css::uno::Sequence<OUString>& getColumnTypes() } +extern "C" { + // comparison of PropertyInfo -extern "C" int NameCompare(const void* pFirst, const void* pSecond) +static int NameCompare(const void* pFirst, const void* pSecond) { return static_cast<OUString const *>(pFirst)->compareTo(*static_cast<OUString const *>(pSecond)); } +} + namespace { diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx index 915ce52dd0f2..5d76624da921 100644 --- a/svx/source/form/datanavi.cxx +++ b/svx/source/form/datanavi.cxx @@ -2403,7 +2403,7 @@ namespace svxform } } - void copyPropSet( const Reference< XPropertySet >& xFrom, Reference< XPropertySet > const & xTo ) + static void copyPropSet( const Reference< XPropertySet >& xFrom, Reference< XPropertySet > const & xTo ) { DBG_ASSERT( xFrom.is(), "copyPropSet(): no source" ); DBG_ASSERT( xTo.is(), "copyPropSet(): no target" ); diff --git a/svx/source/form/fmPropBrw.cxx b/svx/source/form/fmPropBrw.cxx index b53e247e3f20..29d19f5358dc 100644 --- a/svx/source/form/fmPropBrw.cxx +++ b/svx/source/form/fmPropBrw.cxx @@ -103,7 +103,7 @@ const long STD_MIN_SIZE_X = 250; const long STD_MIN_SIZE_Y = 250; -OUString GetUIHeadlineName(sal_Int16 nClassId, const Any& aUnoObj) +static OUString GetUIHeadlineName(sal_Int16 nClassId, const Any& aUnoObj) { const char* pClassNameResourceId = nullptr; diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index 3b46b5806320..ef234e200590 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -554,7 +554,7 @@ bool FmXBoundFormFieldIterator::ShouldHandleElement(const Reference< XInterface> } -bool isControlList(const SdrMarkList& rMarkList) +static bool isControlList(const SdrMarkList& rMarkList) { // the list contains only controls and at least one control const size_t nMarkCount = rMarkList.GetMarkCount(); @@ -597,7 +597,7 @@ bool isControlList(const SdrMarkList& rMarkList) } -Reference< XForm > GetForm(const Reference< XInterface>& _rxElement) +static Reference< XForm > GetForm(const Reference< XInterface>& _rxElement) { Reference< XForm > xForm( _rxElement, UNO_QUERY ); if ( xForm.is() ) @@ -2986,7 +2986,7 @@ void FmXFormShell::startFiltering_Lock() } -void saveFilter(const Reference< runtime::XFormController >& _rxController) +static void saveFilter(const Reference< runtime::XFormController >& _rxController) { Reference< XPropertySet> xFormAsSet(_rxController->getModel(), UNO_QUERY); Reference< XPropertySet> xControllerAsSet(_rxController, UNO_QUERY); diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx index 5132c9b3133d..491a9c548ad2 100644 --- a/svx/source/form/fmvwimp.cxx +++ b/svx/source/form/fmvwimp.cxx @@ -259,7 +259,7 @@ void SAL_CALL FormViewPageWindowAdapter::makeVisible( const Reference< XControl } } -Reference< XFormController > getControllerSearchChildren( const Reference< XIndexAccess > & xIndex, const Reference< XTabControllerModel > & xModel) +static Reference< XFormController > getControllerSearchChildren( const Reference< XIndexAccess > & xIndex, const Reference< XTabControllerModel > & xModel) { if (xIndex.is() && xIndex->getCount()) { diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx index 34e86a1fcc5e..63d8cdac73b2 100644 --- a/svx/source/form/navigatortree.cxx +++ b/svx/source/form/navigatortree.cxx @@ -88,7 +88,7 @@ namespace svxform MapModelToShape; - void collectShapeModelMapping( SdrPage const * _pPage, MapModelToShape& _rMapping ) + static void collectShapeModelMapping( SdrPage const * _pPage, MapModelToShape& _rMapping ) { OSL_ENSURE( _pPage, "collectShapeModelMapping: invalid arg!" ); diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx index a41d820da345..5fd5b35762b1 100644 --- a/svx/source/gallery2/galctrl.cxx +++ b/svx/source/gallery2/galctrl.cxx @@ -250,7 +250,7 @@ void GalleryPreview::PreviewMedia( const INetURLObject& rURL ) } } -void drawTransparenceBackground(vcl::RenderContext& rOut, const Point& rPos, const Size& rSize) +static void drawTransparenceBackground(vcl::RenderContext& rOut, const Point& rPos, const Size& rSize) { // draw checkered background diff --git a/svx/source/gengal/gengal.cxx b/svx/source/gengal/gengal.cxx index 744c80ae58a8..73c6f649ddef 100644 --- a/svx/source/gengal/gengal.cxx +++ b/svx/source/gengal/gengal.cxx @@ -188,7 +188,7 @@ void GalApp::Init() } } -std::vector<OUString> ReadResponseFile_Impl(OUString const& rInput) +static std::vector<OUString> ReadResponseFile_Impl(OUString const& rInput) { osl::File file(rInput); osl::FileBase::RC rc = file.open(osl_File_OpenFlag_Read); @@ -243,7 +243,7 @@ std::vector<OUString> ReadResponseFile_Impl(OUString const& rInput) return ret; } -void +static void ReadResponseFile(std::vector<INetURLObject> & rFiles, OUString const& rInput) { std::vector<OUString> files(ReadResponseFile_Impl(rInput)); diff --git a/svx/source/items/pageitem.cxx b/svx/source/items/pageitem.cxx index 166eff735ffc..163d4876f5be 100644 --- a/svx/source/items/pageitem.cxx +++ b/svx/source/items/pageitem.cxx @@ -73,7 +73,7 @@ bool SvxPageItem::operator==( const SfxPoolItem& rAttr ) const eUse == rItem.eUse ); } -inline OUString GetUsageText( const SvxPageUsage eU ) +static inline OUString GetUsageText( const SvxPageUsage eU ) { switch( eU ) { diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx index 037e8ace65d2..57b0bfaff55e 100644 --- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx @@ -199,12 +199,12 @@ namespace sdr { namespace contact { }; - bool operator==( const ControlHolder& _rControl, const Reference< XInterface >& _rxCompare ) + static bool operator==( const ControlHolder& _rControl, const Reference< XInterface >& _rxCompare ) { return _rControl.getControl() == _rxCompare; } - bool operator==( const ControlHolder& _rControl, const Any& _rxCompare ) + static bool operator==( const ControlHolder& _rControl, const Any& _rxCompare ) { return _rControl == Reference< XInterface >( _rxCompare, UNO_QUERY ); } @@ -274,7 +274,7 @@ namespace sdr { namespace contact { /** positions a control, and sets its zoom mode, using a given transformation and output device */ - void adjustControlGeometry_throw( const ControlHolder& _rControl, const tools::Rectangle& _rLogicBoundingRect, + static void adjustControlGeometry_throw( const ControlHolder& _rControl, const tools::Rectangle& _rLogicBoundingRect, const basegfx::B2DHomMatrix& _rViewTransformation, const ::basegfx::B2DHomMatrix& _rZoomLevelNormalization ) { OSL_PRECOND( _rControl.is(), "UnoControlContactHelper::adjustControlGeometry_throw: illegal control!" ); @@ -310,7 +310,7 @@ namespace sdr { namespace contact { /** disposes the given control */ - void disposeAndClearControl_nothrow( ControlHolder& _rControl ) + static void disposeAndClearControl_nothrow( ControlHolder& _rControl ) { try { diff --git a/svx/source/sdr/overlay/overlayselection.cxx b/svx/source/sdr/overlay/overlayselection.cxx index 13e8e4ad1e16..5d22203a4e4e 100644 --- a/svx/source/sdr/overlay/overlayselection.cxx +++ b/svx/source/sdr/overlay/overlayselection.cxx @@ -36,7 +36,7 @@ namespace sdr namespace overlay { // combine rages geometrically to a single, ORed polygon - basegfx::B2DPolyPolygon impCombineRangesToPolyPolygon(const std::vector< basegfx::B2DRange >& rRanges) + static basegfx::B2DPolyPolygon impCombineRangesToPolyPolygon(const std::vector< basegfx::B2DRange >& rRanges) { const sal_uInt32 nCount(rRanges.size()); basegfx::B2DPolyPolygon aRetval; @@ -60,7 +60,7 @@ namespace sdr // check if wanted type OverlayType::Transparent or OverlayType::Solid // is possible. If not, fallback to invert mode (classic mode) - OverlayType impCheckPossibleOverlayType(OverlayType aOverlayType) + static OverlayType impCheckPossibleOverlayType(OverlayType aOverlayType) { if(OverlayType::Invert != aOverlayType) { diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index 30269bf5344b..a9c60d9d91c6 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -2796,7 +2796,7 @@ void SdrDragCrook::TakeSdrDragComment(OUString& rStr) const #define DRAG_CROOK_RASTER_MAXIMUM (15) #define DRAG_CROOK_RASTER_DISTANCE (30) -basegfx::B2DPolyPolygon impCreateDragRaster(SdrPageView const & rPageView, const tools::Rectangle& rMarkRect) +static basegfx::B2DPolyPolygon impCreateDragRaster(SdrPageView const & rPageView, const tools::Rectangle& rMarkRect) { basegfx::B2DPolyPolygon aRetval; diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx index 93d1d87850d4..0dd66b0f14e2 100644 --- a/svx/source/svdraw/svdedtv1.cxx +++ b/svx/source/svdraw/svdedtv1.cxx @@ -1413,7 +1413,7 @@ SfxItemSet SdrEditView::GetGeoAttrFromMarked() const return aRetSet; } -Point ImpGetPoint(const tools::Rectangle& rRect, RectPoint eRP) +static Point ImpGetPoint(const tools::Rectangle& rRect, RectPoint eRP) { switch(eRP) { case RectPoint::LT: return rRect.TopLeft(); diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx index d10805516869..510b58d23b9c 100644 --- a/svx/source/svdraw/svdhdl.cxx +++ b/svx/source/svdraw/svdhdl.cxx @@ -1864,9 +1864,11 @@ struct ImplHdlAndIndex sal_uInt32 mnIndex; }; +extern "C" { + // Helper method for sorting handles taking care of OrdNums, keeping order in // single objects and re-sorting polygon handles intuitively -extern "C" int ImplSortHdlFunc( const void* pVoid1, const void* pVoid2 ) +static int ImplSortHdlFunc( const void* pVoid1, const void* pVoid2 ) { const ImplHdlAndIndex* p1 = static_cast<ImplHdlAndIndex const *>(pVoid1); const ImplHdlAndIndex* p2 = static_cast<ImplHdlAndIndex const *>(pVoid2); @@ -1940,6 +1942,7 @@ extern "C" int ImplSortHdlFunc( const void* pVoid1, const void* pVoid2 ) } } +} void SdrHdlList::TravelFocusHdl(bool bForward) { diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx index 61401a33262f..db64774aa686 100644 --- a/svx/source/svdraw/svdibrow.cxx +++ b/svx/source/svdraw/svdibrow.cxx @@ -559,7 +559,7 @@ void SdrItemBrowserControl::ImpSetEntry(const ImpItemListRow& rEntry, std::size_ } } -bool ImpGetItem(const SfxItemSet& rSet, sal_uInt16 nWhich, const SfxPoolItem*& rpItem) +static bool ImpGetItem(const SfxItemSet& rSet, sal_uInt16 nWhich, const SfxPoolItem*& rpItem) { SfxItemState eState=rSet.GetItemState(nWhich,true,&rpItem); if (eState==SfxItemState::DEFAULT) { @@ -568,7 +568,7 @@ bool ImpGetItem(const SfxItemSet& rSet, sal_uInt16 nWhich, const SfxPoolItem*& r return (eState==SfxItemState::DEFAULT || eState==SfxItemState::SET) && rpItem!=nullptr; } -bool IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16& rIndent) +static bool IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16& rIndent) { rIndent=0; if (pSet==nullptr) return false; @@ -828,7 +828,7 @@ bool IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16& rI return false; } -sal_uInt16 ImpSortWhich(sal_uInt16 nWhich) +static sal_uInt16 ImpSortWhich(sal_uInt16 nWhich) { switch (nWhich) { // Line diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index 696c7e6b7c53..c7f34d9dd3e3 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -1916,7 +1916,7 @@ void SdrModel::ReadUserDataSequenceValue(const css::beans::PropertyValue* pValue } template <typename T> -inline void addPair(std::vector< std::pair< OUString, Any > >& aUserData, const OUString& name, const T val) +static inline void addPair(std::vector< std::pair< OUString, Any > >& aUserData, const OUString& name, const T val) { aUserData.push_back(std::pair< OUString, Any >(name, css::uno::makeAny(val))); } diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index 317dd6daa40d..476d4de45a5c 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -204,7 +204,7 @@ static bool ImpVerticalSwitch( const SdrObjCustomShape& rCustoShape ) // #i37011# create a clone with all attributes changed to shadow attributes // and translation executed, too. -SdrObject* ImpCreateShadowObjectClone(const SdrObject& rOriginal, const SfxItemSet& rOriginalSet) +static SdrObject* ImpCreateShadowObjectClone(const SdrObject& rOriginal, const SfxItemSet& rOriginalSet) { SdrObject* pRetval = nullptr; const bool bShadow(rOriginalSet.Get(SDRATTR_SHADOW).GetValue()); diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index cfafb5a7785e..5a705b998c77 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -2310,7 +2310,7 @@ SdrObject* SdrObject::GetConnectedNode(bool /*bTail1*/) const } -void extractLineContourFromPrimitive2DSequence( +static void extractLineContourFromPrimitive2DSequence( const drawinglayer::primitive2d::Primitive2DContainer& rxSequence, basegfx::B2DPolygonVector& rExtractedHairlines, basegfx::B2DPolyPolygonVector& rExtractedLineFills) diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx index cbe1ce864f68..5f80317af1f1 100644 --- a/svx/source/svdraw/svdocirc.cxx +++ b/svx/source/svdraw/svdocirc.cxx @@ -53,7 +53,7 @@ using namespace com::sun::star; -Point GetAnglePnt(const tools::Rectangle& rR, long nAngle) +static Point GetAnglePnt(const tools::Rectangle& rR, long nAngle) { Point aCenter(rR.Center()); long nWdt=rR.Right()-rR.Left(); @@ -962,7 +962,7 @@ void SdrCircObj::RestGeoData(const SdrObjGeoData& rGeo) ImpSetCircInfoToAttr(); } -void Union(tools::Rectangle& rR, const Point& rP) +static void Union(tools::Rectangle& rR, const Point& rP) { if (rP.X()<rR.Left ()) rR.SetLeft(rP.X() ); if (rP.X()>rR.Right ()) rR.SetRight(rP.X() ); diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx index 24943f06d84a..c7add749df64 100644 --- a/svx/source/svdraw/svdomeas.cxx +++ b/svx/source/svdraw/svdomeas.cxx @@ -326,7 +326,7 @@ void SdrMeasureObj::ImpTakeAttr(ImpMeasureRec& rRec) const rRec.nTextAutoAngleView=static_cast<const SdrMeasureTextAutoAngleViewItem&>(rSet.Get(SDRATTR_MEASURETEXTAUTOANGLEVIEW)).GetValue(); } -long impGetLineStartEndDistance(const basegfx::B2DPolyPolygon& rPolyPolygon, long nNewWidth, bool bCenter) +static long impGetLineStartEndDistance(const basegfx::B2DPolyPolygon& rPolyPolygon, long nNewWidth, bool bCenter) { const basegfx::B2DRange aPolygonRange(rPolyPolygon.getB2DRange()); const double fOldWidth(std::max(aPolygonRange.getWidth(), 1.0)); diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx index 007cbba7d8d8..3dd12b6341af 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -57,7 +57,7 @@ using namespace sdr; -inline sal_uInt16 GetPrevPnt(sal_uInt16 nPnt, sal_uInt16 nPntMax, bool bClosed) +static inline sal_uInt16 GetPrevPnt(sal_uInt16 nPnt, sal_uInt16 nPntMax, bool bClosed) { if (nPnt>0) { nPnt--; @@ -68,7 +68,7 @@ inline sal_uInt16 GetPrevPnt(sal_uInt16 nPnt, sal_uInt16 nPntMax, bool bClosed) return nPnt; } -inline sal_uInt16 GetNextPnt(sal_uInt16 nPnt, sal_uInt16 nPntMax, bool bClosed) +static inline sal_uInt16 GetNextPnt(sal_uInt16 nPnt, sal_uInt16 nPntMax, bool bClosed) { nPnt++; if (nPnt>nPntMax || (bClosed && nPnt>=nPntMax)) nPnt=0; diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 50202370ccd7..2a520936da66 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1896,7 +1896,7 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* pEditStatus ) /* Begin chaining code */ // XXX: Make it a method somewhere? -SdrObject *ImpGetObjByName(SdrObjList const *pObjList, OUString const& aObjName) +static SdrObject *ImpGetObjByName(SdrObjList const *pObjList, OUString const& aObjName) { // scan the whole list size_t nObjCount = pObjList->GetObjCount(); @@ -1912,7 +1912,7 @@ SdrObject *ImpGetObjByName(SdrObjList const *pObjList, OUString const& aObjName) } // XXX: Make it a (private) method of SdrTextObj -void ImpUpdateChainLinks(SdrTextObj *pTextObj, OUString const& aNextLinkName) +static void ImpUpdateChainLinks(SdrTextObj *pTextObj, OUString const& aNextLinkName) { // XXX: Current implementation constraints text boxes to be on the same page diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 5a79e8818b6d..d2993c240157 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -1238,7 +1238,7 @@ void SdrTextObj::impGetBlinkTextTiming(drawinglayer::animation::AnimationEntryLi } } -void impCreateScrollTiming(const SfxItemSet& rSet, drawinglayer::animation::AnimationEntryList& rAnimList, bool bForward, double fTimeFullPath, double fFrequency) +static void impCreateScrollTiming(const SfxItemSet& rSet, drawinglayer::animation::AnimationEntryList& rAnimList, bool bForward, double fTimeFullPath, double fFrequency) { bool bVisibleWhenStopped(rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE).GetValue()); bool bVisibleWhenStarted(rSet.Get(SDRATTR_TEXT_ANISTARTINSIDE).GetValue()); @@ -1269,7 +1269,7 @@ void impCreateScrollTiming(const SfxItemSet& rSet, drawinglayer::animation::Anim } } -void impCreateAlternateTiming(const SfxItemSet& rSet, drawinglayer::animation::AnimationEntryList& rAnimList, double fRelativeTextLength, bool bForward, double fTimeFullPath, double fFrequency) +static void impCreateAlternateTiming(const SfxItemSet& rSet, drawinglayer::animation::AnimationEntryList& rAnimList, double fRelativeTextLength, bool bForward, double fTimeFullPath, double fFrequency) { if(basegfx::fTools::more(fRelativeTextLength, 0.5)) { @@ -1337,7 +1337,7 @@ void impCreateAlternateTiming(const SfxItemSet& rSet, drawinglayer::animation::A } } -void impCreateSlideTiming(const SfxItemSet& rSet, drawinglayer::animation::AnimationEntryList& rAnimList, bool bForward, double fTimeFullPath, double fFrequency) +static void impCreateSlideTiming(const SfxItemSet& rSet, drawinglayer::animation::AnimationEntryList& rAnimList, bool bForward, double fTimeFullPath, double fFrequency) { // move in from outside, start outside const double fStartPosition(bForward ? 0.0 : 1.0); diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index 636d735efd64..9f931cafd945 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -1041,7 +1041,7 @@ void SdrPageProperties::ImpAddStyleSheet(SfxStyleSheet& rNewStyleSheet) } } -void ImpPageChange(SdrPage& rSdrPage) +static void ImpPageChange(SdrPage& rSdrPage) { rSdrPage.ActionChanged(); rSdrPage.getSdrModelFromSdrPage().SetChanged(); diff --git a/svx/source/svdraw/svdtrans.cxx b/svx/source/svdraw/svdtrans.cxx index 34bb9396659b..b62aae338eae 100644 --- a/svx/source/svdraw/svdtrans.cxx +++ b/svx/source/svdraw/svdtrans.cxx @@ -572,7 +572,7 @@ long BigMulDiv(long nVal, long nMul, long nDiv) // How many eU units fit into a mm, respectively an inch? // Or: How many mm, respectively inches, are there in an eU (and then give me the inverse) -FrPair GetInchOrMM(MapUnit eU) +static FrPair GetInchOrMM(MapUnit eU) { switch (eU) { case MapUnit::Map1000thInch: return FrPair(1000,1); @@ -604,7 +604,7 @@ FrPair GetInchOrMM(MapUnit eU) return Fraction(1,1); } -FrPair GetInchOrMM(FieldUnit eU) +static FrPair GetInchOrMM(FieldUnit eU) { switch (eU) { case FUNIT_INCH : return FrPair( 1,1); @@ -660,7 +660,7 @@ FrPair GetMapFactor(FieldUnit eS, FieldUnit eD) // 1 yd = 3 ft = 36" = 914,4mm // 1 ft = 12 " = 1" = 304,8mm -void GetMeterOrInch(MapUnit eMU, short& rnComma, long& rnMul, long& rnDiv, bool& rbMetr, bool& rbInch) +static void GetMeterOrInch(MapUnit eMU, short& rnComma, long& rnMul, long& rnDiv, bool& rbMetr, bool& rbInch) { rnMul=1; rnDiv=1; short nComma=0; diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index 4abad96afbf4..36d71e008c7f 100644 --- a/svx/source/table/tablecontroller.cxx +++ b/svx/source/table/tablecontroller.cxx @@ -2304,7 +2304,7 @@ static void ImplSetLinePreserveColor( SvxBoxItem& rNewFrame, const SvxBorderLine } -void ImplApplyBoxItem( CellPosFlag nCellPosFlags, const SvxBoxItem* pBoxItem, const SvxBoxInfoItem* pBoxInfoItem, SvxBoxItem& rNewFrame ) +static void ImplApplyBoxItem( CellPosFlag nCellPosFlags, const SvxBoxItem* pBoxItem, const SvxBoxInfoItem* pBoxInfoItem, SvxBoxItem& rNewFrame ) { if (nCellPosFlags & (CellPosFlag::Before|CellPosFlag::After|CellPosFlag::Upper|CellPosFlag::Lower)) { diff --git a/svx/source/table/tablemodel.cxx b/svx/source/table/tablemodel.cxx index 76ef46d9ce7e..49eb7f2f9655 100644 --- a/svx/source/table/tablemodel.cxx +++ b/svx/source/table/tablemodel.cxx @@ -55,7 +55,7 @@ namespace sdr { namespace table { // removes the given range from a vector -template< class Vec, class Iter > void remove_range( Vec& rVector, sal_Int32 nIndex, sal_Int32 nCount ) +template< class Vec, class Iter > static void remove_range( Vec& rVector, sal_Int32 nIndex, sal_Int32 nCount ) { const sal_Int32 nSize = static_cast<sal_Int32>(rVector.size()); if( nCount && (nIndex >= 0) && (nIndex < nSize) ) @@ -74,7 +74,7 @@ template< class Vec, class Iter > void remove_range( Vec& rVector, sal_Int32 nIn /** inserts a range into a vector */ -template< class Vec, class Iter, class Entry > sal_Int32 insert_range( Vec& rVector, sal_Int32 nIndex, sal_Int32 nCount ) +template< class Vec, class Iter, class Entry > static sal_Int32 insert_range( Vec& rVector, sal_Int32 nIndex, sal_Int32 nCount ) { if( nCount ) { diff --git a/svx/source/table/tablertfexporter.cxx b/svx/source/table/tablertfexporter.cxx index edd0ff610beb..7453ebab540b 100644 --- a/svx/source/table/tablertfexporter.cxx +++ b/svx/source/table/tablertfexporter.cxx @@ -77,7 +77,7 @@ SdrTableRtfExporter::SdrTableRtfExporter( SvStream& rStrm, SdrTableObj& rObj ) { } -long HundMMToTwips( long nIn ) +static long HundMMToTwips( long nIn ) { long nRet = OutputDevice::LogicToLogic( nIn, MapUnit::Map100thMM, MapUnit::MapTwip ); return nRet; diff --git a/svx/source/table/tablertfimporter.cxx b/svx/source/table/tablertfimporter.cxx index 98a366dad788..62eb91b412d7 100644 --- a/svx/source/table/tablertfimporter.cxx +++ b/svx/source/table/tablertfimporter.cxx @@ -374,7 +374,7 @@ void SdrTableRTFParser::NextColumn() mpActDefault = nullptr; } -long TwipsToHundMM( long nIn ) +static long TwipsToHundMM( long nIn ) { long nRet = OutputDevice::LogicToLogic( nIn, MapUnit::MapTwip, MapUnit::Map100thMM ); return nRet; diff --git a/svx/source/table/viewcontactoftableobj.cxx b/svx/source/table/viewcontactoftableobj.cxx index 63ea0085a690..27100545cf02 100644 --- a/svx/source/table/viewcontactoftableobj.cxx +++ b/svx/source/table/viewcontactoftableobj.cxx @@ -148,7 +148,7 @@ namespace sdr { namespace contact { - svx::frame::Style impGetLineStyle( + static svx::frame::Style impGetLineStyle( const sdr::table::TableLayouter& rLayouter, sal_Int32 nX, sal_Int32 nY, diff --git a/svx/source/toolbars/extrusionbar.cxx b/svx/source/toolbars/extrusionbar.cxx index c7fc165671bb..cf14a4a55448 100644 --- a/svx/source/toolbars/extrusionbar.cxx +++ b/svx/source/toolbars/extrusionbar.cxx @@ -78,7 +78,7 @@ ExtrusionBar::~ExtrusionBar() SetRepeatTarget(nullptr); } -void getLightingDirectionDefaults( const Direction3D **pLighting1Defaults, const Direction3D **pLighting2Defaults ) +static void getLightingDirectionDefaults( const Direction3D **pLighting1Defaults, const Direction3D **pLighting2Defaults ) { static const Direction3D aLighting1Defaults[9] = @@ -608,7 +608,7 @@ void ExtrusionBar::execute( SdrView* pSdrView, SfxRequest const & rReq, SfxBindi } } -void getExtrusionDirectionState( SdrView const * pSdrView, SfxItemSet& rSet ) +static void getExtrusionDirectionState( SdrView const * pSdrView, SfxItemSet& rSet ) { const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); const size_t nCount = rMarkList.GetMarkCount(); @@ -755,7 +755,7 @@ void getExtrusionDirectionState( SdrView const * pSdrView, SfxItemSet& rSet ) rSet.DisableItem( SID_EXTRUSION_DIRECTION ); } -void getExtrusionProjectionState( SdrView const * pSdrView, SfxItemSet& rSet ) +static void getExtrusionProjectionState( SdrView const * pSdrView, SfxItemSet& rSet ) { const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); const size_t nCount = rMarkList.GetMarkCount(); @@ -810,7 +810,7 @@ void getExtrusionProjectionState( SdrView const * pSdrView, SfxItemSet& rSet ) rSet.DisableItem( SID_EXTRUSION_PROJECTION ); } -void getExtrusionSurfaceState( SdrView const * pSdrView, SfxItemSet& rSet ) +static void getExtrusionSurfaceState( SdrView const * pSdrView, SfxItemSet& rSet ) { const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); const size_t nCount = rMarkList.GetMarkCount(); @@ -895,7 +895,7 @@ void getExtrusionSurfaceState( SdrView const * pSdrView, SfxItemSet& rSet ) rSet.DisableItem( SID_EXTRUSION_SURFACE ); } -void getExtrusionDepthState( SdrView const * pSdrView, SfxItemSet& rSet ) +static void getExtrusionDepthState( SdrView const * pSdrView, SfxItemSet& rSet ) { const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); const size_t nCount = rMarkList.GetMarkCount(); @@ -974,7 +974,7 @@ static bool compare_direction( const Direction3D& d1, const Direction3D& d2 ) return false; } -void getExtrusionLightingDirectionState( SdrView const * pSdrView, SfxItemSet& rSet ) +static void getExtrusionLightingDirectionState( SdrView const * pSdrView, SfxItemSet& rSet ) { const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); const size_t nCount = rMarkList.GetMarkCount(); @@ -1053,7 +1053,7 @@ void getExtrusionLightingDirectionState( SdrView const * pSdrView, SfxItemSet& r rSet.DisableItem( SID_EXTRUSION_LIGHTING_DIRECTION ); } -void getExtrusionLightingIntensityState( SdrView const * pSdrView, SfxItemSet& rSet ) +static void getExtrusionLightingIntensityState( SdrView const * pSdrView, SfxItemSet& rSet ) { const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); const size_t nCount = rMarkList.GetMarkCount(); @@ -1120,7 +1120,7 @@ void getExtrusionLightingIntensityState( SdrView const * pSdrView, SfxItemSet& r rSet.DisableItem( SID_EXTRUSION_LIGHTING_INTENSITY ); } -void getExtrusionColorState( SdrView const * pSdrView, SfxItemSet& rSet ) +static void getExtrusionColorState( SdrView const * pSdrView, SfxItemSet& rSet ) { const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); const size_t nCount = rMarkList.GetMarkCount(); diff --git a/svx/source/toolbars/fontworkbar.cxx b/svx/source/toolbars/fontworkbar.cxx index cdfc32236443..b4679ba0eff0 100644 --- a/svx/source/toolbars/fontworkbar.cxx +++ b/svx/source/toolbars/fontworkbar.cxx @@ -52,7 +52,7 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::uno; -void SetAlignmentState( SdrView const * pSdrView, SfxItemSet& rSet ) +static void SetAlignmentState( SdrView const * pSdrView, SfxItemSet& rSet ) { const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); const size_t nCount = rMarkList.GetMarkCount(); @@ -95,7 +95,7 @@ void SetAlignmentState( SdrView const * pSdrView, SfxItemSet& rSet ) rSet.Put( SfxInt32Item( SID_FONTWORK_ALIGNMENT, nAlignment ) ); } -void SetCharacterSpacingState( SdrView const * pSdrView, SfxItemSet& rSet ) +static void SetCharacterSpacingState( SdrView const * pSdrView, SfxItemSet& rSet ) { const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); const size_t nCount = rMarkList.GetMarkCount(); @@ -120,7 +120,7 @@ void SetCharacterSpacingState( SdrView const * pSdrView, SfxItemSet& rSet ) } -void SetKernCharacterPairsState( SdrView const * pSdrView, SfxItemSet& rSet ) +static void SetKernCharacterPairsState( SdrView const * pSdrView, SfxItemSet& rSet ) { const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); const size_t nCount = rMarkList.GetMarkCount(); @@ -139,7 +139,7 @@ void SetKernCharacterPairsState( SdrView const * pSdrView, SfxItemSet& rSet ) rSet.Put( SfxBoolItem( SID_FONTWORK_KERN_CHARACTER_PAIRS, bChecked ) ); } -void SetFontWorkShapeTypeState( SdrView const * pSdrView, SfxItemSet& rSet ) +static void SetFontWorkShapeTypeState( SdrView const * pSdrView, SfxItemSet& rSet ) { const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); const size_t nCount = rMarkList.GetMarkCount(); @@ -319,7 +319,7 @@ static void impl_execute( SfxRequest const & rReq, SdrCustomShapeGeometryItem& r } } -void GetGeometryForCustomShape( SdrCustomShapeGeometryItem& rGeometryItem, const OUString& rCustomShape ) +static void GetGeometryForCustomShape( SdrCustomShapeGeometryItem& rGeometryItem, const OUString& rCustomShape ) { const OUString sType( "Type" ); diff --git a/svx/source/unodraw/UnoNamespaceMap.cxx b/svx/source/unodraw/UnoNamespaceMap.cxx index aa905c7ea754..33e90b738627 100644 --- a/svx/source/unodraw/UnoNamespaceMap.cxx +++ b/svx/source/unodraw/UnoNamespaceMap.cxx @@ -73,14 +73,14 @@ namespace svx return static_cast<XWeak*>(new NamespaceMap( pWhichIds, pPool )); } - Sequence< OUString > NamespaceMap_getSupportedServiceNames() + static Sequence< OUString > NamespaceMap_getSupportedServiceNames() throw() { Sequence<OUString> aSupportedServiceNames { "com.sun.star.xml.NamespaceMap" }; return aSupportedServiceNames; } - OUString NamespaceMap_getImplementationName() + static OUString NamespaceMap_getImplementationName() throw() { return OUString( "com.sun.star.comp.Svx.NamespaceMap" ); diff --git a/svx/source/unodraw/unobrushitemhelper.cxx b/svx/source/unodraw/unobrushitemhelper.cxx index 60f4c14cd52e..fe4d636a55a4 100644 --- a/svx/source/unodraw/unobrushitemhelper.cxx +++ b/svx/source/unodraw/unobrushitemhelper.cxx @@ -152,7 +152,7 @@ void setSvxBrushItemAsFillAttributesToTargetSet(const SvxBrushItem& rBrush, SfxI } } -sal_uInt16 getTransparenceForSvxBrushItem(const SfxItemSet& rSourceSet, bool bSearchInParents) +static sal_uInt16 getTransparenceForSvxBrushItem(const SfxItemSet& rSourceSet, bool bSearchInParents) { sal_uInt16 nFillTransparence(rSourceSet.Get(XATTR_FILLTRANSPARENCE, bSearchInParents).GetValue()); const SfxPoolItem* pGradientItem = nullptr; @@ -171,7 +171,7 @@ sal_uInt16 getTransparenceForSvxBrushItem(const SfxItemSet& rSourceSet, bool bSe return nFillTransparence; } -SvxBrushItem getSvxBrushItemForSolid(const SfxItemSet& rSourceSet, bool bSearchInParents, sal_uInt16 nBackgroundID) +static SvxBrushItem getSvxBrushItemForSolid(const SfxItemSet& rSourceSet, bool bSearchInParents, sal_uInt16 nBackgroundID) { Color aFillColor(rSourceSet.Get(XATTR_FILLCOLOR, bSearchInParents).GetColorValue()); diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx index 0d6c32e8a0cf..492c92a5eeb3 100644 --- a/svx/source/unodraw/unoprov.cxx +++ b/svx/source/unodraw/unoprov.cxx @@ -50,7 +50,7 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::beans::PropertyAttribute; using ::com::sun::star::drawing::TextVerticalAdjust; -SfxItemPropertyMapEntry const * ImplGetSvxShapePropertyMap() +static SfxItemPropertyMapEntry const * ImplGetSvxShapePropertyMap() { static SfxItemPropertyMapEntry const aShapePropertyMap_Impl[] = { @@ -73,7 +73,7 @@ SfxItemPropertyMapEntry const * ImplGetSvxShapePropertyMap() return aShapePropertyMap_Impl; } -SfxItemPropertyMapEntry const * ImplGetSvxTextShapePropertyMap() +static SfxItemPropertyMapEntry const * ImplGetSvxTextShapePropertyMap() { static SfxItemPropertyMapEntry const aTextShapePropertyMap_Impl[] = { @@ -96,7 +96,7 @@ SfxItemPropertyMapEntry const * ImplGetSvxTextShapePropertyMap() return aTextShapePropertyMap_Impl; } -SfxItemPropertyMapEntry const * ImplGetSvxConnectorPropertyMap() +static SfxItemPropertyMapEntry const * ImplGetSvxConnectorPropertyMap() { static SfxItemPropertyMapEntry const aConnectorPropertyMap_Impl[] = { @@ -120,7 +120,7 @@ SfxItemPropertyMapEntry const * ImplGetSvxConnectorPropertyMap() return aConnectorPropertyMap_Impl; } -SfxItemPropertyMapEntry const * ImplGetSvxDimensioningPropertyMap() +static SfxItemPropertyMapEntry const * ImplGetSvxDimensioningPropertyMap() { static SfxItemPropertyMapEntry const aDimensioningPropertyMap_Impl[] = { @@ -144,7 +144,7 @@ SfxItemPropertyMapEntry const * ImplGetSvxDimensioningPropertyMap() return aDimensioningPropertyMap_Impl; } -SfxItemPropertyMapEntry const * ImplGetSvxCirclePropertyMap() +static SfxItemPropertyMapEntry const * ImplGetSvxCirclePropertyMap() { static SfxItemPropertyMapEntry const aCirclePropertyMap_Impl[] = { @@ -168,7 +168,7 @@ SfxItemPropertyMapEntry const * ImplGetSvxCirclePropertyMap() return aCirclePropertyMap_Impl; } -SfxItemPropertyMapEntry const * ImplGetSvxPolyPolygonPropertyMap() +static SfxItemPropertyMapEntry const * ImplGetSvxPolyPolygonPropertyMap() { static SfxItemPropertyMapEntry const aPolyPolygonPropertyMap_Impl[] = { @@ -194,7 +194,7 @@ SfxItemPropertyMapEntry const * ImplGetSvxPolyPolygonPropertyMap() return aPolyPolygonPropertyMap_Impl; } -SfxItemPropertyMapEntry const * ImplGetSvxGraphicObjectPropertyMap() +static SfxItemPropertyMapEntry const * ImplGetSvxGraphicObjectPropertyMap() { static SfxItemPropertyMapEntry const aGraphicObjectPropertyMap_Impl[] = { @@ -225,7 +225,7 @@ SfxItemPropertyMapEntry const * ImplGetSvxGraphicObjectPropertyMap() return aGraphicObjectPropertyMap_Impl; } -SfxItemPropertyMapEntry const * ImplGetSvx3DSceneObjectPropertyMap() +static SfxItemPropertyMapEntry const * ImplGetSvx3DSceneObjectPropertyMap() { static SfxItemPropertyMapEntry const a3DSceneObjectPropertyMap_Impl[] = { @@ -243,7 +243,7 @@ SfxItemPropertyMapEntry const * ImplGetSvx3DSceneObjectPropertyMap() return a3DSceneObjectPropertyMap_Impl; } -SfxItemPropertyMapEntry const * ImplGetSvx3DCubeObjectPropertyMap() +static SfxItemPropertyMapEntry const * ImplGetSvx3DCubeObjectPropertyMap() { static SfxItemPropertyMapEntry const a3DCubeObjectPropertyMap_Impl[] = { @@ -264,7 +264,7 @@ SfxItemPropertyMapEntry const * ImplGetSvx3DCubeObjectPropertyMap() return a3DCubeObjectPropertyMap_Impl; } -SfxItemPropertyMapEntry const * ImplGetSvx3DSphereObjectPropertyMap() +static SfxItemPropertyMapEntry const * ImplGetSvx3DSphereObjectPropertyMap() { static SfxItemPropertyMapEntry const a3DSphereObjectPropertyMap_Impl[] = { @@ -284,7 +284,7 @@ SfxItemPropertyMapEntry const * ImplGetSvx3DSphereObjectPropertyMap() return a3DSphereObjectPropertyMap_Impl; } -SfxItemPropertyMapEntry const * ImplGetSvx3DLatheObjectPropertyMap() +static SfxItemPropertyMapEntry const * ImplGetSvx3DLatheObjectPropertyMap() { static SfxItemPropertyMapEntry const a3DLatheObjectPropertyMap_Impl[] = { @@ -310,7 +310,7 @@ SfxItemPropertyMapEntry const * ImplGetSvx3DLatheObjectPropertyMap() return a3DLatheObjectPropertyMap_Impl; } -SfxItemPropertyMapEntry const * ImplGetSvx3DExtrudeObjectPropertyMap() +static SfxItemPropertyMapEntry const * ImplGetSvx3DExtrudeObjectPropertyMap() { static SfxItemPropertyMapEntry const a3DExtrudeObjectPropertyMap_Impl[] = { @@ -336,7 +336,7 @@ SfxItemPropertyMapEntry const * ImplGetSvx3DExtrudeObjectPropertyMap() return a3DExtrudeObjectPropertyMap_Impl; } -SfxItemPropertyMapEntry const * ImplGetSvx3DPolygonObjectPropertyMap() +static SfxItemPropertyMapEntry const * ImplGetSvx3DPolygonObjectPropertyMap() { static SfxItemPropertyMapEntry const a3DPolygonObjectPropertyMap_Impl[] = { @@ -357,7 +357,7 @@ SfxItemPropertyMapEntry const * ImplGetSvx3DPolygonObjectPropertyMap() return a3DPolygonObjectPropertyMap_Impl; } -SfxItemPropertyMapEntry const * ImplGetSvxAllPropertyMap() +static SfxItemPropertyMapEntry const * ImplGetSvxAllPropertyMap() { static SfxItemPropertyMapEntry const aAllPropertyMap_Impl[] = { @@ -399,7 +399,7 @@ SfxItemPropertyMapEntry const * ImplGetSvxAllPropertyMap() return aAllPropertyMap_Impl; } -SfxItemPropertyMapEntry const * ImplGetSvxGroupPropertyMap() +static SfxItemPropertyMapEntry const * ImplGetSvxGroupPropertyMap() { static SfxItemPropertyMapEntry const aGroupPropertyMap_Impl[] = { @@ -412,7 +412,7 @@ SfxItemPropertyMapEntry const * ImplGetSvxGroupPropertyMap() return aGroupPropertyMap_Impl; } -SfxItemPropertyMapEntry const * ImplGetSvxOle2PropertyMap() +static SfxItemPropertyMapEntry const * ImplGetSvxOle2PropertyMap() { static SfxItemPropertyMapEntry const aOle2PropertyMap_Impl[] = { @@ -445,7 +445,7 @@ SfxItemPropertyMapEntry const * ImplGetSvxOle2PropertyMap() return aOle2PropertyMap_Impl; } -SfxItemPropertyMapEntry const * ImplGetSvxPluginPropertyMap() +static SfxItemPropertyMapEntry const * ImplGetSvxPluginPropertyMap() { static SfxItemPropertyMapEntry const aPluginPropertyMap_Impl[] = { @@ -475,7 +475,7 @@ SfxItemPropertyMapEntry const * ImplGetSvxPluginPropertyMap() return aPluginPropertyMap_Impl; } -SfxItemPropertyMapEntry const * ImplGetSvxFramePropertyMap() +static SfxItemPropertyMapEntry const * ImplGetSvxFramePropertyMap() { //TODO/LATER: new properties for ScrollingMode and DefaultBorder static SfxItemPropertyMapEntry const aFramePropertyMap_Impl[] = @@ -509,7 +509,7 @@ SfxItemPropertyMapEntry const * ImplGetSvxFramePropertyMap() return aFramePropertyMap_Impl; } -SfxItemPropertyMapEntry const * ImplGetSvxAppletPropertyMap() +static SfxItemPropertyMapEntry const * ImplGetSvxAppletPropertyMap() { static SfxItemPropertyMapEntry const aAppletPropertyMap_Impl[] = { @@ -542,7 +542,7 @@ SfxItemPropertyMapEntry const * ImplGetSvxAppletPropertyMap() return aAppletPropertyMap_Impl; } -SfxItemPropertyMapEntry const * ImplGetSvxControlShapePropertyMap() +static SfxItemPropertyMapEntry const * ImplGetSvxControlShapePropertyMap() { static SfxItemPropertyMapEntry const aControlPropertyMap_Impl[] = { @@ -599,7 +599,7 @@ SfxItemPropertyMapEntry const * ImplGetSvxControlShapePropertyMap() return aControlPropertyMap_Impl; } -SfxItemPropertyMapEntry const * ImplGetSvxPageShapePropertyMap() +static SfxItemPropertyMapEntry const * ImplGetSvxPageShapePropertyMap() { static SfxItemPropertyMapEntry const aPageShapePropertyMap_Impl[] = { @@ -622,7 +622,7 @@ SfxItemPropertyMapEntry const * ImplGetSvxPageShapePropertyMap() return aPageShapePropertyMap_Impl; } -SfxItemPropertyMapEntry const * ImplGetSvxCaptionPropertyMap() +static SfxItemPropertyMapEntry const * ImplGetSvxCaptionPropertyMap() { static SfxItemPropertyMapEntry const aCaptionPropertyMap_Impl[] = { @@ -656,7 +656,7 @@ SfxItemPropertyMapEntry const * ImplGetSvxCaptionPropertyMap() return aCaptionPropertyMap_Impl; } -SfxItemPropertyMapEntry const * ImplGetSvxCustomShapePropertyMap() +static SfxItemPropertyMapEntry const * ImplGetSvxCustomShapePropertyMap() { static SfxItemPropertyMapEntry const aCustomShapePropertyMap_Impl[] = { @@ -679,7 +679,7 @@ SfxItemPropertyMapEntry const * ImplGetSvxCustomShapePropertyMap() return aCustomShapePropertyMap_Impl; } -SfxItemPropertyMapEntry const * ImplGetSvxMediaShapePropertyMap() +static SfxItemPropertyMapEntry const * ImplGetSvxMediaShapePropertyMap() { static SfxItemPropertyMapEntry const aMediaShapePropertyMap_Impl[] = { @@ -711,7 +711,7 @@ SfxItemPropertyMapEntry const * ImplGetSvxMediaShapePropertyMap() return aMediaShapePropertyMap_Impl; } -SfxItemPropertyMapEntry const * ImplGetSvxTableShapePropertyMap() +static SfxItemPropertyMapEntry const * ImplGetSvxTableShapePropertyMap() { static SfxItemPropertyMapEntry const aTableShapePropertyMap_Impl[] = { @@ -742,7 +742,7 @@ SfxItemPropertyMapEntry const * ImplGetSvxTableShapePropertyMap() return aTableShapePropertyMap_Impl; } -comphelper::PropertyMapEntry const * ImplGetSvxDrawingDefaultsPropertyMap() +static comphelper::PropertyMapEntry const * ImplGetSvxDrawingDefaultsPropertyMap() { static comphelper::PropertyMapEntry const aSvxDrawingDefaultsPropertyMap_Impl[] = { @@ -762,7 +762,7 @@ comphelper::PropertyMapEntry const * ImplGetSvxDrawingDefaultsPropertyMap() return aSvxDrawingDefaultsPropertyMap_Impl; } -comphelper::PropertyMapEntry const * ImplGetAdditionalWriterDrawingDefaultsPropertyMap() +static comphelper::PropertyMapEntry const * ImplGetAdditionalWriterDrawingDefaultsPropertyMap() { static comphelper::PropertyMapEntry const aSvxAdditionalDefaultsPropertyMap_Impl[] = { @@ -1467,7 +1467,7 @@ static const char* RID_SVXSTR_TRASNGR[] = RID_SVXSTR_TRASNGR0 }; -bool SvxUnoGetResourceRanges( const sal_uInt16 nWhich, const char**& pApiResIds, const char**& pIntResIds, int& nCount ) throw() +static bool SvxUnoGetResourceRanges( const sal_uInt16 nWhich, const char**& pApiResIds, const char**& pIntResIds, int& nCount ) throw() { switch( nWhich ) { @@ -1514,7 +1514,7 @@ bool SvxUnoGetResourceRanges( const sal_uInt16 nWhich, const char**& pApiResIds, } /// @throws std::exception -bool SvxUnoConvertResourceString(const char **pSourceResIds, const char** pDestResIds, int nCount, OUString& rString, bool bToApi) +static bool SvxUnoConvertResourceString(const char **pSourceResIds, const char** pDestResIds, int nCount, OUString& rString, bool bToApi) { // first, calculate the search string length without an optional number after the name sal_Int32 nLength = rString.getLength(); @@ -1749,7 +1749,7 @@ static const char* SvxUnoColorNameResId[] = }; /// @throws std::exception -bool SvxUnoConvertResourceStringBuiltIn(const char** pSourceResIds, const char** pDestResIds, int nCount, OUString& rString, bool bToApi) +static bool SvxUnoConvertResourceStringBuiltIn(const char** pSourceResIds, const char** pDestResIds, int nCount, OUString& rString, bool bToApi) { //We replace e.g. "Gray 10%" with the translation of Gray, but we shouldn't //replace "Red Hat 1" with the translation of Red :-) diff --git a/svx/source/unodraw/unoshap3.cxx b/svx/source/unodraw/unoshap3.cxx index 4873ff2dc0cb..0e487d0c7888 100644 --- a/svx/source/unodraw/unoshap3.cxx +++ b/svx/source/unodraw/unoshap3.cxx @@ -649,7 +649,7 @@ Svx3DLatheObject::~Svx3DLatheObject() throw() { } -bool PolyPolygonShape3D_to_B3dPolyPolygon( +static bool PolyPolygonShape3D_to_B3dPolyPolygon( const Any& rValue, basegfx::B3DPolyPolygon& rResultPolygon, bool bCorrectPolygon) diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 6f68c8611241..0bd7c77fb017 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -605,7 +605,7 @@ void SvxShape::ForceMetricTo100th_mm(basegfx::B2DHomMatrix& rB2DHomMatrix) const } } -void SvxItemPropertySet_ObtainSettingsFromPropertySet(const SvxItemPropertySet& rPropSet, +static void SvxItemPropertySet_ObtainSettingsFromPropertySet(const SvxItemPropertySet& rPropSet, SfxItemSet& rSet, const uno::Reference< beans::XPropertySet >& xSet, const SfxItemPropertyMap* pMap ) { if(rPropSet.AreThereOwnUsrAnys()) diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx index 305c9fe410fd..d22b3d667f76 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -65,7 +65,7 @@ using namespace ::com::sun::star; -long ScaleMetricValue( long nVal, long nMul, long nDiv ) +static long ScaleMetricValue( long nVal, long nMul, long nDiv ) { BigInt aVal( nVal ); diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx index f0055671a58a..7c2dd6176373 100644 --- a/sw/qa/core/uwriter.cxx +++ b/sw/qa/core/uwriter.cxx @@ -289,7 +289,7 @@ void SwDocTest::testUserPerceivedCharCount() CPPUNIT_ASSERT_EQUAL_MESSAGE("Surrogate Pair should be counted as single character", static_cast<sal_Int32>(1), nCount); } -SwTextNode* getModelToViewTestDocument(SwDoc *pDoc) +static SwTextNode* getModelToViewTestDocument(SwDoc *pDoc) { SwNodeIndex aIdx(pDoc->GetNodes().GetEndOfContent(), -1); SwPaM aPaM(aIdx); @@ -334,7 +334,7 @@ SwTextNode* getModelToViewTestDocument(SwDoc *pDoc) return pTextNode; } -SwTextNode* getModelToViewTestDocument2(SwDoc *pDoc) +static SwTextNode* getModelToViewTestDocument2(SwDoc *pDoc) { getModelToViewTestDocument(pDoc); diff --git a/sw/qa/extras/globalfilter/globalfilter.cxx b/sw/qa/extras/globalfilter/globalfilter.cxx index 088e6b7658be..5c935a97ac56 100644 --- a/sw/qa/extras/globalfilter/globalfilter.cxx +++ b/sw/qa/extras/globalfilter/globalfilter.cxx @@ -272,7 +272,7 @@ void Test::testImageWithSpecialID() } /// Gives the first embedded or linked image in a document. -uno::Reference<drawing::XShape> lcl_getShape(const uno::Reference<lang::XComponent>& xComponent, bool bEmbedded) +static uno::Reference<drawing::XShape> lcl_getShape(const uno::Reference<lang::XComponent>& xComponent, bool bEmbedded) { uno::Reference<drawing::XShape> xShape; diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index ab993fb28439..6bc124027511 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -108,7 +108,7 @@ DECLARE_ODFEXPORT_TEST(testMathObjectFlatExport, "2_MathType3.docx") CPPUNIT_ASSERT_EQUAL(OUString(" size 12{2+2=4} {}"), formula2); } -void testTdf43569_CheckIfFieldParse() +static void testTdf43569_CheckIfFieldParse() { { const OUString fieldDefinition("IF A B C"); diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx index 3b879d9f82ff..bd31b56d3e76 100644 --- a/sw/qa/extras/odfimport/odfimport.cxx +++ b/sw/qa/extras/odfimport/odfimport.cxx @@ -486,7 +486,7 @@ DECLARE_ODFIMPORT_TEST(testFdo55814, "fdo55814.odt") CPPUNIT_ASSERT_EQUAL(OUString("Hide==\"Yes\""), getProperty<OUString>(xSections->getByIndex(0), "Condition")); } -void lcl_CheckShape( +static void lcl_CheckShape( uno::Reference<drawing::XShape> const& xShape, OUString const& rExpected) { uno::Reference<container::XNamed> const xNamed(xShape, uno::UNO_QUERY); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx index 0ee86d675247..6f862ef90b5c 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx @@ -221,7 +221,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo51034, "fdo51034.odt") // Remove all spaces, as LO export/import may change that. // Replace symbol - (i.e. U+2212) with ASCII - , LO does this change and it shouldn't matter. -void CHECK_FORMULA(OUString const & expected, OUString const & actual) { +static void CHECK_FORMULA(OUString const & expected, OUString const & actual) { CPPUNIT_ASSERT_EQUAL( expected.replaceAll( " ", "" ).replaceAll( OUString(u"\u2212"), "-" ), actual.replaceAll( " ", "" ).replaceAll( OUString(u"\u2212"), "-" )); diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 2140f4c1dccb..cf165fbdb1fa 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -628,7 +628,7 @@ DECLARE_OOXMLIMPORT_TEST(testGroupshapeSdt, "groupshape-sdt.docx") CPPUNIT_ASSERT_EQUAL(sal_Int32(20), getProperty<sal_Int32>(getRun(getParagraphOfText(1, xShape->getText()), 1), "CharKerning")); } -void lcl_countTextFrames(const css::uno::Reference< lang::XComponent >& xComponent, +static void lcl_countTextFrames(const css::uno::Reference< lang::XComponent >& xComponent, sal_Int32 nExpected ) { uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(xComponent, uno::UNO_QUERY); diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx index df913f7f9e7f..286b6ddd721c 100644 --- a/sw/qa/extras/tiledrendering/tiledrendering.cxx +++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx @@ -454,7 +454,7 @@ void SwTiledRenderingTest::testResetSelection() CPPUNIT_ASSERT(!pWrtShell->IsSelFrameMode()); } -void lcl_search(bool bBackward) +static void lcl_search(bool bBackward) { uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence( { diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 8a2537a2292a..0bb8c12afab1 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -3957,7 +3957,7 @@ void SwUiWriterTest::testShapeAnchorUndo() CPPUNIT_ASSERT_EQUAL(pObject->GetLogicRect(), aOrigLogicRect); } -void lcl_dispatchCommand(const uno::Reference<lang::XComponent>& xComponent, const OUString& rCommand, const uno::Sequence<beans::PropertyValue>& rPropertyValues) +static void lcl_dispatchCommand(const uno::Reference<lang::XComponent>& xComponent, const OUString& rCommand, const uno::Sequence<beans::PropertyValue>& rPropertyValues) { uno::Reference<frame::XController> xController = uno::Reference<frame::XModel>(xComponent, uno::UNO_QUERY)->getCurrentController(); CPPUNIT_ASSERT(xController.is()); diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index 8d7b01d4da53..c7bd35214480 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -1066,7 +1066,7 @@ uno::Sequence< OUString > SAL_CALL SwAccessibleParagraph::getSupportedServiceNam return aRet; } -uno::Sequence< OUString > const & getAttributeNames() +static uno::Sequence< OUString > const & getAttributeNames() { static uno::Sequence< OUString >* pNames = nullptr; @@ -1099,7 +1099,7 @@ uno::Sequence< OUString > const & getAttributeNames() return *pNames; } -uno::Sequence< OUString > const & getSupplementalAttributeNames() +static uno::Sequence< OUString > const & getSupplementalAttributeNames() { static uno::Sequence< OUString >* pNames = nullptr; diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx index 73d0a5050f93..770dffbf47c8 100644 --- a/sw/source/core/bastyp/calc.cxx +++ b/sw/source/core/bastyp/calc.cxx @@ -181,7 +181,7 @@ CalcOp* FindOperator( const OUString& rSrch ) OperatorCompare )); } -inline LanguageType GetDocAppScriptLang( SwDoc const & rDoc ) +static inline LanguageType GetDocAppScriptLang( SwDoc const & rDoc ) { return static_cast<const SvxLanguageItem&>(rDoc.GetDefault( GetWhichOfScript( RES_CHRATR_LANGUAGE, diff --git a/sw/source/core/bastyp/swregion.cxx b/sw/source/core/bastyp/swregion.cxx index cd87db46817a..8462cd90f252 100644 --- a/sw/source/core/bastyp/swregion.cxx +++ b/sw/source/core/bastyp/swregion.cxx @@ -135,7 +135,7 @@ void SwRegionRects::Invert() swap( aInvRegion ); } -inline SwTwips CalcArea( const SwRect &rRect ) +static inline SwTwips CalcArea( const SwRect &rRect ) { return rRect.Width() * rRect.Height(); } diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index e65bafc8fec8..6dc236921d9b 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -79,7 +79,7 @@ using namespace util; * Check if pCurrentCursor points into already existing ranges and delete those. * @param Pointer to SwCursor object */ -void CheckRange( SwCursor* pCurrentCursor ) +static void CheckRange( SwCursor* pCurrentCursor ) { const SwPosition *pStt = pCurrentCursor->Start(), *pEnd = pCurrentCursor->GetPoint() == pStt ? pCurrentCursor->GetMark() : pCurrentCursor->GetPoint(); diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index ac00e8742990..5c74dd1eccaf 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -638,7 +638,7 @@ const SwTOXMark& SwCursorShell::GotoTOXMark( const SwTOXMark& rStart, } /// jump to next/previous field type -void lcl_MakeFieldLst( +static void lcl_MakeFieldLst( SetGetExpFields& rLst, const SwFieldType& rFieldType, const bool bInReadOnly, diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx index 31d299a34fba..d0b38b1288df 100644 --- a/sw/source/core/crsr/findattr.cxx +++ b/sw/source/core/crsr/findattr.cxx @@ -54,7 +54,7 @@ using namespace ::com::sun::star::util; typedef std::set<SwFormat*> SwpFormats; // Special case for SvxFontItem: only compare the name -bool CmpAttr( const SfxPoolItem& rItem1, const SfxPoolItem& rItem2 ) +static bool CmpAttr( const SfxPoolItem& rItem1, const SfxPoolItem& rItem2 ) { switch( rItem1.Which() ) { diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx index 243699f5de91..4417ed395f48 100644 --- a/sw/source/core/crsr/findtxt.cxx +++ b/sw/source/core/crsr/findtxt.cxx @@ -197,7 +197,7 @@ lcl_CleanStr(const SwTextNode& rNd, sal_Int32 const nStart, sal_Int32& rEnd, } // skip all non SwPostIts inside the array -size_t GetPostIt(sal_Int32 aCount,const SwpHints *pHts) +static size_t GetPostIt(sal_Int32 aCount,const SwpHints *pHts) { size_t aIndex = 0; while (aCount) diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx index 9f5fc230841a..31e54222d064 100644 --- a/sw/source/core/crsr/pam.cxx +++ b/sw/source/core/crsr/pam.cxx @@ -46,7 +46,7 @@ #include <editsh.hxx> // for the dump "MSC-" compiler -inline sal_Int32 GetSttOrEnd( bool bCondition, const SwContentNode& rNd ) +static inline sal_Int32 GetSttOrEnd( bool bCondition, const SwContentNode& rNd ) { return bCondition ? 0 : rNd.Len(); } diff --git a/sw/source/core/crsr/trvlfnfl.cxx b/sw/source/core/crsr/trvlfnfl.cxx index c0fa6a288320..b488f6b426d3 100644 --- a/sw/source/core/crsr/trvlfnfl.cxx +++ b/sw/source/core/crsr/trvlfnfl.cxx @@ -162,13 +162,13 @@ bool SwCursorShell::GotoFootnoteAnchor() return bRet; } -inline bool CmpLE( const SwTextFootnote& rFootnote, sal_uLong nNd, sal_Int32 nCnt ) +static inline bool CmpLE( const SwTextFootnote& rFootnote, sal_uLong nNd, sal_Int32 nCnt ) { const sal_uLong nTNd = rFootnote.GetTextNode().GetIndex(); return nTNd < nNd || ( nTNd == nNd && rFootnote.GetStart() <= nCnt ); } -inline bool CmpL( const SwTextFootnote& rFootnote, sal_uLong nNd, sal_Int32 nCnt ) +static inline bool CmpL( const SwTextFootnote& rFootnote, sal_uLong nNd, sal_Int32 nCnt ) { const sal_uLong nTNd = rFootnote.GetTextNode().GetIndex(); return nTNd < nNd || ( nTNd == nNd && rFootnote.GetStart() < nCnt ); diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx b/sw/source/core/doc/DocumentStylePoolManager.cxx index aafd5fffab7f..d397be625b26 100644 --- a/sw/source/core/doc/DocumentStylePoolManager.cxx +++ b/sw/source/core/doc/DocumentStylePoolManager.cxx @@ -2538,7 +2538,7 @@ std::vector<OUString> *SwStyleNameMapper::s_pTextUINameArray = nullptr, *SwStyleNameMapper::s_pTableStyleUINameArray = nullptr, *SwStyleNameMapper::s_pCellStyleUINameArray = nullptr; -std::vector<OUString>* +static std::vector<OUString>* lcl_NewUINameArray(const char** pIds, const size_t nLen, const size_t nSvxIds = 0) { assert(nSvxIds <= nLen); diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx index bf51116f14c6..a670fc83ded4 100644 --- a/sw/source/core/doc/dbgoutsw.cxx +++ b/sw/source/core/doc/dbgoutsw.cxx @@ -92,7 +92,7 @@ const char * dbg_out(const OUString & aStr) return aDbgOutResult.getStr(); } -map<sal_uInt16,OUString> & GetItemWhichMap() +static map<sal_uInt16,OUString> & GetItemWhichMap() { static map<sal_uInt16,OUString> aItemWhichMap; static bool bInitialized = false; diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx index 4484ff45dd2c..3ddbf4bc96ad 100644 --- a/sw/source/core/doc/docglbl.cxx +++ b/sw/source/core/doc/docglbl.cxx @@ -84,7 +84,7 @@ bool SwDoc::GenerateHTMLDoc( const OUString& rPath, } // two helpers for outline mode -SwNodePtr GetStartNode( SwOutlineNodes const * pOutlNds, int nOutlineLevel, SwOutlineNodes::size_type* nOutl ) +static SwNodePtr GetStartNode( SwOutlineNodes const * pOutlNds, int nOutlineLevel, SwOutlineNodes::size_type* nOutl ) { SwNodePtr pNd; @@ -97,7 +97,7 @@ SwNodePtr GetStartNode( SwOutlineNodes const * pOutlNds, int nOutlineLevel, SwOu return nullptr; } -SwNodePtr GetEndNode( SwOutlineNodes const * pOutlNds, int nOutlineLevel, SwOutlineNodes::size_type* nOutl ) +static SwNodePtr GetEndNode( SwOutlineNodes const * pOutlNds, int nOutlineLevel, SwOutlineNodes::size_type* nOutl ) { SwNodePtr pNd; @@ -117,7 +117,7 @@ SwNodePtr GetEndNode( SwOutlineNodes const * pOutlNds, int nOutlineLevel, SwOutl } // two helpers for collection mode -SwNodePtr GetStartNode( const SwOutlineNodes* pOutlNds, const SwTextFormatColl* pSplitColl, SwOutlineNodes::size_type* nOutl ) +static SwNodePtr GetStartNode( const SwOutlineNodes* pOutlNds, const SwTextFormatColl* pSplitColl, SwOutlineNodes::size_type* nOutl ) { SwNodePtr pNd; for( ; *nOutl < pOutlNds->size(); ++(*nOutl) ) @@ -130,7 +130,7 @@ SwNodePtr GetStartNode( const SwOutlineNodes* pOutlNds, const SwTextFormatColl* return nullptr; } -SwNodePtr GetEndNode( const SwOutlineNodes* pOutlNds, const SwTextFormatColl* pSplitColl, SwOutlineNodes::size_type* nOutl ) +static SwNodePtr GetEndNode( const SwOutlineNodes* pOutlNds, const SwTextFormatColl* pSplitColl, SwOutlineNodes::size_type* nOutl ) { SwNodePtr pNd; diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index 1b975dc48942..4300f5a3c2c8 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -85,7 +85,7 @@ namespace { } } -inline sal_uInt8 GetUpperLvlChg( sal_uInt8 nCurLvl, sal_uInt8 nLevel, sal_uInt16 nMask ) +static inline sal_uInt8 GetUpperLvlChg( sal_uInt8 nCurLvl, sal_uInt8 nLevel, sal_uInt16 nMask ) { if( 1 < nLevel ) { diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index e023f77f11ac..e8ad85df185d 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -107,7 +107,7 @@ void SwExtraRedlineTable::dumpAsXml(xmlTextWriterPtr pWriter) const } #if OSL_DEBUG_LEVEL > 0 -bool CheckPosition( const SwPosition* pStt, const SwPosition* pEnd ) +static bool CheckPosition( const SwPosition* pStt, const SwPosition* pEnd ) { int nError = 0; SwNode* pSttNode = &pStt->nNode.GetNode(); diff --git a/sw/source/core/doc/gctable.cxx b/sw/source/core/doc/gctable.cxx index aeab4b21521a..55e00d45e104 100644 --- a/sw/source/core/doc/gctable.cxx +++ b/sw/source/core/doc/gctable.cxx @@ -25,7 +25,7 @@ using namespace ::editeng; -inline const SvxBorderLine* GetLineTB( const SvxBoxItem* pBox, bool bTop ) +static inline const SvxBorderLine* GetLineTB( const SvxBoxItem* pBox, bool bTop ) { return bTop ? pBox->GetTop() : pBox->GetBottom(); } diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index 5755a37472bc..b0c228967859 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -83,7 +83,7 @@ using namespace com::sun::star; -inline bool GetRealURL( const SwGrfNode& rNd, OUString& rText ) +static inline bool GetRealURL( const SwGrfNode& rNd, OUString& rText ) { bool bRet = rNd.GetFileFilterNms( &rText, nullptr ); if( bRet ) @@ -880,7 +880,7 @@ static void lcl_correctlyAlignRect( SwRect& rAlignedGrfArea, const SwRect& rInAr } } -bool paintUsingPrimitivesHelper( +static bool paintUsingPrimitivesHelper( vcl::RenderContext& rOutputDevice, const drawinglayer::primitive2d::Primitive2DContainer& rSequence, const basegfx::B2DRange& rSourceRange, diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx index 9551e4480f9d..384ae1e3adbe 100644 --- a/sw/source/core/doc/tblrwcl.cxx +++ b/sw/source/core/doc/tblrwcl.cxx @@ -469,7 +469,7 @@ static void lcl_InsCol( FndLine_* pFndLn, CpyPara& rCpyPara, sal_uInt16 nCpyCnt, } } -SwRowFrame* GetRowFrame( SwTableLine& rLine ) +static SwRowFrame* GetRowFrame( SwTableLine& rLine ) { SwIterator<SwRowFrame,SwFormat> aIter( *rLine.GetFrameFormat() ); for( SwRowFrame* pFrame = aIter.First(); pFrame; pFrame = aIter.Next() ) @@ -2825,7 +2825,7 @@ static bool lcl_InsOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam, // SwComparePosition::Equal, // Box and start/end are the same // SwComparePosition::OverlapBefore, // Box overlapps the start // SwComparePosition::OverlapBehind // Box overlapps the end -SwComparePosition CheckBoxInRange( sal_uInt16 nStt, sal_uInt16 nEnd, +static SwComparePosition CheckBoxInRange( sal_uInt16 nStt, sal_uInt16 nEnd, sal_uInt16 nBoxStt, sal_uInt16 nBoxEnd ) { // Still treat COLFUZZY! @@ -3898,7 +3898,7 @@ static FndBox_* lcl_SaveInsDelData( CR_SetLineHeight& rParam, SwUndo** ppUndo, return pFndBox; } -void SetLineHeight( SwTableLine& rLine, SwTwips nOldHeight, SwTwips nNewHeight, +static void SetLineHeight( SwTableLine& rLine, SwTwips nOldHeight, SwTwips nNewHeight, bool bMinSize ) { SwLayoutFrame* pLineFrame = GetRowFrame( rLine ); diff --git a/sw/source/core/doc/textboxhelper.cxx b/sw/source/core/doc/textboxhelper.cxx index acd112c17c2b..45fce1328985 100644 --- a/sw/source/core/doc/textboxhelper.cxx +++ b/sw/source/core/doc/textboxhelper.cxx @@ -258,7 +258,7 @@ SwFrameFormat* SwTextBoxHelper::getOtherTextBoxFormat(uno::Reference<drawing::XS return getOtherTextBoxFormat(pFormat, RES_DRAWFRMFMT); } -template <typename T> void lcl_queryInterface(SwFrameFormat* pShape, uno::Any& rAny) +template <typename T> static void lcl_queryInterface(SwFrameFormat* pShape, uno::Any& rAny) { if (SwFrameFormat* pFormat = SwTextBoxHelper::getOtherTextBoxFormat(pShape, RES_DRAWFRMFMT)) { diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx index ff35893cd1e2..fabde76a4c80 100644 --- a/sw/source/core/docnode/ndtbl1.cxx +++ b/sw/source/core/docnode/ndtbl1.cxx @@ -59,7 +59,7 @@ using namespace ::com::sun::star; // See swtable.cxx too #define COLFUZZY 20L -inline bool IsSame( long nA, long nB ) { return std::abs(nA-nB) <= COLFUZZY; } +static inline bool IsSame( long nA, long nB ) { return std::abs(nA-nB) <= COLFUZZY; } // SwTableLine::ChgFrameFormat may delete old format which doesn't have writer listeners anymore. // This may invalidate my pointers, and lead to use-after-free. For this reason, I register myself @@ -157,7 +157,7 @@ static bool lcl_GetBoxSel( const SwCursor& rCursor, SwSelBoxes& rBoxes, return !rBoxes.empty(); } -inline void InsertLine( std::vector<SwTableLine*>& rLineArr, SwTableLine* pLine ) +static inline void InsertLine( std::vector<SwTableLine*>& rLineArr, SwTableLine* pLine ) { if( rLineArr.end() == std::find( rLineArr.begin(), rLineArr.end(), pLine ) ) rLineArr.push_back( pLine ); @@ -186,9 +186,9 @@ struct LinesAndTable m_rLines(rL), m_rTable(rTable), m_bInsertLines(true) {} }; -bool FindLine_( FndLine_ & rLine, LinesAndTable* pPara ); +static bool FindLine_( FndLine_ & rLine, LinesAndTable* pPara ); -bool FindBox_( FndBox_ & rBox, LinesAndTable* pPara ) +static bool FindBox_( FndBox_ & rBox, LinesAndTable* pPara ) { if (!rBox.GetLines().empty()) { @@ -533,7 +533,7 @@ bool SwDoc::GetRowBackground( const SwCursor& rCursor, SvxBrushItem &rToFill ) return bRet; } -inline void InsertCell( std::vector<SwCellFrame*>& rCellArr, SwCellFrame* pCellFrame ) +static inline void InsertCell( std::vector<SwCellFrame*>& rCellArr, SwCellFrame* pCellFrame ) { if( rCellArr.end() == std::find( rCellArr.begin(), rCellArr.end(), pCellFrame ) ) rCellArr.push_back( pCellFrame ); diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 66bd7395d990..069e9bc9f9e3 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -84,7 +84,7 @@ using namespace ::com::sun::star::i18n; namespace AttrSetHandleHelper { -void GetNewAutoStyle( std::shared_ptr<const SfxItemSet>& rpAttrSet, +static void GetNewAutoStyle( std::shared_ptr<const SfxItemSet>& rpAttrSet, const SwContentNode& rNode, SwAttrSet const & rNewAttrSet ) { @@ -99,7 +99,7 @@ void GetNewAutoStyle( std::shared_ptr<const SfxItemSet>& rpAttrSet, rNode.SetModifyAtAttr( bSetModifyAtAttr ); } -void SetParent( std::shared_ptr<const SfxItemSet>& rpAttrSet, +static void SetParent( std::shared_ptr<const SfxItemSet>& rpAttrSet, const SwContentNode& rNode, const SwFormat* pParentFormat, const SwFormat* pConditionalFormat ) @@ -135,7 +135,7 @@ void SetParent( std::shared_ptr<const SfxItemSet>& rpAttrSet, } } -const SfxPoolItem* Put( std::shared_ptr<const SfxItemSet>& rpAttrSet, +static const SfxPoolItem* Put( std::shared_ptr<const SfxItemSet>& rpAttrSet, const SwContentNode& rNode, const SfxPoolItem& rAttr ) { @@ -146,7 +146,7 @@ const SfxPoolItem* Put( std::shared_ptr<const SfxItemSet>& rpAttrSet, return pRet; } -bool Put( std::shared_ptr<const SfxItemSet>& rpAttrSet, const SwContentNode& rNode, +static bool Put( std::shared_ptr<const SfxItemSet>& rpAttrSet, const SwContentNode& rNode, const SfxItemSet& rSet ) { SwAttrSet aNewSet( static_cast<const SwAttrSet&>(*rpAttrSet) ); @@ -173,7 +173,7 @@ bool Put( std::shared_ptr<const SfxItemSet>& rpAttrSet, const SwContentNode& rNo return bRet; } -bool Put_BC( std::shared_ptr<const SfxItemSet>& rpAttrSet, +static bool Put_BC( std::shared_ptr<const SfxItemSet>& rpAttrSet, const SwContentNode& rNode, const SfxPoolItem& rAttr, SwAttrSet* pOld, SwAttrSet* pNew ) { @@ -192,7 +192,7 @@ bool Put_BC( std::shared_ptr<const SfxItemSet>& rpAttrSet, return bRet; } -bool Put_BC( std::shared_ptr<const SfxItemSet>& rpAttrSet, +static bool Put_BC( std::shared_ptr<const SfxItemSet>& rpAttrSet, const SwContentNode& rNode, const SfxItemSet& rSet, SwAttrSet* pOld, SwAttrSet* pNew ) { @@ -225,7 +225,7 @@ bool Put_BC( std::shared_ptr<const SfxItemSet>& rpAttrSet, return bRet; } -sal_uInt16 ClearItem_BC( std::shared_ptr<const SfxItemSet>& rpAttrSet, +static sal_uInt16 ClearItem_BC( std::shared_ptr<const SfxItemSet>& rpAttrSet, const SwContentNode& rNode, sal_uInt16 nWhich, SwAttrSet* pOld, SwAttrSet* pNew ) { @@ -238,7 +238,7 @@ sal_uInt16 ClearItem_BC( std::shared_ptr<const SfxItemSet>& rpAttrSet, return nRet; } -sal_uInt16 ClearItem_BC( std::shared_ptr<const SfxItemSet>& rpAttrSet, +static sal_uInt16 ClearItem_BC( std::shared_ptr<const SfxItemSet>& rpAttrSet, const SwContentNode& rNode, sal_uInt16 nWhich1, sal_uInt16 nWhich2, SwAttrSet* pOld, SwAttrSet* pNew ) @@ -814,7 +814,7 @@ const SwTextNode* SwNode::FindOutlineNodeOfLevel( sal_uInt8 nLvl ) const return pRet; } -inline bool IsValidNextPrevNd( const SwNode& rNd ) +static inline bool IsValidNextPrevNd( const SwNode& rNd ) { return SwNodeType::Table == rNd.GetNodeType() || ( SwNodeType::ContentMask & rNd.GetNodeType() ) || diff --git a/sw/source/core/docnode/node2lay.cxx b/sw/source/core/docnode/node2lay.cxx index 8957ca5780a7..f9cb83687a43 100644 --- a/sw/source/core/docnode/node2lay.cxx +++ b/sw/source/core/docnode/node2lay.cxx @@ -57,7 +57,7 @@ public: SwFrame* GetFrame( const Point* pDocPos ) const; }; -SwNode* GoNextWithFrame(const SwNodes& rNodes, SwNodeIndex *pIdx) +static SwNode* GoNextWithFrame(const SwNodes& rNodes, SwNodeIndex *pIdx) { if( pIdx->GetIndex() >= rNodes.Count() - 1 ) return nullptr; @@ -91,7 +91,7 @@ SwNode* GoNextWithFrame(const SwNodes& rNodes, SwNodeIndex *pIdx) return pNd; } -SwNode* GoPreviousWithFrame(SwNodeIndex *pIdx) +static SwNode* GoPreviousWithFrame(SwNodeIndex *pIdx) { if( !pIdx->GetIndex() ) return nullptr; diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx index e23f6b549847..55ad45d2b361 100644 --- a/sw/source/core/docnode/nodes.cxx +++ b/sw/source/core/docnode/nodes.cxx @@ -49,7 +49,7 @@ typedef std::vector<SwStartNode*> SwSttNdPtrs; // function to determine the highest level in the given range -sal_uInt16 HighestLevel( SwNodes & rNodes, const SwNodeRange & rRange ); +static sal_uInt16 HighestLevel( SwNodes & rNodes, const SwNodeRange & rRange ); /** Constructor * @@ -1312,7 +1312,7 @@ SwContentNode* SwNodes::GoPrevious(SwNodeIndex *pIdx) return static_cast<SwContentNode*>(pNd); } -inline bool TstIdx( sal_uLong nSttIdx, sal_uLong nEndIdx, sal_uLong nStt, sal_uLong nEnd ) +static inline bool TstIdx( sal_uLong nSttIdx, sal_uLong nEndIdx, sal_uLong nStt, sal_uLong nEnd ) { return nStt < nSttIdx && nEnd >= nSttIdx && nStt < nEndIdx && nEnd >= nEndIdx; diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index efe04fe60bc1..71a72a92d866 100644 --- a/sw/source/core/draw/dcontact.cxx +++ b/sw/source/core/draw/dcontact.cxx @@ -1068,7 +1068,7 @@ class NestedUserCallHdl }; /// Notify the format's textbox that it should reconsider its position / size. -void lcl_textBoxSizeNotify(SwFrameFormat* pFormat) +static void lcl_textBoxSizeNotify(SwFrameFormat* pFormat) { if (SwTextBoxHelper::isTextBox(pFormat, RES_DRAWFRMFMT)) { @@ -2044,7 +2044,7 @@ namespace sdr namespace contact { /// recursively collect primitive data from given VOC with given offset - void impAddPrimitivesFromGroup(const ViewObjectContact& rVOC, const basegfx::B2DHomMatrix& rOffsetMatrix, const DisplayInfo& rDisplayInfo, drawinglayer::primitive2d::Primitive2DContainer& rxTarget) + static void impAddPrimitivesFromGroup(const ViewObjectContact& rVOC, const basegfx::B2DHomMatrix& rOffsetMatrix, const DisplayInfo& rDisplayInfo, drawinglayer::primitive2d::Primitive2DContainer& rxTarget) { const sal_uInt32 nSubHierarchyCount(rVOC.GetViewContact().GetObjectCount()); diff --git a/sw/source/core/draw/dpage.cxx b/sw/source/core/draw/dpage.cxx index 5ead2c022ca4..4a173ffa8dcf 100644 --- a/sw/source/core/draw/dpage.cxx +++ b/sw/source/core/draw/dpage.cxx @@ -93,7 +93,7 @@ SdrObject* SwDPage::ReplaceObject( SdrObject* pNewObj, size_t nObjNum ) return FmFormPage::ReplaceObject( pNewObj, nObjNum ); } -void InsertGridFrame( SdrPageGridFrameList *pLst, const SwFrame *pPg ) +static void InsertGridFrame( SdrPageGridFrameList *pLst, const SwFrame *pPg ) { SwRect aPrt( pPg->getFramePrintArea() ); aPrt += pPg->getFrameArea().Pos(); diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx index 94c384b57486..aeccb79f030e 100644 --- a/sw/source/core/draw/dview.cxx +++ b/sw/source/core/draw/dview.cxx @@ -130,7 +130,7 @@ bool SwDrawView::IsAntiAliasing() const return getOptionsDrawinglayer().IsAntiAliasing(); } -SdrObject* impLocalHitCorrection(SdrObject* pRetval, const Point& rPnt, sal_uInt16 nTol, const SdrMarkList &rMrkList) +static SdrObject* impLocalHitCorrection(SdrObject* pRetval, const Point& rPnt, sal_uInt16 nTol, const SdrMarkList &rMrkList) { if(!nTol) { diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index 26e2593c9ca2..2328bf1fe205 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -217,7 +217,7 @@ public: SwNodeIndex const * pSttNd = nullptr, SwNodeIndex const * pEndNd = nullptr ); }; -const sal_Unicode* StrChr( const sal_Unicode* pSrc, sal_Unicode c ) +static const sal_Unicode* StrChr( const sal_Unicode* pSrc, sal_Unicode c ) { while( *pSrc && *pSrc != c ) ++pSrc; diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx index 4666ca93aaf0..3e1d3a74c778 100644 --- a/sw/source/core/edit/edfcol.cxx +++ b/sw/source/core/edit/edfcol.cxx @@ -691,7 +691,7 @@ SwTextFormatColl& SwEditShell::GetTextFormatColl(sal_uInt16 nFormatColl) const return *((*(GetDoc()->GetTextFormatColls()))[nFormatColl]); } -void insertFieldToDocument(uno::Reference<lang::XMultiServiceFactory> const & rxMultiServiceFactory, +static void insertFieldToDocument(uno::Reference<lang::XMultiServiceFactory> const & rxMultiServiceFactory, uno::Reference<text::XText> const & rxText, uno::Reference<text::XParagraphCursor> const & rxParagraphCursor, OUString const & rsKey) { @@ -702,7 +702,7 @@ void insertFieldToDocument(uno::Reference<lang::XMultiServiceFactory> const & rx rxText->insertTextContent(rxParagraphCursor, xTextContent, false); } -void removeAllClassificationFields(OUString const & rPolicy, uno::Reference<text::XText> const & rxText) +static void removeAllClassificationFields(OUString const & rPolicy, uno::Reference<text::XText> const & rxText) { uno::Reference<container::XEnumerationAccess> xParagraphEnumerationAccess(rxText, uno::UNO_QUERY); uno::Reference<container::XEnumeration> xParagraphs = xParagraphEnumerationAccess->createEnumeration(); @@ -735,7 +735,7 @@ void removeAllClassificationFields(OUString const & rPolicy, uno::Reference<text } } -sal_Int32 getNumberOfParagraphs(uno::Reference<text::XText> const & xText) +static sal_Int32 getNumberOfParagraphs(uno::Reference<text::XText> const & xText) { uno::Reference<container::XEnumerationAccess> xParagraphEnumAccess(xText, uno::UNO_QUERY); uno::Reference<container::XEnumeration> xParagraphEnum = xParagraphEnumAccess->createEnumeration(); @@ -748,7 +748,7 @@ sal_Int32 getNumberOfParagraphs(uno::Reference<text::XText> const & xText) return nResult; } -void equaliseNumberOfParagraph(std::vector<svx::ClassificationResult> const & rResults, uno::Reference<text::XText> const & xText) +static void equaliseNumberOfParagraph(std::vector<svx::ClassificationResult> const & rResults, uno::Reference<text::XText> const & xText) { sal_Int32 nNumberOfParagraphs = 0; for (svx::ClassificationResult const & rResult : rResults) @@ -1145,7 +1145,7 @@ void SwEditShell::SetClassification(const OUString& rName, SfxClassificationPoli } } -void lcl_ApplyParagraphClassification(SwDoc* pDoc, +static void lcl_ApplyParagraphClassification(SwDoc* pDoc, const uno::Reference<frame::XModel>& xModel, const uno::Reference<text::XTextContent>& xParent, std::vector<svx::ClassificationResult> aResults) @@ -1273,7 +1273,7 @@ void SwEditShell::ApplyParagraphClassification(std::vector<svx::ClassificationRe lcl_ApplyParagraphClassification(GetDoc(), xModel, xParent, std::move(aResults)); } -std::vector<svx::ClassificationResult> lcl_CollectParagraphClassification(const uno::Reference<frame::XModel>& xModel, const uno::Reference<text::XTextContent>& xParagraph) +static std::vector<svx::ClassificationResult> lcl_CollectParagraphClassification(const uno::Reference<frame::XModel>& xModel, const uno::Reference<text::XTextContent>& xParagraph) { std::vector<svx::ClassificationResult> aResult; @@ -1348,7 +1348,7 @@ std::vector<svx::ClassificationResult> SwEditShell::CollectParagraphClassificati return lcl_CollectParagraphClassification(xModel, xParent); } -sal_Int16 lcl_GetAngle(const drawing::HomogenMatrix3& rMatrix) +static sal_Int16 lcl_GetAngle(const drawing::HomogenMatrix3& rMatrix) { basegfx::B2DHomMatrix aTransformation; basegfx::B2DTuple aScale; @@ -1427,7 +1427,7 @@ SfxWatermarkItem SwEditShell::GetWatermark() return SfxWatermarkItem(); } -void lcl_placeWatermarkInHeader(const SfxWatermarkItem& rWatermark, +static void lcl_placeWatermarkInHeader(const SfxWatermarkItem& rWatermark, const uno::Reference<frame::XModel>& xModel, const uno::Reference<beans::XPropertySet>& xPageStyle, const uno::Reference<text::XText>& xHeaderText) @@ -1859,7 +1859,7 @@ void SwEditShell::ValidateAllParagraphSignatures(bool updateDontRemove) } } -uno::Reference<text::XTextField> lcl_GetParagraphMetadataFieldAtIndex(const SwDocShell* pDocSh, SwTextNode const * pNode, const sal_uLong index) +static uno::Reference<text::XTextField> lcl_GetParagraphMetadataFieldAtIndex(const SwDocShell* pDocSh, SwTextNode const * pNode, const sal_uLong index) { uno::Reference<text::XTextField> xTextField; if (pNode != nullptr && pDocSh != nullptr) @@ -2050,7 +2050,7 @@ bool SwEditShell::RemoveParagraphMetadataFieldAtCursor() return false; } -OUString lcl_GetParagraphClassification(SfxClassificationHelper & rHelper, sfx::ClassificationKeyCreator const & rKeyCreator, +static OUString lcl_GetParagraphClassification(SfxClassificationHelper & rHelper, sfx::ClassificationKeyCreator const & rKeyCreator, const uno::Reference<frame::XModel>& xModel, const uno::Reference<text::XTextContent>& xParagraph) { uno::Reference<text::XTextField> xTextField; @@ -2071,7 +2071,7 @@ OUString lcl_GetParagraphClassification(SfxClassificationHelper & rHelper, sfx:: return OUString(); } -OUString lcl_GetHighestClassificationParagraphClass(SwPaM* pCursor) +static OUString lcl_GetHighestClassificationParagraphClass(SwPaM* pCursor) { OUString sHighestClass; diff --git a/sw/source/core/edit/edtab.cxx b/sw/source/core/edit/edtab.cxx index 28a5c05be494..c9432dd78015 100644 --- a/sw/source/core/edit/edtab.cxx +++ b/sw/source/core/edit/edtab.cxx @@ -54,9 +54,9 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; //Added for bug #i119954# Application crashed if undo/redo covert nest table to text -bool ConvertTableToText( const SwTableNode *pTableNode, sal_Unicode cCh ); +static bool ConvertTableToText( const SwTableNode *pTableNode, sal_Unicode cCh ); -void ConvertNestedTablesToText( const SwTableLines &rTableLines, sal_Unicode cCh ) +static void ConvertNestedTablesToText( const SwTableLines &rTableLines, sal_Unicode cCh ) { for (size_t n = 0; n < rTableLines.size(); ++n) { diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx index 293ec2667ac6..9d68652b0573 100644 --- a/sw/source/core/fields/expfld.cxx +++ b/sw/source/core/fields/expfld.cxx @@ -135,7 +135,7 @@ OUString ReplacePoint( const OUString& rTmpName, bool bWithCommandType ) return sRes; } -SwTextNode* GetFirstTextNode( const SwDoc& rDoc, SwPosition& rPos, +static SwTextNode* GetFirstTextNode( const SwDoc& rDoc, SwPosition& rPos, const SwContentFrame *pCFrame, Point &rPt ) { SwTextNode* pTextNode = nullptr; diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx index fd19f87419e7..a46593d2a12b 100644 --- a/sw/source/core/frmedt/fetab.cxx +++ b/sw/source/core/frmedt/fetab.cxx @@ -72,7 +72,7 @@ using namespace ::com::sun::star; // also see swtable.cxx #define COLFUZZY 20L -inline bool IsSame( long nA, long nB ) { return std::abs(nA-nB) <= COLFUZZY; } +static inline bool IsSame( long nA, long nB ) { return std::abs(nA-nB) <= COLFUZZY; } class TableWait { diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index 158ac489ecb1..da6d31b63d96 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -1069,7 +1069,7 @@ static bool IsShown(sal_uLong const nIndex, } } -void AppendObjsOfNode(SwFrameFormats const*const pTable, sal_uLong const nIndex, +static void AppendObjsOfNode(SwFrameFormats const*const pTable, sal_uLong const nIndex, SwFrame *const pFrame, SwPageFrame *const pPage, SwDoc *const pDoc, std::vector<sw::Extent>::const_iterator *const pIter, std::vector<sw::Extent>::const_iterator const*const pEnd) @@ -1159,7 +1159,7 @@ void AppendObjs(const SwFrameFormats *const pTable, sal_uLong const nIndex, } } -void AppendAllObjs(const SwFrameFormats* pTable, const SwFrame* pSib) +static void AppendAllObjs(const SwFrameFormats* pTable, const SwFrame* pSib) { //Connecting of all Objects, which are described in the SpzTable with the //layout. @@ -2047,7 +2047,7 @@ void SwBorderAttrs::IsLine_() * pre-/succeeding paragraph. */ -inline bool CmpLines( const editeng::SvxBorderLine *pL1, const editeng::SvxBorderLine *pL2 ) +static inline bool CmpLines( const editeng::SvxBorderLine *pL1, const editeng::SvxBorderLine *pL2 ) { return ( ((pL1 && pL2) && (*pL1 == *pL2)) || (!pL1 && !pL2) ); } diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index ed003618424e..0f3be5c45aaf 100644 --- a/sw/source/core/layout/ftnfrm.cxx +++ b/sw/source/core/layout/ftnfrm.cxx @@ -1733,7 +1733,7 @@ void SwFootnoteBossFrame::CollectFootnotes( const SwContentFrame* _pRef, CollectFootnotes_( _pRef, pFootnote, _rFootnoteArr, _bCollectOnlyPreviousFootnotes, pRefBossFrame ); } -inline void FootnoteInArr( SwFootnoteFrames& rFootnoteArr, SwFootnoteFrame* pFootnote ) +static inline void FootnoteInArr( SwFootnoteFrames& rFootnoteArr, SwFootnoteFrame* pFootnote ) { if ( rFootnoteArr.end() == std::find( rFootnoteArr.begin(), rFootnoteArr.end(), pFootnote ) ) rFootnoteArr.push_back( pFootnote ); diff --git a/sw/source/core/layout/hffrm.cxx b/sw/source/core/layout/hffrm.cxx index 26f8ea1a1f4f..da3442879815 100644 --- a/sw/source/core/layout/hffrm.cxx +++ b/sw/source/core/layout/hffrm.cxx @@ -660,7 +660,7 @@ bool SwHeadFootFrame::GetEatSpacing() const return pFormat->GetHeaderAndFooterEatSpacing().GetValue(); } -void DelFlys( SwLayoutFrame const *pFrame, SwPageFrame *pPage ) +static void DelFlys( SwLayoutFrame const *pFrame, SwPageFrame *pPage ) { size_t i = 0; while ( pPage->GetSortedObjs() && diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx index 02502e82eff1..e5dffd9ba05f 100644 --- a/sw/source/core/layout/newfrm.cxx +++ b/sw/source/core/layout/newfrm.cxx @@ -49,13 +49,13 @@ bool SwRootFrame::s_isNoVirDev = false; SwCache *SwFrame::mpCache = nullptr; -long FirstMinusSecond( long nFirst, long nSecond ) +static long FirstMinusSecond( long nFirst, long nSecond ) { return nFirst - nSecond; } -long SecondMinusFirst( long nFirst, long nSecond ) +static long SecondMinusFirst( long nFirst, long nSecond ) { return nSecond - nFirst; } -long SwIncrement( long nA, long nAdd ) +static long SwIncrement( long nA, long nAdd ) { return nA + nAdd; } -long SwDecrement( long nA, long nSub ) +static long SwDecrement( long nA, long nSub ) { return nA - nSub; } static SwRectFnCollection aHorizontal = { diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index 5513c8ec1a79..175e7d546f30 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -164,7 +164,7 @@ void SwTabFrame::RegistFlys() } } -void SwInvalidateAll( SwFrame *pFrame, long nBottom ); +static void SwInvalidateAll( SwFrame *pFrame, long nBottom ); static void lcl_RecalcRow( SwRowFrame* pRow, long nBottom ); static bool lcl_ArrangeLowers( SwLayoutFrame *pLay, long lYStart, bool bInva ); // #i26945# - add parameter <_bOnlyRowsAndCells> to control @@ -1339,7 +1339,7 @@ void SwTabFrame::Join() } } -void SwInvalidatePositions( SwFrame *pFrame, long nBottom ) +static void SwInvalidatePositions( SwFrame *pFrame, long nBottom ) { // LONG_MAX == nBottom means we have to calculate all bool bAll = LONG_MAX == nBottom; diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index 14887a9e274f..b31483b18f8f 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -1975,14 +1975,14 @@ bool SwRootFrame::MakeTableCursors( SwTableCursor& rTableCursor ) return bRet; } -inline void Sub( SwRegionRects& rRegion, const SwRect& rRect ) +static inline void Sub( SwRegionRects& rRegion, const SwRect& rRect ) { if( rRect.Width() > 1 && rRect.Height() > 1 && rRect.IsOver( rRegion.GetOrigin() )) rRegion -= rRect; } -inline void Add( SwRegionRects& rRegion, const SwRect& rRect ) +static inline void Add( SwRegionRects& rRegion, const SwRect& rRect ) { if( rRect.Width() > 1 && rRect.Height() > 1 ) rRegion += rRect; diff --git a/sw/source/core/layout/virtoutp.cxx b/sw/source/core/layout/virtoutp.cxx index c39055fea33b..389a2154cd24 100644 --- a/sw/source/core/layout/virtoutp.cxx +++ b/sw/source/core/layout/virtoutp.cxx @@ -68,7 +68,7 @@ bool SwRootFrame::HasSameRect( const SwRect& rRect ) */ // define to control, if old or new solution for setting the mapping for // an virtual output device is used. -void SetMappingForVirtDev( const Point& _rNewOrigin, +static void SetMappingForVirtDev( const Point& _rNewOrigin, const vcl::RenderContext* _pOrgOutDev, vcl::RenderContext* _pVirDev ) { diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index 6fb13bae04e9..82060a833d06 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -71,7 +71,7 @@ using namespace com::sun::star; #define COLFUZZY 20 -void ChgTextToNum( SwTableBox& rBox, const OUString& rText, const Color* pCol, +static void ChgTextToNum( SwTableBox& rBox, const OUString& rText, const Color* pCol, bool bChgAlign, sal_uLong nNdPos ); inline const Color* SwTableBox::GetSaveUserColor() const @@ -1937,7 +1937,7 @@ void SwTable::SetHTMLTableLayout(std::shared_ptr<SwHTMLTableLayout> const& r) m_xHTMLLayout = r; } -void ChgTextToNum( SwTableBox& rBox, const OUString& rText, const Color* pCol, +static void ChgTextToNum( SwTableBox& rBox, const OUString& rText, const Color* pCol, bool bChgAlign ) { sal_uLong nNdPos = rBox.IsValidNumTextNd(); @@ -2069,7 +2069,7 @@ void ChgTextToNum( SwTableBox& rBox, const OUString& rText, const Color* pCol, } -void ChgNumToText( SwTableBox& rBox, sal_uLong nFormat ) +static void ChgNumToText( SwTableBox& rBox, sal_uLong nFormat ) { sal_uLong nNdPos = rBox.IsValidNumTextNd( false ); if( ULONG_MAX == nNdPos ) diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx index 2c9424bd6529..fd09c2632cfb 100644 --- a/sw/source/core/text/frmform.cxx +++ b/sw/source/core/text/frmform.cxx @@ -117,7 +117,7 @@ void SwTextFrame::ValidateFrame() // After a RemoveFootnote the BodyFrame and all Frames contained within it, need to be // recalculated, so that the DeadLine is right. // First we search outwards, on the way back we calculate everything. -void ValidateBodyFrame_( SwFrame *pFrame ) +static void ValidateBodyFrame_( SwFrame *pFrame ) { vcl::RenderContext* pRenderContext = pFrame ? pFrame->getRootFrame()->GetCurrShell()->GetOut() : nullptr; if( pFrame && !pFrame->IsCellFrame() ) diff --git a/sw/source/core/text/frminf.cxx b/sw/source/core/text/frminf.cxx index f3df1bbaa46c..303ca595487d 100644 --- a/sw/source/core/text/frminf.cxx +++ b/sw/source/core/text/frminf.cxx @@ -131,7 +131,7 @@ SwTwips SwTextFrameInfo::GetCharPos(TextFrameIndex const nChar, bool bCenter) co return (( nNext + nStt ) / 2 ) - aRectFnSet.GetLeft(pFrame->getFrameArea()); } -SwPaM *AddPam( SwPaM *pPam, const SwTextFrame* pTextFrame, +static SwPaM *AddPam( SwPaM *pPam, const SwTextFrame* pTextFrame, TextFrameIndex const nPos, TextFrameIndex const nLen) { if( nLen ) diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index 2c52ed892944..74a046232bcd 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -162,7 +162,7 @@ SwTextInfo::SwTextInfo( const SwTextInfo &rInf ) #if OSL_DEBUG_LEVEL > 0 -void ChkOutDev( const SwTextSizeInfo &rInf ) +static void ChkOutDev( const SwTextSizeInfo &rInf ) { if ( !rInf.GetVsh() ) return; @@ -173,7 +173,7 @@ void ChkOutDev( const SwTextSizeInfo &rInf ) } #endif -inline TextFrameIndex GetMinLen( const SwTextSizeInfo &rInf ) +static inline TextFrameIndex GetMinLen( const SwTextSizeInfo &rInf ) { const TextFrameIndex nTextLen(rInf.GetText().getLength()); if (rInf.GetLen() == TextFrameIndex(COMPLETE_STRING)) diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx index 44df9ea35304..178051ad1a51 100644 --- a/sw/source/core/text/itratr.cxx +++ b/sw/source/core/text/itratr.cxx @@ -435,7 +435,7 @@ static void InsertCharAttrs(SfxPoolItem const** pAttrs, SfxItemSet const& rItems // if return false: portion ends at start of redline, indexes unchanged // if return true: portion end not known (past end of redline), indexes point to first hint past end of redline -bool CanSkipOverRedline(SwRangeRedline const& rRedline, +static bool CanSkipOverRedline(SwRangeRedline const& rRedline, size_t & rStartIndex, size_t & rEndIndex) { size_t nStartIndex(rStartIndex); diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index a0923601cce7..16d35e581131 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -77,7 +77,7 @@ namespace { bool lcl_HasSameBorder(const SwFont& rFirst, const SwFont& rSecond); } -inline void ClearFly( SwTextFormatInfo &rInf ) +static inline void ClearFly( SwTextFormatInfo &rInf ) { delete rInf.GetFly(); rInf.SetFly(nullptr); diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx index 7e2458fcb2b9..4e65a4b9bedc 100644 --- a/sw/source/core/text/itrpaint.cxx +++ b/sw/source/core/text/itrpaint.cxx @@ -70,7 +70,7 @@ bool IsUnderlineBreak( const SwLinePortion& rPor, const SwFont& rFnt ) SvxCaseMap::SmallCaps == rFnt.GetCaseMap(); } -const Color GetUnderColor( const SwFont *pFont ) +static const Color GetUnderColor( const SwFont *pFont ) { return pFont->GetUnderColor() == COL_AUTO ? pFont->GetColor() : pFont->GetUnderColor(); diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index 28c69bb6960c..307f28ab0f30 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -89,7 +89,7 @@ using namespace i18n::ScriptType; #define isSeenOrSadChar(c) (IS_JOINING_GROUP((c), SAD) || IS_JOINING_GROUP((c), SEEN)) // Beh and charters that behave like Beh in medial form. -bool isBehChar(sal_Unicode cCh) +static bool isBehChar(sal_Unicode cCh) { bool bRet = false; switch (u_getIntPropertyValue(cCh, UCHAR_JOINING_GROUP)) @@ -114,7 +114,7 @@ bool isBehChar(sal_Unicode cCh) } // Yeh and charters that behave like Yeh in final form. -bool isYehChar(sal_Unicode cCh) +static bool isYehChar(sal_Unicode cCh) { bool bRet = false; switch (u_getIntPropertyValue(cCh, UCHAR_JOINING_GROUP)) @@ -134,7 +134,7 @@ bool isYehChar(sal_Unicode cCh) return bRet; } -bool isTransparentChar ( sal_Unicode cCh ) +static bool isTransparentChar ( sal_Unicode cCh ) { return u_getIntPropertyValue( cCh, UCHAR_JOINING_TYPE ) == U_JT_TRANSPARENT; } diff --git a/sw/source/core/text/porlin.cxx b/sw/source/core/text/porlin.cxx index ca4080becbac..7a9c81925fb7 100644 --- a/sw/source/core/text/porlin.cxx +++ b/sw/source/core/text/porlin.cxx @@ -28,7 +28,7 @@ #include <blink.hxx> #if OSL_DEBUG_LEVEL > 0 -bool ChkChain( SwLinePortion *pStart ) +static bool ChkChain( SwLinePortion *pStart ) { SwLinePortion *pPor = pStart->GetPortion(); sal_uInt16 nCount = 0; diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index 6d83d3285c97..38ce27805492 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -697,7 +697,7 @@ SwTextFrame::~SwTextFrame() namespace sw { -void UpdateMergedParaForInsert(MergedPara & rMerged, +static void UpdateMergedParaForInsert(MergedPara & rMerged, SwTextNode const& rNode, sal_Int32 const nIndex, sal_Int32 const nLen) { assert(nIndex <= rNode.Len()); @@ -747,7 +747,7 @@ void UpdateMergedParaForInsert(MergedPara & rMerged, // 1. if real delete => correct nStart/nEnd for full nLen // 2. if rl delete => do not correct nStart/nEnd but just exclude deleted -TextFrameIndex UpdateMergedParaForDelete(MergedPara & rMerged, +static TextFrameIndex UpdateMergedParaForDelete(MergedPara & rMerged, bool const isRealDelete, SwTextNode const& rNode, sal_Int32 nIndex, sal_Int32 const nLen) { diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx index b67daa422b65..586750276517 100644 --- a/sw/source/core/text/txtftn.cxx +++ b/sw/source/core/text/txtftn.cxx @@ -954,7 +954,7 @@ SwNumberPortion *SwTextFormatter::NewFootnoteNumPortion( SwTextFormatInfo const return pNewPor; } -OUString lcl_GetPageNumber( const SwPageFrame* pPage ) +static OUString lcl_GetPageNumber( const SwPageFrame* pPage ) { OSL_ENSURE( pPage, "GetPageNumber: Homeless TextFrame" ); const sal_uInt16 nVirtNum = pPage->GetVirtPageNum(); diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 886e3b8ce5e6..df9b9ddddca9 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -1483,7 +1483,7 @@ static SwCharFormat* lcl_FindCharFormat( const SwCharFormats* pCharFormats, cons return nullptr; } -void lcl_CopyHint( +static void lcl_CopyHint( const sal_uInt16 nWhich, const SwTextAttr * const pHt, SwTextAttr *const pNewHt, diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index f028b973e601..fad6b64db17e 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -364,7 +364,7 @@ sal_uInt16 SwFont::CalcShadowSpace( } // maps directions for vertical layout -sal_uInt16 MapDirection( sal_uInt16 nDir, const bool bVertFormat ) +static sal_uInt16 MapDirection( sal_uInt16 nDir, const bool bVertFormat ) { if ( bVertFormat ) { diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index cf6cade9344e..6369912516cb 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -1775,7 +1775,7 @@ bool SwTextNode::IsIgnoredCharFormatForNumbering(const sal_uInt16 nWhich) //Font underline; //Font Italic of Western, CJK and CTL; //Font Bold of Wertern, CJK and CTL; -bool lcl_IsIgnoredCharFormatForBullets(const sal_uInt16 nWhich) +static bool lcl_IsIgnoredCharFormatForBullets(const sal_uInt16 nWhich) { return (nWhich == RES_CHRATR_UNDERLINE || nWhich == RES_CHRATR_POSTURE || nWhich == RES_CHRATR_WEIGHT || nWhich == RES_CHRATR_CJK_POSTURE || nWhich == RES_CHRATR_CJK_WEIGHT diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index 46fe039ee514..ff2d645c83da 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -682,7 +682,7 @@ void SwTextNode::RstTextAttr( } } -sal_Int32 clipIndexBounds(const OUString &rStr, sal_Int32 nPos) +static sal_Int32 clipIndexBounds(const OUString &rStr, sal_Int32 nPos) { if (nPos < 0) return 0; diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index b7bf849e15ac..fd0031746ea4 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -177,7 +177,7 @@ public: #if OSL_DEBUG_LEVEL > 0 #include <shellio.hxx> -void CheckTable( const SwTable& ); +static void CheckTable( const SwTable& ); #define CHECKTABLE(t) CheckTable( t ); #else #define CHECKTABLE(t) diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index 05d70e6d5807..b6335a7b6a36 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -317,7 +317,7 @@ static sal_Int32 lcl_PropName2TokenPos(const OUString& rPropertyName) return SAL_MAX_INT32; } -sal_uInt16 GetFieldTypeMId( const OUString& rProperty, const SwFieldType& rTyp ) +static sal_uInt16 GetFieldTypeMId( const OUString& rProperty, const SwFieldType& rTyp ) { sal_uInt16 nId = lcl_GetPropMapIdForFieldType( rTyp.Which() ); const SfxItemPropertySet* pSet = aSwMapProvider.GetPropertySet( nId ); diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index aded66619adf..9f5a070d4611 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -105,7 +105,7 @@ lcl_AnyToBool(uno::Any const& rVal) /// @throws lang::IllegalArgumentException template<typename T> -void lcl_AnyToBitMask(uno::Any const& rValue, +static void lcl_AnyToBitMask(uno::Any const& rValue, T & rBitMask, const T nBit) { rBitMask = lcl_AnyToBool(rValue) @@ -114,7 +114,7 @@ void lcl_AnyToBitMask(uno::Any const& rValue, } template<typename T> -void lcl_BitMaskToAny(uno::Any & o_rValue, +static void lcl_BitMaskToAny(uno::Any & o_rValue, const T nBitMask, const T nBit) { const bool bRet(nBitMask & nBit); @@ -1230,7 +1230,7 @@ SwXDocumentIndex::removeVetoableChangeListener( OSL_FAIL("SwXDocumentIndex::removeVetoableChangeListener(): not implemented"); } -void lcl_CalcLayout(SwDoc *pDoc) +static void lcl_CalcLayout(SwDoc *pDoc) { SwViewShell *pViewShell = nullptr; SwEditShell* pEditShell = nullptr; diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index c1c91b365bf0..fdd42ce4c99f 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -1764,7 +1764,7 @@ void SwUnoCursorHelper::SetPropertyValue( // SwUnoCursorHelper::SetTextFormatColl, instead of extending item set. // We need to get them from nodes in next call to GetCursorAttr. // The rest could cause similar problems in theory, so we just list them here. -inline bool propertyCausesSideEffectsInNodes(sal_uInt16 nWID) +static inline bool propertyCausesSideEffectsInNodes(sal_uInt16 nWID) { return nWID == FN_UNO_PARA_STYLE || nWID == FN_UNO_CHARFMT_SEQUENCE || diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index c1b1529534a7..ee146bb68d7f 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -111,7 +111,7 @@ namespace #define WID_BEGIN_NOTICE 10 #define WID_ANCHOR_CHARACTER_STYLE 11 -const SfxItemPropertySet* GetFootnoteSet() +static const SfxItemPropertySet* GetFootnoteSet() { static const SfxItemPropertyMapEntry aFootnoteMap_Impl[] = { @@ -133,7 +133,7 @@ const SfxItemPropertySet* GetFootnoteSet() return &aFootnoteSet_Impl; } -const SfxItemPropertySet* GetEndnoteSet() +static const SfxItemPropertySet* GetEndnoteSet() { static const SfxItemPropertyMapEntry aEndnoteMap_Impl[] = { @@ -151,7 +151,7 @@ const SfxItemPropertySet* GetEndnoteSet() return &aEndnoteSet_Impl; } -const SfxItemPropertySet* GetNumberingRulesSet() +static const SfxItemPropertySet* GetNumberingRulesSet() { static const SfxItemPropertyMapEntry aNumberingRulesMap_Impl[] = { @@ -178,7 +178,7 @@ const SfxItemPropertySet* GetNumberingRulesSet() #define WID_COUNT_LINES_IN_FRAMES 9 #define WID_RESTART_AT_EACH_PAGE 10 -const SfxItemPropertySet* GetLineNumberingSet() +static const SfxItemPropertySet* GetLineNumberingSet() { static const SfxItemPropertyMapEntry aLineNumberingMap_Impl[] = { diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index e58c1f01e535..db28a9ad84f8 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -1560,7 +1560,7 @@ const SwPageDesc* SwStyleBase_Impl::GetOldPageDesc() -sal_uInt8 lcl_TranslateMetric(const SfxItemPropertySimpleEntry& rEntry, SwDoc* pDoc, uno::Any& o_aValue) +static sal_uInt8 lcl_TranslateMetric(const SfxItemPropertySimpleEntry& rEntry, SwDoc* pDoc, uno::Any& o_aValue) { // check for needed metric translation if(!(rEntry.nMoreFlags & PropertyMoreFlags::METRIC_ITEM)) @@ -2458,7 +2458,7 @@ beans::PropertyState SwXStyle::getPropertyState(const OUString& rPropertyName) // allow to retarget the SfxItemSet working on, default correctly. Only // use pSourceSet below this point (except in header/footer processing) -const SfxItemSet* lcl_GetItemsetForProperty(const SfxItemSet& rSet, SfxStyleFamily eFamily, const OUString& rPropertyName) +static const SfxItemSet* lcl_GetItemsetForProperty(const SfxItemSet& rSet, SfxStyleFamily eFamily, const OUString& rPropertyName) { if(eFamily != SfxStyleFamily::Page) return &rSet; @@ -2572,7 +2572,7 @@ void SwXStyle::setPropertyToDefault(const OUString& rPropertyName) setPropertiesToDefault(aSequence); } -SwFormat* lcl_GetFormatForStyle(SwDoc const * pDoc, const rtl::Reference<SwDocStyleSheet>& xStyle, const SfxStyleFamily eFamily) +static SwFormat* lcl_GetFormatForStyle(SwDoc const * pDoc, const rtl::Reference<SwDocStyleSheet>& xStyle, const SfxStyleFamily eFamily) { if(!xStyle.is()) return nullptr; diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index 7f832ac8e0d4..9725815c5ed0 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -532,7 +532,7 @@ OUString sw_GetCellName( sal_Int32 nColumn, sal_Int32 nRow ) @param i_bTopLeft if true, find top left box, otherwise find bottom right box */ -const SwTableBox* lcl_FindCornerTableBox(const SwTableLines& rTableLines, const bool i_bTopLeft) +static const SwTableBox* lcl_FindCornerTableBox(const SwTableLines& rTableLines, const bool i_bTopLeft) { const SwTableLines* pLines(&rTableLines); while(true) diff --git a/sw/source/filter/basflt/fltini.cxx b/sw/source/filter/basflt/fltini.cxx index 128a1478447d..784d86d2f8e9 100644 --- a/sw/source/filter/basflt/fltini.cxx +++ b/sw/source/filter/basflt/fltini.cxx @@ -63,9 +63,9 @@ using namespace com::sun::star; SwRead ReadAscii = nullptr, ReadHTML = nullptr, ReadXML = nullptr; -Reader* GetRTFReader(); -Reader* GetWW8Reader(); -Reader* GetDOCXReader(); +static Reader* GetRTFReader(); +static Reader* GetWW8Reader(); +static Reader* GetDOCXReader(); // Note: if editing, please don't forget to modify also the enum // ReaderWriterEnum and aFilterDetect in iodetect.hxx & iodetect.cxx @@ -109,7 +109,7 @@ SwRead SwGetReaderXML() // SW_DLLPUBLIC return ReadXML; } -inline void SetFltPtr( sal_uInt16 rPos, SwRead pReader ) +static inline void SetFltPtr( sal_uInt16 rPos, SwRead pReader ) { aReaderWriter[ rPos ].pReader = pReader; } diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index 96cd25a1e979..ef1b8d7bb636 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -416,7 +416,7 @@ SwHTMLFormatInfo::~SwHTMLFormatInfo() { } -void OutHTML_SwFormat( Writer& rWrt, const SwFormat& rFormat, +static void OutHTML_SwFormat( Writer& rWrt, const SwFormat& rFormat, const SfxItemSet *pNodeItemSet, SwHTMLTextCollOutputInfo& rInfo ) { @@ -963,7 +963,7 @@ void OutHTML_SwFormat( Writer& rWrt, const SwFormat& rFormat, rHWrt.m_nFirstLineIndent = 0; } -void OutHTML_SwFormatOff( Writer& rWrt, const SwHTMLTextCollOutputInfo& rInfo ) +static void OutHTML_SwFormatOff( Writer& rWrt, const SwHTMLTextCollOutputInfo& rInfo ) { SwHTMLWriter & rHWrt = static_cast<SwHTMLWriter&>(rWrt); diff --git a/sw/source/filter/html/htmlftn.cxx b/sw/source/filter/html/htmlftn.cxx index 2655f2756709..90f5aae2b9cc 100644 --- a/sw/source/filter/html/htmlftn.cxx +++ b/sw/source/filter/html/htmlftn.cxx @@ -31,7 +31,7 @@ #include "swhtml.hxx" #include "wrthtml.hxx" -sal_Int32 lcl_html_getNextPart( OUString& rPart, const OUString& rContent, +static sal_Int32 lcl_html_getNextPart( OUString& rPart, const OUString& rContent, sal_Int32 nPos ) { rPart = aEmptyOUStr; @@ -73,7 +73,7 @@ sal_Int32 lcl_html_getNextPart( OUString& rPart, const OUString& rContent, return nPos; } -sal_Int32 lcl_html_getEndNoteInfo( SwEndNoteInfo& rInfo, +static sal_Int32 lcl_html_getEndNoteInfo( SwEndNoteInfo& rInfo, const OUString& rContent, bool bEndNote ) { diff --git a/sw/source/filter/ww8/WW8TableInfo.cxx b/sw/source/filter/ww8/WW8TableInfo.cxx index e27e3393f3bd..ae6596f43b52 100644 --- a/sw/source/filter/ww8/WW8TableInfo.cxx +++ b/sw/source/filter/ww8/WW8TableInfo.cxx @@ -734,7 +734,7 @@ WW8TableInfo::processTableBoxLines(const SwTableBox * pBox, return pNodeInfo; } -void updateFinalEndOfLine(RowEndInners_t &rLastRowEnds, WW8TableNodeInfo const * pEndOfCellInfo) +static void updateFinalEndOfLine(RowEndInners_t &rLastRowEnds, WW8TableNodeInfo const * pEndOfCellInfo) { sal_Int32 nDepth = pEndOfCellInfo->getDepth(); WW8TableNodeInfoInner::Pointer_t pInner = pEndOfCellInfo->getInnerForDepth(nDepth); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index a72f89a7d022..37d8e972a42c 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -8227,7 +8227,7 @@ void DocxAttributeOutput::FormatAnchor( const SwFormatAnchor& ) // Fly frames: anchors here aren't matching the anchors in docx } -boost::optional<sal_Int32> lcl_getDmlAlpha(const SvxBrushItem& rBrush) +static boost::optional<sal_Int32> lcl_getDmlAlpha(const SvxBrushItem& rBrush) { boost::optional<sal_Int32> oRet; sal_Int32 nTransparency = rBrush.GetColor().GetTransparency(); diff --git a/sw/source/filter/ww8/docxexportfilter.cxx b/sw/source/filter/ww8/docxexportfilter.cxx index 4069289670e0..92ec0d103da9 100644 --- a/sw/source/filter/ww8/docxexportfilter.cxx +++ b/sw/source/filter/ww8/docxexportfilter.cxx @@ -98,7 +98,7 @@ bool DocxExportFilter::exportDocument() // UNO stuff so that the filter is registered #define IMPL_NAME "com.sun.star.comp.Writer.DocxExport" -OUString DocxExport_getImplementationName() +static OUString DocxExport_getImplementationName() { return OUString( IMPL_NAME ); } @@ -108,13 +108,13 @@ OUString DocxExportFilter::getImplementationName() return DocxExport_getImplementationName(); } -uno::Sequence< OUString > DocxExport_getSupportedServiceNames() throw() +static uno::Sequence< OUString > DocxExport_getSupportedServiceNames() throw() { return uno::Sequence< OUString > { "com.sun.star.document.ExportFilter" }; } /// @throws uno::Exception -uno::Reference< uno::XInterface > DocxExport_createInstance(const uno::Reference< uno::XComponentContext > & xCtx ) +static uno::Reference< uno::XInterface > DocxExport_createInstance(const uno::Reference< uno::XComponentContext > & xCtx ) { return static_cast<cppu::OWeakObject*>(new DocxExportFilter( xCtx )); } diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index 8a10ac8ae651..0335062cf984 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -775,7 +775,7 @@ void DocxSdrExport::writeVMLDrawing(const SdrObject* sdrObj, const SwFrameFormat m_pImpl->m_pSerializer->endElementNS(XML_w, XML_pict); } -bool lcl_isLockedCanvas(const uno::Reference<drawing::XShape>& xShape) +static bool lcl_isLockedCanvas(const uno::Reference<drawing::XShape>& xShape) { bool bRet = false; uno::Sequence<beans::PropertyValue> propList = lclGetProperty(xShape, "InteropGrabBag"); @@ -984,7 +984,7 @@ void DocxSdrExport::writeDMLAndVMLDrawing(const SdrObject* sdrObj, } // Converts ARGB transparency (0..255) to drawingml alpha (opposite, and 0..100000) -OString lcl_ConvertTransparency(const Color& rColor) +static OString lcl_ConvertTransparency(const Color& rColor) { if (rColor.GetTransparency() > 0) { diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx index e8218ff98a5e..819e14c4ef21 100644 --- a/sw/source/filter/ww8/rtfsdrexport.cxx +++ b/sw/source/filter/ww8/rtfsdrexport.cxx @@ -101,15 +101,15 @@ void RtfSdrExport::AddShape(sal_uInt32 nShapeType, ShapeFlag nShapeFlags, sal_uI m_nShapeFlags = nShapeFlags; } -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, std::size_t& rVerticesPos, - sal_uInt16 nPointSize) +static inline sal_Int32 impl_GetPointComponent(const sal_uInt8*& pVal, std::size_t& rVerticesPos, + sal_uInt16 nPointSize) { sal_Int32 nRet = 0; if ((nPointSize == 0xfff0) || (nPointSize == 4)) diff --git a/sw/source/filter/ww8/writerwordglue.cxx b/sw/source/filter/ww8/writerwordglue.cxx index 8c88c6461c8c..e7d4ee46f61a 100644 --- a/sw/source/filter/ww8/writerwordglue.cxx +++ b/sw/source/filter/ww8/writerwordglue.cxx @@ -54,7 +54,7 @@ using namespace css; namespace myImplHelpers { - SwTwips CalcHdFtDist(const SwFrameFormat& rFormat, sal_uInt16 nSpacing) + static SwTwips CalcHdFtDist(const SwFrameFormat& rFormat, sal_uInt16 nSpacing) { /* The normal case for reexporting word docs is to have dynamic spacing, @@ -94,12 +94,12 @@ namespace myImplHelpers return nDist; } - SwTwips CalcHdDist(const SwFrameFormat& rFormat) + static SwTwips CalcHdDist(const SwFrameFormat& rFormat) { return CalcHdFtDist(rFormat, rFormat.GetULSpace().GetUpper()); } - SwTwips CalcFtDist(const SwFrameFormat& rFormat) + static SwTwips CalcFtDist(const SwFrameFormat& rFormat) { return CalcHdFtDist(rFormat, rFormat.GetULSpace().GetLower()); } @@ -313,7 +313,7 @@ namespace myImplHelpers return pColl ? 0 : maHelper.MakeStyle(aName); } - OUString FindBestMSSubstituteFont(const OUString &rFont) + static OUString FindBestMSSubstituteFont(const OUString &rFont) { if (IsStarSymbol(rFont)) return OUString("Arial Unicode MS"); @@ -756,7 +756,7 @@ namespace sw /** Find cFind in rParams if not embedded in " double quotes. Will NOT find '\\' or '"'. */ - sal_Int32 findUnquoted( const OUString& rParams, sal_Unicode cFind, sal_Int32 nFromPos ) + static sal_Int32 findUnquoted( const OUString& rParams, sal_Unicode cFind, sal_Int32 nFromPos ) { const sal_Int32 nLen = rParams.getLength(); if (nFromPos < 0 || nLen <= nFromPos) @@ -789,7 +789,7 @@ namespace sw /** Find all rFind in rParams if not embedded in " double quotes and replace with rReplace. Will NOT find '\\' or '"'. */ - bool replaceUnquoted( OUString& rParams, const OUString& rFind, const OUString& rReplace ) + static bool replaceUnquoted( OUString& rParams, const OUString& rFind, const OUString& rReplace ) { bool bReplaced = false; if (rFind.isEmpty()) diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index aca4539fd21e..ac7815c13a6a 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -564,7 +564,7 @@ sal_Int16 eHoriOri, sal_Int16 eHoriRel, SwTwips nPageLeft, return bRet; } -bool RTLDrawingsHack(long &rLeft, +static bool RTLDrawingsHack(long &rLeft, sal_Int16 eHoriOri, sal_Int16 eHoriRel, SwTwips nPageLeft, SwTwips nPageRight, SwTwips nPageSize) { @@ -1531,7 +1531,7 @@ void SwBasicEscherEx::WriteEmptyFlyFrame(const SwFrameFormat& rFormat, sal_uInt3 CloseContainer(); // ESCHER_SpContainer } -ShapeFlag AddMirrorFlags(ShapeFlag nFlags, const SwMirrorGrf &rMirror) +static ShapeFlag AddMirrorFlags(ShapeFlag nFlags, const SwMirrorGrf &rMirror) { switch (rMirror.GetValue()) { @@ -2838,7 +2838,7 @@ sal_Int32 SwEscherEx::WriteFlyFrame(const DrawObj &rObj, sal_uInt32 &rShapeId, return nBorderThick; } -sal_uInt16 FindPos(const SwFrameFormat &rFormat, unsigned int nHdFtIndex, +static sal_uInt16 FindPos(const SwFrameFormat &rFormat, unsigned int nHdFtIndex, DrawObjPointerVector &rPVec) { auto aEnd = rPVec.end(); diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 5bd578015214..32353635a075 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -232,7 +232,7 @@ SwWW8AttrIter::SwWW8AttrIter(MSWordExportBase& rWr, const SwTextNode& rTextNd) : nCurrentSwPos = SearchNext(1); } -sal_Int32 lcl_getMinPos( sal_Int32 pos1, sal_Int32 pos2 ) +static sal_Int32 lcl_getMinPos( sal_Int32 pos1, sal_Int32 pos2 ) { if ( pos1 >= 0 && pos2 >= 0 ) { @@ -855,7 +855,7 @@ void WW8AttributeOutput::EndRuby(const SwTextNode& /*rNode*/, sal_Int32 /*nPos*/ } /*#i15387# Better ideas welcome*/ -OUString &TruncateBookmark( OUString &rRet ) +static OUString &TruncateBookmark( OUString &rRet ) { if ( rRet.getLength() > 40 ) rRet = rRet.copy( 0, 40 ); diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 8cabd8d90f34..e5c423bd86ed 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -1527,7 +1527,7 @@ bool WW8Export::TransBrush(const Color& rCol, WW8_SHD& rShd) return !rCol.GetTransparency(); } -sal_uInt32 SuitableBGColor(Color nIn) +static sal_uInt32 SuitableBGColor(Color nIn) { if (nIn == COL_AUTO) return 0xFF000000; diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index 55d57a77174f..4f538c6eb565 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -105,7 +105,7 @@ using namespace sw::types; using namespace sw::util; // helper methods -Color WW8TransCol(SVBT32 nWC) +static Color WW8TransCol(SVBT32 nWC) { #if 1 // 1 = use predefined color, 0 = ignore @@ -460,7 +460,7 @@ SdrObject* SwWW8ImplReader::ReadPolyLine(WW8_DPHEAD const * pHd, SfxAllItemSet & return pObj; } -ESelection GetESelection(EditEngine const &rDrawEditEngine, long nCpStart, long nCpEnd) +static ESelection GetESelection(EditEngine const &rDrawEditEngine, long nCpStart, long nCpEnd) { sal_Int32 nPCnt = rDrawEditEngine.GetParagraphCount(); sal_Int32 nSP = 0; @@ -920,7 +920,7 @@ sal_Int32 SwWW8ImplReader::GetRangeAsDrawingString(OUString& rString, long nStar //how EditEngine does it, but preserve the length and replace the extra //chars with placeholders, record the position of the placeholders and //remove those extra chars after attributes have been inserted -std::vector<sal_Int32> replaceDosLineEndsButPreserveLength(OUString &rIn) +static std::vector<sal_Int32> replaceDosLineEndsButPreserveLength(OUString &rIn) { OUStringBuffer aNewData(rIn); std::vector<sal_Int32> aDosLineEndDummies; @@ -946,7 +946,7 @@ std::vector<sal_Int32> replaceDosLineEndsButPreserveLength(OUString &rIn) return aDosLineEndDummies; } -void removePositions(EditEngine &rDrawEditEngine, const std::vector<sal_Int32>& rDosLineEndDummies) +static void removePositions(EditEngine &rDrawEditEngine, const std::vector<sal_Int32>& rDosLineEndDummies) { for (auto aIter = rDosLineEndDummies.rbegin(); aIter != rDosLineEndDummies.rend(); ++aIter) { diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx index ab1183600fc1..d2d39f37d526 100644 --- a/sw/source/filter/ww8/ww8graf2.cxx +++ b/sw/source/filter/ww8/ww8graf2.cxx @@ -232,7 +232,7 @@ void wwZOrderer::InsertObject(SdrObject* pObject, sal_uLong nPos) } } -extern void WW8PicShadowToReal( WW8_PIC_SHADOW const * pPicS, WW8_PIC* pPic ); +static void WW8PicShadowToReal( WW8_PIC_SHADOW const * pPicS, WW8_PIC* pPic ); bool SwWW8ImplReader::GetPictGrafFromStream(Graphic& rGraphic, SvStream& rSrc) { diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index d7f24bff5596..92d9e9ec5a4f 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -176,7 +176,7 @@ static SwMacroInfo* GetMacroInfo( SdrObject* pObj ) return nullptr; }; -void lclGetAbsPath(OUString& rPath, sal_uInt16 nLevel, SwDocShell const * pDocShell) +static void lclGetAbsPath(OUString& rPath, sal_uInt16 nLevel, SwDocShell const * pDocShell) { OUStringBuffer aTmpStr; while( nLevel ) @@ -2855,7 +2855,7 @@ void SwWW8ImplReader::PostProcessAttrs() So a encoding converter that on an undefined character attempts to convert from 1252 on the undefined character */ -std::size_t Custom8BitToUnicode(rtl_TextToUnicodeConverter hConverter, +static std::size_t Custom8BitToUnicode(rtl_TextToUnicodeConverter hConverter, sal_Char const *pIn, std::size_t nInLen, sal_Unicode *pOut, std::size_t nOutLen) { const sal_uInt32 nFlags = @@ -4358,7 +4358,7 @@ void wwSectionManager::SetUseOn(wwSection &rSection) * Set the page descriptor on this node, handle the different cases for a text * node or a table */ -void GiveNodePageDesc(SwNodeIndex const &rIdx, const SwFormatPageDesc &rPgDesc, +static void GiveNodePageDesc(SwNodeIndex const &rIdx, const SwFormatPageDesc &rPgDesc, SwDoc &rDoc) { /* diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index d1378edf6aac..447083d83ab6 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -1613,7 +1613,7 @@ enum wwTableSprm sprmTDefTableNewShd, sprmTCellPadding, sprmTCellPaddingDefault }; -wwTableSprm GetTableSprm(sal_uInt16 nId, ww::WordVersion eVer) +static wwTableSprm GetTableSprm(sal_uInt16 nId, ww::WordVersion eVer) { switch (eVer) { @@ -3072,7 +3072,7 @@ void WW8TabDesc::SetTabShades( SwTableBox* pBox, short nWwIdx ) } } -SvxFrameDirection MakeDirection(sal_uInt16 nCode, bool bIsBiDi) +static SvxFrameDirection MakeDirection(sal_uInt16 nCode, bool bIsBiDi) { SvxFrameDirection eDir = SvxFrameDirection::Environment; // 1: Asian layout with rotated CJK characters diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index bda1388f5034..bcfdc2d95e4a 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -477,7 +477,7 @@ static void lcl_CopyGreaterEight(OUString &rDest, OUString const &rSrc, } } -OUString sanitizeString(const OUString& rString) +static OUString sanitizeString(const OUString& rString) { sal_Int32 i=0; while (i < rString.getLength()) @@ -1495,7 +1495,7 @@ WW8ListManager::~WW8ListManager() COVERITY_NOEXCEPT_FALSE } } -bool IsEqualFormatting(const SwNumRule &rOne, const SwNumRule &rTwo) +static bool IsEqualFormatting(const SwNumRule &rOne, const SwNumRule &rTwo) { bool bRet = ( diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 5e275d36034a..b265592e42de 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -305,7 +305,7 @@ static void lcl_ConvertSequenceName(OUString& rSequenceName) // FindParaStart() finds 1st Parameter that follows '\' and cToken // and returns start of this parameter or -1 -sal_Int32 FindParaStart( const OUString& rStr, sal_Unicode cToken, sal_Unicode cToken2 ) +static sal_Int32 FindParaStart( const OUString& rStr, sal_Unicode cToken, sal_Unicode cToken2 ) { bool bStr = false; // ignore inside a string @@ -334,7 +334,7 @@ sal_Int32 FindParaStart( const OUString& rStr, sal_Unicode cToken, sal_Unicode c // FindPara() finds the first parameter including '\' and cToken. // A new String will be allocated (has to be deallocated by the caller) // and everything that is part of the parameter will be returned. -OUString FindPara( const OUString& rStr, sal_Unicode cToken, sal_Unicode cToken2 ) +static OUString FindPara( const OUString& rStr, sal_Unicode cToken, sal_Unicode cToken2 ) { sal_Int32 n2; // end sal_Int32 n = FindParaStart( rStr, cToken, cToken2 ); // start @@ -408,7 +408,7 @@ bool SwWW8ImplReader::ForceFieldLanguage(SwField &rField, LanguageType nLang) return bRet; } -OUString GetWordDefaultDateStringAsUS(SvNumberFormatter* pFormatter, LanguageType nLang) +static OUString GetWordDefaultDateStringAsUS(SvNumberFormatter* pFormatter, LanguageType nLang) { //Get the system date in the correct final language layout, convert to //a known language and modify the 2 digit year part to be 4 digit, and @@ -691,7 +691,7 @@ sal_uInt16 SwWW8ImplReader::End_Field() return nRet; } -bool AcceptableNestedField(sal_uInt16 nFieldCode) +static bool AcceptableNestedField(sal_uInt16 nFieldCode) { switch (nFieldCode) { @@ -2203,7 +2203,7 @@ eF_ResT SwWW8ImplReader::Read_F_PgRef( WW8FieldDesc*, OUString& rStr ) //helper function //For MS MacroButton field, the symbol in plain text is always "(" (0x28), //which should be mapped according to the macro type -bool ConvertMacroSymbol( const OUString& rName, OUString& rReference ) +static bool ConvertMacroSymbol( const OUString& rName, OUString& rReference ) { bool bConverted = false; if( rReference == "(" ) diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 51547066ef96..3cb699a0a0d3 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -130,7 +130,7 @@ Color SwWW8ImplReader::GetCol(sal_uInt8 nIco) return nIco < SAL_N_ELEMENTS(eSwWW8ColA) ? eSwWW8ColA[nIco] : COL_AUTO; } -inline sal_uInt32 MSRoundTweak(sal_uInt32 x) +static inline sal_uInt32 MSRoundTweak(sal_uInt32 x) { return x; } @@ -1378,7 +1378,7 @@ static sal_uInt8 lcl_ReadBorders(bool bVer67, WW8_BRCVer9* brc, WW8PLCFx_Cp_FKP* return nBorder; } -void GetLineIndex(SvxBoxItem &rBox, short nLineThickness, short nSpace, +static void GetLineIndex(SvxBoxItem &rBox, short nLineThickness, short nSpace, sal_uInt32 cv, short nIdx, SvxBoxItemLine nOOIndex, sal_uInt16 nWWIndex, short *pSize) { @@ -1411,7 +1411,7 @@ void GetLineIndex(SvxBoxItem &rBox, short nLineThickness, short nSpace, } -void Set1Border(SvxBoxItem &rBox, const WW8_BRCVer9& rBor, SvxBoxItemLine nOOIndex, +static void Set1Border(SvxBoxItem &rBox, const WW8_BRCVer9& rBor, SvxBoxItemLine nOOIndex, sal_uInt16 nWWIndex, short *pSize, const bool bIgnoreSpace) { short nSpace; @@ -1542,7 +1542,7 @@ static void FlySecur1(short& rSize, const bool bBorder) rSize = nMin; } -inline bool SetValSprm( sal_Int16* pVar, WW8PLCFx_Cp_FKP* pPap, sal_uInt16 nId ) +static inline bool SetValSprm( sal_Int16* pVar, WW8PLCFx_Cp_FKP* pPap, sal_uInt16 nId ) { SprmResult aS = pPap->HasSprm(nId); if (aS.pSprm && aS.nRemainingData >= 2) @@ -1550,7 +1550,7 @@ inline bool SetValSprm( sal_Int16* pVar, WW8PLCFx_Cp_FKP* pPap, sal_uInt16 nId ) return aS.pSprm != nullptr; } -inline bool SetValSprm( sal_Int16* pVar, const WW8RStyle* pStyle, sal_uInt16 nId ) +static inline bool SetValSprm( sal_Int16* pVar, const WW8RStyle* pStyle, sal_uInt16 nId ) { SprmResult aS = pStyle->HasParaSprm(nId); if (aS.pSprm && aS.nRemainingData >= 2) @@ -4060,7 +4060,7 @@ void SwWW8ImplReader::Read_NoLineNumb(sal_uInt16 , const sal_uInt8* pData, short NewAttr( aLN ); } -bool lcl_HasExplicitLeft(const WW8PLCFMan *pPlcxMan, bool bVer67) +static bool lcl_HasExplicitLeft(const WW8PLCFMan *pPlcxMan, bool bVer67) { WW8PLCFx_Cp_FKP *pPap = pPlcxMan ? pPlcxMan->GetPapPLCF() : nullptr; if (pPap) @@ -5222,14 +5222,14 @@ struct SprmReadInfo FNReadRecord pReadFnc; }; -bool operator<(const SprmReadInfo &rFirst, const SprmReadInfo &rSecond) +static bool operator<(const SprmReadInfo &rFirst, const SprmReadInfo &rSecond) { return (rFirst.nId < rSecond.nId); } typedef ww::SortedArray<SprmReadInfo> wwSprmDispatcher; -const wwSprmDispatcher *GetWW2SprmDispatcher() +static const wwSprmDispatcher *GetWW2SprmDispatcher() { static SprmReadInfo aSprms[] = { @@ -5385,7 +5385,7 @@ const wwSprmDispatcher *GetWW2SprmDispatcher() return &aSprmSrch; } -const wwSprmDispatcher *GetWW6SprmDispatcher() +static const wwSprmDispatcher *GetWW6SprmDispatcher() { static SprmReadInfo aSprms[] = { @@ -5597,7 +5597,7 @@ const wwSprmDispatcher *GetWW6SprmDispatcher() return &aSprmSrch; } -const wwSprmDispatcher *GetWW8SprmDispatcher() +static const wwSprmDispatcher *GetWW8SprmDispatcher() { static SprmReadInfo aSprms[] = { diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index b8181307d82d..13c4999c0f46 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -838,33 +838,33 @@ SprmInfo wwSprmParser::GetSprmInfo(sal_uInt16 nId) const //-end -inline sal_uInt8 Get_Byte( sal_uInt8 *& p ) +static inline sal_uInt8 Get_Byte( sal_uInt8 *& p ) { sal_uInt8 n = *p; p += 1; return n; } -inline sal_uInt16 Get_UShort( sal_uInt8 *& p ) +static inline sal_uInt16 Get_UShort( sal_uInt8 *& p ) { const sal_uInt16 n = SVBT16ToShort( *reinterpret_cast<SVBT16*>(p) ); p += 2; return n; } -inline sal_Int16 Get_Short( sal_uInt8 *& p ) +static inline sal_Int16 Get_Short( sal_uInt8 *& p ) { return Get_UShort(p); } -inline sal_uInt32 Get_ULong( sal_uInt8 *& p ) +static inline sal_uInt32 Get_ULong( sal_uInt8 *& p ) { sal_uInt32 n = SVBT32ToUInt32( *reinterpret_cast<SVBT32*>(p) ); p += 4; return n; } -inline sal_Int32 Get_Long( sal_uInt8 *& p ) +static inline sal_Int32 Get_Long( sal_uInt8 *& p ) { return Get_ULong(p); } @@ -2592,12 +2592,12 @@ bool WW8PLCFx_Fc_FKP::WW8Fkp::Entry::operator< return (mnFC < rSecond.mnFC); } -bool IsReplaceAllSprm(sal_uInt16 nSpId) +static bool IsReplaceAllSprm(sal_uInt16 nSpId) { return (NS_sprm::LN_PHugePapx == nSpId || 0x6646 == nSpId); } -bool IsExpandableSprm(sal_uInt16 nSpId) +static bool IsExpandableSprm(sal_uInt16 nSpId) { return 0x646B == nSpId; } @@ -6608,7 +6608,7 @@ MSOFactoidType::MSOFactoidType() namespace MSOPBString { -OUString Read(SvStream& rStream) +static OUString Read(SvStream& rStream) { OUString aRet; @@ -6624,7 +6624,7 @@ OUString Read(SvStream& rStream) return aRet; } -void Write(const OUString& rString, SvStream& rStream) +static void Write(const OUString& rString, SvStream& rStream) { sal_uInt16 nBuf = 0; nBuf |= rString.getLength(); // cch, 0..14th bits. diff --git a/sw/source/filter/xml/xmlithlp.cxx b/sw/source/filter/xml/xmlithlp.cxx index d879292d5aba..56cd728628ae 100644 --- a/sw/source/filter/xml/xmlithlp.cxx +++ b/sw/source/filter/xml/xmlithlp.cxx @@ -132,7 +132,7 @@ bool sw_frmitems_parseXMLBorder( const OUString& rValue, return rHasStyle || rHasWidth || rHasColor; } -void sw_frmitems_setXMLBorderStyle( SvxBorderLine& rLine, sal_uInt16 nStyle ) +static void sw_frmitems_setXMLBorderStyle( SvxBorderLine& rLine, sal_uInt16 nStyle ) { SvxBorderLineStyle eStyle = SvxBorderLineStyle::NONE; if ( nStyle != table::BorderLineStyle::NONE ) diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx index be094bddc51f..15de25952958 100644 --- a/sw/source/ui/chrdlg/drpcps.cxx +++ b/sw/source/ui/chrdlg/drpcps.cxx @@ -105,7 +105,7 @@ void SwDropCapsPict::InitPrinter() } // Create Default-String from character-count (A, AB, ABC, ...) -OUString GetDefaultString(sal_Int32 nChars) +static OUString GetDefaultString(sal_Int32 nChars) { OUStringBuffer aStr(nChars); for (sal_Int32 i = 0; i < nChars; i++) diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx index c7ef44e4ff39..5ea1304c1d66 100644 --- a/sw/source/ui/config/optcomp.cxx +++ b/sw/source/ui/config/optcomp.cxx @@ -98,7 +98,7 @@ void SwCompatibilityOptPage::dispose() SfxTabPage::dispose(); } -sal_uLong convertBools2Ulong_Impl +static sal_uLong convertBools2Ulong_Impl ( bool _bUsePrtMetrics, bool _bAddSpacing, diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx index 51a66653b94e..cc3adc0c97f5 100644 --- a/sw/source/ui/frmdlg/column.cxx +++ b/sw/source/ui/frmdlg/column.cxx @@ -75,7 +75,7 @@ using namespace ::com::sun::star; // static data static const sal_uInt16 nVisCols = 3; -inline bool IsMarkInSameSection( SwWrtShell& rWrtSh, const SwSection* pSect ) +static inline bool IsMarkInSameSection( SwWrtShell& rWrtSh, const SwSection* pSect ) { rWrtSh.SwapPam(); bool bRet = pSect == rWrtSh.GetCurrSection(); @@ -347,6 +347,7 @@ SfxItemSet* SwColumnDlg::EvalCurrentSelection(void) return pSet; } +static #if OSL_DEBUG_LEVEL < 2 inline #endif diff --git a/sw/source/ui/table/autoformatpreview.cxx b/sw/source/ui/table/autoformatpreview.cxx index 61af87bdf6e6..f89f33b3396b 100644 --- a/sw/source/ui/table/autoformatpreview.cxx +++ b/sw/source/ui/table/autoformatpreview.cxx @@ -370,8 +370,8 @@ void AutoFormatPreview::CalcCellArray(bool _bFitWidth) maPreviousSize.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, 0.05, 5); } diff --git a/sw/source/ui/vba/vbaborders.cxx b/sw/source/ui/vba/vbaborders.cxx index f0a29acdd0fc..c3a396ada279 100644 --- a/sw/source/ui/vba/vbaborders.cxx +++ b/sw/source/ui/vba/vbaborders.cxx @@ -275,7 +275,7 @@ public: } }; -uno::Reference< container::XIndexAccess > +static uno::Reference< container::XIndexAccess > rangeToBorderIndexAccess( const uno::Reference< table::XCellRange >& xRange, const uno::Reference< uno::XComponentContext > & xContext, VbaPalette const & rPalette ) { return new RangeBorders( xRange, xContext, rPalette ); diff --git a/sw/source/ui/vba/vbavariables.cxx b/sw/source/ui/vba/vbavariables.cxx index d0bfe6bf9d23..eac1278452b6 100644 --- a/sw/source/ui/vba/vbavariables.cxx +++ b/sw/source/ui/vba/vbavariables.cxx @@ -25,7 +25,7 @@ using namespace ::ooo::vba; using namespace ::com::sun::star; /// @throws uno::RuntimeException -uno::Reference< container::XIndexAccess > createVariablesAccess( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< beans::XPropertyAccess >& xUserDefined ) +static uno::Reference< container::XIndexAccess > createVariablesAccess( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< beans::XPropertyAccess >& xUserDefined ) { // FIXME: the performance is poor? XNamedObjectCollectionHelper< word::XVariable >::XNamedVec aVariables; diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx index cd8b77dd87ae..89a99f79d727 100644 --- a/sw/source/uibase/app/apphdl.cxx +++ b/sw/source/uibase/app/apphdl.cxx @@ -208,7 +208,7 @@ void SwModule::StateOther(SfxItemSet &rSet) } // start field dialog -void NewXForms( SfxRequest& rReq ); // implementation: below +static void NewXForms( SfxRequest& rReq ); // implementation: below std::shared_ptr<SwMailMergeConfigItem> SwView::EnsureMailMergeConfigItem(const SfxItemSet* pArgs) { diff --git a/sw/source/uibase/app/swmodul1.cxx b/sw/source/uibase/app/swmodul1.cxx index e23635f8485e..d366ba6d0066 100644 --- a/sw/source/uibase/app/swmodul1.cxx +++ b/sw/source/uibase/app/swmodul1.cxx @@ -439,7 +439,7 @@ static Color lcl_GetAuthorColor(std::size_t nPos) } /// Returns a JSON representation of a redline author. -boost::property_tree::ptree lcl_AuthorToJson(const OUString& rAuthor, std::size_t nIndex) +static boost::property_tree::ptree lcl_AuthorToJson(const OUString& rAuthor, std::size_t nIndex) { boost::property_tree::ptree aRet; aRet.put("index", nIndex); diff --git a/sw/source/uibase/docvw/AnnotationMenuButton.cxx b/sw/source/uibase/docvw/AnnotationMenuButton.cxx index 6f81e9912c70..1b4a19171f28 100644 --- a/sw/source/uibase/docvw/AnnotationMenuButton.cxx +++ b/sw/source/uibase/docvw/AnnotationMenuButton.cxx @@ -36,7 +36,7 @@ namespace sw { namespace annotation { -Color ColorFromAlphaColor(const sal_uInt8 aTransparency, const Color& aFront, const Color& aBack) +static Color ColorFromAlphaColor(const sal_uInt8 aTransparency, const Color& aFront, const Color& aBack) { return Color(sal_uInt8(aFront.GetRed() * aTransparency / 255.0 + aBack.GetRed() * (1 - aTransparency / 255.0)), sal_uInt8(aFront.GetGreen() * aTransparency / 255.0 + aBack.GetGreen() * (1 - aTransparency / 255.0)), diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 393b3af5c4ad..c0d838e3a982 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -313,7 +313,7 @@ struct QuickHelpData #define HIT_PIX 2 /* hit tolerance in pixel */ #define MIN_MOVE 4 -inline bool IsMinMove(const Point &rStartPos, const Point &rLPt) +static inline bool IsMinMove(const Point &rStartPos, const Point &rLPt) { return std::abs(rStartPos.X() - rLPt.X()) > MIN_MOVE || std::abs(rStartPos.Y() - rLPt.Y()) > MIN_MOVE; @@ -325,7 +325,7 @@ inline bool IsMinMove(const Point &rStartPos, const Point &rLPt) * in selecting, with DrawObjects; at SwgFlys to trigger * hyperlinks if applicable (Download/NewWindow!) */ -inline bool IsDrawObjSelectable( const SwWrtShell& rSh, const Point& rPt ) +static inline bool IsDrawObjSelectable( const SwWrtShell& rSh, const Point& rPt ) { bool bRet = true; SdrObject* pObj; diff --git a/sw/source/uibase/fldui/fldmgr.cxx b/sw/source/uibase/fldui/fldmgr.cxx index 4fe742b92cf6..6a5dc759e14d 100644 --- a/sw/source/uibase/fldui/fldmgr.cxx +++ b/sw/source/uibase/fldui/fldmgr.cxx @@ -364,7 +364,7 @@ static SwWrtShell* lcl_GetShell() return nullptr; } -inline sal_uInt16 GetPackCount() { return SAL_N_ELEMENTS(aSwFields); } +static inline sal_uInt16 GetPackCount() { return SAL_N_ELEMENTS(aSwFields); } // FieldManager controls inserting and updating of fields SwFieldMgr::SwFieldMgr(SwWrtShell* pSh ) : diff --git a/sw/source/uibase/misc/glosdoc.cxx b/sw/source/uibase/misc/glosdoc.cxx index c0d17e3cc95e..60a9bdcb6aa6 100644 --- a/sw/source/uibase/misc/glosdoc.cxx +++ b/sw/source/uibase/misc/glosdoc.cxx @@ -337,7 +337,7 @@ SwGlossaries::SwGlossaries() } // set new path and recreate internal array -OUString lcl_makePath(const std::vector<OUString>& rPaths) +static OUString lcl_makePath(const std::vector<OUString>& rPaths) { std::vector<OUString>::const_iterator aIt(rPaths.begin()); const std::vector<OUString>::const_iterator aEnd(rPaths.end()); diff --git a/sw/source/uibase/sidebar/PageStylesPanel.cxx b/sw/source/uibase/sidebar/PageStylesPanel.cxx index 94a5d99c46cc..971ba20ae919 100644 --- a/sw/source/uibase/sidebar/PageStylesPanel.cxx +++ b/sw/source/uibase/sidebar/PageStylesPanel.cxx @@ -58,7 +58,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 ) @@ -67,7 +67,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; diff --git a/sw/source/uibase/uiview/viewport.cxx b/sw/source/uibase/uiview/viewport.cxx index 2896dbd653cd..061ae5dc1bbc 100644 --- a/sw/source/uibase/uiview/viewport.cxx +++ b/sw/source/uibase/uiview/viewport.cxx @@ -50,6 +50,8 @@ #include <comphelper/lok.hxx> #include <vcl/weld.hxx> +#include "viewfunc.hxx" + // The SetVisArea of the DocShell must not be called from InnerResizePixel. // But our adjustments must take place. static bool bProtectDocShellVisArea = false; @@ -68,7 +70,7 @@ bool SwView::IsDocumentBorder() SvxZoomType::PAGEWIDTH_NOBORDER == m_pWrtShell->GetViewOptions()->GetZoomType(); } -inline long GetLeftMargin( SwView const &rView ) +static inline long GetLeftMargin( SwView const &rView ) { SvxZoomType eType = rView.GetWrtShell().GetViewOptions()->GetZoomType(); long lRet = rView.GetWrtShell().GetAnyCurRect(CurRectType::PagePrt).Left(); diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx index a823ec0c4705..d996777be209 100644 --- a/sw/source/uibase/uiview/viewtab.cxx +++ b/sw/source/uibase/uiview/viewtab.cxx @@ -183,7 +183,7 @@ static void lcl_Scale(long& nVal, long nScale) nVal >>= 8; } -void ResizeFrameCols(SwFormatCol& rCol, +static void ResizeFrameCols(SwFormatCol& rCol, long nOldWidth, long nNewWidth, long nLeftDelta ) diff --git a/sw/source/uibase/uno/unomailmerge.cxx b/sw/source/uibase/uno/unomailmerge.cxx index 2816b6a0aa70..cdbd0ff171d5 100644 --- a/sw/source/uibase/uno/unomailmerge.cxx +++ b/sw/source/uibase/uno/unomailmerge.cxx @@ -81,7 +81,7 @@ using namespace SWUnoHelper; typedef ::utl::SharedUNOComponent< XInterface > SharedComponent; -osl::Mutex & GetMailMergeMutex() +static osl::Mutex & GetMailMergeMutex() { static osl::Mutex aMutex; return aMutex; diff --git a/sw/source/uibase/utlui/uitool.cxx b/sw/source/uibase/utlui/uitool.cxx index 2bac72c751fc..e2a3276464f1 100644 --- a/sw/source/uibase/utlui/uitool.cxx +++ b/sw/source/uibase/utlui/uitool.cxx @@ -179,7 +179,7 @@ void ConvertAttrGenToChar(SfxItemSet& rSet, const SfxItemSet& rOrigSet) // Fill header footer -void FillHdFt(SwFrameFormat* pFormat, const SfxItemSet& rSet) +static void FillHdFt(SwFrameFormat* pFormat, const SfxItemSet& rSet) { SwAttrSet aSet(pFormat->GetAttrSet()); aSet.Put(rSet); @@ -196,7 +196,7 @@ void FillHdFt(SwFrameFormat* pFormat, const SfxItemSet& rSet) } /// Convert from UseOnPage to SvxPageUsage. -SvxPageUsage lcl_convertUseToSvx(UseOnPage nUse) +static SvxPageUsage lcl_convertUseToSvx(UseOnPage nUse) { SvxPageUsage nRet = SvxPageUsage::NONE; if (nUse & UseOnPage::Left) @@ -211,7 +211,7 @@ SvxPageUsage lcl_convertUseToSvx(UseOnPage nUse) } /// Convert from SvxPageUsage to UseOnPage. -UseOnPage lcl_convertUseFromSvx(SvxPageUsage nUse) +static UseOnPage lcl_convertUseFromSvx(SvxPageUsage nUse) { UseOnPage nRet = UseOnPage::NONE; if (nUse == SvxPageUsage::Left) diff --git a/test/source/bootstrapfixture.cxx b/test/source/bootstrapfixture.cxx index a8da11caed92..e3ee687374c5 100644 --- a/test/source/bootstrapfixture.cxx +++ b/test/source/bootstrapfixture.cxx @@ -63,7 +63,7 @@ test::BootstrapFixture::BootstrapFixture( bool bAssertOnDialog, bool bNeedUCB ) extern "C" { -void test_init_impl(bool bAssertOnDialog, bool bNeedUCB, +static void test_init_impl(bool bAssertOnDialog, bool bNeedUCB, lang::XMultiServiceFactory * pSFactory) { if (bAssertOnDialog) diff --git a/test/source/sheet/xsheetoutline.cxx b/test/source/sheet/xsheetoutline.cxx index 8a41e3a94346..323560b3a8ac 100644 --- a/test/source/sheet/xsheetoutline.cxx +++ b/test/source/sheet/xsheetoutline.cxx @@ -37,7 +37,7 @@ const OUString rowLevel2 = "OutlineSheet.A3:A27"; const OUString rowLevel3 = "OutlineSheet.A5:A24"; const OUString rowLevel4 = "OutlineSheet.A7:A21"; -OUString getVisibleAdress( +static OUString getVisibleAdress( uno::Reference<sheet::XSpreadsheet> const& xSheet, const OUString& aLevelRangeString) { @@ -53,7 +53,7 @@ OUString getVisibleAdress( } -table::CellRangeAddress getAddressFromRangeString( +static table::CellRangeAddress getAddressFromRangeString( uno::Reference<sheet::XSpreadsheet> const& xSheet, const OUString& aStringAddress) { diff --git a/testtools/source/bridgetest/bridgetest.cxx b/testtools/source/bridgetest/bridgetest.cxx index 6ef7367ffdc2..990d7d3b729e 100644 --- a/testtools/source/bridgetest/bridgetest.cxx +++ b/testtools/source/bridgetest/bridgetest.cxx @@ -71,7 +71,7 @@ using namespace test::testtools::bridgetest; namespace bridge_test { template<typename T, typename U = T> -Sequence<T> cloneSequence(const Sequence<T>& val); +static Sequence<T> cloneSequence(const Sequence<T>& val); inline static Sequence< OUString > getSupportedServiceNames() @@ -998,7 +998,7 @@ static bool raiseException( const Reference< XBridgeTest > & xLBT ) /* Returns an acquired sequence */ -uno_Sequence* cloneSequence(const uno_Sequence* val, const Type& type) +static uno_Sequence* cloneSequence(const uno_Sequence* val, const Type& type) { TypeDescription td(type); td.makeComplete(); @@ -1045,7 +1045,7 @@ Sequence<T> cloneSequence(const Sequence<T>& val) } template< class T > -inline bool makeSurrogate( +static inline bool makeSurrogate( Reference< T > & rOut, Reference< T > const & rOriginal ) { rOut.clear(); diff --git a/testtools/source/bridgetest/cppobj.cxx b/testtools/source/bridgetest/cppobj.cxx index 2e646bfb5a18..dc5880c1b71c 100644 --- a/testtools/source/bridgetest/cppobj.cxx +++ b/testtools/source/bridgetest/cppobj.cxx @@ -622,11 +622,11 @@ void Test_Impl::raiseRuntimeExceptionOneway( const OUString & rMsg, const Refere throw aExc; } -void dothrow2(const RuntimeException& e) +static void dothrow2(const RuntimeException& e) { throw e; } -void dothrow(const RuntimeException& e) +static void dothrow(const RuntimeException& e) { #if defined _MSC_VER // currently only for MSVC: diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index 65b14459e8bd..9edf3ed9086c 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -314,7 +314,7 @@ Reference< XStyleSettings > VCLXWindowImpl::getStyleSettings() // Uses an out-parameter instead of return value, due to the object reference -void ImplInitWindowEvent( css::awt::WindowEvent& rEvent, vcl::Window const * pWindow ) +static void ImplInitWindowEvent( css::awt::WindowEvent& rEvent, vcl::Window const * pWindow ) { Point aPos = pWindow->GetPosPixel(); Size aSz = pWindow->GetSizePixel(); diff --git a/toolkit/source/controls/stdtabcontrollermodel.cxx b/toolkit/source/controls/stdtabcontrollermodel.cxx index ca35f7fad168..47bf8072e44a 100644 --- a/toolkit/source/controls/stdtabcontrollermodel.cxx +++ b/toolkit/source/controls/stdtabcontrollermodel.cxx @@ -155,7 +155,7 @@ sal_uInt32 StdTabControllerModel::ImplGetControlPos( const css::uno::Reference< return CONTROLPOS_NOTFOUND; } -void ImplWriteControls( const css::uno::Reference< css::io::XObjectOutputStream > & OutStream, const css::uno::Sequence< css::uno::Reference< css::awt::XControlModel > >& rCtrls ) +static void ImplWriteControls( const css::uno::Reference< css::io::XObjectOutputStream > & OutStream, const css::uno::Sequence< css::uno::Reference< css::awt::XControlModel > >& rCtrls ) { css::uno::Reference< css::io::XMarkableStream > xMark( OutStream, css::uno::UNO_QUERY ); DBG_ASSERT( xMark.is(), "write: no XMarkableStream!" ); @@ -186,7 +186,7 @@ void ImplWriteControls( const css::uno::Reference< css::io::XObjectOutputStream xMark->deleteMark(nDataBeginMark); } -css::uno::Sequence< css::uno::Reference< css::awt::XControlModel > > ImplReadControls( const css::uno::Reference< css::io::XObjectInputStream > & InStream ) +static css::uno::Sequence< css::uno::Reference< css::awt::XControlModel > > ImplReadControls( const css::uno::Reference< css::io::XObjectInputStream > & InStream ) { css::uno::Reference< css::io::XMarkableStream > xMark( InStream, css::uno::UNO_QUERY ); DBG_ASSERT( xMark.is(), "write: no XMarkableStream!" ); diff --git a/toolkit/source/controls/unocontrolcontainer.cxx b/toolkit/source/controls/unocontrolcontainer.cxx index be64fb6eee17..b704b0dd01cb 100644 --- a/toolkit/source/controls/unocontrolcontainer.cxx +++ b/toolkit/source/controls/unocontrolcontainer.cxx @@ -299,7 +299,7 @@ OUString UnoControlHolderList::impl_getFreeName_throw() // Function to set the controls' visibility according // to the dialog's "Step" property -void implUpdateVisibility +static void implUpdateVisibility ( sal_Int32 nDialogStep, const uno::Reference< awt::XControlContainer >& xControlContainer diff --git a/toolkit/source/helper/property.cxx b/toolkit/source/helper/property.cxx index 1a5c0a6b1ed9..f29ca532293a 100644 --- a/toolkit/source/helper/property.cxx +++ b/toolkit/source/helper/property.cxx @@ -88,7 +88,7 @@ struct ImplPropertyInfo #define DECL_DEP_PROP_3( asciiname, id, type, attrib1, attrib2, attrib3 ) \ ImplPropertyInfo( asciiname, BASEPROPERTY_##id, cppu::UnoType<type>::get(), css::beans::PropertyAttribute::attrib1 | css::beans::PropertyAttribute::attrib2 | css::beans::PropertyAttribute::attrib3, true ) -ImplPropertyInfo* ImplGetPropertyInfos( sal_uInt16& rElementCount ) +static ImplPropertyInfo* ImplGetPropertyInfos( sal_uInt16& rElementCount ) { static ImplPropertyInfo* pPropertyInfos = nullptr; static sal_uInt16 nElements = 0; @@ -304,7 +304,7 @@ struct ImplPropertyInfoCompareFunctor } }; -void ImplAssertValidPropertyArray() +static void ImplAssertValidPropertyArray() { static bool bSorted = false; if( !bSorted ) @@ -331,7 +331,7 @@ sal_uInt16 GetPropertyId( const OUString& rPropertyName ) return ( pInf && pInf != (pInfo+nElements) && pInf->aName == rPropertyName) ? pInf->nPropId: 0; } -const ImplPropertyInfo* ImplGetImplPropertyInfo( sal_uInt16 nPropertyId ) +static const ImplPropertyInfo* ImplGetImplPropertyInfo( sal_uInt16 nPropertyId ) { ImplAssertValidPropertyArray(); diff --git a/toolkit/source/helper/unowrapper.cxx b/toolkit/source/helper/unowrapper.cxx index b38ceeded3ab..f0e2c2dc0e66 100644 --- a/toolkit/source/helper/unowrapper.cxx +++ b/toolkit/source/helper/unowrapper.cxx @@ -38,7 +38,7 @@ using namespace ::com::sun::star; -css::uno::Reference< css::awt::XWindowPeer > CreateXWindow( vcl::Window const * pWindow ) +static css::uno::Reference< css::awt::XWindowPeer > CreateXWindow( vcl::Window const * pWindow ) { switch ( pWindow->GetType() ) { diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx index 1c5717e8ec86..48cd2f4c2881 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -53,7 +53,7 @@ #define SMALL_DVALUE 0.0000001 #define FSQRT2 1.4142135623730950488016887242097 -inline double ImplGetParameter( const Point& rCenter, const Point& rPt, double fWR, double fHR ) +static inline double ImplGetParameter( const Point& rCenter, const Point& rPt, double fWR, double fHR ) { const long nDX = rPt.X() - rCenter.X(); double fAngle = atan2( -rPt.Y() + rCenter.Y(), ( ( nDX == 0 ) ? 0.000000001 : nDX ) ); @@ -1708,7 +1708,7 @@ void Polygon::Write( SvStream& rOStream ) const } // #i74631#/#i115917# numerical correction method for B2DPolygon -void impCorrectContinuity(basegfx::B2DPolygon& roPolygon, sal_uInt32 nIndex, PolyFlags nCFlag) +static void impCorrectContinuity(basegfx::B2DPolygon& roPolygon, sal_uInt32 nIndex, PolyFlags nCFlag) { const sal_uInt32 nPointCount(roPolygon.count()); OSL_ENSURE(nIndex < nPointCount, "impCorrectContinuity: index access out of range (!)"); diff --git a/ucb/source/core/ucbstore.cxx b/ucb/source/core/ucbstore.cxx index fa123e6c9c65..e4b13acaa379 100644 --- a/ucb/source/core/ucbstore.cxx +++ b/ucb/source/core/ucbstore.cxx @@ -61,7 +61,7 @@ using namespace comphelper; using namespace cppu; -OUString makeHierarchalNameSegment( const OUString & rIn ) +static OUString makeHierarchalNameSegment( const OUString & rIn ) { OUStringBuffer aBuffer; aBuffer.append( "['" ); diff --git a/ucb/source/ucp/file/filrow.cxx b/ucb/source/ucp/file/filrow.cxx index 9701a5501972..d8cf74af53b3 100644 --- a/ucb/source/ucp/file/filrow.cxx +++ b/ucb/source/ucp/file/filrow.cxx @@ -39,7 +39,7 @@ using namespace css::uno; // Function for TypeConverting template< class _type_ > -bool convert( TaskManager* pShell, +static bool convert( TaskManager* pShell, uno::Reference< script::XTypeConverter >& xConverter, uno::Any& rValue, _type_& aReturn ) diff --git a/ucb/source/ucp/ftp/ftpdirp.cxx b/ucb/source/ucp/ftp/ftpdirp.cxx index ca439aa31a8a..b7270ac91e2a 100644 --- a/ucb/source/ucp/ftp/ftpdirp.cxx +++ b/ucb/source/ucp/ftp/ftpdirp.cxx @@ -29,7 +29,7 @@ using namespace ftp; -inline bool ascii_isWhitespace( sal_Unicode ch ) +static inline bool ascii_isWhitespace( sal_Unicode ch ) { return ((ch <= 0x20) && ch); } diff --git a/ucb/source/ucp/ftp/ftploaderthread.cxx b/ucb/source/ucp/ftp/ftploaderthread.cxx index 315ccb79e7fa..0b2777393873 100644 --- a/ucb/source/ucp/ftp/ftploaderthread.cxx +++ b/ucb/source/ucp/ftp/ftploaderthread.cxx @@ -36,12 +36,12 @@ using namespace ftp; extern "C" { - int memory_write_dummy(void *,size_t,size_t,void *) + static int memory_write_dummy(void *,size_t,size_t,void *) { return 0; } - void delete_CURL(void *pData) + static void delete_CURL(void *pData) { // Otherwise response for QUIT will be sent to already destroyed // MemoryContainer via non-dummy memory_write function. diff --git a/ucb/source/ucp/ftp/ftpurl.cxx b/ucb/source/ucp/ftp/ftpurl.cxx index 6a671ddd291c..3c6036115e06 100644 --- a/ucb/source/ucp/ftp/ftpurl.cxx +++ b/ucb/source/ucp/ftp/ftpurl.cxx @@ -613,7 +613,7 @@ FTPDirentry FTPURL::direntry() const extern "C" { - size_t memory_read(void *ptr,size_t size,size_t nmemb,void *stream) + static size_t memory_read(void *ptr,size_t size,size_t nmemb,void *stream) { sal_Int32 nRequested = sal_Int32(size*nmemb); CurlInput *curlInput = static_cast<CurlInput*>(stream); diff --git a/ucb/source/ucp/hierarchy/hierarchydata.cxx b/ucb/source/ucp/hierarchy/hierarchydata.cxx index e211d125ab93..7be61954aae2 100644 --- a/ucb/source/ucp/hierarchy/hierarchydata.cxx +++ b/ucb/source/ucp/hierarchy/hierarchydata.cxx @@ -60,7 +60,7 @@ struct HierarchyEntry::iterator_Impl }; -void makeXMLName( const OUString & rIn, OUStringBuffer & rBuffer ) +static void makeXMLName( const OUString & rIn, OUStringBuffer & rBuffer ) { sal_Int32 nCount = rIn.getLength(); for ( sal_Int32 n = 0; n < nCount; ++n ) diff --git a/ucb/source/ucp/webdav-neon/LinkSequence.cxx b/ucb/source/ucp/webdav-neon/LinkSequence.cxx index 6cbf9f0df915..da0bd63aebd1 100644 --- a/ucb/source/ucp/webdav-neon/LinkSequence.cxx +++ b/ucb/source/ucp/webdav-neon/LinkSequence.cxx @@ -54,7 +54,9 @@ struct LinkSequenceParseContext #define STATE_SRC (STATE_TOP + 2) -extern "C" int LinkSequence_startelement_callback( +extern "C" { + +static int LinkSequence_startelement_callback( void *, int parent, const char * /*nspace*/, @@ -82,7 +84,7 @@ extern "C" int LinkSequence_startelement_callback( } -extern "C" int LinkSequence_chardata_callback( +static int LinkSequence_chardata_callback( void *userdata, int state, const char *buf, @@ -111,7 +113,7 @@ extern "C" int LinkSequence_chardata_callback( } -extern "C" int LinkSequence_endelement_callback( +static int LinkSequence_endelement_callback( void *userdata, int state, const char *, @@ -132,6 +134,7 @@ extern "C" int LinkSequence_endelement_callback( return 0; // zero to continue, non-zero to abort parsing } +} // static bool LinkSequence::createFromXML( const OString & rInData, diff --git a/ucb/source/ucp/webdav-neon/LockEntrySequence.cxx b/ucb/source/ucp/webdav-neon/LockEntrySequence.cxx index 263211347820..0023769bcc9a 100644 --- a/ucb/source/ucp/webdav-neon/LockEntrySequence.cxx +++ b/ucb/source/ucp/webdav-neon/LockEntrySequence.cxx @@ -56,7 +56,9 @@ struct LockEntrySequenceParseContext #define STATE_WRITE (STATE_TOP + 5) -extern "C" int LockEntrySequence_startelement_callback( +extern "C" { + +static int LockEntrySequence_startelement_callback( void *, int parent, const char * /*nspace*/, @@ -121,7 +123,7 @@ extern "C" int LockEntrySequence_startelement_callback( } -extern "C" int LockEntrySequence_chardata_callback( +static int LockEntrySequence_chardata_callback( void *, int, const char *, @@ -131,7 +133,7 @@ extern "C" int LockEntrySequence_chardata_callback( } -extern "C" int LockEntrySequence_endelement_callback( +static int LockEntrySequence_endelement_callback( void *userdata, int state, const char *, @@ -180,6 +182,7 @@ extern "C" int LockEntrySequence_endelement_callback( return 0; // zero to continue, non-zero to abort parsing } +} // static bool LockEntrySequence::createFromXML( const OString & rInData, diff --git a/ucb/source/ucp/webdav-neon/LockSequence.cxx b/ucb/source/ucp/webdav-neon/LockSequence.cxx index 210a52ceb88d..917945824d11 100644 --- a/ucb/source/ucp/webdav-neon/LockSequence.cxx +++ b/ucb/source/ucp/webdav-neon/LockSequence.cxx @@ -65,7 +65,9 @@ struct LockSequenceParseContext #define STATE_HREF (STATE_TOP + 10) -extern "C" int LockSequence_startelement_callback( +extern "C" { + +static int LockSequence_startelement_callback( void *, int parent, const char * /*nspace*/, @@ -122,7 +124,7 @@ extern "C" int LockSequence_startelement_callback( } -extern "C" int LockSequence_chardata_callback( +static int LockSequence_chardata_callback( void *userdata, int state, const char *buf, @@ -231,7 +233,7 @@ extern "C" int LockSequence_chardata_callback( } -extern "C" int LockSequence_endelement_callback( +static int LockSequence_endelement_callback( void *userdata, int state, const char *, @@ -295,6 +297,7 @@ extern "C" int LockSequence_endelement_callback( return 0; // zero to continue, non-zero to abort parsing } +} // static bool LockSequence::createFromXML( const OString & rInData, diff --git a/ucb/source/ucp/webdav-neon/NeonPropFindRequest.cxx b/ucb/source/ucp/webdav-neon/NeonPropFindRequest.cxx index 3e25121d28fa..531ab229f976 100644 --- a/ucb/source/ucp/webdav-neon/NeonPropFindRequest.cxx +++ b/ucb/source/ucp/webdav-neon/NeonPropFindRequest.cxx @@ -80,7 +80,9 @@ namespace } } -extern "C" int NPFR_propfind_iter( void* userdata, +extern "C" { + +static int NPFR_propfind_iter( void* userdata, const NeonPropName* pname, const char* value, const HttpStatus* status ) @@ -188,7 +190,7 @@ extern "C" int NPFR_propfind_iter( void* userdata, return 0; // Go on. } -extern "C" void NPFR_propfind_results( void* userdata, +static void NPFR_propfind_results( void* userdata, const ne_uri* uri, const NeonPropFindResultSet* set ) { @@ -205,7 +207,7 @@ extern "C" void NPFR_propfind_results( void* userdata, theResources->push_back( theResource ); } -extern "C" int NPFR_propnames_iter( void* userdata, +static int NPFR_propnames_iter( void* userdata, const NeonPropName* pname, const char* /*value*/, const HttpStatus* /*status*/ ) @@ -220,7 +222,7 @@ extern "C" int NPFR_propnames_iter( void* userdata, return 0; } -extern "C" void NPFR_propnames_results( void* userdata, +static void NPFR_propnames_results( void* userdata, const ne_uri* /*uri*/, const NeonPropFindResultSet* results ) { @@ -237,6 +239,8 @@ extern "C" void NPFR_propnames_results( void* userdata, theResources->push_back( theResource ); } +} + NeonPropFindRequest::NeonPropFindRequest( HttpSession* inSession, const char* inPath, const Depth inDepth, diff --git a/ucb/source/ucp/webdav-neon/NeonSession.cxx b/ucb/source/ucp/webdav-neon/NeonSession.cxx index e17c1f03cfcc..81fa6adca3ad 100644 --- a/ucb/source/ucp/webdav-neon/NeonSession.cxx +++ b/ucb/source/ucp/webdav-neon/NeonSession.cxx @@ -199,7 +199,9 @@ struct NeonRequestContext }; // A simple Neon response_block_reader for use with an XInputStream -extern "C" int NeonSession_ResponseBlockReader(void * inUserData, +extern "C" { + +static int NeonSession_ResponseBlockReader(void * inUserData, const char * inBuf, size_t inLen ) { @@ -213,7 +215,7 @@ extern "C" int NeonSession_ResponseBlockReader(void * inUserData, } // A simple Neon response_block_reader for use with an XOutputStream -extern "C" int NeonSession_ResponseBlockWriter( void * inUserData, +static int NeonSession_ResponseBlockWriter( void * inUserData, const char * inBuf, size_t inLen ) { @@ -226,7 +228,7 @@ extern "C" int NeonSession_ResponseBlockWriter( void * inUserData, return 0; } -extern "C" int NeonSession_NeonAuth( void * inUserData, +static int NeonSession_NeonAuth( void * inUserData, #if defined NE_FEATURE_SSPI && ! defined SYSTEM_NEON const char * inAuthProtocol, #endif @@ -256,6 +258,8 @@ extern "C" int NeonSession_NeonAuth( void * inUserData, return theSession->NeonAuth(pAuthProtocol, inRealm, attempt, inoutUserName, inoutPassWord); } +} + int NeonSession::NeonAuth(const char* inAuthProtocol, const char* inRealm, int attempt, char* inoutUserName, char * inoutPassWord) { @@ -376,7 +380,9 @@ namespace { } } // namespace -extern "C" int NeonSession_CertificationNotify( void *userdata, +extern "C" { + +static int NeonSession_CertificationNotify( void *userdata, int, const ne_ssl_certificate *cert ) { @@ -384,6 +390,8 @@ extern "C" int NeonSession_CertificationNotify( void *userdata, return pSession->CertificationNotify(cert); } +} + int NeonSession::CertificationNotify(const ne_ssl_certificate *cert) { osl::Guard< osl::Mutex > theGuard( m_aMutex ); @@ -528,7 +536,9 @@ int NeonSession::CertificationNotify(const ne_ssl_certificate *cert) return 1; } -extern "C" void NeonSession_PreSendRequest( ne_request * req, +extern "C" { + +static void NeonSession_PreSendRequest( ne_request * req, void * userdata, ne_buffer * headers ) { @@ -539,6 +549,8 @@ extern "C" void NeonSession_PreSendRequest( ne_request * req, pSession->PreSendRequest(req, headers); } +} + void NeonSession::PreSendRequest(ne_request* req, ne_buffer* headers) { osl::Guard< osl::Mutex > theGuard( m_aMutex ); diff --git a/ucb/source/ucp/webdav-neon/UCBDeadPropertyValue.cxx b/ucb/source/ucp/webdav-neon/UCBDeadPropertyValue.cxx index 3ef49ddf0f94..173c3f9c4c20 100644 --- a/ucb/source/ucp/webdav-neon/UCBDeadPropertyValue.cxx +++ b/ucb/source/ucp/webdav-neon/UCBDeadPropertyValue.cxx @@ -68,7 +68,9 @@ static const char aXMLEnd[] = "</value></ucbprop>"; #define STATE_VALUE (STATE_TOP + 2) -extern "C" int UCBDeadPropertyValue_startelement_callback( +extern "C" { + +static int UCBDeadPropertyValue_startelement_callback( void *, int parent, const char * /*nspace*/, @@ -96,7 +98,7 @@ extern "C" int UCBDeadPropertyValue_startelement_callback( } -extern "C" int UCBDeadPropertyValue_chardata_callback( +static int UCBDeadPropertyValue_chardata_callback( void *userdata, int state, const char *buf, @@ -125,7 +127,7 @@ extern "C" int UCBDeadPropertyValue_chardata_callback( } -extern "C" int UCBDeadPropertyValue_endelement_callback( +static int UCBDeadPropertyValue_endelement_callback( void *userdata, int state, const char *, @@ -154,6 +156,7 @@ extern "C" int UCBDeadPropertyValue_endelement_callback( return 0; // zero to continue, non-zero to abort parsing } +} static OUString encodeValue( const OUString & rValue ) { diff --git a/ucbhelper/source/client/proxydecider.cxx b/ucbhelper/source/client/proxydecider.cxx index 080e176863ab..0f5bd69553b7 100644 --- a/ucbhelper/source/client/proxydecider.cxx +++ b/ucbhelper/source/client/proxydecider.cxx @@ -226,7 +226,7 @@ bool WildCard::Matches( const OUString& rString ) const } -bool getConfigStringValue( +static bool getConfigStringValue( const uno::Reference< container::XNameAccess > & xNameAccess, const char * key, OUString & value ) @@ -253,7 +253,7 @@ bool getConfigStringValue( } -bool getConfigInt32Value( +static bool getConfigInt32Value( const uno::Reference< container::XNameAccess > & xNameAccess, const char * key, sal_Int32 & value ) diff --git a/unodevtools/source/skeletonmaker/cppcompskeleton.cxx b/unodevtools/source/skeletonmaker/cppcompskeleton.cxx index 0fba9d46ab14..75da490435e7 100644 --- a/unodevtools/source/skeletonmaker/cppcompskeleton.cxx +++ b/unodevtools/source/skeletonmaker/cppcompskeleton.cxx @@ -31,7 +31,7 @@ using namespace ::codemaker::cpp; namespace skeletonmaker { namespace cpp { -void generateIncludes(std::ostream & o, +static void generateIncludes(std::ostream & o, const std::set< OUString >& interfaces, const OUString & propertyhelper, const bool serviceobject, const bool supportxcomponent) @@ -67,7 +67,7 @@ void generateIncludes(std::ostream & o, } } -short generateNamespace(std::ostream & o, +static short generateNamespace(std::ostream & o, const OString & implname, bool serviceobject, OString & nm) @@ -112,7 +112,7 @@ short generateNamespace(std::ostream & o, return count; } -OString generateCompHelperDeclaration(std::ostream & o, +static OString generateCompHelperDeclaration(std::ostream & o, const OString & implname) { OString nm; @@ -137,7 +137,7 @@ OString generateCompHelperDeclaration(std::ostream & o, return nm; } -void generateCompHelperDefinition(std::ostream & o, +static void generateCompHelperDefinition(std::ostream & o, const OString & implname, const OString & classname, const std::set< OUString >& services) @@ -176,7 +176,7 @@ void generateCompHelperDefinition(std::ostream & o, } -void generateCompFunctions(std::ostream & o, const OString & nmspace) +static void generateCompFunctions(std::ostream & o, const OString & nmspace) { o << "static ::cppu::ImplementationEntry const entries[] = {\n" " { &" << nmspace << "::_create,\n &" @@ -500,7 +500,7 @@ void generateXDispatchProvider(std::ostream& o, " }\n\n return lDispatcher;\n}\n\n"; } -void generateAddinConstructorAndHelper(std::ostream& o, +static void generateAddinConstructorAndHelper(std::ostream& o, ProgramOptions const & options, rtl::Reference< TypeManager > const & manager, const OString & classname, const std::set< OUString >& interfaces) @@ -574,7 +574,7 @@ void generateAddinConstructorAndHelper(std::ostream& o, o <<"}\n\n"; } -void generateMemberInitialization(std::ostream& o, +static void generateMemberInitialization(std::ostream& o, ProgramOptions const & options, rtl::Reference< TypeManager > const & manager, AttributeInfo const & members) @@ -596,7 +596,7 @@ void generateMemberInitialization(std::ostream& o, } } -void generateMemberDeclaration(std::ostream& o, +static void generateMemberDeclaration(std::ostream& o, ProgramOptions const & options, rtl::Reference< TypeManager > const & manager, AttributeInfo const & members) @@ -610,7 +610,7 @@ void generateMemberDeclaration(std::ostream& o, } } -OString generateClassDefinition(std::ostream& o, +static OString generateClassDefinition(std::ostream& o, ProgramOptions const & options, rtl::Reference< TypeManager > const & manager, OString const & classname, @@ -843,7 +843,7 @@ OString generateClassDefinition(std::ostream& o, return parentname.makeStringAndClear(); } -void generateXServiceInfoBodies(std::ostream& o, +static void generateXServiceInfoBodies(std::ostream& o, OString const & classname, OString const & comphelpernamespace) { @@ -868,7 +868,7 @@ void generateXServiceInfoBodies(std::ostream& o, } -void generateMethodBodies(std::ostream& o, +static void generateMethodBodies(std::ostream& o, ProgramOptions const & options, rtl::Reference< TypeManager > const & manager, std::set< OUString > const & interfaces, @@ -891,7 +891,7 @@ void generateMethodBodies(std::ostream& o, } } -void generateQueryInterface(std::ostream& o, +static void generateQueryInterface(std::ostream& o, ProgramOptions const & options, rtl::Reference< TypeManager > const & manager, const std::set< OUString >& interfaces, diff --git a/unodevtools/source/skeletonmaker/cpptypemaker.cxx b/unodevtools/source/skeletonmaker/cpptypemaker.cxx index 47d5e4aa0907..05ca099998cc 100644 --- a/unodevtools/source/skeletonmaker/cpptypemaker.cxx +++ b/unodevtools/source/skeletonmaker/cpptypemaker.cxx @@ -30,7 +30,7 @@ using namespace ::codemaker::cpp; namespace skeletonmaker { namespace cpp { -void printType( +static void printType( std::ostream & o, ProgramOptions const & options, rtl::Reference< TypeManager > const & manager, codemaker::UnoType::Sort sort, OUString const & nucleus, sal_Int32 rank, @@ -134,7 +134,7 @@ void printType( referenceType, defaultvalue); } -bool printConstructorParameters( +static bool printConstructorParameters( std::ostream & o, ProgramOptions const & options, rtl::Reference< TypeManager > const & manager, codemaker::UnoType::Sort sort, @@ -268,7 +268,7 @@ bool printConstructorParameters( return previous; } -void printConstructor( +static void printConstructor( std::ostream & o, ProgramOptions const & options, rtl::Reference< TypeManager > const & manager, codemaker::UnoType::Sort sort, @@ -281,7 +281,7 @@ void printConstructor( o << ");\n"; } -void printMethodParameters( +static void printMethodParameters( std::ostream & o, ProgramOptions const & options, rtl::Reference< TypeManager > const & manager, std::vector< unoidl::InterfaceTypeEntity::Method::Parameter > const & @@ -311,7 +311,7 @@ void printMethodParameters( } } -void printExceptionSpecification( +static void printExceptionSpecification( std::ostream & o, ProgramOptions const & options, rtl::Reference< TypeManager > const & manager, @@ -328,7 +328,7 @@ void printExceptionSpecification( o << ")"; } -void printSetPropertyMixinBody( +static void printSetPropertyMixinBody( std::ostream & o, unoidl::InterfaceTypeEntity::Attribute const & attribute) { unoidl::AccumulationBasedServiceEntity::Property::Attributes propFlags @@ -652,7 +652,7 @@ void printMethods(std::ostream & o, o << "\n"; } -void printConstructors( +static void printConstructors( std::ostream & o, ProgramOptions const & options, rtl::Reference< TypeManager > const & manager, OUString const & name) { @@ -700,7 +700,7 @@ void printConstructors( } } -void printServiceMembers( +static void printServiceMembers( std::ostream & o, ProgramOptions const & options, rtl::Reference< TypeManager > const & manager, OUString const & name, @@ -739,7 +739,7 @@ void printServiceMembers( } } -void printMapsToCppType( +static void printMapsToCppType( std::ostream & o, ProgramOptions const & options, rtl::Reference< TypeManager > const & manager, codemaker::UnoType::Sort sort, OUString const & nucleus, sal_Int32 rank, diff --git a/unodevtools/source/skeletonmaker/javacompskeleton.cxx b/unodevtools/source/skeletonmaker/javacompskeleton.cxx index 75176befcea3..be3bfe7fe751 100644 --- a/unodevtools/source/skeletonmaker/javacompskeleton.cxx +++ b/unodevtools/source/skeletonmaker/javacompskeleton.cxx @@ -32,14 +32,14 @@ using namespace ::codemaker::java; namespace skeletonmaker { namespace java { -void generatePackage(std::ostream & o, const OString & implname) +static void generatePackage(std::ostream & o, const OString & implname) { sal_Int32 index = implname.lastIndexOf('.'); if (index != -1) o << "package " << implname.copy(0, index) << ";\n\n"; } -void generateImports(std::ostream & o, ProgramOptions const & options, +static void generateImports(std::ostream & o, ProgramOptions const & options, const OUString & propertyhelper, bool serviceobject, bool supportxcomponent) { @@ -73,7 +73,7 @@ void generateImports(std::ostream & o, ProgramOptions const & options, } } -void generateCompFunctions(std::ostream & o, const OString & classname) +static void generateCompFunctions(std::ostream & o, const OString & classname) { o << " public static XSingleComponentFactory __getComponentFactory(" " String sImplementationName ) {\n" @@ -91,7 +91,7 @@ void generateCompFunctions(std::ostream & o, const OString & classname) " }\n\n"; } -void generateXServiceInfoBodies(std::ostream& o) +static void generateXServiceInfoBodies(std::ostream& o) { o << " // com.sun.star.lang.XServiceInfo:\n"; o << " public String getImplementationName() {\n" @@ -186,7 +186,7 @@ void generateXPropertyAccessBodies(std::ostream& o) } -bool checkAttribute( +static bool checkAttribute( OStringBuffer& attributeValue, unoidl::AccumulationBasedServiceEntity::Property::Attributes attribute) { @@ -249,7 +249,7 @@ bool checkAttribute( return cast; } -void registerProperties(std::ostream& o, +static void registerProperties(std::ostream& o, const AttributeInfo& properties, const OString& indentation) { @@ -277,7 +277,7 @@ void registerProperties(std::ostream& o, } } -void generateXLocalizableBodies(std::ostream& o) { +static void generateXLocalizableBodies(std::ostream& o) { // com.sun.star.lang.XLocalizable: // setLocale o << " // com.sun.star.lang.XLocalizable:\n" @@ -289,7 +289,7 @@ void generateXLocalizableBodies(std::ostream& o) { " return m_locale;\n }\n\n"; } -void generateXAddInBodies(std::ostream& o) +static void generateXAddInBodies(std::ostream& o) { // com.sun.star.sheet.XAddIn: // getProgrammaticFuntionName @@ -357,7 +357,7 @@ void generateXAddInBodies(std::ostream& o) "sCATEGORYDISPLAYNAME);\n }\n\n"; } -void generateXCompatibilityNamesBodies(std::ostream& o) +static void generateXCompatibilityNamesBodies(std::ostream& o) { o << " // com.sun.star.sheet.XCompatibilityNames:\n" " public com.sun.star.sheet.LocalizedName[] getCompatibilityNames(" @@ -407,7 +407,7 @@ void generateXCompatibilityNamesBodies(std::ostream& o) " return seqLocalizedNames;\n }\n\n"; } -void generateXInitializationBodies(std::ostream& o) +static void generateXInitializationBodies(std::ostream& o) { o << " // com.sun.star.lang.XInitialization:\n" " public void initialize( Object[] object )\n" @@ -417,7 +417,7 @@ void generateXInitializationBodies(std::ostream& o) " com.sun.star.frame.XFrame.class, object[0]);\n }\n }\n\n"; } -void generateXDispatchBodies(std::ostream& o, ProgramOptions const & options) +static void generateXDispatchBodies(std::ostream& o, ProgramOptions const & options) { // com.sun.star.frame.XDispatch // dispatch @@ -453,7 +453,7 @@ void generateXDispatchBodies(std::ostream& o, ProgramOptions const & options) " // add your own code here\n }\n\n"; } -void generateXDispatchProviderBodies(std::ostream& o, ProgramOptions const & options) +static void generateXDispatchProviderBodies(std::ostream& o, ProgramOptions const & options) { // com.sun.star.frame.XDispatchProvider // queryDispatch @@ -492,7 +492,7 @@ void generateXDispatchProviderBodies(std::ostream& o, ProgramOptions const & opt " }\n return seqDispatcher;\n }\n\n"; } -void generateMethodBodies(std::ostream& o, +static void generateMethodBodies(std::ostream& o, ProgramOptions const & options, rtl::Reference< TypeManager > const & manager, const std::set< OUString >& interfaces, @@ -562,7 +562,7 @@ static const char* const propcomment= " // Ensure that your attributes are initialized correctly!\n"; -void generateAddinConstructorAndHelper(std::ostream& o, +static void generateAddinConstructorAndHelper(std::ostream& o, ProgramOptions const & options, rtl::Reference< TypeManager > const & manager, const OString & classname, const std::set< OUString >& services, @@ -699,7 +699,7 @@ void generateAddinConstructorAndHelper(std::ostream& o, } -void generateClassDefinition(std::ostream& o, +static void generateClassDefinition(std::ostream& o, ProgramOptions const & options, rtl::Reference< TypeManager > const & manager, const OString & classname, diff --git a/unodevtools/source/skeletonmaker/javatypemaker.cxx b/unodevtools/source/skeletonmaker/javatypemaker.cxx index 64917b95cf7d..3c45fc209b1f 100644 --- a/unodevtools/source/skeletonmaker/javatypemaker.cxx +++ b/unodevtools/source/skeletonmaker/javatypemaker.cxx @@ -30,7 +30,7 @@ namespace skeletonmaker { namespace java { -void printType( +static void printType( std::ostream & o, ProgramOptions const & options, rtl::Reference< TypeManager > const & manager, codemaker::UnoType::Sort sort, OUString const & nucleus, sal_Int32 rank, @@ -123,7 +123,7 @@ void printType( defaultvalue); } -bool printConstructorParameters( +static bool printConstructorParameters( std::ostream & o, ProgramOptions const & options, rtl::Reference< TypeManager > const & manager, codemaker::UnoType::Sort sort, @@ -257,7 +257,7 @@ bool printConstructorParameters( return previous; } -void printConstructor( +static void printConstructor( std::ostream & o, ProgramOptions const & options, rtl::Reference< TypeManager > const & manager, codemaker::UnoType::Sort sort, @@ -270,7 +270,7 @@ void printConstructor( o << ");\n"; } -void printMethodParameters( +static void printMethodParameters( std::ostream & o, ProgramOptions const & options, rtl::Reference< TypeManager > const & manager, std::vector< unoidl::InterfaceTypeEntity::Method::Parameter > const & @@ -298,7 +298,7 @@ void printMethodParameters( } } -void printExceptionSpecification( +static void printExceptionSpecification( std::ostream & o, ProgramOptions const & options, rtl::Reference< TypeManager > const & manager, std::vector< OUString > const & exceptions) @@ -317,7 +317,7 @@ void printExceptionSpecification( } -void printSetPropertyMixinBody( +static void printSetPropertyMixinBody( std::ostream & o, unoidl::InterfaceTypeEntity::Attribute const & attribute, OString const & indentation) { @@ -570,7 +570,7 @@ void printMethods(std::ostream & o, } } -void printConstructors( +static void printConstructors( std::ostream & o, ProgramOptions const & options, rtl::Reference< TypeManager > const & manager, OUString const & name) { @@ -619,7 +619,7 @@ void printConstructors( } } -void printServiceMembers( +static void printServiceMembers( std::ostream & o, ProgramOptions const & options, rtl::Reference< TypeManager > const & manager, OUString const & name, @@ -655,7 +655,7 @@ void printServiceMembers( } } -void printMapsToJavaType( +static void printMapsToJavaType( std::ostream & o, ProgramOptions const & options, rtl::Reference< TypeManager > const & manager, codemaker::UnoType::Sort sort, OUString const & nucleus, sal_Int32 rank, diff --git a/unodevtools/source/skeletonmaker/skeletoncommon.cxx b/unodevtools/source/skeletonmaker/skeletoncommon.cxx index 966c147f1850..08df9ebf930f 100644 --- a/unodevtools/source/skeletonmaker/skeletoncommon.cxx +++ b/unodevtools/source/skeletonmaker/skeletoncommon.cxx @@ -90,7 +90,7 @@ bool getOutputStream(ProgramOptions const & options, return bStandardout; } -bool containsAttribute(AttributeInfo& attributes, OUString const & attrname) +static bool containsAttribute(AttributeInfo& attributes, OUString const & attrname) { for ( AttributeInfo::const_iterator i(attributes.begin()); i != attributes.end(); ++i ) { @@ -102,7 +102,7 @@ bool containsAttribute(AttributeInfo& attributes, OUString const & attrname) } // collect attributes including inherited attributes -void checkAttributes(rtl::Reference< TypeManager > const & manager, +static void checkAttributes(rtl::Reference< TypeManager > const & manager, OUString const & name, AttributeInfo& attributes, std::set< OUString >& propinterfaces) @@ -281,7 +281,7 @@ void checkDefaultInterfaces( } } -bool checkServiceProperties(rtl::Reference< TypeManager > const & manager, +static bool checkServiceProperties(rtl::Reference< TypeManager > const & manager, OUString const & name) { rtl::Reference< unoidl::Entity > ent; @@ -362,7 +362,7 @@ OUString checkPropertyHelper( return oldStyleWithProperties ? OUString("_") : OUString(); } -bool checkXComponentSupport( +static bool checkXComponentSupport( rtl::Reference< TypeManager > const & manager, OUString const & name) { assert(manager.is()); @@ -447,7 +447,7 @@ checkAdditionalPropertyFlags( // This function checks if the specified types for parameters and return // types are allowed add-in types, for more info see the com.sun.star.sheet.AddIn // service description -bool checkAddinType(rtl::Reference< TypeManager > const & manager, +static bool checkAddinType(rtl::Reference< TypeManager > const & manager, OUString const & type, bool & bLastAny, bool & bHasXPropertySet, bool bIsReturn) { @@ -494,7 +494,7 @@ bool checkAddinType(rtl::Reference< TypeManager > const & manager, return false; } -void checkAddInTypes( +static void checkAddInTypes( rtl::Reference< TypeManager > const & manager, OUString const & name, rtl::Reference< unoidl::InterfaceTypeEntity > const & entity) { @@ -543,7 +543,7 @@ void checkAddInTypes( } } -void generateFunctionParameterMap(std::ostream& o, +static void generateFunctionParameterMap(std::ostream& o, ProgramOptions const & options, rtl::Reference< TypeManager > const & manager, OUString const & name, diff --git a/unoidl/source/sourceprovider-parser.y b/unoidl/source/sourceprovider-parser.y index bb4f5dc2a92a..747437660fdc 100644 --- a/unoidl/source/sourceprovider-parser.y +++ b/unoidl/source/sourceprovider-parser.y @@ -63,7 +63,7 @@ #define YYLLOC_DEFAULT(Current, Rhs, N) \ do { (Current) = YYRHSLOC((Rhs), (N) ? 1 : 0); } while (0) -void yyerror(YYLTYPE * locp, yyscan_t yyscanner, char const * msg) { +static void yyerror(YYLTYPE * locp, yyscan_t yyscanner, char const * msg) { assert(locp != nullptr); unoidl::detail::SourceProviderScannerData * data = yyget_extra(yyscanner); data->errorLine = *locp; diff --git a/unoidl/source/unoidl-check.cxx b/unoidl/source/unoidl-check.cxx index 41ad76143cd1..94f335cd1266 100644 --- a/unoidl/source/unoidl-check.cxx +++ b/unoidl/source/unoidl-check.cxx @@ -27,7 +27,7 @@ namespace unoidl { -bool operator ==(ConstantValue const & lhs, ConstantValue const & rhs) { +static bool operator ==(ConstantValue const & lhs, ConstantValue const & rhs) { if (lhs.type == rhs.type) { switch (lhs.type) { case ConstantValue::TYPE_BOOLEAN: @@ -55,11 +55,11 @@ bool operator ==(ConstantValue const & lhs, ConstantValue const & rhs) { return false; } -bool operator !=(ConstantValue const & lhs, ConstantValue const & rhs) { +static bool operator !=(ConstantValue const & lhs, ConstantValue const & rhs) { return !(lhs == rhs); } -bool operator ==( +static bool operator ==( SingleInterfaceBasedServiceEntity::Constructor::Parameter const & lhs, SingleInterfaceBasedServiceEntity::Constructor::Parameter const & rhs) { diff --git a/unoidl/source/unoidlprovider.cxx b/unoidl/source/unoidlprovider.cxx index cb3bd57074ea..bfbed9d02dd6 100644 --- a/unoidl/source/unoidlprovider.cxx +++ b/unoidl/source/unoidlprovider.cxx @@ -456,7 +456,7 @@ struct MapEntry { Memory32 data; }; -bool operator <(const Map& map1, const Map& map2) { +static bool operator <(const Map& map1, const Map& map2) { return map1.begin < map2.begin || (map1.begin == map2.begin && map1.size < map2.size); } diff --git a/unotest/source/cpp/filters-test.cxx b/unotest/source/cpp/filters-test.cxx index 6a8f74a1c76b..7881d9a8ee59 100644 --- a/unotest/source/cpp/filters-test.cxx +++ b/unotest/source/cpp/filters-test.cxx @@ -20,7 +20,7 @@ namespace test { -void decode(const OUString& rIn, const OUString &rOut) +static void decode(const OUString& rIn, const OUString &rOut) { rtlCipher cipher = rtl_cipher_create(rtl_Cipher_AlgorithmARCFOUR, rtl_Cipher_ModeStream); CPPUNIT_ASSERT_MESSAGE("cipher creation failed", cipher != nullptr); diff --git a/unotools/source/config/configvaluecontainer.cxx b/unotools/source/config/configvaluecontainer.cxx index 3aec56767f60..894e665cf9fc 100644 --- a/unotools/source/config/configvaluecontainer.cxx +++ b/unotools/source/config/configvaluecontainer.cxx @@ -85,9 +85,7 @@ namespace utl aDataType = _rType; } - #ifndef UNX static - #endif void lcl_copyData( const NodeValueAccessor& _rAccessor, const Any& _rData, ::osl::Mutex& _rMutex ) { ::osl::MutexGuard aGuard( _rMutex ); @@ -118,9 +116,7 @@ namespace utl } } - #ifndef UNX static - #endif void lcl_copyData( Any& _rData, const NodeValueAccessor& _rAccessor, ::osl::Mutex& _rMutex ) { ::osl::MutexGuard aGuard( _rMutex ); diff --git a/unotools/source/config/defaultoptions.cxx b/unotools/source/config/defaultoptions.cxx index 0a74a321825a..259cbef80702 100644 --- a/unotools/source/config/defaultoptions.cxx +++ b/unotools/source/config/defaultoptions.cxx @@ -147,7 +147,7 @@ static PathToDefaultMapping_Impl const PathMap_Impl[] = // functions ------------------------------------------------------------- -Sequence< OUString > GetDefaultPropertyNames() +static Sequence< OUString > GetDefaultPropertyNames() { static const char* aPropNames[] = { diff --git a/unotools/source/config/optionsdlg.cxx b/unotools/source/config/optionsdlg.cxx index a8a28b002ce5..535ad64b870b 100644 --- a/unotools/source/config/optionsdlg.cxx +++ b/unotools/source/config/optionsdlg.cxx @@ -161,15 +161,15 @@ void SvtOptionsDlgOptions_Impl::ReadNode( const OUString& _rNode, NodeType _eTyp } } -OUString getGroupPath( const OUString& _rGroup ) +static OUString getGroupPath( const OUString& _rGroup ) { return OUString( ROOT_NODE "/" + _rGroup + "/" ); } -OUString getPagePath( const OUString& _rPage ) +static OUString getPagePath( const OUString& _rPage ) { return OUString( PAGES_NODE "/" + _rPage + "/" ); } -OUString getOptionPath( const OUString& _rOption ) +static OUString getOptionPath( const OUString& _rOption ) { return OUString( OPTIONS_NODE "/" + _rOption + "/" ); } diff --git a/unotools/source/config/saveopt.cxx b/unotools/source/config/saveopt.cxx index 85258c7b3cfd..19a39049e6bc 100644 --- a/unotools/source/config/saveopt.cxx +++ b/unotools/source/config/saveopt.cxx @@ -337,7 +337,7 @@ bool SvtSaveOptions_Impl::IsReadOnly( SvtSaveOptions::EOption eOption ) const #define SAVEWORKINGSET 13 #define ODFDEFAULTVERSION 14 -Sequence< OUString > GetPropertyNames() +static Sequence< OUString > GetPropertyNames() { static const char* aPropNames[] = { diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx index 62bf2b214cfd..11f09a68fe95 100644 --- a/unotools/source/i18n/localedatawrapper.cxx +++ b/unotools/source/i18n/localedatawrapper.cxx @@ -1230,7 +1230,7 @@ static sal_Unicode* ImplAdd9UNum( sal_Unicode* pBuf, sal_uInt32 nNumber ) return pBuf; } -inline sal_Unicode* ImplAddString( sal_Unicode* pBuf, const OUString& rStr ) +static inline sal_Unicode* ImplAddString( sal_Unicode* pBuf, const OUString& rStr ) { if ( rStr.getLength() == 1 ) *pBuf++ = rStr[0]; @@ -1244,14 +1244,14 @@ inline sal_Unicode* ImplAddString( sal_Unicode* pBuf, const OUString& rStr ) return pBuf; } -inline sal_Unicode* ImplAddString( sal_Unicode* pBuf, sal_Unicode c ) +static inline sal_Unicode* ImplAddString( sal_Unicode* pBuf, sal_Unicode c ) { *pBuf = c; pBuf++; return pBuf; } -inline sal_Unicode* ImplAddString( sal_Unicode* pBuf, const sal_Unicode* pCopyBuf, sal_Int32 nLen ) +static inline sal_Unicode* ImplAddString( sal_Unicode* pBuf, const sal_Unicode* pCopyBuf, sal_Int32 nLen ) { memcpy( pBuf, pCopyBuf, nLen * sizeof(sal_Unicode) ); return pBuf + nLen; @@ -1514,7 +1514,7 @@ OUString LocaleDataWrapper::getDuration( const tools::Time& rTime, bool bSec, bo // --- simple number formatting --------------------------------------- -inline size_t ImplGetNumberStringLengthGuess( const LocaleDataWrapper& rLoc, sal_uInt16 nDecimals ) +static inline size_t ImplGetNumberStringLengthGuess( const LocaleDataWrapper& rLoc, sal_uInt16 nDecimals ) { // approximately 3.2 bits per digit const size_t nDig = ((sizeof(sal_Int64) * 8) / 3) + 1; diff --git a/unotools/source/misc/fontcvt.cxx b/unotools/source/misc/fontcvt.cxx index 4c043c072b20..608a424f0f01 100644 --- a/unotools/source/misc/fontcvt.cxx +++ b/unotools/source/misc/fontcvt.cxx @@ -1201,7 +1201,7 @@ StarSymbolToMSMultiFontImpl::StarSymbolToMSMultiFontImpl() } } -const char *SymbolFontToString(int nResult) +static const char *SymbolFontToString(int nResult) { const char * const *ppName = aSymbolNames; int nI = Symbol; diff --git a/unotools/source/ucbhelper/progresshandlerwrap.cxx b/unotools/source/ucbhelper/progresshandlerwrap.cxx index 05e6a6131518..d336af5dcb22 100644 --- a/unotools/source/ucbhelper/progresshandlerwrap.cxx +++ b/unotools/source/ucbhelper/progresshandlerwrap.cxx @@ -31,7 +31,7 @@ ProgressHandlerWrap::ProgressHandlerWrap( css::uno::Reference< css::task::XStatu { } -bool getStatusFromAny_Impl( const Any& aAny, OUString& aText, sal_Int32& nNum ) +static bool getStatusFromAny_Impl( const Any& aAny, OUString& aText, sal_Int32& nNum ) { bool bNumIsSet = false; diff --git a/unotools/source/ucbhelper/tempfile.cxx b/unotools/source/ucbhelper/tempfile.cxx index d42df0c78be9..9b8d7a957c2d 100644 --- a/unotools/source/ucbhelper/tempfile.cxx +++ b/unotools/source/ucbhelper/tempfile.cxx @@ -52,7 +52,7 @@ namespace namespace utl { -OUString getParentName( const OUString& aFileName ) +static OUString getParentName( const OUString& aFileName ) { sal_Int32 lastIndex = aFileName.lastIndexOf( '/' ); OUString aParent; @@ -71,7 +71,7 @@ OUString getParentName( const OUString& aFileName ) return aParent; } -bool ensuredir( const OUString& rUnqPath ) +static bool ensuredir( const OUString& rUnqPath ) { OUString aPath; if ( rUnqPath.isEmpty() ) @@ -115,7 +115,7 @@ bool ensuredir( const OUString& rUnqPath ) return bSuccess; } -OUString ConstructTempDir_Impl( const OUString* pParent ) +static OUString ConstructTempDir_Impl( const OUString* pParent ) { OUString aName; if ( pParent && !pParent->isEmpty() ) @@ -239,7 +239,7 @@ namespace }; }; -OUString lcl_createName( +static OUString lcl_createName( const OUString& rLeadingChars, Tokens & tokens, const OUString* pExtension, const OUString* pParent, bool bDirectory, bool bKeep, bool bLock, bool bCreateParentDirs ) @@ -314,7 +314,7 @@ OUString lcl_createName( return OUString(); } -OUString CreateTempName_Impl( const OUString* pParent, bool bKeep, bool bDir = true ) +static OUString CreateTempName_Impl( const OUString* pParent, bool bKeep, bool bDir = true ) { OUString aEyeCatcher = "lu"; #ifdef UNX diff --git a/unoxml/source/dom/documentbuilder.cxx b/unoxml/source/dom/documentbuilder.cxx index 8e373c6576e7..8d244ab6d6e9 100644 --- a/unoxml/source/dom/documentbuilder.cxx +++ b/unoxml/source/dom/documentbuilder.cxx @@ -333,7 +333,7 @@ namespace DOM } } // extern "C" - void throwEx(xmlParserCtxtPtr ctxt) + static void throwEx(xmlParserCtxtPtr ctxt) { css::xml::sax::SAXParseException saxex; saxex.Message = make_error_message(ctxt); diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx index 8de423bf2810..4ebc80e743c4 100644 --- a/vbahelper/source/vbahelper/vbahelper.cxx +++ b/vbahelper/source/vbahelper/vbahelper.cxx @@ -83,7 +83,7 @@ namespace vba namespace { const double factor = 2540.0 / 72.0; } // helper method to determine if the view ( calc ) is in print-preview mode -bool isInPrintPreview( SfxViewFrame* pView ) +static bool isInPrintPreview( SfxViewFrame* pView ) { sal_uInt16 nViewNo = SID_VIEWSHELL1 - SID_VIEWSHELL0; if ( pView->GetObjectShell()->GetFactory().GetViewFactoryCount() > @@ -232,7 +232,7 @@ getCurrentDoc( const OUString& sKey ) } /// @throws uno::RuntimeException - uno::Reference< frame::XModel > +static uno::Reference< frame::XModel > getCurrentDocCtx( const OUString& ctxName, const uno::Reference< uno::XComponentContext >& xContext ) { uno::Reference< frame::XModel > xModel; @@ -556,7 +556,7 @@ ContainerUtilities::FieldInList( const uno::Sequence< OUString >& SearchList, co } -bool NeedEsc(sal_Unicode cCode) +static bool NeedEsc(sal_Unicode cCode) { return OUString(".^$+\\|{}()").indexOf(cCode) != -1; } diff --git a/vbahelper/source/vbahelper/vbawindowbase.cxx b/vbahelper/source/vbahelper/vbawindowbase.cxx index e37a53b46cdb..ebc67ef0c5d3 100644 --- a/vbahelper/source/vbahelper/vbawindowbase.cxx +++ b/vbahelper/source/vbahelper/vbawindowbase.cxx @@ -59,7 +59,7 @@ VbaWindowBase::setVisible( sal_Bool _visible ) getWindow2()->setVisible( _visible ); } -void setPosSize( const uno::Reference< awt::XWindow >& xWindow, sal_Int32 nValue, sal_Int16 nFlag ) +static void setPosSize( const uno::Reference< awt::XWindow >& xWindow, sal_Int32 nValue, sal_Int16 nFlag ) { css::awt::Rectangle aRect = xWindow->getPosSize(); switch( nFlag ) diff --git a/vcl/backendtest/VisualBackendTest.cxx b/vcl/backendtest/VisualBackendTest.cxx index 3b1627c33b8f..239f47bd7ead 100644 --- a/vcl/backendtest/VisualBackendTest.cxx +++ b/vcl/backendtest/VisualBackendTest.cxx @@ -51,7 +51,7 @@ using namespace css; -void drawBitmapCentered(tools::Rectangle const& rRect, const Bitmap& aBitmap, +static void drawBitmapCentered(tools::Rectangle const& rRect, const Bitmap& aBitmap, vcl::RenderContext& rRenderContext) { long nWidth = rRect.GetWidth(); @@ -67,7 +67,7 @@ void drawBitmapCentered(tools::Rectangle const& rRect, const Bitmap& aBitmap, rRenderContext.DrawBitmap(aPoint, aBitmap); } -void drawBitmapScaledAndCentered(tools::Rectangle const & rRect, Bitmap aBitmap, vcl::RenderContext& rRenderContext, BmpScaleFlag aFlag = BmpScaleFlag::Fast) +static void drawBitmapScaledAndCentered(tools::Rectangle const & rRect, Bitmap aBitmap, vcl::RenderContext& rRenderContext, BmpScaleFlag aFlag = BmpScaleFlag::Fast) { long nWidth = rRect.GetWidth(); long nHeight = rRect.GetHeight(); @@ -81,7 +81,7 @@ void drawBitmapScaledAndCentered(tools::Rectangle const & rRect, Bitmap aBitmap, drawBitmapCentered(rRect, aBitmap, rRenderContext); } -void drawBackgroundRect(tools::Rectangle const & rRect, Color aColor, vcl::RenderContext& rRenderContext) +static void drawBackgroundRect(tools::Rectangle const & rRect, Color aColor, vcl::RenderContext& rRenderContext) { rRenderContext.Push(PushFlags::LINECOLOR | PushFlags::FILLCOLOR); rRenderContext.SetFillColor(aColor); @@ -90,7 +90,7 @@ void drawBackgroundRect(tools::Rectangle const & rRect, Color aColor, vcl::Rende rRenderContext.Pop(); } -void assertAndSetBackground(vcl::test::TestResult eResult, tools::Rectangle const & rRect, vcl::RenderContext& rRenderContext) +static void assertAndSetBackground(vcl::test::TestResult eResult, tools::Rectangle const & rRect, vcl::RenderContext& rRenderContext) { if (eResult == vcl::test::TestResult::Passed) drawBackgroundRect(rRect, COL_GREEN, rRenderContext); diff --git a/vcl/headless/svpbmp.cxx b/vcl/headless/svpbmp.cxx index 543e2ba8574e..824fb847a732 100644 --- a/vcl/headless/svpbmp.cxx +++ b/vcl/headless/svpbmp.cxx @@ -39,7 +39,7 @@ SvpSalBitmap::~SvpSalBitmap() Destroy(); } -std::unique_ptr<BitmapBuffer> ImplCreateDIB( +static std::unique_ptr<BitmapBuffer> ImplCreateDIB( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal) diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index 56bd740dbe40..ea70321ff2fa 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -820,7 +820,7 @@ void SvpSalGraphics::drawPolyPolygon(sal_uInt32 nPoly, 0.0); } -basegfx::B2DPoint impPixelSnap( +static basegfx::B2DPoint impPixelSnap( const basegfx::B2DPolygon& rPolygon, const basegfx::B2DHomMatrix& rObjectToDevice, basegfx::B2DHomMatrix& rObjectToDeviceInv, diff --git a/vcl/headless/svpprn.cxx b/vcl/headless/svpprn.cxx index b9c74f4d8aa5..4404fe4144b0 100644 --- a/vcl/headless/svpprn.cxx +++ b/vcl/headless/svpprn.cxx @@ -56,7 +56,7 @@ static OUString getPdfDir( const PrinterInfo& rInfo ) return aDir; } -inline int PtTo10Mu( int nPoints ) { return static_cast<int>((static_cast<double>(nPoints)*35.27777778)+0.5); } +static inline int PtTo10Mu( int nPoints ) { return static_cast<int>((static_cast<double>(nPoints)*35.27777778)+0.5); } static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData ) { diff --git a/vcl/qa/cppunit/canvasbitmaptest.cxx b/vcl/qa/cppunit/canvasbitmaptest.cxx index 8cbbae5496a0..e013c5d602a9 100644 --- a/vcl/qa/cppunit/canvasbitmaptest.cxx +++ b/vcl/qa/cppunit/canvasbitmaptest.cxx @@ -51,7 +51,7 @@ using namespace vcl::unotools; namespace com { namespace sun { namespace star { namespace rendering { -bool operator==( const RGBColor& rLHS, const ARGBColor& rRHS ) +static bool operator==( const RGBColor& rLHS, const ARGBColor& rRHS ) { return rLHS.Red == rRHS.Red && rLHS.Green == rRHS.Green && rLHS.Blue == rRHS.Blue; } diff --git a/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx b/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx index d63b6b276a58..b61d10096da5 100644 --- a/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx +++ b/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx @@ -37,7 +37,7 @@ public: CPPUNIT_TEST_SUITE_END(); }; -int deltaColor(BitmapColor aColor1, BitmapColor aColor2) +static int deltaColor(BitmapColor aColor1, BitmapColor aColor2) { int deltaR = std::abs(aColor1.GetRed() - aColor2.GetRed()); int deltaG = std::abs(aColor1.GetGreen() - aColor2.GetGreen()); @@ -46,7 +46,7 @@ int deltaColor(BitmapColor aColor1, BitmapColor aColor2) return std::max(std::max(deltaR, deltaG), deltaB); } -bool checkRect(Bitmap& rBitmap, int aLayerNumber, long nAreaHeight, long nAreaWidth, Color aExpectedColor, int nMaxDelta) +static bool checkRect(Bitmap& rBitmap, int aLayerNumber, long nAreaHeight, long nAreaWidth, Color aExpectedColor, int nMaxDelta) { BitmapScopedWriteAccess pAccess(rBitmap); @@ -88,7 +88,7 @@ bool checkRect(Bitmap& rBitmap, int aLayerNumber, long nAreaHeight, long nAreaWi return true; } -int getNumberOfImageComponents(const Graphic& rGraphic) +static int getNumberOfImageComponents(const Graphic& rGraphic) { GfxLink aLink = rGraphic.GetGfxLink(); SvMemoryStream aMemoryStream(const_cast<sal_uInt8*>(aLink.GetData()), aLink.GetDataSize(), diff --git a/vcl/qa/cppunit/svm/svmtest.cxx b/vcl/qa/cppunit/svm/svmtest.cxx index 0015706c8a0f..116bf0ab6758 100644 --- a/vcl/qa/cppunit/svm/svmtest.cxx +++ b/vcl/qa/cppunit/svm/svmtest.cxx @@ -138,7 +138,7 @@ public: CPPUNIT_TEST_SUITE_END(); }; -void setupBaseVirtualDevice(VirtualDevice& rDevice, GDIMetaFile& rMeta) +static void setupBaseVirtualDevice(VirtualDevice& rDevice, GDIMetaFile& rMeta) { rDevice.SetConnectMetaFile(&rMeta); Size aVDSize(10, 10); @@ -147,7 +147,7 @@ void setupBaseVirtualDevice(VirtualDevice& rDevice, GDIMetaFile& rMeta) rDevice.Erase(); } -GDIMetaFile readMetafile(const OUString& rUrl) +static GDIMetaFile readMetafile(const OUString& rUrl) { SvFileStream aFileStream(rUrl, StreamMode::READ); GDIMetaFile aResultMetafile; @@ -156,7 +156,7 @@ GDIMetaFile readMetafile(const OUString& rUrl) return aResultMetafile; } -void writeMetaFile(GDIMetaFile& rInputMetafile, const OUString& rUrl) +static void writeMetaFile(GDIMetaFile& rInputMetafile, const OUString& rUrl) { SvFileStream aFileStream(rUrl, StreamMode::WRITE); aFileStream.Seek(STREAM_SEEK_TO_BEGIN); @@ -164,7 +164,7 @@ void writeMetaFile(GDIMetaFile& rInputMetafile, const OUString& rUrl) aFileStream.Close(); } -GDIMetaFile writeAndRead(GDIMetaFile& rMetaFile, const OUString& sUrl) +static GDIMetaFile writeAndRead(GDIMetaFile& rMetaFile, const OUString& sUrl) { // Turn on to output the SVM bitstreams to files (using the input URL) // to inspect the content or to create a reference file, otherwise leave diff --git a/vcl/qt5/Qt5Graphics_Controls.cxx b/vcl/qt5/Qt5Graphics_Controls.cxx index 18be768c04c0..d98cdafe0137 100644 --- a/vcl/qt5/Qt5Graphics_Controls.cxx +++ b/vcl/qt5/Qt5Graphics_Controls.cxx @@ -36,7 +36,8 @@ @param nControlState State of the widget (default, focused, ...) in Native Widget Framework. @param aValue Value held by the widget (on, off, ...) */ -QStyle::State vclStateValue2StateFlag(ControlState nControlState, const ImplControlValue& aValue) +static QStyle::State vclStateValue2StateFlag(ControlState nControlState, + const ImplControlValue& aValue) { QStyle::State nState = ((nControlState & ControlState::ENABLED) ? QStyle::State_Enabled : QStyle::State_None) diff --git a/vcl/source/app/dbggui.cxx b/vcl/source/app/dbggui.cxx index 1f8db580f978..b27eed124f6c 100644 --- a/vcl/source/app/dbggui.cxx +++ b/vcl/source/app/dbggui.cxx @@ -42,7 +42,7 @@ using namespace ::com::sun::star; -void ImplDbgTestSolarMutex() +static void ImplDbgTestSolarMutex() { assert(ImplGetSVData()->mpDefInst->GetYieldMutex()->IsCurrentThread() && "SolarMutex not owned!"); } diff --git a/vcl/source/app/i18nhelp.cxx b/vcl/source/app/i18nhelp.cxx index acbb9311d03b..45234e9bab00 100644 --- a/vcl/source/app/i18nhelp.cxx +++ b/vcl/source/app/i18nhelp.cxx @@ -75,7 +75,7 @@ LocaleDataWrapper& vcl::I18nHelper::ImplGetLocaleDataWrapper() const return *mpLocaleDataWrapper; } -inline bool is_formatting_mark( sal_Unicode c ) +static inline bool is_formatting_mark( sal_Unicode c ) { if( (c >= 0x200B) && (c <= 0x200F) ) // BiDi and zero-width-markers return true; diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index d4a0ae409acf..ec151895815a 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -453,7 +453,7 @@ void Application::Execute() pSVData->maAppData.mbInAppExecute = false; } -inline bool ImplYield(bool i_bWait, bool i_bAllEvents) +static inline bool ImplYield(bool i_bWait, bool i_bAllEvents) { ImplSVData* pSVData = ImplGetSVData(); diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx index f87354a37316..3ca22053452d 100644 --- a/vcl/source/app/svmain.cxx +++ b/vcl/source/app/svmain.cxx @@ -114,7 +114,7 @@ static bool g_bIsLeanException; static bool isInitVCL(); -oslSignalAction VCLExceptionSignal_impl( void* /*pData*/, oslSignalInfo* pInfo) +static oslSignalAction VCLExceptionSignal_impl( void* /*pData*/, oslSignalInfo* pInfo) { static volatile bool bIn = false; diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index d47311c50bc7..2491efe0228e 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@ -1807,7 +1807,7 @@ static bool ImplCurrencyProcessKeyInput( const KeyEvent& rKEvt, return ImplNumericProcessKeyInput( rKEvt, false, bUseThousandSep, rWrapper ); } -inline bool ImplCurrencyGetValue( const OUString& rStr, sal_Int64& rValue, +static inline bool ImplCurrencyGetValue( const OUString& rStr, sal_Int64& rValue, sal_uInt16 nDecDigits, const LocaleDataWrapper& rWrapper ) { // fetch number diff --git a/vcl/source/control/longcurr.cxx b/vcl/source/control/longcurr.cxx index 3d46cf92d27c..3a0a0b9da8f2 100644 --- a/vcl/source/control/longcurr.cxx +++ b/vcl/source/control/longcurr.cxx @@ -212,7 +212,7 @@ bool ImplCurrencyGetValue( const OUString& rStr, BigInt& rValue, } // namespace -inline bool ImplLongCurrencyGetValue( const OUString& rStr, BigInt& rValue, +static inline bool ImplLongCurrencyGetValue( const OUString& rStr, BigInt& rValue, sal_uInt16 nDecDigits, const LocaleDataWrapper& rLocaleDataWrapper ) { return ImplCurrencyGetValue( rStr, rValue, nDecDigits, rLocaleDataWrapper ); diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index a7082008eeb3..c8eba348db53 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -285,7 +285,7 @@ Size TabControl::ImplGetItemSize( ImplTabItem* pItem, long nMaxWidth ) // http://stackoverflow.com/questions/9071205/balanced-word-wrap-minimum-raggedness-in-php namespace MinimumRaggednessWrap { - std::deque<size_t> GetEndOfLineIndexes(const std::vector<sal_Int32>& rWidthsOf, sal_Int32 nLineWidth) + static std::deque<size_t> GetEndOfLineIndexes(const std::vector<sal_Int32>& rWidthsOf, sal_Int32 nLineWidth) { ++nLineWidth; diff --git a/vcl/source/filter/FilterConfigCache.cxx b/vcl/source/filter/FilterConfigCache.cxx index 369fc3989f04..30f6e4399511 100644 --- a/vcl/source/filter/FilterConfigCache.cxx +++ b/vcl/source/filter/FilterConfigCache.cxx @@ -118,7 +118,7 @@ OUString FilterConfigCache::FilterConfigCacheEntry::GetShortName() @throws It let pass RuntimeExceptions only. */ -Reference< XInterface > openConfig(const char* sPackage) +static Reference< XInterface > openConfig(const char* sPackage) { Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() ); diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 7aa82f10031b..c2146b962248 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -167,7 +167,7 @@ sal_uInt8* ImplSearchEntry( sal_uInt8* pSource, sal_uInt8 const * pDest, sal_uLo return nullptr; } -inline OUString ImpGetExtension( const OUString &rPath ) +static inline OUString ImpGetExtension( const OUString &rPath ) { OUString aExt; INetURLObject aURL( rPath ); diff --git a/vcl/source/filter/graphicfilter2.cxx b/vcl/source/filter/graphicfilter2.cxx index f9b5ae775c7f..32ad4b51947a 100644 --- a/vcl/source/filter/graphicfilter2.cxx +++ b/vcl/source/filter/graphicfilter2.cxx @@ -214,7 +214,7 @@ bool GraphicDescriptor::ImpDetectGIF( SvStream& rStm, bool bExtendedInfo ) } // returns the next jpeg marker, a return value of 0 represents an error -sal_uInt8 ImpDetectJPG_GetNextMarker( SvStream& rStm ) +static sal_uInt8 ImpDetectJPG_GetNextMarker( SvStream& rStm ) { sal_uInt8 nByte; do diff --git a/vcl/source/filter/jpeg/JpegReader.cxx b/vcl/source/filter/jpeg/JpegReader.cxx index 7b307d7f97cb..1e21b012f0d9 100644 --- a/vcl/source/filter/jpeg/JpegReader.cxx +++ b/vcl/source/filter/jpeg/JpegReader.cxx @@ -32,11 +32,13 @@ #define BUFFER_SIZE 4096 +extern "C" { + /* * Initialize source --- called by jpeg_read_header * before any data is actually read. */ -extern "C" void init_source (j_decompress_ptr cinfo) +static void init_source (j_decompress_ptr cinfo) { SourceManagerStruct * source = reinterpret_cast<SourceManagerStruct *>(cinfo->src); @@ -48,7 +50,9 @@ extern "C" void init_source (j_decompress_ptr cinfo) source->no_data_available = FALSE; } -long StreamRead( SvStream* pStream, void* pBuffer, long nBufferSize ) +} + +static long StreamRead( SvStream* pStream, void* pBuffer, long nBufferSize ) { long nRead = 0; @@ -71,7 +75,9 @@ long StreamRead( SvStream* pStream, void* pBuffer, long nBufferSize ) return nRead; } -extern "C" boolean fill_input_buffer (j_decompress_ptr cinfo) +extern "C" { + +static boolean fill_input_buffer (j_decompress_ptr cinfo) { SourceManagerStruct * source = reinterpret_cast<SourceManagerStruct *>(cinfo->src); size_t nbytes; @@ -99,7 +105,7 @@ extern "C" boolean fill_input_buffer (j_decompress_ptr cinfo) return TRUE; } -extern "C" void skip_input_data (j_decompress_ptr cinfo, long numberOfBytes) +static void skip_input_data (j_decompress_ptr cinfo, long numberOfBytes) { SourceManagerStruct * source = reinterpret_cast<SourceManagerStruct *>(cinfo->src); @@ -123,11 +129,13 @@ extern "C" void skip_input_data (j_decompress_ptr cinfo, long numberOfBytes) } } -extern "C" void term_source (j_decompress_ptr) +static void term_source (j_decompress_ptr) { /* no work necessary here */ } +} + void jpeg_svstream_src (j_decompress_ptr cinfo, void* input) { SourceManagerStruct * source; diff --git a/vcl/source/filter/jpeg/JpegWriter.cxx b/vcl/source/filter/jpeg/JpegWriter.cxx index 49e4c6057858..f246c3ea53b3 100644 --- a/vcl/source/filter/jpeg/JpegWriter.cxx +++ b/vcl/source/filter/jpeg/JpegWriter.cxx @@ -38,7 +38,9 @@ struct DestinationManagerStruct JOCTET * buffer; /* start of buffer */ }; -extern "C" void init_destination (j_compress_ptr cinfo) +extern "C" { + +static void init_destination (j_compress_ptr cinfo) { DestinationManagerStruct * destination = reinterpret_cast<DestinationManagerStruct *>(cinfo->dest); @@ -50,7 +52,7 @@ extern "C" void init_destination (j_compress_ptr cinfo) destination->pub.free_in_buffer = BUFFER_SIZE; } -extern "C" boolean empty_output_buffer (j_compress_ptr cinfo) +static boolean empty_output_buffer (j_compress_ptr cinfo) { DestinationManagerStruct * destination = reinterpret_cast<DestinationManagerStruct *>(cinfo->dest); @@ -65,7 +67,7 @@ extern "C" boolean empty_output_buffer (j_compress_ptr cinfo) return TRUE; } -extern "C" void term_destination (j_compress_ptr cinfo) +static void term_destination (j_compress_ptr cinfo) { DestinationManagerStruct * destination = reinterpret_cast<DestinationManagerStruct *>(cinfo->dest); size_t datacount = BUFFER_SIZE - destination->pub.free_in_buffer; @@ -80,6 +82,8 @@ extern "C" void term_destination (j_compress_ptr cinfo) } } +} + void jpeg_svstream_dest (j_compress_ptr cinfo, void* output) { SvStream* stream = static_cast<SvStream*>(output); diff --git a/vcl/source/filter/jpeg/jpegc.cxx b/vcl/source/filter/jpeg/jpegc.cxx index cd87781ebd4f..ab56a35c0de7 100644 --- a/vcl/source/filter/jpeg/jpegc.cxx +++ b/vcl/source/filter/jpeg/jpegc.cxx @@ -55,7 +55,9 @@ struct ErrorManagerStruct #pragma warning(pop) #endif -extern "C" void errorExit (j_common_ptr cinfo) +extern "C" { + +static void errorExit (j_common_ptr cinfo) { char buffer[JMSG_LENGTH_MAX]; (*cinfo->err->format_message) (cinfo, buffer); @@ -64,19 +66,23 @@ extern "C" void errorExit (j_common_ptr cinfo) longjmp(error->setjmp_buffer, 1); } -extern "C" void outputMessage (j_common_ptr cinfo) +static void outputMessage (j_common_ptr cinfo) { char buffer[JMSG_LENGTH_MAX]; (*cinfo->err->format_message) (cinfo, buffer); SAL_WARN("vcl.filter", "failure reading JPEG: " << buffer); } +} + static int GetWarningLimit() { return utl::ConfigManager::IsFuzzing() ? 5 : 1000; } -extern "C" void emitMessage (j_common_ptr cinfo, int msg_level) +extern "C" { + +static void emitMessage (j_common_ptr cinfo, int msg_level) { if (msg_level < 0) { @@ -93,6 +99,8 @@ extern "C" void emitMessage (j_common_ptr cinfo, int msg_level) cinfo->err->output_message(cinfo); } +} + class JpegDecompressOwner { public: @@ -139,7 +147,7 @@ struct JpegStuff std::vector<sal_uInt8> pCYMKBuffer; }; -void ReadJPEG(JpegStuff& rContext, JPEGReader* pJPEGReader, void* pInputStream, long* pLines, +static void ReadJPEG(JpegStuff& rContext, JPEGReader* pJPEGReader, void* pInputStream, long* pLines, Size const & previewSize, GraphicFilterImportFlags nImportFlags, BitmapScopedWriteAccess* ppAccess) { diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx index a877c30c6352..f91c0fbee9d1 100644 --- a/vcl/source/fontsubset/cff.cxx +++ b/vcl/source/fontsubset/cff.cxx @@ -1703,7 +1703,7 @@ void Type1Emitter::emitAllCrypted() // #i110387# quick-and-dirty double->ascii conversion // needed because sprintf/ecvt/etc. alone are too localized (LC_NUMERIC) // also strip off trailing zeros in fraction while we are at it -inline int dbl2str( char* pOut, double fVal) +static inline int dbl2str( char* pOut, double fVal) { const int nLen = psp::getValueOfDouble( pOut, fVal, 6); return nLen; diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx index 85aef9aa7ea0..40a5e0bf0999 100644 --- a/vcl/source/fontsubset/sft.cxx +++ b/vcl/source/fontsubset/sft.cxx @@ -2610,7 +2610,7 @@ void DisposeNameRecords(NameRecord* nr, int n) free(nr); } -template<size_t N> void +template<size_t N> static void append(std::bitset<N> & rSet, size_t const nOffset, sal_uInt32 const nValue) { for (size_t i = 0; i < 32; ++i) diff --git a/vcl/source/gdi/bmpfast.cxx b/vcl/source/gdi/bmpfast.cxx index ebc181e42d07..76f083663ba0 100644 --- a/vcl/source/gdi/bmpfast.cxx +++ b/vcl/source/gdi/bmpfast.cxx @@ -232,7 +232,7 @@ class TrueColorPixelPtr<ScanlineFormat::N8BitPal> // converting truecolor formats template <ScanlineFormat SRCFMT, ScanlineFormat DSTFMT> -inline void ImplConvertPixel( const TrueColorPixelPtr<DSTFMT>& rDst, +static inline void ImplConvertPixel( const TrueColorPixelPtr<DSTFMT>& rDst, const TrueColorPixelPtr<SRCFMT>& rSrc ) { rDst.SetColor( rSrc.GetRed(), rSrc.GetGreen(), rSrc.GetBlue() ); @@ -252,7 +252,7 @@ inline void ImplConvertPixel<ScanlineFormat::N16BitTcLsbMask, ScanlineFormat::N1 } template <ScanlineFormat SRCFMT, ScanlineFormat DSTFMT> -inline void ImplConvertLine( const TrueColorPixelPtr<DSTFMT>& rDst, +static inline void ImplConvertLine( const TrueColorPixelPtr<DSTFMT>& rDst, const TrueColorPixelPtr<SRCFMT>& rSrc, int nPixelCount ) { TrueColorPixelPtr<DSTFMT> aDst( rDst ); @@ -267,7 +267,7 @@ inline void ImplConvertLine( const TrueColorPixelPtr<DSTFMT>& rDst, // alpha blending truecolor pixels template <ScanlineFormat SRCFMT, ScanlineFormat DSTFMT> -inline void ImplBlendPixels( const TrueColorPixelPtr<DSTFMT>& rDst, +static inline void ImplBlendPixels( const TrueColorPixelPtr<DSTFMT>& rDst, const TrueColorPixelPtr<SRCFMT>& rSrc, unsigned nAlphaVal ) { static const unsigned nAlphaShift = 8; @@ -294,7 +294,7 @@ inline void ImplBlendPixels( const TrueColorPixelPtr<DSTFMT>& rDst, } template <ScanlineFormat MASKFMT, ScanlineFormat SRCFMT, ScanlineFormat DSTFMT> -inline void ImplBlendLines( const TrueColorPixelPtr<DSTFMT>& rDst, +static inline void ImplBlendLines( const TrueColorPixelPtr<DSTFMT>& rDst, const TrueColorPixelPtr<SRCFMT>& rSrc, const TrueColorPixelPtr<MASKFMT>& rMsk, int nPixelCount ) { @@ -345,7 +345,7 @@ static bool ImplCopyImage( BitmapBuffer& rDstBuffer, const BitmapBuffer& rSrcBuf } template <ScanlineFormat DSTFMT,ScanlineFormat SRCFMT> -bool ImplConvertToBitmap( TrueColorPixelPtr<SRCFMT>& rSrcLine, +static bool ImplConvertToBitmap( TrueColorPixelPtr<SRCFMT>& rSrcLine, BitmapBuffer& rDstBuffer, const BitmapBuffer& rSrcBuffer ) { // help the compiler to avoid instantiations of unneeded conversions @@ -376,7 +376,7 @@ bool ImplConvertToBitmap( TrueColorPixelPtr<SRCFMT>& rSrcLine, } template <ScanlineFormat SRCFMT> -inline bool ImplConvertFromBitmap( BitmapBuffer& rDst, const BitmapBuffer& rSrc ) +static inline bool ImplConvertFromBitmap( BitmapBuffer& rDst, const BitmapBuffer& rSrc ) { TrueColorPixelPtr<SRCFMT> aSrcType; aSrcType.SetRawPtr( rSrc.mpBits ); @@ -536,7 +536,7 @@ bool ImplFastBitmapConversion( BitmapBuffer& rDst, const BitmapBuffer& rSrc, } template <ScanlineFormat DSTFMT, ScanlineFormat SRCFMT> //,sal_uLong MSKFMT> -bool ImplBlendToBitmap( TrueColorPixelPtr<SRCFMT>& rSrcLine, +static bool ImplBlendToBitmap( TrueColorPixelPtr<SRCFMT>& rSrcLine, BitmapBuffer& rDstBuffer, const BitmapBuffer& rSrcBuffer, const BitmapBuffer& rMskBuffer ) { @@ -611,7 +611,7 @@ inline bool ImplBlendToBitmap<ScanlineFormat::N32BitTcBgra,ScanlineFormat::N32Bi } template <ScanlineFormat SRCFMT> -bool ImplBlendFromBitmap( BitmapBuffer& rDst, const BitmapBuffer& rSrc, const BitmapBuffer& rMsk ) +static bool ImplBlendFromBitmap( BitmapBuffer& rDst, const BitmapBuffer& rSrc, const BitmapBuffer& rMsk ) { TrueColorPixelPtr<SRCFMT> aSrcType; aSrcType.SetRawPtr( rSrc.mpBits ); diff --git a/vcl/source/gdi/impvect.cxx b/vcl/source/gdi/impvect.cxx index 8c779743c5a0..e785aae0aeb7 100644 --- a/vcl/source/gdi/impvect.cxx +++ b/vcl/source/gdi/impvect.cxx @@ -53,11 +53,11 @@ class ImplChain; namespace ImplVectorizer { - ImplVectMap* ImplExpand( BitmapReadAccess* pRAcc, const Color& rColor ); - void ImplCalculate( ImplVectMap* pMap, tools::PolyPolygon& rPolyPoly, sal_uInt8 cReduce ); - bool ImplGetChain( ImplVectMap* pMap, const Point& rStartPt, ImplChain& rChain ); - bool ImplIsUp( ImplVectMap const * pMap, long nY, long nX ); - void ImplLimitPolyPoly( tools::PolyPolygon& rPolyPoly ); + static ImplVectMap* ImplExpand( BitmapReadAccess* pRAcc, const Color& rColor ); + static void ImplCalculate( ImplVectMap* pMap, tools::PolyPolygon& rPolyPoly, sal_uInt8 cReduce ); + static bool ImplGetChain( ImplVectMap* pMap, const Point& rStartPt, ImplChain& rChain ); + static bool ImplIsUp( ImplVectMap const * pMap, long nY, long nX ); + static void ImplLimitPolyPoly( tools::PolyPolygon& rPolyPoly ); } struct ChainMove { long nDX; long nDY; }; @@ -102,7 +102,9 @@ struct ImplColorSet bool mbSet = false; }; -extern "C" int ImplColorSetCmpFnc( const void* p1, const void* p2 ) +extern "C" { + +static int ImplColorSetCmpFnc( const void* p1, const void* p2 ) { ImplColorSet const * pSet1 = static_cast<ImplColorSet const *>(p1); ImplColorSet const * pSet2 = static_cast<ImplColorSet const *>(p2); @@ -124,6 +126,8 @@ extern "C" int ImplColorSetCmpFnc( const void* p1, const void* p2 ) return nRet; } +} + class ImplPointArray { std::unique_ptr<Point[]> mpArray; diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 562927d505b0..1a3e67d366d7 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -1340,7 +1340,7 @@ bool PDFWriterImpl::PDFPage::emit(sal_Int32 nParentObject ) namespace vcl { template < class GEOMETRY > -GEOMETRY lcl_convert( const MapMode& _rSource, const MapMode& _rDest, OutputDevice* _pPixelConversion, const GEOMETRY& _rObject ) +static GEOMETRY lcl_convert( const MapMode& _rSource, const MapMode& _rDest, OutputDevice* _pPixelConversion, const GEOMETRY& _rObject ) { GEOMETRY aPoint; if ( MapUnit::MapPixel == _rSource.GetMapUnit() ) diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index 5ad75f843302..e87f2acfbd0d 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -1561,12 +1561,12 @@ static const long setRun[256] = 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 7, 8, /* 0xf0 - 0xff */ }; -inline bool isSet( const Scanline i_pLine, long i_nIndex ) +static inline bool isSet( const Scanline i_pLine, long i_nIndex ) { return (i_pLine[ i_nIndex/8 ] & (0x80 >> (i_nIndex&7))) != 0; } -long findBitRunImpl( const Scanline i_pLine, long i_nStartIndex, long i_nW, bool i_bSet ) +static long findBitRunImpl( const Scanline i_pLine, long i_nStartIndex, long i_nW, bool i_bSet ) { long nIndex = i_nStartIndex; if( nIndex < i_nW ) @@ -1629,7 +1629,7 @@ long findBitRunImpl( const Scanline i_pLine, long i_nStartIndex, long i_nW, bool return std::min(nIndex, i_nW); } -long findBitRun(const Scanline i_pLine, long i_nStartIndex, long i_nW, bool i_bSet) +static long findBitRun(const Scanline i_pLine, long i_nStartIndex, long i_nW, bool i_bSet) { if (i_nStartIndex < 0) return i_nW; @@ -1637,7 +1637,7 @@ long findBitRun(const Scanline i_pLine, long i_nStartIndex, long i_nW, bool i_bS return findBitRunImpl(i_pLine, i_nStartIndex, i_nW, i_bSet); } -long findBitRun(const Scanline i_pLine, long i_nStartIndex, long i_nW) +static long findBitRun(const Scanline i_pLine, long i_nStartIndex, long i_nW) { if (i_nStartIndex < 0) return i_nW; diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx index abfc5ad55357..5af7829b0e03 100644 --- a/vcl/source/gdi/region.cxx +++ b/vcl/source/gdi/region.cxx @@ -234,7 +234,7 @@ bool vcl::Region::IsEmpty() const } -std::unique_ptr<RegionBand> ImplCreateRegionBandFromPolyPolygon(const tools::PolyPolygon& rPolyPolygon) +static std::unique_ptr<RegionBand> ImplCreateRegionBandFromPolyPolygon(const tools::PolyPolygon& rPolyPolygon) { std::unique_ptr<RegionBand> pRetval; diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx index b9cc988fdbbb..e2fd9aeb88a3 100644 --- a/vcl/source/gdi/sallayout.cxx +++ b/vcl/source/gdi/sallayout.cxx @@ -210,7 +210,7 @@ sal_UCS4 GetLocalizedChar( sal_UCS4 nChar, LanguageType eLang ) return nChar; } -inline bool IsControlChar( sal_UCS4 cChar ) +static inline bool IsControlChar( sal_UCS4 cChar ) { // C0 control characters if( (0x0001 <= cChar) && (cChar <= 0x001F) ) diff --git a/vcl/source/gdi/svmconverter.cxx b/vcl/source/gdi/svmconverter.cxx index 8393c482e41d..b00fdfdce81b 100644 --- a/vcl/source/gdi/svmconverter.cxx +++ b/vcl/source/gdi/svmconverter.cxx @@ -37,7 +37,7 @@ #include <o3tl/make_unique.hxx> // Inlines -void ImplReadRect( SvStream& rIStm, tools::Rectangle& rRect ) +static void ImplReadRect( SvStream& rIStm, tools::Rectangle& rRect ) { Point aTL; Point aBR; @@ -48,7 +48,7 @@ void ImplReadRect( SvStream& rIStm, tools::Rectangle& rRect ) rRect = tools::Rectangle( aTL, aBR ); } -bool ImplReadPoly(SvStream& rIStm, tools::Polygon& rPoly) +static bool ImplReadPoly(SvStream& rIStm, tools::Polygon& rPoly) { sal_Int32 nSize32(0); rIStm.ReadInt32(nSize32); @@ -69,7 +69,7 @@ bool ImplReadPoly(SvStream& rIStm, tools::Polygon& rPoly) return rIStm.good(); } -bool ImplReadPolyPoly(SvStream& rIStm, tools::PolyPolygon& rPolyPoly) +static bool ImplReadPolyPoly(SvStream& rIStm, tools::PolyPolygon& rPolyPoly) { bool bSuccess = true; @@ -91,7 +91,7 @@ bool ImplReadPolyPoly(SvStream& rIStm, tools::PolyPolygon& rPolyPoly) return bSuccess && rIStm.good(); } -void ImplReadColor( SvStream& rIStm, Color& rColor ) +static void ImplReadColor( SvStream& rIStm, Color& rColor ) { sal_Int16 nVal(0); @@ -100,7 +100,7 @@ void ImplReadColor( SvStream& rIStm, Color& rColor ) rIStm.ReadInt16( nVal ); rColor.SetBlue( sal::static_int_cast<sal_uInt8>(static_cast<sal_uInt16>(nVal) >> 8) ); } -bool ImplReadMapMode(SvStream& rIStm, MapMode& rMapMode) +static bool ImplReadMapMode(SvStream& rIStm, MapMode& rMapMode) { sal_Int16 nUnit(0); rIStm.ReadInt16(nUnit); @@ -128,7 +128,7 @@ bool ImplReadMapMode(SvStream& rIStm, MapMode& rMapMode) return true; } -void ImplReadUnicodeComment( sal_uInt32 nStrmPos, SvStream& rIStm, OUString& rString ) +static void ImplReadUnicodeComment( sal_uInt32 nStrmPos, SvStream& rIStm, OUString& rString ) { sal_uInt32 nOld = rIStm.Tell(); if ( nStrmPos ) @@ -149,7 +149,7 @@ void ImplReadUnicodeComment( sal_uInt32 nStrmPos, SvStream& rIStm, OUString& rSt rIStm.Seek( nOld ); } -void ImplSkipActions(SvStream& rIStm, sal_uLong nSkipCount) +static void ImplSkipActions(SvStream& rIStm, sal_uLong nSkipCount) { sal_Int32 nActionSize; sal_Int16 nType; @@ -162,7 +162,7 @@ void ImplSkipActions(SvStream& rIStm, sal_uLong nSkipCount) } } -void ImplReadExtendedPolyPolygonAction(SvStream& rIStm, tools::PolyPolygon& rPolyPoly) +static void ImplReadExtendedPolyPolygonAction(SvStream& rIStm, tools::PolyPolygon& rPolyPoly) { rPolyPoly.Clear(); sal_uInt16 nPolygonCount(0); diff --git a/vcl/source/gdi/vectorgraphicdata.cxx b/vcl/source/gdi/vectorgraphicdata.cxx index 662c2505553d..08aebe0a1b3d 100644 --- a/vcl/source/gdi/vectorgraphicdata.cxx +++ b/vcl/source/gdi/vectorgraphicdata.cxx @@ -90,7 +90,7 @@ BitmapEx convertPrimitive2DSequenceToBitmapEx( return aRetval; } -size_t estimateSize( +static size_t estimateSize( std::deque<uno::Reference<graphic::XPrimitive2D>> const& rSequence) { size_t nRet(0); diff --git a/vcl/source/helper/commandinfoprovider.cxx b/vcl/source/helper/commandinfoprovider.cxx index 1eaab88e4747..378832b55611 100644 --- a/vcl/source/helper/commandinfoprovider.cxx +++ b/vcl/source/helper/commandinfoprovider.cxx @@ -39,7 +39,7 @@ using namespace css::uno; namespace vcl { namespace CommandInfoProvider { -Reference<container::XNameAccess> const GetCommandDescription() +static Reference<container::XNameAccess> const GetCommandDescription() { static WeakReference<container::XNameAccess> xWeakRef; css::uno::Reference<container::XNameAccess> xRef(xWeakRef); @@ -53,7 +53,7 @@ Reference<container::XNameAccess> const GetCommandDescription() return xRef; } -Reference<ui::XModuleUIConfigurationManagerSupplier> const GetModuleConfigurationSupplier() +static Reference<ui::XModuleUIConfigurationManagerSupplier> const GetModuleConfigurationSupplier() { static WeakReference<ui::XModuleUIConfigurationManagerSupplier> xWeakRef; css::uno::Reference<ui::XModuleUIConfigurationManagerSupplier> xRef(xWeakRef); @@ -67,7 +67,7 @@ Reference<ui::XModuleUIConfigurationManagerSupplier> const GetModuleConfiguratio return xRef; } -Reference<ui::XAcceleratorConfiguration> const GetGlobalAcceleratorConfiguration() +static Reference<ui::XAcceleratorConfiguration> const GetGlobalAcceleratorConfiguration() { static WeakReference<ui::XAcceleratorConfiguration> xWeakRef; css::uno::Reference<ui::XAcceleratorConfiguration> xRef(xWeakRef); @@ -81,7 +81,7 @@ Reference<ui::XAcceleratorConfiguration> const GetGlobalAcceleratorConfiguration return xRef; } -Reference<ui::XAcceleratorConfiguration> const GetDocumentAcceleratorConfiguration(const Reference<frame::XFrame>& rxFrame) +static Reference<ui::XAcceleratorConfiguration> const GetDocumentAcceleratorConfiguration(const Reference<frame::XFrame>& rxFrame) { Reference<frame::XController> xController = rxFrame->getController(); if (xController.is()) @@ -100,7 +100,7 @@ Reference<ui::XAcceleratorConfiguration> const GetDocumentAcceleratorConfigurati return nullptr; } -Reference<ui::XAcceleratorConfiguration> const GetModuleAcceleratorConfiguration(const Reference<frame::XFrame>& rxFrame) +static Reference<ui::XAcceleratorConfiguration> const GetModuleAcceleratorConfiguration(const Reference<frame::XFrame>& rxFrame) { css::uno::Reference<css::ui::XAcceleratorConfiguration> curModuleAcceleratorConfiguration; try @@ -119,7 +119,7 @@ Reference<ui::XAcceleratorConfiguration> const GetModuleAcceleratorConfiguration return curModuleAcceleratorConfiguration; } -vcl::KeyCode AWTKey2VCLKey(const awt::KeyEvent& aAWTKey) +static vcl::KeyCode AWTKey2VCLKey(const awt::KeyEvent& aAWTKey) { bool bShift = ((aAWTKey.Modifiers & awt::KeyModifier::SHIFT) == awt::KeyModifier::SHIFT ); bool bMod1 = ((aAWTKey.Modifiers & awt::KeyModifier::MOD1 ) == awt::KeyModifier::MOD1 ); @@ -130,7 +130,7 @@ vcl::KeyCode AWTKey2VCLKey(const awt::KeyEvent& aAWTKey) return vcl::KeyCode(nKey, bShift, bMod1, bMod2, bMod3); } -OUString RetrieveShortcutsFromConfiguration( +static OUString RetrieveShortcutsFromConfiguration( const Reference<ui::XAcceleratorConfiguration>& rxConfiguration, const OUString& rsCommandName) { @@ -157,7 +157,7 @@ OUString RetrieveShortcutsFromConfiguration( return OUString(); } -bool ResourceHasKey(const OUString& rsResourceName, const OUString& rsCommandName, const OUString& rsModuleName) +static bool ResourceHasKey(const OUString& rsResourceName, const OUString& rsCommandName, const OUString& rsModuleName) { Sequence< OUString > aSequence; try @@ -183,7 +183,7 @@ bool ResourceHasKey(const OUString& rsResourceName, const OUString& rsCommandNam return false; } -Sequence<beans::PropertyValue> GetCommandProperties(const OUString& rsCommandName, const OUString& rsModuleName) +static Sequence<beans::PropertyValue> GetCommandProperties(const OUString& rsCommandName, const OUString& rsModuleName) { Sequence<beans::PropertyValue> aProperties; @@ -204,7 +204,7 @@ Sequence<beans::PropertyValue> GetCommandProperties(const OUString& rsCommandNam return aProperties; } -OUString GetCommandProperty(const OUString& rsProperty, const OUString& rsCommandName, const OUString& rsModuleName) +static OUString GetCommandProperty(const OUString& rsProperty, const OUString& rsCommandName, const OUString& rsModuleName) { const Sequence<beans::PropertyValue> aProperties (GetCommandProperties(rsCommandName, rsModuleName)); for (sal_Int32 nIndex=0; nIndex<aProperties.getLength(); ++nIndex) @@ -294,7 +294,7 @@ OUString GetRealCommandForCommand(const OUString& rCommandName, return GetCommandProperty("TargetURL", rCommandName, rsModuleName); } -BitmapEx GetBitmapForCommand(const OUString& rsCommandName, +static BitmapEx GetBitmapForCommand(const OUString& rsCommandName, const Reference<frame::XFrame>& rxFrame, vcl::ImageType eImageType) { diff --git a/vcl/source/image/ImplImageTree.cxx b/vcl/source/image/ImplImageTree.cxx index fd1025dec240..af5329ec379e 100644 --- a/vcl/source/image/ImplImageTree.cxx +++ b/vcl/source/image/ImplImageTree.cxx @@ -332,7 +332,7 @@ bool ImplImageTree::loadImage(OUString const & rName, OUString const & rStyle, B return false; } -OUString createVariant(ImageRequestParameters& rParameters) +static OUString createVariant(ImageRequestParameters& rParameters) { bool bConvertToDarkTheme = rParameters.convertToDarkTheme(); sal_Int32 aScalePercentage = rParameters.scalePercentage(); @@ -345,7 +345,7 @@ OUString createVariant(ImageRequestParameters& rParameters) return aVariant; } -bool loadDiskCachedVersion(OUString const & sVariant, ImageRequestParameters& rParameters) +static bool loadDiskCachedVersion(OUString const & sVariant, ImageRequestParameters& rParameters) { OUString sUrl(getIconCacheUrl(rParameters.msStyle, sVariant, rParameters.msName)); if (!urlExists(sUrl)) @@ -357,7 +357,7 @@ bool loadDiskCachedVersion(OUString const & sVariant, ImageRequestParameters& rP return true; } -void cacheBitmapToDisk(OUString const & sVariant, ImageRequestParameters const & rParameters) +static void cacheBitmapToDisk(OUString const & sVariant, ImageRequestParameters const & rParameters) { OUString sUrl(createIconCacheUrl(rParameters.msStyle, sVariant, rParameters.msName)); vcl::PNGWriter aWriter(rParameters.mrBitmap); diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx index 5dc4090bdaa0..875589e00df1 100644 --- a/vcl/source/opengl/OpenGLContext.cxx +++ b/vcl/source/opengl/OpenGLContext.cxx @@ -238,7 +238,7 @@ bool OpenGLContext::ImplInit() return false; } -OUString getGLString(GLenum eGlEnum) +static OUString getGLString(GLenum eGlEnum) { OUString sString; const GLubyte* pString = glGetString(eGlEnum); diff --git a/vcl/source/outdev/hatch.cxx b/vcl/source/outdev/hatch.cxx index 2059aa364824..79b2c7e7f83a 100644 --- a/vcl/source/outdev/hatch.cxx +++ b/vcl/source/outdev/hatch.cxx @@ -35,7 +35,9 @@ #define HATCH_MAXPOINTS 1024 -extern "C" int HatchCmpFnc( const void* p1, const void* p2 ) +extern "C" { + +static int HatchCmpFnc( const void* p1, const void* p2 ) { const long nX1 = static_cast<Point const *>(p1)->X(); const long nX2 = static_cast<Point const *>(p2)->X(); @@ -45,6 +47,8 @@ extern "C" int HatchCmpFnc( const void* p1, const void* p2 ) return ( nX1 > nX2 ? 1 : nX1 == nX2 ? nY1 > nY2 ? 1: nY1 == nY2 ? 0 : -1 : -1 ); } +} + void OutputDevice::DrawHatch( const tools::PolyPolygon& rPolyPoly, const Hatch& rHatch ) { assert(!is_double_buffered_window()); diff --git a/vcl/source/outdev/map.cxx b/vcl/source/outdev/map.cxx index d88960d9da9b..c890037017e7 100644 --- a/vcl/source/outdev/map.cxx +++ b/vcl/source/outdev/map.cxx @@ -313,7 +313,7 @@ static void ImplCalcMapResolution( const MapMode& rMapMode, rMapRes.mnMapScDenomY = aTempY.GetDenominator(); } -inline void ImplCalcMapResolution( const MapMode& rMapMode, +static inline void ImplCalcMapResolution( const MapMode& rMapMode, long nDPIX, long nDPIY, ImplMapRes& rMapRes, ImplThresholdRes& rThresRes ) diff --git a/vcl/source/window/accel.cxx b/vcl/source/window/accel.cxx index 69a556e0ecaa..7ba39842a2af 100644 --- a/vcl/source/window/accel.cxx +++ b/vcl/source/window/accel.cxx @@ -37,7 +37,7 @@ public: ImplAccelList maIdList; // Id-List }; -sal_uInt16 ImplAccelEntryGetIndex( ImplAccelList* pList, sal_uInt16 nId, +static sal_uInt16 ImplAccelEntryGetIndex( ImplAccelList* pList, sal_uInt16 nId, sal_uInt16* pIndex = nullptr ) { size_t nLow; diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 9b1a1d322916..3bfff31b910e 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -57,7 +57,7 @@ #include <dlfcn.h> #endif -bool toBool(const OString &rValue) +static bool toBool(const OString &rValue) { return (!rValue.isEmpty() && (rValue[0] == 't' || rValue[0] == 'T' || rValue[0] == '1')); } @@ -3267,7 +3267,7 @@ void VclBuilder::insertMenuObject(PopupMenu *pParent, PopupMenu *pSubMenu, const /// Insert items to a ComboBox or a ListBox. /// They have no common ancestor that would have 'InsertEntry()', so use a template. -template<typename T> bool insertItems(vcl::Window *pWindow, VclBuilder::stringmap &rMap, const std::vector<ComboBoxTextItem> &rItems) +template<typename T> static bool insertItems(vcl::Window *pWindow, VclBuilder::stringmap &rMap, const std::vector<ComboBoxTextItem> &rItems) { T *pContainer = dynamic_cast<T*>(pWindow); if (!pContainer) diff --git a/vcl/source/window/keycod.cxx b/vcl/source/window/keycod.cxx index 5f4d4c441d30..8aeb7b07cb74 100644 --- a/vcl/source/window/keycod.cxx +++ b/vcl/source/window/keycod.cxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <accel.h> #include <salinst.hxx> #include <salframe.hxx> #include <svdata.hxx> diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index fd45676424a7..2b4ac9c11b9c 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -183,7 +183,7 @@ void VclContainer::queue_resize(StateChangedType eReason) } -Button* isVisibleButtonWithText(vcl::Window* pCandidate) +static Button* isVisibleButtonWithText(vcl::Window* pCandidate) { if (!pCandidate) return nullptr; @@ -1234,12 +1234,12 @@ static void calcMaxs(const array_type &A, std::vector<VclGrid::Value> &rWidths, } } -bool compareValues(const VclGrid::Value &i, const VclGrid::Value &j) +static bool compareValues(const VclGrid::Value &i, const VclGrid::Value &j) { return i.m_nValue < j.m_nValue; } -VclGrid::Value accumulateValues(const VclGrid::Value &i, const VclGrid::Value &j) +static VclGrid::Value accumulateValues(const VclGrid::Value &i, const VclGrid::Value &j) { VclGrid::Value aRet; aRet.m_nValue = i.m_nValue + j.m_nValue; diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 1fc1ca4b991f..b92daf20f10c 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -548,7 +548,7 @@ void Menu::RemoveItem( sal_uInt16 nPos ) ImplCallEventListeners( VclEventId::MenuRemoveItem, nPos ); } -void ImplCopyItem( Menu* pThis, const Menu& rMenu, sal_uInt16 nPos, sal_uInt16 nNewPos ) +static void ImplCopyItem( Menu* pThis, const Menu& rMenu, sal_uInt16 nPos, sal_uInt16 nNewPos ) { MenuItemType eType = rMenu.GetItemType( nPos ); diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index 9be367442e21..819b3c7ca6e3 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -883,7 +883,7 @@ bool PrintDialog::isSingleJobs() return maOptionsPage.mpCollateSingleJobsBox->IsChecked(); } -void setHelpId( vcl::Window* i_pWindow, const Sequence< OUString >& i_rHelpIds, sal_Int32 i_nIndex ) +static void setHelpId( vcl::Window* i_pWindow, const Sequence< OUString >& i_rHelpIds, sal_Int32 i_nIndex ) { if( i_nIndex >= 0 && i_nIndex < i_rHelpIds.getLength() ) i_pWindow->SetHelpId( OUStringToOString( i_rHelpIds.getConstArray()[i_nIndex], RTL_TEXTENCODING_UTF8 ) ); diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx index 666824613b34..86d1c6eadc3e 100644 --- a/vcl/source/window/status.cxx +++ b/vcl/source/window/status.cxx @@ -79,7 +79,7 @@ struct ImplStatusItem std::unique_ptr<SalLayout> mxLayoutCache; }; -inline long ImplCalcProgressWidth( sal_uInt16 nMax, long nSize ) +static inline long ImplCalcProgressWidth( sal_uInt16 nMax, long nSize ) { return ((nMax*(nSize+(nSize/2)))-(nSize/2)+(STATUSBAR_PRGS_OFFSET*2)); } diff --git a/vcl/source/window/syschild.cxx b/vcl/source/window/syschild.cxx index b96123ddc637..28063ce19c63 100644 --- a/vcl/source/window/syschild.cxx +++ b/vcl/source/window/syschild.cxx @@ -42,7 +42,7 @@ using namespace ::com::sun::star; -void ImplSysChildProc( void* pInst, SalObjEvent nEvent ) +static void ImplSysChildProc( void* pInst, SalObjEvent nEvent ) { VclPtr<SystemChildWindow> pWindow = static_cast<SystemChildWindow*>(pInst); diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index 187667e288a7..c5db670b3c6d 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -112,7 +112,7 @@ void SystemWindow::dispose() Window::dispose(); } -void ImplHandleControlAccelerator( vcl::Window* pWindow, bool bShow ) +static void ImplHandleControlAccelerator( vcl::Window* pWindow, bool bShow ) { Control *pControl = dynamic_cast<Control*>(pWindow->ImplGetWindow()); if (pControl && pControl->GetText().indexOf('~') != -1) diff --git a/vcl/source/window/tabdlg.cxx b/vcl/source/window/tabdlg.cxx index 1cda73af9e44..9a6c01d2478a 100644 --- a/vcl/source/window/tabdlg.cxx +++ b/vcl/source/window/tabdlg.cxx @@ -242,7 +242,7 @@ void TabDialog::StateChanged( StateChangedType nType ) Dialog::StateChanged( nType ); } -vcl::Window* findTabControl(vcl::Window* pCurrent) +static vcl::Window* findTabControl(vcl::Window* pCurrent) { if (!pCurrent) { diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index c21499e00d29..66563c6b9ee7 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -145,7 +145,7 @@ int ToolBox::ImplGetDragWidth() const return ToolBox::ImplGetDragWidth( *this, mbHorz ); } -ButtonType determineButtonType( ImplToolItem const * pItem, ButtonType defaultType ) +static ButtonType determineButtonType( ImplToolItem const * pItem, ButtonType defaultType ) { ButtonType tmpButtonType = defaultType; ToolBoxItemBits nBits = pItem->mnBits & ( ToolBoxItemBits::TEXT_ONLY | ToolBoxItemBits::ICON_ONLY ); @@ -4466,7 +4466,7 @@ bool ToolBox::ImplActivateItem( vcl::KeyCode aKeyCode ) return bRet; } -bool ImplCloseLastPopup( vcl::Window const *pParent ) +static bool ImplCloseLastPopup( vcl::Window const *pParent ) { // close last popup toolbox (see also: // ImplHandleMouseFloatMode(...) in winproc.cxx ) diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index be926265c755..829f7e3f5b27 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -382,7 +382,7 @@ void Window::SetZoom( const Fraction& rZoom ) } } -inline long WinFloatRound( double fVal ) +static inline long WinFloatRound( double fVal ) { return( fVal > 0.0 ? static_cast<long>( fVal + 0.5 ) : -static_cast<long>( -fVal + 0.5 ) ); } diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index ff2d63626b65..590032d10753 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -1866,7 +1866,7 @@ static void DelayedCloseEventLink( void* pCEvent, void* ) delete pEv; } -void ImplHandleClose( vcl::Window* pWindow ) +static void ImplHandleClose( vcl::Window* pWindow ) { ImplSVData* pSVData = ImplGetSVData(); @@ -1961,7 +1961,7 @@ static MouseEventModifiers ImplGetMouseButtonMode( SalMouseEvent const * pEvent return nMode; } -inline bool ImplHandleSalMouseLeave( vcl::Window* pWindow, SalMouseEvent const * pEvent ) +static inline bool ImplHandleSalMouseLeave( vcl::Window* pWindow, SalMouseEvent const * pEvent ) { return ImplHandleMouseEvent( pWindow, MouseNotifyEvent::MOUSEMOVE, true, pEvent->mnX, pEvent->mnY, @@ -1969,7 +1969,7 @@ inline bool ImplHandleSalMouseLeave( vcl::Window* pWindow, SalMouseEvent const * ImplGetMouseMoveMode( pEvent ) ); } -inline bool ImplHandleSalMouseMove( vcl::Window* pWindow, SalMouseEvent const * pEvent ) +static inline bool ImplHandleSalMouseMove( vcl::Window* pWindow, SalMouseEvent const * pEvent ) { return ImplHandleMouseEvent( pWindow, MouseNotifyEvent::MOUSEMOVE, false, pEvent->mnX, pEvent->mnY, @@ -1977,7 +1977,7 @@ inline bool ImplHandleSalMouseMove( vcl::Window* pWindow, SalMouseEvent const * ImplGetMouseMoveMode( pEvent ) ); } -inline bool ImplHandleSalMouseButtonDown( vcl::Window* pWindow, SalMouseEvent const * pEvent ) +static inline bool ImplHandleSalMouseButtonDown( vcl::Window* pWindow, SalMouseEvent const * pEvent ) { return ImplHandleMouseEvent( pWindow, MouseNotifyEvent::MOUSEBUTTONDOWN, false, pEvent->mnX, pEvent->mnY, @@ -1990,7 +1990,7 @@ inline bool ImplHandleSalMouseButtonDown( vcl::Window* pWindow, SalMouseEvent co ImplGetMouseButtonMode( pEvent ) ); } -inline bool ImplHandleSalMouseButtonUp( vcl::Window* pWindow, SalMouseEvent const * pEvent ) +static inline bool ImplHandleSalMouseButtonUp( vcl::Window* pWindow, SalMouseEvent const * pEvent ) { return ImplHandleMouseEvent( pWindow, MouseNotifyEvent::MOUSEBUTTONUP, false, pEvent->mnX, pEvent->mnY, diff --git a/vcl/unx/generic/app/i18n_cb.cxx b/vcl/unx/generic/app/i18n_cb.cxx index b62f5306de04..0b6cdc49b3dd 100644 --- a/vcl/unx/generic/app/i18n_cb.cxx +++ b/vcl/unx/generic/app/i18n_cb.cxx @@ -70,7 +70,7 @@ PreeditDoneCallback ( XIC, XPointer client_data, XPointer ) // Handle deletion of text in a preedit_draw_callback // from and howmuch are guaranteed to be nonnegative -void +static void Preedit_DeleteText(preedit_text_t *ptext, int from, int howmuch) { // If we've been asked to delete no text then just set @@ -116,7 +116,7 @@ Preedit_DeleteText(preedit_text_t *ptext, int from, int howmuch) // reallocate the textbuffer with sufficiently large size 2^x // nnewlimit is presupposed to be larger than ptext->size -void +static void enlarge_buffer ( preedit_text_t *ptext, int nnewlimit ) { size_t nnewsize = ptext->nSize; @@ -134,7 +134,7 @@ enlarge_buffer ( preedit_text_t *ptext, int nnewlimit ) // Handle insertion of text in a preedit_draw_callback // string field of XIMText struct is guaranteed to be != NULL -void +static void Preedit_InsertText(preedit_text_t *pText, XIMText *pInsertText, int where) { sal_Unicode *pInsertTextString; @@ -224,7 +224,7 @@ Preedit_InsertText(preedit_text_t *pText, XIMText *pInsertText, int where) // Handle the change of attributes in a preedit_draw_callback -void +static void Preedit_UpdateAttributes ( preedit_text_t* ptext, XIMFeedback const * feedback, int from, int amount ) { @@ -245,7 +245,7 @@ Preedit_UpdateAttributes ( preedit_text_t* ptext, XIMFeedback const * feedback, // Convert the XIM feedback values into appropriate VCL // EXTTEXTINPUT_ATTR values // returns an allocate list of attributes, which must be freed by caller -ExtTextInputAttr* +static ExtTextInputAttr* Preedit_FeedbackToSAL ( const XIMFeedback* pfeedback, int nlength, std::vector<ExtTextInputAttr>& rSalAttr ) { ExtTextInputAttr *psalattr; diff --git a/vcl/unx/generic/app/saldata.cxx b/vcl/unx/generic/app/saldata.cxx index cf3ba86da73b..860f8fc0def8 100644 --- a/vcl/unx/generic/app/saldata.cxx +++ b/vcl/unx/generic/app/saldata.cxx @@ -461,7 +461,7 @@ void SalXLib::Init() } extern "C" { -void EmitFontpathWarning() +static void EmitFontpathWarning() { static Bool bOnce = False; if ( !bOnce ) diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx index bd2b9d080611..469bb0012193 100644 --- a/vcl/unx/generic/app/saldisp.cxx +++ b/vcl/unx/generic/app/saldisp.cxx @@ -83,21 +83,21 @@ typedef unsigned long Pixel; using namespace vcl_sal; #ifdef DBG_UTIL -inline const char *Null( const char *p ) { return p ? p : ""; } -inline const char *GetEnv( const char *p ) { return Null( getenv( p ) ); } -inline const char *KeyStr( KeySym n ) { return Null( XKeysymToString( n ) ); } +static inline const char *Null( const char *p ) { return p ? p : ""; } +static inline const char *GetEnv( const char *p ) { return Null( getenv( p ) ); } +static inline const char *KeyStr( KeySym n ) { return Null( XKeysymToString( n ) ); } -inline const char *GetAtomName( Display *d, Atom a ) +static inline const char *GetAtomName( Display *d, Atom a ) { return Null( XGetAtomName( d, a ) ); } -inline double Hypothenuse( long w, long h ) +static inline double Hypothenuse( long w, long h ) { return sqrt( static_cast<double>((w*w)+(h*h)) ); } #endif -inline int ColorDiff( int r, int g, int b ) +static inline int ColorDiff( int r, int g, int b ) { return (r*r)+(g*g)+(b*b); } -inline int ColorDiff( Color c1, int r, int g, int b ) +static inline int ColorDiff( Color c1, int r, int g, int b ) { return ColorDiff( static_cast<int>(c1.GetRed())-r, static_cast<int>(c1.GetGreen())-g, static_cast<int>(c1.GetBlue())-b ); } @@ -765,7 +765,7 @@ OUString SalDisplay::GetKeyNameFromKeySym( KeySym nKeySym ) const return aRet; } -inline KeySym sal_XModifier2Keysym( Display *pDisplay, +static inline KeySym sal_XModifier2Keysym( Display *pDisplay, XModifierKeymap const *pXModMap, int n ) { diff --git a/vcl/unx/generic/app/salinst.cxx b/vcl/unx/generic/app/salinst.cxx index 96ab14e5596b..e7be404010e2 100644 --- a/vcl/unx/generic/app/salinst.cxx +++ b/vcl/unx/generic/app/salinst.cxx @@ -99,7 +99,7 @@ struct PredicateReturn }; extern "C" { -Bool ImplPredicateEvent( Display *, XEvent *pEvent, char *pData ) +static Bool ImplPredicateEvent( Display *, XEvent *pEvent, char *pData ) { PredicateReturn *pPre = reinterpret_cast<PredicateReturn *>(pData); diff --git a/vcl/unx/generic/app/sm.cxx b/vcl/unx/generic/app/sm.cxx index 25b516c000f3..b750845a0eb7 100644 --- a/vcl/unx/generic/app/sm.cxx +++ b/vcl/unx/generic/app/sm.cxx @@ -109,11 +109,15 @@ bool IceSalSession::cancelShutdown() return false; } -extern "C" void ICEWatchProc( +extern "C" { + +static void ICEWatchProc( IceConn ice_conn, IcePointer client_data, Bool opening, IcePointer * watch_data); -extern "C" void ICEConnectionWorker(void * data); +static void ICEConnectionWorker(void * data); + +} class ICEConnectionObserver { diff --git a/vcl/unx/generic/dtrans/X11_selection.cxx b/vcl/unx/generic/dtrans/X11_selection.cxx index 38a2822e049a..fd5ed013982a 100644 --- a/vcl/unx/generic/dtrans/X11_selection.cxx +++ b/vcl/unx/generic/dtrans/X11_selection.cxx @@ -3826,7 +3826,7 @@ static bool bWasError = false; extern "C" { - int local_xerror_handler(Display* , XErrorEvent*) + static int local_xerror_handler(Display* , XErrorEvent*) { bWasError = true; return 0; diff --git a/vcl/unx/generic/dtrans/bmp.cxx b/vcl/unx/generic/dtrans/bmp.cxx index 8b7f342bfbb6..e6748166e132 100644 --- a/vcl/unx/generic/dtrans/bmp.cxx +++ b/vcl/unx/generic/dtrans/bmp.cxx @@ -41,13 +41,13 @@ using namespace x11; * helper functions */ -inline void writeLE( sal_uInt16 nNumber, sal_uInt8* pBuffer ) +static inline void writeLE( sal_uInt16 nNumber, sal_uInt8* pBuffer ) { pBuffer[ 0 ] = (nNumber & 0xff); pBuffer[ 1 ] = ((nNumber>>8)&0xff); } -inline void writeLE( sal_uInt32 nNumber, sal_uInt8* pBuffer ) +static inline void writeLE( sal_uInt32 nNumber, sal_uInt8* pBuffer ) { pBuffer[ 0 ] = (nNumber & 0xff); pBuffer[ 1 ] = ((nNumber>>8)&0xff); @@ -55,7 +55,7 @@ inline void writeLE( sal_uInt32 nNumber, sal_uInt8* pBuffer ) pBuffer[ 3 ] = ((nNumber>>24)&0xff); } -inline sal_uInt16 readLE16( const sal_uInt8* pBuffer ) +static inline sal_uInt16 readLE16( const sal_uInt8* pBuffer ) { //This is untainted data which comes from a controlled source //so, using a byte-swapping pattern which coverity doesn't @@ -66,7 +66,7 @@ inline sal_uInt16 readLE16( const sal_uInt8* pBuffer ) return v; } -inline sal_uInt32 readLE32( const sal_uInt8* pBuffer ) +static inline sal_uInt32 readLE32( const sal_uInt8* pBuffer ) { //This is untainted data which comes from a controlled source //so, using a byte-swapping pattern which coverity doesn't @@ -83,7 +83,7 @@ inline sal_uInt32 readLE32( const sal_uInt8* pBuffer ) * scanline helpers */ -inline void X11_writeScanlinePixel( unsigned long nColor, sal_uInt8* pScanline, int depth, int x ) +static inline void X11_writeScanlinePixel( unsigned long nColor, sal_uInt8* pScanline, int depth, int x ) { switch( depth ) { @@ -194,12 +194,12 @@ static sal_uInt8* X11_getPaletteBmpFromImage( return pBuffer; } -inline unsigned long doRightShift( unsigned long nValue, int nShift ) +static inline unsigned long doRightShift( unsigned long nValue, int nShift ) { return (nShift > 0) ? (nValue >> nShift) : (nValue << (-nShift)); } -inline unsigned long doLeftShift( unsigned long nValue, int nShift ) +static inline unsigned long doLeftShift( unsigned long nValue, int nShift ) { return (nShift > 0) ? (nValue << nShift) : (nValue >> (-nShift)); } diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx b/vcl/unx/generic/fontmanager/fontmanager.cxx index b2e3862cefdb..8b6ad13471a0 100644 --- a/vcl/unx/generic/fontmanager/fontmanager.cxx +++ b/vcl/unx/generic/fontmanager/fontmanager.cxx @@ -81,7 +81,7 @@ using namespace com::sun::star::lang; * static helpers */ -inline sal_uInt16 getUInt16BE( const sal_uInt8*& pBuffer ) +static inline sal_uInt16 getUInt16BE( const sal_uInt8*& pBuffer ) { sal_uInt16 nRet = static_cast<sal_uInt16>(pBuffer[1]) | (static_cast<sal_uInt16>(pBuffer[0]) << 8); diff --git a/vcl/unx/generic/print/genprnpsp.cxx b/vcl/unx/generic/print/genprnpsp.cxx index 8ccbfafb75a0..b7aabb648a6e 100644 --- a/vcl/unx/generic/print/genprnpsp.cxx +++ b/vcl/unx/generic/print/genprnpsp.cxx @@ -138,9 +138,9 @@ namespace } } -inline int PtTo10Mu( int nPoints ) { return static_cast<int>((static_cast<double>(nPoints)*35.27777778)+0.5); } +static inline int PtTo10Mu( int nPoints ) { return static_cast<int>((static_cast<double>(nPoints)*35.27777778)+0.5); } -inline int TenMuToPt( int nUnits ) { return static_cast<int>((static_cast<double>(nUnits)/35.27777778)+0.5); } +static inline int TenMuToPt( int nUnits ) { return static_cast<int>((static_cast<double>(nUnits)/35.27777778)+0.5); } static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData ) { diff --git a/vcl/unx/generic/print/printerjob.cxx b/vcl/unx/generic/print/printerjob.cxx index 8b5cb726fdf9..c1f1a0f718d4 100644 --- a/vcl/unx/generic/print/printerjob.cxx +++ b/vcl/unx/generic/print/printerjob.cxx @@ -51,7 +51,7 @@ using namespace psp; namespace psp { -bool +static bool AppendPS (FILE* pDst, osl::File* pSrc, unsigned char* pBuffer) { assert(pBuffer); @@ -183,7 +183,7 @@ PrinterJob::PrinterJob() /* remove all our temporary files, uses external program "rm", since osl functionality is inadequate */ -void +static void removeSpoolDir (const OUString& rSpoolDir) { OUString aSysPath; @@ -202,7 +202,7 @@ removeSpoolDir (const OUString& rSpoolDir) /* creates a spool directory with a "pidgin random" value based on current system time */ -OUString +static OUString createSpoolDir () { TimeValue aCur; diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx index 7446dbf360f2..1ecbcdd5e5d5 100644 --- a/vcl/unx/generic/window/salframe.cxx +++ b/vcl/unx/generic/window/salframe.cxx @@ -2873,7 +2873,7 @@ struct KeyAlternate KeyAlternate( sal_uInt16 nKey, sal_Unicode nChar = 0 ) : nKeyCode( nKey ), nCharCode( nChar ) {} }; -inline KeyAlternate +static inline KeyAlternate GetAlternateKeyCode( const sal_uInt16 nKeyCode ) { KeyAlternate aAlternate; diff --git a/vcl/unx/generic/window/screensaverinhibitor.cxx b/vcl/unx/generic/window/screensaverinhibitor.cxx index 2988bb214507..675b79269627 100644 --- a/vcl/unx/generic/window/screensaverinhibitor.cxx +++ b/vcl/unx/generic/window/screensaverinhibitor.cxx @@ -66,7 +66,7 @@ void ScreenSaverInhibitor::inhibit( bool bInhibit, const OUString& sReason, } #if ENABLE_GIO -void dbusInhibit( bool bInhibit, +static void dbusInhibit( bool bInhibit, const gchar* service, const gchar* path, const gchar* interface, const std::function<GVariant*( GDBusProxy*, GError*& )>& fInhibit, const std::function<GVariant*( GDBusProxy*, const guint, GError*& )>& fUnInhibit, diff --git a/vcl/unx/glxtest.cxx b/vcl/unx/glxtest.cxx index 70d34fb7318d..8b5265c88709 100644 --- a/vcl/unx/glxtest.cxx +++ b/vcl/unx/glxtest.cxx @@ -101,7 +101,7 @@ x_error_handler(Display *, XErrorEvent *ev) return 0; } -void glxtest() +static void glxtest() { signal(SIGPIPE, SIG_IGN); // we want to redirect to /dev/null stdout, stderr, and while we're at it, diff --git a/vcl/unx/gtk/a11y/atkcomponent.cxx b/vcl/unx/gtk/a11y/atkcomponent.cxx index 7d8a4bdc5bba..f79d1749dc2b 100644 --- a/vcl/unx/gtk/a11y/atkcomponent.cxx +++ b/vcl/unx/gtk/a11y/atkcomponent.cxx @@ -23,7 +23,7 @@ using namespace ::com::sun::star; -AtkObjectWrapper* getObjectWrapper(AtkComponent *pComponent) +static AtkObjectWrapper* getObjectWrapper(AtkComponent *pComponent) { AtkObjectWrapper *pWrap = nullptr; if (ATK_IS_OBJECT_WRAPPER(pComponent)) diff --git a/vcl/unx/gtk/a11y/atkfactory.cxx b/vcl/unx/gtk/a11y/atkfactory.cxx index 5c163cd38ece..c95830f752df 100644 --- a/vcl/unx/gtk/a11y/atkfactory.cxx +++ b/vcl/unx/gtk/a11y/atkfactory.cxx @@ -74,7 +74,7 @@ atk_noop_object_wrapper_get_type() return type; } -AtkObject* +static AtkObject* atk_noop_object_wrapper_new() { AtkObject *accessible; diff --git a/vcl/unx/gtk/a11y/atklistener.cxx b/vcl/unx/gtk/a11y/atklistener.cxx index 1c1cff15dd4b..bba1a3a09d53 100644 --- a/vcl/unx/gtk/a11y/atklistener.cxx +++ b/vcl/unx/gtk/a11y/atklistener.cxx @@ -64,7 +64,7 @@ AtkListener::~AtkListener() /*****************************************************************************/ -AtkStateType mapState( const uno::Any &rAny ) +static AtkStateType mapState( const uno::Any &rAny ) { sal_Int16 nState = accessibility::AccessibleStateType::INVALID; rAny >>= nState; diff --git a/vcl/unx/gtk/a11y/atktext.cxx b/vcl/unx/gtk/a11y/atktext.cxx index 5faac5ee526c..532b55013ddd 100644 --- a/vcl/unx/gtk/a11y/atktext.cxx +++ b/vcl/unx/gtk/a11y/atktext.cxx @@ -409,7 +409,7 @@ text_wrapper_set_caret_offset (AtkText *text, } // #i92232# -AtkAttributeSet* +static AtkAttributeSet* handle_text_markup_as_run_attribute( css::uno::Reference<css::accessibility::XAccessibleTextMarkup> const & pTextMarkup, const gint nTextMarkupType, const gint offset, diff --git a/vcl/unx/gtk/a11y/atktextattributes.cxx b/vcl/unx/gtk/a11y/atktextattributes.cxx index 018a755fd234..b40598a65fd1 100644 --- a/vcl/unx/gtk/a11y/atktextattributes.cxx +++ b/vcl/unx/gtk/a11y/atktextattributes.cxx @@ -1015,7 +1015,9 @@ DefaultTabStops2String( const uno::Any& rAny ) /*****************************************************************************/ -extern "C" int +extern "C" { + +static int attr_compare(const void *p1,const void *p2) { const rtl_uString * pustr = static_cast<const rtl_uString *>(p1); @@ -1024,6 +1026,8 @@ attr_compare(const void *p1,const void *p2) return rtl_ustr_ascii_compare_WithLength(pustr->buffer, pustr->length, pc); } +} + static void find_exported_attributes( sal_Int32 *pArray, const css::uno::Sequence< css::beans::PropertyValue >& rAttributeList ) diff --git a/vcl/unx/gtk/a11y/atkutil.cxx b/vcl/unx/gtk/a11y/atkutil.cxx index b5748c12d1a9..d714b08f2dde 100644 --- a/vcl/unx/gtk/a11y/atkutil.cxx +++ b/vcl/unx/gtk/a11y/atkutil.cxx @@ -620,7 +620,7 @@ static void handle_menu_highlighted(::VclMenuEvent const * pEvent) /*****************************************************************************/ -void WindowEventHandler(void *, VclSimpleEvent& rEvent) +static void WindowEventHandler(void *, VclSimpleEvent& rEvent) { try { diff --git a/vcl/unx/gtk/gloactiongroup.cxx b/vcl/unx/gtk/gloactiongroup.cxx index 0ba1112f928f..b058417b821f 100644 --- a/vcl/unx/gtk/gloactiongroup.cxx +++ b/vcl/unx/gtk/gloactiongroup.cxx @@ -49,7 +49,7 @@ G_DEFINE_TYPE (GLOAction, g_lo_action, G_TYPE_OBJECT); #pragma GCC diagnostic pop #endif -GLOAction* +static GLOAction* g_lo_action_new() { return G_LO_ACTION (g_object_new (G_TYPE_LO_ACTION, nullptr)); diff --git a/vcl/unx/gtk/glomenu.cxx b/vcl/unx/gtk/glomenu.cxx index 4ba8f3f8587c..5457ac6eaa05 100644 --- a/vcl/unx/gtk/glomenu.cxx +++ b/vcl/unx/gtk/glomenu.cxx @@ -169,7 +169,7 @@ g_lo_menu_new() return G_LO_MENU( g_object_new (G_TYPE_LO_MENU, nullptr) ); } -void +static void g_lo_menu_set_attribute_value (GLOMenu *menu, gint position, const gchar *attribute, @@ -190,7 +190,7 @@ g_lo_menu_set_attribute_value (GLOMenu *menu, g_hash_table_remove (menu_item.attributes, attribute); } -GVariant* +static GVariant* g_lo_menu_get_attribute_value_from_item_in_section (GLOMenu *menu, gint section, gint position, @@ -468,7 +468,7 @@ g_lo_menu_get_command_from_item_in_section (GLOMenu *menu, return command; } -void +static void g_lo_menu_set_link (GLOMenu *menu, gint position, const gchar *link, diff --git a/vcl/unx/gtk/gtkdata.cxx b/vcl/unx/gtk/gtkdata.cxx index 7263685368ce..298442954c83 100644 --- a/vcl/unx/gtk/gtkdata.cxx +++ b/vcl/unx/gtk/gtkdata.cxx @@ -55,7 +55,7 @@ using namespace vcl_sal; * class GtkSalDisplay * ***************************************************************/ extern "C" { -GdkFilterReturn call_filterGdkEvent( GdkXEvent* sys_event, +static GdkFilterReturn call_filterGdkEvent( GdkXEvent* sys_event, GdkEvent* /*event*/, gpointer data ) { @@ -103,13 +103,13 @@ GtkSalDisplay::~GtkSalDisplay() extern "C" { -void signalScreenSizeChanged( GdkScreen* pScreen, gpointer data ) +static void signalScreenSizeChanged( GdkScreen* pScreen, gpointer data ) { GtkSalDisplay* pDisp = static_cast<GtkSalDisplay*>(data); pDisp->screenSizeChanged( pScreen ); } -void signalMonitorsChanged( GdkScreen* pScreen, gpointer data ) +static void signalMonitorsChanged( GdkScreen* pScreen, gpointer data ) { GtkSalDisplay* pDisp = static_cast<GtkSalDisplay*>(data); pDisp->monitorsChanged( pScreen ); diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx index c3f9b25d677b..8b96ea38e577 100644 --- a/vcl/unx/gtk/gtksalframe.cxx +++ b/vcl/unx/gtk/gtksalframe.cxx @@ -348,7 +348,7 @@ struct KeyAlternate KeyAlternate( sal_uInt16 nKey, sal_Unicode nChar = 0 ) : nKeyCode( nKey ), nCharCode( nChar ) {} }; -inline KeyAlternate +static inline KeyAlternate GetAlternateKeyCode( const sal_uInt16 nKeyCode ) { KeyAlternate aAlternate; @@ -585,7 +585,7 @@ static const GActionEntry app_entries[] = { { "New", activate_uno, nullptr, nullptr, nullptr, {0} } }; -gboolean ensure_dbus_setup( gpointer data ) +static gboolean ensure_dbus_setup( gpointer data ) { GtkSalFrame* pSalFrame = static_cast< GtkSalFrame* >( data ); GdkWindow* gdkWindow = widget_get_window( pSalFrame->getWindow() ); @@ -3645,7 +3645,7 @@ void GtkSalFrame::IMHandler::signalIMPreeditEnd( GtkIMContext*, gpointer im_hand pThis->updateIMSpotLocation(); } -uno::Reference<accessibility::XAccessibleEditableText> +static uno::Reference<accessibility::XAccessibleEditableText> FindFocus(const uno::Reference< accessibility::XAccessibleContext >& xContext) { if (!xContext.is()) diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx index 84add236d0be..aa2f0eeab396 100644 --- a/vcl/unx/gtk/gtksalmenu.cxx +++ b/vcl/unx/gtk/gtksalmenu.cxx @@ -58,7 +58,7 @@ bool GtkSalMenu::PrepUpdate() * Menu updating methods */ -void RemoveSpareItemsFromNativeMenu( GLOMenu* pMenu, GList** pOldCommandList, unsigned nSection, unsigned nValidItems ) +static void RemoveSpareItemsFromNativeMenu( GLOMenu* pMenu, GList** pOldCommandList, unsigned nSection, unsigned nValidItems ) { sal_Int32 nSectionItems = g_lo_menu_get_n_items_from_section( pMenu, nSection ); @@ -97,7 +97,7 @@ namespace } } -void RemoveDisabledItemsFromNativeMenu(GLOMenu* pMenu, GList** pOldCommandList, +static void RemoveDisabledItemsFromNativeMenu(GLOMenu* pMenu, GList** pOldCommandList, sal_Int32 nSection, GActionGroup* pActionGroup) { while (nSection >= 0) @@ -156,7 +156,7 @@ void RemoveDisabledItemsFromNativeMenu(GLOMenu* pMenu, GList** pOldCommandList, } } -void RemoveSpareSectionsFromNativeMenu( GLOMenu* pMenu, GList** pOldCommandList, sal_Int32 nLastSection ) +static void RemoveSpareSectionsFromNativeMenu( GLOMenu* pMenu, GList** pOldCommandList, sal_Int32 nLastSection ) { if ( pMenu == nullptr || pOldCommandList == nullptr ) return; @@ -170,12 +170,12 @@ void RemoveSpareSectionsFromNativeMenu( GLOMenu* pMenu, GList** pOldCommandList, } } -gint CompareStr( gpointer str1, gpointer str2 ) +static gint CompareStr( gpointer str1, gpointer str2 ) { return g_strcmp0( static_cast<const gchar*>(str1), static_cast<const gchar*>(str2) ); } -void RemoveUnusedCommands( GLOActionGroup* pActionGroup, GList* pOldCommandList, GList* pNewCommandList ) +static void RemoveUnusedCommands( GLOActionGroup* pActionGroup, GList* pOldCommandList, GList* pNewCommandList ) { if ( pActionGroup == nullptr || pOldCommandList == nullptr ) { diff --git a/vcl/unx/gtk/salnativewidgets-gtk.cxx b/vcl/unx/gtk/salnativewidgets-gtk.cxx index f932cd4ba47c..ac188941d819 100644 --- a/vcl/unx/gtk/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/salnativewidgets-gtk.cxx @@ -450,7 +450,7 @@ void NWPixmapCacheList::ThemeChanged( ) /********************************************************* * Make border manipulation easier *********************************************************/ -inline void NW_gtk_border_set_from_border( GtkBorder& aDst, const GtkBorder * pSrc ) +static inline void NW_gtk_border_set_from_border( GtkBorder& aDst, const GtkBorder * pSrc ) { aDst.left = pSrc->left; aDst.top = pSrc->top; diff --git a/vcl/unx/gtk3/gtk3gtkdata.cxx b/vcl/unx/gtk3/gtk3gtkdata.cxx index 48047240e643..db810d745cd4 100644 --- a/vcl/unx/gtk3/gtk3gtkdata.cxx +++ b/vcl/unx/gtk3/gtk3gtkdata.cxx @@ -61,7 +61,7 @@ using namespace vcl_sal; * class GtkSalDisplay * ***************************************************************/ extern "C" { -GdkFilterReturn call_filterGdkEvent( GdkXEvent* sys_event, +static GdkFilterReturn call_filterGdkEvent( GdkXEvent* sys_event, GdkEvent* /*event*/, gpointer data ) { @@ -103,13 +103,13 @@ GtkSalDisplay::~GtkSalDisplay() extern "C" { -void signalScreenSizeChanged( GdkScreen* pScreen, gpointer data ) +static void signalScreenSizeChanged( GdkScreen* pScreen, gpointer data ) { GtkSalDisplay* pDisp = static_cast<GtkSalDisplay*>(data); pDisp->screenSizeChanged( pScreen ); } -void signalMonitorsChanged( GdkScreen* pScreen, gpointer data ) +static void signalMonitorsChanged( GdkScreen* pScreen, gpointer data ) { GtkSalDisplay* pDisp = static_cast<GtkSalDisplay*>(data); pDisp->monitorsChanged( pScreen ); diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx index 1f36f039a58c..1953c055a39a 100644 --- a/vcl/unx/gtk3/gtk3gtkframe.cxx +++ b/vcl/unx/gtk3/gtk3gtkframe.cxx @@ -351,7 +351,7 @@ struct KeyAlternate KeyAlternate( sal_uInt16 nKey, sal_Unicode nChar = 0 ) : nKeyCode( nKey ), nCharCode( nChar ) {} }; -inline KeyAlternate +static inline KeyAlternate GetAlternateKeyCode( const sal_uInt16 nKeyCode ) { KeyAlternate aAlternate; @@ -599,7 +599,7 @@ static const GActionEntry app_entries[] = { { "New", activate_uno, nullptr, nullptr, nullptr, {0} } }; -gboolean ensure_dbus_setup( gpointer data ) +static gboolean ensure_dbus_setup( gpointer data ) { GtkSalFrame* pSalFrame = static_cast< GtkSalFrame* >( data ); GdkWindow* gdkWindow = widget_get_window( pSalFrame->getWindow() ); @@ -4176,7 +4176,7 @@ void GtkSalFrame::IMHandler::signalIMPreeditEnd( GtkIMContext*, gpointer im_hand pThis->updateIMSpotLocation(); } -uno::Reference<accessibility::XAccessibleEditableText> +static uno::Reference<accessibility::XAccessibleEditableText> FindFocus(uno::Reference< accessibility::XAccessibleContext > const & xContext) { if (!xContext.is()) diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 1d5ca9e415ef..d99fa04f09fb 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -2235,7 +2235,7 @@ public: } }; -GType crippled_viewport_get_type(); +static GType crippled_viewport_get_type(); #define CRIPPLED_TYPE_VIEWPORT (crippled_viewport_get_type ()) #define CRIPPLED_VIEWPORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CRIPPLED_TYPE_VIEWPORT, CrippledViewport)) @@ -2380,7 +2380,7 @@ GType crippled_viewport_get_type() return type; } -VclPolicyType GtkToVcl(GtkPolicyType eType) +static VclPolicyType GtkToVcl(GtkPolicyType eType) { VclPolicyType eRet(VclPolicyType::NEVER); switch (eType) @@ -2399,7 +2399,7 @@ VclPolicyType GtkToVcl(GtkPolicyType eType) return eRet; } -GtkPolicyType VclToGtk(VclPolicyType eType) +static GtkPolicyType VclToGtk(VclPolicyType eType) { GtkPolicyType eRet(GTK_POLICY_ALWAYS); switch (eType) @@ -2417,7 +2417,7 @@ GtkPolicyType VclToGtk(VclPolicyType eType) return eRet; } -GtkMessageType VclToGtk(VclMessageType eType) +static GtkMessageType VclToGtk(VclMessageType eType) { GtkMessageType eRet(GTK_MESSAGE_INFO); switch (eType) @@ -2438,7 +2438,7 @@ GtkMessageType VclToGtk(VclMessageType eType) return eRet; } -GtkButtonsType VclToGtk(VclButtonsType eType) +static GtkButtonsType VclToGtk(VclButtonsType eType) { GtkButtonsType eRet(GTK_BUTTONS_NONE); switch (eType) diff --git a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx index 9037cff8c11b..17433d0a8f8e 100644 --- a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx @@ -2577,7 +2577,7 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co return true; } -tools::Rectangle GetWidgetSize(const tools::Rectangle& rControlRegion, GtkWidget* widget) +static tools::Rectangle GetWidgetSize(const tools::Rectangle& rControlRegion, GtkWidget* widget) { GtkRequisition aReq; gtk_widget_get_preferred_size(widget, nullptr, &aReq); @@ -2585,7 +2585,7 @@ tools::Rectangle GetWidgetSize(const tools::Rectangle& rControlRegion, GtkWidget return tools::Rectangle(rControlRegion.TopLeft(), Size(rControlRegion.GetWidth(), nHeight)); } -tools::Rectangle AdjustRectForTextBordersPadding(GtkStyleContext* pStyle, long nContentWidth, long nContentHeight, const tools::Rectangle& rControlRegion) +static tools::Rectangle AdjustRectForTextBordersPadding(GtkStyleContext* pStyle, long nContentWidth, long nContentHeight, const tools::Rectangle& rControlRegion) { GtkBorder border; gtk_style_context_get_border(pStyle, gtk_style_context_get_state(pStyle), &border); diff --git a/vcl/unx/gtk3_kde5/kde5_filepicker_ipc.cxx b/vcl/unx/gtk3_kde5/kde5_filepicker_ipc.cxx index aeb864eae2ef..15ff95f02074 100644 --- a/vcl/unx/gtk3_kde5/kde5_filepicker_ipc.cxx +++ b/vcl/unx/gtk3_kde5/kde5_filepicker_ipc.cxx @@ -44,7 +44,7 @@ void sendIpcArg(std::ostream& stream, const QString& string) sendIpcStringArg(stream, utf8.size(), utf8.data()); } -void sendIpcArg(std::ostream& stream, const QStringList& list) +static void sendIpcArg(std::ostream& stream, const QStringList& list) { stream << static_cast<uint32_t>(list.size()) << ' '; for (const auto& entry : list) diff --git a/vcl/unx/kde4/KDE4FilePicker.cxx b/vcl/unx/kde4/KDE4FilePicker.cxx index c6ce35128e09..5454344b949d 100644 --- a/vcl/unx/kde4/KDE4FilePicker.cxx +++ b/vcl/unx/kde4/KDE4FilePicker.cxx @@ -98,13 +98,13 @@ namespace } } -OUString toOUString(const QString& s) +static OUString toOUString(const QString& s) { // QString stores UTF16, just like OUString return OUString(reinterpret_cast<const sal_Unicode*>(s.data()), s.length()); } -QString toQString(const OUString& s) +static QString toQString(const OUString& s) { return QString::fromUtf16( reinterpret_cast<ushort const *>(s.getStr()), s.getLength()); diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx index 01da2c5fad8f..7cbcfeab3ed6 100644 --- a/vcl/unx/kde4/KDESalGraphics.cxx +++ b/vcl/unx/kde4/KDESalGraphics.cxx @@ -41,7 +41,7 @@ @param nControlState State of the widget (default, focused, ...) in Native Widget Framework. @param aValue Value held by the widget (on, off, ...) */ -QStyle::State vclStateValue2StateFlag( ControlState nControlState, +static QStyle::State vclStateValue2StateFlag( ControlState nControlState, const ImplControlValue& aValue ) { QStyle::State nState = @@ -67,7 +67,7 @@ QStyle::State vclStateValue2StateFlag( ControlState nControlState, @param rControlRegion The tools::Rectangle to convert. @return The matching QRect */ -QRect region2QRect( const tools::Rectangle& rControlRegion ) +static QRect region2QRect( const tools::Rectangle& rControlRegion ) { return QRect(rControlRegion.Left(), rControlRegion.Top(), rControlRegion.GetWidth(), rControlRegion.GetHeight()); } diff --git a/vcl/workben/svdem.cxx b/vcl/workben/svdem.cxx index a2750f532e9e..579141839cc4 100644 --- a/vcl/workben/svdem.cxx +++ b/vcl/workben/svdem.cxx @@ -37,7 +37,7 @@ using namespace ::com::sun::star::lang; using namespace cppu; // Forward declaration -void Main(); +static void Main(); SAL_IMPLEMENT_MAIN() { diff --git a/vcl/workben/svpclient.cxx b/vcl/workben/svpclient.cxx index b096a205572d..eb2fa77e3240 100644 --- a/vcl/workben/svpclient.cxx +++ b/vcl/workben/svpclient.cxx @@ -56,7 +56,7 @@ using namespace ::com::sun::star::lang; using namespace cppu; // Forward declaration -void Main(); +static void Main(); SAL_IMPLEMENT_MAIN() { diff --git a/vcl/workben/svptest.cxx b/vcl/workben/svptest.cxx index 09a99b4f003a..e2425807a8e9 100644 --- a/vcl/workben/svptest.cxx +++ b/vcl/workben/svptest.cxx @@ -47,7 +47,7 @@ using namespace ::com::sun::star::lang; using namespace cppu; // Forward declaration -void Main(); +static void Main(); SAL_IMPLEMENT_MAIN() { diff --git a/writerfilter/source/dmapper/CellColorHandler.cxx b/writerfilter/source/dmapper/CellColorHandler.cxx index a19a984d6e7e..f3e63a4faef2 100644 --- a/writerfilter/source/dmapper/CellColorHandler.cxx +++ b/writerfilter/source/dmapper/CellColorHandler.cxx @@ -50,7 +50,7 @@ CellColorHandler::~CellColorHandler() // ST_Shd strings are converted to integers by the tokenizer, store strings in // the InteropGrabBag -uno::Any lcl_ConvertShd(sal_Int32 nIntValue) +static uno::Any lcl_ConvertShd(sal_Int32 nIntValue) { OUString aRet; // This should be in sync with the ST_Shd list in ooxml's model.xml. diff --git a/writerfilter/source/dmapper/ConversionHelper.cxx b/writerfilter/source/dmapper/ConversionHelper.cxx index f4eddffc2625..7206a7fde18a 100644 --- a/writerfilter/source/dmapper/ConversionHelper.cxx +++ b/writerfilter/source/dmapper/ConversionHelper.cxx @@ -37,7 +37,7 @@ namespace dmapper{ namespace ConversionHelper{ /// Convert OOXML border style to WW8 that editeng can handle. -sal_Int32 lcl_convertBorderStyleFromToken(sal_Int32 nOOXMLType) +static sal_Int32 lcl_convertBorderStyleFromToken(sal_Int32 nOOXMLType) { switch (nOOXMLType) { diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index bf9421c3aaad..cf973bbaef9a 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -78,7 +78,7 @@ void DomainMapperTableHandler::startTable(const TablePropertyMapPtr& pProps) #endif } -void lcl_mergeBorder( PropertyIds nId, const PropertyMapPtr& pOrig, const PropertyMapPtr& pDest ) +static void lcl_mergeBorder( PropertyIds nId, const PropertyMapPtr& pOrig, const PropertyMapPtr& pDest ) { boost::optional<PropertyMap::Property> pOrigVal = pOrig->getProperty(nId); @@ -88,7 +88,7 @@ void lcl_mergeBorder( PropertyIds nId, const PropertyMapPtr& pOrig, const Proper } } -void lcl_computeCellBorders( const PropertyMapPtr& pTableBorders, const PropertyMapPtr& pCellProps, +static void lcl_computeCellBorders( const PropertyMapPtr& pTableBorders, const PropertyMapPtr& pCellProps, sal_Int32 nCell, sal_Int32 nRow, bool bIsEndCol, bool bIsEndRow ) { boost::optional<PropertyMap::Property> pVerticalVal = pCellProps->getProperty(META_PROP_VERTICAL_BORDER); @@ -170,7 +170,7 @@ void lcl_computeCellBorders( const PropertyMapPtr& pTableBorders, const Property #ifdef DEBUG_WRITERFILTER -void lcl_debug_BorderLine(table::BorderLine const & rLine) +static void lcl_debug_BorderLine(table::BorderLine const & rLine) { TagLogger::getInstance().startElement("BorderLine"); TagLogger::getInstance().attribute("Color", rLine.Color); @@ -180,7 +180,7 @@ void lcl_debug_BorderLine(table::BorderLine const & rLine) TagLogger::getInstance().endElement(); } -void lcl_debug_TableBorder(table::TableBorder const & rBorder) +static void lcl_debug_TableBorder(table::TableBorder const & rBorder) { TagLogger::getInstance().startElement("TableBorder"); lcl_debug_BorderLine(rBorder.TopLine); @@ -268,7 +268,7 @@ void lcl_extractHoriOrient(std::vector<beans::PropertyValue>& rFrameProperties, } -void lcl_DecrementHoriOrientPosition(std::vector<beans::PropertyValue>& rFrameProperties, sal_Int32 nAmount) +static void lcl_DecrementHoriOrientPosition(std::vector<beans::PropertyValue>& rFrameProperties, sal_Int32 nAmount) { // Shifts the frame left by the given value. for (beans::PropertyValue & rPropertyValue : rFrameProperties) @@ -837,7 +837,7 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl } /// Do all cells in this row have a CellHideMark property? -bool lcl_hideMarks(PropertyMapVector1& rCellProperties) +static bool lcl_hideMarks(PropertyMapVector1& rCellProperties) { for (PropertyMapPtr & p : rCellProperties) { @@ -850,7 +850,7 @@ bool lcl_hideMarks(PropertyMapVector1& rCellProperties) } /// Are all cells in this row empty? -bool lcl_emptyRow(std::vector<RowSequence_t>& rTableRanges, sal_Int32 nRow) +static bool lcl_emptyRow(std::vector<RowSequence_t>& rTableRanges, sal_Int32 nRow) { if (nRow >= static_cast<sal_Int32>(rTableRanges.size())) { diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx index 83e487c415e4..1edc514fb342 100644 --- a/writerfilter/source/dmapper/NumberingManager.cxx +++ b/writerfilter/source/dmapper/NumberingManager.cxx @@ -49,12 +49,12 @@ namespace dmapper { //--------------------------------------------------- Utility functions template <typename T> -beans::PropertyValue lcl_makePropVal(PropertyIds nNameID, T const & aValue) +static beans::PropertyValue lcl_makePropVal(PropertyIds nNameID, T const & aValue) { return {getPropertyName(nNameID), 0, uno::makeAny(aValue), beans::PropertyState_DIRECT_VALUE}; } -sal_Int32 lcl_findProperty( const uno::Sequence< beans::PropertyValue >& aProps, const OUString& sName ) +static sal_Int32 lcl_findProperty( const uno::Sequence< beans::PropertyValue >& aProps, const OUString& sName ) { sal_Int32 i = 0; sal_Int32 nLen = aProps.getLength( ); @@ -71,7 +71,7 @@ sal_Int32 lcl_findProperty( const uno::Sequence< beans::PropertyValue >& aProps, return nPos; } -void lcl_mergeProperties( uno::Sequence< beans::PropertyValue >& aSrc, +static void lcl_mergeProperties( uno::Sequence< beans::PropertyValue >& aSrc, uno::Sequence< beans::PropertyValue >& aDst ) { for ( sal_Int32 i = 0, nSrcLen = aSrc.getLength( ); i < nSrcLen; i++ ) @@ -484,7 +484,7 @@ uno::Sequence<uno::Sequence<beans::PropertyValue>> ListDef::GetMergedPropertyVal return aAbstract; } -uno::Reference< container::XNameContainer > lcl_getUnoNumberingStyles( +static uno::Reference< container::XNameContainer > lcl_getUnoNumberingStyles( uno::Reference<lang::XMultiServiceFactory> const& xFactory) { uno::Reference< container::XNameContainer > xStyles; diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx index e788d2c95a45..691f1a00a474 100644 --- a/writerfilter/source/dmapper/PropertyMap.cxx +++ b/writerfilter/source/dmapper/PropertyMap.cxx @@ -447,7 +447,7 @@ SectionPropertyMap::SectionPropertyMap( bool bIsFirstSection ) } } -OUString lcl_FindUnusedPageStyleName( const uno::Sequence< OUString >& rPageStyleNames ) +static OUString lcl_FindUnusedPageStyleName( const uno::Sequence< OUString >& rPageStyleNames ) { static const char DEFAULT_STYLE[] = "Converted"; sal_Int32 nMaxIndex = 0; @@ -1015,7 +1015,7 @@ void SectionPropertyMap::PrepareHeaderFooterProperties( bool bFirstPage ) } } -uno::Reference< beans::XPropertySet > lcl_GetRangeProperties( bool bIsFirstSection, +static uno::Reference< beans::XPropertySet > lcl_GetRangeProperties( bool bIsFirstSection, DomainMapper_Impl& rDM_Impl, const uno::Reference< text::XTextRange >& xStartingRange ) { diff --git a/writerfilter/source/dmapper/SdtHelper.cxx b/writerfilter/source/dmapper/SdtHelper.cxx index 12c11c38798a..8c24155fbac6 100644 --- a/writerfilter/source/dmapper/SdtHelper.cxx +++ b/writerfilter/source/dmapper/SdtHelper.cxx @@ -30,7 +30,7 @@ namespace dmapper using namespace ::com::sun::star; /// w:sdt's w:dropDownList doesn't have width, so guess the size based on the longest string. -awt::Size lcl_getOptimalWidth(const StyleSheetTablePtr& pStyleSheet, OUString const& rDefault, std::vector<OUString>& rItems) +static awt::Size lcl_getOptimalWidth(const StyleSheetTablePtr& pStyleSheet, OUString const& rDefault, std::vector<OUString>& rItems) { OUString aLongest = rDefault; sal_Int32 nHeight = 0; diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx index 34066eeca780..47b54abfd040 100644 --- a/writerfilter/source/dmapper/StyleSheetTable.cxx +++ b/writerfilter/source/dmapper/StyleSheetTable.cxx @@ -179,7 +179,7 @@ PropertyMapPtr StyleSheetEntry::GetMergedInheritedProperties(const StyleSheetTab return pRet; } -void lcl_mergeProps( const PropertyMapPtr& pToFill, const PropertyMapPtr& pToAdd, TblStyleType nStyleId ) +static void lcl_mergeProps( const PropertyMapPtr& pToFill, const PropertyMapPtr& pToAdd, TblStyleType nStyleId ) { static const PropertyIds pPropsToCheck[] = { diff --git a/writerfilter/source/rtftok/rtfdispatchvalue.cxx b/writerfilter/source/rtftok/rtfdispatchvalue.cxx index cf0b4f1f6b1c..b98508f297b2 100644 --- a/writerfilter/source/rtftok/rtfdispatchvalue.cxx +++ b/writerfilter/source/rtftok/rtfdispatchvalue.cxx @@ -45,7 +45,7 @@ OUString getLODefaultLanguage() namespace writerfilter { -int getNumberFormat(int nParam) +static int getNumberFormat(int nParam) { static const int aMap[] = { NS_ooxml::LN_Value_ST_NumberFormat_decimal, diff --git a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx index cda4256a5ca6..ca12e62eb648 100644 --- a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx +++ b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx @@ -41,7 +41,7 @@ using uno::XInterface; namespace MSWorksCalcImportFilterInternal { /// returns the list of stream name present in a folder -uno::Reference<sdbc::XResultSet> +static uno::Reference<sdbc::XResultSet> getResultSet(const css::uno::Reference<css::ucb::XContent>& xPackageContent) try { if (xPackageContent.is()) diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index 88cedb7bfefd..2ab99629f3df 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -1316,7 +1316,7 @@ OUString ExtensionIteratorBase::implGetFileFromPackage( return aFile; } -inline bool isLetter( sal_Unicode c ) +static inline bool isLetter( sal_Unicode c ) { return rtl::isAsciiAlpha(c); } diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx index c8006bee590f..1035cdd9c3aa 100644 --- a/xmlhelp/source/treeview/tvread.cxx +++ b/xmlhelp/source/treeview/tvread.cxx @@ -320,7 +320,9 @@ TVRead::hasByHierarchicalName( const OUString& aName ) /* */ /**************************************************************************/ -extern "C" void start_handler(void *userData, +extern "C" { + +static void start_handler(void *userData, const XML_Char *name, const XML_Char **atts) { @@ -357,14 +359,14 @@ extern "C" void start_handler(void *userData, } } -extern "C" void end_handler(void *userData, +static void end_handler(void *userData, SAL_UNUSED_PARAMETER const XML_Char * ) { TVDom **tvDom = static_cast< TVDom** >( userData ); *tvDom = (*tvDom)->getParent(); } -extern "C" void data_handler( void *userData, +static void data_handler( void *userData, const XML_Char *s, int len) { @@ -373,6 +375,8 @@ extern "C" void data_handler( void *userData, (*tvDom)->setTitle( s,len ); } +} + TVChildTarget::TVChildTarget( const ConfigData& configData,TVDom* tvDom ) { Elements.resize( tvDom->children.size() ); @@ -1011,7 +1015,7 @@ Reference< deployment::XPackage > ExtensionIteratorBase::implGetNextBundledHelpP return xHelpPackage; } -inline bool isLetter( sal_Unicode c ) +static inline bool isLetter( sal_Unicode c ) { return rtl::isAsciiAlpha(c); } diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx index 3864308f40dc..b7f0a2ff8087 100644 --- a/xmloff/source/chart/SchXMLChartContext.cxx +++ b/xmloff/source/chart/SchXMLChartContext.cxx @@ -241,14 +241,14 @@ SchXMLChartContext::SchXMLChartContext( SchXMLImportHelper& rImpHelper, SchXMLChartContext::~SchXMLChartContext() {} -bool lcl_hasServiceName(Reference<lang::XMultiServiceFactory> const & xFactory, OUString const & rServiceName) +static bool lcl_hasServiceName(Reference<lang::XMultiServiceFactory> const & xFactory, OUString const & rServiceName) { const uno::Sequence<OUString> aServiceNames(xFactory->getAvailableServiceNames()); return std::find(aServiceNames.begin(), aServiceNames.end(), rServiceName) != aServiceNames.end(); } -void lcl_setDataProvider(uno::Reference<chart2::XChartDocument> const & xChartDoc, OUString const & sDataPilotSource) +static void lcl_setDataProvider(uno::Reference<chart2::XChartDocument> const & xChartDoc, OUString const & sDataPilotSource) { if (!xChartDoc.is()) return; diff --git a/xmloff/source/chart/SchXMLTools.cxx b/xmloff/source/chart/SchXMLTools.cxx index 7b1348ec846e..eb0934cc8a90 100644 --- a/xmloff/source/chart/SchXMLTools.cxx +++ b/xmloff/source/chart/SchXMLTools.cxx @@ -155,7 +155,7 @@ SchXMLChartTypeEnum GetChartTypeEnum( const OUString& rClassName ) typedef std::map< OUString, OUString > tMakeStringStringMap; //static -const tMakeStringStringMap& lcl_getChartTypeNameMap() +static const tMakeStringStringMap& lcl_getChartTypeNameMap() { //shape property -- chart model object property static const tMakeStringStringMap g_aChartTypeNameMap{ diff --git a/xmloff/source/core/DocumentSettingsContext.cxx b/xmloff/source/core/DocumentSettingsContext.cxx index 19f755fb6f29..c804aeb179f5 100644 --- a/xmloff/source/core/DocumentSettingsContext.cxx +++ b/xmloff/source/core/DocumentSettingsContext.cxx @@ -206,7 +206,7 @@ public: virtual void EndElement() override; }; -SvXMLImportContext *CreateSettingsContext(SvXMLImport& rImport, sal_uInt16 p_nPrefix, +static SvXMLImportContext *CreateSettingsContext(SvXMLImport& rImport, sal_uInt16 p_nPrefix, const OUString& rLocalName, const uno::Reference<xml::sax::XAttributeList>& xAttrList, beans::PropertyValue& rProp, XMLConfigBaseContext* pBaseContext) diff --git a/xmloff/source/core/DomExport.cxx b/xmloff/source/core/DomExport.cxx index e6d018242676..736835056b9d 100644 --- a/xmloff/source/core/DomExport.cxx +++ b/xmloff/source/core/DomExport.cxx @@ -60,11 +60,11 @@ public: virtual void endElement( const Reference<XElement>& ) {} }; -void visit( DomVisitor&, const Reference<XDocument>& ); -void visit( DomVisitor&, const Reference<XNode>& ); +static void visit( DomVisitor&, const Reference<XDocument>& ); +static void visit( DomVisitor&, const Reference<XNode>& ); -void visitNode( DomVisitor& rVisitor, const Reference<XNode>& xNode ) +static void visitNode( DomVisitor& rVisitor, const Reference<XNode>& xNode ) { switch( xNode->getNodeType() ) { diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 9936f974183d..22c421e19a70 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -3739,7 +3739,7 @@ void XMLShapeExport::export3DLamps( const css::uno::Reference< css::beans::XProp // using namespace ::xmloff::EnhancedCustomShapeToken; -void ExportParameter( OUStringBuffer& rStrBuffer, const css::drawing::EnhancedCustomShapeParameter& rParameter ) +static void ExportParameter( OUStringBuffer& rStrBuffer, const css::drawing::EnhancedCustomShapeParameter& rParameter ) { if ( !rStrBuffer.isEmpty() ) rStrBuffer.append( ' ' ); @@ -3799,7 +3799,7 @@ void ExportParameter( OUStringBuffer& rStrBuffer, const css::drawing::EnhancedCu } } -void ImpExportEquations( SvXMLExport& rExport, const uno::Sequence< OUString >& rEquations ) +static void ImpExportEquations( SvXMLExport& rExport, const uno::Sequence< OUString >& rEquations ) { sal_Int32 i; for ( i = 0; i < rEquations.getLength(); i++ ) @@ -3825,7 +3825,7 @@ void ImpExportEquations( SvXMLExport& rExport, const uno::Sequence< OUString >& } } -void ImpExportHandles( SvXMLExport& rExport, const uno::Sequence< beans::PropertyValues >& rHandles ) +static void ImpExportHandles( SvXMLExport& rExport, const uno::Sequence< beans::PropertyValues >& rHandles ) { sal_uInt32 i, j, nElements = rHandles.getLength(); if ( nElements ) @@ -3969,7 +3969,7 @@ void ImpExportHandles( SvXMLExport& rExport, const uno::Sequence< beans::Propert } } -void ImpExportEnhancedPath( SvXMLExport& rExport, +static void ImpExportEnhancedPath( SvXMLExport& rExport, const uno::Sequence< css::drawing::EnhancedCustomShapeParameterPair >& rCoordinates, const uno::Sequence< css::drawing::EnhancedCustomShapeSegment >& rSegments, bool bExtended = false ) @@ -4129,7 +4129,7 @@ void ImpExportEnhancedPath( SvXMLExport& rExport, ImpExportEnhancedPath( rExport, rCoordinates, rSegments, true ); } -void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< beans::XPropertySet >& xPropSet ) +static void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< beans::XPropertySet >& xPropSet ) { bool bEquations = false; uno::Sequence< OUString > aEquations; diff --git a/xmloff/source/draw/xexptran.cxx b/xmloff/source/draw/xexptran.cxx index 9aece77e02a2..23eec3b5b8e4 100644 --- a/xmloff/source/draw/xexptran.cxx +++ b/xmloff/source/draw/xexptran.cxx @@ -39,28 +39,28 @@ using namespace ::com::sun::star; using o3tl::make_unique; // parsing help functions for simple chars -void Imp_SkipSpaces(const OUString& rStr, sal_Int32& rPos, const sal_Int32 nLen) +static void Imp_SkipSpaces(const OUString& rStr, sal_Int32& rPos, const sal_Int32 nLen) { while(rPos < nLen && ' ' == rStr[rPos]) rPos++; } -void Imp_SkipSpacesAndOpeningBraces(const OUString& rStr, sal_Int32& rPos, const sal_Int32 nLen) +static void Imp_SkipSpacesAndOpeningBraces(const OUString& rStr, sal_Int32& rPos, const sal_Int32 nLen) { while(rPos < nLen && (' ' == rStr[rPos] || '(' == rStr[rPos])) rPos++; } -void Imp_SkipSpacesAndCommas(const OUString& rStr, sal_Int32& rPos, const sal_Int32 nLen) +static void Imp_SkipSpacesAndCommas(const OUString& rStr, sal_Int32& rPos, const sal_Int32 nLen) { while(rPos < nLen && (' ' == rStr[rPos] || ',' == rStr[rPos])) rPos++; } -void Imp_SkipSpacesAndClosingBraces(const OUString& rStr, sal_Int32& rPos, const sal_Int32 nLen) +static void Imp_SkipSpacesAndClosingBraces(const OUString& rStr, sal_Int32& rPos, const sal_Int32 nLen) { while(rPos < nLen && (' ' == rStr[rPos] || ')' == rStr[rPos])) @@ -69,7 +69,7 @@ void Imp_SkipSpacesAndClosingBraces(const OUString& rStr, sal_Int32& rPos, const // parsing help functions for integer numbers -bool Imp_IsOnUnitChar(const OUString& rStr, const sal_Int32 nPos) +static bool Imp_IsOnUnitChar(const OUString& rStr, const sal_Int32 nPos) { sal_Unicode aChar(rStr[nPos]); @@ -78,7 +78,7 @@ bool Imp_IsOnUnitChar(const OUString& rStr, const sal_Int32 nPos) || '%' == aChar; } -double Imp_GetDoubleChar(const OUString& rStr, sal_Int32& rPos, const sal_Int32 nLen, +static double Imp_GetDoubleChar(const OUString& rStr, sal_Int32& rPos, const sal_Int32 nLen, const SvXMLUnitConverter& rConv, double fRetval, bool bLookForUnits = false) { sal_Unicode aChar(rStr[rPos]); @@ -141,14 +141,14 @@ double Imp_GetDoubleChar(const OUString& rStr, sal_Int32& rPos, const sal_Int32 return fRetval; } -void Imp_PutDoubleChar(OUString& rStr, double fValue) +static void Imp_PutDoubleChar(OUString& rStr, double fValue) { OUStringBuffer sStringBuffer; ::sax::Converter::convertDouble(sStringBuffer, fValue); rStr += sStringBuffer; } -void Imp_PutDoubleChar(OUStringBuffer& rStr, const SvXMLUnitConverter& rConv, double fValue, +static void Imp_PutDoubleChar(OUStringBuffer& rStr, const SvXMLUnitConverter& rConv, double fValue, bool bConvertUnits = false) { OUStringBuffer sStringBuffer; diff --git a/xmloff/source/draw/ximpcustomshape.cxx b/xmloff/source/draw/ximpcustomshape.cxx index f84c1e976dd5..c30647b5a469 100644 --- a/xmloff/source/draw/ximpcustomshape.cxx +++ b/xmloff/source/draw/ximpcustomshape.cxx @@ -75,7 +75,7 @@ const SvXMLEnumMapEntry<sal_uInt16> aXML_GluePointEnumMap[] = { XML_RECTANGLE, 3 }, { XML_TOKEN_INVALID, 0 } }; -void GetBool( std::vector< css::beans::PropertyValue >& rDest, +static void GetBool( std::vector< css::beans::PropertyValue >& rDest, const OUString& rValue, const EnhancedCustomShapeTokenEnum eDestProp ) { bool bAttrBool; @@ -88,7 +88,7 @@ void GetBool( std::vector< css::beans::PropertyValue >& rDest, } } -void GetInt32( std::vector< css::beans::PropertyValue >& rDest, +static void GetInt32( std::vector< css::beans::PropertyValue >& rDest, const OUString& rValue, const EnhancedCustomShapeTokenEnum eDestProp ) { sal_Int32 nAttrNumber; @@ -101,7 +101,7 @@ void GetInt32( std::vector< css::beans::PropertyValue >& rDest, } } -void GetDouble( std::vector< css::beans::PropertyValue >& rDest, +static void GetDouble( std::vector< css::beans::PropertyValue >& rDest, const OUString& rValue, const EnhancedCustomShapeTokenEnum eDestProp ) { double fAttrDouble; @@ -114,7 +114,7 @@ void GetDouble( std::vector< css::beans::PropertyValue >& rDest, } } -void GetString( std::vector< css::beans::PropertyValue >& rDest, +static void GetString( std::vector< css::beans::PropertyValue >& rDest, const OUString& rValue, const EnhancedCustomShapeTokenEnum eDestProp ) { beans::PropertyValue aProp; @@ -124,7 +124,7 @@ void GetString( std::vector< css::beans::PropertyValue >& rDest, } template<typename EnumT> -void GetEnum( std::vector< css::beans::PropertyValue >& rDest, +static void GetEnum( std::vector< css::beans::PropertyValue >& rDest, const OUString& rValue, const EnhancedCustomShapeTokenEnum eDestProp, const SvXMLEnumMapEntry<EnumT>& rMap ) { @@ -138,7 +138,7 @@ void GetEnum( std::vector< css::beans::PropertyValue >& rDest, } } -void GetDoublePercentage( std::vector< css::beans::PropertyValue >& rDest, +static void GetDoublePercentage( std::vector< css::beans::PropertyValue >& rDest, const OUString& rValue, const EnhancedCustomShapeTokenEnum eDestProp ) { sal_Int16 const eSrcUnit = ::sax::Converter::GetUnitFromString( @@ -158,7 +158,7 @@ void GetDoublePercentage( std::vector< css::beans::PropertyValue >& rDest, } } -void GetB3DVector( std::vector< css::beans::PropertyValue >& rDest, +static void GetB3DVector( std::vector< css::beans::PropertyValue >& rDest, const OUString& rValue, const EnhancedCustomShapeTokenEnum eDestProp ) { ::basegfx::B3DVector aB3DVector; @@ -172,7 +172,7 @@ void GetB3DVector( std::vector< css::beans::PropertyValue >& rDest, } } -bool GetEquationName( const OUString& rEquation, const sal_Int32 nStart, OUString& rEquationName ) +static bool GetEquationName( const OUString& rEquation, const sal_Int32 nStart, OUString& rEquationName ) { sal_Int32 nIndex = nStart; while( nIndex < rEquation.getLength() ) @@ -195,7 +195,7 @@ bool GetEquationName( const OUString& rEquation, const sal_Int32 nStart, OUStrin return bValid; } -bool GetNextParameter( css::drawing::EnhancedCustomShapeParameter& rParameter, sal_Int32& nIndex, const OUString& rParaString ) +static bool GetNextParameter( css::drawing::EnhancedCustomShapeParameter& rParameter, sal_Int32& nIndex, const OUString& rParaString ) { if ( nIndex >= rParaString.getLength() ) return false; @@ -427,7 +427,7 @@ bool GetNextParameter( css::drawing::EnhancedCustomShapeParameter& rParameter, s return bValid; } -void GetPosition3D( std::vector< css::beans::PropertyValue >& rDest, // e.g. draw:extrusion-viewpoint +static void GetPosition3D( std::vector< css::beans::PropertyValue >& rDest, // e.g. draw:extrusion-viewpoint const OUString& rValue, const EnhancedCustomShapeTokenEnum eDestProp, SvXMLUnitConverter& rUnitConverter ) { @@ -441,7 +441,7 @@ void GetPosition3D( std::vector< css::beans::PropertyValue >& rDest, } } -void GetDoubleSequence( std::vector< css::beans::PropertyValue >& rDest, // e.g. draw:glue-point-leaving-directions +static void GetDoubleSequence( std::vector< css::beans::PropertyValue >& rDest, // e.g. draw:glue-point-leaving-directions const OUString& rValue, const EnhancedCustomShapeTokenEnum eDestProp ) { std::vector< double > vDirection; @@ -466,7 +466,7 @@ void GetDoubleSequence( std::vector< css::beans::PropertyValue >& rDest, } } -void GetSizeSequence( std::vector< css::beans::PropertyValue >& rDest, +static void GetSizeSequence( std::vector< css::beans::PropertyValue >& rDest, const OUString& rValue, const EnhancedCustomShapeTokenEnum eDestProp ) { std::vector< sal_Int32 > vNum; @@ -503,7 +503,7 @@ void GetSizeSequence( std::vector< css::beans::PropertyValue >& rDest, } } -void GetEnhancedParameter( std::vector< css::beans::PropertyValue >& rDest, // e.g. draw:handle-position +static void GetEnhancedParameter( std::vector< css::beans::PropertyValue >& rDest, // e.g. draw:handle-position const OUString& rValue, const EnhancedCustomShapeTokenEnum eDestProp ) { sal_Int32 nIndex = 0; @@ -517,7 +517,7 @@ void GetEnhancedParameter( std::vector< css::beans::PropertyValue >& rDest, } } -void GetEnhancedParameterPair( std::vector< css::beans::PropertyValue >& rDest, // e.g. draw:handle-position +static void GetEnhancedParameterPair( std::vector< css::beans::PropertyValue >& rDest, // e.g. draw:handle-position const OUString& rValue, const EnhancedCustomShapeTokenEnum eDestProp ) { sal_Int32 nIndex = 0; @@ -532,7 +532,7 @@ void GetEnhancedParameterPair( std::vector< css::beans::PropertyValue >& rDest, } } -sal_Int32 GetEnhancedParameterPairSequence( std::vector< css::beans::PropertyValue >& rDest, // e.g. draw:glue-points +static sal_Int32 GetEnhancedParameterPairSequence( std::vector< css::beans::PropertyValue >& rDest, // e.g. draw:glue-points const OUString& rValue, const EnhancedCustomShapeTokenEnum eDestProp ) { std::vector< css::drawing::EnhancedCustomShapeParameterPair > vParameter; @@ -554,7 +554,7 @@ sal_Int32 GetEnhancedParameterPairSequence( std::vector< css::beans::PropertyVal return vParameter.size(); } -void GetEnhancedRectangleSequence( std::vector< css::beans::PropertyValue >& rDest, // e.g. draw:text-areas +static void GetEnhancedRectangleSequence( std::vector< css::beans::PropertyValue >& rDest, // e.g. draw:text-areas const OUString& rValue, const EnhancedCustomShapeTokenEnum eDestProp ) { std::vector< css::drawing::EnhancedCustomShapeTextFrame > vTextFrame; @@ -578,7 +578,7 @@ void GetEnhancedRectangleSequence( std::vector< css::beans::PropertyValue >& rDe } } -void GetEnhancedPath( std::vector< css::beans::PropertyValue >& rDest, // e.g. draw:enhanced-path +static void GetEnhancedPath( std::vector< css::beans::PropertyValue >& rDest, // e.g. draw:enhanced-path const OUString& rValue ) { std::vector< css::drawing::EnhancedCustomShapeParameterPair > vCoordinates; @@ -816,7 +816,7 @@ void GetEnhancedPath( std::vector< css::beans::PropertyValue >& rDest, rDest.push_back( aProp ); } -void GetAdjustmentValues( std::vector< css::beans::PropertyValue >& rDest, // draw:adjustments +static void GetAdjustmentValues( std::vector< css::beans::PropertyValue >& rDest, // draw:adjustments const OUString& rValue ) { std::vector< css::drawing::EnhancedCustomShapeAdjustmentValue > vAdjustmentValue; @@ -1105,7 +1105,7 @@ void XMLEnhancedCustomShapeContext::StartElement( const uno::Reference< xml::sax } } -void SdXMLCustomShapePropertyMerge( std::vector< css::beans::PropertyValue >& rPropVec, +static void SdXMLCustomShapePropertyMerge( std::vector< css::beans::PropertyValue >& rPropVec, const std::vector< beans::PropertyValues >& rElement, const OUString& rElementName ) { @@ -1118,7 +1118,7 @@ void SdXMLCustomShapePropertyMerge( std::vector< css::beans::PropertyValue >& rP } } -void SdXMLCustomShapePropertyMerge( std::vector< css::beans::PropertyValue >& rPropVec, +static void SdXMLCustomShapePropertyMerge( std::vector< css::beans::PropertyValue >& rPropVec, const std::vector< OUString >& rElement, const OUString& rElementName ) { @@ -1131,7 +1131,7 @@ void SdXMLCustomShapePropertyMerge( std::vector< css::beans::PropertyValue >& rP } } -void SdXMLCustomShapePropertyMerge( std::vector< css::beans::PropertyValue >& rPropVec, +static void SdXMLCustomShapePropertyMerge( std::vector< css::beans::PropertyValue >& rPropVec, const std::vector< css::beans::PropertyValue >& rElement, const OUString& rElementName ) { @@ -1148,7 +1148,7 @@ typedef std::unordered_map< OUString, sal_Int32 > EquationHashMap; /* if rPara.Type is from type EnhancedCustomShapeParameterType::EQUATION, the name of the equation will be converted from OUString to index */ -void CheckAndResolveEquationParameter( css::drawing::EnhancedCustomShapeParameter& rPara, EquationHashMap* pH ) +static void CheckAndResolveEquationParameter( css::drawing::EnhancedCustomShapeParameter& rPara, EquationHashMap* pH ) { if ( rPara.Type == css::drawing::EnhancedCustomShapeParameterType::EQUATION ) { diff --git a/xmloff/source/forms/controlpropertymap.cxx b/xmloff/source/forms/controlpropertymap.cxx index 852c2d93d3da..9ca9b7aed308 100644 --- a/xmloff/source/forms/controlpropertymap.cxx +++ b/xmloff/source/forms/controlpropertymap.cxx @@ -38,7 +38,7 @@ namespace xmloff #define MAP_CONST_P( name, prefix, token, type, context ){ name, sizeof(name)-1, prefix, token, type|XML_TYPE_PROP_PARAGRAPH, context, SvtSaveOptions::ODFVER_010, false } #define MAP_END() { nullptr, 0, 0, XML_TOKEN_INVALID, 0, 0, SvtSaveOptions::ODFVER_010, false } - XMLPropertyMapEntry* getControlStylePropertyMap_Access( ) + static XMLPropertyMapEntry* getControlStylePropertyMap_Access( ) { static XMLPropertyMapEntry aControlStyleProperties[] = { @@ -93,7 +93,7 @@ namespace xmloff } }; - void implSortMap(XMLPropertyMapEntry* _pMap) + static void implSortMap(XMLPropertyMapEntry* _pMap) { XMLPropertyMapEntry* pEnd; // determine the last element diff --git a/xmloff/source/style/XMLFontAutoStylePool.cxx b/xmloff/source/style/XMLFontAutoStylePool.cxx index 24926aa8c5ad..95f0394e16f7 100644 --- a/xmloff/source/style/XMLFontAutoStylePool.cxx +++ b/xmloff/source/style/XMLFontAutoStylePool.cxx @@ -534,7 +534,7 @@ void XMLFontAutoStylePool::exportXML() } } -OUString getFreeFontName(uno::Reference<embed::XStorage> const & rxStorage, OUString const & rFamilyName) +static OUString getFreeFontName(uno::Reference<embed::XStorage> const & rxStorage, OUString const & rFamilyName) { OUString sName; int nIndex = 1; @@ -549,7 +549,7 @@ OUString getFreeFontName(uno::Reference<embed::XStorage> const & rxStorage, OUSt return sName; } -OString convertToHashString(std::vector<unsigned char> const & rHash) +static OString convertToHashString(std::vector<unsigned char> const & rHash) { std::stringstream aStringStream; for (auto const & rByte : rHash) @@ -560,7 +560,7 @@ OString convertToHashString(std::vector<unsigned char> const & rHash) return OString(aStringStream.str().c_str()); } -OString getFileHash(OUString const & rFileUrl) +static OString getFileHash(OUString const & rFileUrl) { OString aHash; osl::File aFile(rFileUrl); diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx index ddc70eec4733..b83ae01fb358 100644 --- a/xmloff/source/style/xmlnumfe.cxx +++ b/xmloff/source/style/xmlnumfe.cxx @@ -845,7 +845,7 @@ void SvXMLNumFmtExport::WriteMapElement_Impl( sal_Int32 nOp, double fLimit, // for old (automatic) currency formats: parse currency symbol from text -sal_Int32 lcl_FindSymbol( const OUString& sUpperStr, const OUString& sCurString ) +static sal_Int32 lcl_FindSymbol( const OUString& sUpperStr, const OUString& sCurString ) { // search for currency symbol // Quoting as in ImpSvNumberformatScan::Symbol_Division diff --git a/xmloff/source/table/XMLTableExport.cxx b/xmloff/source/table/XMLTableExport.cxx index 8018f2b1bc3d..c02eea4fb020 100644 --- a/xmloff/source/table/XMLTableExport.cxx +++ b/xmloff/source/table/XMLTableExport.cxx @@ -536,7 +536,7 @@ const TableStyleElement* getWriterSpecificTableStyleMap() return &gWriterSpecificTableStyleElements[0]; } -const TableStyleElement* getWriterSpecificTableStyleAttributes() +static const TableStyleElement* getWriterSpecificTableStyleAttributes() { static const struct TableStyleElement gWriterSpecifitTableStyleAttributes[] = { diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx index 698fcb076477..ba5bba24ac6a 100644 --- a/xmloff/source/text/txtflde.cxx +++ b/xmloff/source/text/txtflde.cxx @@ -249,25 +249,25 @@ SvXMLEnumStringMapEntry<FieldIdEnum> const aFieldServiceNameMapping[] = // property accessor helper functions -inline bool GetBoolProperty(const OUString&, +static inline bool GetBoolProperty(const OUString&, const Reference<XPropertySet> &); -inline bool GetOptionalBoolProperty(const OUString&, +static inline bool GetOptionalBoolProperty(const OUString&, const Reference<XPropertySet> &, const Reference<XPropertySetInfo> &, bool bDefault); -inline double GetDoubleProperty(const OUString&, +static inline double GetDoubleProperty(const OUString&, const Reference<XPropertySet> &); -inline OUString const GetStringProperty(const OUString&, +static inline OUString const GetStringProperty(const OUString&, const Reference<XPropertySet> &); -inline sal_Int32 GetIntProperty(const OUString&, +static inline sal_Int32 GetIntProperty(const OUString&, const Reference<XPropertySet> &); -inline sal_Int16 GetInt16Property(const OUString&, +static inline sal_Int16 GetInt16Property(const OUString&, const Reference<XPropertySet> &); -inline sal_Int8 GetInt8Property(const OUString&, +static inline sal_Int8 GetInt8Property(const OUString&, const Reference<XPropertySet> &); -inline util::DateTime const GetDateTimeProperty( const OUString& sPropName, +static inline util::DateTime const GetDateTimeProperty( const OUString& sPropName, const Reference<XPropertySet> & xPropSet); -inline Sequence<OUString> const GetStringSequenceProperty( +static inline Sequence<OUString> const GetStringSequenceProperty( const OUString& sPropName, const Reference<XPropertySet> & xPropSet); diff --git a/xmloff/source/transform/EventOASISTContext.cxx b/xmloff/source/transform/EventOASISTContext.cxx index 7667d628b397..5fd369f621e5 100644 --- a/xmloff/source/transform/EventOASISTContext.cxx +++ b/xmloff/source/transform/EventOASISTContext.cxx @@ -122,7 +122,7 @@ OUString XMLEventOASISTransformerContext::GetEventName( return (*aIter).second; } -bool ParseURL( +static bool ParseURL( const OUString& rAttrValue, OUString* pName, OUString* pLocation ) { diff --git a/xmloff/source/xforms/SchemaRestrictionContext.cxx b/xmloff/source/xforms/SchemaRestrictionContext.cxx index c1720b1f5c60..fcf58ce5eb2f 100644 --- a/xmloff/source/xforms/SchemaRestrictionContext.cxx +++ b/xmloff/source/xforms/SchemaRestrictionContext.cxx @@ -132,26 +132,26 @@ void SchemaRestrictionContext::HandleAttribute( typedef Any (*convert_t)( const OUString& ); -Any xforms_string( const OUString& rValue ) +static Any xforms_string( const OUString& rValue ) { return makeAny( rValue ); } -Any xforms_int32( const OUString& rValue ) +static Any xforms_int32( const OUString& rValue ) { sal_Int32 nValue; bool bSuccess = ::sax::Converter::convertNumber( nValue, rValue ); return bSuccess ? makeAny( nValue ) : Any(); } -Any xforms_int16( const OUString& rValue ) +static Any xforms_int16( const OUString& rValue ) { sal_Int32 nValue; bool bSuccess = ::sax::Converter::convertNumber( nValue, rValue ); return bSuccess ? makeAny( static_cast<sal_Int16>( nValue ) ) : Any(); } -Any xforms_whitespace( const OUString& rValue ) +static Any xforms_whitespace( const OUString& rValue ) { Any aValue; if( IsXMLToken( rValue, XML_PRESERVE ) ) @@ -163,14 +163,14 @@ Any xforms_whitespace( const OUString& rValue ) return aValue; } -Any xforms_double( const OUString& rValue ) +static Any xforms_double( const OUString& rValue ) { double fValue; bool bSuccess = ::sax::Converter::convertDouble( fValue, rValue ); return bSuccess ? makeAny( fValue ) : Any(); } -Any xforms_date( const OUString& rValue ) +static Any xforms_date( const OUString& rValue ) { Any aAny; @@ -191,14 +191,14 @@ Any xforms_date( const OUString& rValue ) return aAny; } -Any xforms_dateTime( const OUString& rValue ) +static Any xforms_dateTime( const OUString& rValue ) { util::DateTime aDateTime; bool const bSuccess = ::sax::Converter::parseDateTime(aDateTime, rValue); return bSuccess ? makeAny( aDateTime ) : Any(); } -Any xforms_time( const OUString& rValue ) +static Any xforms_time( const OUString& rValue ) { Any aAny; Duration aDuration; diff --git a/xmloff/source/xforms/xformsexport.cxx b/xmloff/source/xforms/xformsexport.cxx index 98291990581a..db14dec1e36b 100644 --- a/xmloff/source/xforms/xformsexport.cxx +++ b/xmloff/source/xforms/xformsexport.cxx @@ -101,10 +101,10 @@ void exportXForms( SvXMLExport& rExport ) } -void exportXFormsInstance( SvXMLExport&, const Sequence<PropertyValue>& ); -void exportXFormsBinding( SvXMLExport&, const Reference<XPropertySet>& ); -void exportXFormsSubmission( SvXMLExport&, const Reference<XPropertySet>& ); -void exportXFormsSchemas( SvXMLExport&, const Reference<css::xforms::XModel>& ); +static void exportXFormsInstance( SvXMLExport&, const Sequence<PropertyValue>& ); +static void exportXFormsBinding( SvXMLExport&, const Reference<XPropertySet>& ); +static void exportXFormsSubmission( SvXMLExport&, const Reference<XPropertySet>& ); +static void exportXFormsSchemas( SvXMLExport&, const Reference<css::xforms::XModel>& ); typedef OUString (*convert_t)( const Any& ); @@ -123,15 +123,15 @@ static void lcl_export( const Reference<XPropertySet>& rPropertySet, #define TABLE_END { nullptr, 0, 0, nullptr } // any conversion functions -OUString xforms_string( const Any& ); -OUString xforms_bool( const Any& ); -OUString xforms_whitespace( const Any& ); -template<typename T, void (*FUNC)( OUStringBuffer&, T )> OUString xforms_convert( const Any& ); -template<typename T, void (*FUNC)( OUStringBuffer&, const T& )> OUString xforms_convertRef( const Any& ); - -void xforms_formatDate( OUStringBuffer& aBuffer, const util::Date& aDate ); -void xforms_formatTime( OUStringBuffer& aBuffer, const css::util::Time& aTime ); -void xforms_formatDateTime( OUStringBuffer& aBuffer, const util::DateTime& aDateTime ); +static OUString xforms_string( const Any& ); +static OUString xforms_bool( const Any& ); +static OUString xforms_whitespace( const Any& ); +template<typename T, void (*FUNC)( OUStringBuffer&, T )> static OUString xforms_convert( const Any& ); +template<typename T, void (*FUNC)( OUStringBuffer&, const T& )> static OUString xforms_convertRef( const Any& ); + +static void xforms_formatDate( OUStringBuffer& aBuffer, const util::Date& aDate ); +static void xforms_formatTime( OUStringBuffer& aBuffer, const css::util::Time& aTime ); +static void xforms_formatDateTime( OUStringBuffer& aBuffer, const util::DateTime& aDateTime ); static void convertNumber(OUStringBuffer & b, sal_Int32 n) { b.append(n); diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx index ae6340cd9848..6d8fde165719 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx @@ -1237,7 +1237,7 @@ void ElementDescriptor::readEvents() } } -inline bool equalFont( Style const & style1, Style const & style2 ) +static inline bool equalFont( Style const & style1, Style const & style2 ) { awt::FontDescriptor const & f1 = style1._descr; awt::FontDescriptor const & f2 = style2._descr; diff --git a/xmlsecurity/source/helper/documentsignaturehelper.cxx b/xmlsecurity/source/helper/documentsignaturehelper.cxx index e4961377099a..dc97143f0029 100644 --- a/xmlsecurity/source/helper/documentsignaturehelper.cxx +++ b/xmlsecurity/source/helper/documentsignaturehelper.cxx @@ -82,7 +82,7 @@ int compareVersions( } } -void ImplFillElementList( +static void ImplFillElementList( std::vector< OUString >& rList, const Reference < css::embed::XStorage >& rxStore, const OUString& rRootStorageName, const bool bRecursive, const DocumentSignatureAlgorithm mode) diff --git a/xmlsecurity/source/xmlsec/errorcallback.cxx b/xmlsecurity/source/xmlsec/errorcallback.cxx index ac9b72511458..3cbe0ac1142e 100644 --- a/xmlsecurity/source/xmlsec/errorcallback.cxx +++ b/xmlsecurity/source/xmlsec/errorcallback.cxx @@ -29,8 +29,9 @@ #include <comphelper/windowserrorstring.hxx> #endif -extern "C" -void errorCallback(const char* file, +extern "C" { + +static void errorCallback(const char* file, int line, const char* func, const char* errorObject, @@ -50,6 +51,8 @@ void errorCallback(const char* file, SAL_WARN("xmlsecurity.xmlsec", file << ":" << line << ": " << func << "() '" << pErrorObject << "' '" << pErrorSubject << "' " << reason << " '" << pMsg << "'" << systemErrorString); } +} + XSECXMLSEC_DLLPUBLIC void setErrorRecorder() { xmlSecErrorsSetCallback(errorCallback); diff --git a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx index 3fb94bd256c5..e79e3db09e9a 100644 --- a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx +++ b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx @@ -54,8 +54,11 @@ using namespace com::sun::star; #define ROOT_CERTS "Root Certs for OpenOffice.org" -extern "C" void nsscrypto_finalize(); +extern "C" { +static void nsscrypto_finalize(); + +} namespace { diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx index 7ccc70c85955..5fd173689ba9 100644 --- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx @@ -57,8 +57,8 @@ using ::com::sun::star::lang::XSingleServiceFactory ; using ::com::sun::star::xml::crypto::XSecurityEnvironment ; using ::com::sun::star::security::XCertificate ; -extern X509Certificate_NssImpl* NssCertToXCert( CERTCertificate* cert ) ; -extern X509Certificate_NssImpl* NssPrivKeyToXCert( SECKEYPrivateKey* ) ; +static X509Certificate_NssImpl* NssCertToXCert( CERTCertificate* cert ) ; +static X509Certificate_NssImpl* NssPrivKeyToXCert( SECKEYPrivateKey* ) ; struct UsageDescription @@ -78,7 +78,7 @@ struct UsageDescription }; -char* GetPasswordFunction( PK11SlotInfo* pSlot, PRBool bRetry, void* /*arg*/ ) +static char* GetPasswordFunction( PK11SlotInfo* pSlot, PRBool bRetry, void* /*arg*/ ) { uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); uno::Reference < task::XInteractionHandler2 > xInteractionHandler( diff --git a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx index 0cf8c17d3303..53449e9c0900 100644 --- a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx @@ -350,7 +350,7 @@ const Sequence< sal_Int8>& X509Certificate_NssImpl::getUnoTunnelId() { return theX509Certificate_NssImplUnoTunnelId::get().getSeq(); } -OUString getAlgorithmDescription(SECAlgorithmID const *aid) +static OUString getAlgorithmDescription(SECAlgorithmID const *aid) { SECOidTag tag; tag = SECOID_GetAlgorithmTag(aid); @@ -360,7 +360,7 @@ OUString getAlgorithmDescription(SECAlgorithmID const *aid) return OUString::createFromAscii( pDesc ) ; } -css::uno::Sequence< sal_Int8 > getThumbprint(CERTCertificate const *pCert, SECOidTag id) +static css::uno::Sequence< sal_Int8 > getThumbprint(CERTCertificate const *pCert, SECOidTag id) { if( pCert != nullptr ) { diff --git a/xmlsecurity/source/xmlsec/saxhelper.cxx b/xmlsecurity/source/xmlsec/saxhelper.cxx index 028edbcf547b..7be5fbfce752 100644 --- a/xmlsecurity/source/xmlsec/saxhelper.cxx +++ b/xmlsecurity/source/xmlsec/saxhelper.cxx @@ -35,7 +35,7 @@ namespace cssxcsax = com::sun::star::xml::csax; * The return value is NULL terminated. The application has the responsibilty to * deallocte the return value. */ -xmlChar* ous_to_xmlstr( const OUString& oustr ) +static xmlChar* ous_to_xmlstr( const OUString& oustr ) { OString ostr = OUStringToOString( oustr , RTL_TEXTENCODING_UTF8 ) ; return xmlStrndup( reinterpret_cast<xmlChar const *>(ostr.getStr()), static_cast<int>(ostr.getLength()) ) ; @@ -45,7 +45,7 @@ xmlChar* ous_to_xmlstr( const OUString& oustr ) * The return value is NULL terminated. The application has the responsibilty to * deallocte the return value. */ -xmlChar* ous_to_nxmlstr( const OUString& oustr, int& length ) +static xmlChar* ous_to_nxmlstr( const OUString& oustr, int& length ) { OString ostr = OUStringToOString( oustr , RTL_TEXTENCODING_UTF8 ) ; length = ostr.getLength(); @@ -57,7 +57,7 @@ xmlChar* ous_to_nxmlstr( const OUString& oustr, int& length ) * The return value and the referenced value must be NULL terminated. * The application has the responsibilty to deallocte the return value. */ -const xmlChar** attrlist_to_nxmlstr( const cssu::Sequence< cssxcsax::XMLAttribute >& aAttributes ) +static const xmlChar** attrlist_to_nxmlstr( const cssu::Sequence< cssxcsax::XMLAttribute >& aAttributes ) { xmlChar* attname = nullptr ; xmlChar* attvalue = nullptr ; diff --git a/xmlsecurity/source/xmlsec/xmlstreamio.cxx b/xmlsecurity/source/xmlsec/xmlstreamio.cxx index 7cd44219d2f5..be48ae34b232 100644 --- a/xmlsecurity/source/xmlsec/xmlstreamio.cxx +++ b/xmlsecurity/source/xmlsec/xmlstreamio.cxx @@ -33,8 +33,9 @@ static bool g_bInputCallbacksRegistered = false; static css::uno::Reference< css::xml::crypto::XUriBinding > m_xUriBinding ; -extern "C" -int xmlStreamMatch( const char* uri ) +extern "C" { + +static int xmlStreamMatch( const char* uri ) { css::uno::Reference< css::io::XInputStream > xInputStream ; @@ -65,8 +66,7 @@ int xmlStreamMatch( const char* uri ) return 0 ; } -extern "C" -void* xmlStreamOpen( const char* uri ) +static void* xmlStreamOpen( const char* uri ) { css::uno::Reference< css::io::XInputStream > xInputStream ; @@ -99,8 +99,7 @@ void* xmlStreamOpen( const char* uri ) return nullptr ; } -extern "C" -int xmlStreamRead( void* context, char* buffer, int len ) +static int xmlStreamRead( void* context, char* buffer, int len ) { int numbers ; css::uno::Reference< css::io::XInputStream > xInputStream ; @@ -124,8 +123,7 @@ int xmlStreamRead( void* context, char* buffer, int len ) return numbers ; } -extern "C" -int xmlStreamClose( void * context ) +static int xmlStreamClose( void * context ) { if (g_bInputCallbacksEnabled && g_bInputCallbacksRegistered) { @@ -139,6 +137,8 @@ int xmlStreamClose( void * context ) return 0 ; } +} + XSECXMLSEC_DLLPUBLIC int xmlEnableStreamInputCallbacks() { if (!g_bInputCallbacksEnabled) |