summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2011-03-23 16:59:26 +0100
committerJan Holesovsky <kendy@suse.cz>2011-03-23 16:59:26 +0100
commitd4e88719d67c5cadb55c85cd372d412fd969c613 (patch)
tree7213e99d8df05f9676cacb75e43f8a0789b263ab /svx
parentdab1b528ed2e2e0f7c494b3d955d8e0ba9798c0a (diff)
parentd46e1d383278641d664dce56965c11b05ac95b4a (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-xsvx/source/form/fmundo.cxx80
-rwxr-xr-xsvx/source/mnuctrls/fntctl.cxx2
-rwxr-xr-xsvx/source/stbctrls/pszctrl.cxx2
-rwxr-xr-xsvx/source/svdraw/svdibrow.cxx6
-rwxr-xr-xsvx/source/svdraw/svdmodel.cxx40
-rwxr-xr-xsvx/source/tbxctrls/itemwin.cxx4
6 files changed, 54 insertions, 80 deletions
diff --git a/svx/source/form/fmundo.cxx b/svx/source/form/fmundo.cxx
index bddd8ef1b5..1eac0ad3fa 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 ( xMFac.is() )
- {
- m_vbaListener.set( xMFac->createInstanceWithContext(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "ooo.vba.EventListener" ) ), xCtx ),
- UNO_QUERY_THROW );
- }
- }
- }
+ if ( m_attemptedListenerCreation )
+ return;
+ m_attemptedListenerCreation = true;
+
+ 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 4f00a265dd..f9c84fcd14 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 54d0220b34..05400a59a6 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 0dd549b77b..4a960d62cc 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 23d88079c7..82d124cf82 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 9852f9ac79..eed8194d77 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;