diff options
author | Matúš Kukan <matus.kukan@gmail.com> | 2011-12-21 01:42:15 +0100 |
---|---|---|
committer | Matúš Kukan <matus.kukan@gmail.com> | 2011-12-21 12:32:12 +0100 |
commit | d73d329bf1a114bb5e26742245aac9abb6dae269 (patch) | |
tree | 797ab55a99fa12dfbd486aaf6d7b4772f1c95f08 /cui | |
parent | 070eff8cf1ad7763b8b730336f11032893b77049 (diff) |
callcatcher: remove unused classes
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/dialogs/insdlg.cxx | 188 | ||||
-rw-r--r-- | cui/source/inc/insdlg.hxx | 38 |
2 files changed, 0 insertions, 226 deletions
diff --git a/cui/source/dialogs/insdlg.cxx b/cui/source/dialogs/insdlg.cxx index 2a0bb9add7fd..06f57771005c 100644 --- a/cui/source/dialogs/insdlg.cxx +++ b/cui/source/dialogs/insdlg.cxx @@ -539,194 +539,6 @@ short SvInsertPlugInDialog::Execute() return nRet; } -// class SvInsertAppletDlg ----------------------------------------------- - -IMPL_LINK( SvInsertAppletDialog, BrowseHdl, PushButton *, EMPTYARG ) -{ - Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); - if( xFactory.is() ) - { - Reference< XFilePicker > xFilePicker( xFactory->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilePicker" ) ) ), UNO_QUERY ); - DBG_ASSERT( xFilePicker.is(), "could not get FilePicker service" ); - - Reference< XInitialization > xInit( xFilePicker, UNO_QUERY ); - Reference< XFilterManager > xFilterMgr( xFilePicker, UNO_QUERY ); - if( xInit.is() && xFilePicker.is() && xFilterMgr.is() ) - { - Sequence< Any > aServiceType( 1 ); - aServiceType[0] <<= TemplateDescription::FILEOPEN_SIMPLE; - xInit->initialize( aServiceType ); - - // add filter - try - { - xFilterMgr->appendFilter( - OUString( RTL_CONSTASCII_USTRINGPARAM( "Applet" ) ), - OUString( RTL_CONSTASCII_USTRINGPARAM( "*.class" ) ) - ); - } - catch( IllegalArgumentException& ) - { - DBG_ASSERT( 0, "caught IllegalArgumentException when registering filter\n" ); - } - - if( xFilePicker->execute() == ExecutableDialogResults::OK ) - { - Sequence< OUString > aPathSeq( xFilePicker->getFiles() ); - - INetURLObject aObj( aPathSeq[0] ); - aEdClassfile.SetText( aObj.getName() ); - aObj.removeSegment(); - aEdClasslocation.SetText( aObj.PathToFileName() ); - } - } - } - - return 0; -} - -// ----------------------------------------------------------------------- - -SvInsertAppletDialog::SvInsertAppletDialog( Window* pParent, const uno::Reference < embed::XStorage >& xStorage ) - : InsertObjectDialog_Impl( pParent, CUI_RES( MD_INSERT_OBJECT_APPLET ), xStorage ), - aFtClassfile( this, CUI_RES( FT_CLASSFILE ) ), - aEdClassfile( this, CUI_RES( ED_CLASSFILE ) ), - aFtClasslocation( this, CUI_RES( FT_CLASSLOCATION ) ), - aEdClasslocation( this, CUI_RES( ED_CLASSLOCATION ) ), - aBtnClass( this, CUI_RES( BTN_CLASS ) ), - aGbClass( this, CUI_RES( GB_CLASS ) ), - aEdAppletOptions( this, CUI_RES( ED_APPLET_OPTIONS ) ), - aGbAppletOptions( this, CUI_RES( GB_APPLET_OPTIONS ) ), - aOKButton1( this, CUI_RES( 1 ) ), - aCancelButton1( this, CUI_RES( 1 ) ), - aHelpButton1( this, CUI_RES( 1 ) ), - m_pURL(0) -{ - FreeResource(); - aBtnClass.SetClickHdl( LINK( this, SvInsertAppletDialog, BrowseHdl ) ); -} - -SvInsertAppletDialog::SvInsertAppletDialog( Window* pParent, const uno::Reference < embed::XEmbeddedObject >& xObj ) - : InsertObjectDialog_Impl( pParent, CUI_RES( MD_INSERT_OBJECT_APPLET ), uno::Reference < embed::XStorage >() ), - aFtClassfile( this, CUI_RES( FT_CLASSFILE ) ), - aEdClassfile( this, CUI_RES( ED_CLASSFILE ) ), - aFtClasslocation( this, CUI_RES( FT_CLASSLOCATION ) ), - aEdClasslocation( this, CUI_RES( ED_CLASSLOCATION ) ), - aBtnClass( this, CUI_RES( BTN_CLASS ) ), - aGbClass( this, CUI_RES( GB_CLASS ) ), - aEdAppletOptions( this, CUI_RES( ED_APPLET_OPTIONS ) ), - aGbAppletOptions( this, CUI_RES( GB_APPLET_OPTIONS ) ), - aOKButton1( this, CUI_RES( 1 ) ), - aCancelButton1( this, CUI_RES( 1 ) ), - aHelpButton1( this, CUI_RES( 1 ) ), - m_pURL(0) -{ - m_xObj = xObj; - FreeResource(); - aBtnClass.SetClickHdl( LINK( this, SvInsertAppletDialog, BrowseHdl ) ); -} - - -SvInsertAppletDialog::~SvInsertAppletDialog() -{ - delete m_pURL; -} - -short SvInsertAppletDialog::Execute() -{ - short nRet = RET_OK; - m_aClass.Erase(); - m_aCommands.Erase(); - - sal_Bool bOK = sal_False; - uno::Reference < beans::XPropertySet > xSet; - if ( m_xObj.is() ) - { - try - { - if ( m_xObj->getCurrentState() == embed::EmbedStates::LOADED ) - m_xObj->changeState( embed::EmbedStates::RUNNING ); - xSet = uno::Reference < beans::XPropertySet >( m_xObj->getComponent(), uno::UNO_QUERY ); - ::rtl::OUString aStr; - uno::Any aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AppletCode") ) ); - if ( aAny >>= aStr ) - SetClass( aStr ); - aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AppletCodeBase") ) ); - if ( aAny >>= aStr ) - SetClassLocation( aStr ); - uno::Sequence< beans::PropertyValue > aCommands; - aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AppletCommands") ) ); - if ( aAny >>= aCommands ) - { - SvCommandList aList; - aList.FillFromSequence( aCommands ); - SetAppletOptions( aList.GetCommands() ); - } - - String aText( CUI_RES( STR_EDIT_APPLET ) ); - SetText( aText ); - bOK = sal_True; - } - catch ( uno::Exception& ) - { - OSL_FAIL( "No Applet!" ); - } - } - else - { - DBG_ASSERT( m_xStorage.is(), "No storage!"); - bOK = m_xStorage.is(); - } - - if ( bOK && ( nRet = Dialog::Execute() ) == RET_OK ) - { - if ( !m_xObj.is() ) - { - ::rtl::OUString aName; - SvGlobalName aClassId( SO3_APPLET_CLASSID ); - m_xObj = aCnt.CreateEmbeddedObject( aClassId.GetByteSequence(), aName ); - if ( m_xObj->getCurrentState() == embed::EmbedStates::LOADED ) - m_xObj->changeState( embed::EmbedStates::RUNNING ); - xSet = uno::Reference < beans::XPropertySet >( m_xObj->getComponent(), uno::UNO_QUERY ); - } - - if ( m_xObj.is() ) - { - try - { - sal_Bool bIPActive = m_xObj->getCurrentState() == embed::EmbedStates::INPLACE_ACTIVE; - if ( bIPActive ) - m_xObj->changeState( embed::EmbedStates::RUNNING ); - - String aClassLocation = GetClassLocation(); - - // Hack, aFileName wird auch fuer Class benutzt - m_aClass = GetClass(); - xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AppletCode") ), makeAny( ::rtl::OUString( m_aClass ) ) ); - - ::rtl::OUString tmp = aClassLocation; - ::osl::File::getFileURLFromSystemPath(tmp, tmp); - aClassLocation = tmp; - xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AppletCodeBase") ), makeAny( tmp ) ); - m_aCommands = GetAppletOptions(); - - uno::Sequence< beans::PropertyValue > aCommandSequence; - Plugin_ImplFillCommandSequence( m_aCommands, aCommandSequence ); - xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AppletCommands") ), makeAny( aCommandSequence ) ); - - if ( bIPActive ) - m_xObj->changeState( embed::EmbedStates::INPLACE_ACTIVE ); - } - catch ( uno::Exception& ) - { - OSL_FAIL( "No Applet!" ); - } - } - } - - return nRet; -} - SfxInsertFloatingFrameDialog::SfxInsertFloatingFrameDialog( Window *pParent, const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage ) : InsertObjectDialog_Impl( pParent, CUI_RES( MD_INSERT_OBJECT_IFRAME ), xStorage ) diff --git a/cui/source/inc/insdlg.hxx b/cui/source/inc/insdlg.hxx index 8cbc141b8b88..4f323b5bbb3d 100644 --- a/cui/source/inc/insdlg.hxx +++ b/cui/source/inc/insdlg.hxx @@ -127,44 +127,6 @@ public: virtual short Execute(); }; -// class SvInsertAppletDialog -------------------------------------------- - -class SvInsertAppletDialog : public InsertObjectDialog_Impl -{ -private: - FixedText aFtClassfile; - Edit aEdClassfile; - FixedText aFtClasslocation; - Edit aEdClasslocation; - PushButton aBtnClass; - FixedLine aGbClass; - MultiLineEdit aEdAppletOptions; - FixedLine aGbAppletOptions; - OKButton aOKButton1; - CancelButton aCancelButton1; - HelpButton aHelpButton1; - INetURLObject* m_pURL; - String m_aClass; - String m_aCommands; - String GetClass() const { return aEdClassfile.GetText(); } - String GetClassLocation() const { return aEdClasslocation.GetText(); } - String GetAppletOptions() const { return aEdAppletOptions.GetText(); } - - void SetClass( const String &rClass ) { aEdClassfile.SetText(rClass); } - void SetClassLocation( const String &rLocation ) { aEdClasslocation.SetText(rLocation); } - void SetAppletOptions( const String &rOptions ) { aEdAppletOptions.SetText(rOptions); } - DECL_LINK( BrowseHdl, PushButton * ); - -public: - SvInsertAppletDialog( Window* pParent, - const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage ); - SvInsertAppletDialog( Window* pParent, - const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject >& xObj ); - ~SvInsertAppletDialog(); - - virtual short Execute(); -}; - class SfxInsertFloatingFrameDialog : public InsertObjectDialog_Impl { private: |