diff options
author | Mathias Bauer <mba@openoffice.org> | 2010-10-28 23:02:10 +0200 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2010-10-28 23:02:10 +0200 |
commit | 83d7b776fba6a9b6be8e52f221b237b49ff7612d (patch) | |
tree | 204f94243b92698fa07d3859d7336a3730f626fd /sfx2 | |
parent | e02ccd1ae444b8bd21e963adc9f368c462fc3609 (diff) | |
parent | da622616ce54d5c5b4e2e299fbf0a8ae527fd413 (diff) |
CWS gnumake: resync to m91; conflicts unresolved
Diffstat (limited to 'sfx2')
123 files changed, 3080 insertions, 2668 deletions
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/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 e4d3ff023b3b..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 ) @@ -208,8 +207,6 @@ public: SvStream* GetInStream(); SvStream* GetOutStream(); - SvEaMgr* GetEaMgr(); - sal_Bool Commit(); sal_Bool IsStorage(); @@ -323,7 +320,6 @@ 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 ); 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/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 63eb9e8c876f..9473ac126bd7 100755..100644 --- a/sfx2/inc/sfx2/objsh.hxx +++ b/sfx2/inc/sfx2/objsh.hxx @@ -293,6 +293,7 @@ public: 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 @@ -346,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( 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 7ae2633456fe..d53dfbe461d8 100644 --- a/sfx2/inc/sfx2/passwd.hxx +++ b/sfx2/inc/sfx2/passwd.hxx @@ -76,7 +76,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/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/sfxhelp.hxx b/sfx2/inc/sfx2/sfxhelp.hxx index 60ad04b2e9ab..17589c7cd399 100644 --- a/sfx2/inc/sfx2/sfxhelp.hxx +++ b/sfx2/inc/sfx2/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/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc index 26e1991c24b8..9ab4a50b63d8 100644 --- a/sfx2/inc/sfx2/sfxsids.hrc +++ b/sfx2/inc/sfx2/sfxsids.hrc @@ -421,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) 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/viewfac.hxx b/sfx2/inc/sfx2/viewfac.hxx index bb6ae43da831..cfe2ff0fb855 100644 --- a/sfx2/inc/sfx2/viewfac.hxx +++ b/sfx2/inc/sfx2/viewfac.hxx @@ -45,20 +45,40 @@ typedef void (*SfxViewInit)(); class SFX2_DLLPUBLIC SfxViewFactory { public: +<<<<<<< local SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI, USHORT nOrdinal ); +======= + SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI, + USHORT nOrdinal, const sal_Char* asciiViewName ); +>>>>>>> other ~SfxViewFactory(); SfxViewShell *CreateInstance(SfxViewFrame *pViewFrame, SfxViewShell *pOldSh); void InitFactory(); +<<<<<<< local +======= + +>>>>>>> other 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; +<<<<<<< local +======= + const String m_sViewName; +>>>>>>> other }; #endif 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 eee2868c2352..22e873aea097 100644 --- a/sfx2/inc/sfx2/viewsh.hxx +++ b/sfx2/inc/sfx2/viewsh.hxx @@ -123,13 +123,21 @@ public: \ static SfxViewFactory&Factory() { return *pFactory; } \ static void InitFactory() +<<<<<<< local #define SFX_IMPL_VIEWFACTORY(Class) \ +======= +#define SFX_IMPL_NAMED_VIEWFACTORY(Class, AsciiViewName) \ +>>>>>>> other SfxViewFactory* Class::pFactory; \ SfxViewShell* __EXPORT Class::CreateInstance(SfxViewFrame *pFrame, SfxViewShell *pOldView) \ { return new Class(pFrame, pOldView); } \ void Class::RegisterFactory( USHORT nPrio ) \ { \ +<<<<<<< local pFactory = new SfxViewFactory(&CreateInstance,&InitFactory,nPrio);\ +======= + pFactory = new SfxViewFactory(&CreateInstance,&InitFactory,nPrio,AsciiViewName);\ +>>>>>>> other InitFactory(); \ } \ void Class::InitFactory() diff --git a/sfx2/prj/build.lst b/sfx2/prj/build.lst index f27d5944c772..d3f687fbc4af 100644 --- a/sfx2/prj/build.lst +++ b/sfx2/prj/build.lst @@ -1,4 +1,38 @@ sf sfx2 : l10n idl basic xmlscript framework readlicense_oo shell setup_native sax SYSTRAY_GTK:libegg LIBXML2:libxml2 NULL sf sfx2 usr1 - all sf_mkout NULL +<<<<<<< local sf sfx2\prj nmake - all sf_prj NULL +======= +sf sfx2\inc nmake - all sf_inc NULL +sf sfx2\prj get - all sf_prj NULL +sf sfx2\mac\res get - all sf_mres NULL +sf sfx2\source\inc get - all sf_sinc NULL +sf sfx2\sdi nmake - all sf_sdi NULL +sf sfx2\source\appl nmake - all sf_appl sf_sdi sf_inc NULL +sf sfx2\source\view nmake - all sf_view sf_sdi sf_inc NULL +sf sfx2\source\bastyp nmake - all sf_bast sf_sdi sf_inc NULL +sf sfx2\source\config nmake - all sf_cnfg sf_sdi sf_inc NULL +sf sfx2\source\control nmake - all sf_ctrl sf_sdi sf_inc NULL +sf sfx2\source\dialog nmake - all sf_dlg sf_sdi sf_inc NULL +sf sfx2\source\doc nmake - all sf_doc sf_sdi sf_inc NULL +sf sfx2\source\layout nmake - all sf_layout sf_sdi sf_inc NULL +sf sfx2\source\menu nmake - all sf_menu sf_sdi sf_inc NULL +sf sfx2\source\notify nmake - all sf_noti sf_sdi sf_inc NULL +sf sfx2\source\statbar nmake - all sf_sbar sf_sdi sf_inc NULL +sf sfx2\source\toolbox nmake - all sf_tbox sf_sdi sf_inc NULL +sf sfx2\source\inet nmake - all sf_inet sf_sdi sf_inc NULL +sf sfx2\source\explorer nmake - all sf_expl sf_sdi sf_inc NULL +sf sfx2\workben\custompanel nmake - all sf_wb_custompanel NULL +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 +>>>>>>> other +<<<<<<< local +======= +# 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 +>>>>>>> other diff --git a/sfx2/prj/d.lst b/sfx2/prj/d.lst index 2b956707606a..50a7f6134f67 100644 --- a/sfx2/prj/d.lst +++ b/sfx2/prj/d.lst @@ -30,3 +30,4 @@ mkdir: %_DEST%\inc%_EXT%\sfx2 ..\sdi\sfx.sdi %_DEST%\inc%_EXT%\sfx2\sfx.sdi ..\sdi\sfxitems.sdi %_DEST%\inc%_EXT%\sfx2\sfxitems.sdi +..\%__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 Binary files differindex 831a8f451dfd..831a8f451dfd 100644 --- a/sfx2/qa/complex/testdocuments/CUSTOM.odt +++ b/sfx2/qa/complex/framework/testdocuments/CUSTOM.odt diff --git a/sfx2/qa/complex/testdocuments/TEST.odt b/sfx2/qa/complex/framework/testdocuments/TEST.odt Binary files differindex 7c6f0b60f7b0..7c6f0b60f7b0 100644 --- a/sfx2/qa/complex/testdocuments/TEST.odt +++ b/sfx2/qa/complex/framework/testdocuments/TEST.odt diff --git a/sfx2/qa/complex/testdocuments/TESTRDFA.odt b/sfx2/qa/complex/framework/testdocuments/TESTRDFA.odt Binary files differindex d59739142df6..d59739142df6 100644 --- a/sfx2/qa/complex/testdocuments/TESTRDFA.odt +++ b/sfx2/qa/complex/framework/testdocuments/TESTRDFA.odt 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 8ca8645a05ff..40d35ab4d702 100755..100644 --- a/sfx2/sdi/sfx.sdi +++ b/sfx2/sdi/sfx.sdi @@ -6411,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 a260df92bc92..0ebd2dd782aa 100644 --- a/sfx2/source/appl/app.cxx +++ b/sfx2/source/appl/app.cxx @@ -118,7 +118,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 1ecfe4dcbb40..f8a387bba79b 100644 --- a/sfx2/source/appl/app.src +++ b/sfx2/source/appl/app.src @@ -665,169 +665,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 9481b7ff5730..c876db373d35 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/appquit.cxx b/sfx2/source/appl/appquit.cxx index 2ce4eac67295..e7d0fd70bf58 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> diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 1387317f7581..d323fc91a395 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -346,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; @@ -358,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; diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index 24a1725aa99c..5f2d1db2345b 100755..100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -132,7 +132,6 @@ using namespace ::com::sun::star::io; #include "sfx2/brokenpackageint.hxx" #include "eventsupplier.hxx" #include "xpackcreator.hxx" -// #include "applet.hxx" #include "plugin.hxx" #include "iframe.hxx" #include <ownsubfilterservice.hxx> @@ -2109,166 +2108,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 , 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/impldde.cxx b/sfx2/source/appl/impldde.cxx index 02763d0480dd..479e8ddea745 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 274e06b13cdf..536167abd016 100644 --- a/sfx2/source/appl/makefile.mk +++ b/sfx2/source/appl/makefile.mk @@ -102,7 +102,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 49c89cf32fa9..707b666bedcd 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 53907f875fe8..328bca2522b5 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/sfxdll.cxx b/sfx2/source/appl/sfxdll.cxx deleted file mode 100644 index 956a61b3e247..000000000000 --- a/sfx2/source/appl/sfxdll.cxx +++ /dev/null @@ -1,69 +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" - -#ifdef WIN -#include <svwin.h> -#endif - -#ifndef GCC -#endif - -#ifdef WIN - -// Statische DLL-Verwaltungs-Variablen -static HINSTANCE hDLLInst = 0; - -//========================================================================== - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ -#ifndef WNT - if ( nHeap ) - UnlockData( 0 ); -#endif - - hDLLInst = hDLL; - - return TRUE; -} - - -//-------------------------------------------------------------------------- - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - - -//========================================================================== - -#endif - diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index a1183019e8d1..9c25006b611c 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -28,8 +28,13 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" +<<<<<<< local #include "sfx2/sfxhelp.hxx" +======= +#include "sfxhelp.hxx" +#include <set> +>>>>>>> other #include <algorithm> #include <com/sun/star/uno/Reference.h> #include <com/sun/star/frame/XFrame.hpp> @@ -78,6 +83,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; @@ -223,13 +229,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(); }; @@ -256,7 +262,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 ); @@ -277,11 +282,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!" ); @@ -301,7 +310,6 @@ SfxHelpOptions_Impl::SfxHelpOptions_Impl() SfxHelpOptions_Impl::~SfxHelpOptions_Impl() { - delete m_pIds; } @@ -328,8 +336,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 }; @@ -372,16 +379,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 @@ -415,6 +412,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() : @@ -583,76 +773,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 @@ -662,28 +782,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; @@ -696,7 +795,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 ); @@ -764,8 +863,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 ); @@ -778,54 +929,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); @@ -841,10 +998,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() ) @@ -853,101 +1016,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; @@ -957,28 +1025,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); @@ -1004,7 +1069,6 @@ void SfxHelp::OpenHelpAgent( ULONG nHelpId ) { DBG_ERRORFILE( "OpenHelpAgent: caught an exception while executing the dispatch!" ); } -// } } } diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index dc496258d091..c08d713547a0 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/dialog/about.cxx b/sfx2/source/dialog/about.cxx index 39f59cb775d9..ea7b0a2bb0bd 100644 --- a/sfx2/source/dialog/about.cxx +++ b/sfx2/source/dialog/about.cxx @@ -54,7 +54,7 @@ #include "sfxresid.hxx" #include <sfx2/sfxdefs.hxx> #include <sfx2/app.hxx> - +#include <sfx2/sfxcommands.h> #include "dialog.hrc" // defines --------------------------------------------------------------- @@ -282,8 +282,7 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerS FreeResource(); - // explizite Help-Id - SetHelpId( SID_ABOUT ); + 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 5b0a42a20444..5a7f8a1fd900 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 0ad62ae1eec1..3d848d4d5648 100755..100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -1525,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 ); diff --git a/sfx2/source/dialog/dinfdlg.src b/sfx2/source/dialog/dinfdlg.src index 53b0f35685cb..c78347e3dba3 100755..100644 --- a/sfx2/source/dialog/dinfdlg.src +++ b/sfx2/source/dialog/dinfdlg.src @@ -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"; @@ -756,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" ; @@ -769,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 ) ; @@ -789,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 ) ; @@ -809,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 ) ; @@ -829,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 ) ; @@ -849,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 ) ; @@ -869,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 ) ; @@ -889,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 c78568757b77..4f55dfde21a7 100644 --- a/sfx2/source/dialog/dockwin.cxx +++ b/sfx2/source/dialog/dockwin.cxx @@ -46,6 +46,7 @@ #include <sfx2/viewsh.hxx> #include "sfx2/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 2112a03dd63f..5a3a6621fec8 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -79,7 +79,6 @@ #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> @@ -98,7 +97,7 @@ #include "filtergrouping.hxx" #include <sfx2/request.hxx> #include "filedlgimpl.hxx" - +#include <helpid.hrc> #include <sfxlocal.hrc> //----------------------------------------------------------------------------- @@ -221,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: @@ -279,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; } @@ -1204,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 ) @@ -1213,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; @@ -1237,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; @@ -1954,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 @@ -2346,9 +2338,6 @@ void FileDialogHelper_Impl::SetContext( FileDialogHelper::Context _eNewContext ) const OUString* pConfigId = GetLastFilterConfigId( _eNewContext ); if( pConfigId ) LoadLastUsedFilter( *pConfigId ); - -// if( nNewHelpId ) -// this->setDialogHelpId( nNewHelpId ); } // ------------------------------------------------------------------------ @@ -2494,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 ); @@ -2748,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/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 index d32ee843cbf2..2ac8f6a43fee 100755..100644 --- a/sfx2/source/dialog/securitypage.cxx +++ b/sfx2/source/dialog/securitypage.cxx @@ -245,6 +245,36 @@ SfxSecurityPage_Impl::SfxSecurityPage_Impl( SfxSecurityPage &rTabPage, const Sfx 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 ); } diff --git a/sfx2/source/dialog/securitypage.src b/sfx2/source/dialog/securitypage.src index fee60404d01c..fee60404d01c 100755..100644 --- a/sfx2/source/dialog/securitypage.src +++ b/sfx2/source/dialog/securitypage.src 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 df010f6bf292..d149bea792dc 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 299cd594e47d..94a137e3ebaf 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/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 5b95f09d7f5f..ff0a15e20088 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 d33418c6fbb2..17f0adf46ea6 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -3718,53 +3718,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/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 1abf43e4ebd8..8644e79f611d 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/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 81a6274034ba..91f5842c1fb7 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 } } diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index 855791d6dd24..75bdcc44d34e 100755..100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -733,7 +733,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 ) { diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 962a738e3ea3..4b907154202b 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 9cb475a1689b..79cd06c98d80 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" ) ) ); @@ -1910,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& ) {} @@ -2056,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 { diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 3884f42088cb..13fb08445431 100755..100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -526,6 +526,13 @@ SfxObjectShell* SfxObjectShell::Current() return pFrame ? pFrame->GetObjectShell() : 0; } +//------------------------------------------------------------------------- + +sal_Bool SfxObjectShell::IsInPrepareClose() const +{ + return pImp->bInPrepareClose; +} + //------------------------------------------------------------------------ struct BoolEnv_Impl diff --git a/sfx2/source/doc/querytemplate.cxx b/sfx2/source/doc/querytemplate.cxx index d3a669e999c3..a2adce45d239 100644 --- a/sfx2/source/doc/querytemplate.cxx +++ b/sfx2/source/doc/querytemplate.cxx @@ -31,7 +31,7 @@ #include "querytemplate.hxx" #include "sfx2/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 1bc0f1f79a6e..1d2ee160d850 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -95,6 +95,7 @@ #include <framework/titlehelper.hxx> #include <comphelper/numberedcollection.hxx> #include <unotools/ucbstreamhelper.hxx> +#include <unotools/ucbhelper.hxx> //________________________________________________________________________________________________________ // includes of my own project @@ -977,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 @@ -988,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 ) @@ -2640,7 +2647,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 @@ -3803,7 +3810,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; } @@ -3817,7 +3824,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 1bba3f3e9cf3..167dadea2e38 100755 --- a/sfx2/source/doc/syspathw32.cxx +++ b/sfx2/source/doc/syspathw32.cxx @@ -78,7 +78,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/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 79dba3208729..ef5c168c36f0 100755..100644 --- a/sfx2/source/inc/helpid.hrc +++ b/sfx2/source/inc/helpid.hrc @@ -29,341 +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_DOCINFOSECURITY (HID_SFX_START + 11) -#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 HID_SECURITYTAB_PASSWORD_TO_OPEN (HID_SFX_START + 328) -#define HID_SECURITYTAB_CONFIRM_PASSWORD_TO_OPEN (HID_SFX_START + 329) -#define HID_SECURITYTAB_PASSWORD_TO_MODIFY (HID_SFX_START + 330) -#define HID_SECURITYTAB_CONFIRM_PASSWORD_TO_MODIFY (HID_SFX_START + 331) -#define HID_SECURITYTAB_OPEN_FILE_READONLY (HID_SFX_START + 332) -#define HID_SECURITYTAB_RECORD_CHANGES (HID_SFX_START + 333) -#define HID_SECURITYTAB_PROTECTION (HID_SFX_START + 334) +#define HID_HELP_ONHELP "SFX2_HID_HELP_ONHELP" -#define ACT_SFX_HID_END HID_SECURITYTAB_PROTECTION +#define HID_QUERY_LOAD_TEMPLATE "SFX2_HID_QUERY_LOAD_TEMPLATE" -// "Uberlaufpr"ufung -------------------------------------------------------- +#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" -#if ACT_SFX_HID_END > HID_SFX_END -#error Resource-Ueberlauf in #line, #file -#endif - -#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/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 eddc97eeb4af..77dbd0dcb885 100644..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 100644..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 0428d015dcea..f0408a66a408 100644 --- a/sfx2/source/menu/virtmenu.cxx +++ b/sfx2/source/menu/virtmenu.cxx @@ -340,7 +340,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() ) { @@ -443,23 +445,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 dc5ad5f15d41..68d855cbf6c6 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 306523677d66..ef963b36d7bb 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 592163f20f17..a4707f03d364 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -649,7 +649,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/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index dc61cb293a26..174daf31bd5f 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; } @@ -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 a633403a2bb1..85f7c7f3745d 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,12 +57,33 @@ 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 ----------------------------------------------------------- +<<<<<<< local SfxViewFactory::SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI, USHORT nOrdinal ): +======= +SfxViewFactory::SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI, + USHORT nOrdinal, const sal_Char* asciiViewName ): +>>>>>>> other fnCreate(fnC), fnInit(fnI), +<<<<<<< local nOrd(nOrdinal) +======= + nOrd(nOrdinal), + m_sViewName( String::CreateFromAscii( asciiViewName ) ) +>>>>>>> other { DBG_CTOR(SfxViewFactory, 0); } diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index ea2af12ab258..55521b026fdc 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -69,6 +69,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> @@ -90,8 +92,12 @@ #include <comphelper/storagehelper.hxx> #include <svtools/asynclink.hxx> #include <svl/sharecontrolfile.hxx> +<<<<<<< local #include <svtools/svtools.hrc> #include <svtools/svtdata.hxx> +======= +#include <framework/framelistanalyzer.hxx> +>>>>>>> other #include <boost/optional.hpp> @@ -102,6 +108,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 @@ -809,6 +817,13 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) 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() ) { @@ -1168,10 +1183,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 @@ -1236,9 +1247,6 @@ void SfxViewFrame::DoDeactivate(sal_Bool bUI, SfxViewFrame* pNewFrame ) pFrame = pFrame->GetParentViewFrame(); } } -#ifdef WIN - pSfxApp->TestFreeResources_Impl(); -#endif } //------------------------------------------------------------------------ @@ -2081,7 +2089,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; } @@ -2140,6 +2166,8 @@ SfxViewShell* SfxViewFrame::LoadViewIntoFrame_Impl( const SfxObjectShell& i_rDoc aTransformLoadArgs.remove( "Hidden" ); ::rtl::OUString sURL( RTL_CONSTASCII_USTRINGPARAM( "private:object" ) ); + if ( !sURL.getLength() ) + sURL = i_rDoc.GetFactory().GetFactoryURL(); Reference< XComponentLoader > xLoader( i_rFrame, UNO_QUERY_THROW ); xLoader->loadComponentFromURL( sURL, ::rtl::OUString::createFromAscii( "_self" ), 0, @@ -2229,6 +2257,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 @@ -2291,6 +2385,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..be20cd2f2a47 100644 --- a/sfx2/source/view/viewimp.hxx +++ b/sfx2/source/view/viewimp.hxx @@ -75,7 +75,7 @@ struct SfxViewShell_Impl ::svt::AcceleratorExecute* 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(); }; diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index 8255bed82592..b12a5f80149a 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -332,7 +332,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 +645,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 +663,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 +700,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; diff --git a/sfx2/util/hidother.src b/sfx2/util/hidother.src index 38e5577a72be..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,7 +98,6 @@ 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; }; 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> |