summaryrefslogtreecommitdiff
path: root/sfx2/source/appl
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source/appl')
-rw-r--r--sfx2/source/appl/app.cxx263
-rwxr-xr-x[-rw-r--r--]sfx2/source/appl/app.hrc45
-rw-r--r--sfx2/source/appl/app.src70
-rw-r--r--sfx2/source/appl/appbas.cxx58
-rw-r--r--[-rwxr-xr-x]sfx2/source/appl/appbaslib.cxx12
-rw-r--r--sfx2/source/appl/appcfg.cxx86
-rw-r--r--sfx2/source/appl/appchild.cxx28
-rw-r--r--sfx2/source/appl/appdata.cxx21
-rw-r--r--sfx2/source/appl/appdde.cxx244
-rw-r--r--sfx2/source/appl/appinit.cxx51
-rw-r--r--sfx2/source/appl/appmain.cxx47
-rw-r--r--sfx2/source/appl/appmisc.cxx59
-rw-r--r--sfx2/source/appl/appopen.cxx209
-rw-r--r--sfx2/source/appl/appquit.cxx42
-rw-r--r--sfx2/source/appl/appreg.cxx12
-rw-r--r--sfx2/source/appl/appserv.cxx201
-rw-r--r--sfx2/source/appl/appuno.cxx84
-rw-r--r--sfx2/source/appl/childwin.cxx106
-rwxr-xr-x[-rw-r--r--]sfx2/source/appl/dde.hrc0
-rw-r--r--sfx2/source/appl/fileobj.cxx123
-rw-r--r--sfx2/source/appl/fileobj.hxx5
-rw-r--r--sfx2/source/appl/fwkhelper.cxx7
-rw-r--r--sfx2/source/appl/helpdispatch.cxx2
-rw-r--r--sfx2/source/appl/helpdispatch.hxx2
-rw-r--r--sfx2/source/appl/helpinterceptor.cxx58
-rw-r--r--sfx2/source/appl/helpinterceptor.hxx8
-rw-r--r--sfx2/source/appl/imagemgr.cxx44
-rw-r--r--sfx2/source/appl/imestatuswindow.cxx61
-rw-r--r--sfx2/source/appl/imestatuswindow.hxx5
-rw-r--r--sfx2/source/appl/impldde.cxx65
-rw-r--r--sfx2/source/appl/impldde.hxx7
-rw-r--r--sfx2/source/appl/linkmgr2.cxx210
-rw-r--r--sfx2/source/appl/linksrc.cxx15
-rw-r--r--sfx2/source/appl/lnkbase2.cxx168
-rw-r--r--sfx2/source/appl/module.cxx71
-rw-r--r--sfx2/source/appl/newhelp.cxx161
-rwxr-xr-x[-rw-r--r--]sfx2/source/appl/newhelp.hrc0
-rw-r--r--sfx2/source/appl/newhelp.hxx7
-rw-r--r--sfx2/source/appl/newhelp.src141
-rw-r--r--sfx2/source/appl/opengrf.cxx35
-rw-r--r--sfx2/source/appl/panelist.hxx3
-rw-r--r--sfx2/source/appl/sfxhelp.cxx377
-rw-r--r--sfx2/source/appl/sfxpicklist.cxx76
-rw-r--r--sfx2/source/appl/shutdownicon.cxx129
-rw-r--r--sfx2/source/appl/shutdownicon.hxx11
-rw-r--r--sfx2/source/appl/shutdowniconOs2.cxx4
-rwxr-xr-x[-rw-r--r--]sfx2/source/appl/shutdowniconaqua.mm13
-rw-r--r--sfx2/source/appl/shutdowniconunx.cxx175
-rw-r--r--sfx2/source/appl/shutdowniconw32.cxx92
-rw-r--r--sfx2/source/appl/workwin.cxx477
-rw-r--r--sfx2/source/appl/xpackcreator.cxx8
-rw-r--r--sfx2/source/appl/xpackcreator.hxx2
52 files changed, 1863 insertions, 2337 deletions
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index d8442bb215f6..c69b3939ee99 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,7 +38,6 @@
#include <sfx2/app.hxx>
#include <sfx2/frame.hxx>
-#include <vos/process.hxx>
#include <tools/simplerm.hxx>
#include <tools/config.hxx>
#include <basic/basrdll.hxx>
@@ -121,7 +121,7 @@
#include <sfx2/mnuitem.hxx>
#endif
-#if defined( WNT ) || defined( OS2 )
+#if defined( WNT )
#define DDE_AVAILABLE
#endif
@@ -147,137 +147,119 @@
#include <framework/addonsoptions.hxx>
#include <svtools/ttprops.hxx>
#include <unotools/extendedsecurityoptions.hxx>
+#include <rtl/instance.hxx>
using namespace ::com::sun::star;
// Static member
SfxApplication* SfxApplication::pApp = NULL;
static BasicDLL* pBasic = NULL;
+static SfxHelp* pSfxHelp = NULL;
-class SfxPropertyHandler : public PropertyHandler
+namespace
{
- virtual void Property( ApplicationProperty& );
-};
-
-static SfxPropertyHandler* pPropertyHandler = 0;
-
-SfxPropertyHandler* GetOrCreatePropertyHandler()
-{
- if ( !pPropertyHandler )
+ class SfxPropertyHandler : public PropertyHandler
{
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if ( !pPropertyHandler )
- pPropertyHandler = new SfxPropertyHandler;
- }
-
- return pPropertyHandler;
-}
+ virtual void Property( ApplicationProperty& );
+ };
-void SfxPropertyHandler::Property( ApplicationProperty& rProp )
-{
- TTProperties* pTTProperties = PTR_CAST( TTProperties, &rProp );
- if ( pTTProperties )
+ void SfxPropertyHandler::Property( ApplicationProperty& rProp )
{
- pTTProperties->nPropertyVersion = TT_PROPERTIES_VERSION;
- switch ( pTTProperties->nActualPR )
+ TTProperties* pTTProperties = PTR_CAST( TTProperties, &rProp );
+ if ( pTTProperties )
{
- case TT_PR_SLOTS:
- {
- pTTProperties->nSidOpenUrl = SID_OPENURL;
- pTTProperties->nSidFileName = SID_FILE_NAME;
- pTTProperties->nSidNewDocDirect = SID_NEWDOCDIRECT;
- pTTProperties->nSidCopy = SID_COPY;
- pTTProperties->nSidPaste = SID_PASTE;
- pTTProperties->nSidSourceView = SID_SOURCEVIEW;
- pTTProperties->nSidSelectAll = SID_SELECTALL;
- pTTProperties->nSidReferer = SID_REFERER;
- pTTProperties->nActualPR = 0;
- }
- break;
- case TT_PR_DISPATCHER:
+ pTTProperties->nPropertyVersion = TT_PROPERTIES_VERSION;
+ switch ( pTTProperties->nActualPR )
{
- // interface for TestTool
- SfxViewFrame* pViewFrame=0;
- SfxDispatcher* pDispatcher=0;
- pViewFrame = SfxViewFrame::Current();
- if ( !pViewFrame )
- pViewFrame = SfxViewFrame::GetFirst();
- if ( pViewFrame )
- pDispatcher = pViewFrame->GetDispatcher();
- else
- pDispatcher = NULL;
- if ( !pDispatcher )
- pTTProperties->nActualPR = TT_PR_ERR_NODISPATCHER;
- else
+ case TT_PR_SLOTS:
{
- pDispatcher->SetExecuteMode(EXECUTEMODE_DIALOGASYNCHRON);
- if ( pTTProperties->mnSID == SID_NEWDOCDIRECT
- || pTTProperties->mnSID == SID_OPENDOC )
+ pTTProperties->nSidOpenUrl = SID_OPENURL;
+ pTTProperties->nSidFileName = SID_FILE_NAME;
+ pTTProperties->nSidNewDocDirect = SID_NEWDOCDIRECT;
+ pTTProperties->nSidCopy = SID_COPY;
+ pTTProperties->nSidPaste = SID_PASTE;
+ pTTProperties->nSidSourceView = SID_SOURCEVIEW;
+ pTTProperties->nSidSelectAll = SID_SELECTALL;
+ pTTProperties->nSidReferer = SID_REFERER;
+ pTTProperties->nActualPR = 0;
+ }
+ break;
+ case TT_PR_DISPATCHER:
+ {
+ // interface for TestTool
+ SfxViewFrame* pViewFrame=0;
+ SfxDispatcher* pDispatcher=0;
+ pViewFrame = SfxViewFrame::Current();
+ if ( !pViewFrame )
+ pViewFrame = SfxViewFrame::GetFirst();
+ if ( pViewFrame )
+ pDispatcher = pViewFrame->GetDispatcher();
+ else
+ pDispatcher = NULL;
+ if ( !pDispatcher )
+ pTTProperties->nActualPR = TT_PR_ERR_NODISPATCHER;
+ else
{
- SfxPoolItem** pArgs = pTTProperties->mppArgs;
- SfxAllItemSet aSet( SFX_APP()->GetPool() );
- if ( pArgs && *pArgs )
- {
- for ( SfxPoolItem **pArg = pArgs; *pArg; ++pArg )
- aSet.Put( **pArg );
- }
- if ( pTTProperties->mnSID == SID_NEWDOCDIRECT )
+ pDispatcher->SetExecuteMode(EXECUTEMODE_DIALOGASYNCHRON);
+ if ( pTTProperties->mnSID == SID_NEWDOCDIRECT
+ || pTTProperties->mnSID == SID_OPENDOC )
{
- String aFactory = String::CreateFromAscii("private:factory/");
+ SfxPoolItem** pArgs = pTTProperties->mppArgs;
+ SfxAllItemSet aSet( SFX_APP()->GetPool() );
if ( pArgs && *pArgs )
{
- SFX_ITEMSET_ARG( &aSet, pFactoryName, SfxStringItem, SID_NEWDOCDIRECT, sal_False );
- if ( pFactoryName )
- aFactory += pFactoryName->GetValue();
+ for ( SfxPoolItem **pArg = pArgs; *pArg; ++pArg )
+ aSet.Put( **pArg );
+ }
+ if ( pTTProperties->mnSID == SID_NEWDOCDIRECT )
+ {
+ String aFactory = String::CreateFromAscii("private:factory/");
+ if ( pArgs && *pArgs )
+ {
+ SFX_ITEMSET_ARG( &aSet, pFactoryName, SfxStringItem, SID_NEWDOCDIRECT, sal_False );
+ if ( pFactoryName )
+ aFactory += pFactoryName->GetValue();
+ else
+ aFactory += String::CreateFromAscii("swriter");
+ }
else
aFactory += String::CreateFromAscii("swriter");
+
+ aSet.Put( SfxStringItem( SID_FILE_NAME, aFactory ) );
+ aSet.ClearItem( SID_NEWDOCDIRECT );
+ pTTProperties->mnSID = SID_OPENDOC;
}
- else
- aFactory += String::CreateFromAscii("swriter");
- aSet.Put( SfxStringItem( SID_FILE_NAME, aFactory ) );
- aSet.ClearItem( SID_NEWDOCDIRECT );
- pTTProperties->mnSID = SID_OPENDOC;
+ aSet.Put( SfxStringItem( SID_TARGETNAME, DEFINE_CONST_UNICODE("_blank") ) );
+ if ( pDispatcher->ExecuteFunction( pTTProperties->mnSID, aSet, pTTProperties->mnMode )
+ == EXECUTE_NO )
+ pTTProperties->nActualPR = TT_PR_ERR_NOEXECUTE;
+ else
+ pTTProperties->nActualPR = 0;
}
-
- aSet.Put( SfxStringItem( SID_TARGETNAME, DEFINE_CONST_UNICODE("_blank") ) );
- if ( pDispatcher->ExecuteFunction( pTTProperties->mnSID, aSet, pTTProperties->mnMode )
- == EXECUTE_NO )
- pTTProperties->nActualPR = TT_PR_ERR_NOEXECUTE;
- else
- pTTProperties->nActualPR = 0;
- }
- else
- {
- if ( pDispatcher->ExecuteFunction(
- pTTProperties->mnSID, pTTProperties->mppArgs, pTTProperties->mnMode )
- == EXECUTE_NO )
- pTTProperties->nActualPR = TT_PR_ERR_NOEXECUTE;
else
- pTTProperties->nActualPR = 0;
+ {
+ if ( pDispatcher->ExecuteFunction(
+ pTTProperties->mnSID, pTTProperties->mppArgs, pTTProperties->mnMode )
+ == EXECUTE_NO )
+ pTTProperties->nActualPR = TT_PR_ERR_NOEXECUTE;
+ else
+ pTTProperties->nActualPR = 0;
+ }
}
}
+ break;
+ default:
+ {
+ pTTProperties->nPropertyVersion = 0;
+ }
}
- break;
-/*
- case TT_PR_IMG:
- {
- SvDataMemberObjectRef aDataObject = new SvDataMemberObject();
- SvData* pDataBmp = new SvData( FORMAT_BITMAP );
- pDataBmp->SetData( pTTProperties->mpBmp );
- aDataObject->Append( pDataBmp );
- aDataObject->CopyClipboard();
- pTTProperties->nActualPR = 0;
- }
- break;
-*/
- default:
- {
- pTTProperties->nPropertyVersion = 0;
- }
+ return;
}
- return;
}
+
+ class thePropertyHandler
+ : public rtl::Static<SfxPropertyHandler, thePropertyHandler> {};
}
#include <framework/imageproducer.hxx>
@@ -297,15 +279,16 @@ SfxApplication* SfxApplication::GetOrCreate()
SfxApplication *pNew = new SfxApplication;
//TODO/CLEANUP
- //ist das Mutex-Handling OK?
+ // Is the Mutex-Handling OK?
static ::osl::Mutex aProtector;
::osl::MutexGuard aGuard2( aProtector );
RTL_LOGFILE_CONTEXT( aLog, "sfx2 (mb93783) ::SfxApplication::SetApp" );
pApp = pNew;
- // at the moment a bug may occur when Initialize_Impl returns sal_False, but this is only temporary because all code that may cause such a
- // fault will be moved outside the SFX
+ // at the moment a bug may occur when Initialize_Impl returns FALSE,
+ // but this is only temporary because all code that may cause such
+ // a fault will be moved outside the SFX
pApp->Initialize_Impl();
::framework::SetImageProducer( GetImage );
@@ -316,7 +299,6 @@ SfxApplication* SfxApplication::GetOrCreate()
::framework::SetIsDockingWindowVisible( IsDockingWindowVisible );
::framework::SetActivateToolPanel( &SfxViewFrame::ActivateToolPanel );
- SfxHelp* pSfxHelp = new SfxHelp;
Application::SetHelp( pSfxHelp );
if ( SvtHelpOptions().IsHelpTips() )
Help::EnableQuickHelp();
@@ -336,12 +318,11 @@ SfxApplication::SfxApplication()
RTL_LOGFILE_CONTEXT( aLog, "sfx2 (mb93783) ::SfxApplication::SfxApplication" );
SetName( DEFINE_CONST_UNICODE("StarOffice") );
- GetpApp()->SetPropertyHandler( GetOrCreatePropertyHandler() );
+ GetpApp()->SetPropertyHandler( &thePropertyHandler::get() );
SvtViewOptions::AcquireOptions();
pAppData_Impl = new SfxAppData_Impl( this );
- pAppData_Impl->UpdateApplicationSettings( SvtMenuOptions().IsEntryHidingEnabled() );
pAppData_Impl->m_xImeStatusWindow->init();
pApp->PreInit();
@@ -353,7 +334,7 @@ SfxApplication::SfxApplication()
#else
if( !InitializeDde() )
{
- ByteString aStr( "Kein DDE-Service moeglich. Fehler: " );
+ ByteString aStr( "No DDE-Service possible. Error: " );
if( GetDdeService() )
aStr += ByteString::CreateFromInt32(GetDdeService()->GetError());
else
@@ -363,6 +344,8 @@ SfxApplication::SfxApplication()
#endif
#endif
+ pSfxHelp = new SfxHelp;
+
pBasic = new BasicDLL;
StarBASIC::SetGlobalErrorHdl( LINK( this, SfxApplication, GlobalBasicErrorHdl_Impl ) );
RTL_LOGFILE_CONTEXT_TRACE( aLog, "} initialize DDE" );
@@ -376,6 +359,9 @@ SfxApplication::~SfxApplication()
SfxModule::DestroyModules_Impl();
+ delete pSfxHelp;
+ Application::SetHelp( NULL );
+
// delete global options
SvtViewOptions::ReleaseOptions();
delete pBasic;
@@ -391,16 +377,15 @@ SfxApplication::~SfxApplication()
const String& SfxApplication::GetLastDir_Impl() const
-/* [Beschreibung]
+/* [Description]
- Interne Methode, mit der im SFx das zuletzt mit der Methode
- <SfxApplication::SetLastDir_Impl()> gesetzte Verzeichnis
- zurueckgegeben wird.
+ Internal method by which the last set directory with the method
+ <SfxApplication::SetLastDir_Impl()> in SFX is returned.
- Dieses ist i.d.R. das zuletzt durch den SfxFileDialog
- angesprochene Verzeichnis.
+ This is usually the most recently addressed by the
+ SfxFileDialog directory.
- [Querverweis]
+ [Cross-reference]
<SfxApplication::SetLastDir_Impl()>
*/
@@ -410,11 +395,11 @@ const String& SfxApplication::GetLastDir_Impl() const
const String& SfxApplication::GetLastSaveDirectory() const
-/* [Beschreibung]
+/* [Description]
- Wie <SfxApplication::GetLastDir_Impl()>, nur extern
+ As <SfxApplication::GetLastDir_Impl()>, only external
- [Querverweis]
+ [Cross-reference]
<SfxApplication::GetLastDir_Impl()>
*/
@@ -426,15 +411,15 @@ const String& SfxApplication::GetLastSaveDirectory() const
void SfxApplication::SetLastDir_Impl
(
- const String& rNewDir /* kompletter Verzeichnis-Pfad als String */
- )
+ const String& rNewDir /* Complete directory path as a string */
+)
-/* [Beschreibung]
+/* [Description]
- Interne Methode, mit der ein Verzeichnis-Pfad gesetzt wird, der
- zuletzt (z.B. durch den SfxFileDialog) angesprochen wurde.
+ Internal Method, by which a directory path is set that was last addressed
+ (eg by the SfxFileDialog).
- [Querverweis]
+ [Cross-reference]
<SfxApplication::GetLastDir_Impl()>
*/
@@ -472,9 +457,7 @@ void SfxApplication::SetViewFrame_Impl( SfxViewFrame *pFrame )
// DocWinActivate : both frames belong to the same TopWindow
// TopWinActivate : both frames belong to different TopWindows
-// not used anymore!
-// sal_Bool bDocWinActivate = pOldContainerFrame && pNewContainerFrame &&
-// pOldContainerFrame->GetTopViewFrame() == pNewContainerFrame->GetTopViewFrame();
+
sal_Bool bTaskActivate = pOldContainerFrame != pNewContainerFrame;
if ( pOldContainerFrame )
@@ -489,15 +472,6 @@ void SfxApplication::SetViewFrame_Impl( SfxViewFrame *pFrame )
pAppData_Impl->pViewFrame = pFrame;
- //const SfxObjectShell* pSh = pViewFrame ? pViewFrame->GetObjectShell() : 0;
- //if ( !pSh )
- //{
- // // otherwise BaseURL is set in activation of document
- // INetURLObject aObject( SvtPathOptions().GetWorkPath() );
- // aObject.setFinalSlash();
- // INetURLObject::SetBaseURL( aObject.GetMainURL( INetURLObject::NO_DECODE ) );
- //}
-
if( pNewContainerFrame )
{
pNewContainerFrame->DoActivate( bTaskActivate );
@@ -557,8 +531,7 @@ short SfxApplication::QuerySave_Impl( SfxObjectShell& rDoc, sal_Bool /*bAutoSave
ResMgr* SfxApplication::CreateResManager( const char *pPrefix )
{
- String aMgrName = String::CreateFromAscii( pPrefix );
- return ResMgr::CreateResMgr(U2S(aMgrName));
+ return ResMgr::CreateResMgr(pPrefix);
}
//---------------------------------------------------------------------
@@ -727,7 +700,7 @@ IMPL_LINK( SfxApplication, GlobalBasicErrorHdl_Impl, StarBASIC*, pStarBasic )
basicide_handle_basic_error pSymbol = (basicide_handle_basic_error) osl_getFunctionSymbol( handleMod, aSymbol.pData );
// call basicide_handle_basic_error in basctl
- long nRet = pSymbol( pStarBasic );
+ long nRet = pSymbol ? pSymbol( pStarBasic ) : 0;
return nRet;
}
@@ -743,8 +716,8 @@ sal_Bool SfxApplication::IsXScriptURL( const String& rScriptURL )
::com::sun::star::uno::Reference
< ::com::sun::star::uri::XUriReferenceFactory >
xFactory( xSMgr->createInstance(
- ::rtl::OUString::createFromAscii(
- "com.sun.star.uri.UriReferenceFactory" ) ),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.uri.UriReferenceFactory" )) ),
::com::sun::star::uno::UNO_QUERY );
if ( xFactory.is() )
@@ -823,3 +796,5 @@ ErrCode SfxApplication::CallBasic( const String& rCode, BasicManager* pMgr, SbxA
{
return pMgr->ExecuteMacro( rCode, pArgs, pRet);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/app.hrc b/sfx2/source/appl/app.hrc
index ff01fd358d4d..25e4e4527e37 100644..100755
--- a/sfx2/source/appl/app.hrc
+++ b/sfx2/source/appl/app.hrc
@@ -34,9 +34,6 @@
#define ACC_IBM (RID_SFX_APP_START+2)
#define MSG_ERR_NO_WEBBROWSER_FOUND (RID_SFX_APP_START+7)
-// Note: no longer in use
-// #define MSG_ERR_EXTERNAL_APP_NOT_FOUND (RID_SFX_APP_START+8)
-
#define MSG_ISPRINTING_QUERYABORT (RID_SFX_APP_START+9)
#define MSG_CANT_QUIT (RID_SFX_APP_START+10)
#define STR_ISMODIFIED (RID_SFX_APP_START+11)
@@ -77,13 +74,9 @@
#define IMG_HELP_TOOLBOX_COPY (RID_SFX_APP_START+118)
#define IMG_HELP_CONTENT_BOOK_OPEN (RID_SFX_APP_START+120)
-#define IMG_HELP_CONTENT_BOOK_OPEN_HC (RID_SFX_APP_START+121)
#define IMG_HELP_CONTENT_BOOK_CLOSED (RID_SFX_APP_START+122)
-#define IMG_HELP_CONTENT_BOOK_CLOSED_HC (RID_SFX_APP_START+123)
#define IMG_HELP_CONTENT_DOC (RID_SFX_APP_START+124)
-#define IMG_HELP_CONTENT_DOC_HC (RID_SFX_APP_START+125) // image
-
#define STR_HELP_WINDOW_TITLE (RID_SFX_APP_START+125) // string
#define STR_HELP_BUTTON_INDEX_ON (RID_SFX_APP_START+126)
@@ -114,16 +107,6 @@
#define RID_HELP_ONSTARTUP_BOX (RID_SFX_APP_START+144)
#define RID_HELP_ONSTARTUP_TEXT (RID_SFX_APP_START+145)
-#define IMG_HELP_TOOLBOX_HC_INDEX_ON (RID_SFX_APP_START+150)
-#define IMG_HELP_TOOLBOX_HC_INDEX_OFF (RID_SFX_APP_START+151)
-#define IMG_HELP_TOOLBOX_HC_START (RID_SFX_APP_START+152)
-#define IMG_HELP_TOOLBOX_HC_PREV (RID_SFX_APP_START+153)
-#define IMG_HELP_TOOLBOX_HC_NEXT (RID_SFX_APP_START+154)
-#define IMG_HELP_TOOLBOX_HC_PRINT (RID_SFX_APP_START+155)
-#define IMG_HELP_TOOLBOX_HC_BOOKMARKS (RID_SFX_APP_START+156)
-#define IMG_HELP_TOOLBOX_HC_SEARCHDIALOG (RID_SFX_APP_START+157)
-#define IMG_HELP_TOOLBOX_HC_COPY (RID_SFX_APP_START+158)
-
#define IMG_HELP_TOOLBOX_L_INDEX_ON (RID_SFX_APP_START+160)
#define IMG_HELP_TOOLBOX_L_INDEX_OFF (RID_SFX_APP_START+161)
#define IMG_HELP_TOOLBOX_L_START (RID_SFX_APP_START+162)
@@ -134,31 +117,15 @@
#define IMG_HELP_TOOLBOX_L_SEARCHDIALOG (RID_SFX_APP_START+167)
#define IMG_HELP_TOOLBOX_L_COPY (RID_SFX_APP_START+168)
-#define IMG_HELP_TOOLBOX_HCL_INDEX_ON (RID_SFX_APP_START+170)
-#define IMG_HELP_TOOLBOX_HCL_INDEX_OFF (RID_SFX_APP_START+171)
-#define IMG_HELP_TOOLBOX_HCL_START (RID_SFX_APP_START+172)
-#define IMG_HELP_TOOLBOX_HCL_PREV (RID_SFX_APP_START+173)
-#define IMG_HELP_TOOLBOX_HCL_NEXT (RID_SFX_APP_START+174)
-#define IMG_HELP_TOOLBOX_HCL_PRINT (RID_SFX_APP_START+175)
-#define IMG_HELP_TOOLBOX_HCL_BOOKMARKS (RID_SFX_APP_START+176)
-#define IMG_HELP_TOOLBOX_HCL_SEARCHDIALOG (RID_SFX_APP_START+177)
-#define IMG_HELP_TOOLBOX_HCL_COPY (RID_SFX_APP_START+178)
-
#define RID_SECURITY_WARNING_HYPERLINK (RID_SFX_APP_START + 180)
#define RID_SECURITY_WARNING_TITLE (RID_SFX_APP_START + 181)
#define RID_DESKTOP (RID_SFX_APP_START + 184)
-// #define RID_XMLSEC_WARNING_BROKENSIGNATURE (RID_SFX_APP_START + 185)
#define RID_XMLSEC_QUERY_LOSINGSIGNATURE (RID_SFX_APP_START + 186)
#define RID_XMLSEC_QUERY_SAVEBEFORESIGN (RID_SFX_APP_START + 187)
- // FREE
- // FREE
-#define RID_XMLSEC_INFO_WRONGDOCFORMAT (RID_SFX_APP_START + 190)
-/* obsolete
-#define RID_WARNING_MACROSDISABLED (RID_SFX_APP_START + 191)
-*/
+#define RID_XMLSEC_INFO_WRONGDOCFORMAT (RID_SFX_APP_START + 190)
#define STR_QUERY_UPDATE_LINKS (RID_SFX_APP_START + 192)
#define STR_DDE_ERROR (RID_SFX_APP_START + 193)
@@ -176,6 +143,16 @@
#define RID_SVXSTR_GRFILTER_FILTERERROR (RID_SFX_APP_START + 202)
#define RID_SVXSTR_GRFILTER_TOOBIG (RID_SFX_APP_START + 203)
+// For the License Information dialog box
+#define DLG_HELP_LICENSING (RID_SFX_APP_START + 204)
+#define STR_LICENSING_INFORMATION_1 (RID_SFX_APP_START + 205)
+#define STR_LICENSING_INFORMATION_2 (RID_SFX_APP_START + 206)
+#define STR_LICENSING_INFORMATION_3 (RID_SFX_APP_START + 207)
+#define STR_LICENSING_INFORMATION_4 (RID_SFX_APP_START + 208)
+#define STR_LICENSING_INFORMATION_5 (RID_SFX_APP_START + 209)
+#define PB_LICENSING_SHOW (RID_SFX_APP_START + 210)
+#define PB_LICENSING_CLOSE (RID_SFX_APP_START + 211)
+
#define MD_DDE_LINKEDIT (RID_SFX_APP_START + 1)
#endif // #ifndef _SFX_APP_HRC
diff --git a/sfx2/source/appl/app.src b/sfx2/source/appl/app.src
index fa5a1fc1c335..f11578805e4d 100644
--- a/sfx2/source/appl/app.src
+++ b/sfx2/source/appl/app.src
@@ -324,16 +324,6 @@ ToolBox RID_HELPBAR
{
Identifier = SID_HELP_ANNOTATE ;
};
- /*
- ToolBoxItem
- {
- Type = TOOLBOXITEM_SEPARATOR ;
- };
- ToolBoxItem
- {
- Identifier = SID_HELP_DOWNLOAD ;
- };
-*/
};
};
@@ -399,7 +389,7 @@ String STR_QUICKSTART_RECENTDOC
String STR_QUERY_UPDATE_LINKS
{
- Text [ en-US ] = "Update all links?" ;
+ Text [ en-US ] = "This document contains one or more links to external data.\n\nWould you like to change the document, and update all links\nto get the most recent data?" ;
};
String STR_DDE_ERROR
@@ -417,7 +407,6 @@ WarningBox RID_SECURITY_WARNING_HYPERLINK
WarningBox RID_SECURITY_WARNING_NO_HYPERLINKS
{
- //HelpId = HID_WARNING_SECURITY_NO_HYPERLINKS;
Buttons = WB_OK ;
DefButton = WB_DEF_OK ;
Message [ en-US ] = "For security reasons, the hyperlink cannot be executed.\nThe stated address will not be opened.";
@@ -435,7 +424,6 @@ String RID_DESKTOP
QueryBox RID_XMLSEC_QUERY_LOSINGSIGNATURE
{
-// HelpId = HID_XMLSEC_QUERY_LOSINGSIGNATURE;
Buttons = WB_YES_NO ;
DefButton = WB_DEF_NO ;
Message [ en-US ] = "Saving will remove all existing signatures.\nDo you want to continue saving the document?" ;
@@ -443,7 +431,6 @@ QueryBox RID_XMLSEC_QUERY_LOSINGSIGNATURE
QueryBox RID_XMLSEC_QUERY_SAVEBEFORESIGN
{
-// HelpId = HID_XMLSEC_QUERY_SAVEBEFORESIGN;
Buttons = WB_YES_NO ;
DefButton = WB_DEF_YES ;
Message [ en-US ] = "The document has to be saved before it can be signed.\nDo you want to save the document?" ;
@@ -451,7 +438,6 @@ QueryBox RID_XMLSEC_QUERY_SAVEBEFORESIGN
InfoBox RID_XMLSEC_INFO_WRONGDOCFORMAT
{
-// HelpId = HID_XMLSEC_INFO_WRONGDOCFORMAT;
Message [ en-US ] = "This document must be saved in OpenDocument file format before it can be digitally signed." ;
};
@@ -516,3 +502,57 @@ String RID_SVXSTR_GRFILTER_TOOBIG
Text [ en-US ] = "Not enough memory to insert graphic" ;
};
+ModalDialog DLG_HELP_LICENSING
+{
+ // Size is computed
+ Text [ en-US ] = "Licensing and Legal information";
+ MOVEABLE = TRUE ;
+ CLOSEABLE = TRUE ;
+ OUTPUTSIZE = TRUE ;
+ SVLOOK = TRUE ;
+ String STR_LICENSING_INFORMATION_1
+ {
+ Text [ en-US ] =
+ "%PRODUCTNAME is made available subject to the terms of GNU Lesser General Public\n"
+ "License Version 3. A copy of the LGPL license can be found at\n"
+ "http://www.gnu.org/licenses/lgpl-3.0.html" ;
+ };
+ String STR_LICENSING_INFORMATION_2
+ {
+ Text [ en-US ] =
+ "Third Party Code Additional copyright notices and license terms applicable to\n"
+ "portions of the Software are set forth in the THIRDPARTYLICENSEREADME.html\n"
+ "file; choose Show License to see exact details in English." ;
+ };
+ String STR_LICENSING_INFORMATION_3
+ {
+ Text [ en-US ] =
+ "All trademarks and registered trademarks mentioned herein are the property of\n"
+ "their respective owners." ;
+ };
+ String STR_LICENSING_INFORMATION_4
+ {
+ Text [ en-US ] =
+ "Copyright © 2000, 2010 LibreOffice contributors and/or their affiliates. All rights\n"
+ "reserved." ;
+ };
+ String STR_LICENSING_INFORMATION_5
+ {
+ Text [ en-US ] =
+ "This product was created by %OOOVENDOR, based on OpenOffice.org,\n"
+ "which is Copyright 2000, 2010 Oracle and/or its affiliates.\n"
+ "%OOOVENDOR acknowledges all community members, please see\n"
+ "http://www.libreoffice.org/ for more details." ;
+ };
+ OKButton PB_LICENSING_SHOW
+ {
+ // Position and size is computed
+ Text [ en-US ] = "~Show License" ;
+ DefButton = TRUE ;
+ };
+ CancelButton PB_LICENSING_CLOSE
+ {
+ // Position and size is computed
+ Text [ en-US ] = "~Close" ;
+ };
+};
diff --git a/sfx2/source/appl/appbas.cxx b/sfx2/source/appl/appbas.cxx
index 6d6c8ace5a09..a776e09d1f74 100644
--- a/sfx2/source/appl/appbas.cxx
+++ b/sfx2/source/appl/appbas.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -86,7 +87,7 @@
#define ITEMID_SEARCH SID_SEARCH_ITEM
#include <svl/srchitem.hxx>
-#include <vos/socket.hxx>
+#include <osl/socket.hxx>
#define SFX_TYPEMAP
#define Selection
@@ -99,17 +100,15 @@ using namespace ::com::sun::star::script;
using ::basic::BasicManagerRepository;
-//========================================================================
-
//------------------------------------------------------------------------
-String lcl_GetVersionString(ResMgr* /*pAppData_ImplResMgr*/)
+String lcl_GetVersionString()
{
::rtl::OUString aDefault;
String aVersion( utl::Bootstrap::getBuildIdData( aDefault ));
if ( aVersion.Len() == 0 )
{
- DBG_ERROR( "No BUILDID in bootstrap file found" );
+ OSL_FAIL( "No BUILDID in bootstrap file found" );
}
aVersion.Erase( 0, aVersion.Search( ':' ) + 1 );
@@ -133,46 +132,6 @@ sal_uInt16 SfxApplication::SaveBasicAndDialogContainer() const
//--------------------------------------------------------------------
-void SfxApplication::RegisterBasicConstants
-(
- const char*, // Prefix vor Konstanten-Namen
- const SfxConstant*, // Array von <SfxConstant> Instanzen
- sal_uInt16 // Anahl der Kontanten in pConsts
-)
-
-/* [Beschreibung]
-
- Diese Methode meldet Konstanten beim BASIC an. Sie sollte on-demand
- (in GetSbxObject() der Applikation) gerufen werden. Das Array mu\s
- alphabetisch nach den Namen sortiert sein!
-
- Durch den Prefix kann Speicher gespart und das Suchen beschleunigt
- werden. Im StarOffice soll der Prefix "so" verwendet werden.
-
-
- [Beispiel]
-
- const SfxConstant __FAR_DATA aConstants[] =
- {
- SFX_BOOL_CONSTANT( "False", sal_False ),
- SFX_BOOL_CONSTANT( "True", sal_True ),
- };
-
- ...
- SFX_APP()->RegisterBasicConstants( 0, aConstants, 2 );
- ...
-
-*/
-
-{
-// DBG_ASSERT( pAppData_Impl->pBasicMgr, "no basic available" );
-
-// pAppData_Impl->pBasicMgr->GetLib(0)->Insert(
-// new SfxConstants_Impl( pPrefix, pConsts, nCount ) );
-}
-
-//--------------------------------------------------------------------
-
SbxVariable* MakeVariable( StarBASIC *pBas, SbxObject *pObject,
const char *pName, sal_uInt32 nSID, SbxDataType eType, SbxClassType eClassType )
{
@@ -229,7 +188,6 @@ void SfxApplication::PropExec_Impl( SfxRequest &rReq )
{
SbxObject* pObject = SbxBase::CreateObject( pItem->GetValue() );
pObject->AddRef();
-//(mba) rReq.SetReturnValue( SfxObjectItem( 0, pObject ) );
rReq.Done();
}
break;
@@ -237,12 +195,6 @@ void SfxApplication::PropExec_Impl( SfxRequest &rReq )
case SID_DELETE_BASICOBJECT:
{
- SFX_REQUEST_ARG(rReq, pItem, SfxObjectItem, nSID, sal_False);
- if ( pItem )
- {
-//(mba) SbxObject* pObject = pItem->GetObject();
-//(mba) pObject->ReleaseRef();
- }
break;
}
@@ -290,7 +242,6 @@ void SfxApplication::PropExec_Impl( SfxRequest &rReq )
//-------------------------------------------------------------------------
void SfxApplication::PropState_Impl( SfxItemSet &rSet )
{
-// SfxViewFrame *pFrame = SfxViewFrame::Current();
SfxWhichIter aIter(rSet);
for ( sal_uInt16 nSID = aIter.FirstWhich(); nSID; nSID = aIter.NextWhich() )
{
@@ -329,3 +280,4 @@ void SfxApplication::PropState_Impl( SfxItemSet &rSet )
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/appbaslib.cxx b/sfx2/source/appl/appbaslib.cxx
index 7f4e8cedb637..eb2c43a27dd3 100755..100644
--- a/sfx2/source/appl/appbaslib.cxx
+++ b/sfx2/source/appl/appbaslib.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -146,7 +147,7 @@ Reference< XLibraryContainer > SfxBasicManagerHolder::getLibraryContainer( Conta
case SCRIPTS: return mxBasicContainer.get();
case DIALOGS: return mxDialogContainer.get();
}
- DBG_ERROR( "SfxBasicManagerHolder::getLibraryContainer: illegal container type!" );
+ OSL_FAIL( "SfxBasicManagerHolder::getLibraryContainer: illegal container type!" );
return NULL;
}
@@ -177,7 +178,7 @@ Sequence< OUString > SfxApplicationDialogLibraryContainer::impl_getStaticSupport
if( bNeedsInit )
{
OUString* pSeq = seqServiceNames.getArray();
- pSeq[0] = OUString::createFromAscii( "com.sun.star.script.ApplicationDialogLibraryContainer" );
+ pSeq[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.ApplicationDialogLibraryContainer"));
bNeedsInit = sal_False;
}
return seqServiceNames;
@@ -191,7 +192,7 @@ OUString SfxApplicationDialogLibraryContainer::impl_getStaticImplementationName(
MutexGuard aGuard( Mutex::getGlobalMutex() );
if( bNeedsInit )
{
- aImplName = OUString::createFromAscii( "com.sun.star.comp.sfx2.ApplicationDialogLibraryContainer" );
+ aImplName = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.sfx2.ApplicationDialogLibraryContainer"));
bNeedsInit = sal_False;
}
return aImplName;
@@ -220,7 +221,7 @@ Sequence< OUString > SfxApplicationScriptLibraryContainer::impl_getStaticSupport
if( bNeedsInit )
{
OUString* pSeq = seqServiceNames.getArray();
- pSeq[0] = OUString::createFromAscii( "com.sun.star.script.ApplicationScriptLibraryContainer" );
+ pSeq[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.ApplicationScriptLibraryContainer"));
bNeedsInit = sal_False;
}
return seqServiceNames;
@@ -234,7 +235,7 @@ OUString SfxApplicationScriptLibraryContainer::impl_getStaticImplementationName(
MutexGuard aGuard( Mutex::getGlobalMutex() );
if( bNeedsInit )
{
- aImplName = OUString::createFromAscii( "com.sun.star.comp.sfx2.ApplicationScriptLibraryContainer" );
+ aImplName = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.sfx2.ApplicationScriptLibraryContainer"));
bNeedsInit = sal_False;
}
return aImplName;
@@ -250,3 +251,4 @@ Reference< XInterface > SAL_CALL SfxApplicationScriptLibraryContainer::impl_crea
return xRet;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx
index d98147078bc6..7c399b32ad2c 100644
--- a/sfx2/source/appl/appcfg.cxx
+++ b/sfx2/source/appl/appcfg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,15 +31,11 @@
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/frame/XDesktop.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
-#ifndef _COM_SUN_STAR_BEANS_PropertyValue_HPP_
#include <com/sun/star/beans/PropertyValue.hpp>
-#endif
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/util/XFlushable.hpp>
-#ifndef _STDLIB_H
#include <stdlib.h>
-#endif
#include <tools/config.hxx>
#include <vcl/sound.hxx>
#include <vcl/msgbox.hxx>
@@ -157,7 +154,7 @@ IMPL_LINK(SfxEventAsyncer_Impl, TimerHdl, Timer*, pAsyncTimer)
{
ByteString aTmp( "SfxEvent: ");
aTmp += ByteString( String( aHint.GetEventName() ), RTL_TEXTENCODING_UTF8 );
- DBG_TRACE( aTmp.GetBuffer() );
+ OSL_TRACE( "%s", aTmp.GetBuffer() );
}
#endif
SFX_APP()->Broadcast( aHint );
@@ -174,7 +171,7 @@ sal_Bool SfxApplication::GetOptions( SfxItemSet& rSet )
{
sal_Bool bRet = sal_False;
SfxItemPool &rPool = GetPool();
- String aTRUEStr('1');
+ String asal_TrueStr('1');
const sal_uInt16 *pRanges = rSet.GetRanges();
SvtSaveOptions aSaveOptions;
@@ -274,9 +271,6 @@ sal_Bool SfxApplication::GetOptions( SfxItemSet& rSet )
}
break;
case SID_ATTR_METRIC :
-// if(rSet.Put( SfxUInt16Item( rPool.GetWhich( SID_ATTR_METRIC ),
-// pOptions->GetMetric() ) ) )
-// bRet = sal_True;
break;
case SID_HELPBALLOONS :
if(rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_HELPBALLOONS ),
@@ -390,23 +384,14 @@ sal_Bool SfxApplication::GetOptions( SfxItemSet& rSet )
if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::E_SECUREURLS))
{
::com::sun::star::uno::Sequence< ::rtl::OUString > seqURLs = aSecurityOptions.GetSecureURLs();
- List aList;
+ std::vector<String> aList;
sal_uInt32 nCount = seqURLs.getLength();
sal_uInt32 nURL;
for( nURL=0; nURL<nCount; ++nURL )
- {
- aList.Insert( new String( seqURLs[nURL] ), LIST_APPEND );
- }
- if( !rSet.Put( SfxStringListItem( rPool.GetWhich(SID_SECURE_URL),
- &aList ) ) )
- {
+ aList.push_back(seqURLs[nURL]);
+
+ if( !rSet.Put( SfxStringListItem( rPool.GetWhich(SID_SECURE_URL), &aList ) ) )
bRet = sal_False;
- }
- for( nURL=0; nURL<nCount; ++nURL )
- {
- delete (String*)aList.GetObject(nURL);
- }
- aList.Clear();
}
}
break;
@@ -505,7 +490,7 @@ sal_Bool SfxApplication::GetOptions( SfxItemSet& rSet )
}
#ifdef DBG_UTIL
if ( !bRet )
- DBG_ERROR( "Putting options failed!" );
+ OSL_FAIL( "Putting options failed!" );
#endif
}
pRanges++;
@@ -520,13 +505,11 @@ sal_Bool SfxApplication::IsSecureURL( const INetURLObject& rURL, const String* p
return SvtSecurityOptions().IsSecureURL( rURL.GetMainURL( INetURLObject::NO_DECODE ), *pReferer );
}
//--------------------------------------------------------------------
-// TODO/CLEANUP: wieso zwei SetOptions Methoden?
+// TODO/CLEANUP: Why two SetOptions Methods?
void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
{
const SfxPoolItem *pItem = 0;
SfxItemPool &rPool = GetPool();
- sal_Bool bResetSession = sal_False;
- sal_Bool bProxiesModified = sal_False;
SvtSaveOptions aSaveOptions;
SvtUndoOptions aUndoOptions;
@@ -609,14 +592,14 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
aSaveOptions.SetDocInfoSave(((const SfxBoolItem *)pItem)->GetValue());
}
- // offende Dokumente merken
+ // Mark open Documents
if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_WORKINGSET), sal_True, &pItem))
{
DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
aSaveOptions.SetSaveWorkingSet(((const SfxBoolItem *)pItem)->GetValue());
}
- // Fenster-Einstellung speichern
+ // Save window settings
if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_SAVEDOCVIEW), sal_True, &pItem))
{
DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
@@ -627,7 +610,6 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_METRIC), sal_True, &pItem))
{
DBG_ASSERT(pItem->ISA(SfxUInt16Item), "UInt16Item expected");
-// pOptions->SetMetric((FieldUnit)((const SfxUInt16Item*)pItem)->GetValue());
}
// HelpBalloons
@@ -672,7 +654,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
sal_Bool bReset = ((const SfxBoolItem *)pItem)->GetValue();
if ( bReset )
{
- DBG_ERROR( "Not implemented, may be EOL!" );
+ OSL_FAIL( "Not implemented, may be EOL!" );
} }
if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_HELP_STYLESHEET ), sal_True, &pItem))
@@ -702,16 +684,16 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
sal_uInt16 nUndoCount = ((const SfxUInt16Item*)pItem)->GetValue();
aUndoOptions.SetUndoCount( nUndoCount );
- // um alle Undo-Manager zu erwischen: "uber alle Frames iterieren
+ // To catch all Undo-Managers: Iterate over all Frames
for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst();
pFrame;
pFrame = SfxViewFrame::GetNext(*pFrame) )
{
- // den Dispatcher des Frames rausholen
+ // Get the Dispatcher of the Frames
SfxDispatcher *pDispat = pFrame->GetDispatcher();
pDispat->Flush();
- // "uber alle SfxShells auf dem Stack des Dispatchers iterieren
+ // Iterate over all SfxShells on the Dispatchers Stack
sal_uInt16 nIdx = 0;
for ( SfxShell *pSh = pDispat->GetShell(nIdx);
pSh;
@@ -743,51 +725,38 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
{
DBG_ASSERT(pItem->ISA(SfxBoolItem), "SfxBoolItem expected");
aSecurityOptions.SetExecutePlugins( ( (const SfxBoolItem *)pItem )->GetValue() );
- bResetSession = sal_True;
}
if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_INET_PROXY_TYPE), sal_True, &pItem))
{
DBG_ASSERT( pItem->ISA(SfxUInt16Item), "UInt16Item expected" );
aInetOptions.SetProxyType((SvtInetOptions::ProxyType)( (const SfxUInt16Item*)pItem )->GetValue());
- bResetSession = sal_True;
- bProxiesModified = sal_True;
}
if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_HTTP_PROXY_NAME ), sal_True, &pItem ) )
{
DBG_ASSERT( pItem->ISA(SfxStringItem), "StringItem expected" );
aInetOptions.SetProxyHttpName( ((const SfxStringItem *)pItem)->GetValue() );
- bResetSession = sal_True;
- bProxiesModified = sal_True;
}
if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_HTTP_PROXY_PORT ), sal_True, &pItem ) )
{
DBG_ASSERT( pItem->ISA(SfxInt32Item), "Int32Item expected" );
aInetOptions.SetProxyHttpPort( ( (const SfxInt32Item*)pItem )->GetValue() );
- bResetSession = sal_True;
- bProxiesModified = sal_True;
}
if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_FTP_PROXY_NAME ), sal_True, &pItem ) )
{
DBG_ASSERT( pItem->ISA(SfxStringItem), "StringItem expected" );
aInetOptions.SetProxyFtpName( ((const SfxStringItem *)pItem)->GetValue() );
- bResetSession = sal_True;
- bProxiesModified = sal_True;
}
if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_FTP_PROXY_PORT ), sal_True, &pItem ) )
{
DBG_ASSERT( pItem->ISA(SfxInt32Item), "Int32Item expected" );
aInetOptions.SetProxyFtpPort( ( (const SfxInt32Item*)pItem )->GetValue() );
- bResetSession = sal_True;
- bProxiesModified = sal_True;
}
if ( SFX_ITEM_SET == rSet.GetItemState(SID_INET_NOPROXY, sal_True, &pItem))
{
DBG_ASSERT(pItem->ISA(SfxStringItem), "StringItem expected");
aInetOptions.SetProxyNoProxy(((const SfxStringItem *)pItem)->GetValue());
- bResetSession = sal_True;
- bProxiesModified = sal_True;
}
// Secure-Referers
@@ -796,13 +765,12 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
DELETEZ(pAppData_Impl->pSecureURLs);
DBG_ASSERT(pItem->ISA(SfxStringListItem), "StringListItem expected");
- const List *pList = ((SfxStringListItem*)pItem)->GetList();
- sal_uInt32 nCount = pList->Count();
+ const std::vector<String> &aList = ((SfxStringListItem*)pItem)->GetList();
+ sal_uInt32 nCount = aList.size();
::com::sun::star::uno::Sequence< ::rtl::OUString > seqURLs(nCount);
for( sal_uInt32 nPosition=0;nPosition<nCount;++nPosition)
- {
- seqURLs[nPosition] = *(const String*)(pList->GetObject(nPosition));
- }
+ seqURLs[nPosition] = aList[nPosition];
+
aSecurityOptions.SetSecureURLs( seqURLs );
}
@@ -825,7 +793,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
#endif
}
- // geaenderte Daten speichern
+ // Store changed data
aInetOptions.flush();
}
@@ -834,7 +802,7 @@ void SfxApplication::SetOptions(const SfxItemSet &rSet)
{
SvtPathOptions aPathOptions;
- // Daten werden in DocInfo und IniManager gespeichert
+ // Data is saved in DocInfo and IniManager
const SfxPoolItem *pItem = 0;
SfxItemPool &rPool = GetPool();
@@ -933,7 +901,7 @@ void SfxApplication::SetOptions(const SfxItemSet &rSet)
//--------------------------------------------------------------------
-// alle Dokumente speichern
+// Save all Documents
sal_Bool SfxApplication::SaveAll_Impl(sal_Bool bPrompt, sal_Bool bAutoSave)
{
@@ -993,13 +961,6 @@ void SfxApplication::NotifyEvent( const SfxEventHint& rEventHint, bool bSynchron
if ( pDoc && ( pDoc->IsPreview() || !pDoc->Get_Impl()->bInitialized ) )
return;
-#ifdef DBG_UTIL
- //::rtl::OUString aName = SfxEventConfiguration::GetEventName_Impl( rEventHint.GetEventId() );
- //ByteString aTmp( "SfxEvent: ");
- //aTmp += ByteString( String(aName), RTL_TEXTENCODING_UTF8 );
- //DBG_TRACE( aTmp.GetBuffer() );
-#endif
-
if ( bSynchron )
{
#ifdef DBG_UTIL
@@ -1007,7 +968,7 @@ void SfxApplication::NotifyEvent( const SfxEventHint& rEventHint, bool bSynchron
{
ByteString aTmp( "SfxEvent: ");
aTmp += ByteString( String( rEventHint.GetEventName() ), RTL_TEXTENCODING_UTF8 );
- DBG_TRACE( aTmp.GetBuffer() );
+ OSL_TRACE( "%s", aTmp.GetBuffer() );
}
#endif
Broadcast(rEventHint);
@@ -1020,3 +981,4 @@ void SfxApplication::NotifyEvent( const SfxEventHint& rEventHint, bool bSynchron
IMPL_OBJHINT( SfxStringHint, String )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/appchild.cxx b/sfx2/source/appl/appchild.cxx
index ea7b331b839b..08a5fc054425 100644
--- a/sfx2/source/appl/appchild.cxx
+++ b/sfx2/source/appl/appchild.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,8 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sfx2.hxx"
-#ifndef GCC
-#endif
#include <svl/whiter.hxx>
#include <svl/eitem.hxx>
@@ -60,17 +59,13 @@ void SfxApplication::RegisterChildWindow_Impl( SfxModule *pMod, SfxChildWinFacto
if (!pAppData_Impl->pFactArr)
pAppData_Impl->pFactArr = new SfxChildWinFactArr_Impl;
-//#ifdef DBG_UTIL
for (sal_uInt16 nFactory=0; nFactory<pAppData_Impl->pFactArr->Count(); ++nFactory)
{
if (pFact->nId == (*pAppData_Impl->pFactArr)[nFactory]->nId)
{
pAppData_Impl->pFactArr->Remove( nFactory );
-// DBG_ERROR("ChildWindow mehrfach registriert!");
-// return;
}
}
-//#endif
pAppData_Impl->pFactArr->C40_INSERT(
SfxChildWinFactory, pFact, pAppData_Impl->pFactArr->Count() );
@@ -83,7 +78,7 @@ void SfxApplication::RegisterChildWindowContext_Impl( SfxModule *pMod, sal_uInt1
SfxChildWinFactory *pF = NULL;
if ( pMod )
{
- // Modul "ubergeben, ChildwindowFactory dort suchen
+ // Abandon Module, search there for ChildwindowFactory
pFactories = pMod->GetChildWinFactories_Impl();
if ( pFactories )
{
@@ -93,7 +88,7 @@ void SfxApplication::RegisterChildWindowContext_Impl( SfxModule *pMod, sal_uInt1
SfxChildWinFactory *pFac = (*pFactories)[nFactory];
if ( nId == pFac->nId )
{
- // Factory gefunden, Context dort registrieren
+ // Factory found, registrer Context here.
pF = pFac;
break;
}
@@ -103,9 +98,9 @@ void SfxApplication::RegisterChildWindowContext_Impl( SfxModule *pMod, sal_uInt1
if ( !pF )
{
- // Factory an der Application suchen
- DBG_ASSERT( pAppData_Impl, "Keine AppDaten!" );
- DBG_ASSERT( pAppData_Impl->pFactArr, "Keine Factories!" );
+ // Search for Factory in the Application
+ DBG_ASSERT( pAppData_Impl, "No AppData!" );
+ DBG_ASSERT( pAppData_Impl->pFactArr, "No Factories!" );
pFactories = pAppData_Impl->pFactArr;
sal_uInt16 nCount = pFactories->Count();
@@ -116,10 +111,10 @@ void SfxApplication::RegisterChildWindowContext_Impl( SfxModule *pMod, sal_uInt1
{
if ( pMod )
{
- // Wenn der Context von einem Modul registriert wurde,
- // mu\s die ChildwindowFactory auch dort zur Verf"ugung
- // stehen, sonst m"u\ste sich die Contextfactory im DLL-Exit
- // wieder abmelden !
+ // If the context of a module has been registered, then the
+ // ChildWindowFactory must also be available there,
+ // else the ContextFactory would have be unsubscribed on
+ // DLL-exit
pF = new SfxChildWinFactory( pFac->pCtor, pFac->nId,
pFac->nPos );
pMod->RegisterChildWindow( pF );
@@ -139,7 +134,7 @@ void SfxApplication::RegisterChildWindowContext_Impl( SfxModule *pMod, sal_uInt1
return;
}
- DBG_ERROR( "Kein ChildWindow fuer diesen Context!" );
+ OSL_FAIL( "No ChildWindow for this Context!" );
}
//--------------------------------------------------------------------
@@ -174,3 +169,4 @@ SfxWorkWindow* SfxApplication::GetWorkWindow_Impl(const SfxViewFrame *pFrame) co
return NULL;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/appdata.cxx b/sfx2/source/appl/appdata.cxx
index 2914c648bfe9..3838526a9eb1 100644
--- a/sfx2/source/appl/appdata.cxx
+++ b/sfx2/source/appl/appdata.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,14 +30,12 @@
#include "precompiled_sfx2.hxx"
#include <tools/cachestr.hxx>
#include <tools/config.hxx>
-#ifndef _INETSTRM_HXX //autogen
#include <svl/inetstrm.hxx>
-#endif
#include <svl/stritem.hxx>
#define _SVSTDARR_STRINGS
#include <svl/svstdarr.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/menu.hxx>
#include <vcl/msgbox.hxx>
@@ -152,20 +151,6 @@ SfxAppData_Impl::~SfxAppData_Impl()
delete pBasMgrListener;
}
-void SfxAppData_Impl::UpdateApplicationSettings( sal_Bool bDontHide )
-{
- AllSettings aAllSet = Application::GetSettings();
- StyleSettings aStyleSet = aAllSet.GetStyleSettings();
- sal_uInt32 nStyleOptions = aStyleSet.GetOptions();
- if ( bDontHide )
- nStyleOptions &= ~STYLE_OPTION_HIDEDISABLED;
- else
- nStyleOptions |= STYLE_OPTION_HIDEDISABLED;
- aStyleSet.SetOptions( nStyleOptions );
- aAllSet.SetStyleSettings( aStyleSet );
- Application::SetSettings( aAllSet );
-}
-
SfxDocumentTemplates* SfxAppData_Impl::GetDocumentTemplates()
{
if ( !pTemplates )
@@ -184,3 +169,5 @@ void SfxAppData_Impl::OnApplicationBasicManagerCreated( BasicManager& _rBasicMan
Reference< XInterface > xCurrentComponent = SfxObjectShell::GetCurrentComponent();
_rBasicManager.SetGlobalUNOConstant( "ThisComponent", makeAny( xCurrentComponent ) );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx
index 26e4fecf3864..c3fb0e9dfc92 100644
--- a/sfx2/source/appl/appdde.cxx
+++ b/sfx2/source/appl/appdde.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,8 +41,6 @@
#include <tools/urlobj.hxx>
#include <tools/diagnose_ex.h>
#include <unotools/pathoptions.hxx>
-#ifndef GCC
-#endif
#include <sfx2/app.hxx>
#include "appdata.hxx"
@@ -78,9 +77,6 @@ public:
virtual sal_Bool MakeTopic( const String& );
virtual String Topics();
-// virtual String Formats();
-// virtual String SysItems();
-// virtual String Status();
virtual sal_Bool SysTopicExecute( const String* pStr );
};
@@ -111,12 +107,6 @@ public:
virtual sal_Bool Execute( const String* );
virtual sal_Bool StartAdviseLoop();
virtual sal_Bool MakeItem( const String& rItem );
-
-// wird benoetigt?
-// virtual void Connect( long n );
-// virtual void Disconnect( long n );
-// virtual void StopAdviseLoop();
-
};
@@ -128,15 +118,14 @@ SV_IMPL_PTRARR( SfxDdeDocTopics_Impl, SfxDdeDocTopic_Impl *)
sal_Bool SfxAppEvent_Impl( ApplicationEvent &rAppEvent,
const String &rCmd, const String &rEvent )
-/* [Beschreibung]
+/* [Description]
- Pr"uft, ob 'rCmd' das Event 'rEvent' ist (ohne '(') und baut
- aus diesem dann ein <ApplicationEvent> zusammen, das per
- <Application::AppEvent()> ausgef"uhrt werden kann. Ist 'rCmd' das
- angegegeben Event 'rEvent', dann wird TRUE zur"uckgegeben, sonst FALSE.
+ Checks if 'rCmd' of the event 'rEvent' is (without '(') and then assemble
+ this data into a <ApplicationEvent>, which can be excecuted through
+ <Application::AppEvent()>. If 'rCmd' is the given event 'rEvent', then
+ TRUE is returned, otherwise FALSE.
-
- [Beispiel]
+ [Example]
rCmd = "Open(\"d:\doc\doc.sdw\")"
rEvent = "Open"
@@ -151,7 +140,7 @@ sal_Bool SfxAppEvent_Impl( ApplicationEvent &rAppEvent,
aData.Erase( 0, aEvent.Len() );
if ( aData.Len() > 2 )
{
- // in das ApplicationEvent-Format wandeln
+ // Transform into the ApplicationEvent Format
aData.Erase( aData.Len()-1, 1 );
for ( sal_uInt16 n = 0; n < aData.Len(); ++n )
{
@@ -175,31 +164,30 @@ sal_Bool SfxAppEvent_Impl( ApplicationEvent &rAppEvent,
long SfxApplication::DdeExecute
(
- const String& rCmd // in unserer BASIC-Syntax formuliert
+ const String& rCmd // Expressed in our BASIC-Syntax
)
-/* [Beschreibung]
+/* Description]
- Diese Methode kann vom Applikationsentwickler "uberladen werden,
- um an seine SfxApplication-Subklasse gerichtete DDE-Kommandos
- zu empfangen.
+ This method can be overloaded by application developers, to receive
+ DDE-commands directed to thier SfxApplication subclass.
- Die Basisimplementierung versteht die API-Funktionalit"at der
- betreffenden SfxApplication-Subklasse in BASIC-Syntax. R"uckgabewerte
- k"onnen dabei leider nicht "ubertragen werden.
+ The base implementation understands the API functionality of the
+ relevant SfxApplication subclass in BASIC syntax. Return values can
+ not be transferred, unfortunately.
*/
{
- // Print oder Open-Event?
+ // Print or Open-Event?
ApplicationEvent aAppEvent;
if ( SfxAppEvent_Impl( aAppEvent, rCmd, DEFINE_CONST_UNICODE("Print") ) ||
SfxAppEvent_Impl( aAppEvent, rCmd, DEFINE_CONST_UNICODE("Open") ) )
GetpApp()->AppEvent( aAppEvent );
else
{
- // alle anderen per BASIC
+ // all others are BASIC
StarBASIC* pBasic = GetBasic();
- ENSURE_OR_RETURN( pBasic, "where's my basic?", 0 );
+ DBG_ASSERT( pBasic, "Where is the Basic???" );
SbxVariable* pRet = pBasic->Execute( rCmd );
if( !pRet )
{
@@ -214,18 +202,17 @@ long SfxApplication::DdeExecute
long SfxApplication::DdeGetData
(
- const String&, // das anzusprechende Item
+ const String&, // the Item to be addressed
const String&, // in: Format
- ::com::sun::star::uno::Any& // out: angeforderte Daten
+ ::com::sun::star::uno::Any& // out: requested data
)
-/* [Beschreibung]
+/* [Description]
- Diese Methode kann vom Applikationsentwickler "uberladen werden,
- um an seine SfxApplication-Subklasse gerichtete DDE-Daten-Anforderungen
- zu empfangen.
+ This method can be overloaded by application developers, to receive
+ DDE-data-requests directed to thier SfxApplication subclass.
- Die Basisimplementierung liefert keine Daten und gibt 0 zur"uck.
+ The base implementation provides no data and returns 0.
*/
{
@@ -236,18 +223,17 @@ long SfxApplication::DdeGetData
long SfxApplication::DdeSetData
(
- const String&, // das anzusprechende Item
+ const String&, // the Item to be addressed
const String&, // in: Format
- const ::com::sun::star::uno::Any& // out: angeforderte Daten
+ const ::com::sun::star::uno::Any& // out: requested data
)
-/* [Beschreibung]
+/* [Description]
- Diese Methode kann vom Applikationsentwickler "uberladen werden,
- um an seine SfxApplication-Subklasse gerichtete DDE-Daten
- zu empfangen.
+ This method can be overloaded by application developers, to receive
+ DDE-data directed to thier SfxApplication subclass.
- Die Basisimplementierung nimmt keine Daten entgegen und liefert 0 zur"uck.
+ The base implementation is not receiving any data and returns 0.
*/
{
@@ -258,15 +244,15 @@ long SfxApplication::DdeSetData
::sfx2::SvLinkSource* SfxApplication::DdeCreateLinkSource
(
- const String& // das zu erzeugende Item
+ const String& // the Item to be addressed
)
-/* [Beschreibung]
+/* [Description]
- Diese Methode kann vom Applikationsentwickler "uberladen werden,
- um an seiner SfxApplication-Subklasse einen DDE-Hotlink einzurichten
+ This method can be overloaded by application developers, to establish
+ a DDE-hotlink to thier SfxApplication subclass.
- Die Basisimplementierung erzeugt keinen und liefert 0 zur"uck.
+ The base implementation is not generate a link and returns 0.
*/
{
@@ -277,21 +263,20 @@ long SfxApplication::DdeSetData
long SfxObjectShell::DdeExecute
(
- const String& rCmd // in unserer BASIC-Syntax formuliert
+ const String& rCmd // Expressed in our BASIC-Syntax
)
-/* [Beschreibung]
+/* [Description]
- Diese Methode kann vom Applikationsentwickler "uberladen werden,
- um an seine SfxObjectShell-Subklasse gerichtete DDE-Kommandos
- zu empfangen.
+ This method can be overloaded by application developers, to receive
+ DDE-commands directed to the thier SfxApplication subclass.
- Die Basisimplementierung f"uhrt nichts aus und liefert 0 zur"uck.
+ The base implementation does nothing and returns 0.
*/
{
StarBASIC* pBasic = GetBasic();
- DBG_ASSERT( pBasic, "Wo ist mein Basic???" ) ;
+ DBG_ASSERT( pBasic, "Where is the Basic???" ) ;
SbxVariable* pRet = pBasic->Execute( rCmd );
if( !pRet )
{
@@ -306,18 +291,17 @@ long SfxObjectShell::DdeExecute
long SfxObjectShell::DdeGetData
(
- const String&, // das anzusprechende Item
+ const String&, // the Item to be addressed
const String&, // in: Format
- ::com::sun::star::uno::Any& // out: angeforderte Daten
+ ::com::sun::star::uno::Any& // out: requested data
)
-/* [Beschreibung]
+/* [Description]
- Diese Methode kann vom Applikationsentwickler "uberladen werden,
- um an seine SfxObjectShell-Subklasse gerichtete DDE-Daten-Anforderungen
- zu empfangen.
+ This method can be overloaded by application developers, to receive
+ DDE-data-requests directed to thier SfxApplication subclass.
- Die Basisimplementierung liefert keine Daten und gibt 0 zur"uck.
+ The base implementation provides no data and returns 0.
*/
{
@@ -328,18 +312,17 @@ long SfxObjectShell::DdeGetData
long SfxObjectShell::DdeSetData
(
- const String&, // das anzusprechende Item
+ const String&, // the Item to be addressed
const String&, // in: Format
- const ::com::sun::star::uno::Any& // out: angeforderte Daten
+ const ::com::sun::star::uno::Any& // out: requested data
)
-/* [Beschreibung]
+/* [Description]
- Diese Methode kann vom Applikationsentwickler "uberladen werden,
- um an seine SfxObjectShell-Subklasse gerichtete DDE-Daten
- zu empfangen.
+ This method can be overloaded by application developers, to receive
+ DDE-data directed to thier SfxApplication subclass.
- Die Basisimplementierung nimmt keine Daten entgegen und liefert 0 zur"uck.
+ The base implementation is not receiving any data and returns 0.
*/
{
@@ -349,38 +332,54 @@ long SfxObjectShell::DdeSetData
//--------------------------------------------------------------------
::sfx2::SvLinkSource* SfxObjectShell::DdeCreateLinkSource
(
- const String& // das zu erzeugende Item
+ const String& // the Item to be addressed
)
-/* [Beschreibung]
+/* [Description]
- Diese Methode kann vom Applikationsentwickler "uberladen werden,
- um an seiner SfxObjectShell-Subklasse einen DDE-Hotlink einzurichten
+ This method can be overloaded by application developers, to establish
+ a DDE-hotlink to thier SfxApplication subclass.
- Die Basisimplementierung erzeugt keinen und liefert 0 zur"uck.
+ The base implementation is not generate a link and returns 0.
*/
{
return 0;
}
+void SfxObjectShell::ReconnectDdeLink(SfxObjectShell& /*rServer*/)
+{
+}
+
+void SfxObjectShell::ReconnectDdeLinks(SfxObjectShell& rServer)
+{
+ TypeId aType = TYPE(SfxObjectShell);
+ SfxObjectShell* p = GetFirst(&aType, false);
+ while (p)
+ {
+ if (&rServer != p)
+ p->ReconnectDdeLink(rServer);
+
+ p = GetNext(*p, &aType, false);
+ }
+}
+
//========================================================================
long SfxViewFrame::DdeExecute
(
- const String& rCmd // in unserer BASIC-Syntax formuliert
+ const String& rCmd // Expressed in our BASIC-Syntax
)
-/* [Beschreibung]
+/* [Description]
- Diese Methode kann vom Applikationsentwickler "uberladen werden,
- um an seine SfxViewFrame-Subklasse gerichtete DDE-Kommandos
- zu empfangen.
+ This method can be overloaded by application developers, to receive
+ DDE-commands directed to the thier SfxApplication subclass.
- Die Basisimplementierung versteht die API-Funktionalit"at des
- betreffenden SfxViewFrame, der darin dargestellten SfxViewShell und
- der betreffenden SfxObjectShell-Subklasse in BASIC-Syntax.
- R"uckgabewerte k"onnen dabei leider nicht "ubertragen werden.
+ The base implementation understands the API functionality of the
+ relevant SfxViewFrame, which is shown and the relevant SfxViewShell
+ and the relevant SfxApplication subclass in BASIC syntax. Return
+ values can not be transferred, unfortunately.
*/
{
@@ -394,18 +393,17 @@ long SfxViewFrame::DdeExecute
long SfxViewFrame::DdeGetData
(
- const String&, // das anzusprechende Item
+ const String&, // the Item to be addressed
const String&, // in: Format
- ::com::sun::star::uno::Any& // out: angeforderte Daten
+ ::com::sun::star::uno::Any& // out: requested data
)
-/* [Beschreibung]
+/* [Description]
- Diese Methode kann vom Applikationsentwickler "uberladen werden,
- um an seine SfxViewFrame-Subklasse gerichtete DDE-Daten-Anforderungen
- zu empfangen.
+ This method can be overloaded by application developers, to receive
+ DDE-data-requests directed to thier SfxApplication subclass.
- Die Basisimplementierung liefert keine Daten und gibt 0 zur"uck.
+ The base implementation provides no data and returns 0.
*/
{
@@ -416,18 +414,17 @@ long SfxViewFrame::DdeGetData
long SfxViewFrame::DdeSetData
(
- const String& , // das anzusprechende Item
- const String& , // in: Format
- const ::com::sun::star::uno::Any& // out: angeforderte Daten
+ const String&, // the Item to be addressed
+ const String&, // in: Format
+ const ::com::sun::star::uno::Any& // out: requested data
)
-/* [Beschreibung]
+/* [Description]
- Diese Methode kann vom Applikationsentwickler "uberladen werden,
- um an seine SfxViewFrame-Subklasse gerichtete DDE-Daten
- zu empfangen.
+ This method can be overloaded by application developers, to receive
+ DDE-data directed to thier SfxApplication subclass.
- Die Basisimplementierung nimmt keine Daten entgegen und liefert 0 zur"uck.
+ The base implementation is not receiving any data and returns 0.
*/
{
@@ -438,15 +435,15 @@ long SfxViewFrame::DdeSetData
::sfx2::SvLinkSource* SfxViewFrame::DdeCreateLinkSource
(
- const String& // das zu erzeugende Item
+ const String& // the Item to be addressed
)
-/* [Beschreibung]
+/* [Description]
- Diese Methode kann vom Applikationsentwickler "uberladen werden,
- um an seiner SfxViewFrame-Subklasse einen DDE-Hotlink einzurichten
+ This method can be overloaded by application developers, to establish
+ a DDE-hotlink to thier SfxApplication subclass.
- Die Basisimplementierung erzeugt keinen und liefert 0 zur"uck.
+ The base implementation is not generate a link and returns 0.
*/
{
@@ -458,7 +455,7 @@ long SfxViewFrame::DdeSetData
sal_Bool SfxApplication::InitializeDde()
{
DBG_ASSERT( !pAppData_Impl->pDdeService,
- "Dde kann nicht mehrfach initialisiert werden" );
+ "Dde can not be initialized multiple times" );
pAppData_Impl->pDdeService = new ImplDdeService( Application::GetAppName() );
int nError = pAppData_Impl->pDdeService->GetError();
@@ -466,10 +463,10 @@ sal_Bool SfxApplication::InitializeDde()
{
pAppData_Impl->pDocTopics = new SfxDdeDocTopics_Impl;
- // wir wollen auf jedenfall RTF unterstuetzen!
+ // we certainly want to support RTF!
pAppData_Impl->pDdeService->AddFormat( FORMAT_RTF );
- // Config-Pfad als Topic wegen Mehrfachstart
+ // Config path as a topic becauseof multiple starts
INetURLObject aOfficeLockFile( SvtPathOptions().GetUserConfigPath() );
aOfficeLockFile.insertName( DEFINE_CONST_UNICODE( "soffice.lck" ) );
String aService( SfxDdeServiceName_Impl(
@@ -494,20 +491,18 @@ void SfxAppData_Impl::DeInitDDE()
void SfxApplication::AddDdeTopic( SfxObjectShell* pSh )
{
- DBG_ASSERT( pAppData_Impl->pDocTopics, "es gibt gar keinen Dde-Service" );
- //OV: Im Serverbetrieb ist DDE abgeklemmt!
+ DBG_ASSERT( pAppData_Impl->pDocTopics, "There is no Dde-Service" );
+ //OV: DDE is disconnected in server mode!
if( !pAppData_Impl->pDocTopics )
return;
- // doppeltes Eintragen verhindern
+ // prevent double submit
String sShellNm;
sal_Bool bFnd = sal_False;
for( sal_uInt16 n = pAppData_Impl->pDocTopics->Count(); n; )
if( (*pAppData_Impl->pDocTopics)[ --n ]->pSh == pSh )
{
- // JP 18.03.96 - Bug 26470
- // falls das Document unbenannt wurde, ist trotzdem ein
- // neues Topics anzulegen!
+ // If the document is untitled, is still a new Topic is created!
if( !bFnd )
{
bFnd = sal_True;
@@ -526,8 +521,8 @@ void SfxApplication::AddDdeTopic( SfxObjectShell* pSh )
void SfxApplication::RemoveDdeTopic( SfxObjectShell* pSh )
{
- DBG_ASSERT( pAppData_Impl->pDocTopics, "es gibt gar keinen Dde-Service" );
- //OV: Im Serverbetrieb ist DDE abgeklemmt!
+ DBG_ASSERT( pAppData_Impl->pDocTopics, "There is no Dde-Service" );
+ //OV: DDE is disconnected in server mode!
if( !pAppData_Impl->pDocTopics )
return;
@@ -554,14 +549,14 @@ DdeService* SfxApplication::GetDdeService()
sal_Bool ImplDdeService::MakeTopic( const String& rNm )
{
- // Workaround gegen Event nach unserem Main() unter OS/2
- // passierte wenn man beim Beenden aus dem OffMgr die App neu startet
+ // Workaround for Event after Main() under OS/2
+ // happens when exiting starts the App again
if ( !Application::IsInExecute() )
return sal_False;
- // das Topic rNm wird gesucht, haben wir es ?
- // erstmal nur ueber die ObjectShells laufen und die mit dem
- // Namen heraussuchen:
+ // The Topic rNm is sought, do we have it?
+ // First only loop over the ObjectShells to find those
+ // with the specific name:
sal_Bool bRet = sal_False;
String sNm( rNm );
sNm.ToLowerAscii();
@@ -571,7 +566,7 @@ sal_Bool ImplDdeService::MakeTopic( const String& rNm )
{
String sTmp( pShell->GetTitle(SFX_TITLE_FULLNAME) );
sTmp.ToLowerAscii();
- if( sTmp == sNm ) // die wollen wir haben
+ if( sTmp == sNm )
{
SFX_APP()->AddDdeTopic( pShell );
bRet = sal_True;
@@ -587,9 +582,7 @@ sal_Bool ImplDdeService::MakeTopic( const String& rNm )
if ( aWorkPath.GetNewAbsURL( rNm, &aFile ) &&
SfxContentHelper::IsDocument( aFile.GetMainURL( INetURLObject::NO_DECODE ) ) )
{
- // File vorhanden
-
- // dann versuche die Datei zu laden:
+ // File exists? then try to load it:
SfxStringItem aName( SID_FILE_NAME, aFile.GetMainURL( INetURLObject::NO_DECODE ) );
SfxBoolItem aNewView(SID_OPEN_NEW_VIEW, sal_True);
@@ -698,7 +691,7 @@ sal_Bool SfxDdeDocTopic_Impl::StartAdviseLoop()
::sfx2::SvLinkSource* pNewObj = pSh->DdeCreateLinkSource( GetCurItem() );
if( pNewObj )
{
- // dann richten wir auch einen entsprechenden SvBaseLink ein
+ // then we also establish a corresponding SvBaseLink
String sNm, sTmp( Application::GetAppName() );
::sfx2::MakeLnkName( sNm, &sTmp, pSh->GetTitle(SFX_TITLE_FULLNAME), GetCurItem() );
new ::sfx2::SvBaseLink( sNm, OBJECT_DDE_EXTERN, pNewObj );
@@ -707,3 +700,4 @@ sal_Bool SfxDdeDocTopic_Impl::StartAdviseLoop()
return bRet;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx
index ba23e04cad12..4f4f3a1ebe6a 100644
--- a/sfx2/source/appl/appinit.cxx
+++ b/sfx2/source/appl/appinit.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,23 +40,17 @@
#include <unotools/saveopt.hxx>
#include <unotools/localisationoptions.hxx>
#include <tools/config.hxx>
-#ifndef _SV_RESARY_HXX
#include <tools/resary.hxx>
-#endif
#include <tools/urlobj.hxx>
#include <svl/intitem.hxx>
#include <svl/eitem.hxx>
#include <svl/stritem.hxx>
-#ifndef _MSGBOX_HXX //autogen
#include <vcl/msgbox.hxx>
-#endif
#include <svtools/ehdl.hxx>
-#ifndef _UNOTOOLS_PROCESSFACTORY_HXX
#include <comphelper/processfactory.hxx>
-#endif
#include <unotools/configmgr.hxx>
#include <rtl/ustrbuf.hxx>
-#include <vos/security.hxx>
+#include <osl/security.hxx>
#include <ucbhelper/configurationkeys.hxx>
#include <unotools/pathoptions.hxx>
#include <unotools/historyoptions.hxx>
@@ -118,22 +113,23 @@ void SAL_CALL SfxTerminateListener_Impl::disposing( const EventObject& ) throw(
void SAL_CALL SfxTerminateListener_Impl::queryTermination( const EventObject& ) throw(TerminationVetoException, RuntimeException )
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if ( !SFX_APP()->QueryExit_Impl() )
throw TerminationVetoException();
}
void SAL_CALL SfxTerminateListener_Impl::notifyTermination( const EventObject& aEvent ) throw(RuntimeException )
{
- static ::rtl::OUString SERVICE_GLOBALEVENTBROADCASTER = ::rtl::OUString::createFromAscii("com.sun.star.frame.GlobalEventBroadcaster");
- static ::rtl::OUString EVENT_QUIT_APP = ::rtl::OUString::createFromAscii("OnCloseApp");
+ static ::rtl::OUString SERVICE_GLOBALEVENTBROADCASTER(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.GlobalEventBroadcaster"));
+ static ::rtl::OUString EVENT_QUIT_APP (RTL_CONSTASCII_USTRINGPARAM("OnCloseApp"));
Reference< XDesktop > xDesktop( aEvent.Source, UNO_QUERY );
if( xDesktop.is() == sal_True )
xDesktop->removeTerminateListener( this );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- utl::ConfigManager::GetConfigManager()->StoreConfigItems();
+ SolarMutexGuard aGuard;
+ utl::ConfigManager::GetConfigManager().StoreConfigItems();
+
SfxApplication* pApp = SFX_APP();
pApp->Broadcast( SfxSimpleHint( SFX_HINT_DEINITIALIZING ) );
pApp->Get_Impl()->pAppDispatch->ReleaseAll();
@@ -148,14 +144,13 @@ void SAL_CALL SfxTerminateListener_Impl::notifyTermination( const EventObject& a
xGlobalBroadcaster->notifyEvent(aEvent2);
}
- //pApp->Deinitialize();
delete pApp;
Application::Quit();
}
::rtl::OUString SAL_CALL SfxTerminateListener_Impl::getImplementationName() throw (RuntimeException)
{
- static const ::rtl::OUString IMPLNAME = ::rtl::OUString::createFromAscii("com.sun.star.comp.sfx2.SfxTerminateListener");
+ static const ::rtl::OUString IMPLNAME(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.sfx2.SfxTerminateListener"));
return IMPLNAME;
}
@@ -182,7 +177,7 @@ Sequence< ::rtl::OUString > SAL_CALL SfxTerminateListener_Impl::getSupportedServ
// The desktop must know, which listener will terminate the SfxApplication in real !
// It must call this special listener as last one ... otherwise we shutdown the SfxApplication BEFORE other listener
// can react ...
- static const ::rtl::OUString SERVICENAME = ::rtl::OUString::createFromAscii("com.sun.star.frame.TerminateListener");
+ static const ::rtl::OUString SERVICENAME(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.TerminateListener"));
Sequence< ::rtl::OUString > lNames(1);
lNames[0] = SERVICENAME;
return lNames;
@@ -207,7 +202,7 @@ String GetSpecialCharsForEdit(Window* pParent, const Font& rFont)
static bool bDetermineFunction = false;
static PFunc_getSpecialCharsForEdit pfunc_getSpecialCharsForEdit = 0;
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if ( !bDetermineFunction )
{
bDetermineFunction = true;
@@ -258,20 +253,20 @@ bool SfxApplication::Initialize_Impl()
#ifdef DBG_UTIL
- // Der SimplerErrorHandler dient Debugzwecken. In der Product werden
- // nichtgehandelte Fehler durch Errorcode 1 an SFX gegeben.
- new SimpleErrorHandler;
+ // The SimplerErrorHandler is for debugging. In the Product errors
+ // not processed are given to SFX as Errorcode 1.
+ pAppData_Impl->m_pSimpleErrorHdl = new SimpleErrorHandler;
#endif
+ pAppData_Impl->m_pToolsErrorHdl = new SfxErrorHandler(
+ RID_ERRHDL, ERRCODE_AREA_TOOLS, ERRCODE_AREA_LIB1);
+
pAppData_Impl->pBasicResMgr = CreateResManager("sb");
pAppData_Impl->pSvtResMgr = CreateResManager("svt");
- new SfxErrorHandler( RID_ERRHDL, ERRCODE_AREA_TOOLS, ERRCODE_AREA_LIB1 );
- new SfxErrorHandler( RID_SO_ERROR_HANDLER, ERRCODE_AREA_SO, ERRCODE_AREA_SO_END, pAppData_Impl->pSvtResMgr );
- new SfxErrorHandler( RID_BASIC_START, ERRCODE_AREA_SBX, ERRCODE_AREA_SBX_END, pAppData_Impl->pBasicResMgr );
-
- // diverse Pointer
- SfxPickList::GetOrCreate( SvtHistoryOptions().GetSize( ePICKLIST ) );
- /////////////////////////////////////////////////////////////////
+ pAppData_Impl->m_pSoErrorHdl = new SfxErrorHandler(
+ RID_SO_ERROR_HANDLER, ERRCODE_AREA_SO, ERRCODE_AREA_SO_END, pAppData_Impl->pSvtResMgr );
+ pAppData_Impl->m_pSbxErrorHdl = new SfxErrorHandler(
+ RID_BASIC_START, ERRCODE_AREA_SBX, ERRCODE_AREA_SBX_END, pAppData_Impl->pBasicResMgr );
DBG_ASSERT( !pAppData_Impl->pAppDispat, "AppDispatcher already exists" );
pAppData_Impl->pAppDispat = new SfxDispatcher((SfxDispatcher*)0);
@@ -305,10 +300,12 @@ bool SfxApplication::Initialize_Impl()
pAppData_Impl->pAppDispat->DoActivate_Impl( sal_True, NULL );
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
// Set special characters callback on vcl edit control
Edit::SetGetSpecialCharsFunction(&GetSpecialCharsForEdit);
}
return sal_True;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/appmain.cxx b/sfx2/source/appl/appmain.cxx
index 64c6673bbafb..00ec4e88ecdd 100644
--- a/sfx2/source/appl/appmain.cxx
+++ b/sfx2/source/appl/appmain.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,8 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sfx2.hxx"
-//#define TF_NEWDESKTOP
-
#define _SDINTERN_HXX
#include <stdio.h>
@@ -40,7 +39,6 @@
#include <svl/itempool.hxx>
#include <svl/urihelper.hxx>
#include <svtools/helpopt.hxx>
-#include <vos/process.hxx>
#include <framework/sfxhelperfunctions.hxx>
#include <rtl/ustring.hxx>
#include <com/sun/star/uno/Exception.hpp>
@@ -85,7 +83,7 @@ DBG_NAME(SfxAppMainCHAOSReg)
//===================================================================
#ifdef TF_POOLABLE
-static SfxItemInfo __READONLY_DATA aItemInfos[] =
+static SfxItemInfo const aItemInfos[] =
{
{ 0, 0 }
};
@@ -100,18 +98,19 @@ void SfxApplication::Init
(
)
-/* [Beschreibung]
+/* [Description]
+
+ This virtual method is called from SFx through Application::Main(),
+ before Execute() is called and:
+ - the Intro is already displayed,
+ - the Applications window exists, but it is still hidden,
+ - the Bindings already exist (Controller can be registered),
+ - the Init and Config-Manager already exists,
+ - the Standard-Controller already exists,
+ - the SFx-Shells have alredy registered their Interfaces.
- Diese virtuelle Methode wird vom SFx aus Application:a:Main() gerufen,
- bevor Execute() ausgef"uhrt wird und
- - das Intro bereits angezeigt ist,
- - das Applikationsfenster exisitiert, aber noch hidden ist,
- - die Bindings bereits existieren (Controller sind anmeldbar),
- - der Ini- und Config-Manager bereits existiert,
- - die Standard-Controller bereits exisitieren,
- - die SFx-Shells ihre Interfaces bereits registriert haben.
+ [Cross-reference]
- [Querverweise]
<SfxApplication::Exit()>
<SfxApplication::OpenClients()>
*/
@@ -122,17 +121,17 @@ void SfxApplication::Init
void SfxApplication::Exit()
-/* [Beschreibung]
+/* [Description]
- Diese virtuelle Methode wird vom SFx aus Application::Main() gerufen,
- nachdem Execute() beendet ist und
- - die Konfiguration (SfxConfigManager) bereits gespeichert wurde,
- - die Fensterpostionen etc. in den SfxIniManager geschrieben wurden,
- - das Applikationsfenster noch existiert, aber hidden ist
- - s"amtliche Dokumente und deren Views bereits geschlossen sind.
- - Dispatcher, Bindings etc. bereits zerst"ort sind
+ This virtual method is called from SFx through Application::Main(),
+ after Execute() has finished and
+ - the configuration (SfxConfigManager) was already saved,
+ - the window postions etc. in the SfxIniManager were written,
+ - the Application widow still exists, but is hidden
+ - all Documents and their Views already are closed.
+ - Dispatcher, Bindings etc. already destroyed.
- [Querverweise]
+ [Cross-reference]
<SfxApplication::Init(int,char*[])>
*/
@@ -161,3 +160,5 @@ SfxFilterMatcher& SfxApplication::GetFilterMatcher()
}
return *pAppData_Impl->pMatcher;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/appmisc.cxx b/sfx2/source/appl/appmisc.cxx
index eafe9d262189..eb0a10016d33 100644
--- a/sfx2/source/appl/appmisc.cxx
+++ b/sfx2/source/appl/appmisc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,8 +30,6 @@
#include "precompiled_sfx2.hxx"
#include <vcl/status.hxx>
#include <vcl/msgbox.hxx>
-#include <vos/process.hxx>
-#include <vos/xception.hxx>
#include <svl/whiter.hxx>
#include <svl/stritem.hxx>
#include <svl/intitem.hxx>
@@ -46,7 +45,7 @@
#include <com/sun/star/uno/Reference.h>
#include <tools/config.hxx>
#include <tools/rcid.h>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <unotools/configmgr.hxx>
#include <com/sun/star/frame/XDesktop.hpp>
#include <unotools/ucbstreamhelper.hxx>
@@ -86,7 +85,6 @@
#include <sfx2/objface.hxx>
#include "helper.hxx" // SfxContentHelper::Kill()
-using namespace ::vos;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::util;
using namespace ::com::sun::star::beans;
@@ -156,13 +154,12 @@ SFX_IMPL_INTERFACE(SfxApplication,SfxShell,SfxResId(RID_DESKTOP))
//--------------------------------------------------------------------
SfxProgress* SfxApplication::GetProgress() const
-/* [Beschreibung]
+/* [Description]
- Liefert den f"ur die gesamte Applikation laufenden SfxProgress
- oder 0, falls keiner f"ur die gesamte Applikation l"auft.
+ Returns the running SfxProgress for the entire application or 0 if
+ none is running for the entire application.
-
- [Querverweise]
+ [Cross-reference]
<SfxProgress::GetActiveProgress(SfxViewFrame*)>
<SfxViewFrame::GetProgress()const>
@@ -180,7 +177,7 @@ SvUShorts* SfxApplication::GetDisabledSlotList_Impl()
SvUShorts* pList = pAppData_Impl->pDisabledSlotList;
if ( !pList )
{
- // Gibt es eine Slotdatei ?
+ // Is there a slot file?
INetURLObject aUserObj( SvtPathOptions().GetUserConfigPath() );
aUserObj.insertName( DEFINE_CONST_UNICODE( "slots.cfg" ) );
SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( aUserObj.GetMainURL( INetURLObject::NO_DECODE ), STREAM_STD_READ );
@@ -196,7 +193,7 @@ SvUShorts* SfxApplication::GetDisabledSlotList_Impl()
sal_Bool bSlots = ( pStream && !pStream->GetError() );
if( bSlots && bSlotsEnabled )
{
- // SlotDatei einlesen
+ // Read Slot file
String aTitle;
pStream->ReadByteString(aTitle);
if ( aTitle.CompareToAscii("SfxSlotFile" ) == COMPARE_EQUAL )
@@ -216,21 +213,20 @@ SvUShorts* SfxApplication::GetDisabledSlotList_Impl()
pStream->ReadByteString(aTitle);
if ( aTitle.CompareToAscii("END" ) != COMPARE_EQUAL || pStream->GetError() )
{
- // Lesen schief gegangen
+ // Read failed
DELETEZ( pList );
bError = sal_True;
}
}
else
{
- // Streamerkennung fehlgeschlagen
+ // Stream detection failure
bError = sal_True;
}
}
else if ( bSlots != bSlotsEnabled )
{
- // Wenn kein Slotlist-Eintrag, dann darf auch keine SlotDatei
- // vorhanden sein
+ // If no slot list entry, then no slot file shall exist
bError = sal_True;
}
@@ -246,9 +242,9 @@ SvUShorts* SfxApplication::GetDisabledSlotList_Impl()
if ( bError )
{
- // Wenn ein Sloteintrag vorhanden ist, aber keine oder eine fehlerhafte
- // SlotDatei, oder aber eine Slotdatei, aber kein Sloteintrag, dann
- // gilt dies als fehlerhafte Konfiguration
+ // If an entry slot is present, but no or faulty slot file, or a slot
+ // file, but no slot entry, then this is considered to be a
+ // misconfiguration
new SfxSpecialConfigError_Impl( String( SfxResId( RID_SPECIALCONFIG_ERROR ) ) );
}
@@ -265,7 +261,7 @@ SfxModule* SfxApplication::GetModule_Impl()
return pModule;
else
{
- DBG_ERROR( "No module!" );
+ OSL_FAIL( "No module!" );
return NULL;
}
}
@@ -285,8 +281,6 @@ SfxResourceManager& SfxApplication::GetResourceManager() const { return *pAppDat
sal_Bool SfxApplication::IsDowning() const { return pAppData_Impl->bDowning; }
SfxDispatcher* SfxApplication::GetAppDispatcher_Impl() { return pAppData_Impl->pAppDispat; }
SfxSlotPool& SfxApplication::GetAppSlotPool_Impl() const { return *pAppData_Impl->pSlotPool; }
-//SfxOptions& SfxApplication::GetOptions() { return *pAppData_Impl->pOptions; }
-//const SfxOptions& SfxApplication::GetOptions() const { return *pAppData_Impl->pOptions; }
static bool impl_loadBitmap(
const rtl::OUString &rPath, const rtl::OUString &rBmpFileName,
@@ -302,8 +296,8 @@ static bool impl_loadBitmap(
// Use graphic class to also support more graphic formats (bmp,png,...)
Graphic aGraphic;
- GraphicFilter* pGF = GraphicFilter::GetGraphicFilter();
- pGF->ImportGraphic( aGraphic, String(), aStrm, GRFILTER_FORMAT_DONTKNOW );
+ GraphicFilter& rGF = GraphicFilter::GetGraphicFilter();
+ rGF.ImportGraphic( aGraphic, String(), aStrm, GRFILTER_FORMAT_DONTKNOW );
// Default case, we load the intro bitmap from a seperate file
// (e.g. staroffice_intro.bmp or starsuite_intro.bmp)
@@ -325,7 +319,7 @@ Image SfxApplication::GetApplicationLogo()
do
{
bLoaded = impl_loadBitmap(
- rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program" ),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR/program")),
aAbouts.getToken( 0, ',', nIndex ), aAppLogo );
}
while ( !bLoaded && ( nIndex >= 0 ) );
@@ -334,25 +328,26 @@ Image SfxApplication::GetApplicationLogo()
if ( !bLoaded )
{
bLoaded = impl_loadBitmap(
- rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program/edition" ),
- rtl::OUString::createFromAscii( "about.png" ), aAppLogo );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR/program/edition")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("about.png")), aAppLogo );
if ( !bLoaded )
bLoaded = impl_loadBitmap(
- rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program/edition" ),
- rtl::OUString::createFromAscii( "about.bmp" ), aAppLogo );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR/program/edition")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("about.bmp")), aAppLogo );
}
if ( !bLoaded )
{
bLoaded = impl_loadBitmap(
- rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program" ),
- rtl::OUString::createFromAscii( "about.png" ), aAppLogo );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR/program")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("about.png")), aAppLogo );
if ( !bLoaded )
bLoaded = impl_loadBitmap(
- rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program" ),
- rtl::OUString::createFromAscii( "about.bmp" ), aAppLogo );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR/program")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("about.bmp")), aAppLogo );
}
return aAppLogo;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index 8b76024c1afb..c644e5dcb30f 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -80,7 +81,7 @@
#include <comphelper/docpasswordhelper.hxx>
#include <vcl/svapp.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <rtl/logfile.hxx>
@@ -152,45 +153,45 @@ void SAL_CALL SfxOpenDocStatusListener_Impl::disposing( const EventObject& ) thr
SfxObjectShellRef SfxApplication::DocAlreadyLoaded
(
- const String& rName, // Name des Dokuments mit Pfad
- sal_Bool bSilent, // sal_True: nicht nach neuer Sicht fragen
- sal_Bool bActivate, // soll bestehende Sicht aktiviert werden
+ const String& rName, // Name of Documents including path
+ sal_Bool bSilent, // sal_True: do not ask for a new view
+ sal_Bool bActivate, // existing view to be activated
sal_Bool bForbidVisible,
const String* pPostStr
)
-/* [Beschreibung]
+/* [Description]
- Stellt fest, ob ein Dokument mit dem Namen 'rName' bereits geladen
- ist und liefert einen Pointer darauf zu"uck.
+ Determines whether a document with the name 'rName' already is loaded and
+ returns a pointer to this document.
- Ist das Dokument noch nicht geladen, wird ein 0-Pointer zur"uckgeliefert.
+ If the document is not loaded, a 0-pointer is returned.
*/
{
- // zu suchenden Namen als URL aufbereiten
+ // prepare to search for names as URL
INetURLObject aUrlToFind( rName );
DBG_ASSERT( aUrlToFind.GetProtocol() != INET_PROT_NOT_VALID, "Invalid URL" );
String aPostString;
if ( pPostStr )
aPostString = *pPostStr;
- // noch offen?
+ // still open?
SfxObjectShellRef xDoc;
if ( !aUrlToFind.HasError() )
{
- // dann bei den normal geoeffneten Docs
+ // then with the normally open Documents
if ( !xDoc.Is() )
{
- xDoc = SfxObjectShell::GetFirst( 0, sal_False ); // auch hidden Docs
+ xDoc = SfxObjectShell::GetFirst( 0, sal_False ); // also hidden Documents
while( xDoc.Is() )
{
if ( xDoc->GetMedium() &&
xDoc->GetCreateMode() == SFX_CREATE_MODE_STANDARD &&
!xDoc->IsAbortingImport() && !xDoc->IsLoading() )
{
- // Vergleiche anhand der URLs
+ // Comparisons between URLs
INetURLObject aUrl( xDoc->GetMedium()->GetName() );
if ( !aUrl.HasError() && aUrl == aUrlToFind &&
(!bForbidVisible || !SfxViewFrame::GetFirst( xDoc, sal_True )) &&
@@ -204,11 +205,10 @@ SfxObjectShellRef SfxApplication::DocAlreadyLoaded
}
}
- // gefunden?
+ // Found?
if ( xDoc.Is() && bActivate )
{
- DBG_ASSERT(
- !bForbidVisible, "Unsichtbares kann nicht aktiviert werden" );
+ DBG_ASSERT(!bForbidVisible, "Invisible can not be enabled" );
SfxViewFrame* pFrame;
for( pFrame = SfxViewFrame::GetFirst( xDoc );
@@ -301,19 +301,17 @@ private:
sal_uInt32 CheckPasswd_Impl
(
- //Window *pWin, // Parent des Dialogs
SfxObjectShell* pDoc,
- SfxItemPool& /*rPool*/, // Pool, falls ein Set erzeugt werden mus
- SfxMedium* pFile // das Medium, dessen Passwort gfs. erfragt werden soll
+ SfxItemPool& /*rPool*/, // Pool, if a Set has to be created
+ SfxMedium* pFile // the Medium and its Password shold be obtained
)
-/* [Beschreibung]
+/* [Description]
- Zu einem Medium das Passwort erfragen; funktioniert nur, wenn es sich
- um einen Storage handelt.
- Wenn in der Documentinfo das Passwort-Flag gesetzt ist, wird
- das Passwort vom Benutzer per Dialog erfragt und an dem Set
- des Mediums gesetzt; das Set wird, wenn nicht vorhanden, erzeugt.
+ Ask for the password for a medium, only works if it concerns storage.
+ If the password flag is set in the Document Info, then the password is
+ requested through a user dialogue and the set at the Set of the medium.
+ If the set does not exist the it is created.
*/
{
sal_uIntPtr nRet = ERRCODE_NONE;
@@ -328,16 +326,13 @@ sal_uInt32 CheckPasswd_Impl
{
sal_Bool bIsEncrypted = sal_False;
try {
- xStorageProps->getPropertyValue( ::rtl::OUString::createFromAscii("HasEncryptedEntries") )
+ xStorageProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HasEncryptedEntries")) )
>>= bIsEncrypted;
} catch( uno::Exception& )
{
// TODO/LATER:
// the storage either has no encrypted elements or it's just
// does not allow to detect it, probably it should be implemented laiter
- /*
- bIsEncrypted = ( aInfo.Load( xStorage ) && aInfo.IsPasswd() );
- */
}
if ( bIsEncrypted )
@@ -398,7 +393,7 @@ sal_uInt32 CheckPasswd_Impl
}
else
{
- OSL_ENSURE( sal_False, "A storage must implement XPropertySet interface!" );
+ OSL_FAIL( "A storage must implement XPropertySet interface!" );
nRet = ERRCODE_SFX_CANTGETPASSWD;
}
}
@@ -491,8 +486,6 @@ sal_uIntPtr SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const String
xDoc->GetStorage()->copyToStorage( xTempStorage );
-//REMOVE // the following operations should be done in one step
-//REMOVE xDoc->DoHandsOff();
if ( !xDoc->DoSaveCompleted( new SfxMedium( xTempStorage, String() ) ) )
throw uno::RuntimeException();
}
@@ -521,7 +514,6 @@ sal_uIntPtr SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const String
SfxItemSet* pNew = xDoc->GetMedium()->GetItemSet()->Clone();
pNew->ClearItem( SID_PROGRESS_STATUSBAR_CONTROL );
pNew->ClearItem( SID_FILTER_NAME );
- //pNew->Put( SfxStringItem( SID_FILTER_NAME, xDoc->GetFactory().GetFilter(0)->GetFilterName() ) );
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgs;
TransformItems( SID_OPENDOC, *pNew, aArgs );
sal_Int32 nLength = aArgs.getLength();
@@ -576,7 +568,7 @@ void SfxApplication::NewDocExec_Impl( SfxRequest& rReq )
{
DBG_MEMTEST();
- // keine Parameter vom BASIC nur Factory angegeben?
+ // No Parameter from BASIC only Factory given?
SFX_REQUEST_ARG(rReq, pTemplNameItem, SfxStringItem, SID_TEMPLATE_NAME, sal_False);
SFX_REQUEST_ARG(rReq, pTemplFileNameItem, SfxStringItem, SID_FILE_NAME, sal_False);
SFX_REQUEST_ARG(rReq, pTemplRegionNameItem, SfxStringItem, SID_TEMPLATE_REGIONNAME, sal_False);
@@ -584,7 +576,7 @@ void SfxApplication::NewDocExec_Impl( SfxRequest& rReq )
SfxObjectShellLock xDoc;
String aTemplateRegion, aTemplateName, aTemplateFileName;
- sal_Bool bDirect = sal_False; // "uber FileName anstelle Region/Template
+ sal_Bool bDirect = sal_False; // through FileName instead of Region/Template
SfxErrorContext aEc(ERRCTX_SFX_NEWDOC);
if ( !pTemplNameItem && !pTemplFileNameItem )
{
@@ -680,6 +672,29 @@ void SfxApplication::NewDocExec_Impl( SfxRequest& rReq )
//---------------------------------------------------------------------------
+namespace {
+
+/**
+ * Check if a given filter type should open the hyperlinked document
+ * natively.
+ *
+ * @param rFilter filter object
+ */
+bool lcl_isFilterNativelySupported(const SfxFilter& rFilter)
+{
+ if (rFilter.IsOwnFormat())
+ return true;
+
+ ::rtl::OUString aName = rFilter.GetFilterName();
+ if (aName.indexOf(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MS Excel"))) == 0)
+ // We can handle all Excel variants natively.
+ return true;
+
+ return false;
+}
+
+}
+
void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
{
DBG_MEMTEST();
@@ -797,8 +812,8 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
rReq.RemoveItem( SID_FILE_NAME );
rReq.AppendItem( SfxStringItem( SID_FILE_NAME, aURL ) );
- // synchron ausf"uhren, damit beim Reschedulen nicht schon das n"achste Dokument
- // geladen wird
+ // Run synchronous, so that not the next document is loaded
+ // when rescheduling
// TODO/LATER: use URLList argument and always remove one document after another, each step in asychronous execution, until finished
// but only if reschedule is a problem
GetDispatcher_Impl()->Execute( SID_OPENDOC, SFX_CALLMODE_SYNCHRON, *rReq.GetArgs() );
@@ -830,13 +845,6 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
delete pURLList;
}
- if ( !rReq.IsSynchronCall() )
- {
- // now check wether a stream is already there
- // if not: download it in a thread and restart the call
- // return;
- }
-
sal_Bool bHyperlinkUsed = sal_False;
if ( SID_OPENURL == nSID )
@@ -910,13 +918,6 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
rReq.AppendItem( SfxBoolItem( SID_PREVIEW, sal_True ) );
}
- if ( STRING_NOTFOUND != aFileFlags.Search( 0x0053 ) ) // S = 53h
- {
- // not supported anymore
- //rReq.RemoveItem( SID_SILENT );
- //rReq.AppendItem( SfxBoolItem( SID_SILENT, sal_True ) );
- }
-
rReq.RemoveItem( SID_OPTIONS );
}
@@ -925,7 +926,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
{
Reference< ::com::sun::star::document::XTypeDetection > xTypeDetection(
::comphelper::getProcessServiceFactory()->createInstance(
- ::rtl::OUString::createFromAscii( "com.sun.star.document.TypeDetection" )),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.TypeDetection"))),
UNO_QUERY );
if ( xTypeDetection.is() )
{
@@ -934,49 +935,16 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
aURL.Complete = aFileName;
Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance(
- ::rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), UNO_QUERY );
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), UNO_QUERY );
xTrans->parseStrict( aURL );
INetProtocol aINetProtocol = INetURLObject( aURL.Complete ).GetProtocol();
SvtExtendedSecurityOptions aExtendedSecurityOptions;
SvtExtendedSecurityOptions::OpenHyperlinkMode eMode = aExtendedSecurityOptions.GetOpenHyperlinkMode();
- if ( eMode == SvtExtendedSecurityOptions::OPEN_WITHSECURITYCHECK )
- {
- if ( aINetProtocol == INET_PROT_FILE )
- {
-/*!!! pb: #i49802# no security warning any longer
- // Check if file URL is a directory. This is not insecure!
- osl::Directory aDir( aURL.Main );
- sal_Bool bIsDir = ( aDir.open() == osl::Directory::E_None );
-
- if ( !bIsDir && !aExtendedSecurityOptions.IsSecureHyperlink( aURL.Complete ) )
- {
- // Security check for local files depending on the extension
- vos::OGuard aGuard( Application::GetSolarMutex() );
- Window *pWindow = SFX_APP()->GetTopWindow();
-
- String aSecurityWarningBoxTitle( SfxResId( RID_SECURITY_WARNING_TITLE ));
- WarningBox aSecurityWarningBox( pWindow, SfxResId( RID_SECURITY_WARNING_HYPERLINK ));
- aSecurityWarningBox.SetText( aSecurityWarningBoxTitle );
- // Replace %s with the real file name
- String aMsgText = aSecurityWarningBox.GetMessText();
- String aMainURL( aURL.Main );
- String aFileName;
-
- utl::LocalFileHelper::ConvertURLToPhysicalName( aMainURL, aFileName );
- aMsgText.SearchAndReplaceAscii( "%s", aFileName );
- aSecurityWarningBox.SetMessText( aMsgText );
-
- if( aSecurityWarningBox.Execute() == RET_NO )
- return;
- }
-*/
- }
- }
- else if ( eMode == SvtExtendedSecurityOptions::OPEN_NEVER && aINetProtocol != INET_PROT_VND_SUN_STAR_HELP )
+ if ( eMode == SvtExtendedSecurityOptions::OPEN_NEVER && aINetProtocol != INET_PROT_VND_SUN_STAR_HELP )
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
Window *pWindow = SFX_APP()->GetTopWindow();
String aSecurityWarningBoxTitle( SfxResId( RID_SECURITY_WARNING_TITLE ));
@@ -989,11 +957,11 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
aTypeName = xTypeDetection->queryTypeByURL( aURL.Main );
SfxFilterMatcher& rMatcher = SFX_APP()->GetFilterMatcher();
const SfxFilter* pFilter = rMatcher.GetFilter4EA( aTypeName );
- if ( !pFilter || !( pFilter->IsOwnFormat() ))
+ if (!pFilter || !lcl_isFilterNativelySupported(*pFilter))
{
// hyperlink does not link to own type => special handling (http, ftp) browser and (other external protocols) OS
Reference< XSystemShellExecute > xSystemShellExecute( ::comphelper::getProcessServiceFactory()->createInstance(
- ::rtl::OUString::createFromAscii( "com.sun.star.system.SystemShellExecute" )), UNO_QUERY );
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.system.SystemShellExecute"))), UNO_QUERY );
if ( xSystemShellExecute.is() )
{
if ( aINetProtocol == INET_PROT_MAILTO )
@@ -1014,13 +982,13 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
}
catch ( ::com::sun::star::lang::IllegalArgumentException& )
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
Window *pWindow = SFX_APP()->GetTopWindow();
ErrorBox( pWindow, SfxResId( MSG_ERR_NO_WEBBROWSER_FOUND )).Execute();
}
catch ( ::com::sun::star::system::SystemShellExecuteException& )
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
Window *pWindow = SFX_APP()->GetTopWindow();
ErrorBox( pWindow, SfxResId( MSG_ERR_NO_WEBBROWSER_FOUND )).Execute();
}
@@ -1033,14 +1001,14 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
Sequence < ::rtl::OUString > aProtocols(2);
// add special protocols that always should be treated as internal
- aProtocols[0] = ::rtl::OUString::createFromAscii("private:*");
- aProtocols[1] = ::rtl::OUString::createFromAscii("vnd.sun.star.*");
+ aProtocols[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("private:*"));
+ aProtocols[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.*"));
try
{
// get registered protocol handlers from configuration
Reference < XNameAccess > xAccess( ::comphelper::ConfigurationHelper::openConfig( ::comphelper::getProcessServiceFactory(),
- ::rtl::OUString::createFromAscii("org.openoffice.Office.ProtocolHandler/HandlerSet"), ::comphelper::ConfigurationHelper::E_READONLY ), UNO_QUERY );
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.ProtocolHandler/HandlerSet")), ::comphelper::ConfigurationHelper::E_READONLY ), UNO_QUERY );
if ( xAccess.is() )
{
Sequence < ::rtl::OUString > aNames = xAccess->getElementNames();
@@ -1052,7 +1020,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
if ( xSet.is() )
{
// copy protocols
- aRet = xSet->getPropertyValue( ::rtl::OUString::createFromAscii("Protocols") );
+ aRet = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Protocols")) );
Sequence < ::rtl::OUString > aTmp;
aRet >>= aTmp;
@@ -1097,7 +1065,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
}
catch ( ::com::sun::star::lang::IllegalArgumentException& )
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
Window *pWindow = SFX_APP()->GetTopWindow();
ErrorBox( pWindow, SfxResId( MSG_ERR_NO_WEBBROWSER_FOUND )).Execute();
}
@@ -1105,7 +1073,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
{
if ( !pFilter )
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
Window *pWindow = SFX_APP()->GetTopWindow();
ErrorBox( pWindow, SfxResId( MSG_ERR_NO_WEBBROWSER_FOUND )).Execute();
}
@@ -1189,7 +1157,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
if (!pInteractionItem)
{
- Reference < ::com::sun::star::task::XInteractionHandler > xHdl( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.comp.uui.UUIInteractionHandler")), UNO_QUERY );
+ Reference < ::com::sun::star::task::XInteractionHandler > xHdl( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.uui.UUIInteractionHandler"))), UNO_QUERY );
if (xHdl.is())
rReq.AppendItem( SfxUnoAnyItem(SID_INTERACTIONHANDLER,::com::sun::star::uno::makeAny(xHdl)) );
}
@@ -1218,8 +1186,6 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
}
Reference < XController > xController;
-// if ( ( !bIsBlankTarget && pFrame ) || pLinkItem || !rReq.IsSynchronCall() )
-// {
// if a frame is given, it must be used for the starting point of the targetting mechanism
// this code is also used if asynchronous loading is possible, because loadComponent always is synchron
if ( !xTargetFrame.is() )
@@ -1230,7 +1196,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
}
else
{
- xTargetFrame.set( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop")), UNO_QUERY );
+ xTargetFrame.set( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop"))), UNO_QUERY );
}
}
@@ -1256,15 +1222,11 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
{
// if loading must be done synchron, we must wait for completion to get a return value
// find frame by myself; I must konw the exact frame to get the controller for the return value from it
- //if( aTarget.getLength() )
- // xTargetFrame = xTargetFrame->findFrame( aTarget, FrameSearchFlag::ALL );
Reference < XComponent > xComp;
try
{
xComp = ::comphelper::SynchronousDispatch::dispatch( xTargetFrame, aFileName, aTarget, 0, aArgs );
-// Reference < XComponentLoader > xLoader( xTargetFrame, UNO_QUERY );
-// xComp = xLoader->loadComponentFromURL( aFileName, aTarget, 0, aArgs );
}
catch(const RuntimeException&)
{
@@ -1285,7 +1247,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
{
URL aURL;
aURL.Complete = aFileName;
- Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), UNO_QUERY );
+ Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), UNO_QUERY );
xTrans->parseStrict( aURL );
Reference < XDispatchProvider > xProv( xTargetFrame, UNO_QUERY );
@@ -1294,37 +1256,6 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
if ( xDisp.is() )
xDisp->dispatch( aURL, aArgs );
}
- /*
- }
- else
- {
- // synchron loading without a given frame or as blank frame
- SFX_REQUEST_ARG( rReq, pFileNameItem, SfxStringItem, SID_FILE_NAME, sal_False );
-
- // Desktop service must exists! dont catch() or check for problems here ...
- // But loading of documents can fail by other reasons. Handle it more gracefully.
- Reference < XComponentLoader > xDesktop( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop")), UNO_QUERY );
- Reference < XComponent > xComp;
- try
- {
- xComp = xDesktop->loadComponentFromURL( pFileNameItem->GetValue(), aTarget, 0, aArgs );
- }
- catch(const RuntimeException&)
- {
- throw;
- }
- catch(const ::com::sun::star::uno::Exception&)
- {
- xDesktop.clear();
- xComp.clear();
- }
-
- Reference < XModel > xModel( xComp, UNO_QUERY );
- if ( xModel.is() )
- xController = xModel->getCurrentController();
- else
- xController = Reference < XController >( xComp, UNO_QUERY );
- }*/
if ( xController.is() )
{
@@ -1358,3 +1289,5 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
delete pLinkItem;
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/appquit.cxx b/sfx2/source/appl/appquit.cxx
index 1a62f48a7a24..c8f3cb7c11d8 100644
--- a/sfx2/source/appl/appquit.cxx
+++ b/sfx2/source/appl/appquit.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,17 +32,12 @@
#include <basic/sbstar.hxx>
#include <svl/svdde.hxx>
-#ifndef _MSGBOX_HXX //autogen
#include <vcl/msgbox.hxx>
-#endif
#include <svl/eitem.hxx>
#include <unotools/saveopt.hxx>
#include <unotools/misccfg.hxx>
-#ifndef GCC
-#endif
-
#include "app.hrc"
#include <sfx2/app.hxx>
#include <sfx2/evntconf.hxx>
@@ -76,13 +72,13 @@ sal_Bool SfxApplication::QueryExit_Impl()
{
sal_Bool bQuit = sal_True;
- // will trotzdem noch jemand, den man nicht abschiessen kann, die App haben?
+ // Does some instance, that can not be shut down, still require the app?
if ( !bQuit )
{
- // nicht wirklich beenden, nur minimieren
+ // Not really exit, only minimize
InfoBox aInfoBox( NULL, SfxResId(MSG_CANT_QUIT) );
aInfoBox.Execute();
- DBG_TRACE( "QueryExit => FALSE (in use)" );
+ OSL_TRACE( "QueryExit => sal_False (in use)" );
return sal_False;
}
@@ -98,14 +94,14 @@ void SfxApplication::Deinitialize()
StarBASIC::Stop();
- // ggf. BASIC speichern
+ // Save BASIC if possible
BasicManager* pBasMgr = BasicManagerRepository::getApplicationBasicManager( false );
if ( pBasMgr && pBasMgr->IsModified() )
SaveBasicManager();
SaveBasicAndDialogContainer();
- pAppData_Impl->bDowning = sal_True; // wegen Timer aus DecAliveCount und QueryExit
+ pAppData_Impl->bDowning = sal_True; // due to Timer from DecAliveCount and QueryExit
DELETEZ( pAppData_Impl->pTemplates );
@@ -113,8 +109,6 @@ void SfxApplication::Deinitialize()
// this method. Therefore this call makes no sense and is the source of
// some stack traces, which we don't understand.
// For more information see:
- // #123501#
- //SetViewFrame(0);
pAppData_Impl->bDowning = sal_False;
DBG_ASSERT( !SfxViewFrame::GetFirst(),
"existing SfxViewFrame after Execute" );
@@ -128,8 +122,8 @@ void SfxApplication::Deinitialize()
// call derived application-exit
Exit();
- // Controller u."a. freigeben
- // dabei sollten auch restliche Komponenten ( Beamer! ) verschwinden
+ // Release Controller and others
+ // then the remaining components should alse disapear ( Beamer! )
BasicManagerRepository::resetApplicationBasicManager();
pAppData_Impl->pBasicManager->reset( NULL );
// this will also delete pBasMgr
@@ -143,7 +137,7 @@ void SfxApplication::Deinitialize()
SfxResId::DeleteResMgr();
DELETEZ(pAppData_Impl->pOfaResMgr);
- // ab hier d"urfen keine SvObjects mehr existieren
+ // from here no SvObjects have to exists
DELETEZ(pAppData_Impl->pMatcher);
DELETEX(pAppData_Impl->pSlotPool);
@@ -159,14 +153,18 @@ void SfxApplication::Deinitialize()
//TODO/CLEANTUP
//ReleaseArgs could be used instead!
-/* This leak is intended !
- Otherwise the TestTool cant use .uno:QuitApp ...
- because every destructed ItemSet work's on an already
- released pool pointer .-)
-
- NoChaos::ReleaseItemPool();
-*/
pAppData_Impl->pPool = NULL;
+ NoChaos::ReleaseItemPool();
+
DELETEZ(pAppData_Impl->pBasicResMgr);
DELETEZ(pAppData_Impl->pSvtResMgr);
+
+ delete pAppData_Impl->m_pSbxErrorHdl;
+ delete pAppData_Impl->m_pSoErrorHdl;
+ delete pAppData_Impl->m_pToolsErrorHdl;
+#ifdef DBG_UTIL
+ delete pAppData_Impl->m_pSimpleErrorHdl;
+#endif
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/appreg.cxx b/sfx2/source/appl/appreg.cxx
index dfecc21f9d4b..743c783471a3 100644
--- a/sfx2/source/appl/appreg.cxx
+++ b/sfx2/source/appl/appreg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,9 +31,6 @@
#include <vcl/toolbox.hxx>
-#ifndef GCC
-#endif
-
#include <sfx2/app.hxx>
#include "appdata.hxx"
#include "arrdecl.hxx"
@@ -94,7 +92,7 @@ void SfxApplication::RegisterToolBoxControl_Impl( SfxModule *pMod, SfxTbxCtrlFac
if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
(pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
{
- DBG_WARNING("TbxController-Registrierung ist nicht eindeutig!");
+ DBG_WARNING("TbxController registration is not clearly defined!");
}
}
#endif
@@ -119,7 +117,7 @@ void SfxApplication::RegisterStatusBarControl_Impl( SfxModule *pMod, SfxStbCtrlF
if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
(pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
{
- DBG_WARNING("StbController-Registrierung ist nicht eindeutig!");
+ DBG_WARNING("StbController registration is not clearly defined!");
}
}
#endif
@@ -144,10 +142,12 @@ void SfxApplication::RegisterMenuControl_Impl( SfxModule *pMod, SfxMenuCtrlFacto
if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
(pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
{
- DBG_WARNING("MenuController-Registrierung ist nicht eindeutig!");
+ DBG_WARNING("MenuController register is not clearly defined!");
}
}
#endif
pAppData_Impl->pMenuCtrlFac->C40_INSERT( SfxMenuCtrlFactory, pFact, pAppData_Impl->pMenuCtrlFac->Count() );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 3e9629149d2a..e3c7fd09be5c 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,6 +48,8 @@
#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
#include <com/sun/star/system/SystemShellExecuteException.hpp>
+#include <com/sun/star/frame/XComponentLoader.hpp>
+
#include <comphelper/processfactory.hxx>
#include <comphelper/storagehelper.hxx>
#include "comphelper/configurationhelper.hxx"
@@ -70,15 +73,16 @@
#include <vcl/help.hxx>
#include <vcl/stdtext.hxx>
#include <rtl/ustrbuf.hxx>
+#include <osl/file.hxx>
#include <unotools/pathoptions.hxx>
#include <unotools/moduleoptions.hxx>
#include <unotools/regoptions.hxx>
#include <svtools/helpopt.hxx>
+#include <svtools/miscopt.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <tools/shl.hxx>
#include <unotools/bootstrap.hxx>
-#include <vos/process.hxx>
#include <rtl/bootstrap.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <rtl/ustrbuf.hxx>
@@ -151,10 +155,49 @@ long QuitAgain_Impl( void* pObj, void* pArg )
return 0;
}
+/// Find the correct location of the document (LICENSE.odt, etc.), and return
+/// it in rURL if found.
+static sal_Bool checkURL( const char *pName, const char *pExt, rtl::OUString &rURL )
+{
+ using namespace osl;
+ DirectoryItem aDirItem;
+
+ rURL = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR/") );
+ rURL += rtl::OUString::createFromAscii( pName );
+ rURL += rtl::OUString::createFromAscii( pExt );
+ rtl::Bootstrap::expandMacros( rURL );
+
+ if (rURL.getLength() != 0)
+ return DirectoryItem::get( rURL, aDirItem ) == DirectoryItem::E_None;
+ else
+ return sal_False;
+}
+
+/// Displays CREDITS or LICENSE in any of the available version
+static void showDocument( const char* pBaseName )
+{
+ try {
+ Reference < XComponentLoader > xLoader( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")) ), UNO_QUERY );
+ Sequence < com::sun::star::beans::PropertyValue > args(2);
+ args[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ViewOnly"));
+ args[0].Value <<= sal_True;
+ args[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReadOnly"));
+ args[1].Value <<= sal_True;
+
+ rtl::OUString aURL;
+ if ( checkURL ( pBaseName, ".odt", aURL ) ||
+ checkURL ( pBaseName, ".html", aURL ) ||
+ checkURL ( pBaseName, "", aURL ) ) {
+ xLoader->loadComponentFromURL( aURL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_blank")), 0, args );
+ }
+ } catch (const ::com::sun::star::uno::Exception &) {
+ }
+}
+
void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
{
DBG_MEMTEST();
- bool bDone = sal_False;
+ bool bDone = false;
switch ( rReq.GetSlot() )
{
case SID_SETOPTIONS:
@@ -206,7 +249,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
if this dialog is closed by the user ...
So we ignore this request now and wait for a new user decision.
*/
- DBG_TRACE1( "QueryExit => FALSE (DispatchLevel == %u)", Application::GetDispatchLevel() );
+ OSL_TRACE( "QueryExit => sal_False (DispatchLevel == %u)", Application::GetDispatchLevel() );
return;
}
@@ -222,7 +265,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
// if terminate() was successful, SfxApplication is now dead!
pAppData_Impl->bInQuit = sal_False;
- // Returnwert setzten, ggf. terminieren
+ // Set return value, terminate if possible
rReq.SetReturnValue( SfxBoolItem( rReq.GetSlot(), bTerminated ) );
return;
}
@@ -266,7 +309,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
const short nRet = pDlg->Execute();
if ( nRet )
- bDone = sal_True;
+ bDone = true;
delete pDlg;
}
@@ -305,14 +348,13 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
sal_Bool bOk = ( n == 0);
rReq.SetReturnValue( SfxBoolItem( 0, bOk ) );
- bDone = sal_True;
+ bDone = true;
break;
}
case SID_SAVEDOCS:
{
sal_Bool bOK = sal_True;
- sal_Bool bTmpDone = sal_True;
for ( SfxObjectShell *pObjSh = SfxObjectShell::GetFirst();
pObjSh;
pObjSh = SfxObjectShell::GetNext( *pObjSh ) )
@@ -322,7 +364,6 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
{
pObjSh->ExecuteSlot( aReq );
SfxBoolItem *pItem = PTR_CAST( SfxBoolItem, aReq.GetReturnValue() );
- bTmpDone = aReq.IsDone();
if ( !pItem || !pItem->GetValue() )
bOK = sal_False;
}
@@ -333,26 +374,62 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
break;
}
+ case SID_SHOW_LICENSE:
+ {
+ ModalDialog aDialog( NULL, SfxResId( DLG_HELP_LICENSING ) );
+
+ String aLicensing;
+ for ( int i = STR_LICENSING_INFORMATION_1; i <= STR_LICENSING_INFORMATION_5; ++i )
+ {
+ if ( i != STR_LICENSING_INFORMATION_1 )
+ aLicensing += String( RTL_CONSTASCII_USTRINGPARAM( "\n\n" ) );
+ aLicensing += String( SfxResId( i ) );
+ }
+
+ FixedText aText( &aDialog );
+ aText.SetText( aLicensing );
+ OKButton aShow( &aDialog, SfxResId( PB_LICENSING_SHOW ) );
+ CancelButton aClose( &aDialog, SfxResId( PB_LICENSING_CLOSE ) );
+
+ // positions and sizes are computed to always fit the language
+ Size aTextSize( aText.GetOptimalSize( WINDOWSIZE_PREFERRED ) );
+ Size aShowSize( aShow.GetOptimalSize( WINDOWSIZE_PREFERRED ) );
+ Size aCloseSize( aClose.GetOptimalSize( WINDOWSIZE_PREFERRED ) );
+
+ long nDelimX = 12;
+ long nDelimY = 12;
+ long nWidth = aTextSize.Width() + 2*nDelimX;
+ long nButtonY = aTextSize.Height() + 2*nDelimY;
+ Size aButtonSize( std::max( aShowSize.Width(), aCloseSize.Width() ) + nDelimX,
+ std::max( aShowSize.Height(), aCloseSize.Height() ) );
+
+ aDialog.SetSizePixel( Size( nWidth, aTextSize.Height() + 3*nDelimY + aButtonSize.Height() ) );
+ aText.SetPosSizePixel( Point( nDelimX, nDelimY ), aTextSize );
+ aShow.SetPosSizePixel( Point( ( nWidth - nDelimX ) / 2 - aButtonSize.Width(), nButtonY ), aButtonSize );
+ aClose.SetPosSizePixel( Point( aShow.GetPosPixel().X() + aButtonSize.Width() + nDelimX, nButtonY ), aButtonSize );
+
+ aText.Show();
+
+ if ( aDialog.Execute() == RET_OK )
+ showDocument( "LICENSE" );
+
+ break;
+ }
+
+ case SID_SHOW_CREDITS:
+ {
+ showDocument( "CREDITS" );
+ break;
+ }
+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
case SID_HELPINDEX:
- case SID_HELP_SUPPORTPAGE:
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
- if ( rReq.GetSlot() == SID_HELP_SUPPORTPAGE )
- {
- // show Support page with new URL
- String sHelpURL = SfxHelp::CreateHelpURL( String::CreateFromAscii(".uno:HelpSupport"), String() );
- String sParams = sHelpURL.Copy( sHelpURL.Search( '?' ) );
- sHelpURL = String::CreateFromAscii("vnd.sun.star.help://shared/text/shared/05/00000001.xhp");
- sHelpURL += sParams;
- sHelpURL += String::CreateFromAscii("&UseDB=no");
- pHelp->Start( sHelpURL, NULL );
- }
- else
- pHelp->Start( String::CreateFromAscii(".uno:HelpIndex"), NULL ); // show start page
- bDone = sal_True;
+ pHelp->Start( String::CreateFromAscii(".uno:HelpIndex"), NULL ); // show start page
+ bDone = true;
}
break;
}
@@ -360,22 +437,21 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
case SID_HELPTIPS:
{
- // Parameter aus werten
+ // Evaluate Parameter
SFX_REQUEST_ARG(rReq, pOnItem, SfxBoolItem, SID_HELPTIPS, sal_False);
bool bOn = pOnItem
? ((SfxBoolItem*)pOnItem)->GetValue()
: !Help::IsQuickHelpEnabled();
- // ausf"uhren
if ( bOn )
Help::EnableQuickHelp();
else
Help::DisableQuickHelp();
SvtHelpOptions().SetHelpTips( bOn );
Invalidate(SID_HELPTIPS);
- bDone = sal_True;
+ bDone = true;
- // ggf. recorden
+ // Record if possible
if ( !rReq.IsAPI() )
rReq.AppendItem( SfxBoolItem( SID_HELPTIPS, bOn) );
break;
@@ -388,22 +464,21 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
}
case SID_HELPBALLOONS:
{
- // Parameter auswerten
+ // Evaluate Parameter
SFX_REQUEST_ARG(rReq, pOnItem, SfxBoolItem, SID_HELPBALLOONS, sal_False);
bool bOn = pOnItem
? ((SfxBoolItem*)pOnItem)->GetValue()
: !Help::IsBalloonHelpEnabled();
- // ausf"uhren
if ( bOn )
Help::EnableBalloonHelp();
else
Help::DisableBalloonHelp();
SvtHelpOptions().SetExtendedHelp( bOn );
Invalidate(SID_HELPBALLOONS);
- bDone = sal_True;
+ bDone = true;
- // ggf. recorden
+ // Record if possible
if ( !rReq.IsAPI() )
rReq.AppendItem( SfxBoolItem( SID_HELPBALLOONS, bOn) );
break;
@@ -419,7 +494,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
: !aHelpOpt.IsHelpAgentAutoStartMode();
aHelpOpt.SetHelpAgentAutoStartMode( bOn );
Invalidate(SID_HELP_PI);
- bDone = sal_True;
+ bDone = true;
break;
}
@@ -432,7 +507,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
VclAbstractDialog* pDlg = pFact->CreateVclDialog( 0, RID_DEFAULTABOUT );
pDlg->Execute();
delete pDlg;
- bDone = sal_True;
+ bDone = true;
}
break;
}
@@ -444,7 +519,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
new SfxTemplateOrganizeDlg(NULL);
pDlg->Execute();
delete pDlg;
- bDone = sal_True;
+ bDone = true;
break;
}
@@ -452,7 +527,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
{
svt::AddressBookSourceDialog aDialog(GetTopWindow(), ::comphelper::getProcessServiceFactory());
aDialog.Execute();
- bDone = sal_True;
+ bDone = true;
break;
}
@@ -525,7 +600,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
rtl::OUStringBuffer aBuf( aToolbarResName );
aBuf.append( pToolbarName->GetValue() );
- // Parameter auswerten
+ // Evaluate Parameter
rtl::OUString aToolbarName( aBuf.makeStringAndClear() );
sal_Bool bShow( !xLayoutManager->isElementVisible( aToolbarName ));
@@ -559,7 +634,7 @@ void SfxApplication::MiscState_Impl(SfxItemSet &rSet)
LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() );
const sal_uInt16 *pRanges = rSet.GetRanges();
- DBG_ASSERT(pRanges && *pRanges, "Set ohne Bereich");
+ DBG_ASSERT(pRanges && *pRanges, "Set without range");
while ( *pRanges )
{
for(sal_uInt16 nWhich = *pRanges++; nWhich <= *pRanges; ++nWhich)
@@ -580,6 +655,18 @@ void SfxApplication::MiscState_Impl(SfxItemSet &rSet)
break;
}
+ case SID_CONFIG:
+ case SID_TOOLBOXOPTIONS:
+ case SID_CONFIGSTATUSBAR:
+ case SID_CONFIGMENU:
+ case SID_CONFIGACCEL:
+ case SID_CONFIGEVENT:
+ {
+ if( SvtMiscOptions().DisableUICustomization() )
+ rSet.DisableItem(nWhich);
+ break;
+ }
+
case SID_BASICSTOP:
if ( !StarBASIC::IsRunning() )
rSet.DisableItem(nWhich);
@@ -656,7 +743,7 @@ void SfxApplication::MiscState_Impl(SfxItemSet &rSet)
static const ::rtl::OUString& getProductRegistrationServiceName( )
{
- static ::rtl::OUString s_sServiceName = ::rtl::OUString::createFromAscii( "com.sun.star.setup.ProductRegistration" );
+ static ::rtl::OUString s_sServiceName(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.setup.ProductRegistration"));
return s_sServiceName;
}
@@ -770,7 +857,7 @@ namespace
{
Reference < XFrame > xFrame( xContainer->getByIndex(i), UNO_QUERY_THROW );
::rtl::OUString sModule = xCheck->identify( xFrame );
- if ( sModule.equalsAscii( "com.sun.star.frame.StartModule" ) )
+ if ( sModule.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.frame.StartModule" ) ) )
return xFrame;
}
catch( const UnknownModuleException& )
@@ -841,11 +928,17 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
{
VclAbstractDialog* pDlg =
pFact->CreateFrameDialog( NULL, xFrame, rReq.GetSlot(), sPageURL );
- pDlg->Execute();
+ short nRet = pDlg->Execute();
delete pDlg;
SfxViewFrame* pView = SfxViewFrame::GetFirst();
while ( pView )
{
+ if (nRet == RET_OK)
+ {
+ SfxObjectShell* pObjSh = pView->GetObjectShell();
+ if (pObjSh)
+ pObjSh->SetConfigOptionsChecked(false);
+ }
pView->GetBindings().InvalidateAll(sal_False);
pView = SfxViewFrame::GetNext( *pView );
}
@@ -866,9 +959,9 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
// 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(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Common")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Dictionaries")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RepositoryURL")),
::rtl::OUString());
if ( xSystemShell.is() && sTemplRepoURL.getLength() > 0 )
@@ -879,10 +972,10 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
// 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"));
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Setup")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("L10N")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooLocale")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en-US")));
aURLBuf.append( sLocale );
xSystemShell->execute(
@@ -912,12 +1005,12 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
// tell it that the user wants to register
if ( xProductRegistration.is() )
{
- xProductRegistration->trigger( ::rtl::OUString::createFromAscii( "RegistrationRequired" ) );
+ xProductRegistration->trigger( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RegistrationRequired")) );
}
}
catch( const ::com::sun::star::uno::Exception& )
{
- DBG_ERROR( "OfficeApplication::ExecuteApp_Impl(SID_ONLINE_REGISTRATION): caught an exception!" );
+ OSL_FAIL( "OfficeApplication::ExecuteApp_Impl(SID_ONLINE_REGISTRATION): caught an exception!" );
}
}
break;
@@ -1152,13 +1245,13 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
Reference< com::sun::star::lang::XMultiServiceFactory > xORB = ::comphelper::getProcessServiceFactory();
Reference< com::sun::star::frame::XDispatchProvider > xProv(
- xORB->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.drawing.ModuleDispatcher")), UNO_QUERY );
+ xORB->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ModuleDispatcher"))), UNO_QUERY );
if ( xProv.is() )
{
::rtl::OUString aCmd = ::rtl::OUString::createFromAscii( GetInterface()->GetSlot( rReq.GetSlot() )->GetUnoName() );
Reference< com::sun::star::frame::XDispatchHelper > xHelper(
- xORB->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.frame.DispatchHelper")), UNO_QUERY );
+ xORB->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.DispatchHelper"))), UNO_QUERY );
if ( xHelper.is() )
{
Sequence < com::sun::star::beans::PropertyValue > aSeq;
@@ -1182,13 +1275,13 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
{
Reference< com::sun::star::lang::XMultiServiceFactory > xORB = ::comphelper::getProcessServiceFactory();
Reference< com::sun::star::frame::XDispatchProvider > xProv(
- xORB->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.text.ModuleDispatcher")), UNO_QUERY );
+ xORB->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.ModuleDispatcher"))), UNO_QUERY );
if ( xProv.is() )
{
::rtl::OUString aCmd = ::rtl::OUString::createFromAscii( GetInterface()->GetSlot( rReq.GetSlot() )->GetUnoName() );
Reference< com::sun::star::frame::XDispatchHelper > xHelper(
- xORB->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.frame.DispatchHelper")), UNO_QUERY );
+ xORB->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.DispatchHelper"))), UNO_QUERY );
if ( xHelper.is() )
{
Sequence < com::sun::star::beans::PropertyValue > aSeq;
@@ -1240,7 +1333,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
void SfxApplication::OfaState_Impl(SfxItemSet &rSet)
{
const sal_uInt16 *pRanges = rSet.GetRanges();
- DBG_ASSERT(pRanges && *pRanges, "Set ohne Bereich");
+ DBG_ASSERT(pRanges && *pRanges, "Set without Region");
while ( *pRanges )
{
for(sal_uInt16 nWhich = *pRanges++; nWhich <= *pRanges; ++nWhich)
@@ -1270,3 +1363,5 @@ void SfxApplication::OfaState_Impl(SfxItemSet &rSet)
if ( !aModuleOpt.IsImpress() )
rSet.DisableItem( SID_SD_AUTOPILOT );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 9ffb48e1b34a..193834d44ed5 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -135,7 +136,6 @@ using namespace ::com::sun::star::io;
#include <ownsubfilterservice.hxx>
#include "SfxDocumentMetaData.hxx"
-#define FRAMELOADER_SERVICENAME "com.sun.star.frame.FrameLoader"
#define PROTOCOLHANDLER_SERVICENAME "com.sun.star.frame.ProtocolHandler"
static char const sTemplateRegionName[] = "TemplateRegionName";
@@ -145,6 +145,7 @@ static char const sOpenNewView[] = "OpenNewView";
static char const sViewId[] = "ViewId";
static char const sPluginMode[] = "PluginMode";
static char const sReadOnly[] = "ReadOnly";
+static char const sDdeReconnect[] = "DDEReconnect";
static char const sStartPresentation[] = "StartPresentation";
static char const sFrameName[] = "FrameName";
static char const sMediaType[] = "MediaType";
@@ -219,7 +220,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
#ifdef DBG_UTIL
ByteString aStr( "No creator method for item: ");
aStr += ByteString::CreateFromInt32( nSlotId );
- DBG_ERROR( aStr.GetBuffer() );
+ OSL_FAIL( aStr.GetBuffer() );
#endif
return;
}
@@ -243,7 +244,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
{
ByteString aStr( "Property not convertable: ");
aStr += pSlot->pUnoName;
- DBG_ERROR( aStr.GetBuffer() );
+ OSL_FAIL( aStr.GetBuffer() );
}
#endif
}
@@ -253,7 +254,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
// for a simple property there can be only one parameter and its name *must* match
ByteString aStr( "Property name does not match: ");
aStr += ByteString( aName, RTL_TEXTENCODING_UTF8 );
- DBG_ERROR( aStr.GetBuffer() );
+ OSL_FAIL( aStr.GetBuffer() );
}
#endif
else
@@ -296,7 +297,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
{
ByteString aDbgStr( "Property not convertable: ");
aDbgStr += pSlot->pUnoName;
- DBG_ERROR( aDbgStr.GetBuffer() );
+ OSL_FAIL( aDbgStr.GetBuffer() );
}
#endif
break;
@@ -309,7 +310,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
// there was a parameter with a name that didn't match to any of the members
ByteString aStr( "Property name does not match: ");
aStr += ByteString( String(rPropValue.Name), RTL_TEXTENCODING_UTF8 );
- DBG_ERROR( aStr.GetBuffer() );
+ OSL_FAIL( aStr.GetBuffer() );
}
#endif
}
@@ -337,7 +338,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
#ifdef DBG_UTIL
ByteString aStr( "No creator method for argument: ");
aStr += rArg.pName;
- DBG_ERROR( aStr.GetBuffer() );
+ OSL_FAIL( aStr.GetBuffer() );
#endif
return;
}
@@ -367,7 +368,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
{
ByteString aStr( "Property not convertable: ");
aStr += rArg.pName;
- DBG_ERROR( aStr.GetBuffer() );
+ OSL_FAIL( aStr.GetBuffer() );
}
#endif
break;
@@ -396,7 +397,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
{
ByteString aStr( "Property not convertable: ");
aStr += rArg.pName;
- DBG_ERROR( aStr.GetBuffer() );
+ OSL_FAIL( aStr.GetBuffer() );
}
#endif
}
@@ -435,7 +436,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
#ifdef DBG_UTIL
ByteString aDbgStr( "Property not convertable: ");
aDbgStr += rArg.pName;
- DBG_ERROR( aDbgStr.GetBuffer() );
+ OSL_FAIL( aDbgStr.GetBuffer() );
#endif
}
@@ -608,6 +609,14 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxBoolItem( SID_DOC_READONLY, bVal ) );
}
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sDdeReconnect)) )
+ {
+ sal_Bool bVal = sal_True;
+ sal_Bool bOK = (rProp.Value >>= bVal);
+ DBG_ASSERT( bOK, "invalid type for DDEReconnect" );
+ if (bOK)
+ rSet.Put( SfxBoolItem( SID_DDE_RECONNECT_ONLOAD, bVal ) );
+ }
else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sStartPresentation)) )
{
sal_Bool bVal = sal_False;
@@ -875,7 +884,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
#endif
}
}
- // --> PB 2007-12-09 #i83757#
+ // API to raise options dialog with a specified options ab page (#i83757#)
else
{
// transform parameter "OptionsPageURL" of slot "OptionsTreeDialog"
@@ -897,7 +906,6 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
}
}
}
- // <--
#ifdef DB_UTIL
if ( nFoundArgs == nCount )
{
@@ -953,7 +961,7 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta
// we will not rely on the "toggle" ability of some property slots
ByteString aStr( "Processing property slot without argument: ");
aStr += ByteString::CreateFromInt32( nSlotId );
- DBG_ERROR( aStr.GetBuffer() );
+ OSL_FAIL( aStr.GetBuffer() );
}
#endif
@@ -1027,6 +1035,8 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta
nAdditional++;
if ( rSet.GetItemState( SID_DOC_READONLY ) == SFX_ITEM_SET )
nAdditional++;
+ if ( rSet.GetItemState( SID_DDE_RECONNECT_ONLOAD ) == SFX_ITEM_SET )
+ nAdditional++;
if ( rSet.GetItemState( SID_DOC_STARTPRESENTATION ) == SFX_ITEM_SET )
nAdditional++;
if ( rSet.GetItemState( SID_SELECTION ) == SFX_ITEM_SET )
@@ -1266,13 +1276,12 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta
sal_uInt16 nSubCount = pType->nAttribs;
if ( !nSubCount )
{
- //rPool.FillVariable( *pItem, *pVar, eUserMetric );
pValue[nActProp].Name = String( String::CreateFromAscii( pSlot->pUnoName ) ) ;
if ( !pItem->QueryValue( pValue[nActProp].Value ) )
{
ByteString aStr( "Item not convertable: ");
aStr += ByteString::CreateFromInt32(nSlotId);
- DBG_ERROR( aStr.GetBuffer() );
+ OSL_FAIL( aStr.GetBuffer() );
}
}
else
@@ -1280,7 +1289,6 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta
// complex type, add a property value for every member of the struct
for ( sal_uInt16 n=1; n<=nSubCount; ++n )
{
- //rPool.FillVariable( *pItem, *pVar, eUserMetric );
sal_uInt8 nSubId = (sal_uInt8) (sal_Int8) pType->aAttrib[n-1].nAID;
if ( bConvertTwips )
nSubId |= CONVERT_TWIPS;
@@ -1296,7 +1304,7 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta
aStr += ByteString::CreateFromInt32( pType->aAttrib[n-1].nAID );
aStr += " not convertable in slot: ";
aStr += ByteString::CreateFromInt32(nSlotId);
- DBG_ERROR( aStr.GetBuffer() );
+ OSL_FAIL( aStr.GetBuffer() );
}
}
}
@@ -1317,13 +1325,12 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta
sal_uInt16 nSubCount = rArg.pType->nAttribs;
if ( !nSubCount )
{
- //rPool.FillVariable( *pItem, *pVar, eUserMetric );
pValue[nActProp].Name = String( String::CreateFromAscii( rArg.pName ) ) ;
if ( !pItem->QueryValue( pValue[nActProp++].Value ) )
{
ByteString aStr( "Item not convertable: ");
aStr += ByteString::CreateFromInt32(rArg.nSlotId);
- DBG_ERROR( aStr.GetBuffer() );
+ OSL_FAIL( aStr.GetBuffer() );
}
}
else
@@ -1331,7 +1338,6 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta
// complex type, add a property value for every member of the struct
for ( sal_uInt16 n = 1; n <= nSubCount; ++n )
{
- //rPool.FillVariable( rItem, *pVar, eUserMetric );
sal_uInt8 nSubId = (sal_uInt8) (sal_Int8) rArg.pType->aAttrib[n-1].nAID;
if ( bConvertTwips )
nSubId |= CONVERT_TWIPS;
@@ -1347,7 +1353,7 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta
aStr += ByteString::CreateFromInt32( rArg.pType->aAttrib[n-1].nAID );
aStr += " not convertable in slot: ";
aStr += ByteString::CreateFromInt32(rArg.nSlotId);
- DBG_ERROR( aStr.GetBuffer() );
+ OSL_FAIL( aStr.GetBuffer() );
}
}
}
@@ -1423,13 +1429,13 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta
pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sFrame));
if ( pItem->ISA( SfxUsrAnyItem ) )
{
- OSL_ENSURE( false, "TransformItems: transporting an XFrame via an SfxUsrAnyItem is not deprecated!" );
+ OSL_FAIL( "TransformItems: transporting an XFrame via an SfxUsrAnyItem is not deprecated!" );
pValue[nActProp++].Value = static_cast< const SfxUsrAnyItem* >( pItem )->GetValue();
}
else if ( pItem->ISA( SfxUnoFrameItem ) )
pValue[nActProp++].Value <<= static_cast< const SfxUnoFrameItem* >( pItem )->GetFrame();
else
- OSL_ENSURE( false, "TransformItems: invalid item type for SID_FILLFRAME!" );
+ OSL_FAIL( "TransformItems: invalid item type for SID_FILLFRAME!" );
}
if ( rSet.GetItemState( SID_TEMPLATE, sal_False, &pItem ) == SFX_ITEM_SET )
{
@@ -1456,6 +1462,11 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta
pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sReadOnly));
pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
}
+ if ( rSet.GetItemState( SID_DDE_RECONNECT_ONLOAD, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sDdeReconnect));
+ pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
+ }
if ( rSet.GetItemState( SID_DOC_STARTPRESENTATION, sal_False, &pItem ) == SFX_ITEM_SET )
{
pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sStartPresentation));
@@ -1688,7 +1699,7 @@ void SAL_CALL SfxMacroLoader::dispatchWithNotification( const ::com::sun::star::
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchResultListener >& xListener )
throw (::com::sun::star::uno::RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
sal_uInt32 nPropertyCount = lArgs.getLength();
::rtl::OUString aReferer;
@@ -1733,7 +1744,7 @@ void SAL_CALL SfxMacroLoader::dispatch( const ::com::sun::star::util::URL&
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArgs )
throw (::com::sun::star::uno::RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
sal_uInt32 nPropertyCount = lArgs.getLength();
::rtl::OUString aReferer;
@@ -1980,7 +1991,7 @@ throw( RuntimeException )
Sequence< sal_Int16 > SAL_CALL SfxAppDispatchProvider::getSupportedCommandGroups()
throw (::com::sun::star::uno::RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
std::list< sal_Int16 > aGroupList;
SfxSlotPool* pAppSlotPool = &SFX_APP()->GetAppSlotPool_Impl();
@@ -2015,7 +2026,7 @@ throw (::com::sun::star::uno::RuntimeException)
{
std::list< ::com::sun::star::frame::DispatchInformation > aCmdList;
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
SfxSlotPool* pAppSlotPool = &SFX_APP()->GetAppSlotPool_Impl();
if ( pAppSlotPool )
@@ -2159,7 +2170,6 @@ SFX2_DLLPUBLIC void* SAL_CALL component_getFactory(
//=============================================================================
// Add new macro line to handle new service.
- //
// !!! ATTENTION !!!
// Write no ";" at end of line and dont forget "else" ! (see macro)
//=============================================================================
@@ -2177,13 +2187,6 @@ SFX2_DLLPUBLIC void* SAL_CALL component_getFactory(
IF_NAME_CREATECOMPONENTFACTORY( TestMouseClickHandler )
#endif
IF_NAME_CREATECOMPONENTFACTORY( OPackageStructureCreator )
- #if 0
- if ( ::sfx2::AppletObject::impl_getStaticImplementationName().equals(
- ::rtl::OUString::createFromAscii( pImplementationName ) ) )
- {
- xFactory = ::sfx2::AppletObject::impl_createFactory();
- }
- #endif
IF_NAME_CREATECOMPONENTFACTORY( ::sfx2::PluginObject )
IF_NAME_CREATECOMPONENTFACTORY( ::sfx2::IFrameObject )
IF_NAME_CREATECOMPONENTFACTORY( ::sfx2::OwnSubFilterService )
@@ -2195,6 +2198,16 @@ SFX2_DLLPUBLIC void* SAL_CALL component_getFactory(
::comp_SfxDocumentMetaData::_getImplementationName(),
::comp_SfxDocumentMetaData::_getSupportedServiceNames());
}
+ if ( ::comp_CompatWriterDocProps::_getImplementationName().equals(
+ ::rtl::OUString::createFromAscii( pImplementationName ) ) )
+ {
+ xFactory = ::cppu::createSingleComponentFactory(
+ ::comp_CompatWriterDocProps::_create,
+ ::comp_CompatWriterDocProps::_getImplementationName(),
+ ::comp_CompatWriterDocProps::_getSupportedServiceNames());
+ }
+
+ // Factory is valid - service was found.
// Factory is valid - service was found.
if ( xFactory.is() )
@@ -2396,3 +2409,4 @@ com::sun::star::uno::Reference < ::com::sun::star::task::XInteractionRequest > N
return com::sun::star::uno::Reference < ::com::sun::star::task::XInteractionRequest >(pImp);
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx
index 2af0e9c179e2..3ce4d0ee5a00 100644
--- a/sfx2/source/appl/childwin.cxx
+++ b/sfx2/source/appl/childwin.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,21 +29,14 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sfx2.hxx"
-#ifndef _TOOLBOX_HXX //autogen
#include <vcl/toolbox.hxx>
-#endif
-#ifndef _RCID_H
#include <tools/rcid.h>
-#endif
#include <unotools/viewoptions.hxx>
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/util/XCloseable.hpp>
#include <cppuhelper/implbase1.hxx>
-#ifndef GCC
-#endif
-
#include <sfx2/childwin.hxx>
#include <sfx2/app.hxx>
#include "arrdecl.hxx"
@@ -219,8 +213,8 @@ SfxChildWindow* SfxChildWindow::CreateChildWindow( sal_uInt16 nId,
SfxChildWinFactory* pFact=0;
sal_uInt16 nOldMode = Application::GetSystemWindowMode();
- // Zuerst ChildWindow im SDT suchen; "Uberlagerungen m"ussen mit einem
- // ChildWindowContext realisiert werden
+ // First search for ChildWindow in SDT; "Overloading has to be realized
+ // by using ChildWindowContext
SfxApplication *pApp = SFX_APP();
{
SfxChildWinFactArr_Impl &rFactories = pApp->GetChildWinFactories_Impl();
@@ -282,12 +276,12 @@ SfxChildWindow* SfxChildWindow::CreateChildWindow( sal_uInt16 nId,
if ( pChild )
pChild->SetFactory_Impl( pFact );
- DBG_ASSERT(pFact && (pChild || !rInfo.bVisible), "ChildWindow-Typ nicht registriert!");
+ DBG_ASSERT(pFact && (pChild || !rInfo.bVisible), "ChildWindow-Typ not registered!");
if ( pChild && !pChild->pWindow )
{
DELETEZ(pChild);
- DBG_WARNING("ChildWindow hat kein Fenster!");
+ DBG_WARNING("ChildWindow has no Window!");
}
return pChild;
@@ -311,8 +305,6 @@ void SfxChildWindow::SaveStatus(const SfxChildWinInfo& rInfo)
}
SvtViewOptions aWinOpt( E_WINDOW, String::CreateFromInt32( nID ) );
- // aWinOpt.SetPosition( rInfo.aPos.X(), rInfo.aPos.Y() );
- // aWinOpt.SetSize( rInfo.aSize.Width(), rInfo.aSize.Height() );
aWinOpt.SetWindowState( String( rInfo.aWinState, RTL_TEXTENCODING_UTF8 ) );
::com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue > aSeq(1);
@@ -378,43 +370,6 @@ sal_uInt16 SfxChildWindow::GetPosition()
return pImp->pFact->nPos;
}
-#if 0
-static void ImplWindowStateFromStr( Point rPos, Size rSize, const ByteString& rStr )
-{
- sal_uIntPtr nValidMask = 0;
- xub_StrLen nIndex = 0;
- ByteString aTokenStr;
-
- aTokenStr = rStr.GetToken( 0, ',', nIndex );
- if ( aTokenStr.Len() )
- {
- rPos.X() = aTokenStr.ToInt32();
- nValidMask |= WINDOWSTATE_MASK_X;
- }
-
- aTokenStr = rStr.GetToken( 0, ',', nIndex );
- if ( aTokenStr.Len() )
- {
- rPos.Y() = aTokenStr.ToInt32();
- nValidMask |= WINDOWSTATE_MASK_Y;
- }
-
- aTokenStr = rStr.GetToken( 0, ',', nIndex );
- if ( aTokenStr.Len() )
- {
- rSize.Width() = aTokenStr.ToInt32();
- nValidMask |= WINDOWSTATE_MASK_WIDTH;
- }
-
- aTokenStr = rStr.GetToken( 0, ';', nIndex );
- if ( aTokenStr.Len() )
- {
- rSize.Height() = aTokenStr.ToInt32();
- nValidMask |= WINDOWSTATE_MASK_HEIGHT;
- }
-}
-#endif
-
//-------------------------------------------------------------------------
void SfxChildWindow::InitializeChildWinFactory_Impl( sal_uInt16 nId, SfxChildWinInfo& rInfo )
{
@@ -433,19 +388,18 @@ void SfxChildWindow::InitializeChildWinFactory_Impl( sal_uInt16 nId, SfxChildWin
String aWinData( aTmp );
rInfo.aWinState = ByteString( String(aWinOpt.GetWindowState()), RTL_TEXTENCODING_UTF8 );
- //ImplWindowStateFromStr( rInfo.aPos, rInfo.aSize, ByteString( aWinState, RTL_TEXTENCODING_UTF8 ) );
if ( aWinData.Len() )
{
- // Nach Versionskennung suchen
+ // Search for version ID
if ( aWinData.GetChar((sal_uInt16)0) != 0x0056 ) // 'V' = 56h
- // Keine Versionskennung, daher nicht verwenden
+ // A version ID, so do not use
return;
- // 'V' l"oschen
+ // Delete 'V'
aWinData.Erase(0,1);
- // Version lesen
+ // Read version
char cToken = ',';
sal_uInt16 nPos = aWinData.Search( cToken );
sal_uInt16 nActVersion = (sal_uInt16)aWinData.Copy( 0, nPos + 1 ).ToInt32();
@@ -454,10 +408,7 @@ void SfxChildWindow::InitializeChildWinFactory_Impl( sal_uInt16 nId, SfxChildWin
aWinData.Erase(0,nPos+1);
- //aWinOpt.GetPosition( rInfo.aPos.X(), rInfo.aPos.Y() );
- //aWinOpt.GetSize( rInfo.aSize.Width(), rInfo.aSize.Height() );
-
- // Sichtbarkeit laden: ist als ein char codiert
+ // Load Visibility: is coded as a char
rInfo.bVisible = (aWinData.GetChar(0) == 0x0056); // 'V' = 56h
aWinData.Erase(0,1);
nPos = aWinData.Search( cToken );
@@ -466,7 +417,7 @@ void SfxChildWindow::InitializeChildWinFactory_Impl( sal_uInt16 nId, SfxChildWin
sal_uInt16 nNextPos = aWinData.Search( cToken, 2 );
if ( nNextPos != STRING_NOTFOUND )
{
- // es gibt noch Extra-Information
+ // there is extra information
rInfo.nFlags = (sal_uInt16)aWinData.Copy( nPos+1, nNextPos - nPos - 1 ).ToInt32();
aWinData.Erase( nPos, nNextPos-nPos+1 );
rInfo.aExtraString = aWinData;
@@ -495,7 +446,7 @@ void SfxChildWindow::CreateContext( sal_uInt16 nContextId, SfxBindings& rBinding
pFact = rFactories[nFactory];
if ( pFact->nId == GetType() )
{
- DBG_ASSERT( pFact->pArr, "Kein Kontext angemeldet!" );
+ DBG_ASSERT( pFact->pArr, "No context registered!" );
if ( !pFact->pArr )
break;
@@ -527,7 +478,7 @@ void SfxChildWindow::CreateContext( sal_uInt16 nContextId, SfxBindings& rBinding
pFact = rFactories[nFactory];
if ( pFact->nId == GetType() )
{
- DBG_ASSERT( pFact->pArr, "Kein Kontext angemeldet!" );
+ DBG_ASSERT( pFact->pArr, "No context registered!" );
if ( !pFact->pArr )
break;
@@ -552,7 +503,7 @@ void SfxChildWindow::CreateContext( sal_uInt16 nContextId, SfxBindings& rBinding
if ( !pCon )
{
- DBG_ERROR( "Kein geeigneter Context gefunden!" );
+ OSL_FAIL( "No suitable context found! ");
return;
}
@@ -587,7 +538,7 @@ FloatingWindow* SfxChildWindowContext::GetFloatingWindow() const
}
else
{
- DBG_ERROR("Kein FloatingWindow-Context!");
+ OSL_FAIL("No FloatingWindow-Context!");
return NULL;
}
}
@@ -661,7 +612,7 @@ sal_Bool SfxChildWinInfo::GetExtraData_Impl
sal_uInt16 *pPos
) const
{
- // ung"ultig?
+ // invalid?
if ( !aExtraString.Len() )
return sal_False;
String aStr;
@@ -669,8 +620,8 @@ sal_Bool SfxChildWinInfo::GetExtraData_Impl
if ( nPos == STRING_NOTFOUND )
return sal_False;
- // Versuche, den Alignment-String "ALIGN:(...)" einzulesen; wenn
- // er nicht vorhanden ist, liegt eine "altere Version vor
+ // Try to read the alignment string "ALIGN :(...)", but if
+ // it is not present, then use an older version
if ( nPos != STRING_NOTFOUND )
{
sal_uInt16 n1 = aExtraString.Search('(', nPos);
@@ -679,20 +630,20 @@ sal_Bool SfxChildWinInfo::GetExtraData_Impl
sal_uInt16 n2 = aExtraString.Search(')', n1);
if ( n2 != STRING_NOTFOUND )
{
- // Alignment-String herausschneiden
+ // Cut out Alignment string
aStr = aExtraString.Copy(nPos, n2 - nPos + 1);
aStr.Erase(nPos, n1-nPos+1);
}
}
}
- // Zuerst das Alignment extrahieren
+ // First extract the Alignment
if ( !aStr.Len() )
return sal_False;
if ( pAlign )
*pAlign = (SfxChildAlignment) (sal_uInt16) aStr.ToInt32();
- // Dann das LastAlignment
+ // then the LastAlignment
nPos = aStr.Search(',');
if ( nPos == STRING_NOTFOUND )
return sal_False;
@@ -700,10 +651,10 @@ sal_Bool SfxChildWinInfo::GetExtraData_Impl
if ( pLastAlign )
*pLastAlign = (SfxChildAlignment) (sal_uInt16) aStr.ToInt32();
- // Dann die Splitting-Informationen
+ // Then the splitting information
nPos = aStr.Search(',');
if ( nPos == STRING_NOTFOUND )
- // Dockt nicht in einem Splitwindow
+ // No docking in a Splitwindow
return sal_True;
aStr.Erase(0, nPos+1);
Point aChildPos;
@@ -747,8 +698,6 @@ void SfxChildWindow::Hide()
}
}
-
-
void SfxChildWindow::Show( sal_uInt16 nFlags )
{
switch ( pWindow->GetType() )
@@ -777,20 +726,14 @@ void SfxChildWindow::SetWorkWindow_Impl( SfxWorkWindow* pWin )
pImp->pWorkWin->SetActiveChild_Impl( pWindow );
}
-//SfxWorkWindow* SfxChildWindow::GetWorkWindow_Impl() const
-//{
-// return pImp->pWorkWin;
-//}
-
void SfxChildWindow::Activate_Impl()
{
- if(pImp->pWorkWin!=NULL) //@#60568#
+ if(pImp->pWorkWin!=NULL)
pImp->pWorkWin->SetActiveChild_Impl( pWindow );
}
void SfxChildWindow::Deactivate_Impl()
{
-// pImp->pWorkWin->SetActiveChild_Impl( NULL );
}
sal_Bool SfxChildWindow::QueryClose()
@@ -853,3 +796,4 @@ void SfxChildWindow::RegisterChildWindow(SfxModule* pMod, SfxChildWinFactory* pF
SFX_APP()->RegisterChildWindow_Impl( pMod, pFact );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/dde.hrc b/sfx2/source/appl/dde.hrc
index d3e178606809..d3e178606809 100644..100755
--- a/sfx2/source/appl/dde.hrc
+++ b/sfx2/source/appl/dde.hrc
diff --git a/sfx2/source/appl/fileobj.cxx b/sfx2/source/appl/fileobj.cxx
index a2b29344f52c..95d32df52f1a 100644
--- a/sfx2/source/appl/fileobj.cxx
+++ b/sfx2/source/appl/fileobj.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -109,9 +110,9 @@ sal_Bool SvFileObject::GetData( ::com::sun::star::uno::Any & rData,
case FILETYPE_TEXT:
if( FORMAT_FILE == nFmt )
{
- // das Medium muss in der Applikation geoffnet werden, um die
- // relativen Datei Links aufzuloesen!!!! Wird ueber den
- // LinkManager und damit von dessen Storage erledigt.
+ // The media in the application must be opened to lookup the
+ // relative file links!! This is done through the link manager
+ // of the Storage.
rData <<= rtl::OUString( sFileNm );
}
break;
@@ -126,20 +127,15 @@ sal_Bool SvFileObject::GetData( ::com::sun::star::uno::Any & rData,
{
Graphic aGrf;
- //JP 15.07.98: Bug 52959
- // falls das Nativformat doch erwuenscht ist, muss am
- // Ende das Flag zurueckgesetzt werden.
-// wird einzig und allein im sw/ndgrf.cxx benutzt, wenn der Link vom
-// GraphicNode entfernt wird.
+ // If the native format is reqested, has to be reset at the
+ // end of the flag. Is solely in the sw/ndgrf.cxx used when
+ // the link is removed form GraphicNode.
sal_Bool bOldNativFormat = bNativFormat;
-//!!?? bNativFormat = 0 != (ASPECT_ICON & pSvData->GetAspect());
- // falls gedruckt werden soll, warten wir bis die
- // Daten vorhanden sind
+ // If about to print, waiting for the data to be available
if( bGetSynchron )
{
- // testhalber mal ein LoadFile rufen um das nach-
- // laden ueberahaupt anzustossen
+ // call a LoadFile every second time to test the loading
if( !xMed.Is() )
LoadFile_Impl();
@@ -155,13 +151,10 @@ sal_Bool SvFileObject::GetData( ::com::sun::star::uno::Any & rData,
}
if( pDownLoadData ||
- ( !bWaitForData && ( xMed.Is() || // wurde als URL geladen
+ ( !bWaitForData && ( xMed.Is() || // was loaded as URL
( bSynchron && LoadFile_Impl() && xMed.Is() ) )) )
{
- // falls
-
- // falls es uebers Internet gesogen wurde, nicht
- // wieder versuchen
+ // If it was loaded from the Internet, do not retry
if( !bGetSynchron )
bLoadAgain = !xMed->IsRemote();
bLoadError = !GetGraphic_Impl( aGrf, xMed->GetInStream() );
@@ -196,7 +189,7 @@ sal_Bool SvFileObject::GetData( ::com::sun::star::uno::Any & rData,
break;
default:
- if( aGrf.GetGDIMetaFile().GetActionCount() )
+ if( aGrf.GetGDIMetaFile().GetActionSize() )
{
GDIMetaFile aMeta( aGrf.GetGDIMetaFile() );
aMeta.Write( aMemStm );
@@ -207,7 +200,7 @@ sal_Bool SvFileObject::GetData( ::com::sun::star::uno::Any & rData,
bNativFormat = bOldNativFormat;
- // alles fertig?
+ // Everything ready?
if( xMed.Is() && !bSynchron && bClearMedium )
{
xMed.Clear();
@@ -224,16 +217,12 @@ sal_Bool SvFileObject::GetData( ::com::sun::star::uno::Any & rData,
return sal_True/*0 != aTypeList.Count()*/;
}
-
-
-
sal_Bool SvFileObject::Connect( sfx2::SvBaseLink* pLink )
{
if( !pLink || !pLink->GetLinkManager() )
return sal_False;
- // teste doch mal, ob nicht ein anderer Link mit der gleichen
- // Verbindung schon existiert
+ // Test if not another link of the same connection already exists
pLink->GetLinkManager()->GetDisplayNames( pLink, 0, &sFileNm, 0, &sFilter );
if( OBJECT_CLIENT_GRF == pLink->GetObjType() )
@@ -271,26 +260,24 @@ sal_Bool SvFileObject::Connect( sfx2::SvBaseLink* pLink )
SetUpdateTimeout( 0 );
- // und jetzt bei diesem oder gefundenem Pseudo-Object anmelden
+ // and now register by this or other found Pseudo-Object
AddDataAdvise( pLink, SotExchange::GetFormatMimeType( pLink->GetContentType()), 0 );
return sal_True;
}
-
sal_Bool SvFileObject::LoadFile_Impl()
{
- // wir sind noch im Laden!!
+ // We are still at Loading!!
if( bWaitForData || !bLoadAgain || xMed.Is() || pDownLoadData )
return sal_False;
- // z.Z. nur auf die aktuelle DocShell
+ // at the moment on the current DocShell
xMed = new SfxMedium( sFileNm, STREAM_STD_READ, sal_True );
SvLinkSource::StreamToLoadFrom aStreamToLoadFrom =
getStreamToLoadFrom();
xMed->setStreamToLoadFrom(
aStreamToLoadFrom.m_xInputStreamToLoadFrom,
aStreamToLoadFrom.m_bIsReadOnly);
- // setStreamToLoadFrom(0,0);
if( sReferer.Len() )
xMed->SetReferer( sReferer );
@@ -307,7 +294,7 @@ sal_Bool SvFileObject::LoadFile_Impl()
bClearMedium = !xMed.Is();
if( bClearMedium )
- xMed = xTmpMed; // falls gleich im DownLoad schon schluss ist
+ xMed = xTmpMed; // If already finished in DownLoad
return bDataReady;
}
@@ -317,7 +304,7 @@ sal_Bool SvFileObject::LoadFile_Impl()
bLoadAgain = !xMed->IsRemote();
bWaitForData = sal_False;
- // Grafik ist fertig, also DataChanged von der Statusaederung schicken:
+ // Graphic is finished, also send DataChanged of the Status change:
SendStateChg_Impl( xMed->GetInStream() && xMed->GetInStream()->GetError()
? sfx2::LinkManager::STATE_LOAD_ERROR : sfx2::LinkManager::STATE_LOAD_OK );
return sal_True;
@@ -326,32 +313,32 @@ sal_Bool SvFileObject::LoadFile_Impl()
sal_Bool SvFileObject::GetGraphic_Impl( Graphic& rGrf, SvStream* pStream )
{
- GraphicFilter* pGF = GraphicFilter::GetGraphicFilter();
+ GraphicFilter& rGF = GraphicFilter::GetGraphicFilter();
- const sal_uInt16 nFilter = sFilter.Len() && pGF->GetImportFormatCount()
- ? pGF->GetImportFormatNumber( sFilter )
+ const sal_uInt16 nFilter = sFilter.Len() && rGF.GetImportFormatCount()
+ ? rGF.GetImportFormatNumber( sFilter )
: GRFILTER_FORMAT_DONTKNOW;
String aEmptyStr;
int nRes;
- // vermeiden, dass ein native Link angelegt wird
+ // To avoid that a native link is created
if( ( !pStream || !pDownLoadData ) && !rGrf.IsLink() &&
!rGrf.GetContext() && !bNativFormat )
rGrf.SetLink( GfxLink() );
if( !pStream )
nRes = xMed.Is() ? GRFILTER_OPENERROR
- : pGF->ImportGraphic( rGrf, INetURLObject(sFileNm),
+ : rGF.ImportGraphic( rGrf, INetURLObject(sFileNm),
nFilter );
else if( !pDownLoadData )
{
pStream->Seek( STREAM_SEEK_TO_BEGIN );
- nRes = pGF->ImportGraphic( rGrf, aEmptyStr, *pStream, nFilter );
+ nRes = rGF.ImportGraphic( rGrf, aEmptyStr, *pStream, nFilter );
}
else
{
- nRes = pGF->ImportGraphic( pDownLoadData->aGrf, aEmptyStr,
+ nRes = rGF.ImportGraphic( pDownLoadData->aGrf, aEmptyStr,
*pStream, nFilter );
if( pDownLoadData )
@@ -364,14 +351,13 @@ sal_Bool SvFileObject::GetGraphic_Impl( Graphic& rGrf, SvStream* pStream )
if( !pDownLoadData->aGrf.GetContext() )
{
xMed->SetDataAvailableLink( Link() );
-// xMed->SetDoneLink( Link() );
delete pDownLoadData, pDownLoadData = 0;
bDataReady = sal_True;
bWaitForData = sal_False;
}
else if( sal_False )
{
- // Timer aufsetzen, um zurueck zukehren
+ // Set up Timer, to return back
pDownLoadData->aTimer.Start();
}
}
@@ -385,14 +371,14 @@ sal_Bool SvFileObject::GetGraphic_Impl( Graphic& rGrf, SvStream* pStream )
{
if( xMed.Is() && !pStream )
{
- DBG_WARNING3( "GrafikFehler [%d] - [%s] URL[%s]",
+ DBG_WARNING3( "Graphic error [%d] - [%s] URL[%s]",
nRes,
xMed->GetPhysicalName().GetBuffer(),
sFileNm.GetBuffer() );
}
else
{
- DBG_WARNING2( "GrafikFehler [%d] - [%s]",
+ DBG_WARNING2( "Graphic error [%d] - [%s]",
nRes, sFileNm.GetBuffer() );
}
}
@@ -418,7 +404,7 @@ String impl_getFilter( const String& _rURL )
{
css::uno::Reference< ::com::sun::star::document::XTypeDetection > xTypeDetection(
::comphelper::getProcessServiceFactory()->createInstance(
- ::rtl::OUString::createFromAscii("com.sun.star.document.TypeDetection") ),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.TypeDetection")) ),
css::uno::UNO_QUERY );
if ( xTypeDetection.is() )
{
@@ -435,7 +421,7 @@ String impl_getFilter( const String& _rURL )
{
::comphelper::SequenceAsHashMap lTypeProps( xTypeCont->getByName( sType ) );
sFilter = lTypeProps.getUnpackedValueOrDefault(
- ::rtl::OUString::createFromAscii("PreferredFilter"), ::rtl::OUString() );
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PreferredFilter")), ::rtl::OUString() );
}
}
}
@@ -459,7 +445,7 @@ void SvFileObject::Edit( Window* pParent, sfx2::SvBaseLink* pLink, const Link& r
{
case OBJECT_CLIENT_GRF:
{
- nType = FILETYPE_GRF; // falls noch nicht gesetzt
+ nType = FILETYPE_GRF; // If not set already
SvxOpenGraphicDialog aDlg(SfxResId(RID_SVXSTR_EDITGRFLINK));
aDlg.EnableLink(sal_False);
@@ -518,19 +504,18 @@ void SvFileObject::Edit( Window* pParent, sfx2::SvBaseLink* pLink, const Link& r
IMPL_STATIC_LINK( SvFileObject, LoadGrfReady_Impl, void*, EMPTYARG )
{
- // wenn wir von hier kommen, kann es kein Fehler mehr sein
+ // When we come form here there it can not be an error no more.
pThis->bLoadError = sal_False;
pThis->bWaitForData = sal_False;
pThis->bInCallDownLoad = sal_False;
if( !pThis->bInNewData && !pThis->bDataReady )
{
- // Grafik ist fertig, also DataChanged von der Status-
- // aederung schicken:
+ // Graphic is finished, also send DataChanged from Status change
pThis->bDataReady = sal_True;
pThis->SendStateChg_Impl( sfx2::LinkManager::STATE_LOAD_OK );
- // und dann nochmal die Daten senden
+ // and then send the data again
pThis->NotifyDataChanged();
}
@@ -563,7 +548,7 @@ IMPL_STATIC_LINK( SvFileObject, DelMedium_Impl, SfxMediumRef*, pDelMed )
IMPL_STATIC_LINK( SvFileObject, LoadGrfNewData_Impl, void*, EMPTYARG )
{
- // wenn wir von hier kommen, kann es kein Fehler mehr sein
+ // When we come form here there it can not be an error no more.
if( pThis->bInNewData )
return 0;
@@ -574,13 +559,11 @@ IMPL_STATIC_LINK( SvFileObject, LoadGrfNewData_Impl, void*, EMPTYARG )
{
pThis->pDownLoadData = new Impl_DownLoadData(
STATIC_LINK( pThis, SvFileObject, LoadGrfNewData_Impl ) );
-
- // Null-Link setzen, damit keine temporaeren Grafiken
- // rausgeswapt werden; der Filter prueft, ob schon
- // ein Link gesetzt ist => falls dies zutrifft, wird
- // _kein_ neuer Link gesetzt; der Link muss hier gesetzt werden,
- // (bevor das erste Mal gefiltert wird), um zu verhindern,
- // dass der Kontext zurueckgesetzt wird (aynchrones Laden)
+ // Set Zero-link, so that no temporary graphics can be swapped out,
+ // the filter checks whether a link is set already => if so, is _no_
+ // new link set, the link here must be set (before it is first
+ // filtered), to prevent, that the context will be reset
+ // (aynchronous loading)
if( !pThis->bNativFormat )
{
static GfxLink aDummyLink;
@@ -596,7 +579,7 @@ IMPL_STATIC_LINK( SvFileObject, LoadGrfNewData_Impl, void*, EMPTYARG )
if( ERRCODE_IO_PENDING == pStrm->GetError() )
pStrm->ResetError();
- // im DataChanged ein DataReady?
+ // a DataReady in DataChanged?
else if( pThis->bWaitForData && pThis->pDownLoadData )
{
pThis->bLoadError = sal_True;
@@ -605,8 +588,7 @@ IMPL_STATIC_LINK( SvFileObject, LoadGrfNewData_Impl, void*, EMPTYARG )
if( pThis->bDataReady )
{
- // Grafik ist fertig, also DataChanged von der Status-
- // aederung schicken:
+ // Graphic is finished, also send DataChanged from Status change
pThis->SendStateChg_Impl( pStrm->GetError() ? sfx2::LinkManager::STATE_LOAD_ERROR : sfx2::LinkManager::STATE_LOAD_OK );
}
@@ -640,14 +622,14 @@ IMPL_LINK( SvFileObject, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg )
return 0;
}
-/* [Beschreibung]
+/* [Description]
+
+ The method determines whether the data-object can be read from a DDE.
- Die Methode stellt fest, ob aus einem DDE-Object die Daten gelesen
- werden kann.
- Zurueckgegeben wird:
- ERRCODE_NONE wenn sie komplett gelesen wurde
- ERRCODE_SO_PENDING wenn sie noch nicht komplett gelesen wurde
- ERRCODE_SO_FALSE sonst
+ The following can be returned:
+ ERRCODE_NONE if it has been completely read
+ ERRCODE_SO_PENDING if it has not been completely read
+ ERRCODE_SO_FALSE otherwise
*/
sal_Bool SvFileObject::IsPending() const
{
@@ -680,10 +662,10 @@ sal_Bool SvFileObject::IsDataComplete() const
void SvFileObject::CancelTransfers()
{
- // und aus dem Cache austragen, wenn man mitten im Laden ist
+ // unsubscribe from the cache if in the middle of loading
if( !bDataReady )
{
- // nicht noch mal aufsetzen
+ // Do not set-up again
bLoadAgain = sal_False;
bDataReady = bLoadError = bWaitForData = sal_True;
SendStateChg_Impl( sfx2::LinkManager::STATE_LOAD_ABORT );
@@ -704,3 +686,4 @@ void SvFileObject::SendStateChg_Impl( sfx2::LinkManager::LinkState nState )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/fileobj.hxx b/sfx2/source/appl/fileobj.hxx
index 0510f38092bd..ceb0f14ea1bc 100644
--- a/sfx2/source/appl/fileobj.hxx
+++ b/sfx2/source/appl/fileobj.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -82,8 +83,7 @@ public:
virtual sal_Bool Connect( sfx2::SvBaseLink* );
virtual void Edit( Window *, sfx2::SvBaseLink *, const Link& rEndEditHdl );
- // erfrage ob das man direkt auf die Daten zugreifen kann oder ob das
- // erst angestossen werden muss
+ // Ask whether you can access data directly or whether it has to be triggered
virtual sal_Bool IsPending() const;
virtual sal_Bool IsDataComplete() const;
@@ -93,3 +93,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/fwkhelper.cxx b/sfx2/source/appl/fwkhelper.cxx
index 1909bcac2e17..60ae5499cc8e 100644
--- a/sfx2/source/appl/fwkhelper.cxx
+++ b/sfx2/source/appl/fwkhelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,7 +32,7 @@
#include <com/sun/star/frame/XFrame.hpp>
#include "sal/config.h"
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include "workwin.hxx"
@@ -39,7 +40,7 @@
void SAL_CALL RefreshToolbars( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame )
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if ( xFrame.is() )
{
SfxFrame* pFrame=0;
@@ -57,3 +58,5 @@ void SAL_CALL RefreshToolbars( ::com::sun::star::uno::Reference< ::com::sun::sta
}
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/helpdispatch.cxx b/sfx2/source/appl/helpdispatch.cxx
index 2e1128aea277..4a7a2f5c0254 100644
--- a/sfx2/source/appl/helpdispatch.cxx
+++ b/sfx2/source/appl/helpdispatch.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -121,3 +122,4 @@ void SAL_CALL HelpDispatch_Impl::removeStatusListener(
m_xRealDispatch->removeStatusListener( xControl, aURL );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/helpdispatch.hxx b/sfx2/source/appl/helpdispatch.hxx
index b9d1e7b17b63..f99c054a3063 100644
--- a/sfx2/source/appl/helpdispatch.hxx
+++ b/sfx2/source/appl/helpdispatch.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,3 +53,4 @@ public:
#endif // #ifndef SFX_HELPDISPATCHER_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/helpinterceptor.cxx b/sfx2/source/appl/helpinterceptor.cxx
index 4f24ecb21355..26f0117aa566 100644
--- a/sfx2/source/appl/helpinterceptor.cxx
+++ b/sfx2/source/appl/helpinterceptor.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -62,9 +63,12 @@ HelpInterceptor_Impl::HelpInterceptor_Impl() :
HelpInterceptor_Impl::~HelpInterceptor_Impl()
{
- for ( sal_uInt16 i = 0; m_pHistory && i < m_pHistory->Count(); ++i )
- delete m_pHistory->GetObject(i);
- delete m_pHistory;
+ if ( m_pHistory )
+ {
+ for ( size_t i = 0, n = m_pHistory->size(); i < n; ++i )
+ delete m_pHistory->at( i );
+ delete m_pHistory;
+ }
}
// -----------------------------------------------------------------------
@@ -73,26 +77,32 @@ void HelpInterceptor_Impl::addURL( const String& rURL )
{
if ( !m_pHistory )
m_pHistory = new HelpHistoryList_Impl;
- sal_uIntPtr nCount = m_pHistory->Count();
+
+ size_t nCount = m_pHistory->size();
if ( nCount && m_nCurPos < ( nCount - 1 ) )
{
- for ( sal_uIntPtr i = nCount - 1; i > m_nCurPos; i-- )
- delete m_pHistory->Remove(i);
+ for ( size_t i = nCount - 1; i > m_nCurPos; i-- )
+ {
+ delete m_pHistory->at( i );
+ HelpHistoryList_Impl::iterator it = m_pHistory->begin();
+ ::std::advance( it, i );
+ m_pHistory->erase( it );
+ }
}
Reference<XFrame> xFrame(m_xIntercepted, UNO_QUERY);
Reference<XController> xController;
if(xFrame.is())
xController = xFrame->getController();
Any aViewData;
- if(xController.is() && m_pHistory->Count())
+ if(xController.is() && !m_pHistory->empty())
{
- m_pHistory->GetObject(m_nCurPos)->aViewData = xController->getViewData();
+ m_pHistory->at( m_nCurPos )->aViewData = xController->getViewData();
}
m_aCurrentURL = rURL;
Any aEmptyViewData;
- m_pHistory->Insert( new HelpHistoryEntry_Impl( rURL, aEmptyViewData ), LIST_APPEND );
- m_nCurPos = m_pHistory->Count() - 1;
+ m_pHistory->push_back( new HelpHistoryEntry_Impl( rURL, aEmptyViewData ) );
+ m_nCurPos = m_pHistory->size() - 1;
// TODO ?
if ( m_xListener.is() )
{
@@ -126,8 +136,8 @@ void HelpInterceptor_Impl::SetStartURL( const String& rURL )
{
m_pHistory = new HelpHistoryList_Impl;
Any aEmptyViewData;
- m_pHistory->Insert( new HelpHistoryEntry_Impl( rURL, aEmptyViewData ), ((sal_uIntPtr)0x0) );
- m_nCurPos = m_pHistory->Count() - 1;
+ m_pHistory->insert( m_pHistory->begin(), new HelpHistoryEntry_Impl( rURL, aEmptyViewData));
+ m_nCurPos = m_pHistory->size() - 1;
m_pWindow->UpdateToolbox();
}
@@ -141,7 +151,7 @@ sal_Bool HelpInterceptor_Impl::HasHistoryPred() const
sal_Bool HelpInterceptor_Impl::HasHistorySucc() const
{
- return m_pHistory && ( m_nCurPos < ( m_pHistory->Count() - 1 ) );
+ return m_pHistory && ( m_nCurPos < ( m_pHistory->size() - 1 ) );
}
@@ -159,9 +169,7 @@ Reference< XDispatch > SAL_CALL HelpInterceptor_Impl::queryDispatch(
if ( m_xSlaveDispatcher.is() )
xResult = m_xSlaveDispatcher->queryDispatch( aURL, aTargetFrameName, nSearchFlags );
- // INetURLObject aObj( aURL.Complete );
- // sal_Bool bHelpURL = ( aObj.GetProtocol() == INET_PROT_VND_SUN_STAR_HELP );
- sal_Bool bHelpURL = aURL.Complete.toAsciiLowerCase().match(rtl::OUString::createFromAscii("vnd.sun.star.help"),0);
+ sal_Bool bHelpURL = aURL.Complete.toAsciiLowerCase().match(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.help")),0);
if ( bHelpURL )
{
@@ -257,7 +265,7 @@ void SAL_CALL HelpInterceptor_Impl::dispatch(
{
if ( m_pHistory )
{
- if(m_pHistory->Count() > m_nCurPos)
+ if(m_pHistory->size() > m_nCurPos)
{
Reference<XFrame> xFrame(m_xIntercepted, UNO_QUERY);
Reference<XController> xController;
@@ -265,18 +273,18 @@ void SAL_CALL HelpInterceptor_Impl::dispatch(
xController = xFrame->getController();
if(xController.is())
{
- m_pHistory->GetObject(m_nCurPos)->aViewData = xController->getViewData();
+ m_pHistory->at( m_nCurPos )->aViewData = xController->getViewData();
}
}
sal_uIntPtr nPos = ( bBack && m_nCurPos > 0 ) ? --m_nCurPos
- : ( !bBack && m_nCurPos < m_pHistory->Count() - 1 )
+ : ( !bBack && m_nCurPos < m_pHistory->size() - 1 )
? ++m_nCurPos
: ULONG_MAX;
if ( nPos < ULONG_MAX )
{
- HelpHistoryEntry_Impl* pEntry = m_pHistory->GetObject( nPos );
+ HelpHistoryEntry_Impl* pEntry = m_pHistory->at( nPos );
if ( pEntry )
m_pWindow->loadHelpContent(pEntry->aURL, sal_False); // false => dont add item to history again!
}
@@ -333,35 +341,29 @@ void SAL_CALL HelpListener_Impl::disposing( const ::com::sun::star::lang::EventO
pInterceptor->removeStatusListener( this, ::com::sun::star::util::URL() );
pInterceptor = NULL;
}
-/*-- 05.09.2002 12:17:59---------------------------------------------------
- -----------------------------------------------------------------------*/
HelpStatusListener_Impl::HelpStatusListener_Impl(
Reference < XDispatch > aDispatch, URL& rURL)
{
aDispatch->addStatusListener(this, rURL);
}
-/*-- 05.09.2002 12:17:59---------------------------------------------------
- -----------------------------------------------------------------------*/
HelpStatusListener_Impl::~HelpStatusListener_Impl()
{
if(xDispatch.is())
xDispatch->removeStatusListener(this, com::sun::star::util::URL());
}
-/*-- 05.09.2002 12:17:59---------------------------------------------------
- -----------------------------------------------------------------------*/
void HelpStatusListener_Impl::statusChanged(
const FeatureStateEvent& rEvent ) throw( RuntimeException )
{
aStateEvent = rEvent;
}
-/*-- 05.09.2002 12:18:00---------------------------------------------------
- -----------------------------------------------------------------------*/
void HelpStatusListener_Impl::disposing( const EventObject& ) throw( RuntimeException )
{
xDispatch->removeStatusListener(this, com::sun::star::util::URL());
xDispatch = 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/helpinterceptor.hxx b/sfx2/source/appl/helpinterceptor.hxx
index 5a6f0d024c20..e912fcdf2364 100644
--- a/sfx2/source/appl/helpinterceptor.hxx
+++ b/sfx2/source/appl/helpinterceptor.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,9 +28,7 @@
#ifndef INCLUDED_SFX_HELPINTERCEPTOR_HXX
#define INCLUDED_SFX_HELPINTERCEPTOR_HXX
-#ifndef _CPPUHELPER_IMPLBASE2_HXX_
#include <cppuhelper/implbase3.hxx>
-#endif
#include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
#include <com/sun/star/frame/XInterceptorInfo.hpp>
#include <com/sun/star/frame/XDispatch.hpp>
@@ -38,8 +37,8 @@
#include <cppuhelper/implbase1.hxx>
#include <com/sun/star/frame/XStatusListener.hpp>
#include <tools/string.hxx>
-#include <tools/list.hxx>
#include <tools/link.hxx>
+#include <vector>
struct HelpHistoryEntry_Impl
{
@@ -50,7 +49,7 @@ struct HelpHistoryEntry_Impl
aURL( rURL ), aViewData(rViewData) {}
};
-DECLARE_LIST(HelpHistoryList_Impl,HelpHistoryEntry_Impl*)
+typedef ::std::vector< HelpHistoryEntry_Impl* > HelpHistoryList_Impl;
class SfxHelpWindow_Impl;
class HelpInterceptor_Impl : public ::cppu::WeakImplHelper3<
@@ -171,3 +170,4 @@ public:
#endif // #ifndef INCLUDED_SFX_HELPINTERCEPTOR_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/imagemgr.cxx b/sfx2/source/appl/imagemgr.cxx
index af8086f4e046..d4c410a2a7ac 100644
--- a/sfx2/source/appl/imagemgr.cxx
+++ b/sfx2/source/appl/imagemgr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,7 +53,7 @@
#include <sfx2/objsh.hxx>
#include <sfx2/docfac.hxx>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::frame;
@@ -61,17 +62,17 @@ using namespace ::com::sun::star::util;
using namespace ::com::sun::star::ui;
using namespace ::com::sun::star::frame;
-typedef std::hash_map< ::rtl::OUString,
+typedef boost::unordered_map< ::rtl::OUString,
WeakReference< XImageManager >,
::rtl::OUStringHash,
::std::equal_to< ::rtl::OUString > > ModuleIdToImagegMgr;
-static WeakReference< XModuleManager > m_xModuleManager;
-static WeakReference< XModuleUIConfigurationManagerSupplier > m_xModuleCfgMgrSupplier;
-static WeakReference< XURLTransformer > m_xURLTransformer;
-static ModuleIdToImagegMgr m_aModuleIdToImageMgrMap;
-Image SAL_CALL GetImage( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& aURL, sal_Bool bBig, sal_Bool bHiContrast )
+Image SAL_CALL GetImage(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
+ const ::rtl::OUString& aURL,
+ bool bBig
+)
{
// TODO/LATeR: shouldn't this become a method at SfxViewFrame?! That would save the UnoTunnel
if ( !rFrame.is() )
@@ -90,22 +91,6 @@ Image SAL_CALL GetImage( const ::com::sun::star::uno::Reference< ::com::sun::sta
rtl::OUString aCommandURL( aURL );
if ( nProtocol == INET_PROT_SLOT )
{
- /*
- // Support old way to retrieve image via slot URL
- Reference< XURLTransformer > xURLTransformer = m_xURLTransformer;
- if ( !xURLTransformer.is() )
- {
- xURLTransformer = Reference< XURLTransformer >(
- ::comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )),
- UNO_QUERY );
- m_xURLTransformer = xURLTransformer;
- }
-
- URL aTargetURL;
- aTargetURL.Complete = aURL;
- xURLTransformer->parseStrict( aTargetURL );
- sal_uInt16 nId = ( sal_uInt16 ) aTargetURL.Path.toInt32();*/
sal_uInt16 nId = ( sal_uInt16 ) String(aURL).Copy(5).ToInt32();
const SfxSlot* pSlot = 0;
if ( xModel.is() )
@@ -147,8 +132,6 @@ Image SAL_CALL GetImage( const ::com::sun::star::uno::Reference< ::com::sun::sta
::com::sun::star::ui::ImageType::SIZE_DEFAULT );
if ( bBig )
nImageType |= ::com::sun::star::ui::ImageType::SIZE_LARGE;
- if ( bHiContrast )
- nImageType |= ::com::sun::star::ui::ImageType::COLOR_HIGHCONTRAST;
if ( xDocImgMgr.is() )
{
@@ -170,6 +153,8 @@ Image SAL_CALL GetImage( const ::com::sun::star::uno::Reference< ::com::sun::sta
}
}
+ static WeakReference< XModuleManager > m_xModuleManager;
+
Reference< XModuleManager > xModuleManager = m_xModuleManager;
if ( !xModuleManager.is() )
@@ -188,11 +173,16 @@ Image SAL_CALL GetImage( const ::com::sun::star::uno::Reference< ::com::sun::sta
{
Reference< XImageManager > xModuleImageManager;
rtl::OUString aModuleId = xModuleManager->identify( rFrame );
+
+ static ModuleIdToImagegMgr m_aModuleIdToImageMgrMap;
+
ModuleIdToImagegMgr::iterator pIter = m_aModuleIdToImageMgrMap.find( aModuleId );
if ( pIter != m_aModuleIdToImageMgrMap.end() )
xModuleImageManager = pIter->second;
else
{
+ static WeakReference< XModuleUIConfigurationManagerSupplier > m_xModuleCfgMgrSupplier;
+
Reference< XModuleUIConfigurationManagerSupplier > xModuleCfgMgrSupplier = m_xModuleCfgMgrSupplier;
if ( !xModuleCfgMgrSupplier.is() )
@@ -223,7 +213,7 @@ Image SAL_CALL GetImage( const ::com::sun::star::uno::Reference< ::com::sun::sta
if ( !!aImage )
return aImage;
else if ( nProtocol != INET_PROT_UNO && nProtocol != INET_PROT_SLOT )
- return SvFileInformationManager::GetImageNoDefault( aObj, bBig, bHiContrast );
+ return SvFileInformationManager::GetImageNoDefault( aObj, bBig );
}
}
catch ( Exception& )
@@ -232,3 +222,5 @@ Image SAL_CALL GetImage( const ::com::sun::star::uno::Reference< ::com::sun::sta
return Image();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/imestatuswindow.cxx b/sfx2/source/appl/imestatuswindow.cxx
index 07eb47bd92ad..ca1f2c3592cb 100644
--- a/sfx2/source/appl/imestatuswindow.cxx
+++ b/sfx2/source/appl/imestatuswindow.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50,7 +51,45 @@
#include "rtl/ustring.hxx"
#include "sal/types.h"
#include "vcl/svapp.hxx"
-#include "vos/mutex.hxx"
+#include "osl/mutex.hxx"
+
+//TO-Do, merge into framework/inc/helpers/mischelpers.hxx and deliver
+class WeakPropertyChangeListener : public ::cppu::WeakImplHelper1<com::sun::star::beans::XPropertyChangeListener>
+{
+ private:
+ com::sun::star::uno::WeakReference<com::sun::star::beans::XPropertyChangeListener> mxOwner;
+
+ public:
+ WeakPropertyChangeListener(com::sun::star::uno::Reference<com::sun::star::beans::XPropertyChangeListener> xOwner)
+ : mxOwner(xOwner)
+ {
+ }
+
+ virtual ~WeakPropertyChangeListener()
+ {
+ }
+
+ virtual void SAL_CALL propertyChange(const com::sun::star::beans::PropertyChangeEvent &rEvent )
+ throw(com::sun::star::uno::RuntimeException)
+ {
+ com::sun::star::uno::Reference<com::sun::star::beans::XPropertyChangeListener> xOwner(mxOwner.get(),
+ com::sun::star::uno::UNO_QUERY);
+ if (xOwner.is())
+ xOwner->propertyChange(rEvent);
+
+ }
+
+ // lang.XEventListener
+ virtual void SAL_CALL disposing(const com::sun::star::lang::EventObject& rEvent)
+ throw(com::sun::star::uno::RuntimeException)
+ {
+ com::sun::star::uno::Reference<com::sun::star::beans::XPropertyChangeListener> xOwner(mxOwner.get(),
+ com::sun::star::uno::UNO_QUERY);
+ if (xOwner.is())
+ xOwner->disposing(rEvent);
+
+ }
+};
namespace css = com::sun::star;
@@ -77,7 +116,7 @@ void ImeStatusWindow::init()
}
catch (css::uno::Exception &)
{
- OSL_ENSURE(false, "com.sun.star.uno.Exception");
+ OSL_FAIL("com.sun.star.uno.Exception");
// Degrade gracefully and use the VCL-supplied default if no
// configuration is available.
}
@@ -95,7 +134,7 @@ bool ImeStatusWindow::isShowing()
}
catch (css::uno::Exception &)
{
- OSL_ENSURE(false, "com.sun.star.uno.Exception");
+ OSL_FAIL("com.sun.star.uno.Exception");
// Degrade gracefully and use the VCL-supplied default if no
// configuration is available.
}
@@ -121,7 +160,7 @@ void ImeStatusWindow::show(bool bShow)
}
catch (css::uno::Exception &)
{
- OSL_ENSURE(false, "com.sun.star.uno.Exception");
+ OSL_FAIL("com.sun.star.uno.Exception");
}
}
@@ -132,17 +171,17 @@ bool ImeStatusWindow::canToggle() const
ImeStatusWindow::~ImeStatusWindow()
{
- if (m_xConfig.is())
+ if (m_xConfig.is() && m_xConfigListener.is())
// We should never get here, but just in case...
try
{
m_xConfig->removePropertyChangeListener(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ShowStatusWindow")),
- this);
+ m_xConfigListener);
}
catch (css::uno::Exception &)
{
- OSL_ENSURE(false, "com.sun.star.uno.RuntimeException");
+ OSL_FAIL("com.sun.star.uno.RuntimeException");
}
}
@@ -158,7 +197,7 @@ void SAL_CALL
ImeStatusWindow::propertyChange(css::beans::PropertyChangeEvent const & )
throw (css::uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SfxApplication* pApp = SfxApplication::Get();
if (pApp)
pApp->Invalidate(SID_SHOW_IME_STATUS_WINDOW);
@@ -220,12 +259,16 @@ css::uno::Reference< css::beans::XPropertySet > ImeStatusWindow::getConfig()
xConfig = m_xConfig;
}
if (bAdd)
+ {
// Exceptions here could be handled individually, to support graceful
// degradation (no update notification mechanism in this case---but also
// no dispose notifications):
+ m_xConfigListener = new WeakPropertyChangeListener(this);
xConfig->addPropertyChangeListener(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ShowStatusWindow")),
- this);
+ m_xConfigListener);
+ }
return xConfig;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/imestatuswindow.hxx b/sfx2/source/appl/imestatuswindow.hxx
index 4edba523ed30..a0a350ce6809 100644
--- a/sfx2/source/appl/imestatuswindow.hxx
+++ b/sfx2/source/appl/imestatuswindow.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -117,9 +118,13 @@ private:
osl::Mutex m_aMutex;
com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >
m_xConfig;
+ com::sun::star::uno::Reference< com::sun::star::beans::XPropertyChangeListener >
+ m_xConfigListener;
bool m_bDisposed;
};
} }
#endif // INCLUDED_SFX2_APPL_IMESTATUSWINDOW_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/impldde.cxx b/sfx2/source/appl/impldde.cxx
index df8ae4b8b425..2d423978619c 100644
--- a/sfx2/source/appl/impldde.cxx
+++ b/sfx2/source/appl/impldde.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,8 @@
#include "precompiled_sfx2.hxx"
#if defined(WNT)
-#include <tools/svwin.h>
+#include <prewin.h>
+#include <postwin.h>
#endif
#include "impldde.hxx"
@@ -127,9 +129,6 @@ IMPL_STATIC_LINK( SvDDELinkEditDialog, EditHdl_Impl, Edit *, pEdit )
return 0;
}
-/* */
-
-
SvDDEObject::SvDDEObject()
: pConnection( 0 ), pLink( 0 ), pRequest( 0 ), pGetData( 0 ), nError( 0 )
{
@@ -151,7 +150,7 @@ sal_Bool SvDDEObject::GetData( ::com::sun::star::uno::Any & rData /*out param*/,
if( !pConnection )
return sal_False;
- if( pConnection->GetError() ) // dann versuchen wir es nochmal
+ if( pConnection->GetError() ) // then we try once more
{
String sServer( pConnection->GetServiceName() );
String sTopic( pConnection->GetTopicName() );
@@ -162,13 +161,13 @@ sal_Bool SvDDEObject::GetData( ::com::sun::star::uno::Any & rData /*out param*/,
nError = DDELINK_ERROR_APP;
}
- if( bWaitForData ) // wir sind rekursiv drin, wieder raus
+ if( bWaitForData ) // we are in an rekursive loop, get out again
return sal_False;
- // Verriegeln gegen Reentrance
+ // Lock against Reentrance
bWaitForData = sal_True;
- // falls gedruckt werden soll, warten wir bis die Daten vorhanden sind
+ // if you want to print, we'll wait until the data is available
if( bSynchron )
{
DdeRequest aReq( *pConnection, sItem, 5000 );
@@ -188,8 +187,7 @@ sal_Bool SvDDEObject::GetData( ::com::sun::star::uno::Any & rData /*out param*/,
}
else
{
- // ansonsten wird es asynchron ausgefuehrt
-// if( !pLink || !pLink->IsBusy() )
+ // otherwise it will be executed asynchronously
{
if( pRequest )
delete pRequest;
@@ -215,9 +213,9 @@ sal_Bool SvDDEObject::Connect( SvBaseLink * pSvLink )
static sal_Bool bInWinExec = sal_False;
#endif
sal_uInt16 nLinkType = pSvLink->GetUpdateMode();
- if( pConnection ) // Verbindung steht ja schon
+ if( pConnection ) // Connection is already made
{
- // tja, dann nur noch als Abhaengig eintragen
+ // well, then just add it as dependent
AddDataAdvise( pSvLink,
SotExchange::GetFormatMimeType( pSvLink->GetContentType()),
LINKUPDATE_ONCALL == nLinkType
@@ -240,8 +238,8 @@ sal_Bool SvDDEObject::Connect( SvBaseLink * pSvLink )
pConnection = new DdeConnection( sServer, sTopic );
if( pConnection->GetError() )
{
- // kann man denn das System-Topic ansprechen ?
- // dann ist der Server oben, kennt nur nicht das Topic!
+ // Is it possible to address the system-Topic?
+ // then the server is up, it just does not know the topic!
if( sTopic.EqualsIgnoreCaseAscii( "SYSTEM" ) )
{
sal_Bool bSysTopic;
@@ -255,12 +253,12 @@ sal_Bool SvDDEObject::Connect( SvBaseLink * pSvLink )
nError = DDELINK_ERROR_DATA;
return sal_False;
}
- // ansonsten unter Win/WinNT die Applikation direkt starten
+ // otherwise in Win/WinNT, start the Application directly
}
#if defined(WNT)
- // Server nicht da, starten und nochmal versuchen
+ // Server not up, try once more to start it.
if( !bInWinExec )
{
ByteString aCmdLine( sServer, RTL_TEXTENCODING_ASCII_US );
@@ -299,7 +297,7 @@ sal_Bool SvDDEObject::Connect( SvBaseLink * pSvLink )
if( LINKUPDATE_ALWAYS == nLinkType && !pLink && !pConnection->GetError() )
{
- // Hot Link einrichten, Daten kommen irgendwann spaeter
+ // Setting up Hot Link, Data will be available at some point later on
pLink = new DdeHotLink( *pConnection, sItem );
pLink->SetDataHdl( LINK( this, SvDDEObject, ImplGetDDEData ) );
pLink->SetDoneHdl( LINK( this, SvDDEObject, ImplDoneDDEData ) );
@@ -352,22 +350,22 @@ sal_Bool SvDDEObject::ImplHasOtherFormat( DdeTransaction& rReq )
nFmt = FORMAT_GDIMETAFILE;
break;
- // sonst noch irgendwas ??
+ // something else?
}
if( nFmt )
- rReq.SetFormat( nFmt ); // damit nochmal versuchen
+ rReq.SetFormat( nFmt ); // try it once more
return 0 != nFmt;
}
sal_Bool SvDDEObject::IsPending() const
-/* [Beschreibung]
-
- Die Methode stellt fest, ob aus einem DDE-Object die Daten gelesen
- werden kann.
- Zurueckgegeben wird:
- ERRCODE_NONE wenn sie komplett gelesen wurde
- ERRCODE_SO_PENDING wenn sie noch nicht komplett gelesen wurde
- ERRCODE_SO_FALSE sonst
+/* [Description]
+
+ The method determines whether the data-object can be read from a DDE.
+
+ Returned is the following:
+ ERRCODE_NONE if it has been completely read
+ ERRCODE_SO_PENDING if it has not been completely read
+ ERRCODE_SO_FALSE otherwise
*/
{
return bWaitForData;
@@ -397,8 +395,8 @@ IMPL_LINK( SvDDEObject, ImplGetDDEData, DdeData*, pData )
Sequence< sal_Int8 > aSeq( (const sal_Int8*)p, nLen );
if( pGetData )
{
- *pGetData <<= aSeq; // Daten kopieren
- pGetData = 0; // und den Pointer bei mir zuruecksetzen
+ *pGetData <<= aSeq; // Copy Data
+ pGetData = 0; // reset the pointer here
}
else
{
@@ -421,9 +419,9 @@ IMPL_LINK( SvDDEObject, ImplDoneDDEData, void*, pData )
{
DdeTransaction* pReq = 0;
if( !pLink || ( pLink && pLink->IsBusy() ))
- pReq = pRequest; // dann kann nur der fertig sein
+ pReq = pRequest; // only the one that is ready
else if( pRequest && pRequest->IsBusy() )
- pReq = pLink; // dann kann nur der fertig sein
+ pReq = pLink; // only the one that is ready
if( pReq )
{
@@ -433,16 +431,17 @@ IMPL_LINK( SvDDEObject, ImplDoneDDEData, void*, pData )
}
else if( pReq == pRequest )
{
- // das wars dann
bWaitForData = sal_False;
}
}
}
else
- // das warten ist beendet
+ // End waiting
bWaitForData = sal_False;
return 0;
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/impldde.hxx b/sfx2/source/appl/impldde.hxx
index 4494cb9c20fa..3a2a84c2b685 100644
--- a/sfx2/source/appl/impldde.hxx
+++ b/sfx2/source/appl/impldde.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,8 +49,8 @@ class SvDDEObject : public SvLinkSource
DdeRequest* pRequest;
::com::sun::star::uno::Any * pGetData;
- sal_uInt8 bWaitForData : 1; // wird auf Daten gewartet?
- sal_uInt8 nError : 7; // Error Code fuer den Dialog
+ sal_uInt8 bWaitForData : 1; // waiting for data?
+ sal_uInt8 nError : 7; // Error code for dialogue
sal_Bool ImplHasOtherFormat( DdeTransaction& );
@@ -76,3 +77,5 @@ public:
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx
index e689b3f22282..9829c3bed5ce 100644
--- a/sfx2/source/appl/linkmgr2.cxx
+++ b/sfx2/source/appl/linkmgr2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55,6 +56,16 @@
#define _SVSTDARR_STRINGSDTOR
#include <svl/svstdarr.hxx>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/util/XCloseable.hpp>
+
+using ::com::sun::star::uno::UNO_QUERY;
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::lang::XComponent;
+using ::com::sun::star::util::XCloseable;
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
namespace sfx2
{
@@ -89,16 +100,30 @@ LinkManager::~LinkManager()
}
}
+void LinkManager::InsertCachedComp(const Reference<XComponent>& xComp)
+{
+ maCachedComps.push_back(xComp);
+}
-/************************************************************************
-|* LinkManager::Remove()
-|*
-|* Beschreibung
-*************************************************************************/
+void LinkManager::CloseCachedComps()
+{
+ CompVector::iterator itr = maCachedComps.begin(), itrEnd = maCachedComps.end();
+ for (; itr != itrEnd; ++itr)
+ {
+ Reference<XCloseable> xCloseable(*itr, UNO_QUERY);
+ if (!xCloseable.is())
+ continue;
+
+ xCloseable->close(true);
+ }
+ maCachedComps.clear();
+}
+
+//--------------------------------------------------------------------------
void LinkManager::Remove( SvBaseLink *pLink )
{
- // keine Links doppelt einfuegen
+ // No duplicate links inserted
int bFound = sal_False;
SvBaseLinkRef** ppRef = (SvBaseLinkRef**)aLinkTbl.GetData();
for( sal_uInt16 n = aLinkTbl.Count(); n; --n, ++ppRef )
@@ -111,7 +136,7 @@ void LinkManager::Remove( SvBaseLink *pLink )
bFound = sal_True;
}
- // falls noch leere rum stehen sollten, weg damit
+ // Remove emty ones if they exist
if( !(*ppRef)->Is() )
{
delete *ppRef;
@@ -148,7 +173,7 @@ void LinkManager::Remove( sal_uInt16 nPos, sal_uInt16 nCnt )
sal_Bool LinkManager::Insert( SvBaseLink* pLink )
{
- // keine Links doppelt einfuegen
+ // No duplicate links inserted
for( sal_uInt16 n = 0; n < aLinkTbl.Count(); ++n )
{
SvBaseLinkRef* pTmp = aLinkTbl[ n ];
@@ -171,7 +196,7 @@ sal_Bool LinkManager::InsertLink( SvBaseLink * pLink,
sal_uInt16 nUpdateMode,
const String* pName )
{
- // unbedingt zuerst
+ // This First
pLink->SetObjType( nObjType );
if( pName )
pLink->SetName( *pName );
@@ -210,7 +235,7 @@ sal_Bool LinkManager::InsertDDELink( SvBaseLink * pLink )
}
-// erfrage die Strings fuer den Dialog
+// Obtain the string for the dialog
sal_Bool LinkManager::GetDisplayNames( const SvBaseLink * pLink,
String* pType,
String* pFile,
@@ -283,8 +308,8 @@ void LinkManager::UpdateAllLinks(
SvStringsDtor aApps, aTopics, aItems;
String sApp, sTopic, sItem;
- // erstmal eine Kopie vom Array machen, damit sich updatende Links in
- // Links in ... nicht dazwischen funken!!
+ // First make a copy of the array in order to update links
+ // links in ... no contact between them!
SvPtrarr aTmpArr( 255, 50 );
sal_uInt16 n;
for( n = 0; n < aLinkTbl.Count(); ++n )
@@ -302,7 +327,7 @@ void LinkManager::UpdateAllLinks(
{
SvBaseLink* pLink = (SvBaseLink*)aTmpArr[ n ];
- // suche erstmal im Array nach dem Eintrag
+ // search first in the array after the entry
sal_uInt16 nFndPos = USHRT_MAX;
for( sal_uInt16 i = 0; i < aLinkTbl.Count(); ++i )
if( pLink == *aLinkTbl[ i ] )
@@ -312,9 +337,9 @@ void LinkManager::UpdateAllLinks(
}
if( USHRT_MAX == nFndPos )
- continue; // war noch nicht vorhanden!
+ continue; // was not available!
- // Graphic-Links noch nicht updaten
+ // Graphic-Links not to update yet
if( !pLink->IsVisible() ||
( !bUpdateGrfLinks && OBJECT_CLIENT_GRF == pLink->GetObjType() ))
continue;
@@ -323,19 +348,16 @@ void LinkManager::UpdateAllLinks(
{
int nRet = QueryBox( pParentWin, WB_YES_NO | WB_DEF_YES, SfxResId( STR_QUERY_UPDATE_LINKS ) ).Execute();
if( RET_YES != nRet )
- return ; // es soll nichts geupdatet werden
- bAskUpdate = sal_False; // einmal reicht
+ return ; // nothing should be updated
+ bAskUpdate = sal_False; // once is enough
}
pLink->Update();
}
+ CloseCachedComps();
}
-/************************************************************************
-|* SvBaseLink::CreateObject()
-|*
-|* Beschreibung
-*************************************************************************/
+//--------------------------------------------------------------------------
SvLinkSourceRef LinkManager::CreateObj( SvBaseLink * pLink )
{
@@ -356,7 +378,7 @@ SvLinkSourceRef LinkManager::CreateObj( SvBaseLink * pLink )
sal_Bool LinkManager::InsertServer( SvLinkSource* pObj )
{
- // keine doppelt einfuegen
+ // no duplicate inserts
if( !pObj || USHRT_MAX != aServerTbl.GetPos( pObj ) )
return sal_False;
@@ -387,6 +409,56 @@ void MakeLnkName( String& rName, const String* pType, const String& rFile,
((rName += cTokenSeperator ) += *pFilter).EraseLeadingChars().EraseTrailingChars();
}
+void LinkManager::ReconnectDdeLink(SfxObjectShell& rServer)
+{
+ SfxMedium* pMed = rServer.GetMedium();
+ if (!pMed)
+ return;
+
+ const ::sfx2::SvBaseLinks& rLinks = GetLinks();
+ sal_uInt16 n = rLinks.Count();
+
+ for (sal_uInt16 i = 0; i < n; ++i)
+ {
+ ::sfx2::SvBaseLink* p = *rLinks[i];
+ String aType, aFile, aLink, aFilter;
+ if (!GetDisplayNames(p, &aType, &aFile, &aLink, &aFilter))
+ continue;
+
+ if (!aType.EqualsAscii("soffice"))
+ // DDE connections between OOo apps are always named 'soffice'.
+ continue;
+
+ String aTmp;
+ OUString aURL = aFile;
+ if (utl::LocalFileHelper::ConvertPhysicalNameToURL(aFile, aTmp))
+ aURL = aTmp;
+
+ if (!aURL.equalsIgnoreAsciiCase(pMed->GetName()))
+ // This DDE link is not associated with this server shell... Skip it.
+ continue;
+
+ if (!aLink.Len())
+ continue;
+
+ LinkServerShell(aLink, rServer, *p);
+ }
+}
+
+void LinkManager::LinkServerShell(const OUString& rPath, SfxObjectShell& rServer, ::sfx2::SvBaseLink& rLink) const
+{
+ ::sfx2::SvLinkSource* pSrvSrc = rServer.DdeCreateLinkSource(rPath);
+ if (pSrvSrc)
+ {
+ ::com::sun::star::datatransfer::DataFlavor aFl;
+ SotExchange::GetFormatDataFlavor(rLink.GetContentType(), aFl);
+ rLink.SetObj(pSrvSrc);
+ pSrvSrc->AddDataAdvise(
+ &rLink, aFl.MimeType,
+ sfx2::LINKUPDATE_ONCALL == rLink.GetUpdateMode() ? ADVISEMODE_ONLYONCE : 0);
+ }
+}
+
sal_Bool LinkManager::InsertFileLink( sfx2::SvBaseLink& rLink,
sal_uInt16 nFileType,
const String& rFileNm,
@@ -413,8 +485,8 @@ sal_Bool LinkManager::InsertFileLink( sfx2::SvBaseLink& rLink )
return sal_False;
}
-// eine Uebertragung wird abgebrochen, also alle DownloadMedien canceln
-// (ist zur Zeit nur fuer die FileLinks interressant!)
+// A transfer is aborted, so cancel all download media
+// (for now this is only of interest for the file links!)
void LinkManager::CancelTransfers()
{
SvFileObject* pFileObj;
@@ -425,27 +497,22 @@ void LinkManager::CancelTransfers()
if( 0 != ( pLnk = &(*rLnks[ --n ])) &&
OBJECT_CLIENT_FILE == (OBJECT_CLIENT_FILE & pLnk->GetObjType()) &&
0 != ( pFileObj = (SvFileObject*)pLnk->GetObj() ) )
-// 0 != ( pFileObj = (SvFileObject*)SvFileObject::ClassFactory()->
-// CastAndAddRef( pLnk->GetObj() )) )
pFileObj->CancelTransfers();
}
-
- // um Status Informationen aus dem FileObject an den BaseLink zu
- // senden, gibt es eine eigene ClipBoardId. Das SvData-Object hat
- // dann die entsprechenden Informationen als String.
- // Wird zur Zeit fuer FileObject in Verbindung mit JavaScript benoetigt
- // - das braucht Informationen ueber Load/Abort/Error
+ // For the purpose of sending Status information from the file object to
+ // the base link, there exist a dedicated ClipBoardId. The SvData-object
+ // gets the appropriate information as a string
+ // For now this is required for file object in conjunction with JavaScript
+ // - needs information about Load/Abort/Error
sal_uIntPtr LinkManager::RegisterStatusInfoId()
{
static sal_uIntPtr nFormat = 0;
if( !nFormat )
{
-// wie sieht die neue Schnittstelle aus?
-// nFormat = Exchange::RegisterFormatName( "StatusInfo vom SvxInternalLink" );
nFormat = SotExchange::RegisterFormatName(
String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM(
- "StatusInfo vom SvxInternalLink" )));
+ "StatusInfo from SvxInternalLink" )));
}
return nFormat;
}
@@ -511,13 +578,11 @@ sal_Bool SvxInternalLink::Connect( sfx2::SvBaseLink* pLink )
SfxObjectShell* pFndShell = 0;
sal_uInt16 nUpdateMode = com::sun::star::document::UpdateDocMode::NO_UPDATE;
String sTopic, sItem, sReferer;
- if( pLink->GetLinkManager() &&
- pLink->GetLinkManager()->GetDisplayNames( pLink, 0, &sTopic, &sItem )
- && sTopic.Len() )
+ LinkManager* pLinkMgr = pLink->GetLinkManager();
+ if (pLinkMgr && pLinkMgr->GetDisplayNames(pLink, 0, &sTopic, &sItem) && sTopic.Len())
{
- // erstmal nur ueber die DocumentShells laufen und die mit dem
- // Namen heraussuchen:
-
+ // first only loop over the DocumentShells the shells and find those
+ // with the name:
com::sun::star::lang::Locale aLocale;
MsLangId::convertLanguageToLocale( LANGUAGE_SYSTEM, aLocale );
CharClass aCC( aLocale );
@@ -528,7 +593,7 @@ sal_Bool SvxInternalLink::Connect( sfx2::SvBaseLink* pLink )
TypeId aType( TYPE(SfxObjectShell) );
sal_Bool bFirst = sal_True;
- SfxObjectShell* pShell = pLink->GetLinkManager()->GetPersist();
+ SfxObjectShell* pShell = pLinkMgr->GetPersist();
if( pShell && pShell->GetMedium() )
{
sReferer = pShell->GetMedium()->GetBaseURL();
@@ -556,7 +621,7 @@ sal_Bool SvxInternalLink::Connect( sfx2::SvBaseLink* pLink )
aCC.toLower( sTmp );
- if( sTmp == sNmURL ) // die wollen wir haben
+ if( sTmp == sNmURL ) // we want these
{
pFndShell = pShell;
break;
@@ -578,9 +643,25 @@ sal_Bool SvxInternalLink::Connect( sfx2::SvBaseLink* pLink )
if( !sTopic.Len() )
return sal_False;
- if( !pFndShell )
+ if (pFndShell)
{
- // dann versuche die Datei zu laden:
+ sfx2::SvLinkSource* pNewSrc = pFndShell->DdeCreateLinkSource( sItem );
+ if( pNewSrc )
+ {
+ ::com::sun::star::datatransfer::DataFlavor aFl;
+ SotExchange::GetFormatDataFlavor( pLink->GetContentType(), aFl );
+
+ pLink->SetObj( pNewSrc );
+ pNewSrc->AddDataAdvise( pLink, aFl.MimeType,
+ sfx2::LINKUPDATE_ONCALL == pLink->GetUpdateMode()
+ ? ADVISEMODE_ONLYONCE
+ : 0 );
+ return true;
+ }
+ }
+ else
+ {
+ // then try to download the file:
INetURLObject aURL( sTopic );
INetProtocol eOld = aURL.GetProtocol();
aURL.SetURL( sTopic = lcl_DDE_RelToAbs( sTopic, sReferer ) );
@@ -593,7 +674,11 @@ sal_Bool SvxInternalLink::Connect( sfx2::SvBaseLink* pLink )
SfxStringItem aTarget( SID_TARGETNAME, String::CreateFromAscii("_blank") );
SfxStringItem aReferer( SID_REFERER, sReferer );
SfxUInt16Item aUpdate( SID_UPDATEDOCMODE, nUpdateMode );
- SfxBoolItem aReadOnly(SID_DOC_READONLY, sal_True);
+ SfxBoolItem aReadOnly(SID_DOC_READONLY, false);
+
+ // Disable automatic re-connection to avoid this link instance
+ // being destroyed at re-connection.
+ SfxBoolItem aDdeConnect(SID_DDE_RECONNECT_ONLOAD, false);
// #i14200# (DDE-link crashes wordprocessor)
SfxAllItemSet aArgs( SFX_APP()->GetPool() );
@@ -604,29 +689,19 @@ sal_Bool SvxInternalLink::Connect( sfx2::SvBaseLink* pLink )
aArgs.Put(aName);
aArgs.Put(aUpdate);
aArgs.Put(aReadOnly);
- pFndShell = SfxObjectShell::CreateAndLoadObject( aArgs );
+ aArgs.Put(aDdeConnect);
+ Reference<XComponent> xComp = SfxObjectShell::CreateAndLoadComponent(aArgs);
+ pFndShell = SfxObjectShell::GetShellFromComponent(xComp);
+ if (xComp.is() && pFndShell)
+ {
+ pLinkMgr->InsertCachedComp(xComp);
+ pLinkMgr->LinkServerShell(sItem, *pFndShell, *pLink);
+ return true;
+ }
}
}
- sal_Bool bRet = sal_False;
- if( pFndShell )
- {
- sfx2::SvLinkSource* pNewSrc = pFndShell->DdeCreateLinkSource( sItem );
- if( pNewSrc )
- {
- bRet = sal_True;
-
- ::com::sun::star::datatransfer::DataFlavor aFl;
- SotExchange::GetFormatDataFlavor( pLink->GetContentType(), aFl );
-
- pLink->SetObj( pNewSrc );
- pNewSrc->AddDataAdvise( pLink, aFl.MimeType,
- sfx2::LINKUPDATE_ONCALL == pLink->GetUpdateMode()
- ? ADVISEMODE_ONLYONCE
- : 0 );
- }
- }
- return bRet;
+ return false;
}
@@ -634,3 +709,4 @@ sal_Bool SvxInternalLink::Connect( sfx2::SvBaseLink* pLink )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/linksrc.cxx b/sfx2/source/appl/linksrc.cxx
index ee6e4fba588b..70aa59578c2d 100644
--- a/sfx2/source/appl/linksrc.cxx
+++ b/sfx2/source/appl/linksrc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,7 +31,6 @@
#include <sfx2/linksrc.hxx>
#include <sfx2/lnkbase.hxx>
-//#include <sot/exchange.hxx>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
@@ -46,7 +46,6 @@ namespace sfx2
TYPEINIT0( SvLinkSource )
-/************** class SvLinkSourceTimer *********************************/
class SvLinkSourceTimer : public Timer
{
SvLinkSource * pOwner;
@@ -62,7 +61,7 @@ SvLinkSourceTimer::SvLinkSourceTimer( SvLinkSource * pOwn )
void SvLinkSourceTimer::Timeout()
{
- // sicher gegen zerstoeren im Handler
+ // Secure against beeing destroyed in Handler
SvLinkSourceRef aAdv( pOwner );
pOwner->SendDataChanged();
}
@@ -209,12 +208,11 @@ void SvLinkSource::setStreamToLoadFrom(const com::sun::star::uno::Reference<com:
pImpl->m_bIsReadOnly = bIsReadOnly;
}
-// --> OD 2008-06-18 #i88291#
+// #i88291#
void SvLinkSource::clearStreamToLoadFrom()
{
pImpl->m_xInputStreamToLoadFrom.clear();
}
-// <--
void SvLinkSource::Closed()
{
@@ -277,7 +275,7 @@ void SvLinkSource::SendDataChanged()
void SvLinkSource::NotifyDataChanged()
{
if( pImpl->nTimeout )
- StartTimer( &pImpl->pTimer, this, pImpl->nTimeout ); // Timeout neu
+ StartTimer( &pImpl->pTimer, this, pImpl->nTimeout ); // New timeout
else
{
SvLinkSource_EntryIter_Impl aIter( pImpl->aArr );
@@ -316,10 +314,10 @@ void SvLinkSource::DataChanged( const String & rMimeType,
const ::com::sun::star::uno::Any & rVal )
{
if( pImpl->nTimeout && !rVal.hasValue() )
- { // nur wenn keine Daten mitgegeben wurden
+ { // only when no data was included
// fire all data to the sink, independent of the requested format
pImpl->aDataMimeType = rMimeType;
- StartTimer( &pImpl->pTimer, this, pImpl->nTimeout ); // Timeout neu
+ StartTimer( &pImpl->pTimer, this, pImpl->nTimeout ); // New timeout
}
else
{
@@ -433,3 +431,4 @@ void SvLinkSource::Edit( Window *, SvBaseLink *, const Link& )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/lnkbase2.cxx b/sfx2/source/appl/lnkbase2.cxx
index 95c24e4a77ab..cc7b31bd1b15 100644
--- a/sfx2/source/appl/lnkbase2.cxx
+++ b/sfx2/source/appl/lnkbase2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,7 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sfx2.hxx"
-
#include <sfx2/lnkbase.hxx>
#include <sot/exchange.hxx>
#include <com/sun/star/uno/Any.hxx>
@@ -72,16 +72,16 @@ struct BaseLink_Impl
{ delete m_pFileDlg; }
};
-// nur fuer die interne Verwaltung
+// only for internal management
struct ImplBaseLinkData
{
struct tClientType
{
- // gilt fuer alle Links
- sal_uIntPtr nCntntType; // Update Format
- // nicht Ole-Links
- sal_Bool bIntrnlLnk; // ist es ein interner Link
- sal_uInt16 nUpdateMode;// UpdateMode
+ // applies for all links
+ sal_uIntPtr nCntntType; // Update Format
+ // Not Ole-Links
+ sal_Bool bIntrnlLnk; // It is an internal link
+ sal_uInt16 nUpdateMode; // UpdateMode
};
struct tDDEType
@@ -107,7 +107,7 @@ class ImplDdeItem : public DdeGetPutItem
{
SvBaseLink* pLink;
DdeData aData;
- Sequence< sal_Int8 > aSeq; // Datacontainer for DdeData !!!
+ Sequence< sal_Int8 > aSeq; // Datacontainer for DdeData !!!
sal_Bool bIsValidData : 1;
sal_Bool bIsInDTOR : 1;
public:
@@ -130,12 +130,7 @@ public:
sal_Bool IsInDTOR() const { return bIsInDTOR; }
};
-
-/************************************************************************
-|* SvBaseLink::SvBaseLink()
-|*
-|* Beschreibung
-*************************************************************************/
+//--------------------------------------------------------------------------
SvBaseLink::SvBaseLink()
{
@@ -146,11 +141,7 @@ SvBaseLink::SvBaseLink()
bWasLastEditOK = sal_False;
}
-/************************************************************************
-|* SvBaseLink::SvBaseLink()
-|*
-|* Beschreibung
-*************************************************************************/
+//--------------------------------------------------------------------------
SvBaseLink::SvBaseLink( sal_uInt16 nUpdateMode, sal_uIntPtr nContentType )
{
@@ -160,19 +151,16 @@ SvBaseLink::SvBaseLink( sal_uInt16 nUpdateMode, sal_uIntPtr nContentType )
bVisible = bSynchron = bUseCache = sal_True;
bWasLastEditOK = sal_False;
- // falls es ein Ole-Link wird,
+ // It it going to be a Ole-Link,
pImplData->ClientType.nUpdateMode = nUpdateMode;
pImplData->ClientType.nCntntType = nContentType;
pImplData->ClientType.bIntrnlLnk = sal_False;
}
-/************************************************************************
-|* SvBaseLink::SvBaseLink()
-|*
-|* Beschreibung
-*************************************************************************/
+//--------------------------------------------------------------------------
SvBaseLink::SvBaseLink( const String& rLinkName, sal_uInt16 nObjectType, SvLinkSource* pObj )
+ : pImpl(0)
{
bVisible = bSynchron = bUseCache = sal_True;
bWasLastEditOK = sal_False;
@@ -182,7 +170,7 @@ SvBaseLink::SvBaseLink( const String& rLinkName, sal_uInt16 nObjectType, SvLinkS
if( !pObj )
{
- DBG_ASSERT( pObj, "Wo ist mein zu linkendes Object" );
+ DBG_ASSERT( pObj, "Where is my left-most object" );
return;
}
@@ -192,15 +180,14 @@ SvBaseLink::SvBaseLink( const String& rLinkName, sal_uInt16 nObjectType, SvLinkS
DdeTopic* pTopic = FindTopic( aLinkName, &nItemStt );
if( pTopic )
{
- // dann haben wir alles zusammen
- // MM hat gefummelt ???
- // MM_TODO wie kriege ich den Namen
+ // then we have it all together
+ // MM_TODO how do I get the name
String aStr = aLinkName; // xLinkName->GetDisplayName();
aStr = aStr.Copy( nItemStt );
pImplData->DDEType.pItem = new ImplDdeItem( *this, aStr );
pTopic->InsertItem( pImplData->DDEType.pItem );
- // dann koennen wir uns auch das Advise merken
+ // store the Advice
xObj = pObj;
}
}
@@ -208,11 +195,7 @@ SvBaseLink::SvBaseLink( const String& rLinkName, sal_uInt16 nObjectType, SvLinkS
xObj = pObj;
}
-/************************************************************************
-|* SvBaseLink::~SvBaseLink()
-|*
-|* Beschreibung
-*************************************************************************/
+//--------------------------------------------------------------------------
SvBaseLink::~SvBaseLink()
{
@@ -227,6 +210,7 @@ SvBaseLink::~SvBaseLink()
}
delete pImplData;
+ delete pImpl;
}
IMPL_LINK( SvBaseLink, EndEditHdl, String*, _pNewName )
@@ -242,11 +226,7 @@ IMPL_LINK( SvBaseLink, EndEditHdl, String*, _pNewName )
return 0;
}
-/************************************************************************
-|* SvBaseLink::SetObjType()
-|*
-|* Beschreibung
-*************************************************************************/
+//--------------------------------------------------------------------------
void SvBaseLink::SetObjType( sal_uInt16 nObjTypeP )
{
@@ -256,33 +236,21 @@ void SvBaseLink::SetObjType( sal_uInt16 nObjTypeP )
nObjType = nObjTypeP;
}
-/************************************************************************
-|* SvBaseLink::SetName()
-|*
-|* Beschreibung
-*************************************************************************/
+//--------------------------------------------------------------------------
void SvBaseLink::SetName( const String & rNm )
{
aLinkName = rNm;
}
-/************************************************************************
-|* SvBaseLink::GetName()
-|*
-|* Beschreibung
-*************************************************************************/
+//--------------------------------------------------------------------------
String SvBaseLink::GetName() const
{
return aLinkName;
}
-/************************************************************************
-|* SvBaseLink::SetObj()
-|*
-|* Beschreibung
-*************************************************************************/
+//--------------------------------------------------------------------------
void SvBaseLink::SetObj( SvLinkSource * pObj )
{
@@ -293,45 +261,32 @@ void SvBaseLink::SetObj( SvLinkSource * pObj )
xObj = pObj;
}
-/************************************************************************
-|* SvBaseLink::SetLinkSourceName()
-|*
-|* Beschreibung
-*************************************************************************/
+//--------------------------------------------------------------------------
void SvBaseLink::SetLinkSourceName( const String & rLnkNm )
{
if( aLinkName == rLnkNm )
return;
- AddNextRef(); // sollte ueberfluessig sein
- // Alte Verbindung weg
+ AddNextRef(); // should be superfluous
+ // remove old connection
Disconnect();
aLinkName = rLnkNm;
- // Neu verbinden
+ // New Connection
_GetRealObject();
- ReleaseRef(); // sollte ueberfluessig sein
+ ReleaseRef(); // should be superfluous
}
-/************************************************************************
-|* SvBaseLink::GetLinkSourceName()
-|*
-|* Beschreibung
-*************************************************************************/
+//--------------------------------------------------------------------------
String SvBaseLink::GetLinkSourceName() const
{
return aLinkName;
}
-
-/************************************************************************
-|* SvBaseLink::SetUpdateMode()
-|*
-|* Beschreibung
-*************************************************************************/
+//--------------------------------------------------------------------------
void SvBaseLink::SetUpdateMode( sal_uInt16 nMode )
{
@@ -347,7 +302,7 @@ void SvBaseLink::SetUpdateMode( sal_uInt16 nMode )
}
}
-// --> OD 2008-06-19 #i88291#
+// #i88291#
void SvBaseLink::clearStreamToLoadFrom()
{
m_xInputStreamToLoadFrom.clear();
@@ -356,7 +311,6 @@ void SvBaseLink::clearStreamToLoadFrom()
xObj->clearStreamToLoadFrom();
}
}
-// <--
sal_Bool SvBaseLink::Update()
{
@@ -370,28 +324,27 @@ sal_Bool SvBaseLink::Update()
if( xObj.Is() )
{
xObj->setStreamToLoadFrom(m_xInputStreamToLoadFrom,m_bIsReadOnly);
- // m_xInputStreamToLoadFrom = 0;
String sMimeType( SotExchange::GetFormatMimeType(
pImplData->ClientType.nCntntType ));
Any aData;
if( xObj->GetData( aData, sMimeType ) )
{
- DataChanged( sMimeType, aData );
- //JP 13.07.00: Bug 76817 - for manual Updates there is no
- // need to hold the ServerObject
+ UpdateResult eRes = DataChanged(sMimeType, aData);
+ bool bSuccess = eRes == SUCCESS;
+ //for manual Updates there is no need to hold the ServerObject
if( OBJECT_CLIENT_DDE == nObjType &&
LINKUPDATE_ONCALL == GetUpdateMode() && xObj.Is() )
xObj->RemoveAllDataAdvise( this );
- return sal_True;
+ return bSuccess;
}
if( xObj.Is() )
{
- // sollten wir asynschron sein?
+ // should be asynschron?
if( xObj->IsPending() )
return sal_True;
- // dann brauchen wir das Object auch nicht mehr
+ // we do not need the object anymore
AddNextRef();
Disconnect();
ReleaseRef();
@@ -421,14 +374,14 @@ void SvBaseLink::_GetRealObject( sal_Bool bConnect)
{
String sServer;
if( pImpl->m_pLinkMgr->GetDisplayNames( this, &sServer ) &&
- sServer == GetpApp()->GetAppName() ) // interner Link !!!
+ sServer == GetpApp()->GetAppName() ) // internal Link !!!
{
- // damit der Internal - Link erzeugt werden kann !!!
+ // so that the Internal link can be created!
nObjType = OBJECT_INTERN;
xObj = pImpl->m_pLinkMgr->CreateObj( this );
pImplData->ClientType.bIntrnlLnk = sal_True;
- nObjType = OBJECT_CLIENT_DDE; // damit wir wissen was es mal war !!
+ nObjType = OBJECT_CLIENT_DDE; // so we know what it once was!
}
else
{
@@ -448,7 +401,7 @@ sal_uIntPtr SvBaseLink::GetContentType() const
if( OBJECT_CLIENT_SO & nObjType )
return pImplData->ClientType.nCntntType;
- return 0; // alle Formate ?
+ return 0; // all Formats ?
}
@@ -487,7 +440,7 @@ void SvBaseLink::Disconnect()
}
}
-void SvBaseLink::DataChanged( const String &, const ::com::sun::star::uno::Any & )
+SvBaseLink::UpdateResult SvBaseLink::DataChanged( const String &, const ::com::sun::star::uno::Any & )
{
switch( nObjType )
{
@@ -496,6 +449,7 @@ void SvBaseLink::DataChanged( const String &, const ::com::sun::star::uno::Any &
pImplData->DDEType.pItem->Notify();
break;
}
+ return SUCCESS;
}
void SvBaseLink::Edit( Window* pParent, const Link& rEndEditHdl )
@@ -578,7 +532,6 @@ bool SvBaseLink::ExecuteEdit( const String& _rNewName )
void SvBaseLink::Closed()
{
if( xObj.Is() )
- // beim Advise Abmelden
xObj->RemoveAllDataAdvise( this );
}
@@ -593,8 +546,7 @@ FileDialogHelper* SvBaseLink::GetFileDialog( sal_uInt32 nFlags, const String& rF
ImplDdeItem::~ImplDdeItem()
{
bIsInDTOR = sal_True;
- // damit im Disconnect nicht jemand auf die Idee kommt, den Pointer zu
- // loeschen!!
+ // So that no-one gets the idea to delete the pointer when Disconnecting!
SvBaseLinkRef aRef( pLink );
aRef->Disconnect();
}
@@ -603,7 +555,7 @@ DdeData* ImplDdeItem::Get( sal_uIntPtr nFormat )
{
if( pLink->GetObj() )
{
- // ist das noch gueltig?
+ // is it still valid?
if( bIsValidData && nFormat == aData.GetFormat() )
return &aData;
@@ -628,19 +580,19 @@ DdeData* ImplDdeItem::Get( sal_uIntPtr nFormat )
sal_Bool ImplDdeItem::Put( const DdeData* )
{
- DBG_ERROR( "ImplDdeItem::Put not implemented" );
+ OSL_FAIL( "ImplDdeItem::Put not implemented" );
return sal_False;
}
void ImplDdeItem::AdviseLoop( sal_Bool bOpen )
{
- // Verbindung wird geschlossen, also Link abmelden
+ // Connection is closed, so also unsubscribe link
if( pLink->GetObj() )
{
if( bOpen )
{
- // es wird wieder eine Verbindung hergestellt
+ // A connection is re-established
if( OBJECT_DDE_EXTERN == pLink->GetObjType() )
{
pLink->GetObj()->AddDataAdvise( pLink, String::CreateFromAscii( "text/plain;charset=utf-16" ), ADVISEMODE_NODATA );
@@ -649,8 +601,8 @@ void ImplDdeItem::AdviseLoop( sal_Bool bOpen )
}
else
{
- // damit im Disconnect nicht jemand auf die Idee kommt,
- // den Pointer zu loeschen!!
+ // So that no-one gets the idea to delete the pointer
+ // when Disconnecting!
SvBaseLinkRef aRef( pLink );
aRef->Disconnect();
}
@@ -672,24 +624,24 @@ static DdeTopic* FindTopic( const String & rLinkName, sal_uInt16* pItemStt )
pService = rSvc.Next() )
if( pService->GetName() == sService )
{
- // dann suchen wir uns das Topic
+ // then we search for the Topic
String sTopic( sNm.GetToken( 0, cTokenSeperator, nTokenPos ) );
if( pItemStt )
*pItemStt = nTokenPos;
- DdeTopics& rTopics = pService->GetTopics();
+ std::vector<DdeTopic*>& rTopics = pService->GetTopics();
for( int i = 0; i < 2; ++i )
{
- for( DdeTopic* pTopic = rTopics.First(); pTopic;
- pTopic = rTopics.Next() )
- if( pTopic->GetName() == sTopic )
- return pTopic;
+ for( std::vector<DdeTopic*>::iterator iterTopic = rTopics.begin();
+ iterTopic != rTopics.end(); ++iterTopic )
+ if( (*iterTopic)->GetName() == sTopic )
+ return *iterTopic;
- // Topic nicht gefunden ?
- // dann versuchen wir ihn mal anzulegen
+ // Topic not found?
+ // then we try once to create it
if( i || !pService->MakeTopic( sTopic ) )
- break; // hat nicht geklappt, also raus
+ break; // did not work, exiting
}
break;
}
@@ -697,3 +649,5 @@ static DdeTopic* FindTopic( const String & rLinkName, sal_uInt16* pItemStt )
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx
index 87953e134292..8048e4b85a55 100644
--- a/sfx2/source/appl/module.cxx
+++ b/sfx2/source/appl/module.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sfx2.hxx"
-#ifndef GCC
-#endif
-
#include <stdio.h>
#include <tools/rcid.h>
@@ -69,12 +67,10 @@ public:
SfxChildWinFactArr_Impl* pFactArr;
ImageList* pImgListSmall;
ImageList* pImgListBig;
- ImageList* pImgListHiSmall;
- ImageList* pImgListHiBig;
SfxModule_Impl();
~SfxModule_Impl();
- ImageList* GetImageList( ResMgr*, sal_Bool, sal_Bool bHiContrast = sal_False );
+ ImageList* GetImageList( ResMgr* pResMgr, bool bBig );
};
SfxModule_Impl::SfxModule_Impl()
@@ -91,18 +87,15 @@ SfxModule_Impl::~SfxModule_Impl()
delete pFactArr;
delete pImgListSmall;
delete pImgListBig;
- delete pImgListHiSmall;
- delete pImgListHiBig;
}
-ImageList* SfxModule_Impl::GetImageList( ResMgr* pResMgr, sal_Bool bBig, sal_Bool bHiContrast )
+ImageList* SfxModule_Impl::GetImageList( ResMgr* pResMgr, bool bBig )
{
- ImageList*& rpList = bBig ? ( bHiContrast ? pImgListHiBig: pImgListBig ) :
- ( bHiContrast ? pImgListHiSmall : pImgListSmall );
+ ImageList*& rpList = bBig ? pImgListBig : pImgListSmall;
if ( !rpList )
{
- ResId aResId( bBig ? ( bHiContrast ? RID_DEFAULTIMAGELIST_LCH : RID_DEFAULTIMAGELIST_LC ) :
- ( bHiContrast ? RID_DEFAULTIMAGELIST_SCH : RID_DEFAULTIMAGELIST_SC ), *pResMgr );
+ ResId aResId( bBig ? ( RID_DEFAULTIMAGELIST_LC ) : ( RID_DEFAULTIMAGELIST_SC ), *pResMgr );
+
aResId.SetRT( RSC_IMAGELIST );
DBG_ASSERT( pResMgr->IsAvailable(aResId), "No default ImageList!" );
@@ -131,16 +124,7 @@ ResMgr* SfxModule::GetResMgr()
}
//====================================================================
-/*
-SfxModule::SfxModule( ResMgr* pMgrP, sal_Bool bDummyP,
- SfxObjectFactory* pFactoryP )
- : pResMgr( pMgrP ), bDummy( bDummyP ), pImpl(0L)
-{
- Construct_Impl();
- if ( pFactoryP )
- pFactoryP->SetModule_Impl( this );
-}
-*/
+
SfxModule::SfxModule( ResMgr* pMgrP, sal_Bool bDummyP,
SfxObjectFactory* pFactoryP, ... )
: pResMgr( pMgrP ), bDummy( bDummyP ), pImpl(0L)
@@ -171,8 +155,6 @@ void SfxModule::Construct_Impl()
pImpl->pFactArr=0;
pImpl->pImgListSmall=0;
pImpl->pImgListBig=0;
- pImpl->pImgListHiSmall=0;
- pImpl->pImgListHiBig=0;
SetPool( &pApp->GetPool() );
}
@@ -186,7 +168,8 @@ SfxModule::~SfxModule()
{
if ( SFX_APP()->Get_Impl() )
{
- // Das Modul wird noch vor dem DeInitialize zerst"ort, also auis dem Array entfernen
+ // The module will be destroyed before the Deinitialize,
+ // so remove from the array
SfxModuleArr_Impl& rArr = GetModules_Impl();
for( sal_uInt16 nPos = rArr.Count(); nPos--; )
{
@@ -215,22 +198,20 @@ SfxSlotPool* SfxModule::GetSlotPool() const
void SfxModule::RegisterChildWindow(SfxChildWinFactory *pFact)
{
- DBG_ASSERT( pImpl, "Kein echtes Modul!" );
+ DBG_ASSERT( pImpl, "No real Module!" );
if (!pImpl->pFactArr)
pImpl->pFactArr = new SfxChildWinFactArr_Impl;
-//#ifdef DBG_UTIL
for (sal_uInt16 nFactory=0; nFactory<pImpl->pFactArr->Count(); ++nFactory)
{
if (pFact->nId == (*pImpl->pFactArr)[nFactory]->nId)
{
pImpl->pFactArr->Remove( nFactory );
- DBG_ERROR("ChildWindow mehrfach registriert!");
+ OSL_FAIL("ChildWindow registered multiple times!");
return;
}
}
-//#endif
pImpl->pFactArr->C40_INSERT(
SfxChildWinFactory, pFact, pImpl->pFactArr->Count() );
@@ -241,7 +222,7 @@ void SfxModule::RegisterChildWindow(SfxChildWinFactory *pFact)
void SfxModule::RegisterChildWindowContext( sal_uInt16 nId,
SfxChildWinContextFactory *pFact)
{
- DBG_ASSERT( pImpl, "Kein echtes Modul!" );
+ DBG_ASSERT( pImpl, "No real Module!" );
sal_uInt16 nCount = pImpl->pFactArr->Count();
for (sal_uInt16 nFactory=0; nFactory<nCount; ++nFactory)
@@ -256,7 +237,7 @@ void SfxModule::RegisterChildWindowContext( sal_uInt16 nId,
}
}
- DBG_ERROR( "Kein ChildWindow fuer diesen Context!" );
+ OSL_FAIL( "No ChildWindow for this Context!" );
}
//-------------------------------------------------------------------------
@@ -273,7 +254,7 @@ void SfxModule::RegisterToolBoxControl( SfxTbxCtrlFactory *pFact )
if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
(pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
{
- DBG_WARNING("TbxController-Registrierung ist nicht eindeutig!");
+ DBG_WARNING("TbxController-Registering is not clearly defined!");
}
}
#endif
@@ -295,7 +276,7 @@ void SfxModule::RegisterStatusBarControl( SfxStbCtrlFactory *pFact )
if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
(pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
{
- DBG_WARNING("StbController-Registrierung ist nicht eindeutig!");
+ DBG_WARNING("TbxController-Registering is not clearly defined!");
}
}
#endif
@@ -317,7 +298,7 @@ void SfxModule::RegisterMenuControl( SfxMenuCtrlFactory *pFact )
if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
(pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
{
- DBG_WARNING("MenuController-Registrierung ist nicht eindeutig!");
+ DBG_WARNING("MenuController-Registering is not clearly defined!");
}
}
#endif
@@ -355,15 +336,10 @@ SfxChildWinFactArr_Impl* SfxModule::GetChildWinFactories_Impl() const
ImageList* SfxModule::GetImageList_Impl( sal_Bool bBig )
{
- return pImpl->GetImageList( pResMgr, bBig, sal_False );
+ return pImpl->GetImageList( pResMgr, bBig );
}
-ImageList* SfxModule::GetImageList_Impl( sal_Bool bBig, sal_Bool bHiContrast )
-{
- return pImpl->GetImageList( pResMgr, bBig, bHiContrast );
-}
-
-SfxTabPage* SfxModule::CreateTabPage( sal_uInt16, Window*, const SfxItemSet& )
+SfxTabPage* SfxModule::CreateTabPage( sal_uInt16, Window*, const SfxItemSet& )
{
return NULL;
}
@@ -381,10 +357,11 @@ void SfxModule::DestroyModules_Impl()
{
SfxModuleArr_Impl& rModules = *pModules;
for( sal_uInt16 nPos = rModules.Count(); nPos--; )
- {
- SfxModule* pMod = rModules.GetObject(nPos);
- delete pMod;
- }
+ {
+ SfxModule* pMod = rModules.GetObject(nPos);
+ delete pMod;
+ }
+ delete pModules, pModules = 0;
}
}
@@ -482,3 +459,5 @@ FieldUnit SfxModule::GetFieldUnit() const
eUnit = (FieldUnit)( (SfxUInt16Item*)pItem )->GetValue();
return eUnit;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index dbeb25d8c6b9..1aa2e8ad6230 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45,7 +46,7 @@
#include "newhelp.hrc"
#include "helpid.hrc"
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <rtl/ustrbuf.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/configurationhelper.hxx>
@@ -70,9 +71,7 @@
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/frame/XDispatchProviderInterception.hpp>
#include <com/sun/star/frame/XFrame.hpp>
-#ifndef _COM_SUN_STAR_TEXT_XBREAKITERATOR_HPP_
#include <com/sun/star/i18n/XBreakIterator.hpp>
-#endif
#include <com/sun/star/i18n/WordType.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/style/XStyle.hpp>
@@ -133,8 +132,6 @@ using namespace ::com::sun::star::ui;
using namespace ::comphelper;
-extern void AppendConfigToken_Impl( String& rURL, sal_Bool bQuestionMark ); // sfxhelp.cxx
-
// defines ---------------------------------------------------------------
#define SPLITSET_ID 0
@@ -293,13 +290,6 @@ ContentListBox_Impl::ContentListBox_Impl( Window* pParent, const ResId& rResId )
aDocumentImage ( SfxResId( IMG_HELP_CONTENT_DOC ) )
{
- if ( GetSettings().GetStyleSettings().GetHighContrastMode() )
- {
- aOpenBookImage = Image( SfxResId( IMG_HELP_CONTENT_BOOK_OPEN_HC ) );
- aClosedBookImage = Image( SfxResId( IMG_HELP_CONTENT_BOOK_CLOSED_HC ) );
- aDocumentImage = Image( SfxResId( IMG_HELP_CONTENT_DOC_HC ) );
- }
-
SetStyle( GetStyle() | WB_HIDESELECTION | WB_HSCROLL );
SetEntryHeight( 16 );
@@ -412,7 +402,7 @@ void ContentListBox_Impl::RequestingChilds( SvLBoxEntry* pParent )
}
catch( Exception& )
{
- DBG_ERROR( "ContentListBox_Impl::RequestingChilds(): unexpected exception" );
+ OSL_FAIL( "ContentListBox_Impl::RequestingChilds(): unexpected exception" );
}
}
@@ -613,7 +603,7 @@ namespace sfx2 {
}
};
- typedef ::std::hash_map< ::rtl::OUString, int, hashOUString, equalOUString > KeywordInfo;
+ typedef ::boost::unordered_map< ::rtl::OUString, int, hashOUString, equalOUString > KeywordInfo;
}
#define UNIFY_AND_INSERT_TOKEN( aToken ) \
@@ -653,7 +643,7 @@ void IndexTabPage_Impl::InitializeIndex()
aURL += ::rtl::OUString( sFactory );
String aTemp = aURL;
- AppendConfigToken_Impl( aTemp, sal_True );
+ AppendConfigToken( aTemp, sal_True );
aURL = aTemp;
Content aCnt( aURL, Reference< ::com::sun::star::ucb::XCommandEnvironment > () );
@@ -742,7 +732,7 @@ void IndexTabPage_Impl::InitializeIndex()
}
catch( Exception& )
{
- DBG_ERROR( "IndexTabPage_Impl::InitializeIndex(): unexpected exception" );
+ OSL_FAIL( "IndexTabPage_Impl::InitializeIndex(): unexpected exception" );
}
aIndexCB.SetUpdateMode( sal_True );
@@ -902,7 +892,7 @@ sal_Bool IndexTabPage_Impl::HasKeyword() const
}
// -----------------------------------------------------------------------
-//added by BerryJia for fixing Bug98251, 2002-12-11
+
sal_Bool IndexTabPage_Impl::HasKeywordIgnoreCase()
{
sal_Bool bRet = sal_False;
@@ -1098,7 +1088,7 @@ IMPL_LINK( SearchTabPage_Impl, SearchHdl, PushButton*, EMPTYARG )
if ( !aFullWordsCB.IsChecked() )
aSearchText = sfx2::PrepareSearchString( aSearchText, xBreakIterator, true );
aSearchURL += aSearchText;
- AppendConfigToken_Impl( aSearchURL, sal_False );
+ AppendConfigToken( aSearchURL, sal_False );
if ( aScopeCB.IsChecked() )
aSearchURL += DEFINE_CONST_UNICODE("&Scope=Heading");
Sequence< ::rtl::OUString > aFactories = SfxContentHelper::GetResultSet( aSearchURL );
@@ -1315,7 +1305,7 @@ void BookmarksBox_Impl::DoAction( sal_uInt16 nAction )
RemoveEntry( nPos );
rtl::OUString aImageURL = IMAGE_URL;
aImageURL += INetURLObject( *pURL ).GetHost();
- nPos = InsertEntry( aDlg.GetTitle(), SvFileInformationManager::GetImage( aImageURL ) );
+ nPos = InsertEntry( aDlg.GetTitle(), SvFileInformationManager::GetImage( aImageURL, false ) );
SetEntryData( nPos, (void*)(sal_uIntPtr)( new String( *pURL ) ) );
SelectEntryPos( nPos );
delete pURL;
@@ -1488,7 +1478,7 @@ void BookmarksTabPage_Impl::AddBookmarks( const String& rTitle, const String& rU
{
rtl::OUString aImageURL = IMAGE_URL;
aImageURL += INetURLObject( rURL ).GetHost();
- sal_uInt16 nPos = aBookmarksBox.InsertEntry( rTitle, SvFileInformationManager::GetImage( aImageURL ) );
+ sal_uInt16 nPos = aBookmarksBox.InsertEntry( rTitle, SvFileInformationManager::GetImage( aImageURL, false ) );
aBookmarksBox.SetEntryData( nPos, (void*)(sal_uIntPtr)( new String( rURL ) ) );
}
@@ -1523,7 +1513,7 @@ sal_Bool SfxHelpWindow_Impl::splitHelpURL(const ::rtl::OUString& sHelpURL,
sHelpURL.append(sFactory);
sHelpURL.append(sContent);
String sURL = String(sHelpURL.makeStringAndClear());
- AppendConfigToken_Impl(sURL, bUseQuestionMark);
+ AppendConfigToken(sURL, bUseQuestionMark);
if (sAnchor.getLength())
sURL += String(sAnchor);
return ::rtl::OUString(sURL);
@@ -1535,7 +1525,6 @@ void SfxHelpWindow_Impl::loadHelpContent(const ::rtl::OUString& sHelpURL, sal_Bo
if (!xLoader.is())
return;
- // --> PB 2007-03-12 #134037#
// If a print job runs do not open a new page
Reference< XFrame > xTextFrame = pTextWin->getFrame();
Reference< XController > xTextController ;
@@ -1546,7 +1535,6 @@ void SfxHelpWindow_Impl::loadHelpContent(const ::rtl::OUString& sHelpURL, sal_Bo
xTextController->suspend( sal_False );
return;
}
- // <--
// save url to history
if (bAddToHistory)
@@ -1563,7 +1551,6 @@ void SfxHelpWindow_Impl::loadHelpContent(const ::rtl::OUString& sHelpURL, sal_Bo
if (xContent.is())
{
bSuccess = sal_True;
-// break;
}
}
catch(const RuntimeException&)
@@ -1644,7 +1631,7 @@ SfxHelpIndexWindow_Impl::~SfxHelpIndexWindow_Impl()
void SfxHelpIndexWindow_Impl::Initialize()
{
String aHelpURL = HELP_URL;
- AppendConfigToken_Impl( aHelpURL, sal_True );
+ AppendConfigToken( aHelpURL, sal_True );
Sequence< ::rtl::OUString > aFactories = SfxContentHelper::GetResultSet( aHelpURL );
const ::rtl::OUString* pFacs = aFactories.getConstArray();
sal_uInt32 i, nCount = aFactories.getLength();
@@ -1786,7 +1773,7 @@ IMPL_LINK( SfxHelpIndexWindow_Impl, KeywordHdl, IndexTabPage_Impl *, EMPTYARG )
{
// keyword found on index?
sal_Bool bIndex = pIPage->HasKeyword();
- //The following two lines are added by BerryJia for fixing Bug98251, 2002-12-11
+
if( !bIndex)
bIndex = pIPage->HasKeywordIgnoreCase();
// then set index or search page as current.
@@ -2175,34 +2162,35 @@ sal_Bool SfxHelpTextWindow_Impl::HasSelection() const
void SfxHelpTextWindow_Impl::InitToolBoxImages()
{
sal_Bool bLarge = SvtMiscOptions().AreCurrentSymbolsLarge();
- sal_Bool bHiContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
-
- aIndexOnImage = Image( SfxResId(
- bLarge ? bHiContrast ? IMG_HELP_TOOLBOX_HCL_INDEX_ON : IMG_HELP_TOOLBOX_L_INDEX_ON
- : bHiContrast ? IMG_HELP_TOOLBOX_HC_INDEX_ON : IMG_HELP_TOOLBOX_INDEX_ON ) );
- aIndexOffImage = Image( SfxResId(
- bLarge ? bHiContrast ? IMG_HELP_TOOLBOX_HCL_INDEX_OFF : IMG_HELP_TOOLBOX_L_INDEX_OFF
- : bHiContrast ? IMG_HELP_TOOLBOX_HC_INDEX_OFF : IMG_HELP_TOOLBOX_INDEX_OFF ) );
+
+ aIndexOnImage = Image( SfxResId( bLarge ? IMG_HELP_TOOLBOX_L_INDEX_ON : IMG_HELP_TOOLBOX_INDEX_ON ) );
+ aIndexOffImage = Image( SfxResId( bLarge ? IMG_HELP_TOOLBOX_L_INDEX_OFF : IMG_HELP_TOOLBOX_INDEX_OFF ) );
+
aToolBox.SetItemImage( TBI_INDEX, bIsIndexOn ? aIndexOffImage : aIndexOnImage );
- aToolBox.SetItemImage( TBI_BACKWARD, Image( SfxResId(
- bLarge ? bHiContrast ? IMG_HELP_TOOLBOX_HCL_PREV : IMG_HELP_TOOLBOX_L_PREV
- : bHiContrast ? IMG_HELP_TOOLBOX_HC_PREV : IMG_HELP_TOOLBOX_PREV ) ) );
- aToolBox.SetItemImage( TBI_FORWARD, Image( SfxResId(
- bLarge ? bHiContrast ? IMG_HELP_TOOLBOX_HCL_NEXT : IMG_HELP_TOOLBOX_L_NEXT
- : bHiContrast ? IMG_HELP_TOOLBOX_HC_NEXT : IMG_HELP_TOOLBOX_NEXT ) ) );
- aToolBox.SetItemImage( TBI_START, Image( SfxResId(
- bLarge ? bHiContrast ? IMG_HELP_TOOLBOX_HCL_START : IMG_HELP_TOOLBOX_L_START
- : bHiContrast ? IMG_HELP_TOOLBOX_HC_START : IMG_HELP_TOOLBOX_START ) ) );
- aToolBox.SetItemImage( TBI_PRINT, Image( SfxResId(
- bLarge ? bHiContrast ? IMG_HELP_TOOLBOX_HCL_PRINT : IMG_HELP_TOOLBOX_L_PRINT
- : bHiContrast ? IMG_HELP_TOOLBOX_HC_PRINT : IMG_HELP_TOOLBOX_PRINT ) ) );
- aToolBox.SetItemImage( TBI_BOOKMARKS, Image( SfxResId(
- bLarge ? bHiContrast ? IMG_HELP_TOOLBOX_HCL_BOOKMARKS : IMG_HELP_TOOLBOX_L_BOOKMARKS
- : bHiContrast ? IMG_HELP_TOOLBOX_HC_BOOKMARKS : IMG_HELP_TOOLBOX_BOOKMARKS ) ) );
- aToolBox.SetItemImage( TBI_SEARCHDIALOG, Image( SfxResId(
- bLarge ? bHiContrast ? IMG_HELP_TOOLBOX_HCL_SEARCHDIALOG : IMG_HELP_TOOLBOX_L_SEARCHDIALOG
- : bHiContrast ? IMG_HELP_TOOLBOX_HC_SEARCHDIALOG : IMG_HELP_TOOLBOX_SEARCHDIALOG ) ) );
+ aToolBox.SetItemImage( TBI_BACKWARD,
+ Image( SfxResId( bLarge ? IMG_HELP_TOOLBOX_L_PREV : IMG_HELP_TOOLBOX_PREV ) )
+ );
+
+ aToolBox.SetItemImage( TBI_FORWARD,
+ Image( SfxResId( bLarge ? IMG_HELP_TOOLBOX_L_NEXT : IMG_HELP_TOOLBOX_NEXT ) )
+ );
+
+ aToolBox.SetItemImage( TBI_START,
+ Image( SfxResId( bLarge ? IMG_HELP_TOOLBOX_L_START : IMG_HELP_TOOLBOX_START ) )
+ );
+
+ aToolBox.SetItemImage( TBI_PRINT,
+ Image( SfxResId( bLarge ? IMG_HELP_TOOLBOX_L_PRINT : IMG_HELP_TOOLBOX_PRINT ) )
+ );
+
+ aToolBox.SetItemImage( TBI_BOOKMARKS,
+ Image( SfxResId( bLarge ? IMG_HELP_TOOLBOX_L_BOOKMARKS : IMG_HELP_TOOLBOX_BOOKMARKS ) )
+ );
+
+ aToolBox.SetItemImage( TBI_SEARCHDIALOG,
+ Image( SfxResId( bLarge ? IMG_HELP_TOOLBOX_L_SEARCHDIALOG : IMG_HELP_TOOLBOX_SEARCHDIALOG ) )
+ );
Size aSize = aToolBox.CalcWindowSizePixel();
aSize.Height() += TOOLBOX_OFFSET;
@@ -2353,7 +2341,7 @@ Reference< XTextRange > SfxHelpTextWindow_Impl::getCursor() const
}
catch( Exception& )
{
- DBG_ERROR( "SfxHelpTextWindow_Impl::getCursor(): unexpected exception" );
+ OSL_FAIL( "SfxHelpTextWindow_Impl::getCursor(): unexpected exception" );
}
return xCursor;
@@ -2421,7 +2409,7 @@ IMPL_LINK( SfxHelpTextWindow_Impl, SelectHdl, Timer*, EMPTYARG )
}
catch( Exception& )
{
- DBG_ERROR( "SfxHelpTextWindow_Impl::SelectHdl(): unexpected exception" );
+ OSL_FAIL( "SfxHelpTextWindow_Impl::SelectHdl(): unexpected exception" );
}
return 1;
@@ -2517,7 +2505,7 @@ IMPL_LINK( SfxHelpTextWindow_Impl, FindHdl, sfx2::SearchDialog*, pDlg )
}
catch( Exception& )
{
- DBG_ERROR( "SfxHelpTextWindow_Impl::SelectHdl(): unexpected exception" );
+ OSL_FAIL( "SfxHelpTextWindow_Impl::SelectHdl(): unexpected exception" );
}
return 0;
@@ -2581,7 +2569,6 @@ long SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& rNEvt )
if ( pCmdEvt->GetCommand() == COMMAND_CONTEXTMENU && pCmdWin != this && pCmdWin != &aToolBox )
{
- sal_Bool bHiContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
Point aPos;
if ( pCmdEvt->IsMouseEvent() )
aPos = pCmdEvt->GetMousePosPixel();
@@ -2590,33 +2577,44 @@ long SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& rNEvt )
aPos.Y() += pTextWin->GetPosPixel().Y();
PopupMenu aMenu;
if ( bIsIndexOn )
- aMenu.InsertItem( TBI_INDEX, aIndexOffText, Image( SfxResId(
- bHiContrast ? IMG_HELP_TOOLBOX_HC_INDEX_OFF : IMG_HELP_TOOLBOX_INDEX_OFF ) ) );
+ aMenu.InsertItem( TBI_INDEX, aIndexOffText, Image( SfxResId( IMG_HELP_TOOLBOX_INDEX_OFF ) ) );
else
- aMenu.InsertItem( TBI_INDEX, aIndexOnText, Image( SfxResId(
- bHiContrast ? IMG_HELP_TOOLBOX_HC_INDEX_ON : IMG_HELP_TOOLBOX_INDEX_ON ) ) );
+ aMenu.InsertItem( TBI_INDEX, aIndexOnText, Image( SfxResId( IMG_HELP_TOOLBOX_INDEX_ON ) ) );
+
aMenu.SetHelpId( TBI_INDEX, HID_HELP_TOOLBOXITEM_INDEX );
aMenu.InsertSeparator();
- aMenu.InsertItem( TBI_BACKWARD, String( SfxResId( STR_HELP_BUTTON_PREV ) ),
- Image( SfxResId( bHiContrast ? IMG_HELP_TOOLBOX_HC_PREV : IMG_HELP_TOOLBOX_PREV ) ) );
+ aMenu.InsertItem( TBI_BACKWARD,
+ String( SfxResId( STR_HELP_BUTTON_PREV ) ),
+ Image( SfxResId( IMG_HELP_TOOLBOX_PREV ) )
+ );
aMenu.SetHelpId( TBI_BACKWARD, HID_HELP_TOOLBOXITEM_BACKWARD );
aMenu.EnableItem( TBI_BACKWARD, pHelpWin->HasHistoryPredecessor() );
- aMenu.InsertItem( TBI_FORWARD, String( SfxResId( STR_HELP_BUTTON_NEXT ) ),
- Image( SfxResId( bHiContrast ? IMG_HELP_TOOLBOX_HC_NEXT : IMG_HELP_TOOLBOX_NEXT ) ) );
+ aMenu.InsertItem( TBI_FORWARD,
+ String( SfxResId( STR_HELP_BUTTON_NEXT ) ),
+ Image( SfxResId( IMG_HELP_TOOLBOX_NEXT ) )
+ );
aMenu.SetHelpId( TBI_FORWARD, HID_HELP_TOOLBOXITEM_FORWARD );
aMenu.EnableItem( TBI_FORWARD, pHelpWin->HasHistorySuccessor() );
- aMenu.InsertItem( TBI_START, String( SfxResId( STR_HELP_BUTTON_START ) ),
- Image( SfxResId( bHiContrast ? IMG_HELP_TOOLBOX_HC_START : IMG_HELP_TOOLBOX_START ) ) );
+ aMenu.InsertItem( TBI_START,
+ String( SfxResId( STR_HELP_BUTTON_START ) ),
+ Image( SfxResId( IMG_HELP_TOOLBOX_START ) )
+ );
aMenu.SetHelpId( TBI_START, HID_HELP_TOOLBOXITEM_START );
aMenu.InsertSeparator();
- aMenu.InsertItem( TBI_PRINT, String( SfxResId( STR_HELP_BUTTON_PRINT ) ),
- Image( SfxResId( bHiContrast ? IMG_HELP_TOOLBOX_HC_PRINT : IMG_HELP_TOOLBOX_PRINT ) ) );
+ aMenu.InsertItem( TBI_PRINT,
+ String( SfxResId( STR_HELP_BUTTON_PRINT ) ),
+ Image( SfxResId( IMG_HELP_TOOLBOX_PRINT ) )
+ );
aMenu.SetHelpId( TBI_PRINT, HID_HELP_TOOLBOXITEM_PRINT );
- aMenu.InsertItem( TBI_BOOKMARKS, String( SfxResId( STR_HELP_BUTTON_ADDBOOKMARK ) ),
- Image( SfxResId( bHiContrast ? IMG_HELP_TOOLBOX_HC_BOOKMARKS : IMG_HELP_TOOLBOX_BOOKMARKS ) ) );
+ aMenu.InsertItem( TBI_BOOKMARKS,
+ String( SfxResId( STR_HELP_BUTTON_ADDBOOKMARK ) ),
+ Image( SfxResId( IMG_HELP_TOOLBOX_BOOKMARKS ) )
+ );
aMenu.SetHelpId( TBI_BOOKMARKS, HID_HELP_TOOLBOXITEM_BOOKMARKS );
- aMenu.InsertItem( TBI_SEARCHDIALOG, String( SfxResId( STR_HELP_BUTTON_SEARCHDIALOG ) ),
- Image( SfxResId( bHiContrast ? IMG_HELP_TOOLBOX_HC_SEARCHDIALOG : IMG_HELP_TOOLBOX_SEARCHDIALOG ) ) );
+ aMenu.InsertItem( TBI_SEARCHDIALOG,
+ String( SfxResId( STR_HELP_BUTTON_SEARCHDIALOG ) ),
+ Image( SfxResId( IMG_HELP_TOOLBOX_SEARCHDIALOG ) )
+ );
aMenu.SetHelpId( TBI_SEARCHDIALOG, HID_HELP_TOOLBOXITEM_SEARCHDIALOG );
aMenu.InsertSeparator();
aMenu.InsertItem( TBI_SELECTIONMODE, String( SfxResId( STR_HELP_MENU_TEXT_SELECTION_MODE ) ) );
@@ -2638,8 +2636,10 @@ long SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& rNEvt )
aMenu.CheckItem(TBI_SELECTIONMODE, bCheck);
}
aMenu.InsertSeparator();
- aMenu.InsertItem( TBI_COPY, String( SfxResId( STR_HELP_MENU_TEXT_COPY ) ),
- Image( SfxResId( bHiContrast ? IMG_HELP_TOOLBOX_HC_COPY : IMG_HELP_TOOLBOX_COPY ) ) );
+ aMenu.InsertItem( TBI_COPY,
+ String( SfxResId( STR_HELP_MENU_TEXT_COPY ) ),
+ Image( SfxResId( IMG_HELP_TOOLBOX_COPY ) )
+ );
aMenu.SetHelpId( TBI_COPY, ".uno:Copy" );
aMenu.EnableItem( TBI_COPY, HasSelection() );
@@ -2918,7 +2918,6 @@ void SfxHelpWindow_Impl::MakeLayout()
Some VCL-patches could not solve this problem so I've established the
workaround: resize the help window if it's visible .-)
*/
-// pScreenWin->Hide();
::com::sun::star::awt::Rectangle aRect = xWindow->getPosSize();
sal_Int32 nOldWidth = bIndex ? nCollapseWidth : nExpandWidth;
@@ -2935,8 +2934,6 @@ void SfxHelpWindow_Impl::MakeLayout()
}
else if ( aWinPos.X() > 0 && aWinPos.Y() > 0 )
pScreenWin->SetPosPixel( aWinPos );
-
-// pScreenWin->Show();
}
Clear();
@@ -3085,10 +3082,7 @@ IMPL_LINK( SfxHelpWindow_Impl, OpenHdl, SfxHelpIndexWindow_Impl* , EMPTYARG )
::rtl::OUString sHelpURL;
-// INetURLObject aObj(aEntry);
-// sal_Bool bComplete = ( aObj.GetProtocol() == INET_PROT_VND_SUN_STAR_HELP );
-
- sal_Bool bComplete = rtl::OUString(aEntry).toAsciiLowerCase().match(rtl::OUString::createFromAscii("vnd.sun.star.help"),0);
+ bool bComplete = rtl::OUString(aEntry).toAsciiLowerCase().match(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.help")),0);
if (bComplete)
sHelpURL = ::rtl::OUString(aEntry);
@@ -3189,7 +3183,7 @@ void SfxHelpWindow_Impl::openDone(const ::rtl::OUString& sURL ,
}
catch( Exception& )
{
- DBG_ERROR( "SfxHelpWindow_Impl::OpenDoneHdl(): unexpected exception" );
+ OSL_FAIL( "SfxHelpWindow_Impl::OpenDoneHdl(): unexpected exception" );
}
// When the SearchPage opens the help doc, then select all words, which are equal to its text
@@ -3400,7 +3394,7 @@ void SfxHelpWindow_Impl::DoAction( sal_uInt16 nActionId )
}
catch( Exception& )
{
- DBG_ERROR( "SfxHelpWindow_Impl::DoAction(): unexpected exception" );
+ OSL_FAIL( "SfxHelpWindow_Impl::DoAction(): unexpected exception" );
}
}
break;
@@ -3490,3 +3484,4 @@ void SfxAddHelpBookmarkDialog_Impl::SetTitle( const String& rTitle )
aTitleED.SetSelection( Selection( 0, rTitle.Len() ) );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/newhelp.hrc b/sfx2/source/appl/newhelp.hrc
index 7bb9aa85678c..7bb9aa85678c 100644..100755
--- a/sfx2/source/appl/newhelp.hrc
+++ b/sfx2/source/appl/newhelp.hrc
diff --git a/sfx2/source/appl/newhelp.hxx b/sfx2/source/appl/newhelp.hxx
index fb34640f93ef..ff983671fa8e 100644
--- a/sfx2/source/appl/newhelp.hxx
+++ b/sfx2/source/appl/newhelp.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -188,7 +189,7 @@ public:
inline void SetKeywordHdl( const Link& rLink ) { aKeywordLink = rLink; }
void SetKeyword( const String& rKeyword );
sal_Bool HasKeyword() const;
- sal_Bool HasKeywordIgnoreCase(); //added by BerryJia for fixing Bug98251, 2002-12-11
+ sal_Bool HasKeywordIgnoreCase();
void OpenKeyword();
inline void SelectExecutableEntry() { aIndexCB.SelectExecutableEntry(); }
@@ -610,5 +611,9 @@ public:
inline String GetTitle() const { return aTitleED.GetText(); }
};
+/// Appends ?Language=xy&System=abc to the help URL in rURL
+void AppendConfigToken( String& rURL, sal_Bool bQuestionMark, const rtl::OUString &rLang = rtl::OUString() );
+
#endif // #ifndef INCLUDED_SFX_NEWHELP_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/newhelp.src b/sfx2/source/appl/newhelp.src
index 88dfed8ad71e..da59e0a35f07 100644
--- a/sfx2/source/appl/newhelp.src
+++ b/sfx2/source/appl/newhelp.src
@@ -217,113 +217,118 @@ Image IMG_HELP_TOOLBOX_INDEX_ON
ImageBitmap = Bitmap { File = "indexon_small.bmp" ; };
MASKCOLOR_MAGENTA
};
+
Image IMG_HELP_TOOLBOX_INDEX_OFF
{
ImageBitmap = Bitmap { File = "indexoff_small.bmp" ; };
MASKCOLOR_MAGENTA
};
+
Image IMG_HELP_TOOLBOX_START
{
ImageBitmap = Bitmap { File = "sc06303.bmp" ; };
MASKCOLOR_MAGENTA
};
+
Image IMG_HELP_TOOLBOX_PREV
{
ImageBitmap = Bitmap { File = "sc06301.bmp" ; };
MASKCOLOR_MAGENTA
};
+
Image IMG_HELP_TOOLBOX_NEXT
{
ImageBitmap = Bitmap { File = "sc06300.bmp" ; };
MASKCOLOR_MAGENTA
};
+
Image IMG_HELP_TOOLBOX_PRINT
{
ImageBitmap = Bitmap { File = "sc05504.bmp" ; };
MASKCOLOR_MAGENTA
};
+
Image IMG_HELP_TOOLBOX_BOOKMARKS
{
ImageBitmap = Bitmap { File = "favourite.bmp" ; };
MASKCOLOR_MAGENTA
};
+
Image IMG_HELP_TOOLBOX_SEARCHDIALOG
{
ImageBitmap = Bitmap { File = "sc05961.bmp" ; };
MASKCOLOR_MAGENTA
};
+
Image IMG_HELP_TOOLBOX_COPY
{
ImageBitmap = Bitmap { File = "sc05711.bmp" ; };
MASKCOLOR_MAGENTA
};
+
Image IMG_HELP_CONTENT_BOOK_OPEN
{
ImageBitmap = Bitmap { File = "hlpbookopen.bmp" ; };
MASKCOLOR_MAGENTA
};
-Image IMG_HELP_CONTENT_BOOK_OPEN_HC
-{
- ImageBitmap = Bitmap { File = "hlpbookopen_h.bmp" ; };
- MASKCOLOR_MAGENTA
-};
+
Image IMG_HELP_CONTENT_BOOK_CLOSED
{
ImageBitmap = Bitmap { File = "hlpbookclosed.bmp" ; };
MASKCOLOR_MAGENTA
};
-Image IMG_HELP_CONTENT_BOOK_CLOSED_HC
-{
- ImageBitmap = Bitmap { File = "hlpbookclosed_h.bmp" ; };
- MASKCOLOR_MAGENTA
-};
+
Image IMG_HELP_CONTENT_DOC
{
ImageBitmap = Bitmap { File = "hlpdoc.bmp" ; };
MASKCOLOR_MAGENTA
};
-Image IMG_HELP_CONTENT_DOC_HC
-{
- ImageBitmap = Bitmap { File = "hlpdoc_h.bmp" ; };
- MASKCOLOR_MAGENTA
-};
String STR_HELP_WINDOW_TITLE
{
Text [ en-US ] = "%PRODUCTNAME Help";
};
+
String STR_HELP_BUTTON_INDEX_ON
{
Text [ en-US ] = "Show Navigation Pane";
};
+
String STR_HELP_BUTTON_INDEX_OFF
{
Text [ en-US ] = "Hide Navigation Pane";
};
+
String STR_HELP_BUTTON_START
{
Text [ en-US ] = "First Page";
};
+
String STR_HELP_BUTTON_PREV
{
Text [ en-US ] = "Previous Page";
};
+
String STR_HELP_BUTTON_NEXT
{
Text [ en-US ] = "Next Page";
};
+
String STR_HELP_BUTTON_PRINT
{
Text [ en-US ] = "Print...";
};
+
String STR_HELP_BUTTON_ADDBOOKMARK
{
Text [ en-US ] = "Add to Bookmarks...";
};
+
String STR_HELP_BUTTON_SEARCHDIALOG
{
Text [ en-US ] = "Find on this Page...";
};
+
String STR_HELP_BUTTON_SOURCEVIEW
{
Text [ en-US ] = "HTML Source";
@@ -333,18 +338,22 @@ String STR_HELP_FIRST_MESSAGE
{
Text [ en-US ] = "The Help is being started...";
};
+
String STR_HELP_FIRST_HTML
{
Text = "<html></head><body><center><br></br><br></br><p><tt>%1</tt></center></body></html>";
};
+
String STR_HELP_MENU_TEXT_SELECTION_MODE
{
Text [ en-US ] = "Select Text";
};
+
String STR_HELP_MENU_TEXT_COPY
{
Text [ en-US ] = "~Copy" ;
};
+
ModalDialog DLG_HELP_ADDBOOKMARK
{
HelpID = "sfx2:ModalDialog:DLG_HELP_ADDBOOKMARK";
@@ -440,144 +449,60 @@ InfoBox RID_INFO_NOSEARCHTEXTFOUND
Message [ en-US ] = "The text you entered was not found.";
};
-Image IMG_HELP_TOOLBOX_HC_INDEX_ON
-{
- ImageBitmap = Bitmap { File = "indexon_small_h.bmp" ; };
- MASKCOLOR_MAGENTA
-};
-Image IMG_HELP_TOOLBOX_HC_INDEX_OFF
-{
- ImageBitmap = Bitmap { File = "indexoff_small_h.bmp" ; };
- MASKCOLOR_MAGENTA
-};
-Image IMG_HELP_TOOLBOX_HC_START
-{
- ImageBitmap = Bitmap { File = "sch06303.bmp" ; };
- MASKCOLOR_MAGENTA
-};
-Image IMG_HELP_TOOLBOX_HC_PREV
-{
- ImageBitmap = Bitmap { File = "sch06301.bmp" ; };
- MASKCOLOR_MAGENTA
-};
-Image IMG_HELP_TOOLBOX_HC_NEXT
-{
- ImageBitmap = Bitmap { File = "sch06300.bmp" ; };
- MASKCOLOR_MAGENTA
-};
-Image IMG_HELP_TOOLBOX_HC_PRINT
-{
- ImageBitmap = Bitmap { File = "sch05504.bmp" ; };
- MASKCOLOR_MAGENTA
-};
-Image IMG_HELP_TOOLBOX_HC_BOOKMARKS
-{
- ImageBitmap = Bitmap { File = "favourite_h.bmp" ; };
- MASKCOLOR_MAGENTA
-};
-Image IMG_HELP_TOOLBOX_HC_SEARCHDIALOG
-{
- ImageBitmap = Bitmap { File = "sch05961.bmp" ; };
- MASKCOLOR_MAGENTA
-};
-Image IMG_HELP_TOOLBOX_HC_COPY
-{
- ImageBitmap = Bitmap { File = "sch05711.bmp" ; };
- MASKCOLOR_MAGENTA
-};
-
Image IMG_HELP_TOOLBOX_L_INDEX_ON
{
ImageBitmap = Bitmap { File = "indexon_big.bmp" ; };
MASKCOLOR_MAGENTA
};
+
Image IMG_HELP_TOOLBOX_L_INDEX_OFF
{
ImageBitmap = Bitmap { File = "indexoff_big.bmp" ; };
MASKCOLOR_MAGENTA
};
+
Image IMG_HELP_TOOLBOX_L_START
{
ImageBitmap = Bitmap { File = "lc06303.bmp" ; };
MASKCOLOR_MAGENTA
};
+
Image IMG_HELP_TOOLBOX_L_PREV
{
ImageBitmap = Bitmap { File = "lc06301.bmp" ; };
MASKCOLOR_MAGENTA
};
+
Image IMG_HELP_TOOLBOX_L_NEXT
{
ImageBitmap = Bitmap { File = "lc06300.bmp" ; };
MASKCOLOR_MAGENTA
};
+
Image IMG_HELP_TOOLBOX_L_PRINT
{
ImageBitmap = Bitmap { File = "lc05504.bmp" ; };
MASKCOLOR_MAGENTA
};
+
Image IMG_HELP_TOOLBOX_L_BOOKMARKS
{
ImageBitmap = Bitmap { File = "favourite_big.bmp" ; };
MASKCOLOR_MAGENTA
};
+
Image IMG_HELP_TOOLBOX_L_SEARCHDIALOG
{
ImageBitmap = Bitmap { File = "lc05961.bmp" ; };
MASKCOLOR_MAGENTA
};
+
Image IMG_HELP_TOOLBOX_L_COPY
{
ImageBitmap = Bitmap { File = "lc05711.bmp" ; };
MASKCOLOR_MAGENTA
};
-Image IMG_HELP_TOOLBOX_HCL_INDEX_ON
-{
- ImageBitmap = Bitmap { File = "indexon_big_h.bmp" ; };
- MASKCOLOR_MAGENTA
-};
-Image IMG_HELP_TOOLBOX_HCL_INDEX_OFF
-{
- ImageBitmap = Bitmap { File = "indexoff_big_h.bmp" ; };
- MASKCOLOR_MAGENTA
-};
-Image IMG_HELP_TOOLBOX_HCL_START
-{
- ImageBitmap = Bitmap { File = "lch06303.bmp" ; };
- MASKCOLOR_MAGENTA
-};
-Image IMG_HELP_TOOLBOX_HCL_PREV
-{
- ImageBitmap = Bitmap { File = "lch06301.bmp" ; };
- MASKCOLOR_MAGENTA
-};
-Image IMG_HELP_TOOLBOX_HCL_NEXT
-{
- ImageBitmap = Bitmap { File = "lch06300.bmp" ; };
- MASKCOLOR_MAGENTA
-};
-Image IMG_HELP_TOOLBOX_HCL_PRINT
-{
- ImageBitmap = Bitmap { File = "lch05504.bmp" ; };
- MASKCOLOR_MAGENTA
-};
-Image IMG_HELP_TOOLBOX_HCL_BOOKMARKS
-{
- ImageBitmap = Bitmap { File = "favourite_big_h.bmp" ; };
- MASKCOLOR_MAGENTA
-};
-Image IMG_HELP_TOOLBOX_HCL_SEARCHDIALOG
-{
- ImageBitmap = Bitmap { File = "lch05961.bmp" ; };
- MASKCOLOR_MAGENTA
-};
-Image IMG_HELP_TOOLBOX_HCL_COPY
-{
- ImageBitmap = Bitmap { File = "lch05711.bmp" ; };
- MASKCOLOR_MAGENTA
-};
-
CheckBox RID_HELP_ONSTARTUP_BOX
{
HelpId = HID_HELP_ONSTARTUP_BOX;
@@ -585,8 +510,8 @@ CheckBox RID_HELP_ONSTARTUP_BOX
TabStop = TRUE;
Size = MAP_APPFONT ( 200 , 10 ) ;
};
+
String RID_HELP_ONSTARTUP_TEXT
{
Text [ en-US ] = "~Display %PRODUCTNAME %MODULENAME Help at Startup";
};
-
diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx
index 6bd233949ddf..25d9857c53c4 100644
--- a/sfx2/source/appl/opengrf.cxx
+++ b/sfx2/source/appl/opengrf.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -126,12 +127,12 @@ short SvxOpenGraphicDialog::Execute()
{
if( GetPath().Len() )
{
- GraphicFilter* pFilter = GraphicFilter::GetGraphicFilter();
+ GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
INetURLObject aObj( GetPath() );
// check whether we can load the graphic
String aCurFilter( GetCurrentFilter() );
- sal_uInt16 nFormatNum = pFilter->GetImportFormatNumber( aCurFilter );
+ sal_uInt16 nFormatNum = rFilter.GetImportFormatNumber( aCurFilter );
sal_uInt16 nRetFormat = 0;
sal_uInt16 nFound = USHRT_MAX;
@@ -143,23 +144,23 @@ short SvxOpenGraphicDialog::Execute()
SvStream* pStream = aMed.GetInStream();
if( pStream )
- nImpRet = pFilter->CanImportGraphic( aObj.GetMainURL( INetURLObject::NO_DECODE ), *pStream, nFormatNum, &nRetFormat );
+ nImpRet = rFilter.CanImportGraphic( aObj.GetMainURL( INetURLObject::NO_DECODE ), *pStream, nFormatNum, &nRetFormat );
else
- nImpRet = pFilter->CanImportGraphic( aObj, nFormatNum, &nRetFormat );
+ nImpRet = rFilter.CanImportGraphic( aObj, nFormatNum, &nRetFormat );
if ( GRFILTER_OK != nImpRet )
{
if ( !pStream )
- nImpRet = pFilter->CanImportGraphic( aObj, GRFILTER_FORMAT_DONTKNOW, &nRetFormat );
+ nImpRet = rFilter.CanImportGraphic( aObj, GRFILTER_FORMAT_DONTKNOW, &nRetFormat );
else
- nImpRet = pFilter->CanImportGraphic( aObj.GetMainURL( INetURLObject::NO_DECODE ), *pStream,
+ nImpRet = rFilter.CanImportGraphic( aObj.GetMainURL( INetURLObject::NO_DECODE ), *pStream,
GRFILTER_FORMAT_DONTKNOW, &nRetFormat );
}
}
else
{
- if( (nImpRet=pFilter->CanImportGraphic( aObj, nFormatNum, &nRetFormat )) != GRFILTER_OK )
- nImpRet = pFilter->CanImportGraphic( aObj, GRFILTER_FORMAT_DONTKNOW, &nRetFormat );
+ if( (nImpRet=rFilter.CanImportGraphic( aObj, nFormatNum, &nRetFormat )) != GRFILTER_OK )
+ nImpRet = rFilter.CanImportGraphic( aObj, GRFILTER_FORMAT_DONTKNOW, &nRetFormat );
}
if ( GRFILTER_OK == nImpRet )
@@ -174,9 +175,9 @@ short SvxOpenGraphicDialog::Execute()
else
{
// setup appropriate filter (so next time, it will work)
- if( pFilter->GetImportFormatCount() )
+ if( rFilter.GetImportFormatCount() )
{
- String aFormatName(pFilter->GetImportFormatName(nFound));
+ String aFormatName(rFilter.GetImportFormatName(nFound));
SetCurrentFilter(aFormatName);
}
@@ -210,10 +211,10 @@ void SvxOpenGraphicDialog::EnableLink( sal_Bool state )
{
mpImpl->xCtrlAcc->enableControl( ExtendedFilePickerElementIds::CHECKBOX_LINK, state );
}
- catch(IllegalArgumentException)
+ catch(const IllegalArgumentException&)
{
#ifdef DBG_UTIL
- DBG_ERROR( "Cannot enable \"link\" checkbox" );
+ OSL_FAIL( "Cannot enable \"link\" checkbox" );
#endif
}
}
@@ -229,10 +230,10 @@ void SvxOpenGraphicDialog::AsLink(sal_Bool bState)
Any aAny; aAny <<= bState;
mpImpl->xCtrlAcc->setValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0, aAny );
}
- catch(IllegalArgumentException)
+ catch(const IllegalArgumentException&)
{
#ifdef DBG_UTIL
- DBG_ERROR( "Cannot check \"link\" checkbox" );
+ OSL_FAIL( "Cannot check \"link\" checkbox" );
#endif
}
}
@@ -250,10 +251,10 @@ sal_Bool SvxOpenGraphicDialog::IsAsLink() const
return aVal.hasValue() ? *(sal_Bool*) aVal.getValue() : sal_False;
}
}
- catch(IllegalArgumentException)
+ catch(const IllegalArgumentException&)
{
#ifdef DBG_UTIL
- DBG_ERROR( "Cannot access \"link\" checkbox" );
+ OSL_FAIL( "Cannot access \"link\" checkbox" );
#endif
}
@@ -290,3 +291,5 @@ void SvxOpenGraphicDialog::SetControlHelpIds( const sal_Int16* _pControlId, cons
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/panelist.hxx b/sfx2/source/appl/panelist.hxx
index 7cbf2a19e628..e5924071a64e 100644
--- a/sfx2/source/appl/panelist.hxx
+++ b/sfx2/source/appl/panelist.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,3 +49,5 @@ namespace sfx2
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index 855369c11bc9..7820b46eb713 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,6 +50,8 @@
#include <com/sun/star/frame/FrameSearchFlag.hpp>
#include <toolkit/helper/vclunohelper.hxx>
#include <com/sun/star/frame/XModuleManager.hpp>
+#include <com/sun/star/system/XSystemShellExecute.hpp>
+#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
#include <unotools/configmgr.hxx>
#include <unotools/configitem.hxx>
#include <svtools/helpopt.hxx>
@@ -67,7 +70,6 @@
#include <svtools/sfxecode.hxx>
#define _SVSTDARR_STRINGSDTOR
-#define _SVSTDARR_ULONGSSORT
#include <svl/svstdarr.hxx>
#include "newhelp.hxx"
@@ -87,12 +89,11 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::util;
using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::system;
#define ERROR_TAG String( DEFINE_CONST_UNICODE("Error: ") )
#define PATH_TAG String( DEFINE_CONST_UNICODE("\nPath: ") )
-// class NoHelpErrorBox --------------------------------------------------
-
class NoHelpErrorBox : public ErrorBox
{
public:
@@ -113,25 +114,28 @@ void NoHelpErrorBox::RequestHelp( const HelpEvent& )
// do nothing, because no help available
}
-// -----------------------------------------------------------------------
-
#define STARTERLIST 0
-rtl::OUString HelpLocaleString()
+static bool impl_hasHelpInstalled( const rtl::OUString &rLang );
+
+/// Return the locale we prefer for displaying help
+static rtl::OUString HelpLocaleString()
{
static rtl::OUString aLocaleStr;
if (!aLocaleStr.getLength())
{
+ const rtl::OUString aEnglish( RTL_CONSTASCII_USTRINGPARAM( "en" ) );
// detect installed locale
Any aLocale =
- ::utl::ConfigManager::GetConfigManager()->GetDirectConfigProperty(
+ ::utl::ConfigManager::GetConfigManager().GetDirectConfigProperty(
::utl::ConfigManager::LOCALE );
aLocale >>= aLocaleStr;
bool bOk = aLocaleStr.getLength() != 0;
- if ( bOk )
+ if ( !bOk )
+ aLocaleStr = aEnglish;
+ else
{
rtl::OUString aBaseInstallPath;
- // utl::Bootstrap::PathStatus aBaseLocateResult =
utl::Bootstrap::locateBaseInstallation(aBaseInstallPath);
static const char *szHelpPath = "/help/";
@@ -155,15 +159,19 @@ rtl::OUString HelpLocaleString()
}
}
}
- if (!bOk)
- aLocaleStr = rtl::OUString( DEFINE_CONST_UNICODE("en") );
+ // if not OK, and not even English installed, we use online help, and
+ // have to preserve the full locale name
+ if ( !bOk && impl_hasHelpInstalled( aEnglish ) )
+ aLocaleStr = aEnglish;
}
return aLocaleStr;
}
-void AppendConfigToken_Impl( String& rURL, sal_Bool bQuestionMark )
+void AppendConfigToken( String& rURL, sal_Bool bQuestionMark, const rtl::OUString &rLang )
{
- ::rtl::OUString aLocaleStr(HelpLocaleString());
+ ::rtl::OUString aLocaleStr( rLang );
+ if ( !aLocaleStr.getLength() )
+ aLocaleStr = HelpLocaleString();
// query part exists?
if ( bQuestionMark )
@@ -179,24 +187,27 @@ void AppendConfigToken_Impl( String& rURL, sal_Bool bQuestionMark )
rURL += DEFINE_CONST_UNICODE("&System=");
rURL += SvtHelpOptions().GetSystem();
-}
+ static rtl::OUString aVersion;
+ if ( aVersion.isEmpty() )
+ aVersion = utl::Bootstrap::getProductVersion();
-// -----------------------------------------------------------------------
+ if ( !aVersion.isEmpty() )
+ {
+ rURL += DEFINE_CONST_UNICODE( "&Version=" );
+ rURL += String( aVersion );
+ }
+}
sal_Bool GetHelpAnchor_Impl( const String& _rURL, String& _rAnchor )
{
sal_Bool bRet = sal_False;
::rtl::OUString sAnchor;
- // --> OD 2009-07-01 #159496#
- // do not release solar mutex due to crash regarding accessibility
-// sal_uIntPtr nSolarCount = Application::ReleaseSolarMutex();
- // <--
try
{
::ucbhelper::Content aCnt( INetURLObject( _rURL ).GetMainURL( INetURLObject::NO_DECODE ),
Reference< ::com::sun::star::ucb::XCommandEnvironment > () );
- if ( ( aCnt.getPropertyValue( ::rtl::OUString::createFromAscii( "AnchorName" ) ) >>= sAnchor ) )
+ if ( ( aCnt.getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AnchorName")) ) >>= sAnchor ) )
{
if ( sAnchor.getLength() > 0 )
@@ -213,15 +224,10 @@ sal_Bool GetHelpAnchor_Impl( const String& _rURL, String& _rAnchor )
catch( ::com::sun::star::uno::Exception& )
{
}
- // --> OD 2009-07-01 #159496#
-// Application::AcquireSolarMutex( nSolarCount );
- // <--
return bRet;
}
-// -----------------------------------------------------------------------
-
class SfxHelpOptions_Impl : public utl::ConfigItem
{
private:
@@ -254,10 +260,8 @@ static Sequence< ::rtl::OUString > GetPropertyNames()
return aNames;
}
-// -----------------------------------------------------------------------
-
SfxHelpOptions_Impl::SfxHelpOptions_Impl()
- : ConfigItem( ::rtl::OUString::createFromAscii("Office.SFX/Help") )
+ : ConfigItem( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Office.SFX/Help")) )
{
Sequence< ::rtl::OUString > aNames = GetPropertyNames();
Sequence< Any > aValues = GetProperties( aNames );
@@ -317,8 +321,6 @@ void SfxHelpOptions_Impl::Commit()
{
}
-// class SfxHelp_Impl ----------------------------------------------------
-
class SfxHelp_Impl
{
private:
@@ -355,7 +357,7 @@ void SfxHelp_Impl::Load()
// fill modules list
// create the help url (empty, without module and helpid)
String sHelpURL( DEFINE_CONST_UNICODE("vnd.sun.star.help://") );
- AppendConfigToken_Impl( sHelpURL, sal_True );
+ AppendConfigToken( sHelpURL, sal_True );
// open ucb content and get the list of the help modules
// the list contains strings with three tokens "ui title \t type \t url"
@@ -407,201 +409,6 @@ sal_Bool SfxHelp_Impl::IsHelpInstalled()
return ( m_aModulesList.begin() != m_aModulesList.end() );
}
-// class SfxHelp ---------------------------------------------------------
-/* some test code for HID conversion - please don't remove
-
-#include <tools/stream.hxx>
-void TestHids()
-{
- static const char* aModules[] =
- {
- "swriter",
- "scalc",
- "simpress",
- "sdraw",
- "sdatabase",
- "smath",
- "schart",
- "sbasic"
- };
-
- SvFileStream* pOut[] =
- {
- 0,0,0,0,0,0,0,0,0
- };
-
- String aIn = String::CreateFromAscii("/data/OOo/replacer/hidsin.lst");
- String aOut = String::CreateFromAscii("/data/OOo/replacer/");
- SvFileStream aInStrm( aIn, STREAM_READ );
- ByteString aBuffer;
- while ( aInStrm.ReadLine( aBuffer ) )
- {
- ByteString aHid = aBuffer.GetToken(0, ' ');
- ByteString aNr = aBuffer.GetToken(1, ' ');
- bool bFound=false;
- for (sal_Int32 n= 0; n<8; n++)
- {
- bFound = false;
- String aHelpURL = SfxHelp::CreateHelpURL( String( aNr, RTL_TEXTENCODING_UTF8 ), String( aModules[n], RTL_TEXTENCODING_UTF8 ) );
- if ( !SfxContentHelper::IsHelpErrorDocument( aHelpURL ) )
- {
- if (!pOut[n])
- {
- String aTmp( aOut );
- aTmp += String( aModules[n], RTL_TEXTENCODING_UTF8 );
- aTmp += String::CreateFromAscii(".lst");
- pOut[n] = new SvFileStream( aTmp, STREAM_WRITE | STREAM_TRUNC );
- }
- pOut[n]->WriteLine( aHid );
- bFound = true;
- break;
- }
- }
-
- if (!bFound)
- {
- if (!pOut[8])
- {
- String aTmp( aOut );
- aTmp += String( "notfound", RTL_TEXTENCODING_UTF8 );
- aTmp += String::CreateFromAscii(".lst");
- pOut[8] = new SvFileStream( aTmp, STREAM_WRITE | STREAM_TRUNC );
- }
- pOut[8]->WriteLine( aHid );
- }
- }
-
- for (sal_Int32 n= 0; n<9; n++)
- DELETEZ( pOut[n] );
-}
-
-void TestHids2()
-{
- static const char* aModules[] =
- {
- "swriter",
- "scalc",
- "simpress",
- "smath",
- "sbasic"
- };
-
- String aOut = String::CreateFromAscii("/data/OOo/replacer/");
- aOut += String::CreateFromAscii("lost.lst");
- SvFileStream aOutStrm( aOut, STREAM_WRITE | STREAM_TRUNC );
- for (sal_Int32 n= 0; n<5; n++)
- {
- String aIn = String::CreateFromAscii("/data/OOo/replacer/help/");
- aIn += String::CreateFromAscii( aModules[n] );
- aIn += String::CreateFromAscii(".lst");
- SvFileStream aInStrm( aIn, STREAM_READ );
- ByteString aBuffer;
- while ( aInStrm.ReadLine( aBuffer ) )
- {
- String aHelpURL = SfxHelp::CreateHelpURL( String( aBuffer, RTL_TEXTENCODING_UTF8 ), String( aModules[n], RTL_TEXTENCODING_UTF8 ) );
- if ( SfxContentHelper::IsHelpErrorDocument( aHelpURL ) )
- aOutStrm.WriteLine( aBuffer );
- }
- }
-}
-
-#include <tools/stream.hxx>
-void TestHids3()
-{
- static const char* aModules[] =
- {
- "swriter",
- "scalc",
- "simpress",
- "sdraw",
- "sdatabase",
- "smath",
- "schart",
- "sbasic"
- };
-
- SvFileStream* pOut[] =
- {
- 0,0,0,0,0,0,0,0,0
- };
-
- String aIn = String::CreateFromAscii("/data/OOo/replacer/hidsin.lst");
- String aOut = String::CreateFromAscii("/data/OOo/replacer/quickhelp/");
- SvFileStream aInStrm( aIn, STREAM_READ );
- ByteString aBuffer;
- while ( aInStrm.ReadLine( aBuffer ) )
- {
- ByteString aHid = aBuffer.GetToken(0, ' ');
- ByteString aNr = aBuffer.GetToken(1, ' ');
- bool bFound=false;
- for (sal_Int32 n= 0; n<8; n++)
- {
- bFound = false;
- String aHelpURL = SfxHelp::CreateHelpURL( String( aNr, RTL_TEXTENCODING_UTF8 ), String( aModules[n], RTL_TEXTENCODING_UTF8 ) );
- if ( SfxContentHelper::GetActiveHelpString( aHelpURL ).Len() )
-// if ( SfxHelp_Impl::GetHelpText( String( aNr, RTL_TEXTENCODING_UTF8 ), String( aModules[n], RTL_TEXTENCODING_UTF8 ) ).Len() )
- {
- if (!pOut[n])
- {
- String aTmp( aOut );
- aTmp += String( aModules[n], RTL_TEXTENCODING_UTF8 );
- aTmp += String::CreateFromAscii(".lst");
- pOut[n] = new SvFileStream( aTmp, STREAM_WRITE | STREAM_TRUNC );
- }
- pOut[n]->WriteLine( aHid );
- bFound = true;
- break;
- }
- }
-
- if (!bFound)
- {
- if (!pOut[8])
- {
- String aTmp( aOut );
- aTmp += String( "notfound", RTL_TEXTENCODING_UTF8 );
- aTmp += String::CreateFromAscii(".lst");
- pOut[8] = new SvFileStream( aTmp, STREAM_WRITE | STREAM_TRUNC );
- }
- pOut[8]->WriteLine( aHid );
- }
- }
-
- for (sal_Int32 n= 0; n<9; n++)
- DELETEZ( pOut[n] );
-}
-
-void TestHids4()
-{
- static const char* aModules[] =
- {
- "swriter",
- "scalc",
- "simpress",
- "smath",
- "sbasic"
- };
-
- String aOut = String::CreateFromAscii("/data/OOo/replacer/quickhelp/");
- aOut += String::CreateFromAscii("lost.lst");
- SvFileStream aOutStrm( aOut, STREAM_WRITE | STREAM_TRUNC );
- for (sal_Int32 n= 0; n<5; n++)
- {
- String aIn = String::CreateFromAscii("/data/OOo/replacer/quickhelp/");
- aIn += String::CreateFromAscii( aModules[n] );
- aIn += String::CreateFromAscii(".lst");
- SvFileStream aInStrm( aIn, STREAM_READ );
- ByteString aBuffer;
- while ( aInStrm.ReadLine( aBuffer ) )
- {
- String aHelpURL = SfxHelp::CreateHelpURL( String( aBuffer, RTL_TEXTENCODING_UTF8 ), String( aModules[n], RTL_TEXTENCODING_UTF8 ) );
- if ( !SfxContentHelper::GetActiveHelpString( aHelpURL ).Len() )
- aOutStrm.WriteLine( aBuffer );
- }
- }
-}
-*/
-
SfxHelp::SfxHelp() :
bIsDebug( sal_False ),
@@ -723,7 +530,7 @@ String SfxHelp::GetHelpModuleName_Impl()
xCont->getByName( aModuleIdentifier ) >>= lProps;
for ( sal_Int32 i = 0; i < lProps.getLength(); ++i )
{
- if ( lProps[i].Name.equalsAscii("ooSetupFactoryShortName") )
+ if ( lProps[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooSetupFactoryShortName")) )
{
lProps[i].Value >>= aFactoryShortName;
break;
@@ -740,26 +547,26 @@ String SfxHelp::GetHelpModuleName_Impl()
if ( aFactoryShortName.getLength() > 0 )
{
// Map some module identifiers to their "real" help module string.
- if ( aFactoryShortName.equalsAscii( "chart2" ) )
+ if ( aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("chart2")) )
aFactoryShortName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "schart" ) );
- else if ( aFactoryShortName.equalsAscii( "BasicIDE" ) )
+ else if ( aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("BasicIDE")) )
aFactoryShortName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "sbasic" ) );
- else if ( aFactoryShortName.equalsAscii( "sweb" )
- || aFactoryShortName.equalsAscii( "sglobal" )
- || aFactoryShortName.equalsAscii( "swxform" ) )
+ else if ( aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("sweb"))
+ || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("sglobal"))
+ || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("swxform")) )
aFactoryShortName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "swriter" ) );
- else if ( aFactoryShortName.equalsAscii( "dbquery" )
- || aFactoryShortName.equalsAscii( "dbbrowser" )
- || aFactoryShortName.equalsAscii( "dbrelation" )
- || aFactoryShortName.equalsAscii( "dbtable" )
- || aFactoryShortName.equalsAscii( "dbapp" )
- || aFactoryShortName.equalsAscii( "dbreport" )
- || aFactoryShortName.equalsAscii( "swreport" )
- || aFactoryShortName.equalsAscii( "dbbrowser" )
- || aFactoryShortName.equalsAscii( "swform" ) )
+ else if ( aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("dbquery"))
+ || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("dbbrowser"))
+ || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("dbrelation"))
+ || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("dbtable"))
+ || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("dbapp"))
+ || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("dbreport"))
+ || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("swreport"))
+ || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("dbbrowser"))
+ || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("swform")) )
aFactoryShortName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "sdatabase" ) );
- else if ( aFactoryShortName.equalsAscii( "sbibliography" )
- || aFactoryShortName.equalsAscii( "StartModule" ) )
+ else if ( aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("sbibliography"))
+ || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("StartModule")) )
aFactoryShortName = sDefaultModule;
}
else
@@ -794,11 +601,11 @@ String SfxHelp::CreateHelpURL_Impl( const String& aCommandURL, const String& rM
RTL_TEXTENCODING_UTF8 ));
String aTempURL = aHelpURL;
- AppendConfigToken_Impl( aTempURL, sal_True );
+ AppendConfigToken( aTempURL, sal_True );
bHasAnchor = GetHelpAnchor_Impl( aTempURL, aAnchor );
}
- AppendConfigToken_Impl( aHelpURL, sal_True );
+ AppendConfigToken( aHelpURL, sal_True );
if ( bHasAnchor )
{
@@ -901,6 +708,16 @@ XubString SfxHelp::GetHelpText( const String& aCommandURL, const Window* pWindow
return sHelpText;
}
+/// Check for built-in help
+static bool impl_hasHelpInstalled( const rtl::OUString &rLang = rtl::OUString() )
+{
+ String aHelpRootURL( DEFINE_CONST_OUSTRING("vnd.sun.star.help://") );
+ AppendConfigToken( aHelpRootURL, sal_True, rLang );
+ Sequence< ::rtl::OUString > aFactories = SfxContentHelper::GetResultSet( aHelpRootURL );
+
+ return ( aFactories.getLength() != 0 );
+}
+
sal_Bool SfxHelp::SearchKeyword( const XubString& rKeyword )
{
return Start_Impl( String(), NULL, rKeyword );
@@ -911,19 +728,39 @@ sal_Bool SfxHelp::Start( const String& rURL, const Window* pWindow )
return Start_Impl( rURL, pWindow, String() );
}
+/// Redirect the vnd.sun.star.help:// urls to http://help.libreoffice.org
+static bool impl_showOnlineHelp( const String& rURL )
+{
+ String aInternal( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.help://" ) );
+ if ( rURL.Len() <= aInternal.Len() || rURL.Copy( 0, aInternal.Len() ) != aInternal )
+ return false;
+
+ rtl::OUString aHelpLink( RTL_CONSTASCII_USTRINGPARAM( "http://help.libreoffice.org/" ) );
+ aHelpLink += rURL.Copy( aInternal.Len() );
+ try
+ {
+ Reference< XSystemShellExecute > xSystemShell(
+ ::comphelper::getProcessServiceFactory()->createInstance(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.system.SystemShellExecute" ) ) ),
+ UNO_QUERY );
+
+ if ( xSystemShell.is() )
+ {
+ xSystemShell->execute( aHelpLink, rtl::OUString(), SystemShellExecuteFlags::DEFAULTS );
+ return true;
+ }
+ }
+ catch( const Exception& )
+ {
+ }
+ return false;
+}
+
sal_Bool SfxHelp::Start_Impl( const String& rURL, const Window* pWindow, const String& rKeyword )
{
- // check if help is available
String aHelpRootURL( DEFINE_CONST_OUSTRING("vnd.sun.star.help://") );
- AppendConfigToken_Impl( aHelpRootURL, sal_True );
+ AppendConfigToken( aHelpRootURL, sal_True);
Sequence< ::rtl::OUString > aFactories = SfxContentHelper::GetResultSet( aHelpRootURL );
- if ( 0 == aFactories.getLength() )
- {
- // no factories -> no help -> error message and return
- NoHelpErrorBox aErrBox( const_cast< Window* >( pWindow ) );
- aErrBox.Execute();
- return sal_False;
- }
/* rURL may be
- a "real" URL
@@ -940,6 +777,8 @@ sal_Bool SfxHelp::Start_Impl( const String& rURL, const Window* pWindow, const S
INetURLObject aParser( rURL );
INetProtocol nProtocol = aParser.GetProtocol();
String aHelpModuleName( GetHelpModuleName_Impl() );
+
+ ::rtl::OUString sKeyword;
switch ( nProtocol )
{
case INET_PROT_VND_SUN_STAR_HELP:
@@ -949,8 +788,15 @@ sal_Bool SfxHelp::Start_Impl( const String& rURL, const Window* pWindow, const S
default:
{
// no URL, just a HelpID (maybe empty in case of keyword search)
- aHelpURL = CreateHelpURL_Impl( rURL, aHelpModuleName );
- if ( pWindow && SfxContentHelper::IsHelpErrorDocument( aHelpURL ) )
+ aHelpURL = CreateHelpURL_Impl( rURL, aHelpModuleName );
+
+ // pb i91715: strings begin with ".HelpId:" are not words of the basic ide
+ // they are helpid-strings used by the testtool -> so we ignore them
+ static const String sHelpIdScheme( DEFINE_CONST_OUSTRING(".HelpId:") );
+ if ( rURL.Search( sHelpIdScheme ) != 0 )
+ sKeyword = ::rtl::OUString( rURL );
+
+ if ( impl_hasHelpInstalled() && pWindow && SfxContentHelper::IsHelpErrorDocument( aHelpURL ) )
{
// no help found -> try with parent help id.
Window* pParent = pWindow->GetParent();
@@ -973,6 +819,18 @@ sal_Bool SfxHelp::Start_Impl( const String& rURL, const Window* pWindow, const S
}
}
+ if ( !impl_hasHelpInstalled() )
+ {
+ if ( impl_showOnlineHelp( aHelpURL ) )
+ return sal_True;
+ else
+ {
+ NoHelpErrorBox aErrBox( const_cast< Window* >( pWindow ) );
+ aErrBox.Execute();
+ return sal_False;
+ }
+ }
+
Reference < XFrame > xDesktop( ::comphelper::getProcessServiceFactory()->createInstance(
DEFINE_CONST_UNICODE("com.sun.star.frame.Desktop") ), UNO_QUERY );
@@ -997,7 +855,7 @@ sal_Bool SfxHelp::Start_Impl( const String& rURL, const Window* pWindow, const S
#ifdef DBG_UTIL
ByteString aTmp("SfxHelp: HelpId = ");
aTmp += ByteString( aHelpURL, RTL_TEXTENCODING_UTF8 );
- DBG_TRACE( aTmp.GetBuffer() );
+ OSL_TRACE( aTmp.GetBuffer() );
#endif
pHelpWindow->SetHelpURL( aHelpURL );
@@ -1041,7 +899,7 @@ void SfxHelp::OpenHelpAgent( const rtl::OString& sHelpId )
URL aURL;
aURL.Complete = CreateHelpURL_Impl( String( ByteString(sHelpId), RTL_TEXTENCODING_UTF8 ), GetHelpModuleName_Impl() );
Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance(
- ::rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" ) ), UNO_QUERY );
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer")) ), UNO_QUERY );
xTrans->parseStrict(aURL);
Reference < XFrame > xCurrentFrame;
@@ -1054,7 +912,7 @@ void SfxHelp::OpenHelpAgent( const rtl::OString& sHelpId )
Reference< XDispatch > xHelpDispatch;
if ( xDispProv.is() )
xHelpDispatch = xDispProv->queryDispatch(
- aURL, ::rtl::OUString::createFromAscii("_helpagent"),
+ aURL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_helpagent")),
FrameSearchFlag::PARENT | FrameSearchFlag::SELF );
DBG_ASSERT( xHelpDispatch.is(), "OpenHelpAgent: could not get a dispatcher!" );
@@ -1078,3 +936,4 @@ String SfxHelp::GetDefaultHelpModule()
return getCurrentModuleIdentifier_Impl();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx
index 59a753fdb2c4..ed4c98638440 100644
--- a/sfx2/source/appl/sfxpicklist.cxx
+++ b/sfx2/source/appl/sfxpicklist.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,6 +58,8 @@
#include "objshimp.hxx"
#include <sfx2/docfilt.hxx>
+#include <rtl/instance.hxx>
+
#include <algorithm>
// ----------------------------------------------------------------------------
@@ -67,7 +70,6 @@ using namespace ::com::sun::star::util;
// ----------------------------------------------------------------------------
-osl::Mutex* SfxPickList::pMutex = 0;
SfxPickList* SfxPickList::pUniqueInstance = 0;
// ----------------------------------------------------------------------------
@@ -86,20 +88,6 @@ class StringLength : public ::cppu::WeakImplHelper1< XStringWidth >
}
};
-// ----------------------------------------------------------------------------
-
-osl::Mutex* SfxPickList::GetOrCreateMutex()
-{
- if ( !pMutex )
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if ( !pMutex )
- pMutex = new osl::Mutex;
- }
-
- return pMutex;
-}
-
void SfxPickList::CreatePicklistMenuTitle( Menu* pMenu, sal_uInt16 nItemId, const String& aURLString, sal_uInt32 nNo )
{
String aPickEntry;
@@ -125,8 +113,6 @@ void SfxPickList::CreatePicklistMenuTitle( Menu* pMenu, sal_uInt16 nItemId, cons
// path and abbreviate it with a special function:
String aFileSystemPath( aURL.getFSysPath( INetURLObject::FSYS_DETECT ) );
-// ::utl::LocalFileHelper::ConvertURLToPhysicalName( aURLString, aPhysicalName );
-
::rtl::OUString aSystemPath( aFileSystemPath );
::rtl::OUString aCompactedSystemPath;
@@ -160,9 +146,15 @@ void SfxPickList::CreatePicklistMenuTitle( Menu* pMenu, sal_uInt16 nItemId, cons
pMenu->SetAccessibleName( nItemId, aAccessibleName );
}
+namespace
+{
+ class thePickListMutex
+ : public rtl::Static<osl::Mutex, thePickListMutex> {};
+}
+
void SfxPickList::RemovePickListEntries()
{
- ::osl::MutexGuard aGuard( GetOrCreateMutex() );
+ ::osl::MutexGuard aGuard( thePickListMutex::get() );
for ( sal_uInt32 i = 0; i < m_aPicklistVector.size(); i++ )
delete m_aPicklistVector[i];
m_aPicklistVector.clear();
@@ -178,28 +170,10 @@ SfxPickList::PickListEntry* SfxPickList::GetPickListEntry( sal_uInt32 nIndex )
return 0;
}
-SfxPickList* SfxPickList::GetOrCreate( const sal_uInt32 nMenuSize )
+SfxPickList& SfxPickList::Get()
{
- if ( !pUniqueInstance )
- {
- ::osl::MutexGuard aGuard( GetOrCreateMutex() );
- if ( !pUniqueInstance )
- pUniqueInstance = new SfxPickList( nMenuSize );
- }
-
- return pUniqueInstance;
-}
-
-SfxPickList* SfxPickList::Get()
-{
- ::osl::MutexGuard aGuard( GetOrCreateMutex() );
- return pUniqueInstance;
-}
-
-void SfxPickList::Delete()
-{
- ::osl::MutexGuard aGuard( GetOrCreateMutex() );
- DELETEZ( pUniqueInstance );
+ static SfxPickList aUniqueInstance(SvtHistoryOptions().GetSize(ePICKLIST));
+ return aUniqueInstance;
}
SfxPickList::SfxPickList( sal_uInt32 nAllowedMenuSize ) :
@@ -219,7 +193,7 @@ void SfxPickList::CreatePickListEntries()
{
RemovePickListEntries();
- // Einlesen der Pickliste
+ // Reading the pick list
Sequence< Sequence< PropertyValue > > seqPicklist = SvtHistoryOptions().GetList( ePICKLIST );
sal_uInt32 nCount = seqPicklist.getLength();
@@ -266,9 +240,9 @@ void SfxPickList::CreatePickListEntries()
void SfxPickList::CreateMenuEntries( Menu* pMenu )
{
- static sal_Bool bPickListMenuInitializing = sal_False;
+ ::osl::MutexGuard aGuard( thePickListMutex::get() );
- ::osl::MutexGuard aGuard( GetOrCreateMutex() );
+ static sal_Bool bPickListMenuInitializing = sal_False;
if ( bPickListMenuInitializing ) // method is not reentrant!
return;
@@ -301,9 +275,9 @@ void SfxPickList::CreateMenuEntries( Menu* pMenu )
void SfxPickList::ExecuteEntry( sal_uInt32 nIndex )
{
- ::osl::ClearableMutexGuard aGuard( GetOrCreateMutex() );
+ ::osl::ClearableMutexGuard aGuard( thePickListMutex::get() );
- PickListEntry *pPick = SfxPickList::Get()->GetPickListEntry( nIndex );
+ PickListEntry *pPick = SfxPickList::Get().GetPickListEntry( nIndex );
if ( pPick )
{
@@ -335,7 +309,7 @@ void SfxPickList::ExecuteMenuEntry( sal_uInt16 nId )
String SfxPickList::GetMenuEntryTitle( sal_uInt32 nIndex )
{
- PickListEntry *pPick = SfxPickList::Get()->GetPickListEntry( nIndex );
+ PickListEntry *pPick = SfxPickList::Get().GetPickListEntry( nIndex );
if ( pPick )
return pPick->aTitle;
@@ -356,7 +330,7 @@ void SfxPickList::Notify( SfxBroadcaster&, const SfxHint& rHint )
if ( rHint.IsA( TYPE( SfxEventHint )))
{
SfxEventHint* pEventHint = PTR_CAST(SfxEventHint,&rHint);
- // nur ObjectShell-bezogene Events mit Medium interessieren
+ // only ObjectShell-related events with media interest
SfxObjectShell* pDocSh = pEventHint->GetObjShell();
if( !pDocSh )
return;
@@ -392,12 +366,12 @@ void SfxPickList::Notify( SfxBroadcaster&, const SfxHint& rHint )
if( !pMed )
return;
- // unbenannt-Docs und embedded-Docs nicht in History
+ // Unnamed Documents and embedded-Documents not in History
if ( !pDocSh->HasName() ||
SFX_CREATE_MODE_STANDARD != pDocSh->GetCreateMode() )
return;
- // Hilfe nicht in History
+ // Help not in History
INetURLObject aURL( pDocSh->IsDocShared() ? pDocSh->GetSharedFileURL() : ::rtl::OUString( pMed->GetOrigURL() ) );
if ( aURL.GetProtocol() == INET_PROT_VND_SUN_STAR_HELP )
return;
@@ -423,12 +397,12 @@ void SfxPickList::Notify( SfxBroadcaster&, const SfxHint& rHint )
if( !pMed )
return;
- // unbenannt-Docs und embedded-Docs nicht in Pickliste
+ // Unnamed Documents and embedded-Documents not im Pickliste
if ( !pDocSh->HasName() ||
SFX_CREATE_MODE_STANDARD != pDocSh->GetCreateMode() )
return;
- // Hilfe nicht in History
+ // Help not in History
INetURLObject aURL( pDocSh->IsDocShared() ? pDocSh->GetSharedFileURL() : ::rtl::OUString( pMed->GetOrigURL() ) );
if ( aURL.GetProtocol() == INET_PROT_VND_SUN_STAR_HELP )
return;
@@ -471,3 +445,5 @@ void SfxPickList::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx
index f7053321ddfa..5cd33826c6e1 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,10 +32,9 @@
#include <shutdownicon.hxx>
#include <app.hrc>
#include <sfx2/app.hxx>
-#include <vos/mutex.hxx>
+#include <osl/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>
#include <com/sun/star/frame/XNotifyingDispatch.hpp>
@@ -52,9 +52,7 @@
#include <com/sun/star/document/UpdateDocMode.hpp>
#include <sfx2/filedlghelper.hxx>
#include <sfx2/fcontnr.hxx>
-#ifndef _UNOTOOLS_PROCESSFACTORY_HXX
#include <comphelper/processfactory.hxx>
-#endif
#include <cppuhelper/compbase1.hxx>
#include <sfx2/dispatch.hxx>
#include <comphelper/extract.hxx>
@@ -79,7 +77,6 @@ using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::util;
using namespace ::com::sun::star::ui::dialogs;
-using namespace ::vos;
#ifdef WNT
using ::rtl::OUString;
#else
@@ -193,6 +190,9 @@ bool ShutdownIcon::LoadModule( osl::Module **pModule,
return true;
}
+// These two timeouts are necessary to avoid there being
+// plugin frames still on the stack, after unloading that
+// code, causing a crash during disabling / termination.
class IdleUnloader : Timer
{
::osl::Module *m_pModule;
@@ -210,6 +210,22 @@ public:
}
};
+class IdleTerminate : Timer
+{
+ Reference< XDesktop > m_xDesktop;
+public:
+ IdleTerminate (Reference< XDesktop > xDesktop)
+ {
+ m_xDesktop = xDesktop;
+ Start();
+ }
+ virtual void Timeout()
+ {
+ m_xDesktop->terminate();
+ delete this;
+ }
+};
+
void ShutdownIcon::initSystray()
{
if (m_bInitialized)
@@ -275,7 +291,7 @@ void ShutdownIcon::OpenURL( const ::rtl::OUString& aURL, const ::rtl::OUString&
aDispatchURL.Complete = aURL;
Reference < com::sun::star::util::XURLTransformer > xURLTransformer(
- ::comphelper::getProcessServiceFactory()->createInstance( OUString::createFromAscii("com.sun.star.util.URLTransformer") ),
+ ::comphelper::getProcessServiceFactory()->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer")) ),
com::sun::star::uno::UNO_QUERY );
if ( xURLTransformer.is() )
{
@@ -306,7 +322,7 @@ void ShutdownIcon::FileOpen()
{
if ( getInstance() && getInstance()->m_xDesktop.is() )
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ ::SolarMutexGuard aGuard;
EnterModalMode();
getInstance()->StartFileDialog();
}
@@ -325,7 +341,7 @@ void ShutdownIcon::FromTemplate()
URL aTargetURL;
aTargetURL.Complete = OUString( RTL_CONSTASCII_USTRINGPARAM( "slot:5500" ) );
- Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), UNO_QUERY );
+ Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), UNO_QUERY );
xTrans->parseStrict( aTargetURL );
Reference < ::com::sun::star::frame::XDispatchProvider > xProv( xFrame, UNO_QUERY );
@@ -335,14 +351,14 @@ void ShutdownIcon::FromTemplate()
if ( aTargetURL.Protocol.compareToAscii("slot:") == COMPARE_EQUAL )
xDisp = xProv->queryDispatch( aTargetURL, ::rtl::OUString(), 0 );
else
- xDisp = xProv->queryDispatch( aTargetURL, ::rtl::OUString::createFromAscii("_blank"), 0 );
+ xDisp = xProv->queryDispatch( aTargetURL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_blank")), 0 );
}
if ( xDisp.is() )
{
Sequence<PropertyValue> aArgs(1);
PropertyValue* pArg = aArgs.getArray();
- pArg[0].Name = rtl::OUString::createFromAscii("Referer");
- pArg[0].Value <<= ::rtl::OUString::createFromAscii("private:user");
+ pArg[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Referer"));
+ pArg[0].Value <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("private:user"));
Reference< ::com::sun::star::frame::XNotifyingDispatch > xNotifyer( xDisp, UNO_QUERY );
if ( xNotifyer.is() )
{
@@ -359,7 +375,7 @@ void ShutdownIcon::FromTemplate()
#include <tools/rcid.h>
OUString ShutdownIcon::GetResString( int id )
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ ::SolarMutexGuard aGuard;
if( ! m_pResMgr )
m_pResMgr = SfxResId::GetResMgr();
@@ -376,7 +392,7 @@ OUString ShutdownIcon::GetResString( int id )
OUString ShutdownIcon::GetUrlDescription( const OUString& aUrl )
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ ::SolarMutexGuard aGuard;
return OUString( SvFileInformationManager::GetDescription( INetURLObject( aUrl ) ) );
}
@@ -385,7 +401,7 @@ OUString ShutdownIcon::GetUrlDescription( const OUString& aUrl )
void ShutdownIcon::StartFileDialog()
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ ::SolarMutexGuard aGuard;
bool bDirty = ( m_bSystemDialogs != static_cast<bool>(SvtMiscOptions().UseSystemFileDialog()) );
@@ -408,7 +424,7 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR
{
DBG_ASSERT( pThis->m_pFileDlg, "ShutdownIcon, DialogClosedHdl_Impl(): no file dialog" );
- // use ctor for filling up filters automatically! #89169#
+ // use constructor for filling up filters automatically!
if ( ERRCODE_NONE == pThis->m_pFileDlg->GetError() )
{
Reference< XFilePicker > xPicker = pThis->m_pFileDlg->GetFilePicker();
@@ -429,21 +445,21 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR
Sequence< PropertyValue > aArgs(3);
Reference < com::sun::star::task::XInteractionHandler > xInteraction(
- ::comphelper::getProcessServiceFactory()->createInstance( OUString::createFromAscii("com.sun.star.task.InteractionHandler") ),
+ ::comphelper::getProcessServiceFactory()->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.task.InteractionHandler")) ),
com::sun::star::uno::UNO_QUERY );
- aArgs[0].Name = OUString::createFromAscii( "InteractionHandler" );
+ aArgs[0].Name = OUString(RTL_CONSTASCII_USTRINGPARAM("InteractionHandler"));
aArgs[0].Value <<= xInteraction;
sal_Int16 nMacroExecMode = ::com::sun::star::document::MacroExecMode::USE_CONFIG;
- aArgs[1].Name = OUString::createFromAscii( "MacroExecutionMode" );
+ aArgs[1].Name = OUString(RTL_CONSTASCII_USTRINGPARAM("MacroExecutionMode"));
aArgs[1].Value <<= nMacroExecMode;
sal_Int16 nUpdateDoc = ::com::sun::star::document::UpdateDocMode::ACCORDING_TO_CONFIG;
- aArgs[2].Name = OUString::createFromAscii( "UpdateDocMode" );
+ aArgs[2].Name = OUString(RTL_CONSTASCII_USTRINGPARAM("UpdateDocMode"));
aArgs[2].Value <<= nUpdateDoc;
- // pb: #102643# use the filedlghelper to get the current filter name,
+ // use the filedlghelper to get the current filter name,
// because it removes the extensions before you get the filter name.
OUString aFilterName( pThis->m_pFileDlg->GetCurrentFilter() );
@@ -457,12 +473,12 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR
xPickerControls->getValue( ExtendedFilePickerElementIds::CHECKBOX_READONLY, 0 ) >>= bReadOnly;
- // #95239#: Only set porperty if readonly is set to TRUE
+ // Only set porperty if readonly is set to TRUE
if ( bReadOnly )
{
aArgs.realloc( ++nArgs );
- aArgs[nArgs-1].Name = OUString::createFromAscii( "ReadOnly" );
+ aArgs[nArgs-1].Name = OUString(RTL_CONSTASCII_USTRINGPARAM("ReadOnly"));
aArgs[nArgs-1].Value <<= bReadOnly;
}
@@ -477,7 +493,7 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR
sal_Int16 uVersion = (sal_Int16)iVersion;
aArgs.realloc( ++nArgs );
- aArgs[nArgs-1].Name = OUString::createFromAscii( "Version" );
+ aArgs[nArgs-1].Name = OUString(RTL_CONSTASCII_USTRINGPARAM("Version"));
aArgs[nArgs-1].Value <<= uVersion;
}
@@ -502,7 +518,7 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR
if ( aFilterName.getLength() )
{
aArgs.realloc( ++nArgs );
- aArgs[nArgs-1].Name = OUString::createFromAscii( "FilterName" );
+ aArgs[nArgs-1].Name = OUString(RTL_CONSTASCII_USTRINGPARAM("FilterName"));
aArgs[nArgs-1].Value <<= aFilterName;
}
}
@@ -514,7 +530,7 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR
{
OUString aBaseDirURL = sFiles[0];
if ( aBaseDirURL.getLength() > 0 && aBaseDirURL[aBaseDirURL.getLength()-1] != '/' )
- aBaseDirURL += OUString::createFromAscii("/");
+ aBaseDirURL += OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
int iFiles;
for ( iFiles = 1; iFiles < nFiles; iFiles++ )
@@ -532,7 +548,7 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR
}
#ifdef WNT
- // #103346 Destroy dialog to prevent problems with custom controls
+ // Destroy dialog to prevent problems with custom controls
// 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.
@@ -579,19 +595,16 @@ void ShutdownIcon::terminateDesktop()
return;
// always remove ourselves as listener
- xDesktop->removeTerminateListener( pInst );
pInst->m_bListenForTermination = true;
+ xDesktop->removeTerminateListener( pInst );
// terminate desktop only if no tasks exist
Reference< XFramesSupplier > xSupplier( xDesktop, UNO_QUERY );
if ( xSupplier.is() )
{
Reference< XIndexAccess > xTasks ( xSupplier->getFrames(), UNO_QUERY );
- if( xTasks.is() )
- {
- if( xTasks->getCount() < 1 )
- xDesktop->terminate();
- }
+ if( xTasks.is() && xTasks->getCount() < 1 )
+ new IdleTerminate( xDesktop );
}
// remove the instance pointer
@@ -629,7 +642,7 @@ ShutdownIcon* ShutdownIcon::createInstance()
void ShutdownIcon::init() throw( ::com::sun::star::uno::Exception )
{
// access resource system and sfx only protected by solarmutex
- vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ ::SolarMutexGuard aSolarGuard;
ResMgr *pResMgr = SfxResId::GetResMgr();
::osl::ResettableMutexGuard aGuard( m_aMutex );
@@ -714,19 +727,6 @@ void SAL_CALL ShutdownIcon::initialize( const ::com::sun::star::uno::Sequence< :
/* Create a sub-classed instance - foo */
ShutdownIcon::pShutdownIcon = this;
initSystray();
-#ifdef OS2
- // above win32 starts the quickstart thread, but we have
- // quickstart running only when -quickstart is specified
- // on command line (next boot).
- // so if -quickstart was not specified, we cannot issue
- // quickstart veto on shutdown.
- if (bQuickstart)
- {
- // disable shutdown
- ShutdownIcon::getInstance()->SetVeto( true );
- ShutdownIcon::getInstance()->addTerminateListener();
- }
-#endif
}
catch(const ::com::sun::star::lang::IllegalArgumentException&)
{
@@ -761,8 +761,6 @@ void ShutdownIcon::LeaveModalMode()
#ifdef WNT
// defined in shutdowniconw32.cxx
-#elif defined(OS2)
-// defined in shutdowniconOs2.cxx
#elif defined QUARTZ
// defined in shutdowniconaqua.cxx
#else
@@ -781,12 +779,20 @@ bool ShutdownIcon::IsQuickstarterInstalled()
// ---------------------------------------------------------------------------
#if defined (ENABLE_QUICKSTART_APPLET) && defined (UNX)
-static OUString getDotAutostart( bool bCreate = false )
+/**
+* Return the XDG autostart directory.
+* http://standards.freedesktop.org/autostart-spec/autostart-spec-latest.html
+* Available in Unix and with Quickstart enabled.
+* @param bCreate Create the directory if it does not exist yet.
+* @return OUString containing the autostart directory path.
+*/
+static OUString getAutostartDir( bool bCreate = false )
{
OUString aShortcut;
const char *pConfigHome;
if( (pConfigHome = getenv("XDG_CONFIG_HOME") ) )
- aShortcut = OStringToOUString( OString( pConfigHome ), RTL_TEXTENCODING_UTF8 );
+ aShortcut = OStringToOUString( OString( pConfigHome ),
+ RTL_TEXTENCODING_UTF8 );
else
{
OUString aHomeURL;
@@ -815,7 +821,7 @@ rtl::OUString ShutdownIcon::getShortcutName()
ResMgr* pMgr = SfxResId::GetResMgr();
if( pMgr )
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ ::SolarMutexGuard aGuard;
UniString aRes( SfxResId( STR_QUICKSTART_LNKNAME ) );
aShortcutName = OUString( aRes );
}
@@ -826,7 +832,7 @@ rtl::OUString ShutdownIcon::getShortcutName()
aShortcut += OUString( RTL_CONSTASCII_USTRINGPARAM( "\\" ) );
aShortcut += aShortcutName;
#else // UNX
- OUString aShortcut = getDotAutostart();
+ OUString aShortcut = getAutostartDir();
aShortcut += OUString( RTL_CONSTASCII_USTRINGPARAM( "/qstart.desktop" ) );
#endif // UNX
return aShortcut;
@@ -835,9 +841,7 @@ rtl::OUString ShutdownIcon::getShortcutName()
bool ShutdownIcon::GetAutostart( )
{
-#if defined(OS2)
- return GetAutostartOs2( );
-#elif defined QUARTZ
+#if defined QUARTZ
return true;
#else
bool bRet = false;
@@ -846,7 +850,7 @@ bool ShutdownIcon::GetAutostart( )
OUString aShortcutUrl;
osl::File::getFileURLFromSystemPath( aShortcut, aShortcutUrl );
osl::File f( aShortcutUrl );
- osl::File::RC error = f.open( OpenFlag_Read );
+ osl::File::RC error = f.open( osl_File_OpenFlag_Read );
if( error == osl::File::E_None )
{
f.close();
@@ -867,7 +871,7 @@ void ShutdownIcon::SetAutostart( bool bActivate )
#ifdef WNT
EnableAutostartW32( aShortcut );
#else // UNX
- getDotAutostart( true );
+ getAutostartDir( true );
OUString aPath( RTL_CONSTASCII_USTRINGPARAM("${BRAND_BASE_DIR}/share/xdg/qstart.desktop" ) );
Bootstrap::expandMacros( aPath );
@@ -879,10 +883,11 @@ void ShutdownIcon::SetAutostart( bool bActivate )
osl_getThreadTextEncoding() );
OString aShortcutUnx = OUStringToOString( aShortcut,
osl_getThreadTextEncoding() );
- if ((0 != symlink(aDesktopFileUnx, aShortcutUnx)) && (errno == EEXIST))
+ if ((0 != symlink(aDesktopFileUnx.getStr(), aShortcutUnx.getStr())) && (errno == EEXIST))
{
- unlink(aShortcutUnx);
- symlink(aDesktopFileUnx, aShortcutUnx);
+ unlink(aShortcutUnx.getStr());
+ int ret = symlink(aDesktopFileUnx.getStr(), aShortcutUnx.getStr());
+ (void)ret; //deliberately ignore return value, it's non-critical if it fails
}
ShutdownIcon *pIcon = ShutdownIcon::createInstance();
@@ -903,8 +908,6 @@ void ShutdownIcon::SetAutostart( bool bActivate )
}
#endif
}
-#elif defined OS2
- SetAutostartOs2( bActivate );
#else
(void)bActivate; // unused variable
#endif // ENABLE_QUICKSTART_APPLET
@@ -963,3 +966,5 @@ void SAL_CALL ShutdownIcon::setFastPropertyValue( ::sal_Int32
return aValue;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/shutdownicon.hxx b/sfx2/source/appl/shutdownicon.hxx
index d702f2a50977..d9e6e17bf802 100644
--- a/sfx2/source/appl/shutdownicon.hxx
+++ b/sfx2/source/appl/shutdownicon.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#ifndef __SHUTDOWNICON_HXX__
#define __SHUTDOWNICON_HXX__
@@ -12,12 +13,8 @@
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/beans/XFastPropertySet.hpp>
-#ifndef _RTL_STRING_HXX
#include <rtl/string.hxx>
-#endif
-#ifndef _RTL_USTRING_HXX
#include <rtl/ustring.hxx>
-#endif
#include <osl/mutex.hxx>
#include <osl/module.hxx>
#include <sfx2/sfxuno.hxx>
@@ -152,10 +149,6 @@ class SFX2_DLLPUBLIC ShutdownIcon : public ShutdownIconServiceBase
static void EnableAutostartW32( const rtl::OUString &aShortcutName );
static rtl::OUString GetAutostartFolderNameW32();
#endif
-#ifdef OS2
- static void SetAutostartOs2( bool bActivate );
- static bool GetAutostartOs2( );
-#endif
};
extern "C" {
@@ -173,3 +166,5 @@ extern "C" {
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/shutdowniconOs2.cxx b/sfx2/source/appl/shutdowniconOs2.cxx
index 936d6f925053..56932fff80a6 100644
--- a/sfx2/source/appl/shutdowniconOs2.cxx
+++ b/sfx2/source/appl/shutdowniconOs2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45,9 +46,7 @@ using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
using namespace ::osl;
-//
// This ObjectID must match the one created in WarpIN scripts!!
-//
#define QUICKSTART_OBJID "OO2_QUICKSTART"
bool ShutdownIcon::IsQuickstarterInstalled()
@@ -92,3 +91,4 @@ bool ShutdownIcon::GetAutostartOs2( )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/shutdowniconaqua.mm b/sfx2/source/appl/shutdowniconaqua.mm
index d51df52b02d1..481447fe7f1a 100644..100755
--- a/sfx2/source/appl/shutdowniconaqua.mm
+++ b/sfx2/source/appl/shutdowniconaqua.mm
@@ -34,8 +34,9 @@
#include "tools/urlobj.hxx"
#include "osl/file.h"
#include "comphelper/sequenceashashmap.hxx"
-#include "vos/mutex.hxx"
+#include "osl/mutex.hxx"
#include "sfx2/app.hxx"
+#include <sal/macros.h>
#include "app.hrc"
#define USE_APP_SHORTCUTS
#include "shutdownicon.hxx"
@@ -386,7 +387,7 @@ extern "C"
void aqua_init_systray()
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
ShutdownIcon *pShutdownIcon = ShutdownIcon::getInstance();
if( ! pShutdownIcon )
@@ -450,12 +451,12 @@ void aqua_init_systray()
if( [NSApp respondsToSelector: @selector(setDockIconClickHandler:)] )
[NSApp performSelector:@selector(setDockIconClickHandler:) withObject: pExecute];
else
- DBG_ERROR( "setDockIconClickHandler selector failed on NSApp\n" );
+ OSL_FAIL( "setDockIconClickHandler selector failed on NSApp\n" );
}
// insert the menu entries for launching the applications
- for ( size_t i = 0; i < sizeof( aMenuItems ) / sizeof( aMenuItems[0] ); ++i )
+ for ( size_t i = 0; i < SAL_N_ELEMENTS( aMenuItems ); ++i )
{
if ( !aModuleOptions.IsModuleInstalled( aMenuItems[i].eModuleIdentifier ) )
// the complete application is not even installed
@@ -497,10 +498,10 @@ void aqua_init_systray()
[NSApp performSelector:@selector(addDockMenuItem:) withObject: pDockSubMenu];
}
else
- DBG_ERROR( "addDockMenuItem selector failed on NSApp\n" );
+ OSL_FAIL( "addDockMenuItem selector failed on NSApp\n" );
}
else
- DBG_ERROR( "addFallbackMenuItem selector failed on NSApp\n" );
+ OSL_FAIL( "addFallbackMenuItem selector failed on NSApp\n" );
}
}
diff --git a/sfx2/source/appl/shutdowniconunx.cxx b/sfx2/source/appl/shutdowniconunx.cxx
index c9c9e06ae248..5e70016d1ff1 100644
--- a/sfx2/source/appl/shutdowniconunx.cxx
+++ b/sfx2/source/appl/shutdowniconunx.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#ifdef ENABLE_QUICKSTART_APPLET
@@ -7,19 +8,20 @@
#include <gtk/gtk.h>
#include <glib.h>
-#include <eggtray/eggtrayicon.h>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/bitmapex.hxx>
#include <vcl/bmpacc.hxx>
#include <sfx2/app.hxx>
-#ifndef _SFX_APP_HRC
#include "app.hrc"
-#endif
#ifndef __SHUTDOWNICON_HXX__
#define USE_APP_SHORTCUTS
#include "shutdownicon.hxx"
#endif
+#ifdef ENABLE_GIO
+#include <gio/gio.h>
+#endif
+
// Cut/paste from vcl/inc/svids.hrc
#define SV_ICON_SMALL_START 25000
@@ -36,9 +38,13 @@ using namespace ::rtl;
using namespace ::osl;
static ResMgr *pVCLResMgr;
-static EggTrayIcon *pTrayIcon;
+static GtkStatusIcon* pTrayIcon;
static GtkWidget *pExitMenuItem = NULL;
static GtkWidget *pOpenMenuItem = NULL;
+static GtkWidget *pDisableMenuItem = NULL;
+#ifdef ENABLE_GIO
+GFileMonitor* pMonitor = NULL;
+#endif
static void open_url_cb( GtkWidget *, gpointer data )
{
@@ -66,9 +72,10 @@ static void systray_disable_cb()
static void exit_quickstarter_cb( GtkWidget * )
{
- egg_tray_icon_cancel_message (pTrayIcon, 1 );
- ShutdownIcon::getInstance()->terminateDesktop();
plugin_shutdown_sys_tray();
+ //terminate may cause this .so to be unloaded. So we must be hands off
+ //all calls into this .so after this call
+ ShutdownIcon::terminateDesktop();
}
static void menu_deactivate_cb( GtkWidget *pMenu )
@@ -83,13 +90,14 @@ static GdkPixbuf * ResIdToPixbuf( sal_uInt16 nResId )
Bitmap pInSalBitmap = aIcon.GetBitmap();
AlphaMask pInSalAlpha = aIcon.GetAlpha();
- BitmapReadAccess* pSalBitmap = pInSalBitmap.AcquireReadAccess();
- BitmapReadAccess* pSalAlpha = pInSalAlpha.AcquireReadAccess();
+ Bitmap::ScopedReadAccess pSalBitmap(pInSalBitmap);
+ AlphaMask::ScopedReadAccess pSalAlpha(pInSalAlpha);
- g_return_val_if_fail( pSalBitmap != NULL, NULL );
+ g_return_val_if_fail( pSalBitmap, NULL );
Size aSize( pSalBitmap->Width(), pSalBitmap->Height() );
- g_return_val_if_fail( Size( pSalAlpha->Width(), pSalAlpha->Height() ) == aSize, NULL );
+ if (pSalAlpha)
+ g_return_val_if_fail( Size( pSalAlpha->Width(), pSalAlpha->Height() ) == aSize, NULL );
int nX, nY;
guchar *pPixbufData = ( guchar * )g_malloc( 4 * aSize.Width() * aSize.Height() );
@@ -115,10 +123,6 @@ static GdkPixbuf * ResIdToPixbuf( sal_uInt16 nResId )
}
}
- pInSalBitmap.ReleaseAccess( pSalBitmap );
- if( pSalAlpha )
- pInSalAlpha.ReleaseAccess( pSalAlpha );
-
return gdk_pixbuf_new_from_data( pPixbufData,
GDK_COLORSPACE_RGB, sal_True, 8,
aSize.Width(), aSize.Height(),
@@ -182,13 +186,13 @@ static void add_ugly_db_item( GtkMenuShell *pMenuShell, const char *pAsciiURL,
Sequence < PropertyValue >& aEntry = aMenu[n];
for ( sal_Int32 m=0; m<aEntry.getLength(); m++ )
{
- if ( aEntry[m].Name.equalsAsciiL( "URL", 3 ) )
+ if ( aEntry[m].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("URL")) )
aEntry[m].Value >>= aURL;
- if ( aEntry[m].Name.equalsAsciiL( "Title", 5 ) )
+ if ( aEntry[m].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Title")) )
aEntry[m].Value >>= aDescription;
}
- if ( aURL.equalsAscii( BASE_URL ) && aDescription.getLength() )
+ if ( aURL.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(BASE_URL)) && aDescription.getLength() )
{
add_item (pMenuShell, pAsciiURL, &aDescription, nResId, pFnCallback);
break;
@@ -265,7 +269,7 @@ static void populate_menu( GtkWidget *pMenu )
pMenuItem = gtk_separator_menu_item_new();
gtk_menu_shell_append( pMenuShell, pMenuItem );
- (void) add_image_menu_item
+ pDisableMenuItem = add_image_menu_item
( pMenuShell, GTK_STOCK_CLOSE,
pShutdownIcon->GetResString( STR_QUICKSTART_PRELAUNCH_UNX ),
G_CALLBACK( systray_disable_cb ) );
@@ -289,30 +293,7 @@ static void refresh_menu( GtkWidget *pMenu )
bool bModal = ShutdownIcon::bModalMode;
gtk_widget_set_sensitive( pExitMenuItem, !bModal);
gtk_widget_set_sensitive( pOpenMenuItem, !bModal);
-}
-
-extern "C" {
-static void
-layout_menu( GtkMenu *menu,
- gint *x, gint *y, gboolean *push_in,
- gpointer )
-{
- GtkRequisition req;
- GtkWidget *ebox = GTK_BIN( pTrayIcon )->child;
-
- gtk_widget_size_request( GTK_WIDGET( menu ), &req );
- gdk_window_get_origin( ebox->window, x, y );
-
- (*x) += ebox->allocation.x;
- (*y) += ebox->allocation.y;
-
- if (*y >= gdk_screen_get_height (gtk_widget_get_screen (ebox)) / 2)
- (*y) -= req.height;
- else
- (*y) += ebox->allocation.height;
-
- *push_in = sal_True;
-}
+ gtk_widget_set_sensitive( pDisableMenuItem, !bModal);
}
static gboolean display_menu_cb( GtkWidget *,
@@ -321,41 +302,51 @@ static gboolean display_menu_cb( GtkWidget *,
if (event->button == 2)
return sal_False;
-#ifdef TEMPLATE_DIALOG_MORE_POLISHED
- if (event->button == 1 &&
- event->type == GDK_2BUTTON_PRESS)
- {
- open_template_cb( NULL );
- return sal_True;
- }
- if (event->button == 3)
- {
- ... as below ...
-#endif
-
refresh_menu( pMenu );
gtk_menu_popup( GTK_MENU( pMenu ), NULL, NULL,
- layout_menu, NULL, 0, event->time );
+ gtk_status_icon_position_menu, pTrayIcon,
+ 0, event->time );
return sal_True;
}
-extern "C" {
- static gboolean
- show_at_idle( gpointer )
+#ifdef ENABLE_GIO
+/*
+ * If the quickstarter is running, then LibreOffice is
+ * upgraded, then the old quickstarter is still running, but is now unreliable
+ * as the old install has been deleted. A fairly intractable problem but we
+ * can avoid much of the pain if we turn off the quickstarter if we detect
+ * that it has been physically deleted or overwritten
+*/
+static void notify_file_changed(GFileMonitor * /*gfilemonitor*/, GFile * /*arg1*/,
+ GFile * /*arg2*/, GFileMonitorEvent event_type, gpointer /*user_data*/)
+{
+ //Shutdown the quick starter if anything has happened to make it unsafe
+ //to remain running, e.g. rpm --erased and all libs deleted, or
+ //rpm --upgrade and libs being overwritten
+ switch (event_type)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- gtk_widget_show_all( GTK_WIDGET( pTrayIcon ) );
- return sal_False;
+ case G_FILE_MONITOR_EVENT_DELETED:
+ case G_FILE_MONITOR_EVENT_CREATED:
+ case G_FILE_MONITOR_EVENT_PRE_UNMOUNT:
+ case G_FILE_MONITOR_EVENT_UNMOUNTED:
+ exit_quickstarter_cb(GTK_WIDGET(pTrayIcon));
+ break;
+ default:
+ break;
}
}
+#endif
void SAL_DLLPUBLIC_EXPORT plugin_init_sys_tray()
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ ::SolarMutexGuard aGuard;
- if( !g_type_from_name( "GdkDisplay" ) )
+ if( /* need gtk_status to resolve */
+ (gtk_check_version( 2, 10, 0 ) != NULL) ||
+ /* we need the vcl plugin and mainloop initialized */
+ !g_type_from_name( "GdkDisplay" ) )
return;
OString aLabel;
@@ -365,45 +356,65 @@ void SAL_DLLPUBLIC_EXPORT plugin_init_sys_tray()
pShutdownIcon->GetResString( STR_QUICKSTART_TIP ),
RTL_TEXTENCODING_UTF8 );
- pTrayIcon = egg_tray_icon_new( aLabel );
-
- GtkWidget *pParent = gtk_event_box_new();
- GtkTooltips *pTooltips = gtk_tooltips_new();
- gtk_tooltips_set_tip( GTK_TOOLTIPS( pTooltips ), pParent, aLabel, NULL );
-
- GtkWidget *pIconImage = gtk_image_new();
- gtk_container_add( GTK_CONTAINER( pParent ), pIconImage );
-
pVCLResMgr = CREATEVERSIONRESMGR( vcl );
GdkPixbuf *pPixbuf = ResIdToPixbuf( SV_ICON_ID_OFFICE );
- gtk_image_set_from_pixbuf( GTK_IMAGE( pIconImage ), pPixbuf );
+ pTrayIcon = gtk_status_icon_new_from_pixbuf(pPixbuf);
g_object_unref( pPixbuf );
+ g_object_set (pTrayIcon, "title", aLabel.getStr(),
+ "tooltip_text", aLabel.getStr(), NULL);
+
GtkWidget *pMenu = gtk_menu_new();
g_signal_connect (pMenu, "deactivate",
G_CALLBACK (menu_deactivate_cb), NULL);
- g_signal_connect( pParent, "button_press_event",
- G_CALLBACK( display_menu_cb ), pMenu );
- gtk_container_add( GTK_CONTAINER( pTrayIcon ), pParent );
-
- // Show at idle to avoid artefacts at startup
- g_idle_add (show_at_idle, (gpointer) pTrayIcon);
+ g_signal_connect(pTrayIcon, "button_press_event",
+ G_CALLBACK(display_menu_cb), pMenu);
// disable shutdown
pShutdownIcon->SetVeto( true );
pShutdownIcon->addTerminateListener();
+
+#ifdef ENABLE_GIO
+ GFile* pFile = NULL;
+ rtl::OUString sLibraryFileUrl;
+ if (osl::Module::getUrlFromAddress(plugin_init_sys_tray, sLibraryFileUrl))
+ pFile = g_file_new_for_uri(rtl::OUStringToOString(sLibraryFileUrl, RTL_TEXTENCODING_UTF8).getStr());
+
+ if (pFile)
+ {
+ if ((pMonitor = g_file_monitor_file(pFile, G_FILE_MONITOR_NONE, NULL, NULL)))
+ g_signal_connect(pMonitor, "changed", (GCallback)notify_file_changed, NULL);
+ g_object_unref(pFile);
+ }
+#endif
}
void SAL_DLLPUBLIC_EXPORT plugin_shutdown_sys_tray()
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ ::SolarMutexGuard aGuard;
if( !pTrayIcon )
return;
- gtk_widget_destroy( GTK_WIDGET( pTrayIcon ) );
+
+#ifdef ENABLE_GIO
+ if (pMonitor)
+ {
+ g_signal_handlers_disconnect_by_func(pMonitor,
+ (void*)notify_file_changed, pMonitor);
+ g_file_monitor_cancel(pMonitor);
+ g_object_unref(pMonitor);
+ pMonitor = NULL;
+ }
+#endif
+
+ g_object_unref(pTrayIcon);
pTrayIcon = NULL;
+
pExitMenuItem = NULL;
pOpenMenuItem = NULL;
+ pDisableMenuItem = NULL;
}
#endif // ENABLE_QUICKSTART_APPLET
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/shutdowniconw32.cxx b/sfx2/source/appl/shutdowniconw32.cxx
index 3f1b49d6d0e4..57cb6ab0d926 100644
--- a/sfx2/source/appl/shutdowniconw32.cxx
+++ b/sfx2/source/appl/shutdowniconw32.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,6 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sfx2.hxx"
+#include <sal/macros.h>
#ifdef WNT
@@ -39,9 +41,7 @@
#undef WINVER
#define WINVER 0x0400
#define USE_APP_SHORTCUTS
-//
// the systray icon is only available on windows
-//
#include <unotools/moduleoptions.hxx>
#include <unotools/dynamicmenuoptions.hxx>
@@ -130,29 +130,6 @@ typedef struct tagMYITEM
// -------------------------------
-static bool isNT()
-{
- static bool bInitialized = false;
- static bool bWnt = false;
-
- if( !bInitialized )
- {
- bInitialized = true;
-
- OSVERSIONINFO aVerInfo;
- aVerInfo.dwOSVersionInfoSize = sizeof( aVerInfo );
- if ( GetVersionEx( &aVerInfo ) )
- {
- if ( aVerInfo.dwPlatformId == VER_PLATFORM_WIN32_NT )
- bWnt = true;
- }
- }
- return bWnt;
-}
-
-
-// -------------------------------
-
static void addMenuItem( HMENU hMenu, UINT id, UINT iconId, const OUString& text, int& pos, int bOwnerdraw, const OUString& module )
{
MENUITEMINFOW mi;
@@ -250,7 +227,7 @@ static HMENU createSystrayMenu( )
OUString aEmpty;
// insert the menu entries for launching the applications
- for ( size_t i = 0; i < sizeof( aMenuItems ) / sizeof( aMenuItems[0] ); ++i )
+ for ( size_t i = 0; i < SAL_N_ELEMENTS( aMenuItems ); ++i )
{
if ( !aModuleOptions.IsModuleInstalled( aMenuItems[i].eModuleIdentifier ) )
// the complete application is not even installed
@@ -273,7 +250,7 @@ static HMENU createSystrayMenu( )
addMenuItem( hMenu, IDM_TEMPLATE, ICON_TEMPLATE,
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, IDM_OPEN, ICON_OPEN, pShutdownIcon->GetResString( STR_QUICKSTART_FILEOPEN ), pos, true, OUString(RTL_CONSTASCII_USTRINGPARAM("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, aEmpty );
@@ -340,30 +317,6 @@ static void addTaskbarIcon( HWND hWnd )
// -------------------------------
-/*
-static void removeTaskbarIcon()
-{
- ShutdownIcon *pShutdownIcon = ShutdownIcon::getInstance();
- OSL_ENSURE( pShutdownIcon, "ShutdownIcon instance empty!");
-
- if( !pShutdownIcon )
- return;
-
- if ( IsWindow( aListenerWindow ))
- {
- deleteSystrayMenu( popupMenu );
-
- NOTIFYICONDATAA nid;
- nid.cbSize=sizeof(NOTIFYICONDATA);
- nid.hWnd = aListenerWindow;
- nid.uID = ID_QUICKSTART;
- Shell_NotifyIconA(NIM_DELETE, &nid);
- }
-}
-*/
-
-// -------------------------------
-
LRESULT CALLBACK listenerWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
static UINT s_uTaskbarRestart = 0;
@@ -427,7 +380,6 @@ LRESULT CALLBACK listenerWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP
#endif
int m = TrackPopupMenuEx( popupMenu, TPM_RETURNCMD|TPM_LEFTALIGN|TPM_RIGHTBUTTON,
pt.x, pt.y, hWnd, NULL );
- // BUGFIX: See Q135788 (PRB: Menus for Notification Icons Don't Work Correctly)
PostMessage( hWnd, NULL, 0, 0 );
switch( m )
{
@@ -493,7 +445,7 @@ LRESULT CALLBACK listenerWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP
static sal_Bool checkOEM() {
Reference<XMultiServiceFactory> rFactory = ::comphelper::getProcessServiceFactory();
Reference<XJob> rOemJob(rFactory->createInstance(
- OUString::createFromAscii("com.sun.star.office.OEMPreloadJob")),
+ OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.office.OEMPreloadJob"))),
UNO_QUERY );
Sequence<NamedValue> args;
sal_Bool bResult = sal_False;
@@ -762,7 +714,6 @@ void OnDrawItem(HWND /*hwnd*/, LPDRAWITEMSTRUCT lpdis)
IMAGE_ICON, cx, cy,
LR_DEFAULTCOLOR | LR_SHARED );
- // DrawIconEx( lpdis->hDC, x, y+(height-cy)/2, hIcon, cx, cy, 0, NULL, DI_NORMAL );
HBRUSH hbrIcon = CreateSolidBrush( GetSysColor( COLOR_GRAYTEXT ) );
@@ -915,22 +866,7 @@ static bool FileExistsW( LPCWSTR lpPath )
bool ShutdownIcon::IsQuickstarterInstalled()
{
wchar_t aPath[_MAX_PATH];
- if( isNT() )
- {
- GetModuleFileNameW( NULL, aPath, _MAX_PATH-1);
- }
- else
- {
- char szPathA[_MAX_PATH];
- GetModuleFileNameA( NULL, szPathA, _MAX_PATH-1);
-
- // calc the string wcstr len
- int nNeededWStrBuffSize = MultiByteToWideChar( CP_ACP, 0, szPathA, -1, NULL, 0 );
-
- // copy the string if necessary
- if ( nNeededWStrBuffSize > 0 )
- MultiByteToWideChar( CP_ACP, 0, szPathA, -1, aPath, nNeededWStrBuffSize );
- }
+ GetModuleFileNameW( NULL, aPath, _MAX_PATH-1);
OUString aOfficepath( reinterpret_cast<const sal_Unicode*>(aPath) );
int i = aOfficepath.lastIndexOf((sal_Char) '\\');
@@ -946,20 +882,7 @@ bool ShutdownIcon::IsQuickstarterInstalled()
void ShutdownIcon::EnableAutostartW32( const rtl::OUString &aShortcut )
{
wchar_t aPath[_MAX_PATH];
- if( isNT() )
- GetModuleFileNameW( NULL, aPath, _MAX_PATH-1);
- else
- {
- char szPathA[_MAX_PATH];
- GetModuleFileNameA( NULL, szPathA, _MAX_PATH-1);
-
- // calc the string wcstr len
- int nNeededWStrBuffSize = MultiByteToWideChar( CP_ACP, 0, szPathA, -1, NULL, 0 );
-
- // copy the string if necessary
- if ( nNeededWStrBuffSize > 0 )
- MultiByteToWideChar( CP_ACP, 0, szPathA, -1, aPath, nNeededWStrBuffSize );
- }
+ GetModuleFileNameW( NULL, aPath, _MAX_PATH-1);
OUString aOfficepath( reinterpret_cast<const sal_Unicode*>(aPath) );
int i = aOfficepath.lastIndexOf((sal_Char) '\\');
@@ -975,3 +898,4 @@ void ShutdownIcon::EnableAutostartW32( const rtl::OUString &aShortcut )
#endif // WNT
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index 0692b85afcda..e61171a381f7 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,11 +29,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sfx2.hxx"
-#ifndef GCC
-#endif
-
#include <stdio.h>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <sfx2/docfile.hxx>
#include <sfx2/objsh.hxx>
@@ -59,9 +57,7 @@
#include <svl/itemiter.hxx>
#include <svl/whiter.hxx>
#include <svl/intitem.hxx>
-#ifndef _SFXEITEM_HXX //autogen
#include <svl/eitem.hxx>
-#endif
#include <com/sun/star/ui/XUIElement.hpp>
#include <com/sun/star/frame/XLayoutManager.hpp>
#include <com/sun/star/frame/XLayoutManagerEventBroadcaster.hpp>
@@ -141,6 +137,7 @@ static const ResIdToResName pToolBarResToName[] =
{ 23031, "mediaobjectbar" }, //draw/impress
{ 25060, "mediaobjectbar" }, //calc
{ 23311, "mediaobjectbar" }, //writer
+ { 23313, "navigationobjectbar" }, //writer
{ 0, "" }
};
@@ -149,11 +146,11 @@ DBG_NAME(SfxWorkWindow)
//SV_IMPL_OBJARR( SfxObjectBarArr_Impl, SfxObjectBar_Impl );
//====================================================================
-// Sortiert die Children nach ihrem Alignment
-// Reihenfolge entspricht der im enum SfxChildAlignment (->CHILDWIN.HXX).
+// Sort the Children according their alignment
+// The order corresponds to the enum SfxChildAlignment (->CHILDWIN.HXX).
//
-// Hilfe, um die "Anderungen am Alignment kompatibal zu machen!
+// Help to make changes to the alignment compatible!
SFX_IMPL_XINTERFACE_3( LayoutManagerListener, OWeakObject, ::com::sun::star::frame::XLayoutManagerListener, ::com::sun::star::lang::XEventListener, ::com::sun::star::lang::XComponent )
@@ -173,7 +170,7 @@ LayoutManagerListener::~LayoutManagerListener()
void LayoutManagerListener::setFrame( const css::uno::Reference< css::frame::XFrame >& xFrame )
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if ( m_pWrkWin && !m_bHasFrame )
{
m_xFrame = xFrame;
@@ -238,7 +235,7 @@ throw (::com::sun::star::uno::RuntimeException)
void SAL_CALL LayoutManagerListener::dispose()
throw( css::uno::RuntimeException )
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
// reset member
m_pWrkWin = 0;
@@ -285,7 +282,7 @@ void SAL_CALL LayoutManagerListener::disposing(
const css::lang::EventObject& )
throw( css::uno::RuntimeException )
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
m_pWrkWin = 0;
m_bHasFrame = sal_False;
m_xFrame = css::uno::Reference< css::frame::XFrame >();
@@ -300,7 +297,7 @@ void SAL_CALL LayoutManagerListener::layoutEvent(
const css::uno::Any& )
throw (css::uno::RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if ( m_pWrkWin )
{
if ( eLayoutEvent == css::frame::LayoutManagerEvents::VISIBLE )
@@ -328,7 +325,7 @@ throw (css::uno::RuntimeException)
//====================================================================
-typedef std::hash_map< sal_Int32, rtl::OUString > ToolBarResIdToResourceURLMap;
+typedef boost::unordered_map< sal_Int32, rtl::OUString > ToolBarResIdToResourceURLMap;
static sal_Bool bMapInitialized = sal_False;
static ToolBarResIdToResourceURLMap aResIdToResourceURLMap;
@@ -527,7 +524,6 @@ void SfxWorkWindow::Sort_Impl()
{
sal_uInt16 k;
for (k=0; k<aSortedList.Count(); k++)
-// if ( (*pChilds)[aSortedList[k]]->eAlign > pCli->eAlign )
if (ChildAlignValue((*pChilds)[aSortedList[k]]->eAlign) >
ChildAlignValue(pCli->eAlign))
break;
@@ -540,7 +536,7 @@ void SfxWorkWindow::Sort_Impl()
//====================================================================
-// ctor f"ur workwin eines Frames
+// constructor for workwin of a Frame
SfxFrameWorkWin_Impl::SfxFrameWorkWin_Impl( Window *pWin, SfxFrame *pFrm, SfxFrame* pMaster )
: SfxWorkWindow(
@@ -558,11 +554,11 @@ SfxFrameWorkWin_Impl::SfxFrameWorkWin_Impl( Window *pWin, SfxFrame *pFrm, SfxFra
bInternalDockingAllowed = sal_True;
}
- // Die ben"otigten SplitWindows (je eins f"ur jede Seite) werden erzeugt
+ // The required split windows (one for each side) can be created
for ( sal_uInt16 n=0; n<SFX_SPLITWINDOWS_MAX; n++ )
{
- // Die SplitWindows sind direkte ChildWindows des WorkWindows und enthalten
- // die angedockten Fenster.
+ // The SplitWindows excludes direct ChildWindows of the WorkWindows
+ // and receives the docked window.
SfxChildAlignment eAlign =
( n == SFX_SPLITWINDOWS_LEFT ? SFX_ALIGN_LEFT :
@@ -573,13 +569,12 @@ SfxFrameWorkWin_Impl::SfxFrameWorkWin_Impl( Window *pWin, SfxFrame *pFrm, SfxFra
pSplit[n] = pSplitWin;
}
- //nOrigMode = SFX_VISIBILITY_CLIENT;
nOrigMode = SFX_VISIBILITY_STANDARD;
nUpdateMode = SFX_VISIBILITY_STANDARD;
}
//====================================================================
-// ctor der Basisklasse
+// Constructor of the base class
SfxWorkWindow::SfxWorkWindow( Window *pWin, SfxBindings& rB, SfxWorkWindow* pParentWorkwin ) :
pParent( pParentWorkwin ),
@@ -602,15 +597,15 @@ SfxWorkWindow::SfxWorkWindow( Window *pWin, SfxBindings& rB, SfxWorkWindow* pPar
m_aProgressBarResName( RTL_CONSTASCII_USTRINGPARAM( "private:resource/progressbar/progressbar" ))
{
DBG_CTOR(SfxWorkWindow, 0);
- DBG_ASSERT (pBindings, "Keine Bindings!");
+ DBG_ASSERT (pBindings, "No Bindings!");
pBindings->SetWorkWindow_Impl( this );
pChildWins = new SfxChildWindows_Impl;
pChilds = new SfxChildList_Impl;
- // F"ur die ObjectBars wird ein fester Platz in der ChildList reserviert,
- // damit sie immer in einer definierten Reihenfolge kommen.
+ // For the ObjectBars a integral place in the Childlist is reserved,
+ // so that they always come in a defined order.
SfxChild_Impl* pChild=0;
for (sal_uInt16 n=0; n < SFX_OBJECTBAR_MAX; ++n)
pChilds->Insert(0,pChild);
@@ -625,13 +620,13 @@ SfxWorkWindow::SfxWorkWindow( Window *pWin, SfxBindings& rB, SfxWorkWindow* pPar
}
//====================================================================
-// dtor
+// Destructor
SfxWorkWindow::~SfxWorkWindow()
{
DBG_DTOR(SfxWorkWindow, 0);
- // SplitWindows l"oschen
+ // Delete SplitWindows
for ( sal_uInt16 n=0; n<SFX_SPLITWINDOWS_MAX; n++ )
{
SfxSplitWindow *p = pSplit[n];
@@ -640,7 +635,7 @@ SfxWorkWindow::~SfxWorkWindow()
delete p;
}
- // Hilfsstruktur f"ur Child-Windows l"oschen
+ // Delete help structure for Child-Windows
DBG_ASSERT( pChilds->Count() == 0, "dangling childs" );
delete pChilds;
delete pChildWins;
@@ -665,7 +660,7 @@ void SfxWorkWindow::Lock_Impl( sal_Bool bLock )
--m_nLock;
if ( m_nLock<0 )
{
- DBG_ERROR("Lock count underflow!");
+ OSL_FAIL("Lock count underflow!");
m_nLock = 0;
}
@@ -705,17 +700,17 @@ void SfxWorkWindow::SaveStatus_Impl()
}
//--------------------------------------------------------------------
-// Hilfsmethode zum Freigeben der Childlisten. Wenn danach nicht der dtor
-// aufgerufen wird, sondern weiter gearbeitet wird, mu\s wie im ctor von
-// SfxWorkWindow noch Platz f"ur die Objectbars und SplitWindows reserviert
-// werden.
+// Helper method to release the child lists. Should the destructor not be
+// called after this, instead work continues, then space for the object bars
+// and split windows has to be reserved in the same way as in the constructor
+// of SfxWorkWindow.
void SfxWorkWindow::DeleteControllers_Impl()
{
DBG_CHKTHIS(SfxWorkWindow, 0);
- // SplitWindows locken (d.h. Resize-Reaktion an den
- // DockingWindows unterdr"ucken)
+ // Lock SplitWindows (which means supressing the Resize-Reaction of the
+ // DockingWindows)
sal_uInt16 n;
for ( n=0; n<SFX_SPLITWINDOWS_MAX; n++ )
{
@@ -724,7 +719,7 @@ void SfxWorkWindow::DeleteControllers_Impl()
p->Lock();
}
- // Child-Windows l"oschen
+ // Delete Child-Windows
for ( n=0; n<pChildWins->Count(); )
{
SfxChildWin_Impl* pCW = (*pChildWins)[n];
@@ -732,18 +727,12 @@ void SfxWorkWindow::DeleteControllers_Impl()
SfxChildWindow *pChild = pCW->pWin;
if (pChild)
{
-/*
- sal_uInt16 nFlags = pCW->aInfo.nFlags;
- pCW->aInfo = pChild->GetInfo();
- pCW->aInfo.nFlags |= nFlags;
- SaveStatus_Impl(pChild, pCW->aInfo);
-*/
pChild->Hide();
- // Wenn das ChildWindow ein direktes Childfenster ist und nicht
- // in einem SplitWindow liegt, am WorkWindow abmelden.
- // Nach TH ist eine Abmeldung am Splitwindow nicht erforderlich,
- // wenn dieses auch gleich mit zerst"ort wird (s.u.).
+ // If the child window is a direct child window and not in a
+ // SplitWindow, cancel it at the workwindow.
+ // After TH a cancellation on the SplitWindow is not necessary
+ // since this window is also destroyed (see below).
if (pCW->pCli)
ReleaseChild_Impl(*pChild->GetWindow());
pCW->pWin = 0;
@@ -756,14 +745,10 @@ void SfxWorkWindow::DeleteControllers_Impl()
// ATTENTION: The array itself is cleared after this loop!!
// Therefore we have to set every array entry to zero as it could be
// accessed by calling pChild->Destroy().
- // See task 128307 (Windows)
// Window::NotifyAllChilds() calls SfxWorkWindow::DataChanged_Impl for
// 8-bit displays (WM_QUERYPALETTECHANGED message due to focus change)!!
- //(*pChildWins)[n] = 0;
}
- //pChildWins->Remove((sal_uInt16)0, nCount);
-
Reference< com::sun::star::frame::XFrame > xFrame = GetFrameInterface();
Reference< com::sun::star::beans::XPropertySet > xPropSet( xFrame, UNO_QUERY );
Reference< ::com::sun::star::frame::XLayoutManager > xLayoutManager;
@@ -783,21 +768,22 @@ void SfxWorkWindow::DeleteControllers_Impl()
{
xLayoutManager->reset();
- // StatusBar l"oschen
+ // Delete StatusBar
ResetStatusBar_Impl();
- // ObjectBars l"oschen( zuletzt, damit pChilds nicht tote Pointer enh"alt )
+ // Delete ObjectBars (this is done last, so that pChilds does not
+ // receive dead Pointers)
for ( sal_uInt16 i = 0; i < aObjBarList.size(); i++ )
{
- // Nicht jede Position mu\s belegt sein
+ // Not every position must be occupied
sal_uInt16 nId = aObjBarList[i].nId;
if ( nId )
aObjBarList[i].nId = 0;
}
}
- // ObjectBars werden alle auf einmal released, da sie einen
- // festen zusammenh"angenden Bereich im Array pChilds belegen
+ // ObjectBars are all released at once, since they occupy a
+ // fixed contiguous area in the array pChild
pChilds->Remove(0, SFX_OBJECTBAR_MAX);
bSorted = sal_False;
@@ -805,7 +791,7 @@ void SfxWorkWindow::DeleteControllers_Impl()
}
//====================================================================
-// Virtuelle Methode zum Anordnen der Childfenster.
+// Virtual method for placing the child window.
void SfxWorkWindow::ArrangeChilds_Impl( sal_Bool /*bForce*/)
{
@@ -835,16 +821,14 @@ void SfxFrameWorkWin_Impl::ArrangeChilds_Impl( sal_Bool bForce )
if ( IsVisible_Impl() )
aBorder = Arrange_Impl();
}
-
- // Wenn das aktuelle Dokument der Applikation einen IPClient enth"alt, mu\s
- // dem dazugeh"origen Objekt durch SetTopToolFramePixel der zur Verf"ugung
- // stehende Platz zugeteilt werden. Das Objekt zeigt dann seine UITools an
- // und setzt den App-Border(->SfxInPlaceEnv_Impl::ArrangeChilds_Impl()).
- // Anderenfalls wird hier direkt der AppBorder gesetzt, um evtl. den Border
- // zu "uberschreiben, den bisher ein Objekt aus einem anderen Dokument
- // gesetzt hatte.
- // Das Objekt setzt, wenn es seine UI-Tools wegnimmt, den SetAppBorder nicht,
- // damit kein ObjectBar-Zappeln entsteht.
+ // If the current application document contains a IPClient, then the
+ // object through SetTopToolFramePixel has to be assigned the available
+ // space. The object will then point to its UITools and sets the app border
+ // (-> SfxInPlaceEnv_Impl:: ArrangeChilds_Impl ()). Otherwise the
+ // app border is set here directly to possibly overwrite the Border that
+ // was set by an object from another document. The object does not set
+ // the SetAppBorder when it removes its UI tools so that no-dithering
+ // ObjectBar arises.
// (->SfxInPlaceEnv_Impl::ArrangeChilds_Impl())
pMasterFrame->SetToolSpaceBorderPixel_Impl( aBorder );
@@ -856,13 +840,12 @@ void SfxFrameWorkWin_Impl::ArrangeChilds_Impl( sal_Bool bForce )
SvBorder SfxWorkWindow::Arrange_Impl()
-/* [Beschreibung]
-
- Diese Methode ordnet alle sichtbaren ChildFenster so an, da\s die angedockten
- Fenster nach der Sorierreihenfolge von au\sen nach innen aneinander
- gesetzt werden. Wenn ein an sich sichtbares Fenster nicht mehr in die
- noch freie ClientArea pa\st, wird es auf "nicht sichtbar" gesetzt.
+/* [Description]
+ This method organizes all visible child windows so that the docked window
+ sorted in order from the outside to the inside are placed after one
+ another. If a visible window does not fit anymore into the free
+ ClientArea, it is set to "not visible".
*/
{
DBG_CHKTHIS(SfxWorkWindow, 0);
@@ -887,10 +870,10 @@ SvBorder SfxWorkWindow::Arrange_Impl()
if ( !pCli->pWin )
continue;
- // Zun"achst nehmen wir an, da\s das Fenster Platz hat
+ // First, we assume that there is room for the window.
pCli->nVisible |= CHILD_FITS_IN;
- // Nicht sichtbare Fenster "uberspringen
+ // Skip invisiable windows
if (pCli->nVisible != CHILD_VISIBLE)
continue;
@@ -1007,8 +990,7 @@ SvBorder SfxWorkWindow::Arrange_Impl()
}
//--------------------------------------------------------------------
-// Close-Handler: die Konfiguration der ChildWindows wird gespeichert.
-//
+// Close-Handler: The Configuration of the ChildWindows is saved.
void SfxWorkWindow::Close_Impl()
{
@@ -1045,7 +1027,7 @@ SfxChild_Impl* SfxWorkWindow::RegisterChild_Impl( Window& rWindow,
SfxChildAlignment eAlign, sal_Bool bCanGetFocus )
{
DBG_CHKTHIS(SfxWorkWindow, 0);
- DBG_ASSERT( pChilds->Count() < 255, "too many childs" );
+ DBG_ASSERT( pChilds->Count() < 255, "too many children" );
DBG_ASSERT( SfxChildAlignValid(eAlign), "invalid align" );
DBG_ASSERT( !FindChild_Impl(rWindow), "child registered more than once" );
@@ -1070,7 +1052,6 @@ void SfxWorkWindow::AlignChild_Impl( Window& rWindow,
SfxChildAlignment eAlign )
{
DBG_CHKTHIS(SfxWorkWindow, 0);
-// DBG_ASSERT( pChilds, "aligning unregistered child" );
DBG_ASSERT( SfxChildAlignValid(eAlign), "invalid align" );
SfxChild_Impl *pChild = FindChild_Impl(rWindow);
@@ -1084,7 +1065,7 @@ void SfxWorkWindow::AlignChild_Impl( Window& rWindow,
pChild->bResize = sal_True;
}
else {
- DBG_ERROR( "aligning unregistered child" );
+ OSL_FAIL( "aligning unregistered child" );
}
}
@@ -1093,7 +1074,6 @@ void SfxWorkWindow::AlignChild_Impl( Window& rWindow,
void SfxWorkWindow::ReleaseChild_Impl( Window& rWindow )
{
DBG_CHKTHIS(SfxWorkWindow, 0);
-// DBG_ASSERT( pChilds, "releasing unregistered child" );
SfxChild_Impl *pChild = 0;
sal_uInt16 nPos;
@@ -1113,7 +1093,7 @@ void SfxWorkWindow::ReleaseChild_Impl( Window& rWindow )
delete pChild;
}
else {
- DBG_ERROR( "releasing unregistered child" );
+ OSL_FAIL( "releasing unregistered child" );
}
}
@@ -1294,11 +1274,10 @@ void SfxWorkWindow::SetObjectBar_Impl( sal_uInt16 nPos, sal_uInt32 nResId,
bool SfxWorkWindow::KnowsObjectBar_Impl( sal_uInt16 nPos ) const
-/* [Beschreibung]
+/* [Description]
- Stellt fest, ob an der betreffenden Position "uberhaupt eine
- Objektleiste zur Verf"ugung stehen w"urde. Ist unabh"agig davon,
- ob diese tats"achlich ein- oder ausgeschaltet ist.
+ Determines if a object list is available at the position in question.
+ This is independent for the fact whether it is actually turned on or off.
*/
{
@@ -1356,7 +1335,6 @@ void SfxFrameWorkWin_Impl::UpdateObjectBars_Impl()
SfxWorkWindow::UpdateObjectBars_Impl();
-// if ( pTask->IsActive() )
{
pWork = pParent;
while ( pWork )
@@ -1443,8 +1421,8 @@ sal_Bool SfxWorkWindow::IsPluginMode( SfxObjectShell* pObjShell )
void SfxWorkWindow::UpdateObjectBars_Impl()
{
- // SplitWindows locken (d.h. Resize-Reaktion an den
- // DockingWindows unterdr"ucken)
+ // Lock SplitWindows (which means supressing the Resize-Reaction of the
+ // DockingWindows)
sal_uInt16 n;
for ( n=0; n<SFX_SPLITWINDOWS_MAX; n++ )
{
@@ -1453,7 +1431,7 @@ void SfxWorkWindow::UpdateObjectBars_Impl()
p->Lock();
}
- // was man so "ofters braucht, merkt man sich (spart Code und Laufzeit)
+ // you realize what is needed often (saves Code and execution time)
SFX_APP();
Reference< com::sun::star::beans::XPropertySet > xPropSet( GetFrameInterface(), UNO_QUERY );
@@ -1478,21 +1456,21 @@ void SfxWorkWindow::UpdateObjectBars_Impl()
bPluginMode = IsPluginMode( pFrame->GetObjectShell() );
}
- // "uber alle Toolboxen iterieren
+ // Iterate over all Toolboxes
xLayoutManager->lock();
for ( n = 0; n < aObjBarList.size(); ++n )
{
sal_uInt16 nId = aObjBarList[n].nId;
sal_Bool bDestroy = aObjBarList[n].bDestroy;
- // die Modi bestimmen, f"ur die die ToolBox gilt
+ // Determine the vaild mode for the ToolBox
sal_uInt16 nTbxMode = aObjBarList[n].nMode;
bool bFullScreenTbx = SFX_VISIBILITY_FULLSCREEN ==
( nTbxMode & SFX_VISIBILITY_FULLSCREEN );
nTbxMode &= ~SFX_VISIBILITY_FULLSCREEN;
nTbxMode &= ~SFX_VISIBILITY_VIEWER;
- // wird in diesem Kontext eine ToolBox gefordert?
+ // Is a ToolBox required in this context ?
bool bModesMatching = ( nUpdateMode && ( nTbxMode & nUpdateMode) == nUpdateMode );
if ( bDestroy )
{
@@ -1516,7 +1494,7 @@ void SfxWorkWindow::UpdateObjectBars_Impl()
}
else if ( nId != 0 )
{
- // ggf. Toolbox an dieser Position l"oschen
+ // Delete the Toolbox at this Position if possible
rtl::OUString aTbxId( m_aTbxTypeName );
aTbxId += GetResourceURLFromResId( aObjBarList[n].nId );
xLayoutManager->destroyElement( aTbxId );
@@ -1530,7 +1508,7 @@ void SfxWorkWindow::UpdateObjectBars_Impl()
UpdateChildWindows_Impl();
- // SplitWindows wieder ent-locken
+ // Unlock the SplitWindows again
for ( n=0; n<SFX_SPLITWINDOWS_MAX; n++ )
{
SfxSplitWindow *p = pSplit[n];
@@ -1551,7 +1529,7 @@ bool SfxWorkWindow::AllowChildWindowCreation_Impl( const SfxChildWin_Impl& i_rCW
void SfxWorkWindow::UpdateChildWindows_Impl()
{
- // alle vorhandenen oder in den Kontext gekommenen ChildWindows
+ // any current or in the context available Childwindows
for ( sal_uInt16 n=0; n<pChildWins->Count(); n++ )
{
SfxChildWin_Impl *pCW = (*pChildWins)[n];
@@ -1559,8 +1537,8 @@ void SfxWorkWindow::UpdateChildWindows_Impl()
sal_Bool bCreate = sal_False;
if ( pCW->nId && !pCW->bDisabled && (pCW->aInfo.nFlags & SFX_CHILDWIN_ALWAYSAVAILABLE || IsVisible_Impl( pCW->nVisibility ) ) )
{
- // Im Kontext ist ein geeignetes ChildWindow erlaubt;
- // ist es auch eingeschaltet ?
+ // In the context is an appropriate ChildWindow allowed;
+ // it is also turned on?
if ( pChildWin == NULL && pCW->bCreate )
{
// Internal docking is only used for embedding into another
@@ -1574,7 +1552,7 @@ void SfxWorkWindow::UpdateChildWindows_Impl()
}
else if ( !IsDockingAllowed() || bIsFullScreen ) // || !bInternalDocking )
{
- // im PresentationMode oder FullScreen nur FloatingWindows
+ // In Presentation mode or FullScreen only FloatingWindows
SfxChildAlignment eAlign;
if ( pCW->aInfo.GetExtraData_Impl( &eAlign ) )
bCreate = ( eAlign == SFX_ALIGN_NOALIGNMENT );
@@ -1585,8 +1563,8 @@ void SfxWorkWindow::UpdateChildWindows_Impl()
if ( bCreate )
bCreate = AllowChildWindowCreation_Impl( *pCW );
- // Momentan kein Fenster da, aber es ist eingeschaltet; Fenster
- // und ggf. Context erzeugen
+ // Currently, no window here, but it is enabled; windows
+ // Create window and if possible theContext
if ( bCreate )
CreateChildWin_Impl( pCW, sal_False );
@@ -1598,23 +1576,23 @@ void SfxWorkWindow::UpdateChildWindows_Impl()
}
else if ( pChildWin )
{
- // Fenster existiert schon; soll es auch sichtbar sein ?
+ // Window already exists, it should also be visible?
if ( ( !bIsFullScreen || pChildWin->GetAlignment() == SFX_ALIGN_NOALIGNMENT ) && bAllChildsVisible )
{
- // Updatemode ist kompatibel; auf jeden Fall wieder einschalten
+ // Update Mode is compatible; definitely enable it
bCreate = AllowChildWindowCreation_Impl( *pCW );
if ( bCreate )
{
if ( pCW->pCli )
{
- // Fenster ist direktes Child
+ // The window is a direct 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
+ // The window ia within a SplitWindow
((SfxDockingWindow*)pChildWin->GetWindow())->Reappear_Impl();
}
@@ -1654,21 +1632,15 @@ void SfxWorkWindow::CreateChildWin_Impl( SfxChildWin_Impl *pCW, sal_Bool bSetFoc
if ( bSetFocus )
bSetFocus = pChildWin->WantsFocus();
pChildWin->SetWorkWindow_Impl( this );
-#if 0
- // Enable-Status richtig setzen
- pChildWin->GetWindow()->EnableInput( pCW->bEnable &&
- ( pWorkWin->IsInputEnabled() /* || pChildWin->GetAlignment() == SFX_ALIGN_NOALIGNMENT */ ) );
-#endif
- // Zumindest der ExtraString wird beim Auswerten ver"andert, also neu holen
+
+ // At least the extra string is changed during the evaluation,
+ // also get it anewed
SfxChildWinInfo aInfo = pChildWin->GetInfo();
pCW->aInfo.aExtraString = aInfo.aExtraString;
pCW->aInfo.bVisible = aInfo.bVisible;
pCW->aInfo.nFlags |= aInfo.nFlags;
- // Nein !! Sonst kann man keine Fenster defaultmaessig ausschalten ( Partwindow! )
-// pCW->aInfo.bVisible = sal_True;
-
- // Erzeugung war erfolgreich
+ // The creation was successful
GetBindings().Invalidate(pCW->nId);
sal_uInt16 nPos = pChildWin->GetPosition();
@@ -1676,9 +1648,8 @@ void SfxWorkWindow::CreateChildWin_Impl( SfxChildWin_Impl *pCW, sal_Bool bSetFoc
{
DBG_ASSERT(nPos < SFX_OBJECTBAR_MAX, "Illegal objectbar position!");
if ((*pChilds)[TbxMatch(nPos)])// &&
-// pChildWin->GetAlignment() == (*pChilds)[nPos]->eAlign )
{
- // ChildWindow ersetzt ObjectBar
+ // ChildWindow replaces ObjectBar
(*pChilds)[TbxMatch(nPos)]->nVisible ^= CHILD_NOT_HIDDEN;
}
}
@@ -1690,9 +1661,8 @@ void SfxWorkWindow::CreateChildWin_Impl( SfxChildWin_Impl *pCW, sal_Bool bSetFoc
if ( pChildWin->GetAlignment() == SFX_ALIGN_NOALIGNMENT || pChildWin->GetWindow()->GetParent() == pWorkWin)
{
- // Das Fenster ist entweder nicht angedockt oder au\serhalb
- // eines SplitWindows angedockt und mu\s daher explizit als
- // Child registriert werden
+ // The window is not docked or docked outside of one split windows
+ // and must therefore be registered explicitly as a Child
pCW->pCli = RegisterChild_Impl(*(pChildWin->GetWindow()), pChildWin->GetAlignment(), pChildWin->CanGetFocus());
pCW->pCli->nVisible = CHILD_VISIBLE;
if ( pChildWin->GetAlignment() != SFX_ALIGN_NOALIGNMENT && bIsFullScreen )
@@ -1701,17 +1671,15 @@ void SfxWorkWindow::CreateChildWin_Impl( SfxChildWin_Impl *pCW, sal_Bool bSetFoc
}
else
{
- // Ein angedocktes Fenster, dessen Parent nicht das WorkWindow ist,
- // mu\s in einem SplitWindow liegen und daher nicht explizit
- // registriert werden.
- // Das passiert aber schon bei der Initialisierung des
- // SfxDockingWindows!
+ // A docked window which parent is not a WorkingWindow, must lie
+ // in a SplitWindow and thus not be explicitly registered.
+ // This happens already in the initialization of SfxDockingWindows!
}
if ( pCW->nInterfaceId != pChildWin->GetContextId() )
pChildWin->CreateContext( pCW->nInterfaceId, GetBindings() );
- // Information in der INI-Datei sichern
+ // Save the information in the INI file
SaveStatus_Impl(pChildWin, pCW->aInfo);
}
}
@@ -1721,24 +1689,7 @@ void SfxWorkWindow::RemoveChildWin_Impl( SfxChildWin_Impl *pCW )
sal_uInt16 nId = pCW->nSaveId;
SfxChildWindow *pChildWin = pCW->pWin;
- // vorhandenes Fenster geht aus dem Kontext und wird daher entfernt
- sal_uInt16 nPos = pChildWin->GetPosition();
- if (nPos != CHILDWIN_NOPOS)
- {
-/*
- // ChildWindow "uberlagert einen ObjectBar
- DBG_ASSERT(nPos < SFX_OBJECTBAR_MAX, "Illegal objectbar position!");
- if ((*pChilds)[TbxMatch(nPos)] &&
- (aObjBars[nPos].nMode & nUpdateMode) ) //&&
-// pChildWin->GetAlignment() == (*pChilds)[nPos]->eAlign )
- {
- // ObjectBar war "uberlagert; jetzt wieder anzeigen
- (*pChilds)[TbxMatch(nPos)]->nVisible ^= CHILD_NOT_HIDDEN;
- }
-*/
- }
-
- // Information in der INI-Datei sichern
+ // Save the information in the INI file
sal_uInt16 nFlags = pCW->aInfo.nFlags;
pCW->aInfo = pChildWin->GetInfo();
pCW->aInfo.nFlags |= nFlags;
@@ -1748,15 +1699,15 @@ void SfxWorkWindow::RemoveChildWin_Impl( SfxChildWin_Impl *pCW )
if ( pCW->pCli )
{
- // ChildWindow ist ein direktes ChildWindow und mu\s sich daher
- // beim WorkWindow abmelden
+ // Child window is a direct child window and must therefore unregister
+ // itself from the WorkWindow
pCW->pCli = 0;
ReleaseChild_Impl(*pChildWin->GetWindow());
}
else
{
- // ChildWindow liegt in einem SplitWindow und meldet sich
- // selbst im dtor dort ab
+ // ChildWindow is within a SplitWindow and unregister itself in
+ // the destructor.
}
pWorkWin->GetSystemWindow()->GetTaskPaneList()->RemoveWindow( pChildWin->GetWindow() );
@@ -1798,7 +1749,8 @@ void SfxWorkWindow::SetTempStatusBar_Impl( sal_Bool bSet )
aStatBar.bTemp = bSet;
if ( !bOn || bReset || (!bSet && aStatBar.nId ) )
{
- // Nur was tun, wenn die Temp-Einstellung wirklich was bewirkt
+ // Just do something if the temp settings really are causing
+ // anything
UpdateStatusBar_Impl();
ArrangeChilds_Impl();
ShowChilds_Impl();
@@ -1817,42 +1769,25 @@ void SfxWorkWindow::UpdateStatusBar_Impl()
Any aValue = xPropSet->getPropertyValue( m_aLayoutManagerPropName );
aValue >>= xLayoutManager;
- // keine Statusleiste, wenn keine Id gew"unscht oder bei FullScreenView
- // oder wenn ausgeschaltet
+ // No status bar, if no ID is required or when in FullScreenView or
+ // if disabled
if ( aStatBar.nId && IsDockingAllowed() && bInternalDockingAllowed && bShowStatusBar &&
( (aStatBar.bOn && !bIsFullScreen) || aStatBar.bTemp ) )
{
- // Id hat sich ge"andert, also passenden Statusbarmanager erzeugen,
- // dieser "ubernimmt die aktuelle Statusleiste;
+ // Id has changed, thus create a suitable Statusbarmanager, this takes
+ // over the current status bar;
if ( xLayoutManager.is() )
xLayoutManager->requestElement( m_aStatusBarResName );
}
else
{
- // Aktuelle StatusBar vernichten
- // Der Manager erzeugt die Statusleiste nur, er zerst"ort sie
- // nicht !
+ // Destroy the current StatusBar
+ // The Manager only creates the Status bar, does not destroy it.
if ( xLayoutManager.is() )
xLayoutManager->destroyElement( m_aStatusBarResName );
}
}
-//------------------------------------------------------------------------
-/*
-void SfxWorkWindow::SetObjectBarVisibility_Impl( sal_uInt16 nMask )
-{
- switch( nMask )
- {
- case SFX_VISIBILITY_UNVISIBLE:
- case SFX_VISIBILITY_STANDARD:
- case SFX_VISIBILITY_CLIENT:
- case SFX_VISIBILITY_SERVER:
- nOrigMode = nMask;
- }
- if (nMask != nUpdateMode)
- nUpdateMode = nMask;
-}*/
-
void SfxWorkWindow::MakeVisible_Impl( sal_Bool bVis )
{
if ( bVis )
@@ -1997,14 +1932,13 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild,
if ( nPos == USHRT_MAX )
return;
-// SfxChild_Impl *pChild = (*pChilds)[nPos];
Rectangle aOuterRect( GetTopRect_Impl() );
aOuterRect.SetPos( pWorkWin->OutputToScreenPixel( aOuterRect.TopLeft() ));
Rectangle aInnerRect( aOuterRect );
sal_Bool bTbx = (eChild == SFX_CHILDWIN_OBJECTBAR);
- // Das gerade betroffene Fenster wird bei der Berechnung des
- // inneren Rechtecks mit eingeschlossen!
+ // The current affected window is included in the calculation of
+ // the inner rectangle!
for ( sal_uInt16 m=0; m<aSortedList.Count(); ++m )
{
sal_uInt16 i=aSortedList[m];
@@ -2015,93 +1949,89 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild,
switch ( pCli->eAlign )
{
case SFX_ALIGN_TOP:
- // Objekt-Toolboxen kommen immer zuletzt
- //if ( bTbx || i <= nPos)
+ // Objekt-Toolboxes come always last
aInnerRect.Top() += pCli->aSize.Height();
break;
case SFX_ALIGN_TOOLBOXTOP:
- // Toolbox geht nur vor, wenn nicht h"ohere Position
+ // Toolbox has priority, if no higher Position
if ( bTbx && i <= nPos)
aInnerRect.Top() += pCli->aSize.Height();
break;
case SFX_ALIGN_HIGHESTTOP:
- // Geht immer vor
+ // Always performed first
aInnerRect.Top() += pCli->aSize.Height();
break;
case SFX_ALIGN_LOWESTTOP:
- // Wird nur mitgez"ahlt, wenn es das aktuelle Fenster ist
+ // Is only counted if it is the current window
if ( i == nPos )
aInnerRect.Top() += pCli->aSize.Height();
break;
case SFX_ALIGN_BOTTOM:
- // Objekt-Toolboxen kommen immer zuletzt
- //if ( bTbx || i <= nPos)
+ // Objekt-Toolboxes come always last
aInnerRect.Bottom() -= pCli->aSize.Height();
break;
case SFX_ALIGN_TOOLBOXBOTTOM:
- // Toolbox geht nur vor, wenn nicht h"ohere Position
+ // Toolbox has priority, if no higher Position
if ( bTbx && i <= nPos)
aInnerRect.Bottom() -= pCli->aSize.Height();
break;
case SFX_ALIGN_LOWESTBOTTOM:
- // Geht immer vor
+ // Always performed first
aInnerRect.Bottom() -= pCli->aSize.Height();
break;
case SFX_ALIGN_HIGHESTBOTTOM:
- // Wird nur mitgez"ahlt, wenn es das aktuelle Fenster ist
+ // Is only counted if it is the current window
if ( i == nPos )
aInnerRect.Bottom() -= pCli->aSize.Height();
break;
case SFX_ALIGN_LEFT:
- // Toolboxen kommen immer zuletzt
- //if (bTbx || i <= nPos)
+ // Toolboxes come always last
aInnerRect.Left() += pCli->aSize.Width();
break;
case SFX_ALIGN_TOOLBOXLEFT:
- // Toolboxen kommen immer zuletzt
+ // Toolboxes come always last
if (bTbx && i <= nPos)
aInnerRect.Left() += pCli->aSize.Width();
break;
case SFX_ALIGN_FIRSTLEFT:
- // Geht immer vor
+ // Always performed first
aInnerRect.Left() += pCli->aSize.Width();
break;
case SFX_ALIGN_LASTLEFT:
- // Wird nur mitgez"ahlt, wenn es das aktuelle Fenster ist
+ // Is only counted if it is the current window
if (i == nPos)
aInnerRect.Left() += pCli->aSize.Width();
case SFX_ALIGN_RIGHT:
- // Toolboxen kommen immer zuletzt
- //if (bTbx || i <= nPos)
+ // Toolboxes come always last
aInnerRect.Right() -= pCli->aSize.Width();
break;
case SFX_ALIGN_TOOLBOXRIGHT:
- // Toolboxen kommen immer zuletzt
+ // Toolboxes come always last
if (bTbx && i <= nPos)
aInnerRect.Right() -= pCli->aSize.Width();
break;
case SFX_ALIGN_FIRSTRIGHT:
- // Wird nur mitgez"ahlt, wenn es das aktuelle Fenster ist
+ // Is only counted if it is the current window
if (i == nPos)
aInnerRect.Right() -= pCli->aSize.Width();
break;
case SFX_ALIGN_LASTRIGHT:
- // Geht immer vor
+ // Always performed first
aInnerRect.Right() -= pCli->aSize.Width();
break;
@@ -2162,7 +2092,6 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild,
}
}
-
//--------------------------------------------------------------------
void SfxWorkWindow::SetChildWindowVisible_Impl( sal_uInt32 lId, sal_Bool bEnabled, sal_uInt16 nMode )
@@ -2173,14 +2102,14 @@ void SfxWorkWindow::SetChildWindowVisible_Impl( sal_uInt32 lId, sal_Bool bEnable
SfxChildWin_Impl *pCW=NULL;
SfxWorkWindow *pWork = pParent;
- // Den obersten parent nehmen; ChildWindows werden immer am WorkWindow
- // der Task bzw. des Frames oder am AppWorkWindow angemeldet
+ // Get the top parent, child windows are alwas registered at the
+ // task of the WorkWindow for example the frame or on AppWorkWindow
while ( pWork && pWork->pParent )
pWork = pWork->pParent;
if ( pWork )
{
- // Dem Parent schon bekannt ?
+ // The Parent already known?
sal_uInt16 nCount = pWork->pChildWins->Count();
for (sal_uInt16 n=0; n<nCount; n++)
if ((*pWork->pChildWins)[n]->nSaveId == nId)
@@ -2192,7 +2121,7 @@ void SfxWorkWindow::SetChildWindowVisible_Impl( sal_uInt32 lId, sal_Bool bEnable
if ( !pCW )
{
- // Kein Parent oder dem Parent noch unbekannt, dann bei mir suchen
+ // If no Parent or the Parent us still unknown, then search here
sal_uInt16 nCount = pChildWins->Count();
for (sal_uInt16 n=0; n<nCount; n++)
if ((*pChildWins)[n]->nSaveId == nId)
@@ -2204,8 +2133,8 @@ void SfxWorkWindow::SetChildWindowVisible_Impl( sal_uInt32 lId, sal_Bool bEnable
if ( !pCW )
{
- // Ist neu, also initialisieren; je nach Flag beim Parent oder bei
- // mir eintragen
+ // If new, then initialize, add this here depending on the flag or
+ // the Parent
pCW = new SfxChildWin_Impl( lId );
pCW->nId = nId;
InitializeChild_Impl( pCW );
@@ -2220,16 +2149,11 @@ void SfxWorkWindow::SetChildWindowVisible_Impl( sal_uInt32 lId, sal_Bool bEnable
pCW->nInterfaceId = nInter;
pCW->nVisibility = nMode;
pCW->bEnable = bEnabled;
-#if 0
- if ( pCW->pWin )
- pCW->pWin->GetWindow()->EnableInput( bEnabled &&
- ( pWorkWin->IsInputEnabled() /* || pCW->pWin->GetAlignment() == SFX_ALIGN_NOALIGNMENT */ ) );
-#endif
pCW->nVisibility = nMode;
}
//--------------------------------------------------------------------
-// Der An/Aus-Status eines ChildWindows wird umgeschaltet.
+// The on/of-Status of a ChildWindows is switched
void SfxWorkWindow::ToggleChildWindow_Impl(sal_uInt16 nId, sal_Bool bSetFocus)
{
@@ -2241,7 +2165,7 @@ void SfxWorkWindow::ToggleChildWindow_Impl(sal_uInt16 nId, sal_Bool bSetFocus)
if ( n<nCount )
{
- // Das Fenster ist schon bekannt
+ // The Window is aleady known
SfxChildWin_Impl *pCW = (*pChildWins)[n];
SfxChildWindow *pChild = pCW->pWin;
@@ -2268,7 +2192,7 @@ void SfxWorkWindow::ToggleChildWindow_Impl(sal_uInt16 nId, sal_Bool bSetFocus)
}
else
{
- // Fenster soll ausgeschaltet werdem
+ // The Window should be switched off
pChild->SetVisible_Impl( sal_False );
RemoveChildWin_Impl( pCW );
}
@@ -2331,11 +2255,11 @@ void SfxWorkWindow::ToggleChildWindow_Impl(sal_uInt16 nId, sal_Bool bSetFocus)
if ( n < nCount )
{
- DBG_ERROR("ChildWindow ist nicht im Kontext!");
+ OSL_FAIL("The ChildWindow is not in context!");
}
else
{
- DBG_ERROR("ChildWindow ist nicht registriert!");
+ OSL_FAIL("The ChildWindow is not registered!");
}
#endif
}
@@ -2368,14 +2292,14 @@ sal_Bool SfxWorkWindow::IsFloating( sal_uInt16 nId )
SfxChildWin_Impl *pCW=NULL;
SfxWorkWindow *pWork = pParent;
- // Den obersten parent nehmen; ChildWindows werden immer am WorkWindow
- // der Task bzw. des Frames oder am AppWorkWindow angemeldet
+ // Get the top parent, child windows are alwas registered at the
+ // task of the WorkWindow for example the frame or on AppWorkWindow
while ( pWork && pWork->pParent )
pWork = pWork->pParent;
if ( pWork )
{
- // Dem Parent schon bekannt ?
+ // The Parent already known?
sal_uInt16 nCount = pWork->pChildWins->Count();
for (sal_uInt16 n=0; n<nCount; n++)
if ((*pWork->pChildWins)[n]->nSaveId == nId)
@@ -2387,7 +2311,7 @@ sal_Bool SfxWorkWindow::IsFloating( sal_uInt16 nId )
if ( !pCW )
{
- // Kein Parent oder dem Parent noch unbekannt, dann bei mir suchen
+ // If no Parent or the Parent us still unknown, then search here
sal_uInt16 nCount = pChildWins->Count();
for (sal_uInt16 n=0; n<nCount; n++)
if ((*pChildWins)[n]->nSaveId == nId)
@@ -2399,8 +2323,8 @@ sal_Bool SfxWorkWindow::IsFloating( sal_uInt16 nId )
if ( !pCW )
{
- // Ist neu, also initialisieren; je nach Flag beim Parent oder bei
- // mir eintragen
+ // If new, then initialize, add this here depending on the flag or
+ // the Parent
pCW = new SfxChildWin_Impl( nId );
pCW->bEnable = sal_False;
pCW->nId = 0;
@@ -2452,14 +2376,14 @@ void SfxWorkWindow::SetChildWindow_Impl(sal_uInt16 nId, sal_Bool bOn, sal_Bool b
SfxChildWin_Impl *pCW=NULL;
SfxWorkWindow *pWork = pParent;
- // Den obersten parent nehmen; ChildWindows werden immer am WorkWindow
- // der Task bzw. des Frames oder am AppWorkWindow angemeldet
+ // Get the top parent, child windows are alwas registered at the
+ // task of the WorkWindow for example the frame or on AppWorkWindow
while ( pWork && pWork->pParent )
pWork = pWork->pParent;
if ( pWork )
{
- // Dem Parent schon bekannt ?
+ // The Parent already known?
sal_uInt16 nCount = pWork->pChildWins->Count();
for (sal_uInt16 n=0; n<nCount; n++)
if ((*pWork->pChildWins)[n]->nSaveId == nId)
@@ -2471,7 +2395,7 @@ void SfxWorkWindow::SetChildWindow_Impl(sal_uInt16 nId, sal_Bool bOn, sal_Bool b
if ( !pCW )
{
- // Kein Parent oder dem Parent noch unbekannt, dann bei mir suchen
+ // If no Parent or the Parent us still unknown, then search here
sal_uInt16 nCount = pChildWins->Count();
for (sal_uInt16 n=0; n<nCount; n++)
if ((*pChildWins)[n]->nSaveId == nId)
@@ -2484,8 +2408,8 @@ void SfxWorkWindow::SetChildWindow_Impl(sal_uInt16 nId, sal_Bool bOn, sal_Bool b
if ( !pCW )
{
- // Ist neu, also initialisieren; je nach Flag beim Parent oder bei
- // mir eintragen
+ // If new, then initialize, add this here depending on the flag or
+ // the Parent
pCW = new SfxChildWin_Impl( nId );
InitializeChild_Impl( pCW );
if ( !pWork || pCW->aInfo.nFlags & SFX_CHILDWIN_TASK )
@@ -2576,11 +2500,11 @@ void SfxWorkWindow::ShowChildWindow_Impl(sal_uInt16 nId, sal_Bool bVisible, sal_
if ( n<nCount )
{
- DBG_ERROR("ChildWindow ist nicht im Kontext!");
+ OSL_FAIL("The ChildWindow is not in context!");
}
else
{
- DBG_ERROR("ChildWindow ist nicht registriert!");
+ OSL_FAIL("The ChildWindow is not registered");
}
#endif
}
@@ -2606,9 +2530,6 @@ SfxChildWindow* SfxWorkWindow::GetChildWindow_Impl(sal_uInt16 nId)
void SfxWorkWindow::ResetChildWindows_Impl()
{
-// if ( pParent )
-// pParent->ResetChildWindows_Impl();
-
for ( sal_uInt16 n = 0; n < pChildWins->Count(); ++n )
{
(*pChildWins)[n]->nId = 0;
@@ -2617,9 +2538,8 @@ void SfxWorkWindow::ResetChildWindows_Impl()
}
//------------------------------------------------------------------------
-// Virtuelle Methode, die die Gr"o\se der Fl"ache (client area) des parent
-// windows liefert, in der Child-Fenster angeordnet werden k"onnen.
-// in der ClientArea des parent findet.
+// Virtual method that returns the size of the area (client area) of the
+// parent windows, in which the ChildWindow can be fitted.
Rectangle SfxWorkWindow::GetTopRect_Impl()
{
@@ -2627,9 +2547,8 @@ Rectangle SfxWorkWindow::GetTopRect_Impl()
}
//------------------------------------------------------------------------
-// Virtuelle Methode, die die Gr"o\se der Fl"ache (client area) des parent
-// windows liefert, in der Child-Fenster angeordnet werden k"onnen.
-// in der ClientArea des parent findet.
+// Virtual method that returns the size of the area (client area) of the
+// parent windows, in which the ChildWindow can be fitted.
Rectangle SfxFrameWorkWin_Impl::GetTopRect_Impl()
{
@@ -2637,8 +2556,8 @@ Rectangle SfxFrameWorkWin_Impl::GetTopRect_Impl()
}
//------------------------------------------------------------------------
-// Virtuelle Methode, um herauszufinden, ob ein Child-Fenster noch Platz
-// in der ClientArea des parent findet.
+// Virtual method to find out if there is room for a ChildWindow in the
+// client area of the parent.
sal_Bool SfxWorkWindow::RequestTopToolSpacePixel_Impl( SvBorder aBorder )
{
@@ -2652,7 +2571,7 @@ sal_Bool SfxWorkWindow::RequestTopToolSpacePixel_Impl( SvBorder aBorder )
void SfxWorkWindow::SaveStatus_Impl(SfxChildWindow *pChild, const SfxChildWinInfo &rInfo)
{
- // Den Status vom Presentation mode wollen wir nicht sichern
+ // The Status of the Presentation mode is not saved
if ( IsDockingAllowed() && bInternalDockingAllowed )
pChild->SaveStatus(rInfo);
}
@@ -2718,11 +2637,6 @@ void SfxWorkWindow::InitializeChild_Impl(SfxChildWin_Impl *pCW)
}
}
}
-/*
-SfxStatBar_Impl* SfxWorkWindow::GetStatusBar_Impl()
-{
- return &aStatBar;
-} */
SfxSplitWindow* SfxWorkWindow::GetSplitWindow_Impl( SfxChildAlignment eAlign )
{
@@ -2815,11 +2729,10 @@ void SfxWorkWindow::ArrangeAutoHideWindows( SfxSplitWindow *pActSplitWin )
Rectangle aArea( aUpperClientArea );
for ( sal_uInt16 n=0; n<SFX_SPLITWINDOWS_MAX; n++ )
{
- // Es werden entweder Dummyfenster oder Fenster im AutoShow-Modus
- // ( nicht gepinned, FadeIn ) behandelt.
- // Nur das "ubergebene Fenster darf unsichtbar sein, denn vielleicht
- // soll daf"ur gerade die Gr"o\se berechnet werden, bevor es angezeigt
- // wird.
+ // Either dummy window or window in the auto-show-mode are processed
+ // (not pinned, FadeIn).
+ // Only the abandoned window may be invisible, because perhaps its
+ // size is just beeing calculated before it is displayed.
SfxSplitWindow* pSplitWin = pSplit[n];
sal_Bool bDummyWindow = !pSplitWin->IsFadeIn();
Window *pDummy = pSplitWin->GetSplitWindow();
@@ -2827,7 +2740,7 @@ void SfxWorkWindow::ArrangeAutoHideWindows( SfxSplitWindow *pActSplitWin )
if ( (pSplitWin->IsPinned() && !bDummyWindow) || (!pWin->IsVisible() && pActSplitWin != pSplitWin) )
continue;
- // Breite und Position des Dummy-Fensters als Ausgangspunkt
+ // Width and position of the dummy window as a starting point
Size aSize = pDummy->GetSizePixel();
Point aPos = pDummy->GetPosPixel();
@@ -2835,13 +2748,13 @@ void SfxWorkWindow::ArrangeAutoHideWindows( SfxSplitWindow *pActSplitWin )
{
case ( 0 ) :
{
- // Linkes SplitWindow
- // Breite vom Fenster selbst holen, wenn nicht das DummyWindow
+ // Left SplitWindow
+ // Get the width of the Window yourself, if no DummyWindow
if ( !bDummyWindow )
aSize.Width() = pSplitWin->GetSizePixel().Width();
- // Wenn links ein Window sichtbar ist, beginnt der freie
- // Bereich rechts davon bzw. bei der Client area
+ // If a Window is visable to the left, then the free region
+ // starts to the right from it, for example at the Client area
long nLeft = aPos.X() + aSize.Width();
if ( nLeft > aArea.Left() )
aArea.Left() = nLeft;
@@ -2849,26 +2762,26 @@ void SfxWorkWindow::ArrangeAutoHideWindows( SfxSplitWindow *pActSplitWin )
}
case ( 1 ) :
{
- // Rechtes SplitWindow
- // Position um Differenz der Breiten korrigieren
+ // Right SplitWindow
+ // Position to correct the difference of the widths
aPos.X() += aSize.Width();
- // Breite vom Fenster selbst holen, wenn nicht das DummyWindow
+ // Get the width of the Window yourself, if no DummyWindow
if ( !bDummyWindow )
aSize.Width() = pSplitWin->GetSizePixel().Width();
aPos.X() -= aSize.Width();
- // Wenn links schon ein Fenster aufgeklappt ist, darf
- // das rechte nicht dar"uber gehen
+ // If already a window is opened at the left side, then the
+ // right is not allowed to overlap this one.
if ( aPos.X() < aArea.Left() )
{
aPos.X() = aArea.Left();
aSize.Width() = aArea.GetWidth();
}
- // Wenn rechts ein Window sichtbar ist, endet der freie
- // Bereich links davon bzw. bei der Client area
+ // If a Window is visable to the right, then the free region
+ // starts to the left from it, for example at the Client area
long nRight = aPos.X();
if ( nRight < aArea.Right() )
aArea.Right() = nRight;
@@ -2876,18 +2789,19 @@ void SfxWorkWindow::ArrangeAutoHideWindows( SfxSplitWindow *pActSplitWin )
}
case ( 2 ) :
{
- // Oberes SplitWindow
- // H"ohe vom Fenster selbst holen, wenn nicht das DummyWindow
+ // Top SplitWindow
+ // Get the height of the Window yourself, if no DummyWindow
if ( !bDummyWindow )
aSize.Height() = pSplitWin->GetSizePixel().Height();
- // Breite anpassen, je nachdem ob links oder rechts
- // schon ein Fenster aufgeklappt ist
+
+ // Adjust width with regard to if a Window is already open
+ // to the left or right
aPos.X() = aArea.Left();
aSize.Width() = aArea.GetWidth();
- // Wenn oben ein Window sichtbar ist, beginnt der freie
- // Bereich darunter bzw. bei der Client Area
+ // If a Window is visable at the top, then the free region
+ // starts beneath it, for example at the Client area
long nTop = aPos.Y() + aSize.Height();
if ( nTop > aArea.Top() )
aArea.Top() = nTop;
@@ -2895,23 +2809,23 @@ void SfxWorkWindow::ArrangeAutoHideWindows( SfxSplitWindow *pActSplitWin )
}
case ( 3 ) :
{
- // Das untere SplitWindow
- // Position um Differenz der H"ohen korrigieren
+ // The bottom SplitWindow
+ // Position to correct the difference of the heights
aPos.Y() += aSize.Height();
- // H"ohe vom Fenster selbst holen, wenn nicht das DummmyWindow
+ // Get the height of the Window yourself, if no DummyWindow
if ( !bDummyWindow )
aSize.Height() = pSplitWin->GetSizePixel().Height();
aPos.Y() -= aSize.Height();
- // Breite anpassen, je nachdem ob links oder rechts
- // schon ein Fenster aufgeklappt ist
+ // Adjust width with regard to if a Window is already open
+ // to the left or right.
aPos.X() = aArea.Left();
aSize.Width() = aArea.GetWidth();
- // Wenn oben schon ein Fenster aufgeklappt ist, darf
- // das untere nicht dar"uber gehen
+ // If already a window is opened at the top, then the
+ // bottom one is not allowed to overlap this one.
if ( aPos.Y() < aArea.Top() )
{
aPos.Y() = aArea.Top();
@@ -2923,11 +2837,11 @@ void SfxWorkWindow::ArrangeAutoHideWindows( SfxSplitWindow *pActSplitWin )
}
if ( !bDummyWindow )
- // Das FadeIn-Window ist ein Float, dessen Koordinaten in
- // Screenkoordinaten gesetzt werden
+ // the FadeIn-Window is a Floating window, which coordinates are
+ // set in Screen coordinates.
pSplitWin->SetPosSizePixel( pWorkWin->OutputToScreenPixel(aPos), aSize );
else
- // Das angedockte DummyWindow
+ // the docked DummyWindow
pDummy->SetPosSizePixel( aPos, aSize );
}
}
@@ -3010,7 +2924,7 @@ Window* SfxWorkWindow::GetActiveChild_Impl()
sal_Bool SfxWorkWindow::ActivateNextChild_Impl( sal_Bool bForward )
{
- // Alle Kinder gem"a\s Liste sortieren
+ // Sort all children under list
SvUShorts aList;
for ( sal_uInt16 i=SFX_OBJECTBAR_MAX; i<pChilds->Count(); i++)
{
@@ -3040,7 +2954,7 @@ sal_Bool SfxWorkWindow::ActivateNextChild_Impl( sal_Bool bForward )
SfxChild_Impl *pAct=NULL;
if ( pActiveChild )
{
- // Das aktive Fenster suchen
+ // Look for the active window
for ( n=0; n<aList.Count(); n++ )
{
SfxChild_Impl* pCli = (*pChilds)[aList[n]];
@@ -3060,7 +2974,7 @@ sal_Bool SfxWorkWindow::ActivateNextChild_Impl( sal_Bool bForward )
{
for ( sal_uInt16 i=0; i<SFX_SPLITWINDOWS_MAX; i++ )
{
- // Eventuell ist pAct ein Splitwindow
+ // Maybe the pNext is a Splitwindow
SfxSplitWindow *p = pSplit[i];
if ( pAct->pWin == p )
{
@@ -3070,8 +2984,8 @@ sal_Bool SfxWorkWindow::ActivateNextChild_Impl( sal_Bool bForward )
}
}
- // pAct ist ein direktes ChildWindow
- // mit dem Nachfolger bzw. Vorg"anger des aktiven Fensters weitermachen
+ // pAct is a direct ChildWindow
+ // continue with the successor or predecessor of the active window
if ( bForward )
n = n+1;
else
@@ -3089,11 +3003,11 @@ sal_Bool SfxWorkWindow::ActivateNextChild_Impl( sal_Bool bForward )
SfxChild_Impl* pNext = pCli;
for ( sal_uInt16 i=0; n<SFX_SPLITWINDOWS_MAX; n++ )
{
- // Eventuell ist pNext ein Splitwindow
+ // Maybe the pNext is a Splitwindow
SfxSplitWindow *p = pSplit[i];
if ( pNext->pWin == p )
{
- // Das erste/letzte Fenster dort aktivieren
+ // Activate the first/last window
p->SetActiveWindow_Impl( NULL );
pNext = NULL;
if( p->ActivateNextChild_Impl( bForward ) )
@@ -3140,3 +3054,4 @@ void SfxWorkWindow::DataChanged_Impl( const DataChangedEvent& )
ArrangeChilds_Impl();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/xpackcreator.cxx b/sfx2/source/appl/xpackcreator.cxx
index 6e6606a67041..17a27c6c8ce9 100644
--- a/sfx2/source/appl/xpackcreator.cxx
+++ b/sfx2/source/appl/xpackcreator.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,15 +48,15 @@ using namespace ::com::sun::star;
uno::Sequence< ::rtl::OUString > SAL_CALL OPackageStructureCreator::impl_getStaticSupportedServiceNames()
{
uno::Sequence< ::rtl::OUString > aRet(2);
- aRet[0] = ::rtl::OUString::createFromAscii("com.sun.star.embed.PackageStructureCreator");
- aRet[1] = ::rtl::OUString::createFromAscii("com.sun.star.comp.embed.PackageStructureCreator");
+ aRet[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.PackageStructureCreator"));
+ aRet[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.embed.PackageStructureCreator"));
return aRet;
}
//-------------------------------------------------------------------------
::rtl::OUString SAL_CALL OPackageStructureCreator::impl_getStaticImplementationName()
{
- return ::rtl::OUString::createFromAscii("com.sun.star.comp.embed.PackageStructureCreator");
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.embed.PackageStructureCreator"));
}
//-------------------------------------------------------------------------
@@ -200,3 +201,4 @@ uno::Sequence< ::rtl::OUString > SAL_CALL OPackageStructureCreator::getSupported
return impl_getStaticSupportedServiceNames();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/xpackcreator.hxx b/sfx2/source/appl/xpackcreator.hxx
index ff3b84dbec64..03ef58e27e03 100644
--- a/sfx2/source/appl/xpackcreator.hxx
+++ b/sfx2/source/appl/xpackcreator.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -73,3 +74,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */