View | Details | Raw Unified | Return to issue 86384
Collapse All | Expand All

(-)inc/app.hxx (-2 lines)
Lines 151-157 Link Here
151
            return m_aBootstrapStatus;
151
            return m_aBootstrapStatus;
152
        }        
152
        }        
153
        
153
        
154
		DECL_STATIC_LINK( Desktop, AsyncTerminate, void*);
155
		static sal_Bool         CheckOEM();
154
		static sal_Bool         CheckOEM();
156
        static sal_Bool         isCrashReporterEnabled();
155
        static sal_Bool         isCrashReporterEnabled();
157
156
Lines 225-231 Link Here
225
		sal_Bool						m_bInvisible;
224
		sal_Bool						m_bInvisible;
226
		bool                            m_bServicesRegistered;
225
		bool                            m_bServicesRegistered;
227
		USHORT							m_nAppEvents;
226
		USHORT							m_nAppEvents;
228
		IntroWindow_Impl*				m_pIntro;
229
		BootstrapError					m_aBootstrapError;
227
		BootstrapError					m_aBootstrapError;
230
        BootstrapStatus                 m_aBootstrapStatus;
228
        BootstrapStatus                 m_aBootstrapStatus;
231
229
(-)source/app/app.cxx (-17 lines)
Lines 479-490 Link Here
479
    aBootstrapFailedBox.Execute();
479
    aBootstrapFailedBox.Execute();
480
}
480
}
481
481
482
void FatalErrorExit(OUString const & aMessage)
483
{
484
    FatalError(aMessage);
485
    _exit( ExitHelper::E_FATAL_ERROR );
486
}
487
488
static bool ShouldSuppressUI(CommandLineArgs* pCmdLine)
482
static bool ShouldSuppressUI(CommandLineArgs* pCmdLine)
489
{
483
{
490
    return  pCmdLine->IsInvisible() ||
484
    return  pCmdLine->IsInvisible() ||
Lines 607-613 Link Here
607
601
608
Desktop::Desktop()
602
Desktop::Desktop()
609
: m_bServicesRegistered( false )
603
: m_bServicesRegistered( false )
610
, m_pIntro( 0 )
611
, m_aBootstrapError( BE_OK )
604
, m_aBootstrapError( BE_OK )
612
, m_pLockfile( NULL )
605
, m_pLockfile( NULL )
613
{
606
{
Lines 2127-2142 Link Here
2127
2120
2128
// ========================================================================
2121
// ========================================================================
2129
2122
2130
IMPL_STATIC_LINK_NOINSTANCE( Desktop, AsyncTerminate, void*, EMPTYARG )
2131
{
2132
    Reference<XMultiServiceFactory> rFactory = ::comphelper::getProcessServiceFactory();
2133
    Reference< XDesktop > xDesktop( rFactory->createInstance(
2134
        OUString::createFromAscii("com.sun.star.frame.Desktop")),
2135
        UNO_QUERY );
2136
    xDesktop.is() && xDesktop->terminate();
2137
    return 0L;
2138
}
2139
2140
class ExitTimer : public Timer 
2123
class ExitTimer : public Timer 
2141
{
2124
{
2142
  public:
2125
  public:
(-)source/app/cmdlineargs.cxx (-71 / +1 lines)
Lines 118-133 Link Here
118
118
119
CommandLineArgs::Supplier::~Supplier() {}
119
CommandLineArgs::Supplier::~Supplier() {}
120
120
121
CommandLineArgs::CommandLineArgs()
122
{
123
	ResetParamValues();
124
}
125
126
// intialize class with command line parameters from process environment
121
// intialize class with command line parameters from process environment
127
CommandLineArgs::CommandLineArgs( ::vos::OExtCommandLine& aExtCmdLine )
122
CommandLineArgs::CommandLineArgs( ::vos::OExtCommandLine& aExtCmdLine )
128
{
123
{
129
	ResetParamValues();
124
	ResetParamValues();
130
    ExtCommandLineSupplier s( aExtCmdLine );
125
	ExtCommandLineSupplier s( aExtCmdLine );
131
	ParseCommandLine_Impl( s, true );
126
	ParseCommandLine_Impl( s, true );
132
}
127
}
133
128
Lines 598-611 Link Here
598
    m_eArgumentCount = NONE;
593
    m_eArgumentCount = NONE;
599
}
594
}
600
595
601
sal_Bool CommandLineArgs::GetBoolParam( BoolParam eParam ) const
602
{
603
	osl::MutexGuard  aMutexGuard( m_aMutex );
604
605
	OSL_ASSERT( ( eParam >= 0 && eParam < CMD_BOOLPARAM_COUNT ) );
606
	return m_aBoolParams[eParam];
607
}
608
609
void CommandLineArgs::SetBoolParam( BoolParam eParam, sal_Bool bNewValue )
596
void CommandLineArgs::SetBoolParam( BoolParam eParam, sal_Bool bNewValue )
610
{
597
{
611
	osl::MutexGuard  aMutexGuard( m_aMutex );
598
	osl::MutexGuard  aMutexGuard( m_aMutex );
Lines 614-635 Link Here
614
	m_aBoolParams[eParam] = bNewValue;
601
	m_aBoolParams[eParam] = bNewValue;
615
}
602
}
616
603
617
const rtl::OUString& CommandLineArgs::GetStringParam( StringParam eParam ) const
618
{
619
	osl::MutexGuard  aMutexGuard( m_aMutex );
620
621
	OSL_ASSERT( ( eParam >= 0 && eParam < CMD_STRINGPARAM_COUNT ) );
622
	return m_aStrParams[eParam];
623
}
624
625
void CommandLineArgs::SetStringParam( StringParam eParam, const rtl::OUString& aNewValue )
626
{
627
	osl::MutexGuard  aMutexGuard( m_aMutex );
628
629
	OSL_ASSERT( ( eParam >= 0 && eParam < CMD_STRINGPARAM_COUNT ) );
630
	m_aStrParams[eParam] = aNewValue;
631
}
632
633
sal_Bool CommandLineArgs::IsMinimized() const
604
sal_Bool CommandLineArgs::IsMinimized() const
634
{
605
{
635
	osl::MutexGuard  aMutexGuard( m_aMutex );
606
	osl::MutexGuard  aMutexGuard( m_aMutex );
Lines 660-671 Link Here
660
	return m_aBoolParams[ CMD_BOOLPARAM_BEAN ];
631
	return m_aBoolParams[ CMD_BOOLPARAM_BEAN ];
661
}
632
}
662
633
663
sal_Bool CommandLineArgs::IsPlugin() const
664
{
665
	osl::MutexGuard  aMutexGuard( m_aMutex );
666
	return m_aBoolParams[ CMD_BOOLPARAM_PLUGIN ];
667
}
668
669
sal_Bool CommandLineArgs::IsServer() const
634
sal_Bool CommandLineArgs::IsServer() const
670
{
635
{
671
	osl::MutexGuard  aMutexGuard( m_aMutex );
636
	osl::MutexGuard  aMutexGuard( m_aMutex );
Lines 828-847 Link Here
828
	return m_aStrSetParams[ CMD_STRINGPARAM_UNACCEPT ];
793
	return m_aStrSetParams[ CMD_STRINGPARAM_UNACCEPT ];
829
}
794
}
830
795
831
sal_Bool CommandLineArgs::GetUserDir( ::rtl::OUString& rPara) const
832
{
833
	osl::MutexGuard  aMutexGuard( m_aMutex );
834
	rPara = m_aStrParams[ CMD_STRINGPARAM_USERDIR ];
835
	return m_aStrSetParams[ CMD_STRINGPARAM_USERDIR ];
836
}
837
838
sal_Bool CommandLineArgs::GetClientDisplay( ::rtl::OUString& rPara) const
839
{
840
	osl::MutexGuard  aMutexGuard( m_aMutex );
841
	rPara = m_aStrParams[ CMD_STRINGPARAM_CLIENTDISPLAY ];
842
	return m_aStrSetParams[ CMD_STRINGPARAM_CLIENTDISPLAY ];
843
}
844
845
sal_Bool CommandLineArgs::GetOpenList( ::rtl::OUString& rPara) const
796
sal_Bool CommandLineArgs::GetOpenList( ::rtl::OUString& rPara) const
846
{
797
{
847
	osl::MutexGuard  aMutexGuard( m_aMutex );
798
	osl::MutexGuard  aMutexGuard( m_aMutex );
Lines 884-896 Link Here
884
	return m_aStrSetParams[ CMD_STRINGPARAM_PRINTLIST ];
835
	return m_aStrSetParams[ CMD_STRINGPARAM_PRINTLIST ];
885
}
836
}
886
837
887
sal_Bool CommandLineArgs::GetVersionString( ::rtl::OUString& rPara) const
888
{
889
	osl::MutexGuard  aMutexGuard( m_aMutex );
890
	rPara = m_aStrParams[ CMD_STRINGPARAM_VERSION ];
891
	return m_aStrSetParams[ CMD_STRINGPARAM_VERSION ];
892
}
893
894
sal_Bool CommandLineArgs::GetPrintToList( ::rtl::OUString& rPara ) const
838
sal_Bool CommandLineArgs::GetPrintToList( ::rtl::OUString& rPara ) const
895
{
839
{
896
	osl::MutexGuard  aMutexGuard( m_aMutex );
840
	osl::MutexGuard  aMutexGuard( m_aMutex );
Lines 905-924 Link Here
905
	return m_aStrSetParams[ CMD_STRINGPARAM_PRINTERNAME ];
849
	return m_aStrSetParams[ CMD_STRINGPARAM_PRINTERNAME ];
906
}
850
}
907
851
908
sal_Bool CommandLineArgs::GetDisplay( ::rtl::OUString& rPara ) const
909
{
910
	osl::MutexGuard  aMutexGuard( m_aMutex );
911
	rPara = m_aStrParams[ CMD_STRINGPARAM_DISPLAY ];
912
	return m_aStrSetParams[ CMD_STRINGPARAM_DISPLAY ];
913
}
914
915
sal_Bool CommandLineArgs::IsPrinting() const
916
{
917
    osl::MutexGuard  aMutexGuard( m_aMutex );
918
    return( m_aStrParams[ CMD_STRINGPARAM_PRINTLIST ].getLength() > 0 ||
919
            m_aStrParams[ CMD_STRINGPARAM_PRINTTOLIST ].getLength() > 0 );
920
}
921
922
sal_Bool CommandLineArgs::IsEmpty() const
852
sal_Bool CommandLineArgs::IsEmpty() const
923
{
853
{
924
    osl::MutexGuard  aMutexGuard( m_aMutex );
854
    osl::MutexGuard  aMutexGuard( m_aMutex );
(-)source/app/cmdlineargs.hxx (-10 lines)
Lines 128-151 Link Here
128
            virtual bool next(rtl::OUString * argument) = 0;
128
            virtual bool next(rtl::OUString * argument) = 0;
129
        };
129
        };
130
130
131
		CommandLineArgs();
132
		CommandLineArgs( ::vos::OExtCommandLine& aExtCmdLine );
131
		CommandLineArgs( ::vos::OExtCommandLine& aExtCmdLine );
133
		CommandLineArgs( Supplier& supplier );
132
		CommandLineArgs( Supplier& supplier );
134
133
135
		// generic methods to access parameter
134
		// generic methods to access parameter
136
		sal_Bool				GetBoolParam( BoolParam eParam ) const;
137
		void					SetBoolParam( BoolParam eParam, sal_Bool bNewValue );
135
		void					SetBoolParam( BoolParam eParam, sal_Bool bNewValue );
138
136
139
		const rtl::OUString&	GetStringParam( StringParam eParam ) const;
140
		void					SetStringParam( StringParam eParam, const rtl::OUString& bNewValue );
141
142
		// Access to bool parameters
137
		// Access to bool parameters
143
		sal_Bool				IsMinimized() const;
138
		sal_Bool				IsMinimized() const;
144
        sal_Bool				IsInvisible() const;
139
        sal_Bool				IsInvisible() const;
145
        sal_Bool				IsNoRestore() const;
140
        sal_Bool				IsNoRestore() const;
146
        sal_Bool				IsNoDefault() const;
141
        sal_Bool				IsNoDefault() const;
147
        sal_Bool				IsBean() const;
142
        sal_Bool				IsBean() const;
148
        sal_Bool				IsPlugin() const;
149
        sal_Bool				IsServer() const;
143
        sal_Bool				IsServer() const;
150
        sal_Bool				IsHeadless() const;
144
        sal_Bool				IsHeadless() const;
151
        sal_Bool				IsQuickstart() const;
145
        sal_Bool				IsQuickstart() const;
Lines 175-192 Link Here
175
        sal_Bool				GetPortalConnectString( ::rtl::OUString& rPara) const;
169
        sal_Bool				GetPortalConnectString( ::rtl::OUString& rPara) const;
176
        sal_Bool				GetAcceptString( ::rtl::OUString& rPara) const;
170
        sal_Bool				GetAcceptString( ::rtl::OUString& rPara) const;
177
		sal_Bool				GetUnAcceptString( ::rtl::OUString& rPara) const;
171
		sal_Bool				GetUnAcceptString( ::rtl::OUString& rPara) const;
178
        sal_Bool				GetUserDir( ::rtl::OUString& rPara) const;
179
        sal_Bool				GetClientDisplay( ::rtl::OUString& rPara) const;
180
        sal_Bool				GetOpenList( ::rtl::OUString& rPara) const;
172
        sal_Bool				GetOpenList( ::rtl::OUString& rPara) const;
181
		sal_Bool				GetViewList( ::rtl::OUString& rPara) const;
173
		sal_Bool				GetViewList( ::rtl::OUString& rPara) const;
182
        sal_Bool                GetStartList( ::rtl::OUString& rPara) const;
174
        sal_Bool                GetStartList( ::rtl::OUString& rPara) const;
183
		sal_Bool				GetForceOpenList( ::rtl::OUString& rPara) const;
175
		sal_Bool				GetForceOpenList( ::rtl::OUString& rPara) const;
184
		sal_Bool				GetForceNewList( ::rtl::OUString& rPara) const;
176
		sal_Bool				GetForceNewList( ::rtl::OUString& rPara) const;
185
        sal_Bool				GetPrintList( ::rtl::OUString& rPara) const;
177
        sal_Bool				GetPrintList( ::rtl::OUString& rPara) const;
186
        sal_Bool				GetVersionString( ::rtl::OUString& rPara) const;
187
		sal_Bool				GetPrintToList( ::rtl::OUString& rPara ) const;
178
		sal_Bool				GetPrintToList( ::rtl::OUString& rPara ) const;
188
		sal_Bool				GetPrinterName( ::rtl::OUString& rPara ) const;
179
		sal_Bool				GetPrinterName( ::rtl::OUString& rPara ) const;
189
		sal_Bool				GetDisplay( ::rtl::OUString& rPara ) const;
190
180
191
        // Special analyzed states (does not match directly to a command line parameter!)
181
        // Special analyzed states (does not match directly to a command line parameter!)
192
        sal_Bool                IsPrinting() const;
182
        sal_Bool                IsPrinting() const;
(-)source/app/cmdlinehelp.cxx (-2 / +2 lines)
Lines 166-172 Link Here
166
		aDlg.Execute();
166
		aDlg.Execute();
167
#endif
167
#endif
168
	}
168
	}
169
169
#ifndef UNX
170
	CmdlineHelpDialog::CmdlineHelpDialog (void)
170
	CmdlineHelpDialog::CmdlineHelpDialog (void)
171
	: ModalDialog( NULL, DesktopResId( DLG_CMDLINEHELP ) )
171
	: ModalDialog( NULL, DesktopResId( DLG_CMDLINEHELP ) )
172
	, m_ftHead( this, DesktopResId( TXT_DLG_CMDLINEHELP_HEADER ) )
172
	, m_ftHead( this, DesktopResId( TXT_DLG_CMDLINEHELP_HEADER ) )
Lines 177-182 Link Here
177
	{
177
	{
178
		FreeResource();
178
		FreeResource();
179
	}
179
	}
180
180
#endif
181
}
181
}
182
182
(-)source/app/cmdlinehelp.hxx (-4 / +2 lines)
Lines 11-17 Link Here
11
namespace desktop
11
namespace desktop
12
{
12
{
13
	void displayCmdlineHelp( void );
13
	void displayCmdlineHelp( void );
14
14
#ifndef UNX
15
	class CmdlineHelpDialog : public ModalDialog
15
	class CmdlineHelpDialog : public ModalDialog
16
	{
16
	{
17
	public:
17
	public:
Lines 23-29 Link Here
23
		FixedText	m_ftBottom;
23
		FixedText	m_ftBottom;
24
		OKButton	m_btOk;
24
		OKButton	m_btOk;
25
	};
25
	};
26
26
#endif
27
28
29
}
27
}
(-)source/app/intro.cxx (-125 lines)
Lines 1-126 Link Here
1
/*************************************************************************
2
 *
3
 *  OpenOffice.org - a multi-platform office productivity suite
4
 *
5
 *  $RCSfile$
6
 *
7
 *  $Revision$
8
 *
9
 *  last change: $Author$ $Date$
10
 *
11
 *  The Contents of this file are made available subject to
12
 *  the terms of GNU Lesser General Public License Version 2.1.
13
 *
14
 *
15
 *    GNU Lesser General Public License Version 2.1
16
 *    =============================================
17
 *    Copyright 2005 by Sun Microsystems, Inc.
18
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
19
 *
20
 *    This library is free software; you can redistribute it and/or
21
 *    modify it under the terms of the GNU Lesser General Public
22
 *    License version 2.1, as published by the Free Software Foundation.
23
 *
24
 *    This library is distributed in the hope that it will be useful,
25
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
26
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
27
 *    Lesser General Public License for more details.
28
 *
29
 *    You should have received a copy of the GNU Lesser General Public
30
 *    License along with this library; if not, write to the Free Software
31
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
32
 *    MA  02111-1307  USA
33
 *
34
 ************************************************************************/
