diff options
author | Philipp Lohmann [pl] <Philipp.Lohmann@Sun.COM> | 2010-01-14 19:11:13 +0100 |
---|---|---|
committer | Philipp Lohmann [pl] <Philipp.Lohmann@Sun.COM> | 2010-01-14 19:11:13 +0100 |
commit | edc27277193bf52dbbb8be32f30377bb5a14a4f0 (patch) | |
tree | 72f6bb926a235ebccf45a3ecd9080ba98ebf2f69 /sfx2 | |
parent | 7cb692f6794de11cb1e48f94a2c022ee6ed5dd64 (diff) | |
parent | b0c799c7fbaa93f707bf18a87eb9aef5d86be52c (diff) |
rebase to DEV300_m69
Diffstat (limited to 'sfx2')
178 files changed, 2935 insertions, 1979 deletions
diff --git a/sfx2/inc/arrdecl.hxx b/sfx2/inc/arrdecl.hxx index 177e3611d5ad..bd0a21ca0dae 100644 --- a/sfx2/inc/arrdecl.hxx +++ b/sfx2/inc/arrdecl.hxx @@ -31,7 +31,7 @@ #define _SFX_ARRDECL_HXX #include <tools/list.hxx> -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include <sfx2/minarray.hxx> struct CntUpdateResult; diff --git a/sfx2/inc/minfitem.hxx b/sfx2/inc/minfitem.hxx index 91c05547df2b..9e97bef83cb3 100644 --- a/sfx2/inc/minfitem.hxx +++ b/sfx2/inc/minfitem.hxx @@ -33,7 +33,7 @@ #include "sal/config.h" #include "sfx2/dllapi.h" #include <tools/string.hxx> -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> class BasicManager; class SFX2_DLLPUBLIC SfxMacroInfoItem: public SfxPoolItem diff --git a/sfx2/inc/msgnodei.hxx b/sfx2/inc/msgnodei.hxx index c076f48f312f..e6e1e11acffb 100644 --- a/sfx2/inc/msgnodei.hxx +++ b/sfx2/inc/msgnodei.hxx @@ -32,9 +32,9 @@ #define _MSGNODEI_HXX -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #include <tools/string.hxx> -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #include <tools/list.hxx> struct SfxMsgAttachFile { String aFile; diff --git a/sfx2/inc/orgmgr.hxx b/sfx2/inc/orgmgr.hxx index 442afca362aa..1ced4f3b0416 100644 --- a/sfx2/inc/orgmgr.hxx +++ b/sfx2/inc/orgmgr.hxx @@ -30,7 +30,7 @@ #ifndef _SFX_ORGMGR_HXX #define _SFX_ORGMGR_HXX -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> class SfxDocumentTemplates; class SfxOrganizeListBox_Impl; diff --git a/sfx2/inc/pch/precompiled_sfx2.hxx b/sfx2/inc/pch/precompiled_sfx2.hxx index f6d0958d5cb7..104f8aa2305f 100644 --- a/sfx2/inc/pch/precompiled_sfx2.hxx +++ b/sfx2/inc/pch/precompiled_sfx2.hxx @@ -491,105 +491,103 @@ #include "sot/object.hxx" #include "sot/storinfo.hxx" #include "svtools/accessibilityoptions.hxx" -#include "svtools/addxmltostorageoptions.hxx" -#include "svtools/adrparse.hxx" -#include "svtools/aeitem.hxx" +#include "svl/adrparse.hxx" +#include "svl/aeitem.hxx" #include "svtools/asynclink.hxx" -#include "svtools/brdcst.hxx" -#include "svtools/cancel.hxx" -#include "svtools/cntwids.hrc" +#include "svl/brdcst.hxx" +#include "svl/cancel.hxx" +#include "svl/cntwids.hrc" #include "svtools/controldims.hrc" -#include "svtools/cstitem.hxx" -#include "svtools/ctypeitm.hxx" -#include "svtools/dateitem.hxx" -#include "svtools/dynamicmenuoptions.hxx" +#include "svl/ctypeitm.hxx" +#include "svl/dateitem.hxx" +#include "unotools/dynamicmenuoptions.hxx" #include "svtools/ehdl.hxx" -#include "svtools/eitem.hxx" +#include "svl/eitem.hxx" #include "svtools/embedhlp.hxx" #include "svtools/embedtransfer.hxx" -#include "svtools/eventcfg.hxx" -#include "svtools/extendedsecurityoptions.hxx" -#include "svtools/flagitem.hxx" -#include "svtools/folderrestriction.hxx" -#include "svtools/fontoptions.hxx" +#include "unotools/eventcfg.hxx" +#include "unotools/extendedsecurityoptions.hxx" +#include "svl/flagitem.hxx" +#include "svl/folderrestriction.hxx" +#include "unotools/fontoptions.hxx" #include "svtools/framestatuslistener.hxx" #include "svtools/helpopt.hxx" -#include "svtools/hint.hxx" -#include "svtools/historyoptions.hxx" +#include "svl/hint.hxx" +#include "unotools/historyoptions.hxx" #include "svtools/htmlkywd.hxx" #include "svtools/htmltokn.h" -#include "svtools/imageitm.hxx" +#include "svl/imageitm.hxx" #include "svtools/imagemgr.hxx" #include "svtools/imap.hxx" #include "svtools/imgdef.hxx" -#include "svtools/inetdef.hxx" -#include "svtools/inethist.hxx" -#include "svtools/inetmsg.hxx" -#include "svtools/inetoptions.hxx" -#include "svtools/inetstrm.hxx" -#include "svtools/inettype.hxx" -#include "svtools/internaloptions.hxx" -#include "svtools/intitem.hxx" -#include "svtools/isethint.hxx" +#include "svl/inetdef.hxx" +#include "svl/inethist.hxx" +#include "svl/inetmsg.hxx" +#include "unotools/inetoptions.hxx" +#include "svl/inetstrm.hxx" +#include "svl/inettype.hxx" +#include "unotools/internaloptions.hxx" +#include "svl/intitem.hxx" +#include "svl/isethint.hxx" #include "svtools/itemdel.hxx" -#include "svtools/itemiter.hxx" -#include "svtools/itempool.hxx" -#include "svtools/itemprop.hxx" -#include "svtools/itemset.hxx" +#include "svl/itemiter.hxx" +#include "svl/itempool.hxx" +#include "svl/itemprop.hxx" +#include "svl/itemset.hxx" #include "svtools/javacontext.hxx" -#include "svtools/lckbitem.hxx" -#include "svtools/localisationoptions.hxx" +#include "svl/lckbitem.hxx" +#include "unotools/localisationoptions.hxx" #include "svtools/localresaccess.hxx" -#include "svtools/lstner.hxx" -#include "svtools/memberid.hrc" +#include "svl/lstner.hxx" +#include "svl/memberid.hrc" #include "svtools/menuoptions.hxx" -#include "svtools/misccfg.hxx" +#include "unotools/misccfg.hxx" #include "svtools/miscopt.hxx" -#include "svtools/moduleoptions.hxx" -#include "svtools/ownlist.hxx" +#include "unotools/moduleoptions.hxx" +#include "svl/ownlist.hxx" #include "svtools/parhtml.hxx" -#include "svtools/pathoptions.hxx" -#include "svtools/pickerhelper.hxx" -#include "svtools/poolitem.hxx" +#include "unotools/pathoptions.hxx" +#include "svl/pickerhelper.hxx" +#include "svl/poolitem.hxx" #include "svtools/printoptions.hxx" -#include "svtools/printwarningoptions.hxx" -#include "svtools/rectitem.hxx" -#include "svtools/regoptions.hxx" -#include "svtools/saveopt.hxx" -#include "svtools/searchopt.hxx" -#include "svtools/securityoptions.hxx" +#include "unotools/printwarningoptions.hxx" +#include "svl/rectitem.hxx" +#include "unotools/regoptions.hxx" +#include "unotools/saveopt.hxx" +#include "unotools/searchopt.hxx" +#include "unotools/securityoptions.hxx" #include "svtools/sfxecode.hxx" -#include "svtools/slstitm.hxx" -#include "svtools/smplhint.hxx" +#include "svl/slstitm.hxx" +#include "svl/smplhint.hxx" #include "svtools/soerr.hxx" #include "vcl/solar.hrc" -#include "svtools/startoptions.hxx" +#include "unotools/startoptions.hxx" #include "svtools/statusbarcontroller.hxx" -#include "svtools/stritem.hxx" -#include "svtools/style.hrc" -#include "svtools/style.hxx" -#include "svtools/svarray.hxx" -#include "svtools/svdde.hxx" -#include "svtools/svstdarr.hxx" +#include "svl/stritem.hxx" +#include "svl/style.hrc" +#include "svl/style.hxx" +#include "svl/svarray.hxx" +#include "svl/svdde.hxx" +#include "svl/svstdarr.hxx" #include "svtools/svtdata.hxx" -#include "svtools/svtools.hrc" -#include "svtools/syslocale.hxx" -#include "svtools/syslocaleoptions.hxx" -#include "svtools/szitem.hxx" +#include "svl/svtools.hrc" +#include "unotools/syslocale.hxx" +#include "unotools/syslocaleoptions.hxx" +#include "svl/szitem.hxx" #include "svtools/templatefoldercache.hxx" #include "svtools/toolboxcontroller.hxx" #include "svtools/transfer.hxx" #include "svtools/ttprops.hxx" -#include "svtools/undo.hxx" -#include "svtools/undoopt.hxx" -#include "svtools/urihelper.hxx" -#include "svtools/urlbmk.hxx" -#include "svtools/useroptions.hxx" -#include "svtools/viewoptions.hxx" -#include "svtools/visitem.hxx" -#include "svtools/whiter.hxx" -#include "svtools/workingsetoptions.hxx" -#include "svtools/zforlist.hxx" +#include "svl/undo.hxx" +#include "unotools/undoopt.hxx" +#include "svl/urihelper.hxx" +#include "svl/urlbmk.hxx" +#include "unotools/useroptions.hxx" +#include "unotools/viewoptions.hxx" +#include "svl/visitem.hxx" +#include "svl/whiter.hxx" +#include "unotools/workingsetoptions.hxx" +#include "svl/zforlist.hxx" #include "toolkit/awt/vclxwindow.hxx" #include "toolkit/helper/convert.hxx" #include "tools/bigint.hxx" diff --git a/sfx2/inc/sfx2/app.hxx b/sfx2/inc/sfx2/app.hxx index 99deee0c97a3..9f035b125a31 100644 --- a/sfx2/inc/sfx2/app.hxx +++ b/sfx2/inc/sfx2/app.hxx @@ -34,8 +34,8 @@ #include "sfx2/dllapi.h" #include "sal/types.h" #include <tools/solar.h> -#include <svtools/smplhint.hxx> -#include <svtools/poolitem.hxx> +#include <svl/smplhint.hxx> +#include <svl/poolitem.hxx> #include <tools/ref.hxx> #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/script/XLibraryContainer.hpp> @@ -94,7 +94,6 @@ class SfxModule; class SfxModuleArr_Impl; class Window; class INetURLObject; -class SfxMiscCfg; struct SfxConstant; struct SfxChildWinFactory; struct SfxMenuCtrlFactory; @@ -229,7 +228,6 @@ public: USHORT GetFreeIndex(); void ReleaseIndex(USHORT i); SfxEventConfiguration* GetEventConfig() const; - SfxMiscCfg* GetMiscConfig(); // Basic/Scripting static sal_Bool IsXScriptURL( const String& rScriptURL ); diff --git a/sfx2/inc/sfx2/appuno.hxx b/sfx2/inc/sfx2/appuno.hxx index e0213e8d8131..773d2fd82d6b 100644 --- a/sfx2/inc/sfx2/appuno.hxx +++ b/sfx2/inc/sfx2/appuno.hxx @@ -65,9 +65,9 @@ // something else header //____________________________________________________________________________________________________________________________________ #include <tools/errcode.hxx> -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #define _SVSTDARR_STRINGSDTOR -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <sfx2/sfxuno.hxx> //____________________________________________________________________________________________________________________________________ diff --git a/sfx2/inc/sfx2/childwin.hxx b/sfx2/inc/sfx2/childwin.hxx index 690d8392d056..2c240dae89af 100644 --- a/sfx2/inc/sfx2/childwin.hxx +++ b/sfx2/inc/sfx2/childwin.hxx @@ -205,8 +205,10 @@ public: void SetPosSizePixel(const Point& rPoint, Size& rSize); Point GetPosPixel() { return pWindow->GetPosPixel(); } - void Hide(); - void Show( USHORT nFlags ); +//<!--Modified by PengYunQuan for Validity Cell Range Picker + virtual void Hide(); + virtual void Show( USHORT nFlags ); +//-->Modified by PengYunQuan for Validity Cell Range Picker sal_uInt16 GetFlags() const { return GetInfo().nFlags; } sal_Bool CanGetFocus() const; diff --git a/sfx2/inc/sfx2/cntids.hrc b/sfx2/inc/sfx2/cntids.hrc index faaf9ec53732..35a983fa995a 100644 --- a/sfx2/inc/sfx2/cntids.hrc +++ b/sfx2/inc/sfx2/cntids.hrc @@ -32,7 +32,7 @@ #define _CNTIDS_HRC #ifndef _CNTWIDS_HRC -#include <svtools/cntwids.hrc> +#include <svl/cntwids.hrc> #endif #ifndef _SOLAR_HRC diff --git a/sfx2/inc/sfx2/ctrlitem.hxx b/sfx2/inc/sfx2/ctrlitem.hxx index f5662777d7ee..51ed03c1e70d 100644 --- a/sfx2/inc/sfx2/ctrlitem.hxx +++ b/sfx2/inc/sfx2/ctrlitem.hxx @@ -33,7 +33,7 @@ #include "sal/config.h" #include "sfx2/dllapi.h" #include "sal/types.h" -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> class SfxPoolItem; class SfxBindings; diff --git a/sfx2/inc/sfx2/dinfdlg.hxx b/sfx2/inc/sfx2/dinfdlg.hxx index 27da2810d49e..2c8448d6bca0 100644 --- a/sfx2/inc/sfx2/dinfdlg.hxx +++ b/sfx2/inc/sfx2/dinfdlg.hxx @@ -37,16 +37,16 @@ #include <vcl/edit.hxx> #include <vcl/field.hxx> #include <svtools/stdctrl.hxx> -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #include <svtools/svmedit.hxx> #include <vcl/edit.hxx> #include <vcl/lstbox.hxx> #include <vcl/scrbar.hxx> #include <svtools/headbar.hxx> -#include <svtools/syslocale.hxx> -#include <svtools/zforlist.hxx> - +#include <unotools/syslocale.hxx> +#include <svl/zforlist.hxx> +#include <com/sun/star/util/Duration.hpp> #include "tabdlg.hxx" namespace com { namespace sun { namespace star { @@ -358,6 +358,55 @@ public: inline CustomPropertyLine* GetLine() const { return m_pLine; } }; +class CustomPropertiesDateField : public DateField +{ +private: + CustomPropertyLine* m_pLine; + +public: + inline CustomPropertiesDateField( + Window* pParent, const ResId& rResId, CustomPropertyLine* pLine ) : + DateField( pParent, rResId ), m_pLine( pLine ) {} + + inline CustomPropertyLine* GetLine() const { return m_pLine; } +}; +class CustomPropertiesTimeField : public TimeField +{ +private: + CustomPropertyLine* m_pLine; + +public: + inline CustomPropertiesTimeField( + Window* pParent, const ResId& rResId, CustomPropertyLine* pLine ) : + TimeField( pParent, rResId ), m_pLine( pLine ) {} + + inline CustomPropertyLine* GetLine() const { return m_pLine; } +}; +class CustomPropertiesDurationField : public Edit +{ + CustomPropertyLine* m_pLine; + com::sun::star::util::Duration m_aDuration; +protected: + virtual void RequestHelp(const HelpEvent& rEvt); +public: + CustomPropertiesDurationField( Window* pParent, const ResId& rResId, CustomPropertyLine* pLine ); + ~CustomPropertiesDurationField(); + + void SetDuration( const com::sun::star::util::Duration& rDuration ); + const com::sun::star::util::Duration& GetDuration() const { return m_aDuration; } +}; + +class CustomPropertiesEditButton : public PushButton +{ + CustomPropertyLine* m_pLine; + +public: + CustomPropertiesEditButton( Window* pParent, const ResId& rResId, CustomPropertyLine* pLine ); + ~CustomPropertiesEditButton(); + + DECL_LINK(ClickHdl, PushButton*); +}; + class CustomPropertiesRemoveButton : public ImageButton { private: @@ -394,9 +443,18 @@ struct CustomPropertyLine ComboBox m_aNameBox; CustomPropertiesTypeBox m_aTypeBox; CustomPropertiesEdit m_aValueEdit; + CustomPropertiesDateField m_aDateField; + CustomPropertiesTimeField m_aTimeField; + const String m_sDurationFormat; + CustomPropertiesDurationField m_aDurationField; + CustomPropertiesEditButton m_aEditButton; CustomPropertiesYesNoButton m_aYesNoButton; CustomPropertiesRemoveButton m_aRemoveButton; + Point m_aDatePos; + Point m_aTimePos; + Size m_aDateTimeSize; + bool m_bIsRemoved; bool m_bTypeLostFocus; @@ -413,6 +471,10 @@ private: ComboBox m_aNameBox; ListBox m_aTypeBox; Edit m_aValueEdit; + DateField m_aDateField; + TimeField m_aTimeField; + Edit m_aDurationField; + PushButton m_aEditButton; CustomPropertiesYesNoButton m_aYesNoButton; ImageButton m_aRemoveButton; @@ -430,6 +492,8 @@ private: DECL_LINK( RemoveHdl, CustomPropertiesRemoveButton* ); DECL_LINK( EditLoseFocusHdl, CustomPropertiesEdit* ); DECL_LINK( BoxLoseFocusHdl, CustomPropertiesTypeBox* ); + //add lose focus handlers of Date/TimeField? + DECL_LINK( EditTimeoutHdl, Timer* ); DECL_LINK( BoxTimeoutHdl, Timer* ); diff --git a/sfx2/inc/sfx2/dispatch.hxx b/sfx2/inc/sfx2/dispatch.hxx index a96f97f20fe7..363c9280fd5a 100644 --- a/sfx2/inc/sfx2/dispatch.hxx +++ b/sfx2/inc/sfx2/dispatch.hxx @@ -37,7 +37,7 @@ #include <stdarg.h> #define _SVSTDARR_USHORTS -#include <svtools/svstdarr.hxx> // SvUShorts +#include <svl/svstdarr.hxx> // SvUShorts #include <sfx2/bindings.hxx> #include <sfx2/viewfrm.hxx> diff --git a/sfx2/inc/sfx2/docfile.hxx b/sfx2/inc/sfx2/docfile.hxx index e8ae3f5d1d85..c322ee4afc0a 100644 --- a/sfx2/inc/sfx2/docfile.hxx +++ b/sfx2/inc/sfx2/docfile.hxx @@ -48,10 +48,10 @@ #include <tools/stream.hxx> #include <tools/string.hxx> #include <tools/list.hxx> -#include <svtools/lstner.hxx> +#include <svl/lstner.hxx> #include <tools/globname.hxx> -#include <svtools/cancel.hxx> +#include <svl/cancel.hxx> #include <cppuhelper/weak.hxx> #include <ucbhelper/content.hxx> @@ -229,7 +229,7 @@ public: sal_Int8 ShowLockedDocumentDialog( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aData, sal_Bool bIsLoading, sal_Bool bOwnLock ); sal_Bool LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI ); - void UnlockFile(); + void UnlockFile( sal_Bool bReleaseLockStream ); ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > GetStorage( sal_Bool bCreateTempIfNo = sal_True ); ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > GetOutputStorage(); @@ -290,6 +290,7 @@ public: SAL_DLLPRIVATE void Init_Impl(); SAL_DLLPRIVATE void ForceSynchronStream_Impl( sal_Bool bSynchron ); + SAL_DLLPRIVATE void GetLockingStream_Impl(); SAL_DLLPRIVATE void GetMedium_Impl(); SAL_DLLPRIVATE sal_Bool TryDirectTransfer( const ::rtl::OUString& aURL, SfxItemSet& aTargetSet ); SAL_DLLPRIVATE void Transfer_Impl(); diff --git a/sfx2/inc/sfx2/event.hxx b/sfx2/inc/sfx2/event.hxx index 9990b786666e..79f1d34ee82c 100644 --- a/sfx2/inc/sfx2/event.hxx +++ b/sfx2/inc/sfx2/event.hxx @@ -33,8 +33,8 @@ #include "sal/config.h" #include "sfx2/dllapi.h" #include <tools/string.hxx> -#include <svtools/hint.hxx> -#include <svtools/eventcfg.hxx> +#include <svl/hint.hxx> +#include <unotools/eventcfg.hxx> #include <rtl/ustring.hxx> #include <com/sun/star/uno/Sequence.hxx> diff --git a/sfx2/inc/sfx2/evntconf.hxx b/sfx2/inc/sfx2/evntconf.hxx index cfe8629cd0cf..647746abe84f 100644 --- a/sfx2/inc/sfx2/evntconf.hxx +++ b/sfx2/inc/sfx2/evntconf.hxx @@ -38,7 +38,7 @@ #include <vcl/button.hxx> #define _SVSTDARR_USHORTS -#include <svtools/svstdarr.hxx> // SvUShorts +#include <svl/svstdarr.hxx> // SvUShorts #include <sfx2/event.hxx> #include <sfx2/sfxsids.hrc> @@ -46,7 +46,7 @@ #undef ITEMID_MACRO #endif #define ITEMID_MACRO SID_ATTR_MACROITEM -#include <svtools/macitem.hxx> +#include <svl/macitem.hxx> class SfxMacroInfo; class SfxMacroInfoArr_Impl; diff --git a/sfx2/inc/sfx2/fcontnr.hxx b/sfx2/inc/sfx2/fcontnr.hxx index 3fd8801c10a9..e48a7c000094 100644 --- a/sfx2/inc/sfx2/fcontnr.hxx +++ b/sfx2/inc/sfx2/fcontnr.hxx @@ -36,7 +36,7 @@ #include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/beans/NamedValue.hpp> #include <com/sun/star/container/XNameAccess.hpp> -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #include <vcl/window.hxx> #include <sfx2/docfilt.hxx> diff --git a/sfx2/inc/sfx2/frame.hxx b/sfx2/inc/sfx2/frame.hxx index 2443fcb345a9..38731e032328 100644 --- a/sfx2/inc/sfx2/frame.hxx +++ b/sfx2/inc/sfx2/frame.hxx @@ -68,9 +68,9 @@ namespace com #include <tools/link.hxx> #include <tools/ref.hxx> #include <tools/string.hxx> -#include <svtools/brdcst.hxx> +#include <svl/brdcst.hxx> #include <tools/list.hxx> -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> class SvBorder; class SfxWorkWindow; diff --git a/sfx2/inc/sfx2/frmdescr.hxx b/sfx2/inc/sfx2/frmdescr.hxx index d6cd9f334f27..07098d74b658 100644 --- a/sfx2/inc/sfx2/frmdescr.hxx +++ b/sfx2/inc/sfx2/frmdescr.hxx @@ -34,10 +34,10 @@ #include "sfx2/dllapi.h" #include <sfx2/sfxsids.hrc> -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #include <tools/urlobj.hxx> #include <tools/string.hxx> -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include <tools/gen.hxx> class SvStream; diff --git a/sfx2/inc/sfx2/itemwrapper.hxx b/sfx2/inc/sfx2/itemwrapper.hxx index ed863cde7fb7..b1fd8934d393 100644 --- a/sfx2/inc/sfx2/itemwrapper.hxx +++ b/sfx2/inc/sfx2/itemwrapper.hxx @@ -33,10 +33,10 @@ #include "sal/config.h" #include "sfx2/dllapi.h" -#include <svtools/eitem.hxx> -#include <svtools/stritem.hxx> -#include <svtools/intitem.hxx> -#include <svtools/itemset.hxx> +#include <svl/eitem.hxx> +#include <svl/stritem.hxx> +#include <svl/intitem.hxx> +#include <svl/itemset.hxx> // ============================================================================ diff --git a/sfx2/inc/sfx2/linkmgr.hxx b/sfx2/inc/sfx2/linkmgr.hxx index 86035885fc43..960faed33473 100644 --- a/sfx2/inc/sfx2/linkmgr.hxx +++ b/sfx2/inc/sfx2/linkmgr.hxx @@ -34,7 +34,7 @@ #include "sfx2/dllapi.h" #include <sfx2/linksrc.hxx> #include <tools/string.hxx> -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> class SfxObjectShell; diff --git a/sfx2/inc/sfx2/macrconf.hxx b/sfx2/inc/sfx2/macrconf.hxx index 9540e1e396b2..d27f660bd275 100644 --- a/sfx2/inc/sfx2/macrconf.hxx +++ b/sfx2/inc/sfx2/macrconf.hxx @@ -35,7 +35,7 @@ #include "sal/types.h" #include <tools/errcode.hxx> #define _SVSTDARR_USHORTS -#include <svtools/svstdarr.hxx> // SvUShorts +#include <svl/svstdarr.hxx> // SvUShorts #include <sfx2/evntconf.hxx> class SfxMacroInfo; diff --git a/sfx2/inc/sfx2/macropg.hxx b/sfx2/inc/sfx2/macropg.hxx index d72023ea40c4..d197b6fe544d 100644 --- a/sfx2/inc/sfx2/macropg.hxx +++ b/sfx2/inc/sfx2/macropg.hxx @@ -35,7 +35,7 @@ #include <sfx2/basedlgs.hxx> #include <sfx2/tabdlg.hxx> -#include <svtools/macitem.hxx> +#include <svl/macitem.hxx> #include <vcl/lstbox.hxx> #include <com/sun/star/frame/XFrame.hpp> diff --git a/sfx2/inc/sfx2/mnuitem.hxx b/sfx2/inc/sfx2/mnuitem.hxx index 85381a891c4b..a173f6e1a31e 100644 --- a/sfx2/inc/sfx2/mnuitem.hxx +++ b/sfx2/inc/sfx2/mnuitem.hxx @@ -90,9 +90,9 @@ public: virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState ); - static SfxMenuControl* CreateControl( USHORT nId, Menu &, SfxBindings & ); - static SfxUnoMenuControl* - CreateControl( const String&, USHORT, Menu&, SfxBindings&, SfxVirtualMenu* ); + static SfxMenuControl* CreateControl( USHORT nId, Menu &, SfxBindings & ); + static SfxUnoMenuControl* CreateControl( const String&, USHORT, Menu&, SfxBindings&, SfxVirtualMenu* ); + static SfxUnoMenuControl* CreateControl( const String&, USHORT, Menu&, const String& sItemText, const String& sHelpText, SfxBindings&, SfxVirtualMenu* ); static BOOL IsSpecialControl( USHORT nId, SfxModule* ); static void RegisterMenuControl(SfxModule*, SfxMenuCtrlFactory*); @@ -104,6 +104,9 @@ class SfxUnoMenuControl : public SfxMenuControl public: SfxUnoMenuControl( const String&, USHORT nId, Menu&, SfxBindings&, SfxVirtualMenu* ); + SfxUnoMenuControl( const String&, USHORT nId, Menu&, + const String&, const String&, + SfxBindings&, SfxVirtualMenu* ); ~SfxUnoMenuControl(); void Select(); }; diff --git a/sfx2/inc/sfx2/msgpool.hxx b/sfx2/inc/sfx2/msgpool.hxx index b6ab4eb4a065..bc45f9303a96 100644 --- a/sfx2/inc/sfx2/msgpool.hxx +++ b/sfx2/inc/sfx2/msgpool.hxx @@ -36,7 +36,7 @@ #include <sfx2/msg.hxx> #include <tools/string.hxx> -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> class SfxInterface; class SfxSlot; diff --git a/sfx2/inc/sfx2/objitem.hxx b/sfx2/inc/sfx2/objitem.hxx index ff2b913381fe..e82e92f188c1 100644 --- a/sfx2/inc/sfx2/objitem.hxx +++ b/sfx2/inc/sfx2/objitem.hxx @@ -32,7 +32,7 @@ #include "sal/config.h" #include "sfx2/dllapi.h" -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #include <sfx2/shell.hxx> diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx index 0cea8e5be8ea..f81be0aa7bba 100644 --- a/sfx2/inc/sfx2/objsh.hxx +++ b/sfx2/inc/sfx2/objsh.hxx @@ -58,7 +58,7 @@ //#if 0 // _SOLAR__PRIVATE #include <vcl/timer.hxx> //#endif -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #include <vcl/timer.hxx> #include <vcl/bitmap.hxx> #include <sot/storage.hxx> @@ -261,6 +261,7 @@ public: TYPEINFO(); SFX_DECL_INTERFACE(SFX_INTERFACE_SFXDOCSH) + static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId(); /* Stampit disable/enable cancel button for print jobs default = true = enable! */ void Stamp_SetPrintCancelState(sal_Bool bState); @@ -303,6 +304,9 @@ public: sal_Bool IsReadOnlyUI() const; void SetNoName(); sal_Bool IsInModalMode() 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; @@ -889,6 +893,7 @@ public: virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); SfxObjectShell* GetObjectShell() const { return pObjSh; } + }; #endif diff --git a/sfx2/inc/sfx2/objuno.hxx b/sfx2/inc/sfx2/objuno.hxx index f4303c0e28e9..c0b015f3bc60 100644 --- a/sfx2/inc/sfx2/objuno.hxx +++ b/sfx2/inc/sfx2/objuno.hxx @@ -51,7 +51,7 @@ #include <com/sun/star/io/IOException.hpp> -#include <svtools/itemprop.hxx> +#include <svl/itemprop.hxx> #include <cppuhelper/implbase10.hxx> #include "sfxuno.hxx" diff --git a/sfx2/inc/sfx2/passwd.hxx b/sfx2/inc/sfx2/passwd.hxx index bb4e1b8c1561..bfe8debecca1 100644 --- a/sfx2/inc/sfx2/passwd.hxx +++ b/sfx2/inc/sfx2/passwd.hxx @@ -68,10 +68,9 @@ private: USHORT mnMinLen; USHORT mnExtras; -//#if 0 // _SOLAR__PRIVATE + bool mbAsciiOnly; DECL_DLLPRIVATE_LINK( EditModifyHdl, Edit* ); DECL_DLLPRIVATE_LINK( OKHdl, OKButton* ); -//#endif public: SfxPasswordDialog( Window* pParent, const String* pGroupText = NULL ); @@ -84,6 +83,7 @@ public: void SetMaxLen( USHORT Len ); void SetEditHelpId( ULONG nId ) { maPasswordED.SetHelpId( nId ); } void ShowExtras( USHORT nExtras ) { mnExtras = nExtras; } + void AllowAsciiOnly( bool i_bAsciiOnly = true ) { mbAsciiOnly = i_bAsciiOnly; } virtual short Execute(); }; diff --git a/sfx2/inc/sfx2/querystatus.hxx b/sfx2/inc/sfx2/querystatus.hxx index e2e88b3df5c1..c9fef61cc318 100644 --- a/sfx2/inc/sfx2/querystatus.hxx +++ b/sfx2/inc/sfx2/querystatus.hxx @@ -33,7 +33,7 @@ #include "sal/config.h" #include "sfx2/dllapi.h" -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #include <cppuhelper/weak.hxx> #include <osl/conditn.hxx> #include <com/sun/star/frame/FeatureStateEvent.hpp> diff --git a/sfx2/inc/sfx2/request.hxx b/sfx2/inc/sfx2/request.hxx index 6fa5001aa301..dfb25ae2a952 100644 --- a/sfx2/inc/sfx2/request.hxx +++ b/sfx2/inc/sfx2/request.hxx @@ -33,8 +33,8 @@ #include "sal/config.h" #include "sfx2/dllapi.h" #include "sal/types.h" -#include <svtools/itemset.hxx> -#include <svtools/hint.hxx> +#include <svl/itemset.hxx> +#include <svl/hint.hxx> #include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/beans/PropertyValue.hpp> diff --git a/sfx2/inc/sfx2/sfx.hrc b/sfx2/inc/sfx2/sfx.hrc index e02f30c5b9be..014a7d984de3 100644 --- a/sfx2/inc/sfx2/sfx.hrc +++ b/sfx2/inc/sfx2/sfx.hrc @@ -37,7 +37,7 @@ #endif #ifndef _MEMBERID_HRC -#include <svtools/memberid.hrc> +#include <svl/memberid.hrc> #endif #define RID_GROUPS_OFFSET 32000 diff --git a/sfx2/inc/sfx2/sfxbasemodel.hxx b/sfx2/inc/sfx2/sfxbasemodel.hxx index 6ef67b6a009a..b7bb0fc93be1 100644 --- a/sfx2/inc/sfx2/sfxbasemodel.hxx +++ b/sfx2/inc/sfx2/sfxbasemodel.hxx @@ -103,7 +103,7 @@ // include of my own project //________________________________________________________________________________________________________ -#include <svtools/lstner.hxx> +#include <svl/lstner.hxx> //________________________________________________________________________________________________________ // defines diff --git a/sfx2/inc/sfx2/sfxhtml.hxx b/sfx2/inc/sfx2/sfxhtml.hxx index 899edd2cd201..270087cf24a9 100644 --- a/sfx2/inc/sfx2/sfxhtml.hxx +++ b/sfx2/inc/sfx2/sfxhtml.hxx @@ -36,7 +36,7 @@ #include "sal/types.h" #include <i18npool/lang.h> #include <svtools/parhtml.hxx> -#include <svtools/macitem.hxx> +#include <svl/macitem.hxx> class ImageMap; diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc index 849be49a94c2..12f5442f1511 100644 --- a/sfx2/inc/sfx2/sfxsids.hrc +++ b/sfx2/inc/sfx2/sfxsids.hrc @@ -873,7 +873,7 @@ #define SID_HELP_PI (SID_SFX_START + 962) #define SID_BASIC_ENABLED (SID_SFX_START + 964) #define SID_EXPORT_DIALOG (SID_SFX_START + 965) -#define SID_IMPORT_DIALOG (SID_SFX_START + 966)
+#define SID_IMPORT_DIALOG (SID_SFX_START + 966) #define SID_BASICBREAK (SID_SFX_START +1521) diff --git a/sfx2/inc/sfx2/sfxstatuslistener.hxx b/sfx2/inc/sfx2/sfxstatuslistener.hxx index 5ada198c7795..735cc3c88562 100644 --- a/sfx2/inc/sfx2/sfxstatuslistener.hxx +++ b/sfx2/inc/sfx2/sfxstatuslistener.hxx @@ -33,7 +33,7 @@ #include "sal/config.h" #include "sfx2/dllapi.h" -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #include <cppuhelper/weak.hxx> #include <osl/conditn.hxx> #include <com/sun/star/frame/FeatureStateEvent.hpp> diff --git a/sfx2/inc/sfx2/shell.hxx b/sfx2/inc/sfx2/shell.hxx index 69169a6d3d10..f7fac480dccd 100644 --- a/sfx2/inc/sfx2/shell.hxx +++ b/sfx2/inc/sfx2/shell.hxx @@ -36,7 +36,7 @@ #include <com/sun/star/embed/VerbDescriptor.hpp> #include <tools/debug.hxx> #include <tools/rtti.hxx> -#include <svtools/brdcst.hxx> +#include <svl/brdcst.hxx> #include <tools/ownlist.hxx> #include <tools/unqid.hxx> diff --git a/sfx2/inc/sfx2/srchitem.hxx b/sfx2/inc/sfx2/srchitem.hxx index 3547fc14515c..594d12cf05b5 100644 --- a/sfx2/inc/sfx2/srchitem.hxx +++ b/sfx2/inc/sfx2/srchitem.hxx @@ -39,7 +39,7 @@ #include <unotools/configitem.hxx> #include <rsc/rscsfx.hxx> #include <tools/string.hxx> -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #include <sfx2/msg.hxx> #include <sfx2/srchdefs.hxx> @@ -112,6 +112,7 @@ public: // ConfigItem virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString > &rPropertyNames ); + virtual void Commit(); sal_uInt16 GetCommand() const { return nCommand; } void SetCommand(sal_uInt16 nNewCommand) { nCommand = nNewCommand; } diff --git a/sfx2/inc/sfx2/tabdlg.hxx b/sfx2/inc/sfx2/tabdlg.hxx index 3cac4227116f..d2fae3e9f534 100644 --- a/sfx2/inc/sfx2/tabdlg.hxx +++ b/sfx2/inc/sfx2/tabdlg.hxx @@ -37,8 +37,8 @@ #include <vcl/button.hxx> #include <vcl/tabctrl.hxx> #include <vcl/tabpage.hxx> -#include <svtools/itempool.hxx> -#include <svtools/itemset.hxx> +#include <svl/itempool.hxx> +#include <svl/itemset.hxx> #include <com/sun/star/frame/XFrame.hpp> #if ENABLE_LAYOUT diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx index 00c5c69240e8..396a948a03cc 100644 --- a/sfx2/inc/sfx2/viewfrm.hxx +++ b/sfx2/inc/sfx2/viewfrm.hxx @@ -33,12 +33,12 @@ #include "sal/config.h" #include "sfx2/dllapi.h" #include "sal/types.h" -#include <svtools/lstner.hxx> +#include <svl/lstner.hxx> #include <sfx2/module.hxx> #include <sfx2/frame.hxx> #include <sfx2/shell.hxx> #include <sfx2/sfxsids.hrc> -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #include <com/sun/star/frame/status/Verb.hpp> #include <com/sun/star/frame/XModel.hpp> diff --git a/sfx2/inc/sfx2/viewsh.hxx b/sfx2/inc/sfx2/viewsh.hxx index ec2255215506..e3a5ae5adb8e 100644 --- a/sfx2/inc/sfx2/viewsh.hxx +++ b/sfx2/inc/sfx2/viewsh.hxx @@ -37,7 +37,7 @@ #include <com/sun/star/frame/XController.hpp> #include <com/sun/star/view/XRenderable.hpp> #include <com/sun/star/uno/Reference.h> -#include <svtools/lstner.hxx> +#include <svl/lstner.hxx> #include <com/sun/star/ui/XContextMenuInterceptor.hpp> #include <com/sun/star/datatransfer/clipboard/XClipboardListener.hpp> #include <cppuhelper/interfacecontainer.hxx> diff --git a/sfx2/inc/sorgitm.hxx b/sfx2/inc/sorgitm.hxx index 5281abcc7074..53953c8db3ee 100644 --- a/sfx2/inc/sorgitm.hxx +++ b/sfx2/inc/sorgitm.hxx @@ -30,7 +30,7 @@ #ifndef _SFX_SORGITM_HXX #define _SFX_SORGITM_HXX -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> // class SfxScriptOrganizerItem --------------------------------------------- diff --git a/sfx2/inc/stbitem.hxx b/sfx2/inc/stbitem.hxx index 0ec27c2ac36d..6d1b7cce6bc5 100644 --- a/sfx2/inc/stbitem.hxx +++ b/sfx2/inc/stbitem.hxx @@ -32,7 +32,7 @@ #include "sal/config.h" #include "sfx2/dllapi.h" -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #include <svtools/statusbarcontroller.hxx> //------------------------------------------------------------------ diff --git a/sfx2/inc/tplpitem.hxx b/sfx2/inc/tplpitem.hxx index 25743f78ec08..d50298b59716 100644 --- a/sfx2/inc/tplpitem.hxx +++ b/sfx2/inc/tplpitem.hxx @@ -34,7 +34,7 @@ #include "sfx2/dllapi.h" #include <tools/string.hxx> #include <tools/rtti.hxx> -#include <svtools/flagitem.hxx> +#include <svl/flagitem.hxx> class SFX2_DLLPUBLIC SfxTemplateItem: public SfxFlagItem { diff --git a/sfx2/prj/d.lst b/sfx2/prj/d.lst index 77acce9a7be9..fe71b1715769 100644 --- a/sfx2/prj/d.lst +++ b/sfx2/prj/d.lst @@ -3,8 +3,6 @@ mkdir: %COMMON_DEST%\res%_EXT% mkdir: %_DEST%\inc%_EXT%\sfx2 ..\%COMMON_OUTDIR%\misc\*.hid %COMMON_DEST%\bin%_EXT%\hid\*.hid -..\%__SRC%\inc\sfxslots.ilb %_DEST%\inc%_EXT%\sfxslots.ilb -..\%__SRC%\inc\sfxslots.ilb* %_DEST%\inc%_EXT%\sfxslots.ilb* ..\%__SRC%\lib\sfx.lib %_DEST%\lib%_EXT%\sfx.lib ..\%__SRC%\lib\lib*.so %_DEST%\lib%_EXT% ..\%__SRC%\lib\*.a %_DEST%\lib%_EXT%\*.a @@ -26,6 +24,8 @@ mkdir: %_DEST%\inc%_EXT%\sfx2 ..\%__SRC%\misc\sfx2.csv %_DEST%\inc%_EXT%\sfx2.csv ..\inc\sfx2\dllapi.h %_DEST%\inc%_EXT%\sfx2\dllapi.h +..\sdi\sfx.sdi %_DEST%\inc%_EXT%\sfx2\sfx.sdi +..\sdi\sfxitems.sdi %_DEST%\inc%_EXT%\sfx2\sfxitems.sdi ..\inc\sfx2\app.hxx %_DEST%\inc%_EXT%\sfx2\app.hxx ..\inc\sfx2\basedlgs.hxx %_DEST%\inc%_EXT%\sfx2\basedlgs.hxx ..\inc\sfx2\bindings.hxx %_DEST%\inc%_EXT%\sfx2\bindings.hxx diff --git a/sfx2/qa/complex/DocumentMetaData.java b/sfx2/qa/complex/DocumentMetaData.java index 8ecf28f37a5f..54b0f7afd3be 100644 --- a/sfx2/qa/complex/DocumentMetaData.java +++ b/sfx2/qa/complex/DocumentMetaData.java @@ -41,8 +41,10 @@ import com.sun.star.lang.XSingleServiceFactory; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.lang.Locale; import com.sun.star.lang.EventObject; -import com.sun.star.util.Time; +import com.sun.star.util.Date; import com.sun.star.util.DateTime; +import com.sun.star.util.Time; +import com.sun.star.util.Duration; import com.sun.star.util.XModifyListener; import com.sun.star.util.XModifyBroadcaster; import com.sun.star.beans.XPropertyContainer; @@ -351,14 +353,30 @@ public class DocumentMetaData extends ComplexTestCase // differently some day... boolean b = true; double d = 3.1415; + // note that Time is only supported for backward compatibilty! Time t = new Time(); t.Hours = 1; t.Minutes = 16; + Date date = new Date(); + date.Year = 2071; + date.Month = 2; + date.Day = 3; dt.Year = 2065; + Duration dur = new Duration(); + dur.Negative = true; + dur.Years = 1001; + dur.Months = 999; + dur.Days = 888; + dur.Hours = 777; + dur.Minutes = 666; + dur.Seconds = 555; + dur.HundredthSeconds = 444; udpc.addProperty("Frobnicate", PropertyAttribute.REMOVEABLE, new Boolean(b)); - udpc.addProperty("FrobDuration", PropertyAttribute.REMOVEABLE, t); + udpc.addProperty("FrobDuration", PropertyAttribute.REMOVEABLE, dur); + udpc.addProperty("FrobDuration2", PropertyAttribute.REMOVEABLE, t); + udpc.addProperty("FrobEndDate", PropertyAttribute.REMOVEABLE, date); udpc.addProperty("FrobStartTime", PropertyAttribute.REMOVEABLE, dt); udpc.addProperty("Pi", PropertyAttribute.REMOVEABLE, new Double(d)); udpc.addProperty("Foo", PropertyAttribute.REMOVEABLE, "bar"); @@ -383,9 +401,13 @@ public class DocumentMetaData extends ComplexTestCase assure ("UserDefined bool", new Boolean(b).equals( udps.getPropertyValue("Frobnicate"))); - assure ("UserDefined time", eqTime(t, (Time) + assure ("UserDefined duration", eqDuration(dur, (Duration) udps.getPropertyValue("FrobDuration"))); - assure ("UserDefined date", eqDateTime(dt, (DateTime) + assure ("UserDefined time", eqTime(t, (Time) + udps.getPropertyValue("FrobDuration2"))); + assure ("UserDefined date", eqDate(date, (Date) + udps.getPropertyValue("FrobEndDate"))); + assure ("UserDefined datetime", eqDateTime(dt, (DateTime) udps.getPropertyValue("FrobStartTime"))); assure ("UserDefined float", new Double(d).equals( udps.getPropertyValue("Pi"))); @@ -423,9 +445,13 @@ public class DocumentMetaData extends ComplexTestCase assure ("UserDefined bool", new Boolean(b).equals( udps.getPropertyValue("Frobnicate"))); - assure ("UserDefined time", eqTime(t, (Time) + assure ("UserDefined duration", eqDuration(dur, (Duration) udps.getPropertyValue("FrobDuration"))); - assure ("UserDefined date", eqDateTime(dt, (DateTime) + assure ("UserDefined time", eqTime(t, (Time) + udps.getPropertyValue("FrobDuration2"))); + assure ("UserDefined date", eqDate(date, (Date) + udps.getPropertyValue("FrobEndDate"))); + assure ("UserDefined datetime", eqDateTime(dt, (DateTime) udps.getPropertyValue("FrobStartTime"))); assure ("UserDefined float", new Double(d).equals( udps.getPropertyValue("Pi"))); @@ -474,12 +500,24 @@ public class DocumentMetaData extends ComplexTestCase && a.HundredthSeconds == b.HundredthSeconds; } + boolean eqDate(Date a, Date b) { + return a.Year == b.Year && a.Month == b.Month && a.Day == b.Day; + } + boolean eqTime(Time a, Time b) { return a.Hours == b.Hours && a.Minutes == b.Minutes && a.Seconds == b.Seconds && a.HundredthSeconds == b.HundredthSeconds; } + boolean eqDuration(Duration a, Duration b) { + return a.Years == b.Years && a.Months == b.Months && a.Days == b.Days + && a.Hours == b.Hours && a.Minutes == b.Minutes + && a.Seconds == b.Seconds + && a.HundredthSeconds == b.HundredthSeconds + && a.Negative == b.Negative; + } + java.util.Collection fromArray(Object[] os) { java.util.Collection ret = new java.util.HashSet(); for (int i = 0; i < os.length; ++i) { diff --git a/sfx2/sdi/sfxitems.sdi b/sfx2/sdi/sfxitems.sdi new file mode 100644 index 000000000000..30fe37ffa5f0 --- /dev/null +++ b/sfx2/sdi/sfxitems.sdi @@ -0,0 +1,89 @@ + item void SfxVoidItem;
+ item BOOL SfxBoolItem;
+ item INT32 SfxUInt16Item;
+ item INT16 SfxInt16Item;
+ item INT32 SfxUInt32Item;
+ item INT32 SfxInt32Item;
+ item String SfxStringItem;
+ item BYTE SfxByteItem;
+ item INT16 SfxEnumItem;
+ item INT16 SfxAllEnumItem;
+ item INT16 TbxImageItem;
+
+ item String SbxItem; //! Dummy
+ item String SfxObjectItem; //! Dummy
+ item String SfxTemplateItem; //! Dummy
+ item String SfxMacroInfoItem; //! Dummy
+ item String SfxImageItem; //! Dummy
+ item String SfxFrameItem; //! Dummy
+ item String SfxObjectShellItem //! Dummy
+ item String SfxUsrAnyItem //! Dummy
+
+ struct Point
+ {
+ INT32 X MID_X;
+ INT32 Y MID_Y;
+ };
+ item Point SfxPointItem;
+
+ struct Rectangle
+ {
+ INT32 Left MID_RECT_LEFT;
+ INT32 Top MID_RECT_TOP;
+ INT32 Width MID_WIDTH;
+ INT32 Height MID_HEIGHT;
+ };
+ item Rectangle SfxRectangleItem;
+
+ struct DocInfo
+ {
+ BOOL UseUserData MID_DOCINFO_USEUSERDATA;
+ BOOL DeleteUserData MID_DOCINFO_DELETEUSERDATA;
+ String Title MID_DOCINFO_TITLE;
+ String Subject MID_DOCINFO_SUBJECT;
+ String KeyWords MID_DOCINFO_KEYWORDS;
+ String Description MID_DOCINFO_DESCRIPTION;
+ BOOL AutoReload MID_DOCINFO_AUTOLOADENABLED;
+ INT32 AutoReloadTime MID_DOCINFO_AUTOLOADSECS;
+ String AutoReloadURL MID_DOCINFO_AUTOLOADURL;
+ String AutoReloadFrame MID_DOCINFO_DEFAULTTARGET;
+ };
+ item DocInfo SfxDocumentInfoItem;
+
+ struct SvxSearch
+ {
+ INT16 StyleFamily MID_SEARCH_STYLEFAMILY;
+ UINT16 CellType MID_SEARCH_CELLTYPE;
+ BOOL RowDirection MID_SEARCH_ROWDIRECTION;
+ BOOL AllTables MID_SEARCH_ALLTABLES;
+ BOOL Backward MID_SEARCH_BACKWARD;
+ BOOL Pattern MID_SEARCH_PATTERN;
+ BOOL Content MID_SEARCH_CONTENT;
+ BOOL AsianOptions MID_SEARCH_ASIANOPTIONS;
+ INT16 AlgorithmType MID_SEARCH_ALGORITHMTYPE;
+ INT32 SearchFlags MID_SEARCH_FLAGS;
+ String SearchString MID_SEARCH_SEARCHSTRING;
+ String ReplaceString MID_SEARCH_REPLACESTRING;
+ INT16 Locale MID_SEARCH_LOCALE;
+ INT32 ChangedChars MID_SEARCH_CHANGEDCHARS;
+ INT32 DeletedChars MID_SEARCH_DELETEDCHARS;
+ INT32 InsertedChars MID_SEARCH_INSERTEDCHARS;
+ INT32 TransliterateFlags MID_SEARCH_TRANSLITERATEFLAGS;
+ INT16 Command MID_SEARCH_COMMAND;
+ };
+ item SvxSearch SvxSearchItem;
+
+ struct SvxSize
+ {
+ INT32 Width MID_SIZE_WIDTH;
+ INT32 Height MID_SIZE_HEIGHT;
+ };
+ item SvxSize SvxSizeItem;
+
+ struct SfxScriptOrganizer
+ {
+ String Language MID_SCRIPT_ORGANIZER_LANGUAGE;
+ };
+ item SfxScriptOrganizer SfxScriptOrganizerItem;
+ item String SvxClipboardFmtItem; //! Dummy
+
diff --git a/sfx2/sdi/sfxslots.sdi b/sfx2/sdi/sfxslots.sdi index e439e8c776a0..44cd45d00868 100644 --- a/sfx2/sdi/sfxslots.sdi +++ b/sfx2/sdi/sfxslots.sdi @@ -36,103 +36,15 @@ StarApplicationFrame [ HelpText( "StarDivision Application Framework" ), SlotIdFile( "sfx2/sfx.hrc" ) -TypeLibFile( "sfxslots.tlb" ) ] { - item void SfxVoidItem; - item BOOL SfxBoolItem; - item INT32 SfxUInt16Item; - item INT16 SfxInt16Item; - item INT32 SfxUInt32Item; - item INT32 SfxInt32Item; - item String SfxStringItem; - item BYTE SfxByteItem; - item INT16 SfxEnumItem; - item INT16 SfxAllEnumItem; - item INT16 TbxImageItem; - - item String SbxItem; //! Dummy - item String SfxObjectItem; //! Dummy - item String SfxTemplateItem; //! Dummy - item String SfxMacroInfoItem; //! Dummy - item String SfxImageItem; //! Dummy - item String SfxFrameItem; //! Dummy - item String SfxObjectShellItem //! Dummy - item String SfxUsrAnyItem //! Dummy - item String SvxClipboardFmtItem; //! Dummy - - struct Point - { - INT32 X MID_X; - INT32 Y MID_Y; - }; - item Point SfxPointItem; - - struct Rectangle - { - INT32 Left MID_RECT_LEFT; - INT32 Top MID_RECT_TOP; - INT32 Width MID_WIDTH; - INT32 Height MID_HEIGHT; - }; - item Rectangle SfxRectangleItem; - - struct DocInfo - { - BOOL UseUserData MID_DOCINFO_USEUSERDATA; - BOOL DeleteUserData MID_DOCINFO_DELETEUSERDATA; - String Title MID_DOCINFO_TITLE; - String Subject MID_DOCINFO_SUBJECT; - String KeyWords MID_DOCINFO_KEYWORDS; - String Description MID_DOCINFO_DESCRIPTION; - BOOL AutoReload MID_DOCINFO_AUTOLOADENABLED; - INT32 AutoReloadTime MID_DOCINFO_AUTOLOADSECS; - String AutoReloadURL MID_DOCINFO_AUTOLOADURL; - String AutoReloadFrame MID_DOCINFO_DEFAULTTARGET; - }; - item DocInfo SfxDocumentInfoItem; - - struct SvxSearch - { - INT16 StyleFamily MID_SEARCH_STYLEFAMILY; - UINT16 CellType MID_SEARCH_CELLTYPE; - BOOL RowDirection MID_SEARCH_ROWDIRECTION; - BOOL AllTables MID_SEARCH_ALLTABLES; - BOOL Backward MID_SEARCH_BACKWARD; - BOOL Pattern MID_SEARCH_PATTERN; - BOOL Content MID_SEARCH_CONTENT; - BOOL AsianOptions MID_SEARCH_ASIANOPTIONS; - INT16 AlgorithmType MID_SEARCH_ALGORITHMTYPE; - INT32 SearchFlags MID_SEARCH_FLAGS; - String SearchString MID_SEARCH_SEARCHSTRING; - String ReplaceString MID_SEARCH_REPLACESTRING; - INT16 Locale MID_SEARCH_LOCALE; - INT32 ChangedChars MID_SEARCH_CHANGEDCHARS; - INT32 DeletedChars MID_SEARCH_DELETEDCHARS; - INT32 InsertedChars MID_SEARCH_INSERTEDCHARS; - INT32 TransliterateFlags MID_SEARCH_TRANSLITERATEFLAGS; - INT16 Command MID_SEARCH_COMMAND; - }; - item SvxSearch SvxSearchItem; - - struct SvxSize - { - INT32 Width MID_SIZE_WIDTH; - INT32 Height MID_SIZE_HEIGHT; - }; - item SvxSize SvxSizeItem; - - struct SfxScriptOrganizer - { - String Language MID_SCRIPT_ORGANIZER_LANGUAGE; - }; - item SfxScriptOrganizer SfxScriptOrganizerItem; - + include "sfxitems.sdi" include "sfx.sdi" include "docslots.sdi" - include "frmslots.sdi" include "viwslots.sdi" + include "frmslots.sdi" include "mdislots.sdi" include "appslots.sdi" + } diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx index 53ea87703ac6..8d13066a8340 100644 --- a/sfx2/source/appl/app.cxx +++ b/sfx2/source/appl/app.cxx @@ -45,19 +45,19 @@ #include <tools/config.hxx> #include <basic/basrdll.hxx> #include <svtools/asynclink.hxx> -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #ifndef _SOUND_HXX //autogen #include <vcl/sound.hxx> #endif -#include <svtools/eitem.hxx> -#include <svtools/urlbmk.hxx> +#include <svl/eitem.hxx> +#include <svl/urlbmk.hxx> #ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> #endif #include <svtools/sfxecode.hxx> #include <svtools/ehdl.hxx> -#include <svtools/svdde.hxx> +#include <svl/svdde.hxx> #include <tools/urlobj.hxx> #include <unotools/tempfile.hxx> #include <osl/file.hxx> @@ -65,7 +65,7 @@ #endif #define _SVSTDARR_STRINGSDTOR -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/uno/Any.hxx> @@ -136,29 +136,28 @@ #define DDE_AVAILABLE #endif -#include <svtools/saveopt.hxx> -#include <svtools/undoopt.hxx> +#include <unotools/saveopt.hxx> +#include <unotools/undoopt.hxx> #include <svtools/helpopt.hxx> -#include <svtools/pathoptions.hxx> -#include <svtools/viewoptions.hxx> -#include <svtools/moduleoptions.hxx> -#include <svtools/historyoptions.hxx> +#include <unotools/pathoptions.hxx> +#include <unotools/viewoptions.hxx> +#include <unotools/moduleoptions.hxx> +#include <unotools/historyoptions.hxx> #include <svtools/menuoptions.hxx> -#include <svtools/addxmltostorageoptions.hxx> #include <svtools/miscopt.hxx> -#include <svtools/useroptions.hxx> -#include <svtools/startoptions.hxx> -#include <svtools/securityoptions.hxx> -#include <svtools/localisationoptions.hxx> -#include <svtools/inetoptions.hxx> -#include <svtools/fontoptions.hxx> -#include <svtools/internaloptions.hxx> -#include <svtools/workingsetoptions.hxx> -#include <svtools/syslocaleoptions.hxx> -#include <svtools/syslocale.hxx> +#include <unotools/useroptions.hxx> +#include <unotools/startoptions.hxx> +#include <unotools/securityoptions.hxx> +#include <unotools/localisationoptions.hxx> +#include <unotools/inetoptions.hxx> +#include <unotools/fontoptions.hxx> +#include <unotools/internaloptions.hxx> +#include <unotools/workingsetoptions.hxx> +#include <unotools/syslocaleoptions.hxx> +#include <unotools/syslocale.hxx> #include <framework/addonsoptions.hxx> #include <svtools/ttprops.hxx> -#include <svtools/extendedsecurityoptions.hxx> +#include <unotools/extendedsecurityoptions.hxx> using namespace ::com::sun::star; @@ -359,7 +358,7 @@ SfxApplication::SfxApplication() RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ initialize DDE" ); #ifdef DDE_AVAILABLE -#ifdef PRODUCT +#ifndef DBG_UTIL InitializeDde(); #else if( !InitializeDde() ) diff --git a/sfx2/source/appl/appbas.cxx b/sfx2/source/appl/appbas.cxx index 37ba123b2aca..4fe352c3c4bc 100644 --- a/sfx2/source/appl/appbas.cxx +++ b/sfx2/source/appl/appbas.cxx @@ -36,15 +36,15 @@ #include <com/sun/star/uno/Reference.h> #include <basic/basrdll.hxx> #include <tools/urlobj.hxx> -#include <svtools/macitem.hxx> +#include <svl/macitem.hxx> #include <basic/sbxfac.hxx> #include <basic/sbx.hxx> #include <vcl/gradient.hxx> -#include <svtools/rectitem.hxx> -#include <svtools/intitem.hxx> -#include <svtools/eitem.hxx> +#include <svl/rectitem.hxx> +#include <svl/intitem.hxx> +#include <svl/eitem.hxx> #include <basic/sbmod.hxx> -#include <svtools/whiter.hxx> +#include <svl/whiter.hxx> #include <basic/sbmeth.hxx> #include <basic/sbstar.hxx> #include <vcl/wrkwin.hxx> @@ -53,9 +53,9 @@ #include <svtools/sfxecode.hxx> #include <svtools/ehdl.hxx> -#include <svtools/undoopt.hxx> -#include <svtools/pathoptions.hxx> -#include <svtools/useroptions.hxx> +#include <unotools/undoopt.hxx> +#include <unotools/pathoptions.hxx> +#include <unotools/useroptions.hxx> #include <unotools/bootstrap.hxx> #include <sfx2/appuno.hxx> diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx index af31659ec24c..5638800a9e4f 100644 --- a/sfx2/source/appl/appcfg.cxx +++ b/sfx2/source/appl/appcfg.cxx @@ -46,40 +46,39 @@ #include <vcl/sound.hxx> #include <vcl/msgbox.hxx> #include <tools/string.hxx> -#include <svtools/itempool.hxx> -#include <svtools/aeitem.hxx> -#include <svtools/slstitm.hxx> -#include <svtools/stritem.hxx> -#include <svtools/intitem.hxx> -#include <svtools/eitem.hxx> -#include <svtools/szitem.hxx> -#include <svtools/undo.hxx> +#include <svl/itempool.hxx> +#include <svl/aeitem.hxx> +#include <svl/slstitm.hxx> +#include <svl/stritem.hxx> +#include <svl/intitem.hxx> +#include <svl/eitem.hxx> +#include <svl/szitem.hxx> +#include <svl/undo.hxx> #define _SVSTDARR_STRINGS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <svtools/ttprops.hxx> #include <sfx2/sfxsids.hrc> #include <sot/exchange.hxx> //#include <svtools/agprop.hxx> //#include <sj2/sjapplet.hxx> -#include <svtools/isethint.hxx> +#include <svl/isethint.hxx> #include <unotools/configmgr.hxx> #include <tools/urlobj.hxx> #include <tools/wldcrd.hxx> -#include <svtools/saveopt.hxx> +#include <unotools/saveopt.hxx> #include <svtools/helpopt.hxx> -#include <svtools/undoopt.hxx> -#include <svtools/securityoptions.hxx> -#include <svtools/pathoptions.hxx> -#include <svtools/inetoptions.hxx> +#include <unotools/undoopt.hxx> +#include <unotools/securityoptions.hxx> +#include <unotools/pathoptions.hxx> +#include <unotools/inetoptions.hxx> #include <svtools/miscopt.hxx> #include <vcl/toolbox.hxx> #include <unotools/localfilehelper.hxx> #include <comphelper/processfactory.hxx> #include <rtl/ustrbuf.hxx> -#include <svtools/misccfg.hxx> #include <sfx2/app.hxx> #include <sfx2/docfile.hxx> @@ -1075,10 +1074,3 @@ void SfxApplication::NotifyEvent( const SfxEventHint& rEventHint, FASTBOOL bSync IMPL_OBJHINT( SfxStringHint, String ) -SfxMiscCfg* SfxApplication::GetMiscConfig() -{ - if ( !pAppData_Impl->pMiscConfig ) - pAppData_Impl->pMiscConfig = new SfxMiscCfg; - - return pAppData_Impl->pMiscConfig; -} diff --git a/sfx2/source/appl/appchild.cxx b/sfx2/source/appl/appchild.cxx index f9698c3b4782..5817337ae60d 100644 --- a/sfx2/source/appl/appchild.cxx +++ b/sfx2/source/appl/appchild.cxx @@ -33,8 +33,8 @@ #ifndef GCC #endif -#include <svtools/whiter.hxx> -#include <svtools/eitem.hxx> +#include <svl/whiter.hxx> +#include <svl/eitem.hxx> #include <sfx2/app.hxx> #include "appdata.hxx" diff --git a/sfx2/source/appl/appdata.cxx b/sfx2/source/appl/appdata.cxx index 23de7317c379..e53a4cacdb93 100644 --- a/sfx2/source/appl/appdata.cxx +++ b/sfx2/source/appl/appdata.cxx @@ -33,17 +33,17 @@ #include <tools/cachestr.hxx> #include <tools/config.hxx> #ifndef _INETSTRM_HXX //autogen -#include <svtools/inetstrm.hxx> +#include <svl/inetstrm.hxx> #endif -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #define _SVSTDARR_STRINGS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <vos/mutex.hxx> #include <vcl/menu.hxx> #include <vcl/msgbox.hxx> -#include <svtools/dateitem.hxx> +#include <svl/dateitem.hxx> #include <vcl/menu.hxx> #include <vcl/wrkwin.hxx> #include "comphelper/processfactory.hxx" @@ -109,7 +109,6 @@ SfxAppData_Impl::SfxAppData_Impl( SfxApplication* pApp ) : pEventConfig(0), pDisabledSlotList( 0 ), pSecureURLs(0), - pMiscConfig(0), pSaveOptions( 0 ), pUndoOptions( 0 ), pHelpOptions( 0 ), diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx index ec26ead8a792..f5b3a2e6dca1 100644 --- a/sfx2/source/appl/appdde.cxx +++ b/sfx2/source/appl/appdde.cxx @@ -31,17 +31,17 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" #include <vcl/wrkwin.hxx> -#include <svtools/rectitem.hxx> -#include <svtools/eitem.hxx> -#include <svtools/intitem.hxx> +#include <svl/rectitem.hxx> +#include <svl/eitem.hxx> +#include <svl/intitem.hxx> #include <basic/sbstar.hxx> -#include <svtools/stritem.hxx> -#include <svtools/svdde.hxx> +#include <svl/stritem.hxx> +#include <svl/svdde.hxx> #include <sfx2/lnkbase.hxx> #include <sfx2/linkmgr.hxx> #include <tools/urlobj.hxx> -#include <svtools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> #ifndef GCC #endif diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx index 98439eb5a6dc..837ccc461586 100644 --- a/sfx2/source/appl/appinit.cxx +++ b/sfx2/source/appl/appinit.cxx @@ -38,17 +38,17 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <svtools/soerr.hxx> -#include <svtools/svtools.hrc> -#include <svtools/saveopt.hxx> -#include <svtools/localisationoptions.hxx> +#include <svl/svtools.hrc> +#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 <svtools/intitem.hxx> -#include <svtools/eitem.hxx> -#include <svtools/stritem.hxx> +#include <svl/intitem.hxx> +#include <svl/eitem.hxx> +#include <svl/stritem.hxx> #ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> #endif @@ -60,9 +60,9 @@ #include <rtl/ustrbuf.hxx> #include <vos/security.hxx> #include <ucbhelper/configurationkeys.hxx> -#include <svtools/pathoptions.hxx> -#include <svtools/historyoptions.hxx> -#include <svtools/moduleoptions.hxx> +#include <unotools/pathoptions.hxx> +#include <unotools/historyoptions.hxx> +#include <unotools/moduleoptions.hxx> #include <cppuhelper/implbase2.hxx> #include <rtl/logfile.hxx> diff --git a/sfx2/source/appl/appmain.cxx b/sfx2/source/appl/appmain.cxx index a65a16e3b518..253311c54f3d 100644 --- a/sfx2/source/appl/appmain.cxx +++ b/sfx2/source/appl/appmain.cxx @@ -37,12 +37,11 @@ #include <stdio.h> #include <tools/urlobj.hxx> -#include <svtools/cstitem.hxx> #include <tools/config.hxx> #include <svtools/ehdl.hxx> -#include <svtools/startoptions.hxx> -#include <svtools/itempool.hxx> -#include <svtools/urihelper.hxx> +#include <unotools/startoptions.hxx> +#include <svl/itempool.hxx> +#include <svl/urihelper.hxx> #include <svtools/helpopt.hxx> #include <vos/process.hxx> #include <framework/sfxhelperfunctions.hxx> @@ -124,7 +123,7 @@ void SfxApplication::Init */ { #ifdef DDE_AVAILABLE -#ifdef PRODUCT +#ifndef DBG_UTIL InitializeDde(); #else if( !InitializeDde() ) diff --git a/sfx2/source/appl/appmisc.cxx b/sfx2/source/appl/appmisc.cxx index 08a61b1f0ce6..1bb12990cb42 100644 --- a/sfx2/source/appl/appmisc.cxx +++ b/sfx2/source/appl/appmisc.cxx @@ -36,13 +36,13 @@ #include <vos/process.hxx> #endif #include <vos/xception.hxx> -#include <svtools/whiter.hxx> -#include <svtools/stritem.hxx> -#include <svtools/intitem.hxx> -#include <svtools/eitem.hxx> +#include <svl/whiter.hxx> +#include <svl/stritem.hxx> +#include <svl/intitem.hxx> +#include <svl/eitem.hxx> #include <svtools/filter.hxx> -#include <svtools/internaloptions.hxx> -#include <svtools/pathoptions.hxx> +#include <unotools/internaloptions.hxx> +#include <unotools/pathoptions.hxx> #include <com/sun/star/registry/InvalidRegistryException.hpp> #ifndef _COM_SUN_STAR_BEANS_PropertyValue_HPP_ #include <com/sun/star/beans/PropertyValue.hpp> @@ -64,7 +64,7 @@ #include <comphelper/processfactory.hxx> #include <unotools/localfilehelper.hxx> #include <unotools/bootstrap.hxx> -#include <svtools/moduleoptions.hxx> +#include <unotools/moduleoptions.hxx> #include <osl/file.hxx> #include "sfxresid.hxx" @@ -189,7 +189,7 @@ void SfxApplication::InitializeDisplayName_Impl() aGuard.clear(); -#ifndef PRODUCT +#ifdef DBG_UTIL ::rtl::OUString aDefault; aTitle += DEFINE_CONST_UNICODE(" ["); diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index ddd6925be3a6..469a198db64e 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -64,22 +64,22 @@ #include <comphelper/sequenceasvector.hxx> #include <vcl/wrkwin.hxx> -#include <svtools/intitem.hxx> +#include <svl/intitem.hxx> #include <vcl/msgbox.hxx> -#include <svtools/stritem.hxx> -#include <svtools/eitem.hxx> +#include <svl/stritem.hxx> +#include <svl/eitem.hxx> #include <sfx2/doctempl.hxx> #include <svtools/sfxecode.hxx> #include <framework/preventduplicateinteraction.hxx> #include <svtools/ehdl.hxx> #include <basic/sbxobj.hxx> -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #include <unotools/localfilehelper.hxx> -#include <svtools/pathoptions.hxx> -#include <svtools/moduleoptions.hxx> +#include <unotools/pathoptions.hxx> +#include <unotools/moduleoptions.hxx> #include <svtools/templdlg.hxx> #include <osl/file.hxx> -#include <svtools/extendedsecurityoptions.hxx> +#include <unotools/extendedsecurityoptions.hxx> #include <comphelper/docpasswordhelper.hxx> #include <vcl/svapp.hxx> @@ -95,7 +95,7 @@ #include <sfx2/new.hxx> #include <sfx2/objitem.hxx> #include <sfx2/objsh.hxx> -#include <svtools/slstitm.hxx> +#include <svl/slstitm.hxx> #include "objshimp.hxx" #include "openflag.hxx" #include <sfx2/passwd.hxx> @@ -112,7 +112,7 @@ #include <sfx2/event.hxx> #define _SVSTDARR_STRINGSDTOR -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::beans; diff --git a/sfx2/source/appl/appquit.cxx b/sfx2/source/appl/appquit.cxx index 16ae1fe236a9..63d33e54997b 100644 --- a/sfx2/source/appl/appquit.cxx +++ b/sfx2/source/appl/appquit.cxx @@ -36,14 +36,14 @@ #ifdef WIN #define _TL_LANG_SPECIAL #endif -#include <svtools/svdde.hxx> +#include <svl/svdde.hxx> #ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> #endif -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> -#include <svtools/saveopt.hxx> -#include <svtools/misccfg.hxx> +#include <unotools/saveopt.hxx> +#include <unotools/misccfg.hxx> #ifndef GCC #endif @@ -77,7 +77,7 @@ using ::basic::BasicManagerRepository; -#ifndef PRODUCT +#ifdef DBG_UTIL DECLARE_LIST( SfxFrameWindowFactoryArray_Impl, SfxFrameWindowFactory* ) SV_DECL_PTRARR(SfxInitLinkList, Link*, 2, 2) #endif @@ -203,16 +203,15 @@ void SfxApplication::Deinitialize() delete pAppData_Impl->pLabelResMgr; -#ifndef PRODUCT +#ifdef DBG_UTIL DELETEX(pAppData_Impl->pSlotPool); DELETEX(pAppData_Impl->pEventConfig); - DELETEX(pAppData_Impl->pMiscConfig); SfxMacroConfig::Release_Impl(); DELETEX(pAppData_Impl->pFactArr); DELETEX(pAppData_Impl->pInitLinkList); #endif -#ifndef PRODUCT +#ifdef DBG_UTIL DELETEX(pAppData_Impl->pTbxCtrlFac); DELETEX(pAppData_Impl->pStbCtrlFac); DELETEX(pAppData_Impl->pMenuCtrlFac); diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 184ecb9f1a5c..4580a11270e0 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -62,7 +62,7 @@ #ifndef _SVT_DOC_ADDRESSTEMPLATE_HXX_ #include <svtools/addresstemplate.hxx> #endif -#include <svtools/visitem.hxx> +#include <svl/visitem.hxx> #include <unotools/intlwrapper.hxx> #ifndef _UNOTOOLS_CONFIGMGR_HXX_ @@ -71,10 +71,10 @@ #include <tools/config.hxx> #include <tools/diagnose_ex.h> #include <vcl/msgbox.hxx> -#include <svtools/cancel.hxx> -#include <svtools/intitem.hxx> -#include <svtools/eitem.hxx> -#include <svtools/stritem.hxx> +#include <svl/cancel.hxx> +#include <svl/intitem.hxx> +#include <svl/eitem.hxx> +#include <svl/stritem.hxx> #include <basic/sbstar.hxx> #include <basic/basmgr.hxx> #include <basic/basrdll.hxx> @@ -84,9 +84,9 @@ #include <vcl/stdtext.hxx> #include <rtl/ustrbuf.hxx> -#include <svtools/pathoptions.hxx> -#include <svtools/moduleoptions.hxx> -#include <svtools/regoptions.hxx> +#include <unotools/pathoptions.hxx> +#include <unotools/moduleoptions.hxx> +#include <unotools/regoptions.hxx> #include <svtools/helpopt.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <tools/shl.hxx> @@ -1209,7 +1209,7 @@ void SfxApplication::OfaState_Impl(SfxItemSet &rSet) { case SID_ONLINE_REGISTRATION: { - ::svt::RegOptions aOptions; + ::utl::RegOptions aOptions; if ( !aOptions.allowMenu() ) rSet.DisableItem( SID_ONLINE_REGISTRATION ); } diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index c9814eb50e6a..7fb6ef35167f 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -43,8 +43,8 @@ #include "sfx2/dllapi.h" #include <basic/sbx.hxx> -#include <svtools/itempool.hxx> -#include <svtools/rectitem.hxx> +#include <svl/itempool.hxx> +#include <svl/rectitem.hxx> #include <tools/debug.hxx> #include <tools/wldcrd.hxx> @@ -60,12 +60,12 @@ #endif #include <basic/sbxcore.hxx> -#include <svtools/ownlist.hxx> -#include <svtools/lckbitem.hxx> -#include <svtools/stritem.hxx> -#include <svtools/slstitm.hxx> -#include <svtools/intitem.hxx> -#include <svtools/eitem.hxx> +#include <svl/ownlist.hxx> +#include <svl/lckbitem.hxx> +#include <svl/stritem.hxx> +#include <svl/slstitm.hxx> +#include <svl/intitem.hxx> +#include <svl/eitem.hxx> #include <com/sun/star/task/XStatusIndicatorFactory.hpp> #include <com/sun/star/task/XInteractionHandler.hpp> #include <com/sun/star/io/XInputStream.hpp> diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx index 60beac537e53..23a08e71356f 100644 --- a/sfx2/source/appl/childwin.cxx +++ b/sfx2/source/appl/childwin.cxx @@ -37,7 +37,7 @@ #ifndef _RCID_H #include <tools/rcid.h> #endif -#include <svtools/viewoptions.hxx> +#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> diff --git a/sfx2/source/appl/impldde.cxx b/sfx2/source/appl/impldde.cxx index e5c93b0bdbba..2bf84f87e973 100644 --- a/sfx2/source/appl/impldde.cxx +++ b/sfx2/source/appl/impldde.cxx @@ -53,7 +53,7 @@ #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Sequence.hxx> -#include <svtools/svdde.hxx> +#include <svl/svdde.hxx> #include <sot/formats.hxx> #define DDELINK_COLD 0 diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx index f06ecada0226..3533fb8a428f 100644 --- a/sfx2/source/appl/linkmgr2.cxx +++ b/sfx2/source/appl/linkmgr2.cxx @@ -47,7 +47,7 @@ #define _SVSTDARR_STRINGSDTOR -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> namespace sfx2 diff --git a/sfx2/source/appl/linksrc.cxx b/sfx2/source/appl/linksrc.cxx index 8ad25458e1b2..f7ff7b161588 100644 --- a/sfx2/source/appl/linksrc.cxx +++ b/sfx2/source/appl/linksrc.cxx @@ -39,7 +39,7 @@ #include <tools/debug.hxx> #include <vcl/timer.hxx> -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> using namespace ::com::sun::star::uno; diff --git a/sfx2/source/appl/lnkbase2.cxx b/sfx2/source/appl/lnkbase2.cxx index 5f10d4062e68..8a852b44b6f7 100644 --- a/sfx2/source/appl/lnkbase2.cxx +++ b/sfx2/source/appl/lnkbase2.cxx @@ -50,7 +50,7 @@ #include <tools/debug.hxx> -#include <svtools/svdde.hxx> +#include <svl/svdde.hxx> using namespace ::com::sun::star::uno; diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 5051f71ab78e..c5412f35d0f6 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -95,10 +95,10 @@ #include <com/sun/star/view/XViewSettingsSupplier.hpp> #include <com/sun/star/ui/XDockingAreaAcceptor.hpp> #include <svtools/helpopt.hxx> -#include <svtools/historyoptions.hxx> +#include <unotools/historyoptions.hxx> #include <svtools/menuoptions.hxx> -#include <svtools/pathoptions.hxx> -#include <svtools/viewoptions.hxx> +#include <unotools/pathoptions.hxx> +#include <unotools/viewoptions.hxx> #include <svtools/svtdata.hxx> #include <tools/urlobj.hxx> #include <tools/cachestr.hxx> @@ -296,7 +296,7 @@ ContentListBox_Impl::ContentListBox_Impl( Window* pParent, const ResId& rResId ) aDocumentImage ( SfxResId( IMG_HELP_CONTENT_DOC ) ) { - if ( GetSettings().GetStyleSettings().GetWindowColor().IsDark() ) + if ( GetSettings().GetStyleSettings().GetHighContrastMode() ) { aOpenBookImage = Image( SfxResId( IMG_HELP_CONTENT_BOOK_OPEN_HC ) ); aClosedBookImage = Image( SfxResId( IMG_HELP_CONTENT_BOOK_CLOSED_HC ) ); @@ -2139,7 +2139,7 @@ SfxHelpTextWindow_Impl::SfxHelpTextWindow_Impl( SfxHelpWindow_Impl* pParent ) : if ( pEnv ) bIsDebug = sal_True; - SvtMiscOptions().AddListener( LINK( this, SfxHelpTextWindow_Impl, NotifyHdl ) ); + SvtMiscOptions().AddListenerLink( LINK( this, SfxHelpTextWindow_Impl, NotifyHdl ) ); if ( aOnStartupCB.GetHelpId() == 0 ) aOnStartupCB.SetHelpId( HID_HELP_ONSTARTUP_BOX ); @@ -2152,7 +2152,7 @@ SfxHelpTextWindow_Impl::~SfxHelpTextWindow_Impl() sfx2::RemoveFromTaskPaneList( &aToolBox ); bIsInClose = sal_True; - SvtMiscOptions().RemoveListener( LINK( this, SfxHelpTextWindow_Impl, NotifyHdl ) ); + SvtMiscOptions().RemoveListenerLink( LINK( this, SfxHelpTextWindow_Impl, NotifyHdl ) ); delete pSrchDlg; } @@ -2178,7 +2178,7 @@ sal_Bool SfxHelpTextWindow_Impl::HasSelection() const void SfxHelpTextWindow_Impl::InitToolBoxImages() { sal_Bool bLarge = SvtMiscOptions().AreCurrentSymbolsLarge(); - sal_Bool bHiContrast = GetBackground().GetColor().IsDark(); + sal_Bool bHiContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); aIndexOnImage = Image( SfxResId( bLarge ? bHiContrast ? IMG_HELP_TOOLBOX_HCL_INDEX_ON : IMG_HELP_TOOLBOX_L_INDEX_ON @@ -2584,7 +2584,7 @@ long SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& rNEvt ) if ( pCmdEvt->GetCommand() == COMMAND_CONTEXTMENU && pCmdWin != this && pCmdWin != &aToolBox ) { - sal_Bool bHiContrast = GetSettings().GetStyleSettings().GetMenuColor().IsDark(); + sal_Bool bHiContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); Point aPos; if ( pCmdEvt->IsMouseEvent() ) aPos = pCmdEvt->GetMousePosPixel(); diff --git a/sfx2/source/appl/newhelp.hxx b/sfx2/source/appl/newhelp.hxx index 69b16058db8f..acda2cf312e7 100644 --- a/sfx2/source/appl/newhelp.hxx +++ b/sfx2/source/appl/newhelp.hxx @@ -52,7 +52,7 @@ namespace com { namespace sun { namespace star { namespace text { class XTextRan #include <vcl/lstbox.hxx> #include <vcl/dialog.hxx> #include <svtools/svtreebx.hxx> -#include <svtools/moduleoptions.hxx> +#include <unotools/moduleoptions.hxx> #include "srchdlg.hxx" diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 8a6622636c14..491de2138917 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -56,12 +56,12 @@ #include <unotools/configmgr.hxx> #include <unotools/configitem.hxx> #include <svtools/helpopt.hxx> -#include <svtools/moduleoptions.hxx> +#include <unotools/moduleoptions.hxx> #include <tools/urlobj.hxx> #include <unotools/configmgr.hxx> #include <ucbhelper/content.hxx> -#include <svtools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> #include <rtl/ustring.hxx> #include <osl/process.h> #include <osl/file.hxx> @@ -74,7 +74,7 @@ #define _SVSTDARR_STRINGSDTOR #define _SVSTDARR_ULONGSSORT -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <sfx2/sfxsids.hrc> #include <sfx2/app.hxx> @@ -237,6 +237,8 @@ public: ~SfxHelpOptions_Impl(); BOOL HasId( ULONG nId ) { USHORT nDummy; return m_pIds ? m_pIds->Seek_Entry( nId, &nDummy ) : FALSE; } + virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ); + virtual void Commit(); }; static Sequence< ::rtl::OUString > GetPropertyNames() @@ -309,6 +311,15 @@ SfxHelpOptions_Impl::~SfxHelpOptions_Impl() delete m_pIds; } + +void SfxHelpOptions_Impl::Notify( const com::sun::star::uno::Sequence< rtl::OUString >& ) +{ +} + +void SfxHelpOptions_Impl::Commit() +{ +} + // class SfxHelp_Impl ---------------------------------------------------- class SfxHelp_Impl diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx index 91227e3e34ec..48b7ecdd1540 100644 --- a/sfx2/source/appl/sfxpicklist.cxx +++ b/sfx2/source/appl/sfxpicklist.cxx @@ -32,13 +32,13 @@ #include "precompiled_sfx2.hxx" #include <com/sun/star/document/XDocumentProperties.hpp> -#include <svtools/historyoptions.hxx> -#include <svtools/useroptions.hxx> +#include <unotools/historyoptions.hxx> +#include <unotools/useroptions.hxx> #include <tools/urlobj.hxx> #include <framework/menuconfiguration.hxx> -#include <svtools/inethist.hxx> -#include <svtools/stritem.hxx> -#include <svtools/eitem.hxx> +#include <svl/inethist.hxx> +#include <svl/stritem.hxx> +#include <svl/eitem.hxx> #include <osl/file.hxx> #include <unotools/localfilehelper.hxx> #include <cppuhelper/implbase1.hxx> diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx index 995b8250e072..52805082de38 100644 --- a/sfx2/source/appl/shutdownicon.cxx +++ b/sfx2/source/appl/shutdownicon.cxx @@ -69,6 +69,7 @@ #include <unistd.h> #include <errno.h> #endif +#include <vcl/timer.hxx> #include "sfxresid.hxx" @@ -186,6 +187,23 @@ bool ShutdownIcon::LoadModule( osl::Module **pModule, return true; } +class IdleUnloader : Timer +{ + ::osl::Module *m_pModule; +public: + IdleUnloader (::osl::Module **pModule) : + m_pModule (*pModule) + { + *pModule = NULL; + Start(); + } + virtual void Timeout() + { + delete m_pModule; + delete this; + } +}; + void ShutdownIcon::initSystray() { if (m_bInitialized) @@ -201,15 +219,15 @@ void ShutdownIcon::deInitSystray() { if (!m_bInitialized) return; + if (m_pDeInitSystray) m_pDeInitSystray(); m_bVeto = false; m_pInitSystray = 0; m_pDeInitSystray = 0; - if (m_pPlugin) - delete m_pPlugin; - m_pPlugin = 0; + new IdleUnloader (&m_pPlugin); + delete m_pFileDlg; m_pFileDlg = NULL; m_bInitialized = false; @@ -233,6 +251,7 @@ ShutdownIcon::ShutdownIcon( Reference< XMultiServiceFactory > aSMgr ) : ShutdownIcon::~ShutdownIcon() { deInitSystray(); + new IdleUnloader (&m_pPlugin); } // --------------------------------------------------------------------------- @@ -853,9 +872,11 @@ void ShutdownIcon::SetAutostart( bool bActivate ) ::osl::File::getFileURLFromSystemPath( aShortcut, aShortcutUrl ); ::osl::File::remove( aShortcutUrl ); #ifdef UNX - ShutdownIcon *pIcon = getInstance(); - if( pIcon ) + if (pShutdownIcon) + { + ShutdownIcon *pIcon = getInstance(); pIcon->deInitSystray(); + } #endif } #elif defined OS2 diff --git a/sfx2/source/appl/shutdowniconOs2.cxx b/sfx2/source/appl/shutdowniconOs2.cxx index 6b69b5d0fae8..f4108950db22 100644 --- a/sfx2/source/appl/shutdowniconOs2.cxx +++ b/sfx2/source/appl/shutdowniconOs2.cxx @@ -29,9 +29,9 @@ ************************************************************************/ -#include <svtools/moduleoptions.hxx> +#include <unotools/moduleoptions.hxx> -#include <svtools/dynamicmenuoptions.hxx> +#include <unotools/dynamicmenuoptions.hxx> #include "shutdownicon.hxx" #include <comphelper/processfactory.hxx> diff --git a/sfx2/source/appl/shutdowniconaqua.mm b/sfx2/source/appl/shutdowniconaqua.mm index e9326b4a22c2..27aa37e05c74 100644 --- a/sfx2/source/appl/shutdowniconaqua.mm +++ b/sfx2/source/appl/shutdowniconaqua.mm @@ -31,9 +31,9 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" -#include "svtools/moduleoptions.hxx" -#include "svtools/dynamicmenuoptions.hxx" -#include "svtools/historyoptions.hxx" +#include "unotools/moduleoptions.hxx" +#include "unotools/dynamicmenuoptions.hxx" +#include "unotools/historyoptions.hxx" #include "tools/urlobj.hxx" #include "osl/file.h" #include "comphelper/sequenceashashmap.hxx" diff --git a/sfx2/source/appl/shutdowniconunx.cxx b/sfx2/source/appl/shutdowniconunx.cxx index f68d367df658..b9799f5818b7 100644 --- a/sfx2/source/appl/shutdowniconunx.cxx +++ b/sfx2/source/appl/shutdowniconunx.cxx @@ -1,9 +1,9 @@ #ifdef ENABLE_QUICKSTART_APPLET -#include <svtools/moduleoptions.hxx> +#include <unotools/moduleoptions.hxx> -#include <svtools/dynamicmenuoptions.hxx> +#include <unotools/dynamicmenuoptions.hxx> #include <gtk/gtk.h> #include <glib.h> diff --git a/sfx2/source/appl/shutdowniconw32.cxx b/sfx2/source/appl/shutdowniconw32.cxx index 414b400d7377..676a46ab584f 100644 --- a/sfx2/source/appl/shutdowniconw32.cxx +++ b/sfx2/source/appl/shutdowniconw32.cxx @@ -45,9 +45,9 @@ // // the systray icon is only available on windows // -#include <svtools/moduleoptions.hxx> -#include <svtools/dynamicmenuoptions.hxx> +#include <unotools/moduleoptions.hxx> +#include <unotools/dynamicmenuoptions.hxx> #include "shutdownicon.hxx" #include "app.hrc" diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx index d2338a9c7226..7287023f1845 100644 --- a/sfx2/source/appl/workwin.cxx +++ b/sfx2/source/appl/workwin.cxx @@ -57,12 +57,12 @@ #include <vcl/toolbox.hxx> #include <tools/rcid.h> #include <toolkit/helper/vclunohelper.hxx> -#include <svtools/itempool.hxx> -#include <svtools/itemiter.hxx> -#include <svtools/whiter.hxx> -#include <svtools/intitem.hxx> +#include <svl/itempool.hxx> +#include <svl/itemiter.hxx> +#include <svl/whiter.hxx> +#include <svl/intitem.hxx> #ifndef _SFXEITEM_HXX //autogen -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #endif #include <com/sun/star/ui/XUIElement.hpp> #include <com/sun/star/frame/XLayoutManager.hpp> diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx index 358c226d6c4a..4b4c17a2c5f2 100644 --- a/sfx2/source/bastyp/fltfnc.cxx +++ b/sfx2/source/bastyp/fltfnc.cxx @@ -60,12 +60,12 @@ #include <rtl/ustring.hxx> #endif #include <rtl/ustrbuf.hxx> -#include <svtools/eitem.hxx> -#include <svtools/intitem.hxx> -#include <svtools/stritem.hxx> -#include <svtools/lckbitem.hxx> -#include <svtools/inettype.hxx> -#include <svtools/rectitem.hxx> +#include <svl/eitem.hxx> +#include <svl/intitem.hxx> +#include <svl/stritem.hxx> +#include <svl/lckbitem.hxx> +#include <svl/inettype.hxx> +#include <svl/rectitem.hxx> #include <sot/storage.hxx> #include <com/sun/star/frame/XDispatchProviderInterceptor.hpp> @@ -97,8 +97,8 @@ #include <com/sun/star/ucb/XContent.hpp> #include <rtl/ustring.hxx> #include <vos/process.hxx> -#include <svtools/pathoptions.hxx> -#include <svtools/moduleoptions.hxx> +#include <unotools/pathoptions.hxx> +#include <unotools/moduleoptions.hxx> #include <comphelper/mediadescriptor.hxx> #include <tools/urlobj.hxx> @@ -109,9 +109,9 @@ using namespace ::com::sun::star::ucb; using namespace ::com::sun::star::document; using namespace ::com::sun::star::beans; using namespace ::vos; -#include <svtools/ctypeitm.hxx> +#include <svl/ctypeitm.hxx> #include <svtools/sfxecode.hxx> -#include <svtools/syslocale.hxx> +#include <unotools/syslocale.hxx> #include "sfxhelp.hxx" #include "sfxbasic.hxx" diff --git a/sfx2/source/bastyp/frmhtml.cxx b/sfx2/source/bastyp/frmhtml.cxx index 4086cf2b1b96..5cb4f0200614 100644 --- a/sfx2/source/bastyp/frmhtml.cxx +++ b/sfx2/source/bastyp/frmhtml.cxx @@ -38,7 +38,7 @@ #define _SVSTDARR_USHORTS #define _SVSTDARR_ULONGS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <sfx2/sfx.hrc> diff --git a/sfx2/source/bastyp/frmhtmlw.cxx b/sfx2/source/bastyp/frmhtmlw.cxx index 96a55c9a95f4..2d1c6db11762 100644 --- a/sfx2/source/bastyp/frmhtmlw.cxx +++ b/sfx2/source/bastyp/frmhtmlw.cxx @@ -32,7 +32,7 @@ #include "precompiled_sfx2.hxx" #ifndef _INETDEF_HXX -#include <svtools/inetdef.hxx> +#include <svl/inetdef.hxx> #endif #include "svtools/htmlkywd.hxx" @@ -40,7 +40,7 @@ #include <rtl/tencinfo.h> #include <unotools/configmgr.hxx> -#include "svtools/urihelper.hxx" +#include "svl/urihelper.hxx" #include <tools/datetime.hxx> #include <sfx2/frmhtmlw.hxx> diff --git a/sfx2/source/bastyp/progress.cxx b/sfx2/source/bastyp/progress.cxx index 121b8604e02d..8f143bb4baee 100644 --- a/sfx2/source/bastyp/progress.cxx +++ b/sfx2/source/bastyp/progress.cxx @@ -39,7 +39,7 @@ #include <basic/sbx.hxx> #endif -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #include <tools/time.hxx> // wg. nRescheduleLocks diff --git a/sfx2/source/bastyp/sfxhtml.cxx b/sfx2/source/bastyp/sfxhtml.cxx index 13a75eb05693..794ee142708c 100644 --- a/sfx2/source/bastyp/sfxhtml.cxx +++ b/sfx2/source/bastyp/sfxhtml.cxx @@ -46,9 +46,9 @@ #include <svtools/imaprect.hxx> #ifndef _SVSTDARR_ULONGS_DECL #define _SVSTDARR_ULONGS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif -#include <svtools/zforlist.hxx> +#include <svl/zforlist.hxx> #include <rtl/tencinfo.h> #include <tools/tenccvt.hxx> diff --git a/sfx2/source/config/evntconf.cxx b/sfx2/source/config/evntconf.cxx index daf9174d20cb..763595913fcd 100644 --- a/sfx2/source/config/evntconf.cxx +++ b/sfx2/source/config/evntconf.cxx @@ -34,14 +34,14 @@ #ifndef _SV_RESARY_HXX #include <tools/resary.hxx> #endif -#include <svtools/lstner.hxx> +#include <svl/lstner.hxx> #include <basic/basmgr.hxx> #include <basic/sbmod.hxx> #include <tools/urlobj.hxx> #include <basic/sbx.hxx> #include <sot/storage.hxx> -#include <svtools/securityoptions.hxx> +#include <unotools/securityoptions.hxx> #ifndef _RTL_USTRING_ #include <rtl/ustring.h> diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx index 48c4b16fbf8c..7bf2c1c6dfe7 100644 --- a/sfx2/source/control/bindings.cxx +++ b/sfx2/source/control/bindings.cxx @@ -32,13 +32,13 @@ #include "precompiled_sfx2.hxx" #include <hash_map> -#include <svtools/itempool.hxx> -#include <svtools/itemiter.hxx> -#include <svtools/eitem.hxx> -#include <svtools/aeitem.hxx> -#include <svtools/intitem.hxx> -#include <svtools/stritem.hxx> -#include <svtools/visitem.hxx> +#include <svl/itempool.hxx> +#include <svl/itemiter.hxx> +#include <svl/eitem.hxx> +#include <svl/aeitem.hxx> +#include <svl/intitem.hxx> +#include <svl/stritem.hxx> +#include <svl/visitem.hxx> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XDispatchProviderInterceptor.hpp> #include <com/sun/star/frame/XDispatch.hpp> @@ -1711,7 +1711,10 @@ IMPL_LINK( SfxBindings, NextJob_Impl, Timer *, pTimer ) // modifying the SfxObjectInterface-stack without SfxBindings => nothing to do SfxViewFrame* pFrame = pDispatcher->GetFrame(); - if ( (pFrame && pFrame->GetObjectShell()->IsInModalMode()) || pSfxApp->IsDowning() || !pImp->pCaches->Count() ) + //<!--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; diff --git a/sfx2/source/control/ctrlitem.cxx b/sfx2/source/control/ctrlitem.cxx index 1c2c047b228d..f39c480fbdeb 100644 --- a/sfx2/source/control/ctrlitem.cxx +++ b/sfx2/source/control/ctrlitem.cxx @@ -30,7 +30,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" -#include <svtools/itempool.hxx> +#include <svl/itempool.hxx> #ifndef GCC #endif diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index f57ca40e8519..fa3330059859 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -33,14 +33,14 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/frame/XDispatchRecorderSupplier.hpp> #include <com/sun/star/frame/XLayoutManager.hpp> -#include <svtools/itempool.hxx> -#include <svtools/itemiter.hxx> -#include <svtools/whiter.hxx> -#include <svtools/intitem.hxx> +#include <svl/itempool.hxx> +#include <svl/itemiter.hxx> +#include <svl/whiter.hxx> +#include <svl/intitem.hxx> #ifndef _SFXEITEM_HXX //autogen -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #endif -#include <svtools/undo.hxx> +#include <svl/undo.hxx> #ifndef _WRKWIN_HXX //autogen #include <vcl/wrkwin.hxx> #endif @@ -50,7 +50,7 @@ #include <stdlib.h> // wg. bsearch #define _SVSTDARR_ULONGS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <svtools/helpopt.hxx> #include <com/sun/star/frame/XLayoutManager.hpp> #include <com/sun/star/beans/XPropertySet.hpp> diff --git a/sfx2/source/control/macrconf.cxx b/sfx2/source/control/macrconf.cxx index ebc621a56bd9..d4149421f161 100644 --- a/sfx2/source/control/macrconf.cxx +++ b/sfx2/source/control/macrconf.cxx @@ -35,7 +35,7 @@ #ifndef _SBX_HXX //autogen #include <basic/sbx.hxx> #endif -#include <svtools/intitem.hxx> +#include <svl/intitem.hxx> #include <basic/sbmeth.hxx> #include <basic/sbmod.hxx> #ifndef _BASIC_SBUNO_HXX diff --git a/sfx2/source/control/makefile.mk b/sfx2/source/control/makefile.mk index 481952409d6c..9d936549b5b3 100644 --- a/sfx2/source/control/makefile.mk +++ b/sfx2/source/control/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2008 by Sun Microsystems, Inc. # # OpenOffice.org - a multi-platform office productivity suite @@ -47,6 +47,10 @@ CFLAGS+=-Od .ENDIF .ENDIF +.IF "$(COM)"=="GCC" +CFLAGS+=-O0 +.ENDIF + # --- Files -------------------------------------------------------- SLOFILES = \ diff --git a/sfx2/source/control/msg.cxx b/sfx2/source/control/msg.cxx index e65c866428e4..0b0a8d2480ed 100644 --- a/sfx2/source/control/msg.cxx +++ b/sfx2/source/control/msg.cxx @@ -30,8 +30,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" -#include <svtools/itempool.hxx> -#include <svtools/eitem.hxx> +#include <svl/itempool.hxx> +#include <svl/eitem.hxx> #ifndef GCC #endif diff --git a/sfx2/source/control/querystatus.cxx b/sfx2/source/control/querystatus.cxx index f5794094f15f..f57d3a3d32f2 100644 --- a/sfx2/source/control/querystatus.cxx +++ b/sfx2/source/control/querystatus.cxx @@ -31,13 +31,13 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" #include <sfx2/querystatus.hxx> -#include <svtools/poolitem.hxx> -#include <svtools/eitem.hxx> -#include <svtools/stritem.hxx> -#include <svtools/intitem.hxx> -#include <svtools/itemset.hxx> +#include <svl/poolitem.hxx> +#include <svl/eitem.hxx> +#include <svl/stritem.hxx> +#include <svl/intitem.hxx> +#include <svl/itemset.hxx> #include <svtools/itemdel.hxx> -#include <svtools/visitem.hxx> +#include <svl/visitem.hxx> #include <cppuhelper/weak.hxx> #include <comphelper/processfactory.hxx> #include <vos/mutex.hxx> diff --git a/sfx2/source/control/request.cxx b/sfx2/source/control/request.cxx index 61747fae7d32..ef47fc088e32 100644 --- a/sfx2/source/control/request.cxx +++ b/sfx2/source/control/request.cxx @@ -39,10 +39,10 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XDispatchRecorderSupplier.hpp> -#include <svtools/itemiter.hxx> +#include <svl/itemiter.hxx> #ifndef _ARGS_HXX //autogen -#include <svtools/itempool.hxx> +#include <svl/itempool.hxx> #endif #include <svtools/itemdel.hxx> @@ -51,7 +51,7 @@ #ifndef GCC #endif -#include <svtools/smplhint.hxx> +#include <svl/smplhint.hxx> #include <sfx2/request.hxx> #include <sfx2/dispatch.hxx> diff --git a/sfx2/source/control/sfxstatuslistener.cxx b/sfx2/source/control/sfxstatuslistener.cxx index cba060b812f3..f7bf79f8a0f6 100644 --- a/sfx2/source/control/sfxstatuslistener.cxx +++ b/sfx2/source/control/sfxstatuslistener.cxx @@ -31,13 +31,13 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" #include <sfx2/sfxstatuslistener.hxx> -#include <svtools/poolitem.hxx> -#include <svtools/eitem.hxx> -#include <svtools/stritem.hxx> -#include <svtools/intitem.hxx> -#include <svtools/itemset.hxx> +#include <svl/poolitem.hxx> +#include <svl/eitem.hxx> +#include <svl/stritem.hxx> +#include <svl/intitem.hxx> +#include <svl/itemset.hxx> #include <svtools/itemdel.hxx> -#include <svtools/visitem.hxx> +#include <svl/visitem.hxx> #include <cppuhelper/weak.hxx> #include <comphelper/processfactory.hxx> #include <vos/mutex.hxx> diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx index 4cbc26f02341..aee76353f1f3 100644 --- a/sfx2/source/control/shell.cxx +++ b/sfx2/source/control/shell.cxx @@ -33,13 +33,13 @@ #include <com/sun/star/embed/VerbDescriptor.hpp> #include <com/sun/star/embed/VerbAttributes.hpp> #include <basic/sbstar.hxx> -#include <svtools/itempool.hxx> -#include <svtools/undo.hxx> +#include <svl/itempool.hxx> +#include <svl/undo.hxx> #include <svtools/itemdel.hxx> #include <svtools/asynclink.hxx> #include <basic/sbx.hxx> -#include <svtools/undoopt.hxx> +#include <unotools/undoopt.hxx> #ifndef GCC #endif @@ -659,7 +659,7 @@ void SfxShell::DoActivate_Impl( SfxViewFrame *pFrame, BOOL bMDI ) */ { -#ifndef PRODUCT +#ifdef DBG_UTIL const SfxInterface *p_IF = GetInterface(); if ( !p_IF ) return; @@ -702,7 +702,7 @@ void SfxShell::DoDeactivate_Impl( SfxViewFrame *pFrame, BOOL bMDI ) */ { -#ifndef PRODUCT +#ifdef DBG_UTIL const SfxInterface *p_IF = GetInterface(); if ( !p_IF ) return; diff --git a/sfx2/source/control/srchitem.cxx b/sfx2/source/control/srchitem.cxx index 8f1507a45610..5702103e3398 100644 --- a/sfx2/source/control/srchitem.cxx +++ b/sfx2/source/control/srchitem.cxx @@ -36,7 +36,7 @@ #ifndef __SBX_SBXVARIABLE_HXX #include <basic/sbxvar.hxx> #endif -#include <svtools/searchopt.hxx> +#include <unotools/searchopt.hxx> #include <com/sun/star/util/XReplaceable.hpp> #include <com/sun/star/util/XSearchable.hpp> #include <com/sun/star/util/XSearchDescriptor.hpp> @@ -44,7 +44,7 @@ #include <com/sun/star/util/XReplaceDescriptor.hpp> #include <com/sun/star/lang/Locale.hpp> -#include <svtools/memberid.hrc> +#include <svl/memberid.hrc> #include <i18npool/mslangid.hxx> #ifndef GCC @@ -359,6 +359,9 @@ void SvxSearchItem::Notify( const Sequence< ::rtl::OUString > & ) SetTransliterationFlags( SvtSearchOptions().GetTransliterationFlags() ); } +void SvxSearchItem::Commit() +{ +} void SvxSearchItem::SetMatchFullHalfWidthForms( sal_Bool bVal ) { diff --git a/sfx2/source/control/statcach.cxx b/sfx2/source/control/statcach.cxx index cb7e0f042f0d..527851e7664a 100644 --- a/sfx2/source/control/statcach.cxx +++ b/sfx2/source/control/statcach.cxx @@ -46,10 +46,10 @@ #include <com/sun/star/frame/FrameAction.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <cppuhelper/weak.hxx> -#include <svtools/eitem.hxx> -#include <svtools/intitem.hxx> -#include <svtools/stritem.hxx> -#include <svtools/visitem.hxx> +#include <svl/eitem.hxx> +#include <svl/intitem.hxx> +#include <svl/stritem.hxx> +#include <svl/visitem.hxx> #include <comphelper/processfactory.hxx> #ifndef GCC diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index 190cc47dc2f6..f33f898237f9 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -32,13 +32,13 @@ #include "precompiled_sfx2.hxx" #include <tools/debug.hxx> -#include <svtools/eitem.hxx> -#include <svtools/stritem.hxx> -#include <svtools/intitem.hxx> -#include <svtools/itemset.hxx> -#include <svtools/visitem.hxx> +#include <svl/eitem.hxx> +#include <svl/stritem.hxx> +#include <svl/intitem.hxx> +#include <svl/itemset.hxx> +#include <svl/visitem.hxx> #include <svtools/javacontext.hxx> -#include <svtools/itempool.hxx> +#include <svl/itempool.hxx> #include <tools/urlobj.hxx> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XController.hpp> diff --git a/sfx2/source/dialog/alienwarn.cxx b/sfx2/source/dialog/alienwarn.cxx index 5ed5569ea336..f7f3f7b14ec9 100644 --- a/sfx2/source/dialog/alienwarn.cxx +++ b/sfx2/source/dialog/alienwarn.cxx @@ -38,7 +38,7 @@ #include "alienwarn.hrc" #include "dialog.hrc" #include <vcl/msgbox.hxx> -#include <svtools/saveopt.hxx> +#include <unotools/saveopt.hxx> // class SfxAlienWarningDialog ------------------------------------------- diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx index 6b92cb0137de..89075b918b42 100644 --- a/sfx2/source/dialog/basedlgs.cxx +++ b/sfx2/source/dialog/basedlgs.cxx @@ -37,8 +37,8 @@ #include <vcl/fixed.hxx> #include <vcl/help.hxx> #include <vcl/msgbox.hxx> -#include <svtools/eitem.hxx> -#include <svtools/viewoptions.hxx> +#include <svl/eitem.hxx> +#include <unotools/viewoptions.hxx> #include <svtools/fixedhyper.hxx> #include <svtools/controldims.hrc> diff --git a/sfx2/source/dialog/dialog.hrc b/sfx2/source/dialog/dialog.hrc index 72cc8c659bc4..44d9c7e346cf 100644 --- a/sfx2/source/dialog/dialog.hrc +++ b/sfx2/source/dialog/dialog.hrc @@ -109,6 +109,8 @@ #define STR_PDF_EXPORT_SEND ( RC_DIALOG_BEGIN + 120 ) #define STR_RECHECK_DOCUMENT ( RC_DIALOG_BEGIN + 121 ) #define IMG_INFO ( RC_DIALOG_BEGIN + 122 ) +#define RID_EDIT_DURATIONS ( RC_DIALOG_BEGIN + 123 ) +#define SFX_PB_EDIT ( RC_DIALOG_BEGIN + 124 ) #endif // #ifndef _SFX_DIALOG_HRC diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 484e953f1cf4..fe03231c6db7 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -32,13 +32,13 @@ #include "precompiled_sfx2.hxx" #include <tools/urlobj.hxx> #include <vcl/msgbox.hxx> -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #include <vcl/svapp.hxx> #include <sfx2/filedlghelper.hxx> #include <unotools/localedatawrapper.hxx> #include <comphelper/processfactory.hxx> -#include <svtools/urihelper.hxx> -#include <svtools/useroptions.hxx> +#include <svl/urihelper.hxx> +#include <unotools/useroptions.hxx> #include <svtools/imagemgr.hxx> #include <tools/datetime.hxx> @@ -49,12 +49,15 @@ #include <com/sun/star/security/DocumentSignatureInformation.hpp> #include <com/sun/star/security/XDocumentDigitalSignatures.hpp> #include <unotools/localedatawrapper.hxx> -#include <svtools/syslocale.hxx> +#include <unotools/syslocale.hxx> #include <rtl/math.hxx> #include <com/sun/star/ui/dialogs/TemplateDescription.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/beans/XPropertyContainer.hpp> +#include <com/sun/star/util/DateTime.hpp> #include <com/sun/star/util/Date.hpp> +#include <com/sun/star/util/Time.hpp> +#include <com/sun/star/util/Duration.hpp> #include <com/sun/star/document/XDocumentProperties.hpp> #include <vcl/timer.hxx> @@ -73,6 +76,8 @@ #include <sfx2/sfx.hrc> #include "dinfdlg.hrc" #include "sfxlocal.hrc" +#include <dialog.hrc> +#include <vcl/help.hxx> #include <algorithm> @@ -269,8 +274,12 @@ SfxDocumentInfoItem::SfxDocumentInfoItem( const String& rFile, for ( sal_Int32 i = 0; i < nCount; ++i ) { // "fix" property? => not a custom property => ignore it! - if ( !(pProps[i].Attributes & ::com::sun::star::beans::PropertyAttribute::REMOVABLE) ) + if (!(pProps[i].Attributes & + ::com::sun::star::beans::PropertyAttribute::REMOVABLE)) + { + DBG_ASSERT(false, "non-removable user-defined property?"); continue; + } uno::Any aValue = xSet->getPropertyValue(pProps[i].Name); CustomProperty* pProp = new CustomProperty( pProps[i].Name, aValue ); @@ -424,7 +433,13 @@ void SfxDocumentInfoItem::UpdateDocumentInfo( const beans::Property* pProps = lProps.getConstArray(); sal_Int32 nCount = lProps.getLength(); for ( sal_Int32 j = 0; j < nCount; ++j ) - xContainer->removeProperty( pProps[j].Name ); + { + if ((pProps[j].Attributes & + ::com::sun::star::beans::PropertyAttribute::REMOVABLE)) + { + xContainer->removeProperty( pProps[j].Name ); + } + } for ( sal_uInt32 k = 0; k < m_aCustomProperties.size(); ++k ) { @@ -1567,7 +1582,168 @@ CustomPropertiesYesNoButton::CustomPropertiesYesNoButton( Window* pParent, const m_aYesButton.SetBackground( aWall ); m_aNoButton.SetBackground( aWall ); } +class DurationDialog_Impl : public ModalDialog +{ + FixedLine aDurationFL; + + OKButton aOKPB; + CancelButton aCancelPB; + HelpButton aHelpPB; + + CheckBox aNegativeCB; + FixedText aYearFT; + NumericField aYearNF; + FixedText aMonthFT; + NumericField aMonthNF; + FixedText aDayFT; + NumericField aDayNF; + FixedText aHourFT; + NumericField aHourNF; + FixedText aMinuteFT; + NumericField aMinuteNF; + FixedText aSecondFT; + NumericField aSecondNF; + FixedText aHSecondFT; + NumericField aHSecondNF; + +public: + + DurationDialog_Impl( Window* pParent, const util::Duration& rDuration ); + ~DurationDialog_Impl(); + + 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 ) ), + aDurationFL(this, SfxResId( FL_DURATION )), + aOKPB( this, SfxResId( PB_OK )), + aCancelPB( this, SfxResId( PB_CANCEL )), + aHelpPB( this, SfxResId( PB_HELP )), + aNegativeCB(this, SfxResId( CB_NEGATIVE )), + aYearFT( this, SfxResId( FT_YEAR )), + aYearNF( this, SfxResId( ED_YEAR )), + aMonthFT( this, SfxResId( FT_MONTH )), + aMonthNF( this, SfxResId( ED_MONTH )), + aDayFT( this, SfxResId( FT_DAY )), + aDayNF( this, SfxResId( ED_DAY )), + aHourFT( this, SfxResId( FT_HOUR )), + aHourNF( this, SfxResId( ED_HOUR )), + aMinuteFT( this, SfxResId( FT_MINUTE )), + aMinuteNF( this, SfxResId( ED_MINUTE )), + aSecondFT( this, SfxResId( FT_SECOND )), + aSecondNF( this, SfxResId( ED_SECOND )), + aHSecondFT( this, SfxResId( FT_HSECOND )), + aHSecondNF( this, SfxResId( ED_HSECOND )) +{ + FreeResource(); + aNegativeCB.Check(rDuration.Negative); + aYearNF.SetValue(rDuration.Years); + aMonthNF.SetValue(rDuration.Months ); + aDayNF.SetValue(rDuration.Days ); + aHourNF.SetValue(rDuration.Hours ); + aMinuteNF.SetValue(rDuration.Minutes); + aSecondNF.SetValue(rDuration.Seconds); + aHSecondNF.SetValue(rDuration.HundredthSeconds); +} +/*-- 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; + aRet.Negative = aNegativeCB.IsChecked(); + aRet.Years = aYearNF.GetValue(); + aRet.Months = aMonthNF.GetValue( ); + aRet.Days = aDayNF.GetValue( ); + aRet.Hours = aHourNF.GetValue( ); + aRet.Minutes = aMinuteNF.GetValue(); + aRet.Seconds = aSecondNF.GetValue(); + aRet.HundredthSeconds = aHSecondNF.GetValue(); + 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 ) + { + Size aSize( GetSizePixel() ); + Rectangle aItemRect( rHEvt.GetMousePosPixel(), aSize ); + if(Help::IsBalloonHelpEnabled()) + Help::ShowBalloon( this, rHEvt.GetMousePosPixel(), GetText() ); + else + Help::ShowQuickHelp( this, aItemRect, GetText(), + QUICKHELP_LEFT|QUICKHELP_VCENTER ); + } +} +/*-- 20.11.2009 15:30:58--------------------------------------------------- + -----------------------------------------------------------------------*/ +void CustomPropertiesDurationField::SetDuration( const util::Duration& rDuration ) +{ + m_aDuration = rDuration; + String sText(rDuration.Negative ? '-' : '+'); + sText += m_pLine->m_sDurationFormat; + sText.SearchAndReplace(String::CreateFromAscii( "%1"), String::CreateFromInt32( rDuration.Years ) ); + sText.SearchAndReplace(String::CreateFromAscii( "%2"), String::CreateFromInt32( rDuration.Months ) ); + sText.SearchAndReplace(String::CreateFromAscii( "%3"), String::CreateFromInt32( rDuration.Days ) ); + sText.SearchAndReplace(String::CreateFromAscii( "%4"), String::CreateFromInt32( rDuration.Hours ) ); + sText.SearchAndReplace(String::CreateFromAscii( "%5"), String::CreateFromInt32( rDuration.Minutes) ); + 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() ); + if( RET_OK == pDurationDlg->Execute() ) + m_pLine->m_aDurationField.SetDuration( pDurationDlg->GetDuration() ); + delete pDurationDlg; + return 1; +} +//-------------------------------------------------------------------------- void CustomPropertiesYesNoButton::Resize() { const long nWidth = GetSizePixel().Width(); @@ -1588,12 +1764,20 @@ CustomPropertyLine::CustomPropertyLine( Window* pParent ) : m_aNameBox ( pParent, SfxResId( SFX_CB_PROPERTY_NAME ) ), m_aTypeBox ( pParent, SfxResId( SFX_LB_PROPERTY_TYPE ), this ), m_aValueEdit ( pParent, SfxResId( SFX_ED_PROPERTY_VALUE ), this ), + m_aDateField ( pParent, SfxResId( SFX_FLD_DATE), this), + m_aTimeField ( pParent, SfxResId( SFX_FLD_TIME), this), + m_sDurationFormat( SfxResId( SFX_ST_DURATION_FORMAT )), + m_aDurationField( pParent, SfxResId( SFX_FLD_DURATION), this), + m_aEditButton( pParent, SfxResId( SFX_PB_EDIT ), this), m_aYesNoButton ( pParent, SfxResId( SFX_WIN_PROPERTY_YESNO ) ), m_aRemoveButton ( pParent, SfxResId( SFX_PB_PROPERTY_REMOVE ), this ), m_bIsRemoved ( false ), m_bTypeLostFocus( false ) { + 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 ); } @@ -1605,6 +1789,10 @@ void CustomPropertyLine::SetRemoved() m_aNameBox.Hide(); m_aTypeBox.Hide(); m_aValueEdit.Hide(); + m_aDateField.Hide(); + m_aTimeField.Hide(); + m_aDurationField.Hide(); + m_aEditButton.Hide(); m_aYesNoButton.Hide(); m_aRemoveButton.Hide(); } @@ -1617,6 +1805,10 @@ CustomPropertiesWindow::CustomPropertiesWindow( Window* pParent, const ResId& rR m_aNameBox ( this, SfxResId( SFX_CB_PROPERTY_NAME ) ), m_aTypeBox ( this, SfxResId( SFX_LB_PROPERTY_TYPE ) ), m_aValueEdit ( this, SfxResId( SFX_ED_PROPERTY_VALUE ) ), + m_aDateField ( this, SfxResId( SFX_FLD_DATE) ), + m_aTimeField ( this, SfxResId( SFX_FLD_TIME) ), + m_aDurationField( this, SfxResId( SFX_FLD_DURATION) ), + m_aEditButton( this, SfxResId( SFX_PB_EDIT )), m_aYesNoButton ( this, SfxResId( SFX_WIN_PROPERTY_YESNO ) ), m_aRemoveButton ( this, SfxResId( SFX_PB_PROPERTY_REMOVE ) ), m_nScrollPos (0), @@ -1641,9 +1833,23 @@ IMPL_LINK( CustomPropertiesWindow, TypeHdl, CustomPropertiesTypeBox*, pBox ) { sal_Int64 nType = sal_Int64( (long)pBox->GetEntryData( pBox->GetSelectEntryPos() ) ); CustomPropertyLine* pLine = pBox->GetLine(); - BOOL bBooleanType = ( CUSTOM_TYPE_BOOLEAN == nType ); - pLine->m_aValueEdit.Show( !bBooleanType ); - pLine->m_aYesNoButton.Show( bBooleanType ); + pLine->m_aValueEdit.Show( (CUSTOM_TYPE_TEXT == nType) || (CUSTOM_TYPE_NUMBER == nType) ); + pLine->m_aDateField.Show( (CUSTOM_TYPE_DATE == nType) || (CUSTOM_TYPE_DATETIME == nType) ); + pLine->m_aTimeField.Show( CUSTOM_TYPE_DATETIME == nType ); + pLine->m_aDurationField.Show( CUSTOM_TYPE_DURATION == nType ); + pLine->m_aEditButton.Show( CUSTOM_TYPE_DURATION == nType ); + pLine->m_aYesNoButton.Show( CUSTOM_TYPE_BOOLEAN == nType ); + //adjust positions of date and time controls + if( nType == CUSTOM_TYPE_DATE ) + { + pLine->m_aDateField.SetPosSizePixel(pLine->m_aValueEdit.GetPosPixel(), pLine->m_aValueEdit.GetSizePixel()); + } + else if( nType == CUSTOM_TYPE_DATETIME) + { + pLine->m_aDateField.SetPosSizePixel( pLine->m_aDatePos, pLine->m_aDateTimeSize ); + pLine->m_aTimeField.SetPosSizePixel(pLine->m_aTimePos, pLine->m_aDateTimeSize ); + } + return 0; } @@ -1665,6 +1871,8 @@ IMPL_LINK( CustomPropertiesWindow, RemoveHdl, CustomPropertiesRemoveButton*, pBu continue; Window* pWindows[] = { &pLine->m_aNameBox, &pLine->m_aTypeBox, &pLine->m_aValueEdit, + &pLine->m_aDateField, &pLine->m_aTimeField, + &pLine->m_aDurationField, &pLine->m_aEditButton, &pLine->m_aYesNoButton, &pLine->m_aRemoveButton, NULL }; Window** pCurrent = pWindows; while ( *pCurrent ) @@ -1774,6 +1982,10 @@ void CustomPropertiesWindow::InitControls( HeaderBar* pHeaderBar, const ScrollBa m_aNameBox.Hide(); m_aTypeBox.Hide(); m_aValueEdit.Hide(); + m_aDateField.Hide(); + m_aTimeField.Hide(); + m_aDurationField.Hide(); + m_aEditButton.Hide(); m_aYesNoButton.Hide(); m_aRemoveButton.Hide(); @@ -1805,11 +2017,23 @@ void CustomPropertiesWindow::InitControls( HeaderBar* pHeaderBar, const ScrollBa if ( *pCurrent == &m_aValueEdit ) { + Point aDurationPos( aPos ); + m_aDurationField.SetPosPixel( aDurationPos ); + Size aDurationSize(aSize); + aDurationSize.Width() -= (m_aEditButton.GetSizePixel().Width() + 3 ); + m_aDurationField.SetSizePixel(aDurationSize); + aDurationPos.X() = aPos.X() - m_aEditButton.GetSizePixel().Width() + aSize.Width(); + m_aEditButton.SetPosPixel(aDurationPos); aSize = m_aYesNoButton.GetSizePixel(); aPos = m_aYesNoButton.GetPosPixel(); aSize.Width() = nWidth; aPos.X() = aRect.getX() + ( nOffset / 2 ); m_aYesNoButton.SetPosSizePixel( aPos, aSize ); + aSize.Width() /= 2; + aSize.Width() -= 2; + m_aDateField.SetPosSizePixel( aPos, aSize ); + aPos.X() += aSize.Width() + 4; + m_aTimeField.SetPosSizePixel( aPos, aSize ); } pCurrent++; @@ -1839,13 +2063,19 @@ void CustomPropertiesWindow::AddLine( const ::rtl::OUString& sName, Any& rAny ) pNewLine->m_aTypeBox.SetSelectHdl( LINK( this, CustomPropertiesWindow, TypeHdl ) ); pNewLine->m_aRemoveButton.SetClickHdl( LINK( this, CustomPropertiesWindow, RemoveHdl ) ); pNewLine->m_aValueEdit.SetLoseFocusHdl( LINK( this, CustomPropertiesWindow, EditLoseFocusHdl ) ); + //add lose focus handlers of date/time fields + pNewLine->m_aTypeBox.SetLoseFocusHdl( LINK( this, CustomPropertiesWindow, BoxLoseFocusHdl ) ); long nPos = GetVisibleLineCount() * GetLineHeight(); m_aCustomPropertiesLines.push_back( pNewLine ); Window* pWindows[] = { &m_aNameBox, &m_aTypeBox, &m_aValueEdit, + &m_aDateField, &m_aTimeField, + &m_aDurationField, &m_aEditButton, &m_aYesNoButton, &m_aRemoveButton, NULL }; Window* pNewWindows[] = { &pNewLine->m_aNameBox, &pNewLine->m_aTypeBox, &pNewLine->m_aValueEdit, + &pNewLine->m_aDateField, &pNewLine->m_aTimeField, + &pNewLine->m_aDurationField, &pNewLine->m_aEditButton, &pNewLine->m_aYesNoButton, &pNewLine->m_aRemoveButton, NULL }; Window** pCurrent = pWindows; Window** pNewCurrent = pNewWindows; @@ -1860,11 +2090,17 @@ 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(); double nTmpValue = 0; bool bTmpValue = false; ::rtl::OUString sTmpValue; - util::DateTime aTmpDate; + util::DateTime aTmpDateTime; + util::Date aTmpDate; + util::Duration aTmpDuration; SvtSysLocale aSysLocale; const LocaleDataWrapper& rLocaleWrapper = aSysLocale.GetLocaleData(); pNewLine->m_aNameBox.SetText( sName ); @@ -1875,6 +2111,7 @@ void CustomPropertiesWindow::AddLine( const ::rtl::OUString& sName, Any& rAny ) { sal_uInt32 nIndex = m_aNumberFormatter.GetFormatIndex( NF_NUMBER_SYSTEM ); m_aNumberFormatter.GetInputLineString( nTmpValue, nIndex, sValue ); + pNewLine->m_aValueEdit.SetText( sValue ); nType = CUSTOM_TYPE_NUMBER; } else if ( rAny >>= bTmpValue ) @@ -1884,50 +2121,26 @@ void CustomPropertiesWindow::AddLine( const ::rtl::OUString& sName, Any& rAny ) } else if ( rAny >>= sTmpValue ) { - sValue = String( sTmpValue ); + pNewLine->m_aValueEdit.SetText( sTmpValue ); nType = CUSTOM_TYPE_TEXT; } else if ( rAny >>= aTmpDate ) { - DateFormat eFormat = rLocaleWrapper.getDateFormat(); - sal_Unicode cDateSep = rLocaleWrapper.getDateSep().GetChar(0); - switch ( eFormat ) - { - case MDY : - { - sValue = String::CreateFromInt32( aTmpDate.Month ); - sValue += cDateSep; - sValue += String::CreateFromInt32( aTmpDate.Day ); - sValue += cDateSep; - if ( aTmpDate.Year < 10 ) - sValue += '0'; - sValue += String::CreateFromInt32( aTmpDate.Year ); - break; - } - case DMY : - { - sValue = String::CreateFromInt32( aTmpDate.Day ); - sValue += cDateSep; - sValue += String::CreateFromInt32( aTmpDate.Month ); - sValue += cDateSep; - if ( aTmpDate.Year < 10 ) - sValue += '0'; - sValue += String::CreateFromInt32( aTmpDate.Year ); - break; - } - case YMD : - { - if ( aTmpDate.Year < 10 ) - sValue += '0'; - sValue += String::CreateFromInt32( aTmpDate.Year ); - sValue += cDateSep; - sValue += String::CreateFromInt32( aTmpDate.Month ); - sValue += cDateSep; - sValue += String::CreateFromInt32( aTmpDate.Day ); - break; - } - } nType = CUSTOM_TYPE_DATE; + pNewLine->m_aDateField.SetDate( Date( aTmpDate.Day, aTmpDate.Month, aTmpDate.Year ) ); + + } + else if ( rAny >>= aTmpDuration ) + { + nType = CUSTOM_TYPE_DURATION; + pNewLine->m_aDurationField.SetDuration( aTmpDuration ); + } + else if ( rAny >>= aTmpDateTime ) + { + pNewLine->m_aDateField.SetDate( Date( aTmpDateTime.Day, aTmpDateTime.Month, aTmpDateTime.Year ) ); + pNewLine->m_aTimeField.SetTime( Time( aTmpDateTime.Hours, aTmpDateTime.Minutes, aTmpDateTime.Seconds, aTmpDateTime.HundredthSeconds ) ); + + nType = CUSTOM_TYPE_DATETIME; } if ( nType != CUSTOM_TYPE_UNKNOWN ) @@ -1939,8 +2152,6 @@ void CustomPropertiesWindow::AddLine( const ::rtl::OUString& sName, Any& rAny ) else pNewLine->m_aYesNoButton.CheckNo(); } - else - pNewLine->m_aValueEdit.SetText( sValue ); pNewLine->m_aTypeBox.SelectEntryPos( m_aTypeBox.GetEntryPos( (void*)nType ) ); } @@ -1991,7 +2202,7 @@ void CustomPropertiesWindow::DoScroll( sal_Int32 nNewPos ) if ( pLine->m_bIsRemoved ) continue; - Window* pWindows[] = { &pLine->m_aNameBox, &pLine->m_aTypeBox, &pLine->m_aValueEdit, + Window* pWindows[] = { &pLine->m_aNameBox, &pLine->m_aTypeBox, &pLine->m_aValueEdit, &pLine->m_aDurationField, &pLine->m_aYesNoButton, &pLine->m_aRemoveButton, NULL }; Window** pCurrent = pWindows; while ( *pCurrent ) @@ -2055,52 +2266,24 @@ Sequence< beans::PropertyValue > CustomPropertiesWindow::GetCustomProperties() c bool bValue = pLine->m_aYesNoButton.IsYesChecked(); aPropertiesSeq[i].Value <<= makeAny( bValue ); } + else if ( CUSTOM_TYPE_DATETIME == nType ) + { + Date aTmpDate = pLine->m_aDateField.GetDate(); + Time aTmpTime = pLine->m_aTimeField.GetTime(); + util::DateTime aDateTime(aTmpTime.Get100Sec(), aTmpTime.GetSec(), aTmpTime.GetMin(), aTmpTime.GetHour(), + aTmpDate.GetDay(), aTmpDate.GetMonth(), aTmpDate.GetYear() ); + aPropertiesSeq[i].Value <<= aDateTime; + } + else if ( CUSTOM_TYPE_DURATION == nType ) + { + aPropertiesSeq[i].Value <<= pLine->m_aDurationField.GetDuration(); + } else if ( CUSTOM_TYPE_DATE == nType ) { - const LocaleDataWrapper& rLocaleWrapper = SvtSysLocale().GetLocaleData(); - DateFormat eFormat = rLocaleWrapper.getDateFormat(); - sal_Unicode cDateSep = rLocaleWrapper.getDateSep().GetChar(0); - String sValue( pLine->m_aValueEdit.GetText() ); - if ( sValue.GetTokenCount( cDateSep ) == 3 ) - { - xub_StrLen nTokenDay = STRING_NOTFOUND; - xub_StrLen nTokenMonth = STRING_NOTFOUND; - xub_StrLen nTokenYear = STRING_NOTFOUND; - - switch ( eFormat ) - { - case MDY : - { - nTokenDay = 1; - nTokenMonth = 0; - nTokenYear = 2; - break; - } - case DMY : - { - nTokenDay = 0; - nTokenMonth = 1; - nTokenYear = 2; - break; - } - case YMD : - { - nTokenDay = 2; - nTokenMonth = 1; - nTokenYear = 0; - break; - } - } - - if ( nTokenDay != STRING_NOTFOUND ) - { - util::DateTime aDateTime( 0, 0, 0, 0, - sal_uInt16( sValue.GetToken( nTokenDay, cDateSep ).ToInt32() ), - sal_uInt16( sValue.GetToken( nTokenMonth, cDateSep ).ToInt32() ), - sal_uInt16( sValue.GetToken( nTokenYear, cDateSep ).ToInt32() ) ); - aPropertiesSeq[i].Value <<= makeAny( aDateTime ); - } - } + Date aTmpDate = pLine->m_aDateField.GetDate(); + util::Date aDate(aTmpDate.GetDay(), aTmpDate.GetMonth(), aTmpDate.GetYear()); + aPropertiesSeq[i].Value <<= aDate; + } else { diff --git a/sfx2/source/dialog/dinfdlg.hrc b/sfx2/source/dialog/dinfdlg.hrc index 94bfb9ba16b6..49647c40e3ee 100644 --- a/sfx2/source/dialog/dinfdlg.hrc +++ b/sfx2/source/dialog/dinfdlg.hrc @@ -39,6 +39,8 @@ #define CUSTOM_TYPE_NUMBER 2 #define CUSTOM_TYPE_DATE 3 #define CUSTOM_TYPE_BOOLEAN 4 +#define CUSTOM_TYPE_DURATION 5 +#define CUSTOM_TYPE_DATETIME 6 // 4 TP_DOCINFORELOAD #define PAGE_WIDTH 260 @@ -154,5 +156,25 @@ #define STR_HEADER_VALUE 92 #define STR_HEADER_ACTION 93 +#define PB_OK 100 +#define PB_CANCEL 101 +#define PB_HELP 102 +#define CB_NEGATIVE 103 +#define FT_YEAR 104 +#define ED_YEAR 105 +#define FT_MONTH 106 +#define ED_MONTH 107 +#define FT_DAY 108 +#define ED_DAY 109 +#define FT_HOUR 110 +#define ED_HOUR 111 +#define FT_MINUTE 112 +#define ED_MINUTE 113 +#define FT_SECOND 114 +#define ED_SECOND 115 +#define FT_HSECOND 116 +#define ED_HSECOND 117 +#define FL_DURATION 118 + #endif diff --git a/sfx2/source/dialog/dinfdlg.src b/sfx2/source/dialog/dinfdlg.src index d8bf2085a5d9..3cad63ecb565 100644 --- a/sfx2/source/dialog/dinfdlg.src +++ b/sfx2/source/dialog/dinfdlg.src @@ -34,6 +34,7 @@ #include "helpid.hrc" #include "sfxlocal.hrc" #include "dinfdlg.hrc" +#include <dialog.hrc> // TP_DOCINFODESC -------------------------------------------------------- String STR_SFX_NEWOFFICEDOC @@ -579,14 +580,16 @@ ComboBox SFX_CB_PROPERTY_NAME ListBox SFX_LB_PROPERTY_TYPE { Pos = MAP_APPFONT ( 63 , 2 ) ; - Size = MAP_APPFONT ( 60 , 50 ) ; + Size = MAP_APPFONT ( 60 , 80 ) ; DropDown = TRUE; Border = TRUE; CurPos = 0; StringList [ en-US ] = { < "Text" ; CUSTOM_TYPE_TEXT ; > ; + < "DateTime" ; CUSTOM_TYPE_DATETIME ; > ; < "Date" ; CUSTOM_TYPE_DATE ; > ; + < "Duration" ; CUSTOM_TYPE_DURATION ; > ; < "Number" ; CUSTOM_TYPE_NUMBER ; > ; < "Yes or no" ; CUSTOM_TYPE_BOOLEAN ; > ; }; @@ -599,6 +602,44 @@ Edit SFX_ED_PROPERTY_VALUE TabStop = TRUE ; Left = TRUE ; }; +DateField SFX_FLD_DATE +{ + Border = TRUE ; + Pos = MAP_APPFONT ( 127 , 2 ) ; + Size = MAP_APPFONT ( 29 , RSC_CD_TEXTBOX_HEIGHT ) ; + TabStop = TRUE ; + Left = TRUE ; + Spin = TRUE; +}; +TimeField SFX_FLD_TIME +{ + Border = TRUE ; + Pos = MAP_APPFONT ( 159 , 2 ) ; + Size = MAP_APPFONT ( 29 , RSC_CD_TEXTBOX_HEIGHT ) ; + TabStop = TRUE ; + Left = TRUE ; + Spin = TRUE; +}; + +Edit SFX_FLD_DURATION +{ + Readonly = TRUE; + Border = TRUE ; + Pos = MAP_APPFONT ( 159 , 2 ) ; + Size = MAP_APPFONT ( 61 - RSC_CD_TEXTBOX_HEIGHT - 2, RSC_CD_TEXTBOX_HEIGHT ) ; + TabStop = TRUE ; +}; +PushButton SFX_PB_EDIT +{ + Pos = MAP_APPFONT ( 159 , 2 ) ; + Size = MAP_APPFONT ( RSC_CD_TEXTBOX_HEIGHT , RSC_CD_TEXTBOX_HEIGHT ) ; + Text = "..."; +}; +String SFX_ST_DURATION_FORMAT +{ + Text [en-US] = " Y: %1 M: %2 D: %3 H: %4 M: %5 S: %6"; +}; + Control SFX_WIN_PROPERTY_YESNO { HelpId = HID_CTRL_CUSTOMPROPS_YES_NO; @@ -684,3 +725,182 @@ TabDialog SID_DOCINFO }; }; +ModalDialog RID_EDIT_DURATIONS +{ + HelpId = HID_DLG_CUSTOMPROPS_DURATION; + OutputSize = TRUE ; + Size = MAP_APPFONT ( 176 , 140 ) ; + Text [ en-US ] = "Edit Duration" ; + Moveable = TRUE ; + OKButton PB_OK + { + Pos = MAP_APPFONT ( 120 , 7 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + DefButton = TRUE; + }; + CancelButton PB_CANCEL + { + Pos = MAP_APPFONT ( 120 , 24 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + }; + HelpButton PB_HELP + { + Pos = MAP_APPFONT ( 120 , 48 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + }; + FixedLine FL_DURATION + { + Pos = MAP_APPFONT ( 6 , 8 ) ; + Size = MAP_APPFONT ( 108 , 8 ) ; + Text [ en-US ] = "Duration" ; + }; + CheckBox CB_NEGATIVE + { + Pos = MAP_APPFONT ( 6 , 21 ) ; + Size = MAP_APPFONT ( 60 , RSC_CD_FIXEDTEXT_HEIGHT ) ; + Text [ en-US ] = "~Negative" ; + }; + FixedText FT_YEAR + { + Pos = MAP_APPFONT ( 6 , 38 ) ; + Size = MAP_APPFONT ( 60 , RSC_CD_FIXEDTEXT_HEIGHT ) ; + Left = TRUE ; + Text [ en-US ] = "~Years" ; + }; + NumericField ED_YEAR + { + Border = TRUE ; + Pos = MAP_APPFONT ( 70 , 36 ) ; + Size = MAP_APPFONT ( 40, RSC_CD_TEXTBOX_HEIGHT ) ; + Repeat = TRUE ; + Spin = TRUE ; + Minimum = 0 ; + First = 1 ; + Last = 100 ; + SpinSize = 1 ; + Value = 0 ; + }; + FixedText FT_MONTH + { + Pos = MAP_APPFONT ( 6 , 52 ) ; + Size = MAP_APPFONT ( 60 , RSC_CD_FIXEDTEXT_HEIGHT ) ; + Left = TRUE ; + Text [ en-US ] = "~Months" ; + }; + NumericField ED_MONTH + { + Border = TRUE ; + Pos = MAP_APPFONT ( 70 , 50 ) ; + Size = MAP_APPFONT ( 40, RSC_CD_TEXTBOX_HEIGHT ) ; + Repeat = TRUE ; + Spin = TRUE ; + Minimum = 0 ; + First = 1 ; + Last = 100 ; + SpinSize = 1 ; + Value = 0 ; + }; + FixedText FT_DAY + { + Pos = MAP_APPFONT ( 6 , 66 ) ; + Size = MAP_APPFONT ( 60 , RSC_CD_FIXEDTEXT_HEIGHT ) ; + Left = TRUE ; + Text [ en-US ] = "~Days" ; + }; + NumericField ED_DAY + { + Border = TRUE ; + Pos = MAP_APPFONT ( 70 , 64 ) ; + Size = MAP_APPFONT ( 40, RSC_CD_TEXTBOX_HEIGHT ) ; + Repeat = TRUE ; + Spin = TRUE ; + Minimum = 0 ; + First = 1 ; + Last = 100 ; + SpinSize = 1 ; + Value = 0 ; + }; + FixedText FT_HOUR + { + Pos = MAP_APPFONT ( 6 , 80 ) ; + Size = MAP_APPFONT ( 60 , RSC_CD_FIXEDTEXT_HEIGHT ) ; + Left = TRUE ; + Text [ en-US ] = "H~ours" ; + }; + NumericField ED_HOUR + { + Border = TRUE ; + Pos = MAP_APPFONT ( 70 , 78 ) ; + Size = MAP_APPFONT ( 40, RSC_CD_TEXTBOX_HEIGHT ) ; + Repeat = TRUE ; + Spin = TRUE ; + Minimum = 0 ; + First = 1 ; + Last = 100 ; + SpinSize = 1 ; + Value = 0 ; + }; + FixedText FT_MINUTE + { + Pos = MAP_APPFONT ( 6 , 94 ) ; + Size = MAP_APPFONT ( 60 , RSC_CD_FIXEDTEXT_HEIGHT ) ; + Left = TRUE ; + Text [ en-US ] = "Min~utes" ; + }; + NumericField ED_MINUTE + { + Border = TRUE ; + Pos = MAP_APPFONT ( 70, 92) ; + Size = MAP_APPFONT ( 40, RSC_CD_TEXTBOX_HEIGHT ) ; + Repeat = TRUE ; + Spin = TRUE ; + Minimum = 0 ; + First = 1 ; + Last = 100 ; + SpinSize = 1 ; + Value = 0 ; + }; + FixedText FT_SECOND + { + Pos = MAP_APPFONT ( 6, 108 ) ; + Size = MAP_APPFONT ( 60 , RSC_CD_FIXEDTEXT_HEIGHT ) ; + Left = TRUE ; + Text [ en-US ] = "~Seconds" ; + }; + NumericField ED_SECOND + { + Border = TRUE ; + Pos = MAP_APPFONT ( 70 , 106 ) ; + Size = MAP_APPFONT ( 40, RSC_CD_TEXTBOX_HEIGHT ) ; + Repeat = TRUE ; + Spin = TRUE ; + Minimum = 0 ; + First = 1 ; + Last = 100 ; + SpinSize = 1 ; + Value = 0 ; + }; + FixedText FT_HSECOND + { + Pos = MAP_APPFONT ( 6 , 122 ) ; + Size = MAP_APPFONT ( 60 , RSC_CD_FIXEDTEXT_HEIGHT ) ; + Left = TRUE ; + Text [ en-US ] = "1/100 se~conds" ; + }; + NumericField ED_HSECOND + { + Border = TRUE ; + Pos = MAP_APPFONT ( 70 , 120 ) ; + Size = MAP_APPFONT ( 40, RSC_CD_TEXTBOX_HEIGHT ) ; + Repeat = TRUE ; + Spin = TRUE ; + Minimum = 0 ; + First = 1 ; + Last = 100 ; + SpinSize = 1 ; + Value = 0 ; + }; + + + +}; diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx index cf7d04ef0875..0b278a55872b 100644 --- a/sfx2/source/dialog/dockwin.cxx +++ b/sfx2/source/dialog/dockwin.cxx @@ -31,7 +31,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #include <vcl/decoview.hxx> #include <vcl/svapp.hxx> diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 5a0d2f4a69a0..683aedcbf32f 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -71,17 +71,17 @@ #include <vcl/cvtgrf.hxx> #include <vcl/msgbox.hxx> #include <vcl/mnemonic.hxx> -#include <svtools/pathoptions.hxx> -#include <svtools/securityoptions.hxx> -#include <svtools/itemset.hxx> -#include <svtools/eitem.hxx> -#include <svtools/intitem.hxx> -#include <svtools/stritem.hxx> +#include <unotools/pathoptions.hxx> +#include <unotools/securityoptions.hxx> +#include <svl/itemset.hxx> +#include <svl/eitem.hxx> +#include <svl/intitem.hxx> +#include <svl/stritem.hxx> #include <svtools/filter.hxx> -#include <svtools/viewoptions.hxx> -#include <svtools/moduleoptions.hxx> +#include <unotools/viewoptions.hxx> +#include <unotools/moduleoptions.hxx> #include <svtools/helpid.hrc> -#include <svtools/pickerhelper.hxx> +#include <svl/pickerhelper.hxx> #include <comphelper/docpasswordrequest.hxx> #include <ucbhelper/content.hxx> #include <ucbhelper/commandenvironment.hxx> diff --git a/sfx2/source/dialog/filedlgimpl.hxx b/sfx2/source/dialog/filedlgimpl.hxx index 848719547ab4..2f9a7574bb2f 100644 --- a/sfx2/source/dialog/filedlgimpl.hxx +++ b/sfx2/source/dialog/filedlgimpl.hxx @@ -41,7 +41,7 @@ #include <sfx2/fcontnr.hxx> #define _SVSTDARR_STRINGSDTOR -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <sfx2/filedlghelper.hxx> #include <comphelper/sequenceasvector.hxx> diff --git a/sfx2/source/dialog/intro.cxx b/sfx2/source/dialog/intro.cxx index aac052ff4ae2..07f20b0801b8 100644 --- a/sfx2/source/dialog/intro.cxx +++ b/sfx2/source/dialog/intro.cxx @@ -38,7 +38,7 @@ #include <tools/stream.hxx> #include <tools/urlobj.hxx> -#include <svtools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> #include <unotools/configmgr.hxx> #include <com/sun/star/uno/Any.h> diff --git a/sfx2/source/dialog/itemconnect.cxx b/sfx2/source/dialog/itemconnect.cxx index 01ed733358d9..211afd11bc6d 100644 --- a/sfx2/source/dialog/itemconnect.cxx +++ b/sfx2/source/dialog/itemconnect.cxx @@ -34,7 +34,7 @@ #include <boost/shared_ptr.hpp> #include <list> -#include <svtools/itempool.hxx> +#include <svl/itempool.hxx> // ============================================================================ diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx index 11d586ea2026..b36a6923184e 100644 --- a/sfx2/source/dialog/mailmodel.cxx +++ b/sfx2/source/dialog/mailmodel.cxx @@ -78,7 +78,7 @@ #include <unotools/configitem.hxx> #include <ucbhelper/content.hxx> #include <tools/urlobj.hxx> -#include <svtools/useroptions.hxx> +#include <unotools/useroptions.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/extract.hxx> #include <comphelper/storagehelper.hxx> diff --git a/sfx2/source/dialog/mailmodelapi.cxx b/sfx2/source/dialog/mailmodelapi.cxx index d5fececf3b38..2e87d2c4a9ba 100644 --- a/sfx2/source/dialog/mailmodelapi.cxx +++ b/sfx2/source/dialog/mailmodelapi.cxx @@ -73,9 +73,9 @@ #include <unotools/tempfile.hxx> #include <vcl/svapp.hxx> -#include <svtools/stritem.hxx> -#include <svtools/eitem.hxx> -#include <svtools/useroptions.hxx> +#include <svl/stritem.hxx> +#include <svl/eitem.hxx> +#include <unotools/useroptions.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/extract.hxx> #include <ucbhelper/content.hxx> diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx index 1300f18e37ac..319c3b873b48 100644 --- a/sfx2/source/dialog/mgetempl.cxx +++ b/sfx2/source/dialog/mgetempl.cxx @@ -37,9 +37,9 @@ #include <vcl/msgbox.hxx> #endif #include <vcl/field.hxx> -#include <svtools/eitem.hxx> -#include <svtools/intitem.hxx> -#include <svtools/style.hxx> +#include <svl/eitem.hxx> +#include <svl/intitem.hxx> +#include <svl/style.hxx> #ifndef GCC #endif @@ -57,7 +57,7 @@ #include "mgetempl.hrc" #ifndef _SFX_STYLE_HRC -#include <svtools/style.hrc> +#include <svl/style.hrc> #endif // SfxManageStyleSheetPage ----------------------------------------------- diff --git a/sfx2/source/dialog/newstyle.cxx b/sfx2/source/dialog/newstyle.cxx index 0e2dc5039a05..05920c07973e 100644 --- a/sfx2/source/dialog/newstyle.cxx +++ b/sfx2/source/dialog/newstyle.cxx @@ -32,7 +32,7 @@ #include "precompiled_sfx2.hxx" // INCLUDE --------------------------------------------------------------- -#include <svtools/style.hxx> +#include <svl/style.hxx> #ifndef GCC #endif diff --git a/sfx2/source/dialog/passwd.cxx b/sfx2/source/dialog/passwd.cxx index cbe47d39b704..981657d476fa 100644 --- a/sfx2/source/dialog/passwd.cxx +++ b/sfx2/source/dialog/passwd.cxx @@ -43,10 +43,35 @@ #include "dialog.hrc" #include "passwd.hrc" +#include "vcl/sound.hxx" + // ----------------------------------------------------------------------- IMPL_LINK_INLINE_START( SfxPasswordDialog, EditModifyHdl, Edit *, EMPTYARG ) { + if( mbAsciiOnly ) + { + rtl::OUString aTest( maPasswordED.GetText() ); + const sal_Unicode* pTest = aTest.getStr(); + sal_Int32 nLen = aTest.getLength(); + rtl::OUStringBuffer aFilter( nLen ); + bool bReset = false; + for( sal_Int32 i = 0; i < nLen; i++ ) + { + if( *pTest > 0x007f ) + bReset = true; + else + aFilter.append( *pTest ); + pTest++; + } + if( bReset ) + { + Sound::Beep( SOUND_ERROR ); + maPasswordED.SetSelection( Selection( 0, nLen ) ); + maPasswordED.ReplaceSelected( aFilter.makeStringAndClear() ); + } + + } maOKBtn.Enable( maPasswordED.GetText().Len() >= mnMinLen ); return 0; } @@ -88,7 +113,8 @@ SfxPasswordDialog::SfxPasswordDialog( Window* pParent, const String* pGroupText maConfirmStr ( SfxResId( STR_PASSWD_CONFIRM ) ), mnMinLen ( 5 ), - mnExtras ( 0 ) + mnExtras ( 0 ), + mbAsciiOnly ( false ) { FreeResource(); diff --git a/sfx2/source/dialog/printopt.cxx b/sfx2/source/dialog/printopt.cxx index c0802b573cc6..29472b65208b 100644 --- a/sfx2/source/dialog/printopt.cxx +++ b/sfx2/source/dialog/printopt.cxx @@ -34,9 +34,9 @@ #ifndef GCC #endif #include <vcl/msgbox.hxx> -#include <svtools/printwarningoptions.hxx> +#include <unotools/printwarningoptions.hxx> #include <svtools/printoptions.hxx> -#include <svtools/flagitem.hxx> +#include <svl/flagitem.hxx> #include "printopt.hrc" diff --git a/sfx2/source/dialog/recfloat.cxx b/sfx2/source/dialog/recfloat.cxx index c2b13fae76f1..7782b5178d8f 100644 --- a/sfx2/source/dialog/recfloat.cxx +++ b/sfx2/source/dialog/recfloat.cxx @@ -38,7 +38,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #include <svtools/generictoolboxcontroller.hxx> #include <vcl/msgbox.hxx> #include <comphelper/processfactory.hxx> diff --git a/sfx2/source/dialog/splitwin.cxx b/sfx2/source/dialog/splitwin.cxx index f30fef23dbd0..750bf90d175c 100644 --- a/sfx2/source/dialog/splitwin.cxx +++ b/sfx2/source/dialog/splitwin.cxx @@ -41,7 +41,7 @@ #ifndef _WRKWIN_HXX //autogen #include <vcl/wrkwin.hxx> #endif -#include <svtools/viewoptions.hxx> +#include <unotools/viewoptions.hxx> #ifndef GCC #endif diff --git a/sfx2/source/dialog/srchdlg.cxx b/sfx2/source/dialog/srchdlg.cxx index 0cbecdc719b0..500d530bab3f 100644 --- a/sfx2/source/dialog/srchdlg.cxx +++ b/sfx2/source/dialog/srchdlg.cxx @@ -38,7 +38,7 @@ #include "srchdlg.hrc" #include "dialog.hrc" #include <tools/debug.hxx> -#include <svtools/viewoptions.hxx> +#include <unotools/viewoptions.hxx> using namespace ::com::sun::star::uno; diff --git a/sfx2/source/dialog/styledlg.cxx b/sfx2/source/dialog/styledlg.cxx index f8df0ea2b082..7d4e60e117e9 100644 --- a/sfx2/source/dialog/styledlg.cxx +++ b/sfx2/source/dialog/styledlg.cxx @@ -32,8 +32,8 @@ #include "precompiled_sfx2.hxx" // include --------------------------------------------------------------- -#include <svtools/whiter.hxx> -#include <svtools/style.hxx> +#include <svl/whiter.hxx> +#include <svl/style.hxx> #ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> #endif diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index 80f0daba71b9..1008c76b8d9f 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -34,10 +34,10 @@ #include <limits.h> #include <stdlib.h> #include <vcl/msgbox.hxx> -#include <svtools/viewoptions.hxx> +#include <unotools/viewoptions.hxx> #define _SVSTDARR_USHORTS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include "appdata.hxx" #include "sfxtypes.hxx" diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 706739cd0571..584dd488da56 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -34,14 +34,14 @@ #ifndef _MENU_HXX //autogen #include <vcl/menu.hxx> #endif -#include <svtools/intitem.hxx> -#include <svtools/stritem.hxx> -#include <svtools/style.hxx> +#include <svl/intitem.hxx> +#include <svl/stritem.hxx> +#include <svl/style.hxx> #ifndef GCC #endif #define _SVSTDARR_STRINGSDTOR -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/sequenceashashmap.hxx> #include <unotools/intlwrapper.hxx> @@ -2407,7 +2407,7 @@ void SfxTemplateDialog_Impl::updateFamilyImages() return; // let the families collection update the images - sal_Bool bIsHighContrast = m_pFloat->GetDisplayBackground().GetColor().IsDark(); + sal_Bool bIsHighContrast = m_pFloat->GetSettings().GetStyleSettings().GetHighContrastMode(); pStyleFamilies->updateImages( *m_pStyleFamiliesId, bIsHighContrast ? BMP_COLOR_HIGHCONTRAST : BMP_COLOR_NORMAL ); // and set the new images on our toolbox @@ -2424,7 +2424,7 @@ void SfxTemplateDialog_Impl::updateFamilyImages() void SfxTemplateDialog_Impl::updateNonFamilyImages() { m_aActionTbR.SetImageList( ImageList( SfxResId( - m_pFloat->GetDisplayBackground().GetColor().IsDark() ? IMG_LST_STYLE_DESIGNER_HC + m_pFloat->GetSettings().GetStyleSettings().GetHighContrastMode() ? IMG_LST_STYLE_DESIGNER_HC : DLG_STYLE_DESIGNER ) ) ); } diff --git a/sfx2/source/dialog/tplcitem.cxx b/sfx2/source/dialog/tplcitem.cxx index e4475268b57d..111cab903f7e 100644 --- a/sfx2/source/dialog/tplcitem.cxx +++ b/sfx2/source/dialog/tplcitem.cxx @@ -33,7 +33,7 @@ // INCLUDE --------------------------------------------------------------- -#include <svtools/intitem.hxx> +#include <svl/intitem.hxx> #include <vcl/svapp.hxx> #ifndef GCC diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx index accb6b5c3a37..5d2cf91b0c8f 100644 --- a/sfx2/source/dialog/versdlg.cxx +++ b/sfx2/source/dialog/versdlg.cxx @@ -34,17 +34,17 @@ #ifndef _UNOTOOLS_PROCESSFACTORY_HXX #include <comphelper/processfactory.hxx> #endif -#include <svtools/eitem.hxx> -#include <svtools/intitem.hxx> -#include <svtools/stritem.hxx> -#include <svtools/itemset.hxx> -#include <svtools/useroptions.hxx> +#include <svl/eitem.hxx> +#include <svl/intitem.hxx> +#include <svl/stritem.hxx> +#include <svl/itemset.hxx> +#include <unotools/useroptions.hxx> #include <vcl/msgbox.hxx> #include <vcl/svapp.hxx> #include <tools/datetime.hxx> #define _SVSTDARR_STRINGSDTOR -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include "versdlg.hrc" #include "versdlg.hxx" diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx index 1423e712242e..476d6f5186a5 100644 --- a/sfx2/source/doc/SfxDocumentMetaData.cxx +++ b/sfx2/source/doc/SfxDocumentMetaData.cxx @@ -66,6 +66,7 @@ #include "com/sun/star/xml/xpath/XXPathAPI.hpp" #include "com/sun/star/util/Date.hpp" #include "com/sun/star/util/Time.hpp" +#include "com/sun/star/util/Duration.hpp" #include "SfxDocumentMetaData.hxx" #include "rtl/ustrbuf.hxx" @@ -79,6 +80,7 @@ #include "comphelper/storagehelper.hxx" #include "comphelper/mediadescriptor.hxx" #include "comphelper/sequenceasvector.hxx" +#include "comphelper/stlunosequence.hxx" #include "sot/storage.hxx" #include "sfx2/docfile.hxx" #include "sax/tools/converter.hxx" @@ -322,7 +324,7 @@ private: /// standard meta data (multiple occurrences) std::map< ::rtl::OUString, std::vector<css::uno::Reference<css::xml::dom::XNode> > > m_metaList; - /// user-defined meta data (meta:user-defined) + /// user-defined meta data (meta:user-defined) @ATTENTION may be null! css::uno::Reference<css::beans::XPropertyContainer> m_xUserDefined; // now for some meta-data attributes; these are not updated directly in the // DOM because updates (detecting "empty" elements) would be quite messy @@ -468,6 +470,11 @@ const char* s_nsODFMeta = "urn:oasis:names:tc:opendocument:xmlns:meta:1.0"; const char* s_metaXml = "meta.xml"; +bool isValidDate(const css::util::Date & i_rDate) +{ + return i_rDate.Month > 0; +} + bool isValidDateTime(const css::util::DateTime & i_rDateTime) { return i_rDateTime.Month > 0; @@ -499,16 +506,25 @@ getQualifier(const char* i_name) { return ::rtl::OUString::createFromAscii(ns); } +bool SAL_CALL +textToDateOrDateTime(css::util::Date & io_rd, css::util::DateTime & io_rdt, + bool & o_rIsDateTime, ::rtl::OUString i_text) throw () +{ + if (::sax::Converter::convertDateOrDateTime( + io_rd, io_rdt, o_rIsDateTime, i_text)) { + return true; + } else { + DBG_WARNING1("SfxDocumentMetaData: invalid date: %s", + OUStringToOString(i_text, RTL_TEXTENCODING_UTF8).getStr()); + return false; + } +} + // convert string to date/time bool SAL_CALL textToDateTime(css::util::DateTime & io_rdt, ::rtl::OUString i_text) throw () { if (::sax::Converter::convertDateTime(io_rdt, i_text)) { - // NB: there may be rounding errors; handle these here - if (io_rdt.HundredthSeconds > 0) { - io_rdt.Seconds++; - io_rdt.HundredthSeconds = 0; - } return true; } else { DBG_WARNING1("SfxDocumentMetaData: invalid date: %s", @@ -527,6 +543,20 @@ textToDateTimeDefault(::rtl::OUString i_text) throw () return dt; } +// convert date to string +::rtl::OUString SAL_CALL +dateToText(css::util::Date const& i_rd) throw () +{ + if (isValidDate(i_rd)) { + ::rtl::OUStringBuffer buf; + ::sax::Converter::convertDate(buf, i_rd); + return buf.makeStringAndClear(); + } else { + return ::rtl::OUString(); + } +} + + // convert date/time to string ::rtl::OUString SAL_CALL dateTimeToText(css::util::DateTime const& i_rdt) throw () @@ -541,60 +571,48 @@ dateTimeToText(css::util::DateTime const& i_rdt) throw () } // convert string to duration -bool SAL_CALL -textToDuration(css::util::Time& io_rut, ::rtl::OUString i_text) throw () +bool +textToDuration(css::util::Duration& io_rDur, ::rtl::OUString const& i_rText) +throw () { - css::util::DateTime dt; - if (::sax::Converter::convertTime(dt, i_text)) { - // NB: there may be rounding errors; handle these here - if (dt.HundredthSeconds > 0) { - dt.Seconds++; - dt.HundredthSeconds = 0; - } - io_rut.Hours = dt.Hours; - io_rut.Minutes = dt.Minutes; - io_rut.Seconds = dt.Seconds; - io_rut.HundredthSeconds = dt.HundredthSeconds; + if (::sax::Converter::convertDuration(io_rDur, i_rText)) { return true; } else { DBG_WARNING1("SfxDocumentMetaData: invalid duration: %s", - OUStringToOString(i_text, RTL_TEXTENCODING_UTF8).getStr()); + OUStringToOString(i_rText, RTL_TEXTENCODING_UTF8).getStr()); return false; } } -sal_Int32 SAL_CALL textToDuration(::rtl::OUString i_text) throw () +sal_Int32 textToDuration(::rtl::OUString const& i_rText) throw () { - css::util::Time t; - if (textToDuration(t, i_text)) { - return t.Hours * 3600 + t.Minutes * 60 + t.Seconds; + css::util::Duration d; + if (textToDuration(d, i_rText)) { + return (d.Days * (24*3600)) + + (d.Hours * 3600) + (d.Minutes * 60) + d.Seconds; } else { return 0; // default } } // convert duration to string -::rtl::OUString SAL_CALL durationToText(css::util::Time const& i_rut) throw () +::rtl::OUString durationToText(css::util::Duration const& i_rDur) throw () { - css::util::DateTime dt; - dt.Hours = i_rut.Hours; - dt.Minutes = i_rut.Minutes; - dt.Seconds = i_rut.Seconds; - dt.HundredthSeconds = i_rut.HundredthSeconds; ::rtl::OUStringBuffer buf; - ::sax::Converter::convertTime(buf, dt); + ::sax::Converter::convertDuration(buf, i_rDur); return buf.makeStringAndClear(); } // convert duration to string ::rtl::OUString SAL_CALL durationToText(sal_Int32 i_value) throw () { - css::util::Time ut; - ut.Hours = static_cast<sal_Int16>(i_value / 3600); - ut.Minutes = static_cast<sal_Int16>((i_value % 3600) / 60); - ut.Seconds = static_cast<sal_Int16>(i_value % 60); - ut.HundredthSeconds = 0; - return durationToText(ut); + css::util::Duration ud; + ud.Days = static_cast<sal_Int16>(i_value / (24 * 3600)); + ud.Hours = static_cast<sal_Int16>((i_value % (24 * 3600)) / 3600); + ud.Minutes = static_cast<sal_Int16>((i_value % 3600) / 60); + ud.Seconds = static_cast<sal_Int16>(i_value % 60); + ud.HundredthSeconds = 0; + return durationToText(ud); } // extract base URL (necessary for converting relative links) @@ -921,17 +939,26 @@ propsToStrings(css::uno::Reference<css::beans::XPropertySet> const & i_xPropSet) } else if (type == ::cppu::UnoType<css::util::Date>::get()) { css::util::Date d; any >>= d; - css::util::DateTime dt; - dt.Year = d.Year; - dt.Month = d.Month; - dt.Day = d.Day; - values.push_back(dateTimeToText(dt)); + values.push_back(dateToText(d)); as.push_back(std::make_pair(vt, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("date")))); } else if (type == ::cppu::UnoType<css::util::Time>::get()) { + // #i97029#: replaced by Duration + // Time is supported for backward compatibility with OOo 3.x, x<=2 css::util::Time ut; any >>= ut; - values.push_back(durationToText(ut)); + css::util::Duration ud; + ud.Hours = ut.Hours; + ud.Minutes = ut.Minutes; + ud.Seconds = ut.Seconds; + ud.HundredthSeconds = ut.HundredthSeconds; + values.push_back(durationToText(ud)); + as.push_back(std::make_pair(vt, + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("time")))); + } else if (type == ::cppu::UnoType<css::util::Duration>::get()) { + css::util::Duration ud; + any >>= ud; + values.push_back(durationToText(ud)); as.push_back(std::make_pair(vt, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("time")))); } else if (::cppu::UnoType<double>::get().isAssignableFrom(type)) { @@ -998,9 +1025,12 @@ SfxDocumentMetaData::updateElement(const char *i_name, void SAL_CALL SfxDocumentMetaData::updateUserDefinedAndAttributes() { createUserDefined(); - css::uno::Reference<css::beans::XPropertySet> xPSet(m_xUserDefined,css::uno::UNO_QUERY_THROW); - std::pair<css::uno::Sequence< ::rtl::OUString>, AttrVector> udStringsAttrs = propsToStrings(xPSet); - (void) setMetaList("meta:user-defined", udStringsAttrs.first,&udStringsAttrs.second); + const css::uno::Reference<css::beans::XPropertySet> xPSet(m_xUserDefined, + css::uno::UNO_QUERY_THROW); + const std::pair<css::uno::Sequence< ::rtl::OUString>, AttrVector> + udStringsAttrs( propsToStrings(xPSet) ); + (void) setMetaList("meta:user-defined", udStringsAttrs.first, + &udStringsAttrs.second); // update elements with attributes std::vector<std::pair<const char *, ::rtl::OUString> > attributes; @@ -1217,15 +1247,13 @@ void SAL_CALL SfxDocumentMetaData::init( std::vector<css::uno::Reference<css::xml::dom::XNode> > & vec = m_metaList[::rtl::OUString::createFromAscii("meta:user-defined")]; - // user-defined meta data: create PropertyBag which only accepts property - // values of allowed types + m_xUserDefined.clear(); // #i105826#: reset (may be re-initialization) if ( !vec.empty() ) { createUserDefined(); } // user-defined meta data: initialize PropertySet from DOM nodes - for (std::vector<css::uno::Reference<css::xml::dom::XNode> >::iterator it = vec.begin(); it != vec.end(); ++it) { css::uno::Reference<css::xml::dom::XElement> xElem(*it, @@ -1248,18 +1276,24 @@ void SAL_CALL SfxDocumentMetaData::init( continue; } } else if (type.equalsAscii("date")) { + bool isDateTime; + css::util::Date d; css::util::DateTime dt; - if (textToDateTime(dt, text)) { - any <<= dt; + if (textToDateOrDateTime(d, dt, isDateTime, text)) { + if (isDateTime) { + any <<= dt; + } else { + any <<= d; + } } else { DBG_WARNING1("SfxDocumentMetaData: invalid date: %s", OUStringToOString(text, RTL_TEXTENCODING_UTF8).getStr()); continue; } } else if (type.equalsAscii("time")) { - css::util::Time ut; - if (textToDuration(ut, text)) { - any <<= ut; + css::util::Duration ud; + if (textToDuration(ud, text)) { + any <<= ud; } else { DBG_WARNING1("SfxDocumentMetaData: invalid time: %s", OUStringToOString(text, RTL_TEXTENCODING_UTF8).getStr()); @@ -1301,10 +1335,14 @@ void SAL_CALL SfxDocumentMetaData::init( //////////////////////////////////////////////////////////////////////////// SfxDocumentMetaData::SfxDocumentMetaData( - css::uno::Reference< css::uno::XComponentContext > const & context) : - BaseMutex(), SfxDocumentMetaData_Base(m_aMutex), - m_xContext(context), m_NotifyListeners(m_aMutex), - m_isInitialized(false), m_isModified(false) + css::uno::Reference< css::uno::XComponentContext > const & context) + : BaseMutex() + , SfxDocumentMetaData_Base(m_aMutex) + , m_xContext(context) + , m_NotifyListeners(m_aMutex) + , m_isInitialized(false) + , m_isModified(false) + , m_AutoloadSecs(0) { DBG_ASSERT(context.is(), "SfxDocumentMetaData: context is null"); DBG_ASSERT(context->getServiceManager().is(), @@ -2168,7 +2206,7 @@ void SAL_CALL SfxDocumentMetaData::setModified( ::sal_Bool bModified ) ::osl::MutexGuard g(m_aMutex); checkInit(); m_isModified = bModified; - if ( !bModified ) + if ( !bModified && m_xUserDefined.is() ) { xMB.set(m_xUserDefined, css::uno::UNO_QUERY); DBG_ASSERT(xMB.is(), @@ -2241,46 +2279,58 @@ void SAL_CALL SfxDocumentMetaData::serialize( void SfxDocumentMetaData::createUserDefined() { + // user-defined meta data: create PropertyBag which only accepts property + // values of allowed types if ( !m_xUserDefined.is() ) { - css::uno::Sequence<css::uno::Type> types(10); + css::uno::Sequence<css::uno::Type> types(11); types[0] = ::cppu::UnoType<bool>::get(); types[1] = ::cppu::UnoType< ::rtl::OUString>::get(); types[2] = ::cppu::UnoType<css::util::DateTime>::get(); types[3] = ::cppu::UnoType<css::util::Date>::get(); - types[4] = ::cppu::UnoType<css::util::Time>::get(); + types[4] = ::cppu::UnoType<css::util::Duration>::get(); types[5] = ::cppu::UnoType<float>::get(); types[6] = ::cppu::UnoType<double>::get(); types[7] = ::cppu::UnoType<sal_Int16>::get(); types[8] = ::cppu::UnoType<sal_Int32>::get(); types[9] = ::cppu::UnoType<sal_Int64>::get(); + // Time is supported for backward compatibility with OOo 3.x, x<=2 + types[10] = ::cppu::UnoType<css::util::Time>::get(); css::uno::Sequence<css::uno::Any> args(2); args[0] <<= css::beans::NamedValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AllowedTypes")), css::uno::makeAny(types)); - // #i94175#: ODF 1.1 allows empty user-defined property names! - args[1] <<= css::beans::NamedValue( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AllowEmptyPropertyName")), + // #i94175#: ODF allows empty user-defined property names! + args[1] <<= css::beans::NamedValue( ::rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("AllowEmptyPropertyName")), css::uno::makeAny(sal_True)); - css::uno::Reference<css::lang::XMultiComponentFactory> xMsf (m_xContext->getServiceManager()); + const css::uno::Reference<css::lang::XMultiComponentFactory> xMsf( + m_xContext->getServiceManager()); m_xUserDefined.set( - xMsf->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("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); - css::uno::Reference<css::lang::XInitialization> xInit(m_xUserDefined, - css::uno::UNO_QUERY); + const css::uno::Reference<css::lang::XInitialization> xInit( + m_xUserDefined, css::uno::UNO_QUERY); if (xInit.is()) { xInit->initialize(args); } - css::uno::Reference<css::util::XModifyBroadcaster> xMB(m_xUserDefined,css::uno::UNO_QUERY); + const css::uno::Reference<css::util::XModifyBroadcaster> xMB( + m_xUserDefined, css::uno::UNO_QUERY); if (xMB.is()) { - css::uno::Sequence< css::uno::Reference< css::uno::XInterface > > aListener = m_NotifyListeners.getElements(); - const css::uno::Reference< css::uno::XInterface >* pIter = aListener.getConstArray(); - const css::uno::Reference< css::uno::XInterface >* pEnd = pIter + aListener.getLength(); - for(;pIter != pEnd;++pIter ) - xMB->addModifyListener(css::uno::Reference< css::util::XModifyListener >(*pIter,css::uno::UNO_QUERY)); + const css::uno::Sequence<css::uno::Reference<css::uno::XInterface> > + listeners(m_NotifyListeners.getElements()); + for (css::uno::Reference< css::uno::XInterface > const * iter = + ::comphelper::stl_begin(listeners); + iter != ::comphelper::stl_end(listeners); ++iter) { + xMB->addModifyListener( + css::uno::Reference< css::util::XModifyListener >(*iter, + css::uno::UNO_QUERY)); + } } } } diff --git a/sfx2/source/doc/applet.cxx b/sfx2/source/doc/applet.cxx index c6e5bfabbe94..8a98a1f8bd70 100644 --- a/sfx2/source/doc/applet.cxx +++ b/sfx2/source/doc/applet.cxx @@ -43,7 +43,7 @@ #include <vcl/syschild.hxx> #include <rtl/ustring.hxx> #include <toolkit/helper/vclunohelper.hxx> -#include <svtools/javaoptions.hxx> +#include <unotools/javaoptions.hxx> #include <svtools/miscopt.hxx> #include <comphelper/TypeGeneration.hxx> diff --git a/sfx2/source/doc/doc.src b/sfx2/source/doc/doc.src index 3f8ab1ae7177..c914d9fe2927 100644 --- a/sfx2/source/doc/doc.src +++ b/sfx2/source/doc/doc.src @@ -30,7 +30,7 @@ #include <sfx2/sfx.hrc> #include "doc.hrc" #define __RSC -#include <svtools/inetdef.hxx> +#include <svl/inetdef.hxx> //#include <so3/so2defs.hxx> // ----------------------------------------------------------------------- diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx index 3a00bbe3097a..012109cac21a 100644 --- a/sfx2/source/doc/docfac.cxx +++ b/sfx2/source/doc/docfac.cxx @@ -35,8 +35,8 @@ #include <com/sun/star/container/XNameAccess.hpp> #include <comphelper/processfactory.hxx> #include <tools/config.hxx> -#include <svtools/pathoptions.hxx> -#include <svtools/moduleoptions.hxx> +#include <unotools/pathoptions.hxx> +#include <unotools/moduleoptions.hxx> #include <tools/urlobj.hxx> #include <unotools/ucbstreamhelper.hxx> #include <comphelper/sequenceashashmap.hxx> diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 32ae33ec3c8b..108c9f27858a 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -90,19 +90,19 @@ #ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> #endif -#include <svtools/stritem.hxx> -#include <svtools/eitem.hxx> -#include <svtools/lckbitem.hxx> +#include <svl/stritem.hxx> +#include <svl/eitem.hxx> +#include <svl/lckbitem.hxx> #include <svtools/sfxecode.hxx> -#include <svtools/itemset.hxx> -#include <svtools/intitem.hxx> +#include <svl/itemset.hxx> +#include <svl/intitem.hxx> #include <svtools/svparser.hxx> // SvKeyValue #include <cppuhelper/weakref.hxx> #include <cppuhelper/implbase1.hxx> #define _SVSTDARR_ULONGS #define _SVSTDARR_STRINGSDTOR -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <unotools/streamwrap.hxx> @@ -121,9 +121,9 @@ using namespace ::com::sun::star::io; #include <tools/urlobj.hxx> #include <tools/inetmime.hxx> #include <unotools/ucblockbytes.hxx> -#include <svtools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> #include <svtools/asynclink.hxx> -#include <svtools/inettype.hxx> +#include <svl/inettype.hxx> #include <ucbhelper/contentbroker.hxx> #include <ucbhelper/commandenvironment.hxx> #include <unotools/localfilehelper.hxx> @@ -133,8 +133,8 @@ using namespace ::com::sun::star::io; #include <ucbhelper/content.hxx> #include <ucbhelper/interactionrequest.hxx> #include <sot/stg.hxx> -#include <svtools/saveopt.hxx> -#include <svtools/documentlockfile.hxx> +#include <unotools/saveopt.hxx> +#include <svl/documentlockfile.hxx> #include "opostponedtruncationstream.hxx" #include "helper.hxx" @@ -155,6 +155,8 @@ using namespace ::com::sun::star::io; #define MAX_REDIRECT 5 +sal_Bool IsReadonlyAccordingACL( const sal_Unicode* pFilePath ); + //========================================================== namespace { @@ -381,6 +383,8 @@ public: Reference < XInputStream > xInputStream; Reference < XStream > xStream; + uno::Reference< io::XStream > m_xLockingStream; + sal_uInt32 nLastStorageError; ::rtl::OUString aCharset; @@ -588,11 +592,14 @@ sal_Bool SfxMedium::DocNeedsFileDateCheck() //------------------------------------------------------------------ util::DateTime SfxMedium::GetInitFileDate( sal_Bool bIgnoreOldValue ) { - if ( ( bIgnoreOldValue || !pImp->m_bGotDateTime ) && GetContent().is() ) + if ( ( bIgnoreOldValue || !pImp->m_bGotDateTime ) && aLogicName.Len() ) { try { - pImp->aContent.getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DateModified" )) ) >>= pImp->m_aDateTime; + uno::Reference< ::com::sun::star::ucb::XCommandEnvironment > xDummyEnv; + ::ucbhelper::Content aContent( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ), xDummyEnv ); + + aContent.getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DateModified" )) ) >>= pImp->m_aDateTime; pImp->m_bGotDateTime = sal_True; } catch ( ::com::sun::star::uno::Exception& ) @@ -1109,6 +1116,13 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI ) // otherwise the document should be opened readonly // if user cancel the loading the ERROR_ABORT is set + 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(); + } + sal_Bool bResult = pImp->m_bLocked; if ( !bResult ) @@ -1120,21 +1134,18 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI ) if ( !bResult && !IsReadOnly() ) { - // check whether the file is readonly in fs - // the check is only necessary if - // do it only for loading, some contents still might have problems with this property, let them not affect the saving sal_Bool bContentReadonly = sal_False; - if ( bLoading && ::utl::LocalFileHelper::IsLocalFile( aLogicName ) ) + if ( bLoading && ::utl::LocalFileHelper::IsLocalFile( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ) ) { - // let the stream be opened to check the possibility to open it for editing - GetMedium_Impl(); + // 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(); } // "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 - SFX_ITEMSET_ARG( pSet, pWriteStreamItem, SfxUnoAnyItem, SID_STREAM, sal_False); - if ( bLoading && !pWriteStreamItem ) + if ( bLoading && !pImp->m_xLockingStream.is() ) { try { @@ -1145,6 +1156,15 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI ) } catch( uno::Exception ) {} + + 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() ); + } } // do further checks only if the file not readonly in fs @@ -2256,6 +2276,45 @@ void SfxMedium::ClearBackup_Impl() } //---------------------------------------------------------------- +void SfxMedium::GetLockingStream_Impl() +{ + if ( ::utl::LocalFileHelper::IsLocalFile( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ) + && !pImp->m_xLockingStream.is() ) + { + SFX_ITEMSET_ARG( pSet, pWriteStreamItem, SfxUnoAnyItem, SID_STREAM, sal_False); + if ( pWriteStreamItem ) + pWriteStreamItem->GetValue() >>= pImp->m_xLockingStream; + + if ( !pImp->m_xLockingStream.is() ) + { + // open the original document + uno::Sequence< beans::PropertyValue > xProps; + TransformItems( SID_OPENDOC, *GetItemSet(), xProps ); + comphelper::MediaDescriptor aMedium( xProps ); + + aMedium.addInputStreamOwnLock(); + + uno::Reference< io::XInputStream > xInputStream; + aMedium[comphelper::MediaDescriptor::PROP_STREAM()] >>= pImp->m_xLockingStream; + aMedium[comphelper::MediaDescriptor::PROP_INPUTSTREAM()] >>= xInputStream; + + if ( !pImp->pTempFile && !aName.Len() ) + { + // the medium is still based on the original file, it makes sence to initialize the streams + if ( pImp->m_xLockingStream.is() ) + pImp->xStream = pImp->m_xLockingStream; + + if ( xInputStream.is() ) + pImp->xInputStream = xInputStream; + + if ( !pImp->xInputStream.is() && pImp->xStream.is() ) + pImp->xInputStream = pImp->xStream->getInputStream(); + } + } + } +} + +//---------------------------------------------------------------- void SfxMedium::GetMedium_Impl() { if ( !pInStream ) @@ -2321,27 +2380,36 @@ void SfxMedium::GetMedium_Impl() TransformItems( SID_OPENDOC, *GetItemSet(), xProps ); comphelper::MediaDescriptor aMedium( xProps ); - if ( bFromTempFile ) - { - aMedium[comphelper::MediaDescriptor::PROP_URL()] <<= ::rtl::OUString( aFileName ); - aMedium.erase( comphelper::MediaDescriptor::PROP_READONLY() ); - aMedium.addInputStream(); - } - else if ( ::utl::LocalFileHelper::IsLocalFile( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ) ) + if ( pImp->m_xLockingStream.is() && !bFromTempFile ) { - // use the special locking approach only for file URLs - aMedium.addInputStreamOwnLock(); + // the medium is not based on the temporary file, so the original stream can be used + pImp->xStream = pImp->m_xLockingStream; } else - aMedium.addInputStream(); + { + if ( bFromTempFile ) + { + aMedium[comphelper::MediaDescriptor::PROP_URL()] <<= ::rtl::OUString( aFileName ); + aMedium.erase( comphelper::MediaDescriptor::PROP_READONLY() ); + aMedium.addInputStream(); + } + else if ( ::utl::LocalFileHelper::IsLocalFile( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ) ) + { + // use the special locking approach only for file URLs + aMedium.addInputStreamOwnLock(); + } + else + aMedium.addInputStream(); + + // the ReadOnly property set in aMedium is ignored + // the check is done in LockOrigFileOnDemand() for file and non-file URLs - // the ReadOnly property set in aMedium is ignored - // the check is done in LockOrigFileOnDemand() for file and non-file URLs + //TODO/MBA: what happens if property is not there?! + aMedium[comphelper::MediaDescriptor::PROP_STREAM()] >>= pImp->xStream; + aMedium[comphelper::MediaDescriptor::PROP_INPUTSTREAM()] >>= pImp->xInputStream; + } - //TODO/MBA: what happens if property is not there?! GetContent(); - aMedium[comphelper::MediaDescriptor::PROP_STREAM()] >>= pImp->xStream; - aMedium[comphelper::MediaDescriptor::PROP_INPUTSTREAM()] >>= pImp->xInputStream; if ( !pImp->xInputStream.is() && pImp->xStream.is() ) pImp->xInputStream = pImp->xStream->getInputStream(); } @@ -2650,7 +2718,7 @@ void SfxMedium::Close() CloseStreams_Impl(); - UnlockFile(); + UnlockFile( sal_False ); } void SfxMedium::CloseAndRelease() @@ -2683,11 +2751,31 @@ void SfxMedium::CloseAndRelease() CloseAndReleaseStreams_Impl(); - UnlockFile(); + UnlockFile( sal_True ); } -void SfxMedium::UnlockFile() +void SfxMedium::UnlockFile( sal_Bool bReleaseLockStream ) { + if ( pImp->m_xLockingStream.is() ) + { + if ( bReleaseLockStream ) + { + try + { + uno::Reference< io::XInputStream > xInStream = pImp->m_xLockingStream->getInputStream(); + uno::Reference< io::XOutputStream > xOutStream = pImp->m_xLockingStream->getOutputStream(); + if ( xInStream.is() ) + xInStream->closeInput(); + if ( xOutStream.is() ) + xOutStream->closeOutput(); + } + catch( uno::Exception& ) + {} + } + + pImp->m_xLockingStream = uno::Reference< io::XStream >(); + } + if ( pImp->m_bLocked ) { try @@ -2709,8 +2797,14 @@ void SfxMedium::CloseAndReleaseStreams_Impl() uno::Reference< io::XInputStream > xInToClose = pImp->xInputStream; uno::Reference< io::XOutputStream > xOutToClose; if ( pImp->xStream.is() ) + { xOutToClose = pImp->xStream->getOutputStream(); + // if the locking stream is closed here the related member should be cleaned + if ( pImp->xStream == pImp->m_xLockingStream ) + pImp->m_xLockingStream = uno::Reference< io::XStream >(); + } + // The probably exsisting SvStream wrappers should be closed first CloseStreams_Impl(); @@ -3422,13 +3516,14 @@ void SfxMedium::CreateTempFile( sal_Bool bReplace ) if ( !( nStorOpenMode & STREAM_TRUNC ) ) { + sal_Bool bTransferSuccess = sal_False; + if ( GetContent().is() && ::utl::LocalFileHelper::IsLocalFile( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ) && ::utl::UCBContentHelper::IsDocument( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ) ) { // if there is already such a document, we should copy it // if it is a file system use OS copy process - sal_Bool bTransferSuccess = sal_False; try { uno::Reference< ::com::sun::star::ucb::XCommandEnvironment > xComEnv; @@ -3449,16 +3544,14 @@ void SfxMedium::CreateTempFile( sal_Bool bReplace ) catch( uno::Exception& ) {} - if ( !bTransferSuccess ) + if ( bTransferSuccess ) { - SetError( ERRCODE_IO_CANTWRITE, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); - return; + CloseOutStream(); + CloseInStream(); } - - CloseOutStream(); - CloseInStream(); } - else if ( pInStream ) + + if ( !bTransferSuccess && pInStream ) { // the case when there is no URL-access available or this is a remote protocoll // but there is an input stream @@ -3478,13 +3571,25 @@ void SfxMedium::CreateTempFile( sal_Bool bReplace ) pOutStream->Write( pBuf, nRead ); } + bTransferSuccess = sal_True; delete[] pBuf; CloseInStream(); } CloseOutStream_Impl(); } else + { + // Quite strange design, but currently it is expected that in this case no transfer happens + // TODO/LATER: get rid of this inconsistent part of the call design + bTransferSuccess = sal_True; CloseInStream(); + } + + if ( !bTransferSuccess ) + { + SetError( ERRCODE_IO_CANTWRITE, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + return; + } } CloseStorage(); diff --git a/sfx2/source/doc/docinsert.cxx b/sfx2/source/doc/docinsert.cxx index ecd9ae7aee42..9615cc4f51a7 100644 --- a/sfx2/source/doc/docinsert.cxx +++ b/sfx2/source/doc/docinsert.cxx @@ -48,13 +48,13 @@ #include <com/sun/star/lang/IllegalArgumentException.hpp> #include <tools/urlobj.hxx> #include <vcl/msgbox.hxx> -#include <svtools/itemset.hxx> -#include <svtools/eitem.hxx> -#include <svtools/intitem.hxx> -#include <svtools/stritem.hxx> +#include <svl/itemset.hxx> +#include <svl/eitem.hxx> +#include <svl/intitem.hxx> +#include <svl/stritem.hxx> #define _SVSTDARR_STRINGSDTOR -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> using namespace ::com::sun::star::lang; using namespace ::com::sun::star::ui::dialogs; diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx index f1b889821de7..8d96c08a51d4 100644 --- a/sfx2/source/doc/docmacromode.cxx +++ b/sfx2/source/doc/docmacromode.cxx @@ -48,7 +48,7 @@ #include <framework/interaction.hxx> #include <osl/file.hxx> #include <rtl/ref.hxx> -#include <svtools/securityoptions.hxx> +#include <unotools/securityoptions.hxx> #include <svtools/sfxecode.hxx> #include <tools/diagnose_ex.h> #include <tools/urlobj.hxx> diff --git a/sfx2/source/doc/doctdlg.cxx b/sfx2/source/doc/doctdlg.cxx index 3d5ba474fb3e..a00b047230d1 100644 --- a/sfx2/source/doc/doctdlg.cxx +++ b/sfx2/source/doc/doctdlg.cxx @@ -34,7 +34,7 @@ #ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> #endif -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #ifndef GCC #endif diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx index f1b117f6a1c9..80492708d652 100644 --- a/sfx2/source/doc/doctempl.cxx +++ b/sfx2/source/doc/doctempl.cxx @@ -42,7 +42,7 @@ #include <vcl/svapp.hxx> #include <vcl/settings.hxx> #include <unotools/localedatawrapper.hxx> -#include <svtools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> #include <tools/string.hxx> #include <tools/urlobj.hxx> #include <svtools/ehdl.hxx> diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index 099e649506c0..4439dc05f9ff 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -43,7 +43,7 @@ #include <vcl/svapp.hxx> #include <vcl/wrkwin.hxx> #include <comphelper/sequenceashashmap.hxx> -#include <svtools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> #include <comphelper/processfactory.hxx> #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/beans/XPropertySet.hpp> diff --git a/sfx2/source/doc/docvor.cxx b/sfx2/source/doc/docvor.cxx index e70824869070..86a86ccb61b4 100644 --- a/sfx2/source/doc/docvor.cxx +++ b/sfx2/source/doc/docvor.cxx @@ -44,17 +44,17 @@ #include <vcl/menubtn.hxx> #include <vcl/msgbox.hxx> #include <vcl/print.hxx> -#include <svtools/style.hxx> -#include <svtools/stritem.hxx> -#include <svtools/eitem.hxx> +#include <svl/style.hxx> +#include <svl/stritem.hxx> +#include <svl/eitem.hxx> #include <svtools/sfxecode.hxx> #include <svtools/ehdl.hxx> #include <svtools/imagemgr.hxx> #include <vcl/waitobj.hxx> #include <tools/urlobj.hxx> #include <tools/color.hxx> -#include <svtools/pathoptions.hxx> -#include <svtools/moduleoptions.hxx> +#include <unotools/pathoptions.hxx> +#include <unotools/moduleoptions.hxx> #include <sot/exchange.hxx> #include <comphelper/storagehelper.hxx> @@ -81,7 +81,7 @@ #endif #include <comphelper/processfactory.hxx> #define _SVSTDARR_STRINGSDTOR -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> static const char cDelim = ':'; BOOL SfxOrganizeListBox_Impl::bDropMoveOk = TRUE; @@ -1188,7 +1188,7 @@ void SfxOrganizeListBox_Impl::RequestingChilds( SvLBoxEntry* pEntry ) // einfuegen BmpColorMode eColorMode = BMP_COLOR_NORMAL; - if ( GetDisplayBackground().GetColor().IsDark() ) + if ( GetSettings().GetStyleSettings().GetHighContrastMode() ) eColorMode = BMP_COLOR_HIGHCONTRAST; @@ -1480,7 +1480,7 @@ const Image &SfxOrganizeListBox_Impl::GetClosedBmp(USHORT nLevel) const */ { - BOOL bHC = GetBackground().GetColor().IsDark(); + BOOL bHC = GetSettings().GetStyleSettings().GetHighContrastMode(); const Image* pRet = NULL; switch( nLevel ) @@ -1514,7 +1514,7 @@ const Image &SfxOrganizeListBox_Impl::GetOpenedBmp(USHORT nLevel) const */ { - BOOL bHC = GetBackground().GetColor().IsDark(); + BOOL bHC = GetSettings().GetStyleSettings().GetHighContrastMode(); const Image* pRet = NULL; switch( nLevel ) diff --git a/sfx2/source/doc/frmdescr.cxx b/sfx2/source/doc/frmdescr.cxx index 6f333586a22e..23616edf9279 100644 --- a/sfx2/source/doc/frmdescr.cxx +++ b/sfx2/source/doc/frmdescr.cxx @@ -34,7 +34,7 @@ #include <sot/object.hxx> #include <tools/stream.hxx> #include <vcl/splitwin.hxx> -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> #ifndef GCC #endif diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index 5916fb625787..bceca0db94ca 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -62,12 +62,11 @@ #include "guisaveas.hxx" -#include <svtools/pathoptions.hxx> -#include <svtools/pathoptions.hxx> -#include <svtools/itemset.hxx> -#include <svtools/adrparse.hxx> -#include <svtools/useroptions.hxx> -#include <svtools/saveopt.hxx> +#include <unotools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> +#include <svl/itemset.hxx> +#include <unotools/useroptions.hxx> +#include <unotools/saveopt.hxx> #include <tools/debug.hxx> #include <tools/urlobj.hxx> #include <comphelper/processfactory.hxx> diff --git a/sfx2/source/doc/makefile.mk b/sfx2/source/doc/makefile.mk index 1b42844491e0..66fd03175a8e 100644 --- a/sfx2/source/doc/makefile.mk +++ b/sfx2/source/doc/makefile.mk @@ -86,11 +86,19 @@ SLOFILES = \ $(SLO)$/DocumentMetadataAccess.obj \ $(SLO)$/Metadatable.obj \ $(SLO)$/sfxmodelfactory.obj \ + $(SLO)$/sfxacldetect.obj \ $(SLO)$/docstoragemodifylistener.obj \ $(SLO)$/querytemplate.obj # $(SLO)$/applet.obj \ +.IF "$(GUI)" == "WNT" + +#HACK TO DISABLE PCH +NOOPTFILES= \ + $(SLO)$/sfxacldetect.obj +.ENDIF + # --- Tagets ------------------------------------------------------- diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx index cffa86c0540d..0fe45c49db95 100644 --- a/sfx2/source/doc/new.cxx +++ b/sfx2/source/doc/new.cxx @@ -37,8 +37,8 @@ #ifndef _SVMEDIT_HXX #include <svtools/svmedit.hxx> #endif -#include <svtools/itemset.hxx> -#include <svtools/eitem.hxx> +#include <svl/itemset.hxx> +#include <svl/eitem.hxx> #include <svtools/sfxecode.hxx> #include <svtools/ehdl.hxx> #include <tools/urlobj.hxx> diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index 83e0ae50d3e7..8514ca9a917a 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -41,25 +41,25 @@ #include <com/sun/star/beans/XFastPropertySet.hpp> #include <tools/cachestr.hxx> #include <vcl/msgbox.hxx> -#include <svtools/style.hxx> +#include <svl/style.hxx> #include <vcl/wrkwin.hxx> -#include <svtools/stritem.hxx> -#include <svtools/intitem.hxx> -#include <svtools/rectitem.hxx> -#include <svtools/eitem.hxx> -#include <svtools/urihelper.hxx> -#include <svtools/ctloptions.hxx> +#include <svl/stritem.hxx> +#include <svl/intitem.hxx> +#include <svl/rectitem.hxx> +#include <svl/eitem.hxx> +#include <svl/urihelper.hxx> +#include <svl/ctloptions.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/storagehelper.hxx> -#include <svtools/securityoptions.hxx> +#include <unotools/securityoptions.hxx> #include <svtools/sfxecode.hxx> #include <svtools/ehdl.hxx> #include <tools/datetime.hxx> #include <math.h> -#include <svtools/saveopt.hxx> -#include <svtools/useroptions.hxx> +#include <unotools/saveopt.hxx> +#include <unotools/useroptions.hxx> #include <unotools/localfilehelper.hxx> #include <vcl/virdev.hxx> #include <vcl/oldprintadaptor.hxx> @@ -1414,31 +1414,35 @@ sal_Bool SfxObjectShell::IsHelpDocument() const void SfxObjectShell::ResetFromTemplate( const String& rTemplateName, const String& rFileName ) { - uno::Reference<document::XDocumentProperties> xDocProps(getDocProperties()); - xDocProps->setTemplateURL( ::rtl::OUString() ); - xDocProps->setTemplateName( ::rtl::OUString() ); - xDocProps->setTemplateDate( util::DateTime() ); - xDocProps->resetUserData( ::rtl::OUString() ); + // only care about reseting this data for openoffice formats otherwise + if ( IsOwnStorageFormat_Impl( *GetMedium()) ) + { + uno::Reference<document::XDocumentProperties> xDocProps(getDocProperties()); + xDocProps->setTemplateURL( ::rtl::OUString() ); + xDocProps->setTemplateName( ::rtl::OUString() ); + xDocProps->setTemplateDate( util::DateTime() ); + xDocProps->resetUserData( ::rtl::OUString() ); - // TODO/REFACTOR: - // Title? + // TODO/REFACTOR: + // Title? - if( ::utl::LocalFileHelper::IsLocalFile( rFileName ) ) - { - String aFoundName; - if( SFX_APP()->Get_Impl()->GetDocumentTemplates()->GetFull( String(), rTemplateName, aFoundName ) ) + if( ::utl::LocalFileHelper::IsLocalFile( rFileName ) ) { - INetURLObject aObj( rFileName ); - xDocProps->setTemplateURL( aObj.GetMainURL(INetURLObject::DECODE_TO_IURI) ); - xDocProps->setTemplateName( rTemplateName ); + String aFoundName; + if( SFX_APP()->Get_Impl()->GetDocumentTemplates()->GetFull( String(), rTemplateName, aFoundName ) ) + { + INetURLObject aObj( rFileName ); + xDocProps->setTemplateURL( aObj.GetMainURL(INetURLObject::DECODE_TO_IURI) ); + xDocProps->setTemplateName( rTemplateName ); - ::DateTime now; - xDocProps->setTemplateDate( util::DateTime( - now.Get100Sec(), now.GetSec(), now.GetMin(), - now.GetHour(), now.GetDay(), now.GetMonth(), - now.GetYear() ) ); + ::DateTime now; + xDocProps->setTemplateDate( util::DateTime( + now.Get100Sec(), now.GetSec(), now.GetMin(), + now.GetHour(), now.GetDay(), now.GetMonth(), + now.GetYear() ) ); - SetQueryLoadTemplate( sal_True ); + SetQueryLoadTemplate( sal_True ); + } } } } diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index 5e3ace93372a..3c78bad9220e 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -32,12 +32,12 @@ #include "precompiled_sfx2.hxx" #ifndef _INETMSG_HXX //autogen -#include <svtools/inetmsg.hxx> +#include <svl/inetmsg.hxx> #endif #include <tools/diagnose_ex.h> -#include <svtools/eitem.hxx> -#include <svtools/stritem.hxx> -#include <svtools/intitem.hxx> +#include <svl/eitem.hxx> +#include <svl/stritem.hxx> +#include <svl/intitem.hxx> #include <svtools/svparser.hxx> // SvKeyValue #include <vos/mutex.hxx> #include <cppuhelper/exc_hlp.hxx> @@ -80,7 +80,7 @@ #include <com/sun/star/uno/Any.h> #include <com/sun/star/ucb/XContent.hpp> #include <com/sun/star/task/ErrorCodeRequest.hpp> -#include <svtools/securityoptions.hxx> +#include <unotools/securityoptions.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/componentcontext.hxx> @@ -111,12 +111,12 @@ using namespace ::com::sun::star::container; #include <svtools/sfxecode.hxx> #include <svtools/ehdl.hxx> -#include <svtools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> #include <unotools/ucbhelper.hxx> #include <tools/inetmime.hxx> #include <tools/urlobj.hxx> -#include <svtools/inettype.hxx> -#include <svtools/sharecontrolfile.hxx> +#include <svl/inettype.hxx> +#include <svl/sharecontrolfile.hxx> #include <osl/file.hxx> #include <rtl/bootstrap.hxx> #include <vcl/svapp.hxx> @@ -491,6 +491,13 @@ 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 + //------------------------------------------------------------------------- sal_Bool SfxObjectShell::HasModalViews() const @@ -2531,12 +2538,20 @@ void SfxObjectShell::StoreLog() if ( pImp->m_xLogRing.is() ) { - ::rtl::OUString aFileURL = - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "${$BRAND_BASE_DIR/program/bootstrap.ini:UserInstallation}" ) ); +#ifdef WNT + ::rtl::OUString aFileURL = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "${$BRAND_BASE_DIR/program/bootstrap.ini:UserInstallation}" ) ); +#else + ::rtl::OUString aFileURL = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "${$BRAND_BASE_DIR/program/bootstraprc:UserInstallation}" ) ); +#endif + ::rtl::Bootstrap::expandMacros( aFileURL ); - ::rtl::OUString aBuildID = - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "${$BRAND_BASE_DIR/program/setup.ini:buildid}" ) ); +#ifdef WNT + ::rtl::OUString aBuildID = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "${$BRAND_BASE_DIR/program/setup.ini:buildid}" ) ); +#else + ::rtl::OUString aBuildID = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "${$BRAND_BASE_DIR/program/setuprc:buildid}" ) ); +#endif + ::rtl::Bootstrap::expandMacros( aBuildID ); if ( aFileURL.getLength() ) diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 8a8512a37af0..fb555c5edeec 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -54,20 +54,20 @@ #include <com/sun/star/security/DocumentSignatureInformation.hpp> #include <com/sun/star/security/XDocumentDigitalSignatures.hpp> #include <tools/urlobj.hxx> -#include <svtools/whiter.hxx> +#include <svl/whiter.hxx> #include <vcl/msgbox.hxx> -#include <svtools/intitem.hxx> -#include <svtools/eitem.hxx> +#include <svl/intitem.hxx> +#include <svl/eitem.hxx> #include <vcl/wrkwin.hxx> #include <svtools/sfxecode.hxx> #include <svtools/ehdl.hxx> #include <comphelper/string.hxx> #include <basic/sbx.hxx> -#include <svtools/pathoptions.hxx> -#include <svtools/useroptions.hxx> +#include <unotools/pathoptions.hxx> +#include <unotools/useroptions.hxx> #include <svtools/asynclink.hxx> -#include <svtools/saveopt.hxx> +#include <unotools/saveopt.hxx> #include <comphelper/documentconstants.hxx> #include <sfx2/app.hxx> @@ -1512,3 +1512,19 @@ void SfxObjectShell::SignScriptingContent() ImplSign( TRUE ); } +// static +const uno::Sequence<sal_Int8>& SfxObjectShell::getUnoTunnelId() +{ + static uno::Sequence<sal_Int8> * pSeq = 0; + if( !pSeq ) + { + osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); + if( !pSeq ) + { + static uno::Sequence< sal_Int8 > aSeq( 16 ); + rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True ); + pSeq = &aSeq; + } + } + return *pSeq; +} diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 21515b2c6f3d..ead9a7c9fd9a 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -34,9 +34,9 @@ #ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> #endif -#include <svtools/eitem.hxx> -#include <svtools/stritem.hxx> -#include <svtools/intitem.hxx> +#include <svl/eitem.hxx> +#include <svl/stritem.hxx> +#include <svl/intitem.hxx> #include <tools/zcodec.hxx> #include <com/sun/star/frame/XStorable.hpp> #include <com/sun/star/frame/XModel.hpp> @@ -80,16 +80,15 @@ #include <comphelper/configurationhelper.hxx> #include <comphelper/interaction.hxx> #include <svtools/sfxecode.hxx> -#include <svtools/securityoptions.hxx> +#include <unotools/securityoptions.hxx> #include <cppuhelper/weak.hxx> #include <comphelper/processfactory.hxx> #include <tools/cachestr.hxx> -#include <svtools/addxmltostorageoptions.hxx> #include <unotools/streamwrap.hxx> -#include <svtools/saveopt.hxx> -#include <svtools/useroptions.hxx> -#include <svtools/pathoptions.hxx> +#include <unotools/saveopt.hxx> +#include <unotools/useroptions.hxx> +#include <unotools/pathoptions.hxx> #include <tools/urlobj.hxx> #include <tools/diagnose_ex.h> #include <unotools/localfilehelper.hxx> @@ -1872,7 +1871,19 @@ sal_Bool SfxObjectShell::DisconnectStorage_Impl( SfxMedium& rSrcMedium, SfxMediu { uno::Reference< embed::XOptimizedStorage > xOptStorage( xStorage, uno::UNO_QUERY_THROW ); ::rtl::OUString aBackupURL = rTargetMedium.GetBackup_Impl(); - if ( aBackupURL.getLength() ) + if ( !aBackupURL.getLength() ) + { + // the backup could not be created, try to disconnect the storage and close the source SfxMedium + // in this case the optimization is not possible, connect storage to a temporary file + rTargetMedium.ResetError(); + xOptStorage->writeAndAttachToStream( uno::Reference< io::XStream >() ); + rSrcMedium.CanDisposeStorage_Impl( sal_False ); + rSrcMedium.Close(); + + // now try to create the backup + rTargetMedium.GetBackup_Impl(); + } + else { // the following call will only compare stream sizes // TODO/LATER: this is a very risky part, since if the URL contents are different from the storage diff --git a/sfx2/source/doc/objuno.cxx b/sfx2/source/doc/objuno.cxx index 1f1cbba7d7e0..eb022afc60df 100644 --- a/sfx2/source/doc/objuno.cxx +++ b/sfx2/source/doc/objuno.cxx @@ -59,7 +59,7 @@ #include <vos/mutex.hxx> #include <tools/errcode.hxx> -#include <svtools/cntwids.hrc> +#include <svl/cntwids.hrc> #include <comphelper/string.hxx> #include <comphelper/sequenceasvector.hxx> #include <comphelper/storagehelper.hxx> diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 950ecf9ea239..91c0f605e453 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -54,14 +54,14 @@ #include <vcl/wrkwin.hxx> #endif #include <vcl/svapp.hxx> -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #include <tools/rtti.hxx> -#include <svtools/lstner.hxx> +#include <svl/lstner.hxx> #include <sfxhelp.hxx> #include <basic/sbstar.hxx> -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #include <basic/sbx.hxx> -#include <svtools/eventcfg.hxx> +#include <unotools/eventcfg.hxx> #include <sfx2/objsh.hxx> #include <sfx2/signaturestate.hxx> @@ -71,7 +71,7 @@ #endif #include <svtools/sfxecode.hxx> #include <svtools/ehdl.hxx> -#include <svtools/printwarningoptions.hxx> +#include <unotools/printwarningoptions.hxx> #ifndef _UNOTOOLS_PROCESSFACTORY_HXX #include <comphelper/processfactory.hxx> #endif @@ -82,9 +82,9 @@ #include <com/sun/star/document/XEmbeddedScripts.hpp> #include <com/sun/star/document/XScriptInvocationContext.hpp> -#include <svtools/urihelper.hxx> -#include <svtools/pathoptions.hxx> -#include <svtools/sharecontrolfile.hxx> +#include <svl/urihelper.hxx> +#include <unotools/pathoptions.hxx> +#include <svl/sharecontrolfile.hxx> #include <unotools/localfilehelper.hxx> #include <unotools/ucbhelper.hxx> #include <svtools/asynclink.hxx> diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx index ed150f390586..103dcf505846 100755 --- a/sfx2/source/doc/printhelper.cxx +++ b/sfx2/source/doc/printhelper.cxx @@ -44,10 +44,10 @@ #include <com/sun/star/lang/EventObject.hpp> #include <com/sun/star/view/DuplexMode.hpp> -#include <svtools/lstner.hxx> -#include <svtools/stritem.hxx> -#include <svtools/intitem.hxx> -#include <svtools/eitem.hxx> +#include <svl/lstner.hxx> +#include <svl/stritem.hxx> +#include <svl/intitem.hxx> +#include <svl/eitem.hxx> #include <unotools/tempfile.hxx> #include <unotools/localfilehelper.hxx> #include <osl/file.hxx> diff --git a/sfx2/source/doc/sfxacldetect.cxx b/sfx2/source/doc/sfxacldetect.cxx new file mode 100755 index 000000000000..b156d409c9be --- /dev/null +++ b/sfx2/source/doc/sfxacldetect.cxx @@ -0,0 +1,108 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: shutdowniconw32.cxx,v $ + * $Revision: 1.48 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifdef WNT + +// necessary to include system headers without warnings +#ifdef _MSC_VER +#pragma warning(disable:4668 4917) +#endif + +#include <windows.h> +#include <lmaccess.h> +#include <sal/types.h> + +sal_Bool IsReadonlyAccordingACL( const sal_Unicode* pFilePath ) +{ + sal_Bool bResult = sal_False; + + sal_uInt32 nFDSize = 0; + GetFileSecurityW( reinterpret_cast< LPCWSTR >(pFilePath), DACL_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|OWNER_SECURITY_INFORMATION, NULL, 0, &nFDSize ); + if ( nFDSize ) + { + PSECURITY_DESCRIPTOR pFileDescr = reinterpret_cast< PSECURITY_DESCRIPTOR >( malloc( nFDSize ) ); + if ( GetFileSecurityW( reinterpret_cast< LPCWSTR >(pFilePath), DACL_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|OWNER_SECURITY_INFORMATION, pFileDescr, nFDSize, &nFDSize ) ) + { + HANDLE hToken = NULL; + if ( OpenThreadToken( GetCurrentThread(), TOKEN_DUPLICATE|TOKEN_QUERY, TRUE, &hToken ) + || OpenProcessToken( GetCurrentProcess(), TOKEN_DUPLICATE|TOKEN_QUERY, &hToken) ) + { + HANDLE hImpersonationToken = NULL; + if ( DuplicateToken( hToken, SecurityImpersonation, &hImpersonationToken) ) + { + sal_uInt32 nDesiredAccess = ACCESS_WRITE; + GENERIC_MAPPING aGenericMapping = { ACCESS_READ, ACCESS_WRITE, 0, ACCESS_READ | ACCESS_WRITE }; + MapGenericMask( &nDesiredAccess, &aGenericMapping ); + + PRIVILEGE_SET aPrivilegeSet; + sal_uInt32 nPrivilegeSetSize = sizeof( PRIVILEGE_SET ); + + sal_uInt32 nGrantedAccess; + BOOL bAccessible = TRUE; + if ( AccessCheck( pFileDescr, + hImpersonationToken, + nDesiredAccess, + &aGenericMapping, + &aPrivilegeSet, + &nPrivilegeSetSize, + &nGrantedAccess, + &bAccessible ) ) + { + bResult = !bAccessible; + } + + CloseHandle( hImpersonationToken ); + } + + CloseHandle( hToken ); + } + } + + free( pFileDescr ); + } + + return bResult; +} + +#else // this is UNX +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_sfx2.hxx" + + +#include <sal/types.h> + +sal_Bool IsReadonlyAccordingACL( const sal_Unicode* ) +{ + // to be implemented + return sal_False; +} + +#endif + diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 03e6e9170153..158dbdb9e13e 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -73,9 +73,9 @@ #include <cppuhelper/exc_hlp.hxx> #include <comphelper/processfactory.hxx> // can be removed when this is a "real" service #include <comphelper/componentcontext.hxx> -#include <svtools/itemset.hxx> -#include <svtools/stritem.hxx> -#include <svtools/eitem.hxx> +#include <svl/itemset.hxx> +#include <svl/stritem.hxx> +#include <svl/eitem.hxx> #include <basic/sbx.hxx> #include <basic/sbuno.hxx> #include <tools/urlobj.hxx> diff --git a/sfx2/source/explorer/nochaos.cxx b/sfx2/source/explorer/nochaos.cxx index 223f0b767845..4c7a1fcbe102 100644 --- a/sfx2/source/explorer/nochaos.cxx +++ b/sfx2/source/explorer/nochaos.cxx @@ -31,9 +31,9 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" -#include <svtools/itempool.hxx> -#include <svtools/poolitem.hxx> -#include <svtools/stritem.hxx> +#include <svl/itempool.hxx> +#include <svl/poolitem.hxx> +#include <svl/stritem.hxx> #include <nochaos.hxx> #include <sfx2/sfxuno.hxx> diff --git a/sfx2/source/inc/appdata.hxx b/sfx2/source/inc/appdata.hxx index bd782b76a5ae..8b0420ef1e97 100644 --- a/sfx2/source/inc/appdata.hxx +++ b/sfx2/source/inc/appdata.hxx @@ -32,7 +32,7 @@ #include <tools/link.hxx> #include <tools/list.hxx> -#include <svtools/lstner.hxx> +#include <svl/lstner.hxx> #include <vcl/timer.hxx> #include <tools/string.hxx> #include "rtl/ref.hxx" @@ -58,7 +58,6 @@ class SfxFilterMatcher; class SfxCancelManager; class SfxStatusDispatcher; class SfxDdeTriggerTopic_Impl; -class SfxMiscCfg; class SfxDocumentTemplates; class SfxFrameArr_Impl; class SvtSaveOptions; @@ -122,7 +121,6 @@ public: SfxEventConfiguration* pEventConfig; SvUShorts* pDisabledSlotList; SvStrings* pSecureURLs; - SfxMiscCfg* pMiscConfig; SvtSaveOptions* pSaveOptions; SvtUndoOptions* pUndoOptions; SvtHelpOptions* pHelpOptions; diff --git a/sfx2/source/inc/applet.hxx b/sfx2/source/inc/applet.hxx index 53b97b2656ff..f8906a7670dd 100644 --- a/sfx2/source/inc/applet.hxx +++ b/sfx2/source/inc/applet.hxx @@ -43,8 +43,8 @@ #include <cppuhelper/implbase6.hxx> #include <rtl/ustring.hxx> -#include <svtools/ownlist.hxx> -#include <svtools/itemprop.hxx> +#include <svl/ownlist.hxx> +#include <svl/itemprop.hxx> namespace com { namespace sun { namespace star { namespace uno { class XComponentContext; diff --git a/sfx2/source/inc/eventsupplier.hxx b/sfx2/source/inc/eventsupplier.hxx index 0940d4bb66e3..a720c2369cf5 100644 --- a/sfx2/source/inc/eventsupplier.hxx +++ b/sfx2/source/inc/eventsupplier.hxx @@ -57,8 +57,8 @@ #include <vos/mutex.hxx> #include <cppuhelper/interfacecontainer.hxx> -#include <svtools/lstner.hxx> -#include <svtools/eventcfg.hxx> +#include <svl/lstner.hxx> +#include <unotools/eventcfg.hxx> //-------------------------------------------------------------------------------------------------------- diff --git a/sfx2/source/inc/helpid.hrc b/sfx2/source/inc/helpid.hrc index 25ec26172109..9aa4f3d8d29c 100644 --- a/sfx2/source/inc/helpid.hrc +++ b/sfx2/source/inc/helpid.hrc @@ -346,8 +346,9 @@ #define HID_TP_CUSTOMPROPERTIES (HID_SFX_START + 324) #define HID_CTRL_CUSTOMPROPERTIES (HID_SFX_START + 325) #define HID_CTRL_CUSTOMPROPS_YES_NO (HID_SFX_START + 326) +#define HID_DLG_CUSTOMPROPS_DURATION (HID_SFX_START + 327) -#define ACT_SFX_HID_END HID_CTRL_CUSTOMPROPS_YES_NO +#define ACT_SFX_HID_END HID_DLG_CUSTOMPROPS_DURATION // "Uberlaufpr"ufung -------------------------------------------------------- diff --git a/sfx2/source/inc/iframe.hxx b/sfx2/source/inc/iframe.hxx index bec875659e28..9abfd70ab663 100644 --- a/sfx2/source/inc/iframe.hxx +++ b/sfx2/source/inc/iframe.hxx @@ -45,8 +45,8 @@ #include <cppuhelper/implbase6.hxx> #include <rtl/ustring.hxx> -#include <svtools/ownlist.hxx> -#include <svtools/itemprop.hxx> +#include <svl/ownlist.hxx> +#include <svl/itemprop.hxx> #include <sfx2/sfxuno.hxx> #include <sfx2/frmdescr.hxx> diff --git a/sfx2/source/inc/objshimp.hxx b/sfx2/source/inc/objshimp.hxx index 77162423cabe..fed465c69986 100644 --- a/sfx2/source/inc/objshimp.hxx +++ b/sfx2/source/inc/objshimp.hxx @@ -38,7 +38,7 @@ #include <com/sun/star/logging/XSimpleLogRing.hpp> #include <tools/datetime.hxx> -#include <svtools/securityoptions.hxx> +#include <unotools/securityoptions.hxx> #include <sfx2/objsh.hxx> #include "sfx2/docmacromode.hxx" #include "bitset.hxx" diff --git a/sfx2/source/inc/plugin.hxx b/sfx2/source/inc/plugin.hxx index bba36717a946..f258ca720b15 100644 --- a/sfx2/source/inc/plugin.hxx +++ b/sfx2/source/inc/plugin.hxx @@ -45,8 +45,8 @@ #include <cppuhelper/implbase5.hxx> #include <rtl/ustring.hxx> -#include <svtools/ownlist.hxx> -#include <svtools/itemprop.hxx> +#include <svl/ownlist.hxx> +#include <svl/itemprop.hxx> #include <sfx2/sfxuno.hxx> diff --git a/sfx2/source/inc/sfxlocal.hrc b/sfx2/source/inc/sfxlocal.hrc index 2ad3670ab014..bc7d267d75d8 100644 --- a/sfx2/source/inc/sfxlocal.hrc +++ b/sfx2/source/inc/sfxlocal.hrc @@ -60,6 +60,11 @@ #define SFX_QB_WRONG_TYPE (RID_SFX_SFXLOCAL_START + 7) #define SFX_IMG_PROPERTY_REMOVE (RID_SFX_SFXLOCAL_START + 8) #define SFX_IMG_PROPERTY_REMOVE_HC (RID_SFX_SFXLOCAL_START + 9) +#define SFX_FLD_DATE (RID_SFX_SFXLOCAL_START + 10) +#define SFX_FLD_TIME (RID_SFX_SFXLOCAL_START + 11) +#define SFX_FLD_DURATION (RID_SFX_SFXLOCAL_START + 12) +#define SFX_ST_DURATION_FORMAT (RID_SFX_SFXLOCAL_START + 13) + #endif diff --git a/sfx2/source/inc/sfxpicklist.hxx b/sfx2/source/inc/sfxpicklist.hxx index 541fad8c3c2e..6e502bd9d7ad 100644 --- a/sfx2/source/inc/sfxpicklist.hxx +++ b/sfx2/source/inc/sfxpicklist.hxx @@ -34,7 +34,7 @@ #include <osl/mutex.hxx> #include <tools/string.hxx> #include <vcl/menu.hxx> -#include <svtools/lstner.hxx> +#include <svl/lstner.hxx> #include <com/sun/star/util/XStringWidth.hpp> #include <vector> diff --git a/sfx2/source/inc/templdgi.hxx b/sfx2/source/inc/templdgi.hxx index c1ffb7a79a0a..b4ea96c1ed4e 100644 --- a/sfx2/source/inc/templdgi.hxx +++ b/sfx2/source/inc/templdgi.hxx @@ -41,12 +41,12 @@ class SfxTemplateControllerItem; #ifndef _LSTBOX_HXX //autogen #include <vcl/lstbox.hxx> #endif -#include <svtools/lstner.hxx> +#include <svl/lstner.hxx> #include <svtools/svtreebx.hxx> -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #define _SVSTDARR_USHORTS -#include <svtools/svstdarr.hxx> // SvUShorts +#include <svl/svstdarr.hxx> // SvUShorts #include <rsc/rscsfx.hxx> #include <tools/rtti.hxx> diff --git a/sfx2/source/inc/virtmenu.hxx b/sfx2/source/inc/virtmenu.hxx index f3c466343205..aecb2c0cf4cb 100644 --- a/sfx2/source/inc/virtmenu.hxx +++ b/sfx2/source/inc/virtmenu.hxx @@ -32,7 +32,7 @@ #define _SFXVIRTMENU_HXX -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include <sfx2/mnuitem.hxx> #include "mnucfga.hxx" diff --git a/sfx2/source/inc/workwin.hxx b/sfx2/source/inc/workwin.hxx index a8d84187691e..59b9d29c479d 100644 --- a/sfx2/source/inc/workwin.hxx +++ b/sfx2/source/inc/workwin.hxx @@ -42,7 +42,7 @@ #include <cppuhelper/propshlp.hxx> #define _SVSTDARR_USHORTS -#include <svtools/svstdarr.hxx> // SvUShorts +#include <svl/svstdarr.hxx> // SvUShorts #include <rtl/ustring.hxx> #include <vos/mutex.hxx> diff --git a/sfx2/source/inet/inettbc.cxx b/sfx2/source/inet/inettbc.cxx index d6ce65c96b6d..de399eaaa956 100644 --- a/sfx2/source/inet/inettbc.cxx +++ b/sfx2/source/inet/inettbc.cxx @@ -40,11 +40,11 @@ #include <com/sun/star/frame/XFramesSupplier.hpp> #endif #include <com/sun/star/task/XInteractionHandler.hpp> -#include <svtools/eitem.hxx> -#include <svtools/stritem.hxx> -#include <svtools/cancel.hxx> -#include <svtools/historyoptions.hxx> -#include <svtools/folderrestriction.hxx> +#include <svl/eitem.hxx> +#include <svl/stritem.hxx> +#include <svl/cancel.hxx> +#include <unotools/historyoptions.hxx> +#include <svl/folderrestriction.hxx> #include <vcl/toolbox.hxx> #ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_ #include <toolkit/unohlp.hxx> @@ -57,9 +57,9 @@ #endif #include <rtl/ustring.hxx> -#include <svtools/itemset.hxx> -#include <svtools/urihelper.hxx> -#include <svtools/pathoptions.hxx> +#include <svl/itemset.hxx> +#include <svl/urihelper.hxx> +#include <unotools/pathoptions.hxx> #include <svtools/asynclink.hxx> #include <svtools/inettbc.hxx> diff --git a/sfx2/source/layout/sfxtabdialog.cxx b/sfx2/source/layout/sfxtabdialog.cxx index a6d592bf48d5..92454ae62f36 100644 --- a/sfx2/source/layout/sfxtabdialog.cxx +++ b/sfx2/source/layout/sfxtabdialog.cxx @@ -34,10 +34,10 @@ #include <limits.h> #include <stdlib.h> #include <vcl/msgbox.hxx> -#include <svtools/viewoptions.hxx> +#include <unotools/viewoptions.hxx> #define _SVSTDARR_USHORTS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include "appdata.hxx" #include "sfxtypes.hxx" diff --git a/sfx2/source/menu/mnuitem.cxx b/sfx2/source/menu/mnuitem.cxx index 988bbf3b4118..0e80cc207ce0 100644 --- a/sfx2/source/menu/mnuitem.cxx +++ b/sfx2/source/menu/mnuitem.cxx @@ -51,8 +51,8 @@ #include <comphelper/processfactory.hxx> #endif #include <tools/urlobj.hxx> -#include <svtools/eitem.hxx> -#include <svtools/stritem.hxx> +#include <svl/eitem.hxx> +#include <svl/stritem.hxx> #include <svtools/imagemgr.hxx> #include <svtools/menuoptions.hxx> #include <framework/menuconfiguration.hxx> @@ -451,7 +451,7 @@ 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.GetMenuColor().IsDark(); + m_bWasHiContrastMode = rSettings.GetHighContrastMode(); m_bShowMenuImages = rSettings.GetUseImagesInMenus(); Reference<com::sun::star::lang::XMultiServiceFactory> aXMultiServiceFactory(::comphelper::getProcessServiceFactory()); @@ -477,7 +477,7 @@ IMPL_LINK( SfxAppMenuControl_Impl, Activate, Menu *, pActMenu ) { const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); ULONG nSymbolsStyle = rSettings.GetSymbolsStyle(); - BOOL bIsHiContrastMode = rSettings.GetMenuColor().IsDark(); + BOOL bIsHiContrastMode = rSettings.GetHighContrastMode(); BOOL bShowMenuImages = rSettings.GetUseImagesInMenus(); if (( nSymbolsStyle != m_nSymbolsStyle ) || @@ -542,6 +542,13 @@ SfxUnoMenuControl* SfxMenuControl::CreateControl( const String& rCmd, return new SfxUnoMenuControl( rCmd, nId, rMenu, rBindings, pVirt ); } +SfxUnoMenuControl* SfxMenuControl::CreateControl( const String& rCmd, + USHORT nId, Menu& rMenu, const String& sItemText, const String& sHelpText, + SfxBindings& rBindings, SfxVirtualMenu* pVirt) +{ + return new SfxUnoMenuControl( rCmd, nId, rMenu, sItemText, sHelpText, rBindings, pVirt); +} + SfxUnoMenuControl::SfxUnoMenuControl( const String& rCmd, USHORT nSlotId, Menu& rMenu, SfxBindings& rBindings, SfxVirtualMenu* pVirt ) : SfxMenuControl( nSlotId, rBindings ) @@ -554,6 +561,19 @@ SfxUnoMenuControl::SfxUnoMenuControl( const String& rCmd, USHORT nSlotId, pUnoCtrl->GetNewDispatch(); } +SfxUnoMenuControl::SfxUnoMenuControl( + const String& rCmd, USHORT nSlotId, Menu& /*rMenu*/, + const String& rItemText, const String& rHelpText, + SfxBindings& rBindings, SfxVirtualMenu* pVirt) + : SfxMenuControl( nSlotId, rBindings ) +{ + Bind( pVirt, nSlotId, rItemText, rHelpText, rBindings); + UnBind(); + pUnoCtrl = new SfxUnoControllerItem( this, rBindings, rCmd ); + pUnoCtrl->acquire(); + pUnoCtrl->GetNewDispatch(); +} + SfxUnoMenuControl::~SfxUnoMenuControl() { pUnoCtrl->UnBind(); diff --git a/sfx2/source/menu/mnumgr.cxx b/sfx2/source/menu/mnumgr.cxx index f0bb48b54261..076932ba9dea 100644 --- a/sfx2/source/menu/mnumgr.cxx +++ b/sfx2/source/menu/mnumgr.cxx @@ -54,13 +54,13 @@ #include <comphelper/processfactory.hxx> #include <unotools/ucbstreamhelper.hxx> #include <tools/urlobj.hxx> -#include <svtools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <sfx2/mnumgr.hxx> #define _SVSTDARR_USHORTS -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #include <svtools/menuoptions.hxx> #include "virtmenu.hxx" diff --git a/sfx2/source/menu/objmnctl.cxx b/sfx2/source/menu/objmnctl.cxx index ba27fdcd797d..3d88009e7c0e 100644 --- a/sfx2/source/menu/objmnctl.cxx +++ b/sfx2/source/menu/objmnctl.cxx @@ -38,7 +38,7 @@ #include <vcl/menu.hxx> #endif #ifndef _SXSTRITEM_HXX //autogen -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #endif #ifndef GCC #endif diff --git a/sfx2/source/menu/virtmenu.cxx b/sfx2/source/menu/virtmenu.cxx index 88c9ba8aa757..87f35805d1e7 100644 --- a/sfx2/source/menu/virtmenu.cxx +++ b/sfx2/source/menu/virtmenu.cxx @@ -34,7 +34,7 @@ #include <sot/factory.hxx> #include <svtools/menuoptions.hxx> #include <svtools/imagemgr.hxx> -#include <svtools/imageitm.hxx> +#include <svl/imageitm.hxx> #include <com/sun/star/container/XEnumeration.hpp> #include <com/sun/star/frame/XDesktop.hpp> #include <com/sun/star/frame/XFramesSupplier.hpp> @@ -284,7 +284,7 @@ SfxVirtualMenu::~SfxVirtualMenu() DBG_DTOR(SfxVirtualMenu, 0); DELETEZ( pImageControl ); - SvtMenuOptions().RemoveListener( LINK( this, SfxVirtualMenu, SettingsChanged ) ); + SvtMenuOptions().RemoveListenerLink( LINK( this, SfxVirtualMenu, SettingsChanged ) ); if ( bIsActive ) { @@ -336,11 +336,7 @@ SfxVirtualMenu::~SfxVirtualMenu() BOOL SfxVirtualMenu::IsHiContrastMode() const { const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); - Color aMenuColor = rSettings.GetMenuColor(); - if ( aMenuColor.IsDark() ) - return TRUE; - else - return FALSE; + return rSettings.GetHighContrastMode(); } //-------------------------------------------------------------------- @@ -400,7 +396,7 @@ void SfxVirtualMenu::CreateFromSVMenu() const int bOleServer = FALSE; const int bMac = FALSE; SvtMenuOptions aOptions; - aOptions.AddListener( LINK( this, SfxVirtualMenu, SettingsChanged ) ); + aOptions.AddListenerLink( LINK( this, SfxVirtualMenu, SettingsChanged ) ); // iterate through the items pBindings->ENTERREGISTRATIONS(); ++nLocks; @@ -421,8 +417,12 @@ void SfxVirtualMenu::CreateFromSVMenu() DELETEZ( pPopup ); } + const String sItemText = pSVMenu->GetItemText(nSlotId); + const String sHelpText = pSVMenu->GetHelpText(nSlotId); + if ( pPopup ) { + SfxMenuControl *pMnuCtrl = SfxMenuControl::CreateControl(nSlotId, *pPopup, *pBindings); @@ -438,10 +438,8 @@ void SfxVirtualMenu::CreateFromSVMenu() SfxMenuCtrlArr_Impl &rCtrlArr = GetAppCtrl_Impl(); rCtrlArr.C40_INSERT( SfxMenuControl, pMnuCtrl, rCtrlArr.Count() ); - (pItems+nPos)->Bind( 0, nSlotId, pSVMenu->GetItemText(nSlotId), - pSVMenu->GetHelpText(nSlotId), *pBindings); - pMnuCtrl->Bind( this, nSlotId, pSVMenu->GetItemText(nSlotId), - pSVMenu->GetHelpText(nSlotId), *pBindings); + (pItems+nPos)->Bind( 0, nSlotId, sItemText, sHelpText, *pBindings); + pMnuCtrl->Bind( this, nSlotId, sItemText, sHelpText, *pBindings); if ( Application::GetSettings().GetStyleSettings().GetUseImagesInMenus() ) { @@ -477,7 +475,7 @@ void SfxVirtualMenu::CreateFromSVMenu() { pMnuCtrl->Bind( this, nSlotId, *new SfxVirtualMenu(nSlotId, this, *pPopup, bHelpInitialized, *pBindings, bOLE, bResCtor), - pSVMenu->GetItemText(nSlotId), pSVMenu->GetHelpText(nSlotId), + sItemText, sHelpText, *pBindings ); } } @@ -514,12 +512,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, *pBindings, this ); + pMnuCtrl = SfxMenuControl::CreateControl( aCmd, nSlotId, *pSVMenu, sItemText, sHelpText, *pBindings, this ); if ( pMnuCtrl ) { SfxMenuCtrlArr_Impl &rCtrlArr = GetAppCtrl_Impl(); rCtrlArr.C40_INSERT( SfxMenuControl, pMnuCtrl, rCtrlArr.Count()); - (pItems+nPos)->Bind( 0, nSlotId, pSVMenu->GetItemText(nSlotId), pSVMenu->GetHelpText(nSlotId), *pBindings); + (pItems+nPos)->Bind( 0, nSlotId, sItemText, sHelpText, *pBindings); } } @@ -531,13 +529,13 @@ void SfxVirtualMenu::CreateFromSVMenu() { SfxMenuCtrlArr_Impl &rCtrlArr = GetAppCtrl_Impl(); rCtrlArr.C40_INSERT( SfxMenuControl, pMnuCtrl, rCtrlArr.Count()); - (pItems+nPos)->Bind( 0, nSlotId, pSVMenu->GetItemText(nSlotId), pSVMenu->GetHelpText(nSlotId), *pBindings); + (pItems+nPos)->Bind( 0, nSlotId, sItemText, sHelpText, *pBindings); } else // take default control pMnuCtrl = (pItems+nPos); - pMnuCtrl->Bind( this, nSlotId, pSVMenu->GetItemText(nSlotId), pSVMenu->GetHelpText(nSlotId), *pBindings); + pMnuCtrl->Bind( this, nSlotId, sItemText, sHelpText, *pBindings); } if ( Application::GetSettings().GetStyleSettings().GetUseImagesInMenus() ) diff --git a/sfx2/source/notify/eventsupplier.cxx b/sfx2/source/notify/eventsupplier.cxx index a01b1df73c82..ec542c4af595 100644 --- a/sfx2/source/notify/eventsupplier.cxx +++ b/sfx2/source/notify/eventsupplier.cxx @@ -42,14 +42,14 @@ #include <com/sun/star/util/XURLTransformer.hpp> #endif #include <tools/urlobj.hxx> -#include <svtools/macitem.hxx> +#include <svl/macitem.hxx> #include <sfx2/appuno.hxx> #include <sfx2/objsh.hxx> #include <sfx2/sfxbasemodel.hxx> #include <sfx2/evntconf.hxx> -#include <svtools/eventcfg.hxx> +#include <unotools/eventcfg.hxx> -#include <svtools/securityoptions.hxx> +#include <unotools/securityoptions.hxx> #include <comphelper/processfactory.hxx> #include "eventsupplier.hxx" diff --git a/sfx2/source/statbar/stbitem.cxx b/sfx2/source/statbar/stbitem.cxx index 503995d97b30..df463ac92396 100644 --- a/sfx2/source/statbar/stbitem.cxx +++ b/sfx2/source/statbar/stbitem.cxx @@ -30,7 +30,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #ifndef GCC #endif #include <com/sun/star/util/URL.hpp> @@ -57,9 +57,9 @@ #include <sfx2/sfx.hrc> #include <comphelper/processfactory.hxx> -#include <svtools/eitem.hxx> -#include <svtools/stritem.hxx> -#include <svtools/intitem.hxx> +#include <svl/eitem.hxx> +#include <svl/stritem.hxx> +#include <svl/intitem.hxx> #ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_ #include <toolkit/unohlp.hxx> #endif diff --git a/sfx2/source/toolbox/imgmgr.cxx b/sfx2/source/toolbox/imgmgr.cxx index 6f00ae5b7681..eb9305fc0e49 100644 --- a/sfx2/source/toolbox/imgmgr.cxx +++ b/sfx2/source/toolbox/imgmgr.cxx @@ -171,7 +171,7 @@ SfxImageManager_Impl::SfxImageManager_Impl( SfxModule* pModule ) : for ( sal_uInt32 i = 0; i < IMAGELIST_COUNT; i++ ) m_pImageList[i] = 0; - m_aOpt.AddListener( LINK( this, SfxImageManager_Impl, OptionsChanged_Impl ) ); + m_aOpt.AddListenerLink( LINK( this, SfxImageManager_Impl, OptionsChanged_Impl ) ); Application::AddEventListener( LINK( this, SfxImageManager_Impl, SettingsChanged_Impl ) ); } @@ -179,7 +179,7 @@ SfxImageManager_Impl::SfxImageManager_Impl( SfxModule* pModule ) : SfxImageManager_Impl::~SfxImageManager_Impl() { - m_aOpt.RemoveListener( LINK( this, SfxImageManager_Impl, OptionsChanged_Impl ) ); + m_aOpt.RemoveListenerLink( LINK( this, SfxImageManager_Impl, OptionsChanged_Impl ) ); Application::RemoveEventListener( LINK( this, SfxImageManager_Impl, SettingsChanged_Impl ) ); for ( sal_uInt32 i = 0; i < m_aToolBoxes.size(); i++ ) @@ -229,7 +229,7 @@ void SfxImageManager_Impl::SetSymbolsSize_Impl( sal_Int16 nNewSymbolsSize ) if ( pInf->nFlags & SFX_TOOLBOX_CHANGESYMBOLSET ) { ToolBox *pBox = pInf->pToolBox; - BOOL bHiContrast = pBox->GetBackground().GetColor().IsDark(); + BOOL bHiContrast = pBox->GetSettings().GetStyleSettings().GetHighContrastMode(); USHORT nCount = pBox->GetItemCount(); for ( USHORT nPos=0; nPos<nCount; nPos++ ) { @@ -424,6 +424,6 @@ void SfxImageManager::SetImagesForceSize( ToolBox& rToolBox, BOOL bHiContrast, B void SfxImageManager::SetImages( ToolBox& rToolBox ) { BOOL bLarge = ( pImp->m_nSymbolsSize == SFX_SYMBOLS_SIZE_LARGE ); - BOOL bHiContrast = rToolBox.GetBackground().GetColor().IsDark(); + BOOL bHiContrast = rToolBox.GetSettings().GetStyleSettings().GetHighContrastMode(); SetImagesForceSize( rToolBox, bHiContrast, bLarge ); } diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx index 6a776f6a211e..29e6b85d67d2 100644 --- a/sfx2/source/toolbox/tbxitem.cxx +++ b/sfx2/source/toolbox/tbxitem.cxx @@ -58,14 +58,14 @@ #include <com/sun/star/ui/XUIFunctionListener.hpp> #include <com/sun/star/frame/status/Visibility.hpp> #include <com/sun/star/document/CorruptedFilterConfigurationException.hpp> -#include <svtools/eitem.hxx> -#include <svtools/stritem.hxx> -#include <svtools/intitem.hxx> -#include <svtools/imageitm.hxx> -#include <svtools/visitem.hxx> -#include <svtools/urlbmk.hxx> +#include <svl/eitem.hxx> +#include <svl/stritem.hxx> +#include <svl/intitem.hxx> +#include <svl/imageitm.hxx> +#include <svl/visitem.hxx> +#include <svl/urlbmk.hxx> #include <vcl/toolbox.hxx> -#include <svtools/moduleoptions.hxx> +#include <unotools/moduleoptions.hxx> #include <svtools/imagemgr.hxx> #include <comphelper/processfactory.hxx> @@ -1529,7 +1529,7 @@ SfxAppToolBoxControl_Impl::SfxAppToolBoxControl_Impl( USHORT nSlotId, USHORT nId // Determine the current background color of the menus const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); m_nSymbolsStyle = rSettings.GetSymbolsStyle(); - m_bWasHiContrastMode = rSettings.GetMenuColor().IsDark(); + m_bWasHiContrastMode = rSettings.GetHighContrastMode(); m_bShowMenuImages = rSettings.GetUseImagesInMenus(); SetImage( String() ); @@ -1654,7 +1654,7 @@ void SfxAppToolBoxControl_Impl::SetImage( const String &rURL ) aURL = sFallback; BOOL bBig = SvtMiscOptions().AreCurrentSymbolsLarge(); - BOOL bHC = GetToolBox().GetBackground().GetColor().IsDark(); + BOOL bHC = GetToolBox().GetSettings().GetStyleSettings().GetHighContrastMode(); Image aImage = SvFileInformationManager::GetImageNoDefault( INetURLObject( aURL ), bBig, bHC ); if ( !aImage ) aImage = !!aMenuImage ? aMenuImage : @@ -1805,7 +1805,7 @@ IMPL_LINK( SfxAppToolBoxControl_Impl, Activate, Menu *, pActMenu ) { const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); ULONG nSymbolsStyle = rSettings.GetSymbolsStyle(); - BOOL bIsHiContrastMode = rSettings.GetMenuColor().IsDark(); + BOOL bIsHiContrastMode = rSettings.GetHighContrastMode(); BOOL bShowMenuImages = rSettings.GetUseImagesInMenus(); if (( nSymbolsStyle != m_nSymbolsStyle ) || diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx index 42e9a1d04cb6..c88297e477f7 100644 --- a/sfx2/source/view/frame.cxx +++ b/sfx2/source/view/frame.cxx @@ -43,12 +43,12 @@ #ifndef _MENU_HXX //autogen #include <vcl/menu.hxx> #endif -#include <svtools/intitem.hxx> +#include <svl/intitem.hxx> #ifndef _SPLITWIN_HXX //autogen #include <vcl/splitwin.hxx> #endif -#include <svtools/eitem.hxx> -#include <svtools/stritem.hxx> +#include <svl/eitem.hxx> +#include <svl/stritem.hxx> #ifndef _TOOLKIT_UNOHLP_HXX #include <toolkit/helper/vclunohelper.hxx> #endif diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index b91e1e6b4998..b439dca4ffed 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -62,10 +62,10 @@ #include <rtl/ustring.h> #include <rtl/logfile.hxx> -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> #include <vcl/window.hxx> -#include <svtools/eitem.hxx> -#include <svtools/stritem.hxx> +#include <svl/eitem.hxx> +#include <svl/stritem.hxx> #include <tools/urlobj.hxx> #include <vos/mutex.hxx> #include <svtools/sfxecode.hxx> @@ -73,7 +73,7 @@ #include <sot/storinfo.hxx> #include <comphelper/sequenceashashmap.hxx> #include <comphelper/mediadescriptor.hxx> -#include <svtools/moduleoptions.hxx> +#include <unotools/moduleoptions.hxx> #ifndef css namespace css = ::com::sun::star; diff --git a/sfx2/source/view/impframe.cxx b/sfx2/source/view/impframe.cxx index d13beadee9f0..c81b48b20aa2 100644 --- a/sfx2/source/view/impframe.cxx +++ b/sfx2/source/view/impframe.cxx @@ -36,7 +36,7 @@ #include "impframe.hxx" -#include <svtools/smplhint.hxx> +#include <svl/smplhint.hxx> #include <sfx2/frame.hxx> #include <sfx2/bindings.hxx> diff --git a/sfx2/source/view/impframe.hxx b/sfx2/source/view/impframe.hxx index 21215fa6e730..d0b83ad619af 100644 --- a/sfx2/source/view/impframe.hxx +++ b/sfx2/source/view/impframe.hxx @@ -31,7 +31,7 @@ #ifndef _SFX_IMPFRAME_HXX #define _SFX_IMPFRAME_HXX -#include <svtools/cancel.hxx> +#include <svl/cancel.hxx> #include <sfx2/frame.hxx> #include <sfx2/viewfrm.hxx> // SvBorder diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx index a8b57be6714b..3e9989760b11 100644 --- a/sfx2/source/view/ipclient.cxx +++ b/sfx2/source/view/ipclient.cxx @@ -72,7 +72,7 @@ #include <toolkit/helper/convert.hxx> #include <tools/fract.hxx> #include <tools/gen.hxx> -#include <svtools/rectitem.hxx> +#include <svl/rectitem.hxx> #include <svtools/soerr.hxx> #include <comphelper/processfactory.hxx> diff --git a/sfx2/source/view/printer.cxx b/sfx2/source/view/printer.cxx index cffeb65ccca5..2b7f89eac7c4 100644 --- a/sfx2/source/view/printer.cxx +++ b/sfx2/source/view/printer.cxx @@ -34,7 +34,7 @@ #include <vcl/metric.hxx> #include <vcl/msgbox.hxx> #include <svtools/printdlg.hxx> -#include <svtools/printwarningoptions.hxx> +#include <unotools/printwarningoptions.hxx> #include <svtools/printoptions.hxx> #include <vector> diff --git a/sfx2/source/view/prnmon.cxx b/sfx2/source/view/prnmon.cxx index 442004df6ef0..de075647ab48 100644 --- a/sfx2/source/view/prnmon.cxx +++ b/sfx2/source/view/prnmon.cxx @@ -39,8 +39,8 @@ #include <vcl/msgbox.hxx> #include <svtools/asynclink.hxx> -#include <svtools/printwarningoptions.hxx> -#include <svtools/eitem.hxx> +#include <unotools/printwarningoptions.hxx> +#include <svl/eitem.hxx> #ifndef GCC #endif diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index 54ccd29a7dd7..2951ac3ef4a3 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -81,6 +81,7 @@ #include <vos/mutex.hxx> #include <osl/mutex.hxx> +#include <tools/diagnose_ex.h> #include <comphelper/sequence.hxx> #include <rtl/ustrbuf.hxx> #include <toolkit/helper/convert.hxx> @@ -706,6 +707,29 @@ void SAL_CALL SfxBaseController::attachFrame( const REFERENCE< XFRAME >& xFrame SfxViewFrame* pActFrame = m_pData->m_pViewShell->GetFrame() ; pActFrame->Enable( TRUE ); pActFrame->GetDispatcher()->Lock( FALSE ); + + if ( ( m_pData->m_pViewShell->GetObjectShell() != NULL ) + && ( m_pData->m_pViewShell->GetObjectShell()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ) + ) + { + SfxViewFrame* pViewFrm = m_pData->m_pViewShell->GetViewFrame(); + if ( !pViewFrm->GetFrame()->IsInPlace() ) + { + // for outplace embedded objects, we want the layout manager to keep the content window + // size constant, if possible + try + { + uno::Reference< beans::XPropertySet > xFrameProps( m_pData->m_xFrame, uno::UNO_QUERY_THROW ); + uno::Reference< beans::XPropertySet > xLayouterProps( + xFrameProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ) ) ), uno::UNO_QUERY_THROW ); + xLayouterProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PreserveContentSize" ) ), uno::makeAny( sal_True ) ); + } + catch( const uno::Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + } + } } } } diff --git a/sfx2/source/view/topfrm.cxx b/sfx2/source/view/topfrm.cxx index 64bdd3582754..6f5c2ffcc3eb 100644 --- a/sfx2/source/view/topfrm.cxx +++ b/sfx2/source/view/topfrm.cxx @@ -60,15 +60,15 @@ #include <com/sun/star/beans/XMaterialHolder.hpp> #include <com/sun/star/awt/XWindow2.hpp> #include <vcl/menu.hxx> -#include <svtools/rectitem.hxx> -#include <svtools/intitem.hxx> -#include <svtools/eitem.hxx> -#include <svtools/stritem.hxx> +#include <svl/rectitem.hxx> +#include <svl/intitem.hxx> +#include <svl/eitem.hxx> +#include <svl/stritem.hxx> #include <svtools/asynclink.hxx> #include <svtools/sfxecode.hxx> #include <vcl/dialog.hxx> -#include <svtools/urihelper.hxx> -#include <svtools/moduleoptions.hxx> +#include <svl/urihelper.hxx> +#include <unotools/moduleoptions.hxx> #include <unotools/configmgr.hxx> #include <unotools/bootstrap.hxx> @@ -535,7 +535,7 @@ SfxTopFrame* SfxTopFrame::Create( SfxObjectShell* pDoc, USHORT nViewId, BOOL bHi aTitle += String(aProductName); aTitle += ' '; aTitle += String( GetModuleName_Impl( aDocServiceName ) ); -#ifndef PRODUCT +#ifdef DBG_UTIL ::rtl::OUString aDefault; aTitle += DEFINE_CONST_UNICODE(" ["); String aVerId( utl::Bootstrap::getBuildIdData( aDefault )); @@ -1098,7 +1098,7 @@ String SfxTopViewFrame::UpdateTitle() aTitle += ' '; ::rtl::OUString aDocServiceName( GetObjectShell()->GetFactory().GetDocumentServiceName() ); aTitle += String( GetModuleName_Impl( aDocServiceName ) ); -#ifndef PRODUCT +#ifdef DBG_UTIL ::rtl::OUString aDefault; aTitle += DEFINE_CONST_UNICODE(" ["); String aVerId( utl::Bootstrap::getBuildIdData( aDefault )); diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 531afa041bde..ba87f0fc33ca 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -44,13 +44,13 @@ #ifndef _SPLITWIN_HXX //autogen #include <vcl/splitwin.hxx> #endif -#include <svtools/moduleoptions.hxx> -#include <svtools/intitem.hxx> -#include <svtools/stritem.hxx> -#include <svtools/eitem.hxx> -#include <svtools/slstitm.hxx> -#include <svtools/whiter.hxx> -#include <svtools/undo.hxx> +#include <unotools/moduleoptions.hxx> +#include <svl/intitem.hxx> +#include <svl/stritem.hxx> +#include <svl/eitem.hxx> +#include <svl/slstitm.hxx> +#include <svl/whiter.hxx> +#include <svl/undo.hxx> #ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> #endif @@ -90,7 +90,7 @@ #include <basic/sbx.hxx> #include <comphelper/storagehelper.hxx> #include <svtools/asynclink.hxx> -#include <svtools/sharecontrolfile.hxx> +#include <svl/sharecontrolfile.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index c5ca117a3854..c7ede4f7b8a5 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -1,1026 +1,1026 @@ -/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: viewprn.cxx,v $
- * $Revision: 1.36.84.1 $
- *
- * 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 <com/sun/star/document/XDocumentProperties.hpp>
-#include <com/sun/star/view/PrintableState.hpp>
-#include "com/sun/star/view/XRenderable.hpp"
-
-#include <svtools/itempool.hxx>
-#include <vcl/msgbox.hxx>
-#include <svtools/printdlg.hxx>
-#include <svtools/prnsetup.hxx>
-#include <svtools/flagitem.hxx>
-#include <svtools/stritem.hxx>
-#include <svtools/intitem.hxx>
-#include <svtools/eitem.hxx>
-#include <sfx2/app.hxx>
-#include <svtools/useroptions.hxx>
-#include <svtools/printwarningoptions.hxx>
-#include <tools/datetime.hxx>
-#include <sfx2/bindings.hxx>
-#include <sfx2/objface.hxx>
-#include <sfx2/viewsh.hxx>
-#include "viewimp.hxx"
-#include <sfx2/viewfrm.hxx>
-#include <sfx2/prnmon.hxx>
-#include "sfxresid.hxx"
-#include <sfx2/request.hxx>
-#include <sfx2/objsh.hxx>
-#include "sfxtypes.hxx"
-#include <sfx2/event.hxx>
-#include <sfx2/docfile.hxx>
-#include <sfx2/docfilt.hxx>
-
-#include "toolkit/awt/vclxdevice.hxx"
-
-#include "view.hrc"
-#include "helpid.hrc"
-
-using namespace com::sun::star;
-using namespace com::sun::star::uno;
-
-TYPEINIT1(SfxPrintingHint, SfxHint);
-
-// -----------------------------------------------------------------------
-class SfxPrinterController : public vcl::PrinterController, public SfxListener
-{
- Any maCompleteSelection;
- Any maSelection;
- Reference< view::XRenderable > mxRenderable;
- mutable Printer* mpLastPrinter;
- mutable Reference<awt::XDevice> mxDevice;
- SfxViewShell* mpViewShell;
- SfxObjectShell* mpObjectShell;
- sal_Bool m_bOrigStatus;
- sal_Bool m_bNeedsChange;
- sal_Bool m_bApi;
- util::DateTime m_aLastPrinted;
- ::rtl::OUString m_aLastPrintedBy;
-
- Sequence< beans::PropertyValue > getMergedOptions() const;
- const Any& getSelectionObject() const;
-public:
- SfxPrinterController( const Any& i_rComplete,
- const Any& i_rSelection,
- const Any& i_rViewProp,
- const Reference< view::XRenderable >& i_xRender,
- sal_Bool i_bApi, sal_Bool i_bDirect,
- SfxViewShell* pView,
- const uno::Sequence< beans::PropertyValue >& rProps
- );
-
- virtual ~SfxPrinterController();
- virtual void Notify( SfxBroadcaster&, const SfxHint& );
-
- virtual int getPageCount() const;
- virtual Sequence< beans::PropertyValue > getPageParameters( int i_nPage ) const;
- virtual void printPage( int i_nPage ) const;
- virtual void jobStarted();
- virtual void jobFinished( com::sun::star::view::PrintableState );
-};
-
-SfxPrinterController::SfxPrinterController( const Any& i_rComplete,
- const Any& i_rSelection,
- const Any& i_rViewProp,
- const Reference< view::XRenderable >& i_xRender,
- sal_Bool i_bApi, sal_Bool i_bDirect,
- SfxViewShell* pView,
- const uno::Sequence< beans::PropertyValue >& rProps
- )
- : maCompleteSelection( i_rComplete )
- , maSelection( i_rSelection )
- , mxRenderable( i_xRender )
- , mpLastPrinter( NULL )
- , mpViewShell( pView )
- , mpObjectShell(0)
- , m_bOrigStatus( sal_False )
- , m_bNeedsChange( sal_False )
- , m_bApi(i_bApi)
-{
- if ( mpViewShell )
- {
- StartListening( *mpViewShell );
- mpObjectShell = mpViewShell->GetObjectShell();
- StartListening( *mpObjectShell );
- m_bOrigStatus = mpObjectShell->IsEnableSetModified();
-
- // check configuration: shall update of printing information in DocInfo set the document to "modified"?
- if ( m_bOrigStatus && !SvtPrintWarningOptions().IsModifyDocumentOnPrintingAllowed() )
- {
- mpObjectShell->EnableSetModified( sal_False );
- m_bNeedsChange = sal_True;
- }
-
- // refresh document info
- uno::Reference<document::XDocumentProperties> xDocProps(mpObjectShell->getDocProperties());
- m_aLastPrintedBy = xDocProps->getPrintedBy();
- m_aLastPrinted = xDocProps->getPrintDate();
-
- xDocProps->setPrintedBy( mpObjectShell->IsUseUserData()
- ? ::rtl::OUString( SvtUserOptions().GetFullName() )
- : ::rtl::OUString() );
- ::DateTime now;
-
- xDocProps->setPrintDate( util::DateTime(
- now.Get100Sec(), now.GetSec(), now.GetMin(), now.GetHour(),
- now.GetDay(), now.GetMonth(), now.GetYear() ) );
- }
-
- // initialize extra ui options
- if( mxRenderable.is() )
- {
- for (sal_Int32 nProp=0; nProp<rProps.getLength(); nProp++)
- setValue( rProps[nProp].Name, rProps[nProp].Value );
-
- Sequence< beans::PropertyValue > aRenderOptions( 3 );
- aRenderOptions[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ExtraPrintUIOptions" ) );
- aRenderOptions[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "View" ) );
- aRenderOptions[1].Value = i_rViewProp;
- aRenderOptions[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsPrinter" ) );
- aRenderOptions[2].Value <<= sal_True;
- Sequence< beans::PropertyValue > aRenderParms( mxRenderable->getRenderer( 0 , getSelectionObject(), aRenderOptions ) );
- int nProps = aRenderParms.getLength();
- for( int i = 0; i < nProps; i++ )
- {
- if( aRenderParms[i].Name.equalsAscii( "ExtraPrintUIOptions" ) )
- {
- Sequence< beans::PropertyValue > aUIProps;
- aRenderParms[i].Value >>= aUIProps;
- setUIOptions( aUIProps );
- break;
- }
- }
- }
-
- // set some job parameters
- setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsApi" ) ), makeAny( i_bApi ) );
- setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsDirect" ) ), makeAny( i_bDirect ) );
- setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsPrinter" ) ), makeAny( sal_True ) );
- setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "View" ) ), i_rViewProp );
-}
-
-void SfxPrinterController::Notify( SfxBroadcaster& , const SfxHint& rHint )
-{
- if ( rHint.IsA(TYPE(SfxSimpleHint)) )
- {
- if ( ((SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
- {
- EndListening(*mpViewShell);
- EndListening(*mpObjectShell);
- mpViewShell = 0;
- mpObjectShell = 0;
- }
- }
-}
-
-SfxPrinterController::~SfxPrinterController()
-{
-}
-
-const Any& SfxPrinterController::getSelectionObject() const
-{
- sal_Int32 nChoice = 0;
- sal_Bool bSel = sal_False;
- const beans::PropertyValue* pVal = getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintContent" ) ) );
- if( pVal )
- pVal->Value >>= nChoice;
- pVal = getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintSelectionOnly" ) ) );
- if( pVal )
- pVal->Value >>= bSel;
- return (nChoice > 1 || bSel) ? maSelection : maCompleteSelection;
-}
-
-Sequence< beans::PropertyValue > SfxPrinterController::getMergedOptions() const
-{
- boost::shared_ptr<Printer> pPrinter( getPrinter() );
- if( pPrinter.get() != mpLastPrinter )
- {
- mpLastPrinter = pPrinter.get();
- VCLXDevice* pXDevice = new VCLXDevice();
- pXDevice->SetOutputDevice( mpLastPrinter );
- mxDevice = Reference< awt::XDevice >( pXDevice );
- }
-
- Sequence< beans::PropertyValue > aRenderOptions( 1 );
- aRenderOptions[ 0 ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RenderDevice" ) );
- aRenderOptions[ 0 ].Value <<= mxDevice;
-
- aRenderOptions = getJobProperties( aRenderOptions );
- return aRenderOptions;
-}
-
-int SfxPrinterController::getPageCount() const
-{
- int nPages = 0;
- boost::shared_ptr<Printer> pPrinter( getPrinter() );
- if( mxRenderable.is() && pPrinter )
- {
- Sequence< beans::PropertyValue > aJobOptions( getMergedOptions() );
- nPages = mxRenderable->getRendererCount( getSelectionObject(), aJobOptions );
- }
- return nPages;
-}
-
-Sequence< beans::PropertyValue > SfxPrinterController::getPageParameters( int i_nPage ) const
-{
- boost::shared_ptr<Printer> pPrinter( getPrinter() );
- Sequence< beans::PropertyValue > aResult;
-
- if( mxRenderable.is() && pPrinter )
- {
- Sequence< beans::PropertyValue > aJobOptions( getMergedOptions() );
- aResult = mxRenderable->getRenderer( i_nPage, getSelectionObject(), aJobOptions );
- }
- return aResult;
-}
-
-void SfxPrinterController::printPage( int i_nPage ) const
-{
- boost::shared_ptr<Printer> pPrinter( getPrinter() );
- if( mxRenderable.is() && pPrinter )
- {
- Sequence< beans::PropertyValue > aJobOptions( getMergedOptions() );
- try
- {
- mxRenderable->render( i_nPage, getSelectionObject(), aJobOptions );
- }
- catch( lang::IllegalArgumentException& )
- {
- // don't care enough about nonexistant page here
- // to provoke a crash
- }
- }
-}
-
-void SfxPrinterController::jobStarted()
-{
- if ( mpObjectShell )
- {
- // FIXME: how to get all print options incl. AdditionalOptions easily?
- uno::Sequence < beans::PropertyValue > aOpts;
- mpObjectShell->Broadcast( SfxPrintingHint( view::PrintableState_JOB_STARTED, aOpts ) );
- }
-}
-
-void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nState )
-{
- if ( mpObjectShell )
- {
- mpObjectShell->Broadcast( SfxPrintingHint( nState ) );
- switch ( nState )
- {
- case view::PrintableState_JOB_FAILED :
- {
- // "real" problem (not simply printing cancelled by user)
- String aMsg( SfxResId( STR_NOSTARTPRINTER ) );
- if ( !m_bApi )
- ErrorBox( mpViewShell->GetWindow(), WB_OK | WB_DEF_OK, aMsg ).Execute();
- // intentionally no break
- }
- case view::PrintableState_JOB_ABORTED :
- {
- // printing not succesful, reset DocInfo
- uno::Reference<document::XDocumentProperties> xDocProps(mpObjectShell->getDocProperties());
- xDocProps->setPrintedBy(m_aLastPrintedBy);
- xDocProps->setPrintDate(m_aLastPrinted);
- break;
- }
-
- case view::PrintableState_JOB_SPOOLED :
- case view::PrintableState_JOB_COMPLETED :
- {
- SfxBindings& rBind = mpViewShell->GetViewFrame()->GetBindings();
- rBind.Invalidate( SID_PRINTDOC );
- rBind.Invalidate( SID_PRINTDOCDIRECT );
- rBind.Invalidate( SID_SETUPPRINTER );
- break;
- }
-
- default:
- break;
- }
-
- if ( m_bNeedsChange )
- mpObjectShell->EnableSetModified( m_bOrigStatus );
- }
-}
-
-// -----------------------------------------------------------------------
-
-void DisableRanges( PrintDialog& rDlg, SfxPrinter* pPrinter )
-
-/* [Beschreibung]
-
- Mit dieser Funktion werden die nicht verf"ugbaren Ranges
- vom Printer zum PrintDialog geforwarded.
-*/
-
-{
- if ( !pPrinter )
- return;
-
- if ( !pPrinter->IsRangeEnabled( PRINTDIALOG_ALL ) )
- rDlg.DisableRange( PRINTDIALOG_ALL );
- if ( !pPrinter->IsRangeEnabled( PRINTDIALOG_SELECTION ) )
- rDlg.DisableRange( PRINTDIALOG_SELECTION );
- if ( !pPrinter->IsRangeEnabled( PRINTDIALOG_FROMTO ) )
- rDlg.DisableRange( PRINTDIALOG_FROMTO );
- if ( !pPrinter->IsRangeEnabled( PRINTDIALOG_RANGE ) )
- rDlg.DisableRange( PRINTDIALOG_RANGE );
-}
-
-//====================================================================
-
-class SfxDialogExecutor_Impl
-
-/* [Beschreibung]
-
- Eine Instanz dieser Klasse wird f"ur die Laufzeit des Printer-Dialogs
- erzeugt, um im dessen Click-Handler f"ur die Zus"atze den per
- virtueller Methode von der abgeleiteten SfxViewShell erzeugten
- Print-Options-Dialog zu erzeugen und die dort eingestellten Optionen
- als SfxItemSet zu zwischenzuspeichern.
-*/
-
-{
-private:
- SfxViewShell* _pViewSh;
- PrintDialog* _pPrintParent;
- PrinterSetupDialog* _pSetupParent;
- SfxItemSet* _pOptions;
- sal_Bool _bModified;
- sal_Bool _bHelpDisabled;
-
- DECL_LINK( Execute, void * );
-
-public:
- SfxDialogExecutor_Impl( SfxViewShell* pViewSh, PrintDialog* pParent );
- SfxDialogExecutor_Impl( SfxViewShell* pViewSh, PrinterSetupDialog* pParent );
- ~SfxDialogExecutor_Impl() { delete _pOptions; }
-
- Link GetLink() const { return LINK( this, SfxDialogExecutor_Impl, Execute); }
- const SfxItemSet* GetOptions() const { return _pOptions; }
- void DisableHelp() { _bHelpDisabled = sal_True; }
-};
-
-//--------------------------------------------------------------------
-
-SfxDialogExecutor_Impl::SfxDialogExecutor_Impl( SfxViewShell* pViewSh, PrintDialog* pParent ) :
-
- _pViewSh ( pViewSh ),
- _pPrintParent ( pParent ),
- _pSetupParent ( NULL ),
- _pOptions ( NULL ),
- _bModified ( sal_False ),
- _bHelpDisabled ( sal_False )
-
-{
-}
-
-SfxDialogExecutor_Impl::SfxDialogExecutor_Impl( SfxViewShell* pViewSh, PrinterSetupDialog* pParent ) :
-
- _pViewSh ( pViewSh ),
- _pPrintParent ( NULL ),
- _pSetupParent ( pParent ),
- _pOptions ( NULL ),
- _bModified ( sal_False ),
- _bHelpDisabled ( sal_False )
-
-{
-}
-
-//--------------------------------------------------------------------
-
-IMPL_LINK( SfxDialogExecutor_Impl, Execute, void *, EMPTYARG )
-{
- // Options lokal merken
- if ( !_pOptions )
- {
- DBG_ASSERT( _pPrintParent || _pSetupParent, "no dialog parent" );
- if( _pPrintParent )
- _pOptions = ( (SfxPrinter*)_pPrintParent->GetPrinter() )->GetOptions().Clone();
- else if( _pSetupParent )
- _pOptions = ( (SfxPrinter*)_pSetupParent->GetPrinter() )->GetOptions().Clone();
- }
-
- if ( _pOptions && _pPrintParent && _pPrintParent->IsSheetRangeAvailable() )
- {
- SfxItemState eState = _pOptions->GetItemState( SID_PRINT_SELECTEDSHEET );
- if ( eState != SFX_ITEM_UNKNOWN )
- {
- PrintSheetRange eRange = _pPrintParent->GetCheckedSheetRange();
- BOOL bValue = ( PRINTSHEETS_ALL != eRange );
- _pOptions->Put( SfxBoolItem( SID_PRINT_SELECTEDSHEET, bValue ) );
- }
- }
-
- // Dialog ausf"uhren
- SfxPrintOptionsDialog* pDlg = new SfxPrintOptionsDialog( _pPrintParent ? static_cast<Window*>(_pPrintParent)
- : static_cast<Window*>(_pSetupParent),
- _pViewSh, _pOptions );
- if ( _bHelpDisabled )
- pDlg->DisableHelp();
- if ( pDlg->Execute() == RET_OK )
- {
- delete _pOptions;
- _pOptions = pDlg->GetOptions().Clone();
-
- if ( _pOptions && _pPrintParent && _pPrintParent->IsSheetRangeAvailable() )
- {
- const SfxPoolItem* pItem;
- if ( SFX_ITEM_SET == _pOptions->GetItemState( SID_PRINT_SELECTEDSHEET, FALSE , &pItem ) )
- {
- _pPrintParent->CheckSheetRange( ( (const SfxBoolItem*)pItem )->GetValue()
- ? PRINTSHEETS_SELECTED_SHEETS : PRINTSHEETS_ALL );
- }
- }
- }
- delete pDlg;
-
- return 0;
-}
-
-//-------------------------------------------------------------------------
-
-BOOL UseStandardPrinter_Impl( Window* /*pParent*/, SfxPrinter* pDocPrinter )
-{
- // Optionen abfragen, ob gewarnt werden soll (Doc uebersteuert App)
- BOOL bWarn = FALSE;
- const SfxItemSet *pDocOptions = &pDocPrinter->GetOptions();
- if ( pDocOptions )
- {
- USHORT nWhich = pDocOptions->GetPool()->GetWhich(SID_PRINTER_NOTFOUND_WARN);
- const SfxBoolItem* pBoolItem = NULL;
- pDocPrinter->GetOptions().GetItemState( nWhich, FALSE, (const SfxPoolItem**) &pBoolItem );
- if ( pBoolItem )
- bWarn = pBoolItem->GetValue();
- }
-/*
- // ggf. den User fragen
- if ( bWarn )
- {
- // Geht nicht mehr ohne OrigJobSetup!
- String aTmp( SfxResId( STR_PRINTER_NOTAVAIL ) );
- QueryBox aBox( pParent, WB_OK_CANCEL | WB_DEF_OK, aTmp );
- return RET_OK == aBox.Execute();
- }
-*/
- // nicht gewarnt => einfach so den StandardDrucker nehmen
- return TRUE;
-}
-//-------------------------------------------------------------------------
-
-SfxPrinter* SfxViewShell::SetPrinter_Impl( SfxPrinter *pNewPrinter )
-
-/* Interne Methode zum Setzen der Unterschiede von 'pNewPrinter' zum
- aktuellen Printer. pNewPrinter wird entweder "ubernommen oder gel"oscht.
-*/
-
-{
- // aktuellen Printer holen
- SfxPrinter *pDocPrinter = GetPrinter();
-
- // Printer-Options auswerten
- FASTBOOL bOriToDoc = FALSE;
- FASTBOOL bSizeToDoc = FALSE;
- if ( &pDocPrinter->GetOptions() )
- {
- USHORT nWhich = GetPool().GetWhich(SID_PRINTER_CHANGESTODOC);
- const SfxFlagItem *pFlagItem = 0;
- pDocPrinter->GetOptions().GetItemState( nWhich, FALSE, (const SfxPoolItem**) &pFlagItem );
- bOriToDoc = pFlagItem ? (pFlagItem->GetValue() & SFX_PRINTER_CHG_ORIENTATION) : FALSE;
- bSizeToDoc = pFlagItem ? (pFlagItem->GetValue() & SFX_PRINTER_CHG_SIZE) : FALSE;
- }
-
- // vorheriges Format und Size feststellen
- Orientation eOldOri = pDocPrinter->GetOrientation();
- Size aOldPgSz = pDocPrinter->GetPaperSizePixel();
-
- // neues Format und Size feststellen
- Orientation eNewOri = pNewPrinter->GetOrientation();
- Size aNewPgSz = pNewPrinter->GetPaperSizePixel();
-
- // "Anderungen am Seitenformat feststellen
- BOOL bOriChg = (eOldOri != eNewOri) && bOriToDoc;
- BOOL bPgSzChg = ( aOldPgSz.Height() !=
- ( bOriChg ? aNewPgSz.Width() : aNewPgSz.Height() ) ||
- aOldPgSz.Width() !=
- ( bOriChg ? aNewPgSz.Height() : aNewPgSz.Width() ) ) &&
- bSizeToDoc;
-
- // Message und Flags f"ur Seitenformat-"Anderung zusammenstellen
- String aMsg;
- USHORT nNewOpt=0;
- if( bOriChg && bPgSzChg )
- {
- aMsg = String(SfxResId(STR_PRINT_NEWORISIZE));
- nNewOpt = SFX_PRINTER_CHG_ORIENTATION | SFX_PRINTER_CHG_SIZE;
- }
- else if (bOriChg )
- {
- aMsg = String(SfxResId(STR_PRINT_NEWORI));
- nNewOpt = SFX_PRINTER_CHG_ORIENTATION;
- }
- else if (bPgSzChg)
- {
- aMsg = String(SfxResId(STR_PRINT_NEWSIZE));
- nNewOpt = SFX_PRINTER_CHG_SIZE;
- }
-
- // in dieser Variable sammeln, was sich so ge"aendert hat
- USHORT nChangedFlags = 0;
-
- // ggf. Nachfrage, ob Seitenformat vom Drucker "ubernommen werden soll
- if ( ( bOriChg || bPgSzChg ) &&
- RET_YES == QueryBox(0, WB_YES_NO | WB_DEF_OK, aMsg).Execute() )
- // Flags mit "Anderungen f"ur <SetPrinter(SfxPrinter*)> mitpflegen
- nChangedFlags |= nNewOpt;
-
- // fuer den MAC sein "temporary of class String" im naechsten if()
- String aTempPrtName = pNewPrinter->GetName();
- String aDocPrtName = pDocPrinter->GetName();
-
- // Wurde der Drucker gewechselt oder von Default auf Specific
- // oder umgekehrt geaendert?
- if ( (aTempPrtName != aDocPrtName) || (pDocPrinter->IsDefPrinter() != pNewPrinter->IsDefPrinter()) )
- {
- // neuen Printer "ubernehmen
- // pNewPrinter->SetOrigJobSetup( pNewPrinter->GetJobSetup() );
- nChangedFlags |= SFX_PRINTER_PRINTER|SFX_PRINTER_JOBSETUP;
- pDocPrinter = pNewPrinter;
- }
- else
- {
- // Extra-Optionen vergleichen
- if ( ! (pNewPrinter->GetOptions() == pDocPrinter->GetOptions()) )
- {
- // Options haben sich geaendert
- pDocPrinter->SetOptions( pNewPrinter->GetOptions() );
- nChangedFlags |= SFX_PRINTER_OPTIONS;
- }
-
- // JobSetups vergleichen
- JobSetup aNewJobSetup = pNewPrinter->GetJobSetup();
- JobSetup aOldJobSetup = pDocPrinter->GetJobSetup();
- if ( aNewJobSetup != aOldJobSetup )
- {
- // JobSetup hat sich geaendert (=> App mu\s neu formatieren)
- // pDocPrinter->SetOrigJobSetup( aNewJobSetup );
- nChangedFlags |= SFX_PRINTER_JOBSETUP;
- }
-
- // alten, ver"anderten Printer behalten
- pDocPrinter->SetPrinterProps( pNewPrinter );
- delete pNewPrinter;
- }
-
- if ( 0 != nChangedFlags )
- // SetPrinter will delete the old printer if it changes
- SetPrinter( pDocPrinter, nChangedFlags );
- return pDocPrinter;
-}
-
-//-------------------------------------------------------------------------
-// Unter WIN32 tritt leider das Problem auf, dass nichts gedruckt
-// wird, wenn SID_PRINTDOCDIRECT auflaueft; bisher bekannte,
-// einzige Abhilfe ist in diesem Fall das Abschalten der Optimierungen
-// (KA 17.12.95)
-#ifdef _MSC_VER
-#pragma optimize ( "", off )
-#endif
-
-void SfxViewShell::ExecPrint( const uno::Sequence < beans::PropertyValue >& rProps, sal_Bool bIsAPI, sal_Bool bIsDirect )
-{
- // get the current selection; our controller should know it
- Reference< frame::XController > xController( GetController() );
- Reference< view::XSelectionSupplier > xSupplier( xController, UNO_QUERY );
-
- Any aSelection;
- if( xSupplier.is() )
- aSelection = xSupplier->getSelection();
- else
- aSelection <<= GetObjectShell()->GetModel();
- Any aComplete( makeAny( GetObjectShell()->GetModel() ) );
- Any aViewProp( makeAny( xController ) );
-
- boost::shared_ptr<vcl::PrinterController> pController( new SfxPrinterController( aComplete,
- aSelection,
- aViewProp,
- GetRenderable(),
- bIsAPI,
- bIsDirect,
- this,
- rProps
- ) );
- SfxObjectShell *pObjShell = GetObjectShell();
- pController->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "JobName" ) ),
- makeAny( rtl::OUString( pObjShell->GetTitle(0) ) ) );
-
- // FIXME: job setup
- SfxPrinter* pDocPrt = GetPrinter(FALSE);
- JobSetup aJobSetup = pDocPrt ? pDocPrt->GetJobSetup() : GetJobSetup();
- if( bIsDirect )
- aJobSetup.SetValue( String( RTL_CONSTASCII_USTRINGPARAM( "IsQuickJob" ) ),
- String( RTL_CONSTASCII_USTRINGPARAM( "true" ) ) );
-
- Printer::PrintJob( pController, aJobSetup );
-}
-
-void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
-{
- // USHORT nCopies=1;
- USHORT nDialogRet = RET_CANCEL;
- // BOOL bCollate=FALSE;
- SfxPrinter* pPrinter = 0;
- PrintDialog* pPrintDlg = 0;
- SfxDialogExecutor_Impl* pExecutor = 0;
- bool bSilent = false;
- BOOL bIsAPI = rReq.GetArgs() && rReq.GetArgs()->Count();
- if ( bIsAPI )
- {
- SFX_REQUEST_ARG(rReq, pSilentItem, SfxBoolItem, SID_SILENT, FALSE);
- bSilent = pSilentItem && pSilentItem->GetValue();
- }
-
- //FIXME: how to transport "bPrintOnHelp"?
-
- // no help button in dialogs if called from the help window
- // (pressing help button would exchange the current page inside the help document that is going to be printed!)
- String aHelpFilterName( DEFINE_CONST_UNICODE("writer_web_HTML_help") );
- SfxMedium* pMedium = GetViewFrame()->GetObjectShell()->GetMedium();
- const SfxFilter* pFilter = pMedium ? pMedium->GetFilter() : NULL;
- sal_Bool bPrintOnHelp = ( pFilter && pFilter->GetFilterName() == aHelpFilterName );
-
- const USHORT nId = rReq.GetSlot();
- switch( nId )
- {
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- case SID_PRINTDOC:
- case SID_PRINTDOCDIRECT:
- {
- SfxObjectShell* pDoc = GetObjectShell();
- bool bDetectHidden = ( !bSilent && pDoc );
- if ( bDetectHidden && pDoc->QueryHiddenInformation( WhenPrinting, NULL ) != RET_YES )
- break;
-
- SFX_REQUEST_ARG(rReq, pSelectItem, SfxBoolItem, SID_SELECTION, FALSE);
- sal_Bool bSelection = pSelectItem && pSelectItem->GetValue();
- if( pSelectItem && rReq.GetArgs()->Count() == 1 )
- bIsAPI = FALSE;
-
- uno::Sequence < beans::PropertyValue > aProps;
- if ( bIsAPI )
- {
- // supported properties:
- // String PrinterName
- // String FileName
- // Int16 From
- // Int16 To
- // In16 Copies
- // String RangeText
- // bool Selection
- // bool Asynchron
- // bool Collate
- // bool Silent
- 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") )
- {
- aProps[nProp]. Name = rtl::OUString::createFromAscii("Wait");
- sal_Bool bAsynchron = sal_False;
- aProps[nProp].Value >>= bAsynchron;
- aProps[nProp].Value <<= (sal_Bool) (!bAsynchron);
- }
- if ( aProps[nProp].Name.equalsAscii("Silent") )
- {
- aProps[nProp]. Name = rtl::OUString::createFromAscii("MonitorVisible");
- sal_Bool bPrintSilent = sal_False;
- aProps[nProp].Value >>= bPrintSilent;
- aProps[nProp].Value <<= (sal_Bool) (!bPrintSilent);
- }
- }
- }
- sal_Int32 nLen = aProps.getLength();
- aProps.realloc( nLen + 1 );
- aProps[nLen].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintSelectionOnly" ) );
- aProps[nLen].Value = makeAny( bSelection );
-
- ExecPrint( aProps, bIsAPI, (nId == SID_PRINTDOCDIRECT) );
-
- // FIXME: Recording
- rReq.Done();
- break;
- }
-
- case SID_SETUPPRINTER :
- case SID_PRINTER_NAME : // only for recorded macros
- {
- // get printer and printer settings from the document
- SfxPrinter *pDocPrinter = GetPrinter(TRUE);
-
- // look for printer in parameters
- SFX_REQUEST_ARG( rReq, pPrinterItem, SfxStringItem, SID_PRINTER_NAME, FALSE );
- if ( pPrinterItem )
- {
- // use PrinterName parameter to create a printer
- pPrinter = new SfxPrinter( pDocPrinter->GetOptions().Clone(), ((const SfxStringItem*) pPrinterItem)->GetValue() );
-
- // if printer is unknown, it can't be used - now printer from document will be used
- if ( !pPrinter->IsOriginal() )
- DELETEZ(pPrinter);
- }
-
- if ( SID_PRINTER_NAME == nId )
- {
- // just set a recorded printer name
- if ( pPrinter )
- SetPrinter( pPrinter, SFX_PRINTER_PRINTER );
- break;
- }
-
- // no PrinterName parameter in ItemSet or the PrinterName points to an unknown printer
- if ( !pPrinter )
- // use default printer from document
- pPrinter = pDocPrinter;
-
- if( !pPrinter || !pPrinter->IsValid() )
- {
- // no valid printer either in ItemSet or at the document
- if ( bSilent )
- {
- rReq.SetReturnValue(SfxBoolItem(0,FALSE));
- break;
- }
- else
- 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,FALSE));
- break;
- }
-
- // FIXME: printer isn't used for printing anymore!
- if( pPrinter->IsPrinting() )
- {
- // if printer is busy, abort printing
- if ( !bSilent )
- InfoBox( NULL, String( SfxResId( STR_ERROR_PRINTER_BUSY ) ) ).Execute();
- rReq.SetReturnValue(SfxBoolItem(0,FALSE));
- break;
- }
-
- // if no arguments are given, retrieve them from a dialog
- if ( !bIsAPI )
- {
- // PrinterDialog needs a temporary printer
- SfxPrinter* pDlgPrinter = pPrinter->Clone();
- nDialogRet = 0;
-
- // execute PrinterSetupDialog
- PrinterSetupDialog* pPrintSetupDlg = new PrinterSetupDialog( GetWindow() );
-
- if ( pImp->bHasPrintOptions )
- {
- // additional controls for dialog
- pExecutor = new SfxDialogExecutor_Impl( this, pPrintSetupDlg );
- if ( bPrintOnHelp )
- pExecutor->DisableHelp();
- pPrintSetupDlg->SetOptionsHdl( pExecutor->GetLink() );
- }
-
- pPrintSetupDlg->SetPrinter( pDlgPrinter );
- nDialogRet = pPrintSetupDlg->Execute();
-
- if ( pExecutor && pExecutor->GetOptions() )
- {
- if ( nDialogRet == RET_OK )
- // remark: have to be recorded if possible!
- pDlgPrinter->SetOptions( *pExecutor->GetOptions() );
- else
- {
- pPrinter->SetOptions( *pExecutor->GetOptions() );
- SetPrinter( pPrinter, SFX_PRINTER_OPTIONS );
- }
- }
-
- DELETEZ( pPrintSetupDlg );
-
- // no recording of PrinterSetup except printer name (is printer dependent)
- rReq.Ignore();
-
- if ( nDialogRet == RET_OK )
- {
- if ( pPrinter->GetName() != pDlgPrinter->GetName() )
- {
- // user has changed the printer -> macro recording
- SfxRequest aReq( GetViewFrame(), SID_PRINTER_NAME );
- aReq.AppendItem( SfxStringItem( SID_PRINTER_NAME, pDlgPrinter->GetName() ) );
- aReq.Done();
- }
-
- // take the changes made in the dialog
- pPrinter = SetPrinter_Impl( pDlgPrinter );
-
- // forget new printer, it was taken over (as pPrinter) or deleted
- pDlgPrinter = NULL;
-
- /* Now lets reset the Dialog printer, since its freed */
- if (pPrintDlg)
- pPrintDlg->SetPrinter (pPrinter);
- }
- else
- {
- // PrinterDialog is used to transfer information on printing,
- // so it will only be deleted here if dialog was cancelled
- DELETEZ( pDlgPrinter );
- DELETEZ( pPrintDlg );
- rReq.Ignore();
- if ( SID_PRINTDOC == nId )
- rReq.SetReturnValue(SfxBoolItem(0,FALSE));
- }
- }
- }
-
- break;
- }
-}
-
-// Optimierungen wieder einschalten
-#ifdef _MSC_VER
-#pragma optimize ( "", on )
-#endif
-
-//--------------------------------------------------------------------
-
-PrintDialog* SfxViewShell::CreatePrintDialog( Window* /*pParent*/ )
-
-/* [Beschreibung]
-
- Diese Methode kann "uberladen werden, um einen speziellen PrintDialog
- zu erzeugen. Dies ist z.B. notwendig wenn spezielle <StarView> Features
- wie drucken von Seitenbereichen.
-*/
-
-{
- #if 0
- PrintDialog *pDlg = new PrintDialog( pParent, false );
- pDlg->SetFirstPage( 1 );
- pDlg->SetLastPage( 9999 );
- pDlg->EnableCollate();
- return pDlg;
- #else
- return NULL;
- #endif
-}
-
-//--------------------------------------------------------------------
-
-void SfxViewShell::PreparePrint( PrintDialog * )
-{
-}
-
-//--------------------------------------------------------------------
-
-
-ErrCode SfxViewShell::DoPrint( SfxPrinter* /*pPrinter*/,
- PrintDialog* /*pPrintDlg*/,
- BOOL /*bSilent*/, BOOL /*bIsAPI*/ )
-{
- #if 0
- // Printer-Dialogbox waehrend des Ausdrucks mu\s schon vor
- // StartJob erzeugt werden, da SV bei einem Quit-Event h"angt
- SfxPrintProgress *pProgress = new SfxPrintProgress( this, !bSilent );
- SfxPrinter *pDocPrinter = GetPrinter(TRUE);
- if ( !pPrinter )
- pPrinter = pDocPrinter;
- else if ( pDocPrinter != pPrinter )
- {
- pProgress->RestoreOnEndPrint( pDocPrinter->Clone() );
- SetPrinter( pPrinter, SFX_PRINTER_PRINTER );
- }
- pProgress->SetWaitMode(FALSE);
-
- // Drucker starten
- PreparePrint( pPrintDlg );
- SfxObjectShell *pObjShell = GetViewFrame()->GetObjectShell();
- if ( pPrinter->StartJob(pObjShell->GetTitle(0)) )
- {
- // Drucken
- Print( *pProgress, bIsAPI, pPrintDlg );
- pProgress->Stop();
- pProgress->DeleteOnEndPrint();
- pPrinter->EndJob();
- }
- else
- {
- // Printer konnte nicht gestartet werden
- delete pProgress;
- }
-
- return pPrinter->GetError();
- #else
- DBG_ERROR( "DoPrint called, dead code !" );
- return ERRCODE_IO_NOTSUPPORTED;
- #endif
-}
-
-//--------------------------------------------------------------------
-
-BOOL SfxViewShell::IsPrinterLocked() const
-{
- return pImp->nPrinterLocks > 0;
-}
-
-//--------------------------------------------------------------------
-
-void SfxViewShell::LockPrinter( BOOL bLock)
-{
- BOOL bChanged = FALSE;
- if ( bLock )
- bChanged = 1 == ++pImp->nPrinterLocks;
- else
- bChanged = 0 == --pImp->nPrinterLocks;
-
- if ( bChanged )
- {
- Invalidate( SID_PRINTDOC );
- Invalidate( SID_PRINTDOCDIRECT );
- Invalidate( SID_SETUPPRINTER );
- }
-}
-
-//--------------------------------------------------------------------
-
-USHORT SfxViewShell::Print( SfxProgress& /*rProgress*/, BOOL /*bIsAPI*/, PrintDialog* /*pDlg*/ )
-{
- return 0;
-}
-
-//--------------------------------------------------------------------
-
-SfxPrinter* SfxViewShell::GetPrinter( BOOL /*bCreate*/ )
-{
- return 0;
-}
-
-//--------------------------------------------------------------------
-
-USHORT SfxViewShell::SetPrinter( SfxPrinter* /*pNewPrinter*/, USHORT /*nDiffFlags*/, bool )
-{
- return 0;
-}
-
-//--------------------------------------------------------------------
-
-SfxTabPage* SfxViewShell::CreatePrintOptionsPage
-(
- Window* /*pParent*/,
- const SfxItemSet& /*rOptions*/
-)
-{
- return 0;
-}
-
-JobSetup SfxViewShell::GetJobSetup() const
-{
- return JobSetup();
-}
-
+/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: viewprn.cxx,v $ + * $Revision: 1.36.84.1 $ + * + * 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 <com/sun/star/document/XDocumentProperties.hpp> +#include <com/sun/star/view/PrintableState.hpp> +#include "com/sun/star/view/XRenderable.hpp" + +#include <svtools/itempool.hxx> +#include <vcl/msgbox.hxx> +#include <svtools/printdlg.hxx> +#include <svtools/prnsetup.hxx> +#include <svl/flagitem.hxx> +#include <svl/stritem.hxx> +#include <svl/intitem.hxx> +#include <svl/eitem.hxx> +#include <sfx2/app.hxx> +#include <svtools/useroptions.hxx> +#include <svtools/printwarningoptions.hxx> +#include <tools/datetime.hxx> +#include <sfx2/bindings.hxx> +#include <sfx2/objface.hxx> +#include <sfx2/viewsh.hxx> +#include "viewimp.hxx" +#include <sfx2/viewfrm.hxx> +#include <sfx2/prnmon.hxx> +#include "sfxresid.hxx" +#include <sfx2/request.hxx> +#include <sfx2/objsh.hxx> +#include "sfxtypes.hxx" +#include <sfx2/event.hxx> +#include <sfx2/docfile.hxx> +#include <sfx2/docfilt.hxx> + +#include "toolkit/awt/vclxdevice.hxx" + +#include "view.hrc" +#include "helpid.hrc" + +using namespace com::sun::star; +using namespace com::sun::star::uno; + +TYPEINIT1(SfxPrintingHint, SfxHint); + +// ----------------------------------------------------------------------- +class SfxPrinterController : public vcl::PrinterController, public SfxListener +{ + Any maCompleteSelection; + Any maSelection; + Reference< view::XRenderable > mxRenderable; + mutable Printer* mpLastPrinter; + mutable Reference<awt::XDevice> mxDevice; + SfxViewShell* mpViewShell; + SfxObjectShell* mpObjectShell; + sal_Bool m_bOrigStatus; + sal_Bool m_bNeedsChange; + sal_Bool m_bApi; + util::DateTime m_aLastPrinted; + ::rtl::OUString m_aLastPrintedBy; + + Sequence< beans::PropertyValue > getMergedOptions() const; + const Any& getSelectionObject() const; +public: + SfxPrinterController( const Any& i_rComplete, + const Any& i_rSelection, + const Any& i_rViewProp, + const Reference< view::XRenderable >& i_xRender, + sal_Bool i_bApi, sal_Bool i_bDirect, + SfxViewShell* pView, + const uno::Sequence< beans::PropertyValue >& rProps + ); + + virtual ~SfxPrinterController(); + virtual void Notify( SfxBroadcaster&, const SfxHint& ); + + virtual int getPageCount() const; + virtual Sequence< beans::PropertyValue > getPageParameters( int i_nPage ) const; + virtual void printPage( int i_nPage ) const; + virtual void jobStarted(); + virtual void jobFinished( com::sun::star::view::PrintableState ); +}; + +SfxPrinterController::SfxPrinterController( const Any& i_rComplete, + const Any& i_rSelection, + const Any& i_rViewProp, + const Reference< view::XRenderable >& i_xRender, + sal_Bool i_bApi, sal_Bool i_bDirect, + SfxViewShell* pView, + const uno::Sequence< beans::PropertyValue >& rProps + ) + : maCompleteSelection( i_rComplete ) + , maSelection( i_rSelection ) + , mxRenderable( i_xRender ) + , mpLastPrinter( NULL ) + , mpViewShell( pView ) + , mpObjectShell(0) + , m_bOrigStatus( sal_False ) + , m_bNeedsChange( sal_False ) + , m_bApi(i_bApi) +{ + if ( mpViewShell ) + { + StartListening( *mpViewShell ); + mpObjectShell = mpViewShell->GetObjectShell(); + StartListening( *mpObjectShell ); + m_bOrigStatus = mpObjectShell->IsEnableSetModified(); + + // check configuration: shall update of printing information in DocInfo set the document to "modified"? + if ( m_bOrigStatus && !SvtPrintWarningOptions().IsModifyDocumentOnPrintingAllowed() ) + { + mpObjectShell->EnableSetModified( sal_False ); + m_bNeedsChange = sal_True; + } + + // refresh document info + uno::Reference<document::XDocumentProperties> xDocProps(mpObjectShell->getDocProperties()); + m_aLastPrintedBy = xDocProps->getPrintedBy(); + m_aLastPrinted = xDocProps->getPrintDate(); + + xDocProps->setPrintedBy( mpObjectShell->IsUseUserData() + ? ::rtl::OUString( SvtUserOptions().GetFullName() ) + : ::rtl::OUString() ); + ::DateTime now; + + xDocProps->setPrintDate( util::DateTime( + now.Get100Sec(), now.GetSec(), now.GetMin(), now.GetHour(), + now.GetDay(), now.GetMonth(), now.GetYear() ) ); + } + + // initialize extra ui options + if( mxRenderable.is() ) + { + for (sal_Int32 nProp=0; nProp<rProps.getLength(); nProp++) + setValue( rProps[nProp].Name, rProps[nProp].Value ); + + Sequence< beans::PropertyValue > aRenderOptions( 3 ); + aRenderOptions[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ExtraPrintUIOptions" ) ); + aRenderOptions[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "View" ) ); + aRenderOptions[1].Value = i_rViewProp; + aRenderOptions[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsPrinter" ) ); + aRenderOptions[2].Value <<= sal_True; + Sequence< beans::PropertyValue > aRenderParms( mxRenderable->getRenderer( 0 , getSelectionObject(), aRenderOptions ) ); + int nProps = aRenderParms.getLength(); + for( int i = 0; i < nProps; i++ ) + { + if( aRenderParms[i].Name.equalsAscii( "ExtraPrintUIOptions" ) ) + { + Sequence< beans::PropertyValue > aUIProps; + aRenderParms[i].Value >>= aUIProps; + setUIOptions( aUIProps ); + break; + } + } + } + + // set some job parameters + setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsApi" ) ), makeAny( i_bApi ) ); + setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsDirect" ) ), makeAny( i_bDirect ) ); + setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsPrinter" ) ), makeAny( sal_True ) ); + setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "View" ) ), i_rViewProp ); +} + +void SfxPrinterController::Notify( SfxBroadcaster& , const SfxHint& rHint ) +{ + if ( rHint.IsA(TYPE(SfxSimpleHint)) ) + { + if ( ((SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING ) + { + EndListening(*mpViewShell); + EndListening(*mpObjectShell); + mpViewShell = 0; + mpObjectShell = 0; + } + } +} + +SfxPrinterController::~SfxPrinterController() +{ +} + +const Any& SfxPrinterController::getSelectionObject() const +{ + sal_Int32 nChoice = 0; + sal_Bool bSel = sal_False; + const beans::PropertyValue* pVal = getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintContent" ) ) ); + if( pVal ) + pVal->Value >>= nChoice; + pVal = getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintSelectionOnly" ) ) ); + if( pVal ) + pVal->Value >>= bSel; + return (nChoice > 1 || bSel) ? maSelection : maCompleteSelection; +} + +Sequence< beans::PropertyValue > SfxPrinterController::getMergedOptions() const +{ + boost::shared_ptr<Printer> pPrinter( getPrinter() ); + if( pPrinter.get() != mpLastPrinter ) + { + mpLastPrinter = pPrinter.get(); + VCLXDevice* pXDevice = new VCLXDevice(); + pXDevice->SetOutputDevice( mpLastPrinter ); + mxDevice = Reference< awt::XDevice >( pXDevice ); + } + + Sequence< beans::PropertyValue > aRenderOptions( 1 ); + aRenderOptions[ 0 ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RenderDevice" ) ); + aRenderOptions[ 0 ].Value <<= mxDevice; + + aRenderOptions = getJobProperties( aRenderOptions ); + return aRenderOptions; +} + +int SfxPrinterController::getPageCount() const +{ + int nPages = 0; + boost::shared_ptr<Printer> pPrinter( getPrinter() ); + if( mxRenderable.is() && pPrinter ) + { + Sequence< beans::PropertyValue > aJobOptions( getMergedOptions() ); + nPages = mxRenderable->getRendererCount( getSelectionObject(), aJobOptions ); + } + return nPages; +} + +Sequence< beans::PropertyValue > SfxPrinterController::getPageParameters( int i_nPage ) const +{ + boost::shared_ptr<Printer> pPrinter( getPrinter() ); + Sequence< beans::PropertyValue > aResult; + + if( mxRenderable.is() && pPrinter ) + { + Sequence< beans::PropertyValue > aJobOptions( getMergedOptions() ); + aResult = mxRenderable->getRenderer( i_nPage, getSelectionObject(), aJobOptions ); + } + return aResult; +} + +void SfxPrinterController::printPage( int i_nPage ) const +{ + boost::shared_ptr<Printer> pPrinter( getPrinter() ); + if( mxRenderable.is() && pPrinter ) + { + Sequence< beans::PropertyValue > aJobOptions( getMergedOptions() ); + try + { + mxRenderable->render( i_nPage, getSelectionObject(), aJobOptions ); + } + catch( lang::IllegalArgumentException& ) + { + // don't care enough about nonexistant page here + // to provoke a crash + } + } +} + +void SfxPrinterController::jobStarted() +{ + if ( mpObjectShell ) + { + // FIXME: how to get all print options incl. AdditionalOptions easily? + uno::Sequence < beans::PropertyValue > aOpts; + mpObjectShell->Broadcast( SfxPrintingHint( view::PrintableState_JOB_STARTED, aOpts ) ); + } +} + +void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nState ) +{ + if ( mpObjectShell ) + { + mpObjectShell->Broadcast( SfxPrintingHint( nState ) ); + switch ( nState ) + { + case view::PrintableState_JOB_FAILED : + { + // "real" problem (not simply printing cancelled by user) + String aMsg( SfxResId( STR_NOSTARTPRINTER ) ); + if ( !m_bApi ) + ErrorBox( mpViewShell->GetWindow(), WB_OK | WB_DEF_OK, aMsg ).Execute(); + // intentionally no break + } + case view::PrintableState_JOB_ABORTED : + { + // printing not succesful, reset DocInfo + uno::Reference<document::XDocumentProperties> xDocProps(mpObjectShell->getDocProperties()); + xDocProps->setPrintedBy(m_aLastPrintedBy); + xDocProps->setPrintDate(m_aLastPrinted); + break; + } + + case view::PrintableState_JOB_SPOOLED : + case view::PrintableState_JOB_COMPLETED : + { + SfxBindings& rBind = mpViewShell->GetViewFrame()->GetBindings(); + rBind.Invalidate( SID_PRINTDOC ); + rBind.Invalidate( SID_PRINTDOCDIRECT ); + rBind.Invalidate( SID_SETUPPRINTER ); + break; + } + + default: + break; + } + + if ( m_bNeedsChange ) + mpObjectShell->EnableSetModified( m_bOrigStatus ); + } +} + +// ----------------------------------------------------------------------- + +void DisableRanges( PrintDialog& rDlg, SfxPrinter* pPrinter ) + +/* [Beschreibung] + + Mit dieser Funktion werden die nicht verf"ugbaren Ranges + vom Printer zum PrintDialog geforwarded. +*/ + +{ + if ( !pPrinter ) + return; + + if ( !pPrinter->IsRangeEnabled( PRINTDIALOG_ALL ) ) + rDlg.DisableRange( PRINTDIALOG_ALL ); + if ( !pPrinter->IsRangeEnabled( PRINTDIALOG_SELECTION ) ) + rDlg.DisableRange( PRINTDIALOG_SELECTION ); + if ( !pPrinter->IsRangeEnabled( PRINTDIALOG_FROMTO ) ) + rDlg.DisableRange( PRINTDIALOG_FROMTO ); + if ( !pPrinter->IsRangeEnabled( PRINTDIALOG_RANGE ) ) + rDlg.DisableRange( PRINTDIALOG_RANGE ); +} + +//==================================================================== + +class SfxDialogExecutor_Impl + +/* [Beschreibung] + + Eine Instanz dieser Klasse wird f"ur die Laufzeit des Printer-Dialogs + erzeugt, um im dessen Click-Handler f"ur die Zus"atze den per + virtueller Methode von der abgeleiteten SfxViewShell erzeugten + Print-Options-Dialog zu erzeugen und die dort eingestellten Optionen + als SfxItemSet zu zwischenzuspeichern. +*/ + +{ +private: + SfxViewShell* _pViewSh; + PrintDialog* _pPrintParent; + PrinterSetupDialog* _pSetupParent; + SfxItemSet* _pOptions; + sal_Bool _bModified; + sal_Bool _bHelpDisabled; + + DECL_LINK( Execute, void * ); + +public: + SfxDialogExecutor_Impl( SfxViewShell* pViewSh, PrintDialog* pParent ); + SfxDialogExecutor_Impl( SfxViewShell* pViewSh, PrinterSetupDialog* pParent ); + ~SfxDialogExecutor_Impl() { delete _pOptions; } + + Link GetLink() const { return LINK( this, SfxDialogExecutor_Impl, Execute); } + const SfxItemSet* GetOptions() const { return _pOptions; } + void DisableHelp() { _bHelpDisabled = sal_True; } +}; + +//-------------------------------------------------------------------- + +SfxDialogExecutor_Impl::SfxDialogExecutor_Impl( SfxViewShell* pViewSh, PrintDialog* pParent ) : + + _pViewSh ( pViewSh ), + _pPrintParent ( pParent ), + _pSetupParent ( NULL ), + _pOptions ( NULL ), + _bModified ( sal_False ), + _bHelpDisabled ( sal_False ) + +{ +} + +SfxDialogExecutor_Impl::SfxDialogExecutor_Impl( SfxViewShell* pViewSh, PrinterSetupDialog* pParent ) : + + _pViewSh ( pViewSh ), + _pPrintParent ( NULL ), + _pSetupParent ( pParent ), + _pOptions ( NULL ), + _bModified ( sal_False ), + _bHelpDisabled ( sal_False ) + +{ +} + +//-------------------------------------------------------------------- + +IMPL_LINK( SfxDialogExecutor_Impl, Execute, void *, EMPTYARG ) +{ + // Options lokal merken + if ( !_pOptions ) + { + DBG_ASSERT( _pPrintParent || _pSetupParent, "no dialog parent" ); + if( _pPrintParent ) + _pOptions = ( (SfxPrinter*)_pPrintParent->GetPrinter() )->GetOptions().Clone(); + else if( _pSetupParent ) + _pOptions = ( (SfxPrinter*)_pSetupParent->GetPrinter() )->GetOptions().Clone(); + } + + if ( _pOptions && _pPrintParent && _pPrintParent->IsSheetRangeAvailable() ) + { + SfxItemState eState = _pOptions->GetItemState( SID_PRINT_SELECTEDSHEET ); + if ( eState != SFX_ITEM_UNKNOWN ) + { + PrintSheetRange eRange = _pPrintParent->GetCheckedSheetRange(); + BOOL bValue = ( PRINTSHEETS_ALL != eRange ); + _pOptions->Put( SfxBoolItem( SID_PRINT_SELECTEDSHEET, bValue ) ); + } + } + + // Dialog ausf"uhren + SfxPrintOptionsDialog* pDlg = new SfxPrintOptionsDialog( _pPrintParent ? static_cast<Window*>(_pPrintParent) + : static_cast<Window*>(_pSetupParent), + _pViewSh, _pOptions ); + if ( _bHelpDisabled ) + pDlg->DisableHelp(); + if ( pDlg->Execute() == RET_OK ) + { + delete _pOptions; + _pOptions = pDlg->GetOptions().Clone(); + + if ( _pOptions && _pPrintParent && _pPrintParent->IsSheetRangeAvailable() ) + { + const SfxPoolItem* pItem; + if ( SFX_ITEM_SET == _pOptions->GetItemState( SID_PRINT_SELECTEDSHEET, FALSE , &pItem ) ) + { + _pPrintParent->CheckSheetRange( ( (const SfxBoolItem*)pItem )->GetValue() + ? PRINTSHEETS_SELECTED_SHEETS : PRINTSHEETS_ALL ); + } + } + } + delete pDlg; + + return 0; +} + +//------------------------------------------------------------------------- + +BOOL UseStandardPrinter_Impl( Window* /*pParent*/, SfxPrinter* pDocPrinter ) +{ + // Optionen abfragen, ob gewarnt werden soll (Doc uebersteuert App) + BOOL bWarn = FALSE; + const SfxItemSet *pDocOptions = &pDocPrinter->GetOptions(); + if ( pDocOptions ) + { + USHORT nWhich = pDocOptions->GetPool()->GetWhich(SID_PRINTER_NOTFOUND_WARN); + const SfxBoolItem* pBoolItem = NULL; + pDocPrinter->GetOptions().GetItemState( nWhich, FALSE, (const SfxPoolItem**) &pBoolItem ); + if ( pBoolItem ) + bWarn = pBoolItem->GetValue(); + } +/* + // ggf. den User fragen + if ( bWarn ) + { + // Geht nicht mehr ohne OrigJobSetup! + String aTmp( SfxResId( STR_PRINTER_NOTAVAIL ) ); + QueryBox aBox( pParent, WB_OK_CANCEL | WB_DEF_OK, aTmp ); + return RET_OK == aBox.Execute(); + } +*/ + // nicht gewarnt => einfach so den StandardDrucker nehmen + return TRUE; +} +//------------------------------------------------------------------------- + +SfxPrinter* SfxViewShell::SetPrinter_Impl( SfxPrinter *pNewPrinter ) + +/* Interne Methode zum Setzen der Unterschiede von 'pNewPrinter' zum + aktuellen Printer. pNewPrinter wird entweder "ubernommen oder gel"oscht. +*/ + +{ + // aktuellen Printer holen + SfxPrinter *pDocPrinter = GetPrinter(); + + // Printer-Options auswerten + FASTBOOL bOriToDoc = FALSE; + FASTBOOL bSizeToDoc = FALSE; + if ( &pDocPrinter->GetOptions() ) + { + USHORT nWhich = GetPool().GetWhich(SID_PRINTER_CHANGESTODOC); + const SfxFlagItem *pFlagItem = 0; + pDocPrinter->GetOptions().GetItemState( nWhich, FALSE, (const SfxPoolItem**) &pFlagItem ); + bOriToDoc = pFlagItem ? (pFlagItem->GetValue() & SFX_PRINTER_CHG_ORIENTATION) : FALSE; + bSizeToDoc = pFlagItem ? (pFlagItem->GetValue() & SFX_PRINTER_CHG_SIZE) : FALSE; + } + + // vorheriges Format und Size feststellen + Orientation eOldOri = pDocPrinter->GetOrientation(); + Size aOldPgSz = pDocPrinter->GetPaperSizePixel(); + + // neues Format und Size feststellen + Orientation eNewOri = pNewPrinter->GetOrientation(); + Size aNewPgSz = pNewPrinter->GetPaperSizePixel(); + + // "Anderungen am Seitenformat feststellen + BOOL bOriChg = (eOldOri != eNewOri) && bOriToDoc; + BOOL bPgSzChg = ( aOldPgSz.Height() != + ( bOriChg ? aNewPgSz.Width() : aNewPgSz.Height() ) || + aOldPgSz.Width() != + ( bOriChg ? aNewPgSz.Height() : aNewPgSz.Width() ) ) && + bSizeToDoc; + + // Message und Flags f"ur Seitenformat-"Anderung zusammenstellen + String aMsg; + USHORT nNewOpt=0; + if( bOriChg && bPgSzChg ) + { + aMsg = String(SfxResId(STR_PRINT_NEWORISIZE)); + nNewOpt = SFX_PRINTER_CHG_ORIENTATION | SFX_PRINTER_CHG_SIZE; + } + else if (bOriChg ) + { + aMsg = String(SfxResId(STR_PRINT_NEWORI)); + nNewOpt = SFX_PRINTER_CHG_ORIENTATION; + } + else if (bPgSzChg) + { + aMsg = String(SfxResId(STR_PRINT_NEWSIZE)); + nNewOpt = SFX_PRINTER_CHG_SIZE; + } + + // in dieser Variable sammeln, was sich so ge"aendert hat + USHORT nChangedFlags = 0; + + // ggf. Nachfrage, ob Seitenformat vom Drucker "ubernommen werden soll + if ( ( bOriChg || bPgSzChg ) && + RET_YES == QueryBox(0, WB_YES_NO | WB_DEF_OK, aMsg).Execute() ) + // Flags mit "Anderungen f"ur <SetPrinter(SfxPrinter*)> mitpflegen + nChangedFlags |= nNewOpt; + + // fuer den MAC sein "temporary of class String" im naechsten if() + String aTempPrtName = pNewPrinter->GetName(); + String aDocPrtName = pDocPrinter->GetName(); + + // Wurde der Drucker gewechselt oder von Default auf Specific + // oder umgekehrt geaendert? + if ( (aTempPrtName != aDocPrtName) || (pDocPrinter->IsDefPrinter() != pNewPrinter->IsDefPrinter()) ) + { + // neuen Printer "ubernehmen + // pNewPrinter->SetOrigJobSetup( pNewPrinter->GetJobSetup() ); + nChangedFlags |= SFX_PRINTER_PRINTER|SFX_PRINTER_JOBSETUP; + pDocPrinter = pNewPrinter; + } + else + { + // Extra-Optionen vergleichen + if ( ! (pNewPrinter->GetOptions() == pDocPrinter->GetOptions()) ) + { + // Options haben sich geaendert + pDocPrinter->SetOptions( pNewPrinter->GetOptions() ); + nChangedFlags |= SFX_PRINTER_OPTIONS; + } + + // JobSetups vergleichen + JobSetup aNewJobSetup = pNewPrinter->GetJobSetup(); + JobSetup aOldJobSetup = pDocPrinter->GetJobSetup(); + if ( aNewJobSetup != aOldJobSetup ) + { + // JobSetup hat sich geaendert (=> App mu\s neu formatieren) + // pDocPrinter->SetOrigJobSetup( aNewJobSetup ); + nChangedFlags |= SFX_PRINTER_JOBSETUP; + } + + // alten, ver"anderten Printer behalten + pDocPrinter->SetPrinterProps( pNewPrinter ); + delete pNewPrinter; + } + + if ( 0 != nChangedFlags ) + // SetPrinter will delete the old printer if it changes + SetPrinter( pDocPrinter, nChangedFlags ); + return pDocPrinter; +} + +//------------------------------------------------------------------------- +// Unter WIN32 tritt leider das Problem auf, dass nichts gedruckt +// wird, wenn SID_PRINTDOCDIRECT auflaueft; bisher bekannte, +// einzige Abhilfe ist in diesem Fall das Abschalten der Optimierungen +// (KA 17.12.95) +#ifdef _MSC_VER +#pragma optimize ( "", off ) +#endif + +void SfxViewShell::ExecPrint( const uno::Sequence < beans::PropertyValue >& rProps, sal_Bool bIsAPI, sal_Bool bIsDirect ) +{ + // get the current selection; our controller should know it + Reference< frame::XController > xController( GetController() ); + Reference< view::XSelectionSupplier > xSupplier( xController, UNO_QUERY ); + + Any aSelection; + if( xSupplier.is() ) + aSelection = xSupplier->getSelection(); + else + aSelection <<= GetObjectShell()->GetModel(); + Any aComplete( makeAny( GetObjectShell()->GetModel() ) ); + Any aViewProp( makeAny( xController ) ); + + boost::shared_ptr<vcl::PrinterController> pController( new SfxPrinterController( aComplete, + aSelection, + aViewProp, + GetRenderable(), + bIsAPI, + bIsDirect, + this, + rProps + ) ); + SfxObjectShell *pObjShell = GetObjectShell(); + pController->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "JobName" ) ), + makeAny( rtl::OUString( pObjShell->GetTitle(0) ) ) ); + + // FIXME: job setup + SfxPrinter* pDocPrt = GetPrinter(FALSE); + JobSetup aJobSetup = pDocPrt ? pDocPrt->GetJobSetup() : GetJobSetup(); + if( bIsDirect ) + aJobSetup.SetValue( String( RTL_CONSTASCII_USTRINGPARAM( "IsQuickJob" ) ), + String( RTL_CONSTASCII_USTRINGPARAM( "true" ) ) ); + + Printer::PrintJob( pController, aJobSetup ); +} + +void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) +{ + // USHORT nCopies=1; + USHORT nDialogRet = RET_CANCEL; + // BOOL bCollate=FALSE; + SfxPrinter* pPrinter = 0; + PrintDialog* pPrintDlg = 0; + SfxDialogExecutor_Impl* pExecutor = 0; + bool bSilent = false; + BOOL bIsAPI = rReq.GetArgs() && rReq.GetArgs()->Count(); + if ( bIsAPI ) + { + SFX_REQUEST_ARG(rReq, pSilentItem, SfxBoolItem, SID_SILENT, FALSE); + bSilent = pSilentItem && pSilentItem->GetValue(); + } + + //FIXME: how to transport "bPrintOnHelp"? + + // no help button in dialogs if called from the help window + // (pressing help button would exchange the current page inside the help document that is going to be printed!) + String aHelpFilterName( DEFINE_CONST_UNICODE("writer_web_HTML_help") ); + SfxMedium* pMedium = GetViewFrame()->GetObjectShell()->GetMedium(); + const SfxFilter* pFilter = pMedium ? pMedium->GetFilter() : NULL; + sal_Bool bPrintOnHelp = ( pFilter && pFilter->GetFilterName() == aHelpFilterName ); + + const USHORT nId = rReq.GetSlot(); + switch( nId ) + { + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + case SID_PRINTDOC: + case SID_PRINTDOCDIRECT: + { + SfxObjectShell* pDoc = GetObjectShell(); + bool bDetectHidden = ( !bSilent && pDoc ); + if ( bDetectHidden && pDoc->QueryHiddenInformation( WhenPrinting, NULL ) != RET_YES ) + break; + + SFX_REQUEST_ARG(rReq, pSelectItem, SfxBoolItem, SID_SELECTION, FALSE); + sal_Bool bSelection = pSelectItem && pSelectItem->GetValue(); + if( pSelectItem && rReq.GetArgs()->Count() == 1 ) + bIsAPI = FALSE; + + uno::Sequence < beans::PropertyValue > aProps; + if ( bIsAPI ) + { + // supported properties: + // String PrinterName + // String FileName + // Int16 From + // Int16 To + // In16 Copies + // String RangeText + // bool Selection + // bool Asynchron + // bool Collate + // bool Silent + 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") ) + { + aProps[nProp]. Name = rtl::OUString::createFromAscii("Wait"); + sal_Bool bAsynchron = sal_False; + aProps[nProp].Value >>= bAsynchron; + aProps[nProp].Value <<= (sal_Bool) (!bAsynchron); + } + if ( aProps[nProp].Name.equalsAscii("Silent") ) + { + aProps[nProp]. Name = rtl::OUString::createFromAscii("MonitorVisible"); + sal_Bool bPrintSilent = sal_False; + aProps[nProp].Value >>= bPrintSilent; + aProps[nProp].Value <<= (sal_Bool) (!bPrintSilent); + } + } + } + sal_Int32 nLen = aProps.getLength(); + aProps.realloc( nLen + 1 ); + aProps[nLen].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintSelectionOnly" ) ); + aProps[nLen].Value = makeAny( bSelection ); + + ExecPrint( aProps, bIsAPI, (nId == SID_PRINTDOCDIRECT) ); + + // FIXME: Recording + rReq.Done(); + break; + } + + case SID_SETUPPRINTER : + case SID_PRINTER_NAME : // only for recorded macros + { + // get printer and printer settings from the document + SfxPrinter *pDocPrinter = GetPrinter(TRUE); + + // look for printer in parameters + SFX_REQUEST_ARG( rReq, pPrinterItem, SfxStringItem, SID_PRINTER_NAME, FALSE ); + if ( pPrinterItem ) + { + // use PrinterName parameter to create a printer + pPrinter = new SfxPrinter( pDocPrinter->GetOptions().Clone(), ((const SfxStringItem*) pPrinterItem)->GetValue() ); + + // if printer is unknown, it can't be used - now printer from document will be used + if ( !pPrinter->IsOriginal() ) + DELETEZ(pPrinter); + } + + if ( SID_PRINTER_NAME == nId ) + { + // just set a recorded printer name + if ( pPrinter ) + SetPrinter( pPrinter, SFX_PRINTER_PRINTER ); + break; + } + + // no PrinterName parameter in ItemSet or the PrinterName points to an unknown printer + if ( !pPrinter ) + // use default printer from document + pPrinter = pDocPrinter; + + if( !pPrinter || !pPrinter->IsValid() ) + { + // no valid printer either in ItemSet or at the document + if ( bSilent ) + { + rReq.SetReturnValue(SfxBoolItem(0,FALSE)); + break; + } + else + 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,FALSE)); + break; + } + + // FIXME: printer isn't used for printing anymore! + if( pPrinter->IsPrinting() ) + { + // if printer is busy, abort printing + if ( !bSilent ) + InfoBox( NULL, String( SfxResId( STR_ERROR_PRINTER_BUSY ) ) ).Execute(); + rReq.SetReturnValue(SfxBoolItem(0,FALSE)); + break; + } + + // if no arguments are given, retrieve them from a dialog + if ( !bIsAPI ) + { + // PrinterDialog needs a temporary printer + SfxPrinter* pDlgPrinter = pPrinter->Clone(); + nDialogRet = 0; + + // execute PrinterSetupDialog + PrinterSetupDialog* pPrintSetupDlg = new PrinterSetupDialog( GetWindow() ); + + if ( pImp->bHasPrintOptions ) + { + // additional controls for dialog + pExecutor = new SfxDialogExecutor_Impl( this, pPrintSetupDlg ); + if ( bPrintOnHelp ) + pExecutor->DisableHelp(); + pPrintSetupDlg->SetOptionsHdl( pExecutor->GetLink() ); + } + + pPrintSetupDlg->SetPrinter( pDlgPrinter ); + nDialogRet = pPrintSetupDlg->Execute(); + + if ( pExecutor && pExecutor->GetOptions() ) + { + if ( nDialogRet == RET_OK ) + // remark: have to be recorded if possible! + pDlgPrinter->SetOptions( *pExecutor->GetOptions() ); + else + { + pPrinter->SetOptions( *pExecutor->GetOptions() ); + SetPrinter( pPrinter, SFX_PRINTER_OPTIONS ); + } + } + + DELETEZ( pPrintSetupDlg ); + + // no recording of PrinterSetup except printer name (is printer dependent) + rReq.Ignore(); + + if ( nDialogRet == RET_OK ) + { + if ( pPrinter->GetName() != pDlgPrinter->GetName() ) + { + // user has changed the printer -> macro recording + SfxRequest aReq( GetViewFrame(), SID_PRINTER_NAME ); + aReq.AppendItem( SfxStringItem( SID_PRINTER_NAME, pDlgPrinter->GetName() ) ); + aReq.Done(); + } + + // take the changes made in the dialog + pPrinter = SetPrinter_Impl( pDlgPrinter ); + + // forget new printer, it was taken over (as pPrinter) or deleted + pDlgPrinter = NULL; + + /* Now lets reset the Dialog printer, since its freed */ + if (pPrintDlg) + pPrintDlg->SetPrinter (pPrinter); + } + else + { + // PrinterDialog is used to transfer information on printing, + // so it will only be deleted here if dialog was cancelled + DELETEZ( pDlgPrinter ); + DELETEZ( pPrintDlg ); + rReq.Ignore(); + if ( SID_PRINTDOC == nId ) + rReq.SetReturnValue(SfxBoolItem(0,FALSE)); + } + } + } + + break; + } +} + +// Optimierungen wieder einschalten +#ifdef _MSC_VER +#pragma optimize ( "", on ) +#endif + +//-------------------------------------------------------------------- + +PrintDialog* SfxViewShell::CreatePrintDialog( Window* /*pParent*/ ) + +/* [Beschreibung] + + Diese Methode kann "uberladen werden, um einen speziellen PrintDialog + zu erzeugen. Dies ist z.B. notwendig wenn spezielle <StarView> Features + wie drucken von Seitenbereichen. +*/ + +{ + #if 0 + PrintDialog *pDlg = new PrintDialog( pParent, false ); + pDlg->SetFirstPage( 1 ); + pDlg->SetLastPage( 9999 ); + pDlg->EnableCollate(); + return pDlg; + #else + return NULL; + #endif +} + +//-------------------------------------------------------------------- + +void SfxViewShell::PreparePrint( PrintDialog * ) +{ +} + +//-------------------------------------------------------------------- + + +ErrCode SfxViewShell::DoPrint( SfxPrinter* /*pPrinter*/, + PrintDialog* /*pPrintDlg*/, + BOOL /*bSilent*/, BOOL /*bIsAPI*/ ) +{ + #if 0 + // Printer-Dialogbox waehrend des Ausdrucks mu\s schon vor + // StartJob erzeugt werden, da SV bei einem Quit-Event h"angt + SfxPrintProgress *pProgress = new SfxPrintProgress( this, !bSilent ); + SfxPrinter *pDocPrinter = GetPrinter(TRUE); + if ( !pPrinter ) + pPrinter = pDocPrinter; + else if ( pDocPrinter != pPrinter ) + { + pProgress->RestoreOnEndPrint( pDocPrinter->Clone() ); + SetPrinter( pPrinter, SFX_PRINTER_PRINTER ); + } + pProgress->SetWaitMode(FALSE); + + // Drucker starten + PreparePrint( pPrintDlg ); + SfxObjectShell *pObjShell = GetViewFrame()->GetObjectShell(); + if ( pPrinter->StartJob(pObjShell->GetTitle(0)) ) + { + // Drucken + Print( *pProgress, bIsAPI, pPrintDlg ); + pProgress->Stop(); + pProgress->DeleteOnEndPrint(); + pPrinter->EndJob(); + } + else + { + // Printer konnte nicht gestartet werden + delete pProgress; + } + + return pPrinter->GetError(); + #else + DBG_ERROR( "DoPrint called, dead code !" ); + return ERRCODE_IO_NOTSUPPORTED; + #endif +} + +//-------------------------------------------------------------------- + +BOOL SfxViewShell::IsPrinterLocked() const +{ + return pImp->nPrinterLocks > 0; +} + +//-------------------------------------------------------------------- + +void SfxViewShell::LockPrinter( BOOL bLock) +{ + BOOL bChanged = FALSE; + if ( bLock ) + bChanged = 1 == ++pImp->nPrinterLocks; + else + bChanged = 0 == --pImp->nPrinterLocks; + + if ( bChanged ) + { + Invalidate( SID_PRINTDOC ); + Invalidate( SID_PRINTDOCDIRECT ); + Invalidate( SID_SETUPPRINTER ); + } +} + +//-------------------------------------------------------------------- + +USHORT SfxViewShell::Print( SfxProgress& /*rProgress*/, BOOL /*bIsAPI*/, PrintDialog* /*pDlg*/ ) +{ + return 0; +} + +//-------------------------------------------------------------------- + +SfxPrinter* SfxViewShell::GetPrinter( BOOL /*bCreate*/ ) +{ + return 0; +} + +//-------------------------------------------------------------------- + +USHORT SfxViewShell::SetPrinter( SfxPrinter* /*pNewPrinter*/, USHORT /*nDiffFlags*/, bool ) +{ + return 0; +} + +//-------------------------------------------------------------------- + +SfxTabPage* SfxViewShell::CreatePrintOptionsPage +( + Window* /*pParent*/, + const SfxItemSet& /*rOptions*/ +) +{ + return 0; +} + +JobSetup SfxViewShell::GetJobSetup() const +{ + return JobSetup(); +} + diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index d1509c9a8d7f..4ee90289347e 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -30,12 +30,12 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" -#include <svtools/stritem.hxx> -#include <svtools/eitem.hxx> -#include <svtools/whiter.hxx> +#include <svl/stritem.hxx> +#include <svl/eitem.hxx> +#include <svl/whiter.hxx> #include <vcl/msgbox.hxx> #include <vcl/toolbox.hxx> -#include <svtools/intitem.hxx> +#include <svl/intitem.hxx> #include <svtools/sfxecode.hxx> #include <svtools/ehdl.hxx> #include <com/sun/star/frame/XLayoutManager.hpp> @@ -55,12 +55,12 @@ #include <vos/mutex.hxx> #include <tools/urlobj.hxx> #include <unotools/tempfile.hxx> -#include <svtools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> #include <svtools/miscopt.hxx> #include <svtools/soerr.hxx> -#include <svtools/internaloptions.hxx> +#include <unotools/internaloptions.hxx> -#include <svtools/javaoptions.hxx> +#include <unotools/javaoptions.hxx> #include <basic/basmgr.hxx> #include <basic/sbuno.hxx> #include <framework/actiontriggerhelper.hxx> |