diff options
-rw-r--r-- | officecfg/registry/schema/org/openoffice/Office/Logging.xcs | 7 | ||||
-rw-r--r-- | svx/source/dialog/treeopt.cxx | 64 |
2 files changed, 42 insertions, 29 deletions
diff --git a/officecfg/registry/schema/org/openoffice/Office/Logging.xcs b/officecfg/registry/schema/org/openoffice/Office/Logging.xcs index d303c1c988c2..5c2f2f1b4f01 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Logging.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Logging.xcs @@ -89,11 +89,10 @@ </info> <prop oor:name="EnablingAllowed" oor:type="xs:boolean"> <info> - <desc>if true and the OOoImprovement Extension is installed, userinterface events (clicks on toolbars and menus for - example) will get logged in a CSV-File. Sending these files to the - OpenOffice.org team helps optimizing the user experience.</desc> + <desc>only if this is true, usage tracking is allowed and its options will be shown + </desc> </info> - <value>true</value> + <value>false</value> </prop> <prop oor:name="LogPath" oor:type="xs:string"> <info> diff --git a/svx/source/dialog/treeopt.cxx b/svx/source/dialog/treeopt.cxx index ba36428e2cd5..7b13286ebd36 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 ); } } |