35
1
36
// MARKER(update_precomp.py): autogen include statement, do not remove
37
#include "precompiled_desktop.hxx"
38
39
40
#include "intro.hxx"
41
42
#include <tools/stream.hxx>
43
#include <tools/urlobj.hxx>
44
#include <vos/process.hxx>
45
#include <rtl/logfile.hxx>
46
#ifndef _SV_SVAPP_HXX
47
#include <vcl/svapp.hxx>
48
#endif
49
50
namespace desktop
51
{
52
53
// -----------------------------------------------------------------------
54
55
void IntroWindow_Impl::Init()
56
{
57
	RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) ::IntroWindow_Impl::Init" );
58
59
	Size aSize = m_aIntroBmp.GetSizePixel();
60
	SetOutputSizePixel( aSize );
61
62
	if ( GetColorCount() >= 16 )
63
	{
64
		Show();
65
		Update();
66
	}
67
}
68
69
// -----------------------------------------------------------------------
70
71
IMPL_LINK( IntroWindow_Impl, AppEventListenerHdl, VclWindowEvent *, inEvent )
72
{
73
	if ( inEvent != 0 )
74
	{
75
		switch ( inEvent->GetId() )
76
		{
77
			case VCLEVENT_WINDOW_HIDE:
78
				Paint( Rectangle() );
79
				break;
80
81
			default:
82
				break;
83
		}
84
	}
85
	return 0;
86
}
87
88
// -----------------------------------------------------------------------
89
90
IntroWindow_Impl::IntroWindow_Impl( const Bitmap& aIntroBitmap ) :
91
	IntroWindow(),
92
	m_aIntroBmp( aIntroBitmap )
93
{
94
	RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) ::IntroWindow_Impl::IntroWindowImpl" );
95
96
	Hide();
97
98
	Init();
99
	Application::AddEventListener(
100
		LINK( this, IntroWindow_Impl, AppEventListenerHdl ) );
