diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-05-24 15:21:22 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-05-24 15:24:48 +0100 |
commit | 1d95129bdc48cd93d1aba2591bdf87ee6ab7b296 (patch) | |
tree | 27be364440dfed7cecf60aa8d5befeef5ab961a5 /cui | |
parent | cdad97557a729ecbbe0236f7998647c5249a005f (diff) |
show the 'java' options page when java disabled
because there are now a bunch of unrelated to java things in there in its new
incarnation as the "advanced" tabpage
this removes the weird empty tabpage in options
in the java-disabled-at-build-time configuration
Change-Id: Ie59d8362d440c41e746b67a0195e4159848f162a
Diffstat (limited to 'cui')
-rw-r--r-- | cui/Library_cui.mk | 3 | ||||
-rw-r--r-- | cui/source/options/optjava.cxx | 68 | ||||
-rw-r--r-- | cui/source/options/optjava.hxx | 4 | ||||
-rw-r--r-- | cui/source/options/treeopt.cxx | 2 | ||||
-rw-r--r-- | cui/uiconfig/ui/optadvancedpage.ui | 2 |
5 files changed, 55 insertions, 24 deletions
diff --git a/cui/Library_cui.mk b/cui/Library_cui.mk index ade10e44f98f..fc27d59d53ea 100644 --- a/cui/Library_cui.mk +++ b/cui/Library_cui.mk @@ -146,8 +146,7 @@ $(eval $(call gb_Library_add_exception_objects,cui,\ cui/source/options/optHeaderTabListbox \ cui/source/options/opthtml \ cui/source/options/optinet2 \ - $(if $(filter TRUE,$(SOLAR_JAVA)), \ - cui/source/options/optjava) \ + cui/source/options/optjava \ cui/source/options/optjsearch \ cui/source/options/optlingu \ cui/source/options/optmemory \ diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx index 1c03981a794d..50428e3428ea 100644 --- a/cui/source/options/optjava.cxx +++ b/cui/source/options/optjava.cxx @@ -43,7 +43,9 @@ #include <com/sun/star/ui/dialogs/TemplateDescription.hpp> #include <com/sun/star/ui/dialogs/FolderPicker.hpp> #include <com/sun/star/ucb/XContentProvider.hpp> +#ifdef SOLAR_JAVA #include <jvmfwk/framework.h> +#endif // define ---------------------------------------------------------------- @@ -180,7 +182,11 @@ SvxJavaOptionsPage::SvxJavaOptionsPage( Window* pParent, const SfxItemSet& rSet xDialogListener->SetDialogClosedLink( LINK( this, SvxJavaOptionsPage, DialogClosedHdl ) ); EnableHdl_Impl(m_pJavaEnableCB); +#ifdef SOLAR_JAVA jfw_lock(); +#else + get<Window>("javaframe")->Disable(); +#endif } // ----------------------------------------------------------------------- @@ -191,6 +197,7 @@ SvxJavaOptionsPage::~SvxJavaOptionsPage() delete m_pParamDlg; delete m_pPathDlg; ClearJavaInfo(); +#ifdef SOLAR_JAVA std::vector< JavaInfo* >::iterator pIter; for ( pIter = m_aAddedInfos.begin(); pIter != m_aAddedInfos.end(); ++pIter ) { @@ -199,6 +206,7 @@ SvxJavaOptionsPage::~SvxJavaOptionsPage() } jfw_unlock(); +#endif } // ----------------------------------------------------------------------- @@ -269,6 +277,7 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, AddHdl_Impl) IMPL_LINK_NOARG(SvxJavaOptionsPage, ParameterHdl_Impl) { +#ifdef SOLAR_JAVA Sequence< OUString > aParameterList; if ( !m_pParamDlg ) { @@ -309,7 +318,7 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, ParameterHdl_Impl) } else m_pParamDlg->SetParameters( aParameterList ); - +#endif return 0; } @@ -317,6 +326,7 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, ParameterHdl_Impl) IMPL_LINK_NOARG(SvxJavaOptionsPage, ClassPathHdl_Impl) { +#ifdef SOLAR_JAVA String sClassPath; if ( !m_pPathDlg ) @@ -353,7 +363,7 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, ClassPathHdl_Impl) } else m_pPathDlg->SetClassPath( sClassPath ); - +#endif return 0; } @@ -402,6 +412,7 @@ IMPL_LINK( SvxJavaOptionsPage, DialogClosedHdl, DialogClosedEvent*, pEvt ) void SvxJavaOptionsPage::ClearJavaInfo() { +#ifdef SOLAR_JAVA if ( m_parJavaInfo ) { JavaInfo** parInfo = m_parJavaInfo; @@ -415,6 +426,7 @@ void SvxJavaOptionsPage::ClearJavaInfo() m_parJavaInfo = NULL; m_nInfoSize = 0; } +#endif } // ----------------------------------------------------------------------- @@ -435,6 +447,7 @@ void SvxJavaOptionsPage::ClearJavaList() void SvxJavaOptionsPage::LoadJREs() { +#ifdef SOLAR_JAVA WaitObject aWaitObj(m_pJavaList); javaFrameworkError eErr = jfw_findAllJREs( &m_parJavaInfo, &m_nInfoSize ); if ( JFW_E_NONE == eErr && m_parJavaInfo ) @@ -473,12 +486,14 @@ void SvxJavaOptionsPage::LoadJREs() } jfw_freeJavaInfo( pSelectedJava ); +#endif } // ----------------------------------------------------------------------- void SvxJavaOptionsPage::AddJRE( JavaInfo* _pInfo ) { +#ifdef SOLAR_JAVA OUStringBuffer sEntry; sEntry.append('\t'); sEntry.append(_pInfo->sVendor); @@ -491,6 +506,9 @@ void SvxJavaOptionsPage::AddJRE( JavaInfo* _pInfo ) INetURLObject aLocObj( OUString( _pInfo->sLocation ) ); String* pLocation = new String( aLocObj.getFSysPath( INetURLObject::FSYS_DETECT ) ); pEntry->SetUserData( pLocation ); +#else + (void)_pInfo; +#endif } // ----------------------------------------------------------------------- @@ -519,6 +537,7 @@ void SvxJavaOptionsPage::HandleCheckEntry( SvTreeListEntry* _pEntry ) void SvxJavaOptionsPage::AddFolder( const OUString& _rFolder ) { +#ifdef SOLAR_JAVA bool bStartAgain = true; JavaInfo* pInfo = NULL; javaFrameworkError eErr = jfw_getJavaInfoByPath( _rFolder.pData, &pInfo ); @@ -584,6 +603,9 @@ void SvxJavaOptionsPage::AddFolder( const OUString& _rFolder ) xFolderPicker->setDisplayDirectory( _rFolder ); Application::PostUserEvent( LINK( this, SvxJavaOptionsPage, StartFolderPickerHdl ) ); } +#else + (void)_rFolder; +#endif } // ----------------------------------------------------------------------- @@ -598,23 +620,6 @@ SfxTabPage* SvxJavaOptionsPage::Create( Window* pParent, const SfxItemSet& rAttr sal_Bool SvxJavaOptionsPage::FillItemSet( SfxItemSet& /*rCoreSet*/ ) { sal_Bool bModified = sal_False; - javaFrameworkError eErr = JFW_E_NONE; - if ( m_pParamDlg ) - { - Sequence< OUString > aParamList = m_pParamDlg->GetParameters(); - sal_Int32 i, nSize = aParamList.getLength(); - rtl_uString** pParamArr = (rtl_uString**)rtl_allocateMemory( sizeof(rtl_uString*) * nSize ); - rtl_uString** pParamArrIter = pParamArr; - const OUString* pList = aParamList.getConstArray(); - for ( i = 0; i < nSize; ++i ) - pParamArr[i] = pList[i].pData; - eErr = jfw_setVMParameters( pParamArrIter, nSize ); - DBG_ASSERT( JFW_E_NONE == eErr, - "SvxJavaOptionsPage::FillItemSet(): error in jfw_setVMParameters" ); - pParamArrIter = pParamArr; - rtl_freeMemory( pParamArr ); - bModified = sal_True; - } if ( m_pExperimentalCB->IsChecked() != m_pExperimentalCB->GetSavedValue() ) { @@ -637,6 +642,25 @@ sal_Bool SvxJavaOptionsPage::FillItemSet( SfxItemSet& /*rCoreSet*/ ) bModified = sal_True; } +#ifdef SOLAR_JAVA + javaFrameworkError eErr = JFW_E_NONE; + if ( m_pParamDlg ) + { + Sequence< OUString > aParamList = m_pParamDlg->GetParameters(); + sal_Int32 i, nSize = aParamList.getLength(); + rtl_uString** pParamArr = (rtl_uString**)rtl_allocateMemory( sizeof(rtl_uString*) * nSize ); + rtl_uString** pParamArrIter = pParamArr; + const OUString* pList = aParamList.getConstArray(); + for ( i = 0; i < nSize; ++i ) + pParamArr[i] = pList[i].pData; + eErr = jfw_setVMParameters( pParamArrIter, nSize ); + DBG_ASSERT( JFW_E_NONE == eErr, + "SvxJavaOptionsPage::FillItemSet(): error in jfw_setVMParameters" ); + pParamArrIter = pParamArr; + rtl_freeMemory( pParamArr ); + bModified = sal_True; + } + if ( m_pPathDlg ) { OUString sPath( m_pPathDlg->GetClassPath() ); @@ -700,6 +724,7 @@ sal_Bool SvxJavaOptionsPage::FillItemSet( SfxItemSet& /*rCoreSet*/ ) "SvxJavaOptionsPage::FillItemSet(): error in jfw_setEnabled" ); bModified = sal_True; } +#endif return bModified; } @@ -713,12 +738,17 @@ void SvxJavaOptionsPage::Reset( const SfxItemSet& /*rSet*/ ) SvtMiscOptions aMiscOpt; +#ifdef SOLAR_JAVA sal_Bool bEnabled = sal_False; javaFrameworkError eErr = jfw_getEnabled( &bEnabled ); if ( eErr != JFW_E_NONE ) bEnabled = sal_False; m_pJavaEnableCB->Check( bEnabled ); EnableHdl_Impl(m_pJavaEnableCB); +#else + m_pJavaEnableCB->Check( false ); + m_pJavaEnableCB->Disable(); +#endif m_pExperimentalCB->Check( aMiscOpt.IsExperimentalMode() ); m_pExperimentalCB->SaveValue(); diff --git a/cui/source/options/optjava.hxx b/cui/source/options/optjava.hxx index b3e9c8ef3dad..5a60ecd24a3b 100644 --- a/cui/source/options/optjava.hxx +++ b/cui/source/options/optjava.hxx @@ -32,7 +32,11 @@ // forward --------------------------------------------------------------- +#ifdef SOLAR_JAVA typedef struct _JavaInfo JavaInfo; +#else +typedef void* JavaInfo; +#endif class SvxJavaParameterDlg; class SvxJavaClassPathDlg; diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index ac4ab975746a..33f2b7918b4a 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -314,9 +314,7 @@ SfxTabPage* CreateGeneralTabPage( sal_uInt16 nId, Window* pParent, const SfxItem case RID_SVXPAGE_ACCESSIBILITYCONFIG: fnCreate = &SvxAccessibilityOptionsTabPage::Create; break; case RID_SVXPAGE_OPTIONS_CTL: fnCreate = &SvxCTLOptionsPage::Create ; break; case RID_SVXPAGE_INET_MOZPLUGIN: fnCreate = &MozPluginTabPage::Create; break; -#ifdef SOLAR_JAVA case RID_SVXPAGE_OPTIONS_JAVA: fnCreate = &SvxJavaOptionsPage::Create ; break; -#endif case RID_SVXPAGE_ONLINEUPDATE: fnCreate = &SvxOnlineUpdateTabPage::Create; break; case RID_OPTPAGE_CHART_DEFCOLORS: fnCreate = &SvxDefaultColorOptPage::Create; break; } diff --git a/cui/uiconfig/ui/optadvancedpage.ui b/cui/uiconfig/ui/optadvancedpage.ui index 1c5449738d7c..02415e41326c 100644 --- a/cui/uiconfig/ui/optadvancedpage.ui +++ b/cui/uiconfig/ui/optadvancedpage.ui @@ -8,7 +8,7 @@ <property name="orientation">vertical</property> <property name="spacing">18</property> <child> - <object class="GtkFrame" id="frame1"> + <object class="GtkFrame" id="javaframe"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="hexpand">True</property> |