diff options
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/dialog/svxruler.cxx | 2 | ||||
-rw-r--r-- | svx/source/fmcomp/gridctrl.cxx | 12 | ||||
-rw-r--r-- | svx/source/form/fmobj.cxx | 4 | ||||
-rw-r--r-- | svx/source/form/fmpage.cxx | 5 | ||||
-rw-r--r-- | svx/source/form/fmpgeimp.cxx | 76 | ||||
-rw-r--r-- | svx/source/form/fmshell.cxx | 6 | ||||
-rw-r--r-- | svx/source/form/fmundo.cxx | 78 | ||||
-rw-r--r-- | svx/source/inc/fmpgeimp.hxx | 4 | ||||
-rwxr-xr-x[-rw-r--r--] | svx/source/mnuctrls/fntctl.cxx | 2 | ||||
-rwxr-xr-x | svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx | 3 | ||||
-rw-r--r-- | svx/source/stbctrls/pszctrl.cxx | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | svx/source/svdraw/svdibrow.cxx | 6 | ||||
-rwxr-xr-x[-rw-r--r--] | svx/source/svdraw/svdmodel.cxx | 40 | ||||
-rw-r--r-- | svx/source/svdraw/svdouno.cxx | 71 | ||||
-rw-r--r-- | svx/source/tbxctrls/itemwin.cxx | 4 |
15 files changed, 138 insertions, 177 deletions
diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx index 4fbd1f3c288e..abc25d865d06 100644 --- a/svx/source/dialog/svxruler.cxx +++ b/svx/source/dialog/svxruler.cxx @@ -2803,7 +2803,7 @@ void SvxRuler::EvalModifier() const RulerType eType = GetDragType(); nDragType = DRAG_OBJECT_SIZE_PROPORTIONAL; if( RULER_TYPE_TAB == eType || - ( ( RULER_TYPE_BORDER == eType || RULER_TYPE_MARGIN1 == eType ) && + ( ( RULER_TYPE_BORDER == eType || RULER_TYPE_MARGIN1 == eType || RULER_TYPE_MARGIN2 == eType) && pColumnItem ) ) PrepareProportional_Impl(eType); break; diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index 38342bf355ea..26f36802a8f9 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -2001,6 +2001,18 @@ void DbGridControl::AdjustRows() RowRemoved(GetRowCount() - nDelta, nDelta, sal_False); // es sind Zeilen weggefallen, dann ab der aktuellen Position neu zeichen Invalidate(); + + sal_Int32 nNewPos = AlignSeekCursor(); + if (m_bSynchDisplay) + DbGridControl_Base::GoToRow(nNewPos); + + SetCurrent(nNewPos); + // there are rows so go to the selected current column + if (nRecordCount) + GoToRowColumnId(nNewPos, GetColumnId(GetCurColumnId())); + if (!IsResizing() && GetRowCount()) + RecalcRows(GetTopRow(), GetVisibleRows(), sal_True); + m_aBar.InvalidateAll(m_nCurrentPos, sal_True); } else // zuwenig RowInserted(GetRowCount(), -nDelta, sal_True); diff --git a/svx/source/form/fmobj.cxx b/svx/source/form/fmobj.cxx index 2b7ad83f7f5f..a3a4038e4ab8 100644 --- a/svx/source/form/fmobj.cxx +++ b/svx/source/form/fmobj.cxx @@ -650,7 +650,9 @@ void FmFormObj::SetUnoControlModel( const Reference< com::sun::star::awt::XContr { SdrUnoObj::SetUnoControlModel( _rxModel ); - // TODO: call something like formObjectInserted at the form page, to tell it the new model + FmFormPage* pFormPage = PTR_CAST( FmFormPage, GetPage() ); + if ( pFormPage ) + pFormPage->GetImpl().formModelAssigned( *this ); impl_checkRefDevice_nothrow( true ); } diff --git a/svx/source/form/fmpage.cxx b/svx/source/form/fmpage.cxx index 480bc5678eaf..bf86964d76de 100644 --- a/svx/source/form/fmpage.cxx +++ b/svx/source/form/fmpage.cxx @@ -105,12 +105,15 @@ FmFormPage::FmFormPage(FmFormModel& rModel, StarBASIC* _pBasic, FASTBOOL bMaster FmFormPage::FmFormPage(const FmFormPage& rPage) :SdrPage(rPage) #ifndef SVX_LIGHT - ,m_pImpl(new FmFormPageImpl( *this, rPage.GetImpl() ) ) + ,m_pImpl(new FmFormPageImpl( *this ) ) #else ,m_pImpl(NULL) #endif ,m_pBasic(0) { +#ifndef SVX_LIGHT + m_pImpl->initFrom( rPage.GetImpl() ); +#endif RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmFormPage::FmFormPage" ); m_sPageName = rPage.m_sPageName; } diff --git a/svx/source/form/fmpgeimp.cxx b/svx/source/form/fmpgeimp.cxx index e239e982dd66..a0d2f5a3c47a 100644 --- a/svx/source/form/fmpgeimp.cxx +++ b/svx/source/form/fmpgeimp.cxx @@ -167,21 +167,18 @@ namespace } //------------------------------------------------------------------------------ -FmFormPageImpl::FmFormPageImpl( FmFormPage& _rPage, const FmFormPageImpl& rImpl ) - :m_rPage( _rPage ) - ,m_bFirstActivation( sal_True ) - ,m_bAttemptedFormCreation( false ) +void FmFormPageImpl::initFrom( FmFormPageImpl& i_foreignImpl ) { - DBG_CTOR(FmFormPageImpl,NULL); - // clone the Forms collection - Reference< XCloneable > xCloneable( const_cast< FmFormPageImpl& >( rImpl ).getForms( false ), UNO_QUERY ); + const Reference< XNameContainer > xForeignForms( const_cast< FmFormPageImpl& >( i_foreignImpl ).getForms( false ) ); + const Reference< XCloneable > xCloneable( xForeignForms, UNO_QUERY ); if ( !xCloneable.is() ) { // great, nothing to do - OSL_ENSURE( !const_cast< FmFormPageImpl& >( rImpl ).getForms( false ).is(), "FmFormPageImpl::FmFormPageImpl: a non-cloneable forms container!?" ); + OSL_ENSURE( !xForeignForms.is(), "FmFormPageImpl::FmFormPageImpl: a non-cloneable forms container!?" ); return; } + try { m_xForms.set( xCloneable->createClone(), UNO_QUERY_THROW ); @@ -196,7 +193,7 @@ FmFormPageImpl::FmFormPageImpl( FmFormPage& _rPage, const FmFormPageImpl& rImpl aVisitor.process( FormComponentPair( xCloneable, m_xForms ), aAssignmentProcessor ); // assign the cloned models to their SdrObjects - SdrObjListIter aForeignIter( rImpl.m_rPage ); + SdrObjListIter aForeignIter( i_foreignImpl.m_rPage ); SdrObjListIter aOwnIter( m_rPage ); OSL_ENSURE( aForeignIter.IsMore() == aOwnIter.IsMore(), "FmFormPageImpl::FmFormPageImpl: inconsistent number of objects (1)!" ); @@ -208,31 +205,23 @@ FmFormPageImpl::FmFormPageImpl( FmFormPage& _rPage, const FmFormPageImpl& rImpl bool bForeignIsForm = pForeignObj && ( pForeignObj->GetObjInventor() == FmFormInventor ); bool bOwnIsForm = pOwnObj && ( pOwnObj->GetObjInventor() == FmFormInventor ); - if ( bForeignIsForm != bOwnIsForm ) - { - OSL_ENSURE( false, "FmFormPageImpl::FmFormPageImpl: inconsistent ordering of objects!" ); - // don't attempt to do further assignments, something's completely messed up - break; - } + ENSURE_OR_BREAK( bForeignIsForm == bOwnIsForm, "FmFormPageImpl::FmFormPageImpl: inconsistent ordering of objects!" ); + // if this fires, don't attempt to do further assignments, something's completely messed up + if ( !bForeignIsForm ) // no form control -> next round continue; Reference< XControlModel > xForeignModel( pForeignObj->GetUnoControlModel() ); - OSL_ENSURE( xForeignModel.is(), "FmFormPageImpl::FmFormPageImpl: control shape without control!" ); - if ( !xForeignModel.is() ) - // the SdrObject does not have a UNO Control Model. This is pathological, but well ... So the cloned - // SdrObject will also not have a UNO Control Model. - continue; - - OSL_ENSURE( !pOwnObj->GetUnoControlModel().is(), "FmFormPageImpl::FmFormPageImpl: there already is a control model for the target object!" ); + ENSURE_OR_CONTINUE( xForeignModel.is(), "FmFormPageImpl::FmFormPageImpl: control shape without control!" ); + // if this fires, the SdrObject does not have a UNO Control Model. This is pathological, but well ... + // So the cloned SdrObject will also not have a UNO Control Model. MapControlModels::const_iterator assignment = aModelAssignment.find( xForeignModel ); - OSL_ENSURE( assignment != aModelAssignment.end(), "FmFormPageImpl::FmFormPageImpl: no clone found for this model!" ); - if ( assignment == aModelAssignment.end() ) - // the source SdrObject has a model, but it is not part of the model hierarchy in rImpl.getForms(). + ENSURE_OR_CONTINUE( assignment != aModelAssignment.end(), "FmFormPageImpl::FmFormPageImpl: no clone found for this model!" ); + // if this fires, the source SdrObject has a model, but it is not part of the model hierarchy in + // i_foreignImpl.getForms(). // Pathological, too ... - continue; pOwnObj->SetUnoControlModel( assignment->second ); } @@ -275,7 +264,7 @@ namespace _map->put( makeAny( xControlModel ), makeAny( xControlShape ) ); } - static void lcl_removeFormObject( const FmFormObj& _object, const Reference< XMap >& _map ) + static void lcl_removeFormObject_throw( const FmFormObj& _object, const Reference< XMap >& _map, bool i_ignoreNonExistence = false ) { // the control model Reference< XControlModel > xControlModel( _object.GetUnoControlModel(), UNO_QUERY ); @@ -287,8 +276,13 @@ namespace Any aOldAssignment = #endif _map->remove( makeAny( xControlModel ) ); - OSL_ENSURE( aOldAssignment == makeAny( Reference< XControlShape >( const_cast< FmFormObj& >( _object ).getUnoShape(), UNO_QUERY ) ), - "lcl_removeFormObject: map was inconsistent!" ); + #if OSL_DEBUG_LEVEL > 0 + (void)aOldAssignment; + #endif + OSL_ENSURE( !i_ignoreNonExistence || + ( aOldAssignment == makeAny( Reference< XControlShape >( const_cast< FmFormObj& >( _object ).getUnoShape(), UNO_QUERY ) ) ), + "lcl_removeFormObject: map was inconsistent!" ); + (void)i_ignoreNonExistence; } } @@ -703,7 +697,26 @@ Reference< XForm > FmFormPageImpl::findFormForDataSource( return sName; } -//------------------------------------------------------------------ +//---------------------------------------------------------------------------------------------------------------------- +void FmFormPageImpl::formModelAssigned( const FmFormObj& _object ) +{ + Reference< XMap > xControlShapeMap( m_aControlShapeMap.get(), UNO_QUERY ); + if ( !xControlShapeMap.is() ) + // our map does not exist -> not interested in this event + return; + + try + { + lcl_removeFormObject_throw( _object, xControlShapeMap, false ); + lcl_insertFormObject_throw( _object, xControlShapeMap ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } +} + +//---------------------------------------------------------------------------------------------------------------------- void FmFormPageImpl::formObjectInserted( const FmFormObj& _object ) { Reference< XMap > xControlShapeMap( m_aControlShapeMap.get(), UNO_QUERY ); @@ -721,6 +734,7 @@ void FmFormPageImpl::formObjectInserted( const FmFormObj& _object ) } } +//---------------------------------------------------------------------------------------------------------------------- void FmFormPageImpl::formObjectRemoved( const FmFormObj& _object ) { Reference< XMap > xControlShapeMap( m_aControlShapeMap.get(), UNO_QUERY ); @@ -730,7 +744,7 @@ void FmFormPageImpl::formObjectRemoved( const FmFormObj& _object ) try { - lcl_removeFormObject( _object, xControlShapeMap ); + lcl_removeFormObject_throw( _object, xControlShapeMap ); } catch( const Exception& ) { diff --git a/svx/source/form/fmshell.cxx b/svx/source/form/fmshell.cxx index 112b47b1107e..4dec747ca431 100644 --- a/svx/source/form/fmshell.cxx +++ b/svx/source/form/fmshell.cxx @@ -901,19 +901,19 @@ void FmFormShell::GetState(SfxItemSet &rSet) case SID_FM_USE_WIZARDS: if ( !SvtModuleOptions().IsModuleInstalled( SvtModuleOptions::E_SDATABASE ) ) rSet.Put( SfxVisibilityItem( nWhich, sal_False ) ); - else if (!m_bDesignMode || !GetFormModel()) + else if (!GetFormModel()) rSet.DisableItem( nWhich ); else rSet.Put( SfxBoolItem(nWhich, GetImpl()->GetWizardUsing() ) ); break; case SID_FM_AUTOCONTROLFOCUS: - if (!m_bDesignMode || !GetFormModel()) + if (!GetFormModel()) rSet.DisableItem( nWhich ); else rSet.Put( SfxBoolItem(nWhich, GetFormModel()->GetAutoControlFocus() ) ); break; case SID_FM_OPEN_READONLY: - if (!m_bDesignMode || !GetFormModel()) + if (!GetFormModel()) rSet.DisableItem( nWhich ); else rSet.Put( SfxBoolItem(nWhich, GetFormModel()->GetOpenInDesignMode() ) ); diff --git a/svx/source/form/fmundo.cxx b/svx/source/form/fmundo.cxx index eee61c5c2dee..ecbfc8afbe1a 100644 --- a/svx/source/form/fmundo.cxx +++ b/svx/source/form/fmundo.cxx @@ -66,6 +66,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; @@ -88,7 +89,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 ) { } @@ -98,7 +101,7 @@ public: // XScriptListener virtual void SAL_CALL firing(const ScriptEvent& evt) throw(RuntimeException) { - setModel(); + attemptListenerCreation(); if ( m_vbaListener.is() ) { m_vbaListener->firing( evt ); @@ -107,7 +110,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 ); @@ -116,61 +119,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/inc/fmpgeimp.hxx b/svx/source/inc/fmpgeimp.hxx index 755c754853dc..9eb91c809d66 100644 --- a/svx/source/inc/fmpgeimp.hxx +++ b/svx/source/inc/fmpgeimp.hxx @@ -81,9 +81,10 @@ protected: public: FmFormPageImpl( FmFormPage& _rPage ); - FmFormPageImpl( FmFormPage& _rPage, const FmFormPageImpl& rImpl ); ~FmFormPageImpl(); + void initFrom( FmFormPageImpl& i_foreignImpl ); + // nur wichtig fuer den DesignMode void setCurForm(::com::sun::star::uno::Reference< ::com::sun::star::form::XForm> xForm); ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm> getDefaultForm(); @@ -135,6 +136,7 @@ public: void formObjectInserted( const FmFormObj& _object ); void formObjectRemoved( const FmFormObj& _object ); + void formModelAssigned( const FmFormObj& _object ); /** returns an object mapping from control models to drawing shapes. */ diff --git a/svx/source/mnuctrls/fntctl.cxx b/svx/source/mnuctrls/fntctl.cxx index 4f51e111c2c3..b10eac69bc54 100644..100755 --- a/svx/source/mnuctrls/fntctl.cxx +++ b/svx/source/mnuctrls/fntctl.cxx @@ -148,7 +148,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/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx index 5e225e626175..56f9a7bdaaf0 100755 --- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx @@ -57,8 +57,6 @@ #include <com/sun/star/container/XContainer.hpp> /** === end UNO includes === **/ -#include <toolkit/helper/formpdfexport.hxx> -#include <vcl/pdfextoutdevdata.hxx> #include <vcl/svapp.hxx> #include <vos/mutex.hxx> #include <comphelper/processfactory.hxx> @@ -69,7 +67,6 @@ #include <basegfx/matrix/b2dhommatrix.hxx> #include <drawinglayer/primitive2d/controlprimitive2d.hxx> -#include <boost/shared_ptr.hpp> #include <boost/bind.hpp> /* diff --git a/svx/source/stbctrls/pszctrl.cxx b/svx/source/stbctrls/pszctrl.cxx index 094cfbd96ee5..d1bc7d4d610e 100644 --- a/svx/source/stbctrls/pszctrl.cxx +++ b/svx/source/stbctrls/pszctrl.cxx @@ -78,7 +78,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 a951819104aa..82cd950bbbed 100644..100755 --- a/svx/source/svdraw/svdibrow.cxx +++ b/svx/source/svdraw/svdibrow.cxx @@ -1258,9 +1258,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 5328e5f1a3d1..30628a10df86 100644..100755 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -836,11 +836,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() ); } } @@ -854,29 +854,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/svdraw/svdouno.cxx b/svx/source/svdraw/svdouno.cxx index ed6c2170a5f2..cd32145c191d 100644 --- a/svx/source/svdraw/svdouno.cxx +++ b/svx/source/svdraw/svdouno.cxx @@ -318,68 +318,25 @@ void SdrUnoObj::operator = (const SdrObject& rObj) SdrRectObj::operator = (rObj); // release the reference to the current control model - SetUnoControlModel(uno::Reference< awt::XControlModel >()); + SetUnoControlModel( NULL ); - aUnoControlModelTypeName = ((SdrUnoObj&) rObj).aUnoControlModelTypeName; - aUnoControlTypeName = ((SdrUnoObj&) rObj).aUnoControlTypeName; + const SdrUnoObj& rUnoObj = dynamic_cast< const SdrUnoObj& >( rObj ); - // copy the uno control model - uno::Reference< awt::XControlModel > xCtrl( ((SdrUnoObj&) rObj).GetUnoControlModel(), uno::UNO_QUERY ); - uno::Reference< util::XCloneable > xClone( xCtrl, uno::UNO_QUERY ); + aUnoControlModelTypeName = rUnoObj.aUnoControlModelTypeName; + aUnoControlTypeName = rUnoObj.aUnoControlTypeName; - if ( xClone.is() ) - { - // copy the model by cloning - uno::Reference< awt::XControlModel > xNewModel( xClone->createClone(), uno::UNO_QUERY ); - DBG_ASSERT( xNewModel.is(), "SdrUnoObj::operator =, no control model!"); - xUnoControlModel = xNewModel; - } - else + // copy the uno control model + const uno::Reference< awt::XControlModel > xSourceControlModel( rUnoObj.GetUnoControlModel(), uno::UNO_QUERY ); + if ( xSourceControlModel.is() ) { - // copy the model by streaming - uno::Reference< io::XPersistObject > xObj( xCtrl, uno::UNO_QUERY ); - uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); - - if ( xObj.is() && xFactory.is() ) + try { - // creating a pipe - uno::Reference< io::XOutputStream > xOutPipe(xFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.io.Pipe")), uno::UNO_QUERY); - uno::Reference< io::XInputStream > xInPipe(xOutPipe, uno::UNO_QUERY); - - // creating the mark streams - uno::Reference< io::XInputStream > xMarkIn(xFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.io.MarkableInputStream")), uno::UNO_QUERY); - uno::Reference< io::XActiveDataSink > xMarkSink(xMarkIn, uno::UNO_QUERY); - - uno::Reference< io::XOutputStream > xMarkOut(xFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.io.MarkableOutputStream")), uno::UNO_QUERY); - uno::Reference< io::XActiveDataSource > xMarkSource(xMarkOut, uno::UNO_QUERY); - - // connect mark and sink - uno::Reference< io::XActiveDataSink > xSink(xFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.io.ObjectInputStream")), uno::UNO_QUERY); - - // connect mark and source - uno::Reference< io::XActiveDataSource > xSource(xFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.io.ObjectOutputStream")), uno::UNO_QUERY); - - uno::Reference< io::XObjectOutputStream > xOutStrm(xSource, uno::UNO_QUERY); - uno::Reference< io::XObjectInputStream > xInStrm(xSink, uno::UNO_QUERY); - - if (xMarkSink.is() && xMarkSource.is() && xSink.is() && xSource.is()) - { - xMarkSink->setInputStream(xInPipe); - xMarkSource->setOutputStream(xOutPipe); - xSink->setInputStream(xMarkIn); - xSource->setOutputStream(xMarkOut); - - // write the object to source - xOutStrm->writeObject(xObj); - xOutStrm->closeOutput(); - // read the object - uno::Reference< awt::XControlModel > xModel(xInStrm->readObject(), uno::UNO_QUERY); - xInStrm->closeInput(); - - DBG_ASSERT(xModel.is(), "SdrUnoObj::operator =, keine Model erzeugt"); - - xUnoControlModel = xModel; - } + uno::Reference< util::XCloneable > xClone( xSourceControlModel, uno::UNO_QUERY_THROW ); + xUnoControlModel.set( xClone->createClone(), uno::UNO_QUERY_THROW ); + } + catch( const uno::Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); } } diff --git a/svx/source/tbxctrls/itemwin.cxx b/svx/source/tbxctrls/itemwin.cxx index 76fd7d423324..7666c1064e15 100644 --- a/svx/source/tbxctrls/itemwin.cxx +++ b/svx/source/tbxctrls/itemwin.cxx @@ -491,7 +491,7 @@ SvxMetricField::SvxMetricField( SetLast( 5000 ); SetFirst( 0 ); - eDlgUnit = SfxModule::GetCurrentFieldUnit(); + eDlgUnit = SfxModule::GetModuleFieldUnit( mxFrame ); SetFieldUnit( *this, eDlgUnit, sal_False ); Show(); } @@ -576,7 +576,7 @@ void SvxMetricField::SetCoreUnit( SfxMapUnit eUnit ) void SvxMetricField::RefreshDlgUnit() { - FieldUnit eTmpUnit = SfxModule::GetCurrentFieldUnit(); + FieldUnit eTmpUnit = SfxModule::GetModuleFieldUnit( mxFrame ); if ( eDlgUnit != eTmpUnit ) { eDlgUnit = eTmpUnit; |