Anonymous avatar Anonymous committed cb13bee

vcl122: #117746# remove unused AtomClient, AtomServer

Comments (0)

Files changed (2)

unotools/inc/unotools/atom.hxx

             { overrideAtom( atomClass, newDescription.atom, newDescription.description ); }
         sal_Bool hasAtom( int atomClass, int atom ) const;
     };
-
-    class AtomServer : public ::cppu::WeakAggImplHelper1< ::com::sun::star::util::XAtomServer >
-    {
-    private:
-        MultiAtomProvider   m_aProvider;
-        ::osl::Mutex        m_aMutex;
-    public:
-        AtomServer();
-        virtual ~AtomServer();
-
-        const ::rtl::OUString& getString( int atomClass, int atom ) const
-            { return m_aProvider.getString( atomClass, atom ); }
-
-        virtual ::com::sun::star::uno::Sequence< ::com::sun::star::util::AtomDescription > SAL_CALL getClass( sal_Int32 atomClass ) throw();
-        virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::util::AtomDescription > > SAL_CALL getClasses( const ::com::sun::star::uno::Sequence< sal_Int32 >& atomClasses ) throw();
-        virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAtomDescriptions( const ::com::sun::star::uno::Sequence< ::com::sun::star::util::AtomClassRequest >& atoms ) throw();
-        virtual ::com::sun::star::uno::Sequence< ::com::sun::star::util::AtomDescription > SAL_CALL getRecentAtoms( sal_Int32 atomClass, sal_Int32 atom ) throw();
-        virtual sal_Int32 SAL_CALL getAtom( sal_Int32 atomClass, const ::rtl::OUString& description, sal_Bool create ) throw();
-    };
-
-    class AtomClient
-    {
-    private:
-        ::com::sun::star::uno::Reference< ::com::sun::star::util::XAtomServer >     m_xServer;
-        MultiAtomProvider m_aProvider;
-    public:
-        AtomClient( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XAtomServer >& );
-        ~AtomClient();
-
-        void updateAtomClasses( const ::com::sun::star::uno::Sequence< sal_Int32 >& atomClasses );
-        int getAtom( int atomClass, const ::rtl::OUString& description, sal_Bool bCreate );
-        const ::rtl::OUString& getString( int atomClass, int atom );
-    };
 }
 
 #endif

unotools/source/misc/atom.cxx

 	m_aAtomLists[ atomClass ]->overrideAtom( atom, description );
 }
 
-// -----------------------------------------------------------------------
-
-AtomServer::AtomServer()
-{
-}
-
-AtomServer::~AtomServer()
-{
-}
-
-sal_Int32 AtomServer::getAtom( sal_Int32 atomClass, const ::rtl::OUString& description, sal_Bool create ) throw()
-{
-	::osl::Guard< ::osl::Mutex > guard( m_aMutex );
-
-	return m_aProvider.getAtom( atomClass, description, create );
-}
-
-Sequence< Sequence< NMSP_UTIL::AtomDescription > > AtomServer::getClasses( const Sequence< sal_Int32 >& atomClasses ) throw()
-{
-	::osl::Guard< ::osl::Mutex > guard( m_aMutex );
-
-	Sequence< Sequence< NMSP_UTIL::AtomDescription > > aRet( atomClasses.getLength() );
-	for( int i = 0; i < atomClasses.getLength(); i++ )
-	{
-		aRet.getArray()[i] = getClass( atomClasses.getConstArray()[i] );
-	}
-	return aRet;
-}
-
-Sequence< NMSP_UTIL::AtomDescription > AtomServer::getClass( sal_Int32 atomClass ) throw()
-{
-	::osl::Guard< ::osl::Mutex > guard( m_aMutex );
-
-	::std::list< ::utl::AtomDescription > atoms;
-	m_aProvider.getClass( atomClass, atoms );
-
-	Sequence< NMSP_UTIL::AtomDescription > aRet( atoms.size() );
-	for( int i = aRet.getLength()-1; i >= 0; i-- )
-	{
-		aRet.getArray()[i].atom			= atoms.back().atom;
-		aRet.getArray()[i].description	= atoms.back().description;
-		atoms.pop_back();
-	}
-
-	return aRet;
-}
-
-Sequence< NMSP_UTIL::AtomDescription > AtomServer::getRecentAtoms( sal_Int32 atomClass, sal_Int32 atom ) throw()
-{
-	::osl::Guard< ::osl::Mutex > guard( m_aMutex );
-
-	::std::list< ::utl::AtomDescription > atoms;
-	m_aProvider.getRecent( atomClass, atom, atoms );
-
-	Sequence< NMSP_UTIL::AtomDescription > aRet( atoms.size() );
-	for( int i = aRet.getLength()-1; i >= 0; i-- )
-	{
-		aRet.getArray()[i].atom			= atoms.back().atom;
-		aRet.getArray()[i].description	= atoms.back().description;
-		atoms.pop_back();
-	}
-
-	return aRet;
-}
-
-Sequence< ::rtl::OUString > AtomServer::getAtomDescriptions( const Sequence< AtomClassRequest >& atoms ) throw()
-{
-	::osl::Guard< ::osl::Mutex > guard( m_aMutex );
-
-	int nStrings = 0, i;
-	for( i = 0; i < atoms.getLength(); i++ )
-		nStrings += atoms.getConstArray()[ i ].atoms.getLength();
-	Sequence< ::rtl::OUString > aRet( nStrings );
-	for( i = 0, nStrings = 0; i < atoms.getLength(); i++ )
-	{
-		const AtomClassRequest& rRequest = atoms.getConstArray()[i];
-		for( int n = 0; n < rRequest.atoms.getLength(); n++ )
-			aRet.getArray()[ nStrings++ ] = m_aProvider.getString( rRequest.atomClass, rRequest.atoms.getConstArray()[ n ] );
-	}
-	return aRet;
-}
-
-// -----------------------------------------------------------------------
-
-AtomClient::AtomClient( const Reference< XAtomServer >& xServer ) :
-		m_xServer( xServer )
-{
-}
-
-AtomClient::~AtomClient()
-{
-}
-
-int AtomClient::getAtom( int atomClass, const ::rtl::OUString& description, sal_Bool bCreate )
-{
-	int nAtom = m_aProvider.getAtom( atomClass, description, sal_False );
-	if( nAtom == INVALID_ATOM && bCreate )
-	{
-        try
-        {
-		    nAtom = m_xServer->getAtom( atomClass, description, bCreate );
-        }
-        catch( RuntimeException& )
-        {
-            return INVALID_ATOM;
-        }
-		if( nAtom != INVALID_ATOM )
-			m_aProvider.overrideAtom( atomClass, nAtom, description );
-	}
-	return nAtom;
-}
-
-const ::rtl::OUString& AtomClient::getString( int atomClass, int atom )
-{
-    static ::rtl::OUString aEmpty;
-
-	if( ! m_aProvider.hasAtom( atomClass, atom ) )
-	{
-		Sequence< NMSP_UTIL::AtomDescription > aSeq;
-        try
-        {
-		    aSeq = m_xServer->getRecentAtoms( atomClass, m_aProvider.getLastAtom( atomClass ) );
-        }
-        catch( RuntimeException& )
-        {
-            return aEmpty;
-        }
-		const NMSP_UTIL::AtomDescription* pDescriptions = aSeq.getConstArray();
-		for( int i = 0; i < aSeq.getLength(); i++ )
-			m_aProvider.overrideAtom( atomClass,
-									  pDescriptions[i].atom,
-									  pDescriptions[i].description
-									  );
-
-		if( ! m_aProvider.hasAtom( atomClass, atom ) )
-		{
-			// holes may occur by the above procedure!
-			Sequence< AtomClassRequest > aReq( 1 );
-			aReq.getArray()[0].atomClass = atomClass;
-			aReq.getArray()[0].atoms.realloc( 1 );
-			aReq.getArray()[0].atoms.getArray()[0] = atom;
-            Sequence< ::rtl::OUString > aRet;
-            try
-            {
-			    aRet = m_xServer->getAtomDescriptions( aReq );
-            }
-            catch( RuntimeException& )
-            {
-                return aEmpty;
-            }
-			if( aRet.getLength() == 1 )
-				m_aProvider.overrideAtom( atomClass, atom, aRet.getConstArray()[0] );
-		}
-	}
-	return m_aProvider.getString( atomClass, atom );
-}
-
-void AtomClient::updateAtomClasses( const Sequence< sal_Int32 >& atomClasses )
-{
-	Sequence< Sequence< NMSP_UTIL::AtomDescription > > aUpdate;
-    try
-    {
-        aUpdate = m_xServer->getClasses( atomClasses );
-    }
-    catch( RuntimeException& )
-    {
-        return;
-    }
-	for( int i = 0; i < atomClasses.getLength(); i++ )
-	{
-		int nClass = atomClasses.getConstArray()[i];
-		const Sequence< NMSP_UTIL::AtomDescription >& rClass = aUpdate.getConstArray()[i];
-		const NMSP_UTIL::AtomDescription* pDesc = rClass.getConstArray();
-		for( int n = 0; n < rClass.getLength(); n++, pDesc++ )
-			m_aProvider.overrideAtom( nClass, pDesc->atom, pDesc->description );
-	}
-}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.