101
}
102
103
// -----------------------------------------------------------------------
104
105
IntroWindow_Impl::~IntroWindow_Impl()
106
{
107
	Application::RemoveEventListener(
108
		LINK( this, IntroWindow_Impl, AppEventListenerHdl ) );
109
	Hide();
110
}
111
112
// -----------------------------------------------------------------------
113
114
void IntroWindow_Impl::Paint( const Rectangle& )
115
{
116
	DrawBitmap( Point(), m_aIntroBmp );
117
	Flush();
118
}
119
120
// -----------------------------------------------------------------------
121
122
void IntroWindow_Impl::Slide()
123
{
124
}
125
126
}
(-)source/app/intro.hxx (-69 lines)
Lines 1-70 Link Here
1
/*************************************************************************
2
 *
3
 *  OpenOffice.org - a multi-platform office productivity suite
4
 *
5
 *  $RCSfile$
6
 *
7
 *  $Revision$
8
 *
9
 *  last change: $Author$ $Date$
10
 *
11
 *  The Contents of this file are made available subject to
12
 *  the terms of GNU Lesser General Public License Version 2.1.
13
 *
14
 *
15
 *    GNU Lesser General Public License Version 2.1
16
 *    =============================================
17
 *    Copyright 2005 by Sun Microsystems, Inc.
18
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
19
 *
20
 *    This library is free software; you can redistribute it and/or
21
 *    modify it under the terms of the GNU Lesser General Public
22
 *    License version 2.1, as published by the Free Software Foundation.
23
 *
24
 *    This library is distributed in the hope that it will be useful,
25
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
26
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
27
 *    Lesser General Public License for more details.
28
 *
29
 *    You should have received a copy of the GNU Lesser General Public
30
 *    License along with this library; if not, write to the Free Software
31
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
32
 *    MA  02111-1307  USA
33
 *
34
 ************************************************************************/
35
#ifndef _DESKTOP_INTRO_HXX
36
#define _DESKTOP_INTRO_HXX
37
1
38
// include ---------------------------------------------------------------
39
40
#ifndef _SV_WRKWIN_HXX
41
#include <vcl/introwin.hxx>
42
#endif
43
#ifndef _SV_BITMAP_HXX
44
#include <vcl/bitmap.hxx>
45
#endif
46
47
// class IntroWindow_Impl ------------------------------------------------
48
namespace desktop
49
{
50
51
class IntroWindow_Impl : public IntroWindow
52
{
53
private:
54
	Bitmap			m_aIntroBmp;
55
56
	void			Init();
57
	DECL_LINK( AppEventListenerHdl, VclWindowEvent * );
58
59
public:
60
	IntroWindow_Impl( const Bitmap& aInfoBitmap );
61
	~IntroWindow_Impl();
62
63
	virtual void	Paint( const Rectangle& );
64
65
	void			Slide();
66
};
67
68
}
69
70
#endif // #ifndef _DESKTOP_INTRO_HXX
(-)source/app/makefile.mk (-3 lines)
Lines 55-66 Link Here
55
        $(OBJ)$/copyright_ascii_ooo.obj		\
55
        $(OBJ)$/copyright_ascii_ooo.obj		\
56
        $(OBJ)$/lockfile.obj				\
56
        $(OBJ)$/lockfile.obj				\
57
        $(OBJ)$/lockfile2.obj				\
57
        $(OBJ)$/lockfile2.obj				\
58
		$(OBJ)$/intro.obj					\
59
		$(OBJ)$/officeipcthread.obj			\
58
		$(OBJ)$/officeipcthread.obj			\
60
		$(OBJ)$/appinit.obj					\
59
		$(OBJ)$/appinit.obj					\
61
		$(OBJ)$/cmdlineargs.obj				\
60
		$(OBJ)$/cmdlineargs.obj				\
62
		$(OBJ)$/oinstanceprovider.obj		\
63
		$(OBJ)$/opluginframefactory.obj		\
64
		$(OBJ)$/appsys.obj					\
61
		$(OBJ)$/appsys.obj					\
65
		$(OBJ)$/desktopresid.obj			\
62
		$(OBJ)$/desktopresid.obj			\
66
		$(OBJ)$/dispatchwatcher.obj			\
63
		$(OBJ)$/dispatchwatcher.obj			\
(-)source/app/officeipcthread.cxx (-7 lines)
Lines 331-343 Link Here
331
	return *pOfficeIPCThreadMutex;
331
	return *pOfficeIPCThreadMutex;
