diff options
author | Andras Timar <atimar@suse.com> | 2012-11-11 18:24:14 +0100 |
---|---|---|
committer | Andras Timar <atimar@suse.com> | 2012-11-11 18:24:14 +0100 |
commit | 06ec1c089519ef3249464aa09eadf03a8db93a39 (patch) | |
tree | 85b2eb6d8ba6ca95e18e1ff82151224cb14106f6 /sfx2 | |
parent | 8e0d67bed54633d555a4601a5d79e2d5ba7ab2bb (diff) | |
parent | 3f899eae02eaad0b967de749fe09b869ba93ad6d (diff) |
Merge branch 'master' into feature/killsdf
Conflicts:
Repository.mk
RepositoryFixes.mk
connectivity/prj/build.lst
extensions/prj/build.lst
filter/prj/build.lst
fpicker/prj/build.lst
l10ntools/StaticLibrary_transex.mk
saxon/build.xml
shell/prj/build.lst
solenv/gbuild/AllLangResTarget.mk
solenv/gbuild/Configuration.mk
solenv/gbuild/UI.mk
ucb/source/ucp/webdav/webdavcontent.cxx
Diffstat (limited to 'sfx2')
65 files changed, 1223 insertions, 527 deletions
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk index eae3511b8511..8a12ad9e9911 100644 --- a/sfx2/Library_sfx.mk +++ b/sfx2/Library_sfx.mk @@ -147,6 +147,7 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\ sfx2/source/control/unoctitm \ sfx2/source/dialog/alienwarn \ sfx2/source/dialog/basedlgs \ + sfx2/source/dialog/checkin \ sfx2/source/dialog/dinfdlg \ sfx2/source/dialog/dinfedt \ sfx2/source/dialog/dockwin \ diff --git a/sfx2/UI_sfx.mk b/sfx2/UI_sfx.mk index a084da170522..c164884df217 100644 --- a/sfx2/UI_sfx.mk +++ b/sfx2/UI_sfx.mk @@ -10,6 +10,7 @@ $(eval $(call gb_UI_UI,sfx)) $(eval $(call gb_UI_add_uifiles,sfx,\ + sfx2/uiconfig/ui/checkin \ sfx2/uiconfig/ui/password \ )) diff --git a/sfx2/inc/docvor.hxx b/sfx2/inc/docvor.hxx index 4bdc1c7c6622..6a2a001b991c 100644 --- a/sfx2/inc/docvor.hxx +++ b/sfx2/inc/docvor.hxx @@ -56,22 +56,22 @@ friend class SfxOrganizeDlg_Impl; DECL_LINK( OnAsyncExecuteDrop, ExecuteDropEvent* ); protected: - virtual sal_Bool EditingEntry( SvLBoxEntry* pEntry, Selection & ); - virtual sal_Bool EditedEntry( SvLBoxEntry* pEntry, const rtl::OUString& rNewText ); - virtual sal_Bool NotifyMoving(SvLBoxEntry *pSource, - SvLBoxEntry* pTarget, - SvLBoxEntry *&pNewParent, sal_uIntPtr &); - virtual sal_Bool NotifyCopying(SvLBoxEntry *pSource, - SvLBoxEntry* pTarget, - SvLBoxEntry *&pNewParent, sal_uIntPtr &); - virtual void RequestingChildren( SvLBoxEntry* pParent ); + virtual sal_Bool EditingEntry( SvTreeListEntry* pEntry, Selection & ); + virtual sal_Bool EditedEntry( SvTreeListEntry* pEntry, const rtl::OUString& rNewText ); + virtual sal_Bool NotifyMoving(SvTreeListEntry *pSource, + SvTreeListEntry* pTarget, + SvTreeListEntry *&pNewParent, sal_uIntPtr &); + virtual sal_Bool NotifyCopying(SvTreeListEntry *pSource, + SvTreeListEntry* pTarget, + SvTreeListEntry *&pNewParent, sal_uIntPtr &); + virtual void RequestingChildren( SvTreeListEntry* pParent ); virtual long ExpandingHdl(); - virtual sal_Bool Select( SvLBoxEntry* pEntry, sal_Bool bSelect=sal_True ); + virtual sal_Bool Select( SvTreeListEntry* pEntry, sal_Bool bSelect=sal_True ); using SvTreeListBox::ExecuteDrop; // new d&d - virtual DragDropMode NotifyStartDrag( TransferDataContainer&, SvLBoxEntry* ); - virtual sal_Bool NotifyAcceptDrop( SvLBoxEntry* ); + virtual DragDropMode NotifyStartDrag( TransferDataContainer&, SvTreeListEntry* ); + virtual sal_Bool NotifyAcceptDrop( SvTreeListEntry* ); virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ); virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ); virtual void DragFinished( sal_Int8 nDropAction ); @@ -96,27 +96,27 @@ public: virtual PopupMenu* CreateContextMenu(); private: - sal_Bool IsStandard_Impl( SvLBoxEntry *) const; + sal_Bool IsStandard_Impl( SvTreeListEntry *) const; sal_Bool MoveOrCopyTemplates(SvTreeListBox *pSourceBox, - SvLBoxEntry *pSource, - SvLBoxEntry* pTarget, - SvLBoxEntry *&pNewParent, + SvTreeListEntry *pSource, + SvTreeListEntry* pTarget, + SvTreeListEntry *&pNewParent, sal_uIntPtr &rIdx, sal_Bool bCopy); sal_Bool MoveOrCopyContents(SvTreeListBox *pSourceBox, - SvLBoxEntry *pSource, - SvLBoxEntry* pTarget, - SvLBoxEntry *&pNewParent, + SvTreeListEntry *pSource, + SvTreeListEntry* pTarget, + SvTreeListEntry *&pNewParent, sal_uIntPtr &rIdx, sal_Bool bCopy); inline sal_uInt16 GetDocLevel() const; SfxObjectShellRef GetObjectShell( const Path& ); sal_Bool IsUniqName_Impl( const String &rText, - SvLBoxEntry* pParent, SvLBoxEntry* pEntry = 0 ) const; - sal_uInt16 GetLevelCount_Impl( SvLBoxEntry* pParent ) const; + SvTreeListEntry* pParent, SvTreeListEntry* pEntry = 0 ) const; + sal_uInt16 GetLevelCount_Impl( SvTreeListEntry* pParent ) const; - SvLBoxEntry* InsertEntryByBmpType( const XubString& rText, BMPTYPE eBmpType, - SvLBoxEntry* pParent = NULL, sal_Bool bChildrenOnDemand = sal_False, + SvTreeListEntry* InsertEntryByBmpType( const XubString& rText, BMPTYPE eBmpType, + SvTreeListEntry* pParent = NULL, sal_Bool bChildrenOnDemand = sal_False, sal_uIntPtr nPos = LIST_APPEND, void* pUserData = NULL ); }; diff --git a/sfx2/inc/sfx2/checkin.hxx b/sfx2/inc/sfx2/checkin.hxx new file mode 100644 index 000000000000..65aa2e75cd1b --- /dev/null +++ b/sfx2/inc/sfx2/checkin.hxx @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#ifndef _SFX_CHECKIN_HXX +#define _SFX_CHECKIN_HXX + +#include <vcl/button.hxx> +#include <vcl/dialog.hxx> +#include <vcl/edit.hxx> + +class SfxCheckinDialog : public ModalDialog +{ + private: + Edit* m_pCommentED; + CheckBox* m_pMajorCB; + + OKButton* m_pOKBtn; + + DECL_DLLPRIVATE_LINK(OKHdl, void *); + + public: + SfxCheckinDialog( Window* pParent ); + + rtl::OUString GetComment( ); + bool IsMajor( ); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/docfile.hxx b/sfx2/inc/sfx2/docfile.hxx index 9a134b651b8b..5ba00f65e830 100644 --- a/sfx2/inc/sfx2/docfile.hxx +++ b/sfx2/inc/sfx2/docfile.hxx @@ -194,6 +194,8 @@ public: sal_Bool SwitchDocumentToFile( const rtl::OUString& aURL ); ::rtl::OUString GetBaseURL( bool bForSaving=false ); + void SetInCheckIn( bool bInCheckIn ); + bool IsInCheckIn( ); #if _SOLAR__PRIVATE SAL_DLLPRIVATE sal_Bool HasStorage_Impl() const; diff --git a/sfx2/inc/sfx2/filedlghelper.hxx b/sfx2/inc/sfx2/filedlghelper.hxx index 98c55b192f08..738f8e1e1338 100644 --- a/sfx2/inc/sfx2/filedlghelper.hxx +++ b/sfx2/inc/sfx2/filedlghelper.hxx @@ -70,7 +70,6 @@ class Window; #define FILEDIALOG_FILTER_ALL "*.*" #define FILE_OPEN_SERVICE_NAME "com.sun.star.ui.dialogs.FilePicker" -#define FOLDER_PICKER_SERVICE_NAME "com.sun.star.ui.dialogs.FolderPicker" #define FILE_OPEN_SERVICE_NAME_OOO "com.sun.star.ui.dialogs.OfficeFilePicker" namespace sfx2 { diff --git a/sfx2/inc/sfx2/infobar.hxx b/sfx2/inc/sfx2/infobar.hxx index 00d521f7749b..b72dbbdb85f5 100644 --- a/sfx2/inc/sfx2/infobar.hxx +++ b/sfx2/inc/sfx2/infobar.hxx @@ -41,17 +41,20 @@ class SFX2_DLLPUBLIC SfxInfoBarContainerChild : public SfxChildWindow class SfxInfoBarWindow : public Window { private: + rtl::OUString m_sId; FixedText* m_pMessage; Button* m_pCloseBtn; std::vector< PushButton* > m_aActionBtns; public: - SfxInfoBarWindow( Window* parent, + SfxInfoBarWindow( Window* parent, const rtl::OUString& sId, const rtl::OUString& sMessage, std::vector< PushButton* > aButtons ); ~SfxInfoBarWindow( ); + virtual const rtl::OUString& getId() const { return m_sId; } virtual void Paint( const Rectangle& ); + virtual void Resize( ); private: DECL_LINK( CloseHandler, void* ); @@ -67,8 +70,11 @@ class SfxInfoBarContainerWindow : public Window SfxInfoBarContainerWindow( SfxInfoBarContainerChild* pChildWin ); ~SfxInfoBarContainerWindow( ); - void appendInfoBar( const rtl::OUString& sMessage, std::vector< PushButton* > aButtons ); + void appendInfoBar( const rtl::OUString& sId, const rtl::OUString& sMessage, std::vector< PushButton* > aButtons ); + SfxInfoBarWindow* getInfoBar( const rtl::OUString& sId ); void removeInfoBar( SfxInfoBarWindow* pInfoBar ); + + virtual void Resize( ); }; diff --git a/sfx2/inc/sfx2/linkmgr.hxx b/sfx2/inc/sfx2/linkmgr.hxx index 03b6ca347850..39c3beda9886 100644 --- a/sfx2/inc/sfx2/linkmgr.hxx +++ b/sfx2/inc/sfx2/linkmgr.hxx @@ -137,9 +137,9 @@ public: SvLinkSourceRef CreateObj( SvBaseLink* ); - void UpdateAllLinks( sal_Bool bAskUpdate = sal_True, - sal_Bool bCallErrHdl = sal_True, - sal_Bool bUpdateGrfLinks = sal_False, + void UpdateAllLinks( bool bAskUpdate = true, + bool bCallErrHdl = true, + bool bUpdateGrfLinks = false, Window* pParentWin = 0 ); // Call for list of links (eg for link-dialog) diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx index 331553db46a4..d2a3b3d76440 100644 --- a/sfx2/inc/sfx2/objsh.hxx +++ b/sfx2/inc/sfx2/objsh.hxx @@ -732,6 +732,10 @@ public: SAL_DLLPRIVATE void ImplSign( sal_Bool bScriptingContent = sal_False ); SAL_DLLPRIVATE sal_Bool QuerySaveSizeExceededModules_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xHandler ); + + SAL_DLLPRIVATE void CheckOut( ); + SAL_DLLPRIVATE void CancelCheckOut( ); + SAL_DLLPRIVATE void CheckIn( ); }; #define SFX_GLOBAL_CLASSID \ diff --git a/sfx2/inc/sfx2/sfxbasecontroller.hxx b/sfx2/inc/sfx2/sfxbasecontroller.hxx index b8daf8b24e88..4db98d5634bb 100644 --- a/sfx2/inc/sfx2/sfxbasecontroller.hxx +++ b/sfx2/inc/sfx2/sfxbasecontroller.hxx @@ -387,7 +387,7 @@ private: SAL_DLLPRIVATE SfxViewFrame& GetViewFrame_Impl() const; SAL_DLLPRIVATE void ShowInfoBars( ); - DECL_LINK( CheckOutHandler, PushButton * ); + DECL_LINK( CheckOutHandler, void * ); //________________________________________________________________________________________________________ // private variables diff --git a/sfx2/inc/sfx2/sfxbasemodel.hxx b/sfx2/inc/sfx2/sfxbasemodel.hxx index 7a3b4a592281..49e4dcae72be 100644 --- a/sfx2/inc/sfx2/sfxbasemodel.hxx +++ b/sfx2/inc/sfx2/sfxbasemodel.hxx @@ -1422,6 +1422,16 @@ public: throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL checkOut( ) throw ( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL cancelCheckOut( ) throw ( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL checkIn( sal_Bool bIsMajor, const rtl::OUString & rMessage ) + throw ( ::com::sun::star::uno::RuntimeException ); + + virtual sal_Bool SAL_CALL isVersionable( ) throw ( ::com::sun::star::uno::RuntimeException ); + virtual sal_Bool SAL_CALL canCheckOut( ) throw ( ::com::sun::star::uno::RuntimeException ); + virtual sal_Bool SAL_CALL canCancelCheckOut( ) throw ( ::com::sun::star::uno::RuntimeException ); + virtual sal_Bool SAL_CALL canCheckIn( ) throw ( ::com::sun::star::uno::RuntimeException ); + + sal_Bool getBoolPropertyValue( const rtl::OUString& rName ) throw ( ::com::sun::star::uno::RuntimeException ); //____________________________________________________________________________________________________ // SfxListener diff --git a/sfx2/inc/sfx2/sfxcommands.h b/sfx2/inc/sfx2/sfxcommands.h index fc075b299c64..f054ca959d90 100644 --- a/sfx2/inc/sfx2/sfxcommands.h +++ b/sfx2/inc/sfx2/sfxcommands.h @@ -44,6 +44,9 @@ #define CMD_SID_OPENHYPERLINK ".uno:OpenHyperlink" #define CMD_SID_DOCINFO_TITLE ".uno:DocInfoTitle" #define CMD_SID_OPENTEMPLATE ".uno:OpenTemplate" +#define CMD_SID_CHECKOUT ".uno:CheckOut" +#define CMD_SID_CANCELCHECKOUT ".uno:CancelCheckOut" +#define CMD_SID_CHECKIN ".uno:CheckIn" #define CMD_SID_OPENURL ".uno:OpenUrl" #define CMD_SID_OPTIONS ".uno:Options" #define CMD_SID_ORGANIZER ".uno:Organizer" diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc index 0d3522bd7b14..0998c65b53f4 100644 --- a/sfx2/inc/sfx2/sfxsids.hrc +++ b/sfx2/inc/sfx2/sfxsids.hrc @@ -143,6 +143,9 @@ #define SID_EXPORTDOCASPDF (SID_SFX_START + 1673) #define SID_DIRECTEXPORTDOCASPDF (SID_SFX_START + 1674) #define SID_UPDATEDOCMODE (SID_SFX_START + 1668) +#define SID_CHECKOUT (SID_SFX_START + 512) +#define SID_CANCELCHECKOUT (SID_SFX_START + 513) +#define SID_CHECKIN (SID_SFX_START + 514) #define SID_FORCERELOAD (SID_SFX_START + 1502) #define SID_FILE_DIALOG (SID_SFX_START + 304) @@ -309,6 +312,7 @@ #define SID_DOCINFO_KEYWORDS (SID_SFX_START + 591) #define SID_DOCINFO_COMMENTS (SID_SFX_START + 592) #define SID_DOCINFO_AUTHOR (SID_SFX_START + 593) +#define SID_DOCINFO_MAJOR (SID_SFX_START + 594) #define SID_NEWDOCDIRECT (SID_SFX_START + 537) #define SID_DOCFRAME (SID_SFX_START + 598) #define SID_TARGETNAME (SID_SFX_START + 560) diff --git a/sfx2/inc/sfx2/sfxuno.hxx b/sfx2/inc/sfx2/sfxuno.hxx index 9e68dc4f913d..103806456caf 100644 --- a/sfx2/inc/sfx2/sfxuno.hxx +++ b/sfx2/inc/sfx2/sfxuno.hxx @@ -564,6 +564,63 @@ bool GetEncryptionData_Impl( const SfxItemSet* pSet, ::com::sun::star::uno::Sequ } //************************************************************************************************************************ +// implementation of XServiceInfo::getImplementationName() +// XServiceInfo::supportsService() +// XServiceInfo::getSupportedServiceNames() +// static xxx::impl_getStaticSupportedServiceNames() +// static xxx::impl_getStaticImplementationName() +// static xxx::impl_createInstance() +//************************************************************************************************************************ +#define SFX_IMPL_XSERVICEINFO_CTX( IMPLCLASS, IMPLSERVICENAME, IMPLNAME ) \ + \ + /* XServiceInfo */ \ + rtl::OUString SAL_CALL IMPLCLASS::getImplementationName() throw( UNORUNTIMEEXCEPTION ) \ + { \ + return impl_getStaticImplementationName(); \ + } \ + \ + /* XServiceInfo */ \ + sal_Bool SAL_CALL IMPLCLASS::supportsService( const rtl::OUString& sServiceName ) throw( UNORUNTIMEEXCEPTION ) \ + { \ + UNOSEQUENCE< rtl::OUString > seqServiceNames = getSupportedServiceNames(); \ + const rtl::OUString* pArray = seqServiceNames.getConstArray(); \ + for ( sal_Int32 nCounter=0; nCounter<seqServiceNames.getLength(); nCounter++ ) \ + { \ + if ( pArray[nCounter] == sServiceName ) \ + { \ + return sal_True ; \ + } \ + } \ + return sal_False ; \ + } \ + \ + /* XServiceInfo */ \ + UNOSEQUENCE< rtl::OUString > SAL_CALL IMPLCLASS::getSupportedServiceNames() throw( UNORUNTIMEEXCEPTION ) \ + { \ + return impl_getStaticSupportedServiceNames(); \ + } \ + \ + /* Helper for XServiceInfo */ \ + UNOSEQUENCE< rtl::OUString > IMPLCLASS::impl_getStaticSupportedServiceNames() \ + { \ + UNOSEQUENCE< rtl::OUString > seqServiceNames( 1 ); \ + seqServiceNames.getArray() [0] = rtl::OUString::createFromAscii( IMPLSERVICENAME ); \ + return seqServiceNames ; \ + } \ + \ + /* Helper for XServiceInfo */ \ + rtl::OUString IMPLCLASS::impl_getStaticImplementationName() \ + { \ + return rtl::OUString::createFromAscii( IMPLNAME ); \ + } \ + \ + /* Helper for registry */ \ + UNOREFERENCE< UNOXINTERFACE > SAL_CALL IMPLCLASS::impl_createInstance( const UNOREFERENCE< UNOXMULTISERVICEFACTORY >& xServiceManager ) throw( UNOEXCEPTION ) \ + { \ + return UNOREFERENCE< UNOXINTERFACE >( *new IMPLCLASS( comphelper::getComponentContext(xServiceManager) ) ); \ + } + +//************************************************************************************************************************ // definition of createFactory() for MultiServices //************************************************************************************************************************ #define SFX_IMPL_SINGLEFACTORY( IMPLCLASS ) \ diff --git a/sfx2/inc/sfx2/tabdlg.hxx b/sfx2/inc/sfx2/tabdlg.hxx index fe244b853aff..c3e010a86c62 100644 --- a/sfx2/inc/sfx2/tabdlg.hxx +++ b/sfx2/inc/sfx2/tabdlg.hxx @@ -68,7 +68,6 @@ friend class SfxTabDialogController; VclVBox *m_pVBox; TabControl *m_pTabCtrl; - VclHButtonBox *m_pActionArea; OKButton *m_pOKBtn; PushButton* m_pApplyBtn; PushButton* m_pUserBtn; @@ -115,6 +114,7 @@ protected: virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ); virtual long Notify( NotifyEvent& rNEvt ); + VclHButtonBox* m_pActionArea; SfxItemSet* pExampleSet; SfxItemSet* GetInputSetImpl(); SfxTabPage* GetTabPage( sal_uInt16 nPageId ) const; diff --git a/sfx2/inc/sfx2/thumbnailview.hxx b/sfx2/inc/sfx2/thumbnailview.hxx index 12d28124f83c..084b3d13fbc3 100644 --- a/sfx2/inc/sfx2/thumbnailview.hxx +++ b/sfx2/inc/sfx2/thumbnailview.hxx @@ -179,16 +179,10 @@ public: virtual ~ThumbnailView (); - void InsertItem( sal_uInt16 nItemId, - const BitmapEx &rImage, const OUString &rStr, - size_t nPos = THUMBNAILVIEW_APPEND ); - void RemoveItem( sal_uInt16 nItemId ); void Clear(); - size_t GetItemCount() const; - size_t GetItemPos( sal_uInt16 nItemId ) const; sal_uInt16 GetItemId( size_t nPos ) const; @@ -300,13 +294,10 @@ protected: SFX2_DLLPRIVATE void ImplInitScrollBar(); SFX2_DLLPRIVATE void ImplDeleteItems(); SFX2_DLLPRIVATE void ImplDraw(); - using Window::ImplScroll; - SFX2_DLLPRIVATE bool ImplScroll( const Point& rPos ); SFX2_DLLPRIVATE size_t ImplGetItem( const Point& rPoint, bool bMove = false ) const; SFX2_DLLPRIVATE ThumbnailViewItem* ImplGetItem( size_t nPos ); SFX2_DLLPRIVATE sal_uInt16 ImplGetVisibleItemCount() const; SFX2_DLLPRIVATE ThumbnailViewItem* ImplGetVisibleItem( sal_uInt16 nVisiblePos ); - SFX2_DLLPRIVATE void ImplInsertItem( ThumbnailViewItem *const pItem, const size_t nPos ); SFX2_DLLPRIVATE void ImplFireAccessibleEvent( short nEventId, const ::com::sun::star::uno::Any& rOldValue, const ::com::sun::star::uno::Any& rNewValue ); SFX2_DLLPRIVATE bool ImplHasAccessibleListeners(); DECL_DLLPRIVATE_LINK( ImplScrollHdl, ScrollBar* ); diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx index c3d889364522..4373a52ae6c1 100644 --- a/sfx2/inc/sfx2/viewfrm.hxx +++ b/sfx2/inc/sfx2/viewfrm.hxx @@ -23,7 +23,6 @@ #include "sfx2/dllapi.h" #include "sal/types.h" #include <svl/lstner.hxx> -#include <sfx2/infobar.hxx> #include <sfx2/module.hxx> #include <sfx2/frame.hxx> #include <sfx2/shell.hxx> @@ -191,8 +190,8 @@ public: The buttons will be added from Right to Left at the right of the info bar. The parent, size and position of each button will be changed: only the width will remain unchanged. */ - void AppendInfoBar( const rtl::OUString& sMessage, std::vector< PushButton* > aButtons ); - void RemoveInfoBar( SfxInfoBarWindow* pInfoBar ); + void AppendInfoBar( const rtl::OUString& sId, const rtl::OUString& sMessage, std::vector< PushButton* > aButtons ); + void RemoveInfoBar( const rtl::OUString& sId ); SAL_DLLPRIVATE void SetDowning_Impl(); SAL_DLLPRIVATE void GetDocNumber_Impl(); diff --git a/sfx2/sdi/docslots.sdi b/sfx2/sdi/docslots.sdi index 291eb58dddad..111ba6ddf690 100644 --- a/sfx2/sdi/docslots.sdi +++ b/sfx2/sdi/docslots.sdi @@ -177,6 +177,21 @@ interface OfficeDocument : Document ExecMethod = ExecFile_Impl; StateMethod = GetState_Impl; ] + SID_CHECKOUT + [ + ExecMethod = ExecFile_Impl; + StateMethod = GetState_Impl; + ] + SID_CANCELCHECKOUT + [ + ExecMethod = ExecFile_Impl; + StateMethod = GetState_Impl; + ] + SID_CHECKIN + [ + ExecMethod = ExecFile_Impl; + StateMethod = GetState_Impl; + ] } //========================================================================= diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi index 92af180aedf3..a7468cef6a2c 100644 --- a/sfx2/sdi/sfx.sdi +++ b/sfx2/sdi/sfx.sdi @@ -4444,6 +4444,78 @@ SfxObjectItem OpenTemplate SID_OPENTEMPLATE GroupId = GID_TEMPLATE; ] +SfxVoidItem CheckOut SID_CHECKOUT +() +[ + /* flags: */ + AutoUpdate = FALSE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = TRUE, + RecordAbsolute = FALSE, + RecordPerSet; + Asynchron; + + /* config: */ + AccelConfig = TRUE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_DOCUMENT; +] + +SfxVoidItem CancelCheckOut SID_CANCELCHECKOUT +() +[ + /* flags: */ + AutoUpdate = FALSE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = TRUE, + RecordAbsolute = FALSE, + RecordPerSet; + Asynchron; + + /* config: */ + AccelConfig = TRUE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_DOCUMENT; +] + +SfxVoidItem CheckIn SID_CHECKIN +(SfxStringItem VersionComment SID_DOCINFO_COMMENTS,SfxBoolItem VersionMajor SID_DOCINFO_MAJOR) +[ + /* flags: */ + AutoUpdate = FALSE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = TRUE, + RecordAbsolute = FALSE, + RecordPerSet; + Asynchron; + + /* config: */ + AccelConfig = TRUE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_DOCUMENT; +] + //-------------------------------------------------------------------------- SfxStringItem OpenUrl SID_OPENURL diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx index a4ffed8510e7..f5862426afe0 100644 --- a/sfx2/source/appl/app.cxx +++ b/sfx2/source/appl/app.cxx @@ -56,7 +56,7 @@ #include <com/sun/star/container/XIndexAccess.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <comphelper/processfactory.hxx> -#include <com/sun/star/uri/XUriReferenceFactory.hpp> +#include <com/sun/star/uri/UriReferenceFactory.hpp> #include <com/sun/star/uri/XVndSunStarScriptUrl.hpp> #include <basic/basmgr.hxx> #include <toolkit/helper/vclunohelper.hxx> @@ -527,35 +527,29 @@ sal_Bool SfxApplication::IsXScriptURL( const String& rScriptURL ) (void) rScriptURL; #else ::com::sun::star::uno::Reference - < ::com::sun::star::lang::XMultiServiceFactory > xSMgr = - ::comphelper::getProcessServiceFactory(); + < ::com::sun::star::uno::XComponentContext > xContext = + ::comphelper::getProcessComponentContext(); ::com::sun::star::uno::Reference < ::com::sun::star::uri::XUriReferenceFactory > - xFactory( xSMgr->createInstance( - ::rtl::OUString( - "com.sun.star.uri.UriReferenceFactory" ) ), - ::com::sun::star::uno::UNO_QUERY ); + xFactory = ::com::sun::star::uri::UriReferenceFactory::create( xContext ); - if ( xFactory.is() ) + try { - try - { - ::com::sun::star::uno::Reference - < ::com::sun::star::uri::XVndSunStarScriptUrl > - xUrl( xFactory->parse( rScriptURL ), - ::com::sun::star::uno::UNO_QUERY ); + ::com::sun::star::uno::Reference + < ::com::sun::star::uri::XVndSunStarScriptUrl > + xUrl( xFactory->parse( rScriptURL ), + ::com::sun::star::uno::UNO_QUERY ); - if ( xUrl.is() ) - { - result = sal_True; - } - } - catch (const ::com::sun::star::uno::RuntimeException&) + if ( xUrl.is() ) { - // ignore, will just return FALSE + result = sal_True; } } + catch (const ::com::sun::star::uno::RuntimeException&) + { + // ignore, will just return FALSE + } #endif return result; } diff --git a/sfx2/source/appl/app.hrc b/sfx2/source/appl/app.hrc index 5cbfd7fed9a8..fb322cbf3251 100644 --- a/sfx2/source/appl/app.hrc +++ b/sfx2/source/appl/app.hrc @@ -112,6 +112,7 @@ #define RID_XMLSEC_QUERY_LOSINGSIGNATURE (RID_SFX_APP_START + 186) #define RID_XMLSEC_QUERY_SAVEBEFORESIGN (RID_SFX_APP_START + 187) +#define RID_QUERY_CANCELCHECKOUT (RID_SFX_APP_START + 188) #define RID_XMLSEC_INFO_WRONGDOCFORMAT (RID_SFX_APP_START + 190) diff --git a/sfx2/source/appl/app.src b/sfx2/source/appl/app.src index 6eae48d2f327..d1dcccd11c9f 100644 --- a/sfx2/source/appl/app.src +++ b/sfx2/source/appl/app.src @@ -432,6 +432,13 @@ QueryBox RID_XMLSEC_QUERY_SAVEBEFORESIGN Message [ en-US ] = "The document has to be saved before it can be signed.\nDo you want to save the document?" ; }; +QueryBox RID_QUERY_CANCELCHECKOUT +{ + Buttons = WB_YES_NO ; + DefButton = WB_DEF_YES ; + Message [ en-US ] = "This will discard all changes on the server since check-out.\nDo you want to proceed?" ; +}; + InfoBox RID_XMLSEC_INFO_WRONGDOCFORMAT { Message [ en-US ] = "This document must be saved in OpenDocument file format before it can be digitally signed." ; diff --git a/sfx2/source/appl/appdata.cxx b/sfx2/source/appl/appdata.cxx index dc04ea6803fa..a49e7790f8e5 100644 --- a/sfx2/source/appl/appdata.cxx +++ b/sfx2/source/appl/appdata.cxx @@ -100,7 +100,7 @@ SfxAppData_Impl::SfxAppData_Impl( SfxApplication* ) , nAutoTabPageId(0) , nRescheduleLocks(0) , nInReschedule(0) - , m_xImeStatusWindow(new sfx2::appl::ImeStatusWindow(comphelper::getProcessServiceFactory())) + , m_xImeStatusWindow(new sfx2::appl::ImeStatusWindow(comphelper::getProcessComponentContext())) , pTbxCtrlFac(0) , pStbCtrlFac(0) , pViewFrames(0) diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index 1d1798ffb659..348f1c11f172 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -999,7 +999,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) try { // get registered protocol handlers from configuration - Reference < XNameAccess > xAccess( ::comphelper::ConfigurationHelper::openConfig( ::comphelper::getProcessServiceFactory(), + Reference < XNameAccess > xAccess( ::comphelper::ConfigurationHelper::openConfig( ::comphelper::getProcessComponentContext(), ::rtl::OUString("org.openoffice.Office.ProtocolHandler/HandlerSet"), ::comphelper::ConfigurationHelper::E_READONLY ), UNO_QUERY ); if ( xAccess.is() ) { diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 450da3e9eebc..fc109add1382 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -351,7 +351,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) RID_SVXDLG_CUSTOMIZE, NULL, &aSet, xFrame ); - if ( pDlg ) + if ( pDlg ) { const short nRet = pDlg->Execute(); @@ -528,13 +528,13 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - case SID_ABOUT: { - SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); + SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); if ( pFact ) { VclAbstractDialog* pDlg = pFact->CreateVclDialog( 0, RID_DEFAULTABOUT ); pDlg->Execute(); delete pDlg; - bDone = true; + bDone = true; } break; } @@ -1002,7 +1002,7 @@ static ::rtl::OUString getConfigurationStringValue( try { ::comphelper::ConfigurationHelper::readDirectKey( - comphelper::getProcessServiceFactory(), + comphelper::getProcessComponentContext(), rPackage, rRelPath, rKey, @@ -1039,8 +1039,8 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) { VclAbstractDialog* pDlg = pFact->CreateFrameDialog( NULL, xFrame, rReq.GetSlot(), sPageURL ); - short nRet = pDlg->Execute(); - delete pDlg; + short nRet = pDlg->Execute(); + delete pDlg; SfxViewFrame* pView = SfxViewFrame::GetFirst(); while ( pView ) { @@ -1232,7 +1232,10 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) short nDialogResult = pDlg->Execute(); if ( !nDialogResult ) + { + delete pDlg; break; + } Sequence< Any > args; Sequence< sal_Int16 > outIndex; @@ -1250,6 +1253,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) xScriptContext = xController; SfxObjectShell::CallXScript( xScriptContext, pDlg->GetScriptURL(), args, ret, outIndex, outArgs ); + delete pDlg; } while ( false ); rReq.Done(); @@ -1275,6 +1279,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) if( pDlg ) { pDlg->Execute(); + delete pDlg; } else { @@ -1315,9 +1320,9 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) if ( pSet && pSet->GetItemState( pSetPool->GetWhich( SID_AUTO_CORRECT_DLG ), sal_False, &pItem ) == SFX_ITEM_SET ) aSet.Put( *pItem ); - SfxAbstractTabDialog* pDlg = pFact->CreateTabDialog( RID_OFA_AUTOCORR_DLG, NULL, &aSet, NULL ); - pDlg->Execute(); - delete pDlg; + SfxAbstractTabDialog* pDlg = pFact->CreateTabDialog( RID_OFA_AUTOCORR_DLG, NULL, &aSet, NULL ); + pDlg->Execute(); + delete pDlg; } break; diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index 36be7f935710..ffb4853e7ec1 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -131,7 +131,8 @@ SfxFormalArgument aFormalArgs[] = { SFX_ARGUMENT(SID_DEFAULTFILENAME,"SuggestedSaveAsName",SfxStringItem), SFX_ARGUMENT(SID_DEFAULTFILEPATH,"SuggestedSaveAsDir",SfxStringItem), SFX_ARGUMENT(SID_DOCINFO_AUTHOR,"VersionAuthor",SfxStringItem), - SFX_ARGUMENT(SID_DOCINFO_COMMENTS,"VersionComment",SfxStringItem), + SFX_ARGUMENT(SID_DOCINFO_COMMENTS,"VersionComment",SfxBoolItem), + SFX_ARGUMENT(SID_DOCINFO_MAJOR,"VersionMajor",SfxStringItem), SFX_ARGUMENT(SID_FILE_FILTEROPTIONS,"FilterOptions",SfxStringItem), SFX_ARGUMENT(SID_FILTER_NAME,"FilterName",SfxStringItem), // SFX_ARGUMENT(SID_FILE_NAME,"FileName",SfxStringItem), @@ -1907,7 +1908,7 @@ ErrCode SfxMacroLoader::loadMacro( const ::rtl::OUString& rURL, com::sun::star:: aQualifiedMethod.Erase( nArgsPos - nHashPos - 1 ); } - if ( pBasMgr->HasMacro( aQualifiedMethod ) ) + if ( pBasMgr->HasMacro( OUString(aQualifiedMethod) ) ) { Any aOldThisComponent; const bool bSetDocMacroMode = ( pDoc != NULL ) && bIsDocBasic; diff --git a/sfx2/source/appl/imestatuswindow.cxx b/sfx2/source/appl/imestatuswindow.cxx index 754e35d9d7a7..56631e9ba801 100644 --- a/sfx2/source/appl/imestatuswindow.cxx +++ b/sfx2/source/appl/imestatuswindow.cxx @@ -26,6 +26,7 @@ #include "com/sun/star/beans/PropertyState.hpp" #include "com/sun/star/beans/PropertyValue.hpp" #include "com/sun/star/beans/XPropertySet.hpp" +#include "com/sun/star/configuration/theDefaultProvider.hpp" #include "com/sun/star/lang/DisposedException.hpp" #include "com/sun/star/lang/XMultiServiceFactory.hpp" #include "com/sun/star/uno/Any.hxx" @@ -84,9 +85,8 @@ namespace css = com::sun::star; using sfx2::appl::ImeStatusWindow; ImeStatusWindow::ImeStatusWindow( - css::uno::Reference< css::lang::XMultiServiceFactory > const & - rServiceFactory): - m_xServiceFactory(rServiceFactory), + css::uno::Reference< css::uno::XComponentContext > const & rxContext): + m_xContext(rxContext), m_bDisposed(false) {} @@ -201,24 +201,14 @@ css::uno::Reference< css::beans::XPropertySet > ImeStatusWindow::getConfig() { if (m_bDisposed) throw css::lang::DisposedException(); - if (!m_xServiceFactory.is()) + if (!m_xContext.is()) throw css::uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "null comphelper::getProcessServiceFactory")), 0); - css::uno::Reference< css::lang::XMultiServiceFactory > xProvider( - m_xServiceFactory->createInstance( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.configuration.ConfigurationProvider"))), - css::uno::UNO_QUERY); - if (!xProvider.is()) - throw css::uno::RuntimeException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "null com.sun.star.configuration." - "ConfigurationProvider")), - 0); + css::uno::Reference< css::lang::XMultiServiceFactory > xProvider = + css::configuration::theDefaultProvider::get( m_xContext ); css::beans::PropertyValue aArg( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath")), -1, css::uno::makeAny( diff --git a/sfx2/source/appl/imestatuswindow.hxx b/sfx2/source/appl/imestatuswindow.hxx index 5aee577fcc54..4ab18a5841ce 100644 --- a/sfx2/source/appl/imestatuswindow.hxx +++ b/sfx2/source/appl/imestatuswindow.hxx @@ -47,7 +47,7 @@ ImeStatusWindow_Impl; class ImeStatusWindow: private ImeStatusWindow_Impl { public: - ImeStatusWindow( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > const& rServiceFactory ); + ImeStatusWindow( com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > const& rxContext ); /** Set up VCL according to the configuration. @@ -103,8 +103,8 @@ private: com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > getConfig(); - com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > - m_xServiceFactory; + com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > + m_xContext; osl::Mutex m_aMutex; com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx index 4ad6a59f4f80..9564a1857208 100644 --- a/sfx2/source/appl/linkmgr2.cxx +++ b/sfx2/source/appl/linkmgr2.cxx @@ -304,9 +304,9 @@ bool LinkManager::GetDisplayNames( } void LinkManager::UpdateAllLinks( - sal_Bool bAskUpdate, - sal_Bool /*bCallErrHdl*/, - sal_Bool bUpdateGrfLinks, + bool bAskUpdate, + bool /*bCallErrHdl*/, + bool bUpdateGrfLinks, Window* pParentWin ) { // First make a copy of the array in order to update links @@ -350,7 +350,7 @@ void LinkManager::UpdateAllLinks( int nRet = QueryBox( pParentWin, WB_YES_NO | WB_DEF_YES, SfxResId( STR_QUERY_UPDATE_LINKS ).toString() ).Execute(); if( RET_YES != nRet ) return ; // nothing should be updated - bAskUpdate = sal_False; // once is enough + bAskUpdate = false; // once is enough } pLink->Update(); diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 09268a375e6c..3e39f645395c 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -296,7 +296,7 @@ ContentListBox_Impl::ContentListBox_Impl( Window* pParent, const ResId& rResId ) ContentListBox_Impl::~ContentListBox_Impl() { sal_uInt16 nPos = 0; - SvLBoxEntry* pEntry = GetEntry( nPos++ ); + SvTreeListEntry* pEntry = GetEntry( nPos++ ); while ( pEntry ) { ::rtl::OUString aTemp( GetEntryText( pEntry ) ); @@ -325,7 +325,7 @@ void ContentListBox_Impl::InitRoot() aURL = aRow.GetToken( 0, '\t', nIdx ); sal_Unicode cFolder = aRow.GetToken( 0, '\t', nIdx ).GetChar(0); sal_Bool bIsFolder = ( '1' == cFolder ); - SvLBoxEntry* pEntry = InsertEntry( aTitle, aOpenBookImage, aClosedBookImage, NULL, sal_True ); + SvTreeListEntry* pEntry = InsertEntry( aTitle, aOpenBookImage, aClosedBookImage, NULL, sal_True ); if ( bIsFolder ) pEntry->SetUserData( new ContentEntry_Impl( aURL, sal_True ) ); } @@ -333,9 +333,9 @@ void ContentListBox_Impl::InitRoot() // ----------------------------------------------------------------------- -void ContentListBox_Impl::ClearChildren( SvLBoxEntry* pParent ) +void ContentListBox_Impl::ClearChildren( SvTreeListEntry* pParent ) { - SvLBoxEntry* pEntry = FirstChild( pParent ); + SvTreeListEntry* pEntry = FirstChild( pParent ); while ( pEntry ) { ::rtl::OUString aTemp( GetEntryText( pEntry ) ); @@ -347,7 +347,7 @@ void ContentListBox_Impl::ClearChildren( SvLBoxEntry* pParent ) // ----------------------------------------------------------------------- -void ContentListBox_Impl::RequestingChildren( SvLBoxEntry* pParent ) +void ContentListBox_Impl::RequestingChildren( SvTreeListEntry* pParent ) { try { @@ -370,7 +370,7 @@ void ContentListBox_Impl::RequestingChildren( SvLBoxEntry* pParent ) aURL = aRow.GetToken( 0, '\t', nIdx ); sal_Unicode cFolder = aRow.GetToken( 0, '\t', nIdx ).GetChar(0); sal_Bool bIsFolder = ( '1' == cFolder ); - SvLBoxEntry* pEntry = NULL; + SvTreeListEntry* pEntry = NULL; if ( bIsFolder ) { pEntry = InsertEntry( aTitle, aOpenBookImage, aClosedBookImage, pParent, sal_True ); @@ -414,7 +414,7 @@ long ContentListBox_Impl::Notify( NotifyEvent& rNEvt ) String ContentListBox_Impl::GetSelectEntry() const { String aRet; - SvLBoxEntry* pEntry = FirstSelected(); + SvTreeListEntry* pEntry = FirstSelected(); if ( pEntry && !( (ContentEntry_Impl*)pEntry->GetUserData() )->bIsFolder ) aRet = ( (ContentEntry_Impl*)pEntry->GetUserData() )->aURL; return aRet; @@ -2170,7 +2170,7 @@ void SfxHelpTextWindow_Impl::InitOnStartupBox( bool bOnlyText ) { sCurrentFactory = SfxHelp::GetCurrentModuleIdentifier(); - Reference< XMultiServiceFactory > xMultiServiceFac = ::comphelper::getProcessServiceFactory(); + Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); Reference< XInterface > xConfig; ::rtl::OUString sPath( PATH_OFFICE_FACTORIES ); sPath += sCurrentFactory; @@ -2185,7 +2185,7 @@ void SfxHelpTextWindow_Impl::InitOnStartupBox( bool bOnlyText ) try { xConfiguration = ConfigurationHelper::openConfig( - xMultiServiceFac, PACKAGE_SETUP, ConfigurationHelper::E_STANDARD ); + xContext, PACKAGE_SETUP, ConfigurationHelper::E_STANDARD ); if ( xConfiguration.is() ) { Any aAny = ConfigurationHelper::readRelativeKey( xConfiguration, sPath, sKey ); diff --git a/sfx2/source/appl/newhelp.hxx b/sfx2/source/appl/newhelp.hxx index 74d73a32194c..cd69921be5b2 100644 --- a/sfx2/source/appl/newhelp.hxx +++ b/sfx2/source/appl/newhelp.hxx @@ -78,14 +78,14 @@ private: Image aDocumentImage; void InitRoot(); - void ClearChildren( SvLBoxEntry* pParent ); + void ClearChildren( SvTreeListEntry* pParent ); public: ContentListBox_Impl( Window* pParent, const ResId& rResId ); ~ContentListBox_Impl(); - virtual void RequestingChildren( SvLBoxEntry* pParent ); + virtual void RequestingChildren( SvTreeListEntry* pParent ); virtual long Notify( NotifyEvent& rNEvt ); inline void SetOpenHdl( const Link& rLink ) { SetDoubleClickHdl( rLink ); } diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx index 14df8c481ed1..60de316a023c 100644 --- a/sfx2/source/bastyp/fltfnc.cxx +++ b/sfx2/source/bastyp/fltfnc.cxx @@ -1147,7 +1147,6 @@ void SfxFilterContainer::ReadFilters_Impl( sal_Bool bUpdate ) SfxFilter* pFilter; for ( size_t i = 0, n = rList.size(); i < n; ++i ) { - pFilter = NULL; pFilter = rList[ i ]; pFilter->nFormatType |= SFX_FILTER_NOTINSTALLED; } diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index 069273e8a1ac..935077c27f39 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -2073,7 +2073,6 @@ SfxPopupMenuManager* SfxDispatcher::Popup( sal_uInt16 nConfigId,Window *pWin, co SfxDispatcher &rDisp = *SFX_APP()->GetDispatcher_Impl(); sal_uInt16 nShLevel = 0; SfxShell *pSh; - nShLevel=0; if ( rDisp.pImp->bQuiet ) { @@ -2101,7 +2100,6 @@ void SfxDispatcher::ExecutePopup( sal_uInt16 nConfigId, Window *pWin, const Poin sal_uInt16 nShLevel = 0; SfxShell *pSh; - nShLevel=0; if ( rDisp.pImp->bQuiet ) { nConfigId = 0; diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx index 6741b59730d2..fd2d215b01e8 100644 --- a/sfx2/source/control/thumbnailview.cxx +++ b/sfx2/source/control/thumbnailview.cxx @@ -405,40 +405,6 @@ void ThumbnailView::CalculateItemPositions () delete pDelScrBar; } -bool ThumbnailView::ImplScroll( const Point& rPos ) -{ - if ( !mbScroll || !maItemListRect.IsInside(rPos) ) - return false; - - const long nScrollOffset = (mnItemHeight <= 16) ? SCROLL_OFFSET/2 : SCROLL_OFFSET; - bool bScroll = false; - - if ( rPos.Y() <= maItemListRect.Top()+nScrollOffset ) - { - if ( mnFirstLine > 0 ) - { - --mnFirstLine; - bScroll = true; - } - } - else if ( rPos.Y() >= maItemListRect.Bottom()-nScrollOffset ) - { - if ( mnFirstLine < static_cast<sal_uInt16>(mnLines-mnVisLines) ) - { - ++mnFirstLine; - bScroll = true; - } - } - - if ( !bScroll ) - return false; - - if ( IsReallyVisible() && IsUpdateMode() ) - Invalidate(); - - return true; -} - size_t ThumbnailView::ImplGetItem( const Point& rPos, bool bMove ) const { if ( !mbHasVisibleItems ) @@ -791,36 +757,6 @@ void ThumbnailView::DataChanged( const DataChangedEvent& rDCEvt ) } } -void ThumbnailView::InsertItem( sal_uInt16 nItemId, const BitmapEx& rImage, - const OUString& rText, size_t nPos ) -{ - ThumbnailViewItem* pItem = new ThumbnailViewItem( *this, this ); - pItem->mnId = nItemId; - pItem->maPreview1 = rImage; - pItem->maTitle = rText; - pItem->setSelectClickHdl(LINK(this,ThumbnailView,OnItemSelected)); - ImplInsertItem( pItem, nPos ); -} - -void ThumbnailView::ImplInsertItem( ThumbnailViewItem *const pItem, const size_t nPos ) -{ - assert(pItem->mnId); // "ItemId == 0" - assert(GetItemPos( pItem->mnId ) == THUMBNAILVIEW_ITEM_NOTFOUND); // ItemId already exists - - if ( nPos < mItemList.size() ) { - ValueItemList::iterator it = mItemList.begin(); - ::std::advance( it, nPos ); - mItemList.insert( it, pItem ); - } else { - mItemList.push_back( pItem ); - } - - CalculateItemPositions(); - - if ( IsReallyVisible() && IsUpdateMode() ) - Invalidate(); -} - void ThumbnailView::RemoveItem( sal_uInt16 nItemId ) { size_t nPos = GetItemPos( nItemId ); @@ -863,11 +799,6 @@ void ThumbnailView::Clear() Invalidate(); } -size_t ThumbnailView::GetItemCount() const -{ - return mItemList.size(); -} - size_t ThumbnailView::GetItemPos( sal_uInt16 nItemId ) const { for ( size_t i = 0, n = mItemList.size(); i < n; ++i ) { diff --git a/sfx2/source/dialog/checkin.cxx b/sfx2/source/dialog/checkin.cxx new file mode 100644 index 000000000000..a2bac2570771 --- /dev/null +++ b/sfx2/source/dialog/checkin.cxx @@ -0,0 +1,39 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <sfx2/checkin.hxx> +#include <vcl/msgbox.hxx> + +SfxCheckinDialog::SfxCheckinDialog( Window* pParent ) : + ModalDialog( pParent, "CheckinDialog", "sfx/ui/checkin.ui" ) +{ + get( m_pCommentED, "VersionComment" ); + get( m_pMajorCB, "MajorVersion" ); + + get( m_pOKBtn, "ok" ); + m_pOKBtn->SetClickHdl( LINK( this, SfxCheckinDialog, OKHdl ) ); +} + +rtl::OUString SfxCheckinDialog::GetComment( ) +{ + return m_pCommentED->GetText( ); +} + +bool SfxCheckinDialog::IsMajor( ) +{ + return m_pMajorCB->IsChecked( ); +} + +IMPL_LINK_NOARG( SfxCheckinDialog, OKHdl ) +{ + EndDialog( RET_OK ); + return 0; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index ee59b5eda131..99d7dbfa1366 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -2321,11 +2321,6 @@ CustomPropertiesControl::CustomPropertiesControl( Window* pParent, const ResId& m_aVertScroll.SetPageSize( nVisibleEntries - 1 ); m_aVertScroll.SetVisibleSize( nVisibleEntries ); - Point aPos = m_aHeaderBar.GetPosPixel(); - Size aSize = m_aHeaderBar.GetSizePixel(); - aPos = m_aVertScroll.GetPosPixel(); - aSize = m_aVertScroll.GetSizePixel(); - Link aScrollLink = LINK( this, CustomPropertiesControl, ScrollHdl ); m_aVertScroll.SetScrollHdl( aScrollLink ); } diff --git a/sfx2/source/dialog/infobar.cxx b/sfx2/source/dialog/infobar.cxx index e72468ca4a47..f92e836abe1d 100644 --- a/sfx2/source/dialog/infobar.cxx +++ b/sfx2/source/dialog/infobar.cxx @@ -18,6 +18,7 @@ #include <sfx2/objsh.hxx> #include <sfx2/sfx.hrc> #include <sfx2/viewsh.hxx> +#include <vcl/svapp.hxx> using namespace std; @@ -49,6 +50,14 @@ namespace basegfx::BColor aLightColor( 1.0, 1.0, 191.0 / 255.0 ); basegfx::BColor aDarkColor( 217.0 / 255.0, 217.0 / 255.0, 78.0 / 255.0 ); + const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); + if ( rSettings.GetHighContrastMode() ) + { + aLightColor = rSettings.GetLightColor( ).getBColor( ); + aDarkColor = rSettings.GetDialogTextColor( ).getBColor( ); + + } + // Light background basegfx::B2DPolygon aPolygon; aPolygon.append( basegfx::B2DPoint( aRect.Left( ), aRect.Top( ) ) ); @@ -85,9 +94,10 @@ namespace } } -SfxInfoBarWindow::SfxInfoBarWindow( Window* pParent, const rtl::OUString& sMessage, - vector< PushButton* > aButtons ) : +SfxInfoBarWindow::SfxInfoBarWindow( Window* pParent, const rtl::OUString& sId, + const rtl::OUString& sMessage, vector< PushButton* > aButtons ) : Window( pParent, 0 ), + m_sId( sId ), m_pMessage( NULL ), m_pCloseBtn( NULL ), m_aActionBtns( aButtons ) @@ -149,6 +159,16 @@ void SfxInfoBarWindow::Paint( const Rectangle& rPaintRect ) basegfx::BColor aLightColor( 1.0, 1.0, 191.0 / 255.0 ); basegfx::BColor aDarkColor( 217.0 / 255.0, 217.0 / 255.0, 78.0 / 255.0 ); + const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); + if ( rSettings.GetHighContrastMode() ) + { + aLightColor = rSettings.GetLightColor( ).getBColor( ); + aDarkColor = rSettings.GetDialogTextColor( ).getBColor( ); + } + + // Update the label background color + m_pMessage->SetBackground( Wallpaper( Color( aLightColor ) ) ); + // Light background basegfx::B2DPolygon aPolygon; aPolygon.append( basegfx::B2DPoint( aRect.Left( ), aRect.Top( ) ) ); @@ -180,6 +200,27 @@ void SfxInfoBarWindow::Paint( const Rectangle& rPaintRect ) Window::Paint( rPaintRect ); } +void SfxInfoBarWindow::Resize( ) +{ + long nWidth = GetSizePixel().getWidth(); + m_pCloseBtn->SetPosSizePixel( Point( nWidth - 25, 15 ), Size( 10, 10 ) ); + + // Reparent the buttons and place them on the right of the bar + long nX = m_pCloseBtn->GetPosPixel( ).getX( ) - 15; + long nBtnGap = 5; + for ( vector< PushButton* >::iterator it = m_aActionBtns.begin( ); + it != m_aActionBtns.end( ); ++it ) + { + PushButton* pBtn = *it; + long nBtnWidth = pBtn->GetSizePixel( ).getWidth(); + nX -= nBtnWidth; + pBtn->SetPosSizePixel( Point( nX, 5 ), Size( nBtnWidth, 30 ) ); + nX -= nBtnGap; + } + + m_pMessage->SetPosSizePixel( Point( 10, 10 ), Size( nX - 20, 20 ) ); +} + IMPL_LINK_NOARG( SfxInfoBarWindow, CloseHandler ) { ((SfxInfoBarContainerWindow*)GetParent())->removeInfoBar( this ); @@ -203,13 +244,12 @@ SfxInfoBarContainerWindow::~SfxInfoBarContainerWindow( ) m_pInfoBars.clear( ); } -void SfxInfoBarContainerWindow::appendInfoBar( const rtl::OUString& sMessage, vector< PushButton* > aButtons ) +void SfxInfoBarContainerWindow::appendInfoBar( const rtl::OUString& sId, const rtl::OUString& sMessage, vector< PushButton* > aButtons ) { Size aSize = GetSizePixel( ); - SfxInfoBarWindow* pInfoBar = new SfxInfoBarWindow( this, sMessage, aButtons ); + SfxInfoBarWindow* pInfoBar = new SfxInfoBarWindow( this, sId, sMessage, aButtons ); pInfoBar->SetPosPixel( Point( 0, aSize.getHeight( ) ) ); - m_pInfoBars.push_back( pInfoBar ); pInfoBar->Show( ); long nHeight = pInfoBar->GetSizePixel( ).getHeight( ); @@ -217,6 +257,19 @@ void SfxInfoBarContainerWindow::appendInfoBar( const rtl::OUString& sMessage, ve SetSizePixel( aSize ); } +SfxInfoBarWindow* SfxInfoBarContainerWindow::getInfoBar( const rtl::OUString& sId ) +{ + SfxInfoBarWindow* pRet = NULL; + for ( vector< SfxInfoBarWindow* >::iterator it = m_pInfoBars.begin( ); + it != m_pInfoBars.end( ) && pRet == NULL; ++it ) + { + SfxInfoBarWindow* pBar = *it; + if ( pBar->getId( ) == sId ) + pRet = pBar; + } + return pRet; +} + void SfxInfoBarContainerWindow::removeInfoBar( SfxInfoBarWindow* pInfoBar ) { for ( vector< SfxInfoBarWindow* >::iterator it = m_pInfoBars.begin( ); @@ -245,6 +298,20 @@ void SfxInfoBarContainerWindow::removeInfoBar( SfxInfoBarWindow* pInfoBar ) m_pChildWin->Update( ); } +void SfxInfoBarContainerWindow::Resize( ) +{ + // Only need to change the width of the infobars + long nWidth = GetSizePixel( ).getWidth( ); + for ( vector< SfxInfoBarWindow * >::iterator it = m_pInfoBars.begin( ); + it != m_pInfoBars.end( ); ++it ) + { + SfxInfoBarWindow* pInfoBar = *it; + Size aSize = pInfoBar->GetSizePixel( ); + aSize.setWidth( nWidth ); + pInfoBar->SetSizePixel( aSize ); + pInfoBar->Resize( ); + } +} SFX_IMPL_POS_CHILDWINDOW_WITHID( SfxInfoBarContainerChild, SID_INFOBARCONTAINER, SFX_OBJECTBAR_OBJECT ); diff --git a/sfx2/source/dialog/securitypage.cxx b/sfx2/source/dialog/securitypage.cxx index ffa3a7aa50f6..b4de6af41e7a 100644 --- a/sfx2/source/dialog/securitypage.cxx +++ b/sfx2/source/dialog/securitypage.cxx @@ -200,11 +200,6 @@ SfxSecurityPage_Impl::SfxSecurityPage_Impl( SfxSecurityPage &rTabPage, const Sfx m_bEndRedliningWarningDone ( false ) { m_aChangeProtectionPB.SetText( m_aProtectSTR ); - // adjust button width if necessary - long nBtnTextWidth = 0; - long nTemp = m_aChangeProtectionPB.GetCtrlTextWidth( m_aChangeProtectionPB.GetText() ); - if (nTemp > nBtnTextWidth) - nBtnTextWidth = nTemp; // force toggle hdl called before visual change of checkbox m_aRecordChangesCB.SetStyle( m_aRecordChangesCB.GetStyle() | WB_EARLYTOGGLE ); diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index b137cee62372..eda237570f9a 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -727,19 +727,14 @@ sal_Bool SfxTabDialog::IsApplyButtonEnabled() const void SfxTabDialog::Start_Impl() { - //If we're layout enabled, we need to force all tabs to - //exist to get overall optimal size for dialog - if (isLayoutEnabled()) + //We need to force all tabs to exist to get overall optimal size for dialog + for (sal_uInt16 n=0; n < m_pTabCtrl->GetPageCount(); ++n) { - for ( sal_uInt16 n=0; n < m_pTabCtrl->GetPageCount(); ++n) + sal_uInt16 nPageId = m_pTabCtrl->GetPageId(n); + if (!m_pTabCtrl->GetTabPage(nPageId)) { - sal_uInt16 nPageId = m_pTabCtrl->GetPageId(n); - TabPage* pTabPage = m_pTabCtrl->GetTabPage(nPageId); - if (!pTabPage) - { - m_pTabCtrl->SetCurPageId(nPageId); - ActivatePageHdl(m_pTabCtrl); - } + m_pTabCtrl->SetCurPageId(nPageId); + ActivatePageHdl(m_pTabCtrl); } } diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index e92b7f085205..3e610b6600ba 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -421,7 +421,7 @@ typedef std::vector<rtl::OUString> ExpandedEntries_t; class StyleTreeListBox_Impl : public DropListBox_Impl { private: - SvLBoxEntry* pCurEntry; + SvTreeListEntry* pCurEntry; Link aDoubleClickLink; Link aDropLink; String aParent; @@ -433,9 +433,9 @@ protected: virtual sal_Bool DoubleClickHdl(); virtual long ExpandingHdl(); virtual void ExpandedHdl(); - virtual sal_Bool NotifyMoving(SvLBoxEntry* pTarget, - SvLBoxEntry* pEntry, - SvLBoxEntry*& rpNewParent, + virtual sal_Bool NotifyMoving(SvTreeListEntry* pTarget, + SvTreeListEntry* pEntry, + SvTreeListEntry*& rpNewParent, sal_uIntPtr& rNewChildPos); public: StyleTreeListBox_Impl( SfxCommonTemplateDialog_Impl* pParent, WinBits nWinStyle = 0); @@ -455,8 +455,8 @@ public: void StyleTreeListBox_Impl::MakeExpanded_Impl(ExpandedEntries_t& rEntries) const { - SvLBoxEntry *pEntry; - for(pEntry=(SvLBoxEntry*)FirstVisible();pEntry;pEntry=(SvLBoxEntry*)NextVisible(pEntry)) + SvTreeListEntry *pEntry; + for(pEntry=(SvTreeListEntry*)FirstVisible();pEntry;pEntry=(SvTreeListEntry*)NextVisible(pEntry)) { if(IsExpanded(pEntry)) { @@ -520,9 +520,9 @@ long StyleTreeListBox_Impl::Notify( NotifyEvent& rNEvt ) //------------------------------------------------------------------------- -sal_Bool StyleTreeListBox_Impl::NotifyMoving(SvLBoxEntry* pTarget, - SvLBoxEntry* pEntry, - SvLBoxEntry*& rpNewParent, +sal_Bool StyleTreeListBox_Impl::NotifyMoving(SvTreeListEntry* pTarget, + SvTreeListEntry* pEntry, + SvTreeListEntry*& rpNewParent, sal_uIntPtr& lPos) /* [Description] @@ -539,7 +539,7 @@ sal_Bool StyleTreeListBox_Impl::NotifyMoving(SvLBoxEntry* pTarget, lPos=0; IntlWrapper aIntlWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() ); const CollatorWrapper* pCollator = aIntlWrapper.getCaseCollator(); - for(SvLBoxEntry *pTmpEntry=FirstChild(pTarget); + for(SvTreeListEntry *pTmpEntry=FirstChild(pTarget); pTmpEntry && COMPARE_LESS==pCollator->compareString( GetEntryText(pTmpEntry),GetEntryText(pEntry)); pTmpEntry=NextSibling(pTmpEntry),lPos++) ; @@ -578,7 +578,7 @@ void StyleTreeListBox_Impl::ExpandedHdl() */ { - SvLBoxEntry *pEntry = GetHdlEntry(); + SvTreeListEntry *pEntry = GetHdlEntry(); if(!IsExpanded(pEntry) && pCurEntry != GetCurEntry()) SelectAll( sal_False ); pCurEntry = 0; @@ -719,12 +719,12 @@ inline sal_Bool IsExpanded_Impl( const ExpandedEntries_t& rEntries, -SvLBoxEntry* FillBox_Impl(SvTreeListBox *pBox, +SvTreeListEntry* FillBox_Impl(SvTreeListBox *pBox, StyleTree_Impl* pEntry, const ExpandedEntries_t& rEntries, - SvLBoxEntry* pParent = 0) + SvTreeListEntry* pParent = 0) { - SvLBoxEntry* pNewEntry = pBox->InsertEntry(pEntry->aName, pParent); + SvTreeListEntry* pNewEntry = pBox->InsertEntry(pEntry->aName, pParent); const sal_uInt16 nCount = pEntry->pChildren ? pEntry->pChildren->size() : 0; for(sal_uInt16 i = 0; i < nCount; ++i) FillBox_Impl(pBox, (*pEntry->pChildren)[i], rEntries, pNewEntry); @@ -1072,7 +1072,7 @@ void SfxCommonTemplateDialog_Impl::SelectStyle(const String &rStr) { if ( rStr.Len() ) { - SvLBoxEntry* pEntry = pTreeBox->First(); + SvTreeListEntry* pEntry = pTreeBox->First(); while ( pEntry ) { if ( pTreeBox->GetEntryText( pEntry ) == rStr ) @@ -1092,9 +1092,9 @@ void SfxCommonTemplateDialog_Impl::SelectStyle(const String &rStr) sal_Bool bSelect = ( rStr.Len() > 0 ); if ( bSelect ) { - SvLBoxEntry* pEntry = (SvLBoxEntry*)aFmtLb.FirstVisible(); + SvTreeListEntry* pEntry = (SvTreeListEntry*)aFmtLb.FirstVisible(); while ( pEntry && aFmtLb.GetEntryText( pEntry ) != rStr ) - pEntry = (SvLBoxEntry*)aFmtLb.NextVisible( pEntry ); + pEntry = (SvTreeListEntry*)aFmtLb.NextVisible( pEntry ); if ( !pEntry ) bSelect = sal_False; else @@ -1121,13 +1121,13 @@ String SfxCommonTemplateDialog_Impl::GetSelectedEntry() const String aRet; if ( pTreeBox ) { - SvLBoxEntry* pEntry = pTreeBox->FirstSelected(); + SvTreeListEntry* pEntry = pTreeBox->FirstSelected(); if ( pEntry ) aRet = pTreeBox->GetEntryText( pEntry ); } else { - SvLBoxEntry* pEntry = aFmtLb.FirstSelected(); + SvTreeListEntry* pEntry = aFmtLb.FirstSelected(); if ( pEntry ) aRet = aFmtLb.GetEntryText( pEntry ); } @@ -1192,7 +1192,7 @@ void SfxCommonTemplateDialog_Impl::FillTreeBox() if ( nCount ) pTreeBox->Expand( pTreeBox->First() ); - for ( SvLBoxEntry* pEntry = pTreeBox->First(); pEntry; pEntry = pTreeBox->Next( pEntry ) ) + for ( SvTreeListEntry* pEntry = pTreeBox->First(); pEntry; pEntry = pTreeBox->Next( pEntry ) ) { if ( IsExpanded_Impl( aEntries, pTreeBox->GetEntryText( pEntry ) ) ) pTreeBox->Expand( pEntry ); @@ -1303,7 +1303,7 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(sal_uInt16 nFlags) EnableItem(SID_STYLE_WATERCAN,sal_False); SfxStyleSheetBase *pStyle = pStyleSheetPool->First(); - SvLBoxEntry* pEntry = aFmtLb.First(); + SvTreeListEntry* pEntry = aFmtLb.First(); std::vector<rtl::OUString> aStrings; comphelper::string::NaturalStringSorter aSorter( diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx index 1411287fab33..55702767d976 100644 --- a/sfx2/source/dialog/versdlg.cxx +++ b/sfx2/source/dialog/versdlg.cxx @@ -261,7 +261,7 @@ void SfxVersionDialog::Init_Impl() aEntry += pInfo->aAuthor; aEntry += '\t'; aEntry += ConvertWhiteSpaces_Impl( pInfo->aComment ); - SvLBoxEntry *pEntry = aVersionBox.InsertEntry( aEntry ); + SvTreeListEntry *pEntry = aVersionBox.InsertEntry( aEntry ); pEntry->SetUserData( pInfo ); } } @@ -290,7 +290,7 @@ void SfxVersionDialog::Open_Impl() { SfxObjectShell *pObjShell = pViewFrame->GetObjectShell(); - SvLBoxEntry *pEntry = aVersionBox.FirstSelected(); + SvTreeListEntry *pEntry = aVersionBox.FirstSelected(); sal_uIntPtr nPos = aVersionBox.GetModel()->GetRelPos( pEntry ); SfxInt16Item aItem( SID_VERSION, (short)nPos+1 ); SfxStringItem aTarget( SID_TARGETNAME, DEFINE_CONST_UNICODE("_blank") ); @@ -368,7 +368,7 @@ IMPL_LINK_NOARG(SfxVersionDialog, SelectHdl_Impl) IMPL_LINK( SfxVersionDialog, ButtonHdl_Impl, Button*, pButton ) { SfxObjectShell *pObjShell = pViewFrame->GetObjectShell(); - SvLBoxEntry *pEntry = aVersionBox.FirstSelected(); + SvTreeListEntry *pEntry = aVersionBox.FirstSelected(); if ( pButton == &aSaveCheckBox ) { diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx index f2fbf52ae512..8ee9bfdc27b6 100644 --- a/sfx2/source/doc/DocumentMetadataAccess.cxx +++ b/sfx2/source/doc/DocumentMetadataAccess.cxx @@ -61,7 +61,7 @@ #include <unotools/ucbhelper.hxx> #include <com/sun/star/uri/XUriReference.hpp> -#include <com/sun/star/uri/XUriReferenceFactory.hpp> +#include <com/sun/star/uri/UriReferenceFactory.hpp> #include <com/sun/star/uri/XVndSunStarPkgUrlReferenceFactory.hpp> @@ -147,13 +147,8 @@ uno::Reference<rdf::XURI> createBaseURI( } } - const uno::Reference<lang::XMultiComponentFactory> xServiceFactory( - i_xContext->getServiceManager(), uno::UNO_SET_THROW); - const uno::Reference<uri::XUriReferenceFactory> xUriFactory( - xServiceFactory->createInstanceWithContext( - ::rtl::OUString( - "com.sun.star.uri.UriReferenceFactory"), i_xContext), - uno::UNO_QUERY_THROW); + const uno::Reference<uri::XUriReferenceFactory> xUriFactory = + uri::UriReferenceFactory::create( i_xContext); uno::Reference< uri::XUriReference > xBaseURI; const uno::Reference< uri::XUriReference > xPkgURI( diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx index 0b97c0b8e19a..b530da3571e9 100644 --- a/sfx2/source/doc/SfxDocumentMetaData.cxx +++ b/sfx2/source/doc/SfxDocumentMetaData.cxx @@ -45,6 +45,7 @@ #include "com/sun/star/document/XExporter.hpp" #include "com/sun/star/document/XFilter.hpp" #include "com/sun/star/xml/sax/Parser.hpp" +#include "com/sun/star/xml/sax/Writer.hpp" #include "com/sun/star/xml/dom/XDocument.hpp" #include "com/sun/star/xml/dom/XElement.hpp" #include "com/sun/star/xml/dom/DocumentBuilder.hpp" @@ -2003,13 +2004,9 @@ SfxDocumentMetaData::storeToStorage( if (!xOutStream.is()) throw css::uno::RuntimeException(); css::uno::Reference<css::lang::XMultiComponentFactory> xMsf ( m_xContext->getServiceManager()); - css::uno::Reference<css::io::XActiveDataSource> xSaxWriter( - xMsf->createInstanceWithContext(::rtl::OUString( - "com.sun.star.xml.sax.Writer"), m_xContext), - css::uno::UNO_QUERY_THROW); + css::uno::Reference<css::xml::sax::XWriter> xSaxWriter( + css::xml::sax::Writer::create(m_xContext)); xSaxWriter->setOutputStream(xOutStream); - css::uno::Reference<css::xml::sax::XDocumentHandler> xDocHandler ( - xSaxWriter, css::uno::UNO_QUERY_THROW); const sal_uInt64 version = SotStorage::GetVersion( xStorage ); // Oasis is also the default (0) @@ -2022,7 +2019,7 @@ SfxDocumentMetaData::storeToStorage( css::uno::Reference<css::beans::XPropertySet> xPropArg = getURLProperties(Medium); css::uno::Sequence< css::uno::Any > args(2); - args[0] <<= xDocHandler; + args[0] <<= xSaxWriter; args[1] <<= xPropArg; css::uno::Reference<css::document::XExporter> xExp( diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx index 4caac052801c..a183008549c9 100644 --- a/sfx2/source/doc/docfac.cxx +++ b/sfx2/source/doc/docfac.cxx @@ -224,7 +224,7 @@ void SfxObjectFactory::SetSystemTemplate( const String& rServiceName, const Stri { uno::Reference< lang::XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory(); uno::Reference< uno::XInterface > xConfig = ::comphelper::ConfigurationHelper::openConfig( - xFactory, CONF_ROOT, ::comphelper::ConfigurationHelper::E_STANDARD ); + ::comphelper::getProcessComponentContext(), CONF_ROOT, ::comphelper::ConfigurationHelper::E_STANDARD ); ::rtl::OUString aActualFilter; ::comphelper::ConfigurationHelper::readRelativeKey( xConfig, CONF_PATH, PROP_ACTUAL_FILTER ) >>= aActualFilter; diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 995be9cad8fe..b1f3541c22d2 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -143,7 +143,7 @@ bool IsSystemFileLockingUsed() { uno::Reference< uno::XInterface > xCommonConfig = ::comphelper::ConfigurationHelper::openConfig( - ::comphelper::getProcessServiceFactory(), + ::comphelper::getProcessComponentContext(), ::rtl::OUString( "/org.openoffice.Office.Common" ), ::comphelper::ConfigurationHelper::E_STANDARD ); if ( !xCommonConfig.is() ) @@ -170,7 +170,7 @@ bool IsOOoLockFileUsed() { uno::Reference< uno::XInterface > xCommonConfig = ::comphelper::ConfigurationHelper::openConfig( - ::comphelper::getProcessServiceFactory(), + ::comphelper::getProcessComponentContext(), ::rtl::OUString( "/org.openoffice.Office.Common" ), ::comphelper::ConfigurationHelper::E_STANDARD ); if ( !xCommonConfig.is() ) @@ -262,6 +262,7 @@ public: bool m_bTriedStorage:1; bool m_bRemote:1; bool m_bInputStreamIsReadOnly:1; + bool m_bInCheckIn:1; OUString m_aName; OUString m_aLogicName; @@ -313,6 +314,9 @@ public: SfxMedium_Impl( SfxMedium* pAntiImplP ); ~SfxMedium_Impl(); + + OUString getFilterMimeType() + { return m_pFilter == 0 ? OUString() : m_pFilter->GetMimeType(); } }; //------------------------------------------------------------------ @@ -336,6 +340,7 @@ SfxMedium_Impl::SfxMedium_Impl( SfxMedium* pAntiImplP ) : m_bTriedStorage(false), m_bRemote(false), m_bInputStreamIsReadOnly(false), + m_bInCheckIn(false), m_pSet(NULL), m_pURLObj(NULL), m_pFilter(NULL), @@ -632,7 +637,20 @@ SvStream* SfxMedium::GetOutStream() if ( pImp->pTempFile ) { - pImp->m_pOutStream = new SvFileStream( pImp->m_aName, STREAM_STD_READWRITE ); + // try to re-use XOutStream from xStream if that exists; + // opening new SvFileStream in this situation may fail on + // Windows with ERROR_SHARING_VIOLATION + if (pImp->xStream.is()) + { + assert(pImp->xStream->getOutputStream().is()); // need that... + pImp->m_pOutStream = utl::UcbStreamHelper::CreateStream( + pImp->xStream, false); + } + else + { + pImp->m_pOutStream = new SvFileStream( + pImp->m_aName, STREAM_STD_READWRITE); + } CloseStorage(); } } @@ -1924,23 +1942,31 @@ void SfxMedium::Transfer_Impl() ::ucbhelper::Content aSourceContent; ::ucbhelper::Content aTransferContent; - // Get the parent URL from the XChild if possible: why would the URL necessarily have - // a hierarchical path? It's not the case for CMIS. ::ucbhelper::Content aDestContent; ::ucbhelper::Content::create( aDestURL, xComEnv, comphelper::getProcessComponentContext(), aDestContent ); - Reference< ::com::sun::star::container::XChild> xChild( aDestContent.get(), uno::UNO_QUERY ); - rtl::OUString sParentUrl; - if ( xChild.is( ) ) + if ( !IsInCheckIn( ) ) { - Reference< ::com::sun::star::ucb::XContent > xParent( xChild->getParent( ), uno::UNO_QUERY ); - if ( xParent.is( ) ) + // Get the parent URL from the XChild if possible: why would the URL necessarily have + // a hierarchical path? It's not always the case for CMIS. + Reference< ::com::sun::star::container::XChild> xChild( aDestContent.get(), uno::UNO_QUERY ); + rtl::OUString sParentUrl; + if ( xChild.is( ) ) { - sParentUrl = xParent->getIdentifier( )->getContentIdentifier(); + Reference< ::com::sun::star::ucb::XContent > xParent( xChild->getParent( ), uno::UNO_QUERY ); + if ( xParent.is( ) ) + { + sParentUrl = xParent->getIdentifier( )->getContentIdentifier(); + } } - } - if ( !sParentUrl.isEmpty() ) - aDest = INetURLObject( sParentUrl ); + if ( !sParentUrl.isEmpty() ) + aDest = INetURLObject( sParentUrl ); + } + else + { + // For checkin, we need the object URL, not the parent folder + aDest = INetURLObject( aDestURL ); + } // LongName wasn't defined anywhere, only used here... get the Title instead // as it's less probably empty @@ -1996,8 +2022,25 @@ void SfxMedium::Transfer_Impl() try { - if (!aTransferContent.transferContent( aSourceContent, ::ucbhelper::InsertOperation_COPY, aFileName, nNameClash )) + rtl::OUString aMimeType = pImp->getFilterMimeType(); + ::ucbhelper::InsertOperation eOperation = ::ucbhelper::InsertOperation_COPY; + bool bMajor = false; + rtl::OUString sComment; + if ( IsInCheckIn( ) ) + { + eOperation = ::ucbhelper::InsertOperation_CHECKIN; + SFX_ITEMSET_ARG( GetItemSet(), pMajor, SfxBoolItem, SID_DOCINFO_MAJOR, false ); + bMajor = pMajor && pMajor->GetValue( ); + SFX_ITEMSET_ARG( GetItemSet(), pComments, SfxStringItem, SID_DOCINFO_COMMENTS, false ); + if ( pComments ) + sComment = pComments->GetValue( ); + } + rtl::OUString sResultURL; + if (!aTransferContent.transferContent( aSourceContent, eOperation, + aFileName, nNameClash, aMimeType, bMajor, sComment, &sResultURL )) pImp->m_eError = ERRCODE_IO_GENERAL; + else if ( !sResultURL.isEmpty( ) ) // Likely to happen only for checkin + SwitchDocumentToFile( sResultURL ); } catch ( const ::com::sun::star::ucb::CommandAbortedException& ) { @@ -2060,10 +2103,12 @@ void SfxMedium::DoInternalBackup_Impl( const ::ucbhelper::Content& aOriginalCont { try { + rtl::OUString sMimeType = pImp->getFilterMimeType(); if( aBackupCont.transferContent( aOriginalContent, ::ucbhelper::InsertOperation_COPY, aBackupName, - NameClash::OVERWRITE ) ) + NameClash::OVERWRITE, + sMimeType ) ) { pImp->m_aBackupURL = aBackObj.GetMainURL( INetURLObject::NO_DECODE ); pImp->m_bRemoveBackup = true; @@ -2146,10 +2191,12 @@ void SfxMedium::DoBackup_Impl() try { // do the transfer ( copy source file to backup dir ) + rtl::OUString sMimeType = pImp->getFilterMimeType(); bSuccess = aContent.transferContent( aSourceContent, ::ucbhelper::InsertOperation_COPY, aFileName, - NameClash::OVERWRITE ); + NameClash::OVERWRITE, + sMimeType ); if( bSuccess ) { pImp->m_aBackupURL = aDest.GetMainURL( INetURLObject::NO_DECODE ); @@ -3276,7 +3323,8 @@ void SfxMedium::CreateTempFile( sal_Bool bReplace ) if ( !aFileName.isEmpty() && aTmpURLObj.removeSegment() ) { ::ucbhelper::Content aTargetContent( aTmpURLObj.GetMainURL( INetURLObject::NO_DECODE ), xComEnv, comphelper::getProcessComponentContext() ); - if ( aTargetContent.transferContent( pImp->aContent, ::ucbhelper::InsertOperation_COPY, aFileName, NameClash::OVERWRITE ) ) + rtl::OUString sMimeType = pImp->getFilterMimeType(); + if ( aTargetContent.transferContent( pImp->aContent, ::ucbhelper::InsertOperation_COPY, aFileName, NameClash::OVERWRITE, sMimeType ) ) { SetWritableForUserOnly( aTmpURL ); bTransferSuccess = true; @@ -3688,4 +3736,14 @@ sal_Bool SfxMedium::SwitchDocumentToFile( const rtl::OUString& aURL ) return bResult; } +void SfxMedium::SetInCheckIn( bool bInCheckIn ) +{ + pImp->m_bInCheckIn = bInCheckIn; +} + +bool SfxMedium::IsInCheckIn( ) +{ + return pImp->m_bInCheckIn; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index e1f1986ea930..92b91947e841 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -39,6 +39,7 @@ #include <com/sun/star/beans/XPropertyContainer.hpp> #include <com/sun/star/beans/StringPair.hpp> #include <com/sun/star/util/XMacroExpander.hpp> +#include <com/sun/star/configuration/theDefaultProvider.hpp> #include <com/sun/star/container/XContainerQuery.hpp> #include <com/sun/star/document/XTypeDetection.hpp> #include <com/sun/star/document/XStandaloneDocumentInfo.hpp> @@ -1406,7 +1407,7 @@ sal_Bool SfxDocTplService_Impl::WriteUINamesForTemplateDir_Impl( const ::rtl::OU if ( !xOutStream.is() ) throw uno::RuntimeException(); - DocTemplLocaleHelper::WriteGroupLocalizationSequence( xOutStream, aUINames, mxFactory ); + DocTemplLocaleHelper::WriteGroupLocalizationSequence( xOutStream, aUINames, comphelper::getComponentContext(mxFactory)); try { // the SAX writer might close the stream xOutStream->closeOutput(); @@ -1418,7 +1419,8 @@ sal_Bool SfxDocTplService_Impl::WriteUINamesForTemplateDir_Impl( const ::rtl::OU aTargetContent.transferContent( aSourceContent, InsertOperation_COPY, ::rtl::OUString( "groupuinames.xml" ), - ucb::NameClash::OVERWRITE ); + ucb::NameClash::OVERWRITE, + ::rtl::OUString( "text/xml" ) ); bResult = sal_True; } catch ( uno::Exception& ) @@ -1837,10 +1839,8 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName, // get the actual filter name ::rtl::OUString aFilterName; - uno::Reference< lang::XMultiServiceFactory > xConfigProvider( - xFactory->createInstance( - ::rtl::OUString("com.sun.star.configuration.ConfigurationProvider") ), - uno::UNO_QUERY_THROW ); + uno::Reference< lang::XMultiServiceFactory > xConfigProvider = + configuration::theDefaultProvider::get( comphelper::getComponentContext(xFactory) ); uno::Sequence< uno::Any > aArgs( 1 ); beans::PropertyValue aPathProp; @@ -2062,7 +2062,8 @@ sal_Bool SfxDocTplService_Impl::addTemplate( const OUString& rGroupName, if( ! aTargetGroup.transferContent( aSourceContent, InsertOperation_COPY, aNewTemplateTargetName, - NameClash::OVERWRITE ) ) + NameClash::OVERWRITE, + aType ) ) return sal_False; // allow to edit the added template diff --git a/sfx2/source/doc/doctemplateslocal.cxx b/sfx2/source/doc/doctemplateslocal.cxx index 82452dc14a39..5f8f174384fc 100644 --- a/sfx2/source/doc/doctemplateslocal.cxx +++ b/sfx2/source/doc/doctemplateslocal.cxx @@ -22,6 +22,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/io/XActiveDataSource.hpp> #include <com/sun/star/xml/sax/Parser.hpp> +#include <com/sun/star/xml/sax/Writer.hpp> #include <com/sun/star/xml/sax/XDocumentHandler.hpp> #include <com/sun/star/lang/IllegalArgumentException.hpp> @@ -40,19 +41,16 @@ uno::Sequence< beans::StringPair > DocTemplLocaleHelper::ReadGroupLocalizationSe } // ----------------------------------- -void SAL_CALL DocTemplLocaleHelper::WriteGroupLocalizationSequence( const uno::Reference< io::XOutputStream >& xOutStream, const uno::Sequence< beans::StringPair >& aSequence, const uno::Reference< lang::XMultiServiceFactory > xFactory ) +void SAL_CALL DocTemplLocaleHelper::WriteGroupLocalizationSequence( const uno::Reference< io::XOutputStream >& xOutStream, const uno::Sequence< beans::StringPair >& aSequence, const uno::Reference< uno::XComponentContext > xContext ) throw( uno::Exception ) { if ( !xOutStream.is() ) throw uno::RuntimeException(); - uno::Reference< io::XActiveDataSource > xWriterSource( - xFactory->createInstance( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.Writer" ) ) ), - uno::UNO_QUERY_THROW ); - uno::Reference< xml::sax::XDocumentHandler > xWriterHandler( xWriterSource, uno::UNO_QUERY_THROW ); + uno::Reference< xml::sax::XWriter > xWriterHandler( + xml::sax::Writer::create(xContext) ); - xWriterSource->setOutputStream( xOutStream ); + xWriterHandler->setOutputStream( xOutStream ); ::rtl::OUString aGroupListElement( RTL_CONSTASCII_USTRINGPARAM( "groupuinames:template-group-list" ) ); ::rtl::OUString aGroupElement( RTL_CONSTASCII_USTRINGPARAM( "groupuinames:template-group" ) ); diff --git a/sfx2/source/doc/doctemplateslocal.hxx b/sfx2/source/doc/doctemplateslocal.hxx index ba0f58af2b86..b6f7fc286b0a 100644 --- a/sfx2/source/doc/doctemplateslocal.hxx +++ b/sfx2/source/doc/doctemplateslocal.hxx @@ -60,7 +60,7 @@ public: void SAL_CALL WriteGroupLocalizationSequence( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& xOutStream, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair >& aSequence, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory ) + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext ) throw( ::com::sun::star::uno::Exception ); // XDocumentHandler diff --git a/sfx2/source/doc/docvor.cxx b/sfx2/source/doc/docvor.cxx index e976a393316b..59995db6e8d2 100644 --- a/sfx2/source/doc/docvor.cxx +++ b/sfx2/source/doc/docvor.cxx @@ -115,7 +115,7 @@ friend class SfxOrganizeListBox_Impl; // save pointer for asynchronous D&D SvTreeListBox* pSourceView; - SvLBoxEntry* pTargetEntry; + SvTreeListEntry* pTargetEntry; SfxOrganizeListBox_Impl* pFinishedBox; sal_Int8 nDropAction; bool bExecDropFinished; @@ -164,7 +164,7 @@ friend class SfxOrganizeListBox_Impl; DECL_LINK(ExportHdl, void *); DECL_LINK(AddFilesHdl, void *); - sal_Bool DontDelete_Impl( SvLBoxEntry* pEntry ); + sal_Bool DontDelete_Impl( SvTreeListEntry* pEntry ); public: SfxOrganizeDlg_Impl( SfxTemplateOrganizeDlg* pParent, SfxDocumentTemplates* pTempl ); @@ -391,7 +391,7 @@ class Path { ImpPath_Impl *pData; public: - Path(SvTreeListBox *pBox, SvLBoxEntry *pEntry); + Path(SvTreeListBox *pBox, SvTreeListEntry *pEntry); Path(const Path &rPath): pData(rPath.pData) { @@ -422,13 +422,13 @@ public: //------------------------------------------------------------------------- -Path::Path(SvTreeListBox *pBox, SvLBoxEntry *pEntry) : +Path::Path(SvTreeListBox *pBox, SvTreeListEntry *pEntry) : pData(new ImpPath_Impl) { DBG_ASSERT(pEntry != 0, "EntryPtr ist NULL"); if(!pEntry) return; - SvLBoxEntry *pParent = pBox->GetParent(pEntry); + SvTreeListEntry *pParent = pBox->GetParent(pEntry); do { pData->aUS.insert(pData->aUS.begin(), (sal_uInt16)pBox->GetModel()->GetRelPos(pEntry)); @@ -441,8 +441,8 @@ Path::Path(SvTreeListBox *pBox, SvLBoxEntry *pEntry) : //------------------------------------------------------------------------- -SvLBoxEntry *GetIndices_Impl(SvTreeListBox *pBox, - SvLBoxEntry *pEntry, +SvTreeListEntry *GetIndices_Impl(SvTreeListBox *pBox, + SvTreeListEntry *pEntry, sal_uInt16 &rRegion, sal_uInt16 &rOffset) /* [Description] @@ -452,7 +452,7 @@ SvLBoxEntry *GetIndices_Impl(SvTreeListBox *pBox, [Parameter] SvTreeListBox *pBox Listbox where the event occurred - SvLBoxEntry *pEntry Entry whose position is to be determined + SvTreeListEntry *pEntry Entry whose position is to be determined sal_uInt16 &rRegion the region within the region of the document template (Out-Parameter) sal_uInt16 &rOffset the position within the region of the @@ -477,7 +477,7 @@ SvLBoxEntry *GetIndices_Impl(SvTreeListBox *pBox, rOffset = USHRT_MAX; return pEntry; } - SvLBoxEntry *pParent = pBox->GetParent(pEntry); + SvTreeListEntry *pParent = pBox->GetParent(pEntry); rRegion = (sal_uInt16)pBox->GetModel()->GetRelPos(pParent); rOffset = (sal_uInt16)pBox->GetModel()->GetRelPos(pEntry); return pEntry; @@ -485,7 +485,7 @@ SvLBoxEntry *GetIndices_Impl(SvTreeListBox *pBox, //------------------------------------------------------------------------- -sal_Bool SfxOrganizeListBox_Impl::Select( SvLBoxEntry* pEntry, sal_Bool bSelect ) +sal_Bool SfxOrganizeListBox_Impl::Select( SvTreeListEntry* pEntry, sal_Bool bSelect ) { if(!bSelect) return SvTreeListBox::Select(pEntry,bSelect); @@ -505,9 +505,9 @@ sal_Bool SfxOrganizeListBox_Impl::Select( SvLBoxEntry* pEntry, sal_Bool bSelect //------------------------------------------------------------------------- sal_Bool SfxOrganizeListBox_Impl::MoveOrCopyTemplates(SvTreeListBox *pSourceBox, - SvLBoxEntry *pSource, - SvLBoxEntry* pTarget, - SvLBoxEntry *&pNewParent, + SvTreeListEntry *pSource, + SvTreeListEntry* pTarget, + SvTreeListEntry *&pNewParent, sal_uIntPtr &rIdx, sal_Bool bCopy) /* [Description] @@ -517,9 +517,9 @@ sal_Bool SfxOrganizeListBox_Impl::MoveOrCopyTemplates(SvTreeListBox *pSourceBox, [Parameter] SvTreeListBox *pSourceBox Source Listbox, at which the event occurred - SvLBoxEntry* pTarget Target entry, to where it will be moved - SvLBoxEntry *pSource Source entry, to be copied / moved - SvLBoxEntry *&pNewParent the parent of the target position generated + SvTreeListEntry* pTarget Target entry, to where it will be moved + SvTreeListEntry *pSource Source entry, to be copied / moved + SvTreeListEntry *&pNewParent the parent of the target position generated at entry (out parameter) sal_uIntPtr &rIdx Index of the target entry sal_Bool bCopy Flag for Copy / Move @@ -530,18 +530,18 @@ sal_Bool SfxOrganizeListBox_Impl::MoveOrCopyTemplates(SvTreeListBox *pSourceBox, [Cross-references] <SfxOrganizeListBox_Impl::MoveOrCopyContents(SvTreeListBox *pSourceBox, - SvLBoxEntry *pSource, - SvLBoxEntry* pTarget, - SvLBoxEntry *&pNewParent, + SvTreeListEntry *pSource, + SvTreeListEntry* pTarget, + SvTreeListEntry *&pNewParent, sal_uIntPtr &rIdx, sal_Bool bCopy)> - <sal_Bool SfxOrganizeListBox_Impl::NotifyMoving(SvLBoxEntry *pTarget, - SvLBoxEntry* pSource, - SvLBoxEntry *&pNewParent, + <sal_Bool SfxOrganizeListBox_Impl::NotifyMoving(SvTreeListEntry *pTarget, + SvTreeListEntry* pSource, + SvTreeListEntry *&pNewParent, sal_uIntPtr &rIdx)> - <sal_Bool SfxOrganizeListBox_Impl::NotifyCopying(SvLBoxEntry *pTarget, - SvLBoxEntry* pSource, - SvLBoxEntry *&pNewParent, + <sal_Bool SfxOrganizeListBox_Impl::NotifyCopying(SvTreeListEntry *pTarget, + SvTreeListEntry* pSource, + SvTreeListEntry *&pNewParent, sal_uIntPtr &rIdx)> */ @@ -596,9 +596,9 @@ sal_Bool SfxOrganizeListBox_Impl::MoveOrCopyTemplates(SvTreeListBox *pSourceBox, //------------------------------------------------------------------------- sal_Bool SfxOrganizeListBox_Impl::MoveOrCopyContents(SvTreeListBox *pSourceBox, - SvLBoxEntry *pSource, - SvLBoxEntry* pTarget, - SvLBoxEntry *&pNewParent, + SvTreeListEntry *pSource, + SvTreeListEntry* pTarget, + SvTreeListEntry *&pNewParent, sal_uIntPtr &rIdx, sal_Bool bCopy) /* [Description] @@ -608,9 +608,9 @@ sal_Bool SfxOrganizeListBox_Impl::MoveOrCopyContents(SvTreeListBox *pSourceBox, [Parameter] SvTreeListBox *pSourceBox Source Listbox, at which the event occurred - SvLBoxEntry* pTarget Target entry, to where it will be moved - SvLBoxEntry *pSource Source entry, to be copied / moved - SvLBoxEntry *&pNewParent the parent of the target position generated + SvTreeListEntry* pTarget Target entry, to where it will be moved + SvTreeListEntry *pSource Source entry, to be copied / moved + SvTreeListEntry *&pNewParent the parent of the target position generated at entry (out parameter) sal_uIntPtr &rIdx Index of the target entry sal_Bool bCopy Flag for Copy / Move @@ -621,18 +621,18 @@ sal_Bool SfxOrganizeListBox_Impl::MoveOrCopyContents(SvTreeListBox *pSourceBox, [Cross-references] <SfxOrganizeListBox_Impl::MoveOrCopyTemplates(SvTreeListBox *pSourceBox, - SvLBoxEntry *pSource, - SvLBoxEntry* pTarget, - SvLBoxEntry *&pNewParent, + SvTreeListEntry *pSource, + SvTreeListEntry* pTarget, + SvTreeListEntry *&pNewParent, sal_uIntPtr &rIdx, sal_Bool bCopy)> - <sal_Bool SfxOrganizeListBox_Impl::NotifyMoving(SvLBoxEntry *pTarget, - SvLBoxEntry* pSource, - SvLBoxEntry *&pNewParent, + <sal_Bool SfxOrganizeListBox_Impl::NotifyMoving(SvTreeListEntry *pTarget, + SvTreeListEntry* pSource, + SvTreeListEntry *&pNewParent, sal_uIntPtr &rIdx)> - <sal_Bool SfxOrganizeListBox_Impl::NotifyCopying(SvLBoxEntry *pTarget, - SvLBoxEntry* pSource, - SvLBoxEntry *&pNewParent, + <sal_Bool SfxOrganizeListBox_Impl::NotifyCopying(SvTreeListEntry *pTarget, + SvTreeListEntry* pSource, + SvTreeListEntry *&pNewParent, sal_uIntPtr &rIdx)> */ @@ -679,7 +679,7 @@ sal_Bool SfxOrganizeListBox_Impl::MoveOrCopyContents(SvTreeListBox *pSourceBox, // Delete duplicate entries if(bOk) { - SvLBoxEntry *pParentIter = pTarget; + SvTreeListEntry *pParentIter = pTarget; // Up to the document level as // the general reference point while(GetModel()->GetDepth(pParentIter) != nTLevel) @@ -687,7 +687,7 @@ sal_Bool SfxOrganizeListBox_Impl::MoveOrCopyContents(SvTreeListBox *pSourceBox, if(pParentIter->HasChildrenOnDemand() && !GetModel()->HasChildren(pParentIter)) RequestingChildren(pParentIter); - SvLBoxEntry *pChildIter = 0; + SvTreeListEntry *pChildIter = 0; sal_uInt16 i = 0; while(i < 2 && p[i+1] != INDEX_IGNORE) @@ -746,9 +746,9 @@ sal_Bool SfxOrganizeListBox_Impl::MoveOrCopyContents(SvTreeListBox *pSourceBox, //------------------------------------------------------------------------- -sal_Bool SfxOrganizeListBox_Impl::NotifyMoving(SvLBoxEntry *pTarget, - SvLBoxEntry* pSource, - SvLBoxEntry *&pNewParent, +sal_Bool SfxOrganizeListBox_Impl::NotifyMoving(SvTreeListEntry *pTarget, + SvTreeListEntry* pSource, + SvTreeListEntry *&pNewParent, sal_uIntPtr &rIdx) /* [Description] @@ -758,9 +758,9 @@ sal_Bool SfxOrganizeListBox_Impl::NotifyMoving(SvLBoxEntry *pTarget, [Parameter] - SvLBoxEntry* pTarget Target entry, to where it will be moved - SvLBoxEntry *pSource Source entry, to be moved - SvLBoxEntry *&pNewParent the parent of the target position generated + SvTreeListEntry* pTarget Target entry, to where it will be moved + SvTreeListEntry *pSource Source entry, to be moved + SvTreeListEntry *&pNewParent the parent of the target position generated at entry (out parameter) sal_uIntPtr &rIdx Index of the target entry @@ -770,20 +770,20 @@ sal_Bool SfxOrganizeListBox_Impl::NotifyMoving(SvLBoxEntry *pTarget, [Cross-references] <SfxOrganizeListBox_Impl::MoveOrCopyTemplates(SvTreeListBox *pSourceBox, - SvLBoxEntry *pSource, - SvLBoxEntry* pTarget, - SvLBoxEntry *&pNewParent, + SvTreeListEntry *pSource, + SvTreeListEntry* pTarget, + SvTreeListEntry *&pNewParent, sal_uIntPtr &rIdx, sal_Bool bCopy)> <SfxOrganizeListBox_Impl::MoveOrCopyContents(SvTreeListBox *pSourceBox, - SvLBoxEntry *pSource, - SvLBoxEntry* pTarget, - SvLBoxEntry *&pNewParent, + SvTreeListEntry *pSource, + SvTreeListEntry* pTarget, + SvTreeListEntry *&pNewParent, sal_uIntPtr &rIdx, sal_Bool bCopy)> - <sal_Bool SfxOrganizeListBox_Impl::NotifyCopying(SvLBoxEntry *pTarget, - SvLBoxEntry* pSource, - SvLBoxEntry *&pNewParent, + <sal_Bool SfxOrganizeListBox_Impl::NotifyCopying(SvTreeListEntry *pTarget, + SvTreeListEntry* pSource, + SvTreeListEntry *&pNewParent, sal_uIntPtr &rIdx)> */ @@ -807,9 +807,9 @@ sal_Bool SfxOrganizeListBox_Impl::NotifyMoving(SvLBoxEntry *pTarget, //------------------------------------------------------------------------- -sal_Bool SfxOrganizeListBox_Impl::NotifyCopying(SvLBoxEntry *pTarget, - SvLBoxEntry* pSource, - SvLBoxEntry *&pNewParent, +sal_Bool SfxOrganizeListBox_Impl::NotifyCopying(SvTreeListEntry *pTarget, + SvTreeListEntry* pSource, + SvTreeListEntry *&pNewParent, sal_uIntPtr &rIdx) /* [Description] @@ -818,9 +818,9 @@ sal_Bool SfxOrganizeListBox_Impl::NotifyCopying(SvLBoxEntry *pTarget, [Parameter] - SvLBoxEntry* pTarget Target entry, to where it will be copied - SvLBoxEntry *pSource Source entry, to be copied - SvLBoxEntry *&pNewParent the parent of the target position generated + SvTreeListEntry* pTarget Target entry, to where it will be copied + SvTreeListEntry *pSource Source entry, to be copied + SvTreeListEntry *&pNewParent the parent of the target position generated at entry (out parameter) sal_uIntPtr &rIdx Index of the target entry @@ -829,20 +829,20 @@ sal_Bool SfxOrganizeListBox_Impl::NotifyCopying(SvLBoxEntry *pTarget, [Cross-references] <SfxOrganizeListBox_Impl::MoveOrCopyTemplates(SvTreeListBox *pSourceBox, - SvLBoxEntry *pSource, - SvLBoxEntry* pTarget, - SvLBoxEntry *&pNewParent, + SvTreeListEntry *pSource, + SvTreeListEntry* pTarget, + SvTreeListEntry *&pNewParent, sal_uIntPtr &rIdx, sal_Bool bCopy)> <SfxOrganizeListBox_Impl::MoveOrCopyContents(SvTreeListBox *pSourceBox, - SvLBoxEntry *pSource, - SvLBoxEntry* pTarget, - SvLBoxEntry *&pNewParent, + SvTreeListEntry *pSource, + SvTreeListEntry* pTarget, + SvTreeListEntry *&pNewParent, sal_uIntPtr &rIdx, sal_Bool bCopy)> - <sal_Bool SfxOrganizeListBox_Impl::NotifyMoving(SvLBoxEntry *pTarget, - SvLBoxEntry* pSource, - SvLBoxEntry *&pNewParent, + <sal_Bool SfxOrganizeListBox_Impl::NotifyMoving(SvTreeListEntry *pTarget, + SvTreeListEntry* pSource, + SvTreeListEntry *&pNewParent, sal_uIntPtr &rIdx)> */ { @@ -864,7 +864,7 @@ sal_Bool SfxOrganizeListBox_Impl::NotifyCopying(SvLBoxEntry *pTarget, //------------------------------------------------------------------------- -sal_Bool SfxOrganizeListBox_Impl::EditingEntry( SvLBoxEntry* pEntry, Selection& ) +sal_Bool SfxOrganizeListBox_Impl::EditingEntry( SvTreeListEntry* pEntry, Selection& ) /* [Description] @@ -872,7 +872,7 @@ sal_Bool SfxOrganizeListBox_Impl::EditingEntry( SvLBoxEntry* pEntry, Selection& (SV-Handler) [Cross-references] - <SfxOrganizeListBox_Impl::EditedEntry(SvLBoxEntry* pEntry, const rtl::OUString& rText)> + <SfxOrganizeListBox_Impl::EditedEntry(SvTreeListEntry* pEntry, const rtl::OUString& rText)> */ { @@ -887,7 +887,7 @@ sal_Bool SfxOrganizeListBox_Impl::EditingEntry( SvLBoxEntry* pEntry, Selection& //------------------------------------------------------------------------- -sal_Bool SfxOrganizeListBox_Impl::EditedEntry(SvLBoxEntry* pEntry, const rtl::OUString& rText) +sal_Bool SfxOrganizeListBox_Impl::EditedEntry(SvTreeListEntry* pEntry, const rtl::OUString& rText) /* [Description] @@ -901,14 +901,14 @@ sal_Bool SfxOrganizeListBox_Impl::EditedEntry(SvLBoxEntry* pEntry, const rtl::OU sal_False: The name should not be changed [Cross-references] - <SfxOrganizeListBox_Impl::EditingEntry(SvLBoxEntry* pEntry, const String& rText)> + <SfxOrganizeListBox_Impl::EditingEntry(SvTreeListEntry* pEntry, const String& rText)> */ { DBG_ASSERT(pEntry, "No Entry selected"); delete pDlg->pSuspend; pDlg->pSuspend = NULL; - SvLBoxEntry* pParent = GetParent(pEntry); + SvTreeListEntry* pParent = GetParent(pEntry); if( rText.isEmpty() ) { ErrorBox aBox( this, SfxResId( MSG_ERROR_EMPTY_NAME ) ); @@ -944,7 +944,7 @@ sal_Bool SfxOrganizeListBox_Impl::EditedEntry(SvLBoxEntry* pEntry, const rtl::OU //------------------------------------------------------------------------- -DragDropMode SfxOrganizeListBox_Impl::NotifyStartDrag( TransferDataContainer&, SvLBoxEntry* pEntry ) +DragDropMode SfxOrganizeListBox_Impl::NotifyStartDrag( TransferDataContainer&, SvTreeListEntry* pEntry ) { sal_uInt16 nSourceLevel = GetModel()->GetDepth( pEntry ); if ( VIEW_FILES == GetViewType() ) @@ -959,12 +959,12 @@ DragDropMode SfxOrganizeListBox_Impl::NotifyStartDrag( TransferDataContainer&, S //------------------------------------------------------------------------- -sal_Bool SfxOrganizeListBox_Impl::NotifyAcceptDrop( SvLBoxEntry* pEntry ) +sal_Bool SfxOrganizeListBox_Impl::NotifyAcceptDrop( SvTreeListEntry* pEntry ) { if(!pEntry) return sal_False; SvTreeListBox *pSource = GetSourceView(); - SvLBoxEntry *pSourceEntry = pSource->FirstSelected(); + SvTreeListEntry *pSourceEntry = pSource->FirstSelected(); if(pEntry == pSourceEntry) return sal_False; sal_uInt16 nSourceLevel = pSource->GetModel()->GetDepth(pSourceEntry); @@ -1110,7 +1110,7 @@ SfxObjectShellRef SfxOrganizeListBox_Impl::GetObjectShell(const Path &rPath) //------------------------------------------------------------------------- -void SfxOrganizeListBox_Impl::RequestingChildren( SvLBoxEntry* pEntry ) +void SfxOrganizeListBox_Impl::RequestingChildren( SvTreeListEntry* pEntry ) /* [Description] @@ -1119,7 +1119,7 @@ void SfxOrganizeListBox_Impl::RequestingChildren( SvLBoxEntry* pEntry ) [Parameter] - SvLBoxEntry* pEntry the entry whose children is requested + SvTreeListEntry* pEntry the entry whose children is requested */ { @@ -1167,7 +1167,7 @@ void SfxOrganizeListBox_Impl::RequestingChildren( SvLBoxEntry* pEntry ) Image aClosedImage( aClosedBmp, aMaskColor ); Image aOpenedImage( aOpenedBmp, aMaskColor ); - SvLBoxEntry *pNew = SvTreeListBox::InsertEntry( + SvTreeListEntry *pNew = SvTreeListBox::InsertEntry( aText, aOpenedImage, aClosedImage, pEntry, bCanHaveChildren); pNew->SetUserData(bDeletable ? &bDeletable : 0); @@ -1191,7 +1191,7 @@ long SfxOrganizeListBox_Impl::ExpandingHdl() { if ( !(nImpFlags & SVLBOX_IS_EXPANDING) ) { - SvLBoxEntry* pEntry = GetHdlEntry(); + SvTreeListEntry* pEntry = GetHdlEntry(); const sal_uInt16 nLevel = GetModel()->GetDepth(pEntry); if((eViewType == VIEW_FILES && nLevel == 0) || (eViewType == VIEW_TEMPLATES && nLevel == 1)) @@ -1203,7 +1203,7 @@ long SfxOrganizeListBox_Impl::ExpandingHdl() else pMgr->DeleteObjectShell(aPath[0], aPath[1]); // Delete all SubEntries - SvLBoxEntry *pToDel = SvTreeListBox::GetEntry(pEntry, 0); + SvTreeListEntry *pToDel = SvTreeListBox::GetEntry(pEntry, 0); while(pToDel) { GetModel()->Remove(pToDel); @@ -1217,7 +1217,7 @@ long SfxOrganizeListBox_Impl::ExpandingHdl() //------------------------------------------------------------------------- sal_Bool SfxOrganizeListBox_Impl::IsUniqName_Impl(const String &rText, - SvLBoxEntry* pParent, SvLBoxEntry *pEntry) const + SvTreeListEntry* pParent, SvTreeListEntry *pEntry) const /* [Description] @@ -1226,7 +1226,7 @@ sal_Bool SfxOrganizeListBox_Impl::IsUniqName_Impl(const String &rText, [Parameter] const String & Name of the search entry - SvLBoxEntry* pSibling Siblings (referred to the level) + SvTreeListEntry* pSibling Siblings (referred to the level) [Return value] @@ -1234,7 +1234,7 @@ sal_Bool SfxOrganizeListBox_Impl::IsUniqName_Impl(const String &rText, */ { - SvLBoxEntry* pChild = FirstChild(pParent); + SvTreeListEntry* pChild = FirstChild(pParent); while(pChild) { const String aEntryText(GetEntryText(pChild)); if(COMPARE_EQUAL == aEntryText.CompareIgnoreCaseToAscii(rText)&&(!pEntry || pEntry!=pChild)) @@ -1246,9 +1246,9 @@ sal_Bool SfxOrganizeListBox_Impl::IsUniqName_Impl(const String &rText, //------------------------------------------------------------------------- -sal_uInt16 SfxOrganizeListBox_Impl::GetLevelCount_Impl(SvLBoxEntry* pParent) const +sal_uInt16 SfxOrganizeListBox_Impl::GetLevelCount_Impl(SvTreeListEntry* pParent) const { - SvLBoxEntry* pChild = FirstChild(pParent); + SvTreeListEntry* pChild = FirstChild(pParent); sal_uInt16 nCount = 0; while(pChild) { pChild = NextSibling(pChild); @@ -1259,16 +1259,16 @@ sal_uInt16 SfxOrganizeListBox_Impl::GetLevelCount_Impl(SvLBoxEntry* pParent) con //------------------------------------------------------------------------- -SvLBoxEntry* SfxOrganizeListBox_Impl::InsertEntryByBmpType( +SvTreeListEntry* SfxOrganizeListBox_Impl::InsertEntryByBmpType( const XubString& rText, BMPTYPE eBmpType, - SvLBoxEntry* pParent, + SvTreeListEntry* pParent, sal_Bool bChildrenOnDemand, sal_uIntPtr nPos, void* pUserData ) { - SvLBoxEntry* pEntry = NULL; + SvTreeListEntry* pEntry = NULL; const Image* pExp = NULL; const Image* pCol = NULL; @@ -1651,7 +1651,7 @@ String SfxOrganizeDlg_Impl::GetPath_Impl( sal_Bool bOpen, const String& rFileNam //------------------------------------------------------------------------- -sal_Bool SfxOrganizeDlg_Impl::DontDelete_Impl( SvLBoxEntry* pEntry ) +sal_Bool SfxOrganizeDlg_Impl::DontDelete_Impl( SvTreeListEntry* pEntry ) { sal_uInt16 nDepth = pFocusBox->GetModel()->GetDepth(pEntry); if(SfxOrganizeListBox_Impl::VIEW_FILES == @@ -1675,7 +1675,7 @@ sal_Bool SfxOrganizeDlg_Impl::DontDelete_Impl( SvLBoxEntry* pEntry ) pEntry = pFocusBox->GetParent(pEntry); --nDepth; } - SvLBoxEntry *pTemplateEntry = pEntry; + SvTreeListEntry *pTemplateEntry = pEntry; sal_uInt16 nRegion = 0, nIndex = 0; GetIndices_Impl( pFocusBox, pTemplateEntry, nRegion, nIndex ); @@ -1709,7 +1709,7 @@ sal_Bool SfxOrganizeDlg_Impl::GetServiceName_Impl( String& rName, String& rFileU { sal_Bool bRet = sal_False; const SfxDocumentTemplates* pTemplates = aMgr.GetTemplates(); - SvLBoxEntry* pEntry = pFocusBox ? pFocusBox->FirstSelected() : NULL; + SvTreeListEntry* pEntry = pFocusBox ? pFocusBox->FirstSelected() : NULL; sal_uInt16 nRegion = 0, nIndex = 0; GetIndices_Impl( pFocusBox, pEntry, nRegion, nIndex ); rFileURL = pTemplates->GetPath( nRegion, nIndex ); @@ -1752,7 +1752,7 @@ long SfxOrganizeDlg_Impl::Dispatch_Impl( sal_uInt16 nId, Menu* _pMenu ) { SuspendAccel aTmp(&aEditAcc); - SvLBoxEntry *pEntry = pFocusBox? pFocusBox->FirstSelected(): 0; + SvTreeListEntry *pEntry = pFocusBox? pFocusBox->FirstSelected(): 0; sal_Bool bHandled = sal_True; switch(nId) { @@ -1765,7 +1765,7 @@ long SfxOrganizeDlg_Impl::Dispatch_Impl( sal_uInt16 nId, Menu* _pMenu ) if(0 == pFocusBox->GetModel()->GetDepth(pEntry)) { const rtl::OUString aNoName(SFX2_RESSTR(STR_NONAME)); - SvLBoxEntry* pParent = pFocusBox->GetParent(pEntry); + SvTreeListEntry* pParent = pFocusBox->GetParent(pEntry); rtl::OUString aName(aNoName); sal_Int32 n = 1; while(!pFocusBox->IsUniqName_Impl(aName, pParent)) @@ -1896,7 +1896,7 @@ long SfxOrganizeDlg_Impl::Dispatch_Impl( sal_uInt16 nId, Menu* _pMenu ) const sal_uInt16 nDocLevel = pFocusBox->GetDocLevel(); if ( !pPrt ) pPrt = new Printer; - SvLBoxEntry *pDocEntry = pEntry; + SvTreeListEntry *pDocEntry = pEntry; while ( pFocusBox->GetModel()->GetDepth( pDocEntry ) > nDocLevel ) pDocEntry = pFocusBox->GetParent( pDocEntry ); const String aName(pFocusBox->GetEntryText(pDocEntry)); @@ -1981,7 +1981,7 @@ IMPL_LINK( SfxOrganizeDlg_Impl, AccelSelect_Impl, Accelerator *, pAccel ) */ { - SvLBoxEntry* pEntry = pFocusBox && pFocusBox->GetSelectionCount() ? + SvTreeListEntry* pEntry = pFocusBox && pFocusBox->GetSelectionCount() ? pFocusBox->FirstSelected() : NULL ; return pEntry && ( pAccel->GetCurItemId() == ID_NEW || !DontDelete_Impl( pEntry ) ) ? Dispatch_Impl( pAccel->GetCurItemId(), NULL ) : 0; @@ -2004,7 +2004,7 @@ IMPL_LINK( SfxOrganizeDlg_Impl, MenuActivate_Impl, Menu *, pMenu ) if ( pFocusBox && pFocusBox->IsEditingActive() ) pFocusBox->EndEditing( sal_False ); sal_Bool bEnable = ( pFocusBox && pFocusBox->GetSelectionCount() ); - SvLBoxEntry* pEntry = bEnable ? pFocusBox->FirstSelected() : NULL; + SvTreeListEntry* pEntry = bEnable ? pFocusBox->FirstSelected() : NULL; const sal_uInt16 nDepth = ( bEnable && pFocusBox->GetSelectionCount() ) ? pFocusBox->GetModel()->GetDepth( pEntry ) : 0; const sal_uInt16 nDocLevel = bEnable ? pFocusBox->GetDocLevel() : 0; diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index 3add4b1aacfe..f90432f12006 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -612,7 +612,7 @@ sal_Int8 ModelData_Impl::CheckSaveAcceptable( sal_Int8 nCurStatus ) // check whether save is acceptable by the configuration // it is done only for documents that have persistence already uno::Reference< uno::XInterface > xCommonConfig = ::comphelper::ConfigurationHelper::openConfig( - m_pOwner->GetServiceFactory(), + comphelper::getComponentContext(m_pOwner->GetServiceFactory()), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Common" ) ), ::comphelper::ConfigurationHelper::E_STANDARD ); if ( !xCommonConfig.is() ) diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 70a4f1dd6c48..2412dcc7b744 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -28,11 +28,13 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/container/XNameAccess.hpp> +#include <com/sun/star/document/XCmisDocument.hpp> #include <com/sun/star/document/XExporter.hpp> #include <com/sun/star/task/InteractionHandler.hpp> #include <com/sun/star/task/XStatusIndicator.hpp> #include <com/sun/star/task/XStatusIndicatorFactory.hpp> #include <com/sun/star/frame/DocumentTemplates.hpp> +#include <com/sun/star/frame/XController2.hpp> #include <com/sun/star/frame/XDocumentTemplates.hpp> #include <com/sun/star/frame/XStorable.hpp> #include <comphelper/processfactory.hxx> @@ -46,6 +48,7 @@ #include <vcl/msgbox.hxx> #include <svl/intitem.hxx> #include <svl/eitem.hxx> +#include <svl/visitem.hxx> #include <vcl/wrkwin.hxx> #include <svtools/sfxecode.hxx> #include <svtools/ehdl.hxx> @@ -84,6 +87,7 @@ #include "sfx2/sfxhelp.hxx" #include <sfx2/msgpool.hxx> #include <sfx2/objface.hxx> +#include <sfx2/checkin.hxx> #include "../appl/app.hrc" #include <com/sun/star/document/XDocumentSubStorageSupplier.hpp> @@ -339,6 +343,65 @@ sal_Bool SfxObjectShell::APISaveAs_Impl return bOk; } +void SfxObjectShell::CheckOut( ) +{ + try + { + uno::Reference< document::XCmisDocument > xCmisDoc( GetModel(), uno::UNO_QUERY_THROW ); + xCmisDoc->checkOut( ); + + // Remove the info bar + SfxViewFrame* pViewFrame = GetFrame(); + pViewFrame->RemoveInfoBar( "checkout" ); + } + catch ( const uno::RuntimeException& e ) + { + ErrorBox* pErrorBox = new ErrorBox( &GetFrame()->GetWindow(), WB_OK, e.Message ); + pErrorBox->Execute( ); + delete pErrorBox; + } +} + +void SfxObjectShell::CancelCheckOut( ) +{ + try + { + uno::Reference< document::XCmisDocument > xCmisDoc( GetModel(), uno::UNO_QUERY_THROW ); + xCmisDoc->cancelCheckOut( ); + } + catch ( const uno::RuntimeException& e ) + { + ErrorBox* pErrorBox = new ErrorBox( &GetFrame()->GetWindow(), WB_OK, e.Message ); + pErrorBox->Execute( ); + delete pErrorBox; + } +} + +void SfxObjectShell::CheckIn( ) +{ + try + { + uno::Reference< document::XCmisDocument > xCmisDoc( GetModel(), uno::UNO_QUERY_THROW ); + // Pop up dialog to ask for comment and major + SfxCheckinDialog checkinDlg( &GetFrame( )->GetWindow( ) ); + if ( checkinDlg.Execute( ) == RET_OK ) + { + rtl::OUString sComment = checkinDlg.GetComment( ); + sal_Bool bMajor = checkinDlg.IsMajor( ); + xCmisDoc->checkIn( bMajor, sComment ); + uno::Reference< util::XModifiable > xModifiable( GetModel( ), uno::UNO_QUERY ); + if ( xModifiable.is( ) ) + xModifiable->setModified( sal_False ); + } + } + catch ( const uno::RuntimeException& e ) + { + ErrorBox* pErrorBox = new ErrorBox( &GetFrame()->GetWindow(), WB_OK, e.Message ); + pErrorBox->Execute( ); + delete pErrorBox; + } +} + //-------------------------------------------------------------------- void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) @@ -884,6 +947,25 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) break; } + + case SID_CHECKOUT: + { + CheckOut( ); + break; + } + case SID_CANCELCHECKOUT: + { + if ( QueryBox( NULL, SfxResId( RID_QUERY_CANCELCHECKOUT ) ).Execute( ) == RET_YES ) + { + CancelCheckOut( ); + } + break; + } + case SID_CHECKIN: + { + CheckIn( ); + break; + } } // Prevent entry in the Pick-lists @@ -918,6 +1000,67 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet) break; } + case SID_CHECKOUT: + { + bool bShow = false; + Reference< XCmisDocument > xCmisDoc( GetModel(), uno::UNO_QUERY ); + beans::PropertyValues aCmisProperties = xCmisDoc->getCmisPropertiesValues( ); + + if ( xCmisDoc->isVersionable( ) && aCmisProperties.hasElements( ) ) + { + // Loop over the CMIS Properties to find cmis:isVersionSeriesCheckedOut + bool bFoundCheckedout = false; + sal_Bool bCheckedOut = sal_False; + for ( sal_Int32 i = 0; i < aCmisProperties.getLength() && !bFoundCheckedout; ++i ) + { + if ( aCmisProperties[i].Name == "cmis:isVersionSeriesCheckedOut" ) + { + bFoundCheckedout = true; + aCmisProperties[i].Value >>= bCheckedOut; + } + } + bShow = !bCheckedOut; + } + + if ( !bShow ) + { + rSet.DisableItem( nWhich ); + rSet.Put( SfxVisibilityItem( nWhich, sal_False ) ); + } + } + break; + + case SID_CANCELCHECKOUT: + case SID_CHECKIN: + { + bool bShow = false; + Reference< XCmisDocument > xCmisDoc( GetModel(), uno::UNO_QUERY ); + beans::PropertyValues aCmisProperties = xCmisDoc->getCmisPropertiesValues( ); + + if ( xCmisDoc->isVersionable( ) && aCmisProperties.hasElements( ) ) + { + // Loop over the CMIS Properties to find cmis:isVersionSeriesCheckedOut + bool bFoundCheckedout = false; + sal_Bool bCheckedOut = sal_False; + for ( sal_Int32 i = 0; i < aCmisProperties.getLength() && !bFoundCheckedout; ++i ) + { + if ( aCmisProperties[i].Name == "cmis:isVersionSeriesCheckedOut" ) + { + bFoundCheckedout = true; + aCmisProperties[i].Value >>= bCheckedOut; + } + } + bShow = bCheckedOut; + } + + if ( !bShow ) + { + rSet.DisableItem( nWhich ); + rSet.Put( SfxVisibilityItem( nWhich, sal_False ) ); + } + } + break; + case SID_VERSION: { SfxObjectShell *pDoc = this; diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index b9b5f0480551..9fe53943155e 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -40,6 +40,7 @@ #include <com/sun/star/task/FutureDocumentVersionProductUpdateRequest.hpp> #include <com/sun/star/task/InteractionClassification.hpp> #include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp> #include <com/sun/star/document/MacroExecMode.hpp> #include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp> #include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp> @@ -1373,7 +1374,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl pFilter = rMedium.GetFilter(); - const SfxStringItem *pVersionItem = pSet ? (const SfxStringItem*) + const SfxStringItem *pVersionItem = ( !rMedium.IsInCheckIn( ) && pSet ) ? (const SfxStringItem*) SfxRequest::GetItem( pSet, SID_DOCINFO_COMMENTS, sal_False, TYPE(SfxStringItem) ) : NULL; ::rtl::OUString aTmpVersionURL; @@ -1459,7 +1460,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl } } - if ( bOk && pVersionItem ) + if ( bOk && pVersionItem && !rMedium.IsInCheckIn() ) { // store a version also const SfxStringItem *pAuthorItem = pSet ? (const SfxStringItem*) @@ -1623,7 +1624,12 @@ sal_Bool SfxObjectShell::SaveTo_Impl AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Medium commit." ) ); + rtl::OUString sName( rMedium.GetName( ) ); bOk = rMedium.Commit(); + rtl::OUString sNewName( rMedium.GetName( ) ); + + if ( sName != sNewName ) + GetMedium( )->SwitchDocumentToFile( sNewName ); if ( bOk ) { @@ -2222,6 +2228,15 @@ sal_Bool SfxObjectShell::ImportFrom( SfxMedium& rMedium, bool bInsert ) { SetError( ERRCODE_IO_BROKENPACKAGE, "Badness in the underlying package format." ); } + catch (const lang::WrappedTargetRuntimeException& rWrapped) + { + io::WrongFormatException e; + if (rWrapped.TargetException >>= e) + { + SetError(*new StringErrorInfo(ERRCODE_SFX_FORMAT_ROWCOL, + e.Message, ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ), ""); + } + } catch(...) {} } @@ -2404,10 +2419,23 @@ sal_Bool SfxObjectShell::DoSave_Impl( const SfxItemSet* pArgs ) pSet->ClearItem( SID_VERSION ); pSet->ClearItem( SID_DOC_BASEURL ); + // copy the version comment and major items for the checkin only + if ( pRetrMedium->IsInCheckIn( ) ) + { + const SfxPoolItem* pMajor = pArgs->GetItem( SID_DOCINFO_MAJOR ); + if ( pMajor ) + pSet->Put( *pMajor ); + + const SfxPoolItem* pComments = pArgs->GetItem( SID_DOCINFO_COMMENTS ); + if ( pComments ) + pSet->Put( *pComments ); + } + // create a medium as a copy; this medium is only for writingm, because it // uses the same name as the original one writing is done through a copy, // that will be transferred to the target (of course after calling HandsOff) SfxMedium* pMediumTmp = new SfxMedium( pRetrMedium->GetName(), pRetrMedium->GetOpenMode(), pFilter, pSet ); + pMediumTmp->SetInCheckIn( pRetrMedium->IsInCheckIn( ) ); pMediumTmp->SetLongName( pRetrMedium->GetLongName() ); if ( pMediumTmp->GetErrorCode() != ERRCODE_NONE ) { diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 872bdbca3b59..163929e826d4 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -1621,11 +1621,13 @@ void SAL_CALL SfxBaseModel::storeSelf( const uno::Sequence< beans::PropertyVa m_pData->m_pObjectShell->AddLog( ::rtl::OUString( OSL_LOG_PREFIX "storeSelf" ) ); SfxSaveGuard aSaveGuard(this, m_pData, sal_False); + sal_Bool bCheckIn = sal_False; for ( sal_Int32 nInd = 0; nInd < aSeqArgs.getLength(); nInd++ ) { // check that only acceptable parameters are provided here if ( aSeqArgs[nInd].Name != "VersionComment" && aSeqArgs[nInd].Name != "Author" - && aSeqArgs[nInd].Name != "InteractionHandler" && aSeqArgs[nInd].Name != "StatusIndicator" ) + && aSeqArgs[nInd].Name != "InteractionHandler" && aSeqArgs[nInd].Name != "StatusIndicator" + && aSeqArgs[nInd].Name != "VersionMajor" && aSeqArgs[nInd].Name != "CheckIn" ) { m_pData->m_pObjectShell->AddLog( ::rtl::OUString( OSL_LOG_PREFIX "unexpected parameter for storeSelf, might be no problem if SaveAs is executed." ) ); m_pData->m_pObjectShell->StoreLog(); @@ -1634,10 +1636,34 @@ void SAL_CALL SfxBaseModel::storeSelf( const uno::Sequence< beans::PropertyVa aMessage += aSeqArgs[nInd].Name; throw lang::IllegalArgumentException( aMessage, uno::Reference< uno::XInterface >(), 1 ); } + else if ( aSeqArgs[nInd].Name == "CheckIn" ) + { + aSeqArgs[nInd].Value >>= bCheckIn; + } + } + + // Remove CheckIn property if needed + sal_uInt16 nSlotId = SID_SAVEDOC; + uno::Sequence< beans::PropertyValue > aArgs = aSeqArgs; + if ( bCheckIn ) + { + nSlotId = SID_CHECKIN; + sal_Int32 nLength = aSeqArgs.getLength( ); + aArgs = uno::Sequence< beans::PropertyValue >( nLength - 1 ); + sal_Int32 nNewI = 0; + for ( sal_Int32 i = 0; i < nLength; ++i ) + { + beans::PropertyValue aProp = aSeqArgs[i]; + if ( aProp.Name != "CheckIn" ) + { + aArgs[nNewI] = aProp; + ++nNewI; + } + } } SfxAllItemSet *pParams = new SfxAllItemSet( SFX_APP()->GetPool() ); - TransformParameters( SID_SAVEDOC, aSeqArgs, *pParams ); + TransformParameters( nSlotId, aArgs, *pParams ); SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEDOC, GlobalEventConfig::GetEventName(STR_EVENT_SAVEDOC), m_pData->m_pObjectShell ) ); @@ -1662,7 +1688,12 @@ void SAL_CALL SfxBaseModel::storeSelf( const uno::Sequence< beans::PropertyVa } } else + { + // Tell the SfxMedium if we are in checkin instead of normal save + m_pData->m_pObjectShell->GetMedium( )->SetInCheckIn( nSlotId == SID_CHECKIN ); bRet = m_pData->m_pObjectShell->Save_Impl( pParams ); + m_pData->m_pObjectShell->GetMedium( )->SetInCheckIn( nSlotId != SID_CHECKIN ); + } DELETEZ( pParams ); @@ -1723,6 +1754,8 @@ void SAL_CALL SfxBaseModel::storeAsURL( const ::rtl::OUString& TransformItems( SID_OPENDOC, *m_pData->m_pObjectShell->GetMedium()->GetItemSet(), aSequence ); attachResource( rURL, aSequence ); + loadCmisProperties( ); + #if OSL_DEBUG_LEVEL > 0 SFX_ITEMSET_ARG( m_pData->m_pObjectShell->GetMedium()->GetItemSet(), pPasswdItem, SfxStringItem, SID_PASSWORD, sal_False); OSL_ENSURE( !pPasswdItem, "There should be no Password property in the document MediaDescriptor!" ); @@ -2568,15 +2601,134 @@ void SAL_CALL SfxBaseModel::checkOut( ) throw ( uno::RuntimeException ) // Reload the CMIS properties loadCmisProperties( ); } - catch (const ucb::ContentCreationException &) + catch ( const uno::Exception & e ) { + throw uno::RuntimeException( e.Message, e.Context ); } - catch (const ucb::CommandAbortedException &) + } +} + +void SAL_CALL SfxBaseModel::cancelCheckOut( ) throw ( uno::RuntimeException ) +{ + SfxMedium* pMedium = m_pData->m_pObjectShell->GetMedium(); + if ( pMedium ) + { + try + { + ::ucbhelper::Content aContent( pMedium->GetName(), + uno::Reference<ucb::XCommandEnvironment>(), + comphelper::getProcessComponentContext() ); + + uno::Any aResult = aContent.executeCommand( "cancelCheckout", uno::Any( ) ); + rtl::OUString sURL; + aResult >>= sURL; + + m_pData->m_pObjectShell->GetMedium( )->SwitchDocumentToFile( sURL ); + m_pData->m_xDocumentProperties->setTitle( getTitle( ) ); + uno::Sequence< beans::PropertyValue > aSequence ; + TransformItems( SID_OPENDOC, *pMedium->GetItemSet(), aSequence ); + attachResource( sURL, aSequence ); + + // Reload the CMIS properties + loadCmisProperties( ); + } + catch ( const uno::Exception & e ) + { + throw uno::RuntimeException( e.Message, e.Context ); + } + } +} + +void SAL_CALL SfxBaseModel::checkIn( sal_Bool bIsMajor, const rtl::OUString& rMessage ) throw ( uno::RuntimeException ) +{ + SfxMedium* pMedium = m_pData->m_pObjectShell->GetMedium(); + if ( pMedium ) + { + try + { + uno::Sequence< beans::PropertyValue > aProps( 3 ); + aProps[0].Name = "VersionMajor"; + aProps[0].Value = uno::makeAny( bIsMajor ); + aProps[1].Name = "VersionComment"; + aProps[1].Value = uno::makeAny( rMessage ); + aProps[2].Name = "CheckIn"; + aProps[2].Value = uno::makeAny( sal_True ); + + rtl::OUString sName( pMedium->GetName( ) ); + storeSelf( aProps ); + + // Refresh pMedium as it has probably changed during the storeSelf call + pMedium = m_pData->m_pObjectShell->GetMedium( ); + rtl::OUString sNewName( pMedium->GetName( ) ); + + // URL has changed, update the document + if ( sName != sNewName ) + { + m_pData->m_xDocumentProperties->setTitle( getTitle( ) ); + uno::Sequence< beans::PropertyValue > aSequence ; + TransformItems( SID_OPENDOC, *pMedium->GetItemSet(), aSequence ); + attachResource( sNewName, aSequence ); + + // Reload the CMIS properties + loadCmisProperties( ); + } + } + catch ( const uno::Exception & e ) { + throw uno::RuntimeException( e.Message, e.Context ); } } } +sal_Bool SfxBaseModel::getBoolPropertyValue( const rtl::OUString& rName ) throw ( uno::RuntimeException ) +{ + sal_Bool bValue = sal_False; + if ( m_pData->m_pObjectShell ) + { + SfxMedium* pMedium = m_pData->m_pObjectShell->GetMedium(); + if ( pMedium ) + { + try + { + ::ucbhelper::Content aContent( pMedium->GetName( ), + uno::Reference<ucb::XCommandEnvironment>(), + comphelper::getProcessComponentContext() ); + com::sun::star::uno::Reference < beans::XPropertySetInfo > xProps = aContent.getProperties(); + if ( xProps->hasPropertyByName( rName ) ) + { + aContent.getPropertyValue( rName ) >>= bValue; + } + } + catch ( const uno::Exception & ) + { + // Simply ignore it: it's likely the document isn't versionable in that case + bValue = sal_False; + } + } + } + return bValue; +} + +sal_Bool SAL_CALL SfxBaseModel::isVersionable( ) throw ( uno::RuntimeException ) +{ + return getBoolPropertyValue( "IsVersionable" ); +} + +sal_Bool SAL_CALL SfxBaseModel::canCheckOut( ) throw ( uno::RuntimeException ) +{ + return getBoolPropertyValue( "CanCheckOut" ); +} + +sal_Bool SAL_CALL SfxBaseModel::canCancelCheckOut( ) throw ( uno::RuntimeException ) +{ + return getBoolPropertyValue( "CanCancelCheckOut" ); +} + +sal_Bool SAL_CALL SfxBaseModel::canCheckIn( ) throw ( uno::RuntimeException ) +{ + return getBoolPropertyValue( "CanCheckIn" ); +} + void SfxBaseModel::loadCmisProperties( ) { SfxMedium* pMedium = m_pData->m_pObjectShell->GetMedium(); @@ -3833,12 +3985,13 @@ css::uno::Reference< css::frame::XTitle > SfxBaseModel::impl_getTitleHelper () if ( ! m_pData->m_xTitleHelper.is ()) { - css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory (); + css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory(); + css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); const ::rtl::OUString SERVICENAME_DESKTOP("com.sun.star.frame.Desktop"); css::uno::Reference< css::frame::XUntitledNumbers > xDesktop(xSMGR->createInstance(SERVICENAME_DESKTOP), css::uno::UNO_QUERY_THROW); css::uno::Reference< css::frame::XModel > xThis (static_cast< css::frame::XModel* >(this), css::uno::UNO_QUERY_THROW); - ::framework::TitleHelper* pHelper = new ::framework::TitleHelper(xSMGR); + ::framework::TitleHelper* pHelper = new ::framework::TitleHelper(xContext); m_pData->m_xTitleHelper = css::uno::Reference< css::frame::XTitle >(static_cast< ::cppu::OWeakObject* >(pHelper), css::uno::UNO_QUERY_THROW); pHelper->setOwner (xThis ); pHelper->connectWithUntitledNumbers (xDesktop); diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index ca5e0b31cd69..01a9a8a47508 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -46,7 +46,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp> #include <com/sun/star/ui/dialogs/TemplateDescription.hpp> -#include <com/sun/star/ui/dialogs/XFolderPicker.hpp> +#include <com/sun/star/ui/dialogs/FolderPicker.hpp> #include "doc.hrc" #include "templatedlg.hrc" @@ -62,6 +62,7 @@ using namespace ::com::sun::star::beans; using namespace ::com::sun::star::embed; using namespace ::com::sun::star::frame; using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; using namespace ::com::sun::star::ui::dialogs; static bool lcl_getServiceName (const OUString &rFileURL, OUString &rName ); @@ -838,8 +839,8 @@ void SfxTemplateManagerDlg::OnTemplateImport () void SfxTemplateManagerDlg::OnTemplateExport() { - uno::Reference<XMultiServiceFactory> xFactory(comphelper::getProcessServiceFactory()); - uno::Reference<XFolderPicker> xFolderPicker(xFactory->createInstance(FOLDER_PICKER_SERVICE_NAME),uno::UNO_QUERY); + uno::Reference<XComponentContext> xContext(comphelper::getProcessComponentContext()); + uno::Reference<XFolderPicker2> xFolderPicker = FolderPicker::create(xContext); xFolderPicker->setDisplayDirectory(SvtPathOptions().GetWorkPath()); diff --git a/sfx2/source/inc/eventsupplier.hxx b/sfx2/source/inc/eventsupplier.hxx index a7aefd20753b..737e3724bb99 100644 --- a/sfx2/source/inc/eventsupplier.hxx +++ b/sfx2/source/inc/eventsupplier.hxx @@ -34,10 +34,9 @@ #include <com/sun/star/uno/Type.hxx> #include <sal/types.h> #include <osl/mutex.hxx> -#include <cppuhelper/weak.hxx> #include <cppuhelper/implbase1.hxx> #include <cppuhelper/implbase2.hxx> -#include <cppuhelper/implbase4.hxx> +#include <cppuhelper/implbase3.hxx> #include <comphelper/sequenceashashmap.hxx> #include <comphelper/sequenceasvector.hxx> #include <sfx2/sfxuno.hxx> @@ -142,7 +141,6 @@ class ModelCollectionEnumeration : public ModelCollectionMutexBase // member //------------------------------------------------------------------------- private: - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xSMGR; TModelList m_lModels; TModelList::iterator m_pEnumerationIt; @@ -150,7 +148,7 @@ class ModelCollectionEnumeration : public ModelCollectionMutexBase // native interface //------------------------------------------------------------------------- public: - ModelCollectionEnumeration(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xSMGR); + ModelCollectionEnumeration(); virtual ~ModelCollectionEnumeration(); void setModelList(const TModelList& rList); @@ -172,22 +170,20 @@ class ModelCollectionEnumeration : public ModelCollectionMutexBase //============================================================================= //TODO: remove support of obsolete document::XEventBroadcaster/Listener class SfxGlobalEvents_Impl : public ModelCollectionMutexBase - , public ::cppu::WeakImplHelper4< ::com::sun::star::lang::XServiceInfo + , public ::cppu::WeakImplHelper3< ::com::sun::star::lang::XServiceInfo , ::com::sun::star::frame::XGlobalEventBroadcaster - , ::com::sun::star::document::XEventBroadcaster , ::com::sun::star::document::XEventListener > { - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xSMGR; ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > m_xEvents; - ::com::sun::star::uno::WeakReference< ::com::sun::star::document::XEventListener > m_xJobExecutorListener; + ::com::sun::star::uno::Reference< ::com::sun::star::document::XEventListener > m_xJobExecutorListener; OINTERFACECONTAINERHELPER m_aLegacyListeners; OINTERFACECONTAINERHELPER m_aDocumentListeners; TModelList m_lModels; GlobalEventConfig* pImp; public: - SfxGlobalEvents_Impl(const com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory >& xSMGR); + SfxGlobalEvents_Impl(const com::sun::star::uno::Reference < ::com::sun::star::uno::XComponentContext >& rxContext); virtual ~SfxGlobalEvents_Impl(); SFX_DECL_XSERVICEINFO diff --git a/sfx2/source/menu/thessubmenu.cxx b/sfx2/source/menu/thessubmenu.cxx index 3a94f5e39f8f..f4c5f474efce 100644 --- a/sfx2/source/menu/thessubmenu.cxx +++ b/sfx2/source/menu/thessubmenu.cxx @@ -21,7 +21,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/linguistic2/XThesaurus.hpp> #include <com/sun/star/linguistic2/XMeaning.hpp> -#include <com/sun/star/linguistic2/XLinguServiceManager.hpp> +#include <com/sun/star/linguistic2/LinguServiceManager.hpp> #include <comphelper/processfactory.hxx> #include <svl/stritem.hxx> @@ -64,19 +64,12 @@ void SfxThesSubMenuHelper::GetLocale( } -SfxThesSubMenuHelper::SfxThesSubMenuHelper() +SfxThesSubMenuHelper::SfxThesSubMenuHelper(): + m_xLngMgr( + linguistic2::LinguServiceManager::create( + comphelper::getProcessComponentContext())), + m_xThesarus(m_xLngMgr->getThesaurus()) { - try - { - uno::Reference< lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW ); - m_xLngMgr = uno::Reference< linguistic2::XLinguServiceManager >( xMSF->createInstance( - OUString( "com.sun.star.linguistic2.LinguServiceManager" )), uno::UNO_QUERY_THROW ); - m_xThesarus = m_xLngMgr->getThesaurus(); - } - catch (const uno::Exception &) - { - DBG_ASSERT( 0, "failed to get thesaurus" ); - } } @@ -140,16 +133,12 @@ bool SfxThesSubMenuHelper::GetMeanings( String SfxThesSubMenuHelper::GetThesImplName( const lang::Locale &rLocale ) const { String aRes; - DBG_ASSERT( m_xLngMgr.is(), "LinguServiceManager missing" ); - if (m_xLngMgr.is()) - { - uno::Sequence< OUString > aServiceNames = m_xLngMgr->getConfiguredServices( - OUString("com.sun.star.linguistic2.Thesaurus"), rLocale ); - // there should be at most one thesaurus configured for each language - DBG_ASSERT( aServiceNames.getLength() <= 1, "more than one thesaurus found. Should not be possible" ); - if (aServiceNames.getLength() == 1) - aRes = aServiceNames[0]; - } + uno::Sequence< OUString > aServiceNames = m_xLngMgr->getConfiguredServices( + OUString("com.sun.star.linguistic2.Thesaurus"), rLocale ); + // there should be at most one thesaurus configured for each language + DBG_ASSERT( aServiceNames.getLength() <= 1, "more than one thesaurus found. Should not be possible" ); + if (aServiceNames.getLength() == 1) + aRes = aServiceNames[0]; return aRes; } diff --git a/sfx2/source/menu/thessubmenu.hxx b/sfx2/source/menu/thessubmenu.hxx index a30883e8abc3..56f6639fe299 100644 --- a/sfx2/source/menu/thessubmenu.hxx +++ b/sfx2/source/menu/thessubmenu.hxx @@ -22,7 +22,7 @@ #define _THESSUBMENU_HXX_ #include <com/sun/star/linguistic2/XThesaurus.hpp> -#include <com/sun/star/linguistic2/XLinguServiceManager.hpp> +#include <com/sun/star/linguistic2/XLinguServiceManager2.hpp> #include <vcl/menu.hxx> #include <sfx2/mnuitem.hxx> @@ -31,7 +31,7 @@ namespace css = ::com::sun::star; class SfxThesSubMenuHelper { - css::uno::Reference< css::linguistic2::XLinguServiceManager > m_xLngMgr; + css::uno::Reference< css::linguistic2::XLinguServiceManager2 > m_xLngMgr; css::uno::Reference< css::linguistic2::XThesaurus > m_xThesarus; private: diff --git a/sfx2/source/notify/eventsupplier.cxx b/sfx2/source/notify/eventsupplier.cxx index 2b4508e891fa..21b578b7146a 100644 --- a/sfx2/source/notify/eventsupplier.cxx +++ b/sfx2/source/notify/eventsupplier.cxx @@ -21,6 +21,7 @@ #include <com/sun/star/util/URL.hpp> +#include <com/sun/star/task/JobExecutor.hpp> #include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/util/XURLTransformer.hpp> #include <tools/urlobj.hxx> @@ -496,9 +497,8 @@ void SfxEvents_Impl::NormalizeMacro( const ::comphelper::NamedValueCollection& i } } -ModelCollectionEnumeration::ModelCollectionEnumeration(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR) +ModelCollectionEnumeration::ModelCollectionEnumeration() : ModelCollectionMutexBase( ) - , m_xSMGR (xSMGR ) , m_pEnumerationIt (m_lModels.begin()) { } @@ -545,13 +545,13 @@ css::uno::Any SAL_CALL ModelCollectionEnumeration::nextElement() return css::uno::makeAny(xModel); } -SFX_IMPL_XSERVICEINFO( SfxGlobalEvents_Impl, "com.sun.star.frame.GlobalEventBroadcaster", "com.sun.star.comp.sfx2.GlobalEventBroadcaster" ) +SFX_IMPL_XSERVICEINFO_CTX( SfxGlobalEvents_Impl, "com.sun.star.frame.GlobalEventBroadcaster", "com.sun.star.comp.sfx2.GlobalEventBroadcaster" ) SFX_IMPL_ONEINSTANCEFACTORY( SfxGlobalEvents_Impl ); //----------------------------------------------------------------------------- -SfxGlobalEvents_Impl::SfxGlobalEvents_Impl( const com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory >& xSMGR) +SfxGlobalEvents_Impl::SfxGlobalEvents_Impl( const css::uno::Reference < css::uno::XComponentContext >& rxContext) : ModelCollectionMutexBase( ) - , m_xSMGR (xSMGR ) + , m_xJobExecutorListener( css::task::JobExecutor::create( rxContext ), css::uno::UNO_QUERY_THROW ) , m_aLegacyListeners (m_aLock) , m_aDocumentListeners (m_aLock) , pImp (0 ) @@ -560,9 +560,6 @@ SfxGlobalEvents_Impl::SfxGlobalEvents_Impl( const com::sun::star::uno::Reference SFX_APP(); pImp = new GlobalEventConfig(); m_xEvents = pImp; - m_xJobExecutorListener = css::uno::Reference< css::document::XEventListener >( - xSMGR->createInstance(::rtl::OUString("com.sun.star.task.JobExecutor")), - UNO_QUERY); m_refCount--; } @@ -754,7 +751,7 @@ css::uno::Reference< css::container::XEnumeration > SAL_CALL SfxGlobalEvents_Imp { // SAFE -> ::osl::ResettableMutexGuard aLock(m_aLock); - ModelCollectionEnumeration* pEnum = new ModelCollectionEnumeration(m_xSMGR); + ModelCollectionEnumeration* pEnum = new ModelCollectionEnumeration(); pEnum->setModelList(m_lModels); css::uno::Reference< css::container::XEnumeration > xEnum( static_cast< css::container::XEnumeration* >(pEnum), @@ -787,13 +784,7 @@ void SfxGlobalEvents_Impl::implts_notifyJobExecution(const css::document::EventO { try { - // SAFE -> - ::osl::ResettableMutexGuard aLock(m_aLock); - css::uno::Reference< css::document::XEventListener > xJobExecutor(m_xJobExecutorListener); - aLock.clear(); - // <- SAFE - if (xJobExecutor.is()) - xJobExecutor->notifyEvent(aEvent); + m_xJobExecutorListener->notifyEvent(aEvent); } catch(const css::uno::RuntimeException&) { throw; } diff --git a/sfx2/source/view/orgmgr.cxx b/sfx2/source/view/orgmgr.cxx index a2d686206ec6..fc74480a544b 100644 --- a/sfx2/source/view/orgmgr.cxx +++ b/sfx2/source/view/orgmgr.cxx @@ -467,11 +467,11 @@ sal_Bool SfxOrganizeMgr::Delete(SfxOrganizeListBox_Impl *pCaller, { // deleting of a group - SvLBoxEntry *pGroupToDelete = pCaller->GetEntry(nRegion); + SvTreeListEntry *pGroupToDelete = pCaller->GetEntry(nRegion); if ( pGroupToDelete ) { sal_uInt16 nItemNum = (sal_uInt16)( pCaller->GetModel()->GetChildCount( pGroupToDelete ) ); - typedef std::deque<SvLBoxEntry*> BoxEntries; + typedef std::deque<SvTreeListEntry*> BoxEntries; BoxEntries pEntriesToDelete; sal_uInt16 nInd = 0; @@ -504,7 +504,7 @@ sal_Bool SfxOrganizeMgr::Delete(SfxOrganizeListBox_Impl *pCaller, { bModified = 1; // Entry to be deleted. - SvLBoxEntry *pEntryToDelete = pCaller->GetEntry(pCaller->GetEntry(nRegion), nIdx); + SvTreeListEntry *pEntryToDelete = pCaller->GetEntry(pCaller->GetEntry(nRegion), nIdx); pCaller->GetModel()->Remove(pEntryToDelete); } @@ -540,7 +540,7 @@ sal_Bool SfxOrganizeMgr::InsertDir if(bOk) { bModified = 1; - SvLBoxEntry *pEntry = pCaller->InsertEntry(rText, + SvTreeListEntry *pEntry = pCaller->InsertEntry(rText, pCaller->GetOpenedBmp(0), pCaller->GetClosedBmp(0), 0, sal_True, nRegion); @@ -631,7 +631,7 @@ sal_Bool SfxOrganizeMgr::CopyFrom(SfxOrganizeListBox_Impl *pCaller, */ { - SvLBoxEntry *pParent = pCaller->FirstSelected(); + SvTreeListEntry *pParent = pCaller->FirstSelected(); if( nIdx!=USHRT_MAX ) pParent = pCaller->GetParent(pParent); if( pTemplates->CopyFrom( nRegion, nIdx, rName ) ) diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index 7b315a6b62ed..dee5ea764914 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -72,6 +72,7 @@ #include <toolkit/helper/convert.hxx> #include <framework/titlehelper.hxx> #include <comphelper/processfactory.hxx> +#include <vcl/msgbox.hxx> #include <boost/unordered_map.hpp> @@ -1439,55 +1440,43 @@ void SfxBaseController::ShowInfoBars( ) { // CMIS verifications REFERENCE< document::XCmisDocument > xCmisDoc( m_pData->m_pViewShell->GetObjectShell()->GetModel(), uno::UNO_QUERY ); - beans::PropertyValues aCmisProperties = xCmisDoc->getCmisPropertiesValues( ); - - if ( aCmisProperties.hasElements( ) ) + if ( xCmisDoc.is( ) ) { - // Loop over the CMIS Properties to find cmis:isVersionSeriesCheckedOut - bool bFoundCheckedout = false; - sal_Bool bCheckedOut = sal_False; - for ( sal_Int32 i = 0; i < aCmisProperties.getLength() && !bFoundCheckedout; ++i ) + beans::PropertyValues aCmisProperties = xCmisDoc->getCmisPropertiesValues( ); + + if ( xCmisDoc->isVersionable( ) && aCmisProperties.hasElements( ) ) { - if ( aCmisProperties[i].Name == "cmis:isVersionSeriesCheckedOut" ) + // Loop over the CMIS Properties to find cmis:isVersionSeriesCheckedOut + bool bFoundCheckedout = false; + sal_Bool bCheckedOut = sal_False; + for ( sal_Int32 i = 0; i < aCmisProperties.getLength() && !bFoundCheckedout; ++i ) { - bFoundCheckedout = true; - aCmisProperties[i].Value >>= bCheckedOut; + if ( aCmisProperties[i].Name == "cmis:isVersionSeriesCheckedOut" ) + { + bFoundCheckedout = true; + aCmisProperties[i].Value >>= bCheckedOut; + } } - } - if ( !bCheckedOut ) - { - // Get the Frame and show the InfoBar if not checked out - SfxViewFrame* pViewFrame = m_pData->m_pViewShell->GetFrame(); - std::vector< PushButton* > aButtons; - PushButton* pBtn = new PushButton( &pViewFrame->GetWindow(), SfxResId( BT_CHECKOUT ) ); - pBtn->SetClickHdl( LINK( this, SfxBaseController, CheckOutHandler ) ); - aButtons.push_back( pBtn ); - pViewFrame->AppendInfoBar( SfxResId( STR_NONCHECKEDOUT_DOCUMENT ), aButtons ); + if ( !bCheckedOut ) + { + // Get the Frame and show the InfoBar if not checked out + SfxViewFrame* pViewFrame = m_pData->m_pViewShell->GetFrame(); + std::vector< PushButton* > aButtons; + PushButton* pBtn = new PushButton( &pViewFrame->GetWindow(), SfxResId( BT_CHECKOUT ) ); + pBtn->SetClickHdl( LINK( this, SfxBaseController, CheckOutHandler ) ); + aButtons.push_back( pBtn ); + pViewFrame->AppendInfoBar( "checkout", SfxResId( STR_NONCHECKEDOUT_DOCUMENT ), aButtons ); + } } } } } -IMPL_LINK( SfxBaseController, CheckOutHandler, PushButton*, pBtn ) +IMPL_LINK_NOARG ( SfxBaseController, CheckOutHandler ) { if ( m_pData->m_pViewShell ) - { - try - { - REFERENCE< document::XCmisDocument > xCmisDoc( m_pData->m_pViewShell->GetObjectShell()->GetModel(), uno::UNO_QUERY_THROW ); - xCmisDoc->checkOut( ); - - // Remove the info bar - SfxInfoBarWindow* pInfoBar = ( SfxInfoBarWindow* )pBtn->GetParent( ); - SfxViewFrame* pViewFrame = m_pData->m_pViewShell->GetFrame(); - pViewFrame->RemoveInfoBar( pInfoBar ); - } - catch ( const uno::RuntimeException& ) - { - // TODO Handle the problem in some way? - } - } + m_pData->m_pViewShell->GetObjectShell()->CheckOut( ); return 0; } @@ -1503,7 +1492,7 @@ css::uno::Reference< css::frame::XTitle > SfxBaseController::impl_getTitleHelper css::uno::Reference< css::frame::XUntitledNumbers > xUntitledProvider(xModel , css::uno::UNO_QUERY ); css::uno::Reference< css::frame::XController > xThis (static_cast< css::frame::XController* >(this), css::uno::UNO_QUERY_THROW); - ::framework::TitleHelper* pHelper = new ::framework::TitleHelper(::comphelper::getProcessServiceFactory()); + ::framework::TitleHelper* pHelper = new ::framework::TitleHelper(::comphelper::getProcessComponentContext()); m_pData->m_xTitleHelper = css::uno::Reference< css::frame::XTitle >(static_cast< ::cppu::OWeakObject* >(pHelper), css::uno::UNO_QUERY_THROW); pHelper->setOwner (xThis ); diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index d9ed89314e47..60bd2a758673 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -23,6 +23,7 @@ #include <sfx2/infobar.hxx> #include <sfx2/viewfrm.hxx> #include <com/sun/star/document/MacroExecMode.hpp> +#include <com/sun/star/frame/DispatchRecorderSupplier.hpp> #include <com/sun/star/frame/XLoadable.hpp> #include <com/sun/star/frame/XLayoutManager.hpp> #include <com/sun/star/frame/XComponentLoader.hpp> @@ -56,7 +57,7 @@ #include <com/sun/star/frame/XDispatchRecorderSupplier.hpp> #include <com/sun/star/document/UpdateDocMode.hpp> #include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/uri/XUriReferenceFactory.hpp> +#include <com/sun/star/uri/UriReferenceFactory.hpp> #include <com/sun/star/uri/XVndSunStarScriptUrl.hpp> #include <com/sun/star/embed/XStorage.hpp> #include <com/sun/star/embed/EmbedStates.hpp> @@ -2327,7 +2328,7 @@ sal_Bool impl_maxOpenDocCountReached() { css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory(); css::uno::Any aVal = ::comphelper::ConfigurationHelper::readDirectKey( - xSMGR, + ::comphelper::getProcessComponentContext(), ::rtl::OUString("org.openoffice.Office.Common/"), ::rtl::OUString("Misc"), ::rtl::OUString("MaxOpenDocuments"), @@ -2620,29 +2621,26 @@ void SfxViewFrame::AddDispatchMacroToBasic_Impl( const ::rtl::OUString& sMacro ) String aModuleName; String aMacroName; String aLocation; - Reference< XMultiServiceFactory > xSMgr = ::comphelper::getProcessServiceFactory(); - Reference< com::sun::star::uri::XUriReferenceFactory > xFactory( xSMgr->createInstance( - ::rtl::OUString("com.sun.star.uri.UriReferenceFactory") ), UNO_QUERY ); - if ( xFactory.is() ) - { - Reference< com::sun::star::uri::XVndSunStarScriptUrl > xUrl( xFactory->parse( aScriptURL ), UNO_QUERY ); - if ( xUrl.is() ) - { - // get name - ::rtl::OUString aName = xUrl->getName(); - sal_Unicode cTok = '.'; - sal_Int32 nIndex = 0; - aLibName = aName.getToken( 0, cTok, nIndex ); - if ( nIndex != -1 ) - aModuleName = aName.getToken( 0, cTok, nIndex ); - if ( nIndex != -1 ) - aMacroName = aName.getToken( 0, cTok, nIndex ); - - // get location - ::rtl::OUString aLocKey("location"); - if ( xUrl->hasParameter( aLocKey ) ) - aLocation = xUrl->getParameter( aLocKey ); - } + Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); + Reference< com::sun::star::uri::XUriReferenceFactory > xFactory = + com::sun::star::uri::UriReferenceFactory::create( xContext ); + Reference< com::sun::star::uri::XVndSunStarScriptUrl > xUrl( xFactory->parse( aScriptURL ), UNO_QUERY ); + if ( xUrl.is() ) + { + // get name + ::rtl::OUString aName = xUrl->getName(); + sal_Unicode cTok = '.'; + sal_Int32 nIndex = 0; + aLibName = aName.getToken( 0, cTok, nIndex ); + if ( nIndex != -1 ) + aModuleName = aName.getToken( 0, cTok, nIndex ); + if ( nIndex != -1 ) + aMacroName = aName.getToken( 0, cTok, nIndex ); + + // get location + ::rtl::OUString aLocKey("location"); + if ( xUrl->hasParameter( aLocKey ) ) + aLocation = xUrl->getParameter( aLocKey ); } BasicManager* pBasMgr = 0; @@ -2836,14 +2834,14 @@ void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq ) com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory(), com::sun::star::uno::UNO_QUERY); + com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > xContext( + ::comphelper::getProcessComponentContext()); xRecorder = com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorder >( xFactory->createInstance(rtl::OUString("com.sun.star.frame.DispatchRecorder")), com::sun::star::uno::UNO_QUERY); - xSupplier = com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorderSupplier >( - xFactory->createInstance(rtl::OUString("com.sun.star.frame.DispatchRecorderSupplier")), - com::sun::star::uno::UNO_QUERY); + xSupplier = com::sun::star::frame::DispatchRecorderSupplier::create( xContext ); xSupplier->setDispatchRecorder(xRecorder); xRecorder->startRecording(xFrame); @@ -3350,7 +3348,7 @@ void SfxViewFrame::ActivateToolPanel_Impl( const ::rtl::OUString& i_rPanelURL ) pPanelAccess->ActivateToolPanel( i_rPanelURL ); } -void SfxViewFrame::AppendInfoBar( const rtl::OUString& sMessage, std::vector< PushButton* > aButtons ) +void SfxViewFrame::AppendInfoBar( const rtl::OUString& sId, const rtl::OUString& sMessage, std::vector< PushButton* > aButtons ) { const sal_uInt16 nId = SfxInfoBarContainerChild::GetChildWindowId(); @@ -3361,12 +3359,12 @@ void SfxViewFrame::AppendInfoBar( const rtl::OUString& sMessage, std::vector< Pu if ( pChild ) { SfxInfoBarContainerWindow* pInfoBars = ( SfxInfoBarContainerWindow* )pChild->GetWindow(); - pInfoBars->appendInfoBar( sMessage, aButtons ); + pInfoBars->appendInfoBar( sId, sMessage, aButtons ); ShowChildWindow( nId ); } } -void SfxViewFrame::RemoveInfoBar( SfxInfoBarWindow* pInfoBar ) +void SfxViewFrame::RemoveInfoBar( const rtl::OUString& sId ) { const sal_uInt16 nId = SfxInfoBarContainerChild::GetChildWindowId(); @@ -3377,6 +3375,7 @@ void SfxViewFrame::RemoveInfoBar( SfxInfoBarWindow* pInfoBar ) if ( pChild ) { SfxInfoBarContainerWindow* pInfoBars = ( SfxInfoBarContainerWindow* )pChild->GetWindow(); + SfxInfoBarWindow* pInfoBar = pInfoBars->getInfoBar( sId ); pInfoBars->removeInfoBar( pInfoBar ); ShowChildWindow( nId ); } diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index c61e3005f8c5..f6c2eb55248f 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -2050,7 +2050,7 @@ sal_Bool SfxViewShell::TryContextMenuInterception( Menu& rIn, const ::rtl::OUStr continue; } } - catch (const uno::RuntimeException&) + catch (...) { aIt.remove(); } diff --git a/sfx2/uiconfig/ui/checkin.ui b/sfx2/uiconfig/ui/checkin.ui new file mode 100644 index 000000000000..0585acba5fc2 --- /dev/null +++ b/sfx2/uiconfig/ui/checkin.ui @@ -0,0 +1,141 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkDialog" id="CheckinDialog"> + <property name="can_focus">False</property> + <property name="border_width">5</property> + <property name="title" translatable="yes">Check-in</property> + <property name="modal">True</property> + <property name="window_position">center-on-parent</property> + <property name="type_hint">dialog</property> + <child internal-child="vbox"> + <object class="GtkBox" id="dialog-vbox1"> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">2</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area1"> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="cancel"> + <property name="label">gtk-cancel</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_action_appearance">False</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="ok"> + <property name="label">gtk-ok</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="receives_default">True</property> + <property name="use_action_appearance">False</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkGrid" id="grid1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <child> + <object class="GtkCheckButton" id="MajorVersion"> + <property name="label" translatable="yes">New major version</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="frame1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkTextView" id="VersionComment"> + <property name="width_request">300</property> + <property name="height_request">150</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="wrap_mode">word</property> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Version comment</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + <action-widgets> + <action-widget response="0">cancel</action-widget> + <action-widget response="0">ok</action-widget> + </action-widgets> + </object> +</interface> diff --git a/sfx2/uiconfig/ui/password.ui b/sfx2/uiconfig/ui/password.ui index 93163167b181..dc14bd25cd7b 100644 --- a/sfx2/uiconfig/ui/password.ui +++ b/sfx2/uiconfig/ui/password.ui @@ -192,7 +192,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Password</property> - <property name="use_markup">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> @@ -288,7 +290,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Second Password</property> - <property name="use_markup">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> diff --git a/sfx2/workben/custompanel/ctp_panel.cxx b/sfx2/workben/custompanel/ctp_panel.cxx index 6cde8e4e5fb9..d41f2e64a847 100644 --- a/sfx2/workben/custompanel/ctp_panel.cxx +++ b/sfx2/workben/custompanel/ctp_panel.cxx @@ -22,7 +22,7 @@ #include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/awt/XWindowPeer.hpp> -#include <com/sun/star/awt/XToolkit.hpp> +#include <com/sun/star/awt/Toolkit.hpp> #include <com/sun/star/awt/WindowClass.hpp> #include <com/sun/star/awt/WindowAttribute.hpp> #include <com/sun/star/awt/PosSize.hpp> @@ -81,10 +81,7 @@ namespace sd { namespace colortoolpanel { ENSURE_OR_THROW( i_rContext.is(), "illegal component context" ); Reference< XMultiComponentFactory > xFactory( i_rContext->getServiceManager(), UNO_SET_THROW ); - Reference< XToolkit > xToolkit( xFactory->createInstanceWithContext( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.Toolkit" ) ), - i_rContext - ), UNO_QUERY_THROW ); + Reference< XToolkit2 > xToolkit = Toolkit::create(i_rContext); WindowDescriptor aWindow; aWindow.Type = WindowClass_SIMPLE; |