diff options
362 files changed, 5214 insertions, 5717 deletions
diff --git a/sfx2/inc/about.hxx b/sfx2/inc/about.hxx index 7a4d1c5f31..a957ea6597 100644 --- a/sfx2/inc/about.hxx +++ b/sfx2/inc/about.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -35,9 +36,11 @@ #include <svtools/svmedit.hxx> #include <tools/list.hxx> #include <svtools/stdctrl.hxx> +#include "svtools/fixedhyper.hxx" #include <sfx2/basedlgs.hxx> // SfxModalDialog +#include <vector> -DECLARE_LIST( AccelList, Accelerator* ) +typedef ::std::vector< Accelerator* > AccelList; // class AboutDialog ----------------------------------------------------- @@ -76,8 +79,10 @@ public: DECL_LINK( TimerHdl, Timer * ); DECL_LINK( AccelSelectHdl, Accelerator * ); + DECL_LINK( HandleHyperlink, svt::FixedHyperlink * ); }; #endif // #ifndef _ABOUT_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/arrdecl.hxx b/sfx2/inc/arrdecl.hxx index 7c6d924a90..3c4eba5291 100644 --- a/sfx2/inc/arrdecl.hxx +++ b/sfx2/inc/arrdecl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,6 +31,7 @@ #include <tools/list.hxx> #include <svl/svarray.hxx> #include <sfx2/minarray.hxx> +#include <vector> struct CntUpdateResult; @@ -70,22 +72,16 @@ class SfxFrame; typedef SfxFrame* SfxFramePtr; SV_DECL_PTRARR( SfxFrameArr_Impl, SfxFramePtr, 4, 4 ) -DECLARE_LIST( SfxFilterList_Impl, SfxFilter* ) +typedef ::std::vector< SfxFilter* > SfxFilterList_Impl; struct SfxExternalLib_Impl; typedef SfxExternalLib_Impl* SfxExternalLibPtr; SV_DECL_PTRARR_DEL( SfxExternalLibArr_Impl, SfxExternalLibPtr, 2, 2 ) -//class XEventListenerRef; -//typedef XEventListenerRef* XEventListenerPtr; -//SV_DECL_PTRARR_DEL( XEventListenerArr_Impl, XEventListenerPtr, 4, 4 ) - -//class XFrameRef; -//typedef XFrameRef* XFramePtr; -//SV_DECL_PTRARR_DEL( XFrameArr_Impl, XFramePtr, 4, 4 ) - class SfxSlot; typedef SfxSlot* SfxSlotPtr; SV_DECL_PTRARR( SfxSlotArr_Impl, SfxSlotPtr, 20, 20 ) #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/bitset.hxx b/sfx2/inc/bitset.hxx index f2e0a88cd7..ecf64ebf30 100644 --- a/sfx2/inc/bitset.hxx +++ b/sfx2/inc/bitset.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -255,3 +256,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/configmgr.hxx b/sfx2/inc/configmgr.hxx index e629a239f3..f09485e962 100644 --- a/sfx2/inc/configmgr.hxx +++ b/sfx2/inc/configmgr.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -32,8 +33,7 @@ namespace utl{ class ConfigManager; } -/* -----------------------------05.09.00 16:42-------------------------------- - appdata.cxx - ---------------------------------------------------------------------------*/ utl::ConfigManager* GetUtlConfigManager(); #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/docvor.hxx b/sfx2/inc/docvor.hxx index 8b84c0a028..87c62f952f 100644 --- a/sfx2/inc/docvor.hxx +++ b/sfx2/inc/docvor.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,9 +29,7 @@ #define _SFXDOCVOR_HXX -#ifndef _DIALOG_HXX //autogen #include <vcl/dialog.hxx> -#endif #include <svtools/svtreebx.hxx> #include <sfx2/objsh.hxx> @@ -58,11 +57,6 @@ friend class SfxOrganizeDlg_Impl; Image aOpenedDocBmp; Image aClosedDocBmp; - Image aOpenedFolderBmpHC; - Image aClosedFolderBmpHC; - Image aOpenedDocBmpHC; - Image aClosedDocBmpHC; - SfxOrganizeMgr* pMgr; SfxOrganizeDlg_Impl* pDlg; @@ -103,8 +97,8 @@ public: void SetMgr(SfxOrganizeMgr *pM) { pMgr = pM; } void Reset(); inline void SetBitmaps( - const Image &rOFolderBmp, const Image &rCFolderBmp, const Image &rODocBmp, const Image &rCDocBmp, - const Image &rOFolderBmpHC, const Image &rCFolderBmpHC, const Image &rODocBmpHC, const Image &rCDocBmpHC ); + const Image &rOFolderBmp, const Image &rCFolderBmp, const Image &rODocBmp, const Image &rCDocBmp + ); const Image &GetClosedBmp(USHORT nLevel) const; const Image &GetOpenedBmp(USHORT nLevel) const; @@ -145,7 +139,6 @@ friend class SfxOrganizeListBox_Impl; class SfxOrganizeDlg_Impl *pImp; -// virtual void DataChanged( const DataChangedEvent& rDCEvt ); public: SfxTemplateOrganizeDlg(Window * pParent, SfxDocumentTemplates* = 0); ~SfxTemplateOrganizeDlg(); @@ -156,3 +149,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/frmload.hxx b/sfx2/inc/frmload.hxx index 3f3fe029b6..3ab32a502e 100644 --- a/sfx2/inc/frmload.hxx +++ b/sfx2/inc/frmload.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -151,3 +152,5 @@ private: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/fwkhelper.hxx b/sfx2/inc/fwkhelper.hxx index 74c55471f7..43e6f4c7f0 100644 --- a/sfx2/inc/fwkhelper.hxx +++ b/sfx2/inc/fwkhelper.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -32,4 +33,8 @@ #include <rtl/ustring.hxx> -SFX2_DLLPUBLIC void SAL_CALL RefreshToolbars( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame ); +SFX2_DLLPUBLIC void SAL_CALL RefreshToolbars( + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame +); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/guisaveas.hxx b/sfx2/inc/guisaveas.hxx index 2b938be0bf..0b442a34a7 100644 --- a/sfx2/inc/guisaveas.hxx +++ b/sfx2/inc/guisaveas.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -107,3 +108,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/idpool.hxx b/sfx2/inc/idpool.hxx index b6469d6546..8583894972 100644 --- a/sfx2/inc/idpool.hxx +++ b/sfx2/inc/idpool.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -61,3 +62,4 @@ inline BOOL IdPool::IsLocked( USHORT nId ) const #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/inettbc.hxx b/sfx2/inc/inettbc.hxx index c50e3a87ed..9089731f10 100644 --- a/sfx2/inc/inettbc.hxx +++ b/sfx2/inc/inettbc.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -32,9 +33,7 @@ #include <tools/string.hxx> #include <tools/urlobj.hxx> -#ifndef _COMBOBOX_HXX //autogen #include <vcl/combobox.hxx> -#endif #include <svtools/acceleratorexecute.hxx> #if _SOLAR__PRIVATE @@ -78,3 +77,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/macro.hxx b/sfx2/inc/macro.hxx index 1594e01572..2e92ae7731 100644 --- a/sfx2/inc/macro.hxx +++ b/sfx2/inc/macro.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #ifndef _SFXMACRO_HXX #define _SFXMACRO_HXX @@ -181,3 +182,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/msgnodei.hxx b/sfx2/inc/msgnodei.hxx index 5667f8b011..334b6b2409 100644 --- a/sfx2/inc/msgnodei.hxx +++ b/sfx2/inc/msgnodei.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -217,3 +218,5 @@ public: #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/orgmgr.hxx b/sfx2/inc/orgmgr.hxx index 5aa02dfa23..1e43b3eee2 100644 --- a/sfx2/inc/orgmgr.hxx +++ b/sfx2/inc/orgmgr.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -104,3 +105,4 @@ public: #endif // #ifndef _SFX_ORGMGR_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/pch/precompiled_sfx2.cxx b/sfx2/inc/pch/precompiled_sfx2.cxx index 4fbd4f6759..01ca1c846a 100644 --- a/sfx2/inc/pch/precompiled_sfx2.cxx +++ b/sfx2/inc/pch/precompiled_sfx2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,3 +28,4 @@ #include "precompiled_sfx2.hxx" +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/pch/precompiled_sfx2.hxx b/sfx2/inc/pch/precompiled_sfx2.hxx index ea0e774b03..3fb1755ea4 100644 --- a/sfx2/inc/pch/precompiled_sfx2.hxx +++ b/sfx2/inc/pch/precompiled_sfx2.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -465,6 +466,7 @@ #include "osl/mutex.hxx" #include "osl/process.h" #include "osl/security.hxx" +#include "osl/socket.hxx" #include "osl/thread.h" #include "osl/thread.hxx" #include "rsc/rscsfx.hxx" @@ -666,3 +668,4 @@ //---MARKER--- #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/progind.hxx b/sfx2/inc/progind.hxx index aee1db6654..0bbbbdbe9c 100644 --- a/sfx2/inc/progind.hxx +++ b/sfx2/inc/progind.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -81,3 +82,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/resmgr.hxx b/sfx2/inc/resmgr.hxx index 0e03cd8d61..a15abfa16a 100644 --- a/sfx2/inc/resmgr.hxx +++ b/sfx2/inc/resmgr.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -73,3 +74,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/DocumentMetadataAccess.hxx b/sfx2/inc/sfx2/DocumentMetadataAccess.hxx index e108912a67..4a8841437c 100644 --- a/sfx2/inc/sfx2/DocumentMetadataAccess.hxx +++ b/sfx2/inc/sfx2/DocumentMetadataAccess.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -213,3 +214,4 @@ private: #endif // _SFX_DOCUMENTMETADATAACCESS_HXX_ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/Metadatable.hxx b/sfx2/inc/sfx2/Metadatable.hxx index 6896fd689f..69e5231175 100644 --- a/sfx2/inc/sfx2/Metadatable.hxx +++ b/sfx2/inc/sfx2/Metadatable.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -185,3 +186,5 @@ protected: } // namespace sfx2 #endif // METADATABLE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/QuerySaveDocument.hxx b/sfx2/inc/sfx2/QuerySaveDocument.hxx index fefd7226ce..bc4dbfc2d2 100644 --- a/sfx2/inc/sfx2/QuerySaveDocument.hxx +++ b/sfx2/inc/sfx2/QuerySaveDocument.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -43,3 +44,4 @@ SFX2_DLLPUBLIC short ExecuteQuerySaveDocument( #endif //SFX_QUERYSAVEDOCUMENT_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/XmlIdRegistry.hxx b/sfx2/inc/sfx2/XmlIdRegistry.hxx index 6efd21cfba..38090e3546 100644 --- a/sfx2/inc/sfx2/XmlIdRegistry.hxx +++ b/sfx2/inc/sfx2/XmlIdRegistry.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -51,8 +52,8 @@ isValidXmlId(::rtl::OUString const & i_rStreamName, ::rtl::OUString const & i_rIdref) { return isValidNCName(i_rIdref) && - (i_rStreamName.equalsAscii("content.xml") || - i_rStreamName.equalsAscii("styles.xml")); + (i_rStreamName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("content.xml")) || + i_rStreamName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("styles.xml"))); } @@ -96,3 +97,4 @@ public: #endif // _SFX_XMLIDREGISTRY_HXX_ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/app.hxx b/sfx2/inc/sfx2/app.hxx index 6c330b023a..f2ef6c6639 100644 --- a/sfx2/inc/sfx2/app.hxx +++ b/sfx2/inc/sfx2/app.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -44,6 +45,7 @@ #include <vcl/svapp.hxx> #include <sfx2/shell.hxx> +#include <vector> class Timer; class ApplicationEvent; @@ -67,7 +69,6 @@ class SfxEventHint; class SfxItemSet; class SfxMacroConfig; class SfxMedium; -class SfxMediumList; class SfxMenuCtrlFactArr_Impl; class SfxNewFileDialog; class SfxObjectShell; @@ -99,6 +100,8 @@ struct SfxTbxCtrlFactory; class SimpleResMgr; class ModalDialog; +typedef ::std::vector< SfxMedium* > SfxMediumList; + namespace sfx2 { class SvLinkSource; @@ -159,12 +162,10 @@ class SFX2_DLLPUBLIC SfxApplication: public SfxShell SfxAppData_Impl* pAppData_Impl; -//#if 0 // _SOLAR__PRIVATE DECL_DLLPRIVATE_LINK( GlobalBasicErrorHdl_Impl, StarBASIC* ); SAL_DLLPRIVATE BOOL SaveAll_Impl(BOOL bPrompt = FALSE, BOOL bAutoSave = FALSE); SAL_DLLPRIVATE short QuerySave_Impl(SfxObjectShell &, BOOL bAutoSave = FALSE); SAL_DLLPRIVATE void InitializeDisplayName_Impl(); -//#endif static SfxApplication* Create(); void Init(); @@ -238,17 +239,14 @@ public: USHORT SaveBasicManager() const; USHORT SaveBasicAndDialogContainer() const; void EnterBasicCall(); - FASTBOOL IsInBasicCall() const; + bool IsInBasicCall() const; void LeaveBasicCall(); - void RegisterBasicConstants( const char *pPrefix, - const SfxConstant *pConsts, - USHORT nCount ); // misc. BOOL GetOptions(SfxItemSet &); void SetOptions(const SfxItemSet &); virtual void Invalidate(USHORT nId = 0); - void NotifyEvent(const SfxEventHint& rEvent, FASTBOOL bSynchron = TRUE ); + void NotifyEvent(const SfxEventHint& rEvent, bool bSynchron = true ); BOOL IsDowning() const; BOOL IsSecureURL( const INetURLObject &rURL, const String *pReferer ) const; static SfxObjectShellRef DocAlreadyLoaded( const String &rName, @@ -265,7 +263,7 @@ public: SAL_DLLPRIVATE BOOL QueryExit_Impl(); SAL_DLLPRIVATE void SetOptions_Impl(const SfxItemSet &); - SAL_DLLPRIVATE FASTBOOL Initialize_Impl(); + SAL_DLLPRIVATE bool Initialize_Impl(); SAL_DLLPRIVATE SfxAppData_Impl* Get_Impl() const { return pAppData_Impl; } @@ -306,7 +304,7 @@ public: SAL_DLLPRIVATE void PlayMacro_Impl( SfxRequest &rReq, StarBASIC *pBas ); SAL_DLLPRIVATE void EnterAsynchronCall_Impl(); - SAL_DLLPRIVATE FASTBOOL IsInAsynchronCall_Impl() const; + SAL_DLLPRIVATE bool IsInAsynchronCall_Impl() const; SAL_DLLPRIVATE void LeaveAsynchronCall_Impl(); SAL_DLLPRIVATE void Registrations_Impl(); SAL_DLLPRIVATE SfxWorkWindow* GetWorkWindow_Impl(const SfxViewFrame *pFrame=0) const; @@ -334,3 +332,4 @@ inline SfxApplication* SfxGetpApp() #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/appuno.hxx b/sfx2/inc/sfx2/appuno.hxx index e6f565ba1c..f614142bbc 100644 --- a/sfx2/inc/sfx2/appuno.hxx +++ b/sfx2/inc/sfx2/appuno.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -133,3 +134,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/basedlgs.hxx b/sfx2/inc/sfx2/basedlgs.hxx index 953c8df5e1..b5f2d7e915 100644 --- a/sfx2/inc/sfx2/basedlgs.hxx +++ b/sfx2/inc/sfx2/basedlgs.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,13 +31,9 @@ #include "sal/config.h" #include "sfx2/dllapi.h" #include "sal/types.h" -#ifndef _FLOATWIN_HXX //autogen #include <vcl/floatwin.hxx> -#endif #include <vcl/timer.hxx> -#ifndef _DIALOG_HXX //autogen #include <vcl/dialog.hxx> -#endif class TabPage; class SfxTabPage; @@ -225,3 +222,4 @@ private: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/basmgr.hxx b/sfx2/inc/sfx2/basmgr.hxx index 16b6c7f7b6..291cad0afd 100644 --- a/sfx2/inc/sfx2/basmgr.hxx +++ b/sfx2/inc/sfx2/basmgr.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -32,3 +33,5 @@ #include <svtools/svtools.hrc> #endif //_SFX_BASMGR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/bindings.hxx b/sfx2/inc/sfx2/bindings.hxx index 6eab21e0b7..8a60557653 100644 --- a/sfx2/inc/sfx2/bindings.hxx +++ b/sfx2/inc/sfx2/bindings.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -117,7 +118,6 @@ friend class SfxBindings_Impl; SfxDispatcher* pDispatcher; // zu verwendender Dispatcher sal_uInt16 nRegLevel; // Lock-Level waehrend Reconfig -//#if 0 // _SOLAR__PRIVATE private: SAL_DLLPRIVATE const SfxPoolItem* Execute_Impl( sal_uInt16 nSlot, const SfxPoolItem **pArgs, sal_uInt16 nModi, SfxCallMode nCall, const SfxPoolItem **pInternalArgs, BOOL bGlobalOnly=FALSE); @@ -135,14 +135,13 @@ private: const SfxPoolItem *pItem, SfxItemState eItemState ); DECL_DLLPRIVATE_LINK( NextJob_Impl, Timer * ); -//#endif public: SfxBindings(); ~SfxBindings(); void HidePopups( bool bHide = true ); - SAL_DLLPRIVATE void HidePopupCtrls_Impl( FASTBOOL bHide = sal_True ); + SAL_DLLPRIVATE void HidePopupCtrls_Impl( bool bHide = true ); void SetDispatcher(SfxDispatcher *pDisp); @@ -193,7 +192,6 @@ public: com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorder > GetRecorder() const; com::sun::star::uno::Reference < com::sun::star::frame::XDispatch > GetDispatch( const SfxSlot*, const com::sun::star::util::URL& aURL, sal_Bool bMasterCommand ); -//#if 0 // _SOLAR__PRIVATE SAL_DLLPRIVATE void ContextChanged_Impl(); SAL_DLLPRIVATE void Execute_Impl( SfxRequest& rReq, const SfxSlot* pSlot, SfxShell* pShell ); SAL_DLLPRIVATE void DeleteControllers_Impl(); @@ -214,7 +212,6 @@ public: SAL_DLLPRIVATE void ExecuteGlobal_Impl( USHORT nId ); SAL_DLLPRIVATE void InvalidateSlotsInMap_Impl(); SAL_DLLPRIVATE void AddSlotToInvalidateSlotsMap_Impl( USHORT nId ); -//#endif }; #ifdef DBG_UTIL @@ -260,3 +257,4 @@ inline int SfxBindings::IsInRegistrations() const #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/chalign.hxx b/sfx2/inc/sfx2/chalign.hxx index 1ad1da83c2..279a192c43 100644 --- a/sfx2/inc/sfx2/chalign.hxx +++ b/sfx2/inc/sfx2/chalign.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -61,3 +62,5 @@ inline BOOL SfxChildAlignValid( SfxChildAlignment eAlign ) } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/childwin.hxx b/sfx2/inc/sfx2/childwin.hxx index a83249963a..7fdfe99f04 100644 --- a/sfx2/inc/sfx2/childwin.hxx +++ b/sfx2/inc/sfx2/childwin.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -77,13 +78,11 @@ struct SfxChildWinInfo bVisible = sal_False; nFlags = 0; } -//#if 0 // _SOLAR__PRIVATE sal_Bool GetExtraData_Impl( SfxChildAlignment *pAlign, SfxChildAlignment *pLastAlign = 0, Size *pSize = 0, sal_uInt16 *pLine = 0, sal_uInt16 *pPos = 0 ) const; -//#endif }; // Factory-Methode eines ChildWindows @@ -126,16 +125,11 @@ struct SfxChildWinFactory , pArr( NULL ) {} -//#if 0 // _SOLAR__PRIVATE ~SfxChildWinFactory() { delete pArr; } -//#else - // Der WIN16-Compiler versucht dort zu "ubersetzen, wo dieser Header - // included wird, und kann dann nat"urlich nicht linken, wenn inline ... -// ~SfxChildWinFactory(); -//#endif + }; class FloatingWindow; @@ -240,7 +234,6 @@ public: virtual com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > GetFrame(); void SetFrame( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > & ); -//#if 0 // _SOLAR__PRIVATE SAL_DLLPRIVATE static void InitializeChildWinFactory_Impl(sal_uInt16, SfxChildWinInfo&); SAL_DLLPRIVATE void SetVisible_Impl( sal_Bool bVis ); SAL_DLLPRIVATE void SetWorkWindow_Impl( SfxWorkWindow* ); @@ -252,7 +245,6 @@ public: GetContext_Impl() const { return pContext; } SAL_DLLPRIVATE void SetFactory_Impl( SfxChildWinFactory* ); -//#endif }; //------------------------------------------------------------------ @@ -321,7 +313,7 @@ public: SfxChildWindow *pWin = new Class(pParent, nId, pBindings, pInfo);\ return pWin; \ } \ - sal_uInt16 __EXPORT Class::GetChildWindowId () \ + sal_uInt16 Class::GetChildWindowId () \ { return MyID; } \ void Class::RegisterChildWindow (sal_Bool bVis, SfxModule *pMod, sal_uInt16 nFlags) \ { \ @@ -334,7 +326,7 @@ public: #define SFX_IMPL_FLOATINGWINDOW(Class, MyID) \ SFX_IMPL_CHILDWINDOW(Class, MyID) \ - SfxChildWinInfo __EXPORT Class::GetInfo() const \ + SfxChildWinInfo Class::GetInfo() const \ { \ SfxChildWinInfo aInfo = SfxChildWindow::GetInfo(); \ ((SfxFloatingWindow*)GetWindow())->FillInfo( aInfo ); \ @@ -342,7 +334,7 @@ public: #define SFX_IMPL_MODELESSDIALOG(Class, MyID) \ SFX_IMPL_CHILDWINDOW(Class, MyID) \ - SfxChildWinInfo __EXPORT Class::GetInfo() const \ + SfxChildWinInfo Class::GetInfo() const \ { \ SfxChildWinInfo aInfo = SfxChildWindow::GetInfo(); \ ((SfxModelessDialog*)GetWindow())->FillInfo( aInfo ); \ @@ -350,7 +342,7 @@ public: #define SFX_IMPL_DOCKINGWINDOW(Class, MyID) \ SFX_IMPL_CHILDWINDOW(Class, MyID) \ - SfxChildWinInfo __EXPORT Class::GetInfo() const \ + SfxChildWinInfo Class::GetInfo() const \ { \ SfxChildWinInfo aInfo = SfxChildWindow::GetInfo(); \ ((SfxDockingWindow*)GetWindow())->FillInfo( aInfo ); \ @@ -358,7 +350,7 @@ public: #define SFX_IMPL_TOOLBOX(Class, MyID) \ SFX_IMPL_CHILDWINDOW(Class, MyID) \ - SfxChildWinInfo __EXPORT Class::GetInfo() const \ + SfxChildWinInfo Class::GetInfo() const \ { \ SfxChildWinInfo aInfo = SfxChildWindow::GetInfo(); \ ((SfxToolbox*)GetWindow())->FillInfo( aInfo ); \ @@ -367,3 +359,5 @@ public: //------------------------------------------------------------------ #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/controlwrapper.hxx b/sfx2/inc/sfx2/controlwrapper.hxx index 66fd1dfc06..272536039d 100644 --- a/sfx2/inc/sfx2/controlwrapper.hxx +++ b/sfx2/inc/sfx2/controlwrapper.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,9 +35,7 @@ #include <memory> -#ifndef _SV_BUTTON_HXX #include <vcl/button.hxx> -#endif #include <vcl/edit.hxx> #include <vcl/field.hxx> #include <vcl/lstbox.hxx> @@ -669,3 +668,4 @@ void ValueSetWrapper< ValueT >::SetControlValue( ValueT nValue ) #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/ctrlitem.hxx b/sfx2/inc/sfx2/ctrlitem.hxx index a939dc331e..8b293995f3 100644 --- a/sfx2/inc/sfx2/ctrlitem.hxx +++ b/sfx2/inc/sfx2/ctrlitem.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -85,11 +86,9 @@ public: static SfxItemState GetItemState( const SfxPoolItem* pState ); -//#if 0 // _SOLAR__PRIVATE SAL_DLLPRIVATE BOOL IsBindable_Impl() const { return pBindings != NULL; } SAL_DLLPRIVATE void BindInternal_Impl( USHORT nNewId, SfxBindings* ); -//#endif }; //==================================================================== @@ -109,3 +108,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/dinfdlg.hxx b/sfx2/inc/sfx2/dinfdlg.hxx index 45a087b8b6..6c103894ab 100644 --- a/sfx2/inc/sfx2/dinfdlg.hxx +++ b/sfx2/inc/sfx2/dinfdlg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -162,8 +163,8 @@ public: virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const; virtual int operator==( const SfxPoolItem& ) const; - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; - virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + virtual bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; + virtual bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); }; // class SfxDocumentPage ------------------------------------------------- @@ -253,7 +254,6 @@ public: // class SfxInternetPage ------------------------------------------------- -class TargetList; namespace sfx2 { class FileDialogHelper; @@ -573,3 +573,4 @@ public: #endif // #ifndef _SFX_DINFDLG_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/dinfedt.hxx b/sfx2/inc/sfx2/dinfedt.hxx index ab2ea95d5d..8d5827c4b6 100644 --- a/sfx2/inc/sfx2/dinfedt.hxx +++ b/sfx2/inc/sfx2/dinfedt.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,9 +30,7 @@ // include --------------------------------------------------------------- -#ifndef _SV_BUTTON_HXX #include <vcl/button.hxx> -#endif #include <vcl/dialog.hxx> #include <vcl/edit.hxx> #include <vcl/fixed.hxx> @@ -77,3 +76,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/dispatch.hxx b/sfx2/inc/sfx2/dispatch.hxx index 265c123e9c..2f6238e79b 100644 --- a/sfx2/inc/sfx2/dispatch.hxx +++ b/sfx2/inc/sfx2/dispatch.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -234,7 +235,6 @@ public: void SetDisableFlags( sal_uInt32 nFlags ); sal_uInt32 GetDisableFlags() const; -//#if 0 // _SOLAR__PRIVATE SAL_DLLPRIVATE BOOL HasSlot_Impl( USHORT ); SAL_DLLPRIVATE void SetMenu_Impl(); SAL_DLLPRIVATE void Update_Impl( BOOL bForce = FALSE ); // ObjectBars etc. @@ -258,7 +258,6 @@ public: SAL_DLLPRIVATE void DoDeactivate_Impl( BOOL bMDI, SfxViewFrame* pNew ); SAL_DLLPRIVATE void InvalidateBindings_Impl(BOOL); SAL_DLLPRIVATE USHORT GetNextToolBox_Impl( USHORT nPos, USHORT nType, String *pStr ); -//#endif }; //-------------------------------------------------------------------- @@ -364,3 +363,4 @@ inline BOOL SfxDispatcher::IsOnTop( const SfxShell& rShell ) #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/dllapi.h b/sfx2/inc/sfx2/dllapi.h index 3833cf93d5..b9c9cf5962 100644 --- a/sfx2/inc/sfx2/dllapi.h +++ b/sfx2/inc/sfx2/dllapi.h @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -40,3 +41,5 @@ #define SFX2_DLLPRIVATE SAL_DLLPRIVATE #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/docfac.hxx b/sfx2/inc/sfx2/docfac.hxx index 3054278504..615de879b2 100644 --- a/sfx2/inc/sfx2/docfac.hxx +++ b/sfx2/inc/sfx2/docfac.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,7 +35,7 @@ #include <tools/rtti.hxx> // SFX_IMPL_MODULE_LIB -#include <vos/module.hxx> +#include <osl/module.hxx> #include <rtl/ustring.hxx> #include <sfx2/objsh.hxx> @@ -108,7 +109,6 @@ public: SfxModule* GetModule() const; -//#if 0 // _SOLAR__PRIVATE SAL_DLLPRIVATE void SetModule_Impl( SfxModule* ); SAL_DLLPRIVATE static void UpdateFilterContainers_Impl(); SAL_DLLPRIVATE sal_uInt16 GetViewNo_Impl( const sal_uInt16 i_nViewId, const sal_uInt16 i_nFallback ) const; @@ -139,3 +139,4 @@ public: \ } #endif // #ifndef _SFX_OBJFAC_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/docfile.hxx b/sfx2/inc/sfx2/docfile.hxx index d6288a7228..cbe39db8c3 100644 --- a/sfx2/inc/sfx2/docfile.hxx +++ b/sfx2/inc/sfx2/docfile.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -51,6 +52,8 @@ #include <cppuhelper/weak.hxx> #include <ucbhelper/content.hxx> +#include <vector> + class SvKeyValueIterator; class SfxObjectFactory; class SfxFilter; @@ -183,7 +186,6 @@ public: void SetDataAvailableLink( const Link& rLink ); Link GetDataAvailableLink( ) const; - sal_uInt32 GetMIMEAndRedirect( String& ); sal_uInt32 GetErrorCode() const; sal_uInt32 GetError() const { return ERRCODE_TOERROR(GetErrorCode()); } @@ -329,10 +331,8 @@ public: SV_DECL_IMPL_REF( SfxMedium ) SV_DECL_COMPAT_WEAK( SfxMedium ) -#ifndef SFXMEDIUM_LIST -#define SFXMEDIUM_LIST -DECLARE_LIST( SfxMediumList, SfxMedium* ) -#endif +typedef ::std::vector< SfxMedium* > SfxMediumList; #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/docfilt.hxx b/sfx2/inc/sfx2/docfilt.hxx index 030ee7dcdf..968e144bfb 100644 --- a/sfx2/inc/sfx2/docfilt.hxx +++ b/sfx2/inc/sfx2/docfilt.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -119,3 +120,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/docinf.hxx b/sfx2/inc/sfx2/docinf.hxx index 214a238125..267690b54e 100644 --- a/sfx2/inc/sfx2/docinf.hxx +++ b/sfx2/inc/sfx2/docinf.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -79,3 +80,4 @@ bool SFX2_DLLPUBLIC SaveOlePropertySet( #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/docinsert.hxx b/sfx2/inc/sfx2/docinsert.hxx index 0f10e2c638..7d1f507f1c 100644 --- a/sfx2/inc/sfx2/docinsert.hxx +++ b/sfx2/inc/sfx2/docinsert.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,15 +32,17 @@ #include <tools/errcode.hxx> #include <tools/link.hxx> #include <tools/string.hxx> +#include <vector> #include "sfx2/dllapi.h" namespace sfx2 { class FileDialogHelper; } class SfxMedium; -class SfxMediumList; class SfxItemSet; class SvStringsDtor; +typedef ::std::vector< SfxMedium* > SfxMediumList; + // ============================================================================ namespace sfx2 { @@ -87,3 +90,4 @@ public: #endif // _SFX_DOCINSERT_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/dockwin.hxx b/sfx2/inc/sfx2/dockwin.hxx index 1ba7dcd3ea..681865189e 100644 --- a/sfx2/inc/sfx2/dockwin.hxx +++ b/sfx2/inc/sfx2/dockwin.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -76,9 +77,7 @@ protected: virtual BOOL Close(); virtual void Move(); -//#if 0 // _SOLAR__PRIVATE SAL_DLLPRIVATE SfxChildWindow* GetChildWindow_Impl() { return pMgr; } -//#endif public: SfxDockingWindow( SfxBindings *pBindings, @@ -113,7 +112,6 @@ public: void AutoShow( BOOL bShow = TRUE ); DECL_LINK( TimerHdl, Timer* ); -//#if 0 // _SOLAR__PRIVATE SAL_DLLPRIVATE void Initialize_Impl(); SAL_DLLPRIVATE USHORT GetWinBits_Impl() const; SAL_DLLPRIVATE void SetItemSize_Impl( const Size& rSize ); @@ -125,7 +123,6 @@ public: SAL_DLLPRIVATE void Pin_Impl( BOOL bPinned ); SAL_DLLPRIVATE SfxSplitWindow* GetSplitWindow_Impl() const; SAL_DLLPRIVATE void ReleaseChildWindow_Impl(); -//#endif }; class SfxDockingWrapper : public SfxChildWindow @@ -140,3 +137,5 @@ class SfxDockingWrapper : public SfxChildWindow }; #endif // #ifndef _SFXDOCKWIN_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/docmacromode.hxx b/sfx2/inc/sfx2/docmacromode.hxx index aef8dd64a5..d06434eee6 100644 --- a/sfx2/inc/sfx2/docmacromode.hxx +++ b/sfx2/inc/sfx2/docmacromode.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -330,3 +331,5 @@ namespace sfx2 //........................................................................ #endif // SFX2_DOCMACROMODE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/docstoragemodifylistener.hxx b/sfx2/inc/sfx2/docstoragemodifylistener.hxx index 5b9ae8cc74..c0dcf66ad4 100644 --- a/sfx2/inc/sfx2/docstoragemodifylistener.hxx +++ b/sfx2/inc/sfx2/docstoragemodifylistener.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -36,10 +37,6 @@ #include <cppuhelper/implbase1.hxx> -namespace vos -{ - class IMutex; -} //........................................................................ namespace sfx2 @@ -66,10 +63,10 @@ namespace sfx2 class SFX2_DLLPUBLIC DocumentStorageModifyListener : public DocumentStorageModifyListener_Base { IModifiableDocument* m_pDocument; - ::vos::IMutex& m_rMutex; + ::osl::SolarMutex& m_rMutex; public: - DocumentStorageModifyListener( IModifiableDocument& _rDocument, ::vos::IMutex& _rMutex ); + DocumentStorageModifyListener( IModifiableDocument& _rDocument, ::osl::SolarMutex& _rMutex ); void dispose(); @@ -93,3 +90,5 @@ namespace sfx2 //........................................................................ #endif // SFX2_DOCSTORAGEMODIFYLISTENER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/doctdlg.hxx b/sfx2/inc/sfx2/doctdlg.hxx index 415eb058b7..7f19f244a4 100644 --- a/sfx2/inc/sfx2/doctdlg.hxx +++ b/sfx2/inc/sfx2/doctdlg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,9 +32,7 @@ #include <vcl/lstbox.hxx> #include <vcl/edit.hxx> #include <vcl/fixed.hxx> -#ifndef _SV_BUTTON_HXX #include <vcl/button.hxx> -#endif #include <vcl/dialog.hxx> #include <vcl/fixed.hxx> @@ -84,3 +83,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/doctempl.hxx b/sfx2/inc/sfx2/doctempl.hxx index 60dd1ae473..0f2ac259df 100644 --- a/sfx2/inc/sfx2/doctempl.hxx +++ b/sfx2/inc/sfx2/doctempl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -146,3 +147,4 @@ public: #endif // #ifndef _SFXDOCTEMPL_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/event.hxx b/sfx2/inc/sfx2/event.hxx index 7f33941a2b..4120229fc3 100644 --- a/sfx2/inc/sfx2/event.hxx +++ b/sfx2/inc/sfx2/event.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -140,3 +141,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/evntconf.hxx b/sfx2/inc/sfx2/evntconf.hxx index bf434c1d62..7f0b217064 100644 --- a/sfx2/inc/sfx2/evntconf.hxx +++ b/sfx2/inc/sfx2/evntconf.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -68,16 +69,26 @@ struct SFX2_DLLPUBLIC SfxEventName , maUIName( rUIName ) {} }; -DECLARE_LIST( _SfxEventNamesList, SfxEventName* ) +typedef ::std::vector< SfxEventName* > _SfxEventNamesList; -class SFX2_DLLPUBLIC SfxEventNamesList : public _SfxEventNamesList +class SFX2_DLLPUBLIC SfxEventNamesList { +private: + _SfxEventNamesList aEventNamesList; + void DelDtor(); + public: - SfxEventNamesList( const USHORT nInitSz = 0, const USHORT nReSz = 1 ): _SfxEventNamesList( nInitSz, nReSz ) {} - SfxEventNamesList( const SfxEventNamesList &rCpy ) : _SfxEventNamesList() { *this = rCpy; } + SfxEventNamesList() {} + SfxEventNamesList( const SfxEventNamesList &rCpy ) { *this = rCpy; } ~SfxEventNamesList() { DelDtor(); } SfxEventNamesList& operator=( const SfxEventNamesList &rCpy ); - void DelDtor(); + + size_t size() const { return aEventNamesList.size(); }; + + SfxEventName* at( size_t Index ) const + { return Index < aEventNamesList.size() ? aEventNamesList[ Index ] : NULL; } + + void push_back( SfxEventName* Item ) { aEventNamesList.push_back( Item ); } }; class SFX2_DLLPUBLIC SfxEventNamesItem : public SfxPoolItem @@ -121,3 +132,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/fcontnr.hxx b/sfx2/inc/sfx2/fcontnr.hxx index 16f23d9552..3848073e66 100644 --- a/sfx2/inc/sfx2/fcontnr.hxx +++ b/sfx2/inc/sfx2/fcontnr.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -115,14 +116,12 @@ public: const SfxFilter* GetFilter4FilterName( const String& rName, SfxFilterFlags nMust = 0, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const; const SfxFilter* GetFilter4UIName( const String& rName, SfxFilterFlags nMust = 0, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const; -//#if 0 // _SOLAR__PRIVATE SAL_DLLPRIVATE static void ReadFilters_Impl( BOOL bUpdate=FALSE ); SAL_DLLPRIVATE static void ReadSingleFilter_Impl( const ::rtl::OUString& rName, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& xTypeCFG, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& xFilterCFG, BOOL bUpdate ); SAL_DLLPRIVATE static const SfxFilter* GetDefaultFilter_Impl( const String& ); -//#endif }; class SfxFilterMatcher_Impl; @@ -136,10 +135,8 @@ public: SfxFilterMatcher(); ~SfxFilterMatcher(); -//#if 0 // _SOLAR__PRIVATE SAL_DLLPRIVATE static BOOL IsFilterInstalled_Impl( const SfxFilter* pFilter ); DECL_DLLPRIVATE_STATIC_LINK( SfxFilterMatcher, MaybeFileHdl_Impl, String* ); -//#endif sal_uInt32 GuessFilterIgnoringContent( SfxMedium& rMedium, const SfxFilter **, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const; sal_uInt32 GuessFilter( SfxMedium& rMedium, const SfxFilter **, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const; @@ -164,9 +161,7 @@ class SFX2_DLLPUBLIC SfxFilterMatcherIter USHORT nCurrent; const SfxFilterMatcher_Impl *pMatch; -//#if 0 // _SOLAR__PRIVATE SAL_DLLPRIVATE const SfxFilter* Find_Impl(); -//#endif public: SfxFilterMatcherIter( const SfxFilterMatcher* pMatchP, SfxFilterFlags nMask = 0, SfxFilterFlags nNotMask = SFX_FILTER_NOTINSTALLED ); @@ -176,3 +171,5 @@ public: #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/filedlghelper.hxx b/sfx2/inc/sfx2/filedlghelper.hxx index bdb53a17a1..7155006a79 100644 --- a/sfx2/inc/sfx2/filedlghelper.hxx +++ b/sfx2/inc/sfx2/filedlghelper.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -38,9 +39,7 @@ #include <tools/errcode.hxx> #include <vcl/dialog.hxx> #include <vcl/edit.hxx> -#ifndef _SV_BUTTON_HXX #include <vcl/button.hxx> -#endif #include <vcl/graph.hxx> #include <sfx2/sfxdefs.hxx> #include <sfx2/sfxuno.hxx> @@ -135,12 +134,9 @@ private: ::com::sun::star::uno::Reference < ::com::sun::star::ui::dialogs::XFilePickerListener > mxImp; FileDialogHelper_Impl *mpImp; -//#if 0 // _SOLAR__PRIVATE SAL_DLLPRIVATE sal_Int16 getDialogType( sal_Int64 nFlags ) const; -//#endif - public: FileDialogHelper( sal_Int64 nFlags, const String& rFactory, @@ -292,21 +288,18 @@ public: DECL_LINK( ExecuteSystemFilePicker, void* ); -//#if 0 // _SOLAR__PRIVATE ErrCode Execute( SvStringsDtor*& rpURLList, SfxItemSet *& rpSet, String& rFilter, const String& rDirPath ); ErrCode Execute( SfxItemSet *& rpSet, String& rFilter ); -//#endif }; #define SFX2_IMPL_DIALOG_CONFIG 0 #define SFX2_IMPL_DIALOG_SYSTEM 1 #define SFX2_IMPL_DIALOG_OOO 2 -//#if 0 // _SOLAR__PRIVATE ErrCode FileOpenDialog_Impl( sal_Int64 nFlags, const String& rFact, SvStringsDtor *& rpURLList, @@ -316,10 +309,10 @@ ErrCode FileOpenDialog_Impl( sal_Int64 nFlags, sal_Int16 nDialog = SFX2_IMPL_DIALOG_CONFIG, const String& rStandardDir = String::CreateFromAscii( "" ), const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rBlackList = ::com::sun::star::uno::Sequence< ::rtl::OUString >()); -//#endif } //----------------------------------------------------------------------------- #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/frame.hxx b/sfx2/inc/sfx2/frame.hxx index fe47d4674b..75b2661cf7 100644 --- a/sfx2/inc/sfx2/frame.hxx +++ b/sfx2/inc/sfx2/frame.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -183,7 +184,6 @@ public: sal_Bool IsInPlace() const; -//#if 0 // _SOLAR__PRIVATE SAL_DLLPRIVATE sal_Bool DoClose_Impl(); SAL_DLLPRIVATE void SetFrameInterface_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame ); SAL_DLLPRIVATE void ReleasingComponent_Impl( sal_Bool bSet ); @@ -237,9 +237,7 @@ class SfxFrameIterator const SfxFrame* pFrame; sal_Bool bRecursive; -//#if 0 // _SOLAR__PRIVATE SfxFrame* NextSibling_Impl( SfxFrame& rPrev ); -//#endif public: SfxFrameIterator( const SfxFrame& rFrame, sal_Bool bRecursive=sal_True ); @@ -267,8 +265,8 @@ public: virtual String GetValueText() const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; - virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + virtual bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; + virtual bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); sal_Bool FrameKilled() const { return &wFrame != pFrame; } @@ -304,10 +302,30 @@ public: { return m_xFrame; } virtual int operator==( const SfxPoolItem& ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; - virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + virtual bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; + virtual bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); +}; + +class SFX2_DLLPUBLIC SfxUnoFrameItem : public SfxPoolItem +{ + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > + m_xFrame; + +public: + TYPEINFO(); + SfxUnoFrameItem(); + SfxUnoFrameItem( sal_uInt16 nWhich, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame ); + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& + GetFrame() const + { return m_xFrame; } + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + virtual bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; + virtual bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); }; typedef SfxUsrAnyItem SfxUnoAnyItem; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/frmdescr.hxx b/sfx2/inc/sfx2/frmdescr.hxx index 1a3413fd30..ac9331e414 100644 --- a/sfx2/inc/sfx2/frmdescr.hxx +++ b/sfx2/inc/sfx2/frmdescr.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -292,3 +293,4 @@ public: #endif // #ifndef _SFX_FRMDESCRHXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/frmhtml.hxx b/sfx2/inc/sfx2/frmhtml.hxx index 0091b6e3ac..ea00089130 100644 --- a/sfx2/inc/sfx2/frmhtml.hxx +++ b/sfx2/inc/sfx2/frmhtml.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -57,3 +58,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/frmhtmlw.hxx b/sfx2/inc/sfx2/frmhtmlw.hxx index e4b134e39a..3d3dca2d08 100644 --- a/sfx2/inc/sfx2/frmhtmlw.hxx +++ b/sfx2/inc/sfx2/frmhtmlw.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -91,3 +92,4 @@ inline void SfxFrameHTMLWriter::OutMeta( SvStream& rStrm, #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/genlink.hxx b/sfx2/inc/sfx2/genlink.hxx index 792f2208ce..e1424a59a8 100644 --- a/sfx2/inc/sfx2/genlink.hxx +++ b/sfx2/inc/sfx2/genlink.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -54,3 +55,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/hintpost.hxx b/sfx2/inc/sfx2/hintpost.hxx index a908bb75cd..fb3c072f7a 100644 --- a/sfx2/inc/sfx2/hintpost.hxx +++ b/sfx2/inc/sfx2/hintpost.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -57,9 +58,7 @@ class SfxHintPoster: public SvRefBase private: void RegisterEvent(); -//#if 0 // _SOLAR__PRIVATE DECL_LINK( DoEvent_Impl, SfxHint * ); -//#endif protected: virtual ~SfxHintPoster(); @@ -78,3 +77,5 @@ public: SV_DECL_IMPL_REF(SfxHintPoster); #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/htmlmode.hxx b/sfx2/inc/sfx2/htmlmode.hxx index f02de328db..e841ad9143 100644 --- a/sfx2/inc/sfx2/htmlmode.hxx +++ b/sfx2/inc/sfx2/htmlmode.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -66,3 +67,4 @@ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/imagemgr.hxx b/sfx2/inc/sfx2/imagemgr.hxx index fa552ad42b..5dd5645be8 100644 --- a/sfx2/inc/sfx2/imagemgr.hxx +++ b/sfx2/inc/sfx2/imagemgr.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. diff --git a/sfx2/inc/sfx2/imgdef.hxx b/sfx2/inc/sfx2/imgdef.hxx index baa5844918..bb535f2787 100644 --- a/sfx2/inc/sfx2/imgdef.hxx +++ b/sfx2/inc/sfx2/imgdef.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,3 +32,4 @@ #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/imgmgr.hxx b/sfx2/inc/sfx2/imgmgr.hxx index ce945eb671..7d45b578a3 100644 --- a/sfx2/inc/sfx2/imgmgr.hxx +++ b/sfx2/inc/sfx2/imgmgr.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -33,9 +34,7 @@ #include <sal/types.h> #include <tools/gen.hxx> -#ifndef _IMAGE_HXX //autogen #include <vcl/image.hxx> -#endif class ToolBox; class SfxModule; @@ -55,13 +54,15 @@ public: // get images from resources void SetImages( ToolBox& rToolBox ); - void SetImages( ToolBox& rToolBox, BOOL bHiContrast, BOOL bLarge ); - void SetImagesForceSize( ToolBox& rToolBox, BOOL bHiContrast, BOOL bLarge ); + void SetImages( ToolBox& rToolBox, BOOL bLarge ); + void SetImagesForceSize( ToolBox& rToolBox, BOOL bLarge ); - Image GetImage( USHORT nId, BOOL bLarge, BOOL bHiContrast ) const; - Image GetImage( USHORT nId, BOOL bHiContrast ) const; - Image SeekImage( USHORT nId, BOOL bLarge, BOOL bHiContrast ) const; - Image SeekImage( USHORT nId, BOOL bHiContrast ) const; + Image GetImage( USHORT nId, BOOL bLarge ) const; + Image GetImage( USHORT nId) const; + Image SeekImage( USHORT nId, BOOL bLarge ) const; + Image SeekImage( USHORT nId ) const; }; -#endif +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/ipclient.hxx b/sfx2/inc/sfx2/ipclient.hxx index 99f24c703f..5bf6877d23 100644 --- a/sfx2/inc/sfx2/ipclient.hxx +++ b/sfx2/inc/sfx2/ipclient.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -106,3 +107,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/itemconnect.hxx b/sfx2/inc/sfx2/itemconnect.hxx index 5f662b92bf..2d5d858426 100644 --- a/sfx2/inc/sfx2/itemconnect.hxx +++ b/sfx2/inc/sfx2/itemconnect.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -593,3 +594,4 @@ ValueSetConnection< ItemWrpT >::ValueSetConnection( #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/itemwrapper.hxx b/sfx2/inc/sfx2/itemwrapper.hxx index 7204588cfb..85cd42ae79 100644 --- a/sfx2/inc/sfx2/itemwrapper.hxx +++ b/sfx2/inc/sfx2/itemwrapper.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -205,3 +206,4 @@ const ItemT& SingleItemWrapper< ItemT, ValueT >::GetDefaultItem( const SfxItemSe #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/layout-post.hxx b/sfx2/inc/sfx2/layout-post.hxx index 080735a7ce..95438e1d9e 100644 --- a/sfx2/inc/sfx2/layout-post.hxx +++ b/sfx2/inc/sfx2/layout-post.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -38,3 +39,5 @@ #endif /* ENABLE_LAYOUT */ #endif /* _SFX2_LAYOUT_POST_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/layout-pre.hxx b/sfx2/inc/sfx2/layout-pre.hxx index 6ed1592f8c..d92331f4c3 100644 --- a/sfx2/inc/sfx2/layout-pre.hxx +++ b/sfx2/inc/sfx2/layout-pre.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -47,3 +48,5 @@ #endif /* ENABLE_LAYOUT */ #endif /* _SFX2_LAYOUT_PRE_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/layout-tabdlg.hxx b/sfx2/inc/sfx2/layout-tabdlg.hxx index 605df887d3..de480cbb50 100644 --- a/sfx2/inc/sfx2/layout-tabdlg.hxx +++ b/sfx2/inc/sfx2/layout-tabdlg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -44,3 +45,4 @@ #endif /* _LAYOUT_SFX_TABDLG_HXX */ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/layout.hxx b/sfx2/inc/sfx2/layout.hxx index 836a762f95..914f9c9224 100644 --- a/sfx2/inc/sfx2/layout.hxx +++ b/sfx2/inc/sfx2/layout.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -49,18 +50,6 @@ public: SfxDialog (::Window* parent, char const* xml_file, char const* id, SfxBindings* bindings=0, SfxChildWindow* child=0); }; -#if 0 -class SFX2_DLLPUBLIC SfxTabDialog - : public ::SfxTabDialog - , public InPlug -{ -public: - SfxTabDialog (::Window *parent, char const* xml_file, char const* id, ResId const& res_id, SfxItemSet const* set=0); - ::Window* GetParent () const; - void FreeResource (); -}; -#endif - class SFX2_DLLPUBLIC SfxTabPage : public ::SfxTabPage , public InPlug @@ -76,3 +65,5 @@ public: } // end namespace layout #endif /* _SFX2_LAYOUT_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/linkmgr.hxx b/sfx2/inc/sfx2/linkmgr.hxx index 6ff4e267d9..86baa70a6d 100644 --- a/sfx2/inc/sfx2/linkmgr.hxx +++ b/sfx2/inc/sfx2/linkmgr.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -55,6 +56,10 @@ SV_DECL_PTRARR( SvLinkSources, SvLinkSourcePtr, 1, 1 ) class SFX2_DLLPUBLIC LinkManager { + typedef ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > > + CompVector; + CompVector maCachedComps; + SvBaseLinks aLinkTbl; SvLinkSources aServerTbl; @@ -166,3 +171,4 @@ SFX2_DLLPUBLIC void MakeLnkName( String& rName, #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/linksrc.hxx b/sfx2/inc/sfx2/linksrc.hxx index ae8d119da1..25aededf8c 100644 --- a/sfx2/inc/sfx2/linksrc.hxx +++ b/sfx2/inc/sfx2/linksrc.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,9 +31,7 @@ #include "sal/config.h" #include "sfx2/dllapi.h" -#ifndef _TOOLS_REF_HXX #include <tools/ref.hxx> -#endif #include <tools/rtti.hxx> #include <com/sun/star/io/XInputStream.hpp> @@ -44,7 +43,6 @@ namespace com { namespace sun { namespace star { namespace uno { class Any; - //class Type; }}}} class Window; class String; @@ -74,7 +72,6 @@ public: SvLinkSource(); virtual ~SvLinkSource(); -// SvBaseLink* GetDataBaseLink() const; BOOL HasDataLinks( const SvBaseLink* = 0 ) const; void Closed(); @@ -124,12 +121,12 @@ public: StreamToLoadFrom getStreamToLoadFrom(); void setStreamToLoadFrom(const com::sun::star::uno::Reference<com::sun::star::io::XInputStream>& xInputStream,sal_Bool bIsReadOnly ); - // --> OD 2008-06-18 #i88291# void clearStreamToLoadFrom(); - // <-- }; SV_DECL_IMPL_REF(SvLinkSource); } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/lnkbase.hxx b/sfx2/inc/sfx2/lnkbase.hxx index a71941175c..5e84c335fd 100644 --- a/sfx2/inc/sfx2/lnkbase.hxx +++ b/sfx2/inc/sfx2/lnkbase.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,17 +32,12 @@ #include "sal/config.h" #include "sfx2/dllapi.h" #include <sot/exchange.hxx> -#ifndef _TOOLS_REF_HXX #include <tools/ref.hxx> -#endif -#ifndef _LINKSOURCE_HXX #include <sfx2/linksrc.hxx> -#endif namespace com { namespace sun { namespace star { namespace uno { class Any; - //class Type; }}}} namespace sfx2 @@ -170,9 +166,8 @@ public: sal_Bool bIsReadOnly ) { m_xInputStreamToLoadFrom = xInputStream; m_bIsReadOnly = bIsReadOnly; } - // --> OD 2008-06-18 #i88291# + // #i88291# void clearStreamToLoadFrom(); - // <-- inline BOOL WasLastEditOK() const { return bWasLastEditOK; } FileDialogHelper* GetFileDialog( sal_uInt32 nFlags, const String& rFactory ) const; @@ -183,3 +178,5 @@ SV_DECL_IMPL_REF(SvBaseLink); } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/macrconf.hxx b/sfx2/inc/sfx2/macrconf.hxx index e0e1ddd375..7514d4c511 100644 --- a/sfx2/inc/sfx2/macrconf.hxx +++ b/sfx2/inc/sfx2/macrconf.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -49,18 +50,12 @@ class SvStream; class SvxMacro; typedef SfxMacroInfo* SfxMacroInfoPtr; -//#if 0 // _SOLAR__PRIVATE SV_DECL_PTRARR(SfxMacroInfoArr_Impl, SfxMacroInfoPtr, 5, 5) -//#else -//class SfxMacroInfoArr_Impl; -//#endif class SFX2_DLLPUBLIC SfxMacroInfo { friend class SfxMacroConfig; friend class SfxEventConfiguration; -friend SvStream& operator >> (SvStream& rStream, SfxMacroInfo& rInfo); -friend SvStream& operator << (SvStream& rStream, const SfxMacroInfo& rInfo); String* pHelpText; sal_uInt16 nRefCnt; @@ -80,8 +75,6 @@ public: const String& rModuleName, const String& rMethodName); ~SfxMacroInfo(); sal_Bool operator==(const SfxMacroInfo& rOther) const; - int Load (SvStream&); - int Store (SvStream&); String GetMacroName() const; String GetQualifiedName() const; String GetFullQualifiedName() const; @@ -106,10 +99,6 @@ public: String GetURL() const; }; -//ASDBG obsolete >= 582 -//ASDBG class ::com::sun::star::uno::Reference< ::com::sun::star::script::XEngine > ; -//ASDBG class ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > ; - class SFX2_DLLPUBLIC SfxMacroConfig { friend class SfxEventConfiguration; @@ -130,9 +119,6 @@ public: static sal_Bool IsBasic( SbxObject*, const String&, BasicManager* ); static ErrCode Call( SbxObject*, const String&, BasicManager*, SbxArray *pArgs=NULL, SbxValue *pRet=NULL ); -//ASDBG obsolete >= 582 -//ASDBG static void CallStarScript( const ::com::sun::star::uno::Reference< ::com::sun::star::script::XEngine > & rxEngine, const String & rCode, -//ASDBG const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & rSource, void *pArgs, void *pRet ); static SbMethod* GetMethod_Impl( const String&, BasicManager* ); sal_uInt16 GetSlotId(SfxMacroInfoPtr); @@ -144,12 +130,12 @@ public: sal_Bool CheckMacro(sal_uInt16 nId) const; sal_Bool CheckMacro( SfxObjectShell*, const SvxMacro* ) const; -//#if 0 // _SOLAR__PRIVATE SAL_DLLPRIVATE static void Release_Impl(); SAL_DLLPRIVATE const SfxMacroInfo* GetMacroInfo_Impl( const SvxMacro *pMacro ) const; DECL_DLLPRIVATE_LINK( CallbackHdl_Impl, SfxMacroConfig*); DECL_DLLPRIVATE_LINK( EventHdl_Impl, SfxMacroInfo*); -//#endif }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/mailmodelapi.hxx b/sfx2/inc/sfx2/mailmodelapi.hxx index ba305a02ae..75236104de 100644 --- a/sfx2/inc/sfx2/mailmodelapi.hxx +++ b/sfx2/inc/sfx2/mailmodelapi.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -33,12 +34,14 @@ #include "tools/link.hxx" #include <tools/string.hxx> #include "sfx2/dllapi.h" - -// class SfxMailModel_Impl ----------------------------------------------- -class AddressList_Impl; +// class AddressList_Impl ------------------------------------------------ +typedef String* AddressItemPtr_Impl; +typedef ::std::vector< AddressItemPtr_Impl > AddressList_Impl; + +// class SfxMailModel_Impl ----------------------------------------------- -class SFX2_DLLPUBLIC SfxMailModel +class SFX2_DLLPUBLIC SfxMailModel { public: enum MailPriority @@ -84,8 +87,8 @@ private: void ClearList( AddressList_Impl* pList ); void MakeValueList( AddressList_Impl* pList, String& rValueList ); SaveResult SaveDocumentAsFormat( const rtl::OUString& aSaveFileName, - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xFrameOrModel, - const rtl::OUString& rType, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xFrameOrModel, + const rtl::OUString& rType, rtl::OUString& rFileNamePath ); SaveResult ShowFilterOptionsDialog( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xSMGR, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > xModel, @@ -104,7 +107,7 @@ public: SEND_MAIL_CANCELLED, SEND_MAIL_ERROR }; - + SfxMailModel(); ~SfxMailModel(); @@ -112,26 +115,26 @@ public: void SetFromAddress( const String& rAddress ) { maFromAddress = rAddress; } void SetSubject( const String& rSubject ) { maSubject = rSubject; } void SetPriority( MailPriority ePrio ) { mePriority = ePrio; } - + /** attaches a document to the current attachment list, can be called more than once. * at the moment there will be a dialog for export executed for every model which is going to be attached. * - * \param sDocumentType + * \param sDocumentType The doc type to export. PDF will be at the moment only a direct export (no dialog). - * \param xModel + * \param xModel The current model to attach - * \param sAttachmentTitle + * \param sAttachmentTitle The title which will be used as attachment title * \return @see error code */ - SendMailResult AttachDocument( const ::rtl::OUString& sDocumentType, - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xFrameOrModel, + SendMailResult AttachDocument( const ::rtl::OUString& sDocumentType, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xFrameOrModel, const ::rtl::OUString& sAttachmentTitle ); SendMailResult SaveAndSend( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame, const rtl::OUString& rType ); SendMailResult Send( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame ); - + sal_Int32 GetCount() const; sal_Bool IsEmpty() const; }; @@ -139,3 +142,5 @@ public: BOOL CreateFromAddress_Impl( String& rFrom ); #endif // INCLUDED_SFX_MAILMODEL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/mgetempl.hxx b/sfx2/inc/sfx2/mgetempl.hxx index 1c775f5a4a..1c9088e827 100644 --- a/sfx2/inc/sfx2/mgetempl.hxx +++ b/sfx2/inc/sfx2/mgetempl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,9 +32,7 @@ #include <vcl/fixed.hxx> #include <vcl/lstbox.hxx> #include <svtools/stdctrl.hxx> -#ifndef _SV_MEDIT_HXX #include <svtools/svmedit.hxx> -#endif #include <sfx2/tabdlg.hxx> @@ -89,13 +88,11 @@ class SfxManageStyleSheetPage : public SfxTabPage private: friend class SfxStyleDialog; -//#if 0 // _SOLAR__PRIVATE DECL_LINK( GetFocusHdl, Edit * ); DECL_LINK( LoseFocusHdl, Edit * ); void UpdateName_Impl(ListBox *, const String &rNew); void SetDescriptionText_Impl(); -//#endif SfxManageStyleSheetPage(Window *pParent, const SfxItemSet &rAttrSet ); ~SfxManageStyleSheetPage(); @@ -118,3 +115,4 @@ protected: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/mieclip.hxx b/sfx2/inc/sfx2/mieclip.hxx index 735000aa1a..dc24589304 100644 --- a/sfx2/inc/sfx2/mieclip.hxx +++ b/sfx2/inc/sfx2/mieclip.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -61,3 +62,4 @@ public: #endif //_MIECLIP_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/minarray.hxx b/sfx2/inc/sfx2/minarray.hxx index e7bb535004..b66be5e15d 100644 --- a/sfx2/inc/sfx2/minarray.hxx +++ b/sfx2/inc/sfx2/minarray.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,7 +35,6 @@ #include <string.h> #include <tools/solar.h> #include <tools/debug.hxx> -//#include "typecast.hxx" #if defined (ALPHA) && defined (UNX) #define DEL_ARRAY( X ) @@ -527,3 +527,5 @@ public:\ }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/minfitem.hxx b/sfx2/inc/sfx2/minfitem.hxx index 16be97df92..77bafc2f4c 100644 --- a/sfx2/inc/sfx2/minfitem.hxx +++ b/sfx2/inc/sfx2/minfitem.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -76,3 +77,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/minstack.hxx b/sfx2/inc/sfx2/minstack.hxx index ded6144173..904ea374c1 100644 --- a/sfx2/inc/sfx2/minstack.hxx +++ b/sfx2/inc/sfx2/minstack.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -97,3 +98,4 @@ public: \ #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/mnuitem.hxx b/sfx2/inc/sfx2/mnuitem.hxx index 5da722138f..f8b9626260 100644 --- a/sfx2/inc/sfx2/mnuitem.hxx +++ b/sfx2/inc/sfx2/mnuitem.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -43,11 +44,7 @@ struct SfxMenuCtrlFactory; class SFX2_DLLPUBLIC SfxMenuControl: public SfxControllerItem { -//friend SvStream& operator<<( SvStream& rStream, const SfxMenuControl& rItem ); -//friend SvStream& operator>>( SvStream& rStream, SfxMenuControl& rItem ); - String aTitle; - String aHelpText; SfxVirtualMenu* pOwnMenu; SfxVirtualMenu* pSubMenu; BOOL b_ShowStrings; @@ -65,15 +62,10 @@ public: using SfxControllerItem::Bind; void Bind( SfxVirtualMenu* pOwnMenu, USHORT nId, - const String& rTitle, const String &rHelpText, - SfxBindings & ); + const String& rTitle, SfxBindings& rBindings ); void Bind( SfxVirtualMenu* pOwnMenu, USHORT nId, SfxVirtualMenu& rSubMenu, - const String& rTitle, const String &rHelpText, - SfxBindings & ); - -// SvStream & Load(SvStream &, SfxBindings*); -// SvStream & Store(SvStream &); + const String& rTitle, SfxBindings& rBindings ); String GetTitle() const; SfxVirtualMenu* GetPopupMenu() const; @@ -81,9 +73,6 @@ public: void SetOwnMenu( SfxVirtualMenu* pMenu ); void RemovePopup(); - const String& GetHelpText() const { return aHelpText; } - void SetHelpText(const String &rStr) { aHelpText = rStr; } - virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState ); @@ -108,8 +97,6 @@ public: void Select(); }; -//-------------------------------------------------------------------- - typedef SfxMenuControl* (*SfxMenuControlCtor)( USHORT nId, Menu &, SfxBindings & ); struct SfxMenuCtrlFactory @@ -126,44 +113,36 @@ struct SfxMenuCtrlFactory {} }; -// - inline String SfxMenuControl::GetTitle() const { return aTitle; } -//-------------------------------------------------------------------- - -// inline SfxVirtualMenu* SfxMenuControl::GetPopupMenu() const { return pSubMenu; } -//-------------------------------------------------------------------- #define SFX_DECL_MENU_CONTROL() \ static SfxMenuControl* CreateImpl( USHORT nId, Menu &rMenu, SfxBindings &rBindings ); \ static void RegisterControl(USHORT nSlotId = 0, SfxModule *pMod=NULL) #define SFX_IMPL_MENU_CONTROL(Class, nItemClass) \ - SfxMenuControl* __EXPORT Class::CreateImpl( USHORT nId, Menu &rMenu, SfxBindings &rBindings ) \ + SfxMenuControl* Class::CreateImpl( USHORT nId, Menu &rMenu, SfxBindings &rBindings ) \ { return new Class(nId, rMenu, rBindings); } \ void Class::RegisterControl(USHORT nSlotId, SfxModule *pMod) \ { SfxMenuControl::RegisterMenuControl( pMod, new SfxMenuCtrlFactory( \ Class::CreateImpl, TYPE(nItemClass), nSlotId ) ); } -//#if 0 // _SOLAR__PRIVATE class SfxAppMenuControl_Impl : public SfxMenuControl { PopupMenu* pMenu; ULONG m_nSymbolsStyle; - BOOL m_bWasHiContrastMode; BOOL m_bShowMenuImages; protected: - DECL_LINK( Activate, Menu * ); // Needed to support high contrast images + DECL_LINK( Activate, Menu * ); public: SFX_DECL_MENU_CONTROL(); @@ -171,6 +150,6 @@ public: ~SfxAppMenuControl_Impl(); }; -//#endif - #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/mnumgr.hxx b/sfx2/inc/sfx2/mnumgr.hxx index 63ade086ab..507c46d4dd 100644 --- a/sfx2/inc/sfx2/mnumgr.hxx +++ b/sfx2/inc/sfx2/mnumgr.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,7 +30,6 @@ #include <stdarg.h> -#ifndef _MENU_HXX //autogen //wg. MENU_APPEND !!!! #include <vcl/menu.hxx> #endif #include <tools/wintypes.hxx> @@ -89,9 +89,7 @@ public: ResMgr* GetResMgr() const { return pResMgr; } void SetPopupMenu( USHORT nId, PopupMenu *pMenu ); -//#if 0 // _SOLAR__PRIVATE void Construct_Impl( Menu* pMenu, BOOL bWithHelp ); -//#endif }; //-------------------------------------------------------------------- @@ -146,3 +144,4 @@ public: #endif // #ifndef _SFXMNUMGR_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/module.hxx b/sfx2/inc/sfx2/module.hxx index 8ccfa7a258..2629cbab7c 100644 --- a/sfx2/inc/sfx2/module.hxx +++ b/sfx2/inc/sfx2/module.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -65,9 +66,7 @@ private: sal_Bool bDummy : 1; SfxModule_Impl* pImpl; -//#if 0 // _SOLAR__PRIVATE SAL_DLLPRIVATE void Construct_Impl(); -//#endif public: TYPEINFO(); @@ -99,7 +98,6 @@ public: static FieldUnit GetCurrentFieldUnit(); FieldUnit GetFieldUnit() const; -//#if 0 // _SOLAR__PRIVATE SAL_DLLPRIVATE static SfxModuleArr_Impl& GetModules_Impl(); SAL_DLLPRIVATE static void DestroyModules_Impl(); SAL_DLLPRIVATE SfxTbxCtrlFactArr_Impl* GetTbxCtrlFactories_Impl() const; @@ -107,9 +105,8 @@ public: SAL_DLLPRIVATE SfxMenuCtrlFactArr_Impl* GetMenuCtrlFactories_Impl() const; SAL_DLLPRIVATE SfxChildWinFactArr_Impl* GetChildWinFactories_Impl() const; SAL_DLLPRIVATE ImageList* GetImageList_Impl( BOOL bBig ); - SAL_DLLPRIVATE ImageList* GetImageList_Impl( BOOL bBig, BOOL bHiContrast ); -//#endif }; #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/msg.hxx b/sfx2/inc/sfx2/msg.hxx index cb206ff5f5..80b7e1ace6 100644 --- a/sfx2/inc/sfx2/msg.hxx +++ b/sfx2/inc/sfx2/msg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -78,14 +79,14 @@ class SfxRequest; class SfxItemSet; #define SFX_EXEC_STUB( aShellClass, aExecMethod) \ - void __EXPORT SfxStub##aShellClass##aExecMethod( \ + void SfxStub##aShellClass##aExecMethod( \ SfxShell *pShell, SfxRequest& rReq) \ { \ (( aShellClass* ) pShell )->aExecMethod( rReq ); \ } #define SFX_STATE_STUB( aShellClass, aStateMethod) \ - void __EXPORT SfxStub##aShellClass##aStateMethod( \ + void SfxStub##aShellClass##aStateMethod( \ SfxShell *pShell, SfxItemSet& rSet) \ { \ (( aShellClass* ) pShell )->aStateMethod( rSet ); \ @@ -112,7 +113,7 @@ enum SfxSlotKind struct SfxTypeAttrib { USHORT nAID; - const char __FAR_DATA* pName; + const char* pName; }; struct SfxType @@ -225,8 +226,8 @@ SFX_DECL_TYPE(18); // for SvxSearchItem } #define SFX_SLOTMAP_NONE(ShellClass) \ - static SfxFormalArgument __FAR_DATA a##ShellClass##Args_Impl[1]; \ - static SfxSlot __FAR_DATA a##ShellClass##Slots_Impl[] = \ + static SfxFormalArgument a##ShellClass##Args_Impl[1]; \ + static SfxSlot a##ShellClass##Slots_Impl[] = \ { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } #define SFX_ARGUMENT( ArgSlotId, ArgName, ArgTypeId ) \ @@ -239,7 +240,7 @@ class SfxPoolItem; struct SfxFormalArgument { const SfxType* pType; // Typ des Parameters (SfxPoolItem Subklasse) - const char __FAR_DATA* pName; // Name des Parameters + const char* pName; // Name des Parameters USHORT nSlotId;// Slot-Id zur Identifikation des Parameters const TypeId& Type() const @@ -265,8 +266,8 @@ public: SfxStateFunc fnState; // Funktion f"ur Status const SfxType* pType; // SfxPoolItem-Typ (Status) - const char __FAR_DATA* pName; // Name des Slots - const char __FAR_DATA* pMethodName; // Name der Method falls anders + const char* pName; // Name des Slots + const char* pMethodName; // Name der Method falls anders const SfxSlot* pLinkedSlot; // Master-Slot f"ur Enum-Werte const SfxSlot* pNextSlot; // mit derselben Status-Methode @@ -275,7 +276,7 @@ public: USHORT nArgDefCount; // Anzahl der formalen Argumente long nDisableFlags; // DisableFlags, die vorhanden sein // m"ussen, damit der Slot enabled ist - const char __FAR_DATA* pUnoName; // UnoName des Slots + const char* pUnoName; // UnoName des Slots public: @@ -347,3 +348,5 @@ inline USHORT SfxSlot::GetGroupId() const } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/msgpool.hxx b/sfx2/inc/sfx2/msgpool.hxx index 71b5c76ab0..692c5a2f37 100644 --- a/sfx2/inc/sfx2/msgpool.hxx +++ b/sfx2/inc/sfx2/msgpool.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -93,3 +94,4 @@ inline const SfxSlot* SfxSlotPool::FirstSlot() #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/navigat.hxx b/sfx2/inc/sfx2/navigat.hxx index a391d06ccc..34bcc891cb 100644 --- a/sfx2/inc/sfx2/navigat.hxx +++ b/sfx2/inc/sfx2/navigat.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -62,3 +63,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/new.hxx b/sfx2/inc/sfx2/new.hxx index 9b2c4d1c58..62563a6536 100644 --- a/sfx2/inc/sfx2/new.hxx +++ b/sfx2/inc/sfx2/new.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,18 +31,10 @@ #include "sal/config.h" #include "sfx2/dllapi.h" -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif -#ifndef _LSTBOX_HXX //autogen #include <vcl/lstbox.hxx> -#endif -#ifndef _EDIT_HXX //autogen #include <vcl/edit.hxx> -#endif -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif #include <sfx2/basedlgs.hxx> //========================================================================= @@ -70,13 +63,6 @@ protected: virtual void Paint( const Rectangle& rRect ); virtual void DataChanged( const DataChangedEvent& rDCEvt ); - /** state whether a system setting for high contrast should be evaluated - and taken into account for this window. - - The default implementation uses the accessibility option IsForDrawings - */ - virtual bool UseHighContrastSetting() const; - public: SfxPreviewWin( Window* pParent, const ResId& rResId, @@ -110,3 +96,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/newstyle.hxx b/sfx2/inc/sfx2/newstyle.hxx index ac0c148e3f..b7fa817b78 100644 --- a/sfx2/inc/sfx2/newstyle.hxx +++ b/sfx2/inc/sfx2/newstyle.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,9 +31,7 @@ #include "sal/config.h" #include "sfx2/dllapi.h" -#ifndef _SV_BUTTON_HXX #include <vcl/button.hxx> -#endif #include <vcl/msgbox.hxx> #include <vcl/combobox.hxx> #include <vcl/dialog.hxx> @@ -51,10 +50,8 @@ private: QueryBox aQueryOverwriteBox; SfxStyleSheetBasePool& rPool; -//#if 0 // _SOLAR__PRIVATE DECL_DLLPRIVATE_LINK( OKHdl, Control * ); DECL_DLLPRIVATE_LINK( ModifyHdl, ComboBox * ); -//#endif public: SfxNewStyleDlg( Window* pParent, SfxStyleSheetBasePool& ); @@ -65,3 +62,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/objface.hxx b/sfx2/inc/sfx2/objface.hxx index 82c80f7111..e7716f99c8 100644 --- a/sfx2/inc/sfx2/objface.hxx +++ b/sfx2/inc/sfx2/objface.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,9 +32,7 @@ #include "sfx2/dllapi.h" #include "sal/types.h" #include <tools/string.hxx> -#ifndef _RESID_HXX //autogen #include <tools/resid.hxx> -#endif #include <sfx2/msg.hxx> @@ -109,12 +108,10 @@ public: void Register( SfxModule* ); -//#if 0 // _SOLAR__PRIVATE SAL_DLLPRIVATE int ContainsSlot_Impl( const SfxSlot *pSlot ) const { return pSlot >= pSlots && pSlot < pSlots + Count(); } SAL_DLLPRIVATE ResMgr* GetResManager_Impl() const { return aNameResId.GetResMgr(); } -//#endif }; //-------------------------------------------------------------------- @@ -135,7 +132,6 @@ inline SfxSlot* SfxInterface::operator[]( USHORT nPos ) const return nPos < nCount? pSlots+nPos: 0; } -//#if 0 // _SOLAR__PRIVATE class SfxIFConfig_Impl { friend class SfxInterface; @@ -149,6 +145,7 @@ public: void RegisterObjectBar( USHORT, const ResId&, sal_uInt32 nFeature, const String* pST=0 ); USHORT GetType(); }; -//#endif #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/objitem.hxx b/sfx2/inc/sfx2/objitem.hxx index ac1d0663a6..d3988fd76c 100644 --- a/sfx2/inc/sfx2/objitem.hxx +++ b/sfx2/inc/sfx2/objitem.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -52,3 +53,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx index f6efccbb60..e2013d4312 100644 --- a/sfx2/inc/sfx2/objsh.hxx +++ b/sfx2/inc/sfx2/objsh.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -52,7 +53,6 @@ // include something else //________________________________________________________________________________________________________________ -//#if 0 // _SOLAR__PRIVATE #include <vcl/timer.hxx> //#endif #include <svl/poolitem.hxx> @@ -127,6 +127,9 @@ namespace com { namespace sun { namespace star { namespace document { class XDocumentProperties; } + namespace lang { + class XComponent; + } } } } typedef sal_uInt32 SfxObjectShellFlags; @@ -222,10 +225,6 @@ private: SAL_DLLPRIVATE sal_Bool SaveTo_Impl(SfxMedium &rMedium, const SfxItemSet* pSet ); -//REMOVE sal_Bool SaveInfoAndConfig_Impl( SvStorageRef pNewStg ); - -//#endif - protected: SfxObjectShell(SfxObjectCreateMode); SfxObjectShell( const sal_uInt64 i_nCreationFlags ); // see sfxmodelfactory.hxx @@ -307,10 +306,8 @@ public: void SetSharedXMLFlag( sal_Bool bFlag ) const; sal_Bool HasSharedXMLFlagSet() const; -//#if 0 // _SOLAR__PRIVATE SAL_DLLPRIVATE void SetModalMode_Impl(sal_Bool bModal=sal_True); SAL_DLLPRIVATE void SetMacroMode_Impl(sal_Bool bModal=sal_True); -//#endif void ResetError(); sal_uInt32 GetError() const; @@ -342,6 +339,16 @@ public: virtual sal_Bool SwitchPersistance( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage ); virtual void UpdateLinks(); + /** + * Called when the Options dialog is dismissed with the OK button, to + * handle potentially conflicting option settings. + */ + virtual void CheckConfigOptions(); + sal_Bool IsConfigOptionsChecked() const; + void SetConfigOptionsChecked( sal_Bool bChecked ); + + // called for a few slots like SID_SAVE[AS]DOC, SID_PRINTDOC[DIRECT], derived classes may abort the action + virtual sal_Bool QuerySlotExecutable( USHORT nSlotId ); // called for a few slots like SID_SAVE[AS]DOC, SID_PRINTDOC[DIRECT], derived classes may abort the action virtual sal_Bool QuerySlotExecutable( USHORT nSlotId ); @@ -354,7 +361,7 @@ public: sal_Bool SaveCompletedChildren( sal_Bool bSuccess ); sal_Bool InsertFrom( SfxMedium &rMedium ); - sal_Bool ImportFrom( SfxMedium &rMedium ); + virtual sal_Bool ImportFrom( SfxMedium &rMedium ); sal_Bool ExportTo( SfxMedium &rMedium ); // xmlsec05, check with SFX team @@ -513,6 +520,9 @@ public: const String& rMimeType, const ::com::sun::star::uno::Any & rValue ); virtual ::sfx2::SvLinkSource* DdeCreateLinkSource( const String& rItem ); + virtual void ReconnectDdeLink(SfxObjectShell& rServer); + + static void ReconnectDdeLinks(SfxObjectShell& rServer); // Contents virtual SfxStyleSheetBasePool* GetStyleSheetPool(); @@ -542,36 +552,24 @@ public: virtual void SetOrganizerSearchMask( SfxStyleSheetBasePool* ) const; + virtual sal_uInt16 GetContentCount( sal_uInt16 nIdx1 = INDEX_IGNORE ); - virtual sal_uInt16 GetContentCount( - sal_uInt16 nIdx1 = INDEX_IGNORE, - sal_uInt16 nIdx2 = INDEX_IGNORE ); virtual sal_Bool CanHaveChilds( sal_uInt16 nIdx1, - sal_uInt16 nIdx2 = INDEX_IGNORE ); - virtual void GetContent( String &, - Bitmap &rClosedBitmap, - Bitmap &rOpenedBitmap, - sal_Bool &bCanDelete, - sal_uInt16 nPos, - sal_uInt16 nIdx1, - sal_uInt16 nIdx2 = INDEX_IGNORE ); + sal_uInt16 nIdx2 = INDEX_IGNORE + ); virtual void GetContent( String &, Bitmap &rClosedBitmap, Bitmap &rOpenedBitmap, - BmpColorMode eColorMode, sal_Bool &bCanDelete, sal_uInt16 nPos, - sal_uInt16 nIdx1, - sal_uInt16 nIdx2 = INDEX_IGNORE ); - - virtual void TriggerHelpPI( - sal_uInt16 nIdx1, sal_uInt16 nIdx2, sal_uInt16 nIdx3); + sal_uInt16 nIdx1 + ); - virtual Bitmap GetStyleFamilyBitmap(SfxStyleFamily eFamily ); + virtual void TriggerHelpPI( sal_uInt16 nIdx1, sal_uInt16 nIdx2 ); - virtual Bitmap GetStyleFamilyBitmap(SfxStyleFamily eFamily, BmpColorMode eColorMode ); + virtual Bitmap GetStyleFamilyBitmap(SfxStyleFamily eFamily); virtual sal_Bool Insert( SfxObjectShell &rSource, sal_uInt16 nSourceIdx1, @@ -599,10 +597,6 @@ public: // F"ur Docs, die zum Formatieren die Viewgr"o\se // ben"otigen virtual SfxObjectShell* GetObjectShell(); - //void SetBaseURL( const String& rURL ); - //const String& GetBaseURL() const; - //const String& GetBaseURLForSaving() const; - //void SetEmptyBaseURL(); virtual SfxFrame* GetSmartSelf( SfxFrame* pSelf, SfxMedium& rMedium ); @@ -620,6 +614,9 @@ public: static SfxObjectShell* CreateObject( const String& rServiceName, SfxObjectCreateMode = SFX_CREATE_MODE_STANDARD ); static SfxObjectShell* CreateObjectByFactoryName( const String& rURL, SfxObjectCreateMode = SFX_CREATE_MODE_STANDARD ); static SfxObjectShell* CreateAndLoadObject( const SfxItemSet& rSet, SfxFrame* pFrame=0 ); + static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > + CreateAndLoadComponent( const SfxItemSet& rSet, SfxFrame* pFrame = NULL ); + static SfxObjectShell* GetShellFromComponent( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xComp ); static String GetServiceNameFromFactory( const String& rFact ); BOOL IsInPlaceActive(); BOOL IsUIActive(); @@ -643,7 +640,6 @@ public: ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > GetStorage(); -//REMOVE void SetFileName( const ::rtl::OUString& ); SvGlobalName GetClassName() const; // comphelper::IEmbeddedHelper @@ -704,9 +700,9 @@ public: // ================================= -//#if 0 // _SOLAR__PRIVATE + // ================================= - SAL_DLLPRIVATE ::boost::shared_ptr<GDIMetaFile> CreatePreviewMetaFile_Impl( sal_Bool bFullContent, sal_Bool bHighContrast ) const; + SAL_DLLPRIVATE ::boost::shared_ptr<GDIMetaFile> CreatePreviewMetaFile_Impl( sal_Bool bFullContent ) const; SAL_DLLPRIVATE sal_Bool IsOwnStorageFormat_Impl(const SfxMedium &) const; @@ -792,8 +788,8 @@ public: SAL_DLLPRIVATE sal_uInt16 ImplGetSignatureState( sal_Bool bScriptingContent = FALSE ); SAL_DLLPRIVATE ::com::sun::star::uno::Sequence< ::com::sun::star::security::DocumentSignatureInformation > - ImplAnalyzeSignature( - sal_Bool bScriptingContent, + ImplAnalyzeSignature( + sal_Bool bScriptingContent, const ::com::sun::star::uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures >& xSigner = ::com::sun::star::uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures >() ); @@ -806,8 +802,6 @@ public: 0x9eaba5c3, 0xb232, 0x4309, \ 0x84, 0x5f, 0x5f, 0x15, 0xea, 0x50, 0xd0, 0x74 -//#if 0 // _SOLAR__PRIVATE - struct ModifyBlocker_Impl { SfxObjectShell* pPersist; @@ -824,7 +818,7 @@ public: pPersist->EnableSetModified( bWasEnabled ); } }; -//#endif + //-------------------------------------------------------------------- #ifndef SFX_DECL_OBJECTSHELL_DEFINED @@ -848,7 +842,6 @@ public: SfxObjectShell* pSh ); virtual void Timeout(); }; -//#endif //------------------------------------------------------------------------- @@ -875,8 +868,8 @@ public: virtual int operator==( const SfxPoolItem& ) const; virtual String GetValueText() const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; - virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + virtual bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; + virtual bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); SfxObjectShell* GetObjectShell() const { return pObjSh; } @@ -884,3 +877,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/objuno.hxx b/sfx2/inc/sfx2/objuno.hxx index f6ea2aad1b..98618cc1d7 100644 --- a/sfx2/inc/sfx2/objuno.hxx +++ b/sfx2/inc/sfx2/objuno.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -190,3 +191,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/opengrf.hxx b/sfx2/inc/sfx2/opengrf.hxx index 09f6752a27..3f716f8650 100644 --- a/sfx2/inc/sfx2/opengrf.hxx +++ b/sfx2/inc/sfx2/opengrf.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -65,3 +66,4 @@ private: #endif // _SVX_OPENGRF_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/passwd.hxx b/sfx2/inc/sfx2/passwd.hxx index 4ca2dd8149..ae1ea12cff 100644 --- a/sfx2/inc/sfx2/passwd.hxx +++ b/sfx2/inc/sfx2/passwd.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -67,6 +68,9 @@ private: HelpButton maHelpBtn; USHORT mnMinLen; + String maMinLenPwdStr; + String maEmptyPwdStr; + String maMainPwdStr; USHORT mnExtras; bool mbAsciiOnly; @@ -95,3 +99,4 @@ public: #endif // #ifndef _SFX_PASSWD_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/printer.hxx b/sfx2/inc/sfx2/printer.hxx index 37986794eb..d437a10ff4 100644 --- a/sfx2/inc/sfx2/printer.hxx +++ b/sfx2/inc/sfx2/printer.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,9 +31,7 @@ #include "sal/config.h" #include "sfx2/dllapi.h" #include "sal/types.h" -#ifndef _PRINT_HXX //autogen #include <vcl/print.hxx> -#endif class SfxTabPage; class SfxItemSet; @@ -81,3 +80,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/printopt.hxx b/sfx2/inc/sfx2/printopt.hxx index 62cc555d4f..68272a58d1 100644 --- a/sfx2/inc/sfx2/printopt.hxx +++ b/sfx2/inc/sfx2/printopt.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,14 +32,10 @@ #include "sal/config.h" #include "sfx2/dllapi.h" #include "sal/types.h" -#ifndef _SV_BUTTON_HXX #include <vcl/button.hxx> -#endif #include <vcl/field.hxx> #include <vcl/fixed.hxx> -#ifndef _SV_BUTTON_HXX //autogen wg. FixedText #include <vcl/button.hxx> -#endif #include <vcl/lstbox.hxx> #include <vcl/print.hxx> @@ -104,9 +101,8 @@ private: SAL_DLLPRIVATE void ImplUpdateControls( const PrinterOptions* pCurrentOptions ); SAL_DLLPRIVATE void ImplSaveControls( PrinterOptions* pCurrentOptions ); - // --> OD 2008-06-25 #i63982# + // #i63982# SAL_DLLPRIVATE void ImplSetAccessibleNames(); - // <-- protected: @@ -126,10 +122,6 @@ public: static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet ); }; -// ------------------------------- -// - TransparencyPrintWarningBox - -// ------------------------------- - class TransparencyPrintWarningBox : public ModalDialog { private: @@ -153,3 +145,4 @@ public: #endif // #ifndef _SFX_PRINTOPT_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/prnmon.hxx b/sfx2/inc/sfx2/prnmon.hxx index 038f9d188a..fc881abff4 100644 --- a/sfx2/inc/sfx2/prnmon.hxx +++ b/sfx2/inc/sfx2/prnmon.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -102,3 +103,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/progress.hxx b/sfx2/inc/sfx2/progress.hxx index e9681d5de5..4ebc34a7d5 100644 --- a/sfx2/inc/sfx2/progress.hxx +++ b/sfx2/inc/sfx2/progress.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -79,13 +80,12 @@ public: static void EnterLock(); static void LeaveLock(); -//#if 0 // _SOLAR__PRIVATE DECL_DLLPRIVATE_STATIC_LINK( SfxProgress, SetStateHdl, PlugInLoadStatus* ); DECL_DLLPRIVATE_STATIC_LINK( SfxProgress, DefaultBindingProgress, SvProgressArg* ); - SAL_DLLPRIVATE FASTBOOL StatusBarManagerGone_Impl(SfxStatusBarManager*pStb); + SAL_DLLPRIVATE bool StatusBarManagerGone_Impl(SfxStatusBarManager*pStb); SAL_DLLPRIVATE const String& GetStateText_Impl() const; -//#endif }; #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/querystatus.hxx b/sfx2/inc/sfx2/querystatus.hxx index 15252453ac..6dd771f424 100644 --- a/sfx2/inc/sfx2/querystatus.hxx +++ b/sfx2/inc/sfx2/querystatus.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -59,3 +60,5 @@ class SFX2_DLLPUBLIC SfxQueryStatus }; #endif // _SFXQUERYSTATUS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/request.hxx b/sfx2/inc/sfx2/request.hxx index 6893725a22..c2d95ab6f7 100644 --- a/sfx2/inc/sfx2/request.hxx +++ b/sfx2/inc/sfx2/request.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -61,7 +62,6 @@ friend struct SfxRequest_Impl; SfxRequest_Impl* pImp; //--------------------------------------------------------------------- -//#if 0 // _SOLAR__PRIVATE public: SAL_DLLPRIVATE void Record_Impl( SfxShell &rSh, const SfxSlot &rSlot, com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorder > xRecorder, @@ -69,7 +69,6 @@ public: private: SAL_DLLPRIVATE void Done_Impl( const SfxItemSet *pSet ); -//#endif //--------------------------------------------------------------------- public: @@ -96,7 +95,7 @@ public: static const SfxPoolItem* GetItem( const SfxItemSet*, USHORT nSlotId, bool bDeep = false, TypeId aType = 0 ); - const SfxPoolItem* GetArg( USHORT nSlotId, FASTBOOL bDeep = FALSE, TypeId aType = 0 ) const; + const SfxPoolItem* GetArg( USHORT nSlotId, bool bDeep = false, TypeId aType = 0 ) const; void ReleaseArgs(); void SetReturnValue(const SfxPoolItem &); const SfxPoolItem* GetReturnValue() const; @@ -105,7 +104,7 @@ public: static com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorder > GetMacroRecorder( SfxViewFrame* pFrame=NULL ); static BOOL HasMacroRecorder( SfxViewFrame* pFrame=NULL ); USHORT GetCallMode() const; - FASTBOOL IsRecording() const; + bool IsRecording() const; void AllowRecording( BOOL ); BOOL AllowsRecording() const; BOOL IsAPI() const; @@ -119,7 +118,7 @@ public: void Ignore(); void Cancel(); BOOL IsCancelled() const; - void Done(const SfxItemSet &, FASTBOOL bKeep = TRUE ); + void Done(const SfxItemSet &, bool bKeep = true ); void ForgetAllArgs(); @@ -137,3 +136,5 @@ private: SfxRequest::GetItem( pArgs, nSlotId, bDeep, TYPE(ItemType) ) #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/securitypage.hxx b/sfx2/inc/sfx2/securitypage.hxx index ade48ac8f4..65adfb9c84 100755 --- a/sfx2/inc/sfx2/securitypage.hxx +++ b/sfx2/inc/sfx2/securitypage.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -56,3 +57,4 @@ public: #endif // #ifndef _SECURITYPAGE_HXX_ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/sfxbasecontroller.hxx b/sfx2/inc/sfx2/sfxbasecontroller.hxx index ebabd29de5..720726900d 100644 --- a/sfx2/inc/sfx2/sfxbasecontroller.hxx +++ b/sfx2/inc/sfx2/sfxbasecontroller.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -415,3 +416,5 @@ private: } ; // class SfxBaseController #endif // _SFX_SFXBASECONTROLLER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/sfxbasemodel.hxx b/sfx2/inc/sfx2/sfxbasemodel.hxx index d29b0a1b42..64c4aaac68 100644 --- a/sfx2/inc/sfx2/sfxbasemodel.hxx +++ b/sfx2/inc/sfx2/sfxbasemodel.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1519,6 +1520,7 @@ protected: /* returns true if the document signatures are valid, otherwise false */ sal_Bool hasValidSignatures() const; + void setDocumentProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentProperties >& ); //________________________________________________________________________________________________________ // private methods //________________________________________________________________________________________________________ @@ -1607,3 +1609,5 @@ private: #undef css #endif // _SFX_SFXBASEMODEL_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/sfxdefs.hxx b/sfx2/inc/sfx2/sfxdefs.hxx index a3653ef65b..eafbef21d4 100644 --- a/sfx2/inc/sfx2/sfxdefs.hxx +++ b/sfx2/inc/sfx2/sfxdefs.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -37,3 +38,4 @@ #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/sfxdlg.hxx b/sfx2/inc/sfx2/sfxdlg.hxx index cab0c677ca..5a88cb76f4 100644 --- a/sfx2/inc/sfx2/sfxdlg.hxx +++ b/sfx2/inc/sfx2/sfxdlg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -158,3 +159,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/sfxhelp.hxx b/sfx2/inc/sfx2/sfxhelp.hxx index ff08edbd66..d7e7dc38bd 100644 --- a/sfx2/inc/sfx2/sfxhelp.hxx +++ b/sfx2/inc/sfx2/sfxhelp.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -70,3 +71,4 @@ public: #endif // #ifndef _SFX_HELP_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/sfxhtml.hxx b/sfx2/inc/sfx2/sfxhtml.hxx index f039b8bd0e..6a24421356 100644 --- a/sfx2/inc/sfx2/sfxhtml.hxx +++ b/sfx2/inc/sfx2/sfxhtml.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -98,12 +99,6 @@ protected: void StartFileDownload( const String& rURL, int nToken, SfxObjectShell *pSh=0 ); - // Ermittelnd des MIME-Types eines zuvor downloadeten Files. Kann nur - // unmittelbar vor FinishFileDownload aufgerufen werden, nie aber - // danach. - - BOOL GetFileDownloadMIME( String& rMime ); - // Beenden eines asynchronen File-Downloads. Gibt TRUE zurueck, wenn // der Download geklappt hat. Das gelesene File befindet sich dann in // dem uebergeben String. @@ -131,3 +126,5 @@ inline BOOL SfxHTMLParser::ParseAreaOptions(ImageMap * pImageMap, const String& #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/sfxmodelfactory.hxx b/sfx2/inc/sfx2/sfxmodelfactory.hxx index ac22ef41df..597d3e9c54 100644 --- a/sfx2/inc/sfx2/sfxmodelfactory.hxx +++ b/sfx2/inc/sfx2/sfxmodelfactory.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -73,3 +74,5 @@ namespace sfx2 //........................................................................ #endif // SFX2_SFXMODELFACTORY_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/sfxresid.hxx b/sfx2/inc/sfx2/sfxresid.hxx index 095f7e1077..63e4868f3d 100644 --- a/sfx2/inc/sfx2/sfxresid.hxx +++ b/sfx2/inc/sfx2/sfxresid.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -54,3 +55,5 @@ public: #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc index d6ab79d2a1..1239a9ed76 100644 --- a/sfx2/inc/sfx2/sfxsids.hrc +++ b/sfx2/inc/sfx2/sfxsids.hrc @@ -75,6 +75,7 @@ #define SID_VERSION_VISIBLE (SID_SFX_START + 313) #define SID_PASTE_UNFORMATTED (SID_SFX_START + 314) +#define SID_DIALOG_RETURN (SID_SFX_START + 318) #define SID_PRINTER_NOTFOUND_WARN (SID_SFX_START + 320) #define SID_PRINTER_USETHREAD (SID_SFX_START + 321) #define SID_PRINTER_NAME (SID_SFX_START + 322) @@ -126,7 +127,8 @@ #define SID_HELP_ZOOMOUT (SID_SFX_START + 418) #define SID_HELP_HELPFILEBOX (SID_SFX_START + 419) #define SID_HELP_HELPFILEBOX_SELECTED (SID_SFX_START + 420) -#define SID_HELP_SUPPORTPAGE (SID_SFX_START + 1683) +#define SID_SHOW_LICENSE (SID_SFX_START + 1683) +#define SID_SHOW_CREDITS (SID_SFX_START + 1711) #define SID_HELP_TUTORIALS (SID_SFX_START + 1695) // default-ids for document @@ -368,6 +370,7 @@ #define SID_OPENCOPY (SID_SFX_START + 674) #define SID_SOURCEVIEW (SID_SFX_START + 675) #define SID_DOC_STARTPRESENTATION (SID_SFX_START + 695) +#define SID_DDE_RECONNECT_ONLOAD (SID_SFX_START + 696) #define SID_PLUGFRAMEARG (SID_SFX_START + 666) #define SID_NEWWINDOWFOREDIT (SID_SFX_START + 667) diff --git a/sfx2/inc/sfx2/sfxstatuslistener.hxx b/sfx2/inc/sfx2/sfxstatuslistener.hxx index 6a44d24f4a..1a4d68d944 100644 --- a/sfx2/inc/sfx2/sfxstatuslistener.hxx +++ b/sfx2/inc/sfx2/sfxstatuslistener.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -91,3 +92,5 @@ class SFX2_DLLPUBLIC SfxStatusListener : }; #endif // _SFXSTATUSLISTENER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/sfxuno.hxx b/sfx2/inc/sfx2/sfxuno.hxx index 0b441b2f0f..06c81df1f2 100644 --- a/sfx2/inc/sfx2/sfxuno.hxx +++ b/sfx2/inc/sfx2/sfxuno.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -56,9 +57,7 @@ //________________________________________________________________________________________________________________________ #include <osl/mutex.hxx> -#ifndef _RTL_USTRING_HXX #include <rtl/ustring.hxx> -#endif //________________________________________________________________________________________________________________________ // defines for namespaces ! @@ -609,3 +608,5 @@ bool GetEncryptionData_Impl( const SfxItemSet* pSet, ::com::sun::star::uno::Sequ } #endif // _SFX_SFXUNO_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/shell.hxx b/sfx2/inc/sfx2/shell.hxx index 9d2ef73d5f..ab8afd59af 100644 --- a/sfx2/inc/sfx2/shell.hxx +++ b/sfx2/inc/sfx2/shell.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -254,7 +255,7 @@ public: virtual void ApplyItemSet( USHORT nId, const SfxItemSet& rSet ); #ifndef _SFXSH_HXX - SAL_DLLPRIVATE FASTBOOL CanExecuteSlot_Impl( const SfxSlot &rSlot ); + SAL_DLLPRIVATE bool CanExecuteSlot_Impl( const SfxSlot &rSlot ); SAL_DLLPRIVATE void DoActivate_Impl( SfxViewFrame *pFrame, BOOL bMDI); SAL_DLLPRIVATE void DoDeactivate_Impl( SfxViewFrame *pFrame, BOOL bMDI); #endif @@ -300,12 +301,12 @@ inline void SfxShell::SetPool //===================================================================== -#define SFX_ARGUMENTMAP(ShellClass) static SfxFormalArgument __FAR_DATA a##ShellClass##Args_Impl[] = +#define SFX_ARGUMENTMAP(ShellClass) static SfxFormalArgument a##ShellClass##Args_Impl[] = -#define SFX_SLOTMAP(ShellClass) static SfxFormalArgument __FAR_DATA a##ShellClass##Args_Impl[1]; \ - static SfxSlot __FAR_DATA a##ShellClass##Slots_Impl[] = +#define SFX_SLOTMAP(ShellClass) static SfxFormalArgument a##ShellClass##Args_Impl[1]; \ + static SfxSlot a##ShellClass##Slots_Impl[] = -#define SFX_SLOTMAP_ARG(ShellClass) static SfxSlot __FAR_DATA a##ShellClass##Slots_Impl[] = +#define SFX_SLOTMAP_ARG(ShellClass) static SfxSlot a##ShellClass##Slots_Impl[] = #define SFX_DECL_INTERFACE(nId) \ static SfxInterface* pInterface; \ @@ -322,7 +323,7 @@ inline void SfxShell::SetPool \ SfxInterface* Class::pInterface = 0; \ const SfxFormalArgument* Class::pSfxFormalArgs_Impl = a##Class##Args_Impl;\ - SfxInterface* __EXPORT Class::GetStaticInterface() \ + SfxInterface* Class::GetStaticInterface() \ { \ if ( !pInterface ) \ { \ @@ -391,3 +392,4 @@ inline void SfxShell::SetPool #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/signaturestate.hxx b/sfx2/inc/sfx2/signaturestate.hxx index 0bdfeef560..cf1d958fcb 100644 --- a/sfx2/inc/sfx2/signaturestate.hxx +++ b/sfx2/inc/sfx2/signaturestate.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -42,3 +43,5 @@ #define SIGNATURESTATE_SIGNATURES_PARTIAL_OK (sal_Int16)5 #endif // SFX2_SIGNATURESTATE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/stbitem.hxx b/sfx2/inc/sfx2/stbitem.hxx index 94261e54ca..a2feb6127e 100644 --- a/sfx2/inc/sfx2/stbitem.hxx +++ b/sfx2/inc/sfx2/stbitem.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -138,7 +139,7 @@ public: static void RegisterControl(USHORT nSlotId = 0, SfxModule *pMod=NULL) #define SFX_IMPL_STATUSBAR_CONTROL(Class, nItemClass) \ - SfxStatusBarControl* __EXPORT Class::CreateImpl( USHORT nSlotId, USHORT nId, StatusBar &rStb ) \ + SfxStatusBarControl* Class::CreateImpl( USHORT nSlotId, USHORT nId, StatusBar &rStb ) \ { return new Class( nSlotId, nId, rStb ); } \ void Class::RegisterControl(USHORT nSlotId, SfxModule *pMod) \ { SfxStatusBarControl::RegisterStatusBarControl( pMod, new SfxStbCtrlFactory( \ @@ -146,3 +147,5 @@ public: #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/styfitem.hxx b/sfx2/inc/sfx2/styfitem.hxx index f8dff35c4d..e15e63ac6a 100644 --- a/sfx2/inc/sfx2/styfitem.hxx +++ b/sfx2/inc/sfx2/styfitem.hxx @@ -1,10 +1,11 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2000, 2010 Oracle and/or its affiliates. * - * OpenOffice.org - a multi-platform office productivity suite + * Copyright 2000, 2010 Oracle and/or its affiliates. * * This file is part of OpenOffice.org. * @@ -30,28 +31,18 @@ #include "sal/config.h" #include "sfx2/dllapi.h" -#ifndef _BITMAP_HXX //autogen #include <vcl/bitmap.hxx> -#endif -#ifndef _IMAGE_HXX //autogen #include <vcl/image.hxx> -#endif #include <tools/list.hxx> -#ifndef _RC_HXX //autogen #include <tools/rc.hxx> -#endif #include <rsc/rscsfx.hxx> +#include <vector> -#ifndef _SFX_STYFITEM_HXX_NOLIST struct SfxFilterTupel { String aName; USHORT nFlags; }; - -DECLARE_LIST(SfxStyleFilter, SfxFilterTupel*) -#else -typedef List SfxStyleFilter; -#endif +typedef ::std::vector< SfxFilterTupel* > SfxStyleFilter; // CLASS ----------------------------------------------------------------- @@ -80,11 +71,7 @@ public: void SetImage( const Image& _rImg ) { aImage = _rImg; } }; -//#if 0 // _SOLAR__PRIVATE -DECLARE_LIST(SfxStyleFamilyList, SfxStyleFamilyItem*) -//#else -//typedef List SfxStyleFamilyList; -//#endif +typedef ::std::vector< SfxStyleFamilyItem* > SfxStyleFamilyList; class SFX2_DLLPUBLIC SfxStyleFamilies: public Resource { @@ -98,11 +85,11 @@ public: SfxStyleFamilies( ) {}; ~SfxStyleFamilies(); - USHORT Count() const - { return (USHORT)aEntryList.Count(); } + size_t size() const + { return aEntryList.size(); } - const SfxStyleFamilyItem* GetObject(ULONG nIdx) const - { return (SfxStyleFamilyItem*)aEntryList.GetObject(nIdx); } + const SfxStyleFamilyItem* at(size_t nIdx) const + { return (SfxStyleFamilyItem*)(aEntryList.empty() ? NULL : aEntryList[nIdx]); } /** updates the images of all single SfxStyleFamilyItems with new images from the given resource @@ -114,8 +101,9 @@ public: @return <TRUE/> if an image list for the requested mode could be found in the given resource. */ - sal_Bool updateImages( const ResId& _rId, const BmpColorMode _eMode ); + sal_Bool updateImages( const ResId& _rId ); }; #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/styledlg.hxx b/sfx2/inc/sfx2/styledlg.hxx index d4f49c8184..05d05baa3c 100644 --- a/sfx2/inc/sfx2/styledlg.hxx +++ b/sfx2/inc/sfx2/styledlg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -38,9 +39,7 @@ class SFX2_DLLPUBLIC SfxStyleDialog: public SfxTabDialog { private: SfxStyleSheetBase* pStyle; -//#if 0 // _SOLAR__PRIVATE DECL_DLLPRIVATE_LINK( CancelHdl, Button * ); -//#endif protected: virtual const SfxItemSet* GetRefreshedSet(); @@ -59,3 +58,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/tabdlg.hxx b/sfx2/inc/sfx2/tabdlg.hxx index 6f84e0cc15..8afb111c7f 100644 --- a/sfx2/inc/sfx2/tabdlg.hxx +++ b/sfx2/inc/sfx2/tabdlg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -110,7 +111,6 @@ friend class SfxTabDialogController; BOOL bItemsReset; BOOL bFmt; -//#if 0 // _SOLAR__PRIVATE DECL_DLLPRIVATE_LINK( ActivatePageHdl, TabControl * ); DECL_DLLPRIVATE_LINK( DeactivatePageHdl, TabControl * ); DECL_DLLPRIVATE_LINK( OkHdl, Button * ); @@ -119,7 +119,6 @@ friend class SfxTabDialogController; DECL_DLLPRIVATE_LINK( UserHdl, Button * ); DECL_DLLPRIVATE_LINK( CancelHdl, Button * ); SAL_DLLPRIVATE void Init_Impl(BOOL, const String *); -//#endif protected: virtual short Ok(); @@ -226,10 +225,8 @@ public: void SetApplyHandler(const Link& _rHdl); Link GetApplyHandler() const; -//#if 0 // _SOLAR__PRIVATE SAL_DLLPRIVATE void Start_Impl(); SAL_DLLPRIVATE BOOL OK_Impl() { return PrepareLeaveCurrentPage(); } -//#endif }; END_NAMESPACE_LAYOUT_SFX_TABDIALOG @@ -305,7 +302,7 @@ public: String GetUserData() { return aUserString; } virtual void FillUserData(); virtual BOOL IsReadOnly() const; - virtual void PageCreated (SfxAllItemSet aSet); //add CHINA001 + virtual void PageCreated (SfxAllItemSet aSet); static const SfxPoolItem* GetItem( const SfxItemSet& rSet, USHORT nSlot, sal_Bool bDeep = sal_True ); void SetFrame(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame); @@ -316,3 +313,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/tbxctrl.hxx b/sfx2/inc/sfx2/tbxctrl.hxx index 8bd07c4f9d..b2e9161d36 100644 --- a/sfx2/inc/sfx2/tbxctrl.hxx +++ b/sfx2/inc/sfx2/tbxctrl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,15 +32,9 @@ #include "sfx2/dllapi.h" #include "sal/types.h" #include <vcl/timer.hxx> -#ifndef _MENU_HXX //autogen #include <vcl/menu.hxx> -#endif -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif -#ifndef _FLOATWIN_HXX //autogen #include <vcl/floatwin.hxx> -#endif #include <sfx2/ctrlitem.hxx> #include <sfx2/sfxstatuslistener.hxx> #include <svtools/toolboxcontroller.hxx> @@ -61,7 +56,6 @@ class SfxUnoControllerItem; svt::ToolboxController* SAL_CALL SfxToolBoxControllerFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, ToolBox* pToolbox, unsigned short nID, const ::rtl::OUString& aCommandURL ); -//typedef SfxToolBoxControl* (*SfxToolBoxControlCtor)( USHORT nId, ToolBox &rTbx, SfxBindings & ); typedef SfxToolBoxControl* (*SfxToolBoxControlCtor)( USHORT nSlotId, USHORT nId, ToolBox& rBox ); struct SfxTbxCtrlFactory @@ -133,10 +127,7 @@ private: SAL_DLLPRIVATE SfxPopupWindow(SfxPopupWindow &); // not defined SAL_DLLPRIVATE void operator =(SfxPopupWindow &); // not defined - -//#if 0 // _SOLAR__PRIVATE DECL_DLLPRIVATE_LINK( Delete, void * ); -//#endif protected: virtual void PopupModeEnd(); @@ -307,14 +298,14 @@ public: }; #define SFX_IMPL_TOOLBOX_CONTROL(Class, nItemClass) \ - SfxToolBoxControl* __EXPORT Class::CreateImpl( USHORT nSlotId, USHORT nId, ToolBox &rTbx ) \ + SfxToolBoxControl* Class::CreateImpl( USHORT nSlotId, USHORT nId, ToolBox &rTbx ) \ { return new Class( nSlotId, nId, rTbx ); } \ void Class::RegisterControl(USHORT nSlotId, SfxModule *pMod) \ { SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( \ Class::CreateImpl, TYPE(nItemClass), nSlotId ) ); } #define SFX_IMPL_TOOLBOX_CONTROL_ARG(Class, nItemClass, Arg) \ - SfxToolBoxControl* __EXPORT Class::CreateImpl( USHORT nSlotId, USHORT nId, ToolBox &rTbx ) \ + SfxToolBoxControl* Class::CreateImpl( USHORT nSlotId, USHORT nId, ToolBox &rTbx ) \ { return new Class( nSlotId, nId, rTbx, Arg); } \ void Class::RegisterControl(USHORT nSlotId, SfxModule *pMod) \ { SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( \ @@ -322,7 +313,6 @@ public: //========================================================================= -//#if 0 // _SOLAR__PRIVATE class SfxDragButton_Impl : public FixedImage { @@ -335,10 +325,6 @@ public: }; class SfxDragToolBoxControl_Impl : public SfxToolBoxControl -/* [Beschreibung] - -*/ - { public: SFX_DECL_TOOLBOX_CONTROL(); @@ -380,13 +366,12 @@ protected: virtual void Select( BOOL ); virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState ); virtual SfxPopupWindow* CreatePopupWindow(); - DECL_LINK( Activate, Menu * ); // Needed to support high contrast images + DECL_LINK( Activate, Menu * ); private: String aLastURL; BOOL bBigImages; PopupMenu* pMenu; ULONG m_nSymbolsStyle; - BOOL m_bWasHiContrastMode; BOOL m_bShowMenuImages; }; @@ -430,7 +415,6 @@ class SfxAddonsToolBoxControl_Impl : public SfxToolBoxControl { BOOL bBigImages; PopupMenu* pMenu; - BOOL m_bWasHiContrastMode; BOOL m_bShowMenuImages; protected: @@ -438,7 +422,7 @@ protected: using SfxToolBoxControl::Select; virtual void Select( BOOL ); virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState ); - DECL_LINK( Activate, Menu * ); // Needed to support high contrast images + DECL_LINK( Activate, Menu * ); public: SFX_DECL_TOOLBOX_CONTROL(); SfxAddonsToolBoxControl_Impl( USHORT nSlotId, USHORT nId, ToolBox& rBox ); @@ -447,6 +431,6 @@ public: void RefreshMenuImages( Menu* pMenu ); }; -//#endif - #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/templdlg.hxx b/sfx2/inc/sfx2/templdlg.hxx index 6cd9846744..c2df1318d6 100644 --- a/sfx2/inc/sfx2/templdlg.hxx +++ b/sfx2/inc/sfx2/templdlg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -100,3 +101,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/unoctitm.hxx b/sfx2/inc/sfx2/unoctitm.hxx index 52c24dd827..dac15f7999 100644 --- a/sfx2/inc/sfx2/unoctitm.hxx +++ b/sfx2/inc/sfx2/unoctitm.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -164,7 +165,6 @@ public: SfxDispatcher* GetDispatcher_Impl(); }; -//#if 0 // _SOLAR__PRIVATE class SfxDispatchController_Impl : public SfxControllerItem { ::com::sun::star::util::URL aDispatchURL; @@ -205,7 +205,7 @@ public: SfxDispatcher* GetDispatcher(); void SetFrame(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame); }; -//#endif #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/userinputinterception.hxx b/sfx2/inc/sfx2/userinputinterception.hxx index 318c8c8ee3..3cc9527519 100644 --- a/sfx2/inc/sfx2/userinputinterception.hxx +++ b/sfx2/inc/sfx2/userinputinterception.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -81,3 +82,5 @@ namespace sfx2 //........................................................................ #endif // USERINPUTINTERCEPTION_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx index cf6bbf0b16..abbdd83296 100644 --- a/sfx2/inc/sfx2/viewfrm.hxx +++ b/sfx2/inc/sfx2/viewfrm.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -343,8 +344,10 @@ public: virtual int operator==( const SfxPoolItem& ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; + virtual bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; const com::sun::star::uno::Sequence < com::sun::star::embed::VerbDescriptor >& GetVerbList() const { return aVerbs; } }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/viewsh.hxx b/sfx2/inc/sfx2/viewsh.hxx index a471a205aa..7e1481952c 100644 --- a/sfx2/inc/sfx2/viewsh.hxx +++ b/sfx2/inc/sfx2/viewsh.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -125,7 +126,7 @@ public: \ #define SFX_IMPL_NAMED_VIEWFACTORY(Class, AsciiViewName) \ SfxViewFactory* Class::pFactory; \ - SfxViewShell* __EXPORT Class::CreateInstance(SfxViewFrame *pFrame, SfxViewShell *pOldView) \ + SfxViewShell* Class::CreateInstance(SfxViewFrame *pFrame, SfxViewShell *pOldView) \ { return new Class(pFrame, pOldView); } \ void Class::RegisterFactory( USHORT nPrio ) \ { \ @@ -141,7 +142,7 @@ public: \ Factory().RegisterViewFactory( ViewShellClass::Factory() ) class SfxInPlaceClient; -DECLARE_LIST( SfxInPlaceClientList, SfxInPlaceClient* ) +typedef ::std::vector< SfxInPlaceClient* > SfxInPlaceClientList; // ----------------------------------------------------------------------- class SFX2_DLLPUBLIC SfxViewShell: public SfxShell, public SfxListener @@ -223,8 +224,8 @@ public: // Focus, KeyInput, Cursor void GotFocus() const; inline void LostFocus() const; - virtual void ShowCursor( FASTBOOL bOn = TRUE ); - virtual FASTBOOL KeyInput( const KeyEvent &rKeyEvent ); + virtual void ShowCursor( bool bOn = true ); + virtual bool KeyInput( const KeyEvent &rKeyEvent ); BOOL Escape(); // Viewing Interface @@ -264,11 +265,11 @@ public: /** forwards the current document, as returned by ->GetCurrentDocument, to SfxObjectShell::SetWorkingDocument */ void SetCurrentDocument() const; - + /** get an XRenderable instance that can render this docuement */ virtual com::sun::star::uno::Reference< com::sun::star::view::XRenderable > GetRenderable(); - + virtual void MarginChanged(); const Size& GetMargin() const; @@ -298,9 +299,8 @@ public: SAL_DLLPRIVATE FASTBOOL GlobalKeyInput_Impl( const KeyEvent &rKeyEvent ); SAL_DLLPRIVATE void NewIPClient_Impl( SfxInPlaceClient *pIPClient ) - { GetIPClientList_Impl(TRUE)->Insert(pIPClient); } - SAL_DLLPRIVATE void IPClientGone_Impl( SfxInPlaceClient *pIPClient ) - { GetIPClientList_Impl(TRUE)->Remove(pIPClient); } + { GetIPClientList_Impl(TRUE)->push_back(pIPClient); } + SAL_DLLPRIVATE void IPClientGone_Impl( SfxInPlaceClient *pIPClient ); SAL_DLLPRIVATE SfxInPlaceClientList* GetIPClientList_Impl( BOOL bCreate = TRUE ) const; SAL_DLLPRIVATE void ResetAllClients_Impl( SfxInPlaceClient *pIP ); SAL_DLLPRIVATE void DiscardClients_Impl(); diff --git a/sfx2/inc/sfxbasic.hxx b/sfx2/inc/sfxbasic.hxx index 89971b072f..a3c46e39dd 100644 --- a/sfx2/inc/sfxbasic.hxx +++ b/sfx2/inc/sfxbasic.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -40,3 +41,4 @@ ErrCode SfxCallMacro( BasicManager* pMgr, const String& rMacro, #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sorgitm.hxx b/sfx2/inc/sorgitm.hxx index 61c8894d08..9bae90cf55 100644 --- a/sfx2/inc/sorgitm.hxx +++ b/sfx2/inc/sorgitm.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -45,10 +46,11 @@ public: virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const; virtual int operator==( const SfxPoolItem& ) const; - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; - virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + virtual bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; + virtual bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); String getLanguage() { return aLanguage; }; }; #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/srchdlg.hxx b/sfx2/inc/srchdlg.hxx index 384f075f01..8398cacaba 100644 --- a/sfx2/inc/srchdlg.hxx +++ b/sfx2/inc/srchdlg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,16 +28,10 @@ #ifndef _SFX_SRCHDLG_HXX_ #define _SFX_SRCHDLG_HXX_ -#ifndef _VCL_BUTTON_HXX #include <vcl/button.hxx> -#endif #include <vcl/combobox.hxx> -#ifndef _VCL_EDIT_HXX #include <vcl/edit.hxx> -#endif -#ifndef _VCL_FIXED_HXX #include <vcl/fixed.hxx> -#endif #include <sfx2/basedlgs.hxx> // ============================================================================ @@ -103,3 +98,4 @@ public: #endif // _SFX_SRCHDLG_HXX_ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/qa/cppunit/makefile.mk b/sfx2/qa/cppunit/makefile.mk deleted file mode 100644 index 4db87b5fe7..0000000000 --- a/sfx2/qa/cppunit/makefile.mk +++ /dev/null @@ -1,86 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -.IF "$(OOO_SUBSEQUENT_TESTS)" == "" -nothing .PHONY: -.ELSE - -PRJ=../.. -PRJNAME=sfx2 -TARGET=qa_cppunit - -ENABLE_EXCEPTIONS=TRUE - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk - -#building with stlport, but cppunit was not built with stlport -.IF "$(USE_SYSTEM_STL)"!="YES" -.IF "$(SYSTEM_CPPUNIT)"=="YES" -CFLAGSCXX+=-DADAPT_EXT_STL -.ENDIF -.ENDIF - -CFLAGSCXX += $(CPPUNIT_CFLAGS) -DLLPRE = # no leading "lib" on .so files - -# --- Libs --------------------------------------------------------- - -SHL1OBJS= \ - $(SLO)/test_metadatable.obj \ - - -SHL1STDLIBS= \ - $(CPPUNITLIB) \ - $(SALLIB) \ - $(CPPULIB) \ - $(CPPUHELPERLIB) \ - $(VCLLIB) \ - $(SFXLIB) \ - - -SHL1TARGET= test_metadatable -SHL1RPATH = NONE -SHL1IMPLIB= i$(SHL1TARGET) -# SHL1DEF= $(MISC)/$(SHL1TARGET).def -DEF1NAME=$(SHL1TARGET) -# DEF1EXPORTFILE= export.exp -SHL1VERSIONMAP= version.map - -# --- All object files --------------------------------------------- - -SLOFILES= \ - $(SHL1OBJS) \ - - -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk -.INCLUDE : _cppunit.mk - -.END diff --git a/sfx2/qa/cppunit/version.map b/sfx2/qa/cppunit/version.map deleted file mode 100644 index 0dbbcc5a73..0000000000 --- a/sfx2/qa/cppunit/version.map +++ /dev/null @@ -1,34 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -UDK_3_0_0 { - global: - cppunitTestPlugIn; - - local: - *; -}; diff --git a/sfx2/sdi/appslots.sdi b/sfx2/sdi/appslots.sdi index a230036695..026f8bb9a2 100644 --- a/sfx2/sdi/appslots.sdi +++ b/sfx2/sdi/appslots.sdi @@ -167,7 +167,11 @@ interface Application ExecMethod = MiscExec_Impl ; StateMethod = MiscState_Impl ; ] - SID_HELP_SUPPORTPAGE + SID_SHOW_LICENSE + [ + ExecMethod = MiscExec_Impl ; + ] + SID_SHOW_CREDITS [ ExecMethod = MiscExec_Impl ; ] @@ -177,6 +181,7 @@ interface Application SID_AVAILABLE_TOOLBARS [ ExecMethod = MiscExec_Impl ; + StateMethod = MiscState_Impl ; ] SID_HELP_TUTORIALS [ diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi index 35ba7ba0c7..3c469f84b6 100644..100755 --- a/sfx2/sdi/sfx.sdi +++ b/sfx2/sdi/sfx.sdi @@ -3830,7 +3830,7 @@ SfxUInt16Item MetricUnit SID_ATTR_METRIC ] //-------------------------------------------------------------------------- -SfxBoolItem Modified SID_MODIFIED +SfxBoolItem ApplyCharUnit SID_ATTR_APPLYCHARUNIT [ /* flags: */ @@ -3857,7 +3857,7 @@ SfxBoolItem Modified SID_MODIFIED ] //-------------------------------------------------------------------------- -SfxStringItem ModifiedStatus SID_DOC_MODIFIED +SfxBoolItem Modified SID_MODIFIED [ /* flags: */ @@ -3873,12 +3873,12 @@ SfxStringItem ModifiedStatus SID_DOC_MODIFIED RecordPerSet; Synchron; - Readonly = TRUE, + Readonly = FALSE, /* config: */ AccelConfig = FALSE, MenuConfig = FALSE, - StatusBarConfig = TRUE, + StatusBarConfig = FALSE, ToolBoxConfig = FALSE, GroupId = GID_VIEW; ] @@ -7339,7 +7339,32 @@ SfxVoidItem UpdateConfiguration SID_UPDATE_CONFIG ] //-------------------------------------------------------------------------- -SfxVoidItem HelpSupport SID_HELP_SUPPORTPAGE +SfxVoidItem ShowLicense SID_SHOW_LICENSE +() +[ + /* flags: */ + AutoUpdate = FALSE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + /* config: */ + AccelConfig = TRUE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_APPLICATION; +] + +//-------------------------------------------------------------------------- +SfxVoidItem ShowCredits SID_SHOW_CREDITS () [ /* flags: */ diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx index 76e580bd6d..f919bf2abc 100644 --- a/sfx2/source/appl/app.cxx +++ b/sfx2/source/appl/app.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -37,7 +38,6 @@ #include <sfx2/app.hxx> #include <sfx2/frame.hxx> -#include <vos/process.hxx> #include <tools/simplerm.hxx> #include <tools/config.hxx> #include <basic/basrdll.hxx> @@ -653,7 +653,7 @@ void SfxApplication::LeaveAsynchronCall_Impl() //-------------------------------------------------------------------- -FASTBOOL SfxApplication::IsInAsynchronCall_Impl() const +bool SfxApplication::IsInAsynchronCall_Impl() const { return pAppData_Impl->nAsynchronCalls > 0; } @@ -739,7 +739,7 @@ IMPL_LINK( SfxApplication, GlobalBasicErrorHdl_Impl, StarBASIC*, pStarBasic ) basicide_handle_basic_error pSymbol = (basicide_handle_basic_error) osl_getFunctionSymbol( handleMod, aSymbol.pData ); // call basicide_handle_basic_error in basctl - long nRet = pSymbol( pStarBasic ); + long nRet = pSymbol ? pSymbol( pStarBasic ) : 0; return nRet; } @@ -755,8 +755,8 @@ sal_Bool SfxApplication::IsXScriptURL( const String& rScriptURL ) ::com::sun::star::uno::Reference < ::com::sun::star::uri::XUriReferenceFactory > xFactory( xSMgr->createInstance( - ::rtl::OUString::createFromAscii( - "com.sun.star.uri.UriReferenceFactory" ) ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.uri.UriReferenceFactory" )) ), ::com::sun::star::uno::UNO_QUERY ); if ( xFactory.is() ) @@ -831,3 +831,4 @@ void SfxApplication::MacroOrganizer( INT16 nTabId ) pSymbol( nTabId ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/app.hrc b/sfx2/source/appl/app.hrc index 1f9c125fb4..6697d5bb32 100644 --- a/sfx2/source/appl/app.hrc +++ b/sfx2/source/appl/app.hrc @@ -39,9 +39,6 @@ #define MSG_ERR_VERSION_CFG (RID_SFX_APP_START+6) #define MSG_ERR_NO_WEBBROWSER_FOUND (RID_SFX_APP_START+7) -// Note: no longer in use -// #define MSG_ERR_EXTERNAL_APP_NOT_FOUND (RID_SFX_APP_START+8) - #define MSG_ISPRINTING_QUERYABORT (RID_SFX_APP_START+9) #define MSG_CANT_QUIT (RID_SFX_APP_START+10) #define STR_ISMODIFIED (RID_SFX_APP_START+11) @@ -105,7 +102,7 @@ #define RID_STR_NOWELCOMESCREEN (RID_SFX_APP_START+91) -// --> PB 2004-08-20 #i33095# +// Option for 'recommend opening document read only' is not evaluated (#i33095#) /* obsolete #define STR_EDITOBJECT (RID_SFX_APP_START+92) #define STR_OPENOBJECT (RID_SFX_APP_START+93) @@ -161,13 +158,9 @@ #define IMG_HELP_TOOLBOX_COPY (RID_SFX_APP_START+118) #define IMG_HELP_CONTENT_BOOK_OPEN (RID_SFX_APP_START+120) -#define IMG_HELP_CONTENT_BOOK_OPEN_HC (RID_SFX_APP_START+121) #define IMG_HELP_CONTENT_BOOK_CLOSED (RID_SFX_APP_START+122) -#define IMG_HELP_CONTENT_BOOK_CLOSED_HC (RID_SFX_APP_START+123) #define IMG_HELP_CONTENT_DOC (RID_SFX_APP_START+124) -#define IMG_HELP_CONTENT_DOC_HC (RID_SFX_APP_START+125) // image - #define IMG_MISSING_1 (RID_SFX_APP_START+126) // image #define IMG_MISSING_2 (RID_SFX_APP_START+127) // image #define IMG_MISSING_3 (RID_SFX_APP_START+128) // image @@ -203,16 +196,6 @@ #define RID_HELP_ONSTARTUP_BOX (RID_SFX_APP_START+144) #define RID_HELP_ONSTARTUP_TEXT (RID_SFX_APP_START+145) -#define IMG_HELP_TOOLBOX_HC_INDEX_ON (RID_SFX_APP_START+150) -#define IMG_HELP_TOOLBOX_HC_INDEX_OFF (RID_SFX_APP_START+151) -#define IMG_HELP_TOOLBOX_HC_START (RID_SFX_APP_START+152) -#define IMG_HELP_TOOLBOX_HC_PREV (RID_SFX_APP_START+153) -#define IMG_HELP_TOOLBOX_HC_NEXT (RID_SFX_APP_START+154) -#define IMG_HELP_TOOLBOX_HC_PRINT (RID_SFX_APP_START+155) -#define IMG_HELP_TOOLBOX_HC_BOOKMARKS (RID_SFX_APP_START+156) -#define IMG_HELP_TOOLBOX_HC_SEARCHDIALOG (RID_SFX_APP_START+157) -#define IMG_HELP_TOOLBOX_HC_COPY (RID_SFX_APP_START+158) - #define IMG_HELP_TOOLBOX_L_INDEX_ON (RID_SFX_APP_START+160) #define IMG_HELP_TOOLBOX_L_INDEX_OFF (RID_SFX_APP_START+161) #define IMG_HELP_TOOLBOX_L_START (RID_SFX_APP_START+162) @@ -223,16 +206,6 @@ #define IMG_HELP_TOOLBOX_L_SEARCHDIALOG (RID_SFX_APP_START+167) #define IMG_HELP_TOOLBOX_L_COPY (RID_SFX_APP_START+168) -#define IMG_HELP_TOOLBOX_HCL_INDEX_ON (RID_SFX_APP_START+170) -#define IMG_HELP_TOOLBOX_HCL_INDEX_OFF (RID_SFX_APP_START+171) -#define IMG_HELP_TOOLBOX_HCL_START (RID_SFX_APP_START+172) -#define IMG_HELP_TOOLBOX_HCL_PREV (RID_SFX_APP_START+173) -#define IMG_HELP_TOOLBOX_HCL_NEXT (RID_SFX_APP_START+174) -#define IMG_HELP_TOOLBOX_HCL_PRINT (RID_SFX_APP_START+175) -#define IMG_HELP_TOOLBOX_HCL_BOOKMARKS (RID_SFX_APP_START+176) -#define IMG_HELP_TOOLBOX_HCL_SEARCHDIALOG (RID_SFX_APP_START+177) -#define IMG_HELP_TOOLBOX_HCL_COPY (RID_SFX_APP_START+178) - #define RID_SECURITY_WARNING_HYPERLINK (RID_SFX_APP_START + 180) #define RID_SECURITY_WARNING_TITLE (RID_SFX_APP_START + 181) diff --git a/sfx2/source/appl/app.src b/sfx2/source/appl/app.src index ae524c25ba..084818a707 100644 --- a/sfx2/source/appl/app.src +++ b/sfx2/source/appl/app.src @@ -838,7 +838,7 @@ String STR_QUICKSTART_RECENTDOC String STR_QUERY_UPDATE_LINKS { - Text [ en-US ] = "Update all links?" ; + Text [ en-US ] = "This document contains one or more links to external data.\n\nWould you like to change the document, and update all links\nto get the most recent data?" ; }; String STR_DDE_ERROR diff --git a/sfx2/source/appl/appbas.cxx b/sfx2/source/appl/appbas.cxx index 52e9d6248a..f292eae14e 100644 --- a/sfx2/source/appl/appbas.cxx +++ b/sfx2/source/appl/appbas.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -100,79 +101,8 @@ using namespace ::com::sun::star::script; using ::basic::BasicManagerRepository; -// #ifndef STR_VERSION_ID -// #define STR_VERSION_ID 1 -// #endif -// #ifndef STR_VERSION_TYPE -// #define STR_VERSION_TYPE 1 -// #endif - -//========================================================================= -/*ASDBG -const SfxConstant __FAR_DATA aConstants[] = -{ - SFX_USHORT_CONSTANT( "AlignBottom", ALIGN_BOTTOM ), - SFX_USHORT_CONSTANT( "AlignTop", ALIGN_TOP ), - SFX_USHORT_CONSTANT( "CharSetANSI", CHARSET_ANSI ), - SFX_USHORT_CONSTANT( "CharSetDontKnow", CHARSET_DONTKNOW ), - SFX_USHORT_CONSTANT( "CharSetIBMPC437", CHARSET_IBMPC_437 ), - SFX_USHORT_CONSTANT( "CharSetIBMPC850", CHARSET_IBMPC_850 ), - SFX_USHORT_CONSTANT( "CharSetIBMPC860", CHARSET_IBMPC_860 ), - SFX_USHORT_CONSTANT( "CharSetIBMPC861", CHARSET_IBMPC_861 ), - SFX_USHORT_CONSTANT( "CharSetIBMPC863", CHARSET_IBMPC_863 ), - SFX_USHORT_CONSTANT( "CharSetIBMPC865", CHARSET_IBMPC_865 ), - SFX_USHORT_CONSTANT( "CharSetIBMPC", CHARSET_IBMPC ), - SFX_USHORT_CONSTANT( "CharSetMac", CHARSET_MAC ), - SFX_USHORT_CONSTANT( "CharSetSymbol", CHARSET_SYMBOL ), - SFX_USHORT_CONSTANT( "CharSetSystem", RTL_TEXTENCODING_UTF8 ), - SFX_USHORT_CONSTANT( "FamilyDecorative", FAMILY_DECORATIVE ), - SFX_USHORT_CONSTANT( "FamilyDontknow", FAMILY_DONTKNOW ), - SFX_USHORT_CONSTANT( "FamilyModern", FAMILY_MODERN ), - SFX_USHORT_CONSTANT( "FamilyRoman", FAMILY_ROMAN ), - SFX_USHORT_CONSTANT( "FamilyScript", FAMILY_SCRIPT ), - SFX_USHORT_CONSTANT( "FamilySwiss", FAMILY_SWISS ), - SFX_USHORT_CONSTANT( "FamilySystem", FAMILY_SYSTEM ), - SFX_USHORT_CONSTANT( "GradientAxial", GRADIENT_AXIAL ), - SFX_USHORT_CONSTANT( "GradientElliptical", GRADIENT_ELLIPTICAL ), - SFX_USHORT_CONSTANT( "GradientLinear", GRADIENT_LINEAR ), - SFX_USHORT_CONSTANT( "GradientRadial", GRADIENT_RADIAL ), - SFX_USHORT_CONSTANT( "GradientRect", GRADIENT_RECT ), - SFX_USHORT_CONSTANT( "GradientSquare", GRADIENT_SQUARE ), - SFX_USHORT_CONSTANT( "ItalicNone", ITALIC_NONE ), - SFX_USHORT_CONSTANT( "ItalicOblique", ITALIC_OBLIQUE ), - SFX_USHORT_CONSTANT( "StrikeThroughDouble", STRIKEOUT_DOUBLE ), - SFX_USHORT_CONSTANT( "StrikeThroughNone", STRIKEOUT_NONE ), - SFX_USHORT_CONSTANT( "StrikeThroughSingle", STRIKEOUT_SINGLE ), - SFX_USHORT_CONSTANT( "UnderlineDotted", UNDERLINE_DOTTED ), - SFX_USHORT_CONSTANT( "UnderlineDouble", UNDERLINE_DOUBLE ), - SFX_USHORT_CONSTANT( "UnderlineNone", UNDERLINE_NONE ), - SFX_USHORT_CONSTANT( "UnderlineSingle", UNDERLINE_SINGLE ), - SFX_USHORT_CONSTANT( "UnitFoot", FUNIT_FOOT ), - SFX_USHORT_CONSTANT( "UnitInch", FUNIT_INCH ), - SFX_USHORT_CONSTANT( "UnitMile", FUNIT_MILE ), - SFX_USHORT_CONSTANT( "UnitPercent", FUNIT_PERCENT ), - SFX_USHORT_CONSTANT( "UnitPoint", FUNIT_POINT ), - SFX_USHORT_CONSTANT( "UnitTwip", FUNIT_TWIP ), - SFX_USHORT_CONSTANT( "Unit_cm", FUNIT_CM ), - SFX_USHORT_CONSTANT( "Unit_m", FUNIT_M ), - SFX_USHORT_CONSTANT( "Unit_mm", FUNIT_MM ), - SFX_USHORT_CONSTANT( "WeightBlack", WEIGHT_BLACK ), - SFX_USHORT_CONSTANT( "WeightBold", WEIGHT_BOLD ), - SFX_USHORT_CONSTANT( "WeightDontKnow", WEIGHT_DONTKNOW ), - SFX_USHORT_CONSTANT( "WeightLight", WEIGHT_LIGHT ), - SFX_USHORT_CONSTANT( "WeightMedium", WEIGHT_MEDIUM ), - SFX_USHORT_CONSTANT( "WeightNormal", WEIGHT_NORMAL ), - SFX_USHORT_CONSTANT( "WeightSemibold", WEIGHT_SEMIBOLD ), - SFX_USHORT_CONSTANT( "WeightSemilight", WEIGHT_SEMILIGHT ), - SFX_USHORT_CONSTANT( "WeightThin", WEIGHT_THIN ), - SFX_USHORT_CONSTANT( "WeightUltrabold", WEIGHT_ULTRABOLD ), - SFX_USHORT_CONSTANT( "WeightUltralight", WEIGHT_ULTRALIGHT ) -}; -*/ -//======================================================================== - //------------------------------------------------------------------------ -String lcl_GetVersionString(ResMgr* /*pAppData_ImplResMgr*/) +String lcl_GetVersionString() { ::rtl::OUString aDefault; String aVersion( utl::Bootstrap::getBuildIdData( aDefault )); @@ -203,46 +133,6 @@ sal_uInt16 SfxApplication::SaveBasicAndDialogContainer() const //-------------------------------------------------------------------- -void SfxApplication::RegisterBasicConstants -( - const char*, // Prefix vor Konstanten-Namen - const SfxConstant*, // Array von <SfxConstant> Instanzen - sal_uInt16 // Anahl der Kontanten in pConsts -) - -/* [Beschreibung] - - Diese Methode meldet Konstanten beim BASIC an. Sie sollte on-demand - (in GetSbxObject() der Applikation) gerufen werden. Das Array mu\s - alphabetisch nach den Namen sortiert sein! - - Durch den Prefix kann Speicher gespart und das Suchen beschleunigt - werden. Im StarOffice soll der Prefix "so" verwendet werden. - - - [Beispiel] - - const SfxConstant __FAR_DATA aConstants[] = - { - SFX_BOOL_CONSTANT( "False", sal_False ), - SFX_BOOL_CONSTANT( "True", sal_True ), - }; - - ... - SFX_APP()->RegisterBasicConstants( 0, aConstants, 2 ); - ... - -*/ - -{ -// DBG_ASSERT( pAppData_Impl->pBasicMgr, "no basic available" ); - -// pAppData_Impl->pBasicMgr->GetLib(0)->Insert( -// new SfxConstants_Impl( pPrefix, pConsts, nCount ) ); -} - -//-------------------------------------------------------------------- - SbxVariable* MakeVariable( StarBASIC *pBas, SbxObject *pObject, const char *pName, sal_uInt32 nSID, SbxDataType eType, SbxClassType eClassType ) { @@ -293,7 +183,7 @@ StarBASIC* SfxApplication::GetBasic() //-------------------------------------------------------------------- -FASTBOOL SfxApplication::IsInBasicCall() const +bool SfxApplication::IsInBasicCall() const { return 0 != pAppData_Impl->nBasicCallLevel; } @@ -371,14 +261,6 @@ void SfxApplication::EnterBasicCall() DBG_ASSERT( pSbx, "SfxShellObject: can't create SbxObject" ); } - if ( !pFrame->GetObjectShell() ) - { - DBG( DbgOutf( "SfxShellObject: BASIC-on-demand for empty frame" ); ) - pSbx = pFrame->GetSbxObject(); - DBG_ASSERT( pSbx, "SfxShellObject: can't create SbxObject" ); - } - } -*/ // Factories anmelden // SbxBase::AddFactory( new SfxSbxObjectFactory_Impl ); } @@ -502,7 +384,7 @@ void SfxApplication::PropState_Impl( SfxItemSet &rSet ) case SID_BUILD_VERSION: { - String aVersion = lcl_GetVersionString(pAppData_Impl->pLabelResMgr); + String aVersion = lcl_GetVersionString(); rSet.Put( SfxUInt32Item( SID_BUILD_VERSION, (sal_uInt32) aVersion.ToInt32() ) ); break; } @@ -588,3 +470,4 @@ void SfxApplication::PlayMacro_Impl( SfxRequest &rReq, StarBASIC *pBasic ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/appbaslib.cxx b/sfx2/source/appl/appbaslib.cxx index fe84d4f1fd..29519876ba 100755 --- a/sfx2/source/appl/appbaslib.cxx +++ b/sfx2/source/appl/appbaslib.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -177,7 +178,7 @@ Sequence< OUString > SfxApplicationDialogLibraryContainer::impl_getStaticSupport if( bNeedsInit ) { OUString* pSeq = seqServiceNames.getArray(); - pSeq[0] = OUString::createFromAscii( "com.sun.star.script.ApplicationDialogLibraryContainer" ); + pSeq[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.ApplicationDialogLibraryContainer")); bNeedsInit = sal_False; } return seqServiceNames; @@ -191,7 +192,7 @@ OUString SfxApplicationDialogLibraryContainer::impl_getStaticImplementationName( MutexGuard aGuard( Mutex::getGlobalMutex() ); if( bNeedsInit ) { - aImplName = OUString::createFromAscii( "com.sun.star.comp.sfx2.ApplicationDialogLibraryContainer" ); + aImplName = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.sfx2.ApplicationDialogLibraryContainer")); bNeedsInit = sal_False; } return aImplName; @@ -220,7 +221,7 @@ Sequence< OUString > SfxApplicationScriptLibraryContainer::impl_getStaticSupport if( bNeedsInit ) { OUString* pSeq = seqServiceNames.getArray(); - pSeq[0] = OUString::createFromAscii( "com.sun.star.script.ApplicationScriptLibraryContainer" ); + pSeq[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.ApplicationScriptLibraryContainer")); bNeedsInit = sal_False; } return seqServiceNames; @@ -234,7 +235,7 @@ OUString SfxApplicationScriptLibraryContainer::impl_getStaticImplementationName( MutexGuard aGuard( Mutex::getGlobalMutex() ); if( bNeedsInit ) { - aImplName = OUString::createFromAscii( "com.sun.star.comp.sfx2.ApplicationScriptLibraryContainer" ); + aImplName = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.sfx2.ApplicationScriptLibraryContainer")); bNeedsInit = sal_False; } return aImplName; @@ -250,3 +251,4 @@ Reference< XInterface > SAL_CALL SfxApplicationScriptLibraryContainer::impl_crea return xRet; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx index a109f6532b..e64325a3cc 100644 --- a/sfx2/source/appl/appcfg.cxx +++ b/sfx2/source/appl/appcfg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,15 +31,11 @@ #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/frame/XDesktop.hpp> #include <com/sun/star/util/XURLTransformer.hpp> -#ifndef _COM_SUN_STAR_BEANS_PropertyValue_HPP_ #include <com/sun/star/beans/PropertyValue.hpp> -#endif #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/util/XFlushable.hpp> -#ifndef _STDLIB_H #include <stdlib.h> -#endif #include <tools/config.hxx> #include <vcl/sound.hxx> #include <vcl/msgbox.hxx> @@ -527,7 +524,6 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) const SfxPoolItem *pItem = 0; SfxItemPool &rPool = GetPool(); BOOL bResetSession = FALSE; - BOOL bProxiesModified = FALSE; SvtSaveOptions aSaveOptions; SvtUndoOptions aUndoOptions; @@ -752,7 +748,6 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) DBG_ASSERT( pItem->ISA(SfxUInt16Item), "UInt16Item expected" ); aInetOptions.SetProxyType((SvtInetOptions::ProxyType)( (const SfxUInt16Item*)pItem )->GetValue()); bResetSession = TRUE; - bProxiesModified = TRUE; } if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_HTTP_PROXY_NAME ), TRUE, &pItem ) ) @@ -760,35 +755,30 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) DBG_ASSERT( pItem->ISA(SfxStringItem), "StringItem expected" ); aInetOptions.SetProxyHttpName( ((const SfxStringItem *)pItem)->GetValue() ); bResetSession = TRUE; - bProxiesModified = TRUE; } if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_HTTP_PROXY_PORT ), TRUE, &pItem ) ) { DBG_ASSERT( pItem->ISA(SfxInt32Item), "Int32Item expected" ); aInetOptions.SetProxyHttpPort( ( (const SfxInt32Item*)pItem )->GetValue() ); bResetSession = TRUE; - bProxiesModified = TRUE; } if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_FTP_PROXY_NAME ), TRUE, &pItem ) ) { DBG_ASSERT( pItem->ISA(SfxStringItem), "StringItem expected" ); aInetOptions.SetProxyFtpName( ((const SfxStringItem *)pItem)->GetValue() ); bResetSession = TRUE; - bProxiesModified = TRUE; } if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_FTP_PROXY_PORT ), TRUE, &pItem ) ) { DBG_ASSERT( pItem->ISA(SfxInt32Item), "Int32Item expected" ); aInetOptions.SetProxyFtpPort( ( (const SfxInt32Item*)pItem )->GetValue() ); bResetSession = TRUE; - bProxiesModified = TRUE; } if ( SFX_ITEM_SET == rSet.GetItemState(SID_INET_NOPROXY, TRUE, &pItem)) { DBG_ASSERT(pItem->ISA(SfxStringItem), "StringItem expected"); aInetOptions.SetProxyNoProxy(((const SfxStringItem *)pItem)->GetValue()); bResetSession = TRUE; - bProxiesModified = TRUE; } // Secure-Referers @@ -1003,7 +993,7 @@ SfxEventConfiguration* SfxApplication::GetEventConfig() const //-------------------------------------------------------------------- //-------------------------------------------------------------------- -void SfxApplication::NotifyEvent( const SfxEventHint& rEventHint, FASTBOOL bSynchron ) +void SfxApplication::NotifyEvent( const SfxEventHint& rEventHint, bool bSynchron ) { //DBG_ASSERT(pAppData_Impl->pEventConfig,"Keine Events angemeldet!"); diff --git a/sfx2/source/appl/appchild.cxx b/sfx2/source/appl/appchild.cxx index dc3e6c4bf3..90054862a9 100644 --- a/sfx2/source/appl/appchild.cxx +++ b/sfx2/source/appl/appchild.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -174,3 +175,4 @@ SfxWorkWindow* SfxApplication::GetWorkWindow_Impl(const SfxViewFrame *pFrame) co return NULL; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/appdata.cxx b/sfx2/source/appl/appdata.cxx index e48ffcc037..dec51cd31e 100644 --- a/sfx2/source/appl/appdata.cxx +++ b/sfx2/source/appl/appdata.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -185,3 +186,5 @@ void SfxAppData_Impl::OnApplicationBasicManagerCreated( BasicManager& _rBasicMan Reference< XInterface > xCurrentComponent = SfxObjectShell::GetCurrentComponent(); _rBasicManager.SetGlobalUNOConstant( "ThisComponent", makeAny( xCurrentComponent ) ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx index 789de8b425..29abc7b991 100644 --- a/sfx2/source/appl/appdde.cxx +++ b/sfx2/source/appl/appdde.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -365,6 +366,23 @@ long SfxObjectShell::DdeSetData return 0; } +void SfxObjectShell::ReconnectDdeLink(SfxObjectShell& /*rServer*/) +{ +} + +void SfxObjectShell::ReconnectDdeLinks(SfxObjectShell& rServer) +{ + TypeId aType = TYPE(SfxObjectShell); + SfxObjectShell* p = GetFirst(&aType, false); + while (p) + { + if (&rServer != p) + p->ReconnectDdeLink(rServer); + + p = GetNext(*p, &aType, false); + } +} + //======================================================================== long SfxViewFrame::DdeExecute @@ -708,3 +726,4 @@ BOOL SfxDdeDocTopic_Impl::StartAdviseLoop() return bRet; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx index d7856fc15e..372c28504f 100644 --- a/sfx2/source/appl/appinit.cxx +++ b/sfx2/source/appl/appinit.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -39,23 +40,18 @@ #include <unotools/saveopt.hxx> #include <unotools/localisationoptions.hxx> #include <tools/config.hxx> -#ifndef _SV_RESARY_HXX #include <tools/resary.hxx> -#endif #include <tools/urlobj.hxx> #include <svl/intitem.hxx> #include <svl/eitem.hxx> #include <svl/stritem.hxx> #ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> -#endif #include <svtools/ehdl.hxx> -#ifndef _UNOTOOLS_PROCESSFACTORY_HXX #include <comphelper/processfactory.hxx> -#endif #include <unotools/configmgr.hxx> #include <rtl/ustrbuf.hxx> -#include <vos/security.hxx> +#include <osl/security.hxx> #include <ucbhelper/configurationkeys.hxx> #include <unotools/pathoptions.hxx> #include <unotools/historyoptions.hxx> @@ -119,22 +115,23 @@ void SAL_CALL SfxTerminateListener_Impl::disposing( const EventObject& ) throw( void SAL_CALL SfxTerminateListener_Impl::queryTermination( const EventObject& ) throw(TerminationVetoException, RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( !SFX_APP()->QueryExit_Impl() ) throw TerminationVetoException(); } void SAL_CALL SfxTerminateListener_Impl::notifyTermination( const EventObject& aEvent ) throw(RuntimeException ) { - static ::rtl::OUString SERVICE_GLOBALEVENTBROADCASTER = ::rtl::OUString::createFromAscii("com.sun.star.frame.GlobalEventBroadcaster"); - static ::rtl::OUString EVENT_QUIT_APP = ::rtl::OUString::createFromAscii("OnCloseApp"); + static ::rtl::OUString SERVICE_GLOBALEVENTBROADCASTER(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.GlobalEventBroadcaster")); + static ::rtl::OUString EVENT_QUIT_APP (RTL_CONSTASCII_USTRINGPARAM("OnCloseApp")); Reference< XDesktop > xDesktop( aEvent.Source, UNO_QUERY ); if( xDesktop.is() == sal_True ) xDesktop->removeTerminateListener( this ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - utl::ConfigManager::GetConfigManager()->StoreConfigItems(); + SolarMutexGuard aGuard; + utl::ConfigManager::GetConfigManager().StoreConfigItems(); + SfxApplication* pApp = SFX_APP(); pApp->Broadcast( SfxSimpleHint( SFX_HINT_DEINITIALIZING ) ); pApp->Get_Impl()->pAppDispatch->ReleaseAll(); @@ -156,7 +153,7 @@ void SAL_CALL SfxTerminateListener_Impl::notifyTermination( const EventObject& a ::rtl::OUString SAL_CALL SfxTerminateListener_Impl::getImplementationName() throw (RuntimeException) { - static const ::rtl::OUString IMPLNAME = ::rtl::OUString::createFromAscii("com.sun.star.comp.sfx2.SfxTerminateListener"); + static const ::rtl::OUString IMPLNAME(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.sfx2.SfxTerminateListener")); return IMPLNAME; } @@ -183,7 +180,7 @@ Sequence< ::rtl::OUString > SAL_CALL SfxTerminateListener_Impl::getSupportedServ // The desktop must know, which listener will terminate the SfxApplication in real ! // It must call this special listener as last one ... otherwise we shutdown the SfxApplication BEFORE other listener // can react ... - static const ::rtl::OUString SERVICENAME = ::rtl::OUString::createFromAscii("com.sun.star.frame.TerminateListener"); + static const ::rtl::OUString SERVICENAME(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.TerminateListener")); Sequence< ::rtl::OUString > lNames(1); lNames[0] = SERVICENAME; return lNames; @@ -208,7 +205,7 @@ String GetSpecialCharsForEdit(Window* pParent, const Font& rFont) static bool bDetermineFunction = false; static PFunc_getSpecialCharsForEdit pfunc_getSpecialCharsForEdit = 0; - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( !bDetermineFunction ) { bDetermineFunction = true; @@ -231,7 +228,7 @@ String GetSpecialCharsForEdit(Window* pParent, const Font& rFont) //==================================================================== -FASTBOOL SfxApplication::Initialize_Impl() +bool SfxApplication::Initialize_Impl() { RTL_LOGFILE_CONTEXT( aLog, "sfx2 (mb93783) ::SfxApplication::Initialize_Impl" ); @@ -307,10 +304,12 @@ FASTBOOL SfxApplication::Initialize_Impl() pAppData_Impl->pAppDispat->DoActivate_Impl( sal_True, NULL ); { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; // Set special characters callback on vcl edit control Edit::SetGetSpecialCharsFunction(&GetSpecialCharsForEdit); } return sal_True; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/appmain.cxx b/sfx2/source/appl/appmain.cxx index 5664fbc2e2..ba10194e91 100644 --- a/sfx2/source/appl/appmain.cxx +++ b/sfx2/source/appl/appmain.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -40,7 +41,6 @@ #include <svl/itempool.hxx> #include <svl/urihelper.hxx> #include <svtools/helpopt.hxx> -#include <vos/process.hxx> #include <framework/sfxhelperfunctions.hxx> #include <rtl/ustring.hxx> #include <com/sun/star/uno/Exception.hpp> @@ -85,7 +85,7 @@ DBG_NAME(SfxAppMainCHAOSReg) //=================================================================== #ifdef TF_POOLABLE -static SfxItemInfo __READONLY_DATA aItemInfos[] = +static SfxItemInfo const aItemInfos[] = { { 0, 0 } }; @@ -163,7 +163,7 @@ bool SfxApplication::InitLabelResMgr( const char* _pLabelPrefix, bool _bExceptio { // maybe corrupted installation throw (::com::sun::star::uno::RuntimeException( - ::rtl::OUString::createFromAscii("iso resource could not be loaded by SfxApplication"), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("iso resource could not be loaded by SfxApplication")), ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >())); } } @@ -190,3 +190,5 @@ SfxFilterMatcher& SfxApplication::GetFilterMatcher() } return *pAppData_Impl->pMatcher; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/appmisc.cxx b/sfx2/source/appl/appmisc.cxx index 07d84df290..4b75e30595 100644 --- a/sfx2/source/appl/appmisc.cxx +++ b/sfx2/source/appl/appmisc.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -41,18 +42,14 @@ #include <unotools/internaloptions.hxx> #include <unotools/pathoptions.hxx> #include <com/sun/star/registry/InvalidRegistryException.hpp> -#ifndef _COM_SUN_STAR_BEANS_PropertyValue_HPP_ #include <com/sun/star/beans/PropertyValue.hpp> -#endif #include <com/sun/star/frame/XFrame.hpp> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XFramesSupplier.hpp> #include <com/sun/star/uno/Reference.h> #include <tools/config.hxx> #include <tools/rcid.h> -#include <vos/mutex.hxx> -#ifndef GCC -#endif +#include <osl/mutex.hxx> #include <unotools/configmgr.hxx> #include <com/sun/star/frame/XDesktop.hpp> @@ -92,7 +89,6 @@ #include <sfx2/objface.hxx> #include "helper.hxx" // SfxContentHelper::Kill() -using namespace ::vos; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::util; using namespace ::com::sun::star::beans; @@ -170,7 +166,7 @@ void SfxApplication::InitializeDisplayName_Impl() String aTitle = Application::GetDisplayName(); if ( !aTitle.Len() ) { - OClearableGuard aGuard( OMutex::getGlobalMutex() ); + osl::ClearableMutexGuard aGuard( osl::Mutex::getGlobalMutex() ); // create version string /*!!! (pb) don't show a version number at the moment @@ -333,3 +329,4 @@ SfxSlotPool& SfxApplication::GetAppSlotPool_Impl() const { return *pAppData_Impl //SfxOptions& SfxApplication::GetOptions() { return *pAppData_Impl->pOptions; } //const SfxOptions& SfxApplication::GetOptions() const { return *pAppData_Impl->pOptions; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index 272ae1e40f..0612f51df5 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -80,7 +81,7 @@ #include <comphelper/docpasswordhelper.hxx> #include <vcl/svapp.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <rtl/logfile.hxx> @@ -327,7 +328,7 @@ sal_uInt32 CheckPasswd_Impl { sal_Bool bIsEncrypted = sal_False; try { - xStorageProps->getPropertyValue( ::rtl::OUString::createFromAscii("HasEncryptedEntries") ) + xStorageProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HasEncryptedEntries")) ) >>= bIsEncrypted; } catch( uno::Exception& ) { @@ -679,6 +680,29 @@ void SfxApplication::NewDocExec_Impl( SfxRequest& rReq ) //--------------------------------------------------------------------------- +namespace { + +/** + * Check if a given filter type should open the hyperlinked document + * natively. + * + * @param rFilter filter object + */ +bool lcl_isFilterNativelySupported(const SfxFilter& rFilter) +{ + if (rFilter.IsOwnFormat()) + return true; + + ::rtl::OUString aName = rFilter.GetFilterName(); + if (aName.indexOf(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MS Excel"))) == 0) + // We can handle all Excel variants natively. + return true; + + return false; +} + +} + void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) { DBG_MEMTEST(); @@ -924,7 +948,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) { Reference< ::com::sun::star::document::XTypeDetection > xTypeDetection( ::comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString::createFromAscii( "com.sun.star.document.TypeDetection" )), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.TypeDetection"))), UNO_QUERY ); if ( xTypeDetection.is() ) { @@ -933,7 +957,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) aURL.Complete = aFileName; Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), UNO_QUERY ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), UNO_QUERY ); xTrans->parseStrict( aURL ); INetProtocol aINetProtocol = INetURLObject( aURL.Complete ).GetProtocol(); @@ -951,7 +975,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) if ( !bIsDir && !aExtendedSecurityOptions.IsSecureHyperlink( aURL.Complete ) ) { // Security check for local files depending on the extension - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Window *pWindow = SFX_APP()->GetTopWindow(); String aSecurityWarningBoxTitle( SfxResId( RID_SECURITY_WARNING_TITLE )); @@ -975,7 +999,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) } else if ( eMode == SvtExtendedSecurityOptions::OPEN_NEVER && aINetProtocol != INET_PROT_VND_SUN_STAR_HELP ) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Window *pWindow = SFX_APP()->GetTopWindow(); String aSecurityWarningBoxTitle( SfxResId( RID_SECURITY_WARNING_TITLE )); @@ -988,11 +1012,11 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) aTypeName = xTypeDetection->queryTypeByURL( aURL.Main ); SfxFilterMatcher& rMatcher = SFX_APP()->GetFilterMatcher(); const SfxFilter* pFilter = rMatcher.GetFilter4EA( aTypeName ); - if ( !pFilter || !( pFilter->IsOwnFormat() )) + if (!pFilter || !lcl_isFilterNativelySupported(*pFilter)) { // hyperlink does not link to own type => special handling (http, ftp) browser and (other external protocols) OS Reference< XSystemShellExecute > xSystemShellExecute( ::comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString::createFromAscii( "com.sun.star.system.SystemShellExecute" )), UNO_QUERY ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.system.SystemShellExecute"))), UNO_QUERY ); if ( xSystemShellExecute.is() ) { if ( aINetProtocol == INET_PROT_MAILTO ) @@ -1013,13 +1037,13 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) } catch ( ::com::sun::star::lang::IllegalArgumentException& ) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Window *pWindow = SFX_APP()->GetTopWindow(); ErrorBox( pWindow, SfxResId( MSG_ERR_NO_WEBBROWSER_FOUND )).Execute(); } catch ( ::com::sun::star::system::SystemShellExecuteException& ) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Window *pWindow = SFX_APP()->GetTopWindow(); ErrorBox( pWindow, SfxResId( MSG_ERR_NO_WEBBROWSER_FOUND )).Execute(); } @@ -1032,14 +1056,14 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) Sequence < ::rtl::OUString > aProtocols(2); // add special protocols that always should be treated as internal - aProtocols[0] = ::rtl::OUString::createFromAscii("private:*"); - aProtocols[1] = ::rtl::OUString::createFromAscii("vnd.sun.star.*"); + aProtocols[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("private:*")); + aProtocols[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.*")); try { // get registered protocol handlers from configuration Reference < XNameAccess > xAccess( ::comphelper::ConfigurationHelper::openConfig( ::comphelper::getProcessServiceFactory(), - ::rtl::OUString::createFromAscii("org.openoffice.Office.ProtocolHandler/HandlerSet"), ::comphelper::ConfigurationHelper::E_READONLY ), UNO_QUERY ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.ProtocolHandler/HandlerSet")), ::comphelper::ConfigurationHelper::E_READONLY ), UNO_QUERY ); if ( xAccess.is() ) { Sequence < ::rtl::OUString > aNames = xAccess->getElementNames(); @@ -1051,7 +1075,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) if ( xSet.is() ) { // copy protocols - aRet = xSet->getPropertyValue( ::rtl::OUString::createFromAscii("Protocols") ); + aRet = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Protocols")) ); Sequence < ::rtl::OUString > aTmp; aRet >>= aTmp; @@ -1096,7 +1120,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) } catch ( ::com::sun::star::lang::IllegalArgumentException& ) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Window *pWindow = SFX_APP()->GetTopWindow(); ErrorBox( pWindow, SfxResId( MSG_ERR_NO_WEBBROWSER_FOUND )).Execute(); } @@ -1104,7 +1128,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) { if ( !pFilter ) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Window *pWindow = SFX_APP()->GetTopWindow(); ErrorBox( pWindow, SfxResId( MSG_ERR_NO_WEBBROWSER_FOUND )).Execute(); } @@ -1188,7 +1212,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) if (!pInteractionItem) { - Reference < ::com::sun::star::task::XInteractionHandler > xHdl( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.comp.uui.UUIInteractionHandler")), UNO_QUERY ); + Reference < ::com::sun::star::task::XInteractionHandler > xHdl( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.uui.UUIInteractionHandler"))), UNO_QUERY ); if (xHdl.is()) rReq.AppendItem( SfxUnoAnyItem(SID_INTERACTIONHANDLER,::com::sun::star::uno::makeAny(xHdl)) ); } @@ -1284,7 +1308,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) { URL aURL; aURL.Complete = aFileName; - Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), UNO_QUERY ); + Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), UNO_QUERY ); xTrans->parseStrict( aURL ); Reference < XDispatchProvider > xProv( xTargetFrame, UNO_QUERY ); @@ -1302,7 +1326,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) // Desktop service must exists! dont catch() or check for problems here ... // But loading of documents can fail by other reasons. Handle it more gracefully. - Reference < XComponentLoader > xDesktop( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop")), UNO_QUERY ); + Reference < XComponentLoader > xDesktop( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop"))), UNO_QUERY ); Reference < XComponent > xComp; try { @@ -1357,3 +1381,5 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) delete pLinkItem; } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/appquit.cxx b/sfx2/source/appl/appquit.cxx index 8499376f1c..5285fad3f4 100644 --- a/sfx2/source/appl/appquit.cxx +++ b/sfx2/source/appl/appquit.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -172,3 +173,5 @@ void SfxApplication::Deinitialize() */ pAppData_Impl->pPool = NULL; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/appreg.cxx b/sfx2/source/appl/appreg.cxx index ec0ee9e975..6febf22427 100644 --- a/sfx2/source/appl/appreg.cxx +++ b/sfx2/source/appl/appreg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,9 +31,6 @@ #include <vcl/toolbox.hxx> -#ifndef GCC -#endif - #include <sfx2/app.hxx> #include "appdata.hxx" #include "arrdecl.hxx" @@ -151,3 +149,5 @@ void SfxApplication::RegisterMenuControl_Impl( SfxModule *pMod, SfxMenuCtrlFacto pAppData_Impl->pMenuCtrlFac->C40_INSERT( SfxMenuCtrlFactory, pFact, pAppData_Impl->pMenuCtrlFac->Count() ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 6089324bb2..7b16d80d30 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -70,15 +71,16 @@ #include <vcl/help.hxx> #include <vcl/stdtext.hxx> #include <rtl/ustrbuf.hxx> +#include <osl/file.hxx> #include <unotools/pathoptions.hxx> #include <unotools/moduleoptions.hxx> #include <unotools/regoptions.hxx> #include <svtools/helpopt.hxx> +#include <svtools/miscopt.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <tools/shl.hxx> #include <unotools/bootstrap.hxx> -#include <vos/process.hxx> #include <rtl/bootstrap.hxx> #include <cppuhelper/exc_hlp.hxx> #include <rtl/ustrbuf.hxx> @@ -154,10 +156,27 @@ long QuitAgain_Impl( void* pObj, void* pArg ) return 0; } +namespace { + sal_Bool checkURL( const char *pName, rtl::OUString &rURL ) + { + using namespace osl; + DirectoryItem aDirItem; + + rURL = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR/") ); + rURL += rtl::OUString::createFromAscii( pName ); + rtl::Bootstrap::expandMacros( rURL ); + + if (rURL.getLength() != 0) + return DirectoryItem::get( rURL, aDirItem ) == DirectoryItem::E_None; + else + return sal_False; + } +} + void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) { DBG_MEMTEST(); - FASTBOOL bDone = FALSE; + bool bDone = false; switch ( rReq.GetSlot() ) { case SID_SETOPTIONS: @@ -269,7 +288,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) const short nRet = pDlg->Execute(); if ( nRet ) - bDone = TRUE; + bDone = true; delete pDlg; } @@ -308,14 +327,13 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) BOOL bOk = ( n == 0); rReq.SetReturnValue( SfxBoolItem( 0, bOk ) ); - bDone = TRUE; + bDone = true; break; } case SID_SAVEDOCS: { BOOL bOK = TRUE; - BOOL bTmpDone = TRUE; for ( SfxObjectShell *pObjSh = SfxObjectShell::GetFirst(); pObjSh; pObjSh = SfxObjectShell::GetNext( *pObjSh ) ) @@ -325,7 +343,6 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) { pObjSh->ExecuteSlot( aReq ); SfxBoolItem *pItem = PTR_CAST( SfxBoolItem, aReq.GetReturnValue() ); - bTmpDone = aReq.IsDone(); if ( !pItem || !pItem->GetValue() ) bOK = FALSE; } @@ -336,9 +353,48 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) break; } + case SID_SHOW_CREDITS: + case SID_SHOW_LICENSE: + { + try { + Reference < XComponentLoader > xLoader( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")) ), UNO_QUERY ); + Sequence < com::sun::star::beans::PropertyValue > args(2); + args[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ViewOnly")); + args[0].Value <<= sal_True; + args[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReadOnly")); + args[1].Value <<= sal_True; + + rtl::OUString aURL; + char const** pNames; + if( rReq.GetSlot() == SID_SHOW_LICENSE ) + { + static char const* pLicenseStrings[] = + { + "LICENSE.odt", "LICENSE.html", "LICENSE" + }; + pNames = pLicenseStrings; + } + else + { + static char const* pCreditsStrings[] = + { + "CREDITS.odt", "CREDITS.html", "CREDITS" + }; + pNames = pCreditsStrings; + } + + if ( checkURL ( pNames[0], aURL ) || + checkURL ( pNames[1], aURL ) || + checkURL ( pNames[2], aURL ) ) { + xLoader->loadComponentFromURL( aURL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_blank")), 0, args ); + } + } catch (const ::com::sun::star::uno::Exception &) { + } + break; + } + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - case SID_HELPINDEX: - case SID_HELP_SUPPORTPAGE: { Help* pHelp = Application::GetHelp(); if ( pHelp ) @@ -376,7 +432,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) Help::DisableQuickHelp(); SvtHelpOptions().SetHelpTips( bOn ); Invalidate(SID_HELPTIPS); - bDone = TRUE; + bDone = true; // ggf. recorden if ( !rReq.IsAPI() ) @@ -404,7 +460,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) Help::DisableBalloonHelp(); SvtHelpOptions().SetExtendedHelp( bOn ); Invalidate(SID_HELPBALLOONS); - bDone = TRUE; + bDone = true; // ggf. recorden if ( !rReq.IsAPI() ) @@ -422,7 +478,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) : !aHelpOpt.IsHelpAgentAutoStartMode(); aHelpOpt.SetHelpAgentAutoStartMode( bOn ); Invalidate(SID_HELP_PI); - bDone = TRUE; + bDone = true; break; } @@ -464,7 +520,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) sBuildId.Insert( sProductSource, 0 ); } - // --> PB 2008-10-30 #i94693# + // Version information (in about box) (#i94693#) /* if the build ids of the basis or ure layer are different from the build id * of the brand layer then show them */ rtl::OUString aBasisProductBuildId( DEFINE_CONST_OUSTRING( @@ -482,7 +538,6 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) sTemp += String( aUREProductBuildId ); sBuildId.Insert( sTemp, sBuildId.Search( ')' ) ); } - // <-- // the build id format is "milestone(build)[cwsname]". For readability, it would // be nice to have some more spaces in there. @@ -508,7 +563,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) AboutDialog* pDlg = new AboutDialog( 0, aDialogResId, sBuildId ); pDlg->Execute(); delete pDlg; - bDone = TRUE; + bDone = true; break; } @@ -519,7 +574,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) new SfxTemplateOrganizeDlg(NULL); pDlg->Execute(); delete pDlg; - bDone = TRUE; + bDone = true; break; } @@ -527,7 +582,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) { svt::AddressBookSourceDialog aDialog(GetTopWindow(), ::comphelper::getProcessServiceFactory()); aDialog.Execute(); - bDone = TRUE; + bDone = true; break; } @@ -655,6 +710,18 @@ void SfxApplication::MiscState_Impl(SfxItemSet &rSet) break; } + case SID_CONFIG: + case SID_TOOLBOXOPTIONS: + case SID_CONFIGSTATUSBAR: + case SID_CONFIGMENU: + case SID_CONFIGACCEL: + case SID_CONFIGEVENT: + { + if( SvtMiscOptions().DisableUICustomization() ) + rSet.DisableItem(nWhich); + break; + } + case SID_BASICSTOP: if ( !StarBASIC::IsRunning() ) rSet.DisableItem(nWhich); @@ -731,7 +798,7 @@ void SfxApplication::MiscState_Impl(SfxItemSet &rSet) static const ::rtl::OUString& getProductRegistrationServiceName( ) { - static ::rtl::OUString s_sServiceName = ::rtl::OUString::createFromAscii( "com.sun.star.setup.ProductRegistration" ); + static ::rtl::OUString s_sServiceName(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.setup.ProductRegistration")); return s_sServiceName; } @@ -916,11 +983,17 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) { VclAbstractDialog* pDlg = pFact->CreateFrameDialog( NULL, xFrame, rReq.GetSlot(), sPageURL ); - pDlg->Execute(); + short nRet = pDlg->Execute(); delete pDlg; SfxViewFrame* pView = SfxViewFrame::GetFirst(); while ( pView ) { + if (nRet == RET_OK) + { + SfxObjectShell* pObjSh = pView->GetObjectShell(); + if (pObjSh) + pObjSh->SetConfigOptionsChecked(false); + } pView->GetBindings().InvalidateAll(FALSE); pView = SfxViewFrame::GetNext( *pView ); } @@ -987,7 +1060,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) // tell it that the user wants to register if ( xProductRegistration.is() ) { - xProductRegistration->trigger( ::rtl::OUString::createFromAscii( "RegistrationRequired" ) ); + xProductRegistration->trigger( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RegistrationRequired")) ); } } catch( const ::com::sun::star::uno::Exception& ) @@ -1227,13 +1300,13 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) Reference< com::sun::star::lang::XMultiServiceFactory > xORB = ::comphelper::getProcessServiceFactory(); Reference< com::sun::star::frame::XDispatchProvider > xProv( - xORB->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.drawing.ModuleDispatcher")), UNO_QUERY ); + xORB->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ModuleDispatcher"))), UNO_QUERY ); if ( xProv.is() ) { ::rtl::OUString aCmd = ::rtl::OUString::createFromAscii( GetInterface()->GetSlot( rReq.GetSlot() )->GetUnoName() ); Reference< com::sun::star::frame::XDispatchHelper > xHelper( - xORB->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.frame.DispatchHelper")), UNO_QUERY ); + xORB->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.DispatchHelper"))), UNO_QUERY ); if ( xHelper.is() ) { Sequence < com::sun::star::beans::PropertyValue > aSeq; @@ -1257,13 +1330,13 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) { Reference< com::sun::star::lang::XMultiServiceFactory > xORB = ::comphelper::getProcessServiceFactory(); Reference< com::sun::star::frame::XDispatchProvider > xProv( - xORB->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.text.ModuleDispatcher")), UNO_QUERY ); + xORB->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.ModuleDispatcher"))), UNO_QUERY ); if ( xProv.is() ) { ::rtl::OUString aCmd = ::rtl::OUString::createFromAscii( GetInterface()->GetSlot( rReq.GetSlot() )->GetUnoName() ); Reference< com::sun::star::frame::XDispatchHelper > xHelper( - xORB->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.frame.DispatchHelper")), UNO_QUERY ); + xORB->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.DispatchHelper"))), UNO_QUERY ); if ( xHelper.is() ) { Sequence < com::sun::star::beans::PropertyValue > aSeq; @@ -1345,3 +1418,5 @@ void SfxApplication::OfaState_Impl(SfxItemSet &rSet) if ( !aModuleOpt.IsImpress() ) rSet.DisableItem( SID_SD_AUTOPILOT ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index 078ed11a53..741f6a36f2 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -875,7 +876,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque #endif } } - // --> PB 2007-12-09 #i83757# + // API to raise options dialog with a specified options ab page (#i83757#) else { // transform parameter "OptionsPageURL" of slot "OptionsTreeDialog" @@ -897,7 +898,6 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque } } } - // <-- #ifdef DB_UTIL if ( nFoundArgs == nCount ) { @@ -1027,6 +1027,8 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta nAdditional++; if ( rSet.GetItemState( SID_DOC_READONLY ) == SFX_ITEM_SET ) nAdditional++; + if ( rSet.GetItemState( SID_DDE_RECONNECT_ONLOAD ) == SFX_ITEM_SET ) + nAdditional++; if ( rSet.GetItemState( SID_DOC_STARTPRESENTATION ) == SFX_ITEM_SET ) nAdditional++; if ( rSet.GetItemState( SID_SELECTION ) == SFX_ITEM_SET ) @@ -1688,7 +1690,7 @@ void SAL_CALL SfxMacroLoader::dispatchWithNotification( const ::com::sun::star:: const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchResultListener >& xListener ) throw (::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; sal_uInt32 nPropertyCount = lArgs.getLength(); ::rtl::OUString aReferer; @@ -1733,7 +1735,7 @@ void SAL_CALL SfxMacroLoader::dispatch( const ::com::sun::star::util::URL& const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArgs ) throw (::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; sal_uInt32 nPropertyCount = lArgs.getLength(); ::rtl::OUString aReferer; @@ -2011,7 +2013,7 @@ throw( RuntimeException ) Sequence< sal_Int16 > SAL_CALL SfxAppDispatchProvider::getSupportedCommandGroups() throw (::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; std::list< sal_Int16 > aGroupList; SfxSlotPool* pAppSlotPool = &SFX_APP()->GetAppSlotPool_Impl(); @@ -2046,7 +2048,7 @@ throw (::com::sun::star::uno::RuntimeException) { std::list< ::com::sun::star::frame::DispatchInformation > aCmdList; - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; SfxSlotPool* pAppSlotPool = &SFX_APP()->GetAppSlotPool_Impl(); if ( pAppSlotPool ) @@ -2208,13 +2210,6 @@ SFX2_DLLPUBLIC void* SAL_CALL component_getFactory( IF_NAME_CREATECOMPONENTFACTORY( TestMouseClickHandler ) #endif IF_NAME_CREATECOMPONENTFACTORY( OPackageStructureCreator ) - #if 0 - if ( ::sfx2::AppletObject::impl_getStaticImplementationName().equals( - ::rtl::OUString::createFromAscii( pImplementationName ) ) ) - { - xFactory = ::sfx2::AppletObject::impl_createFactory(); - } - #endif IF_NAME_CREATECOMPONENTFACTORY( ::sfx2::PluginObject ) IF_NAME_CREATECOMPONENTFACTORY( ::sfx2::IFrameObject ) IF_NAME_CREATECOMPONENTFACTORY( ::sfx2::OwnSubFilterService ) @@ -2226,6 +2221,16 @@ SFX2_DLLPUBLIC void* SAL_CALL component_getFactory( ::comp_SfxDocumentMetaData::_getImplementationName(), ::comp_SfxDocumentMetaData::_getSupportedServiceNames()); } + if ( ::comp_CompatWriterDocProps::_getImplementationName().equals( + ::rtl::OUString::createFromAscii( pImplementationName ) ) ) + { + xFactory = ::cppu::createSingleComponentFactory( + ::comp_CompatWriterDocProps::_create, + ::comp_CompatWriterDocProps::_getImplementationName(), + ::comp_CompatWriterDocProps::_getSupportedServiceNames()); + } + + // Factory is valid - service was found. // Factory is valid - service was found. if ( xFactory.is() ) @@ -2427,3 +2432,4 @@ com::sun::star::uno::Reference < ::com::sun::star::task::XInteractionRequest > N return com::sun::star::uno::Reference < ::com::sun::star::task::XInteractionRequest >(pImp); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx index 639fe81c9a..17a274b4e5 100644 --- a/sfx2/source/appl/childwin.cxx +++ b/sfx2/source/appl/childwin.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,10 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" -#ifndef _TOOLBOX_HXX //autogen #include <vcl/toolbox.hxx> -#endif -#ifndef _RCID_H #include <tools/rcid.h> #endif #include <unotools/viewoptions.hxx> @@ -40,9 +38,6 @@ #include <com/sun/star/util/XCloseable.hpp> #include <cppuhelper/implbase1.hxx> -#ifndef GCC -#endif - #include <sfx2/childwin.hxx> #include <sfx2/app.hxx> #include "arrdecl.hxx" @@ -378,43 +373,6 @@ sal_uInt16 SfxChildWindow::GetPosition() return pImp->pFact->nPos; } -#if 0 -static void ImplWindowStateFromStr( Point rPos, Size rSize, const ByteString& rStr ) -{ - ULONG nValidMask = 0; - xub_StrLen nIndex = 0; - ByteString aTokenStr; - - aTokenStr = rStr.GetToken( 0, ',', nIndex ); - if ( aTokenStr.Len() ) - { - rPos.X() = aTokenStr.ToInt32(); - nValidMask |= WINDOWSTATE_MASK_X; - } - - aTokenStr = rStr.GetToken( 0, ',', nIndex ); - if ( aTokenStr.Len() ) - { - rPos.Y() = aTokenStr.ToInt32(); - nValidMask |= WINDOWSTATE_MASK_Y; - } - - aTokenStr = rStr.GetToken( 0, ',', nIndex ); - if ( aTokenStr.Len() ) - { - rSize.Width() = aTokenStr.ToInt32(); - nValidMask |= WINDOWSTATE_MASK_WIDTH; - } - - aTokenStr = rStr.GetToken( 0, ';', nIndex ); - if ( aTokenStr.Len() ) - { - rSize.Height() = aTokenStr.ToInt32(); - nValidMask |= WINDOWSTATE_MASK_HEIGHT; - } -} -#endif - //------------------------------------------------------------------------- void SfxChildWindow::InitializeChildWinFactory_Impl( sal_uInt16 nId, SfxChildWinInfo& rInfo ) { @@ -853,3 +811,4 @@ void SfxChildWindow::RegisterChildWindow(SfxModule* pMod, SfxChildWinFactory* pF SFX_APP()->RegisterChildWindow_Impl( pMod, pFact ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/fileobj.cxx b/sfx2/source/appl/fileobj.cxx index 7da8dd8d53..2f3241150b 100644 --- a/sfx2/source/appl/fileobj.cxx +++ b/sfx2/source/appl/fileobj.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -418,7 +419,7 @@ String impl_getFilter( const String& _rURL ) { css::uno::Reference< ::com::sun::star::document::XTypeDetection > xTypeDetection( ::comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString::createFromAscii("com.sun.star.document.TypeDetection") ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.TypeDetection")) ), css::uno::UNO_QUERY ); if ( xTypeDetection.is() ) { @@ -435,7 +436,7 @@ String impl_getFilter( const String& _rURL ) { ::comphelper::SequenceAsHashMap lTypeProps( xTypeCont->getByName( sType ) ); sFilter = lTypeProps.getUnpackedValueOrDefault( - ::rtl::OUString::createFromAscii("PreferredFilter"), ::rtl::OUString() ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PreferredFilter")), ::rtl::OUString() ); } } } @@ -704,3 +705,4 @@ void SvFileObject::SendStateChg_Impl( sfx2::LinkManager::LinkState nState ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/fileobj.hxx b/sfx2/source/appl/fileobj.hxx index 98fa3ae622..622a125c81 100644 --- a/sfx2/source/appl/fileobj.hxx +++ b/sfx2/source/appl/fileobj.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -93,3 +94,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/fwkhelper.cxx b/sfx2/source/appl/fwkhelper.cxx index 76b58f1048..b0f3ffc20c 100644 --- a/sfx2/source/appl/fwkhelper.cxx +++ b/sfx2/source/appl/fwkhelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,7 +32,7 @@ #include <com/sun/star/frame/XFrame.hpp> #include "sal/config.h" -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <vcl/svapp.hxx> #include "workwin.hxx" @@ -39,7 +40,7 @@ void SAL_CALL RefreshToolbars( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( xFrame.is() ) { SfxFrame* pFrame=0; @@ -57,3 +58,5 @@ void SAL_CALL RefreshToolbars( ::com::sun::star::uno::Reference< ::com::sun::sta } } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/helpdispatch.cxx b/sfx2/source/appl/helpdispatch.cxx index 40d43948e0..22e3e5d664 100644 --- a/sfx2/source/appl/helpdispatch.cxx +++ b/sfx2/source/appl/helpdispatch.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -121,3 +122,4 @@ void SAL_CALL HelpDispatch_Impl::removeStatusListener( m_xRealDispatch->removeStatusListener( xControl, aURL ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/helpdispatch.hxx b/sfx2/source/appl/helpdispatch.hxx index 706a67d5c3..685f2b8101 100644 --- a/sfx2/source/appl/helpdispatch.hxx +++ b/sfx2/source/appl/helpdispatch.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -52,3 +53,4 @@ public: #endif // #ifndef SFX_HELPDISPATCHER_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/helpinterceptor.cxx b/sfx2/source/appl/helpinterceptor.cxx index ced2134917..c3b75353d9 100644 --- a/sfx2/source/appl/helpinterceptor.cxx +++ b/sfx2/source/appl/helpinterceptor.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -62,9 +63,12 @@ HelpInterceptor_Impl::HelpInterceptor_Impl() : HelpInterceptor_Impl::~HelpInterceptor_Impl() { - for ( USHORT i = 0; m_pHistory && i < m_pHistory->Count(); ++i ) - delete m_pHistory->GetObject(i); - delete m_pHistory; + if ( m_pHistory ) + { + for ( size_t i = 0, n = m_pHistory->size(); i < n; ++i ) + delete m_pHistory->at( i ); + delete m_pHistory; + } } // ----------------------------------------------------------------------- @@ -73,26 +77,32 @@ void HelpInterceptor_Impl::addURL( const String& rURL ) { if ( !m_pHistory ) m_pHistory = new HelpHistoryList_Impl; - ULONG nCount = m_pHistory->Count(); + + size_t nCount = m_pHistory->size(); if ( nCount && m_nCurPos < ( nCount - 1 ) ) { - for ( ULONG i = nCount - 1; i > m_nCurPos; i-- ) - delete m_pHistory->Remove(i); + for ( size_t i = nCount - 1; i > m_nCurPos; i-- ) + { + delete m_pHistory->at( i ); + HelpHistoryList_Impl::iterator it = m_pHistory->begin(); + ::std::advance( it, i ); + m_pHistory->erase( it ); + } } Reference<XFrame> xFrame(m_xIntercepted, UNO_QUERY); Reference<XController> xController; if(xFrame.is()) xController = xFrame->getController(); Any aViewData; - if(xController.is() && m_pHistory->Count()) + if(xController.is() && !m_pHistory->empty()) { - m_pHistory->GetObject(m_nCurPos)->aViewData = xController->getViewData(); + m_pHistory->at( m_nCurPos )->aViewData = xController->getViewData(); } m_aCurrentURL = rURL; Any aEmptyViewData; - m_pHistory->Insert( new HelpHistoryEntry_Impl( rURL, aEmptyViewData ), LIST_APPEND ); - m_nCurPos = m_pHistory->Count() - 1; + m_pHistory->push_back( new HelpHistoryEntry_Impl( rURL, aEmptyViewData ) ); + m_nCurPos = m_pHistory->size() - 1; // TODO ? if ( m_xListener.is() ) { @@ -126,8 +136,8 @@ void HelpInterceptor_Impl::SetStartURL( const String& rURL ) { m_pHistory = new HelpHistoryList_Impl; Any aEmptyViewData; - m_pHistory->Insert( new HelpHistoryEntry_Impl( rURL, aEmptyViewData ), ((ULONG)0x0) ); - m_nCurPos = m_pHistory->Count() - 1; + m_pHistory->insert( m_pHistory->begin(), new HelpHistoryEntry_Impl( rURL, aEmptyViewData ) ); + m_nCurPos = m_pHistory->size() - 1; m_pWindow->UpdateToolbox(); } @@ -141,7 +151,7 @@ sal_Bool HelpInterceptor_Impl::HasHistoryPred() const sal_Bool HelpInterceptor_Impl::HasHistorySucc() const { - return m_pHistory && ( m_nCurPos < ( m_pHistory->Count() - 1 ) ); + return m_pHistory && ( m_nCurPos < ( m_pHistory->size() - 1 ) ); } @@ -161,7 +171,7 @@ Reference< XDispatch > SAL_CALL HelpInterceptor_Impl::queryDispatch( // INetURLObject aObj( aURL.Complete ); // sal_Bool bHelpURL = ( aObj.GetProtocol() == INET_PROT_VND_SUN_STAR_HELP ); - BOOL bHelpURL = aURL.Complete.toAsciiLowerCase().match(rtl::OUString::createFromAscii("vnd.sun.star.help"),0); + BOOL bHelpURL = aURL.Complete.toAsciiLowerCase().match(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.help")),0); if ( bHelpURL ) { @@ -257,7 +267,7 @@ void SAL_CALL HelpInterceptor_Impl::dispatch( { if ( m_pHistory ) { - if(m_pHistory->Count() > m_nCurPos) + if(m_pHistory->size() > m_nCurPos) { Reference<XFrame> xFrame(m_xIntercepted, UNO_QUERY); Reference<XController> xController; @@ -265,18 +275,18 @@ void SAL_CALL HelpInterceptor_Impl::dispatch( xController = xFrame->getController(); if(xController.is()) { - m_pHistory->GetObject(m_nCurPos)->aViewData = xController->getViewData(); + m_pHistory->at( m_nCurPos )->aViewData = xController->getViewData(); } } - + ULONG nPos = ( bBack && m_nCurPos > 0 ) ? --m_nCurPos - : ( !bBack && m_nCurPos < m_pHistory->Count() - 1 ) + : ( !bBack && m_nCurPos < m_pHistory->size() - 1 ) ? ++m_nCurPos : ULONG_MAX; if ( nPos < ULONG_MAX ) { - HelpHistoryEntry_Impl* pEntry = m_pHistory->GetObject( nPos ); + HelpHistoryEntry_Impl* pEntry = m_pHistory->at( nPos ); if ( pEntry ) m_pWindow->loadHelpContent(pEntry->aURL, sal_False); // false => dont add item to history again! } @@ -333,35 +343,29 @@ void SAL_CALL HelpListener_Impl::disposing( const ::com::sun::star::lang::EventO pInterceptor->removeStatusListener( this, ::com::sun::star::util::URL() ); pInterceptor = NULL; } -/*-- 05.09.2002 12:17:59--------------------------------------------------- - -----------------------------------------------------------------------*/ HelpStatusListener_Impl::HelpStatusListener_Impl( Reference < XDispatch > aDispatch, URL& rURL) { aDispatch->addStatusListener(this, rURL); } -/*-- 05.09.2002 12:17:59--------------------------------------------------- - -----------------------------------------------------------------------*/ HelpStatusListener_Impl::~HelpStatusListener_Impl() { if(xDispatch.is()) xDispatch->removeStatusListener(this, com::sun::star::util::URL()); } -/*-- 05.09.2002 12:17:59--------------------------------------------------- - -----------------------------------------------------------------------*/ void HelpStatusListener_Impl::statusChanged( const FeatureStateEvent& rEvent ) throw( RuntimeException ) { aStateEvent = rEvent; } -/*-- 05.09.2002 12:18:00--------------------------------------------------- - -----------------------------------------------------------------------*/ void HelpStatusListener_Impl::disposing( const EventObject& ) throw( RuntimeException ) { xDispatch->removeStatusListener(this, com::sun::star::util::URL()); xDispatch = 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/helpinterceptor.hxx b/sfx2/source/appl/helpinterceptor.hxx index 5fe4addcb3..9f2fe8a495 100644 --- a/sfx2/source/appl/helpinterceptor.hxx +++ b/sfx2/source/appl/helpinterceptor.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,9 +28,7 @@ #ifndef INCLUDED_SFX_HELPINTERCEPTOR_HXX #define INCLUDED_SFX_HELPINTERCEPTOR_HXX -#ifndef _CPPUHELPER_IMPLBASE2_HXX_ #include <cppuhelper/implbase3.hxx> -#endif #include <com/sun/star/frame/XDispatchProviderInterceptor.hpp> #include <com/sun/star/frame/XInterceptorInfo.hpp> #include <com/sun/star/frame/XDispatch.hpp> @@ -40,17 +39,18 @@ #include <tools/string.hxx> #include <tools/list.hxx> #include <tools/link.hxx> +#include <vector> struct HelpHistoryEntry_Impl { String aURL; com::sun::star::uno::Any aViewData; - HelpHistoryEntry_Impl( const String& rURL, const com::sun::star::uno::Any& rViewData ) : + HelpHistoryEntry_Impl( const String& rURL, const com::sun::star::uno::Any& rViewData ) : aURL( rURL ), aViewData(rViewData) {} }; -DECLARE_LIST(HelpHistoryList_Impl,HelpHistoryEntry_Impl*) +typedef ::std::vector< HelpHistoryEntry_Impl* > HelpHistoryList_Impl; class SfxHelpWindow_Impl; class HelpInterceptor_Impl : public ::cppu::WeakImplHelper3< @@ -92,7 +92,7 @@ public: const com::sun::star::uno::Any& GetViewData()const {return m_aViewData;} - + sal_Bool HasHistoryPred() const; // is there a predecessor for the current in the history sal_Bool HasHistorySucc() const; // is there a successor for the current in the history @@ -171,3 +171,4 @@ public: #endif // #ifndef INCLUDED_SFX_HELPINTERCEPTOR_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/imagemgr.cxx b/sfx2/source/appl/imagemgr.cxx index 59714d0570..0284cb8db8 100644 --- a/sfx2/source/appl/imagemgr.cxx +++ b/sfx2/source/appl/imagemgr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -66,10 +67,6 @@ typedef std::hash_map< ::rtl::OUString, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > ModuleIdToImagegMgr; -static WeakReference< XModuleManager > m_xModuleManager; -static WeakReference< XModuleUIConfigurationManagerSupplier > m_xModuleCfgMgrSupplier; -static WeakReference< XURLTransformer > m_xURLTransformer; -static ModuleIdToImagegMgr m_aModuleIdToImageMgrMap; Image SAL_CALL GetImage( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& aURL, BOOL bBig, BOOL bHiContrast ) { @@ -90,22 +87,6 @@ Image SAL_CALL GetImage( const ::com::sun::star::uno::Reference< ::com::sun::sta rtl::OUString aCommandURL( aURL ); if ( nProtocol == INET_PROT_SLOT ) { - /* - // Support old way to retrieve image via slot URL - Reference< XURLTransformer > xURLTransformer = m_xURLTransformer; - if ( !xURLTransformer.is() ) - { - xURLTransformer = Reference< XURLTransformer >( - ::comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), - UNO_QUERY ); - m_xURLTransformer = xURLTransformer; - } - - URL aTargetURL; - aTargetURL.Complete = aURL; - xURLTransformer->parseStrict( aTargetURL ); - USHORT nId = ( USHORT ) aTargetURL.Path.toInt32();*/ USHORT nId = ( USHORT ) String(aURL).Copy(5).ToInt32(); const SfxSlot* pSlot = 0; if ( xModel.is() ) @@ -147,8 +128,6 @@ Image SAL_CALL GetImage( const ::com::sun::star::uno::Reference< ::com::sun::sta ::com::sun::star::ui::ImageType::SIZE_DEFAULT ); if ( bBig ) nImageType |= ::com::sun::star::ui::ImageType::SIZE_LARGE; - if ( bHiContrast ) - nImageType |= ::com::sun::star::ui::ImageType::COLOR_HIGHCONTRAST; if ( xDocImgMgr.is() ) { @@ -170,6 +149,8 @@ Image SAL_CALL GetImage( const ::com::sun::star::uno::Reference< ::com::sun::sta } } + static WeakReference< XModuleManager > m_xModuleManager; + Reference< XModuleManager > xModuleManager = m_xModuleManager; if ( !xModuleManager.is() ) @@ -188,11 +169,16 @@ Image SAL_CALL GetImage( const ::com::sun::star::uno::Reference< ::com::sun::sta { Reference< XImageManager > xModuleImageManager; rtl::OUString aModuleId = xModuleManager->identify( rFrame ); + + static ModuleIdToImagegMgr m_aModuleIdToImageMgrMap; + ModuleIdToImagegMgr::iterator pIter = m_aModuleIdToImageMgrMap.find( aModuleId ); if ( pIter != m_aModuleIdToImageMgrMap.end() ) xModuleImageManager = pIter->second; else { + static WeakReference< XModuleUIConfigurationManagerSupplier > m_xModuleCfgMgrSupplier; + Reference< XModuleUIConfigurationManagerSupplier > xModuleCfgMgrSupplier = m_xModuleCfgMgrSupplier; if ( !xModuleCfgMgrSupplier.is() ) @@ -223,7 +209,7 @@ Image SAL_CALL GetImage( const ::com::sun::star::uno::Reference< ::com::sun::sta if ( !!aImage ) return aImage; else if ( nProtocol != INET_PROT_UNO && nProtocol != INET_PROT_SLOT ) - return SvFileInformationManager::GetImageNoDefault( aObj, bBig, bHiContrast ); + return SvFileInformationManager::GetImageNoDefault( aObj, bBig ); } } catch ( Exception& ) @@ -232,3 +218,5 @@ Image SAL_CALL GetImage( const ::com::sun::star::uno::Reference< ::com::sun::sta return Image(); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/imestatuswindow.cxx b/sfx2/source/appl/imestatuswindow.cxx index 53639a65df..7e6916f01c 100644 --- a/sfx2/source/appl/imestatuswindow.cxx +++ b/sfx2/source/appl/imestatuswindow.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -50,7 +51,7 @@ #include "rtl/ustring.hxx" #include "sal/types.h" #include "vcl/svapp.hxx" -#include "vos/mutex.hxx" +#include "osl/mutex.hxx" namespace css = com::sun::star; @@ -229,3 +230,4 @@ css::uno::Reference< css::beans::XPropertySet > ImeStatusWindow::getConfig() return xConfig; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/imestatuswindow.hxx b/sfx2/source/appl/imestatuswindow.hxx index 2d310c60c7..7c3ca11a15 100644 --- a/sfx2/source/appl/imestatuswindow.hxx +++ b/sfx2/source/appl/imestatuswindow.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -123,3 +124,5 @@ private: } } #endif // INCLUDED_SFX2_APPL_IMESTATUSWINDOW_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/impldde.cxx b/sfx2/source/appl/impldde.cxx index 6598b066d4..5aa7cefa1d 100644 --- a/sfx2/source/appl/impldde.cxx +++ b/sfx2/source/appl/impldde.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -151,7 +152,7 @@ BOOL SvDDEObject::GetData( ::com::sun::star::uno::Any & rData /*out param*/, if( !pConnection ) return FALSE; - if( pConnection->GetError() ) // dann versuchen wir es nochmal + if( pConnection->GetError() ) // then we try once more { String sServer( pConnection->GetServiceName() ); String sTopic( pConnection->GetTopicName() ); @@ -162,13 +163,13 @@ BOOL SvDDEObject::GetData( ::com::sun::star::uno::Any & rData /*out param*/, nError = DDELINK_ERROR_APP; } - if( bWaitForData ) // wir sind rekursiv drin, wieder raus + if( bWaitForData ) // we are in an rekursive loop, get out again return FALSE; - // Verriegeln gegen Reentrance + // Lock against Reentrance bWaitForData = TRUE; - // falls gedruckt werden soll, warten wir bis die Daten vorhanden sind + // if you want to print, we'll wait until the data is available if( bSynchron ) { DdeRequest aReq( *pConnection, sItem, 5000 ); @@ -188,8 +189,8 @@ BOOL SvDDEObject::GetData( ::com::sun::star::uno::Any & rData /*out param*/, } else { - // ansonsten wird es asynchron ausgefuehrt -// if( !pLink || !pLink->IsBusy() ) + // otherwise it will be executed asynchronously +// if( !pLink || !pLink->IsBusy() ) { if( pRequest ) delete pRequest; @@ -215,9 +216,9 @@ BOOL SvDDEObject::Connect( SvBaseLink * pSvLink ) static BOOL bInWinExec = FALSE; #endif USHORT nLinkType = pSvLink->GetUpdateMode(); - if( pConnection ) // Verbindung steht ja schon + if( pConnection ) // Connection is already made { - // tja, dann nur noch als Abhaengig eintragen + // well, then just add it as dependent AddDataAdvise( pSvLink, SotExchange::GetFormatMimeType( pSvLink->GetContentType()), LINKUPDATE_ONCALL == nLinkType @@ -242,6 +243,8 @@ BOOL SvDDEObject::Connect( SvBaseLink * pSvLink ) { // kann man denn das System-Topic ansprechen ? // dann ist der Server oben, kennt nur nicht das Topic! + // Is it possible to address the system-Topic? + // then the server is up, it just does not know the topic! if( sTopic.EqualsIgnoreCaseAscii( "SYSTEM" ) ) { BOOL bSysTopic; @@ -255,12 +258,12 @@ BOOL SvDDEObject::Connect( SvBaseLink * pSvLink ) nError = DDELINK_ERROR_DATA; return FALSE; } - // ansonsten unter Win/WinNT die Applikation direkt starten + // otherwise in Win/WinNT, start the Application directly } #if defined(WNT) - // Server nicht da, starten und nochmal versuchen + // Server not up, try once more to start it. if( !bInWinExec ) { ByteString aCmdLine( sServer, RTL_TEXTENCODING_ASCII_US ); @@ -299,7 +302,7 @@ BOOL SvDDEObject::Connect( SvBaseLink * pSvLink ) if( LINKUPDATE_ALWAYS == nLinkType && !pLink && !pConnection->GetError() ) { - // Hot Link einrichten, Daten kommen irgendwann spaeter + // Setting up Hot Link, Data will be available at some point later on pLink = new DdeHotLink( *pConnection, sItem ); pLink->SetDataHdl( LINK( this, SvDDEObject, ImplGetDDEData ) ); pLink->SetDoneHdl( LINK( this, SvDDEObject, ImplDoneDDEData ) ); @@ -352,22 +355,22 @@ BOOL SvDDEObject::ImplHasOtherFormat( DdeTransaction& rReq ) nFmt = FORMAT_GDIMETAFILE; break; - // sonst noch irgendwas ?? + // something else? } if( nFmt ) - rReq.SetFormat( nFmt ); // damit nochmal versuchen + rReq.SetFormat( nFmt ); // try it once more return 0 != nFmt; } BOOL SvDDEObject::IsPending() const -/* [Beschreibung] - - Die Methode stellt fest, ob aus einem DDE-Object die Daten gelesen - werden kann. - Zurueckgegeben wird: - ERRCODE_NONE wenn sie komplett gelesen wurde - ERRCODE_SO_PENDING wenn sie noch nicht komplett gelesen wurde - ERRCODE_SO_FALSE sonst +/* [Description] + + The method determines whether the data-object can be read from a DDE. + + Returned is the following: + ERRCODE_NONE if it has been completely read + ERRCODE_SO_PENDING if it has not been completely read + ERRCODE_SO_FALSE otherwise */ { return bWaitForData; @@ -397,8 +400,8 @@ IMPL_LINK( SvDDEObject, ImplGetDDEData, DdeData*, pData ) Sequence< sal_Int8 > aSeq( (const sal_Int8*)p, nLen ); if( pGetData ) { - *pGetData <<= aSeq; // Daten kopieren - pGetData = 0; // und den Pointer bei mir zuruecksetzen + *pGetData <<= aSeq; // Copy Data + pGetData = 0; // reset the pointer here } else { @@ -421,9 +424,9 @@ IMPL_LINK( SvDDEObject, ImplDoneDDEData, void*, pData ) { DdeTransaction* pReq = 0; if( !pLink || ( pLink && pLink->IsBusy() )) - pReq = pRequest; // dann kann nur der fertig sein + pReq = pRequest; // only the one that is ready else if( pRequest && pRequest->IsBusy() ) - pReq = pLink; // dann kann nur der fertig sein + pReq = pLink; // only the one that is ready if( pReq ) { @@ -433,16 +436,17 @@ IMPL_LINK( SvDDEObject, ImplDoneDDEData, void*, pData ) } else if( pReq == pRequest ) { - // das wars dann bWaitForData = FALSE; } } } else - // das warten ist beendet + // End waiting bWaitForData = FALSE; return 0; } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/impldde.hxx b/sfx2/source/appl/impldde.hxx index eab554c46d..86734c6fe3 100644 --- a/sfx2/source/appl/impldde.hxx +++ b/sfx2/source/appl/impldde.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -48,8 +49,8 @@ class SvDDEObject : public SvLinkSource DdeRequest* pRequest; ::com::sun::star::uno::Any * pGetData; - BYTE bWaitForData : 1; // wird auf Daten gewartet? - BYTE nError : 7; // Error Code fuer den Dialog + BYTE bWaitForData : 1; // waiting for data? + BYTE nError : 7; // Error code for dialogue BOOL ImplHasOtherFormat( DdeTransaction& ); @@ -76,3 +77,5 @@ public: } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx index dc6e680213..9956760499 100644 --- a/sfx2/source/appl/linkmgr2.cxx +++ b/sfx2/source/appl/linkmgr2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -89,16 +90,34 @@ LinkManager::~LinkManager() } } +void LinkManager::InsertCachedComp(const Reference<XComponent>& xComp) +{ + maCachedComps.push_back(xComp); +} + +void LinkManager::CloseCachedComps() +{ + CompVector::iterator itr = maCachedComps.begin(), itrEnd = maCachedComps.end(); + for (; itr != itrEnd; ++itr) + { + Reference<XCloseable> xCloseable(*itr, UNO_QUERY); + if (!xCloseable.is()) + continue; + + xCloseable->close(true); + } + maCachedComps.clear(); +} /************************************************************************ |* LinkManager::Remove() |* -|* Beschreibung +|* Description *************************************************************************/ void LinkManager::Remove( SvBaseLink *pLink ) { - // keine Links doppelt einfuegen + // No duplicate links inserted int bFound = FALSE; SvBaseLinkRef** ppRef = (SvBaseLinkRef**)aLinkTbl.GetData(); for( USHORT n = aLinkTbl.Count(); n; --n, ++ppRef ) @@ -111,7 +130,7 @@ void LinkManager::Remove( SvBaseLink *pLink ) bFound = TRUE; } - // falls noch leere rum stehen sollten, weg damit + // Remove emty ones if they exist if( !(*ppRef)->Is() ) { delete *ppRef; @@ -148,7 +167,7 @@ void LinkManager::Remove( USHORT nPos, USHORT nCnt ) BOOL LinkManager::Insert( SvBaseLink* pLink ) { - // keine Links doppelt einfuegen + // No duplicate links inserted for( USHORT n = 0; n < aLinkTbl.Count(); ++n ) { SvBaseLinkRef* pTmp = aLinkTbl[ n ]; @@ -171,7 +190,7 @@ BOOL LinkManager::InsertLink( SvBaseLink * pLink, USHORT nUpdateMode, const String* pName ) { - // unbedingt zuerst + // This First pLink->SetObjType( nObjType ); if( pName ) pLink->SetName( *pName ); @@ -277,14 +296,14 @@ BOOL LinkManager::GetDisplayNames( const SvBaseLink * pLink, void LinkManager::UpdateAllLinks( BOOL bAskUpdate, BOOL /*bCallErrHdl*/, - BOOL bUpdateGrfLinks, + BOOL bUpdateGrfLinks, Window* pParentWin ) { SvStringsDtor aApps, aTopics, aItems; String sApp, sTopic, sItem; - // erstmal eine Kopie vom Array machen, damit sich updatende Links in - // Links in ... nicht dazwischen funken!! + // First make a copy of the array in order to update links + // links in ... no contact between them! SvPtrarr aTmpArr( 255, 50 ); USHORT n; for( n = 0; n < aLinkTbl.Count(); ++n ) @@ -302,7 +321,7 @@ void LinkManager::UpdateAllLinks( { SvBaseLink* pLink = (SvBaseLink*)aTmpArr[ n ]; - // suche erstmal im Array nach dem Eintrag + // search first in the array after the entry USHORT nFndPos = USHRT_MAX; for( USHORT i = 0; i < aLinkTbl.Count(); ++i ) if( pLink == *aLinkTbl[ i ] ) @@ -312,9 +331,9 @@ void LinkManager::UpdateAllLinks( } if( USHRT_MAX == nFndPos ) - continue; // war noch nicht vorhanden! + continue; // was not available! - // Graphic-Links noch nicht updaten + // Graphic-Links not to update jet if( !pLink->IsVisible() || ( !bUpdateGrfLinks && OBJECT_CLIENT_GRF == pLink->GetObjType() )) continue; @@ -323,18 +342,19 @@ void LinkManager::UpdateAllLinks( { int nRet = QueryBox( pParentWin, WB_YES_NO | WB_DEF_YES, SfxResId( STR_QUERY_UPDATE_LINKS ) ).Execute(); if( RET_YES != nRet ) - return ; // es soll nichts geupdatet werden - bAskUpdate = FALSE; // einmal reicht + return ; // nothing should be updated + bAskUpdate = FALSE; // once is enough } pLink->Update(); } + CloseCachedComps(); } /************************************************************************ |* SvBaseLink::CreateObject() |* -|* Beschreibung +|* Description *************************************************************************/ SvLinkSourceRef LinkManager::CreateObj( SvBaseLink * pLink ) @@ -356,7 +376,7 @@ SvLinkSourceRef LinkManager::CreateObj( SvBaseLink * pLink ) BOOL LinkManager::InsertServer( SvLinkSource* pObj ) { - // keine doppelt einfuegen + // no duplicate inserts if( !pObj || USHRT_MAX != aServerTbl.GetPos( pObj ) ) return FALSE; @@ -634,3 +654,4 @@ BOOL SvxInternalLink::Connect( sfx2::SvBaseLink* pLink ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/linksrc.cxx b/sfx2/source/appl/linksrc.cxx index 01503faee9..cbd000a3fd 100644 --- a/sfx2/source/appl/linksrc.cxx +++ b/sfx2/source/appl/linksrc.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,7 +31,6 @@ #include <sfx2/linksrc.hxx> #include <sfx2/lnkbase.hxx> -//#include <sot/exchange.hxx> #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Sequence.hxx> @@ -46,7 +46,6 @@ namespace sfx2 TYPEINIT0( SvLinkSource ) -/************** class SvLinkSourceTimer *********************************/ class SvLinkSourceTimer : public Timer { SvLinkSource * pOwner; @@ -62,7 +61,7 @@ SvLinkSourceTimer::SvLinkSourceTimer( SvLinkSource * pOwn ) void SvLinkSourceTimer::Timeout() { - // sicher gegen zerstoeren im Handler + // Secure against beeing destroyed in Handler SvLinkSourceRef aAdv( pOwner ); pOwner->SendDataChanged(); } @@ -209,12 +208,11 @@ void SvLinkSource::setStreamToLoadFrom(const com::sun::star::uno::Reference<com: pImpl->m_bIsReadOnly = bIsReadOnly; } -// --> OD 2008-06-18 #i88291# +// #i88291# void SvLinkSource::clearStreamToLoadFrom() { pImpl->m_xInputStreamToLoadFrom.clear(); } -// <-- void SvLinkSource::Closed() { @@ -277,7 +275,7 @@ void SvLinkSource::SendDataChanged() void SvLinkSource::NotifyDataChanged() { if( pImpl->nTimeout ) - StartTimer( &pImpl->pTimer, this, pImpl->nTimeout ); // Timeout neu + StartTimer( &pImpl->pTimer, this, pImpl->nTimeout ); // New timeout else { SvLinkSource_EntryIter_Impl aIter( pImpl->aArr ); @@ -316,10 +314,10 @@ void SvLinkSource::DataChanged( const String & rMimeType, const ::com::sun::star::uno::Any & rVal ) { if( pImpl->nTimeout && !rVal.hasValue() ) - { // nur wenn keine Daten mitgegeben wurden + { // only when no data was included // fire all data to the sink, independent of the requested format pImpl->aDataMimeType = rMimeType; - StartTimer( &pImpl->pTimer, this, pImpl->nTimeout ); // Timeout neu + StartTimer( &pImpl->pTimer, this, pImpl->nTimeout ); // New timeout } else { @@ -433,3 +431,4 @@ void SvLinkSource::Edit( Window *, SvBaseLink *, const Link& ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/lnkbase2.cxx b/sfx2/source/appl/lnkbase2.cxx index d8fdcd5943..8c9f1fd2e3 100644 --- a/sfx2/source/appl/lnkbase2.cxx +++ b/sfx2/source/appl/lnkbase2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -72,16 +73,16 @@ struct BaseLink_Impl { delete m_pFileDlg; } }; -// nur fuer die interne Verwaltung +// only for internal management struct ImplBaseLinkData { struct tClientType { - // gilt fuer alle Links - ULONG nCntntType; // Update Format - // nicht Ole-Links - BOOL bIntrnlLnk; // ist es ein interner Link - USHORT nUpdateMode;// UpdateMode + // applies for all links + ULONG nCntntType; // Update Format + // Not Ole-Links + BOOL bIntrnlLnk; // It is an internal link + USHORT nUpdateMode; // UpdateMode }; struct tDDEType @@ -107,7 +108,7 @@ class ImplDdeItem : public DdeGetPutItem { SvBaseLink* pLink; DdeData aData; - Sequence< sal_Int8 > aSeq; // Datacontainer for DdeData !!! + Sequence< sal_Int8 > aSeq; // Datacontainer for DdeData !!! BOOL bIsValidData : 1; BOOL bIsInDTOR : 1; public: @@ -132,9 +133,9 @@ public: /************************************************************************ -|* SvBaseLink::SvBaseLink() +|* SvBaseLink::SvBaseLink() |* -|* Beschreibung +|* Description *************************************************************************/ SvBaseLink::SvBaseLink() @@ -147,9 +148,9 @@ SvBaseLink::SvBaseLink() } /************************************************************************ -|* SvBaseLink::SvBaseLink() +|* SvBaseLink::SvBaseLink() |* -|* Beschreibung +|* Description *************************************************************************/ SvBaseLink::SvBaseLink( USHORT nUpdateMode, ULONG nContentType ) @@ -160,16 +161,16 @@ SvBaseLink::SvBaseLink( USHORT nUpdateMode, ULONG nContentType ) bVisible = bSynchron = bUseCache = TRUE; bWasLastEditOK = FALSE; - // falls es ein Ole-Link wird, + // It it going to be a Ole-Link, pImplData->ClientType.nUpdateMode = nUpdateMode; pImplData->ClientType.nCntntType = nContentType; pImplData->ClientType.bIntrnlLnk = FALSE; } /************************************************************************ -|* SvBaseLink::SvBaseLink() +|* SvBaseLink::SvBaseLink() |* -|* Beschreibung +|* Description *************************************************************************/ SvBaseLink::SvBaseLink( const String& rLinkName, USHORT nObjectType, SvLinkSource* pObj ) @@ -182,7 +183,7 @@ SvBaseLink::SvBaseLink( const String& rLinkName, USHORT nObjectType, SvLinkSourc if( !pObj ) { - DBG_ASSERT( pObj, "Wo ist mein zu linkendes Object" ); + DBG_ASSERT( pObj, "Where is my left-most object" ); return; } @@ -192,15 +193,14 @@ SvBaseLink::SvBaseLink( const String& rLinkName, USHORT nObjectType, SvLinkSourc DdeTopic* pTopic = FindTopic( aLinkName, &nItemStt ); if( pTopic ) { - // dann haben wir alles zusammen - // MM hat gefummelt ??? - // MM_TODO wie kriege ich den Namen + // then we have it all together + // MM_TODO how do I get the name String aStr = aLinkName; // xLinkName->GetDisplayName(); aStr = aStr.Copy( nItemStt ); pImplData->DDEType.pItem = new ImplDdeItem( *this, aStr ); pTopic->InsertItem( pImplData->DDEType.pItem ); - // dann koennen wir uns auch das Advise merken + // store the Advice xObj = pObj; } } @@ -209,9 +209,9 @@ SvBaseLink::SvBaseLink( const String& rLinkName, USHORT nObjectType, SvLinkSourc } /************************************************************************ -|* SvBaseLink::~SvBaseLink() +|* SvBaseLink::~SvBaseLink() |* -|* Beschreibung +|* Description *************************************************************************/ SvBaseLink::~SvBaseLink() @@ -243,9 +243,9 @@ IMPL_LINK( SvBaseLink, EndEditHdl, String*, _pNewName ) } /************************************************************************ -|* SvBaseLink::SetObjType() +|* SvBaseLink::SetObjType() |* -|* Beschreibung +|* Description *************************************************************************/ void SvBaseLink::SetObjType( USHORT nObjTypeP ) @@ -257,9 +257,9 @@ void SvBaseLink::SetObjType( USHORT nObjTypeP ) } /************************************************************************ -|* SvBaseLink::SetName() +|* SvBaseLink::SetName() |* -|* Beschreibung +|* Description *************************************************************************/ void SvBaseLink::SetName( const String & rNm ) @@ -268,9 +268,9 @@ void SvBaseLink::SetName( const String & rNm ) } /************************************************************************ -|* SvBaseLink::GetName() +|* SvBaseLink::GetName() |* -|* Beschreibung +|* Description *************************************************************************/ String SvBaseLink::GetName() const @@ -279,9 +279,9 @@ String SvBaseLink::GetName() const } /************************************************************************ -|* SvBaseLink::SetObj() +|* SvBaseLink::SetObj() |* -|* Beschreibung +|* Description *************************************************************************/ void SvBaseLink::SetObj( SvLinkSource * pObj ) @@ -294,9 +294,9 @@ void SvBaseLink::SetObj( SvLinkSource * pObj ) } /************************************************************************ -|* SvBaseLink::SetLinkSourceName() +|* SvBaseLink::SetLinkSourceName() |* -|* Beschreibung +|* Description *************************************************************************/ void SvBaseLink::SetLinkSourceName( const String & rLnkNm ) @@ -304,21 +304,21 @@ void SvBaseLink::SetLinkSourceName( const String & rLnkNm ) if( aLinkName == rLnkNm ) return; - AddNextRef(); // sollte ueberfluessig sein - // Alte Verbindung weg + AddNextRef(); // should be superfluous + // remove old connection Disconnect(); aLinkName = rLnkNm; - // Neu verbinden + // New Connection _GetRealObject(); - ReleaseRef(); // sollte ueberfluessig sein + ReleaseRef(); // should be superfluous } /************************************************************************ -|* SvBaseLink::GetLinkSourceName() +|* SvBaseLink::GetLinkSourceName() |* -|* Beschreibung +|* Description *************************************************************************/ String SvBaseLink::GetLinkSourceName() const @@ -328,9 +328,9 @@ String SvBaseLink::GetLinkSourceName() const /************************************************************************ -|* SvBaseLink::SetUpdateMode() +|* SvBaseLink::SetUpdateMode() |* -|* Beschreibung +|* Description *************************************************************************/ void SvBaseLink::SetUpdateMode( USHORT nMode ) @@ -347,7 +347,7 @@ void SvBaseLink::SetUpdateMode( USHORT nMode ) } } -// --> OD 2008-06-19 #i88291# +// #i88291# void SvBaseLink::clearStreamToLoadFrom() { m_xInputStreamToLoadFrom.clear(); @@ -356,7 +356,6 @@ void SvBaseLink::clearStreamToLoadFrom() xObj->clearStreamToLoadFrom(); } } -// <-- BOOL SvBaseLink::Update() { @@ -387,11 +386,11 @@ BOOL SvBaseLink::Update() } if( xObj.Is() ) { - // sollten wir asynschron sein? + // should be asynschron? if( xObj->IsPending() ) return TRUE; - // dann brauchen wir das Object auch nicht mehr + // we do not need the object anymore AddNextRef(); Disconnect(); ReleaseRef(); @@ -421,14 +420,14 @@ void SvBaseLink::_GetRealObject( BOOL bConnect) { String sServer; if( pImpl->m_pLinkMgr->GetDisplayNames( this, &sServer ) && - sServer == GetpApp()->GetAppName() ) // interner Link !!! + sServer == GetpApp()->GetAppName() ) // internal Link !!! { - // damit der Internal - Link erzeugt werden kann !!! + // so that the Internal link can be created! nObjType = OBJECT_INTERN; xObj = pImpl->m_pLinkMgr->CreateObj( this ); pImplData->ClientType.bIntrnlLnk = TRUE; - nObjType = OBJECT_CLIENT_DDE; // damit wir wissen was es mal war !! + nObjType = OBJECT_CLIENT_DDE; // so we know what it once was! } else { @@ -448,7 +447,7 @@ ULONG SvBaseLink::GetContentType() const if( OBJECT_CLIENT_SO & nObjType ) return pImplData->ClientType.nCntntType; - return 0; // alle Formate ? + return 0; // all Formats ? } @@ -578,7 +577,6 @@ bool SvBaseLink::ExecuteEdit( const String& _rNewName ) void SvBaseLink::Closed() { if( xObj.Is() ) - // beim Advise Abmelden xObj->RemoveAllDataAdvise( this ); } @@ -593,8 +591,7 @@ FileDialogHelper* SvBaseLink::GetFileDialog( sal_uInt32 nFlags, const String& rF ImplDdeItem::~ImplDdeItem() { bIsInDTOR = TRUE; - // damit im Disconnect nicht jemand auf die Idee kommt, den Pointer zu - // loeschen!! + // So that no-one gets the idea to delete the pointer when Disconnecting! SvBaseLinkRef aRef( pLink ); aRef->Disconnect(); } @@ -603,7 +600,7 @@ DdeData* ImplDdeItem::Get( ULONG nFormat ) { if( pLink->GetObj() ) { - // ist das noch gueltig? + // is it still valid? if( bIsValidData && nFormat == aData.GetFormat() ) return &aData; @@ -635,12 +632,12 @@ BOOL ImplDdeItem::Put( const DdeData* ) void ImplDdeItem::AdviseLoop( BOOL bOpen ) { - // Verbindung wird geschlossen, also Link abmelden + // Connection is closed, so also unsubscribe link if( pLink->GetObj() ) { if( bOpen ) { - // es wird wieder eine Verbindung hergestellt + // A connection is re-established if( OBJECT_DDE_EXTERN == pLink->GetObjType() ) { pLink->GetObj()->AddDataAdvise( pLink, String::CreateFromAscii( "text/plain;charset=utf-16" ), ADVISEMODE_NODATA ); @@ -649,8 +646,8 @@ void ImplDdeItem::AdviseLoop( BOOL bOpen ) } else { - // damit im Disconnect nicht jemand auf die Idee kommt, - // den Pointer zu loeschen!! + // So that no-one gets the idea to delete the pointer + // when Disconnecting! SvBaseLinkRef aRef( pLink ); aRef->Disconnect(); } @@ -672,7 +669,7 @@ static DdeTopic* FindTopic( const String & rLinkName, USHORT* pItemStt ) pService = rSvc.Next() ) if( pService->GetName() == sService ) { - // dann suchen wir uns das Topic + // then we search for the Topic String sTopic( sNm.GetToken( 0, cTokenSeperator, nTokenPos ) ); if( pItemStt ) *pItemStt = nTokenPos; @@ -686,10 +683,10 @@ static DdeTopic* FindTopic( const String & rLinkName, USHORT* pItemStt ) if( pTopic->GetName() == sTopic ) return pTopic; - // Topic nicht gefunden ? - // dann versuchen wir ihn mal anzulegen + // Topic not found? + // then we try once to create it if( i || !pService->MakeTopic( sTopic ) ) - break; // hat nicht geklappt, also raus + break; // did not work, exiting } break; } @@ -697,3 +694,5 @@ static DdeTopic* FindTopic( const String & rLinkName, USHORT* pItemStt ) } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx index a02e3128f9..251f0d3873 100644 --- a/sfx2/source/appl/module.cxx +++ b/sfx2/source/appl/module.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,9 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" -#ifndef GCC -#endif - #include <stdio.h> #include <tools/rcid.h> @@ -68,12 +66,10 @@ public: SfxChildWinFactArr_Impl* pFactArr; ImageList* pImgListSmall; ImageList* pImgListBig; - ImageList* pImgListHiSmall; - ImageList* pImgListHiBig; SfxModule_Impl(); ~SfxModule_Impl(); - ImageList* GetImageList( ResMgr*, BOOL, BOOL bHiContrast = FALSE ); + ImageList* GetImageList( ResMgr* pResMgr, BOOL bBig ); }; SfxModule_Impl::SfxModule_Impl() @@ -90,18 +86,15 @@ SfxModule_Impl::~SfxModule_Impl() delete pFactArr; delete pImgListSmall; delete pImgListBig; - delete pImgListHiSmall; - delete pImgListHiBig; } -ImageList* SfxModule_Impl::GetImageList( ResMgr* pResMgr, BOOL bBig, BOOL bHiContrast ) +ImageList* SfxModule_Impl::GetImageList( ResMgr* pResMgr, BOOL bBig ) { - ImageList*& rpList = bBig ? ( bHiContrast ? pImgListHiBig: pImgListBig ) : - ( bHiContrast ? pImgListHiSmall : pImgListSmall ); + ImageList*& rpList = bBig ? pImgListBig : pImgListSmall; if ( !rpList ) { - ResId aResId( bBig ? ( bHiContrast ? RID_DEFAULTIMAGELIST_LCH : RID_DEFAULTIMAGELIST_LC ) : - ( bHiContrast ? RID_DEFAULTIMAGELIST_SCH : RID_DEFAULTIMAGELIST_SC ), *pResMgr ); + ResId aResId( bBig ? ( RID_DEFAULTIMAGELIST_LC ) : ( RID_DEFAULTIMAGELIST_SC ), *pResMgr ); + aResId.SetRT( RSC_IMAGELIST ); DBG_ASSERT( pResMgr->IsAvailable(aResId), "No default ImageList!" ); @@ -130,16 +123,7 @@ ResMgr* SfxModule::GetResMgr() } //==================================================================== -/* -SfxModule::SfxModule( ResMgr* pMgrP, BOOL bDummyP, - SfxObjectFactory* pFactoryP ) - : pResMgr( pMgrP ), bDummy( bDummyP ), pImpl(0L) -{ - Construct_Impl(); - if ( pFactoryP ) - pFactoryP->SetModule_Impl( this ); -} -*/ + SfxModule::SfxModule( ResMgr* pMgrP, BOOL bDummyP, SfxObjectFactory* pFactoryP, ... ) : pResMgr( pMgrP ), bDummy( bDummyP ), pImpl(0L) @@ -170,8 +154,6 @@ void SfxModule::Construct_Impl() pImpl->pFactArr=0; pImpl->pImgListSmall=0; pImpl->pImgListBig=0; - pImpl->pImgListHiSmall=0; - pImpl->pImgListHiBig=0; SetPool( &pApp->GetPool() ); } @@ -185,7 +167,8 @@ SfxModule::~SfxModule() { if ( SFX_APP()->Get_Impl() ) { - // Das Modul wird noch vor dem DeInitialize zerst"ort, also auis dem Array entfernen + // The module will be destroyed before the Deinitialize, + // so remove from the array SfxModuleArr_Impl& rArr = GetModules_Impl(); for( USHORT nPos = rArr.Count(); nPos--; ) { @@ -214,22 +197,20 @@ SfxSlotPool* SfxModule::GetSlotPool() const void SfxModule::RegisterChildWindow(SfxChildWinFactory *pFact) { - DBG_ASSERT( pImpl, "Kein echtes Modul!" ); + DBG_ASSERT( pImpl, "No real Modul!" ); if (!pImpl->pFactArr) pImpl->pFactArr = new SfxChildWinFactArr_Impl; -//#ifdef DBG_UTIL for (USHORT nFactory=0; nFactory<pImpl->pFactArr->Count(); ++nFactory) { if (pFact->nId == (*pImpl->pFactArr)[nFactory]->nId) { pImpl->pFactArr->Remove( nFactory ); - DBG_ERROR("ChildWindow mehrfach registriert!"); + DBG_ERROR("ChildWindow registered multiple times!"); return; } } -//#endif pImpl->pFactArr->C40_INSERT( SfxChildWinFactory, pFact, pImpl->pFactArr->Count() ); @@ -240,7 +221,7 @@ void SfxModule::RegisterChildWindow(SfxChildWinFactory *pFact) void SfxModule::RegisterChildWindowContext( USHORT nId, SfxChildWinContextFactory *pFact) { - DBG_ASSERT( pImpl, "Kein echtes Modul!" ); + DBG_ASSERT( pImpl, "No real Modul!" ); USHORT nCount = pImpl->pFactArr->Count(); for (USHORT nFactory=0; nFactory<nCount; ++nFactory) @@ -255,7 +236,7 @@ void SfxModule::RegisterChildWindowContext( USHORT nId, } } - DBG_ERROR( "Kein ChildWindow fuer diesen Context!" ); + DBG_ERROR( "No ChildWindow for this Context!" ); } //------------------------------------------------------------------------- @@ -272,7 +253,7 @@ void SfxModule::RegisterToolBoxControl( SfxTbxCtrlFactory *pFact ) if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId && (pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) ) { - DBG_WARNING("TbxController-Registrierung ist nicht eindeutig!"); + DBG_WARNING("TbxController-Registering is not clearly defined!"); } } #endif @@ -294,7 +275,7 @@ void SfxModule::RegisterStatusBarControl( SfxStbCtrlFactory *pFact ) if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId && (pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) ) { - DBG_WARNING("StbController-Registrierung ist nicht eindeutig!"); + DBG_WARNING("TbxController-Registering is not clearly defined!"); } } #endif @@ -316,7 +297,7 @@ void SfxModule::RegisterMenuControl( SfxMenuCtrlFactory *pFact ) if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId && (pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) ) { - DBG_WARNING("MenuController-Registrierung ist nicht eindeutig!"); + DBG_WARNING("MenuController-Registering is not clearly defined!"); } } #endif @@ -354,15 +335,10 @@ SfxChildWinFactArr_Impl* SfxModule::GetChildWinFactories_Impl() const ImageList* SfxModule::GetImageList_Impl( BOOL bBig ) { - return pImpl->GetImageList( pResMgr, bBig, FALSE ); -} - -ImageList* SfxModule::GetImageList_Impl( BOOL bBig, BOOL bHiContrast ) -{ - return pImpl->GetImageList( pResMgr, bBig, bHiContrast ); + return pImpl->GetImageList( pResMgr, bBig ); } -SfxTabPage* SfxModule::CreateTabPage( USHORT, Window*, const SfxItemSet& ) +SfxTabPage* SfxModule::CreateTabPage( USHORT, Window*, const SfxItemSet& ) { return NULL; } diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 5033ca5b8f..d13c9e7f83 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -70,9 +71,7 @@ #include <com/sun/star/frame/XDispatchProvider.hpp> #include <com/sun/star/frame/XDispatchProviderInterception.hpp> #include <com/sun/star/frame/XFrame.hpp> -#ifndef _COM_SUN_STAR_TEXT_XBREAKITERATOR_HPP_ #include <com/sun/star/i18n/XBreakIterator.hpp> -#endif #include <com/sun/star/i18n/WordType.hpp> #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/style/XStyle.hpp> @@ -902,7 +901,7 @@ sal_Bool IndexTabPage_Impl::HasKeyword() const } // ----------------------------------------------------------------------- -//added by BerryJia for fixing Bug98251, 2002-12-11 + sal_Bool IndexTabPage_Impl::HasKeywordIgnoreCase() { sal_Bool bRet = sal_False; @@ -1315,7 +1314,7 @@ void BookmarksBox_Impl::DoAction( USHORT nAction ) RemoveEntry( nPos ); rtl::OUString aImageURL = IMAGE_URL; aImageURL += INetURLObject( *pURL ).GetHost(); - nPos = InsertEntry( aDlg.GetTitle(), SvFileInformationManager::GetImage( aImageURL ) ); + nPos = InsertEntry( aDlg.GetTitle(), SvFileInformationManager::GetImage( aImageURL, false ) ); SetEntryData( nPos, (void*)(ULONG)( new String( *pURL ) ) ); SelectEntryPos( nPos ); delete pURL; @@ -1488,7 +1487,7 @@ void BookmarksTabPage_Impl::AddBookmarks( const String& rTitle, const String& rU { rtl::OUString aImageURL = IMAGE_URL; aImageURL += INetURLObject( rURL ).GetHost(); - USHORT nPos = aBookmarksBox.InsertEntry( rTitle, SvFileInformationManager::GetImage( aImageURL ) ); + USHORT nPos = aBookmarksBox.InsertEntry( rTitle, SvFileInformationManager::GetImage( aImageURL, false ) ); aBookmarksBox.SetEntryData( nPos, (void*)(ULONG)( new String( rURL ) ) ); } @@ -1535,7 +1534,6 @@ void SfxHelpWindow_Impl::loadHelpContent(const ::rtl::OUString& sHelpURL, sal_Bo if (!xLoader.is()) return; - // --> PB 2007-03-12 #134037# // If a print job runs do not open a new page Reference< XFrame > xTextFrame = pTextWin->getFrame(); Reference< XController > xTextController ; @@ -1546,7 +1544,6 @@ void SfxHelpWindow_Impl::loadHelpContent(const ::rtl::OUString& sHelpURL, sal_Bo xTextController->suspend( sal_False ); return; } - // <-- // save url to history if (bAddToHistory) @@ -1786,7 +1783,7 @@ IMPL_LINK( SfxHelpIndexWindow_Impl, KeywordHdl, IndexTabPage_Impl *, EMPTYARG ) { // keyword found on index? sal_Bool bIndex = pIPage->HasKeyword(); - //The following two lines are added by BerryJia for fixing Bug98251, 2002-12-11 + if( !bIndex) bIndex = pIPage->HasKeywordIgnoreCase(); // then set index or search page as current. @@ -2175,34 +2172,35 @@ sal_Bool SfxHelpTextWindow_Impl::HasSelection() const void SfxHelpTextWindow_Impl::InitToolBoxImages() { sal_Bool bLarge = SvtMiscOptions().AreCurrentSymbolsLarge(); - sal_Bool bHiContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); - - aIndexOnImage = Image( SfxResId( - bLarge ? bHiContrast ? IMG_HELP_TOOLBOX_HCL_INDEX_ON : IMG_HELP_TOOLBOX_L_INDEX_ON - : bHiContrast ? IMG_HELP_TOOLBOX_HC_INDEX_ON : IMG_HELP_TOOLBOX_INDEX_ON ) ); - aIndexOffImage = Image( SfxResId( - bLarge ? bHiContrast ? IMG_HELP_TOOLBOX_HCL_INDEX_OFF : IMG_HELP_TOOLBOX_L_INDEX_OFF - : bHiContrast ? IMG_HELP_TOOLBOX_HC_INDEX_OFF : IMG_HELP_TOOLBOX_INDEX_OFF ) ); + + aIndexOnImage = Image( SfxResId( bLarge ? IMG_HELP_TOOLBOX_L_INDEX_ON : IMG_HELP_TOOLBOX_INDEX_ON ) ); + aIndexOffImage = Image( SfxResId( bLarge ? IMG_HELP_TOOLBOX_L_INDEX_OFF : IMG_HELP_TOOLBOX_INDEX_OFF ) ); + aToolBox.SetItemImage( TBI_INDEX, bIsIndexOn ? aIndexOffImage : aIndexOnImage ); - aToolBox.SetItemImage( TBI_BACKWARD, Image( SfxResId( - bLarge ? bHiContrast ? IMG_HELP_TOOLBOX_HCL_PREV : IMG_HELP_TOOLBOX_L_PREV - : bHiContrast ? IMG_HELP_TOOLBOX_HC_PREV : IMG_HELP_TOOLBOX_PREV ) ) ); - aToolBox.SetItemImage( TBI_FORWARD, Image( SfxResId( - bLarge ? bHiContrast ? IMG_HELP_TOOLBOX_HCL_NEXT : IMG_HELP_TOOLBOX_L_NEXT - : bHiContrast ? IMG_HELP_TOOLBOX_HC_NEXT : IMG_HELP_TOOLBOX_NEXT ) ) ); - aToolBox.SetItemImage( TBI_START, Image( SfxResId( - bLarge ? bHiContrast ? IMG_HELP_TOOLBOX_HCL_START : IMG_HELP_TOOLBOX_L_START - : bHiContrast ? IMG_HELP_TOOLBOX_HC_START : IMG_HELP_TOOLBOX_START ) ) ); - aToolBox.SetItemImage( TBI_PRINT, Image( SfxResId( - bLarge ? bHiContrast ? IMG_HELP_TOOLBOX_HCL_PRINT : IMG_HELP_TOOLBOX_L_PRINT - : bHiContrast ? IMG_HELP_TOOLBOX_HC_PRINT : IMG_HELP_TOOLBOX_PRINT ) ) ); - aToolBox.SetItemImage( TBI_BOOKMARKS, Image( SfxResId( - bLarge ? bHiContrast ? IMG_HELP_TOOLBOX_HCL_BOOKMARKS : IMG_HELP_TOOLBOX_L_BOOKMARKS - : bHiContrast ? IMG_HELP_TOOLBOX_HC_BOOKMARKS : IMG_HELP_TOOLBOX_BOOKMARKS ) ) ); - aToolBox.SetItemImage( TBI_SEARCHDIALOG, Image( SfxResId( - bLarge ? bHiContrast ? IMG_HELP_TOOLBOX_HCL_SEARCHDIALOG : IMG_HELP_TOOLBOX_L_SEARCHDIALOG - : bHiContrast ? IMG_HELP_TOOLBOX_HC_SEARCHDIALOG : IMG_HELP_TOOLBOX_SEARCHDIALOG ) ) ); + aToolBox.SetItemImage( TBI_BACKWARD, + Image( SfxResId( bLarge ? IMG_HELP_TOOLBOX_L_PREV : IMG_HELP_TOOLBOX_PREV ) ) + ); + + aToolBox.SetItemImage( TBI_FORWARD, + Image( SfxResId( bLarge ? IMG_HELP_TOOLBOX_L_NEXT : IMG_HELP_TOOLBOX_NEXT ) ) + ); + + aToolBox.SetItemImage( TBI_START, + Image( SfxResId( bLarge ? IMG_HELP_TOOLBOX_L_START : IMG_HELP_TOOLBOX_START ) ) + ); + + aToolBox.SetItemImage( TBI_PRINT, + Image( SfxResId( bLarge ? IMG_HELP_TOOLBOX_L_PRINT : IMG_HELP_TOOLBOX_PRINT ) ) + ); + + aToolBox.SetItemImage( TBI_BOOKMARKS, + Image( SfxResId( bLarge ? IMG_HELP_TOOLBOX_L_BOOKMARKS : IMG_HELP_TOOLBOX_BOOKMARKS ) ) + ); + + aToolBox.SetItemImage( TBI_SEARCHDIALOG, + Image( SfxResId( bLarge ? IMG_HELP_TOOLBOX_L_SEARCHDIALOG : IMG_HELP_TOOLBOX_SEARCHDIALOG ) ) + ); Size aSize = aToolBox.CalcWindowSizePixel(); aSize.Height() += TOOLBOX_OFFSET; @@ -2581,7 +2579,6 @@ long SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& rNEvt ) if ( pCmdEvt->GetCommand() == COMMAND_CONTEXTMENU && pCmdWin != this && pCmdWin != &aToolBox ) { - sal_Bool bHiContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); Point aPos; if ( pCmdEvt->IsMouseEvent() ) aPos = pCmdEvt->GetMousePosPixel(); @@ -2590,33 +2587,44 @@ long SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& rNEvt ) aPos.Y() += pTextWin->GetPosPixel().Y(); PopupMenu aMenu; if ( bIsIndexOn ) - aMenu.InsertItem( TBI_INDEX, aIndexOffText, Image( SfxResId( - bHiContrast ? IMG_HELP_TOOLBOX_HC_INDEX_OFF : IMG_HELP_TOOLBOX_INDEX_OFF ) ) ); + aMenu.InsertItem( TBI_INDEX, aIndexOffText, Image( SfxResId( IMG_HELP_TOOLBOX_INDEX_OFF ) ) ); else - aMenu.InsertItem( TBI_INDEX, aIndexOnText, Image( SfxResId( - bHiContrast ? IMG_HELP_TOOLBOX_HC_INDEX_ON : IMG_HELP_TOOLBOX_INDEX_ON ) ) ); + aMenu.InsertItem( TBI_INDEX, aIndexOnText, Image( SfxResId( IMG_HELP_TOOLBOX_INDEX_ON ) ) ); + aMenu.SetHelpId( TBI_INDEX, HID_HELP_TOOLBOXITEM_INDEX ); aMenu.InsertSeparator(); - aMenu.InsertItem( TBI_BACKWARD, String( SfxResId( STR_HELP_BUTTON_PREV ) ), - Image( SfxResId( bHiContrast ? IMG_HELP_TOOLBOX_HC_PREV : IMG_HELP_TOOLBOX_PREV ) ) ); + aMenu.InsertItem( TBI_BACKWARD, + String( SfxResId( STR_HELP_BUTTON_PREV ) ), + Image( SfxResId( IMG_HELP_TOOLBOX_PREV ) ) + ); aMenu.SetHelpId( TBI_BACKWARD, HID_HELP_TOOLBOXITEM_BACKWARD ); aMenu.EnableItem( TBI_BACKWARD, pHelpWin->HasHistoryPredecessor() ); - aMenu.InsertItem( TBI_FORWARD, String( SfxResId( STR_HELP_BUTTON_NEXT ) ), - Image( SfxResId( bHiContrast ? IMG_HELP_TOOLBOX_HC_NEXT : IMG_HELP_TOOLBOX_NEXT ) ) ); + aMenu.InsertItem( TBI_FORWARD, + String( SfxResId( STR_HELP_BUTTON_NEXT ) ), + Image( SfxResId( IMG_HELP_TOOLBOX_NEXT ) ) + ); aMenu.SetHelpId( TBI_FORWARD, HID_HELP_TOOLBOXITEM_FORWARD ); aMenu.EnableItem( TBI_FORWARD, pHelpWin->HasHistorySuccessor() ); - aMenu.InsertItem( TBI_START, String( SfxResId( STR_HELP_BUTTON_START ) ), - Image( SfxResId( bHiContrast ? IMG_HELP_TOOLBOX_HC_START : IMG_HELP_TOOLBOX_START ) ) ); + aMenu.InsertItem( TBI_START, + String( SfxResId( STR_HELP_BUTTON_START ) ), + Image( SfxResId( IMG_HELP_TOOLBOX_START ) ) + ); aMenu.SetHelpId( TBI_START, HID_HELP_TOOLBOXITEM_START ); aMenu.InsertSeparator(); - aMenu.InsertItem( TBI_PRINT, String( SfxResId( STR_HELP_BUTTON_PRINT ) ), - Image( SfxResId( bHiContrast ? IMG_HELP_TOOLBOX_HC_PRINT : IMG_HELP_TOOLBOX_PRINT ) ) ); + aMenu.InsertItem( TBI_PRINT, + String( SfxResId( STR_HELP_BUTTON_PRINT ) ), + Image( SfxResId( IMG_HELP_TOOLBOX_PRINT ) ) + ); aMenu.SetHelpId( TBI_PRINT, HID_HELP_TOOLBOXITEM_PRINT ); - aMenu.InsertItem( TBI_BOOKMARKS, String( SfxResId( STR_HELP_BUTTON_ADDBOOKMARK ) ), - Image( SfxResId( bHiContrast ? IMG_HELP_TOOLBOX_HC_BOOKMARKS : IMG_HELP_TOOLBOX_BOOKMARKS ) ) ); + aMenu.InsertItem( TBI_BOOKMARKS, + String( SfxResId( STR_HELP_BUTTON_ADDBOOKMARK ) ), + Image( SfxResId( IMG_HELP_TOOLBOX_BOOKMARKS ) ) + ); aMenu.SetHelpId( TBI_BOOKMARKS, HID_HELP_TOOLBOXITEM_BOOKMARKS ); - aMenu.InsertItem( TBI_SEARCHDIALOG, String( SfxResId( STR_HELP_BUTTON_SEARCHDIALOG ) ), - Image( SfxResId( bHiContrast ? IMG_HELP_TOOLBOX_HC_SEARCHDIALOG : IMG_HELP_TOOLBOX_SEARCHDIALOG ) ) ); + aMenu.InsertItem( TBI_SEARCHDIALOG, + String( SfxResId( STR_HELP_BUTTON_SEARCHDIALOG ) ), + Image( SfxResId( IMG_HELP_TOOLBOX_SEARCHDIALOG ) ) + ); aMenu.SetHelpId( TBI_SEARCHDIALOG, HID_HELP_TOOLBOXITEM_SEARCHDIALOG ); aMenu.InsertSeparator(); aMenu.InsertItem( TBI_SELECTIONMODE, String( SfxResId( STR_HELP_MENU_TEXT_SELECTION_MODE ) ) ); @@ -3088,7 +3096,7 @@ IMPL_LINK( SfxHelpWindow_Impl, OpenHdl, SfxHelpIndexWindow_Impl* , EMPTYARG ) // INetURLObject aObj(aEntry); // BOOL bComplete = ( aObj.GetProtocol() == INET_PROT_VND_SUN_STAR_HELP ); - BOOL bComplete = rtl::OUString(aEntry).toAsciiLowerCase().match(rtl::OUString::createFromAscii("vnd.sun.star.help"),0); + BOOL bComplete = rtl::OUString(aEntry).toAsciiLowerCase().match(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.help")),0); if (bComplete) sHelpURL = ::rtl::OUString(aEntry); @@ -3490,3 +3498,4 @@ void SfxAddHelpBookmarkDialog_Impl::SetTitle( const String& rTitle ) aTitleED.SetSelection( Selection( 0, rTitle.Len() ) ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/newhelp.hxx b/sfx2/source/appl/newhelp.hxx index 1e0b83c2c5..268ca39141 100644 --- a/sfx2/source/appl/newhelp.hxx +++ b/sfx2/source/appl/newhelp.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -188,7 +189,7 @@ public: inline void SetKeywordHdl( const Link& rLink ) { aKeywordLink = rLink; } void SetKeyword( const String& rKeyword ); sal_Bool HasKeyword() const; - sal_Bool HasKeywordIgnoreCase(); //added by BerryJia for fixing Bug98251, 2002-12-11 + sal_Bool HasKeywordIgnoreCase(); void OpenKeyword(); inline void SelectExecutableEntry() { aIndexCB.SelectExecutableEntry(); } @@ -612,3 +613,4 @@ public: #endif // #ifndef INCLUDED_SFX_NEWHELP_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/newhelp.src b/sfx2/source/appl/newhelp.src index 5b07cc5404..2983783d10 100644 --- a/sfx2/source/appl/newhelp.src +++ b/sfx2/source/appl/newhelp.src @@ -217,113 +217,118 @@ Image IMG_HELP_TOOLBOX_INDEX_ON ImageBitmap = Bitmap { File = "indexon_small.bmp" ; }; MASKCOLOR_MAGENTA }; + Image IMG_HELP_TOOLBOX_INDEX_OFF { ImageBitmap = Bitmap { File = "indexoff_small.bmp" ; }; MASKCOLOR_MAGENTA }; + Image IMG_HELP_TOOLBOX_START { ImageBitmap = Bitmap { File = "sc06303.bmp" ; }; MASKCOLOR_MAGENTA }; + Image IMG_HELP_TOOLBOX_PREV { ImageBitmap = Bitmap { File = "sc06301.bmp" ; }; MASKCOLOR_MAGENTA }; + Image IMG_HELP_TOOLBOX_NEXT { ImageBitmap = Bitmap { File = "sc06300.bmp" ; }; MASKCOLOR_MAGENTA }; + Image IMG_HELP_TOOLBOX_PRINT { ImageBitmap = Bitmap { File = "sc05504.bmp" ; }; MASKCOLOR_MAGENTA }; + Image IMG_HELP_TOOLBOX_BOOKMARKS { ImageBitmap = Bitmap { File = "favourite.bmp" ; }; MASKCOLOR_MAGENTA }; + Image IMG_HELP_TOOLBOX_SEARCHDIALOG { ImageBitmap = Bitmap { File = "sc05961.bmp" ; }; MASKCOLOR_MAGENTA }; + Image IMG_HELP_TOOLBOX_COPY { ImageBitmap = Bitmap { File = "sc05711.bmp" ; }; MASKCOLOR_MAGENTA }; + Image IMG_HELP_CONTENT_BOOK_OPEN { ImageBitmap = Bitmap { File = "hlpbookopen.bmp" ; }; MASKCOLOR_MAGENTA }; -Image IMG_HELP_CONTENT_BOOK_OPEN_HC -{ - ImageBitmap = Bitmap { File = "hlpbookopen_h.bmp" ; }; - MASKCOLOR_MAGENTA -}; + Image IMG_HELP_CONTENT_BOOK_CLOSED { ImageBitmap = Bitmap { File = "hlpbookclosed.bmp" ; }; MASKCOLOR_MAGENTA }; -Image IMG_HELP_CONTENT_BOOK_CLOSED_HC -{ - ImageBitmap = Bitmap { File = "hlpbookclosed_h.bmp" ; }; - MASKCOLOR_MAGENTA -}; + Image IMG_HELP_CONTENT_DOC { ImageBitmap = Bitmap { File = "hlpdoc.bmp" ; }; MASKCOLOR_MAGENTA }; -Image IMG_HELP_CONTENT_DOC_HC -{ - ImageBitmap = Bitmap { File = "hlpdoc_h.bmp" ; }; - MASKCOLOR_MAGENTA -}; String STR_HELP_WINDOW_TITLE { Text [ en-US ] = "%PRODUCTNAME Help"; }; + String STR_HELP_BUTTON_INDEX_ON { Text [ en-US ] = "Show Navigation Pane"; }; + String STR_HELP_BUTTON_INDEX_OFF { Text [ en-US ] = "Hide Navigation Pane"; }; + String STR_HELP_BUTTON_START { Text [ en-US ] = "First Page"; }; + String STR_HELP_BUTTON_PREV { Text [ en-US ] = "Previous Page"; }; + String STR_HELP_BUTTON_NEXT { Text [ en-US ] = "Next Page"; }; + String STR_HELP_BUTTON_PRINT { Text [ en-US ] = "Print..."; }; + String STR_HELP_BUTTON_ADDBOOKMARK { Text [ en-US ] = "Add to Bookmarks..."; }; + String STR_HELP_BUTTON_SEARCHDIALOG { Text [ en-US ] = "Find on this Page..."; }; + String STR_HELP_BUTTON_SOURCEVIEW { Text [ en-US ] = "HTML Source"; @@ -333,18 +338,22 @@ String STR_HELP_FIRST_MESSAGE { Text [ en-US ] = "The Help is being started..."; }; + String STR_HELP_FIRST_HTML { Text = "<html></head><body><center><br></br><br></br><p><tt>%1</tt></center></body></html>"; }; + String STR_HELP_MENU_TEXT_SELECTION_MODE { Text [ en-US ] = "Select Text"; }; + String STR_HELP_MENU_TEXT_COPY { Text [ en-US ] = "~Copy" ; }; + ModalDialog DLG_HELP_ADDBOOKMARK { HelpID = "sfx2:ModalDialog:DLG_HELP_ADDBOOKMARK"; @@ -440,144 +449,60 @@ InfoBox RID_INFO_NOSEARCHTEXTFOUND Message [ en-US ] = "The text you entered was not found."; }; -Image IMG_HELP_TOOLBOX_HC_INDEX_ON -{ - ImageBitmap = Bitmap { File = "indexon_small_h.bmp" ; }; - MASKCOLOR_MAGENTA -}; -Image IMG_HELP_TOOLBOX_HC_INDEX_OFF -{ - ImageBitmap = Bitmap { File = "indexoff_small_h.bmp" ; }; - MASKCOLOR_MAGENTA -}; -Image IMG_HELP_TOOLBOX_HC_START -{ - ImageBitmap = Bitmap { File = "sch06303.bmp" ; }; - MASKCOLOR_MAGENTA -}; -Image IMG_HELP_TOOLBOX_HC_PREV -{ - ImageBitmap = Bitmap { File = "sch06301.bmp" ; }; - MASKCOLOR_MAGENTA -}; -Image IMG_HELP_TOOLBOX_HC_NEXT -{ - ImageBitmap = Bitmap { File = "sch06300.bmp" ; }; - MASKCOLOR_MAGENTA -}; -Image IMG_HELP_TOOLBOX_HC_PRINT -{ - ImageBitmap = Bitmap { File = "sch05504.bmp" ; }; - MASKCOLOR_MAGENTA -}; -Image IMG_HELP_TOOLBOX_HC_BOOKMARKS -{ - ImageBitmap = Bitmap { File = "favourite_h.bmp" ; }; - MASKCOLOR_MAGENTA -}; -Image IMG_HELP_TOOLBOX_HC_SEARCHDIALOG -{ - ImageBitmap = Bitmap { File = "sch05961.bmp" ; }; - MASKCOLOR_MAGENTA -}; -Image IMG_HELP_TOOLBOX_HC_COPY -{ - ImageBitmap = Bitmap { File = "sch05711.bmp" ; }; - MASKCOLOR_MAGENTA -}; - Image IMG_HELP_TOOLBOX_L_INDEX_ON { ImageBitmap = Bitmap { File = "indexon_big.bmp" ; }; MASKCOLOR_MAGENTA }; + Image IMG_HELP_TOOLBOX_L_INDEX_OFF { ImageBitmap = Bitmap { File = "indexoff_big.bmp" ; }; MASKCOLOR_MAGENTA }; + Image IMG_HELP_TOOLBOX_L_START { ImageBitmap = Bitmap { File = "lc06303.bmp" ; }; MASKCOLOR_MAGENTA }; + Image IMG_HELP_TOOLBOX_L_PREV { ImageBitmap = Bitmap { File = "lc06301.bmp" ; }; MASKCOLOR_MAGENTA }; + Image IMG_HELP_TOOLBOX_L_NEXT { ImageBitmap = Bitmap { File = "lc06300.bmp" ; }; MASKCOLOR_MAGENTA }; + Image IMG_HELP_TOOLBOX_L_PRINT { ImageBitmap = Bitmap { File = "lc05504.bmp" ; }; MASKCOLOR_MAGENTA }; + Image IMG_HELP_TOOLBOX_L_BOOKMARKS { ImageBitmap = Bitmap { File = "favourite_big.bmp" ; }; MASKCOLOR_MAGENTA }; + Image IMG_HELP_TOOLBOX_L_SEARCHDIALOG { ImageBitmap = Bitmap { File = "lc05961.bmp" ; }; MASKCOLOR_MAGENTA }; + Image IMG_HELP_TOOLBOX_L_COPY { ImageBitmap = Bitmap { File = "lc05711.bmp" ; }; MASKCOLOR_MAGENTA }; -Image IMG_HELP_TOOLBOX_HCL_INDEX_ON -{ - ImageBitmap = Bitmap { File = "indexon_big_h.bmp" ; }; - MASKCOLOR_MAGENTA -}; -Image IMG_HELP_TOOLBOX_HCL_INDEX_OFF -{ - ImageBitmap = Bitmap { File = "indexoff_big_h.bmp" ; }; - MASKCOLOR_MAGENTA -}; -Image IMG_HELP_TOOLBOX_HCL_START -{ - ImageBitmap = Bitmap { File = "lch06303.bmp" ; }; - MASKCOLOR_MAGENTA -}; -Image IMG_HELP_TOOLBOX_HCL_PREV -{ - ImageBitmap = Bitmap { File = "lch06301.bmp" ; }; - MASKCOLOR_MAGENTA -}; -Image IMG_HELP_TOOLBOX_HCL_NEXT -{ - ImageBitmap = Bitmap { File = "lch06300.bmp" ; }; - MASKCOLOR_MAGENTA -}; -Image IMG_HELP_TOOLBOX_HCL_PRINT -{ - ImageBitmap = Bitmap { File = "lch05504.bmp" ; }; - MASKCOLOR_MAGENTA -}; -Image IMG_HELP_TOOLBOX_HCL_BOOKMARKS -{ - ImageBitmap = Bitmap { File = "favourite_big_h.bmp" ; }; - MASKCOLOR_MAGENTA -}; -Image IMG_HELP_TOOLBOX_HCL_SEARCHDIALOG -{ - ImageBitmap = Bitmap { File = "lch05961.bmp" ; }; - MASKCOLOR_MAGENTA -}; -Image IMG_HELP_TOOLBOX_HCL_COPY -{ - ImageBitmap = Bitmap { File = "lch05711.bmp" ; }; - MASKCOLOR_MAGENTA -}; - CheckBox RID_HELP_ONSTARTUP_BOX { HelpId = HID_HELP_ONSTARTUP_BOX; @@ -585,8 +510,8 @@ CheckBox RID_HELP_ONSTARTUP_BOX TabStop = TRUE; Size = MAP_APPFONT ( 200 , 10 ) ; }; + String RID_HELP_ONSTARTUP_TEXT { Text [ en-US ] = "~Display %PRODUCTNAME %MODULENAME Help at Startup"; }; - diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx index 8ed5132f8a..024fc208de 100644 --- a/sfx2/source/appl/opengrf.cxx +++ b/sfx2/source/appl/opengrf.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. diff --git a/sfx2/source/appl/panelist.hxx b/sfx2/source/appl/panelist.hxx index 2f1afe28b8..fb48cd708d 100644 --- a/sfx2/source/appl/panelist.hxx +++ b/sfx2/source/appl/panelist.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -48,3 +49,5 @@ namespace sfx2 } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 7493f9c706..dd824a30ff 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -49,6 +50,8 @@ #include <com/sun/star/frame/FrameSearchFlag.hpp> #include <toolkit/helper/vclunohelper.hxx> #include <com/sun/star/frame/XModuleManager.hpp> +#include <com/sun/star/system/XSystemShellExecute.hpp> +#include <com/sun/star/system/SystemShellExecuteFlags.hpp> #include <unotools/configmgr.hxx> #include <unotools/configitem.hxx> #include <svtools/helpopt.hxx> @@ -87,12 +90,11 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::util; using namespace ::com::sun::star::frame; using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::system; #define ERROR_TAG String( DEFINE_CONST_UNICODE("Error: ") ) #define PATH_TAG String( DEFINE_CONST_UNICODE("\nPath: ") ) -// class NoHelpErrorBox -------------------------------------------------- - class NoHelpErrorBox : public ErrorBox { public: @@ -113,8 +115,6 @@ void NoHelpErrorBox::RequestHelp( const HelpEvent& ) // do nothing, because no help available } -// ----------------------------------------------------------------------- - #define STARTERLIST 0 rtl::OUString HelpLocaleString() @@ -124,7 +124,7 @@ rtl::OUString HelpLocaleString() { // detect installed locale Any aLocale = - ::utl::ConfigManager::GetConfigManager()->GetDirectConfigProperty( + ::utl::ConfigManager::GetConfigManager().GetDirectConfigProperty( ::utl::ConfigManager::LOCALE ); aLocale >>= aLocaleStr; bool bOk = aLocaleStr.getLength() != 0; @@ -181,22 +181,16 @@ void AppendConfigToken_Impl( String& rURL, sal_Bool bQuestionMark ) } -// ----------------------------------------------------------------------- - sal_Bool GetHelpAnchor_Impl( const String& _rURL, String& _rAnchor ) { sal_Bool bRet = sal_False; ::rtl::OUString sAnchor; - // --> OD 2009-07-01 #159496# - // do not release solar mutex due to crash regarding accessibility -// ULONG nSolarCount = Application::ReleaseSolarMutex(); - // <-- try { ::ucbhelper::Content aCnt( INetURLObject( _rURL ).GetMainURL( INetURLObject::NO_DECODE ), Reference< ::com::sun::star::ucb::XCommandEnvironment > () ); - if ( ( aCnt.getPropertyValue( ::rtl::OUString::createFromAscii( "AnchorName" ) ) >>= sAnchor ) ) + if ( ( aCnt.getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AnchorName")) ) >>= sAnchor ) ) { if ( sAnchor.getLength() > 0 ) @@ -213,15 +207,10 @@ sal_Bool GetHelpAnchor_Impl( const String& _rURL, String& _rAnchor ) catch( ::com::sun::star::uno::Exception& ) { } - // --> OD 2009-07-01 #159496# -// Application::AcquireSolarMutex( nSolarCount ); - // <-- return bRet; } -// ----------------------------------------------------------------------- - class SfxHelpOptions_Impl : public utl::ConfigItem { private: @@ -254,8 +243,6 @@ static Sequence< ::rtl::OUString > GetPropertyNames() return aNames; } -// ----------------------------------------------------------------------- - SfxHelpOptions_Impl::SfxHelpOptions_Impl() : ConfigItem( ::rtl::OUString::createFromAscii("Office.SFX/Help") ) { @@ -317,7 +304,14 @@ void SfxHelpOptions_Impl::Commit() { } -// class SfxHelp_Impl ---------------------------------------------------- + +void SfxHelpOptions_Impl::Notify( const com::sun::star::uno::Sequence< rtl::OUString >& ) +{ +} + +void SfxHelpOptions_Impl::Commit() +{ +} class SfxHelp_Impl { @@ -723,7 +717,7 @@ String SfxHelp::GetHelpModuleName_Impl() xCont->getByName( aModuleIdentifier ) >>= lProps; for ( sal_Int32 i = 0; i < lProps.getLength(); ++i ) { - if ( lProps[i].Name.equalsAscii("ooSetupFactoryShortName") ) + if ( lProps[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooSetupFactoryShortName")) ) { lProps[i].Value >>= aFactoryShortName; break; @@ -740,26 +734,26 @@ String SfxHelp::GetHelpModuleName_Impl() if ( aFactoryShortName.getLength() > 0 ) { // Map some module identifiers to their "real" help module string. - if ( aFactoryShortName.equalsAscii( "chart2" ) ) + if ( aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("chart2")) ) aFactoryShortName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "schart" ) ); - else if ( aFactoryShortName.equalsAscii( "BasicIDE" ) ) + else if ( aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("BasicIDE")) ) aFactoryShortName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "sbasic" ) ); - else if ( aFactoryShortName.equalsAscii( "sweb" ) - || aFactoryShortName.equalsAscii( "sglobal" ) - || aFactoryShortName.equalsAscii( "swxform" ) ) + else if ( aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("sweb")) + || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("sglobal")) + || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("swxform")) ) aFactoryShortName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "swriter" ) ); - else if ( aFactoryShortName.equalsAscii( "dbquery" ) - || aFactoryShortName.equalsAscii( "dbbrowser" ) - || aFactoryShortName.equalsAscii( "dbrelation" ) - || aFactoryShortName.equalsAscii( "dbtable" ) - || aFactoryShortName.equalsAscii( "dbapp" ) - || aFactoryShortName.equalsAscii( "dbreport" ) - || aFactoryShortName.equalsAscii( "swreport" ) - || aFactoryShortName.equalsAscii( "dbbrowser" ) - || aFactoryShortName.equalsAscii( "swform" ) ) + else if ( aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("dbquery")) + || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("dbbrowser")) + || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("dbrelation")) + || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("dbtable")) + || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("dbapp")) + || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("dbreport")) + || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("swreport")) + || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("dbbrowser")) + || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("swform")) ) aFactoryShortName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "sdatabase" ) ); - else if ( aFactoryShortName.equalsAscii( "sbibliography" ) - || aFactoryShortName.equalsAscii( "StartModule" ) ) + else if ( aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("sbibliography")) + || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("StartModule")) ) aFactoryShortName = sDefaultModule; } else @@ -917,13 +911,43 @@ BOOL SfxHelp::Start_Impl( const String& rURL, const Window* pWindow, const Strin String aHelpRootURL( DEFINE_CONST_OUSTRING("vnd.sun.star.help://") ); AppendConfigToken_Impl( aHelpRootURL, sal_True ); Sequence< ::rtl::OUString > aFactories = SfxContentHelper::GetResultSet( aHelpRootURL ); - if ( 0 == aFactories.getLength() ) + + return ( aFactories.getLength() != 0 ); +} + +/// Redirect the vnd.sun.star.help:// urls to http://help.libreoffice.org +static bool impl_showOnlineHelp( const String& rURL ) +{ + String aInternal( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.help://" ) ); + if ( rURL.Len() <= aInternal.Len() || rURL.Copy( 0, aInternal.Len() ) != aInternal ) + return false; + + rtl::OUString aHelpLink( RTL_CONSTASCII_USTRINGPARAM( "http://help.libreoffice.org/" ) ); + aHelpLink += rURL.Copy( aInternal.Len() ); + try { - // no factories -> no help -> error message and return - NoHelpErrorBox aErrBox( const_cast< Window* >( pWindow ) ); - aErrBox.Execute(); - return FALSE; + Reference< XSystemShellExecute > xSystemShell( + ::comphelper::getProcessServiceFactory()->createInstance( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.system.SystemShellExecute" ) ) ), + UNO_QUERY ); + + if ( xSystemShell.is() ) + { + xSystemShell->execute( aHelpLink, rtl::OUString(), SystemShellExecuteFlags::DEFAULTS ); + return true; + } } + catch( const Exception& ) + { + } + return false; +} + +BOOL SfxHelp::Start( const String& rURL, const Window* pWindow ) +{ + String aHelpURL( rURL ); + INetURLObject aParser( aHelpURL ); + INetProtocol nProtocol = aParser.GetProtocol(); /* rURL may be - a "real" URL @@ -973,6 +997,18 @@ BOOL SfxHelp::Start_Impl( const String& rURL, const Window* pWindow, const Strin } } + if ( !impl_hasHelpInstalled() ) + { + if ( impl_showOnlineHelp( aHelpURL ) ) + return TRUE; + else + { + NoHelpErrorBox aErrBox( const_cast< Window* >( pWindow ) ); + aErrBox.Execute(); + return FALSE; + } + } + Reference < XFrame > xDesktop( ::comphelper::getProcessServiceFactory()->createInstance( DEFINE_CONST_UNICODE("com.sun.star.frame.Desktop") ), UNO_QUERY ); @@ -1041,7 +1077,7 @@ void SfxHelp::OpenHelpAgent( const rtl::OString& sHelpId ) URL aURL; aURL.Complete = CreateHelpURL_Impl( String( ByteString(sHelpId), RTL_TEXTENCODING_UTF8 ), GetHelpModuleName_Impl() ); Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" ) ), UNO_QUERY ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer")) ), UNO_QUERY ); xTrans->parseStrict(aURL); Reference < XFrame > xCurrentFrame; @@ -1054,7 +1090,7 @@ void SfxHelp::OpenHelpAgent( const rtl::OString& sHelpId ) Reference< XDispatch > xHelpDispatch; if ( xDispProv.is() ) xHelpDispatch = xDispProv->queryDispatch( - aURL, ::rtl::OUString::createFromAscii("_helpagent"), + aURL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_helpagent")), FrameSearchFlag::PARENT | FrameSearchFlag::SELF ); DBG_ASSERT( xHelpDispatch.is(), "OpenHelpAgent: could not get a dispatcher!" ); @@ -1078,3 +1114,4 @@ String SfxHelp::GetDefaultHelpModule() return getCurrentModuleIdentifier_Impl(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx index af3f346b2b..7d9ea18a3d 100644 --- a/sfx2/source/appl/sfxpicklist.cxx +++ b/sfx2/source/appl/sfxpicklist.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -219,17 +220,17 @@ void SfxPickList::CreatePickListEntries() { RemovePickListEntries(); - // Einlesen der Pickliste + // Reading the pick list Sequence< Sequence< PropertyValue > > seqPicklist = SvtHistoryOptions().GetList( ePICKLIST ); - sal_uInt32 nCount = seqPicklist.getLength(); - sal_uInt32 nEntries = ::std::min( m_nAllowedMenuSize, nCount ); + sal_uInt32 nCount = seqPicklist.getLength(); + sal_uInt32 nEntries = ::std::min( m_nAllowedMenuSize, nCount ); for( sal_uInt32 nItem=0; nItem < nEntries; ++nItem ) { Sequence< PropertyValue > seqPropertySet = seqPicklist[ nItem ]; - INetURLObject aURL; + INetURLObject aURL; ::rtl::OUString sURL; ::rtl::OUString sFilter; ::rtl::OUString sTitle; @@ -356,7 +357,7 @@ void SfxPickList::Notify( SfxBroadcaster&, const SfxHint& rHint ) if ( rHint.IsA( TYPE( SfxEventHint ))) { SfxEventHint* pEventHint = PTR_CAST(SfxEventHint,&rHint); - // nur ObjectShell-bezogene Events mit Medium interessieren + // only ObjectShell-related events with media interest SfxObjectShell* pDocSh = pEventHint->GetObjShell(); if( !pDocSh ) return; @@ -392,12 +393,12 @@ void SfxPickList::Notify( SfxBroadcaster&, const SfxHint& rHint ) if( !pMed ) return; - // unbenannt-Docs und embedded-Docs nicht in History + // Unnamed Documents and embedded-Documents not in History if ( !pDocSh->HasName() || SFX_CREATE_MODE_STANDARD != pDocSh->GetCreateMode() ) return; - // Hilfe nicht in History + // Help not in History INetURLObject aURL( pDocSh->IsDocShared() ? pDocSh->GetSharedFileURL() : ::rtl::OUString( pMed->GetOrigURL() ) ); if ( aURL.GetProtocol() == INET_PROT_VND_SUN_STAR_HELP ) return; @@ -423,12 +424,12 @@ void SfxPickList::Notify( SfxBroadcaster&, const SfxHint& rHint ) if( !pMed ) return; - // unbenannt-Docs und embedded-Docs nicht in Pickliste + // Unnamed Documents and embedded-Documents not im Pickliste if ( !pDocSh->HasName() || SFX_CREATE_MODE_STANDARD != pDocSh->GetCreateMode() ) return; - // Hilfe nicht in History + // Help not in History INetURLObject aURL( pDocSh->IsDocShared() ? pDocSh->GetSharedFileURL() : ::rtl::OUString( pMed->GetOrigURL() ) ); if ( aURL.GetProtocol() == INET_PROT_VND_SUN_STAR_HELP ) return; @@ -471,3 +472,5 @@ void SfxPickList::Notify( SfxBroadcaster&, const SfxHint& rHint ) } } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx index 142602ca58..887cc4c73c 100644 --- a/sfx2/source/appl/shutdownicon.cxx +++ b/sfx2/source/appl/shutdownicon.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,7 +32,7 @@ #include <shutdownicon.hxx> #include <app.hrc> #include <sfx2/app.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <svtools/imagemgr.hxx> #include <svtools/miscopt.hxx> // #include <cmdlineargs.hxx> @@ -52,9 +53,7 @@ #include <com/sun/star/document/UpdateDocMode.hpp> #include <sfx2/filedlghelper.hxx> #include <sfx2/fcontnr.hxx> -#ifndef _UNOTOOLS_PROCESSFACTORY_HXX #include <comphelper/processfactory.hxx> -#endif #include <cppuhelper/compbase1.hxx> #include <sfx2/dispatch.hxx> #include <comphelper/extract.hxx> @@ -275,7 +274,7 @@ void ShutdownIcon::OpenURL( const ::rtl::OUString& aURL, const ::rtl::OUString& aDispatchURL.Complete = aURL; Reference < com::sun::star::util::XURLTransformer > xURLTransformer( - ::comphelper::getProcessServiceFactory()->createInstance( OUString::createFromAscii("com.sun.star.util.URLTransformer") ), + ::comphelper::getProcessServiceFactory()->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer")) ), com::sun::star::uno::UNO_QUERY ); if ( xURLTransformer.is() ) { @@ -306,7 +305,7 @@ void ShutdownIcon::FileOpen() { if ( getInstance() && getInstance()->m_xDesktop.is() ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + ::SolarMutexGuard aGuard; EnterModalMode(); getInstance()->StartFileDialog(); } @@ -325,7 +324,7 @@ void ShutdownIcon::FromTemplate() URL aTargetURL; aTargetURL.Complete = OUString( RTL_CONSTASCII_USTRINGPARAM( "slot:5500" ) ); - Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), UNO_QUERY ); + Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), UNO_QUERY ); xTrans->parseStrict( aTargetURL ); Reference < ::com::sun::star::frame::XDispatchProvider > xProv( xFrame, UNO_QUERY ); @@ -335,14 +334,14 @@ void ShutdownIcon::FromTemplate() if ( aTargetURL.Protocol.compareToAscii("slot:") == COMPARE_EQUAL ) xDisp = xProv->queryDispatch( aTargetURL, ::rtl::OUString(), 0 ); else - xDisp = xProv->queryDispatch( aTargetURL, ::rtl::OUString::createFromAscii("_blank"), 0 ); + xDisp = xProv->queryDispatch( aTargetURL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_blank")), 0 ); } if ( xDisp.is() ) { Sequence<PropertyValue> aArgs(1); PropertyValue* pArg = aArgs.getArray(); - pArg[0].Name = rtl::OUString::createFromAscii("Referer"); - pArg[0].Value <<= ::rtl::OUString::createFromAscii("private:user"); + pArg[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Referer")); + pArg[0].Value <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("private:user")); Reference< ::com::sun::star::frame::XNotifyingDispatch > xNotifyer( xDisp, UNO_QUERY ); if ( xNotifyer.is() ) { @@ -359,7 +358,7 @@ void ShutdownIcon::FromTemplate() #include <tools/rcid.h> OUString ShutdownIcon::GetResString( int id ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + ::SolarMutexGuard aGuard; if( ! m_pResMgr ) m_pResMgr = SfxResId::GetResMgr(); @@ -376,7 +375,7 @@ OUString ShutdownIcon::GetResString( int id ) OUString ShutdownIcon::GetUrlDescription( const OUString& aUrl ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + ::SolarMutexGuard aGuard; return OUString( SvFileInformationManager::GetDescription( INetURLObject( aUrl ) ) ); } @@ -385,7 +384,7 @@ OUString ShutdownIcon::GetUrlDescription( const OUString& aUrl ) void ShutdownIcon::StartFileDialog() { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + ::SolarMutexGuard aGuard; bool bDirty = ( m_bSystemDialogs != static_cast<bool>(SvtMiscOptions().UseSystemFileDialog()) ); @@ -429,18 +428,18 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR Sequence< PropertyValue > aArgs(3); Reference < com::sun::star::task::XInteractionHandler > xInteraction( - ::comphelper::getProcessServiceFactory()->createInstance( OUString::createFromAscii("com.sun.star.task.InteractionHandler") ), + ::comphelper::getProcessServiceFactory()->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.task.InteractionHandler")) ), com::sun::star::uno::UNO_QUERY ); - aArgs[0].Name = OUString::createFromAscii( "InteractionHandler" ); + aArgs[0].Name = OUString(RTL_CONSTASCII_USTRINGPARAM("InteractionHandler")); aArgs[0].Value <<= xInteraction; sal_Int16 nMacroExecMode = ::com::sun::star::document::MacroExecMode::USE_CONFIG; - aArgs[1].Name = OUString::createFromAscii( "MacroExecutionMode" ); + aArgs[1].Name = OUString(RTL_CONSTASCII_USTRINGPARAM("MacroExecutionMode")); aArgs[1].Value <<= nMacroExecMode; sal_Int16 nUpdateDoc = ::com::sun::star::document::UpdateDocMode::ACCORDING_TO_CONFIG; - aArgs[2].Name = OUString::createFromAscii( "UpdateDocMode" ); + aArgs[2].Name = OUString(RTL_CONSTASCII_USTRINGPARAM("UpdateDocMode")); aArgs[2].Value <<= nUpdateDoc; // pb: #102643# use the filedlghelper to get the current filter name, @@ -462,7 +461,7 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR if ( bReadOnly ) { aArgs.realloc( ++nArgs ); - aArgs[nArgs-1].Name = OUString::createFromAscii( "ReadOnly" ); + aArgs[nArgs-1].Name = OUString(RTL_CONSTASCII_USTRINGPARAM("ReadOnly")); aArgs[nArgs-1].Value <<= bReadOnly; } @@ -477,7 +476,7 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR sal_Int16 uVersion = (sal_Int16)iVersion; aArgs.realloc( ++nArgs ); - aArgs[nArgs-1].Name = OUString::createFromAscii( "Version" ); + aArgs[nArgs-1].Name = OUString(RTL_CONSTASCII_USTRINGPARAM("Version")); aArgs[nArgs-1].Value <<= uVersion; } @@ -502,7 +501,7 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR if ( aFilterName.getLength() ) { aArgs.realloc( ++nArgs ); - aArgs[nArgs-1].Name = OUString::createFromAscii( "FilterName" ); + aArgs[nArgs-1].Name = OUString(RTL_CONSTASCII_USTRINGPARAM("FilterName")); aArgs[nArgs-1].Value <<= aFilterName; } } @@ -514,7 +513,7 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR { OUString aBaseDirURL = sFiles[0]; if ( aBaseDirURL.getLength() > 0 && aBaseDirURL[aBaseDirURL.getLength()-1] != '/' ) - aBaseDirURL += OUString::createFromAscii("/"); + aBaseDirURL += OUString(RTL_CONSTASCII_USTRINGPARAM("/")); int iFiles; for ( iFiles = 1; iFiles < nFiles; iFiles++ ) @@ -579,19 +578,16 @@ void ShutdownIcon::terminateDesktop() return; // always remove ourselves as listener - xDesktop->removeTerminateListener( pInst ); pInst->m_bListenForTermination = true; + xDesktop->removeTerminateListener( pInst ); // terminate desktop only if no tasks exist Reference< XFramesSupplier > xSupplier( xDesktop, UNO_QUERY ); if ( xSupplier.is() ) { Reference< XIndexAccess > xTasks ( xSupplier->getFrames(), UNO_QUERY ); - if( xTasks.is() ) - { - if( xTasks->getCount() < 1 ) - xDesktop->terminate(); - } + if( xTasks.is() && xTasks->getCount() < 1 ) + new IdleTerminate( xDesktop ); } // remove the instance pointer @@ -629,7 +625,7 @@ ShutdownIcon* ShutdownIcon::createInstance() void ShutdownIcon::init() throw( ::com::sun::star::uno::Exception ) { // access resource system and sfx only protected by solarmutex - vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + ::SolarMutexGuard aSolarGuard; ResMgr *pResMgr = SfxResId::GetResMgr(); ::osl::ResettableMutexGuard aGuard( m_aMutex ); @@ -781,12 +777,20 @@ bool ShutdownIcon::IsQuickstarterInstalled() // --------------------------------------------------------------------------- #if defined (ENABLE_QUICKSTART_APPLET) && defined (UNX) -static OUString getDotAutostart( bool bCreate = false ) +/** +* Return the XDG autostart directory. +* http://standards.freedesktop.org/autostart-spec/autostart-spec-latest.html +* Available in Unix and with Quickstart enabled. +* @param bCreate Create the directory if it does not exist yet. +* @return OUString containing the autostart directory path. +*/ +static OUString getAutostartDir( bool bCreate = false ) { OUString aShortcut; const char *pConfigHome; if( (pConfigHome = getenv("XDG_CONFIG_HOME") ) ) - aShortcut = OStringToOUString( OString( pConfigHome ), RTL_TEXTENCODING_UTF8 ); + aShortcut = OStringToOUString( OString( pConfigHome ), + RTL_TEXTENCODING_UTF8 ); else { OUString aHomeURL; @@ -815,7 +819,7 @@ rtl::OUString ShutdownIcon::getShortcutName() ResMgr* pMgr = SfxResId::GetResMgr(); if( pMgr ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + ::SolarMutexGuard aGuard; UniString aRes( SfxResId( STR_QUICKSTART_LNKNAME ) ); aShortcutName = OUString( aRes ); } @@ -826,7 +830,7 @@ rtl::OUString ShutdownIcon::getShortcutName() aShortcut += OUString( RTL_CONSTASCII_USTRINGPARAM( "\\" ) ); aShortcut += aShortcutName; #else // UNX - OUString aShortcut = getDotAutostart(); + OUString aShortcut = getAutostartDir(); aShortcut += OUString( RTL_CONSTASCII_USTRINGPARAM( "/qstart.desktop" ) ); #endif // UNX return aShortcut; @@ -846,7 +850,7 @@ bool ShutdownIcon::GetAutostart( ) OUString aShortcutUrl; osl::File::getFileURLFromSystemPath( aShortcut, aShortcutUrl ); osl::File f( aShortcutUrl ); - osl::File::RC error = f.open( OpenFlag_Read ); + osl::File::RC error = f.open( osl_File_OpenFlag_Read ); if( error == osl::File::E_None ) { f.close(); @@ -867,7 +871,7 @@ void ShutdownIcon::SetAutostart( bool bActivate ) #ifdef WNT EnableAutostartW32( aShortcut ); #else // UNX - getDotAutostart( true ); + getAutostartDir( true ); OUString aPath( RTL_CONSTASCII_USTRINGPARAM("${BRAND_BASE_DIR}/share/xdg/qstart.desktop" ) ); Bootstrap::expandMacros( aPath ); @@ -879,10 +883,11 @@ void ShutdownIcon::SetAutostart( bool bActivate ) osl_getThreadTextEncoding() ); OString aShortcutUnx = OUStringToOString( aShortcut, osl_getThreadTextEncoding() ); - if ((0 != symlink(aDesktopFileUnx, aShortcutUnx)) && (errno == EEXIST)) - { - unlink(aShortcutUnx); - symlink(aDesktopFileUnx, aShortcutUnx); + if ((0 != symlink(aDesktopFileUnx, aShortcutUnx)) && (errno == EEXIST)) + { + unlink(aShortcutUnx); + int ret = symlink(aDesktopFileUnx, aShortcutUnx); + (void)ret; //deliberately ignore return value, it's non-critical if it fails } ShutdownIcon *pIcon = ShutdownIcon::createInstance(); @@ -963,3 +968,5 @@ void SAL_CALL ShutdownIcon::setFastPropertyValue( ::sal_Int32 return aValue; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/shutdownicon.hxx b/sfx2/source/appl/shutdownicon.hxx index cc18016e33..09fc15f1ce 100644 --- a/sfx2/source/appl/shutdownicon.hxx +++ b/sfx2/source/appl/shutdownicon.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #ifndef __SHUTDOWNICON_HXX__ #define __SHUTDOWNICON_HXX__ @@ -12,12 +13,8 @@ #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/beans/XFastPropertySet.hpp> -#ifndef _RTL_STRING_HXX #include <rtl/string.hxx> -#endif -#ifndef _RTL_USTRING_HXX #include <rtl/ustring.hxx> -#endif #include <osl/mutex.hxx> #include <osl/module.hxx> #include <sfx2/sfxuno.hxx> @@ -173,3 +170,5 @@ extern "C" { } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/shutdowniconOs2.cxx b/sfx2/source/appl/shutdowniconOs2.cxx index a4595949b1..653e89c4d0 100644 --- a/sfx2/source/appl/shutdowniconOs2.cxx +++ b/sfx2/source/appl/shutdowniconOs2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -92,3 +93,4 @@ bool ShutdownIcon::GetAutostartOs2( ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/shutdowniconaqua.mm b/sfx2/source/appl/shutdowniconaqua.mm index 14f12c79b5..8ce1927f80 100644 --- a/sfx2/source/appl/shutdowniconaqua.mm +++ b/sfx2/source/appl/shutdowniconaqua.mm @@ -34,8 +34,9 @@ #include "tools/urlobj.hxx" #include "osl/file.h" #include "comphelper/sequenceashashmap.hxx" -#include "vos/mutex.hxx" +#include "osl/mutex.hxx" #include "sfx2/app.hxx" +#include <sal/macros.h> #include "app.hrc" #define USE_APP_SHORTCUTS #include "shutdownicon.hxx" @@ -385,7 +386,7 @@ extern "C" void aqua_init_systray() { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; ShutdownIcon *pShutdownIcon = ShutdownIcon::getInstance(); if( ! pShutdownIcon ) @@ -454,7 +455,7 @@ void aqua_init_systray() } // insert the menu entries for launching the applications - for ( size_t i = 0; i < sizeof( aMenuItems ) / sizeof( aMenuItems[0] ); ++i ) + for ( size_t i = 0; i < SAL_N_ELEMENTS( aMenuItems ); ++i ) { if ( !aModuleOptions.IsModuleInstalled( aMenuItems[i].eModuleIdentifier ) ) // the complete application is not even installed diff --git a/sfx2/source/appl/shutdowniconunx.cxx b/sfx2/source/appl/shutdowniconunx.cxx index b9799f5818..7e3aa09347 100644 --- a/sfx2/source/appl/shutdowniconunx.cxx +++ b/sfx2/source/appl/shutdowniconunx.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #ifdef ENABLE_QUICKSTART_APPLET @@ -7,19 +8,20 @@ #include <gtk/gtk.h> #include <glib.h> -#include <eggtray/eggtrayicon.h> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <vcl/bitmapex.hxx> #include <vcl/bmpacc.hxx> #include <sfx2/app.hxx> -#ifndef _SFX_APP_HRC #include "app.hrc" -#endif #ifndef __SHUTDOWNICON_HXX__ #define USE_APP_SHORTCUTS #include "shutdownicon.hxx" #endif +#ifdef ENABLE_GIO +#include <gio/gio.h> +#endif + // Cut/paste from vcl/inc/svids.hrc #define SV_ICON_SMALL_START 25000 @@ -36,9 +38,13 @@ using namespace ::rtl; using namespace ::osl; static ResMgr *pVCLResMgr; -static EggTrayIcon *pTrayIcon; +static GtkStatusIcon* pTrayIcon; static GtkWidget *pExitMenuItem = NULL; static GtkWidget *pOpenMenuItem = NULL; +static GtkWidget *pDisableMenuItem = NULL; +#ifdef ENABLE_GIO +GFileMonitor* pMonitor = NULL; +#endif static void open_url_cb( GtkWidget *, gpointer data ) { @@ -66,9 +72,10 @@ static void systray_disable_cb() static void exit_quickstarter_cb( GtkWidget * ) { - egg_tray_icon_cancel_message (pTrayIcon, 1 ); - ShutdownIcon::getInstance()->terminateDesktop(); plugin_shutdown_sys_tray(); + //terminate may cause this .so to be unloaded. So we must be hands off + //all calls into this .so after this call + ShutdownIcon::terminateDesktop(); } static void menu_deactivate_cb( GtkWidget *pMenu ) @@ -89,7 +96,8 @@ static GdkPixbuf * ResIdToPixbuf( USHORT nResId ) g_return_val_if_fail( pSalBitmap != NULL, NULL ); Size aSize( pSalBitmap->Width(), pSalBitmap->Height() ); - g_return_val_if_fail( Size( pSalAlpha->Width(), pSalAlpha->Height() ) == aSize, NULL ); + if (pSalAlpha) + g_return_val_if_fail( Size( pSalAlpha->Width(), pSalAlpha->Height() ) == aSize, NULL ); int nX, nY; guchar *pPixbufData = ( guchar * )g_malloc( 4 * aSize.Width() * aSize.Height() ); @@ -265,7 +273,7 @@ static void populate_menu( GtkWidget *pMenu ) pMenuItem = gtk_separator_menu_item_new(); gtk_menu_shell_append( pMenuShell, pMenuItem ); - (void) add_image_menu_item + pDisableMenuItem = add_image_menu_item ( pMenuShell, GTK_STOCK_CLOSE, pShutdownIcon->GetResString( STR_QUICKSTART_PRELAUNCH_UNX ), G_CALLBACK( systray_disable_cb ) ); @@ -289,30 +297,7 @@ static void refresh_menu( GtkWidget *pMenu ) bool bModal = ShutdownIcon::bModalMode; gtk_widget_set_sensitive( pExitMenuItem, !bModal); gtk_widget_set_sensitive( pOpenMenuItem, !bModal); -} - -extern "C" { -static void -layout_menu( GtkMenu *menu, - gint *x, gint *y, gboolean *push_in, - gpointer ) -{ - GtkRequisition req; - GtkWidget *ebox = GTK_BIN( pTrayIcon )->child; - - gtk_widget_size_request( GTK_WIDGET( menu ), &req ); - gdk_window_get_origin( ebox->window, x, y ); - - (*x) += ebox->allocation.x; - (*y) += ebox->allocation.y; - - if (*y >= gdk_screen_get_height (gtk_widget_get_screen (ebox)) / 2) - (*y) -= req.height; - else - (*y) += ebox->allocation.height; - - *push_in = TRUE; -} + gtk_widget_set_sensitive( pDisableMenuItem, !bModal); } static gboolean display_menu_cb( GtkWidget *, @@ -336,26 +321,36 @@ static gboolean display_menu_cb( GtkWidget *, refresh_menu( pMenu ); gtk_menu_popup( GTK_MENU( pMenu ), NULL, NULL, - layout_menu, NULL, 0, event->time ); + gtk_status_icon_position_menu, pTrayIcon, + 0, event->time ); return TRUE; } -extern "C" { - static gboolean - show_at_idle( gpointer ) - { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - gtk_widget_show_all( GTK_WIDGET( pTrayIcon ) ); - return FALSE; - } +#ifdef ENABLE_GIO +/* + * See rhbz#610103. If the quickstarter is running, then LibreOffice is + * upgraded, then the old quickstarter is still running, but is now unreliable + * as the old install has been deleted. A fairly intractable problem but we + * can avoid much of the pain if we turn off the quickstarter if we detect + * that it has been physically deleted. +*/ +static void notify_file_changed(GFileMonitor * /*gfilemonitor*/, GFile * /*arg1*/, + GFile * /*arg2*/, GFileMonitorEvent event_type, gpointer /*user_data*/) +{ + if (event_type == G_FILE_MONITOR_EVENT_DELETED) + exit_quickstarter_cb(NULL); } +#endif void SAL_DLLPUBLIC_EXPORT plugin_init_sys_tray() { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + ::SolarMutexGuard aGuard; - if( !g_type_from_name( "GdkDisplay" ) ) + if( /* need gtk_status to resolve */ + (gtk_check_version( 2, 10, 0 ) != NULL) || + /* we need the vcl plugin and mainloop initialized */ + !g_type_from_name( "GdkDisplay" ) ) return; OString aLabel; @@ -365,45 +360,65 @@ void SAL_DLLPUBLIC_EXPORT plugin_init_sys_tray() pShutdownIcon->GetResString( STR_QUICKSTART_TIP ), RTL_TEXTENCODING_UTF8 ); - pTrayIcon = egg_tray_icon_new( aLabel ); - - GtkWidget *pParent = gtk_event_box_new(); - GtkTooltips *pTooltips = gtk_tooltips_new(); - gtk_tooltips_set_tip( GTK_TOOLTIPS( pTooltips ), pParent, aLabel, NULL ); - - GtkWidget *pIconImage = gtk_image_new(); - gtk_container_add( GTK_CONTAINER( pParent ), pIconImage ); - pVCLResMgr = CREATEVERSIONRESMGR( vcl ); GdkPixbuf *pPixbuf = ResIdToPixbuf( SV_ICON_ID_OFFICE ); gtk_image_set_from_pixbuf( GTK_IMAGE( pIconImage ), pPixbuf ); g_object_unref( pPixbuf ); + g_object_set (pTrayIcon, "title", aLabel.getStr(), + "tooltip_text", aLabel.getStr(), NULL); + GtkWidget *pMenu = gtk_menu_new(); g_signal_connect (pMenu, "deactivate", G_CALLBACK (menu_deactivate_cb), NULL); - g_signal_connect( pParent, "button_press_event", - G_CALLBACK( display_menu_cb ), pMenu ); - gtk_container_add( GTK_CONTAINER( pTrayIcon ), pParent ); - - // Show at idle to avoid artefacts at startup - g_idle_add (show_at_idle, (gpointer) pTrayIcon); + g_signal_connect(pTrayIcon, "button_press_event", + G_CALLBACK(display_menu_cb), pMenu); // disable shutdown pShutdownIcon->SetVeto( true ); pShutdownIcon->addTerminateListener(); + +#ifdef ENABLE_GIO + GFile* pFile = NULL; + rtl::OUString sLibraryFileUrl; + if (osl::Module::getUrlFromAddress(plugin_init_sys_tray, sLibraryFileUrl)) + pFile = g_file_new_for_uri(rtl::OUStringToOString(sLibraryFileUrl, RTL_TEXTENCODING_UTF8).getStr()); + + if (pFile) + { + if ((pMonitor = g_file_monitor_file(pFile, G_FILE_MONITOR_NONE, NULL, NULL))) + g_signal_connect(pMonitor, "changed", (GCallback)notify_file_changed, NULL); + g_object_unref(pFile); + } +#endif } void SAL_DLLPUBLIC_EXPORT plugin_shutdown_sys_tray() { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + ::SolarMutexGuard aGuard; if( !pTrayIcon ) return; - gtk_widget_destroy( GTK_WIDGET( pTrayIcon ) ); + +#ifdef ENABLE_GIO + if (pMonitor) + { + g_signal_handlers_disconnect_by_func(pMonitor, + (void*)notify_file_changed, pMonitor); + g_file_monitor_cancel(pMonitor); + g_object_unref(pMonitor); + pMonitor = NULL; + } +#endif + + g_object_unref(pTrayIcon); pTrayIcon = NULL; + pExitMenuItem = NULL; pOpenMenuItem = NULL; + pDisableMenuItem = NULL; } #endif // ENABLE_QUICKSTART_APPLET + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/shutdowniconw32.cxx b/sfx2/source/appl/shutdowniconw32.cxx index 9e260fdc85..7c42b3e997 100644 --- a/sfx2/source/appl/shutdowniconw32.cxx +++ b/sfx2/source/appl/shutdowniconw32.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,6 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" +#include <sal/macros.h> #ifdef WNT @@ -250,7 +252,7 @@ static HMENU createSystrayMenu( ) OUString aEmpty; // insert the menu entries for launching the applications - for ( size_t i = 0; i < sizeof( aMenuItems ) / sizeof( aMenuItems[0] ); ++i ) + for ( size_t i = 0; i < SAL_N_ELEMENTS( aMenuItems ); ++i ) { if ( !aModuleOptions.IsModuleInstalled( aMenuItems[i].eModuleIdentifier ) ) // the complete application is not even installed @@ -493,7 +495,7 @@ LRESULT CALLBACK listenerWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP static sal_Bool checkOEM() { Reference<XMultiServiceFactory> rFactory = ::comphelper::getProcessServiceFactory(); Reference<XJob> rOemJob(rFactory->createInstance( - OUString::createFromAscii("com.sun.star.office.OEMPreloadJob")), + OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.office.OEMPreloadJob"))), UNO_QUERY ); Sequence<NamedValue> args; sal_Bool bResult = sal_False; @@ -975,3 +977,4 @@ void ShutdownIcon::EnableAutostartW32( const rtl::OUString &aShortcut ) #endif // WNT +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx index 06083e5013..fac30fece6 100644 --- a/sfx2/source/appl/workwin.cxx +++ b/sfx2/source/appl/workwin.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,9 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" -#ifndef GCC -#endif - #include <stdio.h> #include <hash_map> @@ -141,6 +139,7 @@ static const ResIdToResName pToolBarResToName[] = { 23031, "mediaobjectbar" }, //draw/impress { 25060, "mediaobjectbar" }, //calc { 23311, "mediaobjectbar" }, //writer + { 23313, "navigationobjectbar" }, //writer { 0, "" } }; @@ -149,11 +148,11 @@ DBG_NAME(SfxWorkWindow) //SV_IMPL_OBJARR( SfxObjectBarArr_Impl, SfxObjectBar_Impl ); //==================================================================== -// Sortiert die Children nach ihrem Alignment -// Reihenfolge entspricht der im enum SfxChildAlignment (->CHILDWIN.HXX). +// Sort the Children according their alignment +// The order corresponds to the enum SfxChildAlignment (->CHILDWIN.HXX). // -// Hilfe, um die "Anderungen am Alignment kompatibal zu machen! +// Help to make changes to the alignment compatible! SFX_IMPL_XINTERFACE_3( LayoutManagerListener, OWeakObject, ::com::sun::star::frame::XLayoutManagerListener, ::com::sun::star::lang::XEventListener, ::com::sun::star::lang::XComponent ) @@ -173,7 +172,7 @@ LayoutManagerListener::~LayoutManagerListener() void LayoutManagerListener::setFrame( const css::uno::Reference< css::frame::XFrame >& xFrame ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( m_pWrkWin && !m_bHasFrame ) { m_xFrame = xFrame; @@ -238,7 +237,7 @@ throw (::com::sun::star::uno::RuntimeException) void SAL_CALL LayoutManagerListener::dispose() throw( css::uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; // reset member m_pWrkWin = 0; @@ -285,7 +284,7 @@ void SAL_CALL LayoutManagerListener::disposing( const css::lang::EventObject& ) throw( css::uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; m_pWrkWin = 0; m_bHasFrame = sal_False; m_xFrame = css::uno::Reference< css::frame::XFrame >(); @@ -300,7 +299,7 @@ void SAL_CALL LayoutManagerListener::layoutEvent( const css::uno::Any& ) throw (css::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( m_pWrkWin ) { if ( eLayoutEvent == css::frame::LayoutManagerEvents::VISIBLE ) @@ -527,7 +526,7 @@ void SfxWorkWindow::Sort_Impl() { USHORT k; for (k=0; k<aSortedList.Count(); k++) -// if ( (*pChilds)[aSortedList[k]]->eAlign > pCli->eAlign ) +// if ( (*pChilds)[aSortedList[k]]->eAlign > pCli->eAlign ) if (ChildAlignValue((*pChilds)[aSortedList[k]]->eAlign) > ChildAlignValue(pCli->eAlign)) break; @@ -540,7 +539,7 @@ void SfxWorkWindow::Sort_Impl() //==================================================================== -// ctor f"ur workwin eines Frames +// constructor for workwin of a Frame SfxFrameWorkWin_Impl::SfxFrameWorkWin_Impl( Window *pWin, SfxFrame *pFrm, SfxFrame* pMaster ) : SfxWorkWindow( @@ -558,11 +557,11 @@ SfxFrameWorkWin_Impl::SfxFrameWorkWin_Impl( Window *pWin, SfxFrame *pFrm, SfxFra bInternalDockingAllowed = sal_True; } - // Die ben"otigten SplitWindows (je eins f"ur jede Seite) werden erzeugt + // The required split windows (one for each side) can be created for ( USHORT n=0; n<SFX_SPLITWINDOWS_MAX; n++ ) { - // Die SplitWindows sind direkte ChildWindows des WorkWindows und enthalten - // die angedockten Fenster. + // The SplitWindows excludes direct ChildWindows of the WorkWindows + // and receives the docked window. SfxChildAlignment eAlign = ( n == SFX_SPLITWINDOWS_LEFT ? SFX_ALIGN_LEFT : @@ -579,7 +578,7 @@ SfxFrameWorkWin_Impl::SfxFrameWorkWin_Impl( Window *pWin, SfxFrame *pFrm, SfxFra } //==================================================================== -// ctor der Basisklasse +// Constructor of the base class SfxWorkWindow::SfxWorkWindow( Window *pWin, SfxBindings& rB, SfxWorkWindow* pParentWorkwin ) : pParent( pParentWorkwin ), @@ -609,8 +608,8 @@ SfxWorkWindow::SfxWorkWindow( Window *pWin, SfxBindings& rB, SfxWorkWindow* pPar pChildWins = new SfxChildWindows_Impl; pChilds = new SfxChildList_Impl; - // F"ur die ObjectBars wird ein fester Platz in der ChildList reserviert, - // damit sie immer in einer definierten Reihenfolge kommen. + // For the ObjectBars a integral place in the Childlist is reserved, + // so that they always come in a defined order. SfxChild_Impl* pChild=0; for (USHORT n=0; n < SFX_OBJECTBAR_MAX; ++n) pChilds->Insert(0,pChild); @@ -625,13 +624,13 @@ SfxWorkWindow::SfxWorkWindow( Window *pWin, SfxBindings& rB, SfxWorkWindow* pPar } //==================================================================== -// dtor +// Destructor SfxWorkWindow::~SfxWorkWindow() { DBG_DTOR(SfxWorkWindow, 0); - // SplitWindows l"oschen + // Delete SplitWindows for ( USHORT n=0; n<SFX_SPLITWINDOWS_MAX; n++ ) { SfxSplitWindow *p = pSplit[n]; @@ -640,7 +639,7 @@ SfxWorkWindow::~SfxWorkWindow() delete p; } - // Hilfsstruktur f"ur Child-Windows l"oschen + // Delete help structure for Child-Windows DBG_ASSERT( pChilds->Count() == 0, "dangling childs" ); delete pChilds; delete pChildWins; @@ -705,17 +704,17 @@ void SfxWorkWindow::SaveStatus_Impl() } //-------------------------------------------------------------------- -// Hilfsmethode zum Freigeben der Childlisten. Wenn danach nicht der dtor -// aufgerufen wird, sondern weiter gearbeitet wird, mu\s wie im ctor von -// SfxWorkWindow noch Platz f"ur die Objectbars und SplitWindows reserviert -// werden. +// Helper method to release the child lists. Should the destructor not be +// called after this, instead work continues, then space for the object bars +// and split windows has to be reserved in the same way as in the constructor +// of SfxWorkWindow. void SfxWorkWindow::DeleteControllers_Impl() { DBG_CHKTHIS(SfxWorkWindow, 0); - // SplitWindows locken (d.h. Resize-Reaktion an den - // DockingWindows unterdr"ucken) + // Lock SplitWindows (which means supressing the Resize-Reaction of the + // DockingWindows) USHORT n; for ( n=0; n<SFX_SPLITWINDOWS_MAX; n++ ) { @@ -724,7 +723,7 @@ void SfxWorkWindow::DeleteControllers_Impl() p->Lock(); } - // Child-Windows l"oschen + // Delete Child-Windows for ( n=0; n<pChildWins->Count(); ) { SfxChildWin_Impl* pCW = (*pChildWins)[n]; @@ -740,10 +739,10 @@ void SfxWorkWindow::DeleteControllers_Impl() */ pChild->Hide(); - // Wenn das ChildWindow ein direktes Childfenster ist und nicht - // in einem SplitWindow liegt, am WorkWindow abmelden. - // Nach TH ist eine Abmeldung am Splitwindow nicht erforderlich, - // wenn dieses auch gleich mit zerst"ort wird (s.u.). + // If the child window is a direct child window and not in a + // SplitWindow, cancel it at the workwindow. + // After TH a cancellation on the SplitWindow is not necessary + // since this window is also destroyed (see below). if (pCW->pCli) ReleaseChild_Impl(*pChild->GetWindow()); pCW->pWin = 0; @@ -783,21 +782,22 @@ void SfxWorkWindow::DeleteControllers_Impl() { xLayoutManager->reset(); - // StatusBar l"oschen + // Delete StatusBar ResetStatusBar_Impl(); - // ObjectBars l"oschen( zuletzt, damit pChilds nicht tote Pointer enh"alt ) + // Delete ObjectBars (this is done last, so that pChilds does not + // receive dead Pointers) for ( USHORT i = 0; i < aObjBarList.size(); i++ ) { - // Nicht jede Position mu\s belegt sein + // Not every position must be occupied USHORT nId = aObjBarList[i].nId; if ( nId ) aObjBarList[i].nId = 0; } } - // ObjectBars werden alle auf einmal released, da sie einen - // festen zusammenh"angenden Bereich im Array pChilds belegen + // ObjectBars are all released at once, since they occupy a + // fixed contiguous area in the array pChild pChilds->Remove(0, SFX_OBJECTBAR_MAX); bSorted = FALSE; @@ -805,7 +805,7 @@ void SfxWorkWindow::DeleteControllers_Impl() } //==================================================================== -// Virtuelle Methode zum Anordnen der Childfenster. +// Virtual method for placing the child window. void SfxWorkWindow::ArrangeChilds_Impl( BOOL /*bForce*/) { @@ -835,16 +835,14 @@ void SfxFrameWorkWin_Impl::ArrangeChilds_Impl( BOOL bForce ) if ( IsVisible_Impl() ) aBorder = Arrange_Impl(); } - - // Wenn das aktuelle Dokument der Applikation einen IPClient enth"alt, mu\s - // dem dazugeh"origen Objekt durch SetTopToolFramePixel der zur Verf"ugung - // stehende Platz zugeteilt werden. Das Objekt zeigt dann seine UITools an - // und setzt den App-Border(->SfxInPlaceEnv_Impl::ArrangeChilds_Impl()). - // Anderenfalls wird hier direkt der AppBorder gesetzt, um evtl. den Border - // zu "uberschreiben, den bisher ein Objekt aus einem anderen Dokument - // gesetzt hatte. - // Das Objekt setzt, wenn es seine UI-Tools wegnimmt, den SetAppBorder nicht, - // damit kein ObjectBar-Zappeln entsteht. + // If the current application document contains a IPClient, then the + // object through SetTopToolFramePixel has to be assigned the available + // space. The object will then point to its UITools and sets the app border + // (-> SfxInPlaceEnv_Impl:: ArrangeChilds_Impl ()). Otherwise the + // app border is set here directly to possibly overwrite the Border that + // was set by an object from another document. The object does not set + // the SetAppBorder when it removes its UI tools so that no-dithering + // ObjectBar arises. // (->SfxInPlaceEnv_Impl::ArrangeChilds_Impl()) pMasterFrame->SetToolSpaceBorderPixel_Impl( aBorder ); @@ -856,13 +854,12 @@ void SfxFrameWorkWin_Impl::ArrangeChilds_Impl( BOOL bForce ) SvBorder SfxWorkWindow::Arrange_Impl() -/* [Beschreibung] - - Diese Methode ordnet alle sichtbaren ChildFenster so an, da\s die angedockten - Fenster nach der Sorierreihenfolge von au\sen nach innen aneinander - gesetzt werden. Wenn ein an sich sichtbares Fenster nicht mehr in die - noch freie ClientArea pa\st, wird es auf "nicht sichtbar" gesetzt. +/* [Description] + This method organizes all visible child windows so that the docked window + sorted in order from the outside to the inside are placed after one + another. If a visible window does not fit anymore into the free + ClientArea, it is set to "not visible". */ { DBG_CHKTHIS(SfxWorkWindow, 0); @@ -887,10 +884,10 @@ SvBorder SfxWorkWindow::Arrange_Impl() if ( !pCli->pWin ) continue; - // Zun"achst nehmen wir an, da\s das Fenster Platz hat + // First, we assume that there is room for the window. pCli->nVisible |= CHILD_FITS_IN; - // Nicht sichtbare Fenster "uberspringen + // Skip invisiable windows if (pCli->nVisible != CHILD_VISIBLE) continue; @@ -1007,7 +1004,7 @@ SvBorder SfxWorkWindow::Arrange_Impl() } //-------------------------------------------------------------------- -// Close-Handler: die Konfiguration der ChildWindows wird gespeichert. +// Close-Handler: The Configuration of the ChildWindows is saved. // void SfxWorkWindow::Close_Impl() @@ -1292,13 +1289,12 @@ void SfxWorkWindow::SetObjectBar_Impl( USHORT nPos, sal_uInt32 nResId, //------------------------------------------------------------------------ -FASTBOOL SfxWorkWindow::KnowsObjectBar_Impl( USHORT nPos ) const +bool SfxWorkWindow::KnowsObjectBar_Impl( USHORT nPos ) const -/* [Beschreibung] +/* [Description] - Stellt fest, ob an der betreffenden Position "uberhaupt eine - Objektleiste zur Verf"ugung stehen w"urde. Ist unabh"agig davon, - ob diese tats"achlich ein- oder ausgeschaltet ist. + Determines if a object list is available at the position in question. + This is independent for the fact whether it is actually turned on or off. */ { @@ -1443,8 +1439,8 @@ sal_Bool SfxWorkWindow::IsPluginMode( SfxObjectShell* pObjShell ) void SfxWorkWindow::UpdateObjectBars_Impl() { - // SplitWindows locken (d.h. Resize-Reaktion an den - // DockingWindows unterdr"ucken) + // Lock SplitWindows (which means supressing the Resize-Reaction of the + // DockingWindows) USHORT n; for ( n=0; n<SFX_SPLITWINDOWS_MAX; n++ ) { @@ -1453,7 +1449,7 @@ void SfxWorkWindow::UpdateObjectBars_Impl() p->Lock(); } - // was man so "ofters braucht, merkt man sich (spart Code und Laufzeit) + // you realize what is needed often (saves Code and execution time) SFX_APP(); Reference< com::sun::star::beans::XPropertySet > xPropSet( GetFrameInterface(), UNO_QUERY ); @@ -1478,22 +1474,22 @@ void SfxWorkWindow::UpdateObjectBars_Impl() bPluginMode = IsPluginMode( pFrame->GetObjectShell() ); } - // "uber alle Toolboxen iterieren + // Iterate over all Toolboxes xLayoutManager->lock(); for ( n = 0; n < aObjBarList.size(); ++n ) { USHORT nId = aObjBarList[n].nId; sal_Bool bDestroy = aObjBarList[n].bDestroy; - // die Modi bestimmen, f"ur die die ToolBox gilt + // Determine the vaild mode for the ToolBox USHORT nTbxMode = aObjBarList[n].nMode; - FASTBOOL bFullScreenTbx = SFX_VISIBILITY_FULLSCREEN == + bool bFullScreenTbx = SFX_VISIBILITY_FULLSCREEN == ( nTbxMode & SFX_VISIBILITY_FULLSCREEN ); nTbxMode &= ~SFX_VISIBILITY_FULLSCREEN; nTbxMode &= ~SFX_VISIBILITY_VIEWER; - // wird in diesem Kontext eine ToolBox gefordert? - FASTBOOL bModesMatching = ( nUpdateMode && ( nTbxMode & nUpdateMode) == nUpdateMode ); + // Is a ToolBox required in this context ? + bool bModesMatching = ( nUpdateMode && ( nTbxMode & nUpdateMode) == nUpdateMode ); if ( bDestroy ) { rtl::OUString aTbxId( m_aTbxTypeName ); @@ -1516,7 +1512,7 @@ void SfxWorkWindow::UpdateObjectBars_Impl() } else if ( nId != 0 ) { - // ggf. Toolbox an dieser Position l"oschen + // Delete the Toolbox at this Position if possible rtl::OUString aTbxId( m_aTbxTypeName ); aTbxId += GetResourceURLFromResId( aObjBarList[n].nId ); xLayoutManager->destroyElement( aTbxId ); @@ -1530,7 +1526,7 @@ void SfxWorkWindow::UpdateObjectBars_Impl() UpdateChildWindows_Impl(); - // SplitWindows wieder ent-locken + // Unlock the SplitWindows again for ( n=0; n<SFX_SPLITWINDOWS_MAX; n++ ) { SfxSplitWindow *p = pSplit[n]; @@ -1551,8 +1547,8 @@ bool SfxWorkWindow::AllowChildWindowCreation_Impl( const SfxChildWin_Impl& i_rCW void SfxWorkWindow::UpdateChildWindows_Impl() { - // alle vorhandenen oder in den Kontext gekommenen ChildWindows - for ( USHORT n=0; n<pChildWins->Count(); n++ ) + // any current or in the context available Childwindows + for ( USHORT n=0; n<pChildWins->Count(); n++ ) { SfxChildWin_Impl *pCW = (*pChildWins)[n]; SfxChildWindow *pChildWin = pCW->pWin; @@ -1574,7 +1570,7 @@ void SfxWorkWindow::UpdateChildWindows_Impl() } else if ( !IsDockingAllowed() || bIsFullScreen ) // || !bInternalDocking ) { - // im PresentationMode oder FullScreen nur FloatingWindows + // In Presentation mode or FullScreen only FloatingWindows SfxChildAlignment eAlign; if ( pCW->aInfo.GetExtraData_Impl( &eAlign ) ) bCreate = ( eAlign == SFX_ALIGN_NOALIGNMENT ); @@ -1598,7 +1594,7 @@ void SfxWorkWindow::UpdateChildWindows_Impl() } else if ( pChildWin ) { - // Fenster existiert schon; soll es auch sichtbar sein ? + // Window already exists, it should also be visible? if ( ( !bIsFullScreen || pChildWin->GetAlignment() == SFX_ALIGN_NOALIGNMENT ) && bAllChildsVisible ) { // Updatemode ist kompatibel; auf jeden Fall wieder einschalten @@ -1654,21 +1650,18 @@ void SfxWorkWindow::CreateChildWin_Impl( SfxChildWin_Impl *pCW, BOOL bSetFocus ) if ( bSetFocus ) bSetFocus = pChildWin->WantsFocus(); pChildWin->SetWorkWindow_Impl( this ); -#if 0 - // Enable-Status richtig setzen - pChildWin->GetWindow()->EnableInput( pCW->bEnable && - ( pWorkWin->IsInputEnabled() /* || pChildWin->GetAlignment() == SFX_ALIGN_NOALIGNMENT */ ) ); -#endif - // Zumindest der ExtraString wird beim Auswerten ver"andert, also neu holen + + // At least the extra string is changed during the evaluation, + // also get it anewed SfxChildWinInfo aInfo = pChildWin->GetInfo(); pCW->aInfo.aExtraString = aInfo.aExtraString; pCW->aInfo.bVisible = aInfo.bVisible; pCW->aInfo.nFlags |= aInfo.nFlags; - // Nein !! Sonst kann man keine Fenster defaultmaessig ausschalten ( Partwindow! ) -// pCW->aInfo.bVisible = TRUE; + // No! Otherwise, you could have disable any window stored (Partwindow!) +// pCW->aInfo.bVisible = TRUE; - // Erzeugung war erfolgreich + // The creation was successful GetBindings().Invalidate(pCW->nId); USHORT nPos = pChildWin->GetPosition(); @@ -1676,9 +1669,9 @@ void SfxWorkWindow::CreateChildWin_Impl( SfxChildWin_Impl *pCW, BOOL bSetFocus ) { DBG_ASSERT(nPos < SFX_OBJECTBAR_MAX, "Illegal objectbar position!"); if ((*pChilds)[TbxMatch(nPos)])// && -// pChildWin->GetAlignment() == (*pChilds)[nPos]->eAlign ) +// pChildWin->GetAlignment() == (*pChilds)[nPos]->eAlign ) { - // ChildWindow ersetzt ObjectBar + // ChildWindow replaces ObjectBar (*pChilds)[TbxMatch(nPos)]->nVisible ^= CHILD_NOT_HIDDEN; } } @@ -1690,9 +1683,8 @@ void SfxWorkWindow::CreateChildWin_Impl( SfxChildWin_Impl *pCW, BOOL bSetFocus ) if ( pChildWin->GetAlignment() == SFX_ALIGN_NOALIGNMENT || pChildWin->GetWindow()->GetParent() == pWorkWin) { - // Das Fenster ist entweder nicht angedockt oder au\serhalb - // eines SplitWindows angedockt und mu\s daher explizit als - // Child registriert werden + // The window is not docked or docked outside of one split windows + // and must therefore be registered explicitly as a Child pCW->pCli = RegisterChild_Impl(*(pChildWin->GetWindow()), pChildWin->GetAlignment(), pChildWin->CanGetFocus()); pCW->pCli->nVisible = CHILD_VISIBLE; if ( pChildWin->GetAlignment() != SFX_ALIGN_NOALIGNMENT && bIsFullScreen ) @@ -1701,17 +1693,15 @@ void SfxWorkWindow::CreateChildWin_Impl( SfxChildWin_Impl *pCW, BOOL bSetFocus ) } else { - // Ein angedocktes Fenster, dessen Parent nicht das WorkWindow ist, - // mu\s in einem SplitWindow liegen und daher nicht explizit - // registriert werden. - // Das passiert aber schon bei der Initialisierung des - // SfxDockingWindows! + // A docked window which parent is not a WorkingWindow, must lie + // in a SplitWindow and thus not be explicitly registered. + // This happens already in the initialization of SfxDockingWindows! } if ( pCW->nInterfaceId != pChildWin->GetContextId() ) pChildWin->CreateContext( pCW->nInterfaceId, GetBindings() ); - // Information in der INI-Datei sichern + // Save the information in the INI file SaveStatus_Impl(pChildWin, pCW->aInfo); } } @@ -1721,24 +1711,24 @@ void SfxWorkWindow::RemoveChildWin_Impl( SfxChildWin_Impl *pCW ) USHORT nId = pCW->nSaveId; SfxChildWindow *pChildWin = pCW->pWin; - // vorhandenes Fenster geht aus dem Kontext und wird daher entfernt + // existing window goes out of the context and is therefore removed USHORT nPos = pChildWin->GetPosition(); if (nPos != CHILDWIN_NOPOS) { /* - // ChildWindow "uberlagert einen ObjectBar + // ChildWindow overloads a ObjectBar DBG_ASSERT(nPos < SFX_OBJECTBAR_MAX, "Illegal objectbar position!"); if ((*pChilds)[TbxMatch(nPos)] && (aObjBars[nPos].nMode & nUpdateMode) ) //&& -// pChildWin->GetAlignment() == (*pChilds)[nPos]->eAlign ) +// pChildWin->GetAlignment() == (*pChilds)[nPos]->eAlign ) { - // ObjectBar war "uberlagert; jetzt wieder anzeigen + // ObjectBar was overloaded; now display it again (*pChilds)[TbxMatch(nPos)]->nVisible ^= CHILD_NOT_HIDDEN; } */ } - // Information in der INI-Datei sichern + // Save the information in the INI file USHORT nFlags = pCW->aInfo.nFlags; pCW->aInfo = pChildWin->GetInfo(); pCW->aInfo.nFlags |= nFlags; @@ -1748,15 +1738,15 @@ void SfxWorkWindow::RemoveChildWin_Impl( SfxChildWin_Impl *pCW ) if ( pCW->pCli ) { - // ChildWindow ist ein direktes ChildWindow und mu\s sich daher - // beim WorkWindow abmelden + // Child window is a direct child window and must therefore unregister + // itself from the WorkWindow pCW->pCli = 0; ReleaseChild_Impl(*pChildWin->GetWindow()); } else { - // ChildWindow liegt in einem SplitWindow und meldet sich - // selbst im dtor dort ab + // ChildWindow is within a SplitWindow and unregister itself in + // the destructor. } pWorkWin->GetSystemWindow()->GetTaskPaneList()->RemoveWindow( pChildWin->GetWindow() ); @@ -1798,7 +1788,8 @@ void SfxWorkWindow::SetTempStatusBar_Impl( BOOL bSet ) aStatBar.bTemp = bSet; if ( !bOn || bReset || (!bSet && aStatBar.nId ) ) { - // Nur was tun, wenn die Temp-Einstellung wirklich was bewirkt + // Just do something if the temp settings really are causing + // anything UpdateStatusBar_Impl(); ArrangeChilds_Impl(); ShowChilds_Impl(); @@ -1817,21 +1808,20 @@ void SfxWorkWindow::UpdateStatusBar_Impl() Any aValue = xPropSet->getPropertyValue( m_aLayoutManagerPropName ); aValue >>= xLayoutManager; - // keine Statusleiste, wenn keine Id gew"unscht oder bei FullScreenView - // oder wenn ausgeschaltet + // No status bar, if no ID is required or when in FullScreenView or + // if disabled if ( aStatBar.nId && IsDockingAllowed() && bInternalDockingAllowed && bShowStatusBar && ( (aStatBar.bOn && !bIsFullScreen) || aStatBar.bTemp ) ) { - // Id hat sich ge"andert, also passenden Statusbarmanager erzeugen, - // dieser "ubernimmt die aktuelle Statusleiste; + // Id has changed, thus create a suitable Statusbarmanager, this takes + // over the current status bar; if ( xLayoutManager.is() ) xLayoutManager->requestElement( m_aStatusBarResName ); } else { - // Aktuelle StatusBar vernichten - // Der Manager erzeugt die Statusleiste nur, er zerst"ort sie - // nicht ! + // Destroy the current StatusBar + // The Manager only creates the Status bar, does not destroy it. if ( xLayoutManager.is() ) xLayoutManager->destroyElement( m_aStatusBarResName ); } @@ -1997,14 +1987,14 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild, if ( nPos == USHRT_MAX ) return; -// SfxChild_Impl *pChild = (*pChilds)[nPos]; +// SfxChild_Impl *pChild = (*pChilds)[nPos]; Rectangle aOuterRect( GetTopRect_Impl() ); aOuterRect.SetPos( pWorkWin->OutputToScreenPixel( aOuterRect.TopLeft() )); Rectangle aInnerRect( aOuterRect ); BOOL bTbx = (eChild == SFX_CHILDWIN_OBJECTBAR); - // Das gerade betroffene Fenster wird bei der Berechnung des - // inneren Rechtecks mit eingeschlossen! + // The current affected window is included in the calculation of + // the inner rectangle! for ( USHORT m=0; m<aSortedList.Count(); ++m ) { USHORT i=aSortedList[m]; @@ -2015,93 +2005,93 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild, switch ( pCli->eAlign ) { case SFX_ALIGN_TOP: - // Objekt-Toolboxen kommen immer zuletzt + // Objekt-Toolboxes come always last //if ( bTbx || i <= nPos) aInnerRect.Top() += pCli->aSize.Height(); break; case SFX_ALIGN_TOOLBOXTOP: - // Toolbox geht nur vor, wenn nicht h"ohere Position + // Toolbox has priority, if no higher Position if ( bTbx && i <= nPos) aInnerRect.Top() += pCli->aSize.Height(); break; case SFX_ALIGN_HIGHESTTOP: - // Geht immer vor + // Always performed first aInnerRect.Top() += pCli->aSize.Height(); break; case SFX_ALIGN_LOWESTTOP: - // Wird nur mitgez"ahlt, wenn es das aktuelle Fenster ist + // Is only counted if it is the current window if ( i == nPos ) aInnerRect.Top() += pCli->aSize.Height(); break; case SFX_ALIGN_BOTTOM: - // Objekt-Toolboxen kommen immer zuletzt + // Objekt-Toolboxes come always last //if ( bTbx || i <= nPos) aInnerRect.Bottom() -= pCli->aSize.Height(); break; case SFX_ALIGN_TOOLBOXBOTTOM: - // Toolbox geht nur vor, wenn nicht h"ohere Position + // Toolbox has priority, if no higher Position if ( bTbx && i <= nPos) aInnerRect.Bottom() -= pCli->aSize.Height(); break; case SFX_ALIGN_LOWESTBOTTOM: - // Geht immer vor + // Always performed first aInnerRect.Bottom() -= pCli->aSize.Height(); break; case SFX_ALIGN_HIGHESTBOTTOM: - // Wird nur mitgez"ahlt, wenn es das aktuelle Fenster ist + // Is only counted if it is the current window if ( i == nPos ) aInnerRect.Bottom() -= pCli->aSize.Height(); break; case SFX_ALIGN_LEFT: - // Toolboxen kommen immer zuletzt + // Toolboxes come always last //if (bTbx || i <= nPos) aInnerRect.Left() += pCli->aSize.Width(); break; case SFX_ALIGN_TOOLBOXLEFT: - // Toolboxen kommen immer zuletzt + // Toolboxes come always last if (bTbx && i <= nPos) aInnerRect.Left() += pCli->aSize.Width(); break; case SFX_ALIGN_FIRSTLEFT: - // Geht immer vor + // Always performed first aInnerRect.Left() += pCli->aSize.Width(); break; case SFX_ALIGN_LASTLEFT: - // Wird nur mitgez"ahlt, wenn es das aktuelle Fenster ist + // Is only counted if it is the current window if (i == nPos) aInnerRect.Left() += pCli->aSize.Width(); case SFX_ALIGN_RIGHT: - // Toolboxen kommen immer zuletzt + // Toolboxes come always last //if (bTbx || i <= nPos) aInnerRect.Right() -= pCli->aSize.Width(); break; case SFX_ALIGN_TOOLBOXRIGHT: - // Toolboxen kommen immer zuletzt + // Toolboxes come always last if (bTbx && i <= nPos) aInnerRect.Right() -= pCli->aSize.Width(); break; case SFX_ALIGN_FIRSTRIGHT: - // Wird nur mitgez"ahlt, wenn es das aktuelle Fenster ist + // Is only counted if it is the current window if (i == nPos) aInnerRect.Right() -= pCli->aSize.Width(); break; case SFX_ALIGN_LASTRIGHT: - // Geht immer vor + // Always performed first aInnerRect.Right() -= pCli->aSize.Width(); break; @@ -2173,14 +2163,14 @@ void SfxWorkWindow::SetChildWindowVisible_Impl( sal_uInt32 lId, BOOL bEnabled, U SfxChildWin_Impl *pCW=NULL; SfxWorkWindow *pWork = pParent; - // Den obersten parent nehmen; ChildWindows werden immer am WorkWindow - // der Task bzw. des Frames oder am AppWorkWindow angemeldet + // Get the top parent, child windows are alwas registered at the + // task of the WorkWindow for example the frame or on AppWorkWindow while ( pWork && pWork->pParent ) pWork = pWork->pParent; if ( pWork ) { - // Dem Parent schon bekannt ? + // The Parent already known? USHORT nCount = pWork->pChildWins->Count(); for (USHORT n=0; n<nCount; n++) if ((*pWork->pChildWins)[n]->nSaveId == nId) @@ -2192,7 +2182,7 @@ void SfxWorkWindow::SetChildWindowVisible_Impl( sal_uInt32 lId, BOOL bEnabled, U if ( !pCW ) { - // Kein Parent oder dem Parent noch unbekannt, dann bei mir suchen + // If no Parent or the Parent us still unknown, then search here USHORT nCount = pChildWins->Count(); for (USHORT n=0; n<nCount; n++) if ((*pChildWins)[n]->nSaveId == nId) @@ -2204,8 +2194,8 @@ void SfxWorkWindow::SetChildWindowVisible_Impl( sal_uInt32 lId, BOOL bEnabled, U if ( !pCW ) { - // Ist neu, also initialisieren; je nach Flag beim Parent oder bei - // mir eintragen + // If new, then initialize, add this here depending on the flag or + // the Parent pCW = new SfxChildWin_Impl( lId ); pCW->nId = nId; InitializeChild_Impl( pCW ); @@ -2220,16 +2210,11 @@ void SfxWorkWindow::SetChildWindowVisible_Impl( sal_uInt32 lId, BOOL bEnabled, U pCW->nInterfaceId = nInter; pCW->nVisibility = nMode; pCW->bEnable = bEnabled; -#if 0 - if ( pCW->pWin ) - pCW->pWin->GetWindow()->EnableInput( bEnabled && - ( pWorkWin->IsInputEnabled() /* || pCW->pWin->GetAlignment() == SFX_ALIGN_NOALIGNMENT */ ) ); -#endif pCW->nVisibility = nMode; } //-------------------------------------------------------------------- -// Der An/Aus-Status eines ChildWindows wird umgeschaltet. +// The on/of-Status of a ChildWindows is switched void SfxWorkWindow::ToggleChildWindow_Impl(USHORT nId, BOOL bSetFocus) { @@ -2241,7 +2226,7 @@ void SfxWorkWindow::ToggleChildWindow_Impl(USHORT nId, BOOL bSetFocus) if ( n<nCount ) { - // Das Fenster ist schon bekannt + // The Window is aleady known SfxChildWin_Impl *pCW = (*pChildWins)[n]; SfxChildWindow *pChild = pCW->pWin; @@ -2331,11 +2316,11 @@ void SfxWorkWindow::ToggleChildWindow_Impl(USHORT nId, BOOL bSetFocus) if ( n < nCount ) { - DBG_ERROR("ChildWindow ist nicht im Kontext!"); + DBG_ERROR("The ChildWindow is not in context!"); } else { - DBG_ERROR("ChildWindow ist nicht registriert!"); + DBG_ERROR("The ChildWindow is not registered!"); } #endif } @@ -2368,14 +2353,14 @@ BOOL SfxWorkWindow::IsFloating( USHORT nId ) SfxChildWin_Impl *pCW=NULL; SfxWorkWindow *pWork = pParent; - // Den obersten parent nehmen; ChildWindows werden immer am WorkWindow - // der Task bzw. des Frames oder am AppWorkWindow angemeldet + // Get the top parent, child windows are alwas registered at the + // task of the WorkWindow for example the frame or on AppWorkWindow while ( pWork && pWork->pParent ) pWork = pWork->pParent; if ( pWork ) { - // Dem Parent schon bekannt ? + // The Parent already known? USHORT nCount = pWork->pChildWins->Count(); for (USHORT n=0; n<nCount; n++) if ((*pWork->pChildWins)[n]->nSaveId == nId) @@ -2387,7 +2372,7 @@ BOOL SfxWorkWindow::IsFloating( USHORT nId ) if ( !pCW ) { - // Kein Parent oder dem Parent noch unbekannt, dann bei mir suchen + // If no Parent or the Parent us still unknown, then search here USHORT nCount = pChildWins->Count(); for (USHORT n=0; n<nCount; n++) if ((*pChildWins)[n]->nSaveId == nId) @@ -2399,8 +2384,8 @@ BOOL SfxWorkWindow::IsFloating( USHORT nId ) if ( !pCW ) { - // Ist neu, also initialisieren; je nach Flag beim Parent oder bei - // mir eintragen + // If new, then initialize, add this here depending on the flag or + // the Parent pCW = new SfxChildWin_Impl( nId ); pCW->bEnable = FALSE; pCW->nId = 0; @@ -2452,14 +2437,14 @@ void SfxWorkWindow::SetChildWindow_Impl(USHORT nId, BOOL bOn, BOOL bSetFocus) SfxChildWin_Impl *pCW=NULL; SfxWorkWindow *pWork = pParent; - // Den obersten parent nehmen; ChildWindows werden immer am WorkWindow - // der Task bzw. des Frames oder am AppWorkWindow angemeldet + // Get the top parent, child windows are alwas registered at the + // task of the WorkWindow for example the frame or on AppWorkWindow while ( pWork && pWork->pParent ) pWork = pWork->pParent; if ( pWork ) { - // Dem Parent schon bekannt ? + // The Parent already known? USHORT nCount = pWork->pChildWins->Count(); for (USHORT n=0; n<nCount; n++) if ((*pWork->pChildWins)[n]->nSaveId == nId) @@ -2471,7 +2456,7 @@ void SfxWorkWindow::SetChildWindow_Impl(USHORT nId, BOOL bOn, BOOL bSetFocus) if ( !pCW ) { - // Kein Parent oder dem Parent noch unbekannt, dann bei mir suchen + // If no Parent or the Parent us still unknown, then search here USHORT nCount = pChildWins->Count(); for (USHORT n=0; n<nCount; n++) if ((*pChildWins)[n]->nSaveId == nId) @@ -2484,8 +2469,8 @@ void SfxWorkWindow::SetChildWindow_Impl(USHORT nId, BOOL bOn, BOOL bSetFocus) if ( !pCW ) { - // Ist neu, also initialisieren; je nach Flag beim Parent oder bei - // mir eintragen + // If new, then initialize, add this here depending on the flag or + // the Parent pCW = new SfxChildWin_Impl( nId ); InitializeChild_Impl( pCW ); if ( !pWork || pCW->aInfo.nFlags & SFX_CHILDWIN_TASK ) @@ -2576,11 +2561,11 @@ void SfxWorkWindow::ShowChildWindow_Impl(USHORT nId, BOOL bVisible, BOOL bSetFoc if ( n<nCount ) { - DBG_ERROR("ChildWindow ist nicht im Kontext!"); + DBG_ERROR("The ChildWindow is not in context!"); } else { - DBG_ERROR("ChildWindow ist nicht registriert!"); + DBG_ERROR("The ChildWindow is not registered"); } #endif } @@ -2606,8 +2591,8 @@ SfxChildWindow* SfxWorkWindow::GetChildWindow_Impl(USHORT nId) void SfxWorkWindow::ResetChildWindows_Impl() { -// if ( pParent ) -// pParent->ResetChildWindows_Impl(); +// if ( pParent ) +// pParent->ResetChildWindows_Impl(); for ( USHORT n = 0; n < pChildWins->Count(); ++n ) { @@ -2617,9 +2602,8 @@ void SfxWorkWindow::ResetChildWindows_Impl() } //------------------------------------------------------------------------ -// Virtuelle Methode, die die Gr"o\se der Fl"ache (client area) des parent -// windows liefert, in der Child-Fenster angeordnet werden k"onnen. -// in der ClientArea des parent findet. +// Virtual method that returns the size of the area (client area) of the +// parent windows, in which the ChildWindow can be fitted. Rectangle SfxWorkWindow::GetTopRect_Impl() { @@ -2627,9 +2611,8 @@ Rectangle SfxWorkWindow::GetTopRect_Impl() } //------------------------------------------------------------------------ -// Virtuelle Methode, die die Gr"o\se der Fl"ache (client area) des parent -// windows liefert, in der Child-Fenster angeordnet werden k"onnen. -// in der ClientArea des parent findet. +// Virtual method that returns the size of the area (client area) of the +// parent windows, in which the ChildWindow can be fitted. Rectangle SfxFrameWorkWin_Impl::GetTopRect_Impl() { @@ -2637,8 +2620,8 @@ Rectangle SfxFrameWorkWin_Impl::GetTopRect_Impl() } //------------------------------------------------------------------------ -// Virtuelle Methode, um herauszufinden, ob ein Child-Fenster noch Platz -// in der ClientArea des parent findet. +// Virtual method to find out if there is room for a ChildWindow in the +// client area of the parent. BOOL SfxWorkWindow::RequestTopToolSpacePixel_Impl( SvBorder aBorder ) { @@ -2652,7 +2635,7 @@ BOOL SfxWorkWindow::RequestTopToolSpacePixel_Impl( SvBorder aBorder ) void SfxWorkWindow::SaveStatus_Impl(SfxChildWindow *pChild, const SfxChildWinInfo &rInfo) { - // Den Status vom Presentation mode wollen wir nicht sichern + // The Status of the Presentation mode is not saved if ( IsDockingAllowed() && bInternalDockingAllowed ) pChild->SaveStatus(rInfo); } @@ -2815,11 +2798,10 @@ void SfxWorkWindow::ArrangeAutoHideWindows( SfxSplitWindow *pActSplitWin ) Rectangle aArea( aUpperClientArea ); for ( USHORT n=0; n<SFX_SPLITWINDOWS_MAX; n++ ) { - // Es werden entweder Dummyfenster oder Fenster im AutoShow-Modus - // ( nicht gepinned, FadeIn ) behandelt. - // Nur das "ubergebene Fenster darf unsichtbar sein, denn vielleicht - // soll daf"ur gerade die Gr"o\se berechnet werden, bevor es angezeigt - // wird. + // Either dummy window or window in the auto-show-mode are processed + // (not pinned, FadeIn). + // Only the abandoned window may be invisible, because perhaps its + // size is just beeing calculated before it is displayed. SfxSplitWindow* pSplitWin = pSplit[n]; BOOL bDummyWindow = !pSplitWin->IsFadeIn(); Window *pDummy = pSplitWin->GetSplitWindow(); @@ -2827,7 +2809,7 @@ void SfxWorkWindow::ArrangeAutoHideWindows( SfxSplitWindow *pActSplitWin ) if ( (pSplitWin->IsPinned() && !bDummyWindow) || (!pWin->IsVisible() && pActSplitWin != pSplitWin) ) continue; - // Breite und Position des Dummy-Fensters als Ausgangspunkt + // Width and position of the dummy window as a starting point Size aSize = pDummy->GetSizePixel(); Point aPos = pDummy->GetPosPixel(); @@ -2835,13 +2817,13 @@ void SfxWorkWindow::ArrangeAutoHideWindows( SfxSplitWindow *pActSplitWin ) { case ( 0 ) : { - // Linkes SplitWindow - // Breite vom Fenster selbst holen, wenn nicht das DummyWindow + // Left SplitWindow + // Get the width of the Window yourself, if no DummyWindow if ( !bDummyWindow ) aSize.Width() = pSplitWin->GetSizePixel().Width(); - // Wenn links ein Window sichtbar ist, beginnt der freie - // Bereich rechts davon bzw. bei der Client area + // If a Window is visable to the left, then the free region + // starts to the right from it, for example at the Client area long nLeft = aPos.X() + aSize.Width(); if ( nLeft > aArea.Left() ) aArea.Left() = nLeft; @@ -2849,26 +2831,26 @@ void SfxWorkWindow::ArrangeAutoHideWindows( SfxSplitWindow *pActSplitWin ) } case ( 1 ) : { - // Rechtes SplitWindow - // Position um Differenz der Breiten korrigieren + // Right SplitWindow + // Position to correct the difference of the widths aPos.X() += aSize.Width(); - // Breite vom Fenster selbst holen, wenn nicht das DummyWindow + // Get the width of the Window yourself, if no DummyWindow if ( !bDummyWindow ) aSize.Width() = pSplitWin->GetSizePixel().Width(); aPos.X() -= aSize.Width(); - // Wenn links schon ein Fenster aufgeklappt ist, darf - // das rechte nicht dar"uber gehen + // If already a window is opened at the left side, then the + // right is not allowed to overlap this one. if ( aPos.X() < aArea.Left() ) { aPos.X() = aArea.Left(); aSize.Width() = aArea.GetWidth(); } - // Wenn rechts ein Window sichtbar ist, endet der freie - // Bereich links davon bzw. bei der Client area + // If a Window is visable to the right, then the free region + // starts to the left from it, for example at the Client area long nRight = aPos.X(); if ( nRight < aArea.Right() ) aArea.Right() = nRight; @@ -2876,18 +2858,19 @@ void SfxWorkWindow::ArrangeAutoHideWindows( SfxSplitWindow *pActSplitWin ) } case ( 2 ) : { - // Oberes SplitWindow - // H"ohe vom Fenster selbst holen, wenn nicht das DummyWindow + // Top SplitWindow + // Get the height of the Window yourself, if no DummyWindow if ( !bDummyWindow ) aSize.Height() = pSplitWin->GetSizePixel().Height(); - // Breite anpassen, je nachdem ob links oder rechts - // schon ein Fenster aufgeklappt ist + + // Adjust width with regard to if a Window is already open + // to the left or right aPos.X() = aArea.Left(); aSize.Width() = aArea.GetWidth(); - // Wenn oben ein Window sichtbar ist, beginnt der freie - // Bereich darunter bzw. bei der Client Area + // If a Window is visable at the top, then the free region + // starts beneath it, for example at the Client area long nTop = aPos.Y() + aSize.Height(); if ( nTop > aArea.Top() ) aArea.Top() = nTop; @@ -2895,23 +2878,23 @@ void SfxWorkWindow::ArrangeAutoHideWindows( SfxSplitWindow *pActSplitWin ) } case ( 3 ) : { - // Das untere SplitWindow - // Position um Differenz der H"ohen korrigieren + // The bottom SplitWindow + // Position to correct the difference of the heights aPos.Y() += aSize.Height(); - // H"ohe vom Fenster selbst holen, wenn nicht das DummmyWindow + // Get the height of the Window yourself, if no DummyWindow if ( !bDummyWindow ) aSize.Height() = pSplitWin->GetSizePixel().Height(); aPos.Y() -= aSize.Height(); - // Breite anpassen, je nachdem ob links oder rechts - // schon ein Fenster aufgeklappt ist + // Adjust width with regard to if a Window is already open + // to the left or right. aPos.X() = aArea.Left(); aSize.Width() = aArea.GetWidth(); - // Wenn oben schon ein Fenster aufgeklappt ist, darf - // das untere nicht dar"uber gehen + // If already a window is opened at the top, then the + // bottom one is not allowed to overlap this one. if ( aPos.Y() < aArea.Top() ) { aPos.Y() = aArea.Top(); @@ -2923,11 +2906,11 @@ void SfxWorkWindow::ArrangeAutoHideWindows( SfxSplitWindow *pActSplitWin ) } if ( !bDummyWindow ) - // Das FadeIn-Window ist ein Float, dessen Koordinaten in - // Screenkoordinaten gesetzt werden + // the FadeIn-Window is a Floating window, which coordinates are + // set in Screen coordinates. pSplitWin->SetPosSizePixel( pWorkWin->OutputToScreenPixel(aPos), aSize ); else - // Das angedockte DummyWindow + // the docked DummyWindow pDummy->SetPosSizePixel( aPos, aSize ); } } @@ -3003,14 +2986,14 @@ void SfxWorkWindow::SetActiveChild_Impl( Window *pChild ) pActiveChild = pChild; } -Window* SfxWorkWindow::GetActiveChild_Impl() +Window* SfxWorkWindow::GetActiveChild_Impl() { return pActiveChild; } BOOL SfxWorkWindow::ActivateNextChild_Impl( BOOL bForward ) { - // Alle Kinder gem"a\s Liste sortieren + // Sort all children under list SvUShorts aList; for ( USHORT i=SFX_OBJECTBAR_MAX; i<pChilds->Count(); i++) { @@ -3040,7 +3023,7 @@ BOOL SfxWorkWindow::ActivateNextChild_Impl( BOOL bForward ) SfxChild_Impl *pAct=NULL; if ( pActiveChild ) { - // Das aktive Fenster suchen + // Look for the active window for ( n=0; n<aList.Count(); n++ ) { SfxChild_Impl* pCli = (*pChilds)[aList[n]]; @@ -3060,7 +3043,7 @@ BOOL SfxWorkWindow::ActivateNextChild_Impl( BOOL bForward ) { for ( USHORT i=0; i<SFX_SPLITWINDOWS_MAX; i++ ) { - // Eventuell ist pAct ein Splitwindow + // Maybe the pNext is a Splitwindow SfxSplitWindow *p = pSplit[i]; if ( pAct->pWin == p ) { @@ -3070,8 +3053,8 @@ BOOL SfxWorkWindow::ActivateNextChild_Impl( BOOL bForward ) } } - // pAct ist ein direktes ChildWindow - // mit dem Nachfolger bzw. Vorg"anger des aktiven Fensters weitermachen + // pAct is a direct ChildWindow + // continue with the successor or predecessor of the active window if ( bForward ) n = n+1; else @@ -3089,11 +3072,11 @@ BOOL SfxWorkWindow::ActivateNextChild_Impl( BOOL bForward ) SfxChild_Impl* pNext = pCli; for ( USHORT i=0; n<SFX_SPLITWINDOWS_MAX; n++ ) { - // Eventuell ist pNext ein Splitwindow + // Maybe the pNext is a Splitwindow SfxSplitWindow *p = pSplit[i]; if ( pNext->pWin == p ) { - // Das erste/letzte Fenster dort aktivieren + // Activate the first/last window p->SetActiveWindow_Impl( NULL ); pNext = NULL; if( p->ActivateNextChild_Impl( bForward ) ) @@ -3140,3 +3123,4 @@ void SfxWorkWindow::DataChanged_Impl( const DataChangedEvent& ) ArrangeChilds_Impl(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/xpackcreator.cxx b/sfx2/source/appl/xpackcreator.cxx index 52798f01f5..863c7786e1 100644 --- a/sfx2/source/appl/xpackcreator.cxx +++ b/sfx2/source/appl/xpackcreator.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -47,15 +48,15 @@ using namespace ::com::sun::star; uno::Sequence< ::rtl::OUString > SAL_CALL OPackageStructureCreator::impl_getStaticSupportedServiceNames() { uno::Sequence< ::rtl::OUString > aRet(2); - aRet[0] = ::rtl::OUString::createFromAscii("com.sun.star.embed.PackageStructureCreator"); - aRet[1] = ::rtl::OUString::createFromAscii("com.sun.star.comp.embed.PackageStructureCreator"); + aRet[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.PackageStructureCreator")); + aRet[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.embed.PackageStructureCreator")); return aRet; } //------------------------------------------------------------------------- ::rtl::OUString SAL_CALL OPackageStructureCreator::impl_getStaticImplementationName() { - return ::rtl::OUString::createFromAscii("com.sun.star.comp.embed.PackageStructureCreator"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.embed.PackageStructureCreator")); } //------------------------------------------------------------------------- @@ -200,3 +201,4 @@ uno::Sequence< ::rtl::OUString > SAL_CALL OPackageStructureCreator::getSupported return impl_getStaticSupportedServiceNames(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/xpackcreator.hxx b/sfx2/source/appl/xpackcreator.hxx index ea8bcc647d..1631d2eada 100644 --- a/sfx2/source/appl/xpackcreator.hxx +++ b/sfx2/source/appl/xpackcreator.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -73,3 +74,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/bastyp/bastyp.hrc b/sfx2/source/bastyp/bastyp.hrc index 36e304715b..decf21c326 100644 --- a/sfx2/source/bastyp/bastyp.hrc +++ b/sfx2/source/bastyp/bastyp.hrc @@ -27,12 +27,12 @@ #include <sfx2/sfx.hrc> -//fuer das Mapping Fehlercode -> ResId +//for the mapping error code -> ResId -#define RC_BASTYP RID_SFX_BASTYP_START -#define STR_FILTER_NOT_INSTALLED (RC_BASTYP + 9) -#define STR_FILTER_CONSULT_SERVICE (RC_BASTYP + 10) -#define STR_MEMEXCEPTION (RC_BASTYP + 28) -#define MSG_MEM_WARN (RC_BASTYP + 29) -#define STR_HTML_GENERATOR (RC_BASTYP + 30) +#define RC_BASTYP RID_SFX_BASTYP_START +#define STR_FILTER_NOT_INSTALLED (RC_BASTYP + 9) +#define STR_FILTER_CONSULT_SERVICE (RC_BASTYP + 10) +#define STR_MEMEXCEPTION (RC_BASTYP + 28) +#define MSG_MEM_WARN (RC_BASTYP + 29) +#define STR_HTML_GENERATOR (RC_BASTYP + 30) diff --git a/sfx2/source/bastyp/bitset.cxx b/sfx2/source/bastyp/bitset.cxx index f304291eaa..7c3aec2489 100644 --- a/sfx2/source/bastyp/bitset.cxx +++ b/sfx2/source/bastyp/bitset.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,8 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" #include <tools/debug.hxx> -#ifndef GCC -#endif #include "bitset.hxx" @@ -393,3 +392,4 @@ USHORT IndexBitSet::GetFreeIndex() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx index a739230d53..6d953aae8c 100644 --- a/sfx2/source/bastyp/fltfnc.cxx +++ b/sfx2/source/bastyp/fltfnc.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -40,9 +41,7 @@ #include <comphelper/sequenceashashmap.hxx> -#ifndef _EXCHANGE_HXX //autogen #include <sot/exchange.hxx> -#endif #include <tools/config.hxx> #include <basic/sbmeth.hxx> #include <basic/basmgr.hxx> @@ -50,12 +49,8 @@ #include <basic/sbxobj.hxx> #include <basic/sbxmeth.hxx> #include <basic/sbxcore.hxx> -#ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> -#endif -#ifndef _RTL_USTRING_HXX //autogen #include <rtl/ustring.hxx> -#endif #include <rtl/ustrbuf.hxx> #include <svl/eitem.hxx> #include <svl/intitem.hxx> @@ -84,9 +79,7 @@ #include <com/sun/star/frame/XFilterDetect.hpp> #include <com/sun/star/loader/XImplementationLoader.hpp> #include <com/sun/star/loader/CannotActivateFactoryException.hpp> -#ifndef _UNOTOOLS_PROCESSFACTORY_HXX #include <comphelper/processfactory.hxx> -#endif #include <com/sun/star/beans/PropertyValue.hpp> #include <sal/types.h> @@ -241,10 +234,9 @@ const SfxFilter* SfxFilterContainer::GetDefaultFilter_Impl( const String& rName if ( bFirstRead ) ReadFilters_Impl(); - sal_uInt16 nCount = ( sal_uInt16 ) pFilterArr->Count(); - for( sal_uInt16 n = 0; n < nCount; n++ ) + for ( size_t i = 0, n = pFilterArr->size(); i < n; ++i ) { - const SfxFilter* pCheckFilter = pFilterArr->GetObject( n ); + const SfxFilter* pCheckFilter = pFilterArr->at( i ); if ( pCheckFilter->GetServiceName().CompareIgnoreCaseToAscii( sServiceName ) == COMPARE_EQUAL ) { pFilter = pCheckFilter; @@ -322,12 +314,12 @@ void SfxFilterMatcher_Impl::Update() if ( pList ) { // this List was already used - pList->Clear(); - for ( USHORT n=0; n<pFilterArr->Count(); n++ ) + pList->clear(); + for ( size_t i = 0, n = pFilterArr->size(); i < n; ++i ) { - SfxFilter* pFilter = pFilterArr->GetObject(n); + SfxFilter* pFilter = pFilterArr->at( i ); if ( pFilter->GetServiceName() == String(aName) ) - pList->Insert( pFilter, LIST_APPEND ); + pList->push_back( pFilter ); } } } @@ -357,10 +349,9 @@ void SfxFilterMatcher_Impl::InitForIterating() const const SfxFilter* SfxFilterMatcher::GetAnyFilter( SfxFilterFlags nMust, SfxFilterFlags nDont ) const { pImpl->InitForIterating(); - sal_uInt16 nCount = ( sal_uInt16 ) pImpl->pList->Count(); - for( sal_uInt16 n = 0; n < nCount; n++ ) + for ( size_t i = 0, n = pImpl->pList->size(); i < n; ++i ) { - const SfxFilter* pFilter = pImpl->pList->GetObject( n ); + const SfxFilter* pFilter = pImpl->pList->at( i ); SfxFilterFlags nFlags = pFilter->GetFilterFlags(); if ( (nFlags & nMust) == nMust && !(nFlags & nDont ) ) return pFilter; @@ -374,10 +365,10 @@ const SfxFilter* SfxFilterMatcher::GetAnyFilter( SfxFilterFlags nMust, SfxFilter sal_uInt32 SfxFilterMatcher::GuessFilterIgnoringContent( SfxMedium& rMedium, const SfxFilter**ppFilter, - SfxFilterFlags /*nMust*/, - SfxFilterFlags /*nDont*/ ) const + SfxFilterFlags nMust, + SfxFilterFlags nDont ) const { - Reference< XTypeDetection > xDetection( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.document.TypeDetection")), UNO_QUERY ); + Reference< XTypeDetection > xDetection( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.TypeDetection"))), UNO_QUERY ); ::rtl::OUString sTypeName; try { @@ -390,7 +381,11 @@ sal_uInt32 SfxFilterMatcher::GuessFilterIgnoringContent( *ppFilter = NULL; if ( sTypeName.getLength() ) - *ppFilter = GetFilter4EA( sTypeName ); + { + // make sure filter list is initialized + pImpl->InitForIterating(); + *ppFilter = GetFilter4EA( sTypeName, nMust, nDont ); + } return *ppFilter ? ERRCODE_NONE : ERRCODE_ABORT; } @@ -425,7 +420,7 @@ sal_uInt32 SfxFilterMatcher::GuessFilterControlDefaultUI( SfxMedium& rMedium, c const SfxFilter* pOldFilter = *ppFilter; // no detection service -> nothing to do ! - Reference< XTypeDetection > xDetection( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.document.TypeDetection")), UNO_QUERY ); + Reference< XTypeDetection > xDetection( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.TypeDetection"))), UNO_QUERY ); if (!xDetection.is()) return ERRCODE_ABORT; @@ -471,7 +466,7 @@ sal_uInt32 SfxFilterMatcher::GuessFilterControlDefaultUI( SfxMedium& rMedium, c // The DocumentService property is only a preselection, and all preselections are considered as optional! // This "wrong" type will be sorted out now because we match only allowed filters to the detected type ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > lQuery(1); - lQuery[0].Name = ::rtl::OUString::createFromAscii("Name"); + lQuery[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name")); lQuery[0].Value <<= sTypeName; const SfxFilter* pFilter = GetFilterForProps(lQuery, nMust, nDont); @@ -493,7 +488,7 @@ sal_Bool SfxFilterMatcher::IsFilterInstalled_Impl( const SfxFilter* pFilter ) { if ( pFilter->GetFilterFlags() & SFX_FILTER_MUSTINSTALL ) { - // Hier k"onnte noch eine Nachinstallation angeboten werden + // Here could a re-installation be offered String aText( SfxResId( STR_FILTER_NOT_INSTALLED ) ); aText.SearchAndReplaceAscii( "$(FILTER)", pFilter->GetUIName() ); QueryBox aQuery( NULL, WB_YES_NO | WB_DEF_YES, aText ); @@ -501,11 +496,11 @@ sal_Bool SfxFilterMatcher::IsFilterInstalled_Impl( const SfxFilter* pFilter ) if ( nRet == RET_YES ) { #ifdef DBG_UTIL - // Setup starten - InfoBox( NULL, DEFINE_CONST_UNICODE("Hier soll jetzt das Setup starten!") ).Execute(); + // Start Setup + InfoBox( NULL, DEFINE_CONST_UNICODE("Here should the Setup now be starting!") ).Execute(); #endif - // Installation mu\s hier noch mitteilen, ob es geklappt hat, dann kann das - // Filterflag gel"oscht werden + // Installation must still give feedback if it worked or not, + // then the Filterflag be deleted } return ( !(pFilter->GetFilterFlags() & SFX_FILTER_MUSTINSTALL) ); @@ -523,9 +518,9 @@ sal_Bool SfxFilterMatcher::IsFilterInstalled_Impl( const SfxFilter* pFilter ) sal_uInt32 SfxFilterMatcher::DetectFilter( SfxMedium& rMedium, const SfxFilter**ppFilter, sal_Bool /*bPlugIn*/, sal_Bool bAPI ) const -/* [Beschreibung] +/* [Description] - Hier wird noch die Filterauswahlbox hochgezogen. Sonst GuessFilter + Here the Filter selection box is pulled up. Otherwise GuessFilter */ { @@ -564,17 +559,18 @@ sal_uInt32 SfxFilterMatcher::DetectFilter( SfxMedium& rMedium, const SfxFilter** { const SfxFilter* pInstallFilter = NULL; - // Jetzt auch Filter testen, die nicht installiert sind ( ErrCode ist irrelevant ) + // Now test the filter which are not installed (ErrCode is irrelevant) GuessFilter( rMedium, &pInstallFilter, SFX_FILTER_IMPORT, SFX_FILTER_CONSULTSERVICE ); if ( pInstallFilter ) { if ( IsFilterInstalled_Impl( pInstallFilter ) ) - // Eventuell wurde der Filter nachinstalliert + // Maybe the filter was installed was installed afterwards. pFilter = pInstallFilter; } else { - // Jetzt auch Filter testen, die erst von Star bezogen werden m"ussen ( ErrCode ist irrelevant ) + // Now test the filter, which first must be obtained by Star + // (ErrCode is irrelevant) GuessFilter( rMedium, &pInstallFilter, SFX_FILTER_IMPORT, 0 ); if ( pInstallFilter ) IsFilterInstalled_Impl( pInstallFilter ); @@ -590,37 +586,7 @@ sal_uInt32 SfxFilterMatcher::DetectFilter( SfxMedium& rMedium, const SfxFilter** if( STRING_NOTFOUND != aFlags.Search( 'H' ) ) bHidden = sal_True; } -/* - if ( ( !pFilter || nErr == ERRCODE_SFX_CONSULTUSER ) && !bAPI && !bHidden ) - { - if ( !pFilter ) - pFilter = pOldFilter; - String aTmpName; - if ( pFilter ) - aTmpName = pFilter->GetUIName(); - - SfxFilterMatcher *pMatcher; - if( bPlugIn && pFilter ) - pMatcher = new SfxFilterMatcher( (SfxFilterContainer *) pFilter->GetFilterContainer() ); - else - pMatcher = (SfxFilterMatcher*) this; - - SfxFilterDialog *pDlg = new SfxFilterDialog( 0, &rMedium, *pMatcher, pFilter ? &aTmpName: 0, 0 ); - const sal_Bool bOk = RET_OK == pDlg->Execute(); - if (bOk) - pFilter = pMatcher->GetFilter4UIName( pDlg->GetSelectEntry()); - - if( bPlugIn && pFilter ) - delete pMatcher; - delete pDlg; - - if ( !bOk) - nErr = ERRCODE_ABORT; - else - nErr = ERRCODE_NONE; - } -*/ *ppFilter = pFilter; if ( bHidden || (bAPI && nErr == ERRCODE_SFX_CONSULTUSER) ) @@ -644,7 +610,7 @@ const SfxFilter* SfxFilterMatcher::GetFilterForProps( const com::sun::star::uno: ::rtl::OUString aValue; // try to get the preferred filter (works without loading all filters!) - if ( (aProps[::rtl::OUString::createFromAscii("PreferredFilter")] >>= aValue) && aValue.getLength() ) + if ( (aProps[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PreferredFilter"))] >>= aValue) && aValue.getLength() ) { const SfxFilter* pFilter = SfxFilter::GetFilterByName( aValue ); if ( !pFilter || (pFilter->GetFilterFlags() & nMust) != nMust || (pFilter->GetFilterFlags() & nDont ) ) @@ -660,7 +626,7 @@ const SfxFilter* SfxFilterMatcher::GetFilterForProps( const com::sun::star::uno: { // preferred filter belongs to another document type; now we must search the filter pImpl->InitForIterating(); - aProps[::rtl::OUString::createFromAscii("Name")] >>= aValue; + aProps[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name"))] >>= aValue; pFilter = GetFilter4EA( aValue, nMust, nDont ); if ( pFilter ) return pFilter; @@ -681,10 +647,9 @@ const SfxFilter* SfxFilterMatcher::GetFilter4Mime( const String& rMediaType,SfxF { if ( pImpl->pList ) { - sal_uInt16 nCount = ( sal_uInt16 ) pImpl->pList->Count(); - for( sal_uInt16 n = 0; n < nCount; n++ ) + for ( size_t i = 0, n = pImpl->pList->size(); i < n; ++i ) { - const SfxFilter* pFilter = pImpl->pList->GetObject( n ); + const SfxFilter* pFilter = pImpl->pList->at( i ); SfxFilterFlags nFlags = pFilter->GetFilterFlags(); if ( (nFlags & nMust) == nMust && !(nFlags & nDont ) && pFilter->GetMimeType() == rMediaType ) return pFilter; @@ -694,7 +659,7 @@ const SfxFilter* SfxFilterMatcher::GetFilter4Mime( const String& rMediaType,SfxF } com::sun::star::uno::Sequence < com::sun::star::beans::NamedValue > aSeq(1); - aSeq[0].Name = ::rtl::OUString::createFromAscii("MediaType"); + aSeq[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")); aSeq[0].Value <<= ::rtl::OUString( rMediaType ); return GetFilterForProps( aSeq, nMust, nDont ); } @@ -703,11 +668,10 @@ const SfxFilter* SfxFilterMatcher::GetFilter4EA( const String& rType,SfxFilterFl { if ( pImpl->pList ) { - sal_uInt16 nCount = ( sal_uInt16 ) pImpl->pList->Count(); const SfxFilter* pFirst = 0; - for( sal_uInt16 n = 0; n < nCount; n++ ) + for ( size_t i = 0, n = pImpl->pList->size(); i < n; ++i ) { - const SfxFilter* pFilter = pImpl->pList->GetObject( n ); + const SfxFilter* pFilter = pImpl->pList->at( i ); SfxFilterFlags nFlags = pFilter->GetFilterFlags(); if ( (nFlags & nMust) == nMust && !(nFlags & nDont ) && pFilter->GetTypeName() == rType ) { @@ -724,7 +688,7 @@ const SfxFilter* SfxFilterMatcher::GetFilter4EA( const String& rType,SfxFilterFl } com::sun::star::uno::Sequence < com::sun::star::beans::NamedValue > aSeq(1); - aSeq[0].Name = ::rtl::OUString::createFromAscii("Name"); + aSeq[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name")); aSeq[0].Value <<= ::rtl::OUString( rType ); return GetFilterForProps( aSeq, nMust, nDont ); } @@ -733,10 +697,9 @@ const SfxFilter* SfxFilterMatcher::GetFilter4Extension( const String& rExt, SfxF { if ( pImpl->pList ) { - sal_uInt16 nCount = ( sal_uInt16 ) pImpl->pList->Count(); - for( sal_uInt16 n = 0; n < nCount; n++ ) + for ( size_t i = 0, n = pImpl->pList->size(); i < n; ++i ) { - const SfxFilter* pFilter = pImpl->pList->GetObject( n ); + const SfxFilter* pFilter = pImpl->pList->at( i ); SfxFilterFlags nFlags = pFilter->GetFilterFlags(); if ( (nFlags & nMust) == nMust && !(nFlags & nDont ) ) { @@ -764,7 +727,7 @@ const SfxFilter* SfxFilterMatcher::GetFilter4Extension( const String& rExt, SfxF sExt.Erase(0,1); com::sun::star::uno::Sequence < com::sun::star::beans::NamedValue > aSeq(1); - aSeq[0].Name = ::rtl::OUString::createFromAscii("Extensions"); + aSeq[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Extensions")); ::com::sun::star::uno::Sequence < ::rtl::OUString > aExts(1); aExts[0] = sExt; aSeq[0].Value <<= aExts; @@ -773,28 +736,12 @@ const SfxFilter* SfxFilterMatcher::GetFilter4Extension( const String& rExt, SfxF const SfxFilter* SfxFilterMatcher::GetFilter4ClipBoardId( sal_uInt32 nId, SfxFilterFlags nMust, SfxFilterFlags nDont ) const { - /* - if ( pImpl->pList ) - { - sal_uInt16 nCount = ( sal_uInt16 ) pImpl->pList->Count(); - for( sal_uInt16 n = 0; n < nCount; n++ ) - { - const SfxFilter* pFilter = pImpl->pList->GetObject( n ); - SfxFilterFlags nFlags = pFilter->GetFilterFlags(); - if ( (nFlags & nMust) == nMust && !(nFlags & nDont ) && pFilter->GetFormat() == nId ) - return pFilter; - } - - return 0; - } - */ - if (nId == 0) return 0; com::sun::star::uno::Sequence < com::sun::star::beans::NamedValue > aSeq(1); ::rtl::OUString aName = SotExchange::GetFormatName( nId ); - aSeq[0].Name = ::rtl::OUString::createFromAscii("ClipboardFormat"); + aSeq[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ClipboardFormat")); aSeq[0].Value <<= aName; return GetFilterForProps( aSeq, nMust, nDont ); } @@ -803,10 +750,9 @@ const SfxFilter* SfxFilterMatcher::GetFilter4UIName( const String& rName, SfxFil { pImpl->InitForIterating(); const SfxFilter* pFirstFilter=0; - sal_uInt16 nCount = ( sal_uInt16 ) pImpl->pList->Count(); - for( sal_uInt16 n = 0; n < nCount; n++ ) + for ( size_t i = 0, n = pImpl->pList->size(); i < n; ++i ) { - const SfxFilter* pFilter = pImpl->pList->GetObject( n ); + const SfxFilter* pFilter = pImpl->pList->at( i ); SfxFilterFlags nFlags = pFilter->GetFilterFlags(); if ( (nFlags & nMust) == nMust && !(nFlags & nDont ) && pFilter->GetUIName() == rName ) @@ -847,9 +793,9 @@ const SfxFilter* SfxFilterMatcher::GetFilter4FilterName( const String& rName, Sf CreateFilterArr(); else { - for( sal_uInt16 n=0; n<pFilterArr->Count(); n++ ) + for ( size_t i = 0, n = pFilterArr->size(); i < n; ++i ) { - const SfxFilter* pFilter = pFilterArr->GetObject( n ); + const SfxFilter* pFilter = pFilterArr->at( i ); SfxFilterFlags nFlags = pFilter->GetFilterFlags(); if ( (nFlags & nMust) == nMust && !(nFlags & nDont ) && pFilter->GetFilterName().CompareIgnoreCaseToAscii( aName ) == COMPARE_EQUAL ) return pFilter; @@ -864,10 +810,9 @@ const SfxFilter* SfxFilterMatcher::GetFilter4FilterName( const String& rName, Sf if ( !pList ) pList = pFilterArr; - sal_uInt16 nCount = ( sal_uInt16 ) pList->Count(); - for( sal_uInt16 n = 0; n < nCount; n++ ) + for ( size_t i = 0, n = pList->size(); i < n; ++i ) { - const SfxFilter* pFilter = pList->GetObject( n ); + const SfxFilter* pFilter = pList->at( i ); SfxFilterFlags nFlags = pFilter->GetFilterFlags(); if ( (nFlags & nMust) == nMust && !(nFlags & nDont ) && pFilter->GetFilterName().CompareIgnoreCaseToAscii( aName ) == COMPARE_EQUAL ) return pFilter; @@ -893,7 +838,7 @@ SfxFilterMatcherIter::SfxFilterMatcherIter( : nOrMask( nOrMaskP ), nAndMask( nAndMaskP ), nCurrent(0), pMatch( pMatchP->pImpl) { - if( nOrMask == 0xffff ) //Wg. Fehlbuild auf s + if( nOrMask == 0xffff ) //Due to falty build on s nOrMask = 0; pMatch->InitForIterating(); } @@ -903,9 +848,9 @@ SfxFilterMatcherIter::SfxFilterMatcherIter( const SfxFilter* SfxFilterMatcherIter::Find_Impl() { const SfxFilter* pFilter = 0; - while( nCurrent < pMatch->pList->Count() ) + while( nCurrent < pMatch->pList->size() ) { - pFilter = pMatch->pList->GetObject(nCurrent++); + pFilter = pMatch->pList->at( nCurrent++ ); SfxFilterFlags nFlags = pFilter->GetFilterFlags(); if( ((nFlags & nOrMask) == nOrMask ) && !(nFlags & nAndMask ) ) break; @@ -998,33 +943,33 @@ void SfxFilterContainer::ReadSingleFilter_Impl( sal_Int32 nFilterProperty = 0 ; for( nFilterProperty=0; nFilterProperty<nFilterPropertyCount; ++nFilterProperty ) { - if( lFilterProperties[nFilterProperty].Name.compareToAscii( "FileFormatVersion" ) == 0 ) + if( lFilterProperties[nFilterProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("FileFormatVersion")) ) { lFilterProperties[nFilterProperty].Value >>= nFormatVersion; } - else if( lFilterProperties[nFilterProperty].Name.compareToAscii( "TemplateName" ) == 0 ) + else if( lFilterProperties[nFilterProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("TemplateName")) ) { lFilterProperties[nFilterProperty].Value >>= sDefaultTemplate; } - else if( lFilterProperties[nFilterProperty].Name.compareToAscii( "Flags" ) == 0 ) + else if( lFilterProperties[nFilterProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Flags")) ) { lFilterProperties[nFilterProperty].Value >>= nFlags; } - else if( lFilterProperties[nFilterProperty].Name.compareToAscii( "UIName" ) == 0 ) + else if( lFilterProperties[nFilterProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("UIName")) ) { lFilterProperties[nFilterProperty].Value >>= sUIName; } - else if( lFilterProperties[nFilterProperty].Name.compareToAscii( "UserData" ) == 0 ) + else if( lFilterProperties[nFilterProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("UserData")) ) { ::com::sun::star::uno::Sequence< ::rtl::OUString > lUserData; lFilterProperties[nFilterProperty].Value >>= lUserData; sUserData = implc_convertStringlistToString( lUserData, ',', ::rtl::OUString() ); } - else if( lFilterProperties[nFilterProperty].Name.compareToAscii( "DocumentService" ) == 0 ) + else if( lFilterProperties[nFilterProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("DocumentService")) ) { lFilterProperties[nFilterProperty].Value >>= sServiceName; } - else if( lFilterProperties[nFilterProperty].Name.compareToAscii( "Type" ) == 0 ) + else if( lFilterProperties[nFilterProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Type")) ) { lFilterProperties[nFilterProperty].Value >>= sType; // Try to get filter .. but look for any exceptions! @@ -1046,25 +991,25 @@ void SfxFilterContainer::ReadSingleFilter_Impl( sal_Int32 nTypeProperty = 0 ; for( nTypeProperty=0; nTypeProperty<nTypePropertyCount; ++nTypeProperty ) { - if( lTypeProperties[nTypeProperty].Name.compareToAscii( "ClipboardFormat" ) == 0 ) + if( lTypeProperties[nTypeProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ClipboardFormat")) ) { lTypeProperties[nTypeProperty].Value >>= sHumanName; } - else if( lTypeProperties[nTypeProperty].Name.compareToAscii( "DocumentIconID" ) == 0 ) + else if( lTypeProperties[nTypeProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("DocumentIconID")) ) { lTypeProperties[nTypeProperty].Value >>= nDocumentIconId; } - else if( lTypeProperties[nTypeProperty].Name.compareToAscii( "MediaType" ) == 0 ) + else if( lTypeProperties[nTypeProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("MediaType")) ) { lTypeProperties[nTypeProperty].Value >>= sMimeType; } - else if( lTypeProperties[nTypeProperty].Name.compareToAscii( "Extensions" ) == 0 ) + else if( lTypeProperties[nTypeProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Extensions")) ) { ::com::sun::star::uno::Sequence< ::rtl::OUString > lExtensions; lTypeProperties[nTypeProperty].Value >>= lExtensions; sExtension = implc_convertStringlistToString( lExtensions, ';', DEFINE_CONST_UNICODE("*.") ); } - else if( lTypeProperties[nTypeProperty].Name.compareToAscii( "URLPattern" ) == 0 ) + else if( lTypeProperties[nTypeProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("URLPattern")) ) { ::com::sun::star::uno::Sequence< ::rtl::OUString > lPattern; lTypeProperties[nTypeProperty].Value >>= lPattern; @@ -1138,7 +1083,7 @@ void SfxFilterContainer::ReadSingleFilter_Impl( pFilter->SetURLPattern(sPattern); if (bNew) - rList.Insert( pFilter, USHRT_MAX ); + rList.push_back( pFilter ); } } @@ -1176,15 +1121,14 @@ void SfxFilterContainer::ReadFilters_Impl( BOOL bUpdate ) // ReadExternalFilters must work in update mode. // Best way seams to mark all filters NOT_INSTALLED // and change it back for all valid filters afterwards. - if( rList.Count() > 0 ) + if( !rList.empty() ) { bUpdate = TRUE; - USHORT nCount = (USHORT)rList.Count(); SfxFilter* pFilter; - for (USHORT f=0; f<nCount; ++f) + for ( size_t i = 0, n = rList.size(); i < n; ++i ) { pFilter = NULL; - pFilter = rList.GetObject(f); + pFilter = rList[ i ]; pFilter->nFormatType |= SFX_FILTER_NOTINSTALLED; } } @@ -1204,7 +1148,7 @@ void SfxFilterContainer::ReadFilters_Impl( BOOL bUpdate ) // And conditional breakpoints on unicode values seams not to be supported .-( #ifdef DEBUG bool bDBGStop = FALSE; - if (sFilterName.indexOf(::rtl::OUString::createFromAscii("DBG_"))>-1) + if (sFilterName.indexOf(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DBG_")))>-1) bDBGStop = TRUE; #endif @@ -1225,3 +1169,5 @@ void SfxFilterContainer::ReadFilters_Impl( BOOL bUpdate ) pImplArr->GetObject(n)->Update(); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/bastyp/fltlst.cxx b/sfx2/source/bastyp/fltlst.cxx index bb830f9926..a9637faa62 100644 --- a/sfx2/source/bastyp/fltlst.cxx +++ b/sfx2/source/bastyp/fltlst.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -41,7 +42,7 @@ #include <sfx2/docfac.hxx> #include <vcl/svapp.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> //***************************************************************************************************************** // namespaces @@ -95,7 +96,7 @@ SfxFilterListener::~SfxFilterListener() void SAL_CALL SfxFilterListener::refreshed( const lang::EventObject& aSource ) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; uno::Reference< util::XRefreshable > xContainer( aSource.Source, uno::UNO_QUERY ); if( (xContainer.is() ) && @@ -108,7 +109,7 @@ void SAL_CALL SfxFilterListener::refreshed( const lang::EventObject& aSource ) t void SAL_CALL SfxFilterListener::disposing( const lang::EventObject& aSource ) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; uno::Reference< util::XRefreshable > xNotifier( aSource.Source, uno::UNO_QUERY ); if (!xNotifier.is()) return; @@ -116,3 +117,5 @@ void SAL_CALL SfxFilterListener::disposing( const lang::EventObject& aSource ) t if (xNotifier == m_xFilterCache) m_xFilterCache.clear(); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/bastyp/fltlst.hxx b/sfx2/source/bastyp/fltlst.hxx index dc802419ca..b775d9d831 100644 --- a/sfx2/source/bastyp/fltlst.hxx +++ b/sfx2/source/bastyp/fltlst.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -65,3 +66,5 @@ class SfxFilterListener : public ::cppu::WeakImplHelper1< ::com::sun::star::util }; // SfxFilterListener #endif // _SFX_FLTLST_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/bastyp/frmhtml.cxx b/sfx2/source/bastyp/frmhtml.cxx index 1ea0c00aeb..ac1a4000d6 100644 --- a/sfx2/source/bastyp/frmhtml.cxx +++ b/sfx2/source/bastyp/frmhtml.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -50,14 +51,14 @@ #define SFX_HTMLFRMSIZE_REL 0x0001 #define SFX_HTMLFRMSIZE_PERCENT 0x0002 -static sal_Char __READONLY_DATA sHTML_SC_yes[] = "YES"; -static sal_Char __READONLY_DATA sHTML_SC_no[] = "NO"; -static sal_Char __READONLY_DATA sHTML_SC_auto[] = "AUTO"; +static sal_Char const sHTML_SC_yes[] = "YES"; +static sal_Char const sHTML_SC_no[] = "NO"; +static sal_Char const sHTML_SC_auto[] = "AUTO"; #define HTML_O_READONLY "READONLY" #define HTML_O_EDIT "EDIT" -static HTMLOptionEnum __READONLY_DATA aScollingTable[] = +static HTMLOptionEnum const aScollingTable[] = { { sHTML_SC_yes, ScrollingYes }, { sHTML_SC_no, ScrollingNo }, @@ -67,14 +68,14 @@ static HTMLOptionEnum __READONLY_DATA aScollingTable[] = void SfxFrameHTMLParser::ParseFrameOptions( SfxFrameDescriptor *pFrame, const HTMLOptions *pOptions, const String& rBaseURL ) { - // die Optionen holen und setzen + // Get and set the options Size aMargin( pFrame->GetMargin() ); - // MIB 15.7.97: Netscape scheint marginwidth auf 0 zu setzen, sobald - // marginheight gesetzt wird und umgekehrt. Machen wir jetzt wegen - // bug #41665# auch so. - // Netscape l"a\st aber ein direktes Setzen auf 0 nicht zu, IE4.0 schon. - // Den Bug machen wir nicht mit! + // MIB 07/15/1997: Netscape seems to set marginwidth to 0 as soon as + // marginheight is set, and vice versa. Due to bug #41665# let us also + // do like that for now. Netscape does however not aallow for a direct + // seting to 0, while IE4.0 does + // We will not mimic that bug ! BOOL bMarginWidth = FALSE, bMarginHeight = FALSE; USHORT nArrLen = pOptions->Count(); @@ -161,3 +162,5 @@ void SfxFrameHTMLParser::ParseFrameOptions( SfxFrameDescriptor *pFrame, const HT pFrame->SetMargin( aMargin ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/bastyp/frmhtmlw.cxx b/sfx2/source/bastyp/frmhtmlw.cxx index 4762c4e622..12e749e1f9 100644 --- a/sfx2/source/bastyp/frmhtmlw.cxx +++ b/sfx2/source/bastyp/frmhtmlw.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -62,13 +63,13 @@ using namespace ::com::sun::star; -static sal_Char __READONLY_DATA sHTML_SC_yes[] = "YES"; -static sal_Char __READONLY_DATA sHTML_SC_no[] = "NO"; -static sal_Char __READONLY_DATA sHTML_SC_auto[] = "AUTO"; -static sal_Char __READONLY_DATA sHTML_MIME_text_html[] = "text/html; charset="; +static sal_Char const sHTML_SC_yes[] = "YES"; +static sal_Char const sHTML_SC_no[] = "NO"; +static sal_Char const sHTML_SC_auto[] = "AUTO"; +static sal_Char const sHTML_MIME_text_html[] = "text/html; charset="; /* not used anymore? -static HTMLOutEvent __FAR_DATA aFrameSetEventTable[] = +static HTMLOutEvent aFrameSetEventTable[] = { { sHTML_O_SDonload, sHTML_O_onload, SFX_EVENT_OPENDOC }, { sHTML_O_SDonunload, sHTML_O_onunload, SFX_EVENT_PREPARECLOSEDOC }, @@ -81,7 +82,7 @@ static HTMLOutEvent __FAR_DATA aFrameSetEventTable[] = #if defined(UNX) const sal_Char SfxFrameHTMLWriter::sNewLine[] = "\012"; #else -const sal_Char __FAR_DATA SfxFrameHTMLWriter::sNewLine[] = "\015\012"; +const sal_Char SfxFrameHTMLWriter::sNewLine[] = "\015\012"; #endif void SfxFrameHTMLWriter::OutMeta( SvStream& rStrm, @@ -236,7 +237,7 @@ void SfxFrameHTMLWriter::Out_DocInfo( SvStream& rStrm, const String& rBaseURL, uno::Reference < script::XTypeConverter > xConverter( ::comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString::createFromAscii("com.sun.star.script.Converter")), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.Converter"))), uno::UNO_QUERY_THROW ); uno::Reference<beans::XPropertySet> xUserDefinedProps( i_xDocProps->getUserDefinedProperties(), uno::UNO_QUERY_THROW); @@ -278,7 +279,7 @@ void SfxFrameHTMLWriter::OutHeader( rtl_TextEncoding eDestEnc ) Strm() << sNewLine; HTMLOutFuncs::Out_AsciiTag( Strm(), sHTML_head, FALSE ) << sNewLine; -//! OutScript(); // Hier fehlen noch die Scripten im Header +//! OutScript(); // Hear the scripts in the Header are still missing } */ @@ -290,7 +291,7 @@ void SfxFrameHTMLWriter::Out_FrameDescriptor( { ByteString sOut; ::rtl::OUString aStr; - uno::Any aAny = xSet->getPropertyValue( ::rtl::OUString::createFromAscii("FrameURL") ); + uno::Any aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameURL")) ); if ( (aAny >>= aStr) && aStr.getLength() ) { String aURL = INetURLObject( aStr ).GetMainURL( INetURLObject::DECODE_TO_IURI ); @@ -305,7 +306,7 @@ void SfxFrameHTMLWriter::Out_FrameDescriptor( } } - aAny = xSet->getPropertyValue( ::rtl::OUString::createFromAscii("FrameName") ); + aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameName")) ); if ( (aAny >>= aStr) && aStr.getLength() ) { ((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_name) += "=\""; @@ -315,18 +316,18 @@ void SfxFrameHTMLWriter::Out_FrameDescriptor( } sal_Int32 nVal = SIZE_NOT_SET; - aAny = xSet->getPropertyValue( ::rtl::OUString::createFromAscii("FrameMarginWidth") ); + aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameMarginWidth")) ); if ( (aAny >>= nVal) && nVal != SIZE_NOT_SET ) (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_marginwidth) += '=') += ByteString::CreateFromInt32( nVal ); - aAny = xSet->getPropertyValue( ::rtl::OUString::createFromAscii("FrameMarginHeight") ); + aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameMarginHeight")) ); if ( (aAny >>= nVal) && nVal != SIZE_NOT_SET ) (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_marginheight) += '=') += ByteString::CreateFromInt32( nVal ); sal_Bool bVal = sal_True; - aAny = xSet->getPropertyValue( ::rtl::OUString::createFromAscii("FrameIsAutoScroll") ); + aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameIsAutoScroll")) ); if ( (aAny >>= bVal) && !bVal ) { - aAny = xSet->getPropertyValue( ::rtl::OUString::createFromAscii("FrameIsScrollingMode") ); + aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameIsScrollingMode")) ); if ( aAny >>= bVal ) { const sal_Char *pStr = bVal ? sHTML_SC_yes : sHTML_SC_no; @@ -335,10 +336,10 @@ void SfxFrameHTMLWriter::Out_FrameDescriptor( } // frame border (MS+Netscape-Erweiterung) - aAny = xSet->getPropertyValue( ::rtl::OUString::createFromAscii("FrameIsAutoBorder") ); + aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameIsAutoBorder")) ); if ( (aAny >>= bVal) && !bVal ) { - aAny = xSet->getPropertyValue( ::rtl::OUString::createFromAscii("FrameIsBorder") ); + aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameIsBorder")) ); if ( aAny >>= bVal ) { const char* pStr = bVal ? sHTML_SC_yes : sHTML_SC_no; @@ -379,3 +380,4 @@ String SfxFrameHTMLWriter::CreateURL( SfxFrame* pFrame ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/bastyp/helper.cxx b/sfx2/source/bastyp/helper.cxx index 0b698070da..d4ce417f53 100644 --- a/sfx2/source/bastyp/helper.cxx +++ b/sfx2/source/bastyp/helper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -56,13 +57,16 @@ #include <ucbhelper/commandenvironment.hxx> #include <comphelper/processfactory.hxx> #include <osl/file.hxx> +#include <vector> using namespace com::sun::star; using namespace rtl; using namespace comphelper; using namespace osl; -DECLARE_LIST( StringList_Impl, OUString* ) +using ::std::vector; + +typedef vector< OUString* > StringList_Impl; #define CONVERT_DATETIME( aUnoDT, aToolsDT ) \ aToolsDT = DateTime( Date( aUnoDT.Day, aUnoDT.Month, aUnoDT.Year ), \ @@ -102,7 +106,7 @@ sal_Bool SfxContentHelper::Transfer_Impl( const String& rSource, const String& r { ::ucbhelper::Content aDestPath( aDestObj.GetMainURL( INetURLObject::NO_DECODE ), uno::Reference< ucb::XCommandEnvironment > () ); uno::Reference< ucb::XCommandInfo > xInfo = aDestPath.getCommands(); - OUString aTransferName = OUString::createFromAscii( "transfer" ); + OUString aTransferName(RTL_CONSTASCII_USTRINGPARAM("transfer")); if ( xInfo->hasCommandByName( aTransferName ) ) { aDestPath.executeCommand( aTransferName, uno::makeAny( @@ -205,7 +209,7 @@ sal_Bool SfxContentHelper::GetTitle( const String& rContent, String& rTitle ) { ::ucbhelper::Content aCnt( aObj.GetMainURL( INetURLObject::NO_DECODE ), uno::Reference< ucb::XCommandEnvironment > () ); OUString aTemp; - aCnt.getPropertyValue( OUString::createFromAscii( "Title" ) ) >>= aTemp; + aCnt.getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("Title")) ) >>= aTemp; rTitle = String( aTemp ); bRet = sal_True; } @@ -231,7 +235,7 @@ sal_Bool SfxContentHelper::Kill( const String& rContent ) try { ::ucbhelper::Content aCnt( aDeleteObj.GetMainURL( INetURLObject::NO_DECODE ), uno::Reference< ucb::XCommandEnvironment > () ); - aCnt.executeCommand( OUString::createFromAscii( "delete" ), uno::makeAny( sal_Bool( sal_True ) ) ); + aCnt.executeCommand( OUString(RTL_CONSTASCII_USTRINGPARAM("delete")), uno::makeAny( sal_Bool( sal_True ) ) ); } catch( ucb::CommandAbortedException& ) { @@ -260,8 +264,8 @@ uno::Sequence < OUString > SfxContentHelper::GetFolderContents( const String& rF uno::Reference< sdbc::XResultSet > xResultSet; uno::Sequence< OUString > aProps(2); OUString* pProps = aProps.getArray(); - pProps[0] = OUString::createFromAscii( "Title" ); - pProps[1] = OUString::createFromAscii( "IsFolder" ); + pProps[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("Title")); + pProps[1] = OUString(RTL_CONSTASCII_USTRINGPARAM("IsFolder")); try { @@ -278,7 +282,7 @@ uno::Sequence < OUString > SfxContentHelper::GetFolderContents( const String& rF uno::Reference < ucb::XAnyCompareFactory > xFactory; uno::Reference < lang::XMultiServiceFactory > xMgr = getProcessServiceFactory(); uno::Reference < ucb::XSortedDynamicResultSetFactory > xSRSFac( - xMgr->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.ucb.SortedDynamicResultSetFactory") ), uno::UNO_QUERY ); + xMgr->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SortedDynamicResultSetFactory")) ), uno::UNO_QUERY ); uno::Sequence< ucb::NumberedSortingInfo > aSortInfo( 2 ); ucb::NumberedSortingInfo* pInfo = aSortInfo.getArray(); @@ -307,7 +311,7 @@ uno::Sequence < OUString > SfxContentHelper::GetFolderContents( const String& rF if ( xResultSet.is() ) { - pFiles = new StringList_Impl; + pFiles = new StringList_Impl(); uno::Reference< ucb::XContentAccess > xContentAccess( xResultSet, uno::UNO_QUERY ); try { @@ -315,7 +319,7 @@ uno::Sequence < OUString > SfxContentHelper::GetFolderContents( const String& rF { OUString aId = xContentAccess->queryContentIdentifierString(); OUString* pFile = new OUString( aId ); - pFiles->Insert( pFile, LIST_APPEND ); + pFiles->push_back( pFile ); } } catch( ucb::CommandAbortedException& ) @@ -335,15 +339,16 @@ uno::Sequence < OUString > SfxContentHelper::GetFolderContents( const String& rF if ( pFiles ) { - ULONG nCount = pFiles->Count(); + size_t nCount = pFiles->size(); uno::Sequence < OUString > aRet( nCount ); OUString* pRet = aRet.getArray(); - for ( ULONG i = 0; i < nCount; ++i ) + for ( size_t i = 0; i < nCount; ++i ) { - OUString* pFile = pFiles->GetObject(i); + OUString* pFile = pFiles->at( i ); pRet[i] = *( pFile ); delete pFile; } + pFiles->clear(); delete pFiles; return aRet; } @@ -368,11 +373,11 @@ uno::Sequence < OUString > SfxContentHelper::GetFolderContentProperties( const S uno::Reference< sdbc::XResultSet > xResultSet; uno::Sequence< OUString > aProps(5); OUString* pProps = aProps.getArray(); - pProps[0] = OUString::createFromAscii( "Title" ); - pProps[1] = OUString::createFromAscii( "ContentType" ); - pProps[2] = OUString::createFromAscii( "Size" ); - pProps[3] = OUString::createFromAscii( "DateModified" ); - pProps[4] = OUString::createFromAscii( "IsFolder" ); + pProps[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("Title")); + pProps[1] = OUString(RTL_CONSTASCII_USTRINGPARAM("ContentType")); + pProps[2] = OUString(RTL_CONSTASCII_USTRINGPARAM("Size")); + pProps[3] = OUString(RTL_CONSTASCII_USTRINGPARAM("DateModified")); + pProps[4] = OUString(RTL_CONSTASCII_USTRINGPARAM("IsFolder")); try { @@ -383,7 +388,7 @@ uno::Sequence < OUString > SfxContentHelper::GetFolderContentProperties( const S uno::Reference < ucb::XAnyCompareFactory > xCmpFactory; uno::Reference < lang::XMultiServiceFactory > xMgr = getProcessServiceFactory(); uno::Reference < ucb::XSortedDynamicResultSetFactory > xSRSFac( - xMgr->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.ucb.SortedDynamicResultSetFactory") ), uno::UNO_QUERY ); + xMgr->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SortedDynamicResultSetFactory")) ), uno::UNO_QUERY ); uno::Sequence< ucb::NumberedSortingInfo > aSortInfo( 2 ); ucb::NumberedSortingInfo* pInfo = aSortInfo.getArray(); @@ -399,9 +404,6 @@ uno::Sequence < OUString > SfxContentHelper::GetFolderContentProperties( const S { xResultSet = xDynamicResultSet->getStaticResultSet(); } - -// if ( xDynResultSet.is() ) -// xResultSet = xDynResultSet->getStaticResultSet(); } catch( ucb::CommandAbortedException& ) { @@ -415,10 +417,10 @@ uno::Sequence < OUString > SfxContentHelper::GetFolderContentProperties( const S if ( xResultSet.is() ) { LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() ); - pProperties = new StringList_Impl; + pProperties = new StringList_Impl(); uno::Reference< sdbc::XRow > xRow( xResultSet, uno::UNO_QUERY ); uno::Reference< ucb::XContentAccess > xContentAccess( xResultSet, uno::UNO_QUERY ); - ULONG nFolderPos = LIST_APPEND; + size_t nFolderPos = size_t(-1); try { @@ -428,12 +430,10 @@ uno::Sequence < OUString > SfxContentHelper::GetFolderContentProperties( const S String aType( xRow->getString(2) ); sal_Int64 nSize = xRow->getLong(3); util::DateTime aDT = xRow->getTimestamp(4); - sal_Bool bFolder = xRow->getBoolean(5); + sal_Bool bFolder = xRow->getBoolean(5); // true = directory, else file String aRow = aTitle; aRow += '\t'; -//! aRow += aType; -//! aRow += '\t'; aRow += String::CreateFromInt64( nSize ); aRow += '\t'; AppendDateTime_Impl( aDT, aRow, aLocaleWrapper ); @@ -442,16 +442,23 @@ uno::Sequence < OUString > SfxContentHelper::GetFolderContentProperties( const S aRow += '\t'; aRow += bFolder ? '1' : '0'; OUString* pRow = new OUString( aRow ); - ULONG nPos = LIST_APPEND; - if ( bFolder ) + size_t nPos = size_t(-1); + if ( bFolder ) // place the directories at the top of the listing { - if ( LIST_APPEND == nFolderPos ) + if ( nFolderPos == size_t(-1) ) nFolderPos = 0; else nFolderPos++; nPos = nFolderPos; } - pProperties->Insert( pRow, nPos ); + if ( nPos >= pProperties->size() ) + pProperties->push_back( pRow ); + else + { + StringList_Impl::iterator it = pProperties->begin(); + ::std::advance( it, nPos ); + it = pProperties->insert( it, pRow ); + } } } catch( ucb::CommandAbortedException& ) @@ -471,15 +478,16 @@ uno::Sequence < OUString > SfxContentHelper::GetFolderContentProperties( const S if ( pProperties ) { - ULONG nCount = pProperties->Count(); + size_t nCount = pProperties->size(); uno::Sequence < OUString > aRet( nCount ); OUString* pRet = aRet.getArray(); - for ( ULONG i = 0; i < nCount; ++i ) + for ( size_t i = 0; i < nCount; ++i ) { - OUString* pProperty = pProperties->GetObject(i); + OUString* pProperty = pProperties->at(i); pRet[i] = *( pProperty ); delete pProperty; } + pProperties->clear(); delete pProperties; return aRet; } @@ -499,9 +507,9 @@ uno::Sequence < OUString > SfxContentHelper::GetResultSet( const String& rURL ) uno::Reference< ucb::XDynamicResultSet > xDynResultSet; uno::Sequence< OUString > aProps(3); OUString* pProps = aProps.getArray(); - pProps[0] = OUString::createFromAscii( "Title" ); - pProps[1] = OUString::createFromAscii( "ContentType" ); - pProps[2] = OUString::createFromAscii( "IsFolder" ); + pProps[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("Title")); + pProps[1] = OUString(RTL_CONSTASCII_USTRINGPARAM("ContentType")); + pProps[2] = OUString(RTL_CONSTASCII_USTRINGPARAM("IsFolder")); try { @@ -520,7 +528,7 @@ uno::Sequence < OUString > SfxContentHelper::GetResultSet( const String& rURL ) if ( xResultSet.is() ) { - pList = new StringList_Impl; + pList = new StringList_Impl(); uno::Reference< sdbc::XRow > xRow( xResultSet, uno::UNO_QUERY ); uno::Reference< ucb::XContentAccess > xContentAccess( xResultSet, uno::UNO_QUERY ); @@ -536,7 +544,7 @@ uno::Sequence < OUString > SfxContentHelper::GetResultSet( const String& rURL ) aRow += '\t'; aRow += String( xContentAccess->queryContentIdentifierString() ); OUString* pRow = new OUString( aRow ); - pList->Insert( pRow, LIST_APPEND ); + pList->push_back( pRow ); } } catch( ucb::CommandAbortedException& ) @@ -564,15 +572,16 @@ uno::Sequence < OUString > SfxContentHelper::GetResultSet( const String& rURL ) if ( pList ) { - ULONG nCount = pList->Count(); + size_t nCount = pList->size(); uno::Sequence < OUString > aRet( nCount ); OUString* pRet = aRet.getArray(); - for ( ULONG i = 0; i < nCount; ++i ) + for ( size_t i = 0; i < nCount; ++i ) { - OUString* pEntry = pList->GetObject(i); + OUString* pEntry = pList->at(i); pRet[i] = *( pEntry ); delete pEntry; } + pList->clear(); delete pList; return aRet; } @@ -595,8 +604,8 @@ uno::Sequence< OUString > SfxContentHelper::GetHelpTreeViewContents( const Strin uno::Reference< sdbc::XResultSet > xResultSet; uno::Sequence< OUString > aProps(2); OUString* pProps = aProps.getArray(); - pProps[0] = OUString::createFromAscii( "Title" ); - pProps[1] = OUString::createFromAscii( "IsFolder" ); + pProps[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("Title")); + pProps[1] = OUString(RTL_CONSTASCII_USTRINGPARAM("IsFolder")); try { @@ -614,7 +623,7 @@ uno::Sequence< OUString > SfxContentHelper::GetHelpTreeViewContents( const Strin if ( xResultSet.is() ) { - pProperties = new StringList_Impl; + pProperties = new StringList_Impl(); uno::Reference< sdbc::XRow > xRow( xResultSet, uno::UNO_QUERY ); uno::Reference< ucb::XContentAccess > xContentAccess( xResultSet, uno::UNO_QUERY ); @@ -630,7 +639,7 @@ uno::Sequence< OUString > SfxContentHelper::GetHelpTreeViewContents( const Strin aRow += '\t'; aRow += bFolder ? '1' : '0'; OUString* pRow = new OUString( aRow ); - pProperties->Insert( pRow, LIST_APPEND ); + pProperties->push_back( pRow ); } } catch( ucb::CommandAbortedException& ) @@ -647,15 +656,16 @@ uno::Sequence< OUString > SfxContentHelper::GetHelpTreeViewContents( const Strin if ( pProperties ) { - ULONG nCount = pProperties->Count(); + size_t nCount = pProperties->size(); uno::Sequence < OUString > aRet( nCount ); OUString* pRet = aRet.getArray(); - for ( ULONG i = 0; i < nCount; ++i ) + for ( size_t i = 0; i < nCount; ++i ) { - OUString* pProperty = pProperties->GetObject(i); + OUString* pProperty = pProperties->at(i); pRet[i] = *( pProperty ); delete pProperty; } + pProperties->clear(); delete pProperties; return aRet; } @@ -706,7 +716,7 @@ sal_Bool SfxContentHelper::IsHelpErrorDocument( const String& rURL ) { ::ucbhelper::Content aCnt( INetURLObject( rURL ).GetMainURL( INetURLObject::NO_DECODE ), uno::Reference< ucb::XCommandEnvironment > () ); - if ( !( aCnt.getPropertyValue( OUString::createFromAscii( "IsErrorDocument" ) ) >>= bRet ) ) + if ( !( aCnt.getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("IsErrorDocument")) ) >>= bRet ) ) { DBG_ERRORFILE( "Property 'IsErrorDocument' is missing" ); } @@ -784,7 +794,7 @@ ErrCode SfxContentHelper::QueryDiskSpace( const String& rPath, sal_Int64& rFreeB try { ::ucbhelper::Content aCnt( aObj.GetMainURL( INetURLObject::NO_DECODE ), uno::Reference< ucb::XCommandEnvironment > () ); - aCnt.getPropertyValue( OUString::createFromAscii( "FreeSpace" ) ) >>= rFreeBytes; + aCnt.getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("FreeSpace")) ) >>= rFreeBytes; } catch( ucb::CommandAbortedException& ) { @@ -810,7 +820,7 @@ ULONG SfxContentHelper::GetSize( const String& rContent ) try { ::ucbhelper::Content aCnt( aObj.GetMainURL( INetURLObject::NO_DECODE ), uno::Reference< ucb::XCommandEnvironment > () ); - aCnt.getPropertyValue( OUString::createFromAscii( "Size" ) ) >>= nTemp; + aCnt.getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("Size")) ) >>= nTemp; } catch( ucb::CommandAbortedException& ) { @@ -877,3 +887,4 @@ sal_Bool SfxContentHelper::Find( const String& rFolder, const String& rName, Str } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/bastyp/mieclip.cxx b/sfx2/source/bastyp/mieclip.cxx index 9695e86bd5..97686aa9ff 100644 --- a/sfx2/source/bastyp/mieclip.cxx +++ b/sfx2/source/bastyp/mieclip.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -93,3 +94,4 @@ SvStream* MSE40HTMLClipFormatObj::IsValid( SvStream& rStream ) return pStrm; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/bastyp/minarray.cxx b/sfx2/source/bastyp/minarray.cxx index 3fa4ddf68e..7ed7c5239b 100644 --- a/sfx2/source/bastyp/minarray.cxx +++ b/sfx2/source/bastyp/minarray.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,9 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" -#ifndef GCC -#endif - #include <sfx2/minarray.hxx> // ----------------------------------------------------------------------- @@ -103,7 +101,7 @@ void SfxPtrArr::Append( void* aElem ) { DBG_MEMTEST(); DBG_ASSERT( sal::static_int_cast< unsigned >(nUsed+1) < ( USHRT_MAX / sizeof(void*) ), "array too large" ); - // musz das Array umkopiert werden? + // Does the Array need to be copied? if ( nUnused == 0 ) { USHORT nNewSize = (nUsed == 1) ? (nGrow==1 ? 2 : nGrow) : nUsed+nGrow; @@ -118,7 +116,7 @@ void SfxPtrArr::Append( void* aElem ) pData = pNewData; } - // jetzt hinten in den freien Raum schreiben + // now write at the back in the open space pData[nUsed] = aElem; ++nUsed; --nUnused; @@ -129,14 +127,14 @@ void SfxPtrArr::Append( void* aElem ) USHORT SfxPtrArr::Remove( USHORT nPos, USHORT nLen ) { DBG_MEMTEST(); - // nLen adjustieren, damit nicht ueber das Ende hinaus geloescht wird + // Adjust nLen, thus to avoid deleting beyond the end nLen = Min( (USHORT)(nUsed-nPos), nLen ); - // einfache Aufgaben erfordern einfache Loesungen! + // simple problems require simple solutions! if ( nLen == 0 ) return 0; - // bleibt vielleicht keiner uebrig + // Maybe no one will remain if ( (nUsed-nLen) == 0 ) { delete [] pData; @@ -146,10 +144,10 @@ USHORT SfxPtrArr::Remove( USHORT nPos, USHORT nLen ) return nLen; } - // feststellen, ob das Array dadurch physikalisch schrumpft... + // Determine whether the array has physically shrunk... if ( (nUnused+nLen) >= nGrow ) { - // auf die naechste Grow-Grenze aufgerundet verkleinern + // reduce (rounded up) to the next Grow-border USHORT nNewUsed = nUsed-nLen; USHORT nNewSize = ((nNewUsed+nGrow-1)/nGrow) * nGrow; DBG_ASSERT( nNewUsed <= nNewSize && nNewUsed+nGrow > nNewSize, @@ -170,7 +168,7 @@ USHORT SfxPtrArr::Remove( USHORT nPos, USHORT nLen ) return nLen; } - // in allen anderen Faellen nur zusammenschieben + // in all other cases, only push together if ( nUsed-nPos-nLen > 0 ) memmove( pData+nPos, pData+nPos+nLen, (nUsed-nPos-nLen)*sizeof(void*) ); nUsed = nUsed - nLen; @@ -183,11 +181,11 @@ USHORT SfxPtrArr::Remove( USHORT nPos, USHORT nLen ) BOOL SfxPtrArr::Remove( void* aElem ) { DBG_MEMTEST(); - // einfache Aufgaben ... + // simple tasks ... if ( nUsed == 0 ) return FALSE; - // rueckwaerts, da meist der letzte zuerst wieder entfernt wird + // backwards, since most of the last is first removed void* *pIter = pData + nUsed - 1; for ( USHORT n = 0; n < nUsed; ++n, --pIter ) if ( *pIter == aElem ) @@ -203,11 +201,11 @@ BOOL SfxPtrArr::Remove( void* aElem ) BOOL SfxPtrArr::Replace( void* aOldElem, void* aNewElem ) { DBG_MEMTEST(); - // einfache Aufgaben ... + // simple tasks ... if ( nUsed == 0 ) return FALSE; - // rueckwaerts, da meist der letzte zuerst wieder entfernt wird + // backwards, since most of the last is first removed void* *pIter = pData + nUsed - 1; for ( USHORT n = 0; n < nUsed; ++n, --pIter ) if ( *pIter == aOldElem ) @@ -242,10 +240,10 @@ void SfxPtrArr::Insert( USHORT nPos, void* rElem ) { DBG_MEMTEST(); DBG_ASSERT( sal::static_int_cast< unsigned >(nUsed+1) < ( USHRT_MAX / sizeof(void*) ), "array too large" ); - // musz das Array umkopiert werden? + // Does the Array have o be copied? if ( nUnused == 0 ) { - // auf die naechste Grow-Grenze aufgerundet vergroeszern + // increase (rounded up ) to the next Grow-border USHORT nNewSize = nUsed+nGrow; void** pNewData = new void*[nNewSize]; @@ -259,11 +257,11 @@ void SfxPtrArr::Insert( USHORT nPos, void* rElem ) pData = pNewData; } - // jetzt den hinteren Teil verschieben + // Now move the rear part if ( nPos < nUsed ) memmove( pData+nPos+1, pData+nPos, (nUsed-nPos)*sizeof(void*) ); - // jetzt in den freien Raum schreiben + // Now write into the free space. memmove( pData+nPos, &rElem, sizeof(void*) ); nUsed += 1; nUnused -= 1; @@ -338,7 +336,7 @@ ByteArr& ByteArr::operator=( const ByteArr& rOrig ) void ByteArr::Append( char aElem ) { DBG_MEMTEST(); - // musz das Array umkopiert werden? + // Does the Array have o be copied? if ( nUnused == 0 ) { USHORT nNewSize = (nUsed == 1) ? (nGrow==1 ? 2 : nGrow) : nUsed+nGrow; @@ -353,7 +351,7 @@ void ByteArr::Append( char aElem ) pData = pNewData; } - // jetzt hinten in den freien Raum schreiben + // now write at the back in the open space pData[nUsed] = aElem; ++nUsed; --nUnused; @@ -364,14 +362,14 @@ void ByteArr::Append( char aElem ) USHORT ByteArr::Remove( USHORT nPos, USHORT nLen ) { DBG_MEMTEST(); - // nLen adjustieren, damit nicht ueber das Ende hinaus geloescht wird + // Adjust nLen, thus to avoid deleting beyond the end nLen = Min( (USHORT)(nUsed-nPos), nLen ); - // einfache Aufgaben erfordern einfache Loesungen! + // simple problems require simple solutions! if ( nLen == 0 ) return 0; - // bleibt vielleicht keiner uebrig + // Maybe no one will remain if ( (nUsed-nLen) == 0 ) { delete [] pData; @@ -381,10 +379,10 @@ USHORT ByteArr::Remove( USHORT nPos, USHORT nLen ) return nLen; } - // feststellen, ob das Array dadurch physikalisch schrumpft... + // Determine whether the array has physically shrunk... if ( (nUnused+nLen) >= nGrow ) { - // auf die naechste Grow-Grenze aufgerundet verkleinern + // reduce (rounded up) to the next Grow-border USHORT nNewUsed = nUsed-nLen; USHORT nNewSize = ((nNewUsed+nGrow-1)/nGrow) * nGrow; DBG_ASSERT( nNewUsed <= nNewSize && nNewUsed+nGrow > nNewSize, @@ -405,7 +403,7 @@ USHORT ByteArr::Remove( USHORT nPos, USHORT nLen ) return nLen; } - // in allen anderen Faellen nur zusammenschieben + // in all other cases, only push together if ( nUsed-nPos-nLen > 0 ) memmove( pData+nPos, pData+nPos+nLen, (nUsed-nPos-nLen)*sizeof(char) ); nUsed = nUsed - nLen; @@ -418,11 +416,11 @@ USHORT ByteArr::Remove( USHORT nPos, USHORT nLen ) BOOL ByteArr::Remove( char aElem ) { DBG_MEMTEST(); - // einfache Aufgaben ... + // simple tasks ... if ( nUsed == 0 ) return FALSE; - // rueckwaerts, da meist der letzte zuerst wieder entfernt wird + // backwards, since most of the last is first removed char *pIter = pData + nUsed - 1; for ( USHORT n = 0; n < nUsed; ++n, --pIter ) if ( *pIter == aElem ) @@ -456,10 +454,10 @@ BOOL ByteArr::Contains( const char rItem ) const void ByteArr::Insert( USHORT nPos, char rElem ) { DBG_MEMTEST(); - // musz das Array umkopiert werden? + // Does the Array need to be copied? if ( nUnused == 0 ) { - // auf die naechste Grow-Grenze aufgerundet vergroeszern + // increase (rounded up) to the next Grow-border USHORT nNewSize = nUsed+nGrow; char* pNewData = new char[nNewSize]; @@ -473,11 +471,11 @@ void ByteArr::Insert( USHORT nPos, char rElem ) pData = pNewData; } - // jetzt den hinteren Teil verschieben + // Now move the rear part if ( nPos < nUsed ) memmove( pData+nPos+1, pData+nPos, (nUsed-nPos)*sizeof(char) ); - // jetzt in den freien Raum schreiben + // now write at the back in the open space memmove( pData+nPos, &rElem, sizeof(char) ); nUsed += 1; nUnused -= 1; @@ -570,7 +568,7 @@ WordArr& WordArr::operator=( const WordArr& rOrig ) void WordArr::Append( short aElem ) { DBG_MEMTEST(); - // musz das Array umkopiert werden? + // Does the Array need to be copied? if ( nUnused == 0 ) { USHORT nNewSize = (nUsed == 1) ? (nGrow==1 ? 2 : nGrow) : nUsed+nGrow; @@ -585,7 +583,7 @@ void WordArr::Append( short aElem ) pData = pNewData; } - // jetzt hinten in den freien Raum schreiben + // now write at the back in the open space pData[nUsed] = aElem; ++nUsed; --nUnused; @@ -596,14 +594,14 @@ void WordArr::Append( short aElem ) USHORT WordArr::Remove( USHORT nPos, USHORT nLen ) { DBG_MEMTEST(); - // nLen adjustieren, damit nicht ueber das Ende hinaus geloescht wird + // Adjust nLen, thus to avoid deleting beyond the end nLen = Min( (USHORT)(nUsed-nPos), nLen ); - // einfache Aufgaben erfordern einfache Loesungen! + // simple problems require simple solutions! if ( nLen == 0 ) return 0; - // bleibt vielleicht keiner uebrig + // Maybe no one will remain if ( (nUsed-nLen) == 0 ) { delete [] pData; @@ -613,10 +611,10 @@ USHORT WordArr::Remove( USHORT nPos, USHORT nLen ) return nLen; } - // feststellen, ob das Array dadurch physikalisch schrumpft... + // Determine whether the array has physically shrunk... if ( (nUnused+nLen) >= nGrow ) { - // auf die naechste Grow-Grenze aufgerundet verkleinern + // reduce (rounded up) to the next Grow-border USHORT nNewUsed = nUsed-nLen; USHORT nNewSize = ((nNewUsed+nGrow-1)/nGrow) * nGrow; DBG_ASSERT( nNewUsed <= nNewSize && nNewUsed+nGrow > nNewSize, @@ -637,7 +635,7 @@ USHORT WordArr::Remove( USHORT nPos, USHORT nLen ) return nLen; } - // in allen anderen Faellen nur zusammenschieben + // in all other cases, only push together if ( nUsed-nPos-nLen > 0 ) memmove( pData+nPos, pData+nPos+nLen, (nUsed-nPos-nLen)*sizeof(short) ); nUsed = nUsed - nLen; @@ -650,11 +648,11 @@ USHORT WordArr::Remove( USHORT nPos, USHORT nLen ) BOOL WordArr::Remove( short aElem ) { DBG_MEMTEST(); - // einfache Aufgaben ... + // simple tasks ... if ( nUsed == 0 ) return FALSE; - // rueckwaerts, da meist der letzte zuerst wieder entfernt wird + // backwards, since most of the last is first removed short *pIter = pData + nUsed - 1; for ( USHORT n = 0; n < nUsed; ++n, --pIter ) if ( *pIter == aElem ) @@ -688,10 +686,10 @@ BOOL WordArr::Contains( const short rItem ) const void WordArr::Insert( USHORT nPos, short rElem ) { DBG_MEMTEST(); - // musz das Array umkopiert werden? + // Does the Array need to be copied? if ( nUnused == 0 ) { - // auf die naechste Grow-Grenze aufgerundet vergroeszern + // increase (rounded up) to the next Grow-border USHORT nNewSize = nUsed+nGrow; short* pNewData = new short[nNewSize]; @@ -705,11 +703,11 @@ void WordArr::Insert( USHORT nPos, short rElem ) pData = pNewData; } - // jetzt den hinteren Teil verschieben + // Now move the rear part if ( nPos < nUsed ) memmove( pData+nPos+1, pData+nPos, (nUsed-nPos)*sizeof(short) ); - // jetzt in den freien Raum schreiben + // now write at the back in the open space memmove( pData+nPos, &rElem, sizeof(short) ); nUsed += 1; nUnused -= 1; @@ -734,3 +732,4 @@ short& WordArr::operator [] (USHORT nPos) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/bastyp/misc.cxx b/sfx2/source/bastyp/misc.cxx index 822d337797..73117c0543 100644 --- a/sfx2/source/bastyp/misc.cxx +++ b/sfx2/source/bastyp/misc.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,9 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" -#ifndef GCC -#endif - #include "sfxtypes.hxx" //-------------------------------------------------------------------- @@ -73,3 +71,4 @@ String SfxStringDecode( const String &, const char * ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/bastyp/progress.cxx b/sfx2/source/bastyp/progress.cxx index f7d4737113..d703562c8b 100644 --- a/sfx2/source/bastyp/progress.cxx +++ b/sfx2/source/bastyp/progress.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -32,14 +33,12 @@ #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/task/XStatusIndicatorFactory.hpp> -#ifndef _SBX_HXX //autogen #include <basic/sbx.hxx> -#endif #include <svl/eitem.hxx> #include <tools/time.hxx> -// wg. nRescheduleLocks +// includes below due to nRescheduleLocks #include "appdata.hxx" #include <sfx2/request.hxx> #include <sfx2/frame.hxx> @@ -114,7 +113,7 @@ struct SfxProgress_Impl #define aTypeLibInfo aProgressTypeLibImpl //======================================================================== -extern ULONG Get10ThSec(); +extern sal_uInt32 Get10ThSec(); // ----------------------------------------------------------------------- @@ -150,31 +149,30 @@ SfxProgress_Impl::SfxProgress_Impl( const String &/*rTitle*/ ) SfxProgress::SfxProgress ( - SfxObjectShell* pObjSh, /* SfxObjectShell, an der die Aktion ausgef"uhrt - wird. Kann NULL sein, dann wird die Applikation - verwendet */ + SfxObjectShell* pObjSh, /* The action is performed on the + SfxObjectShell which can be NULL. + When it is then the application will be + used */ - const String& rText, /* Text, der in der Statuszeile vor den Statusmonitor - erscheint */ + const String& rText, /* Text, which appears before the Statusmonitor + in the status line */ - ULONG nRange, /* Maximalwert des Bereiches */ + ULONG nRange, /* Max value for range */ - BOOL bAll /* alle Dokumente oder nur das Dokument des ViewFrames - disablen (FALSE) */ - ,BOOL bWait /* initial den Wait-Pointer aktivieren (TRUE) */ + BOOL bAll /* Disable all documents or only the document of the ViewFram */ + ,BOOL bWait /* Aktivate the wait-Pointer initially (TRUE) */ ) -/* [Beschreibung] +/* [Description] - Der Konstruktor der Klasse SfxProgress schaltet den als Parameter - "ubergebenen SfxObjectShell und SfxViewFrames, welche dieses Dokument - anzeigen in einen Progress-Mode. D.h. solange eine dieser SfxViewFrame - Instanzen aktiv ist, ist der dazugeh"orige SfxDispatcher und das - dazugeh"orige Window disabled. In der Statuszeile wird ein Balken zur - Fortschritts-Anzeige angezeigt. + The constructor of the class SfxProgress switches the SfxObjectShell + passed as parameter and SfxViewFrames which display this document in + a progress mode. Ie as long as one of those SfxViewFrame instances is + active the associated SfxDispatcher and associated Window is disabled. + A progress-bar will be displayed in the status bar, */ -: pImp( new SfxProgress_Impl( rText ) ), +: pImp( new SfxProgress_Impl( rText ) ), nVal(0), bSuspended(TRUE) { @@ -207,11 +205,10 @@ SfxProgress::SfxProgress SfxProgress::~SfxProgress() -/* [Beschreibung] +/* [Description] - Der Destruktor der Klasse SfxProgress restauriert den alten Zustand; - die Dokumente werden wieder freigeschaltet und die Statuszeile zeigt - wieder Items an. + The destructor of the class SfxProgress restores the old status, + the documents are released again and the status bar shows the items again. */ { @@ -228,9 +225,9 @@ SfxProgress::~SfxProgress() void SfxProgress::Stop() -/* [Beschreibung] +/* [Description] - Vorzeitiges Beenden des <SfxProgress>. + Early Exit of <SfxProgress>. */ { @@ -259,13 +256,12 @@ void SfxProgress::Stop() void SfxProgress::SetText ( - const String& /* neuer Text */ + const String& /* new Text */ ) -/* [Beschreibung] +/* [Description] - "Andert den Text, der links neben dem Fortschritts-Balken - angezeigt wird. + Changes the text that appears to the left next to progress bar. */ { @@ -307,7 +303,7 @@ IMPL_STATIC_LINK( SfxProgress, SetStateHdl, PlugInLoadStatus*, pStatus ) // ----------------------------------------------------------------------- -// muss in AppDaten +// Required in App data static ULONG nLastTime = 0; long TimeOut_Impl( void*, void* pArgV ) @@ -327,9 +323,9 @@ long TimeOut_Impl( void*, void* pArgV ) BOOL SfxProgress::SetStateText ( - ULONG nNewVal, /* neuer Wert f"ur die Fortschritts-Anzeige */ - const String& rNewVal, /* Status als Text */ - ULONG nNewRange /* neuer Maximalwert, 0 f"ur Beibehaltung des alten */ + ULONG nNewVal, /* New value for the progress-bar */ + const String& rNewVal, /* Status as Text */ + ULONG nNewRange /* new maximum value, 0 for retaining the old */ ) { @@ -341,23 +337,21 @@ BOOL SfxProgress::SetStateText BOOL SfxProgress::SetState ( - ULONG nNewVal, /* neuer Wert f"ur die Fortschritts-Anzeige */ + ULONG nNewVal, /* new value for the progress bar */ - ULONG nNewRange /* neuer Maximalwert, 0 f"ur Beibehaltung des alten */ + ULONG nNewRange /* new maximum value, 0 for retaining the old */ ) -/* [Beschreibung] +/* [Description] - Setzen des aktuellen Status; nach einem zeitlichen Versatz - wird Reschedule aufgerufen. + Setting the current status, after a time delay Reschedule is called. - - [R"uckgabewert] + [Return value] BOOL TRUE - Fortfahren mit der Aktion + Proceed with the action FALSE - Abbrechen der Aktion + Cancel action */ { @@ -367,17 +361,14 @@ BOOL SfxProgress::SetState if( pImp->pActiveProgress ) return TRUE; - // neuen Wert "ubernehmen - BOOL bOver=FALSE; nVal = nNewVal; - // neuer Range? + // new Range? if ( nNewRange && nNewRange != pImp->nMax ) { DBG( DbgOutf( "SfxProgress: range changed from %lu to %lu", pImp->nMax, nNewRange ) ); pImp->nMax = nNewRange; - bOver = TRUE; } if ( !pImp->xStatusInd.is() ) @@ -443,11 +434,12 @@ BOOL SfxProgress::SetState void SfxProgress::Resume() -/* [Beschreibung] +/* [Description] - Nimmt die Anzeige des Status nach einer Unterbrechung wieder auf. + Resumed the status of the display after an interrupt. - [Querverweise] + [Cross-reference] + <SfxProgress::Suspend()> */ @@ -488,11 +480,12 @@ void SfxProgress::Resume() void SfxProgress::Suspend() -/* [Beschreibung] +/* [Description] - Unterbricht die Anzeige des Status + Interrupts the status of the display - [Querverweise] + [Cross-reference] + <SfxProgress::Resume()> */ @@ -530,8 +523,8 @@ void SfxProgress::Suspend() void SfxProgress::Lock() { if( pImp->pActiveProgress ) return; - // kein Reschedule bei Embedded-Objekten, - // da wir gegen das OLE Protokoll wehrlos sind + // No Reschedule for Embedded-Objects, + // because we are defenseless against the OLE protocol if ( !pImp->xObjSh.Is() ) { for ( SfxObjectShell *pDocSh = SfxObjectShell::GetFirst(); @@ -581,10 +574,9 @@ void SfxProgress::UnLock() void SfxProgress::Reschedule() -/* [Beschreibung] - - Reschedule von au"sen rufbar +/* [Description] + Reschedule, callable from the outside */ { @@ -608,17 +600,14 @@ void SfxProgress::Reschedule() void SfxProgress::SetWaitMode ( - BOOL bWait /* TRUE - Wartecursor wird verwendet + BOOL bWait /* TRUE Wait-cursor is used - FALSE - Es wird kein Wartecursor verwendet */ + FALSE Wait-cursor not used */ ) -/* [Beschreibung] - - Wartecursor-Modus umschalten. +/* [Description] + Switch Wait-mode. */ { @@ -656,10 +645,9 @@ void SfxProgress::SetWaitMode BOOL SfxProgress::GetWaitMode() const -/* [Beschreibung] - - Wartecursor-Modus abfragen. +/* [Description] + Get Wait-cursor mode. */ { @@ -670,36 +658,34 @@ BOOL SfxProgress::GetWaitMode() const SfxProgress* SfxProgress::GetActiveProgress ( - SfxObjectShell* pDocSh /* <SfxObjectShell>, die nach einem laufenden - <SfxProgress> gefragt werden soll, oder - 0, wenn ein f"ur die gesamte Applikation - laufender SfxProgress erfragt werden soll. - Der Pointer braucht nur zum Zeitpunkt des - Aufrufs g"ultig zu sein. */ + SfxObjectShell* pDocSh /* the <SfxObjectShell>, which should be + queried after a current <SfxProgress>, + or 0 if an current SfxProgress for the + entire application should be obtained. + The pointer only needs at the time of + the call to be valid. + */ ) -/* [Beschreibung] - - Mit dieser Methode kann erfragt werden, ob und welcher <SfxProgress>- - f"ur eine bestimmte Instanz von SfxObjectShell oder gar die gesamte - Applikation zur Zeit aktiv ist. Dies kann z.B. zum Abfangen von - Time-Out-Events etc. verwendet werden. - - Anstelle eines Pointer auf den SfxProgress der SfxObjectShell wird - ggf. der auf den SfxProgress der Applikation geliefert, mit der - Abfrage 'SfxProgress::GetActiveProgress(pMyDocSh)' wird also - insofern vorhanden der SfxProgress von 'pMyDocSh' geliefert, - sonst der SfxProgress der Applikation bzw. ein 0-Pointer. +/* [Description] + This method is used to check whether and which <SfxProgress> is currently + active for a specific instance of SfxObjectShell or even an entire + application. This can for example be used to check for Time-Out-Events, etc. - [Anmerkung] + Instead of a pointer to the SfxProgress the SfxObjectShell may be + pointed at the SfxProgress of the application, with the query + 'SfxProgress:: GetActiveProgress (pMyDocSh)' thus the current + SfxProgress of 'pMyDocSh' is delivered, otherwise the SfxProgress of + the application or a 0-pointer. - "auft kein SfxProgress an der Applikation und ebenfalls keiner an - der angegebenen SfxObjectShell, dann wird immer 0 zur"uckgeliefert, - auch wenn an einer anderen SfxObjectShell ein SfxProgress l"uft. + [Note] + If no SfxProgress is running in the application and also not at the + specified SfxObjectShell, then this method will always return 0, + even if one SfxProgress runs on another SfxObjectShell. - [Querverweise] + [Cross-reference] <SfxApplication::GetProgress()const> <SfxObjectShell::GetProgress()const> @@ -735,19 +721,19 @@ void SfxProgress::LeaveLock() // ----------------------------------------------------------------------- -FASTBOOL SfxProgress::StatusBarManagerGone_Impl +bool SfxProgress::StatusBarManagerGone_Impl ( - SfxStatusBarManager * // dieser <SfxStatusBarManager> wird zerst"ort + SfxStatusBarManager * // This <SfxStatusBarManager> will be destroyed ) -/* [Beschreibung] +/* [Description] - Interne Methode zum Benachrichtigen des SfxProgress, da\s der angegebene - SfxStatusBarManger zerst"ort wird. Damit der Progress ihn loslassen - kann. + Internal method for notifying the SfxProgress that the specified + SfxStatusBarManger will be destroyed so that the Progress can let go of it. */ { return TRUE; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/bastyp/sfxhtml.cxx b/sfx2/source/bastyp/sfxhtml.cxx index b649d9d925..3df8304fce 100644 --- a/sfx2/source/bastyp/sfxhtml.cxx +++ b/sfx2/source/bastyp/sfxhtml.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -57,9 +58,9 @@ using namespace ::com::sun::star; -sal_Char __FAR_DATA sHTML_MIME_text[] = "text/"; -sal_Char __FAR_DATA sHTML_MIME_application[] = "application/"; -sal_Char __FAR_DATA sHTML_MIME_experimental[] = "x-"; +sal_Char sHTML_MIME_text[] = "text/"; +sal_Char sHTML_MIME_application[] = "application/"; +sal_Char sHTML_MIME_experimental[] = "x-"; // <INPUT TYPE=xxx> static HTMLOptionEnum __READONLY_DATA aAreaShapeOptEnums[] = @@ -85,24 +86,24 @@ SfxHTMLParser::SfxHTMLParser( SvStream& rStream, BOOL bIsNewDoc, "SfxHTMLParser::SfxHTMLParser: Switch to UCS2?" ); // Altough the real default encoding is ISO8859-1, we use MS-1252 - // als default encoding. + // as default encoding. SetSrcEncoding( GetExtendedCompatibilityTextEncoding( RTL_TEXTENCODING_ISO_8859_1 ) ); // If the file starts with a BOM, switch to UCS2. SetSwitchToUCS2( TRUE ); } -__EXPORT SfxHTMLParser::~SfxHTMLParser() +SfxHTMLParser::~SfxHTMLParser() { - DBG_ASSERT( !pDLMedium, "Da ist ein File-Download stehengeblieben" ); + DBG_ASSERT( !pDLMedium, "Here is a File Download that has got stuck" ); delete pDLMedium; } BOOL SfxHTMLParser::ParseMapOptions(ImageMap * pImageMap, const HTMLOptions * pOptions) { - DBG_ASSERT( pImageMap, "ParseMapOptions: keine Image-Map" ); - DBG_ASSERT( pOptions, "ParseMapOptions: keine Optionen" ); + DBG_ASSERT( pImageMap, "ParseMapOptions: No Image-Map" ); + DBG_ASSERT( pOptions, "ParseMapOptions: No Options" ); String aName; @@ -128,8 +129,8 @@ BOOL SfxHTMLParser::ParseAreaOptions(ImageMap * pImageMap, const String& rBaseUR USHORT nEventMouseOver, USHORT nEventMouseOut ) { - DBG_ASSERT( pImageMap, "ParseAreaOptions: keine Image-Map" ); - DBG_ASSERT( pOptions, "ParseAreaOptions: keine Optionen" ); + DBG_ASSERT( pImageMap, "ParseAreaOptions: no Image-Map" ); + DBG_ASSERT( pOptions, "ParseAreaOptions: no Options" ); USHORT nShape = IMAP_OBJ_RECTANGLE; SvULongs aCoords; @@ -246,53 +247,48 @@ IMAPOBJ_SETEVENT: void SfxHTMLParser::StartFileDownload( const String& rURL, int nToken, SfxObjectShell *pSh ) { - DBG_ASSERT( !pDLMedium, "StartFileDwonload bei aktivem Download" ); + DBG_ASSERT( !pDLMedium, "StartFileDownload when active Download" ); if( pDLMedium ) return; pDLMedium = new SfxMedium( rURL, SFX_STREAM_READONLY, FALSE ); if( pSh ) { - // Medium registrieren, damit abgebrochen werden kann + // Register the medium, so that it can be stopped. pSh->RegisterTransfer( *pDLMedium ); - // Target-Frame uebertragen, damit auch javascript:-URLs - // "geladen" werden koennen. + // Transfer Target-Frame, so that also the javascript:-URLs + // can be "loaded". //const SfxMedium *pShMedium = pSh->GetMedium(); //if( pShMedium ) - // pDLMedium->SetLoadTargetFrame( pShMedium->GetLoadTargetFrame() ); + // pDLMedium->SetLoadTargetFrame( pShMedium->GetLoadTargetFrame() ); } - // Download anstossen (Achtung: Kann auch synchron sein). + // Push Download (Note: Can also be synchronous). if ( TRUE /*pMedium->GetDoneLink() == Link()*/ ) pDLMedium->DownLoad(); else { - // Downloading-Flag auf TRUE setzen. Es werden dann auch - // Data-Available-Links, wenn wir in den Pending-Staus gelangen. + // Set Downloading-Flag to TRUE. When we get into the Pending-status + // we will then also have Data-Available-Links. SetDownloadingFile( TRUE ); pDLMedium->DownLoad( STATIC_LINK( this, SfxHTMLParser, FileDownloadDone ) ); - // Wenn das Dowsnloading-Flag noch gesetzt ist erfolgt der Download - // asynchron. Wir gehen dann in den Pedning-Staus und warten dort. - // Solange sind alle Aufrufe des Data-Avaialble-Link gesperrt. + // If the Downloading-Flag is still set downloading will be done + // asynchronously. We will go into Pedning-status and wait there. + // As long as we are there all calls to the Data-Link Avaialble are + // locked. if( IsDownloadingFile() ) { - // Den aktuellen Zustand einfrieren und in den Pending-Status gehen. - // Wenn der Download beendet oder abgebrochen wurde, wird ueber - // NewDataRead ein Continue mit dem uebergeben Token angesteossen. + // Unfreeze the current state and go into the Pending-Status. + // When the download is completed or aborted, a Continue with + // the transfer token will be pushed by passedNewDataRead. SaveState( nToken ); eState = SVPAR_PENDING; } } } -BOOL SfxHTMLParser::GetFileDownloadMIME( String& rMIME ) -{ - return pDLMedium && pDLMedium->GetErrorCode()==0 && - pDLMedium->GetMIMEAndRedirect(rMIME)==0; -} - BOOL SfxHTMLParser::FinishFileDownload( String& rStr ) { String aStr; @@ -304,7 +300,7 @@ BOOL SfxHTMLParser::FinishFileDownload( String& rStr ) DBG_ASSERT( pStream, "Kein In-Stream vom Medium erhalten" ); SvMemoryStream aStream; - if( pStream ) // HACK wegen #65563# + if( pStream ) // HACK due to bug #65563# aStream << *pStream; aStream.Seek( STREAM_SEEK_TO_END ); @@ -314,17 +310,6 @@ BOOL SfxHTMLParser::FinishFileDownload( String& rStr ) ? (xub_StrLen)aStream.Tell() : STRING_MAXLEN; - // TODO: untested!!! - rtl_TextEncoding eEnc = - GetExtendedCompatibilityTextEncoding( RTL_TEXTENCODING_ISO_8859_1 ); - String sMime; - if( pDLMedium->GetMIMEAndRedirect( sMime ) == 0 ) - { - rtl_TextEncoding eMimeEnc = GetEncodingByMIME( sMime ); - if( RTL_TEXTENCODING_DONTKNOW != eMimeEnc ) - eEnc = eMimeEnc; - } - ByteString sBuffer; sal_Char* pBuffer = sBuffer.AllocBuffer(nLen); aStream.Seek( 0 ); @@ -340,11 +325,11 @@ BOOL SfxHTMLParser::FinishFileDownload( String& rStr ) IMPL_STATIC_LINK( SfxHTMLParser, FileDownloadDone, void*, EMPTYARG ) { - // Der Download ist jetzt abgeschlossen. Ausserdem muss/darf der - // Data-Available-Link wieder durchgelassen werden. + // The Download is now completed. also the Data-Available-Link + // must or are allowed to be passed through. pThis->SetDownloadingFile( FALSE ); - // ... und einmal aufrufen, damit weitergelesen wird. + // ... and call once, thus will continue reading. pThis->CallAsyncCallLink(); return 0; @@ -445,3 +430,4 @@ double SfxHTMLParser::GetTableDataOptionsValNum( sal_uInt32& nNumForm, return fVal; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/bastyp/sfxresid.cxx b/sfx2/source/bastyp/sfxresid.cxx index 361f52ea2d..6731d282cc 100644 --- a/sfx2/source/bastyp/sfxresid.cxx +++ b/sfx2/source/bastyp/sfxresid.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,8 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" -#ifndef GCC -#endif #include <tools/simplerm.hxx> #include "sfx2/sfxresid.hxx" @@ -71,3 +70,4 @@ void SfxResId::DeleteResMgr() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/config/evntconf.cxx b/sfx2/source/config/evntconf.cxx index c2308c7b61..96de652a54 100644 --- a/sfx2/source/config/evntconf.cxx +++ b/sfx2/source/config/evntconf.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -66,24 +67,20 @@ using namespace com::sun::star; SfxEventNamesList& SfxEventNamesList::operator=( const SfxEventNamesList& rTbl ) { DelDtor(); - for (USHORT n=0; n<rTbl.Count(); n++ ) + for ( size_t i = 0, n = rTbl.size(); i < n; ++i ) { - SfxEventName* pTmp = ((SfxEventNamesList&)rTbl).GetObject(n); - SfxEventName *pNew = new SfxEventName( *pTmp ); - Insert( pNew, n ); + SfxEventName* pTmp = rTbl.at( i ); + SfxEventName* pNew = new SfxEventName( *pTmp ); + aEventNamesList.push_back( pNew ); } return *this; } void SfxEventNamesList::DelDtor() { - SfxEventName* pTmp = First(); - while( pTmp ) - { - delete pTmp; - pTmp = Next(); - } - Clear(); + for ( size_t i = 0, n = aEventNamesList.size(); i < n; ++i ) + delete aEventNamesList[ i ]; + aEventNamesList.clear(); } int SfxEventNamesItem::operator==( const SfxPoolItem& rAttr ) const @@ -93,13 +90,13 @@ int SfxEventNamesItem::operator==( const SfxPoolItem& rAttr ) const const SfxEventNamesList& rOwn = aEventsList; const SfxEventNamesList& rOther = ( (SfxEventNamesItem&) rAttr ).aEventsList; - if ( rOwn.Count() != rOther.Count() ) + if ( rOwn.size() != rOther.size() ) return FALSE; - for ( USHORT nNo = 0; nNo < rOwn.Count(); ++nNo ) + for ( size_t nNo = 0, nCnt = rOwn.size(); nNo < nCnt; ++nNo ) { - const SfxEventName *pOwn = rOwn.GetObject(nNo); - const SfxEventName *pOther = rOther.GetObject(nNo); + const SfxEventName *pOwn = rOwn.at( nNo ); + const SfxEventName *pOther = rOther.at( nNo ); if ( pOwn->mnId != pOther->mnId || pOwn->maEventName != pOther->maEventName || pOwn->maUIName != pOther->maUIName ) @@ -145,7 +142,7 @@ USHORT SfxEventNamesItem::GetVersion( USHORT ) const void SfxEventNamesItem::AddEvent( const String& rName, const String& rUIName, USHORT nID ) { - aEventsList.Insert( new SfxEventName( nID, rName, rUIName.Len() ? rUIName : rName ) ); + aEventsList.push_back( new SfxEventName( nID, rName, rUIName.Len() ? rUIName : rName ) ); } @@ -173,17 +170,17 @@ uno::Any CreateEventData_Impl( const SvxMacro *pMacro ) uno::Sequence < beans::PropertyValue > aProperties(3); beans::PropertyValue *pValues = aProperties.getArray(); - ::rtl::OUString aType = ::rtl::OUString::createFromAscii( STAR_BASIC );; + ::rtl::OUString aType(RTL_CONSTASCII_USTRINGPARAM( STAR_BASIC )); ::rtl::OUString aLib = pMacro->GetLibName(); ::rtl::OUString aMacro = pMacro->GetMacName(); - pValues[ 0 ].Name = ::rtl::OUString::createFromAscii( PROP_EVENT_TYPE ); + pValues[ 0 ].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( PROP_EVENT_TYPE )); pValues[ 0 ].Value <<= aType; - pValues[ 1 ].Name = ::rtl::OUString::createFromAscii( PROP_LIBRARY ); + pValues[ 1 ].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( PROP_LIBRARY )); pValues[ 1 ].Value <<= aLib; - pValues[ 2 ].Name = ::rtl::OUString::createFromAscii( PROP_MACRO_NAME ); + pValues[ 2 ].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( PROP_MACRO_NAME )); pValues[ 2 ].Value <<= aMacro; aEventData <<= aProperties; @@ -196,10 +193,10 @@ uno::Any CreateEventData_Impl( const SvxMacro *pMacro ) ::rtl::OUString aLib = pMacro->GetLibName(); ::rtl::OUString aMacro = pMacro->GetMacName(); - pValues[ 0 ].Name = ::rtl::OUString::createFromAscii( PROP_EVENT_TYPE ); + pValues[ 0 ].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( PROP_EVENT_TYPE )); pValues[ 0 ].Value <<= aLib; - pValues[ 1 ].Name = ::rtl::OUString::createFromAscii( PROP_SCRIPT ); + pValues[ 1 ].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( PROP_SCRIPT )); pValues[ 1 ].Value <<= aMacro; aEventData <<= aProperties; @@ -211,10 +208,10 @@ uno::Any CreateEventData_Impl( const SvxMacro *pMacro ) ::rtl::OUString aMacro = pMacro->GetMacName(); - pValues[ 0 ].Name = ::rtl::OUString::createFromAscii( PROP_EVENT_TYPE ); - pValues[ 0 ].Value <<= ::rtl::OUString::createFromAscii(SVX_MACRO_LANGUAGE_JAVASCRIPT); + pValues[ 0 ].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( PROP_EVENT_TYPE )); + pValues[ 0 ].Value <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SVX_MACRO_LANGUAGE_JAVASCRIPT)); - pValues[ 1 ].Name = ::rtl::OUString::createFromAscii( PROP_MACRO_NAME ); + pValues[ 1 ].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( PROP_MACRO_NAME )); pValues[ 1 ].Value <<= aMacro; aEventData <<= aProperties; @@ -245,7 +242,7 @@ void PropagateEvent_Impl( SfxObjectShell *pDoc, rtl::OUString aEventName, const { xSupplier = uno::Reference < document::XEventsSupplier > ( ::comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString::createFromAscii("com.sun.star.frame.GlobalEventBroadcaster" )), uno::UNO_QUERY ); + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.GlobalEventBroadcaster"))), uno::UNO_QUERY ); } if ( xSupplier.is() ) @@ -291,3 +288,5 @@ SvxMacro* SfxEventConfiguration::ConvertToMacro( const com::sun::star::uno::Any& { return SfxEvents_Impl::ConvertToMacro( rElement, pDoc, bBlowUp ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx index ef0c1e80c3..ae4ce0819d 100644 --- a/sfx2/source/control/bindings.cxx +++ b/sfx2/source/control/bindings.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -49,10 +50,7 @@ #include <comphelper/processfactory.hxx> #include <svtools/itemdel.hxx> -#ifndef GCC -#endif - -// wg. nInReschedule +//Includes below due to nInReschedule #include "appdata.hxx" #include <sfx2/bindings.hxx> #include <sfx2/msg.hxx> @@ -151,33 +149,33 @@ public: SfxWorkWindow* pWorkWin; SfxBindings* pSubBindings; SfxBindings* pSuperBindings; - SfxStateCacheArr_Impl* pCaches; // je ein cache fuer jede gebundene - sal_uInt16 nCachedFunc1; // index der zuletzt gerufenen - sal_uInt16 nCachedFunc2; // index der vorletzt gerufenen - sal_uInt16 nMsgPos; // Message-Position, ab der zu aktualisieren ist - SfxPopupAction ePopupAction; // in DeleteFloatinWindow() abgefragt - sal_Bool bContextChanged; - sal_Bool bMsgDirty; // wurde ein MessageServer invalidiert? - sal_Bool bAllMsgDirty; // wurden die MessageServer invalidiert? - sal_Bool bAllDirty; // nach InvalidateAll - sal_Bool bCtrlReleased; // waehrend EnterRegistrations - AutoTimer aTimer; // fuer volatile Slots - sal_Bool bInUpdate; // fuer Assertions - sal_Bool bInNextJob; // fuer Assertions - sal_Bool bFirstRound; // Erste Runde im Update - sal_uInt16 nFirstShell; // Shell, die in erster Runde bevorzugt wird - sal_uInt16 nOwnRegLevel; // z"ahlt die echten Locks, ohne die der SuperBindings - InvalidateSlotMap m_aInvalidateSlots; // store slots which are invalidated while in update + SfxStateCacheArr_Impl* pCaches; // One chache for each binding + sal_uInt16 nCachedFunc1; // index for the last one called + sal_uInt16 nCachedFunc2; // index for the second last called + sal_uInt16 nMsgPos; // Message-Position relative the one to be updated + SfxPopupAction ePopupAction; // Checked in DeleteFloatinWindow() + sal_Bool bContextChanged; + sal_Bool bMsgDirty; // Has a MessageServer been invalidated? + sal_Bool bAllMsgDirty; // Has a MessageServer been invalidated? + sal_Bool bAllDirty; // After InvalidateAll + sal_Bool bCtrlReleased; // while EnterRegistrations + AutoTimer aTimer; // for volatile Slots + sal_Bool bInUpdate; // for Assertions + sal_Bool bInNextJob; // for Assertions + sal_Bool bFirstRound; // First round in Update + sal_uInt16 nFirstShell; // Shell, the first round is prefered + sal_uInt16 nOwnRegLevel; // Counts the real Locks, exept those of the Super Bindings + InvalidateSlotMap m_aInvalidateSlots; // store slots which are invalidated while in update }; //-------------------------------------------------------------------- struct SfxFoundCache_Impl { - sal_uInt16 nSlotId; // die Slot-Id - sal_uInt16 nWhichId; // falls verf"ugbar die Which-Id, sonst nSlotId - const SfxSlot* pSlot; // Pointer auf den <Master-Slot> - SfxStateCache* pCache; // Pointer auf den StatusCache, ggf. 0 + sal_uInt16 nSlotId; // the Slot-Id + sal_uInt16 nWhichId; // If available: Which-Id, else: nSlotId + const SfxSlot* pSlot; // Pointer to <Master-Slot> + SfxStateCache* pCache; // Pointer to StatusCache, if possible NULL SfxFoundCache_Impl(): nSlotId(0), @@ -217,7 +215,7 @@ SV_IMPL_OP_PTRARR_SORT(SfxFoundCacheArr_Impl, SfxFoundCache_Impl*); SfxBindings::SfxBindings() : pImp(new SfxBindings_Impl), pDispatcher(0), - nRegLevel(1) // geht erst auf 0, wenn Dispatcher gesetzt + nRegLevel(1) // first becomes 0, when the Dispatcher is set { pImp->nMsgPos = 0; pImp->bAllMsgDirty = sal_True; @@ -247,21 +245,20 @@ SfxBindings::SfxBindings() SfxBindings::~SfxBindings() -/* [Beschreibung] +/* [Description] - Destruktor der Klasse SfxBindings. Die eine, f"ur jede <SfxApplication> - existierende Instanz wird von der <SfxApplication> nach Ausf"urhung - von <SfxApplication::Exit()> automatisch zerst"ort. + Destructor of the SfxBindings class. The one, for each <SfxApplication> + existing Instance is automaticaölly destroyed by the <SfxApplication> + after the execution of <SfxApplication::Exit()>. - Noch existierende <SfxControllerItem> Instanzen, die bei dieser - SfxBindings Instanz angemeldet sind, werden im Destruktor - automatisch zerst"ort. Dies sind i.d.R. Floating-Toolboxen, Value-Sets - etc. Arrays von SfxControllerItems d"urfen zu diesem Zeitpunkt nicht - mehr exisitieren. + The still existing <SfxControllerItem> instances, which are registered + by the SfxBindings instance, are automatically destroyed in the Destructor. + These are usually the Floating-Toolboxen, Value-Sets + etc. Arrays of SfxControllerItems may at this time no longer exist. */ { - // Die SubBindings sollen ja nicht gelocked werden ! + // The SubBindings should not be locked! pImp->pSubBindings = NULL; ENTERREGISTRATIONS(); @@ -269,7 +266,7 @@ SfxBindings::~SfxBindings() pImp->aTimer.Stop(); DeleteControllers_Impl(); - // Caches selbst l"oschen + // Delete Caches sal_uInt16 nCount = pImp->pCaches->Count(); for ( sal_uInt16 nCache = 0; nCache < nCount; ++nCache ) delete pImp->pCaches->GetObject(nCache); @@ -284,19 +281,19 @@ SfxBindings::~SfxBindings() void SfxBindings::DeleteControllers_Impl() { - // in der ersten Runde den SfxPopupWindows l"oschen + // in the first round delete SfxPopupWindows sal_uInt16 nCount = pImp->pCaches->Count(); sal_uInt16 nCache; for ( nCache = 0; nCache < nCount; ++nCache ) { - // merken wo man ist + // Remember were you are SfxStateCache *pCache = pImp->pCaches->GetObject(nCache); sal_uInt16 nSlotId = pCache->GetId(); - // SfxPopupWindow l"oschen lassen + // Delete SfxPopupWindow pCache->DeleteFloatingWindows(); - // da der Cache verkleinert worden sein kann, wiederaufsetzen + // Re-align, because the cache may have been reduced sal_uInt16 nNewCount = pImp->pCaches->Count(); if ( nNewCount < nCount ) { @@ -308,13 +305,13 @@ void SfxBindings::DeleteControllers_Impl() } } - // alle Caches l"oschen + // Delete all Caches for ( nCache = pImp->pCaches->Count(); nCache > 0; --nCache ) { - // Cache via ::com::sun::star::sdbcx::Index besorgen + // Get Cache via ::com::sun::star::sdbcx::Index SfxStateCache *pCache = pImp->pCaches->GetObject(nCache-1); - // alle Controller in dem Cache unbinden + // unbind all controllers in the cache SfxControllerItem *pNext; for ( SfxControllerItem *pCtrl = pCache->GetItemLink(); pCtrl; pCtrl = pNext ) @@ -326,7 +323,7 @@ void SfxBindings::DeleteControllers_Impl() if ( pCache->GetInternalController() ) pCache->GetInternalController()->UnBind(); - // Cache l"oschen + // Delete Cache if( nCache-1 < pImp->pCaches->Count() ) delete (*pImp->pCaches)[nCache-1]; pImp->pCaches->Remove(nCache-1, 1); @@ -341,7 +338,7 @@ void SfxBindings::DeleteControllers_Impl() pCtrl->ReleaseBindings(); } - DBG_ASSERT( !pImp->pUnoCtrlArr->Count(), "UnoControllerItems nicht entfernt!" ); + DBG_ASSERT( !pImp->pUnoCtrlArr->Count(), "Do not remove UnoControllerItems!" ); DELETEZ( pImp->pUnoCtrlArr ); } } @@ -358,7 +355,7 @@ SfxPopupAction SfxBindings::GetPopupAction_Impl() const void SfxBindings::HidePopups( bool bHide ) { - // SfxPopupWindows hiden + // Hide SfxPopupWindows HidePopupCtrls_Impl( bHide ); SfxBindings *pSub = pImp->pSubBindings; while ( pSub ) @@ -367,22 +364,22 @@ void SfxBindings::HidePopups( bool bHide ) pSub = pSub->pImp->pSubBindings; } - // SfxChildWindows hiden + // Hide SfxChildWindows DBG_ASSERT( pDispatcher, "HidePopups not allowed without dispatcher" ); if ( pImp->pWorkWin ) pImp->pWorkWin->HidePopups_Impl( bHide, sal_True ); } -void SfxBindings::HidePopupCtrls_Impl( FASTBOOL bHide ) +void SfxBindings::HidePopupCtrls_Impl( bool bHide ) { if ( bHide ) { - // SfxPopupWindows hiden + // Hide SfxPopupWindows pImp->ePopupAction = SFX_POPUP_HIDE; } else { - // SfxPopupWindows showen + // Show SfxPopupWindows pImp->ePopupAction = SFX_POPUP_SHOW; } @@ -395,7 +392,7 @@ void SfxBindings::HidePopupCtrls_Impl( FASTBOOL bHide ) void SfxBindings::Update_Impl ( - SfxStateCache* pCache // der upzudatende SfxStatusCache + SfxStateCache* pCache // The up to date SfxStatusCache ) { if( pCache->GetDispatch().is() && pCache->GetItemLink() ) @@ -409,7 +406,7 @@ void SfxBindings::Update_Impl return; DBG_PROFSTART(SfxBindingsUpdate_Impl); - // alle mit derselben Statusmethode zusammensammeln, die dirty sind + // gather together all with the same status method which are dirty SfxDispatcher &rDispat = *pDispatcher; const SfxSlot *pRealSlot = 0; const SfxSlotServer* pMsgServer = 0; @@ -418,10 +415,10 @@ void SfxBindings::Update_Impl sal_Bool bUpdated = sal_False; if ( pSet ) { - // Status erfragen + // Query Status if ( rDispat._FillState( *pMsgServer, *pSet, pRealSlot ) ) { - // Status posten + // Post Status const SfxInterface *pInterface = rDispat.GetShell(pMsgServer->GetShellLevel())->GetInterface(); for ( sal_uInt16 nPos = 0; nPos < aFound.Count(); ++nPos ) @@ -442,8 +439,9 @@ void SfxBindings::Update_Impl if ( !bUpdated && pCache ) { - // Wenn pCache == NULL und kein SlotServer ( z.B. weil Dispatcher gelockt! ), - // darf nat"urlich kein Update versucht werden + // When pCache == NULL and no SlotServer + // (for example due to locked Dispatcher! ), + // obviously do not try to update SfxFoundCache_Impl aFoundCache( pCache->GetId(), 0, pRealSlot, pCache ); @@ -477,13 +475,13 @@ void SfxBindings::AddSlotToInvalidateSlotsMap_Impl( USHORT nId ) void SfxBindings::Update ( - sal_uInt16 nId // die gebundene und upzudatende Slot-Id + sal_uInt16 nId // the bound and up-to-date Slot-Id ) { DBG_MEMTEST(); DBG_ASSERT( pImp->pCaches != 0, "SfxBindings not initialized" ); -//!!TLX: Fuehrte zu Vorlagenkatalogstillstand +//!!TLX: leads to Template Gallery freeze // if ( nRegLevel ) // return; @@ -514,7 +512,7 @@ void SfxBindings::Update if ( bInternalUpdate ) { - // Status erfragen + // Query Status const SfxSlotServer* pMsgServer = pCache->GetSlotServer(*pDispatcher, pImp->xProv); if ( !pCache->IsControllerDirty() && ( !pMsgServer || @@ -572,10 +570,10 @@ void SfxBindings::Update() void SfxBindings::SetState ( - const SfxItemSet& rSet // zu setzende Status-Werte + const SfxItemSet& rSet // status values to be set ) { - // wenn gelockt, dann nur invalidieren + // when locked then only invalidate if ( nRegLevel ) { SfxItemIter aIter(rSet); @@ -586,12 +584,12 @@ void SfxBindings::SetState } else { - // Status d"urfen nur angenommen werden, wenn alle Slot-Pointer gesetzt sind + // Status may be accepted only if all slot-pointers are set if ( pImp->bMsgDirty ) UpdateSlotServer_Impl(); - // "uber das ItemSet iterieren, falls Slot gebunden, updaten - //! Bug: WhichIter verwenden und ggf. VoidItems hochschicken + // Iterate over the itemset, update if the slot bound + //! Bug: Use WhichIter and possibly send VoidItems up SfxItemIter aIter(rSet); for ( const SfxPoolItem *pItem = aIter.FirstItem(); pItem; @@ -601,12 +599,12 @@ void SfxBindings::SetState GetStateCache( rSet.GetPool()->GetSlotId(pItem->Which()) ); if ( pCache ) { - // Status updaten + // Update status if ( !pCache->IsControllerDirty() ) pCache->Invalidate(sal_False); pCache->SetState( SFX_ITEM_AVAILABLE, pItem ); - //! nicht implementiert: Updates von EnumSlots via MasterSlots + //! Not implemented: Updates from EnumSlots via master slots } } } @@ -616,7 +614,7 @@ void SfxBindings::SetState void SfxBindings::SetState ( - const SfxPoolItem& rItem // zu setzender Status-Wert + const SfxPoolItem& rItem // Status value to be set ) { if ( nRegLevel ) @@ -625,22 +623,22 @@ void SfxBindings::SetState } else { - // Status d"urfen nur angenommen werden, wenn alle Slot-Pointer gesetzt sind + // Status may be accepted only if all slot-pointers are set if ( pImp->bMsgDirty ) UpdateSlotServer_Impl(); - // falls der Slot gebunden ist, updaten + //update if the slot bound DBG_ASSERT( SfxItemPool::IsSlot( rItem.Which() ), "cannot set items with which-id" ); SfxStateCache* pCache = GetStateCache( rItem.Which() ); if ( pCache ) { - // Status updaten + // Update Status if ( !pCache->IsControllerDirty() ) pCache->Invalidate(sal_False); pCache->SetState( SFX_ITEM_AVAILABLE, &rItem ); - //! nicht implementiert: Updates von EnumSlots via MasterSlots + //! Not implemented: Updates from EnumSlots via master slots } } } @@ -658,13 +656,11 @@ SfxStateCache* SfxBindings::GetAnyStateCache_Impl( sal_uInt16 nId ) SfxStateCache* SfxBindings::GetStateCache ( - sal_uInt16 nId /* Slot-Id, deren SfxStatusCache gefunden - werden soll */, - sal_uInt16* pPos /* 0 bzw. Position, ab der die Bindings - bin"ar durchsucht werden sollen. Liefert - die Position zur"uck, an der nId gefunden - wurde, bzw. an der es einfef"ugt werden - w"urde. */ + sal_uInt16 nId, /* Slot-Id, which SfxStatusCache is to be found */ + sal_uInt16* pPos /* NULL for instance the position from which the + bindings are to be searched binary. Returns the + position back for where the nId was found, + or where it was inserted. */ ) { DBG_MEMTEST(); @@ -687,11 +683,8 @@ SfxStateCache* SfxBindings::GetStateCache void SfxBindings::InvalidateAll ( - sal_Bool bWithMsg /* sal_True - Slot-Server als ung"ultig markieren - - sal_False - Slot-Server bleiben g"ultig */ + sal_Bool bWithMsg /* sal_True Mark Slot Server as invalid + sal_False Slot Server remains valid */ ) { DBG_PROFSTART(SfxBindingsInvalidateAll); @@ -702,7 +695,7 @@ void SfxBindings::InvalidateAll if ( pImp->pSubBindings ) pImp->pSubBindings->InvalidateAll( bWithMsg ); - // ist schon alles dirty gesetzt oder downing => nicht zu tun + // everything is already set dirty or downing => nothing to do if ( !pDispatcher || ( pImp->bAllDirty && ( !bWithMsg || pImp->bAllMsgDirty ) ) || SFX_APP()->IsDowning() ) @@ -741,8 +734,8 @@ void SfxBindings::InvalidateAll void SfxBindings::Invalidate ( - const sal_uInt16* pIds /* numerisch sortiertes 0-terminiertes Array - von Slot-Ids (einzel, nicht als Paare!) */ + const sal_uInt16* pIds /* numerically sorted NULL-terminated array of + slot IDs (individual, not as a couple!) */ ) { DBG_PROFSTART(SfxBindingsInvalidateAll); @@ -764,27 +757,27 @@ void SfxBindings::Invalidate if ( pImp->pSubBindings ) pImp->pSubBindings->Invalidate( pIds ); - // ist schon alles dirty gesetzt oder downing => nicht zu tun + // everything is already set dirty or downing => nothing to do if ( !pDispatcher || pImp->bAllDirty || SFX_APP()->IsDowning() ) return; - // in immer kleiner werdenden Berichen bin"ar suchen + // Search binary in always smaller areas for ( sal_uInt16 n = GetSlotPos(*pIds); *pIds && n < pImp->pCaches->Count(); n = GetSlotPos(*pIds, n) ) { - // falls SID "uberhaupt gebunden ist, den Cache invalidieren + // If SID is ever bound, then invalidate the cache SfxStateCache *pCache = pImp->pCaches->GetObject(n); if ( pCache->GetId() == *pIds ) pCache->Invalidate(sal_False); - // n"achste SID + // Next SID if ( !*++pIds ) break; DBG_ASSERT( *pIds > *(pIds-1), "pIds unsorted" ); } - // falls nicht gelockt, Update-Timer starten + // if not enticed to start update timer pImp->nMsgPos = 0; if ( !nRegLevel ) { @@ -802,17 +795,15 @@ void SfxBindings::Invalidate void SfxBindings::InvalidateShell ( - const SfxShell& rSh /* Die <SfxShell>, deren Slot-Ids - invalidiert werden sollen. */, - - sal_Bool bDeep /* sal_True - auch die, von der SfxShell - ererbten Slot-Ids werden invalidert - - sal_False - die ererbten und nicht "uberladenen - Slot-Ids werden invalidiert */ - //! MI: z. Zt. immer bDeep + const SfxShell& rSh, /* <SfxShell>, which Slot-Ids should be + invalidated */ + sal_Bool bDeep /* sal_True + also inherited slot IDs of SfxShell are invalidert + + sal_False + the inherited and not overloaded Slot-Ids were + invalidiert */ + //! MI: for now alwayds bDeep ) { DBG_ASSERT( !pImp->bInUpdate, "SfxBindings::Invalidate while in update" ); @@ -834,11 +825,11 @@ void SfxBindings::InvalidateShell ( pImp->bAllDirty && pImp->bAllMsgDirty ) || SFX_APP()->IsDowning() ) { - // Wenn sowieso demn"achst alle Server geholt werden + // if the next one is anyway, then all the servers are collected return; } - // Level finden + // Find Level sal_uInt16 nLevel = pDispatcher->GetShellLevel(rSh); if ( nLevel != USHRT_MAX ) { @@ -868,7 +859,7 @@ void SfxBindings::InvalidateShell void SfxBindings::Invalidate ( - sal_uInt16 nId // zu invalidierende Slot-Id + sal_uInt16 nId // Status value to be set ) { DBG_MEMTEST(); @@ -906,9 +897,9 @@ void SfxBindings::Invalidate void SfxBindings::Invalidate ( - sal_uInt16 nId, // zu invalidierende Slot-Id - sal_Bool bWithItem, // StateCache clearen ? - sal_Bool bWithMsg // SlotServer neu holen ? + sal_uInt16 nId, // Status value to be set + sal_Bool bWithItem, // Clear StateCache? + sal_Bool bWithMsg // Get new SlotServer? ) { DBG_MEMTEST(); @@ -997,7 +988,7 @@ sal_uInt16 SfxBindings::GetSlotPos( sal_uInt16 nId, sal_uInt16 nStartSearchAt ) while ( !bFound && nLow <= nHigh ) { nMid = (nLow + nHigh) >> 1; - DBG_ASSERT( nMid < pImp->pCaches->Count(), "bsearch ist buggy" ); + DBG_ASSERT( nMid < pImp->pCaches->Count(), "bsearch is buggy" ); int nDiff = (int) nId - (int) ( ((*pImp->pCaches)[nMid])->GetId() ); if ( nDiff < 0) { if ( nMid == 0 ) @@ -1273,7 +1264,8 @@ void SfxBindings::Execute_Impl( SfxRequest& aReq, const SfxSlot* pSlot, SfxShell if ( SFX_KIND_ENUM == pSlot->GetKind() ) { - // bei Enum-Slots muss der Master mit dem Wert des Enums executet werden + // for Enum-Slots, the Master has to be excecuted with the value + // of the enums Wert const SfxSlot *pRealSlot = pShell->GetInterface()->GetRealSlot(pSlot); const sal_uInt16 nSlotId = pRealSlot->GetSlotId(); aReq.SetSlot( nSlotId ); @@ -1282,12 +1274,12 @@ void SfxBindings::Execute_Impl( SfxRequest& aReq, const SfxSlot* pSlot, SfxShell } else if ( SFX_KIND_ATTR == pSlot->GetKind() ) { - // bei Attr-Slots muss der Which-Wert gemapped werden + // Which value has to be mapped for Attribute slots const sal_uInt16 nSlotId = pSlot->GetSlotId(); aReq.SetSlot( nSlotId ); if ( pSlot->IsMode(SFX_SLOT_TOGGLE) ) { - // an togglebare-Attribs (Bools) wird der Wert angeheangt + // The value is attached to a toggleable attribute (Bools) sal_uInt16 nWhich = pSlot->GetWhich(rPool); SfxItemSet aSet(rPool, nWhich, nWhich, 0); SfxStateFunc aFunc = pSlot->GetStateFnc(); @@ -1307,7 +1299,7 @@ void SfxBindings::Execute_Impl( SfxRequest& aReq, const SfxSlot* pSlot, SfxShell { if ( pOldItem->ISA(SfxBoolItem) ) { - // wir koennen Bools toggeln + // we can toggle Bools sal_Bool bOldValue = ((const SfxBoolItem *)pOldItem)->GetValue(); SfxBoolItem *pNewItem = (SfxBoolItem*) (pOldItem->Clone()); pNewItem->SetValue( !bOldValue ); @@ -1317,7 +1309,7 @@ void SfxBindings::Execute_Impl( SfxRequest& aReq, const SfxSlot* pSlot, SfxShell else if ( pOldItem->ISA(SfxEnumItemInterface) && ((SfxEnumItemInterface *)pOldItem)->HasBoolValue()) { - // und Enums mit Bool-Interface + // and Enums with Bool-Interface SfxEnumItemInterface *pNewItem = (SfxEnumItemInterface*) (pOldItem->Clone()); pNewItem->SetBoolValue(!((SfxEnumItemInterface *)pOldItem)->GetBoolValue()); @@ -1330,21 +1322,21 @@ void SfxBindings::Execute_Impl( SfxRequest& aReq, const SfxSlot* pSlot, SfxShell } else if ( SFX_ITEM_DONTCARE == eState ) { - // ein Status-Item per Factory erzeugen + // Create one Status-Item for each Factory SfxPoolItem *pNewItem = pSlot->GetType()->CreateItem(); DBG_ASSERT( pNewItem, "Toggle an Slot ohne ItemFactory" ); pNewItem->SetWhich( nWhich ); if ( pNewItem->ISA(SfxBoolItem) ) { - // wir koennen Bools toggeln + // we can toggle Bools ((SfxBoolItem*)pNewItem)->SetValue( sal_True ); aReq.AppendItem( *pNewItem ); } else if ( pNewItem->ISA(SfxEnumItemInterface) && ((SfxEnumItemInterface *)pNewItem)->HasBoolValue()) { - // und Enums mit Bool-Interface + // and Enums with Bool-Interface ((SfxEnumItemInterface*)pNewItem)->SetBoolValue(sal_True); aReq.AppendItem( *pNewItem ); } @@ -1372,7 +1364,7 @@ void SfxBindings::UpdateSlotServer_Impl() DBG_MEMTEST(); DBG_ASSERT( pImp->pCaches != 0, "SfxBindings not initialized" ); - // synchronisieren + // synchronize pDispatcher->Flush(); // pDispatcher->Update_Impl(); @@ -1411,9 +1403,9 @@ int __cdecl CmpUS_Impl(const void *p1, const void *p2) int CmpUS_Impl(const void *p1, const void *p2) #endif -/* [Beschreibung] +/* [Description] - Interne Vergleichsfunktion fuer qsort. + Internal Comparison function for qsort. */ { @@ -1424,10 +1416,10 @@ int CmpUS_Impl(const void *p1, const void *p2) SfxItemSet* SfxBindings::CreateSet_Impl ( - SfxStateCache*& pCache, // in: Status-Cache von nId - const SfxSlot*& pRealSlot, // out: RealSlot zu nId - const SfxSlotServer** pMsgServer, // out: Slot-Server zu nId - SfxFoundCacheArr_Impl& rFound // out: Liste der Caches der Siblings + SfxStateCache*& pCache, // in: Status-Cache from nId + const SfxSlot*& pRealSlot, // out: RealSlot to nId + const SfxSlotServer** pMsgServer, // out: Slot-Server to nId + SfxFoundCacheArr_Impl& rFound // out: List of Caches for Siblings ) { DBG_MEMTEST(); @@ -1445,30 +1437,30 @@ SfxItemSet* SfxBindings::CreateSet_Impl sal_uInt16 nShellLevel = pMsgSvr->GetShellLevel(); SfxShell *pShell = pDispatcher->GetShell( nShellLevel ); - if ( !pShell ) // seltener GPF beim Browsen durch Update aus Inet-Notify + if ( !pShell ) // rare GPF when browsing through update from Inet-Notify return 0; SfxItemPool &rPool = pShell->GetPool(); - // hole die Status-Methode, von der pCache bedient wird + // get the status method, which is served by the pCache SfxStateFunc pFnc = 0; const SfxInterface *pInterface = pShell->GetInterface(); if ( SFX_KIND_ENUM == pMsgSvr->GetSlot()->GetKind() ) { pRealSlot = pInterface->GetRealSlot(pMsgSvr->GetSlot()); pCache = GetStateCache( pRealSlot->GetSlotId() ); -// DBG_ASSERT( pCache, "Kein Slotcache fuer den Masterslot gefunden!" ); +// DBG_ASSERT( pCache, "No slot cache found for the master slot!" ); } else pRealSlot = pMsgSvr->GetSlot(); // - // Achtung: pCache darf auch NULL sein !!! + // Note: pCache can be NULL! // pFnc = pRealSlot->GetStateFnc(); - // der RealSlot ist immer drin + // the RealSlot is always on const SfxFoundCache_Impl *pFound = new SfxFoundCache_Impl( pRealSlot->GetSlotId(), pRealSlot->GetWhich(rPool), pRealSlot, pCache ); rFound.Insert( pFound ); @@ -1477,24 +1469,23 @@ SfxItemSet* SfxBindings::CreateSet_Impl if ( !SfxMacroConfig::IsMacroSlot( nSlot ) && !(nSlot >= SID_VERB_START && nSlot <= SID_VERB_END) ) { pInterface = pInterface->GetRealInterfaceForSlot( pRealSlot ); - DBG_ASSERT (pInterface,"Slot in angegebener Shell nicht gefunden!"); + DBG_ASSERT (pInterface,"Slot in the given shell is not found"); } - // Durchsuche die Bindings nach den von derselben Funktion bedienten Slots. - // Daf"ur kommen nur Slots in Frage, die es im gefundenen Interface gibt. + // Search through the bindings for slots served by the same function. This , // will only affect slots which are present in the found interface. - // Die Position des Statecaches im StateCache-Array + // The position of the Statecaches in StateCache-Array sal_uInt16 nCachePos = pImp->nMsgPos; const SfxSlot *pSibling = pRealSlot->GetNextSlot(); - // Die Slots eines Interfaces sind im Kreis verkettet + // the Slots odf a interfaces ar linked in a circle while ( pSibling > pRealSlot ) { SfxStateFunc pSiblingFnc=0; SfxStateCache *pSiblingCache = GetStateCache( pSibling->GetSlotId(), &nCachePos ); - // Ist der Slot "uberhaupt gecached ? + // Is the slot cached ? if ( pSiblingCache ) { const SfxSlotServer *pServ = pSiblingCache->GetSlotServer(*pDispatcher, pImp->xProv); @@ -1502,34 +1493,34 @@ SfxItemSet* SfxBindings::CreateSet_Impl pSiblingFnc = pServ->GetSlot()->GetStateFnc(); } - // Mu\s der Slot "uberhaupt upgedatet werden ? - FASTBOOL bInsert = pSiblingCache && pSiblingCache->IsControllerDirty(); + // Does the slot have to be updated at all? + bool bInsert = pSiblingCache && pSiblingCache->IsControllerDirty(); - // Bugfix #26161#: Es reicht nicht, nach der selben Shell zu fragen !! - FASTBOOL bSameMethod = pSiblingCache && pFnc == pSiblingFnc; + // Bugfix #26161#: It is not enough to ask for the same shell!! + bool bSameMethod = pSiblingCache && pFnc == pSiblingFnc; - // Wenn der Slot ein nicht-dirty MasterSlot ist, dann ist vielleicht - // einer seiner Slaves dirty ? Dann wird der Masterslot doch eingef"ugt. + // If the slot is a non-dirty master slot, then maybe one of his slaves + // is dirty? Then the master slot is still inserted. if ( !bInsert && bSameMethod && pSibling->GetLinkedSlot() ) { - // auch Slave-Slots auf Binding pru"fen + // Also check slave slots for Binding const SfxSlot* pFirstSlave = pSibling->GetLinkedSlot(); for ( const SfxSlot *pSlaveSlot = pFirstSlave; !bInsert; pSlaveSlot = pSlaveSlot->GetNextSlot()) { - // Die Slaves zeigen auf ihren Master + // the slaves points to its master DBG_ASSERT(pSlaveSlot->GetLinkedSlot() == pSibling, - "Falsche Master/Slave-Beziehung!"); + "Wrong Master/Slave relationship!"); sal_uInt16 nCurMsgPos = pImp->nMsgPos; const SfxStateCache *pSlaveCache = GetStateCache( pSlaveSlot->GetSlotId(), &nCurMsgPos ); - // Ist der Slave-Slot gecached und dirty ? + // Is the slave slot chached and dirty ? bInsert = pSlaveCache && pSlaveCache->IsControllerDirty(); - // Slaves sind untereinander im Kreis verkettet + // Slaves are chained together in a circle if (pSlaveSlot->GetNextSlot() == pFirstSlave) break; } @@ -1547,20 +1538,20 @@ SfxItemSet* SfxBindings::CreateSet_Impl pSibling = pSibling->GetNextSlot(); } - // aus den Ranges ein Set erzeugen + // Create a Set from the ranges sal_uInt16 *pRanges = new sal_uInt16[rFound.Count() * 2 + 1]; int j = 0; USHORT i = 0; while ( i < rFound.Count() ) { pRanges[j++] = rFound[i]->nWhichId; - // aufeinanderfolgende Zahlen + // consecutive numbers for ( ; i < rFound.Count()-1; ++i ) if ( rFound[i]->nWhichId+1 != rFound[i+1]->nWhichId ) break; pRanges[j++] = rFound[i++]->nWhichId; } - pRanges[j] = 0; // terminierende NULL + pRanges[j] = 0; // terminating NULL SfxItemSet *pSet = new SfxItemSet(rPool, pRanges); delete [] pRanges; DBG_PROFSTOP(SfxBindingsCreateSet); @@ -1571,7 +1562,7 @@ SfxItemSet* SfxBindings::CreateSet_Impl void SfxBindings::UpdateControllers_Impl ( - const SfxInterface* pIF, // das diese Id momentan bedienende Interface + const SfxInterface* pIF, // Id of the current serving Interface const SfxFoundCache_Impl* pFound, // Cache, Slot, Which etc. const SfxPoolItem* pItem, // item to send to controller SfxItemState eState // state of item @@ -1585,18 +1576,18 @@ void SfxBindings::UpdateControllers_Impl const SfxSlot* pSlot = pFound->pSlot; DBG_ASSERT( !pCache || !pSlot || pCache->GetId() == pSlot->GetSlotId(), "SID mismatch" ); - // insofern gebunden, die Controller f"uer den Slot selbst updaten + // bound until now, the Controller to update the Slot. if ( pCache && pCache->IsControllerDirty() ) { if ( SFX_ITEM_DONTCARE == eState ) { - // uneindeuting + // ambiguous pCache->SetState( SFX_ITEM_DONTCARE, (SfxPoolItem *)-1 ); } else if ( SFX_ITEM_DEFAULT == eState && pFound->nWhichId > SFX_WHICH_MAX ) { - // kein Status oder Default aber ohne Pool + // no Status or Default but without Pool SfxVoidItem aVoid(0); pCache->SetState( SFX_ITEM_UNKNOWN, &aVoid ); } @@ -1608,8 +1599,8 @@ void SfxBindings::UpdateControllers_Impl DBG_PROFSTOP(SfxBindingsUpdateCtrl1); - // insofern vorhanden und gebunden, die Controller f"uer Slave-Slots - // (Enum-Werte) des Slots updaten + // Update the slots for so far available and bound Controllers for + // Slave-Slots (Enum-value) DBG_PROFSTART(SfxBindingsUpdateCtrl2); DBG_ASSERT( !pSlot || 0 == pSlot->GetLinkedSlot() || !pItem || pItem->ISA(SfxEnumItemInterface), @@ -1617,7 +1608,7 @@ void SfxBindings::UpdateControllers_Impl const SfxSlot *pFirstSlave = pSlot ? pSlot->GetLinkedSlot() : 0; if ( pIF && pFirstSlave) { - // Items auf EnumItem casten + // Items cast on EnumItem const SfxEnumItemInterface *pEnumItem = PTR_CAST(SfxEnumItemInterface,pItem); if ( eState == SFX_ITEM_AVAILABLE && !pEnumItem ) @@ -1625,14 +1616,14 @@ void SfxBindings::UpdateControllers_Impl else eState = SfxControllerItem::GetItemState( pEnumItem ); - // "uber alle Slaves-Slots iterieren + // Iterate over all Slaves-Slots for ( const SfxSlot *pSlave = pFirstSlave; pSlave; pSlave = pSlave->GetNextSlot() ) { - DBG_ASSERT(pSlave, "Falsche SlaveSlot-Verkettung!"); + DBG_ASSERT(pSlave, "Wrong SlaveSlot binding!"); DBG_ASSERT(SFX_KIND_ENUM == pSlave->GetKind(),"non enum slaves aren't allowed"); DBG_ASSERT(pSlave->GetMasterSlotId() == pSlot->GetSlotId(),"falscher MasterSlot!"); - // ist die Funktion gebunden? + // Binding exist for function ? SfxStateCache *pEnumCache = GetStateCache( pSlave->GetSlotId() ); if ( pEnumCache ) { @@ -1657,14 +1648,14 @@ void SfxBindings::UpdateControllers_Impl } else if ( SFX_ITEM_AVAILABLE == eState ) { - // enum-Wert ermitteln + // Determine enum value sal_uInt16 nValue = pEnumItem->GetEnumValue(); SfxBoolItem aBool( pFound->nWhichId, pSlave->GetValue() == nValue ); pEnumCache->SetState(SFX_ITEM_AVAILABLE, &aBool); } else { - // uneindeuting + // ambiguous pEnumCache->SetState( SFX_ITEM_DONTCARE, (SfxPoolItem *)-1 ); } } @@ -1683,8 +1674,8 @@ void SfxBindings::UpdateControllers_Impl IMPL_LINK( SfxBindings, NextJob_Impl, Timer *, pTimer ) { #ifdef DBG_UTIL - // on Windows very often C++ Exceptions (GPF etc.) are caught by MSVCRT or another MS library - // try to get them here + // on Windows very often C++ Exceptions (GPF etc.) are caught by MSVCRT + // or another MS library try to get them here try { #endif @@ -1722,7 +1713,7 @@ IMPL_LINK( SfxBindings, NextJob_Impl, Timer *, pTimer ) return sal_True; } - // gfs. alle Server aktualisieren / geschieht in eigener Zeitscheibe + // if possible Update all server / happens in its own time slice if ( pImp->bMsgDirty ) { UpdateSlotServer_Impl(); @@ -1736,7 +1727,7 @@ IMPL_LINK( SfxBindings, NextJob_Impl, Timer *, pTimer ) pImp->aTimer.SetTimeout(TIMEOUT_UPDATING); // at least 10 loops and further if more jobs are available but no input - FASTBOOL bPreEmptive = pTimer && !pSfxApp->Get_Impl()->nInReschedule; + bool bPreEmptive = pTimer && !pSfxApp->Get_Impl()->nInReschedule; sal_uInt16 nLoops = 10; pImp->bInNextJob = sal_True; const sal_uInt16 nCount = pImp->pCaches->Count(); @@ -1745,7 +1736,7 @@ IMPL_LINK( SfxBindings, NextJob_Impl, Timer *, pTimer ) // iterate through the bound functions sal_Bool bJobDone = sal_False; while ( !bJobDone ) - { + { SfxStateCache* pCache = (*pImp->pCaches)[pImp->nMsgPos]; DBG_ASSERT( pCache, "invalid SfxStateCache-position in job queue" ); sal_Bool bWasDirty = pCache->IsControllerDirty(); @@ -1755,8 +1746,6 @@ IMPL_LINK( SfxBindings, NextJob_Impl, Timer *, pTimer ) sal_Bool bSkip = sal_False; if ( pImp->bFirstRound ) { - // Falls beim Update eine Shell vorgezogen werden soll, - // kommt in einer ersten Update-Runde nur diese dran const SfxSlotServer *pMsgServer = pCache->GetSlotServer(*pDispatcher, pImp->xProv); if ( pMsgServer && @@ -1780,8 +1769,9 @@ IMPL_LINK( SfxBindings, NextJob_Impl, Timer *, pTimer ) bJobDone = pImp->nMsgPos >= nCount; if ( bJobDone && pImp->bFirstRound ) { - // Update der bevorzugten Shell ist gelaufen, nun d"urfen - // auch die anderen + + // Update of the preferred shell has been done, now may + // also the others shells be updated bJobDone = sal_False; pImp->bFirstRound = sal_False; pImp->nMsgPos = 0; @@ -1816,7 +1806,7 @@ IMPL_LINK( SfxBindings, NextJob_Impl, Timer *, pTimer ) else pImp->aTimer.Stop(); - // Update-Runde ist beendet + // Update round is finished pImp->bInNextJob = sal_False; Broadcast(SfxSimpleHint(SFX_HINT_UPDATEDONE)); DBG_PROFSTOP(SfxBindingsNextJob_Impl); @@ -1860,15 +1850,15 @@ sal_uInt16 SfxBindings::EnterRegistrations(const char *pFile, int nLine) DbgTrace( aMsg.GetBuffer() ); #endif - // Wenn Bindings gelockt werden, auch SubBindings locken + // When bindings are locked, also lock sub bindings. if ( pImp->pSubBindings ) { pImp->pSubBindings->ENTERREGISTRATIONS(); - // Dieses EnterRegistrations ist f"ur die SubBindings kein "echtes" + // These EnterRegistrations are not "real" for the SubBindings pImp->pSubBindings->pImp->nOwnRegLevel--; - // Bindings synchronisieren + // Synchronize Bindings pImp->pSubBindings->nRegLevel = nRegLevel + pImp->pSubBindings->pImp->nOwnRegLevel + 1; } @@ -1884,7 +1874,7 @@ sal_uInt16 SfxBindings::EnterRegistrations(const char *pFile, int nLine) pImp->nCachedFunc1 = 0; pImp->nCachedFunc2 = 0; - // merken, ob ganze Caches verschwunden sind + // Mark if the all of the Caches have dissapered. pImp->bCtrlReleased = sal_False; } @@ -1901,14 +1891,14 @@ void SfxBindings::LeaveRegistrations( sal_uInt16 nLevel, const char *pFile, int DBG_ASSERT( nRegLevel, "Leave without Enter" ); DBG_ASSERT( nLevel == USHRT_MAX || nLevel == nRegLevel, "wrong Leave" ); - // Nur wenn die SubBindings noch von den SuperBindings gelockt sind, diesen Lock entfernen - // ( d.h. wenn es mehr Locks als "echte" Locks dort gibt ) + // Only when the SubBindings are still locked by the Superbindings, + // remove this lock (i.e. if there are more locks than "real" ones) if ( pImp->pSubBindings && pImp->pSubBindings->nRegLevel > pImp->pSubBindings->pImp->nOwnRegLevel ) { - // Bindings synchronisieren + // Synchronize Bindings pImp->pSubBindings->nRegLevel = nRegLevel + pImp->pSubBindings->pImp->nOwnRegLevel; - // Dieses LeaveRegistrations ist f"ur die SubBindings kein "echtes" + // This LeaveRegistrations is not "real" for SubBindings pImp->pSubBindings->pImp->nOwnRegLevel++; pImp->pSubBindings->LEAVEREGISTRATIONS(); } @@ -1931,25 +1921,25 @@ void SfxBindings::LeaveRegistrations( sal_uInt16 nLevel, const char *pFile, int #ifndef slow SfxViewFrame* pFrame = pDispatcher->GetFrame(); - // ggf unbenutzte Caches entfernen bzw. PlugInInfo aufbereiten + // If possible remove unused Caches, for example prepare PlugInInfo if ( pImp->bCtrlReleased ) { for ( sal_uInt16 nCache = pImp->pCaches->Count(); nCache > 0; --nCache ) { - // Cache via ::com::sun::star::sdbcx::Index besorgen + // Get Cache via ::com::sun::star::sdbcx::Index SfxStateCache *pCache = pImp->pCaches->GetObject(nCache-1); - // kein Controller mehr interessiert + // No interested Controller present if ( pCache->GetItemLink() == 0 && !pCache->GetInternalController() ) { - // Cache entfernen. Safety: first remove and then delete + // Remove Cache. Safety: first remove and then delete SfxStateCache* pSfxStateCache = (*pImp->pCaches)[nCache-1]; pImp->pCaches->Remove(nCache-1, 1); delete pSfxStateCache; } else { - // neue Controller mit den alten Items benachrichtigen + // new controller to notify the old items //!pCache->SetCachedState(); } } @@ -1996,7 +1986,7 @@ const SfxSlot* SfxBindings::GetSlot(sal_uInt16 nSlotId) DBG_MEMTEST(); DBG_ASSERT( pImp->pCaches != 0, "SfxBindings not initialized" ); - // syncronisieren + // synchronizing pDispatcher->Flush(); if ( pImp->bMsgDirty ) UpdateSlotServer_Impl(); @@ -2040,7 +2030,7 @@ void SfxBindings::SetDispatcher( SfxDispatcher *pDisp ) { if ( pImp->pSubBindings && pImp->pSubBindings->pDispatcher != pOldDispat ) { - DBG_ERROR( "SubBindings vor Aktivieren schon gesetzt!" ); + DBG_ERROR( "SubBindings already set before activating!" ); pImp->pSubBindings->ENTERREGISTRATIONS(); } LEAVEREGISTRATIONS(); @@ -2050,7 +2040,7 @@ void SfxBindings::SetDispatcher( SfxDispatcher *pDisp ) ENTERREGISTRATIONS(); if ( pImp->pSubBindings && pImp->pSubBindings->pDispatcher != pOldDispat ) { - DBG_ERROR( "SubBindings im Deaktivieren immer noch gesetzt!" ); + DBG_ERROR( "SubBindings still set even when deactivating!" ); pImp->pSubBindings->LEAVEREGISTRATIONS(); } } @@ -2088,10 +2078,10 @@ void SfxBindings::StartUpdate_Impl( sal_Bool bComplete ) pImp->pSubBindings->StartUpdate_Impl( bComplete ); if ( !bComplete ) - // Update darf unterbrochen werden + // Update may be interrupted NextJob_Impl(&pImp->aTimer); else - // alle Slots am St"uck updaten + // Update all slots in a row NextJob_Impl(0); } @@ -2192,14 +2182,14 @@ SfxItemState SfxBindings::QueryState( sal_uInt16 nSlot, SfxPoolItem* &rpState ) } } - // Dann am Dispatcher testen; da die von dort zur"uckgegebenen Items immer - // DELETE_ON_IDLE sind, mu\s eine Kopie davon gezogen werden, um einen - // Eigent"umer"ubergang zu erm"oglichen + // Then test at the dispatcher to check if the returned items from + // there are always DELETE_ON_IDLE, a copy of it has to be made in + // order to allow for transition of ownership. const SfxPoolItem *pItem = NULL; SfxItemState eState = pDispatcher->QueryState( nSlot, pItem ); if ( eState == SFX_ITEM_SET ) { - DBG_ASSERT( pItem, "SFX_ITEM_SET aber kein Item!" ); + DBG_ASSERT( pItem, "SFX_ITEM_SET but no item!" ); if ( pItem ) rpState = pItem->Clone(); } @@ -2357,7 +2347,7 @@ BOOL SfxBindings::ExecuteCommand_Impl( const String& rCommand ) { ::com::sun::star::util::URL aURL; aURL.Complete = rCommand; - Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), UNO_QUERY ); + Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), UNO_QUERY ); xTrans->parseStrict( aURL ); ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDisp = pImp->xProv->queryDispatch( aURL, ::rtl::OUString(), 0 ); if ( xDisp.is() ) @@ -2367,7 +2357,7 @@ BOOL SfxBindings::ExecuteCommand_Impl( const String& rCommand ) ::rtl::OUString sAppName; try { - static ::rtl::OUString our_aModuleManagerName = ::rtl::OUString::createFromAscii("com.sun.star.frame.ModuleManager"); + static ::rtl::OUString our_aModuleManagerName(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.ModuleManager")); ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceManager = ::comphelper::getProcessServiceFactory(); ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager > xModuleManager( @@ -2378,7 +2368,7 @@ BOOL SfxBindings::ExecuteCommand_Impl( const String& rCommand ) sAppName = xModuleManager->identify(xFrame); } catch(::com::sun::star::uno::Exception&) {} Sequence<beans::PropertyValue> source; - ::comphelper::UiEventsLogger::appendDispatchOrigin(source, sAppName, ::rtl::OUString::createFromAscii("SfxAsyncExec")); + ::comphelper::UiEventsLogger::appendDispatchOrigin(source, sAppName, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SfxAsyncExec"))); ::comphelper::UiEventsLogger::logDispatch(aURL, source); } new SfxAsyncExec_Impl( aURL, xDisp ); @@ -2431,3 +2421,5 @@ uno::Reference < frame::XDispatch > SfxBindings::GetDispatch( const SfxSlot* pSl return xRet; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/control/ctrlitem.cxx b/sfx2/source/control/ctrlitem.cxx index 99dd04f3d4..2ff9d0c0a5 100644 --- a/sfx2/source/control/ctrlitem.cxx +++ b/sfx2/source/control/ctrlitem.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -47,11 +48,11 @@ DBG_NAME(SfxControllerItem); void SfxControllerItem::CheckConfigure_Impl( ULONG nType ) { - // echter Slot? (also kein Separator etc.) + // Real Slot? (i.e. no Separator etc.) if ( !nId ) return; - // ist die Id "uberhaupt in 'nType' konfigurierbar? + // is the ID configurable at all in 'nType'? const SfxSlot *pSlot = SFX_SLOTPOOL().GetSlot(nId); DBG_ASSERTWARNING( pSlot, "SfxControllerItem: binding not existing slot" ); if ( pSlot && !pSlot->IsMode(nType) ) @@ -65,7 +66,6 @@ void SfxControllerItem::CheckConfigure_Impl( ULONG nType ) #endif //-------------------------------------------------------------------- - // returns the next registered SfxControllerItem with the same id SfxControllerItem* SfxControllerItem::GetItemLink() @@ -76,7 +76,6 @@ SfxControllerItem* SfxControllerItem::GetItemLink() } //-------------------------------------------------------------------- - // returns TRUE if this binding is really bound to a function BOOL SfxControllerItem::IsBound() const @@ -87,23 +86,21 @@ BOOL SfxControllerItem::IsBound() const } //-------------------------------------------------------------------- - // returns the associated function-id or 0 if none // USHORT SfxControllerItem::GetId() const; //==================================================================== - // registeres with the id at the bindings void SfxControllerItem::Bind( USHORT nNewId, SfxBindings *pBindinx ) { DBG_MEMTEST(); DBG_CHKTHIS(SfxControllerItem, 0); - DBG_ASSERT(pBindings || pBindinx, "Keine Bindings"); + DBG_ASSERT(pBindings || pBindinx, "No Bindings"); if ( IsBound() ) { - DBG_ASSERT(pBindings, "Keine Bindings"); + DBG_ASSERT(pBindings, "No Bindings"); pBindings->Release(*this); } @@ -119,10 +116,10 @@ void SfxControllerItem::BindInternal_Impl( USHORT nNewId, SfxBindings *pBindinx { DBG_MEMTEST(); DBG_CHKTHIS(SfxControllerItem, 0); - DBG_ASSERT(pBindings || pBindinx, "Keine Bindings"); + DBG_ASSERT(pBindings || pBindinx, "No Bindings"); if ( IsBound() ) { - DBG_ASSERT(pBindings, "Keine Bindings"); + DBG_ASSERT(pBindings, "No Bindings"); pBindings->Release(*this); } @@ -139,14 +136,14 @@ void SfxControllerItem::BindInternal_Impl( USHORT nNewId, SfxBindings *pBindinx void SfxControllerItem::UnBind() -/* [Beschreibung] - - "ost die Verbindung dieses SfxControllerItems mit der SfxBindings-Instanz, - an der es zur Zeit gebunden ist. Ab diesem Zeitpunkt erh"alt es keine - Statusbenachrichtigungen (<SfxControllerItem::StateChented()>) mehr. +/* [Description] + Unbinds the connection of this SfxControllerItems with the SfxBindings + instance with which it to time is bound. From this time on it does not + receive any status notifications (<SfxControllerItem::StateChented()>) + anymore. - [Querverweise] + [Cross-reference] <SfxControllerItem::ReBind()> <SfxControllerItem::ClearCache()> @@ -154,7 +151,7 @@ void SfxControllerItem::UnBind() { DBG_MEMTEST(); DBG_CHKTHIS(SfxControllerItem, 0); - DBG_ASSERT(pBindings, "Keine Bindings"); + DBG_ASSERT(pBindings, "No Bindings"); DBG_ASSERT( IsBound(), "unbindings unbound SfxControllerItem" ); pBindings->Release(*this); @@ -165,14 +162,13 @@ void SfxControllerItem::UnBind() void SfxControllerItem::ReBind() -/* [Beschreibung] - - Binded dieses SfxControllerItem wieder an die SfxBindings-Instanz, - an der es zuletzt gebunden war. Ab diesem Zeitpunkt erh"alt es wieder - Statusbenachrichtigungen (<SfxControllerItem::StateChented()>). +/* [Description] + Binds this SfxControllerItem with the SfxBindings instance again, + with which it was last bound. From this time on it does receive status + notifications (<SfxControllerItem::StateChented()>) again. - [Querverweise] + [Cross-reference] <SfxControllerItem::UnBind()> <SfxControllerItem::ClearCache()> @@ -181,7 +177,7 @@ void SfxControllerItem::ReBind() { DBG_MEMTEST(); DBG_CHKTHIS(SfxControllerItem, 0); - DBG_ASSERT(pBindings, "Keine Bindings"); + DBG_ASSERT(pBindings, "No Bindings"); DBG_ASSERT( !IsBound(), "bindings rebound SfxControllerItem" ); pBindings->Register(*this); @@ -191,11 +187,11 @@ DBG_CHKTHIS(SfxControllerItem, 0); void SfxControllerItem::UpdateSlot() -/* [Beschreibung] +/* [Description] - Holt den Status 'hart' neu. + Get the Status again. - [Querverweise] + [Cross-reference] <SfxControllerItem::ClearCache()> */ @@ -212,24 +208,20 @@ void SfxControllerItem::UpdateSlot() void SfxControllerItem::ClearCache() -/* [Beschreibung] - - "oscht den Status-Cache f"ur dieses SfxControllerItem. D.h. beim - n"achsten Status-Update wird das <SfxPoolItem> auf jeden Fall geschickt, - auch wenn zuvor dasselbe geschickt wurde. Dies wird ben"otigt, wenn - ein Controller umgeschaltet werden kann und sich diesen Status - selbst merkt. +/* [Description] + Clears the cache status for this SfxControllerItem. That is by the next + status update is the <SfxPoolItem> sent in any case, even if the same was + sent before. This is needed if a controller can be switched on and note + that status themselves. - [Beispiel] + [Example] - Der Kombi-Controller f"ur das Einstellen des Fl"achentyps und der - konkreten Auspr"agung (Farbe blau oder Schraffur X) kann im Typ - umgestellt werden, wird jedoch dann bei der n"achsten Selektion - wieder benachrichtigt, auch wenn es dieselben Daten sind. + The combined controller for adjusting the surface type and the concrete + expression (blue color, or hatching X) can be changed in type, but is then + notified of the next selection again, even if it the same data. - - [Querverweise] + [Cross-reference] <SfxControllerItem::UnBind()> <SfxControllerItem::ReBind()> @@ -239,13 +231,12 @@ void SfxControllerItem::ClearCache() { DBG_MEMTEST(); DBG_CHKTHIS(SfxControllerItem, 0); - DBG_ASSERT(pBindings, "Keine Bindings"); + DBG_ASSERT(pBindings, "No Bindings"); pBindings->ClearCache_Impl( GetId() ); } //-------------------------------------------------------------------- - // replaces the successor in the list of bindings of the same id SfxControllerItem* SfxControllerItem::ChangeItemLink( SfxControllerItem* pNewLink ) @@ -258,7 +249,6 @@ SfxControllerItem* SfxControllerItem::ChangeItemLink( SfxControllerItem* pNewLin } //-------------------------------------------------------------------- - // changes the id of unbound functions (e.g. for sub-menu-ids) void SfxControllerItem::SetId( USHORT nItemId ) @@ -271,7 +261,7 @@ void SfxControllerItem::SetId( USHORT nItemId ) //-------------------------------------------------------------------- -// creates a atomic item for a controller without registration +// creates a atomic item for a controller without registration. SfxControllerItem::SfxControllerItem(): nId(0), @@ -283,7 +273,6 @@ SfxControllerItem::SfxControllerItem(): } //-------------------------------------------------------------------- - // creates a representation of the function nId and registeres it SfxControllerItem::SfxControllerItem( USHORT nID, SfxBindings &rBindings ): @@ -297,7 +286,6 @@ SfxControllerItem::SfxControllerItem( USHORT nID, SfxBindings &rBindings ): } //-------------------------------------------------------------------- - // unregisteres the item in the bindings SfxControllerItem::~SfxControllerItem() @@ -312,27 +300,29 @@ SfxControllerItem::~SfxControllerItem() void SfxControllerItem::StateChanged ( - USHORT , // <SID> des ausl"osenden Slot - SfxItemState , // <SfxItemState> von 'pState' - const SfxPoolItem* // Slot-Status, ggf. 0 oder IsInvalidItem() + USHORT, // <SID> of the triggering slot + SfxItemState, // <SfxItemState> of 'pState' + const SfxPoolItem* // Slot-Status, NULL or IsInvalidItem() ) -/* [Beschreibung] +/* [Description] - Diese virtuelle Methode wird vom SFx gerufen, um <SfxControllerItem>s - dar"uber zu benachrichtigen, da\s sich der Status des Slots 'nSID' - ge"andert hat. Der neue Wert sowie der von diesem Wert ermittelte - Status wird als 'pState' bzw. 'eState' mitgegeben. + This virtual method is called by the SFx to inform the <SfxControllerItem>s + is about that state of the slots 'NSID' has changed. The new value and the + value determined by this status is given as 'pState' or 'eState'. - Der Status eines Slots kann sich "andern, wenn z.B. das MDI-Fenster - gewechselt wird oder der Slot explizit mit <SfxBindings::Invalidate()> - invalidiert wurde. + The status of a slot may change, for example when the MDI window is + switched or when the slot was invalidated explicitly with + <SfxBindings::Invalidate()>. Achtung! Die Methode wird nicht gerufen, wenn der Slot ung"ultig wurde, danach jedoch wieder denselben Wert angenommen hat. - Diese Basisklasse braucht nicht gerufen zu werden, weitere Zwischenstufen - jedoch (z.B. <SfxToolboxControl>) sollten gerufen werden. + Beware! The method is not called when the slot is invalid, however + has again assumed the same value. + + This base class need not be called, further interim steps however + (eg <SfxToolboxControl> ) should be called. */ { @@ -352,9 +342,9 @@ void SfxControllerItem::DeleteFloatingWindow() void SfxStatusForwarder::StateChanged ( - USHORT nSID, // <SID> des ausl"osenden Slot - SfxItemState eState, // <SfxItemState> von 'pState' - const SfxPoolItem* pState // Slot-Status, ggf. 0 oder IsInvalidItem() + USHORT nSID, // <SID> of the triggering slot + SfxItemState eState, // <SfxItemState> of 'pState' + const SfxPoolItem* pState // Slot-Status, NULL or IsInvalidItem() ) { @@ -375,37 +365,35 @@ SfxStatusForwarder::SfxStatusForwarder( SfxItemState SfxControllerItem::GetItemState ( - const SfxPoolItem* pState /* Pointer auf das <SfxPoolItem>, dessen - Status erfragt werden soll. */ + const SfxPoolItem* pState /* Pointer to <SfxPoolItem>, which + Status should be queried. */ ) -/* [Beschreibung] +/* [Description] - Statische Methode zum Ermitteln des Status des SfxPoolItem-Pointers, - in der Methode <SfxControllerItem::StateChanged(const SfxPoolItem*)> - zu verwenden. + Static method to determine the status of the SfxPoolItem-Pointers, to be + used in the method <SfxControllerItem::StateChanged(const SfxPoolItem*)> - [R"uckgabewert] + [Return value] - SfxItemState SFX_ITEM_UNKNOWN - Enabled, aber keine weitere Statusinformation - verf"ugbar. Typisch f"ur <Slot>s, die allenfalls - zeitweise disabled sind, aber ihre Darstellung sonst - nicht "andern. + SfxItemState SFX_ITEM_UNKNOWN + Enabled, but no further status information available. + Typical for <Slot>s, which anyway are sometimes + disabled, but otherwise do not change their appearance. SFX_ITEM_DISABLED - Disabled und keine weiter Statusinformation - verf"ugbar. Alle anderen ggf. angezeigten Werte sollten - auf den Default zur"uckgesetzt werden. + Disabled and no further status information available. + All other values that may appear should be reset to + default. SFX_ITEM_DONTCARE - Enabled aber es waren nur uneindeutige Werte - verf"ugbar (also keine, die abgefragt werden k"onnen). + Enabled but there were only ambiguous values available + (i.e. non that can be queried). SFX_ITEM_AVAILABLE - Enabled und mit verf"ugbarem Wert, der von 'pState' - erfragbar ist. Der Typ ist dabei im gesamten - Programm eindeutig und durch den Slot festgelegt. + Enabled and with available values, which are queried + by 'pState'. The Type is thus clearly defined in the + entire Program and specified through the Slot. */ { @@ -422,10 +410,10 @@ SfxItemState SfxControllerItem::GetItemState SfxMapUnit SfxControllerItem::GetCoreMetric() const -/* [Beschreibung] +/* [Description] - Holt vom zust"andigen Pool die Ma\seinheit ab, in der das Status-Item - vorliegt. + Gets the measurement unit from the competent pool, in which the Status + item exist. */ { @@ -463,4 +451,4 @@ SfxMapUnit SfxControllerItem::GetCoreMetric() const #pragma optimize("g",off) #endif - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index 3660e7cfac..80c3ab88c9 100755 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -40,11 +41,10 @@ #include <svl/undo.hxx> #ifndef _WRKWIN_HXX //autogen #include <vcl/wrkwin.hxx> -#endif #include <svtools/ttprops.hxx> #include <stdio.h> #include <stdarg.h> -#include <stdlib.h> // wg. bsearch +#include <stdlib.h> // due to bsearch #define _SVSTDARR_ULONGS #include <svl/svstdarr.hxx> @@ -52,10 +52,7 @@ #include <com/sun/star/frame/XLayoutManager.hpp> #include <com/sun/star/beans/XPropertySet.hpp> -#ifndef GCC -#endif - -// wg. nAutoPageID +// due to nAutoPageID #include "appdata.hxx" #include "sfx2/sfxhelp.hxx" #include <sfx2/dispatch.hxx> @@ -99,10 +96,10 @@ DECL_PTRSTACK(SfxShellStack_Impl, SfxShell*, 8, 4 ); struct SfxToDo_Impl { - SfxShell* pCluster; - bool bPush; - bool bDelete; - bool bUntil; + SfxShell* pCluster; + bool bPush; + bool bDelete; + bool bUntil; SfxToDo_Impl() : pCluster(0) @@ -127,10 +124,10 @@ IMPL_OBJSTACK(SfxToDoStack_Impl, SfxToDo_Impl); struct SfxObjectBars_Impl { - sal_uInt32 nResId; // Resource - und ConfigId der Toolbox - sal_uInt16 nMode; // spezielle Sichtbarkeitsflags - String aName; - SfxInterface* pIFace; + sal_uInt32 nResId; // Resource - and ConfigId of the Toolbox + sal_uInt16 nMode; // special visibility flags + String aName; + SfxInterface* pIFace; SfxObjectBars_Impl() : nResId( 0 ) @@ -141,42 +138,43 @@ struct SfxObjectBars_Impl struct SfxDispatcher_Impl { - SfxRequestPtrArray aReqArr; - const SfxSlotServer* pCachedServ1; // zuletzt gerufene Message - const SfxSlotServer* pCachedServ2; // vorletzt gerufene Message - SfxShellStack_Impl aStack; // aktive Funktionalitaet - Timer aTimer; // fuers flushen - SfxToDoStack_Impl aToDoStack; // nicht abgearb. Push/Pop - SfxViewFrame* pFrame; // 0 oder zugeh"or. Frame - SfxDispatcher* pParent; // z.B. AppDispatcher, ggf. 0 - SfxHintPosterRef xPoster; // asynchrones Execute - sal_Bool bFlushing; // sal_True waehrend Flush //? - sal_Bool bUpdated; // Update_Impl gelaufen - sal_Bool bLocked; // kein Execute - sal_Bool bInvalidateOnUnlock;// da fragte jemand - sal_Bool bActive; // nicht verwechseln mit gesetzt! - sal_Bool* pInCallAliveFlag; // dem Stack den Dtor anzeigen - SfxObjectBars_Impl aObjBars[SFX_OBJECTBAR_MAX]; - SfxObjectBars_Impl aFixedObjBars[SFX_OBJECTBAR_MAX]; - SvULongs aChildWins; - sal_uInt16 nActionLevel; // in EnterAction - sal_uInt32 nEventId; // EventId UserEvent - sal_Bool bUILocked; // Update abgeklemmt (!zappeln) - sal_Bool bNoUI; // UI nur vom Parent Dispatcher - sal_Bool bReadOnly; // Dokument ist ReadOnly - sal_Bool bQuiet; // nur parent dispatcher verwenden - sal_Bool bModal; // nur Slots vom Parent-Dispatcher - - sal_Bool bFilterEnabling; // sal_True=filter enabled slots, 2==ReadOnlyDoc uebersteuert - sal_uInt16 nFilterCount; // Anzahl der SIDs in pFilterSIDs - const sal_uInt16* pFilterSIDs; // sortiertes Array von SIDs - sal_uInt16 nStandardMode; // ExecuteMode f. PlugInDispatcher - SvUShorts* pDisableList; - sal_uInt32 nDisableFlags; + SfxRequestPtrArray aReqArr; + const SfxSlotServer* pCachedServ1; // last called message + const SfxSlotServer* pCachedServ2; // penultimate called Message + SfxShellStack_Impl aStack; // active functionality + Timer aTimer; // for Flush + SfxToDoStack_Impl aToDoStack; // not processed Push/Pop + SfxViewFrame* pFrame; // NULL or associated Frame + SfxDispatcher* pParent; // AppDispatcher, NULL if possible + SfxHintPosterRef xPoster; // Execute asynchronous + sal_Bool bFlushing; // sal_True during Flush //? + sal_Bool bUpdated; // Update_Impl has run + sal_Bool bLocked; // No Execute + sal_Bool bInvalidateOnUnlock; // because someone asked + sal_Bool bActive; // not to be confused with set! + sal_Bool* pInCallAliveFlag; // view the Destructor Stack + SfxObjectBars_Impl aObjBars[SFX_OBJECTBAR_MAX]; + SfxObjectBars_Impl aFixedObjBars[SFX_OBJECTBAR_MAX]; + SvULongs aChildWins; + sal_uInt16 nActionLevel; // in EnterAction + sal_uInt32 nEventId; // EventId UserEvent + sal_Bool bUILocked; // Update disconnected (no flicker) + sal_Bool bNoUI; // UI only from Parent Dispatcher + sal_Bool bReadOnly; // Document is ReadOnly + sal_Bool bQuiet; // Only use parent dispatcher + sal_Bool bModal; // Only slots from parent dispatcher + + sal_Bool bFilterEnabling; // sal_True=filter enabled slots, + // 2==ReadOnlyDoc overturned + sal_uInt16 nFilterCount; // Number of SIDs in pFilterSIDs + const sal_uInt16* pFilterSIDs; // sorted Array of SIDs + sal_uInt16 nStandardMode; // ExecuteMode from PlugInDispatcher + SvUShorts* pDisableList; + sal_uInt32 nDisableFlags; }; -#define NO_OBJECTBAR 0 -#define OWN_OBJECTBAR 1 +#define NO_OBJECTBAR 0 +#define OWN_OBJECTBAR 1 #define OTHER_OBJECTBAR 2 //------------------------------------------------------------------ @@ -186,18 +184,17 @@ struct SfxDispatcher_Impl //==================================================================== sal_Bool SfxDispatcher::IsLocked( sal_uInt16 ) const -/* [Beschreibung] +/* [Description] - Mit dieser Methode kann festgestellt werden, ob der SfxDispatcher - gesperrt oder freigegeben ist. Ein gesperrter SfxDispatcher - f"uhrt keine <SfxRequest>s mehr aus und liefert keine - Status-Informationen mehr. Er verh"alt sich so als w"aren alle - Slots disabled. + With this method it can be determined whether the SfxDispatcher is + locked or unlocked. A locked SfxDispatcher does not perform <SfxRequest>s + and no longer provides any status information. It behaves as if all the + slots are disabled. - Der Dispatcher gilt auch als gesperrt, wenn alle Dispatcher - gelockt sind (<SfxApplication::LockDispatcher()>) oder der zugeh"orige - Top-Frame im modal-mode ist und der angegebene Slot Frame-spezifisch - (also nicht von der Application) bedient wird. + The dispatcher is also marked as blocked, if all Dispatcher are locked + (<SfxApplication::LockDispatcher()>) or the associated top frame is in the + modal-mode and if the specified slot are handled as frame-specific + (ie, not served by the application). */ { @@ -207,19 +204,15 @@ sal_Bool SfxDispatcher::IsLocked( sal_uInt16 ) const //-------------------------------------------------------------------- sal_Bool SfxDispatcher::IsAppDispatcher() const -/* [Beschreibung] - - Mit dieser Methode l"a\st sich festellen, ob der SfxDispacher der - Applikations-Dispatcher ist. +/* [Description] + With this method it can be determined if the SfxDispacher is the + applications dispatcher. - [R"uckgabewert] + [Return value] - sal_Bool sal_True - Es ist der Applikations-Dispatcher. - - sal_False - Es ist ein Dispatcher eines SfxViewFrame. + sal_Bool sal_True it is the application dispatcher. + sal_Fals it is a SfxViewFrame dispatcher. */ { @@ -229,10 +222,10 @@ sal_Bool SfxDispatcher::IsAppDispatcher() const //-------------------------------------------------------------------- int SfxDispatcher::Call_Impl( SfxShell& rShell, const SfxSlot &rSlot, SfxRequest &rReq, sal_Bool bRecord ) -/* [Beschreibung] +/* [Description] - Hilfsfunktion zum pr"ufen, ob ein Slot executed werden darf und - der Execution selbst. + Helper function to check whether a slot can be executed and + check the execution itself */ { @@ -243,7 +236,7 @@ int SfxDispatcher::Call_Impl( SfxShell& rShell, const SfxSlot &rSlot, SfxRequest { if ( GetFrame() ) { - // ggf. Recording anwerfen + // Recording may start com::sun::star::uno::Reference< com::sun::star::frame::XFrame > xFrame( GetFrame()->GetFrame().GetFrameInterface(), com::sun::star::uno::UNO_QUERY); @@ -254,7 +247,7 @@ int SfxDispatcher::Call_Impl( SfxShell& rShell, const SfxSlot &rSlot, SfxRequest if ( xSet.is() ) { - com::sun::star::uno::Any aProp = xSet->getPropertyValue(::rtl::OUString::createFromAscii("DispatchRecorderSupplier")); + com::sun::star::uno::Any aProp = xSet->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DispatchRecorderSupplier"))); com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorderSupplier > xSupplier; com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorder > xRecorder; aProp >>= xSupplier; @@ -265,9 +258,8 @@ int SfxDispatcher::Call_Impl( SfxShell& rShell, const SfxSlot &rSlot, SfxRequest rReq.Record_Impl( rShell, rSlot, xRecorder, GetFrame() ); } } - - // Alles holen, was gebraucht wird, da der Slot den Execute evtl. nicht - // "uberlebt, falls es ein 'Pseudoslot' f"ur Macros oder Verben ist + // Get all that is needed, because the slot may not have survived the + // Execute if it is a 'pseudo slot' for macros or verbs. sal_Bool bAutoUpdate = rSlot.IsMode(SFX_SLOT_AUTOUPDATE); // API-Call-Klammerung und Document-Lock w"ahrend des Calls @@ -290,14 +282,14 @@ int SfxDispatcher::Call_Impl( SfxShell& rShell, const SfxSlot &rSlot, SfxRequest SfxExecFunc pFunc = rSlot.GetExecFnc(); rShell.CallExec( pFunc, rReq ); - // falls 'this' noch lebt + // If 'this' is still alive if ( bThisDispatcherAlive ) pImp->pInCallAliveFlag = pOldInCallAliveFlag; else { if ( pOldInCallAliveFlag ) { - // auch verschachtelte Stack-Frames sch"utzen + // also protect nested stack frames *pOldInCallAliveFlag = sal_False; } @@ -310,14 +302,14 @@ int SfxDispatcher::Call_Impl( SfxShell& rShell, const SfxSlot &rSlot, SfxRequest { SfxBindings *pBindings = GetBindings(); - // bei AutoUpdate sofort updaten; "Pseudoslots" d"urfen nicht - // Autoupdate sein! + // When AutoUpdate update immediately; "Pseudoslots" must not be + // Autoupdate! if ( bAutoUpdate && pBindings ) { const SfxSlot* pSlave = rSlot.GetLinkedSlot(); if (pSlave) { - // bei Enum-Slots irgendeinen gebundenen Slave-Slot nehmen + // When enum slots take any bound slave slot while (!pBindings->IsBound(pSlave->GetSlotId()) && pSlave != &rSlot ) pSlave = pSlave->GetLinkedSlot(); pBindings->Invalidate(pSlave->GetSlotId()); @@ -388,11 +380,10 @@ SfxDispatcher::SfxDispatcher( SfxDispatcher* pParent ) SfxDispatcher::SfxDispatcher( SfxViewFrame *pViewFrame ) -/* [Beschreibung] +/* [Description] - Der Konstruktor der Klasse SfxDispatcher legt einen leeren Stack - von <SfxShell>-Pointern an. Er ist initial nicht gelockt und gilt als - geflusht. + The constructor of the SfxDispatcher class places a stack of empty + <SfxShell> pointers. It is not initially locked and is considered flushed. */ { @@ -412,11 +403,11 @@ SfxDispatcher::SfxDispatcher( SfxViewFrame *pViewFrame ) //==================================================================== SfxDispatcher::~SfxDispatcher() -/* [Beschreibung] +/* [Description] - Der Destruktor der Klasse SfxDispatcher darf nicht gerufen werden, - wenn die SfxDispatcher-Instanz aktiv ist. Es d"urfen sich allerdings - noch <SfxShell>-Pointer auf dem Stack befinden. + The destructor of the SfxDispatcher class should not be called when the + SfxDispatcher instance is active. It may, however, still be a <SfxShell> + pointer on the stack. */ { @@ -427,27 +418,26 @@ SfxDispatcher::~SfxDispatcher() DBG_ASSERT( !pImp->bActive, "deleting active Dispatcher" ); #endif - // Damit in LeaveRegistrations kein Timer per Reschedule in PlugComm - // zuschlaegt + // So that no timer by Reschedule in PlugComm strikes the LeaveRegistrations pImp->aTimer.Stop(); pImp->xPoster->SetEventHdl( Link() ); - // die Stack-Varialblem in Call_Impl benachrichtigen + // Notify the stack varialbles in Call_Impl if ( pImp->pInCallAliveFlag ) *pImp->pInCallAliveFlag = sal_False; - // Bindings und App besorgen + // Get bindings and application SfxApplication *pSfxApp = SFX_APP(); SfxBindings* pBindings = GetBindings(); -// if (pImp->nEventId) -// pSfxApp->RemoveEventHdl(pImp->nEventId); +// if (pImp->nEventId) +// pSfxApp->RemoveEventHdl(pImp->nEventId); - // wenn noch nicht flushed, die Bindings wiederbeleben + // When not flushed, revive the bindings if ( pBindings && !pSfxApp->IsDowning() && !bFlushed ) pBindings->DLEAVEREGISTRATIONS(); - // ggf. bei den Bindings abmelden + // may unregister the bindings while ( pBindings ) { if ( pBindings->GetDispatcher_Impl() == this) @@ -461,27 +451,27 @@ SfxDispatcher::~SfxDispatcher() //==================================================================== void SfxDispatcher::Pop ( - SfxShell& rShell, /* Die vom Stack zu nehmende SfxShell-Instanz. */ - - sal_uInt16 nMode /* SFX_SHELL_POP_UNTIL - Es werden auch alle "uber 'rShell' liegenenden - SfxShell's vom Stack genommen. - - SFX_SHELL_POP_DELETE - Alle tats"achlich vom Stack genommenen - SfxShells werden gel"oscht. - - SFX_SHELL_PUSH (InPlace use only) - Die Shell wird gepusht. */ + SfxShell& rShell, /* the stack to take the SfxShell instance. */ + + sal_uInt16 nMode /* SFX_SHELL_POP_UNTIL + Also all 'rShell' of SfxShells are taken from the + stack. + + SFX_SHELL_POP_DELETE + All SfxShells actually taken from the stack + will be deleted. + + SFX_SHELL_PUSH (InPlace use only) + The Shell is pushed. */ ) -/* [Beschreibung] - - Mit dieser Methode wird eine oder mehrere <SfxShell> vom SfxDispatcher - gepoppt. Die SfxShell wird zun"achst zum poppen vermerkt und - es wird ein Timer aufgesetzt. Erst bei Ablauf des Timers wird - tats"achlich gepoppt (<SfxDispatcher::Flush()>) und die <SfxBindings> - werden invalidiert. W"ahrend der Timer l"auft gleichen sich - entgegengesetzte Push und Pop Befehle mit derselben SfxShell aus. +/* [Description] + + With this method, one or more <SfxShell> are poped from the SfxDispatcher. + The SfxShell is marked for popping and a timer is set up. Only when the + timer has reached the end, the pop is actually performed + ( <SfxDispatcher::Flush()> ) and the <SfxBindings> is invalidated. + While the timer is running the opposing push and pop commands on one + SfxShell cancel each other out. */ { @@ -489,8 +479,8 @@ void SfxDispatcher::Pop DBG_ASSERT( rShell.GetInterface(), "pushing SfxShell without previous RegisterInterface()" ); DBG_ASSERT( pImp->nActionLevel == 0, "Push or Pop within Action" ); -// DBG_ASSERT( SFX_APP()->IsInAsynchronCall_Impl(), -// "Dispatcher Push/Pop in synchron-call-stack" ); +// DBG_ASSERT( SFX_APP()->IsInAsynchronCall_Impl(), +// "Dispatcher Push/Pop in synchron-call-stack" ); bool bDelete = (nMode & SFX_SHELL_POP_DELETE) == SFX_SHELL_POP_DELETE; bool bUntil = (nMode & SFX_SHELL_POP_UNTIL) == SFX_SHELL_POP_UNTIL; @@ -511,10 +501,10 @@ void SfxDispatcher::Pop DbgTrace( aMsg.GetBuffer() ); #endif - // gleiche Shell wie on-Top des ToDo-Stacks? + // same shell as on top of the to-do stack? if ( pImp->aToDoStack.Count() && pImp->aToDoStack.Top().pCluster == &rShell ) { - // inverse Actions heben sich auf + // cancel inverse actions if ( pImp->aToDoStack.Top().bPush != bPush ) pImp->aToDoStack.Pop(); else @@ -525,7 +515,7 @@ void SfxDispatcher::Pop } else { - // ::com::sun::star::chaos::Action merken + // Remember ::com::sun::star::chaos::Action pImp->aToDoStack.Push( SfxToDo_Impl(bPush, bDelete, bUntil, rShell) ); if ( bFlushed ) { @@ -533,7 +523,7 @@ void SfxDispatcher::Pop bFlushed = sal_False; pImp->bUpdated = sal_False; - // Bindings schlafen legen + // Put bindings to sleep SfxBindings* pBindings = GetBindings(); if ( pBindings ) pBindings->DENTERREGISTRATIONS(); @@ -543,29 +533,28 @@ void SfxDispatcher::Pop if ( !pSfxApp->IsDowning() && pImp->aToDoStack.Count() ) { //! if (SFX_APP()->AnyInput(INPUT_KEYBOARD | INPUT_MOUSE) ) - //! AnyInput haut nicht hin; hier muss noch ein Kriterium gefunden - //! werden. Solange wieder immer mit Timer. - + //! AnyInput does not work, here a criterion has yet to found. + //! As long as time after time with a timer. if (sal_True) { - // Kein sofortiges Update gewuenscht + // No immediate update is requested pImp->aTimer.SetTimeout(SFX_FLUSH_TIMEOUT); pImp->aTimer.SetTimeoutHdl( LINK(this, SfxDispatcher, EventHdl_Impl ) ); pImp->aTimer.Start(); } else { - // Schnellstmoegliches Update (sollte Normalfall sein) + // Upgrade as quickly as possible(should be the normal case) pImp->aTimer.Stop(); GetpApp()->PostUserEvent(pImp->nEventId, (void*)0); } } else { - // doch nichts zu tun + // but to do nothing pImp->aTimer.Stop(); - // ggf. Bindings wieder aufwecken + // Bindings may wake up again if ( !pImp->aToDoStack.Count() ) { SfxBindings* pBindings = GetBindings(); @@ -579,13 +568,13 @@ void SfxDispatcher::Pop IMPL_LINK_INLINE_START( SfxDispatcher, EventHdl_Impl, void *, pvoid ) -/* [Beschreibung] +/* [Description] - Dieser Handler wird nach <SfxDispatcher::Invalidate()> oder Bewegungen - auf dem Stack (<SfxDispatcher::Push()> und <SfxDispatcher::Pop()) gerufen. + This handler is called after <SfxDispatcher::Invalidate()> or after + changes on the stack (<SfxDispatcher::Push()> and <SfxDispatcher::Pop()) - Er flusht den Stack, falls er dirty ist, f"uhrt also die ausstehenden - Push und Pop Befehle tats"achlich aus. + It flushes the Stack, if it is dirty, thus it actually excecutes the + pending Push and Pop commands. */ { @@ -604,14 +593,14 @@ IMPL_LINK_INLINE_END( SfxDispatcher, EventHdl_Impl, void *, pvoid ) //-------------------------------------------------------------------- sal_Bool SfxDispatcher::CheckVirtualStack( const SfxShell& rShell, sal_Bool bDeep ) -/* [Beschreibung] +/* [Description] - Mit dieser Methode kann gepr"uft werden, ob sich die <SfxShell> rShell - auf dem Stack befindet, wenn er geflusht w"are. Dabei wird der - SfxDispatcher jedoch nicht tats"achlich geflusht. + With this method it can be tested whether the <SfxShell> rShell is on the + stack, when it was flushed. This way the SfxDispatcher is not actually + flushed. - Diese Methode ist u.a. dazu gedacht, Assertions zu erm"oglichen, ohne - als Seiteneffekt den SfxDispathcer flushen zu m"ussen. + This method is intended among other things to make assertions possible + without the side effect of having to flush the SfxDispathcer. */ { @@ -648,21 +637,19 @@ sal_Bool SfxDispatcher::CheckVirtualStack( const SfxShell& rShell, sal_Bool bDee //-------------------------------------------------------------------- sal_uInt16 SfxDispatcher::GetShellLevel( const SfxShell& rShell ) -/* [Beschreibung] - - Ermittelt die Position einer SfxShell im Stack des Dispatchers. - Dazu wird dieser ggf. zuvor geflusht. +/* [Description] + Determines the position of a given SfxShell in the stack of the dispatcher. + If possible this is flushed before. - [Rueckgabewert] + [Return value] - sal_uInt16 == USRT_MAX - Die SfxShell befindet sich nicht auf - diesem SfxDispatcher. + sal_uInt16 == USRT_MAX + The SfxShell is not on this SfxDispatcher. < USHRT_MAX - Position der SfxShell auf dem Dispatcher - von oben mit 0 beginnend gez"ahlt. + Position of the SfxShell on the Dispatcher + from the top count stating with 0. */ { @@ -687,14 +674,14 @@ sal_uInt16 SfxDispatcher::GetShellLevel( const SfxShell& rShell ) //-------------------------------------------------------------------- SfxShell *SfxDispatcher::GetShell(sal_uInt16 nIdx) const -/* [Beschreibung] +/* [Description] - Liefert einen Pointer auf die <SfxShell>, welche sich an der Position - nIdx (von oben, letzt-gepushte liegt bei 0) auf dem Stack befindet. + Returns a pointer to the <SfxShell> which is at the position nIdx + (from the top, last pushed is 0) on the stack. - Dabei wird der SfxDispatcher nicht geflusht. + Thus the SfxDispatcher is not flushed. - Ist der Stack nicht tief genug, wird ein 0-Pointer zur"uckgegeben. + Is the stack not deep enough a NULL-Pointer is returned. */ { @@ -704,22 +691,22 @@ SfxShell *SfxDispatcher::GetShell(sal_uInt16 nIdx) const if ( nIdx < nShellCount ) return pImp->aStack.Top(nIdx); else if ( pImp->pParent ) - return pImp->pParent->GetShell( nIdx - nShellCount ); + return pImp->pParent->GetShell( nIdx - nShellCount ); return 0; } //-------------------------------------------------------------------- SfxBindings* SfxDispatcher::GetBindings() const -/* [Beschreibung] +/* [Description] - Diese Methode liefert einen Pointer auf die <SfxBindings> Instanz - zur"uck, an die der SfxDispatcher gerade gebunden ist. Ein SfxDispatcher - ist nur dann an SfxBindings gebunden, wenn er <UI-aktiv> ist. Ist - er nicht UI-aktiv, wird ein 0-Pointer zur"uckgegeben. + This method returns a pointer to the <SfxBinding> Instance on which the + SfxDispatcher is curretly bound. A SfxDispatcher is only bound to + the SfxBindings when it is <UI-aktiv>. If it is not UI-active, + a NULL-pointer is returned. - Der zur"uckgegebene Pointer ist nur im <unmittelbaren Kontext> des - Methodenaufrufs g"ultig. + The returned pointer is only valid in the immediate context of the method + call. */ { @@ -732,11 +719,11 @@ SfxBindings* SfxDispatcher::GetBindings() const //-------------------------------------------------------------------- SfxViewFrame* SfxDispatcher::GetFrame() const -/* [Beschreibung] +/* [Description] - Liefert einen Pointer auf die <SfxViewFrame> Instanz, der dieser - SfxDispatcher geh"ort. Falls es sich um den Applikations-Dispatcher - handelt, wird ein 0-Pointer zur"uckgegeben. + Returns a pointer to the <SfxViewFrame> instance, which belongs to + this SfxDispatcher. If it is about the application dispatcher, + a NULL-pointer is returned. */ { @@ -747,18 +734,18 @@ SfxViewFrame* SfxDispatcher::GetFrame() const //-------------------------------------------------------------------- void SfxDispatcher::DoActivate_Impl( sal_Bool bMDI, SfxViewFrame* /* pOld */ ) -/* [Beschreibung] +/* [Description] - Diese Methode steuert das Aktivieren eines Dispatchers. + This method controls the activation of a dispatcher. - Da der Applikations-Dispatcher immer aktiv ist, entweder als - Unterdispatcher des <SfxViewFrame>-Dispatchers oder selbst, wird - er nie als ganzes Aktiviert, sondern nur seine einzelnen <SfxShell>s - bei <SfxDispatcher::Push(SfxShell&)>. + Since the application dispatcher is always active, either as a sub + dispatcher of the <SfxViewFrame> dispatcher or as itself, it is never + activated as a whole, instead only its individual <SfxShell>s at + <SfxDispatcher::Push(SfxShell&)>. - Beim Aktivieren eines SfxDispatchers wird an allen auf seinem - Stack befindlichen SfxShells, beginnend mit der untersten, der Handler - <SfxShell::Activate(sal_Bool)> gerufen. + When activating a SfxDispatcher all of the SfxShells located on its stack + are called with the handler <SfxShell::Activate(sal_Bool)>, starting with + the lowest. */ { @@ -770,7 +757,7 @@ void SfxDispatcher::DoActivate_Impl( sal_Bool bMDI, SfxViewFrame* /* pOld */ ) ByteString sTemp("Activate Dispatcher "); sTemp += ByteString::CreateFromInt64( (sal_uIntPtr) this ); DBG_TRACE(sTemp.GetBuffer()); - DBG_ASSERT( !pImp->bActive, "Activate-Fehler" ); + DBG_ASSERT( !pImp->bActive, "Activation error" ); #endif pImp->bActive = sal_True; pImp->bUpdated = sal_False; @@ -813,14 +800,14 @@ void SfxDispatcher::DoActivate_Impl( sal_Bool bMDI, SfxViewFrame* /* pOld */ ) { if (sal_True) { - // Kein sofortiges Update gewuenscht + // No immediate update is requested pImp->aTimer.SetTimeout(SFX_FLUSH_TIMEOUT); pImp->aTimer.SetTimeoutHdl( LINK(this, SfxDispatcher, EventHdl_Impl ) ); pImp->aTimer.Start(); } else { - // Schnellstmoegliches Update (sollte Normalfall sein) + // Upgrade as quickly as possible(should be the normal case) pImp->aTimer.Stop(); GetpApp()->PostUserEvent(pImp->nEventId, (void*)0); } @@ -836,18 +823,18 @@ void SfxDispatcher::DoParentActivate_Impl() //-------------------------------------------------------------------- void SfxDispatcher::DoDeactivate_Impl( sal_Bool bMDI, SfxViewFrame* pNew ) -/* [Beschreibung] +/* [Description] - Diese Methode steuert das Deaktivieren eines Dispatchers. + This method controls the deactivation of a dispatcher. - Da der Applikations-Dispatcher immer aktiv ist, entweder als - Unterdispatcher des <SfxViewFrame>-Dispatchers oder selbst, wird - er nie als ganzes Deaktiviert, sondern nur seine einzelnen <SfxShell>s - bei <SfxDispatcher::Pop(SfxShell&)>. + Since the application dispatcher is always active, either as a sub + dispatcher of the <SfxViewFrame> dispatcher or as itself, it is never + deactivated as a whole, instead only its individual <SfxShell>s at + <SfxDispatcher::Pop(SfxShell&)>. - Beim Deaktivieren eines SfxDispatchers wird an allen auf seinem - Stack befindlichen SfxShells, beginnend mit der obersten, der Handler - <SfxShell::Deactivate(sal_Bool)> gerufen. + When deactivating a SfxDispatcher all of the SfxShells located on its stack + are called with the handler <SfxShell::Deactivate(sal_Bool)>, starting with + the lowest. */ { @@ -859,7 +846,7 @@ void SfxDispatcher::DoDeactivate_Impl( sal_Bool bMDI, SfxViewFrame* pNew ) if ( bMDI ) { DBG_TRACE(ByteString("Deactivate Dispatcher ").Append(ByteString::CreateFromInt64( (sal_uIntPtr) this )).GetBuffer()); - DBG_ASSERT( pImp->bActive, "Deactivate-Fehler" ); + DBG_ASSERT( pImp->bActive, "Deactivate error" ); pImp->bActive = sal_False; if ( pImp->pFrame && !(pImp->pFrame->GetObjectShell()->IsInPlaceActive() ) ) @@ -926,30 +913,28 @@ void SfxDispatcher::DoParentDeactivate_Impl() //-------------------------------------------------------------------- int SfxDispatcher::GetShellAndSlot_Impl ( - sal_uInt16 nSlot, // die zu suchende Slot-Id - SfxShell** ppShell, // die SfxShell, welche nSlot z.Zt. bedient - const SfxSlot** ppSlot, // der SfxSlot, welcher nSlot z.Zt. bedient - sal_Bool bOwnShellsOnly, - sal_Bool bModal, // trotz ModalMode - sal_Bool bRealSlot + sal_uInt16 nSlot, // the searchable Slot-Id + SfxShell** ppShell, // the SfxShell, which are currently handled + // the nSlot + const SfxSlot** ppSlot, // the SfxSlot, which are currently handled + // the nSlot + sal_Bool bOwnShellsOnly, + sal_Bool bModal, // ModalMode + sal_Bool bRealSlot ) -/* [Beschreibung] - - Diese Methode sucht im SfxDispatcher nach der <SfxShell>, von der - die Slot-Id nSlot zur Zeit bedient wird. Dazu wird der Dispatcher - zuvor geflusht. +/* [Description] + This method searches in SfxDispatcher after <SfxShell> , from the Slot Id + nSlot currently being handled. For this, the dispatcher is first flushed. - [R"uckgabewert] + [Return value] - int sal_True - Die SfxShell wurde gefunden, ppShell und ppSlot - sind g"ultig. + int sal_True + The SfxShell was found, ppShell and ppSlot are valid. - sal_True - Die SfxShell wurde nicht gefunden, ppShell und ppSlot - sind ung"ultig. + sal_False + The SfxShell was not found, ppShell and ppSlot are invalid. */ { @@ -1009,16 +994,17 @@ struct Executer : public SfxHint //-------------------------------------------------------------------- void SfxDispatcher::_Execute ( - SfxShell& rShell, // zu rufende <SfxShell> - const SfxSlot& rSlot, // zu rufender <SfxSlot> - SfxRequest& rReq, // auszuf"uhrende Funktion (Id und optional Parameter) - SfxCallMode eCallMode // synchron, asynchron oder wie beim Slot angegeben + SfxShell& rShell, // to the calling <SfxShell> + const SfxSlot& rSlot, // to the calling <SfxSlot> + SfxRequest& rReq, // function to be performed + // (Id and optional parameters) + SfxCallMode eCallMode // Synchronously, asynchronously or as shown in + // the slot ) -/* [Beschreibung] +/* [Description] - Diese Methode f"uhrt einen Request "uber einen gecachten <Slot-Server> - aus. + This method performs a request for a cached <Slot-Server>. */ { @@ -1063,14 +1049,14 @@ void SfxDispatcher::_Execute //-------------------------------------------------------------------- void MappedPut_Impl( SfxAllItemSet &rSet, const SfxPoolItem &rItem ) -/* [Beschreibung] +/* [Description] - Hilfsfunktion zum putten von rItem unter der im Pool des Item-Sets - rSet geltenden Which-Id. + Helper function to put from rItem below the Which-ID in the pool of the + Item Sets rSet. */ { - // mit ggf. gemappter Which-Id putten + // Put with mapped Which-Id if possible const SfxItemPool *pPool = rSet.GetPool(); sal_uInt16 nWhich = rItem.Which(); #ifdef TF_POOLABLE @@ -1094,7 +1080,7 @@ sal_uInt16 SfxDispatcher::ExecuteFunction( sal_uInt16 nSlot, SfxPoolItem **pArgs if ( !nMode ) nMode = pImp->nStandardMode; - // via Bindings/Interceptor? (dann ist der Returnwert nicht exakt) + // through Bindings/Interceptor? (then the return value is not exact) sal_Bool bViaBindings = SFX_USE_BINDINGS == ( nMode & SFX_USE_BINDINGS ); nMode &= ~sal_uInt16(SFX_USE_BINDINGS); if ( bViaBindings && GetBindings() ) @@ -1102,7 +1088,7 @@ sal_uInt16 SfxDispatcher::ExecuteFunction( sal_uInt16 nSlot, SfxPoolItem **pArgs ? EXECUTE_POSSIBLE : EXECUTE_NO; - // sonst via Dispatcher + // otherwise through the Dispatcher if ( IsLocked(nSlot) ) return 0; SfxShell *pShell = 0; @@ -1111,7 +1097,7 @@ sal_uInt16 SfxDispatcher::ExecuteFunction( sal_uInt16 nSlot, SfxPoolItem **pArgs const SfxSlot *pSlot = 0; if ( GetShellAndSlot_Impl( nSlot, &pShell, &pSlot, sal_False, sal_False ) ) { - // Ausf"uhrbarkeit vorher testen + // Feasibility test before if ( pSlot->IsMode( SFX_SLOT_FASTCALL ) || pShell->CanExecuteSlot_Impl( *pSlot ) ) nRet = EXECUTE_POSSIBLE; @@ -1122,7 +1108,6 @@ sal_uInt16 SfxDispatcher::ExecuteFunction( sal_uInt16 nSlot, SfxPoolItem **pArgs eCall = SFX_CALLMODE_ASYNCHRON; else if ( pSlot->GetMode() & SFX_SLOT_ASYNCHRON ) eCall = SFX_CALLMODE_ASYNCHRON; - sal_Bool bDone = sal_False; if ( pArgs && *pArgs ) { SfxAllItemSet aSet( pShell->GetPool() ); @@ -1130,13 +1115,11 @@ sal_uInt16 SfxDispatcher::ExecuteFunction( sal_uInt16 nSlot, SfxPoolItem **pArgs MappedPut_Impl( aSet, **pArg ); SfxRequest aReq( nSlot, eCall, aSet ); _Execute( *pShell, *pSlot, aReq, eCall ); - bDone = aReq.IsDone(); } else { SfxRequest aReq( nSlot, eCall, pShell->GetPool() ); _Execute( *pShell, *pSlot, aReq, eCall ); - bDone = aReq.IsDone(); } } @@ -1151,7 +1134,7 @@ sal_uInt16 SfxDispatcher::ExecuteFunction( sal_uInt16 nSlot, const SfxItemSet& r /* // at the moment not implemented - // via Bindings/Interceptor? (dann ist der Returnwert nicht exakt) + // through Bindings/Interceptor? (then the return value is not exact) sal_Bool bViaBindings = SFX_USE_BINDINGS == ( nMode & SFX_USE_BINDINGS ); nMode &= ~sal_uInt16(SFX_USE_BINDINGS); if ( bViaBindings && GetBindings() ) @@ -1159,7 +1142,7 @@ sal_uInt16 SfxDispatcher::ExecuteFunction( sal_uInt16 nSlot, const SfxItemSet& r ? EXECUTE_POSSIBLE : EXECUTE_NO; */ - // sonst via Dispatcher + // otherwise through the Dispatcher if ( IsLocked(nSlot) ) return 0; SfxShell *pShell = 0; @@ -1168,7 +1151,7 @@ sal_uInt16 SfxDispatcher::ExecuteFunction( sal_uInt16 nSlot, const SfxItemSet& r const SfxSlot *pSlot = 0; if ( GetShellAndSlot_Impl( nSlot, &pShell, &pSlot, sal_False, sal_False ) ) { - // Ausf"uhrbarkeit vorher testen + // Feasibility test before if ( pSlot->IsMode( SFX_SLOT_FASTCALL ) || pShell->CanExecuteSlot_Impl( *pSlot ) ) nRet = EXECUTE_POSSIBLE; @@ -1179,10 +1162,8 @@ sal_uInt16 SfxDispatcher::ExecuteFunction( sal_uInt16 nSlot, const SfxItemSet& r eCall = SFX_CALLMODE_ASYNCHRON; else if ( pSlot->GetMode() & SFX_SLOT_ASYNCHRON ) eCall = SFX_CALLMODE_ASYNCHRON; - sal_Bool bDone = sal_False; - SfxRequest aReq( nSlot, eCall, rArgs ); - _Execute( *pShell, *pSlot, aReq, eCall ); - bDone = aReq.IsDone(); + SfxRequest aReq( nSlot, eCall, rArgs ); + _Execute( *pShell, *pSlot, aReq, eCall ); } return nRet; @@ -1198,7 +1179,7 @@ sal_uInt16 SfxDispatcher::GetSlotId( const String& rCommand ) const SfxSlot* SfxDispatcher::GetSlot( const String& rCommand ) { - // Anzahl der Shells auf den verkettenten Dispatchern z"ahlen + // Count the number of Shells on the linked Dispatcher Flush(); sal_uInt16 nTotCount = pImp->aStack.Count(); if ( pImp->pParent ) @@ -1330,27 +1311,26 @@ const SfxPoolItem* SfxDispatcher::Execute( //-------------------------------------------------------------------- const SfxPoolItem* SfxDispatcher::Execute ( - sal_uInt16 nSlot, // die Id der auszufuehrenden Funktion - SfxCallMode eCall, // SFX_CALLMODE_SYNCRHON, ..._ASYNCHRON oder ..._SLOT - const SfxPoolItem **pArgs, // 0-terminiertes C-Array von Parametern + sal_uInt16 nSlot, // the Id of the executing function + SfxCallMode eCall, // SFX_CALLMODE_SYNCRHON, ..._ASYNCHRON + // or ..._SLOT + const SfxPoolItem **pArgs, // Zero teminated C-Array of Parameters sal_uInt16 nModi, - const SfxPoolItem **pInternalArgs // 0-terminiertes C-Array von Parametern + const SfxPoolItem **pInternalArgs // Zero terminated C-Array of Parameters ) -/* [Beschreibung] - - Methode zum Ausf"uhren eines <SfxSlot>s "uber die Slot-Id. +/* [Description] + Method to excecute a <SfxSlot>s over the Slot-Id. - [R"uckgabewert] + [Return value] - const SfxPoolItem* Pointer auf ein bis zum n"achsten Durchlauf - der Message-Loop g"ultiges SfxPoolItem, - welches den R"uckgabewert enth"alt. + const SfxPoolItem* Pointer to the SfxPoolItem valid to the next run + though the Message-Loop, which contains the return + value. - Oder ein 0-Pointer, wenn die Funktion nicht - ausgef"uhrt wurde (z.B. Abbruch durch den - Benutzer). + Or a NULL-Pointer, when the function was not + executed (for example canceled by the user). */ { @@ -1390,25 +1370,23 @@ const SfxPoolItem* SfxDispatcher::Execute //-------------------------------------------------------------------- const SfxPoolItem* SfxDispatcher::Execute ( - sal_uInt16 nSlot, // die Id der auszufuehrenden Funktion - SfxCallMode eCall, // SFX_CALLMODE_SYNCRHON, ..._ASYNCHRON oder ..._SLOT - const SfxItemSet &rArgs // <SfxItemSet> mit Parametern + sal_uInt16 nSlot, // the Id of the executing function + SfxCallMode eCall, // SFX_CALLMODE_SYNCRHON, ..._ASYNCHRON or ..._SLOT + const SfxItemSet &rArgs // <SfxItemSet> with the parameters ) -/* [Beschreibung] +/* [Description] - Methode zum Ausf"uhren eines <SfxSlot>s "uber die Slot-Id. + Method to excecute a <SfxSlot>s over the Slot-Id. + [Return value] - [R"uckgabewert] + const SfxPoolItem* Pointer to the SfxPoolItem valid to the next run + though the Message-Loop, which contains the return + value. - const SfxPoolItem* Pointer auf ein bis zum n"achsten Durchlauf - der Message-Loop g"ultiges SfxPoolItem, - welches den R"uckgabewert enth"alt. - - Oder ein 0-Pointer, wenn die Funktion nicht - ausgef"uhrt wurde (z.B. Abbruch durch den - Benutzer). + Or a NULL-Pointer, when the function was not + executed (for example canceled by the user). */ { @@ -1449,26 +1427,25 @@ const SfxPoolItem* SfxDispatcher::Execute //-------------------------------------------------------------------- const SfxPoolItem* SfxDispatcher::_Execute ( - sal_uInt16 nSlot, // die Id der auszufuehrenden Funktion - SfxCallMode eCall, // SFX_CALLMODE_SYNCRHON, ..._ASYNCHRON oder ..._SLOT - va_list pVarArgs, // Parameterliste ab 2. Parameter - const SfxPoolItem* pArg1 // erster Parameter + sal_uInt16 nSlot, // the Id of the executing function + SfxCallMode eCall, // SFX_CALLMODE_SYNCRHON, ..._ASYNCHRON or + //..._SLOT + va_list pVarArgs, // Parameter list from the 2nd parameter + const SfxPoolItem* pArg1 // First parameter ) -/* [Beschreibung] - - Methode zum Ausf"uhren eines <SfxSlot>s "uber die Slot-Id. +/* [Description] + Method to excecute a <SfxSlot>s over the Slot-Id. - [R"uckgabewert] + [Return value] - const SfxPoolItem* Pointer auf ein bis zum n"achsten Durchlauf - der Message-Loop g"ultiges SfxPoolItem, - welches den R"uckgabewert enth"alt. + const SfxPoolItem* Pointer to the SfxPoolItem valid to the next run + though the Message-Loop, which contains the return + value. - Oder ein 0-Pointer, wenn die Funktion nicht - ausgef"uhrt wurde (z.B. Abbruch durch den - Benutzer). + Or a NULL-Pointer, when the function was not + executed (for example canceled by the user). */ { @@ -1497,35 +1474,32 @@ const SfxPoolItem* SfxDispatcher::_Execute //-------------------------------------------------------------------- const SfxPoolItem* SfxDispatcher::Execute ( - sal_uInt16 nSlot, // die Id der auszufuehrenden Funktion - SfxCallMode eCall, // SFX_CALLMODE_SYNCRHON, ..._ASYNCHRON oder ..._SLOT - const SfxPoolItem* pArg1, // erster Parameter - ... // 0-terminiertes Liste Parametern + sal_uInt16 nSlot, // the Id of the executing function + SfxCallMode eCall, // SFX_CALLMODE_SYNCRHON, ..._ASYNCHRON or + // ..._SLOT + const SfxPoolItem* pArg1, // First parameter + ... // Zero terminated list of parameters ) -/* [Beschreibung] - - Methode zum Ausf"uhren eines <SfxSlot>s "uber die Slot-Id. +/* [Description] + Method to excecute a <SfxSlot>s over the Slot-Id. - [Anmerkung] + [Note] - Die Parameter werden kopiert, k"onnen daher als Adresse von - Stack-Objekten "ubergeben werden. + The parameters are copied, can therefore be passed on as the address + of stack objects. + [Return value] - [R"uckgabewert] + const SfxPoolItem* Pointer to the SfxPoolItem valid to the next run + though the Message-Loop, which contains the return + value. - const SfxPoolItem* Pointer auf ein bis zum n"achsten Durchlauf - der Message-Loop g"ultiges SfxPoolItem, - welches den R"uckgabewert enth"alt. + Or a NULL-Pointer, when the function was not + executed (for example canceled by the user). - Oder ein 0-Pointer, wenn die Funktion nicht - ausgef"uhrt wurde (z.B. Abbruch durch den - Benutzer). - - - [Beispiel] + [Example] pDispatcher->Execute( SID_OPENDOCUMENT, SFX_CALLMODE_SYNCHRON, &SfxStringItem( SID_FILE_NAME, "\\tmp\\temp.sdd" ), @@ -1564,9 +1538,9 @@ const SfxPoolItem* SfxDispatcher::Execute IMPL_LINK( SfxDispatcher, PostMsgHandler, SfxRequest*, pReq ) -/* [Beschreibung] +/* [Description] - Hilfsmethode zum Empfangen der asynchron auszuf"uhrenden <SfxRequest>s. + Helper method to receive the asynchronously executed <SfxRequest>s. */ { @@ -1574,7 +1548,7 @@ IMPL_LINK( SfxDispatcher, PostMsgHandler, SfxRequest*, pReq ) DBG_ASSERT( !pImp->bFlushing, "recursive call to dispatcher" ); SFX_STACK(SfxDispatcher::PostMsgHandler); - // ist auch der Pool noch nicht gestorben? + // Has also the Pool not yet died? // SfxRequest* pReq = pExec->pRequest; if ( !pReq->IsCancelled() ) { @@ -1592,11 +1566,11 @@ IMPL_LINK( SfxDispatcher, PostMsgHandler, SfxRequest*, pReq ) DBG( SfxApplication *pSfxApp = SFX_APP() ); DBG( pSfxApp->EnterAsynchronCall_Impl() ); - // Wenn pSlot ein "Pseudoslot" f"ur Macros oder Verben ist, kann - // er im Call_Impl zerst"ort werden, also nicht mehr benutzen! + // When the pSlot is a "Pseudoslot" for macros or Verbs, it can + // be destroyed in the Call_Impl, thus do not use it anymore! pReq->SetSynchronCall( sal_False ); - Call_Impl( *pSh, *pSlot, *pReq, pReq->AllowsRecording() ); //! woher bRecord? -// Call_Impl( *pShell, *pExec->pSlot, *pReq, sal_True ); //! woher bRecord? + Call_Impl( *pSh, *pSlot, *pReq, pReq->AllowsRecording() ); //! why bRecord? +// Call_Impl( *pShell, *pExec->pSlot, *pReq, sal_True ); //! why bRecord? DBG( pSfxApp->LeaveAsynchronCall_Impl() ); } @@ -1831,7 +1805,7 @@ void SfxDispatcher::_Update_Impl( sal_Bool bUIActive, sal_Bool bIsMDIApp, sal_Bo if ( bReadOnlyShell && !( nPos & SFX_VISIBILITY_READONLYDOC ) ) continue; - // check wether toolbar needs activation of a special feature + // check weather toolbar needs activation of a special feature sal_uInt32 nFeature = pIFace->GetObjectBarFeature(nNo); if ( nFeature && !pShell->HasUIFeature( nFeature ) ) continue; @@ -1956,9 +1930,9 @@ void SfxDispatcher::_Update_Impl( sal_Bool bUIActive, sal_Bool bIsMDIApp, sal_Bo //-------------------------------------------------------------------- void SfxDispatcher::FlushImpl() -/* [Beschreibung] +/* [Description] - Hilfsmethode zum Ausf"uhren der ausstehenden Push- und Pop-Befehle. + Helper method to execute the outstanding push and pop commands. */ { @@ -1979,8 +1953,8 @@ void SfxDispatcher::FlushImpl() if ( pImp->pParent ) pImp->pParent->Flush(); -// if ( pImp->bQuiet ) -// return; +// if ( pImp->bQuiet ) +// return; pImp->bFlushing = !pImp->bFlushing; if ( !pImp->bFlushing ) @@ -1998,7 +1972,7 @@ void SfxDispatcher::FlushImpl() SfxApplication *pSfxApp = SFX_APP(); - // in der 1. Runde den echten Stack 'um'bauen + // Re-build the true stack in the first round SfxToDoStack_Impl aToDoCopy; sal_Bool bModify = sal_False; short nToDo; @@ -2009,20 +1983,20 @@ void SfxDispatcher::FlushImpl() SfxToDo_Impl aToDo( pImp->aToDoStack.Top(nToDo) ); if ( aToDo.bPush ) { - // tats"aechlich pushen + // Actually push DBG_ASSERT( !pImp->aStack.Contains( aToDo.pCluster ), "pushed SfxShell already on stack" ); pImp->aStack.Push( aToDo.pCluster ); aToDo.pCluster->SetDisableFlags( pImp->nDisableFlags ); - // die bewegte Shell merken + // Mark the moved shell aToDoCopy.Push( aToDo ); } else { - // tats"aechlich poppen + // Actually pop SfxShell* pPopped = 0; - FASTBOOL bFound = sal_False; + bool bFound = false; do { DBG_ASSERT( pImp->aStack.Count(), "popping from empty stack" ); @@ -2030,7 +2004,7 @@ void SfxDispatcher::FlushImpl() pPopped->SetDisableFlags( 0 ); bFound = pPopped == aToDo.pCluster; - // die bewegte Shell merken + // Mark the moved Shell aToDoCopy.Push( SfxToDo_Impl( sal_False, aToDo.bDelete, sal_False, *pPopped) ); } while ( aToDo.bUntil && !bFound ); @@ -2041,7 +2015,7 @@ void SfxDispatcher::FlushImpl() pImp->aToDoStack.Clear(); } - // ggf. Bindings invalidieren + // Invalidate bindings, if possible if ( !pSfxApp->IsDowning() ) { if ( bModify ) @@ -2054,11 +2028,11 @@ void SfxDispatcher::FlushImpl() } pImp->bFlushing = sal_False; - pImp->bUpdated = sal_False; // nicht nur bei bModify, falls Doc/Template-Config + pImp->bUpdated = sal_False; // not only when bModify, if Doc/Template-Config bFlushed = sal_True; DBG_TRACE("Successfully flushed dispatcher!"); - // in der 2. Runde die Shells aktivieren und ggf. l"oschen + // Activate the Shells and possible delete them in the 2nd round for ( nToDo = aToDoCopy.Count()-1; nToDo >= 0; --nToDo ) { SfxToDo_Impl aToDo( aToDoCopy.Top(nToDo) ); @@ -2080,9 +2054,10 @@ void SfxDispatcher::FlushImpl() if( bAwakeBindings ) aToDoCopy.Clear(); - // Wenn bei Activate/Deactivate/Delete weitere Stackbewegungen erfolgt sind : + // If more changes have occured on the stach when + // Activate/Deactivate/Delete: if (!bFlushed) - // falls jemand Push/Pop gerufen hat, wurde auch EnterReg gerufen! + // If Push/Pop hs been called by someone, theb also EnterReg was called! FlushImpl(); if( bAwakeBindings && GetBindings() ) @@ -2102,52 +2077,51 @@ void SfxDispatcher::FlushImpl() void SfxDispatcher::SetSlotFilter ( HACK(hier muss mal ein enum rein) - sal_Bool bEnable, /* sal_True: - nur angegebene Slots enablen, - alle anderen disablen + sal_Bool bEnable, /* sal_True: + only enable specified slots, + disable all other sal_False: - die angegebenen Slots disablen, - alle anderen zun"achst enablen - */ - sal_uInt16 nCount, // Anzahl der SIDs im folgenden Array - const sal_uInt16* pSIDs // sortiertes Array von 'nCount' SIDs + disable specified slots, + first enable all other + */ + sal_uInt16 nCount, // Number of SIDs in the following Array + const sal_uInt16* pSIDs // sorted Array of 'nCount' SIDs ) -/* [Beschreibung] - - Mit dieser Methode wird ein Filter gesetzt, mit dem gezielt Slots - enabled bzw. disabled werden k"onnen. Das "ubergebene Array mu\s - bis zum Dtor bzw. n"achsten <SetSlotFilter()> erhalten bleiben, es - wird nicht vom Dispatcher gel"oscht, es kann daher static sein. +/* [Description] - In ReadOnly-Dokumenten kann man mit 'bEnable==2' quasi das ReadOnlyDoc - Flag von Slots "ubersteuern, dieser werden also wieder gefunden. Auf - andere Slots hat das dann keine Auswirkung. + With this method a filter set, the target slots can be enabled or disabled. + The passed array must be retained until the destructor or the next + <SetSlotFilter()>, it is not deleted from the dispatcher, so it can thus be + static. + In read-only documents the quasi ReadOnlyDoc Flag of slots can be + overturned by the use of 'bEnable == 2', so this will be displayed again. + On the other slots it has no effect. - [Beispiel] + [Example] - gezieltes disablen der Slots 1, 2 und 3: + Targeted disabling of Slots 1, 2 and 3: - static sal_uInt16 __READONLY_DATA pSIDs[] = { 1, 2, 3 }; + static sal_uInt16 const pSIDs[] = { 1, 2, 3 }; pDisp->SetSlotFilter( sal_False, sizeof(pSIDs)/sizeof(sal_uInt16), pSIDs ); - nur die Slots 5, 6 und 7 zulassen: + only permit Slots 5, 6 and 7: - static sal_uInt16 __READONLY_DATA pSIDs[] = { 5, 6, 7 }; + static sal_uInt16 const pSIDs[] = { 5, 6, 7 }; pDisp->SetSlotFilter( sal_True, sizeof(pSIDs)/sizeof(sal_uInt16), pSIDs ); - Filter ausschalten: + Turn-off Filter: pDisp->SetSlotFilter(); */ { #ifdef DBG_UTIL - // Array "uberpr"ufen + // Check Array for ( sal_uInt16 n = 1; n < nCount; ++n ) - DBG_ASSERT( pSIDs[n] > pSIDs[n-1], "SetSlotFilter: SIDs not sortet" ); + DBG_ASSERT( pSIDs[n] > pSIDs[n-1], "SetSlotFilter: SIDs not sorted" ); #endif if ( pImp->pFilterSIDs ) @@ -2181,59 +2155,59 @@ SfxCompareSIDs_Impl( const void* pSmaller, const void* pBigger ) //-------------------------------------------------------------------- sal_Bool SfxDispatcher::IsSlotEnabledByFilter_Impl( sal_uInt16 nSID ) const -/* [Beschreibung] +/* [Description] - Sucht 'nSID' in dem mit <SetSlotFilter()> gesetzten Filter und - liefert sal_True, falls die SID erlaubt ist, bzw. sal_False, falls sie - durch den Filter disabled ist. + Searches for 'nSID' in the Filter set by <SetSlotFilter()> and + returns sal_True, if the SIDis allowed, or sal_False, if it is + disabled by the Filter. - [R"uckgabewert] - sal_Bool 0 => disabled - 1 => enabled - 2 => enabled even if ReadOnlyDoc + [Return value] + sal_Bool 0 => disabled + 1 => enabled + 2 => enabled even if ReadOnlyDoc */ { - // kein Filter? + // no filter? if ( 0 == pImp->nFilterCount ) - // => alle SIDs erlaubt + // => all SIDs allowed return sal_True; - // suchen + // search sal_Bool bFound = 0 != bsearch( &nSID, pImp->pFilterSIDs, pImp->nFilterCount, sizeof(sal_uInt16), SfxCompareSIDs_Impl ); // even if ReadOnlyDoc if ( 2 == pImp->bFilterEnabling ) return bFound ? 2 : 1; - // sonst je nach Negativ/Positiv Filter + // Otherwise after Negative/Positive Filter return pImp->bFilterEnabling ? bFound : !bFound; } //-------------------------------------------------------------------- sal_Bool SfxDispatcher::_TryIntercept_Impl ( - sal_uInt16 nSlot, // zu suchende Slot-Id - SfxSlotServer& rServer, // zu f"uellende <SfxSlotServer>-Instanz - sal_Bool bSelf + sal_uInt16 nSlot, // Slot-Id to search for + SfxSlotServer& rServer, // <SfxSlotServer>-Instance to fill + sal_Bool bSelf ) { - // Eventuell geh"ort der parent auch zu einer Komponente + // Maybe the parent is also belongs to a component SfxDispatcher *pParent = pImp->pParent; sal_uInt16 nLevels = pImp->aStack.Count(); while ( pParent && pParent->pImp->pFrame ) { if ( pParent->pImp->pFrame->GetFrame().HasComponent() ) { - // Components d"urfen intercepten + // Components may be intercepted if ( pParent->_TryIntercept_Impl( nSlot, rServer, sal_True ) ) { - // Die eigenen Shells zum Shelllevel hinzuz"ahlen + // The own shells are added to the Shell Level rServer.SetShellLevel( rServer.GetShellLevel() + nLevels ); return sal_True; } else - // Keine weitere Interception + // No further Interception break; } else @@ -2244,7 +2218,7 @@ sal_Bool SfxDispatcher::_TryIntercept_Impl if ( bSelf ) { - // Die ComponentViewShell befragen + // Query the ComponentViewShell Flush(); SfxShell *pObjShell = GetShell(0); SfxInterface *pIFace = pObjShell->GetInterface(); @@ -2268,30 +2242,29 @@ sal_Bool SfxDispatcher::_TryIntercept_Impl sal_Bool SfxDispatcher::_FindServer ( - sal_uInt16 nSlot, // zu suchende Slot-Id - SfxSlotServer& rServer, // zu f"uellnde <SfxSlotServer>-Instanz - sal_Bool bModal // trotz ModalMode + sal_uInt16 nSlot, // Slot-Id to search for + SfxSlotServer& rServer, // <SfxSlotServer>-Instance to fill + sal_Bool bModal // Dispite ModalMode ) -/* [Beschreibung] +/* [Description] - Diese Hilfsmethode sucht den <Slot-Server>, der nSlot zur Zeit bedient. - Als Ergebnis wird rServer entsprechend gef"ullt. + This helper method searches for the <Slot-Server> which currently serves + the nSlot. As the result, rServe is filled accordingly. - Falls bekannt, kann das SfxInterface mitgegeben werden, von welchem - nSlot momentan bedient wird. + If known the SfxInterface which is currently served by nSlot can be + passed along. - Vor der Suche nach nSlot wird der SfxDispatcher geflusht. + The SfxDispatcher is flushed while searching for nSlot. + [Return value] - [R"uckgabewert] - sal_Bool sal_True - Der Slot wurde gefunden, rServer ist g"ultig. + sal_Bool sal_True + The Slot was found, rServer is valid. sal_False - Der Slot wird momentan nicht bedient, rServer - ist ung"ultig. + The Slot is currently not served, rServer is invalid. */ { @@ -2305,7 +2278,7 @@ sal_Bool SfxDispatcher::_FindServer return sal_False; } - // Anzahl der Shells auf den verkettenten Dispatchern z"ahlen + // Count the number of Shells in the linked dispatchers. Flush(); sal_uInt16 nTotCount = pImp->aStack.Count(); if ( pImp->pParent ) @@ -2318,7 +2291,7 @@ sal_Bool SfxDispatcher::_FindServer } } - // Makro-Slot? + // Macro-Slot? if ( SfxMacroConfig::IsMacroSlot( nSlot ) ) { const SfxMacroInfo* pInfo = pSfxApp->GetMacroConfig()->GetMacroInfo(nSlot); @@ -2356,7 +2329,7 @@ sal_Bool SfxDispatcher::_FindServer } } - // SID gegen gesetzten Filter pr"ufen + // SID check against set filter sal_uInt16 nSlotEnableMode=0; if ( pImp->pFrame ) { @@ -2365,7 +2338,7 @@ sal_Bool SfxDispatcher::_FindServer return sal_False; } - // im Quiet-Mode nur Parent-Dispatcher + // In Quiet-Mode only Parent-Dispatcher if ( pImp->bQuiet ) { if ( pImp->pParent ) @@ -2380,10 +2353,11 @@ sal_Bool SfxDispatcher::_FindServer } sal_Bool bReadOnly = ( 2 != nSlotEnableMode && pImp->bReadOnly ); -// ( pImp->pFrame && pImp->pFrame->GetObjectShell() ); -// pImp->pFrame->GetObjectShell()->IsLoading() ); +// ( pImp->pFrame && pImp->pFrame->GetObjectShell() ); +// pImp->pFrame->GetObjectShell()->IsLoading() ); - // durch alle Shells der verketteten Dispatchern von oben nach unten suchen + // search through all the shells of the chained dispatchers + // from top to bottom #ifdef DBG_UTILx String aStack( "Stack:" ); #endif @@ -2402,26 +2376,26 @@ sal_Bool SfxDispatcher::_FindServer if ( pSlot ) { - // Slot geh"ort zum Container? - FASTBOOL bIsContainerSlot = pSlot->IsMode(SFX_SLOT_CONTAINER); - FASTBOOL bIsInPlace = pImp->pFrame && pImp->pFrame->GetObjectShell()->IsInPlaceActive(); + // Slot belongs to Container? + bool bIsContainerSlot = pSlot->IsMode(SFX_SLOT_CONTAINER); + bool bIsInPlace = pImp->pFrame && pImp->pFrame->GetObjectShell()->IsInPlaceActive(); - // Shell geh"ort zum Server? - // AppDispatcher oder IPFrame-Dispatcher - FASTBOOL bIsServerShell = !pImp->pFrame || bIsInPlace; + // Shell belongs to Server? + // AppDispatcher or IPFrame-Dispatcher + bool bIsServerShell = !pImp->pFrame || bIsInPlace; - // Nat"urlich sind ServerShell-Slots auch ausf"uhrbar, wenn sie auf - // einem Container-Dispatcher ohne IPClient ausgef"uhrt werden sollen. + // Of course ShellServer-Slots are also executable even when it is + // excecuted on a container dispatcher without a IPClient. if ( !bIsServerShell ) { SfxViewShell *pViewSh = pImp->pFrame->GetViewShell(); bIsServerShell = !pViewSh || !pViewSh->GetUIActiveClient(); } - // Shell geh"ort zum Container? - // AppDispatcher oder kein IPFrameDispatcher - FASTBOOL bIsContainerShell = !pImp->pFrame || !bIsInPlace; - // Shell und Slot passen zusammen + // Shell belongs to Container? + // AppDispatcher or no IPFrameDispatcher + bool bIsContainerShell = !pImp->pFrame || !bIsInPlace; + // Shell and Slot match if ( !( ( bIsContainerSlot && bIsContainerShell ) || ( !bIsContainerSlot && bIsServerShell ) ) ) pSlot = 0; @@ -2475,7 +2449,7 @@ sal_Bool SfxDispatcher::HasSlot_Impl( sal_uInt16 nSlot ) } if ( SfxMacroConfig::IsMacroSlot( nSlot ) ) - // Makro-Slot? + // Macro-Slot? return sal_True; else if (nSlot >= SID_VERB_START && nSlot <= SID_VERB_END) { @@ -2490,7 +2464,7 @@ sal_Bool SfxDispatcher::HasSlot_Impl( sal_uInt16 nSlot ) } } - // SID gegen gesetzten Filter pr"ufen + // SID check against set filter sal_uInt16 nSlotEnableMode=0; if ( pImp->pFrame ) { @@ -2499,13 +2473,13 @@ sal_Bool SfxDispatcher::HasSlot_Impl( sal_uInt16 nSlot ) return sal_False; } - // im Quiet-Mode nur Parent-Dispatcher + // In Quiet-Mode only Parent-Dispatcher if ( pImp->bQuiet ) return sal_False; sal_Bool bReadOnly = ( 2 != nSlotEnableMode && pImp->bReadOnly ); -// ( pImp->pFrame && pImp->pFrame->GetObjectShell()); -// pImp->pFrame->GetObjectShell()->IsLoading() ); +// ( pImp->pFrame && pImp->pFrame->GetObjectShell()); +// pImp->pFrame->GetObjectShell()->IsLoading() ); for ( sal_uInt16 i=0 ; i < nTotCount; ++i ) { @@ -2520,27 +2494,27 @@ sal_Bool SfxDispatcher::HasSlot_Impl( sal_uInt16 nSlot ) if ( pSlot ) { - // Slot geh"ort zum Container? - FASTBOOL bIsContainerSlot = pSlot->IsMode(SFX_SLOT_CONTAINER); - FASTBOOL bIsInPlace = pImp->pFrame && pImp->pFrame->GetObjectShell()->IsInPlaceActive(); + // Slot belongs to Container? + bool bIsContainerSlot = pSlot->IsMode(SFX_SLOT_CONTAINER); + bool bIsInPlace = pImp->pFrame && pImp->pFrame->GetObjectShell()->IsInPlaceActive(); - // Shell geh"ort zum Server? - // AppDispatcher oder IPFrame-Dispatcher - FASTBOOL bIsServerShell = !pImp->pFrame || bIsInPlace; + // Shell belongs to Server? + // AppDispatcher or IPFrame-Dispatcher + bool bIsServerShell = !pImp->pFrame || bIsInPlace; - // Nat"urlich sind ServerShell-Slots auch ausf"uhrbar, wenn sie auf - // einem Container-Dispatcher ohne IPClient ausgef"uhrt werden sollen. + // Of course ShellServer-Slots are also executable even when it is + // excecuted on a container dispatcher without a IPClient if ( !bIsServerShell ) { SfxViewShell *pViewSh = pImp->pFrame->GetViewShell(); bIsServerShell = !pViewSh || !pViewSh->GetUIActiveClient(); } - // Shell geh"ort zum Container? - // AppDispatcher oder kein IPFrameDispatcher - FASTBOOL bIsContainerShell = !pImp->pFrame || !bIsInPlace; + // Shell belongs to Container? + // AppDispatcher or no IPFrameDispatcher + bool bIsContainerShell = !pImp->pFrame || !bIsInPlace; - // Shell und Slot passen zusammen + // Shell and Slot match if ( !( ( bIsContainerSlot && bIsContainerShell ) || ( !bIsContainerSlot && bIsServerShell ) ) ) pSlot = 0; @@ -2556,23 +2530,21 @@ sal_Bool SfxDispatcher::HasSlot_Impl( sal_uInt16 nSlot ) return sal_False; } - - //-------------------------------------------------------------------- sal_Bool SfxDispatcher::_FillState ( - const SfxSlotServer& rSvr, // abzufragende <Slot-Server> - SfxItemSet& rState, // zu f"ullendes <SfxItemSet> - const SfxSlot* pRealSlot // ggf. der tats"achliche Slot + const SfxSlotServer& rSvr, // <Slot-Server> to query + SfxItemSet& rState, // <SfxItemSet> to be filled + const SfxSlot* pRealSlot // The actual Slot if possible ) -/* [Beschreibung] +/* [Description] - Hilfsmethode zum Abfragen des Status des <Slot-Server>s rSvr. - In rState m"ussen die gew"unschten Slots-Ids (teilweise in Which-Ids - des betreffenden Pools umgewandelt) vorhanden sein. + Helper method to obtain the status of the <Slot-Server>s rSvr. + The required slots IDs (partly converted to Which-IDs of the pool) + must be present in rstate. - Der SfxDispatcher wird vor der Abfrage geflusht. + The SfxDispatcher is flushed before the query. */ { @@ -2595,9 +2567,9 @@ sal_Bool SfxDispatcher::_FillState return FALSE; // Flush(); - // Objekt ermitteln und Message an diesem Objekt aufrufen + // Determine the object and call the Message of this object SfxShell *pSh = GetShell(rSvr.GetShellLevel()); - DBG_ASSERT(pSh, "ObjektShell nicht gefunden"); + DBG_ASSERT(pSh, "ObjektShell not found"); SfxStateFunc pFunc; @@ -2608,7 +2580,7 @@ sal_Bool SfxDispatcher::_FillState pSh->CallState( pFunc, rState ); #ifdef DBG_UTIL - // pr"ufen, ob IDL (SlotMap) und aktuelle Items "ubereinstimmen + // To examine the conformity of IDL (SlotMap) and current Items if ( DbgIsAssertWarning() && rState.Count() ) { SfxInterface *pIF = pSh->GetInterface(); @@ -2643,10 +2615,9 @@ sal_Bool SfxDispatcher::_FillState //-------------------------------------------------------------------- const SfxPoolItem* SfxDispatcher::_Execute( const SfxSlotServer &rSvr ) -/* [Beschreibung] +/* [Description] - Diese Methode f"uhrt einen Request "uber einen gecachten <Slot-Server> - aus. + This method performs a request for a cached <Slot-Server>. */ { @@ -2663,7 +2634,7 @@ const SfxPoolItem* SfxDispatcher::_Execute( const SfxSlotServer &rSvr ) SFX_APP()->GetMacroConfig()->RegisterSlotId( nSlot ); if ( pSlot->IsMode(SFX_SLOT_ASYNCHRON) ) - //! ignoriert rSvr + //! ignore rSvr { SfxShell *pShell = GetShell( rSvr.GetShellLevel() ); SfxDispatcher *pDispat = this; @@ -2686,10 +2657,10 @@ const SfxPoolItem* SfxDispatcher::_Execute( const SfxSlotServer &rSvr ) } else { - // Objekt ermitteln und Message an diesem Objekt aufrufen + // Determine the object and call the Message of this object SfxShell *pSh = GetShell(rSvr.GetShellLevel()); SfxRequest aReq( pSlot->GetSlotId(), SFX_CALLMODE_RECORD, pSh->GetPool() ); - if ( Call_Impl( *pSh, *pSlot, aReq, sal_True ) ) // von Bindings immer recorden + if ( Call_Impl( *pSh, *pSlot, aReq, sal_True ) ) // Bindings always recording return aReq.GetReturnValue(); } } @@ -2794,12 +2765,11 @@ void SfxDispatcher::ExecutePopup( const ResId &rId, Window *pWin, const Point *p //-------------------------------------------------------------------- void SfxDispatcher::Lock( sal_Bool bLock ) -/* [Beschreibung] +/* [Description] - Mit dieser Methode kann der SfxDispatcher gesperrt und freigegeben - werden. Ein gesperrter SfxDispatcher f"uhrt keine <SfxRequest>s mehr - aus und liefert keine Status-Informationen mehr. Er verh"alt sich - so als w"aren alle Slots disabled. + With this method the SfxDispatcher can be locked and released. A locked + SfxDispatcher does not perform <SfxRequest>s and does no longer provide + status information. It behaves as if all the slots were disabled. */ { @@ -2830,10 +2800,10 @@ sal_uInt32 SfxDispatcher::GetObjectBarId( sal_uInt16 nPos ) const //-------------------------------------------------------------------- void SfxDispatcher::ResetObjectBars_Impl() -/* [Beschreibung] +/* [Description] - Mit dieser Methode werden alle Objectbar-Anforderungen, die dieser - Dispatcher an das AppWindow hat, beseitigt. + With this method all Objectbar requirements which this Dispatcher + imposes on the AppWindow are eliminated. */ { for (sal_uInt16 n=0; n<SFX_OBJECTBAR_MAX; n++) @@ -2921,10 +2891,10 @@ sal_Bool SfxDispatcher::GetReadOnly_Impl() const //------------------------------------------------------------------------- void SfxDispatcher::SetQuietMode_Impl( sal_Bool bOn ) -/* [Beschreibung] +/* [Description] - Bei 'bOn' stellt sich dieser Dispatcher quasi tot und leitet alles - an den Parent-Dispatcher weiter. + With 'bOn' the Dispatcher is quasi dead and transfers everything to the + Parent-Dispatcher. */ { @@ -2937,9 +2907,9 @@ void SfxDispatcher::SetQuietMode_Impl( sal_Bool bOn ) //------------------------------------------------------------------------- void SfxDispatcher::SetModalMode_Impl( sal_Bool bOn ) -/* [Beschreibung] +/* [Description] - Bei 'bOn' werden nur noch Slots des Parent-Dispatchers gefunden. + With 'Bon' only slots of the parent dispatcher are found. */ { @@ -3018,8 +2988,8 @@ sal_Bool SfxDispatcher::IsReadOnlyShell_Impl( sal_uInt16 nShell ) const return sal_True; } -// Ein dirty trick, um an die Methoden der private base class von -// SfxShellStack_Impl heranzukommen +// A dirty trick, to get hold of the methods of the private base class +// SfxShellStack_Impl class StackAccess_Impl : public SfxShellStack_Implarr_ {}; @@ -3027,7 +2997,7 @@ void SfxDispatcher::InsertShell_Impl( SfxShell& rShell, sal_uInt16 nPos ) { Flush(); - // Der cast geht, weil SfxShellStack_Impl keine eigenen member hat + // The cast is because SfxShellStack_Impl member has non of its own ((StackAccess_Impl*) (&pImp->aStack))->Insert( nPos, &rShell ); rShell.SetDisableFlags( pImp->nDisableFlags ); rShell.DoActivate_Impl(pImp->pFrame, sal_True); @@ -3045,7 +3015,7 @@ void SfxDispatcher::RemoveShell_Impl( SfxShell& rShell ) { Flush(); - // Der cast geht, weil SfxShellStack_Impl keine eigenen member hat + // The cast is because SfxShellStack_Impl member has non of its own StackAccess_Impl& rStack = *((StackAccess_Impl*) (&pImp->aStack)); sal_uInt16 nCount = rStack.Count(); for ( sal_uInt16 n=0; n<nCount; ++n ) @@ -3073,16 +3043,17 @@ sal_Bool SfxDispatcher::IsAllowed sal_uInt16 nSlot ) const /* - [Beschreibung] - Die Methode prueft, ob der Zugriff auf diese Schnittstelle erlaubt ist. - */ + [Description] + + The method checks whether the access is allowed on this interface. + */ { if ( !pImp->pDisableList ) { return sal_True; } - // BinSearch in der DisableListe + // BinSearch in the disable list SvUShorts& rList = *pImp->pDisableList; sal_uInt16 nCount = rList.Count(); sal_uInt16 nLow = 0, nMid = 0, nHigh; @@ -3092,7 +3063,7 @@ sal_Bool SfxDispatcher::IsAllowed while ( !bFound && nLow <= nHigh ) { nMid = (nLow + nHigh) >> 1; - DBG_ASSERT( nMid < nCount, "bsearch ist buggy" ); + DBG_ASSERT( nMid < nCount, "bsearch is buggy" ); int nDiff = (int) nSlot - (int) rList[nMid]; if ( nDiff < 0) @@ -3112,7 +3083,7 @@ sal_Bool SfxDispatcher::IsAllowed } #ifdef _DEBUG - // Slot in der Liste gefunden ? + // Slot found in the List? sal_uInt16 nPos = bFound ? nMid : nLow; DBG_ASSERT( nPos <= nCount, "" ); diff --git a/sfx2/source/control/macrconf.cxx b/sfx2/source/control/macrconf.cxx index 3b55e9362a..ed854c3532 100644 --- a/sfx2/source/control/macrconf.cxx +++ b/sfx2/source/control/macrconf.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,27 +30,19 @@ #include "precompiled_sfx2.hxx" #include <basic/sbstar.hxx> #include <basic/basmgr.hxx> -#ifndef _SBX_HXX //autogen #include <basic/sbx.hxx> #endif #include <svl/intitem.hxx> #include <basic/sbmeth.hxx> #include <basic/sbmod.hxx> -#ifndef _BASIC_SBUNO_HXX #include <basic/sbuno.hxx> -#endif #include <osl/mutex.hxx> #include <com/sun/star/script/XEngine.hpp> #include <com/sun/star/document/MacroExecMode.hpp> -#ifndef GCC -#endif - -#ifndef _UNOTOOLS_PROCESSFACTORY_HXX #include <comphelper/processfactory.hxx> -#endif #include <unotools/intlwrapper.hxx> #include <sfx2/msgpool.hxx> @@ -94,8 +87,8 @@ void SfxMacroConfig::Release_Impl() struct SfxMacroConfig_Impl { SfxMacroInfoArr_Impl aArr; - sal_uInt32 nEventId; - sal_Bool bWaitingForCallback; + sal_uInt32 nEventId; + sal_Bool bWaitingForCallback; SfxMacroConfig_Impl() : nEventId( 0 ) @@ -187,7 +180,7 @@ SfxMacroInfo::SfxMacroInfo( const String& rURL ) : if ( aTmp.GetTokenCount('/') > 3 ) { // 'macro:///lib.mod.proc(args)' => Macro via App-BASIC-Mgr - // 'macro://[docname|.]/lib.mod.proc(args)' => Macro via zugehoerigen Doc-BASIC-Mgr + // 'macro://[docname|.]/lib.mod.proc(args)' => Macro via included Doc-BASIC-Mgr if ( aTmp.CompareToAscii("///", 3 ) != COMPARE_EQUAL ) bAppBasic = FALSE; aTmp = rURL.GetToken( 3, '/' ); @@ -234,7 +227,7 @@ SfxMacroInfo::SfxMacroInfo(bool _bAppBasic, const String& rLibName, //========================================================================== SfxMacroInfo::SfxMacroInfo(bool _bAppBasic, const String& rQualifiedName ) -: pHelpText(0), +: pHelpText(0), nRefCnt(0), bAppBasic(_bAppBasic), nSlotId(0), @@ -274,7 +267,7 @@ SfxMacroInfo::~SfxMacroInfo() sal_Bool SfxMacroInfo::operator==(const SfxMacroInfo& rOther) const { if ( GetQualifiedName() == rOther.GetQualifiedName() && - bAppBasic == rOther.bAppBasic ) + bAppBasic == rOther.bAppBasic ) return sal_True; else return sal_False; @@ -307,14 +300,16 @@ String SfxMacroInfo::GetQualifiedName() const aMacroName += '.'; } - // Wg. ::com::sun::star::script::JavaScript kein Zerlegen des Strings mehr + // due to ::com::sun::star::script::JavaScript + // no more disassembly of the string aMacroName += aMethodName; return aMacroName; } String SfxMacroInfo::GetFullQualifiedName() const { - // Liefert nur Unsinn, wenn f"ur ein ::com::sun::star::script::JavaScript aufgerufen ! + // Returns only nonsense, when called for a + // ::com::sun::star::script::JavaScript ! String aRet; if ( bAppBasic ) aRet = SFX_APP()->GetName(); @@ -329,7 +324,7 @@ String SfxMacroInfo::GetURL() const return aMethodName; // 'macro:///lib.mod.proc(args)' => Macro via App-BASIC-Mgr - // 'macro://[docname|.]/lib.mod.proc(args)' => Macro via zugehoerigen Doc-BASIC-Mgr + // 'macro://[docname|.]/lib.mod.proc(args)' => Macro via included Doc-BASIC-Mgr // 'macro://obj.method(args)' => Object via App-BASIC-Mgr String aURL( String::CreateFromAscii("macro://") ); if ( !bAppBasic ) @@ -411,83 +406,6 @@ void SfxMacroInfo::SetHelpText( const String& rName ) *pHelpText = rName; } -//========================================================================== - -SvStream& operator >> (SvStream& rStream, SfxMacroInfo& rInfo) -{ - sal_uInt16 nAppBasic, nFileVersion; - String aDocName; - - rStream >> nFileVersion; - if ( nVersion < nCompatVersion ) - { - // In der 1.Version ohne Versionskennung - nAppBasic = nVersion; - nFileVersion = 1; - rStream.ReadByteString(aDocName,RTL_TEXTENCODING_UTF8); - rStream.ReadByteString(rInfo.aLibName,RTL_TEXTENCODING_UTF8); - rStream.ReadByteString(rInfo.aModuleName,RTL_TEXTENCODING_UTF8); - rStream.ReadByteString(rInfo.aMethodName,RTL_TEXTENCODING_UTF8); - } - else - { - String aInput; - rStream >> nAppBasic; - rStream.ReadByteString(aDocName,RTL_TEXTENCODING_UTF8); // Vorsicht: kann bei AppName Unsinn sein! - rStream.ReadByteString(rInfo.aLibName,RTL_TEXTENCODING_UTF8); - rStream.ReadByteString(rInfo.aModuleName,RTL_TEXTENCODING_UTF8); - rStream.ReadByteString(aInput,RTL_TEXTENCODING_UTF8); - - if ( nFileVersion == nCompatVersion ) - rInfo.aMethodName = aInput; - else - { - sal_uInt16 nCount = aInput.GetTokenCount('.'); - rInfo.aMethodName = aInput.GetToken( nCount-1, '.' ); - if ( nCount > 1 ) - rInfo.aModuleName = aInput.GetToken( nCount-2, '.' ); - if ( nCount > 2 ) - rInfo.aLibName = aInput.GetToken( 0, '.' ); - } - } - - rInfo.bAppBasic = (sal_Bool) nAppBasic; - return rStream; -} - -int SfxMacroInfo::Load( SvStream& rStream ) -{ - rStream >> (*this); - nSlotId = SFX_APP()->GetMacroConfig()->GetSlotId(this); - return 0; -} - -//========================================================================== - -SvStream& operator << (SvStream& rStream, const SfxMacroInfo& rInfo) -{ - if ( rInfo.bAppBasic ) - { - rStream << nVersion - << (sal_uInt16) rInfo.bAppBasic; - rStream.WriteByteString(rInfo.GetBasicName(),RTL_TEXTENCODING_UTF8); - rStream.WriteByteString(rInfo.aLibName,RTL_TEXTENCODING_UTF8); - rStream.WriteByteString(rInfo.aModuleName,RTL_TEXTENCODING_UTF8); - rStream.WriteByteString(rInfo.aMethodName,RTL_TEXTENCODING_UTF8); - } - else - { - rStream << nVersion - << (sal_uInt16) rInfo.bAppBasic; - rStream.WriteByteString(SFX_APP()->GetName(),RTL_TEXTENCODING_UTF8); - rStream.WriteByteString(rInfo.aLibName,RTL_TEXTENCODING_UTF8); - rStream.WriteByteString(rInfo.aModuleName,RTL_TEXTENCODING_UTF8); - rStream.WriteByteString(rInfo.aMethodName,RTL_TEXTENCODING_UTF8); - } - - return rStream; -} - sal_Bool SfxMacroInfo::Compare( const SvxMacro& rMacro ) const { String aName = rMacro.GetLibName(); @@ -521,17 +439,18 @@ SFX_EXEC_STUB( SfxApplication, MacroExec_Impl ) sal_uInt16 SfxMacroConfig::GetSlotId(SfxMacroInfoPtr pInfo) { - sal_uInt16 nCount = pImp->aArr.Count(); // Macro suchen + sal_uInt16 nCount = pImp->aArr.Count(); // Search for Macro sal_uInt16 i; for (i=0; i<nCount; i++) if ((*(pImp->aArr)[i]) == (*pInfo)) break; if (i == nCount) - { // Macro noch unbekannt + { + // Macro still unknown nCount = aIdArray.Count(); sal_uInt16 n; - for (n=0; n<nCount; n++) // freie SlotId suchen + for (n=0; n<nCount; n++) // Seearch for free SlotId if (aIdArray[n] > SID_MACRO_START + n) break; @@ -564,7 +483,7 @@ sal_uInt16 SfxMacroConfig::GetSlotId(SfxMacroInfoPtr pInfo) else pNewSlot->pNextSlot = pNewSlot; - // Macro uebernehmen + // Take over Macro SfxMacroInfoPtr pNewInfo = new SfxMacroInfo(*pInfo); pNewInfo->nSlotId = SID_MACRO_START + n; pImp->aArr.Insert(pNewInfo,n); @@ -585,7 +504,7 @@ sal_uInt16 SfxMacroConfig::GetSlotId(SfxMacroInfoPtr pInfo) void SfxMacroConfig::ReleaseSlotId(sal_uInt16 nId) { - DBG_ASSERT( IsMacroSlot( nId ), "SlotId ist kein Macro!"); + DBG_ASSERT( IsMacroSlot( nId ), "SlotId is no Macro!"); sal_uInt16 nCount = pImp->aArr.Count(); for (sal_uInt16 i=0; i<nCount; i++) @@ -596,23 +515,23 @@ void SfxMacroConfig::ReleaseSlotId(sal_uInt16 nId) pInfo->nRefCnt--; if (pInfo->nRefCnt == 0) { - // Slot wird nicht mehr referenziert, also holen + // Slot is no longer referenced, so get SfxSlot *pSlot = pInfo->pSlot; - // Slot aus der Verkettung rausnehmen + // Take out Slot from the concatenation while (pSlot->pNextSlot != pInfo->pSlot) pSlot = (SfxSlot*) pSlot->pNextSlot; pSlot->pNextSlot = pInfo->pSlot->pNextSlot; - // Slot selbst kurz schlie\sen + // Slot close itself briefly pSlot = pInfo->pSlot; pSlot->pNextSlot = pSlot; - // MacroInfo aus Array entfernen, damit sie kein Unheil - // anrichten kann + // Remove Macro info from array so that it can not cause + // any harm pImp->aArr.Remove(i); - // SlotId wieder freigeben + // Release SlotId again sal_uInt16 nIdCount = aIdArray.Count(); for (sal_uInt16 n=0; n<nIdCount; n++) { @@ -623,9 +542,9 @@ void SfxMacroConfig::ReleaseSlotId(sal_uInt16 nId) } } - // Sofern nicht die Applikation heruntergefahren wird, mu\s - // der Slot asynchron gel"oscht werden, falls er in seinem - // eigenen Execute abgeschossen wird! + // Unless the application is not shut down, then + // the Slot has to be deleted asynchronously if cancelled in + // its own Execute! if ( !SFX_APP()->Get_Impl()->bInQuit ) pImp->nEventId = Application::PostUserEvent( LINK(this, SfxMacroConfig, EventHdl_Impl), pInfo ); else @@ -635,14 +554,14 @@ void SfxMacroConfig::ReleaseSlotId(sal_uInt16 nId) } } - DBG_ERROR("Macro-SlotId nicht gefunden!"); + DBG_ERROR("Macro-SlotId is not found!"); } //========================================================================== void SfxMacroConfig::RegisterSlotId(sal_uInt16 nId) { - DBG_ASSERT( IsMacroSlot( nId ), "SlotId ist kein Macro!"); + DBG_ASSERT( IsMacroSlot( nId ), "SlotId is no Macro!"); sal_uInt16 nCount = pImp->aArr.Count(); for (sal_uInt16 i=0; i<nCount; i++) @@ -654,7 +573,7 @@ void SfxMacroConfig::RegisterSlotId(sal_uInt16 nId) } } - DBG_ERROR("Macro-SlotId nicht gefunden!"); + DBG_ERROR("Macro-SlotId is not found!"); } //========================================================================== @@ -693,7 +612,7 @@ sal_Bool SfxMacroConfig::ExecuteMacro( sal_uInt16 nId, const String& rArgs ) con SvxMacro aMacro( pInfo->GetQualifiedName(), pInfo->GetBasicName(), STARBASIC ); sal_Bool bRet = ExecuteMacro( pSh, &aMacro, rArgs ); - // Release, da im Dispatcher-Execute ein Register gemacht wurde + // Release, because a register was created in the dispatcher Execute ((SfxMacroConfig*)this)->ReleaseSlotId( nId ); return bRet; } @@ -702,11 +621,11 @@ sal_Bool SfxMacroConfig::ExecuteMacro( SfxObjectShell *pSh, const SvxMacro* pMac { SfxApplication *pApp = SFX_APP(); - // Name des Macros oder Scripts bzw. ScriptCode + // Name of the Macros or Scripts (ScriptCode) String aCode( pMacro->GetMacName() ); ErrCode nErr = ERRCODE_NONE; - // Ist es ein Basic-Macro ? + // Is it a Basic-Macro ? ScriptType eSType = pMacro->GetScriptType(); sal_Bool bIsBasic = eSType == STARBASIC; sal_Bool bIsStarScript = ( eSType == EXTENDED_STYPE && pMacro->GetLibName().SearchAscii( "StarScript" ) != STRING_NOTFOUND ); @@ -718,10 +637,10 @@ sal_Bool SfxMacroConfig::ExecuteMacro( SfxObjectShell *pSh, const SvxMacro* pMac BasicManager *pAppMgr = SFX_APP()->GetBasicManager(); if( bIsBasic ) { - // BasicManager von Document? + // BasicManager of the Document? BasicManager *pMgr = pSh ? pSh->GetBasicManager() : NULL; - // Da leider der Name zwischendurch h"aufig gewechselt hat ... + // As the name has unfortunately been changed often ... if( SFX_APP()->GetName() == pMacro->GetLibName() || pMacro->GetLibName().EqualsAscii("StarDesktop") ) pMgr = pAppMgr; @@ -761,16 +680,16 @@ sal_Bool SfxMacroConfig::CheckMacro( SfxObjectShell *pSh, const SvxMacro* pMacro { SfxApplication *pApp = SFX_APP(); - // Name des Macros oder Scripts bzw. ScriptCode + // Name of Macros or Scripts (ScriptCode) String aCode( pMacro->GetMacName() ); ErrCode nErr = ERRCODE_NONE; - // BasicManager von Document oder Application + // BasicManager of Document or Application pApp->EnterBasicCall(); BasicManager *pAppMgr = SFX_APP()->GetBasicManager(); BasicManager *pMgr = pSh ? pSh->GetBasicManager() : NULL; - // Da leider der Name zwischendurch h"aufig gewechselt hat ... + // As the name has unfortunately been changed often ... if( SFX_APP()->GetName() == pMacro->GetLibName() || pMacro->GetLibName().EqualsAscii("StarDesktop") ) pMgr = pAppMgr; @@ -791,14 +710,15 @@ sal_Bool SfxMacroConfig::CheckMacro( sal_uInt16 nId ) const if ( !pInfo ) return sal_False; - // Basic nur initialisieren, wenn default nicht ::com::sun::star::script::JavaScript; dann mu\s - // in IsBasic() sowieso das Basic angelegt werden + // only initialize Basic, when default is not + // ::com::sun::star::script::JavaScript; then the Basic has to be created + // anyway in IsBasic() SfxObjectShell* pSh = SfxObjectShell::Current(); SfxApplication *pApp = SFX_APP(); pApp->EnterBasicCall(); - // BasicManager von Document oder Application + // BasicManager of Document or Application BasicManager *pAppMgr = SFX_APP()->GetBasicManager(); BasicManager *pMgr = pSh ? pSh->GetBasicManager() : NULL; @@ -872,3 +792,4 @@ sal_Bool SfxMacroConfig::IsMacroSlot( sal_uInt16 nId ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/control/macro.cxx b/sfx2/source/control/macro.cxx index da904d4a20..03efe61eae 100644 --- a/sfx2/source/control/macro.cxx +++ b/sfx2/source/control/macro.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -45,181 +46,91 @@ SV_IMPL_PTRARR( SfxStatements_Impl, SfxMacroStatement* ); struct SfxMacro_Impl -/* [Beschreibung] +/* [Description] - Implementations-Struktur der Klasse <SfxMacro>. + Implementation structure for the <SfxMacro> class. */ { - SfxMacroMode eMode; /* Zweck der <SfxMacro>-Instanz, - Bedeutung siehe enum <SfxMacroMode> */ - SfxStatements_Impl aList; /* Liste von aufgezeichneten Statements */ + SfxMacroMode eMode; /* purpose of the <SfxMacro> instance, + for meaning see enum <SfxMacroMode> */ + SfxStatements_Impl aList; /* List of recorded Statements */ }; //==================================================================== SfxMacroStatement::SfxMacroStatement ( - const SfxShell& /*rShell*/, // <SfxShell>, die den Request ausf"uhrte - const String& /*rTarget*/, // Name des Zielobjektes vor der Ausf"urhung - BOOL /*bAbsolute*/, // obsolet - const SfxSlot& rSlot, // der <SfxSlot>, der das Statement abspielen kann - BOOL bRequestDone, // wurde der Request tats"achlich ausgef"uhrt + const SfxShell& /*rShell*/, // <SfxShell> which excexutes the Request + const String& /*rTarget*/, // Name of the target object for the + // excecution + BOOL /*bAbsolute*/, // obsolete + const SfxSlot& rSlot, // the <SfxSlot>, which can read the + // statement + BOOL bRequestDone, // Was the Request really excecuted ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >& rArgs ) -/* [Beschreibung] +/* [Description] Dieser Konstruktor der Klasse SfxMacroStatement erzeugt ein Statement, bei dem ein Objekt angesprochen wird, welches durch 'rShell' angegeben ist. Dabei erfolgt die Addressierung je nach 'bAbsolute' absolut, also z.B. als '[mydoc.sdc]' oder relativ, also z.B. 'ActiveDocument'. - Je nach Art der Subklasse von 'rShell' ergeben sich folgende - Ausdr"ucke: + This constructor of the SfxMacroStatement class generate a statement in + which an object is brought up, which is given by 'rShell'. Thus It is + addressing the ever after 'bAbsolute' absolute, for example, as '[mydoc.sdc]', or relative, that is 'active document'. - | absolut relativ + Depending on the subclass of 'rShell', the following terms: + + | absolute relative ----------------------------------------------------------------------- - SfxApplication' | 'StarCalc' 'Application' + SfxApplication' | 'StarCalc' 'Application' SfxViewFrame' | '[mydoc.sdc:1]' 'ActiveWindow' SfxViewShell' | '[mydoc.sdc:1]' 'AvtiveWindow' SfxObjectShell' | '[mydoc.sdc]' 'ActiveDocument' - sonstige (Sub-Shells) | '[mydoc.sdc:1]' 'ActiveWindow' + sonstige (Sub-Shells) | '[mydoc.sdc:1]' 'ActiveWindow' Dabei sind 'StarCalc' stellvertretend fuer den Namen der Applikation - (Application::GetAppName()const). In der absoluten Fassung k"onnte + (Application::GetAppName()const). In der absoluten Fassung könnte die Selektion auch deskriptiv z.B. als 'CellSelection("A5-D8")') angesprochen werden, dazu mu\ jedoch vom Anwendungsprogrammierer der Konstruktor <SfxMacroStatement::SfxMacroStatement(const String&, const SfxSlot&,BOOL,SfxArguments*)> verwendet werden. - F"ur das so bezeichnete Objekt wird dann je nach Typ des Slots - eine Zuweisung an eines seiner Properties oder der Aufruf einer seiner - Methoden ausgedr"uckt. - + For the so-called object is then, depending on the type of slots, + expressed as an assignment to one of its properties or calling its methods. - [Beispiele] + [Example] - absolut: + absolute: SCalc3.OpenDocument( "\docs\mydoc.sdd", "StarDraw Presentation", 0, 0 ) [mydoc.sdd].Activate() [mydoc.sdd:1].SwitchToView( 2 ) [mydoc.sdc:1:1].CellSelection( "A5-D8" ).LineColor = 192357 - relativ: + relative: ActiveWindow.LineColor = 192357 - - [Querverweise] + [Cross-reference] <SfxMacroStatement::SfxMacroStatement(const String&,const SfxSlot&,BOOL,SfxArguments*)> <SfxMacroStatement::SfxMacroStatement(const String&)> */ -: nSlotId( rSlot.GetSlotId() ), +: nSlotId( rSlot.GetSlotId() ), aArgs( rArgs ), bDone( bRequestDone ), pDummy( 0 ) { - // Workaround Recording nicht exportierter Slots (#25386#) + // Workaround Recording non exported Slots (#25386#) if ( !rSlot.pName ) return; -/* - // Objekt-Typ bestimmen - FASTBOOL bIsApp = rShell.ISA(SfxApplication); - FASTBOOL bIsDoc = rShell.ISA(SfxObjectShell); - FASTBOOL bIsWin = !bIsApp && !bIsDoc && - ( rShell.ISA(SfxViewShell) || rShell.ISA(SfxViewFrame) ); - FASTBOOL bIsSel = !bIsApp && !bIsDoc && !bIsWin; - - // Objekt nicht schon im Slot-Namen enthalten? - if ( bIsSel || rSlot.pName[0] == '.' ) - { - // absolutes Aufzeichnen? - if ( rSlot.IsMode( SFX_SLOT_RECORDABSOLUTE ) ) - { - // an der Applikation oder am Modul - if ( rShell.ISA(SfxApplication) || rShell.ISA(SfxModule) ) - aStatement = rTarget; - - // am Dokument? - // '[' = 5Bh - // ']' = 5Dh - else if ( rShell.ISA(SfxObjectShell) ) - { - aStatement = 0x005B; - aStatement += rTarget; - aStatement += 0x005D; - } - - else if ( rShell.ISA(SfxViewFrame) ) - { - aStatement = 0x005B; - aStatement += String::CreateFromAscii("ViewFrame");//rShell.GetSbxObject()->GetName(); - aStatement += 0x005D; - } - - else - { - // an der View oder Sub-Shell - SfxViewShell *pViewShell = rShell.GetViewShell(); - aStatement = 0x005B; - aStatement += String::CreateFromAscii("ViewShell");//pViewShell->GetViewFrame()->GetSbxObject()->GetName(); - aStatement += 0x005D; - if ( !rShell.ISA(SfxViewFrame) ) - // an einer Sub-Shell zus"atlich ".Selection" anh"angen - aStatement += DEFINE_CONST_UNICODE(".Selection"); - } - } - else // relatives Aufzeichnen - { - // an der Application? - if ( rShell.ISA(SfxApplication) ) - aStatement = DEFINE_CONST_UNICODE("Application"); - - // am Modul? - else if ( rShell.ISA(SfxModule) ) - aStatement = DEFINE_CONST_UNICODE("ActiveModule"); - // am Dokument - else if ( rShell.ISA(SfxObjectShell) ) - aStatement = DEFINE_CONST_UNICODE("ActiveDocument"); - - // am Window - else if ( rShell.ISA(SfxViewShell) || rShell.ISA(SfxViewFrame) ) - aStatement = DEFINE_CONST_UNICODE("ActiveWindow"); - - else - // an einer Sub-Shell - aStatement = DEFINE_CONST_UNICODE("Selection"); - } - } - - if ( bIsSel ) - { - // bei Selection ggf. noch den Namen der SubShell anh"angen - const SfxShellObject *pShObj = - (const SfxShellObject*) rShell.GetSbxObject(); - if ( pShObj ) - { - const SfxShellObject *pParentObj = - (const SfxShellObject*) pShObj->GetParent(); - SfxShell *pParentSh = pParentObj->GetShell(); - DBG_ASSERT( pParentSh->ISA(SfxViewFrame), - "parent of SubShell must be a Frame" ); - if ( rSlot.pName[0] == '.' ) - { - aStatement += '.'; - aStatement += rShell.GetSbxObject()->GetName(); - } - } - else - DBG_ASSERT( rSlot.pName[0] != '0', "recording unnamed object" ); - } -*/ aStatement = DEFINE_CONST_UNICODE("Selection"); - // an diesen Objekt-Ausdruck den Methoden-/Property-Namen und Parameter + // to these object expression of the Method-/Property-Name and parameters GenerateNameAndArgs_Impl( SfxRequest::GetRecordingMacro(), rSlot, bRequestDone, aArgs); } @@ -227,22 +138,22 @@ SfxMacroStatement::SfxMacroStatement SfxMacroStatement::SfxMacroStatement ( - const String& rTarget, // Objekt, was beim Playing angesprochen wird - const SfxSlot& rSlot, // der <SfxSlot>, der das Statement abspielen kann - BOOL bRequestDone, // wurde der Request tats"achlich ausgef"uhrt + const String& rTarget, // The Object which is addressed while playing + const SfxSlot& rSlot, // The <SfxSlot>, which can playback the statement + BOOL bRequestDone, // was the Request actually performed ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >& rArgs ) -/* [Beschreibung] +/* [Description] - [Querverweise] + [Cross-reference] <SfxMacroStatement::SfxMacroStatement(const String&)> <SfxMacroStatement::SfxMacroStatement(const SfxShell&,BOOL,const SfxSlot&,BOOL,SfxArguments*)> */ -: nSlotId( rSlot.GetSlotId() ), +: nSlotId( rSlot.GetSlotId() ), aArgs( rArgs ), bDone( bRequestDone ), pDummy( 0 ) @@ -256,25 +167,24 @@ SfxMacroStatement::SfxMacroStatement SfxMacroStatement::SfxMacroStatement ( - const String& rStatement // manuell erzeugte(s) Statement(s) + const String& rStatement // manually generated statement(s) ) -/* [Beschreibung] - - Dieser Konstruktor erzeugt eine SfxMacroStatement-Instanz, deren - Aufbau vollst"andig vom Applikationsentwickler bestimmt wird. Da der - angegebene String auch mehrere mit CR/LF getrennte Statements - enthalten darf, ist damit ein weitgehender Eingriff in das Aufzeichnen - von BASIC-Makros m"oglich, um Spezialf"alle zu behandeln. +/* [Description] + This constructor creates a SfxMacroStatement instance, its structure is + determined completely by the application developer. Because the specified + string may contain several statements separated with CR/LF, which enables + a extensive in the recording of BASIC-macros, in order to handle special + cases. - [Querverweise] + [Cross-reference] <SfxMacroStatement::SfxMacroStatement(const String&,const SfxSlot&,BOOL,SfxArguments*)> <SfxMacroStatement::SfxMacroStatement(const SfxShell&,BOOL,const SfxSlot&,BOOL,SfxArguments*)> */ -: nSlotId( 0 ), +: nSlotId( 0 ), aStatement( rStatement ), bDone( TRUE ), pDummy( 0 ) @@ -285,15 +195,15 @@ SfxMacroStatement::SfxMacroStatement SfxMacroStatement::SfxMacroStatement ( - const SfxMacroStatement& rOrig // Original, von dem kopiert wird + const SfxMacroStatement& rOrig // Original, from which it will be copied ) -/* [Beschreibung] +/* [Description] - Copy-Konstruktor der SfxMacroStatement-Klasse. + Copy constructor of the sSfxMacroStatement class. */ -: nSlotId( rOrig.nSlotId ), +: nSlotId( rOrig.nSlotId ), aStatement( rOrig.aStatement ), bDone( rOrig.bDone ), pDummy( 0 ) @@ -305,10 +215,10 @@ SfxMacroStatement::SfxMacroStatement SfxMacroStatement::~SfxMacroStatement() -/* [Beschreibung] +/* [Description] - Destruktor der Klasse SfxMacroStatement. Gibt die Liste der - aktuellen Parameter frei. + Destructor of the SfxMacroStatement class. Frees the list of the + current parameters. */ { @@ -318,18 +228,17 @@ SfxMacroStatement::~SfxMacroStatement() void SfxMacroStatement::GenerateNameAndArgs_Impl ( - SfxMacro* /*pMacro*/, // darin wird aufgezeichnet - const SfxSlot& rSlot, // der Slot, der das Statement abspielen kann - BOOL bRequestDone, // TRUE=wurde ausgef"uhrt, FALSE=abgebrochen + SfxMacro* /*pMacro*/, // in this is recorded + const SfxSlot& rSlot, // the slot, which can playback the statement + BOOL bRequestDone, // TRUE=was executed, FALSE=cancelled ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >& /*rArgs*/ ) -/* [Beschreibung] +/* [Description] - Interne Hilfsmethode zum generieren des Funktions-/Property-Names - sowie der Parameter. Diese Methode wird nur verwendet, wenn der - Anwendungsprogrammierer keinen eigenen Source an den <SfxRequest> - geh"angt hat. + Internal utility method for generating the functions-/property-names as + well as the parameter. This method is only used if the application + programmer has not attached his own source to the <SfxRequest>. */ { @@ -337,18 +246,18 @@ void SfxMacroStatement::GenerateNameAndArgs_Impl && rSlot.pName[0] != '.' ) aStatement += '.'; - // der Name des Slots ist der Name der Methode / des Properties + // The name of the slots is the name of the method or properties aStatement += String::CreateFromAscii(rSlot.pName); if ( rSlot.IsMode(SFX_SLOT_METHOD) ) aStatement += DEFINE_CONST_UNICODE("( "); else aStatement += DEFINE_CONST_UNICODE(" = "); - // alle zusammengesuchten Parameter rausschreiben + // Print all required Parameters if ( aArgs.getLength() ) for ( USHORT nArg = 0; nArg < aArgs.getLength(); ++nArg ) { - // den Parameter textuell darstellen + // represent the parameters textually String aArg; ::com::sun::star::uno::Any& rValue = aArgs[nArg].Value; ::com::sun::star::uno::Type pType = rValue.getValueType(); @@ -375,23 +284,23 @@ void SfxMacroStatement::GenerateNameAndArgs_Impl ::rtl::OUString sTemp; rValue >>= sTemp; - // Anf"uhrungszeichen werden verdoppelt + // Quotation marks are doubled XubString aRecordable( sTemp ); USHORT nPos = 0; while ( TRUE ) { - nPos = aRecordable.SearchAndReplace( DEFINE_CONST_UNICODE('"'), DEFINE_CONST_UNICODE("\"\""), nPos ); + nPos = aRecordable.SearchAndReplace( String('"'), DEFINE_CONST_UNICODE("\"\""), nPos ); if ( STRING_NOTFOUND == nPos ) break; nPos += 2; } - // nicht druckbare Zeichen werden als chr$(...) geschrieben - FASTBOOL bPrevReplaced = FALSE; + // non-printable characters are written as chr $(...) + bool bPrevReplaced = false; for ( USHORT n = 0; n < aRecordable.Len(); ++n ) { sal_Unicode cChar = aRecordable.GetChar(n); - if ( !( cChar>=32 && cChar!=127 ) ) // ALS ERSATZ FUER String::IsPrintable()! + if ( !( cChar>=32 && cChar!=127 ) ) // As replacement for String::IsPrintable()! { XubString aReplacement( DEFINE_CONST_UNICODE("+chr$(") ); aReplacement += cChar; @@ -411,24 +320,16 @@ void SfxMacroStatement::GenerateNameAndArgs_Impl aRecordable.Insert( aReplacement, n + 1 ); n = n + aReplacement.Len(); } - bPrevReplaced = TRUE; + bPrevReplaced = true; } else - bPrevReplaced = FALSE; + bPrevReplaced = false; - // Argument in Anf"uhrungszeichen + // Argument in quotation marks aArg = '"'; aArg += aRecordable; aArg += '"'; } -/* - case SbxBYTE: - { - // als Zahl darstellen - aArg = (USHORT) rVar.GetByte(); - break; - } -*/ } else { @@ -436,12 +337,12 @@ void SfxMacroStatement::GenerateNameAndArgs_Impl pType == ::getVoidCppuType(), "Unknown Type in recorder!" ); } - // den Parameter anh"angen + // Attach the parameter aStatement += aArg; aStatement += DEFINE_CONST_UNICODE(", "); } - // Statement beeden + // End statement if ( aArgs.getLength() ) aStatement.Erase( aStatement.Len() - 2, 1 ); else @@ -450,7 +351,7 @@ void SfxMacroStatement::GenerateNameAndArgs_Impl aStatement += ')'; if ( !bRequestDone ) - // nicht als "Done()" gekennzeichnete Statements auskommentieren + // not comment out the "Done ()" marked statements aStatement.InsertAscii( "rem ", 0 ); } @@ -458,29 +359,28 @@ void SfxMacroStatement::GenerateNameAndArgs_Impl SfxMacro::SfxMacro ( - SfxMacroMode eMode // Zweck der Instanz, siehe <SfxMacroMode> + SfxMacroMode eMode // Purpose of the instance, see <SfxMacroMode> ) -/* [Beschreibung] +/* [Description] - Konstruktor der Klasse SfxMacro. Instanzen dieser Klasse werden im - SFx zu zwei Zwecken ben"otigt: + Constructor of the SfxMacro class. Instances of this class are required + for two purposes in SFx: - 1. zum Aufzeichnen von Makros - In diesem Fall wird der Konstruktor mit SFX_MACRO_RECORDINGABSOLUTE - oder SFX_MACRO_RECORDINGRELATIVE aufgerufen. Es sollte sich um eine - Instanz einer abgeleiteten Klasse handeln, um in der Ableitung - die Information dar"uber unterzubringen, wo das Makro gespeichert - werden soll. Ein solches Makro solle sich dann in seinem Destruktor - an der vom Benutzer gew"ahlten Stelle speichern. + 1. for recording macros + In this cas is th constructor called with SFX_MACRO_RECORDINGABSOLUTE or + SFX_MACRO_RECORDINGRELATIVE. Should be an instance of a derived class, + in order to acommodate the derivation of information, where the macro + should be saved. Such a macro should, in its destructor, be saved at the + location specified by the user. - 2. zum Zuordnen von exisitierenden Makros - In diesem Fall wird der Konstruktor mit SFX_MACRO_EXISTING aufgerufen. - Eine solche Instanz wird z.B. ben"otigt, wenn Makros auf Events - oder <SfxControllerItem>s konfiguriert werden sollen. + 2. Assignment of exisiting macros + In this case the constructor is called with SFX_MACRO_EXISTING. + Such a instance is for example needed when macros are to be configured for + events or <SfxControllerItem>s. */ -: pImp( new SfxMacro_Impl ) +: pImp( new SfxMacro_Impl ) { pImp->eMode = eMode; @@ -490,15 +390,13 @@ SfxMacro::SfxMacro SfxMacro::~SfxMacro() -/* [Beschreibung] - - Virtueller Destruktor der Klasse SfxMacro. Dieser sollte in den - abgeleiteten Klassen "uberladen werden, um in den Modi - SFX_MACRO_RECORDINGABSOLUTE und SFX_MACRO_RECORDINGRELATIVE den - aufgezeichneten Source abzuspeichern. +/* [Description] + Virtual Destructor of the SfxMacro class. This should be overloaded in + the derived classes to save the recorded source in the mode + SFX_MACRO_RECORDINGABSOLUTE and SFX_MACRO_RECORDINGRELATIVE. - [Querverweise] + [Cross-reference] <SfxMacro::GenerateSource()const> */ @@ -515,13 +413,12 @@ SfxMacro::~SfxMacro() SfxMacroMode SfxMacro::GetMode() const -/* [Beschreibung] - - Liefert den Modus, der besagt zu welchem Zweck das SfxMacro konstruiert - wurde. +/* [Description] + Returns the mode, which indicates for what purpose this SfxMacro was + constructed. - [Querverweise] + [Cross-reference] enum <SfxMacroMode> */ @@ -534,21 +431,20 @@ SfxMacroMode SfxMacro::GetMode() const void SfxMacro::Record ( - SfxMacroStatement* pStatement // aufzuzeichnendes <SfxMacroStatement> + SfxMacroStatement* pStatement // the recordning <SfxMacroStatement> ) -/* [Beschreibung] +/* [Description] - Diese Methode zeichnet das als Parameter "ubergeben Statement auf. - Die Instanz auf die der "ubergebe Pointer zeigt, geht in das Eigentum - des SfxMacro "uber. + This method features the parameters passed on as a Statement. The + instance to which the pointer points is transfered to the ownership + of SfxMacro. - Der Aufruf ist nur g"ultig, wenn es sich um ein SfxMacro handelt, - welches mit SFX_MACRO_RECORDINGABSOLUTE oder SFX_MACRO_RECORDINGRELATIVE - konstruiert wirde. + The call is only valid if it is about a SfxMacro, which was constructed + with SFX_MACRO_RECORDINGRELATIVE or SFX_MACRO_RECORDINGABSOLUTE and is + available as an already recorded statement. - - [Querverweise] + [Cross-reference] <SfxMacro::Replace(SfxMacroStatement*)> <SfxMacro::Remove()> @@ -564,35 +460,30 @@ void SfxMacro::Record void SfxMacro::Replace ( - SfxMacroStatement* pStatement // aufzuzeichnendes <SfxMacroStatement> + SfxMacroStatement* pStatement // the recording <SfxMacroStatement> ) -/* [Beschreibung] - - Diese Methode zeichnet das als Parameter "ubergeben Statement auf. - Dabei wird das jeweils zuletzt aufgezeichnete Statement "uberschrieben. - Die Instanz auf die der "ubergebe Pointer zeigt, geht in das Eigentum - des SfxMacro "uber. +/* [Description] - Mit dieser Methode ist es m"oglich, Statements zusammenzufassen. Z.B. - anstelle f"unfmal hintereinander 'CursorLeft()' aufzurufen, k"onnte - das zu 'CursorLeft(5)' zusammengefa\st werden. Oder anstelle ein Wort - Buchstabe f"ur Buchstabe aufzubauen, k"onnte dies durch ein einziges - Statement 'InsertString("Hallo")' ersetzt werden. + This method records the statement passed on as a parameter. This will + overwrite the last recorded statement. The instance to which the passed + pointer points is transfered to the ownership of the SfxMacro. - Der Aufruf ist nur g"ultig, wenn es sich um ein SfxMacro handelt, - welches mit SFX_MACRO_RECORDINGABSOLUTE oder SFX_MACRO_RECORDINGRELATIVE - konstruiert wurde und bereits ein aufgezeichnetes Statement vorhanden - ist. + With this method it is possible to combine statements. For example, instead + of calling the 'CursorLeft()' five times could be summarized as + 'CursorLeft (5)'. Or rather than building a word letter by letter, this + could be done by a single statement 'InsertString("Hello")'. + The call is only valid if it is about a SfxMacro, which was constructed + with SFX_MACRO_RECORDINGRELATIVE or SFX_MACRO_RECORDINGABSOLUTE and is + available as an already recorded statement. - [Anmerkung] + [Note] - Diese Methode wird typischerweise aus den Execute-Methoden der - <SfxSlot>s von den Applikationsentwicklern gerufen. + This method is typically called from the execute methods of + <SfxSlot>s created by the application developers. - - [Querverweise] + [Cross-reference] <SfxMacro::Record(SfxMacroStatement*)> <SfxMacro::Remove()> @@ -610,30 +501,26 @@ void SfxMacro::Replace void SfxMacro::Remove() -/* [Beschreibung] - - Diese Methode l"oscht das zuletzt aufgezeichnete <SfxMacroStatement> - und entfernt es aus dem Macro. - - Mit dieser Methode ist es m"oglich, Statements zusammenzufassen. Z.B. - anstelle f"unfmal hintereinander 'CursorLeft()' aufzurufen, k"onnte - das zu 'CursorLeft(5)' zusammengefa\st werden. Oder anstelle ein Wort - Buchstabe f"ur Buchstabe aufzubauen, k"onnte dies durch ein einziges - Statement 'InsertString("Hallo")' ersetzt werden. +/* [Description] - Der Aufruf ist nur g"ultig, wenn es sich um ein SfxMacro handelt, - welches mit SFX_MACRO_RECORDINGABSOLUTE oder SFX_MACRO_RECORDINGRELATIVE - konstruiert wurde und bereits ein aufgezeichnetes Statement vorhanden - ist. + This method deletes the last recorded <SfxMacroStatement> and removes + it from the macro. + With this method it is possible to combine statements. For example, instead + of calling the 'CursorLeft()' five times could be summarized as + 'CursorLeft (5)'. Or rather than building a word letter by letter, this + could be done by a single statement 'InsertString("Hello")'. - [Anmerkung] + The call is only valid if it is about a SfxMacro, which was constructed + with SFX_MACRO_RECORDINGRELATIVE or SFX_MACRO_RECORDINGABSOLUTE and is + available as an already recorded statement. - Diese Methode wird typischerweise aus den Execute-Methoden der - <SfxSlot>s von den Applikationsentwicklern gerufen. + [Note] + This method is typically called from the the Execute methods of <SfxSlot>s + by the application developer. - [Querverweise] + [Cross-reference] <SfxMacro::Replace(SfxMacroStatement*)> <SfxMacro::Record(SfxMacroStatement*)> @@ -650,19 +537,17 @@ void SfxMacro::Remove() const SfxMacroStatement* SfxMacro::GetLastStatement() const -/* [Beschreibung] +/* [Description] - Mit dieser Methode kann auf das jeweils zuletzt aufgezeichnete Statement - lesend zugegriffen werden. Zusammen mit der Methode - <SfxMacro::Replace(SfxMacroStatement*)> ergibt sich dadurch die - M"oglichkeit, Statements zusammenzufassen. + This method enables read access to the last recorded statement. + Together with the method <SfxMacro::Replace(SfxMacroStatement*)> this opens + for the possibility to summarize statements. - Der Aufruf ist nur g"ultig, wenn es sich um ein SfxMacro handelt, - welches mit SFX_MACRO_RECORDINGABSOLUTE oder SFX_MACRO_RECORDINGRELATIVE - konstruiert wurde. + The call is only valid if it is about a SfxMacro, which was constructed + with SFX_MACRO_RECORDINGRELATIVE or SFX_MACRO_RECORDINGABSOLUTE and is + available as an already recorded statement. - - [Querverweise] + [Cross-reference] <SfxMacro::Record(SfxMacroStatement*)> <SfxMacro::Replace(SfxMacroStatement*)> @@ -679,15 +564,14 @@ const SfxMacroStatement* SfxMacro::GetLastStatement() const String SfxMacro::GenerateSource() const -/* [Beschreibung] - - Diese Funktion generiert aus den, seit dem Konstruieren der Instanz - bis zum Zeitpunkt des Aufrufs dieser Methode aufgezeichneten - <SfxMacroStatement>s einen BASIC-Sourcecode, der die Statements, - jedoch nicht den Header ('Sub X') und den Footer ('End Sub') enth"alt. +/* [Description] + This function generates BASIC source code that contains the statements, but + does not contain the header ('Sub X') and Footer ('End Sub') from recorded + <SfxMacroStatement> since the construction of the instance until the time + of calling this method. - [Querverweise] + [Cross-reference] <SfxMacro::Record(SfxMacroStatement*)> <SfxMacro::Repeat(SfxMacroStatement*)> @@ -706,3 +590,4 @@ String SfxMacro::GenerateSource() const return aSource; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/control/minfitem.cxx b/sfx2/source/control/minfitem.cxx index 9d33ca5c71..ca95261ff7 100644 --- a/sfx2/source/control/minfitem.cxx +++ b/sfx2/source/control/minfitem.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -39,7 +40,7 @@ TYPEINIT1(SfxMacroInfoItem, SfxPoolItem); // ----------------------------------------------------------------------- SfxMacroInfoItem::SfxMacroInfoItem( - USHORT nWhichId, // Slot-ID + USHORT nWhichId, // Slot-ID const BasicManager* pMgr, const String &rLibName, const String &rModuleName, @@ -56,7 +57,7 @@ SfxMacroInfoItem::SfxMacroInfoItem( // ----------------------------------------------------------------------- -// copy ctor +// copy constructor SfxMacroInfoItem::SfxMacroInfoItem(const SfxMacroInfoItem& rCopy): SfxPoolItem(rCopy), @@ -102,3 +103,4 @@ String SfxMacroInfoItem::GetQualifiedName() const } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/control/msg.cxx b/sfx2/source/control/msg.cxx index 5f26113b4b..095b66f415 100644 --- a/sfx2/source/control/msg.cxx +++ b/sfx2/source/control/msg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -73,3 +74,4 @@ USHORT SfxSlot::GetWhich( const SfxItemPool &rPool ) const return rtl::OUString( aCmd, aCmd.getLength(), RTL_TEXTENCODING_UTF8 ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/control/msgpool.cxx b/sfx2/source/control/msgpool.cxx index d939e3c984..837793b120 100644 --- a/sfx2/source/control/msgpool.cxx +++ b/sfx2/source/control/msgpool.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,10 +30,8 @@ #include "precompiled_sfx2.hxx" #include <tools/stream.hxx> #include <rsc/rscsfx.hxx> -#ifndef GCC -#endif -// wg. pSlotPool +// due to pSlotPool #include "appdata.hxx" #include <sfx2/msgpool.hxx> #include <sfx2/minarray.hxx> @@ -49,13 +48,6 @@ //==================================================================== -struct SfxSIDRegistration_Impl -{ - String _aGroup; - String _aName; - USHORT _nSID; -}; - struct SfxSlotType_Impl { USHORT nId; @@ -106,7 +98,6 @@ SfxSlotPool::~SfxSlotPool() } //==================================================================== - // registers the availability of the Interface of functions void SfxSlotPool::RegisterInterface( SfxInterface& rInterface ) @@ -118,8 +109,8 @@ void SfxSlotPool::RegisterInterface( SfxInterface& rInterface ) _pInterfaces = new SfxInterfaceArr_Impl; _pInterfaces->Append(&rInterface); - // bei einem (einzelnen) Null-Slot abbrechen (aus syntaktischen Gr"unden - // enthalten interfaces immer mindestens einen Slot) + // Stop at a (single) Null-slot (for syntactic reasons the interfaces + // always contain at least one slot) if ( rInterface.Count() == 1 && !rInterface[0]->nSlotId ) return; @@ -130,7 +121,7 @@ void SfxSlotPool::RegisterInterface( SfxInterface& rInterface ) if ( _pParentPool ) { - // Die Groups im parent Slotpool sind auch hier bekannt + // The Groups in parent Slotpool are also known here SfxSlotGroupArr_Impl& rGroups = *_pParentPool->_pGroups; for ( USHORT n=0; n<rGroups.Count(); n++ ) _pGroups->Append( rGroups[n] ); @@ -150,26 +141,6 @@ void SfxSlotPool::RegisterInterface( SfxInterface& rInterface ) else _pGroups->Append(pDef->GetGroupId()); } -#if 0 - const TypeId &rTypeId = pDef->GetType()->Type(); - if ( /*rTypeId != TYPE(SfxVoidItem) &&*/ rTypeId != 0 ) - { - USHORT nPos; - for ( nPos = 0; nPos < _pTypes->Count(); ++nPos ) - { - if ( _pTypes->GetObject(nPos)->nId == pDef->GetSlotId() ) - { - DBG_ASSERT( rTypeId == _pTypes->GetObject(nPos)->nType, - "same slot id with unequal item types" ); - } - else if ( _pTypes->GetObject(nPos)->nId > pDef->GetSlotId() ) - break; - } - if ( nPos >= _pTypes->Count() || - _pTypes->GetObject(nPos)->nId > pDef->GetSlotId() ) - _pTypes->Append( new SfxSlotType_Impl( pDef->GetSlotId(), rTypeId ) ); - } -#endif } } @@ -190,7 +161,6 @@ TypeId SfxSlotPool::GetSlotType( USHORT nId ) const } //==================================================================== - // unregisters the availability of the Interface of functions void SfxSlotPool::ReleaseInterface( SfxInterface& rInterface ) @@ -210,7 +180,7 @@ const SfxSlot* SfxSlotPool::GetSlot( USHORT nId ) DBG_MEMTEST(); DBG_ASSERT( _pInterfaces != 0, "no Interfaces registered" ); - // Zun"achst die eigenen Interfaces absuchen + // First, search their own interfaces for ( USHORT nInterf = 0; nInterf < _pInterfaces->Count(); ++nInterf ) { const SfxSlot *pDef = _pInterfaces->GetObject(nInterf)->GetSlot(nId); @@ -218,7 +188,7 @@ const SfxSlot* SfxSlotPool::GetSlot( USHORT nId ) return pDef; } - // Dann beim eventuell vorhandenen parent versuchen + // Then try any of the possible existing parent return _pParentPool ? _pParentPool->GetSlot( nId ) : 0; } @@ -237,15 +207,14 @@ String SfxSlotPool::SeekGroup( USHORT nNo ) _nCurGroup = nNo; if ( _pParentPool ) { - // Meistens stimmt die Reihenfolge der Ids "uberein + // In most cases, the order of the IDs agree USHORT nParentCount = _pParentPool->_pGroups->Count(); if ( nNo < nParentCount && (*_pGroups)[nNo] == (*_pParentPool->_pGroups)[nNo] ) _pParentPool->_nCurGroup = nNo; else { - // Ansonsten mu\s gesucht werden - // Wenn die Gruppe im parent pool nicht gefunden wird, wird - // _nCurGroup au\serhalb des g"ultigen Bereiches gesetzt + // Otherwise search. If the group is not found in the parent + // pool, _nCurGroup is set outside the valid range USHORT i; for ( i=1; i<nParentCount; i++ ) if ( (*_pGroups)[nNo] == (*_pParentPool->_pGroups)[i] ) @@ -258,7 +227,7 @@ String SfxSlotPool::SeekGroup( USHORT nNo ) aResId.SetRT(RSC_STRING); if ( !aResId.GetResMgr()->IsAvailable(aResId) ) { - DBG_ERROR( "GroupId-Name nicht im SFX definiert!" ); + DBG_ERROR( "GroupId-Name not defined in SFX!" ); return String(); } @@ -286,18 +255,18 @@ const SfxSlot* SfxSlotPool::SeekSlot( USHORT nStartInterface ) DBG_MEMTEST(); DBG_ASSERT( _pInterfaces != 0, "no Interfaces registered" ); - // Die Numerierung der interfaces startet beim parent pool + // The numbering starts at the interfaces of the parent pool USHORT nFirstInterface = _pParentPool ? _pParentPool->_pInterfaces->Count() : 0; - // sind wir am Ende des Parent-Pools angekommen? + // have reached the end of the Parent-Pools? if ( nStartInterface < nFirstInterface && _pParentPool->_nCurGroup >= _pParentPool->_pGroups->Count() ) nStartInterface = nFirstInterface; - // liegt das Interface noch im Parent-Pool? + // Is the Interface still in the Parent-Pool? if ( nStartInterface < nFirstInterface ) { - DBG_ASSERT( _pParentPool, "Kein parent pool!" ); + DBG_ASSERT( _pParentPool, "No parent pool!" ); _nCurInterface = nStartInterface; return _pParentPool->SeekSlot( nStartInterface ); } @@ -323,7 +292,6 @@ const SfxSlot* SfxSlotPool::SeekSlot( USHORT nStartInterface ) } //-------------------------------------------------------------------- - // skips to the next func in the current group const SfxSlot* SfxSlotPool::NextSlot() @@ -331,7 +299,7 @@ const SfxSlot* SfxSlotPool::NextSlot() DBG_MEMTEST(); DBG_ASSERT( _pInterfaces != 0, "no Interfaces registered" ); - // Die Numerierung der interfaces startet beim parent pool + // The numbering starts at the interfaces of the parent pool USHORT nFirstInterface = _pParentPool ? _pParentPool->_pInterfaces->Count() : 0; if ( _nCurInterface < nFirstInterface && _nCurGroup >= _pParentPool->_pGroups->Count() ) @@ -339,13 +307,13 @@ const SfxSlot* SfxSlotPool::NextSlot() if ( _nCurInterface < nFirstInterface ) { - DBG_ASSERT( _pParentPool, "Kein parent pool!" ); + DBG_ASSERT( _pParentPool, "No parent pool!" ); const SfxSlot *pSlot = _pParentPool->NextSlot(); _nCurInterface = _pParentPool->_nCurInterface; if ( pSlot ) return pSlot; if ( _nCurInterface == nFirstInterface ) - // parent pool ist fertig + // parent pool is ready return SeekSlot( nFirstInterface ); } @@ -368,9 +336,7 @@ const SfxSlot* SfxSlotPool::NextSlot() //-------------------------------------------------------------------- - -// SlotName erfragen, gfs. mit HilfeText - +// Query SlotName with help text //-------------------------------------------------------------------- SfxInterface* SfxSlotPool::FirstInterface() @@ -420,3 +386,4 @@ SfxSlotPool& SfxSlotPool::GetSlotPool( SfxViewFrame *pFrame ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/control/objface.cxx b/sfx2/source/control/objface.cxx index 3e19d86283..3e087425df 100644 --- a/sfx2/source/control/objface.cxx +++ b/sfx2/source/control/objface.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,8 +31,6 @@ #include <stdlib.h> #include <tools/rcid.h> -#ifndef GCC -#endif #include <tools/stream.hxx> #include <sfx2/module.hxx> @@ -131,7 +130,7 @@ static SfxObjectUI_Impl* CreateObjectBarUI_Impl( USHORT nPos, const ResId& rResI //==================================================================== //==================================================================== -// ctor, registeres a new unit +// constuctor, registeres a new unit SfxInterface::SfxInterface( const char *pClassName, const ResId& rNameResId, @@ -183,9 +182,9 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, USHORT nSlotCount ) pIter->GetSlotId() != (pIter+1)->GetSlotId(), "doppelte SID" ); - // jeder Master verweist auf seinen ersten Slave (ENUM), alle - // Slaves auf ihren Master. - // Slaves verweisen im Ring auf die anderen mit gleichem Master + // every master refers to his first slave (ENUM), + // all slaves refer to their master. + // Slaves refer in a circle to the other slaves with the same master if ( pIter->GetKind() == SFX_KIND_ENUM ) { pIter->pLinkedSlot = GetSlot( pIter->nMasterSlotId ); @@ -210,7 +209,8 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, USHORT nSlotCount ) } else if ( 0 == pIter->GetNextSlot() ) { - // Slots verweisen im Ring auf den n"achten mit derselben Statusmethode + // Slots refering in circle to the next with the same + // Status method. SfxSlot *pLastSlot = pIter; for ( USHORT n = nIter; n < Count(); ++n ) { @@ -233,7 +233,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, USHORT nSlotCount ) { if ( pNext->GetSlotId() <= pIter->GetSlotId() ) - DBG_ERROR ("Falsche Reihenfolge!"); + DBG_ERROR ("Wrong order!"); if ( pIter->GetKind() == SFX_KIND_ENUM ) { @@ -244,7 +244,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, USHORT nSlotCount ) { if ( pSlave->pLinkedSlot != pMasterSlot ) { - ByteString aStr("Falsche Master/Slave-Verkettung : "); + ByteString aStr("Wrong Master/Slave- link: "); aStr += ByteString::CreateFromInt32(pMasterSlot->GetSlotId()); aStr += " , "; aStr += ByteString::CreateFromInt32(pSlave->GetSlotId()); @@ -253,7 +253,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, USHORT nSlotCount ) if ( pSlave->nMasterSlotId != pMasterSlot->GetSlotId() ) { - ByteString aStr("Falsche Master/Slave-Ids : "); + ByteString aStr("Wrong Master/Slave-Ids: "); aStr += ByteString::CreateFromInt32(pMasterSlot->GetSlotId()); aStr += " , "; aStr += ByteString::CreateFromInt32(pSlave->GetSlotId()); @@ -270,7 +270,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, USHORT nSlotCount ) { if ( pIter->pLinkedSlot->GetKind() != SFX_KIND_ENUM ) { - ByteString aStr("Slave ist kein enum : "); + ByteString aStr("Slave is no enum: "); aStr += ByteString::CreateFromInt32(pIter->GetSlotId()); aStr += " , "; aStr += ByteString::CreateFromInt32(pIter->pLinkedSlot->GetSlotId()); @@ -284,7 +284,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, USHORT nSlotCount ) pCurSlot = pCurSlot->pNextSlot; if ( pCurSlot->GetStateFnc() != pIter->GetStateFnc() ) { - ByteString aStr("Verkettete Slots mit verschiedenen StateMethods : "); + ByteString aStr("Linked Slots with different State Methods : "); aStr += ByteString::CreateFromInt32(pCurSlot->GetSlotId()); aStr += " , "; aStr += ByteString::CreateFromInt32(pIter->GetSlotId()); @@ -300,11 +300,8 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, USHORT nSlotCount ) #endif } - //-------------------------------------------------------------------- - - SfxInterface::~SfxInterface() { SfxModule *pMod = pImpData->pModule; @@ -324,7 +321,6 @@ SfxInterface::~SfxInterface() // searches for the specified func - const SfxSlot* SfxInterface::GetSlot( USHORT nFuncId ) const { DBG_MEMTEST(); @@ -360,7 +356,6 @@ const SfxSlot* SfxInterface::GetSlot( const String& rCommand ) const //-------------------------------------------------------------------- - const SfxSlot* SfxInterface::GetRealSlot( const SfxSlot *pSlot ) const { DBG_MEMTEST(); @@ -371,7 +366,7 @@ const SfxSlot* SfxInterface::GetRealSlot( const SfxSlot *pSlot ) const { if(pGenoType) return pGenoType->GetRealSlot(pSlot); - DBG_ERROR("fremder Slot"); + DBG_ERROR("unknown Slot"); return 0; } @@ -380,7 +375,6 @@ const SfxSlot* SfxInterface::GetRealSlot( const SfxSlot *pSlot ) const //-------------------------------------------------------------------- - const SfxSlot* SfxInterface::GetRealSlot( USHORT nSlotId ) const { DBG_MEMTEST(); @@ -401,7 +395,6 @@ const SfxSlot* SfxInterface::GetRealSlot( USHORT nSlotId ) const //-------------------------------------------------------------------- - void SfxInterface::RegisterPopupMenu( const ResId& rResId ) { DBG_CHKTHIS(SfxInterface, 0); @@ -454,10 +447,10 @@ const ResId& SfxInterface::GetObjectBarResId( USHORT nNo ) const BOOL bGenoType = (pGenoType != 0 && !pGenoType->HasName()); if ( bGenoType ) { - // Gibt es Toolbars in der Superklasse ? + // Are there toolbars in the super class? USHORT nBaseCount = pGenoType->GetObjectBarCount(); if ( nNo < nBaseCount ) - // Die der Superklasse kommen zuerst + // The Super class comes first return pGenoType->GetObjectBarResId( nNo ); else nNo = nNo - nBaseCount; @@ -465,7 +458,7 @@ const ResId& SfxInterface::GetObjectBarResId( USHORT nNo ) const #ifdef DBG_UTIL USHORT nObjBarCount = pImpData->pObjectBars->Count(); - DBG_ASSERT( nNo<nObjBarCount,"Objectbar ist unbekannt!" ); + DBG_ASSERT( nNo<nObjBarCount,"Objectbar is unknown!" ); #endif return (*pImpData->pObjectBars)[nNo]->aResId; } @@ -478,10 +471,10 @@ USHORT SfxInterface::GetObjectBarPos( USHORT nNo ) const BOOL bGenoType = (pGenoType != 0 && !pGenoType->HasName()); if ( bGenoType ) { - // Gibt es Toolbars in der Superklasse ? + // Are there toolbars in the super class? USHORT nBaseCount = pGenoType->GetObjectBarCount(); if ( nNo < nBaseCount ) - // Die der Superklasse kommen zuerst + // The Super class comes first return pGenoType->GetObjectBarPos( nNo ); else nNo = nNo - nBaseCount; @@ -489,7 +482,7 @@ USHORT SfxInterface::GetObjectBarPos( USHORT nNo ) const #ifdef DBG_UTIL USHORT nObjBarCount = pImpData->pObjectBars->Count(); - DBG_ASSERT( nNo<nObjBarCount,"Objectbar ist unbekannt!" ); + DBG_ASSERT( nNo<nObjBarCount,"Objectbar is unknown!" ); #endif return (*pImpData->pObjectBars)[nNo]->nPos; } @@ -528,10 +521,10 @@ sal_uInt32 SfxInterface::GetChildWindowId (USHORT nNo) const { if ( pGenoType ) { - // Gibt es ChildWindows in der Superklasse ? + // Are there ChildWindows in der Superklasse? USHORT nBaseCount = pGenoType->GetChildWindowCount(); if ( nNo < nBaseCount ) - // Die der Superklasse kommen zuerst + // The Super class comes first return pGenoType->GetChildWindowId( nNo ); else nNo = nNo - nBaseCount; @@ -539,7 +532,7 @@ sal_uInt32 SfxInterface::GetChildWindowId (USHORT nNo) const #ifdef DBG_UTIL USHORT nCWCount = pImpData->pChildWindows->Count(); - DBG_ASSERT( nNo<nCWCount,"ChildWindow ist unbekannt!" ); + DBG_ASSERT( nNo<nCWCount,"ChildWindow is unknown!" ); #endif sal_uInt32 nRet = (*pImpData->pChildWindows)[nNo]->aResId.GetId(); if ( (*pImpData->pChildWindows)[nNo]->bContext ) @@ -551,10 +544,10 @@ sal_uInt32 SfxInterface::GetChildWindowFeature (USHORT nNo) const { if ( pGenoType ) { - // Gibt es ChildWindows in der Superklasse ? + // Are there ChildWindows in der Superklasse? USHORT nBaseCount = pGenoType->GetChildWindowCount(); if ( nNo < nBaseCount ) - // Die der Superklasse kommen zuerst + // The Super class comes first return pGenoType->GetChildWindowFeature( nNo ); else nNo = nNo - nBaseCount; @@ -562,7 +555,7 @@ sal_uInt32 SfxInterface::GetChildWindowFeature (USHORT nNo) const #ifdef DBG_UTIL USHORT nCWCount = pImpData->pChildWindows->Count(); - DBG_ASSERT( nNo<nCWCount,"ChildWindow ist unbekannt!" ); + DBG_ASSERT( nNo<nCWCount,"ChildWindow is unknown!" ); #endif return (*pImpData->pChildWindows)[nNo]->nFeature; } @@ -600,10 +593,10 @@ const String* SfxInterface::GetObjectBarName ( USHORT nNo ) const BOOL bGenoType = (pGenoType != 0 && !pGenoType->HasName()); if ( bGenoType ) { - // Gibt es Toolbars in der Superklasse ? + // Are there toolbars in the super class? USHORT nBaseCount = pGenoType->GetObjectBarCount(); if ( nNo < nBaseCount ) - // Die der Superklasse kommen zuerst + // The Super class comes first return pGenoType->GetObjectBarName( nNo ); else nNo = nNo - nBaseCount; @@ -611,7 +604,7 @@ const String* SfxInterface::GetObjectBarName ( USHORT nNo ) const #ifdef DBG_UTIL USHORT nObjBarCount = pImpData->pObjectBars->Count(); - DBG_ASSERT( nNo<nObjBarCount,"Objectbar ist unbekannt!" ); + DBG_ASSERT( nNo<nObjBarCount,"Objectbar is unknown!" ); #endif return (*pImpData->pObjectBars)[nNo]->pName; } @@ -621,10 +614,10 @@ sal_uInt32 SfxInterface::GetObjectBarFeature ( USHORT nNo ) const BOOL bGenoType = (pGenoType != 0 && !pGenoType->HasName()); if ( bGenoType ) { - // Gibt es Toolbars in der Superklasse ? + // Are there toolbars in the super class? USHORT nBaseCount = pGenoType->GetObjectBarCount(); if ( nNo < nBaseCount ) - // Die der Superklasse kommen zuerst + // The Super class comes first return pGenoType->GetObjectBarFeature( nNo ); else nNo = nNo - nBaseCount; @@ -632,7 +625,7 @@ sal_uInt32 SfxInterface::GetObjectBarFeature ( USHORT nNo ) const #ifdef DBG_UTIL USHORT nObjBarCount = pImpData->pObjectBars->Count(); - DBG_ASSERT( nNo<nObjBarCount,"Objectbar ist unbekannt!" ); + DBG_ASSERT( nNo<nObjBarCount,"Objectbar ist unknown!" ); #endif return (*pImpData->pObjectBars)[nNo]->nFeature; } @@ -642,10 +635,10 @@ BOOL SfxInterface::IsObjectBarVisible(USHORT nNo) const BOOL bGenoType = (pGenoType != 0 && !pGenoType->HasName()); if ( bGenoType ) { - // Gibt es Toolbars in der Superklasse ? + // Are there toolbars in the super class? USHORT nBaseCount = pGenoType->GetObjectBarCount(); if ( nNo < nBaseCount ) - // Die der Superklasse kommen zuerst + // The Super class comes first return pGenoType->IsObjectBarVisible( nNo ); else nNo = nNo - nBaseCount; @@ -653,7 +646,7 @@ BOOL SfxInterface::IsObjectBarVisible(USHORT nNo) const #ifdef DBG_UTIL USHORT nObjBarCount = pImpData->pObjectBars->Count(); - DBG_ASSERT( nNo<nObjBarCount,"Objectbar ist unbekannt!" ); + DBG_ASSERT( nNo<nObjBarCount,"Objectbar is unknown!" ); #endif return (*pImpData->pObjectBars)[nNo]->bVisible; } @@ -663,17 +656,17 @@ const SfxInterface* SfxInterface::GetRealInterfaceForSlot( const SfxSlot *pRealS DBG_ASSERT( pImpData->bRegistered, "Interface not registered!" ); const SfxInterface* pInterface = this; - // Der Slot k"onnte auch aus dem Interface einer Shell-Basisklasse stammen + // The slot could also originate from the interface of a shell base class. do { const SfxSlot *pLastSlot = (*pInterface)[pInterface->Count()-1]; const SfxSlot *pFirstSlot = (*pInterface)[0]; - // Ist pInterface der Owner von pRealSlot ? + // Is pInterface the Owner of pRealSlot ? if ( pFirstSlot <= pRealSlot && pRealSlot <= pLastSlot ) break; - // Sonst Interface der Superklasse probieren + // Otherwise try the Interface of Super class pInterface = pInterface->pGenoType; } while ( pInterface ); @@ -681,5 +674,4 @@ const SfxInterface* SfxInterface::GetRealInterfaceForSlot( const SfxSlot *pRealS return pInterface; } - - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/control/querystatus.cxx b/sfx2/source/control/querystatus.cxx index 3e028498f8..ab3cebafe2 100644 --- a/sfx2/source/control/querystatus.cxx +++ b/sfx2/source/control/querystatus.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -37,7 +38,7 @@ #include <svl/visitem.hxx> #include <cppuhelper/weak.hxx> #include <comphelper/processfactory.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <vcl/svapp.hxx> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/status/ItemStatus.hpp> @@ -97,7 +98,7 @@ SfxQueryStatus_Impl::SfxQueryStatus_Impl( const Reference< XDispatchProvider >& { m_aCommand.Complete = rCommand; Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), UNO_QUERY ); + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), UNO_QUERY ); xTrans->parseStrict( m_aCommand ); if ( rDispatchProvider.is() ) m_xDispatch = rDispatchProvider->queryDispatch( m_aCommand, rtl::OUString(), 0 ); @@ -111,14 +112,14 @@ SfxQueryStatus_Impl::~SfxQueryStatus_Impl() void SAL_CALL SfxQueryStatus_Impl::disposing( const EventObject& ) throw( RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; m_xDispatch.clear(); } void SAL_CALL SfxQueryStatus_Impl::statusChanged( const FeatureStateEvent& rEvent) throw( RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; m_pItem = NULL; m_eState = SFX_ITEM_DISABLED; @@ -189,7 +190,7 @@ throw( RuntimeException ) // Query method SfxItemState SfxQueryStatus_Impl::QueryState( SfxPoolItem*& rpPoolItem ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( !m_bQueryInProgress ) { m_pItem = NULL; @@ -236,6 +237,8 @@ SfxQueryStatus::~SfxQueryStatus() SfxItemState SfxQueryStatus::QueryState( SfxPoolItem*& rpPoolItem ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; return m_pSfxQueryStatusImpl->QueryState( rpPoolItem ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/control/request.cxx b/sfx2/source/control/request.cxx index 5dd20c34f0..6ebf38f2ad 100644 --- a/sfx2/source/control/request.cxx +++ b/sfx2/source/control/request.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -394,7 +395,7 @@ void SfxRequest_Impl::Record com::sun::star::uno::UNO_QUERY); com::sun::star::uno::Reference< com::sun::star::util::XURLTransformer > xTransform( - xFactory->createInstance(rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer")), + xFactory->createInstance(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), com::sun::star::uno::UNO_QUERY); com::sun::star::util::URL aURL; @@ -471,7 +472,7 @@ void SfxRequest::RemoveItem( USHORT nID ) const SfxPoolItem* SfxRequest::GetArg ( USHORT nSlotId, // Slot-Id oder Which-Id des Parameters - FASTBOOL bDeep, // FALSE: nicht in Parent-ItemSets suchen + bool bDeep, // FALSE: nicht in Parent-ItemSets suchen TypeId aType // != 0: RTTI Pruefung mit Assertion ) const { @@ -574,7 +575,7 @@ void SfxRequest::Done erfragt wurden, ggf. 0 falls keine Parameter gesetzt wurden */ - FASTBOOL bKeep /* TRUE (default) + bool bKeep /* TRUE (default) 'rSet' wird gepeichert und ist "uber GetArgs() abfragbar @@ -871,7 +872,7 @@ com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorder > SfxRe if(xSet.is()) { - com::sun::star::uno::Any aProp = xSet->getPropertyValue(rtl::OUString::createFromAscii("DispatchRecorderSupplier")); + com::sun::star::uno::Any aProp = xSet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DispatchRecorderSupplier"))); com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorderSupplier > xSupplier; aProp >>= xSupplier; if(xSupplier.is()) @@ -904,7 +905,7 @@ BOOL SfxRequest::IsAPI() const //-------------------------------------------------------------------- -FASTBOOL SfxRequest::IsRecording() const +bool SfxRequest::IsRecording() const /* [Beschreibung] @@ -976,3 +977,5 @@ void SfxRequest::ReleaseArgs() DELETEZ( pArgs ); DELETEZ( pImp->pInternalArgs ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/control/sfxstatuslistener.cxx b/sfx2/source/control/sfxstatuslistener.cxx index e022890d6c..1614c4f3f3 100644 --- a/sfx2/source/control/sfxstatuslistener.cxx +++ b/sfx2/source/control/sfxstatuslistener.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -37,7 +38,7 @@ #include <svl/visitem.hxx> #include <cppuhelper/weak.hxx> #include <comphelper/processfactory.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <vcl/svapp.hxx> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> @@ -68,7 +69,7 @@ SfxStatusListener::SfxStatusListener( const Reference< XDispatchProvider >& rDis { m_aCommand.Complete = rCommand; Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), UNO_QUERY ); + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), UNO_QUERY ); xTrans->parseStrict( m_aCommand ); if ( rDispatchProvider.is() ) m_xDispatch = rDispatchProvider->queryDispatch( m_aCommand, rtl::OUString(), 0 ); @@ -112,7 +113,7 @@ void SfxStatusListener::Bind( USHORT nSlotId, const rtl::OUString& rNewCommand ) m_nSlotID = nSlotId; m_aCommand.Complete = rNewCommand; Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), UNO_QUERY ); + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), UNO_QUERY ); xTrans->parseStrict( m_aCommand ); m_xDispatch = m_xDispatchProvider->queryDispatch( m_aCommand, rtl::OUString(), 0 ); @@ -190,7 +191,7 @@ throw ( RuntimeException ) void SAL_CALL SfxStatusListener::disposing( const EventObject& Source ) throw( RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( Source.Source == Reference< XInterface >( m_xDispatch, UNO_QUERY )) m_xDispatch.clear(); @@ -201,7 +202,7 @@ throw( RuntimeException ) void SAL_CALL SfxStatusListener::statusChanged( const FeatureStateEvent& rEvent) throw( RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; SfxViewFrame* pViewFrame = NULL; if ( m_xDispatch.is() ) @@ -288,3 +289,4 @@ throw( RuntimeException ) delete pItem; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx index 7fabce6297..2f6415432f 100644 --- a/sfx2/source/control/shell.cxx +++ b/sfx2/source/control/shell.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -125,11 +126,11 @@ String SfxShellIdent_Impl( const SfxShell *pSh ) // SfxShell //========================================================================= -void __EXPORT SfxShell::EmptyExecStub(SfxShell *, SfxRequest &) +void SfxShell::EmptyExecStub(SfxShell *, SfxRequest &) { } -void __EXPORT SfxShell::EmptyStateStub(SfxShell *, SfxItemSet &) +void SfxShell::EmptyStateStub(SfxShell *, SfxItemSet &) { } @@ -853,7 +854,7 @@ ResMgr* SfxShell::GetResMgr() const //-------------------------------------------------------------------- -FASTBOOL SfxShell::CanExecuteSlot_Impl( const SfxSlot &rSlot ) +bool SfxShell::CanExecuteSlot_Impl( const SfxSlot &rSlot ) /* [Beschreibung] @@ -1296,3 +1297,4 @@ void SfxShell::SetViewShell_Impl( SfxViewShell* pView ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/control/sorgitm.cxx b/sfx2/source/control/sorgitm.cxx index 3a14ccc588..353808db74 100644 --- a/sfx2/source/control/sorgitm.cxx +++ b/sfx2/source/control/sorgitm.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -88,7 +89,7 @@ int SfxScriptOrganizerItem::operator==( const SfxPoolItem& rItem) const } -sal_Bool SfxScriptOrganizerItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId ) const +bool SfxScriptOrganizerItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId ) const { String aValue; BOOL bIsString = FALSE; @@ -103,20 +104,20 @@ sal_Bool SfxScriptOrganizerItem::QueryValue( com::sun::star::uno::Any& rVal, BYT break; default: DBG_ERROR("Wrong MemberId!"); - return sal_False; + return false; } if ( bIsString ) rVal <<= ::rtl::OUString( aValue ); else rVal <<= bValue; - return sal_True; + return true; } -sal_Bool SfxScriptOrganizerItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId ) +bool SfxScriptOrganizerItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId ) { ::rtl::OUString aValue; - sal_Bool bRet = sal_False; + sal_Bool bRet = false; nMemberId &= ~CONVERT_TWIPS; switch ( nMemberId ) { @@ -128,9 +129,10 @@ sal_Bool SfxScriptOrganizerItem::PutValue( const com::sun::star::uno::Any& rVal, break; default: DBG_ERROR("Wrong MemberId!"); - return sal_False; + return false; } return bRet; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/control/statcach.cxx b/sfx2/source/control/statcach.cxx index 3c4d89f801..94fcde64f5 100644 --- a/sfx2/source/control/statcach.cxx +++ b/sfx2/source/control/statcach.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -49,9 +50,6 @@ #include <svl/visitem.hxx> #include <comphelper/processfactory.hxx> -#ifndef GCC -#endif - #include <sfx2/app.hxx> #include <sfx2/appuno.hxx> #include "statcach.hxx" @@ -390,7 +388,6 @@ void SfxStateCache::SetVisibleState( BOOL bShow ) { SfxItemState eState( SFX_ITEM_AVAILABLE ); const SfxPoolItem* pState( NULL ); - sal_Bool bNotify( sal_False ); sal_Bool bDeleteItem( sal_False ); if ( bShow != bItemVisible ) @@ -407,7 +404,6 @@ void SfxStateCache::SetVisibleState( BOOL bShow ) pState = pLastItem; eState = eLastState; - bNotify = ( pState != 0 ); } else { @@ -457,10 +453,10 @@ void SfxStateCache::SetState_Impl DBG_PROFSTART(SfxStateCacheSetState); // m"ussen die Controller "uberhaupt benachrichtigt werden? - FASTBOOL bNotify = bItemDirty; + bool bNotify = bItemDirty; if ( !bItemDirty ) { - FASTBOOL bBothAvailable = pLastItem && pState && + bool bBothAvailable = pLastItem && pState && !IsInvalidItem(pState) && !IsInvalidItem(pLastItem); DBG_ASSERT( !bBothAvailable || pState != pLastItem, "setting state with own item" ); if ( bBothAvailable ) @@ -575,3 +571,4 @@ void SfxStateCache::Dispatch( const SfxItemSet* pSet, sal_Bool bForceSynchron ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index dc856786da..ef87fb4e81 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -50,7 +51,7 @@ #include <com/sun/star/frame/status/Visibility.hpp> #include <comphelper/processfactory.hxx> #include <comphelper/sequence.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <uno/current_context.hxx> #include <vcl/svapp.hxx> @@ -108,7 +109,7 @@ SfxUnoControllerItem::SfxUnoControllerItem( SfxControllerItem *pItem, SfxBinding DBG_ASSERT( !pCtrlItem || !pCtrlItem->IsBound(), "ControllerItem fehlerhaft!" ); aCommand.Complete = rCmd; - Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), UNO_QUERY ); + Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), UNO_QUERY ); xTrans->parseStrict( aCommand ); pBindings->RegisterUnoController_Impl( this ); } @@ -130,7 +131,7 @@ void SfxUnoControllerItem::UnBind() void SAL_CALL SfxUnoControllerItem::statusChanged(const ::com::sun::star::frame::FeatureStateEvent& rEvent) throw ( ::com::sun::star::uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; DBG_ASSERT( pCtrlItem, "Dispatch hat den StatusListener nicht entfern!" ); if ( rEvent.Requery ) @@ -339,28 +340,6 @@ sal_Int64 SAL_CALL SfxOfficeDispatch::getSomething( const ::com::sun::star::uno: return 0; } -/* ASDBG -void* SfxOfficeDispatch::getImplementation(Reflection *p) -{ - if( p == ::getCppuType((const SfxOfficeDispatch*)0) ) - return this; - else - return ::cppu::OWeakObject::getImplementation(p); - -} - -Reflection* ::getCppuType((const SfxOfficeDispatch*)0) -{ - static StandardClassReflection aRefl( - 0, - createStandardClass( - "SfxOfficeDispatch", ::cppu::OWeakObject::get::cppu::OWeakObjectIdlClass(), - 1, - ::getCppuType((const ::com::sun::star::frame::XDispatch*)0) ) ); - return &aRefl; -} -*/ - SfxOfficeDispatch::SfxOfficeDispatch( SfxBindings& rBindings, SfxDispatcher* pDispat, const SfxSlot* pSlot, const ::com::sun::star::util::URL& rURL ) { // nOfficeDispatchCount++; @@ -470,7 +449,7 @@ sal_Bool SfxOfficeDispatch::IsMasterUnoCommand() const // Determine if URL contains a master/slave command which must be handled a little bit different sal_Bool SfxOfficeDispatch::IsMasterUnoCommand( const ::com::sun::star::util::URL& aURL ) { - if ( aURL.Protocol.equalsAscii( ".uno:" ) && + if ( aURL.Protocol.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ".uno:" ) ) && ( aURL.Path.indexOf( '.' ) > 0 )) return sal_True; @@ -506,12 +485,12 @@ SfxDispatchController_Impl::SfxDispatchController_Impl( , bVisible( sal_True ) , pUnoName( pSlot->pUnoName ) { - if ( aDispatchURL.Protocol.equalsAscii("slot:") && pUnoName ) + if ( aDispatchURL.Protocol.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("slot:")) && pUnoName ) { ByteString aTmp(".uno:"); aTmp += pUnoName; aDispatchURL.Complete = ::rtl::OUString::createFromAscii( aTmp.GetBuffer() ); - Reference < ::com::sun::star::util::XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), UNO_QUERY ); + Reference < ::com::sun::star::util::XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), UNO_QUERY ); xTrans->parseStrict( aDispatchURL ); } @@ -667,7 +646,7 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchResultListener >& rListener ) throw( ::com::sun::star::uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( pDispatch && ( @@ -702,6 +681,7 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util // Filter arguments which shouldn't be part of the sequence property value sal_Bool bTemp = sal_Bool(); sal_uInt16 nModifier(0); + sal_Bool bVBARequest = sal_False; std::vector< ::com::sun::star::beans::PropertyValue > aAddArgs; for( sal_Int32 n=0; n<nCount; n++ ) { @@ -718,6 +698,10 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util } else if( rProp.Name.equalsAsciiL("KeyModifier",11)) rProp.Value >>= nModifier; + else if( rProp.Name.equalsAsciiL("VBADialogResultRequest",22) ) + { + rProp.Value >>= bVBARequest; + } else aAddArgs.push_back( aArgs[n] ); } @@ -759,7 +743,6 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util aInternalSet.Put( SfxUnoFrameItem( SID_FILLFRAME, xFrameRef ) ); sal_Bool bSuccess = sal_False; - sal_Bool bFailure = sal_False; const SfxPoolItem* pItem = NULL; SfxShell* pShell( 0 ); // #i102619# Retrieve metric from shell before execution - the shell could be destroyed after execution @@ -800,7 +783,14 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util pDispatcher->GetBindings()->Execute_Impl( aReq, pSlot, pShell ); pItem = aReq.GetReturnValue(); bSuccess = aReq.IsDone() || pItem != NULL; - bFailure = aReq.IsCancelled(); + if ( bVBARequest ) + { + SFX_REQUEST_ARG( aReq, pDlgRet, SfxBoolItem, SID_DIALOG_RETURN, FALSE ); + if ( pDlgRet ) + { + bSuccess = pDlgRet->GetValue(); + } + } } } #ifdef DBG_UTIL @@ -842,11 +832,8 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util ::com::sun::star::frame::DispatchResultEvent aEvent; if ( bSuccess ) aEvent.State = com::sun::star::frame::DispatchResultState::SUCCESS; -// else if ( bFailure ) else aEvent.State = com::sun::star::frame::DispatchResultState::FAILURE; -// else -// aEvent.State = com::sun::star::frame::DispatchResultState::DONTKNOW; aEvent.Source = (::com::sun::star::frame::XDispatch*) pDispatch; if ( bSuccess && pItem && !pItem->ISA(SfxVoidItem) ) @@ -871,7 +858,7 @@ SfxDispatcher* SfxDispatchController_Impl::GetDispatcher() void SAL_CALL SfxDispatchController_Impl::addStatusListener(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & aListener, const ::com::sun::star::util::URL& aURL) throw ( ::com::sun::star::uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( !pDispatch ) return; @@ -1011,3 +998,5 @@ void SfxDispatchController_Impl::StateChanged( sal_uInt16 nSID, SfxItemState eSt { StateChanged( nSID, eState, pState, 0 ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/about.cxx b/sfx2/source/dialog/about.cxx index 0d1ece34d4..e4bce1dc1b 100644 --- a/sfx2/source/dialog/about.cxx +++ b/sfx2/source/dialog/about.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,14 +31,8 @@ // include --------------------------------------------------------------- -#ifndef _SV_APP_HXX #include <vcl/svapp.hxx> -#endif -#ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> -#endif -#ifndef GCC -#endif #include <tools/stream.hxx> #include <tools/urlobj.hxx> @@ -57,16 +52,16 @@ #include <sfx2/sfxcommands.h> #include "dialog.hrc" +using namespace ::com::sun::star; + // defines --------------------------------------------------------------- #define SCROLL_OFFSET 1 #define SPACE_OFFSET 5 #define SCROLL_TIMER 30 -#define WELCOME_URL DEFINE_CONST_UNICODE( "http://www.openoffice.org/welcome/credits.html" ) - -// class AboutDialog ----------------------------------------------------- -static void layoutText( FixedInfo &rText, long &nY, long nTextWidth, Size a6Size ) +/** loads the application logo as used in the about dialog and impress slideshow pause screen */ +Image SfxApplication::GetApplicationLogo() { Point aTextPos = rText.GetPosPixel(); aTextPos.X() = a6Size.Width() * 2; @@ -180,10 +175,15 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerS SetFont( aFont ); // if necessary more info - String sVersion = aVersionText.GetText(); + String sVersion = aVersionTextStr; sVersion.SearchAndReplaceAscii( "$(VER)", Application::GetDisplayName() ); sVersion += '\n'; sVersion += rVerStr; +#ifdef BUILD_VER_STRING + String aBuildString( DEFINE_CONST_UNICODE( BUILD_VER_STRING ) ); + sVersion += '\n'; + sVersion += aBuildString; +#endif aVersionText.SetText( sVersion ); // Initialisierung fuer Aufruf Entwickler @@ -196,7 +196,7 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerS { pPrevAccel = pAccel; pAccel = new Accelerator; - aAccelList.Insert( pAccel, LIST_APPEND ); + aAccelList.push_back( pAccel ); USHORT nKey = aAccelStr.GetChar(i) - 'A' + KEY_A; pAccel->InsertItem( 1, KeyCode( nKey, KEY_MOD1 ) ); if ( i > 0 ) @@ -221,26 +221,15 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerS aVersionText.SetBackground(); aCopyrightText.SetBackground(); + aInfoLink.SetURL( aLinkStr ); + aInfoLink.SetBackground(); + aInfoLink.SetClickHdl( LINK( this, AboutDialog, HandleHyperlink ) ); Color aTextColor( rSettings.GetWindowTextColor() ); aVersionText.SetControlForeground( aTextColor ); aCopyrightText.SetControlForeground( aTextColor ); - aBuildData.SetBackground( aWall ); - - Font aSmallFont = rSettings.GetInfoFont(); - Size aSmaller = aNewFont.GetSize(); - aSmaller.Width() = (long) (aSmaller.Width() * 0.75); - aSmaller.Height() = (long) (aSmaller.Height() * 0.75); - aNewFont.SetSize( aSmaller ); - aBuildData.SetFont( aNewFont ); - aBuildData.SetBackground( aWall ); -#ifdef BUILD_VER_STRING - String aBuildString( DEFINE_CONST_UNICODE( BUILD_VER_STRING ) ); -#else - String aBuildString; -#endif - aBuildData.SetText( aBuildString ); - aBuildData.Show(); + + aCopyrightText.SetText( aCopyrightTextStr ); // determine size and position of the dialog & elements Size aAppLogoSiz = aAppLogo.GetSizePixel(); @@ -290,16 +279,13 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerS AboutDialog::~AboutDialog() { // L"oschen des Entwickleraufrufs - if ( aAccelList.Count() ) + if ( !aAccelList.empty() ) { - GetpApp()->RemoveAccel( aAccelList.First() ); - Accelerator* pAccel = aAccelList.Last(); + GetpApp()->RemoveAccel( aAccelList.front() ); - while ( pAccel ) - { - delete pAccel; - pAccel = aAccelList.Prev(); - } + for ( size_t i = 0, n = aAccelList.size(); i < n; ++i ) + delete aAccelList[ i ]; + aAccelList.clear(); } } @@ -340,6 +326,35 @@ IMPL_LINK( AboutDialog, AccelSelectHdl, Accelerator *, pAccelerator ) // ----------------------------------------------------------------------- +IMPL_LINK( AboutDialog, HandleHyperlink, svt::FixedHyperlink*, pHyperlink ) +{ + rtl::OUString sURL=pHyperlink->GetURL(); + rtl::OUString sTitle=GetText(); + + if ( ! sURL.getLength() ) // Nothing to do, when the URL is empty + return 1; + try + { + uno::Reference< com::sun::star::system::XSystemShellExecute > xSystemShellExecute( + ::comphelper::getProcessServiceFactory()->createInstance( + DEFINE_CONST_UNICODE("com.sun.star.system.SystemShellExecute") ), uno::UNO_QUERY_THROW ); + xSystemShellExecute->execute( sURL, rtl::OUString(), com::sun::star::system::SystemShellExecuteFlags::DEFAULTS ); + } + catch ( uno::Exception& ) + { + uno::Any exc( ::cppu::getCaughtException() ); + rtl::OUString msg( ::comphelper::anyToString( exc ) ); + const SolarMutexGuard guard; + ErrorBox aErrorBox( NULL, WB_OK, msg ); + aErrorBox.SetText( sTitle ); + aErrorBox.Execute(); + } + + return 1; +} + +// ----------------------------------------------------------------------- + BOOL AboutDialog::Close() { // stop Timer and finish the dialog @@ -421,3 +436,5 @@ void AboutDialog::Paint( const Rectangle& rRect ) Close(); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/alienwarn.cxx b/sfx2/source/dialog/alienwarn.cxx index 601cd7dad5..14df5beece 100644 --- a/sfx2/source/dialog/alienwarn.cxx +++ b/sfx2/source/dialog/alienwarn.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,6 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" +#include <sal/macros.h> #include "alienwarn.hxx" #include "sfx2/sfxresid.hxx" #include <sfx2/sfxuno.hxx> @@ -143,7 +145,7 @@ void SfxAlienWarningDialog::InitSize() &m_aSaveODFBtn, &m_aKeepCurrentBtn, &m_aMoreInfoBtn, &m_aOptionLine, &m_aWarningOnBox }; Window** pCurrent = pWins; - for ( sal_uInt32 i = 0; i < sizeof( pWins ) / sizeof( pWins[ 0 ] ); ++i, ++pCurrent ) + for ( sal_uInt32 i = 0; i < SAL_N_ELEMENTS( pWins ); ++i, ++pCurrent ) { Point aNewPos = (*pCurrent)->GetPosPixel(); aNewPos.Y() -= nDelta; @@ -175,3 +177,4 @@ void SfxAlienWarningDialog::InitSize() m_aSaveODFBtn.SetPosSizePixel( aPos, aNewSize ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx index edb58bb478..d5590dcb27 100644 --- a/sfx2/source/dialog/basedlgs.cxx +++ b/sfx2/source/dialog/basedlgs.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -55,7 +56,7 @@ using namespace ::com::sun::star::uno; using namespace ::rtl; -#define USERITEM_NAME OUString::createFromAscii( "UserItem" ) +#define USERITEM_NAME OUString(RTL_CONSTASCII_USTRINGPARAM("UserItem")) class SfxModelessDialog_Impl : public SfxListener { @@ -1057,3 +1058,4 @@ const sal_uInt16* SfxSingleTabDialog::GetInputRanges( const SfxItemPool& rPool ) return pRanges; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/dialog.hrc b/sfx2/source/dialog/dialog.hrc index 9664ff19ef..13aba81d3e 100644 --- a/sfx2/source/dialog/dialog.hrc +++ b/sfx2/source/dialog/dialog.hrc @@ -65,8 +65,6 @@ #define RID_ERRBOX_MAIL_CONFIG ( RC_DIALOG_BEGIN + 92 ) -#define IMG_LST_STYLE_DESIGNER_HC ( RC_DIALOG_BEGIN + 99 ) - // 100-106 in tbxcust.hrc #define STR_MACRO_LOSS ( RC_DIALOG_BEGIN + 107 ) #define STR_CANCEL_RECORDING ( RC_DIALOG_BEGIN + 108 ) diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 6c596bea3d..49be693ba4 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -67,7 +68,6 @@ #include <sfx2/frame.hxx> #include <sfx2/viewfrm.hxx> #include <sfx2/request.hxx> -//#include "exptypes.hxx" #include "helper.hxx" #include <sfx2/objsh.hxx> #include <sfx2/docfile.hxx> @@ -163,7 +163,8 @@ String CreateSizeText( ULONG nSize, BOOL bExtraBytes, BOOL bSmartExtraBytes ) fSize /= nGiga; nDec = 3; } - const LocaleDataWrapper& rLocaleWrapper = SvtSysLocale().GetLocaleData(); + const SvtSysLocale aSysLocale; + const LocaleDataWrapper& rLocaleWrapper = aSysLocale.GetLocaleData(); String aSizeStr( rLocaleWrapper.getNum( nSize1, 0 ) ); aSizeStr += aUnitStr; if ( bExtraBytes && ( nSize1 < nSize2 ) ) @@ -402,7 +403,6 @@ void SfxDocumentInfoItem::UpdateDocumentInfo( i_xDocProps->setAutoloadURL(::rtl::OUString()); } i_xDocProps->setDefaultTarget(getDefaultTarget()); -// i_xDocProps->setTemplateName(getTemplateName()); i_xDocProps->setAuthor(getAuthor()); i_xDocProps->setCreationDate(getCreationDate()); i_xDocProps->setModifiedBy(getModifiedBy()); @@ -510,7 +510,7 @@ void SfxDocumentInfoItem::AddCustomProperty( const ::rtl::OUString& sName, const m_aCustomProperties.push_back( pProp ); } -sal_Bool SfxDocumentInfoItem::QueryValue( Any& rVal, BYTE nMemberId ) const +bool SfxDocumentInfoItem::QueryValue( Any& rVal, BYTE nMemberId ) const { String aValue; sal_Int32 nValue = 0; @@ -568,15 +568,15 @@ sal_Bool SfxDocumentInfoItem::QueryValue( Any& rVal, BYTE nMemberId ) const rVal <<= nValue; else rVal <<= bValue; - return sal_True; + return true; } -sal_Bool SfxDocumentInfoItem::PutValue( const Any& rVal, BYTE nMemberId ) +bool SfxDocumentInfoItem::PutValue( const Any& rVal, BYTE nMemberId ) { ::rtl::OUString aValue; sal_Int32 nValue=0; sal_Bool bValue = sal_False; - sal_Bool bRet = sal_False; + bool bRet = false; nMemberId &= ~CONVERT_TWIPS; switch ( nMemberId ) { @@ -633,7 +633,7 @@ sal_Bool SfxDocumentInfoItem::PutValue( const Any& rVal, BYTE nMemberId ) break; default: DBG_ERROR("Wrong MemberId!"); - return sal_False; + return false; } return bRet; @@ -977,20 +977,6 @@ BOOL SfxDocumentPage::FillItemSet( SfxItemSet& rSet ) SfxDocumentInfoItem* pInfoItem = (SfxDocumentInfoItem*)pItem; BOOL bUseData = ( STATE_CHECK == aUseUserDataCB.GetState() ); pInfoItem->SetUseUserData( bUseData ); -/* - if ( !bUseData ) - { - // "Benutzerdaten verwenden" ausgeschaltet -> - // den Benutzer aus den Stamps l"oschen - String aEmptyUser; - aInfo.SetCreated( - SfxStamp( aEmptyUser, aInfo.GetCreated().GetTime() ) ); - aInfo.SetChanged( - SfxStamp( aEmptyUser, aInfo.GetChanged().GetTime() ) ); - aInfo.SetPrinted( - SfxStamp( aEmptyUser, aInfo.GetPrinted().GetTime() ) ); - } -*/ rSet.Put( SfxDocumentInfoItem( *pInfoItem ) ); bRet = TRUE; } @@ -1126,12 +1112,10 @@ void SfxDocumentPage::Reset( const SfxItemSet& rSet ) aCreateValFt.SetText( ConvertDateTime_Impl( pInfoItem->getAuthor(), pInfoItem->getCreationDate(), aLocaleWrapper ) ); util::DateTime aTime( pInfoItem->getModificationDate() ); -// if ( aTime.IsValid() ) if ( aTime.Month > 0 ) aChangeValFt.SetText( ConvertDateTime_Impl( pInfoItem->getModifiedBy(), aTime, aLocaleWrapper ) ); aTime = pInfoItem->getPrintDate(); -// if ( aTime.IsValid()) if ( aTime.Month > 0 ) aPrintValFt.SetText( ConvertDateTime_Impl( pInfoItem->getPrintedBy(), aTime, aLocaleWrapper ) ); @@ -1196,10 +1180,10 @@ SfxInternetPage::SfxInternetPage( Window* pParent, const SfxItemSet& rItemSet ) { pFrame->GetTargetList( aList ); - String* pObj; - for( USHORT nPos = ( USHORT ) aList.Count() ; nPos ; ) + String* pObj; + for( size_t nPos = aList.size() ; nPos ; ) { - pObj = aList.GetObject( --nPos ); + pObj = aList[ --nPos ]; aCBFrame.InsertEntry( *pObj ); delete pObj; } @@ -1776,8 +1760,7 @@ CustomPropertyLine::CustomPropertyLine( Window* pParent ) : m_aTimeField.SetExtFormat( EXTTIMEF_24H_LONG ); m_aDateField.SetExtDateFormat( XTDATEF_SYSTEM_SHORT_YYYY ); - m_aRemoveButton.SetModeImage( SfxResId( SFX_IMG_PROPERTY_REMOVE ), BMP_COLOR_NORMAL ); - m_aRemoveButton.SetModeImage( SfxResId( SFX_IMG_PROPERTY_REMOVE_HC ), BMP_COLOR_HIGHCONTRAST ); + m_aRemoveButton.SetModeImage( SfxResId( SFX_IMG_PROPERTY_REMOVE ) ); } void CustomPropertyLine::SetRemoved() @@ -2027,8 +2010,8 @@ void CustomPropertiesWindow::InitControls( HeaderBar* pHeaderBar, const ScrollBa aSize.Width() = nWidth; aPos.X() = aRect.getX() + ( nOffset / 2 ); m_aYesNoButton.SetPosSizePixel( aPos, aSize ); - aSize.Width() /= 2; - aSize.Width() -= 2; + aSize.Width() /= 2; + aSize.Width() -= 2; m_aDateField.SetPosSizePixel( aPos, aSize ); aPos.X() += aSize.Width() + 4; m_aTimeField.SetPosSizePixel( aPos, aSize ); @@ -2102,7 +2085,7 @@ void CustomPropertiesWindow::AddLine( const ::rtl::OUString& sName, Any& rAny ) SvtSysLocale aSysLocale; const LocaleDataWrapper& rLocaleWrapper = aSysLocale.GetLocaleData(); pNewLine->m_aNameBox.SetText( sName ); - sal_Int32 nType = CUSTOM_TYPE_UNKNOWN; + sal_IntPtr nType = CUSTOM_TYPE_UNKNOWN; String sValue; if ( rAny >>= nTmpValue ) @@ -2125,7 +2108,7 @@ void CustomPropertiesWindow::AddLine( const ::rtl::OUString& sName, Any& rAny ) else if ( rAny >>= aTmpDate ) { nType = CUSTOM_TYPE_DATE; - pNewLine->m_aDateField.SetDate( Date( aTmpDate.Day, aTmpDate.Month, aTmpDate.Year ) ); + pNewLine->m_aDateField.SetDate( Date( aTmpDate.Day, aTmpDate.Month, aTmpDate.Year ) ); } else if ( rAny >>= aTmpDuration ) @@ -2268,7 +2251,7 @@ Sequence< beans::PropertyValue > CustomPropertiesWindow::GetCustomProperties() c { Date aTmpDate = pLine->m_aDateField.GetDate(); Time aTmpTime = pLine->m_aTimeField.GetTime(); - util::DateTime aDateTime(aTmpTime.Get100Sec(), aTmpTime.GetSec(), aTmpTime.GetMin(), aTmpTime.GetHour(), + util::DateTime aDateTime(aTmpTime.Get100Sec(), aTmpTime.GetSec(), aTmpTime.GetMin(), aTmpTime.GetHour(), aTmpDate.GetDay(), aTmpDate.GetMonth(), aTmpDate.GetYear() ); aPropertiesSeq[i].Value <<= aDateTime; } @@ -2343,7 +2326,6 @@ CustomPropertiesControl::CustomPropertiesControl( Window* pParent, const ResId& Link aScrollLink = LINK( this, CustomPropertiesControl, ScrollHdl ); m_aVertScroll.SetScrollHdl( aScrollLink ); -// m_aVertScroll.SetEndScrollHdl( aScrollLink ); } CustomPropertiesControl::~CustomPropertiesControl() @@ -2464,3 +2446,4 @@ SfxTabPage* SfxCustomPropertiesPage::Create( Window* pParent, const SfxItemSet& return new SfxCustomPropertiesPage( pParent, rItemSet ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/dinfdlg.src b/sfx2/source/dialog/dinfdlg.src index 9a45eac92d..17ec71c4fd 100644..100755 --- a/sfx2/source/dialog/dinfdlg.src +++ b/sfx2/source/dialog/dinfdlg.src @@ -705,11 +705,6 @@ Image SFX_IMG_PROPERTY_REMOVE ImageBitmap = Bitmap { File = "deleterow.bmp" ; }; MaskColor = Color { Red=0xffff; Green=0x0000; Blue=0xffff; }; }; -Image SFX_IMG_PROPERTY_REMOVE_HC -{ - ImageBitmap = Bitmap { File = "deleterow_h.bmp" ; }; - MaskColor = Color { Red=0xffff; Green=0x0000; Blue=0xffff; }; -}; QueryBox SFX_QB_WRONG_TYPE { diff --git a/sfx2/source/dialog/dinfedt.cxx b/sfx2/source/dialog/dinfedt.cxx index 8281290e74..ea6db7fd3f 100644 --- a/sfx2/source/dialog/dinfedt.cxx +++ b/sfx2/source/dialog/dinfedt.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -64,3 +65,4 @@ SfxDocInfoEditDlg::SfxDocInfoEditDlg( Window* pParent ) : FreeResource(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx index 36be016832..ef46c63ce9 100644 --- a/sfx2/source/dialog/dockwin.cxx +++ b/sfx2/source/dialog/dockwin.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -104,9 +105,6 @@ namespace }; } -static uno::WeakReference< container::XNameAccess > m_xWindowStateConfiguration; -static uno::WeakReference< frame::XModuleManager > m_xModuleManager; - static bool lcl_getWindowState( const uno::Reference< container::XNameAccess >& xWindowStateMgr, const ::rtl::OUString& rResourceURL, WindowState& rWindowState ) { bool bResult = false; @@ -120,7 +118,7 @@ static bool lcl_getWindowState( const uno::Reference< container::XNameAccess >& { for ( sal_Int32 n = 0; n < aWindowState.getLength(); n++ ) { - if ( aWindowState[n].Name.equalsAscii( "UIName" )) + if ( aWindowState[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "UIName" ) )) { aWindowState[n].Value >>= rWindowState.sTitle; } @@ -191,6 +189,8 @@ SfxDockingWrapper::SfxDockingWrapper( Window* pParentWnd , uno::UNO_QUERY ); } + static uno::WeakReference< frame::XModuleManager > m_xModuleManager; + uno::Reference< frame::XModuleManager > xModuleManager( m_xModuleManager ); if ( !xModuleManager.is() ) { @@ -201,6 +201,8 @@ SfxDockingWrapper::SfxDockingWrapper( Window* pParentWnd , m_xModuleManager = xModuleManager; } + static uno::WeakReference< container::XNameAccess > m_xWindowStateConfiguration; + uno::Reference< container::XNameAccess > xWindowStateConfiguration( m_xWindowStateConfiguration ); if ( !xWindowStateConfiguration.is() ) { @@ -248,7 +250,8 @@ SfxDockingWrapper::SfxDockingWrapper( Window* pParentWnd , SfxChildWindow* SfxDockingWrapper::CreateImpl( Window *pParent, sal_uInt16 nId, SfxBindings *pBindings, SfxChildWinInfo* pInfo ) { - SfxChildWindow *pWin = new SfxDockingWrapper(pParent, nId, pBindings, pInfo); return pWin; + SfxChildWindow *pWin = new SfxDockingWrapper(pParent, nId, pBindings, pInfo); + return pWin; } sal_uInt16 SfxDockingWrapper::GetChildWindowId () @@ -390,7 +393,7 @@ static SfxWorkWindow* lcl_getWorkWindowFromXFrame( const uno::Reference< frame:: */ void SAL_CALL SfxDockingWindowFactory( const uno::Reference< frame::XFrame >& rFrame, const rtl::OUString& rDockingWindowName ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; USHORT nID = USHORT(rDockingWindowName.toInt32()); // Check the range of the provided ID otherwise nothing will happen @@ -416,7 +419,7 @@ void SAL_CALL SfxDockingWindowFactory( const uno::Reference< frame::XFrame >& rF */ bool SAL_CALL IsDockingWindowVisible( const uno::Reference< frame::XFrame >& rFrame, const rtl::OUString& rDockingWindowName ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; USHORT nID = USHORT(rDockingWindowName.toInt32()); @@ -821,11 +824,8 @@ void SfxDockingWindow::EndDocking( const Rectangle& rRect, BOOL bFloatMode ) SfxWorkWindow *pWorkWin = pBindings->GetWorkWindow_Impl(); BOOL bReArrange = FALSE; - SfxChildIdentifier eIdent = SFX_CHILDWIN_DOCKINGWINDOW; if ( pImp->bSplitable ) { - eIdent = SFX_CHILDWIN_SPLITWINDOW; - // Wenn sich das Alignment "andert und das Fenster befindet sich // im angedockten Zustand in einem SplitWindow, mu\s umgemeldet werden // Wenn neu angedockt wird, machen PrepareToggleFloatingMode() @@ -2019,3 +2019,4 @@ IMPL_LINK( SfxDockingWindow, TimerHdl, Timer*, EMPTYARG) return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index fba909e74d..09545e479d 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -63,9 +64,9 @@ #include <unotools/ucbstreamhelper.hxx> #include <unotools/ucbhelper.hxx> #include <unotools/localfilehelper.hxx> -#include <vos/thread.hxx> -#include <vos/mutex.hxx> -#include <vos/security.hxx> +#include <osl/mutex.hxx> +#include <osl/security.hxx> +#include <osl/thread.hxx> #include <vcl/cvtgrf.hxx> #include <vcl/msgbox.hxx> #include <vcl/mnemonic.hxx> @@ -154,35 +155,35 @@ String DecodeSpaces_Impl( const String& rSource ); // ------------------------------------------------------------------------ void SAL_CALL FileDialogHelper_Impl::fileSelectionChanged( const FilePickerEvent& aEvent ) throw ( RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; mpAntiImpl->FileSelectionChanged( aEvent ); } // ------------------------------------------------------------------------ void SAL_CALL FileDialogHelper_Impl::directoryChanged( const FilePickerEvent& aEvent ) throw ( RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; mpAntiImpl->DirectoryChanged( aEvent ); } // ------------------------------------------------------------------------ OUString SAL_CALL FileDialogHelper_Impl::helpRequested( const FilePickerEvent& aEvent ) throw ( RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; return mpAntiImpl->HelpRequested( aEvent ); } // ------------------------------------------------------------------------ void SAL_CALL FileDialogHelper_Impl::controlStateChanged( const FilePickerEvent& aEvent ) throw ( RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; mpAntiImpl->ControlStateChanged( aEvent ); } // ------------------------------------------------------------------------ void SAL_CALL FileDialogHelper_Impl::dialogSizeChanged() throw ( RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; mpAntiImpl->DialogSizeChanged(); } @@ -191,7 +192,7 @@ void SAL_CALL FileDialogHelper_Impl::dialogSizeChanged() throw ( RuntimeExceptio // ------------------------------------------------------------------------ void SAL_CALL FileDialogHelper_Impl::dialogClosed( const DialogClosedEvent& _rEvent ) throw ( RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; mpAntiImpl->DialogClosed( _rEvent ); postExecute( _rEvent.DialogResult ); } @@ -314,7 +315,7 @@ void FileDialogHelper_Impl::handleDialogSizeChanged() // ------------------------------------------------------------------------ void SAL_CALL FileDialogHelper_Impl::disposing( const EventObject& ) throw ( RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; dispose(); } @@ -530,7 +531,7 @@ void FileDialogHelper_Impl::updateSelectionBox() Sequence< ::rtl::OUString > aCtrlList = xCtrlInfo->getSupportedControls(); sal_uInt32 nCount = aCtrlList.getLength(); for ( sal_uInt32 nCtrl = 0; nCtrl < nCount; ++nCtrl ) - if ( aCtrlList[ nCtrl ].equalsAscii("SelectionBox") ) + if ( aCtrlList[ nCtrl ].equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SelectionBox")) ) { bSelectionBoxFound = sal_False; break; @@ -706,22 +707,6 @@ void FileDialogHelper_Impl::updateVersions() } // ----------------------------------------------------------------------- -class OReleaseSolarMutex -{ -private: - const sal_Int32 m_nAquireCount; -public: - OReleaseSolarMutex( ) - :m_nAquireCount( Application::ReleaseSolarMutex() ) - { - } - ~OReleaseSolarMutex( ) - { - Application::AcquireSolarMutex( m_nAquireCount ); - } -}; - -// ----------------------------------------------------------------------- IMPL_LINK( FileDialogHelper_Impl, TimeOutHdl_Impl, Timer*, EMPTYARG ) { if ( !mbHasPreview ) @@ -786,7 +771,7 @@ IMPL_LINK( FileDialogHelper_Impl, TimeOutHdl_Impl, Timer*, EMPTYARG ) try { - OReleaseSolarMutex aReleaseForCallback; + SolarMutexReleaser aReleaseForCallback; // clear the preview window xFilePicker->setImage( FilePreviewImageFormats::BITMAP, aAny ); } @@ -1171,10 +1156,10 @@ FileDialogHelper_Impl::~FileDialogHelper_Impl() #define nMagic -1 -class PickerThread_Impl : public ::vos::OThread +class PickerThread_Impl : public ::osl::Thread { uno::Reference < XFilePicker > mxPicker; - ::vos::OMutex maMutex; + ::osl::Mutex maMutex; virtual void SAL_CALL run(); sal_Int16 mnRet; public: @@ -1182,10 +1167,10 @@ public: : mxPicker( rPicker ), mnRet(nMagic) {} sal_Int16 GetReturnValue() - { ::vos::OGuard aGuard( maMutex ); return mnRet; } + { ::osl::MutexGuard aGuard( maMutex ); return mnRet; } void SetReturnValue( sal_Int16 aRetValue ) - { ::vos::OGuard aGuard( maMutex ); mnRet = aRetValue; } + { ::osl::MutexGuard aGuard( maMutex ); mnRet = aRetValue; } }; void SAL_CALL PickerThread_Impl::run() @@ -1349,7 +1334,7 @@ sal_Int16 FileDialogHelper_Impl::implDoExecute() #ifdef WNT if ( mbSystemPicker ) { - OReleaseSolarMutex aSolarMutex; + SolarMutexReleaser aSolarMutex; nRet = mxFileDlg->execute(); } else @@ -1636,7 +1621,7 @@ ErrCode FileDialogHelper_Impl::execute( SvStringsDtor*& rpURLList, if ( ( aValue >>= bPassWord ) && bPassWord ) { // ask for a password - uno::Reference < ::com::sun::star::task::XInteractionHandler > xInteractionHandler( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.comp.uui.UUIInteractionHandler")), UNO_QUERY ); + uno::Reference < ::com::sun::star::task::XInteractionHandler > xInteractionHandler( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.uui.UUIInteractionHandler"))), UNO_QUERY ); if( xInteractionHandler.is() ) { @@ -1874,7 +1859,7 @@ void FileDialogHelper_Impl::addFilters( sal_Int64 nFlags, uno::Reference< XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory(); uno::Reference< XContainerQuery > xFilterCont( - xSMGR->createInstance(::rtl::OUString::createFromAscii("com.sun.star.document.FilterFactory")), + xSMGR->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.FilterFactory"))), UNO_QUERY); if ( ! xFilterCont.is() ) return; @@ -2049,11 +2034,7 @@ void FileDialogHelper_Impl::saveConfig() try { - aValue = xDlg->getValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0 ); sal_Bool bValue = sal_False; - aValue >>= bValue; - aUserData.SetToken( 0, ' ', String::CreateFromInt32( (sal_Int32) bValue ) ); - aValue = xDlg->getValue( ExtendedFilePickerElementIds::CHECKBOX_PREVIEW, 0 ); bValue = sal_False; aValue >>= bValue; @@ -2193,14 +2174,6 @@ void FileDialogHelper_Impl::loadConfig() { try { - // respect the last "insert as link" state - sal_Bool bLink = (sal_Bool) aUserData.GetToken( 0, ' ' ).ToInt32(); - if ( !xDlg->getValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0 ).hasValue() ) - { - aValue <<= bLink; - xDlg->setValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0, aValue ); - } - // respect the last "show preview" state sal_Bool bShowPreview = (sal_Bool) aUserData.GetToken( 1, ' ' ).ToInt32(); if ( !xDlg->getValue( ExtendedFilePickerElementIds::CHECKBOX_PREVIEW, 0 ).hasValue() ) @@ -2351,25 +2324,7 @@ void FileDialogHelper_Impl::SetContext( FileDialogHelper::Context _eNewContext ) { meContext = _eNewContext; - sal_Int32 nNewHelpId = 0; - OUString aConfigId; - - switch( _eNewContext ) - { -// #104952# dependency to SVX not allowed! When used again, another solution has to be found -// case FileDialogHelper::SW_INSERT_GRAPHIC: -// case FileDialogHelper::SC_INSERT_GRAPHIC: -// case FileDialogHelper::SD_INSERT_GRAPHIC: nNewHelpId = SID_INSERT_GRAPHIC; break; - case FileDialogHelper::SW_INSERT_SOUND: - case FileDialogHelper::SC_INSERT_SOUND: - case FileDialogHelper::SD_INSERT_SOUND: nNewHelpId = SID_INSERT_SOUND; break; - case FileDialogHelper::SW_INSERT_VIDEO: - case FileDialogHelper::SC_INSERT_VIDEO: - case FileDialogHelper::SD_INSERT_VIDEO: nNewHelpId = SID_INSERT_VIDEO; break; - default: break; - } - - const OUString* pConfigId = GetLastFilterConfigId( _eNewContext ); + const OUString* pConfigId = GetLastFilterConfigId( _eNewContext ); if( pConfigId ) LoadLastUsedFilter( *pConfigId ); } @@ -2919,3 +2874,4 @@ String DecodeSpaces_Impl( const String& rSource ) } // end of namespace sfx2 +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/filedlghelper.src b/sfx2/source/dialog/filedlghelper.src index 2b071a2f78..e25fa400f4 100644 --- a/sfx2/source/dialog/filedlghelper.src +++ b/sfx2/source/dialog/filedlghelper.src @@ -25,14 +25,9 @@ * ************************************************************************/ -// includes ****************************************************************** - #include "sfxlocal.hrc" #include "filedlghelper.hrc" -//#include "helpid.hrc" - -// strings ******************************************************************* String STR_SFX_FILEDLG_ACTUALVERSION { diff --git a/sfx2/source/dialog/filedlgimpl.hxx b/sfx2/source/dialog/filedlgimpl.hxx index e2d2bfbf40..5e6f4e9219 100644 --- a/sfx2/source/dialog/filedlgimpl.hxx +++ b/sfx2/source/dialog/filedlgimpl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -236,3 +237,4 @@ namespace sfx2 #endif // _SFX_FILEDLGIMPL_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/filtergrouping.cxx b/sfx2/source/dialog/filtergrouping.cxx index 86456faed1..1ae58c13ca 100644 --- a/sfx2/source/dialog/filtergrouping.cxx +++ b/sfx2/source/dialog/filtergrouping.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -919,7 +920,7 @@ namespace sfx2 { ::comphelper::SequenceAsHashMap lFilterProps (xFilterList->nextElement()); ::rtl::OUString sFilterName = lFilterProps.getUnpackedValueOrDefault( - ::rtl::OUString::createFromAscii("Name"), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name")), ::rtl::OUString()); if (sFilterName.getLength()) m_lFilters.push_back(sFilterName); @@ -967,10 +968,9 @@ namespace sfx2 // retrieve the default filter for this application module. // It must be set as first of the generated filter list. const SfxFilter* pDefaultFilter = SfxFilterContainer::GetDefaultFilter_Impl(_rFactory); - // --> PB 2004-11-01 #i32434# only use one extension + // Only use one extension (#i32434#) // (and always the first if there are more than one) sExtension = pDefaultFilter->GetWildcard().GetWildCard().GetToken( 0, ';' ); - // <-- sUIName = addExtension( pDefaultFilter->GetUIName(), sExtension, sal_False, _rFileDlgImpl ); try { @@ -992,10 +992,9 @@ namespace sfx2 if (pFilter->GetName() == pDefaultFilter->GetName()) continue; - // --> PB 2004-09-21 #i32434# only use one extension + // Only use one extension (#i32434#) // (and always the first if there are more than one) sExtension = pFilter->GetWildcard().GetWildCard().GetToken( 0, ';' ); - // <-- sUIName = addExtension( pFilter->GetUIName(), sExtension, sal_False, _rFileDlgImpl ); try { @@ -1075,9 +1074,9 @@ namespace sfx2 { std::vector< ExportFilter >::iterator aIter = aImportantFilterGroup.begin(); if ( nHTMLIndex != -1 ) - aIter++; + ++aIter; if ( nXHTMLIndex != -1 ) - aIter++; + ++aIter; aImportantFilterGroup.insert( aIter, aExportFilter ); nPDFIndex = 0; } @@ -1085,11 +1084,11 @@ namespace sfx2 { std::vector< ExportFilter >::iterator aIter = aImportantFilterGroup.begin(); if ( nHTMLIndex != -1 ) - aIter++; + ++aIter; if ( nXHTMLIndex != -1 ) - aIter++; + ++aIter; if ( nPDFIndex != -1 ) - aIter++; + ++aIter; aImportantFilterGroup.insert( aIter, aExportFilter ); nFlashIndex = 0; } @@ -1272,3 +1271,4 @@ namespace sfx2 //........................................................................ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/filtergrouping.hxx b/sfx2/source/dialog/filtergrouping.hxx index e65c64025c..d34ec4d615 100644 --- a/sfx2/source/dialog/filtergrouping.hxx +++ b/sfx2/source/dialog/filtergrouping.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -104,3 +105,4 @@ namespace sfx2 #endif // SFX2_FILTERGROUPING_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/intro.cxx b/sfx2/source/dialog/intro.cxx index b5926fdeb6..0583899880 100644 --- a/sfx2/source/dialog/intro.cxx +++ b/sfx2/source/dialog/intro.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,9 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" -#ifndef GCC -#endif - #include "intro.hxx" #include <tools/stream.hxx> @@ -108,3 +106,4 @@ void IntroWindow_Impl::Slide() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/itemconnect.cxx b/sfx2/source/dialog/itemconnect.cxx index 7662d2c276..9fb8990d5a 100644 --- a/sfx2/source/dialog/itemconnect.cxx +++ b/sfx2/source/dialog/itemconnect.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -406,3 +407,4 @@ bool ItemConnectionArray::FillItemSet( SfxItemSet& rDestSet, const SfxItemSet& r } // namespace sfx +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx index a3807486e5..3e229504f0 100644 --- a/sfx2/source/dialog/mailmodel.cxx +++ b/sfx2/source/dialog/mailmodel.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -144,11 +145,6 @@ void PrepareListener_Impl::disposing(const css::lang::EventObject& /*rEvent*/) t { } -// class AddressList_Impl ------------------------------------------------ - -typedef String* AddressItemPtr_Impl; -DECLARE_LIST( AddressList_Impl, AddressItemPtr_Impl ) - // class SfxMailModel ----------------------------------------------- static const char PDF_DOCUMENT_TYPE[] = "pdf_Portable_Document_Format"; @@ -158,10 +154,9 @@ void SfxMailModel::ClearList( AddressList_Impl* pList ) { if ( pList ) { - ULONG i, nCount = pList->Count(); - for ( i = 0; i < nCount; ++i ) - delete pList->GetObject(i); - pList->Clear(); + for( size_t i = 0, n = pList->size(); i < n; ++i ) + delete pList->at(i); + pList->clear(); } } @@ -170,12 +165,11 @@ void SfxMailModel::MakeValueList( AddressList_Impl* pList, String& rValueList ) rValueList.Erase(); if ( pList ) { - ULONG i, nCount = pList->Count(); - for ( i = 0; i < nCount; ++i ) + for( size_t i = 0, n = pList->size(); i < n; ++i ) { if ( rValueList.Len() > 0 ) rValueList += ','; - rValueList += *pList->GetObject(i); + rValueList += *pList->at(i); } } } @@ -221,7 +215,7 @@ SfxMailModel::SaveResult SfxMailModel::ShowFilterOptionsDialog( ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > xFilterCFG = uno::Reference< container::XNameAccess >( xSMGR->createInstance( - ::rtl::OUString::createFromAscii( "com.sun.star.document.FilterFactory" ) ), uno::UNO_QUERY ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.FilterFactory")) ), uno::UNO_QUERY ); css::uno::Reference< css::util::XModifiable > xModifiable( xModel, css::uno::UNO_QUERY ); if ( !xFilterCFG.is() ) @@ -234,7 +228,7 @@ SfxMailModel::SaveResult SfxMailModel::ShowFilterOptionsDialog( sal_Int32 nPropertyCount = aProps.getLength(); for( sal_Int32 nProperty=0; nProperty < nPropertyCount; ++nProperty ) { - if( aProps[nProperty].Name.equals( ::rtl::OUString::createFromAscii( "UIComponent" )) ) + if( aProps[nProperty].Name.equals( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UIComponent"))) ) { ::rtl::OUString aServiceName; aProps[nProperty].Value >>= aServiceName; @@ -281,7 +275,7 @@ SfxMailModel::SaveResult SfxMailModel::ShowFilterOptionsDialog( //add them to the args for ( sal_Int32 nInd = 0; nInd < aPropsFromDialog.getLength(); nInd++ ) { - if( aPropsFromDialog[ nInd ].Name.equals( ::rtl::OUString::createFromAscii( "FilterData" ) ) ) + if( aPropsFromDialog[ nInd ].Name.equals( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FilterData")) ) ) { //found the filterdata, add to the storing argument rArgs.realloc( ++rNumArgs ); @@ -441,7 +435,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( { ::comphelper::SequenceAsHashMap aFilterPropsHM( xEnumeration->nextElement() ); aFilterName = aFilterPropsHM.getUnpackedValueOrDefault( - ::rtl::OUString::createFromAscii( "Name" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name")), ::rtl::OUString() ); } @@ -480,7 +474,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( { ::comphelper::SequenceAsHashMap aFilterPropsHM( xNameAccess->getByName( aModule ) ); aFilterName = aFilterPropsHM.getUnpackedValueOrDefault( - ::rtl::OUString::createFromAscii( "ooSetupFactoryDefaultFilter" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooSetupFactoryDefaultFilter")), ::rtl::OUString() ); css::uno::Reference< css::container::XNameAccess > xNameAccess2( xContainerQuery, css::uno::UNO_QUERY ); @@ -488,7 +482,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( { ::comphelper::SequenceAsHashMap aFilterPropsHM2( xNameAccess2->getByName( aFilterName ) ); aTypeName = aFilterPropsHM2.getUnpackedValueOrDefault( - ::rtl::OUString::createFromAscii( "Type" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Type")), ::rtl::OUString() ); } } @@ -527,7 +521,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( { ::comphelper::SequenceAsHashMap aTypeNamePropsHM( xTypeDetection->getByName( aTypeName ) ); uno::Sequence< ::rtl::OUString > aExtensions = aTypeNamePropsHM.getUnpackedValueOrDefault( - ::rtl::OUString::createFromAscii( "Extensions" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Extensions")), ::uno::Sequence< ::rtl::OUString >() ); if ( aExtensions.getLength() ) aExtension = aExtensions[0]; @@ -776,21 +770,21 @@ void SfxMailModel::AddAddress( const String& rAddress, AddressRole eRole ) { if ( !mpToList ) // create the list - mpToList = new AddressList_Impl; + mpToList = new AddressList_Impl(); pList = mpToList; } else if ( ROLE_CC == eRole ) { if ( !mpCcList ) // create the list - mpCcList = new AddressList_Impl; + mpCcList = new AddressList_Impl(); pList = mpCcList; } else if ( ROLE_BCC == eRole ) { if ( !mpBccList ) // create the list - mpBccList = new AddressList_Impl; + mpBccList = new AddressList_Impl(); pList = mpBccList; } else @@ -802,7 +796,7 @@ void SfxMailModel::AddAddress( const String& rAddress, AddressRole eRole ) { // add address to list AddressItemPtr_Impl pAddress = new String( rAddress ); - pList->Insert( pAddress, LIST_APPEND ); + pList->push_back( pAddress ); } } } @@ -865,52 +859,52 @@ SfxMailModel::SendMailResult SfxMailModel::Send( const css::uno::Reference< css: } xSimpleMailMessage->setOriginator( maFromAddress ); - sal_Int32 nToCount = mpToList ? mpToList->Count() : 0; - sal_Int32 nCcCount = mpCcList ? mpCcList->Count() : 0; - sal_Int32 nCcSeqCount = nCcCount; + size_t nToCount = mpToList ? mpToList->size() : 0; + size_t nCcCount = mpCcList ? mpCcList->size() : 0; + size_t nCcSeqCount = nCcCount; // set recipient (only one) for this simple mail server!! if ( nToCount > 1 ) { nCcSeqCount = nToCount - 1 + nCcCount; - xSimpleMailMessage->setRecipient( *mpToList->GetObject( 0 )); + xSimpleMailMessage->setRecipient( *mpToList->at( 0 ) ); nSendFlags = SimpleMailClientFlags::NO_USER_INTERFACE; } else if ( nToCount == 1 ) { - xSimpleMailMessage->setRecipient( *mpToList->GetObject( 0 )); + xSimpleMailMessage->setRecipient( *mpToList->at( 0 ) ); nSendFlags = SimpleMailClientFlags::NO_USER_INTERFACE; } // all other recipient must be handled with CC recipients! if ( nCcSeqCount > 0 ) { - sal_Int32 nIndex = 0; - Sequence< OUString > aCcRecipientSeq; + size_t nIndex = 0; + Sequence< OUString > aCcRecipientSeq; aCcRecipientSeq.realloc( nCcSeqCount ); if ( nCcSeqCount > nCcCount ) { - for ( sal_Int32 i = 1; i < nToCount; ++i ) + for ( size_t i = 1; i < nToCount; ++i ) { - aCcRecipientSeq[nIndex++] = *mpToList->GetObject(i); + aCcRecipientSeq[nIndex++] = *mpToList->at(i); } } - for ( sal_Int32 i = 0; i < nCcCount; i++ ) + for ( size_t i = 0; i < nCcCount; i++ ) { - aCcRecipientSeq[nIndex++] = *mpCcList->GetObject(i); + aCcRecipientSeq[nIndex++] = *mpCcList->at(i); } xSimpleMailMessage->setCcRecipient( aCcRecipientSeq ); } - sal_Int32 nBccCount = mpBccList ? mpBccList->Count() : 0; + size_t nBccCount = mpBccList ? mpBccList->size() : 0; if ( nBccCount > 0 ) { Sequence< OUString > aBccRecipientSeq( nBccCount ); - for ( sal_Int32 i = 0; i < nBccCount; ++i ) + for ( size_t i = 0; i < nBccCount; ++i ) { - aBccRecipientSeq[i] = *mpBccList->GetObject(i); + aBccRecipientSeq[i] = *mpBccList->at(i); } xSimpleMailMessage->setBccRecipient( aBccRecipientSeq ); } @@ -937,7 +931,7 @@ SfxMailModel::SendMailResult SfxMailModel::Send( const css::uno::Reference< css: { css::uno::Reference< css::awt::XWindow > xParentWindow = xFrame->getContainerWindow(); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Window* pParentWindow = VCLUnoHelper::GetWindow( xParentWindow ); ErrorBox aBox( pParentWindow, SfxResId( RID_ERRBOX_MAIL_CONFIG )); @@ -1027,3 +1021,5 @@ BOOL CreateFromAddress_Impl( String& rFrom ) rFrom.Erase(); return ( rFrom.Len() > 0 ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx index bc630affac..fa663e745e 100644 --- a/sfx2/source/dialog/mgetempl.cxx +++ b/sfx2/source/dialog/mgetempl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,9 +31,7 @@ // include --------------------------------------------------------------- -#ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> -#endif #include <vcl/field.hxx> #include <svl/eitem.hxx> #include <svl/intitem.hxx> @@ -208,24 +207,23 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage( Window* pParent, const SfxItem aBaseFt.Disable(); aBaseLb.Disable(); } - USHORT nCount = pFamilies->Count(); - USHORT i; + size_t nCount = pFamilies->size(); + size_t i; for ( i = 0; i < nCount; ++i ) { - pItem = pFamilies->GetObject(i); + pItem = pFamilies->at( i ); if ( pItem->GetFamily() == pStyle->GetFamily() ) break; } - USHORT nStyleFilterIdx = 0xffff; - if ( i < nCount ) { + USHORT nStyleFilterIdx = 0xffff; // Filterflags const SfxStyleFilter& rList = pItem->GetFilterList(); - nCount = (USHORT)rList.Count(); + nCount = rList.size(); USHORT nIdx = 0; USHORT nMask = pStyle->GetMask() & ~SFXSTYLEBIT_USERDEF; @@ -234,11 +232,10 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage( Window* pParent, const SfxItem for ( i = 0; i < nCount; ++i ) { - SfxFilterTupel* pTupel = rList.GetObject(i); + SfxFilterTupel* pTupel = rList[ i ]; if ( pTupel->nFlags != SFXSTYLEBIT_AUTO && pTupel->nFlags != SFXSTYLEBIT_USED && -// pTupel->nFlags != SFXSTYLEBIT_USERDEF && pTupel->nFlags != SFXSTYLEBIT_ALL ) { aFilterLb.InsertEntry( pTupel->aName, nIdx ); @@ -454,12 +451,9 @@ BOOL SfxManageStyleSheetPage::FillItemSet( SfxItemSet& rSet ) // geht nur bei Benutzervorlagen #if OSL_DEBUG_LEVEL > 1 USHORT nIdx = (USHORT)(long)aFilterLb.GetEntryData( nFilterIdx ); - SfxFilterTupel* p; - p = pItem->GetFilterList().GetObject( nIdx ); + SfxFilterTupel* p = pItem->GetFilterList()[ nIdx ]; #endif - USHORT nMask = pItem->GetFilterList().GetObject( - (USHORT)(long)aFilterLb.GetEntryData( nFilterIdx ) )->nFlags | - SFXSTYLEBIT_USERDEF; + USHORT nMask = pItem->GetFilterList()[ (size_t)aFilterLb.GetEntryData( nFilterIdx ) ]->nFlags | SFXSTYLEBIT_USERDEF; pStyle->SetMask( nMask ); } if(aAutoCB.IsVisible() && @@ -680,3 +674,4 @@ int SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet ) return nRet; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/navigat.cxx b/sfx2/source/dialog/navigat.cxx index 76d43eb15b..20ed965611 100644 --- a/sfx2/source/dialog/navigat.cxx +++ b/sfx2/source/dialog/navigat.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,9 +31,6 @@ // includes ******************************************************************* -#ifndef GCC -#endif - #include <sfx2/navigat.hxx> #include <sfx2/sfx.hrc> #include <sfx2/app.hxx> @@ -98,3 +96,4 @@ BOOL SfxNavigator::Close() return FALSE; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/newstyle.cxx b/sfx2/source/dialog/newstyle.cxx index 07e27b9866..010662d764 100644 --- a/sfx2/source/dialog/newstyle.cxx +++ b/sfx2/source/dialog/newstyle.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -102,7 +103,8 @@ SfxNewStyleDlg::SfxNewStyleDlg( Window* pParent, SfxStyleSheetBasePool& rInPool // ----------------------------------------------------------------------- -__EXPORT SfxNewStyleDlg::~SfxNewStyleDlg() +SfxNewStyleDlg::~SfxNewStyleDlg() { } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/partwnd.cxx b/sfx2/source/dialog/partwnd.cxx index 747560edba..a38141a3af 100644 --- a/sfx2/source/dialog/partwnd.cxx +++ b/sfx2/source/dialog/partwnd.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -43,9 +44,7 @@ #include <com/sun/star/frame/XController.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/awt/PosSize.hpp> -#ifndef _UNOTOOLS_PROCESSFACTORY_HXX #include <comphelper/processfactory.hxx> -#endif #include <toolkit/helper/vclunohelper.hxx> @@ -255,3 +254,4 @@ void SfxPartDockWnd_Impl::FillInfo( SfxChildWinInfo& rInfo ) const } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/passwd.cxx b/sfx2/source/dialog/passwd.cxx index 2d5c4f97ae..30e661dcc4 100644 --- a/sfx2/source/dialog/passwd.cxx +++ b/sfx2/source/dialog/passwd.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,8 +31,6 @@ // Include --------------------------------------------------------------- #include <vcl/msgbox.hxx> -#ifndef GCC -#endif #include <sfx2/passwd.hxx> #include "sfxtypes.hxx" @@ -186,6 +185,25 @@ SfxPasswordDialog::SfxPasswordDialog( Window* pParent, const String* pGroupText if ( pGroupText ) maPasswordBox.SetText( *pGroupText ); + +//set the text to the pasword length + SetPasswdText(); +} + +// ----------------------------------------------------------------------- + +void SfxPasswordDialog::SetPasswdText( ) +{ +//set the new string to the minimum password length + if( mnMinLen == 0 ) + maMinLengthFT.SetText( maEmptyPwdStr ); + else + { + maMainPwdStr = maMinLenPwdStr; + maMainPwdStr.SearchAndReplace( String::CreateFromAscii( "$(MINLEN)" ), String::CreateFromInt32((sal_Int32) mnMinLen ), 0); + maMinLengthFT.SetText( maMainPwdStr ); + maMinLengthFT.Show(); + } } // ----------------------------------------------------------------------- @@ -193,6 +211,7 @@ SfxPasswordDialog::SfxPasswordDialog( Window* pParent, const String* pGroupText void SfxPasswordDialog::SetMinLen( USHORT nLen ) { mnMinLen = nLen; + SetPasswdText(); EditModifyHdl( NULL ); } @@ -253,3 +272,4 @@ short SfxPasswordDialog::Execute() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/passwd.hrc b/sfx2/source/dialog/passwd.hrc index 844de643f4..09a7fb6487 100644 --- a/sfx2/source/dialog/passwd.hrc +++ b/sfx2/source/dialog/passwd.hrc @@ -36,6 +36,7 @@ #define ED_PASSWD_PASSWORD 14 #define FT_PASSWD_CONFIRM 15 #define ED_PASSWD_CONFIRM 16 +#define FT_PASSWD_MINLEN 17 #define BTN_PASSWD_OK 20 #define BTN_PASSWD_CANCEL 21 diff --git a/sfx2/source/dialog/passwd.src b/sfx2/source/dialog/passwd.src index 1d1000c9db..f05a10ddb0 100644 --- a/sfx2/source/dialog/passwd.src +++ b/sfx2/source/dialog/passwd.src @@ -80,6 +80,22 @@ ModalDialog DLG_PASSWD Pos = MAP_APPFONT( 57, 44 ); Size = MAP_APPFONT( 75, 12 ); }; + + String STR_PASSWD_MIN_LEN + { + Text [ en-US ] = "(Minimum $(MINLEN) characters)" ; + }; + String STR_PASSWD_EMPTY + { + Text [ en-US ] = "(The password can be empty)" ; + }; + + FixedText FT_PASSWD_MINLEN + { + Pos = MAP_APPFONT(12, 65 ); + Size = MAP_APPFONT( 126, 10 ); + }; + FixedLine GB_PASSWD_PASSWORD { Pos = MAP_APPFONT( 6, 3 ); diff --git a/sfx2/source/dialog/printopt.cxx b/sfx2/source/dialog/printopt.cxx index fb81bf7a2e..25df40567c 100644 --- a/sfx2/source/dialog/printopt.cxx +++ b/sfx2/source/dialog/printopt.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,8 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" -#ifndef GCC -#endif +#include <sal/macros.h> #include <vcl/msgbox.hxx> #include <unotools/printwarningoptions.hxx> #include <svtools/printoptions.hxx> @@ -42,19 +42,9 @@ #include <sfx2/viewsh.hxx> #include <sfx2/printopt.hxx> -// ----------- -// - statics - -// ----------- - static USHORT aDPIArray[] = { 72, 96, 150, 200, 300, 600 }; static BOOL bOutputForPrinter = TRUE; -#define DPI_COUNT (sizeof(aDPIArray)/sizeof(aDPIArray[0 ])) - -// -------------------------------- -// - SfxCommonPrintOptionsTabPage - -// -------------------------------- - SfxCommonPrintOptionsTabPage::SfxCommonPrintOptionsTabPage( Window* pParent, const SfxItemSet& rSet ) : SfxTabPage( pParent, SfxResId( TP_COMMONPRINTOPTIONS ), rSet ), @@ -107,8 +97,7 @@ SfxCommonPrintOptionsTabPage::SfxCommonPrintOptionsTabPage( Window* pParent, con aReduceGradientsStripesRB.SetToggleHdl( LINK( this, SfxCommonPrintOptionsTabPage, ToggleReduceGradientsStripesRBHdl ) ); aReduceBitmapsResolutionRB.SetToggleHdl( LINK( this, SfxCommonPrintOptionsTabPage, ToggleReduceBitmapsResolutionRBHdl ) ); - // --> PB 2008-06-09 #i89164# - // calculate dynamically the width of radiobutton and listbox + // #i89164# calculate dynamically the width of radiobutton and listbox const long nOffset = 10; Size aOldSize = aReduceBitmapsResolutionRB.GetSizePixel(); Size aNewSize = aReduceBitmapsResolutionRB.GetOptimalSize( WINDOWSIZE_PREFERRED ); @@ -123,24 +112,17 @@ SfxCommonPrintOptionsTabPage::SfxCommonPrintOptionsTabPage( Window* pParent, con aNewSize.Width() += nOffset; aNewSize.Height() = aOldSize.Height(); aReduceBitmapsResolutionLB.SetPosSizePixel( aPos, aNewSize ); - // <-- } -// ----------------------------------------------------------------------------- - SfxCommonPrintOptionsTabPage::~SfxCommonPrintOptionsTabPage() { } -// ----------------------------------------------------------------------------- - SfxTabPage* SfxCommonPrintOptionsTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet ) { return( new SfxCommonPrintOptionsTabPage( pParent, rAttrSet ) ); } -// ----------------------------------------------------------------------------- - Window* SfxCommonPrintOptionsTabPage::GetParentLabeledBy( const Window* pWindow ) const { if ( pWindow == (Window *)&aReduceGradientsStepCountNF ) @@ -161,8 +143,6 @@ Window* SfxCommonPrintOptionsTabPage::GetParentLabelFor( const Window* pWindow ) return SfxTabPage::GetParentLabelFor( pWindow ); } -// ----------------------------------------------------------------------------- - BOOL SfxCommonPrintOptionsTabPage::FillItemSet( SfxItemSet& /*rSet*/ ) { SvtPrintWarningOptions aWarnOptions; @@ -187,8 +167,6 @@ BOOL SfxCommonPrintOptionsTabPage::FillItemSet( SfxItemSet& /*rSet*/ ) return bModified; } -// ----------------------------------------------------------------------------- - void SfxCommonPrintOptionsTabPage::Reset( const SfxItemSet& /*rSet*/ ) { SvtPrintWarningOptions aWarnOptions; @@ -209,13 +187,10 @@ void SfxCommonPrintOptionsTabPage::Reset( const SfxItemSet& /*rSet*/ ) ImplUpdateControls( aPrinterOutputRB.IsChecked() ? &maPrinterOptions : &maPrintFileOptions ); - // --> OD 2008-06-25 #i63982# + // #i63982# ImplSetAccessibleNames(); - // <-- } -// ----------------------------------------------------------------------------- - int SfxCommonPrintOptionsTabPage::DeactivatePage( SfxItemSet* pItemSet ) { if( pItemSet ) @@ -224,8 +199,6 @@ int SfxCommonPrintOptionsTabPage::DeactivatePage( SfxItemSet* pItemSet ) return LEAVE_PAGE; } -// ----------------------------------------------------------------------------- - void SfxCommonPrintOptionsTabPage::ImplUpdateControls( const PrinterOptions* pCurrentOptions ) { aReduceTransparencyCB.Check( pCurrentOptions->IsReduceTransparency() ); @@ -259,7 +232,7 @@ void SfxCommonPrintOptionsTabPage::ImplUpdateControls( const PrinterOptions* pCu aReduceBitmapsResolutionLB.SelectEntryPos( 0 ); else { - for( long i = ( DPI_COUNT - 1 ); i >= 0; i-- ) + for( long i = ( SAL_N_ELEMENTS(aDPIArray) - 1 ); i >= 0; i-- ) { if( nDPI >= aDPIArray[ i ] ) { @@ -279,8 +252,6 @@ void SfxCommonPrintOptionsTabPage::ImplUpdateControls( const PrinterOptions* pCu ClickReduceBitmapsCBHdl( &aReduceBitmapsCB ); } -// ----------------------------------------------------------------------------- - void SfxCommonPrintOptionsTabPage::ImplSetAccessibleNames() { static const String cSeparator = String::CreateFromAscii( " - " ); @@ -379,8 +350,6 @@ void SfxCommonPrintOptionsTabPage::ImplSetAccessibleNames() aTransparencyCB.SetAccessibleName( sAccessibleName ); } -// ----------------------------------------------------------------------------- - void SfxCommonPrintOptionsTabPage::ImplSaveControls( PrinterOptions* pCurrentOptions ) { pCurrentOptions->SetReduceTransparency( aReduceTransparencyCB.IsChecked() ); @@ -392,13 +361,11 @@ void SfxCommonPrintOptionsTabPage::ImplSaveControls( PrinterOptions* pCurrentOpt pCurrentOptions->SetReducedBitmapMode( aReduceBitmapsOptimalRB.IsChecked() ? PRINTER_BITMAP_OPTIMAL : ( aReduceBitmapsNormalRB.IsChecked() ? PRINTER_BITMAP_NORMAL : PRINTER_BITMAP_RESOLUTION ) ); pCurrentOptions->SetReducedBitmapResolution( aDPIArray[ Min( (USHORT) aReduceBitmapsResolutionLB.GetSelectEntryPos(), - (USHORT)( sizeof( aDPIArray ) / sizeof( aDPIArray[ 0 ] ) - 1 ) ) ] ); + (USHORT)( SAL_N_ELEMENTS( aDPIArray ) - 1 ) ) ] ); pCurrentOptions->SetReducedBitmapIncludesTransparency( aReduceBitmapsTransparencyCB.IsChecked() ); pCurrentOptions->SetConvertToGreyscales( aConvertToGreyscalesCB.IsChecked() ); } -// ----------------------------------------------------------------------------- - IMPL_LINK( SfxCommonPrintOptionsTabPage, ClickReduceTransparencyCBHdl, CheckBox*, pBox ) { (void)pBox; //unused @@ -412,8 +379,6 @@ IMPL_LINK( SfxCommonPrintOptionsTabPage, ClickReduceTransparencyCBHdl, CheckBox* return 0; } -// ----------------------------------------------------------------------------- - IMPL_LINK( SfxCommonPrintOptionsTabPage, ClickReduceGradientsCBHdl, CheckBox*, pBox ) { (void)pBox; //unused @@ -428,8 +393,6 @@ IMPL_LINK( SfxCommonPrintOptionsTabPage, ClickReduceGradientsCBHdl, CheckBox*, p return 0; } -// ----------------------------------------------------------------------------- - IMPL_LINK( SfxCommonPrintOptionsTabPage, ClickReduceBitmapsCBHdl, CheckBox*, pBox ) { (void)pBox; //unused @@ -446,8 +409,6 @@ IMPL_LINK( SfxCommonPrintOptionsTabPage, ClickReduceBitmapsCBHdl, CheckBox*, pBo return 0; } -// ----------------------------------------------------------------------------- - IMPL_LINK( SfxCommonPrintOptionsTabPage, ToggleReduceGradientsStripesRBHdl, RadioButton*, pButton ) { (void)pButton; //unused @@ -458,8 +419,6 @@ IMPL_LINK( SfxCommonPrintOptionsTabPage, ToggleReduceGradientsStripesRBHdl, Radi return 0; } -// ----------------------------------------------------------------------------- - IMPL_LINK( SfxCommonPrintOptionsTabPage, ToggleReduceBitmapsResolutionRBHdl, RadioButton*, pButton ) { (void)pButton; //unused @@ -470,8 +429,6 @@ IMPL_LINK( SfxCommonPrintOptionsTabPage, ToggleReduceBitmapsResolutionRBHdl, Rad return 0; } -// ----------------------------------------------------------------------------- - IMPL_LINK( SfxCommonPrintOptionsTabPage, ToggleOutputPrinterRBHdl, RadioButton*, pButton ) { if( pButton->IsChecked() ) @@ -479,9 +436,8 @@ IMPL_LINK( SfxCommonPrintOptionsTabPage, ToggleOutputPrinterRBHdl, RadioButton*, aOutputGB.SetText( OutputDevice::GetNonMnemonicString( pButton->GetText() ) ); ImplUpdateControls( &maPrinterOptions ); bOutputForPrinter = TRUE; - // --> OD 2008-06-25 #i63982# + // #i63982# ImplSetAccessibleNames(); - // <-- } else ImplSaveControls( &maPrinterOptions ); @@ -489,8 +445,6 @@ IMPL_LINK( SfxCommonPrintOptionsTabPage, ToggleOutputPrinterRBHdl, RadioButton*, return 0; } -// ----------------------------------------------------------------------------- - IMPL_LINK( SfxCommonPrintOptionsTabPage, ToggleOutputPrintFileRBHdl, RadioButton*, pButton ) { if( pButton->IsChecked() ) @@ -498,9 +452,8 @@ IMPL_LINK( SfxCommonPrintOptionsTabPage, ToggleOutputPrintFileRBHdl, RadioButton aOutputGB.SetText( OutputDevice::GetNonMnemonicString( pButton->GetText() ) ); ImplUpdateControls( &maPrintFileOptions ); bOutputForPrinter = FALSE; - // --> OD 2008-06-25 #i63982# + // #i63982# ImplSetAccessibleNames(); - // <-- } else ImplSaveControls( &maPrintFileOptions ); @@ -508,10 +461,6 @@ IMPL_LINK( SfxCommonPrintOptionsTabPage, ToggleOutputPrintFileRBHdl, RadioButton return 0; } -// ------------------------------- -// - TransparencyPrintWarningBox - -// ------------------------------- - TransparencyPrintWarningBox::TransparencyPrintWarningBox( Window* pParent ) : ModalDialog( pParent, SfxResId( RID_WARN_PRINTTRANSPARENCY ) ), aWarnFI ( this, SfxResId( FI_PRINTTRANSWARN ) ), @@ -529,17 +478,15 @@ TransparencyPrintWarningBox::TransparencyPrintWarningBox( Window* pParent ) : aNoBtn.SetClickHdl( LINK( this, TransparencyPrintWarningBox, ClickNoBtn ) ); } -// ----------------------------------------------------------------------------- - TransparencyPrintWarningBox::~TransparencyPrintWarningBox() { } -// ----------------------------------------------------------------------------- - IMPL_LINK( TransparencyPrintWarningBox, ClickNoBtn, PushButton*, pButton ) { (void)pButton; //unused EndDialog( RET_NO ); return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/recfloat.cxx b/sfx2/source/dialog/recfloat.cxx index 4c9bd6a815..83ccbe8453 100644 --- a/sfx2/source/dialog/recfloat.cxx +++ b/sfx2/source/dialog/recfloat.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -128,7 +129,7 @@ static rtl::OUString GetLabelFromCommandURL( const rtl::OUString& rCommandURL, c { for ( sal_Int32 i = 0; i < aPropSeq.getLength(); i++ ) { - if ( aPropSeq[i].Name.equalsAscii( "Label" )) + if ( aPropSeq[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Label" ) )) { aPropSeq[i].Value >>= aLabel; break; @@ -278,3 +279,5 @@ IMPL_LINK( SfxRecordingFloat_Impl, Select, ToolBox*, pToolBar ) return 1; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/recfloat.src b/sfx2/source/dialog/recfloat.src index 0e55ac8170..0790accae7 100644 --- a/sfx2/source/dialog/recfloat.src +++ b/sfx2/source/dialog/recfloat.src @@ -30,7 +30,6 @@ // ----------------------------------------------------------------------- #define STD_MASKCOLOR Color { Red = 0xC000; Green = 0xC000; Blue = 0xC000; } -#define STD_HC_MASKCOLOR Color { Red = 0xFFFF ; Green = 0x0000 ; Blue = 0xFFFF ; } FloatingWindow SID_RECORDING_FLOATWINDOW { diff --git a/sfx2/source/dialog/sfxdlg.cxx b/sfx2/source/dialog/sfxdlg.cxx index 333c2b99e5..c9bc2c1f6b 100755 --- a/sfx2/source/dialog/sfxdlg.cxx +++ b/sfx2/source/dialog/sfxdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -42,3 +43,9 @@ SfxAbstractDialogFactory* SfxAbstractDialogFactory::Create() SfxAbstractDialogFactory::~SfxAbstractDialogFactory() { } + +SfxAbstractDialogFactory::~SfxAbstractDialogFactory() +{ +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/splitwin.cxx b/sfx2/source/dialog/splitwin.cxx index 2d5c98bd1b..f2f363394e 100644 --- a/sfx2/source/dialog/splitwin.cxx +++ b/sfx2/source/dialog/splitwin.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -35,7 +36,6 @@ #include <string> // HACK: prevent conflict between STLPORT and Workshop headers -#ifndef _WRKWIN_HXX //autogen #include <vcl/wrkwin.hxx> #endif #include <unotools/viewoptions.hxx> @@ -60,7 +60,7 @@ using namespace ::rtl; #define VERSION 1 #define nPixel 30L -#define USERITEM_NAME OUString::createFromAscii( "UserItem" ) +#define USERITEM_NAME OUString(RTL_CONSTASCII_USTRINGPARAM("UserItem")) struct SfxDock_Impl { @@ -618,6 +618,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize // Das Fenster mu\s vor dem ersten Fenster eingef"ugt werden, das die // gleiche oder eine gr"o\sere Position hat als pDockWin. USHORT nCount = pDockArr->Count(); + USHORT nLastWindowIdx(0); // Wenn gar kein Fenster gefunden wird, wird als erstes eingef"ugt USHORT nInsertPos = 0; @@ -631,6 +632,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize // Wenn kein geeignetes Fenster hinter der gew"unschten Einf"ugeposition // gefunden wird, wird am Ende eingef"ugt nInsertPos = nCount; + nLastWindowIdx = n; USHORT nL=0, nP=0; GetWindowPos( pD->pWin, nL, nP ); @@ -646,11 +648,15 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize pDock->bNewLine = TRUE; } - nInsertPos = n; + nInsertPos = n != 0 ? nLastWindowIdx + 1 : 0; // ignore all non-windows after the last window break; } } } + if (nCount != 0 && nInsertPos == nCount && nLastWindowIdx != nCount - 1) + { + nInsertPos = nLastWindowIdx + 1; // ignore all non-windows after the last window + } pDockArr->Insert(pDock, nInsertPos); InsertWindow_Impl( pDock, rSize, nLine, nPos, bNewLine ); @@ -1302,3 +1308,4 @@ void SfxSplitWindow::SetActiveWindow_Impl( SfxDockingWindow* pWin ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/srchdlg.cxx b/sfx2/source/dialog/srchdlg.cxx index a918580f5d..247bccbaf7 100644 --- a/sfx2/source/dialog/srchdlg.cxx +++ b/sfx2/source/dialog/srchdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -200,3 +201,4 @@ void SearchDialog::Move() // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/styfitem.cxx b/sfx2/source/dialog/styfitem.cxx index 6c5d9f9997..20b04f76f6 100644 --- a/sfx2/source/dialog/styfitem.cxx +++ b/sfx2/source/dialog/styfitem.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,9 +31,6 @@ // INCLUDE --------------------------------------------------------------- -#ifndef GCC -#endif - #include <sfx2/styfitem.hxx> #include <svtools/localresaccess.hxx> #include <tools/debug.hxx> @@ -65,7 +63,7 @@ SfxStyleFamilyItem::SfxStyleFamilyItem( const ResId &rResId ) : pTupel->aName = ReadStringRes(); long lFlags = ReadLongRes(); pTupel->nFlags = (USHORT)lFlags; - aFilterList.Insert(pTupel, LIST_APPEND); + aFilterList.push_back( pTupel ); } } if(nMask & RSC_SFX_STYLE_ITEM_BITMAP) @@ -102,12 +100,9 @@ SfxStyleFamilyItem::SfxStyleFamilyItem( const ResId &rResId ) : SfxStyleFamilyItem::~SfxStyleFamilyItem() { - SfxFilterTupel *pTupel = aFilterList.First(); - while(pTupel) - { - delete pTupel; - pTupel = aFilterList.Next(); - } + for ( size_t i = 0, n = aFilterList.size(); i < n; ++i ) + delete aFilterList[ i ]; + aFilterList.clear(); } // ----------------------------------------------------------------------- @@ -115,9 +110,7 @@ SfxStyleFamilyItem::~SfxStyleFamilyItem() // Implementierung des Resource-Konstruktors SfxStyleFamilies::SfxStyleFamilies( const ResId& rResId ) : - - Resource( rResId.SetRT( RSC_SFX_STYLE_FAMILIES ).SetAutoRelease( FALSE ) ), - aEntryList( 4, 1 ) + Resource( rResId.SetRT( RSC_SFX_STYLE_FAMILIES ).SetAutoRelease( FALSE ) ) { ULONG nCount = ReadLongRes(); for( ULONG i = 0; i < nCount; i++ ) @@ -125,12 +118,12 @@ SfxStyleFamilies::SfxStyleFamilies( const ResId& rResId ) : const ResId aResId((RSHEADER_TYPE *)GetClassRes(), *rResId.GetResMgr()); SfxStyleFamilyItem *pItem = new SfxStyleFamilyItem(aResId); IncrementRes( GetObjSizeRes( (RSHEADER_TYPE *)GetClassRes() ) ); - aEntryList.Insert(pItem, LIST_APPEND); + aEntryList.push_back( pItem ); } FreeResource(); - updateImages( rResId, BMP_COLOR_NORMAL ); + updateImages( rResId ); } // ----------------------------------------------------------------------- @@ -139,19 +132,15 @@ SfxStyleFamilies::SfxStyleFamilies( const ResId& rResId ) : SfxStyleFamilies::~SfxStyleFamilies() { - SfxStyleFamilyItem *pItem = aEntryList.First(); - - while(pItem) - { - delete pItem; - pItem = aEntryList.Next(); - } + for ( size_t i = 0, n = aEntryList.size(); i < n; ++i ) + delete aEntryList[ i ]; + aEntryList.clear(); } // ----------------------------------------------------------------------- -sal_Bool SfxStyleFamilies::updateImages( const ResId& _rId, const BmpColorMode _eMode ) +sal_Bool SfxStyleFamilies::updateImages( const ResId& _rId ) { sal_Bool bSuccess = sal_False; @@ -159,7 +148,7 @@ sal_Bool SfxStyleFamilies::updateImages( const ResId& _rId, const BmpColorMode _ ::svt::OLocalResourceAccess aLocalRes( _rId ); // check if the image list is present - ResId aImageListId( (sal_uInt16)_eMode + 1, *_rId.GetResMgr() ); + ResId aImageListId( (sal_uInt16) 1, *_rId.GetResMgr() ); aImageListId.SetRT( RSC_IMAGELIST ); if ( aLocalRes.IsAvailableRes( aImageListId ) ) @@ -168,14 +157,14 @@ sal_Bool SfxStyleFamilies::updateImages( const ResId& _rId, const BmpColorMode _ // number of styles items/images sal_uInt16 nCount = aImages.GetImageCount( ); - DBG_ASSERT( Count() == nCount, "SfxStyleFamilies::updateImages: found the image list, but missing some bitmaps!" ); - if ( nCount > Count() ) - nCount = Count(); + DBG_ASSERT( aEntryList.size() == nCount, "SfxStyleFamilies::updateImages: found the image list, but missing some bitmaps!" ); + if ( nCount > aEntryList.size() ) + nCount = aEntryList.size(); // set the images on the items - for ( sal_uInt16 i = 0; i < nCount; ++i ) + for ( size_t i = 0; i < nCount; ++i ) { - SfxStyleFamilyItem* pItem = static_cast< SfxStyleFamilyItem* >( aEntryList.GetObject( i ) ); + SfxStyleFamilyItem* pItem = aEntryList[ i ]; pItem->SetImage( aImages.GetImage( aImages.GetImageId( i ) ) ); } @@ -185,3 +174,5 @@ sal_Bool SfxStyleFamilies::updateImages( const ResId& _rId, const BmpColorMode _ return bSuccess; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/styledlg.cxx b/sfx2/source/dialog/styledlg.cxx index 9461951700..c6d9908415 100644 --- a/sfx2/source/dialog/styledlg.cxx +++ b/sfx2/source/dialog/styledlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -33,9 +34,6 @@ #include <svl/style.hxx> #ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> -#endif -#ifndef GCC -#endif #include <sfx2/styledlg.hxx> #include <sfx2/mgetempl.hxx> @@ -174,3 +172,4 @@ IMPL_LINK( SfxStyleDialog, CancelHdl, Button *, pButton ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index c1d250155f..af4ca80570 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -62,7 +63,7 @@ using namespace ::com::sun::star::uno; using namespace ::rtl; -#define USERITEM_NAME OUString::createFromAscii( "UserItem" ) +#define USERITEM_NAME OUString(RTL_CONSTASCII_USTRINGPARAM("UserItem")) TYPEINIT1(LAYOUT_NS_SFX_TABDIALOG SfxTabDialogItem,SfxSetItem); @@ -119,12 +120,12 @@ SfxTabDialogItem::SfxTabDialogItem( USHORT nId, const SfxItemSet& rItemSet ) { } -SfxPoolItem* __EXPORT SfxTabDialogItem::Clone(SfxItemPool* pToPool) const +SfxPoolItem* SfxTabDialogItem::Clone(SfxItemPool* pToPool) const { return new SfxTabDialogItem( *this, pToPool ); } -SfxPoolItem* __EXPORT SfxTabDialogItem::Create(SvStream& /*rStream*/, USHORT /*nVersion*/) const +SfxPoolItem* SfxTabDialogItem::Create(SvStream& /*rStream*/, USHORT /*nVersion*/) const { DBG_ERROR( "Use it only in UI!" ); return NULL; @@ -368,11 +369,6 @@ void SfxTabPage::FillUserData() // ----------------------------------------------------------------------- BOOL SfxTabPage::IsReadOnly() const - -/* [Description] - -*/ - { return FALSE; } @@ -448,12 +444,11 @@ const SfxPoolItem* SfxTabPage::GetExchangeItem( const SfxItemSet& rSet, return GetOldItem( rSet, nSlot ); } -// add CHINA001 begin + void SfxTabPage::PageCreated( SfxAllItemSet /*aSet*/ ) { DBG_ASSERT(0, "SfxTabPage::PageCreated should not be called"); -}//CHINA001 -// add CHINA001 end +} // ----------------------------------------------------------------------- @@ -1054,11 +1049,6 @@ SfxTabPage* SfxTabDialog::GetTabPage( USHORT nPageId ) const // ----------------------------------------------------------------------- BOOL SfxTabDialog::IsInOK() const - -/* [Beschreibung] - -*/ - { return pImpl->bInOK; } @@ -1761,7 +1751,7 @@ void SfxTabDialog::SetInputSet( const SfxItemSet* pInSet ) */ { - FASTBOOL bSet = ( pSet != NULL ); + bool bSet = ( pSet != NULL ); pSet = pInSet; @@ -1796,3 +1786,5 @@ long SfxTabDialog::Notify( NotifyEvent& rNEvt ) } END_NAMESPACE_LAYOUT_SFX_TABDIALOG + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/taskpane.src b/sfx2/source/dialog/taskpane.src deleted file mode 100644 index 4d1a991c0c..0000000000 --- a/sfx2/source/dialog/taskpane.src +++ /dev/null @@ -1,47 +0,0 @@ -/************************************************************************* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include <sfx2/sfx.hrc> -#include "sfxlocal.hrc" - -String STR_SFX_DOCK -{ - Text [ en-US ] = "Dock"; -}; - -String STR_SFX_UNDOCK -{ - Text [ en-US ] = "Undock"; -}; - -String STR_SFX_TASK_PANE_VIEW -{ - Text [ en-US ] = "View"; -}; -String STR_SFX_TASKS -{ - Text [ en-US ] = "Tasks"; -}; diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 9e4b488661..ebb29b98d1 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,7 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" -#ifndef _MENU_HXX //autogen #include <vcl/menu.hxx> #endif #include <svl/intitem.hxx> @@ -377,7 +377,7 @@ SfxActionListBox::SfxActionListBox( SfxCommonTemplateDialog_Impl* pParent, PopupMenu* SfxActionListBox::CreateContextMenu( void ) { - //added by BerryJia for fixing Bug102739 2002-9-9 17:00(Beijing Time) + if( !( GetSelectionCount() > 0 ) ) { pDialog->EnableEdit( FALSE ); @@ -830,7 +830,7 @@ SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, Mod USHORT SfxCommonTemplateDialog_Impl::StyleNrToInfoOffset(USHORT nId) { - const SfxStyleFamilyItem *pItem=pStyleFamilies->GetObject(nId); + const SfxStyleFamilyItem *pItem = pStyleFamilies->at( nId ); return SfxFamilyIdToNId(pItem->GetFamily())-1; } @@ -848,8 +848,8 @@ void SfxTemplateDialog_Impl::EnableEdit(BOOL bEnable) USHORT SfxCommonTemplateDialog_Impl::InfoOffsetToStyleNr(USHORT nId) { - for ( USHORT i=0;i<pStyleFamilies->Count();i++ ) - if ( SfxFamilyIdToNId(pStyleFamilies->GetObject(i)->GetFamily()) == nId+1 ) + for ( size_t i = 0; i < pStyleFamilies->size(); i++ ) + if ( SfxFamilyIdToNId(pStyleFamilies->at( i )->GetFamily()) == nId+1 ) return i; DBG_ERROR("Style Nummer nicht gefunden"); return 0; @@ -861,8 +861,7 @@ USHORT SfxCommonTemplateDialog_Impl::InfoOffsetToStyleNr(USHORT nId) void SfxCommonTemplateDialog_Impl::ReadResource() { // globale Benutzer-Resource auslesen - USHORT i; - for(i = 0; i < MAX_FAMILIES; ++i) + for(USHORT i = 0; i < MAX_FAMILIES; ++i) pFamilyState[i] = 0; SfxViewFrame* pViewFrame = pBindings->GetDispatcher_Impl()->GetFrame(); @@ -883,14 +882,15 @@ void SfxCommonTemplateDialog_Impl::ReadResource() // Einfuegen in die Toolbox // umgekehrte Reihenfolge, da immer vorne eingefuegt wird. - USHORT nCount = pStyleFamilies->Count(); + size_t nCount = pStyleFamilies->size(); pBindings->ENTERREGISTRATIONS(); + size_t i; for(i = 0; i < nCount; ++i) { USHORT nSlot = 0; - switch((USHORT)pStyleFamilies->GetObject(i)->GetFamily()) + switch( (USHORT)pStyleFamilies->at( i )->GetFamily() ) { case SFX_STYLE_FAMILY_CHAR: nSlot = SID_STYLE_FAMILY1; break; case SFX_STYLE_FAMILY_PARA: nSlot = SID_STYLE_FAMILY2; break; @@ -941,7 +941,7 @@ void SfxCommonTemplateDialog_Impl::ReadResource() for( ; nCount--; ) { - const SfxStyleFamilyItem *pItem = pStyleFamilies->GetObject( nCount ); + const SfxStyleFamilyItem *pItem = pStyleFamilies->at( nCount ); USHORT nId = SfxFamilyIdToNId( pItem->GetFamily() ); InsertFamilyItem( nId, pItem ); } @@ -1055,11 +1055,10 @@ void SfxCommonTemplateDialog_Impl::SetAutomaticFilter() // Hilfsfunktion: Zugriff auf aktuelles Family-Item const SfxStyleFamilyItem *SfxCommonTemplateDialog_Impl::GetFamilyItem_Impl() const { - const USHORT nCount = pStyleFamilies->Count(); - for(USHORT i = 0; i < nCount; ++i) + const size_t nCount = pStyleFamilies->size(); + for(size_t i = 0; i < nCount; ++i) { - const SfxStyleFamilyItem *pItem = pStyleFamilies->GetObject(i); -// if(!pItem)continue; + const SfxStyleFamilyItem *pItem = pStyleFamilies->at( i ); USHORT nId = SfxFamilyIdToNId(pItem->GetFamily()); if(nId == nActFamily) return pItem; @@ -1114,7 +1113,7 @@ void SfxCommonTemplateDialog_Impl::SelectStyle(const String &rStr) { aFmtLb.MakeVisible( pEntry ); aFmtLb.Select( pEntry ); - bWaterDisabled = !HasSelectedStyle(); //added by BerryJia for fixing Bug76391 2003-1-22 + bWaterDisabled = !HasSelectedStyle(); FmtSelectHdl( NULL ); } } @@ -1241,14 +1240,14 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(USHORT nFlags) // Flags { // Ist beim Vorlagenkatalog der Fall SfxTemplateItem **ppItem = pFamilyState; - const USHORT nFamilyCount = pStyleFamilies->Count(); - USHORT n; - for(n=0;n<nFamilyCount;n++) - if(ppItem[StyleNrToInfoOffset(n)])break; + const size_t nFamilyCount = pStyleFamilies->size(); + size_t n; + for( n = 0; n < nFamilyCount; n++ ) + if( ppItem[ StyleNrToInfoOffset(n) ] ) break; if ( n == nFamilyCount ) // passiert gelegentlich bei Beichten, Formularen etc.; weiss der Teufel warum return; - ppItem+=StyleNrToInfoOffset(n); + ppItem += StyleNrToInfoOffset(n); nAppFilter = (*ppItem)->GetValue(); FamilySelect( StyleNrToInfoOffset(n)+1 ); pItem = GetFamilyItem_Impl(); @@ -1256,8 +1255,8 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(USHORT nFlags) // Flags const SfxStyleFamily eFam = pItem->GetFamily(); - SfxFilterTupel *pT = pItem->GetFilterList().GetObject(nActFilter); - USHORT nFilter = pT ? pItem->GetFilterList().GetObject(nActFilter)->nFlags : 0; + SfxFilterTupel* pT = ( nActFilter < pItem->GetFilterList().size() ? pItem->GetFilterList()[nActFilter] : NULL ); + USHORT nFilter = pT ? pT->nFlags : 0; if(!nFilter) // automatisch nFilter = nAppFilter; @@ -1275,10 +1274,10 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(USHORT nFlags) // Flags USHORT nPos = aFilterLb.InsertEntry(String(SfxResId(STR_STYLE_FILTER_HIERARCHICAL)), 0); aFilterLb.SetEntryData( nPos, (void*)(ULONG)SFXSTYLEBIT_ALL ); const SfxStyleFilter& rFilter = pItem->GetFilterList(); - for(USHORT i = 0; i < rFilter.Count(); ++i) + for( size_t i = 0; i < rFilter.size(); ++i) { - ULONG nFilterFlags = rFilter.GetObject(i)->nFlags; - nPos = aFilterLb.InsertEntry( rFilter.GetObject(i)->aName ); + ULONG nFilterFlags = rFilter[ i ]->nFlags; + nPos = aFilterLb.InsertEntry( rFilter[ i ]->aName ); aFilterLb.SetEntryData( nPos, (void*)nFilterFlags ); } if(nActFilter < aFilterLb.GetEntryCount() - 1) @@ -1287,8 +1286,8 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(USHORT nFlags) // Flags { nActFilter = 0; aFilterLb.SelectEntryPos(1); - SfxFilterTupel *pActT = rFilter.GetObject(nActFilter); - USHORT nFilterFlags = pActT ? rFilter.GetObject(nActFilter)->nFlags : 0; + SfxFilterTupel* pActT = ( nActFilter < rFilter.size() ) ? rFilter[ nActFilter ] : NULL; + USHORT nFilterFlags = pActT ? pActT->nFlags : 0; pStyleSheetPool->SetSearchMask(eFam, nFilterFlags); } @@ -1313,7 +1312,6 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(USHORT nFlags) // Flags if(nFlags & UPDATE_FAMILY_LIST) { -// EnableEdit(FALSE); EnableItem(SID_STYLE_WATERCAN,FALSE); SfxStyleSheetBase *pStyle = pStyleSheetPool->First(); @@ -1376,7 +1374,7 @@ void SfxCommonTemplateDialog_Impl::SetWaterCanState(const SfxBoolItem *pItem) { // EnableItem(SID_STYLE_WATERCAN, pItem != 0); bWaterDisabled = pItem == 0; -//added by BerryJia for fixing Bug76391 2003-1-7 + if(!bWaterDisabled) bWaterDisabled = !HasSelectedStyle(); @@ -1393,9 +1391,9 @@ void SfxCommonTemplateDialog_Impl::SetWaterCanState(const SfxBoolItem *pItem) //Waehrend Giesskannenmodus Statusupdates ignorieren. - USHORT nCount=pStyleFamilies->Count(); + size_t nCount = pStyleFamilies->size(); pBindings->EnterRegistrations(); - for(USHORT n=0; n<nCount; n++) + for(size_t n = 0; n < nCount; n++) { SfxControllerItem *pCItem=pBoundItems[n]; BOOL bChecked = pItem && pItem->GetValue(); @@ -1462,7 +1460,6 @@ void SfxCommonTemplateDialog_Impl::Update_Impl() pStyleSheetPool = pNewPool; bDocChanged=TRUE; } -// InvalidateBindings(); } if (bUpdateFamily) @@ -1483,10 +1480,10 @@ void SfxCommonTemplateDialog_Impl::Update_Impl() { CheckItem(nActFamily, FALSE); SfxTemplateItem **ppItem = pFamilyState; - const USHORT nFamilyCount = pStyleFamilies->Count(); - USHORT n; - for(n=0;n<nFamilyCount;n++) - if(ppItem[StyleNrToInfoOffset(n)])break; + const size_t nFamilyCount = pStyleFamilies->size(); + size_t n; + for( n = 0; n < nFamilyCount; n++ ) + if( ppItem[ StyleNrToInfoOffset(n) ] ) break; ppItem+=StyleNrToInfoOffset(n); nAppFilter = (*ppItem)->GetValue(); @@ -1517,9 +1514,9 @@ void SfxCommonTemplateDialog_Impl::Update_Impl() const SfxStyleFamilyItem *pStyleItem = GetFamilyItem_Impl(); #if OSL_DEBUG_LEVEL > 1 SfxFilterTupel *pT; - pT = pStyleItem->GetFilterList().GetObject(nActFilter); + pT = pStyleItem->GetFilterList()[ nActFilter ]; #endif - if(0 == pStyleItem->GetFilterList().GetObject(nActFilter)->nFlags + if ( 0 == pStyleItem->GetFilterList()[ nActFilter ]->nFlags && nAppFilter != pItem->GetValue()) { nAppFilter = pItem->GetValue(); @@ -1739,18 +1736,17 @@ BOOL SfxCommonTemplateDialog_Impl::Execute_Impl( if(!nFilterFlags) // Benutzervorlage? nFilterFlags = pFilterItem->GetValue(); const SfxStyleFamilyItem *pFamilyItem = GetFamilyItem_Impl(); - const USHORT nFilterCount = (USHORT) pFamilyItem->GetFilterList().Count(); + const size_t nFilterCount = pFamilyItem->GetFilterList().size(); - for ( USHORT i = 0; i < nFilterCount; ++i ) + for ( size_t i = 0; i < nFilterCount; ++i ) { - const SfxFilterTupel *pTupel = - pFamilyItem->GetFilterList().GetObject(i); + const SfxFilterTupel *pTupel = pFamilyItem->GetFilterList()[ i ]; if ( ( pTupel->nFlags & nFilterFlags ) == nFilterFlags && pIdx ) *pIdx = i; } } - + // Reset destroyed flag otherwise we use the pointer in the dtor // where the local stack object is already destroyed. This would // overwrite objects on the stack!! See #i100110 @@ -1805,7 +1801,6 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, FilterSelectHdl, ListBox *, pBox ) // minus one since hierarchical is inserted at the start FilterSelect(pBox->GetSelectEntryPos() - 1, bHierarchical ); bHierarchical=FALSE; -// UpdateStyles_Impl(UPDATE_FAMILY_LIST); // Anzeige aktualisieren } return 0; @@ -1866,13 +1861,11 @@ void SfxCommonTemplateDialog_Impl::ActionSelect(USHORT nEntry) if(pStyleSheetPool && nActFamily != 0xffff) { const SfxStyleFamily eFam=GetFamilyItem_Impl()->GetFamily(); -//pStyleSheetPool->GetSearchFamily(); const SfxStyleFamilyItem *pItem = GetFamilyItem_Impl(); USHORT nFilter; - if(pItem&&nActFilter!=0xffff) + if( pItem && nActFilter != 0xffff ) { - nFilter = pItem->GetFilterList().GetObject( - nActFilter)->nFlags; + nFilter = pItem->GetFilterList()[ nActFilter ]->nFlags; if(!nFilter) // automatisch nFilter = nAppFilter; } @@ -1880,9 +1873,8 @@ void SfxCommonTemplateDialog_Impl::ActionSelect(USHORT nEntry) nFilter=pStyleSheetPool->GetSearchMask(); pStyleSheetPool->SetSearchMask( eFam, SFXSTYLEBIT_USERDEF ); - SfxNewStyleDlg *pDlg = + SfxNewStyleDlg *pDlg = new SfxNewStyleDlg(pWindow, *pStyleSheetPool); // why? : FloatingWindow must not be parent of a modal dialog - new SfxNewStyleDlg(pWindow, *pStyleSheetPool); if(RET_OK == pDlg->Execute()) { pStyleSheetPool->SetSearchMask(eFam, nFilter); @@ -2001,10 +1993,9 @@ void SfxCommonTemplateDialog_Impl::NewHdl(void *) const SfxStyleFamilyItem *pItem = GetFamilyItem_Impl(); const SfxStyleFamily eFam=pItem->GetFamily(); USHORT nMask; - if(pItem&&nActFilter!=0xffff) + if( pItem && nActFilter != 0xffff ) { - nMask = pItem->GetFilterList().GetObject( - nActFilter)->nFlags; + nMask = pItem->GetFilterList()[ nActFilter ]->nFlags; if(!nMask) // automatisch nMask = nAppFilter; } @@ -2020,27 +2011,6 @@ void SfxCommonTemplateDialog_Impl::NewHdl(void *) Application::SetDefDialogParent( pTmp ); -/* { - DBG_ASSERT(nFilter < aFilterLb.GetEntryCount(), - "Filter ueberindiziert"); - - if(!pTreeBox) - { -// aFilterLb.SelectEntryPos(nFilter); - FilterSelect(nActFilter, TRUE); - } - else - { - FillTreeBox(); - SfxTemplateItem *pState = pFamilyState[nActFamily-1]; - if(pState) - { - const String aStyle(pState->GetStyleName()); - SelectStyle(aStyle); - } - EnableDelete(); - }*/ -// } } } @@ -2067,16 +2037,6 @@ void SfxCommonTemplateDialog_Impl::EditHdl(void *) if ( Execute_Impl( SID_STYLE_EDIT, aTemplName, String(), (USHORT)GetFamilyItem_Impl()->GetFamily(), 0, &nFilter ) ) { -// DBG_ASSERT(nFilter < aFilterLb.GetEntryCount(), "Filter ueberindiziert"); -// aTemplName = pStyle->GetName(); -// kann durch Bearbeiten umbenannt worden sein -/* if(!pTreeBox) - { - // aFilterLb.SelectEntryPos(nFilter); - // FilterSelect(nFilter, TRUE); - } - else - FillTreeBox();*/ } Application::SetDefDialogParent( pTmp ); } @@ -2137,13 +2097,13 @@ void SfxCommonTemplateDialog_Impl::EnableDelete() const SfxStyleFamilyItem *pItem = GetFamilyItem_Impl(); const SfxStyleFamily eFam = pItem->GetFamily(); USHORT nFilter = 0; - if(pItem->GetFilterList().Count() > nActFilter) - nFilter = pItem->GetFilterList().GetObject(nActFilter)->nFlags; + if(pItem->GetFilterList().size() > nActFilter) + nFilter = pItem->GetFilterList()[ nActFilter ]->nFlags; if(!nFilter) // automatisch nFilter = nAppFilter; const SfxStyleSheetBase *pStyle = - pStyleSheetPool->Find(aTemplName,eFam, - pTreeBox? SFXSTYLEBIT_ALL: nFilter); + pStyleSheetPool->Find(aTemplName,eFam, pTreeBox? SFXSTYLEBIT_ALL: nFilter); + DBG_ASSERT(pStyle, "Style nicht gefunden"); if(pStyle && pStyle->IsUserDefined()) { @@ -2158,8 +2118,6 @@ void SfxCommonTemplateDialog_Impl::EnableDelete() { EnableDel(FALSE); } -// rBindings.Invalidate( SID_STYLE_DELETE ); -// rBindings.Update( SID_STYLE_DELETE ); } //------------------------------------------------------------------------- @@ -2221,7 +2179,6 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, FmtSelectHdl, SvTreeListBox *, pListBox GetSelectedEntry(), aEmpty, ( USHORT )GetFamilyItem_Impl()->GetFamily()); } -// EnableEdit(TRUE); EnableItem(SID_STYLE_WATERCAN, !bWaterDisabled); EnableDelete(); } @@ -2378,14 +2335,13 @@ void SfxTemplateDialog_Impl::updateFamilyImages() return; // let the families collection update the images - sal_Bool bIsHighContrast = m_pFloat->GetSettings().GetStyleSettings().GetHighContrastMode(); - pStyleFamilies->updateImages( *m_pStyleFamiliesId, bIsHighContrast ? BMP_COLOR_HIGHCONTRAST : BMP_COLOR_NORMAL ); + pStyleFamilies->updateImages( *m_pStyleFamiliesId ); // and set the new images on our toolbox - USHORT nLoop = pStyleFamilies->Count(); + size_t nLoop = pStyleFamilies->size(); for( ; nLoop--; ) { - const SfxStyleFamilyItem *pItem = pStyleFamilies->GetObject( nLoop ); + const SfxStyleFamilyItem *pItem = pStyleFamilies->at( nLoop ); USHORT nId = SfxFamilyIdToNId( pItem->GetFamily() ); m_aActionTbL.SetItemImage( nId, pItem->GetImage() ); } @@ -2394,9 +2350,7 @@ void SfxTemplateDialog_Impl::updateFamilyImages() // ------------------------------------------------------------------------ void SfxTemplateDialog_Impl::updateNonFamilyImages() { - m_aActionTbR.SetImageList( ImageList( SfxResId( - m_pFloat->GetSettings().GetStyleSettings().GetHighContrastMode() ? IMG_LST_STYLE_DESIGNER_HC - : DLG_STYLE_DESIGNER ) ) ); + m_aActionTbR.SetImageList( ImageList( SfxResId( DLG_STYLE_DESIGNER ) ) ); } // ------------------------------------------------------------------------ @@ -2426,14 +2380,6 @@ void SfxCommonTemplateDialog_Impl::InvalidateBindings() SfxTemplateDialog_Impl::~SfxTemplateDialog_Impl() { -/* - SfxImageManager* pImgMgr = pBindings->GetImageManager(); - if ( pImgMgr ) - { - pImgMgr->ReleaseToolBox( &m_aActionTbL ); - pImgMgr->ReleaseToolBox( &m_aActionTbR ); - } -*/ } //------------------------------------------------------------------------- @@ -2453,10 +2399,6 @@ void SfxTemplateDialog_Impl::Resize() FloatingWindow *pF = m_pFloat->GetFloatingWindow(); if ( pF ) { -// if(pF->IsZoomedIn() && m_bZoomIn==FALSE) -// pF->SetText(String(SfxResId( DLG_STYLE_DESIGNER ))); -// if(!pF->IsZoomedIn() && m_bZoomIn==TRUE && GetFamilyItem_Impl()) -// UpdateStyles_Impl(UPDATE_FAMILY); //Bereich wieder in Titel schreiben m_bZoomIn = pF->IsRollUp(); if ( m_bZoomIn ) return; @@ -2607,7 +2549,7 @@ IMPL_LINK_INLINE_END( SfxTemplateDialog_Impl, ToolBoxLSelect, ToolBox *, pBox ) { for( sal_Int32 i = 0; i < aPropSeq.getLength(); i++ ) { - if ( aPropSeq[i].Name.equalsAscii( "Label" )) + if ( aPropSeq[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Label" ) )) { aPropSeq[i].Value >>= sRet; break; @@ -2637,12 +2579,12 @@ IMPL_LINK( SfxTemplateDialog_Impl, ToolBoxRClick, ToolBox *, pBox ) PopupMenu *pMenu = new PopupMenu; uno::Reference< container::XNameAccess > xNameAccess( ::comphelper::getProcessServiceFactory()-> - createInstance( ::rtl::OUString::createFromAscii( - "com.sun.star.frame.UICommandDescription") ), uno::UNO_QUERY ); + createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.frame.UICommandDescription")) ), uno::UNO_QUERY ); uno::Reference< container::XNameAccess > xUICommands; if ( xNameAccess.is() ) { - rtl::OUString sTextDoc = ::rtl::OUString::createFromAscii("com.sun.star.text.TextDocument"); + rtl::OUString sTextDoc(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextDocument")); if(xNameAccess->hasByName(sTextDoc)) { uno::Any a = xNameAccess->getByName( sTextDoc ); @@ -2654,18 +2596,18 @@ IMPL_LINK( SfxTemplateDialog_Impl, ToolBoxRClick, ToolBox *, pBox ) try { uno::Sequence< beans::PropertyValue > aPropSeq; - uno::Any aCommand = xUICommands->getByName(::rtl::OUString::createFromAscii(".uno:StyleNewByExample")); + uno::Any aCommand = xUICommands->getByName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:StyleNewByExample"))); ::rtl::OUString sLabel = lcl_GetLabel( aCommand ); pMenu->InsertItem( SID_STYLE_NEW_BY_EXAMPLE, sLabel ); pMenu->SetHelpId(SID_STYLE_NEW_BY_EXAMPLE, HID_TEMPLDLG_NEWBYEXAMPLE); - aCommand = xUICommands->getByName(::rtl::OUString::createFromAscii(".uno:StyleUpdateByExample")); + aCommand = xUICommands->getByName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:StyleUpdateByExample"))); sLabel = lcl_GetLabel( aCommand ); pMenu->InsertItem( SID_STYLE_UPDATE_BY_EXAMPLE, sLabel ); pMenu->SetHelpId(SID_STYLE_UPDATE_BY_EXAMPLE, HID_TEMPLDLG_UPDATEBYEXAMPLE); - aCommand = xUICommands->getByName(::rtl::OUString::createFromAscii(".uno:LoadStyles")); + aCommand = xUICommands->getByName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:LoadStyles"))); sLabel = lcl_GetLabel( aCommand ); pMenu->InsertItem( SID_TEMPLATE_LOAD, sLabel ); pMenu->SetHelpId(SID_TEMPLATE_LOAD, ".uno:LoadStyles"); @@ -2846,13 +2788,6 @@ void SfxTemplateCatalog_Impl::EnableItem( USHORT nMesId, BOOL bCheck ) aOkBtn.Enable( bCheck ); if ( nMesId > SFX_STYLE_FAMILY_PSEUDO || nMesId < SFX_STYLE_FAMILY_CHAR ) return; - -/* for(USHORT i=0;i<aFamIds.Count&&aFamIds[i]!=nMesId;i++); - if(i!=aFamIds.Count()) - aFamList.SelectEntry(aFamIds[i]); - else - DBG_ERROR("Entry nicht gefunden");*/ - } //------------------------------------------------------------------------- @@ -2992,24 +2927,17 @@ void SfxTemplateDialog::StateChanged( StateChangedType nStateChange ) SfxDockingWindow::StateChanged( nStateChange ); } -/*-- 10.12.2003 11:44:35--------------------------------------------------- - - -----------------------------------------------------------------------*/ DropToolBox_Impl::DropToolBox_Impl(Window* pParent, SfxTemplateDialog_Impl* pTemplateDialog) : ToolBox(pParent), DropTargetHelper(this), rParent(*pTemplateDialog) { } -/*-- 10.12.2003 11:44:35--------------------------------------------------- - -----------------------------------------------------------------------*/ DropToolBox_Impl::~DropToolBox_Impl() { } -/*-- 10.12.2003 11:44:35--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Int8 DropToolBox_Impl::AcceptDrop( const AcceptDropEvent& rEvt ) { sal_Int8 nReturn = DND_ACTION_NONE; @@ -3029,11 +2957,10 @@ sal_Int8 DropToolBox_Impl::AcceptDrop( const AcceptDropEvent& rEvt ) } return nReturn; } -/*-- 10.12.2003 11:44:35--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Int8 DropToolBox_Impl::ExecuteDrop( const ExecuteDropEvent& rEvt ) { return rParent.aFmtLb.ExecuteDrop(rEvt); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/templdlg.src b/sfx2/source/dialog/templdlg.src index 31cf999d37..477e121b10 100644 --- a/sfx2/source/dialog/templdlg.src +++ b/sfx2/source/dialog/templdlg.src @@ -42,18 +42,7 @@ ImageList DLG_STYLE_DESIGNER }; IdCount = { 3 ; }; }; -ImageList IMG_LST_STYLE_DESIGNER_HC -{ - Prefix = "sch"; - MaskColor = Color { Red = 0xFFFF ; Green = 0x0000 ; Blue = 0xFFFF ; }; - IdList = - { - SID_STYLE_WATERCAN ; - SID_STYLE_NEW_BY_EXAMPLE ; - SID_STYLE_UPDATE_BY_EXAMPLE ; - }; - IdCount = { 3 ; }; -}; + // RID_STYLECATALOG ------------------------------------------------------ ModalDialog RID_STYLECATALOG { @@ -142,11 +131,13 @@ ModalDialog RID_STYLECATALOG DropDown = TRUE ; }; }; + // Strings --------------------------------------------------------------- String STR_STYLE_FILTER_HIERARCHICAL { Text [ en-US ] = "Hierarchical" ; }; + // DLG_STYLE_DESIGNER ---------------------------------------------------- DockingWindow DLG_STYLE_DESIGNER { diff --git a/sfx2/source/dialog/titledockwin.src b/sfx2/source/dialog/titledockwin.src deleted file mode 100644 index 4abd7184a8..0000000000 --- a/sfx2/source/dialog/titledockwin.src +++ /dev/null @@ -1,39 +0,0 @@ -/************************************************************************* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include <sfx2/sfx.hrc> -#include "sfxlocal.hrc" - -Image SFX_IMG_CLOSE_DOC -{ - ImageBitmap = Bitmap { File = "closedoc.png" ; }; -}; - -Image SFX_IMG_CLOSE_DOC_HC -{ - ImageBitmap = Bitmap { File = "closedochc.png" ; }; -}; - diff --git a/sfx2/source/dialog/tplcitem.cxx b/sfx2/source/dialog/tplcitem.cxx index 3985cb2126..d712897e47 100644 --- a/sfx2/source/dialog/tplcitem.cxx +++ b/sfx2/source/dialog/tplcitem.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -79,7 +80,7 @@ void SfxTemplateControllerItem::StateChanged( USHORT nSID, SfxItemState eState, case SID_STYLE_FAMILY4: case SID_STYLE_FAMILY5: { - FASTBOOL bAvailable = SFX_ITEM_AVAILABLE == eState; + bool bAvailable = SFX_ITEM_AVAILABLE == eState; if ( !bAvailable ) rTemplateDlg.SetFamilyState(GetId(), 0); else { @@ -163,9 +164,7 @@ void SfxTemplateControllerItem::StateChanged( USHORT nSID, SfxItemState eState, } } } -/* -----------------------------05.09.2001 10:48------------------------------ - ---------------------------------------------------------------------------*/ IMPL_STATIC_LINK(SfxTemplateControllerItem, SetWaterCanStateHdl_Impl, SfxTemplateControllerItem*, EMPTYARG) { @@ -183,3 +182,4 @@ IMPL_STATIC_LINK(SfxTemplateControllerItem, SetWaterCanStateHdl_Impl, return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/tplpitem.cxx b/sfx2/source/dialog/tplpitem.cxx index b283dac807..fcb9d6ee7f 100644 --- a/sfx2/source/dialog/tplpitem.cxx +++ b/sfx2/source/dialog/tplpitem.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -84,19 +85,19 @@ SfxPoolItem* SfxTemplateItem::Clone( SfxItemPool *) const } //------------------------------------------------------------------------- -sal_Bool SfxTemplateItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE /*nMemberId*/ ) const +bool SfxTemplateItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE /*nMemberId*/ ) const { ::com::sun::star::frame::status::Template aTemplate; - + aTemplate.Value = GetValue(); aTemplate.StyleName = aStyle; rVal <<= aTemplate; - return sal_True; + return true; } //------------------------------------------------------------------------- -sal_Bool SfxTemplateItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE /*nMemberId*/ ) +bool SfxTemplateItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE /*nMemberId*/ ) { ::com::sun::star::frame::status::Template aTemplate; @@ -104,10 +105,10 @@ sal_Bool SfxTemplateItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE / { SetValue( sal::static_int_cast< USHORT >( aTemplate.Value ) ); aStyle = aTemplate.StyleName; - return sal_True; + return true; } - - return sal_False; + + return false; } //------------------------------------------------------------------------- @@ -118,3 +119,4 @@ BYTE SfxTemplateItem::GetFlagCount() const } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx index fa20b7dbb1..9ae9c09e76 100644 --- a/sfx2/source/dialog/versdlg.cxx +++ b/sfx2/source/dialog/versdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,7 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" #include <unotools/localedatawrapper.hxx> -#ifndef _UNOTOOLS_PROCESSFACTORY_HXX #include <comphelper/processfactory.hxx> #endif #include <svl/eitem.hxx> @@ -54,8 +54,10 @@ #include <sfx2/request.hxx> #include <sfx2/sfxuno.hxx> +#include <vector> using namespace com::sun::star; +using ::std::vector; // ************************************************************************** struct SfxVersionInfo @@ -78,16 +80,15 @@ struct SfxVersionInfo return *this; } }; -DECLARE_LIST( _SfxVersionTable, SfxVersionInfo* ) -class SfxVersionTableDtor : public _SfxVersionTable + +typedef vector< SfxVersionInfo* > _SfxVersionTable; + +class SfxVersionTableDtor { +private: + _SfxVersionTable aTableList; public: - SfxVersionTableDtor( const sal_uInt16 nInitSz=0, const sal_uInt16 nReSz=1 ) - : _SfxVersionTable( nInitSz, nReSz ) - {} - - SfxVersionTableDtor( const SfxVersionTableDtor &rCpy ) : - _SfxVersionTable( rCpy ) + SfxVersionTableDtor( const SfxVersionTableDtor &rCpy ) { *this = rCpy; } SfxVersionTableDtor( const uno::Sequence < util::RevisionTag >& rInfo ); @@ -100,6 +101,12 @@ public: SvStream& Read( SvStream & ); SvStream& Write( SvStream & ) const; SvStringsDtor* GetVersions() const; + + size_t size() const + { return aTableList.size(); } + + SfxVersionInfo* at( size_t i ) const + { return aTableList[ i ]; } }; SfxVersionTableDtor::SfxVersionTableDtor( const uno::Sequence < util::RevisionTag >& rInfo ) @@ -111,34 +118,28 @@ SfxVersionTableDtor::SfxVersionTableDtor( const uno::Sequence < util::RevisionTa pInfo->aComment = rInfo[n].Comment; pInfo->aAuthor = rInfo[n].Author; - Date aDate ( rInfo[n].TimeStamp.Day, rInfo[n].TimeStamp.Month, rInfo[n].TimeStamp.Year ); + Date aDate ( rInfo[n].TimeStamp.Day, rInfo[n].TimeStamp.Month, rInfo[n].TimeStamp.Year ); Time aTime ( rInfo[n].TimeStamp.Hours, rInfo[n].TimeStamp.Minutes, rInfo[n].TimeStamp.Seconds, rInfo[n].TimeStamp.HundredthSeconds ); pInfo->aCreationDate = DateTime( aDate, aTime ); - Insert( pInfo, Count() ); + aTableList.push_back( pInfo ); } } void SfxVersionTableDtor::DelDtor() { - SfxVersionInfo* pTmp = First(); - while( pTmp ) - { - delete pTmp; - pTmp = Next(); - } - Clear(); + for ( size_t i = 0, n = aTableList.size(); i < n; ++i ) + delete aTableList[ i ]; + aTableList.clear(); } SfxVersionTableDtor& SfxVersionTableDtor::operator=( const SfxVersionTableDtor& rTbl ) { DelDtor(); - SfxVersionInfo* pTmp = ((SfxVersionTableDtor&)rTbl).First(); - while( pTmp ) + for ( size_t i = 0, n = rTbl.size(); i < n; ++i ) { - SfxVersionInfo *pNew = new SfxVersionInfo( *pTmp ); - Insert( pNew, LIST_APPEND ); - pTmp = ((SfxVersionTableDtor&)rTbl).Next(); + SfxVersionInfo* pNew = new SfxVersionInfo( *(rTbl.at( i )) ); + aTableList.push_back( pNew ); } return *this; } @@ -162,17 +163,16 @@ static String ConvertDateTime_Impl(const DateTime& rTime, const LocaleDataWrappe SvStringsDtor* SfxVersionTableDtor::GetVersions() const { SvStringsDtor *pList = new SvStringsDtor; - SfxVersionInfo* pInfo = ((SfxVersionTableDtor*) this)->First(); LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() ); - while ( pInfo ) + + for ( size_t i = 0, n = aTableList.size(); i < n; ++i ) { + SfxVersionInfo* pInfo = aTableList[ i ]; String *pString = new String( pInfo->aComment ); (*pString) += DEFINE_CONST_UNICODE( "; " ); (*pString) += ConvertDateTime_Impl( pInfo->aCreationDate, aLocaleWrapper ); pList->Insert( pString, pList->Count() ); - pInfo = ((SfxVersionTableDtor*) this)->Next(); } - return pList; } @@ -285,9 +285,9 @@ void SfxVersionDialog::Init_Impl() delete mpTable; mpTable = new SfxVersionTableDtor( aVersions ); { - for ( USHORT n = 0; n < mpTable->Count(); ++n ) + for ( size_t n = 0; n < mpTable->size(); ++n ) { - SfxVersionInfo *pInfo = mpTable->GetObject(n); + SfxVersionInfo *pInfo = mpTable->at( n ); String aEntry = ConvertDateTime_Impl( pInfo->aCreationDate, *mpLocaleWrapper ); aEntry += '\t'; aEntry += pInfo->aAuthor; @@ -517,3 +517,4 @@ IMPL_LINK( SfxViewVersionDialog_Impl, ButtonHdl, Button*, pButton ) return 0L; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx index 5336b5cfe5..aaa74e1c23 100644 --- a/sfx2/source/doc/DocumentMetadataAccess.cxx +++ b/sfx2/source/doc/DocumentMetadataAccess.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -160,8 +161,8 @@ uno::Reference<rdf::XURI> createBaseURI( i_xContext->getServiceManager(), uno::UNO_SET_THROW); const uno::Reference<uri::XUriReferenceFactory> xUriFactory( xServiceFactory->createInstanceWithContext( - ::rtl::OUString::createFromAscii( - "com.sun.star.uri.UriReferenceFactory"), i_xContext), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.uri.UriReferenceFactory")), i_xContext), uno::UNO_QUERY_THROW); uno::Reference< uri::XUriReference > xBaseURI; @@ -174,17 +175,6 @@ uno::Reference<rdf::XURI> createBaseURI( // if ( pkgURI.getLength() && ::utl::UCBContentHelper::IsFolder(pkgURI) ) if (true) { xBaseURI.set( xPkgURI, uno::UNO_SET_THROW ); -#if 0 - } else { - const uno::Reference<uri::XVndSunStarPkgUrlReferenceFactory> - xPkgUriFactory( xServiceFactory->createInstanceWithContext( - ::rtl::OUString::createFromAscii( - "com.sun.star.uri.VndSunStarPkgUrlReferenceFactory"), - i_xContext), - uno::UNO_QUERY_THROW); - xBaseURI.set( xPkgUriFactory->createVndSunStarPkgUrlReference(xPkgURI), - uno::UNO_SET_THROW ); -#endif } ::rtl::OUStringBuffer buf; if (!xBaseURI->getUriReference().endsWithAsciiL("/", 1)) @@ -260,8 +250,8 @@ static bool isFileNameValid(const ::rtl::OUString & i_rFileName) const ::rtl::OUString segment( i_rFileName.getToken(0, static_cast<sal_Unicode> ('/'), idx) ); if (!segment.getLength() || // no empty segments - segment.equalsAscii(".") || // no . segments - segment.equalsAscii("..") || // no .. segments + segment.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(".")) || // no . segments + segment.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("..")) || // no .. segments !::comphelper::OStorageHelper::IsValidZipEntryFileName( segment, sal_False)) // no invalid characters return false; @@ -345,8 +335,8 @@ addFile(struct DocumentMetadataAccess_Impl & i_rImpl, throw; } catch (uno::Exception & e) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString::createFromAscii( - "addFile: exception"), /*this*/0, uno::makeAny(e)); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "addFile: exception")), /*this*/0, uno::makeAny(e)); } } @@ -394,7 +384,7 @@ removeFile(struct DocumentMetadataAccess_Impl & i_rImpl, throw; } catch (uno::Exception & e) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString::createFromAscii("removeFile: exception"), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("removeFile: exception")), 0, uno::makeAny(e)); } } @@ -423,7 +413,7 @@ getAllParts(struct DocumentMetadataAccess_Impl & i_rImpl) throw; } catch (uno::Exception & e) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString::createFromAscii("getAllParts: exception"), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("getAllParts: exception")), 0, uno::makeAny(e)); } } @@ -445,7 +435,7 @@ isPartOfType(struct DocumentMetadataAccess_Impl & i_rImpl, throw; } catch (uno::Exception & e) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString::createFromAscii("isPartOfType: exception"), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("isPartOfType: exception")), 0, uno::makeAny(e)); } } @@ -462,10 +452,10 @@ mkException( ::rtl::OUString const & i_rMessage, iaioe.Classification = task::InteractionClassification_ERROR; iaioe.Code = i_ErrorCode; - const beans::PropertyValue uriProp(::rtl::OUString::createFromAscii("Uri"), + const beans::PropertyValue uriProp(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Uri")), -1, uno::makeAny(i_rUri), static_cast<beans::PropertyState>(0)); const beans::PropertyValue rnProp( - ::rtl::OUString::createFromAscii("ResourceName"), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ResourceName")), -1, uno::makeAny(i_rResource), static_cast<beans::PropertyState>(0)); iaioe.Arguments = ::comphelper::makeSequence( uno::makeAny(uriProp), uno::makeAny(rnProp)); @@ -485,8 +475,8 @@ handleError( ucb::InteractiveAugmentedIOException const & i_rException, const uno::Reference<task::XInteractionHandler> & i_xHandler) { if (!i_xHandler.is()) { - throw lang::WrappedTargetException(::rtl::OUString::createFromAscii( - "DocumentMetadataAccess::loadMetadataFromStorage: exception"), + throw lang::WrappedTargetException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "DocumentMetadataAccess::loadMetadataFromStorage: exception")), /* *this*/ 0, uno::makeAny(i_rException)); } @@ -513,8 +503,8 @@ handleError( ucb::InteractiveAugmentedIOException const & i_rException, return false; } else { OSL_ENSURE(pAbort->wasSelected(), "no continuation selected?"); - throw lang::WrappedTargetException(::rtl::OUString::createFromAscii( - "DocumentMetadataAccess::loadMetadataFromStorage: exception"), + throw lang::WrappedTargetException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "DocumentMetadataAccess::loadMetadataFromStorage: exception")), /* *this*/ 0, uno::makeAny(i_rException)); } } @@ -526,8 +516,8 @@ collectFilesFromStorage(uno::Reference<embed::XStorage> const& i_xStorage, ::rtl::OUString i_Path, std::set< ::rtl::OUString > & o_rFiles) { - static ::rtl::OUString content(::rtl::OUString::createFromAscii(s_content)); - static ::rtl::OUString styles (::rtl::OUString::createFromAscii(s_styles )); + static ::rtl::OUString content(RTL_CONSTASCII_USTRINGPARAM(s_content)); + static ::rtl::OUString styles(RTL_CONSTASCII_USTRINGPARAM(s_styles )); try { if (i_xStorage->hasByName(content) && i_xStorage->isStreamElement(content)) @@ -570,8 +560,8 @@ readStream(struct DocumentMetadataAccess_Impl & i_rImpl, i_rImpl.m_xRepository->importGraph(rdf::FileFormat::RDF_XML, xInStream, xURI, xBaseURI); } else { - throw mkException(::rtl::OUString::createFromAscii( - "readStream: is not a stream"), + throw mkException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "readStream: is not a stream")), ucb::IOErrorCode_NO_FILE, i_rBaseURI + i_rPath, i_rPath); } } else { @@ -597,8 +587,8 @@ readStream(struct DocumentMetadataAccess_Impl & i_rImpl, buf.append(dir).append(static_cast<sal_Unicode>('/')); readStream(i_rImpl, xDir, rest, buf.makeStringAndClear() ); } else { - throw mkException(::rtl::OUString::createFromAscii( - "readStream: is not a directory"), + throw mkException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "readStream: is not a directory")), ucb::IOErrorCode_NO_DIRECTORY, i_rBaseURI + dir, dir); } } @@ -631,7 +621,7 @@ retry: throw; } catch (uno::Exception & e) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString::createFromAscii("importFile: exception"), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("importFile: exception")), 0, uno::makeAny(e)); } } @@ -652,8 +642,8 @@ exportStream(struct DocumentMetadataAccess_Impl & i_rImpl, uno::UNO_QUERY); if (xStreamProps.is()) { // this is NOT supported in FileSystemStorage xStreamProps->setPropertyValue( - ::rtl::OUString::createFromAscii("MediaType"), - uno::makeAny(::rtl::OUString::createFromAscii(s_rdfxml))); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), + uno::makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s_rdfxml)))); } const uno::Reference<io::XOutputStream> xOutStream( xStream->getOutputStream(), uno::UNO_SET_THROW ); @@ -772,9 +762,9 @@ retry: if (rterr.hasValue()) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString::createFromAscii( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DocumentMetadataAccess::loadMetadataFromStorage: " - "exception"), 0, rterr); + "exception")), 0, rterr); } if (err) { @@ -798,7 +788,7 @@ static void init(struct DocumentMetadataAccess_Impl & i_rImpl) getURI<rdf::URIs::PKG_DOCUMENT>(i_rImpl.m_xContext).get()); } catch (uno::Exception & e) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString::createFromAscii("init: unexpected exception"), 0, + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("init: unexpected exception")), 0, uno::makeAny(e)); } @@ -887,8 +877,8 @@ throw (uno::RuntimeException) const IXmlIdRegistry * pReg( m_pImpl->m_rXmlIdRegistrySupplier.GetXmlIdRegistry() ); if (!pReg) { - throw uno::RuntimeException(::rtl::OUString::createFromAscii( - "DocumentMetadataAccess::getElementByXmlId: no registry"), *this); + throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "DocumentMetadataAccess::getElementByXmlId: no registry")), *this); } return pReg->GetElementByMetadataReference(i_rReference); } @@ -899,8 +889,8 @@ DocumentMetadataAccess::getElementByURI( throw (uno::RuntimeException, lang::IllegalArgumentException) { if (!i_xURI.is()) { - throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii( - "DocumentMetadataAccess::getElementByURI: URI is null"), *this, 0); + throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "DocumentMetadataAccess::getElementByURI: URI is null")), *this, 0); } const ::rtl::OUString baseURI( m_pImpl->m_xBaseURI->getStringValue() ); @@ -925,9 +915,9 @@ DocumentMetadataAccess::getMetadataGraphsWithType( throw (uno::RuntimeException, lang::IllegalArgumentException) { if (!i_xType.is()) { - throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii( + throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DocumentMetadataAccess::getMetadataGraphsWithType: " - "type is null"), *this, 0); + "type is null")), *this, 0); } ::comphelper::SequenceAsVector< uno::Reference< rdf::XURI > > ret; @@ -948,21 +938,21 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, container::ElementExistException) { if (!isFileNameValid(i_rFileName)) { - throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii( - "DocumentMetadataAccess::addMetadataFile: invalid FileName"), + throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "DocumentMetadataAccess::addMetadataFile: invalid FileName")), *this, 0); } if (isReservedFile(i_rFileName)) { - throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii( + throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DocumentMetadataAccess::addMetadataFile:" - "invalid FileName: reserved"), *this, 0); + "invalid FileName: reserved")), *this, 0); } for (sal_Int32 i = 0; i < i_rTypes.getLength(); ++i) { if (!i_rTypes[i].is()) { throw lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DocumentMetadataAccess::addMetadataFile: " - "null type"), *this, 2); + "null type")), *this, 2); } } @@ -973,8 +963,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, m_pImpl->m_xRepository->createGraph(xGraphName); } catch (rdf::RepositoryException & e) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString::createFromAscii( - "DocumentMetadataAccess::addMetadataFile: exception"), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "DocumentMetadataAccess::addMetadataFile: exception")), *this, uno::makeAny(e)); // note: all other exceptions are propagated } @@ -994,20 +984,20 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, container::ElementExistException, rdf::ParseException, io::IOException) { if (!isFileNameValid(i_rFileName)) { - throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii( - "DocumentMetadataAccess::importMetadataFile: invalid FileName"), + throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "DocumentMetadataAccess::importMetadataFile: invalid FileName")), *this, 0); } if (isReservedFile(i_rFileName)) { - throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii( + throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DocumentMetadataAccess::importMetadataFile:" - "invalid FileName: reserved"), *this, 0); + "invalid FileName: reserved")), *this, 0); } for (sal_Int32 i = 0; i < i_rTypes.getLength(); ++i) { if (!i_rTypes[i].is()) { throw lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii( - "DocumentMetadataAccess::importMetadataFile: null type"), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "DocumentMetadataAccess::importMetadataFile: null type")), *this, 5); } } @@ -1020,9 +1010,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, i_Format, i_xInStream, xGraphName, i_xBaseURI); } catch (rdf::RepositoryException & e) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString::createFromAscii( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DocumentMetadataAccess::importMetadataFile: " - "RepositoryException"), *this, uno::makeAny(e)); + "RepositoryException")), *this, uno::makeAny(e)); // note: all other exceptions are propagated } @@ -1041,9 +1031,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, m_pImpl->m_xRepository->destroyGraph(i_xGraphName); } catch (rdf::RepositoryException & e) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString::createFromAscii( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DocumentMetadataAccess::removeMetadataFile: " - "RepositoryException"), *this, uno::makeAny(e)); + "RepositoryException")), *this, uno::makeAny(e)); // note: all other exceptions are propagated } @@ -1058,15 +1048,15 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, container::ElementExistException) { if (!isFileNameValid(i_rFileName)) { - throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii( + throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DocumentMetadataAccess::addContentOrStylesFile: " - "invalid FileName"), *this, 0); + "invalid FileName")), *this, 0); } if (!addContentOrStylesFileImpl(*m_pImpl, i_rFileName)) { - throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii( + throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DocumentMetadataAccess::addContentOrStylesFile: " - "invalid FileName: must end with content.xml or styles.xml"), + "invalid FileName: must end with content.xml or styles.xml")), *this, 0); } } @@ -1078,9 +1068,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, container::NoSuchElementException) { if (!isFileNameValid(i_rFileName)) { - throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii( + throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DocumentMetadataAccess::removeContentOrStylesFile: " - "invalid FileName"), *this, 0); + "invalid FileName")), *this, 0); } try { @@ -1093,9 +1083,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, uno::UNO_SET_THROW); if (!xEnum->hasMoreElements()) { throw container::NoSuchElementException( - ::rtl::OUString::createFromAscii( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DocumentMetadataAccess::removeContentOrStylesFile: " - "cannot find stream in manifest graph: ") + i_rFileName, + "cannot find stream in manifest graph: ")) + i_rFileName, *this); } @@ -1106,8 +1096,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, throw; } catch (uno::Exception & e) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString::createFromAscii( - "DocumentMetadataAccess::removeContentOrStylesFile: exception"), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "DocumentMetadataAccess::removeContentOrStylesFile: exception")), *this, uno::makeAny(e)); } } @@ -1120,32 +1110,32 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, lang::WrappedTargetException) { if (!i_xStorage.is()) { - throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii( + throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DocumentMetadataAccess::loadMetadataFromStorage: " - "storage is null"), *this, 0); + "storage is null")), *this, 0); } if (!i_xBaseURI.is()) { - throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii( + throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DocumentMetadataAccess::loadMetadataFromStorage: " - "base URI is null"), *this, 1); + "base URI is null")), *this, 1); } const ::rtl::OUString baseURI( i_xBaseURI->getStringValue()); if (baseURI.indexOf('#') >= 0) { - throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii( + throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DocumentMetadataAccess::loadMetadataFromStorage: " - "base URI not absolute"), *this, 1); + "base URI not absolute")), *this, 1); } if (!baseURI.getLength() || !baseURI.endsWithAsciiL("/", 1)) { - throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii( + throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DocumentMetadataAccess::loadMetadataFromStorage: " - "base URI does not end with slash"), *this, 1); + "base URI does not end with slash")), *this, 1); } initLoading(*m_pImpl, i_xStorage, i_xBaseURI, i_xHandler); std::set< ::rtl::OUString > StgFiles; collectFilesFromStorage(i_xStorage, - ::rtl::OUString::createFromAscii(""), StgFiles); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")), StgFiles); std::vector< ::rtl::OUString > MfstMetadataFiles; @@ -1212,9 +1202,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, throw; } catch (uno::Exception & e) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString::createFromAscii( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DocumentMetadataAccess::loadMetadataFromStorage: " - "exception"), *this, uno::makeAny(e)); + "exception")), *this, uno::makeAny(e)); } std::for_each(StgFiles.begin(), StgFiles.end(), @@ -1231,9 +1221,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, lang::WrappedTargetException) { if (!i_xStorage.is()) { - throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii( + throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DocumentMetadataAccess::storeMetadataToStorage: " - "storage is null"), *this, 0); + "storage is null")), *this, 0); } // export manifest @@ -1247,12 +1237,12 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, } catch (uno::RuntimeException &) { throw; } catch (io::IOException & e) { - throw lang::WrappedTargetException( ::rtl::OUString::createFromAscii( - "storeMetadataToStorage: IO exception"), *this, uno::makeAny(e)); + throw lang::WrappedTargetException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "storeMetadataToStorage: IO exception")), *this, uno::makeAny(e)); } catch (uno::Exception & e) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString::createFromAscii( - "storeMetadataToStorage: exception"), *this, uno::makeAny(e)); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "storeMetadataToStorage: exception")), *this, uno::makeAny(e)); } // export metadata streams @@ -1285,20 +1275,20 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, throw; } catch (io::IOException & e) { throw lang::WrappedTargetException( - ::rtl::OUString::createFromAscii( - "storeMetadataToStorage: IO exception"), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "storeMetadataToStorage: IO exception")), *this, uno::makeAny(e)); } catch (uno::Exception & e) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString::createFromAscii( - "storeMetadataToStorage: exception"), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "storeMetadataToStorage: exception")), *this, uno::makeAny(e)); } } } catch (rdf::RepositoryException & e) { throw lang::WrappedTargetRuntimeException( - ::rtl::OUString::createFromAscii( - "storeMetadataToStorage: exception"), *this, uno::makeAny(e)); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "storeMetadataToStorage: exception")), *this, uno::makeAny(e)); } } @@ -1318,9 +1308,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, md[ ::comphelper::MediaDescriptor::PROP_INPUTSTREAM() ] >>= xIn; } if (!xIn.is() && URL.equalsAscii("")) { - throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii( + throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DocumentMetadataAccess::loadMetadataFromMedium: " - "inalid medium: no URL, no input stream"), *this, 0); + "inalid medium: no URL, no input stream")), *this, 0); } uno::Reference<embed::XStorage> xStorage; try { @@ -1339,14 +1329,14 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, throw; } catch (uno::Exception & e) { throw lang::WrappedTargetException( - ::rtl::OUString::createFromAscii( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DocumentMetadataAccess::loadMetadataFromMedium: " - "exception"), *this, uno::makeAny(e)); + "exception")), *this, uno::makeAny(e)); } if (!xStorage.is()) { - throw uno::RuntimeException(::rtl::OUString::createFromAscii( + throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DocumentMetadataAccess::loadMetadataFromMedium: " - "cannot get Storage"), *this); + "cannot get Storage")), *this); } uno::Reference<rdf::XURI> xBaseURI; try { @@ -1374,9 +1364,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, ::rtl::OUString URL; md[ ::comphelper::MediaDescriptor::PROP_URL() ] >>= URL; if (URL.equalsAscii("")) { - throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii( + throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DocumentMetadataAccess::storeMetadataToMedium: " - "invalid medium: no URL"), *this, 0); + "invalid medium: no URL")), *this, 0); } SfxMedium aMedium(i_rMedium); @@ -1393,9 +1383,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, } if (!xStorage.is()) { - throw uno::RuntimeException(::rtl::OUString::createFromAscii( + throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DocumentMetadataAccess::storeMetadataToMedium: " - "cannot get Storage"), *this); + "cannot get Storage")), *this); } // set MIME type of the storage ::comphelper::MediaDescriptor::const_iterator iter @@ -1430,3 +1420,4 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, } // namespace sfx2 +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/Metadatable.cxx b/sfx2/source/doc/Metadatable.cxx index f77883555c..6f2a33e76a 100644 --- a/sfx2/source/doc/Metadatable.cxx +++ b/sfx2/source/doc/Metadatable.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,7 +31,7 @@ #include <sfx2/Metadatable.hxx> #include <sfx2/XmlIdRegistry.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <vcl/svapp.hxx> // solarmutex #include <rtl/random.h> @@ -521,8 +522,8 @@ XmlIdRegistryDocument::XmlIdRegistry_Impl::LookupElement( { if (!isValidXmlId(i_rStreamName, i_rIdref)) { - throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii( - "illegal XmlId"), 0, 0); + throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "illegal XmlId")), 0, 0); } const XmlIdList_t * pList( LookupElementList(i_rStreamName, i_rIdref) ); @@ -690,15 +691,15 @@ XmlIdRegistryDocument::TryRegisterMetadatable(Metadatable & i_rObject, if (!isValidXmlId(i_rStreamName, i_rIdref)) { - throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii( - "illegal XmlId"), 0, 0); + throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "illegal XmlId")), 0, 0); } if (i_rObject.IsInContent() ? !isContentFile(i_rStreamName) : !isStylesFile(i_rStreamName)) { - throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii( - "illegal XmlId: wrong stream"), 0, 0); + throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "illegal XmlId: wrong stream")), 0, 0); } ::rtl::OUString old_path; @@ -993,8 +994,8 @@ XmlIdRegistryClipboard::XmlIdRegistry_Impl::LookupEntry( { if (!isValidXmlId(i_rStreamName, i_rIdref)) { - throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii( - "illegal XmlId"), 0, 0); + throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "illegal XmlId")), 0, 0); } const ClipboardXmlIdMap_t::const_iterator iter( m_XmlIdMap.find(i_rIdref) ); @@ -1124,15 +1125,15 @@ XmlIdRegistryClipboard::TryRegisterMetadatable(Metadatable & i_rObject, if (!isValidXmlId(i_rStreamName, i_rIdref)) { - throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii( - "illegal XmlId"), 0, 0); + throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "illegal XmlId")), 0, 0); } if (i_rObject.IsInContent() ? !isContentFile(i_rStreamName) : !isStylesFile(i_rStreamName)) { - throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii( - "illegal XmlId: wrong stream"), 0, 0); + throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "illegal XmlId: wrong stream")), 0, 0); } ::rtl::OUString old_path; @@ -1261,8 +1262,8 @@ XmlIdRegistryClipboard::RegisterCopyClipboard(Metadatable & i_rCopy, if (!isValidXmlId(i_rReference.First, i_rReference.Second)) { - throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii( - "illegal XmlId"), 0, 0); + throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "illegal XmlId")), 0, 0); } if (!i_isLatent) @@ -1354,8 +1355,8 @@ Metadatable::SetMetadataReference( else { throw lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("Metadatable::" - "SetMetadataReference: argument is invalid"), /*this*/0, 0); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Metadatable::" + "SetMetadataReference: argument is invalid")), /*this*/0, 0); } } } @@ -1471,19 +1472,6 @@ Metadatable::RegisterAsCopyOf(Metadatable const & i_rSource, { OSL_ENSURE(false, "neither RegDoc nor RegClp cannot happen"); } -#if 0 - { - //FIXME: do we need this at all??? - XmlIdRegistryDocument & rRegDoc( - dynamic_cast<XmlIdRegistryDocument&>( rReg ) ); - { - if (rRegDoc.TryRegisterMetadatable(*this, SourceRef)) - { - this->m_pReg = &rRegDoc; - } - } - } -#endif } } catch (uno::Exception &) @@ -1600,7 +1588,7 @@ Metadatable::JoinMetadatable(Metadatable const & i_rOther, ::rtl::OUString SAL_CALL MetadatableMixin::getLocalName() throw (::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; beans::StringPair mdref( getMetadataReference() ); if (!mdref.Second.getLength()) { @@ -1617,7 +1605,7 @@ Metadatable::JoinMetadatable(Metadatable const & i_rOther, ::rtl::OUString SAL_CALL MetadatableMixin::getNamespace() throw (::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; const uno::Reference< frame::XModel > xModel( GetModel() ); const uno::Reference< rdf::XURI > xDMA( xModel, uno::UNO_QUERY_THROW ); return xDMA->getStringValue(); @@ -1701,3 +1689,4 @@ static void dump(sfx2::XmlIdList_t * pList) #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/QuerySaveDocument.cxx b/sfx2/source/doc/QuerySaveDocument.cxx index 891b2eeb66..dd7b252ccc 100644 --- a/sfx2/source/doc/QuerySaveDocument.cxx +++ b/sfx2/source/doc/QuerySaveDocument.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -47,3 +48,5 @@ short ExecuteQuerySaveDocument(Window* _pParent,const String& _rTitle) return aQBox.Execute(); } // ----------------------------------------------------------------------------- + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx index 16a9ba4603..a55ef8f0e1 100644 --- a/sfx2/source/doc/SfxDocumentMetaData.cxx +++ b/sfx2/source/doc/SfxDocumentMetaData.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -87,6 +88,10 @@ #include <cstring> #include <limits> + +#include <cppuhelper/implbase1.hxx> +#include <com/sun/star/document/XCompatWriterDocProperties.hpp> + /** * This file contains the implementation of the service * com.sun.star.document.DocumentProperties. @@ -292,12 +297,12 @@ public: const css::uno::Sequence< css::beans::StringPair >& i_rNamespaces) throw (css::uno::RuntimeException, css::xml::sax::SAXException); -private: +protected: SfxDocumentMetaData(SfxDocumentMetaData &); // not defined SfxDocumentMetaData& operator =(SfxDocumentMetaData &); // not defined virtual ~SfxDocumentMetaData() {} - + virtual SfxDocumentMetaData* createMe( css::uno::Reference< css::uno::XComponentContext > const & context ) { return new SfxDocumentMetaData( context ); }; const css::uno::Reference< css::uno::XComponentContext > m_xContext; /// for notification @@ -372,6 +377,54 @@ private: void createUserDefined(); }; +typedef ::cppu::ImplInheritanceHelper1< SfxDocumentMetaData, css::document::XCompatWriterDocProperties > CompatWriterDocPropsImpl_BASE; + +class CompatWriterDocPropsImpl : public CompatWriterDocPropsImpl_BASE +{ + rtl::OUString msManager; + rtl::OUString msCategory; + rtl::OUString msCompany; +protected: + virtual SfxDocumentMetaData* createMe( css::uno::Reference< css::uno::XComponentContext > const & context ) { return new CompatWriterDocPropsImpl( context ); }; +public: + CompatWriterDocPropsImpl( css::uno::Reference< css::uno::XComponentContext > const & context) : CompatWriterDocPropsImpl_BASE( context ) {} +// XCompatWriterDocPropsImpl + virtual ::rtl::OUString SAL_CALL getManager() throw (::com::sun::star::uno::RuntimeException) { return msManager; } + virtual void SAL_CALL setManager( const ::rtl::OUString& _manager ) throw (::com::sun::star::uno::RuntimeException) { msManager = _manager; } + virtual ::rtl::OUString SAL_CALL getCategory() throw (::com::sun::star::uno::RuntimeException){ return msCategory; } + virtual void SAL_CALL setCategory( const ::rtl::OUString& _category ) throw (::com::sun::star::uno::RuntimeException){ msCategory = _category; } + virtual ::rtl::OUString SAL_CALL getCompany() throw (::com::sun::star::uno::RuntimeException){ return msCompany; } + virtual void SAL_CALL setCompany( const ::rtl::OUString& _company ) throw (::com::sun::star::uno::RuntimeException){ msCompany = _company; } + +// XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException) + { + return comp_CompatWriterDocProps::_getImplementationName(); + } + + virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException) + { + css::uno::Sequence< rtl::OUString > sServiceNames= getSupportedServiceNames(); + sal_Int32 nLen = sServiceNames.getLength(); + rtl::OUString* pIt = sServiceNames.getArray(); + rtl::OUString* pEnd = ( pIt + nLen ); + sal_Bool bRes = sal_False; + for ( ; pIt != pEnd; ++pIt ) + { + if ( pIt->equals( ServiceName ) ) + { + bRes = sal_True; + break; + } + } + return bRes; + } + + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException) + { + return comp_CompatWriterDocProps::_getSupportedServiceNames(); + } +}; //////////////////////////////////////////////////////////////////////////// bool operator== (const css::util::DateTime &i_rLeft, @@ -490,10 +543,10 @@ getQualifier(const char* i_name) { DBG_ASSERT(i_qname, "SfxDocumentMetaData: getNameSpace: argument is null"); const char * ns = ""; ::rtl::OUString n = getQualifier(i_qname).first; - if (n.equalsAscii("xlink" )) ns = s_nsXLink; - if (n.equalsAscii("dc" )) ns = s_nsDC; - if (n.equalsAscii("office")) ns = s_nsODF; - if (n.equalsAscii("meta" )) ns = s_nsODFMeta; + if (n.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("xlink"))) ns = s_nsXLink; + if (n.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("dc"))) ns = s_nsDC; + if (n.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("office"))) ns = s_nsODF; + if (n.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("meta"))) ns = s_nsODFMeta; DBG_ASSERT(*ns, "SfxDocumentMetaData: unknown namespace prefix"); return ::rtl::OUString::createFromAscii(ns); } @@ -617,8 +670,8 @@ SfxDocumentMetaData::getURLProperties( css::uno::Reference<css::lang::XMultiComponentFactory> xMsf ( m_xContext->getServiceManager()); css::uno::Reference< css::beans::XPropertyContainer> xPropArg( - xMsf->createInstanceWithContext(::rtl::OUString::createFromAscii( - "com.sun.star.beans.PropertyBag"), m_xContext), + xMsf->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.beans.PropertyBag")), m_xContext), css::uno::UNO_QUERY_THROW); try { ::rtl::OUString dburl = @@ -655,8 +708,8 @@ getNodeText(css::uno::Reference<css::xml::dom::XNode> i_xNode) throw (css::uno::RuntimeException) { if (!i_xNode.is()) throw css::uno::RuntimeException( - ::rtl::OUString::createFromAscii( - "SfxDocumentMetaData::getNodeText: argument is null"), i_xNode); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "SfxDocumentMetaData::getNodeText: argument is null")), i_xNode); for (css::uno::Reference<css::xml::dom::XNode> c = i_xNode->getFirstChild(); c.is(); c = c->getNextSibling()) { @@ -735,8 +788,8 @@ SfxDocumentMetaData::setMetaText(const char* i_name, } catch (css::xml::dom::DOMException & e) { css::uno::Any a(e); throw css::lang::WrappedTargetRuntimeException( - ::rtl::OUString::createFromAscii( - "SfxDocumentMetaData::setMetaText: DOM exception"), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "SfxDocumentMetaData::setMetaText: DOM exception")), css::uno::Reference<css::uno::XInterface>(*this), a); } } @@ -873,8 +926,8 @@ SfxDocumentMetaData::setMetaList(const char* i_name, } catch (css::xml::dom::DOMException & e) { css::uno::Any a(e); throw css::lang::WrappedTargetRuntimeException( - ::rtl::OUString::createFromAscii( - "SfxDocumentMetaData::setMetaList: DOM exception"), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "SfxDocumentMetaData::setMetaList: DOM exception")), css::uno::Reference<css::uno::XInterface>(*this), a); } } @@ -1014,8 +1067,8 @@ SfxDocumentMetaData::updateElement(const char *i_name, } catch (css::xml::dom::DOMException & e) { css::uno::Any a(e); throw css::lang::WrappedTargetRuntimeException( - ::rtl::OUString::createFromAscii( - "SfxDocumentMetaData::updateElement: DOM exception"), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "SfxDocumentMetaData::updateElement: DOM exception")), css::uno::Reference<css::uno::XInterface>(*this), a); } } @@ -1073,7 +1126,7 @@ void SAL_CALL SfxDocumentMetaData::updateUserDefinedAndAttributes() static_cast<const char*>("office:target-frame-name"), m_DefaultTarget)); // xlink:show: _blank -> new, any other value -> replace - const sal_Char* show = m_DefaultTarget.equalsAscii("_blank") + const sal_Char* show = m_DefaultTarget.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("_blank")) ? "new" : "replace"; attributes.push_back(std::make_pair( static_cast<const char*>("xlink:show"), @@ -1092,18 +1145,18 @@ SfxDocumentMetaData::createDOM() const // throw (css::uno::RuntimeException) css::uno::Reference<css::lang::XMultiComponentFactory> xMsf ( m_xContext->getServiceManager()); css::uno::Reference<css::xml::dom::XDocumentBuilder> xBuilder( - xMsf->createInstanceWithContext(::rtl::OUString::createFromAscii( - "com.sun.star.xml.dom.DocumentBuilder"), m_xContext), + xMsf->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.xml.dom.DocumentBuilder")), m_xContext), css::uno::UNO_QUERY_THROW ); if (!xBuilder.is()) throw css::uno::RuntimeException( - ::rtl::OUString::createFromAscii("SfxDocumentMetaData::createDOM: " - "cannot create DocumentBuilder service"), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SfxDocumentMetaData::createDOM: " + "cannot create DocumentBuilder service")), *const_cast<SfxDocumentMetaData*>(this)); css::uno::Reference<css::xml::dom::XDocument> xDoc = xBuilder->newDocument(); if (!xDoc.is()) throw css::uno::RuntimeException( - ::rtl::OUString::createFromAscii("SfxDocumentMetaData::createDOM: " - "cannot create new document"), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SfxDocumentMetaData::createDOM: " + "cannot create new document")), *const_cast<SfxDocumentMetaData*>(this)); return xDoc; } @@ -1112,8 +1165,8 @@ void SAL_CALL SfxDocumentMetaData::checkInit() const // throw (css::uno::RuntimeException) { if (!m_isInitialized) { - throw css::uno::RuntimeException(::rtl::OUString::createFromAscii( - "SfxDocumentMetaData::checkInit: not initialized"), + throw css::uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "SfxDocumentMetaData::checkInit: not initialized")), *const_cast<SfxDocumentMetaData*>(this)); } DBG_ASSERT((m_xDoc.is() && m_xParent.is() ), @@ -1127,18 +1180,18 @@ void SAL_CALL SfxDocumentMetaData::init( // css::uno::Exception) { if (!i_xDoc.is()) throw css::uno::RuntimeException( - ::rtl::OUString::createFromAscii( - "SfxDocumentMetaData::init: no DOM tree given"), *this); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "SfxDocumentMetaData::init: no DOM tree given")), *this); css::uno::Reference<css::lang::XMultiComponentFactory> xMsf ( m_xContext->getServiceManager()); css::uno::Reference<css::xml::xpath::XXPathAPI> xPath( - xMsf->createInstanceWithContext(::rtl::OUString::createFromAscii( - "com.sun.star.xml.xpath.XPathAPI"), m_xContext), + xMsf->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.xml.xpath.XPathAPI")), m_xContext), css::uno::UNO_QUERY_THROW ); if (!xPath.is()) throw css::uno::RuntimeException( - ::rtl::OUString::createFromAscii("SfxDocumentMetaData::init:" - " cannot create XPathAPI service"), *this); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SfxDocumentMetaData::init:" + " cannot create XPathAPI service")), *this); m_isInitialized = false; m_xDoc = i_xDoc; @@ -1156,8 +1209,8 @@ void SAL_CALL SfxDocumentMetaData::init( // NB: we do not handle the single-XML-file ODF variant, which would // have the root element office:document. // The root of such documents must be converted in the importer! - ::rtl::OUString prefix = ::rtl::OUString::createFromAscii( - "/child::office:document-meta/child::office:meta"); + ::rtl::OUString prefix(RTL_CONSTASCII_USTRINGPARAM( + "/child::office:document-meta/child::office:meta")); css::uno::Reference<css::xml::dom::XNode> xDocNode( m_xDoc, css::uno::UNO_QUERY_THROW); m_xParent.clear(); @@ -1174,29 +1227,27 @@ void SAL_CALL SfxDocumentMetaData::init( css::uno::Reference<css::xml::dom::XElement> xRElem( i_xDoc->createElementNS( ::rtl::OUString::createFromAscii(s_nsODF), - ::rtl::OUString::createFromAscii("office:document-meta"))); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("office:document-meta")))); css::uno::Reference<css::xml::dom::XNode> xRNode(xRElem, css::uno::UNO_QUERY_THROW); // NB: the following is a _bad_idea_ with our DOM implementation // do _not_ create attributes with xmlns prefix! -// xRElem->setAttribute(::rtl::OUString::createFromAscii("xmlns:office"), -// ::rtl::OUString::createFromAscii(s_nsODF)); xRElem->setAttributeNS(::rtl::OUString::createFromAscii(s_nsODF), - ::rtl::OUString::createFromAscii("office:version"), - ::rtl::OUString::createFromAscii("1.0")); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("office:version")), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("1.0"))); i_xDoc->appendChild(xRNode); css::uno::Reference<css::xml::dom::XNode> xParent ( i_xDoc->createElementNS( ::rtl::OUString::createFromAscii(s_nsODF), - ::rtl::OUString::createFromAscii("office:meta")), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("office:meta"))), css::uno::UNO_QUERY_THROW); xRNode->appendChild(xParent); m_xParent = xParent; } catch (css::xml::dom::DOMException & e) { css::uno::Any a(e); throw css::lang::WrappedTargetRuntimeException( - ::rtl::OUString::createFromAscii( - "SfxDocumentMetaData::init: DOM exception"), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "SfxDocumentMetaData::init: DOM exception")), css::uno::Reference<css::uno::XInterface>(*this), a); } } @@ -1213,7 +1264,7 @@ void SAL_CALL SfxDocumentMetaData::init( // application-specific. css::uno::Reference<css::xml::dom::XNode> xNode = xPath->selectSingleNode(m_xParent, - ::rtl::OUString::createFromAscii("child::") + name); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("child::")) + name); // Do not create an empty element if it is missing; // for certain elements, such as dateTime, this would be invalid m_meta[name] = xNode; @@ -1224,7 +1275,7 @@ void SAL_CALL SfxDocumentMetaData::init( ::rtl::OUString name = ::rtl::OUString::createFromAscii(*pName); css::uno::Reference<css::xml::dom::XNodeList> nodes = xPath->selectNodeList(m_xParent, - ::rtl::OUString::createFromAscii("child::") + name); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("child::")) + name); std::vector<css::uno::Reference<css::xml::dom::XNode> > v; for (sal_Int32 i = 0; i < nodes->getLength(); ++i) { v.push_back(nodes->item(i)); @@ -1245,7 +1296,7 @@ void SAL_CALL SfxDocumentMetaData::init( std::vector<css::uno::Reference<css::xml::dom::XNode> > & vec = - m_metaList[::rtl::OUString::createFromAscii("meta:user-defined")]; + m_metaList[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("meta:user-defined"))]; m_xUserDefined.clear(); // #i105826#: reset (may be re-initialization) if ( !vec.empty() ) { @@ -1263,9 +1314,9 @@ void SAL_CALL SfxDocumentMetaData::init( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("name"))); ::rtl::OUString type = xElem->getAttributeNS( ::rtl::OUString::createFromAscii(s_nsODFMeta), - ::rtl::OUString::createFromAscii("value-type")); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("value-type"))); ::rtl::OUString text = getNodeText(*it); - if (type.equalsAscii("float")) { + if (type.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("float"))) { double d; if (::sax::Converter::convertDouble(d, text)) { any <<= d; @@ -1274,7 +1325,7 @@ void SAL_CALL SfxDocumentMetaData::init( OUStringToOString(text, RTL_TEXTENCODING_UTF8).getStr()); continue; } - } else if (type.equalsAscii("date")) { + } else if (type.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("date"))) { bool isDateTime; css::util::Date d; css::util::DateTime dt; @@ -1298,7 +1349,7 @@ void SAL_CALL SfxDocumentMetaData::init( OUStringToOString(text, RTL_TEXTENCODING_UTF8).getStr()); continue; } - } else if (type.equalsAscii("boolean")) { + } else if (type.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("boolean"))) { bool b; if (::sax::Converter::convertBool(b, text)) { any <<= b; @@ -1307,7 +1358,7 @@ void SAL_CALL SfxDocumentMetaData::init( OUStringToOString(text, RTL_TEXTENCODING_UTF8).getStr()); continue; } - } else if (type.equalsAscii("string") || true) { // default + } else if (type.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("string")) || true) { // default any <<= text; } try { @@ -1521,7 +1572,7 @@ SfxDocumentMetaData::setLanguage(const css::lang::Locale & the_value) { ::rtl::OUString text = the_value.Language; if (the_value.Country.getLength() > 0) { - text += ::rtl::OUString::createFromAscii("-").concat(the_value.Country); + text += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-")).concat(the_value.Country); } setMetaTextAndNotify("dc:language", text); } @@ -1679,8 +1730,8 @@ SfxDocumentMetaData::setAutoloadSecs(::sal_Int32 the_value) throw (css::uno::RuntimeException, css::lang::IllegalArgumentException) { if (the_value < 0) throw css::lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii( - "SfxDocumentMetaData::setAutoloadSecs: argument is negative"), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "SfxDocumentMetaData::setAutoloadSecs: argument is negative")), *this, 0); ::osl::ClearableMutexGuard g(m_aMutex); checkInit(); @@ -1793,8 +1844,8 @@ SfxDocumentMetaData::setEditingCycles(::sal_Int16 the_value) throw (css::uno::RuntimeException, css::lang::IllegalArgumentException) { if (the_value < 0) throw css::lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii( - "SfxDocumentMetaData::setEditingCycles: argument is negative"), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "SfxDocumentMetaData::setEditingCycles: argument is negative")), *this, 0); ::rtl::OUStringBuffer buf; ::sax::Converter::convertNumber(buf, the_value); @@ -1813,8 +1864,8 @@ SfxDocumentMetaData::setEditingDuration(::sal_Int32 the_value) throw (css::uno::RuntimeException, css::lang::IllegalArgumentException) { if (the_value < 0) throw css::lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii( - "SfxDocumentMetaData::setEditingDuration: argument is negative"), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "SfxDocumentMetaData::setEditingDuration: argument is negative")), *this, 0); setMetaTextAndNotify("meta:editing-duration", durationToText(the_value)); } @@ -1838,7 +1889,7 @@ SfxDocumentMetaData::resetUserData(const ::rtl::OUString & the_value) dateTimeToText(css::util::DateTime())); bModified |= setMetaText("meta:editing-duration", durationToText(0)); bModified |= setMetaText("meta:editing-cycles", - ::rtl::OUString::createFromAscii("1")); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("1"))); if (bModified) { g.clear(); @@ -1867,8 +1918,8 @@ SfxDocumentMetaData::loadFromStorage( css::lang::WrappedTargetException, css::io::IOException) { if (!xStorage.is()) throw css::lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("SfxDocumentMetaData::loadFromStorage:" - " argument is null"), *this, 0); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SfxDocumentMetaData::loadFromStorage:" + " argument is null")), *this, 0); ::osl::MutexGuard g(m_aMutex); // open meta data file @@ -1885,12 +1936,12 @@ SfxDocumentMetaData::loadFromStorage( css::uno::Reference<css::lang::XMultiComponentFactory> xMsf ( m_xContext->getServiceManager()); css::uno::Reference<css::xml::sax::XParser> xParser ( - xMsf->createInstanceWithContext(::rtl::OUString::createFromAscii( - "com.sun.star.xml.sax.Parser"), m_xContext), + xMsf->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.xml.sax.Parser")), m_xContext), css::uno::UNO_QUERY_THROW); if (!xParser.is()) throw css::uno::RuntimeException( - ::rtl::OUString::createFromAscii("SfxDocumentMetaData::loadFromStorage:" - " cannot create Parser service"), *this); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SfxDocumentMetaData::loadFromStorage:" + " cannot create Parser service")), *this); css::xml::sax::InputSource input; input.aInputStream = xInStream; @@ -1907,7 +1958,7 @@ SfxDocumentMetaData::loadFromStorage( try { xPropArg->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BaseURI"))) >>= input.sSystemId; - input.sSystemId += ::rtl::OUString::createFromAscii("/").concat( + input.sSystemId += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")).concat( ::rtl::OUString::createFromAscii(s_metaXml)); } catch (css::uno::Exception &) { input.sSystemId = ::rtl::OUString::createFromAscii(s_metaXml); @@ -1920,8 +1971,8 @@ SfxDocumentMetaData::loadFromStorage( ::rtl::OUString::createFromAscii(pServiceName), args, m_xContext), css::uno::UNO_QUERY_THROW); if (!xDocHandler.is()) throw css::uno::RuntimeException( - ::rtl::OUString::createFromAscii("SfxDocumentMetaData::loadFromStorage:" - " cannot create XMLOasisMetaImporter service"), *this); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SfxDocumentMetaData::loadFromStorage:" + " cannot create XMLOasisMetaImporter service")), *this); css::uno::Reference<css::document::XImporter> xImp (xDocHandler, css::uno::UNO_QUERY_THROW); xImp->setTargetDocument(css::uno::Reference<css::lang::XComponent>(this)); @@ -1929,9 +1980,9 @@ SfxDocumentMetaData::loadFromStorage( try { xParser->parseStream(input); } catch (css::xml::sax::SAXException &) { - throw css::io::WrongFormatException(::rtl::OUString::createFromAscii( + throw css::io::WrongFormatException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "SfxDocumentMetaData::loadFromStorage:" - " XML parsing exception"), *this); + " XML parsing exception")), *this); } // NB: the implementation of XMLOasisMetaImporter calls initialize // init(xDocBuilder->getDocument()); @@ -1946,8 +1997,8 @@ SfxDocumentMetaData::storeToStorage( css::lang::WrappedTargetException, css::io::IOException) { if (!xStorage.is()) throw css::lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("SfxDocumentMetaData::storeToStorage:" - " argument is null"), *this, 0); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SfxDocumentMetaData::storeToStorage:" + " argument is null")), *this, 0); ::osl::MutexGuard g(m_aMutex); checkInit(); @@ -1964,7 +2015,7 @@ SfxDocumentMetaData::storeToStorage( css::uno::UNO_QUERY_THROW); xStreamProps->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), - css::uno::makeAny(::rtl::OUString::createFromAscii("text/xml"))); + css::uno::makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("text/xml")))); xStreamProps->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Compressed")), css::uno::makeAny(static_cast<sal_Bool> (sal_False))); @@ -1977,8 +2028,8 @@ SfxDocumentMetaData::storeToStorage( css::uno::Reference<css::lang::XMultiComponentFactory> xMsf ( m_xContext->getServiceManager()); css::uno::Reference<css::io::XActiveDataSource> xSaxWriter( - xMsf->createInstanceWithContext(::rtl::OUString::createFromAscii( - "com.sun.star.xml.sax.Writer"), m_xContext), + xMsf->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.xml.sax.Writer")), m_xContext), css::uno::UNO_QUERY_THROW); xSaxWriter->setOutputStream(xOutStream); css::uno::Reference<css::xml::sax::XDocumentHandler> xDocHandler ( @@ -2012,8 +2063,8 @@ SfxDocumentMetaData::storeToStorage( xTransaction->commit(); } } else { - throw css::io::IOException(::rtl::OUString::createFromAscii( - "SfxDocumentMetaData::storeToStorage: cannot filter"), *this); + throw css::io::IOException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "SfxDocumentMetaData::storeToStorage: cannot filter")), *this); } } @@ -2049,8 +2100,8 @@ SfxDocumentMetaData::loadFromMedium(const ::rtl::OUString & URL, throw; } catch (css::uno::Exception & e) { throw css::lang::WrappedTargetException( - ::rtl::OUString::createFromAscii( - "SfxDocumentMetaData::loadFromMedium: exception"), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "SfxDocumentMetaData::loadFromMedium: exception")), css::uno::Reference<css::uno::XInterface>(*this), css::uno::makeAny(e)); } @@ -2128,14 +2179,14 @@ SfxDocumentMetaData::initialize( if (any >>= xDoc) { if (!xDoc.is()) { throw css::lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("SfxDocumentMetaData::" - "initialize: argument is null"), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SfxDocumentMetaData::" + "initialize: argument is null")), *this, static_cast<sal_Int16>(i)); } } else { throw css::lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("SfxDocumentMetaData::" - "initialize: argument must be XDocument"), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SfxDocumentMetaData::" + "initialize: argument must be XDocument")), *this, static_cast<sal_Int16>(i)); } } @@ -2156,7 +2207,7 @@ SfxDocumentMetaData::createClone() ::osl::MutexGuard g(m_aMutex); checkInit(); - SfxDocumentMetaData *pNew = new SfxDocumentMetaData(m_xContext); + SfxDocumentMetaData *pNew = createMe(m_xContext); // NB: do not copy the modification listeners, only DOM css::uno::Reference<css::xml::dom::XDocument> xDoc = createDOM(); @@ -2174,8 +2225,8 @@ SfxDocumentMetaData::createClone() } catch (css::uno::Exception & e) { css::uno::Any a(e); throw css::lang::WrappedTargetRuntimeException( - ::rtl::OUString::createFromAscii( - "SfxDocumentMetaData::createClone: exception"), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "SfxDocumentMetaData::createClone: exception")), css::uno::Reference<css::uno::XInterface>(*this), a); } // return static_cast< ::cppu::OWeakObject * > (pNew); @@ -2334,6 +2385,32 @@ void SfxDocumentMetaData::createUserDefined() // component helper namespace +namespace comp_CompatWriterDocProps { + + ::rtl::OUString SAL_CALL _getImplementationName() { + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "CompatWriterDocPropsImpl")); +} + + css::uno::Sequence< ::rtl::OUString > SAL_CALL _getSupportedServiceNames() + { + static css::uno::Sequence< rtl::OUString > aServiceNames; + if ( aServiceNames.getLength() == 0 ) + { + aServiceNames.realloc( 1 ); + aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.writer.DocumentProperties" ) ); + } + return aServiceNames; + } + css::uno::Reference< css::uno::XInterface > SAL_CALL _create( + const css::uno::Reference< css::uno::XComponentContext > & context) + SAL_THROW((css::uno::Exception)) + { + return static_cast< ::cppu::OWeakObject * > + (new CompatWriterDocPropsImpl(context)); + } + +} namespace comp_SfxDocumentMetaData { ::rtl::OUString SAL_CALL _getImplementationName() { diff --git a/sfx2/source/doc/doc.hrc b/sfx2/source/doc/doc.hrc index 09e7c58476..87538c9c09 100644 --- a/sfx2/source/doc/doc.hrc +++ b/sfx2/source/doc/doc.hrc @@ -61,14 +61,6 @@ #define BMP_STYLES_FAMILY3 (RID_SFX_DOC_START+ 4) #define BMP_STYLES_FAMILY4 (RID_SFX_DOC_START+ 5) -#define BMP_STYLES_CLOSED_HC (RID_SFX_DOC_START+ 6) -#define BMP_STYLES_OPENED_HC (RID_SFX_DOC_START+ 7) - -#define BMP_STYLES_FAMILY1_HC (RID_SFX_DOC_START+ 8) -#define BMP_STYLES_FAMILY2_HC (RID_SFX_DOC_START+ 9) -#define BMP_STYLES_FAMILY3_HC (RID_SFX_DOC_START+ 10) -#define BMP_STYLES_FAMILY4_HC (RID_SFX_DOC_START+ 11) - #define STR_STYLES (RID_SFX_DOC_START+ 18) #define STR_MACROS (RID_SFX_DOC_START+ 19) @@ -147,10 +139,6 @@ #define STR_OBJECT (RID_SFX_DOC_START+ 84) #define STR_EDITOBJECT (RID_SFX_DOC_START+ 85) -// --> PB 2004-08-20 #i33095# -/* obsolete -#define STR_OPENOBJECT (RID_SFX_DOC_START+ 86) -*/ #define DLOAD_URL 1 #define DLOAD_STATUS 2 diff --git a/sfx2/source/doc/doc.src b/sfx2/source/doc/doc.src index 3081374941..6d46da21ff 100644 --- a/sfx2/source/doc/doc.src +++ b/sfx2/source/doc/doc.src @@ -64,9 +64,6 @@ String STR_QUERY_SAVE_DOCUMENT Bitmap BMP_STYLES_CLOSED { File = "newex.bmp" ; }; Bitmap BMP_STYLES_OPENED { File = "newex.bmp" ; }; -Bitmap BMP_STYLES_CLOSED_HC { File = "newex_h.bmp" ; }; -Bitmap BMP_STYLES_OPENED_HC { File = "newex_h.bmp" ; }; - String STR_STYLES { Text [ en-US ] = "Styles" ; @@ -92,11 +89,6 @@ Bitmap BMP_STYLES_FAMILY2 { File = "styfam2.bmp" ; }; Bitmap BMP_STYLES_FAMILY3 { File = "styfam3.bmp" ; }; Bitmap BMP_STYLES_FAMILY4 { File = "styfam4.bmp" ; }; -Bitmap BMP_STYLES_FAMILY1_HC { File = "styfam1_h.bmp" ; }; -Bitmap BMP_STYLES_FAMILY2_HC { File = "styfam2_h.bmp" ; }; -Bitmap BMP_STYLES_FAMILY3_HC { File = "styfam3_h.bmp" ; }; -Bitmap BMP_STYLES_FAMILY4_HC { File = "styfam4_h.bmp" ; }; - ErrorBox MSG_PRINT_ERROR { BUTTONS = WB_OK ; @@ -376,14 +368,6 @@ String STR_EDITOBJECT Text [ en-US ] = "~Edit"; }; -// --> PB 2004-08-20 #i33095# -/* obsolete -String STR_OPENOBJECT -{ - Text [ en-US ] = "~Open"; -}; -*/ - QueryBox DLG_MACROQUERY { Buttons = WB_OK_CANCEL; diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx index c28e6950f7..a119c74d72 100644 --- a/sfx2/source/doc/docfac.cxx +++ b/sfx2/source/doc/docfac.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -438,8 +439,8 @@ String SfxObjectFactory::GetFactoryURL() const String SfxObjectFactory::GetModuleName() const { - static ::rtl::OUString SERVICENAME_MODULEMANAGER = ::rtl::OUString::createFromAscii("com.sun.star.frame.ModuleManager"); - static ::rtl::OUString PROP_MODULEUINAME = ::rtl::OUString::createFromAscii("ooSetupFactoryUIName"); + static ::rtl::OUString SERVICENAME_MODULEMANAGER(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.ModuleManager")); + static ::rtl::OUString PROP_MODULEUINAME (RTL_CONSTASCII_USTRINGPARAM("ooSetupFactoryUIName")); try { diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 9bf3d01fc4..86d431d119 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -71,9 +72,7 @@ #include <com/sun/star/logging/XSimpleLogRing.hpp> #include <cppuhelper/implbase1.hxx> #include <com/sun/star/beans/PropertyValue.hpp> -#ifndef _COM_SUN_STAR_SECURITY_DOCUMENTSIGNATURESINFORMATION_HPP_ #include <com/sun/star/security/DocumentSignatureInformation.hpp> -#endif #include <com/sun/star/security/XDocumentDigitalSignatures.hpp> #include <tools/zcodec.hxx> #include <tools/cachestr.hxx> @@ -85,7 +84,6 @@ #include <framework/interaction.hxx> #include <unotools/streamhelper.hxx> #include <unotools/localedatawrapper.hxx> -#ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> #endif #include <svl/stritem.hxx> @@ -147,8 +145,7 @@ using namespace ::com::sun::star::io; #include "openflag.hxx" // SFX_STREAM_READONLY etc. #include "sfx2/sfxresid.hxx" #include <sfx2/appuno.hxx> - -//#include "xmlversion.hxx" +#include "sfxacldetect.hxx" #define MAX_REDIRECT 5 @@ -1017,12 +1014,23 @@ sal_Int8 SfxMedium::ShowLockedDocumentDialog( const uno::Sequence< ::rtl::OUStri return nResult; } +namespace +{ + bool isSuitableProtocolForLocking(const String & rLogicName) + { + INetURLObject aUrl( rLogicName ); + INetProtocol eProt = aUrl.GetProtocol(); + return eProt == INET_PROT_FILE || eProt == INET_PROT_SFTP; + } +} + //------------------------------------------------------------------ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI ) { // returns true if the document can be opened for editing ( even if it should be a copy ) // otherwise the document should be opened readonly // if user cancel the loading the ERROR_ABORT is set + sal_Bool bResult = sal_False; if ( pImp->m_bLocked && bLoading && ::utl::LocalFileHelper::IsLocalFile( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ) ) { @@ -1035,10 +1043,12 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI ) if ( !bResult ) { - // no read-write access is necessary on loading if the document is explicitly opened as copy - SFX_ITEMSET_ARG( GetItemSet(), pTemplateItem, SfxBoolItem, SID_TEMPLATE, sal_False); - bResult = ( bLoading && pTemplateItem && pTemplateItem->GetValue() ); - } + if ( pImp->m_bLocked && bLoading && ::utl::LocalFileHelper::IsLocalFile( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ) ) + { + // if the document is already locked the system locking might be temporarely off after storing + // check whether the system file locking should be taken again + GetLockingStream_Impl(); + } if ( !bResult && !IsReadOnly() ) { @@ -1055,12 +1065,12 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI ) // the file is readonly only in case the read-write stream can not be opened if ( bLoading && !pImp->m_xLockingStream.is() ) { - try + sal_Bool bContentReadonly = sal_False; + if ( bLoading && ::utl::LocalFileHelper::IsLocalFile( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ) ) { - // MediaDescriptor does this check also, the duplication should be avoided in future - Reference< ::com::sun::star::ucb::XCommandEnvironment > xDummyEnv; - ::ucbhelper::Content aContent( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ), xDummyEnv ); - aContent.getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsReadOnly" ) ) ) >>= bContentReadonly; + // let the original document be opened to check the possibility to open it for editing + // and to let the writable stream stay open to hold the lock on the document + GetLockingStream_Impl(); } catch( uno::Exception ) {} @@ -1075,28 +1085,55 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI ) } } - // do further checks only if the file not readonly in fs - if ( !bContentReadonly ) - { - // the special file locking should be used only for file URLs - if ( ::utl::LocalFileHelper::IsLocalFile( aLogicName ) ) + // "IsReadOnly" property does not allow to detect whether the file is readonly always + // so we try always to open the file for editing + // the file is readonly only in case the read-write stream can not be opened + if ( bLoading && !pImp->m_xLockingStream.is() ) { + try + { + // MediaDescriptor does this check also, the duplication should be avoided in future + Reference< ::com::sun::star::ucb::XCommandEnvironment > xDummyEnv; + ::ucbhelper::Content aContent( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ), xDummyEnv ); + aContent.getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsReadOnly" ) ) ) >>= bContentReadonly; + } + catch( uno::Exception ) + {} - // in case of storing the document should request the output before locking - if ( bLoading ) +#if EXTRA_ACL_CHECK + // This block was introduced as a fix to i#102464, but removing + // this does not make the problem re-appear. But leaving this + // part would interfere with documents saved in samba share. This + // affects Windows only. + if ( !bContentReadonly ) { - // let the stream be opened to check the system file locking - GetMedium_Impl(); + // the file is not readonly, check the ACL + + String aPhysPath; + if ( ::utl::LocalFileHelper::ConvertURLToPhysicalName( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ), aPhysPath ) ) + bContentReadonly = IsReadonlyAccordingACL( aPhysPath.GetBuffer() ); } +#endif + } - sal_Int8 bUIStatus = LOCK_UI_NOLOCK; + // do further checks only if the file not readonly in fs + if ( !bContentReadonly ) + { + // the special file locking should be used only for suitable URLs + if ( isSuitableProtocolForLocking( aLogicName ) ) + { - // check whether system file locking has been used, the default value is false - sal_Bool bUseSystemLock = IsSystemFileLockingUsed(); + // in case of storing the document should request the output before locking + if ( bLoading ) + { + // let the stream be opened to check the system file locking + GetMedium_Impl(); + } - // TODO/LATER: This implementation does not allow to detect the system lock on saving here, actually this is no big problem - // if system lock is used the writeable stream should be available - sal_Bool bHandleSysLocked = ( bLoading && bUseSystemLock && !pImp->xStream.is() && !pOutStream ); + sal_Int8 bUIStatus = LOCK_UI_NOLOCK; + + // check whether system file locking has been used, the default value is false + sal_Bool bUseSystemLock = ::utl::LocalFileHelper::IsLocalFile( aLogicName ) && IsSystemFileLockingUsed(); do { @@ -1105,47 +1142,55 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI ) ::svt::DocumentLockFile aLockFile( aLogicName ); if ( !bHandleSysLocked ) { - try - { - bResult = aLockFile.CreateOwnLockFile(); - } - catch ( ucb::InteractiveIOException& e ) + ::svt::DocumentLockFile aLockFile( aLogicName ); + if ( !bHandleSysLocked ) { - // exception means that the lock file can not be successfuly accessed - // in this case it should be ignored if system file locking is anyway active - if ( bUseSystemLock || !IsOOoLockFileUsed() ) + try { - bResult = sal_True; - // take the ownership over the lock file - aLockFile.OverwriteOwnLockFile(); + bResult = aLockFile.CreateOwnLockFile(); } - else if ( e.Code == IOErrorCode_INVALID_PARAMETER ) + catch ( ucb::InteractiveIOException& e ) { // system file locking is not active, ask user whether he wants to open the document without any locking uno::Reference< task::XInteractionHandler > xHandler = GetInteractionHandler(); if ( xHandler.is() ) { - ::rtl::Reference< ::ucbhelper::InteractionRequest > xIgnoreRequestImpl - = new ::ucbhelper::InteractionRequest( uno::makeAny( document::LockFileIgnoreRequest() ) ); + // system file locking is not active, ask user whether he wants to open the document without any locking + uno::Reference< task::XInteractionHandler > xHandler = GetInteractionHandler(); - uno::Sequence< uno::Reference< task::XInteractionContinuation > > aContinuations( 2 ); - aContinuations[0] = new ::ucbhelper::InteractionAbort( xIgnoreRequestImpl.get() ); - aContinuations[1] = new ::ucbhelper::InteractionApprove( xIgnoreRequestImpl.get() ); - xIgnoreRequestImpl->setContinuations( aContinuations ); + if ( xHandler.is() ) + { + ::rtl::Reference< ::ucbhelper::InteractionRequest > xIgnoreRequestImpl + = new ::ucbhelper::InteractionRequest( uno::makeAny( document::LockFileIgnoreRequest() ) ); - xHandler->handle( xIgnoreRequestImpl.get() ); + uno::Sequence< uno::Reference< task::XInteractionContinuation > > aContinuations( 2 ); + aContinuations[0] = new ::ucbhelper::InteractionAbort( xIgnoreRequestImpl.get() ); + aContinuations[1] = new ::ucbhelper::InteractionApprove( xIgnoreRequestImpl.get() ); + xIgnoreRequestImpl->setContinuations( aContinuations ); - ::rtl::Reference< ::ucbhelper::InteractionContinuation > xSelected = xIgnoreRequestImpl->getSelection(); - bResult = ( uno::Reference< task::XInteractionApprove >( xSelected.get(), uno::UNO_QUERY ).is() ); + xHandler->handle( xIgnoreRequestImpl.get() ); + + ::rtl::Reference< ::ucbhelper::InteractionContinuation > xSelected = xIgnoreRequestImpl->getSelection(); + bResult = ( uno::Reference< task::XInteractionApprove >( xSelected.get(), uno::UNO_QUERY ).is() ); + } } } - } - catch ( uno::Exception& ) - { - // exception means that the lock file can not be successfuly accessed - // in this case it should be ignored if system file locking is anyway active - if ( bUseSystemLock || !IsOOoLockFileUsed() ) + catch ( uno::Exception& ) + { + // exception means that the lock file can not be successfuly accessed + // in this case it should be ignored if system file locking is anyway active + if ( bUseSystemLock || !IsOOoLockFileUsed() ) + { + bResult = sal_True; + // take the ownership over the lock file + aLockFile.OverwriteOwnLockFile(); + } + } + + // in case OOo locking is turned off the lock file is still written if possible + // but it is ignored while deciding whether the document should be opened for editing or not + if ( !bResult && !IsOOoLockFileUsed() ) { bResult = sal_True; // take the ownership over the lock file @@ -1153,15 +1198,6 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI ) } } - // in case OOo locking is turned off the lock file is still written if possible - // but it is ignored while deciding whether the document should be opened for editing or not - if ( !bResult && !IsOOoLockFileUsed() ) - { - bResult = sal_True; - // take the ownership over the lock file - aLockFile.OverwriteOwnLockFile(); - } - } if ( !bResult ) @@ -1169,12 +1205,15 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI ) uno::Sequence< ::rtl::OUString > aData; try { - // impossibility to get data is no real problem - aData = aLockFile.GetLockData(); - } - catch( uno::Exception ) {} + uno::Sequence< ::rtl::OUString > aData; + try + { + // impossibility to get data is no real problem + aData = aLockFile.GetLockData(); + } + catch( uno::Exception ) {} - sal_Bool bOwnLock = sal_False; + sal_Bool bOwnLock = sal_False; if ( !bHandleSysLocked ) { @@ -1187,40 +1226,65 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI ) && aOwnData[LOCKFILE_LOCALHOST_ID].equals( aData[LOCKFILE_LOCALHOST_ID] ) && aOwnData[LOCKFILE_USERURL_ID].equals( aData[LOCKFILE_USERURL_ID] ) ) { - // this is own lock from the same installation, it could remain because of crash - bResult = sal_True; + uno::Sequence< ::rtl::OUString > aOwnData = aLockFile.GenerateOwnEntry(); + bOwnLock = ( aData.getLength() > LOCKFILE_USERURL_ID + && aOwnData.getLength() > LOCKFILE_USERURL_ID + && aOwnData[LOCKFILE_SYSUSERNAME_ID].equals( aData[LOCKFILE_SYSUSERNAME_ID] ) ); + + if ( bOwnLock + && aOwnData[LOCKFILE_LOCALHOST_ID].equals( aData[LOCKFILE_LOCALHOST_ID] ) + && aOwnData[LOCKFILE_USERURL_ID].equals( aData[LOCKFILE_USERURL_ID] ) ) + { + // this is own lock from the same installation, it could remain because of crash + bResult = sal_True; + } } - } - if ( !bResult && !bNoUI ) - { - bUIStatus = ShowLockedDocumentDialog( aData, bLoading, bOwnLock ); - if ( bUIStatus == LOCK_UI_SUCCEEDED ) + if ( !bResult && !bNoUI ) { - // take the ownership over the lock file - bResult = aLockFile.OverwriteOwnLockFile(); + bUIStatus = ShowLockedDocumentDialog( aData, bLoading, bOwnLock ); + if ( bUIStatus == LOCK_UI_SUCCEEDED ) + { + // take the ownership over the lock file + bResult = aLockFile.OverwriteOwnLockFile(); + } } - } - bHandleSysLocked = sal_False; + bHandleSysLocked = sal_False; + } } - } - catch( uno::Exception& ) - { - } - } while( !bResult && bUIStatus == LOCK_UI_TRY ); + catch( uno::Exception& ) + { + } + } while( !bResult && bUIStatus == LOCK_UI_TRY ); - pImp->m_bLocked = bResult; + pImp->m_bLocked = bResult; + } + else + { + // this is no file URL, check whether the file is readonly + bResult = !bContentReadonly; + } } + } + + if ( !bResult && GetError() == ERRCODE_NONE ) + { + // the error should be set in case it is storing process + // or the document has been opened for editing explicitly + + SFX_ITEMSET_ARG( pSet, pReadOnlyItem, SfxBoolItem, SID_DOC_READONLY, FALSE ); + if ( !bLoading || (pReadOnlyItem && !pReadOnlyItem->GetValue()) ) + SetError( ERRCODE_IO_ACCESSDENIED, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); else - { - // this is no file URL, check whether the file is readonly - bResult = !bContentReadonly; - } + GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, sal_True ) ); } - } - if ( !bResult && GetError() == ERRCODE_NONE ) + // when the file is locked, get the current file date + if ( bResult && DocNeedsFileDateCheck() ) + GetInitFileDate( sal_True ); + } + catch( uno::Exception& ) { // the error should be set in case it is storing process // or the document has been opened for editing explicitly @@ -1231,11 +1295,6 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI ) else GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, sal_True ) ); } - - // when the file is locked, get the current file date - if ( bResult && DocNeedsFileDateCheck() ) - GetInitFileDate( sal_True ); - return bResult; } @@ -1275,9 +1334,9 @@ uno::Reference < embed::XStorage > SfxMedium::GetStorage( sal_Bool bCreateTempIf new utl::ProgressHandlerWrap( xStatusIndicator ) ); uno::Sequence< beans::PropertyValue > aAddProps( 2 ); - aAddProps[0].Name = ::rtl::OUString::createFromAscii( "RepairPackage" ); + aAddProps[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RepairPackage")); aAddProps[0].Value <<= (sal_Bool)sal_True; - aAddProps[1].Name = ::rtl::OUString::createFromAscii( "StatusIndicator" ); + aAddProps[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StatusIndicator")); aAddProps[1].Value <<= xProgressHandler; // the first arguments will be filled later @@ -1659,7 +1718,7 @@ sal_Bool SfxMedium::TransactedTransferForFS_Impl( const INetURLObject& aSource, { Reference< XInputStream > aTempInput = aTempCont.openStream(); bTransactStarted = sal_True; - aOriginalContent.setPropertyValue( ::rtl::OUString::createFromAscii( "Size" ), + aOriginalContent.setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Size")), uno::makeAny( (sal_Int64)0 ) ); aOriginalContent.writeStream( aTempInput, bOverWrite ); bResult = sal_True; @@ -2346,7 +2405,8 @@ void SfxMedium::GetMedium_Impl() pImp->bDownloadDone = sal_True; pImp->aDoneLink.ClearPendingCall(); - pImp->aDoneLink.Call( (void*) GetError() ); + sal_uIntPtr nError = GetError(); + pImp->aDoneLink.Call( (void*)nError ); } } @@ -2784,18 +2844,6 @@ void SfxMedium::CloseStreams_Impl() void SfxMedium::RefreshName_Impl() { -#if 0 //(dv) - if ( pImp->aContent.get().is() ) - { - String aNameP = pImp->xAnchor->GetViewURL(); - pImp->aOrigURL = aNameP; - aLogicName = aNameP; - DELETEZ( pURLObj ); - if (aLogicName.Len()) - aLogicName = GetURLObject().GetMainURL( INetURLObject::NO_DECODE ); - SetIsRemote_Impl(); - } -#endif //(dv) } void SfxMedium::SetIsRemote_Impl() @@ -2967,12 +3015,10 @@ SfxMedium::SfxMedium( const ::com::sun::star::uno::Sequence< ::com::sun::star::b aFilterName = pFilterNameItem->GetValue(); pFilter = SFX_APP()->GetFilterMatcher().GetFilter4FilterName( aFilterName ); - sal_Bool bSalvage = sal_False; SFX_ITEMSET_ARG( pSet, pSalvageItem, SfxStringItem, SID_DOC_SALVAGE, sal_False ); if( pSalvageItem ) { // QUESTION: there is some treatment of Salvage in Init_Impl; align! - bSalvage = sal_True; if ( pSalvageItem->GetValue().Len() ) { // if an URL is provided in SalvageItem that means that the FileName refers to a temporary file @@ -3095,39 +3141,6 @@ const String& SfxMedium::GetPreRedirectedURL() const { return pImp->aPreRedirectionURL; } -//---------------------------------------------------------------- - -sal_uInt32 SfxMedium::GetMIMEAndRedirect( String& /*rName*/ ) -{ -/* dv !!!! not needed any longer ? - INetProtocol eProt = GetURLObject().GetProtocol(); - if( eProt == INET_PROT_FTP && SvBinding::ShouldUseFtpProxy( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ) ) - { - Any aAny( UCB_Helper::GetProperty( GetContent(), WID_FLAG_IS_FOLDER ) ); - sal_Bool bIsFolder = FALSE; - if ( ( aAny >>= bIsFolder ) && bIsFolder ) - return ERRCODE_NONE; - } - - GetMedium_Impl(); - if( !eError && pImp->xBinding.Is() ) - { - eError = pImp->xBinding->GetMimeType( rName ); - - // Wir koennen keine Parameter wie CharSets usw. - rName = rName.GetToken( 0, ';' ); - if( !eError ) - { - if( !pImp->aPreRedirectionURL.Len() ) - pImp->aPreRedirectionURL = aLogicName; - SetName( pImp->xBinding->GetRedirectedURL() ); - } - pImp->aExpireTime = pImp->xBinding->GetExpireDateTime(); - } - return eError; -*/ - return 0; -} //---------------------------------------------------------------- @@ -3207,11 +3220,11 @@ SvKeyValueIterator* SfxMedium::GetHeaderAttributes_Impl() try { - Any aAny = pImp->aContent.getPropertyValue( ::rtl::OUString::createFromAscii( "MediaType" ) ); + Any aAny = pImp->aContent.getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")) ); ::rtl::OUString aContentType; aAny >>= aContentType; - pImp->xAttributes->Append( SvKeyValue( ::rtl::OUString::createFromAscii( "content-type" ), aContentType ) ); + pImp->xAttributes->Append( SvKeyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("content-type")), aContentType ) ); } catch ( ::com::sun::star::uno::Exception& ) { @@ -3247,7 +3260,7 @@ const uno::Sequence < util::RevisionTag >& SfxMedium::GetVersionList( bool _bNoR ( aName.Len() || aLogicName.Len() ) && GetStorage().is() ) { uno::Reference < document::XDocumentRevisionListPersistence > xReader( comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString::createFromAscii("com.sun.star.document.DocumentRevisionListPersistence") ), uno::UNO_QUERY ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.DocumentRevisionListPersistence")) ), uno::UNO_QUERY ); if ( xReader.is() ) { try @@ -3269,7 +3282,7 @@ const uno::Sequence < util::RevisionTag >& SfxMedium::GetVersionList( bool _bNoR uno::Sequence < util::RevisionTag > SfxMedium::GetVersionList( const uno::Reference < embed::XStorage >& xStorage ) { uno::Reference < document::XDocumentRevisionListPersistence > xReader( comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString::createFromAscii("com.sun.star.document.DocumentRevisionListPersistence") ), uno::UNO_QUERY ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.DocumentRevisionListPersistence")) ), uno::UNO_QUERY ); if ( xReader.is() ) { try @@ -3357,7 +3370,7 @@ sal_Bool SfxMedium::SaveVersionList_Impl( sal_Bool /*bUseXML*/ ) return sal_True; uno::Reference < document::XDocumentRevisionListPersistence > xWriter( comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString::createFromAscii("com.sun.star.document.DocumentRevisionListPersistence") ), uno::UNO_QUERY ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.DocumentRevisionListPersistence")) ), uno::UNO_QUERY ); if ( xWriter.is() ) { try @@ -3563,7 +3576,7 @@ void SfxMedium::CreateTempFileNoCopy() try { - Any aAny = pImp->aContent.getPropertyValue( ::rtl::OUString::createFromAscii( "MediaType" ) ); + Any aAny = pImp->aContent.getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")) ); ::rtl::OUString aField; aAny >>= aField; @@ -3932,3 +3945,4 @@ sal_Bool SfxMedium::SwitchDocumentToFile( ::rtl::OUString aURL ) return bResult; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/docfilt.cxx b/sfx2/source/doc/docfilt.cxx index 202140a15b..76c87d5c44 100644 --- a/sfx2/source/doc/docfilt.cxx +++ b/sfx2/source/doc/docfilt.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -196,7 +197,7 @@ String SfxFilter::GetTypeFromStorage( const com::sun::star::uno::Reference< com: if ( xProps.is() ) { ::rtl::OUString aMediaType; - xProps->getPropertyValue( ::rtl::OUString::createFromAscii( "MediaType" ) ) >>= aMediaType; + xProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")) ) >>= aMediaType; if ( aMediaType.getLength() ) { ::com::sun::star::datatransfer::DataFlavor aDataFlavor; @@ -249,3 +250,5 @@ String SfxFilter::GetTypeFromStorage( const com::sun::star::uno::Reference< com: return aRet; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/docinf.cxx b/sfx2/source/doc/docinf.cxx index 15f231795e..27100eb4b6 100644 --- a/sfx2/source/doc/docinf.cxx +++ b/sfx2/source/doc/docinf.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,6 +35,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XPropertyContainer.hpp> #include <com/sun/star/document/XDocumentProperties.hpp> +#include <com/sun/star/document/XCompatWriterDocProperties.hpp> #include <com/sun/star/uno/Exception.hpp> #include <rtl/ustring.hxx> @@ -43,7 +45,6 @@ #include <vcl/gdimtf.hxx> #include "oleprops.hxx" - // ============================================================================ // stream names @@ -172,6 +173,28 @@ sal_uInt32 SFX2_DLLPUBLIC LoadOlePropertySet( } } + uno::Reference< document::XCompatWriterDocProperties > xWriterProps( i_xDocProps, uno::UNO_QUERY ); + if ( xWriterProps.is() ) + { + SfxOleSectionRef xBuiltin = aDocSet.GetSection( SECTION_BUILTIN ); + if ( xBuiltin.get() ) + { + try + { + String aStrValue; + if ( xBuiltin->GetStringValue( aStrValue, PROPID_MANAGER ) ) + xWriterProps->setManager( aStrValue ); + if ( xBuiltin->GetStringValue( aStrValue, PROPID_CATEGORY ) ) + xWriterProps->setCategory( aStrValue ); + if ( xBuiltin->GetStringValue( aStrValue, PROPID_COMPANY ) ) + xWriterProps->setCompany( aStrValue ); + } + catch ( uno::Exception& ) + { + } + } + } + // return code return (nGlobError != ERRCODE_NONE) ? nGlobError : nDocError; } @@ -239,7 +262,7 @@ bool SFX2_DLLPUBLIC SaveOlePropertySet( const sal_Int32 nPropId = rCustomSect.GetFreePropertyId(); rCustomSect.SetBlobValue( nPropId, *i_pGuid ); rCustomSect.SetPropertyName( nPropId, - ::rtl::OUString::createFromAscii("_PID_GUID") ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_PID_GUID")) ); } // write hyperlinks @@ -247,7 +270,7 @@ bool SFX2_DLLPUBLIC SaveOlePropertySet( const sal_Int32 nPropId = rCustomSect.GetFreePropertyId(); rCustomSect.SetBlobValue( nPropId, *i_pHyperlinks ); rCustomSect.SetPropertyName( nPropId, - ::rtl::OUString::createFromAscii("_PID_HLINKS") ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_PID_HLINKS")) ); } uno::Reference<beans::XPropertySet> xUserDefinedProps( @@ -307,3 +330,4 @@ uno::Sequence<sal_uInt8> SFX2_DLLPUBLIC convertMetaFile(GDIMetaFile* i_pThumb) } // namespace sfx2 +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/docinsert.cxx b/sfx2/source/doc/docinsert.cxx index d1ad2aab83..ab50b681ce 100644 --- a/sfx2/source/doc/docinsert.cxx +++ b/sfx2/source/doc/docinsert.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -161,7 +162,7 @@ SfxMediumList* DocumentInserter::CreateMediumList() DELETEZ( pMedium ); if( pMedium && CheckPasswd_Impl( 0, SFX_APP()->GetPool(), pMedium ) != ERRCODE_ABORT ) - pMediumList->Insert( pMedium ); + pMediumList->push_back( pMedium ); else delete pMedium; } @@ -303,3 +304,4 @@ IMPL_LINK( DocumentInserter, DialogClosedHdl, sfx2::FileDialogHelper*, EMPTYARG // ======================================================================= +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx index 613d90cb17..e532cc0667 100644 --- a/sfx2/source/doc/docmacromode.cxx +++ b/sfx2/source/doc/docmacromode.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -38,6 +39,8 @@ #include <com/sun/star/task/DocumentMacroConfirmationRequest.hpp> #include <com/sun/star/task/InteractionClassification.hpp> #include <com/sun/star/security/XDocumentDigitalSignatures.hpp> +#include <com/sun/star/script/XLibraryQueryExecutable.hpp> +#include <com/sun/star/script/vba/XVBACompatibility.hpp> /** === end UNO includes === **/ #include <comphelper/componentcontext.hxx> @@ -73,8 +76,11 @@ namespace sfx2 using ::com::sun::star::document::XEmbeddedScripts; using ::com::sun::star::uno::UNO_SET_THROW; using ::com::sun::star::script::XLibraryContainer; + using ::com::sun::star::script::XLibraryQueryExecutable; + using ::com::sun::star::script::vba::XVBACompatibility; using ::com::sun::star::container::XNameAccess; using ::com::sun::star::uno::UNO_QUERY_THROW; + using ::com::sun::star::uno::UNO_QUERY; /** === end UNO using === **/ namespace MacroExecMode = ::com::sun::star::document::MacroExecMode; @@ -336,6 +342,8 @@ namespace sfx2 if ( xScripts.is() ) xContainer.set( xScripts->getBasicLibraries(), UNO_QUERY_THROW ); + Reference< XVBACompatibility > xDocVBAMode( xContainer, UNO_QUERY ); + sal_Bool bIsVBAMode = ( xDocVBAMode.is() && xDocVBAMode->getVBACompatibilityMode() ); if ( xContainer.is() ) { // a library container exists; check if it's empty @@ -348,25 +356,47 @@ namespace sfx2 { ::rtl::OUString aStdLibName( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) ); Sequence< ::rtl::OUString > aElements = xContainer->getElementNames(); - if ( aElements.getLength() ) + sal_Int32 nElementCount = aElements.getLength(); + if ( nElementCount ) { - if ( aElements.getLength() > 1 || !aElements[0].equals( aStdLibName ) ) + // old check, if more than 1 library or the first library isn't the expected 'Standard' + // trigger the security 'nag' dialog + if ( !bIsVBAMode && ( nElementCount > 1 || !aElements[0].equals( aStdLibName ) ) ) bHasMacroLib = sal_True; else { - // usually a "Standard" library is always present (design) - // for this reason we must check if it's empty - // - // Note: Since #i73229#, this is not true anymore. There's no default - // "Standard" lib anymore. Wouldn't it be time to get completely - // rid of the "Standard" thingie - this shouldn't be necessary - // anymore, should it? - // 2007-01-25 / frank.schoenheit@sun.com - Reference < XNameAccess > xLib; - Any aAny = xContainer->getByName( aStdLibName ); - aAny >>= xLib; + // other wise just check all libraries for executeable code + Reference< XLibraryQueryExecutable > xLib( xContainer, UNO_QUERY ); if ( xLib.is() ) - bHasMacroLib = xLib->hasElements(); + { + const ::rtl::OUString* pElementName = aElements.getConstArray(); + for ( sal_Int32 index = 0; index < nElementCount; ++index ) + { + bHasMacroLib = xLib->HasExecutableCode( pElementName[index] ); + if ( bHasMacroLib ) + break; + } + } + } + } + } + } + if ( bIsVBAMode && !bHasMacroLib && xScripts.is() ) + { + Reference< XLibraryContainer > xDlgContainer( xScripts->getDialogLibraries(), UNO_QUERY ); + if ( xDlgContainer.is() && xDlgContainer->hasElements() ) + { + Sequence< ::rtl::OUString > aElements = xDlgContainer->getElementNames(); + sal_Int32 nElementCount = aElements.getLength(); + const ::rtl::OUString* pElementName = aElements.getConstArray(); + for ( sal_Int32 index = 0; index < nElementCount; ++index ) + { + Reference< XNameAccess > xNameAccess; + xDlgContainer->getByName( pElementName[index] ) >>= xNameAccess; + if ( xNameAccess.is() && xNameAccess->hasElements() ) + { + bHasMacroLib = sal_True; + break; } } } @@ -434,3 +464,5 @@ namespace sfx2 //........................................................................ } // namespace sfx2 //........................................................................ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/docstoragemodifylistener.cxx b/sfx2/source/doc/docstoragemodifylistener.cxx index a1b3eb9393..1da9832a4f 100644 --- a/sfx2/source/doc/docstoragemodifylistener.cxx +++ b/sfx2/source/doc/docstoragemodifylistener.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,7 +30,7 @@ #include "precompiled_sfx2.hxx" #include "sfx2/docstoragemodifylistener.hxx" -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> /** === begin UNO includes === **/ /** === end UNO includes === **/ @@ -56,7 +57,7 @@ namespace sfx2 //= //==================================================================== //-------------------------------------------------------------------- - DocumentStorageModifyListener::DocumentStorageModifyListener( IModifiableDocument& _rDocument, ::vos::IMutex& _rMutex ) + DocumentStorageModifyListener::DocumentStorageModifyListener( IModifiableDocument& _rDocument, ::osl::SolarMutex& _rMutex ) :m_pDocument( &_rDocument ) ,m_rMutex( _rMutex ) { @@ -70,14 +71,14 @@ namespace sfx2 //-------------------------------------------------------------------- void DocumentStorageModifyListener::dispose() { - ::vos::OGuard aGuard( m_rMutex ); + ::osl::SolarGuard aGuard( m_rMutex ); m_pDocument = NULL; } //-------------------------------------------------------------------- void SAL_CALL DocumentStorageModifyListener::modified( const EventObject& /*aEvent*/ ) throw (RuntimeException) { - ::vos::OGuard aGuard( m_rMutex ); + ::osl::SolarGuard aGuard( m_rMutex ); // storageIsModified must not contain any locking! if ( m_pDocument ) m_pDocument->storageIsModified(); @@ -94,3 +95,5 @@ namespace sfx2 //........................................................................ } // namespace sfx2 //........................................................................ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/doctdlg.cxx b/sfx2/source/doc/doctdlg.cxx index 45804246bf..ef9868ce23 100644 --- a/sfx2/source/doc/doctdlg.cxx +++ b/sfx2/source/doc/doctdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,7 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" -#ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> #endif #include <svl/stritem.hxx> @@ -236,3 +236,4 @@ void SfxDocumentTemplateDlg::NewTemplate(const String &rPath) aRegionLb.GetSelectEntryPos(), GetTemplateName(), rPath); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx index f92eabd321..8ffc459e12 100644 --- a/sfx2/source/doc/doctempl.cxx +++ b/sfx2/source/doc/doctempl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,12 +31,10 @@ #include <limits.h> #include <com/sun/star/uno/Any.h> -#include <vos/mutex.hxx> -#include <vos/thread.hxx> +#include <osl/mutex.hxx> +#include <osl/thread.hxx> -#ifndef _SV_RESARY_HXX #include <tools/resary.hxx> -#endif #include <vcl/svapp.hxx> #include <vcl/settings.hxx> #include <unotools/localedatawrapper.hxx> @@ -102,6 +101,10 @@ using namespace ::ucbhelper; #include <comphelper/storagehelper.hxx> #include <unotools/ucbhelper.hxx> +#include <vector> +using ::std::vector; +using ::std::advance; + //======================================================================== // #define DONT_USE_HIERARCHY @@ -122,8 +125,6 @@ using namespace ::ucbhelper; #define SERVICENAME_TYPEDETECTION "com.sun.star.document.TypeDetection" #define TYPEDETECTION_PARAMETER "FileName" -//#define SERVICENAME_OLD_TYPEDETECTION "com.sun.star.frame.FrameLoaderFactory" -//#define PARAMETER_OLD_TYPEDETECTION "DeepDetection" #define SERVICENAME_DOCINFO "com.sun.star.document.DocumentProperties" #define SERVICENAME_DOCTEMPLATES "com.sun.star.frame.DocumentTemplates" #define SERVICENAME_DESKTOP "com.sun.star.frame.Desktop" @@ -177,15 +178,14 @@ using namespace ::DocTempl; class RegionData_Impl { - DECLARE_LIST( EntryList_Impl, DocTempl_EntryData_Impl* ) const SfxDocTemplate_Impl* mpParent; - EntryList_Impl maEntries; + vector< DocTempl_EntryData_Impl* > maEntries; OUString maTitle; OUString maOwnURL; OUString maTargetURL; private: - long GetEntryPos( const OUString& rTitle, + size_t GetEntryPos( const OUString& rTitle, sal_Bool& rFound ) const; const SfxDocTemplate_Impl* GetParent() const { return mpParent; } @@ -197,7 +197,7 @@ public: void SetTargetURL( const OUString& rURL ) { maTargetURL = rURL; } void SetHierarchyURL( const OUString& rURL) { maOwnURL = rURL; } - DocTempl_EntryData_Impl* GetEntry( ULONG nIndex ) const; + DocTempl_EntryData_Impl* GetEntry( size_t nIndex ) const; DocTempl_EntryData_Impl* GetEntry( const OUString& rName ) const; DocTempl_EntryData_Impl* GetByTargetURL( const OUString& rName ) const; @@ -205,21 +205,21 @@ public: const OUString& GetTargetURL(); const OUString& GetHierarchyURL(); - ULONG GetCount() const; + size_t GetCount() const; void SetTitle( const OUString& rTitle ) { maTitle = rTitle; } void AddEntry( const OUString& rTitle, const OUString& rTargetURL, - USHORT *pPos = NULL ); - void DeleteEntry( ULONG nIndex ); + size_t *pPos = NULL ); + void DeleteEntry( size_t nIndex ); int Compare( const OUString& rTitle ) const { return maTitle.compareTo( rTitle ); } int Compare( RegionData_Impl* pCompareWith ) const; }; -DECLARE_LIST( RegionList_Impl, RegionData_Impl* ) +typedef vector< RegionData_Impl* > RegionList_Impl; // ------------------------------------------------------------------------ @@ -258,21 +258,20 @@ public: void Rescan(); - void DeleteRegion( ULONG nIndex ); + void DeleteRegion( size_t nIndex ); - ULONG GetRegionCount() const - { return maRegions.Count(); } + size_t GetRegionCount() const + { return maRegions.size(); } RegionData_Impl* GetRegion( const OUString& rName ) const; - RegionData_Impl* GetRegion( ULONG nIndex ) const; + RegionData_Impl* GetRegion( size_t nIndex ) const; void GetTemplates( Content& rTargetFolder, Content& rParentFolder, RegionData_Impl* pRegion ); - long GetRegionPos( const OUString& rTitle, - sal_Bool& rFound ) const; + size_t GetRegionPos( const OUString& rTitle, sal_Bool& rFound ) const; sal_Bool GetTitleFromURL( const OUString& rURL, OUString& aTitle ); - sal_Bool InsertRegion( RegionData_Impl *pData, ULONG nPos = LIST_APPEND ); + sal_Bool InsertRegion( RegionData_Impl *pData, size_t nPos = size_t(-1) ); OUString GetRootURL() const { return maRootURL; } uno::Reference< XDocumentTemplates > getDocTemplates() { return mxTemplates; } @@ -416,7 +415,7 @@ USHORT SfxDocumentTemplates::GetRegionNo return USHRT_MAX; sal_Bool bFound; - ULONG nIndex = pImp->GetRegionPos( rRegion, bFound ); + size_t nIndex = pImp->GetRegionPos( rRegion, bFound ); if ( bFound ) return (USHORT) nIndex; @@ -937,21 +936,6 @@ sal_Bool SfxDocumentTemplates::CopyOrMove { DBG_ERRORFILE( "Don't know, what to do!" ); return sal_False; -#if 0 - // Verschieben einer Vorlage innerhalb eines Bereiches - // --> nur Verwaltungsdaten aktualisieren - if ( bMove && nTargetRegion == nSourceRegion ) - { - if(nTargetIdx == USHRT_MAX) - nTargetIdx = 0; - const SfxTemplateDirEntryPtr pEntry = rTargetDir[nSourceIdx]; - rTargetDir.Insert(pEntry, nTargetIdx); - if(nTargetIdx < nSourceIdx) - ++nSourceIdx; - rTargetDir.Remove(nSourceIdx); - return SaveDir(rTargetDir); - } -#endif } RegionData_Impl *pSourceRgn = pImp->GetRegion( nSourceRegion ); @@ -999,7 +983,9 @@ sal_Bool SfxDocumentTemplates::CopyOrMove } } - pTargetRgn->AddEntry( aTitle, aNewTargetURL, &nTargetIdx ); + // todo: fix SfxDocumentTemplates to handle size_t instead of USHORT + size_t temp_nTargetIdx = nTargetIdx; + pTargetRgn->AddEntry( aTitle, aNewTargetURL, &temp_nTargetIdx ); return sal_True; } @@ -1220,7 +1206,7 @@ sal_Bool SfxDocumentTemplates::CopyFrom UNO_QUERY ); Sequence< PropertyValue > aArgs( 1 ); - aArgs[0].Name = ::rtl::OUString::createFromAscii("Hidden"); + aArgs[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Hidden")); aArgs[0].Value <<= sal_True; INetURLObject aTemplURL( rName ); @@ -1230,7 +1216,7 @@ sal_Bool SfxDocumentTemplates::CopyFrom { xStorable = uno::Reference< XStorable >( xDesktop->loadComponentFromURL( aTemplURL.GetMainURL(INetURLObject::NO_DECODE), - OUString::createFromAscii( "_blank" ), + OUString(RTL_CONSTASCII_USTRINGPARAM("_blank")), 0, aArgs ), UNO_QUERY ); @@ -1291,7 +1277,9 @@ sal_Bool SfxDocumentTemplates::CopyFrom else nIdx += 1; - pTargetRgn->AddEntry( aTitle, aTemplName, &nIdx ); + // todo: fix SfxDocumentTemplates to handle size_t instead of USHORT + size_t temp_nIdx = nIdx; + pTargetRgn->AddEntry( aTitle, aTemplName, &temp_nIdx ); rName = aTitle; return sal_True; } @@ -2058,26 +2046,21 @@ RegionData_Impl::RegionData_Impl( const SfxDocTemplate_Impl* pParent, // ----------------------------------------------------------------------- RegionData_Impl::~RegionData_Impl() { - DocTempl_EntryData_Impl *pData = maEntries.First(); - - while ( pData ) - { - delete pData; - pData = maEntries.Next(); - } + for ( size_t i = 0, n = maEntries.size(); i < n; ++i ) + delete maEntries[ i ]; + maEntries.clear(); } // ----------------------------------------------------------------------- -long RegionData_Impl::GetEntryPos( const OUString& rTitle, - sal_Bool& rFound ) const +size_t RegionData_Impl::GetEntryPos( const OUString& rTitle, sal_Bool& rFound ) const { #if 1 // Don't use binary search today - ULONG i; - ULONG nCount = maEntries.Count(); + size_t i; + size_t nCount = maEntries.size(); for ( i=0; i<nCount; i++ ) { - DocTempl_EntryData_Impl *pData = maEntries.GetObject( i ); + DocTempl_EntryData_Impl *pData = maEntries[ i ]; if ( pData->Compare( rTitle ) == 0 ) { @@ -2094,9 +2077,9 @@ long RegionData_Impl::GetEntryPos( const OUString& rTitle, // in the maEntries list int nCompVal = 1; - long nStart = 0; - long nEnd = maEntries.Count() - 1; - long nMid; + size_t nStart = 0; + size_t nEnd = maEntries.size() - 1; + size_t nMid; DocTempl_EntryData_Impl* pMid; @@ -2105,7 +2088,7 @@ long RegionData_Impl::GetEntryPos( const OUString& rTitle, while ( nCompVal && ( nStart <= nEnd ) ) { nMid = ( nEnd - nStart ) / 2 + nStart; - pMid = maEntries.GetObject( nMid ); + pMid = maEntries[ nMid ]; nCompVal = pMid->Compare( rTitle ); @@ -2132,7 +2115,7 @@ long RegionData_Impl::GetEntryPos( const OUString& rTitle, // ----------------------------------------------------------------------- void RegionData_Impl::AddEntry( const OUString& rTitle, const OUString& rTargetURL, - USHORT *pPos ) + size_t *pPos ) { INetURLObject aLinkObj( GetHierarchyURL() ); aLinkObj.insertName( rTitle, false, @@ -2140,13 +2123,13 @@ void RegionData_Impl::AddEntry( const OUString& rTitle, INetURLObject::ENCODE_ALL ); OUString aLinkURL = aLinkObj.GetMainURL( INetURLObject::NO_DECODE ); - DocTempl_EntryData_Impl *pEntry; + DocTempl_EntryData_Impl* pEntry; sal_Bool bFound = sal_False; - long nPos = GetEntryPos( rTitle, bFound ); + size_t nPos = GetEntryPos( rTitle, bFound ); if ( bFound ) { - pEntry = maEntries.GetObject( nPos ); + pEntry = maEntries[ nPos ]; } else { @@ -2156,14 +2139,20 @@ void RegionData_Impl::AddEntry( const OUString& rTitle, pEntry = new DocTempl_EntryData_Impl( this, rTitle ); pEntry->SetTargetURL( rTargetURL ); pEntry->SetHierarchyURL( aLinkURL ); - maEntries.Insert( pEntry, nPos ); + if ( nPos < maEntries.size() ) { + vector< DocTempl_EntryData_Impl* >::iterator it = maEntries.begin(); + advance( it, nPos ); + maEntries.insert( it, pEntry ); + } + else + maEntries.push_back( pEntry ); } } // ----------------------------------------------------------------------- -ULONG RegionData_Impl::GetCount() const +size_t RegionData_Impl::GetCount() const { - return maEntries.Count(); + return maEntries.size(); } // ----------------------------------------------------------------------- @@ -2197,9 +2186,8 @@ const OUString& RegionData_Impl::GetTargetURL() OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( TARGET_DIR_URL ) ); getTextProperty_Impl( aRegion, aPropName, maTargetURL ); - // --> PB 2004-10-27 #i32656# - the targeturl must be substituted: $(baseinsturl) + // The targeturl must be substituted: $(baseinsturl) (#i32656#) maTargetURL = SvtPathOptions().SubstituteVariable( maTargetURL ); - // <-- } else { @@ -2217,7 +2205,7 @@ DocTempl_EntryData_Impl* RegionData_Impl::GetEntry( const OUString& rName ) cons long nPos = GetEntryPos( rName, bFound ); if ( bFound ) - return maEntries.GetObject( nPos ); + return maEntries[ nPos ]; else return NULL; } @@ -2225,35 +2213,32 @@ DocTempl_EntryData_Impl* RegionData_Impl::GetEntry( const OUString& rName ) cons // ----------------------------------------------------------------------- DocTempl_EntryData_Impl* RegionData_Impl::GetByTargetURL( const OUString& rName ) const { - DocTempl_EntryData_Impl *pEntry; - - ULONG nCount = maEntries.Count(); - - for ( ULONG i=0; i<nCount; i++ ) + for ( size_t i = 0, n = maEntries.size(); i < n; ++i ) { - pEntry = maEntries.GetObject( i ); - if ( pEntry && ( pEntry->GetTargetURL() == rName ) ) + DocTempl_EntryData_Impl *pEntry = maEntries[ i ]; + if ( pEntry->GetTargetURL() == rName ) return pEntry; } - return NULL; } // ----------------------------------------------------------------------- -DocTempl_EntryData_Impl* RegionData_Impl::GetEntry( ULONG nIndex ) const +DocTempl_EntryData_Impl* RegionData_Impl::GetEntry( size_t nIndex ) const { - return maEntries.GetObject( nIndex ); + if ( nIndex < maEntries.size() ) + return maEntries[ nIndex ]; + return NULL; } // ----------------------------------------------------------------------- -void RegionData_Impl::DeleteEntry( ULONG nIndex ) +void RegionData_Impl::DeleteEntry( size_t nIndex ) { - DocTempl_EntryData_Impl *pEntry = maEntries.GetObject( nIndex ); - - if ( pEntry ) + if ( nIndex < maEntries.size() ) { - delete pEntry; - maEntries.Remove( (ULONG) nIndex ); + delete maEntries[ nIndex ]; + vector< DocTempl_EntryData_Impl*>::iterator it = maEntries.begin(); + advance( it, nIndex ); + maEntries.erase( it ); } } @@ -2299,38 +2284,35 @@ void SfxDocTemplate_Impl::DecrementLock() } // ----------------------------------------------------------------------- -RegionData_Impl* SfxDocTemplate_Impl::GetRegion( ULONG nIndex ) const +RegionData_Impl* SfxDocTemplate_Impl::GetRegion( size_t nIndex ) const { - return maRegions.GetObject( nIndex ); + if ( nIndex < maRegions.size() ) + return maRegions[ nIndex ]; + return NULL; } // ----------------------------------------------------------------------- RegionData_Impl* SfxDocTemplate_Impl::GetRegion( const OUString& rName ) const { - ULONG nCount = maRegions.Count(); - RegionData_Impl *pData; - - for ( ULONG i=0; i<nCount; i++ ) + for ( size_t i = 0, n = maRegions.size(); i < n; ++i ) { - pData = maRegions.GetObject( i ); - - if ( pData->GetTitle() == rName ) + RegionData_Impl* pData = maRegions[ i ]; + if( pData->GetTitle() == rName ) return pData; } - return NULL; } // ----------------------------------------------------------------------- -void SfxDocTemplate_Impl::DeleteRegion( ULONG nIndex ) +void SfxDocTemplate_Impl::DeleteRegion( size_t nIndex ) { - RegionData_Impl* pRegion = maRegions.GetObject( nIndex ); - - if ( pRegion ) + if ( nIndex < maRegions.size() ) { - delete pRegion; - maRegions.Remove( (ULONG) nIndex ); + delete maRegions[ nIndex ]; + RegionList_Impl::iterator it = maRegions.begin(); + advance( it, nIndex ); + maRegions.erase( it ); } } @@ -2352,8 +2334,8 @@ void SfxDocTemplate_Impl::AddRegion( const OUString& rTitle, // now get the content of the region uno::Reference< XResultSet > xResultSet; Sequence< OUString > aProps(2); - aProps[0] = OUString::createFromAscii( TITLE ); - aProps[1] = OUString::createFromAscii( TARGET_URL ); + aProps[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( TITLE )); + aProps[1] = OUString(RTL_CONSTASCII_USTRINGPARAM( TARGET_URL )); try { @@ -2389,7 +2371,7 @@ void SfxDocTemplate_Impl::CreateFromHierarchy( Content &rTemplRoot ) { uno::Reference< XResultSet > xResultSet; Sequence< OUString > aProps(1); - aProps[0] = OUString::createFromAscii( TITLE ); + aProps[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( TITLE )); try { @@ -2451,7 +2433,7 @@ sal_Bool SfxDocTemplate_Impl::Construct( ) Sequence< Any > aCompareArg(1); *(aCompareArg.getArray()) <<= xLocalizable->getLocale();; m_rCompareFactory = uno::Reference< XAnyCompareFactory >( - xFactory->createInstanceWithArguments( OUString::createFromAscii( "com.sun.star.ucb.AnyCompareFactory" ), + xFactory->createInstanceWithArguments( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.AnyCompareFactory")), aCompareArg ), UNO_QUERY ); @@ -2497,7 +2479,7 @@ void SfxDocTemplate_Impl::GetTemplates( Content& rTargetFolder, uno::Reference< XResultSet > xResultSet; Sequence< OUString > aProps(1); - aProps[0] = OUString::createFromAscii( TITLE ); + aProps[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( TITLE )); try { @@ -2549,20 +2531,19 @@ void SfxDocTemplate_Impl::GetTemplates( Content& rTargetFolder, // ----------------------------------------------------------------------- -long SfxDocTemplate_Impl::GetRegionPos( const OUString& rTitle, - sal_Bool& rFound ) const +size_t SfxDocTemplate_Impl::GetRegionPos( const OUString& rTitle, sal_Bool& rFound ) const { int nCompVal = 1; - long nStart = 0; - long nEnd = maRegions.Count() - 1; - long nMid = 0; + size_t nStart = 0; + size_t nEnd = maRegions.size() - 1; + size_t nMid = 0; RegionData_Impl* pMid; while ( nCompVal && ( nStart <= nEnd ) ) { nMid = ( nEnd - nStart ) / 2 + nStart; - pMid = maRegions.GetObject( nMid ); + pMid = maRegions[ nMid ]; nCompVal = pMid->Compare( rTitle ); @@ -2586,27 +2567,29 @@ long SfxDocTemplate_Impl::GetRegionPos( const OUString& rTitle, } // ----------------------------------------------------------------------- -sal_Bool SfxDocTemplate_Impl::InsertRegion( RegionData_Impl *pNew, - ULONG nPos ) +sal_Bool SfxDocTemplate_Impl::InsertRegion( RegionData_Impl *pNew, size_t nPos ) { ::osl::MutexGuard aGuard( maMutex ); - RegionData_Impl *pData = maRegions.First(); - while ( pData && ( pData->Compare( pNew ) != 0 ) ) - pData = maRegions.Next(); + // return false (not inserted) if the entry already exists + for ( size_t i = 0, n = maRegions.size(); i < n; ++i ) + if ( maRegions[ i ]->Compare( pNew ) == 0 ) + return sal_False; - if ( ! pData ) - { - // compare with the name of the standard group here to insert it - // first + size_t newPos = nPos; + if ( pNew->GetTitle() == maStandardGroup ) + newPos = 0; - if ( pNew->GetTitle() == maStandardGroup ) - maRegions.Insert( pNew, (ULONG) 0 ); - else - maRegions.Insert( pNew, nPos ); + if ( newPos < maRegions.size() ) + { + RegionList_Impl::iterator it = maRegions.begin(); + advance( it, newPos ); + maRegions.insert( it, pNew ); } + else + maRegions.push_back( pNew ); - return ( pData == NULL ); + return sal_True; } // ----------------------------------------------------------------------- @@ -2686,15 +2669,9 @@ void SfxDocTemplate_Impl::Clear() if ( mnLockCounter ) return; - RegionData_Impl *pRegData = maRegions.First(); - - while ( pRegData ) - { - delete pRegData; - pRegData = maRegions.Next(); - } - - maRegions.Clear(); + for ( size_t i = 0, n = maRegions.size(); i < n; ++i ) + delete maRegions[ i ]; + maRegions.clear(); } // ----------------------------------------------------------------------- @@ -2737,3 +2714,4 @@ sal_Bool getTextProperty_Impl( Content& rContent, return bGotProperty; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index abc48c5a80..ee0571c30f 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,14 +30,12 @@ #include "precompiled_sfx2.hxx" #include "doctemplates.hxx" -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <tools/debug.hxx> #include <tools/urlobj.hxx> #include <rtl/ustring.hxx> #include <rtl/ustrbuf.hxx> -#ifndef _SV_RESARY_HXX #include <tools/resary.hxx> -#endif #include <vcl/svapp.hxx> #include <vcl/wrkwin.hxx> #include <comphelper/sequenceashashmap.hxx> @@ -72,6 +71,8 @@ #include <sfx2/docfile.hxx> #include "doc.hrc" +#include <vector> + //----------------------------------------------------------------------------- //============================================================================= @@ -123,6 +124,8 @@ using namespace ::rtl; using namespace ::ucbhelper; using namespace ::comphelper; +using ::std::vector; + //============================================================================= class WaitWindow_Impl : public WorkWindow @@ -148,13 +151,13 @@ struct NamePair_Impl OUString maLongName; }; -DECLARE_LIST( NameList_Impl, NamePair_Impl* ) - class Updater_Impl; -class GroupList_Impl; class DocTemplates_EntryData_Impl; class GroupData_Impl; +typedef vector< NamePair_Impl* > NameList_Impl; +typedef vector< GroupData_Impl* > GroupList_Impl; + //============================================================================= #include <com/sun/star/task/XInteractionHandler.hpp> #include <com/sun/star/ucb/XProgressHandler.hpp> @@ -305,7 +308,7 @@ public: //============================================================================= -class Updater_Impl : public ::vos::OThread +class Updater_Impl : public ::osl::Thread { private: SfxDocTplService_Impl *mpDocTemplates; @@ -359,8 +362,7 @@ public: class GroupData_Impl { - DECLARE_LIST( EntryList_Impl, DocTemplates_EntryData_Impl* ) - EntryList_Impl maEntries; + vector< DocTemplates_EntryData_Impl* > maEntries; OUString maTitle; OUString maHierarchyURL; OUString maTargetURL; @@ -376,8 +378,8 @@ public: void setHierarchyURL( const OUString& rURL ) { maHierarchyURL = rURL; } void setTargetURL( const OUString& rURL ) { maTargetURL = rURL; } - sal_Bool getInUse() { return mbInUse; } - sal_Bool getInHierarchy() { return mbInHierarchy; } + sal_Bool getInUse() const { return mbInUse; } + sal_Bool getInHierarchy() const { return mbInHierarchy; } const OUString& getHierarchyURL() const { return maHierarchyURL; } const OUString& getTargetURL() const { return maTargetURL; } const OUString& getTitle() const { return maTitle; } @@ -386,12 +388,10 @@ public: const OUString& rTargetURL, const OUString& rType, const OUString& rHierURL ); - ULONG count() { return maEntries.Count(); } - DocTemplates_EntryData_Impl* getEntry( ULONG nPos ) { return maEntries.GetObject( nPos ); } + size_t count() { return maEntries.size(); } + DocTemplates_EntryData_Impl* getEntry( size_t nPos ) { return maEntries[ nPos ]; } }; -DECLARE_LIST( GroupList_Impl, GroupData_Impl* ) - //============================================================================= //============================================================================= //============================================================================= @@ -472,7 +472,7 @@ void SfxDocTplService_Impl::init_Impl() if ( bNeedsUpdate ) { aGuard.clear(); - ::vos::OClearableGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexClearableGuard aSolarGuard; WaitWindow_Impl* pWin = new WaitWindow_Impl(); @@ -482,7 +482,7 @@ void SfxDocTplService_Impl::init_Impl() update( sal_True ); anotherGuard.clear(); - ::vos::OGuard aSecondSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSecondSolarGuard; delete pWin; } @@ -542,7 +542,7 @@ void SfxDocTplService_Impl::getDefaultLocale() // ----------------------------------------------------------------------- void SfxDocTplService_Impl::readFolderList() { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; ResStringArray aShortNames( SfxResId( TEMPLATE_SHORT_NAMES_ARY ) ); ResStringArray aLongNames( SfxResId( TEMPLATE_LONG_NAMES_ARY ) ); @@ -557,7 +557,7 @@ void SfxDocTplService_Impl::readFolderList() pPair->maShortName = aShortNames.GetString( i ); pPair->maLongName = aLongNames.GetString( i ); - maNames.Insert( pPair, LIST_APPEND ); + maNames.push_back( pPair ); } } @@ -565,17 +565,15 @@ void SfxDocTplService_Impl::readFolderList() OUString SfxDocTplService_Impl::getLongName( const OUString& rShortName ) { OUString aRet; - NamePair_Impl *pPair = maNames.First(); - while ( pPair ) + for ( size_t i = 0, n = maNames.size(); i < n; ++i ) { + NamePair_Impl* pPair = maNames[ i ]; if ( pPair->maShortName == rShortName ) { aRet = pPair->maLongName; break; } - else - pPair = maNames.Next(); } if ( !aRet.getLength() ) @@ -704,7 +702,7 @@ sal_Bool SfxDocTplService_Impl::getTitleFromURL( const OUString& rURL, OUString& uno::Reference< container::XNameAccess > xTypeDetection( mxType, uno::UNO_QUERY_THROW ); SequenceAsHashMap aTypeProps( xTypeDetection->getByName( aDocType ) ); aType = aTypeProps.getUnpackedValueOrDefault( - ::rtl::OUString::createFromAscii( "MediaType" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), ::rtl::OUString() ); } catch( uno::Exception& ) @@ -1152,9 +1150,14 @@ SfxDocTplService_Impl::~SfxDocTplService_Impl() if ( mpUpdater ) { - mpUpdater->kill(); + mpUpdater->terminate(); + mpUpdater->join(); delete mpUpdater; } + + for ( size_t i = 0, n = maNames.size(); i < n; ++i ) + delete maNames[ i ]; + maNames.clear(); } //----------------------------------------------------------------------------- @@ -1235,9 +1238,9 @@ void SfxDocTplService_Impl::doUpdate() } // now check the list - GroupData_Impl *pGroup = aGroupList.First(); - while ( pGroup ) + for( size_t j = 0, n = aGroupList.size(); j < n; ++j ) { + GroupData_Impl *pGroup = aGroupList[ j ]; if ( pGroup->getInUse() ) { if ( pGroup->getInHierarchy() ) @@ -1248,8 +1251,8 @@ void SfxDocTplService_Impl::doUpdate() OUString( RTL_CONSTASCII_USTRINGPARAM( TARGET_DIR_URL ) ), makeAny( pGroup->getTargetURL() ) ); - ULONG nCount = pGroup->count(); - for ( ULONG i=0; i<nCount; i++ ) + size_t nCount = pGroup->count(); + for ( size_t i=0; i<nCount; i++ ) { DocTemplates_EntryData_Impl *pData = pGroup->getEntry( i ); if ( ! pData->getInUse() ) @@ -1275,10 +1278,10 @@ void SfxDocTplService_Impl::doUpdate() removeFromHierarchy( pGroup ); // delete group from hierarchy delete pGroup; - pGroup = aGroupList.Next(); } + aGroupList.clear(); - aValue <<= sal_False; + aValue <<= sal_False; setProperty( maRootContent, aPropName, aValue ); } @@ -1387,11 +1390,11 @@ sal_Bool SfxDocTplService_Impl::WriteUINamesForTemplateDir_Impl( const ::rtl::OU sal_Bool bResult = sal_False; try { uno::Reference< beans::XPropertySet > xTempFile( - mxFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.io.TempFile" ) ), + mxFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.TempFile")) ), uno::UNO_QUERY_THROW ); ::rtl::OUString aTempURL; - uno::Any aUrl = xTempFile->getPropertyValue( ::rtl::OUString::createFromAscii( "Uri" ) ); + uno::Any aUrl = xTempFile->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Uri")) ); aUrl >>= aTempURL; uno::Reference< io::XStream > xStream( xTempFile, uno::UNO_QUERY_THROW ); @@ -1600,7 +1603,7 @@ sal_Bool SfxDocTplService_Impl::removeGroup( const OUString& rGroupName ) uno::Reference< XResultSet > xResultSet; Sequence< OUString > aProps( 1 ); - aProps[0] = OUString::createFromAscii( TARGET_URL ); + aProps[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( TARGET_URL )); try { @@ -1717,7 +1720,7 @@ sal_Bool SfxDocTplService_Impl::renameGroup( const OUString& rOldName, uno::Reference< XResultSet > xResultSet; Sequence< OUString > aProps( 1 ); - aProps[0] = OUString::createFromAscii( TARGET_URL ); + aProps[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( TARGET_URL )); ResultSetInclude eInclude = INCLUDE_DOCUMENTS_ONLY; xResultSet = aGroup.createCursor( aProps, eInclude ); @@ -1823,7 +1826,7 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName, // get document service name uno::Reference< frame::XModuleManager > xModuleManager( xFactory->createInstance( - ::rtl::OUString::createFromAscii( "com.sun.star.frame.ModuleManager" ) ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.ModuleManager")) ), uno::UNO_QUERY_THROW ); sDocServiceName = xModuleManager->identify( uno::Reference< uno::XInterface >( rStorable, uno::UNO_QUERY ) ); if ( !sDocServiceName.getLength() ) @@ -1834,18 +1837,18 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName, uno::Reference< lang::XMultiServiceFactory > xConfigProvider( xFactory->createInstance( - ::rtl::OUString::createFromAscii( "com.sun.star.configuration.ConfigurationProvider" ) ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider")) ), uno::UNO_QUERY_THROW ); uno::Sequence< uno::Any > aArgs( 1 ); beans::PropertyValue aPathProp; - aPathProp.Name = ::rtl::OUString::createFromAscii( "nodepath" ); + aPathProp.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath")); aPathProp.Value <<= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Setup/Office/Factories/" ) ); aArgs[0] <<= aPathProp; uno::Reference< container::XNameAccess > xSOFConfig( xConfigProvider->createInstanceWithArguments( - ::rtl::OUString::createFromAscii( "com.sun.star.configuration.ConfigurationAccess" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationAccess")), aArgs ), uno::UNO_QUERY_THROW ); @@ -1861,13 +1864,13 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName, // find the related type name ::rtl::OUString aTypeName; uno::Reference< container::XNameAccess > xFilterFactory( - xFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.document.FilterFactory" ) ), + xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.FilterFactory")) ), uno::UNO_QUERY_THROW ); uno::Sequence< beans::PropertyValue > aFilterData; xFilterFactory->getByName( aFilterName ) >>= aFilterData; for ( sal_Int32 nInd = 0; nInd < aFilterData.getLength(); nInd++ ) - if ( aFilterData[nInd].Name.equalsAscii( "Type" ) ) + if ( aFilterData[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Type" ) ) ) aFilterData[nInd].Value >>= aTypeName; if ( !aTypeName.getLength() ) @@ -1878,16 +1881,16 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName, mxType.is() ? uno::Reference< container::XNameAccess >( mxType, uno::UNO_QUERY_THROW ) : uno::Reference< container::XNameAccess >( - xFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.document.TypeDetection" ) ), + xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.TypeDetection")) ), uno::UNO_QUERY_THROW ); SequenceAsHashMap aTypeProps( xTypeDetection->getByName( aTypeName ) ); uno::Sequence< ::rtl::OUString > aAllExt = - aTypeProps.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii( "Extensions" ), Sequence< ::rtl::OUString >() ); + aTypeProps.getUnpackedValueOrDefault( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Extensions")), Sequence< ::rtl::OUString >() ); if ( !aAllExt.getLength() ) throw uno::RuntimeException(); - ::rtl::OUString aMediaType = aTypeProps.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii( "MediaType" ), ::rtl::OUString() ); + ::rtl::OUString aMediaType = aTypeProps.getUnpackedValueOrDefault( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), ::rtl::OUString() ); ::rtl::OUString aExt = aAllExt[0]; if ( !aMediaType.getLength() || !aExt.getLength() ) @@ -1913,9 +1916,9 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName, // store template uno::Sequence< PropertyValue > aStoreArgs( 2 ); - aStoreArgs[0].Name = ::rtl::OUString::createFromAscii( "FilterName" ); + aStoreArgs[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FilterName")); aStoreArgs[0].Value <<= aFilterName; - aStoreArgs[1].Name = ::rtl::OUString::createFromAscii( "DocumentTitle" ); + aStoreArgs[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentTitle")); aStoreArgs[1].Value <<= rTemplateName; ::rtl::OUString aCurrentDocumentURL = rStorable->getLocation(); @@ -2432,9 +2435,9 @@ void SfxDocTplService_Impl::addHierGroup( GroupList_Impl& rList, uno::Reference< XResultSet > xResultSet; Sequence< OUString > aProps(3); - aProps[0] = OUString::createFromAscii( TITLE ); - aProps[1] = OUString::createFromAscii( TARGET_URL ); - aProps[2] = OUString::createFromAscii( PROPERTY_TYPE ); + aProps[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( TITLE )); + aProps[1] = OUString(RTL_CONSTASCII_USTRINGPARAM( TARGET_URL )); + aProps[2] = OUString(RTL_CONSTASCII_USTRINGPARAM( PROPERTY_TYPE )); try { @@ -2453,7 +2456,7 @@ void SfxDocTplService_Impl::addHierGroup( GroupList_Impl& rList, GroupData_Impl *pGroup = new GroupData_Impl( rTitle ); pGroup->setHierarchy( sal_True ); pGroup->setHierarchyURL( rOwnURL ); - rList.Insert( pGroup ); + rList.push_back( pGroup ); uno::Reference< XContentAccess > xContentAccess( xResultSet, UNO_QUERY ); uno::Reference< XRow > xRow( xResultSet, UNO_QUERY ); @@ -2518,15 +2521,20 @@ void SfxDocTplService_Impl::addFsysGroup( GroupList_Impl& rList, if ( !aTitle.getLength() ) return; - GroupData_Impl *pGroup = rList.First(); - - while ( pGroup && pGroup->getTitle() != aTitle ) - pGroup = rList.Next(); + GroupData_Impl* pGroup = NULL; + for ( size_t i = 0, n = rList.size(); i < n; ++i ) + { + if ( rList[ i ]->getTitle() == aTitle ) + { + pGroup = rList[ i ]; + break; + } + } if ( !pGroup ) { pGroup = new GroupData_Impl( aTitle ); - rList.Insert( pGroup ); + rList.push_back( pGroup ); } if ( bWriteableGroup ) @@ -2538,7 +2546,7 @@ void SfxDocTplService_Impl::addFsysGroup( GroupList_Impl& rList, Content aContent; uno::Reference< XResultSet > xResultSet; Sequence< OUString > aProps(1); - aProps[0] = OUString::createFromAscii( TITLE ); + aProps[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( TITLE )); try { @@ -2606,7 +2614,7 @@ void SfxDocTplService_Impl::createFromContent( GroupList_Impl& rList, uno::Reference< XResultSet > xResultSet; Sequence< OUString > aProps(1); - aProps[0] = OUString::createFromAscii( TITLE ); + aProps[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( TITLE )); try { @@ -2760,12 +2768,9 @@ GroupData_Impl::GroupData_Impl( const OUString& rTitle ) // ----------------------------------------------------------------------- GroupData_Impl::~GroupData_Impl() { - DocTemplates_EntryData_Impl *pData = maEntries.First(); - while ( pData ) - { - delete pData; - pData = maEntries.Next(); - } + for ( size_t i = 0, n = maEntries.size(); i < n; ++i ) + delete maEntries[ i ]; + maEntries.clear(); } // ----------------------------------------------------------------------- @@ -2774,12 +2779,20 @@ DocTemplates_EntryData_Impl* GroupData_Impl::addEntry( const OUString& rTitle, const OUString& rType, const OUString& rHierURL ) { - DocTemplates_EntryData_Impl *pData = maEntries.First(); + DocTemplates_EntryData_Impl* pData = NULL; + bool EntryFound = false; - while ( pData && pData->getTitle() != rTitle ) - pData = maEntries.Next(); + for ( size_t i = 0, n = maEntries.size(); i < n; ++i ) + { + pData = maEntries[ i ]; + if ( pData->getTitle() == rTitle ) + { + EntryFound = true; + break; + } + } - if ( !pData ) + if ( !EntryFound ) { pData = new DocTemplates_EntryData_Impl( rTitle ); pData->setTargetURL( rTargetURL ); @@ -2789,7 +2802,7 @@ DocTemplates_EntryData_Impl* GroupData_Impl::addEntry( const OUString& rTitle, pData->setHierarchyURL( rHierURL ); pData->setHierarchy( sal_True ); } - maEntries.Insert( pData ); + maEntries.push_back( pData ); } else { @@ -2896,3 +2909,4 @@ void SfxURLRelocator_Impl::makeAbsoluteURL( rtl::OUString & rURL ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/doctemplateslocal.cxx b/sfx2/source/doc/doctemplateslocal.cxx index 9710df98d1..9357f907b4 100644 --- a/sfx2/source/doc/doctemplateslocal.cxx +++ b/sfx2/source/doc/doctemplateslocal.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,24 +29,12 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" -#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_ #include <com/sun/star/beans/StringPair.hpp> -#endif -#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#endif -#ifndef _COM_SUN_STAR_IO_XACTIVEDATASOURCE_HPP #include <com/sun/star/io/XActiveDataSource.hpp> -#endif -#ifndef _COM_SUN_STAR_XML_SAX_XPARSER_HPP #include <com/sun/star/xml/sax/XParser.hpp> -#endif -#ifndef _COM_SUN_STAR_XML_SAX_XDOCUMENTHANDLER_HPP #include <com/sun/star/xml/sax/XDocumentHandler.hpp> -#endif -#ifndef _COM_SUN_STAR_LANG_ILLEGALARGUMENTEXCEPTION_HPP #include <com/sun/star/lang/IllegalArgumentException.hpp> -#endif #include <comphelper/attributelist.hxx> @@ -261,3 +250,4 @@ void SAL_CALL DocTemplLocaleHelper::setDocumentLocator( const uno::Reference< xm { } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/doctemplateslocal.hxx b/sfx2/source/doc/doctemplateslocal.hxx index 5b3feb30cd..9a0e038d56 100644 --- a/sfx2/source/doc/doctemplateslocal.hxx +++ b/sfx2/source/doc/doctemplateslocal.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,9 +29,7 @@ #ifndef _SFX_DOCTEMPLATESLOCAL_HXX #define _SFX_DOCTEMPLATESLOCAL_HXX -#ifndef _COM_SUN_STAR_XML_SAX_XDUCUMENTHANDLER_HPP_ #include <com/sun/star/xml/sax/XDocumentHandler.hpp> -#endif #include <com/sun/star/beans/StringPair.hpp> #include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/io/XOutputStream.hpp> @@ -86,3 +85,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/docvor.cxx b/sfx2/source/doc/docvor.cxx index e27a43fe85..763eb05305 100644 --- a/sfx2/source/doc/docvor.cxx +++ b/sfx2/source/doc/docvor.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,9 +35,7 @@ #include <stdio.h> -#ifndef _SV_PRNSETUP_HXX //autogen #include <svtools/prnsetup.hxx> -#endif #include <vcl/cmdevt.hxx> #include <vcl/menubtn.hxx> #include <vcl/msgbox.hxx> @@ -73,9 +72,7 @@ #include <sfx2/docfilt.hxx> #include <sfx2/fcontnr.hxx> #include <svtools/localresaccess.hxx> -#ifndef _SVT_DOC_ADDRESSTEMPLATE_HXX_ #include <svtools/addresstemplate.hxx> -#endif #include <comphelper/processfactory.hxx> #define _SVSTDARR_STRINGSDTOR #include <svl/svstdarr.hxx> @@ -107,19 +104,13 @@ public: inline void SfxOrganizeListBox_Impl::SetBitmaps( - const Image &rOFolder, const Image &rCFolder, const Image &rODoc, const Image &rCDoc, - const Image &rOFolderHC, const Image &rCFolderHC, const Image &rODocHC, const Image &rCDocHC ) + const Image &rOFolder, const Image &rCFolder, const Image &rODoc, const Image &rCDoc ) { aOpenedFolderBmp = rOFolder; aClosedFolderBmp = rCFolder; aOpenedDocBmp = rODoc; aClosedDocBmp = rCDoc; - aOpenedFolderBmpHC = rOFolderHC; - aClosedFolderBmpHC = rCFolderHC; - aOpenedDocBmpHC = rODocHC; - aClosedDocBmpHC = rCDocHC; - } //========================================================================= @@ -328,15 +319,8 @@ void SfxOrganizeDlg_Impl::InitBitmaps( void ) Image aOpenedDocBmp( SfxResId( IMG_OPENED_DOC ) ); Image aClosedDocBmp( SfxResId( IMG_CLOSED_DOC ) ); - Image aOpenedFolderBmpHC( SfxResId( IMG_OPENED_FOLDER_HC ) ); - Image aClosedFolderBmpHC( SfxResId( IMG_CLOSED_FOLDER_HC ) ); - Image aOpenedDocBmpHC( SfxResId( IMG_OPENED_DOC_HC ) ); - Image aClosedDocBmpHC( SfxResId( IMG_CLOSED_DOC_HC ) ); - - aLeftLb.SetBitmaps( aOpenedFolderBmp, aClosedFolderBmp, aOpenedDocBmp, aClosedDocBmp, - aOpenedFolderBmpHC, aClosedFolderBmpHC, aOpenedDocBmpHC, aClosedDocBmpHC ); - aRightLb.SetBitmaps( aOpenedFolderBmp, aClosedFolderBmp, aOpenedDocBmp, aClosedDocBmp, - aOpenedFolderBmpHC, aClosedFolderBmpHC, aOpenedDocBmpHC, aClosedDocBmpHC ); + aLeftLb.SetBitmaps( aOpenedFolderBmp, aClosedFolderBmp, aOpenedDocBmp, aClosedDocBmp ); + aRightLb.SetBitmaps( aOpenedFolderBmp, aClosedFolderBmp, aOpenedDocBmp, aClosedDocBmp ); } //========================================================================= @@ -430,7 +414,6 @@ ImpPath_Impl::ImpPath_Impl( const ImpPath_Impl& rCopy ) : class Path { ImpPath_Impl *pData; - void NewImp(); public: Path(SvLBox *pBox, SvLBoxEntry *pEntry); Path(const Path &rPath): @@ -481,17 +464,6 @@ Path::Path(SvLBox *pBox, SvLBoxEntry *pEntry) : //------------------------------------------------------------------------- -void Path::NewImp() -{ - if(pData->nRef != 1) - { - pData->nRef--; - pData = new ImpPath_Impl(*pData); - } -} - -//------------------------------------------------------------------------- - SvLBoxEntry *GetIndices_Impl(SvLBox *pBox, SvLBoxEntry *pEntry, USHORT &rRegion, @@ -550,7 +522,7 @@ BOOL SfxOrganizeListBox_Impl::Select( SvLBoxEntry* pEntry, BOOL bSelect ) // it is ok to use the SfxObjectShellRef here since the object that // provides it ( GetObjectShell() calls CreateObjectShell() ) has a lock on it GetObjectShell(aPath)->TriggerHelpPI( - aPath[nLevel+1], aPath[nLevel+2], aPath[nLevel+3]); + aPath[nLevel+1], aPath[nLevel+2]); return SvTreeListBox::Select(pEntry,bSelect); } @@ -1186,20 +1158,10 @@ void SfxOrganizeListBox_Impl::RequestingChilds( SvLBoxEntry* pEntry ) */ { - // wenn keine Childs vorhanden sind, gfs. Childs - // einfuegen - BmpColorMode eColorMode = BMP_COLOR_NORMAL; - - if ( GetSettings().GetStyleSettings().GetHighContrastMode() ) - eColorMode = BMP_COLOR_HIGHCONTRAST; - - if ( !GetModel()->HasChilds( pEntry ) ) { WaitObject aWaitCursor( this ); - // Choose the correct mask color dependent from eColorMode. This must be adopted if - // we change the mask color for normal images, too! Color aMaskColor( COL_LIGHTMAGENTA ); // hier sind alle initial eingefuegt @@ -1221,19 +1183,18 @@ void SfxOrganizeListBox_Impl::RequestingChilds( SvLBoxEntry* pEntry ) SfxObjectShellRef aRef = GetObjectShell(aPath); if(aRef.Is()) { - const USHORT nCount = aRef->GetContentCount( - aPath[nDocLevel+1], aPath[nDocLevel+2]); + const USHORT nCount = aRef->GetContentCount(aPath[nDocLevel+1]); String aText; Bitmap aClosedBmp, aOpenedBmp; - const BOOL bCanHaveChilds = + const bool bCanHaveChilds = aRef->CanHaveChilds(aPath[nDocLevel+1], aPath[nDocLevel+2]); - for(USHORT i = 0; i < nCount; ++i) + for(sal_uInt16 i = 0; i < nCount; ++i) { - BOOL bDeletable; + sal_Bool bDeletable; aRef->GetContent( - aText, aClosedBmp, aOpenedBmp, eColorMode, bDeletable, - i, aPath[nDocLevel+1], aPath[nDocLevel+2]); + aText, aClosedBmp, aOpenedBmp, bDeletable, + i, aPath[nDocLevel+1]); // Create image with the correct mask color Image aClosedImage( aClosedBmp, aMaskColor ); @@ -1334,39 +1295,37 @@ USHORT SfxOrganizeListBox_Impl::GetLevelCount_Impl(SvLBoxEntry* pParent) const //------------------------------------------------------------------------- -SvLBoxEntry* SfxOrganizeListBox_Impl::InsertEntryByBmpType( const XubString& rText, BMPTYPE eBmpType, - SvLBoxEntry* pParent, BOOL bChildsOnDemand, ULONG nPos, void* pUserData ) +SvLBoxEntry* SfxOrganizeListBox_Impl::InsertEntryByBmpType( + const XubString& rText, + BMPTYPE eBmpType, + SvLBoxEntry* pParent, + BOOL bChildsOnDemand, + ULONG nPos, + void* pUserData +) { SvLBoxEntry* pEntry = NULL; const Image* pExp = NULL; const Image* pCol = NULL; - const Image* pExpHC = NULL; - const Image* pColHC = NULL; switch( eBmpType ) { case BMPTYPE_FOLDER: pExp = &aOpenedFolderBmp; pCol = &aClosedFolderBmp; - pExpHC = &aOpenedFolderBmpHC; - pColHC = &aClosedFolderBmpHC; break; - default: - DBG_ERROR( "SfxOrganizeListBox_Impl::InsertEntryByBmpType(): something forgotten?!" ); case BMPTYPE_DOC: pExp = &aOpenedDocBmp; pCol = &aClosedDocBmp; - pExpHC = &aOpenedDocBmpHC; - pColHC = &aClosedDocBmpHC; break; + + default: + DBG_ERROR( "SfxOrganizeListBox_Impl::InsertEntryByBmpType(): something forgotten?!" ); } pEntry = SvTreeListBox::InsertEntry( rText, *pExp, *pCol, pParent, bChildsOnDemand, nPos, pUserData ); - SetExpandedEntryBmp( pEntry, *pExpHC, BMP_COLOR_HIGHCONTRAST ); - SetCollapsedEntryBmp( pEntry, *pColHC, BMP_COLOR_HIGHCONTRAST ); - return pEntry; } @@ -1485,15 +1444,16 @@ const Image &SfxOrganizeListBox_Impl::GetClosedBmp(USHORT nLevel) const */ { - BOOL bHC = GetSettings().GetStyleSettings().GetHighContrastMode(); const Image* pRet = NULL; switch( nLevel ) { default: DBG_ERROR( "Bitmaps ueberindiziert" ); - case 0: pRet = bHC? &aClosedFolderBmpHC : &aClosedFolderBmp; break; - case 1: pRet = bHC? &aClosedDocBmpHC : &aClosedDocBmp; break; + case 0: pRet = &aClosedFolderBmp; + break; + case 1: pRet = &aClosedDocBmp; + break; } return *pRet; @@ -1519,17 +1479,16 @@ const Image &SfxOrganizeListBox_Impl::GetOpenedBmp(USHORT nLevel) const */ { - BOOL bHC = GetSettings().GetStyleSettings().GetHighContrastMode(); const Image* pRet = NULL; switch( nLevel ) { case 0: - pRet = bHC ? &aOpenedFolderBmpHC : &aOpenedFolderBmp; break; + pRet = &aOpenedFolderBmp; break; case 1: - pRet = bHC ? &aOpenedDocBmpHC : &aOpenedDocBmp; break; + pRet = &aOpenedDocBmp; break; default: - pRet = bHC ? &aClosedFolderBmpHC : &aClosedFolderBmp; break; + pRet = &aClosedFolderBmp; break; } return *pRet; @@ -2153,7 +2112,7 @@ IMPL_LINK( SfxOrganizeDlg_Impl, MenuActivate_Impl, Menu *, pMenu ) String aTitle = SvFileInformationManager::GetDescription( INetURLObject(aObjFacURL) ); pSubMenu->InsertItem( nItemId, aTitle, - SvFileInformationManager::GetImage(INetURLObject(aObjFacURL)) ); + SvFileInformationManager::GetImage(INetURLObject(aObjFacURL), false) ); pSubMenu->SetItemCommand( nItemId++, aObjFacURL ); DBG_ASSERT( nItemId <= ID_RESET_DEFAULT_TEMPLATE_END, "menu item id overflow" ); } @@ -2478,3 +2437,4 @@ SfxTemplateOrganizeDlg::~SfxTemplateOrganizeDlg() delete pImp; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/docvor.hrc b/sfx2/source/doc/docvor.hrc index 2009f980e5..3213a259c0 100644 --- a/sfx2/source/doc/docvor.hrc +++ b/sfx2/source/doc/docvor.hrc @@ -29,10 +29,6 @@ #define IMG_CLOSED_FOLDER 1 #define IMG_OPENED_DOC 3 #define IMG_CLOSED_DOC 4 -#define IMG_OPENED_FOLDER_HC 5 -#define IMG_CLOSED_FOLDER_HC 6 -#define IMG_OPENED_DOC_HC 7 -#define IMG_CLOSED_DOC_HC 8 #define ACC_EDIT 1 #define ID_COPY 201 diff --git a/sfx2/source/doc/docvor.src b/sfx2/source/doc/docvor.src index 78ec832d56..429c87cbae 100644 --- a/sfx2/source/doc/docvor.src +++ b/sfx2/source/doc/docvor.src @@ -264,57 +264,4 @@ ModalDialog DLG_ORGANIZE MASKCOLOR ; ImageBitmap = Bitmap { File = "doccl.bmp" ; } ; }; - Image IMG_OPENED_FOLDER_HC - { - MASKCOLOR ; - ImageBitmap = Bitmap { File = "folderop_h.bmp" ; } ; - }; - Image IMG_CLOSED_FOLDER_HC - { - MASKCOLOR ; - ImageBitmap = Bitmap { File = "foldercl_h.bmp" ; } ; - }; - Image IMG_OPENED_DOC_HC - { - MASKCOLOR ; - ImageBitmap = Bitmap { File = "doccl_h.bmp" ; } ; - }; - Image IMG_CLOSED_DOC_HC - { - MASKCOLOR ; - ImageBitmap = Bitmap { File = "doccl_h.bmp" ; } ; - }; - /* FixedText FT_DEFAULT_TEMPLATE_LABEL - { - Pos = MAP_APPFONT ( 3 , 161 ) ; - Size = MAP_APPFONT ( 61 , 10 ) ; - Text [ en-US ] = "Default template:" ; - }; - FixedText FT_DEFAULT_TEMPLATE - { - Pos = MAP_APPFONT ( 66 , 161 ) ; - Size = MAP_APPFONT ( 131 , 10 ) ; - };*/ }; - // ********************************************************************** EOF - - - - - - - - - - - - - - - - - - - - - diff --git a/sfx2/source/doc/frmdescr.cxx b/sfx2/source/doc/frmdescr.cxx index cffc983b88..35b9162323 100644 --- a/sfx2/source/doc/frmdescr.cxx +++ b/sfx2/source/doc/frmdescr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -327,3 +328,4 @@ SfxItemPresentation SfxFrameDescriptorItem::GetPresentation } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/graphhelp.cxx b/sfx2/source/doc/graphhelp.cxx index 31de6951b2..30c0e218c5 100644 --- a/sfx2/source/doc/graphhelp.cxx +++ b/sfx2/source/doc/graphhelp.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -117,7 +118,7 @@ void* GraphicHelper::getEnhMetaFileFromGDI_Impl( const GDIMetaFile* pGDIMeta ) #ifdef WNT if ( pGDIMeta ) { - String aStr = ::rtl::OUString::createFromAscii( ".emf" ); + String aStr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".emf")); ::utl::TempFile aTempFile( ::rtl::OUString(), &aStr, NULL, @@ -463,25 +464,25 @@ sal_Bool GraphicHelper::getThumbnailReplacement_Impl( sal_Int32 nResID, const un { uno::Reference< graphic::XGraphicProvider > xGraphProvider( xServiceManager->createInstance( - ::rtl::OUString::createFromAscii( "com.sun.star.graphic.GraphicProvider" ) ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.graphic.GraphicProvider")) ), uno::UNO_QUERY ); if ( xGraphProvider.is() ) { - ::rtl::OUString aURL = ::rtl::OUString::createFromAscii( "private:resource/sfx/bitmapex/" ); + ::rtl::OUString aURL(RTL_CONSTASCII_USTRINGPARAM("private:resource/sfx/bitmapex/")); aURL += ::rtl::OUString::valueOf( nResID ); uno::Sequence< beans::PropertyValue > aMediaProps( 1 ); - aMediaProps[0].Name = ::rtl::OUString::createFromAscii( "URL" ); + aMediaProps[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL")); aMediaProps[0].Value <<= aURL; uno::Reference< graphic::XGraphic > xGraphic = xGraphProvider->queryGraphic( aMediaProps ); if ( xGraphic.is() ) { uno::Sequence< beans::PropertyValue > aStoreProps( 2 ); - aStoreProps[0].Name = ::rtl::OUString::createFromAscii( "OutputStream" ); + aStoreProps[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OutputStream")); aStoreProps[0].Value <<= xStream; - aStoreProps[1].Name = ::rtl::OUString::createFromAscii( "MimeType" ); - aStoreProps[1].Value <<= ::rtl::OUString::createFromAscii( "image/png" ); + aStoreProps[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MimeType")); + aStoreProps[1].Value <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("image/png")); xGraphProvider->storeGraphic( xGraphic, aStoreProps ); bResult = sal_True; @@ -503,23 +504,23 @@ sal_uInt16 GraphicHelper::getThumbnailReplacementIDByFactoryName_Impl( const ::r { sal_uInt16 nResult = 0; - if ( aFactoryShortName.equalsAscii( "scalc" ) ) + if ( aFactoryShortName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "scalc" ) ) ) { nResult = BMP_128X128_CALC_DOC; } - else if ( aFactoryShortName.equalsAscii( "sdraw" ) ) + else if ( aFactoryShortName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "sdraw" ) ) ) { nResult = BMP_128X128_DRAW_DOC; } - else if ( aFactoryShortName.equalsAscii( "simpress" ) ) + else if ( aFactoryShortName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "simpress" ) ) ) { nResult = BMP_128X128_IMPRESS_DOC; } - else if ( aFactoryShortName.equalsAscii( "smath" ) ) + else if ( aFactoryShortName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "smath" ) ) ) { nResult = BMP_128X128_MATH_DOC; } - else if ( aFactoryShortName.equalsAscii( "swriter" ) || aFactoryShortName.compareToAscii( "swriter/", 8 ) == 0 ) + else if ( aFactoryShortName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "swriter" ) ) || aFactoryShortName.compareToAscii( "swriter/", 8 ) == 0 ) { nResult = BMP_128X128_WRITER_DOC; } @@ -527,3 +528,4 @@ sal_uInt16 GraphicHelper::getThumbnailReplacementIDByFactoryName_Impl( const ::r return nResult; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/graphhelp.hxx b/sfx2/source/doc/graphhelp.hxx index f5d05df95d..d4d91d7e6f 100644 --- a/sfx2/source/doc/graphhelp.hxx +++ b/sfx2/source/doc/graphhelp.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -73,3 +74,4 @@ public: }; +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index 974af27536..7b2f158318 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -106,10 +107,10 @@ #define STATUS_SAVEAS 2 #define STATUS_SAVEAS_STANDARDNAME 3 -const ::rtl::OUString aFilterNameString = ::rtl::OUString::createFromAscii( "FilterName" ); -const ::rtl::OUString aFilterOptionsString = ::rtl::OUString::createFromAscii( "FilterOptions" ); -const ::rtl::OUString aFilterDataString = ::rtl::OUString::createFromAscii( "FilterData" ); -const ::rtl::OUString aFilterFlagsString = ::rtl::OUString::createFromAscii( "FilterFlags" ); +const ::rtl::OUString aFilterNameString(RTL_CONSTASCII_USTRINGPARAM("FilterName")); +const ::rtl::OUString aFilterOptionsString(RTL_CONSTASCII_USTRINGPARAM("FilterOptions")); +const ::rtl::OUString aFilterDataString(RTL_CONSTASCII_USTRINGPARAM("FilterData")); +const ::rtl::OUString aFilterFlagsString(RTL_CONSTASCII_USTRINGPARAM("FilterFlags")); using namespace ::com::sun::star; @@ -140,15 +141,15 @@ static sal_uInt16 getSlotIDFromMode( sal_Int8 nStoreMode ) static sal_uInt8 getStoreModeFromSlotName( const ::rtl::OUString& aSlotName ) { sal_uInt8 nResult = 0; - if ( aSlotName.equalsAscii( "ExportTo" ) ) + if ( aSlotName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ExportTo" ) ) ) nResult = EXPORT_REQUESTED; - else if ( aSlotName.equalsAscii( "ExportToPDF" ) ) + else if ( aSlotName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ExportToPDF" ) ) ) nResult = EXPORT_REQUESTED | PDFEXPORT_REQUESTED; - else if ( aSlotName.equalsAscii( "ExportDirectToPDF" ) ) + else if ( aSlotName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ExportDirectToPDF" ) ) ) nResult = EXPORT_REQUESTED | PDFEXPORT_REQUESTED | PDFDIRECTEXPORT_REQUESTED; - else if ( aSlotName.equalsAscii( "Save" ) ) + else if ( aSlotName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Save" ) ) ) nResult = SAVE_REQUESTED; - else if ( aSlotName.equalsAscii( "SaveAs" ) ) + else if ( aSlotName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "SaveAs" ) ) ) nResult = SAVEAS_REQUESTED; else throw task::ErrorCodeIOException( ::rtl::OUString(), @@ -439,19 +440,19 @@ const ::comphelper::SequenceAsHashMap& ModelData_Impl::GetModuleProps() //------------------------------------------------------------------------- ::rtl::OUString ModelData_Impl::GetDocServiceName() { - return GetModuleProps().getUnpackedValueOrDefault(::rtl::OUString::createFromAscii( "ooSetupFactoryDocumentService" ), ::rtl::OUString()); + return GetModuleProps().getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooSetupFactoryDocumentService")), ::rtl::OUString()); } //------------------------------------------------------------------------- void ModelData_Impl::CheckInteractionHandler() { ::comphelper::SequenceAsHashMap::const_iterator aInteractIter = - m_aMediaDescrHM.find( ::rtl::OUString::createFromAscii( "InteractionHandler" ) ); + m_aMediaDescrHM.find( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("InteractionHandler")) ); if ( aInteractIter == m_aMediaDescrHM.end() ) { try { - m_aMediaDescrHM[ ::rtl::OUString::createFromAscii( "InteractionHandler" ) ] + m_aMediaDescrHM[ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("InteractionHandler")) ] <<= uno::Reference< task::XInteractionHandler >( m_pOwner->GetServiceFactory()->createInstance( DEFINE_CONST_UNICODE("com.sun.star.task.InteractionHandler") ), @@ -474,7 +475,7 @@ uno::Sequence< beans::PropertyValue > ModelData_Impl::GetDocServiceDefaultFilter uno::Sequence< beans::PropertyValue > aProps; ::rtl::OUString aFilterName = GetModuleProps().getUnpackedValueOrDefault( - ::rtl::OUString::createFromAscii( "ooSetupFactoryDefaultFilter" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooSetupFactoryDefaultFilter")), ::rtl::OUString() ); m_pOwner->GetFilterConfiguration()->getByName( aFilterName ) >>= aProps; @@ -491,7 +492,7 @@ uno::Sequence< beans::PropertyValue > ModelData_Impl::GetDocServiceDefaultFilter if ( aProps.getLength() ) { ::comphelper::SequenceAsHashMap aFiltHM( aProps ); - sal_Int32 nFlags = aFiltHM.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii( "Flags" ), + sal_Int32 nFlags = aFiltHM.getUnpackedValueOrDefault( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Flags")), (sal_Int32)0 ); if ( ( ( nFlags & nMust ) == nMust ) && !( nFlags & nDont ) ) aFilterProps = aProps; @@ -505,7 +506,7 @@ uno::Sequence< beans::PropertyValue > ModelData_Impl::GetDocServiceDefaultFilter uno::Sequence< beans::PropertyValue > ModelData_Impl::GetDocServiceAnyFilter( sal_Int32 nMust, sal_Int32 nDont ) { uno::Sequence< beans::NamedValue > aSearchRequest( 1 ); - aSearchRequest[0].Name = ::rtl::OUString::createFromAscii( "DocumentService" ); + aSearchRequest[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentService")); aSearchRequest[0].Value <<= GetDocServiceName(); return ::comphelper::MimeConfigurationHelper::SearchForFilter( m_pOwner->GetFilterQuery(), aSearchRequest, nMust, nDont ); @@ -523,9 +524,9 @@ uno::Sequence< beans::PropertyValue > ModelData_Impl::GetPreselectedFilter_Impl( { // Preselect PDF-Filter for EXPORT uno::Sequence< beans::NamedValue > aSearchRequest( 2 ); - aSearchRequest[0].Name = ::rtl::OUString::createFromAscii( "Type" ); - aSearchRequest[0].Value <<= ::rtl::OUString::createFromAscii( "pdf_Portable_Document_Format" ); - aSearchRequest[1].Name = ::rtl::OUString::createFromAscii( "DocumentService" ); + aSearchRequest[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Type")); + aSearchRequest[0].Value <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("pdf_Portable_Document_Format")); + aSearchRequest[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentService")); aSearchRequest[1].Value <<= GetDocServiceName(); aFilterProps = ::comphelper::MimeConfigurationHelper::SearchForFilter( m_pOwner->GetFilterQuery(), aSearchRequest, nMust, nDont ); @@ -556,7 +557,7 @@ sal_Bool ModelData_Impl::ExecuteFilterDialog_Impl( const ::rtl::OUString& aFilte { sal_Int32 nPropertyCount = aProps.getLength(); for( sal_Int32 nProperty=0; nProperty < nPropertyCount; ++nProperty ) - if( aProps[nProperty].Name.equals( ::rtl::OUString::createFromAscii("UIComponent")) ) + if( aProps[nProperty].Name.equals( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UIComponent"))) ) { ::rtl::OUString aServiceName; aProps[nProperty].Value >>= aServiceName; @@ -640,7 +641,7 @@ sal_Int8 ModelData_Impl::CheckSaveAcceptable( sal_Int8 nCurStatus ) // the saving is acceptable // in case the configuration entry is not set or set to false // or in case of version creation - ::rtl::OUString aVersionCommentString = ::rtl::OUString::createFromAscii( "VersionComment" ); + ::rtl::OUString aVersionCommentString = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VersionComment")); if ( ( ::comphelper::ConfigurationHelper::readRelativeKey( xCommonConfig, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Save/Document/" ) ), @@ -674,10 +675,10 @@ sal_Int8 ModelData_Impl::CheckStateForSave() sal_Bool bVersInfoNeedsStore = sal_False; ::comphelper::SequenceAsHashMap aAcceptedArgs; - ::rtl::OUString aVersionCommentString = ::rtl::OUString::createFromAscii( "VersionComment" ); - ::rtl::OUString aAuthorString = ::rtl::OUString::createFromAscii( "Author" ); - ::rtl::OUString aInteractionHandlerString = ::rtl::OUString::createFromAscii( "InteractionHandler" ); - ::rtl::OUString aStatusIndicatorString = ::rtl::OUString::createFromAscii( "StatusIndicator" ); + ::rtl::OUString aVersionCommentString(RTL_CONSTASCII_USTRINGPARAM("VersionComment")); + ::rtl::OUString aAuthorString(RTL_CONSTASCII_USTRINGPARAM("Author")); + ::rtl::OUString aInteractionHandlerString(RTL_CONSTASCII_USTRINGPARAM("InteractionHandler")); + ::rtl::OUString aStatusIndicatorString(RTL_CONSTASCII_USTRINGPARAM("StatusIndicator")); if ( GetMediaDescr().find( aVersionCommentString ) != GetMediaDescr().end() ) { @@ -697,9 +698,14 @@ sal_Int8 ModelData_Impl::CheckStateForSave() if ( GetMediaDescr().size() != aAcceptedArgs.size() ) GetMediaDescr() = aAcceptedArgs; - // the document must be modified - if ( !GetModifiable()->isModified() && !bVersInfoNeedsStore ) - return STATUS_NO_ACTION; + // the document must be modified unless the always-save flag is set. + SvtMiscOptions aMiscOptions; + sal_Bool bAlwaysAllowSave = aMiscOptions.IsSaveAlwaysAllowed(); + if (!bAlwaysAllowSave) + { + if ( !GetModifiable()->isModified() && !bVersInfoNeedsStore ) + return STATUS_NO_ACTION; + } // if the document is readonly or a new one a SaveAs operation must be used if ( !GetStorable()->hasLocation() || GetStorable()->isReadonly() ) @@ -726,13 +732,13 @@ sal_Int8 ModelData_Impl::CheckFilter( const ::rtl::OUString& aFilterName ) m_pOwner->GetFilterConfiguration()->getByName( aFilterName ) >>= aFilterProps; aFiltPropsHM = ::comphelper::SequenceAsHashMap( aFilterProps ); - nFiltFlags = aFiltPropsHM.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii( "Flags" ), (sal_Int32)0 ); + nFiltFlags = aFiltPropsHM.getUnpackedValueOrDefault( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Flags")), (sal_Int32)0 ); } // only a temporary solution until default filter retrieving feature is implemented // then GetDocServiceDefaultFilter() must be used ::comphelper::SequenceAsHashMap aDefFiltPropsHM = GetDocServiceDefaultFilterCheckFlags( 3, 0 ); - sal_Int32 nDefFiltFlags = aDefFiltPropsHM.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii( "Flags" ), (sal_Int32)0 ); + sal_Int32 nDefFiltFlags = aDefFiltPropsHM.getUnpackedValueOrDefault( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Flags")), (sal_Int32)0 ); // if the old filter is not acceptable // and there is no default filter or it is not acceptable for requested parameters then proceed with saveAs @@ -752,12 +758,12 @@ sal_Int8 ModelData_Impl::CheckFilter( const ::rtl::OUString& aFilterName ) { // the default filter is acceptable and the old filter is alian one // so ask to make a saveAs operation - ::rtl::OUString aUIName = aFiltPropsHM.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii( "UIName" ), + ::rtl::OUString aUIName = aFiltPropsHM.getUnpackedValueOrDefault( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UIName")), ::rtl::OUString() ); - ::rtl::OUString aDefUIName = aDefFiltPropsHM.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii( "UIName" ), + ::rtl::OUString aDefUIName = aDefFiltPropsHM.getUnpackedValueOrDefault( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UIName")), ::rtl::OUString() ); ::rtl::OUString aPreusedFilterName = GetDocProps().getUnpackedValueOrDefault( - ::rtl::OUString::createFromAscii( "PreusedFilterName" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PreusedFilterName")), ::rtl::OUString() ); if ( !aPreusedFilterName.equals( aFilterName ) && !aUIName.equals( aDefUIName ) ) { @@ -773,7 +779,7 @@ sal_Int8 ModelData_Impl::CheckFilter( const ::rtl::OUString& aFilterName ) sal_Bool ModelData_Impl::CheckFilterOptionsDialogExistence() { uno::Sequence< beans::NamedValue > aSearchRequest( 1 ); - aSearchRequest[0].Name = ::rtl::OUString::createFromAscii( "DocumentService" ); + aSearchRequest[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentService")); aSearchRequest[0].Value <<= GetDocServiceName(); uno::Reference< container::XEnumeration > xFilterEnum = @@ -786,7 +792,7 @@ sal_Bool ModelData_Impl::CheckFilterOptionsDialogExistence() { ::comphelper::SequenceAsHashMap aPropsHM( pProps ); ::rtl::OUString aUIServName = aPropsHM.getUnpackedValueOrDefault( - ::rtl::OUString::createFromAscii( "UIComponent" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UIComponent")), ::rtl::OUString() ); if ( aUIServName.getLength() ) return sal_True; @@ -810,7 +816,7 @@ sal_Bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode, sal_Bool bUseFilterOptions = sal_False; ::comphelper::SequenceAsHashMap::const_iterator aOverwriteIter = - GetMediaDescr().find( ::rtl::OUString::createFromAscii( "Overwrite" ) ); + GetMediaDescr().find( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Overwrite")) ); // the file name must be specified if overwrite option is set if ( aOverwriteIter != GetMediaDescr().end() ) @@ -864,7 +870,7 @@ sal_Bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode, // this is a PDF export // the filter options has been shown already ::rtl::OUString aFilterUIName = aPreselectedFilterPropsHM.getUnpackedValueOrDefault( - ::rtl::OUString::createFromAscii( "UIName" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UIName")), ::rtl::OUString() ); pFileDlg = new sfx2::FileDialogHelper( aDialogMode, aDialogFlags, aFilterUIName, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "pdf" ) ), rStandardDir, rBlackList ); @@ -876,11 +882,11 @@ sal_Bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode, pFileDlg = new sfx2::FileDialogHelper( aDialogMode, aDialogFlags, aDocServiceName, nDialog, nMust, nDont, rStandardDir, rBlackList ); } - if( aDocServiceName.equalsAscii( "com.sun.star.drawing.DrawingDocument" ) ) + if( aDocServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.drawing.DrawingDocument" ) ) ) eCtxt = sfx2::FileDialogHelper::SD_EXPORT; - if( aDocServiceName.equalsAscii( "com.sun.star.presentation.PresentationDocument" ) ) + if( aDocServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.presentation.PresentationDocument" ) ) ) eCtxt = sfx2::FileDialogHelper::SI_EXPORT; - if( aDocServiceName.equalsAscii( "com.sun.star.text.TextDocument" ) ) + if( aDocServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.text.TextDocument" ) ) ) eCtxt = sfx2::FileDialogHelper::SW_EXPORT; if ( eCtxt != sfx2::FileDialogHelper::UNKNOWN_CONTEXT ) @@ -930,24 +936,24 @@ sal_Bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode, m_pOwner->GetFilterConfiguration()->getByName( aOldFilterName ) >>= aOldFilterProps; ::comphelper::SequenceAsHashMap aOldFiltPropsHM( aOldFilterProps ); - sal_Int32 nOldFiltFlags = aOldFiltPropsHM.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii( "Flags" ), (sal_Int32)0 ); + sal_Int32 nOldFiltFlags = aOldFiltPropsHM.getUnpackedValueOrDefault( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Flags")), (sal_Int32)0 ); if ( bSetStandardName || ( nOldFiltFlags & nMust ) != nMust || nOldFiltFlags & nDont ) { // the suggested type will be changed, the extension should be adjusted aAdjustToType = aPreselectedFilterPropsHM.getUnpackedValueOrDefault( - ::rtl::OUString::createFromAscii( "Type" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Type")), ::rtl::OUString() ); ::rtl::OUString aFilterUIName = aPreselectedFilterPropsHM.getUnpackedValueOrDefault( - ::rtl::OUString::createFromAscii( "UIName" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UIName")), ::rtl::OUString() ); pFileDlg->SetCurrentFilter( aFilterUIName ); } else { pFileDlg->SetCurrentFilter( aOldFiltPropsHM.getUnpackedValueOrDefault( - ::rtl::OUString::createFromAscii( "UIName" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UIName")), ::rtl::OUString() ) ); } } @@ -961,7 +967,7 @@ sal_Bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode, uno::Reference < view::XSelectionSupplier > xSel( GetModel()->getCurrentController(), uno::UNO_QUERY ); if ( xSel.is() && xSel->getSelection().hasValue() ) - GetMediaDescr()[::rtl::OUString::createFromAscii( "SelectionOnly" )] <<= sal_True; + GetMediaDescr()[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SelectionOnly"))] <<= sal_True; // This is a temporary hardcoded solution must be removed when // dialogs do not need parameters in SidSet representation any more @@ -1088,7 +1094,7 @@ sal_Bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode, delete pFileDlg; // merge in results of the dialog execution - GetMediaDescr()[::rtl::OUString::createFromAscii( "URL" )] <<= + GetMediaDescr()[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL"))] <<= ::rtl::OUString( aURL.GetMainURL( INetURLObject::NO_DECODE )); GetMediaDescr()[aFilterNameString] <<= aFilterName; @@ -1108,7 +1114,7 @@ sal_Bool ModelData_Impl::ShowDocumentInfoDialog() if ( xFrameDispatch.is() ) { util::URL aURL; - aURL.Complete = ::rtl::OUString::createFromAscii( ".uno:SetDocumentProperties" ); + aURL.Complete = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:SetDocumentProperties")); uno::Reference< util::XURLTransformer > xTransformer( m_pOwner->GetServiceFactory()->createInstance( @@ -1118,7 +1124,7 @@ sal_Bool ModelData_Impl::ShowDocumentInfoDialog() { uno::Reference< frame::XDispatch > xDispatch = xFrameDispatch->queryDispatch( aURL, - ::rtl::OUString::createFromAscii( "_self" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_self")), 0 ); if ( xDispatch.is() ) { @@ -1142,7 +1148,7 @@ sal_Bool ModelData_Impl::ShowDocumentInfoDialog() ::rtl::OUString aReccomendedDir; if ( ( aSuggestedDir.getLength() || GetStorable()->hasLocation() ) - && !GetMediaDescr().getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii( "RepairPackage" ), + && !GetMediaDescr().getUnpackedValueOrDefault( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RepairPackage")), sal_False ) ) { INetURLObject aLocation; @@ -1199,7 +1205,7 @@ sal_Bool ModelData_Impl::ShowDocumentInfoDialog() { // adjust the extension to the type uno::Reference< container::XNameAccess > xTypeDetection = uno::Reference< container::XNameAccess >( - m_pOwner->GetServiceFactory()->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.document.TypeDetection" ) ), + m_pOwner->GetServiceFactory()->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.TypeDetection")) ), uno::UNO_QUERY ); if ( xTypeDetection.is() ) { @@ -1210,7 +1216,7 @@ sal_Bool ModelData_Impl::ShowDocumentInfoDialog() { ::comphelper::SequenceAsHashMap aTypeNamePropsHM( aTypeNameProps ); uno::Sequence< ::rtl::OUString > aExtensions = aTypeNamePropsHM.getUnpackedValueOrDefault( - ::rtl::OUString::createFromAscii( "Extensions" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Extensions")), ::uno::Sequence< ::rtl::OUString >() ); if ( aExtensions.getLength() ) aObj.SetExtension( aExtensions[0] ); @@ -1253,7 +1259,7 @@ uno::Reference< container::XNameAccess > SfxStoringHelper::GetFilterConfiguratio if ( !m_xFilterCFG.is() ) { m_xFilterCFG = uno::Reference< container::XNameAccess >( - GetServiceFactory()->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.document.FilterFactory" ) ), + GetServiceFactory()->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.FilterFactory")) ), uno::UNO_QUERY ); if ( !m_xFilterCFG.is() ) @@ -1283,7 +1289,7 @@ uno::Reference< ::com::sun::star::frame::XModuleManager > SfxStoringHelper::GetM { m_xModuleManager = uno::Reference< ::com::sun::star::frame::XModuleManager >( GetServiceFactory()->createInstance( - ::rtl::OUString::createFromAscii( "com.sun.star.frame.ModuleManager" ) ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.ModuleManager")) ), uno::UNO_QUERY ); if ( !m_xModuleManager.is() ) @@ -1330,7 +1336,7 @@ sal_Bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >& if ( nStoreMode & SAVEAS_REQUESTED ) { ::comphelper::SequenceAsHashMap::const_iterator aSaveToIter = - aModelData.GetMediaDescr().find( ::rtl::OUString::createFromAscii( "SaveTo" ) ); + aModelData.GetMediaDescr().find( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SaveTo")) ); if ( aSaveToIter != aModelData.GetMediaDescr().end() ) { sal_Bool bWideExport = sal_False; @@ -1424,7 +1430,7 @@ sal_Bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >& ::comphelper::SequenceAsHashMap aFilterPropsHM( aFilterProps ); ::rtl::OUString aFilterName = aFilterPropsHM.getUnpackedValueOrDefault( - ::rtl::OUString::createFromAscii( "Name" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name")), ::rtl::OUString() ); ::rtl::OUString aFilterFromMediaDescr = aModelData.GetMediaDescr().getUnpackedValueOrDefault( @@ -1435,7 +1441,7 @@ sal_Bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >& ::rtl::OUString() ); sal_Bool bUseFilterOptions = sal_False; - ::comphelper::SequenceAsHashMap::const_iterator aFileNameIter = aModelData.GetMediaDescr().find( ::rtl::OUString::createFromAscii( "URL" ) ); + ::comphelper::SequenceAsHashMap::const_iterator aFileNameIter = aModelData.GetMediaDescr().find( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL")) ); if ( ( nStoreMode & EXPORT_REQUESTED ) && ( nStoreMode & PDFEXPORT_REQUESTED ) && !( nStoreMode & PDFDIRECTEXPORT_REQUESTED ) ) { @@ -1455,7 +1461,7 @@ sal_Bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >& { sal_Int16 nDialog = SFX2_IMPL_DIALOG_CONFIG; ::comphelper::SequenceAsHashMap::const_iterator aDlgIter = - aModelData.GetMediaDescr().find( ::rtl::OUString::createFromAscii( "UseSystemDialog" ) ); + aModelData.GetMediaDescr().find( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UseSystemDialog")) ); if ( aDlgIter != aModelData.GetMediaDescr().end() ) { sal_Bool bUseSystemDialog = sal_True; @@ -1483,14 +1489,14 @@ sal_Bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >& ::rtl::OUString sStandardDir; ::comphelper::SequenceAsHashMap::const_iterator aStdDirIter = - aModelData.GetMediaDescr().find( ::rtl::OUString::createFromAscii( "StandardDir" ) ); + aModelData.GetMediaDescr().find( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StandardDir")) ); if ( aStdDirIter != aModelData.GetMediaDescr().end() ) aStdDirIter->second >>= sStandardDir; ::com::sun::star::uno::Sequence< ::rtl::OUString > aBlackList; ::comphelper::SequenceAsHashMap::const_iterator aBlackListIter = - aModelData.GetMediaDescr().find( ::rtl::OUString::createFromAscii( "BlackList" ) ); + aModelData.GetMediaDescr().find( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BlackList")) ); if ( aBlackListIter != aModelData.GetMediaDescr().end() ) aBlackListIter->second >>= aBlackList; @@ -1524,7 +1530,7 @@ sal_Bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >& } bDialogUsed = sal_True; - aFileNameIter = aModelData.GetMediaDescr().find( ::rtl::OUString::createFromAscii( "URL" ) ); + aFileNameIter = aModelData.GetMediaDescr().find( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL")) ); } else { @@ -1571,7 +1577,7 @@ sal_Bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >& } ::comphelper::SequenceAsHashMap::const_iterator aIter = - aModelData.GetMediaDescr().find( ::rtl::OUString::createFromAscii( "FilterFlags" ) ); + aModelData.GetMediaDescr().find( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FilterFlags")) ); sal_Bool bFilterFlagsSet = ( aIter != aModelData.GetMediaDescr().end() ); if( !( nStoreMode & PDFEXPORT_REQUESTED ) && !bFilterFlagsSet @@ -1667,7 +1673,7 @@ sal_Bool SfxStoringHelper::CheckFilterOptionsAppearence( { ::comphelper::SequenceAsHashMap aPropsHM( aProps ); ::rtl::OUString aServiceName = aPropsHM.getUnpackedValueOrDefault( - ::rtl::OUString::createFromAscii( "UIComponent" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UIComponent")), ::rtl::OUString() ); if( aServiceName.getLength() ) bUseFilterOptions = sal_True; @@ -1800,3 +1806,4 @@ Window* SfxStoringHelper::GetModelWindow( const uno::Reference< frame::XModel >& return pWin; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/iframe.cxx b/sfx2/source/doc/iframe.cxx index 1e4ebbb977..4b8769db25 100644 --- a/sfx2/source/doc/iframe.cxx +++ b/sfx2/source/doc/iframe.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -159,7 +160,7 @@ throw( uno::RuntimeException ) // we must destroy the IFrame before the parent is destroyed xWindow->addEventListener( this ); - mxFrame = uno::Reference< frame::XFrame >( mxFact->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.frame.Frame" ) ), + mxFrame = uno::Reference< frame::XFrame >( mxFact->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Frame")) ), uno::UNO_QUERY ); uno::Reference < awt::XWindow > xWin( pWin->GetComponentInterface(), uno::UNO_QUERY ); mxFrame->initialize( xWin ); @@ -173,15 +174,15 @@ throw( uno::RuntimeException ) util::URL aTargetURL; aTargetURL.Complete = ::rtl::OUString( maFrmDescr.GetURL().GetMainURL( INetURLObject::NO_DECODE ) ); - uno::Reference < util::XURLTransformer > xTrans( mxFact->createInstance( rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), uno::UNO_QUERY ); + uno::Reference < util::XURLTransformer > xTrans( mxFact->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), uno::UNO_QUERY ); xTrans->parseStrict( aTargetURL ); uno::Sequence < beans::PropertyValue > aProps(2); - aProps[0].Name = ::rtl::OUString::createFromAscii("PluginMode"); + aProps[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PluginMode")); aProps[0].Value <<= (sal_Int16) 2; - aProps[1].Name = ::rtl::OUString::createFromAscii("ReadOnly"); + aProps[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReadOnly")); aProps[1].Value <<= (sal_Bool) sal_True; - uno::Reference < frame::XDispatch > xDisp = xProv->queryDispatch( aTargetURL, ::rtl::OUString::createFromAscii("_self"), 0 ); + uno::Reference < frame::XDispatch > xDisp = xProv->queryDispatch( aTargetURL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_self")), 0 ); if ( xDisp.is() ) xDisp->dispatch( aTargetURL, aProps ); @@ -395,3 +396,5 @@ void SAL_CALL IFrameObject::setTitle( const ::rtl::OUString& ) throw (::com::sun } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx index b0009ffed0..50960329d2 100644 --- a/sfx2/source/doc/new.cxx +++ b/sfx2/source/doc/new.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -156,9 +157,6 @@ void SfxPreviewWin_Impl::ImpPaint( pWindow->SetLineColor( aBlackCol ); pWindow->SetFillColor( aWhiteCol ); pWindow->DrawRect( Rectangle( aPoint + Point( FRAME, FRAME ), bPoint + Point( FRAME, FRAME ) ) ); -//! pFile->Move( Point( FRAME, FRAME ) ); -//! pFile->Scale( Fraction( aTmpSize.Width(), aSize.Width() ), -//! Fraction( aTmpSize.Height(), aSize.Height() ) ); pFile->WindStart(); pFile->Play( pWindow, aPoint + Point( FRAME, FRAME ), aSize ); } @@ -176,8 +174,7 @@ SfxPreviewWin::SfxPreviewWin( SetHelpId( HID_PREVIEW_FRAME ); // adjust contrast mode initially - bool bUseContrast = UseHighContrastSetting(); - SetDrawMode( bUseContrast ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR ); + SetDrawMode( OUTPUT_DRAWMODE_COLOR ); // #107818# This preview window is for document previews. Therefore // right-to-left mode should be off @@ -218,18 +215,10 @@ void SfxPreviewWin::DataChanged( const DataChangedEvent& rDCEvt ) if( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) ) { - // adjust contrast mode - bool bUseContrast = UseHighContrastSetting(); - SetDrawMode( bUseContrast ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR ); + SetDrawMode( OUTPUT_DRAWMODE_COLOR ); } } -bool SfxPreviewWin::UseHighContrastSetting() const -{ - return GetSettings().GetStyleSettings().GetHighContrastMode(); -} - - class SfxNewFileDialog_Impl { FixedText aRegionFt; @@ -739,3 +728,4 @@ void SfxNewFileDialog::SetTemplateFlags(USHORT nSet) pImpl->SetTemplateFlags(nSet); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index 1e545e4f6b..cb09d9c774 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -118,16 +119,14 @@ bool operator> (const util::DateTime& i_rLeft, const util::DateTime& i_rRight) return sal_False; } - ::boost::shared_ptr<GDIMetaFile> SfxObjectShell::GetPreviewMetaFile( sal_Bool bFullContent ) const { - return CreatePreviewMetaFile_Impl( bFullContent, sal_False ); + return CreatePreviewMetaFile_Impl( bFullContent ); } - ::boost::shared_ptr<GDIMetaFile> -SfxObjectShell::CreatePreviewMetaFile_Impl( sal_Bool bFullContent, sal_Bool bHighContrast ) const +SfxObjectShell::CreatePreviewMetaFile_Impl( sal_Bool bFullContent ) const { // Nur wenn gerade nicht gedruckt wird, darf DoDraw aufgerufen // werden, sonst wird u.U. der Printer abgeschossen ! @@ -142,10 +141,6 @@ SfxObjectShell::CreatePreviewMetaFile_Impl( sal_Bool bFullContent, sal_Bool bHig VirtualDevice aDevice; aDevice.EnableOutput( FALSE ); - // adjust the output device if HC-metafile is requested - if ( bHighContrast ) - aDevice.SetDrawMode( aDevice.GetDrawMode() | DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT ); - MapMode aMode( ((SfxObjectShell*)this)->GetMapUnit() ); aDevice.SetMapMode( aMode ); pFile->SetPrefMapMode( aMode ); @@ -328,11 +323,9 @@ void SfxObjectShell::SetOrganizerSearchMask( //-------------------------------------------------------------------- -USHORT SfxObjectShell::GetContentCount( - USHORT nIdx1, - USHORT /*nIdx2*/) +sal_uInt16 SfxObjectShell::GetContentCount(sal_uInt16 nIdx) { - switch(nIdx1) + switch(nIdx) { case INDEX_IGNORE: return DEF_CONTENT_COUNT; @@ -346,20 +339,14 @@ USHORT SfxObjectShell::GetContentCount( } case CONTENT_MACRO: break; -/* - case CONTENT_CONFIG: - return ( GetConfigManager() ) ? - GetConfigManager()->GetItemCount() : 0; - break; - */ } return 0; } //-------------------------------------------------------------------- -//TODO/CLEANUP: remove this method (it's virtual) -void SfxObjectShell::TriggerHelpPI(USHORT nIdx1, USHORT nIdx2, USHORT) +//TODO/CLEANUP: remove this method +void SfxObjectShell::TriggerHelpPI(USHORT nIdx1, USHORT nIdx2) { if(nIdx1==CONTENT_STYLE && nIdx2 != INDEX_IGNORE) //StyleSheets { @@ -368,23 +355,18 @@ void SfxObjectShell::TriggerHelpPI(USHORT nIdx1, USHORT nIdx2, USHORT) } } -BOOL SfxObjectShell::CanHaveChilds(USHORT nIdx1, - USHORT nIdx2) +sal_Bool SfxObjectShell::CanHaveChilds(sal_uInt16 nIdx1, sal_uInt16 nIdx2) { - switch(nIdx1) { + switch(nIdx1) + { case INDEX_IGNORE: - return TRUE; + return true; case CONTENT_STYLE: - return INDEX_IGNORE == nIdx2 || !GetStyleSheetPool()? FALSE: TRUE; + return INDEX_IGNORE == nIdx2 || !GetStyleSheetPool() ? false : true; case CONTENT_MACRO: -//!! return INDEX_IGNORE == nIdx2? FALSE: TRUE; - return FALSE; -/* - case CONTENT_CONFIG: - return INDEX_IGNORE == nIdx2 ? FALSE : TRUE; - */ + return false; } - return FALSE; + return false; } //-------------------------------------------------------------------- @@ -392,29 +374,14 @@ BOOL SfxObjectShell::CanHaveChilds(USHORT nIdx1, void SfxObjectShell::GetContent(String &rText, Bitmap &rClosedBitmap, Bitmap &rOpenedBitmap, - BOOL &bCanDel, - USHORT i, - USHORT nIdx1, - USHORT nIdx2 ) -{ - DBG_ERRORFILE( "Non high contrast method called. Please update calling code!" ); - SfxObjectShell::GetContent( rText, rClosedBitmap, rOpenedBitmap, BMP_COLOR_NORMAL, bCanDel, i, nIdx1, nIdx2 ); -} - -//-------------------------------------------------------------------- - -void SfxObjectShell::GetContent(String &rText, - Bitmap &rClosedBitmap, - Bitmap &rOpenedBitmap, - BmpColorMode eColorMode, - BOOL &bCanDel, - USHORT i, - USHORT nIdx1, - USHORT /*nIdx2*/ ) + sal_Bool &bCanDel, + sal_uInt16 i, + sal_uInt16 nIdx +) { - bCanDel=TRUE; + bCanDel=true; - switch(nIdx1) + switch(nIdx) { case INDEX_IGNORE: { @@ -425,37 +392,14 @@ void SfxObjectShell::GetContent(String &rText, { case CONTENT_STYLE: nTextResId = STR_STYLES; - if ( eColorMode == BMP_COLOR_NORMAL ) - { - nClosedBitmapResId= BMP_STYLES_CLOSED; - nOpenedBitmapResId= BMP_STYLES_OPENED; - } - else - { - nClosedBitmapResId= BMP_STYLES_CLOSED_HC; - nOpenedBitmapResId= BMP_STYLES_OPENED_HC; - } + nClosedBitmapResId= BMP_STYLES_CLOSED; + nOpenedBitmapResId= BMP_STYLES_OPENED; break; case CONTENT_MACRO: nTextResId = STR_MACROS; - if ( eColorMode == BMP_COLOR_NORMAL ) - { - nClosedBitmapResId= BMP_STYLES_CLOSED; - nOpenedBitmapResId= BMP_STYLES_OPENED; - } - else - { - nClosedBitmapResId= BMP_STYLES_CLOSED_HC; - nOpenedBitmapResId= BMP_STYLES_OPENED_HC; - } - break; -/* - case CONTENT_CONFIG: - nTextResId = STR_CONFIG; nClosedBitmapResId= BMP_STYLES_CLOSED; nOpenedBitmapResId= BMP_STYLES_OPENED; break; - */ } if ( nTextResId ) @@ -476,52 +420,32 @@ void SfxObjectShell::GetContent(String &rText, bCanDel=((pStyle->GetMask() & SFXSTYLEBIT_USERDEF) == SFXSTYLEBIT_USERDEF); rClosedBitmap = rOpenedBitmap = - GetStyleFamilyBitmap(pStyle->GetFamily(), eColorMode ); + GetStyleFamilyBitmap(pStyle->GetFamily()); } break; case CONTENT_MACRO: break; -/* - case CONTENT_CONFIG: - if ( GetConfigManager() ) - { - rText = GetConfigManager()->GetItem(i); - bCanDel = GetConfigManager()->CanDelete(i); - } - else - rText = String(); - rClosedBitmap = Bitmap(SfxResId(BMP_STYLES_CLOSED)); - rOpenedBitmap = Bitmap(SfxResId(BMP_STYLES_OPENED)); - break; -*/ } } //-------------------------------------------------------------------- -Bitmap SfxObjectShell::GetStyleFamilyBitmap( SfxStyleFamily eFamily ) -{ - DBG_ERRORFILE( "Non high contrast method called. Please update calling code!" ); - return SfxObjectShell::GetStyleFamilyBitmap( eFamily, BMP_COLOR_NORMAL ); -} -//-------------------------------------------------------------------- - -Bitmap SfxObjectShell::GetStyleFamilyBitmap(SfxStyleFamily eFamily, BmpColorMode eColorMode ) +Bitmap SfxObjectShell::GetStyleFamilyBitmap(SfxStyleFamily eFamily) { USHORT nResId = 0; switch(eFamily) { case SFX_STYLE_FAMILY_CHAR: - nResId = ( eColorMode == BMP_COLOR_NORMAL ) ? BMP_STYLES_FAMILY1 : BMP_STYLES_FAMILY1_HC; + nResId = BMP_STYLES_FAMILY1; break; case SFX_STYLE_FAMILY_PARA: - nResId = ( eColorMode == BMP_COLOR_NORMAL ) ? BMP_STYLES_FAMILY2 : BMP_STYLES_FAMILY2_HC; + nResId = BMP_STYLES_FAMILY2; break; case SFX_STYLE_FAMILY_FRAME: - nResId = ( eColorMode == BMP_COLOR_NORMAL ) ? BMP_STYLES_FAMILY3 : BMP_STYLES_FAMILY3_HC; + nResId = BMP_STYLES_FAMILY3; break; case SFX_STYLE_FAMILY_PAGE : - nResId = ( eColorMode == BMP_COLOR_NORMAL ) ? BMP_STYLES_FAMILY4 : BMP_STYLES_FAMILY4_HC; + nResId = BMP_STYLES_FAMILY4; break; case SFX_STYLE_FAMILY_PSEUDO: case SFX_STYLE_FAMILY_ALL: @@ -750,10 +674,6 @@ BOOL SfxObjectShell::Print USHORT /*nIdx3*/, const String* pObjectName ) - -/* [Beschreibung] -*/ - { switch(nIdx1) { @@ -763,7 +683,6 @@ BOOL SfxObjectShell::Print SetOrganizerSearchMask(pStylePool); SfxStyleSheetIterator* pIter = pStylePool->CreateIterator( pStylePool->GetSearchFamily(), pStylePool->GetSearchMask() ); - USHORT nStyles = pIter->Count(); SfxStyleSheetBase *pStyle = pIter->First(); if ( !pStyle ) return TRUE; @@ -793,7 +712,6 @@ BOOL SfxObjectShell::Print aOutPos.Y() += nTextHeight; aOutPos.Y() += nTextHeight/2; aFont.SetSize(Size(0, 35)); // 10pt - nStyles = 1; while(pStyle) { // print template name diff --git a/sfx2/source/doc/objembed.cxx b/sfx2/source/doc/objembed.cxx index 868f337102..89a223bc42 100644 --- a/sfx2/source/doc/objembed.cxx +++ b/sfx2/source/doc/objembed.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -315,3 +316,4 @@ void SfxObjectShell::ClearEmbeddedObjects() DELETEZ( pImp->mpObjectContainer ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/objitem.cxx b/sfx2/source/doc/objitem.cxx index a53a985350..3cecbf41e9 100644 --- a/sfx2/source/doc/objitem.cxx +++ b/sfx2/source/doc/objitem.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,11 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" -#ifndef GCC -#endif - #include <sfx2/objsh.hxx> -//#include "objshimp.hxx" #include <sfx2/objitem.hxx> #include <com/sun/star/lang/XUnoTunnel.hpp> @@ -64,7 +61,7 @@ SfxPoolItem* SfxObjectShellItem::Clone( SfxItemPool *) const //-------------------------------------------------------------------- -sal_Bool SfxObjectShellItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE /*nMemberId*/ ) const +bool SfxObjectShellItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE /*nMemberId*/ ) const { if ( pObjSh ) { @@ -76,12 +73,12 @@ sal_Bool SfxObjectShellItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE /* { rVal <<= ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >(); } - return TRUE; + return true; } //-------------------------------------------------------------------- -sal_Bool SfxObjectShellItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE /*nMemberId*/ ) +bool SfxObjectShellItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE /*nMemberId*/ ) { // This item MUST have a model. Please don't change this, there are UNO-based // implementations which need it!! @@ -91,7 +88,7 @@ sal_Bool SfxObjectShellItem::PutValue( const com::sun::star::uno::Any& rVal, BYT { if ( xModel.is() ) { - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XUnoTunnel > xTunnel( + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XUnoTunnel > xTunnel( xModel, ::com::sun::star::uno::UNO_QUERY ); if ( xTunnel.is() ) { @@ -100,16 +97,16 @@ sal_Bool SfxObjectShellItem::PutValue( const com::sun::star::uno::Any& rVal, BYT if ( nHandle ) { pObjSh = reinterpret_cast< SfxObjectShell* >(sal::static_int_cast<sal_IntPtr>( nHandle )); - return TRUE; + return true; } } } - + pObjSh = 0; - return TRUE; + return true; } - return FALSE; + return true; } //========================================================================= @@ -133,3 +130,5 @@ SfxPoolItem* SfxObjectItem::Clone( SfxItemPool *) const { return new SfxObjectItem( Which(), _pSh ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index ffc27f1a54..ea81cf4b58 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -36,7 +37,7 @@ #include <svl/stritem.hxx> #include <svl/intitem.hxx> #include <svtools/svparser.hxx> // SvKeyValue -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <cppuhelper/exc_hlp.hxx> #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> @@ -48,9 +49,7 @@ #include <com/sun/star/script/InterruptReason.hpp> #include <com/sun/star/script/XEngineListener.hpp> #include <com/sun/star/script/XDebugging.hpp> -#ifndef _COM_SUN_STAR_SCRIPT_XINVOKATION_HPP_ #include <com/sun/star/script/XInvocation.hpp> -#endif #include <com/sun/star/script/ContextInformation.hpp> #include <com/sun/star/script/FinishReason.hpp> #include <com/sun/star/script/XEngine.hpp> @@ -69,9 +68,7 @@ #include <com/sun/star/script/provider/XScriptProvider.hpp> #include <com/sun/star/script/provider/XScriptProviderSupplier.hpp> -#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_ #include <toolkit/unohlp.hxx> -#endif #include <com/sun/star/uno/Reference.h> #include <com/sun/star/uno/Any.h> @@ -98,12 +95,8 @@ using namespace ::com::sun::star::script::provider; using namespace ::com::sun::star::container; #include <basic/sbuno.hxx> #include <basic/sbstar.hxx> -#ifndef _SB_BASMGR_HXX #include <basic/basmgr.hxx> -#endif -#ifndef _VCL_MSGBOX_HXX #include <vcl/msgbox.hxx> -#endif #include <basic/sbx.hxx> #include <svtools/sfxecode.hxx> #include <svtools/ehdl.hxx> @@ -180,7 +173,7 @@ public: //========================================================================= -sal_uInt16 __READONLY_DATA aTitleMap_Impl[3][2] = +sal_uInt16 const aTitleMap_Impl[3][2] = { // local remote /* SFX_TITLE_CAPTION */ { SFX_TITLE_FILENAME, SFX_TITLE_TITLE }, @@ -830,17 +823,6 @@ void SfxObjectShell::SetTitle return; SfxApplication *pSfxApp = SFX_APP(); -#if 0 - // wird 'unbenannt#' als Titel gesetzt - String aNoName(SfxResId(STR_NONAME)); - if ( rTitle.Match(aNoName) <= aNoName.Len() ) - { - // er ist es selbst => ignorieren - pSfxApp->ReleaseIndex(pImp->nVisualDocumentNumber); - pImp->bIsNamedVisible=0; - } -#endif - // ggf. die unbenannt-Nummer freigeben if ( pImp->bIsNamedVisible && USHRT_MAX != pImp->nVisualDocumentNumber ) { @@ -1742,7 +1724,16 @@ ErrCode SfxObjectShell::CallXScript( const Reference< XInterface >& _rxScriptCon // obtain the script, and execute it Reference< provider::XScript > xScript( xScriptProvider->getScript( _rScriptURL ), UNO_QUERY_THROW ); - + if ( pCaller && pCaller->hasValue() ) + { + Reference< beans::XPropertySet > xProps( xScript, uno::UNO_QUERY ); + if ( xProps.is() ) + { + Sequence< uno::Any > aArgs( 1 ); + aArgs[ 0 ] = *pCaller; + xProps->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Caller")), uno::makeAny( aArgs ) ); + } + } aRet = xScript->invoke( aParams, aOutParamIndex, aOutParam ); } catch ( const uno::Exception& ) @@ -1824,7 +1815,7 @@ ErrCode SfxObjectShell::CallStarBasicScript( const String& _rMacroName, const St const void* _pArguments, void* _pReturn ) { OSL_TRACE("in CallSBS"); - ::vos::OClearableGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; // the arguments for the call SbxArrayRef xMacroArguments = lcl_translateUno2Basic( _pArguments ); @@ -1860,7 +1851,7 @@ ErrCode SfxObjectShell::CallScript( void *pRet ) { - ::vos::OClearableGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; ErrCode nErr = ERRCODE_NONE; if( rScriptType.EqualsAscii( "StarBasic" ) ) { @@ -2583,3 +2574,4 @@ void SfxObjectShell::StoreLog() } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 295a14503a..741d5be661 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -83,7 +84,6 @@ #include <sfx2/objsh.hxx> #include "objshimp.hxx" #include "sfxtypes.hxx" -//#include "interno.hxx" #include <sfx2/module.hxx> #include <sfx2/viewfrm.hxx> #include "versdlg.hxx" @@ -944,8 +944,11 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet) } case SID_SAVEDOC: { - BOOL bMediumRO = IsReadOnlyMedium(); - if ( !bMediumRO && GetMedium() && IsModified() ) + SvtMiscOptions aMiscOptions; + bool bAlwaysAllowSave = aMiscOptions.IsSaveAlwaysAllowed(); + bool bAllowSave = (bAlwaysAllowSave || IsModified()); + bool bMediumRO = IsReadOnlyMedium(); + if ( !bMediumRO && GetMedium() && bAllowSave ) rSet.Put(SfxStringItem( nWhich, String(SfxResId(STR_SAVEDOC)))); else @@ -1030,7 +1033,7 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet) case SID_DOC_MODIFIED: { - rSet.Put( SfxStringItem( SID_DOC_MODIFIED, IsModified() ? '*' : ' ' ) ); + rSet.Put( SfxBoolItem( SID_DOC_MODIFIED, IsModified() ) ); break; } diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 7624e7ef32..38f8fc5570 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,7 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" -#ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> #endif #include <svl/eitem.hxx> @@ -164,7 +164,7 @@ void impl_addToModelCollection(const css::uno::Reference< css::frame::XModel >& css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory(); css::uno::Reference< css::container::XSet > xModelCollection( - xSMGR->createInstance(::rtl::OUString::createFromAscii("com.sun.star.frame.GlobalEventBroadcaster")), + xSMGR->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.GlobalEventBroadcaster"))), css::uno::UNO_QUERY); if (xModelCollection.is()) { @@ -238,7 +238,7 @@ sal_Bool SfxObjectShell::PutURLContentsToVersionStream_Impl( try { uno::Reference< embed::XStorage > xVersion = xDocStorage->openStorageElement( - ::rtl::OUString::createFromAscii( "Versions" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Versions")), embed::ElementModes::READWRITE ); DBG_ASSERT( xVersion.is(), @@ -350,7 +350,7 @@ void SfxObjectShell::SetupStorage( const uno::Reference< embed::XStorage >& xSto { try { - xProps->setPropertyValue( ::rtl::OUString::createFromAscii( "MediaType" ), uno::makeAny( aDataFlavor.MimeType ) ); + xProps->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), uno::makeAny( aDataFlavor.MimeType ) ); } catch( uno::Exception& ) { @@ -369,7 +369,7 @@ void SfxObjectShell::SetupStorage( const uno::Reference< embed::XStorage >& xSto { try { - xProps->setPropertyValue( ::rtl::OUString::createFromAscii( "Version" ), uno::makeAny( aVersion ) ); + xProps->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Version")), uno::makeAny( aVersion ) ); } catch( uno::Exception& ) { @@ -613,6 +613,9 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed ) sal_uInt32 nError = HandleFilter( pMedium, this ); if ( nError != ERRCODE_NONE ) SetError( nError, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + + if (pMedium->GetFilter()->GetFilterFlags() & SFX_FILTER_STARTPRESENTATION) + pSet->Put( SfxBoolItem( SID_DOC_STARTPRESENTATION, TRUE) ); } EnableSetModified( sal_False ); @@ -698,7 +701,7 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed ) if ( pMedium->GetFilter() && ( pMedium->GetFilter()->GetFilterFlags() & SFX_FILTER_STARONEFILTER ) ) { uno::Reference < beans::XPropertySet > xSet( GetModel(), uno::UNO_QUERY ); - ::rtl::OUString sLockUpdates(::rtl::OUString::createFromAscii("LockUpdates")); + ::rtl::OUString sLockUpdates(RTL_CONSTASCII_USTRINGPARAM("LockUpdates")); bool bSetProperty = true; try { @@ -845,24 +848,12 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed ) pRequest->addContinuation( new ::comphelper::OInteractionApprove ); pRequest->addContinuation( new ::comphelper::OInteractionAbort ); - typedef ::comphelper::OInteraction< XInteractionAskLater > OInteractionAskLater; - OInteractionAskLater* pLater = new OInteractionAskLater; - pRequest->addContinuation( pLater ); + bool bReconnectDde = true; // by default, we try to auto-connect DDE connections. + if (pDdeReconnectItem) + bReconnectDde = pDdeReconnectItem->GetValue(); - try - { - xHandler->handle( pRequest.get() ); - } - catch( const Exception& ) - { - DBG_UNHANDLED_EXCEPTION(); - } - if ( pLater->wasSelected() ) - SFX_APP()->Get_Impl()->bODFVersionWarningLater = true; - } - } - } - } + if (bReconnectDde) + ReconnectDdeLinks(*this); } else GetpApp()->HideStatusText(); @@ -883,7 +874,7 @@ sal_uInt32 SfxObjectShell::HandleFilter( SfxMedium* pMedium, SfxObjectShell* pDo if( xServiceManager.is() ) { xFilterCFG = com::sun::star::uno::Reference< XNameAccess >( - xServiceManager->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.document.FilterFactory" ) ), + xServiceManager->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.FilterFactory")) ), UNO_QUERY ); } @@ -898,7 +889,7 @@ sal_uInt32 SfxObjectShell::HandleFilter( SfxMedium* pMedium, SfxObjectShell* pDo { sal_Int32 nPropertyCount = aProps.getLength(); for( sal_Int32 nProperty=0; nProperty < nPropertyCount; ++nProperty ) - if( aProps[nProperty].Name.equals( ::rtl::OUString::createFromAscii("UIComponent")) ) + if( aProps[nProperty].Name.equals( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UIComponent"))) ) { ::rtl::OUString aServiceName; aProps[nProperty].Value >>= aServiceName; @@ -1363,7 +1354,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl if ( !xProps.is() ) throw uno::RuntimeException(); - xProps->setPropertyValue( ::rtl::OUString::createFromAscii( "MediaType" ), + xProps->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), uno::makeAny( aDataFlavor.MimeType ) ); } catch( uno::Exception& ) @@ -2643,6 +2634,7 @@ sal_Bool SfxObjectShell::DoSave_Impl( const SfxItemSet* pArgs ) sal_Bool bOpen( sal_False ); bOpen = DoSaveCompleted( pMediumTmp ); DBG_ASSERT(bOpen,"Fehlerbehandlung fuer DoSaveCompleted nicht implementiert"); + (void)bOpen; } else { @@ -2774,7 +2766,7 @@ sal_Bool SfxObjectShell::CommonSaveAs_Impl BOOL bWasReadonly = IsReadOnly(); - if ( aURL == aActName && aURL != INetURLObject( OUString::createFromAscii( "private:stream" ) ) + if ( aURL == aActName && aURL != INetURLObject( OUString(RTL_CONSTASCII_USTRINGPARAM("private:stream")) ) && IsReadOnly() ) { SetError(ERRCODE_SFX_DOCUMENTREADONLY, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) )); @@ -2971,6 +2963,7 @@ sal_Bool SfxObjectShell::PreDoSaveAs_Impl BOOL bRet( FALSE ); bRet = DoSaveCompleted( pMedium ); DBG_ASSERT( bRet, "Error in DoSaveCompleted, can't be handled!"); + (void)bRet; } // TODO/LATER: disconnect the new file from the storage for the case when pure saving is done @@ -3013,9 +3006,9 @@ sal_Bool SfxObjectShell::IsInformationLost() ::rtl::OUString aPreusedFilterName; for ( sal_Int32 nInd = 0; nInd < aProps.getLength(); nInd++ ) { - if ( aProps[nInd].Name.equalsAscii( "FilterName" ) ) + if ( aProps[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "FilterName" ) ) ) aProps[nInd].Value >>= aFilterName; - else if ( aProps[nInd].Name.equalsAscii( "PreusedFilterName" ) ) + else if ( aProps[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PreusedFilterName" ) ) ) aProps[nInd].Value >>= aPreusedFilterName; } @@ -3615,7 +3608,7 @@ sal_Bool SfxObjectShell::CopyStoragesOfUnknownMediaType( const uno::Reference< e default: { OSL_ENSURE( - aSubElements[nInd].equalsAscii( "Configurations2" ) || !xTarget->hasByName( aSubElements[nInd] ), + aSubElements[nInd].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Configurations2" ) ) || !xTarget->hasByName( aSubElements[nInd] ), "The target storage is an output storage, the element should not exist in the target!\n" ); if ( !xTarget->hasByName( aSubElements[nInd] ) ) @@ -3648,12 +3641,12 @@ sal_Bool SfxObjectShell::GenerateAndStoreThumbnail( sal_Bool bEncrypted, try { uno::Reference< embed::XStorage > xThumbnailStor = - xStor->openStorageElement( ::rtl::OUString::createFromAscii( "Thumbnails" ), + xStor->openStorageElement( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Thumbnails")), embed::ElementModes::READWRITE ); if ( xThumbnailStor.is() ) { uno::Reference< io::XStream > xStream = xThumbnailStor->openStreamElement( - ::rtl::OUString::createFromAscii( "thumbnail.png" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("thumbnail.png")), embed::ElementModes::READWRITE ); if ( xStream.is() && WriteThumbnail( bEncrypted, bSigned, bIsTemplate, xStream ) ) @@ -3684,6 +3677,10 @@ sal_Bool SfxObjectShell::WriteThumbnail( sal_Bool bEncrypted, uno::Reference< io::XTruncate > xTruncate( xStream->getOutputStream(), uno::UNO_QUERY_THROW ); xTruncate->truncate(); + uno::Reference < beans::XPropertySet > xSet( xStream, uno::UNO_QUERY ); + if ( xSet.is() ) + xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), + uno::makeAny( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("image/png")) ) ); if ( bEncrypted ) { sal_uInt16 nResID = GraphicHelper::getThumbnailReplacementIDByFactoryName_Impl( @@ -3726,6 +3723,22 @@ void SfxObjectShell::UpdateLinks() { } +void SfxObjectShell::CheckConfigOptions() +{ + // not handled. Each app's shell needs to overwrite this method to add handler. + SetConfigOptionsChecked(true); +} + +sal_Bool SfxObjectShell::IsConfigOptionsChecked() const +{ + return pImp->m_bConfigOptionsChecked; +} + +void SfxObjectShell::SetConfigOptionsChecked( sal_Bool bChecked ) +{ + pImp->m_bConfigOptionsChecked = bChecked; +} + sal_Bool SfxObjectShell::QuerySaveSizeExceededModules_Impl( const uno::Reference< task::XInteractionHandler >& xHandler ) { if ( !HasBasic() ) @@ -3755,3 +3768,5 @@ uno::Reference< task::XInteractionHandler > SfxObjectShell::getInteractionHandle xRet = GetMedium()->GetInteractionHandler(); return xRet; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/objuno.cxx b/sfx2/source/doc/objuno.cxx index 1037367de8..8d3776e8ed 100644 --- a/sfx2/source/doc/objuno.cxx +++ b/sfx2/source/doc/objuno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -45,6 +46,7 @@ #include <com/sun/star/lang/Locale.hpp> #include <com/sun/star/util/XModifiable.hpp> #include <com/sun/star/document/XDocumentProperties.hpp> +#include <com/sun/star/document/XCompatWriterDocProperties.hpp> #include <unotools/configmgr.hxx> #include <tools/inetdef.hxx> @@ -53,7 +55,7 @@ #include <osl/mutex.hxx> #include <rtl/ustrbuf.hxx> #include <vcl/svapp.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <tools/errcode.hxx> #include <svl/cntwids.hrc> @@ -96,7 +98,7 @@ using namespace ::com::sun::star; #define PROPERTY_UNBOUND 0 #define PROPERTY_MAYBEVOID ::com::sun::star::beans::PropertyAttribute::MAYBEVOID -const SfxItemPropertyMapEntry* lcl_GetDocInfoPropertyMap() +const SfxItemPropertyMapEntry* lcl_GetDocInfoPropertyMap() { static SfxItemPropertyMapEntry aDocInfoPropertyMap_Impl[] = { @@ -104,6 +106,9 @@ const SfxItemPropertyMapEntry* lcl_GetDocInfoPropertyMap() { "AutoloadEnabled" , 15, MID_DOCINFO_AUTOLOADENABLED, &::getBooleanCppuType(), PROPERTY_UNBOUND, 0 }, { "AutoloadSecs" , 12, MID_DOCINFO_AUTOLOADSECS, &::getCppuType((const sal_Int32*)0), PROPERTY_UNBOUND, 0 }, { "AutoloadURL" , 11, MID_DOCINFO_AUTOLOADURL, &::getCppuType((const ::rtl::OUString*)0), PROPERTY_UNBOUND, 0 }, + { "Category" , 8 , MID_CATEGORY, &::getCppuType((const ::rtl::OUString*)0), PROPERTY_UNBOUND, 0 }, + { "Company" , 7 , MID_COMPANY, &::getCppuType((const ::rtl::OUString*)0), PROPERTY_UNBOUND, 0 }, + { "Manager" , 7 , MID_MANAGER, &::getCppuType((const ::rtl::OUString*)0), PROPERTY_UNBOUND, 0 }, { "CreationDate" , 12, WID_DATE_CREATED, &::getCppuType((const ::com::sun::star::util::DateTime*)0),PROPERTY_MAYBEVOID, 0 }, { "DefaultTarget" , 13, MID_DOCINFO_DEFAULTTARGET, &::getCppuType((const ::rtl::OUString*)0), PROPERTY_UNBOUND, 0 }, { "Description" , 11, MID_DOCINFO_DESCRIPTION, &::getCppuType((const ::rtl::OUString*)0), PROPERTY_UNBOUND, 0 }, @@ -262,7 +267,7 @@ MixedPropertySetInfo::~MixedPropertySetInfo() ::comphelper::SequenceAsVector< ::com::sun::star::beans::Property > lProps; // copy "fix" props - //todo: os: this ugly thing should be replaced + //todo: os: this ugly thing should be replaced const SfxItemPropertyMapEntry* pFixProp = lcl_GetDocInfoPropertyMap(); while(pFixProp && pFixProp->pName) @@ -303,7 +308,7 @@ MixedPropertySetInfo::~MixedPropertySetInfo() //----------------------------------------------------------------------------- -::com::sun::star::beans::Property SAL_CALL MixedPropertySetInfo::getPropertyByName( +::com::sun::star::beans::Property SAL_CALL MixedPropertySetInfo::getPropertyByName( const ::rtl::OUString& sName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException ) @@ -324,7 +329,7 @@ MixedPropertySetInfo::~MixedPropertySetInfo() throw(::com::sun::star::uno::RuntimeException) { return _aPropertyMap.hasPropertyByName( sName ) ? // "fix" prop? - sal_True : + sal_True : _xUDProps->getPropertySetInfo()->hasPropertyByName(sName); // "dynamic" prop? } @@ -389,13 +394,13 @@ void SfxDocumentInfoObject_Impl::Reset(uno::Reference<document::XDocumentPropert : sName + ::rtl::OUString::valueOf(i+1); while (std::find(names.begin(), names.end(), name) != names.end()) { - name += ::rtl::OUString::createFromAscii("'"); + name += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("'")); } // FIXME there is a race condition here try { xPropContainer->addProperty(name, beans::PropertyAttribute::REMOVEABLE, - uno::makeAny(::rtl::OUString::createFromAscii(""))); + uno::makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")))); } catch (uno::RuntimeException) { throw; } catch (uno::Exception) { @@ -438,14 +443,14 @@ SfxDocumentInfoObject::initialize(const uno::Sequence< uno::Any > & aArguments) uno::Any any = aArguments[0]; uno::Reference<document::XDocumentProperties> xDoc; if (!(any >>= xDoc) || !xDoc.is()) throw lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii( - "SfxDocumentInfoObject::initialize: no XDocumentProperties given"), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "SfxDocumentInfoObject::initialize: no XDocumentProperties given")), *this, 0); _pImp->Reset(xDoc); } else { throw lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii( - "SfxDocumentInfoObject::initialize: no argument given"), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "SfxDocumentInfoObject::initialize: no argument given")), *this, 0); } } @@ -807,6 +812,22 @@ void SAL_CALL SfxDocumentInfoObject::setFastPropertyValue(sal_Int32 nHandle, co _pImp->m_xDocProps->setDefaultTarget(sTemp); break; // case WID_CONTENT_TYPE : // this is readonly! + case MID_CATEGORY: + case MID_MANAGER: + case MID_COMPANY: + { + uno::Reference< document::XCompatWriterDocProperties > xWriterProps( _pImp->m_xDocProps, uno::UNO_QUERY ); + if ( xWriterProps.is() ) + { + if ( nHandle == MID_CATEGORY ) + xWriterProps->setCategory( sTemp ); + else if ( nHandle == MID_MANAGER ) + xWriterProps->setManager( sTemp ); + else + xWriterProps->setCompany( sTemp ); + break; + } + } default: break; } @@ -867,7 +888,7 @@ void SAL_CALL SfxDocumentInfoObject::setFastPropertyValue(sal_Int32 nHandle, co _pImp->m_xDocProps->setAutoloadSecs(60); // default } else if ( !bBoolVal && (0 != _pImp->m_xDocProps->getAutoloadSecs()) ) { _pImp->m_xDocProps->setAutoloadSecs(0); - _pImp->m_xDocProps->setAutoloadURL(::rtl::OUString::createFromAscii("")); + _pImp->m_xDocProps->setAutoloadURL(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(""))); } break; default: @@ -1024,6 +1045,23 @@ void SAL_CALL SfxDocumentInfoObject::setFastPropertyValue(sal_Int32 nHandle, co case MID_DOCINFO_CHARLOCALE: aValue <<= _pImp->m_xDocProps->getLanguage(); break; + case MID_CATEGORY: + case MID_MANAGER: + case MID_COMPANY: + { + uno::Reference< document::XCompatWriterDocProperties > xWriterProps( _pImp->m_xDocProps, uno::UNO_QUERY ); + if ( xWriterProps.is() ) + { + if ( nHandle == MID_CATEGORY ) + aValue <<= xWriterProps->getCategory(); + else if ( nHandle == MID_MANAGER ) + aValue <<= xWriterProps->getManager(); + else + aValue <<= xWriterProps->getCompany(); + break; + } + } + default: aValue <<= ::rtl::OUString(); break; @@ -1103,7 +1141,7 @@ void SAL_CALL SfxDocumentInfoObject::setUserFieldName(sal_Int16 nIndex, const : try { xPropContainer->addProperty(aName, beans::PropertyAttribute::REMOVEABLE, - uno::makeAny(::rtl::OUString::createFromAscii(""))); + uno::makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")))); _pImp->m_UserDefined[nIndex] = aName; } catch (beans::PropertyExistException) { _pImp->m_UserDefined[nIndex] = aName; @@ -1203,7 +1241,7 @@ uno::Reference< embed::XStorage > GetStorage_Impl( const ::rtl::OUString& rName, // Client code checks the returned reference but is not interested on error details. try { - ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; return ::comphelper::OStorageHelper::GetStorageFromURL( rName, bWrite ? embed::ElementModes::READWRITE : embed::ElementModes::READ, @@ -1272,9 +1310,9 @@ void SAL_CALL SfxStandaloneDocumentInfoObject::loadFromURL(const ::rtl::OUStrin try { uno::Sequence<beans::PropertyValue> medium(2); - medium[0].Name = ::rtl::OUString::createFromAscii("DocumentBaseURL"); + medium[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentBaseURL")); medium[0].Value <<= aURL; - medium[1].Name = ::rtl::OUString::createFromAscii("URL"); + medium[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL")); medium[1].Value <<= aURL; _pImp->m_xDocProps->loadFromStorage(xStorage, medium); _pImp->Reset(_pImp->m_xDocProps); @@ -1312,9 +1350,9 @@ void SAL_CALL SfxStandaloneDocumentInfoObject::storeIntoURL(const ::rtl::OUStri try { uno::Sequence<beans::PropertyValue> medium(2); - medium[0].Name = ::rtl::OUString::createFromAscii("DocumentBaseURL"); + medium[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentBaseURL")); medium[0].Value <<= aURL; - medium[1].Name = ::rtl::OUString::createFromAscii("URL"); + medium[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL")); medium[1].Value <<= aURL; _pImp->m_xDocProps->storeToStorage(xStorage, medium); @@ -1348,3 +1386,4 @@ void SAL_CALL SfxStandaloneDocumentInfoObject::storeIntoURL(const ::rtl::OUStri throw task::ErrorCodeIOException( ::rtl::OUString(), uno::Reference< uno::XInterface >(), ERRCODE_IO_CANTWRITE ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 530cdf4836..b6c07f0b34 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -39,17 +40,11 @@ #include <com/sun/star/util/XModifyBroadcaster.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/frame/XTitle.hpp> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> -#ifndef _SV_RESARY_HXX #include <tools/resary.hxx> -#endif -#ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> -#endif -#ifndef _WRKWIN_HXX //autogen #include <vcl/wrkwin.hxx> -#endif #include <vcl/svapp.hxx> #include <svl/eitem.hxx> #include <tools/rtti.hxx> @@ -64,15 +59,12 @@ #include <sfx2/signaturestate.hxx> #include <sfx2/sfxmodelfactory.hxx> -#ifndef _BASIC_SBUNO_HXX #include <basic/sbuno.hxx> -#endif #include <svtools/sfxecode.hxx> #include <svtools/ehdl.hxx> #include <unotools/printwarningoptions.hxx> #ifndef _UNOTOOLS_PROCESSFACTORY_HXX #include <comphelper/processfactory.hxx> -#endif #include <com/sun/star/document/XStorageBasedDocument.hpp> #include <com/sun/star/script/DocumentDialogLibraryContainer.hpp> @@ -134,6 +126,40 @@ DBG_NAME(SfxObjectShell) static WeakReference< XInterface > s_xCurrentComponent; +void lcl_UpdateAppBasicDocVars( const Reference< XInterface >& _rxComponent, bool bClear = false ) +{ + BasicManager* pAppMgr = SFX_APP()->GetBasicManager(); + if ( pAppMgr ) + { + uno::Reference< beans::XPropertySet > xProps( _rxComponent, uno::UNO_QUERY ); + if ( xProps.is() ) + { + try + { + // ThisVBADocObj contains a PropertyValue + // Name is ( the name of the VBA global to insert ) + // Value is the Object to insert. + // ( note: at the moment the Value is actually the model so + // it strictly is not necessary, however we do intend to store + // not the model in basic but a custom object, so we keep this + // level of indirection for future proofing ) + beans::PropertyValue aProp; + xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ThisVBADocObj") ) ) >>= aProp; + rtl::OString sTmp( rtl::OUStringToOString( aProp.Name, RTL_TEXTENCODING_UTF8 ) ); + const char* pAscii = sTmp.getStr(); + if ( bClear ) + pAppMgr->SetGlobalUNOConstant( pAscii, uno::makeAny( uno::Reference< uno::XInterface >() ) ); + else + pAppMgr->SetGlobalUNOConstant( pAscii, aProp.Value ); + + } + catch( uno::Exception& e ) + { + } + } + } +} + //========================================================================= @@ -158,16 +184,17 @@ void SAL_CALL SfxModelListener_Impl::queryClosing( const com::sun::star::lang::E void SAL_CALL SfxModelListener_Impl::notifyClosing( const com::sun::star::lang::EventObject& ) throw ( com::sun::star::uno::RuntimeException ) { - ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; mpDoc->Broadcast( SfxSimpleHint(SFX_HINT_DEINITIALIZING) ); } void SAL_CALL SfxModelListener_Impl::disposing( const com::sun::star::lang::EventObject& _rEvent ) throw ( com::sun::star::uno::RuntimeException ) { // am I ThisComponent in AppBasic? - ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; if ( SfxObjectShell::GetCurrentComponent() == _rEvent.Source ) { + lcl_UpdateAppBasicDocVars( SfxObjectShell::GetCurrentComponent(), true ); // remove ThisComponent reference from AppBasic SfxObjectShell::SetCurrentComponent( Reference< XInterface >() ); } @@ -220,6 +247,7 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell ) ,bSaveVersionOnClose( sal_False ) ,m_bSharedXMLFlag( sal_False ) ,m_bAllowShareControlFileClean( sal_True ) + ,m_bConfigOptionsChecked( sal_False ) ,lErr(ERRCODE_NONE) ,nEventId ( 0) ,pReloadTimer ( 0) @@ -858,7 +886,7 @@ uno::Sequence< ::rtl::OUString > SfxObjectShell::GetEventNames() if ( !pEventNameContainer ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( !pEventNameContainer ) { static uno::Sequence< ::rtl::OUString > aEventNameContainer = GlobalEventConfig().getElementNames(); @@ -892,9 +920,7 @@ void SfxObjectShell::SetBaseModel( SfxBaseModel* pModel ) { return pImp->pBaseModel.get(); } -/* -----------------------------10.09.2001 15:56------------------------------ - ---------------------------------------------------------------------------*/ void SfxObjectShell::SetAutoStyleFilterIndex(sal_uInt16 nSet) { pImp->nStyleFilter = nSet; @@ -920,7 +946,10 @@ void SfxObjectShell::SetCurrentComponent( const Reference< XInterface >& _rxComp BasicManager* pAppMgr = SFX_APP()->GetBasicManager(); s_xCurrentComponent = _rxComponent; if ( pAppMgr ) + { + lcl_UpdateAppBasicDocVars( _rxComponent ); pAppMgr->SetGlobalUNOConstant( "ThisComponent", makeAny( _rxComponent ) ); + } #if OSL_DEBUG_LEVEL > 0 const char* pComponentImplName = _rxComponent.get() ? typeid( *_rxComponent.get() ).name() : "void"; @@ -959,43 +988,43 @@ String SfxObjectShell::GetServiceNameFromFactory( const String& rFact ) if ( aFact.EqualsAscii("swriter") ) { - aServiceName = ::rtl::OUString::createFromAscii("com.sun.star.text.TextDocument"); + aServiceName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextDocument")); } else if ( aFact.EqualsAscii("sweb") || aFact.EqualsAscii("swriter/web") ) { - aServiceName = ::rtl::OUString::createFromAscii("com.sun.star.text.WebDocument"); + aServiceName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.WebDocument")); } else if ( aFact.EqualsAscii("sglobal") || aFact.EqualsAscii("swriter/globaldocument") ) { - aServiceName = ::rtl::OUString::createFromAscii("com.sun.star.text.GlobalDocument"); + aServiceName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.GlobalDocument")); } else if ( aFact.EqualsAscii("scalc") ) { - aServiceName = ::rtl::OUString::createFromAscii("com.sun.star.sheet.SpreadsheetDocument"); + aServiceName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.SpreadsheetDocument")); } else if ( aFact.EqualsAscii("sdraw") ) { - aServiceName = ::rtl::OUString::createFromAscii("com.sun.star.drawing.DrawingDocument"); + aServiceName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.DrawingDocument")); } else if ( aFact.EqualsAscii("simpress") ) { - aServiceName = ::rtl::OUString::createFromAscii("com.sun.star.presentation.PresentationDocument"); + aServiceName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.presentation.PresentationDocument")); } else if ( aFact.EqualsAscii("schart") ) { - aServiceName = ::rtl::OUString::createFromAscii("com.sun.star.chart.ChartDocument"); + aServiceName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.chart.ChartDocument")); } else if ( aFact.EqualsAscii("smath") ) { - aServiceName = ::rtl::OUString::createFromAscii("com.sun.star.formula.FormulaProperties"); + aServiceName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.formula.FormulaProperties")); } else if ( aFact.EqualsAscii("sbasic") ) { - aServiceName = ::rtl::OUString::createFromAscii("com.sun.star.script.BasicIDE"); + aServiceName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.BasicIDE")); } else if ( aFact.EqualsAscii("sdatabase") ) { - aServiceName = ::rtl::OUString::createFromAscii("com.sun.star.sdb.OfficeDatabaseDocument"); + aServiceName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.OfficeDatabaseDocument")); } return aServiceName; @@ -1032,12 +1061,18 @@ SfxObjectShell* SfxObjectShell::CreateObject( const String& rServiceName, SfxObj SfxObjectShell* SfxObjectShell::CreateAndLoadObject( const SfxItemSet& rSet, SfxFrame* pFrame ) { + Reference<lang::XComponent> xComp = CreateAndLoadComponent(rSet, pFrame); + return GetShellFromComponent(xComp); +} + +Reference<lang::XComponent> SfxObjectShell::CreateAndLoadComponent( const SfxItemSet& rSet, SfxFrame* pFrame ) +{ uno::Sequence < beans::PropertyValue > aProps; TransformItems( SID_OPENDOC, rSet, aProps ); SFX_ITEMSET_ARG(&rSet, pFileNameItem, SfxStringItem, SID_FILE_NAME, FALSE); SFX_ITEMSET_ARG(&rSet, pTargetItem, SfxStringItem, SID_TARGETNAME, FALSE); ::rtl::OUString aURL; - ::rtl::OUString aTarget = rtl::OUString::createFromAscii("_blank"); + ::rtl::OUString aTarget(RTL_CONSTASCII_USTRINGPARAM("_blank")); if ( pFileNameItem ) aURL = pFileNameItem->GetValue(); if ( pTargetItem ) @@ -1050,22 +1085,33 @@ SfxObjectShell* SfxObjectShell::CreateAndLoadObject( const SfxItemSet& rSet, Sfx } else xLoader = uno::Reference < frame::XComponentLoader >( comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop") ), uno::UNO_QUERY ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")) ), uno::UNO_QUERY ); - uno::Reference < lang::XUnoTunnel > xObj; + Reference <lang::XComponent> xComp; try { - xObj = uno::Reference< lang::XUnoTunnel >( xLoader->loadComponentFromURL( aURL, aTarget, 0, aProps ), uno::UNO_QUERY ); + xComp = xLoader->loadComponentFromURL(aURL, aTarget, 0, aProps); } catch( uno::Exception& ) {} - if ( xObj.is() ) + return xComp; +} + +SfxObjectShell* SfxObjectShell::GetShellFromComponent( const Reference<lang::XComponent>& xComp ) +{ + try + { + Reference<lang::XUnoTunnel> xTunnel(xComp, UNO_QUERY_THROW); + Sequence <sal_Int8> aSeq( SvGlobalName( SFX_GLOBAL_CLASSID ).GetByteSequence() ); + sal_Int64 nHandle = xTunnel->getSomething( aSeq ); + if (!nHandle) + return NULL; + + return reinterpret_cast< SfxObjectShell* >(sal::static_int_cast< sal_IntPtr >( nHandle )); + } + catch (const Exception&) { - ::com::sun::star::uno::Sequence < sal_Int8 > aSeq( SvGlobalName( SFX_GLOBAL_CLASSID ).GetByteSequence() ); - sal_Int64 nHandle = xObj->getSomething( aSeq ); - if ( nHandle ) - return reinterpret_cast< SfxObjectShell* >(sal::static_int_cast< sal_IntPtr >( nHandle )); } return NULL; diff --git a/sfx2/source/doc/oleprops.cxx b/sfx2/source/doc/oleprops.cxx index 3a27d38879..b0bf446ce0 100755..100644 --- a/sfx2/source/doc/oleprops.cxx +++ b/sfx2/source/doc/oleprops.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1225,3 +1226,5 @@ const SvGlobalName& SfxOlePropertySet::GetSectionGuid( SfxOleSectionType eSectio // ============================================================================ //} // namespace + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/oleprops.hxx b/sfx2/source/doc/oleprops.hxx index 0fddd50de0..24b73c805a 100755..100644 --- a/sfx2/source/doc/oleprops.hxx +++ b/sfx2/source/doc/oleprops.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -80,6 +81,10 @@ const sal_Int32 PROPID_CREATED = 12; const sal_Int32 PROPID_LASTSAVED = 13; const sal_Int32 PROPID_THUMBNAIL = 17; +// some Builtin properties +const sal_Int32 PROPID_CATEGORY = 0x2; +const sal_Int32 PROPID_COMPANY = 0xf; +const sal_Int32 PROPID_MANAGER = 0xe; // predefined codepages const sal_uInt16 CODEPAGE_UNKNOWN = 0; const sal_uInt16 CODEPAGE_UNICODE = 1200; @@ -402,3 +407,5 @@ private: }; //}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/ownsubfilterservice.cxx b/sfx2/source/doc/ownsubfilterservice.cxx index 62e81893d4..005ca6fe40 100644 --- a/sfx2/source/doc/ownsubfilterservice.cxx +++ b/sfx2/source/doc/ownsubfilterservice.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -53,15 +54,15 @@ OwnSubFilterService::~OwnSubFilterService() uno::Sequence< ::rtl::OUString > SAL_CALL OwnSubFilterService::impl_getStaticSupportedServiceNames() { uno::Sequence< ::rtl::OUString > aRet(2); - aRet[0] = ::rtl::OUString::createFromAscii("com.sun.star.document.OwnSubFilter"); - aRet[1] = ::rtl::OUString::createFromAscii("com.sun.star.comp.document.OwnSubFilter"); + aRet[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.OwnSubFilter")); + aRet[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.document.OwnSubFilter")); return aRet; } //------------------------------------------------------------------------- ::rtl::OUString SAL_CALL OwnSubFilterService::impl_getStaticImplementationName() { - return ::rtl::OUString::createFromAscii("com.sun.star.comp.document.OwnSubFilter"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.document.OwnSubFilter")); } //------------------------------------------------------------------------- @@ -163,3 +164,4 @@ uno::Sequence< ::rtl::OUString > SAL_CALL OwnSubFilterService::getSupportedServi } // namespace sfx2 +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/plugin.cxx b/sfx2/source/doc/plugin.cxx index e8b92b7285..cb7c8100ef 100644 --- a/sfx2/source/doc/plugin.cxx +++ b/sfx2/source/doc/plugin.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -103,7 +104,7 @@ sal_Bool SAL_CALL PluginObject::load( const uno::Reference < frame::XFrame >& xFrame ) throw( uno::RuntimeException ) { - uno::Reference< plugin::XPluginManager > xPMgr( mxFact->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.plugin.PluginManager") ), uno::UNO_QUERY ); + uno::Reference< plugin::XPluginManager > xPMgr( mxFact->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.plugin.PluginManager")) ), uno::UNO_QUERY ); if (!xPMgr.is() ) return FALSE; @@ -205,15 +206,15 @@ uno::Reference< beans::XPropertySetInfo > SAL_CALL PluginObject::getPropertySetI void SAL_CALL PluginObject::setPropertyValue(const ::rtl::OUString& aPropertyName, const uno::Any& aAny) throw ( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException) { - if ( aPropertyName.equalsAscii("PluginURL") ) + if ( aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("PluginURL")) ) { aAny >>= maURL; } - else if ( aPropertyName.equalsAscii("PluginMimeType") ) + else if ( aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("PluginMimeType")) ) { aAny >>= maMimeType; } - else if ( aPropertyName.equalsAscii("PluginCommands") ) + else if ( aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("PluginCommands")) ) { maCmdList.Clear(); uno::Sequence < beans::PropertyValue > aCommandSequence; @@ -228,15 +229,15 @@ uno::Any SAL_CALL PluginObject::getPropertyValue(const ::rtl::OUString& aPropert throw ( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { uno::Any aAny; - if ( aPropertyName.equalsAscii("PluginURL") ) + if ( aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("PluginURL")) ) { aAny <<= maURL; } - else if ( aPropertyName.equalsAscii("PluginMimeType") ) + else if ( aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("PluginMimeType")) ) { aAny <<= maMimeType; } - else if ( aPropertyName.equalsAscii("PluginCommands") ) + else if ( aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("PluginCommands")) ) { uno::Sequence< beans::PropertyValue > aCommandSequence; maCmdList.FillSequence( aCommandSequence ); @@ -264,3 +265,5 @@ void SAL_CALL PluginObject::removeVetoableChangeListener(const ::rtl::OUString&, } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx index 8fdc19ff29..2e70f4a490 100755..100644 --- a/sfx2/source/doc/printhelper.cxx +++ b/sfx2/source/doc/printhelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -460,7 +461,7 @@ void SAL_CALL SfxPrintHelper::setPrinter(const uno::Sequence< beans::PropertyVal throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; SfxViewShell* pViewSh = NULL; SfxPrinter* pPrinter = NULL; @@ -505,7 +506,7 @@ class ImplUCBPrintWatcher : public ::osl::Thread { /* SAFE { */ { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; while( m_pPrinter->IsPrinting() ) Application::Yield(); m_pPrinter = NULL; // don't delete it! It's borrowed only :-) @@ -583,7 +584,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& // object already disposed? // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; // get view for sfx printing capabilities SfxViewFrame *pViewFrm = m_pData->m_pObjectShell.Is() ? @@ -800,6 +801,7 @@ void IMPL_PrintListener_DataContainer::Notify( SfxBroadcaster& rBC, const SfxHin m_xPrintJob = new SfxPrintJob_Impl( this ); m_aPrintOptions = pPrintHint->GetOptions(); } +*/ else if ( pPrintHint->GetWhich() != -2 ) // -2 : CancelPrintJob { view::PrintJobEvent aEvent; @@ -819,14 +821,15 @@ void IMPL_PrintListener_DataContainer::Notify( SfxBroadcaster& rBC, const SfxHin void SAL_CALL SfxPrintHelper::addPrintJobListener( const ::com::sun::star::uno::Reference< ::com::sun::star::view::XPrintJobListener >& xListener ) throw (::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; m_pData->m_aInterfaceContainer.addInterface( ::getCppuType((const uno::Reference < view::XPrintJobListener>*)0), xListener ); } void SAL_CALL SfxPrintHelper::removePrintJobListener( const ::com::sun::star::uno::Reference< ::com::sun::star::view::XPrintJobListener >& xListener ) throw (::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; m_pData->m_aInterfaceContainer.removeInterface( ::getCppuType((const uno::Reference < view::XPrintJobListener>*)0), xListener ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/printhelper.hxx b/sfx2/source/doc/printhelper.hxx index 6e0e2d0fd8..8149d7395c 100755..100644 --- a/sfx2/source/doc/printhelper.hxx +++ b/sfx2/source/doc/printhelper.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -67,3 +68,5 @@ private: IMPL_PrintListener_DataContainer* m_pData ; virtual void impl_setPrinter(const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& rPrinter,SfxPrinter*& pPrinter,sal_uInt16& nChangeFlags,SfxViewShell*& pViewSh); } ; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/querytemplate.cxx b/sfx2/source/doc/querytemplate.cxx index 86ff2bdd90..d7a6afb78f 100644 --- a/sfx2/source/doc/querytemplate.cxx +++ b/sfx2/source/doc/querytemplate.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -50,3 +51,4 @@ QueryTemplateBox::QueryTemplateBox( Window* pParent, const String& rMessage ) : } // end of namespace sfx2 +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/querytemplate.hxx b/sfx2/source/doc/querytemplate.hxx index 0805dd73fc..ef7d06eb39 100644 --- a/sfx2/source/doc/querytemplate.hxx +++ b/sfx2/source/doc/querytemplate.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -42,3 +43,4 @@ namespace sfx2 #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/sfxacldetect.hxx b/sfx2/source/doc/sfxacldetect.hxx new file mode 100644 index 0000000000..99868f6507 --- /dev/null +++ b/sfx2/source/doc/sfxacldetect.hxx @@ -0,0 +1,39 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Kohei Yoshida <kyoshida@novell.com> + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#ifndef __SFXACLDETECT_HXX__ +#define __SFXACLDETECT_HXX__ + +// Let's check if this extra ACL check is still necessary... If disabling it +// causes no regressions, then we can safely remove this code. +#define EXTRA_ACL_CHECK 0 + +#if EXTRA_ACL_CHECK +sal_Bool IsReadonlyAccordingACL( const sal_Unicode* pFilePath ); +#endif + +#endif diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 7e6eab4a21..9feb25950c 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -80,7 +81,7 @@ #include <tools/urlobj.hxx> #include <tools/diagnose_ex.h> #include <unotools/tempfile.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <vcl/salctype.hxx> #include <sot/clsids.hxx> #include <sot/storinfo.hxx> @@ -133,10 +134,6 @@ #include <sfx2/sfxresid.hxx> //________________________________________________________________________________________________________ -// const -static const ::rtl::OUString SERVICENAME_DESKTOP = ::rtl::OUString::createFromAscii ("com.sun.star.frame.Desktop"); - -//________________________________________________________________________________________________________ // namespaces //________________________________________________________________________________________________________ @@ -284,8 +281,8 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument const uno::Reference<frame:: XTransientDocumentsDocumentContentFactory> xTDDCF( xMsf->createInstanceWithContext( - ::rtl::OUString::createFromAscii( "com.sun.star.frame." - "TransientDocumentsDocumentContentFactory"), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame." + "TransientDocumentsDocumentContentFactory")), xContext), uno::UNO_QUERY_THROW); const uno::Reference<ucb::XContent> xContent( @@ -299,7 +296,7 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument OSL_ENSURE(uri.getLength(), "GetDMA: empty uri?"); if (uri.getLength() && !uri.endsWithAsciiL("/", 1)) { - uri = uri + ::rtl::OUString::createFromAscii("/"); + uri = uri + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); } m_xDocumentMetadata = new ::sfx2::DocumentMetadataAccess( @@ -473,8 +470,8 @@ SfxSaveGuard::SfxSaveGuard(const uno::Reference< frame::XModel >& xM , m_pData (pData ) , m_pFramesLock(0 ) { - static ::rtl::OUString MSG_1 = ::rtl::OUString::createFromAscii("Object already disposed." ); - static ::rtl::OUString MSG_2 = ::rtl::OUString::createFromAscii("Concurrent save requests on the same document are not possible."); + static ::rtl::OUString MSG_1(RTL_CONSTASCII_USTRINGPARAM("Object already disposed.")); + static ::rtl::OUString MSG_2(RTL_CONSTASCII_USTRINGPARAM("Concurrent save requests on the same document are not possible.")); if ( m_pData->m_bClosed ) throw ::com::sun::star::lang::DisposedException( @@ -864,12 +861,12 @@ uno::Reference< document::XDocumentInfo > SAL_CALL SfxBaseModel::getDocumentInfo } catch (uno::RuntimeException &) { throw; } catch (uno::Exception & e) { - throw lang::WrappedTargetRuntimeException(::rtl::OUString::createFromAscii( - "SfxBaseModel::getDocumentInfo: cannot initialize"), *this, + throw lang::WrappedTargetRuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "SfxBaseModel::getDocumentInfo: cannot initialize")), *this, uno::makeAny(e)); } try { - rtl::OUString aName = rtl::OUString::createFromAscii("MediaType"); + rtl::OUString aName(RTL_CONSTASCII_USTRINGPARAM("MediaType")); uno::Reference < beans::XPropertySet > xSet( getDocumentStorage(), uno::UNO_QUERY ); uno::Any aMediaType = xSet->getPropertyValue( aName ); @@ -883,7 +880,15 @@ uno::Reference< document::XDocumentInfo > SAL_CALL SfxBaseModel::getDocumentInfo return m_pData->m_xDocumentInfo; } - +void +SfxBaseModel::setDocumentProperties( const uno::Reference< document::XDocumentProperties >& rxNewDocProps ) +{ + // object already disposed? + ::SolarMutexGuard aGuard; + if ( impl_isDisposed() ) + throw lang::DisposedException(); + m_pData->m_xDocumentProperties.set(rxNewDocProps, uno::UNO_QUERY_THROW); +} // document::XDocumentPropertiesSupplier: uno::Reference< document::XDocumentProperties > SAL_CALL SfxBaseModel::getDocumentProperties() @@ -913,7 +918,7 @@ SfxBaseModel::getDocumentProperties() void SAL_CALL SfxBaseModel::disposing( const lang::EventObject& aObject ) throw(::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( impl_isDisposed() ) return; @@ -1064,13 +1069,13 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SfxBaseModel::getArgs() throw(::c aRectSeq[3] = aTmpRect.Bottom(); seqArgsNew.realloc( ++nNewLength ); - seqArgsNew[ nNewLength - 1 ].Name = ::rtl::OUString::createFromAscii( "WinExtent" ); + seqArgsNew[ nNewLength - 1 ].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WinExtent")); seqArgsNew[ nNewLength - 1 ].Value <<= aRectSeq; if ( m_pData->m_aPreusedFilterName.getLength() ) { seqArgsNew.realloc( ++nNewLength ); - seqArgsNew[ nNewLength - 1 ].Name = ::rtl::OUString::createFromAscii( "PreusedFilterName" ); + seqArgsNew[ nNewLength - 1 ].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PreusedFilterName")); seqArgsNew[ nNewLength - 1 ].Value <<= m_pData->m_aPreusedFilterName; } @@ -1086,7 +1091,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SfxBaseModel::getArgs() throw(::c aBorderSeq[3] = aBorder.Bottom(); seqArgsNew.realloc( ++nNewLength ); - seqArgsNew[ nNewLength - 1 ].Name = ::rtl::OUString::createFromAscii( "DocumentBorder" ); + seqArgsNew[ nNewLength - 1 ].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentBorder")); seqArgsNew[ nNewLength - 1 ].Value <<= aBorderSeq; } @@ -1359,7 +1364,7 @@ void SAL_CALL SfxBaseModel::removeModifyListener(const uno::Reference< XMODIFYLI void SAL_CALL SfxBaseModel::close( sal_Bool bDeliverOwnership ) throw (util::CloseVetoException, uno::RuntimeException) { - static ::rtl::OUString MSG_1 = ::rtl::OUString::createFromAscii("Cant close while saving."); + static ::rtl::OUString MSG_1(RTL_CONSTASCII_USTRINGPARAM("Cant close while saving.")); ::vos::OGuard aGuard( Application::GetSolarMutex() ); if ( impl_isDisposed() || m_pData->m_bClosed || m_pData->m_bClosing ) @@ -1921,7 +1926,7 @@ uno::Any SAL_CALL SfxBaseModel::getTransferData( const DATAFLAVOR& aFlavor ) if ( m_pData->m_pObjectShell.Is() ) { - if ( aFlavor.MimeType.equalsAscii( "application/x-openoffice-objectdescriptor-xml;windows_formatname=\"Star Object Descriptor (XML)\"" ) ) + if ( aFlavor.MimeType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application/x-openoffice-objectdescriptor-xml;windows_formatname=\"Star Object Descriptor (XML)\"")) ) { if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) ) { @@ -1950,7 +1955,7 @@ uno::Any SAL_CALL SfxBaseModel::getTransferData( const DATAFLAVOR& aFlavor ) else throw datatransfer::UnsupportedFlavorException(); } - else if ( aFlavor.MimeType.equalsAscii( "application/x-openoffice-embed-source;windows_formatname=\"Star EMBS\"" ) ) + else if ( aFlavor.MimeType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application/x-openoffice-embed-source;windows_formatname=\"Star EMBS\"")) ) { if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) ) { @@ -1975,7 +1980,7 @@ uno::Any SAL_CALL SfxBaseModel::getTransferData( const DATAFLAVOR& aFlavor ) else throw datatransfer::UnsupportedFlavorException(); } - else if ( aFlavor.MimeType.equalsAscii( "application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"" ) ) + else if ( aFlavor.MimeType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"")) ) { if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) ) { @@ -1996,12 +2001,12 @@ uno::Any SAL_CALL SfxBaseModel::getTransferData( const DATAFLAVOR& aFlavor ) else throw datatransfer::UnsupportedFlavorException(); } - else if ( aFlavor.MimeType.equalsAscii( "application/x-openoffice-highcontrast-gdimetafile;windows_formatname=\"GDIMetaFile\"" ) ) + else if ( aFlavor.MimeType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application/x-openoffice-highcontrast-gdimetafile;windows_formatname=\"GDIMetaFile\"")) ) { if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) ) { ::boost::shared_ptr<GDIMetaFile> pMetaFile = - m_pData->m_pObjectShell->CreatePreviewMetaFile_Impl( sal_True, sal_True ); + m_pData->m_pObjectShell->CreatePreviewMetaFile_Impl( sal_True ); if ( pMetaFile ) { @@ -2016,7 +2021,7 @@ uno::Any SAL_CALL SfxBaseModel::getTransferData( const DATAFLAVOR& aFlavor ) else throw datatransfer::UnsupportedFlavorException(); } - else if ( aFlavor.MimeType.equalsAscii( "application/x-openoffice-emf;windows_formatname=\"Image EMF\"" ) ) + else if ( aFlavor.MimeType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application/x-openoffice-emf;windows_formatname=\"Image EMF\"")) ) { if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) ) { @@ -2051,7 +2056,7 @@ uno::Any SAL_CALL SfxBaseModel::getTransferData( const DATAFLAVOR& aFlavor ) else throw datatransfer::UnsupportedFlavorException(); } - else if ( aFlavor.MimeType.equalsAscii( "application/x-openoffice-wmf;windows_formatname=\"Image WMF\"" ) ) + else if ( aFlavor.MimeType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application/x-openoffice-wmf;windows_formatname=\"Image WMF\"")) ) { if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) ) { @@ -2091,7 +2096,7 @@ uno::Any SAL_CALL SfxBaseModel::getTransferData( const DATAFLAVOR& aFlavor ) else throw datatransfer::UnsupportedFlavorException(); } - else if ( aFlavor.MimeType.equalsAscii( "application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"" ) ) + else if ( aFlavor.MimeType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"")) ) { if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) ) { @@ -2115,7 +2120,7 @@ uno::Any SAL_CALL SfxBaseModel::getTransferData( const DATAFLAVOR& aFlavor ) else throw datatransfer::UnsupportedFlavorException(); } - else if ( aFlavor.MimeType.equalsAscii( "image/png" ) ) + else if ( aFlavor.MimeType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("image/png")) ) { if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) ) { @@ -2225,17 +2230,17 @@ sal_Bool SAL_CALL SfxBaseModel::isDataFlavorSupported( const DATAFLAVOR& aFlavor { SfxModelGuard aGuard( *this ); - if ( aFlavor.MimeType.equalsAscii( "application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"" ) ) + if ( aFlavor.MimeType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"")) ) { if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) ) return sal_True; } - else if ( aFlavor.MimeType.equalsAscii( "application/x-openoffice-highcontrast-gdimetafile;windows_formatname=\"GDIMetaFile\"" ) ) + else if ( aFlavor.MimeType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application/x-openoffice-highcontrast-gdimetafile;windows_formatname=\"GDIMetaFile\"")) ) { if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) ) return sal_True; } - else if ( aFlavor.MimeType.equalsAscii( "application/x-openoffice-emf;windows_formatname=\"Image EMF\"" ) ) + else if ( aFlavor.MimeType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application/x-openoffice-emf;windows_formatname=\"Image EMF\"")) ) { if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) ) return sal_True; @@ -2243,7 +2248,7 @@ sal_Bool SAL_CALL SfxBaseModel::isDataFlavorSupported( const DATAFLAVOR& aFlavor && aFlavor.DataType == getCppuType( (const sal_uInt64*) 0 ) ) return sal_True; } - else if ( aFlavor.MimeType.equalsAscii( "application/x-openoffice-wmf;windows_formatname=\"Image WMF\"" ) ) + else if ( aFlavor.MimeType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application/x-openoffice-wmf;windows_formatname=\"Image WMF\"")) ) { if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) ) return sal_True; @@ -2251,22 +2256,22 @@ sal_Bool SAL_CALL SfxBaseModel::isDataFlavorSupported( const DATAFLAVOR& aFlavor && aFlavor.DataType == getCppuType( (const sal_uInt64*) 0 ) ) return sal_True; } - else if ( aFlavor.MimeType.equalsAscii( "application/x-openoffice-objectdescriptor-xml;windows_formatname=\"Star Object Descriptor (XML)\"" ) ) + else if ( aFlavor.MimeType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application/x-openoffice-objectdescriptor-xml;windows_formatname=\"Star Object Descriptor (XML)\"")) ) { if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) ) return sal_True; } - else if ( aFlavor.MimeType.equalsAscii( "application/x-openoffice-embed-source;windows_formatname=\"Star EMBS\"" ) ) + else if ( aFlavor.MimeType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application/x-openoffice-embed-source;windows_formatname=\"Star EMBS\"")) ) { if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) ) return sal_True; } - else if ( aFlavor.MimeType.equalsAscii( "application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"" ) ) + else if ( aFlavor.MimeType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"")) ) { if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) ) return sal_True; } - else if ( aFlavor.MimeType.equalsAscii( "image/png" ) ) + else if ( aFlavor.MimeType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("image/png")) ) { if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) ) return sal_True; @@ -2421,7 +2426,7 @@ void addTitle_Impl( Sequence < ::com::sun::star::beans::PropertyValue >& rSeq, c for ( nArg = 0; nArg < nCount; nArg++ ) { ::com::sun::star::beans::PropertyValue& rProp = rSeq[nArg]; - if ( rProp.Name.equalsAscii("Title") ) + if ( rProp.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Title")) ) { rProp.Value <<= rTitle; break; @@ -2656,6 +2661,17 @@ void SfxBaseModel::MethodEntryCheck( const bool i_mustBeInitialized ) const throw ::com::sun::star::lang::NotInitializedException( ::rtl::OUString(), *const_cast< SfxBaseModel* >( this ) ); } +sal_Bool SfxBaseModel::IsInitialized() const +{ + if ( !m_pData || !m_pData->m_pObjectShell ) + { + OSL_ENSURE( false, "SfxBaseModel::IsInitialized: this should have been caught earlier!" ); + return sal_False; + } + + return m_pData->m_pObjectShell->GetMedium() != NULL; +} + sal_Bool SfxBaseModel::impl_isDisposed() const { return ( m_pData == NULL ) ; @@ -3151,7 +3167,6 @@ Sequence< ::rtl::OUString > SAL_CALL SfxBaseModel::getDocumentSubStoragesNames() SfxModelGuard aGuard( *this ); Sequence< ::rtl::OUString > aResult; - sal_Int32 nResultSize = 0; sal_Bool bSuccess = sal_False; if ( m_pData->m_pObjectShell.Is() ) { @@ -3160,6 +3175,7 @@ Sequence< ::rtl::OUString > SAL_CALL SfxBaseModel::getDocumentSubStoragesNames() if ( xAccess.is() ) { Sequence< ::rtl::OUString > aTemp = xAccess->getElementNames(); + sal_Int32 nResultSize = 0; for ( sal_Int32 n = 0; n < aTemp.getLength(); n++ ) { if ( xStorage->isStorageElement( aTemp[n] ) ) @@ -3229,7 +3245,7 @@ rtl::OUString SfxBaseModel::getRuntimeUID() const sal_Bool SfxBaseModel::hasValidSignatures() const { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( m_pData->m_pObjectShell.Is() ) return ( m_pData->m_pObjectShell->ImplGetSignatureState( sal_False ) == SIGNATURESTATE_SIGNATURES_OK ); return sal_False; @@ -3242,7 +3258,7 @@ static void GetCommandFromSequence( rtl::OUString& rCommand, sal_Int32& nIndex, for ( sal_Int32 i = 0; i < rSeqPropValue.getLength(); i++ ) { - if ( rSeqPropValue[i].Name.equalsAsciiL( "Command", 7 )) + if ( rSeqPropValue[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Command")) ) { rSeqPropValue[i].Value >>= rCommand; nIndex = i; @@ -3299,7 +3315,7 @@ uno::Reference< ui::XUIConfigurationManager > SAL_CALL SfxBaseModel::getUIConfig { uno::Reference< ui::XUIConfigurationManager > xNewUIConfMan( ::comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString::createFromAscii( "com.sun.star.ui.UIConfigurationManager" )), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.UIConfigurationManager"))), uno::UNO_QUERY ); Reference< ui::XUIConfigurationStorage > xUIConfigStorage( xNewUIConfMan, uno::UNO_QUERY ); @@ -3421,7 +3437,6 @@ void SAL_CALL SfxBaseModel::setVisualAreaSize( sal_Int64 nAspect, const awt::Siz Size aWinSize = pWindow->GetSizePixel(); awt::Size aCurrent = getVisualAreaSize( nAspect ); Size aDiff( aSize.Width-aCurrent.Width, aSize.Height-aCurrent.Height ); - Size aWrongDiff = OutputDevice::LogicToLogic( aDiff , m_pData->m_pObjectShell->GetMapUnit(), pWindow->GetMapMode() ); aDiff = pViewFrm->GetViewShell()->GetWindow()->LogicToPixel( aDiff ); aWinSize.Width() += aDiff.Width(); aWinSize.Height() += aDiff.Height(); @@ -3448,20 +3463,6 @@ awt::Size SAL_CALL SfxBaseModel::getVisualAreaSize( sal_Int64 /*nAspect*/ ) Rectangle aTmpRect = m_pData->m_pObjectShell->GetVisArea( ASPECT_CONTENT ); -#if 0 - Window* pWindow = NULL; - SfxViewFrame* pViewFrm = m_pData->m_pObjectShell.Is() ? - SfxViewFrame::GetFirst( m_pData->m_pObjectShell, 0, sal_False ) : 0; - - if ( pWindow ) - { - MapMode aInternalMapMode( pViewFrm->GetWindow().GetMapMode() ); - MapMode aExternalMapMode( m_pData->m_pObjectShell->GetMapUnit() ); - - aTmpRect = OutputDevice::LogicToLogic( aTmpRect, aInternalMapMode, aExternalMapMode ); - } -#endif - return awt::Size( aTmpRect.GetWidth(), aTmpRect.GetHeight() ); } @@ -3487,8 +3488,8 @@ embed::VisualRepresentation SAL_CALL SfxBaseModel::getPreferredVisualRepresentat SfxModelGuard aGuard( *this ); datatransfer::DataFlavor aDataFlavor( - ::rtl::OUString::createFromAscii( "application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"" ), - ::rtl::OUString::createFromAscii( "GDIMetaFile" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"" )), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GDIMetaFile")), ::getCppuType( (const uno::Sequence< sal_Int8 >*) NULL ) ); embed::VisualRepresentation aVisualRepresentation; @@ -3616,15 +3617,23 @@ void SAL_CALL SfxBaseModel::switchToStorage( const uno::Reference< XSTORAGE >& x throw IOEXCEPTION(); // TODO: // the persistence should be switched only if the storage is different - if ( xStorage != m_pData->m_pObjectShell->GetStorage() - && !m_pData->m_pObjectShell->SwitchPersistance( xStorage ) ) + if ( xStorage != m_pData->m_pObjectShell->GetStorage() ) { - sal_uInt32 nError = m_pData->m_pObjectShell->GetErrorCode(); - throw task::ErrorCodeIOException( ::rtl::OUString(), - uno::Reference< uno::XInterface >(), - nError ? nError : ERRCODE_IO_GENERAL ); + if ( !m_pData->m_pObjectShell->SwitchPersistance( xStorage ) ) + { + sal_uInt32 nError = m_pData->m_pObjectShell->GetErrorCode(); + throw task::ErrorCodeIOException( ::rtl::OUString(), + uno::Reference< uno::XInterface >(), + nError ? nError : ERRCODE_IO_GENERAL ); + } + else + { + // UICfgMgr has a reference to the old storage, update it + uno::Reference< ui::XUIConfigurationStorage > xUICfgMgrStorage( getUIConfigurationManager(), uno::UNO_QUERY ); + if ( xUICfgMgrStorage.is() ) + xUICfgMgrStorage->setStorage( xStorage ); + } } - m_pData->m_pObjectShell->Get_Impl()->bOwnsStorage = FALSE; } @@ -3707,6 +3716,7 @@ css::uno::Reference< css::frame::XTitle > SfxBaseModel::impl_getTitleHelper () if ( ! m_pData->m_xTitleHelper.is ()) { css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory (); + static const ::rtl::OUString SERVICENAME_DESKTOP(RTL_CONSTASCII_USTRINGPARAM("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); @@ -3732,7 +3742,7 @@ css::uno::Reference< css::frame::XUntitledNumbers > SfxBaseModel::impl_getUntitl m_pData->m_xNumberedControllers = css::uno::Reference< css::frame::XUntitledNumbers >(static_cast< ::cppu::OWeakObject* >(pHelper), css::uno::UNO_QUERY_THROW); pHelper->setOwner (xThis); - pHelper->setUntitledPrefix (::rtl::OUString::createFromAscii(" : ")); + pHelper->setUntitledPrefix (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" : "))); } return m_pData->m_xNumberedControllers; @@ -4093,8 +4103,8 @@ SfxBaseModel::getRDFRepository() throw (uno::RuntimeException) const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA()); if (!xDMA.is()) { - throw uno::RuntimeException( ::rtl::OUString::createFromAscii( - "model has no document metadata"), *this ); + throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "model has no document metadata")), *this ); } return xDMA->getRDFRepository(); @@ -4108,8 +4118,8 @@ SfxBaseModel::getStringValue() throw (uno::RuntimeException) const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA()); if (!xDMA.is()) { - throw uno::RuntimeException( ::rtl::OUString::createFromAscii( - "model has no document metadata"), *this ); + throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "model has no document metadata")), *this ); } return xDMA->getStringValue(); @@ -4123,8 +4133,8 @@ SfxBaseModel::getNamespace() throw (uno::RuntimeException) const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA()); if (!xDMA.is()) { - throw uno::RuntimeException( ::rtl::OUString::createFromAscii( - "model has no document metadata"), *this ); + throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "model has no document metadata")), *this ); } return xDMA->getNamespace(); @@ -4137,8 +4147,8 @@ SfxBaseModel::getLocalName() throw (uno::RuntimeException) const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA()); if (!xDMA.is()) { - throw uno::RuntimeException( ::rtl::OUString::createFromAscii( - "model has no document metadata"), *this ); + throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "model has no document metadata")), *this ); } return xDMA->getLocalName(); @@ -4154,8 +4164,8 @@ throw (uno::RuntimeException) const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA()); if (!xDMA.is()) { - throw uno::RuntimeException( ::rtl::OUString::createFromAscii( - "model has no document metadata"), *this ); + throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "model has no document metadata")), *this ); } return xDMA->getElementByMetadataReference(i_rReference); @@ -4169,8 +4179,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException) const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA()); if (!xDMA.is()) { - throw uno::RuntimeException( ::rtl::OUString::createFromAscii( - "model has no document metadata"), *this ); + throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "model has no document metadata")), *this ); } return xDMA->getElementByURI(i_xURI); @@ -4185,8 +4195,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException) const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA()); if (!xDMA.is()) { - throw uno::RuntimeException( ::rtl::OUString::createFromAscii( - "model has no document metadata"), *this ); + throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "model has no document metadata")), *this ); } return xDMA->getMetadataGraphsWithType(i_xType); @@ -4202,8 +4212,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA()); if (!xDMA.is()) { - throw uno::RuntimeException( ::rtl::OUString::createFromAscii( - "model has no document metadata"), *this ); + throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "model has no document metadata")), *this ); } return xDMA->addMetadataFile(i_rFileName, i_rTypes); @@ -4223,8 +4233,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA()); if (!xDMA.is()) { - throw uno::RuntimeException( ::rtl::OUString::createFromAscii( - "model has no document metadata"), *this ); + throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "model has no document metadata")), *this ); } return xDMA->importMetadataFile(i_Format, @@ -4241,8 +4251,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA()); if (!xDMA.is()) { - throw uno::RuntimeException( ::rtl::OUString::createFromAscii( - "model has no document metadata"), *this ); + throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "model has no document metadata")), *this ); } return xDMA->removeMetadataFile(i_xGraphName); @@ -4257,8 +4267,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA()); if (!xDMA.is()) { - throw uno::RuntimeException( ::rtl::OUString::createFromAscii( - "model has no document metadata"), *this ); + throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "model has no document metadata")), *this ); } return xDMA->addContentOrStylesFile(i_rFileName); @@ -4273,8 +4283,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA()); if (!xDMA.is()) { - throw uno::RuntimeException( ::rtl::OUString::createFromAscii( - "model has no document metadata"), *this ); + throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "model has no document metadata")), *this ); } return xDMA->removeContentOrStylesFile(i_rFileName); @@ -4293,8 +4303,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, const uno::Reference<rdf::XDocumentMetadataAccess> xDMA( m_pData->CreateDMAUninitialized()); if (!xDMA.is()) { - throw uno::RuntimeException( ::rtl::OUString::createFromAscii( - "model has no document metadata"), *this ); + throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "model has no document metadata")), *this ); } try { @@ -4320,8 +4330,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA()); if (!xDMA.is()) { - throw uno::RuntimeException( ::rtl::OUString::createFromAscii( - "model has no document metadata"), *this ); + throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "model has no document metadata")), *this ); } return xDMA->storeMetadataToStorage(i_xStorage); @@ -4338,8 +4348,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, const uno::Reference<rdf::XDocumentMetadataAccess> xDMA( m_pData->CreateDMAUninitialized()); if (!xDMA.is()) { - throw uno::RuntimeException( ::rtl::OUString::createFromAscii( - "model has no document metadata"), *this ); + throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "model has no document metadata")), *this ); } try { @@ -4364,10 +4374,11 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA()); if (!xDMA.is()) { - throw uno::RuntimeException( ::rtl::OUString::createFromAscii( - "model has no document metadata"), *this ); + throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "model has no document metadata")), *this ); } return xDMA->storeMetadataToMedium(i_rMedium); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/sfxmodelfactory.cxx b/sfx2/source/doc/sfxmodelfactory.cxx index 6f9545e244..a22671c8d0 100644 --- a/sfx2/source/doc/sfxmodelfactory.cxx +++ b/sfx2/source/doc/sfxmodelfactory.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -237,3 +238,5 @@ namespace sfx2 //........................................................................ } // namespace sfx2 //........................................................................ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/syspath.hxx b/sfx2/source/doc/syspath.hxx deleted file mode 100644 index cc1a1ef2ed..0000000000 --- a/sfx2/source/doc/syspath.hxx +++ /dev/null @@ -1,44 +0,0 @@ -/************************************************************************* -* -* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -* -* Copyright 2008 by Sun Microsystems, Inc. -* -* OpenOffice.org - a multi-platform office productivity suite -* -* $RCSfile: shutdowniconw32.cxx,v $ -* $Revision: 1.48 $ -* -* This file is part of OpenOffice.org. -* -* OpenOffice.org is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License version 3 -* only, as published by the Free Software Foundation. -* -* OpenOffice.org is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU Lesser General Public License version 3 for more details -* (a copy is included in the LICENSE file that accompanied this code). -* -* You should have received a copy of the GNU Lesser General Public License -* version 3 along with OpenOffice.org. If not, see -* <http://www.openoffice.org/license.html> -* for a copy of the LGPLv3 License. -* -************************************************************************/ - -#ifndef __SYSPATH_HXX__ -#define __SYSPATH_HXX__ -//#pragma warning(disable:4917) - -#include <sfx2/dllapi.h> - -class SFX2_DLLPUBLIC SystemPath -{ -public: - static bool GetUserTemplateLocation(sal_Unicode*, int nSize); -}; - -#endif - diff --git a/sfx2/source/explorer/nochaos.cxx b/sfx2/source/explorer/nochaos.cxx index 0cd3162a27..dedac405ff 100644 --- a/sfx2/source/explorer/nochaos.cxx +++ b/sfx2/source/explorer/nochaos.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -213,3 +214,5 @@ CntStaticPoolDefaults_Impl::CntStaticPoolDefaults_Impl( CntItemPool* /*pPool*/ ) 0, SFX_ITEM_POOLABLE ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/SfxDocumentMetaData.hxx b/sfx2/source/inc/SfxDocumentMetaData.hxx index 871ed19d5e..27ae280fd6 100644 --- a/sfx2/source/inc/SfxDocumentMetaData.hxx +++ b/sfx2/source/inc/SfxDocumentMetaData.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -45,5 +46,17 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL _create( } // closing component helper namespace +namespace comp_CompatWriterDocProps { + +namespace css = ::com::sun::star; + +// component and service helper functions: +::rtl::OUString SAL_CALL _getImplementationName(); +css::uno::Sequence< ::rtl::OUString > SAL_CALL _getSupportedServiceNames(); +css::uno::Reference< css::uno::XInterface > SAL_CALL _create( + css::uno::Reference< css::uno::XComponentContext > const & context ); + +} #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/alienwarn.hxx b/sfx2/source/inc/alienwarn.hxx index c358a4a93b..53300e2cd3 100644 --- a/sfx2/source/inc/alienwarn.hxx +++ b/sfx2/source/inc/alienwarn.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,9 +28,7 @@ #ifndef _SFX_ALIENWARN_HXX #define _SFX_ALIENWARN_HXX -#ifndef _SV_BUTTON_HXX #include <vcl/button.hxx> -#endif #include <vcl/fixed.hxx> #include <sfx2/basedlgs.hxx> @@ -54,3 +53,4 @@ public: #endif // #ifndef _SFX_ALIENWARN_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/appbas.hxx b/sfx2/source/inc/appbas.hxx index cb08763ace..2fea537d06 100644 --- a/sfx2/source/inc/appbas.hxx +++ b/sfx2/source/inc/appbas.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -42,3 +43,4 @@ SbxVariable* MakeVariable( StarBASIC *pBas, SbxObject *pObject, #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/appbaslib.hxx b/sfx2/source/inc/appbaslib.hxx index 6d327efb01..6a38048702 100644 --- a/sfx2/source/inc/appbaslib.hxx +++ b/sfx2/source/inc/appbaslib.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -138,3 +139,4 @@ public: #endif // APPBASLIB_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/appdata.hxx b/sfx2/source/inc/appdata.hxx index eff70fb605..143045a993 100644 --- a/sfx2/source/inc/appdata.hxx +++ b/sfx2/source/inc/appdata.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -180,3 +181,4 @@ public: #endif // #ifndef _SFX_APPDATA_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/doctemplates.hxx b/sfx2/source/inc/doctemplates.hxx index 0b6b46bd57..b1d9a61da7 100644 --- a/sfx2/source/inc/doctemplates.hxx +++ b/sfx2/source/inc/doctemplates.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -100,3 +101,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/eventsupplier.hxx b/sfx2/source/inc/eventsupplier.hxx index b8c1adba42..4bee9a24bd 100644 --- a/sfx2/source/inc/eventsupplier.hxx +++ b/sfx2/source/inc/eventsupplier.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -52,7 +53,7 @@ #include <comphelper/sequenceasvector.hxx> #include <sfx2/sfxuno.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <cppuhelper/interfacecontainer.hxx> #include <svl/lstner.hxx> #include <unotools/eventcfg.hxx> @@ -262,3 +263,5 @@ private: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/fltfnc.hxx b/sfx2/source/inc/fltfnc.hxx index 40facd03fa..6d82667441 100644 --- a/sfx2/source/inc/fltfnc.hxx +++ b/sfx2/source/inc/fltfnc.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -33,3 +34,4 @@ BOOL SfxIsHelpEntryURL( const String &rURL, const String &rExtMask ); #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/fltoptint.hxx b/sfx2/source/inc/fltoptint.hxx index 91765b3a55..715a211df0 100644 --- a/sfx2/source/inc/fltoptint.hxx +++ b/sfx2/source/inc/fltoptint.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. diff --git a/sfx2/source/inc/helper.hxx b/sfx2/source/inc/helper.hxx index 78e04c0fdf..a9761f4eb3 100644 --- a/sfx2/source/inc/helper.hxx +++ b/sfx2/source/inc/helper.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -76,3 +77,4 @@ public: #endif // #ifndef _SFX_HELPER_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/helpid.hrc b/sfx2/source/inc/helpid.hrc index 0e96396065..0e96396065 100644..100755 --- a/sfx2/source/inc/helpid.hrc +++ b/sfx2/source/inc/helpid.hrc diff --git a/sfx2/source/inc/hexplwnd.hxx b/sfx2/source/inc/hexplwnd.hxx index 84a0ccdfbc..f0d9cbee44 100644 --- a/sfx2/source/inc/hexplwnd.hxx +++ b/sfx2/source/inc/hexplwnd.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -99,3 +100,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/iframe.hxx b/sfx2/source/inc/iframe.hxx index f3e69c2a97..c2c775b7b4 100644 --- a/sfx2/source/inc/iframe.hxx +++ b/sfx2/source/inc/iframe.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -91,3 +92,5 @@ public: } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/intro.hxx b/sfx2/source/inc/intro.hxx index 3b6119a6f0..6b9212cdee 100644 --- a/sfx2/source/inc/intro.hxx +++ b/sfx2/source/inc/intro.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -53,3 +54,4 @@ public: #endif // #ifndef _SFX_INTRO_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/mailmodel.hxx b/sfx2/source/inc/mailmodel.hxx index 2a94f1ac67..584a228ffc 100644 --- a/sfx2/source/inc/mailmodel.hxx +++ b/sfx2/source/inc/mailmodel.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -103,3 +104,5 @@ public: BOOL CreateFromAddress_Impl( String& rFrom ); #endif // INCLUDED_SFX_MAILMODEL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/mnucfga.hxx b/sfx2/source/inc/mnucfga.hxx index 53b7ebe684..5d80683975 100644 --- a/sfx2/source/inc/mnucfga.hxx +++ b/sfx2/source/inc/mnucfga.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,9 +29,7 @@ #define _SFXMNUCFGA_HXX #include <tools/string.hxx> -#ifndef _SFXMINARRAY_HXX #include <sfx2/minarray.hxx> -#endif //================================================================== @@ -50,3 +49,4 @@ DECL_PTRARRAY(SfxMenuCfgItemArr, SfxMenuCfgItem*, 4, 4 ) #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/nfltdlg.hxx b/sfx2/source/inc/nfltdlg.hxx index ccd56e0252..208e473341 100644 --- a/sfx2/source/inc/nfltdlg.hxx +++ b/sfx2/source/inc/nfltdlg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,9 +31,7 @@ #include <vcl/dialog.hxx> #include <vcl/lstbox.hxx> -#ifndef _SV_BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif #include <vcl/fixed.hxx> class SfxFilterMatcher; @@ -64,3 +63,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/nochaos.hxx b/sfx2/source/inc/nochaos.hxx index 457063d3f8..e270ddffdb 100644 --- a/sfx2/source/inc/nochaos.hxx +++ b/sfx2/source/inc/nochaos.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -38,3 +39,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/objmnctl.hxx b/sfx2/source/inc/objmnctl.hxx index 3adea607c9..1b535ebec1 100644 --- a/sfx2/source/inc/objmnctl.hxx +++ b/sfx2/source/inc/objmnctl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,9 +29,7 @@ #define _SFX_OBJMNCTL_HXX -#ifndef _SFX_HXX #include <sfx2/mnuitem.hxx> -#endif class SfxBindings; class PopupMenu; @@ -54,3 +53,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/objshimp.hxx b/sfx2/source/inc/objshimp.hxx index c31a671f90..c7c1bc926d 100644 --- a/sfx2/source/inc/objshimp.hxx +++ b/sfx2/source/inc/objshimp.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,8 +28,6 @@ #ifndef _SFX_OBJSHIMP_HXX #define _SFX_OBJSHIMP_HXX -//#include <hash_map> - #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/uno/Sequence.hxx> #include <rtl/ustring.hxx> @@ -108,7 +107,8 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess bUseUserData:1, bSaveVersionOnClose:1, m_bSharedXMLFlag:1, // whether the flag should be stored in xml file - m_bAllowShareControlFileClean:1; // whether the flag should be stored in xml file + m_bAllowShareControlFileClean:1, // whether the flag should be stored in xml file + m_bConfigOptionsChecked:1; // whether or not the user options are checked after the Options dialog is closed. IndexBitSet aBitSet; sal_uInt32 lErr; @@ -174,3 +174,4 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/openflag.hxx b/sfx2/source/inc/openflag.hxx index 00600c5a10..70a5d7cd3a 100644 --- a/sfx2/source/inc/openflag.hxx +++ b/sfx2/source/inc/openflag.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -39,3 +40,5 @@ #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/ownsubfilterservice.hxx b/sfx2/source/inc/ownsubfilterservice.hxx index a85ae8b305..63e21234fb 100644 --- a/sfx2/source/inc/ownsubfilterservice.hxx +++ b/sfx2/source/inc/ownsubfilterservice.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,9 +31,7 @@ #include <com/sun/star/document/XFilter.hpp> #include <com/sun/star/lang/XInitialization.hpp> -#ifndef _COM_SUN_STAR_LANG_XPSERVICEINFO_HPP_ #include <com/sun/star/lang/XServiceInfo.hpp> -#endif #include <com/sun/star/lang/XSingleServiceFactory.hpp> #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/io/XStream.hpp> @@ -88,3 +87,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/partwnd.hxx b/sfx2/source/inc/partwnd.hxx index b515357562..ed7c9a9c9d 100644 --- a/sfx2/source/inc/partwnd.hxx +++ b/sfx2/source/inc/partwnd.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -88,3 +89,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/plugin.hxx b/sfx2/source/inc/plugin.hxx index bdb7a157c9..c4951614dc 100644 --- a/sfx2/source/inc/plugin.hxx +++ b/sfx2/source/inc/plugin.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -89,3 +90,5 @@ public: } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/preview.hxx b/sfx2/source/inc/preview.hxx index dfb1f1776c..0d5d84e84c 100644 --- a/sfx2/source/inc/preview.hxx +++ b/sfx2/source/inc/preview.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -71,3 +72,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/recfloat.hxx b/sfx2/source/inc/recfloat.hxx index 53cf9d2cff..f1db7cf16a 100644 --- a/sfx2/source/inc/recfloat.hxx +++ b/sfx2/source/inc/recfloat.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -67,3 +68,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/referers.hxx b/sfx2/source/inc/referers.hxx index 78885cdd5b..3f42928ba8 100644 --- a/sfx2/source/inc/referers.hxx +++ b/sfx2/source/inc/referers.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,3 +35,5 @@ #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/sfxpicklist.hxx b/sfx2/source/inc/sfxpicklist.hxx index 3839ef48c2..9956a7ab04 100644 --- a/sfx2/source/inc/sfxpicklist.hxx +++ b/sfx2/source/inc/sfxpicklist.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -84,3 +85,5 @@ class SfxPickList : public SfxListener }; #endif // _SFX_PICKLIST_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/sfxtypes.hxx b/sfx2/source/inc/sfxtypes.hxx index 4560408512..b1396539e4 100644 --- a/sfx2/source/inc/sfxtypes.hxx +++ b/sfx2/source/inc/sfxtypes.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,24 +29,14 @@ #define _SFX_SFXTYPES_HXX #include <tools/debug.hxx> -#ifndef _RC_HXX //autogen #include <tools/rc.hxx> -#endif -#ifndef _RCID_H //autogen #include <tools/rcid.h> -#endif -#ifndef _RESID_HXX //autogen #include <tools/resid.hxx> -#endif #include <tools/link.hxx> -#ifndef _APP_HXX //autogen #include <vcl/svapp.hxx> -#endif #include <vcl/wrkwin.hxx> -#ifndef _VOS_MUTEX_HXX //autogen -#include <vos/mutex.hxx> -#endif +#include <osl/mutex.hxx> #ifndef DELETEZ #define DELETEZ(pPtr) ( delete pPtr, pPtr = 0 ) @@ -197,3 +188,4 @@ public: #endif // #ifndef _SFX_SFXTYPES_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/sfxurlrelocator.hxx b/sfx2/source/inc/sfxurlrelocator.hxx index b7328def13..0bea52f42b 100644 --- a/sfx2/source/inc/sfxurlrelocator.hxx +++ b/sfx2/source/inc/sfxurlrelocator.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -52,3 +53,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/slotserv.hxx b/sfx2/source/inc/slotserv.hxx index 7f3ebde79d..65f297e3c6 100644 --- a/sfx2/source/inc/slotserv.hxx +++ b/sfx2/source/inc/slotserv.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -82,3 +83,5 @@ inline const SfxSlot* SfxSlotServer::GetSlot() const #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/splitwin.hxx b/sfx2/source/inc/splitwin.hxx index 7a6d4fc823..30a4170f15 100644 --- a/sfx2/source/inc/splitwin.hxx +++ b/sfx2/source/inc/splitwin.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,9 +28,7 @@ #ifndef _SFXSPLITWIN_HXX #define _SFXSPLITWIN_HXX -#ifndef _SPLITWIN_HXX //autogen #include <vcl/splitwin.hxx> -#endif #include <sfx2/childwin.hxx> class SfxWorkWindow; @@ -131,3 +130,4 @@ public: #endif // #ifndef _SFXSPLITWIN_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/statcach.hxx b/sfx2/source/inc/statcach.hxx index fd23e99857..955c805885 100644 --- a/sfx2/source/inc/statcach.hxx +++ b/sfx2/source/inc/statcach.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -38,13 +39,9 @@ #include <com/sun/star/beans/PropertyValue.hpp> #include <cppuhelper/weak.hxx> -#ifndef _SFXBINDINGS_HXX #include <sfx2/bindings.hxx> -#endif -#ifndef _SFXMSGSERV_HXX #include "slotserv.hxx" -#endif #include <sfx2/sfxuno.hxx> @@ -180,3 +177,5 @@ inline sal_uInt16 SfxStateCache::GetId() const } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/templdgi.hxx b/sfx2/source/inc/templdgi.hxx index a5e24e2ce9..25bc87ffc8 100644 --- a/sfx2/source/inc/templdgi.hxx +++ b/sfx2/source/inc/templdgi.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,13 +30,8 @@ class SfxTemplateControllerItem; -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif -#ifndef _TOOLBOX_HXX //autogen #include <vcl/toolbox.hxx> -#endif -#ifndef _LSTBOX_HXX //autogen #include <vcl/lstbox.hxx> #endif #include <svl/lstner.hxx> @@ -279,9 +275,6 @@ public: void SetAutomaticFilter(); }; -/* -----------------10.12.2003 11:42----------------- - - --------------------------------------------------*/ class DropToolBox_Impl : public ToolBox, public DropTargetHelper { @@ -392,3 +385,4 @@ friend class SfxTemplateCatalog; #endif // #ifndef _SFX_TEMPDLGI_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/tplcitem.hxx b/sfx2/source/inc/tplcitem.hxx index a13abfbcd3..da2c3b2549 100644 --- a/sfx2/source/inc/tplcitem.hxx +++ b/sfx2/source/inc/tplcitem.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -50,3 +51,5 @@ public: #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/tplcomp.hxx b/sfx2/source/inc/tplcomp.hxx index 572e571793..df486fc25a 100644 --- a/sfx2/source/inc/tplcomp.hxx +++ b/sfx2/source/inc/tplcomp.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,15 +30,6 @@ #define _TPLCOMP_HXX #include <osl/mutex.hxx> -//ASDBG #ifndef _USR_UNO_HXX -//ASDBG #include <usr/uno.hxx> -//ASDBG #endif -//ASDBG #ifndef _USR_LSTCOMP_HXX -//ASDBG #include <usr/iterhlp.hxx> -//ASDBG #endif -//ASDBG #ifndef _USR_SERVICES_HXX -//ASDBG #include <usr/services.hxx> -//ASDBG #endif #include <com/sun/star/chaos/XCommandExecutor.hpp> #include <com/sun/star/chaos/XStatusCallback.hpp> #include <com/sun/star/chaos/UnknownCommandException.hpp> @@ -222,3 +214,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/versdlg.hxx b/sfx2/source/inc/versdlg.hxx index edac2017a0..41dab39d52 100644 --- a/sfx2/source/inc/versdlg.hxx +++ b/sfx2/source/inc/versdlg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,15 +29,9 @@ #ifndef _VERSDLG_HXX #define _VERSDLG_HXX -// #include ***************************************************************** - -#ifndef _SV_BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif #include <vcl/fixed.hxx> -#ifndef _SVTREEBOX_HXX //autogen #include <svtools/svtabbx.hxx> -#endif #include <svtools/svmedit.hxx> #include <sfx2/basedlgs.hxx> @@ -107,3 +102,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/virtmenu.hxx b/sfx2/source/inc/virtmenu.hxx index 3d7e02d1a1..ce475ef54d 100644 --- a/sfx2/source/inc/virtmenu.hxx +++ b/sfx2/source/inc/virtmenu.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -63,12 +64,11 @@ private: BOOL bHelpInitialized : 1; BOOL bIsActive : 1; BOOL bControllersUnBound : 1; - BOOL bWasHighContrast : 1; BOOL bIsAddonPopupMenu : 1; private: void Construct_Impl(); - FASTBOOL Bind_Impl( Menu *pMenu ); + bool Bind_Impl( Menu *pMenu ); inline SfxMenuCtrlArr_Impl& GetAppCtrl_Impl() { return pAppCtrl? *pAppCtrl: *(pAppCtrl = new SfxMenuCtrlArr_Impl) ; @@ -108,7 +108,6 @@ public: USHORT GetItemId( USHORT nPos ) const; SfxVirtualMenu* GetPopupMenu( USHORT nId ) const; String GetItemText( USHORT nId ) const; - String GetItemHelpText( USHORT nId ) const; //void InvalidateKeyCodes(); @@ -124,7 +123,6 @@ public: void SetResMgr(ResMgr* pMgr) {pResMgr = pMgr; } ResMgr* GetResMgr() { return pResMgr; } void SetHelpIds( ResMgr* ); - BOOL IsHiContrastMode() const; void UpdateImages(); DECL_LINK( Select, Menu * ); @@ -157,3 +155,5 @@ inline USHORT SfxVirtualMenu::GetItemId( USHORT nPos ) const #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/workwin.hxx b/sfx2/source/inc/workwin.hxx index da70b744a4..3058669349 100644 --- a/sfx2/source/inc/workwin.hxx +++ b/sfx2/source/inc/workwin.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,9 +32,7 @@ #include <deque> #include <com/sun/star/frame/XDispatch.hpp> #include <com/sun/star/frame/XFrame.hpp> -#ifndef _COM_SUN_STAR_UI_XUILEMENT_HPP_ #include <com/sun/star/ui/XUIElement.hpp> -#endif #include <com/sun/star/task/XStatusIndicator.hpp> #include <com/sun/star/frame/XLayoutManagerListener.hpp> #include <cppuhelper/weak.hxx> @@ -42,7 +41,7 @@ #define _SVSTDARR_USHORTS #include <svl/svstdarr.hxx> // SvUShorts #include <rtl/ustring.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <sfx2/sfx.hrc> #include <sfx2/childwin.hxx> @@ -335,7 +334,7 @@ public: void SetObjectBar_Impl( USHORT nPos, sal_uInt32 nResId, SfxInterface *pIFace, const String* pName=0 ); Window* GetObjectBar_Impl( USHORT nPos, sal_uInt32 nResId ); - FASTBOOL KnowsObjectBar_Impl( USHORT nPos ) const; + bool KnowsObjectBar_Impl( USHORT nPos ) const; BOOL IsVisible_Impl(); void MakeVisible_Impl( BOOL ); void SetObjectBarVisibility_Impl( USHORT nVis ); @@ -389,3 +388,5 @@ public: #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inet/inettbc.cxx b/sfx2/source/inet/inettbc.cxx index e026dc6356..66fc47bfb6 100644 --- a/sfx2/source/inet/inettbc.cxx +++ b/sfx2/source/inet/inettbc.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,27 +31,17 @@ #include "inettbc.hxx" -#ifndef GCC -#endif #include <com/sun/star/uno/Any.h> -#ifndef _COM_SUN_STAR_FRAME_XFRAMESSUPLLIER_HPP_ #include <com/sun/star/frame/XFramesSupplier.hpp> -#endif #include <com/sun/star/task/XInteractionHandler.hpp> #include <svl/eitem.hxx> #include <svl/stritem.hxx> #include <unotools/historyoptions.hxx> #include <svl/folderrestriction.hxx> #include <vcl/toolbox.hxx> -#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_ #include <toolkit/unohlp.hxx> -#endif -#ifndef _VOS_THREAD_HXX //autogen -#include <vos/thread.hxx> -#endif -#ifndef _VOS_MUTEX_HXX //autogen -#include <vos/mutex.hxx> -#endif +#include <osl/thread.hxx> +#include <osl/mutex.hxx> #include <rtl/ustring.hxx> #include <svl/itemset.hxx> @@ -123,7 +114,7 @@ void SfxURLToolBoxControl_Impl::OpenURL( const String& rName, BOOL /*bNew*/ ) co if ( xDispatchProvider.is() && m_xServiceManager.is() ) { URL aTargetURL; - ::rtl::OUString aTarget( ::rtl::OUString::createFromAscii( "_default" )); + ::rtl::OUString aTarget( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_default"))); aTargetURL.Complete = aName; @@ -132,17 +123,17 @@ void SfxURLToolBoxControl_Impl::OpenURL( const String& rName, BOOL /*bNew*/ ) co if ( xDispatch.is() ) { Sequence< PropertyValue > aArgs( 2 ); - aArgs[0].Name = ::rtl::OUString::createFromAscii( "Referer" ); - aArgs[0].Value = makeAny( ::rtl::OUString::createFromAscii( SFX_REFERER_USER )); + aArgs[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Referer")); + aArgs[0].Value = makeAny( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SFX_REFERER_USER ))); aArgs[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FileName" )); aArgs[1].Value = makeAny( ::rtl::OUString( aName )); if ( aFilter.Len() ) { aArgs.realloc( 4 ); - aArgs[2].Name = ::rtl::OUString::createFromAscii( "FilterOptions" ); + aArgs[2].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FilterOptions")); aArgs[2].Value = makeAny( ::rtl::OUString( aOptions )); - aArgs[3].Name = ::rtl::OUString::createFromAscii( "FilterName" ); + aArgs[3].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FilterName")); aArgs[3].Value = makeAny( ::rtl::OUString( aFilter )); } @@ -203,7 +194,7 @@ IMPL_LINK( SfxURLToolBoxControl_Impl, OpenHdl, void*, EMPTYARG ) if ( m_xServiceManager.is() ) { Reference< XFramesSupplier > xDesktop( m_xServiceManager->createInstance( - ::rtl::OUString::createFromAscii( "com.sun.star.frame.Desktop" )), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop"))), UNO_QUERY ); Reference< XFrame > xFrame( xDesktop->getActiveFrame(), UNO_QUERY ); if ( xFrame.is() ) diff --git a/sfx2/source/layout/factory.cxx b/sfx2/source/layout/factory.cxx index 6d6c01c935..56a0f2eea2 100644 --- a/sfx2/source/layout/factory.cxx +++ b/sfx2/source/layout/factory.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -66,3 +67,5 @@ SAL_DLLPUBLIC_EXPORT Window* CreateWindow (VCLXWindow** vcl, OUString const& nam } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/layout/sfxdialog.cxx b/sfx2/source/layout/sfxdialog.cxx index 1c8c7c2080..c4b08357b4 100644 --- a/sfx2/source/layout/sfxdialog.cxx +++ b/sfx2/source/layout/sfxdialog.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -36,3 +37,5 @@ SfxDialog::SfxDialog(::Window* parent, char const* xml_file, char const* id, Sfx } } // end namespace layout + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/layout/sfxtabdialog.cxx b/sfx2/source/layout/sfxtabdialog.cxx index 889ed8a0bc..d3b91172d7 100644 --- a/sfx2/source/layout/sfxtabdialog.cxx +++ b/sfx2/source/layout/sfxtabdialog.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -70,3 +71,5 @@ using namespace ::com::sun::star; #define TabDlgCmpUS_Impl layout__TabDlgCmpUS_Impl #include "../dialog/tabdlg.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/layout/sfxtabpage.cxx b/sfx2/source/layout/sfxtabpage.cxx index ececd9f88c..f2e3b713bc 100644 --- a/sfx2/source/layout/sfxtabpage.cxx +++ b/sfx2/source/layout/sfxtabpage.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -35,29 +36,6 @@ namespace layout using namespace ::com::sun::star; -#if 0 -SfxTabDialog::SfxTabDialog (::Window *parent, char const* xml_file, char const* id, ResId const& res_id, SfxItemSet const* set) - : ::SfxTabDialog (parent, res_id, set) - , InPlug (parent, xml_file, id) -{ -} - -::Window* SfxTabDialog::GetParent () const -{ - return Window::GetParent (); -} - -::Window* SfxTabDialog::GetWindow () const -{ - return Window::GetParent (); -} - -void SfxTabDialog::FreeResource () -{ - //::Window::FreeResource (); -} -#endif - SfxTabPage::SfxTabPage (::Window *parent, char const* xml_file, char const* id, SfxItemSet const* set) : ::SfxTabPage (parent, 0, *set) , InPlug (parent, xml_file, id) @@ -87,3 +65,5 @@ Size SfxTabPage::GetOptimalSize (WindowSizeType) const } } // end namespace layout + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/menu/mnuitem.cxx b/sfx2/source/menu/mnuitem.cxx index 705d4a68a5..e36d337b06 100644 --- a/sfx2/source/menu/mnuitem.cxx +++ b/sfx2/source/menu/mnuitem.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -40,21 +41,15 @@ #include <com/sun/star/frame/XFrame.hpp> #include <com/sun/star/util/URL.hpp> #include <com/sun/star/beans/PropertyValue.hpp> -#ifndef _UNOTOOLS_PROCESSFACTORY_HXX #include <comphelper/processfactory.hxx> -#endif #include <com/sun/star/util/XURLTransformer.hpp> -#ifndef _UNOTOOLS_PROCESSFACTORY_HXX #include <comphelper/processfactory.hxx> -#endif #include <tools/urlobj.hxx> #include <svl/eitem.hxx> #include <svl/stritem.hxx> #include <svtools/imagemgr.hxx> #include <svtools/menuoptions.hxx> #include <framework/menuconfiguration.hxx> -#ifndef GCC -#endif #include <sfx2/app.hxx> #include <sfx2/sfx.hrc> @@ -145,13 +140,11 @@ void SfxMenuControl::Bind( SfxVirtualMenu* pOwn, USHORT nSlotId, const String& rTitle, - const String &rHelpText, SfxBindings &rBindings ) { DBG_MEMTEST(); aTitle = rTitle; - aHelpText = rHelpText; pOwnMenu = pOwn; pSubMenu = 0; if ( pOwn ) @@ -172,7 +165,6 @@ void SfxMenuControl::Bind( USHORT nSlotId, SfxVirtualMenu& rMenu, const String& rTitle, - const String &rHelpText, SfxBindings &rBindings ) { DBG_MEMTEST(); @@ -181,7 +173,6 @@ void SfxMenuControl::Bind( pOwnMenu = pOwn; pSubMenu = &rMenu; aTitle = rTitle; - aHelpText = rHelpText; } //-------------------------------------------------------------------- @@ -198,8 +189,6 @@ SfxMenuControl::SfxMenuControl( BOOL bShowStrings ) //-------------------------------------------------------------------- -// ctor for array - SfxMenuControl::SfxMenuControl(): pOwnMenu(0), pSubMenu(0), @@ -228,8 +217,6 @@ SfxMenuControl::SfxMenuControl(USHORT nSlotId, SfxBindings& rBindings): //-------------------------------------------------------------------- -// dtor - SfxMenuControl::~SfxMenuControl() { if ( SfxMacroConfig::IsMacroSlot( GetId() ) ) @@ -253,12 +240,12 @@ void SfxMenuControl::StateChanged const SfxPoolItem* pState ) { - (void)nSID; //unused + (void)nSID; DBG_MEMTEST(); DBG_ASSERT( nSID == GetId(), "strange SID" ); DBG_ASSERT( pOwnMenu != 0, "setting state to dangling SfxMenuControl" ); - FASTBOOL bIsObjMenu = + bool bIsObjMenu = GetId() >= SID_OBJECTMENU0 && GetId() < SID_OBJECTMENU_LAST; // enabled/disabled-Flag pauschal korrigieren @@ -278,19 +265,13 @@ void SfxMenuControl::StateChanged if ( !bIsObjMenu ) pOwnMenu->CheckItem( GetId(), FALSE ); - // SetItemText flackert in MenuBar insbes. unter OS/2 (Bug #20658) - if ( // !bIsObjMenu && nicht wegen "Format/Datenbank" - pOwnMenu->GetSVMenu()->GetItemText( GetId() ) != GetTitle() ) + if ( pOwnMenu->GetSVMenu()->GetItemText( GetId() ) != GetTitle() ) { DBG_WARNING("Title of menu item changed - please check if this needs correction!"); - // pOwnMenu->SetItemText( GetId(), GetTitle() ); } return; } - // ggf. das alte Enum-Menu entfernen/loeschen - //! delete pOwnMenu->GetMenu().ChangePopupMenu( GetId(), 0 ); - bool bCheck = false; if ( pState->ISA(SfxBoolItem) ) { @@ -448,7 +429,6 @@ SfxAppMenuControl_Impl::SfxAppMenuControl_Impl( // Determine the current background color setting for menus const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); m_nSymbolsStyle = rSettings.GetSymbolsStyle(); - m_bWasHiContrastMode = rSettings.GetHighContrastMode(); m_bShowMenuImages = rSettings.GetUseImagesInMenus(); Reference<com::sun::star::lang::XMultiServiceFactory> aXMultiServiceFactory(::comphelper::getProcessServiceFactory()); @@ -474,15 +454,12 @@ IMPL_LINK( SfxAppMenuControl_Impl, Activate, Menu *, pActMenu ) { const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); ULONG nSymbolsStyle = rSettings.GetSymbolsStyle(); - BOOL bIsHiContrastMode = rSettings.GetHighContrastMode(); BOOL bShowMenuImages = rSettings.GetUseImagesInMenus(); if (( nSymbolsStyle != m_nSymbolsStyle ) || - ( bIsHiContrastMode != m_bWasHiContrastMode ) || ( bShowMenuImages != m_bShowMenuImages )) { m_nSymbolsStyle = nSymbolsStyle; - m_bWasHiContrastMode = bIsHiContrastMode; m_bShowMenuImages = bShowMenuImages; USHORT nCount = pActMenu->GetItemCount(); @@ -504,7 +481,7 @@ IMPL_LINK( SfxAppMenuControl_Impl, Activate, Menu *, pActMenu ) if ( aImageId.getLength() > 0 ) { Reference< ::com::sun::star::frame::XFrame > xFrame; - Image aImage = GetImage( xFrame, aImageId, FALSE, bIsHiContrastMode ); + Image aImage = GetImage( xFrame, aImageId, FALSE ); if ( !!aImage ) { bImageSet = sal_True; @@ -516,7 +493,7 @@ IMPL_LINK( SfxAppMenuControl_Impl, Activate, Menu *, pActMenu ) if ( !bImageSet && aCmd.Len() ) { Image aImage = SvFileInformationManager::GetImage( - INetURLObject(aCmd), FALSE, bIsHiContrastMode ); + INetURLObject(aCmd), FALSE ); if ( !!aImage ) pActMenu->SetItemImage( nItemId, aImage ); } @@ -550,8 +527,20 @@ SfxUnoMenuControl::SfxUnoMenuControl( const String& rCmd, USHORT nSlotId, Menu& rMenu, SfxBindings& rBindings, SfxVirtualMenu* pVirt ) : SfxMenuControl( nSlotId, rBindings ) { - Bind( pVirt, nSlotId, rMenu.GetItemText(nSlotId), - rMenu.GetHelpText(nSlotId), rBindings); + Bind( pVirt, nSlotId, rMenu.GetItemText(nSlotId), rBindings); + UnBind(); + pUnoCtrl = new SfxUnoControllerItem( this, rBindings, rCmd ); + pUnoCtrl->acquire(); + pUnoCtrl->GetNewDispatch(); +} + +SfxUnoMenuControl::SfxUnoMenuControl( + const String& rCmd, USHORT nSlotId, Menu& /*rMenu*/, + const String& rItemText, + SfxBindings& rBindings, SfxVirtualMenu* pVirt) + : SfxMenuControl( nSlotId, rBindings ) +{ + Bind( pVirt, nSlotId, rItemText, rBindings); UnBind(); pUnoCtrl = new SfxUnoControllerItem( this, rBindings, rCmd ); pUnoCtrl->acquire(); @@ -581,3 +570,5 @@ void SfxUnoMenuControl::Select() { pUnoCtrl->Execute(); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/menu/mnumgr.cxx b/sfx2/source/menu/mnumgr.cxx index 35a3badd6a..c5b523f623 100755 --- a/sfx2/source/menu/mnumgr.cxx +++ b/sfx2/source/menu/mnumgr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -40,11 +41,7 @@ #include <string> // HACK: prevent conflict between STLPORT and Workshop headers #include <cstdarg> // std::va_list -#ifndef _POINTR_HXX //autogen #include <vcl/pointr.hxx> -#endif -#ifndef GCC -#endif #include <unotools/streamwrap.hxx> #include <sfx2/objsh.hxx> diff --git a/sfx2/source/menu/objmnctl.cxx b/sfx2/source/menu/objmnctl.cxx index e396c196fd..e324dafec2 100644 --- a/sfx2/source/menu/objmnctl.cxx +++ b/sfx2/source/menu/objmnctl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,7 +32,6 @@ #include <com/sun/star/embed/VerbAttributes.hpp> #include <tools/list.hxx> -#ifndef _MENU_HXX //autogen #include <vcl/menu.hxx> #endif #ifndef _SXSTRITEM_HXX //autogen @@ -163,3 +163,4 @@ PopupMenu* SfxObjectVerbsControl::GetPopup() const } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/menu/virtmenu.cxx b/sfx2/source/menu/virtmenu.cxx index 8876f3c0ef..8bfe435712 100644 --- a/sfx2/source/menu/virtmenu.cxx +++ b/sfx2/source/menu/virtmenu.cxx @@ -1,10 +1,11 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2000, 2010 Oracle and/or its affiliates. * - * OpenOffice.org - a multi-platform office productivity suite + * Copyright 2000, 2010 Oracle and/or its affiliates. * * This file is part of OpenOffice.org. * @@ -62,9 +63,7 @@ #include <sfx2/objsh.hxx> #include <framework/addonsoptions.hxx> -#ifndef __FRAMEWORK_CLASSES_ADDONMENUS_HXX_ #include <framework/addonmenu.hxx> -#endif #include <framework/menuconfiguration.hxx> using namespace ::com::sun::star::container; @@ -135,21 +134,21 @@ void SfxMenuImageControl_Impl::Update() static Image RetrieveAddOnImage( Reference< com::sun::star::frame::XFrame >& rFrame, const rtl::OUString& aImageId, const rtl::OUString& aURL, - BOOL bBigImage, - BOOL bHiContrast ) + BOOL bBigImage +) { Image aImage; if ( aImageId.getLength() > 0 ) { - aImage = GetImage( rFrame, aImageId, bBigImage, bHiContrast ); + aImage = GetImage( rFrame, aImageId, bBigImage ); if ( !!aImage ) return aImage; } - aImage = GetImage( rFrame, aURL, bBigImage, bHiContrast ); + aImage = GetImage( rFrame, aURL, bBigImage ); if ( !aImage ) - aImage = framework::AddonsOptions().GetImageFromURL( aURL, bBigImage, bHiContrast ); + aImage = framework::AddonsOptions().GetImageFromURL( aURL, bBigImage ); return aImage; } @@ -196,13 +195,12 @@ SfxVirtualMenu::SfxVirtualMenu( USHORT nOwnId, SfxVirtualMenu* pOwnParent, Menu& rMenu, BOOL bWithHelp, SfxBindings &rBindings, BOOL bOLEServer, BOOL bRes, BOOL bIsAddonMenu ): pItems(0), - pImageControl(0), + pImageControl(0), pBindings(&rBindings), pResMgr(0), pAutoDeactivate(0), nLocks(0), bHelpInitialized( bWithHelp ), - bWasHighContrast( FALSE ), bIsAddonPopupMenu( bIsAddonMenu ) { DBG_MEMTEST(); @@ -238,7 +236,6 @@ SfxVirtualMenu::SfxVirtualMenu( Menu *pStarViewMenu, BOOL bWithHelp, pAutoDeactivate(0), nLocks(0), bHelpInitialized( bWithHelp ), - bWasHighContrast( FALSE ), bIsAddonPopupMenu( bIsAddonMenu ) { DBG_MEMTEST(); @@ -324,14 +321,6 @@ SfxVirtualMenu::~SfxVirtualMenu() DBG_ASSERT( !nLocks, "destroying active menu" ); } //-------------------------------------------------------------------- - -BOOL SfxVirtualMenu::IsHiContrastMode() const -{ - const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); - return rSettings.GetHighContrastMode(); -} - -//-------------------------------------------------------------------- // internal: creates the virtual menu from the pSVMenu void SfxVirtualMenu::CreateFromSVMenu() @@ -396,9 +385,6 @@ void SfxVirtualMenu::CreateFromSVMenu() pBindings->ENTERREGISTRATIONS(); ++nLocks; pImageControl = new SfxMenuImageControl_Impl( SID_IMAGE_ORIENTATION, *pBindings, this ); - // Update high contrast state - bWasHighContrast = IsHiContrastMode(); - USHORT nSVPos = 0; for ( USHORT nPos=0; nPos<nCount; ++nPos, ++nSVPos ) { @@ -439,7 +425,7 @@ void SfxVirtualMenu::CreateFromSVMenu() { rtl::OUString aSlotURL( RTL_CONSTASCII_USTRINGPARAM( "slot:" )); aSlotURL += rtl::OUString::valueOf( sal_Int32( nSlotId )); - Image aImage = GetImage( xFrame, aSlotURL, FALSE, bWasHighContrast ); + Image aImage = GetImage( xFrame, aSlotURL, FALSE ); pSVMenu->SetItemImage( nSlotId, aImage ); } } @@ -536,13 +522,13 @@ void SfxVirtualMenu::CreateFromSVMenu() if ( pMenuAttributes ) aImageId = pMenuAttributes->aImageId; // Retrieve image id from menu attributes - aImage = RetrieveAddOnImage( xFrame, aImageId, aCmd, FALSE, bWasHighContrast ); + aImage = RetrieveAddOnImage( xFrame, aImageId, aCmd, FALSE ); } else { rtl::OUString aSlotURL( RTL_CONSTASCII_USTRINGPARAM( "slot:" )); aSlotURL += rtl::OUString::valueOf( sal_Int32( nSlotId )); - aImage = GetImage( xFrame, aSlotURL, FALSE, bWasHighContrast ); + aImage = GetImage( xFrame, aSlotURL, FALSE ); } if ( !!aImage ) @@ -620,13 +606,13 @@ IMPL_LINK( SfxVirtualMenu, SettingsChanged, void*, EMPTYARG ) if ( pMenuAttributes ) aImageId = pMenuAttributes->aImageId; // Retrieve image id from menu attributes - pSVMenu->SetItemImage( nSlotId, RetrieveAddOnImage( xFrame, aImageId, aCmd, FALSE, bIsHiContrastMode )); + pSVMenu->SetItemImage( nSlotId, RetrieveAddOnImage( xFrame, aImageId, aCmd, FALSE )); } else { rtl::OUString aSlotURL( RTL_CONSTASCII_USTRINGPARAM( "slot:" )); aSlotURL += rtl::OUString::valueOf( sal_Int32( nSlotId )); - pSVMenu->SetItemImage( nSlotId, GetImage( xFrame, aSlotURL, FALSE, bWasHighContrast )); + pSVMenu->SetItemImage( nSlotId, GetImage( xFrame, aSlotURL, FALSE )); } } else if( nType == MENUITEM_STRINGIMAGE && !bIcons ) @@ -667,7 +653,6 @@ void SfxVirtualMenu::UpdateImages() if ( bIcons ) { - BOOL bIsHiContrastMode = IsHiContrastMode(); USHORT nItemCount = pSVMenu->GetItemCount(); SfxViewFrame * pViewFrame = pBindings->GetDispatcher()->GetFrame(); Reference<com::sun::star::frame::XFrame> xFrame( pViewFrame->GetFrame().GetFrameInterface() ); @@ -689,13 +674,13 @@ void SfxVirtualMenu::UpdateImages() if ( pMenuAttributes ) aImageId = pMenuAttributes->aImageId; // Retrieve image id from menu attributes - pSVMenu->SetItemImage( nSlotId, RetrieveAddOnImage( xFrame, aImageId, aCmd, FALSE, bIsHiContrastMode )); + pSVMenu->SetItemImage( nSlotId, RetrieveAddOnImage( xFrame, aImageId, aCmd, FALSE )); } else { rtl::OUString aSlotURL( RTL_CONSTASCII_USTRINGPARAM( "slot:" )); aSlotURL += rtl::OUString::valueOf( sal_Int32( nSlotId )); - pSVMenu->SetItemImage( nSlotId, GetImage( xFrame, aSlotURL, FALSE, bWasHighContrast )); + pSVMenu->SetItemImage( nSlotId, GetImage( xFrame, aSlotURL, FALSE )); } } } @@ -717,7 +702,6 @@ void SfxVirtualMenu::UpdateImages( Menu* pMenu ) BOOL bIcons = Application::GetSettings().GetStyleSettings().GetUseImagesInMenus(); if ( bIcons ) { - BOOL bIsHiContrastMode = IsHiContrastMode(); USHORT nItemCount = pMenu->GetItemCount(); Reference<com::sun::star::frame::XFrame> aXFrame( pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame().GetFrameInterface() ); @@ -735,7 +719,7 @@ void SfxVirtualMenu::UpdateImages( Menu* pMenu ) if ( pMenuAttributes ) aImageId = pMenuAttributes->aImageId; // Retrieve image id from menu attributes - pMenu->SetItemImage( nSlotId, RetrieveAddOnImage( aXFrame, aImageId, pMenu->GetItemCommand( nSlotId ), FALSE, bIsHiContrastMode )); + pMenu->SetItemImage( nSlotId, RetrieveAddOnImage( aXFrame, aImageId, pMenu->GetItemCommand( nSlotId ), FALSE )); } if ( pPopup ) @@ -768,7 +752,7 @@ void SfxVirtualMenu::RemoveMenuImages( Menu* pMenu ) //-------------------------------------------------------------------- -FASTBOOL SfxVirtualMenu::Bind_Impl( Menu *pMenu ) +bool SfxVirtualMenu::Bind_Impl( Menu *pMenu ) { // Selber suchen, da SV mit 'USHORT nSID = pSVMenu->GetCurItemId();' immer // 0 liefert. Das ist so, weil die Event-Weiterleitung lt. TH nichts mit @@ -778,7 +762,7 @@ FASTBOOL SfxVirtualMenu::Bind_Impl( Menu *pMenu ) for ( USHORT nPos = 0; nPos < nCount; ++nPos ) { // angesprochenes Sub-Menu gefunden? - FASTBOOL bFound = FALSE; + bool bFound = false; USHORT nSID = pSVMenu->GetItemId(nPos); SfxMenuControl &rCtrl = pItems[nPos]; bFound = pSVMenu->GetPopupMenu(nSID) == pMenu; @@ -808,9 +792,7 @@ FASTBOOL SfxVirtualMenu::Bind_Impl( Menu *pMenu ) DBG_OUTF( ("Neues VirtualMenu %lx erzeugt", pSubMenu) ); - rCtrl.Bind( this, nSID, *pSubMenu, - pSVMenu->GetItemText(nSID), pSVMenu->GetHelpText(nSID), - *pBindings ); + rCtrl.Bind( this, nSID, *pSubMenu, pSVMenu->GetItemText(nSID), *pBindings ); // Activate weiterleiten pSubMenu->Bind_Impl( pMenu ); @@ -913,7 +895,7 @@ void SfxVirtualMenu::InsertAddOnsMenuItem( Menu* pMenu ) { rtl::OUString aSlotURL( RTL_CONSTASCII_USTRINGPARAM( "slot:" )); aSlotURL += rtl::OUString::valueOf( sal_Int32( SID_ADDONS )); - pMenu->SetItemImage( SID_ADDONS, GetImage( xFrame, aSlotURL, FALSE, bWasHighContrast )); + pMenu->SetItemImage( SID_ADDONS, GetImage( xFrame, aSlotURL, FALSE )); } } else @@ -1060,16 +1042,6 @@ IMPL_LINK( SfxVirtualMenu, Activate, Menu *, pMenu ) if ( pAutoDeactivate ) // QAP-Hack pAutoDeactivate->Start(); - if ( IsHiContrastMode() != bWasHighContrast ) - { - // Refresh images as our background color changed and remember it!! - bWasHighContrast = IsHiContrastMode(); - if ( bIsAddonPopupMenu ) - UpdateImages( pSVMenu ); - else - UpdateImages(); - } - // erledigt return TRUE; } @@ -1324,9 +1296,7 @@ void SfxVirtualMenu::InitPopup( USHORT nPos, BOOL /*bOLE*/ ) DBG_OUTF( ("Neues VirtualMenu %lx erzeugt", pSubMenu) ); - rCtrl.Bind( this, nSID, *pSubMenu, - pSVMenu->GetItemText(nSID), pSVMenu->GetHelpText(nSID), - *pBindings ); + rCtrl.Bind( this, nSID, *pSubMenu, pSVMenu->GetItemText(nSID), *pBindings ); } } @@ -1359,3 +1329,4 @@ void SfxVirtualMenu::SetHelpIds( ResMgr *pRes ) pResMgr = pRes; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/notify/eventsupplier.cxx b/sfx2/source/notify/eventsupplier.cxx index b439fbcb69..f1381d225c 100644 --- a/sfx2/source/notify/eventsupplier.cxx +++ b/sfx2/source/notify/eventsupplier.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,13 +32,9 @@ //-------------------------------------------------------------------------------------------------------- #include <com/sun/star/beans/PropertyValue.hpp> -#ifndef _COM_SUN_STAR_UTL_URL_HPP_ #include <com/sun/star/util/URL.hpp> -#endif -#ifndef _COM_SUN_STAR_UTL_XURLTRANSFORMER_HPP_ #include <com/sun/star/util/XURLTransformer.hpp> -#endif #include <tools/urlobj.hxx> #include <svl/macitem.hxx> #include <sfx2/appuno.hxx> @@ -107,7 +104,7 @@ void SAL_CALL SfxEvents_Impl::replaceByName( const OUSTRING & aName, const ANY & ::rtl::OUString sType; if ( ( aProperties.getLength() == 1 ) - && ( aProperties[0].Name.compareToAscii( PROP_EVENT_TYPE ) == 0 ) + && ( aProperties[0].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(PROP_EVENT_TYPE)) ) && ( aProperties[0].Value >>= sType ) && ( sType.getLength() == 0 ) ) @@ -220,13 +217,13 @@ static void Execute( ANY& aEventData, const css::document::DocumentEvent& aTrigg sal_Int32 nIndex = 0; while ( nIndex < nCount ) { - if ( aProperties[ nIndex ].Name.compareToAscii( PROP_EVENT_TYPE ) == 0 ) + if (aProperties[ nIndex ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(PROP_EVENT_TYPE))) aProperties[ nIndex ].Value >>= aType; - else if ( aProperties[ nIndex ].Name.compareToAscii( PROP_SCRIPT ) == 0 ) + else if (aProperties[ nIndex ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(PROP_SCRIPT))) aProperties[ nIndex ].Value >>= aScript; - else if ( aProperties[ nIndex ].Name.compareToAscii( PROP_LIBRARY ) == 0 ) + else if (aProperties[ nIndex ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(PROP_LIBRARY))) aProperties[ nIndex ].Value >>= aLibrary; - else if ( aProperties[ nIndex ].Name.compareToAscii( PROP_MACRO_NAME ) == 0 ) + else if (aProperties[ nIndex ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(PROP_MACRO_NAME))) aProperties[ nIndex ].Value >>= aMacroName; else { DBG_ERROR("Unknown property value!"); @@ -234,13 +231,13 @@ static void Execute( ANY& aEventData, const css::document::DocumentEvent& aTrigg nIndex += 1; } - if ( aType.compareToAscii( STAR_BASIC ) == 0 && aScript.getLength() ) + if (aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(STAR_BASIC)) && aScript.getLength()) { com::sun::star::uno::Any aAny; SfxMacroLoader::loadMacro( aScript, aAny, pDoc ); } - else if ( aType.compareToAscii( "Service" ) == 0 || - aType.compareToAscii( "Script" ) == 0 ) + else if (aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Service")) || + aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Script"))) { if ( aScript.getLength() ) { @@ -251,8 +248,8 @@ static void Execute( ANY& aEventData, const css::document::DocumentEvent& aTrigg ::com::sun::star::uno::Reference < ::com::sun::star::util::XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString::createFromAscii( - "com.sun.star.util.URLTransformer" ) ), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.util.URLTransformer" )) ), UNO_QUERY ); ::com::sun::star::util::URL aURL; @@ -273,8 +270,8 @@ static void Execute( ANY& aEventData, const css::document::DocumentEvent& aTrigg xProv = ::com::sun::star::uno::Reference < ::com::sun::star::frame::XDispatchProvider > ( ::comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString::createFromAscii( - "com.sun.star.frame.Desktop" ) ), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.frame.Desktop" )) ), UNO_QUERY ); } @@ -285,7 +282,7 @@ static void Execute( ANY& aEventData, const css::document::DocumentEvent& aTrigg if ( xDisp.is() ) { //::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue > aArgs(1); - //aArgs[0].Name = rtl::OUString::createFromAscii("Referer"); + //aArgs[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Referer")); //aArs[0].Value <<= ::rtl::OUString( pDoc->GetMedium()->GetName() ); //xDisp->dispatch( aURL, aArgs ); @@ -403,13 +400,13 @@ SvxMacro* SfxEvents_Impl::ConvertToMacro( const ANY& rElement, SfxObjectShell* p while ( nIndex < nCount ) { - if ( aProperties[ nIndex ].Name.compareToAscii( PROP_EVENT_TYPE ) == 0 ) + if (aProperties[ nIndex ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(PROP_EVENT_TYPE))) aProperties[ nIndex ].Value >>= aType; - else if ( aProperties[ nIndex ].Name.compareToAscii( PROP_SCRIPT ) == 0 ) + else if (aProperties[ nIndex ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(PROP_SCRIPT))) aProperties[ nIndex ].Value >>= aScriptURL; - else if ( aProperties[ nIndex ].Name.compareToAscii( PROP_LIBRARY ) == 0 ) + else if (aProperties[ nIndex ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(PROP_LIBRARY))) aProperties[ nIndex ].Value >>= aLibrary; - else if ( aProperties[ nIndex ].Name.compareToAscii( PROP_MACRO_NAME ) == 0 ) + else if (aProperties[ nIndex ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(PROP_MACRO_NAME))) aProperties[ nIndex ].Value >>= aMacroName; else { DBG_ERROR("Unknown propery value!"); @@ -419,11 +416,11 @@ SvxMacro* SfxEvents_Impl::ConvertToMacro( const ANY& rElement, SfxObjectShell* p // Get the type ScriptType eType( STARBASIC ); - if ( aType.compareToAscii( STAR_BASIC ) == COMPARE_EQUAL ) + if (aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(STAR_BASIC))) eType = STARBASIC; - else if ( aType.compareToAscii( "Script" ) == COMPARE_EQUAL && aScriptURL.getLength() ) + else if (aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Script")) && aScriptURL.getLength()) eType = EXTENDED_STYPE; - else if ( aType.compareToAscii( SVX_MACRO_LANGUAGE_JAVASCRIPT ) == COMPARE_EQUAL ) + else if (aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(SVX_MACRO_LANGUAGE_JAVASCRIPT))) eType = JAVASCRIPT; else { DBG_ERRORFILE( "ConvertToMacro: Unknown macro type" ); @@ -431,7 +428,7 @@ SvxMacro* SfxEvents_Impl::ConvertToMacro( const ANY& rElement, SfxObjectShell* p if ( aMacroName.getLength() ) { - if ( aLibrary.compareToAscii("application") == 0 ) + if (aLibrary.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application"))) aLibrary = SFX_APP()->GetName(); else aLibrary = ::rtl::OUString(); @@ -469,28 +466,28 @@ void SfxEvents_Impl::BlowUpMacro( const ANY& rEvent, ANY& rRet, SfxObjectShell* while ( nIndex < nCount ) { - if ( aInProps[ nIndex ].Name.compareToAscii( PROP_EVENT_TYPE ) == 0 ) + if (aInProps[ nIndex ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(PROP_EVENT_TYPE))) { aInProps[nIndex].Value >>= aType; aOutProps[0] = aInProps[nIndex]; } - else if ( aInProps[ nIndex ].Name.compareToAscii( PROP_SCRIPT ) == 0 ) + else if (aInProps[ nIndex ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(PROP_SCRIPT))) { aInProps[nIndex].Value >>= aScript; aOutProps[1] = aInProps[nIndex]; } - else if ( aInProps[ nIndex ].Name.compareToAscii( PROP_LIBRARY ) == 0 ) + else if (aInProps[ nIndex ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(PROP_LIBRARY))) { aInProps[ nIndex ].Value >>= aLibrary; } - else if ( aInProps[ nIndex ].Name.compareToAscii( PROP_MACRO_NAME ) == 0 ) + else if (aInProps[ nIndex ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(PROP_MACRO_NAME))) { aInProps[ nIndex ].Value >>= aMacroName; } nIndex += 1; } - if ( aType.compareToAscii( STAR_BASIC ) == 0 ) + if (aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(STAR_BASIC))) { aOutProps.realloc(4); if ( aScript.getLength() ) @@ -502,7 +499,7 @@ void SfxEvents_Impl::BlowUpMacro( const ANY& rEvent, ANY& rRet, SfxObjectShell* if ( ( nHashPos != STRING_NOTFOUND ) && ( nHashPos < nArgsPos ) ) { OUSTRING aBasMgrName( INetURLObject::decode( aScript.copy( 8, nHashPos-8 ), INET_HEX_ESCAPE, INetURLObject::DECODE_WITH_CHARSET ) ); - if ( aBasMgrName.compareToAscii(".") == 0 ) + if (aBasMgrName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("."))) aLibrary = pDoc->GetTitle(); /* else if ( aBasMgrName.getLength() ) @@ -523,7 +520,7 @@ void SfxEvents_Impl::BlowUpMacro( const ANY& rEvent, ANY& rRet, SfxObjectShell* else if ( aMacroName.getLength() ) { aScript = OUSTRING( RTL_CONSTASCII_USTRINGPARAM( MACRO_PRFIX ) ); - if ( aLibrary.compareTo( SFX_APP()->GetName() ) != 0 && aLibrary.compareToAscii("StarDesktop") != 0 && aLibrary.compareToAscii("application") != 0 ) + if ( aLibrary.compareTo( SFX_APP()->GetName() ) != 0 && !aLibrary.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("StarDesktop")) && !aLibrary.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application")) ) aScript += String('.'); aScript += String('/'); @@ -534,7 +531,7 @@ void SfxEvents_Impl::BlowUpMacro( const ANY& rEvent, ANY& rRet, SfxObjectShell* // wrong properties return; - if ( aLibrary.compareToAscii("document") != 0 ) + if (!aLibrary.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("document"))) { if ( !aLibrary.getLength() || (pDoc && ( String(aLibrary) == pDoc->GetTitle( SFX_TITLE_APINAME ) || String(aLibrary) == pDoc->GetTitle() )) ) aLibrary = String::CreateFromAscii("document"); @@ -542,15 +539,15 @@ void SfxEvents_Impl::BlowUpMacro( const ANY& rEvent, ANY& rRet, SfxObjectShell* aLibrary = String::CreateFromAscii("application"); } - aOutProps[1].Name = OUSTRING::createFromAscii( PROP_SCRIPT ); + aOutProps[1].Name = OUSTRING(RTL_CONSTASCII_USTRINGPARAM( PROP_SCRIPT )); aOutProps[1].Value <<= aScript; - aOutProps[2].Name = OUSTRING::createFromAscii( PROP_LIBRARY ); + aOutProps[2].Name = OUSTRING(RTL_CONSTASCII_USTRINGPARAM( PROP_LIBRARY )); aOutProps[2].Value <<= aLibrary; - aOutProps[3].Name = OUSTRING::createFromAscii( PROP_MACRO_NAME ); + aOutProps[3].Name = OUSTRING(RTL_CONSTASCII_USTRINGPARAM( PROP_MACRO_NAME )); aOutProps[3].Value <<= aMacroName; rRet <<= aOutProps; } - else if ( aType.compareToAscii( SVX_MACRO_LANGUAGE_JAVASCRIPT ) == 0 ) + else if (aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(SVX_MACRO_LANGUAGE_JAVASCRIPT))) { aOutProps[1] = aInProps[1]; rRet <<= aOutProps; @@ -600,7 +597,7 @@ css::uno::Any SAL_CALL ModelCollectionEnumeration::nextElement() ::osl::ResettableMutexGuard aLock(m_aLock); if (m_pEnumerationIt == m_lModels.end()) throw css::container::NoSuchElementException( - ::rtl::OUString::createFromAscii("End of model enumeration reached."), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("End of model enumeration reached.")), static_cast< css::container::XEnumeration* >(this)); css::uno::Reference< css::frame::XModel > xModel(*m_pEnumerationIt, UNO_QUERY); ++m_pEnumerationIt; @@ -626,7 +623,7 @@ SfxGlobalEvents_Impl::SfxGlobalEvents_Impl( const com::sun::star::uno::Reference pImp = new GlobalEventConfig(); m_xEvents = pImp; m_xJobExecutorListener = css::uno::Reference< css::document::XEventListener >( - xSMGR->createInstance(::rtl::OUString::createFromAscii("com.sun.star.task.JobExecutor")), + xSMGR->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.task.JobExecutor"))), UNO_QUERY); m_refCount--; } @@ -749,7 +746,7 @@ void SAL_CALL SfxGlobalEvents_Impl::insert( const css::uno::Any& aElement ) aElement >>= xDoc; if (!xDoc.is()) throw css::lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("Cant locate at least the model parameter."), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Cant locate at least the model parameter.")), static_cast< css::container::XSet* >(this), 0); @@ -786,7 +783,7 @@ void SAL_CALL SfxGlobalEvents_Impl::remove( const css::uno::Any& aElement ) aElement >>= xDoc; if (!xDoc.is()) throw css::lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii("Cant locate at least the model parameter."), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Cant locate at least the model parameter.")), static_cast< css::container::XSet* >(this), 0); @@ -918,3 +915,4 @@ TModelList::iterator SfxGlobalEvents_Impl::impl_searchDoc(const css::uno::Refere return pIt; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/notify/hintpost.cxx b/sfx2/source/notify/hintpost.cxx index 12e78bd90f..f77d03071e 100644 --- a/sfx2/source/notify/hintpost.cxx +++ b/sfx2/source/notify/hintpost.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,9 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" -#ifndef GCC -#endif - #include "arrdecl.hxx" #include <sfx2/hintpost.hxx> #include <sfx2/app.hxx> @@ -100,11 +98,5 @@ void SfxHintPoster::SetEventHdl( const GenLink& rLink ) #define LOG( x ) -#if 0 -#define LOG( x ) \ -{ \ - SvFileStream aStrm( "f:\\temp\\log", STREAM_READWRITE ); \ - aStrm.Seek( STREAM_SEEK_TO_END ); \ - aStrm << x.GetStr() << '\n'; \ -} -#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/statbar/stbitem.cxx b/sfx2/source/statbar/stbitem.cxx index 0c1591de16..faf3afa325 100644 --- a/sfx2/source/statbar/stbitem.cxx +++ b/sfx2/source/statbar/stbitem.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -59,7 +60,6 @@ #include <svl/intitem.hxx> #ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_ #include <toolkit/unohlp.hxx> -#endif #include <toolkit/helper/convert.hxx> using namespace ::com::sun::star; @@ -88,12 +88,12 @@ svt::StatusbarController* SAL_CALL SfxStatusBarControllerFactory( unsigned short nID, const ::rtl::OUString& aCommandURL ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; util::URL aTargetURL; aTargetURL.Complete = aCommandURL; uno::Reference < util::XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString::createFromAscii( "com.sun.star.util.URLTransformer" )), uno::UNO_QUERY ); + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), uno::UNO_QUERY ); xTrans->parseStrict( aTargetURL ); SfxObjectShell* pObjShell = NULL; @@ -228,7 +228,7 @@ throw ( ::com::sun::star::uno::RuntimeException ) SfxViewFrame* pViewFrame = NULL; uno::Reference < frame::XController > xController; - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( m_xFrame.is() ) xController = m_xFrame->getController(); @@ -333,7 +333,7 @@ throw ( ::com::sun::star::uno::RuntimeException ) const awt::MouseEvent& rMouseEvent ) throw ( uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; ::Point aPos( rMouseEvent.X, rMouseEvent.Y ); ::MouseEvent aMouseEvent( aPos, @@ -351,7 +351,7 @@ throw ( uno::RuntimeException ) const awt::MouseEvent& rMouseEvent ) throw (uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; ::Point aPos( rMouseEvent.X, rMouseEvent.Y ); ::MouseEvent aMouseEvent( aPos, @@ -368,7 +368,7 @@ throw (uno::RuntimeException) const ::awt::MouseEvent& rMouseEvent ) throw ( uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; ::Point aPos( rMouseEvent.X, rMouseEvent.Y ); ::MouseEvent aMouseEvent( aPos, @@ -388,7 +388,7 @@ void SAL_CALL SfxStatusBarControl::command( const ::com::sun::star::uno::Any& /*aData*/ ) throw (::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; ::Point aPos( rPos.X, rPos.Y ); CommandEvent aCmdEvent( aPos, (USHORT)nCommand, TRUE, NULL ); @@ -404,7 +404,7 @@ void SAL_CALL SfxStatusBarControl::paint( ::sal_Int32 nStyle ) throw ( ::uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; OutputDevice* pOutDev = VCLUnoHelper::GetOutputDevice( xGraphics );; if ( pOutDev ) @@ -420,7 +420,7 @@ throw ( ::uno::RuntimeException ) void SAL_CALL SfxStatusBarControl::click() throw ( uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Click(); } @@ -429,7 +429,7 @@ throw ( uno::RuntimeException ) void SAL_CALL SfxStatusBarControl::doubleClick() throw ( uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; DoubleClick(); } @@ -647,7 +647,7 @@ SfxStatusBarControl* SfxStatusBarControl::CreateControl SfxModule* pMod ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; SfxApplication *pApp = SFX_APP(); SfxSlotPool *pSlotPool; @@ -690,3 +690,5 @@ void SfxStatusBarControl::RegisterStatusBarControl(SfxModule* pMod, SfxStbCtrlFa SFX_APP()->RegisterStatusBarControl_Impl( pMod, pFact ); } //-------------------------------------------------------------------- + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/toolbox/imgmgr.cxx b/sfx2/source/toolbox/imgmgr.cxx index 791798b2e9..1055467ee4 100644 --- a/sfx2/source/toolbox/imgmgr.cxx +++ b/sfx2/source/toolbox/imgmgr.cxx @@ -1,10 +1,11 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2000, 2010 Oracle and/or its affiliates. * - * OpenOffice.org - a multi-platform office productivity suite + * Copyright 2000, 2010 Oracle and/or its affiliates. * * This file is part of OpenOffice.org. * @@ -44,14 +45,9 @@ #include <tools/rcid.h> #include <tools/link.hxx> #include <svtools/miscopt.hxx> -#include <vos/mutex.hxx> - -#ifndef GCC -#endif +#include <osl/mutex.hxx> -#ifndef _UNOTOOLS_PROCESSFACTORY_HXX #include <comphelper/processfactory.hxx> -#endif const sal_uInt32 IMAGELIST_COUNT = 4; // small, small-hi, large, large-hi @@ -70,14 +66,14 @@ public: ImageList* m_pImageList[IMAGELIST_COUNT]; SfxModule* m_pModule; - ImageList* GetImageList( BOOL bBig, BOOL bHiContrast ); - Image GetImage( USHORT nId, BOOL bBig, BOOL bHiContrast ); + ImageList* GetImageList( BOOL bBig ); + Image GetImage( USHORT nId, BOOL bBig ); void SetSymbolsSize_Impl( sal_Int16 ); - + DECL_LINK( OptionsChanged_Impl, void* ); DECL_LINK( SettingsChanged_Impl, void* ); - + SfxImageManager_Impl( SfxModule* pModule ); ~SfxImageManager_Impl(); }; @@ -88,14 +84,10 @@ typedef std::hash_map< sal_Int64, sal_Int64 > SfxImageManagerMap; static SfxImageManager_Impl* pGlobalImageManager = 0; static SfxImageManagerMap m_ImageManager_ImplMap; static SfxImageManagerMap m_ImageManagerMap; -static ImageList* pImageListSmall=0; -static ImageList* pImageListBig=0; -static ImageList* pImageListHiSmall=0; -static ImageList* pImageListHiBig=0; static SfxImageManager_Impl* GetImageManager( SfxModule* pModule ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( pModule == 0 ) { @@ -112,9 +104,9 @@ static SfxImageManager_Impl* GetImageManager( SfxModule* pModule ) else { pImpl = new SfxImageManager_Impl( pModule ); - m_ImageManager_ImplMap.insert( - SfxImageManagerMap::value_type( - sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( pModule )), + m_ImageManager_ImplMap.insert( + SfxImageManagerMap::value_type( + sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( pModule )), sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( pImpl )) )); } return pImpl; @@ -122,40 +114,32 @@ static SfxImageManager_Impl* GetImageManager( SfxModule* pModule ) } // Global image list -static ImageList* GetImageList( BOOL bBig, BOOL bHiContrast ) +static ImageList* GetImageList( BOOL bBig ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - - // Has to be changed if we know how the IDs are named!!! - ImageList*& rpList = bBig ? ( bHiContrast ? pImageListHiBig : pImageListBig ) : - ( bHiContrast ? pImageListHiSmall : pImageListSmall ); - if ( !rpList ) - { - ResMgr *pResMgr = SfxApplication::GetOrCreate()->GetOffResManager_Impl(); + SolarMutexGuard aGuard; + ImageList* rpList = NULL; - ResId aResId( bBig ? ( bHiContrast ? RID_DEFAULTIMAGELIST_LCH : RID_DEFAULTIMAGELIST_LC ) : - ( bHiContrast ? RID_DEFAULTIMAGELIST_SCH : RID_DEFAULTIMAGELIST_SC ), *pResMgr); + ResMgr *pResMgr = SfxApplication::GetOrCreate()->GetOffResManager_Impl(); - aResId.SetRT( RSC_IMAGELIST ); + ResId aResId( bBig ? ( RID_DEFAULTIMAGELIST_LC ) : ( RID_DEFAULTIMAGELIST_SC ), *pResMgr); - DBG_ASSERT( pResMgr->IsAvailable(aResId), "No default ImageList!" ); + aResId.SetRT( RSC_IMAGELIST ); - if ( pResMgr->IsAvailable(aResId) ) - rpList = new ImageList( aResId ); - else - rpList = new ImageList(); - } + DBG_ASSERT( pResMgr->IsAvailable(aResId), "No default ImageList!" ); + + if ( pResMgr->IsAvailable(aResId) ) + rpList = new ImageList( aResId ); + else + rpList = new ImageList(); return rpList; } -static sal_Int16 impl_convertBools( sal_Bool bLarge, sal_Bool bHiContrast ) +static sal_Int16 impl_convertBools( sal_Bool bLarge ) { sal_Int16 nIndex( 0 ); if ( bLarge ) nIndex += 1; - if ( bHiContrast ) - nIndex += 2; return nIndex; } @@ -185,25 +169,25 @@ SfxImageManager_Impl::~SfxImageManager_Impl() //------------------------------------------------------------------------- -ImageList* SfxImageManager_Impl::GetImageList( BOOL bBig, BOOL bHiContrast ) +ImageList* SfxImageManager_Impl::GetImageList( BOOL bBig ) { - sal_Int32 nIndex = impl_convertBools( bBig, bHiContrast ); + sal_Int32 nIndex = impl_convertBools( bBig ); if ( !m_pImageList[nIndex] ) { if ( !m_pModule ) - m_pImageList[nIndex] = ::GetImageList( bBig, bHiContrast ); + m_pImageList[nIndex] = ::GetImageList( bBig ); else - m_pImageList[nIndex] = m_pModule->GetImageList_Impl( bBig, bHiContrast ); + m_pImageList[nIndex] = m_pModule->GetImageList_Impl( bBig ); } - + return m_pImageList[nIndex]; } //------------------------------------------------------------------------- -Image SfxImageManager_Impl::GetImage( USHORT nId, BOOL bBig, BOOL bHiContrast ) +Image SfxImageManager_Impl::GetImage( USHORT nId, BOOL bBig ) { - ImageList* pImageList = GetImageList( bBig, bHiContrast ); + ImageList* pImageList = GetImageList( bBig ); if ( pImageList ) return pImageList->GetImage( nId ); return Image(); @@ -213,8 +197,8 @@ Image SfxImageManager_Impl::GetImage( USHORT nId, BOOL bBig, BOOL bHiContrast ) void SfxImageManager_Impl::SetSymbolsSize_Impl( sal_Int16 nNewSymbolsSize ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - + SolarMutexGuard aGuard; + if ( nNewSymbolsSize != m_nSymbolsSize ) { m_nSymbolsSize = nNewSymbolsSize; @@ -226,14 +210,13 @@ void SfxImageManager_Impl::SetSymbolsSize_Impl( sal_Int16 nNewSymbolsSize ) if ( pInf->nFlags & SFX_TOOLBOX_CHANGESYMBOLSET ) { ToolBox *pBox = pInf->pToolBox; - BOOL bHiContrast = pBox->GetSettings().GetStyleSettings().GetHighContrastMode(); USHORT nCount = pBox->GetItemCount(); for ( USHORT nPos=0; nPos<nCount; nPos++ ) { USHORT nId = pBox->GetItemId( nPos ); if ( pBox->GetItemType(nPos) == TOOLBOXITEM_BUTTON ) { - pBox->SetItemImage( nId, GetImage( nId, bLarge, bHiContrast ) ); + pBox->SetItemImage( nId, GetImage( nId, bLarge ) ); SfxStateCache *pCache = SfxViewFrame::Current()->GetBindings().GetStateCache( nId ); if ( pCache ) pCache->SetCachedState(); @@ -250,8 +233,8 @@ void SfxImageManager_Impl::SetSymbolsSize_Impl( sal_Int16 nNewSymbolsSize ) aSize.Height() = aActSize.Height(); pBox->SetSizePixel( aSize ); - } - } + } + } } } } @@ -294,17 +277,17 @@ SfxImageManager::~SfxImageManager() SfxImageManager* SfxImageManager::GetImageManager( SfxModule* pModule ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - - SfxImageManagerMap::const_iterator pIter = + SolarMutexGuard aGuard; + + SfxImageManagerMap::const_iterator pIter = m_ImageManagerMap.find( sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( pModule ))); if ( pIter != m_ImageManagerMap.end() ) return reinterpret_cast< SfxImageManager* >( sal::static_int_cast< sal_IntPtr >( pIter->second )); else { SfxImageManager* pSfxImageManager = new SfxImageManager( pModule ); - m_ImageManagerMap.insert( SfxImageManagerMap::value_type( - sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( pModule )), + m_ImageManagerMap.insert( SfxImageManagerMap::value_type( + sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( pModule )), sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( pSfxImageManager )) )); return pSfxImageManager; } @@ -312,9 +295,9 @@ SfxImageManager* SfxImageManager::GetImageManager( SfxModule* pModule ) //------------------------------------------------------------------------- -Image SfxImageManager::GetImage( USHORT nId, BOOL bBig, BOOL bHiContrast ) const +Image SfxImageManager::GetImage( USHORT nId, BOOL bBig ) const { - ImageList* pImageList = pImp->GetImageList( bBig, bHiContrast ); + ImageList* pImageList = pImp->GetImageList( bBig ); if ( pImageList && pImageList->HasImageAtPos( nId ) ) return pImageList->GetImage( nId ); return Image(); @@ -322,23 +305,23 @@ Image SfxImageManager::GetImage( USHORT nId, BOOL bBig, BOOL bHiContrast ) const //------------------------------------------------------------------------- -Image SfxImageManager::GetImage( USHORT nId, BOOL bHiContrast ) const +Image SfxImageManager::GetImage( USHORT nId ) const { BOOL bLarge = SvtMiscOptions().AreCurrentSymbolsLarge(); - return GetImage( nId, bLarge, bHiContrast ); + return GetImage( nId, bLarge ); } //------------------------------------------------------------------------- -Image SfxImageManager::SeekImage( USHORT nId, BOOL bBig, BOOL bHiContrast ) const +Image SfxImageManager::SeekImage( USHORT nId, BOOL bBig ) const { sal_Bool bGlobal = ( pImp->m_pModule == 0 ); - ImageList* pImageList = pImp->GetImageList( bBig, bHiContrast ); + ImageList* pImageList = pImp->GetImageList( bBig ); if ( pImageList && pImageList->HasImageAtPos( nId ) ) return pImageList->GetImage( nId ); else if ( !bGlobal ) { - pImageList = ::GetImageManager( 0 )->GetImageList( bBig, bHiContrast ); + pImageList = ::GetImageManager( 0 )->GetImageList( bBig ); if ( pImageList ) return pImageList->GetImage( nId ); } @@ -347,18 +330,18 @@ Image SfxImageManager::SeekImage( USHORT nId, BOOL bBig, BOOL bHiContrast ) cons //------------------------------------------------------------------------- -Image SfxImageManager::SeekImage( USHORT nId, BOOL bHiContrast ) const +Image SfxImageManager::SeekImage( USHORT nId ) const { BOOL bLarge = SvtMiscOptions().AreCurrentSymbolsLarge(); - return SeekImage( nId, bLarge, bHiContrast ); + return SeekImage( nId, bLarge ); } //------------------------------------------------------------------------- void SfxImageManager::RegisterToolBox( ToolBox *pBox, USHORT nFlags ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - + SolarMutexGuard aGuard; + ToolBoxInf_Impl* pInf = new ToolBoxInf_Impl; pInf->pToolBox = pBox; pInf->nFlags = nFlags; @@ -369,8 +352,8 @@ void SfxImageManager::RegisterToolBox( ToolBox *pBox, USHORT nFlags ) void SfxImageManager::ReleaseToolBox( ToolBox *pBox ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - + SolarMutexGuard aGuard; + for ( sal_uInt32 n=0; n < pImp->m_aToolBoxes.size(); n++ ) { if ((pImp->m_aToolBoxes[n])->pToolBox == pBox ) @@ -384,17 +367,17 @@ void SfxImageManager::ReleaseToolBox( ToolBox *pBox ) //------------------------------------------------------------------------- -void SfxImageManager::SetImages( ToolBox& rToolBox, BOOL bHiContrast, BOOL bLarge ) +void SfxImageManager::SetImages( ToolBox& rToolBox, BOOL bLarge ) { - SetImagesForceSize( rToolBox, bLarge, bHiContrast ); + SetImagesForceSize( rToolBox, bLarge ); } //------------------------------------------------------------------------- -void SfxImageManager::SetImagesForceSize( ToolBox& rToolBox, BOOL bHiContrast, BOOL bLarge ) +void SfxImageManager::SetImagesForceSize( ToolBox& rToolBox, BOOL bLarge ) { - ImageList* pImageList = pImp->GetImageList( bLarge, bHiContrast ); - + ImageList* pImageList = pImp->GetImageList( bLarge ); + USHORT nCount = rToolBox.GetItemCount(); for (USHORT n=0; n<nCount; n++) { @@ -421,6 +404,7 @@ void SfxImageManager::SetImagesForceSize( ToolBox& rToolBox, BOOL bHiContrast, B void SfxImageManager::SetImages( ToolBox& rToolBox ) { BOOL bLarge = ( pImp->m_nSymbolsSize == SFX_SYMBOLS_SIZE_LARGE ); - BOOL bHiContrast = rToolBox.GetSettings().GetStyleSettings().GetHighContrastMode(); - SetImagesForceSize( rToolBox, bHiContrast, bLarge ); + SetImagesForceSize( rToolBox, bLarge ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx index 8517f60e4c..b176ab39e2 100644 --- a/sfx2/source/toolbox/tbxitem.cxx +++ b/sfx2/source/toolbox/tbxitem.cxx @@ -1,10 +1,11 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2000, 2010 Oracle and/or its affiliates. * - * OpenOffice.org - a multi-platform office productivity suite + * Copyright 2000, 2010 Oracle and/or its affiliates. * * This file is part of OpenOffice.org. * @@ -71,15 +72,10 @@ #include <framework/menuconfiguration.hxx> #include <framework/sfxhelperfunctions.hxx> #include <vcl/taskpanelist.hxx> -#ifndef _TOOLKIT_UNOHLP_HXX #include <toolkit/helper/vclunohelper.hxx> -#endif #include <svtools/menuoptions.hxx> #include <svtools/miscopt.hxx> -#ifndef GCC -#endif - #include <sfx2/tbxctrl.hxx> #include <sfx2/mnumgr.hxx> #include <sfx2/dispatch.hxx> @@ -153,11 +149,11 @@ static Window* GetTopMostParentSystemWindow( Window* pWindow ) svt::ToolboxController* SAL_CALL SfxToolBoxControllerFactory( const Reference< XFrame >& rFrame, ToolBox* pToolbox, unsigned short nID, const ::rtl::OUString& aCommandURL ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; URL aTargetURL; aTargetURL.Complete = aCommandURL; - Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), UNO_QUERY ); + Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), UNO_QUERY ); xTrans->parseStrict( aTargetURL ); if ( aTargetURL.Arguments.getLength() ) return NULL; @@ -297,7 +293,7 @@ void SAL_CALL SfxToolBoxControl::dispose() throw (::com::sun::star::uno::Runtime svt::ToolboxController::dispose(); // Remove and destroy our item window at our toolbox - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Window* pWindow = pImpl->pBox->GetItemWindow( pImpl->nTbxId ); pImpl->pBox->SetItemWindow( pImpl->nTbxId, 0 ); delete pWindow; @@ -330,7 +326,7 @@ void SfxToolBoxControl::RegisterToolBoxControl( SfxModule* pMod, SfxTbxCtrlFacto SfxToolBoxControl* SfxToolBoxControl::CreateControl( USHORT nSlotId, USHORT nTbxId, ToolBox *pBox, SfxModule* pMod ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; SfxToolBoxControl *pCtrl; SfxApplication *pApp = SFX_APP(); @@ -454,7 +450,7 @@ void SfxToolBoxControl::Dispatch( ::com::sun::star::util::URL aTargetURL; aTargetURL.Complete = rCommand; Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), UNO_QUERY ); xTrans->parseStrict( aTargetURL ); @@ -468,7 +464,7 @@ void SfxToolBoxControl::Dispatch( const ::rtl::OUString& aCommand, ::com::sun::s { Reference < XController > xController; - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( getFrameInterface().is() ) xController = getFrameInterface()->getController(); @@ -498,7 +494,7 @@ void SfxToolBoxControl::Dispatch( const ::rtl::OUString& aCommand, ::com::sun::s sAppName = xModuleManager->identify(xFrame); } catch(::com::sun::star::uno::Exception&) {} Sequence<PropertyValue> source; - ::comphelper::UiEventsLogger::appendDispatchOrigin(source, sAppName, ::rtl::OUString::createFromAscii("SfxToolBoxControl")); + ::comphelper::UiEventsLogger::appendDispatchOrigin(source, sAppName, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SfxToolBoxControl"))); ::comphelper::UiEventsLogger::logDispatch(aTargetURL, source); } xDispatch->dispatch( aTargetURL, aArgs ); @@ -539,7 +535,7 @@ throw ( ::com::sun::star::uno::RuntimeException ) SfxViewFrame* pViewFrame = NULL; Reference < XController > xController; - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( getFrameInterface().is() ) xController = getFrameInterface()->getController(); @@ -669,24 +665,24 @@ void SAL_CALL SfxToolBoxControl::updateImage() throw (::com::sun::star::uno::Run // XToolbarController void SAL_CALL SfxToolBoxControl::execute( sal_Int16 KeyModifier ) throw (::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Select( (USHORT)KeyModifier ); } void SAL_CALL SfxToolBoxControl::click() throw (::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Click(); } void SAL_CALL SfxToolBoxControl::doubleClick() throw (::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; DoubleClick(); } Reference< ::com::sun::star::awt::XWindow > SAL_CALL SfxToolBoxControl::createPopupWindow() throw (::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Window* pWindow = CreatePopupWindow(); if ( pWindow ) return VCLUnoHelper::GetInterface( pWindow ); @@ -696,7 +692,7 @@ Reference< ::com::sun::star::awt::XWindow > SAL_CALL SfxToolBoxControl::createPo Reference< ::com::sun::star::awt::XWindow > SAL_CALL SfxToolBoxControl::createItemWindow( const Reference< ::com::sun::star::awt::XWindow >& rParent ) throw (::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; return VCLUnoHelper::GetInterface( CreateItemWindow( VCLUnoHelper::GetWindow( rParent ))); } @@ -735,7 +731,7 @@ throw (::com::sun::star::uno::RuntimeException) void SAL_CALL SfxToolBoxControl::endPopupMode( const ::com::sun::star::awt::EndPopupModeEvent& aEvent ) throw (::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; ::rtl::OUString aSubToolBarResName; if ( pImpl->mxUIElement.is() ) @@ -783,11 +779,8 @@ throw (::com::sun::star::uno::RuntimeException) try { Window* pTbxWindow = VCLUnoHelper::GetWindow( xSubToolBar ); - ToolBox* pToolBar( 0 ); if ( pTbxWindow && pTbxWindow->GetType() == WINDOW_TOOLBOX ) { - pToolBar = (ToolBox *)pTbxWindow; - Any a; a = xProp->getPropertyValue( aPersistentString ); xProp->setPropertyValue( aPersistentString, makeAny( sal_False )); @@ -821,7 +814,7 @@ throw (::com::sun::star::uno::RuntimeException) void SfxToolBoxControl::createAndPositionSubToolBar( const ::rtl::OUString& rSubToolBarResName ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( pImpl->pBox ) { @@ -1031,7 +1024,7 @@ void SfxToolBoxControl::Select( BOOL /*bMod1*/ ) ::rtl::OUString sAppName; try { - static ::rtl::OUString our_aModuleManagerName = ::rtl::OUString::createFromAscii("com.sun.star.frame.ModuleManager"); + static ::rtl::OUString our_aModuleManagerName(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.ModuleManager")); ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceManager = ::comphelper::getProcessServiceFactory(); ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager > xModuleManager( @@ -1040,7 +1033,7 @@ void SfxToolBoxControl::Select( BOOL /*bMod1*/ ) sAppName = xModuleManager->identify(m_xFrame); } catch(::com::sun::star::uno::Exception&) {} Sequence<PropertyValue> vSource; - ::comphelper::UiEventsLogger::appendDispatchOrigin(vSource, sAppName, ::rtl::OUString::createFromAscii("SfxToolBoxControl")); + ::comphelper::UiEventsLogger::appendDispatchOrigin(vSource, sAppName, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SfxToolBoxControl"))); URL aURL; aURL.Complete = m_aCommandURL; ::comphelper::UiEventsLogger::logDispatch(aURL, vSource); @@ -1112,7 +1105,7 @@ throw ( ::com::sun::star::uno::RuntimeException ) SfxViewFrame* pViewFrame = NULL; Reference < XController > xController; - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( m_xFrame.is() ) xController = m_xFrame->getController(); @@ -1526,7 +1519,6 @@ SfxAppToolBoxControl_Impl::SfxAppToolBoxControl_Impl( USHORT nSlotId, USHORT nId // Determine the current background color of the menus const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); m_nSymbolsStyle = rSettings.GetSymbolsStyle(); - m_bWasHiContrastMode = rSettings.GetHighContrastMode(); m_bShowMenuImages = rSettings.GetUseImagesInMenus(); SetImage( String() ); @@ -1615,7 +1607,7 @@ SfxPopupWindow* SfxAppToolBoxControl_Impl::CreatePopupWindow() if ( !pMenu ) { ::framework::MenuConfiguration aConf( m_xServiceManager ); - if ( m_aCommandURL.equalsAscii( ".uno:AddDirect" )) + if ( m_aCommandURL.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ".uno:AddDirect" ) )) pMenu = aConf.CreateBookmarkMenu( m_xFrame, BOOKMARK_NEWMENU ); else pMenu = aConf.CreateBookmarkMenu( m_xFrame, BOOKMARK_WIZARDMENU ); @@ -1651,11 +1643,10 @@ void SfxAppToolBoxControl_Impl::SetImage( const String &rURL ) aURL = sFallback; BOOL bBig = SvtMiscOptions().AreCurrentSymbolsLarge(); - BOOL bHC = GetToolBox().GetSettings().GetStyleSettings().GetHighContrastMode(); - Image aImage = SvFileInformationManager::GetImageNoDefault( INetURLObject( aURL ), bBig, bHC ); + Image aImage = SvFileInformationManager::GetImageNoDefault( INetURLObject( aURL ), bBig ); if ( !aImage ) aImage = !!aMenuImage ? aMenuImage : - SvFileInformationManager::GetImage( INetURLObject( aURL ), bBig, bHC ); + SvFileInformationManager::GetImage( INetURLObject( aURL ), bBig ); Size aBigSize( GetToolBox().GetDefaultImageSize() ); if ( bBig && aImage.GetSizePixel() != aBigSize ) { @@ -1713,7 +1704,7 @@ void SfxAppToolBoxControl_Impl::Select( BOOL bMod1 ) aTargetURL.Complete = aLastURL; getURLTransformer()->parseStrict( aTargetURL ); - ::rtl::OUString aTarget( ::rtl::OUString::createFromAscii( "_default" )); + ::rtl::OUString aTarget( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_default"))); if ( pMenu ) { ::framework::MenuConfiguration::Attributes* pMenuAttributes = @@ -1729,8 +1720,8 @@ void SfxAppToolBoxControl_Impl::Select( BOOL bMod1 ) { Sequence< PropertyValue > aArgs( 1 ); - aArgs[0].Name = ::rtl::OUString::createFromAscii( "Referer" ); - aArgs[0].Value = makeAny( ::rtl::OUString::createFromAscii( SFX_REFERER_USER )); + aArgs[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Referer")); + aArgs[0].Value = makeAny( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SFX_REFERER_USER )) ); ExecuteInfo* pExecuteInfo = new ExecuteInfo; pExecuteInfo->xDispatch = xDispatch; @@ -1761,7 +1752,7 @@ long Select_Impl( void* /*pHdl*/, void* pVoid ) URL aTargetURL; aTargetURL.Complete = aURL; Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), UNO_QUERY ); xTrans->parseStrict( aTargetURL ); @@ -1773,7 +1764,7 @@ long Select_Impl( void* /*pHdl*/, void* pVoid ) xDisp = xProv->queryDispatch( aTargetURL, ::rtl::OUString(), 0 ); else { - ::rtl::OUString aTargetFrame( ::rtl::OUString::createFromAscii( "_blank" ) ); + ::rtl::OUString aTargetFrame( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_blank")) ); ::framework::MenuConfiguration::Attributes* pMenuAttributes = (::framework::MenuConfiguration::Attributes*)pMenu->GetUserValue( pMenu->GetCurItemId() ); @@ -1802,15 +1793,12 @@ IMPL_LINK( SfxAppToolBoxControl_Impl, Activate, Menu *, pActMenu ) { const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); ULONG nSymbolsStyle = rSettings.GetSymbolsStyle(); - BOOL bIsHiContrastMode = rSettings.GetHighContrastMode(); BOOL bShowMenuImages = rSettings.GetUseImagesInMenus(); if (( nSymbolsStyle != m_nSymbolsStyle ) || - ( bIsHiContrastMode != m_bWasHiContrastMode ) || ( bShowMenuImages != m_bShowMenuImages )) { m_nSymbolsStyle = nSymbolsStyle; - m_bWasHiContrastMode = bIsHiContrastMode; m_bShowMenuImages = bShowMenuImages; USHORT nCount = pActMenu->GetItemCount(); @@ -1832,7 +1820,7 @@ IMPL_LINK( SfxAppToolBoxControl_Impl, Activate, Menu *, pActMenu ) if ( aImageId.getLength() > 0 ) { Reference< ::com::sun::star::frame::XFrame > xFrame; - Image aImage = GetImage( xFrame, aImageId, FALSE, bIsHiContrastMode ); + Image aImage = GetImage( xFrame, aImageId, FALSE ); if ( !!aImage ) { bImageSet = sal_True; @@ -1844,7 +1832,7 @@ IMPL_LINK( SfxAppToolBoxControl_Impl, Activate, Menu *, pActMenu ) if ( !bImageSet && aCmd.Len() ) { Image aImage = SvFileInformationManager::GetImage( - INetURLObject(aCmd), FALSE, bIsHiContrastMode ); + INetURLObject(aCmd), FALSE ); if ( !!aImage ) pActMenu->SetItemImage( nId, aImage ); } @@ -1893,3 +1881,5 @@ IMPL_STATIC_LINK_NOINSTANCE( SfxAppToolBoxControl_Impl, ExecuteHdl_Impl, Execute void SfxAppToolBoxControl_Impl::Click( ) { } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx index 09e42563d6..acea8a46f0 100644 --- a/sfx2/source/view/frame.cxx +++ b/sfx2/source/view/frame.cxx @@ -1,10 +1,11 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2000, 2010 Oracle and/or its affiliates. * - * OpenOffice.org - a multi-platform office productivity suite + * Copyright 2000, 2010 Oracle and/or its affiliates. * * This file is part of OpenOffice.org. * @@ -37,7 +38,6 @@ #include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/container/XChild.hpp> -#ifndef _MENU_HXX //autogen #include <vcl/menu.hxx> #endif #include <svl/intitem.hxx> @@ -48,16 +48,10 @@ #include <svl/stritem.hxx> #ifndef _TOOLKIT_UNOHLP_HXX #include <toolkit/helper/vclunohelper.hxx> -#endif #include <com/sun/star/awt/PosSize.hpp> -#ifndef _UNOTOOLS_PROCESSFACTORY_HXX #include <comphelper/processfactory.hxx> -#endif #include <vcl/msgbox.hxx> -#ifndef GCC -#endif - // wg. pTopFrames #include "appdata.hxx" #include <sfx2/app.hxx> @@ -503,11 +497,11 @@ void SfxFrame::GetTargetList( TargetList& rList ) const if ( !GetParentFrame() ) { // Einen Leerstring f"ur 'Kein Target' - rList.Insert( new String() ); - rList.Insert( new String( DEFINE_CONST_UNICODE( "_top" ) ) ); - rList.Insert( new String( DEFINE_CONST_UNICODE( "_parent" ) ) ); - rList.Insert( new String( DEFINE_CONST_UNICODE( "_blank" ) ) ); - rList.Insert( new String( DEFINE_CONST_UNICODE( "_self" ) ) ); + rList.push_back( new String() ); + rList.push_back( new String( DEFINE_CONST_UNICODE( "_top" ) ) ); + rList.push_back( new String( DEFINE_CONST_UNICODE( "_parent" ) ) ); + rList.push_back( new String( DEFINE_CONST_UNICODE( "_blank" ) ) ); + rList.push_back( new String( DEFINE_CONST_UNICODE( "_self" ) ) ); } SfxViewFrame* pView = GetCurrentViewFrame(); @@ -592,7 +586,7 @@ SfxPoolItem* SfxFrameItem::Clone( SfxItemPool *) const return pNew; } -sal_Bool SfxFrameItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE ) const +bool SfxFrameItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE ) const { if ( wFrame ) { @@ -603,7 +597,7 @@ sal_Bool SfxFrameItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE ) const return FALSE; } -sal_Bool SfxFrameItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE ) +bool SfxFrameItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE ) { Reference < XFrame > xFrame; if ( (rVal >>= xFrame) && xFrame.is() ) @@ -643,13 +637,13 @@ SfxPoolItem* SfxUsrAnyItem::Clone( SfxItemPool *) const return new SfxUsrAnyItem( Which(), aValue ); } -sal_Bool SfxUsrAnyItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE /*nMemberId*/ ) const +bool SfxUsrAnyItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE /*nMemberId*/ ) const { rVal = aValue; return sal_True; } -sal_Bool SfxUsrAnyItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE /*nMemberId*/ ) +bool SfxUsrAnyItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE /*nMemberId*/ ) { aValue = rVal; return sal_True; @@ -992,3 +986,4 @@ const SfxPoolItem* SfxFrame::OpenDocumentSynchron( SfxItemSet& i_rSet, const Ref return SFX_APP()->GetDispatcher_Impl()->Execute( SID_OPENDOC, SFX_CALLMODE_SYNCHRON, i_rSet ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index a5b6f8d4fa..d7e8547f2b 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,6 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" +#include <sal/macros.h> #include "frmload.hxx" #include "objshimp.hxx" #include "sfx2/app.hxx" @@ -695,14 +697,14 @@ UNOSEQUENCE< UNOOUSTRING > SfxFrameLoader_Impl::impl_getStaticSupportedServiceNa { UNOMUTEXGUARD aGuard( UNOMUTEX::getGlobalMutex() ); UNOSEQUENCE< UNOOUSTRING > seqServiceNames( 1 ); - seqServiceNames.getArray() [0] = UNOOUSTRING::createFromAscii( "com.sun.star.frame.SynchronousFrameLoader" ); + seqServiceNames.getArray() [0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.SynchronousFrameLoader" )); return seqServiceNames ; } /* Helper for XServiceInfo */ UNOOUSTRING SfxFrameLoader_Impl::impl_getStaticImplementationName() { - return UNOOUSTRING::createFromAscii( "com.sun.star.comp.office.FrameLoader" ); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.office.FrameLoader" )); } /* Helper for registry */ @@ -711,3 +713,4 @@ UNOREFERENCE< UNOXINTERFACE > SAL_CALL SfxFrameLoader_Impl::impl_createInstance( return UNOREFERENCE< UNOXINTERFACE >( *new SfxFrameLoader_Impl( xServiceManager ) ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/view/impframe.hxx b/sfx2/source/view/impframe.hxx index b327bce801..cee90cd7ce 100644 --- a/sfx2/source/view/impframe.hxx +++ b/sfx2/source/view/impframe.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -98,3 +99,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx index fc5a49eb58..6c9d4fd658 100644 --- a/sfx2/source/view/ipclient.cxx +++ b/sfx2/source/view/ipclient.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -216,9 +217,9 @@ throw (::com::sun::star::uno::RuntimeException) void SAL_CALL SfxInPlaceClient_Impl::notifyEvent( const document::EventObject& aEvent ) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; - if ( m_pClient && aEvent.EventName.equalsAscii("OnVisAreaChanged") && m_nAspect != embed::Aspects::MSOLE_ICON ) + if ( m_pClient && aEvent.EventName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("OnVisAreaChanged")) && m_nAspect != embed::Aspects::MSOLE_ICON ) { m_pClient->FormatChanged(); // for Writer when format of the object is changed with the area m_pClient->ViewChanged(); @@ -354,7 +355,7 @@ void SAL_CALL SfxInPlaceClient_Impl::visibilityChanged( sal_Bool bVisible ) throw ( embed::WrongStateException, uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( !m_pClient || !m_pClient->GetViewShell() ) throw uno::RuntimeException(); @@ -438,7 +439,7 @@ uno::Reference< ::com::sun::star::frame::XLayoutManager > SAL_CALL SfxInPlaceCli uno::Reference< ::com::sun::star::frame::XLayoutManager > xMan; try { - uno::Any aAny = xFrame->getPropertyValue( ::rtl::OUString::createFromAscii("LayoutManager") ); + uno::Any aAny = xFrame->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LayoutManager")) ); aAny >>= xMan; } catch ( uno::Exception& ) @@ -1167,3 +1168,5 @@ BOOL SfxInPlaceClient::IsUIActive() { return m_pImp->m_bUIActive; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/view/orgmgr.cxx b/sfx2/source/view/orgmgr.cxx index 5cc69f6364..4263db3b7f 100644 --- a/sfx2/source/view/orgmgr.cxx +++ b/sfx2/source/view/orgmgr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,16 +32,10 @@ #include <com/sun/star/embed/XTransactedObject.hpp> #include <com/sun/star/embed/ElementModes.hpp> -#ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> -#endif #include <tools/urlobj.hxx> -#ifndef GCC -#endif -#ifndef _UNOTOOLS_PROCESSFACTORY_HXX #include <comphelper/processfactory.hxx> -#endif #include <unotools/intlwrapper.hxx> #include <comphelper/storagehelper.hxx> @@ -830,3 +825,4 @@ void SfxOrganizeMgr::SaveAll(Window *pParent) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/view/printer.cxx b/sfx2/source/view/printer.cxx index 8db0147da2..1db73a4d29 100644 --- a/sfx2/source/view/printer.cxx +++ b/sfx2/source/view/printer.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,9 +35,6 @@ #include <svtools/printoptions.hxx> #include <vector> -#ifndef GCC -#endif - #include <sfx2/printer.hxx> #include <sfx2/printopt.hxx> #include "sfxtypes.hxx" @@ -310,3 +308,4 @@ void SfxPrintOptionsDialog::DisableHelp() aHelpBtn.Disable(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index 46d47b76fe..6b5e2f69be 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -80,7 +81,6 @@ #include <workwin.hxx> #include <sfx2/objface.hxx> -#include <vos/mutex.hxx> #include <osl/mutex.hxx> #include <tools/diagnose_ex.h> #include <comphelper/sequence.hxx> @@ -275,7 +275,7 @@ public: void SAL_CALL SfxStatusIndicator::start(const ::rtl::OUString& aText, sal_Int32 nRange) throw(::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( xOwner.is() ) { _nRange = nRange; @@ -294,7 +294,7 @@ void SAL_CALL SfxStatusIndicator::start(const ::rtl::OUString& aText, sal_Int32 void SAL_CALL SfxStatusIndicator::end(void) throw(::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( xOwner.is() ) { if ( !xProgress.is() ) @@ -309,7 +309,7 @@ void SAL_CALL SfxStatusIndicator::end(void) throw(::com::sun::star::uno::Runtime void SAL_CALL SfxStatusIndicator::setText(const ::rtl::OUString& aText) throw(::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( xOwner.is() ) { if ( !xProgress.is() ) @@ -324,7 +324,7 @@ void SAL_CALL SfxStatusIndicator::setText(const ::rtl::OUString& aText) throw(:: void SAL_CALL SfxStatusIndicator::setValue( sal_Int32 nValue ) throw(::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( xOwner.is() ) { _nValue = nValue; @@ -343,7 +343,7 @@ void SAL_CALL SfxStatusIndicator::setValue( sal_Int32 nValue ) throw(::com::sun: void SAL_CALL SfxStatusIndicator::reset() throw(::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( xOwner.is() ) { if ( !xProgress.is() ) @@ -358,7 +358,7 @@ void SAL_CALL SfxStatusIndicator::reset() throw(::com::sun::star::uno::RuntimeEx void SAL_CALL SfxStatusIndicator::disposing( const com::sun::star::lang::EventObject& /*Source*/ ) throw(::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; xOwner = 0; xProgress.clear(); } @@ -420,7 +420,7 @@ void SAL_CALL IMPL_SfxBaseController_CloseListenerHelper::disposing( const EVENT void SAL_CALL IMPL_SfxBaseController_CloseListenerHelper::queryClosing( const EVENTOBJECT& aEvent, sal_Bool bDeliverOwnership ) throw (RUNTIMEEXCEPTION, com::sun::star::util::CloseVetoException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; SfxViewShell* pShell = m_pController->GetViewShell_Impl(); if ( m_pController != NULL && pShell ) { @@ -437,7 +437,7 @@ void SAL_CALL IMPL_SfxBaseController_CloseListenerHelper::queryClosing( const EV pShell->TakeFrameOwnerShip_Impl(); } - throw com::sun::star::util::CloseVetoException(::rtl::OUString::createFromAscii("Controller disagree ..."),static_cast< ::cppu::OWeakObject*>(this)); + throw com::sun::star::util::CloseVetoException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Controller disagree ...")),static_cast< ::cppu::OWeakObject*>(this)); } } } @@ -504,7 +504,7 @@ IMPL_SfxBaseController_ListenerHelper::~IMPL_SfxBaseController_ListenerHelper() void SAL_CALL IMPL_SfxBaseController_ListenerHelper::frameAction( const FRAMEACTIONEVENT& aEvent ) throw( RUNTIMEEXCEPTION ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( ( m_pController != NULL ) && ( aEvent.Frame == m_pController->getFrame() ) && @@ -529,7 +529,7 @@ void SAL_CALL IMPL_SfxBaseController_ListenerHelper::frameAction( const FRAMEACT void SAL_CALL IMPL_SfxBaseController_ListenerHelper::disposing( const EVENTOBJECT& /*aEvent*/ ) throw( ::com::sun::star::uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( m_pController && m_pController->getFrame().is() ) m_pController->getFrame()->removeFrameActionListener( this ) ; } @@ -616,7 +616,7 @@ void SAL_CALL SfxBaseController::attachFrame( const REFERENCE< XFRAME >& xFrame { REFERENCE< XFRAME > xTemp( getFrame() ) ; - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( xTemp.is() ) { xTemp->removeFrameActionListener( m_pData->m_xListener ) ; @@ -670,7 +670,7 @@ sal_Bool SAL_CALL SfxBaseController::attachModel( const REFERENCE< XMODEL >& xMo sal_Bool SAL_CALL SfxBaseController::suspend( sal_Bool bSuspend ) throw( ::com::sun::star::uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; // ignore dublicate calls, which doesnt change anything real if (bSuspend == m_pData->m_bSuspendState) @@ -730,7 +730,7 @@ ANY SfxBaseController::getViewData() throw( ::com::sun::star::uno::RuntimeExcept { ANY aAny; String sData1; - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( m_pData->m_pViewShell ) { m_pData->m_pViewShell->WriteUserData( sData1 ) ; @@ -747,7 +747,7 @@ ANY SfxBaseController::getViewData() throw( ::com::sun::star::uno::RuntimeExcept void SAL_CALL SfxBaseController::restoreViewData( const ANY& aValue ) throw( ::com::sun::star::uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( m_pData->m_pViewShell ) { ::rtl::OUString sData; @@ -762,7 +762,7 @@ void SAL_CALL SfxBaseController::restoreViewData( const ANY& aValue ) throw( ::c REFERENCE< XFRAME > SAL_CALL SfxBaseController::getFrame() throw( ::com::sun::star::uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; return m_pData->m_xFrame; } @@ -772,7 +772,7 @@ REFERENCE< XFRAME > SAL_CALL SfxBaseController::getFrame() throw( ::com::sun::st REFERENCE< XMODEL > SAL_CALL SfxBaseController::getModel() throw( ::com::sun::star::uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; return m_pData->m_pViewShell ? m_pData->m_pViewShell->GetObjectShell()->GetModel() : REFERENCE < XMODEL > () ; } @@ -784,14 +784,14 @@ REFERENCE< XDISPATCH > SAL_CALL SfxBaseController::queryDispatch( const UNOURL& const ::rtl::OUString& sTargetFrameName, sal_Int32 eSearchFlags ) throw( RUNTIMEEXCEPTION ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; REFERENCE< XDISPATCH > xDisp; if ( m_pData->m_pViewShell ) { SfxViewFrame* pAct = m_pData->m_pViewShell->GetViewFrame() ; if ( !m_pData->m_bDisposing ) { - if ( sTargetFrameName.compareToAscii( "_beamer" ) == COMPARE_EQUAL ) + if ( sTargetFrameName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("_beamer")) ) { SfxViewFrame *pFrame = m_pData->m_pViewShell->GetViewFrame(); if ( eSearchFlags & ( ::com::sun::star::frame::FrameSearchFlag::CREATE )) @@ -808,7 +808,7 @@ REFERENCE< XDISPATCH > SAL_CALL SfxBaseController::queryDispatch( const UNOURL& return xProv->queryDispatch( aURL, sTargetFrameName, ::com::sun::star::frame::FrameSearchFlag::SELF ); } - if ( aURL.Protocol.compareToAscii( ".uno:" ) == COMPARE_EQUAL ) + if ( aURL.Protocol.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(".uno:")) ) { rtl::OUString aMasterCommand = SfxOfficeDispatch::GetMasterUnoCommand( aURL ); sal_Bool bMasterCommand( aMasterCommand.getLength() > 0 ); @@ -864,7 +864,7 @@ REFERENCE< XDISPATCH > SAL_CALL SfxBaseController::queryDispatch( const UNOURL& } } } - else if ( aURL.Protocol.compareToAscii( "slot:" ) == COMPARE_EQUAL ) + else if ( aURL.Protocol.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("slot:")) ) { USHORT nId = (USHORT) aURL.Path.toInt32(); @@ -916,7 +916,7 @@ REFERENCE< XDISPATCH > SAL_CALL SfxBaseController::queryDispatch( const UNOURL& } } } - else if( sTargetFrameName.compareToAscii( "_self" )==COMPARE_EQUAL || sTargetFrameName.getLength()==0 ) + else if( sTargetFrameName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("_self")) || sTargetFrameName.getLength()==0 ) { // check for already loaded URL ... but with additional jumpmark! REFERENCE< XMODEL > xModel = getModel(); @@ -964,7 +964,7 @@ frame::BorderWidths SAL_CALL SfxBaseController::getBorder() { frame::BorderWidths aResult; - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( m_pData->m_pViewShell ) { SvBorder aBorder = m_pData->m_pViewShell->GetBorderPixel(); @@ -994,7 +994,7 @@ void SAL_CALL SfxBaseController::removeBorderResizeListener( const uno::Referenc awt::Rectangle SAL_CALL SfxBaseController::queryBorderedArea( const awt::Rectangle& aPreliminaryRectangle ) throw ( uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( m_pData->m_pViewShell ) { Rectangle aTmpRect = VCLRectangle( aPreliminaryRectangle ); @@ -1120,7 +1120,7 @@ void SAL_CALL SfxBaseController::removeEventListener( const REFERENCE< XEVENTLIS void SfxBaseController::ReleaseShell_Impl() { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( m_pData->m_pViewShell ) { SfxObjectShell* pDoc = m_pData->m_pViewShell->GetObjectShell() ; @@ -1146,7 +1146,7 @@ SfxViewShell* SfxBaseController::GetViewShell_Impl() const ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > SAL_CALL SfxBaseController::getStatusIndicator( ) throw (::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( m_pData->m_pViewShell && !m_pData->m_xIndicator.is() ) m_pData->m_xIndicator = new SfxStatusIndicator( this, m_pData->m_pViewShell->GetViewFrame()->GetFrame().GetWorkWindow_Impl() ); return m_pData->m_xIndicator; @@ -1157,7 +1157,7 @@ void SAL_CALL SfxBaseController::registerContextMenuInterceptor( const REFERENCE { m_pData->m_aInterceptorContainer.addInterface( xInterceptor ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( m_pData->m_pViewShell ) m_pData->m_pViewShell->AddContextMenuInterceptor_Impl( xInterceptor ); } @@ -1167,39 +1167,39 @@ void SAL_CALL SfxBaseController::releaseContextMenuInterceptor( const REFERENCE< { m_pData->m_aInterceptorContainer.removeInterface( xInterceptor ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( m_pData->m_pViewShell ) m_pData->m_pViewShell->RemoveContextMenuInterceptor_Impl( xInterceptor ); } void SAL_CALL SfxBaseController::addKeyHandler( const ::com::sun::star::uno::Reference< XKEYHANDLER >& xHandler ) throw (::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; m_pData->m_aUserInputInterception.addKeyHandler( xHandler ); } void SAL_CALL SfxBaseController::removeKeyHandler( const ::com::sun::star::uno::Reference< XKEYHANDLER >& xHandler ) throw (::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; m_pData->m_aUserInputInterception.removeKeyHandler( xHandler ); } void SAL_CALL SfxBaseController::addMouseClickHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseClickHandler >& xHandler ) throw (::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; m_pData->m_aUserInputInterception.addMouseClickHandler( xHandler ); } void SAL_CALL SfxBaseController::removeMouseClickHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseClickHandler >& xHandler ) throw (::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; m_pData->m_aUserInputInterception.removeMouseClickHandler( xHandler ); } ::com::sun::star::uno::Sequence< sal_Int16 > SAL_CALL SfxBaseController::getSupportedCommandGroups() throw (::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; std::list< sal_Int16 > aGroupList; SfxViewFrame* pViewFrame( m_pData->m_pViewShell->GetFrame() ); @@ -1235,7 +1235,7 @@ throw (::com::sun::star::uno::RuntimeException) { std::list< ::com::sun::star::frame::DispatchInformation > aCmdList; - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( m_pData->m_pViewShell ) { const ULONG nMode( SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_MENUCONFIG ); @@ -1487,7 +1487,7 @@ void SfxBaseController::ConnectSfxFrame_Impl( const ConnectSfxFrame i_eConnect ) //============================================================================= css::uno::Reference< css::frame::XTitle > SfxBaseController::impl_getTitleHelper () { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( ! m_pData->m_xTitleHelper.is ()) { @@ -1540,3 +1540,5 @@ void SAL_CALL SfxBaseController::removeTitleChangeListener(const css::uno::Refer if (xBroadcaster.is ()) xBroadcaster->removeTitleChangeListener (xListener); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/view/userinputinterception.cxx b/sfx2/source/view/userinputinterception.cxx index 6fca09fb29..a05b94fb69 100644 --- a/sfx2/source/view/userinputinterception.cxx +++ b/sfx2/source/view/userinputinterception.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -276,3 +277,5 @@ namespace sfx2 //........................................................................ } // namespace sfx2 //........................................................................ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/view/viewfac.cxx b/sfx2/source/view/viewfac.cxx index 432c8a5a1e..60d8c6bb62 100644 --- a/sfx2/source/view/viewfac.cxx +++ b/sfx2/source/view/viewfac.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -86,3 +87,4 @@ SfxViewFactory::~SfxViewFactory() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 82db2aa1b5..db2fb425a7 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -48,6 +49,7 @@ #include <svl/undo.hxx> #include <vcl/msgbox.hxx> #include <svtools/sfxecode.hxx> +#include <svtools/miscopt.hxx> #include <svtools/ehdl.hxx> #include <tools/diagnose_ex.h> #include <com/sun/star/container/XIndexAccess.hpp> @@ -716,7 +718,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) if (!pInteractionItem) { - Reference < ::com::sun::star::task::XInteractionHandler > xHdl( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.comp.uui.UUIInteractionHandler")), UNO_QUERY ); + Reference < ::com::sun::star::task::XInteractionHandler > xHdl( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.uui.UUIInteractionHandler"))), UNO_QUERY ); if (xHdl.is()) pNewSet->Put( SfxUnoAnyItem(SID_INTERACTIONHANDLER,::com::sun::star::uno::makeAny(xHdl)) ); } @@ -2245,6 +2247,7 @@ SfxViewFrame* SfxViewFrame::Get( const Reference< XController>& i_rController, c if ( pViewFrame->GetViewShell()->GetController() == i_rController ) break; } + OSL_ENSURE( !sNewViewName.Equals( sCurrentViewName ), "SfxViewFrame::SaveCurrentViewData_Impl: suspicious: new and old view name are identical!" ); return pViewFrame; } @@ -2536,16 +2539,16 @@ void SfxViewFrame::ExecView_Impl */ sal_Bool impl_maxOpenDocCountReached() { - static ::rtl::OUString SERVICE_DESKTOP = ::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop"); + static ::rtl::OUString SERVICE_DESKTOP(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")); try { css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory(); css::uno::Any aVal = ::comphelper::ConfigurationHelper::readDirectKey( xSMGR, - ::rtl::OUString::createFromAscii("org.openoffice.Office.Common/"), - ::rtl::OUString::createFromAscii("Misc"), - ::rtl::OUString::createFromAscii("MaxOpenDocuments"), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Common/")), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Misc")), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MaxOpenDocuments")), ::comphelper::ConfigurationHelper::E_READONLY); // NIL means: count of allowed documents = infinite ! @@ -2572,7 +2575,7 @@ sal_Bool impl_maxOpenDocCountReached() continue; // a) do not count the help window - if (xFrame->getName().equalsAscii("OFFICE_HELP_TASK")) + if (xFrame->getName().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("OFFICE_HELP_TASK"))) continue; // b) count all other frames @@ -2775,7 +2778,6 @@ void SfxViewFrame::Resize( BOOL bForce ) void CutLines( ::rtl::OUString& rStr, sal_Int32 nStartLine, sal_Int32 nLines, BOOL bEraseTrailingEmptyLines ) { sal_Int32 nStartPos = 0; - sal_Int32 nEndPos = 0; sal_Int32 nLine = 0; while ( nLine < nStartLine ) { @@ -2790,7 +2792,7 @@ void CutLines( ::rtl::OUString& rStr, sal_Int32 nStartLine, sal_Int32 nLines, BO if ( nStartPos != -1 ) { - nEndPos = nStartPos; + sal_Int32 nEndPos = nStartPos; for ( sal_Int32 i = 0; i < nLines; i++ ) nEndPos = rStr.indexOf( LINE_SEP, nEndPos+1 ); @@ -2853,7 +2855,7 @@ void SfxViewFrame::AddDispatchMacroToBasic_Impl( const ::rtl::OUString& sMacro ) String aLocation; Reference< XMultiServiceFactory > xSMgr = ::comphelper::getProcessServiceFactory(); Reference< com::sun::star::uri::XUriReferenceFactory > xFactory( xSMgr->createInstance( - ::rtl::OUString::createFromAscii( "com.sun.star.uri.UriReferenceFactory" ) ), UNO_QUERY ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uri.UriReferenceFactory")) ), UNO_QUERY ); if ( xFactory.is() ) { Reference< com::sun::star::uri::XVndSunStarScriptUrl > xUrl( xFactory->parse( aScriptURL ), UNO_QUERY ); @@ -2870,7 +2872,7 @@ void SfxViewFrame::AddDispatchMacroToBasic_Impl( const ::rtl::OUString& sMacro ) aMacroName = aName.getToken( 0, cTok, nIndex ); // get location - ::rtl::OUString aLocKey = ::rtl::OUString::createFromAscii( "location" ); + ::rtl::OUString aLocKey(RTL_CONSTASCII_USTRINGPARAM("location")); if ( xUrl->hasParameter( aLocKey ) ) aLocation = xUrl->getParameter( aLocKey ); } @@ -3028,14 +3030,14 @@ void SfxViewFrame::AddDispatchMacroToBasic_Impl( const ::rtl::OUString& sMacro ) void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq ) { DBG_MEMTEST(); - FASTBOOL bDone = FALSE; + bool bDone = false; switch ( rReq.GetSlot() ) { case SID_STOP_RECORDING : case SID_RECORDMACRO : { // try to find any active recorder on this frame - ::rtl::OUString sProperty = rtl::OUString::createFromAscii("DispatchRecorderSupplier"); + ::rtl::OUString sProperty(RTL_CONSTASCII_USTRINGPARAM("DispatchRecorderSupplier")); com::sun::star::uno::Reference< com::sun::star::frame::XFrame > xFrame( GetFrame().GetFrameInterface(), com::sun::star::uno::UNO_QUERY); @@ -3080,11 +3082,11 @@ void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq ) com::sun::star::uno::UNO_QUERY); xRecorder = com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorder >( - xFactory->createInstance(rtl::OUString::createFromAscii("com.sun.star.frame.DispatchRecorder")), + xFactory->createInstance(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("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::createFromAscii("com.sun.star.frame.DispatchRecorderSupplier")), + xFactory->createInstance(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.DispatchRecorderSupplier"))), com::sun::star::uno::UNO_QUERY); xSupplier->setDispatchRecorder(xRecorder); @@ -3236,14 +3238,16 @@ void SfxViewFrame::MiscState_Impl(SfxItemSet &rSet) case SID_RECORDMACRO : { + SvtMiscOptions aMiscOptions; const char* pName = GetObjectShell()->GetFactory().GetShortName(); - if ( strcmp(pName,"swriter") && strcmp(pName,"scalc") ) + if ( !aMiscOptions.IsExperimentalMode() || + ( strcmp(pName,"swriter") && strcmp(pName,"scalc") ) ) { rSet.DisableItem( nWhich ); break; } - ::rtl::OUString sProperty = rtl::OUString::createFromAscii("DispatchRecorderSupplier"); + ::rtl::OUString sProperty(RTL_CONSTASCII_USTRINGPARAM("DispatchRecorderSupplier")); com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xSet( GetFrame().GetFrameInterface(), com::sun::star::uno::UNO_QUERY); @@ -3259,14 +3263,16 @@ void SfxViewFrame::MiscState_Impl(SfxItemSet &rSet) case SID_STOP_RECORDING : { + SvtMiscOptions aMiscOptions; const char* pName = GetObjectShell()->GetFactory().GetShortName(); - if ( strcmp(pName,"swriter") && strcmp(pName,"scalc") ) + if ( !aMiscOptions.IsExperimentalMode() || + ( strcmp(pName,"swriter") && strcmp(pName,"scalc") ) ) { rSet.DisableItem( nWhich ); break; } - ::rtl::OUString sProperty = rtl::OUString::createFromAscii("DispatchRecorderSupplier"); + ::rtl::OUString sProperty(RTL_CONSTASCII_USTRINGPARAM("DispatchRecorderSupplier")); com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xSet( GetFrame().GetFrameInterface(), com::sun::star::uno::UNO_QUERY); @@ -3372,20 +3378,20 @@ void SfxViewFrame::ChildWindowExecute( SfxRequest &rReq ) else { ::com::sun::star::util::URL aTargetURL; - aTargetURL.Complete = ::rtl::OUString::createFromAscii(".component:DB/DataSourceBrowser"); - Reference < ::com::sun::star::util::XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), UNO_QUERY ); + aTargetURL.Complete = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".component:DB/DataSourceBrowser")); + Reference < ::com::sun::star::util::XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), UNO_QUERY ); xTrans->parseStrict( aTargetURL ); Reference < XDispatchProvider > xProv( xFrame, UNO_QUERY ); Reference < ::com::sun::star::frame::XDispatch > xDisp; if ( xProv.is() ) - xDisp = xProv->queryDispatch( aTargetURL, ::rtl::OUString::createFromAscii("_beamer"), 31 ); + xDisp = xProv->queryDispatch( aTargetURL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_beamer")), 31 ); if ( xDisp.is() ) { Sequence < ::com::sun::star::beans::PropertyValue > aArgs(1); ::com::sun::star::beans::PropertyValue* pArg = aArgs.getArray(); - pArg[0].Name = rtl::OUString::createFromAscii("Referer"); - pArg[0].Value <<= ::rtl::OUString::createFromAscii("private:user"); + pArg[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Referer")); + pArg[0].Value <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("private:user")); xDisp->dispatch( aTargetURL, aArgs ); } } @@ -3597,3 +3603,5 @@ void SfxViewFrame::ActivateToolPanel_Impl( const ::rtl::OUString& i_rPanelURL ) ENSURE_OR_RETURN_VOID( pPanelAccess, "SfxViewFrame::ActivateToolPanel_Impl: task pane child window does not implement a required interface!" ); pPanelAccess->ActivateToolPanel( i_rPanelURL ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/view/viewimp.hxx b/sfx2/source/view/viewimp.hxx index 6c06da3599..a8355e751a 100644 --- a/sfx2/source/view/viewimp.hxx +++ b/sfx2/source/view/viewimp.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -83,3 +84,4 @@ struct SfxViewShell_Impl #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index 1a43efb5ed..3646712fe7 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -426,34 +427,6 @@ IMPL_LINK( SfxDialogExecutor_Impl, Execute, void *, EMPTYARG ) //------------------------------------------------------------------------- -BOOL UseStandardPrinter_Impl( Window* /*pParent*/, SfxPrinter* pDocPrinter ) -{ - // Optionen abfragen, ob gewarnt werden soll (Doc uebersteuert App) - BOOL bWarn = FALSE; - const SfxItemSet *pDocOptions = &pDocPrinter->GetOptions(); - if ( pDocOptions ) - { - USHORT nWhich = pDocOptions->GetPool()->GetWhich(SID_PRINTER_NOTFOUND_WARN); - const SfxBoolItem* pBoolItem = NULL; - pDocPrinter->GetOptions().GetItemState( nWhich, FALSE, (const SfxPoolItem**) &pBoolItem ); - if ( pBoolItem ) - bWarn = pBoolItem->GetValue(); - } -/* - // ggf. den User fragen - if ( bWarn ) - { - // Geht nicht mehr ohne OrigJobSetup! - String aTmp( SfxResId( STR_PRINTER_NOTAVAIL ) ); - QueryBox aBox( pParent, WB_OK_CANCEL | WB_DEF_OK, aTmp ); - return RET_OK == aBox.Execute(); - } -*/ - // nicht gewarnt => einfach so den StandardDrucker nehmen - return TRUE; -} -//------------------------------------------------------------------------- - SfxPrinter* SfxViewShell::SetPrinter_Impl( SfxPrinter *pNewPrinter ) /* Interne Methode zum Setzen der Unterschiede von 'pNewPrinter' zum @@ -465,8 +438,8 @@ SfxPrinter* SfxViewShell::SetPrinter_Impl( SfxPrinter *pNewPrinter ) SfxPrinter *pDocPrinter = GetPrinter(); // Printer-Options auswerten - FASTBOOL bOriToDoc = FALSE; - FASTBOOL bSizeToDoc = FALSE; + bool bOriToDoc = false; + bool bSizeToDoc = false; if ( &pDocPrinter->GetOptions() ) { USHORT nWhich = GetPool().GetWhich(SID_PRINTER_CHANGESTODOC); @@ -824,6 +797,10 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) aReq.AppendItem( SfxStringItem( SID_PRINTER_NAME, pDlgPrinter->GetName() ) ); aReq.Done(); } + if ( nId == SID_SETUPPRINTER ) + { + rReq.AppendItem( SfxBoolItem( SID_DIALOG_RETURN, TRUE ) ); + } // take the changes made in the dialog pPrinter = SetPrinter_Impl( pDlgPrinter ); @@ -912,3 +889,4 @@ JobSetup SfxViewShell::GetJobSetup() const return JobSetup(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 9855ffcd93..d5866d2629 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -1,10 +1,11 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2000, 2010 Oracle and/or its affiliates. * - * OpenOffice.org - a multi-platform office productivity suite + * Copyright 2000, 2010 Oracle and/or its affiliates. * * This file is part of OpenOffice.org. * @@ -48,7 +49,7 @@ #include <cppuhelper/implbase1.hxx> #include <osl/file.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <tools/urlobj.hxx> #include <unotools/tempfile.hxx> #include <unotools/pathoptions.hxx> @@ -90,9 +91,7 @@ #include <sfx2/docfilt.hxx> // #110897# -#ifndef _UNOTOOLS_PROCESSFACTORY_HXX #include <comphelper/processfactory.hxx> -#endif using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -283,7 +282,7 @@ static ::rtl::OUString RetrieveLabelFromCommand( { for ( sal_Int32 i = 0; i < aPropSeq.getLength(); i++ ) { - if ( aPropSeq[i].Name.equalsAscii( "Label" )) + if ( aPropSeq[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Label" ) )) { aPropSeq[i].Value >>= aStr; break; @@ -350,11 +349,11 @@ static ::rtl::OUString impl_retrieveFilterNameFromTypeAndModule( { ::comphelper::SequenceAsHashMap aFilterPropsHM( xEnumeration->nextElement() ); ::rtl::OUString aFilterName = aFilterPropsHM.getUnpackedValueOrDefault( - ::rtl::OUString::createFromAscii( "Name" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name")), ::rtl::OUString() ); sal_Int32 nFilterFlags = aFilterPropsHM.getUnpackedValueOrDefault( - ::rtl::OUString::createFromAscii( "Flags" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Flags")), sal_Int32( 0 ) ); if ( nFilterFlags & nFlags ) @@ -380,7 +379,7 @@ enum ETypeFamily ::rtl::OUString impl_searchFormatTypeForApp(const css::uno::Reference< css::frame::XFrame >& xFrame , ETypeFamily eTypeFamily) { - static ::rtl::OUString SERVICENAME_MODULEMANAGER = ::rtl::OUString::createFromAscii("com.sun.star.frame.ModuleManager"); + static ::rtl::OUString SERVICENAME_MODULEMANAGER(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.ModuleManager")); try { @@ -394,32 +393,32 @@ enum ETypeFamily { case E_MS_DOC: { - if (sModule.equalsAscii( "com.sun.star.text.TextDocument" )) + if (sModule.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.text.TextDocument" ) )) sType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "writer_MS_Word_97" )); else - if (sModule.equalsAscii( "com.sun.star.sheet.SpreadsheetDocument" )) + if (sModule.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.sheet.SpreadsheetDocument" ) )) sType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "calc_MS_Excel_97" )); else - if (sModule.equalsAscii( "com.sun.star.drawing.DrawingDocument" )) + if (sModule.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.drawing.DrawingDocument" ) )) sType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "impress_MS_PowerPoint_97" )); else - if (sModule.equalsAscii( "com.sun.star.presentation.PresentationDocument" )) + if (sModule.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.presentation.PresentationDocument" ) )) sType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "impress_MS_PowerPoint_97" )); } break; case E_OOO_DOC: { - if (sModule.equalsAscii( "com.sun.star.text.TextDocument" )) + if (sModule.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.text.TextDocument" ) )) sType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "writer8" )); else - if (sModule.equalsAscii( "com.sun.star.sheet.SpreadsheetDocument" )) + if (sModule.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.sheet.SpreadsheetDocument" ) )) sType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "calc8" )); else - if (sModule.equalsAscii( "com.sun.star.drawing.DrawingDocument" )) + if (sModule.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.drawing.DrawingDocument" ) )) sType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "draw8" )); else - if (sModule.equalsAscii( "com.sun.star.presentation.PresentationDocument" )) + if (sModule.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.presentation.PresentationDocument" ) )) sType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "impress8" )); } break; @@ -437,6 +436,24 @@ enum ETypeFamily //-------------------------------------------------------------------- +SAL_DLLPRIVATE void SfxViewShell::IPClientGone_Impl( SfxInPlaceClient *pIPClient ) +{ + SfxInPlaceClientList* pClientList = GetIPClientList_Impl(TRUE); + + for( SfxInPlaceClientList::iterator it = pClientList->begin(); it < pClientList->end(); ++it ) + { + if ( *it == pIPClient ) + { + pClientList->erase( it ); + break; + } + } +} + + + +//-------------------------------------------------------------------- + void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) { const USHORT nId = rReq.GetSlot(); @@ -714,7 +731,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) } ::com::sun::star::uno::Reference< XSystemShellExecute > xSystemShellExecute( xSMGR->createInstance( - ::rtl::OUString::createFromAscii( "com.sun.star.system.SystemShellExecute" )), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.system.SystemShellExecute"))), css::uno::UNO_QUERY ); BOOL bRet( TRUE ); @@ -1758,7 +1775,7 @@ BOOL SfxViewShell::ExecKey_Impl(const KeyEvent& aKey) //-------------------------------------------------------------------- -FASTBOOL SfxViewShell::KeyInput( const KeyEvent &rKeyEvent ) +bool SfxViewShell::KeyInput( const KeyEvent &rKeyEvent ) /* [Beschreibung] @@ -1785,14 +1802,14 @@ FASTBOOL SfxViewShell::KeyInput( const KeyEvent &rKeyEvent ) return ExecKey_Impl(rKeyEvent); } -FASTBOOL SfxViewShell::GlobalKeyInput_Impl( const KeyEvent &rKeyEvent ) +bool SfxViewShell::GlobalKeyInput_Impl( const KeyEvent &rKeyEvent ) { return ExecKey_Impl(rKeyEvent); } //-------------------------------------------------------------------- -void SfxViewShell::ShowCursor( FASTBOOL /*bOn*/ ) +void SfxViewShell::ShowCursor( bool /*bOn*/ ) /* [Beschreibung] @@ -1832,9 +1849,9 @@ void SfxViewShell::ResetAllClients_Impl( SfxInPlaceClient *pIP ) if ( !pClients ) return; - for ( USHORT n=0; n < pClients->Count(); n++ ) + for ( size_t n = 0; n < pClients->size(); n++ ) { - SfxInPlaceClient* pIPClient = pClients->GetObject(n); + SfxInPlaceClient* pIPClient = pClients->at( n ); if( pIPClient != pIP ) pIPClient->ResetObject(); } @@ -1848,7 +1865,7 @@ void SfxViewShell::DisconnectAllClients() if ( !pClients ) return; - for ( USHORT n=0; n<pClients->Count(); ) + for ( size_t n = 0; n < pClients->size(); ) // clients will remove themselves from the list delete pClients->GetObject(n); } @@ -1875,9 +1892,9 @@ void SfxViewShell::VisAreaChanged(const Rectangle& /*rVisArea*/) if ( !pClients ) return; - for (USHORT n=0; n < pClients->Count(); n++) + for ( size_t n = 0; n < pClients->size(); n++) { - SfxInPlaceClient* pIPClient = pClients->GetObject(n); + SfxInPlaceClient* pIPClient = pClients->at( n ); if ( pIPClient->IsObjectInPlaceActive() ) // client is active, notify client that the VisArea might have changed pIPClient->VisAreaChanged(); @@ -1944,8 +1961,8 @@ void SfxViewShell::DiscardClients_Impl() if ( !pClients ) return; - for (USHORT n=0; n < pClients->Count(); ) - delete pClients->GetObject(n); + for ( size_t n = 0; n < pClients->size(); ) + delete pClients->at( n ); } //-------------------------------------------------------------------- @@ -2078,6 +2095,11 @@ SfxBaseController* SfxViewShell::GetBaseController_Impl() const return pImp->m_pController.get(); } +SfxBaseController* SfxViewShell::GetBaseController_Impl() const +{ + return pImp->pController; +} + void SfxViewShell::AddContextMenuInterceptor_Impl( const REFERENCE< XCONTEXTMENUINTERCEPTOR >& xInterceptor ) { pImp->aInterceptorContainer.addInterface( xInterceptor ); diff --git a/sfx2/util/sfx.xml b/sfx2/util/sfx.xml index a27b0970ce..681f500053 100644 --- a/sfx2/util/sfx.xml +++ b/sfx2/util/sfx.xml @@ -68,7 +68,6 @@ <project-build-dependency> cppu </project-build-dependency> <project-build-dependency> cppuhelper </project-build-dependency> - <project-build-dependency> vos </project-build-dependency> <project-build-dependency> sal </project-build-dependency> <project-build-dependency> tools </project-build-dependency> <project-build-dependency> svtools </project-build-dependency> @@ -82,7 +81,6 @@ <runtime-module-dependency> cppu2 </runtime-module-dependency> <runtime-module-dependency> cppuhelper </runtime-module-dependency> - <runtime-module-dependency> vos2$(COM) </runtime-module-dependency> <runtime-module-dependency> sal2 </runtime-module-dependency> <runtime-module-dependency> tl </runtime-module-dependency> <runtime-module-dependency> svt </runtime-module-dependency> diff --git a/sfx2/workben/custompanel/makefile.mk b/sfx2/workben/custompanel/makefile.mk new file mode 100644 index 0000000000..1eb20ceed3 --- /dev/null +++ b/sfx2/workben/custompanel/makefile.mk @@ -0,0 +1,120 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=../.. +PRJNAME=sfx2 + +TARGET=custompanel +ENABLE_EXCEPTIONS=TRUE +LIBTARGET=NO +EXTENSIONNAME:=custom-tool-panel + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk + +#------------------------------------------------------------------- + +#---- extension version +EXTENSION_VERSION_BASE=0.1 +.IF ( "$(CWS_WORK_STAMP)" == "" ) || ( "$(UPDATER)" == "YES" ) + EXTENSION_VERSION=$(EXTENSION_VERSION_BASE) +.ELSE + EXTENSION_VERSION=$(EXTENSION_VERSION_BASE).cws.$(CWS_WORK_STAMP) +.ENDIF + +#---- extension title package name +EXTENSION_TITLE=Custom Tool Panel Example +EXTENSION_ZIPNAME=$(EXTENSIONNAME)-$(EXTENSION_VERSION_BASE)-$(RTL_OS:l)-$(RTL_ARCH:l) + +#-------------------------------------------------- + +SHL1DLLPRE= +SHL1TARGET=$(TARGET).uno +LIB1TARGET=$(SLB)/$(SHL1TARGET).lib +LIB1OBJFILES= \ + $(SLO)/ctp_factory.obj \ + $(SLO)/ctp_services.obj \ + $(SLO)/ctp_panel.obj + +SHL1STDLIBS= \ + $(CPPULIB) \ + $(SALLIB) \ + $(SALHELPERLIB) \ + $(CPPUHELPERLIB) + +SHL1VERSIONMAP=$(SOLARSRC)/solenv/src/component.map +SHL1LIBS= $(LIB1TARGET) +SHL1DEF= $(MISC)/$(SHL1TARGET).def +SHL1RPATH= OXT +DEF1NAME= $(SHL1TARGET) + +# create Extension ----------------------------- + +COMPONENT_CONFIGDEST=. + +COMPONENT_XCU = \ + $(EXTENSIONDIR)/WriterWindowState.xcu \ + $(EXTENSIONDIR)/CalcWindowState.xcu \ + $(EXTENSIONDIR)/DrawWindowState.xcu \ + $(EXTENSIONDIR)/ImpressWindowState.xcu \ + $(EXTENSIONDIR)/Factories.xcu + +COMPONENT_LIBRARIES = \ + $(EXTENSIONDIR)/$(SHL1TARGET)$(DLLPOST) + +COMPONENT_IMAGES= \ + $(EXTENSIONDIR)/panel.png + +# ........ dependencies for packaging the extension ........ +EXTENSION_PACKDEPS=makefile.mk $(COMPONENT_IMAGES) + +# --- Targets ------------------------------------------------------ +.INCLUDE : extension_pre.mk +.INCLUDE : target.mk +.INCLUDE : extension_post.mk + +$(EXTENSIONDIR)/%.png : ./%.png + @@-$(MKDIRHIER) $(@:d) + @$(COPY) $< $@ > $(NULLDEV) + +$(EXTENSIONDIR)/WriterWindowState.xcu: ./WriterWindowState.xcu + @@-$(MKDIRHIER) $(@:d) + $(COMMAND_ECHO)$(TYPE) ./WriterWindowState.xcu | sed s/UPDATED_IDENTIFIER/$(IMPLEMENTATION_IDENTIFIER)/ > $(EXTENSIONDIR)/WriterWindowState.xcu + +$(EXTENSIONDIR)/CalcWindowState.xcu: ./CalcWindowState.xcu + @@-$(MKDIRHIER) $(@:d) + $(COMMAND_ECHO)$(TYPE) ./CalcWindowState.xcu | sed s/UPDATED_IDENTIFIER/$(IMPLEMENTATION_IDENTIFIER)/ > $(EXTENSIONDIR)/CalcWindowState.xcu + +$(EXTENSIONDIR)/DrawWindowState.xcu: ./DrawWindowState.xcu + @@-$(MKDIRHIER) $(@:d) + $(COMMAND_ECHO)$(TYPE) ./DrawWindowState.xcu | sed s/UPDATED_IDENTIFIER/$(IMPLEMENTATION_IDENTIFIER)/ > $(EXTENSIONDIR)/DrawWindowState.xcu + +$(EXTENSIONDIR)/ImpressWindowState.xcu: ./ImpressWindowState.xcu + @@-$(MKDIRHIER) $(@:d) + $(COMMAND_ECHO)$(TYPE) ./ImpressWindowState.xcu | sed s/UPDATED_IDENTIFIER/$(IMPLEMENTATION_IDENTIFIER)/ > $(EXTENSIONDIR)/ImpressWindowState.xcu + |