332
}
332
}
333
333
334
OfficeIPCThread* OfficeIPCThread::GetOfficeIPCThread()
335
{
336
	// Return the one and only OfficeIPCThread pointer
337
	::osl::MutexGuard	aGuard( GetMutex() );
338
	return pGlobalOfficeIPCThread;
339
}
340
341
void OfficeIPCThread::BlockAllRequests()
334
void OfficeIPCThread::BlockAllRequests()
342
{
335
{
343
	// We have the order to block all incoming requests. Framework
336
	// We have the order to block all incoming requests. Framework
(-)source/app/officeipcthread.hxx (-1 lines)
Lines 136-142 Link Here
136
	virtual ~OfficeIPCThread();
136
	virtual ~OfficeIPCThread();
137
137
138
	// controlling pipe communication during shutdown
138
	// controlling pipe communication during shutdown
139
	static OfficeIPCThread*		GetOfficeIPCThread();
140
	static void					BlockAllRequests();
139
	static void					BlockAllRequests();
141
	static sal_Bool				AreRequestsPending();
140
	static sal_Bool				AreRequestsPending();
142
	static void					RequestsCompleted( int n = 1 );
141
	static void					RequestsCompleted( int n = 1 );
(-)source/app/oinstanceprovider.cxx (-210 lines)
Lines 1-210 Link Here
1
 /*************************************************************************
2
 *
3
 *  OpenOffice.org - a multi-platform office productivity suite
4
 *
5
 *  $RCSfile$
6
 *
7
 *  $Revision$
8
 *
9
 *  last change: $Author$ $Date$
10
 *
11
 *  The Contents of this file are made available subject to
12
 *  the terms of GNU Lesser General Public License Version 2.1.
13
 *
14
 *
15
 *    GNU Lesser General Public License Version 2.1
16
 *    =============================================
17
 *    Copyright 2005 by Sun Microsystems, Inc.
18
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
19
 *
20
 *    This library is free software; you can redistribute it and/or
21
 *    modify it under the terms of the GNU Lesser General Public
22
 *    License version 2.1, as published by the Free Software Foundation.
23
 *
24
 *    This library is distributed in the hope that it will be useful,
25
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
26
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
27
 *    Lesser General Public License for more details.
28
 *
29
 *    You should have received a copy of the GNU Lesser General Public
30
 *    License along with this library; if not, write to the Free Software
31
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
32
 *    MA  02111-1307  USA
33
 *
34
 ************************************************************************/
35
36
// MARKER(update_precomp.py): autogen include statement, do not remove
37
#include "precompiled_desktop.hxx"
38
39
//_________________________________________________________________________________________________________________
40
//	my own includes
41
//_________________________________________________________________________________________________________________
42
43
#include "oinstanceprovider.hxx"
44
#include "opluginframefactory.hxx"
45
46
//_________________________________________________________________________________________________________________
47
//	interface includes
48
//_________________________________________________________________________________________________________________
49
50
#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
51
#include <comphelper/processfactory.hxx>
52
#endif
53
54
//_________________________________________________________________________________________________________________
55
//	includes of other projects
56
//_________________________________________________________________________________________________________________
57
#ifndef _OSL_DIAGNOSE_H_
58
#include <osl/diagnose.h>
59
#endif
60
61
//_________________________________________________________________________________________________________________
62
//	namespace
63
//_________________________________________________________________________________________________________________
64
65
using namespace ::osl							;
66
using namespace ::rtl							;
67
using namespace ::cppu							;
68
using namespace ::com::sun::star::uno			;
69
using namespace ::com::sun::star::lang			;
70
using namespace ::com::sun::star::bridge		;
71
using namespace ::com::sun::star::container		;
72
73
//_________________________________________________________________________________________________________________
74
//	non exported const
75
//_________________________________________________________________________________________________________________
76
#define	INSTANCENAME_PLUGINFACTORY							OUString(RTL_CONSTASCII_USTRINGPARAM("PluginFactory"))
77
#define	INSTANCENAME_PLUGINFACTORY_SERVICEMANAGER			OUString(RTL_CONSTASCII_USTRINGPARAM("ServiceManager"))
78
79
//_________________________________________________________________________________________________________________
80
//	non exported definitions
81
//_________________________________________________________________________________________________________________
82
83
//_________________________________________________________________________________________________________________
84
//	declarations
85
//_________________________________________________________________________________________________________________
86
87
//*****************************************************************************************************************
88
//	constructor
89
//*****************************************************************************************************************
90
OInstanceProvider::OInstanceProvider( const Reference< XMultiServiceFactory >& xFactory )
91
		//	Init baseclasses first
92
		//	Attention:
93
		//		Don't change order of initialization!
94
		//      OMutexMember is a struct with a mutex as member. We can't use a mutex as member directly, while
95
		//		we must garant right initialization and a valid value of this! First initialize
96
		//		baseclasses and then members. And we need the mutex for other baseclasses !!!
97
		:	OMutexMember(			)
98
		,	OWeakObject	(			)
99
		// Init member
100
		,	m_xFactory	( xFactory	)
101
{
102
}
103
104
//*****************************************************************************************************************
105
//	destructor (protected!)
106
//*****************************************************************************************************************
107
OInstanceProvider::~OInstanceProvider()
108
{
109
}
110
111
//*****************************************************************************************************************
112
//	XInterface
113
//*****************************************************************************************************************
114
115
void SAL_CALL OInstanceProvider::acquire() throw()
116
{ OWeakObject::acquire(); }
117
118
void SAL_CALL OInstanceProvider::release() throw()
119
{ OWeakObject::release(); }
120
121
Any SAL_CALL OInstanceProvider::queryInterface( const Type& aType ) throw( RuntimeException )
122
{
123
	Any aReturn	( ::cppu::queryInterface( aType, static_cast< XInstanceProvider* >( this ) ) );
124
	if ( aReturn.hasValue() == sal_False )
125
	{
126
		aReturn = OWeakObject::queryInterface( aType );
127
	}
128
	return aReturn;
129
}
130
131
//*****************************************************************************************************************
132
//	XInstanceProvider
133
//*****************************************************************************************************************
134
Reference< XInterface > SAL_CALL OInstanceProvider::getInstance( const OUString& sInstanceName ) throw(	NoSuchElementException	,
135
																										RuntimeException		)
136
{
137
	// Ready for multithreading
138
	MutexGuard aGuard( m_aMutex );
139
140
	// Safe impossible cases
141
	// This method is not defined for all incoming parameter.
142
	OSL_ENSURE( impldbg_checkParameter_getInstance( sInstanceName ), "OInstanceProvider::getInstance()\nInvalid parameter detected.\n" );
143
144
	// Set default return value
145
	Reference< XInterface > xReturn;
146
147
	// Attention: The created factories are helper services and not registered in registry!
148
	// We cant' instanciate it as service; we must do it dynamicly.
149
150
	// If a correct name for factory was given ...
151
	if ( sInstanceName == INSTANCENAME_PLUGINFACTORY )
152
	{
153
		// ... create this searched factory and set it for return.
154
		OPlugInFrameFactory* pPlugInFactory = new OPlugInFrameFactory( m_xFactory );
155
		xReturn = Reference< XInterface >( (OWeakObject*)pPlugInFactory, UNO_QUERY );
156
		// Safe impossible cases!
157
		// This operation can't failed.
158
		OSL_ENSURE( !(xReturn.is()==sal_False), "OInstanceProvider::getInstance()\nCreation of PlugInFactory failed!\n" );
159
	}
160
	else if (sInstanceName == INSTANCENAME_PLUGINFACTORY_SERVICEMANAGER)
161
	{
162
		xReturn = Reference< XInterface >( ::comphelper::getProcessServiceFactory(), UNO_QUERY );
163
	}
164
	else
165
	{
166
		// If an unknown name was given, we throw an exception!
167
		NoSuchElementException aTmpException;
168
		throw( aTmpException );
169
	}
170
171
	// Return result of this operation.
172
	return xReturn;
173
}
174
175
//_________________________________________________________________________________________________________________
176
//	debug methods
177
//_________________________________________________________________________________________________________________
178
179
/*-----------------------------------------------------------------------------------------------------------------
180
	The follow methods checks the parameter for other functions. If a parameter or his value is non valid,
181
	we return "sal_False". (else sal_True) This mechanism is used to throw an ASSERT!
182
183
	ATTENTION
184
185
		If you miss a test for one of this parameters, contact the autor or add it himself !(?)
186
		But ... look for right testing! See using of this methods!
187
-----------------------------------------------------------------------------------------------------------------*/
188
189
#if OSL_DEBUG_LEVEL > 0
190
191
//*****************************************************************************************************************
192
sal_Bool OInstanceProvider::impldbg_checkParameter_getInstance( const OUString& sInstanceName )
193
{
194
	// Set default return value.
195
	sal_Bool bOK = sal_True;
196
	// Check parameter.
197
	if	(
198
			( &sInstanceName	==	NULL	)	||
199
			(
200
				( sInstanceName	!=	INSTANCENAME_PLUGINFACTORY	&& sInstanceName != INSTANCENAME_PLUGINFACTORY_SERVICEMANAGER )
201
			)
202
		)
203
	{
204
		bOK = sal_False ;
205
	}
206
	// Return result of check.
207
	return bOK ;
208
}
209
210
#endif  //  #ifdef OSL_DEBUG_LEVEL
(-)source/app/oinstanceprovider.hxx (-232 lines)
Lines 1-232 Link Here
1
/*************************************************************************
2
 *
3
 *  OpenOffice.org - a multi-platform office productivity suite
4
 *
5
 *  $RCSfile$
6
 *
7
 *  $Revision$
8
 *
9
 *  last change: $Author$ $Date$
10
 *
11
 *  The Contents of this file are made available subject to
12
 *  the terms of GNU Lesser General Public License Version 2.1.
13
 *
14
 *
15
 *    GNU Lesser General Public License Version 2.1
16
 *    =============================================
17
 *    Copyright 2005 by Sun Microsystems, Inc.
18
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
19
 *
20
 *    This library is free software; you can redistribute it and/or
21
 *    modify it under the terms of the GNU Lesser General Public
22
 *    License version 2.1, as published by the Free Software Foundation.
23
 *
24
 *    This library is distributed in the hope that it will be useful,
25
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
26
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
27
 *    Lesser General Public License for more details.
28
 *
29
 *    You should have received a copy of the GNU Lesser General Public
30
 *    License along with this library; if not, write to the Free Software
31
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
32
 *    MA  02111-1307  USA
33
 *
34
 ************************************************************************/
35
36
#ifndef __SFX_OINSTANCEPROVIDER_HXX_
37
#define __SFX_OINSTANCEPROVIDER_HXX_
38
39
//_________________________________________________________________________________________________________________
40
//	my own includes
41
//_________________________________________________________________________________________________________________
42
43
#include "omutexmember.hxx"
44
45
//_________________________________________________________________________________________________________________
46
//	interface includes
47
//_________________________________________________________________________________________________________________
48
49
#ifndef _COM_SUN_STAR_BRIDGE_XINSTANCEPROVIDER_HPP_
50
#include <com/sun/star/bridge/XInstanceProvider.hpp>
51
#endif
52
53
#ifndef _COM_SUN_STAR_LANG_XSINGLESERVICEFACTORY_HPP_
54
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
55
#endif
56
57
#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
58
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
59
#endif
60
61
#ifndef _COM_SUN_STAR_CONTAINER_NOSUCHELEMENTEXCEPTION_HPP_
62
#include <com/sun/star/container/NoSuchElementException.hpp>
63
#endif
64
65
//_________________________________________________________________________________________________________________
66
//	other includes
67
//_________________________________________________________________________________________________________________
68
69
#ifndef _CPPUHELPER_WEAK_HXX_
70
#include <cppuhelper/weak.hxx>
71
#endif
72
73
//_________________________________________________________________________________________________________________
74
//	namespace
75
//_________________________________________________________________________________________________________________
76
77
#define	XINSTANCEPROVIDER					::com::sun::star::bridge::XInstanceProvider
78
#define	OWEAKOBJECT							::cppu::OWeakObject
79
#define	NOSUCHELEMENTEXCEPTION				::com::sun::star::container::NoSuchElementException
80
#define	XMULTISERVICEFACTORY				::com::sun::star::lang::XMultiServiceFactory
81
#define	REFERENCE							::com::sun::star::uno::Reference
82
#define	RUNTIMEEXCEPTION					::com::sun::star::uno::RuntimeException
83
#define	ANY									::com::sun::star::uno::Any
84
#define	UNOTYPE								::com::sun::star::uno::Type
85
#define	XINTERFACE							::com::sun::star::uno::XInterface
86
#define	OUSTRING							::rtl::OUString
87
88
//_________________________________________________________________________________________________________________
89
//	exported const
90
//_________________________________________________________________________________________________________________
91
92
//_________________________________________________________________________________________________________________
93
//	exported definitions
94
//_________________________________________________________________________________________________________________
95
96
/*-************************************************************************************************************//**
97
	@short			create factories corresponding to special name
98
	@descr			If you need a factory for creation of other factories (zB. neccessary for bridges) you can use
99
					these implementation. You will give us a factory name and we will give you these factory (if it exist).
100
101
	@implements		XInterface
102
					XInstanceProvider
103
					[ XDebugging if ENABLE_SERVICEDEBUG is defined! ]
104
	@base			OMutexMember
105
					OWeakObject
106
107
	@devstatus		deprecated
108
*//*-*************************************************************************************************************/
109
110
class OInstanceProvider	:	public XINSTANCEPROVIDER			,
111
							public OMutexMember					,	// Order of baseclasses is important for right initialization!
112
							public OWEAKOBJECT
113
{
114
	//-------------------------------------------------------------------------------------------------------------
115
	//	public methods
116
	//-------------------------------------------------------------------------------------------------------------
117
118
	public:
119
120
		//---------------------------------------------------------------------------------------------------------
121
		//	constructor / destructor
122
		//---------------------------------------------------------------------------------------------------------
123
124
		/*-****************************************************************************************************//**
125
			@short		standard ctor
126
			@descr		These initialize a new instance of ths class with needed informations for work.
127
128
			@seealso	using at owner
129
130
			@param		-
131
			@return		-
132
133
			@onerror	-
134
		*//*-*****************************************************************************************************/
135
136
	 	OInstanceProvider( const REFERENCE< XMULTISERVICEFACTORY >& xFactory );
137
138
		//---------------------------------------------------------------------------------------------------------
139
		//	XInterface
140
		//---------------------------------------------------------------------------------------------------------
141
142
    	virtual void SAL_CALL acquire() throw();
143
		virtual void SAL_CALL release() throw();
144
		virtual ANY SAL_CALL queryInterface( const UNOTYPE& aType ) throw( RUNTIMEEXCEPTION );
145
146
		//---------------------------------------------------------------------------------------------------------
147
		//	XInstanceProvider
148
		//---------------------------------------------------------------------------------------------------------
149
150
		/*-****************************************************************************************************//**
151
			@short      return reference to a factory for specified instance
152
			@descr		These object is a selector for different factories. You will give me a factory name -
153
						and I will give you a reference to the right factory object (if any exist!).
154
155
			@seealso	-
156
157
			@param		"sInstanceName", name of searched factory.
158
			@return		A reference to corresponding factory.
159
160
			@onerror	A null reference is returned.
161
		*//*-*****************************************************************************************************/
162
163
		virtual REFERENCE< XINTERFACE > SAL_CALL getInstance( const OUSTRING& sInstanceName ) throw(	NOSUCHELEMENTEXCEPTION	,
164
																										RUNTIMEEXCEPTION		);
165
166
	//-------------------------------------------------------------------------------------------------------------
167
	//	protected methods
168
	//-------------------------------------------------------------------------------------------------------------
169
170
	protected:
171
172
		/*-****************************************************************************************************//**
173
			@short		standard destructor
174
			@descr		This method destruct an instance of this class and clear some member.
175
						This method is protected, because its not allowed to use an instance of this class as a member!
176
						You MUST use a pointer.
177
178
			@seealso	-
179
180
			@param		-
181
			@return		-
182
183
			@onerror	-
184
		*//*-*****************************************************************************************************/
185
186
		virtual	~OInstanceProvider();
187
188
	//-------------------------------------------------------------------------------------------------------------
189
	//	private methods
190
	//-------------------------------------------------------------------------------------------------------------
191
192
	private:
193
194
	//-------------------------------------------------------------------------------------------------------------
195
	//	debug methods
196
	//	(should be private everyway!)
197
	//-------------------------------------------------------------------------------------------------------------
198
199
		/*-****************************************************************************************************//**
200
			@short		debug-method to check incoming parameter of some other mehods of this class
201
			@descr		The following methods are used to check parameters for other methods
202
						of this class. The return value is used directly for an ASSERT(...).
203
204
			@seealso	ASSERTs in implementation!
205
206
			@param		references to checking variables
207
			@return		sal_False on invalid parameter<BR>
208
						sal_True  otherway
209
210
			@onerror	-
211
		*//*-*****************************************************************************************************/
212
213
    #if OSL_DEBUG_LEVEL > 0
214
215
	private:
216
217
		sal_Bool impldbg_checkParameter_getInstance( const OUSTRING& sInstanceName );
218
219
    #endif  // #ifdef OSL_DEBUG_LEVEL
220
221
	//-------------------------------------------------------------------------------------------------------------
222
	//	variables
223
	//	(should be private everyway!)
224
	//-------------------------------------------------------------------------------------------------------------
225
226
	private:
227
228
		REFERENCE< XMULTISERVICEFACTORY >		m_xFactory		;
229
230
};		//	class OInstanceProvider
231
232
#endif	//	#ifndef __SFX_OINSTANCEPROVIDER_HXX_
(-)source/app/opluginframefactory.cxx (-216 lines)
Lines 1-217 Link Here
1
/*************************************************************************
2
 *
3
 *  OpenOffice.org - a multi-platform office productivity suite
4
 *
5
 *  $RCSfile$
6
 *
7
 *  $Revision$
8
 *
9
 *  last change: $Author$ $Date$
10
 *
11
 *  The Contents of this file are made available subject to
12
 *  the terms of GNU Lesser General Public License Version 2.1.
13
 *
14
 *
15
 *    GNU Lesser General Public License Version 2.1
16
 *    =============================================
17
 *    Copyright 2005 by Sun Microsystems, Inc.
18
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
19
 *
20
 *    This library is free software; you can redistribute it and/or
21
 *    modify it under the terms of the GNU Lesser General Public
22
 *    License version 2.1, as published by the Free Software Foundation.
23
 *
24
 *    This library is distributed in the hope that it will be useful,
25
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
26
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
27
 *    Lesser General Public License for more details.
28
 *
29
 *    You should have received a copy of the GNU Lesser General Public
30
 *    License along with this library; if not, write to the Free Software
31
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
32
 *    MA  02111-1307  USA
33
 *
34
 ************************************************************************/
35
1
36
// MARKER(update_precomp.py): autogen include statement, do not remove
37
#include "precompiled_desktop.hxx"
38
39
//_________________________________________________________________________________________________________________
40
//	my own includes
41
//_________________________________________________________________________________________________________________
42
43
#include "opluginframefactory.hxx"
44
45
//_________________________________________________________________________________________________________________
46
//	interface includes
47
//_________________________________________________________________________________________________________________
48
49
#ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_HPP_
50
#include <com/sun/star/lang/XInitialization.hpp>
51
#endif
52
53
#ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_
54
#include <com/sun/star/frame/XFrame.hpp>
55
#endif
56
57
//_________________________________________________________________________________________________________________
58
//	includes of other projects
59
//_________________________________________________________________________________________________________________
60
61
#ifndef _OSL_DIAGNOSE_H_
62
#include <osl/diagnose.h>
63
#endif
64
65
//_________________________________________________________________________________________________________________
66
//	namespace
67
//_________________________________________________________________________________________________________________
68
69
using namespace ::osl							;
70
using namespace ::rtl							;
71
using namespace ::cppu							;
72
using namespace ::com::sun::star::uno			;
73
using namespace ::com::sun::star::lang			;
74
using namespace ::com::sun::star::frame			;
75
76
//_________________________________________________________________________________________________________________
77
//	non exported const
78
//_________________________________________________________________________________________________________________
79
#define	SERVICENAME_DESKTOP									OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop"				))
80
#define	SERVICENAME_PLUGINFRAME								OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.mozilla.Plugin"				))
81
82
//_________________________________________________________________________________________________________________
83
//	non exported definitions
84
//_________________________________________________________________________________________________________________
85
86
//_________________________________________________________________________________________________________________
87
//	declarations
88
//_________________________________________________________________________________________________________________
89
90
//*****************************************************************************************************************
91
//	constructor
92
//*****************************************************************************************************************
93
OPlugInFrameFactory::OPlugInFrameFactory( const Reference< XMultiServiceFactory >& xFactory )
94
		//	Init baseclasses first
95
		//	Attention:
96
		//		Don't change order of initialization!
97
		//      OMutexMember is a struct with a mutex as member. We can't use a mutex as member directly, while
98
		//		we must garant right initialization and a valid value of this! First initialize
99
		//		baseclasses and then members. And we need the mutex for other baseclasses !!!
100
		:	OMutexMember(			)
101
		,	OWeakObject	(			)
102
		// Init member
103
		,	m_xFactory	( xFactory	)
104
{
105
}
106
107
//*****************************************************************************************************************
108
//	destructor (protected!)
109
//*****************************************************************************************************************
110
OPlugInFrameFactory::~OPlugInFrameFactory()
111
{
112
}
113
114
//*****************************************************************************************************************
115
//	XInterface
116
//*****************************************************************************************************************
117
118
void SAL_CALL OPlugInFrameFactory::acquire() throw()
119
{ OWeakObject::acquire(); }
120
121
void SAL_CALL OPlugInFrameFactory::release() throw()
122
{ OWeakObject::release(); }
123
124
Any SAL_CALL OPlugInFrameFactory::queryInterface( const Type& aType ) throw( RuntimeException )
125
{
126
	Any aReturn	( ::cppu::queryInterface( aType, static_cast< XSingleServiceFactory* >( this ) ) );
127
	if ( aReturn.hasValue() == sal_False )
128
	{
129
		aReturn = OWeakObject::queryInterface( aType );
130
	}
131
	return aReturn;
132
}
133
//*****************************************************************************************************************
134
//	XSingleServiceFactory
135
//*****************************************************************************************************************
136
Reference< XInterface > SAL_CALL OPlugInFrameFactory::createInstance() throw(	Exception		,
137
																				RuntimeException)
138
{
139
	// Ready for multithreading
140
	MutexGuard aGuard( m_aMutex );
141
142
	// Create new plugin.
143
	Reference< XInterface > xPlugIn( m_xFactory->createInstance( SERVICENAME_PLUGINFRAME ), UNO_QUERY );
144
	// Safe impossible cases
145
	OSL_ENSURE( !(xPlugIn.is()==sal_False), "OPlugInFrameFactory::createInstance()\nServicename of PlugIn is unknown!\n" );
146
147
	// Ouer plugin need information about his parent!
148
	// If someone dispatch anything to this plugin instance, he will create a new window and load the content.
149
	// Then he must append himself to ouer frame tree !!! => Thats why he need a valid reference to the desktop
150
	// as parent to do this.
151
	// Return result.
152
	return xPlugIn;
153
}
154
155
//*****************************************************************************************************************
156
//	XSingleServiceFactory
157
//*****************************************************************************************************************
158
Reference< XInterface > SAL_CALL OPlugInFrameFactory::createInstanceWithArguments( const Sequence< Any >& seqArguments ) throw(	Exception		,
159
																																RuntimeException)
160
{
161
	// Ready for multithreading
162
	MutexGuard aGuard( m_aMutex );
163
164
	// Safe impossible cases
165
	// This method is not defined for all incoming parameter.
166
	OSL_ENSURE( impldbg_checkParameter_createInstanceWithArguments( seqArguments ), "OPlugInFrameFactory::createInstanceWithArguments()\nInvalid parameter detected.\n" );
167
168
	// Create new PlugIn.
169
	Reference< XInterface > xPlugIn = createInstance();
170
	// Initialize it with given arguments.
171
	if ( xPlugIn.is()==sal_True )
172
	{
173
		// Before we must cast to right interface.
174
		Reference< XInitialization > xInit( xPlugIn, UNO_QUERY );
175
		// Safe impossible cases
176
		OSL_ENSURE( !(xInit.is()==sal_False), "OPlugInFrameFactory::createInstanceWithArguments()\nPlugIn don't support XInitialization ?!...\n" );
177
		xInit->initialize( seqArguments );
178
	}
179
180
	// Return result.
181
	return xPlugIn;
182
}
183
184
//_________________________________________________________________________________________________________________
185
//	debug methods
186
//_________________________________________________________________________________________________________________
187
188
/*-----------------------------------------------------------------------------------------------------------------
189
	The follow methods checks the parameter for other functions. If a parameter or his value is non valid,
190
	we return "sal_False". (else sal_True) This mechanism is used to throw an ASSERT!
191
192
	ATTENTION
193
194
		If you miss a test for one of this parameters, contact the autor or add it himself !(?)
195
		But ... look for right testing! See using of this methods!
196
-----------------------------------------------------------------------------------------------------------------*/
197
198
#if OSL_DEBUG_LEVEL > 0
199
200
//*****************************************************************************************************************
201
sal_Bool OPlugInFrameFactory::impldbg_checkParameter_createInstanceWithArguments( const Sequence< Any >& seqArguments )
202
{
203
	// Set default return value.
204
	sal_Bool bOK = sal_True;
205
	// Check parameter.
206
	if	(
207
			( &seqArguments				==	NULL	)	||
208
			( seqArguments.getLength()	<	1  		)
209
		)
210
	{
211
		bOK = sal_False ;
212
	}
213
	// Return result of check.
214
	return bOK ;
215
}
216
217
#endif  //  #ifdef OSL_DEBUG_LEVEL
(-)source/app/opluginframefactory.hxx (-243 lines)
Lines 1-243 Link Here
1
/*************************************************************************
2
 *
3
 *  OpenOffice.org - a multi-platform office productivity suite
4
 *
5
 *  $RCSfile$
6
 *
7
 *  $Revision$
8
 *
9
 *  last change: $Author$ $Date$
10
 *
11
 *  The Contents of this file are made available subject to
12
 *  the terms of GNU Lesser General Public License Version 2.1.
13
 *
14
 *
15
 *    GNU Lesser General Public License Version 2.1
16
 *    =============================================
17
 *    Copyright 2005 by Sun Microsystems, Inc.
18
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
19
 *
20
 *    This library is free software; you can redistribute it and/or
21
 *    modify it under the terms of the GNU Lesser General Public
22
 *    License version 2.1, as published by the Free Software Foundation.
23
 *
24
 *    This library is distributed in the hope that it will be useful,
25
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
26
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
27
 *    Lesser General Public License for more details.
28
 *
29
 *    You should have received a copy of the GNU Lesser General Public
30
 *    License along with this library; if not, write to the Free Software
31
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
32
 *    MA  02111-1307  USA
33
 *
34
 ************************************************************************/
35
36
#ifndef __SFX_OPLUGINFRAMEFACTORY_HXX_
37
#define __SFX_OPLUGINFRAMEFACTORY_HXX_
38
39
//_________________________________________________________________________________________________________________
40
//	my own includes
41
//_________________________________________________________________________________________________________________
42
43
#include "omutexmember.hxx"
44
45
//_________________________________________________________________________________________________________________
46
//	interface includes
47
//_________________________________________________________________________________________________________________
48
49
#ifndef _COM_SUN_STAR_LANG_XSINGLESERVICEFACTORY_HPP_
50
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
51
#endif
52
53
#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
54
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
55
#endif
56
57
//_________________________________________________________________________________________________________________
58
//	other includes
59
//_________________________________________________________________________________________________________________
60
61
#ifndef _CPPUHELPER_WEAK_HXX_
62
#include <cppuhelper/weak.hxx>
63
#endif
64
65
//_________________________________________________________________________________________________________________
66
//	namespace
67
//_________________________________________________________________________________________________________________
68
69
#define	XSINGLESERVICEFACTORY				::com::sun::star::lang::XSingleServiceFactory
70
#define	OWEAKOBJECT							::cppu::OWeakObject
71
#define	EXCEPTION							::com::sun::star::uno::Exception
72
#define	SEQUENCE							::com::sun::star::uno::Sequence
73
#define	XCONNECTION							::com::sun::star::connection::XConnection
74
#define	IOEXCEPTION							::com::sun::star::io::IOException
75
#define	XINSTANCEPROVIDER					::com::sun::star::bridge::XInstanceProvider
76
#define	NOSUCHELEMENTEXCEPTION				::com::sun::star::container::NoSuchElementException
77
#define	XMULTISERVICEFACTORY				::com::sun::star::lang::XMultiServiceFactory
78
#define	REFERENCE							::com::sun::star::uno::Reference
79
#define	RUNTIMEEXCEPTION					::com::sun::star::uno::RuntimeException
80
#define	ANY									::com::sun::star::uno::Any
81
#define	UNOTYPE								::com::sun::star::uno::Type
82
#define	XINTERFACE							::com::sun::star::uno::XInterface
83
#define	OUSTRING							::rtl::OUString
84
#define	MUTEX								::osl::Mutex
85
86
//_________________________________________________________________________________________________________________
87
//	exported const
88
//_________________________________________________________________________________________________________________
89
90
//_________________________________________________________________________________________________________________
91
//	exported definitions
92
//_________________________________________________________________________________________________________________
93
94
/*-************************************************************************************************************//**
95
	@short			-
96
	@descr			-
97
98
	@implements		XInterface
99
					XSingleServiceFactory
100
					[ XDebugging if ENABLE_SERVICEDEBUG is defined! ]
101
	@base			OMutexMember
102
					OWeakObject
103
104
	@devstatus		deprecated
105
*//*-*************************************************************************************************************/
106
107
class OPlugInFrameFactory	:	public XSINGLESERVICEFACTORY		,
108
								public OMutexMember					,	// Order of baseclasses is important for right initialization!
109
								public OWEAKOBJECT
110
{
111
	//-------------------------------------------------------------------------------------------------------------
112
	//	public methods
113
	//-------------------------------------------------------------------------------------------------------------
114
115
	public:
116
117
		//---------------------------------------------------------------------------------------------------------
118
		//	constructor / destructor
119
		//---------------------------------------------------------------------------------------------------------
120
121
		/*-****************************************************************************************************//**
122
			@short		standard ctor
123
			@descr		These initialize a new instance of ths class with needed informations for work.
124
125
			@seealso	using at owner
126
127
			@param		-
128
			@return		-
129
130
			@onerror	-
131
		*//*-*****************************************************************************************************/
132
133
	 	OPlugInFrameFactory( const REFERENCE< XMULTISERVICEFACTORY >& xFactory );
134
135
		//---------------------------------------------------------------------------------------------------------
136
		//	XInterface
137
		//---------------------------------------------------------------------------------------------------------
138
139
    	virtual void SAL_CALL acquire() throw();
140
		virtual void SAL_CALL release() throw();
141
		virtual ANY SAL_CALL queryInterface( const UNOTYPE& aType ) throw( RUNTIMEEXCEPTION );
142
143
		//---------------------------------------------------------------------------------------------------------
144
		//	XSingleServiceFactory
145
		//---------------------------------------------------------------------------------------------------------
146
147
		/*-****************************************************************************************************//**
148
			@short      -
149
			@descr		-
150
151
			@seealso	-
152
153
			@param		-
154
			@return		-
155
156
			@onerror	-
157
		*//*-*****************************************************************************************************/
158
159
    	virtual REFERENCE< XINTERFACE > SAL_CALL createInstance() throw(	EXCEPTION			,
160
																			RUNTIMEEXCEPTION	);
161
162
		/*-****************************************************************************************************//**
163
			@short      -
164
			@descr		-
165
166
			@seealso	-
167
168
			@param		-
169
			@return		-
170
171
			@onerror	-
172
		*//*-*****************************************************************************************************/
173
174
    	virtual REFERENCE< XINTERFACE > SAL_CALL createInstanceWithArguments( const SEQUENCE< ANY >& seqArguments ) throw(	EXCEPTION			,
175
																															RUNTIMEEXCEPTION	);
176
177
	//-------------------------------------------------------------------------------------------------------------
178
	//	protected methods
179
	//-------------------------------------------------------------------------------------------------------------
180
181
	protected:
182
183
		/*-****************************************************************************************************//**
184
			@short		standard destructor
185
			@descr		This method destruct an instance of this class and clear some member.
186
						This method is protected, because its not allowed to use an instance of this class as a member!
187
						You MUST use a pointer.
188
189
			@seealso	-
190
191
			@param		-
192
			@return		-
193
194
			@onerror	-
195
		*//*-*****************************************************************************************************/
196
197
		virtual	~OPlugInFrameFactory();
198
199
	//-------------------------------------------------------------------------------------------------------------
200
	//	private methods
201
	//-------------------------------------------------------------------------------------------------------------
202
203
	private:
204
205
	//-------------------------------------------------------------------------------------------------------------
206
	//	debug methods
207
	//	(should be private everyway!)
208
	//-------------------------------------------------------------------------------------------------------------
209
210
		/*-****************************************************************************************************//**
211
			@short		debug-method to check incoming parameter of some other mehods of this class
212
			@descr		The following methods are used to check parameters for other methods
213
						of this class. The return value is used directly for an ASSERT(...).
214
215
			@seealso	ASSERTs in implementation!
216
217
			@param		references to checking variables
218
			@return		sal_False on invalid parameter<BR>
219
						sal_True  otherway
220
221
			@onerror	-
222
		*//*-*****************************************************************************************************/
223
224
    #if OSL_DEBUG_LEVEL > 0
225
226
	private:
227
228
    	sal_Bool impldbg_checkParameter_createInstanceWithArguments( const SEQUENCE< ANY >& seqArguments );
229
230
    #endif  // #ifdef OSL_DEBUG_LEVEL
231
232
	//-------------------------------------------------------------------------------------------------------------
233
	//	variables
234
	//	(should be private everyway!)
235
	//-------------------------------------------------------------------------------------------------------------
236
237
	private:
238
239
		REFERENCE< XMULTISERVICEFACTORY >			m_xFactory		;
240
241
};		//	class OPlugInFrameFactory
242
243
#endif	//	#ifndef __FRAMEWORK_OPLUGINFRAMEFACTORY_HXX_
(-)source/deployment/dp_xml.cxx (-29 lines)
Lines 160-177 Link Here
160
}
160
}
161
161
162
//______________________________________________________________________________
162
//______________________________________________________________________________
163
Reference<xml::input::XNamespaceMapping> const &
164
XmlElement::getNamespaceMapping() const
165
{
166
    if (! m_xNamespaceMapping.is()) {
167
        throw RuntimeException(
168
            OUSTR("document has not been parsed yet!"),
169
            static_cast<OWeakObject *>( const_cast<XmlElement *>(this) ) );
170
    }
171
    return m_xNamespaceMapping;
172
}
173
174
//______________________________________________________________________________
175
void XmlElement::check_xmlns( sal_Int32 uid ) const
163
void XmlElement::check_xmlns( sal_Int32 uid ) const
176
    throw (xml::sax::SAXException)
