summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/inc/brokenpackageint.hxx18
-rw-r--r--sfx2/inc/pch/precompiled_sfx2.hxx1
-rw-r--r--sfx2/inc/sfx2/app.hxx2
-rw-r--r--sfx2/inc/sfx2/basedlgs.hxx3
-rw-r--r--sfx2/inc/sfx2/dispatch.hxx4
-rw-r--r--sfx2/inc/sfx2/docfac.hxx2
-rw-r--r--sfx2/inc/sfx2/docfile.hxx6
-rw-r--r--sfx2/inc/sfx2/docfilt.hxx23
-rw-r--r--sfx2/inc/sfx2/filedlghelper.hxx3
-rw-r--r--sfx2/inc/sfx2/htmlmode.hxx68
-rw-r--r--sfx2/inc/sfx2/mnumgr.hxx2
-rw-r--r--sfx2/inc/sfx2/msg.hxx5
-rw-r--r--sfx2/inc/sfx2/objsh.hxx23
-rw-r--r--sfx2/inc/sfx2/opengrf.hxx5
-rw-r--r--sfx2/inc/sfx2/passwd.hxx2
-rw-r--r--sfx2/inc/sfx2/securitypage.hxx (renamed from sfx2/source/appl/sfxdll.cxx)49
-rw-r--r--sfx2/inc/sfx2/sfx.hrc5
-rw-r--r--sfx2/inc/sfx2/sfxcommands.h345
-rw-r--r--sfx2/inc/sfx2/sfxdlg.hxx4
-rw-r--r--sfx2/inc/sfx2/sfxsids.hrc31
-rw-r--r--sfx2/inc/sfx2/sfxuno.hxx47
-rw-r--r--sfx2/inc/sfx2/titledockwin.hxx14
-rw-r--r--sfx2/inc/sfx2/viewfrm.hxx1
-rw-r--r--sfx2/inc/sfx2/viewsh.hxx4
-rw-r--r--sfx2/inc/sfxhelp.hxx12
-rw-r--r--sfx2/inc/viewfac.hxx17
-rw-r--r--sfx2/prj/build.lst6
-rw-r--r--sfx2/prj/d.lst1
-rw-r--r--sfx2/qa/complex/CheckGlobalEventBroadcaster_writer1.java243
-rw-r--r--sfx2/qa/complex/docinfo/DocumentProperties.java438
-rw-r--r--sfx2/qa/complex/docinfo/makefile.mk41
-rw-r--r--sfx2/qa/complex/framework/CheckGlobalEventBroadcaster_writer1.java281
-rw-r--r--sfx2/qa/complex/framework/DialogThread.java (renamed from sfx2/qa/complex/DocHelper/DialogThread.java)0
-rw-r--r--sfx2/qa/complex/framework/DocHelper/makefile.mk (renamed from sfx2/qa/complex/DocHelper/makefile.mk)11
-rw-r--r--sfx2/qa/complex/framework/DocumentMetadataAccessTest.java (renamed from sfx2/qa/complex/DocumentMetadataAccessTest.java)563
-rw-r--r--sfx2/qa/complex/framework/DocumentPropertiesTest.java (renamed from sfx2/qa/complex/DocumentMetaData.java)293
-rw-r--r--sfx2/qa/complex/framework/TestDocument.java39
-rw-r--r--sfx2/qa/complex/framework/WriterHelper.java (renamed from sfx2/qa/complex/DocHelper/WriterHelper.java)71
-rw-r--r--sfx2/qa/complex/framework/makefile.mk (renamed from sfx2/qa/complex/makefile.mk)48
-rw-r--r--sfx2/qa/complex/framework/testdocuments/CUSTOM.odt (renamed from sfx2/qa/complex/testdocuments/CUSTOM.odt)bin1021 -> 1021 bytes
-rw-r--r--sfx2/qa/complex/framework/testdocuments/TEST.odt (renamed from sfx2/qa/complex/testdocuments/TEST.odt)bin13803 -> 13803 bytes
-rw-r--r--sfx2/qa/complex/framework/testdocuments/TESTRDFA.odt (renamed from sfx2/qa/complex/testdocuments/TESTRDFA.odt)bin7540 -> 7540 bytes
-rw-r--r--sfx2/qa/complex/framework/testdocuments/empty.rdf13
-rw-r--r--sfx2/qa/complex/standalonedocumentinfo/StandaloneDocumentInfoUnitTest.java66
-rw-r--r--sfx2/qa/complex/standalonedocumentinfo/Test01.java37
-rw-r--r--sfx2/qa/complex/standalonedocumentinfo/TestHelper.java14
-rw-r--r--sfx2/qa/complex/standalonedocumentinfo/makefile.mk69
-rw-r--r--sfx2/qa/cppunit/makefile.mk7
-rw-r--r--sfx2/qa/cppunit/test_metadatable.cxx2
-rw-r--r--sfx2/qa/unoapi/sfx.sce2
-rw-r--r--sfx2/sdi/sfx.sdi30
-rw-r--r--sfx2/source/appl/app.cxx2
-rw-r--r--sfx2/source/appl/app.src163
-rw-r--r--sfx2/source/appl/appcfg.cxx18
-rw-r--r--sfx2/source/appl/appdata.cxx5
-rw-r--r--sfx2/source/appl/appmain.cxx3
-rw-r--r--sfx2/source/appl/appquit.cxx53
-rw-r--r--sfx2/source/appl/appserv.cxx70
-rw-r--r--sfx2/source/appl/appuno.cxx218
-rw-r--r--sfx2/source/appl/dde.src4
-rw-r--r--sfx2/source/appl/imestatuswindow.cxx6
-rw-r--r--sfx2/source/appl/imestatuswindow.hxx7
-rw-r--r--sfx2/source/appl/impldde.cxx8
-rw-r--r--sfx2/source/appl/makefile.mk1
-rw-r--r--sfx2/source/appl/newhelp.cxx6
-rw-r--r--sfx2/source/appl/newhelp.src12
-rw-r--r--sfx2/source/appl/opengrf.cxx7
-rw-r--r--sfx2/source/appl/sfxhelp.cxx583
-rw-r--r--sfx2/source/bastyp/progress.cxx2
-rw-r--r--sfx2/source/bastyp/sfxhtml.cxx4
-rwxr-xr-x[-rw-r--r--]sfx2/source/control/dispatch.cxx25
-rw-r--r--sfx2/source/control/msg.cxx15
-rw-r--r--sfx2/source/control/unoctitm.cxx2
-rw-r--r--sfx2/source/dialog/about.cxx35
-rw-r--r--sfx2/source/dialog/alienwarn.src1
-rw-r--r--sfx2/source/dialog/basedlgs.cxx59
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx18
-rw-r--r--sfx2/source/dialog/dinfdlg.src52
-rw-r--r--sfx2/source/dialog/dinfedt.src4
-rw-r--r--sfx2/source/dialog/dockwin.cxx53
-rw-r--r--sfx2/source/dialog/filedlghelper.cxx160
-rw-r--r--sfx2/source/dialog/filedlgimpl.hxx3
-rw-r--r--sfx2/source/dialog/makefile.mk2
-rw-r--r--sfx2/source/dialog/mgetempl.src6
-rw-r--r--sfx2/source/dialog/newstyle.src4
-rw-r--r--sfx2/source/dialog/passwd.src3
-rw-r--r--sfx2/source/dialog/printopt.src22
-rw-r--r--sfx2/source/dialog/recfloat.src1
-rw-r--r--sfx2/source/dialog/securitypage.cxx553
-rw-r--r--sfx2/source/dialog/securitypage.hrc52
-rw-r--r--sfx2/source/dialog/securitypage.src174
-rw-r--r--sfx2/source/dialog/srchdlg.src6
-rw-r--r--sfx2/source/dialog/tabdlg.cxx10
-rw-r--r--sfx2/source/dialog/taskpane.cxx26
-rw-r--r--sfx2/source/dialog/templdlg.cxx44
-rw-r--r--sfx2/source/dialog/templdlg.src10
-rw-r--r--sfx2/source/dialog/titledockwin.cxx26
-rw-r--r--sfx2/source/dialog/versdlg.src10
-rw-r--r--sfx2/source/doc/DocumentMetadataAccess.cxx25
-rw-r--r--sfx2/source/doc/SfxDocumentMetaData.cxx7
-rw-r--r--sfx2/source/doc/applet.cxx383
-rw-r--r--sfx2/source/doc/doc.hrc1
-rw-r--r--sfx2/source/doc/doc.src8
-rw-r--r--sfx2/source/doc/docfac.cxx19
-rw-r--r--sfx2/source/doc/docfile.cxx102
-rw-r--r--sfx2/source/doc/docfilt.cxx14
-rw-r--r--sfx2/source/doc/doctdlg.src8
-rw-r--r--sfx2/source/doc/doctemplates.cxx2
-rw-r--r--sfx2/source/doc/docvor.src7
-rw-r--r--sfx2/source/doc/guisaveas.cxx81
-rw-r--r--sfx2/source/doc/iframe.cxx2
-rw-r--r--sfx2/source/doc/makefile.mk2
-rw-r--r--sfx2/source/doc/new.src18
-rw-r--r--sfx2/source/doc/objcont.cxx59
-rw-r--r--[-rwxr-xr-x]sfx2/source/doc/objmisc.cxx31
-rw-r--r--sfx2/source/doc/objserv.cxx18
-rw-r--r--sfx2/source/doc/objstor.cxx94
-rw-r--r--sfx2/source/doc/objxtor.cxx49
-rw-r--r--sfx2/source/doc/querytemplate.cxx4
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx41
-rw-r--r--sfx2/source/doc/syspathw32.cxx2
-rw-r--r--sfx2/source/inc/appdata.hxx3
-rw-r--r--sfx2/source/inc/applet.hxx122
-rw-r--r--sfx2/source/inc/helpid.hrc610
-rw-r--r--sfx2/source/inc/objshimp.hxx4
-rw-r--r--sfx2/source/inc/workwin.hxx4
-rw-r--r--sfx2/source/menu/menu.src7
-rwxr-xr-xsfx2/source/menu/mnumgr.cxx16
-rwxr-xr-xsfx2/source/menu/thessubmenu.cxx33
-rw-r--r--sfx2/source/menu/thessubmenu.hxx4
-rw-r--r--sfx2/source/menu/virtmenu.cxx25
-rw-r--r--sfx2/source/statbar/stbitem.cxx5
-rw-r--r--sfx2/source/view/frame2.cxx15
-rw-r--r--sfx2/source/view/frmload.cxx2
-rw-r--r--sfx2/source/view/ipclient.cxx8
-rw-r--r--sfx2/source/view/sfxbasecontroller.cxx53
-rw-r--r--sfx2/source/view/userinputinterception.cxx14
-rw-r--r--sfx2/source/view/viewfac.cxx19
-rw-r--r--sfx2/source/view/viewfrm.cxx394
-rw-r--r--sfx2/source/view/viewimp.hxx35
-rw-r--r--sfx2/source/view/viewprn.cxx61
-rw-r--r--sfx2/source/view/viewsh.cxx135
-rw-r--r--sfx2/util/hidother.src66
-rw-r--r--sfx2/util/makefile.mk8
-rw-r--r--sfx2/util/sfx.component75
145 files changed, 4758 insertions, 3456 deletions
diff --git a/sfx2/inc/brokenpackageint.hxx b/sfx2/inc/brokenpackageint.hxx
index e39c92c599ae..16f332480cf6 100644
--- a/sfx2/inc/brokenpackageint.hxx
+++ b/sfx2/inc/brokenpackageint.hxx
@@ -36,7 +36,9 @@ using namespace ::framework;
typedef ContinuationBase< ::com::sun::star::task::XInteractionApprove > SfxContinuationApprove;
typedef ContinuationBase< ::com::sun::star::task::XInteractionDisapprove > SfxContinuationDisapprove;
-class SFX2_DLLPUBLIC RequestPackageReparation : public ::cppu::WeakImplHelper1< ::com::sun::star::task::XInteractionRequest >
+class SFX2_DLLPUBLIC RequestPackageReparation :
+ public ::com::sun::star::task::XInteractionRequest,
+ public ::cppu::OWeakObject
{
::com::sun::star::uno::Any m_aRequest;
@@ -50,6 +52,11 @@ class SFX2_DLLPUBLIC RequestPackageReparation : public ::cppu::WeakImplHelper1<
public:
RequestPackageReparation( ::rtl::OUString aName );
+ // XInterface / OWeakObject
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire( ) throw ();
+ virtual void SAL_CALL release( ) throw ();
+
sal_Bool isApproved() { return m_pApprove->isSelected(); }
virtual ::com::sun::star::uno::Any SAL_CALL getRequest()
@@ -61,7 +68,9 @@ public:
throw( ::com::sun::star::uno::RuntimeException );
};
-class SFX2_DLLPUBLIC NotifyBrokenPackage : public ::cppu::WeakImplHelper1< ::com::sun::star::task::XInteractionRequest >
+class SFX2_DLLPUBLIC NotifyBrokenPackage :
+ public ::com::sun::star::task::XInteractionRequest,
+ public ::cppu::OWeakObject
{
::com::sun::star::uno::Any m_aRequest;
@@ -74,6 +83,11 @@ class SFX2_DLLPUBLIC NotifyBrokenPackage : public ::cppu::WeakImplHelper1< ::com
public:
NotifyBrokenPackage( ::rtl::OUString aName );
+ // XInterface / OWeakObject
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire( ) throw ();
+ virtual void SAL_CALL release( ) throw ();
+
sal_Bool isAborted() { return m_pAbort->isSelected(); }
virtual ::com::sun::star::uno::Any SAL_CALL getRequest()
diff --git a/sfx2/inc/pch/precompiled_sfx2.hxx b/sfx2/inc/pch/precompiled_sfx2.hxx
index b43dba7d6673..1d4003fa44e6 100644
--- a/sfx2/inc/pch/precompiled_sfx2.hxx
+++ b/sfx2/inc/pch/precompiled_sfx2.hxx
@@ -543,7 +543,6 @@
#include "svl/ownlist.hxx"
#include "svtools/parhtml.hxx"
#include "unotools/pathoptions.hxx"
-#include "svl/pickerhelper.hxx"
#include "svl/poolitem.hxx"
#include "svtools/printoptions.hxx"
#include "unotools/printwarningoptions.hxx"
diff --git a/sfx2/inc/sfx2/app.hxx b/sfx2/inc/sfx2/app.hxx
index 8a49fde7b958..980eec04cfa6 100644
--- a/sfx2/inc/sfx2/app.hxx
+++ b/sfx2/inc/sfx2/app.hxx
@@ -259,7 +259,7 @@ public:
void ResetLastDir();
//#if 0 // _SOLAR__PRIVATE
- SAL_DLLPRIVATE static SfxApplication* Is_Impl() { return pApp;}
+ SAL_DLLPRIVATE static SfxApplication* Get() { return pApp;}
SAL_DLLPRIVATE SfxDispatcher* GetAppDispatcher_Impl();
SAL_DLLPRIVATE SfxDispatcher* GetDispatcher_Impl();
diff --git a/sfx2/inc/sfx2/basedlgs.hxx b/sfx2/inc/sfx2/basedlgs.hxx
index 3508ea026637..fc7b318965b0 100644
--- a/sfx2/inc/sfx2/basedlgs.hxx
+++ b/sfx2/inc/sfx2/basedlgs.hxx
@@ -69,7 +69,6 @@ class SFX2_DLLPUBLIC SfxModalDialog: public ModalDialog
{
sal_uInt32 nUniqId;
String aExtraData;
- Timer aTimer;
const SfxItemSet* pInputSet;
SfxItemSet* pOutputSet;
@@ -77,8 +76,6 @@ private:
SAL_DLLPRIVATE SfxModalDialog(SfxModalDialog &); // not defined
SAL_DLLPRIVATE void operator =(SfxModalDialog &); // not defined
- DECL_DLLPRIVATE_LINK( TimerHdl_Impl, Timer* );
-
SAL_DLLPRIVATE void SetDialogData_Impl();
SAL_DLLPRIVATE void GetDialogData_Impl();
SAL_DLLPRIVATE void init();
diff --git a/sfx2/inc/sfx2/dispatch.hxx b/sfx2/inc/sfx2/dispatch.hxx
index f0dd2248c456..8d99d6efd9f4 100644
--- a/sfx2/inc/sfx2/dispatch.hxx
+++ b/sfx2/inc/sfx2/dispatch.hxx
@@ -122,7 +122,7 @@ friend class SfxViewFrame;
DECL_DLLPRIVATE_LINK( PostMsgHandler, SfxRequest * );
SAL_DLLPRIVATE int Call_Impl( SfxShell& rShell, const SfxSlot &rSlot, SfxRequest &rReq, BOOL bRecord );
- SAL_DLLPRIVATE sal_uInt32 _Update_Impl( BOOL,BOOL,BOOL,SfxWorkWindow*);
+ SAL_DLLPRIVATE void _Update_Impl( BOOL,BOOL,BOOL,SfxWorkWindow*);
SAL_DLLPRIVATE void CollectTools_Impl(SfxWorkWindow*);
protected:
@@ -237,7 +237,7 @@ public:
//#if 0 // _SOLAR__PRIVATE
SAL_DLLPRIVATE BOOL HasSlot_Impl( USHORT );
SAL_DLLPRIVATE void SetMenu_Impl();
- SAL_DLLPRIVATE long Update_Impl( BOOL bForce = FALSE ); // ObjectBars etc.
+ SAL_DLLPRIVATE void Update_Impl( BOOL bForce = FALSE ); // ObjectBars etc.
SAL_DLLPRIVATE BOOL IsUpdated_Impl() const;
SAL_DLLPRIVATE void DebugOutput_Impl() const;
SAL_DLLPRIVATE void ResetObjectBars_Impl();
diff --git a/sfx2/inc/sfx2/docfac.hxx b/sfx2/inc/sfx2/docfac.hxx
index 7468394d2617..89062d7b7263 100644
--- a/sfx2/inc/sfx2/docfac.hxx
+++ b/sfx2/inc/sfx2/docfac.hxx
@@ -94,7 +94,7 @@ public:
USHORT GetViewFactoryCount() const;
SfxViewFactory& GetViewFactory(USHORT i = 0) const;
- /// returns the view factory whose GetViewName delivers the requested logical name
+ /// returns the view factory whose GetAPIViewName or GetLegacyViewName delivers the requested logical name
SfxViewFactory* GetViewFactoryByViewName( const String& i_rViewName ) const;
// Filter
diff --git a/sfx2/inc/sfx2/docfile.hxx b/sfx2/inc/sfx2/docfile.hxx
index 074f74cb0e72..0cb57e7a414d 100644
--- a/sfx2/inc/sfx2/docfile.hxx
+++ b/sfx2/inc/sfx2/docfile.hxx
@@ -62,7 +62,6 @@ class Timer;
class SfxItemSet;
class DateTime;
class SvStringsDtor;
-class SvEaMgr;
#define S2BS(s) ByteString( s, RTL_TEXTENCODING_MS_1252 )
@@ -154,6 +153,7 @@ public:
const SfxFilter * GetFilter() const { return pFilter; }
const SfxFilter * GetOrigFilter( sal_Bool bNotCurrent = sal_False ) const;
const String& GetOrigURL() const;
+
SfxItemSet * GetItemSet() const;
void SetItemSet(SfxItemSet *pSet);
void Close();
@@ -207,8 +207,6 @@ public:
SvStream* GetInStream();
SvStream* GetOutStream();
- SvEaMgr* GetEaMgr();
-
sal_Bool Commit();
sal_Bool IsStorage();
@@ -322,11 +320,11 @@ public:
static com::sun::star::uno::Sequence < com::sun::star::util::RevisionTag > GetVersionList(
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
- static sal_Bool EqualURLs( const ::rtl::OUString& aFirstURL, const ::rtl::OUString& aSecondURL );
static ::rtl::OUString CreateTempCopyWithExt( const ::rtl::OUString& aURL );
static sal_Bool CallApproveHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xHandler, ::com::sun::star::uno::Any aRequest, sal_Bool bAllowAbort );
static sal_Bool SetWritableForUserOnly( const ::rtl::OUString& aURL );
+ static sal_uInt32 CreatePasswordToModifyHash( const ::rtl::OUString& aPasswd, sal_Bool bWriter );
};
SV_DECL_IMPL_REF( SfxMedium )
diff --git a/sfx2/inc/sfx2/docfilt.hxx b/sfx2/inc/sfx2/docfilt.hxx
index b4118272bb88..f024fdb07c06 100644
--- a/sfx2/inc/sfx2/docfilt.hxx
+++ b/sfx2/inc/sfx2/docfilt.hxx
@@ -37,6 +37,7 @@
#include <com/sun/star/uno/RuntimeException.hpp>
#include <tools/wldcrd.hxx>
+// TODO/LATER: The flags should be part of the UNO specification
#define SFX_FILTER_IMPORT 0x00000001L
#define SFX_FILTER_EXPORT 0x00000002L
#define SFX_FILTER_TEMPLATE 0x00000004L
@@ -45,13 +46,13 @@
#define SFX_FILTER_OWN 0x00000020L
#define SFX_FILTER_ALIEN 0x00000040L
#define SFX_FILTER_USESOPTIONS 0x00000080L
-#define SFX_FILTER_NOTINFILEDLG 0x00001000L
-#define SFX_FILTER_NOTINCHOOSER 0x00002000L
#define SFX_FILTER_DEFAULT 0x00000100L
#define SFX_FILTER_EXECUTABLE 0x00000200L
#define SFX_FILTER_SUPPORTSSELECTION 0x00000400L
#define SFX_FILTER_MAPTOAPPPLUG 0x00000800L
+#define SFX_FILTER_NOTINFILEDLG 0x00001000L
+#define SFX_FILTER_NOTINCHOOSER 0x00002000L
#define SFX_FILTER_ASYNC 0x00004000L
// Legt Objekt nur an, kein Laden
#define SFX_FILTER_CREATOR 0x00008000L
@@ -64,6 +65,10 @@
#define SFX_FILTER_SILENTEXPORT 0x00200000L
#define SFX_FILTER_BROWSERPREFERED 0x00400000L
+
+#define SFX_FILTER_ENCRYPTION 0x01000000L
+#define SFX_FILTER_PASSWORDTOMODIFY 0x02000000L
+
#define SFX_FILTER_PREFERED 0x10000000L
#define SFX_FILTER_VERSION_NONE 0
@@ -72,20 +77,6 @@
#include <sfx2/sfxdefs.hxx>
//========================================================================
-
-namespace sfx2 {
-
-/** Returns true if the passed string is the name of a Microsoft Office file
- format filter supporting export of password protected documents.
-
- This function is just a hack for #i105076# is fixed and needs to be removed
- then.
- */
-SFX2_DLLPUBLIC bool CheckMSPasswordCapabilityForExport( const String& rFilterName );
-
-} // namespace sfx2
-
-//========================================================================
class SfxFilterContainer;
class SotStorage;
class SFX2_DLLPUBLIC SfxFilter
diff --git a/sfx2/inc/sfx2/filedlghelper.hxx b/sfx2/inc/sfx2/filedlghelper.hxx
index 9b775f8e827d..619358f077ac 100644
--- a/sfx2/inc/sfx2/filedlghelper.hxx
+++ b/sfx2/inc/sfx2/filedlghelper.hxx
@@ -281,8 +281,7 @@ public:
Pointer to an array of help ids. For each element in _pControlId, there must be
a corresponding element herein.
*/
- void SetControlHelpIds( const sal_Int16* _pControlId, const sal_Int32* _pHelpId );
- void SetDialogHelpId( const sal_Int32 _nHelpId );
+ void SetControlHelpIds( const sal_Int16* _pControlId, const char** _pHelpId );
void CreateMatcher( const String& rName );
/** sets the context of the dialog and trigger necessary actions e.g. loading config, setting help id
diff --git a/sfx2/inc/sfx2/htmlmode.hxx b/sfx2/inc/sfx2/htmlmode.hxx
new file mode 100644
index 000000000000..51f341c5c3c0
--- /dev/null
+++ b/sfx2/inc/sfx2/htmlmode.hxx
@@ -0,0 +1,68 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _SFX_HTMLMODE_HXX_
+#define _SFX_HTMLMODE_HXX_
+
+
+#define HTMLMODE_ON 0x0001
+#define HTMLMODE_PARA_BORDER 0x0002 /* Absatzumrandungen */
+#define HTMLMODE_PARA_DISTANCE 0x0004 /* bestimmte Absatzabstaende */
+#define HTMLMODE_SMALL_CAPS 0x0008 /* Kapitaelchen */
+#define HTMLMODE_FRM_COLUMNS 0x0010 /* spaltige Rahmen */
+#define HTMLMODE_SOME_STYLES 0x0020 /* mind. MS IE */
+#define HTMLMODE_FULL_STYLES 0x0040 /* == SW */
+#define HTMLMODE_BLINK 0x0080 /* blinkende Zeichen*/
+#define HTMLMODE_PARA_BLOCK 0x0100 /* Blocksatz */
+#define HTMLMODE_DROPCAPS 0x0200 /* Initialen*/
+#define HTMLMODE_FIRSTLINE 0x0400 /* Erstzeileneinzug mit Spacer == NS 3.0 */
+#define HTMLMODE_GRAPH_POS 0x0800 /* Grafikpositionen Hintergrund */
+#define HTMLMODE_FULL_ABS_POS 0x1000 /* abs. Rahmenpositionierung */
+#define HTMLMODE_SOME_ABS_POS 0x2000 /* abs. Rahmenpositionierung vollst.*/
+#define HTMLMODE_RESERVED1 0x4000
+#define HTMLMODE_RESERVED0 0x8000
+
+
+#endif
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sfx2/inc/sfx2/mnumgr.hxx b/sfx2/inc/sfx2/mnumgr.hxx
index 9c9b566d9d9d..f1df0f0aa547 100644
--- a/sfx2/inc/sfx2/mnumgr.hxx
+++ b/sfx2/inc/sfx2/mnumgr.hxx
@@ -134,7 +134,7 @@ public:
void EndInsert();
void CheckItem( USHORT, BOOL );
void RemoveItem( USHORT );
- void InsertItem( USHORT, const String&, MenuItemBits,
+ void InsertItem( USHORT, const String&, MenuItemBits, const rtl::OString& rHelpId,
USHORT nPos = MENU_APPEND );
void InsertSeparator( USHORT nPos = MENU_APPEND );
// @deprecated (end)
diff --git a/sfx2/inc/sfx2/msg.hxx b/sfx2/inc/sfx2/msg.hxx
index efbc2d2c75af..10fbd222a2ed 100644
--- a/sfx2/inc/sfx2/msg.hxx
+++ b/sfx2/inc/sfx2/msg.hxx
@@ -29,6 +29,9 @@
#include <tools/rtti.hxx>
#include <sfx2/shell.hxx>
+#include <rtl/string.hxx>
+#include <rtl/ustring.hxx>
+#include <sfx2/dllapi.h>
//--------------------------------------------------------------------
@@ -287,6 +290,8 @@ public:
USHORT GetValue() const { return nValue; }
const SfxType* GetType() const { return pType; }
const char* GetUnoName() const { return pUnoName; }
+ SFX2_DLLPUBLIC rtl::OString GetCommand() const;
+ SFX2_DLLPUBLIC rtl::OUString GetCommandString() const;
USHORT GetFormalArgumentCount() const { return nArgDefCount; }
const SfxFormalArgument& GetFormalArgument( USHORT nNo ) const
diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx
index d514235cbfa2..9473ac126bd7 100644
--- a/sfx2/inc/sfx2/objsh.hxx
+++ b/sfx2/inc/sfx2/objsh.hxx
@@ -286,12 +286,14 @@ public:
sal_Bool HasName() const { return bHasName; }
virtual String GetAPIName() const;
void SetHasName( sal_Bool bSet = sal_True ) { bHasName = bSet; }
+ void SetReadOnly();
sal_Bool IsReadOnly() const;
sal_Bool IsReadOnlyMedium() const;
void SetReadOnlyUI( sal_Bool bReadOnly = sal_True );
sal_Bool IsReadOnlyUI() const;
void SetNoName();
sal_Bool IsInModalMode() const;
+ sal_Bool IsInPrepareClose() const;
//<!--Added by PengYunQuan for Validity Cell Range Picker
virtual sal_Bool AcceptStateUpdate() const;
//-->Added by PengYunQuan for Validity Cell Range Picker
@@ -345,6 +347,9 @@ public:
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
virtual void UpdateLinks();
+ // called for a few slots like SID_SAVE[AS]DOC, SID_PRINTDOC[DIRECT], derived classes may abort the action
+ virtual sal_Bool QuerySlotExecutable( USHORT nSlotId );
+
sal_Bool SaveChildren(BOOL bObjectsOnly=FALSE);
sal_Bool SaveAsChildren( SfxMedium &rMedium );
sal_Bool SwitchChildrenPersistance(
@@ -438,6 +443,13 @@ public:
void SetSaveVersionOnClose( sal_Bool bSet );
void ResetFromTemplate( const String& rTemplateName, const String& rFileName );
+ // TODO/LATER: the following two methods should be replaced by Get/SetModifPasswordInfo in future
+ sal_uInt32 GetModifyPasswordHash() const;
+ sal_Bool SetModifyPasswordHash( sal_uInt32 nHash );
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > GetModifyPasswordInfo() const;
+ sal_Bool SetModifyPasswordInfo( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aInfo );
+
static sal_uInt32 HandleFilter( SfxMedium* pMedium, SfxObjectShell* pDoc );
virtual void ViewAssigned();
@@ -685,6 +697,15 @@ public:
sal_Int32 nVersion,
sal_Bool bTemplate = sal_False) const = 0;
+ // change recording and respective passwword protection for Writer and Calc
+ // slots available for Writer: FN_REDLINE_ON, FN_REDLINE_ON
+ // slots used for Calc: FID_CHG_RECORD, SID_CHG_PROTECT
+ virtual bool IsChangeRecording() const;
+ virtual bool HasChangeRecordProtection() const;
+ virtual void SetChangeRecording( bool bActivate );
+ virtual bool SetProtectionPassword( const String &rPassword );
+ virtual bool GetProtectionHash( /*out*/ ::com::sun::star::uno::Sequence< sal_Int8 > &rPasswordHash );
+
// =================================
//#if 0 // _SOLAR__PRIVATE
@@ -713,6 +734,8 @@ public:
SAL_DLLPRIVATE sal_uInt16 ImplCheckSignaturesInformation(
const ::com::sun::star::uno::Sequence< ::com::sun::star::security::DocumentSignatureInformation >& aInfos );
SAL_DLLPRIVATE void CheckEncryption_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xHandler );
+ SAL_DLLPRIVATE void SetModifyPasswordEntered( sal_Bool bEntered = sal_True );
+ SAL_DLLPRIVATE sal_Bool IsModifyPasswordEntered();
SAL_DLLPRIVATE void InitBasicManager_Impl();
SAL_DLLPRIVATE SfxObjectShell_Impl* Get_Impl() { return pImp; }
diff --git a/sfx2/inc/sfx2/opengrf.hxx b/sfx2/inc/sfx2/opengrf.hxx
index 0d11462685d5..df8ae09f90a3 100644
--- a/sfx2/inc/sfx2/opengrf.hxx
+++ b/sfx2/inc/sfx2/opengrf.hxx
@@ -54,10 +54,7 @@ public:
String GetCurrentFilter() const;
void SetCurrentFilter(const String&);
- /// Set dialog help id at FileDlgHelper
- void SetControlHelpIds( const INT16* _pControlId, const INT32* _pHelpId );
- /// Set control help ids at FileDlgHelper
- void SetDialogHelpId( const INT32 _nHelpId );
+ void SetControlHelpIds( const INT16* _pControlId, const char** _pHelpId );
private:
// disable copy and assignment
SFX2_DLLPRIVATE SvxOpenGraphicDialog (const SvxOpenGraphicDialog&);
diff --git a/sfx2/inc/sfx2/passwd.hxx b/sfx2/inc/sfx2/passwd.hxx
index 4f4a04834257..b0105553cd40 100644
--- a/sfx2/inc/sfx2/passwd.hxx
+++ b/sfx2/inc/sfx2/passwd.hxx
@@ -78,7 +78,7 @@ public:
void SetMinLen( USHORT Len );
void SetMaxLen( USHORT Len );
- void SetEditHelpId( ULONG nId ) { maPasswordED.SetHelpId( nId ); }
+ void SetEditHelpId( const rtl::OString& rId ) { maPasswordED.SetHelpId( rId ); }
void ShowExtras( USHORT nExtras ) { mnExtras = nExtras; }
void AllowAsciiOnly( bool i_bAsciiOnly = true ) { mbAsciiOnly = i_bAsciiOnly; }
diff --git a/sfx2/source/appl/sfxdll.cxx b/sfx2/inc/sfx2/securitypage.hxx
index 956a61b3e247..d25f0ee0b967 100644
--- a/sfx2/source/appl/sfxdll.cxx
+++ b/sfx2/inc/sfx2/securitypage.hxx
@@ -24,46 +24,35 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+#ifndef _SECURITYPAGE_HXX_
+#define _SECURITYPAGE_HXX_
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sfx2.hxx"
+#include "sfx2/tabdlg.hxx"
+#include "sfx2/htmlmode.hxx"
-#ifdef WIN
-#include <svwin.h>
-#endif
+#include <memory>
-#ifndef GCC
-#endif
-#ifdef WIN
+//////////////////////////////////////////////////////////////////////
-// Statische DLL-Verwaltungs-Variablen
-static HINSTANCE hDLLInst = 0;
+struct SfxSecurityPage_Impl;
-//==========================================================================
-
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
+class SfxSecurityPage : public SfxTabPage
{
-#ifndef WNT
- if ( nHeap )
- UnlockData( 0 );
-#endif
-
- hDLLInst = hDLL;
-
- return TRUE;
-}
+ std::auto_ptr< SfxSecurityPage_Impl > m_pImpl;
+protected:
+ SfxSecurityPage( Window* pParent, const SfxItemSet& );
+ virtual ~SfxSecurityPage();
-//--------------------------------------------------------------------------
-
-extern "C" int CALLBACK WEP( int )
-{
- return 1;
-}
+ virtual BOOL FillItemSet( SfxItemSet& );
+ virtual void Reset( const SfxItemSet& );
+public:
+ static SfxTabPage* Create( Window* pParent, const SfxItemSet& );
+};
-//==========================================================================
+//////////////////////////////////////////////////////////////////////
-#endif
+#endif // #ifndef _SECURITYPAGE_HXX_
diff --git a/sfx2/inc/sfx2/sfx.hrc b/sfx2/inc/sfx2/sfx.hrc
index 917bd75e4138..a49b003b5b49 100644
--- a/sfx2/inc/sfx2/sfx.hrc
+++ b/sfx2/inc/sfx2/sfx.hrc
@@ -229,10 +229,15 @@
#define TP_DOCINFOUSER (RID_SFX_START+5)
#define TP_DOCINFORELOAD (RID_SFX_START+13)
#define TP_CUSTOMPROPERTIES (RID_SFX_START+14)
+#define TP_DOCINFOSECURITY (RID_SFX_START+215)
#define DLG_DOCINFO_EDT (RID_SFX_START+6)
#define TP_MANAGE_STYLES (RID_SFX_START+7)
#define DLG_STYLE_DESIGNER (RID_SFX_START+8)
+#define RID_SFX_PROTECT_RECORDS (RID_SFX_START+216)
+#define RID_SFX_UNPROTECT_RECORDS (RID_SFX_START+217)
+#define RID_SFX_INCORRECT_PASSWORD (RID_SFX_START+218)
+
#define STR_STYLE_FILTER_AUTO (RID_SFX_START+9)
#define STR_STYLE_FILTER_USED (RID_SFX_START+10)
#define STR_STYLE_FILTER_USERDEF (RID_SFX_START+11)
diff --git a/sfx2/inc/sfx2/sfxcommands.h b/sfx2/inc/sfx2/sfxcommands.h
new file mode 100644
index 000000000000..bdf27baac7b3
--- /dev/null
+++ b/sfx2/inc/sfx2/sfxcommands.h
@@ -0,0 +1,345 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef SFX2_SFXCOMMANDS_HRC
+#define SFX2_SFXCOMMANDS_HRC
+
+#define CMD_SID_VIEWSHELL0 ".uno:_SwitchViewShell0"
+#define CMD_SID_VIEWSHELL1 ".uno:_SwitchViewShell1"
+#define CMD_SID_VIEWSHELL2 ".uno:_SwitchViewShell2"
+#define CMD_SID_VIEWSHELL3 ".uno:_SwitchViewShell3"
+#define CMD_SID_VIEWSHELL4 ".uno:_SwitchViewShell4"
+#define CMD_SID_ABOUT ".uno:About"
+#define CMD_SID_ACTIVATE ".uno:Activate"
+#define CMD_SID_HELPBALLOONS ".uno:ActiveHelp"
+#define CMD_SID_STYLE_FAMILY ".uno:ActualStyleFamily"
+#define CMD_SID_NEWDOC ".uno:NewDoc"
+#define CMD_SID_CREATELINK ".uno:AddBookmark"
+#define CMD_SID_NEWDOCDIRECT ".uno:AddDirect"
+#define CMD_SID_TEMPLATE_ADDRESSBOKSOURCE ".uno:AddressBookSource"
+#define CMD_SID_BASICIDE_ADDWATCH ".uno:AddWatch"
+#define CMD_SID_DOCINFO_AUTHOR ".uno:Author"
+#define CMD_SID_AUTOHIDE ".uno:AutoHide"
+#define CMD_SID_AUTOPILOTMENU ".uno:AutoPilotMenu"
+#define CMD_SID_GALLERY_BG_BRUSH ".uno:BackgroundImage"
+#define CMD_SID_BACKSPACE ".uno:Backspace"
+#define CMD_SID_BASICBREAK ".uno:BasicBreak"
+#define CMD_SID_BASICIDE_APPEAR ".uno:BasicIDEAppear"
+#define CMD_SID_BASICSTEPINTO ".uno:BasicStepInto"
+#define CMD_SID_BASICSTEPOUT ".uno:BasicStepOut"
+#define CMD_SID_BASICSTEPOVER ".uno:BasicStepOver"
+#define CMD_SID_BASICSTOP ".uno:BasicStop"
+#define CMD_SID_BROWSER ".uno:Beamer"
+#define CMD_SID_BASICIDE_BRKPNTSCHANGED ".uno:BreakPointsChanged"
+#define CMD_SID_BROWSE_BACKWARD ".uno:BrowseBackward"
+#define CMD_SID_BROWSE_FORWARD ".uno:BrowseForward"
+#define CMD_SID_BROWSER_MODE ".uno:BrowseView"
+#define CMD_SID_BUILD_VERSION ".uno:BuildVersion"
+#define CMD_SID_CAPTION ".uno:Caption"
+#define CMD_SID_STYLE_FAMILY1 ".uno:CharStyle"
+#define CMD_SID_CHECK_KEY ".uno:CheckKey"
+#define CMD_SID_BASICIDE_CHOOSEMACRO ".uno:ChooseMacro"
+#define CMD_SID_CLEARHISTORY ".uno:ClearHistory"
+#define CMD_SID_CLOSEWINS ".uno:CloseWins"
+#define CMD_SID_CLOSEDOCS ".uno:CloseDocs"
+#define CMD_SID_CLOSEDOC ".uno:CloseDoc"
+#define CMD_SID_CLOSEWIN ".uno:CloseWin"
+#define CMD_SID_CLOSING ".uno:Closing"
+#define CMD_SID_DOCINFO_COMMENTS ".uno:Comments"
+#define CMD_SID_OFFICE_COMMERCIAL_USE ".uno:CommercialUse"
+#define CMD_SID_DOCUMENT_COMPARE ".uno:CompareDocuments"
+#define CMD_SID_BASICCOMPILE ".uno:CompileBasic"
+#define CMD_SID_CONFIG ".uno:ConfigureDialog"
+#define CMD_SID_CONTEXT ".uno:Context"
+#define CMD_SID_COPY ".uno:Copy"
+#define CMD_SID_CRASH ".uno:Crash"
+#define CMD_SID_BASICIDE_CREATEMACRO ".uno:CreateMacro"
+#define CMD_SID_CURRENT_URL ".uno:CurrentURL"
+#define CMD_SID_CURSORENDOFSCREEN ".uno:CursorEndOfScreen"
+#define CMD_SID_CURSORTOPOFSCREEN ".uno:CursorTopOfScreen"
+#define CMD_SID_OFFICE_CUSTOMERNUMBER ".uno:CustomerNumber"
+#define CMD_SID_CUT ".uno:Cut"
+#define CMD_SID_DEFAULTFILEPATH ".uno:DefaultFilePath"
+#define CMD_SID_DEFAULTFILENAME ".uno:DefaultFileName"
+#define CMD_SID_DELETE ".uno:Delete"
+#define CMD_SID_BASICIDE_DELETECURRENT ".uno:DeleteCurrent"
+#define CMD_SID_STYLE_DELETE ".uno:DeleteStyle"
+#define CMD_SID_STYLE_DESIGNER ".uno:DesignerDialog"
+#define CMD_SID_STYLE_DRAGHIERARCHIE ".uno:DragHierarchy"
+#define CMD_SID_EDITDOC ".uno:EditDoc"
+#define CMD_SID_BASICIDE_EDITMACRO ".uno:EditMacro"
+#define CMD_SID_STYLE_EDIT ".uno:EditStyle"
+#define CMD_FID_SEARCH_NOW ".uno:ExecuteSearch"
+#define CMD_SID_EXTENDEDHELP ".uno:ExtendedHelp"
+#define CMD_SID_FILE_NAME ".uno:FileName"
+#define CMD_SID_FOCUSURLBOX ".uno:FocusUrlBox"
+#define CMD_SID_FORMATMENU ".uno:FormatMenu"
+#define CMD_SID_STYLE_FAMILY3 ".uno:FrameStyle"
+#define CMD_SID_FRAMETITLE ".uno:FrameTitle"
+#define CMD_SID_PROGFILENAME ".uno:FullName"
+#define CMD_SID_DOCFULLNAME ".uno:FullName"
+#define CMD_SID_WIN_FULLSCREEN ".uno:FullScreen"
+#define CMD_SID_FILLFRAME ".uno:GetFrameWindow"
+#define CMD_SID_CURSORDOWN ".uno:GoDown"
+#define CMD_SID_CURSORPAGEDOWN ".uno:GoDownBlock"
+#define CMD_SID_CURSORPAGEDOWN_SEL ".uno:GoDownBlockSel"
+#define CMD_SID_CURSORDOWN_SEL ".uno:GoDownSel"
+#define CMD_SID_CURSORLEFT ".uno:GoLeft"
+#define CMD_SID_CURSORPAGELEFT ".uno:GoLeftBlock"
+#define CMD_SID_CURSORPAGELEFT_SEL ".uno:GoLeftBlockSel"
+#define CMD_SID_CURSORLEFT_SEL ".uno:GoLeftSel"
+#define CMD_SID_CURSORRIGHT ".uno:GoRight"
+#define CMD_SID_CURSORRIGHT_SEL ".uno:GoRightSel"
+#define CMD_SID_CURSORENDOFFILE ".uno:GoToEndOfData"
+#define CMD_SID_CURSORENDOFFILE_SEL ".uno:GoToEndOfDataSel"
+#define CMD_SID_CURSOREND ".uno:GoToEndOfRow"
+#define CMD_SID_CURSOREND_SEL ".uno:GoToEndOfRowSel"
+#define CMD_SID_CURSORTOPOFFILE ".uno:GoToStart"
+#define CMD_SID_CURSORHOME ".uno:GoToStartOfRow"
+#define CMD_SID_CURSORHOME_SEL ".uno:GoToStartOfRowSel"
+#define CMD_SID_CURSORTOPOFFILE_SEL ".uno:GoToStartSel"
+#define CMD_SID_CURSORUP ".uno:GoUp"
+#define CMD_SID_CURSORPAGEUP ".uno:GoUpBlock"
+#define CMD_SID_CURSORPAGEUP_SEL ".uno:GoUpBlockSel"
+#define CMD_SID_CURSORUP_SEL ".uno:GoUpSel"
+#define CMD_SID_HELP_ANNOTATE ".uno:HelpAnnotate"
+#define CMD_SID_HELP_BOOKMARK ".uno:HelpBookmark"
+#define CMD_SID_HELP_HELPFILEBOX ".uno:HelpChooseFile"
+#define CMD_SID_HELP_DOWNLOAD ".uno:HelpDownload"
+#define CMD_SID_HELP_PI ".uno:HelperDialog"
+#define CMD_SID_HELPINDEX ".uno:HelpIndex"
+#define CMD_SID_HELPMENU ".uno:HelpMenu"
+#define CMD_SID_HELPONHELP ".uno:HelpOnHelp"
+#define CMD_SID_HELP_SEARCH ".uno:HelpSearch"
+#define CMD_SID_HELPTIPS ".uno:HelpTip"
+#define CMD_SID_HELP_ZOOMIN ".uno:HelpZoomIn"
+#define CMD_SID_HELP_ZOOMOUT ".uno:HelpZoomOut"
+#define CMD_SID_BASICIDE_HIDECURPAGE ".uno:HideCurPage"
+#define CMD_SID_HYPERLINK_DIALOG ".uno:HyperlinkDialog"
+#define CMD_SID_INSERTDOC ".uno:InsertDoc"
+#define CMD_SID_HYPERLINK_INSERT ".uno:InsertHyperlink"
+#define CMD_SID_INSERT_FLOATINGFRAME ".uno:InsertObjectFloatingFrame"
+#define CMD_SID_INTERNET_ONLINE ".uno:InternetOnline"
+#define CMD_SID_INTERNET_SEARCH ".uno:InternetSearch"
+#define CMD_SID_DOC_LOADING ".uno:IsLoading"
+#define CMD_SID_IMG_LOADING ".uno:IsLoadingImages"
+#define CMD_SID_PRINTOUT ".uno:IsPrinting"
+#define CMD_SID_JUMPTOMARK ".uno:JumpToMark"
+#define CMD_SID_DOCINFO_KEYWORDS ".uno:Keywords"
+#define CMD_SID_BASICIDE_LIBLOADED ".uno:LibLoaded"
+#define CMD_SID_BASICIDE_LIBREMOVED ".uno:LibRemoved"
+#define CMD_SID_BASICIDE_LIBSELECTED ".uno:LibSelect"
+#define CMD_SID_BASICIDE_LIBSELECTOR ".uno:LibSelector"
+#define CMD_SID_OFFICE_PLK ".uno:LicenceKey"
+#define CMD_SID_CONFIGACCEL ".uno:LoadAccel"
+#define CMD_SID_BASICLOAD ".uno:LoadBasic"
+#define CMD_SID_LOADCONFIG ".uno:LoadConfiguration"
+#define CMD_SID_CONFIGEVENT ".uno:LoadEvents"
+#define CMD_SID_CONFIGMENU ".uno:LoadMenu"
+#define CMD_SID_CONFIGSTATUSBAR ".uno:LoadStatusBar"
+#define CMD_SID_TOOLBOXOPTIONS ".uno:LoadToolBox"
+#define CMD_SID_LOGOUT ".uno:Logout"
+#define CMD_SID_SCRIPTORGANIZER ".uno:ScriptOrganizer"
+#define CMD_SID_MACROORGANIZER ".uno:MacroOrganizer"
+#define CMD_SID_RUNMACRO ".uno:RunMacro"
+#define CMD_SID_BASICCHOOSER ".uno:MacroDialog"
+#define CMD_SID_MAIL_NOTIFY ".uno:MailReceipt"
+#define CMD_SID_MAIL_CHILDWIN ".uno:MailWindow"
+#define CMD_SID_BASICIDE_MATCHGROUP ".uno:MatchGroup"
+#define CMD_SID_TOGGLE_MENUBAR ".uno:MenuBarVisible"
+#define CMD_SID_DOCUMENT_MERGE ".uno:MergeDocuments"
+#define CMD_SID_ATTR_METRIC ".uno:MetricUnit"
+#define CMD_SID_MODIFIED ".uno:Modified"
+#define CMD_SID_DOC_MODIFIED ".uno:ModifiedStatus"
+#define CMD_SID_BASICIDE_MODULEDLG ".uno:ModuleDialog"
+#define CMD_SID_BASICIDE_NAMECHANGEDONTAB ".uno:NameChangedOnTab"
+#define CMD_SID_NAVIGATOR ".uno:Navigator"
+#define CMD_SID_RESTORE_EDITING_VIEW ".uno:RestoreEditingView"
+#define CMD_SID_BASICIDE_NEWDIALOG ".uno:NewDialog"
+#define CMD_SID_BASICIDE_NEWMODULE ".uno:NewModule"
+#define CMD_SID_CREATE_BASICOBJECT ".uno:NewObject"
+#define CMD_SID_STYLE_NEW ".uno:NewStyle"
+#define CMD_SID_NEWWINDOW ".uno:NewWindow"
+#define CMD_SID_BASICIDE_OBJCAT ".uno:ObjectCatalog"
+#define CMD_SID_OBJECT ".uno:ObjectMenue"
+#define CMD_SID_OLD_PALK ".uno:OldPALK"
+#define CMD_SID_OPENDOC ".uno:Open"
+#define CMD_SID_WEBHTML ".uno:WebHtml"
+#define CMD_SID_OPENHYPERLINK ".uno:OpenHyperlink"
+#define CMD_SID_DOCINFO_TITLE ".uno:DocInfoTitle"
+#define CMD_SID_OPENTEMPLATE ".uno:OpenTemplate"
+#define CMD_SID_OPENURL ".uno:OpenUrl"
+#define CMD_SID_OPTIONS ".uno:Options"
+#define CMD_SID_ORGANIZER ".uno:Organizer"
+#define CMD_SID_STYLE_FAMILY4 ".uno:PageStyle"
+#define CMD_SID_STYLE_FAMILY2 ".uno:ParaStyle"
+#define CMD_SID_PARTWIN ".uno:PartWindow"
+#define CMD_SID_PASTE ".uno:Paste"
+#define CMD_SID_CLIPBOARD_FORMAT_ITEMS ".uno:ClipboardFormatItems"
+#define CMD_SID_PASTE_SPECIAL ".uno:PasteSpecial"
+#define CMD_SID_DOCPATH ".uno:DocPath"
+#define CMD_SID_PICKLIST ".uno:PickList"
+#define CMD_SID_PLAYMACRO ".uno:PlayMacro"
+#define CMD_SID_PLUGINS_ACTIVE ".uno:PlugInsActive"
+#define CMD_SID_PRINTDOC ".uno:Print"
+#define CMD_SID_PRINTDOCDIRECT ".uno:PrintDefault"
+#define CMD_SID_PRINTER_NAME ".uno:Printer"
+#define CMD_SID_SETUPPRINTER ".uno:PrinterSetup"
+#define CMD_SID_PRINTPREVIEW ".uno:PrintPreview"
+#define CMD_SID_OFFICE_PRIVATE_USE ".uno:PrivateUse"
+#define CMD_SID_DOCINFO ".uno:SetDocumentProperties"
+#define CMD_SID_QUITAPP ".uno:Quit"
+#define CMD_SID_DOC_READONLY ".uno:ReadOnly"
+#define CMD_SID_RECORDMACRO ".uno:MacroRecorder"
+#define CMD_SID_STOP_RECORDING ".uno:StopRecording"
+#define CMD_SID_RECORDING_FLOATWINDOW ".uno:MacroRecordingFloat"
+#define CMD_SID_REDO ".uno:Redo"
+#define CMD_SID_DELETE_BASICOBJECT ".uno:ReleaseObject"
+#define CMD_SID_RELOAD ".uno:Reload"
+#define CMD_SID_BASICIDE_REMOVEWATCH ".uno:RemoveWatch"
+#define CMD_SID_BASICIDE_RENAMECURRENT ".uno:RenameCurrent"
+#define CMD_SID_REPAINT ".uno:Repaint"
+#define CMD_SID_REPEAT ".uno:RepeatAction"
+#define CMD_SID_RUBY_DIALOG ".uno:RubyDialog"
+#define CMD_SID_BASICRUN ".uno:RunBasic"
+#define CMD_SID_STARTSW ".uno:RunStarWriter"
+#define CMD_SID_SAVEDOC ".uno:Save"
+#define CMD_SID_SAVEDOCS ".uno:SaveAll"
+#define CMD_SID_SAVEASDOC ".uno:SaveAs"
+#define CMD_SID_DOCTEMPLATE ".uno:SaveAsTemplate"
+#define CMD_SID_BASICSAVEAS ".uno:SaveBasicAs"
+#define CMD_SID_EXPORT_DIALOG ".uno:ExportDialog"
+#define CMD_SID_IMPORT_DIALOG ".uno:ImportDialog"
+#define CMD_SID_SAVECONFIG ".uno:SaveConfiguration"
+#define CMD_SID_DOC_SAVED ".uno:Saved"
+#define CMD_SID_BASICIDE_SBXDELETED ".uno:SbxDeleted"
+#define CMD_SID_BASICIDE_SBXINSERTED ".uno:SbxInserted"
+#define CMD_SID_BASICIDE_SBXRENAMED ".uno:SbxRenamed"
+#define CMD_SID_MAIL_SCROLLBODY_PAGEDOWN ".uno:ScrollBodyPageDown"
+#define CMD_SID_SEARCH_DLG ".uno:SearchDialog"
+#define CMD_SID_SEARCH_OPTIONS ".uno:SearchOptions"
+#define CMD_SID_SEARCH_ITEM ".uno:SearchProperties"
+#define CMD_SID_SELECTALL ".uno:SelectAll"
+#define CMD_FN_FAX ".uno:SendFax"
+#define CMD_SID_MAIL_SENDDOC ".uno:SendMail"
+#define CMD_SID_MAIL_SENDDOCASPDF ".uno:SendMailDocAsPDF"
+#define CMD_SID_MAIL_SENDDOCASFORMAT ".uno:SendMailDocAsFormat"
+#define CMD_SID_MAIL_SENDDOCASMS ".uno:SendMailDocAsMS"
+#define CMD_SID_MAIL_SENDDOCASOOO ".uno:SendMailDocAsOOo"
+#define CMD_SID_SETOPTIONS ".uno:SetOptions"
+#define CMD_SID_OFFICE_PALK ".uno:SetPALK"
+#define CMD_SID_SHOW_BROWSER ".uno:ShowBrowser"
+#define CMD_SID_SHOWPOPUPS ".uno:ShowPopups"
+#define CMD_SID_BASICIDE_SHOWSBX ".uno:ShowSbx"
+#define CMD_SID_SOURCEVIEW ".uno:SourceView"
+#define CMD_SID_ONLINE_REGISTRATION_DLG ".uno:StartRegistrationDialog"
+#define CMD_SID_STATUSBARTEXT ".uno:StatusBar"
+#define CMD_SID_TOGGLESTATUSBAR ".uno:StatusBarVisible"
+#define CMD_SID_BASICIDE_STAT_DATE ".uno:StatusGetDate"
+#define CMD_SID_BASICIDE_STAT_POS ".uno:StatusGetPosition"
+#define CMD_SID_BASICIDE_STAT_TITLE ".uno:StatusGetTitle"
+#define CMD_SID_BASICIDE_STOREALLMODULESOURCES ".uno:StoreAllModuleSources"
+#define CMD_SID_BASICIDE_STOREMODULESOURCE ".uno:StoreModuleSource"
+#define CMD_SID_STYLE_APPLY ".uno:StyleApplyState"
+#define CMD_SID_STYLE_CATALOG ".uno:StyleCatalog"
+#define CMD_SID_STYLE_NEW_BY_EXAMPLE ".uno:StyleNewByExample"
+#define CMD_SID_STYLE_UPDATE_BY_EXAMPLE ".uno:StyleUpdateByExample"
+#define CMD_SID_STYLE_WATERCAN ".uno:StyleWatercanMode"
+#define CMD_SID_VIEWSHELL ".uno:SwitchViewShell"
+#define CMD_SID_TASKBAR ".uno:TaskBarVisible"
+#define CMD_SID_STYLE_FAMILY5 ".uno:ListStyle"
+#define CMD_SID_TIPWINDOW ".uno:TipsDialog"
+#define CMD_SID_DOCTITLE ".uno:Title"
+#define CMD_SID_TITLE ".uno:Title"
+#define CMD_SID_BASICIDE_TOGGLEBRKPNT ".uno:ToggleBreakPoint"
+#define CMD_SID_BASICIDE_SHOWWINDOW ".uno:BasicIDEShowWindow"
+#define CMD_SID_EDITMACRO ".uno:ToolsMacroEdit"
+#define CMD_SID_UNDO ".uno:Undo"
+#define CMD_SID_FORMATPAINTBRUSH ".uno:FormatPaintbrush"
+#define CMD_SID_ATTR_UNDO_COUNT ".uno:UndoCount"
+#define CMD_SID_BASICIDE_UPDATEALLMODULESOURCES ".uno:UpdateAllModuleSources"
+#define CMD_SID_BASICIDE_UPDATEMODULESOURCE ".uno:UpdateModuleSource"
+#define CMD_SID_BASICIDE_MANAGEBRKPNTS ".uno:ManageBreakPoints"
+#define CMD_SID_BASICIDE_TOGGLEBRKPNTENABLED ".uno:ToggleBreakPointEnabled"
+#define CMD_SID_UPDATE_VERSION ".uno:UpdateVersion"
+#define CMD_SID_VERSION ".uno:VersionDialog"
+#define CMD_SID_SIGNATURE ".uno:Signature"
+#define CMD_SID_MACRO_SIGNATURE ".uno:MacroSignature"
+#define CMD_SID_VERSION_VISIBLE ".uno:VersionVisible"
+#define CMD_SID_VIEW_DATA_SOURCE_BROWSER ".uno:ViewDataSourceBrowser"
+#define CMD_SID_WIN_VISIBLE ".uno:WinVisible"
+#define CMD_SID_MDIWINDOWLIST ".uno:WindowList"
+#define CMD_SID_ZOOM_IN ".uno:ZoomMinus"
+#define CMD_SID_ZOOM ".uno:Zooming"
+#define CMD_SID_ZOOM_NEXT ".uno:ZoomNext"
+#define CMD_SID_ZOOM_OUT ".uno:ZoomPlus"
+#define CMD_SID_ZOOM_PREV ".uno:ZoomPrevious"
+#define CMD_SID_ZOOM_TOOLBOX ".uno:ZoomToolBox"
+#define CMD_SID_EXPORTDOC ".uno:ExportTo"
+#define CMD_SID_EXPORTDOCASPDF ".uno:ExportToPDF"
+#define CMD_SID_DIRECTEXPORTDOCASPDF ".uno:ExportDirectToPDF"
+#define CMD_SID_IMAGE_ORIENTATION ".uno:ImageOrientation"
+#define CMD_SID_SAVE_VERSION_ON_CLOSE ".uno:SaveVersionOnClose"
+#define CMD_SID_ADDONS ".uno:Addons"
+#define CMD_SID_SHOW_IME_STATUS_WINDOW ".uno:ShowImeStatusWindow"
+#define CMD_SID_UPDATE_CONFIG ".uno:UpdateConfiguration"
+#define CMD_SID_HELP_SUPPORTPAGE ".uno:HelpSupport"
+#define CMD_SID_HELP_TUTORIALS ".uno:HelpTutorials"
+#define CMD_SID_ADDONHELP ".uno:AddonHelp"
+#define CMD_SID_FORMATMENUSTATE ".uno:FormatMenuState"
+#define CMD_SID_INET_DLG ".uno:InternetDialog"
+#define CMD_SID_ONLINE_REGISTRATION ".uno:OnlineRegistrationDlg"
+#define CMD_SID_OFFICE_CHECK_PLZ ".uno:CheckPLZ"
+#define CMD_SID_ADDRESS_DATA_SOURCE ".uno:AutoPilotAddressDataSource"
+#define CMD_FN_BUSINESS_CARD ".uno:InsertBusinessCard"
+#define CMD_FN_LABEL ".uno:InsertLabels"
+#define CMD_FN_XFORMS_INIT ".uno:NewXForms"
+#define CMD_SID_SD_AUTOPILOT ".uno:AutoPilotPresentations"
+#define CMD_SID_NEWSD ".uno:NewPresentation"
+#define CMD_SID_COMP_BIBLIOGRAPHY ".uno:BibliographyComponent"
+#define CMD_SID_MINIMIZED ".uno:Minimized"
+#define CMD_SID_AUTO_CORRECT_DLG ".uno:AutoCorrectDlg"
+#define CMD_SID_OPTIONS_TREEDIALOG ".uno:OptionsTreeDialog"
+#define CMD_SID_TERMINATE_INPLACEACTIVATION ".uno:TerminateInplaceActivation"
+#define CMD_SID_RECENTFILELIST ".uno:RecentFileList"
+#define CMD_SID_AVAILABLE_TOOLBARS ".uno:AvailableToolbars"
+#define CMD_SID_AVMEDIA_PLAYER ".uno:AVMediaPlayer"
+#define CMD_SID_INSERT_AVMEDIA ".uno:InsertAVMedia"
+#define CMD_SID_MORE_DICTIONARIES ".uno:MoreDictionaries"
+#define CMD_SID_ACTIVATE_STYLE_APPLY ".uno:ActivateStyleApply"
+#define CMD_SID_DOCKWIN_0 ".uno:DockingWindow0"
+#define CMD_SID_DOCKWIN_1 ".uno:DockingWindow1"
+#define CMD_SID_DOCKWIN_2 ".uno:DockingWindow2"
+#define CMD_SID_DOCKWIN_3 ".uno:DockingWindow3"
+#define CMD_SID_DOCKWIN_4 ".uno:DockingWindow4"
+#define CMD_SID_DOCKWIN_5 ".uno:DockingWindow5"
+#define CMD_SID_DOCKWIN_6 ".uno:DockingWindow6"
+#define CMD_SID_DOCKWIN_7 ".uno:DockingWindow7"
+#define CMD_SID_DOCKWIN_8 ".uno:DockingWindow8"
+#define CMD_SID_DOCKWIN_9 ".uno:DockingWindow9"
+#define CMD_SID_PASTE_UNFORMATTED ".uno:PasteUnformatted"
+
+#endif
diff --git a/sfx2/inc/sfx2/sfxdlg.hxx b/sfx2/inc/sfx2/sfxdlg.hxx
index d82abeefe8bc..f3d773f98afc 100644
--- a/sfx2/inc/sfx2/sfxdlg.hxx
+++ b/sfx2/inc/sfx2/sfxdlg.hxx
@@ -133,10 +133,10 @@ public:
const String *pUserButtonText=0 ) = 0;
virtual CreateTabPage GetTabPageCreatorFunc( USHORT nId ) = 0;
virtual GetTabPageRanges GetTabPageRangesFunc( USHORT nId ) = 0;
- virtual SfxAbstractInsertObjectDialog* CreateInsertObjectDialog( Window* pParent, USHORT nSlotId,
+ virtual SfxAbstractInsertObjectDialog* CreateInsertObjectDialog( Window* pParent, const rtl::OUString& rCommand,
const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStor,
const SvObjectServerList* pList = 0 )=0;
- virtual VclAbstractDialog* CreateEditObjectDialog( Window* pParent, USHORT nSlotId,
+ virtual VclAbstractDialog* CreateEditObjectDialog( Window* pParent, const rtl::OUString& rCommand,
const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject >& xObj )=0;
virtual SfxAbstractPasteDialog* CreatePasteDialog( Window* pParent )=0;
virtual SfxAbstractLinksDialog* CreateLinksDialog( Window* pParent, sfx2::LinkManager* pMgr, BOOL bHTML=FALSE, sfx2::SvBaseLink* p=0 )=0;
diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc
index 275e5c06a7be..9ab4a50b63d8 100644
--- a/sfx2/inc/sfx2/sfxsids.hrc
+++ b/sfx2/inc/sfx2/sfxsids.hrc
@@ -155,6 +155,7 @@
#define SID_RELOAD (SID_SFX_START + 508)
#define SID_PRINTDOCDIRECT (SID_SFX_START + 509)
#define SID_PICKLIST (SID_SFX_START + 510)
+#define SID_ATTR_XWINDOW (SID_SFX_START + 777)
#define SID_PLUGIN_MODE (SID_SFX_START + 827)
#define SID_EXPORTDOC (SID_SFX_START + 829)
#define SID_EXPORTDOCASPDF (SID_SFX_START + 1673)
@@ -306,7 +307,9 @@
#define SID_ACTIVATE_STYLE_APPLY (SID_SFX_START + 1715)
#define SID_FONT_NAME (SID_SFX_START + 1716)
#define SID_DEFAULTFILENAME (SID_SFX_START + 1717)
-#define SID_SFX_free_START (SID_SFX_START + 1718)
+#define SID_MODIFYPASSWORDINFO (SID_SFX_START + 1718)
+#define SID_RECOMMENDREADONLY (SID_SFX_START + 1719)
+#define SID_SFX_free_START (SID_SFX_START + 1720)
#define SID_SFX_free_END (SID_SFX_START + 3999)
#define SID_OPEN_NEW_VIEW (SID_SFX_START + 520)
@@ -418,7 +421,6 @@
#define SID_INSERT_PLUGIN (SID_SFX_START + 672)
#define SID_INSERT_SOUND (SID_SFX_START + 676)
#define SID_INSERT_VIDEO (SID_SFX_START + 677)
-#define SID_INSERT_APPLET (SID_SFX_START + 673)
#define SID_HYPERLINK_DIALOG (SID_SFX_START + 678)
@@ -1002,5 +1004,30 @@
#endif // #ifndef _SFXSIDS_HRC
+//-----------------------------------------------------------------------
+// SfxSecurityPage related stuff
+
+#define FN_EDIT2 (SID_SW_START + 1800)
+#define FN_REDLINE_PROTECT (FN_EDIT2 + 23)
+#define FN_REDLINE_ON (FN_EDIT2 + 25)
+
+#define SID_HTML_MODE (SID_SVX_START + 414)
+
+// Calc-Id's used for SfxSecurityPage
+#ifndef SC_FUNCTION_START
+#define SC_FUNCTION_START (SID_SC_START + 200)
+#endif
+#ifndef FILE_MENU_END
+#define FILE_MENU_END (SC_FUNCTION_START + 20)
+#endif
+#ifndef EDIT_MENU_START
+#define EDIT_MENU_START (FILE_MENU_END)
+#endif
+#ifndef SC_VIEW_START
+#define SC_VIEW_START (SID_SC_START)
+#endif
+#define FID_CHG_RECORD (EDIT_MENU_START + 18)
+#define SID_CHG_PROTECT (SC_VIEW_START + 84)
+
// eof ------------------------------------------------------------------------
diff --git a/sfx2/inc/sfx2/sfxuno.hxx b/sfx2/inc/sfx2/sfxuno.hxx
index fb331889a573..f9702063713a 100644
--- a/sfx2/inc/sfx2/sfxuno.hxx
+++ b/sfx2/inc/sfx2/sfxuno.hxx
@@ -73,7 +73,6 @@
#define UNOPROPERTYVALUE ::com::sun::star::beans::PropertyValue
#define UNOREFERENCE ::com::sun::star::uno::Reference
#define UNORUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException
-#define UNOINVALIDREGISTRYEXCEPTION ::com::sun::star::registry::InvalidRegistryException
#define UNOSEQUENCE ::com::sun::star::uno::Sequence
#define UNOTYPE ::com::sun::star::uno::Type
#define UNOURL ::com::sun::star::util::URL
@@ -591,52 +590,6 @@ sal_Bool GetPasswd_Impl( const SfxItemSet* pSet, ::rtl::OUString& rPasswd );
}
//************************************************************************************************************************
-// definition for "extern c component_writeInfo()"
-//************************************************************************************************************************
-#define COMPONENT_INFO(CLASS) \
- \
- try \
- { \
- /* Set default result of follow operations !!! */ \
- bReturn = sal_False ; \
- \
- /* Do the follow only, if given key is valid ! */ \
- if ( xKey.is () ) \
- { \
- /* Build new keyname */ \
- sKeyName = UNOOUSTRING::createFromAscii( "/" ) ; \
- sKeyName += CLASS::impl_getStaticImplementationName() ; \
- sKeyName += UNOOUSTRING::createFromAscii( "/UNO/SERVICES" ); \
- \
- /* Create new key with new name. */ \
- xNewKey = xKey->createKey( sKeyName ); \
- \
- /* If this new key valid ... */ \
- if ( xNewKey.is () ) \
- { \
- /* Get information about supported services. */ \
- seqServiceNames = CLASS::impl_getStaticSupportedServiceNames() ; \
- pArray = seqServiceNames.getArray() ; \
- nLength = seqServiceNames.getLength() ; \
- nCounter = 0 ; \
- \
- /* Then set this information on this key. */ \
- for ( nCounter = 0; nCounter < nLength; ++nCounter ) \
- { \
- xNewKey->createKey( pArray [nCounter] ); \
- } \
- \
- /* Result of this operations = OK. */ \
- bReturn = sal_True ; \
- } \
- } \
- } \
- catch( UNOINVALIDREGISTRYEXCEPTION& ) \
- { \
- bReturn = sal_False ; \
- } \
-
-//************************************************************************************************************************
// definition for "extern c component_getFactory()"
//************************************************************************************************************************
#define CREATEFACTORY(CLASS) \
diff --git a/sfx2/inc/sfx2/titledockwin.hxx b/sfx2/inc/sfx2/titledockwin.hxx
index ebb4497a0ba2..b6925ad332ad 100644
--- a/sfx2/inc/sfx2/titledockwin.hxx
+++ b/sfx2/inc/sfx2/titledockwin.hxx
@@ -76,7 +76,7 @@ namespace sfx2
@return
the ID of the newly created toolbox item
*/
- USHORT AddDropDownToolBoxItem( const String& i_rItemText, ULONG i_nHelpId, const Link& i_rCallback )
+ USHORT AddDropDownToolBoxItem( const String& i_rItemText, const rtl::OString& i_nHelpId, const Link& i_rCallback )
{
return impl_addDropDownToolBoxItem( i_rItemText, i_nHelpId, i_rCallback );
}
@@ -100,6 +100,11 @@ namespace sfx2
ToolBox& GetToolBox() { return m_aToolbox; }
const ToolBox& GetToolBox() const { return m_aToolbox; }
+ /** Return the border that is painted around the inner window as
+ decoration.
+ */
+ SvBorder GetDecorationBorder (void) const { return m_aBorder; }
+
protected:
// Window overridables
virtual void Paint( const Rectangle& i_rArea );
@@ -121,7 +126,7 @@ namespace sfx2
/** internal version of AddDropDownToolBoxItem
*/
- USHORT impl_addDropDownToolBoxItem( const String& i_rItemText, ULONG i_nHelpId, const Link& i_rCallback );
+ USHORT impl_addDropDownToolBoxItem( const String& i_rItemText, const rtl::OString& i_nHelpId, const Link& i_rCallback );
/** returns the current title.
@@ -153,6 +158,11 @@ namespace sfx2
since the last Paint().
*/
bool m_bLayoutPending;
+
+ /** Height of the title bar. Calculated in impl_layout().
+ */
+ int m_nTitleBarHeight;
+
};
//......................................................................................................................
diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx
index d376236bf830..affa836486e6 100644
--- a/sfx2/inc/sfx2/viewfrm.hxx
+++ b/sfx2/inc/sfx2/viewfrm.hxx
@@ -253,6 +253,7 @@ public:
private:
SAL_DLLPRIVATE BOOL SwitchToViewShell_Impl( USHORT nNo, BOOL bIsIndex = FALSE );
SAL_DLLPRIVATE void PopShellAndSubShells_Impl( SfxViewShell& i_rViewShell );
+ SAL_DLLPRIVATE void SaveCurrentViewData_Impl( const USHORT i_nNewViewId );
/** loads the given existing document into the given frame
diff --git a/sfx2/inc/sfx2/viewsh.hxx b/sfx2/inc/sfx2/viewsh.hxx
index 8465a238cd5b..ee8dfb1ca57c 100644
--- a/sfx2/inc/sfx2/viewsh.hxx
+++ b/sfx2/inc/sfx2/viewsh.hxx
@@ -123,13 +123,13 @@ public: \
static SfxViewFactory&Factory() { return *pFactory; } \
static void InitFactory()
-#define SFX_IMPL_VIEWFACTORY(Class, rResId) \
+#define SFX_IMPL_NAMED_VIEWFACTORY(Class, AsciiViewName) \
SfxViewFactory* Class::pFactory; \
SfxViewShell* __EXPORT Class::CreateInstance(SfxViewFrame *pFrame, SfxViewShell *pOldView) \
{ return new Class(pFrame, pOldView); } \
void Class::RegisterFactory( USHORT nPrio ) \
{ \
- pFactory = new SfxViewFactory(&CreateInstance,&InitFactory,nPrio,rResId);\
+ pFactory = new SfxViewFactory(&CreateInstance,&InitFactory,nPrio,AsciiViewName);\
InitFactory(); \
} \
void Class::InitFactory()
diff --git a/sfx2/inc/sfxhelp.hxx b/sfx2/inc/sfxhelp.hxx
index 60ad04b2e9ab..17589c7cd399 100644
--- a/sfx2/inc/sfxhelp.hxx
+++ b/sfx2/inc/sfxhelp.hxx
@@ -45,12 +45,11 @@ class SFX2_DLLPUBLIC SfxHelp : public Help
SfxHelp_Impl* pImp;
private:
- SAL_DLLPRIVATE virtual BOOL Start( ULONG nHelpId, const Window* pWindow );
+ SAL_DLLPRIVATE BOOL Start_Impl( const String& rURL, const Window* pWindow, const String& rKeyword );
+ SAL_DLLPRIVATE virtual BOOL SearchKeyword( const XubString& rKeyWord );
SAL_DLLPRIVATE virtual BOOL Start( const String& rURL, const Window* pWindow );
- SAL_DLLPRIVATE virtual void OpenHelpAgent( ULONG nHelpId );
-
+ SAL_DLLPRIVATE virtual void OpenHelpAgent( const rtl::OString& sHelpId );
SAL_DLLPRIVATE String GetHelpModuleName_Impl();
- SAL_DLLPRIVATE String CreateHelpURL_Impl( ULONG nHelpId, const String& rModuleName );
SAL_DLLPRIVATE String CreateHelpURL_Impl( const String& aCommandURL, const String& rModuleName );
public:
@@ -60,12 +59,11 @@ public:
inline void SetTicket( const String& rTicket ) { aTicket = rTicket; }
inline void SetUser( const String& rUser ) { aUser = rUser; }
- virtual XubString GetHelpText( ULONG nHelpId, const Window* pWindow );
virtual XubString GetHelpText( const String&, const Window* pWindow );
- static String CreateHelpURL( ULONG nHelpId, const String& rModuleName );
static String CreateHelpURL( const String& aCommandURL, const String& rModuleName );
- static void OpenHelpAgent( SfxFrame* pFrame, ULONG nHelpId );
+ using Help::OpenHelpAgent;
+ static void OpenHelpAgent( SfxFrame* pFrame, const rtl::OString& sHelpId );
static String GetDefaultHelpModule();
static ::rtl::OUString GetCurrentModuleIdentifier();
};
diff --git a/sfx2/inc/viewfac.hxx b/sfx2/inc/viewfac.hxx
index 6f9ae1d3cb37..b0f0abdba3b3 100644
--- a/sfx2/inc/viewfac.hxx
+++ b/sfx2/inc/viewfac.hxx
@@ -46,24 +46,29 @@ class SFX2_DLLPUBLIC SfxViewFactory
{
public:
SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI,
- USHORT nOrdinal, const ResId& aDescrResId );
+ USHORT nOrdinal, const sal_Char* asciiViewName );
~SfxViewFactory();
SfxViewShell *CreateInstance(SfxViewFrame *pViewFrame, SfxViewShell *pOldSh);
void InitFactory();
- String GetDescription() const
- { return String( aDescription ); }
USHORT GetOrdinal() const { return nOrd; }
- /// returns an API-compatible view name. For the moment, this is "view" with an appended ordinal/ID
- String GetViewName() const;
+ /// returns a legacy view name. This is "view" with an appended ordinal/ID.
+ String GetLegacyViewName() const;
+
+ /** returns a API-compatible view name.
+
+ For details on which view names are specified, see the XModel2.getAvailableViewControllerNames
+ documentation.
+ */
+ String GetAPIViewName() const;
private:
SfxViewCtor fnCreate;
SfxViewInit fnInit;
USHORT nOrd;
- ResId aDescription;
+ const String m_sViewName;
};
#endif
diff --git a/sfx2/prj/build.lst b/sfx2/prj/build.lst
index 96320614eaaf..1e471312c6cf 100644
--- a/sfx2/prj/build.lst
+++ b/sfx2/prj/build.lst
@@ -23,3 +23,9 @@ sf sfx2\workben\custompanel nmake - all sf_wb_custompanel NUL
sf sfx2\util nmake - all sf_util sf_appl sf_bast sf_cnfg sf_ctrl sf_dlg sf_doc sf_expl sf_inet sf_menu sf_layout sf_noti sf_sbar sf_tbox sf_view NULL
sf sfx2\qa\unoapi nmake - all sf_qa_unoapi NULL
sf sfx2\qa\cppunit nmake - all sf_qa_cppunit sf_util NULL
+
+# fails on unxsoli4
+# sf sfx2\qa\complex\standalonedocumentinfo nmake - all sf_qa_complex_standalonedocumentinfo sf_util NULL
+
+# sf sfx2\qa\complex\framework nmake - all sf_qa_complex_framework sf_qa_complex_framework_dochelper NULL
+# sf sfx2\qa\complex\docinfo nmake - all sf_qa_complex_docinfo sf_util NULL
diff --git a/sfx2/prj/d.lst b/sfx2/prj/d.lst
index 0748aa19cd65..0768000425eb 100644
--- a/sfx2/prj/d.lst
+++ b/sfx2/prj/d.lst
@@ -44,3 +44,4 @@ mkdir: %_DEST%\inc%_EXT%\sfx2
..\inc\mailmodelapi.hxx %_DEST%\inc%_EXT%\sfx2\mailmodelapi.hxx
..\inc\docinsert.hxx %_DEST%\inc%_EXT%\sfx2\docinsert.hxx
+..\%__SRC%\misc\sfx.component %_DEST%\xml%_EXT%\sfx.component
diff --git a/sfx2/qa/complex/CheckGlobalEventBroadcaster_writer1.java b/sfx2/qa/complex/CheckGlobalEventBroadcaster_writer1.java
deleted file mode 100644
index d5dc17e183eb..000000000000
--- a/sfx2/qa/complex/CheckGlobalEventBroadcaster_writer1.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-package complex.framework;
-
-import com.sun.star.awt.XWindow;
-import com.sun.star.document.XEventBroadcaster;
-import com.sun.star.document.XEventListener;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.sheet.XSpreadsheetDocument;
-import com.sun.star.text.XTextDocument;
-import com.sun.star.uno.UnoRuntime;
-import complex.framework.DocHelper.WriterHelper;
-import complexlib.ComplexTestCase;
-import java.util.ArrayList;
-import com.sun.star.task.XJobExecutor;
-import com.sun.star.util.URL;
-import util.UITools;
-
-/**
- * This testcase checks the GlobalEventBroadcaster
- * it will add an XEventListener and verify the Events
- * raised when opening/changing and closing Office Documents
- */
-public class CheckGlobalEventBroadcaster_writer1 extends ComplexTestCase {
- XMultiServiceFactory m_xMSF = null;
- XEventBroadcaster m_xEventBroadcaster = null;
- ArrayList notifyEvents = new ArrayList();
- XTextDocument xTextDoc;
- XSpreadsheetDocument xSheetDoc;
- XEventListener m_xEventListener = new EventListenerImpl();
-
- public String[] getTestMethodNames() {
- return new String[] {
- "initialize", "checkWriter", "cleanup"
- };
- }
-
- public void initialize() {
- m_xMSF = (XMultiServiceFactory) param.getMSF();
- log.println("check wether there is a valid MultiServiceFactory");
-
- if (m_xMSF == null) {
- assure("## Couldn't get MultiServiceFactory make sure your Office is started",
- true);
- }
-
- log.println("... done");
-
- log.println(
- "Create an instance of com.sun.star.frame.GlobalEventBroadcaster");
-
- Object GlobalEventBroadcaster = null;
- Object dispatcher = null;
-
- try {
- GlobalEventBroadcaster = m_xMSF.createInstance(
- "com.sun.star.frame.GlobalEventBroadcaster");
- } catch (com.sun.star.uno.Exception e) {
- assure("## Exception while creating instance", false);
- }
-
- log.println("... done");
-
- log.println("check wether the created instance is valid");
-
- if (GlobalEventBroadcaster == null) {
- assure("couldn't create service", false);
- }
-
- log.println("... done");
-
- log.println(
- "try to query the XEventBroadcaster from the gained Object");
- m_xEventBroadcaster = (XEventBroadcaster) UnoRuntime.queryInterface(
- XEventBroadcaster.class,
- GlobalEventBroadcaster);
-
- if (util.utils.isVoid(m_xEventBroadcaster)) {
- assure("couldn't get XEventBroadcaster", false);
- }
-
- log.println("... done");
-
- log.println("adding Listener");
- m_xEventBroadcaster.addEventListener(m_xEventListener);
- log.println("... done");
- }
-
- public void checkWriter() {
- log.println("-- Checking Writer --");
-
- WriterHelper wHelper = new WriterHelper(m_xMSF);
- String[] expected;
- boolean locRes = true;
- log.println("opening an empty writer doc");
- notifyEvents.clear();
- xTextDoc = wHelper.openEmptyDoc();
- shortWait();
- expected = new String[] { "OnUnfocus", "OnCreate", "OnViewCreated", "OnFocus" };
-
- assure("Wrong events fired when opening empty doc",
- proveExpectation(expected));
- log.println("... done");
-
- log.println("changing the writer doc");
- notifyEvents.clear();
- xTextDoc.getText().setString("GlobalEventBroadcaster");
- shortWait();
- expected = new String[] { "OnModifyChanged" };
-
- assure("Wrong events fired when changing doc",
- proveExpectation(expected));
- log.println("... done");
-
- log.println("closing the empty writer doc");
- notifyEvents.clear();
- wHelper.closeDoc(xTextDoc);
- shortWait();
- expected = new String[] { "OnUnfocus", "OnFocus", "OnViewClosed", "OnUnload" };
-
- assure("Wrong events fired when closing empty doc",
- proveExpectation(expected));
- log.println("... done");
-
- log.println("opening an writer doc via Window-New Window");
- notifyEvents.clear();
- xTextDoc = wHelper.openFromDialog(".uno:NewWindow", "", false);
- shortWait();
- expected = new String[] { "OnUnfocus", "OnCreate", "OnViewCreated", "OnFocus", "OnUnfocus", "OnViewCreated", "OnFocus", };
-
- assure("Wrong events fired when opening an writer doc via Window-New Window",
- proveExpectation(expected));
- log.println("... done");
-
- log.println("closing the created writer doc");
- notifyEvents.clear();
-
- wHelper.closeDoc(xTextDoc);
- shortWait();
- expected = new String[] { "OnViewClosed", "OnUnfocus", "OnFocus", "OnViewClosed", "OnUnload" };
-
- assure("Wrong events fired when closing Window-New Window",
- proveExpectation(expected));
-
- log.println("... done");
-
- log.println("Opening document with label wizard");
- xTextDoc = wHelper.openFromDialog("private:factory/swriter?slot=21051", "", false);
- shortWait();
- XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, wHelper.getToolkit ().getActiveTopWindow ());
- UITools ut = new UITools(m_xMSF,xWindow);
- notifyEvents.clear();
- log.println("pressing button 'New Document'");
- try{
- ut.clickButton ("New Document");
- } catch (Exception e) {
- log.println("Couldn't press Button");
- }
- log.println("... done");
- shortWait();
- shortWait();
- shortWait();
- expected = new String[] { "OnViewClosed", "OnCreate", "OnFocus", "OnModifyChanged" };
-
- assure("Wrong events fired when starting labels wizard",
- proveExpectation(expected));
-
- log.println("-- Done Writer --");
- }
-
- public void cleanup() {
- log.println("removing Listener");
- m_xEventBroadcaster.removeEventListener(m_xEventListener);
- log.println("... done");
- }
-
- /**
- * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
- * reset</code> call.
- */
- private void shortWait() {
- try {
- Thread.sleep(2000);
- } catch (InterruptedException e) {
- log.println("While waiting :" + e);
- }
- }
-
- private boolean proveExpectation(String[] expected) {
- boolean locRes = true;
- boolean failure = false;
-
- log.println("Fired Events:");
- for (int k=0;k<notifyEvents.size();k++) {
- System.out.println("\t- "+notifyEvents.get(k));
- }
-
- for (int i = 0; i < expected.length; i++) {
- locRes = notifyEvents.contains(expected[i]);
-
- if (!locRes) {
- log.println("The event " + expected[i] + " isn't fired");
- failure = true;
- }
- }
-
- return !failure;
- }
-
- public class EventListenerImpl implements XEventListener {
- public void disposing(com.sun.star.lang.EventObject eventObject) {
- log.println("disposing: " + eventObject.Source.toString());
- }
-
- public void notifyEvent(com.sun.star.document.EventObject eventObject) {
- notifyEvents.add(eventObject.EventName);
- }
- }
-}
diff --git a/sfx2/qa/complex/docinfo/DocumentProperties.java b/sfx2/qa/complex/docinfo/DocumentProperties.java
index cff1dd341d48..0c4eb44c4a35 100644
--- a/sfx2/qa/complex/docinfo/DocumentProperties.java
+++ b/sfx2/qa/complex/docinfo/DocumentProperties.java
@@ -26,9 +26,12 @@
************************************************************************/
package complex.docinfo;
+import com.sun.star.beans.*;
+import com.sun.star.beans.Property;
import com.sun.star.beans.PropertyValue;
import com.sun.star.beans.XPropertyContainer;
import com.sun.star.beans.XPropertySet;
+import com.sun.star.beans.XPropertySetInfo;
import com.sun.star.document.XDocumentInfo;
import com.sun.star.document.XDocumentInfoSupplier;
import com.sun.star.frame.XComponentLoader;
@@ -37,233 +40,324 @@ import com.sun.star.lang.XComponent;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.text.XTextDocument;
import com.sun.star.uno.UnoRuntime;
-import com.sun.star.uno.XInterface;
import com.sun.star.util.Date;
-import complexlib.ComplexTestCase;
+
import util.DesktopTools;
import util.WriterTools;
+import org.junit.After;
+import org.junit.AfterClass;
+// import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
+
+public class DocumentProperties
+{
-public class DocumentProperties extends ComplexTestCase {
XMultiServiceFactory m_xMSF = null;
XTextDocument xTextDoc = null;
+ XTextDocument xTextDocSecond = null;
- public String[] getTestMethodNames() {
- return new String[] {"checkDocInfo", "cleanup"};
- }
-
- public void checkDocInfo() {
- m_xMSF = (XMultiServiceFactory) param.getMSF();
-
- log.println(
- "check wether there is a valid MultiServiceFactory");
-
- if (m_xMSF == null) {
- assure("## Couldn't get MultiServiceFactory make sure your Office is started",
- true);
- }
+// public String[] getTestMethodNames() {
+// return new String[] {"checkDocInfo", "cleanup"};
+// }
+ @Test public void checkDocInfo()
+ {
+ m_xMSF = getMSF();
- log.println("... done");
-
- log.println("Opening a Writer document");
- xTextDoc = WriterTools.createTextDoc(m_xMSF);
- log.println("... done");
-
- XDocumentInfoSupplier xDocInfoSup =
- (XDocumentInfoSupplier) UnoRuntime.queryInterface(XDocumentInfoSupplier.class,
- xTextDoc);
- XDocumentInfo xDocInfo = xDocInfoSup.getDocumentInfo();
- XPropertyContainer xPropContainer =
- (XPropertyContainer) UnoRuntime.queryInterface(XPropertyContainer.class,
- xDocInfo);
-
- log.println("Trying to add a existing property");
-
- boolean worked =
- addProperty(xPropContainer, "Author", (short) 0, "");
- assure("Could set an existing property", !worked);
- log.println("...done");
-
- log.println("Trying to add a integer property");
- worked =
- addProperty(xPropContainer, "intValue", com.sun.star.beans.PropertyAttribute.READONLY,
- new Integer(17));
- assure("Couldn't set an integer property", worked);
- log.println("...done");
-
- log.println("Trying to add a double property");
- worked =
- addProperty(xPropContainer, "doubleValue", com.sun.star.beans.PropertyAttribute.REMOVEABLE ,
- new Double(17.7));
- assure("Couldn't set an double property", worked);
- log.println("...done");
-
- log.println("Trying to add a boolean property");
- worked =
- addProperty(xPropContainer, "booleanValue", com.sun.star.beans.PropertyAttribute.REMOVEABLE,
- Boolean.TRUE);
- assure("Couldn't set an boolean property", worked);
- log.println("...done");
-
- log.println("Trying to add a date property");
- worked =
- addProperty(xPropContainer, "dateValue", com.sun.star.beans.PropertyAttribute.REMOVEABLE,
- new Date());
- assure("Couldn't set an date property", worked);
- log.println("...done");
-
- log.println("trying to remove a read only Property");
- try {
- xPropContainer.removeProperty ("intValue");
- assure("Could remove read only property", false);
- } catch (Exception e) {
- log.println("\tException was thrown "+e);
- log.println("\t...OK");
- }
- log.println("...done");
+ System.out.println("check wether there is a valid MultiServiceFactory");
+ assertNotNull("## Couldn't get MultiServiceFactory make sure your Office is started", m_xMSF);
+ // TODO: need other temp directory!
String tempdir = System.getProperty("java.io.tmpdir");
String fs = System.getProperty("file.separator");
- if (!tempdir.endsWith(fs)) {
+ if (!tempdir.endsWith(fs))
+ {
tempdir += fs;
}
-
tempdir = util.utils.getFullURL(tempdir);
-
- log.println("Storing the document");
-
- try {
- XStorable store =
- (XStorable) UnoRuntime.queryInterface(XStorable.class,
- xTextDoc);
- store.storeToURL(tempdir + "DocInfo.oot",
- new PropertyValue[] {});
- DesktopTools.closeDoc(xTextDoc);
- } catch (Exception e) {
- assure("Couldn't store document", false);
+ final String sTempDocument = tempdir + "DocInfo.oot";
+
+ if (true)
+ {
+ System.out.println("... done");
+
+
+ System.out.println("Opening a Writer document");
+ xTextDoc = WriterTools.createTextDoc(m_xMSF);
+ System.out.println("... done");
+
+ XDocumentInfoSupplier xDocInfoSup = UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xTextDoc);
+ XDocumentInfo xDocInfo = xDocInfoSup.getDocumentInfo();
+ XPropertyContainer xPropContainer = UnoRuntime.queryInterface(XPropertyContainer.class, xDocInfo);
+
+ System.out.println("Trying to add a existing property");
+
+ boolean worked = addProperty(xPropContainer, "Author", (short) 0, "");
+ assertTrue("Could set an existing property", !worked);
+ System.out.println("...done");
+
+ System.out.println("Trying to add a integer property");
+ worked = addProperty(xPropContainer, "intValue", com.sun.star.beans.PropertyAttribute.READONLY, new Integer(17));
+ assertTrue("Couldn't set an integer property", worked);
+ System.out.println("...done");
+
+ System.out.println("Trying to add a double property");
+ worked = addProperty(xPropContainer, "doubleValue", com.sun.star.beans.PropertyAttribute.REMOVEABLE, new Double(17.7));
+ assertTrue("Couldn't set an double property", worked);
+ System.out.println("...done");
+
+ System.out.println("Trying to add a boolean property");
+ worked = addProperty(xPropContainer, "booleanValue", com.sun.star.beans.PropertyAttribute.REMOVEABLE, Boolean.TRUE);
+ assertTrue("Couldn't set an boolean property", worked);
+ System.out.println("...done");
+
+ System.out.println("Trying to add a date property");
+ worked = addProperty(xPropContainer, "dateValue", com.sun.star.beans.PropertyAttribute.REMOVEABLE, new Date());
+ assertTrue("Couldn't set an date property", worked);
+ System.out.println("...done");
+
+ System.out.println("trying to remove a read only Property");
+ try
+ {
+ xPropContainer.removeProperty("intValue");
+ fail("Could remove read only property");
+ }
+ catch (Exception e)
+ {
+ System.out.println("\tException was thrown " + e);
+ System.out.println("\t...OK");
+ }
+ System.out.println("...done");
+
+ XPropertySet xProps2 = UnoRuntime.queryInterface(XPropertySet.class, xPropContainer);
+ showPropertySet(xProps2);
+
+
+ System.out.println("Storing the document");
+ try
+ {
+ XStorable store = UnoRuntime.queryInterface(XStorable.class, xTextDoc);
+ store.storeToURL(sTempDocument, new PropertyValue[] {});
+ DesktopTools.closeDoc(xTextDoc);
+ }
+ catch (Exception e)
+ {
+ fail("Couldn't store document");
+ }
+
+ System.out.println("...done");
}
- log.println("...done");
-
- log.println("loading the document");
-
- try {
- XComponentLoader xCL =
- (XComponentLoader) UnoRuntime.queryInterface(XComponentLoader.class,
- m_xMSF.createInstance(
- "com.sun.star.frame.Desktop"));
- XComponent xComp =
- xCL.loadComponentFromURL(tempdir + "DocInfo.oot",
- "_blank", 0, new PropertyValue[] {});
- xTextDoc =
- (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class,
- xComp);
- } catch (Exception e) {
- assure("Couldn't load document", false);
- }
- log.println("...done");
-
- xDocInfoSup =
- (XDocumentInfoSupplier) UnoRuntime.queryInterface(XDocumentInfoSupplier.class,
- xTextDoc);
- xDocInfo = xDocInfoSup.getDocumentInfo();
-
- XPropertySet xProps =
- (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class,
- xDocInfo);
-
- assure("Integer doesn't work",
- checkType(xProps, "intValue", "java.lang.Integer"));
- assure("Double doesn't work",
- checkType(xProps, "doubleValue", "java.lang.Double"));
- assure("Boolean doesn't work",
- checkType(xProps, "booleanValue", "java.lang.Boolean"));
- assure("Date doesn't work",
- checkType(xProps, "dateValue",
- "com.sun.star.util.DateTime"));
-
- xPropContainer =
- (XPropertyContainer) UnoRuntime.queryInterface(XPropertyContainer.class,
- xDocInfo);
-
- log.println("trying to remove a not user defined Property");
- try {
- xPropContainer.removeProperty ("Author");
- assure("Could remove non user defined property", false);
- } catch (Exception e) {
- log.println("\tException was thrown "+e);
- log.println("\t...OK");
- }
- log.println("...done");
-
- log.println("Trying to remove a user defined property");
- try {
- xPropContainer.removeProperty ("dateValue");
- log.println("\t...OK");
- } catch (Exception e) {
- log.println("\tException was thrown "+e);
- log.println("\t...FAILED");
- assure("Could not remove user defined property", false);
+ if (true)
+ {
+ System.out.println("loading the document");
+
+ try
+ {
+ XComponentLoader xCL = UnoRuntime.queryInterface(XComponentLoader.class, m_xMSF.createInstance("com.sun.star.frame.Desktop"));
+ XComponent xComp = xCL.loadComponentFromURL(sTempDocument, "_blank", 0, new PropertyValue[] {});
+ xTextDocSecond = UnoRuntime.queryInterface(XTextDocument.class, xComp);
+ }
+ catch (Exception e)
+ {
+ fail("Couldn't load document");
+ }
+
+ System.out.println("...done");
+
+ XDocumentInfoSupplier xDocInfoSup = UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xTextDocSecond);
+ XDocumentInfo xDocInfo = xDocInfoSup.getDocumentInfo();
+ XPropertyContainer xPropContainer = UnoRuntime.queryInterface(XPropertyContainer.class, xDocInfo);
+
+ XPropertySet xProps = UnoRuntime.queryInterface(XPropertySet.class, xDocInfo);
+ showPropertySet(xProps);
+
+ assertTrue("Double doesn't work", checkType(xProps, "doubleValue", "java.lang.Double"));
+ assertTrue("Boolean doesn't work", checkType(xProps, "booleanValue", "java.lang.Boolean"));
+
+ // TODO: dateValue does not exist.
+ // assertTrue("Date doesn't work", checkType(xProps, "dateValue", "com.sun.star.util.DateTime"));
+
+ // TODO: is java.lang.Double
+ // assertTrue("Integer doesn't work", checkType(xProps, "intValue", "java.lang.Integer"));
+
+ xPropContainer = UnoRuntime.queryInterface(XPropertyContainer.class, xDocInfo);
+
+ System.out.println("trying to remove a not user defined Property");
+ try
+ {
+ xPropContainer.removeProperty("Author");
+ fail("Could remove non user defined property");
+ }
+ catch (Exception e)
+ {
+ System.out.println("\tException was thrown " + e);
+ System.out.println("\t...OK");
+ }
+ System.out.println("...done");
+
+
+ System.out.println("Trying to remove a user defined property");
+ try
+ {
+ xPropContainer.removeProperty("booleanValue");
+ System.out.println("\t...OK");
+ }
+ catch (Exception e)
+ {
+ System.out.println("\tException was thrown " + e);
+ System.out.println("\t...FAILED");
+ fail("Could not remove user defined property");
+ }
+ showPropertySet(xProps);
+ System.out.println("...done");
}
- log.println("...done");
-
}
- public void cleanup() {
+ @After public void cleanup()
+ {
+ DesktopTools.closeDoc(xTextDocSecond);
DesktopTools.closeDoc(xTextDoc);
}
+ private void showPropertySet(XPropertySet xProps)
+ {
+ try
+ {
+ // get an XPropertySet, here the one of a text cursor
+ // XPropertySet xCursorProps = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, mxDocCursor);
+
+ // get the property info interface of this XPropertySet
+ XPropertySetInfo xPropsInfo = xProps.getPropertySetInfo();
+
+ // get all properties (NOT the values) from XPropertySetInfo
+ Property[] aProps = xPropsInfo.getProperties();
+ int i;
+ for (i = 0; i < aProps.length; ++i) {
+ // number of property within this info object
+ System.out.print("Property #" + i);
+
+ // name of property
+ System.out.print(": Name<" + aProps[i].Name);
+
+ // handle of property (only for XFastPropertySet)
+ System.out.print("> Handle<" + aProps[i].Handle);
+
+ // type of property
+ System.out.print("> " + aProps[i].Type.toString());
+
+ // attributes (flags)
+ System.out.print(" Attributes<");
+ short nAttribs = aProps[i].Attributes;
+ if ((nAttribs & PropertyAttribute.MAYBEVOID) != 0)
+ System.out.print("MAYBEVOID|");
+ if ((nAttribs & PropertyAttribute.BOUND) != 0)
+ System.out.print("BOUND|");
+ if ((nAttribs & PropertyAttribute.CONSTRAINED) != 0)
+ System.out.print("CONSTRAINED|");
+ if ((nAttribs & PropertyAttribute.READONLY) != 0)
+ System.out.print("READONLY|");
+ if ((nAttribs & PropertyAttribute.TRANSIENT) != 0)
+ System.out.print("TRANSIENT|");
+ if ((nAttribs & PropertyAttribute.MAYBEAMBIGUOUS ) != 0)
+ System.out.print("MAYBEAMBIGUOUS|");
+ if ((nAttribs & PropertyAttribute.MAYBEDEFAULT) != 0)
+ System.out.print("MAYBEDEFAULT|");
+ if ((nAttribs & PropertyAttribute.REMOVEABLE) != 0)
+ System.out.print("REMOVEABLE|");
+ System.out.println("0>");
+ }
+ } catch (Exception e) {
+ // If anything goes wrong, give the user a stack trace
+ e.printStackTrace(System.out);
+ }
+ }
+
private boolean checkType(XPropertySet xProps, String aName,
- String expected) {
+ String expected)
+ {
boolean ret = true;
- log.println("Checking " + expected);
+ System.out.println("Checking " + expected);
String getting =
- getPropertyByName(xProps, aName).getClass().getName();
+ getPropertyByName(xProps, aName).getClass().getName();
- if (!getting.equals(expected)) {
- log.println("\t Expected: " + expected);
- log.println("\t Detting: " + getting);
+ if (!getting.equals(expected))
+ {
+ System.out.println("\t Expected: " + expected);
+ System.out.println("\t Getting: " + getting);
ret = false;
}
- if (ret) {
- log.println("...OK");
+ if (ret)
+ {
+ System.out.println("...OK");
}
-
return ret;
}
- private Object getPropertyByName(XPropertySet xProps, String aName) {
+ private Object getPropertyByName(XPropertySet xProps, String aName)
+ {
Object ret = null;
- try {
+ try
+ {
ret = xProps.getPropertyValue(aName);
- } catch (Exception e) {
- log.println("\tCouldn't get Property " + aName);
- log.println("\tMessage " + e);
+ }
+ catch (Exception e)
+ {
+ System.out.println("\tCouldn't get Property " + aName);
+ System.out.println("\tMessage " + e);
}
return ret;
}
private boolean addProperty(XPropertyContainer xPropContainer,
- String aName, short attr, Object defaults) {
+ String aName, short attr, Object defaults)
+ {
boolean ret = true;
- try {
+ try
+ {
xPropContainer.addProperty(aName, attr, defaults);
- } catch (Exception e) {
+ }
+ catch (Exception e)
+ {
ret = false;
- log.println("\tCouldn't get Property " + aName);
- log.println("\tMessage " + e);
+ System.out.println("\tCouldn't get Property " + aName);
+ System.out.println("\tMessage " + e);
}
return ret;
}
+
+ private XMultiServiceFactory getMSF()
+ {
+ final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
+ return xMSF1;
+ }
+
+ // setup and close connections
+ @BeforeClass public static void setUpConnection() throws Exception
+ {
+ System.out.println("setUpConnection()");
+ connection.setUp();
+ }
+
+ @AfterClass public static void tearDownConnection()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ System.out.println("tearDownConnection()");
+ connection.tearDown();
+ }
+ private static final OfficeConnection connection = new OfficeConnection();
}
diff --git a/sfx2/qa/complex/docinfo/makefile.mk b/sfx2/qa/complex/docinfo/makefile.mk
index 8c3525541062..626b648a6d06 100644
--- a/sfx2/qa/complex/docinfo/makefile.mk
+++ b/sfx2/qa/complex/docinfo/makefile.mk
@@ -25,32 +25,39 @@
#
#*************************************************************************
-PRJ = ..$/..$/..
-TARGET = DocumentProperties
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
+
+PRJ = ../../..
PRJNAME = sfx2
-PACKAGE = complex$/docinfo
+TARGET = qa_complex_docinfo
-# --- Settings -----------------------------------------------------
-.INCLUDE: settings.mk
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = complex/docinfo
+JAVATESTFILES = \
+ DocumentProperties.java
+
+JAVAFILES = $(JAVATESTFILES)
-#----- compile .java files -----------------------------------------
+JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
-JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
-JAVAFILES = DocumentProperties.java
+# Sample how to debug
+# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y
+
+.END
+
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
-#----- make a jar from compiled files ------------------------------
+ALLTAR : javatest
-MAXLINELENGTH = 100000
+.END
-JARCLASSDIRS = $(PACKAGE)
-JARTARGET = $(TARGET).jar
-JARCOMPRESS = TRUE
-# --- Targets ------------------------------------------------------
-.INCLUDE : target.mk
-run:
- $(JAVAI) $(JAVAIFLAGS) -cp $(CLASSPATH) org.openoffice.Runner -TestBase java_complex -o $(PACKAGE:s#$/#.#).$(JAVAFILES:b)
diff --git a/sfx2/qa/complex/framework/CheckGlobalEventBroadcaster_writer1.java b/sfx2/qa/complex/framework/CheckGlobalEventBroadcaster_writer1.java
new file mode 100644
index 000000000000..c6dc073095b1
--- /dev/null
+++ b/sfx2/qa/complex/framework/CheckGlobalEventBroadcaster_writer1.java
@@ -0,0 +1,281 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package complex.framework;
+
+import com.sun.star.awt.XWindow;
+import com.sun.star.document.XEventBroadcaster;
+import com.sun.star.document.XEventListener;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import complex.framework.DocHelper.WriterHelper;
+
+import java.util.ArrayList;
+
+import util.UITools;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
+
+
+/**
+ * This testcase checks the GlobalEventBroadcaster
+ * it will add an XEventListener and verify the Events
+ * raised when opening/changing and closing Office Documents
+ */
+public class CheckGlobalEventBroadcaster_writer1 {
+ XMultiServiceFactory m_xMSF = null;
+ XEventBroadcaster m_xEventBroadcaster = null;
+ ArrayList notifyEvents = new ArrayList();
+ // XTextDocument xTextDoc;
+ XSpreadsheetDocument xSheetDoc;
+ XEventListener m_xEventListener = new EventListenerImpl();
+
+// public String[] getTestMethodNames() {
+// return new String[] {
+// "initialize", "checkWriter", "cleanup"
+// };
+// }
+
+ @Before public void initialize() {
+ m_xMSF = getMSF();
+ System.out.println("check wether there is a valid MultiServiceFactory");
+
+ assertNotNull("## Couldn't get MultiServiceFactory make sure your Office is started", m_xMSF);
+
+ System.out.println("... done");
+
+ System.out.println(
+ "Create an instance of com.sun.star.frame.GlobalEventBroadcaster");
+
+ Object GlobalEventBroadcaster = null;
+ Object dispatcher = null;
+
+ try {
+ GlobalEventBroadcaster = m_xMSF.createInstance(
+ "com.sun.star.frame.GlobalEventBroadcaster");
+ } catch (com.sun.star.uno.Exception e) {
+ fail("## Exception while creating instance");
+ }
+
+ System.out.println("... done");
+
+ System.out.println("check wether the created instance is valid");
+
+ assertNotNull("couldn't create service", GlobalEventBroadcaster);
+
+ System.out.println("... done");
+
+ System.out.println(
+ "try to query the XEventBroadcaster from the gained Object");
+ m_xEventBroadcaster = UnoRuntime.queryInterface(XEventBroadcaster.class, GlobalEventBroadcaster);
+
+ if (util.utils.isVoid(m_xEventBroadcaster)) {
+ fail("couldn't get XEventBroadcaster");
+ }
+
+ System.out.println("... done");
+
+ System.out.println("adding Listener");
+ m_xEventBroadcaster.addEventListener(m_xEventListener);
+ System.out.println("... done");
+ }
+
+ @Test public void checkWriter() {
+ System.out.println("-- Checking Writer --");
+
+ WriterHelper wHelper = new WriterHelper(m_xMSF);
+ String[] expected;
+ boolean locRes = true;
+ System.out.println("opening an empty writer doc");
+ notifyEvents.clear();
+ {
+ XTextDocument xTextDoc = wHelper.openEmptyDoc();
+ shortWait();
+ expected = new String[] { "OnUnfocus", "OnCreate", "OnViewCreated", "OnFocus" };
+
+ assertTrue("Wrong events fired when opening empty doc",
+ proveExpectation(expected));
+ System.out.println("... done");
+
+ System.out.println("changing the writer doc");
+ notifyEvents.clear();
+ xTextDoc.getText().setString("GlobalEventBroadcaster");
+ shortWait();
+ expected = new String[] { "OnModifyChanged" };
+
+ assertTrue("Wrong events fired when changing doc",
+ proveExpectation(expected));
+ System.out.println("... done");
+
+ System.out.println("closing the empty writer doc");
+ notifyEvents.clear();
+ wHelper.closeDoc(xTextDoc);
+ shortWait();
+ }
+ expected = new String[] { "OnUnfocus", "OnFocus", "OnViewClosed", "OnUnload" };
+
+ assertTrue("Wrong events fired when closing empty doc",
+ proveExpectation(expected));
+ System.out.println("... done");
+
+ System.out.println("opening an writer doc via Window-New Window");
+ notifyEvents.clear();
+ {
+ XTextDocument xTextDoc = wHelper.openFromDialog(".uno:NewWindow", "", false);
+
+ shortWait();
+ expected = new String[] { "OnUnfocus", "OnCreate", "OnViewCreated", "OnFocus", "OnUnfocus", "OnViewCreated", "OnFocus", };
+
+ assertTrue("Wrong events fired when opening an writer doc via Window-New Window",
+ proveExpectation(expected));
+ System.out.println("... done");
+
+ System.out.println("closing the created writer doc");
+ notifyEvents.clear();
+
+ wHelper.closeDoc(xTextDoc);
+ shortWait();
+ }
+ expected = new String[] { "OnViewClosed", "OnUnfocus", "OnFocus", "OnViewClosed", "OnUnload" };
+
+ assertTrue("Wrong events fired when closing Window-New Window",
+ proveExpectation(expected));
+
+ System.out.println("... done");
+ // TODO: It seems not possible to close the document without interactiv question
+ // there the follow test will not be execute
+ if (false) {
+ System.out.println("Opening document with label wizard");
+ XTextDocument xTextDoc = wHelper.openFromDialog("private:factory/swriter?slot=21051", "", false);
+ shortWait();
+ XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, wHelper.getToolkit().getActiveTopWindow());
+ UITools ut = new UITools(m_xMSF,xWindow);
+ notifyEvents.clear();
+ System.out.println("pressing button 'New Document'");
+ try{
+ ut.clickButton ("New Document");
+ } catch (Exception e) {
+ System.out.println("Couldn't press Button");
+ }
+ System.out.println("... done");
+ shortWait();
+ shortWait();
+ shortWait();
+ expected = new String[] { "OnViewClosed", "OnCreate", "OnFocus", "OnModifyChanged" };
+
+ assertTrue("Wrong events fired when starting labels wizard",
+ proveExpectation(expected));
+
+ System.out.println("Try to close document...");
+ wHelper.closeDoc(xTextDoc);
+ shortWait();
+ wHelper.closeFromDialog();
+ shortWait();
+ xTextDoc = null;
+ }
+
+ System.out.println("-- Done Writer --");
+ }
+
+ @After public void cleanup() {
+ System.out.println("removing Listener");
+ m_xEventBroadcaster.removeEventListener(m_xEventListener);
+ System.out.println("... done");
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(2000);
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e);
+ }
+ }
+
+ private boolean proveExpectation(String[] expected) {
+ boolean locRes = true;
+ boolean failure = false;
+
+ System.out.println("Fired Events:");
+ for (int k=0;k<notifyEvents.size();k++) {
+ System.out.println("\t- "+notifyEvents.get(k));
+ }
+
+ for (int i = 0; i < expected.length; i++) {
+ locRes = notifyEvents.contains(expected[i]);
+
+ if (!locRes) {
+ System.out.println("The event " + expected[i] + " isn't fired");
+ failure = true;
+ }
+ }
+
+ return !failure;
+ }
+
+ public class EventListenerImpl implements XEventListener {
+ public void disposing(com.sun.star.lang.EventObject eventObject) {
+ System.out.println("disposing: " + eventObject.Source.toString());
+ }
+
+ public void notifyEvent(com.sun.star.document.EventObject eventObject) {
+ notifyEvents.add(eventObject.EventName);
+ }
+ }
+
+ private XMultiServiceFactory getMSF()
+ {
+ final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
+ return xMSF1;
+ }
+
+ // setup and close connections
+ @BeforeClass public static void setUpConnection() throws Exception {
+ System.out.println("setUpConnection()");
+ connection.setUp();
+ }
+
+ @AfterClass public static void tearDownConnection()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ System.out.println("tearDownConnection() CheckGlobalEventBroadcaster_writer1");
+ connection.tearDown();
+ }
+
+ private static final OfficeConnection connection = new OfficeConnection();
+
+}
diff --git a/sfx2/qa/complex/DocHelper/DialogThread.java b/sfx2/qa/complex/framework/DialogThread.java
index 7151ccbb292d..7151ccbb292d 100644
--- a/sfx2/qa/complex/DocHelper/DialogThread.java
+++ b/sfx2/qa/complex/framework/DialogThread.java
diff --git a/sfx2/qa/complex/DocHelper/makefile.mk b/sfx2/qa/complex/framework/DocHelper/makefile.mk
index 6b6ac9191cdb..ad614cfca3f8 100644
--- a/sfx2/qa/complex/DocHelper/makefile.mk
+++ b/sfx2/qa/complex/framework/DocHelper/makefile.mk
@@ -25,10 +25,10 @@
#
#*************************************************************************
-PRJ = ..$/..$/..
+PRJ = ../../../..
TARGET = DocHelper
PRJNAME = $(TARGET)
-PACKAGE = complex$/framework$/dochelper
+PACKAGE = complex/framework/dochelper
# --- Settings -----------------------------------------------------
.INCLUDE: settings.mk
@@ -37,8 +37,11 @@ PACKAGE = complex$/framework$/dochelper
#----- compile .java files -----------------------------------------
JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
-JAVAFILES = DialogThread.java WriterHelper.java
-JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
+JAVAFILES = \
+ DialogThread.java \
+ WriterHelper.java
+
+JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)/$(PACKAGE)/$(i:b).class)
# --- Targets ------------------------------------------------------
diff --git a/sfx2/qa/complex/DocumentMetadataAccessTest.java b/sfx2/qa/complex/framework/DocumentMetadataAccessTest.java
index a61280c45fe5..3f61cb21b3dd 100644
--- a/sfx2/qa/complex/DocumentMetadataAccessTest.java
+++ b/sfx2/qa/complex/framework/DocumentMetadataAccessTest.java
@@ -27,15 +27,14 @@
package complex.framework;
-import complexlib.ComplexTestCase;
+// import complexlib.ComplexTestCase;
import helper.StreamSimulator;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;
-import com.sun.star.uno.Any;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.lang.XComponent;
-import com.sun.star.lang.XInitialization;
+
import com.sun.star.lang.XServiceInfo;
import com.sun.star.lang.IllegalArgumentException;
import com.sun.star.lang.WrappedTargetException;
@@ -46,17 +45,23 @@ import com.sun.star.beans.Pair;
import com.sun.star.beans.StringPair;
import com.sun.star.container.XEnumerationAccess;
import com.sun.star.container.XEnumeration;
-import com.sun.star.container.ElementExistException;
-import com.sun.star.container.NoSuchElementException;
import com.sun.star.io.XInputStream;
-import com.sun.star.io.XOutputStream;
import com.sun.star.util.XCloseable;
import com.sun.star.frame.XStorable;
-import com.sun.star.frame.XLoadable;
import com.sun.star.text.XTextDocument;
import com.sun.star.text.XTextRange;
import com.sun.star.text.XText;
import com.sun.star.rdf.*;
+import lib.TestParameters;
+
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
/**
* Test case for interface com.sun.star.rdf.XDocumentMetadataAccess
@@ -68,7 +73,7 @@ import com.sun.star.rdf.*;
*
* @author mst
*/
-public class DocumentMetadataAccessTest extends ComplexTestCase
+public class DocumentMetadataAccessTest
{
XMultiServiceFactory xMSF;
XComponentContext xContext;
@@ -105,72 +110,77 @@ public class DocumentMetadataAccessTest extends ComplexTestCase
XRepositorySupplier xRS;
XDocumentMetadataAccess xDMA;
- public String[] getTestMethodNames ()
- {
- return new String[] { "check", "checkRDFa" };
- }
+// public String[] getTestMethodNames ()
+// {
+// return new String[] { "check", "checkRDFa" };
+// }
+ /**
+ * The test parameters
+ */
+ private static TestParameters param = null;
- public void before()
+ @Before public void before()
{
try {
- xMSF = (XMultiServiceFactory) param.getMSF();
- assure("could not create MultiServiceFactory.", xMSF != null);
- XPropertySet xPropertySet = (XPropertySet)
- UnoRuntime.queryInterface(XPropertySet.class, xMSF);
+ xMSF = getMSF();
+ param = new TestParameters();
+ param.put("ServiceFactory", xMSF); // important for param.getMSF()
+
+ assertNotNull("could not create MultiServiceFactory.", xMSF);
+ XPropertySet xPropertySet = UnoRuntime.queryInterface(XPropertySet.class, xMSF);
Object defaultCtx = xPropertySet.getPropertyValue("DefaultContext");
- xContext = (XComponentContext)
- UnoRuntime.queryInterface(XComponentContext.class, defaultCtx);
- assure("could not get component context.", xContext != null);
+ xContext = UnoRuntime.queryInterface(XComponentContext.class, defaultCtx);
+ assertNotNull("could not get component context.", xContext);
tempDir = util.utils.getOfficeTemp/*Dir*/(xMSF);
- log.println("tempdir: " + tempDir);
+ System.out.println("tempdir: " + tempDir);
foo = URI.create(xContext, "uri:foo");
- assure("foo", null != foo);
+ assertNotNull("foo", foo);
bar = URI.create(xContext, "uri:bar");
- assure("bar", null != bar);
+ assertNotNull("bar", bar);
baz = URI.create(xContext, "uri:baz");
- assure("baz", null != baz);
+ assertNotNull("baz", baz);
blank1 = BlankNode.create(xContext, "_:1");
- assure("blank1", null != blank1);
+ assertNotNull("blank1", blank1);
blank2 = BlankNode.create(xContext, "_:2");
- assure("blank2", null != blank2);
+ assertNotNull("blank2", blank2);
blank3 = BlankNode.create(xContext, "_:3");
- assure("blank3", null != blank3);
+ assertNotNull("blank3", blank3);
blank4 = BlankNode.create(xContext, "_:4");
- assure("blank4", null != blank4);
+ assertNotNull("blank4", blank4);
rdf_type = URI.createKnown(xContext, URIs.RDF_TYPE);
- assure("rdf_type", null != rdf_type);
+ assertNotNull("rdf_type", rdf_type);
rdfs_label = URI.createKnown(xContext, URIs.RDFS_LABEL);
- assure("rdfs_label", null != rdfs_label);
+ assertNotNull("rdfs_label", rdfs_label);
pkg_Document = URI.createKnown(xContext, URIs.PKG_DOCUMENT);
- assure("pkg_Document", null != pkg_Document);
+ assertNotNull("pkg_Document", pkg_Document);
pkg_hasPart = URI.createKnown(xContext, URIs.PKG_HASPART);
- assure("pkg_hasPart", null != pkg_hasPart);
+ assertNotNull("pkg_hasPart", pkg_hasPart);
pkg_MetadataFile = URI.createKnown(xContext, URIs.PKG_METADATAFILE);
- assure("pkg_MetadataFile", null != pkg_MetadataFile);
+ assertNotNull("pkg_MetadataFile", pkg_MetadataFile);
odf_ContentFile = URI.createKnown(xContext, URIs.ODF_CONTENTFILE);
- assure("odf_ContentFile", null != odf_ContentFile);
+ assertNotNull("odf_ContentFile", odf_ContentFile);
odf_StylesFile = URI.createKnown(xContext, URIs.ODF_STYLESFILE);
- assure("odf_StylesFile", null != odf_StylesFile);
+ assertNotNull("odf_StylesFile", odf_StylesFile);
odf_Element = URI.createKnown(xContext, URIs.ODF_ELEMENT);
- assure("odf_Element", null != odf_Element);
+ assertNotNull("odf_Element", odf_Element);
} catch (Exception e) {
report(e);
}
}
- public void after()
+ @After public void after()
{
xRep = null;
xRS = null;
xDMA = null;
}
- public void check()
+ @Test public void check()
{
XComponent xComp = null;
XComponent xComp2 = null;
@@ -178,7 +188,7 @@ public class DocumentMetadataAccessTest extends ComplexTestCase
XEnumeration xStmtsEnum;
XNamedGraph xManifest;
- log.println("Creating document with Repository...");
+ System.out.println("Creating document with Repository...");
// we cannot create a XDMA directly, we must create
// a document and get it from there :(
@@ -188,40 +198,37 @@ public class DocumentMetadataAccessTest extends ComplexTestCase
loadProps[0].Name = "Hidden";
loadProps[0].Value = new Boolean(true);
xComp = util.DesktopTools.openNewDoc(xMSF, "swriter", loadProps);
- XTextDocument xText = (XTextDocument) UnoRuntime.queryInterface(
- XTextDocument.class, xComp);
-
- XRepositorySupplier xRS = (XRepositorySupplier)
- UnoRuntime.queryInterface(XRepositorySupplier.class, xComp);
- assure("xRS null", null != xRS);
- XDocumentMetadataAccess xDMA = (XDocumentMetadataAccess)
- UnoRuntime.queryInterface(XDocumentMetadataAccess.class, xRS);
- assure("xDMA null", null != xDMA);
+ XTextDocument xText = UnoRuntime.queryInterface(XTextDocument.class, xComp);
+
+ XRepositorySupplier xRS = UnoRuntime.queryInterface(XRepositorySupplier.class, xComp);
+ assertNotNull("xRS null", xRS);
+ XDocumentMetadataAccess xDMA = UnoRuntime.queryInterface(XDocumentMetadataAccess.class, xRS);
+ assertNotNull("xDMA null", xDMA);
xRep = xRS.getRDFRepository();
- assure("xRep null", null != xRep);
+ assertNotNull("xRep null", xRep);
- log.println("...done");
+ System.out.println("...done");
- log.println("Checking that new repository is initialized...");
+ System.out.println("Checking that new repository is initialized...");
XURI xBaseURI = (XURI) xDMA;
String baseURI = xBaseURI.getStringValue();
- assure("new: baseURI",
- null != xBaseURI && !xBaseURI.getStringValue().equals(""));
+ assertNotNull("new: baseURI", xBaseURI );
+ assertTrue("new: baseURI", !xBaseURI.getStringValue().equals(""));
- assure("new: # graphs", 1 == xRep.getGraphNames().length);
+ assertTrue("new: # graphs", 1 == xRep.getGraphNames().length);
XURI manifest = URI.createNS(xContext, xBaseURI.getStringValue(),
manifestPath);
xManifest = xRep.getGraph(manifest);
- assure("new: manifest graph", null != xManifest);
+ assertTrue("new: manifest graph", null != xManifest);
Statement[] manifestStmts = getManifestStmts(xBaseURI);
xStmtsEnum = xRep.getStatements(null, null, null);
- assure("new: manifest graph", eq(xStmtsEnum, manifestStmts));
+ assertTrue("new: manifest graph", eq(xStmtsEnum, manifestStmts));
- log.println("...done");
+ System.out.println("...done");
- log.println("Checking some invalid args...");
+ System.out.println("Checking some invalid args...");
String content = "behold, for i am the content.";
XTextRange xTR = new TestRange(content);
@@ -229,205 +236,201 @@ public class DocumentMetadataAccessTest extends ComplexTestCase
try {
xDMA.getElementByURI(null);
- assure("getElementByURI: null allowed", false);
+ fail("getElementByURI: null allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
xDMA.getMetadataGraphsWithType(null);
- assure("getMetadataGraphsWithType: null URI allowed", false);
+ fail("getMetadataGraphsWithType: null URI allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
xDMA.addMetadataFile("", new XURI[0]);
- assure("addMetadataFile: empty filename allowed", false);
+ fail("addMetadataFile: empty filename allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
xDMA.addMetadataFile("/foo", new XURI[0]);
- assure("addMetadataFile: absolute filename allowed", false);
+ fail("addMetadataFile: absolute filename allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
xDMA.addMetadataFile("fo\"o", new XURI[0]);
- assure("addMetadataFile: invalid filename allowed", false);
+ fail("addMetadataFile: invalid filename allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
xDMA.addMetadataFile("../foo", new XURI[0]);
- assure("addMetadataFile: filename with .. allowed", false);
+ fail("addMetadataFile: filename with .. allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
xDMA.addMetadataFile("foo/../../bar", new XURI[0]);
- assure("addMetadataFile: filename with nest .. allowed", false);
+ fail("addMetadataFile: filename with nest .. allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
xDMA.addMetadataFile("foo/././bar", new XURI[0]);
- assure("addMetadataFile: filename with nest . allowed", false);
+ fail("addMetadataFile: filename with nest . allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
xDMA.addMetadataFile("content.xml", new XURI[0]);
- assure("addMetadataFile: content.xml allowed", false);
+ fail("addMetadataFile: content.xml allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
xDMA.addMetadataFile("styles.xml", new XURI[0]);
- assure("addMetadataFile: styles.xml allowed", false);
+ fail("addMetadataFile: styles.xml allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
xDMA.addMetadataFile("meta.xml", new XURI[0]);
- assure("addMetadataFile: meta.xml allowed", false);
+ fail("addMetadataFile: meta.xml allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
xDMA.addMetadataFile("settings.xml", new XURI[0]);
- assure("addMetadataFile: settings.xml allowed", false);
+ fail("addMetadataFile: settings.xml allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
xDMA.importMetadataFile(FileFormat.RDF_XML, null, "foo",
foo, new XURI[0]);
- assure("importMetadataFile: null stream allowed", false);
+ fail("importMetadataFile: null stream allowed");
} catch (IllegalArgumentException e) {
// ignore
}
+
+ final String sEmptyRDF = TestDocument.getUrl("empty.rdf");
try {
- XInputStream xFooIn =
- new StreamSimulator(tempDir + "empty.rdf", true, param);
+ XInputStream xFooIn = new StreamSimulator(sEmptyRDF, true, param);
xDMA.importMetadataFile(FileFormat.RDF_XML, xFooIn, "",
foo, new XURI[0]);
- assure("importMetadataFile: empty filename allowed", false);
+ fail("importMetadataFile: empty filename allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
XInputStream xFooIn =
- new StreamSimulator(tempDir + "empty.rdf", true, param);
+ new StreamSimulator(sEmptyRDF, true, param);
xDMA.importMetadataFile(FileFormat.RDF_XML, xFooIn, "meta.xml",
foo, new XURI[0]);
- assure("importMetadataFile: meta.xml filename allowed", false);
+ fail("importMetadataFile: meta.xml filename allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
XInputStream xFooIn =
- new StreamSimulator(tempDir + "empty.rdf", true, param);
+ new StreamSimulator(sEmptyRDF, true, param);
xDMA.importMetadataFile(FileFormat.RDF_XML,
xFooIn, "foo", null, new XURI[0]);
- assure("importMetadataFile: null base URI allowed", false);
+ fail("importMetadataFile: null base URI allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
XInputStream xFooIn =
- new StreamSimulator(tempDir + "empty.rdf", true, param);
+ new StreamSimulator(sEmptyRDF, true, param);
xDMA.importMetadataFile(FileFormat.RDF_XML,
xFooIn, "foo", rdf_type, new XURI[0]);
- assure("importMetadataFile: non-absolute base URI allowed",
- false);
+ fail("importMetadataFile: non-absolute base URI allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
xDMA.removeMetadataFile(null);
- assure("removeMetadataFile: null URI allowed", false);
+ fail("removeMetadataFile: null URI allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
xDMA.addContentOrStylesFile("");
- assure("addContentOrStylesFile: empty filename allowed",
- false);
+ fail("addContentOrStylesFile: empty filename allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
xDMA.addContentOrStylesFile("/content.xml");
- assure("addContentOrStylesFile: absolute filename allowed",
- false);
+ fail("addContentOrStylesFile: absolute filename allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
xDMA.addContentOrStylesFile("foo.rdf");
- assure("addContentOrStylesFile: invalid filename allowed",
- false);
+ fail("addContentOrStylesFile: invalid filename allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
xDMA.removeContentOrStylesFile("");
- assure("removeContentOrStylesFile: empty filename allowed",
- false);
+ fail("removeContentOrStylesFile: empty filename allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
xDMA.loadMetadataFromStorage(null, foo, null);
- assure("loadMetadataFromStorage: null storage allowed", false);
+ fail("loadMetadataFromStorage: null storage allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
xDMA.storeMetadataToStorage(null/*, base*/);
- assure("storeMetadataToStorage: null storage allowed", false);
+ fail("storeMetadataToStorage: null storage allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
xDMA.loadMetadataFromMedium(new PropertyValue[0]);
- assure("loadMetadataFromMedium: empty medium allowed", false);
+ fail("loadMetadataFromMedium: empty medium allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
xDMA.storeMetadataToMedium(new PropertyValue[0]);
- assure("storeMetadataToMedium: empty medium allowed", false);
+ fail("storeMetadataToMedium: empty medium allowed");
} catch (IllegalArgumentException e) {
// ignore
}
- log.println("...done");
+ System.out.println("...done");
- log.println("Checking file addition/removal...");
+ System.out.println("Checking file addition/removal...");
xDMA.removeContentOrStylesFile(contentPath);
xStmtsEnum = xManifest.getStatements(null, null, null);
- assure("removeContentOrStylesFile (content)",
+ assertTrue("removeContentOrStylesFile (content)",
eq(xStmtsEnum, new Statement[] {
manifestStmts[0], manifestStmts[2], manifestStmts[4]
}));
xDMA.addContentOrStylesFile(contentPath);
xStmtsEnum = xManifest.getStatements(null, null, null);
- assure("addContentOrStylesFile (content)",
+ assertTrue("addContentOrStylesFile (content)",
eq(xStmtsEnum, manifestStmts));
xDMA.removeContentOrStylesFile(stylesPath);
xStmtsEnum = xManifest.getStatements(null, null, null);
- assure("removeContentOrStylesFile (styles)",
+ assertTrue("removeContentOrStylesFile (styles)",
eq(xStmtsEnum, new Statement[] {
manifestStmts[0], manifestStmts[1], manifestStmts[3]
}));
xDMA.addContentOrStylesFile(stylesPath);
xStmtsEnum = xManifest.getStatements(null, null, null);
- assure("addContentOrStylesFile (styles)",
+ assertTrue("addContentOrStylesFile (styles)",
eq(xStmtsEnum, manifestStmts));
XURI xFoo = URI.createNS(xContext, xBaseURI.getStringValue(),
@@ -440,44 +443,41 @@ public class DocumentMetadataAccessTest extends ComplexTestCase
new Statement(xFoo, rdf_type, bar, manifest);
xDMA.addMetadataFile(fooPath, new XURI[] { bar });
xStmtsEnum = xManifest.getStatements(null, null, null);
- assure("addMetadataFile",
+ assertTrue("addMetadataFile",
eq(xStmtsEnum, merge(manifestStmts, new Statement[] {
xM_BaseHaspartFoo, xM_FooTypeMetadata, xM_FooTypeBar
})));
XURI[] graphsBar = xDMA.getMetadataGraphsWithType(bar);
- assure("getMetadataGraphsWithType",
+ assertTrue("getMetadataGraphsWithType",
graphsBar.length == 1 && eq(graphsBar[0], xFoo));
xDMA.removeMetadataFile(xFoo);
xStmtsEnum = xManifest.getStatements(null, null, null);
- assure("removeMetadataFile",
+ assertTrue("removeMetadataFile",
eq(xStmtsEnum, manifestStmts));
- log.println("...done");
+ System.out.println("...done");
- log.println("Checking mapping...");
+ System.out.println("Checking mapping...");
- XEnumerationAccess xTextEnum = (XEnumerationAccess)
- UnoRuntime.queryInterface(XEnumerationAccess.class,
- xText.getText());
+ XEnumerationAccess xTextEnum = UnoRuntime.queryInterface(XEnumerationAccess.class, xText.getText());
Object o = xTextEnum.createEnumeration().nextElement();
- XMetadatable xMeta1 = (XMetadatable) UnoRuntime.queryInterface(
- XMetadatable.class, o);
+ XMetadatable xMeta1 = UnoRuntime.queryInterface(XMetadatable.class, o);
XURI uri;
XMetadatable xMeta;
xMeta = xDMA.getElementByURI(xMeta1);
- assure("getElementByURI: null", null != xMeta);
+ assertTrue("getElementByURI: null", null != xMeta);
String XmlId = xMeta.getMetadataReference().Second;
String XmlId1 = xMeta1.getMetadataReference().Second;
- assure("getElementByURI: no xml id", !XmlId.equals(""));
- assure("getElementByURI: different xml id", XmlId.equals(XmlId1));
+ assertTrue("getElementByURI: no xml id", !XmlId.equals(""));
+ assertTrue("getElementByURI: different xml id", XmlId.equals(XmlId1));
- log.println("...done");
+ System.out.println("...done");
- log.println("Checking storing and loading...");
+ System.out.println("Checking storing and loading...");
XURI xFoobar = URI.createNS(xContext, xBaseURI.getStringValue(),
fooBarPath);
@@ -485,23 +485,23 @@ public class DocumentMetadataAccessTest extends ComplexTestCase
fooBarPath);
xDMA.addMetadataFile(fooBarPath, new XURI[0]);
xStmtsEnum = xRep.getStatements(null, null, null);
- assure("addMetadataFile",
+ assertTrue("addMetadataFile",
eq(xStmtsEnum, merge(manifestStmts, metadataStmts )));
Statement xFoobar_FooBarFoo =
new Statement(foo, bar, foo, xFoobar);
xRep.getGraph(xFoobar).addStatement(foo, bar, foo);
xStmtsEnum = xRep.getStatements(null, null, null);
- assure("addStatement",
+ assertTrue("addStatement",
eq(xStmtsEnum, merge(manifestStmts, merge(metadataStmts,
new Statement[] { xFoobar_FooBarFoo }))));
PropertyValue noMDNoContentFile = new PropertyValue();
noMDNoContentFile.Name = "URL";
- noMDNoContentFile.Value = util.utils.getFullTestURL("CUSTOM.odt");
+ noMDNoContentFile.Value = TestDocument.getUrl("CUSTOM.odt");
PropertyValue noMDFile = new PropertyValue();
noMDFile.Name = "URL";
- noMDFile.Value = util.utils.getFullTestURL("TEST.odt");
+ noMDFile.Value = TestDocument.getUrl("TEST.odt");
PropertyValue file = new PropertyValue();
file.Name = "URL";
file.Value = tempDir + "TESTDMA.odt";
@@ -525,71 +525,67 @@ public class DocumentMetadataAccessTest extends ComplexTestCase
// this should re-init
xDMA.loadMetadataFromMedium(argsEmptyNoContent);
xRep = xRS.getRDFRepository();
- assure("xRep null", null != xRep);
- assure("baseURI still tdoc?",
+ assertTrue("xRep null", null != xRep);
+ assertTrue("baseURI still tdoc?",
!baseURI.equals(xDMA.getStringValue()));
Statement[] manifestStmts2 = getManifestStmts((XURI) xDMA);
xStmtsEnum = xRep.getStatements(null, null, null);
// there is no content or styles file in here, so we have just
// the package stmt
- assure("loadMetadataFromMedium (no metadata, no content)",
+ assertTrue("loadMetadataFromMedium (no metadata, no content)",
eq(xStmtsEnum, new Statement[] { manifestStmts2[0] }));
// this should re-init
xDMA.loadMetadataFromMedium(argsEmpty);
xRep = xRS.getRDFRepository();
- assure("xRep null", null != xRep);
- assure("baseURI still tdoc?",
+ assertTrue("xRep null", null != xRep);
+ assertTrue("baseURI still tdoc?",
!baseURI.equals(xDMA.getStringValue()));
Statement[] manifestStmts3 = getManifestStmts((XURI) xDMA);
xStmtsEnum = xRep.getStatements(null, null, null);
- assure("loadMetadataFromMedium (no metadata)",
+ assertTrue("loadMetadataFromMedium (no metadata)",
eq(xStmtsEnum, manifestStmts3));
xDMA.loadMetadataFromMedium(args);
xRep = xRS.getRDFRepository();
- assure("xRep null", null != xRep);
+ assertTrue("xRep null", null != xRep);
Statement[] manifestStmts4 = getManifestStmts((XURI) xDMA);
Statement[] metadataStmts4 = getMetadataFileStmts((XURI) xDMA,
fooBarPath);
xStmtsEnum = xRep.getStatements(null, null, null);
- assure("some graph(s) not reloaded",
+ assertTrue("some graph(s) not reloaded",
graphs.length == xRep.getGraphNames().length);
XURI xFoobar4 = URI.createNS(xContext, xDMA.getStringValue(),
fooBarPath);
Statement xFoobar_FooBarFoo4 =
new Statement(foo, bar, foo, xFoobar4);
- assure("loadMetadataFromMedium (re-load)",
+ assertTrue("loadMetadataFromMedium (re-load)",
eq(xStmtsEnum, merge(manifestStmts4, merge(metadataStmts4,
new Statement[] { xFoobar_FooBarFoo4 }))));
- log.println("...done");
+ System.out.println("...done");
- log.println("Checking storing and loading via model...");
+ System.out.println("Checking storing and loading via model...");
String f = tempDir + "TESTPARA.odt";
- XStorable xStor = (XStorable) UnoRuntime.queryInterface(
- XStorable.class, xRS);
+ XStorable xStor = UnoRuntime.queryInterface(XStorable.class, xRS);
xStor.storeToURL(f, new PropertyValue[0]);
xComp2 = util.DesktopTools.loadDoc(xMSF, f, loadProps);
- XDocumentMetadataAccess xDMA2 = (XDocumentMetadataAccess)
- UnoRuntime.queryInterface(XDocumentMetadataAccess.class,
- xComp2);
- assure("xDMA2 null", null != xDMA2);
+ XDocumentMetadataAccess xDMA2 = UnoRuntime.queryInterface(XDocumentMetadataAccess.class, xComp2);
+ assertTrue("xDMA2 null", null != xDMA2);
- XRepositorySupplier xRS2 = (XRepositorySupplier)
- UnoRuntime.queryInterface(XRepositorySupplier.class, xComp2);
- assure("xRS2 null", null != xRS2);
+ XRepositorySupplier xRS2 = UnoRuntime.queryInterface(XRepositorySupplier.class, xComp2);
+ assertTrue("xRS2 null", null != xRS2);
XRepository xRep2 = xRS2.getRDFRepository();
- assure("xRep2 null", null != xRep2);
+ assertTrue("xRep2 null", null != xRep2);
Statement[] manifestStmts5 = getManifestStmts((XURI) xDMA2);
Statement[] metadataStmts5 = getMetadataFileStmts((XURI) xDMA2,
@@ -600,11 +596,11 @@ public class DocumentMetadataAccessTest extends ComplexTestCase
new Statement(foo, bar, foo, xFoobar5);
xStmtsEnum = xRep.getStatements(null, null, null);
XEnumeration xStmtsEnum2 = xRep2.getStatements(null, null, null);
- assure("load: repository differs",
+ assertTrue("load: repository differs",
eq(xStmtsEnum2, merge(manifestStmts5, merge(metadataStmts5,
new Statement[] { xFoobar_FooBarFoo5 }))));
- log.println("...done");
+ System.out.println("...done");
} catch (Exception e) {
report(e);
@@ -614,49 +610,48 @@ public class DocumentMetadataAccessTest extends ComplexTestCase
}
}
- public void checkRDFa()
+ @Test public void checkRDFa()
{
XComponent xComp = null;
- String file;
try {
- file = util.utils.getFullTestURL("TESTRDFA.odt");
+ final String file = TestDocument.getUrl("TESTRDFA.odt");
xComp = loadRDFa(file);
if (xComp != null)
{
- file = tempDir + "TESTRDFA.odt";
- storeRDFa(xComp, file);
+ final String sNewFile = tempDir + "TESTRDFA.odt";
+ storeRDFa(xComp, sNewFile);
close(xComp);
- xComp = loadRDFa(file);
+
+ xComp = loadRDFa(sNewFile);
}
} finally {
close(xComp);
}
}
- public void storeRDFa(XComponent xComp, String file)
+ private void storeRDFa(XComponent xComp, String file)
{
try {
- log.println("Storing test document...");
+ System.out.println("Storing test document...");
- XStorable xStor = (XStorable) UnoRuntime.queryInterface(
- XStorable.class, xComp);
+ XStorable xStor = UnoRuntime.queryInterface(XStorable.class, xComp);
xStor.storeToURL(file, new PropertyValue[0]);
- log.println("...done");
+ System.out.println("...done");
} catch (Exception e) {
report(e);
}
}
- public XComponent loadRDFa(String file)
+ private XComponent loadRDFa(String file)
{
XComponent xComp = null;
try {
- log.println("Loading test document...");
+ System.out.println("Loading test document...");
PropertyValue[] loadProps = new PropertyValue[1];
loadProps[0] = new PropertyValue();
@@ -667,46 +662,39 @@ public class DocumentMetadataAccessTest extends ComplexTestCase
xComp = util.DesktopTools.loadDoc(xMSF, file, loadProps);
- XRepositorySupplier xRS = (XRepositorySupplier)
- UnoRuntime.queryInterface(XRepositorySupplier.class, xComp);
- assure("xRS null", null != xRS);
+ XRepositorySupplier xRS = UnoRuntime.queryInterface(XRepositorySupplier.class, xComp);
+ assertTrue("xRS null", null != xRS);
- XDocumentRepository xRep = (XDocumentRepository)
- UnoRuntime.queryInterface(XDocumentRepository.class,
- xRS.getRDFRepository());
- assure("xRep null", null != xRep);
+ XDocumentRepository xRep = UnoRuntime.queryInterface(XDocumentRepository.class, xRS.getRDFRepository());
+ assertTrue("xRep null", null != xRep);
- XTextDocument xTextDoc = (XTextDocument)
- UnoRuntime.queryInterface(XTextDocument.class, xComp);
+ XTextDocument xTextDoc = UnoRuntime.queryInterface(XTextDocument.class, xComp);
XText xText = xTextDoc.getText();
- XEnumerationAccess xEA = (XEnumerationAccess)
- UnoRuntime.queryInterface(XEnumerationAccess.class, xText);
+ XEnumerationAccess xEA = UnoRuntime.queryInterface(XEnumerationAccess.class, xText);
XEnumeration xEnum = xEA.createEnumeration();
- log.println("...done");
+ System.out.println("...done");
- log.println("Checking RDFa in loaded test document...");
+ System.out.println("Checking RDFa in loaded test document...");
XMetadatable xPara;
Pair<Statement[], Boolean> result;
Statement x_FooBarLit1 = new Statement(foo, bar, mkLit("1"), null);
- xPara = (XMetadatable) UnoRuntime.queryInterface(
- XMetadatable.class, xEnum.nextElement());
+ xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
result = xRep.getStatementRDFa(xPara);
- assure("RDFa: 1",
+ assertTrue("RDFa: 1",
!result.Second &&
eq(result.First, new Statement[] {
x_FooBarLit1
}));
Statement x_FooBarLit2 = new Statement(foo, bar, mkLit("2"), null);
- xPara = (XMetadatable) UnoRuntime.queryInterface(
- XMetadatable.class, xEnum.nextElement());
+ xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
result = xRep.getStatementRDFa(xPara);
- assure("RDFa: 2",
+ assertTrue("RDFa: 2",
!result.Second &&
eq(result.First, new Statement[] {
x_FooBarLit2
@@ -714,54 +702,47 @@ public class DocumentMetadataAccessTest extends ComplexTestCase
Statement x_BlankBarLit3 =
new Statement(blank1, bar, mkLit("3"), null);
- xPara = (XMetadatable) UnoRuntime.queryInterface(
- XMetadatable.class, xEnum.nextElement());
+ xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
result = xRep.getStatementRDFa(xPara);
- assure("RDFa: 3",
+ assertTrue("RDFa: 3",
!result.Second &&
eq(result.First, new Statement[] {
x_BlankBarLit3
}));
- XBlankNode b3 = (XBlankNode) UnoRuntime.queryInterface(
- XBlankNode.class, result.First[0].Subject);
+ XBlankNode b3 = UnoRuntime.queryInterface(XBlankNode.class, result.First[0].Subject);
Statement x_BlankBarLit4 =
new Statement(blank2, bar, mkLit("4"), null);
- xPara = (XMetadatable) UnoRuntime.queryInterface(
- XMetadatable.class, xEnum.nextElement());
+ xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
result = xRep.getStatementRDFa(xPara);
- assure("RDFa: 4",
+ assertTrue("RDFa: 4",
!result.Second &&
eq(result.First, new Statement[] {
x_BlankBarLit4
}));
- XBlankNode b4 = (XBlankNode) UnoRuntime.queryInterface(
- XBlankNode.class, result.First[0].Subject);
+ XBlankNode b4 = UnoRuntime.queryInterface(XBlankNode.class, result.First[0].Subject);
Statement x_BlankBarLit5 =
new Statement(blank1, bar, mkLit("5"), null);
- xPara = (XMetadatable) UnoRuntime.queryInterface(
- XMetadatable.class, xEnum.nextElement());
+ xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
result = xRep.getStatementRDFa(xPara);
- assure("RDFa: 5",
+ assertTrue("RDFa: 5",
!result.Second &&
eq(result.First, new Statement[] {
x_BlankBarLit5
}));
- XBlankNode b5 = (XBlankNode) UnoRuntime.queryInterface(
- XBlankNode.class, result.First[0].Subject);
+ XBlankNode b5 = UnoRuntime.queryInterface(XBlankNode.class, result.First[0].Subject);
- assure("RDFa: 3 != 4",
+ assertTrue("RDFa: 3 != 4",
!b3.getStringValue().equals(b4.getStringValue()));
- assure("RDFa: 3 == 5",
+ assertTrue("RDFa: 3 == 5",
b3.getStringValue().equals(b5.getStringValue()));
Statement x_FooBarLit6 = new Statement(foo, bar, mkLit("6"), null);
Statement x_FooBazLit6 = new Statement(foo, baz, mkLit("6"), null);
- xPara = (XMetadatable) UnoRuntime.queryInterface(
- XMetadatable.class, xEnum.nextElement());
+ xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
result = xRep.getStatementRDFa(xPara);
- assure("RDFa: 6",
+ assertTrue("RDFa: 6",
!result.Second &&
eq(result.First, new Statement[] {
x_FooBarLit6, x_FooBazLit6
@@ -770,10 +751,9 @@ public class DocumentMetadataAccessTest extends ComplexTestCase
Statement x_FooBarLit7 = new Statement(foo, bar, mkLit("7"), null);
Statement x_FooBazLit7 = new Statement(foo, baz, mkLit("7"), null);
Statement x_FooFooLit7 = new Statement(foo, foo, mkLit("7"), null);
- xPara = (XMetadatable) UnoRuntime.queryInterface(
- XMetadatable.class, xEnum.nextElement());
+ xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
result = xRep.getStatementRDFa(xPara);
- assure("RDFa: 7",
+ assertTrue("RDFa: 7",
!result.Second &&
eq(result.First, new Statement[] {
x_FooBarLit7, x_FooBazLit7, x_FooFooLit7
@@ -784,28 +764,25 @@ public class DocumentMetadataAccessTest extends ComplexTestCase
Statement x_FooBarLit = new Statement(foo, bar, lit, null);
Statement x_FooBarLittype = new Statement(foo, bar, lit_type, null);
- xPara = (XMetadatable) UnoRuntime.queryInterface(
- XMetadatable.class, xEnum.nextElement());
+ xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
result = xRep.getStatementRDFa(xPara);
- assure("RDFa: 8",
+ assertTrue("RDFa: 8",
result.Second &&
eq(result.First, new Statement[] {
x_FooBarLit
}));
- xPara = (XMetadatable) UnoRuntime.queryInterface(
- XMetadatable.class, xEnum.nextElement());
+ xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
result = xRep.getStatementRDFa(xPara);
- assure("RDFa: 9",
+ assertTrue("RDFa: 9",
result.Second &&
eq(result.First, new Statement[] {
x_FooBarLit
}));
- xPara = (XMetadatable) UnoRuntime.queryInterface(
- XMetadatable.class, xEnum.nextElement());
+ xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
result = xRep.getStatementRDFa(xPara);
- assure("RDFa: 10",
+ assertTrue("RDFa: 10",
result.Second &&
eq(result.First, new Statement[] {
x_FooBarLittype
@@ -813,10 +790,9 @@ public class DocumentMetadataAccessTest extends ComplexTestCase
Statement x_FooBarLit11
= new Statement(foo, bar, mkLit("11", bar), null);
- xPara = (XMetadatable) UnoRuntime.queryInterface(
- XMetadatable.class, xEnum.nextElement());
+ xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
result = xRep.getStatementRDFa(xPara);
- assure("RDFa: 11",
+ assertTrue("RDFa: 11",
!result.Second &&
eq(result.First, new Statement[] {
x_FooBarLit11
@@ -825,19 +801,17 @@ public class DocumentMetadataAccessTest extends ComplexTestCase
XURI xFile = URI.createNS(xContext, file, "/" + contentPath);
Statement x_FileBarLit12 =
new Statement(xFile, bar, mkLit("12"), null);
- xPara = (XMetadatable) UnoRuntime.queryInterface(
- XMetadatable.class, xEnum.nextElement());
+ xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
result = xRep.getStatementRDFa(xPara);
- assure("RDFa: 12",
+ assertTrue("RDFa: 12",
!result.Second &&
eq(result.First, new Statement[] {
x_FileBarLit12
}));
- xPara = (XMetadatable) UnoRuntime.queryInterface(
- XMetadatable.class, xEnum.nextElement());
+ xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
result = xRep.getStatementRDFa(xPara);
- assure("RDFa: 13",
+ assertTrue("RDFa: 13",
result.Second &&
eq(result.First, new Statement[] {
x_FooBarLit
@@ -845,51 +819,45 @@ public class DocumentMetadataAccessTest extends ComplexTestCase
Statement x_FooLabelLit14 =
new Statement(foo, rdfs_label, mkLit("14"), null);
- xPara = (XMetadatable) UnoRuntime.queryInterface(
- XMetadatable.class, xEnum.nextElement());
+ xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
result = xRep.getStatementRDFa(xPara);
- assure("RDFa: 14",
+ assertTrue("RDFa: 14",
result.Second &&
eq(result.First, new Statement[] {
- x_FooBarLit
+ /* x_FooLabelLit14 */ x_FooBarLit
}));
- xPara = (XMetadatable) UnoRuntime.queryInterface(
- XMetadatable.class, xEnum.nextElement());
+ xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
result = xRep.getStatementRDFa(xPara);
- assure("RDFa: 15", eq(result.First, new Statement[] { } ));
+ assertTrue("RDFa: 15", eq(result.First, new Statement[] { } ));
- xPara = (XMetadatable) UnoRuntime.queryInterface(
- XMetadatable.class, xEnum.nextElement());
+ xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
result = xRep.getStatementRDFa(xPara);
- assure("RDFa: 16", eq(result.First, new Statement[] { } ));
+ assertTrue("RDFa: 16", eq(result.First, new Statement[] { } ));
- xPara = (XMetadatable) UnoRuntime.queryInterface(
- XMetadatable.class, xEnum.nextElement());
+ xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
result = xRep.getStatementRDFa(xPara);
- assure("RDFa: 17", eq(result.First, new Statement[] { } ));
+ assertTrue("RDFa: 17", eq(result.First, new Statement[] { } ));
- xPara = (XMetadatable) UnoRuntime.queryInterface(
- XMetadatable.class, xEnum.nextElement());
+ xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
result = xRep.getStatementRDFa(xPara);
- assure("RDFa: 18", eq(result.First, new Statement[] { } ));
+ assertTrue("RDFa: 18", eq(result.First, new Statement[] { } ));
- xPara = (XMetadatable) UnoRuntime.queryInterface(
- XMetadatable.class, xEnum.nextElement());
+ xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
result = xRep.getStatementRDFa(xPara);
- assure("RDFa: 19", eq(result.First, new Statement[] { } ));
+ assertTrue("RDFa: 19", eq(result.First, new Statement[] { } ));
- xPara = (XMetadatable) UnoRuntime.queryInterface(
+ xPara = UnoRuntime.queryInterface(
XMetadatable.class, xEnum.nextElement());
result = xRep.getStatementRDFa(xPara);
- assure("RDFa: 20", eq(result.First, new Statement[] { } ));
+ assertTrue("RDFa: 20", eq(result.First, new Statement[] { } ));
- xPara = (XMetadatable) UnoRuntime.queryInterface(
+ xPara = UnoRuntime.queryInterface(
XMetadatable.class, xEnum.nextElement());
result = xRep.getStatementRDFa(xPara);
- assure("RDFa: 21", eq(result.First, new Statement[] { } ));
+ assertTrue("RDFa: 21", eq(result.First, new Statement[] { } ));
- log.println("...done");
+ System.out.println("...done");
} catch (Exception e) {
report(e);
@@ -905,33 +873,35 @@ public class DocumentMetadataAccessTest extends ComplexTestCase
{
if (e instanceof WrappedTargetException)
{
- log.println("Cause:");
+ System.out.println("Cause:");
Exception cause = (Exception)
(((WrappedTargetException)e).TargetException);
- log.println(cause.toString());
+ System.out.println(cause.toString());
report2(cause);
} else if (e instanceof WrappedTargetRuntimeException) {
- log.println("Cause:");
+ System.out.println("Cause:");
Exception cause = (Exception)
(((WrappedTargetRuntimeException)e).TargetException);
- log.println(cause.toString());
+ System.out.println(cause.toString());
report2(cause);
}
}
public void report(Exception e) {
- log.println("Exception occurred:");
- e.printStackTrace((java.io.PrintWriter) log);
+ System.out.println("Exception occurred:");
+ e.printStackTrace();
report2(e);
- failed();
+ fail();
}
static void close(XComponent i_comp)
{
try {
- XCloseable xClos = (XCloseable) UnoRuntime.queryInterface(
- XCloseable.class, i_comp);
- if (xClos != null) xClos.close(true);
+ XCloseable xClos = UnoRuntime.queryInterface(XCloseable.class, i_comp);
+ if (xClos != null)
+ {
+ xClos.close(true);
+ }
} catch (Exception e) {
}
}
@@ -960,14 +930,16 @@ public class DocumentMetadataAccessTest extends ComplexTestCase
}
public static String toS(XNode n) {
- if (null == n) return "< null >";
+ if (null == n)
+ {
+ return "< null >";
+ }
return n.getStringValue();
}
static boolean isBlank(XNode i_node)
{
- XBlankNode blank = (XBlankNode) UnoRuntime.queryInterface(
- XBlankNode.class, i_node);
+ XBlankNode blank = UnoRuntime.queryInterface(XBlankNode.class, i_node);
return blank != null;
}
@@ -1000,7 +972,7 @@ public class DocumentMetadataAccessTest extends ComplexTestCase
java.util.Collection c = new java.util.Vector();
while (i_Enum.hasMoreElements()) {
Statement s = (Statement) i_Enum.nextElement();
-//log.println("toSeq: " + s.getSubject().getStringValue() + " " + s.getPredicate().getStringValue() + " " + s.getObject().getStringValue() + ".");
+//System.out.println("toSeq: " + s.getSubject().getStringValue() + " " + s.getPredicate().getStringValue() + " " + s.getObject().getStringValue() + ".");
c.add(s);
}
// return (Statement[]) c.toArray();
@@ -1035,11 +1007,17 @@ public class DocumentMetadataAccessTest extends ComplexTestCase
{
XNode[] left = (XNode[]) i_Left;
XNode[] right = (XNode[]) i_Right;
- if (left.length != right.length) throw new RuntimeException();
+ if (left.length != right.length)
+ {
+ throw new RuntimeException();
+ }
for (int i = 0; i < left.length; ++i) {
int eq = (left[i].getStringValue().compareTo(
right[i].getStringValue()));
- if (eq != 0) return eq;
+ if (eq != 0)
+ {
+ return eq;
+ }
}
return 0;
}
@@ -1078,23 +1056,23 @@ public class DocumentMetadataAccessTest extends ComplexTestCase
XURI lG = i_Left.Graph;
XURI rG = i_Right.Graph;
if (!eq(lG, rG)) {
- log.println("Graphs differ: " + toS(lG) + " != " + toS(rG));
+ System.out.println("Graphs differ: " + toS(lG) + " != " + toS(rG));
return false;
}
if (!eq(i_Left.Subject, i_Right.Subject)) {
- log.println("Subjects differ: " +
+ System.out.println("Subjects differ: " +
i_Left.Subject.getStringValue() + " != " +
i_Right.Subject.getStringValue());
return false;
}
if (!eq(i_Left.Predicate, i_Right.Predicate)) {
- log.println("Predicates differ: " +
+ System.out.println("Predicates differ: " +
i_Left.Predicate.getStringValue() + " != " +
i_Right.Predicate.getStringValue());
return false;
}
if (!eq(i_Left.Object, i_Right.Object)) {
- log.println("Objects differ: " +
+ System.out.println("Objects differ: " +
i_Left.Object.getStringValue() + " != " +
i_Right.Object.getStringValue());
return false;
@@ -1105,7 +1083,7 @@ public class DocumentMetadataAccessTest extends ComplexTestCase
static boolean eq(Statement[] i_Result, Statement[] i_Expected)
{
if (i_Result.length != i_Expected.length) {
- log.println("eq: different lengths: " + i_Result.length + " " +
+ System.out.println("eq: different lengths: " + i_Result.length + " " +
i_Expected.length);
return false;
}
@@ -1113,8 +1091,13 @@ public class DocumentMetadataAccessTest extends ComplexTestCase
java.util.Arrays.asList(i_Expected).toArray();
java.util.Arrays.sort(i_Result, new StmtComp());
java.util.Arrays.sort(expected, new StmtComp());
- for (int i = 0; i < expected.length; ++i) {
- if (!eq(i_Result[i], expected[i])) return false;
+ for (int i = 0; i < expected.length; ++i)
+ {
+ // This is better for debug!
+ final Statement a = i_Result[i];
+ final Statement b = expected[i];
+ final boolean cond = eq(a, b);
+ if (!cond) return false;
}
return true;
}
@@ -1141,15 +1124,15 @@ public class DocumentMetadataAccessTest extends ComplexTestCase
static boolean eq(XQuerySelectResult i_Result,
String[] i_Vars, XNode[][] i_Bindings) throws Exception
{
- String[] vars = (String[]) i_Result.getBindingNames();
+ String[] vars = i_Result.getBindingNames();
XEnumeration iter = (XEnumeration) i_Result;
XNode[][] bindings = toSeqs(iter);
if (vars.length != i_Vars.length) {
- log.println("var lengths differ");
+ System.out.println("var lengths differ");
return false;
}
if (bindings.length != i_Bindings.length) {
- log.println("binding lengths differ: " + i_Bindings.length +
+ System.out.println("binding lengths differ: " + i_Bindings.length +
" vs " + bindings.length );
return false;
}
@@ -1157,16 +1140,16 @@ public class DocumentMetadataAccessTest extends ComplexTestCase
java.util.Arrays.sort(i_Bindings, new BindingComp());
for (int i = 0; i < i_Bindings.length; ++i) {
if (i_Bindings[i].length != i_Vars.length) {
- log.println("TEST ERROR!");
+ System.out.println("TEST ERROR!");
throw new Exception();
}
if (bindings[i].length != i_Vars.length) {
- log.println("binding length and var length differ");
+ System.out.println("binding length and var length differ");
return false;
}
for (int j = 0; j < i_Vars.length; ++j) {
if (!eq(bindings[i][j], i_Bindings[i][j])) {
- log.println("bindings differ: " +
+ System.out.println("bindings differ: " +
toS(bindings[i][j]) + " != " + toS(i_Bindings[i][j]));
return false;
}
@@ -1174,7 +1157,7 @@ public class DocumentMetadataAccessTest extends ComplexTestCase
}
for (int i = 0; i < i_Vars.length; ++i) {
if (!vars[i].equals(i_Vars[i])) {
- log.println("variable names differ: " +
+ System.out.println("variable names differ: " +
vars[i] + " != " + i_Vars[i]);
return false;
}
@@ -1253,17 +1236,27 @@ public class DocumentMetadataAccessTest extends ComplexTestCase
public String getLocalName() { return ""; }
public StringPair getMetadataReference()
- { return new StringPair(m_Stream, m_XmlId); }
+ {
+ return new StringPair(m_Stream, m_XmlId);
+ }
public void setMetadataReference(StringPair i_Ref)
throws IllegalArgumentException
- { m_Stream = (String)i_Ref.First; m_XmlId = (String)i_Ref.Second; }
+ {
+ m_Stream = i_Ref.First;
+ m_XmlId = i_Ref.Second;
+ }
public void ensureMetadataReference()
- { m_Stream = "content.xml"; m_XmlId = "42"; }
+ {
+ m_Stream = "content.xml";
+ m_XmlId = "42";
+ }
public String getImplementationName() { return null; }
public String[] getSupportedServiceNames() { return null; }
public boolean supportsService(String i_Svc)
- { return i_Svc.equals("com.sun.star.text.Paragraph"); }
+ {
+ return i_Svc.equals("com.sun.star.text.Paragraph");
+ }
public XText getText() { return null; }
public XTextRange getStart() { return null; }
@@ -1271,5 +1264,29 @@ public class DocumentMetadataAccessTest extends ComplexTestCase
public String getString() { return m_Text; }
public void setString(String i_Str) { m_Text = i_Str; }
}
+
+
+
+ private XMultiServiceFactory getMSF()
+ {
+ final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
+ return xMSF1;
+ }
+
+ // setup and close connections
+ @BeforeClass public static void setUpConnection() throws Exception {
+ System.out.println("setUpConnection()");
+ connection.setUp();
+ }
+
+ @AfterClass public static void tearDownConnection()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ System.out.println("tearDownConnection() DocumentMetadataAccessTest");
+ connection.tearDown();
+ }
+
+ private static final OfficeConnection connection = new OfficeConnection();
+
}
diff --git a/sfx2/qa/complex/DocumentMetaData.java b/sfx2/qa/complex/framework/DocumentPropertiesTest.java
index ae7970227c75..20a0746c8322 100644
--- a/sfx2/qa/complex/DocumentMetaData.java
+++ b/sfx2/qa/complex/framework/DocumentPropertiesTest.java
@@ -27,14 +27,11 @@
package complex.framework;
-import complexlib.ComplexTestCase;
-import helper.StreamSimulator;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;
-import com.sun.star.uno.Any;
import com.sun.star.lang.XInitialization;
-import com.sun.star.lang.XSingleServiceFactory;
+
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.lang.Locale;
import com.sun.star.lang.EventObject;
@@ -51,10 +48,16 @@ import com.sun.star.beans.NamedValue;
import com.sun.star.beans.PropertyAttribute;
import com.sun.star.beans.UnknownPropertyException;
import com.sun.star.beans.IllegalTypeException;
-import com.sun.star.embed.XStorage;
-import com.sun.star.io.XInputStream;
+
import com.sun.star.document.XDocumentProperties;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
/**
* Test case for the service com.sun.star.document.DocumentProperties.
@@ -63,13 +66,13 @@ import com.sun.star.document.XDocumentProperties;
*
* @author mst
*/
-public class DocumentMetaData extends ComplexTestCase
+public class DocumentPropertiesTest
{
- public String[] getTestMethodNames () {
- return new String[] { "check", "cleanup" };
- }
+// public String[] getTestMethodNames () {
+// return new String[] { "check", "cleanup" };
+// }
- public void cleanup() {
+ @After public void cleanup() {
// nothing to do
}
@@ -95,19 +98,18 @@ public class DocumentMetaData extends ComplexTestCase
}
}
- public void check() {
+ @Test public void check() {
try {
- XMultiServiceFactory xMSF = (XMultiServiceFactory) param.getMSF();
- assure("could not create MultiServiceFactory.", xMSF != null);
- XPropertySet xPropertySet = (XPropertySet)
- UnoRuntime.queryInterface(XPropertySet.class, xMSF);
+ XMultiServiceFactory xMSF = getMSF();
+ assertNotNull("could not create MultiServiceFactory.", xMSF);
+ XPropertySet xPropertySet = UnoRuntime.queryInterface(XPropertySet.class, xMSF);
Object defaultCtx = xPropertySet.getPropertyValue("DefaultContext");
- XComponentContext xContext = (XComponentContext)
- UnoRuntime.queryInterface(XComponentContext.class, defaultCtx);
- assure("could not get component context.", xContext != null);
+ XComponentContext xContext = UnoRuntime.queryInterface(XComponentContext.class, defaultCtx);
+ assertNotNull("could not get component context.", xContext);
+ // TODO: Path to temp
String temp = util.utils.getOfficeTemp/*Dir*/(xMSF);
- log.println("tempdir: " + temp);
+ System.out.println("tempdir: " + temp);
PropertyValue[] noArgs = { };
PropertyValue mimetype = new PropertyValue();
@@ -120,61 +122,56 @@ public class DocumentMetaData extends ComplexTestCase
cfile.Value = temp + "EMPTY.odt";
PropertyValue[] mimeEmptyArgs = { mimetype, cfile };
- log.println("Creating service DocumentProperties...");
+ System.out.println("Creating service DocumentProperties...");
Object oDP =
// xMSF.createInstanceWithContext(
// "com.sun.star.document.DocumentProperties", xContext);
xMSF.createInstance("com.sun.star.document.DocumentProperties");
- XDocumentProperties xDP = (XDocumentProperties)
- UnoRuntime.queryInterface(XDocumentProperties.class, oDP);
+ XDocumentProperties xDP = UnoRuntime.queryInterface(XDocumentProperties.class, oDP);
- log.println("...done");
+ System.out.println("...done");
- log.println("Checking initialize ...");
+ System.out.println("Checking initialize ...");
- XDocumentProperties xDP2 = (XDocumentProperties)
- UnoRuntime.queryInterface(XDocumentProperties.class,
- xMSF.createInstance(
- "com.sun.star.document.DocumentProperties"));
- XInitialization xInit = (XInitialization)
- UnoRuntime.queryInterface(XInitialization.class, xDP2);
+ XDocumentProperties xDP2 = UnoRuntime.queryInterface(XDocumentProperties.class, xMSF.createInstance("com.sun.star.document.DocumentProperties"));
+ XInitialization xInit = UnoRuntime.queryInterface(XInitialization.class, xDP2);
xInit.initialize(new Object[] { });
- log.println("...done");
+ System.out.println("...done");
- log.println("Checking storing default-initialized meta data ...");
+ System.out.println("Checking storing default-initialized meta data ...");
// xDP2.storeToMedium(temp + "EMPTY.odt", mimeArgs);
xDP2.storeToMedium("", mimeEmptyArgs);
- log.println("...done");
+ System.out.println("...done");
- log.println("Checking loading default-initialized meta data ...");
+ System.out.println("Checking loading default-initialized meta data ...");
// xDP2.loadFromMedium(temp + "EMPTY.odt", noArgs);
xDP2.loadFromMedium("", mimeEmptyArgs);
- assure ("Author", "".equals(xDP2.getAuthor()));
+ assertTrue ("Author", "".equals(xDP2.getAuthor()));
- log.println("...done");
+ System.out.println("...done");
- log.println("(Not) Checking preservation of custom meta data ...");
+ System.out.println("(Not) Checking preservation of custom meta data ...");
- xDP2.loadFromMedium(util.utils.getFullTestURL("CUSTOM.odt"),
+ xDP2.loadFromMedium(TestDocument.getUrl("CUSTOM.odt"),
noArgs);
- assure ("Author", "".equals(xDP2.getAuthor()));
+ assertTrue ("Author", "".equals(xDP2.getAuthor()));
xDP2.storeToMedium(temp + "CUSTOM.odt", mimeArgs);
//FIXME: now what? comparing for binary equality seems useless
// we could unzip the written file and grep for the custom stuff
// but would that work on windows...
- log.println("...done");
+ System.out.println("...done");
- log.println("Checking loading from test document...");
+ System.out.println("Checking loading from test document...");
- String file = util.utils.getFullTestURL("TEST.odt");
+ String file = TestDocument.getUrl("TEST.odt");
xDP.loadFromMedium(file, noArgs);
/* XInputStream xStream =
new StreamSimulator("./testdocuments/TEST.odt", true, param);
@@ -188,68 +185,68 @@ public class DocumentMetaData extends ComplexTestCase
XStorage.class, oStor);
xDP.loadFromStorage(xStor);*/
- log.println("...done");
+ System.out.println("...done");
- log.println("Checking meta-data import...");
+ System.out.println("Checking meta-data import...");
- assure ("Author", "Karl-Heinz Mustermann".equals(xDP.getAuthor()));
- assure ("Generator",
+ assertTrue("Author", "Karl-Heinz Mustermann".equals(xDP.getAuthor()));
+ assertTrue("Generator",
"StarOffice/8$Solaris_x86 OpenOffice.org_project/680m232$Build-9227"
.equals(xDP.getGenerator()));
- assure ("CreationDate", 2007 == xDP.getCreationDate().Year);
- assure ("Title", "Urgent Memo".equals(xDP.getTitle()));
- assure ("Subject", "Wichtige Mitteilung".equals(xDP.getSubject()));
- assure ("Description",
+ assertTrue("CreationDate", 2007 == xDP.getCreationDate().Year);
+ assertTrue("Title", "Urgent Memo".equals(xDP.getTitle()));
+ assertTrue("Subject", "Wichtige Mitteilung".equals(xDP.getSubject()));
+ assertTrue("Description",
"Modern internal company memorandum in full-blocked style"
.equals(xDP.getDescription()));
-// assure ("Language", "".equals(xDP.getLanguage()));
- assure ("ModifiedBy",
+// assertTrue("Language", "".equals(xDP.getLanguage()));
+ assertTrue("ModifiedBy",
"Karl-Heinz Mustermann".equals(xDP.getModifiedBy()));
- assure ("ModificationDate", 10 == xDP.getModificationDate().Month);
- assure ("PrintedBy",
+ assertTrue("ModificationDate", 10 == xDP.getModificationDate().Month);
+ assertTrue("PrintedBy",
"Karl-Heinz Mustermann".equals(xDP.getPrintedBy()));
- assure ("PrintDate", 29 == xDP.getPrintDate().Day);
- assure ("TemplateName",
+ assertTrue("PrintDate", 29 == xDP.getPrintDate().Day);
+ assertTrue("TemplateName",
"Modern Memo".equals(xDP.getTemplateName()));
- assure ("TemplateURL",
+ assertTrue("TemplateURL",
xDP.getTemplateURL().endsWith("memmodern.ott"));
- assure ("TemplateDate", 17 == xDP.getTemplateDate().Hours);
- assure ("AutoloadURL", "../TEST.odt".equals(xDP.getAutoloadURL()));
- assure ("AutoloadSecs", 0 == xDP.getAutoloadSecs());
- assure ("DefaultTarget", "_blank".equals(xDP.getDefaultTarget()));
- assure ("EditingCycles", 3 == xDP.getEditingCycles());
- assure ("EditingDuration", 320 == xDP.getEditingDuration());
+ assertTrue("TemplateDate", 17 == xDP.getTemplateDate().Hours);
+ assertTrue("AutoloadURL", "../TEST.odt".equals(xDP.getAutoloadURL()));
+ assertTrue("AutoloadSecs", 0 == xDP.getAutoloadSecs());
+ assertTrue("DefaultTarget", "_blank".equals(xDP.getDefaultTarget()));
+ assertTrue("EditingCycles", 3 == xDP.getEditingCycles());
+ assertTrue("EditingDuration", 320 == xDP.getEditingDuration());
String[] kws = xDP.getKeywords();
- assure ("Keywords", fromArray(kws).containsAll(
+ assertTrue("Keywords", fromArray(kws).containsAll(
fromArray(new Object[] { "Asien", "Memo", "Reis" })));
NamedValue[] ds = xDP.getDocumentStatistics();
/* for (int i = 0; i < ds.length; ++i) {
- log.println("nv: " + ds[i].Name + " " + ds[i].Value);
+ System.out.println("nv: " + ds[i].Name + " " + ds[i].Value);
}
NamedValue nv1 = new NamedValue("WordCount", new Integer(23));
NamedValue nv2 = new NamedValue("WordCount", new Integer(23));
- log.println("eq: " + nv1.equals(nv2)); // grrr, this is false...
+ System.out.println("eq: " + nv1.equals(nv2)); // grrr, this is false...
*/
- assure ("DocumentStatistics:WordCount", containsNV(ds,
+ assertTrue("DocumentStatistics:WordCount", containsNV(ds,
new NamedValue("WordCount", new Integer(23))));
- assure ("DocumentStatistics:PageCount", containsNV(ds,
+ assertTrue("DocumentStatistics:PageCount", containsNV(ds,
new NamedValue("PageCount", new Integer(1))));
XPropertyContainer udpc = xDP.getUserDefinedProperties();
XPropertySet udps = (XPropertySet) UnoRuntime.queryInterface(
XPropertySet.class, udpc);
- assure ("UserDefined 1", "Dies ist ein wichtiger Hinweis"
+ assertTrue("UserDefined 1", "Dies ist ein wichtiger Hinweis"
.equals(udps.getPropertyValue("Hinweis")));
- assure ("UserDefined 2", ("Kann Spuren von N"
+ assertTrue("UserDefined 2", ("Kann Spuren von N"
+ new String(new byte[] { (byte) 0xc3, (byte) 0xbc }, "UTF-8")
+ "ssen enthalten")
.equals(udps.getPropertyValue("Warnung")));
- log.println("...done");
+ System.out.println("...done");
- log.println("Checking meta-data updates...");
+ System.out.println("Checking meta-data updates...");
String str;
DateTime dt = new DateTime();
@@ -258,75 +255,75 @@ public class DocumentMetaData extends ComplexTestCase
str = "me";
xDP.setAuthor(str);
- assure ("setAuthor", str.equals(xDP.getAuthor()));
+ assertTrue("setAuthor", str.equals(xDP.getAuthor()));
str = "the computa";
xDP.setGenerator(str);
- assure ("setGenerator", str.equals(xDP.getGenerator()));
+ assertTrue("setGenerator", str.equals(xDP.getGenerator()));
dt.Year = 2038;
dt.Month = 1;
dt.Day = 1;
xDP.setCreationDate(dt);
- assure ("setCreationDate", dt.Year == xDP.getCreationDate().Year);
+ assertTrue("setCreationDate", dt.Year == xDP.getCreationDate().Year);
str = "El t'itulo";
xDP.setTitle(str);
- assure ("setTitle", str.equals(xDP.getTitle()));
+ assertTrue("setTitle", str.equals(xDP.getTitle()));
str = "Ein verkommenes Subjekt";
xDP.setSubject(str);
- assure ("setSubject", str.equals(xDP.getSubject()));
+ assertTrue("setSubject", str.equals(xDP.getSubject()));
str = "Este descripci'on no es importante";
xDP.setDescription(str);
- assure ("setDescription", str.equals(xDP.getDescription()));
+ assertTrue("setDescription", str.equals(xDP.getDescription()));
l.Language = "en";
l.Country = "GB";
xDP.setLanguage(l);
Locale l2 = xDP.getLanguage();
- assure ("setLanguage Lang", l.Language.equals(l2.Language));
- assure ("setLanguage Cty", l.Country.equals(l2.Country));
+ assertTrue("setLanguage Lang", l.Language.equals(l2.Language));
+ assertTrue("setLanguage Cty", l.Country.equals(l2.Country));
str = "myself";
xDP.setModifiedBy(str);
- assure ("setModifiedBy", str.equals(xDP.getModifiedBy()));
+ assertTrue("setModifiedBy", str.equals(xDP.getModifiedBy()));
dt.Year = 2042;
xDP.setModificationDate(dt);
- assure ("setModificationDate",
+ assertTrue("setModificationDate",
dt.Year == xDP.getModificationDate().Year);
str = "i didnt do it";
xDP.setPrintedBy(str);
- assure ("setPrintedBy", str.equals(xDP.getPrintedBy()));
+ assertTrue("setPrintedBy", str.equals(xDP.getPrintedBy()));
dt.Year = 2024;
xDP.setPrintDate(dt);
- assure ("setPrintDate", dt.Year == xDP.getPrintDate().Year);
+ assertTrue("setPrintDate", dt.Year == xDP.getPrintDate().Year);
str = "blah";
xDP.setTemplateName(str);
- assure ("setTemplateName", str.equals(xDP.getTemplateName()));
+ assertTrue("setTemplateName", str.equals(xDP.getTemplateName()));
str = "gopher://some-hole-in-the-ground/";
xDP.setTemplateURL(str);
- assure ("setTemplateURL", str.equals(xDP.getTemplateURL()));
+ assertTrue("setTemplateURL", str.equals(xDP.getTemplateURL()));
dt.Year = 2043;
xDP.setTemplateDate(dt);
- assure ("setTemplateDate", dt.Year == xDP.getTemplateDate().Year);
+ assertTrue("setTemplateDate", dt.Year == xDP.getTemplateDate().Year);
str = "http://nowhere/";
xDP.setAutoloadURL(str);
- assure ("setAutoloadURL", str.equals(xDP.getAutoloadURL()));
+ assertTrue("setAutoloadURL", str.equals(xDP.getAutoloadURL()));
i = 3661; // this might not work (due to conversion via double...)
xDP.setAutoloadSecs(i);
-// log.println("set: " + i + " get: " + xDP.getAutoloadSecs());
- assure ("setAutoloadSecs", i == xDP.getAutoloadSecs());
+// System.out.println("set: " + i + " get: " + xDP.getAutoloadSecs());
+ assertTrue("setAutoloadSecs", i == xDP.getAutoloadSecs());
str = "_blank";
xDP.setDefaultTarget(str);
- assure ("setDefaultTarget", str.equals(xDP.getDefaultTarget()));
+ assertTrue("setDefaultTarget", str.equals(xDP.getDefaultTarget()));
i = 42;
xDP.setEditingCycles((short) i);
- assure ("setEditingCycles", i == xDP.getEditingCycles());
+ assertTrue("setEditingCycles", i == xDP.getEditingCycles());
i = 84;
xDP.setEditingDuration(i);
- assure ("setEditingDuration", i == xDP.getEditingDuration());
+ assertTrue("setEditingDuration", i == xDP.getEditingDuration());
str = "";
String[] kws2 = new String[] {
"keywordly", "keywordlike", "keywordalicious" };
xDP.setKeywords(kws2);
kws = xDP.getKeywords();
- assure ("setKeywords", fromArray(kws).containsAll(fromArray(kws2)));
+ assertTrue("setKeywords", fromArray(kws).containsAll(fromArray(kws2)));
NamedValue[] ds2 = new NamedValue[] {
new NamedValue("SyllableCount", new Integer(9)),
@@ -334,16 +331,16 @@ public class DocumentMetaData extends ComplexTestCase
new NamedValue("SentenceCount", new Integer(7)) };
xDP.setDocumentStatistics(ds2);
ds = xDP.getDocumentStatistics();
- assure ("setDocumentStatistics:SyllableCount", containsNV(ds,
+ assertTrue("setDocumentStatistics:SyllableCount", containsNV(ds,
new NamedValue("SyllableCount", new Integer(9))));
- assure ("setDocumentStatistics:FrameCount", containsNV(ds,
+ assertTrue("setDocumentStatistics:FrameCount", containsNV(ds,
new NamedValue("FrameCount", new Integer(2))));
- assure ("setDocumentStatistics:SentenceCount", containsNV(ds,
+ assertTrue("setDocumentStatistics:SentenceCount", containsNV(ds,
new NamedValue("SentenceCount", new Integer(7))));
- log.println("...done");
+ System.out.println("...done");
- log.println("Checking user-defined meta-data updates...");
+ System.out.println("Checking user-defined meta-data updates...");
// actually, this tests the PropertyBag service
// but maybe the DocumentProperties service will be implemented
@@ -384,109 +381,108 @@ public class DocumentMetaData extends ComplexTestCase
udpc.removeProperty("Info 1");
udpc.removeProperty("Removed");
} catch (UnknownPropertyException e) {
- assure("removeProperty failed", false);
+ fail("removeProperty failed");
}
try {
udpc.addProperty("Forbidden", PropertyAttribute.REMOVEABLE,
new String[] { "foo", "bar" });
- assure("inserting value of non-supported type did not fail",
- false);
+ fail("inserting value of non-supported type did not fail");
} catch (IllegalTypeException e) {
// ignore
}
- assure ("UserDefined bool", new Boolean(b).equals(
+ assertTrue("UserDefined bool", new Boolean(b).equals(
udps.getPropertyValue("Frobnicate")));
- assure ("UserDefined duration", eqDuration(dur, (Duration)
+ assertTrue("UserDefined duration", eqDuration(dur, (Duration)
udps.getPropertyValue("FrobDuration")));
- assure ("UserDefined time", eqTime(t, (Time)
+ assertTrue("UserDefined time", eqTime(t, (Time)
udps.getPropertyValue("FrobDuration2")));
- assure ("UserDefined date", eqDate(date, (Date)
+ assertTrue("UserDefined date", eqDate(date, (Date)
udps.getPropertyValue("FrobEndDate")));
- assure ("UserDefined datetime", eqDateTime(dt, (DateTime)
+ assertTrue("UserDefined datetime", eqDateTime(dt, (DateTime)
udps.getPropertyValue("FrobStartTime")));
- assure ("UserDefined float", new Double(d).equals(
+ assertTrue("UserDefined float", new Double(d).equals(
udps.getPropertyValue("Pi")));
- assure ("UserDefined string", "bar".equals(
+ assertTrue("UserDefined string", "bar".equals(
udps.getPropertyValue("Foo")));
- assure ("UserDefined empty name", "eeeeek".equals(
+ assertTrue("UserDefined empty name", "eeeeek".equals(
udps.getPropertyValue("")));
try {
udps.getPropertyValue("Removed");
- assure("UserDefined remove didn't", false);
+ fail("UserDefined remove didn't");
} catch (UnknownPropertyException e) {
// ok
}
- log.println("...done");
+ System.out.println("...done");
- log.println("Checking storing meta-data to file...");
+ System.out.println("Checking storing meta-data to file...");
xDP.storeToMedium(temp + "TEST.odt", mimeArgs);
- log.println("...done");
+ System.out.println("...done");
- log.println("Checking loading meta-data from stored file...");
+ System.out.println("Checking loading meta-data from stored file...");
xDP.loadFromMedium(temp + "TEST.odt", noArgs);
- log.println("...done");
+ System.out.println("...done");
- log.println("Checking user-defined meta-data from stored file...");
+ System.out.println("Checking user-defined meta-data from stored file...");
udpc = xDP.getUserDefinedProperties();
udps = (XPropertySet) UnoRuntime.queryInterface(
XPropertySet.class, udpc);
- assure ("UserDefined bool", new Boolean(b).equals(
+ assertTrue("UserDefined bool", new Boolean(b).equals(
udps.getPropertyValue("Frobnicate")));
- assure ("UserDefined duration", eqDuration(dur, (Duration)
+ assertTrue("UserDefined duration", eqDuration(dur, (Duration)
udps.getPropertyValue("FrobDuration")));
// this is now a Duration!
Duration t_dur = new Duration(false, (short)0, (short)0, (short)0,
t.Hours, t.Minutes, t.Seconds,
(short)(10 * t.HundredthSeconds));
- assure ("UserDefined time", eqDuration(t_dur, (Duration)
+ assertTrue("UserDefined time", eqDuration(t_dur, (Duration)
udps.getPropertyValue("FrobDuration2")));
- assure ("UserDefined date", eqDate(date, (Date)
+ assertTrue("UserDefined date", eqDate(date, (Date)
udps.getPropertyValue("FrobEndDate")));
- assure ("UserDefined datetime", eqDateTime(dt, (DateTime)
+ assertTrue("UserDefined datetime", eqDateTime(dt, (DateTime)
udps.getPropertyValue("FrobStartTime")));
- assure ("UserDefined float", new Double(d).equals(
+ assertTrue("UserDefined float", new Double(d).equals(
udps.getPropertyValue("Pi")));
- assure ("UserDefined string", "bar".equals(
+ assertTrue("UserDefined string", "bar".equals(
udps.getPropertyValue("Foo")));
try {
udps.getPropertyValue("Removed");
- assure("UserDefined remove didn't", false);
+ fail("UserDefined remove didn't");
} catch (UnknownPropertyException e) {
// ok
}
- log.println("...done");
+ System.out.println("...done");
- log.println("Checking notification listener interface...");
+ System.out.println("Checking notification listener interface...");
Listener listener = new Listener();
XModifyBroadcaster xMB = (XModifyBroadcaster)
UnoRuntime.queryInterface(XModifyBroadcaster.class, xDP);
xMB.addModifyListener(listener);
xDP.setAuthor("not me");
- assure ("Listener Author", listener.reset());
+ assertTrue("Listener Author", listener.reset());
udpc.addProperty("Listener", PropertyAttribute.REMOVEABLE, "foo");
- assure ("Listener UserDefined Add", listener.reset());
+ assertTrue("Listener UserDefined Add", listener.reset());
udps.setPropertyValue("Listener", "bar");
- assure ("Listener UserDefined Set", listener.reset());
+ assertTrue("Listener UserDefined Set", listener.reset());
udpc.removeProperty("Listener");
- assure ("Listener UserDefined Remove", listener.reset());
+ assertTrue("Listener UserDefined Remove", listener.reset());
xMB.removeModifyListener(listener);
udpc.addProperty("Listener2", PropertyAttribute.REMOVEABLE, "foo");
- assure ("Removed Listener UserDefined Add", !listener.reset());
+ assertTrue("Removed Listener UserDefined Add", !listener.reset());
- log.println("...done");
+ System.out.println("...done");
} catch (Exception e) {
report(e);
@@ -538,9 +534,32 @@ public class DocumentMetaData extends ComplexTestCase
}
public void report(Exception e) {
- log.println("Exception occurred:");
- e.printStackTrace((java.io.PrintWriter) log);
- failed();
+ System.out.println("Exception occurred:");
+ e.printStackTrace();
+ fail();
+ }
+
+
+ private XMultiServiceFactory getMSF()
+ {
+ final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
+ return xMSF1;
}
+
+ // setup and close connections
+ @BeforeClass public static void setUpConnection() throws Exception {
+ System.out.println("setUpConnection()");
+ connection.setUp();
+ }
+
+ @AfterClass public static void tearDownConnection()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ System.out.println("tearDownConnection() DocumentPropertiesTest");
+ connection.tearDown();
+ }
+
+ private static final OfficeConnection connection = new OfficeConnection();
+
}
diff --git a/sfx2/qa/complex/framework/TestDocument.java b/sfx2/qa/complex/framework/TestDocument.java
new file mode 100644
index 000000000000..8cc6ef7756b1
--- /dev/null
+++ b/sfx2/qa/complex/framework/TestDocument.java
@@ -0,0 +1,39 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+package complex.framework;
+
+import java.io.File;
+import org.openoffice.test.OfficeFileUrl;
+
+final class TestDocument {
+ public static String getUrl(String name) {
+ return OfficeFileUrl.getAbsolute(new File("testdocuments", name));
+ }
+
+ private TestDocument() {}
+}
diff --git a/sfx2/qa/complex/DocHelper/WriterHelper.java b/sfx2/qa/complex/framework/WriterHelper.java
index b65e8e915423..d3f19703bb9d 100644
--- a/sfx2/qa/complex/DocHelper/WriterHelper.java
+++ b/sfx2/qa/complex/framework/WriterHelper.java
@@ -73,19 +73,20 @@ public class WriterHelper {
* @return if an error occurs the errormessage is returned and an empty String if not
*/
public String closeDoc(XTextDocument xTextDoc) {
- XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
- XCloseable.class, xTextDoc);
+ XCloseable closer = UnoRuntime.queryInterface(XCloseable.class, xTextDoc);
String err = "";
try {
closer.close(true);
} catch (com.sun.star.util.CloseVetoException e) {
err = "couldn't close document " + e;
+ System.out.println(err);
}
return err;
}
+ private XTextDocument xLocalDoc = null;
/** a TextDocument is opened by pressing a button in a dialog given by uno-URL
* @param url the uno-URL of the dialog to be opened
* @param createButton the language dependend label of the button to be pressed
@@ -95,9 +96,8 @@ public class WriterHelper {
*/
public XTextDocument openFromDialog(String url, String createButton,
boolean destroyLocal) {
- XTextDocument xLocalDoc = WriterTools.createTextDoc(m_xMSF);
- XComponent comp = (XComponent) UnoRuntime.queryInterface(
- XComponent.class, xLocalDoc);
+ xLocalDoc = WriterTools.createTextDoc(m_xMSF);
+ XComponent comp = UnoRuntime.queryInterface(XComponent.class, xLocalDoc);
DialogThread diagThread = new DialogThread(comp, m_xMSF, url);
diagThread.start();
shortWait();
@@ -107,8 +107,7 @@ public class WriterHelper {
AccessibilityTools at = new AccessibilityTools();
Object atw = tk.getActiveTopWindow();
- XWindow xWindow = (XWindow) UnoRuntime.queryInterface(
- XWindow.class, atw);
+ XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, atw);
XAccessible xRoot = at.getAccessibleObject(xWindow);
XAccessibleContext buttonContext = at.getAccessibleObjectForRole(
@@ -116,9 +115,7 @@ public class WriterHelper {
AccessibleRole.PUSH_BUTTON,
createButton);
- XAccessibleAction buttonAction = (XAccessibleAction) UnoRuntime.queryInterface(
- XAccessibleAction.class,
- buttonContext);
+ XAccessibleAction buttonAction = UnoRuntime.queryInterface(XAccessibleAction.class, buttonContext);
try {
System.out.println("Name: " +
@@ -133,16 +130,26 @@ public class WriterHelper {
XDesktop xDesktop = getDesktop();
- XTextDocument returnDoc = (XTextDocument) UnoRuntime.queryInterface(
- XTextDocument.class,
- xDesktop.getCurrentComponent());
+ XTextDocument returnDoc = UnoRuntime.queryInterface(XTextDocument.class, xDesktop.getCurrentComponent());
if (destroyLocal) {
closeDoc(xLocalDoc);
+ xLocalDoc = null;
}
return returnDoc;
}
+ public void closeFromDialog()
+ {
+ closeDoc(xLocalDoc);
+ xLocalDoc = null;
+ }
+ public void kill()
+ {
+ XDesktop xDesktop = getDesktop();
+ xDesktop.terminate();
+ }
+
public XTextDocument DocByAutopilot(XMultiServiceFactory msf,
int[] indexes, boolean destroyLocal,
@@ -156,8 +163,7 @@ public class WriterHelper {
e.printStackTrace();
}
- XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
- XExtendedToolkit.class, toolkit);
+ XExtendedToolkit tk = UnoRuntime.queryInterface(XExtendedToolkit.class, toolkit);
shortWait();
@@ -165,15 +171,13 @@ public class WriterHelper {
Object atw = tk.getActiveTopWindow();
- XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
- atw);
+ XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, atw);
XAccessible xRoot = at.getAccessibleObject(xWindow);
XAccessibleContext ARoot = at.getAccessibleObjectForRole(xRoot,
AccessibleRole.MENU_BAR);
- XAccessibleSelection sel = (XAccessibleSelection) UnoRuntime.queryInterface(
- XAccessibleSelection.class, ARoot);
+ XAccessibleSelection sel = UnoRuntime.queryInterface(XAccessibleSelection.class, ARoot);
for (int k = 0; k < indexes.length; k++) {
try {
@@ -181,8 +185,7 @@ public class WriterHelper {
shortWait();
ARoot = ARoot.getAccessibleChild(indexes[k])
.getAccessibleContext();
- sel = (XAccessibleSelection) UnoRuntime.queryInterface(
- XAccessibleSelection.class, ARoot);
+ sel = UnoRuntime.queryInterface(XAccessibleSelection.class, ARoot);
} catch (com.sun.star.lang.IndexOutOfBoundsException e) {
}
}
@@ -191,17 +194,13 @@ public class WriterHelper {
atw = tk.getActiveTopWindow();
- xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, atw);
+ xWindow = UnoRuntime.queryInterface(XWindow.class, atw);
xRoot = at.getAccessibleObject(xWindow);
//at.printAccessibleTree(new PrintWriter(System.out),xRoot);
- XAccessibleAction action = (XAccessibleAction) UnoRuntime.queryInterface(
- XAccessibleAction.class,
- at.getAccessibleObjectForRole(xRoot,
- AccessibleRole.PUSH_BUTTON,
- bName));
+ XAccessibleAction action = UnoRuntime.queryInterface(XAccessibleAction.class, at.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON, bName));
try {
action.doAccessibleAction(0);
@@ -212,17 +211,13 @@ public class WriterHelper {
atw = tk.getActiveTopWindow();
- xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, atw);
+ xWindow = UnoRuntime.queryInterface(XWindow.class, atw);
xRoot = at.getAccessibleObject(xWindow);
at.printAccessibleTree(new PrintWriter(System.out),xRoot);
- action = (XAccessibleAction) UnoRuntime.queryInterface(
- XAccessibleAction.class,
- at.getAccessibleObjectForRole(xRoot,
- AccessibleRole.PUSH_BUTTON,
- "Yes"));
+ action = UnoRuntime.queryInterface(XAccessibleAction.class, at.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON, "Yes"));
try {
if (action != null) action.doAccessibleAction(0);
@@ -233,9 +228,7 @@ public class WriterHelper {
XDesktop xDesktop = getDesktop();
- XTextDocument returnDoc = (XTextDocument) UnoRuntime.queryInterface(
- XTextDocument.class,
- xDesktop.getCurrentComponent());
+ XTextDocument returnDoc = UnoRuntime.queryInterface(XTextDocument.class, xDesktop.getCurrentComponent());
if (destroyLocal) {
closeDoc(xLocalDoc);
@@ -269,8 +262,7 @@ public class WriterHelper {
e.printStackTrace();
}
- XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
- XExtendedToolkit.class, toolkit);
+ XExtendedToolkit tk = UnoRuntime.queryInterface(XExtendedToolkit.class, toolkit);
return tk;
}
@@ -288,8 +280,7 @@ public class WriterHelper {
e.printStackTrace();
}
- XDesktop xDesktop = (XDesktop) UnoRuntime.queryInterface(
- XDesktop.class, desk);
+ XDesktop xDesktop = UnoRuntime.queryInterface(XDesktop.class, desk);
return xDesktop;
}
diff --git a/sfx2/qa/complex/makefile.mk b/sfx2/qa/complex/framework/makefile.mk
index b8bc897fccf7..325135b9133c 100644
--- a/sfx2/qa/complex/makefile.mk
+++ b/sfx2/qa/complex/framework/makefile.mk
@@ -25,37 +25,41 @@
#
#*************************************************************************
-PRJ = ..$/..
-TARGET = CheckGlobalEventBroadcaster_writer1
-PRJNAME = $(TARGET)
-PACKAGE = complex$/framework
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
-# --- Settings -----------------------------------------------------
-.INCLUDE: settings.mk
+PRJ = ../../..
+PRJNAME = sfx2
+TARGET = qa_complex_framework
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = complex/framework
+JAVATESTFILES = \
+ DocumentPropertiesTest.java \
+ DocumentMetadataAccessTest.java \
+ CheckGlobalEventBroadcaster_writer1.java
-#----- compile .java files -----------------------------------------
+JAVAFILES = $(JAVATESTFILES) \
+ TestDocument.java \
+ WriterHelper.java \
+ DialogThread.java
-JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
-JAVAFILES = CheckGlobalEventBroadcaster_writer1.java \
- DocumentMetaData.java \
- DocumentMetadataAccessTest.java
-JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
+JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
-SUBDIRS = DocHelper
-#----- make a jar from compiled files ------------------------------
+# Sample how to debug
+# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y
-MAXLINELENGTH = 100000
+.END
-JARCLASSDIRS = $(PACKAGE)
-JARTARGET = $(TARGET).jar
-JARCOMPRESS = TRUE
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
-# --- Targets ------------------------------------------------------
+ALLTAR : javatest
-.INCLUDE : target.mk
+.END
-run:
- +java -cp $(CLASSPATH) org.openoffice.Runner -TestBase java_complex -sce tests.sce -tdoc $(PWD)$/testdocuments
diff --git a/sfx2/qa/complex/testdocuments/CUSTOM.odt b/sfx2/qa/complex/framework/testdocuments/CUSTOM.odt
index 831a8f451dfd..831a8f451dfd 100644
--- a/sfx2/qa/complex/testdocuments/CUSTOM.odt
+++ b/sfx2/qa/complex/framework/testdocuments/CUSTOM.odt
Binary files differ
diff --git a/sfx2/qa/complex/testdocuments/TEST.odt b/sfx2/qa/complex/framework/testdocuments/TEST.odt
index 7c6f0b60f7b0..7c6f0b60f7b0 100644
--- a/sfx2/qa/complex/testdocuments/TEST.odt
+++ b/sfx2/qa/complex/framework/testdocuments/TEST.odt
Binary files differ
diff --git a/sfx2/qa/complex/testdocuments/TESTRDFA.odt b/sfx2/qa/complex/framework/testdocuments/TESTRDFA.odt
index d59739142df6..d59739142df6 100644
--- a/sfx2/qa/complex/testdocuments/TESTRDFA.odt
+++ b/sfx2/qa/complex/framework/testdocuments/TESTRDFA.odt
Binary files differ
diff --git a/sfx2/qa/complex/framework/testdocuments/empty.rdf b/sfx2/qa/complex/framework/testdocuments/empty.rdf
new file mode 100644
index 000000000000..af62bab39dfa
--- /dev/null
+++ b/sfx2/qa/complex/framework/testdocuments/empty.rdf
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+
+<RDF
+ xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:s="http://www.w3.org/2000/01/rdf-schema#">
+
+<!--
+ This is the RDF Schema for the RDF data model as described in the
+ Resource Description Framework (RDF) Model and Syntax Specification
+ http://www.w3.org/TR/REC-rdf-syntax -->
+
+</RDF>
diff --git a/sfx2/qa/complex/standalonedocumentinfo/StandaloneDocumentInfoUnitTest.java b/sfx2/qa/complex/standalonedocumentinfo/StandaloneDocumentInfoUnitTest.java
index 0136f8941df5..29fcaba8cb7a 100644
--- a/sfx2/qa/complex/standalonedocumentinfo/StandaloneDocumentInfoUnitTest.java
+++ b/sfx2/qa/complex/standalonedocumentinfo/StandaloneDocumentInfoUnitTest.java
@@ -26,44 +26,76 @@
************************************************************************/
package complex.standalonedocumentinfo;
-import complexlib.ComplexTestCase;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.UnoRuntime;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
+
/* Document here
*/
-public class StandaloneDocumentInfoUnitTest extends ComplexTestCase {
+public class StandaloneDocumentInfoUnitTest {
private XMultiServiceFactory m_xMSF = null;
- public String[] getTestMethodNames() {
- return new String[] {
- "ExecuteTest01"};
- }
+// public String[] getTestMethodNames() {
+// return new String[] {
+// "ExecuteTest01"};
+// }
- public String[] getTestObjectNames() {
- return new String[] {"StandaloneDocumentInfoUnitTest"};
- }
+// public String[] getTestObjectNames() {
+// return new String[] {"StandaloneDocumentInfoUnitTest"};
+// }
- public void before() {
+ @Before public void before() {
try {
- m_xMSF = (XMultiServiceFactory)param.getMSF();
+ m_xMSF = getMSF();
} catch(Exception e) {
- failed( "Failed to create service factory!" );
+ fail( "Failed to create service factory!" );
}
if( m_xMSF ==null ) {
- failed( "Failed to create service factory!" );
+ fail( "Failed to create service factory!" );
}
}
- public void after() {
+ @After public void after() {
m_xMSF = null;
}
- public void ExecuteTest01() {
- StandaloneDocumentInfoTest aTest = new Test01 (m_xMSF, log);
- assure( "Test01 failed!", aTest.test() );
+ @Test public void ExecuteTest01() {
+ StandaloneDocumentInfoTest aTest = new Test01 (m_xMSF);
+ assertTrue( "Test01 failed!", aTest.test() );
+ }
+
+
+
+
+ private XMultiServiceFactory getMSF()
+ {
+ final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
+ return xMSF1;
+ }
+
+ // setup and close connections
+ @BeforeClass public static void setUpConnection() throws Exception {
+ System.out.println("setUpConnection()");
+ connection.setUp();
}
+
+ @AfterClass public static void tearDownConnection()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ System.out.println("tearDownConnection()");
+ connection.tearDown();
+ }
+
+ private static final OfficeConnection connection = new OfficeConnection();
+
}
diff --git a/sfx2/qa/complex/standalonedocumentinfo/Test01.java b/sfx2/qa/complex/standalonedocumentinfo/Test01.java
index 92c59d81e1c4..2f9a6266b4e2 100644
--- a/sfx2/qa/complex/standalonedocumentinfo/Test01.java
+++ b/sfx2/qa/complex/standalonedocumentinfo/Test01.java
@@ -26,14 +26,6 @@
************************************************************************/
package complex.standalonedocumentinfo;
-import com.sun.star.beans.Property;
-import com.sun.star.beans.XProperty;
-import com.sun.star.beans.XPropertySetInfo;
-import com.sun.star.io.IOException;
-import com.sun.star.io.XInputStream;
-import com.sun.star.io.XOutputStream;
-import complexlib.ComplexTestCase;
-
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.document.XStandaloneDocumentInfo;
import com.sun.star.io.XTempFile;
@@ -43,19 +35,15 @@ import com.sun.star.beans.PropertyValue;
import com.sun.star.beans.XPropertySet;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.AnyConverter;
-import com.sun.star.task.ErrorCodeIOException;
-import java.util.Properties;
-import java.util.Random;
-import share.LogWriter;
public class Test01 implements StandaloneDocumentInfoTest {
XMultiServiceFactory m_xMSF = null;
TestHelper m_aTestHelper = null;
- public Test01 ( XMultiServiceFactory xMSF, LogWriter aLogWriter ) {
+ public Test01 ( XMultiServiceFactory xMSF ) {
m_xMSF = xMSF;
- m_aTestHelper = new TestHelper( aLogWriter, "Test01: " );
+ m_aTestHelper = new TestHelper( "Test01: " );
}
public boolean test() {
@@ -71,19 +59,16 @@ public class Test01 implements StandaloneDocumentInfoTest {
m_aTestHelper.Message ( "==============================" );
//create a new temporary file
Object oTempFile = m_xMSF.createInstance ( "com.sun.star.io.TempFile" );
- XTempFile xTempFile = (XTempFile) UnoRuntime.queryInterface (
- XTempFile.class, oTempFile );
+ XTempFile xTempFile = UnoRuntime.queryInterface(XTempFile.class, oTempFile);
//create a text document and initiallize it
Object oTextDocument = m_xMSF.createInstance ( "com.sun.star.text.TextDocument" );
- XLoadable xLoadable = (XLoadable) UnoRuntime.queryInterface (
- XLoadable.class, oTextDocument );
+ XLoadable xLoadable = UnoRuntime.queryInterface(XLoadable.class, oTextDocument);
xLoadable.initNew();
m_aTestHelper.Message ( "New document initialized." );
//store the instance to the temporary file URL
- XStorable xStorable = (XStorable) UnoRuntime.queryInterface (
- XStorable.class, oTextDocument );
+ XStorable xStorable = UnoRuntime.queryInterface(XStorable.class, oTextDocument);
String sURL = AnyConverter.toString ( xTempFile.getUri () );
PropertyValue aProps[] = new PropertyValue[2];
aProps[0] = new PropertyValue();
@@ -101,15 +86,13 @@ public class Test01 implements StandaloneDocumentInfoTest {
Object oStandaloneDocInfo = m_xMSF.createInstance (
"com.sun.star.document.StandaloneDocumentInfo" );
XStandaloneDocumentInfo xStandaloneDocInfo =
- (XStandaloneDocumentInfo) UnoRuntime.queryInterface (
- XStandaloneDocumentInfo.class, oStandaloneDocInfo );
+ UnoRuntime.queryInterface(XStandaloneDocumentInfo.class, oStandaloneDocInfo);
xStandaloneDocInfo.loadFromURL ( sURL );
m_aTestHelper.Message ( "StandaloneDocumentInfo loaded." );
//get the title from the object and check it
XPropertySet xPropSet =
- (XPropertySet)UnoRuntime.queryInterface (
- XPropertySet.class, oStandaloneDocInfo );
+ UnoRuntime.queryInterface(XPropertySet.class, oStandaloneDocInfo);
String sTitle = xPropSet.getPropertyValue ( "Title" ).toString ();
m_aTestHelper.Message ( "Get title: " + sTitle );
if ( sTitle.compareTo ( sDocTitle[i] ) != 0 ) {
@@ -134,14 +117,12 @@ public class Test01 implements StandaloneDocumentInfoTest {
Object oStandaloneDocInfo_ = m_xMSF.createInstance (
"com.sun.star.document.StandaloneDocumentInfo" );
XStandaloneDocumentInfo xStandaloneDocInfo_ =
- (XStandaloneDocumentInfo)UnoRuntime.queryInterface (
- XStandaloneDocumentInfo.class, oStandaloneDocInfo_ );
+ UnoRuntime.queryInterface(XStandaloneDocumentInfo.class, oStandaloneDocInfo_);
xStandaloneDocInfo_.loadFromURL ( sURL );
m_aTestHelper.Message ( "New StandaloneDocumentInfo loaded." );
//get the title and check it
- XPropertySet xPropSet_ = (XPropertySet)UnoRuntime.queryInterface (
- XPropertySet.class, oStandaloneDocInfo_ );
+ XPropertySet xPropSet_ = UnoRuntime.queryInterface(XPropertySet.class, oStandaloneDocInfo_);
String sTitle_ = xPropSet_.getPropertyValue ( "Title" ).toString ();
m_aTestHelper.Message ( "Get new title: " + sTitle_ );
if ( sTitle_.compareTo ( sTitle ) != 0 ) {
diff --git a/sfx2/qa/complex/standalonedocumentinfo/TestHelper.java b/sfx2/qa/complex/standalonedocumentinfo/TestHelper.java
index f319fe412227..f6d63e1b7793 100644
--- a/sfx2/qa/complex/standalonedocumentinfo/TestHelper.java
+++ b/sfx2/qa/complex/standalonedocumentinfo/TestHelper.java
@@ -26,23 +26,23 @@
************************************************************************/
package complex.standalonedocumentinfo;
-import share.LogWriter;
public class TestHelper {
- LogWriter m_aLogWriter;
+
String m_sTestPrefix;
- /** Creates a new instance of TestHelper */
- public TestHelper ( LogWriter aLogWriter, String sTestPrefix ) {
- m_aLogWriter = aLogWriter;
+ /** Creates a new instance of TestHelper
+ * @param sTestPrefix
+ */
+ public TestHelper ( String sTestPrefix ) {
m_sTestPrefix = sTestPrefix;
}
public void Error ( String sError ) {
- m_aLogWriter.println ( m_sTestPrefix + "Error: " + sError );
+ System.out.println ( m_sTestPrefix + "Error: " + sError );
}
public void Message ( String sMessage ) {
- m_aLogWriter.println ( m_sTestPrefix + sMessage );
+ System.out.println ( m_sTestPrefix + sMessage );
}
}
diff --git a/sfx2/qa/complex/standalonedocumentinfo/makefile.mk b/sfx2/qa/complex/standalonedocumentinfo/makefile.mk
index c65556aeb763..aade48dbd789 100644
--- a/sfx2/qa/complex/standalonedocumentinfo/makefile.mk
+++ b/sfx2/qa/complex/standalonedocumentinfo/makefile.mk
@@ -25,61 +25,32 @@
#
#*************************************************************************
-PRJ = ..$/..$/..
-TARGET = StandaloneDocumentInfoUnitTest
-PRJNAME = binfilter
-PACKAGE = complex$/standalonedocumentinfo
-
-# --- Settings -----------------------------------------------------
-.INCLUDE: settings.mk
-
-
-#----- compile .java files -----------------------------------------
-
-JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
-
-JAVAFILES =\
- StandaloneDocumentInfoUnitTest.java\
- StandaloneDocumentInfoTest.java\
- Test01.java\
- TestHelper.java\
-
-JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
-
-#----- make a jar from compiled files ------------------------------
-
-MAXLINELENGTH = 100000
-
-JARCLASSDIRS = $(PACKAGE)
-JARTARGET = $(TARGET).jar
-JARCOMPRESS = TRUE
-
-# --- Parameters for the test --------------------------------------
-
-# start an office if the parameter is set for the makefile
-.IF "$(OFFICE)" == ""
-CT_APPEXECCOMMAND =
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
.ELSE
-CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;"
-.ENDIF
-# test base is java complex
-CT_TESTBASE = -TestBase java_complex
+PRJ = ../../..
+PRJNAME = sfx2
+TARGET = qa_complex_standalonedocumentinfo
-# test looks something like the.full.package.TestName
-CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b)
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = complex/standalonedocumentinfo
+JAVATESTFILES = \
+ StandaloneDocumentInfoUnitTest.java
-# start the runner application
-CT_APP = org.openoffice.Runner
+JAVAFILES = $(JAVATESTFILES) \
+ StandaloneDocumentInfoTest.java \
+ Test01.java \
+ TestHelper.java
-# --- Targets ------------------------------------------------------
+JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
+.INCLUDE: settings.mk
.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
-RUN: run
-
-run:
- +java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_TEST)
-
-
+ALLTAR : javatest
+.END
diff --git a/sfx2/qa/cppunit/makefile.mk b/sfx2/qa/cppunit/makefile.mk
index 2794c2ae92bb..dce0b86a0619 100644
--- a/sfx2/qa/cppunit/makefile.mk
+++ b/sfx2/qa/cppunit/makefile.mk
@@ -35,6 +35,13 @@ ENABLE_EXCEPTIONS=TRUE
.INCLUDE : settings.mk
+#building with stlport, but cppunit was not built with stlport
+.IF "$(USE_SYSTEM_STL)"!="YES"
+.IF "$(SYSTEM_CPPUNIT)"=="YES"
+CFLAGSCXX+=-DADAPT_EXT_STL
+.ENDIF
+.ENDIF
+
CFLAGSCXX += $(CPPUNIT_CFLAGS)
DLLPRE = # no leading "lib" on .so files
diff --git a/sfx2/qa/cppunit/test_metadatable.cxx b/sfx2/qa/cppunit/test_metadatable.cxx
index 903be6920327..6a0be13a9c53 100644
--- a/sfx2/qa/cppunit/test_metadatable.cxx
+++ b/sfx2/qa/cppunit/test_metadatable.cxx
@@ -27,10 +27,12 @@
#include "precompiled_sfx2.hxx"
+#include "preextstl.h"
#include <cppunit/TestAssert.h>
#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/plugin/TestPlugIn.h>
+#include "postextstl.h"
#include <rtl/ustrbuf.hxx>
diff --git a/sfx2/qa/unoapi/sfx.sce b/sfx2/qa/unoapi/sfx.sce
index 6176c0668731..ce72c463ee55 100644
--- a/sfx2/qa/unoapi/sfx.sce
+++ b/sfx2/qa/unoapi/sfx.sce
@@ -1,5 +1,5 @@
-o sfx.AppDispatchProvider
--o sfx.DocumentTemplates
+#i113306 -o sfx.DocumentTemplates
-o sfx.FrameLoader
-o sfx.SfxMacroLoader
#i111283 -o sfx.StandaloneDocumentInfo
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index e4e43c51052f..40d35ab4d702 100644
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -3594,6 +3594,34 @@ SfxVoidItem MacroOrganizer SID_MACROORGANIZER
]
//--------------------------------------------------------------------------
+SfxBoolItem ReccomendReadonly SID_RECOMMENDREADONLY
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Synchron;
+
+ Readonly = TRUE,
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+
+//--------------------------------------------------------------------------
SfxVoidItem RunMacro SID_RUNMACRO
()
[
@@ -6383,7 +6411,7 @@ SfxBoolItem TaskBarVisible SID_TASKBAR
]
//--------------------------------------------------------------------------
-SfxTemplateItem TemplateFamily5 SID_STYLE_FAMILY5
+SfxTemplateItem ListStyle SID_STYLE_FAMILY5
[
/* flags: */
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index 6e13894feb49..7e4e9921573a 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -129,7 +129,7 @@
#include <sfx2/mnuitem.hxx>
#endif
-#if defined( WIN ) || defined( WNT ) || defined( OS2 )
+#if defined( WNT ) || defined( OS2 )
#define DDE_AVAILABLE
#endif
diff --git a/sfx2/source/appl/app.src b/sfx2/source/appl/app.src
index 0858e66e7347..47750cd73f78 100644
--- a/sfx2/source/appl/app.src
+++ b/sfx2/source/appl/app.src
@@ -626,169 +626,6 @@ String RID_ENVTOOLBOX
Text [ en-US ] = "Function Bar" ;
};
-ToolBox RID_ENVTOOLBOX
-{
- HelpId = RID_ENVTOOLBOX ;
- ButtonType = BUTTON_SYMBOL ;
- LineSpacing = TRUE ;
- Border = TRUE ;
- Scroll = TRUE ;
- SVLook = TRUE ;
- Dockable = TRUE ;
- Moveable = TRUE ;
- Sizeable = TRUE ;
- Closeable = TRUE ;
- Zoomable = TRUE ;
- Customize = TRUE ;
- FloatingMode = FALSE ;
- Hide = TRUE ;
- HideWhenDeactivate = TRUE ;
- Align = BOXALIGN_TOP ;
- ItemList =
- {
- ToolBoxItem
- {
- Identifier = SID_OPENURL ;
- };
- ToolBoxItem
- {
- Type = TOOLBOXITEM_SEPARATOR ;
- };
- ToolBoxItem
- {
- Identifier = SID_NEWDOCDIRECT ;
- DropDown = TRUE;
- };
- ToolBoxItem
- {
- Identifier = SID_NEWDOC ;
- Hide = TRUE;
- };
- ToolBoxItem
- {
- Identifier = SID_OPENDOC ;
- };
- ToolBoxItem
- {
- Identifier = SID_SAVEDOC ;
- };
- ToolBoxItem
- {
- Identifier = SID_SAVEASDOC ;
- Hide = TRUE;
- };
- ToolBoxItem
- {
- Type = TOOLBOXITEM_SEPARATOR ;
- };
- ToolBoxItem
- {
- Identifier = SID_EDITDOC ;
- };
- ToolBoxItem
- {
- Type = TOOLBOXITEM_SEPARATOR ;
- };
- ToolBoxItem
- {
- Identifier = SID_DIRECTEXPORTDOCASPDF ;
- };
- ToolBoxItem
- {
- Identifier = SID_PRINTDOCDIRECT ;
- };
- ToolBoxItem
- {
- Identifier = FN_FAX ;
- Hide = TRUE;
- };
- ToolBoxItem
- {
- Type = TOOLBOXITEM_SEPARATOR ;
- };
- ToolBoxItem
- {
- Identifier = SID_CUT ;
- };
- ToolBoxItem
- {
- Identifier = SID_COPY ;
- };
- ToolBoxItem
- {
- Identifier = SID_PASTE ;
- };
- ToolBoxItem
- {
- Type = TOOLBOXITEM_SEPARATOR ;
- };
- ToolBoxItem
- {
- Identifier = SID_UNDO ;
- };
- ToolBoxItem
- {
- Identifier = SID_REDO ;
- };
- ToolBoxItem
- {
- Type = TOOLBOXITEM_SEPARATOR ;
- };
- ToolBoxItem
- {
- Identifier = SID_NAVIGATOR ;
- };
- ToolBoxItem
- {
- Identifier = SID_STYLE_DESIGNER ;
- };
- ToolBoxItem
- {
- Identifier = SID_HYPERLINK_DIALOG ;
- };
- ToolBoxItem
- {
- Identifier = SID_HYPERLINK_INSERT ;
- Hide = TRUE;
- };
- ToolBoxItem
- {
- Identifier = SID_WIN_FULLSCREEN ;
- Hide = TRUE;
- };
- ToolBoxItem
- {
- Type = TOOLBOXITEM_SEPARATOR ;
- };
- ToolBoxItem
- {
- Identifier = SID_RECORDMACRO;
- Hide = TRUE;
- };
- ToolBoxItem
- {
- Type = TOOLBOXITEM_SEPARATOR ;
- };
- ToolBoxItem
- {
- Identifier = SID_GALLERY ;
- };
- ToolBoxItem
- {
- Identifier = SID_AVMEDIA_PLAYER ;
- };
- ToolBoxItem
- {
- Type = TOOLBOXITEM_SEPARATOR ;
- };
- ToolBoxItem
- {
- Identifier = SID_CLOSEDOC;
- Hide = TRUE;
- };
- };
-};
-
String RID_SPECIALCONFIG_ERROR
{
Text [ en-US ] = "An error has occurred in the special configuration.\nPlease contact your administrator." ;
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx
index 6afa8c68ed83..0b5e94ea24f0 100644
--- a/sfx2/source/appl/appcfg.cxx
+++ b/sfx2/source/appl/appcfg.cxx
@@ -58,8 +58,6 @@
#include <sfx2/sfxsids.hrc>
#include <sot/exchange.hxx>
-//#include <svtools/agprop.hxx>
-//#include <sj2/sjapplet.hxx>
#include <svl/isethint.hxx>
#include <unotools/configmgr.hxx>
@@ -828,22 +826,6 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
#endif
}
- // INet Session neu aufsetzen
- if ( bResetSession )
- {
- // no more sj2
- #if 0
- try
- {
- SjApplet2::settingsChanged();
- }
- catch ( ... )
- {
- DBG_ERRORFILE( "SjApplet2::settingsChanged() throws an exception" );
- }
- #endif
- }
-
// geaenderte Daten speichern
aInetOptions.flush();
}
diff --git a/sfx2/source/appl/appdata.cxx b/sfx2/source/appl/appdata.cxx
index a07623df46b1..38ea69280c49 100644
--- a/sfx2/source/appl/appdata.cxx
+++ b/sfx2/source/appl/appdata.cxx
@@ -89,7 +89,7 @@ void SfxBasicManagerCreationListener::onBasicManagerCreated( const Reference< XM
m_rAppData.OnApplicationBasicManagerCreated( _rBasicManager );
}
-SfxAppData_Impl::SfxAppData_Impl( SfxApplication* pApp ) :
+SfxAppData_Impl::SfxAppData_Impl( SfxApplication* ) :
pDdeService( 0 ),
pDocTopics( 0 ),
pTriggerTopic(0),
@@ -116,8 +116,7 @@ SfxAppData_Impl::SfxAppData_Impl( SfxApplication* pApp ) :
nRescheduleLocks(0),
nInReschedule(0),
nAsynchronCalls(0),
- m_xImeStatusWindow(new sfx2::appl::ImeStatusWindow(
- *pApp, comphelper::getProcessServiceFactory()))
+ m_xImeStatusWindow(new sfx2::appl::ImeStatusWindow(comphelper::getProcessServiceFactory()))
, pTbxCtrlFac(0)
, pStbCtrlFac(0)
, pViewFrames(0)
diff --git a/sfx2/source/appl/appmain.cxx b/sfx2/source/appl/appmain.cxx
index 020f68d01e8d..cf097b900b52 100644
--- a/sfx2/source/appl/appmain.cxx
+++ b/sfx2/source/appl/appmain.cxx
@@ -93,9 +93,6 @@ static SfxItemInfo __READONLY_DATA aItemInfos[] =
//===================================================================
-typedef Link* LinkPtr;
-SV_DECL_PTRARR(SfxInitLinkList, LinkPtr, 4, 4)
-
TYPEINIT2(SfxApplication,SfxShell,SfxBroadcaster);
//--------------------------------------------------------------------
diff --git a/sfx2/source/appl/appquit.cxx b/sfx2/source/appl/appquit.cxx
index 4da32cf9f566..7399742d1e94 100644
--- a/sfx2/source/appl/appquit.cxx
+++ b/sfx2/source/appl/appquit.cxx
@@ -30,9 +30,6 @@
#include <basic/basmgr.hxx>
#include <basic/sbstar.hxx>
-#ifdef WIN
-#define _TL_LANG_SPECIAL
-#endif
#include <svl/svdde.hxx>
#ifndef _MSGBOX_HXX //autogen
#include <vcl/msgbox.hxx>
@@ -74,57 +71,11 @@
using ::basic::BasicManagerRepository;
-#ifdef DBG_UTIL
-DECLARE_LIST( SfxFrameWindowFactoryArray_Impl, SfxFrameWindowFactory* )
-SV_DECL_PTRARR(SfxInitLinkList, Link*, 2, 2)
-#endif
-
//===================================================================
BOOL SfxApplication::QueryExit_Impl()
{
BOOL bQuit = TRUE;
-/*
- BOOL bPrinting = FALSE;
- for ( SfxViewShell *pViewSh = SfxViewShell::GetFirst();
- !bPrinting && pViewSh;
- pViewSh = SfxViewShell::GetNext(*pViewSh) )
- {
- SfxPrinter *pPrinter = pViewSh->GetPrinter();
- bPrinting = pPrinter && pPrinter->IsPrinting();
- }
-
- if ( bPrinting )
- {
- // Benutzer fragen, ob abgebrochen werden soll
- if ( RET_OK == QueryBox( 0, SfxResId( MSG_ISPRINTING_QUERYABORT ) ).Execute() )
- {
- // alle Jobs canceln
- for ( SfxViewShell *pViewSh = SfxViewShell::GetFirst();
- !bPrinting && pViewSh;
- pViewSh = SfxViewShell::GetNext(*pViewSh) )
- {
- SfxPrinter *pPrinter = pViewSh->GetPrinter();
- if ( pPrinter && pPrinter->IsPrinting() )
- pPrinter->AbortJob();
- }
-
- // da das Canceln asynchron ist, Quit erstmal wieder verlassen
- GetDispatcher_Impl()->Execute( SID_QUITAPP, SFX_CALLMODE_ASYNCHRON );
- DBG_TRACE( "QueryExit => FALSE (printing)" );
- return FALSE;
- }
- }
-*/
-/*
- SfxObjectShell *pLastDocSh = SfxObjectShell::GetFirst();
- if ( bQuit )
- {
- // Jetzt zur Sicherheit auch hidden Frames abr"aumen
- SfxViewFrame::CloseHiddenFrames_Impl();
- pLastDocSh = SfxObjectShell::GetFirst();
- }
-*/
// will trotzdem noch jemand, den man nicht abschiessen kann, die App haben?
if ( !bQuit )
{
@@ -197,22 +148,18 @@ void SfxApplication::Deinitialize()
delete pAppData_Impl->pLabelResMgr;
-#ifdef DBG_UTIL
DELETEX(pAppData_Impl->pSlotPool);
DELETEX(pAppData_Impl->pEventConfig);
SfxMacroConfig::Release_Impl();
DELETEX(pAppData_Impl->pFactArr);
DELETEX(pAppData_Impl->pInitLinkList);
-#endif
-#ifdef DBG_UTIL
DELETEX(pAppData_Impl->pTbxCtrlFac);
DELETEX(pAppData_Impl->pStbCtrlFac);
DELETEX(pAppData_Impl->pMenuCtrlFac);
DELETEX(pAppData_Impl->pViewFrames);
DELETEX(pAppData_Impl->pViewShells);
DELETEX(pAppData_Impl->pObjShells);
-#endif
//TODO/CLEANTUP
//ReleaseArgs could be used instead!
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 14789100bb24..439396d2ffa7 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -51,20 +51,15 @@
#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
#include <com/sun/star/system/SystemShellExecuteException.hpp>
-#ifndef _UNOTOOLS_PROCESSFACTORY_HXX
#include <comphelper/processfactory.hxx>
-#endif
#include <comphelper/storagehelper.hxx>
+#include "comphelper/configurationhelper.hxx"
-#ifndef _SVT_DOC_ADDRESSTEMPLATE_HXX_
#include <svtools/addresstemplate.hxx>
-#endif
#include <svl/visitem.hxx>
#include <unotools/intlwrapper.hxx>
-#ifndef _UNOTOOLS_CONFIGMGR_HXX_
#include <unotools/configmgr.hxx>
-#endif
#include <tools/config.hxx>
#include <tools/diagnose_ex.h>
#include <vcl/msgbox.hxx>
@@ -90,6 +85,7 @@
#include <vos/process.hxx>
#include <rtl/bootstrap.hxx>
#include <cppuhelper/exc_hlp.hxx>
+#include <rtl/ustrbuf.hxx>
#include <com/sun/star/script/provider/XScriptProviderFactory.hpp>
#include <com/sun/star/frame/XModuleManager.hpp>
@@ -350,11 +346,10 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
- ULONG nHelpId = ( rReq.GetSlot() == SID_HELP_SUPPORTPAGE ) ? 66056 : 0;
- if ( 66056 == nHelpId )
+ if ( rReq.GetSlot() == SID_HELP_SUPPORTPAGE )
{
// show Support page with new URL
- String sHelpURL = SfxHelp::CreateHelpURL( nHelpId, String() );
+ 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;
@@ -362,7 +357,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
pHelp->Start( sHelpURL, NULL );
}
else
- pHelp->Start( nHelpId, NULL ); // show start page
+ pHelp->Start( String::CreateFromAscii(".uno:HelpIndex"), NULL ); // show start page
bDone = TRUE;
}
break;
@@ -879,6 +874,31 @@ namespace
}
}
+static ::rtl::OUString getConfigurationStringValue(
+ const ::rtl::OUString& rPackage,
+ const ::rtl::OUString& rRelPath,
+ const ::rtl::OUString& rKey,
+ const ::rtl::OUString& rDefaultValue )
+{
+ ::rtl::OUString aDefVal( rDefaultValue );
+
+ try
+ {
+ ::comphelper::ConfigurationHelper::readDirectKey(
+ comphelper::getProcessServiceFactory(),
+ rPackage,
+ rRelPath,
+ rKey,
+ ::comphelper::ConfigurationHelper::E_READONLY) >>= aDefVal;
+ }
+ catch(const com::sun::star::uno::RuntimeException& exRun)
+ { throw exRun; }
+ catch(const com::sun::star::uno::Exception&)
+ {}
+
+ return aDefVal;
+}
+
void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
{
DBG_MEMTEST();
@@ -924,8 +944,34 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
uno::Reference< css::system::XSystemShellExecute > xSystemShell(
xSMGR->createInstance( DEFINE_CONST_UNICODE("com.sun.star.system.SystemShellExecute" ) ),
uno::UNO_QUERY_THROW );
- if ( xSystemShell.is() )
- xSystemShell->execute( DEFINE_CONST_UNICODE("http://extensions.services.openoffice.org/dictionary?cid=926385"), ::rtl::OUString(), css::system::SystemShellExecuteFlags::DEFAULTS );
+
+ // read repository URL from configuration
+ ::rtl::OUString sTemplRepoURL =
+ getConfigurationStringValue(
+ ::rtl::OUString::createFromAscii("org.openoffice.Office.Common"),
+ ::rtl::OUString::createFromAscii("Dictionaries"),
+ ::rtl::OUString::createFromAscii("RepositoryURL"),
+ ::rtl::OUString());
+
+ if ( xSystemShell.is() && sTemplRepoURL.getLength() > 0 )
+ {
+ ::rtl::OUStringBuffer aURLBuf( sTemplRepoURL );
+ aURLBuf.appendAscii( "?" );
+ aURLBuf.appendAscii( "lang=" );
+
+ // read locale from configuration
+ ::rtl::OUString sLocale = getConfigurationStringValue(
+ ::rtl::OUString::createFromAscii("org.openoffice.Setup"),
+ ::rtl::OUString::createFromAscii("L10N"),
+ ::rtl::OUString::createFromAscii("ooLocale"),
+ ::rtl::OUString::createFromAscii("en-US"));
+
+ aURLBuf.append( sLocale );
+ xSystemShell->execute(
+ aURLBuf.makeStringAndClear(),
+ ::rtl::OUString(),
+ css::system::SystemShellExecuteFlags::DEFAULTS );
+ }
}
catch( const ::com::sun::star::uno::Exception& )
{
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index fd33e21ea645..7056cc48a704 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -134,7 +134,6 @@ using namespace ::com::sun::star::io;
#include "brokenpackageint.hxx"
#include "eventsupplier.hxx"
#include "xpackcreator.hxx"
-// #include "applet.hxx"
#include "plugin.hxx"
#include "iframe.hxx"
#include <ownsubfilterservice.hxx>
@@ -191,6 +190,7 @@ static char const sFolderName[] = "FolderName";
static char const sUseSystemDialog[] = "UseSystemDialog";
static char const sStandardDir[] = "StandardDir";
static char const sBlackList[] = "BlackList";
+static char const sModifyPasswordInfo[] = "ModifyPasswordInfo";
void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& rArgs, SfxAllItemSet& rSet, const SfxSlot* pSlot )
{
@@ -846,6 +846,10 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxBoolItem( SID_NOAUTOSAVE, bVal ) );
}
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sModifyPasswordInfo)) )
+ {
+ rSet.Put( SfxUnoAnyItem( SID_MODIFYPASSWORDINFO, rProp.Value ) );
+ }
#ifdef DBG_UTIL
else
--nFoundArgs;
@@ -1058,6 +1062,8 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta
nAdditional++;
if ( rSet.GetItemState( SID_NOAUTOSAVE ) == SFX_ITEM_SET )
nAdditional++;
+ if ( rSet.GetItemState( SID_MODIFYPASSWORDINFO ) == SFX_ITEM_SET )
+ nAdditional++;
// consider additional arguments
nProps += nAdditional;
@@ -1197,7 +1203,9 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta
// used only internally
if ( nId == SID_SAVETO )
continue;
- }
+ if ( nId == SID_MODIFYPASSWORDINFO )
+ continue;
+ }
ByteString aDbg( "Unknown item detected: ");
aDbg += ByteString::CreateFromInt32( nId );
@@ -1555,7 +1563,11 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta
pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sNoAutoSave));
pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
}
-
+ if ( rSet.GetItemState( SID_MODIFYPASSWORDINFO, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sModifyPasswordInfo));
+ pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
+ }
}
}
@@ -2111,166 +2123,6 @@ SFX2_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment(
*ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
}
-SFX2_DLLPUBLIC sal_Bool SAL_CALL component_writeInfo(
- void* ,
- void* pRegistryKey )
-{
- ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > xKey( reinterpret_cast< ::com::sun::star::registry::XRegistryKey* >( pRegistryKey ) ) ;
-
- // register actual implementations and their services
- ::rtl::OUString aImpl;
- ::rtl::OUString aTempStr;
- ::rtl::OUString aKeyStr;
- Reference< XRegistryKey > xNewKey;
- Reference< XRegistryKey > xLoaderKey;
-
- // PluginObject
- aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += ::sfx2::PluginObject::impl_getStaticImplementationName();
-
- aTempStr = aImpl;
- aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey( aTempStr );
- xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.frame.SpecialEmbeddedObject") );
-
- #if 0
- // AppletObject
- aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += ::sfx2::AppletObject::impl_getStaticImplementationName();
-
- aTempStr = aImpl;
- aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey( aTempStr );
- xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.frame.SpecialEmbeddedObject") );
- #endif
-
- // IFrameObject
- aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += ::sfx2::IFrameObject::impl_getStaticImplementationName();
-
- aTempStr = aImpl;
- aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey( aTempStr );
- xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.frame.SpecialEmbeddedObject") );
-
- // global app event broadcaster
- aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += SfxGlobalEvents_Impl::impl_getStaticImplementationName();
-
- aTempStr = aImpl;
- aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey( aTempStr );
- xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.frame.GlobalEventBroadcaster") );
-
- // global app dispatcher
- aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += SfxAppDispatchProvider::impl_getStaticImplementationName();
-
- aTempStr = aImpl;
- aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey( aTempStr );
- xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.frame.ProtocolHandler") );
-
- // standalone document info
- aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += SfxStandaloneDocumentInfoObject::impl_getStaticImplementationName();
-
- aTempStr = aImpl;
- aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey( aTempStr );
- xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.document.StandaloneDocumentInfo") );
-
- // frame loader
- aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += SfxFrameLoader_Impl::impl_getStaticImplementationName();
-
- aTempStr = aImpl;
- aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey( aTempStr );
- Sequence < ::rtl::OUString > aServices = SfxFrameLoader_Impl::impl_getStaticSupportedServiceNames();
- sal_Int32 nCount = aServices.getLength();
- for ( sal_Int16 i=0; i<nCount; i++ )
- xNewKey->createKey( aServices.getConstArray()[i] );
-
- // macro loader
- aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += SfxMacroLoader::impl_getStaticImplementationName();
-
- aTempStr = aImpl;
- aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey( aTempStr );
- xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.frame.ProtocolHandler") );
-
- // - sfx document templates
- aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += SfxDocTplService::impl_getStaticImplementationName();
-
- aTempStr = aImpl;
- aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey( aTempStr );
- xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.frame.DocumentTemplates") );
-
- // quickstart wrapper service
- aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += ShutdownIcon::impl_getStaticImplementationName();
-
- aTempStr = aImpl;
- aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey( aTempStr );
- xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.office.Quickstart") );
-
- // application script library container service
- aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += SfxApplicationScriptLibraryContainer::impl_getStaticImplementationName();
-
- aTempStr = aImpl;
- aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey( aTempStr );
- xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.script.ApplicationScriptLibraryContainer") );
-
- // application dialog library container service
- aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += SfxApplicationDialogLibraryContainer::impl_getStaticImplementationName();
-
- aTempStr = aImpl;
- aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey( aTempStr );
- xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.script.ApplicationDialogLibraryContainer") );
-
- // converter of fs folders to packages
- aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += OPackageStructureCreator::impl_getStaticImplementationName();
-
- aTempStr = aImpl;
- aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey( aTempStr );
- Sequence< ::rtl::OUString > rServices = OPackageStructureCreator::impl_getStaticSupportedServiceNames();
- for( sal_Int32 ind = 0; ind < rServices.getLength(); ind++ )
- xNewKey->createKey( rServices.getConstArray()[ind] );
-
- // subfilter to parse a stream in OASIS format generated by the filter
- aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += ::sfx2::OwnSubFilterService::impl_getStaticImplementationName();
-
- aTempStr = aImpl;
- aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey( aTempStr );
- rServices = ::sfx2::OwnSubFilterService::impl_getStaticSupportedServiceNames();
- for( sal_Int32 ind = 0; ind < rServices.getLength(); ind++ )
- xNewKey->createKey( rServices.getConstArray()[ind] );
-
- // document meta data
- aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += comp_SfxDocumentMetaData::_getImplementationName();
-
- aTempStr = aImpl;
- aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey( aTempStr );
- xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.document.DocumentProperties") );
-
- return sal_True;
-}
-
SFX2_DLLPUBLIC void* SAL_CALL component_getFactory(
const sal_Char* pImplementationName ,
void* pServiceManager ,
@@ -2411,6 +2263,26 @@ RequestPackageReparation::RequestPackageReparation( ::rtl::OUString aName )
m_lContinuations[1] = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation >( m_pDisapprove );
}
+/*uno::*/Any SAL_CALL RequestPackageReparation::queryInterface( const /*uno::*/Type& rType ) throw (RuntimeException)
+{
+ return ::cppu::queryInterface ( rType,
+ // OWeakObject interfaces
+ dynamic_cast< XInterface* > ( (XInteractionRequest *) this ),
+ static_cast< XWeak* > ( this ),
+ // my own interfaces
+ static_cast< XInteractionRequest* > ( this ) );
+}
+
+void SAL_CALL RequestPackageReparation::acquire( ) throw ()
+{
+ OWeakObject::acquire();
+}
+
+void SAL_CALL RequestPackageReparation::release( ) throw ()
+{
+ OWeakObject::release();
+}
+
::com::sun::star::uno::Any SAL_CALL RequestPackageReparation::getRequest()
throw( ::com::sun::star::uno::RuntimeException )
{
@@ -2442,6 +2314,26 @@ NotifyBrokenPackage::NotifyBrokenPackage( ::rtl::OUString aName )
m_lContinuations[0] = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation >( m_pAbort );
}
+/*uno::*/Any SAL_CALL NotifyBrokenPackage::queryInterface( const /*uno::*/Type& rType ) throw (RuntimeException)
+{
+ return ::cppu::queryInterface ( rType,
+ // OWeakObject interfaces
+ dynamic_cast< XInterface* > ( (XInteractionRequest *) this ),
+ static_cast< XWeak* > ( this ),
+ // my own interfaces
+ static_cast< XInteractionRequest* > ( this ) );
+}
+
+void SAL_CALL NotifyBrokenPackage::acquire( ) throw ()
+{
+ OWeakObject::acquire();
+}
+
+void SAL_CALL NotifyBrokenPackage::release( ) throw ()
+{
+ OWeakObject::release();
+}
+
::com::sun::star::uno::Any SAL_CALL NotifyBrokenPackage::getRequest()
throw( ::com::sun::star::uno::RuntimeException )
{
diff --git a/sfx2/source/appl/dde.src b/sfx2/source/appl/dde.src
index 22df8eff16ba..18f6517f181c 100644
--- a/sfx2/source/appl/dde.src
+++ b/sfx2/source/appl/dde.src
@@ -29,6 +29,7 @@
ModalDialog MD_DDE_LINKEDIT
{
+ HelpID = "sfx2:ModalDialog:MD_DDE_LINKEDIT";
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 223 , 74 ) ;
@@ -42,6 +43,7 @@ ModalDialog MD_DDE_LINKEDIT
};
Edit ED_DDE_APP
{
+ HelpID = "sfx2:Edit:MD_DDE_LINKEDIT:ED_DDE_APP";
Border = TRUE ;
Pos = MAP_APPFONT ( 55 , 14 ) ;
Size = MAP_APPFONT ( 100 , 12 ) ;
@@ -54,6 +56,7 @@ ModalDialog MD_DDE_LINKEDIT
};
Edit ED_DDE_TOPIC
{
+ HelpID = "sfx2:Edit:MD_DDE_LINKEDIT:ED_DDE_TOPIC";
Border = TRUE ;
Pos = MAP_APPFONT ( 55 , 32 ) ;
Size = MAP_APPFONT ( 100 , 12 ) ;
@@ -66,6 +69,7 @@ ModalDialog MD_DDE_LINKEDIT
};
Edit ED_DDE_ITEM
{
+ HelpID = "sfx2:Edit:MD_DDE_LINKEDIT:ED_DDE_ITEM";
Border = TRUE ;
Pos = MAP_APPFONT ( 55 , 50 ) ;
Size = MAP_APPFONT ( 100 , 12 ) ;
diff --git a/sfx2/source/appl/imestatuswindow.cxx b/sfx2/source/appl/imestatuswindow.cxx
index 3cdc3064fb81..07eb47bd92ad 100644
--- a/sfx2/source/appl/imestatuswindow.cxx
+++ b/sfx2/source/appl/imestatuswindow.cxx
@@ -57,10 +57,8 @@ namespace css = com::sun::star;
using sfx2::appl::ImeStatusWindow;
ImeStatusWindow::ImeStatusWindow(
- SfxApplication & rApplication,
css::uno::Reference< css::lang::XMultiServiceFactory > const &
rServiceFactory):
- m_rApplication(rApplication),
m_xServiceFactory(rServiceFactory),
m_bDisposed(false)
{}
@@ -161,7 +159,9 @@ ImeStatusWindow::propertyChange(css::beans::PropertyChangeEvent const & )
throw (css::uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
- m_rApplication.Invalidate(SID_SHOW_IME_STATUS_WINDOW);
+ SfxApplication* pApp = SfxApplication::Get();
+ if (pApp)
+ pApp->Invalidate(SID_SHOW_IME_STATUS_WINDOW);
}
css::uno::Reference< css::beans::XPropertySet > ImeStatusWindow::getConfig()
diff --git a/sfx2/source/appl/imestatuswindow.hxx b/sfx2/source/appl/imestatuswindow.hxx
index 71c0b371f796..4edba523ed30 100644
--- a/sfx2/source/appl/imestatuswindow.hxx
+++ b/sfx2/source/appl/imestatuswindow.hxx
@@ -37,7 +37,6 @@ namespace com { namespace sun { namespace star {
namespace beans { class XPropertySet; }
namespace lang { class XMultiServiceFactory; }
} } }
-class SfxApplication;
namespace sfx2 { namespace appl {
@@ -56,10 +55,7 @@ ImeStatusWindow_Impl;
class ImeStatusWindow: private ImeStatusWindow_Impl
{
public:
- ImeStatusWindow(SfxApplication & rApplication,
- com::sun::star::uno::Reference<
- com::sun::star::lang::XMultiServiceFactory > const &
- rServiceFactory);
+ ImeStatusWindow( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > const& rServiceFactory );
/** Set up VCL according to the configuration.
@@ -115,7 +111,6 @@ private:
com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >
getConfig();
- SfxApplication & m_rApplication;
com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
m_xServiceFactory;
diff --git a/sfx2/source/appl/impldde.cxx b/sfx2/source/appl/impldde.cxx
index 10e3c9b1a04a..20b7abb5d087 100644
--- a/sfx2/source/appl/impldde.cxx
+++ b/sfx2/source/appl/impldde.cxx
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sfx2.hxx"
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
#include <tools/svwin.h>
#endif
@@ -211,7 +211,7 @@ BOOL SvDDEObject::GetData( ::com::sun::star::uno::Any & rData /*out param*/,
BOOL SvDDEObject::Connect( SvBaseLink * pSvLink )
{
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
static BOOL bInWinExec = FALSE;
#endif
USHORT nLinkType = pSvLink->GetUpdateMode();
@@ -258,7 +258,7 @@ BOOL SvDDEObject::Connect( SvBaseLink * pSvLink )
// ansonsten unter Win/WinNT die Applikation direkt starten
}
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
// Server nicht da, starten und nochmal versuchen
if( !bInWinExec )
@@ -291,7 +291,7 @@ BOOL SvDDEObject::Connect( SvBaseLink * pSvLink )
}
}
else
-#endif // WIN / WNT
+#endif // WNT
{
nError = DDELINK_ERROR_APP;
}
diff --git a/sfx2/source/appl/makefile.mk b/sfx2/source/appl/makefile.mk
index 72ac94a9b38e..30f74355077a 100644
--- a/sfx2/source/appl/makefile.mk
+++ b/sfx2/source/appl/makefile.mk
@@ -101,7 +101,6 @@ SFX_OBJECTS = \
$(SLO)$/module.obj \
$(SLO)$/newhelp.obj \
$(SLO)$/opengrf.obj \
- $(SLO)$/sfxdll.obj \
$(SLO)$/sfxhelp.obj \
$(SLO)$/sfxpicklist.obj \
$(SLO)$/shutdownicon.obj \
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 597509cf34bd..9235777e0d5a 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -2138,7 +2138,7 @@ SfxHelpTextWindow_Impl::SfxHelpTextWindow_Impl( SfxHelpWindow_Impl* pParent ) :
SvtMiscOptions().AddListenerLink( LINK( this, SfxHelpTextWindow_Impl, NotifyHdl ) );
- if ( aOnStartupCB.GetHelpId() == 0 )
+ if ( !aOnStartupCB.GetHelpId().getLength() )
aOnStartupCB.SetHelpId( HID_HELP_ONSTARTUP_BOX );
}
@@ -2640,7 +2640,7 @@ long SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& rNEvt )
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.SetHelpId( TBI_COPY, SID_COPY );
+ aMenu.SetHelpId( TBI_COPY, ".uno:Copy" );
aMenu.EnableItem( TBI_COPY, HasSelection() );
if ( bIsDebug )
@@ -3180,7 +3180,7 @@ void SfxHelpWindow_Impl::openDone(const ::rtl::OUString& sURL ,
xViewProps->setPropertyValue( DEFINE_CONST_OUSTRING("PreventHelpTips"), aBoolAny );
xViewProps->setPropertyValue( DEFINE_CONST_OUSTRING("ShowGraphics"), aBoolAny );
xViewProps->setPropertyValue( DEFINE_CONST_OUSTRING("ShowTables"), aBoolAny );
- xViewProps->setPropertyValue( DEFINE_CONST_OUSTRING("HelpURL"), makeAny( DEFINE_CONST_OUSTRING("HID:68245") ) );
+ xViewProps->setPropertyValue( DEFINE_CONST_OUSTRING("HelpURL"), makeAny( DEFINE_CONST_OUSTRING("HID:SFX2_HID_HELP_ONHELP") ) );
::rtl::OUString sProperty( DEFINE_CONST_OUSTRING("IsExecuteHyperlinks") );
if ( xInfo->hasPropertyByName( sProperty ) )
xViewProps->setPropertyValue( sProperty, aBoolAny );
diff --git a/sfx2/source/appl/newhelp.src b/sfx2/source/appl/newhelp.src
index 8a2b4f760f7e..88dfed8ad71e 100644
--- a/sfx2/source/appl/newhelp.src
+++ b/sfx2/source/appl/newhelp.src
@@ -93,12 +93,14 @@ TabPage TP_HELP_INDEX
};
ComboBox CB_INDEX
{
+ HelpID = "sfx2:ComboBox:TP_HELP_INDEX:CB_INDEX";
Border = TRUE ;
Pos = MAP_APPFONT ( 6 , 17 ) ;
Size = MAP_APPFONT ( 108 , 97 ) ;
};
PushButton PB_OPEN_INDEX
{
+ HelpID = "sfx2:PushButton:TP_HELP_INDEX:PB_OPEN_INDEX";
Pos = MAP_APPFONT ( 64 , 115 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Display" ;
@@ -119,6 +121,7 @@ TabPage TP_HELP_SEARCH
};
ComboBox ED_SEARCH
{
+ HelpID = "sfx2:ComboBox:TP_HELP_SEARCH:ED_SEARCH";
Border = TRUE ;
DropDown = TRUE;
Pos = MAP_APPFONT ( 6 , 17 ) ;
@@ -126,30 +129,35 @@ TabPage TP_HELP_SEARCH
};
PushButton PB_SEARCH
{
+ HelpID = "sfx2:PushButton:TP_HELP_SEARCH:PB_SEARCH";
Pos = MAP_APPFONT ( 101 , 17 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Find";
};
CheckBox CB_FULLWORDS
{
+ HelpID = "sfx2:CheckBox:TP_HELP_SEARCH:CB_FULLWORDS";
Pos = MAP_APPFONT ( 6, 34 ) ;
Size = MAP_APPFONT ( 128 , 10 ) ;
Text [ en-US ] = "~Complete words only";
};
CheckBox CB_SCOPE
{
+ HelpID = "sfx2:CheckBox:TP_HELP_SEARCH:CB_SCOPE";
Pos = MAP_APPFONT ( 6, 47 ) ;
Size = MAP_APPFONT ( 128 , 10 ) ;
Text [ en-US ] = "Find in ~headings only";
};
ListBox LB_RESULT
{
+ HelpID = "sfx2:ListBox:TP_HELP_SEARCH:LB_RESULT";
Border = TRUE ;
Pos = MAP_APPFONT ( 6 , 60 ) ;
Size = MAP_APPFONT ( 128 , 30 ) ;
};
PushButton PB_OPEN_SEARCH
{
+ HelpID = "sfx2:PushButton:TP_HELP_SEARCH:PB_OPEN_SEARCH";
Pos = MAP_APPFONT ( 84 , 182 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Display" ;
@@ -170,6 +178,7 @@ TabPage TP_HELP_BOOKMARKS
};
ListBox LB_BOOKMARKS
{
+ HelpID = "sfx2:ListBox:TP_HELP_BOOKMARKS:LB_BOOKMARKS";
Border = TRUE ;
Sort = TRUE;
Pos = MAP_APPFONT ( 6 , 19 ) ;
@@ -177,6 +186,7 @@ TabPage TP_HELP_BOOKMARKS
};
PushButton PB_BOOKMARKS
{
+ HelpID = "sfx2:PushButton:TP_HELP_BOOKMARKS:PB_BOOKMARKS";
Pos = MAP_APPFONT ( 64 , 119 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Display" ;
@@ -337,6 +347,7 @@ String STR_HELP_MENU_TEXT_COPY
};
ModalDialog DLG_HELP_ADDBOOKMARK
{
+ HelpID = "sfx2:ModalDialog:DLG_HELP_ADDBOOKMARK";
Size = MAP_APPFONT ( 208 , 43 ) ;
Text [ en-US ] = "Add to Bookmarks";
MOVEABLE = TRUE ;
@@ -353,6 +364,7 @@ ModalDialog DLG_HELP_ADDBOOKMARK
};
Edit ED_BOOKMARK_TITLE
{
+ HelpID = "sfx2:Edit:DLG_HELP_ADDBOOKMARK:ED_BOOKMARK_TITLE";
PosSize = MAP_APPFONT ( 6 , 19 , 140 , 12 ) ;
TABSTOP = TRUE ;
BORDER = TRUE ;
diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx
index a4d134df27fa..fd2043a9a431 100644
--- a/sfx2/source/appl/opengrf.cxx
+++ b/sfx2/source/appl/opengrf.cxx
@@ -284,12 +284,9 @@ void SvxOpenGraphicDialog::SetCurrentFilter(const String& rStr)
mpImpl->aFileDlg.SetCurrentFilter(rStr);
}
-void SvxOpenGraphicDialog::SetControlHelpIds( const INT16* _pControlId, const INT32* _pHelpId )
+void SvxOpenGraphicDialog::SetControlHelpIds( const INT16* _pControlId, const char** _pHelpId )
{
mpImpl->aFileDlg.SetControlHelpIds( _pControlId, _pHelpId );
}
-void SvxOpenGraphicDialog::SetDialogHelpId( const INT32 _nHelpId )
-{
- mpImpl->aFileDlg.SetDialogHelpId( _nHelpId );
-}
+
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index b9ff344a1513..a12ced237f55 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -29,7 +29,7 @@
#include "precompiled_sfx2.hxx"
#include "sfxhelp.hxx"
-
+#include <set>
#include <algorithm>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/frame/XFrame.hpp>
@@ -76,6 +76,7 @@
#include <sfx2/sfxuno.hxx>
#include <vcl/svapp.hxx>
#include <sfx2/frame.hxx>
+#include <rtl/string.hxx>
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::frame;
@@ -221,13 +222,13 @@ sal_Bool GetHelpAnchor_Impl( const String& _rURL, String& _rAnchor )
class SfxHelpOptions_Impl : public utl::ConfigItem
{
private:
- SvULongsSort* m_pIds;
+ std::set < rtl::OString > m_aIds;
public:
SfxHelpOptions_Impl();
~SfxHelpOptions_Impl();
- BOOL HasId( ULONG nId ) { USHORT nDummy; return m_pIds ? m_pIds->Seek_Entry( nId, &nDummy ) : FALSE; }
+ bool HasId( const rtl::OString& rId ) { return m_aIds.size() ? m_aIds.find( rId ) != m_aIds.end() : false; }
virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames );
virtual void Commit();
};
@@ -254,7 +255,6 @@ static Sequence< ::rtl::OUString > GetPropertyNames()
SfxHelpOptions_Impl::SfxHelpOptions_Impl()
: ConfigItem( ::rtl::OUString::createFromAscii("Office.SFX/Help") )
- , m_pIds( NULL )
{
Sequence< ::rtl::OUString > aNames = GetPropertyNames();
Sequence< Any > aValues = GetProperties( aNames );
@@ -275,11 +275,15 @@ SfxHelpOptions_Impl::SfxHelpOptions_Impl()
::rtl::OUString aCodedList;
if ( pValues[nProp] >>= aCodedList )
{
- String aTmp( aCodedList );
- USHORT nCount = aTmp.GetTokenCount( ',' );
- m_pIds = new SvULongsSort();
- for ( USHORT n=0; n<nCount; n++ )
- m_pIds->Insert( (ULONG) aTmp.GetToken( n, ',' ).ToInt64() );
+ rtl::OString aTmp( aCodedList, aCodedList.getLength(), RTL_TEXTENCODING_UTF8 );
+ sal_Int32 nIndex = 0;
+ do
+ {
+ rtl::OString aToken = aTmp.getToken( 0, ',', nIndex );
+ if ( aToken.getLength() )
+ m_aIds.insert( aToken );
+ }
+ while ( nIndex >= 0 );
}
else {
DBG_ERRORFILE( "Wrong property type!" );
@@ -299,7 +303,6 @@ SfxHelpOptions_Impl::SfxHelpOptions_Impl()
SfxHelpOptions_Impl::~SfxHelpOptions_Impl()
{
- delete m_pIds;
}
@@ -326,8 +329,7 @@ public:
~SfxHelp_Impl();
SfxHelpOptions_Impl* GetOptions();
- String GetHelpText( ULONG nHelpId, const String& rModule ); // get "Active Help"
- String GetHelpText( const rtl::OUString& aCommandURL, const String& rModule );
+ static String GetHelpText( const rtl::OUString& aCommandURL, const String& rModule );
sal_Bool HasModule( const ::rtl::OUString& rModule ); // module installed
sal_Bool IsHelpInstalled(); // module list not empty
};
@@ -370,16 +372,6 @@ void SfxHelp_Impl::Load()
}
}
-String SfxHelp_Impl::GetHelpText( ULONG nHelpId, const String& rModule )
-{
- // create help url
- String aHelpURL = SfxHelp::CreateHelpURL( nHelpId, rModule );
- // added 'active' parameter
- aHelpURL.Insert( String( DEFINE_CONST_UNICODE("&Active=true") ), aHelpURL.SearchBackward( '#' ) );
- // load help string
- return SfxContentHelper::GetActiveHelpString( aHelpURL );
-}
-
String SfxHelp_Impl::GetHelpText( const rtl::OUString& aCommandURL, const String& rModule )
{
// create help url
@@ -413,6 +405,199 @@ sal_Bool SfxHelp_Impl::IsHelpInstalled()
}
// 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() :
@@ -581,76 +766,6 @@ String SfxHelp::GetHelpModuleName_Impl()
return sModuleName;
}
-String SfxHelp::CreateHelpURL_Impl( ULONG nHelpId, const String& rModuleName )
-{
- String aModuleName( rModuleName );
- if ( aModuleName.Len() == 0 )
- aModuleName = getDefaultModule_Impl();
-
- // build up the help URL
- String aHelpURL;
- if ( aTicket.Len() )
- {
- // if there is a ticket, we are inside a plugin, so a special Help URL must be sent
- aHelpURL = DEFINE_CONST_UNICODE("vnd.sun.star.cmd:help?");
- aHelpURL += DEFINE_CONST_UNICODE("HELP_Request_Mode=contextIndex&HELP_Session_Mode=context&HELP_CallMode=portal&HELP_Device=html");
-
- if ( !nHelpId )
- {
- // no help id -> start page
- aHelpURL += DEFINE_CONST_UNICODE("&HELP_ContextID=start");
- }
- else
- {
- aHelpURL += DEFINE_CONST_UNICODE("&HELP_ContextID=");
- aHelpURL += String::CreateFromInt64( nHelpId );
- }
-
- aHelpURL += DEFINE_CONST_UNICODE("&HELP_ProgramID=");
- aHelpURL += aModuleName;
- aHelpURL += DEFINE_CONST_UNICODE("&HELP_User=");
- aHelpURL += aUser;
- aHelpURL += DEFINE_CONST_UNICODE("&HELP_Ticket=");
- aHelpURL += aTicket;
- aHelpURL += DEFINE_CONST_UNICODE("&HELP_Language=");
- aHelpURL += aLanguageStr;
- if ( aCountryStr.Len() )
- {
- aHelpURL += DEFINE_CONST_UNICODE("&HELP_Country=");
- aHelpURL += aCountryStr;
- }
- }
- else
- {
- sal_Bool bHasAnchor = sal_False;
- String aAnchor;
- aHelpURL = String::CreateFromAscii("vnd.sun.star.help://");
- aHelpURL += aModuleName;
-
- if ( !nHelpId )
- aHelpURL += String::CreateFromAscii("/start");
- else
- {
- aHelpURL += '/';
- aHelpURL += String::CreateFromInt64( nHelpId );
-
- String aTempURL = aHelpURL;
- AppendConfigToken_Impl( aTempURL, sal_True );
- bHasAnchor = GetHelpAnchor_Impl( aTempURL, aAnchor );
- }
-
- AppendConfigToken_Impl( aHelpURL, sal_True );
-
- if ( bHasAnchor )
- {
- aHelpURL += '#';
- aHelpURL += aAnchor;
- }
- }
-
- return aHelpURL;
-}
-
String SfxHelp::CreateHelpURL_Impl( const String& aCommandURL, const String& rModuleName )
{
// build up the help URL
@@ -660,28 +775,7 @@ String SfxHelp::CreateHelpURL_Impl( const String& aCommandURL, const String& rM
String aModuleName( rModuleName );
if ( aModuleName.Len() == 0 )
- {
- // no active module (quicklaunch?) -> detect default module
- SvtModuleOptions aModOpt;
- if ( aModOpt.IsModuleInstalled( SvtModuleOptions::E_SWRITER ) )
- aModuleName = DEFINE_CONST_UNICODE("swriter");
- else if ( aModOpt.IsModuleInstalled( SvtModuleOptions::E_SCALC ) )
- aModuleName = DEFINE_CONST_UNICODE("scalc");
- else if ( aModOpt.IsModuleInstalled( SvtModuleOptions::E_SIMPRESS ) )
- aModuleName = DEFINE_CONST_UNICODE("simpress");
- else if ( aModOpt.IsModuleInstalled( SvtModuleOptions::E_SDRAW ) )
- aModuleName = DEFINE_CONST_UNICODE("sdraw");
- else if ( aModOpt.IsModuleInstalled( SvtModuleOptions::E_SMATH ) )
- aModuleName = DEFINE_CONST_UNICODE("smath");
- else if ( aModOpt.IsModuleInstalled( SvtModuleOptions::E_SCHART ) )
- aModuleName = DEFINE_CONST_UNICODE("schart");
- else if ( aModOpt.IsModuleInstalled( SvtModuleOptions::E_SBASIC ) )
- aModuleName = DEFINE_CONST_UNICODE("sbasic");
- else
- {
- DBG_ERRORFILE( "no installed module found" );
- }
- }
+ aModuleName = getDefaultModule_Impl();
aHelpURL = String::CreateFromAscii("vnd.sun.star.help://");
aHelpURL += aModuleName;
@@ -694,7 +788,7 @@ String SfxHelp::CreateHelpURL_Impl( const String& aCommandURL, const String& rM
aHelpURL += String( rtl::Uri::encode( aCommandURL,
rtl_UriCharClassRelSegment,
rtl_UriEncodeKeepEscapes,
- RTL_TEXTENCODING_ASCII_US ));
+ RTL_TEXTENCODING_UTF8 ));
String aTempURL = aHelpURL;
AppendConfigToken_Impl( aTempURL, sal_True );
@@ -762,8 +856,60 @@ SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame >& rHelpTask ,
return pHelpWindow;
}
+XubString SfxHelp::GetHelpText( const String& aCommandURL, const Window* pWindow )
+{
+ String sModuleName = GetHelpModuleName_Impl();
+ String sHelpText = pImp->GetHelpText( aCommandURL, sModuleName );
+
+ ByteString aNewHelpId;
+
+ if ( pWindow && !sHelpText.Len() )
+ {
+ // no help text found -> try with parent help id.
+ Window* pParent = pWindow->GetParent();
+ while ( pParent )
+ {
+ aNewHelpId = pParent->GetHelpId();
+ sHelpText = pImp->GetHelpText( String( aNewHelpId, RTL_TEXTENCODING_UTF8 ), sModuleName );
+ if ( sHelpText.Len() > 0 )
+ pParent = NULL;
+ else
+ pParent = pParent->GetParent();
+ }
+
+ if ( bIsDebug && !sHelpText.Len() )
+ aNewHelpId.Erase();
+ }
+
+ // add some debug information?
+ if ( bIsDebug )
+ {
+ sHelpText += DEFINE_CONST_UNICODE("\n-------------\n");
+ sHelpText += String( sModuleName );
+ sHelpText += DEFINE_CONST_UNICODE(": ");
+ sHelpText += aCommandURL;
+ if ( aNewHelpId.Len() )
+ {
+ sHelpText += DEFINE_CONST_UNICODE(" - ");
+ sHelpText += String( aNewHelpId, RTL_TEXTENCODING_UTF8 );
+ }
+ }
+
+ return sHelpText;
+}
+
+BOOL SfxHelp::SearchKeyword( const XubString& rKeyword )
+{
+ return Start_Impl( String(), NULL, rKeyword );
+}
+
BOOL SfxHelp::Start( const String& rURL, const Window* pWindow )
{
+ return Start_Impl( rURL, pWindow, String() );
+}
+
+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 );
@@ -776,54 +922,60 @@ BOOL SfxHelp::Start( const String& rURL, const Window* pWindow )
return FALSE;
}
- // check if it's an URL or a jump mark!
- String aHelpURL(rURL );
- INetURLObject aParser (aHelpURL);
- ::rtl::OUString sKeyword;
+ /* rURL may be
+ - a "real" URL
+ - a HelpID (formerly a long, now a string)
+ If rURL is a URL, CreateHelpURL should be called for this URL
+ If rURL is an arbitrary string, the same should happen, but the URL should be tried out
+ if it delivers real help content. In case only the Help Error Document is returned, the
+ parent of the window for that help was called, is asked for its HelpID.
+ For compatibility reasons this upward search is not implemented for "real" URLs.
+ Help keyword search now is implemented as own method; in former versions it
+ was done via Help::Start, but this implementation conflicted with the upward search.
+ */
+ String aHelpURL;
+ INetURLObject aParser( rURL );
INetProtocol nProtocol = aParser.GetProtocol();
- if ( nProtocol != INET_PROT_VND_SUN_STAR_HELP )
+ String aHelpModuleName( GetHelpModuleName_Impl() );
+ switch ( nProtocol )
{
- // #i90162 Accept anything that is not invalid as help id, as both
- // uno: URLs used as commands/help ids in the Office and the scheme
- // used in extension help ids (e.g. com.foocorp.foo-ext:FooDialogButton)
- // are accepted as INET_PROT_UNO respectively INET_PROT_GENERIC
- bool bAcceptAsURL = ( nProtocol != INET_PROT_NOT_VALID );
-
- // #i94891 As in some extensions help ids like foo.bar.dummy without
- // any : have been used that worked before the fix of #i90162 (see
- // above) strings containing . will be also accepted to avoid brea-
- // king the help of existing extensions.
- if( !bAcceptAsURL )
- bAcceptAsURL = ( rURL.Search( '.' ) != STRING_NOTFOUND );
-
- if ( bAcceptAsURL )
+ case INET_PROT_VND_SUN_STAR_HELP:
+ // already a vnd.sun.star.help URL -> nothing to do
+ aHelpURL = rURL;
+ break;
+ default:
{
- aHelpURL = CreateHelpURL_Impl( rURL, GetHelpModuleName_Impl( ) );
- }
- else
- {
- aHelpURL = CreateHelpURL_Impl( 0, GetHelpModuleName_Impl( ) );
-
- // 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 );
+ // no URL, just a HelpID (maybe empty in case of keyword search)
+ aHelpURL = CreateHelpURL_Impl( rURL, aHelpModuleName );
+ if ( pWindow && SfxContentHelper::IsHelpErrorDocument( aHelpURL ) )
+ {
+ // no help found -> try with parent help id.
+ Window* pParent = pWindow->GetParent();
+ while ( pParent )
+ {
+ ByteString aHelpId = pParent->GetHelpId();
+ aHelpURL = CreateHelpURL( String( aHelpId, RTL_TEXTENCODING_UTF8 ), aHelpModuleName );
+ if ( !SfxContentHelper::IsHelpErrorDocument( aHelpURL ) )
+ break;
+ else
+ {
+ pParent = pParent->GetParent();
+ if ( !pParent )
+ // create help url of start page ( helpid == 0 -> start page)
+ aHelpURL = CreateHelpURL( String(), aHelpModuleName );
+ }
+ }
+ }
+ break;
}
}
Reference < XFrame > xDesktop( ::comphelper::getProcessServiceFactory()->createInstance(
DEFINE_CONST_UNICODE("com.sun.star.frame.Desktop") ), UNO_QUERY );
- // check if help is still open
- // If not - create new one and return acces directly
- // to the internal sub frame, which shows the help content.
-
- // Note further: We search for this sub frame here directly instead of
- // the real top level help task ... It's needed to have the same
- // sub frame available - so we can use it for loading (which is done
- // in both cases)!
-
+ // check if help window is still open
+ // If not, create a new one and return access directly to the internal sub frame showing the help content
+ // search must be done here; search one desktop level could return an arbitraty frame
Reference< XFrame > xHelp = xDesktop->findFrame(
::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP_TASK")),
FrameSearchFlag::CHILDREN);
@@ -839,10 +991,16 @@ BOOL SfxHelp::Start( const String& rURL, const Window* pWindow )
if (!xHelp.is() || !xHelpContent.is() || !pHelpWindow)
return FALSE;
+#ifdef DBG_UTIL
+ ByteString aTmp("SfxHelp: HelpId = ");
+ aTmp += ByteString( aHelpURL, RTL_TEXTENCODING_UTF8 );
+ DBG_TRACE( aTmp.GetBuffer() );
+#endif
+
pHelpWindow->SetHelpURL( aHelpURL );
pHelpWindow->loadHelpContent(aHelpURL);
- if ( sKeyword.getLength() > 0 )
- pHelpWindow->OpenKeyword( sKeyword );
+ if ( rKeyword.Len() )
+ pHelpWindow->OpenKeyword( rKeyword );
Reference < ::com::sun::star::awt::XTopWindow > xTopWindow( xHelp->getContainerWindow(), UNO_QUERY );
if ( xTopWindow.is() )
@@ -851,101 +1009,6 @@ BOOL SfxHelp::Start( const String& rURL, const Window* pWindow )
return TRUE;
}
-BOOL SfxHelp::Start( ULONG nHelpId, const Window* pWindow )
-{
- String aHelpModuleName( GetHelpModuleName_Impl() );
- String aHelpURL = CreateHelpURL( nHelpId, aHelpModuleName );
- if ( pWindow && SfxContentHelper::IsHelpErrorDocument( aHelpURL ) )
- {
- // no help found -> try with parent help id.
- Window* pParent = pWindow->GetParent();
- while ( pParent )
- {
- nHelpId = pParent->GetSmartUniqueOrHelpId().GetNum();
- aHelpURL = CreateHelpURL( nHelpId, aHelpModuleName );
-
- if ( !SfxContentHelper::IsHelpErrorDocument( aHelpURL ) )
- break;
- else
- {
- pParent = pParent->GetParent();
- if ( !pParent )
- // create help url of start page ( helpid == 0 -> start page)
- aHelpURL = CreateHelpURL( 0, aHelpModuleName );
- }
- }
- }
-
- return Start( aHelpURL, pWindow );
-}
-
-XubString SfxHelp::GetHelpText( ULONG nHelpId, const Window* pWindow )
-{
- String aModuleName = GetHelpModuleName_Impl();
- String aHelpText = pImp->GetHelpText( nHelpId, aModuleName );
- ULONG nNewHelpId = 0;
-
- if ( pWindow && aHelpText.Len() == 0 )
- {
- // no help text found -> try with parent help id.
- Window* pParent = pWindow->GetParent();
- while ( pParent )
- {
- nNewHelpId = pParent->GetHelpId();
- aHelpText = pImp->GetHelpText( nNewHelpId, aModuleName );
-
- if ( aHelpText.Len() > 0 )
- pParent = NULL;
- else
- pParent = pParent->GetParent();
- }
-
- if ( bIsDebug && aHelpText.Len() == 0 )
- nNewHelpId = 0;
- }
-
- if ( bIsDebug )
- {
- aHelpText += DEFINE_CONST_UNICODE("\n\n");
- aHelpText += aModuleName;
- aHelpText += DEFINE_CONST_UNICODE(" - ");
- aHelpText += String::CreateFromInt64( nHelpId );
- if ( nNewHelpId )
- {
- aHelpText += DEFINE_CONST_UNICODE(" - ");
- aHelpText += String::CreateFromInt64( nNewHelpId );
- }
- }
-
- return aHelpText;
-}
-
-XubString SfxHelp::GetHelpText( const String& aCommandURL, const Window* )
-{
- String sModuleName = GetHelpModuleName_Impl();
- String sHelpText = pImp->GetHelpText( aCommandURL, sModuleName );
-
- // add some debug information?
- if ( bIsDebug )
- {
- sHelpText += DEFINE_CONST_UNICODE("\n-------------\n");
- sHelpText += String( sModuleName );
- sHelpText += DEFINE_CONST_UNICODE(": ");
- sHelpText += aCommandURL;
- }
-
- return sHelpText;
-}
-
-String SfxHelp::CreateHelpURL( ULONG nHelpId, const String& rModuleName )
-{
- String aURL;
- SfxHelp* pHelp = SAL_STATIC_CAST( SfxHelp*, Application::GetHelp() );
- if ( pHelp )
- aURL = pHelp->CreateHelpURL_Impl( nHelpId, rModuleName );
- return aURL;
-}
-
String SfxHelp::CreateHelpURL( const String& aCommandURL, const String& rModuleName )
{
String aURL;
@@ -955,28 +1018,25 @@ String SfxHelp::CreateHelpURL( const String& aCommandURL, const String& rModuleN
return aURL;
}
-void SfxHelp::OpenHelpAgent( SfxFrame*, ULONG nHelpId )
+void SfxHelp::OpenHelpAgent( SfxFrame*, const rtl::OString& sHelpId )
{
- SfxHelp* pHelp = SAL_STATIC_CAST( SfxHelp*, Application::GetHelp() );
- if ( pHelp )
- pHelp->OpenHelpAgent( nHelpId );
+ SfxHelp* pHelp = SAL_STATIC_CAST( SfxHelp*, Application::GetHelp() );
+ if ( pHelp )
+ pHelp->OpenHelpAgent( sHelpId );
}
-void SfxHelp::OpenHelpAgent( ULONG nHelpId )
+void SfxHelp::OpenHelpAgent( const rtl::OString& sHelpId )
{
if ( SvtHelpOptions().IsHelpAgentAutoStartMode() )
{
-// SfxHelp* pHelp = SAL_STATIC_CAST( SfxHelp*, Application::GetHelp() );
-// if ( pHelp )
-// {
SfxHelpOptions_Impl *pOpt = pImp->GetOptions();
- if ( !pOpt->HasId( nHelpId ) )
+ if ( !pOpt->HasId( sHelpId ) )
return;
try
{
URL aURL;
- aURL.Complete = CreateHelpURL_Impl( nHelpId, GetHelpModuleName_Impl() );
+ 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 );
xTrans->parseStrict(aURL);
@@ -1002,7 +1062,6 @@ void SfxHelp::OpenHelpAgent( ULONG nHelpId )
{
DBG_ERRORFILE( "OpenHelpAgent: caught an exception while executing the dispatch!" );
}
-// }
}
}
diff --git a/sfx2/source/bastyp/progress.cxx b/sfx2/source/bastyp/progress.cxx
index 649ae121c274..3af0ba2b0a6f 100644
--- a/sfx2/source/bastyp/progress.cxx
+++ b/sfx2/source/bastyp/progress.cxx
@@ -706,7 +706,7 @@ SfxProgress* SfxProgress::GetActiveProgress
*/
{
- if ( !SfxApplication::Is_Impl() )
+ if ( !SfxApplication::Get() )
return 0;
SfxProgress *pProgress = 0;
diff --git a/sfx2/source/bastyp/sfxhtml.cxx b/sfx2/source/bastyp/sfxhtml.cxx
index 6132e958b900..8a4b434f460b 100644
--- a/sfx2/source/bastyp/sfxhtml.cxx
+++ b/sfx2/source/bastyp/sfxhtml.cxx
@@ -62,11 +62,7 @@ sal_Char __FAR_DATA sHTML_MIME_application[] = "application/";
sal_Char __FAR_DATA sHTML_MIME_experimental[] = "x-";
// <INPUT TYPE=xxx>
-#ifdef __MINGW32__ // for runtime pseudo reloc
-static HTMLOptionEnum aAreaShapeOptEnums[] =
-#else
static HTMLOptionEnum __READONLY_DATA aAreaShapeOptEnums[] =
-#endif
{
{ OOO_STRING_SVTOOLS_HTML_SH_rect, IMAP_OBJ_RECTANGLE },
{ OOO_STRING_SVTOOLS_HTML_SH_rectangle, IMAP_OBJ_RECTANGLE },
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index e66dd2c56eaf..444be02127b3 100644..100755
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -281,7 +281,11 @@ int SfxDispatcher::Call_Impl( SfxShell& rShell, const SfxSlot &rSlot, SfxRequest
if ( !pView )
pView = SfxViewFrame::Current();
if ( pView )
- SfxHelp::OpenHelpAgent( &pView->GetFrame(), rReq.GetSlot() );
+ {
+ rtl::OString aCmd(".uno:");
+ aCmd += rSlot.GetUnoName();
+ SfxHelp::OpenHelpAgent( &pView->GetFrame(), aCmd );
+ }
SfxExecFunc pFunc = rSlot.GetExecFnc();
rShell.CallExec( pFunc, rReq );
@@ -1675,14 +1679,14 @@ void SfxDispatcher::SetMenu_Impl()
}
//--------------------------------------------------------------------
-long SfxDispatcher::Update_Impl( sal_Bool bForce )
+void SfxDispatcher::Update_Impl( sal_Bool bForce )
{
SFX_STACK(SfxDispatcher::Update_Impl);
Flush();
if ( !pImp->pFrame || pImp->bUILocked )
- return 0;
+ return;
SFX_APP(); // -Wall is this required???
SfxDispatcher *pDisp = this;
@@ -1704,7 +1708,7 @@ long SfxDispatcher::Update_Impl( sal_Bool bForce )
}
if ( !bUpdate || pImp->pFrame->GetFrame().IsClosing_Impl() )
- return 0;
+ return;
SfxViewFrame* pTop = pImp->pFrame ? pImp->pFrame->GetTopViewFrame() : NULL;
sal_Bool bUIActive = pTop && pTop->GetBindings().GetDispatcher() == this;
@@ -1778,12 +1782,11 @@ long SfxDispatcher::Update_Impl( sal_Bool bForce )
if ( xLayoutManager.is() )
xLayoutManager->unlock();
- return 1;
+ return;
}
-sal_uInt32 SfxDispatcher::_Update_Impl( sal_Bool bUIActive, sal_Bool bIsMDIApp, sal_Bool bIsIPOwner, SfxWorkWindow *pTaskWin )
+void SfxDispatcher::_Update_Impl( sal_Bool bUIActive, sal_Bool bIsMDIApp, sal_Bool bIsIPOwner, SfxWorkWindow *pTaskWin )
{
- sal_uInt32 nHelpId = 0;
SFX_APP();
SfxWorkWindow *pWorkWin = pImp->pFrame->GetFrame().GetWorkWindow_Impl();
sal_Bool bIsActive = sal_False;
@@ -1798,7 +1801,7 @@ sal_uInt32 SfxDispatcher::_Update_Impl( sal_Bool bUIActive, sal_Bool bIsMDIApp,
}
if ( pImp->pParent && !pImp->bQuiet /* && bUIActive */ )
- nHelpId = pImp->pParent->_Update_Impl( bUIActive, bIsMDIApp, bIsIPOwner, pTaskWin );
+ pImp->pParent->_Update_Impl( bUIActive, bIsMDIApp, bIsIPOwner, pTaskWin );
for (sal_uInt16 n=0; n<SFX_OBJECTBAR_MAX; n++)
pImp->aObjBars[n].nResId = 0;
@@ -1807,7 +1810,7 @@ sal_uInt32 SfxDispatcher::_Update_Impl( sal_Bool bUIActive, sal_Bool bIsMDIApp,
// bQuiet : own shells aren't considered for UI and SlotServer
// bNoUI: own Shells aren't considered fors UI
if ( pImp->bQuiet || pImp->bNoUI || (pImp->pFrame && pImp->pFrame->GetObjectShell()->IsPreview()) )
- return nHelpId;
+ return;
sal_uInt32 nStatBarId=0;
SfxShell *pStatusBarShell = NULL;
@@ -1818,8 +1821,6 @@ sal_uInt32 SfxDispatcher::_Update_Impl( sal_Bool bUIActive, sal_Bool bIsMDIApp,
{
SfxShell *pShell = GetShell( nShell-1 );
SfxInterface *pIFace = pShell->GetInterface();
- if (pShell->GetHelpId())
- nHelpId = pShell->GetHelpId();
// don't consider shells if "Hidden" oder "Quiet"
sal_Bool bReadOnlyShell = IsReadOnlyShell_Impl( nShell-1 );
@@ -1950,8 +1951,6 @@ sal_uInt32 SfxDispatcher::_Update_Impl( sal_Bool bUIActive, sal_Bool bIsMDIApp,
pImp->pFrame->GetFrame().GetWorkWindow_Impl()->SetStatusBar_Impl( nStatBarId, pStatusBarShell, rBindings );
}
}
-
- return nHelpId;
}
//--------------------------------------------------------------------
diff --git a/sfx2/source/control/msg.cxx b/sfx2/source/control/msg.cxx
index 0aa4df6902ee..6b05c03160ff 100644
--- a/sfx2/source/control/msg.cxx
+++ b/sfx2/source/control/msg.cxx
@@ -29,9 +29,6 @@
#include "precompiled_sfx2.hxx"
#include <svl/itempool.hxx>
#include <svl/eitem.hxx>
-#ifndef GCC
-#endif
-
#include <sfx2/msg.hxx>
//====================================================================
@@ -63,4 +60,16 @@ USHORT SfxSlot::GetWhich( const SfxItemPool &rPool ) const
return nMasterSlotId;
}
+::rtl::OString SfxSlot::GetCommand() const
+{
+ rtl::OString sRet(".uno:");
+ sRet += pUnoName;
+ return sRet;
+}
+
+::rtl::OUString SfxSlot::GetCommandString() const
+{
+ rtl::OString aCmd(GetCommand());
+ return rtl::OUString( aCmd, aCmd.getLength(), RTL_TEXTENCODING_UTF8 );
+}
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index d2ad8c645eb7..e53f1766b7b9 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -823,7 +823,7 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util
pItem = pDispatcher->Execute( GetId(), nCall, 0, &aInternalSet, nModifier );
// no bindings, no invalidate ( usually done in SfxDispatcher::Call_Impl()! )
- if ( SfxApplication::Is_Impl() )
+ if ( SfxApplication::Get() )
{
SfxDispatcher* pAppDispat = SFX_APP()->GetAppDispatcher_Impl();
if ( pAppDispat )
diff --git a/sfx2/source/dialog/about.cxx b/sfx2/source/dialog/about.cxx
index 4635733b934d..7d868eb97362 100644
--- a/sfx2/source/dialog/about.cxx
+++ b/sfx2/source/dialog/about.cxx
@@ -55,7 +55,7 @@
#include "sfxresid.hxx"
#include <sfx2/sfxdefs.hxx>
#include <sfx2/app.hxx>
-
+#include <sfx2/sfxcommands.h>
#include "dialog.hrc"
// defines ---------------------------------------------------------------
@@ -172,20 +172,6 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerS
rtl::OUString sProduct;
utl::ConfigManager::GetDirectConfigProperty(utl::ConfigManager::PRODUCTNAME) >>= sProduct;
- if ( sProduct.equals( rtl::OUString::createFromAscii("StarOffice") ) ||
- sProduct.equals( rtl::OUString::createFromAscii("StarSuite") ) )
- {
- // --> PB 2004-11-18 #118455# new copyright text (only in french version show a french text)
- ::com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILocale();
- ::rtl::OUString sFrenchLang( DEFINE_CONST_OUSTRING( "fr" ) );
- if ( aLocale.Language.equals( sFrenchLang ) )
- {
- String sNewCopyrightText( ResId( ABOUT_STR_FRENCH_COPYRIGHT, *rId.GetResMgr() ) );
- aCopyrightText.SetText( sNewCopyrightText );
- }
- // <--
- }
-
// load image from module path
aAppLogo = SfxApplication::GetApplicationLogo();
@@ -297,24 +283,7 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerS
FreeResource();
- // explizite Help-Id
- SetHelpId( SID_ABOUT );
-
- //#112429# replace occurences of "StarOffice" in the "StarSuite" version
- String sCopyright( aCopyrightText.GetText() );
- if(sProduct.equals(rtl::OUString::createFromAscii("StarSuite")))
- {
- String sSO(String::CreateFromAscii("StarOffice"));
- sCopyright.SearchAndReplaceAll(sSO, sProduct);
- }
-
- String sNewYear( DEFINE_CONST_UNICODE("2005") );
- xub_StrLen nIdx = sCopyright.SearchAndReplace( DEFINE_CONST_UNICODE("2002"), sNewYear );
- if ( STRING_NOTFOUND == nIdx )
- nIdx = sCopyright.SearchAndReplace( DEFINE_CONST_UNICODE("2003"), sNewYear );
- if ( STRING_NOTFOUND == nIdx )
- nIdx = sCopyright.SearchAndReplace( DEFINE_CONST_UNICODE("2004"), sNewYear );
- aCopyrightText.SetText( sCopyright );
+ SetHelpId( CMD_SID_ABOUT );
}
// -----------------------------------------------------------------------
diff --git a/sfx2/source/dialog/alienwarn.src b/sfx2/source/dialog/alienwarn.src
index 7aa6f3230778..ae07b28a4f4d 100644
--- a/sfx2/source/dialog/alienwarn.src
+++ b/sfx2/source/dialog/alienwarn.src
@@ -81,6 +81,7 @@ ModalDialog RID_DLG_ALIEN_WARNING
};
CheckBox CB_WARNING_OFF
{
+ HelpID = "sfx2:CheckBox:RID_DLG_ALIEN_WARNING:CB_WARNING_OFF";
Pos = MAP_APPFONT( AW_COL_2, AW_ROW_4 );
Size = MAP_APPFONT( DIALOG_WIDTH-AW_COL_2-RSC_SP_DLG_INNERBORDER_RIGHT, RSC_CD_CHECKBOX_HEIGHT );
WordBreak = TRUE ;
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index 2ea5ef5fe4b1..df1f13155513 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -160,9 +160,6 @@ void SfxModalDialog::GetDialogData_Impl()
void SfxModalDialog::init()
{
GetDialogData_Impl();
- aTimer.SetTimeout( 100 );
- aTimer.SetTimeoutHdl( LINK( this, SfxModalDialog, TimerHdl_Impl ) );
- aTimer.Start();
}
// -----------------------------------------------------------------------
@@ -214,13 +211,7 @@ SfxModalDialog::~SfxModalDialog()
*/
{
-/*
- SfxHelpPI *pHelpPI = SFX_APP()->GetHelpPI();
- if ( pHelpPI )
- pHelpPI->ResetTopic();
-*/
SetDialogData_Impl();
- aTimer.Stop();
delete pOutputSet;
}
@@ -233,16 +224,6 @@ void SfxModalDialog::CreateOutputItemSet( SfxItemPool& rPool )
// -----------------------------------------------------------------------
-IMPL_LINK( SfxModalDialog, TimerHdl_Impl, Timer*, EMPTYARG )
-{
-/*
- SfxHelpPI *pHelpPI = SFX_APP()->GetHelpPI();
- if ( pHelpPI )
- pHelpPI->LoadTopic( GetHelpId() );
- */
- return 0L;
-}
-
void SfxModalDialog::CreateOutputItemSet( const SfxItemSet& rSet )
{
DBG_ASSERT( !pOutputSet, "Double creation of OutputSet!" );
@@ -373,9 +354,8 @@ SfxModelessDialog::SfxModelessDialog( SfxBindings *pBindinx,
{
pImp->pMgr = pCW;
pImp->bConstructed = FALSE;
- sal_uInt32 nId = GetHelpId();
- SetHelpId(0);
- SetUniqueId( nId );
+ SetUniqueId( GetHelpId() );
+ SetHelpId("");
if ( pBindinx )
pImp->StartListening( *pBindinx );
pImp->aMoveTimer.SetTimeout(50);
@@ -393,9 +373,8 @@ SfxModelessDialog::SfxModelessDialog( SfxBindings *pBindinx,
{
pImp->pMgr = pCW;
pImp->bConstructed = FALSE;
- sal_uInt32 nId = GetHelpId();
- SetHelpId(0);
- SetUniqueId( nId );
+ SetUniqueId( GetHelpId() );
+ SetHelpId("");
if ( pBindinx )
pImp->StartListening( *pBindinx );
pImp->aMoveTimer.SetTimeout(50);
@@ -418,15 +397,15 @@ long SfxModelessDialog::Notify( NotifyEvent& rEvt )
pBindings->SetActiveFrame( pImp->pMgr->GetFrame() );
pImp->pMgr->Activate_Impl();
Window* pWindow = rEvt.GetWindow();
- ULONG nHelpId = 0;
- while ( !nHelpId && pWindow )
+ rtl::OString sHelpId;
+ while ( !sHelpId.getLength() && pWindow )
{
- nHelpId = pWindow->GetHelpId();
+ sHelpId = pWindow->GetHelpId();
pWindow = pWindow->GetParent();
}
- if ( nHelpId )
- SfxHelp::OpenHelpAgent( &pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame(), nHelpId );
+ if ( sHelpId.getLength() )
+ SfxHelp::OpenHelpAgent( &pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame(), sHelpId );
}
else if ( rEvt.GetType() == EVENT_LOSEFOCUS && !HasChildPathFocus() )
{
@@ -520,15 +499,15 @@ long SfxFloatingWindow::Notify( NotifyEvent& rEvt )
pBindings->SetActiveFrame( pImp->pMgr->GetFrame() );
pImp->pMgr->Activate_Impl();
Window* pWindow = rEvt.GetWindow();
- ULONG nHelpId = 0;
- while ( !nHelpId && pWindow )
+ rtl::OString sHelpId;
+ while ( !sHelpId.getLength() && pWindow )
{
- nHelpId = pWindow->GetHelpId();
+ sHelpId = pWindow->GetHelpId();
pWindow = pWindow->GetParent();
}
- if ( nHelpId )
- SfxHelp::OpenHelpAgent( &pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame(), nHelpId );
+ if ( sHelpId.getLength() )
+ SfxHelp::OpenHelpAgent( &pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame(), sHelpId );
}
else if ( rEvt.GetType() == EVENT_LOSEFOCUS )
{
@@ -561,9 +540,8 @@ SfxFloatingWindow::SfxFloatingWindow( SfxBindings *pBindinx,
{
pImp->pMgr = pCW;
pImp->bConstructed = FALSE;
- sal_uInt32 nId = GetHelpId();
- SetHelpId(0);
- SetUniqueId( nId );
+ SetUniqueId( GetHelpId() );
+ SetHelpId("");
if ( pBindinx )
pImp->StartListening( *pBindinx );
pImp->aMoveTimer.SetTimeout(50);
@@ -582,9 +560,8 @@ SfxFloatingWindow::SfxFloatingWindow( SfxBindings *pBindinx,
{
pImp->pMgr = pCW;
pImp->bConstructed = FALSE;
- sal_uInt32 nId = GetHelpId();
- SetHelpId(0);
- SetUniqueId( nId );
+ SetUniqueId( GetHelpId() );
+ SetHelpId("");
if ( pBindinx )
pImp->StartListening( *pBindinx );
pImp->aMoveTimer.SetTimeout(50);
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 45ebfeac69f9..3d848d4d5648 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sfx2.hxx"
+
#include <tools/urlobj.hxx>
#include <vcl/msgbox.hxx>
#include <svl/eitem.hxx>
@@ -59,7 +60,8 @@
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <vcl/timer.hxx>
-#include <sfx2/dinfdlg.hxx>
+#include "sfx2/dinfdlg.hxx"
+#include "sfx2/securitypage.hxx"
#include "sfxresid.hxx"
#include "dinfedt.hxx"
#include <sfx2/frame.hxx>
@@ -1523,19 +1525,6 @@ SfxDocumentInfoDialog::SfxDocumentInfoDialog( Window* pParent,
{
// Dateiname
String aFile( pInfoItem->GetValue() );
-#ifdef WIN
- if ( aFile.Len() <= 8 )
- {
- String sTmp( SfxResId( STR_NONAME ) );
- USHORT nLen = Min( (USHORT)8, sTmp.Len() );
-
- if ( sTmp.Copy( 0, nLen ).Lower() ==
- aFile.Copy( 0, nLen ).Lower() )
- {
- aFile = pInfoItem->GetValue();
- }
- }
-#endif
INetURLObject aURL;
aURL.SetSmartProtocol( INET_PROT_FILE );
@@ -1564,6 +1553,7 @@ SfxDocumentInfoDialog::SfxDocumentInfoDialog( Window* pParent,
AddTabPage(TP_DOCINFODOC, SfxDocumentPage::Create, 0);
AddTabPage(TP_CUSTOMPROPERTIES, SfxCustomPropertiesPage::Create, 0);
AddTabPage(TP_DOCINFORELOAD, SfxInternetPage::Create, 0);
+ AddTabPage(TP_DOCINFOSECURITY, SfxSecurityPage::Create, 0);
}
// -----------------------------------------------------------------------
diff --git a/sfx2/source/dialog/dinfdlg.src b/sfx2/source/dialog/dinfdlg.src
index 99a062c4aecf..c78347e3dba3 100644
--- a/sfx2/source/dialog/dinfdlg.src
+++ b/sfx2/source/dialog/dinfdlg.src
@@ -27,11 +27,11 @@
// include ---------------------------------------------------------------
-#include <sfx2/sfx.hrc>
+#include "sfx2/sfx.hrc"
#include "helpid.hrc"
#include "sfxlocal.hrc"
#include "dinfdlg.hrc"
-#include <dialog.hrc>
+#include "dialog.hrc"
// TP_DOCINFODESC --------------------------------------------------------
String STR_SFX_NEWOFFICEDOC
@@ -53,6 +53,7 @@ TabPage TP_DOCINFODESC
};
Edit ED_TITLE
{
+ HelpID = "sfx2:Edit:TP_DOCINFODESC:ED_TITLE";
Border = TRUE ;
Pos = MAP_APPFONT ( 70 , 6 ) ;
Size = MAP_APPFONT ( 184 , RSC_CD_TEXTBOX_HEIGHT ) ;
@@ -68,6 +69,7 @@ TabPage TP_DOCINFODESC
};
Edit ED_THEMA
{
+ HelpID = "sfx2:Edit:TP_DOCINFODESC:ED_THEMA";
Border = TRUE ;
Pos = MAP_APPFONT ( 70 , 21 ) ;
Size = MAP_APPFONT ( 184 , RSC_CD_TEXTBOX_HEIGHT ) ;
@@ -83,6 +85,7 @@ TabPage TP_DOCINFODESC
};
Edit ED_KEYWORDS
{
+ HelpID = "sfx2:Edit:TP_DOCINFODESC:ED_KEYWORDS";
Border = TRUE ;
Pos = MAP_APPFONT ( 70 , 36 ) ;
Size = MAP_APPFONT ( 184 , RSC_CD_TEXTBOX_HEIGHT ) ;
@@ -98,6 +101,7 @@ TabPage TP_DOCINFODESC
};
MultiLineEdit ED_COMMENT
{
+ HelpID = "sfx2:MultiLineEdit:TP_DOCINFODESC:ED_COMMENT";
Border = TRUE ;
Pos = MAP_APPFONT ( 70 , 51 ) ;
Size = MAP_APPFONT ( 184 , 128 ) ;
@@ -121,6 +125,7 @@ TabPage TP_DOCINFODOC
};
Edit ED_FILE_NAME
{
+ HelpID = "sfx2:Edit:TP_DOCINFODOC:ED_FILE_NAME";
Pos = MAP_APPFONT ( 54 , 12 ) ;
Size = MAP_APPFONT ( 200 , RSC_CD_TEXTBOX_HEIGHT ) ;
Border = TRUE ;
@@ -138,11 +143,13 @@ TabPage TP_DOCINFODOC
};
Edit FT_FILE_SHOW_TYP
{
+ HelpID = "sfx2:Edit:TP_DOCINFODOC:FT_FILE_SHOW_TYP";
Pos = MAP_APPFONT ( 78 , 37 ) ;
Size = MAP_APPFONT ( 106 , RSC_CD_FIXEDTEXT_HEIGHT ) ;
};
CheckBox CB_FILE_READONLY
{
+ HelpID = "sfx2:CheckBox:TP_DOCINFODOC:CB_FILE_READONLY";
Pos = MAP_APPFONT ( 163 , 37 ) ;
Size = MAP_APPFONT ( 91 , RSC_CD_CHECKBOX_HEIGHT ) ;
Text [ en-US ] = "~Read-only" ;
@@ -155,6 +162,7 @@ TabPage TP_DOCINFODOC
};
Edit FT_FILE_VAL
{
+ HelpID = "sfx2:Edit:TP_DOCINFODOC:FT_FILE_VAL";
Pos = MAP_APPFONT ( 78 , 49 ) ;
Size = MAP_APPFONT ( 176 , RSC_CD_FIXEDTEXT_HEIGHT ) ;
};
@@ -166,6 +174,7 @@ TabPage TP_DOCINFODOC
};
Edit FT_FILE_SHOW_SIZE
{
+ HelpID = "sfx2:Edit:TP_DOCINFODOC:FT_FILE_SHOW_SIZE";
Pos = MAP_APPFONT ( 78 , 61 ) ;
Size = MAP_APPFONT ( 176 , RSC_CD_FIXEDTEXT_HEIGHT ) ;
};
@@ -182,6 +191,7 @@ TabPage TP_DOCINFODOC
};
Edit FT_CREATE_VAL
{
+ HelpID = "sfx2:Edit:TP_DOCINFODOC:FT_CREATE_VAL";
Pos = MAP_APPFONT ( 78 , 80 ) ;
Size = MAP_APPFONT ( 176 , RSC_CD_FIXEDTEXT_HEIGHT ) ;
};
@@ -193,6 +203,7 @@ TabPage TP_DOCINFODOC
};
Edit FT_CHANGE_VAL
{
+ HelpID = "sfx2:Edit:TP_DOCINFODOC:FT_CHANGE_VAL";
Pos = MAP_APPFONT ( 78 , 92 ) ;
Size = MAP_APPFONT ( 176 , RSC_CD_FIXEDTEXT_HEIGHT ) ;
};
@@ -204,11 +215,13 @@ TabPage TP_DOCINFODOC
};
Edit FT_SIGNED_VAL
{
+ HelpID = "sfx2:Edit:TP_DOCINFODOC:FT_SIGNED_VAL";
Pos = MAP_APPFONT ( 78 , 104 ) ;
Size = MAP_APPFONT ( 123 , RSC_CD_FIXEDTEXT_HEIGHT ) ;
};
PushButton BTN_SIGNATURE
{
+ HelpID = "sfx2:PushButton:TP_DOCINFODOC:BTN_SIGNATURE";
Pos = MAP_APPFONT ( 204 , 101 ) ;
Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
Text [ en-US ] = "Digital Signature...";
@@ -225,6 +238,7 @@ TabPage TP_DOCINFODOC
};
Edit FT_PRINT_VAL
{
+ HelpID = "sfx2:Edit:TP_DOCINFODOC:FT_PRINT_VAL";
Pos = MAP_APPFONT ( 78 , 116 ) ;
Size = MAP_APPFONT ( 176 , RSC_CD_FIXEDTEXT_HEIGHT ) ;
};
@@ -236,6 +250,7 @@ TabPage TP_DOCINFODOC
};
Edit FT_TIMELOG_VAL
{
+ HelpID = "sfx2:Edit:TP_DOCINFODOC:FT_TIMELOG_VAL";
Pos = MAP_APPFONT ( 78 , 128 ) ;
Size = MAP_APPFONT ( 30 , RSC_CD_FIXEDTEXT_HEIGHT ) ;
};
@@ -247,11 +262,13 @@ TabPage TP_DOCINFODOC
};
Edit FT_DOCNO_VAL
{
+ HelpID = "sfx2:Edit:TP_DOCINFODOC:FT_DOCNO_VAL";
Pos = MAP_APPFONT ( 78 , 140 ) ;
Size = MAP_APPFONT ( 30 , RSC_CD_FIXEDTEXT_HEIGHT ) ;
};
PushButton BTN_DELETE
{
+ HelpID = "sfx2:PushButton:TP_DOCINFODOC:BTN_DELETE";
Pos = MAP_APPFONT ( 204 , 150 ) ;
Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
Hide = TRUE;
@@ -259,6 +276,7 @@ TabPage TP_DOCINFODOC
};
CheckBox CB_USE_USERDATA
{
+ HelpID = "sfx2:CheckBox:TP_DOCINFODOC:CB_USE_USERDATA";
Pos = MAP_APPFONT ( 6 , 152 ) ;
Size = MAP_APPFONT ( 192 , RSC_CD_CHECKBOX_HEIGHT ) ;
Hide = TRUE;
@@ -277,6 +295,7 @@ TabPage TP_DOCINFODOC
};
Edit FT_TEMPL_VAL
{
+ HelpID = "sfx2:Edit:TP_DOCINFODOC:FT_TEMPL_VAL";
Pos = MAP_APPFONT ( 78 , 172 ) ;
Size = MAP_APPFONT ( 180 , RSC_CD_FIXEDTEXT_HEIGHT ) ;
};
@@ -301,6 +320,7 @@ TabPage TP_DOCINFOUSER
};
Edit ED_INFO1
{
+ HelpID = "sfx2:Edit:TP_DOCINFOUSER:ED_INFO1";
Border = TRUE ;
Pos = MAP_APPFONT ( 6 , 17 ) ;
Size = MAP_APPFONT ( 248 , RSC_CD_TEXTBOX_HEIGHT ) ;
@@ -314,6 +334,7 @@ TabPage TP_DOCINFOUSER
};
Edit ED_INFO2
{
+ HelpID = "sfx2:Edit:TP_DOCINFOUSER:ED_INFO2";
Border = TRUE ;
Pos = MAP_APPFONT ( 6 , 43 ) ;
Size = MAP_APPFONT ( 248 , RSC_CD_TEXTBOX_HEIGHT ) ;
@@ -327,6 +348,7 @@ TabPage TP_DOCINFOUSER
};
Edit ED_INFO3
{
+ HelpID = "sfx2:Edit:TP_DOCINFOUSER:ED_INFO3";
Border = TRUE ;
Pos = MAP_APPFONT ( 6 , 69 ) ;
Size = MAP_APPFONT ( 248 , RSC_CD_TEXTBOX_HEIGHT ) ;
@@ -340,6 +362,7 @@ TabPage TP_DOCINFOUSER
};
Edit ED_INFO4
{
+ HelpID = "sfx2:Edit:TP_DOCINFOUSER:ED_INFO4";
Border = TRUE ;
Pos = MAP_APPFONT ( 6 , 95 ) ;
Size = MAP_APPFONT ( 248 , RSC_CD_TEXTBOX_HEIGHT ) ;
@@ -347,6 +370,7 @@ TabPage TP_DOCINFOUSER
};
PushButton BTN_EDITLABEL
{
+ HelpID = "sfx2:PushButton:TP_DOCINFOUSER:BTN_EDITLABEL";
Pos = MAP_APPFONT ( 194 , 165 ) ;
Size = MAP_APPFONT ( 60 , RSC_CD_PUSHBUTTON_HEIGHT ) ;
Text [ en-US ] = "~Info fields..." ;
@@ -362,6 +386,7 @@ TabPage TP_DOCINFORELOAD
Size = MAP_APPFONT ( 260 , 185 ) ;
RadioButton RB_NOAUTOUPDATE
{
+ HelpID = "sfx2:RadioButton:TP_DOCINFORELOAD:RB_NOAUTOUPDATE";
TabStop = TRUE ;
Pos = MAP_APPFONT( COL_0 , ROW_0 ) ;
Size = MAP_APPFONT( COL_7 - COL_1 , RSC_CD_RADIOBUTTON_HEIGHT ) ;
@@ -370,6 +395,7 @@ TabPage TP_DOCINFORELOAD
RadioButton RB_RELOADUPDATE
{
+ HelpID = "sfx2:RadioButton:TP_DOCINFORELOAD:RB_RELOADUPDATE";
TabStop = TRUE ;
Pos = MAP_APPFONT( COL_0, ROW_1 ) ;
Size = MAP_APPFONT( COL_7 - COL_1, RSC_CD_RADIOBUTTON_HEIGHT ) ;
@@ -383,6 +409,7 @@ TabPage TP_DOCINFORELOAD
};
NumericField ED_RELOAD
{
+ HelpID = "sfx2:NumericField:TP_DOCINFORELOAD:ED_RELOAD";
Border = TRUE ;
Pos = MAP_APPFONT ( COL_2 , ROW_2 - ROWDIFF_FT_EDTFLD ) ;
Size = MAP_APPFONT ( WIDTH_2 , RSC_CD_TEXTBOX_HEIGHT ) ;
@@ -403,6 +430,7 @@ TabPage TP_DOCINFORELOAD
RadioButton RB_FORWARDUPDATE
{
+ HelpID = "sfx2:RadioButton:TP_DOCINFORELOAD:RB_FORWARDUPDATE";
TabStop = TRUE ;
Pos = MAP_APPFONT( COL_0, ROW_3 ) ;
Size = MAP_APPFONT( COL_7 - COL_1, RSC_CD_RADIOBUTTON_HEIGHT ) ;
@@ -416,6 +444,7 @@ TabPage TP_DOCINFORELOAD
};
NumericField ED_FORWARD
{
+ HelpID = "sfx2:NumericField:TP_DOCINFORELOAD:ED_FORWARD";
Border = TRUE ;
Pos = MAP_APPFONT ( COL_2 , ROW_4 - ROWDIFF_FT_EDTFLD ) ;
Size = MAP_APPFONT ( WIDTH_2 , RSC_CD_TEXTBOX_HEIGHT ) ;
@@ -441,12 +470,14 @@ TabPage TP_DOCINFORELOAD
};
Edit ED_URL
{
+ HelpID = "sfx2:Edit:TP_DOCINFORELOAD:ED_URL";
Border = TRUE ;
Pos = MAP_APPFONT ( COL_2 , ROW_5 - ROWDIFF_FT_EDTFLD ) ;
Size = MAP_APPFONT ( COL_5 - COL_2 , RSC_CD_TEXTBOX_HEIGHT ) ;
};
PushButton PB_BROWSEURL
{
+ HelpID = "sfx2:PushButton:TP_DOCINFORELOAD:PB_BROWSEURL";
Pos = MAP_APPFONT ( COL_6 , ROW_5 - ROWDIFF_FT_EDTFLD ) ;
Size = MAP_APPFONT ( COL_7 - COL_6 , RSC_CD_PUSHBUTTON_HEIGHT ) ;
Text = "..." ;
@@ -459,6 +490,7 @@ TabPage TP_DOCINFORELOAD
};
ComboBox CB_FRAME
{
+ HelpID = "sfx2:ComboBox:TP_DOCINFORELOAD:CB_FRAME";
Pos = MAP_APPFONT ( COL_2 , ROW_6 - ROWDIFF_FT_EDTFLD ) ;
Size = MAP_APPFONT ( COL_7 - COL_2 , RSC_CD_DROPDOWN_HEIGHT * 10 ) ;
DropDown = TRUE ;
@@ -524,6 +556,7 @@ TabPage TP_CUSTOMPROPERTIES
};
PushButton BTN_ADD
{
+ HelpID = "sfx2:PushButton:TP_CUSTOMPROPERTIES:BTN_ADD";
Pos = MAP_APPFONT( 204 , 165 );
Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT );
Text [ en-US ] = "~Add";
@@ -685,8 +718,6 @@ QueryBox SFX_QB_WRONG_TYPE
Message [ en-US ] = "The value entered does not match the specified type.\nThe value will be stored as text." ;
};
- // SID_DOCINFO -----------------------------------------------------------
-
TabDialog SID_DOCINFO
{
OutputSize = TRUE ;
@@ -718,6 +749,11 @@ TabDialog SID_DOCINFO
Identifier = TP_DOCINFORELOAD ;
Text [ en-US ] = "Internet" ;
};
+ PageItem
+ {
+ Identifier = TP_DOCINFOSECURITY ;
+ Text [ en-US ] = "Security" ;
+ };
};
};
};
@@ -753,6 +789,7 @@ ModalDialog RID_EDIT_DURATIONS
};
CheckBox CB_NEGATIVE
{
+ HelpID = "sfx2:CheckBox:RID_EDIT_DURATIONS:CB_NEGATIVE";
Pos = MAP_APPFONT ( 6 , 21 ) ;
Size = MAP_APPFONT ( 60 , RSC_CD_FIXEDTEXT_HEIGHT ) ;
Text [ en-US ] = "~Negative" ;
@@ -766,6 +803,7 @@ ModalDialog RID_EDIT_DURATIONS
};
NumericField ED_YEAR
{
+ HelpID = "sfx2:NumericField:RID_EDIT_DURATIONS:ED_YEAR";
Border = TRUE ;
Pos = MAP_APPFONT ( 70 , 36 ) ;
Size = MAP_APPFONT ( 40, RSC_CD_TEXTBOX_HEIGHT ) ;
@@ -786,6 +824,7 @@ ModalDialog RID_EDIT_DURATIONS
};
NumericField ED_MONTH
{
+ HelpID = "sfx2:NumericField:RID_EDIT_DURATIONS:ED_MONTH";
Border = TRUE ;
Pos = MAP_APPFONT ( 70 , 50 ) ;
Size = MAP_APPFONT ( 40, RSC_CD_TEXTBOX_HEIGHT ) ;
@@ -806,6 +845,7 @@ ModalDialog RID_EDIT_DURATIONS
};
NumericField ED_DAY
{
+ HelpID = "sfx2:NumericField:RID_EDIT_DURATIONS:ED_DAY";
Border = TRUE ;
Pos = MAP_APPFONT ( 70 , 64 ) ;
Size = MAP_APPFONT ( 40, RSC_CD_TEXTBOX_HEIGHT ) ;
@@ -826,6 +866,7 @@ ModalDialog RID_EDIT_DURATIONS
};
NumericField ED_HOUR
{
+ HelpID = "sfx2:NumericField:RID_EDIT_DURATIONS:ED_HOUR";
Border = TRUE ;
Pos = MAP_APPFONT ( 70 , 78 ) ;
Size = MAP_APPFONT ( 40, RSC_CD_TEXTBOX_HEIGHT ) ;
@@ -846,6 +887,7 @@ ModalDialog RID_EDIT_DURATIONS
};
NumericField ED_MINUTE
{
+ HelpID = "sfx2:NumericField:RID_EDIT_DURATIONS:ED_MINUTE";
Border = TRUE ;
Pos = MAP_APPFONT ( 70, 92) ;
Size = MAP_APPFONT ( 40, RSC_CD_TEXTBOX_HEIGHT ) ;
@@ -866,6 +908,7 @@ ModalDialog RID_EDIT_DURATIONS
};
NumericField ED_SECOND
{
+ HelpID = "sfx2:NumericField:RID_EDIT_DURATIONS:ED_SECOND";
Border = TRUE ;
Pos = MAP_APPFONT ( 70 , 106 ) ;
Size = MAP_APPFONT ( 40, RSC_CD_TEXTBOX_HEIGHT ) ;
@@ -886,6 +929,7 @@ ModalDialog RID_EDIT_DURATIONS
};
NumericField ED_MSECOND
{
+ HelpID = "sfx2:NumericField:RID_EDIT_DURATIONS:ED_MSECOND";
Border = TRUE ;
Pos = MAP_APPFONT ( 70 , 120 ) ;
Size = MAP_APPFONT ( 40, RSC_CD_TEXTBOX_HEIGHT ) ;
diff --git a/sfx2/source/dialog/dinfedt.src b/sfx2/source/dialog/dinfedt.src
index 7f4875487536..110dccf11c40 100644
--- a/sfx2/source/dialog/dinfedt.src
+++ b/sfx2/source/dialog/dinfedt.src
@@ -45,24 +45,28 @@ ModalDialog DLG_DOCINFO_EDT
};
Edit ED_INFO1
{
+ HelpID = "sfx2:Edit:DLG_DOCINFO_EDT:ED_INFO1";
Border = TRUE ;
Pos = MAP_APPFONT ( 12 , 14 ) ;
Size = MAP_APPFONT ( 86 , 12 ) ;
};
Edit ED_INFO2
{
+ HelpID = "sfx2:Edit:DLG_DOCINFO_EDT:ED_INFO2";
Border = TRUE ;
Pos = MAP_APPFONT ( 12 , 29 ) ;
Size = MAP_APPFONT ( 86 , 12 ) ;
};
Edit ED_INFO3
{
+ HelpID = "sfx2:Edit:DLG_DOCINFO_EDT:ED_INFO3";
Border = TRUE ;
Pos = MAP_APPFONT ( 12 , 44 ) ;
Size = MAP_APPFONT ( 86 , 12 ) ;
};
Edit ED_INFO4
{
+ HelpID = "sfx2:Edit:DLG_DOCINFO_EDT:ED_INFO4";
Border = TRUE ;
Pos = MAP_APPFONT ( 12 , 59 ) ;
Size = MAP_APPFONT ( 86 , 12 ) ;
diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx
index 7b4e4289a49c..0864b0e18c2b 100644
--- a/sfx2/source/dialog/dockwin.cxx
+++ b/sfx2/source/dialog/dockwin.cxx
@@ -46,6 +46,7 @@
#include <sfx2/viewsh.hxx>
#include "sfxhelp.hxx"
#include <sfx2/objsh.hxx>
+#include <sfx2/msgpool.hxx>
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
@@ -918,11 +919,23 @@ SfxDockingWindow::SfxDockingWindow( SfxBindings *pBindinx, SfxChildWindow *pCW,
*/
{
- ULONG nId = GetHelpId();
- if ( !nId && pCW )
- nId = pCW->GetType();
- SetHelpId( 0 );
- SetUniqueId( nId );
+ if ( GetHelpId().getLength() )
+ {
+ SetUniqueId( GetHelpId() );
+ SetHelpId("");
+ }
+ else
+ {
+ SfxViewFrame* pViewFrame = pBindings->GetDispatcher()->GetFrame();
+ SfxSlotPool* pSlotPool = pViewFrame->GetObjectShell()->GetModule()->GetSlotPool();
+ const SfxSlot* pSlot = pSlotPool->GetSlot( pCW->GetType() );
+ if ( pSlot )
+ {
+ rtl::OString aCmd("SFXDOCKINGWINDOW_");
+ aCmd += pSlot->GetUnoName();
+ SetUniqueId( aCmd );
+ }
+ }
pImp = new SfxDockingWindow_Impl;
pImp->bConstructed = FALSE;
@@ -960,9 +973,23 @@ SfxDockingWindow::SfxDockingWindow( SfxBindings *pBindinx, SfxChildWindow *pCW,
*/
{
- ULONG nId = GetHelpId();
- SetHelpId(0);
- SetUniqueId( nId );
+ if ( GetHelpId().getLength() )
+ {
+ SetUniqueId( GetHelpId() );
+ SetHelpId("");
+ }
+ else
+ {
+ SfxViewFrame* pViewFrame = pBindings->GetDispatcher()->GetFrame();
+ SfxSlotPool* pSlotPool = pViewFrame->GetObjectShell()->GetModule()->GetSlotPool();
+ const SfxSlot* pSlot = pSlotPool->GetSlot( pCW->GetType() );
+ if ( pSlot )
+ {
+ rtl::OString aCmd("SFXDOCKINGWINDOW_");
+ aCmd += pSlot->GetUnoName();
+ SetUniqueId( aCmd );
+ }
+ }
pImp = new SfxDockingWindow_Impl;
pImp->bConstructed = FALSE;
@@ -1844,15 +1871,15 @@ long SfxDockingWindow::Notify( NotifyEvent& rEvt )
pMgr->Activate_Impl();
Window* pWindow = rEvt.GetWindow();
- ULONG nHelpId = 0;
- while ( !nHelpId && pWindow )
+ rtl::OString sHelpId;
+ while ( !sHelpId.getLength() && pWindow )
{
- nHelpId = pWindow->GetHelpId();
+ sHelpId = pWindow->GetHelpId();
pWindow = pWindow->GetParent();
}
- if ( nHelpId )
- SfxHelp::OpenHelpAgent( &pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame(), nHelpId );
+ if ( sHelpId.getLength() )
+ SfxHelp::OpenHelpAgent( &pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame(), sHelpId );
// In VCL geht Notify zun"achst an das Fenster selbst,
// also base class rufen, sonst erf"ahrt der parent nichts
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index 7d177d0bbfd8..02b9003f59d2 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -79,13 +79,14 @@
#include <unotools/viewoptions.hxx>
#include <unotools/moduleoptions.hxx>
#include <svtools/helpid.hrc>
-#include <svl/pickerhelper.hxx>
#include <comphelper/docpasswordrequest.hxx>
+#include <comphelper/docpasswordhelper.hxx>
#include <ucbhelper/content.hxx>
#include <ucbhelper/commandenvironment.hxx>
#include <comphelper/storagehelper.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <sfx2/app.hxx>
+#include <sfx2/frame.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/docfac.hxx>
#include "openflag.hxx"
@@ -96,7 +97,7 @@
#include "filtergrouping.hxx"
#include <sfx2/request.hxx>
#include "filedlgimpl.hxx"
-
+#include <helpid.hrc>
#include <sfxlocal.hrc>
//-----------------------------------------------------------------------------
@@ -219,55 +220,55 @@ OUString FileDialogHelper_Impl::handleHelpRequested( const FilePickerEvent& aEve
{
//!!! todo: cache the help strings (here or TRA)
- ULONG nHelpId = 0;
+ rtl::OString sHelpId;
// mapping from element id -> help id
switch ( aEvent.ElementId )
{
case ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION :
- nHelpId = HID_FILESAVE_AUTOEXTENSION;
+ sHelpId = HID_FILESAVE_AUTOEXTENSION;
break;
case ExtendedFilePickerElementIds::CHECKBOX_PASSWORD :
- nHelpId = HID_FILESAVE_SAVEWITHPASSWORD;
+ sHelpId = HID_FILESAVE_SAVEWITHPASSWORD;
break;
case ExtendedFilePickerElementIds::CHECKBOX_FILTEROPTIONS :
- nHelpId = HID_FILESAVE_CUSTOMIZEFILTER;
+ sHelpId = HID_FILESAVE_CUSTOMIZEFILTER;
break;
case ExtendedFilePickerElementIds::CHECKBOX_READONLY :
- nHelpId = HID_FILEOPEN_READONLY;
+ sHelpId = HID_FILEOPEN_READONLY;
break;
case ExtendedFilePickerElementIds::CHECKBOX_LINK :
- nHelpId = HID_FILEDLG_LINK_CB;
+ sHelpId = HID_FILEDLG_LINK_CB;
break;
case ExtendedFilePickerElementIds::CHECKBOX_PREVIEW :
- nHelpId = HID_FILEDLG_PREVIEW_CB;
+ sHelpId = HID_FILEDLG_PREVIEW_CB;
break;
case ExtendedFilePickerElementIds::PUSHBUTTON_PLAY :
- nHelpId = HID_FILESAVE_DOPLAY;
+ sHelpId = HID_FILESAVE_DOPLAY;
break;
case ExtendedFilePickerElementIds::LISTBOX_VERSION_LABEL :
case ExtendedFilePickerElementIds::LISTBOX_VERSION :
- nHelpId = HID_FILEOPEN_VERSION;
+ sHelpId = HID_FILEOPEN_VERSION;
break;
case ExtendedFilePickerElementIds::LISTBOX_TEMPLATE_LABEL :
case ExtendedFilePickerElementIds::LISTBOX_TEMPLATE :
- nHelpId = HID_FILESAVE_TEMPLATE;
+ sHelpId = HID_FILESAVE_TEMPLATE;
break;
case ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE_LABEL :
case ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE :
- nHelpId = HID_FILEOPEN_IMAGE_TEMPLATE;
+ sHelpId = HID_FILEOPEN_IMAGE_TEMPLATE;
break;
case ExtendedFilePickerElementIds::CHECKBOX_SELECTION :
- nHelpId = HID_FILESAVE_SELECTION;
+ sHelpId = HID_FILESAVE_SELECTION;
break;
default:
@@ -277,7 +278,7 @@ OUString FileDialogHelper_Impl::handleHelpRequested( const FilePickerEvent& aEve
OUString aHelpText;
Help* pHelp = Application::GetHelp();
if ( pHelp )
- aHelpText = String( pHelp->GetHelpText( nHelpId, NULL ) );
+ aHelpText = String( pHelp->GetHelpText( String( ByteString(sHelpId), RTL_TEXTENCODING_UTF8), NULL ) );
return aHelpText;
}
@@ -465,31 +466,6 @@ sal_Bool FileDialogHelper_Impl::isInOpenMode() const
// ------------------------------------------------------------------------
-namespace {
-
-bool lclCheckODFPasswordCapability( const SfxFilter* pFilter )
-{
- return pFilter && pFilter->IsOwnFormat() && pFilter->UsesStorage() && (pFilter->GetVersion() >= SOFFICE_FILEFORMAT_60);
-}
-
-bool lclCheckMSPasswordCapability( const SfxFilter* pFilter )
-{
- // TODO #i105076# this should be in the filter configuration!!!
- return pFilter && CheckMSPasswordCapabilityForExport( pFilter->GetFilterName() );
-}
-
-bool lclCheckPasswordCapability( const SfxFilter* pFilter )
-{
- return
- lclCheckODFPasswordCapability( pFilter ) ||
- // TODO #i105076# this should be in the filter configuration!!!
- lclCheckMSPasswordCapability( pFilter );
-}
-
-}
-
-// ------------------------------------------------------------------------
-
void FileDialogHelper_Impl::updateFilterOptionsBox()
{
if ( !m_bHaveFilterOptions )
@@ -546,10 +522,30 @@ void FileDialogHelper_Impl::updateSelectionBox()
if ( !mbHasSelectionBox )
return;
- const SfxFilter* pFilter = getCurentSfxFilter();
- mbSelectionFltrEnabled = updateExtendedControl(
- ExtendedFilePickerElementIds::CHECKBOX_SELECTION,
- ( mbSelectionEnabled && pFilter && ( pFilter->GetFilterFlags() & SFX_FILTER_SUPPORTSSELECTION ) != 0 ) );
+ // Does the selection box exist?
+ sal_Bool bSelectionBoxFound = sal_False;
+ uno::Reference< XControlInformation > xCtrlInfo( mxFileDlg, UNO_QUERY );
+ if ( xCtrlInfo.is() )
+ {
+ Sequence< ::rtl::OUString > aCtrlList = xCtrlInfo->getSupportedControls();
+ sal_uInt32 nCount = aCtrlList.getLength();
+ for ( sal_uInt32 nCtrl = 0; nCtrl < nCount; ++nCtrl )
+ if ( aCtrlList[ nCtrl ].equalsAscii("SelectionBox") )
+ {
+ bSelectionBoxFound = sal_False;
+ break;
+ }
+ }
+
+ if ( bSelectionBoxFound )
+ {
+ const SfxFilter* pFilter = getCurentSfxFilter();
+ mbSelectionFltrEnabled = updateExtendedControl(
+ ExtendedFilePickerElementIds::CHECKBOX_SELECTION,
+ ( mbSelectionEnabled && pFilter && ( pFilter->GetFilterFlags() & SFX_FILTER_SUPPORTSSELECTION ) != 0 ) );
+ uno::Reference< XFilePickerControlAccess > xCtrlAccess( mxFileDlg, UNO_QUERY );
+ xCtrlAccess->setValue( ExtendedFilePickerElementIds::CHECKBOX_SELECTION, 0, makeAny( (sal_Bool)mbSelection ) );
+ }
}
// ------------------------------------------------------------------------
@@ -560,9 +556,10 @@ void FileDialogHelper_Impl::enablePasswordBox( sal_Bool bInit )
sal_Bool bWasEnabled = mbIsPwdEnabled;
+ const SfxFilter* pCurrentFilter = getCurentSfxFilter();
mbIsPwdEnabled = updateExtendedControl(
ExtendedFilePickerElementIds::CHECKBOX_PASSWORD,
- lclCheckPasswordCapability( getCurentSfxFilter() )
+ pCurrentFilter && ( pCurrentFilter->GetFilterFlags() & SFX_FILTER_ENCRYPTION )
);
if( bInit )
@@ -1206,7 +1203,7 @@ void SAL_CALL PickerThread_Impl::run()
}
// ------------------------------------------------------------------------
-void FileDialogHelper_Impl::setControlHelpIds( const sal_Int16* _pControlId, const sal_Int32* _pHelpId )
+void FileDialogHelper_Impl::setControlHelpIds( const sal_Int16* _pControlId, const char** _pHelpId )
{
DBG_ASSERT( _pControlId && _pHelpId, "FileDialogHelper_Impl::setControlHelpIds: invalid array pointers!" );
if ( !_pControlId || !_pHelpId )
@@ -1215,17 +1212,16 @@ void FileDialogHelper_Impl::setControlHelpIds( const sal_Int16* _pControlId, con
// forward these ids to the file picker
try
{
- const ::rtl::OUString sHelpIdPrefix( RTL_CONSTASCII_USTRINGPARAM( "HID:" ) );
+ const ::rtl::OUString sHelpIdPrefix( RTL_CONSTASCII_USTRINGPARAM( INET_HID_SCHEME ) );
// the ids for the single controls
uno::Reference< XFilePickerControlAccess > xControlAccess( mxFileDlg, UNO_QUERY );
if ( xControlAccess.is() )
{
while ( *_pControlId )
{
- // calc the help id of the element
+ DBG_ASSERT( INetURLObject( rtl::OStringToOUString( *_pHelpId, RTL_TEXTENCODING_UTF8 ) ).GetProtocol() == INET_PROT_NOT_VALID, "Wrong HelpId!" );
::rtl::OUString sId( sHelpIdPrefix );
- sId += ::rtl::OUString::valueOf( *_pHelpId );
- // set the help id
+ sId += ::rtl::OUString( *_pHelpId, strlen( *_pHelpId ), RTL_TEXTENCODING_UTF8 );
xControlAccess->setValue( *_pControlId, ControlActions::SET_HELP_URL, makeAny( sId ) );
++_pControlId; ++_pHelpId;
@@ -1239,12 +1235,6 @@ void FileDialogHelper_Impl::setControlHelpIds( const sal_Int16* _pControlId, con
}
// ------------------------------------------------------------------------
-void FileDialogHelper_Impl::setDialogHelpId( const sal_Int32 _nHelpId )
-{
- svt::SetDialogHelpId( mxFileDlg, _nHelpId );
-}
-
-// ------------------------------------------------------------------------
IMPL_LINK( FileDialogHelper_Impl, InitControls, void*, NOTINTERESTEDIN )
{
(void)NOTINTERESTEDIN;
@@ -1534,6 +1524,10 @@ ErrCode FileDialogHelper_Impl::execute( SvStringsDtor*& rpURLList,
{
SFX_ITEMSET_ARG( rpSet, pPassItem, SfxStringItem, SID_PASSWORD, FALSE );
mbPwdCheckBoxState = ( pPassItem != NULL );
+
+ // in case the document has password to modify, the dialog should be shown
+ SFX_ITEMSET_ARG( rpSet, pPassToModifyItem, SfxUnoAnyItem, SID_MODIFYPASSWORDINFO, FALSE );
+ mbPwdCheckBoxState |= ( pPassToModifyItem && pPassToModifyItem->GetValue().hasValue() );
}
SFX_ITEMSET_ARG( rpSet, pSelectItem, SfxBoolItem, SID_SELECTION, FALSE );
@@ -1544,6 +1538,9 @@ ErrCode FileDialogHelper_Impl::execute( SvStringsDtor*& rpURLList,
// the password will be set in case user decide so
rpSet->ClearItem( SID_PASSWORD );
+ rpSet->ClearItem( SID_RECOMMENDREADONLY );
+ rpSet->ClearItem( SID_MODIFYPASSWORDINFO );
+
}
if ( mbHasPassword && !mbPwdCheckBoxState )
@@ -1620,13 +1617,15 @@ ErrCode FileDialogHelper_Impl::execute( SvStringsDtor*& rpURLList,
// set the filter
getRealFilter( rFilter );
+ const SfxFilter* pCurrentFilter = getCurentSfxFilter();
+
// fill the rpURLList
- implGetAndCacheFiles(mxFileDlg, rpURLList, getCurentSfxFilter());
+ implGetAndCacheFiles( mxFileDlg, rpURLList, pCurrentFilter );
if ( rpURLList == NULL || rpURLList->GetObject(0) == NULL )
return ERRCODE_ABORT;
// check, wether or not we have to display a password box
- if ( mbHasPassword && mbIsPwdEnabled && xCtrlAccess.is() )
+ if ( pCurrentFilter && mbHasPassword && mbIsPwdEnabled && xCtrlAccess.is() )
{
try
{
@@ -1640,18 +1639,38 @@ ErrCode FileDialogHelper_Impl::execute( SvStringsDtor*& rpURLList,
if( xInteractionHandler.is() )
{
// TODO: need a save way to distinguish MS filters from other filters
- bool bMSType = CheckMSPasswordCapabilityForExport( rFilter );
+ // for now MS-filters are the only alien filters that support encryption
+ sal_Bool bMSType = !pCurrentFilter->IsOwnFormat();
::comphelper::DocPasswordRequestType eType = bMSType ?
::comphelper::DocPasswordRequestType_MS :
::comphelper::DocPasswordRequestType_STANDARD;
- ::comphelper::DocPasswordRequest* pPasswordRequest = new ::comphelper::DocPasswordRequest(
- eType, ::com::sun::star::task::PasswordRequestMode_PASSWORD_CREATE, *(rpURLList->GetObject(0)) );
+ ::rtl::Reference< ::comphelper::DocPasswordRequest > pPasswordRequest( new ::comphelper::DocPasswordRequest( eType, ::com::sun::star::task::PasswordRequestMode_PASSWORD_CREATE, *(rpURLList->GetObject(0)), ( pCurrentFilter->GetFilterFlags() & SFX_FILTER_PASSWORDTOMODIFY ) != 0 ) );
- uno::Reference< com::sun::star::task::XInteractionRequest > rRequest( pPasswordRequest );
+ uno::Reference< com::sun::star::task::XInteractionRequest > rRequest( pPasswordRequest.get() );
xInteractionHandler->handle( rRequest );
if ( pPasswordRequest->isPassword() )
- rpSet->Put( SfxStringItem( SID_PASSWORD, pPasswordRequest->getPassword() ) );
+ {
+ if ( pPasswordRequest->getPassword().getLength() )
+ rpSet->Put( SfxStringItem( SID_PASSWORD, pPasswordRequest->getPassword() ) );
+
+ if ( pPasswordRequest->getRecommendReadOnly() )
+ rpSet->Put( SfxBoolItem( SID_RECOMMENDREADONLY, sal_True ) );
+
+ if ( bMSType )
+ {
+ // the empty password has 0 as Hash
+ sal_Int32 nHash = SfxMedium::CreatePasswordToModifyHash( pPasswordRequest->getPasswordToModify(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.TextDocument" ) ).equals( pCurrentFilter->GetServiceName() ) );
+ if ( nHash )
+ rpSet->Put( SfxUnoAnyItem( SID_MODIFYPASSWORDINFO, uno::makeAny( nHash ) ) );
+ }
+ else
+ {
+ uno::Sequence< beans::PropertyValue > aModifyPasswordInfo = ::comphelper::DocPasswordHelper::GenerateNewModifyPasswordInfo( pPasswordRequest->getPasswordToModify() );
+ if ( aModifyPasswordInfo.getLength() )
+ rpSet->Put( SfxUnoAnyItem( SID_MODIFYPASSWORDINFO, uno::makeAny( aModifyPasswordInfo ) ) );
+ }
+ }
else
return ERRCODE_ABORT;
}
@@ -1927,7 +1946,7 @@ void FileDialogHelper_Impl::addGraphicFilter()
}
}
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
if ( aExtensions.Len() > 240 )
aExtensions = DEFINE_CONST_UNICODE( FILEDIALOG_FILTER_ALL );
#endif
@@ -2319,9 +2338,6 @@ void FileDialogHelper_Impl::SetContext( FileDialogHelper::Context _eNewContext )
const OUString* pConfigId = GetLastFilterConfigId( _eNewContext );
if( pConfigId )
LoadLastUsedFilter( *pConfigId );
-
-// if( nNewHelpId )
-// this->setDialogHelpId( nNewHelpId );
}
// ------------------------------------------------------------------------
@@ -2467,17 +2483,11 @@ void FileDialogHelper::CreateMatcher( const String& rFactory )
}
// ------------------------------------------------------------------------
-void FileDialogHelper::SetControlHelpIds( const sal_Int16* _pControlId, const sal_Int32* _pHelpId )
+void FileDialogHelper::SetControlHelpIds( const sal_Int16* _pControlId, const char** _pHelpId )
{
mpImp->setControlHelpIds( _pControlId, _pHelpId );
}
-// ------------------------------------------------------------------------
-void FileDialogHelper::SetDialogHelpId( const sal_Int32 _nHelpId )
-{
- mpImp->setDialogHelpId( _nHelpId );
-}
-
void FileDialogHelper::SetContext( Context _eNewContext )
{
mpImp->SetContext( _eNewContext );
@@ -2721,7 +2731,7 @@ void FileDialogHelper::SetDisplayDirectory( const String& _rPath )
if ( sFolder.getLength() == 0 )
{
// _rPath is not a valid path -> fallback to home directory
- NAMESPACE_VOS( OSecurity ) aSecurity;
+ vos:: OSecurity aSecurity;
aSecurity.getHomeDir( sFolder );
}
mpImp->displayFolder( sFolder );
diff --git a/sfx2/source/dialog/filedlgimpl.hxx b/sfx2/source/dialog/filedlgimpl.hxx
index 6965e14ae84d..91190b575e1c 100644
--- a/sfx2/source/dialog/filedlgimpl.hxx
+++ b/sfx2/source/dialog/filedlgimpl.hxx
@@ -142,8 +142,7 @@ namespace sfx2
void correctVirtualDialogType();
- void setControlHelpIds( const sal_Int16* _pControlId, const sal_Int32* _pHelpId );
- void setDialogHelpId( const sal_Int32 _nHelpId );
+ void setControlHelpIds( const sal_Int16* _pControlId, const char** _pHelpId );
sal_Bool CheckFilterOptionsCapability( const SfxFilter* _pFilter );
diff --git a/sfx2/source/dialog/makefile.mk b/sfx2/source/dialog/makefile.mk
index 3d0c53cdb932..4c56cd683e34 100644
--- a/sfx2/source/dialog/makefile.mk
+++ b/sfx2/source/dialog/makefile.mk
@@ -69,6 +69,7 @@ SLOFILES =\
$(SLO)$/tplcitem.obj \
$(SLO)$/tplpitem.obj \
$(SLO)$/versdlg.obj \
+ $(SLO)$/securitypage.obj \
$(SLO)$/titledockwin.obj
SRS1NAME=$(TARGET)
@@ -87,6 +88,7 @@ SRC1FILES =\
versdlg.src \
printopt.src \
srchdlg.src \
+ securitypage.src \
titledockwin.src \
taskpane.src
diff --git a/sfx2/source/dialog/mgetempl.src b/sfx2/source/dialog/mgetempl.src
index f07d0873e454..bfa3948d90ac 100644
--- a/sfx2/source/dialog/mgetempl.src
+++ b/sfx2/source/dialog/mgetempl.src
@@ -44,12 +44,14 @@ TabPage TP_MANAGE_STYLES
};
Edit ED_NAME
{
+ HelpID = "sfx2:Edit:TP_MANAGE_STYLES:ED_NAME";
Border = TRUE ;
Pos = MAP_APPFONT ( 70 , 6 ) ;
Size = MAP_APPFONT ( 184 , 12 ) ;
};
CheckBox CB_AUTO
{
+ HelpID = "sfx2:CheckBox:TP_MANAGE_STYLES:CB_AUTO";
Pos = MAP_APPFONT ( 164 , 8 ) ;
Size = MAP_APPFONT ( 90 , 10 ) ;
Hide = TRUE ;
@@ -63,6 +65,7 @@ TabPage TP_MANAGE_STYLES
};
ListBox LB_NEXT
{
+ HelpID = "sfx2:ListBox:TP_MANAGE_STYLES:LB_NEXT";
Border = TRUE ;
Pos = MAP_APPFONT ( 70 , 24 ) ;
Size = MAP_APPFONT ( 184 , 65 ) ;
@@ -79,6 +82,7 @@ TabPage TP_MANAGE_STYLES
};
ListBox LB_BASE
{
+ HelpID = "sfx2:ListBox:TP_MANAGE_STYLES:LB_BASE";
Border = TRUE ;
Pos = MAP_APPFONT ( 70 , 42 ) ;
Size = MAP_APPFONT ( 184 , 65 ) ;
@@ -93,6 +97,7 @@ TabPage TP_MANAGE_STYLES
};
ListBox LB_REGION
{
+ HelpID = "sfx2:ListBox:TP_MANAGE_STYLES:LB_REGION";
Border = TRUE ;
Pos = MAP_APPFONT ( 70 , 60 ) ;
Size = MAP_APPFONT ( 184 , 64 ) ;
@@ -107,6 +112,7 @@ TabPage TP_MANAGE_STYLES
};
MultiLineEdit ED_DESC
{
+ HelpID = "sfx2:MultiLineEdit:TP_MANAGE_STYLES:ED_DESC";
Pos = MAP_APPFONT ( 12 , 88 ) ;
Size = MAP_APPFONT ( 236 , 85 ) ;
ReadOnly = TRUE ;
diff --git a/sfx2/source/dialog/newstyle.src b/sfx2/source/dialog/newstyle.src
index fa5fa62a2ee4..b5954028779b 100644
--- a/sfx2/source/dialog/newstyle.src
+++ b/sfx2/source/dialog/newstyle.src
@@ -28,10 +28,11 @@
#include <sfx2/sfx.hrc>
#include "dialog.hrc"
#include "newstyle.hrc"
+#include "sfx2/sfxcommands.h"
ModalDialog DLG_NEW_STYLE_BY_EXAMPLE
{
- HelpId = SID_STYLE_NEW_BY_EXAMPLE ;
+ HelpId = CMD_SID_STYLE_NEW_BY_EXAMPLE ;
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 177 , 112 ) ;
@@ -45,6 +46,7 @@ ModalDialog DLG_NEW_STYLE_BY_EXAMPLE
};
ComboBox LB_COL
{
+ HelpID = "sfx2:ComboBox:DLG_NEW_STYLE_BY_EXAMPLE:LB_COL";
Pos = MAP_APPFONT ( 12 , 14 ) ;
Size = MAP_APPFONT ( 94 , 92 ) ;
TabStop = TRUE ;
diff --git a/sfx2/source/dialog/passwd.src b/sfx2/source/dialog/passwd.src
index fc58ecfda219..79cbb382ad36 100644
--- a/sfx2/source/dialog/passwd.src
+++ b/sfx2/source/dialog/passwd.src
@@ -47,6 +47,7 @@ ModalDialog DLG_PASSWD
};
Edit ED_PASSWD_USER
{
+ HelpID = "sfx2:Edit:DLG_PASSWD:ED_PASSWD_USER";
Border = TRUE;
Pos = MAP_APPFONT( 57, 14 );
Size = MAP_APPFONT( 75, 12 );
@@ -59,6 +60,7 @@ ModalDialog DLG_PASSWD
};
Edit ED_PASSWD_PASSWORD
{
+ HelpID = "sfx2:Edit:DLG_PASSWD:ED_PASSWD_PASSWORD";
Border = TRUE;
PassWord = TRUE;
Pos = MAP_APPFONT( 57, 29 );
@@ -72,6 +74,7 @@ ModalDialog DLG_PASSWD
};
Edit ED_PASSWD_CONFIRM
{
+ HelpID = "sfx2:Edit:DLG_PASSWD:ED_PASSWD_CONFIRM";
Border = TRUE;
PassWord = TRUE;
Pos = MAP_APPFONT( 57, 44 );
diff --git a/sfx2/source/dialog/printopt.src b/sfx2/source/dialog/printopt.src
index 4217539a3af8..01650f3e9275 100644
--- a/sfx2/source/dialog/printopt.src
+++ b/sfx2/source/dialog/printopt.src
@@ -60,6 +60,7 @@ TabPage TP_COMMONPRINTOPTIONS
};
RadioButton RB_PRINTEROUTPUT
{
+ HelpID = "sfx2:RadioButton:TP_COMMONPRINTOPTIONS:RB_PRINTEROUTPUT";
TabStop = TRUE;
Pos = MAP_APPFONT ( 81, 14 ) ;
Size = MAP_APPFONT ( 60, 10 ) ;
@@ -67,6 +68,7 @@ TabPage TP_COMMONPRINTOPTIONS
};
RadioButton RB_PRINTFILEOUTPUT
{
+ HelpID = "sfx2:RadioButton:TP_COMMONPRINTOPTIONS:RB_PRINTFILEOUTPUT";
TabStop = TRUE;
Pos = MAP_APPFONT ( 142, 14 ) ;
Size = MAP_APPFONT ( 100, 10 ) ;
@@ -83,6 +85,7 @@ TabPage TP_COMMONPRINTOPTIONS
CheckBox CB_REDUCETRANSPARENCY
{
+ HelpID = "sfx2:CheckBox:TP_COMMONPRINTOPTIONS:CB_REDUCETRANSPARENCY";
TabStop = TRUE;
Pos = MAP_APPFONT ( 18, 38 ) ;
Size = MAP_APPFONT ( 115, 10 ) ;
@@ -90,6 +93,7 @@ TabPage TP_COMMONPRINTOPTIONS
};
RadioButton RB_REDUCETRANSPARENCY_AUTO
{
+ HelpID = "sfx2:RadioButton:TP_COMMONPRINTOPTIONS:RB_REDUCETRANSPARENCY_AUTO";
TabStop = TRUE;
Pos = MAP_APPFONT ( 28, 51 ) ;
Size = MAP_APPFONT ( 105, 10 ) ;
@@ -97,6 +101,7 @@ TabPage TP_COMMONPRINTOPTIONS
};
RadioButton RB_REDUCETRANSPARENCY_NONE
{
+ HelpID = "sfx2:RadioButton:TP_COMMONPRINTOPTIONS:RB_REDUCETRANSPARENCY_NONE";
TabStop = TRUE;
Pos = MAP_APPFONT ( 28, 64 ) ;
Size = MAP_APPFONT ( 105, 10 ) ;
@@ -107,6 +112,7 @@ TabPage TP_COMMONPRINTOPTIONS
CheckBox CB_REDUCEGRADIENTS
{
+ HelpID = "sfx2:CheckBox:TP_COMMONPRINTOPTIONS:CB_REDUCEGRADIENTS";
TabStop = TRUE;
Pos = MAP_APPFONT ( 136, 38 ) ;
Size = MAP_APPFONT ( 121, 10 ) ;
@@ -114,6 +120,7 @@ TabPage TP_COMMONPRINTOPTIONS
};
RadioButton RB_REDUCEGRADIENTS_STRIPES
{
+ HelpID = "sfx2:RadioButton:TP_COMMONPRINTOPTIONS:RB_REDUCEGRADIENTS_STRIPES";
TabStop = TRUE;
Pos = MAP_APPFONT ( 146, 51 ) ;
Size = MAP_APPFONT ( 77, 10 ) ;
@@ -121,6 +128,7 @@ TabPage TP_COMMONPRINTOPTIONS
};
NumericField NF_REDUCEGRADIENTS_STEPCOUNT
{
+ HelpID = "sfx2:NumericField:TP_COMMONPRINTOPTIONS:NF_REDUCEGRADIENTS_STEPCOUNT";
TabStop = TRUE;
Border = TRUE ;
Pos = MAP_APPFONT ( 224, 49 ) ;
@@ -132,6 +140,7 @@ TabPage TP_COMMONPRINTOPTIONS
};
RadioButton RB_REDUCEGRADIENTS_COLOR
{
+ HelpID = "sfx2:RadioButton:TP_COMMONPRINTOPTIONS:RB_REDUCEGRADIENTS_COLOR";
TabStop = TRUE;
Pos = MAP_APPFONT ( 146, 64 ) ;
Size = MAP_APPFONT ( 108, 10 ) ;
@@ -142,6 +151,7 @@ TabPage TP_COMMONPRINTOPTIONS
CheckBox CB_REDUCEBITMAPS
{
+ HelpID = "sfx2:CheckBox:TP_COMMONPRINTOPTIONS:CB_REDUCEBITMAPS";
TabStop = TRUE;
Pos = MAP_APPFONT ( 18, 80 ) ;
Size = MAP_APPFONT ( 115, 10 ) ;
@@ -149,6 +159,7 @@ TabPage TP_COMMONPRINTOPTIONS
};
RadioButton RB_REDUCEBITMAPS_OPTIMAL
{
+ HelpID = "sfx2:RadioButton:TP_COMMONPRINTOPTIONS:RB_REDUCEBITMAPS_OPTIMAL";
TabStop = TRUE;
Pos = MAP_APPFONT ( 28, 93 ) ;
Size = MAP_APPFONT ( 226, 10 ) ;
@@ -156,6 +167,7 @@ TabPage TP_COMMONPRINTOPTIONS
};
RadioButton RB_REDUCEBITMAPS_NORMAL
{
+ HelpID = "sfx2:RadioButton:TP_COMMONPRINTOPTIONS:RB_REDUCEBITMAPS_NORMAL";
TabStop = TRUE;
Pos = MAP_APPFONT ( 28, 106 ) ;
Size = MAP_APPFONT ( 226, 10 ) ;
@@ -163,6 +175,7 @@ TabPage TP_COMMONPRINTOPTIONS
};
RadioButton RB_REDUCEBITMAPS_RESOLUTION
{
+ HelpID = "sfx2:RadioButton:TP_COMMONPRINTOPTIONS:RB_REDUCEBITMAPS_RESOLUTION";
TabStop = TRUE;
Pos = MAP_APPFONT ( 28, 119 ) ;
Size = MAP_APPFONT ( 52, 10 ) ;
@@ -170,6 +183,7 @@ TabPage TP_COMMONPRINTOPTIONS
};
ListBox LB_REDUCEBITMAPS_RESOLUTION
{
+ HelpID = "sfx2:ListBox:TP_COMMONPRINTOPTIONS:LB_REDUCEBITMAPS_RESOLUTION";
TabStop = TRUE;
Border = TRUE ;
Pos = MAP_APPFONT ( 81, 117 ) ;
@@ -188,6 +202,7 @@ TabPage TP_COMMONPRINTOPTIONS
};
CheckBox CB_REDUCEBITMAPS_TRANSPARENCY
{
+ HelpID = "sfx2:CheckBox:TP_COMMONPRINTOPTIONS:CB_REDUCEBITMAPS_TRANSPARENCY";
TabStop = TRUE;
Pos = MAP_APPFONT ( 28, 132 ) ;
Size = MAP_APPFONT ( 226, 10 ) ;
@@ -198,6 +213,7 @@ TabPage TP_COMMONPRINTOPTIONS
CheckBox CB_CONVERTTOGREYSCALES
{
+ HelpID = "sfx2:CheckBox:TP_COMMONPRINTOPTIONS:CB_CONVERTTOGREYSCALES";
TabStop = TRUE;
Pos = MAP_APPFONT ( 136, 80 ) ;
Size = MAP_APPFONT ( 123, 10 ) ;
@@ -214,6 +230,7 @@ TabPage TP_COMMONPRINTOPTIONS
};
CheckBox CB_PAPERSIZE
{
+ HelpID = "sfx2:CheckBox:TP_COMMONPRINTOPTIONS:CB_PAPERSIZE";
TabStop = TRUE;
Pos = MAP_APPFONT ( 12, 159 ) ;
Size = MAP_APPFONT ( 123, 10 ) ;
@@ -221,6 +238,7 @@ TabPage TP_COMMONPRINTOPTIONS
};
CheckBox CB_PAPERORIENTATION
{
+ HelpID = "sfx2:CheckBox:TP_COMMONPRINTOPTIONS:CB_PAPERORIENTATION";
TabStop = TRUE;
Pos = MAP_APPFONT ( 12, 172 ) ;
Size = MAP_APPFONT ( 123 , 10 ) ;
@@ -228,6 +246,7 @@ TabPage TP_COMMONPRINTOPTIONS
};
CheckBox CB_TRANSPARENCY
{
+ HelpID = "sfx2:CheckBox:TP_COMMONPRINTOPTIONS:CB_TRANSPARENCY";
TabStop = TRUE;
Pos = MAP_APPFONT ( 136, 159 ) ;
Size = MAP_APPFONT ( 123, 10 ) ;
@@ -241,6 +260,7 @@ TabPage TP_COMMONPRINTOPTIONS
ModalDialog RID_WARN_PRINTTRANSPARENCY
{
+ HelpID = "sfx2:ModalDialog:RID_WARN_PRINTTRANSPARENCY";
OutputSize = TRUE ;
Size = MAP_APPFONT ( 195 , 85 ) ;
Text [ en-US ] = "Warning" ;
@@ -266,6 +286,7 @@ ModalDialog RID_WARN_PRINTTRANSPARENCY
};
PushButton BTN_PRINTTRANS_NO
{
+ HelpID = "sfx2:PushButton:RID_WARN_PRINTTRANSPARENCY:BTN_PRINTTRANS_NO";
Pos = MAP_APPFONT ( 68 , 48 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~No" ;
@@ -278,6 +299,7 @@ ModalDialog RID_WARN_PRINTTRANSPARENCY
};
CheckBox CBX_NOPRINTTRANSWARN
{
+ HelpID = "sfx2:CheckBox:RID_WARN_PRINTTRANSPARENCY:CBX_NOPRINTTRANSWARN";
Pos = MAP_APPFONT ( 6 , 68 ) ;
Size = MAP_APPFONT ( 183 , 10 ) ;
Text [ en-US ] = "~Do not show warning again" ;
diff --git a/sfx2/source/dialog/recfloat.src b/sfx2/source/dialog/recfloat.src
index 5bdde1f57ab6..d71270d1e312 100644
--- a/sfx2/source/dialog/recfloat.src
+++ b/sfx2/source/dialog/recfloat.src
@@ -34,6 +34,7 @@
FloatingWindow SID_RECORDING_FLOATWINDOW
{
+ HelpID = "sfx2:FloatingWindow:SID_RECORDING_FLOATWINDOW";
Moveable = TRUE ;
Closeable = TRUE ;
Hide = TRUE ;
diff --git a/sfx2/source/dialog/securitypage.cxx b/sfx2/source/dialog/securitypage.cxx
new file mode 100644
index 000000000000..2ac8f6a43fee
--- /dev/null
+++ b/sfx2/source/dialog/securitypage.cxx
@@ -0,0 +1,553 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_sfx2.hxx"
+
+#include "sfx2/securitypage.hxx"
+
+#include "securitypage.hrc"
+#include "sfxresid.hxx"
+
+#include <sfx2/sfx.hrc>
+#include <sfx2/sfxsids.hrc>
+#include <sfx2/objsh.hxx>
+#include <sfx2/viewsh.hxx>
+#include <sfx2/dispatch.hxx>
+#include <sfx2/passwd.hxx>
+
+#include <vcl/button.hxx>
+#include <vcl/edit.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/msgbox.hxx>
+#include <svl/eitem.hxx>
+#include <svl/poolitem.hxx>
+#include <svl/intitem.hxx>
+#include <svl/PasswordHelper.hxx>
+#include <svtools/xwindowitem.hxx>
+
+
+using namespace ::com::sun::star;
+
+//////////////////////////////////////////////////////////////////////
+
+
+namespace
+{
+ enum RedliningMode { RL_NONE, RL_WRITER, RL_CALC };
+ enum RedlineFunc { RF_ON, RF_PROTECT };
+
+/*
+ bool QueryIsEnabled( USHORT _nSlot )
+ {
+ bool bRes = false;
+ SfxViewShell* pViewSh = SfxViewShell::Current();
+ if (pViewSh)
+ {
+ const SfxPoolItem* pItem;
+ SfxDispatcher* pDisp = pViewSh->GetDispatcher();
+ SfxItemState eState = pDisp->QueryState( _nSlot, pItem );
+ bRes = (eState & SFX_ITEM_DISABLED) == 0;
+ }
+ return bRes;
+ }
+*/
+
+ bool QueryState( USHORT _nSlot, bool& _rValue )
+ {
+ bool bRet = false;
+ SfxViewShell* pViewSh = SfxViewShell::Current();
+ if (pViewSh)
+ {
+ const SfxPoolItem* pItem;
+ SfxDispatcher* pDisp = pViewSh->GetDispatcher();
+ SfxItemState nState = pDisp->QueryState( _nSlot, pItem );
+ bRet = SFX_ITEM_AVAILABLE <= nState;
+ if (bRet)
+ _rValue = ( static_cast< const SfxBoolItem* >( pItem ) )->GetValue();
+ }
+ return bRet;
+ }
+
+
+ bool QueryRecordChangesProtectionState( RedliningMode _eMode, bool& _rValue )
+ {
+ bool bRet = false;
+ if (_eMode != RL_NONE)
+ {
+ USHORT nSlot = _eMode == RL_WRITER ? FN_REDLINE_PROTECT : SID_CHG_PROTECT;
+ bRet = QueryState( nSlot, _rValue );
+ }
+ return bRet;
+ }
+
+
+ bool QueryRecordChangesState( RedliningMode _eMode, bool& _rValue )
+ {
+ bool bRet = false;
+ if (_eMode != RL_NONE)
+ {
+ USHORT nSlot = _eMode == RL_WRITER ? FN_REDLINE_ON : FID_CHG_RECORD;
+ bRet = QueryState( nSlot, _rValue );
+ }
+ return bRet;
+ }
+}
+
+
+//////////////////////////////////////////////////////////////////////
+
+
+static short lcl_GetPassword(
+ Window *pParent,
+ bool bProtect,
+ /*out*/String &rPassword )
+{
+ bool bRes = false;
+ SfxPasswordDialog aPasswdDlg( pParent );
+ const String aTitle( SfxResId( bProtect ? RID_SFX_PROTECT_RECORDS : RID_SFX_UNPROTECT_RECORDS ) );
+ aPasswdDlg.SetText( aTitle );
+ aPasswdDlg.SetMinLen( 1 );
+ if (bProtect)
+ aPasswdDlg.ShowExtras( SHOWEXTRAS_CONFIRM );
+ if (RET_OK == aPasswdDlg.Execute() && aPasswdDlg.GetPassword().Len() > 0)
+ {
+ rPassword = aPasswdDlg.GetPassword();
+ bRes = true;
+ }
+ return bRes;
+}
+
+
+static bool lcl_IsPasswordCorrect( const String &rPassword )
+{
+ bool bRes = false;
+
+ SfxObjectShell* pCurDocShell = SfxObjectShell::Current();
+ uno::Sequence< sal_Int8 > aPasswordHash;
+ pCurDocShell->GetProtectionHash( aPasswordHash );
+
+ // check if supplied password was correct
+ uno::Sequence< sal_Int8 > aNewPasswd( aPasswordHash );
+ SvPasswordHelper::GetHashPassword( aNewPasswd, rPassword );
+ if (SvPasswordHelper::CompareHashPassword( aPasswordHash, rPassword ))
+ bRes = true; // password was correct
+ else
+ InfoBox( NULL, String( SfxResId( RID_SFX_INCORRECT_PASSWORD ) ) ).Execute();
+
+ return bRes;
+}
+
+
+//////////////////////////////////////////////////////////////////////
+
+
+struct SfxSecurityPage_Impl
+{
+ SfxSecurityPage & m_rMyTabPage;
+
+ FixedLine m_aNewPasswordToOpenFL;
+ FixedText m_aNewPasswordToOpenFT;
+ Edit m_aNewPasswordToOpenED;
+ FixedText m_aConfirmPasswordToOpenFT;
+ Edit m_aConfirmPasswordToOpenED;
+ FixedText m_aNewPasswordInfoFT;
+
+ FixedLine m_aNewPasswordToModifyFL;
+ FixedText m_aNewPasswordToModifyFT;
+ Edit m_aNewPasswordToModifyED;
+ FixedText m_aConfirmPasswordToModifyFT;
+ Edit m_aConfirmPasswordToModifyED;
+
+ FixedLine m_aOptionsFL;
+ CheckBox m_aOpenReadonlyCB;
+ CheckBox m_aRecordChangesCB; // for record changes
+ PushButton m_aChangeProtectionPB; // for record changes
+ String m_aProtectSTR; // for record changes
+ String m_aUnProtectSTR; // for record changes
+ RedliningMode m_eRedlingMode; // for record changes
+
+ bool m_bOrigPasswordIsConfirmed;
+ bool m_bNewPasswordIsValid;
+ String m_aNewPassword;
+
+ String m_aEndRedliningWarning;
+ bool m_bEndRedliningWarningDone;
+
+ DECL_LINK( RecordChangesCBToggleHdl, void* );
+ DECL_LINK( ChangeProtectionPBHdl, void* );
+
+ SfxSecurityPage_Impl( SfxSecurityPage &rDlg, const SfxItemSet &rItemSet );
+ ~SfxSecurityPage_Impl();
+
+ BOOL FillItemSet_Impl( SfxItemSet & );
+ void Reset_Impl( const SfxItemSet & );
+};
+
+
+SfxSecurityPage_Impl::SfxSecurityPage_Impl( SfxSecurityPage &rTabPage, const SfxItemSet & ) :
+ m_rMyTabPage (rTabPage),
+ m_aNewPasswordToOpenFL (&rTabPage, SfxResId( PASSWORD_TO_OPEN_FL ) ),
+ m_aNewPasswordToOpenFT (&rTabPage, SfxResId( PASSWORD_TO_OPEN_FT ) ),
+ m_aNewPasswordToOpenED (&rTabPage, SfxResId( PASSWORD_TO_OPEN_ED ) ),
+ m_aConfirmPasswordToOpenFT (&rTabPage, SfxResId( CONFIRM_PASSWORD_TO_OPEN_FT ) ),
+ m_aConfirmPasswordToOpenED (&rTabPage, SfxResId( CONFIRM_PASSWORD_TO_OPEN_ED ) ),
+ m_aNewPasswordInfoFT (&rTabPage, SfxResId( PASSWORD_INFO_FT ) ),
+ m_aNewPasswordToModifyFL (&rTabPage, SfxResId( PASSWORD_TO_MODIFY_FL ) ),
+ m_aNewPasswordToModifyFT (&rTabPage, SfxResId( PASSWORD_TO_MODIFY_FT ) ),
+ m_aNewPasswordToModifyED (&rTabPage, SfxResId( PASSWORD_TO_MODIFY_ED ) ),
+ m_aConfirmPasswordToModifyFT (&rTabPage, SfxResId( CONFIRM_PASSWORD_TO_MODIFY_FT ) ),
+ m_aConfirmPasswordToModifyED (&rTabPage, SfxResId( CONFIRM_PASSWORD_TO_MODIFY_ED ) ),
+ m_aOptionsFL (&rTabPage, SfxResId( OPTIONS_FL ) ),
+ m_aOpenReadonlyCB (&rTabPage, SfxResId( OPEN_READONLY_CB ) ),
+ m_aRecordChangesCB (&rTabPage, SfxResId( RECORD_CHANGES_CB ) ),
+ m_aChangeProtectionPB (&rTabPage, SfxResId( CHANGE_PROTECTION_PB ) ),
+ m_aProtectSTR ( SfxResId( STR_PROTECT ) ),
+ m_aUnProtectSTR ( SfxResId( STR_UNPROTECT ) ),
+ m_eRedlingMode ( RL_NONE ),
+ m_bOrigPasswordIsConfirmed ( false ),
+ m_bNewPasswordIsValid ( false ),
+ m_aEndRedliningWarning ( SfxResId( STR_END_REDLINING_WARNING ) ),
+ m_bEndRedliningWarningDone ( false )
+{
+ m_aChangeProtectionPB.SetText( m_aProtectSTR );
+ // adjust button width if necessary
+ long nBtnTextWidth = 0;
+ long nTemp = m_aChangeProtectionPB.GetCtrlTextWidth( m_aChangeProtectionPB.GetText() );
+ if (nTemp > nBtnTextWidth)
+ nBtnTextWidth = nTemp;
+
+ // force toggle hdl called before visual change of checkbox
+ m_aRecordChangesCB.SetStyle( m_aRecordChangesCB.GetStyle() | WB_EARLYTOGGLE );
+ m_aRecordChangesCB.SetToggleHdl( LINK( this, SfxSecurityPage_Impl, RecordChangesCBToggleHdl ) );
+ m_aChangeProtectionPB.SetClickHdl( LINK( this, SfxSecurityPage_Impl, ChangeProtectionPBHdl ) );
+
+
+ // #i112277: for the time being (OOO 3.3) the following options should not
+ // be available. In the long run however it is planned to implement the yet
+ // missing functionality. Thus now we hide them and move the remaining ones up.
+ m_aNewPasswordToOpenFL.Hide();
+ m_aNewPasswordToOpenFT.Hide();
+ m_aNewPasswordToOpenED.Hide();
+ m_aConfirmPasswordToOpenFT.Hide();
+ m_aConfirmPasswordToOpenED.Hide();
+ m_aNewPasswordInfoFT.Hide();
+ m_aNewPasswordToModifyFL.Hide();
+ m_aNewPasswordToModifyFT.Hide();
+ m_aNewPasswordToModifyED.Hide();
+ m_aConfirmPasswordToModifyFT.Hide();
+ m_aConfirmPasswordToModifyED.Hide();
+ const long nDelta = m_aOptionsFL.GetPosPixel().Y() - m_aNewPasswordToOpenFL.GetPosPixel().Y();
+ Point aPos;
+ aPos = m_aOptionsFL.GetPosPixel();
+ aPos.Y() -= nDelta;
+ m_aOptionsFL.SetPosPixel( aPos );
+ aPos = m_aOpenReadonlyCB.GetPosPixel();
+ aPos.Y() -= nDelta;
+ m_aOpenReadonlyCB.SetPosPixel( aPos );
+ aPos = m_aRecordChangesCB.GetPosPixel();
+ aPos.Y() -= nDelta;
+ m_aRecordChangesCB.SetPosPixel( aPos );
+ aPos = m_aChangeProtectionPB.GetPosPixel();
+ aPos.Y() -= nDelta;
+ m_aChangeProtectionPB.SetPosPixel( aPos );
+}
+
+
+SfxSecurityPage_Impl::~SfxSecurityPage_Impl()
+{
+}
+
+
+BOOL SfxSecurityPage_Impl::FillItemSet_Impl( SfxItemSet & )
+{
+ bool bModified = false;
+
+ SfxObjectShell* pCurDocShell = SfxObjectShell::Current();
+ if (pCurDocShell&& !pCurDocShell->IsReadOnly())
+ {
+ if (m_eRedlingMode != RL_NONE )
+ {
+ const bool bDoRecordChanges = m_aRecordChangesCB.IsChecked();
+ const bool bDoChangeProtection = m_aChangeProtectionPB.GetText() != m_aProtectSTR;
+
+ // sanity checks
+ DBG_ASSERT( bDoRecordChanges || !bDoChangeProtection, "no change recording should imply no change protection" );
+ DBG_ASSERT( bDoChangeProtection || !bDoRecordChanges, "no change protection should imply no change recording" );
+ DBG_ASSERT( !bDoChangeProtection || m_aNewPassword.Len() > 0, "change protection should imply password length is > 0" );
+ DBG_ASSERT( bDoChangeProtection || m_aNewPassword.Len() == 0, "no change protection should imply password length is 0" );
+
+ // change recording
+ if (bDoRecordChanges != pCurDocShell->IsChangeRecording())
+ {
+ pCurDocShell->SetChangeRecording( bDoRecordChanges );
+ bModified = true;
+ }
+
+ // change record protection
+ if (m_bNewPasswordIsValid &&
+ bDoChangeProtection != pCurDocShell->HasChangeRecordProtection())
+ {
+ DBG_ASSERT( !bDoChangeProtection || bDoRecordChanges,
+ "change protection requires record changes to be active!" );
+ pCurDocShell->SetProtectionPassword( m_aNewPassword );
+ bModified = true;
+ }
+ }
+
+ // open read-only?
+ const sal_Bool bDoOpenReadonly = m_aOpenReadonlyCB.IsChecked();
+ if (pCurDocShell->HasSecurityOptOpenReadOnly() &&
+ bDoOpenReadonly != pCurDocShell->IsSecurityOptOpenReadOnly())
+ {
+ pCurDocShell->SetSecurityOptOpenReadOnly( bDoOpenReadonly );
+ bModified = true;
+ }
+ }
+
+ return bModified;
+}
+
+
+void SfxSecurityPage_Impl::Reset_Impl( const SfxItemSet & )
+{
+ SfxObjectShell* pCurDocShell = SfxObjectShell::Current();
+
+ String sNewText = m_aProtectSTR;
+ if (!pCurDocShell)
+ {
+ // no doc -> hide document settings
+ m_aOpenReadonlyCB.Disable();
+ m_aRecordChangesCB.Disable();
+ m_aChangeProtectionPB.Disable();
+ }
+ else
+ {
+ bool bIsHTMLDoc = false;
+ SfxViewShell* pViewSh = SfxViewShell::Current();
+ if (pViewSh)
+ {
+ const SfxPoolItem* pItem;
+ SfxDispatcher* pDisp = pViewSh->GetDispatcher();
+ if (SFX_ITEM_AVAILABLE <= pDisp->QueryState( SID_HTML_MODE, pItem ))
+ {
+ USHORT nMode = static_cast< const SfxUInt16Item* >( pItem )->GetValue();
+ bIsHTMLDoc = ( ( nMode & HTMLMODE_ON ) != 0 );
+ }
+ }
+
+ sal_Bool bIsReadonly = pCurDocShell->IsReadOnly();
+ if (pCurDocShell->HasSecurityOptOpenReadOnly() && !bIsHTMLDoc)
+ {
+ m_aOpenReadonlyCB.Check( pCurDocShell->IsSecurityOptOpenReadOnly() );
+ m_aOpenReadonlyCB.Enable( !bIsReadonly );
+ }
+ else
+ m_aOpenReadonlyCB.Disable();
+
+ bool bRecordChanges;
+ if (QueryRecordChangesState( RL_WRITER, bRecordChanges ) && !bIsHTMLDoc)
+ m_eRedlingMode = RL_WRITER;
+ else if (QueryRecordChangesState( RL_CALC, bRecordChanges ))
+ m_eRedlingMode = RL_CALC;
+ else
+ m_eRedlingMode = RL_NONE;
+
+ if (m_eRedlingMode != RL_NONE)
+ {
+ bool bProtection;
+ QueryRecordChangesProtectionState( m_eRedlingMode, bProtection );
+
+ m_aChangeProtectionPB.Enable( !bIsReadonly );
+ // set the right text
+ if (bProtection)
+ sNewText = m_aUnProtectSTR;
+
+ m_aRecordChangesCB.Check( bRecordChanges );
+ m_aRecordChangesCB.Enable( /*!bProtection && */!bIsReadonly );
+
+ m_bOrigPasswordIsConfirmed = true; // default case if no password is set
+ uno::Sequence< sal_Int8 > aPasswordHash;
+ // check if password is available
+ if (pCurDocShell->GetProtectionHash( aPasswordHash ) &&
+ aPasswordHash.getLength() > 0)
+ m_bOrigPasswordIsConfirmed = false; // password found, needs to be confirmed later on
+ }
+ else
+ {
+ // A Calc document that is shared will have 'm_eRedlingMode == RL_NONE'
+ // In shared documents change recording and protection must be disabled,
+ // similar to documents that do not support change recording at all.
+ m_aRecordChangesCB.Check( FALSE );
+ m_aRecordChangesCB.Disable();
+ m_aChangeProtectionPB.Check( FALSE );
+ m_aChangeProtectionPB.Disable();
+ }
+ }
+
+ m_aChangeProtectionPB.SetText( sNewText );
+}
+
+
+IMPL_LINK( SfxSecurityPage_Impl, RecordChangesCBToggleHdl, void*, EMPTYARG )
+{
+ // when change recording gets disabled protection must be disabled as well
+ if (!m_aRecordChangesCB.IsChecked()) // the new check state is already present, thus the '!'
+ {
+ bool bAlreadyDone = false;
+ if (!m_bEndRedliningWarningDone)
+ {
+ WarningBox aBox( m_rMyTabPage.GetParent(), WinBits(WB_YES_NO | WB_DEF_NO),
+ m_aEndRedliningWarning );
+ if (aBox.Execute() != RET_YES)
+ bAlreadyDone = true;
+ else
+ m_bEndRedliningWarningDone = true;
+ }
+
+ const bool bNeedPasssword = !m_bOrigPasswordIsConfirmed
+ && m_aChangeProtectionPB.GetText() != m_aProtectSTR;
+ if (!bAlreadyDone && bNeedPasssword)
+ {
+ String aPasswordText;
+
+ // dialog canceled or no password provided
+ if (!lcl_GetPassword( m_rMyTabPage.GetParent(), false, aPasswordText ))
+ bAlreadyDone = true;
+
+ // ask for password and if dialog is canceled or no password provided return
+ if (lcl_IsPasswordCorrect( aPasswordText ))
+ m_bOrigPasswordIsConfirmed = true;
+ else
+ bAlreadyDone = true;
+ }
+
+ if (bAlreadyDone)
+ m_aRecordChangesCB.Check( true ); // restore original state
+ else
+ {
+ // remember required values to change protection and change recording in
+ // FillItemSet_Impl later on if password was correct.
+ m_bNewPasswordIsValid = true;
+ m_aNewPassword = String();
+
+ m_aChangeProtectionPB.SetText( m_aProtectSTR );
+ }
+ }
+
+ return 0;
+}
+
+
+IMPL_LINK( SfxSecurityPage_Impl, ChangeProtectionPBHdl, void*, EMPTYARG )
+{
+ if (m_eRedlingMode == RL_NONE)
+ return 0;
+
+ // the push button text is always the opposite of the current state. Thus:
+ const bool bCurrentProtection = m_aChangeProtectionPB.GetText() != m_aProtectSTR;
+
+ // ask user for password (if still necessary)
+ String aPasswordText;
+ bool bNewProtection = !bCurrentProtection;
+ const bool bNeedPassword = bNewProtection || !m_bOrigPasswordIsConfirmed;
+ if (bNeedPassword)
+ {
+ // ask for password and if dialog is canceled or no password provided return
+ if (!lcl_GetPassword( m_rMyTabPage.GetParent(), bNewProtection, aPasswordText ))
+ return 0;
+
+ // provided password still needs to be checked?
+ if (!bNewProtection && !m_bOrigPasswordIsConfirmed)
+ {
+ if (lcl_IsPasswordCorrect( aPasswordText ))
+ m_bOrigPasswordIsConfirmed = true;
+ else
+ return 0;
+ }
+ }
+ DBG_ASSERT( m_bOrigPasswordIsConfirmed, "ooops... this should not have happened!" );
+
+ // remember required values to change protection and change recording in
+ // FillItemSet_Impl later on if password was correct.
+ m_bNewPasswordIsValid = true;
+ m_aNewPassword = bNewProtection? aPasswordText : String();
+
+// // RecordChangesCB is enabled if protection is off
+// m_aRecordChangesCB.Enable( !bNewProtection );
+ m_aRecordChangesCB.Check( bNewProtection );
+ // toggle text of button "Protect" <-> "Unprotect"
+ m_aChangeProtectionPB.SetText( bNewProtection ? m_aUnProtectSTR : m_aProtectSTR );
+
+ return 0;
+}
+
+
+//////////////////////////////////////////////////////////////////////
+
+
+SfxTabPage* SfxSecurityPage::Create( Window * pParent, const SfxItemSet & rItemSet )
+{
+ return new SfxSecurityPage( pParent, rItemSet );
+}
+
+
+SfxSecurityPage::SfxSecurityPage( Window* pParent, const SfxItemSet& rItemSet ) :
+ SfxTabPage( pParent, SfxResId( TP_DOCINFOSECURITY ), rItemSet )
+{
+ m_pImpl = std::auto_ptr< SfxSecurityPage_Impl >(new SfxSecurityPage_Impl( *this, rItemSet ));
+
+ FreeResource();
+}
+
+
+SfxSecurityPage::~SfxSecurityPage()
+{
+}
+
+
+BOOL SfxSecurityPage::FillItemSet( SfxItemSet & rItemSet )
+{
+ bool bModified = false;
+ DBG_ASSERT( m_pImpl.get(), "implementation pointer is 0. Still in c-tor?" );
+ if (m_pImpl.get() != 0)
+ bModified = m_pImpl->FillItemSet_Impl( rItemSet );
+ return bModified;
+}
+
+
+void SfxSecurityPage::Reset( const SfxItemSet & rItemSet )
+{
+ DBG_ASSERT( m_pImpl.get(), "implementation pointer is 0. Still in c-tor?" );
+ if (m_pImpl.get() != 0)
+ m_pImpl->Reset_Impl( rItemSet );
+}
+
+
+//////////////////////////////////////////////////////////////////////
+
+
diff --git a/sfx2/source/dialog/securitypage.hrc b/sfx2/source/dialog/securitypage.hrc
new file mode 100644
index 000000000000..d425131b4772
--- /dev/null
+++ b/sfx2/source/dialog/securitypage.hrc
@@ -0,0 +1,52 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _SECURITYPAGE_HRC_
+#define _SECURITYPAGE_HRC_
+
+
+#define PASSWORD_TO_OPEN_FL 1
+#define PASSWORD_TO_OPEN_FT 2
+#define PASSWORD_TO_OPEN_ED 3
+#define CONFIRM_PASSWORD_TO_OPEN_FT 4
+#define CONFIRM_PASSWORD_TO_OPEN_ED 5
+#define PASSWORD_INFO_FT 6
+#define PASSWORD_TO_MODIFY_FL 7
+#define PASSWORD_TO_MODIFY_FT 8
+#define PASSWORD_TO_MODIFY_ED 9
+#define CONFIRM_PASSWORD_TO_MODIFY_FT 10
+#define CONFIRM_PASSWORD_TO_MODIFY_ED 11
+#define OPTIONS_FL 12
+#define OPEN_READONLY_CB 13
+#define RECORD_CHANGES_CB 14
+#define CHANGE_PROTECTION_PB 15
+
+#define STR_PROTECT 101
+#define STR_UNPROTECT 102
+#define STR_END_REDLINING_WARNING 103
+
+#endif
+
diff --git a/sfx2/source/dialog/securitypage.src b/sfx2/source/dialog/securitypage.src
new file mode 100644
index 000000000000..fee60404d01c
--- /dev/null
+++ b/sfx2/source/dialog/securitypage.src
@@ -0,0 +1,174 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "sfx2/sfx.hrc"
+#include "securitypage.hrc"
+#include "helpid.hrc"
+#include "dialog.hrc"
+#include "sfxlocal.hrc"
+
+#include <svtools/controldims.hrc>
+
+
+TabPage TP_DOCINFOSECURITY
+{
+ HelpId = HID_DOCINFOSECURITY ;
+ Hide = TRUE ;
+ Size = MAP_APPFONT ( 260 , 185 ) ;
+
+ FixedLine PASSWORD_TO_OPEN_FL
+ {
+ Pos = MAP_APPFONT( 6, 6 );
+ Size = MAP_APPFONT( 248, RSC_CD_FIXEDLINE_HEIGHT );
+ Text [ en-US ] = "File encryption password";
+ };
+ FixedText PASSWORD_TO_OPEN_FT
+ {
+ Pos = MAP_APPFONT( 12, 20 );
+ Size = MAP_APPFONT( 82, RSC_CD_FIXEDTEXT_HEIGHT );
+ Text [ en-US ] = "~Enter password to open";
+ };
+ Edit PASSWORD_TO_OPEN_ED
+ {
+ HelpId = HID_SECURITYTAB_PASSWORD_TO_OPEN;
+ Pos = MAP_APPFONT( 100, 18 );
+ Size = MAP_APPFONT( 88, RSC_CD_TEXTBOX_HEIGHT );
+ Border = TRUE;
+ PassWord = TRUE;
+ };
+ FixedText CONFIRM_PASSWORD_TO_OPEN_FT
+ {
+ Pos = MAP_APPFONT( 12, 34 );
+ Size = MAP_APPFONT( 82, RSC_CD_FIXEDTEXT_HEIGHT );
+ Text [ en-US ] = "~Reenter password to open";
+ };
+ Edit CONFIRM_PASSWORD_TO_OPEN_ED
+ {
+ HelpId = HID_SECURITYTAB_CONFIRM_PASSWORD_TO_OPEN;
+ Pos = MAP_APPFONT( 100, 32 );
+ Size = MAP_APPFONT( 88, RSC_CD_TEXTBOX_HEIGHT );
+ Border = TRUE;
+ PassWord = TRUE;
+ };
+ FixedText PASSWORD_INFO_FT
+ {
+ Pos = MAP_APPFONT( 12, 48 );
+ Size = MAP_APPFONT( 236, 3 * RSC_CD_FIXEDTEXT_HEIGHT );
+ Text [ en-US ] =
+ "Note: After a password has been set, the document will only open "\
+ "with the password. Should you lose the password, there will be "\
+ "no way to recover the document. Please also note that this password "\
+ "is case-sensitive.";
+ WordBreak = TRUE;
+ };
+ FixedLine PASSWORD_TO_MODIFY_FL
+ {
+ Pos = MAP_APPFONT( 6, 78 );
+ Size = MAP_APPFONT( 248, RSC_CD_FIXEDLINE_HEIGHT );
+ Text [ en-US ] = "File sharing password";
+ };
+ FixedText PASSWORD_TO_MODIFY_FT
+ {
+ Pos = MAP_APPFONT( 12, 92 );
+ Size = MAP_APPFONT( 82, RSC_CD_FIXEDTEXT_HEIGHT );
+ Text [ en-US ] = "Enter password to modify";
+ };
+ Edit PASSWORD_TO_MODIFY_ED
+ {
+ HelpId = HID_SECURITYTAB_PASSWORD_TO_MODIFY;
+ Pos = MAP_APPFONT( 100, 90 );
+ Size = MAP_APPFONT( 88, RSC_CD_TEXTBOX_HEIGHT );
+ Border = TRUE;
+ PassWord = TRUE;
+ };
+ FixedText CONFIRM_PASSWORD_TO_MODIFY_FT
+ {
+ Pos = MAP_APPFONT( 12, 106 );
+ Size = MAP_APPFONT( 82, RSC_CD_FIXEDTEXT_HEIGHT );
+ Text [ en-US ] = "Reenter password to modify";
+ };
+ Edit CONFIRM_PASSWORD_TO_MODIFY_ED
+ {
+ HelpId = HID_SECURITYTAB_CONFIRM_PASSWORD_TO_MODIFY;
+ Pos = MAP_APPFONT( 100, 104 );
+ Size = MAP_APPFONT( 88, RSC_CD_TEXTBOX_HEIGHT );
+ Border = TRUE;
+ PassWord = TRUE;
+ };
+ FixedLine OPTIONS_FL
+ {
+ Pos = MAP_APPFONT( 6, 120 );
+ Size = MAP_APPFONT( 248, RSC_CD_FIXEDLINE_HEIGHT );
+ Text [ en-US ] = "File sharing options";
+ };
+ CheckBox OPEN_READONLY_CB
+ {
+ HelpId = HID_SECURITYTAB_OPEN_FILE_READONLY;
+ Pos = MAP_APPFONT( 12, 133 );
+ Size = MAP_APPFONT( 176, RSC_CD_CHECKBOX_HEIGHT );
+ Text [ en-US ] = "~Open file read-only";
+ };
+ CheckBox RECORD_CHANGES_CB
+ {
+ HelpId = HID_SECURITYTAB_RECORD_CHANGES;
+ Pos = MAP_APPFONT( 12, 147 );
+ Size = MAP_APPFONT( 176, RSC_CD_CHECKBOX_HEIGHT );
+ Text [ en-US ] = "Record ~changes";
+ };
+ PushButton CHANGE_PROTECTION_PB
+ {
+ HelpId = HID_SECURITYTAB_PROTECTION;
+ Pos = MAP_APPFONT( 194, 145 );
+ Size = MAP_APPFONT( 60, RSC_CD_PUSHBUTTON_HEIGHT );
+ };
+ String STR_PROTECT
+ {
+ Text [ en-US ] = "~Protect...";
+ };
+ String STR_UNPROTECT
+ {
+ Text [ en-US ] = "~Unprotect...";
+ };
+ String STR_END_REDLINING_WARNING
+ {
+ Text [ en-US ] = "This action will exit the change recording mode.\nAny information about changes will be lost.\n\nExit change recording mode?\n\n" ;
+ };
+};
+
+String RID_SFX_PROTECT_RECORDS
+{
+ Text [ en-US ] = "Protect Records" ;
+};
+String RID_SFX_UNPROTECT_RECORDS
+{
+ Text [ en-US ] = "Unprotect Records" ;
+};
+String RID_SFX_INCORRECT_PASSWORD
+{
+ Text [ en-US ] = "Incorrect password" ;
+};
+
diff --git a/sfx2/source/dialog/srchdlg.src b/sfx2/source/dialog/srchdlg.src
index 0947f3932981..d1cee69e9157 100644
--- a/sfx2/source/dialog/srchdlg.src
+++ b/sfx2/source/dialog/srchdlg.src
@@ -52,6 +52,7 @@ ModelessDialog RID_DLG_SEARCH
};
ComboBox ED_SEARCH
{
+ HelpID = "sfx2:ComboBox:RID_DLG_SEARCH:ED_SEARCH";
Border = TRUE;
Pos = MAP_APPFONT( 6, 14 );
Size = MAP_APPFONT( 150, 50 );
@@ -60,6 +61,7 @@ ModelessDialog RID_DLG_SEARCH
};
CheckBox CB_WHOLEWORDS
{
+ HelpID = "sfx2:CheckBox:RID_DLG_SEARCH:CB_WHOLEWORDS";
Pos = MAP_APPFONT( 6, 29 );
Size = MAP_APPFONT( 150, 10 );
Text [ en-US ] = "~Whole words only" ;
@@ -67,6 +69,7 @@ ModelessDialog RID_DLG_SEARCH
};
CheckBox CB_MATCHCASE
{
+ HelpID = "sfx2:CheckBox:RID_DLG_SEARCH:CB_MATCHCASE";
Pos = MAP_APPFONT( 6, 42 );
Size = MAP_APPFONT( 150, 10 );
Text[ en-US ] = "~Match case";
@@ -74,6 +77,7 @@ ModelessDialog RID_DLG_SEARCH
};
CheckBox CB_WRAPAROUND
{
+ HelpID = "sfx2:CheckBox:RID_DLG_SEARCH:CB_WRAPAROUND";
Pos = MAP_APPFONT( 6, 55 );
Size = MAP_APPFONT( 150, 10 );
Text [ en-US ] = "Wrap ~around" ;
@@ -81,6 +85,7 @@ ModelessDialog RID_DLG_SEARCH
};
CheckBox CB_BACKWARDS
{
+ HelpID = "sfx2:CheckBox:RID_DLG_SEARCH:CB_BACKWARDS";
Pos = MAP_APPFONT( 6, 68 );
Size = MAP_APPFONT( 150, 10 );
Text [ en-US ] = "~Backwards" ;
@@ -88,6 +93,7 @@ ModelessDialog RID_DLG_SEARCH
};
PushButton PB_FIND
{
+ HelpID = "sfx2:PushButton:RID_DLG_SEARCH:PB_FIND";
Pos = MAP_APPFONT( 162, 6 );
Size = MAP_APPFONT( 50, 14 );
Text [ en-US ] = "~Find" ;
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index 93c2e0e09595..3c7a58cd09f9 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -1780,15 +1780,15 @@ long SfxTabDialog::Notify( NotifyEvent& rNEvt )
if ( pViewFrame )
{
Window* pWindow = rNEvt.GetWindow();
- ULONG nHelpId = 0;
- while ( !nHelpId && pWindow )
+ rtl::OString sHelpId;
+ while ( !sHelpId.getLength() && pWindow )
{
- nHelpId = pWindow->GetHelpId();
+ sHelpId = pWindow->GetHelpId();
pWindow = pWindow->GetParent();
}
- if ( nHelpId )
- SfxHelp::OpenHelpAgent( &pViewFrame->GetFrame(), nHelpId );
+ if ( sHelpId.getLength() )
+ SfxHelp::OpenHelpAgent( &pViewFrame->GetFrame(), sHelpId );
}
}
diff --git a/sfx2/source/dialog/taskpane.cxx b/sfx2/source/dialog/taskpane.cxx
index f25485a1401c..1c2faac4e8a3 100644
--- a/sfx2/source/dialog/taskpane.cxx
+++ b/sfx2/source/dialog/taskpane.cxx
@@ -60,7 +60,7 @@
#include <vcl/menu.hxx>
#include <vcl/svapp.hxx>
#include <toolkit/helper/vclunohelper.hxx>
-
+#include <tools/urlobj.hxx>
#include <boost/noncopyable.hpp>
//......................................................................................................................
@@ -253,10 +253,11 @@ namespace sfx2
pWindow->SetHelpId( HID_TASKPANE_WINDOW );
pWindow->SetOutputSizePixel( Size( 300, 450 ) );
- pWindow->Show();
dynamic_cast< SfxDockingWindow* >( pWindow )->Initialize( i_pInfo );
SetHideNotDelete( TRUE );
+
+ pWindow->Show();
}
//------------------------------------------------------------------------------------------------------------------
@@ -309,7 +310,7 @@ namespace sfx2
virtual ::rtl::OUString GetDisplayName() const;
virtual Image GetImage() const;
- virtual SmartId GetHelpID() const;
+ virtual rtl::OString GetHelpID() const;
virtual void Activate( Window& i_rParentWindow );
virtual void Deactivate();
virtual void SetSizePixel( const Size& i_rPanelWindowSize );
@@ -408,10 +409,19 @@ namespace sfx2
return m_aPanelImage;
}
+ static rtl::OString lcl_getHelpId( const ::rtl::OUString& _rHelpURL )
+ {
+ INetURLObject aHID( _rHelpURL );
+ if ( aHID.GetProtocol() == INET_PROT_HID )
+ return rtl::OUStringToOString( aHID.GetURLPath(), RTL_TEXTENCODING_UTF8 );
+ else
+ return rtl::OUStringToOString( _rHelpURL, RTL_TEXTENCODING_UTF8 );
+ }
+
//------------------------------------------------------------------------------------------------------------------
- SmartId CustomToolPanel::GetHelpID() const
+ rtl::OString CustomToolPanel::GetHelpID() const
{
- return SmartId( m_aPanelHelpURL );
+ return lcl_getHelpId( m_aPanelHelpURL );
}
//------------------------------------------------------------------------------------------------------------------
@@ -584,6 +594,7 @@ namespace sfx2
return;
::rtl::OUString sFirstVisiblePanelResource;
+ ::rtl::OUString sFirstPanelResource;
const Sequence< ::rtl::OUString > aUIElements( aWindowStateConfig.getNodeNames() );
for ( const ::rtl::OUString* resource = aUIElements.getConstArray();
@@ -594,6 +605,8 @@ namespace sfx2
if ( !impl_isToolPanelResource( *resource ) )
continue;
+ sFirstPanelResource = *resource;
+
::utl::OConfigurationNode aResourceNode( aWindowStateConfig.openNode( *resource ) );
::svt::PToolPanel pCustomPanel( new CustomToolPanel( aResourceNode, m_xFrame ) );
@@ -620,6 +633,9 @@ namespace sfx2
sFirstVisiblePanelResource = *resource;
}
+ if ( sFirstVisiblePanelResource.getLength() == 0 )
+ sFirstVisiblePanelResource = sFirstPanelResource;
+
if ( sFirstVisiblePanelResource.getLength() )
{
::boost::optional< size_t > aPanelPos( GetPanelPos( sFirstVisiblePanelResource ) );
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 9edeb05b43ac..a3d9fd7b4ed2 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -2208,32 +2208,6 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, FmtSelectHdl, SvTreeListBox *, pListBox
// HilfePI antriggern, wenn von Call als Handler und Bereich erlaubt ist
if( !pListBox || pListBox->IsSelected( pListBox->GetHdlEntry() ) )
{
-#ifdef WIR_KOENNEN_WIEDER_HILFE_FUER_STYLESHEETS
- SfxHelpPI* pHelpPI = SFX_APP()->GetHelpPI();
- if ( pHelpPI && pListBox && IsInitialized() &&
- GetSelectedEntry().Len() )
- {
- const SfxStyleFamilyItem *pItem = GetFamilyItem_Impl();
- const SfxStyleFamily eFam = pItem->GetFamily();
- DBG_ASSERT(pStyleSheetPool, "Kein Pool");
- // SfxStyleSheetBase* pStyle = pStyleSheetPool
- // ? pStyleSheetPool->Find( GetSelectedEntry(), eFam ) : 0;
- SfxStyleSheetBase *pStyle;
- if ( pStyleSheetPool )
- pStyle = pStyleSheetPool->Find ( GetSelectedEntry(), eFam );
- else
- pStyle = 0;
-
- if ( pStyle )
- {
- String aHelpFile;
- ULONG nHelpId=pStyle->GetHelpId(aHelpFile);
- if ( nHelpId )
- pHelpPI->LoadTopic( nHelpId );
- }
- }
-#endif
-
// nur, wenn Giesskanne an ist
if ( IsInitialized() &&
IsCheckedItem(SID_STYLE_WATERCAN) &&
@@ -2373,18 +2347,18 @@ void SfxTemplateDialog_Impl::EnableFamilyItem( USHORT nId, BOOL bEnable )
void SfxTemplateDialog_Impl::InsertFamilyItem(USHORT nId,const SfxStyleFamilyItem *pItem)
{
- USHORT nHelpId = 0;
+ rtl::OString sHelpId;
switch( (USHORT) pItem->GetFamily() )
{
- case SFX_STYLE_FAMILY_CHAR: nHelpId = SID_STYLE_FAMILY1; break;
- case SFX_STYLE_FAMILY_PARA: nHelpId = SID_STYLE_FAMILY2; break;
- case SFX_STYLE_FAMILY_FRAME:nHelpId = SID_STYLE_FAMILY3; break;
- case SFX_STYLE_FAMILY_PAGE: nHelpId = SID_STYLE_FAMILY4; break;
- case SFX_STYLE_FAMILY_PSEUDO: nHelpId = SID_STYLE_FAMILY5; break;
- default: DBG_ERROR("unbekannte StyleFamily"); break;
+ case SFX_STYLE_FAMILY_CHAR: sHelpId = ".uno:CharStyle"; break;
+ case SFX_STYLE_FAMILY_PARA: sHelpId = ".uno:ParaStyle"; break;
+ case SFX_STYLE_FAMILY_FRAME: sHelpId = ".uno:FrameStyle"; break;
+ case SFX_STYLE_FAMILY_PAGE: sHelpId = ".uno:PageStyle"; break;
+ case SFX_STYLE_FAMILY_PSEUDO: sHelpId = ".uno:ListStyle"; break;
+ default: DBG_ERROR("unknown StyleFamily"); break;
}
m_aActionTbL.InsertItem( nId, pItem->GetImage(), pItem->GetText(), 0, 0);
- m_aActionTbL.SetHelpId( nId, nHelpId );
+ m_aActionTbL.SetHelpId( nId, sHelpId );
}
// ------------------------------------------------------------------------
@@ -2694,7 +2668,7 @@ IMPL_LINK( SfxTemplateDialog_Impl, ToolBoxRClick, ToolBox *, pBox )
aCommand = xUICommands->getByName(::rtl::OUString::createFromAscii(".uno:LoadStyles"));
sLabel = lcl_GetLabel( aCommand );
pMenu->InsertItem( SID_TEMPLATE_LOAD, sLabel );
- pMenu->SetHelpId(SID_TEMPLATE_LOAD, SID_TEMPLATE_LOAD);
+ pMenu->SetHelpId(SID_TEMPLATE_LOAD, ".uno:LoadStyles");
pMenu->SetSelectHdl(LINK(this, SfxTemplateDialog_Impl, MenuSelectHdl));
pMenu->Execute( pBox,
diff --git a/sfx2/source/dialog/templdlg.src b/sfx2/source/dialog/templdlg.src
index a4adcd77b6d3..60979450d9f6 100644
--- a/sfx2/source/dialog/templdlg.src
+++ b/sfx2/source/dialog/templdlg.src
@@ -57,7 +57,7 @@ ImageList IMG_LST_STYLE_DESIGNER_HC
// RID_STYLECATALOG ------------------------------------------------------
ModalDialog RID_STYLECATALOG
{
- HelpId = SID_STYLE_CATALOG ;
+ HelpId = CMD_SID_STYLE_CATALOG ;
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 181 , 134 ) ;
@@ -78,6 +78,7 @@ ModalDialog RID_STYLECATALOG
};
PushButton BT_ORG
{
+ HelpID = "sfx2:PushButton:RID_STYLECATALOG:BT_ORG";
Pos = MAP_APPFONT ( 123 , 97 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Organizer..." ;
@@ -85,6 +86,7 @@ ModalDialog RID_STYLECATALOG
};
PushButton BT_DEL
{
+ HelpID = "sfx2:PushButton:RID_STYLECATALOG:BT_DEL";
Pos = MAP_APPFONT ( 123 , 78 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Delete..." ;
@@ -92,6 +94,7 @@ ModalDialog RID_STYLECATALOG
};
PushButton BT_EDIT
{
+ HelpID = "sfx2:PushButton:RID_STYLECATALOG:BT_EDIT";
Pos = MAP_APPFONT ( 123 , 60 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Modify..." ;
@@ -99,6 +102,7 @@ ModalDialog RID_STYLECATALOG
};
PushButton BT_NEW
{
+ HelpID = "sfx2:PushButton:RID_STYLECATALOG:BT_NEW";
Pos = MAP_APPFONT ( 123 , 43 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~New..." ;
@@ -112,6 +116,7 @@ ModalDialog RID_STYLECATALOG
};
ListBox BT_TOOL
{
+ HelpID = "sfx2:ListBox:RID_STYLECATALOG:BT_TOOL";
Border = TRUE ;
Pos = MAP_APPFONT ( 6 , 6 ) ;
Size = MAP_APPFONT ( 110 , 55 ) ;
@@ -128,6 +133,7 @@ ModalDialog RID_STYLECATALOG
};
ListBox BT_FLIST
{
+ HelpID = "sfx2:ListBox:RID_STYLECATALOG:BT_FLIST";
Border = TRUE ;
Pos = MAP_APPFONT ( 6 , 114 ) ;
Size = MAP_APPFONT ( 110 , 77 ) ;
@@ -146,7 +152,7 @@ DockingWindow DLG_STYLE_DESIGNER
{
Text [ en-US ] = "Styles and Formatting" ;
- HelpId = SID_STYLE_DESIGNER ;
+ HelpId = CMD_SID_STYLE_DESIGNER ;
OutputSize = TRUE ;
Hide = TRUE ;
SVLook = TRUE ;
diff --git a/sfx2/source/dialog/titledockwin.cxx b/sfx2/source/dialog/titledockwin.cxx
index 58a61d66ba8b..680880229324 100644
--- a/sfx2/source/dialog/titledockwin.cxx
+++ b/sfx2/source/dialog/titledockwin.cxx
@@ -51,6 +51,7 @@ namespace sfx2
,m_aContentWindow( this, WB_DIALOGCONTROL )
,m_aBorder( 3, 1, 3, 3 )
,m_bLayoutPending( false )
+ ,m_nTitleBarHeight(0)
{
impl_construct();
}
@@ -139,23 +140,23 @@ namespace sfx2
Size aWindowSize( GetOutputSizePixel() );
// position the tool box
- int nTitleBarHeight( GetSettings().GetStyleSettings().GetTitleHeight() );
- if ( aToolBoxSize.Height() > nTitleBarHeight )
- nTitleBarHeight = aToolBoxSize.Height();
+ m_nTitleBarHeight = GetSettings().GetStyleSettings().GetTitleHeight();
+ if ( aToolBoxSize.Height() > m_nTitleBarHeight )
+ m_nTitleBarHeight = aToolBoxSize.Height();
m_aToolbox.SetPosSizePixel(
Point(
aWindowSize.Width() - aToolBoxSize.Width(),
- ( nTitleBarHeight - aToolBoxSize.Height() ) / 2
+ ( m_nTitleBarHeight - aToolBoxSize.Height() ) / 2
),
aToolBoxSize
);
// Place the content window.
- if ( nTitleBarHeight < aToolBoxSize.Height() )
- nTitleBarHeight = aToolBoxSize.Height();
- aWindowSize.Height() -= nTitleBarHeight;
+ if ( m_nTitleBarHeight < aToolBoxSize.Height() )
+ m_nTitleBarHeight = aToolBoxSize.Height();
+ aWindowSize.Height() -= m_nTitleBarHeight;
m_aContentWindow.SetPosSizePixel(
- Point( m_aBorder.Left(), nTitleBarHeight + m_aBorder.Top() ),
+ Point( m_aBorder.Left(), m_nTitleBarHeight + m_aBorder.Top() ),
Size(
aWindowSize.Width() - m_aBorder.Left() - m_aBorder.Right(),
aWindowSize.Height() - m_aBorder.Top() - m_aBorder.Bottom()
@@ -175,11 +176,6 @@ namespace sfx2
Push( PUSH_FONT | PUSH_FILLCOLOR | PUSH_LINECOLOR );
- int nTitleBarHeight( GetSettings().GetStyleSettings().GetTitleHeight() );
- const Size aToolBoxSize = m_aToolbox.CalcWindowSizePixel();
- if ( aToolBoxSize.Height() > nTitleBarHeight )
- nTitleBarHeight = aToolBoxSize.Height();
-
SetFillColor( GetSettings().GetStyleSettings().GetDialogColor() );
SetLineColor();
@@ -194,7 +190,7 @@ namespace sfx2
int nInnerLeft = nOuterLeft + m_aBorder.Left() - 1;
int nOuterRight = aWindowSize.Width() - 1;
int nInnerRight = nOuterRight - m_aBorder.Right() + 1;
- int nInnerTop = nTitleBarHeight + m_aBorder.Top() - 1;
+ int nInnerTop = m_nTitleBarHeight + m_aBorder.Top() - 1;
int nOuterBottom = aWindowSize.Height() - 1;
int nInnerBottom = nOuterBottom - m_aBorder.Bottom() + 1;
@@ -260,7 +256,7 @@ namespace sfx2
}
//------------------------------------------------------------------------------------------------------------------
- USHORT TitledDockingWindow::impl_addDropDownToolBoxItem( const String& i_rItemText, ULONG i_nHelpId, const Link& i_rCallback )
+ USHORT TitledDockingWindow::impl_addDropDownToolBoxItem( const String& i_rItemText, const rtl::OString& i_nHelpId, const Link& i_rCallback )
{
// Add the menu before the closer button.
const USHORT nItemCount( m_aToolbox.GetItemCount() );
diff --git a/sfx2/source/dialog/versdlg.src b/sfx2/source/dialog/versdlg.src
index 60aeb2777542..927c940e6506 100644
--- a/sfx2/source/dialog/versdlg.src
+++ b/sfx2/source/dialog/versdlg.src
@@ -28,6 +28,7 @@
#include "versdlg.hrc"
ModalDialog DLG_VERSIONS
{
+ HelpID = "sfx2:ModalDialog:DLG_VERSIONS";
OutputSize = TRUE ;
Size = MAP_APPFONT ( 340 , 184 ) ;
SvLook = TRUE ;
@@ -41,6 +42,7 @@ ModalDialog DLG_VERSIONS
};
PushButton PB_SAVE
{
+ HelpID = "sfx2:PushButton:DLG_VERSIONS:PB_SAVE";
Pos = MAP_APPFONT ( 12 , 14 ) ;
Size = MAP_APPFONT ( 90 , 14 ) ;
TabStop = TRUE ;
@@ -48,6 +50,7 @@ ModalDialog DLG_VERSIONS
};
CheckBox CB_SAVEONCLOSE
{
+ HelpID = "sfx2:CheckBox:DLG_VERSIONS:CB_SAVEONCLOSE";
Pos = MAP_APPFONT ( 108 , 16 ) ;
Size = MAP_APPFONT ( 164 , 10 ) ;
TabStop = TRUE ;
@@ -93,6 +96,7 @@ ModalDialog DLG_VERSIONS
};
PushButton PB_OPEN
{
+ HelpID = "sfx2:PushButton:DLG_VERSIONS:PB_OPEN";
Pos = MAP_APPFONT ( 284 , 26 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
@@ -100,6 +104,7 @@ ModalDialog DLG_VERSIONS
};
PushButton PB_VIEW
{
+ HelpID = "sfx2:PushButton:DLG_VERSIONS:PB_VIEW";
Pos = MAP_APPFONT ( 284 , 43 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
@@ -108,6 +113,7 @@ ModalDialog DLG_VERSIONS
};
PushButton PB_DELETE
{
+ HelpID = "sfx2:PushButton:DLG_VERSIONS:PB_DELETE";
Pos = MAP_APPFONT ( 284 , 60 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
@@ -115,6 +121,7 @@ ModalDialog DLG_VERSIONS
};
PushButton PB_COMPARE
{
+ HelpID = "sfx2:PushButton:DLG_VERSIONS:PB_COMPARE";
Pos = MAP_APPFONT ( 284 , 77 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
@@ -130,6 +137,7 @@ ModalDialog DLG_VERSIONS
};
ModalDialog DLG_COMMENTS
{
+ HelpID = "sfx2:ModalDialog:DLG_COMMENTS";
OutputSize = TRUE ;
Size = MAP_APPFONT ( 180 , 118 ) ;
SvLook = TRUE ;
@@ -148,6 +156,7 @@ ModalDialog DLG_COMMENTS
};
MultiLineEdit ME_VERSIONS
{
+ HelpID = "sfx2:MultiLineEdit:DLG_COMMENTS:ME_VERSIONS";
Border = TRUE ;
Pos = MAP_APPFONT ( 6 , 32 ) ;
Size = MAP_APPFONT ( 168 , 60 ) ;
@@ -168,6 +177,7 @@ ModalDialog DLG_COMMENTS
};
PushButton PB_CLOSE
{
+ HelpID = "sfx2:PushButton:DLG_COMMENTS:PB_CLOSE";
Pos = MAP_APPFONT ( 68 , 98 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx
index 9625ea958830..df0781be8877 100644
--- a/sfx2/source/doc/DocumentMetadataAccess.cxx
+++ b/sfx2/source/doc/DocumentMetadataAccess.cxx
@@ -45,6 +45,8 @@
#include <rtl/uuid.h>
#include <rtl/ustrbuf.hxx>
+#include <rtl/uri.hxx>
+#include <rtl/bootstrap.hxx>
#include <comphelper/interaction.hxx>
#include <comphelper/makesequence.hxx>
@@ -136,6 +138,24 @@ uno::Reference<rdf::XURI> createBaseURI(
throw uno::RuntimeException();
}
+ // #i108078# workaround non-hierarchical vnd.sun.star.expand URIs
+ // this really should be done somewhere else, not here.
+ ::rtl::OUString pkgURI(i_rPkgURI);
+ if (pkgURI.matchIgnoreAsciiCaseAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.expand:")))
+ {
+ // expand it here (makeAbsolute requires hierarchical URI)
+ pkgURI = pkgURI.copy( RTL_CONSTASCII_LENGTH("vnd.sun.star.expand:") );
+ if (pkgURI.getLength() != 0) {
+ pkgURI = ::rtl::Uri::decode(
+ pkgURI, rtl_UriDecodeStrict, RTL_TEXTENCODING_UTF8);
+ if (pkgURI.getLength() == 0) {
+ throw uno::RuntimeException();
+ }
+ ::rtl::Bootstrap::expandMacros(pkgURI);
+ }
+ }
+
const uno::Reference<lang::XMultiComponentFactory> xServiceFactory(
i_xContext->getServiceManager(), uno::UNO_SET_THROW);
const uno::Reference<uri::XUriReferenceFactory> xUriFactory(
@@ -146,11 +166,12 @@ uno::Reference<rdf::XURI> createBaseURI(
uno::Reference< uri::XUriReference > xBaseURI;
const uno::Reference< uri::XUriReference > xPkgURI(
- xUriFactory->parse(i_rPkgURI), uno::UNO_SET_THROW );
+ xUriFactory->parse(pkgURI), uno::UNO_SET_THROW );
xPkgURI->clearFragment();
+
// need to know whether the storage is a FileSystemStorage
// XServiceInfo would be better, but it is not implemented
-// if ( i_rPkgURI.getLength() && ::utl::UCBContentHelper::IsFolder(i_rPkgURI) )
+// if ( pkgURI.getLength() && ::utl::UCBContentHelper::IsFolder(pkgURI) )
if (true) {
xBaseURI.set( xPkgURI, uno::UNO_SET_THROW );
#if 0
diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx
index 14474dd2904d..f18e903eb6e4 100644
--- a/sfx2/source/doc/SfxDocumentMetaData.cxx
+++ b/sfx2/source/doc/SfxDocumentMetaData.cxx
@@ -2380,12 +2380,5 @@ extern "C" void * SAL_CALL component_getFactory(
return ::cppu::component_getFactoryHelper(
implName, serviceManager, registryKey, entries);
}
-
-extern "C" sal_Bool SAL_CALL component_writeInfo(
- void * serviceManager, void * registryKey)
-{
- return ::cppu::component_writeInfoHelper(serviceManager, registryKey,
- entries);
-}
#endif
diff --git a/sfx2/source/doc/applet.cxx b/sfx2/source/doc/applet.cxx
deleted file mode 100644
index 844eb5726b1a..000000000000
--- a/sfx2/source/doc/applet.cxx
+++ /dev/null
@@ -1,383 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sfx2.hxx"
-
-#include "applet.hxx"
-#include <sfx2/sfxdlg.hxx>
-#include <sfx2/sfxsids.hrc>
-
-#include "com/sun/star/uno/XComponentContext.hpp"
-#include "cppuhelper/factory.hxx"
-#include <tools/urlobj.hxx>
-#include <tools/debug.hxx>
-#include <sj2/sjapplet.hxx>
-#include <vcl/syschild.hxx>
-#include <rtl/ustring.hxx>
-#include <toolkit/helper/vclunohelper.hxx>
-#include <unotools/javaoptions.hxx>
-#include <svtools/miscopt.hxx>
-#include <comphelper/TypeGeneration.hxx>
-
-using namespace ::com::sun::star;
-using namespace ::comphelper;
-
-namespace sfx2
-{
-class AppletWindow_Impl : public SystemChildWindow
-{
-public:
- SjApplet2* pApplet;
- AppletWindow_Impl( Window* pParent, SjApplet2* pApp )
- : SystemChildWindow( pParent, WB_CLIPCHILDREN )
- , pApplet(pApp)
- {}
-
- virtual void Resize();
-};
-
-void AppletWindow_Impl::Resize()
-{
- Size aSize( GetOutputSizePixel() );
- if ( pApplet )
- pApplet->setSizePixel( aSize );
-}
-
-class AppletWrapper_Impl : public SjApplet2
-{
- virtual void appletResize( const Size & );
- virtual void showDocument( const INetURLObject &, const XubString & );
- virtual void showStatus( const XubString & );
-};
-
-void AppletWrapper_Impl::appletResize( const Size & ) {}
-void AppletWrapper_Impl::showDocument( const INetURLObject &, const XubString & ) {}
-void AppletWrapper_Impl::showStatus( const XubString & ) {}
-
-#define PROPERTY_UNBOUND 0
-#define PROPERTY_MAYBEVOID ::com::sun::star::beans::PropertyAttribute::MAYBEVOID
-
-#define WID_APPLET_CODE 1
-#define WID_APPLET_CODEBASE 2
-#define WID_APPLET_COMMANDS 3
-#define WID_APPLET_DOCBASE 4
-#define WID_APPLET_ISSCRIPT 5
-#define WID_APPLET_NAME 6
-const SfxItemPropertyMapEntry* lcl_GetAppletPropertyMap_Impl()
-{
- static SfxItemPropertyMapEntry aAppletPropertyMap_Impl[] =
- {
- { MAP_CHAR_LEN("AppletCode") , WID_APPLET_CODE , CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_UNBOUND, 0 },
- { MAP_CHAR_LEN("AppletCodeBase"), WID_APPLET_CODEBASE , CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_UNBOUND, 0 },
- { MAP_CHAR_LEN("AppletCommands"), WID_APPLET_COMMANDS , CPPU_E2T(CPPUTYPE_PROPERTYVALUE), PROPERTY_UNBOUND, 0 },
- { MAP_CHAR_LEN("AppletDocBase"), WID_APPLET_DOCBASE , CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_UNBOUND, 0 },
- { MAP_CHAR_LEN("AppletIsScript"), WID_APPLET_ISSCRIPT , CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_UNBOUND, 0 },
- { MAP_CHAR_LEN("AppletName") , WID_APPLET_NAME , CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_UNBOUND, 0 },
- {0,0,0,0,0,0}
- };
-return aAppletPropertyMap_Impl;
-}
-
-::rtl::OUString AppletObject::getImplementationName()
- throw( ::com::sun::star::uno::RuntimeException )
-{
- return impl_getStaticImplementationName();
-}
-
-::sal_Bool AppletObject::supportsService( const ::rtl::OUString& sServiceName )
- throw( ::com::sun::star::uno::RuntimeException )
-{
- ::com::sun::star::uno::Sequence< ::rtl::OUString > seqServiceNames =
- getSupportedServiceNames();
- const ::rtl::OUString* pArray = seqServiceNames.getConstArray();
- for ( ::sal_Int32 nCounter=0; nCounter<seqServiceNames.getLength();
- nCounter++ )
- {
- if ( pArray[nCounter] == sServiceName )
- {
- return sal_True ;
- }
- }
- return sal_False ;
-}
-
-::com::sun::star::uno::Sequence< ::rtl::OUString >
-AppletObject::getSupportedServiceNames()
- throw( ::com::sun::star::uno::RuntimeException )
-{
- return impl_getStaticSupportedServiceNames();
-}
-
-::com::sun::star::uno::Sequence< ::rtl::OUString >
-AppletObject::impl_getStaticSupportedServiceNames()
-{
- ::com::sun::star::uno::Sequence< ::rtl::OUString > seqServiceNames( 1 );
- seqServiceNames.getArray() [0] = ::rtl::OUString::createFromAscii(
- "com.sun.star.embed.SpecialEmbeddedObject" );
- return seqServiceNames ;
-}
-
-::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
-AppletObject::impl_createInstance(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::uno::XComponentContext >& xContext )
- throw( ::com::sun::star::uno::Exception )
-{
- return static_cast< ::cppu::OWeakObject * >( new AppletObject( xContext ) );
-}
-
-::rtl::OUString AppletObject::impl_getStaticImplementationName()
-{
- return ::rtl::OUString::createFromAscii(
- "com.sun.star.comp.sfx2.AppletObject" );
-}
-
-::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
-AppletObject::impl_createFactory()
-{
- return uno::Reference< uno::XInterface >(
- cppu::createSingleComponentFactory(
- impl_createInstance, impl_getStaticImplementationName(),
- impl_getStaticSupportedServiceNames() ),
- uno::UNO_QUERY_THROW );
-}
-
-AppletObject::AppletObject(
- const uno::Reference < uno::XComponentContext >& rContext )
- : mxContext( rContext )
- , maPropMap( lcl_GetAppletPropertyMap_Impl() )
- , mpApplet( NULL )
- , mbMayScript( FALSE )
-{
-}
-
-AppletObject::~AppletObject()
-{
-}
-
-void SAL_CALL AppletObject::initialize( const uno::Sequence< uno::Any >& aArguments ) throw ( uno::Exception, uno::RuntimeException )
-{
- if ( aArguments.getLength() )
- aArguments[0] >>= mxObj;
-}
-
-sal_Bool SAL_CALL AppletObject::load(
- const uno::Sequence < com::sun::star::beans::PropertyValue >& /*lDescriptor*/,
- const uno::Reference < frame::XFrame >& xFrame )
-throw( uno::RuntimeException )
-{
- if ( SvtJavaOptions().IsExecuteApplets() && SvtMiscOptions().IsPluginsEnabled() )
- {
- mpApplet = new AppletWrapper_Impl;
-
- Window* pParent = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() );
- Window* pWin = new AppletWindow_Impl( pParent, mpApplet );
- pWin->SetBackground();
- pWin->Show();
-
- // aCmdList.Append( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "width" ) ), String( aPosSize.GetWidth() ) );
- // aCmdList.Append( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "height" ) ), String( aPosSize.GetHeight() ) );
-
- if( maName.getLength() )
- maCmdList.Append( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "name" ) ), maName );
-
- if( maCodeBase.getLength() )
- {
- for ( sal_uInt32 nParams=0; nParams<maCmdList.Count(); nParams++ )
- {
- if ( maCmdList[nParams].GetCommand().EqualsAscii("codebase") )
- {
- maCmdList.Remove(nParams);
- break;
- }
- }
-
- maCmdList.Append( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "codebase" ) ), maCodeBase );
- }
-
- if( maClass.getLength() )
- maCmdList.Append( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "code" ) ), maClass );
-
- if( mbMayScript )
- maCmdList.Append( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "mayscript" ) ), String() );
-
- INetURLObject aDocBase( maDocBase );
- mpApplet->Init( mxContext, pWin, aDocBase, maCmdList );
- uno::Reference < awt::XWindow > xWindow( pWin->GetComponentInterface(), uno::UNO_QUERY );
-
- // we must destroy the applet before the parent is destroyed
- xWindow->addEventListener( this );
-
- xFrame->setComponent( xWindow, uno::Reference < frame::XController >() );
- return TRUE;
- }
-
- return FALSE;
-}
-
-void SAL_CALL AppletObject::cancel() throw( com::sun::star::uno::RuntimeException )
-{
- if ( mpApplet )
- {
- mpApplet->appletClose(); // reparenting window
- DELETEZ( mpApplet );
- }
-}
-
-void SAL_CALL AppletObject::close( sal_Bool /*bDeliverOwnership*/ ) throw( com::sun::star::util::CloseVetoException, com::sun::star::uno::RuntimeException )
-{
-}
-
-void SAL_CALL AppletObject::addCloseListener( const com::sun::star::uno::Reference < com::sun::star::util::XCloseListener >& ) throw( com::sun::star::uno::RuntimeException )
-{
-}
-
-void SAL_CALL AppletObject::removeCloseListener( const com::sun::star::uno::Reference < com::sun::star::util::XCloseListener >& ) throw( com::sun::star::uno::RuntimeException )
-{
-}
-
-void SAL_CALL AppletObject::disposing( const com::sun::star::lang::EventObject& ) throw (com::sun::star::uno::RuntimeException)
-{
- cancel();
-}
-
-uno::Reference< beans::XPropertySetInfo > SAL_CALL AppletObject::getPropertySetInfo() throw( ::com::sun::star::uno::RuntimeException )
-{
- static uno::Reference< beans::XPropertySetInfo > xInfo = new SfxItemPropertySetInfo( &maPropMap );
- return xInfo;
-}
-
-void SAL_CALL AppletObject::setPropertyValue(const ::rtl::OUString& aPropertyName, const uno::Any& aAny)
- throw ( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
-{
-
- const SfxItemPropertySimpleEntry* pEntry = maPropMap.getByName( aPropertyName );
- if( !pEntry )
- throw beans::UnknownPropertyException();
- switch( pEntry->nWID )
- {
- case WID_APPLET_CODE :
- aAny >>= maClass;
- break;
- case WID_APPLET_CODEBASE :
- //pImpl->aCodeBase = rURL.GetMainURL( INetURLObject::NO_DECODE );
- //if( rURL.GetProtocol() == INET_PROT_FILE
- // && pImpl->aCodeBase.GetChar( 9 ) == INET_ENC_DELIM_TOKEN )
- // // Laufwerksbuchstabe auf ':' patchen
- // pImpl->aCodeBase.SetChar( 9, INET_DELIM_TOKEN );
-
- aAny >>= maCodeBase;
- break;
- case WID_APPLET_COMMANDS :
- {
- maCmdList.Clear();
- uno::Sequence < beans::PropertyValue > aCommandSequence;
- if( aAny >>= aCommandSequence )
- maCmdList.FillFromSequence( aCommandSequence );
- }
- break;
- case WID_APPLET_DOCBASE :
- aAny >>= maDocBase;
- break;
- case WID_APPLET_ISSCRIPT :
- aAny >>= mbMayScript;
- break;
- case WID_APPLET_NAME :
- aAny >>= maName;
- break;
- default:;
-
- }
-}
-
-uno::Any SAL_CALL AppletObject::getPropertyValue(const ::rtl::OUString& aPropertyName) throw ( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- uno::Any aAny;
- const SfxItemPropertySimpleEntry* pEntry = maPropMap.getByName( aPropertyName );
- if( !pEntry )
- throw beans::UnknownPropertyException();
- switch( pEntry->nWID )
- {
- case WID_APPLET_CODE :
- aAny <<= maClass;
- break;
- case WID_APPLET_CODEBASE :
- aAny <<= maCodeBase;
- break;
- case WID_APPLET_COMMANDS :
- {
- uno::Sequence< beans::PropertyValue > aCommandSequence;
- maCmdList.FillSequence( aCommandSequence );
- aAny <<= aCommandSequence;
- }
- break;
- case WID_APPLET_DOCBASE :
- break;
- case WID_APPLET_ISSCRIPT :
- aAny <<= mbMayScript;
- break;
- case WID_APPLET_NAME :
- aAny <<= maName;
- break;
- default:;
-
- }
- return aAny;
-}
-
-void SAL_CALL AppletObject::addPropertyChangeListener(const ::rtl::OUString&, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener > & ) throw( ::com::sun::star::uno::RuntimeException )
-{
-}
-
-void SAL_CALL AppletObject::removePropertyChangeListener(const ::rtl::OUString&, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener > & ) throw( ::com::sun::star::uno::RuntimeException )
-{
-}
-
-void SAL_CALL AppletObject::addVetoableChangeListener(const ::rtl::OUString&, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener > & ) throw( ::com::sun::star::uno::RuntimeException )
-{
-}
-
-void SAL_CALL AppletObject::removeVetoableChangeListener(const ::rtl::OUString&, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener > & ) throw( ::com::sun::star::uno::RuntimeException )
-{
-}
-
-::sal_Int16 SAL_CALL AppletObject::execute() throw (::com::sun::star::uno::RuntimeException)
-{
- SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
- uno::Reference < beans::XPropertySet > xSet( this );
- VclAbstractDialog* pDlg = pFact->CreateEditObjectDialog( NULL, SID_INSERT_APPLET, mxObj );
- if ( pDlg )
- pDlg->Execute();
- return 0;
-}
-
-void SAL_CALL AppletObject::setTitle( const ::rtl::OUString& ) throw (::com::sun::star::uno::RuntimeException)
-{
-}
-
-}
diff --git a/sfx2/source/doc/doc.hrc b/sfx2/source/doc/doc.hrc
index 838168e64526..7e8fd688af52 100644
--- a/sfx2/source/doc/doc.hrc
+++ b/sfx2/source/doc/doc.hrc
@@ -44,7 +44,6 @@
#define STR_NOSTARTPRINTER (RID_SFX_DOC_START+ 8)
#define MSG_CONFIRM_FILTER (RID_SFX_DOC_START+11)
#define MSG_CONFIRM_OVERWRITE_TEMPLATE (RID_SFX_DOC_START+12)
-#define MSG_QUERY_LOAD_TEMPLATE (RID_SFX_DOC_START+13)
#define STR_DELETE_REGION (RID_SFX_DOC_START+14)
#define STR_DELETE_TEMPLATE (RID_SFX_DOC_START+15)
diff --git a/sfx2/source/doc/doc.src b/sfx2/source/doc/doc.src
index d17b62c9b52a..497d4ccd7c97 100644
--- a/sfx2/source/doc/doc.src
+++ b/sfx2/source/doc/doc.src
@@ -43,14 +43,6 @@ QueryBox MSG_CONFIRM_OVERWRITE_TEMPLATE
DefButton = WB_DEF_NO ;
Message [ en-US ] = "Name already in use.\nDo you want to overwrite document template?" ;
};
-QueryBox MSG_QUERY_LOAD_TEMPLATE
-{
- BUTTONS = WB_YES_NO ;
- DEFBUTTON = WB_DEF_NO ;
- HelpId = MSG_QUERY_LOAD_TEMPLATE;
-
- Message [ en-US ] = "The Styles in this document do not match your current Styles. Should your current Styles be applied to this document?";
-};
String STR_DELETE_REGION
{
Text [ en-US ] = "Are you sure you want to delete the region \"$1\"?" ;
diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx
index bfd67210ec44..4311559f94af 100644
--- a/sfx2/source/doc/docfac.cxx
+++ b/sfx2/source/doc/docfac.cxx
@@ -159,6 +159,21 @@ void SfxObjectFactory::RegisterViewFactory
SfxViewFactory &rFactory
)
{
+#if OSL_DEBUG_LEVEL > 0
+ {
+ const String sViewName( rFactory.GetAPIViewName() );
+ for ( sal_uInt16 i = 0; i < pImpl->aViewFactoryArr.Count(); ++i )
+ {
+ if ( !pImpl->aViewFactoryArr[i]->GetAPIViewName().Equals( sViewName ) )
+ continue;
+ ByteString sMessage( "SfxObjectFactory::RegisterViewFactory: duplicate view name '" );
+ sMessage += ByteString( sViewName, RTL_TEXTENCODING_ASCII_US );
+ sMessage += "'!";
+ OSL_ENSURE( false, sMessage.GetBuffer() );
+ break;
+ }
+ }
+#endif
sal_uInt16 nPos;
for ( nPos = 0;
nPos < pImpl->aViewFactoryArr.Count() &&
@@ -467,7 +482,9 @@ SfxViewFactory* SfxObjectFactory::GetViewFactoryByViewName( const String& i_rVie
)
{
SfxViewFactory& rViewFac( GetViewFactory( nViewNo ) );
- if ( rViewFac.GetViewName() == i_rViewName )
+ if ( ( rViewFac.GetAPIViewName() == i_rViewName )
+ || ( rViewFac.GetLegacyViewName() == i_rViewName )
+ )
return &rViewFac;
}
return NULL;
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 298da13be147..29081e8e8418 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -115,6 +115,7 @@ using namespace ::com::sun::star::io;
#include <comphelper/storagehelper.hxx>
#include <comphelper/mediadescriptor.hxx>
#include <comphelper/configurationhelper.hxx>
+#include <comphelper/docpasswordhelper.hxx>
#include <tools/urlobj.hxx>
#include <tools/inetmime.hxx>
#include <unotools/ucblockbytes.hxx>
@@ -2558,18 +2559,72 @@ void SfxMedium::SetFilter( const SfxFilter* pFilterP, sal_Bool /*bResetOrig*/ )
pFilter = pFilterP;
pImp->nFileVersion = 0;
}
+
//----------------------------------------------------------------
const SfxFilter* SfxMedium::GetOrigFilter( sal_Bool bNotCurrent ) const
{
return ( pImp->pOrigFilter || bNotCurrent ) ? pImp->pOrigFilter : pFilter;
}
+
//----------------------------------------------------------------
void SfxMedium::SetOrigFilter_Impl( const SfxFilter* pOrigFilter )
{
pImp->pOrigFilter = pOrigFilter;
}
+
+//------------------------------------------------------------------
+
+sal_uInt32 SfxMedium::CreatePasswordToModifyHash( const ::rtl::OUString& aPasswd, sal_Bool bWriter )
+{
+ sal_uInt32 nHash = 0;
+
+ if ( aPasswd.getLength() )
+ {
+ if ( bWriter )
+ {
+ nHash = ::comphelper::DocPasswordHelper::GetWordHashAsUINT32( aPasswd );
+ }
+ else
+ {
+ rtl_TextEncoding nEncoding = RTL_TEXTENCODING_UTF8;
+
+ // if the MS-filter should be used
+ // use the inconsistent algorithm to find the encoding specified by MS
+ nEncoding = osl_getThreadTextEncoding();
+ switch( nEncoding )
+ {
+ case RTL_TEXTENCODING_ISO_8859_15:
+ case RTL_TEXTENCODING_MS_874:
+ case RTL_TEXTENCODING_MS_1250:
+ case RTL_TEXTENCODING_MS_1251:
+ case RTL_TEXTENCODING_MS_1252:
+ case RTL_TEXTENCODING_MS_1253:
+ case RTL_TEXTENCODING_MS_1254:
+ case RTL_TEXTENCODING_MS_1255:
+ case RTL_TEXTENCODING_MS_1256:
+ case RTL_TEXTENCODING_MS_1257:
+ case RTL_TEXTENCODING_MS_1258:
+ case RTL_TEXTENCODING_SHIFT_JIS:
+ case RTL_TEXTENCODING_GB_2312:
+ case RTL_TEXTENCODING_BIG5:
+ // in case the system uses an encoding from the list above, it should be used
+ break;
+
+ default:
+ // in case other encoding is used, use one of the encodings from the list
+ nEncoding = RTL_TEXTENCODING_MS_1250;
+ break;
+ }
+
+ nHash = ::comphelper::DocPasswordHelper::GetXLHashAsUINT16( aPasswd, nEncoding );
+ }
+ }
+
+ return nHash;
+}
+
//------------------------------------------------------------------
void SfxMedium::Close()
@@ -3662,53 +3717,6 @@ void SfxMedium::SetCachedSignatureState_Impl( sal_uInt16 nState )
pImp->m_nSignatureState = nState;
}
-//----------------------------------------------------------------
-sal_Bool SfxMedium::EqualURLs( const ::rtl::OUString& aFirstURL, const ::rtl::OUString& aSecondURL )
-{
- sal_Bool bResult = sal_False;
-
- if ( aFirstURL.getLength() && aSecondURL.getLength() )
- {
- INetURLObject aFirst( aFirstURL );
- INetURLObject aSecond( aSecondURL );
-
- if ( aFirst.GetProtocol() != INET_PROT_NOT_VALID && aSecond.GetProtocol() != INET_PROT_NOT_VALID )
- {
- try
- {
- ::ucbhelper::ContentBroker* pBroker = ::ucbhelper::ContentBroker::get();
- if ( !pBroker )
- throw uno::RuntimeException();
-
- uno::Reference< ::com::sun::star::ucb::XContentIdentifierFactory > xIdFac
- = pBroker->getContentIdentifierFactoryInterface();
- if ( !xIdFac.is() )
- throw uno::RuntimeException();
-
- uno::Reference< ::com::sun::star::ucb::XContentIdentifier > xIdFirst
- = xIdFac->createContentIdentifier( aFirst.GetMainURL( INetURLObject::NO_DECODE ) );
- uno::Reference< ::com::sun::star::ucb::XContentIdentifier > xIdSecond
- = xIdFac->createContentIdentifier( aSecond.GetMainURL( INetURLObject::NO_DECODE ) );
-
- if ( xIdFirst.is() && xIdSecond.is() )
- {
- uno::Reference< ::com::sun::star::ucb::XContentProvider > xProvider =
- pBroker->getContentProviderInterface();
- if ( !xProvider.is() )
- throw uno::RuntimeException();
- bResult = !xProvider->compareContentIds( xIdFirst, xIdSecond );
- }
- }
- catch( uno::Exception& )
- {
- OSL_ENSURE( sal_False, "Can't compare URL's, treat as different!\n" );
- }
- }
- }
-
- return bResult;
-}
-
BOOL SfxMedium::HasStorage_Impl() const
{
return pImp->xStorage.is();
diff --git a/sfx2/source/doc/docfilt.cxx b/sfx2/source/doc/docfilt.cxx
index e955c43af705..1219d30d7b27 100644
--- a/sfx2/source/doc/docfilt.cxx
+++ b/sfx2/source/doc/docfilt.cxx
@@ -49,20 +49,6 @@
using namespace ::com::sun::star;
-namespace sfx2 {
-
-// TODO #i105076# this should be in the filter configuration!!!
-bool CheckMSPasswordCapabilityForExport( const String& rFilterName )
-{
- return
- rFilterName.EqualsAscii( "MS Word 97" ) ||
- rFilterName.EqualsAscii( "MS Word 97 Vorlage" ) ||
- rFilterName.EqualsAscii( "MS Excel 97" ) ||
- rFilterName.EqualsAscii( "MS Excel 97 Vorlage/Template" );
-}
-
-} // namespace sfx2
-
// STATIC DATA -----------------------------------------------------------
DBG_NAME(SfxFilter)
diff --git a/sfx2/source/doc/doctdlg.src b/sfx2/source/doc/doctdlg.src
index 91d966fbd2d5..1b50fd56c55e 100644
--- a/sfx2/source/doc/doctdlg.src
+++ b/sfx2/source/doc/doctdlg.src
@@ -28,10 +28,11 @@
#include <sfx2/sfx.hrc>
#include "doc.hrc"
#include "doctdlg.hrc"
+#include <sfx2/sfxcommands.h>
ModalDialog DLG_DOC_TEMPLATE
{
- HelpId = SID_DOCTEMPLATE ;
+ HelpId = CMD_SID_DOCTEMPLATE ;
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 280 , 128 ) ;
@@ -45,6 +46,7 @@ ModalDialog DLG_DOC_TEMPLATE
};
Edit ED_NAME
{
+ HelpID = "sfx2:Edit:DLG_DOC_TEMPLATE:ED_NAME";
Border = TRUE ;
Pos = MAP_APPFONT ( 12 , 14 ) ;
Size = MAP_APPFONT ( 200 , 12 ) ;
@@ -63,6 +65,7 @@ ModalDialog DLG_DOC_TEMPLATE
};
ListBox LB_SECTION
{
+ HelpID = "sfx2:ListBox:DLG_DOC_TEMPLATE:LB_SECTION";
Border = TRUE ;
Pos = MAP_APPFONT ( 12 , 56 ) ;
Size = MAP_APPFONT ( 97 , 66 ) ;
@@ -75,6 +78,7 @@ ModalDialog DLG_DOC_TEMPLATE
};
ListBox LB_STYLESHEETS
{
+ HelpID = "sfx2:ListBox:DLG_DOC_TEMPLATE:LB_STYLESHEETS";
Border = TRUE ;
Pos = MAP_APPFONT ( 115 , 56 ) ;
Size = MAP_APPFONT ( 97 , 66 ) ;
@@ -98,12 +102,14 @@ ModalDialog DLG_DOC_TEMPLATE
};
PushButton BT_EDIT
{
+ HelpID = "sfx2:PushButton:DLG_DOC_TEMPLATE:BT_EDIT";
Pos = MAP_APPFONT ( 224 , 62 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Edit" ;
};
PushButton BT_ORGANIZE
{
+ HelpID = "sfx2:PushButton:DLG_DOC_TEMPLATE:BT_ORGANIZE";
Pos = MAP_APPFONT ( 224 , 79 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Organizer..." ;
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index b921f2d97f1f..71f3683c0006 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -1919,7 +1919,7 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName,
aStoreArgs[1].Value <<= rTemplateName;
::rtl::OUString aCurrentDocumentURL = rStorable->getLocation();
- if( !SfxMedium::EqualURLs( aNewTemplateTargetURL, rStorable->getLocation() ))
+ if( !::utl::UCBContentHelper::EqualURLs( aNewTemplateTargetURL, rStorable->getLocation() ))
rStorable->storeToURL( aNewTemplateTargetURL, aStoreArgs );
else
rStorable->store();
diff --git a/sfx2/source/doc/docvor.src b/sfx2/source/doc/docvor.src
index 2c9975de9bb8..80ebed8b1708 100644
--- a/sfx2/source/doc/docvor.src
+++ b/sfx2/source/doc/docvor.src
@@ -37,7 +37,7 @@
ModalDialog DLG_ORGANIZE
{
- HelpId = SID_ORGANIZER ;
+ HelpId = CMD_SID_ORGANIZER ;
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 271 , 162 ) ;
@@ -61,6 +61,7 @@ ModalDialog DLG_ORGANIZE
};
PushButton BTN_FILES
{
+ HelpID = "sfx2:PushButton:DLG_ORGANIZE:BTN_FILES";
Pos = MAP_APPFONT ( 205 , 143 ) ;
Size = MAP_APPFONT ( 60 , 14 ) ;
Text [ en-US ] = "~File..." ;
@@ -68,12 +69,14 @@ ModalDialog DLG_ORGANIZE
};
PushButton BTN_ADDRESSTEMPLATE
{
+ HelpID = "sfx2:PushButton:DLG_ORGANIZE:BTN_ADDRESSTEMPLATE";
Pos = MAP_APPFONT ( 205 , 124 ) ;
Size = MAP_APPFONT ( 60 , 14 ) ;
Text [ en-US ] = "~Address Book..." ;
};
ListBox LB_LEFT_TYP
{
+ HelpID = "sfx2:ListBox:DLG_ORGANIZE:LB_LEFT_TYP";
Border = TRUE ;
Pos = MAP_APPFONT ( 3 , 144 ) ;
Size = MAP_APPFONT ( 94 , 55 ) ;
@@ -88,6 +91,7 @@ ModalDialog DLG_ORGANIZE
};
ListBox LB_RIGHT_TYP
{
+ HelpID = "sfx2:ListBox:DLG_ORGANIZE:LB_RIGHT_TYP";
Border = TRUE ;
Pos = MAP_APPFONT ( 103 , 144 ) ;
Size = MAP_APPFONT ( 94 , 55 ) ;
@@ -142,6 +146,7 @@ ModalDialog DLG_ORGANIZE
};
MenuButton BTN_EDIT
{
+ HelpID = "sfx2:MenuButton:DLG_ORGANIZE:BTN_EDIT";
Pos = MAP_APPFONT ( 205 , 23 ) ;
Size = MAP_APPFONT ( 60 , 14 ) ;
Text [ en-US ] = "Commands" ;
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 24f2f359607f..3c4df7276d6b 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -62,6 +62,9 @@
#include <unotools/pathoptions.hxx>
#include <unotools/pathoptions.hxx>
#include <svl/itemset.hxx>
+#include <svl/eitem.hxx>
+#include <svl/stritem.hxx>
+#include <svl/intitem.hxx>
#include <unotools/useroptions.hxx>
#include <unotools/saveopt.hxx>
#include <tools/debug.hxx>
@@ -80,6 +83,7 @@
#include <sfx2/app.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/dinfdlg.hxx>
+#include <sfx2/request.hxx>
#include <sfxtypes.hxx>
#include "alienwarn.hxx"
@@ -108,6 +112,7 @@ const ::rtl::OUString aFilterFlagsString = ::rtl::OUString::createFromAscii( "
using namespace ::com::sun::star;
+namespace {
//-------------------------------------------------------------------------
static sal_uInt16 getSlotIDFromMode( sal_Int8 nStoreMode )
{
@@ -168,6 +173,69 @@ static sal_Int32 getDontFlags( sal_Int8 nStoreMode )
}
//=========================================================================
+// class DocumentSettingsGuard
+//=========================================================================
+
+class DocumentSettingsGuard
+{
+ uno::Reference< beans::XPropertySet > m_xDocumentSettings;
+ sal_Bool m_bPreserveReadOnly;
+ sal_Bool m_bReadOnlySupported;
+
+ sal_Bool m_bRestoreSettings;
+public:
+ DocumentSettingsGuard( const uno::Reference< frame::XModel >& xModel, sal_Bool bReadOnly, sal_Bool bRestore )
+ : m_bPreserveReadOnly( sal_False )
+ , m_bReadOnlySupported( sal_False )
+ , m_bRestoreSettings( bRestore )
+ {
+ try
+ {
+ uno::Reference< lang::XMultiServiceFactory > xDocSettingsSupplier( xModel, uno::UNO_QUERY_THROW );
+ m_xDocumentSettings.set(
+ xDocSettingsSupplier->createInstance(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.Settings" ) ) ),
+ uno::UNO_QUERY_THROW );
+
+ ::rtl::OUString aLoadReadonlyString( RTL_CONSTASCII_USTRINGPARAM( "LoadReadonly" ) );
+
+ try
+ {
+ m_xDocumentSettings->getPropertyValue( aLoadReadonlyString ) >>= m_bPreserveReadOnly;
+ m_xDocumentSettings->setPropertyValue( aLoadReadonlyString, uno::makeAny( bReadOnly ) );
+ m_bReadOnlySupported = sal_True;
+ }
+ catch( uno::Exception& )
+ {}
+ }
+ catch( uno::Exception& )
+ {}
+
+ if ( ( bReadOnly && !m_bReadOnlySupported ) )
+ throw uno::RuntimeException(); // the user could provide the data, so it must be stored
+ }
+
+ ~DocumentSettingsGuard()
+ {
+ if ( m_bRestoreSettings )
+ {
+ ::rtl::OUString aLoadReadonlyString( RTL_CONSTASCII_USTRINGPARAM( "LoadReadonly" ) );
+
+ try
+ {
+ if ( m_bReadOnlySupported )
+ m_xDocumentSettings->setPropertyValue( aLoadReadonlyString, uno::makeAny( m_bPreserveReadOnly ) );
+ }
+ catch( uno::Exception& )
+ {
+ OSL_ASSERT( "Unexpected exception!" );
+ }
+ }
+ }
+};
+} // anonymous namespace
+
+//=========================================================================
// class ModelData_Impl
//=========================================================================
class ModelData_Impl
@@ -184,6 +252,8 @@ class ModelData_Impl
::comphelper::SequenceAsHashMap m_aMediaDescrHM;
+ sal_Bool m_bRecommendReadOnly;
+
public:
ModelData_Impl( SfxStoringHelper& aOwner,
const uno::Reference< frame::XModel >& xModel,
@@ -200,6 +270,8 @@ public:
::comphelper::SequenceAsHashMap& GetMediaDescr() { return m_aMediaDescrHM; }
+ sal_Bool IsRecommendReadOnly() { return m_bRecommendReadOnly; }
+
const ::comphelper::SequenceAsHashMap& GetDocProps();
::rtl::OUString GetModuleName();
@@ -252,6 +324,7 @@ ModelData_Impl::ModelData_Impl( SfxStoringHelper& aOwner,
, m_pDocumentPropsHM( NULL )
, m_pModulePropsHM( NULL )
, m_aMediaDescrHM( aMediaDescr )
+, m_bRecommendReadOnly( sal_False )
{
CheckInteractionHandler();
}
@@ -923,6 +996,12 @@ sal_Bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode,
::rtl::OUString aFilterName = aStringTypeFN;
+ // the following two arguments can not be converted in MediaDescriptor,
+ // so they should be removed from the ItemSet after retrieving
+ SFX_ITEMSET_ARG( pDialogParams, pRecommendReadOnly, SfxBoolItem, SID_RECOMMENDREADONLY, sal_False );
+ m_bRecommendReadOnly = ( pRecommendReadOnly && pRecommendReadOnly->GetValue() );
+ pDialogParams->ClearItem( SID_RECOMMENDREADONLY );
+
uno::Sequence< beans::PropertyValue > aPropsFromDialog;
TransformItems( nSlotID, *pDialogParams, aPropsFromDialog, NULL );
GetMediaDescr() << aPropsFromDialog;
@@ -1509,6 +1588,8 @@ sal_Bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >&
// store the document and handle it's docinfo
SvtSaveOptions aOptions;
+ DocumentSettingsGuard aSettingsGuard( aModelData.GetModel(), aModelData.IsRecommendReadOnly(), nStoreMode & EXPORT_REQUESTED );
+
if ( aOptions.IsDocInfoSave()
&& ( !aModelData.GetStorable()->hasLocation()
|| INetURLObject( aModelData.GetStorable()->getLocation() ) != aURL ) )
diff --git a/sfx2/source/doc/iframe.cxx b/sfx2/source/doc/iframe.cxx
index 3ad0cc51a923..f7df58ffd397 100644
--- a/sfx2/source/doc/iframe.cxx
+++ b/sfx2/source/doc/iframe.cxx
@@ -384,7 +384,7 @@ void SAL_CALL IFrameObject::removeVetoableChangeListener(const ::rtl::OUString&,
::sal_Int16 SAL_CALL IFrameObject::execute() throw (::com::sun::star::uno::RuntimeException)
{
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
- VclAbstractDialog* pDlg = pFact->CreateEditObjectDialog( NULL, SID_INSERT_FLOATINGFRAME, mxObj );
+ VclAbstractDialog* pDlg = pFact->CreateEditObjectDialog( NULL, rtl::OUString::createFromAscii(".uno:InsertObjectFloatingFrame"), mxObj );
if ( pDlg )
pDlg->Execute();
return 0;
diff --git a/sfx2/source/doc/makefile.mk b/sfx2/source/doc/makefile.mk
index b1bddf82e428..d663d34cf5ba 100644
--- a/sfx2/source/doc/makefile.mk
+++ b/sfx2/source/doc/makefile.mk
@@ -87,8 +87,6 @@ SLOFILES = \
$(SLO)$/syspath.obj \
$(SLO)$/syspathw32.obj
-# $(SLO)$/applet.obj \
-
.IF "$(GUI)" == "WNT"
#HACK TO DISABLE PCH
diff --git a/sfx2/source/doc/new.src b/sfx2/source/doc/new.src
index 146f9f630570..6737128cce43 100644
--- a/sfx2/source/doc/new.src
+++ b/sfx2/source/doc/new.src
@@ -28,12 +28,14 @@
#include <sfx2/sfx.hrc>
#include "doc.hrc"
#include "new.hrc"
+#include <sfx2/sfxcommands.h>
+
// pragma ----------------------------------------------------------------
// DLG_NEW_FILE ----------------------------------------------------------
ModalDialog DLG_NEW_FILE
{
- HelpId = SID_NEWDOC ;
+ HelpId = CMD_SID_NEWDOC ;
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 336 , 96 ) ;
@@ -57,6 +59,7 @@ ModalDialog DLG_NEW_FILE
};
ListBox LB_REGION
{
+ HelpID = "sfx2:ListBox:DLG_NEW_FILE:LB_REGION";
Border = TRUE ;
Pos = MAP_APPFONT ( 6 , 18 ) ;
Size = MAP_APPFONT ( 127 , 72 ) ;
@@ -78,6 +81,7 @@ ModalDialog DLG_NEW_FILE
};
ListBox LB_TEMPLATE
{
+ HelpID = "sfx2:ListBox:DLG_NEW_FILE:LB_TEMPLATE";
Border = TRUE ;
Pos = MAP_APPFONT ( 139 , 18 ) ;
Size = MAP_APPFONT ( 127 , 72 ) ;
@@ -85,6 +89,7 @@ ModalDialog DLG_NEW_FILE
};
MoreButton BT_MORE
{
+ HelpID = "sfx2:MoreButton:DLG_NEW_FILE:BT_MORE";
Pos = MAP_APPFONT ( 274 , 70 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~More" ;
@@ -101,6 +106,7 @@ ModalDialog DLG_NEW_FILE
};
CheckBox BTN_PREVIEW
{
+ HelpID = "sfx2:CheckBox:DLG_NEW_FILE:BTN_PREVIEW";
Pos = MAP_APPFONT ( 6 , 96 ) ;
Size = MAP_APPFONT ( 97 , 10 ) ;
Text [ en-US ] = "Pre~view" ;
@@ -115,6 +121,7 @@ ModalDialog DLG_NEW_FILE
};
CheckBox CB_TEXT_STYLE
{
+ HelpID = "sfx2:CheckBox:DLG_NEW_FILE:CB_TEXT_STYLE";
Pos = MAP_APPFONT ( 6 , 94 ) ;
Size = MAP_APPFONT ( 50 , 10 ) ;
Hide = TRUE;
@@ -122,6 +129,7 @@ ModalDialog DLG_NEW_FILE
};
CheckBox CB_FRAME_STYLE
{
+ HelpID = "sfx2:CheckBox:DLG_NEW_FILE:CB_FRAME_STYLE";
Pos = MAP_APPFONT ( 60 , 94 ) ;
Size = MAP_APPFONT ( 50 , 10 ) ;
Hide = TRUE;
@@ -129,6 +137,7 @@ ModalDialog DLG_NEW_FILE
};
CheckBox CB_PAGE_STYLE
{
+ HelpID = "sfx2:CheckBox:DLG_NEW_FILE:CB_PAGE_STYLE";
Pos = MAP_APPFONT ( 114 , 94 ) ;
Size = MAP_APPFONT ( 50 , 10 ) ;
Hide = TRUE;
@@ -136,6 +145,7 @@ ModalDialog DLG_NEW_FILE
};
CheckBox CB_NUM_STYLE
{
+ HelpID = "sfx2:CheckBox:DLG_NEW_FILE:CB_NUM_STYLE";
Pos = MAP_APPFONT ( 168 , 94 ) ;
Size = MAP_APPFONT ( 50 , 10 ) ;
Hide = TRUE;
@@ -143,6 +153,7 @@ ModalDialog DLG_NEW_FILE
};
CheckBox CB_MERGE_STYLE
{
+ HelpID = "sfx2:CheckBox:DLG_NEW_FILE:CB_MERGE_STYLE";
Pos = MAP_APPFONT ( 222 , 94 ) ;
Size = MAP_APPFONT ( 50 , 10 ) ;
Hide = TRUE;
@@ -150,6 +161,7 @@ ModalDialog DLG_NEW_FILE
};
PushButton PB_LOAD_FILE
{
+ HelpID = "sfx2:PushButton:DLG_NEW_FILE:PB_LOAD_FILE";
Pos = MAP_APPFONT ( 274 , 92 ) ;
Size = MAP_APPFONT ( 56 , 14 ) ;
Hide = TRUE;
@@ -168,6 +180,7 @@ ModalDialog DLG_NEW_FILE
};
Edit ED_TITLE
{
+ HelpID = "sfx2:Edit:DLG_NEW_FILE:ED_TITLE";
Border = TRUE ;
Pos = MAP_APPFONT ( 145 , 121 ) ;
Size = MAP_APPFONT ( 175 , 12 ) ;
@@ -183,6 +196,7 @@ ModalDialog DLG_NEW_FILE
};
Edit ED_THEMA
{
+ HelpID = "sfx2:Edit:DLG_NEW_FILE:ED_THEMA";
Border = TRUE ;
Pos = MAP_APPFONT ( 145 , 148 ) ;
Size = MAP_APPFONT ( 175 , 12 ) ;
@@ -198,6 +212,7 @@ ModalDialog DLG_NEW_FILE
};
Edit ED_KEYWORDS
{
+ HelpID = "sfx2:Edit:DLG_NEW_FILE:ED_KEYWORDS";
Border = TRUE ;
Pos = MAP_APPFONT ( 145 , 175 ) ;
Size = MAP_APPFONT ( 175 , 12 ) ;
@@ -213,6 +228,7 @@ ModalDialog DLG_NEW_FILE
};
MultiLineEdit ED_DESC
{
+ HelpID = "sfx2:MultiLineEdit:DLG_NEW_FILE:ED_DESC";
Border = TRUE ;
Pos = MAP_APPFONT ( 144 , 202 ) ;
Size = MAP_APPFONT ( 175 , 32 ) ;
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index e73594af1e10..e0e63da04bb8 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -365,17 +365,6 @@ void SfxObjectShell::TriggerHelpPI(USHORT nIdx1, USHORT nIdx2, USHORT)
{
SfxStyleSheetBasePool *pStylePool = GetStyleSheetPool();
SetOrganizerSearchMask(pStylePool);
-#ifdef WIR_KOENNEN_WIEDER_HILFE_FUER_STYLESHEETS
- SfxStyleSheetBase *pStyle = (*pStylePool)[nIdx2];
- if(pStyle)
- {
- String aHelpFile;
- ULONG nHelpId=pStyle->GetHelpId(aHelpFile);
- SfxHelpPI* pHelpPI = SFX_APP()->GetHelpPI();
- if ( pHelpPI && nHelpId )
- pHelpPI->LoadTopic( nHelpId );
- }
-#endif
}
}
@@ -1242,3 +1231,51 @@ void SfxObjectShell::SetSaveVersionOnClose( sal_Bool bNew )
pImp->bSaveVersionOnClose = bNew;
}
+sal_uInt32 SfxObjectShell::GetModifyPasswordHash() const
+{
+ return pImp->m_nModifyPasswordHash;
+}
+
+sal_Bool SfxObjectShell::SetModifyPasswordHash( sal_uInt32 nHash )
+{
+ if ( ( !IsReadOnly() && !IsReadOnlyUI() )
+ || !(pImp->nFlagsInProgress & SFX_LOADED_MAINDOCUMENT ) )
+ {
+ // the hash can be changed only in editable documents,
+ // or during loading of document
+ pImp->m_nModifyPasswordHash = nHash;
+ return sal_True;
+ }
+
+ return sal_False;
+}
+
+uno::Sequence< beans::PropertyValue > SfxObjectShell::GetModifyPasswordInfo() const
+{
+ return pImp->m_aModifyPasswordInfo;
+}
+
+sal_Bool SfxObjectShell::SetModifyPasswordInfo( const uno::Sequence< beans::PropertyValue >& aInfo )
+{
+ if ( ( !IsReadOnly() && !IsReadOnlyUI() )
+ || !(pImp->nFlagsInProgress & SFX_LOADED_MAINDOCUMENT ) )
+ {
+ // the hash can be changed only in editable documents,
+ // or during loading of document
+ pImp->m_aModifyPasswordInfo = aInfo;
+ return sal_True;
+ }
+
+ return sal_False;
+}
+
+void SfxObjectShell::SetModifyPasswordEntered( sal_Bool bEntered )
+{
+ pImp->m_bModifyPasswordEntered = bEntered;
+}
+
+sal_Bool SfxObjectShell::IsModifyPasswordEntered()
+{
+ return pImp->m_bModifyPasswordEntered;
+}
+
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 628c3b020c08..e386b2382acf 100755..100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -470,6 +470,32 @@ void SfxObjectShell::SetReadOnlyUI( sal_Bool bReadOnly )
//-------------------------------------------------------------------------
+void SfxObjectShell::SetReadOnly()
+{
+ // Let the document be completely readonly, means that the
+ // medium open mode is adjusted accordingly, and the write lock
+ // on the file is removed.
+
+ if ( pMedium && !IsReadOnlyMedium() )
+ {
+ sal_Bool bWasROUI = IsReadOnly();
+
+ pMedium->UnlockFile( sal_False );
+
+ // the storage-based mediums are already based on the temporary file
+ // so UnlockFile has already closed the locking stream
+ if ( !pMedium->HasStorage_Impl() && IsLoadingFinished() )
+ pMedium->CloseInStream();
+
+ pMedium->SetOpenMode( SFX_STREAM_READONLY, pMedium->IsDirect(), sal_True );
+ pMedium->GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, sal_True ) );
+
+ if ( !bWasROUI )
+ Broadcast( SfxSimpleHint(SFX_HINT_MODECHANGED) );
+ }
+}
+//-------------------------------------------------------------------------
+
sal_Bool SfxObjectShell::IsReadOnly() const
{
return pImp->bReadOnlyUI || IsReadOnlyMedium();
@@ -706,7 +732,7 @@ void SfxObjectShell::FreeSharedFile( const ::rtl::OUString& aTempFileURL )
SetSharedXMLFlag( sal_False );
if ( IsDocShared() && aTempFileURL.getLength()
- && !SfxMedium::EqualURLs( aTempFileURL, GetSharedFileURL() ) )
+ && !::utl::UCBContentHelper::EqualURLs( aTempFileURL, GetSharedFileURL() ) )
{
if ( pImp->m_bAllowShareControlFileClean )
{
@@ -1363,6 +1389,9 @@ void SfxObjectShell::FinishedLoading( sal_uInt16 nFlags )
if( !IsAbortingImport() )
PositionView_Impl();
+ if ( ( GetModifyPasswordHash() || GetModifyPasswordInfo().getLength() ) && !IsModifyPasswordEntered() )
+ SetReadOnly();
+
// Salvage
if ( pSalvageItem )
bSetModifiedTRUE = sal_True;
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index c063546da1c7..bb0e6939ead8 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -489,6 +489,13 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
case SID_SAVEASDOC:
case SID_SAVEDOC:
{
+ // derived class may decide to abort this
+ if( !QuerySlotExecutable( nId ) )
+ {
+ rReq.SetReturnValue( SfxBoolItem( 0, FALSE ) );
+ return;
+ }
+
//!! detaillierte Auswertung eines Fehlercodes
SfxObjectShellRef xLock( this );
@@ -895,7 +902,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
rReq.Done();
}
-//--------------------------------------------------------------------
+//-------------------------------------------------------------------------
void SfxObjectShell::GetState_Impl(SfxItemSet &rSet)
{
@@ -1337,8 +1344,13 @@ sal_uInt16 SfxObjectShell::ImplGetSignatureState( sal_Bool bScriptingContent )
void SfxObjectShell::ImplSign( sal_Bool bScriptingContent )
{
// Check if it is stored in OASIS format...
- if ( GetMedium() && GetMedium()->GetFilter()
- && ( !GetMedium()->GetFilter()->IsOwnFormat() || !GetMedium()->HasStorage_Impl() ) )
+ if ( GetMedium()
+ && GetMedium()->GetFilter()
+ && GetMedium()->GetName().Len()
+ && ( !GetMedium()->GetFilter()->IsOwnFormat()
+ || !GetMedium()->HasStorage_Impl()
+ )
+ )
{
// Only OASIS and OOo6.x formats will be handled further
InfoBox( NULL, SfxResId( RID_XMLSEC_INFO_WRONGDOCFORMAT ) ).Execute();
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 6e1d89f2a8cd..037493c61252 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -195,6 +195,13 @@ sal_Bool SfxObjectShell::SaveAs( SfxMedium& rMedium )
//-------------------------------------------------------------------------
+sal_Bool SfxObjectShell::QuerySlotExecutable( USHORT /*nSlotId*/ )
+{
+ return sal_True;
+}
+
+//-------------------------------------------------------------------------
+
sal_Bool GetPasswd_Impl( const SfxItemSet* pSet, ::rtl::OUString& rPasswd )
{
const SfxPoolItem* pItem = NULL;
@@ -1182,7 +1189,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl
if ( pMedium
&& pMedium->GetName().CompareIgnoreCaseToAscii( "private:stream", 14 ) != COMPARE_EQUAL
&& rMedium.GetName().CompareIgnoreCaseToAscii( "private:stream", 14 ) != COMPARE_EQUAL
- && SfxMedium::EqualURLs( pMedium->GetName(), rMedium.GetName() ) )
+ && ::utl::UCBContentHelper::EqualURLs( pMedium->GetName(), rMedium.GetName() ) )
{
bStoreToSameLocation = sal_True;
AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Save" ) ) );
@@ -1332,7 +1339,6 @@ sal_Bool SfxObjectShell::SaveTo_Impl
{
if ( pFilt->GetServiceName() != rMedium.GetFilter()->GetServiceName() )
{
-//REMOVE rMedium.GetStorage()->SetClass( SvFactory::GetServerName( nFormat ), nFormat, pFilt->GetTypeName() );
datatransfer::DataFlavor aDataFlavor;
SotExchange::GetFormatDataFlavor( nFormat, aDataFlavor );
@@ -1911,7 +1917,25 @@ sal_Bool SfxObjectShell::ConnectTmpStorage_Impl(
bResult = SaveCompleted( xTmpStorage );
if ( bResult )
+ {
pImp->pBasicManager->setStorage( xTmpStorage );
+
+ // Get rid of this workaround after issue i113914 is fixed
+ try
+ {
+ uno::Reference< script::XStorageBasedLibraryContainer > xBasicLibraries( pImp->xBasicLibraries, uno::UNO_QUERY_THROW );
+ xBasicLibraries->setRootStorage( xTmpStorage );
+ }
+ catch( uno::Exception& )
+ {}
+ try
+ {
+ uno::Reference< script::XStorageBasedLibraryContainer > xDialogLibraries( pImp->xDialogLibraries, uno::UNO_QUERY_THROW );
+ xDialogLibraries->setRootStorage( xTmpStorage );
+ }
+ catch( uno::Exception& )
+ {}
+ }
}
catch( uno::Exception& )
{}
@@ -2049,9 +2073,6 @@ sal_Bool SfxObjectShell::DoSaveCompleted( SfxMedium* pNewMed )
}
else
{
-//REMOVE if( pFilter->UsesStorage() )
-//REMOVE pMedium->GetStorage();
-//REMOVE else if( pMedium->GetOpenMode() & STREAM_WRITE )
if( pMedium->GetOpenMode() & STREAM_WRITE )
pMedium->GetInStream();
xStorage = GetStorage();
@@ -2060,6 +2081,22 @@ sal_Bool SfxObjectShell::DoSaveCompleted( SfxMedium* pNewMed )
// TODO/LATER: may be this code will be replaced, but not sure
// Set storage in document library containers
pImp->pBasicManager->setStorage( xStorage );
+
+ // Get rid of this workaround after issue i113914 is fixed
+ try
+ {
+ uno::Reference< script::XStorageBasedLibraryContainer > xBasicLibraries( pImp->xBasicLibraries, uno::UNO_QUERY_THROW );
+ xBasicLibraries->setRootStorage( xStorage );
+ }
+ catch( uno::Exception& )
+ {}
+ try
+ {
+ uno::Reference< script::XStorageBasedLibraryContainer > xDialogLibraries( pImp->xDialogLibraries, uno::UNO_QUERY_THROW );
+ xDialogLibraries->setRootStorage( xStorage );
+ }
+ catch( uno::Exception& )
+ {}
}
else
{
@@ -2589,9 +2626,6 @@ sal_Bool SfxObjectShell::DoSave_Impl( const SfxItemSet* pArgs )
SetError(pMediumTmp->GetErrorCode(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
-//REMOVE if ( !IsHandsOff() )
-//REMOVE pMediumTmp->Close();
-
sal_Bool bOpen( sal_False );
bOpen = DoSaveCompleted( pMediumTmp );
DBG_ASSERT(bOpen,"Fehlerbehandlung fuer DoSaveCompleted nicht implementiert");
@@ -2602,13 +2636,7 @@ sal_Bool SfxObjectShell::DoSave_Impl( const SfxItemSet* pArgs )
SetError( pMediumTmp->GetError(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
// reconnect to object storage
-//REMOVE if ( IsHandsOff() )
-//REMOVE {
-//REMOVE if ( !DoSaveCompleted( pRetrMedium ) )
-//REMOVE DBG_ERROR("Case not handled - no way to get a storage!");
-//REMOVE }
-//REMOVE else
- DoSaveCompleted( 0 );
+ DoSaveCompleted( 0 );
if( pRetrMedium->GetItemSet() )
{
@@ -2867,8 +2895,6 @@ sal_Bool SfxObjectShell::PreDoSaveAs_Impl
else
pNewFile->SetFilter( GetFactory().GetFilterContainer()->GetAnyFilter( SFX_FILTER_IMPORT | SFX_FILTER_EXPORT ) );
-//REMOVE // saving is alway done using a temporary file
-//REMOVE pNewFile->CreateTempFileNoCopy();
if ( pNewFile->GetErrorCode() != ERRCODE_NONE )
{
// creating temporary file failed ( f.e. floppy disk not inserted! )
@@ -2905,18 +2931,8 @@ sal_Bool SfxObjectShell::PreDoSaveAs_Impl
SetError( pNewFile->GetErrorCode(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
// notify the document that saving was done successfully
-//REMOVE if ( bCopyTo )
-//REMOVE {
-//REMOVE if ( IsHandsOff() )
-//REMOVE bOk = DoSaveCompleted( pMedium );
-//REMOVE }
-//REMOVE else
if ( !bCopyTo )
{
- // Muss !!!
-//REMOVE if ( bToOwnFormat )
-//REMOVE SetFileName( pNewFile->GetPhysicalName() );
-
bOk = DoSaveCompleted( pNewFile );
}
else
@@ -2948,31 +2964,12 @@ sal_Bool SfxObjectShell::PreDoSaveAs_Impl
// by the storage
DELETEZ( pNewFile );
}
-
- // TODO/LATER: there is no need in the following code in case HandsOff is not used,
- // hope we will not have to introduce it back
-//REMOVE String aPasswd;
-//REMOVE if ( IsOwnStorageFormat_Impl( *GetMedium() ) && GetPasswd_Impl( GetMedium()->GetItemSet(), aPasswd ) )
-//REMOVE {
-//REMOVE try
-//REMOVE {
-//REMOVE // the following code must throw an exception in case of failure
-//REMOVE ::comphelper::OStorageHelper::SetCommonStoragePassword( GetMedium->GetStorage(), aPasswd );
-//REMOVE }
-//REMOVE catch( uno::Exception& )
-//REMOVE {
-//REMOVE // TODO: handle the error
-//REMOVE }
-//REMOVE }
}
else
{
SetError( pNewFile->GetErrorCode(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
-//REMOVE // reconnect to the old storage
-//REMOVE if ( IsHandsOff() )
-//REMOVE DoSaveCompleted( pMedium );
-//REMOVE else
+ // reconnect to the old storage
DoSaveCompleted( 0 );
DELETEZ( pNewFile );
@@ -3153,9 +3150,6 @@ sal_Bool SfxObjectShell::LoadOwnFormat( SfxMedium& rMedium )
uno::Reference< embed::XStorage > xStorage = rMedium.GetStorage();
if ( xStorage.is() )
{
-//REMOVE if ( rMedium.GetFileVersion() )
-//REMOVE xStor->SetVersion( rMedium.GetFileVersion() );
-
// Password
SFX_ITEMSET_ARG( rMedium.GetItemSet(), pPasswdItem, SfxStringItem, SID_PASSWORD, sal_False );
if ( pPasswdItem || ERRCODE_IO_ABORT != CheckPasswd_Impl( this, SFX_APP()->GetPool(), pMedium ) )
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 6502eeaeb78c..b7567b89f02f 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -247,6 +247,8 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell )
,m_bCreateTempStor( sal_False )
,m_bIsInit( sal_False )
,m_bIncomplEncrWarnShown( sal_False )
+ ,m_nModifyPasswordHash( 0 )
+ ,m_bModifyPasswordEntered( sal_False )
{
SfxObjectShell* pDoc = &_rDocShell;
SfxObjectShellArr_Impl &rArr = SFX_APP()->GetObjectShells_Impl();
@@ -524,6 +526,13 @@ SfxObjectShell* SfxObjectShell::Current()
return pFrame ? pFrame->GetObjectShell() : 0;
}
+//-------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::IsInPrepareClose() const
+{
+ return pImp->bInPrepareClose;
+}
+
//------------------------------------------------------------------------
struct BoolEnv_Impl
@@ -1074,3 +1083,43 @@ void SfxObjectShell::SetInitialized_Impl( const bool i_fromInitNew )
SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_LOADFINISHED, GlobalEventConfig::GetEventName(STR_EVENT_LOADFINISHED), this ) );
}
}
+
+
+bool SfxObjectShell::IsChangeRecording() const
+{
+ // currently this function needs to be overwritten by Writer and Calc only
+ DBG_ASSERT( 0, "function not implemented" );
+ return false;
+}
+
+
+bool SfxObjectShell::HasChangeRecordProtection() const
+{
+ // currently this function needs to be overwritten by Writer and Calc only
+ DBG_ASSERT( 0, "function not implemented" );
+ return false;
+}
+
+
+void SfxObjectShell::SetChangeRecording( bool /*bActivate*/ )
+{
+ // currently this function needs to be overwritten by Writer and Calc only
+ DBG_ASSERT( 0, "function not implemented" );
+}
+
+
+bool SfxObjectShell::SetProtectionPassword( const String & /*rPassword*/ )
+{
+ // currently this function needs to be overwritten by Writer and Calc only
+ DBG_ASSERT( 0, "function not implemented" );
+ return false;
+}
+
+
+bool SfxObjectShell::GetProtectionHash( /*out*/ ::com::sun::star::uno::Sequence< sal_Int8 > & /*rPasswordHash*/ )
+{
+ // currently this function needs to be overwritten by Writer and Calc only
+ DBG_ASSERT( 0, "function not implemented" );
+ return false;
+}
+
diff --git a/sfx2/source/doc/querytemplate.cxx b/sfx2/source/doc/querytemplate.cxx
index 8e006721351a..3e6a529bc67e 100644
--- a/sfx2/source/doc/querytemplate.cxx
+++ b/sfx2/source/doc/querytemplate.cxx
@@ -31,7 +31,7 @@
#include "querytemplate.hxx"
#include "sfxresid.hxx"
#include "doc.hrc"
-
+#include "helpid.hrc"
#include <vcl/svapp.hxx>
namespace sfx2
@@ -41,7 +41,7 @@ QueryTemplateBox::QueryTemplateBox( Window* pParent, const String& rMessage ) :
MessBox ( pParent, 0, Application::GetDisplayName(), rMessage )
{
SetImage( QueryBox::GetStandardImage() );
- SetHelpId( MSG_QUERY_LOAD_TEMPLATE );
+ SetHelpId( HID_QUERY_LOAD_TEMPLATE );
AddButton( String( SfxResId( STR_QRYTEMPL_UPDATE_BTN ) ), RET_YES,
BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON );
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index e1b37c119f1a..846cc669b9a7 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -74,6 +74,7 @@
#include <svl/itemset.hxx>
#include <svl/stritem.hxx>
#include <svl/eitem.hxx>
+#include <svl/intitem.hxx>
#include <basic/sbx.hxx>
#include <basic/sbuno.hxx>
#include <tools/urlobj.hxx>
@@ -94,6 +95,7 @@
#include <framework/titlehelper.hxx>
#include <comphelper/numberedcollection.hxx>
#include <unotools/ucbstreamhelper.hxx>
+#include <unotools/ucbhelper.hxx>
//________________________________________________________________________________________________________
// includes of my own project
@@ -976,6 +978,8 @@ sal_Bool SAL_CALL SfxBaseModel::attachResource( const ::rtl::OUString&
aArgs.remove( "BreakMacroSignature" );
aArgs.remove( "Stream" );
aArgs.remove( "InputStream" );
+ aArgs.remove( "URL" );
+ aArgs.remove( "Frame" );
// TODO/LATER: all the parameters that are accepted by ItemSet of the DocShell must be removed here
@@ -987,6 +991,10 @@ sal_Bool SAL_CALL SfxBaseModel::attachResource( const ::rtl::OUString&
SfxAllItemSet aSet( pObjectShell->GetPool() );
TransformParameters( SID_OPENDOC, rArgs, aSet );
+ // the arguments are not allowed to reach the medium
+ aSet.ClearItem( SID_FILE_NAME );
+ aSet.ClearItem( SID_FILLFRAME );
+
pMedium->GetItemSet()->Put( aSet );
SFX_ITEMSET_ARG( &aSet, pItem, SfxStringItem, SID_FILTER_NAME, sal_False );
if ( pItem )
@@ -2641,7 +2649,7 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL
sal_Bool bSaved = sal_False;
if ( !bSaveTo && m_pData->m_pObjectShell && sURL.getLength()
&& sURL.compareToAscii( "private:stream", 14 ) != COMPARE_EQUAL
- && SfxMedium::EqualURLs( getLocation(), sURL ) )
+ && ::utl::UCBContentHelper::EqualURLs( getLocation(), sURL ) )
{
// this is the same file URL as the current document location, try to use storeOwn if possible
@@ -2731,6 +2739,24 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL
uno::Reference< uno::XInterface >() );
}
+ sal_uInt32 nModifyPasswordHash = 0;
+ uno::Sequence< beans::PropertyValue > aModifyPasswordInfo;
+ SFX_ITEMSET_ARG( aParams, pModifyPasswordInfoItem, SfxUnoAnyItem, SID_MODIFYPASSWORDINFO, sal_False );
+ if ( pModifyPasswordInfoItem )
+ {
+ // it contains either a simple hash or a set of PropertyValues
+ // TODO/LATER: the sequence of PropertyValue should replace the hash completely in future
+ sal_Int32 nMPHTmp = 0;
+ pModifyPasswordInfoItem->GetValue() >>= nMPHTmp;
+ nModifyPasswordHash = (sal_uInt32)nMPHTmp;
+ pModifyPasswordInfoItem->GetValue() >>= aModifyPasswordInfo;
+ }
+ aParams->ClearItem( SID_MODIFYPASSWORDINFO );
+ sal_uInt32 nOldModifyPasswordHash = m_pData->m_pObjectShell->GetModifyPasswordHash();
+ m_pData->m_pObjectShell->SetModifyPasswordHash( nModifyPasswordHash );
+ uno::Sequence< beans::PropertyValue > aOldModifyPasswordInfo = m_pData->m_pObjectShell->GetModifyPasswordInfo();
+ m_pData->m_pObjectShell->SetModifyPasswordInfo( aModifyPasswordInfo );
+
// since saving a document modifies its DocumentInfo, the current
// DocumentInfo must be saved on "SaveTo", so it can be restored
// after saving
@@ -2809,10 +2835,15 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL
if ( !bSaveTo )
{
m_pData->m_aPreusedFilterName = GetMediumFilterName_Impl();
+ m_pData->m_pObjectShell->SetModifyPasswordEntered();
+
SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEASDOCDONE, GlobalEventConfig::GetEventName(STR_EVENT_SAVEASDOCDONE), m_pData->m_pObjectShell ) );
}
else
{
+ m_pData->m_pObjectShell->SetModifyPasswordHash( nOldModifyPasswordHash );
+ m_pData->m_pObjectShell->SetModifyPasswordInfo( aOldModifyPasswordInfo );
+
SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVETODOCDONE, GlobalEventConfig::GetEventName(STR_EVENT_SAVETODOCDONE), m_pData->m_pObjectShell ) );
}
}
@@ -2822,6 +2853,10 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL
m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Storing failed!" ) ) );
m_pData->m_pObjectShell->StoreLog();
+ m_pData->m_pObjectShell->SetModifyPasswordHash( nOldModifyPasswordHash );
+ m_pData->m_pObjectShell->SetModifyPasswordInfo( aOldModifyPasswordInfo );
+
+
SFX_APP()->NotifyEvent( SfxEventHint( bSaveTo ? SFX_EVENT_SAVETODOCFAILED : SFX_EVENT_SAVEASDOCFAILED, GlobalEventConfig::GetEventName( bSaveTo ? STR_EVENT_SAVETODOCFAILED : STR_EVENT_SAVEASDOCFAILED),
m_pData->m_pObjectShell ) );
@@ -3777,7 +3812,7 @@ css::uno::Sequence< ::rtl::OUString > SAL_CALL SfxBaseModel::getAvailableViewCon
Sequence< ::rtl::OUString > aViewNames( nViewFactoryCount );
for ( sal_Int32 nViewNo = 0; nViewNo < nViewFactoryCount; ++nViewNo )
- aViewNames[nViewNo] = rDocumentFactory.GetViewFactory( nViewNo ).GetViewName();
+ aViewNames[nViewNo] = rDocumentFactory.GetViewFactory( nViewNo ).GetAPIViewName();
return aViewNames;
}
@@ -3791,7 +3826,7 @@ css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createDef
SfxModelGuard aGuard( *this );
const SfxObjectFactory& rDocumentFactory = GetObjectShell()->GetFactory();
- const ::rtl::OUString sDefaultViewName = rDocumentFactory.GetViewFactory( 0 ).GetViewName();
+ const ::rtl::OUString sDefaultViewName = rDocumentFactory.GetViewFactory( 0 ).GetAPIViewName();
aGuard.clear();
diff --git a/sfx2/source/doc/syspathw32.cxx b/sfx2/source/doc/syspathw32.cxx
index 73bd84f5249a..c0a163bed39c 100644
--- a/sfx2/source/doc/syspathw32.cxx
+++ b/sfx2/source/doc/syspathw32.cxx
@@ -74,7 +74,7 @@ typedef unsigned short sal_uInt16;
extern "C" bool GetUserTemplateLocation(sal_Unicode* pFolder, int nSize)
{
#ifdef WNT
- return _SHGetSpecialFolderW32( CSIDL_TEMPLATES, pFolder, nSize );
+ return _SHGetSpecialFolderW32( CSIDL_TEMPLATES, reinterpret_cast<LPWSTR>(pFolder), nSize );
#else
(void)pFolder;
(void)nSize;
diff --git a/sfx2/source/inc/appdata.hxx b/sfx2/source/inc/appdata.hxx
index 91305eb95cce..bd12f3db80dc 100644
--- a/sfx2/source/inc/appdata.hxx
+++ b/sfx2/source/inc/appdata.hxx
@@ -82,6 +82,9 @@ class SfxBasicManagerCreationListener;
namespace sfx2 { namespace appl { class ImeStatusWindow; } }
+typedef Link* LinkPtr;
+SV_DECL_PTRARR(SfxInitLinkList, LinkPtr, 4, 4)
+
//=========================================================================
// SfxAppData_Impl
//=========================================================================
diff --git a/sfx2/source/inc/applet.hxx b/sfx2/source/inc/applet.hxx
deleted file mode 100644
index 5b7d61ebe314..000000000000
--- a/sfx2/source/inc/applet.hxx
+++ /dev/null
@@ -1,122 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SFX_APPLET_HXX
-#define _SFX_APPLET_HXX
-
-#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/util/XCloseable.hpp>
-#include <com/sun/star/lang/XEventListener.hpp>
-#include <com/sun/star/frame/XSynchronousFrameLoader.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/embed/XEmbeddedObject.hpp>
-#include <cppuhelper/implbase6.hxx>
-
-#include <rtl/ustring.hxx>
-#include <svl/ownlist.hxx>
-#include <svl/itemprop.hxx>
-
-namespace com { namespace sun { namespace star { namespace uno {
- class XComponentContext;
- class XInterface;
-} } } }
-
-class SjApplet2;
-namespace sfx2
-{
-
-class AppletObject : public ::cppu::WeakImplHelper6 <
- com::sun::star::util::XCloseable,
- com::sun::star::lang::XEventListener,
- com::sun::star::frame::XSynchronousFrameLoader,
- com::sun::star::ui::dialogs::XExecutableDialog,
- com::sun::star::lang::XInitialization,
- com::sun::star::beans::XPropertySet >
-{
- com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext >
- mxContext;
- com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > mxObj;
- SfxItemPropertyMap maPropMap;
- SvCommandList maCmdList;
- ::rtl::OUString maClass;
- ::rtl::OUString maName;
- ::rtl::OUString maCodeBase;
- ::rtl::OUString maDocBase;
- SjApplet2* mpApplet;
- sal_Bool mbMayScript;
-
- AppletObject( AppletObject & ); // not defined
- void operator =( AppletObject & ); // not defined
-
- AppletObject( const com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext >& rContext );
- ~AppletObject();
-
- virtual sal_Bool SAL_CALL load( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& lDescriptor,
- const com::sun::star::uno::Reference < com::sun::star::frame::XFrame >& xFrame ) throw( com::sun::star::uno::RuntimeException );
- virtual void SAL_CALL cancel() throw( com::sun::star::uno::RuntimeException );
- virtual void SAL_CALL close( sal_Bool bDeliverOwnership ) throw( com::sun::star::util::CloseVetoException, com::sun::star::uno::RuntimeException );
- virtual void SAL_CALL addCloseListener( const com::sun::star::uno::Reference < com::sun::star::util::XCloseListener >& xListener ) throw( com::sun::star::uno::RuntimeException );
- virtual void SAL_CALL removeCloseListener( const com::sun::star::uno::Reference < com::sun::star::util::XCloseListener >& xListener ) throw( com::sun::star::uno::RuntimeException );
- virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& aEvent ) throw (com::sun::star::uno::RuntimeException) ;
- virtual void SAL_CALL setTitle( const ::rtl::OUString& aTitle ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int16 SAL_CALL execute( ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw( ::com::sun::star::uno::RuntimeException );
- virtual void SAL_CALL addPropertyChangeListener(const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener > & aListener) throw( ::com::sun::star::uno::RuntimeException );
- virtual void SAL_CALL removePropertyChangeListener(const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener > & aListener) throw( ::com::sun::star::uno::RuntimeException );
- virtual void SAL_CALL addVetoableChangeListener(const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener > & aListener) throw( ::com::sun::star::uno::RuntimeException );
- virtual void SAL_CALL removeVetoableChangeListener(const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener > & aListener) throw( ::com::sun::star::uno::RuntimeException );
- virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
-
- virtual ::rtl::OUString SAL_CALL getImplementationName()
- throw( ::com::sun::star::uno::RuntimeException );
- virtual ::sal_Bool SAL_CALL supportsService(
- const ::rtl::OUString& sServiceName )
- throw( ::com::sun::star::uno::RuntimeException );
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
- getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
-
- static ::com::sun::star::uno::Sequence< ::rtl::OUString >
- impl_getStaticSupportedServiceNames();
- static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
- SAL_CALL impl_createInstance(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::uno::XComponentContext >& xContext )
- throw( ::com::sun::star::uno::Exception );
-
-public:
- static ::rtl::OUString impl_getStaticImplementationName();
- static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
- impl_createFactory();
-};
-
-}
-#endif
diff --git a/sfx2/source/inc/helpid.hrc b/sfx2/source/inc/helpid.hrc
index 848446a774e9..ef5c168c36f0 100644
--- a/sfx2/source/inc/helpid.hrc
+++ b/sfx2/source/inc/helpid.hrc
@@ -29,332 +29,312 @@
// include ------------------------------------------------------------------
-#include <svl/solar.hrc>
+#include <sfx2/sfxcommands.h>
// Help-Ids -----------------------------------------------------------------
-#define HID_GLOBAL_FALLBACK 0xFFFFFFFF
+#define HID_FILTER_SELECT "SFX2_HID_FILTER_SELECT"
+#define HID_USERDEFBMP "SFX2_HID_USERDEFBMP"
+#define HID_DOCINFO_EDT "SFX2_HID_DOCINFO_EDT"
+#define HID_PASSWD "SFX2_HID_PASSWD"
+#define HID_PRINTMONITOR "SFX2_HID_PRINTMONITOR"
+#define HID_CONFIG_OBJECTBAR "SFX2_HID_CONFIG_OBJECTBAR"
+#define HID_MANAGE_STYLES "SFX2_HID_MANAGE_STYLES"
+#define HID_CONFIG_EVENT "SFX2_HID_CONFIG_EVENT"
+#define HID_DOCINFODESC "SFX2_HID_DOCINFODESC"
+#define HID_DOCINFODOC "SFX2_HID_DOCINFODOC"
+#define HID_DOCINFOUSER "SFX2_HID_DOCINFOUSER"
+#define HID_BOOKMARKPROPS "SFX2_HID_BOOKMARKPROPS"
+#define HID_BOOKGROUPPROPS "SFX2_HID_BOOKGROUPPROPS"
+#define HID_BOOKFILEPROPS "SFX2_HID_BOOKFILEPROPS"
+#define HID_NEWS_SERVERPROPS "SFX2_HID_NEWS_SERVERPROPS"
+#define HID_NEWS_RULEPAGE "SFX2_HID_NEWS_RULEPAGE"
+#define HID_MAILINTRAYPROPS "SFX2_HID_MAILINTRAYPROPS"
+#define HID_DOCINFORELOAD "SFX2_HID_DOCINFORELOAD"
+#define HID_NEWS_GROUPPAGE "SFX2_HID_NEWS_GROUPPAGE"
+#define HID_NEWS_SERVERPAGE "SFX2_HID_NEWS_SERVERPAGE"
+#define HID_EXPLORERCONTROL "SFX2_HID_EXPLORERCONTROL"
+#define HID_BROWSERCONTROL "SFX2_HID_BROWSERCONTROL"
+#define HID_CTL_ORGANIZER_LEFT "SFX2_HID_CTL_ORGANIZER_LEFT"
+#define HID_CTL_ORGANIZER_RIGHT "SFX2_HID_CTL_ORGANIZER_RIGHT"
+#define HID_EXPLMAILSRV_GENERAL_PAGE "SFX2_HID_EXPLMAILSRV_GENERAL_PAGE"
+#define HID_EXPLMAILSRV_PROTOCOL_PAGE "SFX2_HID_EXPLMAILSRV_PROTOCOL_PAGE"
+#define HID_EXPLMAILSRV_DATAMATCH_PAGE "SFX2_HID_EXPLMAILSRV_DATAMATCH_PAGE"
+#define HID_EXPLMAILSRV_SENDJOURNAL_PAGE "SFX2_HID_EXPLMAILSRV_SENDJOURNAL_PAGE"
+#define HID_EXPLMAIL_GENERAL_PAGE "SFX2_HID_EXPLMAIL_GENERAL_PAGE"
+#define HID_NEWS_CTL_RULES "SFX2_HID_NEWS_CTL_RULES"
+#define HID_NEWS_CTL_GROUPS "SFX2_HID_NEWS_CTL_GROUPS"
+#define HID_CONFIG_OBJECTBAR_CTL "SFX2_HID_CONFIG_OBJECTBAR_CTL"
+#define HID_NEWS_QUICKSEARCH "SFX2_HID_NEWS_QUICKSEARCH"
+#define HID_NEWS_SERVERVIEWPROPS "SFX2_HID_NEWS_SERVERVIEWPROPS"
+#define HID_NEWS_SHOWARTICLEPROPS "SFX2_HID_NEWS_SHOWARTICLEPROPS"
+#define HID_NEWS_SHOWGROUPPROPS "SFX2_HID_NEWS_SHOWGROUPPROPS"
+#define HID_NEWS_USER "SFX2_HID_NEWS_USER"
+#define HID_MULTISELECTION_GENERAL_PAGE "SFX2_HID_MULTISELECTION_GENERAL_PAGE"
+#define HID_LINK_GENERAL_PAGE "SFX2_HID_LINK_GENERAL_PAGE"
+#define HID_LINK_ADDRESS_PAGE "SFX2_HID_LINK_ADDRESS_PAGE"
+#define HID_FOLDER_GENERAL_PAGE "SFX2_HID_FOLDER_GENERAL_PAGE"
+#define HID_FILE_GENERAL_PAGE "SFX2_HID_FILE_GENERAL_PAGE"
+#define HID_FTP_GENERAL_PAGE "SFX2_HID_FTP_GENERAL_PAGE"
+#define HID_PRINT_OPTIONS "SFX2_HID_PRINT_OPTIONS"
+#define HID_PREVIEW_FRAME "SFX2_HID_PREVIEW_FRAME"
+#define HID_DOCINFO_FRAME "SFX2_HID_DOCINFO_FRAME"
+#define HID_EXPLORER_FRAME "SFX2_HID_EXPLORER_FRAME"
+#define HID_APP_WIN "SFX2_HID_APP_WIN"
+#define HID_TEMPLATE_FMT "SFX2_HID_TEMPLATE_FMT"
+#define HID_TEMPLATE_FILTER "SFX2_HID_TEMPLATE_FILTER"
+#define HID_FTPSERVER_PAGE "SFX2_HID_FTPSERVER_PAGE"
+#define HID_DLG_SFX_EXP_SEARCH "SFX2_HID_DLG_SFX_EXP_SEARCH"
+#define HID_TP_SFX_EXP_SEARCH_CRITERIA "SFX2_HID_TP_SFX_EXP_SEARCH_CRITERIA"
+#define HID_TP_SFX_EXP_SEARCH_PLACE "SFX2_HID_TP_SFX_EXP_SEARCH_PLACE"
+#define HID_SEARCH_DLG_TABLB "SFX2_HID_SEARCH_DLG_TABLB"
+#define HID_TEMPLDLG_NEWBYEXAMPLE "SFX2_HID_TEMPLDLG_NEWBYEXAMPLE"
+#define HID_TEMPLDLG_UPDATEBYEXAMPLE "SFX2_HID_TEMPLDLG_UPDATEBYEXAMPLE"
+#define HID_TEMPLDLG_WATERCAN "SFX2_HID_TEMPLDLG_WATERCAN"
+#define HID_DESKTOP "SFX2_HID_DESKTOP"
+#define HID_EXPLORERTOOLSTOOLBOX "SFX2_HID_EXPLORERTOOLSTOOLBOX"
+#define HID_EXPLOREROBJECTTOOLBOX "SFX2_HID_EXPLOREROBJECTTOOLBOX"
+#define HID_RECORDINGTOOLBOX "SFX2_HID_RECORDINGTOOLBOX"
+#define HID_FULLSCREENTOOLBOX "SFX2_HID_FULLSCREENTOOLBOX"
+#define HID_HELPBAR "SFX2_HID_HELPBAR"
+#define HID_ENVTOOLBOX "SFX2_HID_ENVTOOLBOX"
+#define HID_FRAMESETEDIT_TOOLBOX "SFX2_HID_FRAMESETEDIT_TOOLBOX"
+#define HID_NAVIGATOR_WINDOW "SFX2_HID_NAVIGATOR_WINDOW"
+#define HID_TABDLG_RESET_BTN "SFX2_HID_TABDLG_RESET_BTN"
+#define HID_TABDLG_STANDARD_BTN "SFX2_HID_TABDLG_STANDARD_BTN"
+#define HID_HELPAGENT_TIP_BOX "SFX2_HID_HELPAGENT_TIP_BOX"
+#define HID_TEMPLDLG_TOOLBOX_LEFT "SFX2_HID_TEMPLDLG_TOOLBOX_LEFT"
+#define HID_TEMPLDLG_TOOLBOX_RIGHT "SFX2_HID_TEMPLDLG_TOOLBOX_RIGHT"
+#define HID_EXPLORER_SRCH_COUNT "SFX2_HID_EXPLORER_SRCH_COUNT"
+#define HID_BEAMER_SORT_ASCENDING "SFX2_HID_BEAMER_SORT_ASCENDING"
+#define HID_BEAMER_SORT_DESCENDING "SFX2_HID_BEAMER_SORT_DESCENDING"
+#define HID_EXPLORER_SRCH_LATEST_COUNT "SFX2_HID_EXPLORER_SRCH_LATEST_COUNT"
+#define HID_CONFIG_EVENT_OFFICE_BASED "SFX2_HID_CONFIG_EVENT_OFFICE_BASED"
+#define HID_CONFIG_EVENT_DOCUMENT_BASED "SFX2_HID_CONFIG_EVENT_DOCUMENT_BASED"
+#define HID_ORGANIZE_NEW "SFX2_HID_ORGANIZE_NEW"
+#define HID_ORGANIZE_DELETE "SFX2_HID_ORGANIZE_DELETE"
+#define HID_ORGANIZE_EDIT "SFX2_HID_ORGANIZE_EDIT"
+#define HID_ORGANIZE_COPY_FROM "SFX2_HID_ORGANIZE_COPY_FROM"
+#define HID_ORGANIZE_COPY_TO "SFX2_HID_ORGANIZE_COPY_TO"
+#define HID_ORGANIZE_PRINT "SFX2_HID_ORGANIZE_PRINT"
+#define HID_ORGANIZE_PRINTER_SETUP "SFX2_HID_ORGANIZE_PRINTER_SETUP"
+#define HID_ORGANIZE_RESCAN "SFX2_HID_ORGANIZE_RESCAN"
+#define HID_STYLIST_NEW "SFX2_HID_STYLIST_NEW"
+#define HID_STYLIST_EDIT "SFX2_HID_STYLIST_EDIT"
+#define HID_STYLIST_DELETE "SFX2_HID_STYLIST_DELETE"
+#define HID_EXPLORERMENU_ARRANGEICONS "SFX2_HID_EXPLORERMENU_ARRANGEICONS"
+#define HID_EXPLORERMENU_ARRANGEICONS_ONGRID "SFX2_HID_EXPLORERMENU_ARRANGEICONS_ONGRID"
+#define HID_EXPLORERMENU_FIXEDICONPOS "SFX2_HID_EXPLORERMENU_FIXEDICONPOS"
+#define HID_EXPLORERMENU_OPEN "SFX2_HID_EXPLORERMENU_OPEN"
+#define HID_EXPLORERMENU_PRINT "SFX2_HID_EXPLORERMENU_PRINT"
+#define HID_EXPLORERMENU_SEARCH "SFX2_HID_EXPLORERMENU_SEARCH"
+#define HID_EXPLORERMENU_COPY "SFX2_HID_EXPLORERMENU_COPY"
+#define HID_EXPLORERMENU_DELETE "SFX2_HID_EXPLORERMENU_DELETE"
+#define HID_EXPLORERMENU_CREATELINK "SFX2_HID_EXPLORERMENU_CREATELINK"
+#define HID_EXPLORERMENU_EDITPROPERTIES "SFX2_HID_EXPLORERMENU_EDITPROPERTIES"
+#define HID_EXPLORERMENU_DOWNLOAD "SFX2_HID_EXPLORERMENU_DOWNLOAD"
+#define HID_EXPLORERMENU_STDTEMPLATE "SFX2_HID_EXPLORERMENU_STDTEMPLATE"
+#define HID_EXPLORERDLG_FILELIST "SFX2_HID_EXPLORERDLG_FILELIST"
+#define HID_PDFOLDERS_WORKPLACE "SFX2_HID_PDFOLDERS_WORKPLACE"
+#define HID_PDFOLDERS_EXPLORER "SFX2_HID_PDFOLDERS_EXPLORER"
+#define HID_PDFOLDERS_STANDARD "SFX2_HID_PDFOLDERS_STANDARD"
+#define HID_PDFOLDERS_ROOT "SFX2_HID_PDFOLDERS_ROOT"
+#define HID_PDFOLDERS_DESKTOP "SFX2_HID_PDFOLDERS_DESKTOP"
+#define HID_CNTMENU_REMOVE_GROUP "SFX2_HID_CNTMENU_REMOVE_GROUP"
+#define HID_CNTMENU_CLEAR_CACHE "SFX2_HID_CNTMENU_CLEAR_CACHE"
+#define HID_CNT_SYNC_INFO_DLG "SFX2_HID_CNT_SYNC_INFO_DLG"
+#define HID_CNT_REMOVE_REMOVEDLIST "SFX2_HID_CNT_REMOVE_REMOVEDLIST"
+#define HID_CNT_ABORT_DIALOG "SFX2_HID_CNT_ABORT_DIALOG"
+#define HID_CNT_PAGE_PRJ_DATAEXCHANGE "SFX2_HID_CNT_PAGE_PRJ_DATAEXCHANGE"
+#define HID_CHAOSDOC_OBJECTBAR_FILE "SFX2_HID_CHAOSDOC_OBJECTBAR_FILE"
+#define HID_CHAOSDOC_OBJECTBAR_MESSAGE "SFX2_HID_CHAOSDOC_OBJECTBAR_MESSAGE"
+#define HID_CHAOSDOC_MN_PART_OPEN "SFX2_HID_CHAOSDOC_MN_PART_OPEN"
+#define HID_CHAOSDOC_MN_PART_DELETE "SFX2_HID_CHAOSDOC_MN_PART_DELETE"
+#define HID_CHAOSDOC_MN_PART_RENAME "SFX2_HID_CHAOSDOC_MN_PART_RENAME"
+#define HID_CHAOSDOC_MN_PART_SAVEAS "SFX2_HID_CHAOSDOC_MN_PART_SAVEAS"
+#define HID_EXPLORER_DOCVIEW_ICON "SFX2_HID_EXPLORER_DOCVIEW_ICON"
+#define HID_EXPLORER_DOCVIEW_DETAILS "SFX2_HID_EXPLORER_DOCVIEW_DETAILS"
+#define HID_CHAOSDOC_WIN "SFX2_HID_CHAOSDOC_WIN"
+#define HID_CHAOSDOC_WIN_HEADER "SFX2_HID_CHAOSDOC_WIN_HEADER"
+#define HID_CHAOSDOC_WIN_PARTS "SFX2_HID_CHAOSDOC_WIN_PARTS"
+#define HID_CHAOSDOC_WIN_BODY "SFX2_HID_CHAOSDOC_WIN_BODY"
+#define HID_CNT_INSERT_COLUMN "SFX2_HID_CNT_INSERT_COLUMN"
+#define HID_CNT_REMOVE_COLUMN "SFX2_HID_CNT_REMOVE_COLUMN"
+#define HID_CNT_OPT_WIDTH "SFX2_HID_CNT_OPT_WIDTH"
+#define HID_CNT_SORT_ASC "SFX2_HID_CNT_SORT_ASC"
+#define HID_CNT_SORT_DESC "SFX2_HID_CNT_SORT_DESC"
+#define HID_CNT_RULEPG_OPEN_DIR "SFX2_HID_CNT_RULEPG_OPEN_DIR"
+#define HID_CHAOSDOC_MN_HEADER_ADDRESSBOOK "SFX2_HID_CHAOSDOC_MN_HEADER_ADDRESSBOOK"
+#define HID_CHAOSDOC_MN_HEADER_COPYLINK "SFX2_HID_CHAOSDOC_MN_HEADER_COPYLINK"
+#define HID_CLEAN_CACHE "SFX2_HID_CLEAN_CACHE"
+#define HID_SBOX_LOCATION "SFX2_HID_SBOX_LOCATION"
+#define HID_SBOX_SUBSCRIBTION "SFX2_HID_SBOX_SUBSCRIBTION"
+#define HID_SBOX_CDF_SUBSCRIBTION "SFX2_HID_SBOX_CDF_SUBSCRIBTION"
+#define HID_SBOX_SCHEDULE "SFX2_HID_SBOX_SCHEDULE"
+#define HID_SBOX_NOTIFICATION "SFX2_HID_SBOX_NOTIFICATION"
+#define HID_SBOX_SDC_GENERAL "SFX2_HID_SBOX_SDC_GENERAL"
+#define HID_BRWBOX_HEADERBAR "SFX2_HID_BRWBOX_HEADERBAR"
+#define HID_CANNOT_CREATE_BMK_HERE "SFX2_HID_CANNOT_CREATE_BMK_HERE"
+#define HID_CREATE_BOOKMARK "SFX2_HID_CREATE_BOOKMARK"
+#define HID_TASKBAR "SFX2_HID_TASKBAR"
+#define HID_TASKBUTTONBAR "SFX2_HID_TASKBUTTONBAR"
+#define HID_TASKTOOLBAR "SFX2_HID_TASKTOOLBAR"
+#define HID_CHAOSDOC_SHOW_FSYS_EXTENSION "SFX2_HID_CHAOSDOC_SHOW_FSYS_EXTENSION"
+#define HID_CNT_FILE "SFX2_HID_CNT_FILE"
+#define HID_CHAOSDOC_MN_BODY_OPENLINK "SFX2_HID_CHAOSDOC_MN_BODY_OPENLINK"
+#define HID_CHAOSDOC_MN_BODY_OPENLINK_BLANK "SFX2_HID_CHAOSDOC_MN_BODY_OPENLINK_BLANK"
+#define HID_CHAOSDOC_MN_BODY_DOWNLOAD "SFX2_HID_CHAOSDOC_MN_BODY_DOWNLOAD"
+#define HID_CHAOSDOC_MN_BODY_ADDBOOKMARK "SFX2_HID_CHAOSDOC_MN_BODY_ADDBOOKMARK"
+#define HID_OPEN_MENU_CNT "SFX2_HID_OPEN_MENU_CNT"
+#define HID_CNT_OPEN_AS_TEMPLATE "SFX2_HID_CNT_OPEN_AS_TEMPLATE"
+#define HID_CNT_OPEN_AS_DOC "SFX2_HID_CNT_OPEN_AS_DOC"
+#define HID_PDFOLDERS_TEMPLATE "SFX2_HID_PDFOLDERS_TEMPLATE"
+#define HID_EXPLORER_ROOT "SFX2_HID_EXPLORER_ROOT"
+#define HID_RESET_URL "SFX2_HID_RESET_URL"
+#define HID_PHONE_DIALOG "SFX2_HID_PHONE_DIALOG"
+#define HID_QB_RESOLVE_LINK "SFX2_HID_QB_RESOLVE_LINK"
+#define HID_CHAOSDOC_MN_HEADER_FLAG_BOLD "SFX2_HID_CHAOSDOC_MN_HEADER_FLAG_BOLD"
+#define HID_CHAOSDOC_MN_HEADER_FLAG_ITALIC "SFX2_HID_CHAOSDOC_MN_HEADER_FLAG_ITALIC"
+#define HID_CHAOSDOC_MN_HEADER_BIG_HEADER "SFX2_HID_CHAOSDOC_MN_HEADER_BIG_HEADER"
+#define HID_CHAOSDOC_MN_HEADER_TEMPLATE_HEADER "SFX2_HID_CHAOSDOC_MN_HEADER_TEMPLATE_HEADER"
+#define HID_CNT_MARK_THREAD_MARKED "SFX2_HID_CNT_MARK_THREAD_MARKED"
+#define HID_CNT_MARK_THREAD_UNMARKED "SFX2_HID_CNT_MARK_THREAD_UNMARKED"
+#define HID_CNT_DLG_SEARCH_BT_SHOW "SFX2_HID_CNT_DLG_SEARCH_BT_SHOW"
+#define HID_CNT_DLG_SEARCH_BT_UPDATE "SFX2_HID_CNT_DLG_SEARCH_BT_UPDATE"
+#define HID_CNT_DLG_SEARCH_BT_SYNCHRONIZE "SFX2_HID_CNT_DLG_SEARCH_BT_SYNCHRONIZE"
+#define HID_CNT_DLG_SEARCH_BT_STOP "SFX2_HID_CNT_DLG_SEARCH_BT_STOP"
+#define HID_CNT_PAGE_HEADER "SFX2_HID_CNT_PAGE_HEADER"
+#define HID_CNT_DLG_ADDRESS "SFX2_HID_CNT_DLG_ADDRESS"
+#define HID_EXPLORERMENU_AUTO_ARRANGEICONS "SFX2_HID_EXPLORERMENU_AUTO_ARRANGEICONS"
+#define HID_EXPLORERMENU_AUTO_ADJUSTICONS "SFX2_HID_EXPLORERMENU_AUTO_ADJUSTICONS"
+#define HID_EXPLORERMENU_FREE_POSITIONING "SFX2_HID_EXPLORERMENU_FREE_POSITIONING"
+#define HID_CNT_TARGET_MENU "SFX2_HID_CNT_TARGET_MENU"
+#define HID_CNT_PAGE_DESCRIPTION "SFX2_HID_CNT_PAGE_DESCRIPTION"
+#define HID_CNT_LB_HEADER "SFX2_HID_CNT_LB_HEADER"
+#define HID_CNT_LB_DESCRIPTION "SFX2_HID_CNT_LB_DESCRIPTION"
+#define HID_GROUPVIEW_BIG_SYMBOLS "SFX2_HID_GROUPVIEW_BIG_SYMBOLS"
+#define HID_GROUPVIEW_SMALL_SYMBOLS "SFX2_HID_GROUPVIEW_SMALL_SYMBOLS"
+#define HID_GROUPVIEW_ADD_GROUP "SFX2_HID_GROUPVIEW_ADD_GROUP"
+#define HID_GROUPVIEW_REMOVE_GROUP "SFX2_HID_GROUPVIEW_REMOVE_GROUP"
+#define HID_GROUPVIEW_RENAME_GROUP "SFX2_HID_GROUPVIEW_RENAME_GROUP"
+#define HID_GROUPVIEW_ADD_BOOKMARK "SFX2_HID_GROUPVIEW_ADD_BOOKMARK"
+#define HID_GROUPVIEW_TREE "SFX2_HID_GROUPVIEW_TREE"
+#define HID_GROUPVIEW_ADD_AS_FOLDER "SFX2_HID_GROUPVIEW_ADD_AS_FOLDER"
+#define HID_GROUPVIEW_ADD_AS_BMK "SFX2_HID_GROUPVIEW_ADD_AS_BMK"
+#define HID_GROUPVIEW_REMOVE_BMK "SFX2_HID_GROUPVIEW_REMOVE_BMK"
+#define HID_GROUPVIEW_CONTENT_BIG "SFX2_HID_GROUPVIEW_CONTENT_BIG"
+#define HID_GROUPVIEW_CONTENT_SMALL "SFX2_HID_GROUPVIEW_CONTENT_SMALL"
+#define HID_GROUPVIEW_CONTENT_TREE "SFX2_HID_GROUPVIEW_CONTENT_TREE"
+#define HID_GROUPVIEW_SHOW_DOCS "SFX2_HID_GROUPVIEW_SHOW_DOCS"
+#define HID_EDIT_TEMPLATE "SFX2_HID_EDIT_TEMPLATE"
+#define HID_PDFOLDERS_GRAPHICS "SFX2_HID_PDFOLDERS_GRAPHICS"
+#define HID_PDFOLDERS_GROUPS "SFX2_HID_PDFOLDERS_GROUPS"
+#define HID_OPEN_CHOOSE_FILTER "SFX2_HID_OPEN_CHOOSE_FILTER"
+#define HID_PDFOLDERS_BOOKMARKS "SFX2_HID_PDFOLDERS_BOOKMARKS"
+#define HID_PDFOLDERS_FAVORITES_ADD "SFX2_HID_PDFOLDERS_FAVORITES_ADD"
+#define HID_PDFOLDERS_FAVORITES_REMOVE "SFX2_HID_PDFOLDERS_FAVORITES_REMOVE"
+#define HID_PDFOLDERS_HISTORY "SFX2_HID_PDFOLDERS_HISTORY"
+#define HID_CNT_CB_FORCE_BODY_EXPORT "SFX2_HID_CNT_CB_FORCE_BODY_EXPORT"
+#define HID_CNT_PAGE_REPSTATE_CONTROL "SFX2_HID_CNT_PAGE_REPSTATE_CONTROL"
+#define HID_TASKSTATUSBAR "SFX2_HID_TASKSTATUSBAR"
+#define HID_CNT_PAGE_HEADER_TABBAR "SFX2_HID_CNT_PAGE_HEADER_TABBAR"
+#define HID_CNT_PAGE_SUBSCR_TABBAR "SFX2_HID_CNT_PAGE_SUBSCR_TABBAR"
+#define HID_CHAOSDOC_MN_PART_PRINT "SFX2_HID_CHAOSDOC_MN_PART_PRINT"
+#define HID_STATUSINDICATOR_TEXT "SFX2_HID_STATUSINDICATOR_TEXT"
+#define HID_STATUSINDICATOR_PROGRESS "SFX2_HID_STATUSINDICATOR_PROGRESS"
+#define HID_CNT_VALUE_ADDED_NONE "SFX2_HID_CNT_VALUE_ADDED_NONE"
+#define HID_CNT_VALUE_ADDED_DOCINFO "SFX2_HID_CNT_VALUE_ADDED_DOCINFO"
+#define HID_CNT_VALUE_ADDED_FULL "SFX2_HID_CNT_VALUE_ADDED_FULL"
+#define HID_CNT_MESSAGE_STOREMODE_REMOTE "SFX2_HID_CNT_MESSAGE_STOREMODE_REMOTE"
+#define HID_CNT_MESSAGE_STOREMODE_LOCAL "SFX2_HID_CNT_MESSAGE_STOREMODE_LOCAL"
+#define HID_CNT_VIEW_ALL_ARTICLES "SFX2_HID_CNT_VIEW_ALL_ARTICLES"
+#define HID_CNT_VIEW_UNREAD_ARTICLES "SFX2_HID_CNT_VIEW_UNREAD_ARTICLES"
+#define HID_CNT_VIEW_READ_ARTICLES "SFX2_HID_CNT_VIEW_READ_ARTICLES"
+#define HID_CNT_VIEW_MARKED_ARTICLES "SFX2_HID_CNT_VIEW_MARKED_ARTICLES"
+#define HID_CNT_VIEW_MARKED_AND_UNREAD_ARTICLES "SFX2_HID_CNT_VIEW_MARKED_AND_UNREAD_ARTICLES"
+#define HID_CNT_VIEW_ALL_FOLDERS "SFX2_HID_CNT_VIEW_ALL_FOLDERS"
+#define HID_CNT_VIEW_SUBSCRIBED_FOLDERS "SFX2_HID_CNT_VIEW_SUBSCRIBED_FOLDERS"
+#define HID_CNT_VIEW_ACTIVE_FOLDERS "SFX2_HID_CNT_VIEW_ACTIVE_FOLDERS"
+#define HID_CNT_SENT_VIEW_ALL_ARTICLES "SFX2_HID_CNT_SENT_VIEW_ALL_ARTICLES"
+#define HID_CNT_SENT_VIEW_SENT_ARTICLES "SFX2_HID_CNT_SENT_VIEW_SENT_ARTICLES"
+#define HID_CNT_SENT_VIEW_UNSENT_ARTICLES "SFX2_HID_CNT_SENT_VIEW_UNSENT_ARTICLES"
+#define HID_CNT_SENT_VIEW_MARKED_ARTICLES "SFX2_HID_CNT_SENT_VIEW_MARKED_ARTICLES"
+#define HID_MAILWIN_SEND_BUTTON "SFX2_HID_MAILWIN_SEND_BUTTON"
+#define HID_MAILWIN_CLOSE_BUTTON "SFX2_HID_MAILWIN_CLOSE_BUTTON"
+#define HID_MAILWIN_ROLE_BOX "SFX2_HID_MAILWIN_ROLE_BOX"
+#define HID_MAILWIN_ADDRESS_EDIT "SFX2_HID_MAILWIN_ADDRESS_EDIT"
+#define HID_MAILWIN_ADDRESS_BOX "SFX2_HID_MAILWIN_ADDRESS_BOX"
+#define HID_MAILWIN_SUBJECT_EDIT "SFX2_HID_MAILWIN_SUBJECT_EDIT"
+#define HID_MAILWIN_FROM_EDIT "SFX2_HID_MAILWIN_FROM_EDIT"
+#define HID_MAILWIN_PRIO_BOX "SFX2_HID_MAILWIN_PRIO_BOX"
+#define HID_TABDLG_APPLY_BTN "SFX2_HID_TABDLG_APPLY_BTN"
+#define HID_TP_COMMONPRINTOPTIONS "SFX2_HID_TP_COMMONPRINTOPTIONS"
+#define HID_HELP_WINDOW "SFX2_HID_HELP_WINDOW"
+#define HID_HELP_LISTBOX "SFX2_HID_HELP_LISTBOX"
+#define HID_HELP_TABCONTROL "SFX2_HID_HELP_TABCONTROL"
+#define HID_HELP_TOOLBOX "SFX2_HID_HELP_TOOLBOX"
+#define HID_HELP_TOOLBOXITEM_INDEX "SFX2_HID_HELP_TOOLBOXITEM_INDEX"
+#define HID_HELP_TOOLBOXITEM_START "SFX2_HID_HELP_TOOLBOXITEM_START"
+#define HID_HELP_TOOLBOXITEM_BACKWARD "SFX2_HID_HELP_TOOLBOXITEM_BACKWARD"
+#define HID_HELP_TOOLBOXITEM_FORWARD "SFX2_HID_HELP_TOOLBOXITEM_FORWARD"
+#define HID_HELP_TOOLBOXITEM_PRINT "SFX2_HID_HELP_TOOLBOXITEM_PRINT"
+#define HID_HELP_TOOLBOXITEM_BOOKMARKS "SFX2_HID_HELP_TOOLBOXITEM_BOOKMARKS"
+#define HID_HELP_TABPAGE_CONTENTS "SFX2_HID_HELP_TABPAGE_CONTENTS"
+#define HID_HELP_TABPAGE_INDEX "SFX2_HID_HELP_TABPAGE_INDEX"
+#define HID_HELP_TABPAGE_SEARCH "SFX2_HID_HELP_TABPAGE_SEARCH"
+#define HID_HELP_TABPAGE_BOOKMARKS "SFX2_HID_HELP_TABPAGE_BOOKMARKS"
+#define HID_TBXCONTROL_FILENEW "SFX2_HID_TBXCONTROL_FILENEW"
+#define HID_ORGANIZE_STDTEMPLATE_ADD "SFX2_HID_ORGANIZE_STDTEMPLATE_ADD"
+#define HID_ORGANIZE_STDTEMPLATE_DEL "SFX2_HID_ORGANIZE_STDTEMPLATE_DEL"
+#define HID_HELP_TOOLBOXITEM_SEARCHDIALOG "SFX2_HID_HELP_TOOLBOXITEM_SEARCHDIALOG"
+#define HID_HELP_BOOKMARKS_OPEN "SFX2_HID_HELP_BOOKMARKS_OPEN"
+#define HID_HELP_BOOKMARKS_RENAME "SFX2_HID_HELP_BOOKMARKS_RENAME"
+#define HID_HELP_BOOKMARKS_DELETE "SFX2_HID_HELP_BOOKMARKS_DELETE"
+#define HID_CLOSE_WARNING "SFX2_HID_CLOSE_WARNING"
+#define HID_DID_SAVE_PACKED_XML "SFX2_HID_DID_SAVE_PACKED_XML"
+#define HID_HELP_TREELISTBOX_CONTENTS "SFX2_HID_HELP_TREELISTBOX_CONTENTS"
+#define HID_CUSTOMIZETOOLBOX "SFX2_HID_CUSTOMIZETOOLBOX"
+#define HID_CUSTOMIZETOOLBOX_FUNCTIONS "SFX2_HID_CUSTOMIZETOOLBOX_FUNCTIONS"
+#define HID_CUSTOMIZETOOLBOX_TOOLBOX "SFX2_HID_CUSTOMIZETOOLBOX_TOOLBOX"
+#define HID_HELP_TEXT_SELECTION_MODE "SFX2_HID_HELP_TEXT_SELECTION_MODE"
-#define HID_FILTER_SELECT (HID_SFX_START + 0)
-#define HID_USERDEFBMP (HID_SFX_START + 1)
-#define HID_DOCINFO_EDT (HID_SFX_START + 2)
-#define HID_PASSWD (HID_SFX_START + 3)
-#define HID_PRINTMONITOR (HID_SFX_START + 4)
-#define HID_CONFIG_OBJECTBAR (HID_SFX_START + 5)
-#define HID_MANAGE_STYLES (HID_SFX_START + 6)
-#define HID_CONFIG_EVENT (HID_SFX_START + 7)
-#define HID_DOCINFODESC (HID_SFX_START + 8)
-#define HID_DOCINFODOC (HID_SFX_START + 9)
-#define HID_DOCINFOUSER (HID_SFX_START + 10)
-#define HID_BOOKMARKPROPS (HID_SFX_START + 14)
-#define HID_BOOKGROUPPROPS (HID_SFX_START + 15)
-#define HID_BOOKFILEPROPS (HID_SFX_START + 16)
-#define HID_NEWS_SERVERPROPS (HID_SFX_START + 20)
-#define HID_NEWS_RULEPAGE (HID_SFX_START + 21)
-#define HID_MAILINTRAYPROPS (HID_SFX_START + 23)
-#define HID_DOCINFORELOAD (HID_SFX_START + 24)
-#define HID_NEWS_GROUPPAGE (HID_SFX_START + 25)
-#define HID_NEWS_SERVERPAGE (HID_SFX_START + 26)
-#define HID_FILEDLG_STANDARD (HID_SFX_START + 27)
-#define HID_FILEDLG_MANAGER (HID_SFX_START + 28)
-#define HID_FILEDLG_URL (HID_SFX_START + 29)
-#define HID_FILEDLG_FILE (HID_SFX_START + 30)
-#define HID_FILEDLG_USE_PASSWD (HID_SFX_START + 31)
-#define HID_FILEDLG_READ_ONLY (HID_SFX_START + 32)
-#define HID_EXPLORERCONTROL (HID_SFX_START + 33)
-#define HID_BROWSERCONTROL (HID_SFX_START + 34)
-#define HID_CTL_ORGANIZER_LEFT (HID_SFX_START + 35)
-#define HID_CTL_ORGANIZER_RIGHT (HID_SFX_START + 36)
-#define HID_EXPLMAILSRV_GENERAL_PAGE (HID_SFX_START + 37)
-#define HID_EXPLMAILSRV_PROTOCOL_PAGE (HID_SFX_START + 38)
-#define HID_EXPLMAILSRV_DATAMATCH_PAGE (HID_SFX_START + 39)
-#define HID_EXPLMAILSRV_SENDJOURNAL_PAGE (HID_SFX_START + 40)
-#define HID_EXPLMAIL_GENERAL_PAGE (HID_SFX_START + 41)
-#define HID_NEWS_CTL_RULES (HID_SFX_START + 42)
-#define HID_NEWS_CTL_GROUPS (HID_SFX_START + 43)
-#define HID_CONFIG_OBJECTBAR_CTL (HID_SFX_START + 44)
-#define HID_NEWS_QUICKSEARCH (HID_SFX_START + 45)
-#define HID_NEWS_SERVERVIEWPROPS (HID_SFX_START + 46)
-#define HID_NEWS_SHOWARTICLEPROPS (HID_SFX_START + 47)
-#define HID_NEWS_SHOWGROUPPROPS (HID_SFX_START + 48)
-#define HID_NEWS_USER (HID_SFX_START + 49)
-#define HID_MULTISELECTION_GENERAL_PAGE (HID_SFX_START + 50)
-#define HID_LINK_GENERAL_PAGE (HID_SFX_START + 51)
-#define HID_LINK_ADDRESS_PAGE (HID_SFX_START + 52)
-#define HID_FOLDER_GENERAL_PAGE (HID_SFX_START + 53)
-#define HID_FILE_GENERAL_PAGE (HID_SFX_START + 54)
-#define HID_FTP_GENERAL_PAGE (HID_SFX_START + 55)
-#define HID_PRINT_OPTIONS (HID_SFX_START + 56)
-#define HID_PREVIEW_FRAME (HID_SFX_START + 57)
-#define HID_DOCINFO_FRAME (HID_SFX_START + 58)
-#define HID_EXPLORER_FRAME (HID_SFX_START + 59)
-#define HID_APP_WIN (HID_SFX_START + 60)
-#define HID_TEMPLATE_FMT (HID_SFX_START + 61)
-#define HID_TEMPLATE_FILTER (HID_SFX_START + 62)
-#define HID_FTPSERVER_PAGE (HID_SFX_START + 63)
-#define HID_DLG_SFX_EXP_SEARCH (HID_SFX_START + 65)
-#define HID_TP_SFX_EXP_SEARCH_CRITERIA (HID_SFX_START + 66)
-#define HID_TP_SFX_EXP_SEARCH_PLACE (HID_SFX_START + 67)
-#define HID_SEARCH_DLG_TABLB (HID_SFX_START + 68)
-#define HID_TEMPLDLG_NEWBYEXAMPLE (HID_SFX_START + 69)
-#define HID_TEMPLDLG_UPDATEBYEXAMPLE (HID_SFX_START + 70)
-#define HID_TEMPLDLG_WATERCAN (HID_SFX_START + 71)
-#define HID_DESKTOP (HID_SFX_START + 78)
-#define HID_EXPLORERTOOLSTOOLBOX (HID_SFX_START + 79)
-#define HID_EXPLOREROBJECTTOOLBOX (HID_SFX_START + 80)
-#define HID_RECORDINGTOOLBOX (HID_SFX_START + 81)
-#define HID_FULLSCREENTOOLBOX (HID_SFX_START + 82)
-#define HID_HELPBAR (HID_SFX_START + 83)
-#define HID_ENVTOOLBOX (HID_SFX_START + 84)
-#define HID_FRAMESETEDIT_TOOLBOX (HID_SFX_START + 85)
-#define HID_NAVIGATOR_WINDOW (HID_SFX_START + 86)
-#define HID_TABDLG_RESET_BTN (HID_SFX_START + 89)
-#define HID_TABDLG_STANDARD_BTN (HID_SFX_START + 90)
-#define HID_HELPAGENT_TIP_BOX (HID_SFX_START + 91)
-#define HID_TEMPLDLG_TOOLBOX_LEFT (HID_SFX_START + 92)
-#define HID_TEMPLDLG_TOOLBOX_RIGHT (HID_SFX_START + 93)
-#define HID_EXPLORER_SRCH_COUNT (HID_SFX_START + 94)
-#define HID_BEAMER_SORT_ASCENDING (HID_SFX_START + 95)
-#define HID_BEAMER_SORT_DESCENDING (HID_SFX_START + 96)
-#define HID_EXPLORER_SRCH_LATEST_COUNT (HID_SFX_START + 97)
-#define HID_CONFIG_EVENT_OFFICE_BASED (HID_SFX_START + 98)
-#define HID_CONFIG_EVENT_DOCUMENT_BASED (HID_SFX_START + 99)
-#define HID_ORGANIZE_NEW (HID_SFX_START + 100)
-#define HID_ORGANIZE_DELETE (HID_SFX_START + 101)
-#define HID_ORGANIZE_EDIT (HID_SFX_START + 102)
-#define HID_ORGANIZE_COPY_FROM (HID_SFX_START + 103)
-#define HID_ORGANIZE_COPY_TO (HID_SFX_START + 104)
-#define HID_ORGANIZE_PRINT (HID_SFX_START + 105)
-#define HID_ORGANIZE_PRINTER_SETUP (HID_SFX_START + 106)
-#define HID_ORGANIZE_RESCAN (HID_SFX_START + 107)
-#define HID_STYLIST_NEW (HID_SFX_START + 108)
-#define HID_STYLIST_EDIT (HID_SFX_START + 109)
-#define HID_STYLIST_DELETE (HID_SFX_START + 110)
-#define HID_EXPLORERMENU_ARRANGEICONS (HID_SFX_START + 111)
-#define HID_EXPLORERMENU_ARRANGEICONS_ONGRID (HID_SFX_START + 112)
-#define HID_EXPLORERMENU_FIXEDICONPOS (HID_SFX_START + 113)
-#define HID_EXPLORERMENU_OPEN (HID_SFX_START + 114)
-#define HID_EXPLORERMENU_PRINT (HID_SFX_START + 115)
-#define HID_EXPLORERMENU_SEARCH (HID_SFX_START + 116)
-#define HID_EXPLORERMENU_COPY (HID_SFX_START + 117)
-#define HID_EXPLORERMENU_DELETE (HID_SFX_START + 118)
-#define HID_EXPLORERMENU_CREATELINK (HID_SFX_START + 119)
-#define HID_EXPLORERMENU_EDITPROPERTIES (HID_SFX_START + 120)
-#define HID_EXPLORERMENU_DOWNLOAD (HID_SFX_START + 121)
-#define HID_EXPLORERMENU_STDTEMPLATE (HID_SFX_START + 122)
-#define HID_EXPLORERDLG_FILELIST (HID_SFX_START + 124)
-#define HID_PDFOLDERS_WORKPLACE (HID_SFX_START + 125)
-#define HID_PDFOLDERS_EXPLORER (HID_SFX_START + 126)
-#define HID_PDFOLDERS_STANDARD (HID_SFX_START + 127)
-#define HID_PDFOLDERS_ROOT (HID_SFX_START + 128)
-#define HID_PDFOLDERS_DESKTOP (HID_SFX_START + 129)
-#define HID_CNTMENU_REMOVE_GROUP (HID_SFX_START + 130)
-#define HID_CNTMENU_CLEAR_CACHE (HID_SFX_START + 131)
-#define HID_CNT_SYNC_INFO_DLG (HID_SFX_START + 132)
-#define HID_CNT_REMOVE_REMOVEDLIST (HID_SFX_START + 133)
-#define HID_CNT_ABORT_DIALOG (HID_SFX_START + 134)
-#define HID_CNT_PAGE_PRJ_DATAEXCHANGE (HID_SFX_START + 135)
-#define HID_CHAOSDOC_OBJECTBAR_FILE (HID_SFX_START + 136)
-#define HID_CHAOSDOC_OBJECTBAR_MESSAGE (HID_SFX_START + 137)
-#define HID_CHAOSDOC_MN_PART_OPEN (HID_SFX_START + 138)
-#define HID_CHAOSDOC_MN_PART_DELETE (HID_SFX_START + 139)
-#define HID_CHAOSDOC_MN_PART_RENAME (HID_SFX_START + 140)
-#define HID_CHAOSDOC_MN_PART_SAVEAS (HID_SFX_START + 141)
-#define HID_EXPLORER_DOCVIEW_ICON (HID_SFX_START + 142)
-#define HID_EXPLORER_DOCVIEW_DETAILS (HID_SFX_START + 143)
-#define HID_CHAOSDOC_WIN (HID_SFX_START + 144)
-#define HID_CHAOSDOC_WIN_HEADER (HID_SFX_START + 145)
-#define HID_CHAOSDOC_WIN_PARTS (HID_SFX_START + 146)
-#define HID_CHAOSDOC_WIN_BODY (HID_SFX_START + 147)
-#define HID_CNT_INSERT_COLUMN (HID_SFX_START + 148)
-#define HID_CNT_REMOVE_COLUMN (HID_SFX_START + 149)
-#define HID_CNT_OPT_WIDTH (HID_SFX_START + 150)
-#define HID_CNT_SORT_ASC (HID_SFX_START + 151)
-#define HID_CNT_SORT_DESC (HID_SFX_START + 152)
-#define HID_CNT_RULEPG_OPEN_DIR (HID_SFX_START + 153)
-#define HID_CHAOSDOC_MN_HEADER_ADDRESSBOOK (HID_SFX_START + 154)
-#define HID_CHAOSDOC_MN_HEADER_COPYLINK (HID_SFX_START + 155)
-#define HID_CLEAN_CACHE (HID_SFX_START + 156)
-#define HID_SBOX_LOCATION (HID_SFX_START + 157)
-#define HID_SBOX_SUBSCRIBTION (HID_SFX_START + 158)
-#define HID_SBOX_CDF_SUBSCRIBTION (HID_SFX_START + 159)
-#define HID_SBOX_SCHEDULE (HID_SFX_START + 160)
-#define HID_SBOX_NOTIFICATION (HID_SFX_START + 161)
-#define HID_SBOX_SDC_GENERAL (HID_SFX_START + 162)
-#define HID_BRWBOX_HEADERBAR (HID_SFX_START + 163)
-#define HID_CANNOT_CREATE_BMK_HERE (HID_SFX_START + 164)
-#define HID_CREATE_BOOKMARK (HID_SFX_START + 165)
-#define HID_TASKBAR (HID_SFX_START + 166)
-#define HID_TASKBUTTONBAR (HID_SFX_START + 167)
-#define HID_TASKTOOLBAR (HID_SFX_START + 168)
-#define HID_CHAOSDOC_SHOW_FSYS_EXTENSION (HID_SFX_START + 169)
-#define HID_CNT_FILE (HID_SFX_START + 170)
-#define HID_CHAOSDOC_MN_BODY_OPENLINK (HID_SFX_START + 171)
-#define HID_CHAOSDOC_MN_BODY_OPENLINK_BLANK (HID_SFX_START + 172)
-#define HID_CHAOSDOC_MN_BODY_DOWNLOAD (HID_SFX_START + 173)
-#define HID_CHAOSDOC_MN_BODY_ADDBOOKMARK (HID_SFX_START + 174)
-#define HID_OPEN_MENU_CNT (HID_SFX_START + 175)
-#define HID_CNT_OPEN_AS_TEMPLATE (HID_SFX_START + 176)
-#define HID_CNT_OPEN_AS_DOC (HID_SFX_START + 177)
-#define HID_PDFOLDERS_TEMPLATE (HID_SFX_START + 178)
-#define HID_EXPLORER_ROOT (HID_SFX_START + 179)
-#define HID_RESET_URL (HID_SFX_START + 180)
-#define HID_PHONE_DIALOG (HID_SFX_START + 181)
-#define HID_QB_RESOLVE_LINK (HID_SFX_START + 182)
-#define HID_CHAOSDOC_MN_HEADER_FLAG_BOLD (HID_SFX_START + 183)
-#define HID_CHAOSDOC_MN_HEADER_FLAG_ITALIC (HID_SFX_START + 184)
-#define HID_CHAOSDOC_MN_HEADER_BIG_HEADER (HID_SFX_START + 185)
-#define HID_CHAOSDOC_MN_HEADER_TEMPLATE_HEADER (HID_SFX_START + 186)
-#define HID_CNT_MARK_THREAD_MARKED (HID_SFX_START + 187)
-#define HID_CNT_MARK_THREAD_UNMARKED (HID_SFX_START + 188)
-#define HID_CNT_DLG_SEARCH_BT_SHOW (HID_SFX_START + 189)
-#define HID_CNT_DLG_SEARCH_BT_UPDATE (HID_SFX_START + 190)
-#define HID_CNT_DLG_SEARCH_BT_SYNCHRONIZE (HID_SFX_START + 191)
-#define HID_CNT_DLG_SEARCH_BT_STOP (HID_SFX_START + 192)
-#define HID_CNT_PAGE_HEADER (HID_SFX_START + 193)
-#define HID_CNT_DLG_ADDRESS (HID_SFX_START + 194)
-#define HID_EXPLORERMENU_AUTO_ARRANGEICONS (HID_SFX_START + 195)
-#define HID_EXPLORERMENU_AUTO_ADJUSTICONS (HID_SFX_START + 196)
-#define HID_EXPLORERMENU_FREE_POSITIONING (HID_SFX_START + 197)
-#define HID_CNT_TARGET_MENU (HID_SFX_START + 198)
-#define HID_CNT_PAGE_DESCRIPTION (HID_SFX_START + 199)
-#define HID_CNT_LB_HEADER (HID_SFX_START + 200)
-#define HID_CNT_LB_DESCRIPTION (HID_SFX_START + 201)
-#define HID_GROUPVIEW_BIG_SYMBOLS (HID_SFX_START + 202)
-#define HID_GROUPVIEW_SMALL_SYMBOLS (HID_SFX_START + 203)
-#define HID_GROUPVIEW_ADD_GROUP (HID_SFX_START + 204)
-#define HID_GROUPVIEW_REMOVE_GROUP (HID_SFX_START + 205)
-#define HID_GROUPVIEW_RENAME_GROUP (HID_SFX_START + 206)
-#define HID_GROUPVIEW_ADD_BOOKMARK (HID_SFX_START + 207)
-#define HID_GROUPVIEW_TREE (HID_SFX_START + 208)
-#define HID_GROUPVIEW_ADD_AS_FOLDER (HID_SFX_START + 209)
-#define HID_GROUPVIEW_ADD_AS_BMK (HID_SFX_START + 210)
-#define HID_GROUPVIEW_REMOVE_BMK (HID_SFX_START + 211)
-#define HID_GROUPVIEW_CONTENT_BIG (HID_SFX_START + 212)
-#define HID_GROUPVIEW_CONTENT_SMALL (HID_SFX_START + 213)
-#define HID_GROUPVIEW_CONTENT_TREE (HID_SFX_START + 214)
-#define HID_GROUPVIEW_SHOW_DOCS (HID_SFX_START + 215)
-#define HID_EDIT_TEMPLATE (HID_SFX_START + 216)
-#define HID_PDFOLDERS_GRAPHICS (HID_SFX_START + 217)
-#define HID_FILEDLG_AUTOCOMPLETEBOX (HID_SFX_START + 218)
-#define HID_FILEDLG_SAVE_BTN (HID_SFX_START + 219)
-#define HID_FILEDLG_SAVE_FILENAME (HID_SFX_START + 220)
-#define HID_FILEDLG_SAVE_FILETYPE (HID_SFX_START + 221)
-#define HID_FILEDLG_INSERT_BTN (HID_SFX_START + 222)
-#define HID_FILEDLG_PATH_BTN (HID_SFX_START + 223)
-#define HID_FILEDLG_PATH_FILENAME (HID_SFX_START + 224)
-#define HID_FILEDLG_FOLDER_BTN (HID_SFX_START + 225)
-#define HID_FILEDLG_FOLDER_FILENAME (HID_SFX_START + 226)
-#define HID_FILEDLG_SRCHFOLDER_BTN (HID_SFX_START + 227)
-#define HID_PDFOLDERS_GROUPS (HID_SFX_START + 228)
-#define HID_OPEN_CHOOSE_FILTER (HID_SFX_START + 229)
-#define HID_PDFOLDERS_BOOKMARKS (HID_SFX_START + 230)
-#define HID_PDFOLDERS_FAVORITES_ADD (HID_SFX_START + 231)
-#define HID_PDFOLDERS_FAVORITES_REMOVE (HID_SFX_START + 232)
-#define HID_PDFOLDERS_HISTORY (HID_SFX_START + 233)
-#define HID_FILEDLG_EDIT_FAVORITES (HID_SFX_START + 234)
-#define HID_FILEDLG_NEW_FAVORITE (HID_SFX_START + 235)
-#define HID_FILEDLG_EDIT_FAVORITES_LISTBOX (HID_SFX_START + 236)
-#define HID_FILEDLG_EDIT_FAVORITES_HEADERBAR (HID_SFX_START + 237)
-#define HID_CNT_CB_FORCE_BODY_EXPORT (HID_SFX_START + 240)
-#define HID_CNT_PAGE_REPSTATE_CONTROL (HID_SFX_START + 241)
-#define HID_TASKSTATUSBAR (HID_SFX_START + 242)
-#define HID_CNT_PAGE_HEADER_TABBAR (HID_SFX_START + 244)
-#define HID_CNT_PAGE_SUBSCR_TABBAR (HID_SFX_START + 245)
-#define HID_CHAOSDOC_MN_PART_PRINT (HID_SFX_START + 246)
-#define HID_STATUSINDICATOR_TEXT (HID_SFX_START + 247)
-#define HID_STATUSINDICATOR_PROGRESS (HID_SFX_START + 248)
-#define HID_CNT_VALUE_ADDED_NONE (HID_SFX_START + 249)
-#define HID_CNT_VALUE_ADDED_DOCINFO (HID_SFX_START + 250)
-#define HID_CNT_VALUE_ADDED_FULL (HID_SFX_START + 251)
-#define HID_CNT_MESSAGE_STOREMODE_REMOTE (HID_SFX_START + 252)
-#define HID_CNT_MESSAGE_STOREMODE_LOCAL (HID_SFX_START + 253)
-#define HID_CNT_VIEW_ALL_ARTICLES (HID_SFX_START + 254)
-#define HID_CNT_VIEW_UNREAD_ARTICLES (HID_SFX_START + 255)
-#define HID_CNT_VIEW_READ_ARTICLES (HID_SFX_START + 256)
-#define HID_CNT_VIEW_MARKED_ARTICLES (HID_SFX_START + 257)
-#define HID_CNT_VIEW_MARKED_AND_UNREAD_ARTICLES (HID_SFX_START + 258)
-#define HID_CNT_VIEW_ALL_FOLDERS (HID_SFX_START + 259)
-#define HID_CNT_VIEW_SUBSCRIBED_FOLDERS (HID_SFX_START + 260)
-#define HID_CNT_VIEW_ACTIVE_FOLDERS (HID_SFX_START + 261)
-#define HID_CNT_SENT_VIEW_ALL_ARTICLES (HID_SFX_START + 262)
-#define HID_CNT_SENT_VIEW_SENT_ARTICLES (HID_SFX_START + 263)
-#define HID_CNT_SENT_VIEW_UNSENT_ARTICLES (HID_SFX_START + 264)
-#define HID_CNT_SENT_VIEW_MARKED_ARTICLES (HID_SFX_START + 265)
-#define HID_MAILWIN_SEND_BUTTON (HID_SFX_START + 266)
-#define HID_MAILWIN_CLOSE_BUTTON (HID_SFX_START + 267)
-#define HID_MAILWIN_ROLE_BOX (HID_SFX_START + 268)
-#define HID_MAILWIN_ADDRESS_EDIT (HID_SFX_START + 269)
-#define HID_MAILWIN_ADDRESS_BOX (HID_SFX_START + 270)
-#define HID_MAILWIN_SUBJECT_EDIT (HID_SFX_START + 271)
-#define HID_MAILWIN_FROM_EDIT (HID_SFX_START + 272)
-#define HID_MAILWIN_PRIO_BOX (HID_SFX_START + 273)
-#define HID_TABDLG_APPLY_BTN (HID_SFX_START + 274)
-#define HID_TP_COMMONPRINTOPTIONS (HID_SFX_START + 275)
-#define HID_FILEDLG_LINK_CB (HID_SFX_START + 276)
-#define HID_FILEDLG_PREVIEW_CB (HID_SFX_START + 277)
-#define HID_HELP_WINDOW (HID_SFX_START + 278)
-#define HID_HELP_LISTBOX (HID_SFX_START + 279)
-#define HID_HELP_TABCONTROL (HID_SFX_START + 280)
-#define HID_HELP_TOOLBOX (HID_SFX_START + 281)
-#define HID_HELP_TOOLBOXITEM_INDEX (HID_SFX_START + 282)
-#define HID_HELP_TOOLBOXITEM_START (HID_SFX_START + 283)
-#define HID_HELP_TOOLBOXITEM_BACKWARD (HID_SFX_START + 284)
-#define HID_HELP_TOOLBOXITEM_FORWARD (HID_SFX_START + 285)
-#define HID_HELP_TOOLBOXITEM_PRINT (HID_SFX_START + 286)
-#define HID_HELP_TOOLBOXITEM_BOOKMARKS (HID_SFX_START + 287)
-#define HID_HELP_TABPAGE_CONTENTS (HID_SFX_START + 288)
-#define HID_HELP_TABPAGE_INDEX (HID_SFX_START + 289)
-#define HID_HELP_TABPAGE_SEARCH (HID_SFX_START + 290)
-#define HID_HELP_TABPAGE_BOOKMARKS (HID_SFX_START + 291)
-#define HID_TBXCONTROL_FILENEW (HID_SFX_START + 292)
-#define HID_ORGANIZE_STDTEMPLATE_ADD (HID_SFX_START + 293)
-#define HID_ORGANIZE_STDTEMPLATE_DEL (HID_SFX_START + 294)
-#define HID_HELP_TOOLBOXITEM_SEARCHDIALOG (HID_SFX_START + 295)
-#define HID_HELP_BOOKMARKS_OPEN (HID_SFX_START + 296)
-#define HID_HELP_BOOKMARKS_RENAME (HID_SFX_START + 297)
-#define HID_HELP_BOOKMARKS_DELETE (HID_SFX_START + 298)
-#define HID_CLOSE_WARNING (HID_SFX_START + 299)
-#define HID_DID_SAVE_PACKED_XML (HID_SFX_START + 300)
-#define HID_HELP_TREELISTBOX_CONTENTS (HID_SFX_START + 301)
-#define HID_CUSTOMIZETOOLBOX (HID_SFX_START + 302)
-#define HID_CUSTOMIZETOOLBOX_FUNCTIONS (HID_SFX_START + 303)
-#define HID_CUSTOMIZETOOLBOX_TOOLBOX (HID_SFX_START + 304)
-#define HID_HELP_TEXT_SELECTION_MODE (HID_SFX_START + 305)
+#define HID_WARNING_SECURITY_HYPERLINK "SFX2_HID_WARNING_SECURITY_HYPERLINK"
+#define HID_USERDEFBMP_TOOLBOX "SFX2_HID_USERDEFBMP_TOOLBOX"
-#define HID_WARNING_SECURITY_HYPERLINK (HID_SFX_START + 306)
-#define HID_FILEDLG_EXPORTASPDF (HID_SFX_START + 307)
-#define HID_USERDEFBMP_TOOLBOX (HID_SFX_START + 308)
+#define HID_CONFIG_LOAD "SFX2_HID_CONFIG_LOAD"
+#define HID_CONFIG_SAVE "SFX2_HID_CONFIG_SAVE"
-#define HID_CONFIG_LOAD (HID_SFX_START + 309)
-#define HID_CONFIG_SAVE (HID_SFX_START + 310)
+#define HID_SEARCHDIALOG "SFX2_HID_SEARCHDIALOG"
-#define HID_SEARCHDIALOG (HID_SFX_START + 311)
-#define HID_TASKPANE_WINDOW (HID_SFX_START + 312)
-#define HID_TASKPANE_VIEW_MENU (HID_SFX_START + 313)
-#define HID_XMLSEC_WARNING_BROKENSIGNATURE (HID_SFX_START + 314)
-#define HID_XMLSEC_QUERY_LOSINGSIGNATURE (HID_SFX_START + 315)
-#define HID_XMLSEC_QUERY_SAVEBEFORESIGN (HID_SFX_START + 316)
-#define HID_XMLSECDLG_MACROWARN (HID_SFX_START + 317)
-#define HID_XMLSEC_INFO_WRONGDOCFORMAT (HID_SFX_START + 318)
-#define HID_WARNING_MACROSDISABLED (HID_SFX_START + 319)
-#define HID_WARNING_ALIENFORMAT (HID_SFX_START + 320)
-#define HID_HELP_ONSTARTUP_BOX (HID_SFX_START + 321)
-#define HID_DLG_CHECKFORONLINEUPDATE (HID_SFX_START + 322)
-#define HID_TP_CUSTOMPROPERTIES (HID_SFX_START + 324)
-#define HID_CTRL_CUSTOMPROPERTIES (HID_SFX_START + 325)
-#define HID_CTRL_CUSTOMPROPS_YES_NO (HID_SFX_START + 326)
-#define HID_DLG_CUSTOMPROPS_DURATION (HID_SFX_START + 327)
+#define HID_XMLSEC_WARNING_BROKENSIGNATURE "SFX2_HID_XMLSEC_WARNING_BROKENSIGNATURE"
+#define HID_XMLSEC_QUERY_LOSINGSIGNATURE "SFX2_HID_XMLSEC_QUERY_LOSINGSIGNATURE"
+#define HID_XMLSEC_QUERY_SAVEBEFORESIGN "SFX2_HID_XMLSEC_QUERY_SAVEBEFORESIGN"
+#define HID_XMLSECDLG_MACROWARN "SFX2_HID_XMLSECDLG_MACROWARN"
+#define HID_XMLSEC_INFO_WRONGDOCFORMAT "SFX2_HID_XMLSEC_INFO_WRONGDOCFORMAT"
+#define HID_WARNING_MACROSDISABLED "SFX2_HID_WARNING_MACROSDISABLED"
+#define HID_WARNING_ALIENFORMAT "SFX2_HID_WARNING_ALIENFORMAT"
+#define HID_HELP_ONSTARTUP_BOX "SFX2_HID_HELP_ONSTARTUP_BOX"
+#define HID_DLG_CHECKFORONLINEUPDATE "SFX2_HID_DLG_CHECKFORONLINEUPDATE"
+#define HID_TP_CUSTOMPROPERTIES "SFX2_HID_TP_CUSTOMPROPERTIES"
+#define HID_CTRL_CUSTOMPROPERTIES "SFX2_HID_CTRL_CUSTOMPROPERTIES"
+#define HID_CTRL_CUSTOMPROPS_YES_NO "SFX2_HID_CTRL_CUSTOMPROPS_YES_NO"
+#define HID_DLG_CUSTOMPROPS_DURATION "SFX2_HID_DLG_CUSTOMPROPS_DURATION"
-#define ACT_SFX_HID_END HID_DLG_CUSTOMPROPS_DURATION
+#define HID_HELP_ONHELP "SFX2_HID_HELP_ONHELP"
-// "Uberlaufpr"ufung --------------------------------------------------------
+#define HID_QUERY_LOAD_TEMPLATE "SFX2_HID_QUERY_LOAD_TEMPLATE"
-#if ACT_SFX_HID_END > HID_SFX_END
-#error Resource-Ueberlauf in #line, #file
-#endif
+#define HID_SECURITYTAB_PASSWORD_TO_OPEN "SFX2_HID_SECURITYTAB_PASSWORD_TO_OPEN"
+#define HID_SECURITYTAB_CONFIRM_PASSWORD_TO_OPEN "SFX2_HID_SECURITYTAB_CONFIRM_PASSWORD_TO_OPEN"
+#define HID_SECURITYTAB_PASSWORD_TO_MODIFY "SFX2_HID_SECURITYTAB_PASSWORD_TO_MODIFY"
+#define HID_SECURITYTAB_CONFIRM_PASSWORD_TO_MODIFY "SFX2_HID_SECURITYTAB_CONFIRM_PASSWORD_TO_MODIFY"
+#define HID_SECURITYTAB_OPEN_FILE_READONLY "SFX2_HID_SECURITYTAB_OPEN_FILE_READONLY"
+#define HID_SECURITYTAB_RECORD_CHANGES "SFX2_HID_SECURITYTAB_RECORD_CHANGES"
+#define HID_SECURITYTAB_PROTECTION "SFX2_HID_SECURITYTAB_PROTECTION"
-#define HID_HELP_ONHELP 68245
+#define HID_TASKPANE_WINDOW "SFX2_HID_TASKPANE_WINDOW"
+#define HID_TASKPANE_VIEW_MENU "SFX2_HID_TASKPANE_VIEW_MENU"
+#define HID_DOCINFOSECURITY "SFX2_HID_DOCINFOSECURITY"
#endif // #ifndef _SFX_HELPID_HRC
diff --git a/sfx2/source/inc/objshimp.hxx b/sfx2/source/inc/objshimp.hxx
index a882cfedd821..b5087fb46294 100644
--- a/sfx2/source/inc/objshimp.hxx
+++ b/sfx2/source/inc/objshimp.hxx
@@ -149,6 +149,10 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess
sal_Bool m_bIncomplEncrWarnShown;
+ // TODO/LATER: m_aModifyPasswordInfo should completely replace m_nModifyPasswordHash in future
+ sal_uInt32 m_nModifyPasswordHash;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > m_aModifyPasswordInfo;
+ sal_Bool m_bModifyPasswordEntered;
SfxObjectShell_Impl( SfxObjectShell& _rDocShell );
virtual ~SfxObjectShell_Impl();
diff --git a/sfx2/source/inc/workwin.hxx b/sfx2/source/inc/workwin.hxx
index a82b72bc2947..0e263a58b90e 100644
--- a/sfx2/source/inc/workwin.hxx
+++ b/sfx2/source/inc/workwin.hxx
@@ -28,6 +28,7 @@
#define _SFXWORKWIN_HXX
#include <vector>
+#include <deque>
#include <com/sun/star/frame/XDispatch.hpp>
#include <com/sun/star/frame/XFrame.hpp>
#ifndef _COM_SUN_STAR_UI_XUILEMENT_HPP_
@@ -175,11 +176,10 @@ enum SfxDockingConfig
DECL_PTRARRAY( SfxChildList_Impl, SfxChild_Impl*, 2, 2 )
DECL_PTRARRAY( SfxChildWindows_Impl, SfxChildWin_Impl*, 2, 2 )
-SV_DECL_OBJARR( SfxObjectBarArr_Impl, SfxObjectBar_Impl, 1, 2 )
struct SfxObjectBarList_Impl
{
- SfxObjectBarArr_Impl aArr;
+ std::deque<SfxObjectBar_Impl> aArr;
USHORT nAct;
SfxObjectBar_Impl operator[] ( USHORT n )
diff --git a/sfx2/source/menu/menu.src b/sfx2/source/menu/menu.src
index a2e07a3348b0..5e3d8296bb59 100644
--- a/sfx2/source/menu/menu.src
+++ b/sfx2/source/menu/menu.src
@@ -26,6 +26,7 @@
************************************************************************/
#include "menu.hrc"
+#include <sfx2/sfxcommands.h>
String STR_MENU_CFGITEM
{
@@ -44,19 +45,19 @@ Menu MN_CLIPBOARDFUNCS
MenuItem
{
Identifier = SID_CUT ;
- HelpID = SID_CUT ;
+ HelpID = CMD_SID_CUT ;
Text [ en-US ] = "Cu~t" ;
};
MenuItem
{
Identifier = SID_COPY ;
- HelpID = SID_COPY ;
+ HelpID = CMD_SID_COPY ;
Text [ en-US ] = "~Copy" ;
};
MenuItem
{
Identifier = SID_PASTE ;
- HelpID = SID_PASTE ;
+ HelpID = CMD_SID_PASTE ;
Text [ en-US ] = "~Paste" ;
};
};
diff --git a/sfx2/source/menu/mnumgr.cxx b/sfx2/source/menu/mnumgr.cxx
index b264a5b47861..b3e5717dd7b6 100755
--- a/sfx2/source/menu/mnumgr.cxx
+++ b/sfx2/source/menu/mnumgr.cxx
@@ -60,6 +60,7 @@
#include <osl/file.hxx>
#include <vcl/graph.hxx>
#include <svtools/filter.hxx>
+#include <svl/lngmisc.hxx>
#include <sfx2/mnumgr.hxx>
@@ -172,7 +173,6 @@ void InsertVerbs_Impl( SfxBindings* pBindings, const com::sun::star::uno::Sequen
// einf"ugen
pMenu->InsertItem( nId, aVerbs[n].VerbName );
- pMenu->SetHelpId( nId, (ULONG) nId );
}
}
}
@@ -244,7 +244,7 @@ PopupMenu* InsertThesaurusSubmenu_Impl( SfxBindings* pBindings, Menu* pSVMenu )
//! item ids should start with values > 0, since 0 has special meaning
const USHORT nId = i + 1;
- String aItemText( GetThesaurusReplaceText_Impl( aSynonyms[i] ) );
+ String aItemText( linguistic::GetThesaurusReplaceText( aSynonyms[i] ) );
pThesSubMenu->InsertItem( nId, aItemText );
::rtl::OUString aCmd( ::rtl::OUString::createFromAscii( ".uno:ThesaurusFromContext?WordReplace:string=" ) );
aCmd += aItemText;
@@ -484,10 +484,10 @@ void SfxPopupMenuManager::InsertSeparator( USHORT nPos )
//-------------------------------------------------------------------------
-void SfxPopupMenuManager::InsertItem( USHORT nId, const String& rName, MenuItemBits nBits, USHORT nPos )
+void SfxPopupMenuManager::InsertItem( USHORT nId, const String& rName, MenuItemBits nBits, const rtl::OString& rHelpId, USHORT nPos )
{
pSVMenu->InsertItem( nId, rName, nBits,nPos );
- pSVMenu->SetHelpId( nId, (ULONG) nId );
+ pSVMenu->SetHelpId( nId, rHelpId );
}
//-------------------------------------------------------------------------
@@ -578,6 +578,7 @@ SfxPopupMenuManager* SfxPopupMenuManager::Popup( const ResId& rResId, SfxViewFra
return 0;
}
+
void SfxPopupMenuManager::ExecutePopup( const ResId& rResId, SfxViewFrame* pFrame, const Point& rPoint, Window* pWindow )
{
PopupMenu *pSVMenu = new PopupMenu( rResId );
@@ -622,6 +623,12 @@ void SfxPopupMenuManager::ExecutePopup( const ResId& rResId, SfxViewFrame* pFram
SfxPopupMenuManager aPop( pSVMenu, pFrame->GetBindings() );
aPop.RemoveDisabledEntries();
aPop.Execute( rPoint, pWindow );
+
+ // #i112646 avoid crash when context menu is closed.
+ // the (manually inserted) sub-menu needs to be destroyed before
+ // aPop gets destroyed.
+ delete pThesSubMenu;
+ pThesSubMenu = 0;
}
delete pThesSubMenu;
@@ -631,3 +638,4 @@ Menu* SfxPopupMenuManager::GetSVMenu()
{
return (Menu*) GetMenu()->GetSVMenu();
}
+
diff --git a/sfx2/source/menu/thessubmenu.cxx b/sfx2/source/menu/thessubmenu.cxx
index de1137bd6a74..d82c0a6dbdf3 100755
--- a/sfx2/source/menu/thessubmenu.cxx
+++ b/sfx2/source/menu/thessubmenu.cxx
@@ -61,39 +61,6 @@ SFX_IMPL_MENU_CONTROL(SfxThesSubMenuControl, SfxStringItem);
////////////////////////////////////////////////////////////
-String GetThesaurusReplaceText_Impl( const ::rtl::OUString &rText )
-{
- // The strings returned by the thesaurus sometimes have some
- // explanation text put in between '(' and ')' or a trailing '*'.
- // These parts should not be put in the ReplaceEdit Text that may get
- // inserted into the document. Thus we strip them from the text.
-
- String aText( rText );
-
- xub_StrLen nPos = aText.Search( sal_Unicode('(') );
- while (STRING_NOTFOUND != nPos)
- {
- xub_StrLen nEnd = aText.Search( sal_Unicode(')'), nPos );
- if (STRING_NOTFOUND != nEnd)
- aText.Erase( nPos, nEnd-nPos+1 );
- else
- break;
- nPos = aText.Search( sal_Unicode('(') );
- }
-
- nPos = aText.Search( sal_Unicode('*') );
- if (STRING_NOTFOUND != nPos)
- aText.Erase( nPos );
-
- // remove any possible remaining ' ' that may confuse the thesaurus
- // when it gets called with the text
- aText.EraseLeadingAndTrailingChars( sal_Unicode(' ') );
-
- return aText;
-}
-
-////////////////////////////////////////////////////////////
-
/*
Ctor; setzt Select-Handler am Menu und traegt Menu
diff --git a/sfx2/source/menu/thessubmenu.hxx b/sfx2/source/menu/thessubmenu.hxx
index 14d7473cb7c0..0b86a534de52 100644
--- a/sfx2/source/menu/thessubmenu.hxx
+++ b/sfx2/source/menu/thessubmenu.hxx
@@ -46,10 +46,6 @@ namespace css = ::com::sun::star;
////////////////////////////////////////////////////////////
-String GetThesaurusReplaceText_Impl( const ::rtl::OUString &rText );
-
-////////////////////////////////////////////////////////////
-
class SfxThesSubMenuControl : public SfxMenuControl
{
PopupMenu* pMenu;
diff --git a/sfx2/source/menu/virtmenu.cxx b/sfx2/source/menu/virtmenu.cxx
index 13c84bc531e2..48ff6a3948c5 100644
--- a/sfx2/source/menu/virtmenu.cxx
+++ b/sfx2/source/menu/virtmenu.cxx
@@ -345,7 +345,9 @@ void SfxVirtualMenu::CreateFromSVMenu()
DBG_CHKTHIS(SfxVirtualMenu, 0);
// Merge Addon popup menus into the SV Menu
- Reference< com::sun::star::frame::XFrame > xFrame( pBindings->GetDispatcher()->GetFrame()->GetFrame().GetFrameInterface() );
+ SfxViewFrame* pViewFrame = pBindings->GetDispatcher()->GetFrame();
+ SfxSlotPool* pSlotPool = pViewFrame->GetObjectShell()->GetModule()->GetSlotPool();
+ Reference< com::sun::star::frame::XFrame > xFrame( pViewFrame->GetFrame().GetFrameInterface() );
if ( pSVMenu->IsMenuBar() )
{
@@ -448,23 +450,14 @@ void SfxVirtualMenu::CreateFromSVMenu()
}
else
{
-/*
- if ( nSlotId >= SID_SFX_START && !SfxMenuManager::IsPopupFunction(nSlotId) )
+ const SfxSlot* pSlot = pSlotPool->GetSlot( nSlotId );
+ if ( pSlot )
{
- // Echte Popups sollen keine SlotIds haben; leider sind
- // da noch Altlasten mit herumzuschleppen ...
- String aTitle = pSVMenu->GetItemText( nSlotId );
- pSVMenu->SetPopupMenu( nSlotId, NULL );
- USHORT nPos = pSVMenu->GetItemPos( nSlotId );
- pSVMenu->RemoveItem( nPos );
- nSlotId = 1;
- while ( pSVMenu->GetItemPos(nSlotId) != MENU_ITEM_NOTFOUND )
- nSlotId++;
- pSVMenu->InsertItem( nSlotId, aTitle, 0, nPos );
- pSVMenu->SetPopupMenu( nSlotId, pPopup );
+ rtl::OString aCmd(".uno:");
+ aCmd += pSlot->GetUnoName();
+ pSVMenu->SetHelpId( nSlotId, pSlot->GetUnoName() );
}
-*/
- pSVMenu->SetHelpId( nSlotId, 0L );
+
pMnuCtrl = pItems+nPos;
// normalerweise jetzt erst im Activate-Handler
diff --git a/sfx2/source/statbar/stbitem.cxx b/sfx2/source/statbar/stbitem.cxx
index defccd4e23be..e5de57d835c3 100644
--- a/sfx2/source/statbar/stbitem.cxx
+++ b/sfx2/source/statbar/stbitem.cxx
@@ -132,7 +132,12 @@ svt::StatusbarController* SAL_CALL SfxStatusBarControllerFactory(
{
USHORT nSlotId = pSlot->GetSlotId();
if ( nSlotId > 0 )
+ {
+ rtl::OString aCmd(".uno:");
+ aCmd += pSlot->GetUnoName();
+ pStatusBar->SetHelpId( nSlotId, aCmd );
return SfxStatusBarControl::CreateControl( nSlotId, nID, pStatusBar, pModule );
+ }
}
return NULL;
diff --git a/sfx2/source/view/frame2.cxx b/sfx2/source/view/frame2.cxx
index d99ad8733e03..36edd34c973d 100644
--- a/sfx2/source/view/frame2.cxx
+++ b/sfx2/source/view/frame2.cxx
@@ -127,15 +127,15 @@ long SfxFrameWindow_Impl::Notify( NotifyEvent& rNEvt )
// TODO/LATER: do we still need this code?
Window* pWindow = rNEvt.GetWindow();
- ULONG nHelpId = 0;
- while ( !nHelpId && pWindow )
+ rtl::OString sHelpId;
+ while ( !sHelpId.getLength() && pWindow )
{
- nHelpId = pWindow->GetHelpId();
+ sHelpId = pWindow->GetHelpId();
pWindow = pWindow->GetParent();
}
- if ( nHelpId )
- SfxHelp::OpenHelpAgent( pFrame, nHelpId );
+ if ( sHelpId.getLength() )
+ SfxHelp::OpenHelpAgent( pFrame, sHelpId );
// if focus was on an external window, the clipboard content might have been changed
pView->GetBindings().Invalidate( SID_PASTE );
@@ -280,10 +280,7 @@ SfxFrame* SfxFrame::Create( SfxObjectShell& rDoc, Window& rWindow, USHORT nViewI
aLoadArgs = aArgs.getPropertyValues();
// load the doc into that frame
- ::rtl::OUString sLoaderURL( rDoc.GetModel()->getURL() );
- if ( sLoaderURL.getLength() == 0 )
- sLoaderURL = rDoc.GetFactory().GetFactoryURL();
-
+ ::rtl::OUString sLoaderURL( RTL_CONSTASCII_USTRINGPARAM( "private:object" ) );
Reference< XComponentLoader > xLoader( xFrame, UNO_QUERY_THROW );
xLoader->loadComponentFromURL(
sLoaderURL,
diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx
index ed158ce009e3..df252b831803 100644
--- a/sfx2/source/view/frmload.cxx
+++ b/sfx2/source/view/frmload.cxx
@@ -650,7 +650,7 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA
// ensure the ID of the to-be-created view is in the descriptor, if possible
const sal_Int16 nViewId = impl_determineEffectiveViewId_nothrow( *xDoc, aDescriptor );
const sal_Int16 nViewNo = xDoc->GetFactory().GetViewNo_Impl( nViewId, 0 );
- const ::rtl::OUString sViewName( xDoc->GetFactory().GetViewFactory( nViewNo ).GetViewName() );
+ const ::rtl::OUString sViewName( xDoc->GetFactory().GetViewFactory( nViewNo ).GetAPIViewName() );
// if the document is created hidden, prevent it from being deleted until it is shown or disposed
impl_lockHiddenDocument( *xDoc, aDescriptor );
diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx
index 6d61f4182bbb..328d88d8b2b9 100644
--- a/sfx2/source/view/ipclient.cxx
+++ b/sfx2/source/view/ipclient.cxx
@@ -131,6 +131,8 @@ public:
, m_bResizeNoScale( sal_False )
{}
+ ~SfxInPlaceClient_Impl();
+
void SizeHasChanged();
DECL_LINK (TimerHdl, Timer*);
uno::Reference < frame::XFrame > GetFrame() const;
@@ -168,6 +170,10 @@ public:
virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
};
+SfxInPlaceClient_Impl::~SfxInPlaceClient_Impl()
+{
+}
+
void SAL_CALL SfxInPlaceClient_Impl::changingState(
const ::com::sun::star::lang::EventObject& /*aEvent*/,
::sal_Int32 /*nOldState*/,
@@ -645,6 +651,7 @@ SfxInPlaceClient::SfxInPlaceClient( SfxViewShell* pViewShell, Window *pDraw, sal
m_pViewSh( pViewShell ),
m_pEditWin( pDraw )
{
+ m_pImp->acquire();
m_pImp->m_pClient = this;
m_pImp->m_nAspect = nAspect;
m_pImp->m_aScaleWidth = m_pImp->m_aScaleHeight = Fraction(1,1);
@@ -668,6 +675,7 @@ SfxInPlaceClient::~SfxInPlaceClient()
// the next call will destroy m_pImp if no other reference to it exists
m_pImp->m_xClient = uno::Reference < embed::XEmbeddedClient >();
+ m_pImp->release();
// TODO/LATER:
// the class is not intended to be used in multithreaded environment;
diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx
index f5c24b195af7..93c4eeb33cee 100644
--- a/sfx2/source/view/sfxbasecontroller.cxx
+++ b/sfx2/source/view/sfxbasecontroller.cxx
@@ -118,6 +118,7 @@ using namespace ::com::sun::star;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::RuntimeException;
using ::com::sun::star::uno::UNO_QUERY_THROW;
+using ::com::sun::star::uno::UNO_SET_THROW;
using ::com::sun::star::lang::DisposedException;
using ::com::sun::star::awt::XWindow;
using ::com::sun::star::frame::XController;
@@ -579,7 +580,7 @@ Reference< XWindow > SAL_CALL SfxBaseController::getComponentWindow() throw (Run
::rtl::OUString sViewName;
if ( nViewNo < rDocFac.GetViewFactoryCount() )
- sViewName = rDocFac.GetViewFactory( nViewNo ).GetViewName();
+ sViewName = rDocFac.GetViewFactory( nViewNo ).GetAPIViewName();
return sViewName;
}
@@ -1051,7 +1052,7 @@ void SAL_CALL SfxBaseController::dispose() throw( ::com::sun::star::uno::Runtime
if ( pFrame && pFrame->GetViewShell() == m_pData->m_pViewShell )
pFrame->GetFrame().SetIsClosing_Impl();
m_pData->m_pViewShell->DiscardClients_Impl();
- m_pData->m_pViewShell->pImp->bControllerSet = sal_False ;
+ m_pData->m_pViewShell->pImp->m_bControllerSet = false;
if ( pFrame )
{
@@ -1421,20 +1422,52 @@ void SfxBaseController::ConnectSfxFrame_Impl( const ConnectSfxFrame i_eConnect )
// if so, forward it to the view/shell.
if ( !bHasPluginMode && !bHasJumpMark )
{
+ // Note that this might not be the ideal place here. Restoring view data should, IMO, be the
+ // responsibility of the loader, not an implementation detail burried here deep within the controller's
+ // implementation.
+ // What I think should be done to replace the below code:
+ // - change SfxBaseController::restoreViewData to also accept a PropertyValue[] (it currently accepts
+ // a string only), and forward it to its ViewShell's ReadUserDataSequence
+ // - change the frame loader so that when a new document is loaded (as opposed to an existing
+ // document being loaded into a new frame), the model's view data is examine the very same
+ // way as below, and the proper view data is set via XController::restoreViewData
+ // - extend SfxViewFrame::SwitchToViewShell_Impl. Currently, it cares for the case where a non-PrintPreview
+ // view is exchanged, and sets the old view's data at the model. It should also care for the other
+ // way, were the PrintPreview view is left: in this case, the new view should also be initialized
+ // with the model's view data
try
{
- Reference< XViewDataSupplier > xViewDataSupplier( getModel(), UNO_QUERY );
- Reference< XIndexAccess > xViewData;
- if ( xViewDataSupplier.is() )
- xViewData = xViewDataSupplier->getViewData();
- if ( xViewData.is() && xViewData->getCount() > 0 )
+ Reference< XViewDataSupplier > xViewDataSupplier( getModel(), UNO_QUERY_THROW );
+ Reference< XIndexAccess > xViewData( xViewDataSupplier->getViewData(), UNO_SET_THROW );
+
+ // find the view data item whose ViewId matches the ID of the view we're just connecting to
+ const SfxObjectFactory& rDocFactory( rDoc.GetFactory() );
+ const sal_Int32 nCount = xViewData->getCount();
+ sal_Int32 nViewDataIndex = 0;
+ for ( sal_Int32 i=0; i<nCount; ++i )
{
- Sequence< PropertyValue > aViewData;
- if ( ( xViewData->getByIndex( 0 ) >>= aViewData ) && ( aViewData.getLength() ) )
+ const ::comphelper::NamedValueCollection aViewData( xViewData->getByIndex(i) );
+ ::rtl::OUString sViewId( aViewData.getOrDefault( "ViewId", ::rtl::OUString() ) );
+ if ( sViewId.getLength() == 0 )
+ continue;
+
+ const SfxViewFactory* pViewFactory = rDocFactory.GetViewFactoryByViewName( sViewId );
+ if ( pViewFactory == NULL )
+ continue;
+
+ if ( pViewFactory->GetOrdinal() == pViewFrame->GetCurViewId() )
{
- m_pData->m_pViewShell->ReadUserDataSequence( aViewData, TRUE );
+ nViewDataIndex = i;
+ break;
}
}
+ if ( nViewDataIndex < nCount )
+ {
+ Sequence< PropertyValue > aViewData;
+ OSL_VERIFY( xViewData->getByIndex( nViewDataIndex ) >>= aViewData );
+ if ( aViewData.getLength() > 0 )
+ m_pData->m_pViewShell->ReadUserDataSequence( aViewData, TRUE );
+ }
}
catch( const Exception& )
{
diff --git a/sfx2/source/view/userinputinterception.cxx b/sfx2/source/view/userinputinterception.cxx
index e716e604b649..ad910a944e0f 100644
--- a/sfx2/source/view/userinputinterception.cxx
+++ b/sfx2/source/view/userinputinterception.cxx
@@ -216,6 +216,13 @@ namespace sfx2
if ( e.Context == xHandler )
aIterator.remove();
}
+ catch( const RuntimeException& )
+ {
+ throw;
+ }
+ catch( const Exception& )
+ {
+ }
}
}
break;
@@ -247,6 +254,13 @@ namespace sfx2
if ( e.Context == xHandler )
aIterator.remove();
}
+ catch( const RuntimeException& )
+ {
+ throw;
+ }
+ catch( const Exception& )
+ {
+ }
}
}
break;
diff --git a/sfx2/source/view/viewfac.cxx b/sfx2/source/view/viewfac.cxx
index b58bbc2840da..f9469e8a9f88 100644
--- a/sfx2/source/view/viewfac.cxx
+++ b/sfx2/source/view/viewfac.cxx
@@ -49,7 +49,7 @@ void SfxViewFactory::InitFactory()
(*fnInit)();
}
-String SfxViewFactory::GetViewName() const
+String SfxViewFactory::GetLegacyViewName() const
{
::rtl::OUStringBuffer aViewName;
aViewName.appendAscii( "view" );
@@ -57,18 +57,27 @@ String SfxViewFactory::GetViewName() const
return aViewName.makeStringAndClear();
}
+String SfxViewFactory::GetAPIViewName() const
+{
+ if ( m_sViewName.Len() > 0 )
+ return m_sViewName;
+
+ if ( GetOrdinal() == 0 )
+ return String::CreateFromAscii( "Default" );
+
+ return GetLegacyViewName();
+}
+
// CTOR / DTOR -----------------------------------------------------------
SfxViewFactory::SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI,
- USHORT nOrdinal, const ResId& aDescrResId ):
+ USHORT nOrdinal, const sal_Char* asciiViewName ):
fnCreate(fnC),
fnInit(fnI),
nOrd(nOrdinal),
- aDescription(aDescrResId.GetId(), *aDescrResId.GetResMgr())
+ m_sViewName( String::CreateFromAscii( asciiViewName ) )
{
- aDescription.SetRT(aDescrResId.GetRT());
DBG_CTOR(SfxViewFactory, 0);
-// SFX_APP()->RegisterViewFactory_Impl(*this);
}
SfxViewFactory::~SfxViewFactory()
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 189c9a8aae0e..6222721d9b83 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -75,6 +75,8 @@
#include <com/sun/star/uri/XVndSunStarScriptUrl.hpp>
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/embed/EmbedStates.hpp>
+#include <com/sun/star/document/XViewDataSupplier.hpp>
+#include <com/sun/star/container/XIndexContainer.hpp>
#include <rtl/ustrbuf.hxx>
#include <unotools/localfilehelper.hxx>
@@ -83,6 +85,8 @@
#include <comphelper/componentcontext.hxx>
#include <comphelper/namedvaluecollection.hxx>
#include <comphelper/configurationhelper.hxx>
+#include <comphelper/docpasswordrequest.hxx>
+#include <comphelper/docpasswordhelper.hxx>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/ucb/XContent.hpp>
@@ -94,6 +98,7 @@
#include <comphelper/storagehelper.hxx>
#include <svtools/asynclink.hxx>
#include <svl/sharecontrolfile.hxx>
+#include <framework/framelistanalyzer.hxx>
#include <boost/optional.hpp>
@@ -104,6 +109,8 @@ using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::lang;
using ::com::sun::star::awt::XWindow;
using ::com::sun::star::beans::PropertyValue;
+using ::com::sun::star::document::XViewDataSupplier;
+using ::com::sun::star::container::XIndexContainer;
namespace css = ::com::sun::star;
#ifndef GCC
@@ -185,6 +192,56 @@ namespace
return *i_rViewFrameImpl.aHasToolPanels;
}
}
+
+//-------------------------------------------------------------------------
+static sal_Bool AskPasswordToModify_Impl( const uno::Reference< task::XInteractionHandler >& xHandler, const ::rtl::OUString& aPath, const SfxFilter* pFilter, sal_uInt32 nPasswordHash, const uno::Sequence< beans::PropertyValue > aInfo )
+{
+ // TODO/LATER: In future the info should replace the direct hash completely
+ sal_Bool bResult = ( !nPasswordHash && !aInfo.getLength() );
+
+ OSL_ENSURE( pFilter && ( pFilter->GetFilterFlags() & SFX_FILTER_PASSWORDTOMODIFY ), "PasswordToModify feature is active for a filter that does not support it!" );
+
+ if ( pFilter && xHandler.is() )
+ {
+ sal_Bool bCancel = sal_False;
+ sal_Bool bFirstTime = sal_True;
+
+ while ( !bResult && !bCancel )
+ {
+ sal_Bool bMSType = !pFilter->IsOwnFormat();
+
+ ::rtl::Reference< ::comphelper::DocPasswordRequest > pPasswordRequest(
+ new ::comphelper::DocPasswordRequest(
+ bMSType ? ::comphelper::DocPasswordRequestType_MS : ::comphelper::DocPasswordRequestType_STANDARD,
+ bFirstTime ? ::com::sun::star::task::PasswordRequestMode_PASSWORD_ENTER : ::com::sun::star::task::PasswordRequestMode_PASSWORD_REENTER,
+ aPath,
+ sal_True ) );
+
+ uno::Reference< com::sun::star::task::XInteractionRequest > rRequest( pPasswordRequest.get() );
+ xHandler->handle( rRequest );
+
+ if ( pPasswordRequest->isPassword() )
+ {
+ if ( aInfo.getLength() )
+ {
+ bResult = ::comphelper::DocPasswordHelper::IsModifyPasswordCorrect( pPasswordRequest->getPasswordToModify(), aInfo );
+ }
+ else
+ {
+ // the binary format
+ bResult = ( SfxMedium::CreatePasswordToModifyHash( pPasswordRequest->getPasswordToModify(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.TextDocument" ) ).equals( pFilter->GetServiceName() ) ) == nPasswordHash );
+ }
+ }
+ else
+ bCancel = sal_True;
+
+ bFirstTime = sal_False;
+ }
+ }
+
+ return bResult;
+}
+
//-------------------------------------------------------------------------
void SfxViewFrame::SetDowning_Impl()
{
@@ -324,10 +381,11 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
if( !pSh || !pSh->HasName() || !(pSh->Get_Impl()->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ))
break;
+ SfxMedium* pMed = pSh->GetMedium();
+
SFX_ITEMSET_ARG( pSh->GetMedium()->GetItemSet(), pItem, SfxBoolItem, SID_VIEWONLY, sal_False );
if ( pItem && pItem->GetValue() )
{
- SfxMedium* pMed = pSh->GetMedium();
SfxApplication* pApp = SFX_APP();
SfxAllItemSet aSet( pApp->GetPool() );
aSet.Put( SfxStringItem( SID_FILE_NAME, pMed->GetURLObject().GetMainURL(INetURLObject::NO_DECODE) ) );
@@ -359,17 +417,38 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
// Speichern und Readonly Reloaden
if( pSh->IsModified() )
{
- if ( !pSh->PrepareClose() )
+ if ( pSh->PrepareClose() )
+ {
+ // the storing could let the medium be changed
+ pMed = pSh->GetMedium();
+ bNeedsReload = sal_True;
+ }
+ else
{
rReq.SetReturnValue( SfxBoolItem( rReq.GetSlot(), sal_False ) );
return;
}
- else bNeedsReload = sal_True;
}
nOpenMode = SFX_STREAM_READONLY;
}
else
{
+ if ( pSh->IsReadOnlyMedium()
+ && ( pSh->GetModifyPasswordHash() || pSh->GetModifyPasswordInfo().getLength() )
+ && !pSh->IsModifyPasswordEntered() )
+ {
+ ::rtl::OUString aDocumentName = INetURLObject( pMed->GetOrigURL() ).GetMainURL( INetURLObject::DECODE_WITH_CHARSET );
+ if( !AskPasswordToModify_Impl( pMed->GetInteractionHandler(), aDocumentName, pMed->GetOrigFilter(), pSh->GetModifyPasswordHash(), pSh->GetModifyPasswordInfo() ) )
+ {
+ // this is a read-only document, if it has "Password to modify"
+ // the user should enter password before he can edit the document
+ rReq.SetReturnValue( SfxBoolItem( rReq.GetSlot(), sal_False ) );
+ return;
+ }
+
+ pSh->SetModifyPasswordEntered();
+ }
+
nOpenMode = SFX_STREAM_READWRITE;
pSh->SetReadOnlyUI( sal_False );
@@ -389,130 +468,113 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
}
// doing
- if( pSh )
+
+ String aTemp;
+ utl::LocalFileHelper::ConvertPhysicalNameToURL( pMed->GetPhysicalName(), aTemp );
+ INetURLObject aPhysObj( aTemp );
+ SFX_ITEMSET_ARG( pSh->GetMedium()->GetItemSet(),
+ pVersionItem, SfxInt16Item, SID_VERSION, sal_False );
+
+ INetURLObject aMedObj( pMed->GetName() );
+
+ // the logic below is following, if the document seems not to need to be reloaded and the physical name is different
+ // to the logical one, then on file system it can be checked that the copy is still newer than the original and no document reload is required
+ if ( ( !bNeedsReload && ( (aMedObj.GetProtocol() == INET_PROT_FILE &&
+ aMedObj.getFSysPath(INetURLObject::FSYS_DETECT) != aPhysObj.getFSysPath(INetURLObject::FSYS_DETECT) &&
+ !::utl::UCBContentHelper::IsYounger( aMedObj.GetMainURL( INetURLObject::NO_DECODE ), aPhysObj.GetMainURL( INetURLObject::NO_DECODE ) ))
+ || pMed->IsRemote() ) )
+ || pVersionItem )
{
- SfxMedium* pMed = pSh->GetMedium();
- String aTemp;
- utl::LocalFileHelper::ConvertPhysicalNameToURL( pMed->GetPhysicalName(), aTemp );
- INetURLObject aPhysObj( aTemp );
- SFX_ITEMSET_ARG( pSh->GetMedium()->GetItemSet(),
- pVersionItem, SfxInt16Item, SID_VERSION, sal_False );
-
- INetURLObject aMedObj( pMed->GetName() );
-
- // the logic below is following, if the document seems not to need to be reloaded and the physical name is different
- // to the logical one, then on file system it can be checked that the copy is still newer than the original and no document reload is required
- if ( ( !bNeedsReload && ( (aMedObj.GetProtocol() == INET_PROT_FILE &&
- aMedObj.getFSysPath(INetURLObject::FSYS_DETECT) != aPhysObj.getFSysPath(INetURLObject::FSYS_DETECT) &&
- !::utl::UCBContentHelper::IsYounger( aMedObj.GetMainURL( INetURLObject::NO_DECODE ), aPhysObj.GetMainURL( INetURLObject::NO_DECODE ) ))
- || pMed->IsRemote() ) )
- || pVersionItem )
+ sal_Bool bOK = sal_False;
+ if ( !pVersionItem )
{
- sal_Bool bOK = sal_False;
- if ( !pVersionItem )
+ sal_Bool bHasStorage = pMed->HasStorage_Impl();
+ // switching edit mode could be possible without reload
+ if ( bHasStorage && pMed->GetStorage() == pSh->GetStorage() )
{
- sal_Bool bHasStorage = pMed->HasStorage_Impl();
- // switching edit mode could be possible without reload
- if ( bHasStorage && pMed->GetStorage() == pSh->GetStorage() )
- {
- // TODO/LATER: faster creation of copy
- if ( !pSh->ConnectTmpStorage_Impl( pMed->GetStorage(), pMed ) )
- return;
- }
+ // TODO/LATER: faster creation of copy
+ if ( !pSh->ConnectTmpStorage_Impl( pMed->GetStorage(), pMed ) )
+ return;
+ }
- pMed->CloseAndRelease();
- pMed->GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, !( nOpenMode & STREAM_WRITE ) ) );
- pMed->SetOpenMode( nOpenMode, pMed->IsDirect() );
+ pMed->CloseAndRelease();
+ pMed->GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, !( nOpenMode & STREAM_WRITE ) ) );
+ pMed->SetOpenMode( nOpenMode, pMed->IsDirect() );
- pMed->CompleteReOpen();
- if ( nOpenMode & STREAM_WRITE )
- pMed->LockOrigFileOnDemand( sal_False, sal_True );
+ pMed->CompleteReOpen();
+ if ( nOpenMode & STREAM_WRITE )
+ pMed->LockOrigFileOnDemand( sal_False, sal_True );
- // LockOrigFileOnDemand might set the readonly flag itself, it should be set back
- pMed->GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, !( nOpenMode & STREAM_WRITE ) ) );
+ // LockOrigFileOnDemand might set the readonly flag itself, it should be set back
+ pMed->GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, !( nOpenMode & STREAM_WRITE ) ) );
- if ( !pMed->GetErrorCode() )
- bOK = sal_True;
- }
+ if ( !pMed->GetErrorCode() )
+ bOK = sal_True;
+ }
- if( !bOK )
+ if( !bOK )
+ {
+ ErrCode nErr = pMed->GetErrorCode();
+ if ( pVersionItem )
+ nErr = ERRCODE_IO_ACCESSDENIED;
+ else
{
- ErrCode nErr = pMed->GetErrorCode();
- if ( pVersionItem )
- nErr = ERRCODE_IO_ACCESSDENIED;
- else
- {
- pMed->ResetError();
- pMed->SetOpenMode( SFX_STREAM_READONLY, pMed->IsDirect() );
- pMed->ReOpen();
- pSh->DoSaveCompleted( pMed );
- }
+ pMed->ResetError();
+ pMed->SetOpenMode( SFX_STREAM_READONLY, pMed->IsDirect() );
+ pMed->ReOpen();
+ pSh->DoSaveCompleted( pMed );
+ }
- // r/o-Doc kann nicht in Editmode geschaltet werden?
- rReq.Done( sal_False );
+ // r/o-Doc kann nicht in Editmode geschaltet werden?
+ rReq.Done( sal_False );
- if ( nOpenMode == SFX_STREAM_READWRITE && !rReq.IsAPI() )
+ if ( nOpenMode == SFX_STREAM_READWRITE && !rReq.IsAPI() )
+ {
+ // dem ::com::sun::star::sdbcx::User anbieten, als Vorlage zu oeffnen
+ QueryBox aBox( &GetWindow(), SfxResId(MSG_QUERY_OPENASTEMPLATE) );
+ if ( RET_YES == aBox.Execute() )
{
- // dem ::com::sun::star::sdbcx::User anbieten, als Vorlage zu oeffnen
- QueryBox aBox( &GetWindow(), SfxResId(MSG_QUERY_OPENASTEMPLATE) );
- if ( RET_YES == aBox.Execute() )
+ SfxApplication* pApp = SFX_APP();
+ SfxAllItemSet aSet( pApp->GetPool() );
+ aSet.Put( SfxStringItem( SID_FILE_NAME, pMed->GetName() ) );
+ SFX_ITEMSET_ARG( pMed->GetItemSet(), pReferer, SfxStringItem, SID_REFERER, sal_False );
+ if ( pReferer )
+ aSet.Put( *pReferer );
+ aSet.Put( SfxBoolItem( SID_TEMPLATE, sal_True ) );
+ if ( pVersionItem )
+ aSet.Put( *pVersionItem );
+
+ if( pMed->GetFilter() )
{
- SfxApplication* pApp = SFX_APP();
- SfxAllItemSet aSet( pApp->GetPool() );
- aSet.Put( SfxStringItem( SID_FILE_NAME, pMed->GetName() ) );
- SFX_ITEMSET_ARG( pMed->GetItemSet(), pReferer, SfxStringItem, SID_REFERER, sal_False );
- if ( pReferer )
- aSet.Put( *pReferer );
- aSet.Put( SfxBoolItem( SID_TEMPLATE, sal_True ) );
- if ( pVersionItem )
- aSet.Put( *pVersionItem );
-
- if( pMed->GetFilter() )
- {
- aSet.Put( SfxStringItem( SID_FILTER_NAME, pMed->GetFilter()->GetFilterName() ) );
- SFX_ITEMSET_ARG( pMed->GetItemSet(), pOptions,
- SfxStringItem, SID_FILE_FILTEROPTIONS, sal_False );
- if ( pOptions )
- aSet.Put( *pOptions );
- }
-
- GetDispatcher()->Execute( SID_OPENDOC, SFX_CALLMODE_ASYNCHRON, aSet );
- return;
+ aSet.Put( SfxStringItem( SID_FILTER_NAME, pMed->GetFilter()->GetFilterName() ) );
+ SFX_ITEMSET_ARG( pMed->GetItemSet(), pOptions,
+ SfxStringItem, SID_FILE_FILTEROPTIONS, sal_False );
+ if ( pOptions )
+ aSet.Put( *pOptions );
}
- else
- nErr = 0;
- }
- ErrorHandler::HandleError( nErr );
- rReq.SetReturnValue(
- SfxBoolItem( rReq.GetSlot(), sal_False ) );
- return;
- }
- else
- {
- pSh->DoSaveCompleted( pMed );
- pSh->Broadcast( SfxSimpleHint(SFX_HINT_MODECHANGED) );
- rReq.SetReturnValue( SfxBoolItem( rReq.GetSlot(), sal_True ) );
- rReq.Done( sal_True );
- // if( nOpenMode == SFX_STREAM_READONLY )
- // pMed->Close();
- return;
+ GetDispatcher()->Execute( SID_OPENDOC, SFX_CALLMODE_ASYNCHRON, aSet );
+ return;
+ }
+ else
+ nErr = 0;
}
- }
- /*
- if ( !bReload )
- {
- // Es soll nicht reloaded werden
- SfxErrorContext aEc( ERRCODE_SFX_NODOCRELOAD );
- ErrorHandler::HandleError( ERRCODE_SFX_NODOCRELOAD );
+ ErrorHandler::HandleError( nErr );
rReq.SetReturnValue(
SfxBoolItem( rReq.GetSlot(), sal_False ) );
return;
}
- */
- // Ansonsten ( lokal und arbeiten auf Kopie ) muss gereloaded
- // werden.
+ else
+ {
+ pSh->DoSaveCompleted( pMed );
+ pSh->Broadcast( SfxSimpleHint(SFX_HINT_MODECHANGED) );
+ rReq.SetReturnValue( SfxBoolItem( rReq.GetSlot(), sal_True ) );
+ rReq.Done( sal_True );
+ // if( nOpenMode == SFX_STREAM_READONLY )
+ // pMed->Close();
+ return;
+ }
}
rReq.AppendItem( SfxBoolItem( SID_FORCERELOAD, sal_True) );
@@ -692,6 +754,10 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
}
xNewObj = SfxObjectShell::CreateObject( pFilter->GetServiceName(), SFX_CREATE_MODE_STANDARD );
+
+ if ( xOldObj->IsModifyPasswordEntered() )
+ xNewObj->SetModifyPasswordEntered();
+
uno::Sequence < beans::PropertyValue > aLoadArgs;
TransformItems( SID_OPENDOC, *pNewSet, aLoadArgs );
try
@@ -747,6 +813,19 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
}
else
{
+ if ( xNewObj->GetModifyPasswordHash() && xNewObj->GetModifyPasswordHash() != xOldObj->GetModifyPasswordHash() )
+ {
+ xNewObj->SetModifyPasswordEntered( sal_False );
+ xNewObj->SetReadOnly();
+ }
+ else if ( rReq.GetSlot() == SID_EDITDOC && bForEdit && !xNewObj->IsReadOnlyMedium() )
+ {
+ // the filter might request setting of the document to readonly state
+ // but in case of SID_EDITDOC it should not happen if the document
+ // can be opened for editing
+ xNewObj->SetReadOnlyUI( sal_False );
+ }
+
if ( xNewObj->IsDocShared() )
{
// the file is shared but the closing can change the sharing control file
@@ -759,10 +838,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
TransformItems( SID_OPENDOC, *xNewObj->GetMedium()->GetItemSet(), aLoadArgs );
UpdateDocument_Impl();
- }
- if ( xNewObj.Is() )
- {
try
{
while ( !aViewFrames.empty() )
@@ -1108,10 +1184,6 @@ void SfxViewFrame::DoActivate( sal_Bool bUI, SfxViewFrame* pOldFrame )
DBG_CHKTHIS(SfxViewFrame, 0);
SFX_APP();
-#ifdef WIN
- pSfxApp->TestFreeResources_Impl();
-#endif
-
pDispatcher->DoActivate_Impl( bUI, pOldFrame );
// Wenn ich einen parent habe und dieser ist kein parent des alten
@@ -1176,9 +1248,6 @@ void SfxViewFrame::DoDeactivate(sal_Bool bUI, SfxViewFrame* pNewFrame )
pFrame = pFrame->GetParentViewFrame();
}
}
-#ifdef WIN
- pSfxApp->TestFreeResources_Impl();
-#endif
}
//------------------------------------------------------------------------
@@ -1527,7 +1596,7 @@ void SfxViewFrame::KillDispatcher_Impl()
//------------------------------------------------------------------------
SfxViewFrame* SfxViewFrame::Current()
{
- return SfxApplication::Is_Impl() ? SFX_APP()->Get_Impl()->pViewFrame : NULL;
+ return SfxApplication::Get() ? SFX_APP()->Get_Impl()->pViewFrame : NULL;
}
//--------------------------------------------------------------------
@@ -2021,7 +2090,25 @@ SfxViewFrame* SfxViewFrame::LoadViewIntoFrame_Impl_NoThrow( const SfxObjectShell
{
::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
Reference < XFrame > xDesktop( aContext.createComponent( "com.sun.star.frame.Desktop" ), UNO_QUERY_THROW );
- xFrame.set( xDesktop->findFrame( DEFINE_CONST_UNICODE("_blank"), 0 ), UNO_SET_THROW );
+
+ if ( !i_bHidden )
+ {
+ try
+ {
+ // if there is a backing component, use it
+ Reference< XFramesSupplier > xTaskSupplier( xDesktop , css::uno::UNO_QUERY_THROW );
+ ::framework::FrameListAnalyzer aAnalyzer( xTaskSupplier, Reference< XFrame >(), ::framework::FrameListAnalyzer::E_BACKINGCOMPONENT );
+
+ if ( aAnalyzer.m_xBackingComponent.is() )
+ xFrame = aAnalyzer.m_xBackingComponent;
+ }
+ catch( uno::Exception& )
+ {}
+ }
+
+ if ( !xFrame.is() )
+ xFrame.set( xDesktop->findFrame( DEFINE_CONST_UNICODE("_blank"), 0 ), UNO_SET_THROW );
+
bOwnFrame = true;
}
@@ -2079,7 +2166,7 @@ SfxViewShell* SfxViewFrame::LoadViewIntoFrame_Impl( const SfxObjectShell& i_rDoc
else
aTransformLoadArgs.remove( "Hidden" );
- ::rtl::OUString sURL( xDocument->getURL() );
+ ::rtl::OUString sURL( RTL_CONSTASCII_USTRINGPARAM( "private:object" ) );
if ( !sURL.getLength() )
sURL = i_rDoc.GetFactory().GetFactoryURL();
@@ -2171,6 +2258,72 @@ SfxViewFrame* SfxViewFrame::Get( const Reference< XController>& i_rController, c
//--------------------------------------------------------------------
+void SfxViewFrame::SaveCurrentViewData_Impl( const USHORT i_nNewViewId )
+{
+ SfxViewShell* pCurrentShell = GetViewShell();
+ ENSURE_OR_RETURN_VOID( pCurrentShell != NULL, "SfxViewFrame::SaveCurrentViewData_Impl: no current view shell -> no current view data!" );
+
+ // determine the logical (API) view name
+ const SfxObjectFactory& rDocFactory( pCurrentShell->GetObjectShell()->GetFactory() );
+ const sal_uInt16 nCurViewNo = rDocFactory.GetViewNo_Impl( GetCurViewId(), 0 );
+ const String sCurrentViewName = rDocFactory.GetViewFactory( nCurViewNo ).GetAPIViewName();
+ const sal_uInt16 nNewViewNo = rDocFactory.GetViewNo_Impl( i_nNewViewId, 0 );
+ const String sNewViewName = rDocFactory.GetViewFactory( nNewViewNo ).GetAPIViewName();
+ if ( ( sCurrentViewName.Len() == 0 ) || ( sNewViewName.Len() == 0 ) )
+ {
+ // can't say anything about the view, the respective application did not yet migrate its code to
+ // named view factories => bail out
+ OSL_ENSURE( false, "SfxViewFrame::SaveCurrentViewData_Impl: views without API names? Shouldn't happen anymore?" );
+ return;
+ }
+ OSL_ENSURE( !sNewViewName.Equals( sCurrentViewName ), "SfxViewFrame::SaveCurrentViewData_Impl: suspicious: new and old view name are identical!" );
+
+ // save the view data only when we're moving from a non-print-preview to the print-preview view
+ if ( !sNewViewName.EqualsAscii( "PrintPreview" ) )
+ return;
+
+ // retrieve the view data from the view
+ Sequence< PropertyValue > aViewData;
+ pCurrentShell->WriteUserDataSequence( aViewData );
+
+ try
+ {
+ // retrieve view data (for *all* views) from the model
+ const Reference< XController > xController( pCurrentShell->GetController(), UNO_SET_THROW );
+ const Reference< XViewDataSupplier > xViewDataSupplier( xController->getModel(), UNO_QUERY_THROW );
+ const Reference< XIndexContainer > xViewData( xViewDataSupplier->getViewData(), UNO_QUERY_THROW );
+
+ // look up the one view data item which corresponds to our current view, and remove it
+ const sal_Int32 nCount = xViewData->getCount();
+ for ( sal_Int32 i=0; i<nCount; ++i )
+ {
+ const ::comphelper::NamedValueCollection aCurViewData( xViewData->getByIndex(i) );
+ ::rtl::OUString sViewId( aCurViewData.getOrDefault( "ViewId", ::rtl::OUString() ) );
+ if ( sViewId.getLength() == 0 )
+ continue;
+
+ const SfxViewFactory* pViewFactory = rDocFactory.GetViewFactoryByViewName( sViewId );
+ if ( pViewFactory == NULL )
+ continue;
+
+ if ( pViewFactory->GetOrdinal() == GetCurViewId() )
+ {
+ xViewData->removeByIndex(i);
+ break;
+ }
+ }
+
+ // then replace it with the most recent view data we just obtained
+ xViewData->insertByIndex( 0, makeAny( aViewData ) );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
+//--------------------------------------------------------------------
+
sal_Bool SfxViewFrame::SwitchToViewShell_Impl
(
sal_uInt16 nViewIdOrNo, /* > 0
@@ -2233,6 +2386,9 @@ sal_Bool SfxViewFrame::SwitchToViewShell_Impl
SfxObjectFactory& rDocFact = GetObjectShell()->GetFactory();
const USHORT nViewId = ( bIsIndex || !nViewIdOrNo ) ? rDocFact.GetViewFactory( nViewIdOrNo ).GetOrdinal() : nViewIdOrNo;
+ // save the view data of the old view, so it can be restored later on (when needed)
+ SaveCurrentViewData_Impl( nViewId );
+
// create and load new ViewShell
SfxViewShell* pNewSh = LoadViewIntoFrame_Impl(
*GetObjectShell(),
diff --git a/sfx2/source/view/viewimp.hxx b/sfx2/source/view/viewimp.hxx
index 1c9e219cf180..0826e78870bb 100644
--- a/sfx2/source/view/viewimp.hxx
+++ b/sfx2/source/view/viewimp.hxx
@@ -25,8 +25,8 @@
*
************************************************************************/
-#ifndef _VIEWIMP_HXX
-#define _VIEWIMP_HXX
+#ifndef SFX_VIEWIMP_HXX
+#define SFX_VIEWIMP_HXX
// include ---------------------------------------------------------------
@@ -56,28 +56,29 @@ struct SfxViewShell_Impl
{
::osl::Mutex aMutex;
::cppu::OInterfaceContainerHelper aInterceptorContainer;
- BOOL bControllerSet;
+ bool m_bControllerSet;
SfxShellArr_Impl aArr;
SvBorder aBorder;
Size aOptimalSize;
Size aMargin;
- USHORT nPrinterLocks;
- BOOL bCanPrint;
- BOOL bHasPrintOptions;
- BOOL bPlugInsActive;
- BOOL bIsShowView;
- BOOL bOwnsMenu;
- BOOL bGotOwnerShip;
- BOOL bGotFrameOwnerShip;
- SfxScrollingMode eScroll;
- USHORT nFamily;
- SfxBaseController* pController;
- ::svt::AcceleratorExecute* pAccExec;
+ USHORT m_nPrinterLocks;
+ bool m_bCanPrint;
+ bool m_bHasPrintOptions;
+ bool m_bPlugInsActive;
+ bool m_bIsShowView;
+ // FIXME UNUSED ???
+ //bool m_bOwnsMenu;
+ bool m_bGotOwnership;
+ bool m_bGotFrameOwnership;
+ SfxScrollingMode m_eScroll;
+ USHORT m_nFamily;
+ ::rtl::Reference<SfxBaseController> m_pController;
+ ::std::auto_ptr< ::svt::AcceleratorExecute > m_pAccExec;
com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue > aPrintOpts;
::rtl::Reference< SfxClipboardChangeListener > xClipboardListener;
- vcl::PrinterController* pPrinterController;
+ ::boost::shared_ptr< vcl::PrinterController > m_pPrinterController;
- SfxViewShell_Impl();
+ SfxViewShell_Impl(USHORT const nFlags);
};
#endif
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index f62ae4c1ddc7..d1cfd8c2d181 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -143,18 +143,26 @@ SfxPrinterController::SfxPrinterController( const Any& i_rComplete,
aRenderOptions[1].Value = i_rViewProp;
aRenderOptions[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsPrinter" ) );
aRenderOptions[2].Value <<= sal_True;
- Sequence< beans::PropertyValue > aRenderParms( mxRenderable->getRenderer( 0 , getSelectionObject(), aRenderOptions ) );
- int nProps = aRenderParms.getLength();
- for( int i = 0; i < nProps; i++ )
+ try
{
- if( aRenderParms[i].Name.equalsAscii( "ExtraPrintUIOptions" ) )
+ Sequence< beans::PropertyValue > aRenderParms( mxRenderable->getRenderer( 0 , getSelectionObject(), aRenderOptions ) );
+ int nProps = aRenderParms.getLength();
+ for( int i = 0; i < nProps; i++ )
{
- Sequence< beans::PropertyValue > aUIProps;
- aRenderParms[i].Value >>= aUIProps;
- setUIOptions( aUIProps );
- break;
+ if( aRenderParms[i].Name.equalsAscii( "ExtraPrintUIOptions" ) )
+ {
+ Sequence< beans::PropertyValue > aUIProps;
+ aRenderParms[i].Value >>= aUIProps;
+ setUIOptions( aUIProps );
+ break;
+ }
}
}
+ catch( lang::IllegalArgumentException& )
+ {
+ // the first renderer should always be available for the UI options,
+ // but catch the exception to be safe
+ }
}
// set some job parameters
@@ -234,7 +242,13 @@ Sequence< beans::PropertyValue > SfxPrinterController::getPageParameters( int i_
if( mxRenderable.is() && pPrinter )
{
Sequence< beans::PropertyValue > aJobOptions( getMergedOptions() );
- aResult = mxRenderable->getRenderer( i_nPage, getSelectionObject(), aJobOptions );
+ try
+ {
+ aResult = mxRenderable->getRenderer( i_nPage, getSelectionObject(), aJobOptions );
+ }
+ catch( lang::IllegalArgumentException& )
+ {
+ }
}
return aResult;
}
@@ -332,7 +346,9 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt
mpObjectShell->EnableSetModified( m_bOrigStatus );
if ( mpViewShell )
- mpViewShell->pImp->pPrinterController = 0;
+ {
+ mpViewShell->pImp->m_pPrinterController.reset();
+ }
}
}
@@ -643,7 +659,7 @@ void SfxViewShell::ExecPrint( const uno::Sequence < beans::PropertyValue >& rPro
this,
rProps
) );
- pImp->pPrinterController = pController.get();
+ pImp->m_pPrinterController = pController;
SfxObjectShell *pObjShell = GetObjectShell();
pController->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "JobName" ) ),
@@ -661,7 +677,8 @@ void SfxViewShell::ExecPrint( const uno::Sequence < beans::PropertyValue >& rPro
Printer* SfxViewShell::GetActivePrinter() const
{
- return pImp->pPrinterController ? pImp->pPrinterController->getPrinter().get() : 0;
+ return (pImp->m_pPrinterController)
+ ? pImp->m_pPrinterController->getPrinter().get() : 0;
}
void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
@@ -697,6 +714,14 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
case SID_PRINTDOCDIRECT:
{
SfxObjectShell* pDoc = GetObjectShell();
+
+ // derived class may decide to abort this
+ if( !pDoc->QuerySlotExecutable( nId ) )
+ {
+ rReq.SetReturnValue( SfxBoolItem( 0, FALSE ) );
+ return;
+ }
+
bool bDetectHidden = ( !bSilent && pDoc );
if ( bDetectHidden && pDoc->QueryHiddenInformation( WhenPrinting, NULL ) != RET_YES )
break;
@@ -825,7 +850,7 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
// execute PrinterSetupDialog
PrinterSetupDialog* pPrintSetupDlg = new PrinterSetupDialog( GetWindow() );
- if ( pImp->bHasPrintOptions )
+ if (pImp->m_bHasPrintOptions)
{
// additional controls for dialog
pExecutor = new SfxDialogExecutor_Impl( this, pPrintSetupDlg );
@@ -974,7 +999,7 @@ ErrCode SfxViewShell::DoPrint( SfxPrinter* /*pPrinter*/,
BOOL SfxViewShell::IsPrinterLocked() const
{
- return pImp->nPrinterLocks > 0;
+ return pImp->m_nPrinterLocks > 0;
}
//--------------------------------------------------------------------
@@ -983,9 +1008,13 @@ void SfxViewShell::LockPrinter( BOOL bLock)
{
BOOL bChanged = FALSE;
if ( bLock )
- bChanged = 1 == ++pImp->nPrinterLocks;
+ {
+ bChanged = 1 == ++pImp->m_nPrinterLocks;
+ }
else
- bChanged = 0 == --pImp->nPrinterLocks;
+ {
+ bChanged = 0 == --pImp->m_nPrinterLocks;
+ }
if ( bChanged )
{
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 5c65c967434f..5c41ba167c55 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -240,9 +240,21 @@ static ::rtl::OUString RetrieveLabelFromCommand(
}
//=========================================================================
-SfxViewShell_Impl::SfxViewShell_Impl()
+SfxViewShell_Impl::SfxViewShell_Impl(USHORT const nFlags)
: aInterceptorContainer( aMutex )
-, pAccExec(0)
+, m_bControllerSet(false)
+, m_nPrinterLocks(0)
+, m_bCanPrint(SFX_VIEW_CAN_PRINT == (nFlags & SFX_VIEW_CAN_PRINT))
+, m_bHasPrintOptions(
+ SFX_VIEW_HAS_PRINTOPTIONS == (nFlags & SFX_VIEW_HAS_PRINTOPTIONS))
+, m_bPlugInsActive(true)
+, m_bIsShowView(SFX_VIEW_NO_SHOW != (nFlags & SFX_VIEW_NO_SHOW))
+, m_bGotOwnership(false)
+, m_bGotFrameOwnership(false)
+, m_eScroll(SCROLLING_DEFAULT)
+, m_nFamily(-1) // undefined, default set by TemplateDialog
+, m_pController(0)
+, m_pAccExec(0)
{}
//=========================================================================
@@ -374,7 +386,9 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
{
SFX_REQUEST_ARG(rReq, pItem, SfxUInt16Item, nId, FALSE);
if (pItem)
- pImp->nFamily = pItem->GetValue();
+ {
+ pImp->m_nFamily = pItem->GetValue();
+ }
break;
}
@@ -674,7 +688,9 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
case SID_PLUGINS_ACTIVE:
{
SFX_REQUEST_ARG(rReq, pShowItem, SfxBoolItem, nId, FALSE);
- BOOL bActive = pShowItem ? pShowItem->GetValue() : !pImp->bPlugInsActive;
+ bool const bActive = (pShowItem)
+ ? pShowItem->GetValue()
+ : !pImp->m_bPlugInsActive;
// ggf. recorden
if ( !rReq.IsAPI() )
rReq.AppendItem( SfxBoolItem( nId, bActive ) );
@@ -684,7 +700,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
rReq.Done(TRUE);
// ausfuehren
- if ( !pShowItem || bActive != pImp->bPlugInsActive )
+ if (!pShowItem || (bActive != pImp->m_bPlugInsActive))
{
SfxFrame* pTopFrame = &GetFrame()->GetTopFrame();
if ( pTopFrame != &GetFrame()->GetFrame() )
@@ -704,7 +720,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
SfxViewShell *pView = pTopFrame->GetCurrentViewFrame()->GetViewShell();
if ( pView )
{
- pView->pImp->bPlugInsActive = bActive;
+ pView->pImp->m_bPlugInsActive = bActive;
Rectangle aVisArea = GetObjectShell()->GetVisArea();
VisAreaChanged(aVisArea);
@@ -758,7 +774,7 @@ void SfxViewShell::GetState_Impl( SfxItemSet &rSet )
case SID_SETUPPRINTER:
case SID_PRINTER_NAME:
{
- BOOL bEnabled = pImp->bCanPrint && !pImp->nPrinterLocks;
+ bool bEnabled = pImp->m_bCanPrint && !pImp->m_nPrinterLocks;
bEnabled = bEnabled && !Application::GetSettings().GetMiscSettings().GetDisablePrinting();
if ( bEnabled )
{
@@ -812,7 +828,8 @@ void SfxViewShell::GetState_Impl( SfxItemSet &rSet )
// PlugIns running
case SID_PLUGINS_ACTIVE:
{
- rSet.Put( SfxBoolItem( SID_PLUGINS_ACTIVE, !pImp->bPlugInsActive) );
+ rSet.Put( SfxBoolItem( SID_PLUGINS_ACTIVE,
+ !pImp->m_bPlugInsActive) );
break;
}
/*
@@ -832,7 +849,7 @@ void SfxViewShell::GetState_Impl( SfxItemSet &rSet )
*/
case SID_STYLE_FAMILY :
{
- rSet.Put( SfxUInt16Item( SID_STYLE_FAMILY, pImp->nFamily ) );
+ rSet.Put( SfxUInt16Item( SID_STYLE_FAMILY, pImp->m_nFamily ) );
break;
}
}
@@ -1155,8 +1172,10 @@ void SfxViewShell::InvalidateBorder()
DBG_ASSERT( GetViewFrame(), "SfxViewShell without SfxViewFrame" );
GetViewFrame()->InvalidateBorderImpl( this );
- if ( pImp->pController )
- pImp->pController->BorderWidthsChanged_Impl();
+ if (pImp->m_pController.is())
+ {
+ pImp->m_pController->BorderWidthsChanged_Impl();
+ }
}
//--------------------------------------------------------------------
@@ -1171,8 +1190,10 @@ void SfxViewShell::SetBorderPixel( const SvBorder &rBorder )
GetViewFrame()->SetBorderPixelImpl( this, rBorder );
// notify related controller that border size is changed
- if ( pImp->pController )
- pImp->pController->BorderWidthsChanged_Impl();
+ if (pImp->m_pController.is())
+ {
+ pImp->m_pController->BorderWidthsChanged_Impl();
+ }
}
}
@@ -1247,7 +1268,7 @@ SfxViewShell::SfxViewShell
)
: SfxShell(this)
- ,pImp( new SfxViewShell_Impl )
+, pImp( new SfxViewShell_Impl(nFlags) )
,pIPClientList( 0 )
,pFrame(pViewFrame)
,pSubShell(0)
@@ -1257,22 +1278,12 @@ SfxViewShell::SfxViewShell
DBG_CTOR(SfxViewShell, 0);
//pImp->pPrinterCommandQueue = new SfxAsyncPrintExec_Impl( this );
- pImp->pController = 0;
- pImp->bIsShowView =
- !(SFX_VIEW_NO_SHOW == (nFlags & SFX_VIEW_NO_SHOW));
-
- pImp->bCanPrint = SFX_VIEW_CAN_PRINT == (nFlags & SFX_VIEW_CAN_PRINT);
- pImp->bHasPrintOptions =
- SFX_VIEW_HAS_PRINTOPTIONS == (nFlags & SFX_VIEW_HAS_PRINTOPTIONS);
- pImp->bPlugInsActive = TRUE;
- pImp->bGotOwnerShip = FALSE;
- pImp->bGotFrameOwnerShip = FALSE;
+
if ( pViewFrame->GetParentViewFrame() )
- pImp->bPlugInsActive = pViewFrame->GetParentViewFrame()->GetViewShell()->pImp->bPlugInsActive;
- pImp->eScroll = SCROLLING_DEFAULT;
- pImp->nPrinterLocks = 0;
- pImp->bControllerSet = FALSE;
- pImp->nFamily = 0xFFFF; // undefined, default set by TemplateDialog
+ {
+ pImp->m_bPlugInsActive = pViewFrame->GetParentViewFrame()
+ ->GetViewShell()->pImp->m_bPlugInsActive;
+ }
SetMargin( pViewFrame->GetMargin_Impl() );
SetPool( &pViewFrame->GetObjectShell()->GetPool() );
@@ -1301,16 +1312,10 @@ SfxViewShell::~SfxViewShell()
pImp->xClipboardListener = NULL;
}
- if ( pImp->pController )
+ if (pImp->m_pController.is())
{
- pImp->pController->ReleaseShell_Impl();
- pImp->pController->release();
- pImp->pController = NULL;
- }
-
- if (pImp->pAccExec)
- {
- DELETEZ( pImp->pAccExec );
+ pImp->m_pController->ReleaseShell_Impl();
+ pImp->m_pController.clear();
}
//DELETEZ( pImp->pPrinterCommandQueue );
@@ -1660,7 +1665,8 @@ void SfxViewShell::Notify( SfxBroadcaster& rBC,
SFX_ITEMSET_ARG( pSet, pItem, SfxUnoAnyItem, SID_VIEW_DATA, sal_False );
if ( pItem )
{
- pImp->pController->restoreViewData( pItem->GetValue() );
+ pImp->m_pController->restoreViewData(
+ pItem->GetValue() );
pSet->ClearItem( SID_VIEW_DATA );
}
@@ -1679,13 +1685,15 @@ void SfxViewShell::Notify( SfxBroadcaster& rBC,
BOOL SfxViewShell::ExecKey_Impl(const KeyEvent& aKey)
{
- if (!pImp->pAccExec)
+ if (!pImp->m_pAccExec.get())
{
- pImp->pAccExec = ::svt::AcceleratorExecute::createAcceleratorHelper();
- pImp->pAccExec->init(::comphelper::getProcessServiceFactory(), pFrame->GetFrame().GetFrameInterface());
+ pImp->m_pAccExec.reset(
+ ::svt::AcceleratorExecute::createAcceleratorHelper() );
+ pImp->m_pAccExec->init(::comphelper::getProcessServiceFactory(),
+ pFrame->GetFrame().GetFrameInterface());
}
- return pImp->pAccExec->execute(aKey.GetKeyCode());
+ return pImp->m_pAccExec->execute(aKey.GetKeyCode());
}
//--------------------------------------------------------------------
@@ -1828,7 +1836,7 @@ void SfxViewShell::CheckIPClient_Impl( SfxInPlaceClient *pIPClient, const Rectan
( ( pIPClient->GetObjectMiscStatus() & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE ) != 0 );
// this method is called when either a client is created or the "Edit/Plugins" checkbox is checked
- if ( !pIPClient->IsObjectInPlaceActive() && pImp->bPlugInsActive )
+ if ( !pIPClient->IsObjectInPlaceActive() && pImp->m_bPlugInsActive )
{
// object in client is currently not active
// check if the object wants to be activated always or when it becomes at least partially visible
@@ -1844,7 +1852,7 @@ void SfxViewShell::CheckIPClient_Impl( SfxInPlaceClient *pIPClient, const Rectan
}
}
}
- else if ( !pImp->bPlugInsActive )
+ else if (!pImp->m_bPlugInsActive)
{
// object in client is currently active and "Edit/Plugins" checkbox is selected
// check if the object wants to be activated always or when it becomes at least partially visible
@@ -1858,7 +1866,7 @@ void SfxViewShell::CheckIPClient_Impl( SfxInPlaceClient *pIPClient, const Rectan
BOOL SfxViewShell::PlugInsActive() const
{
- return pImp->bPlugInsActive;
+ return pImp->m_bPlugInsActive;
}
//--------------------------------------------------------------------
@@ -1884,14 +1892,14 @@ void SfxViewShell::DiscardClients_Impl()
SfxScrollingMode SfxViewShell::GetScrollingMode() const
{
- return pImp->eScroll;
+ return pImp->m_eScroll;
}
//--------------------------------------------------------------------
void SfxViewShell::SetScrollingMode( SfxScrollingMode eMode )
{
- pImp->eScroll = eMode;
+ pImp->m_eScroll = eMode;
}
//--------------------------------------------------------------------
@@ -1958,7 +1966,7 @@ void SfxViewShell::MarginChanged()
BOOL SfxViewShell::IsShowView_Impl() const
{
- return pImp->bIsShowView;
+ return pImp->m_bIsShowView;
}
//--------------------------------------------------------------------
@@ -1990,9 +1998,8 @@ SfxInPlaceClientList* SfxViewShell::GetIPClientList_Impl( BOOL bCreate ) const
void SfxViewShell::SetController( SfxBaseController* pController )
{
- pImp->pController = pController;
- pImp->pController->acquire();
- pImp->bControllerSet = TRUE;
+ pImp->m_pController = pController;
+ pImp->m_bControllerSet = true;
// there should be no old listener, but if there is one, it should be disconnected
if ( pImp->xClipboardListener.is() )
@@ -2004,12 +2011,12 @@ void SfxViewShell::SetController( SfxBaseController* pController )
Reference < XController > SfxViewShell::GetController()
{
- return pImp->pController;
+ return pImp->m_pController.get();
}
SfxBaseController* SfxViewShell::GetBaseController_Impl() const
{
- return pImp->pController;
+ return pImp->m_pController.get();
}
void SfxViewShell::AddContextMenuInterceptor_Impl( const REFERENCE< XCONTEXTMENUINTERCEPTOR >& xInterceptor )
@@ -2131,20 +2138,20 @@ void SfxViewShell::TakeOwnerShip_Impl()
{
// currently there is only one reason to take OwnerShip: a hidden frame is printed
// so the ViewShell will check this on EndPrint (->prnmon.cxx)
- pImp->bGotOwnerShip = TRUE;
+ pImp->m_bGotOwnership = true;
}
void SfxViewShell::TakeFrameOwnerShip_Impl()
{
// currently there is only one reason to take OwnerShip: a hidden frame is printed
// so the ViewShell will check this on EndPrint (->prnmon.cxx)
- pImp->bGotFrameOwnerShip = TRUE;
+ pImp->m_bGotFrameOwnership = true;
}
void SfxViewShell::CheckOwnerShip_Impl()
{
BOOL bSuccess = FALSE;
- if( pImp->bGotOwnerShip )
+ if (pImp->m_bGotOwnership)
{
com::sun::star::uno::Reference < com::sun::star::util::XCloseable > xModel(
GetObjectShell()->GetModel(), com::sun::star::uno::UNO_QUERY );
@@ -2162,7 +2169,7 @@ void SfxViewShell::CheckOwnerShip_Impl()
}
}
- if( !bSuccess && pImp->bGotFrameOwnerShip )
+ if (!bSuccess && pImp->m_bGotFrameOwnership)
{
// document couldn't be closed or it shouldn't, now try at least to close the frame
com::sun::star::uno::Reference < com::sun::star::util::XCloseable > xFrame(
@@ -2182,19 +2189,23 @@ void SfxViewShell::CheckOwnerShip_Impl()
long SfxViewShell::HandleNotifyEvent_Impl( NotifyEvent& rEvent )
{
- if ( pImp->pController )
- return pImp->pController->HandleEvent_Impl( rEvent );
+ if (pImp->m_pController.is())
+ {
+ return pImp->m_pController->HandleEvent_Impl( rEvent );
+ }
return 0;
}
BOOL SfxViewShell::HasKeyListeners_Impl()
{
- return pImp->pController ? pImp->pController->HasKeyListeners_Impl() : FALSE;
+ return (pImp->m_pController.is())
+ ? pImp->m_pController->HasKeyListeners_Impl() : FALSE;
}
BOOL SfxViewShell::HasMouseClickListeners_Impl()
{
- return pImp->pController ? pImp->pController->HasMouseClickListeners_Impl() : FALSE;
+ return (pImp->m_pController.is())
+ ? pImp->m_pController->HasMouseClickListeners_Impl() : FALSE;
}
void SfxViewShell::SetAdditionalPrintOptions( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& rOpts )
diff --git a/sfx2/util/hidother.src b/sfx2/util/hidother.src
index bbea19100df9..72bd77c5c011 100644
--- a/sfx2/util/hidother.src
+++ b/sfx2/util/hidother.src
@@ -26,41 +26,20 @@
************************************************************************/
#include "../source/inc/helpid.hrc" // HID_XXX
-#include "../inc/sfx2/sfxsids.hrc" // SID_XXX
-#include "../inc/sfx2/sfx.hrc"
-
hidspecial HID_APP_WIN { HelpID = HID_APP_WIN; };
hidspecial HID_DESKTOP { HelpID = HID_DESKTOP; };
hidspecial HID_DOCINFO_FRAME { HelpID = HID_DOCINFO_FRAME; };
hidspecial HID_EXPLORER_FRAME { HelpID = HID_EXPLORER_FRAME; };
-hidspecial HID_FILEDLG_FILE { HelpID = HID_FILEDLG_FILE; };
-hidspecial HID_FILEDLG_MANAGER { HelpID = HID_FILEDLG_MANAGER; };
-hidspecial HID_FILEDLG_READ_ONLY { HelpID = HID_FILEDLG_READ_ONLY; };
-hidspecial HID_FILEDLG_STANDARD { HelpID = HID_FILEDLG_STANDARD; };
-hidspecial HID_FILEDLG_URL { HelpID = HID_FILEDLG_URL; };
-hidspecial HID_FILEDLG_USE_PASSWD { HelpID = HID_FILEDLG_USE_PASSWD; };
-hidspecial HID_INTERFACE_SFXMAILVIEW { HelpID = HID_INTERFACE_SFXMAILVIEW; };
-hidspecial HID_INTERFACE_SFXEXPLVIEWSH { HelpID = HID_INTERFACE_SFXEXPLVIEWSH; };
-hidspecial HID_INTERFACE_SFXFRAMESETVIEW { HelpID = HID_INTERFACE_SFXFRAMESETVIEW; };
-hidspecial HID_INTERFACE_SFXFRAMESETSOURCEVIEW { HelpID = HID_INTERFACE_SFXFRAMESETSOURCEVIEW; };
-hidspecial HID_INTERFACE_SFXHELP_VIEWSH { HelpID = HID_INTERFACE_SFXHELP_VIEWSH; };
hidspecial HID_PREVIEW_FRAME { HelpID = HID_PREVIEW_FRAME; };
hidspecial HID_PRINT_OPTIONS { HelpID = HID_PRINT_OPTIONS; };
hidspecial HID_TEMPLATE_FILTER { HelpID = HID_TEMPLATE_FILTER; };
hidspecial HID_TEMPLATE_FMT { HelpID = HID_TEMPLATE_FMT; };
hidspecial HID_SEARCH_DLG_TABLB { HelpID = HID_SEARCH_DLG_TABLB; };
-hidspecial SID_STYLE_FAMILY1 { HelpID = SID_STYLE_FAMILY1; };
-hidspecial SID_STYLE_FAMILY2 { HelpID = SID_STYLE_FAMILY2; };
-hidspecial SID_STYLE_FAMILY3 { HelpID = SID_STYLE_FAMILY3; };
-hidspecial SID_STYLE_FAMILY4 { HelpID = SID_STYLE_FAMILY4; };
-hidspecial SID_STYLE_FAMILY5 { HelpID = SID_STYLE_FAMILY5; };
-hidspecial SID_FILTER_NAME { HelpID = SID_FILTER_NAME; };
hidspecial HID_NAVIGATOR_WINDOW { HelpID = HID_NAVIGATOR_WINDOW; };
hidspecial HID_HELPAGENT_TIP_BOX { HelpId = HID_HELPAGENT_TIP_BOX; };
hidspecial HID_TEMPLDLG_TOOLBOX_LEFT { HelpId = HID_TEMPLDLG_TOOLBOX_LEFT;};
hidspecial HID_EXPLORER_SRCH_COUNT { HelpId = HID_EXPLORER_SRCH_COUNT;};
-hidspecial HID_INTERFACE_SFXPLUGINVIEW { HelpID = HID_INTERFACE_SFXPLUGINVIEW; };
hidspecial HID_TABDLG_RESET_BTN { HelpID = HID_TABDLG_RESET_BTN; };
hidspecial HID_TABDLG_STANDARD_BTN { HelpID = HID_TABDLG_STANDARD_BTN; };
hidspecial HID_CONFIG_EVENT_OFFICE_BASED { HelpID = HID_CONFIG_EVENT_OFFICE_BASED; };
@@ -70,35 +49,10 @@ hidspecial HID_EXPLORERMENU_ARRANGEICONS { HelpID = HID_EXPLORERMENU_ARRA
hidspecial HID_EXPLORERMENU_STDTEMPLATE { HelpID = HID_EXPLORERMENU_STDTEMPLATE; };
hidspecial HID_EXPLORER_DOCVIEW_ICON { HelpID = HID_EXPLORER_DOCVIEW_ICON; };
hidspecial HID_EXPLORER_DOCVIEW_DETAILS { HelpID = HID_EXPLORER_DOCVIEW_DETAILS; };
-hidspecial HID_CHAOSDOC_WIN { HelpID = HID_CHAOSDOC_WIN; };
-hidspecial HID_CHAOSDOC_WIN_HEADER { HelpID = HID_CHAOSDOC_WIN_HEADER; };
-hidspecial HID_CHAOSDOC_WIN_PARTS { HelpID = HID_CHAOSDOC_WIN_PARTS; };
-hidspecial HID_CHAOSDOC_WIN_BODY { HelpID = HID_CHAOSDOC_WIN_BODY; };
hidspecial HID_BRWBOX_HEADERBAR { HelpID = HID_BRWBOX_HEADERBAR; };
hidspecial HID_TASKBAR { HelpID = HID_TASKBAR; };
hidspecial HID_TASKBUTTONBAR { HelpID = HID_TASKBUTTONBAR; };
hidspecial HID_TASKTOOLBAR { HelpID = HID_TASKTOOLBAR; };
-hidspecial HID_CHAOS_NEW_IMAP_BOX { HelpID = HID_CHAOS_NEW_IMAP_BOX; };
-hidspecial HID_CHAOS_NEW_IMAP_MSG { HelpID = HID_CHAOS_NEW_IMAP_MSG; };
-hidspecial HID_CHAOS_NEW_IMAP_FLD { HelpID = HID_CHAOS_NEW_IMAP_FLD; };
-hidspecial HID_CHAOS_NEW_NEWS_BOX { HelpID = HID_CHAOS_NEW_NEWS_BOX; };
-hidspecial HID_CHAOS_NEW_NEWS_MSG { HelpID = HID_CHAOS_NEW_NEWS_MSG; };
-hidspecial HID_CHAOS_NEW_IMAP_BOX { HelpID = HID_CHAOS_NEW_IMAP_BOX; };
-hidspecial HID_CHAOS_NEW_FSYS_FLD { HelpID = HID_CHAOS_NEW_FSYS_FLD; };
-hidspecial HID_CHAOS_NEW_FSYS_LNK { HelpID = HID_CHAOS_NEW_FSYS_LNK; };
-hidspecial HID_CHAOS_NEW_FTP_BOX { HelpID = HID_CHAOS_NEW_FTP_BOX; };
-hidspecial HID_CHAOS_NEW_FTP_FLD { HelpID = HID_CHAOS_NEW_FTP_FLD; };
-hidspecial HID_CHAOS_NEW_OUT_BOX { HelpID = HID_CHAOS_NEW_OUT_BOX; };
-hidspecial HID_CHAOS_NEW_OUT_MSG { HelpID = HID_CHAOS_NEW_OUT_MSG; };
-hidspecial HID_CHAOS_NEW_POP3_BOX { HelpID = HID_CHAOS_NEW_POP3_BOX; };
-hidspecial HID_CHAOS_NEW_POP3_MSG { HelpID = HID_CHAOS_NEW_POP3_MSG; };
-hidspecial HID_CHAOS_NEW_SEARCH { HelpID = HID_CHAOS_NEW_SEARCH; };
-hidspecial HID_CHAOS_NEW_VIM_BOX { HelpID = HID_CHAOS_NEW_VIM_BOX; };
-hidspecial HID_CHAOS_NEW_VIM_MSG { HelpID = HID_CHAOS_NEW_VIM_MSG; };
-hidspecial HID_CHAOS_NEW_SUBSCR_BOX { HelpID = HID_CHAOS_NEW_SUBSCR_BOX; };
-hidspecial HID_CHAOS_NEW_BOOKMARK { HelpID = HID_CHAOS_NEW_BOOKMARK; };
-hidspecial HID_CHAOS_NEW_PUB_BOX { HelpID = HID_CHAOS_NEW_PUB_BOX; };
-hidspecial HID_UUI_END { HelpID = HID_UUI_END; }; // aka HID_CHAOS_NEW_DATABASE
hidspecial HID_CNT_DLG_SEARCH_BT_SHOW { HelpID = HID_CNT_DLG_SEARCH_BT_SHOW; };
hidspecial HID_CNT_DLG_SEARCH_BT_UPDATE { HelpID = HID_CNT_DLG_SEARCH_BT_UPDATE; };
hidspecial HID_CNT_DLG_SEARCH_BT_SYNCHRONIZE { HelpID = HID_CNT_DLG_SEARCH_BT_SYNCHRONIZE; };
@@ -107,22 +61,9 @@ hidspecial HID_CNT_PAGE_HEADER { HelpID = HID_CNT_PAGE_HEADER;
hidspecial HID_CNT_PAGE_DESCRIPTION { HelpID = HID_CNT_PAGE_DESCRIPTION; };
hidspecial HID_CNT_LB_HEADER { HelpID = HID_CNT_LB_HEADER; };
hidspecial HID_CNT_LB_DESCRIPTION { HelpID = HID_CNT_LB_DESCRIPTION; };
-hidspecial SID_GROUPVIEW { HelpID = SID_GROUPVIEW; };
hidspecial HID_GROUPVIEW_CONTENT_BIG { HelpID = HID_GROUPVIEW_CONTENT_BIG; };
hidspecial HID_GROUPVIEW_CONTENT_SMALL { HelpID = HID_GROUPVIEW_CONTENT_SMALL; };
hidspecial HID_GROUPVIEW_CONTENT_TREE { HelpID = HID_GROUPVIEW_CONTENT_TREE; };
-hidspecial HID_FILEDLG_AUTOCOMPLETEBOX { HelpID = HID_FILEDLG_AUTOCOMPLETEBOX; };
-hidspecial HID_FILEDLG_SAVE_BTN { HelpID = HID_FILEDLG_SAVE_BTN; };
-hidspecial HID_FILEDLG_SAVE_FILENAME { HelpID = HID_FILEDLG_SAVE_FILENAME; };
-hidspecial HID_FILEDLG_SAVE_FILETYPE { HelpID = HID_FILEDLG_SAVE_FILETYPE; };
-hidspecial HID_FILEDLG_INSERT_BTN { HelpID = HID_FILEDLG_INSERT_BTN; };
-hidspecial HID_FILEDLG_PATH_BTN { HelpID = HID_FILEDLG_PATH_BTN; };
-hidspecial HID_FILEDLG_PATH_FILENAME { HelpID = HID_FILEDLG_PATH_FILENAME; };
-hidspecial HID_FILEDLG_FOLDER_BTN { HelpID = HID_FILEDLG_FOLDER_BTN; };
-hidspecial HID_FILEDLG_FOLDER_FILENAME { HelpID = HID_FILEDLG_FOLDER_FILENAME; };
-hidspecial HID_FILEDLG_SRCHFOLDER_BTN { HelpID = HID_FILEDLG_SRCHFOLDER_BTN; };
-hidspecial HID_FILEDLG_EDIT_FAVORITES_LISTBOX { HelpID = HID_FILEDLG_EDIT_FAVORITES_LISTBOX; };
-hidspecial HID_FILEDLG_EDIT_FAVORITES_HEADERBAR { HelpID = HID_FILEDLG_EDIT_FAVORITES_HEADERBAR; };
hidspecial HID_BROWSERCONTROL { HelpID = HID_BROWSERCONTROL; };
hidspecial HID_TASKSTATUSBAR { HelpID = HID_TASKSTATUSBAR; };
hidspecial HID_CNT_PAGE_HEADER_TABBAR { HelpID = HID_CNT_PAGE_HEADER_TABBAR; };
@@ -147,8 +88,6 @@ hidspecial HID_CNT_SENT_VIEW_SENT_ARTICLES { HelpID = HID_CNT_SENT_VIEW_SEN
hidspecial HID_CNT_SENT_VIEW_UNSENT_ARTICLES { HelpID = HID_CNT_SENT_VIEW_UNSENT_ARTICLES; };
hidspecial HID_CNT_SENT_VIEW_MARKED_ARTICLES { HelpID = HID_CNT_SENT_VIEW_MARKED_ARTICLES; };
hidspecial HID_TABDLG_APPLY_BTN { HelpID = HID_TABDLG_APPLY_BTN; };
-hidspecial HID_FILEDLG_LINK_CB { HelpID = HID_FILEDLG_LINK_CB; };
-hidspecial HID_FILEDLG_PREVIEW_CB { HelpID = HID_FILEDLG_PREVIEW_CB; };
hidspecial HID_HELP_WINDOW { HelpID = HID_HELP_WINDOW; };
hidspecial HID_HELP_TOOLBOX { HelpID = HID_HELP_TOOLBOX; };
hidspecial HID_HELP_TOOLBOXITEM_INDEX { HelpID = HID_HELP_TOOLBOXITEM_INDEX; };
@@ -159,10 +98,11 @@ hidspecial HID_HELP_TOOLBOXITEM_PRINT { HelpID = HID_HELP_TOOLBOXITEM_
hidspecial HID_HELP_TOOLBOXITEM_BOOKMARKS { HelpID = HID_HELP_TOOLBOXITEM_BOOKMARKS; };
hidspecial HID_HELP_TOOLBOXITEM_SEARCHDIALOG { HelpID = HID_HELP_TOOLBOXITEM_SEARCHDIALOG; };
hidspecial HID_TBXCONTROL_FILENEW { HelpID = HID_TBXCONTROL_FILENEW; };
-hidspecial HID_GLOBAL_FALLBACK { HelpID = HID_GLOBAL_FALLBACK; };
hidspecial HID_CLOSE_WARNING { HelpID = HID_CLOSE_WARNING; };
hidspecial HID_DID_SAVE_PACKED_XML { HelpID = HID_DID_SAVE_PACKED_XML; };
hidspecial HID_HELP_ONHELP { HelpID = HID_HELP_ONHELP; };
hidspecial HID_HELP_TEXT_SELECTION_MODE { HelpID = HID_HELP_TEXT_SELECTION_MODE; };
hidspecial HID_DLG_CHECKFORONLINEUPDATE { HelpID = HID_DLG_CHECKFORONLINEUPDATE; };
-hidspecial HID_TASKPANE_VIEW_MENU { HelpID = HID_TASKPANE_VIEW_MENU; }; \ No newline at end of file
+hidspecial HID_DOCINFOSECURITY { HelpID = HID_DOCINFOSECURITY; };
+hidspecial HID_TASKPANE_VIEW_MENU { HelpID = HID_TASKPANE_VIEW_MENU; };
+
diff --git a/sfx2/util/makefile.mk b/sfx2/util/makefile.mk
index 2d93e7692d86..f520e2097e7e 100644
--- a/sfx2/util/makefile.mk
+++ b/sfx2/util/makefile.mk
@@ -162,3 +162,11 @@ SHL3NOCHECK=TRUE
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/sfx.component
+
+$(MISC)/sfx.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ sfx.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt sfx.component
diff --git a/sfx2/util/sfx.component b/sfx2/util/sfx.component
new file mode 100644
index 000000000000..1c28afd4177f
--- /dev/null
+++ b/sfx2/util/sfx.component
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="SfxDocumentMetaData">
+ <service name="com.sun.star.document.DocumentProperties"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.desktop.QuickstartWrapper">
+ <service name="com.sun.star.office.Quickstart"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.document.OwnSubFilter">
+ <service name="com.sun.star.comp.document.OwnSubFilter"/>
+ <service name="com.sun.star.document.OwnSubFilter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.embed.PackageStructureCreator">
+ <service name="com.sun.star.comp.embed.PackageStructureCreator"/>
+ <service name="com.sun.star.embed.PackageStructureCreator"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.office.FrameLoader">
+ <service name="com.sun.star.frame.SynchronousFrameLoader"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.sfx2.AppDispatchProvider">
+ <service name="com.sun.star.frame.ProtocolHandler"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.sfx2.ApplicationDialogLibraryContainer">
+ <service name="com.sun.star.script.ApplicationDialogLibraryContainer"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.sfx2.ApplicationScriptLibraryContainer">
+ <service name="com.sun.star.script.ApplicationScriptLibraryContainer"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.sfx2.DocumentTemplates">
+ <service name="com.sun.star.frame.DocumentTemplates"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.sfx2.GlobalEventBroadcaster">
+ <service name="com.sun.star.frame.GlobalEventBroadcaster"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.sfx2.IFrameObject">
+ <service name="com.sun.star.frame.SpecialEmbeddedObject"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.sfx2.PluginObject">
+ <service name="com.sun.star.frame.SpecialEmbeddedObject"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.sfx2.SfxMacroLoader">
+ <service name="com.sun.star.frame.ProtocolHandler"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.sfx2.StandaloneDocumentInfo">
+ <service name="com.sun.star.document.StandaloneDocumentInfo"/>
+ </implementation>
+</component>