diff options
Diffstat (limited to 'sfx2')
472 files changed, 7408 insertions, 7556 deletions
diff --git a/sfx2/AllLangResTarget_sfx2.mk b/sfx2/AllLangResTarget_sfx2.mk index c49fd42cd96e..c49fd42cd96e 100644..100755 --- a/sfx2/AllLangResTarget_sfx2.mk +++ b/sfx2/AllLangResTarget_sfx2.mk diff --git a/sfx2/JunitTest_sfx2_unoapi.mk b/sfx2/JunitTest_sfx2_unoapi.mk index 33602a0b720d..33602a0b720d 100644..100755 --- a/sfx2/JunitTest_sfx2_unoapi.mk +++ b/sfx2/JunitTest_sfx2_unoapi.mk diff --git a/sfx2/Makefile b/sfx2/Makefile index a79aff831024..a79aff831024 100644..100755 --- a/sfx2/Makefile +++ b/sfx2/Makefile diff --git a/sfx2/Package_inc.mk b/sfx2/Package_inc.mk index 57317629323b..57317629323b 100644..100755 --- a/sfx2/Package_inc.mk +++ b/sfx2/Package_inc.mk diff --git a/sfx2/Package_sdi.mk b/sfx2/Package_sdi.mk index 43e484b19a2d..43e484b19a2d 100644..100755 --- a/sfx2/Package_sdi.mk +++ b/sfx2/Package_sdi.mk diff --git a/sfx2/README b/sfx2/README new file mode 100755 index 000000000000..3b160a25203b --- /dev/null +++ b/sfx2/README @@ -0,0 +1,3 @@ +This is the gui code, much of which is now deprecated. +List of documents open would be traceked, +raw C__ code; gutsy core of document management and loading. diff --git a/sfx2/inc/about.hxx b/sfx2/inc/about.hxx new file mode 100755 index 000000000000..2e5c4326f7b0 --- /dev/null +++ b/sfx2/inc/about.hxx @@ -0,0 +1,89 @@ +/* -*- 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 + * + * 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 _ABOUT_HXX +#define _ABOUT_HXX + +// include --------------------------------------------------------------- + +#include <tools/resary.hxx> +#include <vcl/button.hxx> +#include <vcl/accel.hxx> +#include <svtools/svmedit.hxx> +#include <svtools/stdctrl.hxx> +#include "svtools/fixedhyper.hxx" +#include <sfx2/basedlgs.hxx> // SfxModalDialog +#include <vector> + +typedef ::std::vector< Accelerator* > AccelList; + +// class AboutDialog ----------------------------------------------------- + +class AboutDialog : public SfxModalDialog +{ +private: + OKButton aOKButton; + Image aAppLogo; + + MultiLineEdit aVersionText; + MultiLineEdit aCopyrightText; + svt::FixedHyperlink aInfoLink; + + ResStringArray aDeveloperAry; + String aDevVersionStr; + String aAccelStr; + String aVersionData; + String aVersionTextStr; + String aCopyrightTextStr; + String aLinkStr; + + AccelList aAccelList; + + AutoTimer aTimer; + long nOff; + long m_nDeltaWidth; + int m_nPendingScrolls; + + BOOL bNormal; + +protected: + virtual BOOL Close(); + virtual void Paint( const Rectangle& ); + +public: + AboutDialog( Window* pParent, const ResId& rId, const String& rVerStr ); + ~AboutDialog(); + + 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 c6d2ed3c8e78..c7d181eb1110 100644..100755 --- 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. @@ -27,9 +28,9 @@ #ifndef _SFX_ARRDECL_HXX #define _SFX_ARRDECL_HXX -#include <tools/list.hxx> #include <svl/svarray.hxx> #include <sfx2/minarray.hxx> +#include <vector> struct CntUpdateResult; @@ -70,22 +71,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 3fbf4eecffbd..f61e95984fe8 100644..100755 --- 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/brokenpackageint.hxx b/sfx2/inc/brokenpackageint.hxx new file mode 100755 index 000000000000..daa47dcd9d51 --- /dev/null +++ b/sfx2/inc/brokenpackageint.hxx @@ -0,0 +1,103 @@ +/* -*- 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 + * + * 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 "sal/config.h" +#include "sfx2/dllapi.h" +#include <com/sun/star/document/BrokenPackageRequest.hpp> +#include <com/sun/star/task/XInteractionApprove.hpp> +#include <com/sun/star/task/XInteractionDisapprove.hpp> +#include <framework/interaction.hxx> + +using namespace ::framework; +typedef ContinuationBase< ::com::sun::star::task::XInteractionApprove > SfxContinuationApprove; +typedef ContinuationBase< ::com::sun::star::task::XInteractionDisapprove > SfxContinuationDisapprove; + +class SFX2_DLLPUBLIC RequestPackageReparation : + public ::com::sun::star::task::XInteractionRequest, + public ::cppu::OWeakObject +{ + ::com::sun::star::uno::Any m_aRequest; + + ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > + > m_lContinuations; + + SfxContinuationApprove* m_pApprove; + SfxContinuationDisapprove* m_pDisapprove; + +public: + RequestPackageReparation( ::rtl::OUString aName ); + + // XInterface / OWeakObject + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire( ) throw (); + virtual void SAL_CALL release( ) throw (); + + sal_Bool isApproved() { return m_pApprove->isSelected(); } + + virtual ::com::sun::star::uno::Any SAL_CALL getRequest() + throw( ::com::sun::star::uno::RuntimeException ); + + virtual ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > + > SAL_CALL getContinuations() + throw( ::com::sun::star::uno::RuntimeException ); +}; + +class SFX2_DLLPUBLIC NotifyBrokenPackage : + public ::com::sun::star::task::XInteractionRequest, + public ::cppu::OWeakObject +{ + ::com::sun::star::uno::Any m_aRequest; + + ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > + > m_lContinuations; + + ContinuationAbort* m_pAbort; + +public: + NotifyBrokenPackage( ::rtl::OUString aName ); + + // XInterface / OWeakObject + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire( ) throw (); + virtual void SAL_CALL release( ) throw (); + + sal_Bool isAborted() { return m_pAbort->isSelected(); } + + virtual ::com::sun::star::uno::Any SAL_CALL getRequest() + throw( ::com::sun::star::uno::RuntimeException ); + + virtual ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > + > SAL_CALL getContinuations() + throw( ::com::sun::star::uno::RuntimeException ); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/configmgr.hxx b/sfx2/inc/configmgr.hxx index 0cc4305349e8..5146fd662101 100644..100755 --- 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 9e252123348b..c800d445f6af 100644..100755 --- 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(sal_uInt16 nLevel) const; const Image &GetOpenedBmp(sal_uInt16 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/filedlghelper.hrc b/sfx2/inc/filedlghelper.hrc index a5db7b4fdb30..a5db7b4fdb30 100644..100755 --- a/sfx2/inc/filedlghelper.hrc +++ b/sfx2/inc/filedlghelper.hrc diff --git a/sfx2/inc/frmload.hxx b/sfx2/inc/frmload.hxx index 437f3bf07439..a35ce9d5a263 100644..100755 --- 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 7dd54559dc0b..1b23e4c2bae6 100644..100755 --- 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 b10ed6c90819..28f8379c6f1f 100644..100755 --- 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 b8e605b6ef13..d5fc4adb0ed7 100644..100755 --- 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 sal_Bool IdPool::IsLocked( sal_uInt16 nId ) const #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/inettbc.hxx b/sfx2/inc/inettbc.hxx index 97b5275711f1..f0a73404320c 100644..100755 --- 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 b6a0a2a655d5..13c451836313 100644..100755 --- 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 c6d714657ed6..53c15fc02d24 100644..100755 --- 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. @@ -28,11 +29,10 @@ #ifndef _MSGNODEI_HXX #define _MSGNODEI_HXX - #include <svl/eitem.hxx> #include <tools/string.hxx> #include <svl/poolitem.hxx> -#include <tools/list.hxx> + struct SfxMsgAttachFile { String aFile; String aName; @@ -217,3 +217,5 @@ public: #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/orgmgr.hxx b/sfx2/inc/orgmgr.hxx index 99a87f75f860..da26a55f0921 100644..100755 --- 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 c87b9d94ed2b..7f5f9dd3a307 100644..100755 --- 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 45755cdd8799..5c4a41e7d6f2 100644..100755 --- 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" @@ -597,7 +599,6 @@ #include "tools/globname.hxx" #include "tools/inetmime.hxx" #include "tools/link.hxx" -#include "tools/list.hxx" #include "tools/ownlist.hxx" #include "tools/rc.hxx" #include "tools/rcid.h" @@ -655,14 +656,11 @@ #include "vcl/timer.hxx" #include "vcl/unohelp.hxx" #include "tools/wintypes.hxx" -#include "vos/diagnose.hxx" -#include "vos/module.hxx" -#include "vos/mutex.hxx" -#include "vos/process.hxx" -#include "vos/security.hxx" -#include "vos/socket.hxx" -#include "vos/thread.hxx" -#include "vos/xception.hxx" +#include "osl/diagnose.h" +#include "osl/module.hxx" +#include "osl/mutex.hxx" +#include "osl/process.h" //---MARKER--- #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/progind.hxx b/sfx2/inc/progind.hxx index a3857b14c4ed..e06665e41779 100644..100755 --- 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 7fdb1eab2d7c..3e0fc3cfc1c5 100644..100755 --- 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 def1e4ab5a0e..d22f37304445 100644..100755 --- 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 273eb1afef87..143f0ec52efb 100644..100755 --- 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 e25d1a23082c..753f6a4b2607 100644..100755 --- 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 7871fbe66ac5..00c5ae88063a 100644..100755 --- 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 f8032b448291..226aa2d5b051 100644..100755 --- 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. @@ -45,6 +46,7 @@ #include <vcl/svapp.hxx> #include <sfx2/shell.hxx> +#include <vector> class Timer; class ApplicationEvent; @@ -68,7 +70,6 @@ class SfxEventHint; class SfxItemSet; class SfxMacroConfig; class SfxMedium; -class SfxMediumList; class SfxMenuCtrlFactArr_Impl; class SfxNewFileDialog; class SfxObjectShell; @@ -102,6 +103,8 @@ class ModalDialog; class SbxArray; class SbxValue; +typedef ::std::vector< SfxMedium* > SfxMediumList; + namespace sfx2 { class SvLinkSource; @@ -236,9 +239,6 @@ public: StarBASIC* GetBasic(); sal_uInt16 SaveBasicManager() const; sal_uInt16 SaveBasicAndDialogContainer() const; - void RegisterBasicConstants( const char *pPrefix, - const SfxConstant *pConsts, - sal_uInt16 nCount ); // misc. sal_Bool GetOptions(SfxItemSet &); @@ -254,7 +254,6 @@ public: const String* pPostStr = 0); void ResetLastDir(); -//#if 0 // _SOLAR__PRIVATE SAL_DLLPRIVATE static SfxApplication* Get() { return pApp;} SAL_DLLPRIVATE SfxDispatcher* GetAppDispatcher_Impl(); SAL_DLLPRIVATE SfxDispatcher* GetDispatcher_Impl(); @@ -309,8 +308,9 @@ public: SAL_DLLPRIVATE SfxSlotPool& GetAppSlotPool_Impl() const; SAL_DLLPRIVATE SfxModule* GetModule_Impl(); SAL_DLLPRIVATE ResMgr* GetOffResManager_Impl(); -//#endif + /* loads a branded bitmap - that can be overridden per locale */ + static bool LoadBrandBitmap (const char* pName, BitmapEx &rBitmap); /** loads the application logo as used in the about dialog and impress slideshow pause screen */ static Image GetApplicationLogo(); }; @@ -327,3 +327,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 8136caac2ad9..9c5727e62f1a 100644..100755 --- 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 979cfe5693a9..3327c2afeb49 100644..100755 --- 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 0227ad6515ec..37096a6637ab 100644..100755 --- 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 32a5fb1dd223..c6a9e8870b3d 100644..100755 --- 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, sal_Bool bGlobalOnly=sal_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( int 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( sal_uInt16 nId ); SAL_DLLPRIVATE void InvalidateSlotsInMap_Impl(); SAL_DLLPRIVATE void AddSlotToInvalidateSlotsMap_Impl( sal_uInt16 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 26b13ee34bd7..0b2967bdbd70 100644..100755 --- 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 sal_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 5570506b2c89..3760c1d30be9 100644..100755 --- 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. @@ -33,7 +34,7 @@ #include <vcl/window.hxx> #include <com/sun/star/frame/XFrame.hpp> -#ifdef ENABLE_INIMANAGER//MUSTINI +#ifdef ENABLE_INIMANAGER #include "inimgr.hxx" #endif #include <sfx2/shell.hxx> @@ -47,11 +48,6 @@ class SfxChildWindow; class SfxChildWindowContext; class SfxChildWinContextArr_Impl; -//ASDBG #ifndef _XFRAME_REF -//ASDBG #define _XFRAME_REF -//ASDBG USR_DECLIMPL_REF( ::com::sun::star::frame::XFrame, ::com::sun::star::uno::XInterface ); -//ASDBG #endif - #define SFX_CHILDWIN_ZOOMIN 0x01 // ganz eingeklapptes Float #define SFX_CHILDWIN_SMALL 0x02 // halb eingeklapptes Float #define SFX_CHILDWIN_FORCEDOCK 0x04 // Float verboten @@ -77,13 +73,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 +120,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; @@ -202,10 +191,8 @@ public: void SetPosSizePixel(const Point& rPoint, Size& rSize); Point GetPosPixel() { return pWindow->GetPosPixel(); } -//<!--Modified by PengYunQuan for Validity Cell Range Picker virtual void Hide(); virtual void Show( sal_uInt16 nFlags ); -//-->Modified by PengYunQuan for Validity Cell Range Picker sal_uInt16 GetFlags() const { return GetInfo().nFlags; } sal_Bool CanGetFocus() const; @@ -240,7 +227,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 +238,6 @@ public: GetContext_Impl() const { return pContext; } SAL_DLLPRIVATE void SetFactory_Impl( SfxChildWinFactory* ); -//#endif }; //------------------------------------------------------------------ @@ -270,7 +255,7 @@ public: //! demn"achst hinf"allig ! #define SFX_IMPL_CHILDWINDOW_CONTEXT(Class, MyID, ShellClass) \ - SfxChildWindowContext* __EXPORT Class::CreateImpl( ::Window *pParent, \ + SfxChildWindowContext* Class::CreateImpl( ::Window *pParent, \ SfxBindings *pBindings, SfxChildWinInfo* pInfo ) \ { \ SfxChildWindowContext *pContext = new Class(pParent, \ @@ -290,7 +275,7 @@ public: // CreateImpl mu\s noch als Parameter die Factory mitbekommen wg. ContextId // Solange wird diese Id auf 0 gesetzt und in SfxChildWindow::CreateContext gepatched #define SFX_IMPL_CHILDWINDOWCONTEXT(Class, MyID) \ - SfxChildWindowContext* __EXPORT Class::CreateImpl( ::Window *pParent, \ + SfxChildWindowContext* Class::CreateImpl( ::Window *pParent, \ SfxBindings *pBindings, SfxChildWinInfo* pInfo ) \ { \ SfxChildWindowContext *pContext = new Class(pParent,0,pBindings,pInfo);\ @@ -315,13 +300,13 @@ public: SFX_IMPL_POS_CHILDWINDOW(Class, MyID, CHILDWIN_NOPOS) #define SFX_IMPL_POS_CHILDWINDOW(Class, MyID, Pos) \ - SfxChildWindow* __EXPORT Class::CreateImpl( ::Window *pParent, \ + SfxChildWindow* Class::CreateImpl( ::Window *pParent, \ sal_uInt16 nId, SfxBindings *pBindings, SfxChildWinInfo* pInfo ) \ { \ 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 +319,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 +327,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 +335,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 +343,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 +352,5 @@ public: //------------------------------------------------------------------ #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/cntids.hrc b/sfx2/inc/sfx2/cntids.hrc index ef652981f76d..ef652981f76d 100644..100755 --- a/sfx2/inc/sfx2/cntids.hrc +++ b/sfx2/inc/sfx2/cntids.hrc diff --git a/sfx2/inc/sfx2/controlwrapper.hxx b/sfx2/inc/sfx2/controlwrapper.hxx index ed962342b6e3..5959e5eed2ea 100644..100755 --- 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 4ceb2d940f52..f5ee81b977a1 100644..100755 --- 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 sal_Bool IsBindable_Impl() const { return pBindings != NULL; } SAL_DLLPRIVATE void BindInternal_Impl( sal_uInt16 nNewId, SfxBindings* ); -//#endif }; //==================================================================== @@ -109,3 +108,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/dialogs.hrc b/sfx2/inc/sfx2/dialogs.hrc index 97e9dd725c9a..97e9dd725c9a 100644..100755 --- a/sfx2/inc/sfx2/dialogs.hrc +++ b/sfx2/inc/sfx2/dialogs.hrc diff --git a/sfx2/inc/sfx2/dinfdlg.hxx b/sfx2/inc/sfx2/dinfdlg.hxx index 61e972c99278..b6cc70f41156 100644..100755 --- 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, sal_uInt8 nMemberId = 0 ) const; - virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); + virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; + virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 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 64ad32cb1337..1560ae450da8 100644..100755 --- 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 945d04b71f99..2e9c39e8b027 100644..100755 --- 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. @@ -231,7 +232,6 @@ public: void SetDisableFlags( sal_uInt32 nFlags ); sal_uInt32 GetDisableFlags() const; -//#if 0 // _SOLAR__PRIVATE SAL_DLLPRIVATE sal_Bool HasSlot_Impl( sal_uInt16 ); SAL_DLLPRIVATE void SetMenu_Impl(); SAL_DLLPRIVATE void Update_Impl( sal_Bool bForce = sal_False ); // ObjectBars etc. @@ -255,7 +255,6 @@ public: SAL_DLLPRIVATE void DoDeactivate_Impl( sal_Bool bMDI, SfxViewFrame* pNew ); SAL_DLLPRIVATE void InvalidateBindings_Impl(sal_Bool); SAL_DLLPRIVATE sal_uInt16 GetNextToolBox_Impl( sal_uInt16 nPos, sal_uInt16 nType, String *pStr ); -//#endif }; //-------------------------------------------------------------------- @@ -361,3 +360,4 @@ inline sal_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 78066a4b2d7c..82018b6480e5 100644..100755 --- 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 bc2d9bfc7be2..9be57c9bb528 100644..100755 --- 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,11 +109,9 @@ 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; -//#endif private: // Kopieren verboten @@ -139,3 +138,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 87e62aef5b63..e987d3df19a0 100644..100755 --- 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. @@ -44,13 +45,14 @@ #include <com/sun/star/beans/PropertyValue.hpp> #include <tools/stream.hxx> #include <tools/string.hxx> -#include <tools/list.hxx> #include <svl/lstner.hxx> #include <tools/globname.hxx> #include <cppuhelper/weak.hxx> #include <ucbhelper/content.hxx> +#include <vector> + class SvKeyValueIterator; class SfxObjectFactory; class SfxFilter; @@ -92,7 +94,6 @@ class SFX2_DLLPUBLIC SfxMedium : public SvRefBase SvGlobalName aFilterClass; SvStream* pInStream; SvStream* pOutStream; -//REMOVE SvStorageRef aStorage; const SfxFilter* pFilter; SfxItemSet* pSet; SfxMedium_Impl* pImp; @@ -160,11 +161,7 @@ public: void ReOpen(); void CompleteReOpen(); const String& GetName() const {return aLogicName;} -#if defined SINIX && defined GCC && defined C272 - const INetURLObject& GetURLObject(); -#else const INetURLObject& GetURLObject() const; -#endif void CheckFileDate( const ::com::sun::star::util::DateTime& aInitDate ); sal_Bool DocNeedsFileDateCheck(); @@ -183,7 +180,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()); } @@ -277,7 +273,6 @@ public: SAL_DLLPRIVATE void SetUpdatePickList(sal_Bool); SAL_DLLPRIVATE sal_Bool IsUpdatePickList() const; -//REMOVE void SetStorage_Impl( SvStorage* pStor ); SAL_DLLPRIVATE void SetLongName(const String &rName) { aLongName = rName; } SAL_DLLPRIVATE const String & GetLongName() const { return aLongName; } @@ -329,10 +324,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 7a6af9040066..a951239d4a25 100644..100755 --- 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. @@ -38,6 +39,7 @@ #include <tools/wldcrd.hxx> #include <comphelper/documentconstants.hxx> +#define SFX_FILTER_STARTPRESENTATION 0x20000000L #include <sfx2/sfxdefs.hxx> @@ -119,3 +121,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 9f7da1932110..22b13be1d56d 100644..100755 --- 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 c4e4be12185e..40969a76dbe1 100644..100755 --- 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 c9138988fa45..021b9fdefe44 100644..100755 --- 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 sal_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( sal_Bool bShow = sal_True ); DECL_LINK( TimerHdl, Timer* ); -//#if 0 // _SOLAR__PRIVATE SAL_DLLPRIVATE void Initialize_Impl(); SAL_DLLPRIVATE sal_uInt16 GetWinBits_Impl() const; SAL_DLLPRIVATE void SetItemSize_Impl( const Size& rSize ); @@ -125,7 +123,6 @@ public: SAL_DLLPRIVATE void Pin_Impl( sal_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 463e5dbe4aa2..48b58b4ecd9b 100644..100755 --- 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 977916ed532c..b6ac0da8becb 100644..100755 --- 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 9c991912448a..8d8e7dfdd546 100644..100755 --- 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 bc0728b0ec1b..ee3db35cebf4 100644..100755 --- 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 d24a38be0deb..6e28386b4f19 100644..100755 --- 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 791b63da930a..89fef8d61687 100644..100755 --- 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. @@ -44,6 +45,7 @@ #endif #define ITEMID_MACRO SID_ATTR_MACROITEM #include <svl/macitem.hxx> +#include <vector> class SfxObjectShell; class SvxMacroTableDtor; @@ -64,16 +66,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 sal_uInt16 nInitSz = 0, const sal_uInt16 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 @@ -117,3 +129,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 90c43c1ff774..21c6c27609d8 100644..100755 --- 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( sal_Bool bUpdate=sal_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, sal_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 sal_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 sal_uInt16 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 619358f077ac..f31f6d24e5d1 100644..100755 --- 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 622be188072a..54b3d0330308 100644..100755 --- 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. @@ -66,9 +67,9 @@ namespace com #include <tools/ref.hxx> #include <tools/string.hxx> #include <svl/brdcst.hxx> -#include <tools/list.hxx> #include <svl/poolitem.hxx> #include <comphelper/namedvaluecollection.hxx> +#include <vector> class SvBorder; class SfxWorkWindow; @@ -93,7 +94,7 @@ class SystemWindow; typedef SfxFrame* SfxFramePtr; class SfxFrameArr_Impl; -DECLARE_LIST( TargetList, String* ) +typedef ::std::vector< String* > TargetList; #define SFXFRAME_HASTITLE 0x0001 @@ -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 ); @@ -225,7 +225,6 @@ public: SAL_DLLPRIVATE SystemWindow* GetTopWindow_Impl() const; SAL_DLLPRIVATE void PositionWindow_Impl( const Rectangle& rWinArea ) const; SAL_DLLPRIVATE bool IsMarkedHidden_Impl() const; -//#endif private: SAL_DLLPRIVATE void Construct_Impl(); }; @@ -237,9 +236,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 +264,8 @@ public: virtual String GetValueText() const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; - virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); + virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; + virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); sal_Bool FrameKilled() const { return &wFrame != pFrame; } @@ -286,8 +283,8 @@ public: { return aValue; } virtual int operator==( const SfxPoolItem& ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; - virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); + virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; + virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); }; class SFX2_DLLPUBLIC SfxUnoFrameItem : public SfxPoolItem @@ -304,10 +301,12 @@ 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, sal_uInt8 nMemberId = 0 ) const; - virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); + virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; + virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 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 cc6ae5f4cb7e..51305f9a2766 100644..100755 --- 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 9c3ff64e688a..ac3f2303df7b 100644..100755 --- 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 e6b681c57f93..9521d6982fb6 100644..100755 --- 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 35a7534e6294..81479a0af846 100644..100755 --- 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 375a22f5b2ec..0a3fbe1672c6 100644..100755 --- 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 51f341c5c3c0..b6f5982b455f 100644..100755 --- 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 fb5337f63b5a..0bbde7a0b47b 100644..100755 --- 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. @@ -33,4 +34,10 @@ #include <rtl/ustring.hxx> #include <vcl/image.hxx> -SFX2_DLLPUBLIC Image SAL_CALL GetImage( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& aURL, sal_Bool bBig, sal_Bool bHiContrast ); +SFX2_DLLPUBLIC Image SAL_CALL GetImage( + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, + const ::rtl::OUString& aURL, + bool bBig +); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/imgdef.hxx b/sfx2/inc/sfx2/imgdef.hxx index 1aa34a393b33..a729eb6cda84 100644..100755 --- 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 555cd37939b3..de3c9b55ecfc 100644..100755 --- 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, sal_Bool bHiContrast, sal_Bool bLarge ); - void SetImagesForceSize( ToolBox& rToolBox, sal_Bool bHiContrast, sal_Bool bLarge ); + void SetImages( ToolBox& rToolBox, bool bLarge ); + void SetImagesForceSize( ToolBox& rToolBox, bool bLarge ); - Image GetImage( sal_uInt16 nId, sal_Bool bLarge, sal_Bool bHiContrast ) const; - Image GetImage( sal_uInt16 nId, sal_Bool bHiContrast ) const; - Image SeekImage( sal_uInt16 nId, sal_Bool bLarge, sal_Bool bHiContrast ) const; - Image SeekImage( sal_uInt16 nId, sal_Bool bHiContrast ) const; + Image GetImage( sal_uInt16 nId, bool bLarge ) const; + Image GetImage( sal_uInt16 nId) const; + Image SeekImage( sal_uInt16 nId, bool bLarge ) const; + Image SeekImage( sal_uInt16 nId ) const; }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/ipclient.hxx b/sfx2/inc/sfx2/ipclient.hxx index d302bc53442e..bdcddc500ddb 100644..100755 --- 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 3d93bded533f..1ca48d8d8635 100644..100755 --- 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 939182eae12d..55d7c9b2a4d3 100644..100755 --- 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 91ae78410500..e7eddef08f39 100644..100755 --- 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 fdd4d418ebf9..db467fd06da7 100644..100755 --- 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 a5099a3a6b75..2629b2c7c106 100644..100755 --- 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 d92ed2ac4ac1..95bd42d39c88 100644..100755 --- 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 5a1dd1b15bd7..dbd792413784 100644..100755 --- 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. @@ -33,10 +34,18 @@ #include <tools/string.hxx> #include <svl/svarray.hxx> +#include <vector> + class SfxObjectShell; class Graphic; class Size; +namespace com { namespace sun { namespace star { + namespace lang { + class XComponent; + } +}}} + namespace sfx2 { // Damit der Link ueber den Status der zu ladenen Grafik informierten werden @@ -55,6 +64,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; @@ -74,6 +87,16 @@ public: LinkManager( SfxObjectShell * pCacheCont ); ~LinkManager(); + /** + * Insert a component loaded during link update, which needs to be closed + * when the update is complete. + * + * @param xComp component loaded during link update. + */ + void InsertCachedComp(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xComp); + + void CloseCachedComps(); + SfxObjectShell* GetPersist() const { return pPersist; } void SetPersist( SfxObjectShell * p ) { pPersist = p; } @@ -100,6 +123,17 @@ public: // falls am Link schon alles eingestellt ist ! sal_Bool InsertFileLink( sfx2::SvBaseLink& ); + void ReconnectDdeLink(SfxObjectShell& rServer); + + /** + * Reconnect the server document shell to a DDE link object. + * + * @param rPath path to the server document + * @param rServer server document shell instance + * @param rLink link object of the client document + */ + void LinkServerShell(const ::rtl::OUString& rPath, SfxObjectShell& rServer, ::sfx2::SvBaseLink& rLink) const; + // erfrage die Strings fuer den Dialog sal_Bool GetDisplayNames( const SvBaseLink *, String* pType, @@ -166,3 +200,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 16e9af685c8e..11a9a2281f08 100644..100755 --- 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; sal_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 ffd3020fa9d0..2c0e4c625c11 100644..100755 --- 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 sal_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 new file mode 100755 index 000000000000..60692b4c49a6 --- /dev/null +++ b/sfx2/inc/sfx2/macrconf.hxx @@ -0,0 +1,141 @@ +/* -*- 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 + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _SFX_MACROCONF_HXX +#define _SFX_MACROCONF_HXX + +#include "sal/config.h" +#include "sfx2/dllapi.h" +#include "sal/types.h" +#include <tools/errcode.hxx> +#define _SVSTDARR_USHORTS +#include <svl/svstdarr.hxx> // SvUShorts +#include <sfx2/evntconf.hxx> + +class SfxMacroInfo; +class SfxSlot; +class SfxMacroInfoItem; +class SfxObjectShell; +class BasicManager; +struct SfxMacroConfig_Impl; +class SbMethod; +class SbxValue; +class SbxObject; +class SbxArray; +class SvStream; +class SvxMacro; + +typedef SfxMacroInfo* SfxMacroInfoPtr; +SV_DECL_PTRARR(SfxMacroInfoArr_Impl, SfxMacroInfoPtr, 5, 5) + +class SFX2_DLLPUBLIC SfxMacroInfo +{ +friend class SfxMacroConfig; +friend class SfxEventConfiguration; + + String* pHelpText; + sal_uInt16 nRefCnt; + sal_Bool bAppBasic; + String aLibName; + String aModuleName; + String aMethodName; + sal_uInt16 nSlotId; + SfxSlot* pSlot; + +public: + SfxMacroInfo( const String& rURL ); + SfxMacroInfo( bool _bAppBasic = true ); + SfxMacroInfo( bool _bAppBasic, const String& rQualifiedName ); + SfxMacroInfo(SfxMacroInfo& rOther); + SfxMacroInfo(bool _bAppBasic, const String& rLibName, + const String& rModuleName, const String& rMethodName); + ~SfxMacroInfo(); + sal_Bool operator==(const SfxMacroInfo& rOther) const; + String GetMacroName() const; + String GetQualifiedName() const; + String GetFullQualifiedName() const; + BasicManager* GetBasicManager() const; + String GetBasicName() const; + String GetHelpText() const; + sal_Bool IsAppMacro() const + { return bAppBasic; } + const String& GetModuleName() const + { return aModuleName; } + const String& GetLibName() const + { return aLibName; } + const String& GetMethodName() const + { return aMethodName; } + sal_uInt16 GetSlotId() const + { return nSlotId; } + SfxSlot* GetSlot() const + { return pSlot; } + + sal_Bool Compare( const SvxMacro& ) const; + void SetHelpText( const String& rText ); + String GetURL() const; +}; + +class SFX2_DLLPUBLIC SfxMacroConfig +{ +friend class SfxEventConfiguration; + + SAL_DLLPRIVATE static SfxMacroConfig* pMacroConfig; + + SfxMacroConfig_Impl* pImp; + SvUShorts aIdArray; + +public: + SfxMacroConfig(); + ~SfxMacroConfig(); + + static SfxMacroConfig* GetOrCreate(); + + static String RequestHelp( sal_uInt16 nId ); + static sal_Bool IsMacroSlot( sal_uInt16 nId ); + static sal_Bool IsBasic( SbxObject*, const String&, BasicManager* ); + static ErrCode Call( SbxObject*, const String&, BasicManager*, + SbxArray *pArgs=NULL, SbxValue *pRet=NULL ); + static SbMethod* GetMethod_Impl( const String&, BasicManager* ); + + sal_uInt16 GetSlotId(SfxMacroInfoPtr); + void ReleaseSlotId(sal_uInt16 nId); + void RegisterSlotId(sal_uInt16 nId); + SfxMacroInfo* GetMacroInfo(sal_uInt16 nId) const; + sal_Bool ExecuteMacro(sal_uInt16 nId, const String& rArgs ) const; + sal_Bool ExecuteMacro( SfxObjectShell*, const SvxMacro*, const String& ) const; + sal_Bool CheckMacro(sal_uInt16 nId) const; + sal_Bool CheckMacro( SfxObjectShell*, const SvxMacro* ) const; + + 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/macropg.hxx b/sfx2/inc/sfx2/macropg.hxx index fda2e3feaf96..fda2e3feaf96 100644..100755 --- a/sfx2/inc/sfx2/macropg.hxx +++ b/sfx2/inc/sfx2/macropg.hxx diff --git a/sfx2/inc/sfx2/mailmodelapi.hxx b/sfx2/inc/sfx2/mailmodelapi.hxx index d94583f44eb2..3411a7647451 100644..100755 --- 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. @@ -34,9 +35,11 @@ #include <tools/string.hxx> #include "sfx2/dllapi.h" -// class SfxMailModel_Impl ----------------------------------------------- +// class AddressList_Impl ------------------------------------------------ +typedef String* AddressItemPtr_Impl; +typedef ::std::vector< AddressItemPtr_Impl > AddressList_Impl; -class AddressList_Impl; +// class SfxMailModel_Impl ----------------------------------------------- class SFX2_DLLPUBLIC SfxMailModel { @@ -139,3 +142,5 @@ public: sal_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 a599163116e5..ee0f313d0470 100644..100755 --- 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 7a00cabd307e..72f2e4e0487b 100644..100755 --- 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 6ccd7e0081c4..22b2695ab16a 100644..100755 --- 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 bdeeaaaba6c8..3d2cd29aaa44 100644..100755 --- 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 6b92205a7694..4c98ec5ef0f2 100644..100755 --- 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. @@ -27,7 +28,6 @@ #ifndef _SFXMINSTACK_HXX #define _SFXMINSTACK_HXX -//ASDBG #ifndef _SFXMINARRAY_HXX #include <sfx2/minarray.hxx> #define DECL_OBJSTACK( ARR, T, nI, nG ) \ @@ -97,3 +97,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 669f579a254c..a4b990c63b1f 100644..100755 --- 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; sal_Bool b_ShowStrings; @@ -65,15 +62,10 @@ public: using SfxControllerItem::Bind; void Bind( SfxVirtualMenu* pOwnMenu, sal_uInt16 nId, - const String& rTitle, const String &rHelpText, - SfxBindings & ); + const String& rTitle, SfxBindings& rBindings ); void Bind( SfxVirtualMenu* pOwnMenu, sal_uInt16 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,15 +73,12 @@ public: void SetOwnMenu( SfxVirtualMenu* pMenu ); void RemovePopup(); - const String& GetHelpText() const { return aHelpText; } - void SetHelpText(const String &rStr) { aHelpText = rStr; } - virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ); static SfxMenuControl* CreateControl( sal_uInt16 nId, Menu &, SfxBindings & ); static SfxUnoMenuControl* CreateControl( const String&, sal_uInt16, Menu&, SfxBindings&, SfxVirtualMenu* ); - static SfxUnoMenuControl* CreateControl( const String&, sal_uInt16, Menu&, const String& sItemText, const String& sHelpText, SfxBindings&, SfxVirtualMenu* ); + static SfxUnoMenuControl* CreateControl( const String&, sal_uInt16, Menu&, const String& sItemText, SfxBindings&, SfxVirtualMenu* ); static sal_Bool IsSpecialControl( sal_uInt16 nId, SfxModule* ); static void RegisterMenuControl(SfxModule*, SfxMenuCtrlFactory*); @@ -102,14 +91,12 @@ public: SfxUnoMenuControl( const String&, sal_uInt16 nId, Menu&, SfxBindings&, SfxVirtualMenu* ); SfxUnoMenuControl( const String&, sal_uInt16 nId, Menu&, - const String&, const String&, + const String&, SfxBindings&, SfxVirtualMenu* ); ~SfxUnoMenuControl(); void Select(); }; -//-------------------------------------------------------------------- - typedef SfxMenuControl* (*SfxMenuControlCtor)( sal_uInt16 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( sal_uInt16 nId, Menu &rMenu, SfxBindings &rBindings ); \ static void RegisterControl(sal_uInt16 nSlotId = 0, SfxModule *pMod=NULL) #define SFX_IMPL_MENU_CONTROL(Class, nItemClass) \ - SfxMenuControl* __EXPORT Class::CreateImpl( sal_uInt16 nId, Menu &rMenu, SfxBindings &rBindings ) \ + SfxMenuControl* Class::CreateImpl( sal_uInt16 nId, Menu &rMenu, SfxBindings &rBindings ) \ { return new Class(nId, rMenu, rBindings); } \ void Class::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod) \ { SfxMenuControl::RegisterMenuControl( pMod, new SfxMenuCtrlFactory( \ Class::CreateImpl, TYPE(nItemClass), nSlotId ) ); } -//#if 0 // _SOLAR__PRIVATE class SfxAppMenuControl_Impl : public SfxMenuControl { PopupMenu* pMenu; sal_uIntPtr m_nSymbolsStyle; - sal_Bool m_bWasHiContrastMode; sal_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 d54dafd6e0b2..7fd7618ea3ea 100644..100755 --- 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,9 +30,7 @@ #include <stdarg.h> -#ifndef _MENU_HXX //autogen //wg. MENU_APPEND !!!! #include <vcl/menu.hxx> -#endif #include <tools/wintypes.hxx> #include <tools/link.hxx> #include <com/sun/star/embed/VerbDescriptor.hpp> @@ -89,9 +88,7 @@ public: ResMgr* GetResMgr() const { return pResMgr; } void SetPopupMenu( sal_uInt16 nId, PopupMenu *pMenu ); -//#if 0 // _SOLAR__PRIVATE void Construct_Impl( Menu* pMenu, sal_Bool bWithHelp ); -//#endif }; //-------------------------------------------------------------------- @@ -119,7 +116,6 @@ public: // @deprecated!! // Don't use this method any longer. The whole class will be removed in the future. // Changing code which relies on Popup would need much more effort. - // Please contact cd@openoffice.org if you have questions or need help static SfxPopupMenuManager* Popup( const ResId& rResId, SfxViewFrame* pFrame,const Point& rPoint, Window* pWindow ); sal_uInt16 Execute( const Point& rPos, Window *pWindow ); @@ -129,7 +125,6 @@ public: // @deprecated (start)!! // Don't use these methods any longer. The whole class will be removed in the future. // Changing code which relies on these methods would need much more effort! - // Please contact cd@openoffice.org if you have questions or need help void StartInsert(); void EndInsert(); void CheckItem( sal_uInt16, sal_Bool ); @@ -146,3 +141,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 f944b29c18da..d737b6cf295d 100644..100755 --- 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( sal_Bool bBig ); - SAL_DLLPRIVATE ImageList* GetImageList_Impl( sal_Bool bBig, sal_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 a69fd108ccea..f13fcabcecfe 100644..100755 --- 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 { sal_uInt16 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 sal_uInt16 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: sal_uInt16 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 sal_uInt16 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 2bda4f36a59d..05854edbb010 100644..100755 --- 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 2958f92ca0d3..2412fca06a09 100644..100755 --- 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 e6bfe590431e..d97ee529b3c3 100644..100755 --- 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 ce596bacaa81..22f47eec8974 100644..100755 --- 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 4294a93a454c..d867bd065f2b 100644..100755 --- 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[]( sal_uInt16 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( sal_uInt16, const ResId&, sal_uInt32 nFeature, const String* pST=0 ); sal_uInt16 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 f7024ccc76f9..cc14c6881791 100644..100755 --- 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 05ae3365d6b1..a3ad4fbf917c 100644..100755 --- 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. @@ -42,19 +43,14 @@ #include <com/sun/star/security/DocumentSignatureInformation.hpp> #include <com/sun/star/security/XDocumentDigitalSignatures.hpp> #include <com/sun/star/task/XInteractionHandler.hpp> - #include <com/sun/star/beans/XPropertySet.hpp> - #include <boost/shared_ptr.hpp> - //________________________________________________________________________________________________________________ // include something else //________________________________________________________________________________________________________________ -//#if 0 // _SOLAR__PRIVATE #include <vcl/timer.hxx> -//#endif #include <svl/poolitem.hxx> #include <vcl/timer.hxx> #include <vcl/bitmap.hxx> @@ -126,6 +122,9 @@ namespace com { namespace sun { namespace star { namespace document { class XDocumentProperties; } + namespace lang { + class XComponent; + } } } } typedef sal_uInt32 SfxObjectShellFlags; @@ -209,16 +208,11 @@ private: bIsTmp :1; // temp. Storage private: -//#if 0 // _SOLAR__PRIVATE SAL_DLLPRIVATE void UpdateTime_Impl(const ::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentProperties> & i_xDocProps); 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 @@ -274,7 +268,6 @@ public: void FlushDocInfo(); sal_Bool HasName() const { return bHasName; } virtual String GetAPIName() const; - void SetHasName( sal_Bool bSet = sal_True ) { bHasName = bSet; } void SetReadOnly(); sal_Bool IsReadOnly() const; sal_Bool IsReadOnlyMedium() const; @@ -283,9 +276,7 @@ public: void SetNoName(); sal_Bool IsInModalMode() const; sal_Bool IsInPrepareClose() const; - //<!--Added by PengYunQuan for Validity Cell Range Picker virtual sal_Bool AcceptStateUpdate() const; - //-->Added by PengYunQuan for Validity Cell Range Picker sal_Bool HasModalViews() const; sal_Bool IsHelpDocument() const; @@ -300,10 +291,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; @@ -335,6 +324,13 @@ 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( sal_uInt16 nSlotId ); @@ -347,7 +343,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 @@ -368,8 +364,8 @@ public: ::com::sun::star::uno::Any& aRet, ::com::sun::star::uno::Sequence< sal_Int16 >& aOutParamIndex, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aOutParam, - bool bRaiseError = true - ); + bool bRaiseError = true, + const ::com::sun::star::uno::Any* aCaller = 0 ); static ErrCode CallXScript( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxScriptContext, @@ -378,7 +374,8 @@ public: ::com::sun::star::uno::Any& aRet, ::com::sun::star::uno::Sequence< sal_Int16 >& aOutParamIndex, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aOutParam, - bool bRaiseError = true + bool bRaiseError = true, + const ::com::sun::star::uno::Any* aCaller = 0 ); /** adjusts the internal macro mode, according to the current security settings @@ -465,8 +462,6 @@ public: SfxProgress* GetProgress() const; void SetWaitCursor( sal_Bool bSet ) const; -//(mba) virtual SotObjectRef CreateAggObj( const SotFactory* pFact ); - // Naming Interface void SetTitle( const String& rTitle ); String GetTitle( sal_uInt16 nMaxLen = 0 ) const; @@ -481,6 +476,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(); @@ -510,36 +508,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, @@ -567,10 +553,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 ); @@ -588,6 +570,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 ); sal_Bool IsInPlaceActive(); sal_Bool IsUIActive(); @@ -611,7 +596,6 @@ public: ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > GetStorage(); -//REMOVE void SetFileName( const ::rtl::OUString& ); SvGlobalName GetClassName() const; // comphelper::IEmbeddedHelper @@ -672,9 +656,7 @@ 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; @@ -766,15 +748,12 @@ public: SAL_DLLPRIVATE void ImplSign( sal_Bool bScriptingContent = sal_False ); SAL_DLLPRIVATE sal_Bool QuerySaveSizeExceededModules_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xHandler ); -//#endif }; #define SFX_GLOBAL_CLASSID \ 0x9eaba5c3, 0xb232, 0x4309, \ 0x84, 0x5f, 0x5f, 0x15, 0xea, 0x50, 0xd0, 0x74 -//#if 0 // _SOLAR__PRIVATE - struct ModifyBlocker_Impl { SfxObjectShell* pPersist; @@ -791,7 +770,7 @@ public: pPersist->EnableSetModified( bWasEnabled ); } }; -//#endif + //-------------------------------------------------------------------- #ifndef SFX_DECL_OBJECTSHELL_DEFINED @@ -802,7 +781,6 @@ SV_DECL_LOCK(SfxObjectShell) SV_IMPL_LOCK(SfxObjectShell) SV_IMPL_REF(SfxObjectShell) -//#if 0 // _SOLAR__PRIVATE //-------------------------------------------------------------------- class AutoReloadTimer_Impl : public Timer { @@ -815,7 +793,6 @@ public: SfxObjectShell* pSh ); virtual void Timeout(); }; -//#endif //------------------------------------------------------------------------- @@ -842,8 +819,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, sal_uInt8 nMemberId = 0 ) const; - virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); + virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; + virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); SfxObjectShell* GetObjectShell() const { return pObjSh; } @@ -851,3 +828,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 0a0dea610ac5..1c7a63998c03 100644..100755 --- 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 7887b12a761e..3c9f20a18632 100644..100755 --- 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 26458b16f844..567320cfa58e 100644..100755 --- 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. @@ -56,6 +57,7 @@ private: Edit maPasswordED; FixedText maConfirmFT; Edit maConfirmED; + FixedText maMinLengthFT; FixedLine maPassword2Box; FixedText maPassword2FT; Edit maPassword2ED; @@ -66,13 +68,19 @@ private: CancelButton maCancelBtn; HelpButton maHelpBtn; - sal_uInt16 mnMinLen; - sal_uInt16 mnExtras; + String maConfirmStr; + String maMinLenPwdStr; + String maEmptyPwdStr; + String maMainPwdStr; + sal_uInt16 mnMinLen; + sal_uInt16 mnExtras; bool mbAsciiOnly; DECL_DLLPRIVATE_LINK( EditModifyHdl, Edit* ); DECL_DLLPRIVATE_LINK( OKHdl, OKButton* ); + void SetPasswdText(); + public: SfxPasswordDialog( Window* pParent, const String* pGroupText = NULL ); @@ -95,3 +103,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 53b2e87d5fa8..68315b772736 100644..100755 --- 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 723fbcc02f9e..0b25dec5dc38 100644..100755 --- 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 0b00fbb47ab9..c11f45e06396 100644..100755 --- 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. @@ -33,7 +34,7 @@ #include <vcl/button.hxx> #include <vcl/dialog.hxx> #include <sfx2/printer.hxx> -//#include <sfx2/progress.hxx> + class SfxViewShell; //class SfxProgress; @@ -43,35 +44,6 @@ struct SfxPrintProgress_Impl; #define PAGE_MAX 9999 //max. Anzahl der Seiten die gedruckt werden -//-------------------------------------------------------------------- -/* -class SFX2_DLLPUBLIC SfxPrintProgress: public SfxProgress -{ - SfxPrintProgress_Impl* pImp; - -private: -//#if 0 // _SOLAR__PRIVATE - DECL_DLLPRIVATE_LINK( PrintErrorNotify, void * ); - DECL_DLLPRIVATE_LINK( StartPrintNotify, void * ); - DECL_DLLPRIVATE_LINK( EndPrintNotify, void * ); -//#endif -public: - SfxPrintProgress( SfxViewShell* pViewSh, - FASTBOOL bShow = sal_True ); - virtual ~SfxPrintProgress(); - - virtual void SetText( const String &rText ); - sal_Bool SetStateText( sal_uIntPtr nVal, const String &rVal, sal_uIntPtr nNewRange = 0 ); - virtual sal_Bool SetState( sal_uIntPtr nVal, sal_uIntPtr nNewRange = 0 ); - - void RestoreOnEndPrint( SfxPrinter *pOldPrinter ); - void RestoreOnEndPrint( SfxPrinter *pOldPrinter, - sal_Bool bOldEnablePrintFile ); - void DeleteOnEndPrint(); - void SetCancelHdl( const Link& aCancelHdl ); - sal_Bool IsAborted() const; -}; -*/ // ------------------------------------------------------------------------ struct SfxPrintOptDlg_Impl; @@ -102,3 +74,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 6f21f6ed92f8..f8bd9e7ffb9d 100644..100755 --- 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 97764317522e..28a0460a4b5b 100644..100755 --- 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 26a87fa31c3d..d7c993b94148 100644..100755 --- 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: @@ -105,7 +104,7 @@ public: static com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorder > GetMacroRecorder( SfxViewFrame* pFrame=NULL ); static sal_Bool HasMacroRecorder( SfxViewFrame* pFrame=NULL ); sal_uInt16 GetCallMode() const; - bool IsRecording() const; + bool IsRecording() const; void AllowRecording( sal_Bool ); sal_Bool AllowsRecording() const; sal_Bool IsAPI() const; @@ -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 4c47533f4e4a..93f5611a287f 100644..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/sfx.hrc b/sfx2/inc/sfx2/sfx.hrc index dfa3cc8593ec..65b620a9ec62 100755 --- a/sfx2/inc/sfx2/sfx.hrc +++ b/sfx2/inc/sfx2/sfx.hrc @@ -183,9 +183,7 @@ #define RID_DEFAULTIMAGELIST_LC (RID_SFX_START+17) #define RID_DEFAULTIMAGELIST_LM (RID_SFX_START+18) #define RID_STYLEDLG (RID_SFX_START+28) -#define RID_DEFAULTIMAGELIST_SCH (RID_SFX_START+35) #define RID_DEFAULTIMAGELIST_SMH (RID_SFX_START+36) -#define RID_DEFAULTIMAGELIST_LCH (RID_SFX_START+37) #define RID_DEFAULTIMAGELIST_LMH (RID_SFX_START+38) #define RID_IMAGELIST_SCH (RID_SFX_START+39) #define RID_IMAGELIST_SMH (RID_SFX_START+40) @@ -208,6 +206,10 @@ #define RID_DEFAULTABOUT (RID_SFX_START+0) +#define ABOUT_FTXT_LINK 3 +#define ABOUT_STR_VERSION 4 +#define ABOUT_STR_COPYRIGHT 5 +#define ABOUT_STR_LINK 6 #define RID_APPTITLE (RID_SFX_START+4) #define RID_DOCALREADYLOADED_DLG (RID_SFX_START+1) @@ -222,9 +224,7 @@ #define TP_MANAGE_STYLES (RID_SFX_START+7) #define DLG_STYLE_DESIGNER (RID_SFX_START+8) -#define RID_SFX_PROTECT_RECORDS (RID_SFX_START+216) -#define RID_SFX_UNPROTECT_RECORDS (RID_SFX_START+217) -#define RID_SFX_INCORRECT_PASSWORD (RID_SFX_START+218) +#define RID_SFX_INCORRECT_PASSWORD (RID_SFX_START+216) #define STR_STYLE_FILTER_AUTO (RID_SFX_START+9) #define STR_STYLE_FILTER_USED (RID_SFX_START+10) @@ -291,6 +291,7 @@ #define GID_MODIFY (RID_GROUPS_SFXOFFSET+23) #define GID_DRAWING (RID_GROUPS_SFXOFFSET+24) #define GID_CONTROLS (RID_GROUPS_SFXOFFSET+25) +#define GID_NAVIGATION (RID_GROUPS_SFXOFFSET+26) // compatibility-#defines #define GID_FORMEL GID_MATH @@ -355,8 +356,10 @@ #define MID_DOCINFO_ENCRYPTED 0x2c #define MID_DOCINFO_STATISTIC 0x33 #define MID_DOCINFO_CHARLOCALE 0x34 - -#define MID_LAST_USED_PROPID MID_DOCINFO_CHARLOCALE +#define MID_CATEGORY 0x35 +#define MID_COMPANY 0x36 +#define MID_MANAGER 0x37 +#define MID_LAST_USED_PROPID MID_MANAGER // Config-Ids ----------------------------------------------------------- diff --git a/sfx2/inc/sfx2/sfxbasecontroller.hxx b/sfx2/inc/sfx2/sfxbasecontroller.hxx index 4cc7d0321da3..cd0f1e8ce50d 100644..100755 --- 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. @@ -384,7 +385,6 @@ public: virtual void SAL_CALL addTitleChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XTitleChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL removeTitleChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XTitleChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); -//#if 0 // _SOLAR__PRIVATE // FIXME: TL needs this in sw/source/ui/uno/unotxdoc.cxx now; // either the _Impl name should vanish or there should be an "official" API SfxViewShell* GetViewShell_Impl() const; @@ -393,7 +393,6 @@ public: SAL_DLLPRIVATE sal_Bool HasMouseClickListeners_Impl(); SAL_DLLPRIVATE void SetCreationArguments_Impl( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& i_rCreationArgs ); SAL_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::frame::XTitle > impl_getTitleHelper (); -//#endif private: enum ConnectSfxFrame { @@ -415,3 +414,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 017486d251de..35e170042400 100644..100755 --- 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. @@ -87,7 +88,7 @@ #include <cppuhelper/typeprovider.hxx> #include <com/sun/star/script/XStarBasicAccess.hpp> #include <osl/mutex.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <vcl/svapp.hxx> #include <tools/link.hxx> @@ -1513,6 +1514,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 //________________________________________________________________________________________________________ @@ -1619,7 +1621,7 @@ public: }; SfxModelGuard( SfxBaseModel& i_rModel, const AllowedModelState i_eState = E_FULLY_ALIVE ) - :m_aGuard( Application::GetSolarMutex() ) + : m_aGuard() { i_rModel.MethodEntryCheck( i_eState != E_INITIALIZING ); } @@ -1643,9 +1645,11 @@ public: } private: - ::osl::ResettableGuard< ::vos::IMutex > m_aGuard; + SolarMutexClearableGuard m_aGuard; }; #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 55a521e3951c..2a9c64a87936 100644..100755 --- 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 eefa614d9630..b1ab1b879c98 100644..100755 --- 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 98b31872ce68..8c11031ff8e9 100644..100755 --- 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 a2d0e4162ba6..3141c862db39 100644..100755 --- 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. - - sal_Bool GetFileDownloadMIME( String& rMime ); - // Beenden eines asynchronen File-Downloads. Gibt sal_True zurueck, wenn // der Download geklappt hat. Das gelesene File befindet sich dann in // dem uebergeben String. @@ -131,3 +126,5 @@ inline sal_Bool SfxHTMLParser::ParseAreaOptions(ImageMap * pImageMap, const Stri #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/sfxmodelfactory.hxx b/sfx2/inc/sfx2/sfxmodelfactory.hxx index 416358cb60e2..37e6582b697d 100644..100755 --- 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 6c67fbbf7dcc..320d18bf0f03 100644..100755 --- 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 17d47097fb46..268c8f9a671f 100644..100755 --- 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) @@ -748,6 +751,7 @@ #define SID_ATTR_QUICKLAUNCHER (SID_OPTIONS_START + 74) #define SID_ATTR_YEAR2000 (SID_OPTIONS_START + 87) #define SID_ATTR_ALLOWFOLDERWEBVIEW (SID_OPTIONS_START + 92) +#define SID_ATTR_APPLYCHARUNIT (SID_OPTIONS_START + 88) // PathTabPage @@ -860,7 +864,6 @@ #define SID_ZOOM (SID_SVX_START + 289) #define SID_SEARCH_ITEM (SID_SVX_START + 291) #define SID_ATTR_CHAR_FONTWIDTH (SID_SVX_START + 303) -#define SID_HYPERLINK_INSERT (SID_SVX_START + 360) #define SID_HYPERLINK_GETLINK (SID_SVX_START + 361) #define SID_HYPERLINK_SETLINK (SID_SVX_START + 362) #define SID_NAVIGATOR (SID_SVX_START + 366) diff --git a/sfx2/inc/sfx2/sfxstatuslistener.hxx b/sfx2/inc/sfx2/sfxstatuslistener.hxx index 02fa61b17f45..c8b709e2aeb5 100644..100755 --- 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 691716b70571..d0fc3601b593 100644..100755 --- 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 40c2a7fc42fc..fc6c273a9f6c 100644..100755 --- 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. @@ -259,7 +260,7 @@ public: virtual void ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ); #ifndef _SFXSH_HXX - SAL_DLLPRIVATE bool CanExecuteSlot_Impl( const SfxSlot &rSlot ); + SAL_DLLPRIVATE bool CanExecuteSlot_Impl( const SfxSlot &rSlot ); SAL_DLLPRIVATE void DoActivate_Impl( SfxViewFrame *pFrame, sal_Bool bMDI); SAL_DLLPRIVATE void DoDeactivate_Impl( SfxViewFrame *pFrame, sal_Bool bMDI); #endif @@ -305,12 +306,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; \ @@ -327,7 +328,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 ) \ { \ @@ -396,3 +397,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 bea01c6e283a..a7e68013d499 100644..100755 --- 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 f3bb30eaea5f..8be28db84d92 100644..100755 --- 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(sal_uInt16 nSlotId = 0, SfxModule *pMod=NULL) #define SFX_IMPL_STATUSBAR_CONTROL(Class, nItemClass) \ - SfxStatusBarControl* __EXPORT Class::CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar &rStb ) \ + SfxStatusBarControl* Class::CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar &rStb ) \ { return new Class( nSlotId, nId, rStb ); } \ void Class::RegisterControl(sal_uInt16 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 5bb473906dbd..dd79ff6556f8 100644..100755 --- a/sfx2/inc/sfx2/styfitem.hxx +++ b/sfx2/inc/sfx2/styfitem.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,28 +31,17 @@ #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; sal_uInt16 nFlags; }; - -DECLARE_LIST(SfxStyleFilter, SfxFilterTupel*) -#else -typedef List SfxStyleFilter; -#endif +typedef ::std::vector< SfxFilterTupel* > SfxStyleFilter; // CLASS ----------------------------------------------------------------- @@ -80,11 +70,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 +84,11 @@ public: SfxStyleFamilies( ) {}; ~SfxStyleFamilies(); - sal_uInt16 Count() const - { return (sal_uInt16)aEntryList.Count(); } + size_t size() const + { return aEntryList.size(); } - const SfxStyleFamilyItem* GetObject(sal_uIntPtr 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 +100,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 10c4b28381a6..4d121edf0e24 100644..100755 --- 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 6ea55ed96067..c426476cbf02 100644..100755 --- 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; sal_Bool bItemsReset; sal_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(sal_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 sal_Bool OK_Impl() { return PrepareLeaveCurrentPage(); } -//#endif }; END_NAMESPACE_LAYOUT_SFX_TABDIALOG @@ -305,7 +302,7 @@ public: String GetUserData() { return aUserString; } virtual void FillUserData(); virtual sal_Bool IsReadOnly() const; - virtual void PageCreated (SfxAllItemSet aSet); //add CHINA001 + virtual void PageCreated (SfxAllItemSet aSet); static const SfxPoolItem* GetItem( const SfxItemSet& rSet, sal_uInt16 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/taskpane.hxx b/sfx2/inc/sfx2/taskpane.hxx index 54783b6df455..f80b66c4d0ee 100644..100755 --- a/sfx2/inc/sfx2/taskpane.hxx +++ b/sfx2/inc/sfx2/taskpane.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. * @@ -243,3 +244,5 @@ namespace sfx2 //...................................................................................................................... #endif // SFX_TASKPANE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/tbxctrl.hxx b/sfx2/inc/sfx2/tbxctrl.hxx index f8bfa0f00b37..3051f3ed188f 100644..100755 --- 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)( sal_uInt16 nId, ToolBox &rTbx, SfxBindings & ); typedef SfxToolBoxControl* (*SfxToolBoxControlCtor)( sal_uInt16 nSlotId, sal_uInt16 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( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx ) \ + SfxToolBoxControl* Class::CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx ) \ { return new Class( nSlotId, nId, rTbx ); } \ void Class::RegisterControl(sal_uInt16 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( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx ) \ + SfxToolBoxControl* Class::CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx ) \ { return new Class( nSlotId, nId, rTbx, Arg); } \ void Class::RegisterControl(sal_uInt16 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( sal_Bool ); virtual void StateChanged( sal_uInt16 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; sal_Bool bBigImages; PopupMenu* pMenu; sal_uIntPtr m_nSymbolsStyle; - sal_Bool m_bWasHiContrastMode; sal_Bool m_bShowMenuImages; }; @@ -430,7 +415,6 @@ class SfxAddonsToolBoxControl_Impl : public SfxToolBoxControl { sal_Bool bBigImages; PopupMenu* pMenu; - sal_Bool m_bWasHiContrastMode; sal_Bool m_bShowMenuImages; protected: @@ -438,7 +422,7 @@ protected: using SfxToolBoxControl::Select; virtual void Select( sal_Bool ); virtual void StateChanged( sal_uInt16 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( sal_uInt16 nSlotId, sal_uInt16 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 b663a277065f..e235e760698c 100644..100755 --- 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/titledockwin.hxx b/sfx2/inc/sfx2/titledockwin.hxx index cee9709841a5..8b03be062387 100644..100755 --- a/sfx2/inc/sfx2/titledockwin.hxx +++ b/sfx2/inc/sfx2/titledockwin.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. * @@ -170,3 +171,5 @@ namespace sfx2 //...................................................................................................................... #endif // SFX_TITLEDOCKWIN_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/tplpitem.hxx b/sfx2/inc/sfx2/tplpitem.hxx index 5b2cbd1dfaf9..c8c9765be13c 100644..100755 --- a/sfx2/inc/sfx2/tplpitem.hxx +++ b/sfx2/inc/sfx2/tplpitem.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,8 +50,10 @@ public: virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; virtual int operator==( const SfxPoolItem& ) const; virtual sal_uInt8 GetFlagCount() const; - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; - virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); + virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; + virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/unoctitm.hxx b/sfx2/inc/sfx2/unoctitm.hxx index f30a544922b5..d1fcf169046b 100644..100755 --- 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 16504af6331e..4f7311125bd3 100644..100755 --- 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/viewfac.hxx b/sfx2/inc/sfx2/viewfac.hxx index f3376e733702..da4d7902c30a 100644..100755 --- a/sfx2/inc/sfx2/viewfac.hxx +++ b/sfx2/inc/sfx2/viewfac.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 @@ private: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx index ef5d4a358e22..f450e0108690 100644..100755 --- 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. @@ -205,7 +206,6 @@ public: void ChildWindowExecute(SfxRequest&); void ChildWindowState(SfxItemSet&); -//#if 0 // _SOLAR__PRIVATE SAL_DLLPRIVATE void SetDowning_Impl(); SAL_DLLPRIVATE void GetDocNumber_Impl(); SAL_DLLPRIVATE sal_Bool IsDowning_Impl() const; @@ -249,7 +249,6 @@ public: SAL_DLLPRIVATE void SetCurViewId_Impl( const sal_uInt16 i_nID ); SAL_DLLPRIVATE void ActivateToolPanel_Impl( const ::rtl::OUString& i_rPanelURL ); -//#endif private: SAL_DLLPRIVATE sal_Bool SwitchToViewShell_Impl( sal_uInt16 nNo, sal_Bool bIsIndex = sal_False ); SAL_DLLPRIVATE void PopShellAndSubShells_Impl( SfxViewShell& i_rViewShell ); @@ -343,8 +342,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, sal_uInt8 nMemberId = 0 ) const; + virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 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 6e613cce0176..a40321c61b45 100644..100755 --- 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. @@ -43,6 +44,8 @@ #include <tools/gen.hxx> #include <tools/errcode.hxx> #include <vcl/jobset.hxx> +#include <vector> + class SfxBaseController; class Size; class Fraction; @@ -125,7 +128,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( sal_uInt16 nPrio ) \ { \ @@ -141,7 +144,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 @@ -224,8 +227,8 @@ public: // Focus, KeyInput, Cursor void GotFocus() const; inline void LostFocus() const; - virtual void ShowCursor( FASTBOOL bOn = sal_True ); - virtual FASTBOOL KeyInput( const KeyEvent &rKeyEvent ); + virtual void ShowCursor( bool bOn = true ); + virtual bool KeyInput( const KeyEvent &rKeyEvent ); sal_Bool Escape(); // Viewing Interface @@ -299,9 +302,8 @@ public: SAL_DLLPRIVATE bool GlobalKeyInput_Impl( const KeyEvent &rKeyEvent ); SAL_DLLPRIVATE void NewIPClient_Impl( SfxInPlaceClient *pIPClient ) - { GetIPClientList_Impl(sal_True)->Insert(pIPClient); } - SAL_DLLPRIVATE void IPClientGone_Impl( SfxInPlaceClient *pIPClient ) - { GetIPClientList_Impl(sal_True)->Remove(pIPClient); } + { GetIPClientList_Impl(TRUE)->push_back(pIPClient); } + SAL_DLLPRIVATE void IPClientGone_Impl( SfxInPlaceClient *pIPClient ); SAL_DLLPRIVATE SfxInPlaceClientList* GetIPClientList_Impl( sal_Bool bCreate = sal_True ) const; SAL_DLLPRIVATE void ResetAllClients_Impl( SfxInPlaceClient *pIP ); SAL_DLLPRIVATE void DiscardClients_Impl(); @@ -378,3 +380,5 @@ inline SfxViewFrame* SfxViewShell::GetViewFrame() const #endif // #ifndef _SFXVIEWSH_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file diff --git a/sfx2/inc/sfxbasic.hxx b/sfx2/inc/sfxbasic.hxx new file mode 100755 index 000000000000..14a8bd7f9904 --- /dev/null +++ b/sfx2/inc/sfxbasic.hxx @@ -0,0 +1,44 @@ +/* -*- 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 + * + * 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 _SFXBASIC_HXX +#define _SFXBASIC_HXX + +class BasicManager; +class SbMethod; + +//------------------------------------------------------------------ + +SbMethod* SfxQueryMacro( BasicManager* pMgr, const String& rMacro ); + +ErrCode SfxCallMacro( BasicManager* pMgr, const String& rMacro, + SbxArray *pArgs = 0, SbxValue *pRet = 0 ); + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sorgitm.hxx b/sfx2/inc/sorgitm.hxx index 52dbe7b71294..aedb2ab16ac8 100644..100755 --- 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, sal_uInt8 nMemberId = 0 ) const; - virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); + virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; + virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 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 4816bfc58f8e..2e6d1effb4c7 100644..100755 --- 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/prj/build.lst b/sfx2/prj/build.lst index f25e991f84f4..27a2e6edb2d3 100644..100755 --- a/sfx2/prj/build.lst +++ b/sfx2/prj/build.lst @@ -1,3 +1,3 @@ -sf sfx2 : L10N:l10n idl basic xmlscript framework readlicense_oo shell setup_native sax SYSTRAY_GTK:libegg LIBXML2:libxml2 LIBXSLT:libxslt NULL +sf sfx2 : L10N:l10n idl basic xmlscript framework readlicense_oo shell setup_native sax LIBXML2:libxml2 LIBXSLT:libxslt NULL sf sfx2\prj nmake - all sf_prj NULL diff --git a/sfx2/prj/d.lst b/sfx2/prj/d.lst index e69de29bb2d1..e69de29bb2d1 100644..100755 --- a/sfx2/prj/d.lst +++ b/sfx2/prj/d.lst diff --git a/sfx2/prj/makefile.mk b/sfx2/prj/makefile.mk index e312a7ccab65..e312a7ccab65 100644..100755 --- a/sfx2/prj/makefile.mk +++ b/sfx2/prj/makefile.mk diff --git a/sfx2/qa/complex/sfx2/DocumentInfo.java b/sfx2/qa/complex/sfx2/DocumentInfo.java index ca7ae8b1dda0..ca7ae8b1dda0 100644..100755 --- a/sfx2/qa/complex/sfx2/DocumentInfo.java +++ b/sfx2/qa/complex/sfx2/DocumentInfo.java diff --git a/sfx2/qa/complex/sfx2/DocumentMetadataAccess.java b/sfx2/qa/complex/sfx2/DocumentMetadataAccess.java index d145b9028473..d145b9028473 100644..100755 --- a/sfx2/qa/complex/sfx2/DocumentMetadataAccess.java +++ b/sfx2/qa/complex/sfx2/DocumentMetadataAccess.java diff --git a/sfx2/qa/complex/sfx2/DocumentProperties.java b/sfx2/qa/complex/sfx2/DocumentProperties.java index 01ccaa21619b..01ccaa21619b 100644..100755 --- a/sfx2/qa/complex/sfx2/DocumentProperties.java +++ b/sfx2/qa/complex/sfx2/DocumentProperties.java diff --git a/sfx2/qa/complex/sfx2/GlobalEventBroadcaster.java b/sfx2/qa/complex/sfx2/GlobalEventBroadcaster.java index 41bd66ccb5b9..41bd66ccb5b9 100644..100755 --- a/sfx2/qa/complex/sfx2/GlobalEventBroadcaster.java +++ b/sfx2/qa/complex/sfx2/GlobalEventBroadcaster.java diff --git a/sfx2/qa/complex/sfx2/StandaloneDocumentInfo.java b/sfx2/qa/complex/sfx2/StandaloneDocumentInfo.java index 1e9cbb1f4738..1e9cbb1f4738 100644..100755 --- a/sfx2/qa/complex/sfx2/StandaloneDocumentInfo.java +++ b/sfx2/qa/complex/sfx2/StandaloneDocumentInfo.java diff --git a/sfx2/qa/complex/sfx2/makefile.mk b/sfx2/qa/complex/sfx2/makefile.mk index 20b170fba3b4..20b170fba3b4 100644..100755 --- a/sfx2/qa/complex/sfx2/makefile.mk +++ b/sfx2/qa/complex/sfx2/makefile.mk diff --git a/sfx2/qa/complex/sfx2/standalonedocinfo/StandaloneDocumentInfoTest.java b/sfx2/qa/complex/sfx2/standalonedocinfo/StandaloneDocumentInfoTest.java index d255f3d16822..d255f3d16822 100644..100755 --- a/sfx2/qa/complex/sfx2/standalonedocinfo/StandaloneDocumentInfoTest.java +++ b/sfx2/qa/complex/sfx2/standalonedocinfo/StandaloneDocumentInfoTest.java diff --git a/sfx2/qa/complex/sfx2/standalonedocinfo/Test01.java b/sfx2/qa/complex/sfx2/standalonedocinfo/Test01.java index bf54bb4ca90b..bf54bb4ca90b 100644..100755 --- a/sfx2/qa/complex/sfx2/standalonedocinfo/Test01.java +++ b/sfx2/qa/complex/sfx2/standalonedocinfo/Test01.java diff --git a/sfx2/qa/complex/sfx2/standalonedocinfo/TestHelper.java b/sfx2/qa/complex/sfx2/standalonedocinfo/TestHelper.java index a650ce9bb2e4..a650ce9bb2e4 100644..100755 --- a/sfx2/qa/complex/sfx2/standalonedocinfo/TestHelper.java +++ b/sfx2/qa/complex/sfx2/standalonedocinfo/TestHelper.java diff --git a/sfx2/qa/complex/sfx2/testdocuments/CUSTOM.odt b/sfx2/qa/complex/sfx2/testdocuments/CUSTOM.odt Binary files differindex 831a8f451dfd..831a8f451dfd 100644..100755 --- a/sfx2/qa/complex/sfx2/testdocuments/CUSTOM.odt +++ b/sfx2/qa/complex/sfx2/testdocuments/CUSTOM.odt diff --git a/sfx2/qa/complex/sfx2/testdocuments/TEST.odt b/sfx2/qa/complex/sfx2/testdocuments/TEST.odt Binary files differindex 7c6f0b60f7b0..7c6f0b60f7b0 100644..100755 --- a/sfx2/qa/complex/sfx2/testdocuments/TEST.odt +++ b/sfx2/qa/complex/sfx2/testdocuments/TEST.odt diff --git a/sfx2/qa/complex/sfx2/testdocuments/TESTRDFA.odt b/sfx2/qa/complex/sfx2/testdocuments/TESTRDFA.odt Binary files differindex d59739142df6..d59739142df6 100644..100755 --- a/sfx2/qa/complex/sfx2/testdocuments/TESTRDFA.odt +++ b/sfx2/qa/complex/sfx2/testdocuments/TESTRDFA.odt diff --git a/sfx2/qa/complex/sfx2/testdocuments/empty.rdf b/sfx2/qa/complex/sfx2/testdocuments/empty.rdf index af62bab39dfa..af62bab39dfa 100644..100755 --- a/sfx2/qa/complex/sfx2/testdocuments/empty.rdf +++ b/sfx2/qa/complex/sfx2/testdocuments/empty.rdf diff --git a/sfx2/qa/complex/sfx2/tools/DialogThread.java b/sfx2/qa/complex/sfx2/tools/DialogThread.java index e67e65f218db..e67e65f218db 100644..100755 --- a/sfx2/qa/complex/sfx2/tools/DialogThread.java +++ b/sfx2/qa/complex/sfx2/tools/DialogThread.java diff --git a/sfx2/qa/complex/sfx2/tools/TestDocument.java b/sfx2/qa/complex/sfx2/tools/TestDocument.java index 8f2108df358e..8f2108df358e 100644..100755 --- a/sfx2/qa/complex/sfx2/tools/TestDocument.java +++ b/sfx2/qa/complex/sfx2/tools/TestDocument.java diff --git a/sfx2/qa/complex/sfx2/tools/WriterHelper.java b/sfx2/qa/complex/sfx2/tools/WriterHelper.java index 4767028572bb..4767028572bb 100644..100755 --- a/sfx2/qa/complex/sfx2/tools/WriterHelper.java +++ b/sfx2/qa/complex/sfx2/tools/WriterHelper.java diff --git a/sfx2/qa/cppunit/makefile.mk b/sfx2/qa/cppunit/makefile.mk new file mode 100755 index 000000000000..10e0eaa3d979 --- /dev/null +++ b/sfx2/qa/cppunit/makefile.mk @@ -0,0 +1,70 @@ +#************************************************************************* +# +# 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=qa_cppunit + +ENABLE_EXCEPTIONS=TRUE + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk + +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) +DEF1NAME=$(SHL1TARGET) +SHL1VERSIONMAP= version.map + +# --- All object files --------------------------------------------- + +SLOFILES= \ + $(SHL1OBJS) + + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk +.INCLUDE : _cppunit.mk + diff --git a/sfx2/qa/cppunit/test_metadatable.cxx b/sfx2/qa/cppunit/test_metadatable.cxx index 9930d61acf20..4a94890f21df 100644..100755 --- a/sfx2/qa/cppunit/test_metadatable.cxx +++ b/sfx2/qa/cppunit/test_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. @@ -107,12 +108,12 @@ void MetadatableTest::test() MockMetadatable m4(*pReg); MockMetadatable m5(*pReg); ::rtl::OUString empty; - ::rtl::OUString content( ::rtl::OUString::createFromAscii("content.xml") ); - ::rtl::OUString styles ( ::rtl::OUString::createFromAscii("styles.xml") ); - ::rtl::OUString sid1( ::rtl::OUString::createFromAscii("id1") ); - ::rtl::OUString sid2( ::rtl::OUString::createFromAscii("id2") ); - ::rtl::OUString sid3( ::rtl::OUString::createFromAscii("id3") ); - ::rtl::OUString sid4( ::rtl::OUString::createFromAscii("id4") ); + ::rtl::OUString content( RTL_CONSTASCII_USTRINGPARAM("content.xml") ); + ::rtl::OUString styles( RTL_CONSTASCII_USTRINGPARAM("styles.xml") ); + ::rtl::OUString sid1( RTL_CONSTASCII_USTRINGPARAM("id1") ); + ::rtl::OUString sid2( RTL_CONSTASCII_USTRINGPARAM("id2") ); + ::rtl::OUString sid3( RTL_CONSTASCII_USTRINGPARAM("id3") ); + ::rtl::OUString sid4( RTL_CONSTASCII_USTRINGPARAM("id4") ); beans::StringPair id1(content, sid1); beans::StringPair id2(content, sid2); beans::StringPair id3(content, sid3); @@ -272,3 +273,4 @@ CPPUNIT_TEST_SUITE_REGISTRATION(MetadatableTest); CPPUNIT_PLUGIN_IMPLEMENT(); +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/qa/cppunit/version.map b/sfx2/qa/cppunit/version.map index 3308588ef6f8..3308588ef6f8 100644..100755 --- a/sfx2/qa/cppunit/version.map +++ b/sfx2/qa/cppunit/version.map diff --git a/sfx2/qa/unoapi/Test.java b/sfx2/qa/unoapi/Test.java index c1231c975a2b..c1231c975a2b 100644..100755 --- a/sfx2/qa/unoapi/Test.java +++ b/sfx2/qa/unoapi/Test.java diff --git a/sfx2/qa/unoapi/knownissues.xcl b/sfx2/qa/unoapi/knownissues.xcl index 1d87f84c96d2..1d87f84c96d2 100644..100755 --- a/sfx2/qa/unoapi/knownissues.xcl +++ b/sfx2/qa/unoapi/knownissues.xcl diff --git a/sfx2/qa/unoapi/sfx.sce b/sfx2/qa/unoapi/sfx.sce index ce72c463ee55..ce72c463ee55 100644..100755 --- a/sfx2/qa/unoapi/sfx.sce +++ b/sfx2/qa/unoapi/sfx.sce diff --git a/sfx2/qa/unoapi/testdocuments/SfxStandaloneDocInfoObject.sdw b/sfx2/qa/unoapi/testdocuments/SfxStandaloneDocInfoObject.sdw Binary files differindex c4b5672f9624..c4b5672f9624 100644..100755 --- a/sfx2/qa/unoapi/testdocuments/SfxStandaloneDocInfoObject.sdw +++ b/sfx2/qa/unoapi/testdocuments/SfxStandaloneDocInfoObject.sdw diff --git a/sfx2/qa/unoapi/testdocuments/report.stw b/sfx2/qa/unoapi/testdocuments/report.stw Binary files differindex 5b8efafa159b..5b8efafa159b 100644..100755 --- a/sfx2/qa/unoapi/testdocuments/report.stw +++ b/sfx2/qa/unoapi/testdocuments/report.stw diff --git a/sfx2/qa/unoapi/testdocuments/report2.stw b/sfx2/qa/unoapi/testdocuments/report2.stw Binary files differindex 9ee0a7ee0ee0..9ee0a7ee0ee0 100644..100755 --- a/sfx2/qa/unoapi/testdocuments/report2.stw +++ b/sfx2/qa/unoapi/testdocuments/report2.stw diff --git a/sfx2/sdi/appslots.sdi b/sfx2/sdi/appslots.sdi index f20cdbd7c385..3bd2bc8b1e02 100644..100755 --- 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/docslots.sdi b/sfx2/sdi/docslots.sdi index 0e4a302d9d13..0e4a302d9d13 100644..100755 --- a/sfx2/sdi/docslots.sdi +++ b/sfx2/sdi/docslots.sdi diff --git a/sfx2/sdi/frmslots.sdi b/sfx2/sdi/frmslots.sdi index dbf9267448e1..33a6fbce671a 100644..100755 --- a/sfx2/sdi/frmslots.sdi +++ b/sfx2/sdi/frmslots.sdi @@ -30,11 +30,6 @@ interface Window Automation = FALSE ; ] { - SID_HYPERLINK_INSERT - [ - ExecMethod = ChildWindowExecute ; - StateMethod = ChildWindowState ; - ] SID_HYPERLINK_DIALOG [ ExecMethod = ChildWindowExecute ; diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi index a9c5ca6e7330..e69bf590a322 100644..100755 --- a/sfx2/sdi/sfx.sdi +++ b/sfx2/sdi/sfx.sdi @@ -2953,33 +2953,6 @@ SfxBoolItem InsertDoc SID_INSERTDOC ] //-------------------------------------------------------------------------- -SfxBoolItem InsertHyperlink SID_HYPERLINK_INSERT - -[ - /* flags: */ - AutoUpdate = TRUE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = FALSE, - HasDialog = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - Synchron; - - Readonly = FALSE, - - /* config: */ - AccelConfig = TRUE, - MenuConfig = TRUE, - StatusBarConfig = FALSE, - ToolBoxConfig = TRUE, - GroupId = GID_VIEW; -] - -//-------------------------------------------------------------------------- SfxVoidItem InsertObjectFloatingFrame SID_INSERT_FLOATINGFRAME ( SfxStringItem Name FN_PARAM_1, @@ -3830,6 +3803,33 @@ SfxUInt16Item MetricUnit SID_ATTR_METRIC ] //-------------------------------------------------------------------------- +SfxBoolItem ApplyCharUnit SID_ATTR_APPLYCHARUNIT + +[ + /* flags: */ + AutoUpdate = TRUE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + Readonly = FALSE, + + /* config: */ + AccelConfig = FALSE, + MenuConfig = FALSE, + StatusBarConfig = FALSE, + ToolBoxConfig = FALSE, + GroupId = GID_VIEW; +] + +//-------------------------------------------------------------------------- SfxBoolItem Modified SID_MODIFIED [ @@ -3857,7 +3857,7 @@ SfxBoolItem Modified SID_MODIFIED ] //-------------------------------------------------------------------------- -SfxStringItem ModifiedStatus SID_DOC_MODIFIED +SfxBoolItem ModifiedStatus SID_DOC_MODIFIED [ /* flags: */ @@ -7264,7 +7264,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/sdi/sfxitems.sdi b/sfx2/sdi/sfxitems.sdi index 421c1cb29529..421c1cb29529 100644..100755 --- a/sfx2/sdi/sfxitems.sdi +++ b/sfx2/sdi/sfxitems.sdi diff --git a/sfx2/sdi/sfxslots.sdi b/sfx2/sdi/sfxslots.sdi index 1479c4716efc..1479c4716efc 100644..100755 --- a/sfx2/sdi/sfxslots.sdi +++ b/sfx2/sdi/sfxslots.sdi diff --git a/sfx2/sdi/viwslots.sdi b/sfx2/sdi/viwslots.sdi index 4d14d927adf6..4d14d927adf6 100644..100755 --- a/sfx2/sdi/viwslots.sdi +++ b/sfx2/sdi/viwslots.sdi diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx index d8442bb215f6..41b12bdd2749 100644..100755 --- 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> @@ -259,18 +259,6 @@ void SfxPropertyHandler::Property( ApplicationProperty& rProp ) } } break; -/* - case TT_PR_IMG: - { - SvDataMemberObjectRef aDataObject = new SvDataMemberObject(); - SvData* pDataBmp = new SvData( FORMAT_BITMAP ); - pDataBmp->SetData( pTTProperties->mpBmp ); - aDataObject->Append( pDataBmp ); - aDataObject->CopyClipboard(); - pTTProperties->nActualPR = 0; - } - break; -*/ default: { pTTProperties->nPropertyVersion = 0; @@ -472,9 +460,7 @@ void SfxApplication::SetViewFrame_Impl( SfxViewFrame *pFrame ) // DocWinActivate : both frames belong to the same TopWindow // TopWinActivate : both frames belong to different TopWindows -// not used anymore! -// sal_Bool bDocWinActivate = pOldContainerFrame && pNewContainerFrame && -// pOldContainerFrame->GetTopViewFrame() == pNewContainerFrame->GetTopViewFrame(); + sal_Bool bTaskActivate = pOldContainerFrame != pNewContainerFrame; if ( pOldContainerFrame ) @@ -489,15 +475,6 @@ void SfxApplication::SetViewFrame_Impl( SfxViewFrame *pFrame ) pAppData_Impl->pViewFrame = pFrame; - //const SfxObjectShell* pSh = pViewFrame ? pViewFrame->GetObjectShell() : 0; - //if ( !pSh ) - //{ - // // otherwise BaseURL is set in activation of document - // INetURLObject aObject( SvtPathOptions().GetWorkPath() ); - // aObject.setFinalSlash(); - // INetURLObject::SetBaseURL( aObject.GetMainURL( INetURLObject::NO_DECODE ) ); - //} - if( pNewContainerFrame ) { pNewContainerFrame->DoActivate( bTaskActivate ); @@ -557,8 +534,7 @@ short SfxApplication::QuerySave_Impl( SfxObjectShell& rDoc, sal_Bool /*bAutoSave ResMgr* SfxApplication::CreateResManager( const char *pPrefix ) { - String aMgrName = String::CreateFromAscii( pPrefix ); - return ResMgr::CreateResMgr(U2S(aMgrName)); + return ResMgr::CreateResMgr(pPrefix); } //--------------------------------------------------------------------- @@ -727,7 +703,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; } @@ -743,8 +719,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() ) @@ -823,3 +799,5 @@ ErrCode SfxApplication::CallBasic( const String& rCode, BasicManager* pMgr, SbxA { return pMgr->ExecuteMacro( rCode, pArgs, pRet); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/app.hrc b/sfx2/source/appl/app.hrc index ff01fd358d4d..25e4e4527e37 100644..100755 --- a/sfx2/source/appl/app.hrc +++ b/sfx2/source/appl/app.hrc @@ -34,9 +34,6 @@ #define ACC_IBM (RID_SFX_APP_START+2) #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) @@ -77,13 +74,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 STR_HELP_WINDOW_TITLE (RID_SFX_APP_START+125) // string #define STR_HELP_BUTTON_INDEX_ON (RID_SFX_APP_START+126) @@ -114,16 +107,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) @@ -134,31 +117,15 @@ #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) #define RID_DESKTOP (RID_SFX_APP_START + 184) -// #define RID_XMLSEC_WARNING_BROKENSIGNATURE (RID_SFX_APP_START + 185) #define RID_XMLSEC_QUERY_LOSINGSIGNATURE (RID_SFX_APP_START + 186) #define RID_XMLSEC_QUERY_SAVEBEFORESIGN (RID_SFX_APP_START + 187) - // FREE - // FREE -#define RID_XMLSEC_INFO_WRONGDOCFORMAT (RID_SFX_APP_START + 190) -/* obsolete -#define RID_WARNING_MACROSDISABLED (RID_SFX_APP_START + 191) -*/ +#define RID_XMLSEC_INFO_WRONGDOCFORMAT (RID_SFX_APP_START + 190) #define STR_QUERY_UPDATE_LINKS (RID_SFX_APP_START + 192) #define STR_DDE_ERROR (RID_SFX_APP_START + 193) @@ -176,6 +143,16 @@ #define RID_SVXSTR_GRFILTER_FILTERERROR (RID_SFX_APP_START + 202) #define RID_SVXSTR_GRFILTER_TOOBIG (RID_SFX_APP_START + 203) +// For the License Information dialog box +#define DLG_HELP_LICENSING (RID_SFX_APP_START + 204) +#define STR_LICENSING_INFORMATION_1 (RID_SFX_APP_START + 205) +#define STR_LICENSING_INFORMATION_2 (RID_SFX_APP_START + 206) +#define STR_LICENSING_INFORMATION_3 (RID_SFX_APP_START + 207) +#define STR_LICENSING_INFORMATION_4 (RID_SFX_APP_START + 208) +#define STR_LICENSING_INFORMATION_5 (RID_SFX_APP_START + 209) +#define PB_LICENSING_SHOW (RID_SFX_APP_START + 210) +#define PB_LICENSING_CLOSE (RID_SFX_APP_START + 211) + #define MD_DDE_LINKEDIT (RID_SFX_APP_START + 1) #endif // #ifndef _SFX_APP_HRC diff --git a/sfx2/source/appl/app.src b/sfx2/source/appl/app.src index fa5a1fc1c335..97dd00a73367 100644..100755 --- a/sfx2/source/appl/app.src +++ b/sfx2/source/appl/app.src @@ -399,7 +399,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 @@ -516,3 +516,57 @@ String RID_SVXSTR_GRFILTER_TOOBIG Text [ en-US ] = "Not enough memory to insert graphic" ; }; +ModalDialog DLG_HELP_LICENSING +{ + // Size is computed + Text [ en-US ] = "Licensing and Legal information"; + MOVEABLE = TRUE ; + CLOSEABLE = TRUE ; + OUTPUTSIZE = TRUE ; + SVLOOK = TRUE ; + String STR_LICENSING_INFORMATION_1 + { + Text [ en-US ] = + "%PRODUCTNAME is made available subject to the terms of GNU Lesser General Public\n" + "License Version 3. A copy of the LGPL license can be found at\n" + "http://www.gnu.org/licenses/lgpl-3.0.html" ; + }; + String STR_LICENSING_INFORMATION_2 + { + Text [ en-US ] = + "Third Party Code Additional copyright notices and license terms applicable to\n" + "portions of the Software are set forth in the THIRDPARTYLICENSEREADME.html\n" + "file; choose Show License to see exact details in English." ; + }; + String STR_LICENSING_INFORMATION_3 + { + Text [ en-US ] = + "All trademarks and registered trademarks mentioned herein are the property of\n" + "their respective owners." ; + }; + String STR_LICENSING_INFORMATION_4 + { + Text [ en-US ] = + "Copyright © 2000, 2010 LibreOffice contributors and/or their affiliates. All rights\n" + "reserved." ; + }; + String STR_LICENSING_INFORMATION_5 + { + Text [ en-US ] = + "This product was created by %OOOVENDOR, based on OpenOffice.org,\n" + "which is Copyright 2000, 2010 Oracle and/or its affiliates.\n" + "%OOOVENDOR acknowledges all community members, please see\n" + "http://www.libreoffice.org/ for more details." ; + }; + OKButton PB_LICENSING_SHOW + { + // Position and size is computed + Text [ en-US ] = "~Show License" ; + DefButton = TRUE ; + }; + CancelButton PB_LICENSING_CLOSE + { + // Position and size is computed + Text [ en-US ] = "~Close" ; + }; +}; diff --git a/sfx2/source/appl/appbas.cxx b/sfx2/source/appl/appbas.cxx index 6d6c8ace5a09..a776e09d1f74 100644..100755 --- 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. @@ -86,7 +87,7 @@ #define ITEMID_SEARCH SID_SEARCH_ITEM #include <svl/srchitem.hxx> -#include <vos/socket.hxx> +#include <osl/socket.hxx> #define SFX_TYPEMAP #define Selection @@ -99,17 +100,15 @@ using namespace ::com::sun::star::script; using ::basic::BasicManagerRepository; -//======================================================================== - //------------------------------------------------------------------------ -String lcl_GetVersionString(ResMgr* /*pAppData_ImplResMgr*/) +String lcl_GetVersionString() { ::rtl::OUString aDefault; String aVersion( utl::Bootstrap::getBuildIdData( aDefault )); if ( aVersion.Len() == 0 ) { - DBG_ERROR( "No BUILDID in bootstrap file found" ); + OSL_FAIL( "No BUILDID in bootstrap file found" ); } aVersion.Erase( 0, aVersion.Search( ':' ) + 1 ); @@ -133,46 +132,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 ) { @@ -229,7 +188,6 @@ void SfxApplication::PropExec_Impl( SfxRequest &rReq ) { SbxObject* pObject = SbxBase::CreateObject( pItem->GetValue() ); pObject->AddRef(); -//(mba) rReq.SetReturnValue( SfxObjectItem( 0, pObject ) ); rReq.Done(); } break; @@ -237,12 +195,6 @@ void SfxApplication::PropExec_Impl( SfxRequest &rReq ) case SID_DELETE_BASICOBJECT: { - SFX_REQUEST_ARG(rReq, pItem, SfxObjectItem, nSID, sal_False); - if ( pItem ) - { -//(mba) SbxObject* pObject = pItem->GetObject(); -//(mba) pObject->ReleaseRef(); - } break; } @@ -290,7 +242,6 @@ void SfxApplication::PropExec_Impl( SfxRequest &rReq ) //------------------------------------------------------------------------- void SfxApplication::PropState_Impl( SfxItemSet &rSet ) { -// SfxViewFrame *pFrame = SfxViewFrame::Current(); SfxWhichIter aIter(rSet); for ( sal_uInt16 nSID = aIter.FirstWhich(); nSID; nSID = aIter.NextWhich() ) { @@ -329,3 +280,4 @@ void SfxApplication::PropState_Impl( SfxItemSet &rSet ) } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/appbaslib.cxx b/sfx2/source/appl/appbaslib.cxx index 7f4e8cedb637..eb2c43a27dd3 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. @@ -146,7 +147,7 @@ Reference< XLibraryContainer > SfxBasicManagerHolder::getLibraryContainer( Conta case SCRIPTS: return mxBasicContainer.get(); case DIALOGS: return mxDialogContainer.get(); } - DBG_ERROR( "SfxBasicManagerHolder::getLibraryContainer: illegal container type!" ); + OSL_FAIL( "SfxBasicManagerHolder::getLibraryContainer: illegal container type!" ); return NULL; } @@ -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 d98147078bc6..8974a6c6e586 100644..100755 --- 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> @@ -274,9 +271,6 @@ sal_Bool SfxApplication::GetOptions( SfxItemSet& rSet ) } break; case SID_ATTR_METRIC : -// if(rSet.Put( SfxUInt16Item( rPool.GetWhich( SID_ATTR_METRIC ), -// pOptions->GetMetric() ) ) ) -// bRet = sal_True; break; case SID_HELPBALLOONS : if(rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_HELPBALLOONS ), @@ -505,7 +499,7 @@ sal_Bool SfxApplication::GetOptions( SfxItemSet& rSet ) } #ifdef DBG_UTIL if ( !bRet ) - DBG_ERROR( "Putting options failed!" ); + OSL_FAIL( "Putting options failed!" ); #endif } pRanges++; @@ -526,7 +520,6 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) const SfxPoolItem *pItem = 0; SfxItemPool &rPool = GetPool(); sal_Bool bResetSession = sal_False; - sal_Bool bProxiesModified = sal_False; SvtSaveOptions aSaveOptions; SvtUndoOptions aUndoOptions; @@ -627,7 +620,6 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_METRIC), sal_True, &pItem)) { DBG_ASSERT(pItem->ISA(SfxUInt16Item), "UInt16Item expected"); -// pOptions->SetMetric((FieldUnit)((const SfxUInt16Item*)pItem)->GetValue()); } // HelpBalloons @@ -672,7 +664,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) sal_Bool bReset = ((const SfxBoolItem *)pItem)->GetValue(); if ( bReset ) { - DBG_ERROR( "Not implemented, may be EOL!" ); + OSL_FAIL( "Not implemented, may be EOL!" ); } } if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_HELP_STYLESHEET ), sal_True, &pItem)) @@ -751,7 +743,6 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) DBG_ASSERT( pItem->ISA(SfxUInt16Item), "UInt16Item expected" ); aInetOptions.SetProxyType((SvtInetOptions::ProxyType)( (const SfxUInt16Item*)pItem )->GetValue()); bResetSession = sal_True; - bProxiesModified = sal_True; } if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_HTTP_PROXY_NAME ), sal_True, &pItem ) ) @@ -759,35 +750,30 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) DBG_ASSERT( pItem->ISA(SfxStringItem), "StringItem expected" ); aInetOptions.SetProxyHttpName( ((const SfxStringItem *)pItem)->GetValue() ); bResetSession = sal_True; - bProxiesModified = sal_True; } if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_HTTP_PROXY_PORT ), sal_True, &pItem ) ) { DBG_ASSERT( pItem->ISA(SfxInt32Item), "Int32Item expected" ); aInetOptions.SetProxyHttpPort( ( (const SfxInt32Item*)pItem )->GetValue() ); bResetSession = sal_True; - bProxiesModified = sal_True; } if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_FTP_PROXY_NAME ), sal_True, &pItem ) ) { DBG_ASSERT( pItem->ISA(SfxStringItem), "StringItem expected" ); aInetOptions.SetProxyFtpName( ((const SfxStringItem *)pItem)->GetValue() ); bResetSession = sal_True; - bProxiesModified = sal_True; } if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_FTP_PROXY_PORT ), sal_True, &pItem ) ) { DBG_ASSERT( pItem->ISA(SfxInt32Item), "Int32Item expected" ); aInetOptions.SetProxyFtpPort( ( (const SfxInt32Item*)pItem )->GetValue() ); bResetSession = sal_True; - bProxiesModified = sal_True; } if ( SFX_ITEM_SET == rSet.GetItemState(SID_INET_NOPROXY, sal_True, &pItem)) { DBG_ASSERT(pItem->ISA(SfxStringItem), "StringItem expected"); aInetOptions.SetProxyNoProxy(((const SfxStringItem *)pItem)->GetValue()); bResetSession = sal_True; - bProxiesModified = sal_True; } // Secure-Referers @@ -993,13 +979,6 @@ void SfxApplication::NotifyEvent( const SfxEventHint& rEventHint, bool bSynchron if ( pDoc && ( pDoc->IsPreview() || !pDoc->Get_Impl()->bInitialized ) ) return; -#ifdef DBG_UTIL - //::rtl::OUString aName = SfxEventConfiguration::GetEventName_Impl( rEventHint.GetEventId() ); - //ByteString aTmp( "SfxEvent: "); - //aTmp += ByteString( String(aName), RTL_TEXTENCODING_UTF8 ); - //DBG_TRACE( aTmp.GetBuffer() ); -#endif - if ( bSynchron ) { #ifdef DBG_UTIL @@ -1020,3 +999,4 @@ void SfxApplication::NotifyEvent( const SfxEventHint& rEventHint, bool bSynchron IMPL_OBJHINT( SfxStringHint, String ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/appchild.cxx b/sfx2/source/appl/appchild.cxx index ea7b331b839b..79f5d108e4ef 100644..100755 --- 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. @@ -28,8 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" -#ifndef GCC -#endif #include <svl/whiter.hxx> #include <svl/eitem.hxx> @@ -60,17 +59,13 @@ void SfxApplication::RegisterChildWindow_Impl( SfxModule *pMod, SfxChildWinFacto if (!pAppData_Impl->pFactArr) pAppData_Impl->pFactArr = new SfxChildWinFactArr_Impl; -//#ifdef DBG_UTIL for (sal_uInt16 nFactory=0; nFactory<pAppData_Impl->pFactArr->Count(); ++nFactory) { if (pFact->nId == (*pAppData_Impl->pFactArr)[nFactory]->nId) { pAppData_Impl->pFactArr->Remove( nFactory ); -// DBG_ERROR("ChildWindow mehrfach registriert!"); -// return; } } -//#endif pAppData_Impl->pFactArr->C40_INSERT( SfxChildWinFactory, pFact, pAppData_Impl->pFactArr->Count() ); @@ -139,7 +134,7 @@ void SfxApplication::RegisterChildWindowContext_Impl( SfxModule *pMod, sal_uInt1 return; } - DBG_ERROR( "Kein ChildWindow fuer diesen Context!" ); + OSL_FAIL( "Kein ChildWindow fuer diesen Context!" ); } //-------------------------------------------------------------------- @@ -174,3 +169,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 71a6fc269c11..3b53636f1c45 100644..100755 --- 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. @@ -29,14 +30,12 @@ #include "precompiled_sfx2.hxx" #include <tools/cachestr.hxx> #include <tools/config.hxx> -#ifndef _INETSTRM_HXX //autogen #include <svl/inetstrm.hxx> -#endif #include <svl/stritem.hxx> #define _SVSTDARR_STRINGS #include <svl/svstdarr.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <vcl/menu.hxx> #include <vcl/msgbox.hxx> @@ -182,3 +181,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 26e4fecf3864..50bf2107563d 100644..100755 --- 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. @@ -40,8 +41,6 @@ #include <tools/urlobj.hxx> #include <tools/diagnose_ex.h> #include <unotools/pathoptions.hxx> -#ifndef GCC -#endif #include <sfx2/app.hxx> #include "appdata.hxx" @@ -78,9 +77,6 @@ public: virtual sal_Bool MakeTopic( const String& ); virtual String Topics(); -// virtual String Formats(); -// virtual String SysItems(); -// virtual String Status(); virtual sal_Bool SysTopicExecute( const String* pStr ); }; @@ -112,11 +108,6 @@ public: virtual sal_Bool StartAdviseLoop(); virtual sal_Bool MakeItem( const String& rItem ); -// wird benoetigt? -// virtual void Connect( long n ); -// virtual void Disconnect( long n ); -// virtual void StopAdviseLoop(); - }; @@ -364,6 +355,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 @@ -505,7 +513,6 @@ void SfxApplication::AddDdeTopic( SfxObjectShell* pSh ) for( sal_uInt16 n = pAppData_Impl->pDocTopics->Count(); n; ) if( (*pAppData_Impl->pDocTopics)[ --n ]->pSh == pSh ) { - // JP 18.03.96 - Bug 26470 // falls das Document unbenannt wurde, ist trotzdem ein // neues Topics anzulegen! if( !bFnd ) @@ -707,3 +714,4 @@ sal_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 d9ff26beccba..1748a9fac469 100644..100755 --- 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,17 @@ #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> @@ -118,22 +113,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(); @@ -148,14 +144,13 @@ void SAL_CALL SfxTerminateListener_Impl::notifyTermination( const EventObject& a xGlobalBroadcaster->notifyEvent(aEvent2); } - //pApp->Deinitialize(); delete pApp; Application::Quit(); } ::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; } @@ -182,7 +177,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; @@ -207,7 +202,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; @@ -306,10 +301,12 @@ bool 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 64c6673bbafb..b2017fa94887 100644..100755 --- 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. @@ -28,8 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" -//#define TF_NEWDESKTOP - #define _SDINTERN_HXX #include <stdio.h> @@ -40,7 +39,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 +83,7 @@ DBG_NAME(SfxAppMainCHAOSReg) //=================================================================== #ifdef TF_POOLABLE -static SfxItemInfo __READONLY_DATA aItemInfos[] = +static SfxItemInfo const aItemInfos[] = { { 0, 0 } }; @@ -161,3 +159,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 eafe9d262189..ce7c4f8e5547 100644..100755 --- 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. @@ -29,8 +30,6 @@ #include "precompiled_sfx2.hxx" #include <vcl/status.hxx> #include <vcl/msgbox.hxx> -#include <vos/process.hxx> -#include <vos/xception.hxx> #include <svl/whiter.hxx> #include <svl/stritem.hxx> #include <svl/intitem.hxx> @@ -46,7 +45,7 @@ #include <com/sun/star/uno/Reference.h> #include <tools/config.hxx> #include <tools/rcid.h> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <unotools/configmgr.hxx> #include <com/sun/star/frame/XDesktop.hpp> #include <unotools/ucbstreamhelper.hxx> @@ -86,7 +85,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; @@ -265,7 +263,7 @@ SfxModule* SfxApplication::GetModule_Impl() return pModule; else { - DBG_ERROR( "No module!" ); + OSL_FAIL( "No module!" ); return NULL; } } @@ -285,8 +283,6 @@ SfxResourceManager& SfxApplication::GetResourceManager() const { return *pAppDat sal_Bool SfxApplication::IsDowning() const { return pAppData_Impl->bDowning; } SfxDispatcher* SfxApplication::GetAppDispatcher_Impl() { return pAppData_Impl->pAppDispat; } SfxSlotPool& SfxApplication::GetAppSlotPool_Impl() const { return *pAppData_Impl->pSlotPool; } -//SfxOptions& SfxApplication::GetOptions() { return *pAppData_Impl->pOptions; } -//const SfxOptions& SfxApplication::GetOptions() const { return *pAppData_Impl->pOptions; } static bool impl_loadBitmap( const rtl::OUString &rPath, const rtl::OUString &rBmpFileName, @@ -356,3 +352,4 @@ Image SfxApplication::GetApplicationLogo() return aAppLogo; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index 281a87c962f7..2b3f35d06170 100644..100755 --- 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> @@ -300,7 +301,6 @@ private: sal_uInt32 CheckPasswd_Impl ( - //Window *pWin, // Parent des Dialogs SfxObjectShell* pDoc, SfxItemPool& /*rPool*/, // Pool, falls ein Set erzeugt werden mus SfxMedium* pFile // das Medium, dessen Passwort gfs. erfragt werden soll @@ -327,16 +327,13 @@ 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& ) { // TODO/LATER: // the storage either has no encrypted elements or it's just // does not allow to detect it, probably it should be implemented laiter - /* - bIsEncrypted = ( aInfo.Load( xStorage ) && aInfo.IsPasswd() ); - */ } if ( bIsEncrypted ) @@ -490,8 +487,6 @@ sal_uIntPtr SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const String xDoc->GetStorage()->copyToStorage( xTempStorage ); -//REMOVE // the following operations should be done in one step -//REMOVE xDoc->DoHandsOff(); if ( !xDoc->DoSaveCompleted( new SfxMedium( xTempStorage, String() ) ) ) throw uno::RuntimeException(); } @@ -520,7 +515,6 @@ sal_uIntPtr SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const String SfxItemSet* pNew = xDoc->GetMedium()->GetItemSet()->Clone(); pNew->ClearItem( SID_PROGRESS_STATUSBAR_CONTROL ); pNew->ClearItem( SID_FILTER_NAME ); - //pNew->Put( SfxStringItem( SID_FILTER_NAME, xDoc->GetFactory().GetFilter(0)->GetFilterName() ) ); ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgs; TransformItems( SID_OPENDOC, *pNew, aArgs ); sal_Int32 nLength = aArgs.getLength(); @@ -679,6 +673,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(); @@ -909,13 +926,6 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) rReq.AppendItem( SfxBoolItem( SID_PREVIEW, sal_True ) ); } - if ( STRING_NOTFOUND != aFileFlags.Search( 0x0053 ) ) // S = 53h - { - // not supported anymore - //rReq.RemoveItem( SID_SILENT ); - //rReq.AppendItem( SfxBoolItem( SID_SILENT, sal_True ) ); - } - rReq.RemoveItem( SID_OPTIONS ); } @@ -924,7 +934,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,49 +943,16 @@ 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(); SvtExtendedSecurityOptions aExtendedSecurityOptions; SvtExtendedSecurityOptions::OpenHyperlinkMode eMode = aExtendedSecurityOptions.GetOpenHyperlinkMode(); - if ( eMode == SvtExtendedSecurityOptions::OPEN_WITHSECURITYCHECK ) - { - if ( aINetProtocol == INET_PROT_FILE ) - { -/*!!! pb: #i49802# no security warning any longer - // Check if file URL is a directory. This is not insecure! - osl::Directory aDir( aURL.Main ); - sal_Bool bIsDir = ( aDir.open() == osl::Directory::E_None ); - - if ( !bIsDir && !aExtendedSecurityOptions.IsSecureHyperlink( aURL.Complete ) ) - { - // Security check for local files depending on the extension - vos::OGuard aGuard( Application::GetSolarMutex() ); - Window *pWindow = SFX_APP()->GetTopWindow(); - - String aSecurityWarningBoxTitle( SfxResId( RID_SECURITY_WARNING_TITLE )); - WarningBox aSecurityWarningBox( pWindow, SfxResId( RID_SECURITY_WARNING_HYPERLINK )); - aSecurityWarningBox.SetText( aSecurityWarningBoxTitle ); - - // Replace %s with the real file name - String aMsgText = aSecurityWarningBox.GetMessText(); - String aMainURL( aURL.Main ); - String aFileName; - - utl::LocalFileHelper::ConvertURLToPhysicalName( aMainURL, aFileName ); - aMsgText.SearchAndReplaceAscii( "%s", aFileName ); - aSecurityWarningBox.SetMessText( aMsgText ); - if( aSecurityWarningBox.Execute() == RET_NO ) - return; - } -*/ - } - } - else if ( eMode == SvtExtendedSecurityOptions::OPEN_NEVER && aINetProtocol != INET_PROT_VND_SUN_STAR_HELP ) + 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 +965,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 +990,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 +1009,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 +1028,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 +1073,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 +1081,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 +1165,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)) ); } @@ -1217,8 +1194,6 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) } Reference < XController > xController; -// if ( ( !bIsBlankTarget && pFrame ) || pLinkItem || !rReq.IsSynchronCall() ) -// { // if a frame is given, it must be used for the starting point of the targetting mechanism // this code is also used if asynchronous loading is possible, because loadComponent always is synchron if ( !xTargetFrame.is() ) @@ -1229,7 +1204,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) } else { - xTargetFrame.set( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop")), UNO_QUERY ); + xTargetFrame.set( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop"))), UNO_QUERY ); } } @@ -1255,15 +1230,11 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) { // if loading must be done synchron, we must wait for completion to get a return value // find frame by myself; I must konw the exact frame to get the controller for the return value from it - //if( aTarget.getLength() ) - // xTargetFrame = xTargetFrame->findFrame( aTarget, FrameSearchFlag::ALL ); Reference < XComponent > xComp; try { xComp = ::comphelper::SynchronousDispatch::dispatch( xTargetFrame, aFileName, aTarget, 0, aArgs ); -// Reference < XComponentLoader > xLoader( xTargetFrame, UNO_QUERY ); -// xComp = xLoader->loadComponentFromURL( aFileName, aTarget, 0, aArgs ); } catch(const RuntimeException&) { @@ -1284,7 +1255,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 ); @@ -1293,37 +1264,6 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) if ( xDisp.is() ) xDisp->dispatch( aURL, aArgs ); } - /* - } - else - { - // synchron loading without a given frame or as blank frame - SFX_REQUEST_ARG( rReq, pFileNameItem, SfxStringItem, SID_FILE_NAME, sal_False ); - - // 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 < XComponent > xComp; - try - { - xComp = xDesktop->loadComponentFromURL( pFileNameItem->GetValue(), aTarget, 0, aArgs ); - } - catch(const RuntimeException&) - { - throw; - } - catch(const ::com::sun::star::uno::Exception&) - { - xDesktop.clear(); - xComp.clear(); - } - - Reference < XModel > xModel( xComp, UNO_QUERY ); - if ( xModel.is() ) - xController = xModel->getCurrentController(); - else - xController = Reference < XController >( xComp, UNO_QUERY ); - }*/ if ( xController.is() ) { @@ -1357,3 +1297,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 351376091929..6a42effd35ff 100644..100755 --- 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. @@ -31,17 +32,12 @@ #include <basic/sbstar.hxx> #include <svl/svdde.hxx> -#ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> -#endif #include <svl/eitem.hxx> #include <unotools/saveopt.hxx> #include <unotools/misccfg.hxx> -#ifndef GCC -#endif - #include "app.hrc" #include <sfx2/app.hxx> #include <sfx2/evntconf.hxx> @@ -113,8 +109,6 @@ void SfxApplication::Deinitialize() // this method. Therefore this call makes no sense and is the source of // some stack traces, which we don't understand. // For more information see: - // #123501# - //SetViewFrame(0); pAppData_Impl->bDowning = sal_False; DBG_ASSERT( !SfxViewFrame::GetFirst(), "existing SfxViewFrame after Execute" ); @@ -168,3 +162,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 dfecc21f9d4b..5cacf651ec99 100644..100755 --- 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 3e9629149d2a..ca68aea830ce 100644..100755 --- 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. @@ -47,6 +48,8 @@ #include <com/sun/star/system/SystemShellExecuteFlags.hpp> #include <com/sun/star/system/SystemShellExecuteException.hpp> +#include <com/sun/star/frame/XComponentLoader.hpp> + #include <comphelper/processfactory.hxx> #include <comphelper/storagehelper.hxx> #include "comphelper/configurationhelper.hxx" @@ -70,15 +73,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> @@ -151,10 +155,49 @@ long QuitAgain_Impl( void* pObj, void* pArg ) return 0; } +/// Find the correct location of the document (LICENSE.odt, etc.), and return +/// it in rURL if found. +static sal_Bool checkURL( const char *pName, const char *pExt, rtl::OUString &rURL ) +{ + using namespace osl; + DirectoryItem aDirItem; + + rURL = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR/") ); + rURL += rtl::OUString::createFromAscii( pName ); + rURL += rtl::OUString::createFromAscii( pExt ); + rtl::Bootstrap::expandMacros( rURL ); + + if (rURL.getLength() != 0) + return DirectoryItem::get( rURL, aDirItem ) == DirectoryItem::E_None; + else + return sal_False; +} + +/// Displays CREDITS or LICENSE in any of the available version +static void showDocument( const char* pBaseName ) +{ + 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; + if ( checkURL ( pBaseName, ".odt", aURL ) || + checkURL ( pBaseName, ".html", aURL ) || + checkURL ( pBaseName, "", aURL ) ) { + xLoader->loadComponentFromURL( aURL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_blank")), 0, args ); + } + } catch (const ::com::sun::star::uno::Exception &) { + } +} + void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) { DBG_MEMTEST(); - bool bDone = sal_False; + bool bDone = false; switch ( rReq.GetSlot() ) { case SID_SETOPTIONS: @@ -266,7 +309,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) const short nRet = pDlg->Execute(); if ( nRet ) - bDone = sal_True; + bDone = true; delete pDlg; } @@ -305,14 +348,13 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) sal_Bool bOk = ( n == 0); rReq.SetReturnValue( SfxBoolItem( 0, bOk ) ); - bDone = sal_True; + bDone = true; break; } case SID_SAVEDOCS: { sal_Bool bOK = sal_True; - sal_Bool bTmpDone = sal_True; for ( SfxObjectShell *pObjSh = SfxObjectShell::GetFirst(); pObjSh; pObjSh = SfxObjectShell::GetNext( *pObjSh ) ) @@ -322,7 +364,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 = sal_False; } @@ -333,26 +374,62 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) break; } + case SID_SHOW_LICENSE: + { + ModalDialog aDialog( NULL, SfxResId( DLG_HELP_LICENSING ) ); + + String aLicensing; + for ( int i = STR_LICENSING_INFORMATION_1; i <= STR_LICENSING_INFORMATION_5; ++i ) + { + if ( i != STR_LICENSING_INFORMATION_1 ) + aLicensing += String( RTL_CONSTASCII_USTRINGPARAM( "\n\n" ) ); + aLicensing += String( SfxResId( i ) ); + } + + FixedText aText( &aDialog ); + aText.SetText( aLicensing ); + OKButton aShow( &aDialog, SfxResId( PB_LICENSING_SHOW ) ); + CancelButton aClose( &aDialog, SfxResId( PB_LICENSING_CLOSE ) ); + + // positions and sizes are computed to always fit the language + Size aTextSize( aText.GetOptimalSize( WINDOWSIZE_PREFERRED ) ); + Size aShowSize( aShow.GetOptimalSize( WINDOWSIZE_PREFERRED ) ); + Size aCloseSize( aClose.GetOptimalSize( WINDOWSIZE_PREFERRED ) ); + + long nDelimX = 12; + long nDelimY = 12; + long nWidth = aTextSize.Width() + 2*nDelimX; + long nButtonY = aTextSize.Height() + 2*nDelimY; + Size aButtonSize( std::max( aShowSize.Width(), aCloseSize.Width() ) + nDelimX, + std::max( aShowSize.Height(), aCloseSize.Height() ) ); + + aDialog.SetSizePixel( Size( nWidth, aTextSize.Height() + 3*nDelimY + aButtonSize.Height() ) ); + aText.SetPosSizePixel( Point( nDelimX, nDelimY ), aTextSize ); + aShow.SetPosSizePixel( Point( ( nWidth - nDelimX ) / 2 - aButtonSize.Width(), nButtonY ), aButtonSize ); + aClose.SetPosSizePixel( Point( aShow.GetPosPixel().X() + aButtonSize.Width() + nDelimX, nButtonY ), aButtonSize ); + + aText.Show(); + + if ( aDialog.Execute() == RET_OK ) + showDocument( "LICENSE" ); + + break; + } + + case SID_SHOW_CREDITS: + { + showDocument( "CREDITS" ); + break; + } + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - case SID_HELPINDEX: - case SID_HELP_SUPPORTPAGE: { Help* pHelp = Application::GetHelp(); if ( pHelp ) { - if ( rReq.GetSlot() == SID_HELP_SUPPORTPAGE ) - { - // show Support page with new URL - String sHelpURL = SfxHelp::CreateHelpURL( String::CreateFromAscii(".uno:HelpSupport"), String() ); - String sParams = sHelpURL.Copy( sHelpURL.Search( '?' ) ); - sHelpURL = String::CreateFromAscii("vnd.sun.star.help://shared/text/shared/05/00000001.xhp"); - sHelpURL += sParams; - sHelpURL += String::CreateFromAscii("&UseDB=no"); - pHelp->Start( sHelpURL, NULL ); - } - else - pHelp->Start( String::CreateFromAscii(".uno:HelpIndex"), NULL ); // show start page - bDone = sal_True; + pHelp->Start( String::CreateFromAscii(".uno:HelpIndex"), NULL ); // show start page + bDone = true; } break; } @@ -373,7 +450,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) Help::DisableQuickHelp(); SvtHelpOptions().SetHelpTips( bOn ); Invalidate(SID_HELPTIPS); - bDone = sal_True; + bDone = true; // ggf. recorden if ( !rReq.IsAPI() ) @@ -401,7 +478,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) Help::DisableBalloonHelp(); SvtHelpOptions().SetExtendedHelp( bOn ); Invalidate(SID_HELPBALLOONS); - bDone = sal_True; + bDone = true; // ggf. recorden if ( !rReq.IsAPI() ) @@ -419,7 +496,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) : !aHelpOpt.IsHelpAgentAutoStartMode(); aHelpOpt.SetHelpAgentAutoStartMode( bOn ); Invalidate(SID_HELP_PI); - bDone = sal_True; + bDone = true; break; } @@ -432,7 +509,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) VclAbstractDialog* pDlg = pFact->CreateVclDialog( 0, RID_DEFAULTABOUT ); pDlg->Execute(); delete pDlg; - bDone = sal_True; + bDone = true; } break; } @@ -444,7 +521,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) new SfxTemplateOrganizeDlg(NULL); pDlg->Execute(); delete pDlg; - bDone = sal_True; + bDone = true; break; } @@ -452,7 +529,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) { svt::AddressBookSourceDialog aDialog(GetTopWindow(), ::comphelper::getProcessServiceFactory()); aDialog.Execute(); - bDone = sal_True; + bDone = true; break; } @@ -580,6 +657,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); @@ -656,7 +745,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; } @@ -770,7 +859,7 @@ namespace { Reference < XFrame > xFrame( xContainer->getByIndex(i), UNO_QUERY_THROW ); ::rtl::OUString sModule = xCheck->identify( xFrame ); - if ( sModule.equalsAscii( "com.sun.star.frame.StartModule" ) ) + if ( sModule.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.frame.StartModule" ) ) ) return xFrame; } catch( const UnknownModuleException& ) @@ -841,12 +930,18 @@ 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 ) { - pView->GetBindings().InvalidateAll(sal_False); + if (nRet == RET_OK) + { + SfxObjectShell* pObjSh = pView->GetObjectShell(); + if (pObjSh) + pObjSh->SetConfigOptionsChecked(false); + } + pView->GetBindings().InvalidateAll(FALSE); pView = SfxViewFrame::GetNext( *pView ); } } @@ -866,9 +961,9 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) // read repository URL from configuration ::rtl::OUString sTemplRepoURL = getConfigurationStringValue( - ::rtl::OUString::createFromAscii("org.openoffice.Office.Common"), - ::rtl::OUString::createFromAscii("Dictionaries"), - ::rtl::OUString::createFromAscii("RepositoryURL"), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Common")), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Dictionaries")), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RepositoryURL")), ::rtl::OUString()); if ( xSystemShell.is() && sTemplRepoURL.getLength() > 0 ) @@ -879,10 +974,10 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) // read locale from configuration ::rtl::OUString sLocale = getConfigurationStringValue( - ::rtl::OUString::createFromAscii("org.openoffice.Setup"), - ::rtl::OUString::createFromAscii("L10N"), - ::rtl::OUString::createFromAscii("ooLocale"), - ::rtl::OUString::createFromAscii("en-US")); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Setup")), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("L10N")), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooLocale")), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en-US"))); aURLBuf.append( sLocale ); xSystemShell->execute( @@ -912,12 +1007,12 @@ 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& ) { - DBG_ERROR( "OfficeApplication::ExecuteApp_Impl(SID_ONLINE_REGISTRATION): caught an exception!" ); + OSL_FAIL( "OfficeApplication::ExecuteApp_Impl(SID_ONLINE_REGISTRATION): caught an exception!" ); } } break; @@ -1152,13 +1247,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; @@ -1182,13 +1277,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; @@ -1270,3 +1365,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 9ffb48e1b34a..8f68e21a2453 100644..100755 --- 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. @@ -135,7 +136,6 @@ using namespace ::com::sun::star::io; #include <ownsubfilterservice.hxx> #include "SfxDocumentMetaData.hxx" -#define FRAMELOADER_SERVICENAME "com.sun.star.frame.FrameLoader" #define PROTOCOLHANDLER_SERVICENAME "com.sun.star.frame.ProtocolHandler" static char const sTemplateRegionName[] = "TemplateRegionName"; @@ -145,6 +145,7 @@ static char const sOpenNewView[] = "OpenNewView"; static char const sViewId[] = "ViewId"; static char const sPluginMode[] = "PluginMode"; static char const sReadOnly[] = "ReadOnly"; +static char const sDdeReconnect[] = "DDEReconnect"; static char const sStartPresentation[] = "StartPresentation"; static char const sFrameName[] = "FrameName"; static char const sMediaType[] = "MediaType"; @@ -608,6 +609,14 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxBoolItem( SID_DOC_READONLY, bVal ) ); } + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sDdeReconnect)) ) + { + sal_Bool bVal = sal_True; + sal_Bool bOK = (rProp.Value >>= bVal); + DBG_ASSERT( bOK, "invalid type for DDEReconnect" ); + if (bOK) + rSet.Put( SfxBoolItem( SID_DDE_RECONNECT_ONLOAD, bVal ) ); + } else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sStartPresentation)) ) { sal_Bool bVal = sal_False; @@ -875,7 +884,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 +906,6 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque } } } - // <-- #ifdef DB_UTIL if ( nFoundArgs == nCount ) { @@ -1027,6 +1035,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 ) @@ -1266,7 +1276,6 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta sal_uInt16 nSubCount = pType->nAttribs; if ( !nSubCount ) { - //rPool.FillVariable( *pItem, *pVar, eUserMetric ); pValue[nActProp].Name = String( String::CreateFromAscii( pSlot->pUnoName ) ) ; if ( !pItem->QueryValue( pValue[nActProp].Value ) ) { @@ -1280,7 +1289,6 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta // complex type, add a property value for every member of the struct for ( sal_uInt16 n=1; n<=nSubCount; ++n ) { - //rPool.FillVariable( *pItem, *pVar, eUserMetric ); sal_uInt8 nSubId = (sal_uInt8) (sal_Int8) pType->aAttrib[n-1].nAID; if ( bConvertTwips ) nSubId |= CONVERT_TWIPS; @@ -1317,7 +1325,6 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta sal_uInt16 nSubCount = rArg.pType->nAttribs; if ( !nSubCount ) { - //rPool.FillVariable( *pItem, *pVar, eUserMetric ); pValue[nActProp].Name = String( String::CreateFromAscii( rArg.pName ) ) ; if ( !pItem->QueryValue( pValue[nActProp++].Value ) ) { @@ -1331,7 +1338,6 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta // complex type, add a property value for every member of the struct for ( sal_uInt16 n = 1; n <= nSubCount; ++n ) { - //rPool.FillVariable( rItem, *pVar, eUserMetric ); sal_uInt8 nSubId = (sal_uInt8) (sal_Int8) rArg.pType->aAttrib[n-1].nAID; if ( bConvertTwips ) nSubId |= CONVERT_TWIPS; @@ -1456,6 +1462,11 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sReadOnly)); pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); } + if ( rSet.GetItemState( SID_DDE_RECONNECT_ONLOAD, sal_False, &pItem ) == SFX_ITEM_SET ) + { + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sDdeReconnect)); + pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); + } if ( rSet.GetItemState( SID_DOC_STARTPRESENTATION, sal_False, &pItem ) == SFX_ITEM_SET ) { pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sStartPresentation)); @@ -1688,7 +1699,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 +1744,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; @@ -1980,7 +1991,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(); @@ -2015,7 +2026,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 ) @@ -2139,6 +2150,16 @@ SFX2_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment( *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ; } + + + // writer compatable document properties + aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); + aImpl += comp_CompatWriterDocProps::_getImplementationName(); + + aTempStr = aImpl; + aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); + xNewKey = xKey->createKey( aTempStr ); + xNewKey->createKey( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.writer.DocumentProperties")) ); SFX2_DLLPUBLIC void* SAL_CALL component_getFactory( const sal_Char* pImplementationName , void* pServiceManager , @@ -2177,13 +2198,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 ) @@ -2195,6 +2209,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() ) @@ -2396,3 +2420,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 2af0e9c179e2..4be2c1008214 100644..100755 --- 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,21 +29,14 @@ // 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> #include <com/sun/star/frame/XController.hpp> #include <com/sun/star/frame/XFrame.hpp> #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" @@ -311,8 +305,6 @@ void SfxChildWindow::SaveStatus(const SfxChildWinInfo& rInfo) } SvtViewOptions aWinOpt( E_WINDOW, String::CreateFromInt32( nID ) ); - // aWinOpt.SetPosition( rInfo.aPos.X(), rInfo.aPos.Y() ); - // aWinOpt.SetSize( rInfo.aSize.Width(), rInfo.aSize.Height() ); aWinOpt.SetWindowState( String( rInfo.aWinState, RTL_TEXTENCODING_UTF8 ) ); ::com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue > aSeq(1); @@ -378,43 +370,6 @@ sal_uInt16 SfxChildWindow::GetPosition() return pImp->pFact->nPos; } -#if 0 -static void ImplWindowStateFromStr( Point rPos, Size rSize, const ByteString& rStr ) -{ - sal_uIntPtr 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 ) { @@ -454,9 +409,6 @@ void SfxChildWindow::InitializeChildWinFactory_Impl( sal_uInt16 nId, SfxChildWin aWinData.Erase(0,nPos+1); - //aWinOpt.GetPosition( rInfo.aPos.X(), rInfo.aPos.Y() ); - //aWinOpt.GetSize( rInfo.aSize.Width(), rInfo.aSize.Height() ); - // Sichtbarkeit laden: ist als ein char codiert rInfo.bVisible = (aWinData.GetChar(0) == 0x0056); // 'V' = 56h aWinData.Erase(0,1); @@ -552,7 +504,7 @@ void SfxChildWindow::CreateContext( sal_uInt16 nContextId, SfxBindings& rBinding if ( !pCon ) { - DBG_ERROR( "Kein geeigneter Context gefunden!" ); + OSL_FAIL( "Kein geeigneter Context gefunden!" ); return; } @@ -587,7 +539,7 @@ FloatingWindow* SfxChildWindowContext::GetFloatingWindow() const } else { - DBG_ERROR("Kein FloatingWindow-Context!"); + OSL_FAIL("Kein FloatingWindow-Context!"); return NULL; } } @@ -777,20 +729,14 @@ void SfxChildWindow::SetWorkWindow_Impl( SfxWorkWindow* pWin ) pImp->pWorkWin->SetActiveChild_Impl( pWindow ); } -//SfxWorkWindow* SfxChildWindow::GetWorkWindow_Impl() const -//{ -// return pImp->pWorkWin; -//} - void SfxChildWindow::Activate_Impl() { - if(pImp->pWorkWin!=NULL) //@#60568# + if(pImp->pWorkWin!=NULL) pImp->pWorkWin->SetActiveChild_Impl( pWindow ); } void SfxChildWindow::Deactivate_Impl() { -// pImp->pWorkWin->SetActiveChild_Impl( NULL ); } sal_Bool SfxChildWindow::QueryClose() @@ -853,3 +799,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/dde.hrc b/sfx2/source/appl/dde.hrc index d3e178606809..d3e178606809 100644..100755 --- a/sfx2/source/appl/dde.hrc +++ b/sfx2/source/appl/dde.hrc diff --git a/sfx2/source/appl/dde.src b/sfx2/source/appl/dde.src index 18f6517f181c..18f6517f181c 100644..100755 --- a/sfx2/source/appl/dde.src +++ b/sfx2/source/appl/dde.src diff --git a/sfx2/source/appl/fileobj.cxx b/sfx2/source/appl/fileobj.cxx index a2b29344f52c..6380194e403d 100644..100755 --- 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. @@ -126,13 +127,11 @@ sal_Bool SvFileObject::GetData( ::com::sun::star::uno::Any & rData, { Graphic aGrf; - //JP 15.07.98: Bug 52959 // falls das Nativformat doch erwuenscht ist, muss am // Ende das Flag zurueckgesetzt werden. // wird einzig und allein im sw/ndgrf.cxx benutzt, wenn der Link vom // GraphicNode entfernt wird. sal_Bool bOldNativFormat = bNativFormat; -//!!?? bNativFormat = 0 != (ASPECT_ICON & pSvData->GetAspect()); // falls gedruckt werden soll, warten wir bis die // Daten vorhanden sind @@ -290,7 +289,6 @@ sal_Bool SvFileObject::LoadFile_Impl() xMed->setStreamToLoadFrom( aStreamToLoadFrom.m_xInputStreamToLoadFrom, aStreamToLoadFrom.m_bIsReadOnly); - // setStreamToLoadFrom(0,0); if( sReferer.Len() ) xMed->SetReferer( sReferer ); @@ -418,7 +416,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 +433,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 +702,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 0510f38092bd..6b4ff850ec53 100644..100755 --- 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 1909bcac2e17..60ae5499cc8e 100644..100755 --- 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 2e1128aea277..4a7a2f5c0254 100644..100755 --- 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 b9d1e7b17b63..f99c054a3063 100644..100755 --- 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 4f24ecb21355..3337e17562f4 100644..100755 --- 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 ( sal_uInt16 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; - sal_uIntPtr nCount = m_pHistory->Count(); + + size_t nCount = m_pHistory->size(); if ( nCount && m_nCurPos < ( nCount - 1 ) ) { - for ( sal_uIntPtr 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 ), ((sal_uIntPtr)0x0) ); - m_nCurPos = m_pHistory->Count() - 1; + m_pHistory->insert( m_pHistory->begin(), new HelpHistoryEntry_Impl( rURL, aEmptyViewData, (sal_uIntPtr)0x0 ) ); + 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 ) ); } @@ -159,9 +169,7 @@ Reference< XDispatch > SAL_CALL HelpInterceptor_Impl::queryDispatch( if ( m_xSlaveDispatcher.is() ) xResult = m_xSlaveDispatcher->queryDispatch( aURL, aTargetFrameName, nSearchFlags ); - // INetURLObject aObj( aURL.Complete ); - // sal_Bool bHelpURL = ( aObj.GetProtocol() == INET_PROT_VND_SUN_STAR_HELP ); - sal_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 +265,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 +273,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(); } } sal_uIntPtr 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 +341,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 5a6f0d024c20..e912fcdf2364 100644..100755 --- 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> @@ -38,8 +37,8 @@ #include <cppuhelper/implbase1.hxx> #include <com/sun/star/frame/XStatusListener.hpp> #include <tools/string.hxx> -#include <tools/list.hxx> #include <tools/link.hxx> +#include <vector> struct HelpHistoryEntry_Impl { @@ -50,7 +49,7 @@ struct HelpHistoryEntry_Impl 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< @@ -171,3 +170,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 af8086f4e046..d4c410a2a7ac 100644..100755 --- 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. @@ -52,7 +53,7 @@ #include <sfx2/objsh.hxx> #include <sfx2/docfac.hxx> -#include <hash_map> +#include <boost/unordered_map.hpp> using namespace ::com::sun::star::uno; using namespace ::com::sun::star::frame; @@ -61,17 +62,17 @@ using namespace ::com::sun::star::util; using namespace ::com::sun::star::ui; using namespace ::com::sun::star::frame; -typedef std::hash_map< ::rtl::OUString, +typedef boost::unordered_map< ::rtl::OUString, WeakReference< XImageManager >, ::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, sal_Bool bBig, sal_Bool bHiContrast ) +Image SAL_CALL GetImage( + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, + const ::rtl::OUString& aURL, + bool bBig +) { // TODO/LATeR: shouldn't this become a method at SfxViewFrame?! That would save the UnoTunnel if ( !rFrame.is() ) @@ -90,22 +91,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 ); - sal_uInt16 nId = ( sal_uInt16 ) aTargetURL.Path.toInt32();*/ sal_uInt16 nId = ( sal_uInt16 ) String(aURL).Copy(5).ToInt32(); const SfxSlot* pSlot = 0; if ( xModel.is() ) @@ -147,8 +132,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 +153,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 +173,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 +213,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 +222,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 07eb47bd92ad..b5126744aa50 100644..100755 --- 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; @@ -158,7 +159,7 @@ void SAL_CALL ImeStatusWindow::propertyChange(css::beans::PropertyChangeEvent const & ) throw (css::uno::RuntimeException) { - vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; SfxApplication* pApp = SfxApplication::Get(); if (pApp) pApp->Invalidate(SID_SHOW_IME_STATUS_WINDOW); @@ -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 4edba523ed30..184cdc721a6b 100644..100755 --- 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 df8ae4b8b425..20afe00dce15 100644..100755 --- 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. @@ -127,9 +128,6 @@ IMPL_STATIC_LINK( SvDDELinkEditDialog, EditHdl_Impl, Edit *, pEdit ) return 0; } -/* */ - - SvDDEObject::SvDDEObject() : pConnection( 0 ), pLink( 0 ), pRequest( 0 ), pGetData( 0 ), nError( 0 ) { @@ -151,7 +149,7 @@ sal_Bool SvDDEObject::GetData( ::com::sun::star::uno::Any & rData /*out param*/, if( !pConnection ) return sal_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 +160,13 @@ sal_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 sal_False; - // Verriegeln gegen Reentrance + // Lock against Reentrance bWaitForData = sal_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 +186,7 @@ sal_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( pRequest ) delete pRequest; @@ -215,9 +212,9 @@ sal_Bool SvDDEObject::Connect( SvBaseLink * pSvLink ) static sal_Bool bInWinExec = sal_False; #endif sal_uInt16 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 +239,8 @@ sal_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" ) ) { sal_Bool bSysTopic; @@ -255,12 +254,12 @@ sal_Bool SvDDEObject::Connect( SvBaseLink * pSvLink ) nError = DDELINK_ERROR_DATA; return sal_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 +298,7 @@ sal_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 +351,22 @@ sal_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; } sal_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 +396,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 +420,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 +432,17 @@ IMPL_LINK( SvDDEObject, ImplDoneDDEData, void*, pData ) } else if( pReq == pRequest ) { - // das wars dann bWaitForData = sal_False; } } } else - // das warten ist beendet + // End waiting bWaitForData = sal_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 4494cb9c20fa..3a2a84c2b685 100644..100755 --- 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; - sal_uInt8 bWaitForData : 1; // wird auf Daten gewartet? - sal_uInt8 nError : 7; // Error Code fuer den Dialog + sal_uInt8 bWaitForData : 1; // waiting for data? + sal_uInt8 nError : 7; // Error code for dialogue sal_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 e689b3f22282..6b163fda68fd 100644..100755 --- 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. @@ -55,6 +56,16 @@ #define _SVSTDARR_STRINGSDTOR #include <svl/svstdarr.hxx> +#include <com/sun/star/lang/XComponent.hpp> +#include <com/sun/star/util/XCloseable.hpp> + +using ::com::sun::star::uno::UNO_QUERY; +using ::com::sun::star::uno::Reference; +using ::com::sun::star::lang::XComponent; +using ::com::sun::star::util::XCloseable; +using ::rtl::OUString; +using ::rtl::OUStringBuffer; + namespace sfx2 { @@ -89,16 +100,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 = sal_False; SvBaseLinkRef** ppRef = (SvBaseLinkRef**)aLinkTbl.GetData(); for( sal_uInt16 n = aLinkTbl.Count(); n; --n, ++ppRef ) @@ -111,7 +140,7 @@ void LinkManager::Remove( SvBaseLink *pLink ) bFound = sal_True; } - // falls noch leere rum stehen sollten, weg damit + // Remove emty ones if they exist if( !(*ppRef)->Is() ) { delete *ppRef; @@ -148,7 +177,7 @@ void LinkManager::Remove( sal_uInt16 nPos, sal_uInt16 nCnt ) sal_Bool LinkManager::Insert( SvBaseLink* pLink ) { - // keine Links doppelt einfuegen + // No duplicate links inserted for( sal_uInt16 n = 0; n < aLinkTbl.Count(); ++n ) { SvBaseLinkRef* pTmp = aLinkTbl[ n ]; @@ -171,7 +200,7 @@ sal_Bool LinkManager::InsertLink( SvBaseLink * pLink, sal_uInt16 nUpdateMode, const String* pName ) { - // unbedingt zuerst + // This First pLink->SetObjType( nObjType ); if( pName ) pLink->SetName( *pName ); @@ -210,7 +239,7 @@ sal_Bool LinkManager::InsertDDELink( SvBaseLink * pLink ) } -// erfrage die Strings fuer den Dialog +// Obtain the string for the dialog sal_Bool LinkManager::GetDisplayNames( const SvBaseLink * pLink, String* pType, String* pFile, @@ -283,8 +312,8 @@ void LinkManager::UpdateAllLinks( 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 ); sal_uInt16 n; for( n = 0; n < aLinkTbl.Count(); ++n ) @@ -302,7 +331,7 @@ void LinkManager::UpdateAllLinks( { SvBaseLink* pLink = (SvBaseLink*)aTmpArr[ n ]; - // suche erstmal im Array nach dem Eintrag + // search first in the array after the entry sal_uInt16 nFndPos = USHRT_MAX; for( sal_uInt16 i = 0; i < aLinkTbl.Count(); ++i ) if( pLink == *aLinkTbl[ i ] ) @@ -312,9 +341,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 +352,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 = sal_False; // einmal reicht + return ; // nothing should be updated + bAskUpdate = sal_False // once is enough } pLink->Update(); } + CloseCachedComps(); } /************************************************************************ |* SvBaseLink::CreateObject() |* -|* Beschreibung +|* Description *************************************************************************/ SvLinkSourceRef LinkManager::CreateObj( SvBaseLink * pLink ) @@ -356,7 +386,7 @@ SvLinkSourceRef LinkManager::CreateObj( SvBaseLink * pLink ) sal_Bool LinkManager::InsertServer( SvLinkSource* pObj ) { - // keine doppelt einfuegen + // no duplicate inserts if( !pObj || USHRT_MAX != aServerTbl.GetPos( pObj ) ) return sal_False; @@ -387,7 +417,57 @@ void MakeLnkName( String& rName, const String* pType, const String& rFile, ((rName += cTokenSeperator ) += *pFilter).EraseLeadingChars().EraseTrailingChars(); } -sal_Bool LinkManager::InsertFileLink( sfx2::SvBaseLink& rLink, +void LinkManager::ReconnectDdeLink(SfxObjectShell& rServer) +{ + SfxMedium* pMed = rServer.GetMedium(); + if (!pMed) + return; + + const ::sfx2::SvBaseLinks& rLinks = GetLinks(); + sal_uInt16 n = rLinks.Count(); + + for (sal_uInt16 i = 0; i < n; ++i) + { + ::sfx2::SvBaseLink* p = *rLinks[i]; + String aType, aFile, aLink, aFilter; + if (!GetDisplayNames(p, &aType, &aFile, &aLink, &aFilter)) + continue; + + if (!aType.EqualsAscii("soffice")) + // DDE connections between OOo apps are always named 'soffice'. + continue; + + String aTmp; + OUString aURL = aFile; + if (utl::LocalFileHelper::ConvertPhysicalNameToURL(aFile, aTmp)) + aURL = aTmp; + + if (!aURL.equalsIgnoreAsciiCase(pMed->GetName())) + // This DDE link is not associated with this server shell... Skip it. + continue; + + if (!aLink.Len()) + continue; + + LinkServerShell(aLink, rServer, *p); + } +} + +void LinkManager::LinkServerShell(const OUString& rPath, SfxObjectShell& rServer, ::sfx2::SvBaseLink& rLink) const +{ + ::sfx2::SvLinkSource* pSrvSrc = rServer.DdeCreateLinkSource(rPath); + if (pSrvSrc) + { + ::com::sun::star::datatransfer::DataFlavor aFl; + SotExchange::GetFormatDataFlavor(rLink.GetContentType(), aFl); + rLink.SetObj(pSrvSrc); + pSrvSrc->AddDataAdvise( + &rLink, aFl.MimeType, + sfx2::LINKUPDATE_ONCALL == rLink.GetUpdateMode() ? ADVISEMODE_ONLYONCE : 0); + } +} + +bool LinkManager::InsertFileLink( sfx2::SvBaseLink& rLink, sal_uInt16 nFileType, const String& rFileNm, const String* pFilterNm, @@ -413,8 +493,8 @@ sal_Bool LinkManager::InsertFileLink( sfx2::SvBaseLink& rLink ) return sal_False; } -// eine Uebertragung wird abgebrochen, also alle DownloadMedien canceln -// (ist zur Zeit nur fuer die FileLinks interressant!) +// A transfer is aborted, so cancel all download media +// (for now this is only of interest for the file links!) void LinkManager::CancelTransfers() { SvFileObject* pFileObj; @@ -425,24 +505,21 @@ void LinkManager::CancelTransfers() if( 0 != ( pLnk = &(*rLnks[ --n ])) && OBJECT_CLIENT_FILE == (OBJECT_CLIENT_FILE & pLnk->GetObjType()) && 0 != ( pFileObj = (SvFileObject*)pLnk->GetObj() ) ) -// 0 != ( pFileObj = (SvFileObject*)SvFileObject::ClassFactory()-> -// CastAndAddRef( pLnk->GetObj() )) ) pFileObj->CancelTransfers(); } - - // um Status Informationen aus dem FileObject an den BaseLink zu - // senden, gibt es eine eigene ClipBoardId. Das SvData-Object hat - // dann die entsprechenden Informationen als String. - // Wird zur Zeit fuer FileObject in Verbindung mit JavaScript benoetigt - // - das braucht Informationen ueber Load/Abort/Error + // For the purpose of sending Status information from the file object to + // the base link, there exist a dedicated ClipBoardId. The SvData-object + // gets the appropriate information as a string + // For now this is required for file object in conjunction with JavaScript + // - needs information about Load/Abort/Error sal_uIntPtr LinkManager::RegisterStatusInfoId() { static sal_uIntPtr nFormat = 0; if( !nFormat ) { -// wie sieht die neue Schnittstelle aus? -// nFormat = Exchange::RegisterFormatName( "StatusInfo vom SvxInternalLink" ); +// what is the new interface? +// nFormat = Exchange::RegisterFormatName( "StatusInfo vom SvxInternalLink" ); nFormat = SotExchange::RegisterFormatName( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "StatusInfo vom SvxInternalLink" ))); @@ -511,13 +588,11 @@ sal_Bool SvxInternalLink::Connect( sfx2::SvBaseLink* pLink ) SfxObjectShell* pFndShell = 0; sal_uInt16 nUpdateMode = com::sun::star::document::UpdateDocMode::NO_UPDATE; String sTopic, sItem, sReferer; - if( pLink->GetLinkManager() && - pLink->GetLinkManager()->GetDisplayNames( pLink, 0, &sTopic, &sItem ) - && sTopic.Len() ) + LinkManager* pLinkMgr = pLink->GetLinkManager(); + if (pLinkMgr && pLinkMgr->GetDisplayNames(pLink, 0, &sTopic, &sItem) && sTopic.Len()) { - // erstmal nur ueber die DocumentShells laufen und die mit dem - // Namen heraussuchen: - + // first only loop over the DocumentShells the shells and find those + // with the name: com::sun::star::lang::Locale aLocale; MsLangId::convertLanguageToLocale( LANGUAGE_SYSTEM, aLocale ); CharClass aCC( aLocale ); @@ -528,7 +603,7 @@ sal_Bool SvxInternalLink::Connect( sfx2::SvBaseLink* pLink ) TypeId aType( TYPE(SfxObjectShell) ); sal_Bool bFirst = sal_True; - SfxObjectShell* pShell = pLink->GetLinkManager()->GetPersist(); + SfxObjectShell* pShell = pLinkMgr->GetPersist(); if( pShell && pShell->GetMedium() ) { sReferer = pShell->GetMedium()->GetBaseURL(); @@ -556,7 +631,7 @@ sal_Bool SvxInternalLink::Connect( sfx2::SvBaseLink* pLink ) aCC.toLower( sTmp ); - if( sTmp == sNmURL ) // die wollen wir haben + if( sTmp == sNmURL ) // we want these { pFndShell = pShell; break; @@ -578,9 +653,25 @@ sal_Bool SvxInternalLink::Connect( sfx2::SvBaseLink* pLink ) if( !sTopic.Len() ) return sal_False; - if( !pFndShell ) + if (pFndShell) { - // dann versuche die Datei zu laden: + sfx2::SvLinkSource* pNewSrc = pFndShell->DdeCreateLinkSource( sItem ); + if( pNewSrc ) + { + ::com::sun::star::datatransfer::DataFlavor aFl; + SotExchange::GetFormatDataFlavor( pLink->GetContentType(), aFl ); + + pLink->SetObj( pNewSrc ); + pNewSrc->AddDataAdvise( pLink, aFl.MimeType, + sfx2::LINKUPDATE_ONCALL == pLink->GetUpdateMode() + ? ADVISEMODE_ONLYONCE + : 0 ); + return true; + } + } + else + { + // then try to download the file: INetURLObject aURL( sTopic ); INetProtocol eOld = aURL.GetProtocol(); aURL.SetURL( sTopic = lcl_DDE_RelToAbs( sTopic, sReferer ) ); @@ -593,7 +684,11 @@ sal_Bool SvxInternalLink::Connect( sfx2::SvBaseLink* pLink ) SfxStringItem aTarget( SID_TARGETNAME, String::CreateFromAscii("_blank") ); SfxStringItem aReferer( SID_REFERER, sReferer ); SfxUInt16Item aUpdate( SID_UPDATEDOCMODE, nUpdateMode ); - SfxBoolItem aReadOnly(SID_DOC_READONLY, sal_True); + SfxBoolItem aReadOnly(SID_DOC_READONLY, false); + + // Disable automatic re-connection to avoid this link instance + // being destroyed at re-connection. + SfxBoolItem aDdeConnect(SID_DDE_RECONNECT_ONLOAD, false); // #i14200# (DDE-link crashes wordprocessor) SfxAllItemSet aArgs( SFX_APP()->GetPool() ); @@ -604,29 +699,19 @@ sal_Bool SvxInternalLink::Connect( sfx2::SvBaseLink* pLink ) aArgs.Put(aName); aArgs.Put(aUpdate); aArgs.Put(aReadOnly); - pFndShell = SfxObjectShell::CreateAndLoadObject( aArgs ); + aArgs.Put(aDdeConnect); + Reference<XComponent> xComp = SfxObjectShell::CreateAndLoadComponent(aArgs); + pFndShell = SfxObjectShell::GetShellFromComponent(xComp); + if (xComp.is() && pFndShell) + { + pLinkMgr->InsertCachedComp(xComp); + pLinkMgr->LinkServerShell(sItem, *pFndShell, *pLink); + return true; + } } } - sal_Bool bRet = sal_False; - if( pFndShell ) - { - sfx2::SvLinkSource* pNewSrc = pFndShell->DdeCreateLinkSource( sItem ); - if( pNewSrc ) - { - bRet = sal_True; - - ::com::sun::star::datatransfer::DataFlavor aFl; - SotExchange::GetFormatDataFlavor( pLink->GetContentType(), aFl ); - - pLink->SetObj( pNewSrc ); - pNewSrc->AddDataAdvise( pLink, aFl.MimeType, - sfx2::LINKUPDATE_ONCALL == pLink->GetUpdateMode() - ? ADVISEMODE_ONLYONCE - : 0 ); - } - } - return bRet; + return false; } @@ -634,3 +719,4 @@ sal_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 ee6e4fba588b..70aa59578c2d 100644..100755 --- 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 95c24e4a77ab..8fae3ed17fa8 100644..100755 --- 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 - sal_uIntPtr nCntntType; // Update Format - // nicht Ole-Links - sal_Bool bIntrnlLnk; // ist es ein interner Link - sal_uInt16 nUpdateMode;// UpdateMode + // applies for all links + sal_uIntPtr nCntntType; // Update Format + // Not Ole-Links + sal_Bool bIntrnlLnk; // It is an internal link + sal_uInt16 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 !!! sal_Bool bIsValidData : 1; sal_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( sal_uInt16 nUpdateMode, sal_uIntPtr nContentType ) @@ -160,16 +161,16 @@ SvBaseLink::SvBaseLink( sal_uInt16 nUpdateMode, sal_uIntPtr nContentType ) bVisible = bSynchron = bUseCache = sal_True; bWasLastEditOK = sal_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 = sal_False; } /************************************************************************ -|* SvBaseLink::SvBaseLink() +|* SvBaseLink::SvBaseLink() |* -|* Beschreibung +|* Description *************************************************************************/ SvBaseLink::SvBaseLink( const String& rLinkName, sal_uInt16 nObjectType, SvLinkSource* pObj ) @@ -182,7 +183,7 @@ SvBaseLink::SvBaseLink( const String& rLinkName, sal_uInt16 nObjectType, SvLinkS 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, sal_uInt16 nObjectType, SvLinkS 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, sal_uInt16 nObjectType, SvLinkS } /************************************************************************ -|* 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( sal_uInt16 nObjTypeP ) @@ -257,9 +257,9 @@ void SvBaseLink::SetObjType( sal_uInt16 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( sal_uInt16 nMode ) @@ -347,7 +347,7 @@ void SvBaseLink::SetUpdateMode( sal_uInt16 nMode ) } } -// --> OD 2008-06-19 #i88291# +// #i88291# void SvBaseLink::clearStreamToLoadFrom() { m_xInputStreamToLoadFrom.clear(); @@ -356,7 +356,6 @@ void SvBaseLink::clearStreamToLoadFrom() xObj->clearStreamToLoadFrom(); } } -// <-- sal_Bool SvBaseLink::Update() { @@ -370,7 +369,6 @@ sal_Bool SvBaseLink::Update() if( xObj.Is() ) { xObj->setStreamToLoadFrom(m_xInputStreamToLoadFrom,m_bIsReadOnly); - // m_xInputStreamToLoadFrom = 0; String sMimeType( SotExchange::GetFormatMimeType( pImplData->ClientType.nCntntType )); Any aData; @@ -378,8 +376,7 @@ sal_Bool SvBaseLink::Update() if( xObj->GetData( aData, sMimeType ) ) { DataChanged( sMimeType, aData ); - //JP 13.07.00: Bug 76817 - for manual Updates there is no - // need to hold the ServerObject + //for manual Updates there is no need to hold the ServerObject if( OBJECT_CLIENT_DDE == nObjType && LINKUPDATE_ONCALL == GetUpdateMode() && xObj.Is() ) xObj->RemoveAllDataAdvise( this ); @@ -387,11 +384,11 @@ sal_Bool SvBaseLink::Update() } if( xObj.Is() ) { - // sollten wir asynschron sein? + // should be asynschron? if( xObj->IsPending() ) return sal_True; - // dann brauchen wir das Object auch nicht mehr + // we do not need the object anymore AddNextRef(); Disconnect(); ReleaseRef(); @@ -421,14 +418,14 @@ void SvBaseLink::_GetRealObject( sal_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 = sal_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 +445,7 @@ sal_uIntPtr SvBaseLink::GetContentType() const if( OBJECT_CLIENT_SO & nObjType ) return pImplData->ClientType.nCntntType; - return 0; // alle Formate ? + return 0; // all Formats ? } @@ -578,7 +575,6 @@ bool SvBaseLink::ExecuteEdit( const String& _rNewName ) void SvBaseLink::Closed() { if( xObj.Is() ) - // beim Advise Abmelden xObj->RemoveAllDataAdvise( this ); } @@ -593,8 +589,7 @@ FileDialogHelper* SvBaseLink::GetFileDialog( sal_uInt32 nFlags, const String& rF ImplDdeItem::~ImplDdeItem() { bIsInDTOR = sal_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 +598,7 @@ DdeData* ImplDdeItem::Get( sal_uIntPtr nFormat ) { if( pLink->GetObj() ) { - // ist das noch gueltig? + // is it still valid? if( bIsValidData && nFormat == aData.GetFormat() ) return &aData; @@ -628,19 +623,19 @@ DdeData* ImplDdeItem::Get( sal_uIntPtr nFormat ) sal_Bool ImplDdeItem::Put( const DdeData* ) { - DBG_ERROR( "ImplDdeItem::Put not implemented" ); + OSL_FAIL( "ImplDdeItem::Put not implemented" ); return sal_False; } void ImplDdeItem::AdviseLoop( sal_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 +644,8 @@ void ImplDdeItem::AdviseLoop( sal_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 +667,7 @@ static DdeTopic* FindTopic( const String & rLinkName, sal_uInt16* 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 +681,10 @@ static DdeTopic* FindTopic( const String & rLinkName, sal_uInt16* 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 +692,5 @@ static DdeTopic* FindTopic( const String & rLinkName, sal_uInt16* pItemStt ) } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx index 90b93cc3748e..19cf297efd4e 100644..100755 --- 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*, sal_Bool, sal_Bool bHiContrast = sal_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, sal_Bool bBig, sal_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, sal_Bool bDummyP, - SfxObjectFactory* pFactoryP ) - : pResMgr( pMgrP ), bDummy( bDummyP ), pImpl(0L) -{ - Construct_Impl(); - if ( pFactoryP ) - pFactoryP->SetModule_Impl( this ); -} -*/ + SfxModule::SfxModule( ResMgr* pMgrP, sal_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( sal_uInt16 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 (sal_uInt16 nFactory=0; nFactory<pImpl->pFactArr->Count(); ++nFactory) { if (pFact->nId == (*pImpl->pFactArr)[nFactory]->nId) { pImpl->pFactArr->Remove( nFactory ); - DBG_ERROR("ChildWindow mehrfach registriert!"); + OSL_FAIL("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( sal_uInt16 nId, SfxChildWinContextFactory *pFact) { - DBG_ASSERT( pImpl, "Kein echtes Modul!" ); + DBG_ASSERT( pImpl, "No real Modul!" ); sal_uInt16 nCount = pImpl->pFactArr->Count(); for (sal_uInt16 nFactory=0; nFactory<nCount; ++nFactory) @@ -255,7 +236,7 @@ void SfxModule::RegisterChildWindowContext( sal_uInt16 nId, } } - DBG_ERROR( "Kein ChildWindow fuer diesen Context!" ); + OSL_FAIL( "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( sal_Bool bBig ) { - return pImpl->GetImageList( pResMgr, bBig, sal_False ); -} - -ImageList* SfxModule::GetImageList_Impl( sal_Bool bBig, sal_Bool bHiContrast ) -{ - return pImpl->GetImageList( pResMgr, bBig, bHiContrast ); + return pImpl->GetImageList( pResMgr, bBig ); } -SfxTabPage* SfxModule::CreateTabPage( sal_uInt16, Window*, const SfxItemSet& ) +SfxTabPage* SfxModule::CreateTabPage( sal_uInt16 Window*, const SfxItemSet& ) { return NULL; } @@ -448,3 +424,5 @@ FieldUnit SfxModule::GetFieldUnit() const eUnit = (FieldUnit)( (SfxUInt16Item*)pItem )->GetValue(); return eUnit; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index dbeb25d8c6b9..22e964149f61 100644..100755 --- 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. @@ -45,7 +46,7 @@ #include "newhelp.hrc" #include "helpid.hrc" -#include <hash_map> +#include <boost/unordered_map.hpp> #include <rtl/ustrbuf.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/configurationhelper.hxx> @@ -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> @@ -133,8 +132,6 @@ using namespace ::com::sun::star::ui; using namespace ::comphelper; -extern void AppendConfigToken_Impl( String& rURL, sal_Bool bQuestionMark ); // sfxhelp.cxx - // defines --------------------------------------------------------------- #define SPLITSET_ID 0 @@ -293,13 +290,6 @@ ContentListBox_Impl::ContentListBox_Impl( Window* pParent, const ResId& rResId ) aDocumentImage ( SfxResId( IMG_HELP_CONTENT_DOC ) ) { - if ( GetSettings().GetStyleSettings().GetHighContrastMode() ) - { - aOpenBookImage = Image( SfxResId( IMG_HELP_CONTENT_BOOK_OPEN_HC ) ); - aClosedBookImage = Image( SfxResId( IMG_HELP_CONTENT_BOOK_CLOSED_HC ) ); - aDocumentImage = Image( SfxResId( IMG_HELP_CONTENT_DOC_HC ) ); - } - SetStyle( GetStyle() | WB_HIDESELECTION | WB_HSCROLL ); SetEntryHeight( 16 ); @@ -412,7 +402,7 @@ void ContentListBox_Impl::RequestingChilds( SvLBoxEntry* pParent ) } catch( Exception& ) { - DBG_ERROR( "ContentListBox_Impl::RequestingChilds(): unexpected exception" ); + OSL_FAIL( "ContentListBox_Impl::RequestingChilds(): unexpected exception" ); } } @@ -613,7 +603,7 @@ namespace sfx2 { } }; - typedef ::std::hash_map< ::rtl::OUString, int, hashOUString, equalOUString > KeywordInfo; + typedef ::boost::unordered_map< ::rtl::OUString, int, hashOUString, equalOUString > KeywordInfo; } #define UNIFY_AND_INSERT_TOKEN( aToken ) \ @@ -653,7 +643,7 @@ void IndexTabPage_Impl::InitializeIndex() aURL += ::rtl::OUString( sFactory ); String aTemp = aURL; - AppendConfigToken_Impl( aTemp, sal_True ); + AppendConfigToken( aTemp, sal_True ); aURL = aTemp; Content aCnt( aURL, Reference< ::com::sun::star::ucb::XCommandEnvironment > () ); @@ -742,7 +732,7 @@ void IndexTabPage_Impl::InitializeIndex() } catch( Exception& ) { - DBG_ERROR( "IndexTabPage_Impl::InitializeIndex(): unexpected exception" ); + OSL_FAIL( "IndexTabPage_Impl::InitializeIndex(): unexpected exception" ); } aIndexCB.SetUpdateMode( sal_True ); @@ -902,7 +892,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; @@ -1098,7 +1088,7 @@ IMPL_LINK( SearchTabPage_Impl, SearchHdl, PushButton*, EMPTYARG ) if ( !aFullWordsCB.IsChecked() ) aSearchText = sfx2::PrepareSearchString( aSearchText, xBreakIterator, true ); aSearchURL += aSearchText; - AppendConfigToken_Impl( aSearchURL, sal_False ); + AppendConfigToken( aSearchURL, sal_False ); if ( aScopeCB.IsChecked() ) aSearchURL += DEFINE_CONST_UNICODE("&Scope=Heading"); Sequence< ::rtl::OUString > aFactories = SfxContentHelper::GetResultSet( aSearchURL ); @@ -1315,7 +1305,7 @@ void BookmarksBox_Impl::DoAction( sal_uInt16 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*)(sal_uIntPtr)( new String( *pURL ) ) ); SelectEntryPos( nPos ); delete pURL; @@ -1488,7 +1478,7 @@ void BookmarksTabPage_Impl::AddBookmarks( const String& rTitle, const String& rU { rtl::OUString aImageURL = IMAGE_URL; aImageURL += INetURLObject( rURL ).GetHost(); - sal_uInt16 nPos = aBookmarksBox.InsertEntry( rTitle, SvFileInformationManager::GetImage( aImageURL ) ); + sal_uInt16 nPos = aBookmarksBox.InsertEntry( rTitle, SvFileInformationManager::GetImage( aImageURL, false ) ); aBookmarksBox.SetEntryData( nPos, (void*)(sal_uIntPtr)( new String( rURL ) ) ); } @@ -1523,7 +1513,7 @@ sal_Bool SfxHelpWindow_Impl::splitHelpURL(const ::rtl::OUString& sHelpURL, sHelpURL.append(sFactory); sHelpURL.append(sContent); String sURL = String(sHelpURL.makeStringAndClear()); - AppendConfigToken_Impl(sURL, bUseQuestionMark); + AppendConfigToken(sURL, bUseQuestionMark); if (sAnchor.getLength()) sURL += String(sAnchor); return ::rtl::OUString(sURL); @@ -1535,7 +1525,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 +1535,6 @@ void SfxHelpWindow_Impl::loadHelpContent(const ::rtl::OUString& sHelpURL, sal_Bo xTextController->suspend( sal_False ); return; } - // <-- // save url to history if (bAddToHistory) @@ -1644,7 +1632,7 @@ SfxHelpIndexWindow_Impl::~SfxHelpIndexWindow_Impl() void SfxHelpIndexWindow_Impl::Initialize() { String aHelpURL = HELP_URL; - AppendConfigToken_Impl( aHelpURL, sal_True ); + AppendConfigToken( aHelpURL, sal_True ); Sequence< ::rtl::OUString > aFactories = SfxContentHelper::GetResultSet( aHelpURL ); const ::rtl::OUString* pFacs = aFactories.getConstArray(); sal_uInt32 i, nCount = aFactories.getLength(); @@ -1786,7 +1774,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 +2163,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; @@ -2353,7 +2342,7 @@ Reference< XTextRange > SfxHelpTextWindow_Impl::getCursor() const } catch( Exception& ) { - DBG_ERROR( "SfxHelpTextWindow_Impl::getCursor(): unexpected exception" ); + OSL_FAIL( "SfxHelpTextWindow_Impl::getCursor(): unexpected exception" ); } return xCursor; @@ -2421,7 +2410,7 @@ IMPL_LINK( SfxHelpTextWindow_Impl, SelectHdl, Timer*, EMPTYARG ) } catch( Exception& ) { - DBG_ERROR( "SfxHelpTextWindow_Impl::SelectHdl(): unexpected exception" ); + OSL_FAIL( "SfxHelpTextWindow_Impl::SelectHdl(): unexpected exception" ); } return 1; @@ -2517,7 +2506,7 @@ IMPL_LINK( SfxHelpTextWindow_Impl, FindHdl, sfx2::SearchDialog*, pDlg ) } catch( Exception& ) { - DBG_ERROR( "SfxHelpTextWindow_Impl::SelectHdl(): unexpected exception" ); + OSL_FAIL( "SfxHelpTextWindow_Impl::SelectHdl(): unexpected exception" ); } return 0; @@ -2581,7 +2570,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 +2578,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 ) ) ); @@ -2638,9 +2637,11 @@ long SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& rNEvt ) aMenu.CheckItem(TBI_SELECTIONMODE, bCheck); } aMenu.InsertSeparator(); - aMenu.InsertItem( TBI_COPY, String( SfxResId( STR_HELP_MENU_TEXT_COPY ) ), - Image( SfxResId( bHiContrast ? IMG_HELP_TOOLBOX_HC_COPY : IMG_HELP_TOOLBOX_COPY ) ) ); + aMenu.InsertItem( TBI_COPY, + String( SfxResId( STR_HELP_MENU_TEXT_COPY ) ), + Image( SfxResId( IMG_HELP_TOOLBOX_COPY ) ) aMenu.SetHelpId( TBI_COPY, ".uno:Copy" ); + ); aMenu.EnableItem( TBI_COPY, HasSelection() ); if ( bIsDebug ) @@ -2918,7 +2919,6 @@ void SfxHelpWindow_Impl::MakeLayout() Some VCL-patches could not solve this problem so I've established the workaround: resize the help window if it's visible .-) */ -// pScreenWin->Hide(); ::com::sun::star::awt::Rectangle aRect = xWindow->getPosSize(); sal_Int32 nOldWidth = bIndex ? nCollapseWidth : nExpandWidth; @@ -2935,8 +2935,6 @@ void SfxHelpWindow_Impl::MakeLayout() } else if ( aWinPos.X() > 0 && aWinPos.Y() > 0 ) pScreenWin->SetPosPixel( aWinPos ); - -// pScreenWin->Show(); } Clear(); @@ -3085,10 +3083,7 @@ IMPL_LINK( SfxHelpWindow_Impl, OpenHdl, SfxHelpIndexWindow_Impl* , EMPTYARG ) ::rtl::OUString sHelpURL; -// INetURLObject aObj(aEntry); -// sal_Bool bComplete = ( aObj.GetProtocol() == INET_PROT_VND_SUN_STAR_HELP ); - - sal_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); @@ -3189,7 +3184,7 @@ void SfxHelpWindow_Impl::openDone(const ::rtl::OUString& sURL , } catch( Exception& ) { - DBG_ERROR( "SfxHelpWindow_Impl::OpenDoneHdl(): unexpected exception" ); + OSL_FAIL( "SfxHelpWindow_Impl::OpenDoneHdl(): unexpected exception" ); } // When the SearchPage opens the help doc, then select all words, which are equal to its text @@ -3400,7 +3395,7 @@ void SfxHelpWindow_Impl::DoAction( sal_uInt16 nActionId ) } catch( Exception& ) { - DBG_ERROR( "SfxHelpWindow_Impl::DoAction(): unexpected exception" ); + OSL_FAIL( "SfxHelpWindow_Impl::DoAction(): unexpected exception" ); } } break; @@ -3490,3 +3485,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.hrc b/sfx2/source/appl/newhelp.hrc index 7bb9aa85678c..7bb9aa85678c 100644..100755 --- a/sfx2/source/appl/newhelp.hrc +++ b/sfx2/source/appl/newhelp.hrc diff --git a/sfx2/source/appl/newhelp.hxx b/sfx2/source/appl/newhelp.hxx index fb34640f93ef..ff983671fa8e 100644..100755 --- 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(); } @@ -610,5 +611,9 @@ public: inline String GetTitle() const { return aTitleED.GetText(); } }; +/// Appends ?Language=xy&System=abc to the help URL in rURL +void AppendConfigToken( String& rURL, sal_Bool bQuestionMark, const rtl::OUString &rLang = rtl::OUString() ); + #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 88dfed8ad71e..da59e0a35f07 100644..100755 --- 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 6bd233949ddf..a3d917725456 100644..100755 --- 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. @@ -290,3 +291,5 @@ void SvxOpenGraphicDialog::SetControlHelpIds( const sal_Int16* _pControlId, cons } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/panelist.hxx b/sfx2/source/appl/panelist.hxx index 7cbf2a19e628..e5924071a64e 100644..100755 --- 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/sfx.src b/sfx2/source/appl/sfx.src index 3bca517c5fd5..3bca517c5fd5 100644..100755 --- a/sfx2/source/appl/sfx.src +++ b/sfx2/source/appl/sfx.src diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 855369c11bc9..e235ca07446a 100644..100755 --- 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,25 +115,28 @@ void NoHelpErrorBox::RequestHelp( const HelpEvent& ) // do nothing, because no help available } -// ----------------------------------------------------------------------- - #define STARTERLIST 0 -rtl::OUString HelpLocaleString() +static bool impl_hasHelpInstalled( const rtl::OUString &rLang ); + +/// Return the locale we prefer for displaying help +static rtl::OUString HelpLocaleString() { static rtl::OUString aLocaleStr; if (!aLocaleStr.getLength()) { + const rtl::OUString aEnglish( RTL_CONSTASCII_USTRINGPARAM( "en" ) ); // detect installed locale Any aLocale = - ::utl::ConfigManager::GetConfigManager()->GetDirectConfigProperty( + ::utl::ConfigManager::GetConfigManager().GetDirectConfigProperty( ::utl::ConfigManager::LOCALE ); aLocale >>= aLocaleStr; bool bOk = aLocaleStr.getLength() != 0; - if ( bOk ) + if ( !bOk ) + aLocaleStr = aEnglish; + else { rtl::OUString aBaseInstallPath; - // utl::Bootstrap::PathStatus aBaseLocateResult = utl::Bootstrap::locateBaseInstallation(aBaseInstallPath); static const char *szHelpPath = "/help/"; @@ -155,15 +160,19 @@ rtl::OUString HelpLocaleString() } } } - if (!bOk) - aLocaleStr = rtl::OUString( DEFINE_CONST_UNICODE("en") ); + // if not OK, and not even English installed, we use online help, and + // have to preserve the full locale name + if ( !bOk && impl_hasHelpInstalled( aEnglish ) ) + aLocaleStr = aEnglish; } return aLocaleStr; } -void AppendConfigToken_Impl( String& rURL, sal_Bool bQuestionMark ) +void AppendConfigToken( String& rURL, sal_Bool bQuestionMark, const rtl::OUString &rLang ) { - ::rtl::OUString aLocaleStr(HelpLocaleString()); + ::rtl::OUString aLocaleStr( rLang ); + if ( !aLocaleStr.getLength() ) + aLocaleStr = HelpLocaleString(); // query part exists? if ( bQuestionMark ) @@ -181,22 +190,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 -// sal_uIntPtr 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 +216,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,10 +252,9 @@ static Sequence< ::rtl::OUString > GetPropertyNames() return aNames; } -// ----------------------------------------------------------------------- - SfxHelpOptions_Impl::SfxHelpOptions_Impl() - : ConfigItem( ::rtl::OUString::createFromAscii("Office.SFX/Help") ) + : ConfigItem( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Office.SFX/Help")) ) + , m_pIds( NULL ) { Sequence< ::rtl::OUString > aNames = GetPropertyNames(); Sequence< Any > aValues = GetProperties( aNames ); @@ -317,8 +314,6 @@ void SfxHelpOptions_Impl::Commit() { } -// class SfxHelp_Impl ---------------------------------------------------- - class SfxHelp_Impl { private: @@ -355,7 +350,7 @@ void SfxHelp_Impl::Load() // fill modules list // create the help url (empty, without module and helpid) String sHelpURL( DEFINE_CONST_UNICODE("vnd.sun.star.help://") ); - AppendConfigToken_Impl( sHelpURL, sal_True ); + AppendConfigToken( sHelpURL, sal_True ); // open ucb content and get the list of the help modules // the list contains strings with three tokens "ui title \t type \t url" @@ -407,201 +402,6 @@ sal_Bool SfxHelp_Impl::IsHelpInstalled() return ( m_aModulesList.begin() != m_aModulesList.end() ); } -// class SfxHelp --------------------------------------------------------- -/* some test code for HID conversion - please don't remove - -#include <tools/stream.hxx> -void TestHids() -{ - static const char* aModules[] = - { - "swriter", - "scalc", - "simpress", - "sdraw", - "sdatabase", - "smath", - "schart", - "sbasic" - }; - - SvFileStream* pOut[] = - { - 0,0,0,0,0,0,0,0,0 - }; - - String aIn = String::CreateFromAscii("/data/OOo/replacer/hidsin.lst"); - String aOut = String::CreateFromAscii("/data/OOo/replacer/"); - SvFileStream aInStrm( aIn, STREAM_READ ); - ByteString aBuffer; - while ( aInStrm.ReadLine( aBuffer ) ) - { - ByteString aHid = aBuffer.GetToken(0, ' '); - ByteString aNr = aBuffer.GetToken(1, ' '); - bool bFound=false; - for (sal_Int32 n= 0; n<8; n++) - { - bFound = false; - String aHelpURL = SfxHelp::CreateHelpURL( String( aNr, RTL_TEXTENCODING_UTF8 ), String( aModules[n], RTL_TEXTENCODING_UTF8 ) ); - if ( !SfxContentHelper::IsHelpErrorDocument( aHelpURL ) ) - { - if (!pOut[n]) - { - String aTmp( aOut ); - aTmp += String( aModules[n], RTL_TEXTENCODING_UTF8 ); - aTmp += String::CreateFromAscii(".lst"); - pOut[n] = new SvFileStream( aTmp, STREAM_WRITE | STREAM_TRUNC ); - } - pOut[n]->WriteLine( aHid ); - bFound = true; - break; - } - } - - if (!bFound) - { - if (!pOut[8]) - { - String aTmp( aOut ); - aTmp += String( "notfound", RTL_TEXTENCODING_UTF8 ); - aTmp += String::CreateFromAscii(".lst"); - pOut[8] = new SvFileStream( aTmp, STREAM_WRITE | STREAM_TRUNC ); - } - pOut[8]->WriteLine( aHid ); - } - } - - for (sal_Int32 n= 0; n<9; n++) - DELETEZ( pOut[n] ); -} - -void TestHids2() -{ - static const char* aModules[] = - { - "swriter", - "scalc", - "simpress", - "smath", - "sbasic" - }; - - String aOut = String::CreateFromAscii("/data/OOo/replacer/"); - aOut += String::CreateFromAscii("lost.lst"); - SvFileStream aOutStrm( aOut, STREAM_WRITE | STREAM_TRUNC ); - for (sal_Int32 n= 0; n<5; n++) - { - String aIn = String::CreateFromAscii("/data/OOo/replacer/help/"); - aIn += String::CreateFromAscii( aModules[n] ); - aIn += String::CreateFromAscii(".lst"); - SvFileStream aInStrm( aIn, STREAM_READ ); - ByteString aBuffer; - while ( aInStrm.ReadLine( aBuffer ) ) - { - String aHelpURL = SfxHelp::CreateHelpURL( String( aBuffer, RTL_TEXTENCODING_UTF8 ), String( aModules[n], RTL_TEXTENCODING_UTF8 ) ); - if ( SfxContentHelper::IsHelpErrorDocument( aHelpURL ) ) - aOutStrm.WriteLine( aBuffer ); - } - } -} - -#include <tools/stream.hxx> -void TestHids3() -{ - static const char* aModules[] = - { - "swriter", - "scalc", - "simpress", - "sdraw", - "sdatabase", - "smath", - "schart", - "sbasic" - }; - - SvFileStream* pOut[] = - { - 0,0,0,0,0,0,0,0,0 - }; - - String aIn = String::CreateFromAscii("/data/OOo/replacer/hidsin.lst"); - String aOut = String::CreateFromAscii("/data/OOo/replacer/quickhelp/"); - SvFileStream aInStrm( aIn, STREAM_READ ); - ByteString aBuffer; - while ( aInStrm.ReadLine( aBuffer ) ) - { - ByteString aHid = aBuffer.GetToken(0, ' '); - ByteString aNr = aBuffer.GetToken(1, ' '); - bool bFound=false; - for (sal_Int32 n= 0; n<8; n++) - { - bFound = false; - String aHelpURL = SfxHelp::CreateHelpURL( String( aNr, RTL_TEXTENCODING_UTF8 ), String( aModules[n], RTL_TEXTENCODING_UTF8 ) ); - if ( SfxContentHelper::GetActiveHelpString( aHelpURL ).Len() ) -// if ( SfxHelp_Impl::GetHelpText( String( aNr, RTL_TEXTENCODING_UTF8 ), String( aModules[n], RTL_TEXTENCODING_UTF8 ) ).Len() ) - { - if (!pOut[n]) - { - String aTmp( aOut ); - aTmp += String( aModules[n], RTL_TEXTENCODING_UTF8 ); - aTmp += String::CreateFromAscii(".lst"); - pOut[n] = new SvFileStream( aTmp, STREAM_WRITE | STREAM_TRUNC ); - } - pOut[n]->WriteLine( aHid ); - bFound = true; - break; - } - } - - if (!bFound) - { - if (!pOut[8]) - { - String aTmp( aOut ); - aTmp += String( "notfound", RTL_TEXTENCODING_UTF8 ); - aTmp += String::CreateFromAscii(".lst"); - pOut[8] = new SvFileStream( aTmp, STREAM_WRITE | STREAM_TRUNC ); - } - pOut[8]->WriteLine( aHid ); - } - } - - for (sal_Int32 n= 0; n<9; n++) - DELETEZ( pOut[n] ); -} - -void TestHids4() -{ - static const char* aModules[] = - { - "swriter", - "scalc", - "simpress", - "smath", - "sbasic" - }; - - String aOut = String::CreateFromAscii("/data/OOo/replacer/quickhelp/"); - aOut += String::CreateFromAscii("lost.lst"); - SvFileStream aOutStrm( aOut, STREAM_WRITE | STREAM_TRUNC ); - for (sal_Int32 n= 0; n<5; n++) - { - String aIn = String::CreateFromAscii("/data/OOo/replacer/quickhelp/"); - aIn += String::CreateFromAscii( aModules[n] ); - aIn += String::CreateFromAscii(".lst"); - SvFileStream aInStrm( aIn, STREAM_READ ); - ByteString aBuffer; - while ( aInStrm.ReadLine( aBuffer ) ) - { - String aHelpURL = SfxHelp::CreateHelpURL( String( aBuffer, RTL_TEXTENCODING_UTF8 ), String( aModules[n], RTL_TEXTENCODING_UTF8 ) ); - if ( !SfxContentHelper::GetActiveHelpString( aHelpURL ).Len() ) - aOutStrm.WriteLine( aBuffer ); - } - } -} -*/ - SfxHelp::SfxHelp() : bIsDebug( sal_False ), @@ -723,7 +523,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 +540,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 @@ -794,11 +594,11 @@ String SfxHelp::CreateHelpURL_Impl( const String& aCommandURL, const String& rM RTL_TEXTENCODING_UTF8 )); String aTempURL = aHelpURL; - AppendConfigToken_Impl( aTempURL, sal_True ); + AppendConfigToken( aTempURL, sal_True ); bHasAnchor = GetHelpAnchor_Impl( aTempURL, aAnchor ); } - AppendConfigToken_Impl( aHelpURL, sal_True ); + AppendConfigToken( aHelpURL, sal_True ); if ( bHasAnchor ) { @@ -901,6 +701,16 @@ XubString SfxHelp::GetHelpText( const String& aCommandURL, const Window* pWindow return sHelpText; } +/// Check for built-in help +static bool impl_hasHelpInstalled( const rtl::OUString &rLang = rtl::OUString() ) +{ + String aHelpRootURL( DEFINE_CONST_OUSTRING("vnd.sun.star.help://") ); + AppendConfigToken_Impl( aHelpRootURL, sal_True ); + Sequence< ::rtl::OUString > aFactories = SfxContentHelper::GetResultSet( aHelpRootURL ); + + return ( aFactories.getLength() != 0 ); +} + sal_Bool SfxHelp::SearchKeyword( const XubString& rKeyword ) { return Start_Impl( String(), NULL, rKeyword ); @@ -911,19 +721,39 @@ sal_Bool SfxHelp::Start( const String& rURL, const Window* pWindow ) return Start_Impl( rURL, pWindow, String() ); } +/// 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 + { + 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; +} + sal_Bool SfxHelp::Start_Impl( const String& rURL, const Window* pWindow, const String& rKeyword ) { - // check if help is available String aHelpRootURL( DEFINE_CONST_OUSTRING("vnd.sun.star.help://") ); - AppendConfigToken_Impl( aHelpRootURL, sal_True ); + AppendConfigToken( aHelpRootURL, sal_True, rLang ); Sequence< ::rtl::OUString > aFactories = SfxContentHelper::GetResultSet( aHelpRootURL ); - if ( 0 == aFactories.getLength() ) - { - // no factories -> no help -> error message and return - NoHelpErrorBox aErrBox( const_cast< Window* >( pWindow ) ); - aErrBox.Execute(); - return sal_False; - } /* rURL may be - a "real" URL @@ -940,6 +770,8 @@ sal_Bool SfxHelp::Start_Impl( const String& rURL, const Window* pWindow, const S INetURLObject aParser( rURL ); INetProtocol nProtocol = aParser.GetProtocol(); String aHelpModuleName( GetHelpModuleName_Impl() ); + + ::rtl::OUString sKeyword; switch ( nProtocol ) { case INET_PROT_VND_SUN_STAR_HELP: @@ -949,7 +781,14 @@ sal_Bool SfxHelp::Start_Impl( const String& rURL, const Window* pWindow, const S default: { // no URL, just a HelpID (maybe empty in case of keyword search) - aHelpURL = CreateHelpURL_Impl( rURL, aHelpModuleName ); + aHelpURL = CreateHelpURL_Impl( rURL, aHelpModuleName ); + + // pb i91715: strings begin with ".HelpId:" are not words of the basic ide + // they are helpid-strings used by the testtool -> so we ignore them + static const String sHelpIdScheme( DEFINE_CONST_OUSTRING(".HelpId:") ); + if ( rURL.Search( sHelpIdScheme ) != 0 ) + sKeyword = ::rtl::OUString( rURL ); + if ( pWindow && SfxContentHelper::IsHelpErrorDocument( aHelpURL ) ) { // no help found -> try with parent help id. @@ -973,6 +812,18 @@ sal_Bool SfxHelp::Start_Impl( const String& rURL, const Window* pWindow, const S } } + 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 +892,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 +905,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 +929,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 59a753fdb2c4..727241fd299e 100644..100755 --- 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. @@ -125,8 +126,6 @@ void SfxPickList::CreatePicklistMenuTitle( Menu* pMenu, sal_uInt16 nItemId, cons // path and abbreviate it with a special function: String aFileSystemPath( aURL.getFSysPath( INetURLObject::FSYS_DETECT ) ); -// ::utl::LocalFileHelper::ConvertURLToPhysicalName( aURLString, aPhysicalName ); - ::rtl::OUString aSystemPath( aFileSystemPath ); ::rtl::OUString aCompactedSystemPath; @@ -219,7 +218,7 @@ void SfxPickList::CreatePickListEntries() { RemovePickListEntries(); - // Einlesen der Pickliste + // Reading the pick list Sequence< Sequence< PropertyValue > > seqPicklist = SvtHistoryOptions().GetList( ePICKLIST ); sal_uInt32 nCount = seqPicklist.getLength(); @@ -356,7 +355,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 +391,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 +422,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 +470,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 f7053321ddfa..abbcc16e388f 100644..100755 --- 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,10 +32,9 @@ #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> #include <com/sun/star/task/XInteractionHandler.hpp> #include <com/sun/star/frame/XDispatchResultListener.hpp> #include <com/sun/star/frame/XNotifyingDispatch.hpp> @@ -52,9 +52,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> @@ -79,7 +77,6 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::util; using namespace ::com::sun::star::ui::dialogs; -using namespace ::vos; #ifdef WNT using ::rtl::OUString; #else @@ -193,6 +190,9 @@ bool ShutdownIcon::LoadModule( osl::Module **pModule, return true; } +// These two timeouts are necessary to avoid there being +// plugin frames still on the stack, after unloading that +// code, causing a crash during disabling / termination. class IdleUnloader : Timer { ::osl::Module *m_pModule; @@ -210,6 +210,22 @@ public: } }; +class IdleTerminate : Timer +{ + Reference< XDesktop > m_xDesktop; +public: + IdleTerminate (Reference< XDesktop > xDesktop) + { + m_xDesktop = xDesktop; + Start(); + } + virtual void Timeout() + { + m_xDesktop->terminate(); + delete this; + } +}; + void ShutdownIcon::initSystray() { if (m_bInitialized) @@ -275,7 +291,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 +322,7 @@ void ShutdownIcon::FileOpen() { if ( getInstance() && getInstance()->m_xDesktop.is() ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + ::SolarMutexGuard aGuard; EnterModalMode(); getInstance()->StartFileDialog(); } @@ -325,7 +341,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 +351,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 +375,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 +392,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 +401,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()) ); @@ -408,7 +424,7 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR { DBG_ASSERT( pThis->m_pFileDlg, "ShutdownIcon, DialogClosedHdl_Impl(): no file dialog" ); - // use ctor for filling up filters automatically! #89169# + // use ctor for filling up filters automatically! if ( ERRCODE_NONE == pThis->m_pFileDlg->GetError() ) { Reference< XFilePicker > xPicker = pThis->m_pFileDlg->GetFilePicker(); @@ -429,21 +445,21 @@ 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, + // use the filedlghelper to get the current filter name, // because it removes the extensions before you get the filter name. OUString aFilterName( pThis->m_pFileDlg->GetCurrentFilter() ); @@ -457,12 +473,12 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR xPickerControls->getValue( ExtendedFilePickerElementIds::CHECKBOX_READONLY, 0 ) >>= bReadOnly; - // #95239#: Only set porperty if readonly is set to TRUE + // Only set porperty if readonly is set to TRUE 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 +493,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 +518,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 +530,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++ ) @@ -532,7 +548,7 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR } #ifdef WNT - // #103346 Destroy dialog to prevent problems with custom controls + // Destroy dialog to prevent problems with custom controls // This fix is dependent on the dialog settings. Destroying the dialog here will // crash the non-native dialog implementation! Therefore make this dependent on // the settings. @@ -579,19 +595,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 +642,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 +794,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 +836,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 +847,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 +867,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 +888,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 +900,11 @@ void ShutdownIcon::SetAutostart( bool bActivate ) osl_getThreadTextEncoding() ); OString aShortcutUnx = OUStringToOString( aShortcut, osl_getThreadTextEncoding() ); - if ((0 != symlink(aDesktopFileUnx, aShortcutUnx)) && (errno == EEXIST)) + if ((0 != symlink(aDesktopFileUnx.getStr(), aShortcutUnx.getStr())) && (errno == EEXIST)) { - unlink(aShortcutUnx); - symlink(aDesktopFileUnx, aShortcutUnx); + unlink(aShortcutUnx.getStr()); + int ret = symlink(aDesktopFileUnx.getStr(), aShortcutUnx.getStr()); + (void)ret; //deliberately ignore return value, it's non-critical if it fails } ShutdownIcon *pIcon = ShutdownIcon::createInstance(); @@ -963,3 +985,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 d702f2a50977..7ce6c1e8918d 100644..100755 --- 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 936d6f925053..9a3ab850ae36 100644..100755 --- 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 14f12c79b53b..8ce1927f80bf 100644..100755 --- 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 c9c9e06ae248..d8c33ecbb67a 100644..100755 --- 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( sal_uInt16 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() ); @@ -182,13 +190,13 @@ static void add_ugly_db_item( GtkMenuShell *pMenuShell, const char *pAsciiURL, Sequence < PropertyValue >& aEntry = aMenu[n]; for ( sal_Int32 m=0; m<aEntry.getLength(); m++ ) { - if ( aEntry[m].Name.equalsAsciiL( "URL", 3 ) ) + if ( aEntry[m].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("URL")) ) aEntry[m].Value >>= aURL; - if ( aEntry[m].Name.equalsAsciiL( "Title", 5 ) ) + if ( aEntry[m].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Title")) ) aEntry[m].Value >>= aDescription; } - if ( aURL.equalsAscii( BASE_URL ) && aDescription.getLength() ) + if ( aURL.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(BASE_URL)) && aDescription.getLength() ) { add_item (pMenuShell, pAsciiURL, &aDescription, nResId, pFnCallback); break; @@ -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 = sal_True; -} + gtk_widget_set_sensitive( pDisableMenuItem, !bModal); } static gboolean display_menu_cb( GtkWidget *, @@ -321,41 +306,51 @@ static gboolean display_menu_cb( GtkWidget *, if (event->button == 2) return sal_False; -#ifdef TEMPLATE_DIALOG_MORE_POLISHED - if (event->button == 1 && - event->type == GDK_2BUTTON_PRESS) - { - open_template_cb( NULL ); - return sal_True; - } - if (event->button == 3) - { - ... as below ... -#endif - 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 sal_True; } -extern "C" { - static gboolean - show_at_idle( gpointer ) +#ifdef ENABLE_GIO +/* + * 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 or overwritten +*/ +static void notify_file_changed(GFileMonitor * /*gfilemonitor*/, GFile * /*arg1*/, + GFile * /*arg2*/, GFileMonitorEvent event_type, gpointer /*user_data*/) +{ + //Shutdown the quick starter if anything has happened to make it unsafe + //to remain running, e.g. rpm --erased and all libs deleted, or + //rpm --upgrade and libs being overwritten + switch (event_type) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - gtk_widget_show_all( GTK_WIDGET( pTrayIcon ) ); - return sal_False; + case G_FILE_MONITOR_EVENT_DELETED: + case G_FILE_MONITOR_EVENT_CREATED: + case G_FILE_MONITOR_EVENT_PRE_UNMOUNT: + case G_FILE_MONITOR_EVENT_UNMOUNTED: + exit_quickstarter_cb(GTK_WIDGET(pTrayIcon)); + break; + default: + break; } } +#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 ); + pTrayIcon = gtk_status_icon_new_from_pixbuf(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 26fd35272a51..72bd91ae1727 100644..100755 --- 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 @@ -273,7 +275,7 @@ static HMENU createSystrayMenu( ) addMenuItem( hMenu, IDM_TEMPLATE, ICON_TEMPLATE, pShutdownIcon->GetResString( STR_QUICKSTART_FROMTEMPLATE ), pos, true, aEmpty); addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false, aEmpty ); - addMenuItem( hMenu, IDM_OPEN, ICON_OPEN, pShutdownIcon->GetResString( STR_QUICKSTART_FILEOPEN ), pos, true, OUString::createFromAscii( "SHELL32" )); + addMenuItem( hMenu, IDM_OPEN, ICON_OPEN, pShutdownIcon->GetResString( STR_QUICKSTART_FILEOPEN ), pos, true, OUString(RTL_CONSTASCII_USTRINGPARAM("SHELL32"))); addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false, aEmpty ); #endif addMenuItem( hMenu, IDM_INSTALL,0, pShutdownIcon->GetResString( STR_QUICKSTART_PRELAUNCH ), pos, false, aEmpty ); @@ -340,30 +342,6 @@ static void addTaskbarIcon( HWND hWnd ) // ------------------------------- -/* -static void removeTaskbarIcon() -{ - ShutdownIcon *pShutdownIcon = ShutdownIcon::getInstance(); - OSL_ENSURE( pShutdownIcon, "ShutdownIcon instance empty!"); - - if( !pShutdownIcon ) - return; - - if ( IsWindow( aListenerWindow )) - { - deleteSystrayMenu( popupMenu ); - - NOTIFYICONDATAA nid; - nid.cbSize=sizeof(NOTIFYICONDATA); - nid.hWnd = aListenerWindow; - nid.uID = ID_QUICKSTART; - Shell_NotifyIconA(NIM_DELETE, &nid); - } -} -*/ - -// ------------------------------- - LRESULT CALLBACK listenerWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { static UINT s_uTaskbarRestart = 0; @@ -427,7 +405,6 @@ LRESULT CALLBACK listenerWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP #endif int m = TrackPopupMenuEx( popupMenu, TPM_RETURNCMD|TPM_LEFTALIGN|TPM_RIGHTBUTTON, pt.x, pt.y, hWnd, NULL ); - // BUGFIX: See Q135788 (PRB: Menus for Notification Icons Don't Work Correctly) PostMessage( hWnd, NULL, 0, 0 ); switch( m ) { @@ -493,7 +470,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 +952,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 0692b85afcda..afab6bc6331d 100644..100755 --- 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,11 +29,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" -#ifndef GCC -#endif - #include <stdio.h> -#include <hash_map> +#include <boost/unordered_map.hpp> #include <sfx2/docfile.hxx> #include <sfx2/objsh.hxx> @@ -59,9 +57,7 @@ #include <svl/itemiter.hxx> #include <svl/whiter.hxx> #include <svl/intitem.hxx> -#ifndef _SFXEITEM_HXX //autogen #include <svl/eitem.hxx> -#endif #include <com/sun/star/ui/XUIElement.hpp> #include <com/sun/star/frame/XLayoutManager.hpp> #include <com/sun/star/frame/XLayoutManagerEventBroadcaster.hpp> @@ -141,6 +137,7 @@ static const ResIdToResName pToolBarResToName[] = { 23031, "mediaobjectbar" }, //draw/impress { 25060, "mediaobjectbar" }, //calc { 23311, "mediaobjectbar" }, //writer + { 23313, "navigationobjectbar" }, //writer { 0, "" } }; @@ -149,11 +146,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 +170,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 +235,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 +282,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 +297,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 ) @@ -328,7 +325,7 @@ throw (css::uno::RuntimeException) //==================================================================== -typedef std::hash_map< sal_Int32, rtl::OUString > ToolBarResIdToResourceURLMap; +typedef boost::unordered_map< sal_Int32, rtl::OUString > ToolBarResIdToResourceURLMap; static sal_Bool bMapInitialized = sal_False; static ToolBarResIdToResourceURLMap aResIdToResourceURLMap; @@ -527,7 +524,6 @@ void SfxWorkWindow::Sort_Impl() { sal_uInt16 k; for (k=0; k<aSortedList.Count(); k++) -// if ( (*pChilds)[aSortedList[k]]->eAlign > pCli->eAlign ) if (ChildAlignValue((*pChilds)[aSortedList[k]]->eAlign) > ChildAlignValue(pCli->eAlign)) break; @@ -540,7 +536,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 +554,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 ( sal_uInt16 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 : @@ -573,13 +569,12 @@ SfxFrameWorkWin_Impl::SfxFrameWorkWin_Impl( Window *pWin, SfxFrame *pFrm, SfxFra pSplit[n] = pSplitWin; } - //nOrigMode = SFX_VISIBILITY_CLIENT; nOrigMode = SFX_VISIBILITY_STANDARD; nUpdateMode = SFX_VISIBILITY_STANDARD; } //==================================================================== -// ctor der Basisklasse +// Constructor of the base class SfxWorkWindow::SfxWorkWindow( Window *pWin, SfxBindings& rB, SfxWorkWindow* pParentWorkwin ) : pParent( pParentWorkwin ), @@ -609,8 +604,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 (sal_uInt16 n=0; n < SFX_OBJECTBAR_MAX; ++n) pChilds->Insert(0,pChild); @@ -625,13 +620,13 @@ SfxWorkWindow::SfxWorkWindow( Window *pWin, SfxBindings& rB, SfxWorkWindow* pPar } //==================================================================== -// dtor +// Destructor SfxWorkWindow::~SfxWorkWindow() { DBG_DTOR(SfxWorkWindow, 0); - // SplitWindows l"oschen + // Delete SplitWindows for ( sal_uInt16 n=0; n<SFX_SPLITWINDOWS_MAX; n++ ) { SfxSplitWindow *p = pSplit[n]; @@ -640,7 +635,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; @@ -665,7 +660,7 @@ void SfxWorkWindow::Lock_Impl( sal_Bool bLock ) --m_nLock; if ( m_nLock<0 ) { - DBG_ERROR("Lock count underflow!"); + OSL_FAIL("Lock count underflow!"); m_nLock = 0; } @@ -705,17 +700,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) sal_uInt16 n; for ( n=0; n<SFX_SPLITWINDOWS_MAX; n++ ) { @@ -724,7 +719,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]; @@ -732,18 +727,12 @@ void SfxWorkWindow::DeleteControllers_Impl() SfxChildWindow *pChild = pCW->pWin; if (pChild) { -/* - sal_uInt16 nFlags = pCW->aInfo.nFlags; - pCW->aInfo = pChild->GetInfo(); - pCW->aInfo.nFlags |= nFlags; - SaveStatus_Impl(pChild, pCW->aInfo); -*/ 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; @@ -756,14 +745,10 @@ void SfxWorkWindow::DeleteControllers_Impl() // ATTENTION: The array itself is cleared after this loop!! // Therefore we have to set every array entry to zero as it could be // accessed by calling pChild->Destroy(). - // See task 128307 (Windows) // Window::NotifyAllChilds() calls SfxWorkWindow::DataChanged_Impl for // 8-bit displays (WM_QUERYPALETTECHANGED message due to focus change)!! - //(*pChildWins)[n] = 0; } - //pChildWins->Remove((sal_uInt16)0, nCount); - Reference< com::sun::star::frame::XFrame > xFrame = GetFrameInterface(); Reference< com::sun::star::beans::XPropertySet > xPropSet( xFrame, UNO_QUERY ); Reference< ::com::sun::star::frame::XLayoutManager > xLayoutManager; @@ -783,21 +768,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 ( sal_uInt16 i = 0; i < aObjBarList.size(); i++ ) { - // Nicht jede Position mu\s belegt sein + // Not every position must be occupied sal_uInt16 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 = sal_False; @@ -805,7 +791,7 @@ void SfxWorkWindow::DeleteControllers_Impl() } //==================================================================== -// Virtuelle Methode zum Anordnen der Childfenster. +// Virtual method for placing the child window. void SfxWorkWindow::ArrangeChilds_Impl( sal_Bool /*bForce*/) { @@ -835,16 +821,14 @@ void SfxFrameWorkWin_Impl::ArrangeChilds_Impl( sal_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 +840,12 @@ void SfxFrameWorkWin_Impl::ArrangeChilds_Impl( sal_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 +870,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 +990,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() @@ -1070,7 +1053,6 @@ void SfxWorkWindow::AlignChild_Impl( Window& rWindow, SfxChildAlignment eAlign ) { DBG_CHKTHIS(SfxWorkWindow, 0); -// DBG_ASSERT( pChilds, "aligning unregistered child" ); DBG_ASSERT( SfxChildAlignValid(eAlign), "invalid align" ); SfxChild_Impl *pChild = FindChild_Impl(rWindow); @@ -1084,7 +1066,7 @@ void SfxWorkWindow::AlignChild_Impl( Window& rWindow, pChild->bResize = sal_True; } else { - DBG_ERROR( "aligning unregistered child" ); + OSL_FAIL( "aligning unregistered child" ); } } @@ -1093,7 +1075,6 @@ void SfxWorkWindow::AlignChild_Impl( Window& rWindow, void SfxWorkWindow::ReleaseChild_Impl( Window& rWindow ) { DBG_CHKTHIS(SfxWorkWindow, 0); -// DBG_ASSERT( pChilds, "releasing unregistered child" ); SfxChild_Impl *pChild = 0; sal_uInt16 nPos; @@ -1113,7 +1094,7 @@ void SfxWorkWindow::ReleaseChild_Impl( Window& rWindow ) delete pChild; } else { - DBG_ERROR( "releasing unregistered child" ); + OSL_FAIL( "releasing unregistered child" ); } } @@ -1294,11 +1275,10 @@ void SfxWorkWindow::SetObjectBar_Impl( sal_uInt16 nPos, sal_uInt32 nResId, bool SfxWorkWindow::KnowsObjectBar_Impl( sal_uInt16 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. */ { @@ -1356,7 +1336,6 @@ void SfxFrameWorkWin_Impl::UpdateObjectBars_Impl() SfxWorkWindow::UpdateObjectBars_Impl(); -// if ( pTask->IsActive() ) { pWork = pParent; while ( pWork ) @@ -1443,8 +1422,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) sal_uInt16 n; for ( n=0; n<SFX_SPLITWINDOWS_MAX; n++ ) { @@ -1453,7 +1432,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,21 +1457,21 @@ 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 ) { sal_uInt16 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 sal_uInt16 nTbxMode = aObjBarList[n].nMode; bool bFullScreenTbx = SFX_VISIBILITY_FULLSCREEN == ( nTbxMode & SFX_VISIBILITY_FULLSCREEN ); nTbxMode &= ~SFX_VISIBILITY_FULLSCREEN; nTbxMode &= ~SFX_VISIBILITY_VIEWER; - // wird in diesem Kontext eine ToolBox gefordert? + // Is a ToolBox required in this context ? bool bModesMatching = ( nUpdateMode && ( nTbxMode & nUpdateMode) == nUpdateMode ); if ( bDestroy ) { @@ -1516,7 +1495,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 +1509,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,7 +1530,7 @@ bool SfxWorkWindow::AllowChildWindowCreation_Impl( const SfxChildWin_Impl& i_rCW void SfxWorkWindow::UpdateChildWindows_Impl() { - // alle vorhandenen oder in den Kontext gekommenen ChildWindows + // any current or in the context available Childwindows for ( sal_uInt16 n=0; n<pChildWins->Count(); n++ ) { SfxChildWin_Impl *pCW = (*pChildWins)[n]; @@ -1559,8 +1538,8 @@ void SfxWorkWindow::UpdateChildWindows_Impl() sal_Bool bCreate = sal_False; if ( pCW->nId && !pCW->bDisabled && (pCW->aInfo.nFlags & SFX_CHILDWIN_ALWAYSAVAILABLE || IsVisible_Impl( pCW->nVisibility ) ) ) { - // Im Kontext ist ein geeignetes ChildWindow erlaubt; - // ist es auch eingeschaltet ? + // In the context is an appropriate ChildWindow allowed; + // it is also turned on? if ( pChildWin == NULL && pCW->bCreate ) { // Internal docking is only used for embedding into another @@ -1574,7 +1553,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 ); @@ -1585,8 +1564,8 @@ void SfxWorkWindow::UpdateChildWindows_Impl() if ( bCreate ) bCreate = AllowChildWindowCreation_Impl( *pCW ); - // Momentan kein Fenster da, aber es ist eingeschaltet; Fenster - // und ggf. Context erzeugen + // Currently, no window here, but it is enabled; windows + // Create window and if possible theContext if ( bCreate ) CreateChildWin_Impl( pCW, sal_False ); @@ -1598,23 +1577,23 @@ 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 + // Update Mode is compatible; definitely enable it bCreate = AllowChildWindowCreation_Impl( *pCW ); if ( bCreate ) { if ( pCW->pCli ) { - // Fenster ist direktes Child + // The window is a direct Child if ( bAllChildsVisible && ( (IsDockingAllowed() && bInternalDockingAllowed) || pCW->pCli->eAlign == SFX_ALIGN_NOALIGNMENT ) ) pCW->pCli->nVisible |= CHILD_NOT_HIDDEN; } else { if ( pCW->bCreate && IsDockingAllowed() && bInternalDockingAllowed ) - // Fenster liegt in einem SplitWindow + // The window ia within a SplitWindow ((SfxDockingWindow*)pChildWin->GetWindow())->Reappear_Impl(); } @@ -1654,21 +1633,15 @@ void SfxWorkWindow::CreateChildWin_Impl( SfxChildWin_Impl *pCW, sal_Bool bSetFoc 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 = sal_True; - - // Erzeugung war erfolgreich + // The creation was successful GetBindings().Invalidate(pCW->nId); sal_uInt16 nPos = pChildWin->GetPosition(); @@ -1676,9 +1649,8 @@ void SfxWorkWindow::CreateChildWin_Impl( SfxChildWin_Impl *pCW, sal_Bool bSetFoc { DBG_ASSERT(nPos < SFX_OBJECTBAR_MAX, "Illegal objectbar position!"); if ((*pChilds)[TbxMatch(nPos)])// && -// pChildWin->GetAlignment() == (*pChilds)[nPos]->eAlign ) { - // ChildWindow ersetzt ObjectBar + // ChildWindow replaces ObjectBar (*pChilds)[TbxMatch(nPos)]->nVisible ^= CHILD_NOT_HIDDEN; } } @@ -1690,9 +1662,8 @@ void SfxWorkWindow::CreateChildWin_Impl( SfxChildWin_Impl *pCW, sal_Bool bSetFoc 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 +1672,15 @@ void SfxWorkWindow::CreateChildWin_Impl( SfxChildWin_Impl *pCW, sal_Bool bSetFoc } 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 +1690,7 @@ void SfxWorkWindow::RemoveChildWin_Impl( SfxChildWin_Impl *pCW ) sal_uInt16 nId = pCW->nSaveId; SfxChildWindow *pChildWin = pCW->pWin; - // vorhandenes Fenster geht aus dem Kontext und wird daher entfernt - sal_uInt16 nPos = pChildWin->GetPosition(); - if (nPos != CHILDWIN_NOPOS) - { -/* - // ChildWindow "uberlagert einen ObjectBar - DBG_ASSERT(nPos < SFX_OBJECTBAR_MAX, "Illegal objectbar position!"); - if ((*pChilds)[TbxMatch(nPos)] && - (aObjBars[nPos].nMode & nUpdateMode) ) //&& -// pChildWin->GetAlignment() == (*pChilds)[nPos]->eAlign ) - { - // ObjectBar war "uberlagert; jetzt wieder anzeigen - (*pChilds)[TbxMatch(nPos)]->nVisible ^= CHILD_NOT_HIDDEN; - } -*/ - } - - // Information in der INI-Datei sichern + // Save the information in the INI file sal_uInt16 nFlags = pCW->aInfo.nFlags; pCW->aInfo = pChildWin->GetInfo(); pCW->aInfo.nFlags |= nFlags; @@ -1748,15 +1700,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 +1750,8 @@ void SfxWorkWindow::SetTempStatusBar_Impl( sal_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,42 +1770,25 @@ 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 ); } } -//------------------------------------------------------------------------ -/* -void SfxWorkWindow::SetObjectBarVisibility_Impl( sal_uInt16 nMask ) -{ - switch( nMask ) - { - case SFX_VISIBILITY_UNVISIBLE: - case SFX_VISIBILITY_STANDARD: - case SFX_VISIBILITY_CLIENT: - case SFX_VISIBILITY_SERVER: - nOrigMode = nMask; - } - if (nMask != nUpdateMode) - nUpdateMode = nMask; -}*/ - void SfxWorkWindow::MakeVisible_Impl( sal_Bool bVis ) { if ( bVis ) @@ -1997,14 +1933,13 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild, if ( nPos == USHRT_MAX ) return; -// SfxChild_Impl *pChild = (*pChilds)[nPos]; Rectangle aOuterRect( GetTopRect_Impl() ); aOuterRect.SetPos( pWorkWin->OutputToScreenPixel( aOuterRect.TopLeft() )); Rectangle aInnerRect( aOuterRect ); sal_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 ( sal_uInt16 m=0; m<aSortedList.Count(); ++m ) { sal_uInt16 i=aSortedList[m]; @@ -2015,93 +1950,89 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild, switch ( pCli->eAlign ) { case SFX_ALIGN_TOP: - // Objekt-Toolboxen kommen immer zuletzt - //if ( bTbx || i <= nPos) + // Objekt-Toolboxes come always last 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 - //if ( bTbx || i <= nPos) + // Objekt-Toolboxes come always last 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 - //if (bTbx || i <= nPos) + // Toolboxes come always last 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 - //if (bTbx || i <= nPos) + // Toolboxes come always last 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; @@ -2162,7 +2093,6 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild, } } - //-------------------------------------------------------------------- void SfxWorkWindow::SetChildWindowVisible_Impl( sal_uInt32 lId, sal_Bool bEnabled, sal_uInt16 nMode ) @@ -2173,14 +2103,14 @@ void SfxWorkWindow::SetChildWindowVisible_Impl( sal_uInt32 lId, sal_Bool bEnable 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? sal_uInt16 nCount = pWork->pChildWins->Count(); for (sal_uInt16 n=0; n<nCount; n++) if ((*pWork->pChildWins)[n]->nSaveId == nId) @@ -2192,7 +2122,7 @@ void SfxWorkWindow::SetChildWindowVisible_Impl( sal_uInt32 lId, sal_Bool bEnable 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 sal_uInt16 nCount = pChildWins->Count(); for (sal_uInt16 n=0; n<nCount; n++) if ((*pChildWins)[n]->nSaveId == nId) @@ -2204,8 +2134,8 @@ void SfxWorkWindow::SetChildWindowVisible_Impl( sal_uInt32 lId, sal_Bool bEnable 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 +2150,11 @@ void SfxWorkWindow::SetChildWindowVisible_Impl( sal_uInt32 lId, sal_Bool bEnable 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(sal_uInt16 nId, sal_Bool bSetFocus) { @@ -2241,7 +2166,7 @@ void SfxWorkWindow::ToggleChildWindow_Impl(sal_uInt16 nId, sal_Bool bSetFocus) if ( n<nCount ) { - // Das Fenster ist schon bekannt + // The Window is aleady known SfxChildWin_Impl *pCW = (*pChildWins)[n]; SfxChildWindow *pChild = pCW->pWin; @@ -2268,7 +2193,7 @@ void SfxWorkWindow::ToggleChildWindow_Impl(sal_uInt16 nId, sal_Bool bSetFocus) } else { - // Fenster soll ausgeschaltet werdem + // The Window should be switched off pChild->SetVisible_Impl( sal_False ); RemoveChildWin_Impl( pCW ); } @@ -2331,11 +2256,11 @@ void SfxWorkWindow::ToggleChildWindow_Impl(sal_uInt16 nId, sal_Bool bSetFocus) if ( n < nCount ) { - DBG_ERROR("ChildWindow ist nicht im Kontext!"); + OSL_FAIL("The ChildWindow is not in context!"); } else { - DBG_ERROR("ChildWindow ist nicht registriert!"); + OSL_FAIL("The ChildWindow is not registered!"); } #endif } @@ -2368,14 +2293,14 @@ sal_Bool SfxWorkWindow::IsFloating( sal_uInt16 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? sal_uInt16 nCount = pWork->pChildWins->Count(); for (sal_uInt16 n=0; n<nCount; n++) if ((*pWork->pChildWins)[n]->nSaveId == nId) @@ -2387,7 +2312,7 @@ sal_Bool SfxWorkWindow::IsFloating( sal_uInt16 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 sal_uInt16 nCount = pChildWins->Count(); for (sal_uInt16 n=0; n<nCount; n++) if ((*pChildWins)[n]->nSaveId == nId) @@ -2399,8 +2324,8 @@ sal_Bool SfxWorkWindow::IsFloating( sal_uInt16 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 = sal_False; pCW->nId = 0; @@ -2452,14 +2377,14 @@ void SfxWorkWindow::SetChildWindow_Impl(sal_uInt16 nId, sal_Bool bOn, sal_Bool b 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? sal_uInt16 nCount = pWork->pChildWins->Count(); for (sal_uInt16 n=0; n<nCount; n++) if ((*pWork->pChildWins)[n]->nSaveId == nId) @@ -2471,7 +2396,7 @@ void SfxWorkWindow::SetChildWindow_Impl(sal_uInt16 nId, sal_Bool bOn, sal_Bool b 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 sal_uInt16 nCount = pChildWins->Count(); for (sal_uInt16 n=0; n<nCount; n++) if ((*pChildWins)[n]->nSaveId == nId) @@ -2484,8 +2409,8 @@ void SfxWorkWindow::SetChildWindow_Impl(sal_uInt16 nId, sal_Bool bOn, sal_Bool b 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 +2501,11 @@ void SfxWorkWindow::ShowChildWindow_Impl(sal_uInt16 nId, sal_Bool bVisible, sal_ if ( n<nCount ) { - DBG_ERROR("ChildWindow ist nicht im Kontext!"); + OSL_FAIL("The ChildWindow is not in context!"); } else { - DBG_ERROR("ChildWindow ist nicht registriert!"); + OSL_FAIL("The ChildWindow is not registered"); } #endif } @@ -2606,8 +2531,6 @@ SfxChildWindow* SfxWorkWindow::GetChildWindow_Impl(sal_uInt16 nId) void SfxWorkWindow::ResetChildWindows_Impl() { -// if ( pParent ) -// pParent->ResetChildWindows_Impl(); for ( sal_uInt16 n = 0; n < pChildWins->Count(); ++n ) { @@ -2617,9 +2540,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 +2549,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 +2558,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. sal_Bool SfxWorkWindow::RequestTopToolSpacePixel_Impl( SvBorder aBorder ) { @@ -2652,7 +2573,7 @@ sal_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); } @@ -2718,11 +2639,6 @@ void SfxWorkWindow::InitializeChild_Impl(SfxChildWin_Impl *pCW) } } } -/* -SfxStatBar_Impl* SfxWorkWindow::GetStatusBar_Impl() -{ - return &aStatBar; -} */ SfxSplitWindow* SfxWorkWindow::GetSplitWindow_Impl( SfxChildAlignment eAlign ) { @@ -2815,11 +2731,10 @@ void SfxWorkWindow::ArrangeAutoHideWindows( SfxSplitWindow *pActSplitWin ) Rectangle aArea( aUpperClientArea ); for ( sal_uInt16 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]; sal_Bool bDummyWindow = !pSplitWin->IsFadeIn(); Window *pDummy = pSplitWin->GetSplitWindow(); @@ -2827,7 +2742,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 +2750,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 +2764,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 +2791,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 +2811,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 +2839,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 ); } } @@ -3010,7 +2926,7 @@ Window* SfxWorkWindow::GetActiveChild_Impl() sal_Bool SfxWorkWindow::ActivateNextChild_Impl( sal_Bool bForward ) { - // Alle Kinder gem"a\s Liste sortieren + // Sort all children under list SvUShorts aList; for ( sal_uInt16 i=SFX_OBJECTBAR_MAX; i<pChilds->Count(); i++) { @@ -3040,7 +2956,7 @@ sal_Bool SfxWorkWindow::ActivateNextChild_Impl( sal_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 +2976,7 @@ sal_Bool SfxWorkWindow::ActivateNextChild_Impl( sal_Bool bForward ) { for ( sal_uInt16 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 +2986,8 @@ sal_Bool SfxWorkWindow::ActivateNextChild_Impl( sal_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 +3005,11 @@ sal_Bool SfxWorkWindow::ActivateNextChild_Impl( sal_Bool bForward ) SfxChild_Impl* pNext = pCli; for ( sal_uInt16 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 +3056,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 6e6606a67041..17a27c6c8ce9 100644..100755 --- 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 ff3b84dbec64..03ef58e27e03 100644..100755 --- 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 b585ac79f035..fd53e2577212 100644..100755 --- 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/bastyp.src b/sfx2/source/bastyp/bastyp.src index 5ef74f5874b3..5ef74f5874b3 100644..100755 --- a/sfx2/source/bastyp/bastyp.src +++ b/sfx2/source/bastyp/bastyp.src diff --git a/sfx2/source/bastyp/bitset.cxx b/sfx2/source/bastyp/bitset.cxx index dde66315720f..1a462c8133e2 100644..100755 --- 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 @@ sal_uInt16 IndexBitSet::GetFreeIndex() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx index f73e6e5498ad..fc284d4c2d19 100644..100755 --- 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,16 +79,13 @@ #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> #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/ucb/XContent.hpp> #include <rtl/ustring.hxx> -#include <vos/process.hxx> #include <unotools/pathoptions.hxx> #include <unotools/moduleoptions.hxx> #include <comphelper/mediadescriptor.hxx> @@ -105,7 +97,6 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::ucb; using namespace ::com::sun::star::document; using namespace ::com::sun::star::beans; -using namespace ::vos; #include <svl/ctypeitm.hxx> #include <svtools/sfxecode.hxx> #include <unotools/syslocale.hxx> @@ -240,10 +231,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; @@ -321,12 +311,12 @@ void SfxFilterMatcher_Impl::Update() if ( pList ) { // this List was already used - pList->Clear(); - for ( sal_uInt16 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 ); } } } @@ -356,10 +346,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; @@ -373,10 +362,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 { @@ -389,7 +378,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; } @@ -424,7 +417,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; @@ -470,7 +463,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); @@ -492,7 +485,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 ); @@ -500,11 +493,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) ); @@ -522,9 +515,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 */ { @@ -563,17 +556,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 ); @@ -612,7 +606,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 ) ) @@ -628,7 +622,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; @@ -649,10 +643,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; @@ -662,7 +655,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 ); } @@ -671,11 +664,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 ) { @@ -692,7 +684,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 ); } @@ -701,10 +693,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 ) ) { @@ -732,7 +723,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; @@ -746,7 +737,7 @@ const SfxFilter* SfxFilterMatcher::GetFilter4ClipBoardId( sal_uInt32 nId, SfxFil 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 ); } @@ -755,10 +746,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 ) @@ -778,7 +768,7 @@ const SfxFilter* SfxFilterMatcher::GetFilter4FilterName( const String& rName, Sf sal_uInt16 nIndex = aName.SearchAscii(": "); if ( nIndex != STRING_NOTFOUND ) { - DBG_ERROR("Old filter name used!"); + OSL_FAIL("Old filter name used!"); aName = rName.Copy( nIndex + 2 ); } @@ -799,9 +789,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; @@ -816,10 +806,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; @@ -845,7 +834,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(); } @@ -855,9 +844,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; @@ -950,33 +939,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! @@ -998,25 +987,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; @@ -1035,7 +1024,7 @@ void SfxFilterContainer::ReadSingleFilter_Impl( { nClipboardId = SotExchange::RegisterFormatName( sHumanName ); - // #100570# For external filters ignore clipboard IDs + // For external filters ignore clipboard IDs if((nFlags & SFX_FILTER_STARONEFILTER) == SFX_FILTER_STARONEFILTER) { nClipboardId = 0; @@ -1047,7 +1036,7 @@ void SfxFilterContainer::ReadSingleFilter_Impl( sal_Int32 nStartRealName = sFilterName.indexOf( DEFINE_CONST_UNICODE(": "), 0 ); if( nStartRealName != -1 ) { - DBG_ERROR("Old format, not supported!"); + OSL_FAIL("Old format, not supported!"); sFilterName = sFilterName.copy( nStartRealName+2 ); } @@ -1090,7 +1079,7 @@ void SfxFilterContainer::ReadSingleFilter_Impl( pFilter->SetURLPattern(sPattern); if (bNew) - rList.Insert( pFilter, USHRT_MAX ); + rList.push_back( pFilter ); } } @@ -1128,15 +1117,14 @@ void SfxFilterContainer::ReadFilters_Impl( sal_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 = sal_True; - sal_uInt16 nCount = (sal_uInt16)rList.Count(); SfxFilter* pFilter; - for (sal_uInt16 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; } } @@ -1149,17 +1137,6 @@ void SfxFilterContainer::ReadFilters_Impl( sal_Bool bUpdate ) // Try to get filter .. but look for any exceptions! // May be filter was deleted by another thread ... ::rtl::OUString sFilterName = lFilterNames[nFilter]; - - // This debug code can be used to break on inserting/updating - // special debug filters at runtime. - // Otherwise you have to check more then 300 filter names manually .-) - // And conditional breakpoints on unicode values seams not to be supported .-( - #ifdef DEBUG - bool bDBGStop = sal_False; - if (sFilterName.indexOf(::rtl::OUString::createFromAscii("DBG_"))>-1) - bDBGStop = sal_True; - #endif - ReadSingleFilter_Impl( sFilterName, xTypeCFG, xFilterCFG, bUpdate ); } } @@ -1177,3 +1154,5 @@ void SfxFilterContainer::ReadFilters_Impl( sal_Bool bUpdate ) pImplArr->GetObject(n)->Update(); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/bastyp/fltfnc.src b/sfx2/source/bastyp/fltfnc.src index 4203163eceeb..4203163eceeb 100644..100755 --- a/sfx2/source/bastyp/fltfnc.src +++ b/sfx2/source/bastyp/fltfnc.src diff --git a/sfx2/source/bastyp/fltlst.cxx b/sfx2/source/bastyp/fltlst.cxx index 297dedc50807..3fc966c45d8e 100644..100755 --- 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 b3afb425634d..02af4663037c 100644..100755 --- 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 fb850b624695..6ea2f1b50d98 100644..100755 --- 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. @@ -28,7 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" -#include <tools/list.hxx> #include <tools/table.hxx> #include <svtools/htmltokn.h> #include <svtools/asynclink.hxx> @@ -50,14 +50,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 +67,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 ! sal_Bool bMarginWidth = sal_False, bMarginHeight = sal_False; sal_uInt16 nArrLen = pOptions->Count(); @@ -102,8 +102,6 @@ void SfxFrameHTMLParser::ParseFrameOptions( SfxFrameDescriptor *pFrame, const HT case HTML_O_MARGINWIDTH: aMargin.Width() = pOption->GetNumber(); -// if( aMargin.Width() < 1 ) -// aMargin.Width() = 1; if( !bMarginHeight ) aMargin.Height() = 0; bMarginWidth = sal_True; @@ -111,8 +109,6 @@ void SfxFrameHTMLParser::ParseFrameOptions( SfxFrameDescriptor *pFrame, const HT case HTML_O_MARGINHEIGHT: aMargin.Height() = pOption->GetNumber(); -// if( aMargin.Height() < 1 ) -// aMargin.Height() = 1; if( !bMarginWidth ) aMargin.Width() = 0; bMarginHeight = sal_True; @@ -161,3 +157,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 9330608d9f8b..cc2fd26d2bea 100644..100755 --- 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. @@ -28,12 +29,9 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" -#ifndef _INETDEF_HXX #include <svl/inetdef.hxx> -#endif #include "svtools/htmlkywd.hxx" -//!(dv) #include <chaos2/cntapi.hxx> #include <rtl/tencinfo.h> #include <unotools/configmgr.hxx> @@ -62,26 +60,15 @@ 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="; - -/* not used anymore? -static HTMLOutEvent __FAR_DATA aFrameSetEventTable[] = -{ - { sHTML_O_SDonload, sHTML_O_onload, SFX_EVENT_OPENDOC }, - { sHTML_O_SDonunload, sHTML_O_onunload, SFX_EVENT_PREPARECLOSEDOC }, - { sHTML_O_SDonfocus, sHTML_O_onfocus, SFX_EVENT_ACTIVATEDOC }, - { sHTML_O_SDonblur, sHTML_O_onblur, SFX_EVENT_DEACTIVATEDOC }, - { 0, 0, 0 } -}; -*/ +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="; #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, @@ -165,7 +152,7 @@ void SfxFrameHTMLWriter::Out_DocInfo( SvStream& rStrm, const String& rBaseURL, { // Reload if( (i_xDocProps->getAutoloadSecs() != 0) || - !i_xDocProps->getAutoloadURL().equalsAscii("") ) + i_xDocProps->getAutoloadURL().getLength() ) { String sContent = String::CreateFromInt32( i_xDocProps->getAutoloadSecs() ); @@ -236,7 +223,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); @@ -264,23 +251,6 @@ void SfxFrameHTMLWriter::Out_DocInfo( SvStream& rStrm, const String& rBaseURL, } } } -/* -void SfxFrameHTMLWriter::OutHeader( rtl_TextEncoding eDestEnc ) -{ - // <HTML> - // <HEAD> - // <TITLE>Titel</TITLE> - // </HEAD> - HTMLOutFuncs::Out_AsciiTag( Strm(), sHTML_html ) << sNewLine; - HTMLOutFuncs::Out_AsciiTag( Strm(), sHTML_head ); - - Out_DocInfo( Strm(), &pDoc->GetDocInfo(), "\t", eDestEnc ); - Strm() << sNewLine; - HTMLOutFuncs::Out_AsciiTag( Strm(), sHTML_head, sal_False ) << sNewLine; - -//! OutScript(); // Hier fehlen noch die Scripten im Header -} -*/ void SfxFrameHTMLWriter::Out_FrameDescriptor( SvStream& rOut, const String& rBaseURL, const uno::Reference < beans::XPropertySet >& xSet, @@ -290,7 +260,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 +275,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 +285,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,29 +305,16 @@ 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; (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_frameborder) += '=') += pStr; } } - - // TODO/LATER: currently not supported attributes - // resize - //if( !pFrame->IsResizable() ) - // (sOut += ' ') += sHTML_O_noresize; - // - //if ( pFrame->GetWallpaper() ) - //{ - // ((sOut += ' ') += sHTML_O_bordercolor) += '='; - // rOut << sOut.GetBuffer(); - // HTMLOutFuncs::Out_Color( rOut, pFrame->GetWallpaper()->GetColor(), eDestEnc ); - //} - //else rOut << sOut.GetBuffer(); } catch ( uno::Exception& ) @@ -372,10 +329,10 @@ String SfxFrameHTMLWriter::CreateURL( SfxFrame* pFrame ) if( !aRet.Len() && pShell ) { aRet = pShell->GetMedium()->GetName(); -//!(dv) CntAnchor::ToPresentationURL( aRet ); } return aRet; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/bastyp/helper.cxx b/sfx2/source/bastyp/helper.cxx index 3493981e5a25..123951f1bcff 100644..100755 --- 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,19 @@ #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; + +using ::rtl::OUString; +using ::rtl::OStringBuffer; +using ::rtl::OStringToOUString; + +typedef vector< OUString* > StringList_Impl; #define CONVERT_DATETIME( aUnoDT, aToolsDT ) \ aToolsDT = DateTime( Date( aUnoDT.Day, aUnoDT.Month, aUnoDT.Year ), \ @@ -102,7 +109,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 +212,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 +238,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 +267,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 +285,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 +314,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 +322,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 +342,16 @@ uno::Sequence < OUString > SfxContentHelper::GetFolderContents( const String& rF if ( pFiles ) { - sal_uIntPtr nCount = pFiles->Count(); + size_t nCount = pFiles->size(); uno::Sequence < OUString > aRet( nCount ); OUString* pRet = aRet.getArray(); - for ( sal_uIntPtr 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 +376,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 +391,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 +407,6 @@ uno::Sequence < OUString > SfxContentHelper::GetFolderContentProperties( const S { xResultSet = xDynamicResultSet->getStaticResultSet(); } - -// if ( xDynResultSet.is() ) -// xResultSet = xDynResultSet->getStaticResultSet(); } catch( ucb::CommandAbortedException& ) { @@ -415,10 +420,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 ); - sal_uIntPtr nFolderPos = LIST_APPEND; + size_t nFolderPos = size_t(-1); try { @@ -428,12 +433,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 +445,23 @@ uno::Sequence < OUString > SfxContentHelper::GetFolderContentProperties( const S aRow += '\t'; aRow += bFolder ? '1' : '0'; OUString* pRow = new OUString( aRow ); - sal_uIntPtr 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 +481,16 @@ uno::Sequence < OUString > SfxContentHelper::GetFolderContentProperties( const S if ( pProperties ) { - sal_uIntPtr nCount = pProperties->Count(); + size_t nCount = pProperties->size(); uno::Sequence < OUString > aRet( nCount ); OUString* pRet = aRet.getArray(); - for ( sal_uIntPtr 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 +510,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 +531,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 +547,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 +575,16 @@ uno::Sequence < OUString > SfxContentHelper::GetResultSet( const String& rURL ) if ( pList ) { - sal_uIntPtr nCount = pList->Count(); + size_t nCount = pList->size(); uno::Sequence < OUString > aRet( nCount ); OUString* pRet = aRet.getArray(); - for ( sal_uIntPtr 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 +607,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 +626,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 +642,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 +659,16 @@ uno::Sequence< OUString > SfxContentHelper::GetHelpTreeViewContents( const Strin if ( pProperties ) { - sal_uIntPtr nCount = pProperties->Count(); + size_t nCount = pProperties->size(); uno::Sequence < OUString > aRet( nCount ); OUString* pRet = aRet.getArray(); - for ( sal_uIntPtr 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 +719,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 +797,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 +823,7 @@ sal_uIntPtr 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 +890,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 0b5315eab809..db1899e23b71 100644..100755 --- 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 9559de4069b0..4deae2555f0a 100644..100755 --- 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 ) { sal_uInt16 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 ) sal_uInt16 SfxPtrArr::Remove( sal_uInt16 nPos, sal_uInt16 nLen ) { DBG_MEMTEST(); - // nLen adjustieren, damit nicht ueber das Ende hinaus geloescht wird + // Adjust nLen, thus to avoid deleting beyond the end nLen = Min( (sal_uInt16)(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 @@ sal_uInt16 SfxPtrArr::Remove( sal_uInt16 nPos, sal_uInt16 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 sal_uInt16 nNewUsed = nUsed-nLen; sal_uInt16 nNewSize = ((nNewUsed+nGrow-1)/nGrow) * nGrow; DBG_ASSERT( nNewUsed <= nNewSize && nNewUsed+nGrow > nNewSize, @@ -170,7 +168,7 @@ sal_uInt16 SfxPtrArr::Remove( sal_uInt16 nPos, sal_uInt16 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 @@ sal_uInt16 SfxPtrArr::Remove( sal_uInt16 nPos, sal_uInt16 nLen ) sal_Bool SfxPtrArr::Remove( void* aElem ) { DBG_MEMTEST(); - // einfache Aufgaben ... + // simple tasks ... if ( nUsed == 0 ) return sal_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 ( sal_uInt16 n = 0; n < nUsed; ++n, --pIter ) if ( *pIter == aElem ) @@ -203,11 +201,11 @@ sal_Bool SfxPtrArr::Remove( void* aElem ) sal_Bool SfxPtrArr::Replace( void* aOldElem, void* aNewElem ) { DBG_MEMTEST(); - // einfache Aufgaben ... + // simple tasks ... if ( nUsed == 0 ) return sal_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 ( sal_uInt16 n = 0; n < nUsed; ++n, --pIter ) if ( *pIter == aOldElem ) @@ -242,10 +240,10 @@ void SfxPtrArr::Insert( sal_uInt16 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 sal_uInt16 nNewSize = nUsed+nGrow; void** pNewData = new void*[nNewSize]; @@ -259,11 +257,11 @@ void SfxPtrArr::Insert( sal_uInt16 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 ) { sal_uInt16 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 ) sal_uInt16 ByteArr::Remove( sal_uInt16 nPos, sal_uInt16 nLen ) { DBG_MEMTEST(); - // nLen adjustieren, damit nicht ueber das Ende hinaus geloescht wird + // Adjust nLen, thus to avoid deleting beyond the end nLen = Min( (sal_uInt16)(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 @@ sal_uInt16 ByteArr::Remove( sal_uInt16 nPos, sal_uInt16 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 sal_uInt16 nNewUsed = nUsed-nLen; sal_uInt16 nNewSize = ((nNewUsed+nGrow-1)/nGrow) * nGrow; DBG_ASSERT( nNewUsed <= nNewSize && nNewUsed+nGrow > nNewSize, @@ -405,7 +403,7 @@ sal_uInt16 ByteArr::Remove( sal_uInt16 nPos, sal_uInt16 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 @@ sal_uInt16 ByteArr::Remove( sal_uInt16 nPos, sal_uInt16 nLen ) sal_Bool ByteArr::Remove( char aElem ) { DBG_MEMTEST(); - // einfache Aufgaben ... + // simple tasks ... if ( nUsed == 0 ) return sal_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 ( sal_uInt16 n = 0; n < nUsed; ++n, --pIter ) if ( *pIter == aElem ) @@ -456,10 +454,10 @@ sal_Bool ByteArr::Contains( const char rItem ) const void ByteArr::Insert( sal_uInt16 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 sal_uInt16 nNewSize = nUsed+nGrow; char* pNewData = new char[nNewSize]; @@ -473,11 +471,11 @@ void ByteArr::Insert( sal_uInt16 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 ) { sal_uInt16 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 ) sal_uInt16 WordArr::Remove( sal_uInt16 nPos, sal_uInt16 nLen ) { DBG_MEMTEST(); - // nLen adjustieren, damit nicht ueber das Ende hinaus geloescht wird + // Adjust nLen, thus to avoid deleting beyond the end nLen = Min( (sal_uInt16)(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 @@ sal_uInt16 WordArr::Remove( sal_uInt16 nPos, sal_uInt16 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 sal_uInt16 nNewUsed = nUsed-nLen; sal_uInt16 nNewSize = ((nNewUsed+nGrow-1)/nGrow) * nGrow; DBG_ASSERT( nNewUsed <= nNewSize && nNewUsed+nGrow > nNewSize, @@ -637,7 +635,7 @@ sal_uInt16 WordArr::Remove( sal_uInt16 nPos, sal_uInt16 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 @@ sal_uInt16 WordArr::Remove( sal_uInt16 nPos, sal_uInt16 nLen ) sal_Bool WordArr::Remove( short aElem ) { DBG_MEMTEST(); - // einfache Aufgaben ... + // simple tasks ... if ( nUsed == 0 ) return sal_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 ( sal_uInt16 n = 0; n < nUsed; ++n, --pIter ) if ( *pIter == aElem ) @@ -688,10 +686,10 @@ sal_Bool WordArr::Contains( const short rItem ) const void WordArr::Insert( sal_uInt16 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 sal_uInt16 nNewSize = nUsed+nGrow; short* pNewData = new short[nNewSize]; @@ -705,11 +703,11 @@ void WordArr::Insert( sal_uInt16 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 [] (sal_uInt16 nPos) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/bastyp/misc.cxx b/sfx2/source/bastyp/misc.cxx index ae3b0807bbe4..80991dcc492b 100644..100755 --- 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 3c4c78e9d630..0ad5de1fea52 100644..100755 --- 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,11 @@ #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 #include "appdata.hxx" #include <sfx2/request.hxx> #include <sfx2/frame.hxx> @@ -114,7 +112,7 @@ struct SfxProgress_Impl #define aTypeLibInfo aProgressTypeLibImpl //======================================================================== -extern sal_uIntPtr Get10ThSec(); +extern sal_uInt32 Get10ThSec(); // ----------------------------------------------------------------------- @@ -150,31 +148,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 */ - sal_uIntPtr nRange, /* Maximalwert des Bereiches */ + sal_uIntPtr nRange, /* Max value for range */ - sal_Bool bAll /* alle Dokumente oder nur das Dokument des ViewFrames - disablen (sal_False) */ - ,sal_Bool bWait /* initial den Wait-Pointer aktivieren (sal_True) */ + sal_Bool bAll, /* Disable all documents or only the document of the ViewFram */ + sal_Bool bWait /* Activate 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(sal_True) { @@ -207,11 +204,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 +224,9 @@ SfxProgress::~SfxProgress() void SfxProgress::Stop() -/* [Beschreibung] +/* [Description] - Vorzeitiges Beenden des <SfxProgress>. + Early Exit of <SfxProgress>. */ { @@ -259,13 +255,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. */ { @@ -285,29 +280,8 @@ const String& SfxProgress::GetStateText_Impl() const } // ----------------------------------------------------------------------- -/* -IMPL_STATIC_LINK( SfxProgress, SetStateHdl, PlugInLoadStatus*, pStatus ) -{ - INetRequest* pReq = 0; - const INetHint *pHint = PTR_CAST( INetHint, pStatus->pHint ); - pReq = PTR_CAST( INetRequest, pStatus->pBC ); - - String aString; - if( pReq ) - aString = SfxMedium::GetStatusString( pHint->GetId(), pReq, pHint ); - if( aString.Len() ) - { - GetpApp()->ShowStatusText( aString ); - if( pThis ) - pThis->pImp->bIsStatusText = sal_True; - } - return 0; -} -*/ - -// ----------------------------------------------------------------------- -// muss in AppDaten +// Required in App data static sal_uIntPtr nLastTime = 0; long TimeOut_Impl( void*, void* pArgV ) @@ -327,9 +301,9 @@ long TimeOut_Impl( void*, void* pArgV ) sal_Bool SfxProgress::SetStateText ( - sal_uLong nNewVal, /* neuer Wert f"ur die Fortschritts-Anzeige */ - const String& rNewVal, /* Status als Text */ - sal_uLong nNewRange /* neuer Maximalwert, 0 f"ur Beibehaltung des alten */ + sal_uLong nNewVal, /* New value for the progress-bar */ + const String& rNewVal, /* Status as Text */ + sal_uLong nNewRange /* new maximum value, 0 for retaining the old */ ) { @@ -341,43 +315,34 @@ sal_Bool SfxProgress::SetStateText sal_Bool SfxProgress::SetState ( - sal_uLong nNewVal, /* neuer Wert f"ur die Fortschritts-Anzeige */ + sal_uLong nNewVal, /* new value for the progress bar */ - sal_uLong nNewRange /* neuer Maximalwert, 0 f"ur Beibehaltung des alten */ + sal_uLong nNewRange /* new maximum value, 0 for retaining the old */ ) -/* [Beschreibung] - - Setzen des aktuellen Status; nach einem zeitlichen Versatz - wird Reschedule aufgerufen. +/* [Description] + Setting the current status, after a time delay Reschedule is called. - [R"uckgabewert] + [Return value] sal_Bool TRUE - Fortfahren mit der Aktion + Proceed with the action FALSE - Abbrechen der Aktion + Cancel action */ { - // wurde via Stop-Button angehalten? -// if ( pImp->IsCancelled() ) -// return sal_False; - if( pImp->pActiveProgress ) return sal_True; - // neuen Wert "ubernehmen - sal_Bool bOver=sal_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 = sal_True; } if ( !pImp->xStatusInd.is() ) @@ -400,14 +365,6 @@ sal_Bool SfxProgress::SetState SFX_ITEMSET_ARG( pMedium->GetItemSet(), pHiddenItem, SfxBoolItem, SID_HIDDEN, sal_False ); if ( !pHiddenItem || !pHiddenItem->GetValue() ) { - // not in a view, perhaps it's just loading - //SfxFrame* pFrame = pMedium->GetLoadTargetFrame(); - //if ( pFrame && pFrame->GetCurrentViewFrame() ) - //{ - // recycling frame - //pImp->pView = pFrame->GetCurrentViewFrame(); - //} - //else { SFX_ITEMSET_ARG( pMedium->GetItemSet(), pIndicatorItem, SfxUnoAnyItem, SID_PROGRESS_STATUSBAR_CONTROL, sal_False ); Reference< XStatusIndicator > xInd; @@ -443,11 +400,12 @@ sal_Bool SfxProgress::SetState void SfxProgress::Resume() -/* [Beschreibung] +/* [Description] + + Resumed the status of the display after an interrupt. - Nimmt die Anzeige des Status nach einer Unterbrechung wieder auf. + [Cross-reference] - [Querverweise] <SfxProgress::Suspend()> */ @@ -488,11 +446,12 @@ void SfxProgress::Resume() void SfxProgress::Suspend() -/* [Beschreibung] +/* [Description] - Unterbricht die Anzeige des Status + Interrupts the status of the display + + [Cross-reference] - [Querverweise] <SfxProgress::Resume()> */ @@ -530,8 +489,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 +540,9 @@ void SfxProgress::UnLock() void SfxProgress::Reschedule() -/* [Beschreibung] - - Reschedule von au"sen rufbar +/* [Description] + Reschedule, callable from the outside */ { @@ -609,16 +567,13 @@ void SfxProgress::Reschedule() void SfxProgress::SetWaitMode ( sal_Bool bWait /* TRUE - Wartecursor wird verwendet - FALSE - Es wird kein Wartecursor verwendet */ + FALSE Wait-cursor not used */ ) -/* [Beschreibung] - - Wartecursor-Modus umschalten. +/* [Description] + Switch Wait-mode. */ { @@ -656,10 +611,9 @@ void SfxProgress::SetWaitMode sal_Bool SfxProgress::GetWaitMode() const -/* [Beschreibung] - - Wartecursor-Modus abfragen. +/* [Description] + Get Wait-cursor mode. */ { @@ -670,36 +624,34 @@ sal_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 +687,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 sal_True; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/bastyp/sfxhtml.cxx b/sfx2/source/bastyp/sfxhtml.cxx index 7d86043308ce..24e0bbc630b6 100644..100755 --- 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,12 +58,12 @@ 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[] = +static HTMLOptionEnum const aAreaShapeOptEnums[] = { { OOO_STRING_SVTOOLS_HTML_SH_rect, IMAP_OBJ_RECTANGLE }, { OOO_STRING_SVTOOLS_HTML_SH_rectangle, IMAP_OBJ_RECTANGLE }, @@ -85,24 +86,24 @@ SfxHTMLParser::SfxHTMLParser( SvStream& rStream, sal_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( sal_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; } sal_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 @@ sal_Bool SfxHTMLParser::ParseAreaOptions(ImageMap * pImageMap, const String& rBa sal_uInt16 nEventMouseOver, sal_uInt16 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" ); sal_uInt16 nShape = IMAP_OBJ_RECTANGLE; SvULongs aCoords; @@ -246,53 +247,42 @@ 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, sal_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. - //const SfxMedium *pShMedium = pSh->GetMedium(); - //if( pShMedium ) - // pDLMedium->SetLoadTargetFrame( pShMedium->GetLoadTargetFrame() ); } - // Download anstossen (Achtung: Kann auch synchron sein). + // Push Download (Note: Can also be synchronous). if ( sal_True /*pMedium->GetDoneLink() == Link()*/ ) pDLMedium->DownLoad(); else { - // Downloading-Flag auf sal_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( sal_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; } } } -sal_Bool SfxHTMLParser::GetFileDownloadMIME( String& rMIME ) -{ - return pDLMedium && pDLMedium->GetErrorCode()==0 && - pDLMedium->GetMIMEAndRedirect(rMIME)==0; -} - sal_Bool SfxHTMLParser::FinishFileDownload( String& rStr ) { String aStr; @@ -304,7 +294,7 @@ sal_Bool SfxHTMLParser::FinishFileDownload( String& rStr ) DBG_ASSERT( pStream, "Kein In-Stream vom Medium erhalten" ); SvMemoryStream aStream; - if( pStream ) // HACK wegen #65563# + if( pStream ) aStream << *pStream; aStream.Seek( STREAM_SEEK_TO_END ); @@ -314,17 +304,6 @@ sal_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 +319,11 @@ sal_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( sal_False ); - // ... und einmal aufrufen, damit weitergelesen wird. + // ... and call once, thus will continue reading. pThis->CallAsyncCallLink(); return 0; @@ -445,3 +424,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 0ed0aab649cf..219e41c5cd53 100644..100755 --- 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 59d3107532a4..eb13788aba94 100644..100755 --- 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 (sal_uInt16 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 sal_False; - for ( sal_uInt16 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 ) @@ -127,25 +124,25 @@ SfxPoolItem* SfxEventNamesItem::Clone( SfxItemPool *) const SfxPoolItem* SfxEventNamesItem::Create(SvStream &, sal_uInt16) const { - DBG_ERROR("not streamable!"); + OSL_FAIL("not streamable!"); return new SfxEventNamesItem(Which()); } SvStream& SfxEventNamesItem::Store(SvStream &rStream, sal_uInt16 ) const { - DBG_ERROR("not streamable!"); + OSL_FAIL("not streamable!"); return rStream; } sal_uInt16 SfxEventNamesItem::GetVersion( sal_uInt16 ) const { - DBG_ERROR("not streamable!"); + OSL_FAIL("not streamable!"); return 0; } void SfxEventNamesItem::AddEvent( const String& rName, const String& rUIName, sal_uInt16 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 d8e4258e60d4..20d45830021b 100644..100755 --- 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. @@ -28,7 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" -#include <hash_map> +#include <boost/unordered_map.hpp> #include <svl/itempool.hxx> #include <svl/itemiter.hxx> #include <svl/eitem.hxx> @@ -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> @@ -100,7 +98,7 @@ static sal_uInt16 nTimeOut = 300; static sal_uInt32 nCache1 = 0; static sal_uInt32 nCache2 = 0; -typedef std::hash_map< sal_uInt16, bool > InvalidateSlotMap; +typedef boost::unordered_map< USHORT, bool > InvalidateSlotMap; //==================================================================== @@ -150,33 +148,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), @@ -216,7 +214,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; @@ -246,21 +244,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(); @@ -268,7 +265,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); @@ -283,19 +280,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 ) { @@ -307,13 +304,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 ) @@ -325,7 +322,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); @@ -340,7 +337,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 ); } } @@ -357,7 +354,7 @@ SfxPopupAction SfxBindings::GetPopupAction_Impl() const void SfxBindings::HidePopups( bool bHide ) { - // SfxPopupWindows hiden + // Hide SfxPopupWindows HidePopupCtrls_Impl( bHide ); SfxBindings *pSub = pImp->pSubBindings; while ( pSub ) @@ -366,22 +363,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; } @@ -394,7 +391,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() ) @@ -408,7 +405,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; @@ -417,10 +414,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 ) @@ -441,8 +438,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 ); @@ -476,16 +474,12 @@ void SfxBindings::AddSlotToInvalidateSlotsMap_Impl( sal_uInt16 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 -// if ( nRegLevel ) -// return; - if ( pDispatcher ) pDispatcher->Flush(); @@ -513,7 +507,7 @@ void SfxBindings::Update if ( bInternalUpdate ) { - // Status erfragen + // Query Status const SfxSlotServer* pMsgServer = pCache->GetSlotServer(*pDispatcher, pImp->xProv); if ( !pCache->IsControllerDirty() && ( !pMsgServer || @@ -571,10 +565,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); @@ -585,12 +579,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; @@ -600,12 +594,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 } } } @@ -615,7 +609,7 @@ void SfxBindings::SetState void SfxBindings::SetState ( - const SfxPoolItem& rItem // zu setzender Status-Wert + const SfxPoolItem& rItem // Status value to be set ) { if ( nRegLevel ) @@ -624,22 +618,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 } } } @@ -657,13 +651,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(); @@ -686,11 +678,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); @@ -701,7 +690,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() ) @@ -716,21 +705,13 @@ void SfxBindings::InvalidateAll for ( sal_uInt16 n = 0; n < pImp->pCaches->Count(); ++n ) pImp->pCaches->GetObject(n)->Invalidate(bWithMsg); -/* - ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame > xFrame - ( pDispatcher->GetFrame()->GetFrame().GetFrameInterface(), UNO_QUERY ); - if ( bWithMsg && xFrame.is() ) - xFrame->contextChanged(); -*/ pImp->nMsgPos = 0; if ( !nRegLevel ) { pImp->aTimer.Stop(); pImp->aTimer.SetTimeout(TIMEOUT_FIRST); pImp->aTimer.Start(); -// pImp->bFirstRound = sal_True; -// pImp->nFirstShell = 0; } DBG_PROFSTOP(SfxBindingsInvalidateAll); @@ -740,13 +721,11 @@ 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); -// DBG_ASSERT( !pImp->bInUpdate, "SfxBindings::Invalidate while in update" ); - DBG_MEMTEST(); if ( pImp->bInUpdate ) @@ -763,35 +742,33 @@ 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 ) { pImp->aTimer.Stop(); pImp->aTimer.SetTimeout(TIMEOUT_FIRST); pImp->aTimer.Start(); -// pImp->bFirstRound = sal_True; -// pImp->nFirstShell = 0; } DBG_PROFSTOP(SfxBindingsInvalidateAll); @@ -801,17 +778,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" ); @@ -833,11 +808,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 ) { @@ -867,11 +842,10 @@ void SfxBindings::InvalidateShell void SfxBindings::Invalidate ( - sal_uInt16 nId // zu invalidierende Slot-Id + sal_uInt16 nId // Status value to be set ) { DBG_MEMTEST(); -// DBG_ASSERT( !pImp->bInUpdate, "SfxBindings::Invalidate while in update" ); if ( pImp->bInUpdate ) { @@ -905,9 +879,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(); @@ -996,7 +970,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 ) @@ -1077,7 +1051,6 @@ void SfxBindings::Release( SfxControllerItem& rItem ) { DBG_MEMTEST(); DBG_ASSERT( pImp->pCaches != 0, "SfxBindings not initialized" ); - //! DBG_ASSERT( nRegLevel > 0, "release without EnterRegistrations" ); DBG_ASSERT( !pImp->bInNextJob, "SfxBindings::Release while status-updating" ); ENTERREGISTRATIONS(); @@ -1112,11 +1085,6 @@ void SfxBindings::Release( SfxControllerItem& rItem ) // was this the last controller? if ( pCache->GetItemLink() == 0 && !pCache->GetInternalController() ) { -#ifdef slow - // remove the BoundFunc - delete (*pImp->pCaches)[nPos]; - pImp->pCaches->Remove(nPos, 1); -#endif pImp->bCtrlReleased = sal_True; } } @@ -1266,7 +1234,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 ); @@ -1275,12 +1244,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(); @@ -1300,7 +1269,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 ); @@ -1310,7 +1279,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()); @@ -1318,36 +1287,36 @@ void SfxBindings::Execute_Impl( SfxRequest& aReq, const SfxSlot* pSlot, SfxShell delete pNewItem; } else { - DBG_ERROR( "Toggle only for Enums and Bools allowed" ); + OSL_FAIL( "Toggle only for Enums and Bools allowed" ); } } 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 ); } else { - DBG_ERROR( "Toggle only for Enums and Bools allowed" ); + OSL_FAIL( "Toggle only for Enums and Bools allowed" ); } delete pNewItem; } else { - DBG_ERROR( "suspicious Toggle-Slot" ); + OSL_FAIL( "suspicious Toggle-Slot" ); } } @@ -1365,9 +1334,8 @@ void SfxBindings::UpdateSlotServer_Impl() DBG_MEMTEST(); DBG_ASSERT( pImp->pCaches != 0, "SfxBindings not initialized" ); - // synchronisieren + // synchronize pDispatcher->Flush(); -// pDispatcher->Update_Impl(); if ( pImp->bAllMsgDirty ) { @@ -1375,8 +1343,6 @@ void SfxBindings::UpdateSlotServer_Impl() { ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame > xFrame ( pDispatcher->GetFrame()->GetFrame().GetFrameInterface(), UNO_QUERY ); - //if ( xFrame.is() ) - // xFrame->contextChanged(); pImp->bContextChanged = sal_False; } else @@ -1404,9 +1370,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. */ { @@ -1417,10 +1383,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(); @@ -1438,30 +1404,29 @@ 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!" ); } 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 ); @@ -1470,24 +1435,23 @@ SfxItemSet* SfxBindings::CreateSet_Impl if ( !(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); @@ -1495,34 +1459,34 @@ SfxItemSet* SfxBindings::CreateSet_Impl pSiblingFnc = pServ->GetSlot()->GetStateFnc(); } - // Mu\s der Slot "uberhaupt upgedatet werden ? + // 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 !! + // 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; } @@ -1540,20 +1504,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; sal_uInt16 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); @@ -1564,7 +1528,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 @@ -1578,18 +1542,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 ); } @@ -1601,8 +1565,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), @@ -1610,7 +1574,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 ) @@ -1618,14 +1582,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 ) { @@ -1650,14 +1614,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 ); } } @@ -1676,8 +1640,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 @@ -1701,10 +1665,7 @@ IMPL_LINK( SfxBindings, NextJob_Impl, Timer *, pTimer ) // modifying the SfxObjectInterface-stack without SfxBindings => nothing to do SfxViewFrame* pFrame = pDispatcher->GetFrame(); - //<!--Modified by PengYunQuan for Validity Cell Range Picker - //if ( (pFrame && pFrame->GetObjectShell()->IsInModalMode()) || pSfxApp->IsDowning() || !pImp->pCaches->Count() ) if ( (pFrame && !pFrame->GetObjectShell()->AcceptStateUpdate()) || pSfxApp->IsDowning() || !pImp->pCaches->Count() ) - //-->Modified by PengYunQuan for Validity Cell Range Picker { DBG_PROFSTOP(SfxBindingsNextJob_Impl0); return sal_True; @@ -1715,7 +1676,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(); @@ -1744,26 +1705,9 @@ IMPL_LINK( SfxBindings, NextJob_Impl, Timer *, pTimer ) sal_Bool bWasDirty = pCache->IsControllerDirty(); if ( bWasDirty ) { -/* - 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 && - pMsgServer->GetShellLevel() != pImp->nFirstShell ) - bSkip = sal_True; - } - - if ( !bSkip ) - { -*/ Update_Impl( pCache ); DBG_ASSERT( nCount == pImp->pCaches->Count(), "Reschedule in StateChanged => buff" ); -// } } // skip to next function binding @@ -1773,8 +1717,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; @@ -1809,7 +1754,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); @@ -1818,7 +1763,7 @@ IMPL_LINK( SfxBindings, NextJob_Impl, Timer *, pTimer ) } catch (...) { - DBG_ERROR("C++ exception caught!"); + OSL_FAIL("C++ exception caught!"); pImp->bInNextJob = sal_False; } @@ -1847,21 +1792,18 @@ sal_uInt16 SfxBindings::EnterRegistrations(const char *pFile, int nLine) aMsg += " Line: "; aMsg += ByteString::CreateFromInt32(nLine); } -// FILE* pLog = fopen( "c:\\bindings.log", "a+w" ); -// fwrite( aMsg.GetBuffer(), 1, aMsg.Len(), pLog ); -// fclose( pLog ); 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; } @@ -1877,7 +1819,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; } @@ -1894,14 +1836,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(); } @@ -1914,40 +1856,29 @@ void SfxBindings::LeaveRegistrations( sal_uInt16 nLevel, const char *pFile, int if ( pImp->bContextChanged ) { pImp->bContextChanged = sal_False; - /* - ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame > xFrame - ( pDispatcher->GetFrame()->GetFrame().GetFrameInterface(), UNO_QUERY ); - if ( xFrame.is() ) - xFrame->contextChanged();*/ } -#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 - //!pCache->SetCachedState(); - } } } -#endif + // restart background-processing pImp->nMsgPos = 0; if ( !pFrame || !pFrame->GetObjectShell() ) @@ -1957,7 +1888,6 @@ void SfxBindings::LeaveRegistrations( sal_uInt16 nLevel, const char *pFile, int pImp->aTimer.Stop(); pImp->aTimer.SetTimeout(TIMEOUT_FIRST); pImp->aTimer.Start(); -// pImp->bFirstRound = sal_True; } } @@ -1975,9 +1905,6 @@ void SfxBindings::LeaveRegistrations( sal_uInt16 nLevel, const char *pFile, int aMsg += " Line: "; aMsg += ByteString::CreateFromInt32(nLine); } -// FILE* pLog = fopen( "c:\\bindings.log", "a+w" ); -// fwrite( aMsg.GetBuffer(), 1, aMsg.Len(), pLog ); -// fclose( pLog ); DbgTrace( aMsg.GetBuffer() ); #endif } @@ -1989,7 +1916,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(); @@ -2033,7 +1960,7 @@ void SfxBindings::SetDispatcher( SfxDispatcher *pDisp ) { if ( pImp->pSubBindings && pImp->pSubBindings->pDispatcher != pOldDispat ) { - DBG_ERROR( "SubBindings vor Aktivieren schon gesetzt!" ); + OSL_FAIL( "SubBindings already set before activating!" ); pImp->pSubBindings->ENTERREGISTRATIONS(); } LEAVEREGISTRATIONS(); @@ -2043,7 +1970,7 @@ void SfxBindings::SetDispatcher( SfxDispatcher *pDisp ) ENTERREGISTRATIONS(); if ( pImp->pSubBindings && pImp->pSubBindings->pDispatcher != pOldDispat ) { - DBG_ERROR( "SubBindings im Deaktivieren immer noch gesetzt!" ); + OSL_FAIL( "SubBindings still set even when deactivating!" ); pImp->pSubBindings->LEAVEREGISTRATIONS(); } } @@ -2081,10 +2008,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); } @@ -2185,14 +2112,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(); } @@ -2350,7 +2277,7 @@ sal_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() ) @@ -2360,7 +2287,7 @@ sal_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( @@ -2371,7 +2298,7 @@ sal_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 ); @@ -2424,3 +2351,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 e90b680ffa13..5e4bd6561d9b 100644..100755 --- 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. @@ -28,8 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" #include <svl/itempool.hxx> -#ifndef GCC -#endif #include <sfx2/ctrlitem.hxx> #include <sfx2/bindings.hxx> @@ -47,11 +46,11 @@ DBG_NAME(SfxControllerItem); void SfxControllerItem::CheckConfigure_Impl( sal_uIntPtr 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 +64,6 @@ void SfxControllerItem::CheckConfigure_Impl( sal_uIntPtr nType ) #endif //-------------------------------------------------------------------- - // returns the next registered SfxControllerItem with the same id SfxControllerItem* SfxControllerItem::GetItemLink() @@ -76,7 +74,6 @@ SfxControllerItem* SfxControllerItem::GetItemLink() } //-------------------------------------------------------------------- - // returns sal_True if this binding is really bound to a function sal_Bool SfxControllerItem::IsBound() const @@ -87,23 +84,21 @@ sal_Bool SfxControllerItem::IsBound() const } //-------------------------------------------------------------------- - // returns the associated function-id or 0 if none // sal_uInt16 SfxControllerItem::GetId() const; //==================================================================== - // registeres with the id at the bindings void SfxControllerItem::Bind( sal_uInt16 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 +114,10 @@ void SfxControllerItem::BindInternal_Impl( sal_uInt16 nNewId, SfxBindings *pBind { 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 +134,14 @@ void SfxControllerItem::BindInternal_Impl( sal_uInt16 nNewId, SfxBindings *pBind void SfxControllerItem::UnBind() -/* [Beschreibung] +/* [Description] - "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. + 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 +149,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 +160,13 @@ void SfxControllerItem::UnBind() void SfxControllerItem::ReBind() -/* [Beschreibung] +/* [Description] - Binded dieses SfxControllerItem wieder an die SfxBindings-Instanz, - an der es zuletzt gebunden war. Ab diesem Zeitpunkt erh"alt es wieder - Statusbenachrichtigungen (<SfxControllerItem::StateChented()>). + 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 +175,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 +185,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 +206,20 @@ void SfxControllerItem::UpdateSlot() void SfxControllerItem::ClearCache() -/* [Beschreibung] +/* [Description] - "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. + 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. + [Example] - [Beispiel] + 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. - 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. - - - [Querverweise] + [Cross-reference] <SfxControllerItem::UnBind()> <SfxControllerItem::ReBind()> @@ -239,13 +229,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 +247,6 @@ SfxControllerItem* SfxControllerItem::ChangeItemLink( SfxControllerItem* pNewLin } //-------------------------------------------------------------------- - // changes the id of unbound functions (e.g. for sub-menu-ids) void SfxControllerItem::SetId( sal_uInt16 nItemId ) @@ -271,7 +259,7 @@ void SfxControllerItem::SetId( sal_uInt16 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 +271,6 @@ SfxControllerItem::SfxControllerItem(): } //-------------------------------------------------------------------- - // creates a representation of the function nId and registeres it SfxControllerItem::SfxControllerItem( sal_uInt16 nID, SfxBindings &rBindings ): @@ -297,7 +284,6 @@ SfxControllerItem::SfxControllerItem( sal_uInt16 nID, SfxBindings &rBindings ): } //-------------------------------------------------------------------- - // unregisteres the item in the bindings SfxControllerItem::~SfxControllerItem() @@ -312,27 +298,29 @@ SfxControllerItem::~SfxControllerItem() void SfxControllerItem::StateChanged ( - sal_uInt16 , // <SID> des ausl"osenden Slot - SfxItemState , // <SfxItemState> von 'pState' - const SfxPoolItem* // Slot-Status, ggf. 0 oder IsInvalidItem() + sal_uInt16, // <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 +340,9 @@ void SfxControllerItem::DeleteFloatingWindow() void SfxStatusForwarder::StateChanged ( - sal_uInt16 nSID, // <SID> des ausl"osenden Slot - SfxItemState eState, // <SfxItemState> von 'pState' - const SfxPoolItem* pState // Slot-Status, ggf. 0 oder IsInvalidItem() + sal_uInt16 nSID, // <SID> of the triggering slot + SfxItemState eState, // <SfxItemState> of 'pState' + const SfxPoolItem* pState // Slot-Status, NULL or IsInvalidItem() ) { @@ -375,37 +363,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. + 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 +408,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 +449,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 9b403e3ddab4..013fabd5651d 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. @@ -34,17 +35,13 @@ #include <svl/itemiter.hxx> #include <svl/whiter.hxx> #include <svl/intitem.hxx> -#ifndef _SFXEITEM_HXX //autogen #include <svl/eitem.hxx> -#endif #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 +49,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> @@ -98,10 +92,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) @@ -126,10 +120,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 ) @@ -140,37 +134,39 @@ 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_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 @@ -184,18 +180,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). */ { @@ -205,19 +200,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. */ { @@ -227,21 +218,21 @@ 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 */ { SFX_STACK(SfxDispatcher::Call_Impl); - // darf der Slot gerufen werden (i.S.v. enabled) + // The slot may be called (meaning enabled) if ( rSlot.IsMode(SFX_SLOT_FASTCALL) || rShell.CanExecuteSlot_Impl(rSlot) ) { 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); @@ -252,7 +243,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; @@ -263,14 +254,13 @@ 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 + // API-call parentheses and document-lock during the calls { - // 'this' mu\s im Dtor bescheid sagen + // 'this' must respond in the Destructor sal_Bool bThisDispatcherAlive = sal_True; sal_Bool *pOldInCallAliveFlag = pImp->pInCallAliveFlag; pImp->pInCallAliveFlag = &bThisDispatcherAlive; @@ -288,14 +278,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; } @@ -308,14 +298,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()); @@ -385,11 +375,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. */ { @@ -409,11 +398,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. */ { @@ -424,27 +413,23 @@ 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); - - // 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) @@ -458,27 +443,27 @@ SfxDispatcher::~SfxDispatcher() //==================================================================== void SfxDispatcher::Pop ( - SfxShell& rShell, /* Die vom Stack zu nehmende SfxShell-Instanz. */ + SfxShell& rShell, /* the stack to take the SfxShell instance. */ - sal_uInt16 nMode /* SFX_SHELL_POP_UNTIL - Es werden auch alle "uber 'rShell' liegenenden - SfxShell's vom Stack genommen. + sal_uInt16 nMode /* SFX_SHELL_POP_UNTIL + Also all 'rShell' of SfxShells are taken from the + stack. - SFX_SHELL_POP_DELETE - Alle tats"achlich vom Stack genommenen - SfxShells werden gel"oscht. + SFX_SHELL_POP_DELETE + All SfxShells actually taken from the stack + will be deleted. - SFX_SHELL_PUSH (InPlace use only) - Die Shell wird gepusht. */ + 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. */ { @@ -505,10 +490,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 @@ -519,7 +504,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 ) { @@ -527,7 +512,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(); @@ -537,29 +522,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(); @@ -573,13 +557,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. */ { @@ -598,14 +582,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. */ { @@ -642,21 +626,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. */ { @@ -681,14 +663,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. */ { @@ -705,15 +687,15 @@ SfxShell *SfxDispatcher::GetShell(sal_uInt16 nIdx) const //-------------------------------------------------------------------- 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. */ { @@ -726,11 +708,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. */ { @@ -741,18 +723,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. */ { @@ -764,7 +746,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; @@ -792,7 +774,6 @@ void SfxDispatcher::DoActivate_Impl( sal_Bool bMDI, SfxViewFrame* /* pOld */ ) if ( bMDI && pImp->pFrame ) { - //SfxWorkWindow *pWorkWin = pImp->pFrame->GetFrame().GetWorkWindow_Impl(); SfxBindings *pBind = GetBindings(); while ( pBind ) { @@ -807,14 +788,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); } @@ -830,18 +811,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. */ { @@ -853,7 +834,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() ) ) @@ -897,7 +878,6 @@ void SfxDispatcher::DoDeactivate_Impl( sal_Bool bMDI, SfxViewFrame* pNew ) if ( bHidePopups ) { - //SfxWorkWindow *pWorkWin = pImp->pFrame->GetFrame().GetWorkWindow_Impl(); SfxBindings *pBind = GetBindings(); while ( pBind ) { @@ -920,30 +900,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_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] +/* [Description] - Diese Methode sucht im SfxDispatcher nach der <SfxShell>, von der - die Slot-Id nSlot zur Zeit bedient wird. Dazu wird der Dispatcher - zuvor geflusht. + This method searches in SfxDispatcher after <SfxShell> , from the Slot Id + nSlot currently being handled. For this, the dispatcher is first flushed. + [Return value] - [R"uckgabewert] + int sal_True + The SfxShell was found, ppShell and ppSlot are valid. - int sal_True - Die SfxShell wurde gefunden, ppShell und ppSlot - sind g"ultig. - - 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. */ { @@ -964,55 +942,26 @@ int SfxDispatcher::GetShellAndSlot_Impl if ( bRealSlot && ((0 == *ppSlot) || (0 == (*ppSlot)->GetExecFnc()) )) return sal_False; -#ifdef DBG_UTILx - ByteString aMsg( nSlot ); - aMsg += " found in "; - aMsg += (*ppShell)->GetInterface()->GetClassName(); - DbgTrace( aMsg.GetBuffer() ); -#endif - return sal_True; } -#ifdef DBG_UTILx - ByteString aMsg( nSlot ); - aMsg += " not found"; - DbgTrace( aMsg.GetBuffer() ); -#endif - return sal_False; } -/* -struct Executer : public SfxHint -{ - SfxRequest *pRequest; - const SfxSlot* pSlot; - sal_uInt16 nLevel; - - Executer( SfxRequest* pReq, const SfxSlot* p, sal_uInt16 n ) - : pRequest( pReq ) - , pSlot(p) - , nLevel(n) - {} - ~Executer() - {delete pRequest;} -}; -*/ - //-------------------------------------------------------------------- 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>. */ { @@ -1038,7 +987,6 @@ void SfxDispatcher::_Execute if ( eCallMode & SFX_CALLMODE_RECORD ) rReq.AllowRecording( sal_True ); pDispat->pImp->xPoster->Post(new SfxRequest(rReq)); -// pDispat->pImp->xPoster->Post(new Executer(new SfxRequest(rReq), &rSlot, n )); return; } } @@ -1053,14 +1001,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 @@ -1084,7 +1032,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() ) @@ -1092,7 +1040,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; @@ -1101,7 +1049,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; @@ -1112,7 +1060,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() ); @@ -1120,13 +1067,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(); } } @@ -1139,17 +1084,7 @@ sal_uInt16 SfxDispatcher::ExecuteFunction( sal_uInt16 nSlot, const SfxItemSet& r if ( !nMode ) nMode = pImp->nStandardMode; -/* - // at the moment not implemented - // via Bindings/Interceptor? (dann ist der Returnwert nicht exakt) - sal_Bool bViaBindings = SFX_USE_BINDINGS == ( nMode & SFX_USE_BINDINGS ); - nMode &= ~sal_uInt16(SFX_USE_BINDINGS); - if ( bViaBindings && GetBindings() ) - return GetBindings()->Execute( nSlot, rArgs, nMode ) - ? EXECUTE_POSSIBLE - : EXECUTE_NO; -*/ - // sonst via Dispatcher + // otherwise through the Dispatcher if ( IsLocked(nSlot) ) return 0; SfxShell *pShell = 0; @@ -1158,7 +1093,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; @@ -1169,10 +1104,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; @@ -1188,7 +1121,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 ) @@ -1320,27 +1253,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). */ { @@ -1380,25 +1312,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). */ { @@ -1439,26 +1369,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). */ { @@ -1487,35 +1416,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] +/* [Description] - Methode zum Ausf"uhren eines <SfxSlot>s "uber die Slot-Id. + Method to excecute a <SfxSlot>s over the Slot-Id. + [Note] - [Anmerkung] + The parameters are copied, can therefore be passed on as the address + of stack objects. - Die Parameter werden kopiert, k"onnen daher als Adresse von - Stack-Objekten "ubergeben werden. + [Return value] + const SfxPoolItem* Pointer to the SfxPoolItem valid to the next run + though the Message-Loop, which contains the return + value. - [R"uckgabewert] + Or a NULL-Pointer, when the function was not + executed (for example canceled by the user). - 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). - - - [Beispiel] + [Example] pDispatcher->Execute( SID_OPENDOCUMENT, SFX_CALLMODE_SYNCHRON, &SfxStringItem( SID_FILE_NAME, "\\tmp\\temp.sdd" ), @@ -1554,9 +1480,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. */ { @@ -1564,8 +1490,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? -// SfxRequest* pReq = pExec->pRequest; + // Has also the Pool not yet died? if ( !pReq->IsCancelled() ) { if ( !IsLocked(pReq->GetSlot()) ) @@ -1573,8 +1498,6 @@ IMPL_LINK( SfxDispatcher, PostMsgHandler, SfxRequest*, pReq ) Flush(); SfxSlotServer aSvr; if ( _FindServer(pReq->GetSlot(), aSvr, HACK(x) sal_True ) ) -// SfxShell *pShell = GetShell(pExec->nLevel); -// if ( pShell && pShell->GetInterface()->GetSlot( pExec->pSlot->GetSlotId() ) ) { const SfxSlot *pSlot = aSvr.GetSlot(); SfxShell *pSh = GetShell(aSvr.GetShellLevel()); @@ -1582,27 +1505,21 @@ 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? DBG( pSfxApp->LeaveAsynchronCall_Impl() ); } - -// delete pExec; } else { -// pImp->xPoster->Post(pExec); if ( pImp->bLocked ) pImp->aReqArr.Insert( new SfxRequest(*pReq), pImp->aReqArr.Count() ); else pImp->xPoster->Post(new SfxRequest(*pReq)); } } -// else -// delete pExec; delete pReq; return 0; @@ -1789,7 +1706,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; @@ -1914,9 +1831,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. */ { @@ -1937,26 +1854,17 @@ void SfxDispatcher::FlushImpl() if ( pImp->pParent ) pImp->pParent->Flush(); -// if ( pImp->bQuiet ) -// return; - pImp->bFlushing = !pImp->bFlushing; if ( !pImp->bFlushing ) { pImp->bFlushing = sal_True; DBG_PROFSTOP(SfxDispatcherFlush); -//! -#ifdef DBG_UTIL_MESSEHACK_AUSKOMMENT - DBG_ERROR( "reentering SfxDispatcher::Flush()" ); - aMsg += " reentering, aborted"; - DbgTrace( aMsg.GetBuffer() ); -#endif return; } 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; @@ -1967,20 +1875,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; - bool bFound = sal_False; + bool bFound = false; do { DBG_ASSERT( pImp->aStack.Count(), "popping from empty stack" ); @@ -1988,7 +1896,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 ); @@ -1999,7 +1907,7 @@ void SfxDispatcher::FlushImpl() pImp->aToDoStack.Clear(); } - // ggf. Bindings invalidieren + // Invalidate bindings, if possible if ( !pSfxApp->IsDowning() ) { if ( bModify ) @@ -2012,11 +1920,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) ); @@ -2038,9 +1946,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() ) @@ -2060,52 +1969,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] +/* [Description] - 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. + 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 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. + 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. + [Example] - [Beispiel] + Targeted disabling of Slots 1, 2 and 3: - gezieltes disablen der Slots 1, 2 und 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 ) @@ -2120,7 +2028,7 @@ void SfxDispatcher::SetSlotFilter //-------------------------------------------------------------------- EXTERN_C -#if defined( PM2 ) && (!defined( CSET ) && !defined ( MTW ) && !defined( WTC )) +#if defined( PM2 ) int _stdcall #else #ifdef WNT @@ -2139,59 +2047,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 @@ -2202,7 +2110,7 @@ sal_Bool SfxDispatcher::_TryIntercept_Impl if ( bSelf ) { - // Die ComponentViewShell befragen + // Query the ComponentViewShell Flush(); SfxShell *pObjShell = GetShell(0); SfxInterface *pIFace = pObjShell->GetInterface(); @@ -2212,11 +2120,6 @@ sal_Bool SfxDispatcher::_TryIntercept_Impl { rServer.SetSlot(pSlot); rServer.SetShellLevel(0); -#ifdef DBG_UTILx - String aMsg( nSlot ); - aMsg += " intercepted"; - DbgTrace( aMsg.GetBuffer() ); -#endif return sal_True; } } @@ -2226,43 +2129,42 @@ 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. */ { SFX_STACK(SfxDispatcher::_FindServer); - // Dispatcher gelockt? (SID_HELP_PI trotzdem durchlassen) + // Dispatcher locked? (nevertheless let SID_HELP_PI through) if ( IsLocked(nSlot) ) { pImp->bInvalidateOnUnlock = sal_True; 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 ) @@ -2296,7 +2198,7 @@ sal_Bool SfxDispatcher::_FindServer } } - // SID gegen gesetzten Filter pr"ufen + // SID check against set filter sal_uInt16 nSlotEnableMode=0; if ( pImp->pFrame ) { @@ -2305,7 +2207,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 ) @@ -2320,13 +2222,9 @@ sal_Bool SfxDispatcher::_FindServer } sal_Bool bReadOnly = ( 2 != nSlotEnableMode && pImp->bReadOnly ); -// ( pImp->pFrame && pImp->pFrame->GetObjectShell() ); -// pImp->pFrame->GetObjectShell()->IsLoading() ); - // durch alle Shells der verketteten Dispatchern von oben nach unten suchen -#ifdef DBG_UTILx - String aStack( "Stack:" ); -#endif + // search through all the shells of the chained dispatchers + // from top to bottom sal_uInt16 nFirstShell = pImp->bModal && !bModal ? pImp->aStack.Count() : 0; for ( sal_uInt16 i = nFirstShell; i < nTotCount; ++i ) { @@ -2342,45 +2240,31 @@ sal_Bool SfxDispatcher::_FindServer if ( pSlot ) { - // Slot geh"ort zum Container? + // 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 + // 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 + // 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; } -#ifdef DBG_UTILx - if ( pSlot ) - { - String aMsg( nSlot ); - aMsg += " found in "; - aMsg += pObjShell->GetInterface()->GetClassName(); - DbgTrace( aMsg.GetBuffer() ); - } - else - { - aStack += " "; - aStack += pObjShell->GetInterface()->GetClassName(); - } -#endif if ( pSlot && !IsAllowed( nSlot ) ) { pSlot = NULL; @@ -2394,12 +2278,6 @@ sal_Bool SfxDispatcher::_FindServer } } -#ifdef DBG_UTILx - String aMsg( nSlot ); - aMsg += " not found in "; - aMsg += aStack; - DbgTrace( aMsg.GetBuffer() ); -#endif return sal_False; } @@ -2427,7 +2305,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 ) { @@ -2436,13 +2314,11 @@ 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() ); for ( sal_uInt16 i=0 ; i < nTotCount; ++i ) { @@ -2457,27 +2333,27 @@ sal_Bool SfxDispatcher::HasSlot_Impl( sal_uInt16 nSlot ) if ( pSlot ) { - // Slot geh"ort zum Container? + // 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 + // 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 + // 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; @@ -2493,23 +2369,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. */ { @@ -2532,9 +2406,9 @@ sal_Bool SfxDispatcher::_FillState return sal_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; @@ -2545,7 +2419,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(); @@ -2580,10 +2454,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>. */ { @@ -2596,7 +2469,7 @@ const SfxPoolItem* SfxDispatcher::_Execute( const SfxSlotServer &rSvr ) Flush(); if ( pSlot->IsMode(SFX_SLOT_ASYNCHRON) ) - //! ignoriert rSvr + //! ignore rSvr { SfxShell *pShell = GetShell( rSvr.GetShellLevel() ); SfxDispatcher *pDispat = this; @@ -2609,20 +2482,16 @@ const SfxPoolItem* SfxDispatcher::_Execute( const SfxSlotServer &rSvr ) pDispat->pImp->xPoster->Post( new SfxRequest( pSlot->GetSlotId(), SFX_CALLMODE_RECORD, pShell->GetPool() ) ); -// pDispat->pImp->xPoster->Post(new Executer( -// new SfxRequest( pSlot->GetSlotId(), -// SFX_CALLMODE_RECORD, pShell->GetPool() ), -// pSlot, n )); return 0; } } } 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(); } } @@ -2669,20 +2538,7 @@ void SfxDispatcher::ExecutePopup( sal_uInt16 nConfigId, Window *pWin, const Poin SfxDispatcher &rDisp = *SFX_APP()->GetDispatcher_Impl(); sal_uInt16 nShLevel = 0; SfxShell *pSh; -/* - const SvVerbList *pVerbList = 0; - sal_uInt16 nMaxShellLevel = rDisp.pImp->aStack.Count(); - for ( pSh = rDisp.GetShell(nShLevel); - pSh && nShLevel < nMaxShellLevel ; - ++nShLevel, pSh = rDisp.GetShell(nShLevel) ) - { - if ( pSh->GetVerbs() ) - { - pVerbList = pSh->GetVerbs(); - break; - } - } -*/ + nShLevel=0; if ( rDisp.pImp->bQuiet ) { @@ -2696,14 +2552,6 @@ void SfxDispatcher::ExecutePopup( sal_uInt16 nConfigId, Window *pWin, const Poin const ResId& rResId = pSh->GetInterface()->GetPopupMenuResId(); if ( ( nConfigId == 0 && rResId.GetId() ) || ( nConfigId != 0 && rResId.GetId() == nConfigId ) ) { - //SfxPopupMenuManager aPop( rResId.GetId(), *rDisp.GetBindings() ); - //aPop.SetResMgr(rResId.GetResMgr()); - //aPop.AddClipboardFunctions(); - //aPop.Initialize(); - //if ( pVerbList && pVerbList->Count() ) - // aPop.InsertVerbs(pVerbList); - //aPop.RemoveDisabledEntries(); - //aPop.Execute( pPos ? *pPos : pWindow->GetPointerPosPixel(), pWindow ); SfxPopupMenuManager::ExecutePopup( rResId, rDisp.GetFrame(), pPos ? *pPos : pWindow->GetPointerPosPixel(), pWindow ); return; } @@ -2714,25 +2562,17 @@ void SfxDispatcher::ExecutePopup( sal_uInt16 nConfigId, Window *pWin, const Poin void SfxDispatcher::ExecutePopup( const ResId &rId, Window *pWin, const Point *pPos ) { Window *pWindow = pWin ? pWin : pImp->pFrame->GetFrame().GetWorkWindow_Impl()->GetWindow(); -/* - SfxPopupMenuManager aPop( rId, *GetBindings() ); - aPop.AddClipboardFunctions(); - aPop.Initialize(); - aPop.RemoveDisabledEntries(); - aPop.Execute( pPos ? *pPos : pWindow->GetPointerPosPixel(), pWindow ); -*/ SfxPopupMenuManager::ExecutePopup( rId, GetFrame(), pPos ? *pPos : pWindow->GetPointerPosPixel(), pWindow ); } //-------------------------------------------------------------------- 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. */ { @@ -2763,10 +2603,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++) @@ -2811,8 +2651,6 @@ void SfxDispatcher::LockUI_Impl( sal_Bool bLock ) //------------------------------------------------------------------------- void SfxDispatcher::HideUI( sal_Bool bHide ) { -// if ( !bHide && pImp->bReadOnly ) -// bHide = sal_True; sal_Bool bWasHidden = pImp->bNoUI; pImp->bNoUI = bHide; if ( pImp->pFrame ) @@ -2843,7 +2681,6 @@ void SfxDispatcher::HideUI( sal_Bool bHide ) void SfxDispatcher::SetReadOnly_Impl( sal_Bool bOn ) { pImp->bReadOnly = bOn; -// pImp->bNoUI = bOn; } sal_Bool SfxDispatcher::GetReadOnly_Impl() const @@ -2854,10 +2691,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. */ { @@ -2870,9 +2707,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. */ { @@ -2951,8 +2788,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_ {}; @@ -2960,7 +2797,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); @@ -2978,7 +2815,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 ) @@ -3006,16 +2843,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; @@ -3025,7 +2863,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) @@ -3045,7 +2883,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, "" ); @@ -3111,3 +2949,5 @@ SfxModule* SfxDispatcher::GetModule() const return (SfxModule*) pSh; } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/control/macrconf.cxx b/sfx2/source/control/macrconf.cxx new file mode 100755 index 000000000000..1464ffe0abed --- /dev/null +++ b/sfx2/source/control/macrconf.cxx @@ -0,0 +1,794 @@ +/* -*- 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 + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_sfx2.hxx" +#include <basic/sbstar.hxx> +#include <basic/basmgr.hxx> +#include <basic/sbx.hxx> +#include <svl/intitem.hxx> +#include <basic/sbmeth.hxx> +#include <basic/sbmod.hxx> +#include <basic/sbuno.hxx> + +#include <osl/mutex.hxx> + +#include <com/sun/star/script/XEngine.hpp> +#include <com/sun/star/document/MacroExecMode.hpp> + +#include <comphelper/processfactory.hxx> +#include <unotools/intlwrapper.hxx> + +#include <sfx2/msgpool.hxx> +#include <sfx2/macrconf.hxx> +#include "sfxbasic.hxx" +#include <sfx2/sfx.hrc> +#include <sfx2/app.hxx> +#include <sfx2/objsh.hxx> +#include <sfx2/dispatch.hxx> +#include "minfitem.hxx" +#include "imgmgr.hxx" +#include <sfx2/evntconf.hxx> +#include <sfx2/docfile.hxx> +#include <sfx2/genlink.hxx> +#include <sfx2/viewfrm.hxx> +#include <appdata.hxx> +#include "objshimp.hxx" +#include <sfx2/request.hxx> + +static const sal_uInt16 nCompatVersion = 2; +static const sal_uInt16 nVersion = 3; + +// Static member +SfxMacroConfig* SfxMacroConfig::pMacroConfig = NULL; + +SfxMacroConfig* SfxMacroConfig::GetOrCreate() +{ + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if ( !pMacroConfig ) + pMacroConfig = new SfxMacroConfig; + return pMacroConfig; +} + +void SfxMacroConfig::Release_Impl() +{ + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + DELETEZ( pMacroConfig ); +} + +//========================================================================== + +struct SfxMacroConfig_Impl +{ + SfxMacroInfoArr_Impl aArr; + sal_uInt32 nEventId; + sal_Bool bWaitingForCallback; + + SfxMacroConfig_Impl() + : nEventId( 0 ) + , bWaitingForCallback( sal_False ) + {} +}; + +//========================================================================== + +SbMethod* SfxQueryMacro_Impl( BasicManager* pMgr , const String& rMacro, + const String &rLibName, const String& rModule ) +{ + IntlWrapper aIntlWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() ); + const CollatorWrapper* pCollator = aIntlWrapper.getCollator(); + sal_uInt16 nLibCount = pMgr->GetLibCount(); + for ( sal_uInt16 nLib = 0; nLib < nLibCount; ++nLib ) + { + if ( COMPARE_EQUAL == pCollator->compareString( pMgr->GetLibName( nLib ), rLibName ) ) + { + StarBASIC* pLib = pMgr->GetLib( nLib ); + if( !pLib ) + { + pMgr->LoadLib( nLib ); + pLib = pMgr->GetLib( nLib ); + } + + if( pLib ) + { + sal_uInt16 nModCount = pLib->GetModules()->Count(); + for( sal_uInt16 nMod = 0; nMod < nModCount; ++nMod ) + { + SbModule* pMod = (SbModule*)pLib->GetModules()->Get( nMod ); + if ( pMod && COMPARE_EQUAL == pCollator->compareString( pMod->GetName(), rModule ) ) + { + SbMethod* pMethod = (SbMethod*)pMod->Find( rMacro, SbxCLASS_METHOD ); + if( pMethod ) + return pMethod; + } + } + } + } + } + return 0; +} + +SbMethod* SfxQueryMacro( BasicManager* pMgr , const String& rMacro ) +{ + sal_uInt16 nLast = 0; + String aMacro = rMacro; + String aLibName = aMacro.GetToken( 0, '.', nLast ); + String aModule = aMacro.GetToken( 0, '.', nLast ); + aMacro.Erase( 0, nLast ); + + return SfxQueryMacro_Impl( pMgr, aMacro, aLibName, aModule ); +} + +ErrCode SfxCallMacro( BasicManager* pMgr, const String& rCode, + SbxArray *pArgs, SbxValue *pRet ) +{ + ErrCode nErr; + SfxApplication *pApp = SFX_APP(); + pApp->EnterBasicCall(); + SbMethod* pMethod = SfxQueryMacro( pMgr, rCode ); + if ( pMethod ) + { + if ( pArgs ) + pMethod->SetParameters( pArgs ); + nErr = pMethod->Call( pRet ); + } + else + nErr = ERRCODE_BASIC_PROC_UNDEFINED; + + pApp->LeaveBasicCall(); + return nErr; +} + +//========================================================================== + +SfxMacroInfo::SfxMacroInfo( const String& rURL ) : + pHelpText(0), + nRefCnt(0), + bAppBasic(TRUE), + nSlotId(0), + pSlot(0) +{ + if ( rURL.CompareToAscii( "macro:", 6 ) == COMPARE_EQUAL ) + { + String aTmp = rURL.Copy( 6 ); + if ( aTmp.GetTokenCount('/') > 3 ) + { + // 'macro:///lib.mod.proc(args)' => Macro via App-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, '/' ); + if ( aTmp.GetTokenCount('.') == 3 ) + { + aLibName = aTmp.GetToken( 0, '.' ); + aModuleName = aTmp.GetToken( 1, '.' ); + aMethodName = aTmp.GetToken( 2, '.' ); + + // Remove arguments to be compatible + aMethodName.SearchAndReplaceAscii( "()", String(), sal::static_int_cast< xub_StrLen >(std::max( aMethodName.Len()-2, 0 ))); + } + } + + DBG_ASSERT( aLibName.Len() && aModuleName.Len() && aMethodName.Len(), "Wrong macro URL!" ); + } + else + aMethodName = rURL; +} + +SfxMacroInfo::SfxMacroInfo( bool _bAppBasic ) : + pHelpText(0), + nRefCnt(0), + bAppBasic(_bAppBasic), + nSlotId(0), + pSlot(0) +{} + +//========================================================================== + +SfxMacroInfo::SfxMacroInfo(bool _bAppBasic, const String& rLibName, + const String& rModuleName, const String& rMethodName) : + pHelpText(0), + nRefCnt(0), + bAppBasic(_bAppBasic), + aLibName(rLibName), + aModuleName(rModuleName), + aMethodName(rMethodName), + nSlotId(0), + pSlot(0) +{ +} + +//========================================================================== + +SfxMacroInfo::SfxMacroInfo(bool _bAppBasic, const String& rQualifiedName ) +: pHelpText(0), + nRefCnt(0), + bAppBasic(_bAppBasic), + nSlotId(0), + pSlot(0) +{ + sal_uInt16 nCount = rQualifiedName.GetTokenCount('.'); + aMethodName = rQualifiedName.GetToken( nCount-1, '.' ); + if ( nCount > 1 ) + aModuleName = rQualifiedName.GetToken( nCount-2, '.' ); + if ( nCount > 2 ) + aLibName = rQualifiedName.GetToken( 0, '.' ); +} + +//========================================================================== + +SfxMacroInfo::SfxMacroInfo(SfxMacroInfo& rOther) : + pHelpText(0), + nRefCnt(0), + bAppBasic(rOther.bAppBasic), + aLibName(rOther.aLibName), + aModuleName(rOther.aModuleName), + aMethodName(rOther.aMethodName), + nSlotId(rOther.nSlotId), + pSlot(0) +{} + +//========================================================================== + +SfxMacroInfo::~SfxMacroInfo() +{ + delete pSlot; + delete pHelpText; +} + +//========================================================================== + +sal_Bool SfxMacroInfo::operator==(const SfxMacroInfo& rOther) const +{ + if ( GetQualifiedName() == rOther.GetQualifiedName() && + bAppBasic == rOther.bAppBasic ) + return sal_True; + else + return sal_False; +} + +//========================================================================== + +String SfxMacroInfo::GetMacroName() const +{ + String aMacroName = aMethodName; + aMacroName += '('; + aMacroName += aLibName; + aMacroName += '.'; + aMacroName += aModuleName; + aMacroName += ')'; + return aMacroName; +} + +//========================================================================== + +String SfxMacroInfo::GetQualifiedName() const +{ + String aMacroName; + if( aMacroName.Len() || aLibName.Len() ) + { + // Altes Format + aMacroName = aLibName; + aMacroName += '.'; + aMacroName += aModuleName; + aMacroName += '.'; + } + + // due to ::com::sun::star::script::JavaScript + // no more disassembly of the string + aMacroName += aMethodName; + return aMacroName; +} + +String SfxMacroInfo::GetFullQualifiedName() const +{ + // Returns only nonsense, when called for a + // ::com::sun::star::script::JavaScript ! + String aRet; + if ( bAppBasic ) + aRet = SFX_APP()->GetName(); + aRet += '.'; + aRet += GetQualifiedName(); + return aRet; +} + +String SfxMacroInfo::GetURL() const +{ + if ( !aLibName.Len() ) + return aMethodName; + + // 'macro:///lib.mod.proc(args)' => Macro via App-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 ) + aURL += '.'; + aURL += '/'; + aURL += aLibName; + aURL += '.'; + aURL += aModuleName; + aURL += '.'; + aURL += aMethodName; + aURL += String::CreateFromAscii("()"); + + return aURL; +} + +//========================================================================== + +BasicManager* SfxMacroInfo::GetBasicManager() const +{ + if (bAppBasic) + { + return SFX_APP()->GetBasicManager(); + } + else + { + SfxObjectShell *pCurrDocShell = SfxObjectShell::Current(); + return pCurrDocShell ? pCurrDocShell->GetBasicManager() : + SFX_APP()->GetBasicManager(); + } +} + +//========================================================================== + +String SfxMacroInfo::GetBasicName() const +{ + if (bAppBasic) + { + return SFX_APP()->GetName(); + } + else + { + SfxObjectShell *pCurrDocShell = SfxObjectShell::Current(); + if ( pCurrDocShell ) + return pCurrDocShell->GetTitle(); + else + return SFX_APP()->GetName(); + } +} + +String SfxMacroInfo::GetHelpText() const +{ + if ( pHelpText ) + return *pHelpText; + return String(); +} + +String SfxMacroConfig::RequestHelp( sal_uInt16 nId ) +{ + SfxMacroInfo *pInfo = SFX_APP()->GetMacroConfig()->GetMacroInfo( nId ); + if ( !pInfo ) + return String(); + + if ( !pInfo->pHelpText ) + { + SbMethod *pMethod = + SfxQueryMacro_Impl( pInfo->GetBasicManager(), pInfo->aMethodName, + pInfo->aLibName, pInfo->aModuleName ); + if ( pMethod && pMethod->GetInfo() ) + pInfo->pHelpText = new String( pMethod->GetInfo()->GetComment() ); + } + + return pInfo->GetHelpText(); +} + +void SfxMacroInfo::SetHelpText( const String& rName ) +{ + if ( !pHelpText ) + pHelpText = new String; + *pHelpText = rName; +} + +sal_Bool SfxMacroInfo::Compare( const SvxMacro& rMacro ) const +{ + String aName = rMacro.GetLibName(); + aName += '.'; + aName += rMacro.GetMacName(); + if ( GetFullQualifiedName() == aName ) + return sal_True; + return sal_False; +} + +//========================================================================== + +SfxMacroConfig::SfxMacroConfig() +{ + pImp = new SfxMacroConfig_Impl; +} + +//========================================================================== + +SfxMacroConfig::~SfxMacroConfig() +{ + if ( pImp->nEventId ) + Application::RemoveUserEvent( pImp->nEventId ); + delete pImp; +} + +//========================================================================== + +SFX_STATE_STUB( SfxApplication, MacroState_Impl ) +SFX_EXEC_STUB( SfxApplication, MacroExec_Impl ) + +sal_uInt16 SfxMacroConfig::GetSlotId(SfxMacroInfoPtr pInfo) +{ + 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 still unknown + nCount = aIdArray.Count(); + sal_uInt16 n; + for (n=0; n<nCount; n++) // Seearch for free SlotId + if (aIdArray[n] > SID_MACRO_START + n) + break; + + sal_uInt16 nNewSlotId = SID_MACRO_START + n; + if ( nNewSlotId > SID_MACRO_END ) + return 0; + aIdArray.Insert( SID_MACRO_START + n, n ); + + SfxSlot *pNewSlot = new SfxSlot; + pNewSlot->nSlotId = SID_MACRO_START + n; + pNewSlot->nGroupId = 0; + pNewSlot->nFlags = SFX_SLOT_ASYNCHRON; + pNewSlot->nMasterSlotId = 0; + pNewSlot->nValue = 0; + pNewSlot->fnExec = SFX_STUB_PTR(SfxApplication,MacroExec_Impl); + pNewSlot->fnState = SFX_STUB_PTR(SfxApplication,MacroState_Impl); + pNewSlot->pType = 0; HACK(SFX_TYPE(SfxVoidItem)) + pNewSlot->pName = pNewSlot->pMethodName = U2S(pInfo->aMethodName).getStr(); + pNewSlot->pLinkedSlot = 0; + pNewSlot->nArgDefCount = 0; + pNewSlot->pFirstArgDef = 0; + pNewSlot->pUnoName = 0; + + if (nCount) + { + SfxSlot *pSlot = (pImp->aArr)[0]->pSlot; + pNewSlot->pNextSlot = pSlot->pNextSlot; + pSlot->pNextSlot = pNewSlot; + } + else + pNewSlot->pNextSlot = pNewSlot; + + // Take over Macro + SfxMacroInfoPtr pNewInfo = new SfxMacroInfo(*pInfo); + pNewInfo->nSlotId = SID_MACRO_START + n; + pImp->aArr.Insert(pNewInfo,n); + pNewInfo->pSlot = pNewSlot; + pInfo->nSlotId = pNewInfo->nSlotId; + pNewInfo->nRefCnt++; + } + else + { + pInfo->nSlotId = (pImp->aArr)[i]->nSlotId; + (pImp->aArr)[i]->nRefCnt++; + } + + return pInfo->nSlotId; +} + +//========================================================================== + +void SfxMacroConfig::ReleaseSlotId(sal_uInt16 nId) +{ + DBG_ASSERT( IsMacroSlot( nId ), "SlotId is no Macro!"); + + sal_uInt16 nCount = pImp->aArr.Count(); + for (sal_uInt16 i=0; i<nCount; i++) + { + SfxMacroInfo *pInfo = (pImp->aArr)[i]; + if (pInfo->nSlotId == nId) + { + pInfo->nRefCnt--; + if (pInfo->nRefCnt == 0) + { + // Slot is no longer referenced, so get + SfxSlot *pSlot = pInfo->pSlot; + + // Take out Slot from the concatenation + while (pSlot->pNextSlot != pInfo->pSlot) + pSlot = (SfxSlot*) pSlot->pNextSlot; + pSlot->pNextSlot = pInfo->pSlot->pNextSlot; + + // Slot close itself briefly + pSlot = pInfo->pSlot; + pSlot->pNextSlot = pSlot; + + // Remove Macro info from array so that it can not cause + // any harm + pImp->aArr.Remove(i); + + // Release SlotId again + sal_uInt16 nIdCount = aIdArray.Count(); + for (sal_uInt16 n=0; n<nIdCount; n++) + { + if (aIdArray[n] == nId) + { + aIdArray.Remove(n); + break; + } + } + + // 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 + EventHdl_Impl( pInfo ); + } + return; + } + } + + OSL_FAIL("Macro-SlotId is not found!"); +} + +//========================================================================== + +void SfxMacroConfig::RegisterSlotId(sal_uInt16 nId) +{ + DBG_ASSERT( IsMacroSlot( nId ), "SlotId is no Macro!"); + + sal_uInt16 nCount = pImp->aArr.Count(); + for (sal_uInt16 i=0; i<nCount; i++) + { + if ((pImp->aArr)[i]->nSlotId == nId) + { + (pImp->aArr)[i]->nRefCnt++; + return; + } + } + + OSL_FAIL("Macro-SlotId is not found!"); +} + +//========================================================================== + +SfxMacroInfo* SfxMacroConfig::GetMacroInfo(sal_uInt16 nId) const +{ + sal_uInt16 nCount = pImp->aArr.Count(); + for (sal_uInt16 i=0; i<nCount; i++) + if ((pImp->aArr)[i]->nSlotId == nId) + return (pImp->aArr)[i]; + + return 0; +} + +//========================================================================== + +const SfxMacroInfo* SfxMacroConfig::GetMacroInfo_Impl( const SvxMacro *pMacro ) const +{ + sal_uInt16 nCount = pImp->aArr.Count(); + for (sal_uInt16 i=0; i<nCount; i++) + if ((pImp->aArr)[i]->Compare(*pMacro) ) + return (pImp->aArr)[i]; + return 0; +} + +//========================================================================== + +sal_Bool SfxMacroConfig::ExecuteMacro( sal_uInt16 nId, const String& rArgs ) const +{ + const SfxMacroInfo* pInfo = GetMacroInfo( nId ); + if ( !pInfo ) + return sal_False; + + SfxObjectShell* pSh = SfxObjectShell::Current(); + + SvxMacro aMacro( pInfo->GetQualifiedName(), pInfo->GetBasicName(), STARBASIC ); + sal_Bool bRet = ExecuteMacro( pSh, &aMacro, rArgs ); + + // Release, because a register was created in the dispatcher Execute + ((SfxMacroConfig*)this)->ReleaseSlotId( nId ); + return bRet; +} + +sal_Bool SfxMacroConfig::ExecuteMacro( SfxObjectShell *pSh, const SvxMacro* pMacro, const String& /*rArgs*/ ) const +{ + SfxApplication *pApp = SFX_APP(); + + // Name of the Macros or Scripts (ScriptCode) + String aCode( pMacro->GetMacName() ); + ErrCode nErr = ERRCODE_NONE; + + // 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 ); + sal_Bool bIsBasicLibBased = bIsBasic || bIsStarScript || !pSh; + + if ( bIsBasicLibBased ) + { + pApp->EnterBasicCall(); + BasicManager *pAppMgr = SFX_APP()->GetBasicManager(); + if( bIsBasic ) + { + // BasicManager of the Document? + BasicManager *pMgr = pSh ? pSh->GetBasicManager() : NULL; + + // As the name has unfortunately been changed often ... + if( SFX_APP()->GetName() == pMacro->GetLibName() || + pMacro->GetLibName().EqualsAscii("StarDesktop") ) + pMgr = pAppMgr; + else if ( pMgr == pAppMgr ) + pMgr = NULL; + + if ( pSh && pMgr && pMgr != pAppMgr ) + { + if ( !pSh->AdjustMacroMode( String() ) ) + return sal_False; + } + + if ( pSh && pMgr && pMgr == pAppMgr ) + { + ::com::sun::star::uno::Any aOldThisComponent = pAppMgr->SetGlobalUNOConstant( "ThisComponent", makeAny( pSh->GetModel() ) ); + nErr = Call( 0, aCode, pMgr ); + pAppMgr->SetGlobalUNOConstant( "ThisComponent", aOldThisComponent ); + } + else if ( pMgr ) + nErr = Call( 0, aCode, pMgr ); + else + nErr = SbxERR_NO_METHOD; + + } + + pApp->LeaveBasicCall(); + } + else + { + nErr = SbxERR_NO_METHOD; + } + + return ( nErr == ERRCODE_NONE ); +} + +sal_Bool SfxMacroConfig::CheckMacro( SfxObjectShell *pSh, const SvxMacro* pMacro ) const +{ + SfxApplication *pApp = SFX_APP(); + + // Name of Macros or Scripts (ScriptCode) + String aCode( pMacro->GetMacName() ); + ErrCode nErr = ERRCODE_NONE; + + // BasicManager of Document or Application + pApp->EnterBasicCall(); + BasicManager *pAppMgr = SFX_APP()->GetBasicManager(); + BasicManager *pMgr = pSh ? pSh->GetBasicManager() : NULL; + + // As the name has unfortunately been changed often ... + if( SFX_APP()->GetName() == pMacro->GetLibName() || + pMacro->GetLibName().EqualsAscii("StarDesktop") ) + pMgr = pAppMgr; + else if ( pMgr == pAppMgr ) + pMgr = NULL; + + if ( !pMgr || !SfxQueryMacro( pMgr, aCode ) ) + nErr = SbxERR_NO_METHOD; + pApp->LeaveBasicCall(); + return ( nErr == ERRCODE_NONE ); +} + +//========================================================================== + +sal_Bool SfxMacroConfig::CheckMacro( sal_uInt16 nId ) const +{ + const SfxMacroInfo* pInfo = GetMacroInfo( nId ); + if ( !pInfo ) + return sal_False; + + // 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 of Document or Application + BasicManager *pAppMgr = SFX_APP()->GetBasicManager(); + BasicManager *pMgr = pSh ? pSh->GetBasicManager() : NULL; + + if( SFX_APP()->GetName() == pInfo->GetBasicName() ) + pMgr = SFX_APP()->GetBasicManager(); + else if ( pMgr == pAppMgr ) + pMgr = NULL; + + String aFull( pInfo->GetQualifiedName() ); + sal_Bool bIsBasic = pMgr ? IsBasic( 0, aFull, pMgr ) : sal_False; + pApp->LeaveBasicCall(); + return bIsBasic; +} + +//========================================================================== + +IMPL_LINK( SfxMacroConfig, CallbackHdl_Impl, SfxMacroConfig*, pConfig ) +{ + (void)pConfig; // unused + pImp->bWaitingForCallback = sal_False; + return 0; +} + +IMPL_LINK( SfxMacroConfig, EventHdl_Impl, SfxMacroInfo*, pInfo ) +{ + delete pInfo; + pImp->nEventId = 0; + return 0; +} + +sal_Bool SfxMacroConfig::IsBasic( + SbxObject* /*pVCtrl*/, + const String& rCode, + BasicManager* pMgr ) +{ + sal_Bool bFound; + SFX_APP()->EnterBasicCall(); + bFound = SfxQueryMacro( pMgr, rCode ) != 0; + SFX_APP()->LeaveBasicCall(); + return bFound; +} + +ErrCode SfxMacroConfig::Call( + SbxObject* /*pVCtrl*/, + const String& rCode, + BasicManager* pMgr, + SbxArray *pArgs, + SbxValue *pRet ) +{ + SfxApplication *pApp = SFX_APP(); + pApp->EnterBasicCall(); + SbMethod* pMethod = SfxQueryMacro( pMgr, rCode ); + ErrCode nErr = 0; + if( pMethod ) + { + if ( pArgs ) + pMethod->SetParameters( pArgs ); + nErr = pMethod->Call( pRet ); + } + else + nErr = ERRCODE_BASIC_PROC_UNDEFINED; + + pApp->LeaveBasicCall(); + return nErr; +} + + +sal_Bool SfxMacroConfig::IsMacroSlot( sal_uInt16 nId ) +{ + return ( nId >= SID_MACRO_START && nId <= SID_MACRO_END ); +} + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/control/macro.cxx b/sfx2/source/control/macro.cxx index 87879656021e..46f0e5dd8f79 100644..100755 --- 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,40 +46,45 @@ 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 - sal_Bool /*bAbsolute*/, // obsolet - const SfxSlot& rSlot, // der <SfxSlot>, der das Statement abspielen kann - sal_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 + sal_Bool /*bAbsolute*/, // obsolete + const SfxSlot& rSlot, // the <SfxSlot>, which can read the + // statement + sal_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' SfxViewFrame' | '[mydoc.sdc:1]' 'ActiveWindow' @@ -87,139 +93,44 @@ SfxMacroStatement::SfxMacroStatement 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&,sal_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&,sal_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 if ( !rSlot.pName ) return; -/* - // Objekt-Typ bestimmen - bool bIsApp = rShell.ISA(SfxApplication); - bool bIsDoc = rShell.ISA(SfxObjectShell); - bool bIsWin = !bIsApp && !bIsDoc && - ( rShell.ISA(SfxViewShell) || rShell.ISA(SfxViewFrame) ); - bool 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 - sal_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 + sal_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&,sal_Bool,const SfxSlot&,sal_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&,sal_Bool,SfxArguments*)> <SfxMacroStatement::SfxMacroStatement(const SfxShell&,sal_Bool,const SfxSlot&,sal_Bool,SfxArguments*)> */ -: nSlotId( 0 ), +: nSlotId( 0 ), aStatement( rStatement ), bDone( sal_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 - sal_Bool bRequestDone, // sal_True=wurde ausgef"uhrt, sal_False=abgebrochen + SfxMacro* /*pMacro*/, // in this is recorded + const SfxSlot& rSlot, // the slot, which can playback the statement + sal_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 ( sal_uInt16 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 ); sal_uInt16 nPos = 0; while ( sal_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 - bool bPrevReplaced = sal_False; + // non-printable characters are written as chr $(...) + bool bPrevReplaced = false; for ( sal_uInt16 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; @@ -402,7 +311,6 @@ void SfxMacroStatement::GenerateNameAndArgs_Impl n = n + aReplacement.Len(); aRecordable.SetChar((unsigned short) (n-2), 0x0029);// ')' = 29h aRecordable.Replace( n-1, 2, DEFINE_CONST_UNICODE("+\"") ); - // ++n; } else { @@ -411,24 +319,16 @@ void SfxMacroStatement::GenerateNameAndArgs_Impl aRecordable.Insert( aReplacement, n + 1 ); n = n + aReplacement.Len(); } - bPrevReplaced = sal_True; + bPrevReplaced = true; } else - bPrevReplaced = sal_False; + bPrevReplaced = false; - // Argument in Anf"uhrungszeichen + // Argument in quotation marks aArg = '"'; aArg += aRecordable; aArg += '"'; } -/* - case SbxBYTE: - { - // als Zahl darstellen - aArg = (sal_uInt16) rVar.GetByte(); - break; - } -*/ } else { @@ -436,12 +336,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 +350,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 +358,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 +389,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 +412,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 +430,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 +459,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 +500,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 +536,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 +563,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 +589,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 c5e46620a908..55c56c184b24 100644..100755 --- 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. @@ -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 ffedd2632770..119b186f112b 100644..100755 --- 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. @@ -43,7 +44,7 @@ SfxSlotKind SfxSlot::GetKind() const return (SfxSlotKind) SFX_KIND_ENUM; else { - DBG_ERROR( "invalid slot kind detected" ); + OSL_FAIL( "invalid slot kind detected" ); return SFX_KIND_ENUM; } } @@ -73,3 +74,4 @@ sal_uInt16 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 9cda943c8509..b2afa3dc1e22 100644..100755 --- 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> @@ -48,13 +47,6 @@ //==================================================================== -struct SfxSIDRegistration_Impl -{ - String _aGroup; - String _aName; - sal_uInt16 _nSID; -}; - struct SfxSlotType_Impl { sal_uInt16 nId; @@ -105,7 +97,6 @@ SfxSlotPool::~SfxSlotPool() } //==================================================================== - // registers the availability of the Interface of functions void SfxSlotPool::RegisterInterface( SfxInterface& rInterface ) @@ -117,8 +108,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; @@ -129,7 +120,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 ( sal_uInt16 n=0; n<rGroups.Count(); n++ ) _pGroups->Append( rGroups[n] ); @@ -149,26 +140,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 ) - { - sal_uInt16 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 } } @@ -178,18 +149,9 @@ TypeId SfxSlotPool::GetSlotType( sal_uInt16 nId ) const { const SfxSlot* pSlot = (const_cast <SfxSlotPool*> (this))->GetSlot( nId ); return pSlot ? pSlot->GetType()->Type() : 0; -/* - for ( sal_uInt16 nPos = 0; nPos < _pTypes->Count(); ++nPos ) - { - if ( _pTypes->GetObject(nPos)->nId == nId ) - return _pTypes->GetObject(nPos)->nType; - } - return _pParentPool ? _pParentPool->GetSlotType( nId ) : 0; - */ } //==================================================================== - // unregisters the availability of the Interface of functions void SfxSlotPool::ReleaseInterface( SfxInterface& rInterface ) @@ -209,7 +171,7 @@ const SfxSlot* SfxSlotPool::GetSlot( sal_uInt16 nId ) DBG_MEMTEST(); DBG_ASSERT( _pInterfaces != 0, "no Interfaces registered" ); - // Zun"achst die eigenen Interfaces absuchen + // First, search their own interfaces for ( sal_uInt16 nInterf = 0; nInterf < _pInterfaces->Count(); ++nInterf ) { const SfxSlot *pDef = _pInterfaces->GetObject(nInterf)->GetSlot(nId); @@ -217,7 +179,7 @@ const SfxSlot* SfxSlotPool::GetSlot( sal_uInt16 nId ) return pDef; } - // Dann beim eventuell vorhandenen parent versuchen + // Then try any of the possible existing parent return _pParentPool ? _pParentPool->GetSlot( nId ) : 0; } @@ -236,15 +198,14 @@ String SfxSlotPool::SeekGroup( sal_uInt16 nNo ) _nCurGroup = nNo; if ( _pParentPool ) { - // Meistens stimmt die Reihenfolge der Ids "uberein + // In most cases, the order of the IDs agree sal_uInt16 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 sal_uInt16 i; for ( i=1; i<nParentCount; i++ ) if ( (*_pGroups)[nNo] == (*_pParentPool->_pGroups)[i] ) @@ -257,7 +218,7 @@ String SfxSlotPool::SeekGroup( sal_uInt16 nNo ) aResId.SetRT(RSC_STRING); if ( !aResId.GetResMgr()->IsAvailable(aResId) ) { - DBG_ERROR( "GroupId-Name nicht im SFX definiert!" ); + OSL_FAIL( "GroupId-Name not defined in SFX!" ); return String(); } @@ -285,18 +246,18 @@ const SfxSlot* SfxSlotPool::SeekSlot( sal_uInt16 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 sal_uInt16 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 ); } @@ -322,7 +283,6 @@ const SfxSlot* SfxSlotPool::SeekSlot( sal_uInt16 nStartInterface ) } //-------------------------------------------------------------------- - // skips to the next func in the current group const SfxSlot* SfxSlotPool::NextSlot() @@ -330,7 +290,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 sal_uInt16 nFirstInterface = _pParentPool ? _pParentPool->_pInterfaces->Count() : 0; if ( _nCurInterface < nFirstInterface && _nCurGroup >= _pParentPool->_pGroups->Count() ) @@ -338,13 +298,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 ); } @@ -367,9 +327,7 @@ const SfxSlot* SfxSlotPool::NextSlot() //-------------------------------------------------------------------- - -// SlotName erfragen, gfs. mit HilfeText - +// Query SlotName with help text //-------------------------------------------------------------------- SfxInterface* SfxSlotPool::FirstInterface() @@ -419,3 +377,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 f73a7f4acf4b..8538e064418d 100644..100755 --- 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> @@ -48,7 +47,7 @@ DBG_NAME(SfxInterface) //==================================================================== EXTERN_C -#if defined( PM2 ) && (!defined( CSET ) && !defined ( MTW ) && !defined( WTC )) +#if defined( PM2 ) int _stdcall #else #ifdef WNT @@ -131,7 +130,7 @@ static SfxObjectUI_Impl* CreateObjectBarUI_Impl( sal_uInt16 nPos, const ResId& r //==================================================================== //==================================================================== -// ctor, registeres a new unit +// constuctor, registeres a new unit SfxInterface::SfxInterface( const char *pClassName, const ResId& rNameResId, @@ -175,17 +174,14 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, sal_uInt16 nSlotCount ) sal_uInt16 nIter = 1; for ( pIter = pSlots; nIter <= nCount; ++pIter, ++nIter ) { - //! hier bitte sinnvoll pruefen - //! DBG_ASSERT(!(pIter->IsMode(SFX_SLOT_CACHABLE) && - //! pIter->IsMode(SFX_SLOT_VOLATILE)), - //! "invalid Flags" ); + DBG_ASSERT( nIter == nCount || 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 +206,8 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, sal_uInt16 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 ( sal_uInt16 n = nIter; n < Count(); ++n ) { @@ -233,7 +230,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, sal_uInt16 nSlotCount ) { if ( pNext->GetSlotId() <= pIter->GetSlotId() ) - DBG_ERROR ("Falsche Reihenfolge!"); + OSL_FAIL("Wrong order!"); if ( pIter->GetKind() == SFX_KIND_ENUM ) { @@ -244,7 +241,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, sal_uInt16 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 +250,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, sal_uInt16 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 +267,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, sal_uInt16 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 +281,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, sal_uInt16 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 +297,8 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, sal_uInt16 nSlotCount ) #endif } - //-------------------------------------------------------------------- - - SfxInterface::~SfxInterface() { SfxModule *pMod = pImpData->pModule; @@ -324,7 +318,6 @@ SfxInterface::~SfxInterface() // searches for the specified func - const SfxSlot* SfxInterface::GetSlot( sal_uInt16 nFuncId ) const { DBG_MEMTEST(); @@ -360,7 +353,6 @@ const SfxSlot* SfxInterface::GetSlot( const String& rCommand ) const //-------------------------------------------------------------------- - const SfxSlot* SfxInterface::GetRealSlot( const SfxSlot *pSlot ) const { DBG_MEMTEST(); @@ -371,7 +363,7 @@ const SfxSlot* SfxInterface::GetRealSlot( const SfxSlot *pSlot ) const { if(pGenoType) return pGenoType->GetRealSlot(pSlot); - DBG_ERROR("fremder Slot"); + OSL_FAIL("unknown Slot"); return 0; } @@ -380,7 +372,6 @@ const SfxSlot* SfxInterface::GetRealSlot( const SfxSlot *pSlot ) const //-------------------------------------------------------------------- - const SfxSlot* SfxInterface::GetRealSlot( sal_uInt16 nSlotId ) const { DBG_MEMTEST(); @@ -392,7 +383,7 @@ const SfxSlot* SfxInterface::GetRealSlot( sal_uInt16 nSlotId ) const { if(pGenoType) return pGenoType->GetRealSlot(nSlotId); - DBG_ERROR("fremder Slot"); + OSL_FAIL("fremder Slot"); return 0; } @@ -401,7 +392,6 @@ const SfxSlot* SfxInterface::GetRealSlot( sal_uInt16 nSlotId ) const //-------------------------------------------------------------------- - void SfxInterface::RegisterPopupMenu( const ResId& rResId ) { DBG_CHKTHIS(SfxInterface, 0); @@ -454,10 +444,10 @@ const ResId& SfxInterface::GetObjectBarResId( sal_uInt16 nNo ) const sal_Bool bGenoType = (pGenoType != 0 && !pGenoType->HasName()); if ( bGenoType ) { - // Gibt es Toolbars in der Superklasse ? + // Are there toolbars in the super class? sal_uInt16 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 +455,7 @@ const ResId& SfxInterface::GetObjectBarResId( sal_uInt16 nNo ) const #ifdef DBG_UTIL sal_uInt16 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 +468,10 @@ sal_uInt16 SfxInterface::GetObjectBarPos( sal_uInt16 nNo ) const sal_Bool bGenoType = (pGenoType != 0 && !pGenoType->HasName()); if ( bGenoType ) { - // Gibt es Toolbars in der Superklasse ? + // Are there toolbars in the super class? sal_uInt16 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 +479,7 @@ sal_uInt16 SfxInterface::GetObjectBarPos( sal_uInt16 nNo ) const #ifdef DBG_UTIL sal_uInt16 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 +518,10 @@ sal_uInt32 SfxInterface::GetChildWindowId (sal_uInt16 nNo) const { if ( pGenoType ) { - // Gibt es ChildWindows in der Superklasse ? + // Are there ChildWindows in der Superklasse? sal_uInt16 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 +529,7 @@ sal_uInt32 SfxInterface::GetChildWindowId (sal_uInt16 nNo) const #ifdef DBG_UTIL sal_uInt16 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 +541,10 @@ sal_uInt32 SfxInterface::GetChildWindowFeature (sal_uInt16 nNo) const { if ( pGenoType ) { - // Gibt es ChildWindows in der Superklasse ? + // Are there ChildWindows in der Superklasse? sal_uInt16 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 +552,7 @@ sal_uInt32 SfxInterface::GetChildWindowFeature (sal_uInt16 nNo) const #ifdef DBG_UTIL sal_uInt16 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 +590,10 @@ const String* SfxInterface::GetObjectBarName ( sal_uInt16 nNo ) const sal_Bool bGenoType = (pGenoType != 0 && !pGenoType->HasName()); if ( bGenoType ) { - // Gibt es Toolbars in der Superklasse ? + // Are there toolbars in the super class? sal_uInt16 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 +601,7 @@ const String* SfxInterface::GetObjectBarName ( sal_uInt16 nNo ) const #ifdef DBG_UTIL sal_uInt16 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 +611,10 @@ sal_uInt32 SfxInterface::GetObjectBarFeature ( sal_uInt16 nNo ) const sal_Bool bGenoType = (pGenoType != 0 && !pGenoType->HasName()); if ( bGenoType ) { - // Gibt es Toolbars in der Superklasse ? + // Are there toolbars in the super class? sal_uInt16 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 +622,7 @@ sal_uInt32 SfxInterface::GetObjectBarFeature ( sal_uInt16 nNo ) const #ifdef DBG_UTIL sal_uInt16 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 +632,10 @@ sal_Bool SfxInterface::IsObjectBarVisible(sal_uInt16 nNo) const sal_Bool bGenoType = (pGenoType != 0 && !pGenoType->HasName()); if ( bGenoType ) { - // Gibt es Toolbars in der Superklasse ? + // Are there toolbars in the super class? sal_uInt16 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 +643,7 @@ sal_Bool SfxInterface::IsObjectBarVisible(sal_uInt16 nNo) const #ifdef DBG_UTIL sal_uInt16 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 +653,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 +671,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 9fb17332c27d..5632858d2b6b 100644..100755 --- 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 ec6f9a7428e9..32c454c1f1f1 100644..100755 --- 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. @@ -38,16 +39,11 @@ #include <com/sun/star/frame/XDispatchRecorderSupplier.hpp> #include <svl/itemiter.hxx> -#ifndef _ARGS_HXX //autogen #include <svl/itempool.hxx> -#endif #include <svtools/itemdel.hxx> #include <comphelper/processfactory.hxx> -#ifndef GCC -#endif - #include <svl/smplhint.hxx> #include <sfx2/request.hxx> @@ -394,7 +390,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; @@ -470,8 +466,8 @@ void SfxRequest::RemoveItem( sal_uInt16 nID ) const SfxPoolItem* SfxRequest::GetArg ( - sal_uInt16 nSlotId, // Slot-Id oder Which-Id des Parameters - bool bDeep, // false: nicht in Parent-ItemSets suchen + sal_uInt16 nSlotId, // Slot-Id oder Which-Id des Parameters + bool bDeep, // false: nicht in Parent-ItemSets suchen TypeId aType // != 0: RTTI Pruefung mit Assertion ) const { @@ -540,7 +536,7 @@ const SfxPoolItem* SfxRequest::GetItem return pItem; // Item da aber falsch => Programmierfehler - DBG_ERROR( "invalid argument type" ); + OSL_FAIL( "invalid argument type" ); } } @@ -790,7 +786,7 @@ void SfxRequest::Done_Impl if ( nSlotId == nSlot ) { // mit Hosentr"ager und G"urtel reparieren des falschen Flags - DBG_ERROR( "recursion RecordPerItem - use RecordPerSet!" ); + OSL_FAIL( "recursion RecordPerItem - use RecordPerSet!" ); SfxSlot *pSlot = (SfxSlot*) pImp->pSlot; pSlot->nFlags &= ~((sal_uIntPtr)SFX_SLOT_RECORDPERITEM); pSlot->nFlags &= SFX_SLOT_RECORDPERSET; @@ -871,7 +867,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()) @@ -976,3 +972,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 96f305f58389..c40263f18cac 100644..100755 --- 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( sal_uInt16 nSlotId, const rtl::OUString& rNewComma 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 be365349888f..f02fa16e8bdb 100644..100755 --- 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. @@ -38,9 +39,6 @@ #include <unotools/undoopt.hxx> -#ifndef GCC -#endif - #include <sfx2/app.hxx> #include <sfx2/shell.hxx> #include <sfx2/bindings.hxx> @@ -81,7 +79,6 @@ struct SfxShell_Impl: public SfxBroadcaster SfxViewShell* pViewSh; // SfxViewShell falls Shell ViewFrame/ViewShell/SubShell ist SfxViewFrame* pFrame; // Frame, falls <UI-aktiv> SfxRepeatTarget* pRepeatTarget; -// SbxObjectRef xParent; sal_Bool bInAppBASIC; sal_Bool bActive; sal_uIntPtr nDisableFlags; @@ -123,11 +120,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 &) { } @@ -599,7 +596,7 @@ void SfxShell::Invalidate { if ( !GetViewShell() ) { - DBG_ERROR( "wrong Invalidate method called!" ); + OSL_FAIL( "wrong Invalidate method called!" ); return; } @@ -1286,3 +1283,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 df627a19e6fb..4bf146527839 100644..100755 --- 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, sal_uInt8 nMemberId ) const +bool SfxScriptOrganizerItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const { String aValue; sal_Bool bIsString = sal_False; @@ -102,21 +103,21 @@ sal_Bool SfxScriptOrganizerItem::QueryValue( com::sun::star::uno::Any& rVal, sal aValue = aLanguage; break; default: - DBG_ERROR("Wrong MemberId!"); - return sal_False; + OSL_FAIL("Wrong MemberId!"); + 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, sal_uInt8 nMemberId ) +bool SfxScriptOrganizerItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) { ::rtl::OUString aValue; - sal_Bool bRet = sal_False; + sal_Bool bRet = false; nMemberId &= ~CONVERT_TWIPS; switch ( nMemberId ) { @@ -127,10 +128,11 @@ sal_Bool SfxScriptOrganizerItem::PutValue( const com::sun::star::uno::Any& rVal, aLanguage = aValue; break; default: - DBG_ERROR("Wrong MemberId!"); - return sal_False; + OSL_FAIL("Wrong MemberId!"); + 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 889cf97b1b6c..dfdb67ed0947 100644..100755 --- 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. @@ -29,11 +30,10 @@ #include "precompiled_sfx2.hxx" #ifdef SOLARIS -// HACK: prevent conflict between STLPORT and Workshop headers on Solaris 8 #include <ctime> #endif -#include <string> // HACK: prevent conflict between STLPORT and Workshop headers +#include <string> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XController.hpp> #include <com/sun/star/frame/XFrameActionListener.hpp> @@ -49,9 +49,6 @@ #include <svl/visitem.hxx> #include <comphelper/processfactory.hxx> -#ifndef GCC -#endif - #include <sfx2/app.hxx> #include <sfx2/appuno.hxx> #include "statcach.hxx" @@ -110,7 +107,6 @@ void SAL_CALL BindDispatch_Impl::statusChanged( const ::com::sun::star::frame:: SfxPoolItem *pItem=NULL; sal_uInt16 nId = pCache->GetId(); SfxItemState eState = SFX_ITEM_DISABLED; - // pCache->Invalidate( sal_False ); if ( !aStatus.IsEnabled ) { // default @@ -379,8 +375,6 @@ void SfxStateCache::SetState */ { -// if ( pDispatch ) -// return; SetState_Impl( eState, pState, bMaybeDirty ); } @@ -390,7 +384,6 @@ void SfxStateCache::SetVisibleState( sal_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 +400,6 @@ void SfxStateCache::SetVisibleState( sal_Bool bShow ) pState = pLastItem; eState = eLastState; - bNotify = ( pState != 0 ); } else { @@ -575,3 +567,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 2a54e5b1c638..3f139ad3ac2b 100644..100755 --- 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> @@ -71,7 +72,6 @@ namespace css = ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::util; -//long nOfficeDispatchCount = 0; enum URLTypeId { @@ -108,7 +108,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 +130,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 ) @@ -206,7 +206,7 @@ void SfxUnoControllerItem::GetNewDispatch() if ( !pBindings ) { // Bindings released - DBG_ERROR( "Tried to get dispatch, but no Bindings!" ); + OSL_FAIL( "Tried to get dispatch, but no Bindings!" ); return; } @@ -339,48 +339,20 @@ 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++; - // this object is an adapter that shows a ::com::sun::star::frame::XDispatch-Interface to the outside and uses a SfxControllerItem to monitor a state pControllerItem = new SfxDispatchController_Impl( this, &rBindings, pDispat, pSlot, rURL ); } SfxOfficeDispatch::SfxOfficeDispatch( SfxDispatcher* pDispat, const SfxSlot* pSlot, const ::com::sun::star::util::URL& rURL ) { -// nOfficeDispatchCount++; - // this object is an adapter that shows a ::com::sun::star::frame::XDispatch-Interface to the outside and uses a SfxControllerItem to monitor a state pControllerItem = new SfxDispatchController_Impl( this, NULL, pDispat, pSlot, rURL ); } SfxOfficeDispatch::~SfxOfficeDispatch() { -// --nOfficeDispatchCount; - if ( pControllerItem ) { // when dispatch object is released, destroy its connection to this object and destroy it @@ -470,7 +442,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 +478,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 +639,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 && ( @@ -676,14 +648,6 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util ) ) { - /* - if ( !IsBound() && pBindings ) - { - pBindings->ENTERREGISTRATIONS(); - BindInternal_Impl( nSlot, pBindings ); - pBindings->LEAVEREGISTRATIONS(); - } */ - if ( !pDispatcher && pBindings ) pDispatcher = GetBindings().GetDispatcher_Impl(); @@ -702,6 +666,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 +683,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 +728,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 +768,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 +817,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,17 +843,10 @@ 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; - /*if ( !IsBound() && pBindings ) - { - pBindings->ENTERREGISTRATIONS(); - BindInternal_Impl( nSlot, pBindings ); - pBindings->LEAVEREGISTRATIONS(); - } */ - // Use alternative QueryState call to have a valid UNO representation of the state. ::com::sun::star::uno::Any aState; if ( !pDispatcher && pBindings ) @@ -1011,3 +976,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 new file mode 100755 index 000000000000..83319fc9aa84 --- /dev/null +++ b/sfx2/source/dialog/about.cxx @@ -0,0 +1,394 @@ +/* -*- 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 + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_sfx2.hxx" + +// include --------------------------------------------------------------- + +#include <vcl/svapp.hxx> +#include <vcl/msgbox.hxx> + +#include <tools/stream.hxx> +#include <tools/urlobj.hxx> +#include <rtl/bootstrap.hxx> +#include <unotools/configmgr.hxx> +#include <unotools/bootstrap.hxx> +#include <com/sun/star/uno/Any.h> +#include <unotools/configmgr.hxx> +#include <vcl/svapp.hxx> +#include <vcl/graph.hxx> +#include <svtools/filter.hxx> + +#include "com/sun/star/system/SystemShellExecuteFlags.hpp" +#include "com/sun/star/system/XSystemShellExecute.hpp" +#include <comphelper/processfactory.hxx> +#include "comphelper/anytostring.hxx" +#include "cppuhelper/exc_hlp.hxx" +#include "cppuhelper/bootstrap.hxx" + +#include <sfx2/sfxuno.hxx> +#include "about.hxx" +#include "sfxresid.hxx" +#include <sfx2/sfxdefs.hxx> +#include <sfx2/app.hxx> + +#include "dialog.hrc" + +using namespace ::com::sun::star; + +// defines --------------------------------------------------------------- + +#define SCROLL_OFFSET 1 +#define SPACE_OFFSET 5 +#define SCROLL_TIMER 30 + +/** loads the application logo as used in the about dialog and impress slideshow pause screen */ +Image SfxApplication::GetApplicationLogo() +{ + BitmapEx aBitmap; + Application::LoadBrandBitmap ("about", aBitmap); + return Image( aBitmap ); +} + +AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerStr ) : + + SfxModalDialog ( pParent, rId ), + + aOKButton ( this, ResId( ABOUT_BTN_OK, *rId.GetResMgr() ) ), + aVersionText ( this, ResId( ABOUT_FTXT_VERSION, *rId.GetResMgr() ) ), + aCopyrightText ( this, ResId( ABOUT_FTXT_COPYRIGHT, *rId.GetResMgr() ) ), + aInfoLink ( this, ResId( ABOUT_FTXT_LINK, *rId.GetResMgr() ) ), + aDeveloperAry ( ResId( ABOUT_STR_DEVELOPER_ARY, *rId.GetResMgr() ) ), + aDevVersionStr ( rVerStr ), + aAccelStr ( ResId( ABOUT_STR_ACCEL, *rId.GetResMgr() ) ), + aVersionTextStr( ResId( ABOUT_STR_VERSION, *rId.GetResMgr() ) ), + aCopyrightTextStr( ResId( ABOUT_STR_COPYRIGHT, *rId.GetResMgr() ) ), + aLinkStr ( ResId( ABOUT_STR_LINK, *rId.GetResMgr() ) ), + aTimer (), + nOff ( 0 ), + m_nDeltaWidth ( 0 ), + m_nPendingScrolls( 0 ), + bNormal ( TRUE ) +{ + rtl::OUString sProduct; + utl::ConfigManager::GetDirectConfigProperty(utl::ConfigManager::PRODUCTNAME) >>= sProduct; + + // load image from module path + aAppLogo = SfxApplication::GetApplicationLogo(); + + // Transparenter Font + Font aFont = GetFont(); + aFont.SetTransparent( TRUE ); + SetFont( aFont ); + + // if necessary more info + 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 + if ( aAccelStr.Len() && ByteString(U2S(aAccelStr)).IsAlphaAscii() ) + { + Accelerator *pAccel = 0, *pPrevAccel = 0, *pFirstAccel = 0; + aAccelStr.ToUpperAscii(); + + for ( USHORT i = 0; i < aAccelStr.Len(); ++i ) + { + pPrevAccel = pAccel; + pAccel = new Accelerator; + aAccelList.push_back( pAccel ); + USHORT nKey = aAccelStr.GetChar(i) - 'A' + KEY_A; + pAccel->InsertItem( 1, KeyCode( nKey, KEY_MOD1 ) ); + if ( i > 0 ) + pPrevAccel->SetAccel( 1, pAccel ); + if ( i == 0 ) + pFirstAccel = pAccel; + } + pAccel->SetSelectHdl( LINK( this, AboutDialog, AccelSelectHdl ) ); + GetpApp()->InsertAccel( pFirstAccel ); + } + + // set for background and text the correct system color + const StyleSettings& rSettings = GetSettings().GetStyleSettings(); + Color aWhiteCol( rSettings.GetWindowColor() ); + Wallpaper aWall( aWhiteCol ); + SetBackground( aWall ); + Font aNewFont( aCopyrightText.GetFont() ); + aNewFont.SetTransparent( TRUE ); + + aVersionText.SetFont( aNewFont ); + aCopyrightText.SetFont( aNewFont ); + + 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 ); + + aCopyrightText.SetText( aCopyrightTextStr ); + + // determine size and position of the dialog & elements + Size aAppLogoSiz = aAppLogo.GetSizePixel(); + + if (aAppLogoSiz.Width() < 300) + aAppLogoSiz.Width() = 300; + + Size aOutSiz = GetOutputSizePixel(); + aOutSiz.Width() = aAppLogoSiz.Width(); + + // analyze size of the aVersionText widget + // character size + Size a6Size = aVersionText.LogicToPixel( Size( 6, 6 ), MAP_APPFONT ); + // preferred Version widget size + Size aVTSize = aVersionText.CalcMinimumSize(); + long nY = aAppLogoSiz.Height() + ( a6Size.Height() * 2 ); + long nDlgMargin = a6Size.Width() * 3 ; + long nCtrlMargin = aVTSize.Height() + ( a6Size.Height() * 2 ); + long nTextWidth = aOutSiz.Width() - nDlgMargin; + + // finally set the aVersionText widget position and size + Size aVTCopySize = aVTSize; + Point aVTCopyPnt; + aVTCopySize.Width() = nTextWidth; + aVTCopyPnt.X() = ( aOutSiz.Width() - aVTCopySize.Width() ) / 2; + aVTCopyPnt.Y() = nY; + aVersionText.SetPosSizePixel( aVTCopyPnt, aVTCopySize ); + + nY += nCtrlMargin; + + // OK-Button-Position (at the bottom and centered) + Size aOKSiz = aOKButton.GetSizePixel(); + Point aOKPnt = aOKButton.GetPosPixel(); + + // FixedHyperlink with more info link + Point aLinkPnt = aInfoLink.GetPosPixel(); + Size aLinkSize = aInfoLink.GetSizePixel(); + + // Multiline edit with Copyright-Text + Point aCopyPnt = aCopyrightText.GetPosPixel(); + Size aCopySize = aCopyrightText.GetSizePixel(); + aCopySize.Width() = nTextWidth; + aCopySize.Height() = aOutSiz.Height() - nY - ( aOKSiz.Height() * 2 ) - 3*aLinkSize.Height() - nCtrlMargin; + + aCopyPnt.X() = ( aOutSiz.Width() - aCopySize.Width() ) / 2; + aCopyPnt.Y() = nY; + aCopyrightText.SetPosSizePixel( aCopyPnt, aCopySize ); + + nY += aCopySize.Height() + aLinkSize.Height(); + + aLinkSize.Width() = aInfoLink.CalcMinimumSize().Width(); + aLinkPnt.X() = ( aOutSiz.Width() - aLinkSize.Width() ) / 2; + aLinkPnt.Y() = nY; + aInfoLink.SetPosSizePixel( aLinkPnt, aLinkSize ); + + nY += aLinkSize.Height() + nCtrlMargin; + + aOKPnt.X() = ( aOutSiz.Width() - aOKSiz.Width() ) / 2; + aOKPnt.Y() = nY; + aOKButton.SetPosPixel( aOKPnt ); + + // Change the width of the dialog + SetOutputSizePixel( aOutSiz ); + + FreeResource(); + + // explizite Help-Id + SetHelpId( SID_ABOUT ); +} + +// ----------------------------------------------------------------------- + +AboutDialog::~AboutDialog() +{ + // L"oschen des Entwickleraufrufs + if ( !aAccelList.empty() ) + { + GetpApp()->RemoveAccel( aAccelList.front() ); + + for ( size_t i = 0, n = aAccelList.size(); i < n; ++i ) + delete aAccelList[ i ]; + aAccelList.clear(); + } +} + +// ----------------------------------------------------------------------- + +IMPL_LINK( AboutDialog, TimerHdl, Timer *, pTimer ) +{ + (void)pTimer; //unused + ++m_nPendingScrolls; + Invalidate( INVALIDATE_NOERASE | INVALIDATE_NOCHILDREN ); + return 0; +} + +// ----------------------------------------------------------------------- + +IMPL_LINK( AboutDialog, AccelSelectHdl, Accelerator *, pAccelerator ) +{ + (void)pAccelerator; //unused + // init Timer + aTimer.SetTimeoutHdl( LINK( this, AboutDialog, TimerHdl ) ); + + // init scroll mode + nOff = GetOutputSizePixel().Height(); + MapMode aMapMode( MAP_PIXEL ); + SetMapMode( aMapMode ); + bNormal = FALSE; + + // start scroll Timer + aTimer.SetTimeout( SCROLL_TIMER ); + aTimer.Start(); + return 0; +} + +// ----------------------------------------------------------------------- + +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 + aTimer.Stop(); + EndDialog( RET_OK ); + return( FALSE ); +} + +// ----------------------------------------------------------------------- + +void AboutDialog::Paint( const Rectangle& rRect ) +{ + SetClipRegion( rRect ); + + if ( bNormal ) // not in scroll mode + { + Point aPos( m_nDeltaWidth / 2, 0 ); + DrawImage( aPos, aAppLogo ); + return; + } + + // scroll the content + const int nDeltaY = -SCROLL_OFFSET * m_nPendingScrolls; + if( !nDeltaY ) + return; + nOff += nDeltaY; + Scroll( 0, nDeltaY, SCROLL_NOERASE ); + m_nPendingScrolls = 0; + + // draw the credits text + const Font aOrigFont = GetFont(); + const int nFullWidth = GetOutputSizePixel().Width(); + + int nY = nOff; + const int nDevCnt = static_cast<int>( aDeveloperAry.Count() ); + for( int i = 0; i < nDevCnt; ++i ) + { + if( nY >= rRect.Bottom() ) + break; + + int nPos2 = nY + GetTextHeight() + 3; + if( nPos2 >= rRect.Top() + nDeltaY ) + { + const String aStr = aDeveloperAry.GetString(i); + const long nVal = aDeveloperAry.GetValue(i); + + if ( nVal ) + { + // emphasize the headers + Font aFont = aOrigFont; + aFont.SetWeight( (FontWeight)nVal ); + SetFont( aFont ); + nPos2 = nY + GetTextHeight() + 3; + } + + // clear text background + Rectangle aEraseRect( Point(0,nY), Size( nFullWidth, nPos2-nY)); + Erase( aEraseRect ); + + // draw centered text + const long nTextWidth = GetTextWidth( aStr ); + long nX = (nFullWidth - 5 - nTextWidth) / 2; + if( nX < 0 ) + nX = SPACE_OFFSET; + const Point aPnt( nX, nY ); + DrawText( aPnt, aStr ); + + // restore the font if needed + if( nVal ) + SetFont( aOrigFont ); + } + nY = nPos2; + } + + // close dialog if the whole text has been scrolled + if ( nY <= 0 ) + { + bNormal = TRUE; + Close(); + } +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/alienwarn.cxx b/sfx2/source/dialog/alienwarn.cxx index 13a0433b7be5..6e2dd844b095 100644..100755 --- 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/alienwarn.hrc b/sfx2/source/dialog/alienwarn.hrc index e3a23dc57836..e3a23dc57836 100644..100755 --- a/sfx2/source/dialog/alienwarn.hrc +++ b/sfx2/source/dialog/alienwarn.hrc diff --git a/sfx2/source/dialog/alienwarn.src b/sfx2/source/dialog/alienwarn.src index ae07b28a4f4d..ae07b28a4f4d 100644..100755 --- a/sfx2/source/dialog/alienwarn.src +++ b/sfx2/source/dialog/alienwarn.src diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx index c7f9bbeec244..f46f9cea85ae 100644..100755 --- 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 { @@ -1023,7 +1024,7 @@ const sal_uInt16* SfxSingleTabDialog::GetInputRanges( const SfxItemPool& rPool ) { if ( GetInputItemSet() ) { - DBG_ERROR( "Set bereits vorhanden!" ); + OSL_FAIL( "Set bereits vorhanden!" ); return GetInputItemSet()->GetRanges(); } @@ -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 7f03bf416431..08940391ac87 100644..100755 --- 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/dialog.src b/sfx2/source/dialog/dialog.src index c39425510ae2..c39425510ae2 100644..100755 --- a/sfx2/source/dialog/dialog.src +++ b/sfx2/source/dialog/dialog.src diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 2d5c383f8b89..52fbc865d4f1 100644..100755 --- 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( sal_uIntPtr nSize, sal_Bool bExtraBytes, sal_Bool bSmartE 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, sal_uInt8 nMemberId ) const +bool SfxDocumentInfoItem::QueryValue( Any& rVal, sal_uInt8 nMemberId ) const { String aValue; sal_Int32 nValue = 0; @@ -558,7 +558,7 @@ sal_Bool SfxDocumentInfoItem::QueryValue( Any& rVal, sal_uInt8 nMemberId ) const aValue = getTitle(); break; default: - DBG_ERROR("Wrong MemberId!"); + OSL_FAIL("Wrong MemberId!"); return sal_False; } @@ -568,15 +568,15 @@ sal_Bool SfxDocumentInfoItem::QueryValue( Any& rVal, sal_uInt8 nMemberId ) const rVal <<= nValue; else rVal <<= bValue; - return sal_True; + return true; } -sal_Bool SfxDocumentInfoItem::PutValue( const Any& rVal, sal_uInt8 nMemberId ) +bool SfxDocumentInfoItem::PutValue( const Any& rVal, sal_uInt8 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 ) { @@ -632,8 +632,8 @@ sal_Bool SfxDocumentInfoItem::PutValue( const Any& rVal, sal_uInt8 nMemberId ) setTitle(aValue); break; default: - DBG_ERROR("Wrong MemberId!"); - return sal_False; + OSL_FAIL("Wrong MemberId!"); + return false; } return bRet; @@ -978,20 +978,6 @@ sal_Bool SfxDocumentPage::FillItemSet( SfxItemSet& rSet ) SfxDocumentInfoItem* pInfoItem = (SfxDocumentInfoItem*)pItem; sal_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 = sal_True; } @@ -1127,12 +1113,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 ) ); @@ -1197,10 +1181,10 @@ SfxInternetPage::SfxInternetPage( Window* pParent, const SfxItemSet& rItemSet ) { pFrame->GetTargetList( aList ); - String* pObj; - for( sal_uInt16 nPos = ( sal_uInt16 ) aList.Count() ; nPos ; ) + String* pObj; + for( size_t nPos = aList.size() ; nPos ; ) { - pObj = aList.GetObject( --nPos ); + pObj = aList[ --nPos ]; aCBFrame.InsertEntry( *pObj ); delete pObj; } @@ -1262,7 +1246,7 @@ void SfxInternetPage::ChangeState( STATE eNewState ) EnableReload( sal_True ); break; default: - DBG_ERROR( "*SfxInternetPage::SetState(): unhandled state!" ); + OSL_FAIL( "*SfxInternetPage::SetState(): unhandled state!" ); } eState = eNewState; @@ -1462,7 +1446,6 @@ void SfxInternetPage::Reset( const SfxItemSet& rSet ) ChangeState( eNewState ); - // #102907# ------------------------ SFX_ITEMSET_ARG( &rSet, pROItem, SfxBoolItem, SID_DOC_READONLY, sal_False ); if ( pROItem && pROItem->GetValue() ) { @@ -1611,9 +1594,7 @@ public: util::Duration GetDuration() const; }; -/*-- 20.11.2009 15:40:46--------------------------------------------------- - -----------------------------------------------------------------------*/ DurationDialog_Impl::DurationDialog_Impl( Window* pParent, const util::Duration& rDuration) : ModalDialog( pParent, SfxResId( RID_EDIT_DURATIONS ) ), @@ -1647,15 +1628,11 @@ DurationDialog_Impl::DurationDialog_Impl( aSecondNF.SetValue(rDuration.Seconds); aMSecondNF.SetValue(rDuration.MilliSeconds); } -/*-- 20.11.2009 16:08:55--------------------------------------------------- - -----------------------------------------------------------------------*/ DurationDialog_Impl::~DurationDialog_Impl() { } -/*-- 20.11.2009 15:41:47--------------------------------------------------- - -----------------------------------------------------------------------*/ util::Duration DurationDialog_Impl::GetDuration() const { util::Duration aRet; @@ -1670,24 +1647,17 @@ util::Duration DurationDialog_Impl::GetDuration() const return aRet; } -/*-- 20.11.2009 15:30:58--------------------------------------------------- - - -----------------------------------------------------------------------*/ CustomPropertiesDurationField::CustomPropertiesDurationField( Window* pParent, const ResId& rResId, CustomPropertyLine* pLine ) : Edit( pParent, rResId ), m_pLine( pLine ) { SetDuration( util::Duration(false, 0, 0, 0, 0, 0, 0, 0) ); } -/*-- 23.11.2009 08:46:02--------------------------------------------------- - -----------------------------------------------------------------------*/ CustomPropertiesDurationField::~CustomPropertiesDurationField() { } -/*-- 23.11.2009 09:23:35--------------------------------------------------- - -----------------------------------------------------------------------*/ void CustomPropertiesDurationField::RequestHelp( const HelpEvent& rHEvt ) { if( rHEvt.GetMode() & HELPMODE_QUICK ) @@ -1701,9 +1671,7 @@ void CustomPropertiesDurationField::RequestHelp( const HelpEvent& rHEvt ) QUICKHELP_LEFT|QUICKHELP_VCENTER ); } } -/*-- 20.11.2009 15:30:58--------------------------------------------------- - -----------------------------------------------------------------------*/ void CustomPropertiesDurationField::SetDuration( const util::Duration& rDuration ) { m_aDuration = rDuration; @@ -1717,23 +1685,17 @@ void CustomPropertiesDurationField::SetDuration( const util::Duration& rDuration sText.SearchAndReplace(String::CreateFromAscii( "%6"), String::CreateFromInt32( rDuration.Seconds) ); SetText( sText ); } -/*-- 23.11.2009 08:51:15--------------------------------------------------- - -----------------------------------------------------------------------*/ CustomPropertiesEditButton::CustomPropertiesEditButton( Window* pParent, const ResId& rResId, CustomPropertyLine* pLine ) : PushButton( pParent, rResId ), m_pLine( pLine ) { SetClickHdl( LINK( this, CustomPropertiesEditButton, ClickHdl )); } -/*-- 23.11.2009 08:51:15--------------------------------------------------- - -----------------------------------------------------------------------*/ CustomPropertiesEditButton::~CustomPropertiesEditButton() { } -/*-- 23.11.2009 08:47:37--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK( CustomPropertiesEditButton, ClickHdl, PushButton*, EMPTYARG ) { DurationDialog_Impl* pDurationDlg = new DurationDialog_Impl( this, m_pLine->m_aDurationField.GetDuration() ); @@ -1777,8 +1739,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() @@ -2099,7 +2060,7 @@ void CustomPropertiesWindow::AddLine( const ::rtl::OUString& sName, Any& rAny ) pCurrent++; pNewCurrent++; } - // + pNewLine->m_aDatePos = pNewLine->m_aDateField.GetPosPixel(); pNewLine->m_aTimePos = pNewLine->m_aTimeField.GetPosPixel(); pNewLine->m_aDateTimeSize = pNewLine->m_aDateField.GetSizePixel(); @@ -2113,7 +2074,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 ) @@ -2354,7 +2315,6 @@ CustomPropertiesControl::CustomPropertiesControl( Window* pParent, const ResId& Link aScrollLink = LINK( this, CustomPropertiesControl, ScrollHdl ); m_aVertScroll.SetScrollHdl( aScrollLink ); -// m_aVertScroll.SetEndScrollHdl( aScrollLink ); } CustomPropertiesControl::~CustomPropertiesControl() @@ -2475,3 +2435,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.hrc b/sfx2/source/dialog/dinfdlg.hrc index 43bd848844a0..43bd848844a0 100644..100755 --- a/sfx2/source/dialog/dinfdlg.hrc +++ b/sfx2/source/dialog/dinfdlg.hrc diff --git a/sfx2/source/dialog/dinfdlg.src b/sfx2/source/dialog/dinfdlg.src index eaa24105bb17..fdaa47543a2a 100644..100755 --- a/sfx2/source/dialog/dinfdlg.src +++ b/sfx2/source/dialog/dinfdlg.src @@ -709,11 +709,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 5c250f7cc912..93ee933d48bf 100644..100755 --- 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. @@ -28,9 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" -#ifndef GCC -#endif - #include "sfx2/dinfedt.hxx" #include "sfx2/sfxresid.hxx" @@ -64,3 +62,4 @@ SfxDocInfoEditDlg::SfxDocInfoEditDlg( Window* pParent ) : FreeResource(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/dinfedt.hrc b/sfx2/source/dialog/dinfedt.hrc index ef52362af2cb..ef52362af2cb 100644..100755 --- a/sfx2/source/dialog/dinfedt.hrc +++ b/sfx2/source/dialog/dinfedt.hrc diff --git a/sfx2/source/dialog/dinfedt.src b/sfx2/source/dialog/dinfedt.src index 110dccf11c40..110dccf11c40 100644..100755 --- a/sfx2/source/dialog/dinfedt.src +++ b/sfx2/source/dialog/dinfedt.src diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx index 76bd38377eb8..58d09bf48a53 100644..100755 --- 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; sal_uInt16 nID = sal_uInt16(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; sal_uInt16 nID = sal_uInt16(rDockingWindowName.toInt32()); @@ -445,7 +448,6 @@ friend class SfxDockingWindow; Size aMinSize; SfxSplitWindow* pSplitWin; sal_Bool bSplitable; -// sal_Bool bAutoHide; Timer aMoveTimer; // Folgende members sind nur in der Zeit von StartDocking bis EndDocking @@ -612,12 +614,6 @@ void SfxDockingWindow::ToggleFloatingMode() GetFloatingWindow()->SetWindowState( pImp->aWinState ); else GetFloatingWindow()->SetOutputSizePixel( GetFloatingSize() ); -/* - if ( pImp->bSplitable && !pImp->bEndDocked ) - // Wenn das Fenster vorher in einem SplitWindow lag, kommt von - // Sv kein Show - Show(); -*/ } else { @@ -821,11 +817,8 @@ void SfxDockingWindow::EndDocking( const Rectangle& rRect, sal_Bool bFloatMode ) SfxWorkWindow *pWorkWin = pBindings->GetWorkWindow_Impl(); sal_Bool bReArrange = sal_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() @@ -895,12 +888,7 @@ void SfxDockingWindow::Resizing( Size& /*rSize*/ ) */ { -/* - if(rSize.Width() < pImp->aMinSize.Width()) - rSize.Width() = pImp->aMinSize.Width(); - if(rSize.Height() < pImp->aMinSize.Height()) - rSize.Height() = pImp->aMinSize.Height(); -*/ + } //------------------------------------------------------------------------- @@ -944,7 +932,6 @@ SfxDockingWindow::SfxDockingWindow( SfxBindings *pBindinx, SfxChildWindow *pCW, pImp->bDockingPrevented = sal_False; pImp->bSplitable = sal_True; -// pImp->bAutoHide = sal_False; // Zun"achst auf Defaults setzen; das Alignment wird in der Subklasse gesetzt pImp->nLine = pImp->nDockLine = 0; @@ -953,8 +940,6 @@ SfxDockingWindow::SfxDockingWindow( SfxBindings *pBindinx, SfxChildWindow *pCW, pImp->SetLastAlignment(SFX_ALIGN_NOALIGNMENT); pImp->aMoveTimer.SetTimeout(50); pImp->aMoveTimer.SetTimeoutHdl(LINK(this,SfxDockingWindow,TimerHdl)); - -// DBG_ASSERT(pMgr,"DockingWindow erfordert ein SfxChildWindow!"); } //------------------------------------------------------------------------- @@ -998,7 +983,6 @@ SfxDockingWindow::SfxDockingWindow( SfxBindings *pBindinx, SfxChildWindow *pCW, pImp->bDockingPrevented = sal_False; pImp->bSplitable = sal_True; -// pImp->bAutoHide = sal_False; // Zun"achst auf Defaults setzen; das Alignment wird in der Subklasse gesetzt pImp->nLine = pImp->nDockLine = 0; @@ -1007,8 +991,6 @@ SfxDockingWindow::SfxDockingWindow( SfxBindings *pBindinx, SfxChildWindow *pCW, pImp->SetLastAlignment(SFX_ALIGN_NOALIGNMENT); pImp->aMoveTimer.SetTimeout(50); pImp->aMoveTimer.SetTimeoutHdl(LINK(this,SfxDockingWindow,TimerHdl)); - -// DBG_ASSERT(pMgr,"DockingWindow erfordert ein SfxChildWindow!"); } //------------------------------------------------------------------------- @@ -1024,7 +1006,6 @@ void SfxDockingWindow::Initialize(SfxChildWinInfo *pInfo) { if ( !pMgr ) { - // Bugfix #39771 pImp->SetDockAlignment( SFX_ALIGN_NOALIGNMENT ); pImp->bConstructed = sal_True; return; @@ -1083,7 +1064,7 @@ void SfxDockingWindow::Initialize(SfxChildWinInfo *pInfo) SfxChildAlignment eAlign = CheckAlignment(GetAlignment(),GetAlignment()); if ( eAlign != GetAlignment() ) { - DBG_ERROR("Invalid Alignment!"); + OSL_FAIL("Invalid Alignment!"); SetAlignment( eAlign ); aStr.Erase(); } @@ -1114,7 +1095,7 @@ void SfxDockingWindow::Initialize(SfxChildWinInfo *pInfo) } } else { - DBG_ERROR( "Information is missing!" ); + OSL_FAIL( "Information is missing!" ); } } @@ -1174,7 +1155,6 @@ void SfxDockingWindow::Initialize(SfxChildWinInfo *pInfo) if ( pImp->bSplitable ) { -// pImp->bAutoHide = ( pInfo->nFlags & SFX_CHILDWIN_AUTOHIDE) != 0; pImp->pSplitWin = pWorkWin->GetSplitWindow_Impl(GetAlignment()); pImp->pSplitWin->InsertWindow(this, pImp->aSplitSize); } @@ -1198,7 +1178,6 @@ void SfxDockingWindow::Initialize_Impl() { if ( !pMgr ) { - // Bugfix #39771 pImp->bConstructed = sal_True; return; } @@ -1908,8 +1887,6 @@ long SfxDockingWindow::Notify( NotifyEvent& rEvt ) sal_uInt16 SfxDockingWindow::GetWinBits_Impl() const { sal_uInt16 nBits = 0; -// if ( pImp->bAutoHide ) -// nBits |= SWIB_AUTOHIDE; return nBits; } @@ -1971,14 +1948,6 @@ void SfxDockingWindow::AutoShow_Impl( sal_Bool bShow ) } } -/* -void SfxDockingWindow::Pin_Impl( sal_Bool bPinned ) -{ - if ( pImp->pSplitWin ) - pImp->pSplitWin->Pin_Impl( bPinned ); -} -*/ - SfxSplitWindow* SfxDockingWindow::GetSplitWindow_Impl() const { return pImp->pSplitWin; @@ -2019,3 +1988,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 0f3b35648061..f90cb9116fe6 100644..100755 --- 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,13 +315,12 @@ void FileDialogHelper_Impl::handleDialogSizeChanged() // ------------------------------------------------------------------------ void SAL_CALL FileDialogHelper_Impl::disposing( const EventObject& ) throw ( RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; dispose(); } // ------------------------------------------------------------------------ -// ------------------------------------------------------------------------ -// ------------------------------------------------------------------------ + void FileDialogHelper_Impl::dispose() { if ( mxFileDlg.is() ) @@ -407,7 +407,7 @@ sal_Bool FileDialogHelper_Impl::updateExtendedControl( sal_Int16 _nExtendedContr } catch( const IllegalArgumentException& ) { - DBG_ERROR( "FileDialogHelper_Impl::updateExtendedControl: caught an exception!" ); + OSL_FAIL( "FileDialogHelper_Impl::updateExtendedControl: caught an exception!" ); } } return bIsEnabled; @@ -530,7 +530,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; @@ -608,7 +608,6 @@ void FileDialogHelper_Impl::updatePreviewState( sal_Bool _bUpdatePreviewWindow ) { mbShowPreview = bShowPreview; - // #97633 // setShowState has currently no effect for the // OpenOffice FilePicker (see svtools/source/filepicker/iodlg.cxx) uno::Reference< XFilePreview > xFilePreview( mxFileDlg, UNO_QUERY ); @@ -657,18 +656,6 @@ void FileDialogHelper_Impl::updateVersions() for ( sal_Int32 i=0; i<xVersions.getLength(); i++ ) aEntries[ i + 1 ] = xVersions[i].Identifier; - - // TODO/LATER: not sure that this information must be shown in future ( binfilter? ) -//REMOVE else -//REMOVE { -//REMOVE SfxFilterFlags nMust = SFX_FILTER_IMPORT | SFX_FILTER_OWN; -//REMOVE SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED | SFX_FILTER_STARONEFILTER; -//REMOVE if ( SFX_APP()->GetFilterMatcher().GetFilter4ClipBoardId( pStor->GetFormat(), nMust, nDont ) ) -//REMOVE { -//REMOVE aEntries.realloc( 1 ); -//REMOVE aEntries[0] = OUString( String ( SfxResId( STR_SFX_FILEDLG_ACTUALVERSION ) ) ); -//REMOVE } -//REMOVE } } catch( uno::Exception& ) { @@ -706,22 +693,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 ) @@ -743,7 +714,6 @@ IMPL_LINK( FileDialogHelper_Impl, TimeOutHdl_Impl, Timer*, EMPTYARG ) if ( ERRCODE_NONE == getGraphic( aURL, maGraphic ) ) { - // #89491 // changed the code slightly; // before: the bitmap was scaled and // surrounded a white frame @@ -768,7 +738,7 @@ IMPL_LINK( FileDialogHelper_Impl, TimeOutHdl_Impl, Timer*, EMPTYARG ) else aBmp.Scale( nYRatio, nYRatio ); - // #94505# Convert to true color, to allow CopyPixel + // Convert to true color, to allow CopyPixel aBmp.Convert( BMP_CONVERSION_24BIT ); // and copy it into the Any @@ -786,7 +756,7 @@ IMPL_LINK( FileDialogHelper_Impl, TimeOutHdl_Impl, Timer*, EMPTYARG ) try { - OReleaseSolarMutex aReleaseForCallback; + SolarMutexReleaser aReleaseForCallback; // clear the preview window xFilePicker->setImage( FilePreviewImageFormats::BITMAP, aAny ); } @@ -1059,9 +1029,6 @@ FileDialogHelper_Impl::FileDialogHelper_Impl( break; } - - - //Sequence < Any > aInitArguments( mbSystemPicker || !mpPreferredParentWindow ? 1 : 3 ); Sequence < Any > aInitArguments( !mpPreferredParentWindow ? 3 : 4 ); // This is a hack. We currently know that the internal file picker implementation @@ -1098,8 +1065,6 @@ FileDialogHelper_Impl::FileDialogHelper_Impl( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ParentWindow" ) ), makeAny( VCLUnoHelper::GetInterface( mpPreferredParentWindow ) ) ); - - } try @@ -1108,7 +1073,7 @@ FileDialogHelper_Impl::FileDialogHelper_Impl( } catch( const Exception& ) { - DBG_ERROR( "FileDialogHelper_Impl::FileDialogHelper_Impl: could not initialize the picker!" ); + OSL_FAIL( "FileDialogHelper_Impl::FileDialogHelper_Impl: could not initialize the picker!" ); } } @@ -1171,10 +1136,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 +1147,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() @@ -1230,7 +1195,7 @@ void FileDialogHelper_Impl::setControlHelpIds( const sal_Int16* _pControlId, con } catch( const Exception& ) { - DBG_ERROR( "FileDialogHelper_Impl::setControlHelpIds: caught an exception while setting the help ids!" ); + OSL_FAIL( "FileDialogHelper_Impl::setControlHelpIds: caught an exception while setting the help ids!" ); } } @@ -1254,7 +1219,6 @@ void FileDialogHelper_Impl::preExecute() updatePreviewState( sal_False ); implInitializeFileName( ); - // #106079# / 2002-12-09 / fs@openoffice.org #if !(defined(MACOSX) && defined(QUARTZ)) && !defined(WNT) // allow for dialog implementations which need to be executed before they return valid values for @@ -1289,7 +1253,6 @@ void FileDialogHelper_Impl::implInitializeFileName( ) // in case we're operating as save dialog, and "auto extension" is checked, // cut the extension from the name - // #106079# / 2002-12-09 / fs@openoffice.org if ( mbIsSaveDlg && mbHasAutoExt ) { try @@ -1312,7 +1275,7 @@ void FileDialogHelper_Impl::implInitializeFileName( ) } catch( const Exception& ) { - DBG_ERROR( "FileDialogHelper_Impl::implInitializeFileName: could not ask for the auto-extension current-value!" ); + OSL_FAIL( "FileDialogHelper_Impl::implInitializeFileName: could not ask for the auto-extension current-value!" ); } } } @@ -1328,28 +1291,14 @@ sal_Int16 FileDialogHelper_Impl::implDoExecute() //On MacOSX the native file picker has to run in the primordial thread because of drawing issues //On Linux the native gtk file picker, when backed by gnome-vfs2, needs to be run in the same //primordial thread as the ucb gnome-vfs2 provider was initialized in. -/* -#ifdef WNT - if ( mbSystemPicker ) - { - PickerThread_Impl* pThread = new PickerThread_Impl( mxFileDlg ); - pThread->create(); - while ( pThread->GetReturnValue() == nMagic ) - Application::Yield(); - pThread->join(); - nRet = pThread->GetReturnValue(); - delete pThread; - } - else -#endif -*/ + { try { #ifdef WNT if ( mbSystemPicker ) { - OReleaseSolarMutex aSolarMutex; + SolarMutexReleaser aSolarMutex; nRet = mxFileDlg->execute(); } else @@ -1397,35 +1346,7 @@ String FileDialogHelper_Impl::implEnsureURLExtension(const String& sURL, const String& /*sExtension*/) { return sURL; - /* - // This feature must be active for file save/export only ! - if ( - (! mbIsSaveDlg) && - (! mbExport ) - ) - return sURL; - - // no extension available (because "ALL *.*" was selected) ? - // Nod idea what else should happen here .-) - if (sExtension.Len() < 1) - return sURL; - - // Some FilePicker implementations already add the right extension ... - // or might be the user used the right one already ... - // Dont create duplicate extension. - INetURLObject aURL(sURL); - if (aURL.getExtension().equals(sExtension)) - return sURL; - - // Ignore any other extension set by the user. - // Make sure suitable extension is used always. - // e.g. "test.bla.odt" for "ODT" - ::rtl::OUStringBuffer sNewURL(256); - sNewURL.append (sURL ); - sNewURL.appendAscii("." ); - sNewURL.append (sExtension); - return sNewURL.makeStringAndClear(); - */ + } // ------------------------------------------------------------------------ @@ -1577,7 +1498,7 @@ ErrCode FileDialogHelper_Impl::execute( SvStringsDtor*& rpURLList, } catch( IllegalArgumentException ) { - DBG_ERROR( "FileDialogHelper_Impl::execute: caught an IllegalArgumentException!" ); + OSL_FAIL( "FileDialogHelper_Impl::execute: caught an IllegalArgumentException!" ); } } @@ -1598,7 +1519,7 @@ ErrCode FileDialogHelper_Impl::execute( SvStringsDtor*& rpURLList, } catch( IllegalArgumentException ) { - DBG_ERROR( "FileDialogHelper_Impl::execute: caught an IllegalArgumentException!" ); + OSL_FAIL( "FileDialogHelper_Impl::execute: caught an IllegalArgumentException!" ); } } } @@ -1636,7 +1557,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() ) { @@ -1777,12 +1698,6 @@ void FileDialogHelper_Impl::displayFolder( const ::rtl::OUString& _rPath ) // nothing to do return; - /* - if ( !::utl::UCBContentHelper::IsFolder( _rPath ) ) - // only valid folders accepted here - return; - */ - maPath = _rPath; if ( mxFileDlg.is() ) { @@ -1792,7 +1707,7 @@ void FileDialogHelper_Impl::displayFolder( const ::rtl::OUString& _rPath ) } catch( const IllegalArgumentException& ) { - DBG_ERROR( "FileDialogHelper_Impl::displayFolder: caught an exception!" ); + OSL_FAIL( "FileDialogHelper_Impl::displayFolder: caught an exception!" ); } } } @@ -1809,7 +1724,7 @@ void FileDialogHelper_Impl::setFileName( const ::rtl::OUString& _rFile ) } catch( const IllegalArgumentException& ) { - DBG_ERROR( "FileDialogHelper_Impl::setFileName: caught an exception!" ); + OSL_FAIL( "FileDialogHelper_Impl::setFileName: caught an exception!" ); } } } @@ -1874,7 +1789,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 +1964,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 +2104,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() ) @@ -2299,11 +2202,8 @@ void FileDialogHelper_Impl::setDefaultValues() } catch( const Exception& ) { - DBG_ERROR( "FileDialogHelper_Impl::setDefaultValues: caught an exception while setting the display directory!" ); + OSL_FAIL( "FileDialogHelper_Impl::setDefaultValues: caught an exception while setting the display directory!" ); } - - // INetURLObject aStdDirObj( SvtPathOptions().GetWorkPath() ); - //SetStandardDir( aStdDirObj.GetMainURL( INetURLObject::NO_DECODE ) ); } } @@ -2351,24 +2251,6 @@ 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 ); if( pConfigId ) LoadLastUsedFilter( *pConfigId ); @@ -2765,7 +2647,7 @@ void FileDialogHelper::SetDisplayDirectory( const String& _rPath ) if ( sFolder.getLength() == 0 ) { // _rPath is not a valid path -> fallback to home directory - vos:: OSecurity aSecurity; + osl::Security aSecurity; aSecurity.getHomeDir( sFolder ); } mpImp->displayFolder( sFolder ); @@ -2919,3 +2801,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 61df13350510..eeee5d36aab7 100644..100755 --- 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 6c559139ddd2..0a76cb1eca67 100644..100755 --- 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 ab75d777c5ff..29e234c5500b 100644..100755 --- 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. @@ -223,7 +224,7 @@ namespace sfx2 if ( m_aClassReferrer.end() == aClassRef ) { // we do not know this global class - DBG_ERROR( "ReadGlobalFilter::operator(): unknown filter name!" ); + OSL_FAIL( "ReadGlobalFilter::operator(): unknown filter name!" ); // TODO: perhaps we should be more tolerant - at the moment, the filter is dropped // We could silently push_back it to the container .... } @@ -692,12 +693,6 @@ namespace sfx2 FilterGroupEntryReferrer::iterator aBelongsToLocal = aLocalClassesRef.find( sFilterName ); if ( aLocalClassesRef.end() != aBelongsToLocal ) { -/* -#ifdef DBG_UTIL - const ::rtl::OUString& rLocalClassDisplayName = aBelongsToLocal->second->First; - const ::rtl::OUString& rLocalClassExtension = aBelongsToLocal->second->Second; -#endif -*/ // okay, there is a local class which the filter belongs to // -> append the wildcard aExtendWildcard( *aBelongsToLocal ); @@ -919,7 +914,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 +962,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 +986,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 +1068,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 +1078,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 +1265,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 8075186614dd..5702362298fd 100644..100755 --- 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 637b89898a3a..8bfed93e4cba 100644..100755 --- 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 68fab9fed333..0cffdf5217ab 100644..100755 --- 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 6664e393ed5a..3433e74e2073 100644..100755 --- 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 ) { - sal_uIntPtr 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 ) { - sal_uIntPtr 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,59 +859,65 @@ 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; + 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 ); } Sequence< OUString > aAttachmentSeq(&(maAttachedDocuments[0]),maAttachedDocuments.size()); - xSimpleMailMessage->setSubject( maSubject ); + if ( xSimpleMailMessage->getSubject().getLength() == 0 ) { + OUString baseName( maAttachedDocuments[0].copy( maAttachedDocuments[0].lastIndexOf( '/' ) + 1 ) ); + OUString subject( baseName ); + if ( maAttachedDocuments.size() > 1 ) + subject += OUString(RTL_CONSTASCII_USTRINGPARAM(", ...")); + xSimpleMailMessage->setSubject( subject ); + } xSimpleMailMessage->setAttachement( aAttachmentSeq ); sal_Bool bSend( sal_False ); @@ -937,7 +937,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 +1027,5 @@ sal_Bool CreateFromAddress_Impl( String& rFrom ) rFrom.Erase(); return ( rFrom.Len() > 0 ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/mailwindow.src b/sfx2/source/dialog/mailwindow.src index e5648e7f414f..e5648e7f414f 100644..100755 --- a/sfx2/source/dialog/mailwindow.src +++ b/sfx2/source/dialog/mailwindow.src diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx index 5cac88236f4a..3f4ea4ddad16 100644..100755 --- 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. @@ -29,16 +30,11 @@ #include "precompiled_sfx2.hxx" // include --------------------------------------------------------------- - -#ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> -#endif #include <vcl/field.hxx> #include <svl/eitem.hxx> #include <svl/intitem.hxx> #include <svl/style.hxx> -#ifndef GCC -#endif #include <sfx2/styfitem.hxx> #include <sfx2/styledlg.hxx> @@ -53,9 +49,7 @@ #include "dialog.hrc" #include "mgetempl.hrc" -#ifndef _SFX_STYLE_HRC #include <svl/style.hrc> -#endif // SfxManageStyleSheetPage ----------------------------------------------- @@ -91,9 +85,7 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage( Window* pParent, const SfxItem nFlags ( pStyle->GetMask() ) /* [Beschreibung] - Konstruktor; initialisiert die ListBoxen mit den Vorlagen - */ { @@ -208,24 +200,23 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage( Window* pParent, const SfxItem aBaseFt.Disable(); aBaseLb.Disable(); } - sal_uInt16 nCount = pFamilies->Count(); - sal_uInt16 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; } - sal_uInt16 nStyleFilterIdx = 0xffff; - if ( i < nCount ) { + sal_uInt16 nStyleFilterIdx = 0xffff; // Filterflags const SfxStyleFilter& rList = pItem->GetFilterList(); - nCount = (sal_uInt16)rList.Count(); + nCount = rList.size(); sal_uInt16 nIdx = 0; sal_uInt16 nMask = pStyle->GetMask() & ~SFXSTYLEBIT_USERDEF; @@ -234,11 +225,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 ); @@ -286,9 +276,7 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage( Window* pParent, const SfxItem SfxManageStyleSheetPage::~SfxManageStyleSheetPage() /* [Beschreibung] - Destruktor; Freigabe der Daten - */ { @@ -306,16 +294,13 @@ void SfxManageStyleSheetPage::UpdateName_Impl( ListBox* pBox, const String& rNew ) /* [Beschreibung] - Nach der "Anderung eines Vorlagennamens die ListBox pBox aktualisieren [Parameter] - ListBox* pBox ListBox, deren Eintr"age aktualisiert werden sollen const String& rNew der neue Name - */ { @@ -336,13 +321,11 @@ void SfxManageStyleSheetPage::UpdateName_Impl( ListBox* pBox, void SfxManageStyleSheetPage::SetDescriptionText_Impl() /* [Beschreibung] - Attributbeschreibung setzen. daf"ur die eingestellte Metrik besorgen. */ { SfxMapUnit eUnit = SFX_MAPUNIT_CM; -// FieldUnit eFieldUnit = pSfxApp->GetOptions().GetMetric(); FieldUnit eFieldUnit( FUNIT_CM ); SfxModule* pModule = SfxModule::GetActiveModule(); if ( pModule ) @@ -355,14 +338,11 @@ void SfxManageStyleSheetPage::SetDescriptionText_Impl() switch ( eFieldUnit ) { case FUNIT_MM: eUnit = SFX_MAPUNIT_MM; break; - case FUNIT_CM: case FUNIT_M: case FUNIT_KM: eUnit = SFX_MAPUNIT_CM; break; - case FUNIT_POINT: case FUNIT_PICA: eUnit = SFX_MAPUNIT_POINT; break; - case FUNIT_INCH: case FUNIT_FOOT: case FUNIT_MILE: eUnit = SFX_MAPUNIT_INCH; break; @@ -378,9 +358,7 @@ void SfxManageStyleSheetPage::SetDescriptionText_Impl() IMPL_LINK_INLINE_START( SfxManageStyleSheetPage, GetFocusHdl, Edit *, pEdit ) /* [Beschreibung] - StarView Handler; GetFocus-Handler des Edits mit dem Vorlagennamen. - */ { @@ -417,27 +395,20 @@ IMPL_LINK_INLINE_END( SfxManageStyleSheetPage, LoseFocusHdl, Edit *, pEdit ) sal_Bool SfxManageStyleSheetPage::FillItemSet( SfxItemSet& rSet ) /* [Beschreibung] - - Handler f"ur das Setzen der (modifizierten) Daten. Wird aus dem Ok des SfxTabDialog gerufen. [Parameter] - SfxItemSet &rAttrSet das Set, das die Daten entgegennimmt. - [R"uckgabewert] - sal_Bool sal_True: es hat eine "Anderung der Daten stattgefunden sal_False: es hat keine "Anderung der Daten stattgefunden [Querverweise] - <class SfxTabDialog> - */ { @@ -454,12 +425,9 @@ sal_Bool SfxManageStyleSheetPage::FillItemSet( SfxItemSet& rSet ) // geht nur bei Benutzervorlagen #if OSL_DEBUG_LEVEL > 1 sal_uInt16 nIdx = (sal_uInt16)(long)aFilterLb.GetEntryData( nFilterIdx ); - SfxFilterTupel* p; - p = pItem->GetFilterList().GetObject( nIdx ); + SfxFilterTupel* p = pItem->GetFilterList()[ nIdx ]; #endif - sal_uInt16 nMask = pItem->GetFilterList().GetObject( - (sal_uInt16)(long)aFilterLb.GetEntryData( nFilterIdx ) )->nFlags | - SFXSTYLEBIT_USERDEF; + sal_uInt16 nMask = pItem->GetFilterList()[ (size_t)aFilterLb.GetEntryData( nFilterIdx ) ]->nFlags | SFXSTYLEBIT_USERDEF; pStyle->SetMask( nMask ); } if(aAutoCB.IsVisible() && @@ -476,19 +444,13 @@ sal_Bool SfxManageStyleSheetPage::FillItemSet( SfxItemSet& rSet ) void SfxManageStyleSheetPage::Reset( const SfxItemSet& /*rAttrSet*/ ) /* [Beschreibung] - - Handler f"ur das Initialisieren der Seite mit den initialen Daten. [Parameter] - const SfxItemSet &rAttrSet das Set mit den Daten - [Querverweise] - <class SfxTabDialog> - */ { @@ -548,12 +510,9 @@ SfxTabPage* SfxManageStyleSheetPage::Create( Window* pParent, const SfxItemSet &rAttrSet ) /* [Beschreibung] - - Factory f"ur das Erzeugen der Seite [Querverweise] - <class SfxTabDialog> */ @@ -567,20 +526,16 @@ SfxTabPage* SfxManageStyleSheetPage::Create( Window* pParent, void SfxManageStyleSheetPage::ActivatePage( const SfxItemSet& rSet) /* [Beschreibung] - ActivatePage- Handler des SfxTabDialog; wird f"ur die Aktualisierung des beschreibenden Textes verwendet, da sich dieser durch "Anderungen der Daten anderer Seiten ge"andert haben kann. [Parameter] - const SfxItemSet& das Set f"ur den Datenaustausch; wird hier nicht verwendet. [Querverweise] - <SfxTabDialog::ActivatePage(const SfxItemSet &)> - */ { @@ -600,20 +555,16 @@ void SfxManageStyleSheetPage::ActivatePage( const SfxItemSet& rSet) int SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet ) /* [Beschreibung] - DeactivatePage- Handler des SfxTabDialog; die Daten werden an der Vorlage eingestellt, damit die richtige Vererbung f"ur die anderen Seiten des Dialoges vorliegt. Im Fehlerfall wird das Verlassen der Seite unterbunden. [Parameter] - SfxItemSet* das Set f"ur den Datenaustausch; wird hier nicht verwendet. [Querverweise] - <SfxTabDialog::DeactivatePage(SfxItemSet*)> - */ { @@ -680,3 +631,4 @@ int SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet ) return nRet; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/mgetempl.hrc b/sfx2/source/dialog/mgetempl.hrc index a34700846f9c..a34700846f9c 100644..100755 --- a/sfx2/source/dialog/mgetempl.hrc +++ b/sfx2/source/dialog/mgetempl.hrc diff --git a/sfx2/source/dialog/mgetempl.src b/sfx2/source/dialog/mgetempl.src index c478ed715646..9d359813b82a 100644..100755 --- a/sfx2/source/dialog/mgetempl.src +++ b/sfx2/source/dialog/mgetempl.src @@ -84,8 +84,6 @@ TabPage TP_MANAGE_STYLES { Pos = MAP_APPFONT ( 6 , 44 ) ; Size = MAP_APPFONT ( 61 , 10 ) ; - /* ### ACHTUNG: Neuer Text in Resource? ~Verknüpft mit : ~Verkn³pft mit */ - /* ### ACHTUNG: Neuer Text in Resource? ~Verknüpft mit : ~Verkn³pft mit */ Text [ en-US ] = "Linked with" ; }; ListBox LB_BASE diff --git a/sfx2/source/dialog/navigat.cxx b/sfx2/source/dialog/navigat.cxx index fbfabe632009..4839b3f88639 100644..100755 --- 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 @@ sal_Bool SfxNavigator::Close() return sal_False; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/newstyle.cxx b/sfx2/source/dialog/newstyle.cxx index 17bbee8c126f..0984e8c62010 100644..100755 --- 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. @@ -30,8 +31,6 @@ // INCLUDE --------------------------------------------------------------- #include <svl/style.hxx> -#ifndef GCC -#endif #include <sfx2/newstyle.hxx> #include "dialog.hrc" @@ -103,7 +102,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/newstyle.hrc b/sfx2/source/dialog/newstyle.hrc index 0efc04869ba9..0efc04869ba9 100644..100755 --- a/sfx2/source/dialog/newstyle.hrc +++ b/sfx2/source/dialog/newstyle.hrc diff --git a/sfx2/source/dialog/newstyle.src b/sfx2/source/dialog/newstyle.src index b5954028779b..b5954028779b 100644..100755 --- a/sfx2/source/dialog/newstyle.src +++ b/sfx2/source/dialog/newstyle.src diff --git a/sfx2/source/dialog/partwnd.cxx b/sfx2/source/dialog/partwnd.cxx index cb082987a3e1..ee98f4c26970 100644..100755 --- 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> @@ -96,37 +95,9 @@ SfxPartChildWnd_Impl::~SfxPartChildWnd_Impl() // and we need a valid pMgr for further operations ... SfxPartDockWnd_Impl* pWin = (SfxPartDockWnd_Impl*) pWindow; -// if( pWin != NULL && !xFrame.is() ) -// pWin->ReleaseChildWindow_Impl(); -/* - // Release frame and window. - // If frame reference is valid here ... start dieing from inside by calling dispose(). - SetFrame( NULL ); - pWindow = NULL; -*/ + if ( pWin && xFrame == pWin->GetBindings().GetActiveFrame() ) pWin->GetBindings().SetActiveFrame( NULL ); -/* - if( xFrame.is() ) - { - try - { - ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > xCloseable ( xFrame, ::com::sun::star::uno::UNO_QUERY ); - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > xDisposeable( xFrame, ::com::sun::star::uno::UNO_QUERY ); - if (xCloseable.is()) - xCloseable->close(sal_True); - else - if (xDisposeable.is()) - xDisposeable->dispose(); - } - catch( ::com::sun::star::util::CloseVetoException& ) - { - } - catch( ::com::sun::star::lang::DisposedException& ) - { - } - } - */ } sal_Bool SfxPartChildWnd_Impl::QueryClose() @@ -183,7 +154,7 @@ SfxPartDockWnd_Impl::SfxPartDockWnd_Impl xSupp->getFrames()->append( xFrame ); } else { - DBG_ERROR("Bindings without Dispatcher!"); + OSL_FAIL("Bindings without Dispatcher!"); } } @@ -255,3 +226,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 47af8e61d81b..d3da6de72887 100644..100755 --- 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" @@ -111,6 +110,8 @@ SfxPasswordDialog::SfxPasswordDialog( Window* pParent, const String* pGroupText maPasswordED ( this, SfxResId( ED_PASSWD_PASSWORD ) ), maConfirmFT ( this, SfxResId( FT_PASSWD_CONFIRM ) ), maConfirmED ( this, SfxResId( ED_PASSWD_CONFIRM ) ), + + maMinLengthFT ( this, SfxResId( FT_PASSWD_MINLEN ) ), maPassword2Box ( this, 0 ), maPassword2FT ( this, SfxResId( FT_PASSWD_PASSWORD2 ) ), maPassword2ED ( this, SfxResId( ED_PASSWD_PASSWORD2 ) ), @@ -120,7 +121,9 @@ SfxPasswordDialog::SfxPasswordDialog( Window* pParent, const String* pGroupText maCancelBtn ( this, SfxResId( BTN_PASSWD_CANCEL ) ), maHelpBtn ( this, SfxResId( BTN_PASSWD_HELP ) ), - mnMinLen ( 1 ), + maMinLenPwdStr ( SfxResId( STR_PASSWD_MIN_LEN ) ), + maEmptyPwdStr ( SfxResId( STR_PASSWD_EMPTY ) ), + maMainPwdStr ( ), mnExtras ( 0 ), mbAsciiOnly ( false ) @@ -187,6 +190,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(); + } } // ----------------------------------------------------------------------- @@ -194,6 +216,7 @@ SfxPasswordDialog::SfxPasswordDialog( Window* pParent, const String* pGroupText void SfxPasswordDialog::SetMinLen( sal_uInt16 nLen ) { mnMinLen = nLen; + SetPasswdText(); EditModifyHdl( NULL ); } @@ -226,6 +249,66 @@ short SfxPasswordDialog::Execute() maPasswordFT.Show(); if( (mnExtras & SHOWEXTRAS_USER ) ) { +#warning Inevitably this layout logic will be wrong post merge until we can see the dialog to test it. + Size a3Size = LogicToPixel( Size( 3, 3 ), MAP_APPFONT ); + Size a6Size = LogicToPixel( Size( 6, 6 ), MAP_APPFONT ); + long nMinHeight = maHelpBtn.GetPosPixel().Y() + + maHelpBtn.GetSizePixel().Height() + a6Size.Height(); + USHORT nRowHided = 1; + + if ( SHOWEXTRAS_NONE == mnExtras ) + { + maUserFT.Hide(); + maUserED.Hide(); + maConfirmFT.Hide(); + maConfirmED.Hide(); + maPasswordFT.Hide(); + + Point aPos = maUserFT.GetPosPixel(); + long nEnd = maUserED.GetPosPixel().X() + maUserED.GetSizePixel().Width(); + maPasswordED.SetPosPixel( aPos ); + Size aSize = maPasswordED.GetSizePixel(); + aSize.Width() = nEnd - aPos.X(); + maPasswordED.SetSizePixel( aSize ); + + nRowHided = 2; + } + else if ( SHOWEXTRAS_USER == mnExtras ) + { + maConfirmFT.Hide(); + maConfirmED.Hide(); + } + else if ( SHOWEXTRAS_CONFIRM == mnExtras ) + { + maUserFT.Hide(); + maUserED.Hide(); + + Point aPwdPos1 = maPasswordFT.GetPosPixel(); + Point aPwdPos2 = maPasswordED.GetPosPixel(); + + Point aPos = maUserFT.GetPosPixel(); + maPasswordFT.SetPosPixel( aPos ); + aPos = maUserED.GetPosPixel(); + maPasswordED.SetPosPixel( aPos ); + + aPos = maConfirmFT.GetPosPixel(); + maConfirmFT.SetPosPixel( aPwdPos1 ); + maConfirmED.SetPosPixel( aPwdPos2 ); + maMinLengthFT.SetPosPixel(aPos); + } + + Size aBoxSize = maPasswordBox.GetSizePixel(); + aBoxSize.Height() -= ( nRowHided * maUserED.GetSizePixel().Height() ); + aBoxSize.Height() -= ( nRowHided * a3Size.Height() ); + maPasswordBox.SetSizePixel( aBoxSize ); + + long nDlgHeight = maPasswordBox.GetPosPixel().Y() + aBoxSize.Height() + a6Size.Height(); + if ( nDlgHeight < nMinHeight ) + nDlgHeight = nMinHeight; + Size aDlgSize = GetOutputSizePixel(); + aDlgSize.Height() = nDlgHeight; + SetOutputSizePixel( aDlgSize ); + maUserFT.Show(); maUserED.Show(); } @@ -254,3 +337,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 dd35a6449dd8..8a82c853320e 100644..100755 --- 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 @@ -46,10 +47,11 @@ #define FT_PASSWD_CONFIRM2 27 #define ED_PASSWD_CONFIRM2 28 -//IAccessibility2 Implementation 2009----- -#define TEXT_PASSWD 31 -//-----IAccessibility2 Implementation 2009 -#endif +#define STR_PASSWD_CONFIRM 29 +#define STR_PASSWD_MIN_LEN 30 +#define STR_PASSWD_EMPTY 31 + +#define TEXT_PASSWD 32 -// ******************************************************************* EOF +#endif diff --git a/sfx2/source/dialog/passwd.src b/sfx2/source/dialog/passwd.src index beb2f96a5e21..cca8814d1526 100644..100755 --- 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 e6182880b963..bec9a5760c5c 100644..100755 --- 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 sal_uInt16 aDPIArray[] = { 72, 96, 150, 200, 300, 600 }; static sal_Bool bOutputForPrinter = sal_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 ); } -// ----------------------------------------------------------------------------- - sal_Bool SfxCommonPrintOptionsTabPage::FillItemSet( SfxItemSet& /*rSet*/ ) { SvtPrintWarningOptions aWarnOptions; @@ -187,8 +167,6 @@ sal_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( (sal_uInt16) aReduceBitmapsResolutionLB.GetSelectEntryPos(), - (sal_uInt16)( sizeof( aDPIArray ) / sizeof( aDPIArray[ 0 ] ) - 1 ) ) ] ); + (sal_uInt16)( 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 = sal_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 = sal_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/printopt.hrc b/sfx2/source/dialog/printopt.hrc index 38c766c9f56a..38c766c9f56a 100644..100755 --- a/sfx2/source/dialog/printopt.hrc +++ b/sfx2/source/dialog/printopt.hrc diff --git a/sfx2/source/dialog/printopt.src b/sfx2/source/dialog/printopt.src index 01650f3e9275..01650f3e9275 100644..100755 --- a/sfx2/source/dialog/printopt.src +++ b/sfx2/source/dialog/printopt.src diff --git a/sfx2/source/dialog/recfloat.cxx b/sfx2/source/dialog/recfloat.cxx index 7b24a3862811..2fac778744d7 100644..100755 --- 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 d71270d1e312..47e4803c1b5b 100644..100755 --- 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/securitypage.cxx b/sfx2/source/dialog/securitypage.cxx index abad2c341c01..535a74625fc3 100644..100755 --- a/sfx2/source/dialog/securitypage.cxx +++ b/sfx2/source/dialog/securitypage.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. @@ -61,22 +62,6 @@ namespace enum RedliningMode { RL_NONE, RL_WRITER, RL_CALC }; enum RedlineFunc { RF_ON, RF_PROTECT }; -/* - bool QueryIsEnabled( sal_uInt16 _nSlot ) - { - bool bRes = false; - SfxViewShell* pViewSh = SfxViewShell::Current(); - if (pViewSh) - { - const SfxPoolItem* pItem; - SfxDispatcher* pDisp = pViewSh->GetDispatcher(); - SfxItemState eState = pDisp->QueryState( _nSlot, pItem ); - bRes = (eState & SFX_ITEM_DISABLED) == 0; - } - return bRes; - } -*/ - bool QueryState( sal_uInt16 _nSlot, bool& _rValue ) { bool bRet = false; @@ -118,10 +103,8 @@ namespace } } - ////////////////////////////////////////////////////////////////////// - static short lcl_GetPassword( Window *pParent, bool bProtect, @@ -129,8 +112,6 @@ static short lcl_GetPassword( { bool bRes = false; SfxPasswordDialog aPasswdDlg( pParent ); - const String aTitle( SfxResId( bProtect ? RID_SFX_PROTECT_RECORDS : RID_SFX_UNPROTECT_RECORDS ) ); - aPasswdDlg.SetText( aTitle ); aPasswdDlg.SetMinLen( 1 ); if (bProtect) aPasswdDlg.ShowExtras( SHOWEXTRAS_CONFIRM ); @@ -162,10 +143,8 @@ static bool lcl_IsPasswordCorrect( const String &rPassword ) return bRes; } - ////////////////////////////////////////////////////////////////////// - struct SfxSecurityPage_Impl { SfxSecurityPage & m_rMyTabPage; @@ -497,8 +476,6 @@ IMPL_LINK( SfxSecurityPage_Impl, ChangeProtectionPBHdl, void*, EMPTYARG ) m_bNewPasswordIsValid = true; m_aNewPassword = bNewProtection? aPasswordText : String(); -// // RecordChangesCB is enabled if protection is off -// m_aRecordChangesCB.Enable( !bNewProtection ); m_aRecordChangesCB.Check( bNewProtection ); // toggle text of button "Protect" <-> "Unprotect" m_aChangeProtectionPB.SetText( bNewProtection ? m_aUnProtectSTR : m_aProtectSTR ); @@ -506,10 +483,8 @@ IMPL_LINK( SfxSecurityPage_Impl, ChangeProtectionPBHdl, void*, EMPTYARG ) return 0; } - ////////////////////////////////////////////////////////////////////// - SfxTabPage* SfxSecurityPage::Create( Window * pParent, const SfxItemSet & rItemSet ) { return new SfxSecurityPage( pParent, rItemSet ); @@ -547,7 +522,6 @@ void SfxSecurityPage::Reset( const SfxItemSet & rItemSet ) m_pImpl->Reset_Impl( rItemSet ); } - ////////////////////////////////////////////////////////////////////// - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/securitypage.src b/sfx2/source/dialog/securitypage.src index fee60404d01c..87cc2e1af8d8 100755 --- a/sfx2/source/dialog/securitypage.src +++ b/sfx2/source/dialog/securitypage.src @@ -159,14 +159,6 @@ TabPage TP_DOCINFOSECURITY }; }; -String RID_SFX_PROTECT_RECORDS -{ - Text [ en-US ] = "Protect Records" ; -}; -String RID_SFX_UNPROTECT_RECORDS -{ - Text [ en-US ] = "Unprotect Records" ; -}; String RID_SFX_INCORRECT_PASSWORD { Text [ en-US ] = "Incorrect password" ; diff --git a/sfx2/source/dialog/sfxdlg.cxx b/sfx2/source/dialog/sfxdlg.cxx index becab5097ec3..76010410b898 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,5 @@ SfxAbstractDialogFactory* SfxAbstractDialogFactory::Create() SfxAbstractDialogFactory::~SfxAbstractDialogFactory() { } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/splitwin.cxx b/sfx2/source/dialog/splitwin.cxx index 2eb332f9d5d9..58535f062b3a 100644..100755 --- 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. @@ -29,18 +30,13 @@ #include "precompiled_sfx2.hxx" #ifdef SOLARIS -// HACK: prevent conflict between STLPORT and Workshop headers on Solaris 8 #include <ctime> #endif -#include <string> // HACK: prevent conflict between STLPORT and Workshop headers +#include <string> -#ifndef _WRKWIN_HXX //autogen #include <vcl/wrkwin.hxx> -#endif #include <unotools/viewoptions.hxx> -#ifndef GCC -#endif #include <vcl/timer.hxx> @@ -60,7 +56,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 { @@ -106,7 +102,6 @@ friend class SfxSplitWindow; aTimer.SetTimeoutHdl( LINK(pOwner, SfxSplitWindow, TimerHdl ) ); aTimer.SetTimeout( 200 ); -// EnableDrop( sal_True ); SetAlign( pOwner->GetAlign() ); Actualize(); ShowAutoHideButton( pOwner->IsAutoHideButtonVisible() ); @@ -255,7 +250,6 @@ SfxSplitWindow::SfxSplitWindow( Window* pParent, SfxChildAlignment eAl, pEmptyWin->nState = (sal_uInt16) aWinData.GetToken( 1, ',' ).ToInt32(); if ( pEmptyWin->nState & 2 ) pEmptyWin->bFadeIn = sal_True; - //bPinned = !( pEmptyWin->nState & 1 ); bPinned = sal_True; // always assume pinned - floating mode not used anymore sal_uInt16 i=2; @@ -582,12 +576,6 @@ void SfxSplitWindow::MoveWindow( SfxDockingWindow* pDockWin, const Size& rSize, // alles eine Zeile nach vorne! nLine--; } -/* - else if ( nLine == nL && nPos > nP ) - { - nPos--; - } -*/ RemoveWindow( pDockWin ); InsertWindow( pDockWin, rSize, nLine, nPos, bNewLine ); } @@ -618,6 +606,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. sal_uInt16 nCount = pDockArr->Count(); + USHORT nLastWindowIdx(0); // Wenn gar kein Fenster gefunden wird, wird als erstes eingef"ugt sal_uInt16 nInsertPos = 0; @@ -631,6 +620,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; sal_uInt16 nL=0, nP=0; GetWindowPos( pD->pWin, nL, nP ); @@ -646,11 +636,15 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize pDock->bNewLine = sal_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 ); @@ -1236,13 +1230,7 @@ void SfxSplitWindow::Show_Impl() pDock->pWin->FadeIn( pEmptyWin->bFadeIn ); } } -/* -void SfxSplitWindow::Pin_Impl( sal_Bool bPin ) -{ - if ( bPinned != bPin ) - AutoHide(); -} -*/ + sal_Bool SfxSplitWindow::ActivateNextChild_Impl( sal_Bool bForward ) { // Wenn kein pActive, auf erstes bzw. letztes Fenster gehen ( bei !bForward wird erst in der loop dekrementiert ) @@ -1302,3 +1290,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 ff3cd08b01c8..c385bad34df3 100644..100755 --- 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/srchdlg.hrc b/sfx2/source/dialog/srchdlg.hrc index 55fe9ce47d26..55fe9ce47d26 100644..100755 --- a/sfx2/source/dialog/srchdlg.hrc +++ b/sfx2/source/dialog/srchdlg.hrc diff --git a/sfx2/source/dialog/srchdlg.src b/sfx2/source/dialog/srchdlg.src index d1cee69e9157..d1cee69e9157 100644..100755 --- a/sfx2/source/dialog/srchdlg.src +++ b/sfx2/source/dialog/srchdlg.src diff --git a/sfx2/source/dialog/styfitem.cxx b/sfx2/source/dialog/styfitem.cxx index ba6fac0fdee8..74008de1ff51 100644..100755 --- 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 = (sal_uInt16)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( sal_False ) ), - aEntryList( 4, 1 ) + Resource( rResId.SetRT( RSC_SFX_STYLE_FAMILIES ).SetAutoRelease( false ) ) { sal_uIntPtr nCount = ReadLongRes(); for( sal_uIntPtr 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 1a155458995f..d9ea1321adf1 100644..100755 --- 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. @@ -31,11 +32,7 @@ // include --------------------------------------------------------------- #include <svl/whiter.hxx> #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 +171,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 35a5fb766b97..8a10a84137b7 100644..100755 --- 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,14 +120,14 @@ SfxTabDialogItem::SfxTabDialogItem( sal_uInt16 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*/, sal_uInt16 /*nVersion*/) const +SfxPoolItem* SfxTabDialogItem::Create(SvStream& /*rStream*/, sal_uInt16 /*nVersion*/) const { - DBG_ERROR( "Use it only in UI!" ); + OSL_FAIL( "Use it only in UI!" ); return NULL; } @@ -368,11 +369,6 @@ void SfxTabPage::FillUserData() // ----------------------------------------------------------------------- sal_Bool SfxTabPage::IsReadOnly() const - -/* [Description] - -*/ - { return sal_False; } @@ -392,11 +388,7 @@ const SfxPoolItem* SfxTabPage::GetItem( const SfxItemSet& rSet, sal_uInt16 nSlot const SfxItemPool* pPool = rSet.GetPool(); sal_uInt16 nWh = pPool->GetWhich( nSlot, bDeep ); const SfxPoolItem* pItem = 0; -#ifdef DEBUG - SfxItemState eState; - eState = -#endif - rSet.GetItemState( nWh, sal_True, &pItem ); // -Wall required?? + rSet.GetItemState( nWh, TRUE, &pItem ); if ( !pItem && nWh != nSlot ) pItem = &pPool->GetDefaultItem( nWh ); @@ -448,12 +440,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 +} // ----------------------------------------------------------------------- @@ -1059,11 +1050,6 @@ SfxTabPage* SfxTabDialog::GetTabPage( sal_uInt16 nPageId ) const // ----------------------------------------------------------------------- sal_Bool SfxTabDialog::IsInOK() const - -/* [Beschreibung] - -*/ - { return pImpl->bInOK; } @@ -1530,8 +1516,6 @@ IMPL_LINK( SfxTabDialog, DeactivatePageHdl, TabControl *, pTabCtrl ) nRet = pPage->DeactivatePage( &aTmp ); else nRet = pPage->DeactivatePage( NULL ); -//! else -//! pPage->FillItemSet( aTmp ); if ( ( SfxTabPage::LEAVE_PAGE & nRet ) == SfxTabPage::LEAVE_PAGE && aTmp.Count() ) @@ -1609,7 +1593,6 @@ const SfxItemSet* SfxTabDialog::GetOutputItemSet if ( pDataObject->bOnDemand ) return &pDataObject->pTabPage->GetItemSet(); - // else return pOutSet; } return NULL; @@ -1730,25 +1713,6 @@ const sal_uInt16* SfxTabDialog::GetInputRanges( const SfxItemPool& rPool ) qsort( (void*)aUS.GetData(), aUS.Count(), sizeof(sal_uInt16), TabDlgCmpUS_Impl ); - // Ranges erzeugen - //!! Auskommentiert, da fehlerhaft - /* - pRanges = new sal_uInt16[aUS.Count() * 2 + 1]; - int j = 0; - i = 0; - - while ( i < aUS.Count() ) - { - pRanges[j++] = aUS[i]; - // aufeinanderfolgende Zahlen - for( ; i < aUS.Count()-1; ++i ) - if ( aUS[i] + 1 != aUS[i+1] ) - break; - pRanges[j++] = aUS[i++]; - } - pRanges[j] = 0; // terminierende NULL - */ - pRanges = new sal_uInt16[aUS.Count() + 1]; memcpy(pRanges, aUS.GetData(), sizeof(sal_uInt16) * aUS.Count()); pRanges[aUS.Count()] = 0; @@ -1801,3 +1765,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.cxx b/sfx2/source/dialog/taskpane.cxx index 8974363a02d1..4d88ad76a500 100644..100755 --- a/sfx2/source/dialog/taskpane.cxx +++ b/sfx2/source/dialog/taskpane.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. * @@ -184,8 +185,7 @@ namespace sfx2 aCommandName.append( sImageURL.copy( nCommandImagePrefixLen ) ); const ::rtl::OUString sCommandName( aCommandName.makeStringAndClear() ); - const sal_Bool bHiContrast( Application::GetSettings().GetStyleSettings().GetHighContrastMode() ); - const Image aPanelImage( GetImage( i_rDocFrame, sCommandName, sal_False, bHiContrast ) ); + const Image aPanelImage( GetImage( i_rDocFrame, sCommandName, FALSE ) ); return aPanelImage.GetXGraphic(); } @@ -1297,3 +1297,5 @@ namespace sfx2 //...................................................................................................................... } // namespace sfx2 //...................................................................................................................... + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/taskpane.src b/sfx2/source/dialog/taskpane.src index 5a955e8587d1..5a955e8587d1 100644..100755 --- a/sfx2/source/dialog/taskpane.src +++ b/sfx2/source/dialog/taskpane.src diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index d8ea47baf32d..5e1f75571127 100644..100755 --- 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,14 +29,10 @@ // 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> #include <svl/stritem.hxx> #include <svl/style.hxx> -#ifndef GCC -#endif #define _SVSTDARR_STRINGSDTOR #include <svl/svstdarr.hxx> @@ -79,6 +76,7 @@ #include <sfx2/viewfrm.hxx> #include <comphelper/configurationhelper.hxx> +#include <comphelper/string.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::beans; @@ -102,6 +100,13 @@ static sal_uInt16 nLastItemId = USHRT_MAX; // filter box has maximum 12 entries visible #define MAX_FILTER_ENTRIES 12 +// Special constant to save hierarchical mode +// We've to use this hack since this is not the +// index in the filter listbox that is saved but the +// index in the filters list and hierarchical is not +// in it +#define HIERARCHICAL_FILTER_INDEX 0xfffe // 0xffff is reserved + //========================================================================= TYPEINIT0(SfxCommonTemplateDialog_Impl); @@ -263,9 +268,6 @@ sal_Int8 DropListBox_Impl::AcceptDrop( const AcceptDropEvent& rEvt ) sal_Int8 DropListBox_Impl::ExecuteDrop( const ExecuteDropEvent& rEvt ) { -// rEvt.maDropEvent.Context->acceptDrop( DND_ACTION_NONE ); -// rEvt.maDropEvent.Context->dropComplete( sal_True ); - sal_Int8 nRet = DND_ACTION_NONE; SfxObjectShell* pDocShell = pDialog->GetObjectShell(); TransferableDataHelper aHelper( rEvt.maDropEvent.Transferable ); @@ -377,7 +379,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( sal_False ); @@ -672,6 +674,11 @@ void StyleTree_Impl::Put(StyleTree_Impl* pIns, sal_uIntPtr lPos) StyleTreeArr_Impl &MakeTree_Impl(StyleTreeArr_Impl &rArr) { const sal_uInt16 nCount = rArr.Count(); + + comphelper::string::NaturalStringSorter aSorter( + ::comphelper::getProcessComponentContext(), + Application::GetSettings().GetLocale()); + // Alle unter ihren Parents einordnen sal_uInt16 i; for(i = 0; i < nCount; ++i) @@ -686,20 +693,16 @@ StyleTreeArr_Impl &MakeTree_Impl(StyleTreeArr_Impl &rArr) { // initial sortiert einfuegen sal_uInt16 ii; - IntlWrapper aIntlWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() ); - const CollatorWrapper* pCollator = aIntlWrapper.getCaseCollator(); - for ( ii = 0; - ii < pCmp->Count() && COMPARE_LESS == - pCollator->compareString( (*pCmp->pChilds)[ii]->aName, - pEntry->aName);++ii) ; - pCmp->Put(pEntry,ii); + for( nPos = 0 ; nPos < pCmp->Count() && + aSorter.compare((*pCmp->pChilds)[nPos]->aName, pEntry->aName) < 0 ; nPos++); + pCmp->Put(pEntry,nPos); break; } } } } - // alle, die schon unter ihrem Parent eingeordnet wurden - // entfernen + + // Keep only nodes with no parent in root array for(i = 0; i < rArr.Count(); ) { if(rArr[i]->HasParent()) @@ -831,7 +834,7 @@ SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, Mod sal_uInt16 SfxCommonTemplateDialog_Impl::StyleNrToInfoOffset(sal_uInt16 nId) { - const SfxStyleFamilyItem *pItem=pStyleFamilies->GetObject(nId); + const SfxStyleFamilyItem *pItem = pStyleFamilies->at( nId ); return SfxFamilyIdToNId(pItem->GetFamily())-1; } @@ -849,10 +852,10 @@ void SfxTemplateDialog_Impl::EnableEdit(sal_Bool bEnable) sal_uInt16 SfxCommonTemplateDialog_Impl::InfoOffsetToStyleNr(sal_uInt16 nId) { - for ( sal_uInt16 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"); + OSL_FAIL("Style Nummer nicht gefunden"); return 0; } @@ -884,21 +887,22 @@ void SfxCommonTemplateDialog_Impl::ReadResource() // Einfuegen in die Toolbox // umgekehrte Reihenfolge, da immer vorne eingefuegt wird. - sal_uInt16 nCount = pStyleFamilies->Count(); + size_t nCount = pStyleFamilies->size(); pBindings->ENTERREGISTRATIONS(); + size_t i; for(i = 0; i < nCount; ++i) { sal_uInt16 nSlot = 0; - switch((sal_uInt16)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; case SFX_STYLE_FAMILY_FRAME:nSlot = SID_STYLE_FAMILY3; break; case SFX_STYLE_FAMILY_PAGE: nSlot = SID_STYLE_FAMILY4; break; case SFX_STYLE_FAMILY_PSEUDO: nSlot = SID_STYLE_FAMILY5; break; - default: DBG_ERROR("unbekannte StyleFamily"); break; + default: OSL_FAIL("unbekannte StyleFamily"); break; } pBoundItems[i] = new SfxTemplateControllerItem(nSlot, *this, *pBindings); @@ -942,7 +946,7 @@ void SfxCommonTemplateDialog_Impl::ReadResource() for( ; nCount--; ) { - const SfxStyleFamilyItem *pItem = pStyleFamilies->GetObject( nCount ); + const SfxStyleFamilyItem *pItem = pStyleFamilies->at( nCount ); sal_uInt16 nId = SfxFamilyIdToNId( pItem->GetFamily() ); InsertFamilyItem( nId, pItem ); } @@ -1056,11 +1060,10 @@ void SfxCommonTemplateDialog_Impl::SetAutomaticFilter() // Hilfsfunktion: Zugriff auf aktuelles Family-Item const SfxStyleFamilyItem *SfxCommonTemplateDialog_Impl::GetFamilyItem_Impl() const { - const sal_uInt16 nCount = pStyleFamilies->Count(); - for(sal_uInt16 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 ); sal_uInt16 nId = SfxFamilyIdToNId(pItem->GetFamily()); if(nId == nActFamily) return pItem; @@ -1115,7 +1118,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 ); } } @@ -1198,8 +1201,7 @@ void SfxCommonTemplateDialog_Impl::FillTreeBox() const sal_uInt16 nCount = aArr.Count(); for(sal_uInt16 i = 0; i < nCount; ++i) FillBox_Impl(pTreeBox, aArr[i], aEntries); - -// EnableEdit(sal_False); +; EnableItem(SID_STYLE_WATERCAN,sal_False); SfxTemplateItem* pState = pFamilyState[nActFamily-1]; @@ -1233,23 +1235,24 @@ sal_Bool SfxCommonTemplateDialog_Impl::HasSelectedStyle() const //------------------------------------------------------------------------- -// intern: Aktualisierung der Anzeige -void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(sal_uInt16 nFlags) // Flags, was aktualisiert werden soll (s.o.) +// internal: Refresh the display +// nFlags: what we should update. +void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(sal_uInt16 nFlags) { - DBG_ASSERT(nFlags, "nichts zu tun"); + DBG_ASSERT(nFlags, "nothing to do"); const SfxStyleFamilyItem *pItem = GetFamilyItem_Impl(); if (!pItem) { // Ist beim Vorlagenkatalog der Fall SfxTemplateItem **ppItem = pFamilyState; - const sal_uInt16 nFamilyCount = pStyleFamilies->Count(); - sal_uInt16 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 + // It happens sometimes, God knows why return; - ppItem+=StyleNrToInfoOffset(n); + ppItem += StyleNrToInfoOffset(n); nAppFilter = (*ppItem)->GetValue(); FamilySelect( StyleNrToInfoOffset(n)+1 ); pItem = GetFamilyItem_Impl(); @@ -1257,17 +1260,17 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(sal_uInt16 nFlags) // F const SfxStyleFamily eFam = pItem->GetFamily(); - SfxFilterTupel *pT = pItem->GetFilterList().GetObject(nActFilter); - sal_uInt16 nFilter = pT ? pItem->GetFilterList().GetObject(nActFilter)->nFlags : 0; + SfxFilterTupel* pT = ( nActFilter < pItem->GetFilterList().size() ? pItem->GetFilterList()[nActFilter] : NULL ); + sal_uInt16 nFilter = pT ? pT->nFlags : 0; if(!nFilter) // automatisch nFilter = nAppFilter; - DBG_ASSERT(pStyleSheetPool, "kein StyleSheetPool"); + DBG_ASSERT(pStyleSheetPool, "no StyleSheetPool"); if(pStyleSheetPool) { pStyleSheetPool->SetSearchMask(eFam, nFilter); pItem = GetFamilyItem_Impl(); - if((nFlags & UPDATE_FAMILY) == UPDATE_FAMILY) + if((nFlags & UPDATE_FAMILY) == UPDATE_FAMILY) // Update view type list (Hierarchical, All, etc. { CheckItem(nActFamily, sal_True); // Button in Toolbox checken aFilterLb.SetUpdateMode(sal_False); @@ -1276,10 +1279,10 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(sal_uInt16 nFlags) // F sal_uInt16 nPos = aFilterLb.InsertEntry(String(SfxResId(STR_STYLE_FILTER_HIERARCHICAL)), 0); aFilterLb.SetEntryData( nPos, (void*)(sal_uIntPtr)SFXSTYLEBIT_ALL ); const SfxStyleFilter& rFilter = pItem->GetFilterList(); - for(sal_uInt16 i = 0; i < rFilter.Count(); ++i) + for( size_t i = 0; i < rFilter.size(); ++i) { - sal_uIntPtr nFilterFlags = rFilter.GetObject(i)->nFlags; - nPos = aFilterLb.InsertEntry( rFilter.GetObject(i)->aName ); + sal_uIntPtr nFilterFlags = rFilter[ i ]->nFlags; + nPos = aFilterLb.InsertEntry( rFilter[ i ]->aName ); aFilterLb.SetEntryData( nPos, (void*)nFilterFlags ); } if(nActFilter < aFilterLb.GetEntryCount() - 1) @@ -1288,8 +1291,8 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(sal_uInt16 nFlags) // F { nActFilter = 0; aFilterLb.SelectEntryPos(1); - SfxFilterTupel *pActT = rFilter.GetObject(nActFilter); - sal_uInt16 nFilterFlags = pActT ? rFilter.GetObject(nActFilter)->nFlags : 0; + SfxFilterTupel* pActT = ( nActFilter < rFilter.size() ) ? rFilter[ nActFilter ] : NULL; + sal_uInt16 nFilterFlags = pActT ? pActT->nFlags : 0; pStyleSheetPool->SetSearchMask(eFam, nFilterFlags); } @@ -1314,27 +1317,23 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(sal_uInt16 nFlags) // F if(nFlags & UPDATE_FAMILY_LIST) { -// EnableEdit(sal_False); EnableItem(SID_STYLE_WATERCAN,sal_False); SfxStyleSheetBase *pStyle = pStyleSheetPool->First(); SvLBoxEntry* pEntry = aFmtLb.First(); SvStringsDtor aStrings; + comphelper::string::NaturalStringSorter aSorter( + ::comphelper::getProcessComponentContext(), + Application::GetSettings().GetLocale()); + while( pStyle ) { //Bubblesort - for( sal_uInt16 nPos = aStrings.Count() + 1 ; nPos-- ;) - { - if( !nPos || *aStrings[nPos-1] < pStyle->GetName() ) - { - // Die Namen stehen in den Styles, also nicht kopieren - // Reingefallen!: Writer hat insgesamt nur 1 Style - aStrings.Insert( - new String( pStyle->GetName() ), nPos ); - break; - } - } + sal_uInt16 nPos; + for( nPos = aStrings.Count() ; nPos && + aSorter.compare(*(aStrings[nPos-1]), pStyle->GetName()) > 0 ; nPos--); + aStrings.Insert( new String( pStyle->GetName() ), nPos ); pStyle = pStyleSheetPool->Next(); } @@ -1350,19 +1349,21 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(sal_uInt16 nFlags) // F if( nPos < nCount || pEntry ) { - // Box mit den Vorlagen fuellen + // Fills the display box aFmtLb.SetUpdateMode(sal_False); aFmtLb.Clear(); nPos = 0; - while( nPos < nCount ) - aFmtLb.InsertEntry( *aStrings.GetObject( nPos++ )); - aFmtLb.SetUpdateMode(sal_True); + for(nPos = 0 ; nPos < nCount ; ++nPos ) + { + aFmtLb.InsertEntry( *aStrings.GetObject( nPos ), 0, FALSE, nPos); + } + aFmtLb.SetUpdateMode(true); } - // aktuelle Vorlage anzeigen + // Selects the current style if any SfxTemplateItem *pState = pFamilyState[nActFamily-1]; String aStyle; - if(pState) //Aktuellen Eintrag selektieren + if(pState) aStyle = pState->GetStyleName(); SelectStyle(aStyle); EnableDelete(); @@ -1375,9 +1376,8 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(sal_uInt16 nFlags) // F // Aktualisierung Anzeige: Gie\skanne an/aus 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(); @@ -1394,9 +1394,9 @@ void SfxCommonTemplateDialog_Impl::SetWaterCanState(const SfxBoolItem *pItem) //Waehrend Giesskannenmodus Statusupdates ignorieren. - sal_uInt16 nCount=pStyleFamilies->Count(); + size_t nCount = pStyleFamilies->size(); pBindings->EnterRegistrations(); - for(sal_uInt16 n=0; n<nCount; n++) + for(size_t n = 0; n < nCount; n++) { SfxControllerItem *pCItem=pBoundItems[n]; sal_Bool bChecked = pItem && pItem->GetValue(); @@ -1463,7 +1463,6 @@ void SfxCommonTemplateDialog_Impl::Update_Impl() pStyleSheetPool = pNewPool; bDocChanged=sal_True; } -// InvalidateBindings(); } if (bUpdateFamily) @@ -1484,10 +1483,10 @@ void SfxCommonTemplateDialog_Impl::Update_Impl() { CheckItem(nActFamily, sal_False); SfxTemplateItem **ppItem = pFamilyState; - const sal_uInt16 nFamilyCount = pStyleFamilies->Count(); - sal_uInt16 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(); @@ -1518,9 +1517,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(); @@ -1740,12 +1739,11 @@ sal_Bool SfxCommonTemplateDialog_Impl::Execute_Impl( if(!nFilterFlags) // Benutzervorlage? nFilterFlags = pFilterItem->GetValue(); const SfxStyleFamilyItem *pFamilyItem = GetFamilyItem_Impl(); - const sal_uInt16 nFilterCount = (sal_uInt16) pFamilyItem->GetFilterList().Count(); + const size_t nFilterCount = pFamilyItem->GetFilterList().size(); - for ( sal_uInt16 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; @@ -1772,7 +1770,6 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, FilterSelectHdl, ListBox *, pBox ) bHierarchical=sal_True; const String aSelectEntry( GetSelectedEntry()); aFmtLb.Hide(); - // aFilterLb.Disable(); pTreeBox = new StyleTreeListBox_Impl( this, WB_HASBUTTONS | WB_HASLINES | @@ -1790,7 +1787,10 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, FilterSelectHdl, ListBox *, pBox ) ((StyleTreeListBox_Impl*)pTreeBox)-> SetDropHdl(LINK(this, SfxCommonTemplateDialog_Impl, DropHdl)); pTreeBox->SetIndent(10); - + SfxViewFrame *pViewFrame = pBindings->GetDispatcher_Impl()->GetFrame(); + SfxObjectShell *pDocShell = pViewFrame->GetObjectShell(); + if (pDocShell) + SaveFactoryStyleFilter( pDocShell, HIERARCHICAL_FILTER_INDEX ); FillTreeBox(); SelectStyle(aSelectEntry); pTreeBox->SetAccessibleName(SfxResId(STR_STYLE_ELEMTLIST)); @@ -1807,7 +1807,6 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, FilterSelectHdl, ListBox *, pBox ) // minus one since hierarchical is inserted at the start FilterSelect(pBox->GetSelectEntryPos() - 1, bHierarchical ); bHierarchical=sal_False; -// UpdateStyles_Impl(UPDATE_FAMILY_LIST); // Anzeige aktualisieren } return 0; @@ -1868,13 +1867,11 @@ void SfxCommonTemplateDialog_Impl::ActionSelect(sal_uInt16 nEntry) if(pStyleSheetPool && nActFamily != 0xffff) { const SfxStyleFamily eFam=GetFamilyItem_Impl()->GetFamily(); -//pStyleSheetPool->GetSearchFamily(); const SfxStyleFamilyItem *pItem = GetFamilyItem_Impl(); sal_uInt16 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; } @@ -1882,9 +1879,8 @@ void SfxCommonTemplateDialog_Impl::ActionSelect(sal_uInt16 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); @@ -1909,7 +1905,7 @@ void SfxCommonTemplateDialog_Impl::ActionSelect(sal_uInt16 nEntry) case SID_TEMPLATE_LOAD: SFX_APP()->GetDispatcher_Impl()->Execute(nEntry); break; - default: DBG_ERROR("not implemented"); break; + default: OSL_FAIL("not implemented"); break; } } @@ -2003,10 +1999,9 @@ void SfxCommonTemplateDialog_Impl::NewHdl(void *) const SfxStyleFamilyItem *pItem = GetFamilyItem_Impl(); const SfxStyleFamily eFam=pItem->GetFamily(); sal_uInt16 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; } @@ -2022,27 +2017,6 @@ void SfxCommonTemplateDialog_Impl::NewHdl(void *) Application::SetDefDialogParent( pTmp ); -/* { - DBG_ASSERT(nFilter < aFilterLb.GetEntryCount(), - "Filter ueberindiziert"); - - if(!pTreeBox) - { -// aFilterLb.SelectEntryPos(nFilter); - FilterSelect(nActFilter, sal_True); - } - else - { - FillTreeBox(); - SfxTemplateItem *pState = pFamilyState[nActFamily-1]; - if(pState) - { - const String aStyle(pState->GetStyleName()); - SelectStyle(aStyle); - } - EnableDelete(); - }*/ -// } } } @@ -2069,16 +2043,6 @@ void SfxCommonTemplateDialog_Impl::EditHdl(void *) if ( Execute_Impl( SID_STYLE_EDIT, aTemplName, String(), (sal_uInt16)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, sal_True); - } - else - FillTreeBox();*/ } Application::SetDefDialogParent( pTmp ); } @@ -2139,13 +2103,13 @@ void SfxCommonTemplateDialog_Impl::EnableDelete() const SfxStyleFamilyItem *pItem = GetFamilyItem_Impl(); const SfxStyleFamily eFam = pItem->GetFamily(); sal_uInt16 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()) { @@ -2160,8 +2124,6 @@ void SfxCommonTemplateDialog_Impl::EnableDelete() { EnableDel(sal_False); } -// rBindings.Invalidate( SID_STYLE_DELETE ); -// rBindings.Update( SID_STYLE_DELETE ); } //------------------------------------------------------------------------- @@ -2223,7 +2185,6 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, FmtSelectHdl, SvTreeListBox *, pListBox GetSelectedEntry(), aEmpty, ( sal_uInt16 )GetFamilyItem_Impl()->GetFamily()); } -// EnableEdit(sal_True); EnableItem(SID_STYLE_WATERCAN, !bWaterDisabled); EnableDelete(); } @@ -2325,6 +2286,9 @@ SfxTemplateDialog_Impl::SfxTemplateDialog_Impl( { pDlgWindow->FreeResource(); + SfxViewFrame* pViewFrame = pBindings->GetDispatcher_Impl()->GetFrame(); + pCurObjShell = pViewFrame->GetObjectShell(); + USHORT nSavedFilter = static_cast< USHORT >( LoadFactoryStyleFilter( pCurObjShell ) ); Initialize(); m_aActionTbL.SetSelectHdl(LINK(this, SfxTemplateDialog_Impl, ToolBoxLSelect)); @@ -2336,6 +2300,12 @@ SfxTemplateDialog_Impl::SfxTemplateDialog_Impl( aFont.SetWeight( WEIGHT_NORMAL ); aFilterLb.SetFont( aFont ); m_aActionTbL.SetHelpId( HID_TEMPLDLG_TOOLBOX_LEFT ); + if( nSavedFilter == HIERARCHICAL_FILTER_INDEX ) + { + bHierarchical = FALSE; // Force content refresh + aFilterLb.SelectEntry(String(SfxResId(STR_STYLE_FILTER_HIERARCHICAL))); + FilterSelectHdl(&aFilterLb); + } } // ------------------------------------------------------------------------ @@ -2346,6 +2316,7 @@ void SfxTemplateDialog_Impl::EnableFamilyItem( sal_uInt16 nId, sal_Bool bEnable } //------------------------------------------------------------------------- +// Insert element into dropdown filter "Frame Styles", "List Styles", etc. void SfxTemplateDialog_Impl::InsertFamilyItem(sal_uInt16 nId,const SfxStyleFamilyItem *pItem) { @@ -2357,7 +2328,7 @@ void SfxTemplateDialog_Impl::InsertFamilyItem(sal_uInt16 nId,const SfxStyleFamil case SFX_STYLE_FAMILY_FRAME: sHelpId = ".uno:FrameStyle"; break; case SFX_STYLE_FAMILY_PAGE: sHelpId = ".uno:PageStyle"; break; case SFX_STYLE_FAMILY_PSEUDO: sHelpId = ".uno:ListStyle"; break; - default: DBG_ERROR("unknown StyleFamily"); break; + default: OSL_FAIL("unknown StyleFamily"); break; } m_aActionTbL.InsertItem( nId, pItem->GetImage(), pItem->GetText(), 0, 0); m_aActionTbL.SetHelpId( nId, sHelpId ); @@ -2380,14 +2351,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 - sal_uInt16 nLoop = pStyleFamilies->Count(); + size_t nLoop = pStyleFamilies->size(); for( ; nLoop--; ) { - const SfxStyleFamilyItem *pItem = pStyleFamilies->GetObject( nLoop ); + const SfxStyleFamilyItem *pItem = pStyleFamilies->at( nLoop ); sal_uInt16 nId = SfxFamilyIdToNId( pItem->GetFamily() ); m_aActionTbL.SetItemImage( nId, pItem->GetImage() ); } @@ -2396,9 +2366,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 ) ) ); } // ------------------------------------------------------------------------ @@ -2428,14 +2396,6 @@ void SfxCommonTemplateDialog_Impl::InvalidateBindings() SfxTemplateDialog_Impl::~SfxTemplateDialog_Impl() { -/* - SfxImageManager* pImgMgr = pBindings->GetImageManager(); - if ( pImgMgr ) - { - pImgMgr->ReleaseToolBox( &m_aActionTbL ); - pImgMgr->ReleaseToolBox( &m_aActionTbR ); - } -*/ } //------------------------------------------------------------------------- @@ -2455,10 +2415,6 @@ void SfxTemplateDialog_Impl::Resize() FloatingWindow *pF = m_pFloat->GetFloatingWindow(); if ( pF ) { -// if(pF->IsZoomedIn() && m_bZoomIn==sal_False) -// pF->SetText(String(SfxResId( DLG_STYLE_DESIGNER ))); -// if(!pF->IsZoomedIn() && m_bZoomIn==sal_True && GetFamilyItem_Impl()) -// UpdateStyles_Impl(UPDATE_FAMILY); //Bereich wieder in Titel schreiben m_bZoomIn = pF->IsRollUp(); if ( m_bZoomIn ) return; @@ -2609,7 +2565,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; @@ -2639,12 +2595,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 ); @@ -2656,18 +2612,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"); @@ -2848,13 +2804,6 @@ void SfxTemplateCatalog_Impl::EnableItem( sal_uInt16 nMesId, sal_Bool bCheck ) aOkBtn.Enable( bCheck ); if ( nMesId > SFX_STYLE_FAMILY_PSEUDO || nMesId < SFX_STYLE_FAMILY_CHAR ) return; - -/* for(sal_uInt16 i=0;i<aFamIds.Count&&aFamIds[i]!=nMesId;i++); - if(i!=aFamIds.Count()) - aFamList.SelectEntry(aFamIds[i]); - else - DBG_ERROR("Entry nicht gefunden");*/ - } //------------------------------------------------------------------------- @@ -2994,24 +2943,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; @@ -3031,11 +2973,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.hrc b/sfx2/source/dialog/templdlg.hrc index e39108ce57a9..e39108ce57a9 100644..100755 --- a/sfx2/source/dialog/templdlg.hrc +++ b/sfx2/source/dialog/templdlg.hrc diff --git a/sfx2/source/dialog/templdlg.src b/sfx2/source/dialog/templdlg.src index ff2661181434..51b6e9802147 100644..100755 --- 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,6 +131,7 @@ ModalDialog RID_STYLECATALOG DropDown = TRUE ; }; }; + // Strings --------------------------------------------------------------- String STR_STYLE_ELEMTLIST { @@ -151,6 +141,7 @@ String STR_STYLE_FILTER_HIERARCHICAL { Text [ en-US ] = "Hierarchical" ; }; + // DLG_STYLE_DESIGNER ---------------------------------------------------- DockingWindow DLG_STYLE_DESIGNER { diff --git a/sfx2/source/dialog/titledockwin.cxx b/sfx2/source/dialog/titledockwin.cxx index 5d41fc214786..f017ad454063 100644..100755 --- a/sfx2/source/dialog/titledockwin.cxx +++ b/sfx2/source/dialog/titledockwin.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. * @@ -246,12 +247,7 @@ namespace sfx2 // Get the closer bitmap and set it as right most button. Image aImage( SfxResId( SFX_IMG_CLOSE_DOC ) ); - Image aImageHC( SfxResId( SFX_IMG_CLOSE_DOC_HC ) ); - m_aToolbox.InsertItem( 1, - GetSettings().GetStyleSettings().GetHighContrastMode() - ? aImageHC - : aImage - ); + m_aToolbox.InsertItem( 1, aImage ); m_aToolbox.ShowItem( 1 ); } @@ -358,3 +354,5 @@ namespace sfx2 //...................................................................................................................... } // namespace sfx2 //...................................................................................................................... + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/titledockwin.src b/sfx2/source/dialog/titledockwin.src index 3f52e84ab75d..ede6c4b8c4d1 100644..100755 --- a/sfx2/source/dialog/titledockwin.src +++ b/sfx2/source/dialog/titledockwin.src @@ -31,9 +31,3 @@ 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 2b815a260e3a..5a831b162cf2 100644..100755 --- 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. @@ -103,7 +104,7 @@ void SfxTemplateControllerItem::StateChanged( sal_uInt16 nSID, SfxItemState eSta nFamily = 4; break; case SID_STYLE_FAMILY5: nFamily = 5; break; - default: DBG_ERROR("unbekannte StyleFamily"); break; + default: OSL_FAIL("unbekannte StyleFamily"); break; } rTemplateDlg.EnableFamilyItem( nFamily, !bDisable ); break; @@ -139,9 +140,6 @@ void SfxTemplateControllerItem::StateChanged( sal_uInt16 nSID, SfxItemState eSta { rTemplateDlg.EnableExample_Impl( GetId(), eState != SFX_ITEM_DISABLED ); - // Das Select Disabled dann, falls enabled und Style Readonly -/* String aStr = rTemplateDlg.GetSelectedEntry(); - if( aStr.Len() ) rTemplateDlg.SelectStyle( aStr ); */ break; } case SID_STYLE_NEW: @@ -163,9 +161,7 @@ void SfxTemplateControllerItem::StateChanged( sal_uInt16 nSID, SfxItemState eSta } } } -/* -----------------------------05.09.2001 10:48------------------------------ - ---------------------------------------------------------------------------*/ IMPL_STATIC_LINK(SfxTemplateControllerItem, SetWaterCanStateHdl_Impl, SfxTemplateControllerItem*, EMPTYARG) { @@ -183,3 +179,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 774c7e44e7a7..67e1b004b4f0 100644..100755 --- 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,7 +85,7 @@ SfxPoolItem* SfxTemplateItem::Clone( SfxItemPool *) const } //------------------------------------------------------------------------- -sal_Bool SfxTemplateItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const +bool SfxTemplateItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const { ::com::sun::star::frame::status::Template aTemplate; @@ -92,11 +93,11 @@ sal_Bool SfxTemplateItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 aTemplate.StyleName = aStyle; rVal <<= aTemplate; - return sal_True; + return true; } //------------------------------------------------------------------------- -sal_Bool SfxTemplateItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) +bool SfxTemplateItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) { ::com::sun::star::frame::status::Template aTemplate; @@ -104,10 +105,10 @@ sal_Bool SfxTemplateItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uI { SetValue( sal::static_int_cast< sal_uInt16 >( aTemplate.Value ) ); aStyle = aTemplate.StyleName; - return sal_True; + return true; } - return sal_False; + return false; } //------------------------------------------------------------------------- @@ -118,3 +119,4 @@ sal_uInt8 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 51219608b75e..afdc3f934065 100644..100755 --- 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,9 +29,7 @@ // 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> #include <svl/intitem.hxx> #include <svl/stritem.hxx> @@ -54,8 +53,10 @@ #include <sfx2/request.hxx> #include <sfx2/sfxuno.hxx> +#include <vector> using namespace com::sun::star; +using ::std::vector; // ************************************************************************** struct SfxVersionInfo @@ -78,16 +79,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 +100,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,41 +117,33 @@ 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; } //---------------------------------------------------------------- -//---------------------------------------------------------------- -//---------------------------------------------------------------- SfxVersionInfo::SfxVersionInfo() { } @@ -162,17 +160,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 +282,9 @@ void SfxVersionDialog::Init_Impl() delete mpTable; mpTable = new SfxVersionTableDtor( aVersions ); { - for ( sal_uInt16 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 +514,4 @@ IMPL_LINK( SfxViewVersionDialog_Impl, ButtonHdl, Button*, pButton ) return 0L; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/versdlg.hrc b/sfx2/source/dialog/versdlg.hrc index 2de7596221e1..2de7596221e1 100644..100755 --- a/sfx2/source/dialog/versdlg.hrc +++ b/sfx2/source/dialog/versdlg.hrc diff --git a/sfx2/source/dialog/versdlg.src b/sfx2/source/dialog/versdlg.src index 927c940e6506..927c940e6506 100644..100755 --- a/sfx2/source/dialog/versdlg.src +++ b/sfx2/source/dialog/versdlg.src diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx index df0781be8877..8ad9d8b537cb 100644..100755 --- 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. @@ -111,20 +112,20 @@ static const char s_odfmime [] = "application/vnd.oasis.opendocument."; static bool isContentFile(::rtl::OUString const & i_rPath) { - return i_rPath.equalsAscii(s_content); + return i_rPath.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(s_content)); } static bool isStylesFile (::rtl::OUString const & i_rPath) { - return i_rPath.equalsAscii(s_styles); + return i_rPath.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(s_styles)); } static bool isReservedFile(::rtl::OUString const & i_rPath) { return isContentFile(i_rPath) || isStylesFile(i_rPath) - || i_rPath.equalsAscii(s_meta) - || i_rPath.equalsAscii(s_settings); + || i_rPath.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(s_meta)) + || i_rPath.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(s_settings)); } //////////////////////////////////////////////////////////////////////////// @@ -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)); } @@ -498,11 +488,7 @@ handleError( ucb::InteractiveAugmentedIOException const & i_rException, new ::comphelper::OInteractionApprove ); ::rtl::Reference< ::comphelper::OInteractionAbort > pAbort( new ::comphelper::OInteractionAbort ); - /* this does not seem to work - if (i_rException.Code != ucb::IOErrorCode_WRONG_FORMAT) { - pRequest->addContinuation( pRetry.get() ); - } - */ + pRequest->addContinuation( pApprove.get() ); pRequest->addContinuation( pAbort.get() ); // actually call the handler @@ -513,8 +499,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 +512,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)) @@ -555,7 +541,7 @@ readStream(struct DocumentMetadataAccess_Impl & i_rImpl, ::rtl::OUString rest; try { if (!splitPath(i_rPath, dir, rest)) throw uno::RuntimeException(); - if (dir.equalsAscii("")) { + if (dir.getLength() == 0) { if (i_xStorage->isStreamElement(i_rPath)) { const uno::Reference<io::XStream> xStream( i_xStorage->openStreamElement(i_rPath, @@ -570,8 +556,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 +583,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 +617,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 +638,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 ); @@ -675,7 +661,7 @@ writeStream(struct DocumentMetadataAccess_Impl & i_rImpl, ::rtl::OUString rest; if (!splitPath(i_rPath, dir, rest)) throw uno::RuntimeException(); try { - if (dir.equalsAscii("")) { + if (dir.getLength() == 0) { exportStream(i_rImpl, i_xStorage, i_xGraphName, i_rPath, i_rBaseURI); } else { @@ -772,9 +758,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 +784,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)); } @@ -849,7 +835,6 @@ DocumentMetadataAccess::~DocumentMetadataAccess() { } - // ::com::sun::star::rdf::XRepositorySupplier: uno::Reference< rdf::XRepository > SAL_CALL DocumentMetadataAccess::getRDFRepository() throw (uno::RuntimeException) @@ -887,8 +872,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 +884,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 +910,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 +933,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 +958,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 +979,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 +1005,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 +1026,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 +1043,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 +1063,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 +1078,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 +1091,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 +1105,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 +1197,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 +1216,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 +1232,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 +1270,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)); } } @@ -1317,10 +1302,10 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, if (md.addInputStream()) { md[ ::comphelper::MediaDescriptor::PROP_INPUTSTREAM() ] >>= xIn; } - if (!xIn.is() && URL.equalsAscii("")) { - throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii( + if (!xIn.is() && (URL.getLength() == 0)) { + 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 +1324,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 { @@ -1373,10 +1358,10 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, ::comphelper::MediaDescriptor md(i_rMedium); ::rtl::OUString URL; md[ ::comphelper::MediaDescriptor::PROP_URL() ] >>= URL; - if (URL.equalsAscii("")) { - throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii( + if (URL.getLength() == 0) { + 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 +1378,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 +1415,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 94c5826569f2..302e181fe438 100644..100755 --- 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> @@ -38,7 +39,7 @@ #include <boost/bind.hpp> #include <memory> -#include <hash_map> +#include <boost/unordered_map.hpp> #include <list> #include <algorithm> #if OSL_DEBUG_LEVEL > 0 @@ -126,12 +127,12 @@ static const char s_prefix [] = "id"; // prefix for generated xml:id static bool isContentFile(::rtl::OUString const & i_rPath) { - return i_rPath.equalsAscii(s_content); + return i_rPath.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(s_content)); } static bool isStylesFile (::rtl::OUString const & i_rPath) { - return i_rPath.equalsAscii(s_styles); + return i_rPath.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(s_styles)); } @@ -401,11 +402,11 @@ XmlIdRegistry::GetXmlIdForElement(const Metadatable& i_rObject) const /// generate unique xml:id template< typename T > /*static*/ ::rtl::OUString create_id(const - ::std::hash_map< ::rtl::OUString, T, ::rtl::OUStringHash > & i_rXmlIdMap) + ::boost::unordered_map< ::rtl::OUString, T, ::rtl::OUStringHash > & i_rXmlIdMap) { static rtlRandomPool s_Pool( rtl_random_createPool() ); - const ::rtl::OUString prefix( ::rtl::OUString::createFromAscii(s_prefix) ); - typename ::std::hash_map< ::rtl::OUString, T, ::rtl::OUStringHash > + const ::rtl::OUString prefix(RTL_CONSTASCII_USTRINGPARAM(s_prefix)); + typename ::boost::unordered_map< ::rtl::OUString, T, ::rtl::OUStringHash > ::const_iterator iter; ::rtl::OUString id; do @@ -426,7 +427,7 @@ template< typename T > typedef ::std::list< Metadatable* > XmlIdList_t; /// Idref -> (content.xml element list, styles.xml element list) -typedef ::std::hash_map< ::rtl::OUString, +typedef ::boost::unordered_map< ::rtl::OUString, ::std::pair< XmlIdList_t, XmlIdList_t >, ::rtl::OUStringHash > XmlIdMap_t; /// pointer hash template @@ -439,7 +440,7 @@ template<typename T> struct PtrHash }; /// element -> (stream name, idref) -typedef ::std::hash_map< const Metadatable*, +typedef ::boost::unordered_map< const Metadatable*, ::std::pair< ::rtl::OUString, ::rtl::OUString>, PtrHash<Metadatable> > XmlIdReverseMap_t; @@ -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) ); @@ -554,9 +555,9 @@ XmlIdRegistryDocument::XmlIdRegistry_Impl::LookupXmlId( m_XmlIdReverseMap.find(&i_rObject) ); if (iter != m_XmlIdReverseMap.end()) { - OSL_ENSURE(!iter->second.first.equalsAscii(""), + OSL_ENSURE(iter->second.first.getLength(), "null stream in m_XmlIdReverseMap"); - OSL_ENSURE(!iter->second.second.equalsAscii(""), + OSL_ENSURE(iter->second.second.getLength(), "null id in m_XmlIdReverseMap"); o_rStream = iter->second.first; o_rIdref = iter->second.second; @@ -599,9 +600,6 @@ XmlIdRegistryDocument::XmlIdRegistry_Impl::TryInsertMetadatable( ::boost::bind( &Metadatable::IsInClipboard, _1 ) ) ) ) ) { -// ??? this is not undoable -// pList->clear(); -// pList->push_back( &i_rObject ); pList->push_front( &i_rObject ); return true; } @@ -690,15 +688,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; @@ -709,7 +707,7 @@ XmlIdRegistryDocument::TryRegisterMetadatable(Metadatable & i_rObject, return (m_pImpl->LookupElement(old_path, old_idref) == &i_rObject); } XmlIdMap_t::iterator old_id( m_pImpl->m_XmlIdMap.end() ); - if (!old_idref.equalsAscii("")) + if (old_idref.getLength()) { old_id = m_pImpl->m_XmlIdMap.find(old_idref); OSL_ENSURE(old_id != m_pImpl->m_XmlIdMap.end(), "old id not found"); @@ -746,7 +744,7 @@ XmlIdRegistryDocument::RegisterMetadatableAndCreateID(Metadatable & i_rObject) m_pImpl->LookupXmlId(i_rObject, old_path, old_idref); XmlIdMap_t::iterator old_id( m_pImpl->m_XmlIdMap.end() ); - if (!old_idref.equalsAscii("")) + if (old_idref.getLength()) { old_id = m_pImpl->m_XmlIdMap.find(old_idref); OSL_ENSURE(old_id != m_pImpl->m_XmlIdMap.end(), "old id not found"); @@ -797,7 +795,7 @@ void XmlIdRegistryDocument::RemoveXmlIdForElement(const Metadatable& i_rObject) m_pImpl->m_XmlIdReverseMap.find(&i_rObject) ); if (iter != m_pImpl->m_XmlIdReverseMap.end()) { - OSL_ENSURE(!iter->second.second.equalsAscii(""), + OSL_ENSURE(iter->second.second.getLength(), "null id in m_XmlIdReverseMap"); m_pImpl->m_XmlIdReverseMap.erase(iter); } @@ -922,13 +920,13 @@ struct RMapEntry }; /// element -> (stream name, idref, source) -typedef ::std::hash_map< const Metadatable*, +typedef ::boost::unordered_map< const Metadatable*, struct RMapEntry, PtrHash<Metadatable> > ClipboardXmlIdReverseMap_t; /// Idref -> (content.xml element, styles.xml element) -typedef ::std::hash_map< ::rtl::OUString, +typedef ::boost::unordered_map< ::rtl::OUString, ::std::pair< Metadatable*, Metadatable* >, ::rtl::OUStringHash > ClipboardXmlIdMap_t; @@ -993,8 +991,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) ); @@ -1031,9 +1029,9 @@ XmlIdRegistryClipboard::XmlIdRegistry_Impl::LookupXmlId( m_XmlIdReverseMap.find(&i_rObject) ); if (iter != m_XmlIdReverseMap.end()) { - OSL_ENSURE(!iter->second.m_Stream.equalsAscii(""), + OSL_ENSURE(iter->second.m_Stream.getLength(), "null stream in m_XmlIdReverseMap"); - OSL_ENSURE(!iter->second.m_XmlId.equalsAscii(""), + OSL_ENSURE(iter->second.m_XmlId.getLength(), "null id in m_XmlIdReverseMap"); o_rStream = iter->second.m_Stream; o_rIdref = iter->second.m_XmlId; @@ -1055,8 +1053,6 @@ XmlIdRegistryClipboard::XmlIdRegistry_Impl::TryInsertMetadatable( OSL_ENSURE(isContentFile(i_rStreamName) || isStylesFile(i_rStreamName), "invalid stream"); - //wntmsci12 won't parse this: -// Metadatable ** ppEntry( LookupEntry(i_rStreamName, i_rIdref) ); Metadatable ** ppEntry = LookupEntry(i_rStreamName, i_rIdref); if (ppEntry) { @@ -1124,15 +1120,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; @@ -1144,7 +1140,7 @@ XmlIdRegistryClipboard::TryRegisterMetadatable(Metadatable & i_rObject, return (m_pImpl->LookupElement(old_path, old_idref) == &i_rObject); } ClipboardXmlIdMap_t::iterator old_id( m_pImpl->m_XmlIdMap.end() ); - if (!old_idref.equalsAscii("")) + if (old_idref.getLength()) { old_id = m_pImpl->m_XmlIdMap.find(old_idref); OSL_ENSURE(old_id != m_pImpl->m_XmlIdMap.end(), "old id not found"); @@ -1179,7 +1175,7 @@ XmlIdRegistryClipboard::RegisterMetadatableAndCreateID(Metadatable & i_rObject) ::rtl::OUString old_path; ::rtl::OUString old_idref; LookupXmlId(i_rObject, old_path, old_idref); - if (!old_idref.equalsAscii("") && + if (old_idref.getLength() && (m_pImpl->LookupElement(old_path, old_idref) == &i_rObject)) { return; @@ -1225,7 +1221,7 @@ void XmlIdRegistryClipboard::RemoveXmlIdForElement(const Metadatable& i_rObject) m_pImpl->m_XmlIdReverseMap.find(&i_rObject) ); if (iter != m_pImpl->m_XmlIdReverseMap.end()) { - OSL_ENSURE(!iter->second.m_XmlId.equalsAscii(""), + OSL_ENSURE(iter->second.m_XmlId.getLength(), "null id in m_XmlIdReverseMap"); m_pImpl->m_XmlIdReverseMap.erase(iter); } @@ -1261,8 +1257,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) @@ -1332,14 +1328,14 @@ void Metadatable::SetMetadataReference( const ::com::sun::star::beans::StringPair & i_rReference) { - if (i_rReference.Second.equalsAscii("")) + if (i_rReference.Second.getLength() == 0) { RemoveMetadataReference(); } else { ::rtl::OUString streamName( i_rReference.First ); - if (streamName.equalsAscii("")) + if (streamName.getLength() == 0) { // handle empty stream name as auto-detect. // necessary for importing flat file format. @@ -1354,8 +1350,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); } } } @@ -1420,7 +1416,7 @@ Metadatable::RegisterAsCopyOf(Metadatable const & i_rSource, { beans::StringPair SourceRef( i_rSource.m_pReg->GetXmlIdForElement(i_rSource) ); - bool isLatent( SourceRef.Second.equalsAscii("") ); + bool isLatent( SourceRef.Second.getLength() == 0 ); XmlIdRegistryDocument * pSourceRegDoc( dynamic_cast<XmlIdRegistryDocument*>(i_rSource.m_pReg) ); OSL_ENSURE(pSourceRegDoc, "RegisterAsCopyOf: 2 clipboards?"); @@ -1471,19 +1467,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 +1583,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 +1600,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(); @@ -1628,7 +1611,7 @@ beans::StringPair SAL_CALL MetadatableMixin::getMetadataReference() throw (uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Metadatable *const pObject( GetCoreObject() ); if (!pObject) @@ -1646,7 +1629,7 @@ MetadatableMixin::setMetadataReference( const beans::StringPair & i_rReference) throw (uno::RuntimeException, lang::IllegalArgumentException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Metadatable *const pObject( GetCoreObject() ); if (!pObject) @@ -1662,7 +1645,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException) void SAL_CALL MetadatableMixin::ensureMetadataReference() throw (uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Metadatable *const pObject( GetCoreObject() ); if (!pObject) @@ -1701,3 +1684,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 1907e54246ab..ae27713ce1ba 100644..100755 --- 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. @@ -34,7 +35,6 @@ #include <sfx2/sfxuno.hxx> #include "doc.hrc" #include <vcl/msgbox.hxx> - // ----------------------------------------------------------------------------- short ExecuteQuerySaveDocument(Window* _pParent,const String& _rTitle) { @@ -47,3 +47,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 f18e903eb6e4..f2b665f245cb 100644..100755 --- 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 @@ -329,11 +334,8 @@ private: /// check if we are initialized properly void SAL_CALL checkInit() const; - // throw (css::uno::RuntimeException); /// initialize state from given DOM tree void SAL_CALL init(css::uno::Reference<css::xml::dom::XDocument> i_xDom); - // throw (css::uno::RuntimeException, css::io::WrongFormatException, - // css::uno::Exception); /// update element in DOM tree void SAL_CALL updateElement(const char *i_name, std::vector<std::pair<const char *, ::rtl::OUString> >* i_pAttrs = 0); @@ -344,34 +346,75 @@ private: /// extract base URL (necessary for converting relative links) css::uno::Reference<css::beans::XPropertySet> SAL_CALL getURLProperties( const css::uno::Sequence<css::beans::PropertyValue> & i_rMedium) const; - // throw (css::uno::RuntimeException); /// get text of standard meta data element ::rtl::OUString SAL_CALL getMetaText(const char* i_name) const; - // throw (css::uno::RuntimeException); /// set text of standard meta data element iff not equal to existing text bool SAL_CALL setMetaText(const char* i_name, const ::rtl::OUString & i_rValue); - // throw (css::uno::RuntimeException); /// set text of standard meta data element iff not equal to existing text void SAL_CALL setMetaTextAndNotify(const char* i_name, const ::rtl::OUString & i_rValue); - // throw (css::uno::RuntimeException); /// get text of standard meta data element's attribute ::rtl::OUString SAL_CALL getMetaAttr(const char* i_name, const char* i_attr) const; - // throw (css::uno::RuntimeException); /// get text of a list of standard meta data elements (multiple occ.) css::uno::Sequence< ::rtl::OUString > SAL_CALL getMetaList( const char* i_name) const; - // throw (css::uno::RuntimeException); /// set text of a list of standard meta data elements (multiple occ.) bool SAL_CALL setMetaList(const char* i_name, const css::uno::Sequence< ::rtl::OUString > & i_rValue, AttrVector const* = 0); - // throw (css::uno::RuntimeException); 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 +533,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 +660,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 +698,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()) { @@ -697,7 +740,7 @@ SfxDocumentMetaData::setMetaText(const char* i_name, css::uno::Reference<css::xml::dom::XNode> xNode = m_meta.find(name)->second; try { - if (i_rValue.equalsAscii("")) { + if (i_rValue.getLength() == 0) { if (xNode.is()) { // delete m_xParent->removeChild(xNode); xNode.clear(); @@ -735,8 +778,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 +916,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 +1057,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); } } @@ -1033,7 +1076,7 @@ void SAL_CALL SfxDocumentMetaData::updateUserDefinedAndAttributes() // update elements with attributes std::vector<std::pair<const char *, ::rtl::OUString> > attributes; - if (!m_TemplateName.equalsAscii("") || !m_TemplateURL.equalsAscii("") + if (m_TemplateName.getLength() || m_TemplateURL.getLength() || isValidDateTime(m_TemplateDate)) { attributes.push_back(std::make_pair( static_cast<const char*>("xlink:type"), @@ -1056,7 +1099,7 @@ void SAL_CALL SfxDocumentMetaData::updateUserDefinedAndAttributes() } attributes.clear(); - if (!m_AutoloadURL.equalsAscii("") || (0 != m_AutoloadSecs)) { + if (m_AutoloadURL.getLength() || (0 != m_AutoloadSecs)) { attributes.push_back(std::make_pair( static_cast<const char*>("xlink:href" ), m_AutoloadURL )); attributes.push_back(std::make_pair( @@ -1068,12 +1111,12 @@ void SAL_CALL SfxDocumentMetaData::updateUserDefinedAndAttributes() } attributes.clear(); - if (!m_DefaultTarget.equalsAscii("")) { + if (m_DefaultTarget.getLength()) { attributes.push_back(std::make_pair( 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 +1135,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 +1155,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() ), @@ -1123,22 +1166,20 @@ SfxDocumentMetaData::checkInit() const // throw (css::uno::RuntimeException) // initialize state from DOM tree void SAL_CALL SfxDocumentMetaData::init( css::uno::Reference<css::xml::dom::XDocument> i_xDoc) -// throw (css::uno::RuntimeException, css::io::WrongFormatException, -// 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,16 +1197,14 @@ 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(); try { m_xParent = xPath->selectSingleNode(xDocNode, prefix); } catch (com::sun::star::uno::Exception &) { -// DBG_WARNING("SfxDocumentMetaData::init: " -// "caught RuntimeException from libxml!"); } if (!m_xParent.is()) { @@ -1174,29 +1213,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 +1250,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 +1261,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 +1282,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 +1300,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 +1311,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; @@ -1289,7 +1326,7 @@ void SAL_CALL SfxDocumentMetaData::init( OUStringToOString(text, RTL_TEXTENCODING_UTF8).getStr()); continue; } - } else if (type.equalsAscii("time")) { + } else if (type.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("time"))) { css::util::Duration ud; if (textToDuration(ud, text)) { any <<= ud; @@ -1298,7 +1335,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 +1344,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 +1558,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 +1716,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(); @@ -1721,7 +1758,7 @@ SfxDocumentMetaData::getDocumentStatistics() throw (css::uno::RuntimeException) for (size_t i = 0; s_stdStats[i] != 0; ++i) { const char * aName = s_stdStatAttrs[i]; ::rtl::OUString text = getMetaAttr("meta:document-statistic", aName); - if (text.equalsAscii("")) continue; + if (text.getLength() == 0) continue; css::beans::NamedValue stat; stat.Name = ::rtl::OUString::createFromAscii(s_stdStats[i]); sal_Int32 val; @@ -1793,8 +1830,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 +1850,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 +1875,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 +1904,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 +1922,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 +1944,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 +1957,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,12 +1966,11 @@ 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()); checkInit(); } @@ -1946,8 +1982,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 +2000,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 +2013,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 +2048,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); } } @@ -2026,7 +2062,7 @@ SfxDocumentMetaData::loadFromMedium(const ::rtl::OUString & URL, css::uno::Reference<css::io::XInputStream> xIn; ::comphelper::MediaDescriptor md(Medium); // if we have an URL parameter, it replaces the one in the media descriptor - if (!URL.equalsAscii("")) { + if (URL.getLength()) { md[ ::comphelper::MediaDescriptor::PROP_URL() ] <<= URL; } if (sal_True == md.addInputStream()) { @@ -2049,14 +2085,14 @@ 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)); } if (!xStorage.is()) { - throw css::uno::RuntimeException(::rtl::OUString::createFromAscii( - "SfxDocumentMetaData::loadFromMedium: cannot get Storage"), + throw css::uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "SfxDocumentMetaData::loadFromMedium: cannot get Storage")), *this); } loadFromStorage(xStorage, md.getAsConstPropertyValueList()); @@ -2069,7 +2105,7 @@ SfxDocumentMetaData::storeToMedium(const ::rtl::OUString & URL, css::lang::WrappedTargetException, css::io::IOException) { ::comphelper::MediaDescriptor md(Medium); - if (!URL.equalsAscii("")) { + if (URL.getLength()) { md[ ::comphelper::MediaDescriptor::PROP_URL() ] <<= URL; } SfxMedium aMedium(md.getAsConstPropertyValueList()); @@ -2078,8 +2114,8 @@ SfxDocumentMetaData::storeToMedium(const ::rtl::OUString & URL, if (!xStorage.is()) { - throw css::uno::RuntimeException(::rtl::OUString::createFromAscii( - "SfxDocumentMetaData::storeToMedium: cannot get Storage"), + throw css::uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "SfxDocumentMetaData::storeToMedium: cannot get Storage")), *this); } // set MIME type of the storage @@ -2128,14 +2164,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 +2192,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,11 +2210,10 @@ 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); return css::uno::Reference<css::util::XCloneable> (pNew); } @@ -2334,6 +2369,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() { @@ -2367,18 +2428,4 @@ static ::cppu::ImplementationEntry const entries[] = { { 0, 0, 0, 0, 0, 0 } }; -#if 0 -extern "C" void SAL_CALL component_getImplementationEnvironment( - const char ** envTypeName, uno_Environment **) -{ - *envTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - -extern "C" void * SAL_CALL component_getFactory( - const char * implName, void * serviceManager, void * registryKey) -{ - return ::cppu::component_getFactoryHelper( - implName, serviceManager, registryKey, entries); -} -#endif - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/doc.hrc b/sfx2/source/doc/doc.hrc index c3cbf01cfc9a..aca8a3a304fd 100644..100755 --- 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) @@ -76,7 +68,6 @@ #define STR_PRINT_STYLES_HEADER (RID_SFX_DOC_START+ 21) #define MSG_PRINT_ERROR (RID_SFX_DOC_START+ 22) #define STR_BACKUP_COPY (RID_SFX_DOC_START+ 23) -// #define MSG_WARNING_BACKUP (RID_SFX_DOC_START+ 24) #define MSG_CANT_OPEN_TEMPLATE (RID_SFX_DOC_START+ 25) #define MSG_VIEW_OPEN_CANT_SAVE (RID_SFX_DOC_START+ 26) #define STR_ERROR_SAVE (RID_SFX_DOC_START+ 27) @@ -97,7 +88,6 @@ #define MSG_TEMPLATE_DIR_NOT_EXIST (RID_SFX_DOC_START+ 40) #define MSG_DOCINFO_CANTREAD (RID_SFX_DOC_START+ 41) #define STR_ERROR_NOSTORAGE (RID_SFX_DOC_START+ 42) -// #define STR_QUERY_SAVEOWNFORMAT (RID_SFX_DOC_START+ 43) #define STR_QUERY_MUSTOWNFORMAT (RID_SFX_DOC_START+ 44) #define STR_SAVEDOC (RID_SFX_DOC_START+ 45) #define STR_UPDATEDOC (RID_SFX_DOC_START+ 46) @@ -169,18 +159,12 @@ // some icons are commented out since they are removed #define BMP_SIGNATURE (RID_SFX_DOC_START+97) -// #define BMP_128X128_BASE_DOC (RID_SFX_DOC_START+98) #define BMP_128X128_CALC_DOC (RID_SFX_DOC_START+99) -// #define BMP_128X128_CALC_TEMP (RID_SFX_DOC_START+100) #define BMP_128X128_CHART_DOC (RID_SFX_DOC_START+101) #define BMP_128X128_DRAW_DOC (RID_SFX_DOC_START+102) -// #define BMP_128X128_DRAW_TEMP (RID_SFX_DOC_START+103) #define BMP_128X128_IMPRESS_DOC (RID_SFX_DOC_START+104) -// #define BMP_128X128_IMPRESS_TEMP (RID_SFX_DOC_START+105) -// #define BMP_128X128_MASTER_DOC (RID_SFX_DOC_START+106) #define BMP_128X128_MATH_DOC (RID_SFX_DOC_START+107) #define BMP_128X128_WRITER_DOC (RID_SFX_DOC_START+108) -// #define BMP_128X128_WRITER_TEMP (RID_SFX_DOC_START+109) #define STR_HIDDENINFO_CONTAINS (RID_SFX_DOC_START+110) #define STR_HIDDENINFO_RECORDCHANGES (RID_SFX_DOC_START+111) @@ -193,9 +177,7 @@ #define STR_HIDDENINFO_CONTINUE_SIGNING (RID_SFX_DOC_START+118) #define STR_HIDDENINFO_CONTINUE_CREATEPDF (RID_SFX_DOC_START+119) -// #define MSG_WARNING_MACRO_ISDISABLED (RID_SFX_DOC_START+120) #define STR_NEW_FILENAME_SAVE (RID_SFX_DOC_START+121) -// #define STR_MACROS_DISABLED (RID_SFX_DOC_START+122) #define STR_ERROR_DELETE_TEMPLATE_DIR (RID_SFX_DOC_START+123) #define STR_DOCINFO_INFOFIELD (RID_SFX_DOC_START+124) diff --git a/sfx2/source/doc/doc.src b/sfx2/source/doc/doc.src index bbf3ccb33253..c13ae3d5ecd1 100644..100755 --- a/sfx2/source/doc/doc.src +++ b/sfx2/source/doc/doc.src @@ -28,7 +28,7 @@ #include "doc.hrc" #define __RSC #include <svl/inetdef.hxx> -//#include <so3/so2defs.hxx> + // ----------------------------------------------------------------------- QueryBox MSG_CONFIRM_FILTER @@ -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 ; @@ -191,8 +183,6 @@ InfoBox MSG_DOCINFO_CANTREAD }; String STR_ERROR_NOSTORAGE { - /* ### ACHTUNG: Neuer Text in Resource? Die ausgew�hlte Datei besitzt ein falsches Format. : Die ausgew�hlte Datei besitzt ein falsches Format. */ - /* ### ACHTUNG: Neuer Text in Resource? Die ausgew�hlte Datei besitzt ein falsches Format. : Die ausgew�hlte Datei besitzt ein falsches Format. */ Text [ en-US ] = "The selected file has an incorrect format." ; }; String STR_QUERY_MUSTOWNFORMAT @@ -221,8 +211,6 @@ String STR_CLOSEDOC }; String STR_CLOSEDOC_ANDRETURN { - /* ### ACHTUNG: Neuer Text in Resource? S~chlie�en & zur�ck zu : S~chlie�en & zur�ck zu */ - /* ### ACHTUNG: Neuer Text in Resource? S~chlie�en & zur�ck zu : S~chlie�en & zur�ck zu */ Text [ en-US ] = "~Close & Return to " ; }; String STR_WIZARD diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx index 1ef90b67b173..c0e5bba2803b 100644..100755 --- 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. @@ -73,8 +74,6 @@ DECL_PTRARRAY( SfxViewFactoryArr_Impl, SfxViewFactory*, 2, 2 ) DBG_NAME(SfxObjectFactory) -//static SfxObjectFactoryArr_Impl* pObjFac = 0; - //======================================================================== struct SfxObjectFactory_Impl @@ -212,16 +211,16 @@ void SfxObjectFactory::SetModule_Impl( SfxModule *pMod ) void SfxObjectFactory::SetSystemTemplate( const String& rServiceName, const String& rTemplateName ) { static const int nMaxPathSize = 16000; - static ::rtl::OUString SERVICE_FILTER_FACTORY = ::rtl::OUString::createFromAscii( "com.sun.star.document.FilterFactory" ); - static ::rtl::OUString SERVICE_TYPE_DECTECTION = ::rtl::OUString::createFromAscii( "com.sun.star.document.TypeDetection" ); - static ::rtl::OUString SERVICE_SIMPLE_ACCESS = ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ); + static ::rtl::OUString SERVICE_FILTER_FACTORY(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.FilterFactory")); + static ::rtl::OUString SERVICE_TYPE_DECTECTION(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.TypeDetection")); + static ::rtl::OUString SERVICE_SIMPLE_ACCESS(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess")); - static ::rtl::OUString CONF_ROOT = ::rtl::OUString::createFromAscii( "/org.openoffice.Setup"); - static ::rtl::OUString CONF_PATH = ::rtl::OUString::createFromAscii( "Office/Factories/" ) + ::rtl::OUString( rServiceName ); - static ::rtl::OUString PROP_DEF_TEMPL_CHANGED = ::rtl::OUString::createFromAscii( "ooSetupFactorySystemDefaultTemplateChanged" ); - static ::rtl::OUString PROP_ACTUAL_FILTER = ::rtl::OUString::createFromAscii( "ooSetupFactoryActualFilter" ); + static ::rtl::OUString CONF_ROOT(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Setup")); + static ::rtl::OUString CONF_PATH = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Office/Factories/" )) + ::rtl::OUString( rServiceName ); + static ::rtl::OUString PROP_DEF_TEMPL_CHANGED(RTL_CONSTASCII_USTRINGPARAM("ooSetupFactorySystemDefaultTemplateChanged")); + static ::rtl::OUString PROP_ACTUAL_FILTER(RTL_CONSTASCII_USTRINGPARAM("ooSetupFactoryActualFilter")); - static ::rtl::OUString DEF_TPL_STR = ::rtl::OUString::createFromAscii("/soffice."); + static ::rtl::OUString DEF_TPL_STR(RTL_CONSTASCII_USTRINGPARAM("/soffice.")); String sURL; String sPath; @@ -253,11 +252,11 @@ void SfxObjectFactory::SetSystemTemplate( const String& rServiceName, const Stri uno::Sequence< beans::PropertyValue > aActuralFilterData; xFilterFactory->getByName( aActualFilter ) >>= aActuralFilterData; for ( sal_Int32 nInd = 0; nInd < aActuralFilterData.getLength(); nInd++ ) - if ( aActuralFilterData[nInd].Name.equalsAscii( "Type" ) ) + if ( aActuralFilterData[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Type" ) ) ) aActuralFilterData[nInd].Value >>= aActualFilterTypeName; ::comphelper::SequenceAsHashMap aProps1( xTypeDetection->getByName( aActualFilterTypeName ) ); uno::Sequence< ::rtl::OUString > aAllExt = - aProps1.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii( "Extensions" ), uno::Sequence< ::rtl::OUString >() ); + aProps1.getUnpackedValueOrDefault( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Extensions")), uno::Sequence< ::rtl::OUString >() ); //To-do: check if aAllExt is empty first ::rtl::OUString aExt = aAllExt[0]; @@ -269,7 +268,7 @@ void SfxObjectFactory::SetSystemTemplate( const String& rServiceName, const Stri ::rtl::OUString aBackupURL; ::osl::Security().getConfigDir(aBackupURL); - aBackupURL += ::rtl::OUString::createFromAscii( "/temp" ); + aBackupURL += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/temp")); if ( !xSimpleFileAccess->exists( aBackupURL ) ) xSimpleFileAccess->createFolder( aBackupURL ); @@ -285,21 +284,21 @@ void SfxObjectFactory::SetSystemTemplate( const String& rServiceName, const Stri uno::Reference< document::XTypeDetection > xTypeDetector( xTypeDetection, uno::UNO_QUERY ); ::comphelper::SequenceAsHashMap aProps2( xTypeDetection->getByName( xTypeDetector->queryTypeByURL( rTemplateName ) ) ); ::rtl::OUString aFilterName = - aProps2.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii("PreferredFilter"), ::rtl::OUString() ); + aProps2.getUnpackedValueOrDefault( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PreferredFilter")), ::rtl::OUString() ); uno::Sequence< beans::PropertyValue > aArgs( 3 ); - aArgs[0].Name = ::rtl::OUString::createFromAscii( "FilterName" ); + aArgs[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FilterName")); aArgs[0].Value <<= aFilterName; - aArgs[1].Name = ::rtl::OUString::createFromAscii( "AsTemplate" ); + aArgs[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AsTemplate")); aArgs[1].Value <<= sal_True; - aArgs[2].Name = ::rtl::OUString::createFromAscii( "URL" ); + aArgs[2].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL")); aArgs[2].Value <<= ::rtl::OUString( rTemplateName ); uno::Reference< frame::XLoadable > xLoadable( xFactory->createInstance( ::rtl::OUString( rServiceName ) ), uno::UNO_QUERY ); xLoadable->load( aArgs ); aArgs.realloc( 2 ); - aArgs[1].Name = ::rtl::OUString::createFromAscii( "Overwrite" ); + aArgs[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Overwrite")); aArgs[1].Value <<= sal_True; uno::Reference< frame::XStorable > xStorable( xLoadable, uno::UNO_QUERY ); @@ -348,37 +347,6 @@ String SfxObjectFactory::GetStandardTemplate( const String& rServiceName ) return sTemplate; } -/* -const SfxObjectFactory* SfxObjectFactory::GetFactory( const String& rFactoryURL ) -{ - const SfxObjectFactory* pFactory = 0; - String aFact( rFactoryURL ); - String aPrefix( DEFINE_CONST_UNICODE( "private:factory/" ) ); - if ( aPrefix.Len() == aFact.Match( aPrefix ) ) - // Aufruf m"oglich mit z.B. "swriter" oder "private:factory/swriter" - aFact.Erase( 0, aPrefix.Len() ); - sal_uInt16 nPos = aFact.Search( '?' ); - - // Etwaige Parameter abschneiden - aFact.Erase( nPos, aFact.Len() ); - - SfxApplication *pApp = SFX_APP(); - - // "swriter4" durch "swriter" ersetzen, zum Vergleichen uppercase verwenden - WildCard aSearchedFac( aFact.EraseAllChars('4').ToUpperAscii() ); - for( sal_uInt16 n = GetObjectFactoryCount_Impl(); !pFactory && n--; ) - { - pFactory = &GetObjectFactory_Impl( n ); - String aCompareTo = String::CreateFromAscii( pFactory->GetShortName() ); - aCompareTo.ToUpperAscii(); - if( !aSearchedFac.Matches( aCompareTo ) ) - pFactory = 0; - } - - return pFactory; -} -*/ - const SfxFilter* SfxObjectFactory::GetTemplateFilter() const { sal_uInt16 nVersion=0; @@ -438,8 +406,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 { @@ -489,3 +457,5 @@ SfxViewFactory* SfxObjectFactory::GetViewFactoryByViewName( const String& i_rVie } return NULL; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 63b116ef75e8..695d3af6e31f 100644..100755 --- 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,9 +84,7 @@ #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> #include <svl/eitem.hxx> #include <svl/lckbitem.hxx> @@ -147,14 +144,11 @@ 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 -sal_Bool IsReadonlyAccordingACL( const sal_Unicode* pFilePath ); - //========================================================== namespace { @@ -538,7 +532,7 @@ Reference < XContent > SfxMedium::GetContent() const } else { - // TODO: DBG_ERROR("SfxMedium::GetContent()\nCreate Content? This code exists as fallback only. Please clarify, why its used."); + // TODO: OSL_FAIL("SfxMedium::GetContent()\nCreate Content? This code exists as fallback only. Please clarify, why its used."); String aURL; if ( aName.Len() ) ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aName, aURL ); @@ -693,8 +687,6 @@ sal_Bool SfxMedium::CloseOutStream_Impl() //maybe we need a new flag when the storage was created from the outstream if ( pImp->xStorage.is() ) { - //const SvStream *pStorage = aStorage->GetSvStream(); - //if ( pStorage == pOutStream ) CloseStorage(); } @@ -777,7 +769,7 @@ sal_Bool SfxMedium::IsStorage() String aURL; if ( !::utl::LocalFileHelper::ConvertPhysicalNameToURL( aName, aURL ) ) { - DBG_ERROR("Physical name not convertable!"); + OSL_FAIL("Physical name not convertable!"); } pImp->bIsStorage = SotStorage::IsStorageFile( aURL ) && !SotStorage::IsOLEStorage( aURL); if ( !pImp->bIsStorage ) @@ -1017,135 +1009,164 @@ 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 ) ) ) + if ( !GetURLObject().HasError() ) try { - // 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(); - } - - sal_Bool bResult = pImp->m_bLocked; + 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 ) - { - // 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() ); - } + bResult = pImp->m_bLocked; - if ( !bResult && !IsReadOnly() ) - { - sal_Bool bContentReadonly = sal_False; - if ( bLoading && ::utl::LocalFileHelper::IsLocalFile( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ) ) + if ( !bResult ) { - // 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(); + // 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() ); } - // "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() ) + if ( !bResult && !IsReadOnly() ) { - 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 ) - {} - if ( !bContentReadonly ) + // "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() ) { - // the file is not readonly, check the ACL + 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 ) + {} - String aPhysPath; - if ( ::utl::LocalFileHelper::ConvertURLToPhysicalName( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ), aPhysPath ) ) - bContentReadonly = IsReadonlyAccordingACL( aPhysPath.GetBuffer() ); +#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 ) + { + // 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 } - } - // 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 ) ) + // do further checks only if the file not readonly in fs + if ( !bContentReadonly ) { - - // in case of storing the document should request the output before locking - if ( bLoading ) + // the special file locking should be used only for suitable URLs + if ( isSuitableProtocolForLocking( aLogicName ) ) { - // let the stream be opened to check the system file locking - GetMedium_Impl(); - } - sal_Int8 bUIStatus = LOCK_UI_NOLOCK; + // 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(); + } - // check whether system file locking has been used, the default value is false - sal_Bool bUseSystemLock = IsSystemFileLockingUsed(); + sal_Int8 bUIStatus = LOCK_UI_NOLOCK; - // 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 ); + // check whether system file locking has been used, the default value is false + sal_Bool bUseSystemLock = ::utl::LocalFileHelper::IsLocalFile( aLogicName ) && IsSystemFileLockingUsed(); - do - { - try + // 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 ); + + do { - ::svt::DocumentLockFile aLockFile( aLogicName ); - if ( !bHandleSysLocked ) + try { - 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() ) + // 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() ) { - ::rtl::Reference< ::ucbhelper::InteractionRequest > xIgnoreRequestImpl - = new ::ucbhelper::InteractionRequest( uno::makeAny( document::LockFileIgnoreRequest() ) ); + bResult = sal_True; + // take the ownership over the lock file + aLockFile.OverwriteOwnLockFile(); + } + else if ( e.Code == IOErrorCode_INVALID_PARAMETER ) + { + // 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() ) ); - 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 ); + 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 ); - xHandler->handle( xIgnoreRequestImpl.get() ); + xHandler->handle( xIgnoreRequestImpl.get() ); - ::rtl::Reference< ::ucbhelper::InteractionContinuation > xSelected = xIgnoreRequestImpl->getSelection(); - bResult = ( uno::Reference< task::XInteractionApprove >( xSelected.get(), uno::UNO_QUERY ).is() ); + ::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,89 +1174,83 @@ 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 ) - { - uno::Sequence< ::rtl::OUString > aData; - try + if ( !bResult ) { - // 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 ) - { - 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] ) ) + if ( !bHandleSysLocked ) { - // 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; - } - else - { - // this is no file URL, check whether the file is readonly - bResult = !bContentReadonly; + 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 + 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, sal_False ); - if ( !bLoading || (pReadOnlyItem && !pReadOnlyItem->GetValue()) ) - SetError( ERRCODE_IO_ACCESSDENIED, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); - 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 ); + if ( !bLoading || (pReadOnlyItem && !pReadOnlyItem->GetValue()) ) + SetError( ERRCODE_IO_ACCESSDENIED, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + 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 ); + } + catch( uno::Exception& ) + { + OSL_ENSURE( sal_False, "Unexpected problem by locking, high probability, that the content could not be created" ); + } return bResult; } @@ -1275,9 +1290,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 @@ -1411,8 +1426,6 @@ uno::Reference< embed::XStorage > SfxMedium::GetZipStorageToSign_Impl( sal_Bool { if ( !GetError() && !pImp->m_xZipStorage.is() ) { - // very careful!!! - // if bReadOnly == sal_False and there is no temporary file the original file might be used GetMedium_Impl(); try @@ -1659,7 +1672,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; @@ -1861,7 +1874,7 @@ void SfxMedium::Transfer_Impl() } else { - DBG_ERROR( "Illegal Output stream parameter!\n" ); + OSL_FAIL( "Illegal Output stream parameter!\n" ); SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); } @@ -2167,7 +2180,6 @@ void SfxMedium::ClearBackup_Impl() if ( pImp->m_aBackupURL.getLength() ) { if ( ::utl::UCBContentHelper::Kill( pImp->m_aBackupURL ) ) - // || !::utl::UCBContentHelper::IsDocument( pImp->m_aBackupURL ) ); { pImp->m_bRemoveBackup = sal_False; pImp->m_aBackupURL = ::rtl::OUString(); @@ -2175,7 +2187,7 @@ void SfxMedium::ClearBackup_Impl() else { - DBG_ERROR("Couldn't remove backup file!"); + OSL_FAIL("Couldn't remove backup file!"); } } } @@ -2255,7 +2267,7 @@ void SfxMedium::GetMedium_Impl() { if ( !::utl::LocalFileHelper::ConvertPhysicalNameToURL( aName, aFileName ) ) { - DBG_ERROR("Physical name not convertable!"); + OSL_FAIL("Physical name not convertable!"); } } else @@ -2280,8 +2292,6 @@ void SfxMedium::GetMedium_Impl() pImp->xInputStream->skipBytes(0); if(m_bIsReadOnly) GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, sal_True ) ); - - // m_xInputStreamToLoadFrom = 0; } else { @@ -2346,7 +2356,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 ); } } @@ -2428,7 +2439,7 @@ void SfxMedium::Init_Impl() INetProtocol eProt = aUrl.GetProtocol(); if ( eProt == INET_PROT_NOT_VALID ) { - DBG_ERROR ( "Unknown protocol!" ); + OSL_FAIL( "Unknown protocol!" ); } else { @@ -2463,7 +2474,7 @@ void SfxMedium::Init_Impl() || !aLogicName.CompareToAscii( "private:stream", 14 ) == COMPARE_EQUAL ) ) { pSet->ClearItem( SID_OUTPUTSTREAM ); - DBG_ERROR( "Unexpected Output stream parameter!\n" ); + OSL_FAIL( "Unexpected Output stream parameter!\n" ); } if ( aLogicName.Len() ) @@ -2636,27 +2647,6 @@ void SfxMedium::Close() { if ( pImp->xStorage.is() ) { - // don't close the streams if they belong to the - // storage - //TODO/MBA: how to?! Do we need the flag?! - /* - const SvStream *pStream = aStorage->GetSvStream(); - if ( pStream && pStream == pInStream ) - { - CloseZipStorage_Impl(); - pInStream = NULL; - pImp->xInputStream = Reference < XInputStream >(); - pImp->xLockBytes.Clear(); - if ( pSet ) - pSet->ClearItem( SID_INPUTSTREAM ); - aStorage->SetDeleteStream( sal_True ); - } - else if ( pStream && pStream == pOutStream ) - { - pOutStream = NULL; - aStorage->SetDeleteStream( sal_True ); - } */ - CloseStorage(); } @@ -2669,27 +2659,6 @@ void SfxMedium::CloseAndRelease() { if ( pImp->xStorage.is() ) { - // don't close the streams if they belong to the - // storage - //TODO/MBA: how to?! Do we need the flag?! - /* - const SvStream *pStream = aStorage->GetSvStream(); - if ( pStream && pStream == pInStream ) - { - CloseZipStorage_Impl(); - pInStream = NULL; - pImp->xInputStream = Reference < XInputStream >(); - pImp->xLockBytes.Clear(); - if ( pSet ) - pSet->ClearItem( SID_INPUTSTREAM ); - aStorage->SetDeleteStream( sal_True ); - } - else if ( pStream && pStream == pOutStream ) - { - pOutStream = NULL; - aStorage->SetDeleteStream( sal_True ); - } */ - CloseStorage(); } @@ -2784,18 +2753,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() @@ -2809,7 +2766,6 @@ void SfxMedium::SetIsRemote_Impl() case INET_PROT_POP3: case INET_PROT_NEWS: case INET_PROT_IMAP: -// case INET_PROT_OUT: case INET_PROT_VIM: bRemote = sal_True; break; default: @@ -2880,7 +2836,7 @@ sal_Bool SfxMedium::IsTemporary() const sal_Bool SfxMedium::Exists( sal_Bool /*bForceSession*/ ) { - DBG_ERROR( "Not implemented!" ); + OSL_FAIL( "Not implemented!" ); return sal_True; } @@ -2967,12 +2923,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 @@ -3034,13 +2988,6 @@ SfxMedium::SfxMedium( const uno::Reference < embed::XStorage >& rStor, const Str SfxMedium::~SfxMedium() { - /* Attention - Don't enable CancelTransfers() till you know that the writer/web has changed his asynchronous load - behaviour. Otherwhise may StyleSheets inside a html file will be loaded at the right time. - => further the help will be empty then ... #100490# - */ - //CancelTransfers(); - // if there is a requirement to clean the backup this is the last possibility to do it ClearBackup_Impl(); @@ -3053,12 +3000,12 @@ SfxMedium::~SfxMedium() String aTemp; if ( !::utl::LocalFileHelper::ConvertPhysicalNameToURL( aName, aTemp )) { - DBG_ERROR("Physical name not convertable!"); + OSL_FAIL("Physical name not convertable!"); } if ( !::utl::UCBContentHelper::Kill( aTemp ) ) { - DBG_ERROR("Couldn't remove temporary file!"); + OSL_FAIL("Couldn't remove temporary file!"); } } @@ -3095,39 +3042,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 = sal_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 +3121,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 +3161,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 +3183,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 +3271,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 +3477,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 +3846,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 516f6c549b4b..3b82bb5bec59 100644..100755 --- 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. @@ -31,11 +32,10 @@ // INCLUDE --------------------------------------------------------------- #ifdef SOLARIS -// HACK: prevent conflict between STLPORT and Workshop headers on Solaris 8 #include <ctime> #endif -#include <string> // HACK: prevent conflict between STLPORT and Workshop headers +#include <string> #include <sot/exchange.hxx> #include <comphelper/processfactory.hxx> #include <com/sun/star/beans/XPropertySet.hpp> @@ -196,7 +196,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 +249,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 bd23bf5659d0..2f5995c4dbde 100644..100755 --- 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( @@ -291,7 +314,6 @@ uno::Sequence<sal_uInt8> SFX2_DLLPUBLIC convertMetaFile(GDIMetaFile* i_pThumb) // magic value 160 taken from GraphicHelper::getThumbnailFormatFromGDI_Impl() if( i_pThumb->CreateThumbnail( 160, aBitmap ) ) { aBitmap.GetBitmap().Write( aStream, sal_False, sal_False ); -// uno::Sequence<sal_uInt8> aSeq(aStream.GetSize()); // WRONG aStream.Seek(STREAM_SEEK_TO_END); uno::Sequence<sal_uInt8> aSeq(aStream.Tell()); const sal_uInt8* pBlob( @@ -307,3 +329,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 e03f18691a09..9b1ebfeb799e 100644..100755 --- 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; } @@ -248,7 +249,7 @@ IMPL_LINK( DocumentInserter, DialogClosedHdl, sfx2::FileDialogHelper*, EMPTYARG } catch( IllegalArgumentException ) { - DBG_ERROR( "FileDialogHelper_Impl::execute: caught an IllegalArgumentException!" ); + OSL_FAIL( "FileDialogHelper_Impl::execute: caught an IllegalArgumentException!" ); } } @@ -269,7 +270,7 @@ IMPL_LINK( DocumentInserter, DialogClosedHdl, sfx2::FileDialogHelper*, EMPTYARG } catch( IllegalArgumentException ) { - DBG_ERROR( "FileDialogHelper_Impl::execute: caught an IllegalArgumentException!" ); + OSL_FAIL( "FileDialogHelper_Impl::execute: caught an IllegalArgumentException!" ); } } } @@ -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 249ebbaf02ab..c57b048816ed 100644..100755 --- 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 625aff0031fc..847cb15c2082 100644..100755 --- 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 7a3c4a66f443..3d5cf41708c3 100644..100755 --- 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,12 +29,8 @@ // 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> -#ifndef GCC -#endif #include <sfx2/doctdlg.hxx> #include "docvor.hxx" @@ -236,3 +233,4 @@ void SfxDocumentTemplateDlg::NewTemplate(const String &rPath) aRegionLb.GetSelectEntryPos(), GetTemplateName(), rPath); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/doctdlg.hrc b/sfx2/source/doc/doctdlg.hrc index 8deed4699f3b..8deed4699f3b 100644..100755 --- a/sfx2/source/doc/doctdlg.hrc +++ b/sfx2/source/doc/doctdlg.hrc diff --git a/sfx2/source/doc/doctdlg.src b/sfx2/source/doc/doctdlg.src index 1b50fd56c55e..1b50fd56c55e 100644..100755 --- a/sfx2/source/doc/doctdlg.src +++ b/sfx2/source/doc/doctdlg.src diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx index 5b9b03f4b673..d461b3a17fe0 100644..100755 --- 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( sal_uIntPtr 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(); - sal_uIntPtr GetCount() const; + size_t GetCount() const; void SetTitle( const OUString& rTitle ) { maTitle = rTitle; } void AddEntry( const OUString& rTitle, const OUString& rTargetURL, - sal_uInt16 *pPos = NULL ); - void DeleteEntry( sal_uIntPtr 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( sal_uIntPtr nIndex ); + void DeleteRegion( size_t nIndex ); - sal_uIntPtr GetRegionCount() const - { return maRegions.Count(); } + size_t GetRegionCount() const + { return maRegions.size(); } RegionData_Impl* GetRegion( const OUString& rName ) const; - RegionData_Impl* GetRegion( sal_uIntPtr 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, sal_uIntPtr 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; } @@ -316,8 +315,6 @@ static sal_Bool getTextProperty_Impl( Content& rContent, OUString& rPropValue ); //======================================================================== -//======================================================================== -//======================================================================== String SfxDocumentTemplates::GetFullRegionName ( @@ -416,7 +413,7 @@ sal_uInt16 SfxDocumentTemplates::GetRegionNo return USHRT_MAX; sal_Bool bFound; - sal_uIntPtr nIndex = pImp->GetRegionPos( rRegion, bFound ); + size_t nIndex = pImp->GetRegionPos( rRegion, bFound ); if ( bFound ) return (sal_uInt16) nIndex; @@ -763,25 +760,6 @@ String SfxDocumentTemplates::GetDefaultTemplatePath else return String(); -/* dv! missing: create the directory, if it doesn't exists - - - DBG_ASSERT(aDirs.GetTokenCount(cDelim), "Keine Bereiche"); - DirEntry aPath(aDirs.GetToken(0, cDelim)); - - // Verzeichnis anlegen - if(!aPath.MakeDir()) - return String(); - - MakeFileName_Impl(aPath, rLongName, sal_True); - SfxTemplateDir *pEntry = new SfxTemplateDir; - SfxTemplateDirEntryPtr pDirEntry = - new SfxTemplateDirEntry( String( '.' ), aPath.GetPath() ); - pDirEntry->SetContent(new SfxTemplateDir(aPath.GetPath())); - pEntry->Insert(pDirEntry, pEntry->Count()); - pDirs->Insert(pEntry, pDirs->Count()); - return aPath.GetFull(); -*/ } //------------------------------------------------------------------------ @@ -937,21 +915,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 +962,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 +1185,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 +1195,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 +1256,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; } @@ -1790,7 +1757,6 @@ void SfxDocumentTemplates::Construct() // verz"ogerter Aufbau der Verwaltungsdaten { -// pImp->Construct(); } //------------------------------------------------------------------------ @@ -1878,8 +1844,6 @@ sal_Bool SfxDocumentTemplates::HasUserContents( sal_uInt16 nRegion, sal_uInt16 n } // ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- DocTempl_EntryData_Impl::DocTempl_EntryData_Impl( RegionData_Impl* pParent, const OUString& rTitle ) { @@ -2045,9 +2009,6 @@ const OUString& DocTempl_EntryData_Impl::GetTargetURL() } // ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- RegionData_Impl::RegionData_Impl( const SfxDocTemplate_Impl* pParent, const OUString& rTitle ) { @@ -2058,26 +2019,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 - sal_uIntPtr i; - sal_uIntPtr 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 +2050,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 +2061,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 +2088,7 @@ long RegionData_Impl::GetEntryPos( const OUString& rTitle, // ----------------------------------------------------------------------- void RegionData_Impl::AddEntry( const OUString& rTitle, const OUString& rTargetURL, - sal_uInt16 *pPos ) + size_t *pPos ) { INetURLObject aLinkObj( GetHierarchyURL() ); aLinkObj.insertName( rTitle, false, @@ -2140,13 +2096,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 +2112,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 ); } } // ----------------------------------------------------------------------- -sal_uIntPtr RegionData_Impl::GetCount() const +size_t RegionData_Impl::GetCount() const { - return maEntries.Count(); + return maEntries.size(); } // ----------------------------------------------------------------------- @@ -2197,9 +2159,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 +2178,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 +2186,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; - - sal_uIntPtr nCount = maEntries.Count(); - - for ( sal_uIntPtr 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( sal_uIntPtr 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( sal_uIntPtr 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( (sal_uIntPtr) nIndex ); + delete maEntries[ nIndex ]; + vector< DocTempl_EntryData_Impl*>::iterator it = maEntries.begin(); + advance( it, nIndex ); + maEntries.erase( it ); } } @@ -2266,8 +2224,6 @@ int RegionData_Impl::Compare( RegionData_Impl* pCompare ) const } // ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- SfxDocTemplate_Impl::SfxDocTemplate_Impl() : mbConstructed( sal_False ) @@ -2299,38 +2255,35 @@ void SfxDocTemplate_Impl::DecrementLock() } // ----------------------------------------------------------------------- -RegionData_Impl* SfxDocTemplate_Impl::GetRegion( sal_uIntPtr 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 { - sal_uIntPtr nCount = maRegions.Count(); - RegionData_Impl *pData; - - for ( sal_uIntPtr 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( sal_uIntPtr nIndex ) +void SfxDocTemplate_Impl::DeleteRegion( size_t nIndex ) { - RegionData_Impl* pRegion = maRegions.GetObject( nIndex ); - - if ( pRegion ) + if ( nIndex < maRegions.size() ) { - delete pRegion; - maRegions.Remove( (sal_uIntPtr) nIndex ); + delete maRegions[ nIndex ]; + RegionList_Impl::iterator it = maRegions.begin(); + advance( it, nIndex ); + maRegions.erase( it ); } } @@ -2352,8 +2305,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 +2342,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 +2404,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 +2450,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 +2502,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 +2538,29 @@ long SfxDocTemplate_Impl::GetRegionPos( const OUString& rTitle, } // ----------------------------------------------------------------------- -sal_Bool SfxDocTemplate_Impl::InsertRegion( RegionData_Impl *pNew, - sal_uIntPtr 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, (sal_uIntPtr) 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,20 +2640,12 @@ 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(); } // ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- sal_Bool getTextProperty_Impl( Content& rContent, const OUString& rPropName, OUString& rPropValue ) @@ -2737,3 +2683,4 @@ sal_Bool getTextProperty_Impl( Content& rContent, return bGotProperty; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/doctempl.src b/sfx2/source/doc/doctempl.src index 2c91358f845e..2c91358f845e 100644..100755 --- a/sfx2/source/doc/doctempl.src +++ b/sfx2/source/doc/doctempl.src diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index dd6218034bc7..08d7e2b8a404 100644..100755 --- 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,15 +30,13 @@ #include "precompiled_sfx2.hxx" #include "doctemplates.hxx" -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <tools/debug.hxx> #include <tools/diagnose_ex.h> #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> @@ -73,6 +72,8 @@ #include <sfx2/docfile.hxx> #include "doc.hrc" +#include <vector> + //----------------------------------------------------------------------------- //============================================================================= @@ -124,6 +125,8 @@ using namespace ::rtl; using namespace ::ucbhelper; using namespace ::comphelper; +using ::std::vector; + //============================================================================= class WaitWindow_Impl : public WorkWindow @@ -149,13 +152,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> @@ -306,7 +309,7 @@ public: //============================================================================= -class Updater_Impl : public ::vos::OThread +class Updater_Impl : public ::osl::Thread { private: SfxDocTplService_Impl *mpDocTemplates; @@ -360,8 +363,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; @@ -377,8 +379,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; } @@ -387,16 +389,10 @@ public: const OUString& rTargetURL, const OUString& rType, const OUString& rHierURL ); - sal_uIntPtr count() { return maEntries.Count(); } - DocTemplates_EntryData_Impl* getEntry( sal_uIntPtr 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* ) - -//============================================================================= -//============================================================================= -//============================================================================= - //----------------------------------------------------------------------------- // private SfxDocTplService_Impl //----------------------------------------------------------------------------- @@ -473,7 +469,7 @@ void SfxDocTplService_Impl::init_Impl() if ( bNeedsUpdate ) { aGuard.clear(); - ::vos::OClearableGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexClearableGuard aSolarGuard; WaitWindow_Impl* pWin = new WaitWindow_Impl(); @@ -483,7 +479,7 @@ void SfxDocTplService_Impl::init_Impl() update( sal_True ); anotherGuard.clear(); - ::vos::OGuard aSecondSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSecondSolarGuard; delete pWin; } @@ -543,7 +539,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 ) ); @@ -558,7 +554,7 @@ void SfxDocTplService_Impl::readFolderList() pPair->maShortName = aShortNames.GetString( i ); pPair->maLongName = aLongNames.GetString( i ); - maNames.Insert( pPair, LIST_APPEND ); + maNames.push_back( pPair ); } } @@ -566,17 +562,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() ) @@ -705,7 +699,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& ) @@ -1153,9 +1147,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(); } //----------------------------------------------------------------------------- @@ -1236,9 +1235,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() ) @@ -1249,8 +1248,8 @@ void SfxDocTplService_Impl::doUpdate() OUString( RTL_CONSTASCII_USTRINGPARAM( TARGET_DIR_URL ) ), makeAny( pGroup->getTargetURL() ) ); - sal_uIntPtr nCount = pGroup->count(); - for ( sal_uIntPtr 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() ) @@ -1276,10 +1275,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 ); } @@ -1388,11 +1387,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 ); @@ -1601,7 +1600,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 { @@ -1718,7 +1717,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 ); @@ -1824,7 +1823,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() ) @@ -1835,18 +1834,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 ); @@ -1862,13 +1861,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() ) @@ -1879,16 +1878,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() ) @@ -1914,9 +1913,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(); @@ -2221,8 +2220,6 @@ sal_Bool SfxDocTplService_Impl::renameTemplate( const OUString& rGroupName, } //----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- SFX_IMPL_XSERVICEINFO( SfxDocTplService, TEMPLATE_SERVICE_NAME, TEMPLATE_IMPLEMENTATION_NAME ) SFX_IMPL_SINGLEFACTORY( SfxDocTplService ) @@ -2362,8 +2359,6 @@ void SAL_CALL SfxDocTplService::update() pImp->update( sal_True ); } -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- //------------------------------------------------------------------------ Updater_Impl::Updater_Impl( SfxDocTplService_Impl* pTemplates ) @@ -2390,8 +2385,6 @@ void SAL_CALL Updater_Impl::onTerminated() } //----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- WaitWindow_Impl::WaitWindow_Impl() : WorkWindow( NULL, WB_BORDER | WB_3DLOOK ) { @@ -2422,8 +2415,6 @@ void WaitWindow_Impl::Paint( const Rectangle& /*rRect*/ ) } //----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- void SfxDocTplService_Impl::addHierGroup( GroupList_Impl& rList, const OUString& rTitle, const OUString& rOwnURL ) @@ -2433,9 +2424,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 { @@ -2454,7 +2445,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 ); @@ -2519,15 +2510,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 ) @@ -2539,7 +2535,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 { @@ -2607,7 +2603,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 { @@ -2749,8 +2745,6 @@ void SfxDocTplService_Impl::removeFromHierarchy( GroupData_Impl *pGroup ) } // ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- GroupData_Impl::GroupData_Impl( const OUString& rTitle ) { maTitle = rTitle; @@ -2761,12 +2755,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(); } // ----------------------------------------------------------------------- @@ -2775,12 +2766,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 ); @@ -2790,7 +2789,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 { @@ -2814,8 +2813,6 @@ DocTemplates_EntryData_Impl* GroupData_Impl::addEntry( const OUString& rTitle, } // ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- DocTemplates_EntryData_Impl::DocTemplates_EntryData_Impl( const OUString& rTitle ) { maTitle = rTitle; @@ -2922,3 +2919,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 277199d30051..46c1c639159c 100644..100755 --- 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 84b1a9cc9611..720cb62b71c0 100644..100755 --- 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 9b67da63ab74..b714b5816790 100644..100755 --- 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, sal_uInt16 &rRegion, @@ -550,7 +522,7 @@ sal_Bool SfxOrganizeListBox_Impl::Select( SvLBoxEntry* pEntry, sal_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); } @@ -783,7 +755,7 @@ sal_Bool SfxOrganizeListBox_Impl::MoveOrCopyContents(SvLBox *pSourceBox, } if(!bCopy && &aSourceDoc != &aTargetDoc) { - //#109566# pool styles that are moved produce + //pool styles that are moved produce //an rIdx == INDEX_IGNORE //the method has to return true to keep the box content consistent bRemovedFromSource = aSourceDoc->Remove(aSource[nSLevel+1], @@ -792,7 +764,6 @@ sal_Bool SfxOrganizeListBox_Impl::MoveOrCopyContents(SvLBox *pSourceBox, } } } -// rIdx++; return (((rIdx != INDEX_IGNORE)|| bRemovedFromSource) && bOk ) ? bKeepExpansion? (sal_Bool)2: sal_True: sal_False; } @@ -992,12 +963,7 @@ sal_Bool SfxOrganizeListBox_Impl::EditedEntry(SvLBoxEntry* pEntry, const String& ErrorBox( this, aResId ).Execute(); return sal_False; } -/* - else - { - SfxTemplateOrganizeDlg* pDlg = (SfxTemplateOrganizeDlg*)Window::GetParent(); - } -*/ + return sal_True; } @@ -1186,20 +1152,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 +1177,18 @@ void SfxOrganizeListBox_Impl::RequestingChilds( SvLBoxEntry* pEntry ) SfxObjectShellRef aRef = GetObjectShell(aPath); if(aRef.Is()) { - const sal_uInt16 nCount = aRef->GetContentCount( - aPath[nDocLevel+1], aPath[nDocLevel+2]); + const sal_uInt16 nCount = aRef->GetContentCount(aPath[nDocLevel+1]); String aText; Bitmap aClosedBmp, aOpenedBmp; - const sal_Bool bCanHaveChilds = + const bool bCanHaveChilds = aRef->CanHaveChilds(aPath[nDocLevel+1], aPath[nDocLevel+2]); for(sal_uInt16 i = 0; i < nCount; ++i) { 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 +1289,37 @@ sal_uInt16 SfxOrganizeListBox_Impl::GetLevelCount_Impl(SvLBoxEntry* pParent) con //------------------------------------------------------------------------- -SvLBoxEntry* SfxOrganizeListBox_Impl::InsertEntryByBmpType( const XubString& rText, BMPTYPE eBmpType, - SvLBoxEntry* pParent, sal_Bool bChildsOnDemand, sal_uIntPtr nPos, void* pUserData ) +SvLBoxEntry* SfxOrganizeListBox_Impl::InsertEntryByBmpType( + const XubString& rText, + BMPTYPE eBmpType, + SvLBoxEntry* pParent, + sal_Bool bChildsOnDemand, + sal_uIntPtr 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: + OSL_FAIL( "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 +1438,16 @@ const Image &SfxOrganizeListBox_Impl::GetClosedBmp(sal_uInt16 nLevel) const */ { - sal_Bool bHC = GetSettings().GetStyleSettings().GetHighContrastMode(); const Image* pRet = NULL; switch( nLevel ) { - default: DBG_ERROR( "Bitmaps ueberindiziert" ); + default: OSL_FAIL( "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 +1473,16 @@ const Image &SfxOrganizeListBox_Impl::GetOpenedBmp(sal_uInt16 nLevel) const */ { - sal_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 +2106,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 +2431,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 842aa73fb8a3..c17f424a2a90 100644..100755 --- 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 80ebed8b1708..595f349061a2 100644..100755 --- a/sfx2/source/doc/docvor.src +++ b/sfx2/source/doc/docvor.src @@ -53,8 +53,6 @@ ModalDialog DLG_ORGANIZE { Pos = MAP_APPFONT ( 205 , 6 ) ; Size = MAP_APPFONT ( 60 , 14 ) ; - /* ### ACHTUNG: Neuer Text in Resource? Schließen : Schlie˜en */ - /* ### ACHTUNG: Neuer Text in Resource? Schließen : Schlie˜en */ Text [ en-US ] = "Close" ; TabStop = TRUE ; DefButton = TRUE ; @@ -169,8 +167,6 @@ ModalDialog DLG_ORGANIZE { Identifier = ID_DELETE ; HelpId = HID_ORGANIZE_DELETE ; - /* ### ACHTUNG: Neuer Text in Resource? ~Löschen : ~L÷schen */ - /* ### ACHTUNG: Neuer Text in Resource? ~Löschen : ~L÷schen */ Text [ en-US ] = "~Delete" ; AccelKey = KeyCode { @@ -264,57 +260,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 848e042daa45..3dfdd686259c 100644..100755 --- 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. @@ -32,8 +33,6 @@ #include <tools/stream.hxx> #include <vcl/splitwin.hxx> #include <svl/itemset.hxx> -#ifndef GCC -#endif #include <sfx2/frmdescr.hxx> #include <sfx2/app.hxx> @@ -327,3 +326,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 eff1554526ea..15b3cd9b65a1 100644..100755 --- 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 22f8ad5a115e..0fce34e13171 100644..100755 --- 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/graphhelp.src b/sfx2/source/doc/graphhelp.src index 1936a8460d25..1936a8460d25 100644..100755 --- a/sfx2/source/doc/graphhelp.src +++ b/sfx2/source/doc/graphhelp.src diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index 2ccf5fa7a849..e41712c19038 100644..100755 --- 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. @@ -67,6 +68,7 @@ #include <svl/intitem.hxx> #include <unotools/useroptions.hxx> #include <unotools/saveopt.hxx> +#include <svtools/miscopt.hxx> #include <tools/debug.hxx> #include <tools/urlobj.hxx> #include <comphelper/processfactory.hxx> @@ -106,10 +108,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 +142,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(), @@ -229,7 +231,7 @@ public: } catch( uno::Exception& ) { - OSL_ASSERT( "Unexpected exception!" ); + OSL_FAIL( "Unexpected exception!" ); } } } @@ -271,7 +273,7 @@ public: ::comphelper::SequenceAsHashMap& GetMediaDescr() { return m_aMediaDescrHM; } - sal_Bool IsRecommendReadOnly() { return m_bRecommendReadOnly; } + sal_Bool IsRecommendReadOnly() const { return m_bRecommendReadOnly; } const ::comphelper::SequenceAsHashMap& GetDocProps(); @@ -439,19 +441,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 +476,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 +493,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 +507,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 +525,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 +558,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 +642,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 +676,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 +699,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 +733,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 +759,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 +780,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 +793,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 +817,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 +871,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 +883,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 ) @@ -914,7 +921,7 @@ sal_Bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode, { // it is export, set the preselected filter ::rtl::OUString aFilterUIName = aPreselectedFilterPropsHM.getUnpackedValueOrDefault( - ::rtl::OUString::createFromAscii( "UIName" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UIName")), ::rtl::OUString() ); pFileDlg->SetCurrentFilter( aFilterUIName ); } @@ -930,24 +937,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 +968,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 +1095,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 +1115,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 +1125,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 +1149,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 +1206,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 +1217,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 +1260,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 +1290,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 +1337,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 +1431,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 +1442,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 +1462,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 +1490,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 +1531,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 +1578,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 @@ -1611,7 +1618,7 @@ sal_Bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >& bDialogUsed = sal_True; else { - DBG_ERROR( "Can't execute document info dialog!\n" ); + OSL_FAIL( "Can't execute document info dialog!\n" ); } try { @@ -1667,7 +1674,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 +1807,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 0bd63da878a3..0b37de71657a 100644..100755 --- 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. @@ -73,7 +74,6 @@ IFrameWindow_Impl::IFrameWindow_Impl( Window *pParent, sal_Bool bHasBorder, WinB SetBorderStyle( WINDOW_BORDER_NOBORDER ); else SetBorderStyle( WINDOW_BORDER_NORMAL ); - //SetActivateMode( ACTIVATE_MODE_GRABFOCUS ); } void IFrameWindow_Impl::SetBorder( sal_Bool bNewBorder ) @@ -159,7 +159,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 +173,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 +395,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 955d231898f9..8392022dff5b 100644..100755 --- 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,10 +174,9 @@ 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 + // This preview window is for document previews. Therefore // right-to-left mode should be off EnableRTL( sal_False ); } @@ -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; @@ -679,8 +668,6 @@ SfxNewFileDialog_Impl::SfxNewFileDialog_Impl( aPrevTimer.SetTimeout( 500 ); aPrevTimer.SetTimeoutHdl( LINK( this, SfxNewFileDialog_Impl, Update)); -// else -// aRegionLb.InsertEntry(String(SfxResId(STR_STANDARD))); aRegionLb.SelectEntryPos(0); RegionSelect(&aRegionLb); } @@ -739,3 +726,4 @@ void SfxNewFileDialog::SetTemplateFlags(sal_uInt16 nSet) pImpl->SetTemplateFlags(nSet); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/new.hrc b/sfx2/source/doc/new.hrc index dd8878bf0177..dd8878bf0177 100644..100755 --- a/sfx2/source/doc/new.hrc +++ b/sfx2/source/doc/new.hrc diff --git a/sfx2/source/doc/new.src b/sfx2/source/doc/new.src index 6737128cce43..6737128cce43 100644..100755 --- a/sfx2/source/doc/new.src +++ b/sfx2/source/doc/new.src diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index b389f980185d..a43ccd48214e 100644..100755 --- 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. @@ -89,8 +90,6 @@ using namespace ::com::sun::star::uno; //==================================================================== -//==================================================================== - static bool operator> (const util::DateTime& i_rLeft, const util::DateTime& i_rRight) { @@ -118,16 +117,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 +139,6 @@ SfxObjectShell::CreatePreviewMetaFile_Impl( sal_Bool bFullContent, sal_Bool bHig VirtualDevice aDevice; aDevice.EnableOutput( sal_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 +321,9 @@ void SfxObjectShell::SetOrganizerSearchMask( //-------------------------------------------------------------------- -sal_uInt16 SfxObjectShell::GetContentCount( - sal_uInt16 nIdx1, - sal_uInt16 /*nIdx2*/) +sal_uInt16 SfxObjectShell::GetContentCount(sal_uInt16 nIdx) { - switch(nIdx1) + switch(nIdx) { case INDEX_IGNORE: return DEF_CONTENT_COUNT; @@ -346,20 +337,14 @@ sal_uInt16 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(sal_uInt16 nIdx1, sal_uInt16 nIdx2, sal_uInt16) +//TODO/CLEANUP: remove this method +void SfxObjectShell::TriggerHelpPI(sal_uInt16 nIdx1, sal_uInt16 nIdx2) { if(nIdx1==CONTENT_STYLE && nIdx2 != INDEX_IGNORE) //StyleSheets { @@ -368,23 +353,18 @@ void SfxObjectShell::TriggerHelpPI(sal_uInt16 nIdx1, sal_uInt16 nIdx2, sal_uInt } } -sal_Bool SfxObjectShell::CanHaveChilds(sal_uInt16 nIdx1, - sal_uInt16 nIdx2) +sal_Bool SfxObjectShell::CanHaveChilds(sal_uInt16 nIdx1, sal_uInt16 nIdx2) { - switch(nIdx1) { + switch(nIdx1) + { case INDEX_IGNORE: - return sal_True; + return true; case CONTENT_STYLE: - return INDEX_IGNORE == nIdx2 || !GetStyleSheetPool()? sal_False: sal_True; + return INDEX_IGNORE == nIdx2 || !GetStyleSheetPool() ? false : true; case CONTENT_MACRO: -//!! return INDEX_IGNORE == nIdx2? sal_False: sal_True; - return sal_False; -/* - case CONTENT_CONFIG: - return INDEX_IGNORE == nIdx2 ? sal_False : sal_True; - */ + return false; } - return sal_False; + return false; } //-------------------------------------------------------------------- @@ -394,27 +374,12 @@ void SfxObjectShell::GetContent(String &rText, Bitmap &rOpenedBitmap, sal_Bool &bCanDel, sal_uInt16 i, - sal_uInt16 nIdx1, - sal_uInt16 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, - sal_Bool &bCanDel, - sal_uInt16 i, - sal_uInt16 nIdx1, - sal_uInt16 /*nIdx2*/ ) + sal_uInt16 nIdx +) { - bCanDel=sal_True; + bCanDel=true; - switch(nIdx1) + switch(nIdx) { case INDEX_IGNORE: { @@ -425,37 +390,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 +418,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) { sal_uInt16 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: @@ -664,29 +586,7 @@ sal_Bool SfxObjectShell::Insert(SfxObjectShell &rSource, else bRet = sal_False; } -/* - else if (nSourceIdx1 == CONTENT_CONFIG) - { - nIdx1 = CONTENT_CONFIG; - - SfxConfigManager *pCfgMgr = SFX_CFGMANAGER(); - if ( !GetConfigManager() ) - { - SetConfigManager(new SfxConfigManager(0, pCfgMgr)); - SetTemplateConfig(sal_False); - if (this == Current()) - GetConfigManager()->Activate(pCfgMgr); - } - if (GetConfigManager()->CopyItem( - nSourceIdx2, nIdx2, rSource.GetConfigManager())) - { - SetModified(sal_True); - bRet = sal_True; - SFX_APP()->GetDispatcher_Impl()->Update_Impl(sal_True); - } - } -*/ return bRet; } @@ -750,10 +650,6 @@ sal_Bool SfxObjectShell::Print sal_uInt16 /*nIdx3*/, const String* pObjectName ) - -/* [Beschreibung] -*/ - { switch(nIdx1) { @@ -763,7 +659,6 @@ sal_Bool SfxObjectShell::Print SetOrganizerSearchMask(pStylePool); SfxStyleSheetIterator* pIter = pStylePool->CreateIterator( pStylePool->GetSearchFamily(), pStylePool->GetSearchMask() ); - sal_uInt16 nStyles = pIter->Count(); SfxStyleSheetBase *pStyle = pIter->First(); if ( !pStyle ) return sal_True; @@ -793,7 +688,6 @@ sal_Bool SfxObjectShell::Print aOutPos.Y() += nTextHeight; aOutPos.Y() += nTextHeight/2; aFont.SetSize(Size(0, 35)); // 10pt - nStyles = 1; while(pStyle) { // print template name @@ -903,7 +797,6 @@ void SfxObjectShell::LoadStyles { SfxStyleSheetBase *pSource; SfxStyleSheetBase *pDest; -// Styles_Impl () : pSource(0), pDest(0) {} }; SfxStyleSheetBasePool *pSourcePool = rSource.GetStyleSheetPool(); @@ -934,7 +827,6 @@ void SfxObjectShell::LoadStyles for ( sal_uInt16 i = 0; i < nFound; ++i ) { pFound[i].pDest->GetItemSet().PutExtended(pFound[i].pSource->GetItemSet(), SFX_ITEM_DONTCARE, SFX_ITEM_DEFAULT); -// pFound[i].pDest->SetHelpId(pFound[i].pSource->GetHelpId()); if(pFound[i].pSource->HasParentSupport()) pFound[i].pDest->SetParent(pFound[i].pSource->GetParent()); if(pFound[i].pSource->HasFollowSupport()) @@ -1085,7 +977,6 @@ void SfxObjectShell::UpdateFromTemplate_Impl( ) // remember date/time of check xDocProps->setTemplateDate(aTemplDate); // TODO/LATER: new functionality to store document info is required ( didn't work for SO7 XML format ) -//REPLACE pInfo->Save(xDocStor); } } } @@ -1229,3 +1120,4 @@ sal_Bool SfxObjectShell::IsModifyPasswordEntered() return pImp->m_bModifyPasswordEntered; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/objembed.cxx b/sfx2/source/doc/objembed.cxx index a83335ea9fcd..1415377aa429 100644..100755 --- 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. @@ -134,45 +135,6 @@ void SfxObjectShell::SetVisArea( const Rectangle & rVisArea ) SetModified( sal_True ); SFX_APP()->NotifyEvent(SfxEventHint( SFX_EVENT_VISAREACHANGED, GlobalEventConfig::GetEventName(STR_EVENT_VISAREACHANGED), this)); - - /* - Size aSize (GetVisArea().GetSize()); - if ( GetIPEnv() && GetIPEnv()->GetEditWin() ) - ViewChanged( ASPECT_CONTENT ); - */ - - - // OutPlace die Gr"o\se des MDI-Fensters anpassen - // Unbedingt den Gr"o\senvergleich machen, spart nicht nur Zeit, sondern - // vermeidet auch Rundungsfehler ! - /* - // in case of ole outplace editing the frame should be found - SfxViewFrame* pFrameToResize = pFrame ? pFrame : SfxViewFrame::GetFirst( GetObjectShell() ); - - if ( pFrameToResize && !pIPF && rRect.GetSize() != aSize && - !pFrameToResize->IsAdjustPosSizePixelLocked_Impl() ) - - { - // Zuerst die logischen Koordinaten von IP-Objekt und EditWindow - // ber"ucksichtigen - SfxViewShell *pShell = pFrameToResize->GetViewShell(); - Window *pWindow = pShell->GetWindow(); - - // Da in den Applikationen bei der R"ucktransformation immer die - // Eckpunkte tranformiert werden und nicht die Size (um die Ecken - // alignen zu k"onnen), transformieren wir hier auch die Punkte, um - // m"oglichst wenig Rundungsfehler zu erhalten. - Rectangle aRect = pWindow->LogicToPixel( rRect ); - Size aSize = aRect.GetSize(); - pShell->GetWindow()->SetSizePixel( aSize ); - pFrameToResize->DoAdjustPosSizePixel( pShell, Point(), aSize ); - } - - // bei InPlace die View skalieren - if ( GetIPEnv() && GetIPEnv()->GetEditWin() && !bDisableViewScaling && pIPF ) - pIPF->GetEnv_Impl()->MakeScale( rRect.GetSize(), GetMapUnit(), - pIPF->GetViewShell()->GetWindow()->GetOutputSizePixel() ); - */ } } } @@ -232,9 +194,6 @@ void SfxObjectShell::DoDraw( OutputDevice* pDev, Fraction aXF( rSize.Width(), aSize.Width() ); Fraction aYF( rSize.Height(), aSize.Height() ); -//REMOVE Point aOrg = rObjPos; -//REMOVE aMod.SetMapUnit( MAP_100TH_MM ); -//REMOVE aSize = pDev->LogicToLogic( GetVisArea( nAspect ).GetSize(), &aMod, &aWilliMode ); DoDraw_Impl( pDev, rObjPos, aXF, aYF, rSetup, nAspect ); } } @@ -280,9 +239,7 @@ void SfxObjectShell::DoDraw_Impl( OutputDevice* pDev, else pMtf = NULL; } -// #ifndef UNX if( pDev->IsClipRegion() && pDev->GetOutDevType() != OUTDEV_PRINTER ) -// #endif { aRegion = pDev->PixelToLogic( aRegion ); pDev->SetClipRegion( aRegion ); @@ -290,12 +247,7 @@ void SfxObjectShell::DoDraw_Impl( OutputDevice* pDev, if( pMtf ) pMtf->Record( pDev ); -//REMOVE SvOutPlaceObjectRef xOutRef( this ); -//REMOVE if ( xOutRef.Is() ) -//REMOVE xOutRef->DrawObject( pDev, rSetup, rSize, nAspect ); -//REMOVE else Draw( pDev, rSetup, nAspect ); -//REMOVE DrawHatch( pDev, aVisArea.TopLeft(), aVisArea.GetSize() ); // Deviceeinstellungen wieder herstellen pDev->Pop(); @@ -315,3 +267,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 01fb87f29eac..38517d378aae 100644..100755 --- 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, sal_uInt8 /*nMemberId*/ ) const +bool SfxObjectShellItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const { if ( pObjSh ) { @@ -76,12 +73,12 @@ sal_Bool SfxObjectShellItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uIn { rVal <<= ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >(); } - return sal_True; + return true; } //-------------------------------------------------------------------- -sal_Bool SfxObjectShellItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) +bool SfxObjectShellItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) { // This item MUST have a model. Please don't change this, there are UNO-based // implementations which need it!! @@ -100,16 +97,16 @@ sal_Bool SfxObjectShellItem::PutValue( const com::sun::star::uno::Any& rVal, sal if ( nHandle ) { pObjSh = reinterpret_cast< SfxObjectShell* >(sal::static_int_cast<sal_IntPtr>( nHandle )); - return sal_True; + return true; } } } pObjSh = 0; - return sal_True; + return true; } - return sal_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 d961c2df3aef..e03d0a8813c3 100644..100755 --- 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. @@ -28,15 +29,13 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" -#ifndef _INETMSG_HXX //autogen #include <svl/inetmsg.hxx> -#endif #include <tools/diagnose_ex.h> #include <svl/eitem.hxx> #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 +47,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> @@ -63,15 +60,11 @@ #include <com/sun/star/util/XModifiable.hpp> #include <com/sun/star/container/XChild.hpp> #include <com/sun/star/ucb/XSimpleFileAccess.hpp> - - #include <com/sun/star/script/provider/XScript.hpp> #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 +91,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 +169,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 }, @@ -238,25 +227,6 @@ void SfxObjectShell::FlushDocInfo() sal_Int32 delay(xDocProps->getAutoloadSecs()); SetAutoLoad( INetURLObject(url), delay * 1000, (delay > 0) || url.getLength() ); -/* - // bitte beachten: - // 1. Titel in DocInfo aber nicht am Doc (nach HTML-Import) - // => auch am Doc setzen - // 2. Titel in DocInfo leer (Briefumschlagsdruck) - // => nicht am Doc setzen, da sonst "unbenanntX" daraus wird - String aDocInfoTitle = GetDocInfo().GetTitle(); - if ( aDocInfoTitle.Len() ) - SetTitle( aDocInfoTitle ); - else - { - pImp->aTitle.Erase(); - SetNamedVisibility_Impl(); - if ( GetMedium() ) - { - SfxShell::SetName( GetTitle(SFX_TITLE_APINAME) ); - Broadcast( SfxSimpleHint(SFX_HINT_TITLECHANGED) ); - } - }*/ } //------------------------------------------------------------------------- @@ -464,8 +434,6 @@ void SfxObjectShell::SetReadOnlyUI( sal_Bool bReadOnly ) if ( bWasRO != IsReadOnly() ) { Broadcast( SfxSimpleHint(SFX_HINT_MODECHANGED) ); - //if ( pImp->pDocInfo ) - // pImp->pDocInfo->SetReadOnly( IsReadOnly() ); } } @@ -509,12 +477,10 @@ sal_Bool SfxObjectShell::IsInModalMode() const return pImp->bModalMode || pImp->bRunningMacro; } -//<!--Added by PengYunQuan for Validity Cell Range Picker sal_Bool SfxObjectShell::AcceptStateUpdate() const { return !IsInModalMode(); } -//-->Added by PengYunQuan for Validity Cell Range Picker //------------------------------------------------------------------------- @@ -830,17 +796,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 ) { @@ -850,9 +805,6 @@ void SfxObjectShell::SetTitle // Title setzen pImp->aTitle = rTitle; -// Wieso denn in der DocInfo? -// GetDocInfo().SetTitle( rTitle ); -// FlushDocInfo(); // Benachrichtigungen if ( GetMedium() ) @@ -929,19 +881,10 @@ String SfxObjectShell::GetTitle */ { -// if ( GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ) -// return String(); SfxMedium *pMed = GetMedium(); if ( IsLoading() ) return String(); -/* if ( !nMaxLength && pImp->pDocInfo ) - { - String aTitle = pImp->pDocInfo->GetTitle(); - if ( aTitle.Len() ) - return aTitle; - } */ - // Titel erzeugen? if ( SFX_TITLE_DETECT == nMaxLength && !pImp->aTitle.Len() ) { @@ -1082,8 +1025,6 @@ void SfxObjectShell::InvalidateName() { // Title neu erzeugen pImp->aTitle.Erase(); -// pImp->nVisualDocumentNumber = USHRT_MAX; - //GetTitle( SFX_TITLE_DETECT ); SetName( GetTitle( SFX_TITLE_APINAME ) ); // Benachrichtigungen @@ -1596,14 +1537,6 @@ void SfxObjectShell::CancelTransfers() AbortImport(); if( IsLoading() ) FinishedLoading( SFX_LOADED_ALL ); - -/* - SfxViewFrame* pFrame = SfxViewFrame::GetFirst( this ); - while( pFrame ) - { - pFrame->CancelTransfers(); - pFrame = SfxViewFrame::GetNext( *pFrame, this ); - }*/ } } @@ -1694,7 +1627,7 @@ namespace } ErrCode SfxObjectShell::CallXScript( const Reference< XInterface >& _rxScriptContext, const ::rtl::OUString& _rScriptURL, - const Sequence< Any >& aParams, Any& aRet, Sequence< sal_Int16 >& aOutParamIndex, Sequence< Any >& aOutParam, bool bRaiseError ) + const Sequence< Any >& aParams, Any& aRet, Sequence< sal_Int16 >& aOutParamIndex, Sequence< Any >& aOutParam, bool bRaiseError, const ::com::sun::star::uno::Any* pCaller ) { OSL_TRACE( "in CallXScript" ); ErrCode nErr = ERRCODE_NONE; @@ -1728,6 +1661,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& ) @@ -1760,10 +1703,10 @@ ErrCode SfxObjectShell::CallXScript( const String& rScriptURL, aParams, ::com::sun::star::uno::Any& aRet, ::com::sun::star::uno::Sequence< sal_Int16 >& aOutParamIndex, - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aOutParam - , bool bRaiseError ) + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& + aOutParam, bool bRaiseError, const ::com::sun::star::uno::Any* pCaller ) { - return CallXScript( GetModel(), rScriptURL, aParams, aRet, aOutParamIndex, aOutParam, bRaiseError ); + return CallXScript( GetModel(), rScriptURL, aParams, aRet, aOutParamIndex, aOutParam, bRaiseError, pCaller ); } //------------------------------------------------------------------------- @@ -1829,7 +1772,6 @@ void SfxHeaderAttributes_Impl::SetAttribute( const SvKeyValue& rKV ) } else { -// DBG_ERROR( "Schlechtes ::com::sun::star::util::DateTime fuer Expired" ); pDoc->GetMedium()->SetExpired_Impl( Date( 1, 1, 1970 ) ); } } @@ -1929,7 +1871,6 @@ sal_Bool SfxObjectShell::IsSecure() return sal_False; if ( aOpt.IsSecureURL( aURL.GetMainURL( INetURLObject::NO_DECODE ), aReferer ) ) - //if ( SvtSecurityOptions().IsSecureURL( aURL.GetMainURL( INetURLObject::NO_DECODE ), aReferer ) ) { if ( GetMedium()->GetContent().is() ) { @@ -2411,3 +2352,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 73d836938183..9710836a3517 100644..100755 --- 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. @@ -63,8 +64,9 @@ #include <basic/sbx.hxx> #include <unotools/pathoptions.hxx> #include <unotools/useroptions.hxx> -#include <svtools/asynclink.hxx> #include <unotools/saveopt.hxx> +#include <svtools/asynclink.hxx> +#include <svtools/miscopt.hxx> #include <comphelper/documentconstants.hxx> #include <sfx2/app.hxx> @@ -83,7 +85,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" @@ -938,14 +939,16 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet) if ( !pFrame || !pDoc->HasName() || !IsOwnStorageFormat_Impl( *pDoc->GetMedium() ) ) -//REMOVE || pDoc->GetMedium()->GetStorage()->GetVersion() < SOFFICE_FILEFORMAT_50 ) rSet.DisableItem( nWhich ); break; } case SID_SAVEDOC: { - sal_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 @@ -984,18 +987,6 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet) rSet.DisableItem( nWhich ); break; } -/* - const SfxFilter* pCombinedFilters = NULL; - SfxFilterContainer* pFilterContainer = GetFactory().GetFilterContainer(); - - if ( pFilterContainer ) - { - SfxFilterFlags nMust = SFX_FILTER_IMPORT | SFX_FILTER_EXPORT; - SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED | SFX_FILTER_INTERNAL; - - pCombinedFilters = pFilterContainer->GetAnyFilter( nMust, nDont ); - } -*/ if ( /*!pCombinedFilters ||*/ !GetMedium() ) rSet.DisableItem( nWhich ); else @@ -1006,31 +997,12 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet) case SID_EXPORTDOCASPDF: case SID_DIRECTEXPORTDOCASPDF: { - /* - - search for filter cant work correctly ... - Because it's not clear, which export filter for which office module - must be searched. On the other side it can be very expensive doing so. - The best solution would be: on installation time we should know if pdf feature - was installed or not!!! (e.g. by writing a bool inside cfg) - - SfxFilterContainer* pFilterContainer = GetFactory().GetFilterContainer(); - if ( pFilterContainer ) - { - String aPDFExtension = String::CreateFromAscii( "pdf" ); - const SfxFilter* pFilter = pFilterContainer->GetFilter4Extension( aPDFExtension, SFX_FILTER_EXPORT ); - if ( pFilter != NULL ) - break; - } - - rSet.DisableItem( nWhich ); - */ break; } case SID_DOC_MODIFIED: { - rSet.Put( SfxStringItem( SID_DOC_MODIFIED, IsModified() ? '*' : ' ' ) ); + rSet.Put( SfxBoolItem( SID_DOC_MODIFIED, IsModified() ) ); break; } @@ -1145,7 +1117,7 @@ void SfxObjectShell::StateProps_Impl(SfxItemSet &rSet) case SID_DOCPATH: { - DBG_ERROR( "Not supported anymore!" ); + OSL_FAIL( "Not supported anymore!" ); break; } @@ -1506,3 +1478,5 @@ const uno::Sequence<sal_Int8>& SfxObjectShell::getUnoTunnelId() } return *pSeq; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 9a86e962cac6..673e56b2263a 100644..100755 --- 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,9 +29,7 @@ // 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> #include <svl/stritem.hxx> #include <svl/intitem.hxx> @@ -164,7 +163,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 +237,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(), @@ -306,7 +305,7 @@ sal_Bool SfxObjectShell::PutURLContentsToVersionStream_Impl( } catch ( uno::Exception& ) { - DBG_ERROR( "Creation of a storage copy is failed!" ); + OSL_FAIL( "Creation of a storage copy is failed!" ); ::utl::UCBContentHelper::Kill( aTempURL ); aTempURL = ::rtl::OUString(); @@ -350,7 +349,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 +368,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 +612,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 +700,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 { @@ -781,8 +783,6 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed ) if( IsOwnStorageFormat_Impl(*pMed) && pMed->GetFilter() ) { -//???? dv DirEntry aDirEntry( pMed->GetPhysicalName() ); -//???? dv SetFileName( aDirEntry.GetFull() ); } Broadcast( SfxSimpleHint(SFX_HINT_NAMECHANGED) ); @@ -810,59 +810,15 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed ) } } - if ( pMedium->HasStorage_Impl() ) - { - uno::Reference< XInteractionHandler > xHandler( pMedium->GetInteractionHandler() ); - if ( xHandler.is() && !SFX_APP()->Get_Impl()->bODFVersionWarningLater ) - { - uno::Reference<beans::XPropertySet> xStorageProps( pMedium->GetStorage(), uno::UNO_QUERY_THROW ); - ::rtl::OUString sVersion; - try - { - xStorageProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ) ) >>= sVersion; - } - catch( const uno::Exception& ) - { - // Custom Property "ODFVersion" does not exist - } - - if ( sVersion.getLength() ) - { - double nVersion = sVersion.toDouble(); - if ( nVersion > 1.20001 && SfxObjectShell_Impl::NeedsOfficeUpdateDialog() ) - // ODF version greater than 1.2 - added some decimal places to be safe against floating point conversion errors (hack) - { - ::rtl::OUString sDocumentURL( pMedium->GetOrigURL() ); - ::rtl::OUString aSystemFileURL; - if ( osl::FileBase::getSystemPathFromFileURL( sDocumentURL, aSystemFileURL ) == osl::FileBase::E_None ) - sDocumentURL = aSystemFileURL; - - FutureDocumentVersionProductUpdateRequest aUpdateRequest; - aUpdateRequest.Classification = InteractionClassification_QUERY; - aUpdateRequest.DocumentURL = sDocumentURL; + const SfxBoolItem* pDdeReconnectItem = static_cast<const SfxBoolItem*>( + SfxRequest::GetItem(pMedium->GetItemSet(), SID_DDE_RECONNECT_ONLOAD, false, TYPE(SfxBoolItem))); - ::rtl::Reference< ::comphelper::OInteractionRequest > pRequest = new ::comphelper::OInteractionRequest( makeAny( aUpdateRequest ) ); - pRequest->addContinuation( new ::comphelper::OInteractionApprove ); - pRequest->addContinuation( new ::comphelper::OInteractionAbort ); + bool bReconnectDde = true; // by default, we try to auto-connect DDE connections. + if (pDdeReconnectItem) + bReconnectDde = pDdeReconnectItem->GetValue(); - typedef ::comphelper::OInteraction< XInteractionAskLater > OInteractionAskLater; - OInteractionAskLater* pLater = new OInteractionAskLater; - pRequest->addContinuation( pLater ); - - 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 +839,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 +854,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; @@ -1075,9 +1031,6 @@ sal_Bool SfxObjectShell::DoSave() bOk = pMedium->Commit(); } -//#88046 -// if ( bOk ) -// SetModified( sal_False ); return bOk; } @@ -1128,7 +1081,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl { // if no filter was set, use the default filter // this should be changed in the feature, it should be an error! - DBG_ERROR("No filter set!"); + OSL_FAIL("No filter set!"); pFilter = GetFactory().GetFilterContainer()->GetAnyFilter( SFX_FILTER_IMPORT | SFX_FILTER_EXPORT ); rMedium.SetFilter(pFilter); } @@ -1363,7 +1316,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& ) @@ -1411,7 +1364,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl } catch( uno::Exception& ) { - DBG_ERROR( "Setting of common encryption key failed!" ); + OSL_FAIL( "Setting of common encryption key failed!" ); SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); } } @@ -1500,7 +1453,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl catch( uno::Exception& ) { AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Preserve versions has failed." ) ) ); - DBG_ERROR( "Couldn't copy versions!\n" ); + OSL_FAIL( "Couldn't copy versions!\n" ); bOk = sal_False; // TODO/LATER: a specific error could be set } @@ -1661,7 +1614,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl { // it should not happen, the copies signature is invalid! // throw the changes away - OSL_ASSERT( "An invalid signature was copied!" ); + OSL_FAIL( "An invalid signature was copied!" ); } } } @@ -1789,7 +1742,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl struct _ea eaType; strcpy( filePath, CHAR_POINTER( aSystemFileURL)); strcpy( docType, CHAR_POINTER( rMedium.GetFilter()->GetServiceName())); -#if OSL_DEBUG_LEVEL>1 +#if OSL_DEBUG_LEVEL > 1 printf( "file name: %s\n", filePath); printf( "filter name: %s\n", CHAR_POINTER(rMedium.GetFilter()->GetFilterName())); printf( "service name: %s\n", docType); @@ -1816,7 +1769,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl eaType.value = &eaAscii; // put EA to file rc = _ea_put( &eaType, filePath, 0, ".TYPE"); -#if OSL_DEBUG_LEVEL>1 +#if OSL_DEBUG_LEVEL > 1 printf( "ea name: %s, rc %d, errno %d\n", eaAscii.szType, rc, errno); #endif } @@ -1927,7 +1880,6 @@ sal_Bool SfxObjectShell::ConnectTmpStorage_Impl( // TODO/LATER: may be it should be done in SwitchPersistence also // TODO/LATER: find faster way to copy storage; perhaps sharing with backup?! xStorage->copyToStorage( xTmpStorage ); - //CopyStoragesOfUnknownMediaType( xStorage, xTmpStorage ); bResult = SaveCompleted( xTmpStorage ); if ( bResult ) @@ -1998,7 +1950,7 @@ sal_Bool SfxObjectShell::DoSaveObjectAs( SfxMedium& rMedium, sal_Bool bCommit ) } catch( uno::Exception& ) { - DBG_ERROR( "The strotage was not commited on DoSaveAs!\n" ); + OSL_FAIL( "The strotage was not commited on DoSaveAs!\n" ); } } } @@ -2035,11 +1987,7 @@ sal_Bool SfxObjectShell::DoSaveCompleted( SfxMedium* pNewMed ) sal_Bool bOk = sal_True; sal_Bool bMedChanged = pNewMed && pNewMed!=pMedium; -/* sal_Bool bCreatedTempStor = pNewMed && pMedium && - IsPackageStorageFormat_Impl(*pMedium) && - !IsPackageStorageFormat_Impl(*pNewMed) && - pMedium->GetName().Len(); -*/ + DBG_ASSERT( !pNewMed || pNewMed->GetError() == ERRCODE_NONE, "DoSaveCompleted: Medium has error!" ); // delete Medium (and Storage!) after all notifications @@ -2277,7 +2225,7 @@ sal_Bool SfxObjectShell::InsertFrom( SfxMedium& rMedium ) } if ( xLoader.is() ) { - // #131744#: it happens that xLoader does not support xImporter! + // it happens that xLoader does not support xImporter! try{ uno::Reference< lang::XComponent > xComp( GetModel(), uno::UNO_QUERY_THROW ); uno::Reference< document::XImporter > xImporter( xLoader, uno::UNO_QUERY_THROW ); @@ -2372,7 +2320,7 @@ sal_Bool SfxObjectShell::ImportFrom( SfxMedium& rMedium ) } if ( xLoader.is() ) { - // #131744#: it happens that xLoader does not support xImporter! + // it happens that xLoader does not support xImporter! try{ uno::Reference< lang::XComponent > xComp( GetModel(), uno::UNO_QUERY_THROW ); uno::Reference< document::XImporter > xImporter( xLoader, uno::UNO_QUERY_THROW ); @@ -2605,7 +2553,6 @@ sal_Bool SfxObjectShell::DoSave_Impl( const SfxItemSet* pArgs ) // writing is done through a copy, that will be transferred to the target ( of course after calling HandsOff ) SfxMedium* pMediumTmp = new SfxMedium( pRetrMedium->GetName(), pRetrMedium->GetOpenMode(), pRetrMedium->IsDirect(), pFilter, pSet ); pMediumTmp->SetLongName( pRetrMedium->GetLongName() ); -// pMediumTmp->CreateTempFileNoCopy(); if ( pMediumTmp->GetErrorCode() != ERRCODE_NONE ) { SetError( pMediumTmp->GetError(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); @@ -2615,10 +2562,6 @@ sal_Bool SfxObjectShell::DoSave_Impl( const SfxItemSet* pArgs ) // copy version list from "old" medium to target medium, so it can be used on saving pMediumTmp->TransferVersionList_Impl( *pRetrMedium ); -/* - if ( pFilter && ( pFilter->GetFilterFlags() & SFX_FILTER_PACKED ) ) - SetError( GetMedium()->Unpack_Impl( pRetrMedium->GetPhysicalName() ), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); -*/ // an interaction handler here can aquire only in case of GUI Saving // and should be removed after the saving is done @@ -2643,6 +2586,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,16 +2718,13 @@ sal_Bool SfxObjectShell::CommonSaveAs_Impl sal_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 ) )); return sal_False; } - // this notification should be already sent by caller in sfxbasemodel - // SFX_APP()->NotifyEvent(SfxEventHint( bSaveTo? SFX_EVENT_SAVETODOC : SFX_EVENT_SAVEASDOC,this)); - if( SFX_ITEM_SET != aParams->GetItemState(SID_UNPACK) && SvtSaveOptions().IsSaveUnpacked() ) aParams->Put( SfxBoolItem( SID_UNPACK, sal_False ) ); @@ -2812,7 +2753,6 @@ sal_Bool SfxObjectShell::CommonSaveAs_Impl pSet->ClearItem( SID_CHARSET ); pSet->ClearItem( SID_FILTER_NAME ); pSet->ClearItem( SID_OPTIONS ); - //pSet->ClearItem( SID_FILE_FILTEROPTIONS ); pSet->ClearItem( SID_VERSION ); pSet->ClearItem( SID_EDITDOC ); pSet->ClearItem( SID_OVERWRITE ); @@ -2891,7 +2831,7 @@ sal_Bool SfxObjectShell::PreDoSaveAs_Impl #ifdef DBG_UTIL if ( pMergedParams->GetItemState( SID_DOC_SALVAGE) >= SFX_ITEM_SET ) - DBG_ERROR("Salvage item present in Itemset, check the parameters!"); + OSL_FAIL("Salvage item present in Itemset, check the parameters!"); #endif // should be unneccessary - too hot to handle! @@ -2928,13 +2868,6 @@ sal_Bool SfxObjectShell::PreDoSaveAs_Impl if ( pImp->bPreserveVersions ) pNewFile->TransferVersionList_Impl( *pMedium ); -/* - if ( GetMedium()->GetFilter() && ( GetMedium()->GetFilter()->GetFilterFlags() & SFX_FILTER_PACKED ) ) - { - SfxMedium *pMed = bCopyTo ? pMedium : pNewFile; - pNewFile->SetError( GetMedium()->Unpack_Impl( pMed->GetPhysicalName() ) , ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); - } -*/ // Save the document ( first as temporary file, then transfer to the target URL by committing the medium ) sal_Bool bOk = sal_False; if ( !pNewFile->GetErrorCode() && SaveTo_Impl( *pNewFile, NULL ) ) @@ -2971,6 +2904,7 @@ sal_Bool SfxObjectShell::PreDoSaveAs_Impl sal_Bool bRet( sal_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 @@ -3001,7 +2935,7 @@ sal_Bool SfxObjectShell::PreDoSaveAs_Impl sal_Bool SfxObjectShell::LoadFrom( SfxMedium& /*rMedium*/ ) { - DBG_ERROR( "Base implementation, must not be called in general!" ); + OSL_FAIL( "Base implementation, must not be called in general!" ); return sal_True; } @@ -3013,9 +2947,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 +3549,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 +3582,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 +3618,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 +3664,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 +3709,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 8573c4afc0f4..639692894267 100644..100755 --- 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> @@ -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 }, @@ -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); } } @@ -740,24 +745,6 @@ void SAL_CALL SfxDocumentInfoObject::setFastPropertyValue(sal_Int32 nHandle, co break; case WID_FROM : { - // QUESTION: do we still need this? - /* - // String aStrVal( sTemp ); - if ( aStrVal.Len() > TIMESTAMP_MAXLENGTH ) - { - SvAddressParser aParser( aStrVal ); - if ( aParser.Count() > 0 ) - { - String aEmail = aParser.GetEmailAddress(0); - String aRealname = aParser.GetRealName(0); - - if ( aRealname.Len() <= TIMESTAMP_MAXLENGTH ) - aStrVal = aRealname; - else if ( aEmail.Len() <= TIMESTAMP_MAXLENGTH ) - aStrVal = aEmail; - } - } */ - if ( _pImp->m_xDocProps->getAuthor() != sTemp ) _pImp->m_xDocProps->setAuthor(sTemp); break; @@ -806,7 +793,22 @@ void SAL_CALL SfxDocumentInfoObject::setFastPropertyValue(sal_Int32 nHandle, co if ( _pImp->m_xDocProps->getDefaultTarget() != sTemp ) _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 +869,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: @@ -1007,7 +1009,7 @@ void SAL_CALL SfxDocumentInfoObject::setFastPropertyValue(sal_Int32 nHandle, co case MID_DOCINFO_AUTOLOADENABLED: aValue <<= static_cast<sal_Bool> ( (_pImp->m_xDocProps->getAutoloadSecs() != 0) - || !(_pImp->m_xDocProps->getAutoloadURL().equalsAscii(""))); + || _pImp->m_xDocProps->getAutoloadURL().getLength()); break; case MID_DOCINFO_AUTOLOADURL: aValue <<= _pImp->m_xDocProps->getAutoloadURL(); @@ -1024,6 +1026,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; @@ -1036,9 +1055,6 @@ void SAL_CALL SfxDocumentInfoObject::setFastPropertyValue(sal_Int32 nHandle, co sal_Int16 SAL_CALL SfxDocumentInfoObject::getUserFieldCount() throw( ::com::sun::star::uno::RuntimeException ) { -// uno::Reference<beans::XPropertyAccess> xPropSet( -// _pImp->m_xDocProps->getUserDefinedProperties(), uno::UNO_QUERY_THROW); -// return xPropSet->getPropertyValues().getLength(); return FOUR; } @@ -1103,7 +1119,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; @@ -1181,7 +1197,6 @@ SfxStandaloneDocumentInfoObject::SfxStandaloneDocumentInfoObject( const ::com::s uno::Reference< lang::XInitialization > xDocProps( _xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.DocumentProperties"))), uno::UNO_QUERY_THROW); -// xDocProps->initialize(uno::Sequence<uno::Any>()); uno::Any a; a <<= xDocProps; uno::Sequence<uno::Any> args(1); @@ -1203,7 +1218,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, @@ -1261,8 +1276,6 @@ void SAL_CALL SfxStandaloneDocumentInfoObject::loadFromURL(const ::rtl::OUStrin uno::Reference< document::XDocumentProperties > xDocProps( _xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.DocumentProperties"))), uno::UNO_QUERY_THROW); -// uno::Reference< lang::XInitialization > xInit(xDocProps, uno::UNO_QUERY_THROW); -// xInit->initialize(uno::Sequence<uno::Any>()); _pImp->Reset(xDocProps); aGuard.clear(); @@ -1272,9 +1285,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 +1325,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 +1361,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 4255e9bd2939..f37bb9f469dd 100644..100755 --- 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,11 @@ #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,8 +125,39 @@ 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( const uno::Exception& ) + { + } + } + } +} //========================================================================= @@ -158,16 +180,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 +243,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) @@ -584,7 +608,6 @@ sal_uInt16 SfxObjectShell::PrepareClose SfxViewFrame *pFrame = SfxObjectShell::Current() == this ? SfxViewFrame::Current() : SfxViewFrame::GetFirst( this ); - sal_Bool bClose = sal_False; if ( bUI && IsModified() && pFrame ) { // minimierte restoren @@ -594,9 +617,6 @@ sal_uInt16 SfxObjectShell::PrepareClose // fragen, ob gespeichert werden soll short nRet = RET_YES; - //TODO/CLEANUP - //brauchen wir UI=2 noch? - //if( SfxApplication::IsPlugin() == sal_False || bUI == 2 ) { //initiate help agent to inform about "print modifies the document" SvtPrintWarningOptions aPrintOptions; @@ -631,8 +651,6 @@ sal_uInt16 SfxObjectShell::PrepareClose if ( !pPoolItem || pPoolItem->ISA(SfxVoidItem) || ( pPoolItem->ISA(SfxBoolItem) && !( (const SfxBoolItem*) pPoolItem )->GetValue() ) ) return sal_False; - else - bClose = sal_True; } else if ( RET_CANCEL == nRet ) // abgebrochen @@ -641,11 +659,6 @@ sal_uInt16 SfxObjectShell::PrepareClose { return RET_NEWTASK; } - else - { - // Bei Nein nicht noch Informationlost - bClose = sal_True; - } } pImp->bPreparedForClose = sal_True; @@ -858,7 +871,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 +905,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 +931,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 +973,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 +1046,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, sal_False); SFX_ITEMSET_ARG(&rSet, pTargetItem, SfxStringItem, SID_TARGETNAME, sal_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 +1070,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; @@ -1124,3 +1155,4 @@ bool SfxObjectShell::GetProtectionHash( /*out*/ ::com::sun::star::uno::Sequence< return false; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/oleprops.cxx b/sfx2/source/doc/oleprops.cxx index 2e0df56ba141..0e6113f94f99 100755 --- 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 5bd586576ac8..d4abac5bac7e 100755 --- 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; @@ -92,7 +97,6 @@ const sal_Int32 CLIPFMT_WIN = -1; const sal_Int32 CLIPDATAFMT_DIB = 8; // ============================================================================ -// ============================================================================ /** Helper for classes that need text encoding settings. @@ -163,8 +167,6 @@ private: void ImplSaveString16( SvStream& rStrm, const String& rValue ) const; }; - -// ============================================================================ // ============================================================================ /** Base class for all classes related to OLE property sets. @@ -208,7 +210,6 @@ private: }; // ============================================================================ -// ============================================================================ /** Base class for all OLE property objects. */ class SfxOlePropertyBase : public SfxOleObjectBase @@ -244,7 +245,6 @@ private: }; // ============================================================================ -// ============================================================================ /** Property containing custom names for other properties in the property set. */ class SfxOleDictionaryProperty : public SfxOlePropertyBase, public SfxOleStringHelper @@ -272,7 +272,6 @@ private: }; // ============================================================================ -// ============================================================================ /** A section in a property set. Contains properties with unique identifiers. */ class SfxOleSection : public SfxOleObjectBase @@ -356,7 +355,6 @@ private: typedef ::boost::shared_ptr< SfxOleSection > SfxOleSectionRef; // ============================================================================ -// ============================================================================ /** Enumerates different section types in OLE property sets. */ enum SfxOleSectionType @@ -402,3 +400,5 @@ private: }; //}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/ownsubfilterservice.cxx b/sfx2/source/doc/ownsubfilterservice.cxx index 9cab42889b6e..de28259e2391 100644..100755 --- 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 8c731845554f..10ba8dc4ede3 100644..100755 --- 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 sal_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 8bf97ba5b435..d0de20f85a77 100755 --- 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. @@ -52,7 +53,7 @@ #include <tools/urlobj.hxx> #include <ucbhelper/content.hxx> #include <cppuhelper/interfacecontainer.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <cppuhelper/implbase1.hxx> #include <sfx2/viewfrm.hxx> @@ -263,7 +264,7 @@ namespace uno::Sequence< beans::PropertyValue > SAL_CALL SfxPrintHelper::getPrinter() throw(::com::sun::star::uno::RuntimeException) { // object already disposed? - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; // search for any view of this document that is currently printing const Printer *pPrinter = NULL; @@ -435,11 +436,11 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue > } } - //os 12.11.98: die PaperSize darf nur gesetzt werden, wenn tatsaechlich + //die PaperSize darf nur gesetzt werden, wenn tatsaechlich //PAPER_USER gilt, sonst koennte vom Treiber ein falsches Format gewaehlt werden if(nPaperFormat == view::PaperFormat_USER && aSetPaperSize.Width()) { - //JP 23.09.98 - Bug 56929 - MapMode von 100mm in die am + //MapMode von 100mm in die am // Device gesetzten umrechnen. Zusaetzlich nur dann // setzen, wenn sie wirklich veraendert wurden. aSetPaperSize = pPrinter->LogicToPixel( aSetPaperSize, MAP_100TH_MM ); @@ -450,7 +451,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue > } } - // #96772#: wait until printing is done + //wait until printing is done SfxPrinter* pDocPrinter = pViewSh->GetPrinter(); while ( pDocPrinter->IsPrinting() ) Application::Yield(); @@ -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 :-) @@ -559,10 +560,10 @@ class ImplUCBPrintWatcher : public ::osl::Thread ::com::sun::star::ucb::NameClash::OVERWRITE); } } - catch( ::com::sun::star::ucb::ContentCreationException& ) { DBG_ERROR("content create exception"); } - catch( ::com::sun::star::ucb::CommandAbortedException& ) { DBG_ERROR("command abort exception"); } - catch( ::com::sun::star::uno::RuntimeException& ) { DBG_ERROR("runtime exception"); } - catch( ::com::sun::star::uno::Exception& ) { DBG_ERROR("unknown exception"); } + catch( ::com::sun::star::ucb::ContentCreationException& ) { OSL_FAIL("content create exception"); } + catch( ::com::sun::star::ucb::CommandAbortedException& ) { OSL_FAIL("command abort exception"); } + catch( ::com::sun::star::uno::RuntimeException& ) { OSL_FAIL("runtime exception"); } + catch( ::com::sun::star::uno::Exception& ) { OSL_FAIL("unknown exception"); } // kill the temp file! delete *ppTempFile; @@ -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() ? @@ -593,8 +594,6 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& SfxViewShell* pView = pViewFrm->GetViewShell(); if ( !pView ) return; - -// SfxAllItemSet aArgs( pView->GetPool() ); sal_Bool bMonitor = sal_False; // We need this information at the end of this method, if we start the vcl printer // by executing the slot. Because if it is a ucb relevant URL we must wait for @@ -648,7 +647,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& aCheckedArgs[nProps++].Value <<= sFileURL; // and append the local filename aCheckedArgs.realloc( aCheckedArgs.getLength()+1 ); - aCheckedArgs[nProps].Name = rtl::OUString::createFromAscii("LocalFileName"); + aCheckedArgs[nProps].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LocalFileName")); aCheckedArgs[nProps++].Value <<= ::rtl::OUString( sTemp ); } else @@ -664,7 +663,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& aCheckedArgs[nProps++].Value <<= sTemp; // and append the local filename aCheckedArgs.realloc( aCheckedArgs.getLength()+1 ); - aCheckedArgs[nProps].Name = rtl::OUString::createFromAscii("LocalFileName"); + aCheckedArgs[nProps].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LocalFileName")); aCheckedArgs[nProps++].Value <<= ::rtl::OUString( sPath ); } else @@ -682,7 +681,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& pUCBPrintTempFile->EnableKillingFile(); //FIXME: does it work? - aCheckedArgs[nProps].Name = rtl::OUString::createFromAscii("LocalFileName"); + aCheckedArgs[nProps].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LocalFileName")); aCheckedArgs[nProps++].Value <<= ::rtl::OUString( pUCBPrintTempFile->GetFileName() ); sUcbUrl = sURL; } @@ -707,7 +706,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& sal_Bool bTemp = sal_Bool(); if ( rProp.Value >>= bTemp ) { - aCheckedArgs[nProps].Name = rtl::OUString::createFromAscii("Collate"); + aCheckedArgs[nProps].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Collate")); aCheckedArgs[nProps++].Value <<= bTemp; } else @@ -819,14 +818,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 9ba05fc20cee..d5b5ba83dffd 100755 --- 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 a2adce45d239..076780971e2b 100644..100755 --- 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 92e9f26da0a7..ef27654cc922 100644..100755 --- 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.cxx b/sfx2/source/doc/sfxacldetect.cxx index ded9d3000fc8..289a44a44237 100644..100755 --- a/sfx2/source/doc/sfxacldetect.cxx +++ b/sfx2/source/doc/sfxacldetect.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,6 +30,9 @@ #include "precompiled_sfx2.hxx" + +#if EXTRA_ACL_CHECK + #ifdef WNT // necessary to include system headers without warnings @@ -107,3 +111,6 @@ sal_Bool IsReadonlyAccordingACL( const sal_Unicode* ) #endif +#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 100755 index 000000000000..40112f3b8bad --- /dev/null +++ b/sfx2/source/doc/sfxacldetect.hxx @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 32b46bb67e4d..a2d53139e956 100644..100755 --- 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> @@ -134,10 +135,6 @@ #include <sfx2/sfxresid.hxx> //________________________________________________________________________________________________________ -// const -static const ::rtl::OUString SERVICENAME_DESKTOP = ::rtl::OUString::createFromAscii ("com.sun.star.frame.Desktop"); - -//________________________________________________________________________________________________________ // namespaces //________________________________________________________________________________________________________ @@ -186,7 +183,7 @@ SfxDocInfoListener_Impl::~SfxDocInfoListener_Impl() void SAL_CALL SfxDocInfoListener_Impl::modified( const lang::EventObject& ) throw ( uno::RuntimeException ) { - ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; // notify changes to the SfxObjectShell m_rShell.FlushDocInfo(); @@ -293,8 +290,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( @@ -308,7 +305,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( @@ -482,8 +479,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( @@ -808,8 +805,6 @@ void SAL_CALL SfxBaseModel::dispose() throw(::com::sun::star::uno::RuntimeExcept { // as long as an SfxObjectShell is assigned to an SfxBaseModel it is still existing here // so we can't dispose the shared DocumentInfoObject here - // uno::Reference < lang::XComponent > xComp( m_pData->m_xDocumentInfo, uno::UNO_QUERY ); - // xComp->dispose(); m_pData->m_xDocumentInfo = 0; } @@ -879,17 +874,17 @@ 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 ); + getDocumentStorage(), uno::UNO_QUERY_THROW ); uno::Any aMediaType = xSet->getPropertyValue( aName ); uno::Reference < beans::XPropertySet > xDocSet( - m_pData->m_xDocumentInfo, uno::UNO_QUERY ); + m_pData->m_xDocumentInfo, uno::UNO_QUERY_THROW ); xDocSet->setPropertyValue( aName, aMediaType ); } catch (uno::Exception &) { //ignore @@ -898,7 +893,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() @@ -911,7 +914,6 @@ SfxBaseModel::getDocumentProperties() ::comphelper::getProcessServiceFactory()->createInstance( DEFINE_CONST_UNICODE("com.sun.star.document.DocumentProperties") ), uno::UNO_QUERY_THROW); -// xDocProps->initialize(uno::Sequence<uno::Any>()); m_pData->m_xDocumentProperties.set(xDocProps, uno::UNO_QUERY_THROW); uno::Reference<util::XModifyBroadcaster> xMB(m_pData->m_xDocumentProperties, uno::UNO_QUERY_THROW); xMB->addModifyListener(new SfxDocInfoListener_Impl(*m_pData->m_pObjectShell)); @@ -928,7 +930,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; @@ -953,7 +955,7 @@ sal_Bool SAL_CALL SfxBaseModel::attachResource( const ::rtl::OUString& throw(::com::sun::star::uno::RuntimeException) { SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING ); - if ( rURL.getLength() == 0 && rArgs.getLength() == 1 && rArgs[0].Name.equalsAscii( "SetEmbedded" ) ) + if ( rURL.getLength() == 0 && rArgs.getLength() == 1 && rArgs[0].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SetEmbedded")) ) { // allows to set a windowless document to EMBEDDED state // but _only_ before load() or initNew() methods @@ -1079,13 +1081,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; } @@ -1101,7 +1103,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; } @@ -1435,9 +1437,9 @@ 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() ); + SolarMutexGuard aGuard; if ( impl_isDisposed() || m_pData->m_bClosed || m_pData->m_bClosing ) return; @@ -1859,23 +1861,9 @@ void SAL_CALL SfxBaseModel::load( const uno::Sequence< beans::PropertyValue >& throw frame::IllegalArgumentIOException(); } - // !TODO: currently not working - //SFX_ITEMSET_ARG( pParams, pFrameItem, SfxFrameItem, SID_DOCFRAME, sal_False ); - //if( pFrameItem && pFrameItem->GetFrame() ) - //{ - // SfxFrame* pFrame = pFrameItem->GetFrame(); - // pMedium->SetLoadTargetFrame( pFrame ); - //} - SFX_ITEMSET_ARG( pMedium->GetItemSet(), pSalvageItem, SfxStringItem, SID_DOC_SALVAGE, sal_False ); sal_Bool bSalvage = pSalvageItem ? sal_True : sal_False; - // SFX_ITEMSET_ARG( pMedium->GetItemSet(), pTemplateItem, SfxBoolItem, SID_TEMPLATE, sal_False); - // sal_Bool bTemplate = pTemplateItem && pTemplateItem->GetValue(); - // - // does already happen in DoLoad call - //m_pData->m_pObjectShell->SetActivateEvent_Impl( bTemplate ? SFX_EVENT_CREATEDOC : SFX_EVENT_OPENDOC ); - // load document sal_uInt32 nError = ERRCODE_NONE; if ( !m_pData->m_pObjectShell->DoLoad(pMedium) ) @@ -1967,7 +1955,7 @@ void SAL_CALL SfxBaseModel::load( const uno::Sequence< beans::PropertyValue >& if ( m_pData->m_pObjectShell->GetMedium() != pMedium ) { // for whatever reason document now has another medium - DBG_ERROR("Document has rejected the medium?!"); + OSL_FAIL("Document has rejected the medium?!"); delete pMedium; } @@ -2008,7 +1996,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 ) ) { @@ -2037,7 +2025,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 ) ) { @@ -2062,7 +2050,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 ) ) { @@ -2083,12 +2071,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 ) { @@ -2103,7 +2091,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 ) ) { @@ -2138,7 +2126,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 ) ) { @@ -2178,7 +2166,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 ) ) { @@ -2202,7 +2190,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 ) ) { @@ -2312,17 +2300,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; @@ -2330,7 +2318,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; @@ -2338,22 +2326,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; @@ -2508,7 +2496,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; @@ -2573,11 +2561,6 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC , { case SFX_EVENT_STORAGECHANGED: { - // for now this event is sent only on creation of a new storage for new document - // and in case of reload of medium without document reload - // other events are used to detect storage change - // NotifyStorageListeners_Impl(); - if ( m_pData->m_xUIConfigurationManager.is() && m_pData->m_pObjectShell->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ) { @@ -2656,14 +2639,6 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC , { postEvent_Impl( GlobalEventConfig::GetEventName( STR_EVENT_MODECHANGED ) ); } -/* - else if ( pSimpleHint->GetId() == SFX_HINT_DYING - || pSimpleHint->GetId() == SFX_HINT_DEINITIALIZING ) - { - SfxObjectShellLock pShellLock = m_pData->m_pObjectShellLock; - m_pData->m_pObjectShellLock = SfxObjectShellLock(); - } -*/ } } } @@ -2772,8 +2747,6 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL if( !sURL.getLength() ) throw frame::IllegalArgumentIOException(); - //sal_Bool aSaveAsTemplate = sal_False; - sal_Bool bSaved = sal_False; if ( !bSaveTo && m_pData->m_pObjectShell && sURL.getLength() && sURL.compareToAscii( "private:stream", 14 ) != COMPARE_EQUAL @@ -3151,8 +3124,6 @@ void SAL_CALL SfxBaseModel::addPrintJobListener( const uno::Reference< view::XPr if ( xPJB.is() ) xPJB->addPrintJobListener( xListener ); } -// else -// m_pData->m_aInterfaceContainer.addInterface( ::getCppuType((const uno::Reference< view::XPrintJobListener >*)0), xListener ); } void SAL_CALL SfxBaseModel::removePrintJobListener( const uno::Reference< view::XPrintJobListener >& xListener ) throw (uno::RuntimeException) @@ -3165,8 +3136,6 @@ void SAL_CALL SfxBaseModel::removePrintJobListener( const uno::Reference< view:: if ( xPJB.is() ) xPJB->removePrintJobListener( xListener ); } -// else -// m_pData->m_aInterfaceContainer.addInterface( ::getCppuType((const uno::Reference< view::XPrintJobListener >*)0), xListener ); } // simple declaration of class SvObject is enough @@ -3175,7 +3144,7 @@ void SAL_CALL SfxBaseModel::removePrintJobListener( const uno::Reference< view:: class SvObject; sal_Int64 SAL_CALL SfxBaseModel::getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( GetObjectShell() ) { SvGlobalName aName( aIdentifier ); @@ -3238,7 +3207,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() ) { @@ -3247,6 +3215,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] ) ) @@ -3316,7 +3285,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; @@ -3329,7 +3298,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; @@ -3386,7 +3355,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 ); @@ -3508,7 +3477,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(); @@ -3535,20 +3503,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() ); } @@ -3574,8 +3528,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; @@ -3703,16 +3657,24 @@ 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 = sal_False; + m_pData->m_pObjectShell->Get_Impl()->bOwnsStorage = FALSE; } uno::Reference< XSTORAGE > SAL_CALL SfxBaseModel::getDocumentStorage() @@ -3794,6 +3756,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); @@ -3819,7 +3782,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; @@ -3960,10 +3923,10 @@ css::uno::Sequence< ::rtl::OUString > SAL_CALL SfxBaseModel::getAvailableViewCon SfxModelGuard aGuard( *this ); const SfxObjectFactory& rDocumentFactory = GetObjectShell()->GetFactory(); - const sal_Int32 nViewFactoryCount = rDocumentFactory.GetViewFactoryCount(); + const sal_Int16 nViewFactoryCount = rDocumentFactory.GetViewFactoryCount(); Sequence< ::rtl::OUString > aViewNames( nViewFactoryCount ); - for ( sal_Int32 nViewNo = 0; nViewNo < nViewFactoryCount; ++nViewNo ) + for ( sal_Int16 nViewNo = 0; nViewNo < nViewFactoryCount; ++nViewNo ) aViewNames[nViewNo] = rDocumentFactory.GetViewFactory( nViewNo ).GetAPIViewName(); return aViewNames; } @@ -4181,8 +4144,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(); @@ -4196,8 +4159,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(); @@ -4211,8 +4174,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(); @@ -4225,8 +4188,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(); @@ -4242,8 +4205,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); @@ -4257,8 +4220,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); @@ -4273,8 +4236,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); @@ -4290,8 +4253,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); @@ -4311,8 +4274,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, @@ -4329,8 +4292,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); @@ -4345,8 +4308,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); @@ -4361,8 +4324,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); @@ -4381,8 +4344,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 { @@ -4408,8 +4371,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); @@ -4426,8 +4389,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 { @@ -4452,8 +4415,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->storeMetadataToMedium(i_rMedium); @@ -4472,3 +4435,4 @@ void SfxModelSubComponent::disposing() // nothing to do here } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/sfxmodelfactory.cxx b/sfx2/source/doc/sfxmodelfactory.cxx index 714dfc2ea824..93dbfa15c420 100644..100755 --- 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. @@ -148,9 +149,9 @@ namespace sfx2 { static bool isSpecialArgumentName( const ::rtl::OUString& _rValueName ) { - return _rValueName.equalsAscii( "EmbeddedObject" ) - || _rValueName.equalsAscii( "EmbeddedScriptSupport" ) - || _rValueName.equalsAscii( "DocumentRecoverySupport" ); + return _rValueName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "EmbeddedObject" ) ) + || _rValueName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "EmbeddedScriptSupport" ) ) + || _rValueName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "DocumentRecoverySupport" ) ); } bool operator()( const Any& _rArgument ) const @@ -237,3 +238,5 @@ namespace sfx2 //........................................................................ } // namespace sfx2 //........................................................................ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/syspath.cxx b/sfx2/source/doc/syspath.cxx index a1025370ed24..af77c0b5f93f 100644..100755 --- a/sfx2/source/doc/syspath.cxx +++ b/sfx2/source/doc/syspath.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. @@ -6,9 +7,6 @@ * * 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 @@ -46,3 +44,5 @@ bool SystemPath::GetUserTemplateLocation(sal_Unicode* pFolder, int nSize ) return false; #endif } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/syspath.hxx b/sfx2/source/doc/syspath.hxx index 015c16f18d26..7287032ef74d 100644..100755 --- a/sfx2/source/doc/syspath.hxx +++ b/sfx2/source/doc/syspath.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. @@ -6,9 +7,6 @@ * * 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 @@ -42,3 +40,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/syspathw32.cxx b/sfx2/source/doc/syspathw32.cxx index 167dadea2e38..819e59344de8 100755 --- a/sfx2/source/doc/syspathw32.cxx +++ b/sfx2/source/doc/syspathw32.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. @@ -6,9 +7,6 @@ * * 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 @@ -85,3 +83,5 @@ extern "C" bool GetUserTemplateLocation(sal_Unicode* pFolder, int nSize) return false; #endif } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/explorer/nochaos.cxx b/sfx2/source/explorer/nochaos.cxx index 32d1cf2cf6fd..fc2bcd1b59d9 100644..100755 --- 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 ec573cf007a7..d53d85595e8c 100644..100755 --- 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 f7c38173fceb..e34a2d2846bf 100644..100755 --- 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 05c182419514..6f3809d5674c 100644..100755 --- 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 5bc7662e8f9b..dd47c79273aa 100644..100755 --- 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 7da892ca89c9..28b9cbe1b850 100644..100755 --- 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. @@ -28,7 +29,6 @@ #define _SFX_APPDATA_HXX #include <tools/link.hxx> -#include <tools/list.hxx> #include <svl/lstner.hxx> #include <vcl/timer.hxx> #include <tools/string.hxx> @@ -178,3 +178,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 5e962b93a117..f34f0fde4aeb 100644..100755 --- 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 4964cf30233d..87e1c54a7c1a 100644..100755 --- 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> @@ -271,3 +272,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 bac498b6f765..d9f10a52882d 100644..100755 --- 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 @@ sal_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 d674c7620d54..4c5c570cefa5 100644..100755 --- 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. @@ -76,3 +77,4 @@ public: }; #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/helper.hxx b/sfx2/source/inc/helper.hxx index 6e0061a69cf2..ad180e067fa5 100644..100755 --- 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/hexplwnd.hxx b/sfx2/source/inc/hexplwnd.hxx index 228ce78949b9..501b2bbef242 100644..100755 --- 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 041ffac822b7..b0a98b740a0b 100644..100755 --- 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 1b09008c0778..8eb741bc7a97 100644..100755 --- 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 148c99095edb..1a8193111470 100644..100755 --- 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: sal_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 609661e638e9..ed59872059c9 100644..100755 --- 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 09a5c0a2c5ec..2a1e6b421bdd 100644..100755 --- 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 daa06f8e4371..473980578742 100644..100755 --- 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 cac1da05fd48..4d744ccd957c 100644..100755 --- 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 b5087fb46294..24f219e6a315 100644..100755 --- 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 5b719095eae8..1f28d0150075 100644..100755 --- 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 f800e1e253ae..51bdaf23d35a 100644..100755 --- 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 4a485e3cc91f..269d879e3414 100644..100755 --- 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 a9d3ce2f1e72..852e32b80449 100644..100755 --- 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 f247a2570cf9..483e651fa604 100644..100755 --- 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. @@ -32,7 +33,6 @@ #include <sfx2/basedlgs.hxx> class SfxObjectShell; -//REMOVE class SvStorageRef; class SfxFrameWindow; class SfxFrame; @@ -71,3 +71,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 b8e5bb35068c..c9458310e464 100644..100755 --- 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 6c938861d013..cf58771396d1 100644..100755 --- 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/sfxlocal.hrc b/sfx2/source/inc/sfxlocal.hrc index 615445bd919e..f2afb54b161c 100644..100755 --- a/sfx2/source/inc/sfxlocal.hrc +++ b/sfx2/source/inc/sfxlocal.hrc @@ -63,9 +63,7 @@ // Images ---------------------------------------------------------------- #define SFX_IMG_PROPERTY_REMOVE (RID_SFX_SFXLOCAL_START + 0) -#define SFX_IMG_PROPERTY_REMOVE_HC (RID_SFX_SFXLOCAL_START + 1) #define SFX_IMG_CLOSE_DOC (RID_SFX_SFXLOCAL_START + 2) -#define SFX_IMG_CLOSE_DOC_HC (RID_SFX_SFXLOCAL_START + 3) #endif diff --git a/sfx2/source/inc/sfxpicklist.hxx b/sfx2/source/inc/sfxpicklist.hxx index 830ba2e3b810..458b5c7a7b71 100644..100755 --- 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 5c01b0d53259..79ddfd740c25 100644..100755 --- 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 ) @@ -191,3 +182,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 5ab1125b7cb6..83ade822a9cb 100644..100755 --- 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. @@ -57,3 +58,4 @@ private: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/slotserv.hxx b/sfx2/source/inc/slotserv.hxx index afef5e926f5f..79431630aa9a 100644..100755 --- 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 4c4ad9cf9390..00794ae944d8 100644..100755 --- 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 19e1c3e12587..421a4be9e3ff 100644..100755 --- 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 64c9b539d2be..f8a2814576ae 100644..100755 --- 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,15 +30,9 @@ 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> #include <svtools/svtreebx.hxx> #include <svl/eitem.hxx> @@ -279,9 +274,6 @@ public: void SetAutomaticFilter(); }; -/* -----------------10.12.2003 11:42----------------- - - --------------------------------------------------*/ class DropToolBox_Impl : public ToolBox, public DropTargetHelper { @@ -392,3 +384,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 af2ede51701d..ee02d409ffc0 100644..100755 --- 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 c172efb15d87..ba090e87cb67 100644..100755 --- 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 0203d7744e9e..d70e9046f3f4 100644..100755 --- 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 c54a627e2a78..9e80468d7d64 100644..100755 --- 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: sal_Bool bHelpInitialized : 1; sal_Bool bIsActive : 1; sal_Bool bControllersUnBound : 1; - sal_Bool bWasHighContrast : 1; sal_Bool bIsAddonPopupMenu : 1; private: void Construct_Impl(); - bool 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: sal_uInt16 GetItemId( sal_uInt16 nPos ) const; SfxVirtualMenu* GetPopupMenu( sal_uInt16 nId ) const; String GetItemText( sal_uInt16 nId ) const; - String GetItemHelpText( sal_uInt16 nId ) const; //void InvalidateKeyCodes(); @@ -124,7 +123,6 @@ public: void SetResMgr(ResMgr* pMgr) {pResMgr = pMgr; } ResMgr* GetResMgr() { return pResMgr; } void SetHelpIds( ResMgr* ); - sal_Bool IsHiContrastMode() const; void UpdateImages(); DECL_LINK( Select, Menu * ); @@ -157,3 +155,5 @@ inline sal_uInt16 SfxVirtualMenu::GetItemId( sal_uInt16 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 8c06e1233297..3b06553ecb14 100644..100755 --- 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> @@ -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 e420f5a04b5b..9504049e5ec5 100644..100755 --- 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, sal_Bool /*bNew*/ 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, sal_Bool /*bNew*/ 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() ) @@ -247,7 +238,7 @@ void SfxURLToolBoxControl_Impl::StateChanged { if ( nSID == SID_OPENURL ) { - // Disable URL box if command is disabled #111014# + // Disable URL box if command is disabled GetURLBox()->Enable( SFX_ITEM_DISABLED != eState ); } @@ -301,3 +292,4 @@ void SfxURLToolBoxControl_Impl::StateChanged } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/layout/factory.cxx b/sfx2/source/layout/factory.cxx index e572ffb2b76e..a5a00227eecf 100644..100755 --- 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. @@ -57,7 +58,7 @@ SAL_DLLPUBLIC_EXPORT Window* CreateWindow (VCLXWindow** vcl, OUString const& nam { ; } - else if (name.equalsAscii ("sfxmodelessdialog")) + else if (name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("sfxmodelessdialog"))) { window = new SfxModelessDialog_unprotect (parent, ImplGetWinBits (attributes, 0)); *vcl = new layoutimpl::VCLXDialog (); @@ -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 f3a76c489b7e..e8eb980c0466 100644..100755 --- 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 7909d404b524..da2dc738ae4e 100644..100755 --- 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 7df739a38bb3..b7a857c6fbde 100644..100755 --- 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/menu.hrc b/sfx2/source/menu/menu.hrc index b437f797c26e..b437f797c26e 100644..100755 --- a/sfx2/source/menu/menu.hrc +++ b/sfx2/source/menu/menu.hrc diff --git a/sfx2/source/menu/menu.src b/sfx2/source/menu/menu.src index 5e3d8296bb59..5e3d8296bb59 100644..100755 --- a/sfx2/source/menu/menu.src +++ b/sfx2/source/menu/menu.src diff --git a/sfx2/source/menu/mnuitem.cxx b/sfx2/source/menu/mnuitem.cxx index c93fa116172b..330db8d3d0de 100644..100755 --- 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. @@ -29,32 +30,25 @@ #include "precompiled_sfx2.hxx" #ifdef SOLARIS -// HACK: prevent conflict between STLPORT and Workshop headers on Solaris 8 #include <ctime> #endif -#include <string> // HACK: prevent conflict between STLPORT and Workshop includes +#include <string> #include <com/sun/star/uno/Reference.h> #include <com/sun/star/frame/XDispatch.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> #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> @@ -144,13 +138,11 @@ void SfxMenuControl::Bind( SfxVirtualMenu* pOwn, sal_uInt16 nSlotId, const String& rTitle, - const String &rHelpText, SfxBindings &rBindings ) { DBG_MEMTEST(); aTitle = rTitle; - aHelpText = rHelpText; pOwnMenu = pOwn; pSubMenu = 0; if ( pOwn ) @@ -171,7 +163,6 @@ void SfxMenuControl::Bind( sal_uInt16 nSlotId, SfxVirtualMenu& rMenu, const String& rTitle, - const String &rHelpText, SfxBindings &rBindings ) { DBG_MEMTEST(); @@ -180,7 +171,6 @@ void SfxMenuControl::Bind( pOwnMenu = pOwn; pSubMenu = &rMenu; aTitle = rTitle; - aHelpText = rHelpText; } //-------------------------------------------------------------------- @@ -197,8 +187,6 @@ SfxMenuControl::SfxMenuControl( sal_Bool bShowStrings ) //-------------------------------------------------------------------- -// ctor for array - SfxMenuControl::SfxMenuControl(): pOwnMenu(0), pSubMenu(0), @@ -227,8 +215,6 @@ SfxMenuControl::SfxMenuControl(sal_uInt16 nSlotId, SfxBindings& rBindings): //-------------------------------------------------------------------- -// dtor - SfxMenuControl::~SfxMenuControl() { delete pSubMenu; @@ -250,7 +236,7 @@ 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" ); @@ -275,19 +261,13 @@ void SfxMenuControl::StateChanged if ( !bIsObjMenu ) pOwnMenu->CheckItem( GetId(), sal_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) ) { @@ -445,7 +425,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()); @@ -471,15 +450,12 @@ IMPL_LINK( SfxAppMenuControl_Impl, Activate, Menu *, pActMenu ) { const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); sal_uIntPtr nSymbolsStyle = rSettings.GetSymbolsStyle(); - sal_Bool bIsHiContrastMode = rSettings.GetHighContrastMode(); sal_Bool bShowMenuImages = rSettings.GetUseImagesInMenus(); if (( nSymbolsStyle != m_nSymbolsStyle ) || - ( bIsHiContrastMode != m_bWasHiContrastMode ) || ( bShowMenuImages != m_bShowMenuImages )) { m_nSymbolsStyle = nSymbolsStyle; - m_bWasHiContrastMode = bIsHiContrastMode; m_bShowMenuImages = bShowMenuImages; sal_uInt16 nCount = pActMenu->GetItemCount(); @@ -501,7 +477,7 @@ IMPL_LINK( SfxAppMenuControl_Impl, Activate, Menu *, pActMenu ) if ( aImageId.getLength() > 0 ) { Reference< ::com::sun::star::frame::XFrame > xFrame; - Image aImage = GetImage( xFrame, aImageId, sal_False, bIsHiContrastMode ); + Image aImage = GetImage( xFrame, aImageId, false ); if ( !!aImage ) { bImageSet = sal_True; @@ -513,7 +489,7 @@ IMPL_LINK( SfxAppMenuControl_Impl, Activate, Menu *, pActMenu ) if ( !bImageSet && aCmd.Len() ) { Image aImage = SvFileInformationManager::GetImage( - INetURLObject(aCmd), sal_False, bIsHiContrastMode ); + INetURLObject(aCmd), false ); if ( !!aImage ) pActMenu->SetItemImage( nItemId, aImage ); } @@ -537,18 +513,17 @@ SfxUnoMenuControl* SfxMenuControl::CreateControl( const String& rCmd, } SfxUnoMenuControl* SfxMenuControl::CreateControl( const String& rCmd, - sal_uInt16 nId, Menu& rMenu, const String& sItemText, const String& sHelpText, + sal_uInt16 nId, Menu& rMenu, const String& sItemText, SfxBindings& rBindings, SfxVirtualMenu* pVirt) { - return new SfxUnoMenuControl( rCmd, nId, rMenu, sItemText, sHelpText, rBindings, pVirt); + return new SfxUnoMenuControl( rCmd, nId, rMenu, sItemText, rBindings, pVirt); } SfxUnoMenuControl::SfxUnoMenuControl( const String& rCmd, sal_uInt16 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(); @@ -557,11 +532,11 @@ SfxUnoMenuControl::SfxUnoMenuControl( const String& rCmd, sal_uInt16 nSlotId, SfxUnoMenuControl::SfxUnoMenuControl( const String& rCmd, sal_uInt16 nSlotId, Menu& /*rMenu*/, - const String& rItemText, const String& rHelpText, + const String& rItemText, SfxBindings& rBindings, SfxVirtualMenu* pVirt) : SfxMenuControl( nSlotId, rBindings ) { - Bind( pVirt, nSlotId, rItemText, rHelpText, rBindings); + Bind( pVirt, nSlotId, rItemText, rBindings); UnBind(); pUnoCtrl = new SfxUnoControllerItem( this, rBindings, rCmd ); pUnoCtrl->acquire(); @@ -578,3 +553,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 ed3bd40fb558..788c7eae1d1c 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. @@ -33,18 +34,13 @@ #include <com/sun/star/container/XNamed.hpp> #ifdef SOLARIS -// HACK: prevent conflict between STLPORT and Workshop headers on Solaris 8 #include <ctime> #endif -#include <string> // HACK: prevent conflict between STLPORT and Workshop headers +#include <string> #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> @@ -199,9 +195,9 @@ static Image lcl_GetImageFromPngUrl( const ::rtl::OUString &rFileUrl ) PopupMenu* InsertThesaurusSubmenu_Impl( SfxBindings* pBindings, Menu* pSVMenu ) { - // + // build thesaurus sub menu if look-up string is available - // + PopupMenu* pThesSubMenu = 0; SfxPoolItem *pItem = 0; pBindings->QueryState( SID_THES, pItem ); @@ -230,11 +226,10 @@ PopupMenu* InsertThesaurusSubmenu_Impl( SfxBindings* pBindings, Menu* pSVMenu ) if (nNumSynonyms > 0) { SvtLinguConfig aCfg; - const bool bHC = Application::GetSettings().GetStyleSettings().GetHighContrastMode(); Image aImage; String sThesImplName( aHelper.GetThesImplName( aLocale ) ); - ::rtl::OUString aSynonymsImageUrl( aCfg.GetSynonymsContextImage( sThesImplName, bHC ) ); + ::rtl::OUString aSynonymsImageUrl( aCfg.GetSynonymsContextImage( sThesImplName ) ); if (sThesImplName.Len() > 0 && aSynonymsImageUrl.getLength() > 0) aImage = Image( lcl_GetImageFromPngUrl( aSynonymsImageUrl ) ); @@ -245,7 +240,7 @@ PopupMenu* InsertThesaurusSubmenu_Impl( SfxBindings* pBindings, Menu* pSVMenu ) String aItemText( linguistic::GetThesaurusReplaceText( aSynonyms[i] ) ); pThesSubMenu->InsertItem( nId, aItemText ); - ::rtl::OUString aCmd( ::rtl::OUString::createFromAscii( ".uno:ThesaurusFromContext?WordReplace:string=" ) ); + ::rtl::OUString aCmd(RTL_CONSTASCII_USTRINGPARAM(".uno:ThesaurusFromContext?WordReplace:string=") ); aCmd += aItemText; pThesSubMenu->SetItemCommand( nId, aCmd ); @@ -261,7 +256,7 @@ PopupMenu* InsertThesaurusSubmenu_Impl( SfxBindings* pBindings, Menu* pSVMenu ) pThesSubMenu->InsertSeparator(); const String sThesaurus( SfxResId( STR_MENU_THESAURUS ) ); pThesSubMenu->InsertItem( 100, sThesaurus ); - pThesSubMenu->SetItemCommand( 100, ::rtl::OUString::createFromAscii( ".uno:ThesaurusDialog" ) ); + pThesSubMenu->SetItemCommand( 100, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:ThesaurusDialog")) ); pSVMenu->InsertSeparator(); const String sSynonyms( SfxResId( STR_MENU_SYNONYMS ) ); @@ -292,7 +287,6 @@ void SfxMenuManager::UseDefault() ResId aResId(GetType(),*pResMgr); aResId.SetRT(RSC_MENU); Menu *pSVMenu = new PopupMenu( aResId ); - //SfxMenuManager::EraseItemCmds( pSVMenu ); // Remove .uno cmds to be compatible with 6.0/src641 if ( bAddClipboardFuncs ) { @@ -638,3 +632,4 @@ Menu* SfxPopupMenuManager::GetSVMenu() return (Menu*) GetMenu()->GetSVMenu(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/menu/objmnctl.cxx b/sfx2/source/menu/objmnctl.cxx index 639669ab90c3..3a92a4989bc0 100644..100755 --- 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. @@ -30,15 +31,8 @@ #include <com/sun/star/embed/VerbDescriptor.hpp> #include <com/sun/star/embed/VerbAttributes.hpp> -#include <tools/list.hxx> -#ifndef _MENU_HXX //autogen #include <vcl/menu.hxx> -#endif -#ifndef _SXSTRITEM_HXX //autogen #include <svl/stritem.hxx> -#endif -#ifndef GCC -#endif #include <sfx2/sfxsids.hrc> #include "objmnctl.hxx" @@ -163,3 +157,4 @@ PopupMenu* SfxObjectVerbsControl::GetPopup() const } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/menu/thessubmenu.cxx b/sfx2/source/menu/thessubmenu.cxx index 501d3e35f326..e3eaf62f2305 100755 --- a/sfx2/source/menu/thessubmenu.cxx +++ b/sfx2/source/menu/thessubmenu.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. @@ -6,9 +7,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: thessubmenu.cxx,v $ - * $Revision: 1.0 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -227,7 +225,7 @@ String SfxThesSubMenuHelper::GetThesImplName( const lang::Locale &rLocale ) cons if (m_xLngMgr.is()) { uno::Sequence< OUString > aServiceNames = m_xLngMgr->getConfiguredServices( - OUString::createFromAscii("com.sun.star.linguistic2.Thesaurus"), rLocale ); + OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.linguistic2.Thesaurus")), rLocale ); // there should be at most one thesaurus configured for each language DBG_ASSERT( aServiceNames.getLength() <= 1, "more than one thesaurus found. Should not be possible" ); if (aServiceNames.getLength() == 1) @@ -239,3 +237,4 @@ String SfxThesSubMenuHelper::GetThesImplName( const lang::Locale &rLocale ) cons //////////////////////////////////////////////////////////// +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/menu/thessubmenu.hxx b/sfx2/source/menu/thessubmenu.hxx index 394c22b6e497..bf0491477d27 100644..100755 --- a/sfx2/source/menu/thessubmenu.hxx +++ b/sfx2/source/menu/thessubmenu.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. @@ -6,9 +7,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: thessubmenu.hxx,v $ - * $Revision: 1.0 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -101,3 +99,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/menu/virtmenu.cxx b/sfx2/source/menu/virtmenu.cxx index 76be183057c0..b175b76f69b8 100644..100755 --- a/sfx2/source/menu/virtmenu.cxx +++ b/sfx2/source/menu/virtmenu.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. @@ -61,9 +62,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; @@ -134,21 +133,21 @@ void SfxMenuImageControl_Impl::Update() static Image RetrieveAddOnImage( Reference< com::sun::star::frame::XFrame >& rFrame, const rtl::OUString& aImageId, const rtl::OUString& aURL, - sal_Bool bBigImage, - sal_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; } @@ -181,10 +180,6 @@ void SfxVirtualMenu::Construct_Impl() pSVMenu->SetDeactivateHdl( LINK(this, SfxVirtualMenu, Deactivate) ); pSVMenu->SetSelectHdl( LINK(this, SfxVirtualMenu, Select) ); - // #107258# accelerator keys are needed for accessibility - //if ( bOLE ) - // InvalidateKeyCodes(); - if ( !pResMgr && pParent ) pResMgr = pParent->pResMgr; } @@ -201,7 +196,6 @@ SfxVirtualMenu::SfxVirtualMenu( sal_uInt16 nOwnId, pAutoDeactivate(0), nLocks(0), bHelpInitialized( bWithHelp ), - bWasHighContrast( sal_False ), bIsAddonPopupMenu( bIsAddonMenu ) { DBG_MEMTEST(); @@ -237,7 +231,6 @@ SfxVirtualMenu::SfxVirtualMenu( Menu *pStarViewMenu, sal_Bool bWithHelp, pAutoDeactivate(0), nLocks(0), bHelpInitialized( bWithHelp ), - bWasHighContrast( sal_False ), bIsAddonPopupMenu( bIsAddonMenu ) { DBG_MEMTEST(); @@ -323,14 +316,6 @@ SfxVirtualMenu::~SfxVirtualMenu() DBG_ASSERT( !nLocks, "destroying active menu" ); } //-------------------------------------------------------------------- - -sal_Bool SfxVirtualMenu::IsHiContrastMode() const -{ - const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); - return rSettings.GetHighContrastMode(); -} - -//-------------------------------------------------------------------- // internal: creates the virtual menu from the pSVMenu void SfxVirtualMenu::CreateFromSVMenu() @@ -395,9 +380,6 @@ void SfxVirtualMenu::CreateFromSVMenu() pBindings->ENTERREGISTRATIONS(); ++nLocks; pImageControl = new SfxMenuImageControl_Impl( SID_IMAGE_ORIENTATION, *pBindings, this ); - // Update high contrast state - bWasHighContrast = IsHiContrastMode(); - sal_uInt16 nSVPos = 0; for ( sal_uInt16 nPos=0; nPos<nCount; ++nPos, ++nSVPos ) { @@ -411,7 +393,6 @@ void SfxVirtualMenu::CreateFromSVMenu() } const String sItemText = pSVMenu->GetItemText(nSlotId); - const String sHelpText = pSVMenu->GetHelpText(nSlotId); if ( pPopup ) { @@ -431,27 +412,19 @@ void SfxVirtualMenu::CreateFromSVMenu() SfxMenuCtrlArr_Impl &rCtrlArr = GetAppCtrl_Impl(); rCtrlArr.C40_INSERT( SfxMenuControl, pMnuCtrl, rCtrlArr.Count() ); - (pItems+nPos)->Bind( 0, nSlotId, sItemText, sHelpText, *pBindings); - pMnuCtrl->Bind( this, nSlotId, sItemText, sHelpText, *pBindings); + (pItems+nPos)->Bind( 0, nSlotId, sItemText, *pBindings); + pMnuCtrl->Bind( this, nSlotId, sItemText, *pBindings); if ( Application::GetSettings().GetStyleSettings().GetUseImagesInMenus() ) { rtl::OUString aSlotURL( RTL_CONSTASCII_USTRINGPARAM( "slot:" )); aSlotURL += rtl::OUString::valueOf( sal_Int32( nSlotId )); - Image aImage = GetImage( xFrame, aSlotURL, sal_False, bWasHighContrast ); + Image aImage = GetImage( xFrame, aSlotURL, false ); pSVMenu->SetItemImage( nSlotId, aImage ); } } else { - const SfxSlot* pSlot = pSlotPool->GetSlot( nSlotId ); - if ( pSlot ) - { - rtl::OString aCmd(".uno:"); - aCmd += pSlot->GetUnoName(); - pSVMenu->SetHelpId( nSlotId, pSlot->GetUnoName() ); - } - pMnuCtrl = pItems+nPos; // normalerweise jetzt erst im Activate-Handler @@ -459,8 +432,7 @@ void SfxVirtualMenu::CreateFromSVMenu() { pMnuCtrl->Bind( this, nSlotId, *new SfxVirtualMenu(nSlotId, this, *pPopup, bHelpInitialized, *pBindings, bOLE, bResCtor), - sItemText, sHelpText, - *pBindings ); + sItemText, *pBindings ); } } @@ -478,12 +450,12 @@ void SfxVirtualMenu::CreateFromSVMenu() if ( aCmd.Len() && (( nSlotId < SID_SFX_START ) || ( nSlotId > SHRT_MAX )) ) { // try to create control via comand name - pMnuCtrl = SfxMenuControl::CreateControl( aCmd, nSlotId, *pSVMenu, sItemText, sHelpText, *pBindings, this ); + pMnuCtrl = SfxMenuControl::CreateControl( aCmd, nSlotId, *pSVMenu, sItemText, *pBindings, this ); if ( pMnuCtrl ) { SfxMenuCtrlArr_Impl &rCtrlArr = GetAppCtrl_Impl(); rCtrlArr.C40_INSERT( SfxMenuControl, pMnuCtrl, rCtrlArr.Count()); - (pItems+nPos)->Bind( 0, nSlotId, sItemText, sHelpText, *pBindings); + (pItems+nPos)->Bind( 0, nSlotId, sItemText, *pBindings); } } @@ -495,13 +467,13 @@ void SfxVirtualMenu::CreateFromSVMenu() { SfxMenuCtrlArr_Impl &rCtrlArr = GetAppCtrl_Impl(); rCtrlArr.C40_INSERT( SfxMenuControl, pMnuCtrl, rCtrlArr.Count()); - (pItems+nPos)->Bind( 0, nSlotId, sItemText, sHelpText, *pBindings); + (pItems+nPos)->Bind( 0, nSlotId, sItemText, *pBindings); } else // take default control pMnuCtrl = (pItems+nPos); - pMnuCtrl->Bind( this, nSlotId, sItemText, sHelpText, *pBindings); + pMnuCtrl->Bind( this, nSlotId, sItemText, *pBindings); } if ( Application::GetSettings().GetStyleSettings().GetUseImagesInMenus() ) @@ -517,13 +489,13 @@ void SfxVirtualMenu::CreateFromSVMenu() if ( pMenuAttributes ) aImageId = pMenuAttributes->aImageId; // Retrieve image id from menu attributes - aImage = RetrieveAddOnImage( xFrame, aImageId, aCmd, sal_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, sal_False, bWasHighContrast ); + aImage = GetImage( xFrame, aSlotURL, false ); } if ( !!aImage ) @@ -565,7 +537,6 @@ IMPL_LINK( SfxVirtualMenu, Highlight, Menu *, pMenu ) if ( pMenu == pSVMenu ) { // AutoDeactivate ist jetzt nicht mehr n"otig - //sal_uInt16 nSlotId = pMenu->GetCurItemId(); if ( pAutoDeactivate ) pAutoDeactivate->Stop(); } @@ -578,7 +549,6 @@ IMPL_LINK( SfxVirtualMenu, SettingsChanged, void*, EMPTYARG ) sal_uInt16 nItemCount = pSVMenu->GetItemCount(); SfxViewFrame *pViewFrame = pBindings->GetDispatcher()->GetFrame(); sal_Bool bIcons = Application::GetSettings().GetStyleSettings().GetUseImagesInMenus(); - sal_Bool bIsHiContrastMode = IsHiContrastMode(); Reference<com::sun::star::frame::XFrame> xFrame( pViewFrame->GetFrame().GetFrameInterface() ); if ( !bIsAddonPopupMenu ) @@ -601,13 +571,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, sal_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, sal_False, bWasHighContrast )); + pSVMenu->SetItemImage( nSlotId, GetImage( xFrame, aSlotURL, false )); } } else if( nType == MENUITEM_STRINGIMAGE && !bIcons ) @@ -648,7 +618,6 @@ void SfxVirtualMenu::UpdateImages() if ( bIcons ) { - sal_Bool bIsHiContrastMode = IsHiContrastMode(); sal_uInt16 nItemCount = pSVMenu->GetItemCount(); SfxViewFrame * pViewFrame = pBindings->GetDispatcher()->GetFrame(); Reference<com::sun::star::frame::XFrame> xFrame( pViewFrame->GetFrame().GetFrameInterface() ); @@ -670,13 +639,13 @@ void SfxVirtualMenu::UpdateImages() if ( pMenuAttributes ) aImageId = pMenuAttributes->aImageId; // Retrieve image id from menu attributes - pSVMenu->SetItemImage( nSlotId, RetrieveAddOnImage( xFrame, aImageId, aCmd, sal_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, sal_False, bWasHighContrast )); + pSVMenu->SetItemImage( nSlotId, GetImage( xFrame, aSlotURL, false )); } } } @@ -698,7 +667,6 @@ void SfxVirtualMenu::UpdateImages( Menu* pMenu ) sal_Bool bIcons = Application::GetSettings().GetStyleSettings().GetUseImagesInMenus(); if ( bIcons ) { - sal_Bool bIsHiContrastMode = IsHiContrastMode(); sal_uInt16 nItemCount = pMenu->GetItemCount(); Reference<com::sun::star::frame::XFrame> aXFrame( pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame().GetFrameInterface() ); @@ -716,7 +684,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 ), sal_False, bIsHiContrastMode )); + pMenu->SetItemImage( nSlotId, RetrieveAddOnImage( aXFrame, aImageId, pMenu->GetItemCommand( nSlotId ), false )); } if ( pPopup ) @@ -789,9 +757,7 @@ bool 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 ); @@ -894,7 +860,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, sal_False, bWasHighContrast )); + pMenu->SetItemImage( SID_ADDONS, GetImage( xFrame, aSlotURL, false )); } } else @@ -913,8 +879,6 @@ IMPL_LINK( SfxVirtualMenu, Activate, Menu *, pMenu ) // MI: wozu war der noch gut? // MBA: scheint ein alter QAP-Hack gewesen zu sein ( in rev.1.41 eingecheckt ! ) -// if ( Application::IsInModalMode() ) -// return TRUE; // abw"urgen if ( pMenu ) { @@ -1028,29 +992,12 @@ IMPL_LINK( SfxVirtualMenu, Activate, Menu *, pMenu ) pBindings->Update( SID_IMAGE_ORIENTATION ); - // HelpText on-demand - if ( !bHelpInitialized ) - { - // TODO/CLEANUP: do we need help texts in context menus? - // old way with SlotInfo doesn't work anymore - } - // bis zum Deactivate die Statusupdates unterdr"ucken pBindings->ENTERREGISTRATIONS(); ++nLocks; bIsActive = sal_True; 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 sal_True; } @@ -1093,22 +1040,7 @@ IMPL_LINK( SfxVirtualMenu, Select, Menu *, pMenu ) { sal_uInt16 nSlotId = (sal_uInt16) pMenu->GetCurItemId(); DBG_OUTF( ("SfxVirtualMenu %lx selected %u from %lx", this, nSlotId, pMenu) ); -/* - if ( pSVMenu->GetItemCommand( nSlotId ).Len() ) - { - SfxMenuCtrlArr_Impl& rCtrlArr = GetAppCtrl_Impl(); - for ( sal_uInt16 nPos=0; nPos<rCtrlArr.Count(); nPos++ ) - { - SfxMenuControl* pCtrl = rCtrlArr[nPos]; - if ( pCtrl->GetId() == nSlotId ) - { - SfxUnoMenuControl *pUnoCtrl = (SfxUnoMenuControl*) pCtrl; - pUnoCtrl->Select(); - return sal_True; - } - } - } -*/ + if ( nSlotId >= START_ITEMID_WINDOWLIST && nSlotId <= END_ITEMID_WINDOWLIST ) { // window list menu item selected @@ -1208,21 +1140,6 @@ String SfxVirtualMenu::GetItemText( sal_uInt16 nSlotId ) const } //-------------------------------------------------------------------- -// returns the text of the item as currently shown in the menu - -String SfxVirtualMenu::GetItemHelpText( sal_uInt16 nSlotId ) const -{ - DBG_MEMTEST(); - DBG_CHKTHIS(SfxVirtualMenu, 0); - - sal_uInt16 nPos = GetItemPos(nSlotId); - if ( nPos != MENU_ITEM_NOTFOUND ) - return (pItems+nPos)->GetHelpText(); - return String(); -} - -//-------------------------------------------------------------------- - // set the checkmark of the specified item void SfxVirtualMenu::CheckItem( sal_uInt16 nItemId, sal_Bool bCheck ) @@ -1305,9 +1222,7 @@ void SfxVirtualMenu::InitPopup( sal_uInt16 nPos, sal_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 ); } } @@ -1316,9 +1231,6 @@ void SfxVirtualMenu::InitializeHelp() for ( sal_uInt16 nPos = 0; nPos<pSVMenu->GetItemCount(); ++nPos ) { sal_uInt16 nSlotId = pSVMenu->GetItemId(nPos); - // TODO/CLEANUP: this code does nothing! -// if ( !bHelpInitialized ) -// pSVMenu->SetHelpText( nId, rSlotPool.GetSlotHelpText_Impl( nId ) ); SfxMenuControl &rCtrl = pItems[nPos]; if ( nSlotId && !rCtrl.GetId() ) { @@ -1340,3 +1252,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 fd1327e423ca..30f144ccefec 100644..100755 --- 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> @@ -104,7 +101,7 @@ void SAL_CALL SfxEvents_Impl::replaceByName( const OUSTRING & aName, const ANY & ::rtl::OUString sType; if ( ( aNormalizedDescriptor.size() == 1 ) - && ( aNormalizedDescriptor.has( PROP_EVENT_TYPE ) == 0 ) + && ( aProperties[0].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(PROP_EVENT_TYPE)) ) && ( aNormalizedDescriptor.get( PROP_EVENT_TYPE ) >>= sType ) && ( sType.getLength() == 0 ) ) @@ -217,27 +214,27 @@ 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!"); + OSL_FAIL("Unknown property value!"); } 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() ) { @@ -248,8 +245,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; @@ -270,8 +267,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 ); } @@ -282,7 +279,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 ); @@ -400,27 +397,27 @@ 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!"); + OSL_FAIL("Unknown propery value!"); } nIndex += 1; } // 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" ); @@ -428,7 +425,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(); @@ -468,7 +465,7 @@ void SfxEvents_Impl::NormalizeMacro( const ::comphelper::NamedValueCollection& i if ( aScript.getLength() ) o_normalizedDescriptor.put( PROP_SCRIPT, aScript ); - if ( aType.compareToAscii( STAR_BASIC ) == 0 ) + if (aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(STAR_BASIC))) { if ( aScript.getLength() ) { @@ -479,7 +476,7 @@ void SfxEvents_Impl::NormalizeMacro( const ::comphelper::NamedValueCollection& i 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() ) @@ -500,7 +497,7 @@ void SfxEvents_Impl::NormalizeMacro( const ::comphelper::NamedValueCollection& i 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('/'); @@ -511,7 +508,7 @@ void SfxEvents_Impl::NormalizeMacro( const ::comphelper::NamedValueCollection& i // 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"); @@ -564,7 +561,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; @@ -590,7 +587,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--; } @@ -713,7 +710,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); @@ -750,7 +747,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); @@ -882,3 +879,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 d541f5542e3e..09299a152102 100644..100755 --- 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 387a6d09f89a..86c9c0b3a82e 100644..100755 --- 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. @@ -28,8 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" #include <svl/stritem.hxx> -#ifndef GCC -#endif #include <com/sun/star/util/URL.hpp> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XController.hpp> @@ -57,9 +56,7 @@ #include <svl/eitem.hxx> #include <svl/stritem.hxx> #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 +85,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 +225,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 +330,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 +348,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 +365,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 +385,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, (sal_uInt16)nCommand, sal_True, NULL ); @@ -404,7 +401,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 +417,7 @@ throw ( ::uno::RuntimeException ) void SAL_CALL SfxStatusBarControl::click() throw ( uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Click(); } @@ -429,7 +426,7 @@ throw ( uno::RuntimeException ) void SAL_CALL SfxStatusBarControl::doubleClick() throw ( uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; DoubleClick(); } @@ -647,7 +644,7 @@ SfxStatusBarControl* SfxStatusBarControl::CreateControl SfxModule* pMod ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; SfxApplication *pApp = SFX_APP(); SfxSlotPool *pSlotPool; @@ -690,3 +687,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 3afea8890535..9d1031034a7a 100644..100755 --- a/sfx2/source/toolbox/imgmgr.cxx +++ b/sfx2/source/toolbox/imgmgr.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 <stdio.h> -#include <hash_map> +#include <boost/unordered_map.hpp> #include "sfx2/imgmgr.hxx" #include <sfx2/sfx.hrc> @@ -44,14 +45,9 @@ #include <tools/rcid.h> #include <tools/link.hxx> #include <svtools/miscopt.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> -#ifndef GCC -#endif - -#ifndef _UNOTOOLS_PROCESSFACTORY_HXX #include <comphelper/processfactory.hxx> -#endif const sal_uInt32 IMAGELIST_COUNT = 4; // small, small-hi, large, large-hi @@ -70,8 +66,8 @@ public: ImageList* m_pImageList[IMAGELIST_COUNT]; SfxModule* m_pModule; - ImageList* GetImageList( sal_Bool bBig, sal_Bool bHiContrast ); - Image GetImage( sal_uInt16 nId, sal_Bool bBig, sal_Bool bHiContrast ); + ImageList* GetImageList( bool bBig ); + Image GetImage( sal_uInt16 nId, bool bBig ); void SetSymbolsSize_Impl( sal_Int16 ); DECL_LINK( OptionsChanged_Impl, void* ); @@ -82,20 +78,16 @@ public: ~SfxImageManager_Impl(); }; -typedef std::hash_map< sal_Int64, sal_Int64 > SfxImageManagerMap; +typedef boost::unordered_map< sal_Int64, sal_Int64 > SfxImageManagerMap; // global image lists 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 ) { @@ -122,40 +114,32 @@ static SfxImageManager_Impl* GetImageManager( SfxModule* pModule ) } // Global image list -static ImageList* GetImageList( sal_Bool bBig, sal_Bool bHiContrast ) +static ImageList* GetImageList( bool bBig ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; + ImageList* rpList = NULL; - // 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(); + ResMgr *pResMgr = SfxApplication::GetOrCreate()->GetOffResManager_Impl(); - 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 ); + aResId.SetRT( RSC_IMAGELIST ); - DBG_ASSERT( pResMgr->IsAvailable(aResId), "No default ImageList!" ); + DBG_ASSERT( pResMgr->IsAvailable(aResId), "No default ImageList!" ); - if ( pResMgr->IsAvailable(aResId) ) - rpList = new ImageList( aResId ); - else - rpList = new 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,15 +169,15 @@ SfxImageManager_Impl::~SfxImageManager_Impl() //------------------------------------------------------------------------- -ImageList* SfxImageManager_Impl::GetImageList( sal_Bool bBig, sal_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]; @@ -201,9 +185,9 @@ ImageList* SfxImageManager_Impl::GetImageList( sal_Bool bBig, sal_Bool bHiContra //------------------------------------------------------------------------- -Image SfxImageManager_Impl::GetImage( sal_uInt16 nId, sal_Bool bBig, sal_Bool bHiContrast ) +Image SfxImageManager_Impl::GetImage( sal_uInt16 nId, bool bBig ) { - ImageList* pImageList = GetImageList( bBig, bHiContrast ); + ImageList* pImageList = GetImageList( bBig ); if ( pImageList ) return pImageList->GetImage( nId ); return Image(); @@ -213,7 +197,7 @@ Image SfxImageManager_Impl::GetImage( sal_uInt16 nId, sal_Bool bBig, sal_Bool bH void SfxImageManager_Impl::SetSymbolsSize_Impl( sal_Int16 nNewSymbolsSize ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( nNewSymbolsSize != m_nSymbolsSize ) { @@ -226,14 +210,13 @@ void SfxImageManager_Impl::SetSymbolsSize_Impl( sal_Int16 nNewSymbolsSize ) if ( pInf->nFlags & SFX_TOOLBOX_CHANGESYMBOLSET ) { ToolBox *pBox = pInf->pToolBox; - sal_Bool bHiContrast = pBox->GetSettings().GetStyleSettings().GetHighContrastMode(); sal_uInt16 nCount = pBox->GetItemCount(); for ( sal_uInt16 nPos=0; nPos<nCount; nPos++ ) { sal_uInt16 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(); @@ -294,7 +277,7 @@ SfxImageManager::~SfxImageManager() SfxImageManager* SfxImageManager::GetImageManager( SfxModule* pModule ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; SfxImageManagerMap::const_iterator pIter = m_ImageManagerMap.find( sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( pModule ))); @@ -312,9 +295,9 @@ SfxImageManager* SfxImageManager::GetImageManager( SfxModule* pModule ) //------------------------------------------------------------------------- -Image SfxImageManager::GetImage( sal_uInt16 nId, sal_Bool bBig, sal_Bool bHiContrast ) const +Image SfxImageManager::GetImage( sal_uInt16 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( sal_uInt16 nId, sal_Bool bBig, sal_Bool bHiCont //------------------------------------------------------------------------- -Image SfxImageManager::GetImage( sal_uInt16 nId, sal_Bool bHiContrast ) const +Image SfxImageManager::GetImage( sal_uInt16 nId ) const { sal_Bool bLarge = SvtMiscOptions().AreCurrentSymbolsLarge(); - return GetImage( nId, bLarge, bHiContrast ); + return GetImage( nId, bLarge ); } //------------------------------------------------------------------------- -Image SfxImageManager::SeekImage( sal_uInt16 nId, sal_Bool bBig, sal_Bool bHiContrast ) const +Image SfxImageManager::SeekImage( sal_uInt16 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,17 +330,17 @@ Image SfxImageManager::SeekImage( sal_uInt16 nId, sal_Bool bBig, sal_Bool bHiCon //------------------------------------------------------------------------- -Image SfxImageManager::SeekImage( sal_uInt16 nId, sal_Bool bHiContrast ) const +Image SfxImageManager::SeekImage( sal_uInt16 nId ) const { sal_Bool bLarge = SvtMiscOptions().AreCurrentSymbolsLarge(); - return SeekImage( nId, bLarge, bHiContrast ); + return SeekImage( nId, bLarge ); } //------------------------------------------------------------------------- void SfxImageManager::RegisterToolBox( ToolBox *pBox, sal_uInt16 nFlags ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; ToolBoxInf_Impl* pInf = new ToolBoxInf_Impl; pInf->pToolBox = pBox; @@ -369,7 +352,7 @@ void SfxImageManager::RegisterToolBox( ToolBox *pBox, sal_uInt16 nFlags ) void SfxImageManager::ReleaseToolBox( ToolBox *pBox ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; for ( sal_uInt32 n=0; n < pImp->m_aToolBoxes.size(); n++ ) { @@ -384,16 +367,16 @@ void SfxImageManager::ReleaseToolBox( ToolBox *pBox ) //------------------------------------------------------------------------- -void SfxImageManager::SetImages( ToolBox& rToolBox, sal_Bool bHiContrast, sal_Bool bLarge ) +void SfxImageManager::SetImages( ToolBox& rToolBox, bool bLarge ) { - SetImagesForceSize( rToolBox, bLarge, bHiContrast ); + SetImagesForceSize( rToolBox, bLarge ); } //------------------------------------------------------------------------- -void SfxImageManager::SetImagesForceSize( ToolBox& rToolBox, sal_Bool bHiContrast, sal_Bool bLarge ) +void SfxImageManager::SetImagesForceSize( ToolBox& rToolBox, bool bLarge ) { - ImageList* pImageList = pImp->GetImageList( bLarge, bHiContrast ); + ImageList* pImageList = pImp->GetImageList( bLarge ); sal_uInt16 nCount = rToolBox.GetItemCount(); for (sal_uInt16 n=0; n<nCount; n++) @@ -421,6 +404,7 @@ void SfxImageManager::SetImagesForceSize( ToolBox& rToolBox, sal_Bool bHiContras void SfxImageManager::SetImages( ToolBox& rToolBox ) { sal_Bool bLarge = ( pImp->m_nSymbolsSize == SFX_SYMBOLS_SIZE_LARGE ); - sal_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 730926351a05..12637246fe8a 100644..100755 --- a/sfx2/source/toolbox/tbxitem.cxx +++ b/sfx2/source/toolbox/tbxitem.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,6 @@ #include "precompiled_sfx2.hxx" #ifdef SOLARIS -// HACK: prevent conflict between STLPORT and Workshop headers on Solaris 8 #include <ctime> #endif @@ -71,15 +71,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> @@ -111,7 +106,6 @@ #include <comphelper/uieventslogger.hxx> #include <com/sun/star/frame/XModuleManager.hpp> -//using namespace ::com::sun::star::awt; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::frame; using namespace ::com::sun::star::frame::status; @@ -152,11 +146,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; @@ -296,7 +290,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; @@ -329,7 +323,7 @@ void SfxToolBoxControl::RegisterToolBoxControl( SfxModule* pMod, SfxTbxCtrlFacto SfxToolBoxControl* SfxToolBoxControl::CreateControl( sal_uInt16 nSlotId, sal_uInt16 nTbxId, ToolBox *pBox, SfxModule* pMod ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; SfxToolBoxControl *pCtrl; SfxApplication *pApp = SFX_APP(); @@ -453,7 +447,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 ); @@ -467,7 +461,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(); @@ -486,7 +480,7 @@ void SfxToolBoxControl::Dispatch( const ::rtl::OUString& aCommand, ::com::sun::s ::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( @@ -497,7 +491,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 ); @@ -538,7 +532,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(); @@ -668,24 +662,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( (sal_uInt16)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 ); @@ -695,7 +689,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 ))); } @@ -734,7 +728,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() ) @@ -782,11 +776,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 )); @@ -820,7 +811,7 @@ throw (::com::sun::star::uno::RuntimeException) void SfxToolBoxControl::createAndPositionSubToolBar( const ::rtl::OUString& rSubToolBarResName ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( pImpl->pBox ) { @@ -1030,7 +1021,7 @@ void SfxToolBoxControl::Select( sal_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( @@ -1039,7 +1030,7 @@ void SfxToolBoxControl::Select( sal_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); @@ -1111,7 +1102,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(); @@ -1525,7 +1516,6 @@ SfxAppToolBoxControl_Impl::SfxAppToolBoxControl_Impl( sal_uInt16 nSlotId, sal_uI // 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() ); @@ -1614,7 +1604,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 ); @@ -1650,11 +1640,10 @@ void SfxAppToolBoxControl_Impl::SetImage( const String &rURL ) aURL = sFallback; sal_Bool bBig = SvtMiscOptions().AreCurrentSymbolsLarge(); - sal_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 ) { @@ -1712,7 +1701,7 @@ void SfxAppToolBoxControl_Impl::Select( sal_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 = @@ -1728,8 +1717,8 @@ void SfxAppToolBoxControl_Impl::Select( sal_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; @@ -1760,7 +1749,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 ); @@ -1772,7 +1761,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() ); @@ -1801,15 +1790,12 @@ IMPL_LINK( SfxAppToolBoxControl_Impl, Activate, Menu *, pActMenu ) { const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); sal_uIntPtr nSymbolsStyle = rSettings.GetSymbolsStyle(); - sal_Bool bIsHiContrastMode = rSettings.GetHighContrastMode(); sal_Bool bShowMenuImages = rSettings.GetUseImagesInMenus(); if (( nSymbolsStyle != m_nSymbolsStyle ) || - ( bIsHiContrastMode != m_bWasHiContrastMode ) || ( bShowMenuImages != m_bShowMenuImages )) { m_nSymbolsStyle = nSymbolsStyle; - m_bWasHiContrastMode = bIsHiContrastMode; m_bShowMenuImages = bShowMenuImages; sal_uInt16 nCount = pActMenu->GetItemCount(); @@ -1831,7 +1817,7 @@ IMPL_LINK( SfxAppToolBoxControl_Impl, Activate, Menu *, pActMenu ) if ( aImageId.getLength() > 0 ) { Reference< ::com::sun::star::frame::XFrame > xFrame; - Image aImage = GetImage( xFrame, aImageId, sal_False, bIsHiContrastMode ); + Image aImage = GetImage( xFrame, aImageId, false ); if ( !!aImage ) { bImageSet = sal_True; @@ -1843,7 +1829,7 @@ IMPL_LINK( SfxAppToolBoxControl_Impl, Activate, Menu *, pActMenu ) if ( !bImageSet && aCmd.Len() ) { Image aImage = SvFileInformationManager::GetImage( - INetURLObject(aCmd), sal_False, bIsHiContrastMode ); + INetURLObject(aCmd), false ); if ( !!aImage ) pActMenu->SetItemImage( nId, aImage ); } @@ -1892,3 +1878,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 1b9260474938..263358ca0a86 100644..100755 --- a/sfx2/source/view/frame.cxx +++ b/sfx2/source/view/frame.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,27 +38,16 @@ #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> -#ifndef _SPLITWIN_HXX //autogen #include <vcl/splitwin.hxx> -#endif #include <svl/eitem.hxx> #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 +493,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 +582,7 @@ SfxPoolItem* SfxFrameItem::Clone( SfxItemPool *) const return pNew; } -sal_Bool SfxFrameItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) const +bool SfxFrameItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE ) const { if ( wFrame ) { @@ -603,7 +593,7 @@ sal_Bool SfxFrameItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) c return sal_False; } -sal_Bool SfxFrameItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 ) +bool SfxFrameItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE ) { Reference < XFrame > xFrame; if ( (rVal >>= xFrame) && xFrame.is() ) @@ -643,13 +633,13 @@ SfxPoolItem* SfxUsrAnyItem::Clone( SfxItemPool *) const return new SfxUsrAnyItem( Which(), aValue ); } -sal_Bool SfxUsrAnyItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const +bool SfxUsrAnyItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const { rVal = aValue; return sal_True; } -sal_Bool SfxUsrAnyItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) +bool SfxUsrAnyItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) { aValue = rVal; return sal_True; @@ -677,13 +667,13 @@ SfxPoolItem* SfxUnoFrameItem::Clone( SfxItemPool* ) const return new SfxUnoFrameItem( Which(), m_xFrame ); } -sal_Bool SfxUnoFrameItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const +bool SfxUnoFrameItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const { rVal <<= m_xFrame; return sal_True; } -sal_Bool SfxUnoFrameItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) +bool SfxUnoFrameItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) { return ( rVal >>= m_xFrame ); } @@ -992,3 +982,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/frame2.cxx b/sfx2/source/view/frame2.cxx index ea6ab3abfb74..0f3f80097bfb 100644..100755 --- a/sfx2/source/view/frame2.cxx +++ b/sfx2/source/view/frame2.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. @@ -479,3 +480,5 @@ bool SfxFrame::IsMarkedHidden_Impl() const { return pImp->bHidden; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index 958f37f12916..a72b49ad1dc6 100644..100755 --- 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" @@ -74,7 +76,7 @@ #include <toolkit/helper/vclunohelper.hxx> #include <tools/diagnose_ex.h> #include <ucbhelper/simpleinteractionrequest.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> /** === begin UNO using === **/ using ::com::sun::star::beans::PropertyValue; @@ -322,7 +324,7 @@ SfxObjectShellRef SfxFrameLoader_Impl::impl_findObjectShell( const Reference< XM } } - DBG_ERROR( "SfxFrameLoader_Impl::impl_findObjectShell: model is not based on SfxObjectShell - wrong frame loader usage!" ); + OSL_FAIL( "SfxFrameLoader_Impl::impl_findObjectShell: model is not based on SfxObjectShell - wrong frame loader usage!" ); return NULL; } @@ -438,7 +440,7 @@ void SfxFrameLoader_Impl::impl_removeLoaderArguments( ::comphelper::NamedValueCo }; ::comphelper::NamedValueCollection aViewArgs; - for ( size_t i=0; i < sizeof( pKnownViewArgs ) / sizeof( pKnownViewArgs[0] ); ++i ) + for ( size_t i=0; i < SAL_N_ELEMENTS( pKnownViewArgs ); ++i ) { if ( io_rDescriptor.has( pKnownViewArgs[i] ) ) { @@ -524,7 +526,7 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA { ENSURE_OR_THROW( _rTargetFrame.is(), "illegal NULL frame" ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; RTL_LOGFILE_CONTEXT( aLog, "sfx2 (mb93783) ::SfxFrameLoader::load" ); @@ -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 72f322036efb..b49f9dd777a4 100644..100755 --- 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/impviewframe.hxx b/sfx2/source/view/impviewframe.hxx index 8fea153aed52..c4b3d081843e 100644..100755 --- a/sfx2/source/view/impviewframe.hxx +++ b/sfx2/source/view/impviewframe.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. * @@ -96,3 +97,4 @@ public: #endif // SFX2_IMPVIEWFRAME_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx index 30f2d568a3a8..903e4d35ece8 100644..100755 --- 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 @@ sal_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 21bc74affd70..5979d64e1b7b 100644..100755 --- 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> @@ -75,9 +70,6 @@ struct _FileListEntry const CollatorWrapper* pCollator; SfxObjectShellLock aDocShell; // ObjectShell als Ref-Klasse -//REMOVE SvStorageRef aStor; // Referenz auf Storage, wenn wir diesen geoeffnet haben - //uno::Reference< embed::XStorage > xStorage; - sal_Bool bFile; // als Datei auf Platte // (!= unbenannt1, nicht als Dok. geladen; // diese werden nicht gespeichert!) @@ -296,7 +288,6 @@ SfxObjectShellRef SfxOrganizeMgr::CreateObjectShell( sal_uInt16 nIdx ) // andernfalls Doc-Shell anlegen if ( !pEntry->aDocShell.Is() ) { -//(mba)/task SfxWaitCursor aWaitCursor; INetURLObject aFileObj( pEntry->aFileName ); sal_Bool bDum = sal_False; SfxApplication* pSfxApp = SFX_APP(); @@ -371,7 +362,6 @@ SfxObjectShellRef SfxOrganizeMgr::CreateObjectShell(sal_uInt16 nRegion, */ { -//(mba)/task SfxWaitCursor aWaitCursor; return pTemplates->CreateObjectShell(nRegion, nIdx); } @@ -830,3 +820,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 470b96106184..fb362b7814ea 100644..100755 --- 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 b3a7bea50946..e361d866a3d8 100644..100755 --- 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,7 @@ #include <workwin.hxx> #include <sfx2/objface.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <osl/mutex.hxx> #include <tools/diagnose_ex.h> #include <comphelper/sequence.hxx> @@ -90,7 +91,7 @@ #include <comphelper/processfactory.hxx> #include <tools/diagnose_ex.h> -#include <hash_map> +#include <boost/unordered_map.hpp> #include <sfx2/event.hxx> #include "sfx2/viewfac.hxx" @@ -177,7 +178,7 @@ static GroupIDToCommandGroup GroupIDCommandGroupMap[] = { 0 , 0 } }; -typedef std::hash_map< sal_Int16, sal_Int16 > GroupHashMap; +typedef boost::unordered_map< sal_Int16, sal_Int16 > GroupHashMap; sal_Int16 MapGroupIDToCommandGroup( sal_Int16 nGroupID ) @@ -275,7 +276,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 +295,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 +310,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 +325,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 +344,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 +359,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 +421,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 +438,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 +505,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 +530,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 ) ; } @@ -561,7 +562,7 @@ SfxBaseController::~SfxBaseController() Reference< XWindow > SAL_CALL SfxBaseController::getComponentWindow() throw (RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( !m_pData->m_pViewShell ) throw DisposedException(); @@ -570,7 +571,7 @@ Reference< XWindow > SAL_CALL SfxBaseController::getComponentWindow() throw (Run ::rtl::OUString SAL_CALL SfxBaseController::getViewControllerName() throw (RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( !m_pData->m_pViewShell || !m_pData->m_pViewShell->GetObjectShell() ) throw DisposedException(); @@ -587,7 +588,7 @@ Reference< XWindow > SAL_CALL SfxBaseController::getComponentWindow() throw (Run Sequence< PropertyValue > SAL_CALL SfxBaseController::getCreationArguments() throw (RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( !m_pData->m_pViewShell || !m_pData->m_pViewShell->GetObjectShell() ) throw DisposedException(); @@ -616,7 +617,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 ) ; @@ -654,7 +655,7 @@ sal_Bool SAL_CALL SfxBaseController::attachModel( const REFERENCE< XMODEL >& xMo if ( m_pData->m_pViewShell && xModel.is() && xModel != m_pData->m_pViewShell->GetObjectShell()->GetModel() ) { // don't allow to reattach a model! - DBG_ERROR("Can't reattach model!"); + OSL_FAIL("Can't reattach model!"); return sal_False; } @@ -670,7 +671,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 +731,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 +748,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 +763,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 +773,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 +785,14 @@ REFERENCE< XDISPATCH > SAL_CALL SfxBaseController::queryDispatch( const UNOU 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 +809,7 @@ REFERENCE< XDISPATCH > SAL_CALL SfxBaseController::queryDispatch( const UNOU 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 +865,7 @@ REFERENCE< XDISPATCH > SAL_CALL SfxBaseController::queryDispatch( const UNOU } } } - else if ( aURL.Protocol.compareToAscii( "slot:" ) == COMPARE_EQUAL ) + else if ( aURL.Protocol.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("slot:")) ) { sal_uInt16 nId = (sal_uInt16) aURL.Path.toInt32(); @@ -916,7 +917,7 @@ REFERENCE< XDISPATCH > SAL_CALL SfxBaseController::queryDispatch( const UNOU } } } - 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 +965,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 +995,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 ); @@ -1035,7 +1036,7 @@ void SfxBaseController::BorderWidthsChanged_Impl() void SAL_CALL SfxBaseController::dispose() throw( ::com::sun::star::uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Reference< XController > xTmp( this ); m_pData->m_bDisposing = sal_True ; @@ -1120,7 +1121,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 +1147,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 +1158,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 +1168,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 +1236,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 sal_uIntPtr nMode( SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_MENUCONFIG ); @@ -1487,7 +1488,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 +1541,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 97c9e7926e39..845ba8cc70d0 100644..100755 --- 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/view.hrc b/sfx2/source/view/view.hrc index 3dce1ec795bb..3dce1ec795bb 100644..100755 --- a/sfx2/source/view/view.hrc +++ b/sfx2/source/view/view.hrc diff --git a/sfx2/source/view/view.src b/sfx2/source/view/view.src index b4c09a0677ed..b4c09a0677ed 100644..100755 --- a/sfx2/source/view/view.src +++ b/sfx2/source/view/view.src diff --git a/sfx2/source/view/viewfac.cxx b/sfx2/source/view/viewfac.cxx index 1b48d716ff79..16fd68505ad9 100644..100755 --- 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 eb8fb8cf6125..6e137c1a9513 100644..100755 --- 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> @@ -170,8 +172,6 @@ SFX_IMPL_INTERFACE(SfxViewFrame,SfxShell,SfxResId(0)) TYPEINIT2(SfxViewFrame,SfxShell,SfxListener); TYPEINIT1(SfxViewFrameItem, SfxPoolItem); -//========================================================================= - //------------------------------------------------------------------------- namespace { @@ -716,7 +716,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)) ); } @@ -1114,7 +1114,7 @@ void SfxViewFrame::ReleaseObjectShell_Impl() } #ifdef DBG_UTIL else - DBG_ERROR("Keine Shell"); + OSL_FAIL("Keine Shell"); #endif if ( xObjSh.Is() ) @@ -1183,22 +1183,6 @@ void SfxViewFrame::DoActivate( sal_Bool bUI, SfxViewFrame* pOldFrame ) // ViewFrames, erh"alt er ein ParentActivate if ( bUI ) { -/* - SfxMedium* pMed = GetObjectShell() ? GetObjectShell()->GetMedium() : NULL; - if( pMed ) - { - SFX_ITEMSET_ARG( - pMed->GetItemSet(), pInterceptorItem, SfxSlotInterceptorItem, - SID_INTERCEPTOR, sal_False ); - if( pInterceptorItem ) - { - SfxSlotInterceptor* pInter = pInterceptorItem->GetValue(); - if( !pInter->GetBindings() ) - pInter->SetBindings( &GetBindings() ); - pInter->Activate( sal_True ); - } - } - */ SfxViewFrame *pFrame = GetParentViewFrame(); while ( pFrame ) { @@ -1220,19 +1204,6 @@ void SfxViewFrame::DoDeactivate(sal_Bool bUI, SfxViewFrame* pNewFrame ) // ViewFrames, erh"alt er ein ParentDeactivate if ( bUI ) { -// if ( GetFrame().GetWorkWindow_Impl() ) -// GetFrame().GetWorkWindow_Impl()->SaveStatus_Impl(); -/* - SfxMedium* pMed = GetObjectShell() ? GetObjectShell()->GetMedium() : NULL; - if( pMed ) - { - SFX_ITEMSET_ARG( - pMed->GetItemSet(), pInterceptorItem, SfxSlotInterceptorItem, - SID_INTERCEPTOR, sal_False ); - if( pInterceptorItem ) - pInterceptorItem->GetValue()->Activate( sal_False ); - } -*/ SfxViewFrame *pFrame = GetParentViewFrame(); while ( pFrame ) { @@ -1252,13 +1223,6 @@ void SfxViewFrame::InvalidateBorderImpl( const SfxViewShell* pSh ) { if ( GetFrame().IsInPlace() ) { - /* - Size aSize( GetViewShell()->GetWindow()->GetSizePixel() ); - - //Size aBorderSz( pEnv->GetBorderWin()->GetHatchBorderPixel() ); - Point aOfs; //( aBorderSz.Width(), aBorderSz.Height() ); - - DoAdjustPosSizePixel( GetViewShell(), aOfs, aSize );*/ return; } @@ -1692,43 +1656,18 @@ SfxProgress* SfxViewFrame::GetProgress() const //-------------------------------------------------------------------- void SfxViewFrame::ShowStatusText( const String& /*rText*/) { -/* OBSOLETE: If this is used, framework/uielement/progressbarwrapper.[h|c]xx & - framework/uielement/statusindicatorinterfacewrapper.[h|c]xx must be - extended to support a new interface to support ShowStatusText/HideStatusText - SfxWorkWindow* pWorkWin = GetFrame().GetWorkWindow_Impl(); - SfxStatusBarManager *pMgr = pWorkWin->GetStatusBarManager_Impl(); - if ( pMgr ) - { - pMgr->GetStatusBar()->HideItems(); - pMgr->GetStatusBar()->SetText( rText ); - } -*/ } //-------------------------------------------------------------------- void SfxViewFrame::HideStatusText() { -/* OBSOLETE: If this is used, framework/uielement/progressbarwrapper.[h|c]xx & - framework/uielement/statusindicatorinterfacewrapper.[h|c]xx must be - extended to support a new interface to support ShowStatusText/HideStatusText - SfxWorkWindow* pWorkWin = GetFrame().GetWorkWindow_Impl(); - SfxStatusBarManager *pMgr = pWorkWin->GetStatusBarManager_Impl(); - if ( pMgr ) - pMgr->GetStatusBar()->ShowItems(); -*/ } - //-------------------------------------------------------------------- #ifdef ENABLE_INIMANAGER//MUSTINI SfxIniManager* SfxViewFrame::GetIniManager() const { -/* SfxIniManager *pIniMgr = GetObjectShell() - ? GetObjectShell()->GetFactory().GetIniManager() - : 0; - if ( !pIniMgr )*/ //! return SFX_APP()->GetAppIniManager(); -// return pIniMgr; } #endif @@ -1878,13 +1817,6 @@ void SfxViewFrame::Enable( sal_Bool bEnable ) if ( pViewSh ) pViewSh->ShowCursor(sal_False); } -/* - if ( !bEnable ) - GetBindings().ENTERREGISTRATIONS(); - GetDispatcher()->Lock( !bEnable ); - if ( bEnable ) - GetBindings().LEAVEREGISTRATIONS(); -*/ } } @@ -1922,12 +1854,6 @@ void SfxViewFrame::Show() GetWindow().Show(); GetFrame().GetWindow().Show(); -/* SfxViewFrame* pCurrent = SfxViewFrame::Current(); - if ( GetFrame().GetFrameInterface()->isActive() && - pCurrent != this && - ( !pCurrent || pCurrent->GetParentViewFrame_Impl() != this ) && - !GetActiveChildFrame_Impl() ) - MakeActive_Impl( sal_False );*/ if ( xObjSh.Is() && xObjSh->Get_Impl()->bHiddenLockedByAPI ) { xObjSh->Get_Impl()->bHiddenLockedByAPI = sal_False; @@ -2052,21 +1978,6 @@ void SfxViewFrame::SetActiveChildFrame_Impl( SfxViewFrame *pViewFrame ) SfxViewFrame* SfxViewFrame::GetActiveChildFrame_Impl() const { SfxViewFrame *pViewFrame = pImp->pActiveChild; -/* - if ( !pViewFrame ) - { - // Wenn es keinen aktiven ChildFrame gibt, irgendeinen nehmen - for ( sal_uInt16 n=0; n<GetChildFrameCount(); n++ ) - { - pViewFrame = - PTR_CAST( SfxViewFrame, GetChildFrame(n)->GetChildFrame(0) ); - if ( pViewFrame ) - break; - } - } - - pImp->pActiveChild = pViewFrame; -*/ return pViewFrame; } @@ -2164,7 +2075,7 @@ SfxViewShell* SfxViewFrame::LoadViewIntoFrame_Impl( const SfxObjectShell& i_rDoc sURL = i_rDoc.GetFactory().GetFactoryURL(); Reference< XComponentLoader > xLoader( i_rFrame, UNO_QUERY_THROW ); - xLoader->loadComponentFromURL( sURL, ::rtl::OUString::createFromAscii( "_self" ), 0, + xLoader->loadComponentFromURL( sURL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_self")), 0, aTransformLoadArgs.getPropertyValues() ); SfxViewShell* pViewShell = SfxViewShell::Get( i_rFrame->getController() ); @@ -2536,16 +2447,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 +2483,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 +2686,6 @@ void SfxViewFrame::Resize( sal_Bool bForce ) void CutLines( ::rtl::OUString& rStr, sal_Int32 nStartLine, sal_Int32 nLines, sal_Bool bEraseTrailingEmptyLines ) { sal_Int32 nStartPos = 0; - sal_Int32 nEndPos = 0; sal_Int32 nLine = 0; while ( nLine < nStartLine ) { @@ -2790,7 +2700,7 @@ void CutLines( ::rtl::OUString& rStr, sal_Int32 nStartLine, sal_Int32 nLines, sa if ( nStartPos != -1 ) { - nEndPos = nStartPos; + sal_Int32 nEndPos = nStartPos; for ( sal_Int32 i = 0; i < nLines; i++ ) nEndPos = rStr.indexOf( LINE_SEP, nEndPos+1 ); @@ -2826,14 +2736,6 @@ void CutLines( ::rtl::OUString& rStr, sal_Int32 nStartLine, sal_Int32 nLines, sa */ void SfxViewFrame::AddDispatchMacroToBasic_Impl( const ::rtl::OUString& sMacro ) { - /* - // get lib and modul name from dialog - SfxModule *pMod = GetObjectShell()->GetModule(); - SfxRequest aReq( SID_BASICCHOOSER, SFX_CALLMODE_SYNCHRON, pMod->GetPool() ); - const SfxPoolItem* pRet = pMod->ExecuteSlot( aReq ); - if ( pRet ) - ::rtl::OUString = ((SfxStringItem*)pRet)->GetValue(); - */ if ( !sMacro.getLength() ) return; @@ -2853,7 +2755,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 +2772,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 ); } @@ -3018,13 +2920,14 @@ void SfxViewFrame::AddDispatchMacroToBasic_Impl( const ::rtl::OUString& sMacro ) void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq ) { DBG_MEMTEST(); + 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); @@ -3069,11 +2972,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); @@ -3222,14 +3125,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); @@ -3245,14 +3150,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); @@ -3303,7 +3210,7 @@ void SfxViewFrame::MiscState_Impl(SfxItemSet &rSet) case SID_FORMATMENUSTATE : { - DBG_ERROR("Outdated slot!"); + OSL_FAIL("Outdated slot!"); rSet.DisableItem( nWhich ); break; } @@ -3358,20 +3265,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 ); } } @@ -3477,12 +3384,6 @@ SfxWorkWindow* SfxViewFrame::GetWorkWindow_Impl( sal_uInt16 /*nId*/ ) return pWork; } -/* -void SfxViewFrame::SetChildWindow(sal_uInt16 nId, sal_Bool bOn) -{ - SetChildWindow( nId, bOn, sal_True ); -}*/ - void SfxViewFrame::SetChildWindow(sal_uInt16 nId, sal_Bool bOn, sal_Bool bSetFocus ) { SfxWorkWindow* pWork = GetWorkWindow_Impl( nId ); @@ -3553,7 +3454,7 @@ void SfxViewFrame::SetViewFrame( SfxViewFrame* pFrame ) // --------------------------------------------------------------------------------------------------------------------- void SfxViewFrame::ActivateToolPanel( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame, const ::rtl::OUString& i_rPanelURL ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; // look up the SfxFrame for the given XFrame SfxFrame* pFrame = NULL; @@ -3583,3 +3484,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/viewfrm2.cxx b/sfx2/source/view/viewfrm2.cxx index 6352adfb53e4..78f26f34cb28 100644..100755 --- a/sfx2/source/view/viewfrm2.cxx +++ b/sfx2/source/view/viewfrm2.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. @@ -76,7 +77,7 @@ using ::com::sun::star::lang::XComponent; static ::rtl::OUString GetModuleName_Impl( const ::rtl::OUString& sDocService ) { - uno::Reference< container::XNameAccess > xMM( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.frame.ModuleManager")), uno::UNO_QUERY ); + uno::Reference< container::XNameAccess > xMM( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.ModuleManager"))), uno::UNO_QUERY ); ::rtl::OUString sVar; if ( !xMM.is() ) return sVar; @@ -128,7 +129,7 @@ static String _getTabString() Sequence< NamedValue > sMaterial; if (xHolder->getMaterial() >>= sMaterial) { for (int i=0; i < sMaterial.getLength(); i++) { - if ((sMaterial[i].Name.equalsAscii("title")) && + if ((sMaterial[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("title"))) && (sMaterial[i].Value >>= aTabString)) { result += ' '; @@ -330,7 +331,7 @@ void SfxViewFrame::Exec_Impl(SfxRequest &rReq ) aFactName = pImp->aFactoryName; else { - DBG_ERROR("Missing argument!"); + OSL_FAIL("Missing argument!"); break; } @@ -447,7 +448,7 @@ void SfxViewFrame::GetState_Impl( SfxItemSet &rSet ) break; default: - DBG_ERROR( "invalid message-id" ); + OSL_FAIL( "invalid message-id" ); } } ++pRanges; @@ -521,3 +522,5 @@ void SfxViewFrame::Deactivate( sal_Bool bMDI ) pImp->bActive = sal_False; //(mba): hier evtl. wie in Beanframe NotifyEvent ?! } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/view/viewimp.hxx b/sfx2/source/view/viewimp.hxx index 83c916d3071e..edd5495a33ef 100644..100755 --- 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 515149c5a2d3..b0197ff9f4da 100644..100755 --- 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. @@ -148,7 +149,7 @@ SfxPrinterController::SfxPrinterController( const Any& i_rComplete, int nProps = aRenderParms.getLength(); for( int i = 0; i < nProps; i++ ) { - if( aRenderParms[i].Name.equalsAscii( "ExtraPrintUIOptions" ) ) + if( aRenderParms[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ExtraPrintUIOptions" ) ) ) { Sequence< beans::PropertyValue > aUIProps; aRenderParms[i].Value >>= aUIProps; @@ -426,34 +427,6 @@ IMPL_LINK( SfxDialogExecutor_Impl, Execute, void *, EMPTYARG ) //------------------------------------------------------------------------- -sal_Bool UseStandardPrinter_Impl( Window* /*pParent*/, SfxPrinter* pDocPrinter ) -{ - // Optionen abfragen, ob gewarnt werden soll (Doc uebersteuert App) - sal_Bool bWarn = sal_False; - const SfxItemSet *pDocOptions = &pDocPrinter->GetOptions(); - if ( pDocOptions ) - { - sal_uInt16 nWhich = pDocOptions->GetPool()->GetWhich(SID_PRINTER_NOTFOUND_WARN); - const SfxBoolItem* pBoolItem = NULL; - pDocPrinter->GetOptions().GetItemState( nWhich, sal_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 sal_True; -} -//------------------------------------------------------------------------- - SfxPrinter* SfxViewShell::SetPrinter_Impl( SfxPrinter *pNewPrinter ) /* Interne Methode zum Setzen der Unterschiede von 'pNewPrinter' zum @@ -684,20 +657,20 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) TransformItems( nId, *rReq.GetArgs(), aProps, GetInterface()->GetSlot(nId) ); for ( sal_Int32 nProp=0; nProp<aProps.getLength(); nProp++ ) { - if ( aProps[nProp].Name.equalsAscii("Copies") ) - aProps[nProp]. Name = rtl::OUString::createFromAscii("CopyCount"); - else if ( aProps[nProp].Name.equalsAscii("RangeText") ) - aProps[nProp]. Name = rtl::OUString::createFromAscii("Pages"); - if ( aProps[nProp].Name.equalsAscii("Asynchron") ) + if ( aProps[nProp].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Copies")) ) + aProps[nProp]. Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CopyCount")); + else if ( aProps[nProp].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("RangeText")) ) + aProps[nProp]. Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Pages")); + if ( aProps[nProp].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Asynchron")) ) { - aProps[nProp]. Name = rtl::OUString::createFromAscii("Wait"); + aProps[nProp]. Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Wait")); sal_Bool bAsynchron = sal_False; aProps[nProp].Value >>= bAsynchron; aProps[nProp].Value <<= (sal_Bool) (!bAsynchron); } - if ( aProps[nProp].Name.equalsAscii("Silent") ) + if ( aProps[nProp].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Silent")) ) { - aProps[nProp]. Name = rtl::OUString::createFromAscii("MonitorVisible"); + aProps[nProp]. Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MonitorVisible")); sal_Bool bPrintSilent = sal_False; aProps[nProp].Value >>= bPrintSilent; aProps[nProp].Value <<= (sal_Bool) (!bPrintSilent); @@ -759,13 +732,6 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) ErrorBox( NULL, WB_OK | WB_DEF_OK, String( SfxResId( STR_NODEFPRINTER ) ) ).Execute(); } - if ( !pPrinter->IsOriginal() && rReq.GetArgs() && !UseStandardPrinter_Impl( NULL, pPrinter ) ) - { - // printer is not available, but standard printer should not be used - rReq.SetReturnValue(SfxBoolItem(0,sal_False)); - break; - } - // FIXME: printer isn't used for printing anymore! if( pPrinter->IsPrinting() ) { @@ -824,6 +790,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 ); @@ -840,6 +810,10 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) rReq.Ignore(); if ( SID_PRINTDOC == nId ) rReq.SetReturnValue(SfxBoolItem(0,sal_False)); + if ( nId == SID_SETUPPRINTER ) + { + rReq.AppendItem( SfxBoolItem( SID_DIALOG_RETURN, FALSE ) ); + } } } } @@ -912,3 +886,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 88b185482abb..a0570f31bb1f 100644..100755 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.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,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; @@ -175,7 +174,7 @@ SfxClipboardChangeListener::~SfxClipboardChangeListener() void SfxClipboardChangeListener::ChangedContents() { - const ::vos::OGuard aGuard( Application::GetSolarMutex() ); + const SolarMutexGuard aGuard; if( m_pViewShell ) { SfxBindings& rBind = m_pViewShell->GetViewFrame()->GetBindings(); @@ -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 sal_uInt16 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 ); sal_Bool bRet( sal_True ); @@ -727,7 +744,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) } catch ( uno::Exception& ) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Window *pParent = SFX_APP()->GetTopWindow(); ErrorBox( pParent, SfxResId( MSG_ERROR_NO_WEBBROWSER_FOUND )).Execute(); bRet = sal_False; @@ -788,9 +805,9 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) SfxInPlaceClientList *pClients = pView->GetIPClientList_Impl(sal_False); if ( pClients ) { - for (sal_uInt16 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 ) pView->CheckIPClient_Impl( pIPClient, aVisArea ); } @@ -1008,14 +1025,14 @@ SfxInPlaceClient* SfxViewShell::FindIPClient if( !pObjParentWin ) pObjParentWin = GetWindow(); - for (sal_uInt16 n=0; n < pClients->Count(); n++) - { - SfxInPlaceClient *pIPClient = (SfxInPlaceClient*) pClients->GetObject(n); + for ( size_t n = 0; n < pClients->size(); n++) + { + SfxInPlaceClient *pIPClient = (SfxInPlaceClient*) pClients->at( n ); if ( pIPClient->GetObject() == xObj && pIPClient->GetEditWin() == pObjParentWin ) - return pIPClient; - } + return pIPClient; + } - return 0; + return 0; } //-------------------------------------------------------------------- @@ -1034,12 +1051,12 @@ SfxInPlaceClient* SfxViewShell::GetUIActiveIPClient_Impl() const if ( !pClients ) return 0; - for (sal_uInt16 n=0; n < pClients->Count(); n++) - { - SfxInPlaceClient* pIPClient = pClients->GetObject(n); + for ( size_t n = 0; n < pClients->size(); n++) + { + SfxInPlaceClient* pIPClient = pClients->at( n ); if ( pIPClient->IsUIActive() ) return pIPClient; - } + } return NULL; } @@ -1050,9 +1067,9 @@ SfxInPlaceClient* SfxViewShell::GetUIActiveClient() const if ( !pClients ) return 0; - for (sal_uInt16 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->IsObjectUIActive() ) return pIPClient; } @@ -1314,7 +1331,7 @@ void SfxViewShell::SetWindow Size SfxViewShell::GetOptimalSizePixel() const { - DBG_ERROR( "Useless call!" ); + OSL_FAIL( "Useless call!" ); return Size(); } @@ -1758,7 +1775,7 @@ sal_Bool SfxViewShell::ExecKey_Impl(const KeyEvent& aKey) //-------------------------------------------------------------------- -FASTBOOL SfxViewShell::KeyInput( const KeyEvent &rKeyEvent ) +bool SfxViewShell::KeyInput( const KeyEvent &rKeyEvent ) /* [Beschreibung] @@ -1769,7 +1786,7 @@ FASTBOOL SfxViewShell::KeyInput( const KeyEvent &rKeyEvent ) [R"uckgabewert] - FASTBOOL sal_True + bool TRUE die Taste ist konfiguriert, der betreffende Handler wurde gerufen @@ -1792,7 +1809,7 @@ bool SfxViewShell::GlobalKeyInput_Impl( const KeyEvent &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 ( sal_uInt16 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,9 +1865,9 @@ void SfxViewShell::DisconnectAllClients() if ( !pClients ) return; - for ( sal_uInt16 n=0; n<pClients->Count(); ) + for ( size_t n = 0; n < pClients->size(); ) // clients will remove themselves from the list - delete pClients->GetObject(n); + delete pClients->at( n ); } //-------------------------------------------------------------------- @@ -1875,9 +1892,9 @@ void SfxViewShell::VisAreaChanged(const Rectangle& /*rVisArea*/) if ( !pClients ) return; - for (sal_uInt16 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 (sal_uInt16 n=0; n < pClients->Count(); ) - delete pClients->GetObject(n); + for ( size_t n = 0; n < pClients->size(); ) + delete pClients->at( n ); } //-------------------------------------------------------------------- @@ -2170,7 +2187,7 @@ sal_Bool SfxViewShell::TryContextMenuInterception( Menu& rIn, const ::rtl::OUStr // interceptor is indifferent continue; default: - DBG_ERROR("Wrong return value of ContextMenuInterceptor!"); + OSL_FAIL("Wrong return value of ContextMenuInterceptor!"); continue; } } @@ -2324,3 +2341,4 @@ void SfxViewShell::AddRemoveClipboardListener( const uno::Reference < datatransf } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/util/hidother.src b/sfx2/util/hidother.src index 72bd77c5c011..72bd77c5c011 100644..100755 --- a/sfx2/util/hidother.src +++ b/sfx2/util/hidother.src diff --git a/sfx2/util/make_tco.btm b/sfx2/util/make_tco.btm index d25dad24a692..d25dad24a692 100644..100755 --- a/sfx2/util/make_tco.btm +++ b/sfx2/util/make_tco.btm diff --git a/sfx2/util/mkdemo.pl b/sfx2/util/mkdemo.pl index fd4a2d9cecbe..fd4a2d9cecbe 100644..100755 --- a/sfx2/util/mkdemo.pl +++ b/sfx2/util/mkdemo.pl diff --git a/sfx2/util/sfx.component b/sfx2/util/sfx.component index 1c28afd4177f..1c28afd4177f 100644..100755 --- a/sfx2/util/sfx.component +++ b/sfx2/util/sfx.component diff --git a/sfx2/util/sfx.xml b/sfx2/util/sfx.xml index c16e75206001..971981cc5171 100644..100755 --- 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/CalcWindowState.xcu b/sfx2/workben/custompanel/CalcWindowState.xcu index 17629c0bf698..17629c0bf698 100644..100755 --- a/sfx2/workben/custompanel/CalcWindowState.xcu +++ b/sfx2/workben/custompanel/CalcWindowState.xcu diff --git a/sfx2/workben/custompanel/DrawWindowState.xcu b/sfx2/workben/custompanel/DrawWindowState.xcu index 6037a3f5a083..6037a3f5a083 100644..100755 --- a/sfx2/workben/custompanel/DrawWindowState.xcu +++ b/sfx2/workben/custompanel/DrawWindowState.xcu diff --git a/sfx2/workben/custompanel/Factories.xcu b/sfx2/workben/custompanel/Factories.xcu index f8df23e9f40a..f8df23e9f40a 100644..100755 --- a/sfx2/workben/custompanel/Factories.xcu +++ b/sfx2/workben/custompanel/Factories.xcu diff --git a/sfx2/workben/custompanel/ImpressWindowState.xcu b/sfx2/workben/custompanel/ImpressWindowState.xcu index a8fea859bbab..a8fea859bbab 100644..100755 --- a/sfx2/workben/custompanel/ImpressWindowState.xcu +++ b/sfx2/workben/custompanel/ImpressWindowState.xcu diff --git a/sfx2/workben/custompanel/WriterWindowState.xcu b/sfx2/workben/custompanel/WriterWindowState.xcu index 248a2e14a3f4..248a2e14a3f4 100644..100755 --- a/sfx2/workben/custompanel/WriterWindowState.xcu +++ b/sfx2/workben/custompanel/WriterWindowState.xcu diff --git a/sfx2/workben/custompanel/ctp_factory.cxx b/sfx2/workben/custompanel/ctp_factory.cxx index 54880cc5fcc7..40525347ac58 100644..100755 --- a/sfx2/workben/custompanel/ctp_factory.cxx +++ b/sfx2/workben/custompanel/ctp_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. * @@ -94,7 +95,7 @@ namespace sd { namespace colortoolpanel const PropertyValue* pArgEnd = i_rArgs.getConstArray() + i_rArgs.getLength(); for ( ; pArg != pArgEnd; ++pArg ) { - if ( pArg->Name.equalsAscii( "ParentWindow" ) ) + if ( pArg->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ParentWindow" ) ) ) { xParentWindow.set( pArg->Value, UNO_QUERY ); break; @@ -165,3 +166,5 @@ namespace sd { namespace colortoolpanel //...................................................................................................................... } } // namespace sd::colortoolpanel //...................................................................................................................... + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/workben/custompanel/ctp_factory.hxx b/sfx2/workben/custompanel/ctp_factory.hxx index 8a359f59caaf..471485f1e0ea 100644..100755 --- a/sfx2/workben/custompanel/ctp_factory.hxx +++ b/sfx2/workben/custompanel/ctp_factory.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 sd { namespace colortoolpanel //...................................................................................................................... #endif // SD_WORKBENCH_CTP_FACTORY_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/workben/custompanel/ctp_panel.cxx b/sfx2/workben/custompanel/ctp_panel.cxx index ee94287bedbf..e7f36edcf0ff 100644..100755 --- a/sfx2/workben/custompanel/ctp_panel.cxx +++ b/sfx2/workben/custompanel/ctp_panel.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. * @@ -268,3 +269,5 @@ namespace sd { namespace colortoolpanel //...................................................................................................................... } } // namespace sd::colortoolpanel //...................................................................................................................... + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/workben/custompanel/ctp_panel.hxx b/sfx2/workben/custompanel/ctp_panel.hxx index 39c46c9d93a5..ed844f3a3ee5 100644..100755 --- a/sfx2/workben/custompanel/ctp_panel.hxx +++ b/sfx2/workben/custompanel/ctp_panel.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. * @@ -122,3 +123,5 @@ namespace sd { namespace colortoolpanel //...................................................................................................................... #endif // SD_WORKBENCH_CTP_PANEL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/workben/custompanel/ctp_services.cxx b/sfx2/workben/custompanel/ctp_services.cxx index 4164e8bc1629..7f4f45f4e6e7 100644..100755 --- a/sfx2/workben/custompanel/ctp_services.cxx +++ b/sfx2/workben/custompanel/ctp_services.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. * @@ -90,3 +91,5 @@ extern "C" return ::cppu::component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey , ::sd::colortoolpanel::s_aServiceEntries ); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/workben/custompanel/delzip b/sfx2/workben/custompanel/delzip index e69de29bb2d1..e69de29bb2d1 100644..100755 --- a/sfx2/workben/custompanel/delzip +++ b/sfx2/workben/custompanel/delzip diff --git a/sfx2/workben/custompanel/description.xml b/sfx2/workben/custompanel/description.xml index a90aa73a77f6..a90aa73a77f6 100644..100755 --- a/sfx2/workben/custompanel/description.xml +++ b/sfx2/workben/custompanel/description.xml diff --git a/sfx2/workben/custompanel/manifest.xml b/sfx2/workben/custompanel/manifest.xml index 9122d16a4189..9122d16a4189 100644..100755 --- a/sfx2/workben/custompanel/manifest.xml +++ b/sfx2/workben/custompanel/manifest.xml diff --git a/sfx2/workben/custompanel/panel.png b/sfx2/workben/custompanel/panel.png Binary files differindex 2438714af8a6..2438714af8a6 100644..100755 --- a/sfx2/workben/custompanel/panel.png +++ b/sfx2/workben/custompanel/panel.png |