164
    throw (xml::sax::SAXException)
177
{
165
{
Lines 196-218 Link Here
196
    }
184
    }
197
}
185
}
198
186
199
//______________________________________________________________________________
200
void XmlElement::check_parsed() const
201
    throw (xml::sax::SAXException)
202
{
203
    if (! isParsed()) {
204
        ::rtl::OUStringBuffer buf;
205
        buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("missing closing element "
206
                                                    "event for \"") );
207
        buf.append( m_localname );
208
        buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\"!") );
209
        throw xml::sax::SAXException(
210
            buf.makeStringAndClear(),
211
            static_cast<OWeakObject *>( const_cast<XmlElement *>(this) ),
212
            Any() );
213
    }
214
}
215
216
// XElement
187
// XElement
217
//______________________________________________________________________________
188
//______________________________________________________________________________
218
Reference<xml::input::XElement> XmlElement::getParent()
189
Reference<xml::input::XElement> XmlElement::getParent()
(-)source/deployment/gui/dp_gui.h (-1 lines)
Lines 184-190 Link Here
184
184
185
        SvLBoxEntry * getCurrentSingleSelectedEntry() const;
185
        SvLBoxEntry * getCurrentSingleSelectedEntry() const;
186
        bool isFirstLevelChild( SvLBoxEntry * entry ) const;
