diff options
author | Jan Holesovsky <kendy@suse.cz> | 2011-03-23 16:59:26 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2011-03-23 16:59:26 +0100 |
commit | 3b7ab82aee60aec1e47c1e253d3977a3fc011f5b (patch) | |
tree | 1ebee7adb28ba3175deee3948aee8f5489d9b509 /svx | |
parent | 486dd9082e177aa63294f76d6a75b08dde5957e5 (diff) | |
parent | 61879c218dd0e6e94884e7c6e06e3c5c18540b4a (diff) |
Merge commit 'ooo/DEV300_m103'
Conflicts:
basic/source/runtime/makefile.mk
basic/source/runtime/step2.cxx
desktop/prj/build.lst
desktop/source/app/app.cxx
desktop/source/deployment/registry/dp_backend.cxx
drawinglayer/source/attribute/fontattribute.cxx
editeng/inc/editeng/fontitem.hxx
editeng/source/editeng/edtspell.cxx
editeng/source/misc/svxacorr.cxx
framework/inc/services/substitutepathvars.hxx
framework/source/services/substitutepathvars.cxx
sfx2/qa/cppunit/makefile.mk
sfx2/source/doc/SfxDocumentMetaData.cxx
sfx2/source/doc/objxtor.cxx
svx/source/dialog/svxruler.cxx
sysui/desktop/icons/so9_base_app.ico
sysui/desktop/icons/so9_calc_app.ico
sysui/desktop/icons/so9_draw_app.ico
sysui/desktop/icons/so9_impress_app.ico
sysui/desktop/icons/so9_main_app.ico
sysui/desktop/icons/so9_math_app.ico
sysui/desktop/icons/so9_writer_app.ico
xmlhelp/source/cxxhelp/provider/databases.cxx
xmlhelp/source/cxxhelp/provider/db.cxx
xmlhelp/source/cxxhelp/provider/db.hxx
Diffstat (limited to 'svx')
-rwxr-xr-x | svx/source/form/fmundo.cxx | 78 | ||||
-rwxr-xr-x | svx/source/mnuctrls/fntctl.cxx | 2 | ||||
-rwxr-xr-x | svx/source/stbctrls/pszctrl.cxx | 2 | ||||
-rwxr-xr-x | svx/source/svdraw/svdibrow.cxx | 6 | ||||
-rwxr-xr-x | svx/source/svdraw/svdmodel.cxx | 40 | ||||
-rwxr-xr-x | svx/source/tbxctrls/itemwin.cxx | 4 |
6 files changed, 53 insertions, 79 deletions
diff --git a/svx/source/form/fmundo.cxx b/svx/source/form/fmundo.cxx index 116e9c91e3d5..c067eaee336c 100755 --- a/svx/source/form/fmundo.cxx +++ b/svx/source/form/fmundo.cxx @@ -68,6 +68,7 @@ #include <comphelper/property.hxx> #include <comphelper/uno3.hxx> #include <comphelper/stl_types.hxx> +#include <comphelper/componentcontext.hxx> using namespace ::com::sun::star::uno; using namespace ::com::sun::star::awt; @@ -90,7 +91,9 @@ typedef cppu::WeakImplHelper1< XScriptListener > ScriptEventListener_BASE; class ScriptEventListenerWrapper : public ScriptEventListener_BASE { public: - ScriptEventListenerWrapper( FmFormModel& _rModel) throw ( RuntimeException ) : pModel(&_rModel) + ScriptEventListenerWrapper( FmFormModel& _rModel) throw ( RuntimeException ) + :m_rModel( _rModel ) + ,m_attemptedListenerCreation( false ) { } @@ -100,7 +103,7 @@ public: // XScriptListener virtual void SAL_CALL firing(const ScriptEvent& evt) throw(RuntimeException) { - setModel(); + attemptListenerCreation(); if ( m_vbaListener.is() ) { m_vbaListener->firing( evt ); @@ -109,7 +112,7 @@ public: virtual Any SAL_CALL approveFiring(const ScriptEvent& evt) throw( com::sun::star::reflection::InvocationTargetException, RuntimeException) { - setModel(); + attemptListenerCreation(); if ( m_vbaListener.is() ) { return m_vbaListener->approveFiring( evt ); @@ -118,61 +121,32 @@ public: } private: - void setModel() + void attemptListenerCreation() { - if ( !m_vbaListener.is() ) - { - Reference < XPropertySet > xProps( - ::comphelper::getProcessServiceFactory(), UNO_QUERY ); - if ( xProps.is() ) - { - Reference< XComponentContext > xCtx( xProps->getPropertyValue( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), UNO_QUERY ); - if ( xCtx.is() ) - { - Reference< XMultiComponentFactory > xMFac( - xCtx->getServiceManager(), UNO_QUERY ); - - // SfxObjectShellRef is good here since the model controls the lifetime of the shell - SfxObjectShellRef xObjSh = pModel->GetObjectShell(); - Reference< XMultiServiceFactory > xDocFac; - if ( xObjSh.Is() ) - xDocFac.set( xObjSh->GetModel(), UNO_QUERY ); + if ( m_attemptedListenerCreation ) + return; + m_attemptedListenerCreation = true; - if ( xMFac.is() ) - { - m_vbaListener.set( xMFac->createInstanceWithContext( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "ooo.vba.EventListener" ) ), xCtx ), - UNO_QUERY_THROW ); - } - } - } + try + { + ::comphelper::ComponentContext const aContext( ::comphelper::getProcessServiceFactory() ); + Reference< XScriptListener > const xScriptListener( aContext.createComponent( "ooo.vba.EventListener" ), UNO_QUERY_THROW ); + Reference< XPropertySet > const xListenerProps( xScriptListener, UNO_QUERY_THROW ); + // SfxObjectShellRef is good here since the model controls the lifetime of the shell + SfxObjectShellRef const xObjectShell = m_rModel.GetObjectShell(); + ENSURE_OR_THROW( xObjectShell.Is(), "no object shell!" ); + xListenerProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Model" ) ), makeAny( xObjectShell->GetModel() ) ); + + m_vbaListener = xScriptListener; } - Reference< XPropertySet > xProps( m_vbaListener, UNO_QUERY ); - if ( xProps.is() ) + catch( Exception const & ) { - try - { - // SfxObjectShellRef is good here since the model controls the lifetime of the shell - SfxObjectShellRef xObjSh = pModel->GetObjectShell(); - if ( xObjSh.Is() && m_vbaListener.is() ) - { - Any aVal; - aVal <<= xObjSh->GetModel(); - xProps->setPropertyValue( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Model" ) ), - aVal ); - } - } - catch( Exception& ) - { - //swallow any errors - } + DBG_UNHANDLED_EXCEPTION(); } } - FmFormModel* pModel; - Reference< XScriptListener > m_vbaListener; + FmFormModel& m_rModel; + Reference< XScriptListener > m_vbaListener; + bool m_attemptedListenerCreation; }; diff --git a/svx/source/mnuctrls/fntctl.cxx b/svx/source/mnuctrls/fntctl.cxx index 7e3d62dcd66b..0c7946900171 100755 --- a/svx/source/mnuctrls/fntctl.cxx +++ b/svx/source/mnuctrls/fntctl.cxx @@ -149,7 +149,7 @@ void SvxFontMenuControl::Notify( SfxBroadcaster&, const SfxHint& rHint ) IMPL_LINK_INLINE_START( SvxFontMenuControl, MenuSelect, FontNameMenu *, pMen ) { SvxFontItem aItem( GetId() ); - aItem.GetFamilyName() = pMen->GetCurName(); + aItem.SetFamilyName(pMen->GetCurName()); GetBindings().GetDispatcher()->Execute( GetId(), SFX_CALLMODE_RECORD, &aItem, 0L ); return 0; } diff --git a/svx/source/stbctrls/pszctrl.cxx b/svx/source/stbctrls/pszctrl.cxx index 3b5bca6b777e..8be9399aa843 100755 --- a/svx/source/stbctrls/pszctrl.cxx +++ b/svx/source/stbctrls/pszctrl.cxx @@ -77,7 +77,7 @@ String SvxPosSizeStatusBarControl::GetMetricStr_Impl( long nVal ) { // Applikations-Metrik besorgen und setzen - FieldUnit eOutUnit = SfxModule::GetCurrentFieldUnit(); + FieldUnit eOutUnit = SfxModule::GetModuleFieldUnit( getFrameInterface() ); FieldUnit eInUnit = FUNIT_100TH_MM; String sMetric; diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx index 40ff18e2628b..3db4a25fd613 100755 --- a/svx/source/svdraw/svdibrow.cxx +++ b/svx/source/svdraw/svdibrow.cxx @@ -1251,9 +1251,9 @@ IMPL_LINK(SdrItemBrowser,ChangedHdl,_SdrItemBrowserControl*,pBrowse) case ITEM_XCOLOR: break; case ITEM_COLOR: break; case ITEM_FONT: { - ((SvxFontItem*)pNewItem)->GetFamily()=FAMILY_DONTKNOW; - ((SvxFontItem*)pNewItem)->GetFamilyName()=aNewText; - ((SvxFontItem*)pNewItem)->GetStyleName().Erase(); + ((SvxFontItem*)pNewItem)->SetFamily( FAMILY_DONTKNOW ); + ((SvxFontItem*)pNewItem)->SetFamilyName(aNewText); + ((SvxFontItem*)pNewItem)->SetStyleName( String() ); } break; case ITEM_FONTHEIGHT: { sal_uIntPtr nHgt=0; diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index 5857a75d1b11..594f116ae545 100755 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -837,11 +837,11 @@ void ImpGetDefaultFontsLanguage( SvxFontItem& rLatin, SvxFontItem& rAsian, SvxFo aOutTypeArr[ n ].nFntType, aOutTypeArr[ n ].nLanguage, DEFAULTFONT_FLAGS_ONLYONE, 0 )); SvxFontItem* pI = aItemArr[ n ]; - pI->GetFamily() = aFnt.GetFamily(); - pI->GetFamilyName() = aFnt.GetName(); - pI->GetStyleName().Erase(); - pI->GetPitch() = aFnt.GetPitch(); - pI->GetCharSet() = aFnt.GetCharSet(); + pI->SetFamily( aFnt.GetFamily()); + pI->SetFamilyName( aFnt.GetName()); + pI->SetStyleName( String() ); + pI->SetPitch( aFnt.GetPitch()); + pI->SetCharSet( aFnt.GetCharSet() ); } } @@ -855,29 +855,29 @@ void SdrModel::SetTextDefaults( SfxItemPool* pItemPool, sal_uIntPtr nDefTextHgt // get DEFAULTFONT_LATIN_TEXT and set at pool as dynamic default Font aFont(OutputDevice::GetDefaultFont(DEFAULTFONT_LATIN_TEXT, nLanguage, DEFAULTFONT_FLAGS_ONLYONE, 0)); - aSvxFontItem.GetFamily() = aFont.GetFamily(); - aSvxFontItem.GetFamilyName() = aFont.GetName(); - aSvxFontItem.GetStyleName().Erase(); - aSvxFontItem.GetPitch() = aFont.GetPitch(); - aSvxFontItem.GetCharSet() = aFont.GetCharSet(); + aSvxFontItem.SetFamily(aFont.GetFamily()); + aSvxFontItem.SetFamilyName(aFont.GetName()); + aSvxFontItem.SetStyleName(String()); + aSvxFontItem.SetPitch( aFont.GetPitch()); + aSvxFontItem.SetCharSet( aFont.GetCharSet() ); pItemPool->SetPoolDefaultItem(aSvxFontItem); // get DEFAULTFONT_CJK_TEXT and set at pool as dynamic default Font aFontCJK(OutputDevice::GetDefaultFont(DEFAULTFONT_CJK_TEXT, nLanguage, DEFAULTFONT_FLAGS_ONLYONE, 0)); - aSvxFontItemCJK.GetFamily() = aFontCJK.GetFamily(); - aSvxFontItemCJK.GetFamilyName() = aFontCJK.GetName(); - aSvxFontItemCJK.GetStyleName().Erase(); - aSvxFontItemCJK.GetPitch() = aFontCJK.GetPitch(); - aSvxFontItemCJK.GetCharSet() = aFontCJK.GetCharSet(); + aSvxFontItemCJK.SetFamily( aFontCJK.GetFamily()); + aSvxFontItemCJK.SetFamilyName(aFontCJK.GetName()); + aSvxFontItemCJK.SetStyleName(String()); + aSvxFontItemCJK.SetPitch( aFontCJK.GetPitch()); + aSvxFontItemCJK.SetCharSet( aFontCJK.GetCharSet()); pItemPool->SetPoolDefaultItem(aSvxFontItemCJK); // get DEFAULTFONT_CTL_TEXT and set at pool as dynamic default Font aFontCTL(OutputDevice::GetDefaultFont(DEFAULTFONT_CTL_TEXT, nLanguage, DEFAULTFONT_FLAGS_ONLYONE, 0)); - aSvxFontItemCTL.GetFamily() = aFontCTL.GetFamily(); - aSvxFontItemCTL.GetFamilyName() = aFontCTL.GetName(); - aSvxFontItemCTL.GetStyleName().Erase(); - aSvxFontItemCTL.GetPitch() = aFontCTL.GetPitch(); - aSvxFontItemCTL.GetCharSet() = aFontCTL.GetCharSet(); + aSvxFontItemCTL.SetFamily(aFontCTL.GetFamily()); + aSvxFontItemCTL.SetFamilyName(aFontCTL.GetName()); + aSvxFontItemCTL.SetStyleName(String()); + aSvxFontItemCTL.SetPitch( aFontCTL.GetPitch() ); + aSvxFontItemCTL.SetCharSet( aFontCTL.GetCharSet()); pItemPool->SetPoolDefaultItem(aSvxFontItemCTL); // set dynamic FontHeight defaults diff --git a/svx/source/tbxctrls/itemwin.cxx b/svx/source/tbxctrls/itemwin.cxx index f5beb6660b8b..e7fe6fd333bf 100755 --- a/svx/source/tbxctrls/itemwin.cxx +++ b/svx/source/tbxctrls/itemwin.cxx @@ -468,7 +468,7 @@ SvxMetricField::SvxMetricField( SetLast( 5000 ); SetFirst( 0 ); - eDlgUnit = SfxModule::GetCurrentFieldUnit(); + eDlgUnit = SfxModule::GetModuleFieldUnit( mxFrame ); SetFieldUnit( *this, eDlgUnit, sal_False ); Show(); } @@ -552,7 +552,7 @@ void SvxMetricField::SetCoreUnit( SfxMapUnit eUnit ) void SvxMetricField::RefreshDlgUnit() { - FieldUnit eTmpUnit = SfxModule::GetCurrentFieldUnit(); + FieldUnit eTmpUnit = SfxModule::GetModuleFieldUnit( mxFrame ); if ( eDlgUnit != eTmpUnit ) { eDlgUnit = eTmpUnit; |