summaryrefslogtreecommitdiff
path: root/svx/source/dialog/treeopt.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/dialog/treeopt.cxx')
-rw-r--r--svx/source/dialog/treeopt.cxx64
1 files changed, 39 insertions, 25 deletions
diff --git a/svx/source/dialog/treeopt.cxx b/svx/source/dialog/treeopt.cxx
index e79abcbf23..b51492a22b 100644
--- a/svx/source/dialog/treeopt.cxx
+++ b/svx/source/dialog/treeopt.cxx
@@ -55,6 +55,7 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/oooimprovement/XCoreController.hpp>
#include <comphelper/configurationhelper.hxx>
#include <com/sun/star/awt/XDialogProvider.hpp>
#include <com/sun/star/awt/XDialogProvider2.hpp>
@@ -1892,18 +1893,15 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
for ( i = 1; i < nEnd; ++i )
{
- bool bImprovePage = false;
+ String sNewTitle = rGeneralArray.GetString(i);
nPageId = (sal_uInt16)rGeneralArray.GetValue(i);
if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
continue;
// Disable Online Update page if service not installed
- if( RID_SVXPAGE_ONLINEUPDATE == nPageId || RID_SVXPAGE_IMPROVEMENT == nPageId )
+ if( RID_SVXPAGE_ONLINEUPDATE == nPageId )
{
- bImprovePage = ( RID_SVXPAGE_IMPROVEMENT == nPageId );
- ::rtl::OUString sService = bImprovePage ?
- C2U("com.sun.star.oooimprovement.CoreController") :
- C2U("com.sun.star.setup.UpdateCheck");
+ const ::rtl::OUString sService = C2U("com.sun.star.setup.UpdateCheck");
try
{
@@ -1917,33 +1915,49 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
{
continue;
}
+ }
+ // Disable OOoImprovement page if not enabled
+ if( RID_SVXPAGE_IMPROVEMENT == nPageId )
+ {
+ const ::rtl::OUString sService = C2U("com.sun.star.oooimprovement.CoreController");
+
+ try
+ {
+ Reference < XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
+ Reference < ::com::sun::star::oooimprovement::XCoreController > xService( xFactory->createInstance( sService ), UNO_QUERY );
+
+ if( ! xService.is() )
+ continue;
+ if( ! xService->showBuiltinOptionsPage(1))
+ continue;
+ }
+ catch ( ::com::sun::star::loader::CannotActivateFactoryException& )
+ {
+ continue;
+ }
- if ( bImprovePage )
+ SvxEmptyPage* pTempPage = new SvxEmptyPage( this );
+ sPageTitle = pTempPage->GetText();
+ delete pTempPage;
+ xub_StrLen nPos = sPageTitle.Search( rGeneralArray.GetString(0) );
+ if ( nPos != STRING_NOTFOUND )
{
- SvxEmptyPage* pTempPage = new SvxEmptyPage( this );
- sPageTitle = pTempPage->GetText();
- delete pTempPage;
- xub_StrLen nPos = sPageTitle.Search( rGeneralArray.GetString(0) );
- if ( nPos != STRING_NOTFOUND )
+ xub_StrLen nLen = rGeneralArray.GetString(0).Len();
+ if ( sPageTitle.GetChar( nPos + nLen ) == ' ' )
+ nLen++;
+ else if ( nPos + nLen == sPageTitle.Len() &&
+ sPageTitle.GetChar( nPos + nLen ) == ' ' )
{
- xub_StrLen nLen = rGeneralArray.GetString(0).Len();
- if ( sPageTitle.GetChar( nPos + nLen ) == ' ' )
- nLen++;
- else if ( nPos + nLen == sPageTitle.Len() &&
- sPageTitle.GetChar( nPos + nLen ) == ' ' )
- {
- nPos++;
- nLen++;
- }
- sPageTitle.Erase( nPos, nLen );
+ nPos++;
+ nLen++;
}
+ sPageTitle.Erase( nPos, nLen );
}
+ if(sPageTitle.Len() > 0)
+ sNewTitle = sPageTitle;
}
-
if ( nPageId != RID_SVXPAGE_SSO || isSSOEnabled )
{
- String sNewTitle =
- ( bImprovePage && sPageTitle.Len() > 0 ) ? sPageTitle : rGeneralArray.GetString(i);
AddTabPage( nPageId, sNewTitle, nGroup );
}
}