summaryrefslogtreecommitdiff
path: root/sfx2/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-06-06 14:20:21 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-06-06 14:52:49 +0100
commit516ed22b3f51982df7dbfa875ce8056e167da091 (patch)
tree1289a749232332299b693d006392a78dc1c1e8ca /sfx2/source
parent35a65baefe99181685aea8e630d27c5e2a7c6bc4 (diff)
Remove remnants of help agent
it was removed with 66714f1888eaccef4eb5341971278ae7dfafa16b but gobs of code (and UI) still existed to collect the help id and give it to the missing help agent with various UI visible options and buttons to control the help agent which isn't there Change-Id: I625da27b3046d481e43f4d35d32cc7063a1c6291
Diffstat (limited to 'sfx2/source')
-rw-r--r--sfx2/source/appl/appcfg.cxx24
-rw-r--r--sfx2/source/appl/appserv.cxx19
-rw-r--r--sfx2/source/appl/sfxhelp.cxx162
-rw-r--r--sfx2/source/control/dispatch.cxx10
-rw-r--r--sfx2/source/dialog/basedlgs.cxx20
-rw-r--r--sfx2/source/dialog/dockwin.cxx11
-rw-r--r--sfx2/source/dialog/tabdlg.cxx23
-rw-r--r--sfx2/source/doc/objserv.cxx12
-rw-r--r--sfx2/source/doc/objxtor.cxx7
-rw-r--r--sfx2/source/view/frame2.cxx12
10 files changed, 4 insertions, 296 deletions
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx
index 03aaf69c2e0b..8b0022aec34c 100644
--- a/sfx2/source/appl/appcfg.cxx
+++ b/sfx2/source/appl/appcfg.cxx
@@ -270,16 +270,6 @@ sal_Bool SfxApplication::GetOptions( SfxItemSet& rSet )
aHelpOptions.IsHelpTips() ) ) )
bRet = sal_True;
break;
- case SID_ATTR_AUTOHELPAGENT :
- if(rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_ATTR_AUTOHELPAGENT ),
- aHelpOptions.IsHelpAgentAutoStartMode() ) ) )
- bRet = sal_True;
- break;
- case SID_HELPAGENT_TIMEOUT :
- if ( rSet.Put( SfxInt32Item( rPool.GetWhich( SID_HELPAGENT_TIMEOUT ),
- aHelpOptions.GetHelpAgentTimeoutPeriod() ) ) )
- bRet = sal_True;
- break;
case SID_ATTR_WELCOMESCREEN :
if(rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_ATTR_WELCOMESCREEN ),
aHelpOptions.IsWelcomeScreen() ) ) )
@@ -638,20 +628,6 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
aHelpOptions.SetHelpTips(((const SfxBoolItem *)pItem)->GetValue());
}
- // AutoHelpAgent
- if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOHELPAGENT ), sal_True, &pItem))
- {
- DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
- aHelpOptions.SetHelpAgentAutoStartMode( ((const SfxBoolItem *)pItem)->GetValue() );
- }
-
- // help agent timeout
- if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_HELPAGENT_TIMEOUT ), sal_True, &pItem ) )
- {
- DBG_ASSERT(pItem->ISA(SfxInt32Item), "Int32Item expected");
- aHelpOptions.SetHelpAgentTimeoutPeriod( ( (const SfxInt32Item*)pItem )->GetValue() );
- }
-
// WelcomeScreen
if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_WELCOMESCREEN ), sal_True, &pItem))
{
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 825125d0d48f..8914037f0ec3 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -528,20 +528,6 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- case SID_HELP_PI:
- {
- SvtHelpOptions aHelpOpt;
- SFX_REQUEST_ARG(rReq, pOnItem, SfxBoolItem, SID_HELP_PI, sal_False);
- sal_Bool bOn = pOnItem
- ? ((SfxBoolItem*)pOnItem)->GetValue()
- : !aHelpOpt.IsHelpAgentAutoStartMode();
- aHelpOpt.SetHelpAgentAutoStartMode( bOn );
- Invalidate(SID_HELP_PI);
- bDone = true;
- break;
- }
-
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
case SID_ABOUT:
{
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
@@ -766,11 +752,6 @@ void SfxApplication::MiscState_Impl(SfxItemSet &rSet)
rSet.Put( SfxBoolItem( SID_HELPBALLOONS, Help::IsBalloonHelpEnabled() ) );
}
break;
- case SID_HELP_PI:
- {
- rSet.Put( SfxBoolItem( SID_HELP_PI, SvtHelpOptions().IsHelpAgentAutoStartMode() ) );
- }
- break;
case SID_EXTENDEDHELP:
{
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index 0d35063ecba8..cd0676159005 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -96,8 +96,6 @@ void NoHelpErrorBox::RequestHelp( const HelpEvent& )
// do nothing, because no help available
}
-#define STARTERLIST 0
-
static bool impl_hasHelpInstalled( const OUString &rLang );
/// Return the locale we prefer for displaying help
@@ -200,115 +198,12 @@ sal_Bool GetHelpAnchor_Impl( const OUString& _rURL, OUString& _rAnchor )
return bRet;
}
-class SfxHelpOptions_Impl : public utl::ConfigItem
-{
-private:
- std::set < OString > m_aIds;
-
-public:
- SfxHelpOptions_Impl();
- ~SfxHelpOptions_Impl();
-
- bool HasId( const OString& rId ) { return m_aIds.size() ? m_aIds.find( rId ) != m_aIds.end() : false; }
- virtual void Notify( const com::sun::star::uno::Sequence< OUString >& aPropertyNames );
- virtual void Commit();
-};
-
-static Sequence< OUString > GetPropertyNames()
-{
- Sequence< OUString > aNames( 1 );
- OUString* pNames = aNames.getArray();
- pNames[0] = OUString( "HelpAgentStarterList" );
-
- return aNames;
-}
-
-SfxHelpOptions_Impl::SfxHelpOptions_Impl()
- : ConfigItem( OUString("Office.SFX/Help") )
-{
- Sequence< OUString > aNames = GetPropertyNames();
- Sequence< Any > aValues = GetProperties( aNames );
- EnableNotification( aNames );
- const Any* pValues = aValues.getConstArray();
- DBG_ASSERT( aValues.getLength() == aNames.getLength(), "GetProperties failed" );
- if ( aValues.getLength() == aNames.getLength() )
- {
- for ( int nProp = 0; nProp < aNames.getLength(); nProp++ )
- {
- DBG_ASSERT( pValues[nProp].hasValue(), "property value missing" );
- if ( pValues[nProp].hasValue() )
- {
- switch ( nProp )
- {
- case STARTERLIST :
- {
- OUString aCodedList;
- if ( pValues[nProp] >>= aCodedList )
- {
- OString aTmp(
- OUStringToOString(
- aCodedList, RTL_TEXTENCODING_UTF8));
- sal_Int32 nIndex = 0;
- do
- {
- OString aToken = aTmp.getToken( 0, ',', nIndex );
- if ( !aToken.isEmpty() )
- m_aIds.insert( aToken );
- }
- while ( nIndex >= 0 );
- }
- else {
- SAL_WARN( "sfx2.appl", "Wrong property type!" );
- }
-
- break;
- }
-
- default:
- SAL_WARN( "sfx2.appl", "Wrong property!" );
- break;
- }
- }
- }
- }
-}
-
-SfxHelpOptions_Impl::~SfxHelpOptions_Impl()
-{
-}
-
-
-void SfxHelpOptions_Impl::Notify( const com::sun::star::uno::Sequence< OUString >& )
-{
-}
-
-void SfxHelpOptions_Impl::Commit()
-{
-}
-
class SfxHelp_Impl
{
-private:
- SfxHelpOptions_Impl* m_pOpt; // the options
-
public:
- SfxHelp_Impl();
- ~SfxHelp_Impl();
-
- SfxHelpOptions_Impl* GetOptions();
- static OUString GetHelpText( const OUString& aCommandURL, const OUString& rModule );
+ static OUString GetHelpText( const OUString& aCommandURL, const OUString& rModule );
};
-SfxHelp_Impl::SfxHelp_Impl() :
- m_pOpt ( NULL )
-{
-}
-
-SfxHelp_Impl::~SfxHelp_Impl()
-{
- delete m_pOpt;
-}
-
OUString SfxHelp_Impl::GetHelpText( const OUString& aCommandURL, const OUString& rModule )
{
// create help url
@@ -322,14 +217,6 @@ OUString SfxHelp_Impl::GetHelpText( const OUString& aCommandURL, const OUString&
return SfxContentHelper::GetActiveHelpString( aHelpURL.makeStringAndClear() );
}
-SfxHelpOptions_Impl* SfxHelp_Impl::GetOptions()
-{
- // create if not exists
- if ( !m_pOpt )
- m_pOpt = new SfxHelpOptions_Impl;
- return m_pOpt;
-}
-
SfxHelp::SfxHelp() :
bIsDebug( sal_False ),
pImp ( NULL )
@@ -581,7 +468,7 @@ SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame2 >& rHelpTask ,
OUString SfxHelp::GetHelpText( const OUString& aCommandURL, const Window* pWindow )
{
OUString sModuleName = GetHelpModuleName_Impl();
- OUString sHelpText = pImp->GetHelpText( aCommandURL, sModuleName );
+ OUString sHelpText = SfxHelp_Impl::GetHelpText( aCommandURL, sModuleName );
OString aNewHelpId;
@@ -592,7 +479,7 @@ OUString SfxHelp::GetHelpText( const OUString& aCommandURL, const Window* pWindo
while ( pParent )
{
aNewHelpId = pParent->GetHelpId();
- sHelpText = pImp->GetHelpText( OStringToOUString(aNewHelpId, RTL_TEXTENCODING_UTF8), sModuleName );
+ sHelpText = SfxHelp_Impl::GetHelpText( OStringToOUString(aNewHelpId, RTL_TEXTENCODING_UTF8), sModuleName );
if (!sHelpText.isEmpty())
pParent = NULL;
else
@@ -793,49 +680,6 @@ OUString SfxHelp::CreateHelpURL(const OUString& aCommandURL, const OUString& rMo
return pHelp ? pHelp->CreateHelpURL_Impl( aCommandURL, rModuleName ) : OUString();
}
-void SfxHelp::OpenHelpAgent( SfxFrame*, const OString& sHelpId )
-{
- SfxHelp* pHelp = (static_cast< SfxHelp* >(Application::GetHelp()) );
- if ( pHelp )
- pHelp->OpenHelpAgent( sHelpId );
-}
-
-void SfxHelp::OpenHelpAgent( const OString& sHelpId )
-{
- if ( SvtHelpOptions().IsHelpAgentAutoStartMode() )
- {
- SfxHelpOptions_Impl *pOpt = pImp->GetOptions();
- if ( !pOpt->HasId( sHelpId ) )
- return;
-
- try
- {
- URL aURL;
- aURL.Complete = CreateHelpURL_Impl( OStringToOUString(sHelpId, RTL_TEXTENCODING_UTF8), GetHelpModuleName_Impl() );
- Reference< XURLTransformer > xTrans( URLTransformer::create( ::comphelper::getProcessComponentContext() ) );
- xTrans->parseStrict(aURL);
-
- Reference < XDesktop2 > xDesktop = Desktop::create( ::comphelper::getProcessComponentContext() );
- Reference < XFrame > xCurrentFrame = xDesktop->getCurrentFrame();
-
- Reference< XDispatchProvider > xDispProv( xCurrentFrame, UNO_QUERY );
- Reference< XDispatch > xHelpDispatch;
- if ( xDispProv.is() )
- xHelpDispatch = xDispProv->queryDispatch(
- aURL, OUString("_helpagent"),
- FrameSearchFlag::PARENT | FrameSearchFlag::SELF );
-
- DBG_ASSERT( xHelpDispatch.is(), "OpenHelpAgent: could not get a dispatcher!" );
- if ( xHelpDispatch.is() )
- xHelpDispatch->dispatch( aURL, Sequence< PropertyValue >() );
- }
- catch (const Exception&)
- {
- SAL_WARN( "sfx2.appl", "OpenHelpAgent: caught an exception while executing the dispatch!" );
- }
- }
-}
-
OUString SfxHelp::GetDefaultHelpModule()
{
return getDefaultModule_Impl();
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index f77cae4813c5..9acf705ee3be 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -239,16 +239,6 @@ int SfxDispatcher::Call_Impl( SfxShell& rShell, const SfxSlot &rSlot, SfxRequest
sal_Bool *pOldInCallAliveFlag = pImp->pInCallAliveFlag;
pImp->pInCallAliveFlag = &bThisDispatcherAlive;
- SfxViewFrame* pView = GetFrame();
- if ( !pView )
- pView = SfxViewFrame::Current();
- if ( pView )
- {
- OString aCmd(".uno:");
- aCmd += rSlot.GetUnoName();
- SfxHelp::OpenHelpAgent( &pView->GetFrame(), aCmd );
- }
-
SfxExecFunc pFunc = rSlot.GetExecFnc();
rShell.CallExec( pFunc, rReq );
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index 5fedbc3ff620..6b26bf3b0a8e 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -367,16 +367,6 @@ long SfxModelessDialog::Notify( NotifyEvent& rEvt )
{
pBindings->SetActiveFrame( pImp->pMgr->GetFrame() );
pImp->pMgr->Activate_Impl();
- Window* pWindow = rEvt.GetWindow();
- OString sHelpId;
- while ( sHelpId.isEmpty() && pWindow )
- {
- sHelpId = pWindow->GetHelpId();
- pWindow = pWindow->GetParent();
- }
-
- if ( !sHelpId.isEmpty() )
- SfxHelp::OpenHelpAgent( &pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame(), sHelpId );
}
else if ( rEvt.GetType() == EVENT_LOSEFOCUS && !HasChildPathFocus() )
{
@@ -465,16 +455,6 @@ long SfxFloatingWindow::Notify( NotifyEvent& rEvt )
{
pBindings->SetActiveFrame( pImp->pMgr->GetFrame() );
pImp->pMgr->Activate_Impl();
- Window* pWindow = rEvt.GetWindow();
- OString sHelpId;
- while ( sHelpId.isEmpty() && pWindow )
- {
- sHelpId = pWindow->GetHelpId();
- pWindow = pWindow->GetParent();
- }
-
- if ( !sHelpId.isEmpty() )
- SfxHelp::OpenHelpAgent( &pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame(), sHelpId );
}
else if ( rEvt.GetType() == EVENT_LOSEFOCUS )
{
diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx
index 8486883fa2cf..1e3b0e2ed03f 100644
--- a/sfx2/source/dialog/dockwin.cxx
+++ b/sfx2/source/dialog/dockwin.cxx
@@ -1782,17 +1782,6 @@ long SfxDockingWindow::Notify( NotifyEvent& rEvt )
else if (pMgr != NULL)
pMgr->Activate_Impl();
- Window* pWindow = rEvt.GetWindow();
- OString sHelpId;
- while ( sHelpId.isEmpty() && pWindow )
- {
- sHelpId = pWindow->GetHelpId();
- pWindow = pWindow->GetParent();
- }
-
- if ( !sHelpId.isEmpty() )
- SfxHelp::OpenHelpAgent( &pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame(), sHelpId );
-
// In VCL Notify goes first to the window itself, also call the
// base class, otherwise the parent learns nothing
// if ( rEvt.GetWindow() == this ) PB: #i74693# not necessary any longer
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index cc463289060b..75fcdef6bdb3 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -1625,27 +1625,4 @@ void SfxTabDialog::SetInputSet( const SfxItemSet* pInSet )
}
}
-long SfxTabDialog::Notify( NotifyEvent& rNEvt )
-{
- if ( rNEvt.GetType() == EVENT_GETFOCUS )
- {
- SfxViewFrame* pViewFrame = GetViewFrame() ? GetViewFrame() : SfxViewFrame::Current();
- if ( pViewFrame )
- {
- Window* pWindow = rNEvt.GetWindow();
- OString sHelpId;
- while ( sHelpId.isEmpty() && pWindow )
- {
- sHelpId = pWindow->GetHelpId();
- pWindow = pWindow->GetParent();
- }
-
- if ( !sHelpId.isEmpty() )
- SfxHelp::OpenHelpAgent( &pViewFrame->GetFrame(), sHelpId );
- }
- }
-
- return TabDialog::Notify( rNEvt );
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 907ee1a67228..cfd21cfdb76e 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -558,7 +558,6 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
// at the end of the method
aModelGuard.Init_Impl( uno::Reference< util::XCloseable >( GetModel(), uno::UNO_QUERY ) );
- sal_Bool bDialogUsed = sal_False;
sal_uInt32 nErrorCode = ERRCODE_NONE;
// by default versions should be preserved always except in case of an explicit
@@ -662,7 +661,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
if ( QueryHiddenInformation( bIsPDFExport ? WhenCreatingPDF : WhenSaving, NULL ) == RET_YES )
{
- bDialogUsed = aHelper.GUIStoreModel( GetModel(),
+ aHelper.GUIStoreModel( GetModel(),
OUString::createFromAscii( pSlot->GetUnoName() ),
aDispatchArgs,
bPreselectPassword,
@@ -691,15 +690,6 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
const SfxFilter* pFilt = GetFactory().GetFilterContainer()->GetFilter4FilterName( aFilterName );
OSL_ENSURE( nId == SID_SAVEDOC || pFilt, "The filter can not be zero since it was used for storing!\n" );
- if ( bDialogUsed && pFilt
- && pFilt->IsOwnFormat()
- && pFilt->UsesStorage()
- && pFilt->GetVersion() >= SOFFICE_FILEFORMAT_60 )
- {
- SfxViewFrame* pDocViewFrame = SfxViewFrame::GetFirst( this );
- if ( pDocViewFrame )
- SfxHelp::OpenHelpAgent( &pDocViewFrame->GetFrame(), HID_DID_SAVE_PACKED_XML );
- }
// the StoreAsURL/StoreToURL method have called this method with false
// so it has to be restored to true here since it is a call from GUI
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 133ac0280399..64e5b4314721 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -622,13 +622,6 @@ sal_uInt16 SfxObjectShell::PrepareClose
// Ask if to save
short nRet = RET_YES;
{
- //initiate help agent to inform about "print modifies the document"
- SvtPrintWarningOptions aPrintOptions;
- if (aPrintOptions.IsModifyDocumentOnPrintingAllowed() &&
- HasName() && getDocProperties()->getPrintDate().Month > 0)
- {
- SfxHelp::OpenHelpAgent( &pFirst->GetFrame(), HID_CLOSE_WARNING );
- }
const Reference< XTitle > xTitle( *pImp->pBaseModel.get(), UNO_QUERY_THROW );
const OUString sTitle = xTitle->getTitle ();
nRet = ExecuteQuerySaveDocument(&pFrame->GetWindow(),sTitle);
diff --git a/sfx2/source/view/frame2.cxx b/sfx2/source/view/frame2.cxx
index 6ac414f3469c..bacba1ce0d3f 100644
--- a/sfx2/source/view/frame2.cxx
+++ b/sfx2/source/view/frame2.cxx
@@ -114,18 +114,6 @@ long SfxFrameWindow_Impl::Notify( NotifyEvent& rNEvt )
pView->MakeActive_Impl( sal_False );
}
- // TODO/LATER: do we still need this code?
- Window* pWindow = rNEvt.GetWindow();
- OString sHelpId;
- while ( sHelpId.isEmpty() && pWindow )
- {
- sHelpId = pWindow->GetHelpId();
- pWindow = pWindow->GetParent();
- }
-
- if ( !sHelpId.isEmpty() )
- SfxHelp::OpenHelpAgent( pFrame, sHelpId );
-
// if focus was on an external window, the clipboard content might have been changed
pView->GetBindings().Invalidate( SID_PASTE );
pView->GetBindings().Invalidate( SID_PASTE_SPECIAL );