186
        bool isFirstLevelChild( SvLBoxEntry * entry ) const;
187
        ::rtl::OUString getContext( SvLBoxEntry * entry ) const;
188
        ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage> getPackage(
187
        ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage> getPackage(
189
            SvLBoxEntry * entry ) const;
188
            SvLBoxEntry * entry ) const;
190
        void select(::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage> const &   xPackage);
189
        void select(::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage> const &   xPackage);
(-)source/deployment/gui/dp_gui_treelb.cxx (-9 lines)
Lines 611-625 Link Here
611
}
611
}
612
612
613
//______________________________________________________________________________
613
//______________________________________________________________________________
614
OUString DialogImpl::TreeListBoxImpl::getContext( SvLBoxEntry * entry ) const
615
{
616
    if (entry == 0)
617
        return OUString();
618
    else
619
        return NodeImpl::get(entry)->m_xPackageManager->getContext();
620
}
621
622
//______________________________________________________________________________
623
Reference<deployment::XPackage>
614
Reference<deployment::XPackage>
624
DialogImpl::TreeListBoxImpl::getPackage( SvLBoxEntry * entry ) const
615
DialogImpl::TreeListBoxImpl::getPackage( SvLBoxEntry * entry ) const
625
{
616
{
(-)source/deployment/inc/db.hxx (-23 / +2 lines)
Lines 91-113 Link Here
91
    class DESKTOP_DEPLOYMENTMISC_DLLPUBLIC DbEnv : db_internal::Noncopyable
91
    class DESKTOP_DEPLOYMENTMISC_DLLPUBLIC DbEnv : db_internal::Noncopyable
92
    {	
92
    {	
93
	    friend class Db;
93
	    friend class Db;
94
	
95
    private:	
94
    private:	
96
    	DB_ENV* m_pDBENV;
95
	    DB_ENV* m_pDBENV;
97
	
96
	
98
    public:	
97
    public:	
99
	    explicit DbEnv(u_int32_t flags);	
98
	    static char *strerror(int);
100
	    ~DbEnv();
101
	
102
	    int open(const char *db_home, u_int32_t flags, int mode);	
103
	    void close(u_int32_t flags);
104
105
	    int set_alloc(
106
				  db_malloc_fcn_type app_malloc, 
107
				  db_realloc_fcn_type app_realloc,
108
				  db_free_fcn_type app_free);
109
        
110
        static char *strerror(int);
111
    };
99
    };
112
  
100
  
113
    class DESKTOP_DEPLOYMENTMISC_DLLPUBLIC Db : db_internal::Noncopyable 
101
    class DESKTOP_DEPLOYMENTMISC_DLLPUBLIC Db : db_internal::Noncopyable 
Lines 135-145 Link Here
135
	    int put(DB_TXN* txnid, Dbt *key, Dbt *data, u_int32_t flags);
123
	    int put(DB_TXN* txnid, Dbt *key, Dbt *data, u_int32_t flags);
136
	
124
	
137
	    int cursor(DB_TXN *txnid, Dbc **cursorp, u_int32_t flags);
125
	    int cursor(DB_TXN *txnid, Dbc **cursorp, u_int32_t flags);
138
139
	    int set_alloc(
140
				  db_malloc_fcn_type app_malloc, 
141
				  db_realloc_fcn_type app_realloc,
142
				  db_free_fcn_type app_free);
143
    };
126
    };
