xmloff: cleanup StyleMap

Change-Id: I487ab62f412512b0437e6b46a01a3be7c88f5760
This commit is contained in:
Tomaž Vajngerl
2015-04-13 19:57:16 +09:00
parent 211c12b9c6
commit a88a8ca0d2

View File

@@ -24,53 +24,53 @@
#include "StyleMap.hxx" #include "StyleMap.hxx"
using namespace ::osl; using namespace osl;
using namespace ::com::sun::star::uno; using namespace css::uno;
using namespace ::com::sun::star::lang; using namespace css::lang;
namespace
{
class theStyleMapUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theStyleMapUnoTunnelId>
{};
} // end anonymous namespace
StyleMap::StyleMap() StyleMap::StyleMap()
{ {
} }
StyleMap::~StyleMap() StyleMap::~StyleMap()
{ {
} }
namespace
{
class theStyleMapUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theStyleMapUnoTunnelId> {};
}
// XUnoTunnel & co // XUnoTunnel & co
const Sequence< sal_Int8 > & StyleMap::getUnoTunnelId() throw() const Sequence<sal_Int8>& StyleMap::getUnoTunnelId() throw()
{ {
return theStyleMapUnoTunnelId::get().getSeq(); return theStyleMapUnoTunnelId::get().getSeq();
} }
StyleMap* StyleMap::getImplementation( Reference< XInterface > xInt ) throw() StyleMap* StyleMap::getImplementation(Reference<XInterface> xInterface) throw()
{ {
Reference< XUnoTunnel > xUT( xInt, UNO_QUERY ); Reference<XUnoTunnel> xUnoTunnel(xInterface, UNO_QUERY);
if( xUT.is() ) if (xUnoTunnel.is())
return reinterpret_cast<StyleMap *>( {
xUT->getSomething( StyleMap::getUnoTunnelId() ) ); return reinterpret_cast<StyleMap*>(xUnoTunnel->getSomething(StyleMap::getUnoTunnelId()));
else }
return 0;
return 0;
} }
// XUnoTunnel // XUnoTunnel
sal_Int64 SAL_CALL StyleMap::getSomething( sal_Int64 SAL_CALL StyleMap::getSomething(const Sequence<sal_Int8>& rId)
const Sequence< sal_Int8 >& rId ) throw(RuntimeException, std::exception)
throw( RuntimeException, std::exception )
{ {
if( rId.getLength() == 16 && if (rId.getLength() == 16 &&
0 == memcmp( getUnoTunnelId().getConstArray(), memcmp(getUnoTunnelId().getConstArray(), rId.getConstArray(), 16) == 0)
rId.getConstArray(), 16 ) )
{ {
return reinterpret_cast<sal_Int64>( this ); return reinterpret_cast<sal_Int64>(this);
} }
return 0; return 0;
} }