summaryrefslogtreecommitdiff
path: root/sfx2/source/appl
diff options
context:
space:
mode:
authorBjoern Michaelsen <b_michaelsen@openoffice.org>2010-07-13 14:36:24 +0200
committerBjoern Michaelsen <b_michaelsen@openoffice.org>2010-07-13 14:36:24 +0200
commit9bea5fdbf9ac1ce9d6118a63e8f98d7264872cc8 (patch)
tree577b47340d556419e4b8e690f0c841c4d69f97fc /sfx2/source/appl
parent4f19a2d4af8de4cb23e0a9e74d8df6ba27cdf5e1 (diff)
parent871f924d559017fcf06a4c691fae6bcd9a82491e (diff)
CWS gnumake2: resync to DEV300_m84
Diffstat (limited to 'sfx2/source/appl')
-rw-r--r--sfx2/source/appl/app.cxx1
-rw-r--r--sfx2/source/appl/appdata.cxx5
-rw-r--r--sfx2/source/appl/appinit.cxx2
-rw-r--r--sfx2/source/appl/appmain.cxx3
-rw-r--r--sfx2/source/appl/appquit.cxx50
-rw-r--r--sfx2/source/appl/appreg.cxx1
-rw-r--r--sfx2/source/appl/appserv.cxx63
-rwxr-xr-x[-rw-r--r--]sfx2/source/appl/appuno.cxx0
-rw-r--r--sfx2/source/appl/imagemgr.cxx2
-rw-r--r--sfx2/source/appl/imestatuswindow.cxx6
-rw-r--r--sfx2/source/appl/imestatuswindow.hxx7
-rw-r--r--sfx2/source/appl/module.cxx13
-rw-r--r--sfx2/source/appl/sfxhelp.cxx15
-rw-r--r--sfx2/source/appl/shutdownicon.cxx23
-rw-r--r--sfx2/source/appl/shutdownicon.hxx1
-rw-r--r--sfx2/source/appl/shutdowniconw32.cxx50
-rw-r--r--sfx2/source/appl/workwin.cxx107
17 files changed, 208 insertions, 141 deletions
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index 2e2074013d..e1028de7d0 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -311,6 +311,7 @@ SfxApplication* SfxApplication::GetOrCreate()
::framework::SetStatusBarControllerCreator( SfxStatusBarControllerFactory );
::framework::SetDockingWindowCreator( SfxDockingWindowFactory );
::framework::SetIsDockingWindowVisible( IsDockingWindowVisible );
+ ::framework::SetActivateToolPanel( &SfxViewFrame::ActivateToolPanel );
SfxHelp* pSfxHelp = new SfxHelp;
Application::SetHelp( pSfxHelp );
diff --git a/sfx2/source/appl/appdata.cxx b/sfx2/source/appl/appdata.cxx
index 0691d5e762..e48ffcc037 100644
--- a/sfx2/source/appl/appdata.cxx
+++ b/sfx2/source/appl/appdata.cxx
@@ -89,7 +89,7 @@ void SfxBasicManagerCreationListener::onBasicManagerCreated( const Reference< XM
m_rAppData.OnApplicationBasicManagerCreated( _rBasicManager );
}
-SfxAppData_Impl::SfxAppData_Impl( SfxApplication* pApp ) :
+SfxAppData_Impl::SfxAppData_Impl( SfxApplication* ) :
pDdeService( 0 ),
pDocTopics( 0 ),
pTriggerTopic(0),
@@ -116,8 +116,7 @@ SfxAppData_Impl::SfxAppData_Impl( SfxApplication* pApp ) :
nRescheduleLocks(0),
nInReschedule(0),
nAsynchronCalls(0),
- m_xImeStatusWindow(new sfx2::appl::ImeStatusWindow(
- *pApp, comphelper::getProcessServiceFactory()))
+ m_xImeStatusWindow(new sfx2::appl::ImeStatusWindow(comphelper::getProcessServiceFactory()))
, pTbxCtrlFac(0)
, pStbCtrlFac(0)
, pViewFrames(0)
diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx
index 6917ef9071..a1035f6339 100644
--- a/sfx2/source/appl/appinit.cxx
+++ b/sfx2/source/appl/appinit.cxx
@@ -35,7 +35,7 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <svtools/soerr.hxx>
-#include <svl/svtools.hrc>
+#include <svtools/svtools.hrc>
#include <unotools/saveopt.hxx>
#include <unotools/localisationoptions.hxx>
#include <tools/config.hxx>
diff --git a/sfx2/source/appl/appmain.cxx b/sfx2/source/appl/appmain.cxx
index ea79690e02..ded60743dc 100644
--- a/sfx2/source/appl/appmain.cxx
+++ b/sfx2/source/appl/appmain.cxx
@@ -93,9 +93,6 @@ static SfxItemInfo __READONLY_DATA aItemInfos[] =
//===================================================================
-typedef Link* LinkPtr;
-SV_DECL_PTRARR(SfxInitLinkList, LinkPtr, 4, 4)
-
TYPEINIT2(SfxApplication,SfxShell,SfxBroadcaster);
//--------------------------------------------------------------------
diff --git a/sfx2/source/appl/appquit.cxx b/sfx2/source/appl/appquit.cxx
index f2068c91f0..a82d42a510 100644
--- a/sfx2/source/appl/appquit.cxx
+++ b/sfx2/source/appl/appquit.cxx
@@ -74,57 +74,11 @@
using ::basic::BasicManagerRepository;
-#ifdef DBG_UTIL
-DECLARE_LIST( SfxFrameWindowFactoryArray_Impl, SfxFrameWindowFactory* )
-SV_DECL_PTRARR(SfxInitLinkList, Link*, 2, 2)
-#endif
-
//===================================================================
BOOL SfxApplication::QueryExit_Impl()
{
BOOL bQuit = TRUE;
-/*
- BOOL bPrinting = FALSE;
- for ( SfxViewShell *pViewSh = SfxViewShell::GetFirst();
- !bPrinting && pViewSh;
- pViewSh = SfxViewShell::GetNext(*pViewSh) )
- {
- SfxPrinter *pPrinter = pViewSh->GetPrinter();
- bPrinting = pPrinter && pPrinter->IsPrinting();
- }
-
- if ( bPrinting )
- {
- // Benutzer fragen, ob abgebrochen werden soll
- if ( RET_OK == QueryBox( 0, SfxResId( MSG_ISPRINTING_QUERYABORT ) ).Execute() )
- {
- // alle Jobs canceln
- for ( SfxViewShell *pViewSh = SfxViewShell::GetFirst();
- !bPrinting && pViewSh;
- pViewSh = SfxViewShell::GetNext(*pViewSh) )
- {
- SfxPrinter *pPrinter = pViewSh->GetPrinter();
- if ( pPrinter && pPrinter->IsPrinting() )
- pPrinter->AbortJob();
- }
-
- // da das Canceln asynchron ist, Quit erstmal wieder verlassen
- GetDispatcher_Impl()->Execute( SID_QUITAPP, SFX_CALLMODE_ASYNCHRON );
- DBG_TRACE( "QueryExit => FALSE (printing)" );
- return FALSE;
- }
- }
-*/
-/*
- SfxObjectShell *pLastDocSh = SfxObjectShell::GetFirst();
- if ( bQuit )
- {
- // Jetzt zur Sicherheit auch hidden Frames abr"aumen
- SfxViewFrame::CloseHiddenFrames_Impl();
- pLastDocSh = SfxObjectShell::GetFirst();
- }
-*/
// will trotzdem noch jemand, den man nicht abschiessen kann, die App haben?
if ( !bQuit )
{
@@ -197,22 +151,18 @@ void SfxApplication::Deinitialize()
delete pAppData_Impl->pLabelResMgr;
-#ifdef DBG_UTIL
DELETEX(pAppData_Impl->pSlotPool);
DELETEX(pAppData_Impl->pEventConfig);
SfxMacroConfig::Release_Impl();
DELETEX(pAppData_Impl->pFactArr);
DELETEX(pAppData_Impl->pInitLinkList);
-#endif
-#ifdef DBG_UTIL
DELETEX(pAppData_Impl->pTbxCtrlFac);
DELETEX(pAppData_Impl->pStbCtrlFac);
DELETEX(pAppData_Impl->pMenuCtrlFac);
DELETEX(pAppData_Impl->pViewFrames);
DELETEX(pAppData_Impl->pViewShells);
DELETEX(pAppData_Impl->pObjShells);
-#endif
//TODO/CLEANTUP
//ReleaseArgs could be used instead!
diff --git a/sfx2/source/appl/appreg.cxx b/sfx2/source/appl/appreg.cxx
index a08405a073..ec0ee9e975 100644
--- a/sfx2/source/appl/appreg.cxx
+++ b/sfx2/source/appl/appreg.cxx
@@ -42,6 +42,7 @@
#include "inettbc.hxx"
#include "sfx2/stbitem.hxx"
#include <sfx2/navigat.hxx>
+#include <sfx2/taskpane.hxx>
#include <sfx2/module.hxx>
#include <sfx2/viewfrm.hxx>
#include "partwnd.hxx"
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 18df405f8e..e51364b6fb 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -51,20 +51,15 @@
#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
#include <com/sun/star/system/SystemShellExecuteException.hpp>
-#ifndef _UNOTOOLS_PROCESSFACTORY_HXX
#include <comphelper/processfactory.hxx>
-#endif
#include <comphelper/storagehelper.hxx>
+#include "comphelper/configurationhelper.hxx"
-#ifndef _SVT_DOC_ADDRESSTEMPLATE_HXX_
#include <svtools/addresstemplate.hxx>
-#endif
#include <svl/visitem.hxx>
#include <unotools/intlwrapper.hxx>
-#ifndef _UNOTOOLS_CONFIGMGR_HXX_
#include <unotools/configmgr.hxx>
-#endif
#include <tools/config.hxx>
#include <tools/diagnose_ex.h>
#include <vcl/msgbox.hxx>
@@ -90,6 +85,7 @@
#include <vos/process.hxx>
#include <rtl/bootstrap.hxx>
#include <cppuhelper/exc_hlp.hxx>
+#include <rtl/ustrbuf.hxx>
#include <com/sun/star/script/provider/XScriptProviderFactory.hpp>
#include <com/sun/star/frame/XModuleManager.hpp>
@@ -879,6 +875,31 @@ namespace
}
}
+static ::rtl::OUString getConfigurationStringValue(
+ const ::rtl::OUString& rPackage,
+ const ::rtl::OUString& rRelPath,
+ const ::rtl::OUString& rKey,
+ const ::rtl::OUString& rDefaultValue )
+{
+ ::rtl::OUString aDefVal( rDefaultValue );
+
+ try
+ {
+ ::comphelper::ConfigurationHelper::readDirectKey(
+ comphelper::getProcessServiceFactory(),
+ rPackage,
+ rRelPath,
+ rKey,
+ ::comphelper::ConfigurationHelper::E_READONLY) >>= aDefVal;
+ }
+ catch(const com::sun::star::uno::RuntimeException& exRun)
+ { throw exRun; }
+ catch(const com::sun::star::uno::Exception&)
+ {}
+
+ return aDefVal;
+}
+
void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
{
DBG_MEMTEST();
@@ -924,8 +945,34 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
uno::Reference< css::system::XSystemShellExecute > xSystemShell(
xSMGR->createInstance( DEFINE_CONST_UNICODE("com.sun.star.system.SystemShellExecute" ) ),
uno::UNO_QUERY_THROW );
- if ( xSystemShell.is() )
- xSystemShell->execute( DEFINE_CONST_UNICODE("http://extensions.services.openoffice.org/dictionary?cid=926385"), ::rtl::OUString(), css::system::SystemShellExecuteFlags::DEFAULTS );
+
+ // read repository URL from configuration
+ ::rtl::OUString sTemplRepoURL =
+ getConfigurationStringValue(
+ ::rtl::OUString::createFromAscii("org.openoffice.Office.Common"),
+ ::rtl::OUString::createFromAscii("Dictionaries"),
+ ::rtl::OUString::createFromAscii("RepositoryURL"),
+ ::rtl::OUString());
+
+ if ( xSystemShell.is() && sTemplRepoURL.getLength() > 0 )
+ {
+ ::rtl::OUStringBuffer aURLBuf( sTemplRepoURL );
+ aURLBuf.appendAscii( "?" );
+ aURLBuf.appendAscii( "lang=" );
+
+ // read locale from configuration
+ ::rtl::OUString sLocale = getConfigurationStringValue(
+ ::rtl::OUString::createFromAscii("org.openoffice.Setup"),
+ ::rtl::OUString::createFromAscii("L10N"),
+ ::rtl::OUString::createFromAscii("ooLocale"),
+ ::rtl::OUString::createFromAscii("en-US"));
+
+ aURLBuf.append( sLocale );
+ xSystemShell->execute(
+ aURLBuf.makeStringAndClear(),
+ ::rtl::OUString(),
+ css::system::SystemShellExecuteFlags::DEFAULTS );
+ }
}
catch( const ::com::sun::star::uno::Exception& )
{
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 7bbd4c22a3..7bbd4c22a3 100644..100755
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
diff --git a/sfx2/source/appl/imagemgr.cxx b/sfx2/source/appl/imagemgr.cxx
index 18cfedd112..59714d0570 100644
--- a/sfx2/source/appl/imagemgr.cxx
+++ b/sfx2/source/appl/imagemgr.cxx
@@ -71,7 +71,7 @@ static WeakReference< XModuleUIConfigurationManagerSupplier > m_xModuleCfgMgrSup
static WeakReference< XURLTransformer > m_xURLTransformer;
static ModuleIdToImagegMgr m_aModuleIdToImageMgrMap;
-Image SAL_CALL GetImage( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& aURL, BOOL bBig, BOOL bHiContrast )
+Image SAL_CALL GetImage( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& aURL, BOOL bBig, BOOL bHiContrast )
{
// TODO/LATeR: shouldn't this become a method at SfxViewFrame?! That would save the UnoTunnel
if ( !rFrame.is() )
diff --git a/sfx2/source/appl/imestatuswindow.cxx b/sfx2/source/appl/imestatuswindow.cxx
index 2885f60bb9..53639a65df 100644
--- a/sfx2/source/appl/imestatuswindow.cxx
+++ b/sfx2/source/appl/imestatuswindow.cxx
@@ -57,10 +57,8 @@ namespace css = com::sun::star;
using sfx2::appl::ImeStatusWindow;
ImeStatusWindow::ImeStatusWindow(
- SfxApplication & rApplication,
css::uno::Reference< css::lang::XMultiServiceFactory > const &
rServiceFactory):
- m_rApplication(rApplication),
m_xServiceFactory(rServiceFactory),
m_bDisposed(false)
{}
@@ -161,7 +159,9 @@ ImeStatusWindow::propertyChange(css::beans::PropertyChangeEvent const & )
throw (css::uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
- m_rApplication.Invalidate(SID_SHOW_IME_STATUS_WINDOW);
+ SfxApplication* pApp = SfxApplication::Get();
+ if (pApp)
+ pApp->Invalidate(SID_SHOW_IME_STATUS_WINDOW);
}
css::uno::Reference< css::beans::XPropertySet > ImeStatusWindow::getConfig()
diff --git a/sfx2/source/appl/imestatuswindow.hxx b/sfx2/source/appl/imestatuswindow.hxx
index cbfe2c4748..2d310c60c7 100644
--- a/sfx2/source/appl/imestatuswindow.hxx
+++ b/sfx2/source/appl/imestatuswindow.hxx
@@ -37,7 +37,6 @@ namespace com { namespace sun { namespace star {
namespace beans { class XPropertySet; }
namespace lang { class XMultiServiceFactory; }
} } }
-class SfxApplication;
namespace sfx2 { namespace appl {
@@ -56,10 +55,7 @@ ImeStatusWindow_Impl;
class ImeStatusWindow: private ImeStatusWindow_Impl
{
public:
- ImeStatusWindow(SfxApplication & rApplication,
- com::sun::star::uno::Reference<
- com::sun::star::lang::XMultiServiceFactory > const &
- rServiceFactory);
+ ImeStatusWindow( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > const& rServiceFactory );
/** Set up VCL according to the configuration.
@@ -115,7 +111,6 @@ private:
com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >
getConfig();
- SfxApplication & m_rApplication;
com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
m_xServiceFactory;
diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx
index aaa300b5a7..a02e3128f9 100644
--- a/sfx2/source/appl/module.cxx
+++ b/sfx2/source/appl/module.cxx
@@ -49,6 +49,8 @@
#include <sfx2/objface.hxx>
#include <sfx2/viewfrm.hxx>
#include <svl/intitem.hxx>
+#include "sfx2/taskpane.hxx"
+#include <tools/diagnose_ex.h>
#define SfxModule
#include "sfxslots.hxx"
@@ -400,6 +402,17 @@ BOOL SfxModule::IsActive() const
return FALSE;
}
+bool SfxModule::IsChildWindowAvailable( const USHORT i_nId, const SfxViewFrame* i_pViewFrame ) const
+{
+ if ( i_nId != SID_TASKPANE )
+ // by default, assume it is
+ return true;
+
+ const SfxViewFrame* pViewFrame = i_pViewFrame ? i_pViewFrame : GetFrame();
+ ENSURE_OR_RETURN( pViewFrame, "SfxModule::IsChildWindowAvailable: no frame to ask for the module identifier!", false );
+ return ::sfx2::ModuleTaskPane::ModuleHasToolPanels( pViewFrame->GetFrame().GetFrameInterface() );
+}
+
SfxModule* SfxModule::GetActiveModule( SfxViewFrame* pFrame )
{
if ( !pFrame )
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index a90172aa6b..31c2ce7693 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -714,9 +714,6 @@ String SfxHelp::CreateHelpURL_Impl( const String& aCommandURL, const String& rMo
return aHelpURL;
}
-static ::rtl::OUString OFFICE_HELP_TASK = ::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP_TASK"));
-static ::rtl::OUString OFFICE_HELP = ::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP" ));
-
SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame >& rHelpTask ,
Reference< XFrame >& rHelpContent)
{
@@ -725,7 +722,7 @@ SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame >& rHelpTask ,
// otherwhise - create new help task
Reference< XFrame > xHelpTask = xDesktop->findFrame(
- OFFICE_HELP_TASK,
+ ::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP_TASK")),
FrameSearchFlag::TASKS | FrameSearchFlag::CREATE);
if (!xHelpTask.is())
return 0;
@@ -740,7 +737,7 @@ SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame >& rHelpTask ,
if (xHelpTask->setComponent( xHelpWindow, Reference< XController >() ))
{
// Customize UI ...
- xHelpTask->setName( OFFICE_HELP_TASK );
+ xHelpTask->setName( ::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP_TASK")) );
Reference< XPropertySet > xProps(xHelpTask, UNO_QUERY);
if (xProps.is())
@@ -754,13 +751,13 @@ SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame >& rHelpTask ,
// This sub frame is created internaly (if we called new SfxHelpWindow_Impl() ...)
// It should exist :-)
- xHelpContent = xHelpTask->findFrame(OFFICE_HELP, FrameSearchFlag::CHILDREN);
+ xHelpContent = xHelpTask->findFrame(::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP")), FrameSearchFlag::CHILDREN);
}
if (!xHelpContent.is())
delete pHelpWindow;
- xHelpContent->setName(OFFICE_HELP);
+ xHelpContent->setName(::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP")));
rHelpTask = xHelpTask;
rHelpContent = xHelpContent;
@@ -830,10 +827,10 @@ BOOL SfxHelp::Start( const String& rURL, const Window* pWindow )
// in both cases)!
Reference< XFrame > xHelp = xDesktop->findFrame(
- OFFICE_HELP_TASK,
+ ::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP_TASK")),
FrameSearchFlag::CHILDREN);
Reference< XFrame > xHelpContent = xDesktop->findFrame(
- OFFICE_HELP,
+ ::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP")),
FrameSearchFlag::CHILDREN);
SfxHelpWindow_Impl* pHelpWindow = 0;
diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx
index 9e3c5eee4b..b6f12aecbc 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -33,6 +33,7 @@
#include <sfx2/app.hxx>
#include <vos/mutex.hxx>
#include <svtools/imagemgr.hxx>
+#include <svtools/miscopt.hxx>
// #include <cmdlineargs.hxx>
#include <com/sun/star/task/XInteractionHandler.hpp>
#include <com/sun/star/frame/XDispatchResultListener.hpp>
@@ -239,6 +240,7 @@ ShutdownIcon::ShutdownIcon( Reference< XMultiServiceFactory > aSMgr ) :
ShutdownIconServiceBase( m_aMutex ),
m_bVeto ( false ),
m_bListenForTermination ( false ),
+ m_bSystemDialogs( false ),
m_pResMgr( NULL ),
m_pFileDlg( NULL ),
m_xServiceManager( aSMgr ),
@@ -247,6 +249,7 @@ ShutdownIcon::ShutdownIcon( Reference< XMultiServiceFactory > aSMgr ) :
m_pPlugin( 0 ),
m_bInitialized( false )
{
+ m_bSystemDialogs = SvtMiscOptions().UseSystemFileDialog();
}
ShutdownIcon::~ShutdownIcon()
@@ -380,6 +383,16 @@ void ShutdownIcon::StartFileDialog()
{
::vos::OGuard aGuard( Application::GetSolarMutex() );
+ bool bDirty = ( m_bSystemDialogs != static_cast<bool>(SvtMiscOptions().UseSystemFileDialog()) );
+
+ if ( m_pFileDlg && bDirty )
+ {
+ // Destroy instance as changing the system file dialog setting
+ // forces us to create a new FileDialogHelper instance!
+ delete m_pFileDlg;
+ m_pFileDlg = NULL;
+ }
+
if ( !m_pFileDlg )
m_pFileDlg = new FileDialogHelper( WB_OPEN | SFXWB_MULTISELECTION, String() );
m_pFileDlg->StartExecuteModal( STATIC_LINK( this, ShutdownIcon, DialogClosedHdl_Impl ) );
@@ -516,8 +529,14 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR
#ifdef WNT
// #103346 Destroy dialog to prevent problems with custom controls
- delete pThis->m_pFileDlg;
- pThis->m_pFileDlg = NULL;
+ // This fix is dependent on the dialog settings. Destroying the dialog here will
+ // crash the non-native dialog implementation! Therefore make this dependent on
+ // the settings.
+ if ( SvtMiscOptions().UseSystemFileDialog() )
+ {
+ delete pThis->m_pFileDlg;
+ pThis->m_pFileDlg = NULL;
+ }
#endif
LeaveModalMode();
diff --git a/sfx2/source/appl/shutdownicon.hxx b/sfx2/source/appl/shutdownicon.hxx
index a1c836cbea..cc18016e33 100644
--- a/sfx2/source/appl/shutdownicon.hxx
+++ b/sfx2/source/appl/shutdownicon.hxx
@@ -52,6 +52,7 @@ class SFX2_DLLPUBLIC ShutdownIcon : public ShutdownIconServiceBase
::osl::Mutex m_aMutex;
bool m_bVeto;
bool m_bListenForTermination;
+ bool m_bSystemDialogs;
ResMgr* m_pResMgr;
sfx2::FileDialogHelper* m_pFileDlg;
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
diff --git a/sfx2/source/appl/shutdowniconw32.cxx b/sfx2/source/appl/shutdowniconw32.cxx
index e9e5ba6123..9e260fdc85 100644
--- a/sfx2/source/appl/shutdowniconw32.cxx
+++ b/sfx2/source/appl/shutdowniconw32.cxx
@@ -109,7 +109,7 @@ using namespace ::osl;
#define ICON_TEMPLATE 16
#define ICON_MACROLIBRARY 17
#define ICON_CONFIGURATION 18
-#define ICON_OPEN 19
+#define ICON_OPEN 5 // See index of open folder icon in shell32.dll
#define ICON_SETUP 500
#define SFX_TASKBAR_NOTIFICATION WM_USER+1
@@ -124,6 +124,7 @@ static void OnDrawItem(HWND hwnd, LPDRAWITEMSTRUCT lpdis);
typedef struct tagMYITEM
{
OUString text;
+ OUString module;
UINT iconId;
} MYITEM;
@@ -152,7 +153,7 @@ static bool isNT()
// -------------------------------
-static void addMenuItem( HMENU hMenu, UINT id, UINT iconId, const OUString& text, int& pos, int bOwnerdraw )
+static void addMenuItem( HMENU hMenu, UINT id, UINT iconId, const OUString& text, int& pos, int bOwnerdraw, const OUString& module )
{
MENUITEMINFOW mi;
memset( &mi, 0, sizeof( MENUITEMINFOW ) );
@@ -175,6 +176,7 @@ static void addMenuItem( HMENU hMenu, UINT id, UINT iconId, const OUString& text
MYITEM *pMyItem = new MYITEM;
pMyItem->text = text;
pMyItem->iconId = iconId;
+ pMyItem->module = module;
mi.dwItemData = (DWORD) pMyItem;
}
else
@@ -245,6 +247,8 @@ static HMENU createSystrayMenu( )
{ SvtModuleOptions::E_SMATH, IDM_MATH, ICON_MATH_DOCUMENT, MATH_URL },
};
+ OUString aEmpty;
+
// insert the menu entries for launching the applications
for ( size_t i = 0; i < sizeof( aMenuItems ) / sizeof( aMenuItems[0] ); ++i )
{
@@ -260,19 +264,21 @@ static HMENU createSystrayMenu( )
continue;
addMenuItem( hMenu, aMenuItems[i].nMenuItemID, aMenuItems[i].nMenuIconID,
- pShutdownIcon->GetUrlDescription( sURL ), pos, true );
+ pShutdownIcon->GetUrlDescription( sURL ), pos, true, aEmpty );
}
+
+
// insert the remaining menu entries
addMenuItem( hMenu, IDM_TEMPLATE, ICON_TEMPLATE,
- pShutdownIcon->GetResString( STR_QUICKSTART_FROMTEMPLATE ), pos, true);
- addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false );
- addMenuItem( hMenu, IDM_OPEN, ICON_OPEN, pShutdownIcon->GetResString( STR_QUICKSTART_FILEOPEN ), pos, true );
- addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false );
+ pShutdownIcon->GetResString( STR_QUICKSTART_FROMTEMPLATE ), pos, true, aEmpty);
+ addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false, aEmpty );
+ addMenuItem( hMenu, IDM_OPEN, ICON_OPEN, pShutdownIcon->GetResString( STR_QUICKSTART_FILEOPEN ), pos, true, OUString::createFromAscii( "SHELL32" ));
+ addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false, aEmpty );
#endif
- addMenuItem( hMenu, IDM_INSTALL,0, pShutdownIcon->GetResString( STR_QUICKSTART_PRELAUNCH ), pos, false );
- addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false );
- addMenuItem( hMenu, IDM_EXIT, 0, pShutdownIcon->GetResString( STR_QUICKSTART_EXIT ), pos, false );
+ addMenuItem( hMenu, IDM_INSTALL,0, pShutdownIcon->GetResString( STR_QUICKSTART_PRELAUNCH ), pos, false, aEmpty );
+ addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false, aEmpty );
+ addMenuItem( hMenu, IDM_EXIT, 0, pShutdownIcon->GetResString( STR_QUICKSTART_EXIT ), pos, false, aEmpty );
// indicate status of autostart folder
CheckMenuItem( hMenu, IDM_INSTALL, MF_BYCOMMAND | (ShutdownIcon::GetAutostart() ? MF_CHECKED : MF_UNCHECKED) );
@@ -736,11 +742,25 @@ void OnDrawItem(HWND /*hwnd*/, LPDRAWITEMSTRUCT lpdis)
x = aRect.left;
y = aRect.top;
- int cx = GetSystemMetrics( SM_CXSMICON );
- int cy = GetSystemMetrics( SM_CYSMICON );
- HICON hIcon = (HICON) LoadImageA( GetModuleHandle( NULL ), MAKEINTRESOURCE( pMyItem->iconId ),
- IMAGE_ICON, cx, cy,
- LR_DEFAULTCOLOR | LR_SHARED );
+ int cx = GetSystemMetrics( SM_CXSMICON );
+ int cy = GetSystemMetrics( SM_CYSMICON );
+ HICON hIcon( 0 );
+ HMODULE hModule( GetModuleHandle( NULL ) );
+
+ if ( pMyItem->module.getLength() > 0 )
+ {
+ LPCWSTR pModuleName = reinterpret_cast<LPCWSTR>( pMyItem->module.getStr() );
+ hModule = GetModuleHandleW( pModuleName );
+ if ( hModule == NULL )
+ {
+ LoadLibraryW( pModuleName );
+ hModule = GetModuleHandleW( pModuleName );
+ }
+ }
+
+ hIcon = (HICON) LoadImageA( hModule, MAKEINTRESOURCE( pMyItem->iconId ),
+ IMAGE_ICON, cx, cy,
+ LR_DEFAULTCOLOR | LR_SHARED );
// DrawIconEx( lpdis->hDC, x, y+(height-cy)/2, hIcon, cx, cy, 0, NULL, DI_NORMAL );
diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index 290645a39e..06083e5013 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -53,6 +53,7 @@
#include <vcl/taskpanelist.hxx>
#include <vcl/toolbox.hxx>
#include <tools/rcid.h>
+#include <tools/diagnose_ex.h>
#include <toolkit/helper/vclunohelper.hxx>
#include <svl/itempool.hxx>
#include <svl/itemiter.hxx>
@@ -1538,6 +1539,16 @@ void SfxWorkWindow::UpdateObjectBars_Impl()
}
}
+bool SfxWorkWindow::AllowChildWindowCreation_Impl( const SfxChildWin_Impl& i_rCW ) const
+{
+ // or checking the availability of child windows, we need access to the module
+ const SfxViewFrame* pViewFrame = pBindings->GetDispatcher_Impl()->GetFrame();
+ const SfxObjectShell* pShell = pViewFrame ? pViewFrame->GetObjectShell() : NULL;
+ const SfxModule* pModule = pShell ? pShell->GetModule() : NULL;
+ ENSURE_OR_RETURN( pModule, "SfxWorkWindow::UpdateChildWindows_Impl: did not find an SfxModule to ask for the child win availability!", true );
+ return pModule->IsChildWindowAvailable( i_rCW.nId, pViewFrame );
+}
+
void SfxWorkWindow::UpdateChildWindows_Impl()
{
// alle vorhandenen oder in den Kontext gekommenen ChildWindows
@@ -1550,7 +1561,7 @@ void SfxWorkWindow::UpdateChildWindows_Impl()
{
// Im Kontext ist ein geeignetes ChildWindow erlaubt;
// ist es auch eingeschaltet ?
- if ( pChildWin == 0 && pCW->bCreate )
+ if ( pChildWin == NULL && pCW->bCreate )
{
// Internal docking is only used for embedding into another
// container. We force the floating state of all floatable
@@ -1571,6 +1582,9 @@ void SfxWorkWindow::UpdateChildWindows_Impl()
else
bCreate = TRUE;
+ if ( bCreate )
+ bCreate = AllowChildWindowCreation_Impl( *pCW );
+
// Momentan kein Fenster da, aber es ist eingeschaltet; Fenster
// und ggf. Context erzeugen
if ( bCreate )
@@ -1588,19 +1602,25 @@ void SfxWorkWindow::UpdateChildWindows_Impl()
if ( ( !bIsFullScreen || pChildWin->GetAlignment() == SFX_ALIGN_NOALIGNMENT ) && bAllChildsVisible )
{
// Updatemode ist kompatibel; auf jeden Fall wieder einschalten
- bCreate = TRUE;
- if ( pCW->pCli )
+ bCreate = AllowChildWindowCreation_Impl( *pCW );
+ if ( bCreate )
{
- // Fenster ist direktes Child
- if ( bAllChildsVisible && ( (IsDockingAllowed() && bInternalDockingAllowed) || pCW->pCli->eAlign == SFX_ALIGN_NOALIGNMENT ) )
- pCW->pCli->nVisible |= CHILD_NOT_HIDDEN;
+ if ( pCW->pCli )
+ {
+ // Fenster ist direktes Child
+ if ( bAllChildsVisible && ( (IsDockingAllowed() && bInternalDockingAllowed) || pCW->pCli->eAlign == SFX_ALIGN_NOALIGNMENT ) )
+ pCW->pCli->nVisible |= CHILD_NOT_HIDDEN;
+ }
+ else
+ {
+ if ( pCW->bCreate && IsDockingAllowed() && bInternalDockingAllowed )
+ // Fenster liegt in einem SplitWindow
+ ((SfxDockingWindow*)pChildWin->GetWindow())->Reappear_Impl();
+ }
+
+ if ( pCW->nInterfaceId != pChildWin->GetContextId() )
+ pChildWin->CreateContext( pCW->nInterfaceId, GetBindings() );
}
- else if ( pCW->bCreate && IsDockingAllowed() && bInternalDockingAllowed )
- // Fenster liegt in einem SplitWindow
- ((SfxDockingWindow*)pChildWin->GetWindow())->Reappear_Impl();
-
- if ( pCW->nInterfaceId != pChildWin->GetContextId() )
- pChildWin->CreateContext( pCW->nInterfaceId, GetBindings() );
}
}
}
@@ -2225,7 +2245,7 @@ void SfxWorkWindow::ToggleChildWindow_Impl(USHORT nId, BOOL bSetFocus)
SfxChildWin_Impl *pCW = (*pChildWins)[n];
SfxChildWindow *pChild = pCW->pWin;
- bool bCreationAllowed( sal_True );
+ bool bCreationAllowed( true );
if ( !bInternalDockingAllowed )
{
// Special case for all non-floatable child windows. We have
@@ -2233,43 +2253,51 @@ void SfxWorkWindow::ToggleChildWindow_Impl(USHORT nId, BOOL bSetFocus)
bCreationAllowed = !( pCW->aInfo.nFlags & SFX_CHILDWIN_FORCEDOCK );
}
- if ( pChild && pCW->bCreate && bCreationAllowed )
+ if ( bCreationAllowed )
{
- if ( pChild->QueryClose() )
+ if ( pCW->bCreate )
{
- if ( pChild && pChild->IsHideAtToggle() )
+ if ( pChild )
{
- pCW->bCreate = !pCW->bCreate;
- ShowChildWindow_Impl( nId, pCW->bCreate, bSetFocus );
+ if ( pChild->QueryClose() )
+ {
+ pCW->bCreate = FALSE;
+ if ( pChild->IsHideAtToggle() )
+ {
+ ShowChildWindow_Impl( nId, FALSE, bSetFocus );
+ }
+ else
+ {
+ // Fenster soll ausgeschaltet werdem
+ pChild->SetVisible_Impl( FALSE );
+ RemoveChildWin_Impl( pCW );
+ }
+ }
}
else
{
- // Fenster soll ausgeschaltet werdem
+ // no actual Window exists, yet => just remember the "switched off" state
pCW->bCreate = FALSE;
- pChild->SetVisible_Impl( FALSE );
- RemoveChildWin_Impl( pCW );
}
}
- }
- else if ( pCW->bCreate && bCreationAllowed )
- {
- pCW->bCreate = FALSE;
- }
- else if ( bCreationAllowed )
- {
- pCW->bCreate = TRUE;
-
- if ( pChild )
- {
- ShowChildWindow_Impl( nId, pCW->bCreate, bSetFocus );
- }
else
{
- // Fenster erzeugen
- CreateChildWin_Impl( pCW, bSetFocus );
- if ( !pCW->pWin )
- // Erzeugung war erfolglos
- pCW->bCreate = FALSE;
+ pCW->bCreate = AllowChildWindowCreation_Impl( *pCW );
+ if ( pCW->bCreate )
+ {
+ if ( pChild )
+ {
+ ShowChildWindow_Impl( nId, TRUE, bSetFocus );
+ }
+ else
+ {
+ // create actual Window
+ CreateChildWin_Impl( pCW, bSetFocus );
+ if ( !pCW->pWin )
+ // no success
+ pCW->bCreate = FALSE;
+ }
+ }
}
}
@@ -2488,7 +2516,6 @@ void SfxWorkWindow::ShowChildWindow_Impl(USHORT nId, BOOL bVisible, BOOL bSetFoc
SfxChildWindow *pChildWin = pCW->pWin;
if ( pChildWin )
{
-// pCW->bCreate = bVisible;
if ( bVisible )
{
if ( pCW->pCli )