144
  
127
  
145
    class DESKTOP_DEPLOYMENTMISC_DLLPUBLIC Dbc : db_internal::Noncopyable 
128
    class DESKTOP_DEPLOYMENTMISC_DLLPUBLIC Dbc : db_internal::Noncopyable 
Lines 157-164 Link Here
157
	    int close();
140
	    int close();
158
	
141
	
159
	    int get(Dbt *key, Dbt *data, u_int32_t flags);
142
	    int get(Dbt *key, Dbt *data, u_int32_t flags);
160
161
        int del(u_int32_t flags_arg);
162
    };
143
    };
163
  
144
  
164
    class DESKTOP_DEPLOYMENTMISC_DLLPUBLIC Dbt: private DBT 
145
    class DESKTOP_DEPLOYMENTMISC_DLLPUBLIC Dbt: private DBT 
Lines 180-187 Link Here
180
	
161
	
181
  	    u_int32_t get_size() const;
162
  	    u_int32_t get_size() const;
182
	    void set_size(u_int32_t value);
163
	    void set_size(u_int32_t value);
183
184
	    void set_flags(u_int32_t);
185
    };
164
    };
186
}
165
}
187
166
(-)source/deployment/inc/dp_xml.h (-14 lines)
Lines 86-98 Link Here
86
        {}
86
        {}
87
    virtual ~XmlElement();
87
    virtual ~XmlElement();
88
public:
88
public:
89
    css::uno::Reference<css::xml::input::XNamespaceMapping> const &
90
    getNamespaceMapping() const;
91
    
92
    inline bool isParsed() const { return m_got_endElement; }
89
    inline bool isParsed() const { return m_got_endElement; }
93
    void check_parsed() const throw (css::xml::sax::SAXException);
94
    
95
    inline ::rtl::OUString getCharacters() const;
96
    
90
    
97
    inline XmlElement(
91
    inline XmlElement(
98
        css::uno::Reference<css::xml::input::XNamespaceMapping>
92
        css::uno::Reference<css::xml::input::XNamespaceMapping>
Lines 135-148 Link Here
135
        throw (css::xml::sax::SAXException, css::uno::RuntimeException);
129
        throw (css::xml::sax::SAXException, css::uno::RuntimeException);
136
};
130
};
137
131
138
//______________________________________________________________________________
139
inline ::rtl::OUString XmlElement::getCharacters() const
140
{
141
    check_parsed();
142
    return m_characters;
143
}
144
145
146
//==============================================================================
132
//==============================================================================
147
class XmlRootElement : public ::cppu::ImplInheritanceHelper1<
133
class XmlRootElement : public ::cppu::ImplInheritanceHelper1<
148
                                        XmlElement, css::xml::input::XRoot >
134
                                        XmlElement, css::xml::input::XRoot >
(-)source/deployment/manager/dp_manager.cxx (-9 lines)
Lines 437-451 Link Here
437
}
437
}
438
438
439
//______________________________________________________________________________
439
//______________________________________________________________________________
440
void PackageManagerImpl::checkAborted(
441
    ::rtl::Reference<AbortChannel> const & abortChannel )
442
{
443
    if (abortChannel.is() && abortChannel->isAborted())
444
        throw CommandAbortedException(
445
            OUSTR("abort!"), static_cast<OWeakObject *>(this) );
446
}
447
448
//______________________________________________________________________________
449
Reference<task::XAbortChannel> PackageManagerImpl::createAbortChannel()
440
Reference<task::XAbortChannel> PackageManagerImpl::createAbortChannel()
450
    throw (RuntimeException)
441
    throw (RuntimeException)
451
{
442
{
(-)source/deployment/manager/dp_manager.h (-3 lines)
Lines 102-110 Link Here
102
		css::uno::Reference<css::ucb::XCommandEnvironment> const & cmdEnv);
102
		css::uno::Reference<css::ucb::XCommandEnvironment> const & cmdEnv);
103
103
104
104
105
    void checkAborted(
106
        ::rtl::Reference< ::dp_misc::AbortChannel > const & abortChannel );
107
    
108
    class CmdEnvWrapperImpl
105
    class CmdEnvWrapperImpl
109
        : public ::cppu::WeakImplHelper2< css::ucb::XCommandEnvironment,
106
        : public ::cppu::WeakImplHelper2< css::ucb::XCommandEnvironment,
110
                                          css::ucb::XProgressHandler >
107
                                          css::ucb::XProgressHandler >
(-)source/deployment/misc/db.cxx (-70 lines)
Lines 58-115 Link Here
58
58
59
//----------------------------------------------------------------------------
59
//----------------------------------------------------------------------------
60
60
61
DbEnv::DbEnv(u_int32_t flags)
62
: m_pDBENV(0)
63
{
64
    db_internal::check_error( db_env_create(&m_pDBENV,flags), "DbEnv::DbEnv" );
65
}
66
67
DbEnv::~DbEnv()
68
{
69
    if (m_pDBENV)
70
    {
71
        // should not happen
72
        // TODO: add assert
73
        m_pDBENV->close(m_pDBENV,0);
74
    }
75
}
76
77
int DbEnv::open(const char *db_home, u_int32_t flags, int mode)
78
{
79
  return db_internal::check_error( m_pDBENV->open(m_pDBENV,db_home,flags,mode), "DbEnv::open" );
80
}
81
82
void DbEnv::close(u_int32_t flags)
83
{
84
    int error = m_pDBENV->close(m_pDBENV,flags);
85
    m_pDBENV = 0;
86
87
    db_internal::check_error(error, "DbEnv::close");
88
}
89
90
int DbEnv::set_alloc(db_malloc_fcn_type app_malloc, 
91
					 db_realloc_fcn_type app_realloc,
92
					 db_free_fcn_type app_free)
