diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2003-09-19 07:53:59 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2003-09-19 07:53:59 +0000 |
commit | 5e74098814ff6b626e5415298083cd2b3f17995a (patch) | |
tree | 637d0bc7f973f89fc92ab50f862bff743e05927d /starmath/source/unomodel.cxx | |
parent | 2a280d166499c8101d3a6fe3bbdfcdc8a8f187e7 (diff) |
INTEGRATION: CWS fwkq1 (1.24.26); FILE MERGED
2003/07/17 12:21:24 mba 1.24.26.2: #110843#: get rid of factories
2003/07/15 06:25:23 mba 1.24.26.1: #110843#: get rid of factories
Diffstat (limited to 'starmath/source/unomodel.cxx')
-rw-r--r-- | starmath/source/unomodel.cxx | 42 |
1 files changed, 32 insertions, 10 deletions
diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx index 4319e29618..03dfd773f5 100644 --- a/starmath/source/unomodel.cxx +++ b/starmath/source/unomodel.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unomodel.cxx,v $ * - * $Revision: 1.24 $ + * $Revision: 1.25 $ * - * last change: $Author: rt $ $Date: 2003-04-24 14:08:12 $ + * last change: $Author: rt $ $Date: 2003-09-19 08:53:59 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -142,6 +142,8 @@ #include <config.hxx> #endif +#include <smdll.hxx> + using namespace ::vos; using namespace ::rtl; using namespace ::cppu; @@ -320,7 +322,6 @@ uno::Any SAL_CALL SmModel::queryInterface( const uno::Type& rType ) throw(uno::R static_cast< XMultiPropertySet* > ( this ), //static_cast< XPropertyState* > ( this ), // my own interfaces - static_cast< XUnoTunnel* > ( this ), static_cast< XServiceInfo* > ( this ), static_cast< XRenderable* > ( this ) ); if (!aRet.hasValue()) @@ -351,10 +352,9 @@ uno::Sequence< uno::Type > SAL_CALL SmModel::getTypes( ) throw(uno::RuntimeExce ::vos::OGuard aGuard(Application::GetSolarMutex()); uno::Sequence< uno::Type > aTypes = SfxBaseModel::getTypes(); sal_Int32 nLen = aTypes.getLength(); - aTypes.realloc(nLen + 5); + aTypes.realloc(nLen + 4); uno::Type* pTypes = aTypes.getArray(); pTypes[nLen++] = ::getCppuType((Reference<XServiceInfo>*)0); - pTypes[nLen++] = ::getCppuType((Reference<XUnoTunnel>*)0); pTypes[nLen++] = ::getCppuType((Reference<XPropertySet>*)0); pTypes[nLen++] = ::getCppuType((Reference<XMultiPropertySet>*)0); pTypes[nLen++] = ::getCppuType((Reference<XRenderable>*)0); @@ -392,7 +392,8 @@ sal_Int64 SAL_CALL SmModel::getSomething( const uno::Sequence< sal_Int8 >& rId ) { return (sal_Int64)this; } - return 0; + + return SfxBaseModel::getSomething( rId ); } /*-- 07.01.00 16:32:59--------------------------------------------------- @@ -417,8 +418,15 @@ sal_Int16 lcl_AnyToINT16(const uno::Any& rAny) OUString SmModel::getImplementationName(void) throw( uno::RuntimeException ) { - return C2U("SmModel"); + return getImplementationName_Static(); } + + +::rtl::OUString SmModel::getImplementationName_Static() +{ + return rtl::OUString::createFromAscii("com.sun.star.comp.math.FormulaDocument"); +} + /*-- 07.02.00 13:24:09--------------------------------------------------- -----------------------------------------------------------------------*/ @@ -431,6 +439,11 @@ sal_Bool SmModel::supportsService(const OUString& rServiceName) throw( uno::Runt -----------------------------------------------------------------------*/ uno::Sequence< OUString > SmModel::getSupportedServiceNames(void) throw( uno::RuntimeException ) { + return getSupportedServiceNames_Static(); +} + +uno::Sequence< OUString > SmModel::getSupportedServiceNames_Static(void) +{ ::vos::OGuard aGuard(Application::GetSolarMutex()); uno::Sequence< OUString > aRet(1); @@ -899,7 +912,7 @@ static Size lcl_GuessPaperSize() aRes.Width() = lLetterWidth; aRes.Height() = lLetterHeight; } - aRes = OutputDevice::LogicToLogic( aRes, MapMode(MAP_TWIP), + aRes = OutputDevice::LogicToLogic( aRes, MapMode(MAP_TWIP), MapMode(MAP_100TH_MM) ); return aRes; } @@ -991,9 +1004,9 @@ void SAL_CALL SmModel::render( { aPrtPaperSize = lcl_GuessPaperSize(); // factors from Windows DIN A4 - aOutputSize = Size( aPrtPaperSize.Width() * 0.941, + aOutputSize = Size( aPrtPaperSize.Width() * 0.941, aPrtPaperSize.Height() * 0.961); - aPrtPageOffset = Point( aPrtPaperSize.Width() * 0.0250, + aPrtPageOffset = Point( aPrtPaperSize.Width() * 0.0250, aPrtPaperSize.Height() * 0.0214); } Point aZeroPoint; @@ -1021,3 +1034,12 @@ void SAL_CALL SmModel::render( } } +uno::Reference< uno::XInterface > SAL_CALL SmModel_createInstance( + const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) throw( uno::Exception ) +{ + ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SmDLL::Init(); + SfxObjectShell* pShell = new SmDocShell( SFX_CREATE_MODE_STANDARD ); + return uno::Reference< uno::XInterface >( pShell->GetModel() ); +} + |