93
{
94
    int err = m_pDBENV->set_alloc(m_pDBENV,app_malloc,app_realloc,app_free);
95
    return db_internal::check_error(err,"Db::set_alloc");
96
}
97
98
99
char *DbEnv::strerror(int error) {
61
char *DbEnv::strerror(int error) {
100
    return (db_strerror(error));
62
    return (db_strerror(error));
101
}
63
}
102
64
103
//----------------------------------------------------------------------------
65
//----------------------------------------------------------------------------
104
66
105
int Db::set_alloc(   db_malloc_fcn_type app_malloc, 
106
					 db_realloc_fcn_type app_realloc,
107
					 db_free_fcn_type app_free)
108
{
109
    int err = m_pDBP->set_alloc(m_pDBP,app_malloc,app_realloc,app_free);
110
    return db_internal::check_error(err,"Db::set_alloc");
111
}
112
113
Db::Db(DbEnv* pDbenv,u_int32_t flags) 
67
Db::Db(DbEnv* pDbenv,u_int32_t flags) 
114
: m_pDBP(0)
68
: m_pDBP(0)
115
{  
69
{  
Lines 243-269 Link Here
243
    return err;
197
    return err;
244
}
198
}
245
199
246
int Dbc::del(u_int32_t flags_arg)
247
{
248
	DBC *cursor = m_pDBC;
249
    int err;
250
    
251
    if ((err = cursor->c_del(cursor, flags_arg)) != 0) {
252
        
253
		// DB_KEYEMPTY is a "normal" return, so should not be
254
		// thrown as an error
255
		//
256
		if (err != DB_KEYEMPTY) {
257
			db_internal::check_error( err, "Db::del");
258
			return (err);
259
		}
260
	}
261
	return (err);
262
}
263
264
//----------------------------------------------------------------------------
200
//----------------------------------------------------------------------------
265
201
266
267
Dbt::Dbt()
202
Dbt::Dbt()
268
{  
203
{  
269
    using namespace std;
204
    using namespace std;
Lines 325-335 Link Here
325
    this->size = value; 
260
    this->size = value; 
326
}
261
}
327
262
328
void Dbt::set_flags(u_int32_t value)
329
{ 
330
    this->flags = value;
331
}
332
333
//----------------------------------------------------------------------------
263
//----------------------------------------------------------------------------
334
void db_internal::raise_error(int dberr, const char * where)
264
void db_internal::raise_error(int dberr, const char * where)
335
{
265
{
(-)source/migration/pages.cxx (-44 lines)
Lines 590-639 Link Here
590
    return sal_True;
590
    return sal_True;
591
}
591
}
592
592
593
RegistrationPage::RegistrationMode RegistrationPage::getRegistrationMode() const
594
{
595
    RegistrationPage::RegistrationMode eMode = rmNow;
596
    if ( m_rbLater.IsChecked() )
597
        eMode = rmLater;
598
    else if ( m_rbNever.IsChecked() )
599
        eMode = rmNever;
600
    else if ( m_rbReg.IsChecked() )
601
        eMode = rmAlready;
602
    return eMode;
603
}
604
605
void RegistrationPage::prepareSingleMode()
606
{
607
    // remove wizard text (hide and cut)
608
    m_flSeparator.Hide();
609
    m_ftEnd.Hide();
610
    Size aNewSize = GetSizePixel();
611
    aNewSize.Height() -= ( aNewSize.Height() - m_flSeparator.GetPosPixel().Y() );
612
    SetSizePixel( aNewSize );
613
}
614
615
bool RegistrationPage::hasReminderDateCome()
616
{
617
    return ::svt::RegOptions().hasReminderDateCome();
618
}
619
620
void RegistrationPage::executeSingleMode()
621
{
622
    // opens the page in a single tabdialog
623
    SfxSingleTabDialog aSingleDlg( NULL, TP_REGISTRATION );
624
    RegistrationPage* pPage = new RegistrationPage( &aSingleDlg, WizardResId( TP_REGISTRATION ) );
625
    pPage->prepareSingleMode();
626
    aSingleDlg.SetPage( pPage );
627
    aSingleDlg.SetText( pPage->getSingleModeTitle() );
628
    aSingleDlg.Execute();
629
    // the registration modes "Now" and "Later" are handled by the page
630
    RegistrationPage::RegistrationMode eMode = pPage->getRegistrationMode();
631
    if ( eMode == RegistrationPage::rmNow || eMode == RegistrationPage::rmLater )
632
        pPage->commitPage( IWizardPage::CR_FINISH );
633
    if ( eMode != RegistrationPage::rmLater )
634
        ::svt::RegOptions().removeReminder();
635
}
636
637
// -----------------------------------------------------------------------
593
// -----------------------------------------------------------------------
638
594
639
static char const OEM_PRELOAD_SECTION[] = "Bootstrap";
595
static char const OEM_PRELOAD_SECTION[] = "Bootstrap";
(-)source/migration/pages.hxx (-5 lines)
Lines 209-220 Link Here
209
        rmAlready   // already registered
209
        rmAlready   // already registered
210
    };
210
    };
211
211
212
    RegistrationMode    getRegistrationMode() const;
213
    void                prepareSingleMode();
214
    inline String       getSingleModeTitle() const { return m_ftHeader.GetText(); }
212
    inline String       getSingleModeTitle() const { return m_ftHeader.GetText(); }
215
216
    static bool         hasReminderDateCome();
217
    static void         executeSingleMode();
218
};
213
};
219
214
220
} // namespace desktop
215
} // namespace desktop
(-)source/migration/wizard.cxx (-5 lines)
Lines 377-387 Link Here
377
        return sal_False;
377
        return sal_False;
378
}
378
}
379
379
380
void FirstStartWizard::overrideCheck(sal_Bool bOverride)
381
{
382
    m_bOverride = bOverride;
383
}
384
385
short FirstStartWizard::Execute()
380
short FirstStartWizard::Execute()
386
{
381
{
387
    return svt::RoadmapWizard::Execute();
382
    return svt::RoadmapWizard::Execute();
(-)source/migration/wizard.hxx (-2 lines)
Lines 69-76 Link Here
69
    virtual short Execute();
69
    virtual short Execute();
70
    virtual long PreNotify( NotifyEvent& rNEvt );
70
    virtual long PreNotify( NotifyEvent& rNEvt );
71
71
72
    void overrideCheck(sal_Bool bOverride);
73
74
private:
72
private:
75
    sal_Bool m_bOverride;
73
    sal_Bool m_bOverride;
76
    WizardState _currentState;
74
    WizardState _currentState;
(-)source/splash/splash.cxx (-15 lines)
Lines 704-722 Link Here
704
const sal_Char *SplashScreen::serviceName = "com.sun.star.office.SplashScreen";
704
const sal_Char *SplashScreen::serviceName = "com.sun.star.office.SplashScreen";
705
const sal_Char *SplashScreen::implementationName = "com.sun.star.office.comp.SplashScreen";
705
const sal_Char *SplashScreen::implementationName = "com.sun.star.office.comp.SplashScreen";
706
const sal_Char *SplashScreen::supportedServiceNames[] = {"com.sun.star.office.SplashScreen", NULL};
706
const sal_Char *SplashScreen::supportedServiceNames[] = {"com.sun.star.office.SplashScreen", NULL};
707
OUString SplashScreen::impl_getImplementationName()
708
{
709
	return OUString::createFromAscii(implementationName);
710
}
707
}
711
Sequence<OUString> SplashScreen::impl_getSupportedServiceNames()
712
{
713
	Sequence<OUString> aSequence;
714
	for (int i=0; supportedServiceNames[i]!=NULL; i++) {
715
		aSequence.realloc(i+1);
716
		aSequence[i]=(OUString::createFromAscii(supportedServiceNames[i]));
717
	}
718
	return aSequence;
719
}
720
721
}
722
(-)source/splash/splash.hxx (-4 lines)
Lines 145-154 Link Here
145
145
146
    static Reference< XInterface > getInstance(const Reference < XMultiServiceFactory >& xFactory);
146
    static Reference< XInterface > getInstance(const Reference < XMultiServiceFactory >& xFactory);
147
147
148
	// static service info
149
    static OUString  impl_getImplementationName();
150
	static Sequence<OUString> impl_getSupportedServiceNames();
151
152
	// XStatusIndicator
148
	// XStatusIndicator
153
	virtual void SAL_CALL end() throw ( RuntimeException );
149
	virtual void SAL_CALL end() throw ( RuntimeException );
154
	virtual void SAL_CALL reset() throw ( RuntimeException );
150
	virtual void SAL_CALL reset() throw ( RuntimeException );
(-)util/makefile.mk (-3 lines)
Lines 53-64 Link Here
53
			$(OBJ)$/appfirststart.obj		\
53
			$(OBJ)$/appfirststart.obj		\
54
			$(OBJ)$/lockfile.obj			\
54
			$(OBJ)$/lockfile.obj			\
55
			$(OBJ)$/lockfile2.obj			\
55
			$(OBJ)$/lockfile2.obj			\
56
			$(OBJ)$/intro.obj				\
57
			$(OBJ)$/officeipcthread.obj		\
56
			$(OBJ)$/officeipcthread.obj		\
58
			$(OBJ)$/appinit.obj				\
57
			$(OBJ)$/appinit.obj				\
59
			$(OBJ)$/cmdlineargs.obj			\
58
			$(OBJ)$/cmdlineargs.obj			\
60
			$(OBJ)$/oinstanceprovider.obj	\
61
			$(OBJ)$/opluginframefactory.obj	\
62
			$(OBJ)$/appsys.obj				\
59
			$(OBJ)$/appsys.obj				\
63
			$(OBJ)$/desktopresid.obj		\
60
			$(OBJ)$/desktopresid.obj		\
64
			$(OBJ)$/dispatchwatcher.obj		\
61
			$(OBJ)$/dispatchwatcher.obj		\

Return to issue 86384