diff options
Diffstat (limited to 'sfx2/source/appl')
56 files changed, 1523 insertions, 2886 deletions
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx index a632a8fedcfa..b954e9f5e7a9 100644..100755 --- a/sfx2/source/appl/app.cxx +++ b/sfx2/source/appl/app.cxx @@ -41,6 +41,8 @@ #include <tools/simplerm.hxx> #include <tools/config.hxx> #include <basic/basrdll.hxx> +#include <basic/sbmeth.hxx> +#include <basic/sbmod.hxx> #include <svtools/asynclink.hxx> #include <svl/stritem.hxx> #include <vcl/sound.hxx> @@ -75,18 +77,15 @@ #include <comphelper/processfactory.hxx> #include <com/sun/star/uri/XUriReferenceFactory.hpp> #include <com/sun/star/uri/XVndSunStarScriptUrl.hpp> - #include <basic/basmgr.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <vcl/svapp.hxx> - #include <rtl/logfile.hxx> - #include <sfx2/appuno.hxx> -#include "sfxhelp.hxx" +#include "sfx2/sfxhelp.hxx" #include <sfx2/request.hxx> #include "sfxtypes.hxx" -#include "sfxresid.hxx" +#include "sfx2/sfxresid.hxx" #include "arrdecl.hxx" #include <sfx2/progress.hxx> #include <sfx2/objsh.hxx> @@ -112,16 +111,17 @@ #include <sfx2/module.hxx> #include <sfx2/tbxctrl.hxx> #include <sfx2/sfxdlg.hxx> -#include "stbitem.hxx" +#include "sfx2/stbitem.hxx" #include "eventsupplier.hxx" #include <sfx2/dockwin.hxx> +#include <tools/svlibrary.hxx> #ifdef DBG_UTIL #include <sfx2/tbxctrl.hxx> #include <sfx2/mnuitem.hxx> #endif -#if defined( WIN ) || defined( WNT ) || defined( OS2 ) +#if defined( WNT ) || defined( OS2 ) #define DDE_AVAILABLE #endif @@ -226,7 +226,7 @@ void SfxPropertyHandler::Property( ApplicationProperty& rProp ) String aFactory = String::CreateFromAscii("private:factory/"); if ( pArgs && *pArgs ) { - SFX_ITEMSET_ARG( &aSet, pFactoryName, SfxStringItem, SID_NEWDOCDIRECT, FALSE ); + SFX_ITEMSET_ARG( &aSet, pFactoryName, SfxStringItem, SID_NEWDOCDIRECT, sal_False ); if ( pFactoryName ) aFactory += pFactoryName->GetValue(); else @@ -271,7 +271,7 @@ void SfxPropertyHandler::Property( ApplicationProperty& rProp ) #include <framework/imageproducer.hxx> #include <framework/acceleratorinfo.hxx> #include <framework/sfxhelperfunctions.hxx> -#include "imagemgr.hxx" +#include "sfx2/imagemgr.hxx" #include "fwkhelper.hxx" ::osl::Mutex SfxApplication::gMutex; @@ -352,20 +352,15 @@ SfxApplication::SfxApplication() #endif #endif - if ( !InitLabelResMgr( "iso" ) ) - // no "iso" resource -> search for "ooo" resource - InitLabelResMgr( "ooo", true ); pBasic = new BasicDLL; - StarBASIC::SetGlobalErrorHdl( LINK( this, SfxApplication, GlobalBasicErrorHdl_Impl ) ); - - - RTL_LOGFILE_CONTEXT_TRACE( aLog, "} initialize DDE" ); } SfxApplication::~SfxApplication() { + OSL_ENSURE( GetObjectShells_Impl().Count() == 0, "Memory leak: some object shells were not removed!" ); + Broadcast( SfxSimpleHint(SFX_HINT_DYING) ); SfxModule::DestroyModules_Impl(); @@ -466,12 +461,12 @@ void SfxApplication::SetViewFrame_Impl( SfxViewFrame *pFrame ) // DocWinActivate : both frames belong to the same TopWindow // TopWinActivate : both frames belong to different TopWindows - BOOL bTaskActivate = pOldContainerFrame != pNewContainerFrame; + sal_Bool bTaskActivate = pOldContainerFrame != pNewContainerFrame; if ( pOldContainerFrame ) { if ( bTaskActivate ) - NotifyEvent( SfxEventHint( SFX_EVENT_DEACTIVATEDOC, GlobalEventConfig::GetEventName(STR_EVENT_DEACTIVATEDOC), pOldContainerFrame->GetObjectShell() ) ); + NotifyEvent( SfxViewEventHint( SFX_EVENT_DEACTIVATEDOC, GlobalEventConfig::GetEventName(STR_EVENT_DEACTIVATEDOC), pOldContainerFrame->GetObjectShell(), pOldContainerFrame->GetFrame().GetController() ) ); pOldContainerFrame->DoDeactivate( bTaskActivate, pFrame ); if( pOldContainerFrame->GetProgress() ) @@ -486,7 +481,7 @@ void SfxApplication::SetViewFrame_Impl( SfxViewFrame *pFrame ) if ( bTaskActivate && pNewContainerFrame->GetObjectShell() ) { pNewContainerFrame->GetObjectShell()->PostActivateEvent_Impl( pNewContainerFrame ); - NotifyEvent(SfxEventHint(SFX_EVENT_ACTIVATEDOC, GlobalEventConfig::GetEventName(STR_EVENT_ACTIVATEDOC), pNewContainerFrame->GetObjectShell() ) ); + NotifyEvent(SfxViewEventHint(SFX_EVENT_ACTIVATEDOC, GlobalEventConfig::GetEventName(STR_EVENT_ACTIVATEDOC), pNewContainerFrame->GetObjectShell(), pNewContainerFrame->GetFrame().GetController() ) ); } SfxProgress *pProgress = pNewContainerFrame->GetProgress(); @@ -563,13 +558,6 @@ ResMgr* SfxApplication::GetSfxResManager() //-------------------------------------------------------------------- -ResMgr* SfxApplication::GetLabelResManager() const -{ - return pAppData_Impl->pLabelResMgr; -} - -//-------------------------------------------------------------------- - SimpleResMgr* SfxApplication::GetSimpleResManager() { if ( !pAppData_Impl->pSimpleResManager ) @@ -686,7 +674,7 @@ SfxObjectShellArr_Impl& SfxApplication::GetObjectShells_Impl() const return *pAppData_Impl->pObjShells; } -void SfxApplication::Invalidate( USHORT nId ) +void SfxApplication::Invalidate( sal_uInt16 nId ) { for( SfxViewFrame* pFrame = SfxViewFrame::GetFirst(); pFrame; pFrame = SfxViewFrame::GetNext( *pFrame ) ) Invalidate_Impl( pFrame->GetBindings(), nId ); @@ -696,17 +684,15 @@ void SfxApplication::Invalidate( USHORT nId ) #define STRING( x ) DOSTRING( x ) typedef long (SAL_CALL *basicide_handle_basic_error)(void*); -typedef rtl_uString* (SAL_CALL *basicide_choose_macro)(void*, BOOL, rtl_uString*); -typedef void* (SAL_CALL *basicide_macro_organizer)(INT16); +typedef rtl_uString* (SAL_CALL *basicide_choose_macro)(void*, sal_Bool, rtl_uString*); +typedef void* (SAL_CALL *basicide_macro_organizer)(sal_Int16); extern "C" { static void SAL_CALL thisModule() {} } IMPL_LINK( SfxApplication, GlobalBasicErrorHdl_Impl, StarBASIC*, pStarBasic ) { // get basctl dllname - String sLibName = String::CreateFromAscii( STRING( DLL_NAME ) ); - sLibName.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "sfx" ) ), String( RTL_CONSTASCII_USTRINGPARAM( "basctl" ) ) ); - ::rtl::OUString aLibName( sLibName ); + static ::rtl::OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "basctl" ) ) ); // load module oslModule handleMod = osl_loadModuleRelative( @@ -724,7 +710,7 @@ IMPL_LINK( SfxApplication, GlobalBasicErrorHdl_Impl, StarBASIC*, pStarBasic ) sal_Bool SfxApplication::IsXScriptURL( const String& rScriptURL ) { - sal_Bool result = FALSE; + sal_Bool result = sal_False; ::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory > xSMgr = @@ -748,7 +734,7 @@ sal_Bool SfxApplication::IsXScriptURL( const String& rScriptURL ) if ( xUrl.is() ) { - result = TRUE; + result = sal_True; } } catch ( ::com::sun::star::uno::RuntimeException& ) @@ -774,11 +760,11 @@ SfxApplication::ChooseScript() uno::Reference< frame::XFrame > xFrame( pFrame ? pFrame->GetFrameInterface() : uno::Reference< frame::XFrame >() ); AbstractScriptSelectorDialog* pDlg = - pFact->CreateScriptSelectorDialog( NULL, FALSE, xFrame ); + pFact->CreateScriptSelectorDialog( NULL, sal_False, xFrame ); OSL_TRACE("done, now exec it"); - USHORT nRet = pDlg->Execute(); + sal_uInt16 nRet = pDlg->Execute(); OSL_TRACE("has returned"); @@ -792,12 +778,10 @@ SfxApplication::ChooseScript() return aScriptURL; } -void SfxApplication::MacroOrganizer( INT16 nTabId ) +void SfxApplication::MacroOrganizer( sal_Int16 nTabId ) { // get basctl dllname - String sLibName = String::CreateFromAscii( STRING( DLL_NAME ) ); - sLibName.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "sfx" ) ), String( RTL_CONSTASCII_USTRINGPARAM( "basctl" ) ) ); - ::rtl::OUString aLibName( sLibName ); + static ::rtl::OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "basctl" ) ) ); // load module oslModule handleMod = osl_loadModuleRelative( @@ -811,4 +795,9 @@ void SfxApplication::MacroOrganizer( INT16 nTabId ) pSymbol( nTabId ); } +ErrCode SfxApplication::CallBasic( const String& rCode, BasicManager* pMgr, SbxArray* pArgs, SbxValue* pRet ) +{ + return pMgr->ExecuteMacro( rCode, pArgs, pRet); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/app.hrc b/sfx2/source/appl/app.hrc index 6940815f2d83..25e4e4527e37 100644..100755 --- a/sfx2/source/appl/app.hrc +++ b/sfx2/source/appl/app.hrc @@ -32,105 +32,27 @@ // #defines ***************************************************************** #define ACC_IBM (RID_SFX_APP_START+2) -#define MSG_ERR_WRITE_CFG (RID_SFX_APP_START+2) -#define MSG_ERR_READ_CFG (RID_SFX_APP_START+3) -#define MSG_ERR_OPEN_CFG (RID_SFX_APP_START+4) -#define MSG_ERR_FILETYPE_CFG (RID_SFX_APP_START+5) -#define MSG_ERR_VERSION_CFG (RID_SFX_APP_START+6) #define MSG_ERR_NO_WEBBROWSER_FOUND (RID_SFX_APP_START+7) #define MSG_ISPRINTING_QUERYABORT (RID_SFX_APP_START+9) #define MSG_CANT_QUIT (RID_SFX_APP_START+10) #define STR_ISMODIFIED (RID_SFX_APP_START+11) -#define STR_AUTOSAVE (RID_SFX_APP_START+12) -#define STR_MAIL (RID_SFX_APP_START+13) -#define MSG_ERR_WRITE_SBL (RID_SFX_APP_START+14) -#define MSG_IS_SERVER (RID_SFX_APP_START+15) - -#define STR_RESEXCEPTION (RID_SFX_APP_START+21) -#define STR_SYSRESEXCEPTION (RID_SFX_APP_START+22) -#define STR_DOUBLEEXCEPTION (RID_SFX_APP_START+23) -#define STR_RESWARNING (RID_SFX_APP_START+24) -#define STR_ERR_NOTEMPLATE (RID_SFX_APP_START+27) -#define STR_RECOVER_TITLE (RID_SFX_APP_START+28) -#define STR_RECOVER_QUERY (RID_SFX_APP_START+29) -#define STR_RECOVER_PREPARED (RID_SFX_APP_START+30) -#define MSG_ERR_SOINIT (RID_SFX_APP_START+31) - -#define MSG_IOERR_FILE_NOT_FOUND (RID_SFX_APP_START+32) -#define MSG_IOERR_PATH_NOT_FOUND (RID_SFX_APP_START+33) -#define MSG_IOERR_TOO_MANY_OPEN_FILES (RID_SFX_APP_START+34) -#define MSG_IOERR_ACCESS_DENIED (RID_SFX_APP_START+35) -#define MSG_IOERR_INVALID_ACCESS (RID_SFX_APP_START+36) -#define MSG_IOERR_INVALID_HANDLE (RID_SFX_APP_START+37) -#define MSG_IOERR_CANNOT_MAKE (RID_SFX_APP_START+38) -#define MSG_IOERR_SHARING (RID_SFX_APP_START+39) -#define MSG_IOERR_INVALID_PARAMETER (RID_SFX_APP_START+40) -#define MSG_IOERR_GENERAL (RID_SFX_APP_START+41) #define RID_FULLSCREENTOOLBOX (RID_SFX_APP_START+42) #define RID_RECORDINGTOOLBOX (RID_SFX_APP_START+43) #define RID_ENVTOOLBOX (RID_SFX_APP_START+44) #define STR_QUITAPP (RID_SFX_APP_START+59) -#define STR_EXITANDRETURN (RID_SFX_APP_START+60) -#define STR_ERR_NOFILE (RID_SFX_APP_START+61) -#define STR_EXTHELPSTATUS (RID_SFX_APP_START+62) - -#define STR_ADDRESS_NAME (RID_SFX_APP_START+65) #define RID_STR_HLPFILENOTEXIST (RID_SFX_APP_START+68) -#define RID_STR_HLPAPPNOTSTARTED (RID_SFX_APP_START+69) - -#define STR_NODOUBLE (RID_SFX_APP_START+75) -#define STR_NOPRINTER (RID_SFX_APP_START+76) - -#define MSG_SIGNAL (RID_SFX_APP_START+77) #define RID_STR_HELP (RID_SFX_APP_START+79) #define RID_STR_NOAUTOSTARTHELPAGENT (RID_SFX_APP_START+80) #define RID_HELPBAR (RID_SFX_APP_START+81) #define RID_SPECIALCONFIG_ERROR (RID_SFX_APP_START+82) -#define STR_MEMINFO_HEADER (RID_SFX_APP_START+84) -#define STR_MEMINFO_FOOTER (RID_SFX_APP_START+85) -#define STR_MEMINFO_OBJINFO (RID_SFX_APP_START+86) - -#define RID_PLUGIN (RID_SFX_APP_START+87) - -#define RID_WARN_POST_MAILTO (RID_SFX_APP_START+88) - -#define RID_STR_NOWELCOMESCREEN (RID_SFX_APP_START+91) - -#define STR_CORRUPT_INSTALLATION (RID_SFX_APP_START+94) -#define IDS_SBERR_STOREREF (RID_SFX_APP_START+97) - #define CONFIG_PATH_START (RID_SFX_APP_START+98) -#define STR_KEY_ADDINS_PATH (CONFIG_PATH_START+0) -#define STR_KEY_AUTOCORRECT_DIR (CONFIG_PATH_START+1) -#define STR_KEY_GLOSSARY_PATH (CONFIG_PATH_START+2) -#define STR_KEY_BACKUP_PATH (CONFIG_PATH_START+3) -#define STR_KEY_BASIC_PATH (CONFIG_PATH_START+4) -#define STR_KEY_BITMAP_PATH (CONFIG_PATH_START+5) -#define STR_KEY_CONFIG_DIR (CONFIG_PATH_START+6) -#define STR_KEY_DICTIONARY_PATH (CONFIG_PATH_START+7) -#define STR_KEY_FAVORITES_DIR (CONFIG_PATH_START+8) -#define STR_KEY_FILTER_PATH (CONFIG_PATH_START+9) -#define STR_KEY_GALLERY_DIR (CONFIG_PATH_START+10) -#define STR_KEY_GRAPHICS_PATH (CONFIG_PATH_START+11) -#define STR_KEY_HELP_DIR (CONFIG_PATH_START+12) -#define STR_KEY_LINGUISTIC_DIR (CONFIG_PATH_START+13) -#define STR_KEY_MODULES_PATH (CONFIG_PATH_START+14) -#define STR_KEY_PALETTE_PATH (CONFIG_PATH_START+15) -#define STR_KEY_PLUGINS_PATH (CONFIG_PATH_START+16) -#define STR_KEY_STORAGE_DIR (CONFIG_PATH_START+17) -#define STR_KEY_TEMP_PATH (CONFIG_PATH_START+18) -#define STR_KEY_TEMPLATE_PATH (CONFIG_PATH_START+19) -#define STR_KEY_USERCONFIG_PATH (CONFIG_PATH_START+20) -#define STR_KEY_USERDICTIONARY_DIR (CONFIG_PATH_START+21) -#define STR_KEY_WORK_PATH (CONFIG_PATH_START+22) - #define WIN_HELPINDEX (RID_SFX_APP_START+99) #define TP_HELP_CONTENT (RID_SFX_APP_START+100) #define TP_HELP_INDEX (RID_SFX_APP_START+101) @@ -155,11 +77,6 @@ #define IMG_HELP_CONTENT_BOOK_CLOSED (RID_SFX_APP_START+122) #define IMG_HELP_CONTENT_DOC (RID_SFX_APP_START+124) -#define IMG_MISSING_1 (RID_SFX_APP_START+126) // image -#define IMG_MISSING_2 (RID_SFX_APP_START+127) // image -#define IMG_MISSING_3 (RID_SFX_APP_START+128) // image -#define IMG_MISSING_4 (RID_SFX_APP_START+129) // image - #define STR_HELP_WINDOW_TITLE (RID_SFX_APP_START+125) // string #define STR_HELP_BUTTON_INDEX_ON (RID_SFX_APP_START+126) @@ -203,8 +120,6 @@ #define RID_SECURITY_WARNING_HYPERLINK (RID_SFX_APP_START + 180) #define RID_SECURITY_WARNING_TITLE (RID_SFX_APP_START + 181) -#define RID_INVALID_URL_MSG (RID_SFX_APP_START + 182) -#define RID_INVALID_URL_TITLE (RID_SFX_APP_START + 183) #define RID_DESKTOP (RID_SFX_APP_START + 184) #define RID_XMLSEC_QUERY_LOSINGSIGNATURE (RID_SFX_APP_START + 186) diff --git a/sfx2/source/appl/app.src b/sfx2/source/appl/app.src index fa9d65a9fbf0..97dd00a73367 100644..100755 --- a/sfx2/source/appl/app.src +++ b/sfx2/source/appl/app.src @@ -31,63 +31,48 @@ #include "app.hrc" #include "helpid.hrc" -InfoBox RID_DOCALREADYLOADED_DLG +String STR_NONAME { - Message [ en-US ] = "Document already open." ; + Text [ en-US ] = "Untitled" ; }; - -ErrorBox RID_CANTLOADDOC_DLG +String STR_CLOSE { - Message [ en-US ] = "Cannot open document." ; + Text [ en-US ] = "Close" ; }; - -ErrorBox MSG_ERR_READ_CFG +String STR_STYLE_FILTER_AUTO { - BUTTONS = WB_OK ; - DEFBUTTON = WB_DEF_OK ; - Message [ en-US ] = "Error reading configuration file." ; + Text [ en-US ] = "Automatic" ; }; - -ErrorBox MSG_ERR_WRITE_CFG +String STR_STANDARD_SHORTCUT { - BUTTONS = WB_OK ; - DEFBUTTON = WB_DEF_OK ; - Message [ en-US ] = "Error writing configuration file." ; + Text [ en-US ] = "Standard" ; }; - -ErrorBox MSG_ERR_OPEN_CFG +String STR_BYTES { - BUTTONS = WB_OK ; - DEFBUTTON = WB_DEF_OK ; - Message [ en-US ] = "Error opening configuration file." ; + Text [ en-US ] = "Bytes" ; }; - -ErrorBox MSG_ERR_FILETYPE_CFG +String STR_KB { - BUTTONS = WB_OK ; - DEFBUTTON = WB_DEF_OK ; - Message [ en-US ] = "File is not a configuration file." ; + Text [ en-US ] = "KB" ; }; - -ErrorBox MSG_ERR_VERSION_CFG +String STR_MB { - BUTTONS = WB_OK ; - DEFBUTTON = WB_DEF_OK ; - Message [ en-US ] = "Configuration file contains the wrong version." ; + Text [ en-US ] = "MB" ; }; - -ErrorBox MSG_ERR_WRITE_SBL +String STR_GB { - BUTTONS = WB_OK ; - DEFBUTTON = WB_DEF_OK ; - Message [ en-US ] = "Error recording BASIC library in\n'@'." ; + Text [ en-US ] = "GB" ; +}; +QueryBox MSG_QUERY_LASTVERSION +{ + Buttons = WB_YES_NO ; + DefButton = WB_DEF_NO ; + Message [ en-US ] = "Cancel all changes?" ; }; -ErrorBox MSG_SIGNAL +InfoBox RID_DOCALREADYLOADED_DLG { - BUTTONS = WB_YES_NO ; - DEFBUTTON = WB_DEF_YES ; - Message [ en-US ] = "An unexpected program error has occurred.\n\nDo you want to try to save your changes in all open documents before the program is terminated?" ; + Message [ en-US ] = "Document already open." ; }; ErrorBox MSG_ERR_NO_WEBBROWSER_FOUND @@ -102,89 +87,6 @@ Resource SID_UNKNOWN String 1 "-" ; }; -Resource BMP_SFX_COLOR -{ - ExtraData = - { - SID_NEWDOC; // 043 - SID_OPENDOC; // 044 - SID_CLOSEDOC; // 045 - SID_RELOAD; // 046 - SID_SAVEASDOC; // 047 - SID_PRINTDOC; // 051 - SID_SETUPPRINTER; // 053 - SID_QUITAPP; // 054 - SID_UNDO; // 055 - SID_REDO; // 056 - SID_REPEAT; // 057 - SID_CUT; // 058 - SID_COPY; // 059 - SID_PASTE; // 060 - SID_DELETE; // 061 - SID_SELECTALL; // 062 - SID_SAVEDOC; // 063 was 046 - SID_EXITANDRETURN; // 064 was 054 - SID_RECORDMACRO; // 095 - SID_EDITMACRO; // 096 - SID_HELPMENU; // 098 - SID_CONFIG; // 123 - SID_CONFIGTOOLBOX; // 124 - 0; - }; - Bitmap BMP_SFX_SMALL { File = "sco.bmp" ; }; - Bitmap BMP_SFX_LARGE { File = "lco.bmp" ; }; -}; - -Resource BMP_SFX_MONO -{ - ExtraData = - { - SID_NEWDOC; // 043 - SID_OPENDOC; // 044 - SID_CLOSEDOC; // 045 - SID_RELOAD; // 046 - SID_SAVEASDOC; // 047 - SID_PRINTDOC; // 051 - SID_SETUPPRINTER; // 053 - SID_QUITAPP; // 054 - SID_UNDO; // 055 - SID_REDO; // 056 - SID_REPEAT; // 057 - SID_CUT; // 058 - SID_COPY; // 059 - SID_PASTE; // 060 - SID_DELETE; // 061 - SID_SELECTALL; // 062 - SID_SAVEDOC; // 063 was 046 - SID_EXITANDRETURN; // 064 was 054 - SID_RECORDMACRO; // 095 - SID_EDITMACRO; // 096 - SID_HELPMENU; // 098 - SID_CONFIG; // 123 - SID_CONFIGTOOLBOX; // 124 - 0; - }; - Bitmap BMP_SFX_SMALL { File = "smo.bmp" ; }; - Bitmap BMP_SFX_LARGE { File = "lmo.bmp" ; }; -}; - -WarningBox RID_WARN_POST_MAILTO -{ - BUTTONS = WB_OK_CANCEL ; - DEFBUTTON = WB_DEF_OK ; - Message [ en-US ] = "A form is to be sent by e-mail.\nThis means that the receiver will get to see your e-mail address." ; -}; - -String STR_RECOVER_TITLE -{ - Text [ en-US ] = "File Recovery" ; -}; - -String STR_RECOVER_QUERY -{ - Text [ en-US ] = "Should the file \"$1\" be restored?" ; -}; - String GID_INTERN { Text [ en-US ] = "Internal" ; @@ -315,155 +217,16 @@ String GID_CONTROLS Text [ en-US ] = "Controls" ; }; -TabDialog SID_OPTIONS -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 244 , 155 ) ; - Text [ en-US ] = "Options" ; - Moveable = TRUE ; - Closeable = TRUE ; - TabControl 1 - { - SVLook = TRUE ; - Pos = MAP_APPFONT ( 3 , 15 ) ; - Size = MAP_APPFONT ( 221 , 130 ) ; - PageList = - { - PageItem - { - Identifier = RID_SFXPAGE_GENERAL ; - Text [ en-US ] = "General" ; - PageResID = 256 ; - }; - PageItem - { - Identifier = RID_SFXPAGE_SAVE ; - Text [ en-US ] = "Save" ; - PageResID = 257 ; - }; - PageItem - { - Identifier = RID_SFXPAGE_PATH ; - Text [ en-US ] = "Paths" ; - PageResID = 258 ; - }; - PageItem - { - Identifier = RID_SFXPAGE_SPELL ; - Text [ en-US ] = "Spellcheck" ; - PageResID = 259 ; - }; - }; - }; -}; - InfoBox MSG_CANT_QUIT { Message [ en-US ] = "The application cannot be terminated at the moment.\nPlease wait until all print jobs and/or\nOLE actions have finished and close all dialogs." ; }; -QueryBox MSG_IS_SERVER -{ - Buttons = WB_YES_NO ; - DefButton = WB_DEF_NO ; - Message [ en-US ] = "This application is as object or print server active.\nDo you want to terminate anyway?" ; -}; - -String STR_NODOUBLE -{ - Text [ en-US ] = "%PRODUCTNAME cannot be started more than once." ; -}; - -String STR_NOPRINTER -{ - Text [ en-US ] = "Some %PRODUCTNAME functions will not work properly without a printer driver.\nPlease install a printer driver." ; -}; - String STR_ISMODIFIED { Text [ en-US ] = "Do you want to save the changes to %1?" ; }; -String STR_AUTOSAVE -{ - Text [ en-US ] = "AutoSave" ; -}; - -String STR_RESWARNING -{ - Text [ en-US ] = "Limited system resources. Please quit other applications or close some windows before continuing." ; -}; -String STR_RESEXCEPTION -{ - Text [ en-US ] = "There are files missing. Please check application setup." ; -}; - -String STR_DOUBLEEXCEPTION -{ - Text [ en-US ] = "Another error occurred during the save recovery.\nPossibly, the data could not be entirely saved." ; -}; - -String STR_SYSRESEXCEPTION -{ - Text [ en-US ] = "System resources exhausted. Please restart the application." ; -}; - -ErrorBox MSG_ERR_SOINIT -{ - Message [ en-US ] = "Error initializing object-system." ; -}; - -String MSG_IOERR_FILE_NOT_FOUND -{ - Text [ en-US ] = "The file $(FILE) doesn't exist." ; -}; - -String MSG_IOERR_PATH_NOT_FOUND -{ - Text [ en-US ] = "The path to file $(FILE) doesn't exist." ; -}; - -String MSG_IOERR_TOO_MANY_OPEN_FILES -{ - Text [ en-US ] = "The file $(FILE) could not be opened,\nbecause too many files are open.\nPlease close some files and try again." ; -}; - -String MSG_IOERR_ACCESS_DENIED -{ - Text [ en-US ] = "The file $(FILE) could not be opened due to missing access rights." ; -}; - -String MSG_IOERR_INVALID_ACCESS -{ - Text [ en-US ] = "The file $(FILE) could not be accessed." ; -}; - -String MSG_IOERR_INVALID_HANDLE -{ - Text [ en-US ] = "The file $(FILE) could not be opened due to an invalid file handle." ; -}; - -String MSG_IOERR_CANNOT_MAKE -{ - Text [ en-US ] = "The file $(FILE) could not be created." ; -}; - -String MSG_IOERR_SHARING -{ - Text [ en-US ] = "Error by shared access to $(FILE)." ; -}; - -String MSG_IOERR_INVALID_PARAMETER -{ - Text [ en-US ] = "" ; -}; - -String MSG_IOERR_GENERAL -{ - Text [ en-US ] = "General I/O error accessing $(FILE)." ; -}; - String RID_FULLSCREENTOOLBOX { Text = "" ; @@ -499,41 +262,11 @@ ToolBox RID_FULLSCREENTOOLBOX }; }; -String STR_ERR_NOTEMPLATE -{ - Text [ en-US ] = "The selected template has an incorrect format" ; -}; - -String STR_ERR_NOFILE -{ - Text [ en-US ] = "Can't open file $." ; -}; - String STR_QUITAPP { Text [ en-US ] = "E~xit" ; }; -String STR_EXITANDRETURN -{ - Text [ en-US ] = "E~xit & return to " ; -}; - -String STR_EXTHELPSTATUS -{ - Text [ en-US ] = "Select a command or click to select a theme." ; -}; - -String STR_MAIL -{ - Text [ en-US ] = "Mail" ; -}; - -String STR_ADDRESS_NAME -{ - Text [ en-US ] = "Addresses" ; -}; - String RID_STR_HELP { Text [ en-US ] = "Help" ; @@ -544,11 +277,6 @@ String RID_STR_NOAUTOSTARTHELPAGENT Text [ en-US ] = "No automatic start at 'XX'" ; }; -String RID_STR_NOWELCOMESCREEN -{ - Text [ en-US ] = "Don't display tips" ; -}; - String RID_HELPBAR { Text [ en-US ] = "Help Bar" ; @@ -614,11 +342,6 @@ String RID_STR_HLPFILENOTEXIST Text [ en-US ] = "The help file for this topic is not installed." ; }; -String RID_STR_HLPAPPNOTSTARTED -{ - Text [ en-US ] = "The help system could not be started" ; -}; - //---------------------------------------------------------------------------- String RID_ENVTOOLBOX @@ -626,292 +349,11 @@ String RID_ENVTOOLBOX Text [ en-US ] = "Function Bar" ; }; -ToolBox RID_ENVTOOLBOX -{ - HelpId = RID_ENVTOOLBOX ; - ButtonType = BUTTON_SYMBOL ; - LineSpacing = TRUE ; - Border = TRUE ; - Scroll = TRUE ; - SVLook = TRUE ; - Dockable = TRUE ; - Moveable = TRUE ; - Sizeable = TRUE ; - Closeable = TRUE ; - Zoomable = TRUE ; - Customize = TRUE ; - FloatingMode = FALSE ; - Hide = TRUE ; - HideWhenDeactivate = TRUE ; - Align = BOXALIGN_TOP ; - ItemList = - { - ToolBoxItem - { - Identifier = SID_OPENURL ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_NEWDOCDIRECT ; - DropDown = TRUE; - }; - ToolBoxItem - { - Identifier = SID_NEWDOC ; - Hide = TRUE; - }; - ToolBoxItem - { - Identifier = SID_OPENDOC ; - }; - ToolBoxItem - { - Identifier = SID_SAVEDOC ; - }; - ToolBoxItem - { - Identifier = SID_SAVEASDOC ; - Hide = TRUE; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_EDITDOC ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_DIRECTEXPORTDOCASPDF ; - }; - ToolBoxItem - { - Identifier = SID_PRINTDOCDIRECT ; - }; - ToolBoxItem - { - Identifier = FN_FAX ; - Hide = TRUE; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_CUT ; - }; - ToolBoxItem - { - Identifier = SID_COPY ; - }; - ToolBoxItem - { - Identifier = SID_PASTE ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_UNDO ; - }; - ToolBoxItem - { - Identifier = SID_REDO ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_NAVIGATOR ; - }; - ToolBoxItem - { - Identifier = SID_STYLE_DESIGNER ; - }; - ToolBoxItem - { - Identifier = SID_HYPERLINK_DIALOG ; - }; - ToolBoxItem - { - Identifier = SID_WIN_FULLSCREEN ; - Hide = TRUE; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_RECORDMACRO; - Hide = TRUE; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_GALLERY ; - }; - ToolBoxItem - { - Identifier = SID_AVMEDIA_PLAYER ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_CLOSEDOC; - Hide = TRUE; - }; - }; -}; - String RID_SPECIALCONFIG_ERROR { Text [ en-US ] = "An error has occurred in the special configuration.\nPlease contact your administrator." ; }; -String STR_MEMINFO_HEADER -{ -}; - -String STR_MEMINFO_FOOTER -{ - Text = "</table>" ; -}; - -String STR_MEMINFO_OBJINFO -{ - Text = "<tr><td >$(VISIBLE)</td><td>$(CACHED)</td><td>$(EXPIRE)</td><td>$(JSDIRTY)</td><td>$(JSEXEC)</td><td>$(FORBID)</td><td>$(FACTORY)</td><td>$(URL)</td><td>$(ORIGURL)</td><td>$(POSTSTRING)</td></tr>" ; -}; - -String RID_PLUGIN -{ - Text [ en-US ] = "Enable plug-ins" ; -}; - -String STR_CORRUPT_INSTALLATION -{ - Text [ en-US ] = "Important program components could not be initialized correctly.\nPlease start the setup program with the option /Repair." ; -}; - -String IDS_SBERR_STOREREF -{ - Text [ en-US ] = "Reference will not be saved: " ; -}; - -String STR_KEY_CONFIG_DIR -{ - Text [ en-US ] = "Configuration" ; -}; -String STR_KEY_WORK_PATH -{ - Text [ en-US ] = "My Documents" ; -}; -String STR_KEY_GRAPHICS_PATH -{ - Text [ en-US ] = "Graphics" ; -}; -String STR_KEY_BITMAP_PATH -{ - Text [ en-US ] = "Icons" ; -}; -String STR_KEY_BASIC_PATH -{ - Text = "BASIC" ; -}; - -String STR_KEY_PALETTE_PATH -{ - Text [ en-US ] = "Palettes" ; -}; -String STR_KEY_BACKUP_PATH -{ - Text [ en-US ] = "Backups" ; -}; -String STR_KEY_MODULES_PATH -{ - Text [ en-US ] = "Modules" ; -}; -String STR_KEY_TEMPLATE_PATH -{ - Text [ en-US ] = "Templates" ; -}; -String STR_KEY_GLOSSARY_PATH -{ - Text [ en-US ] = "AutoText" ; -}; -String STR_KEY_DICTIONARY_PATH -{ - Text [ en-US ] = "Dictionaries" ; -}; -String STR_KEY_HELP_DIR -{ - Text [ en-US ] = "Help" ; -}; -String STR_KEY_GALLERY_DIR -{ - Text [ en-US ] = "Gallery" ; -}; - -String STR_KEY_STORAGE_DIR -{ - Text [ en-US ] = "Message Storage" ; -}; -String STR_KEY_TEMP_PATH -{ - Text [ en-US ] = "Temporary files" ; -}; -String STR_KEY_PLUGINS_PATH -{ - Text [ en-US ] = "Plug-ins" ; -}; -String STR_KEY_FAVORITES_DIR -{ - Text [ en-US ] = "Folder Bookmarks" ; -}; -String STR_KEY_FILTER_PATH -{ - Text [ en-US ] = "Filters" ; -}; -String STR_KEY_ADDINS_PATH -{ - Text [ en-US ] = "Add-ins" ; -}; -String STR_KEY_USERCONFIG_PATH -{ - Text [ en-US ] = "User Configuration" ; -}; -String STR_KEY_USERDICTIONARY_DIR -{ - Text [ en-US ] = "User-defined dictionaries" ; -}; -String STR_KEY_AUTOCORRECT_DIR -{ - Text [ en-US ] = "AutoCorrect" ; -}; -String STR_KEY_LINGUISTIC_DIR -{ - Text [ en-US ] = "Writing aids" ; -}; String STR_QUICKSTART_EXIT { Text [ en-US ] = "Exit Quickstarter" ; @@ -986,17 +428,6 @@ String RID_SECURITY_WARNING_TITLE Text [ en-US ] = "Security Warning" ; }; -ErrorBox RID_INVALID_URL_MSG -{ - Buttons = WB_OK ; - Message [ en-US ] = "The URL is not valid." ; -}; - -String RID_INVALID_URL_TITLE -{ - Text = "%PRODUCTNAME %PRODUCTVERSION" ; -}; - String RID_DESKTOP { Text = "%PRODUCTNAME" ; @@ -1029,39 +460,37 @@ String RID_XMLSEC_DOCUMENTSIGNED Text [ en-US ] = " (Signed)" ; }; -Image IMG_MISSING_1 -{ - ImageBitmap = Bitmap { File = "sc05539.bmp" ; }; -}; - -Image IMG_MISSING_2 -{ - ImageBitmap = Bitmap { File = "sc05700.bmp" ; }; -}; - -Image IMG_MISSING_3 +String STR_STANDARD { - ImageBitmap = Bitmap { File = "sc06302.bmp" ; }; + Text [ en-US ] = "Standard" ; }; -Image IMG_MISSING_4 +String RID_SVXSTR_FILELINK { - ImageBitmap = Bitmap { File = "sn064.bmp" ; }; + Text [ en-US ] = "Document" ; }; -String RID_SVXSTR_FILELINK +String STR_NONE { - Text [ en-US ] = "Document" ; + Text [ en-US ] = "- None -" ; }; String RID_SVXSTR_GRAFIKLINK { Text [ en-US ] = "Graphic" ; }; +String STR_SFX_FILTERNAME_ALL +{ + Text [ en-US ] = "All files (*.*)" ; +}; String RID_SVXSTR_EDITGRFLINK { Text [ en-US ] = "Link graphics" ; }; - +// i66948 used in project scripting +String STR_ERRUNOEVENTBINDUNG +{ + Text [ en-US ] = "An appropriate component method %1\ncould not be found.\n\nCheck spelling of method name."; +}; String RID_SVXSTR_GRFILTER_OPENERROR { Text [ en-US ] = "Graphics file cannot be opened" ; diff --git a/sfx2/source/appl/appbas.cxx b/sfx2/source/appl/appbas.cxx index 5ff2f321d371..a776e09d1f74 100644..100755 --- a/sfx2/source/appl/appbas.cxx +++ b/sfx2/source/appl/appbas.cxx @@ -61,7 +61,7 @@ #include "arrdecl.hxx" #include <sfx2/app.hxx> #include "sfxtypes.hxx" -#include "sfxresid.hxx" +#include "sfx2/sfxresid.hxx" #include <sfx2/msg.hxx> #include <sfx2/msgpool.hxx> #include <sfx2/progress.hxx> @@ -70,17 +70,16 @@ #include <sfx2/viewfrm.hxx> #include <sfx2/viewsh.hxx> #include <sfx2/dispatch.hxx> -#include "tplpitem.hxx" -#include "minfitem.hxx" +#include "sfx2/tplpitem.hxx" +#include "sfx2/minfitem.hxx" #include "app.hrc" #include <sfx2/evntconf.hxx> -#include <sfx2/macrconf.hxx> #include <sfx2/request.hxx> #include <sfx2/dinfdlg.hxx> #include "appdata.hxx" #include "appbas.hxx" -#include "sfxhelp.hxx" -#include "basmgr.hxx" +#include "sfx2/sfxhelp.hxx" +#include "sfx2/basmgr.hxx" #include "sorgitm.hxx" #include "appbaslib.hxx" #include <basic/basicmanagerrepository.hxx> @@ -147,10 +146,6 @@ SbxVariable* MakeVariable( StarBASIC *pBas, SbxObject *pObject, BasicManager* SfxApplication::GetBasicManager() { - if ( pAppData_Impl->nBasicCallLevel == 0 ) - // precaution - EnterBasicCall(); - return BasicManagerRepository::getApplicationBasicManager( true ); } @@ -179,33 +174,6 @@ StarBASIC* SfxApplication::GetBasic() return GetBasicManager()->GetLib(0); } -//-------------------------------------------------------------------- - -bool SfxApplication::IsInBasicCall() const -{ - return 0 != pAppData_Impl->nBasicCallLevel; -} - -//-------------------------------------------------------------------- - -void SfxApplication::EnterBasicCall() -{ - if ( 1 == ++pAppData_Impl->nBasicCallLevel ) - { - OSL_TRACE( "SfxShellObject: BASIC-on-demand" ); - - // First load the BASIC - GetBasic(); - } -} - -//-------------------------------------------------------------------- - -void SfxApplication::LeaveBasicCall() -{ - --pAppData_Impl->nBasicCallLevel; -} - //------------------------------------------------------------------------- void SfxApplication::PropExec_Impl( SfxRequest &rReq ) { @@ -253,10 +221,6 @@ void SfxApplication::PropExec_Impl( SfxRequest &rReq ) break; } - case SID_PLAYMACRO: - PlayMacro_Impl( rReq, GetBasic() ); - break; - case SID_OFFICE_PRIVATE_USE: case SID_OFFICE_COMMERCIAL_USE: { @@ -300,27 +264,13 @@ void SfxApplication::PropState_Impl( SfxItemSet &rSet ) break; case SID_ATTR_UNDO_COUNT: - rSet.Put( SfxUInt16Item( SID_ATTR_UNDO_COUNT, sal::static_int_cast< UINT16 >( SvtUndoOptions().GetUndoCount() ) ) ); + rSet.Put( SfxUInt16Item( SID_ATTR_UNDO_COUNT, sal::static_int_cast< sal_uInt16 >( SvtUndoOptions().GetUndoCount() ) ) ); break; case SID_UPDATE_VERSION: rSet.Put( SfxUInt32Item( SID_UPDATE_VERSION, SUPD ) ); break; - case SID_BUILD_VERSION: - { - String aVersion = lcl_GetVersionString(); - rSet.Put( SfxUInt32Item( SID_BUILD_VERSION, (sal_uInt32) aVersion.ToInt32() ) ); - break; - } - - case SID_OFFICE_PRIVATE_USE: - case SID_OFFICE_COMMERCIAL_USE: - { - DBG_ASSERT( sal_False, "SfxApplication::PropState_Impl()\nSID_OFFICE_PRIVATE_USE & SID_OFFICE_COMMERCIAL_USE are obsolete!\n" ); - break; - } - case SID_OFFICE_CUSTOMERNUMBER: { rSet.Put( SfxStringItem( nSID, SvtUserOptions().GetCustomerNumber() ) ); @@ -330,69 +280,4 @@ void SfxApplication::PropState_Impl( SfxItemSet &rSet ) } } -//-------------------------------------------------------------------- -void SfxApplication::MacroExec_Impl( SfxRequest& rReq ) -{ - DBG_MEMTEST(); - if ( SfxMacroConfig::IsMacroSlot( rReq.GetSlot() ) ) - { - // Create reference to SlotId, so that the excecute in the slot - // is not cancelled. - GetMacroConfig()->RegisterSlotId(rReq.GetSlot()); - SFX_REQUEST_ARG(rReq, pArgs, SfxStringItem, - rReq.GetSlot(), sal_False); - String aArgs; - if( pArgs ) aArgs = pArgs->GetValue(); - if ( GetMacroConfig()->ExecuteMacro(rReq.GetSlot(), aArgs ) ) - rReq.Done(); - GetMacroConfig()->ReleaseSlotId(rReq.GetSlot()); - } -} - -//-------------------------------------------------------------------- -void SfxApplication::MacroState_Impl( SfxItemSet& ) -{ - DBG_MEMTEST(); -} - -//------------------------------------------------------------------------- - -void SfxApplication::PlayMacro_Impl( SfxRequest &rReq, StarBASIC *pBasic ) -{ - EnterBasicCall(); - sal_Bool bOK = sal_False; - - // Makro and asynch-Flag - SFX_REQUEST_ARG(rReq,pMacro,SfxStringItem,SID_STATEMENT,sal_False); - SFX_REQUEST_ARG(rReq,pAsynch,SfxBoolItem,SID_ASYNCHRON,sal_False); - - if ( pAsynch && pAsynch->GetValue() ) - { - // run asynchronously - GetDispatcher_Impl()->Execute( SID_PLAYMACRO, SFX_CALLMODE_ASYNCHRON, pMacro, 0L ); - rReq.Done(); - } - else if ( pMacro ) - { - // Process statement - DBG_ASSERT( pBasic, "no BASIC found" ) ; - String aStatement( '[' ); - aStatement += pMacro->GetValue(); - aStatement += ']'; - - // Finish the request preventatively because it maybe destroyed - rReq.Done(); - rReq.ReleaseArgs(); - - // Process statement - pBasic->Execute( aStatement ); - bOK = 0 == SbxBase::GetError(); - SbxBase::ResetError(); - } - - LeaveBasicCall(); - rReq.SetReturnValue(SfxBoolItem(0,bOK)); -} - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/appbaslib.cxx b/sfx2/source/appl/appbaslib.cxx index 01fe6536d683..eb2c43a27dd3 100644..100755 --- a/sfx2/source/appl/appbaslib.cxx +++ b/sfx2/source/appl/appbaslib.cxx @@ -26,6 +26,9 @@ * ************************************************************************/ +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_sfx2.hxx" + #include "appbaslib.hxx" #include <sfx2/sfxuno.hxx> diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx index 48b76959a18a..8387c5854b73 100644..100755 --- a/sfx2/source/appl/appcfg.cxx +++ b/sfx2/source/appl/appcfg.cxx @@ -75,7 +75,7 @@ #include <sfx2/app.hxx> #include <sfx2/docfile.hxx> #include <sfx2/viewfrm.hxx> -#include "sfxhelp.hxx" +#include "sfx2/sfxhelp.hxx" #include "sfxtypes.hxx" #include <sfx2/dispatch.hxx> #include <sfx2/objsh.hxx> @@ -85,10 +85,9 @@ #include <sfx2/evntconf.hxx> #include "appdata.hxx" #include "workwin.hxx" -#include <sfx2/macrconf.hxx> #include "helper.hxx" // SfxContentHelper::... #include "app.hrc" -#include "sfxresid.hxx" +#include "sfx2/sfxresid.hxx" #include "shutdownicon.hxx" using namespace ::com::sun::star::uno; @@ -168,13 +167,13 @@ IMPL_LINK(SfxEventAsyncer_Impl, TimerHdl, Timer*, pAsyncTimer) //-------------------------------------------------------------------- -BOOL SfxApplication::GetOptions( SfxItemSet& rSet ) +sal_Bool SfxApplication::GetOptions( SfxItemSet& rSet ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; SfxItemPool &rPool = GetPool(); - String aTRUEStr('1'); + String asal_TrueStr('1'); - const USHORT *pRanges = rSet.GetRanges(); + const sal_uInt16 *pRanges = rSet.GetRanges(); SvtSaveOptions aSaveOptions; SvtUndoOptions aUndoOptions; SvtHelpOptions aHelpOptions; @@ -184,91 +183,91 @@ BOOL SfxApplication::GetOptions( SfxItemSet& rSet ) while ( *pRanges ) { - for(USHORT nWhich = *pRanges++; nWhich <= *pRanges; ++nWhich) + for(sal_uInt16 nWhich = *pRanges++; nWhich <= *pRanges; ++nWhich) { switch(nWhich) { case SID_ATTR_BUTTON_OUTSTYLE3D : if(rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_BUTTON_OUTSTYLE3D ), aMiscOptions.GetToolboxStyle() != TOOLBOX_STYLE_FLAT))) - bRet = TRUE; + bRet = sal_True; break; case SID_ATTR_BUTTON_BIGSIZE : { if( rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_BUTTON_BIGSIZE ), aMiscOptions.AreCurrentSymbolsLarge() ) ) ) - bRet = TRUE; + bRet = sal_True; break; } case SID_ATTR_BACKUP : { - bRet = TRUE; + bRet = sal_True; if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_BACKUP)) if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_BACKUP ),aSaveOptions.IsBackup()))) - bRet = FALSE; + bRet = sal_False; } break; case SID_ATTR_PRETTYPRINTING: { - bRet = TRUE; + bRet = sal_True; if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_DOPRETTYPRINTING)) if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_PRETTYPRINTING ), aSaveOptions.IsPrettyPrinting()))) - bRet = FALSE; + bRet = sal_False; } break; case SID_ATTR_WARNALIENFORMAT: { - bRet = TRUE; + bRet = sal_True; if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_WARNALIENFORMAT)) if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_WARNALIENFORMAT ), aSaveOptions.IsWarnAlienFormat()))) - bRet = FALSE; + bRet = sal_False; } break; case SID_ATTR_AUTOSAVE : { - bRet = TRUE; + bRet = sal_True; if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_AUTOSAVE)) if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_AUTOSAVE ), aSaveOptions.IsAutoSave()))) - bRet = FALSE; + bRet = sal_False; } break; case SID_ATTR_AUTOSAVEPROMPT : { - bRet = TRUE; + bRet = sal_True; if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_AUTOSAVEPROMPT)) if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_AUTOSAVEPROMPT ), aSaveOptions.IsAutoSavePrompt()))) - bRet = FALSE; + bRet = sal_False; } break; case SID_ATTR_AUTOSAVEMINUTE : { - bRet = TRUE; + bRet = sal_True; if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_AUTOSAVETIME)) - if (!rSet.Put( SfxUInt16Item( rPool.GetWhich( SID_ATTR_AUTOSAVEMINUTE ), (UINT16)aSaveOptions.GetAutoSaveTime()))) - bRet = FALSE; + if (!rSet.Put( SfxUInt16Item( rPool.GetWhich( SID_ATTR_AUTOSAVEMINUTE ), (sal_uInt16)aSaveOptions.GetAutoSaveTime()))) + bRet = sal_False; } break; case SID_ATTR_DOCINFO : { - bRet = TRUE; + bRet = sal_True; if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_DOCINFSAVE)) if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_DOCINFO ), aSaveOptions.IsDocInfoSave()))) - bRet = FALSE; + bRet = sal_False; } break; case SID_ATTR_WORKINGSET : { - bRet = TRUE; + bRet = sal_True; if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_SAVEWORKINGSET)) if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_WORKINGSET ), aSaveOptions.IsSaveWorkingSet()))) - bRet = FALSE; + bRet = sal_False; } break; case SID_ATTR_SAVEDOCVIEW : { - bRet = TRUE; + bRet = sal_True; if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_SAVEDOCVIEW)) if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_SAVEDOCVIEW ), aSaveOptions.IsSaveDocView()))) - bRet = FALSE; + bRet = sal_False; } break; case SID_ATTR_METRIC : @@ -276,37 +275,37 @@ BOOL SfxApplication::GetOptions( SfxItemSet& rSet ) case SID_HELPBALLOONS : if(rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_HELPBALLOONS ), aHelpOptions.IsExtendedHelp() ) ) ) - bRet = TRUE; + bRet = sal_True; break; case SID_HELPTIPS : if(rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_HELPTIPS ), aHelpOptions.IsHelpTips() ) ) ) - bRet = TRUE; + bRet = sal_True; break; case SID_ATTR_AUTOHELPAGENT : if(rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_ATTR_AUTOHELPAGENT ), aHelpOptions.IsHelpAgentAutoStartMode() ) ) ) - bRet = TRUE; + bRet = sal_True; break; case SID_HELPAGENT_TIMEOUT : if ( rSet.Put( SfxInt32Item( rPool.GetWhich( SID_HELPAGENT_TIMEOUT ), aHelpOptions.GetHelpAgentTimeoutPeriod() ) ) ) - bRet = TRUE; + bRet = sal_True; break; case SID_ATTR_WELCOMESCREEN : if(rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_ATTR_WELCOMESCREEN ), aHelpOptions.IsWelcomeScreen() ) ) ) - bRet = TRUE; + bRet = sal_True; break; case SID_HELP_STYLESHEET : if(rSet.Put( SfxStringItem ( rPool.GetWhich( SID_HELP_STYLESHEET ), aHelpOptions.GetHelpStyleSheet() ) ) ) - bRet = TRUE; + bRet = sal_True; break; case SID_ATTR_UNDO_COUNT : if(rSet.Put( SfxUInt16Item ( rPool.GetWhich( SID_ATTR_UNDO_COUNT ), - (UINT16)aUndoOptions.GetUndoCount() ) ) ) - bRet = TRUE; + (sal_uInt16)aUndoOptions.GetUndoCount() ) ) ) + bRet = sal_True; break; case SID_ATTR_QUICKLAUNCHER : { @@ -314,74 +313,74 @@ BOOL SfxApplication::GetOptions( SfxItemSet& rSet ) { if ( rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_QUICKLAUNCHER ), ShutdownIcon::GetAutostart() ) ) ) - bRet = TRUE; + bRet = sal_True; } else { rSet.DisableItem( rPool.GetWhich( SID_ATTR_QUICKLAUNCHER ) ); - bRet = TRUE; + bRet = sal_True; } break; } case SID_SAVEREL_INET : { - bRet = TRUE; + bRet = sal_True; if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_SAVERELINET)) if (!rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_SAVEREL_INET ), aSaveOptions.IsSaveRelINet() ))) - bRet = FALSE; + bRet = sal_False; } break; case SID_SAVEREL_FSYS : { - bRet = TRUE; + bRet = sal_True; if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_SAVERELFSYS)) if (!rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_SAVEREL_FSYS ), aSaveOptions.IsSaveRelFSys() ))) - bRet = FALSE; + bRet = sal_False; } break; case SID_BASIC_ENABLED : { - bRet = TRUE; + bRet = sal_True; if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::E_BASICMODE)) { - if ( !rSet.Put( SfxUInt16Item( rPool.GetWhich( SID_BASIC_ENABLED ), sal::static_int_cast< UINT16 >(aSecurityOptions.GetBasicMode())))) - bRet = FALSE; + if ( !rSet.Put( SfxUInt16Item( rPool.GetWhich( SID_BASIC_ENABLED ), sal::static_int_cast< sal_uInt16 >(aSecurityOptions.GetBasicMode())))) + bRet = sal_False; } } break; case SID_INET_EXE_PLUGIN : { - bRet = TRUE; + bRet = sal_True; if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::E_EXECUTEPLUGINS)) { if ( !rSet.Put( SfxBoolItem( SID_INET_EXE_PLUGIN, aSecurityOptions.IsExecutePlugins() ) ) ) - bRet = FALSE; + bRet = sal_False; } } break; case SID_MACRO_WARNING : { - bRet = TRUE; + bRet = sal_True; if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::E_WARNING)) { if ( !rSet.Put( SfxBoolItem( SID_MACRO_WARNING, aSecurityOptions.IsWarningEnabled() ) ) ) - bRet = FALSE; + bRet = sal_False; } } break; case SID_MACRO_CONFIRMATION : { - bRet = TRUE; + bRet = sal_True; if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::E_CONFIRMATION)) { if ( !rSet.Put( SfxBoolItem( SID_MACRO_CONFIRMATION, aSecurityOptions.IsConfirmationEnabled() ) ) ) - bRet = FALSE; + bRet = sal_False; } } break; case SID_SECURE_URL : { - bRet = TRUE; + bRet = sal_True; if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::E_SECUREURLS)) { ::com::sun::star::uno::Sequence< ::rtl::OUString > seqURLs = aSecurityOptions.GetSecureURLs(); @@ -395,7 +394,7 @@ BOOL SfxApplication::GetOptions( SfxItemSet& rSet ) if( !rSet.Put( SfxStringListItem( rPool.GetWhich(SID_SECURE_URL), &aList ) ) ) { - bRet = FALSE; + bRet = sal_False; } for( nURL=0; nURL<nCount; ++nURL ) { @@ -413,31 +412,31 @@ BOOL SfxApplication::GetOptions( SfxItemSet& rSet ) case SID_INET_PROXY_TYPE : { if( rSet.Put( SfxUInt16Item ( rPool.GetWhich( SID_INET_PROXY_TYPE ), - (UINT16)aInetOptions.GetProxyType() ))) - bRet = TRUE; + (sal_uInt16)aInetOptions.GetProxyType() ))) + bRet = sal_True; break; } case SID_INET_HTTP_PROXY_NAME : { if ( rSet.Put( SfxStringItem ( rPool.GetWhich(SID_INET_HTTP_PROXY_NAME ), aInetOptions.GetProxyHttpName() ))) - bRet = TRUE; + bRet = sal_True; break; } case SID_INET_HTTP_PROXY_PORT : if ( rSet.Put( SfxInt32Item( rPool.GetWhich(SID_INET_HTTP_PROXY_PORT ), aInetOptions.GetProxyHttpPort() ))) - bRet = TRUE; + bRet = sal_True; break; case SID_INET_FTP_PROXY_NAME : if ( rSet.Put( SfxStringItem ( rPool.GetWhich(SID_INET_FTP_PROXY_NAME ), aInetOptions.GetProxyFtpName() ))) - bRet = TRUE; + bRet = sal_True; break; case SID_INET_FTP_PROXY_PORT : if ( rSet.Put( SfxInt32Item ( rPool.GetWhich(SID_INET_FTP_PROXY_PORT ), aInetOptions.GetProxyFtpPort() ))) - bRet = TRUE; + bRet = sal_True; break; case SID_INET_SECURITY_PROXY_NAME : case SID_INET_SECURITY_PROXY_PORT : @@ -448,7 +447,7 @@ BOOL SfxApplication::GetOptions( SfxItemSet& rSet ) case SID_INET_NOPROXY : if( rSet.Put( SfxStringItem ( rPool.GetWhich( SID_INET_NOPROXY), aInetOptions.GetProxyNoProxy() ))) - bRet = TRUE; + bRet = sal_True; break; case SID_ATTR_PATHNAME : case SID_ATTR_PATHGROUP : @@ -456,7 +455,7 @@ BOOL SfxApplication::GetOptions( SfxItemSet& rSet ) SfxAllEnumItem aNames(rPool.GetWhich(SID_ATTR_PATHGROUP)); SfxAllEnumItem aValues(rPool.GetWhich(SID_ATTR_PATHNAME)); SvtPathOptions aPathCfg; - for ( USHORT nProp = SvtPathOptions::PATH_ADDIN; + for ( sal_uInt16 nProp = SvtPathOptions::PATH_ADDIN; nProp <= SvtPathOptions::PATH_WORK; nProp++ ) { const String aName( SfxResId( CONFIG_PATH_START + nProp ) ); @@ -491,7 +490,7 @@ BOOL SfxApplication::GetOptions( SfxItemSet& rSet ) } if ( rSet.Put(aNames) || rSet.Put(aValues) ) - bRet = TRUE; + bRet = sal_True; } default: @@ -510,7 +509,7 @@ BOOL SfxApplication::GetOptions( SfxItemSet& rSet ) } //-------------------------------------------------------------------- -BOOL SfxApplication::IsSecureURL( const INetURLObject& rURL, const String* pReferer ) const +sal_Bool SfxApplication::IsSecureURL( const INetURLObject& rURL, const String* pReferer ) const { return SvtSecurityOptions().IsSecureURL( rURL.GetMainURL( INetURLObject::NO_DECODE ), *pReferer ); } @@ -520,7 +519,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) { const SfxPoolItem *pItem = 0; SfxItemPool &rPool = GetPool(); - BOOL bResetSession = FALSE; + sal_Bool bResetSession = sal_False; SvtSaveOptions aSaveOptions; SvtUndoOptions aUndoOptions; @@ -529,18 +528,18 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) SvtPathOptions aPathOptions; SvtInetOptions aInetOptions; SvtMiscOptions aMiscOptions; - if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_BUTTON_OUTSTYLE3D), TRUE, &pItem) ) + if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_BUTTON_OUTSTYLE3D), sal_True, &pItem) ) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - USHORT nOutStyle = + sal_uInt16 nOutStyle = ( (const SfxBoolItem *)pItem)->GetValue() ? 0 : TOOLBOX_STYLE_FLAT; aMiscOptions.SetToolboxStyle( nOutStyle ); } - if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_BUTTON_BIGSIZE), TRUE, &pItem) ) + if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_BUTTON_BIGSIZE), sal_True, &pItem) ) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - BOOL bBigSize = ( (const SfxBoolItem*)pItem )->GetValue(); + sal_Bool bBigSize = ( (const SfxBoolItem*)pItem )->GetValue(); aMiscOptions.SetSymbolsSize( sal::static_int_cast< sal_Int16 >( bBigSize ? SFX_SYMBOLS_SIZE_LARGE : SFX_SYMBOLS_SIZE_SMALL ) ); @@ -555,144 +554,144 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) } // Backup - if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_BACKUP), TRUE, &pItem) ) + if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_BACKUP), sal_True, &pItem) ) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); aSaveOptions.SetBackup( ( (const SfxBoolItem*)pItem )->GetValue() ); } // PrettyPrinting - if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_ATTR_PRETTYPRINTING ), TRUE, &pItem ) ) + if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_ATTR_PRETTYPRINTING ), sal_True, &pItem ) ) { DBG_ASSERT( pItem->ISA( SfxBoolItem ), "BoolItem expected" ); aSaveOptions.SetPrettyPrinting( static_cast< const SfxBoolItem*> ( pItem )->GetValue() ); } // WarnAlienFormat - if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_ATTR_WARNALIENFORMAT ), TRUE, &pItem ) ) + if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_ATTR_WARNALIENFORMAT ), sal_True, &pItem ) ) { DBG_ASSERT( pItem->ISA( SfxBoolItem ), "BoolItem expected" ); aSaveOptions.SetWarnAlienFormat( static_cast< const SfxBoolItem*> ( pItem )->GetValue() ); } // AutoSave - if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOSAVE), TRUE, &pItem)) + if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOSAVE), sal_True, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); aSaveOptions.SetAutoSave( ( (const SfxBoolItem*)pItem )->GetValue() ); } // AutoSave-Propt - if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOSAVEPROMPT), TRUE, &pItem)) + if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOSAVEPROMPT), sal_True, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); aSaveOptions.SetAutoSavePrompt(((const SfxBoolItem *)pItem)->GetValue()); } // AutoSave-Time - if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOSAVEMINUTE), TRUE, &pItem)) + if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOSAVEMINUTE), sal_True, &pItem)) { DBG_ASSERT(pItem->ISA(SfxUInt16Item), "UInt16Item expected"); aSaveOptions.SetAutoSaveTime(((const SfxUInt16Item *)pItem)->GetValue()); } // DocInfo - if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_DOCINFO), TRUE, &pItem)) + if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_DOCINFO), sal_True, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); aSaveOptions.SetDocInfoSave(((const SfxBoolItem *)pItem)->GetValue()); } // Mark open Documents - if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_WORKINGSET), TRUE, &pItem)) + if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_WORKINGSET), sal_True, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); aSaveOptions.SetSaveWorkingSet(((const SfxBoolItem *)pItem)->GetValue()); } // Save window settings - if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_SAVEDOCVIEW), TRUE, &pItem)) + if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_SAVEDOCVIEW), sal_True, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); aSaveOptions.SetSaveDocView(((const SfxBoolItem *)pItem)->GetValue()); } // Metric - if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_METRIC), TRUE, &pItem)) + if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_METRIC), sal_True, &pItem)) { DBG_ASSERT(pItem->ISA(SfxUInt16Item), "UInt16Item expected"); } // HelpBalloons - if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_HELPBALLOONS), TRUE, &pItem)) + if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_HELPBALLOONS), sal_True, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); aHelpOptions.SetExtendedHelp(((const SfxBoolItem *)pItem)->GetValue()); } // HelpTips - if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_HELPTIPS), TRUE, &pItem)) + if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_HELPTIPS), sal_True, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); aHelpOptions.SetHelpTips(((const SfxBoolItem *)pItem)->GetValue()); } // AutoHelpAgent - if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOHELPAGENT ), TRUE, &pItem)) + if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOHELPAGENT ), sal_True, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); aHelpOptions.SetHelpAgentAutoStartMode( ((const SfxBoolItem *)pItem)->GetValue() ); } // help agent timeout - if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_HELPAGENT_TIMEOUT ), TRUE, &pItem ) ) + if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_HELPAGENT_TIMEOUT ), sal_True, &pItem ) ) { DBG_ASSERT(pItem->ISA(SfxInt32Item), "Int32Item expected"); aHelpOptions.SetHelpAgentTimeoutPeriod( ( (const SfxInt32Item*)pItem )->GetValue() ); } // WelcomeScreen - if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_WELCOMESCREEN ), TRUE, &pItem)) + if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_WELCOMESCREEN ), sal_True, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); aHelpOptions.SetWelcomeScreen( ((const SfxBoolItem *)pItem)->GetValue() ); } // WelcomeScreen - if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_WELCOMESCREEN_RESET ), TRUE, &pItem)) + if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_WELCOMESCREEN_RESET ), sal_True, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - BOOL bReset = ((const SfxBoolItem *)pItem)->GetValue(); + sal_Bool bReset = ((const SfxBoolItem *)pItem)->GetValue(); if ( bReset ) { OSL_FAIL( "Not implemented, may be EOL!" ); } } - if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_HELP_STYLESHEET ), TRUE, &pItem)) + if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_HELP_STYLESHEET ), sal_True, &pItem)) { DBG_ASSERT(pItem->ISA(SfxStringItem), "StringItem expected"); aHelpOptions.SetHelpStyleSheet( ((const SfxStringItem *)pItem)->GetValue() ); } // SaveRelINet - if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_SAVEREL_INET), TRUE, &pItem)) + if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_SAVEREL_INET), sal_True, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); aSaveOptions.SetSaveRelINet(((const SfxBoolItem *)pItem)->GetValue()); } // SaveRelFSys - if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_SAVEREL_FSYS), TRUE, &pItem)) + if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_SAVEREL_FSYS), sal_True, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); aSaveOptions.SetSaveRelFSys(((const SfxBoolItem *)pItem)->GetValue()); } // Undo-Count - if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_UNDO_COUNT), TRUE, &pItem)) + if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_UNDO_COUNT), sal_True, &pItem)) { DBG_ASSERT(pItem->ISA(SfxUInt16Item), "UInt16Item expected"); - USHORT nUndoCount = ((const SfxUInt16Item*)pItem)->GetValue(); + sal_uInt16 nUndoCount = ((const SfxUInt16Item*)pItem)->GetValue(); aUndoOptions.SetUndoCount( nUndoCount ); // To catch all Undo-Managers: Iterate over all Frames @@ -705,12 +704,12 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) pDispat->Flush(); // Iterate over all SfxShells on the Dispatchers Stack - USHORT nIdx = 0; + sal_uInt16 nIdx = 0; for ( SfxShell *pSh = pDispat->GetShell(nIdx); pSh; ++nIdx, pSh = pDispat->GetShell(nIdx) ) { - SfxUndoManager *pShUndoMgr = pSh->GetUndoManager(); + ::svl::IUndoManager *pShUndoMgr = pSh->GetUndoManager(); if ( pShUndoMgr ) pShUndoMgr->SetMaxUndoActionCount( nUndoCount ); } @@ -718,67 +717,67 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) } // Office autostart - if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_QUICKLAUNCHER), TRUE, &pItem)) + if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_QUICKLAUNCHER), sal_True, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - ShutdownIcon::SetAutostart( ( (const SfxBoolItem*)pItem )->GetValue() != FALSE ); + ShutdownIcon::SetAutostart( ( (const SfxBoolItem*)pItem )->GetValue() != sal_False ); } // StarBasic Enable - if ( SFX_ITEM_SET == rSet.GetItemState(SID_BASIC_ENABLED, TRUE, &pItem)) + if ( SFX_ITEM_SET == rSet.GetItemState(SID_BASIC_ENABLED, sal_True, &pItem)) { DBG_ASSERT(pItem->ISA(SfxUInt16Item), "SfxInt16Item expected"); aSecurityOptions.SetBasicMode( (EBasicSecurityMode)( (const SfxUInt16Item*)pItem )->GetValue() ); } // Execute PlugIns - if ( SFX_ITEM_SET == rSet.GetItemState(SID_INET_EXE_PLUGIN, TRUE, &pItem)) + if ( SFX_ITEM_SET == rSet.GetItemState(SID_INET_EXE_PLUGIN, sal_True, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "SfxBoolItem expected"); aSecurityOptions.SetExecutePlugins( ( (const SfxBoolItem *)pItem )->GetValue() ); - bResetSession = TRUE; + bResetSession = sal_True; } - if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_INET_PROXY_TYPE), TRUE, &pItem)) + if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_INET_PROXY_TYPE), sal_True, &pItem)) { DBG_ASSERT( pItem->ISA(SfxUInt16Item), "UInt16Item expected" ); aInetOptions.SetProxyType((SvtInetOptions::ProxyType)( (const SfxUInt16Item*)pItem )->GetValue()); - bResetSession = TRUE; + bResetSession = sal_True; } - if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_HTTP_PROXY_NAME ), TRUE, &pItem ) ) + if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_HTTP_PROXY_NAME ), sal_True, &pItem ) ) { DBG_ASSERT( pItem->ISA(SfxStringItem), "StringItem expected" ); aInetOptions.SetProxyHttpName( ((const SfxStringItem *)pItem)->GetValue() ); - bResetSession = TRUE; + bResetSession = sal_True; } - if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_HTTP_PROXY_PORT ), TRUE, &pItem ) ) + if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_HTTP_PROXY_PORT ), sal_True, &pItem ) ) { DBG_ASSERT( pItem->ISA(SfxInt32Item), "Int32Item expected" ); aInetOptions.SetProxyHttpPort( ( (const SfxInt32Item*)pItem )->GetValue() ); - bResetSession = TRUE; + bResetSession = sal_True; } - if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_FTP_PROXY_NAME ), TRUE, &pItem ) ) + if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_FTP_PROXY_NAME ), sal_True, &pItem ) ) { DBG_ASSERT( pItem->ISA(SfxStringItem), "StringItem expected" ); aInetOptions.SetProxyFtpName( ((const SfxStringItem *)pItem)->GetValue() ); - bResetSession = TRUE; + bResetSession = sal_True; } - if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_FTP_PROXY_PORT ), TRUE, &pItem ) ) + if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_FTP_PROXY_PORT ), sal_True, &pItem ) ) { DBG_ASSERT( pItem->ISA(SfxInt32Item), "Int32Item expected" ); aInetOptions.SetProxyFtpPort( ( (const SfxInt32Item*)pItem )->GetValue() ); - bResetSession = TRUE; + bResetSession = sal_True; } - if ( SFX_ITEM_SET == rSet.GetItemState(SID_INET_NOPROXY, TRUE, &pItem)) + if ( SFX_ITEM_SET == rSet.GetItemState(SID_INET_NOPROXY, sal_True, &pItem)) { DBG_ASSERT(pItem->ISA(SfxStringItem), "StringItem expected"); aInetOptions.SetProxyNoProxy(((const SfxStringItem *)pItem)->GetValue()); - bResetSession = TRUE; + bResetSession = sal_True; } // Secure-Referers - if ( SFX_ITEM_SET == rSet.GetItemState(SID_SECURE_URL, TRUE, &pItem)) + if ( SFX_ITEM_SET == rSet.GetItemState(SID_SECURE_URL, sal_True, &pItem)) { DELETEZ(pAppData_Impl->pSecureURLs); @@ -793,30 +792,25 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) aSecurityOptions.SetSecureURLs( seqURLs ); } - if ( SFX_ITEM_SET == rSet.GetItemState(SID_MACRO_WARNING, TRUE, &pItem)) + if ( SFX_ITEM_SET == rSet.GetItemState(SID_MACRO_WARNING, sal_True, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "SfxBoolItem expected"); aSecurityOptions.SetWarningEnabled( ( (const SfxBoolItem *)pItem )->GetValue() ); } - if ( SFX_ITEM_SET == rSet.GetItemState(SID_MACRO_CONFIRMATION, TRUE, &pItem)) + if ( SFX_ITEM_SET == rSet.GetItemState(SID_MACRO_CONFIRMATION, sal_True, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "SfxBoolItem expected"); aSecurityOptions.SetConfirmationEnabled( ( (const SfxBoolItem *)pItem )->GetValue() ); } // EnableMetafilePrint - if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_ENABLE_METAFILEPRINT ), TRUE, &pItem ) ) + if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_ENABLE_METAFILEPRINT ), sal_True, &pItem ) ) { #ifdef ENABLE_MISSINGKEYASSERTIONS//MUSTINI DBG_ASSERT(sal_False, "SfxApplication::SetOptions_Impl()\nsoffice.ini key \"MetafilPrint\" not supported any longer!\n"); #endif } - // Set up INet Session again - if ( bResetSession ) - { - } - // Store changed data aInetOptions.flush(); } @@ -833,7 +827,7 @@ void SfxApplication::SetOptions(const SfxItemSet &rSet) SfxAllItemSet aSendSet( rSet ); // PathName - if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_PATHNAME), TRUE, &pItem)) + if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_PATHNAME), sal_True, &pItem)) { DBG_ASSERT(pItem->ISA(SfxAllEnumItem), "AllEnumItem expected"); const SfxAllEnumItem* pEnumItem = (const SfxAllEnumItem *)pItem; @@ -841,7 +835,7 @@ void SfxApplication::SetOptions(const SfxItemSet &rSet) String aNoChangeStr( ' ' ); for( sal_uInt32 nPath=0; nPath<nCount; ++nPath ) { - String sValue = pEnumItem->GetValueTextByPos((USHORT)nPath); + String sValue = pEnumItem->GetValueTextByPos((sal_uInt16)nPath); if ( sValue != aNoChangeStr ) { switch( nPath ) @@ -927,11 +921,11 @@ void SfxApplication::SetOptions(const SfxItemSet &rSet) // Save all Documents -BOOL SfxApplication::SaveAll_Impl(BOOL bPrompt, BOOL bAutoSave) +sal_Bool SfxApplication::SaveAll_Impl(sal_Bool bPrompt, sal_Bool bAutoSave) { - bAutoSave = FALSE; // functionality moved to new AutoRecovery Service! + bAutoSave = sal_False; // functionality moved to new AutoRecovery Service! - BOOL bFunc = TRUE; + sal_Bool bFunc = sal_True; short nRet; for ( SfxObjectShell *pDoc = SfxObjectShell::GetFirst(); @@ -959,11 +953,11 @@ BOOL SfxApplication::SaveAll_Impl(BOOL bPrompt, BOOL bAutoSave) const SfxPoolItem *pPoolItem = pDoc->ExecuteSlot( aReq ); if ( !pPoolItem || !pPoolItem->ISA(SfxBoolItem) || !( (const SfxBoolItem*) pPoolItem )->GetValue() ) - bFunc = FALSE; + bFunc = sal_False; } else if ( nRet == RET_CANCEL ) { - bFunc = FALSE; + bFunc = sal_False; break; } else if ( nRet == RET_NO ) @@ -978,21 +972,6 @@ BOOL SfxApplication::SaveAll_Impl(BOOL bPrompt, BOOL bAutoSave) //-------------------------------------------------------------------- -SfxMacroConfig* SfxApplication::GetMacroConfig() const -{ - return SfxMacroConfig::GetOrCreate(); -} - -//-------------------------------------------------------------------- -SfxEventConfiguration* SfxApplication::GetEventConfig() const -{ - if (!pAppData_Impl->pEventConfig) - pAppData_Impl->pEventConfig = new SfxEventConfiguration; - return pAppData_Impl->pEventConfig; -} - -//-------------------------------------------------------------------- - //-------------------------------------------------------------------- void SfxApplication::NotifyEvent( const SfxEventHint& rEventHint, bool bSynchron ) { diff --git a/sfx2/source/appl/appchild.cxx b/sfx2/source/appl/appchild.cxx index 204ef0bbf981..08a5fc054425 100644..100755 --- a/sfx2/source/appl/appchild.cxx +++ b/sfx2/source/appl/appchild.cxx @@ -59,7 +59,7 @@ void SfxApplication::RegisterChildWindow_Impl( SfxModule *pMod, SfxChildWinFacto if (!pAppData_Impl->pFactArr) pAppData_Impl->pFactArr = new SfxChildWinFactArr_Impl; - for (USHORT nFactory=0; nFactory<pAppData_Impl->pFactArr->Count(); ++nFactory) + for (sal_uInt16 nFactory=0; nFactory<pAppData_Impl->pFactArr->Count(); ++nFactory) { if (pFact->nId == (*pAppData_Impl->pFactArr)[nFactory]->nId) { @@ -71,7 +71,7 @@ void SfxApplication::RegisterChildWindow_Impl( SfxModule *pMod, SfxChildWinFacto SfxChildWinFactory, pFact, pAppData_Impl->pFactArr->Count() ); } -void SfxApplication::RegisterChildWindowContext_Impl( SfxModule *pMod, USHORT nId, +void SfxApplication::RegisterChildWindowContext_Impl( SfxModule *pMod, sal_uInt16 nId, SfxChildWinContextFactory *pFact) { SfxChildWinFactArr_Impl *pFactories; @@ -82,8 +82,8 @@ void SfxApplication::RegisterChildWindowContext_Impl( SfxModule *pMod, USHORT nI pFactories = pMod->GetChildWinFactories_Impl(); if ( pFactories ) { - USHORT nCount = pFactories->Count(); - for (USHORT nFactory=0; nFactory<nCount; ++nFactory) + sal_uInt16 nCount = pFactories->Count(); + for (sal_uInt16 nFactory=0; nFactory<nCount; ++nFactory) { SfxChildWinFactory *pFac = (*pFactories)[nFactory]; if ( nId == pFac->nId ) @@ -103,8 +103,8 @@ void SfxApplication::RegisterChildWindowContext_Impl( SfxModule *pMod, USHORT nI DBG_ASSERT( pAppData_Impl->pFactArr, "No Factories!" ); pFactories = pAppData_Impl->pFactArr; - USHORT nCount = pFactories->Count(); - for (USHORT nFactory=0; nFactory<nCount; ++nFactory) + sal_uInt16 nCount = pFactories->Count(); + for (sal_uInt16 nFactory=0; nFactory<nCount; ++nFactory) { SfxChildWinFactory *pFac = (*pFactories)[nFactory]; if ( nId == pFac->nId ) diff --git a/sfx2/source/appl/appdata.cxx b/sfx2/source/appl/appdata.cxx index 3cf26042b47d..3b53636f1c45 100644..100755 --- a/sfx2/source/appl/appdata.cxx +++ b/sfx2/source/appl/appdata.cxx @@ -56,7 +56,7 @@ #include <sfx2/request.hxx> #include "referers.hxx" #include "app.hrc" -#include "sfxresid.hxx" +#include "sfx2/sfxresid.hxx" #include "objshimp.hxx" #include <sfx2/appuno.hxx> #include "imestatuswindow.hxx" @@ -97,11 +97,9 @@ SfxAppData_Impl::SfxAppData_Impl( SfxApplication* ) : pTopFrames( new SfxFrameArr_Impl ), pInitLinkList(0), pMatcher( 0 ), - pLabelResMgr( 0 ), pAppDispatch(NULL), pTemplates( 0 ), pPool(0), - pEventConfig(0), pDisabledSlotList( 0 ), pSecureURLs(0), pSaveOptions( 0 ), @@ -111,7 +109,6 @@ SfxAppData_Impl::SfxAppData_Impl( SfxApplication* ) : pTemplateCommon( 0 ), nDocModalMode(0), nAutoTabPageId(0), - nBasicCallLevel(0), nRescheduleLocks(0), nInReschedule(0), nAsynchronCalls(0), diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx index 03234cec803a..c3fb0e9dfc92 100644..100755 --- a/sfx2/source/appl/appdde.cxx +++ b/sfx2/source/appl/appdde.cxx @@ -39,6 +39,7 @@ #include <sfx2/linkmgr.hxx> #include <tools/urlobj.hxx> +#include <tools/diagnose_ex.h> #include <unotools/pathoptions.hxx> #include <sfx2/app.hxx> @@ -73,11 +74,11 @@ public: ImplDdeService( const String& rNm ) : DdeService( rNm ) {} - virtual BOOL MakeTopic( const String& ); + virtual sal_Bool MakeTopic( const String& ); virtual String Topics(); - virtual BOOL SysTopicExecute( const String* pStr ); + virtual sal_Bool SysTopicExecute( const String* pStr ); }; class SfxDdeTriggerTopic_Impl : public DdeTopic @@ -87,7 +88,7 @@ public: : DdeTopic( DEFINE_CONST_UNICODE("TRIGGER") ) {} - virtual BOOL Execute( const String* ); + virtual sal_Bool Execute( const String* ); }; class SfxDdeDocTopic_Impl : public DdeTopic @@ -101,11 +102,11 @@ public: : DdeTopic( pShell->GetTitle(SFX_TITLE_FULLNAME) ), pSh( pShell ) {} - virtual DdeData* Get( ULONG ); - virtual BOOL Put( const DdeData* ); - virtual BOOL Execute( const String* ); - virtual BOOL StartAdviseLoop(); - virtual BOOL MakeItem( const String& rItem ); + virtual DdeData* Get( sal_uIntPtr ); + virtual sal_Bool Put( const DdeData* ); + virtual sal_Bool Execute( const String* ); + virtual sal_Bool StartAdviseLoop(); + virtual sal_Bool MakeItem( const String& rItem ); }; @@ -114,7 +115,7 @@ SV_IMPL_PTRARR( SfxDdeDocTopics_Impl, SfxDdeDocTopic_Impl *) //======================================================================== -BOOL SfxAppEvent_Impl( ApplicationEvent &rAppEvent, +sal_Bool SfxAppEvent_Impl( ApplicationEvent &rAppEvent, const String &rCmd, const String &rEvent ) /* [Description] @@ -141,7 +142,7 @@ BOOL SfxAppEvent_Impl( ApplicationEvent &rAppEvent, { // Transform into the ApplicationEvent Format aData.Erase( aData.Len()-1, 1 ); - for ( USHORT n = 0; n < aData.Len(); ++n ) + for ( sal_uInt16 n = 0; n < aData.Len(); ++n ) { if ( aData.GetChar(n) == 0x0022 ) // " = 22h for ( ; aData.GetChar(++n) != 0x0022 ; ) @@ -152,11 +153,11 @@ BOOL SfxAppEvent_Impl( ApplicationEvent &rAppEvent, aData.EraseAllChars( 0x0022 ); ApplicationAddress aAddr; rAppEvent = ApplicationEvent( String(), aAddr, U2S(rEvent), aData ); - return TRUE; + return sal_True; } } - return FALSE; + return sal_False; } //------------------------------------------------------------------------- @@ -185,11 +186,9 @@ long SfxApplication::DdeExecute else { // all others are BASIC - EnterBasicCall(); StarBASIC* pBasic = GetBasic(); DBG_ASSERT( pBasic, "Where is the Basic???" ); SbxVariable* pRet = pBasic->Execute( rCmd ); - LeaveBasicCall(); if( !pRet ) { SbxBase::ResetError(); @@ -453,7 +452,7 @@ long SfxViewFrame::DdeSetData //======================================================================== -BOOL SfxApplication::InitializeDde() +sal_Bool SfxApplication::InitializeDde() { DBG_ASSERT( !pAppData_Impl->pDdeService, "Dde can not be initialized multiple times" ); @@ -499,14 +498,14 @@ void SfxApplication::AddDdeTopic( SfxObjectShell* pSh ) // prevent double submit String sShellNm; - BOOL bFnd = FALSE; - for( USHORT n = pAppData_Impl->pDocTopics->Count(); n; ) + sal_Bool bFnd = sal_False; + for( sal_uInt16 n = pAppData_Impl->pDocTopics->Count(); n; ) if( (*pAppData_Impl->pDocTopics)[ --n ]->pSh == pSh ) { // If the document is untitled, is still a new Topic is created! if( !bFnd ) { - bFnd = TRUE; + bFnd = sal_True; (sShellNm = pSh->GetTitle(SFX_TITLE_FULLNAME)).ToLowerAscii(); } String sNm( (*pAppData_Impl->pDocTopics)[ n ]->GetName() ); @@ -528,7 +527,7 @@ void SfxApplication::RemoveDdeTopic( SfxObjectShell* pSh ) return; SfxDdeDocTopic_Impl* pTopic; - for( USHORT n = pAppData_Impl->pDocTopics->Count(); n; ) + for( sal_uInt16 n = pAppData_Impl->pDocTopics->Count(); n; ) if( ( pTopic = (*pAppData_Impl->pDocTopics)[ --n ])->pSh == pSh ) { pAppData_Impl->pDdeService->RemoveTopic( *pTopic ); @@ -548,17 +547,17 @@ DdeService* SfxApplication::GetDdeService() //-------------------------------------------------------------------- -BOOL ImplDdeService::MakeTopic( const String& rNm ) +sal_Bool ImplDdeService::MakeTopic( const String& rNm ) { // Workaround for Event after Main() under OS/2 // happens when exiting starts the App again if ( !Application::IsInExecute() ) - return FALSE; + return sal_False; // The Topic rNm is sought, do we have it? // First only loop over the ObjectShells to find those // with the specific name: - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; String sNm( rNm ); sNm.ToLowerAscii(); TypeId aType( TYPE(SfxObjectShell) ); @@ -570,7 +569,7 @@ BOOL ImplDdeService::MakeTopic( const String& rNm ) if( sTmp == sNm ) { SFX_APP()->AddDdeTopic( pShell ); - bRet = TRUE; + bRet = sal_True; break; } pShell = SfxObjectShell::GetNext( *pShell, &aType ); @@ -585,9 +584,9 @@ BOOL ImplDdeService::MakeTopic( const String& rNm ) { // File exists? then try to load it: SfxStringItem aName( SID_FILE_NAME, aFile.GetMainURL( INetURLObject::NO_DECODE ) ); - SfxBoolItem aNewView(SID_OPEN_NEW_VIEW, TRUE); + SfxBoolItem aNewView(SID_OPEN_NEW_VIEW, sal_True); - SfxBoolItem aSilent(SID_SILENT, TRUE); + SfxBoolItem aSilent(SID_SILENT, sal_True); SfxDispatcher* pDispatcher = SFX_APP()->GetDispatcher_Impl(); const SfxPoolItem* pRet = pDispatcher->Execute( SID_OPENDOC, SFX_CALLMODE_SYNCHRON, @@ -600,7 +599,7 @@ BOOL ImplDdeService::MakeTopic( const String& rNm ) ->GetFrame()->GetObjectShell() ) ) { SFX_APP()->AddDdeTopic( pShell ); - bRet = TRUE; + bRet = sal_True; } } } @@ -630,20 +629,20 @@ String ImplDdeService::Topics() return sRet; } -BOOL ImplDdeService::SysTopicExecute( const String* pStr ) +sal_Bool ImplDdeService::SysTopicExecute( const String* pStr ) { - return (BOOL)SFX_APP()->DdeExecute( *pStr ); + return (sal_Bool)SFX_APP()->DdeExecute( *pStr ); } //-------------------------------------------------------------------- -BOOL SfxDdeTriggerTopic_Impl::Execute( const String* ) +sal_Bool SfxDdeTriggerTopic_Impl::Execute( const String* ) { - return TRUE; + return sal_True; } //-------------------------------------------------------------------- -DdeData* SfxDdeDocTopic_Impl::Get( ULONG nFormat ) +DdeData* SfxDdeDocTopic_Impl::Get( sal_uIntPtr nFormat ) { String sMimeType( SotExchange::GetFormatMimeType( nFormat )); ::com::sun::star::uno::Any aValue; @@ -657,11 +656,11 @@ DdeData* SfxDdeDocTopic_Impl::Get( ULONG nFormat ) return 0; } -BOOL SfxDdeDocTopic_Impl::Put( const DdeData* pData ) +sal_Bool SfxDdeDocTopic_Impl::Put( const DdeData* pData ) { aSeq = ::com::sun::star::uno::Sequence< sal_Int8 >( (sal_Int8*)(const void*)*pData, (long)*pData ); - BOOL bRet; + sal_Bool bRet; if( aSeq.getLength() ) { ::com::sun::star::uno::Any aValue; @@ -670,25 +669,25 @@ BOOL SfxDdeDocTopic_Impl::Put( const DdeData* pData ) bRet = 0 != pSh->DdeSetData( GetCurItem(), sMimeType, aValue ); } else - bRet = FALSE; + bRet = sal_False; return bRet; } -BOOL SfxDdeDocTopic_Impl::Execute( const String* pStr ) +sal_Bool SfxDdeDocTopic_Impl::Execute( const String* pStr ) { long nRet = pStr ? pSh->DdeExecute( *pStr ) : 0; return 0 != nRet; } -BOOL SfxDdeDocTopic_Impl::MakeItem( const String& rItem ) +sal_Bool SfxDdeDocTopic_Impl::MakeItem( const String& rItem ) { AddItem( DdeItem( rItem ) ); - return TRUE; + return sal_True; } -BOOL SfxDdeDocTopic_Impl::StartAdviseLoop() +sal_Bool SfxDdeDocTopic_Impl::StartAdviseLoop() { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; ::sfx2::SvLinkSource* pNewObj = pSh->DdeCreateLinkSource( GetCurItem() ); if( pNewObj ) { @@ -696,7 +695,7 @@ BOOL SfxDdeDocTopic_Impl::StartAdviseLoop() String sNm, sTmp( Application::GetAppName() ); ::sfx2::MakeLnkName( sNm, &sTmp, pSh->GetTitle(SFX_TITLE_FULLNAME), GetCurItem() ); new ::sfx2::SvBaseLink( sNm, OBJECT_DDE_EXTERN, pNewObj ); - bRet = TRUE; + bRet = sal_True; } return bRet; } diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx index 57d87b800d45..fe682c3e30e4 100644..100755 --- a/sfx2/source/appl/appinit.cxx +++ b/sfx2/source/appl/appinit.cxx @@ -69,18 +69,18 @@ #include <sfx2/docfac.hxx> #include <sfx2/evntconf.hxx> #include "intro.hxx" -#include <sfx2/macrconf.hxx> #include <sfx2/mnumgr.hxx> #include <sfx2/msgpool.hxx> #include <sfx2/progress.hxx> -#include "sfxhelp.hxx" -#include "sfxresid.hxx" +#include "sfx2/sfxhelp.hxx" +#include "sfx2/sfxresid.hxx" #include "sfxtypes.hxx" #include <sfx2/viewsh.hxx> #include "nochaos.hxx" #include <sfx2/fcontnr.hxx> #include "helper.hxx" // SfxContentHelper::Kill() #include "sfxpicklist.hxx" +#include <tools/svlibrary.hxx> #ifdef UNX #define stricmp(a,b) strcmp(a,b) @@ -207,10 +207,7 @@ String GetSpecialCharsForEdit(Window* pParent, const Font& rFont) { bDetermineFunction = true; - String sLibName = String::CreateFromAscii( STRING( DLL_NAME ) ); - sLibName.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "sfx" ) ), String( RTL_CONSTASCII_USTRINGPARAM( "cui" ) ) ); - - rtl::OUString aLibName( sLibName ); + static ::rtl::OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "cui" ) ) ); oslModule handleMod = osl_loadModuleRelative( &thisModule, aLibName.pData, 0 ); diff --git a/sfx2/source/appl/appmain.cxx b/sfx2/source/appl/appmain.cxx index 854499bdd89d..00ec4e88ecdd 100644..100755 --- a/sfx2/source/appl/appmain.cxx +++ b/sfx2/source/appl/appmain.cxx @@ -51,7 +51,7 @@ #include <sfx2/app.hxx> #include "arrdecl.hxx" #include <sfx2/dispatch.hxx> -#include "sfxresid.hxx" +#include "sfx2/sfxresid.hxx" #include <sfx2/fcontnr.hxx> #include <sfx2/viewsh.hxx> #include "intro.hxx" @@ -115,21 +115,6 @@ void SfxApplication::Init <SfxApplication::OpenClients()> */ { -#ifdef DDE_AVAILABLE -#ifndef DBG_UTIL - InitializeDde(); -#else - if( !InitializeDde() ) - { - ByteString aStr( "No DDE-Service possible. Error: " ); - if( GetDdeService() ) - aStr += GetDdeService()->GetError(); - else - aStr += '?'; - DBG_ASSERT( sal_False, aStr.GetBuffer() ) - } -#endif -#endif } //-------------------------------------------------------------------- @@ -159,35 +144,6 @@ void SfxApplication::PreInit( ) { } -//--------------------------------------------------------------------------- -bool SfxApplication::InitLabelResMgr( const char* _pLabelPrefix, bool _bException ) -{ - bool bRet = false; - // Label-DLL with various resources for OEM-Ver. etc. (Intro, Titel, About) - DBG_ASSERT( _pLabelPrefix, "Wrong initialisation!" ); - if ( _pLabelPrefix ) - { - // try to create the Label-DLL - pAppData_Impl->pLabelResMgr = CreateResManager( _pLabelPrefix ); - - // no separate label-DLL available? - if ( !pAppData_Impl->pLabelResMgr ) - { - if ( _bException ) - { - // maybe corrupted installation - throw (::com::sun::star::uno::RuntimeException( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("iso resource could not be loaded by SfxApplication")), - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >())); - } - } - else - bRet = true; - } - - return bRet; -} - void SfxApplication::Main( ) { } diff --git a/sfx2/source/appl/appmisc.cxx b/sfx2/source/appl/appmisc.cxx index 50db1ffb8669..93abf1c813f8 100644..100755 --- a/sfx2/source/appl/appmisc.cxx +++ b/sfx2/source/appl/appmisc.cxx @@ -48,7 +48,6 @@ #include <osl/mutex.hxx> #include <unotools/configmgr.hxx> #include <com/sun/star/frame/XDesktop.hpp> - #include <unotools/ucbstreamhelper.hxx> #include <framework/menuconfiguration.hxx> #include <comphelper/processfactory.hxx> @@ -56,13 +55,14 @@ #include <unotools/bootstrap.hxx> #include <unotools/moduleoptions.hxx> #include <osl/file.hxx> +#include <rtl/bootstrap.hxx> -#include "sfxresid.hxx" +#include "sfx2/sfxresid.hxx" #include <sfx2/app.hxx> #include "appdata.hxx" #include "arrdecl.hxx" #include <sfx2/tbxctrl.hxx> -#include "stbitem.hxx" +#include "sfx2/stbitem.hxx" #include <sfx2/mnuitem.hxx> #include <sfx2/docfac.hxx> #include <sfx2/docfile.hxx> @@ -152,38 +152,6 @@ SFX_IMPL_INTERFACE(SfxApplication,SfxShell,SfxResId(RID_DESKTOP)) } //-------------------------------------------------------------------- - -void SfxApplication::InitializeDisplayName_Impl() -{ - SfxAppData_Impl* pAppData = Get_Impl(); - if ( !pAppData->pLabelResMgr ) - return; - - String aTitle = Application::GetDisplayName(); - if ( !aTitle.Len() ) - { - osl::ClearableMutexGuard aGuard( osl::Mutex::getGlobalMutex() ); - - // load application title - aTitle = String( ResId( RID_APPTITLE, *pAppData->pLabelResMgr ) ); - // merge version into title - aTitle.SearchAndReplaceAscii( "$(VER)", String() /*aVersion*/ ); - - aGuard.clear(); - -#ifdef DBG_UTIL - ::rtl::OUString aDefault; - aTitle += DEFINE_CONST_UNICODE(" ["); - - String aVerId( utl::Bootstrap::getBuildIdData( aDefault )); - aTitle += aVerId; - aTitle += ']'; -#endif - Application::SetDisplayName( aTitle ); - } -} - -//-------------------------------------------------------------------- SfxProgress* SfxApplication::GetProgress() const /* [Description] @@ -221,8 +189,8 @@ SvUShorts* SfxApplication::GetDisabledSlotList_Impl() pStream = ::utl::UcbStreamHelper::CreateStream( aObj.GetMainURL( INetURLObject::NO_DECODE ), STREAM_STD_READ ); } - BOOL bSlotsEnabled = SvtInternalOptions().SlotCFGEnabled(); - BOOL bSlots = ( pStream && !pStream->GetError() ); + sal_Bool bSlotsEnabled = SvtInternalOptions().SlotCFGEnabled(); + sal_Bool bSlots = ( pStream && !pStream->GetError() ); if( bSlots && bSlotsEnabled ) { // Read Slot file @@ -288,7 +256,7 @@ SfxModule* SfxApplication::GetModule_Impl() { SfxModule* pModule = SfxModule::GetActiveModule(); if ( !pModule ) - pModule = SfxModule::GetActiveModule( SfxViewFrame::GetFirst( FALSE ) ); + pModule = SfxModule::GetActiveModule( SfxViewFrame::GetFirst( sal_False ) ); if( pModule ) return pModule; else @@ -310,8 +278,76 @@ ISfxTemplateCommon* SfxApplication::GetCurrentTemplateCommon( SfxBindings& rBind } SfxResourceManager& SfxApplication::GetResourceManager() const { return *pAppData_Impl->pResMgr; } -BOOL SfxApplication::IsDowning() const { return pAppData_Impl->bDowning; } +sal_Bool SfxApplication::IsDowning() const { return pAppData_Impl->bDowning; } SfxDispatcher* SfxApplication::GetAppDispatcher_Impl() { return pAppData_Impl->pAppDispat; } SfxSlotPool& SfxApplication::GetAppSlotPool_Impl() const { return *pAppData_Impl->pSlotPool; } +static bool impl_loadBitmap( + const rtl::OUString &rPath, const rtl::OUString &rBmpFileName, + Image &rLogo ) +{ + rtl::OUString uri( rPath ); + rtl::Bootstrap::expandMacros( uri ); + INetURLObject aObj( uri ); + aObj.insertName( rBmpFileName ); + SvFileStream aStrm( aObj.PathToFileName(), STREAM_STD_READ ); + if ( !aStrm.GetError() ) + { + // Use graphic class to also support more graphic formats (bmp,png,...) + Graphic aGraphic; + + GraphicFilter* pGF = GraphicFilter::GetGraphicFilter(); + pGF->ImportGraphic( aGraphic, String(), aStrm, GRFILTER_FORMAT_DONTKNOW ); + + // Default case, we load the intro bitmap from a seperate file + // (e.g. staroffice_intro.bmp or starsuite_intro.bmp) + BitmapEx aBmp = aGraphic.GetBitmapEx(); + rLogo = Image( aBmp ); + return true; + } + return false; +} + +/** loads the application logo as used in the about dialog and impress slideshow pause screen */ +Image SfxApplication::GetApplicationLogo() +{ + Image aAppLogo; + + rtl::OUString aAbouts; + bool bLoaded = false; + sal_Int32 nIndex = 0; + do + { + bLoaded = impl_loadBitmap( + rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program" ), + aAbouts.getToken( 0, ',', nIndex ), aAppLogo ); + } + while ( !bLoaded && ( nIndex >= 0 ) ); + + // fallback to "about.bmp" + if ( !bLoaded ) + { + bLoaded = impl_loadBitmap( + rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program/edition" ), + rtl::OUString::createFromAscii( "about.png" ), aAppLogo ); + if ( !bLoaded ) + bLoaded = impl_loadBitmap( + rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program/edition" ), + rtl::OUString::createFromAscii( "about.bmp" ), aAppLogo ); + } + + if ( !bLoaded ) + { + bLoaded = impl_loadBitmap( + rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program" ), + rtl::OUString::createFromAscii( "about.png" ), aAppLogo ); + if ( !bLoaded ) + bLoaded = impl_loadBitmap( + rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program" ), + rtl::OUString::createFromAscii( "about.bmp" ), aAppLogo ); + } + + return aAppLogo; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index 25381e4571e9..20b6746476d8 100644..100755 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -99,7 +99,7 @@ #include <sfx2/passwd.hxx> #include "referers.hxx" #include <sfx2/request.hxx> -#include "sfxresid.hxx" +#include "sfx2/sfxresid.hxx" #include <sfx2/viewsh.hxx> #include "app.hrc" #include <sfx2/viewfrm.hxx> @@ -131,20 +131,20 @@ namespace css = ::com::sun::star; class SfxOpenDocStatusListener_Impl : public WeakImplHelper1< XDispatchResultListener > { public: - BOOL bFinished; - BOOL bSuccess; + sal_Bool bFinished; + sal_Bool bSuccess; virtual void SAL_CALL dispatchFinished( const DispatchResultEvent& Event ) throw(RuntimeException); virtual void SAL_CALL disposing( const EventObject& Source ) throw(RuntimeException); SfxOpenDocStatusListener_Impl() - : bFinished( FALSE ) - , bSuccess( FALSE ) + : bFinished( sal_False ) + , bSuccess( sal_False ) {} }; void SAL_CALL SfxOpenDocStatusListener_Impl::dispatchFinished( const DispatchResultEvent& aEvent ) throw(RuntimeException) { bSuccess = ( aEvent.State == DispatchResultState::SUCCESS ); - bFinished = TRUE; + bFinished = sal_True; } void SAL_CALL SfxOpenDocStatusListener_Impl::disposing( const EventObject& ) throw(RuntimeException) @@ -154,9 +154,9 @@ void SAL_CALL SfxOpenDocStatusListener_Impl::disposing( const EventObject& ) thr SfxObjectShellRef SfxApplication::DocAlreadyLoaded ( const String& rName, // Name of Documents including path - BOOL bSilent, // TRUE: do not ask for a new view - BOOL bActivate, // existing view to be activated - BOOL bForbidVisible, + sal_Bool bSilent, // sal_True: do not ask for a new view + sal_Bool bActivate, // existing view to be activated + sal_Bool bForbidVisible, const String* pPostStr ) @@ -184,7 +184,7 @@ SfxObjectShellRef SfxApplication::DocAlreadyLoaded // then with the normally open Documents if ( !xDoc.Is() ) { - xDoc = SfxObjectShell::GetFirst( 0, FALSE ); // also hidden Documents + xDoc = SfxObjectShell::GetFirst( 0, sal_False ); // also hidden Documents while( xDoc.Is() ) { if ( xDoc->GetMedium() && @@ -194,13 +194,13 @@ SfxObjectShellRef SfxApplication::DocAlreadyLoaded // Comparisons between URLs INetURLObject aUrl( xDoc->GetMedium()->GetName() ); if ( !aUrl.HasError() && aUrl == aUrlToFind && - (!bForbidVisible || !SfxViewFrame::GetFirst( xDoc, TRUE )) && + (!bForbidVisible || !SfxViewFrame::GetFirst( xDoc, sal_True )) && !xDoc->IsLoading()) { break; } } - xDoc = SfxObjectShell::GetNext( *xDoc, 0, FALSE ); + xDoc = SfxObjectShell::GetNext( *xDoc, 0, sal_False ); } } } @@ -221,7 +221,7 @@ SfxObjectShellRef SfxApplication::DocAlreadyLoaded InfoBox( 0, SfxResId(RID_DOCALREADYLOADED_DLG)).Execute(); if ( bActivate ) { - pFrame->MakeActive_Impl( TRUE ); + pFrame->MakeActive_Impl( sal_True ); } } } @@ -239,8 +239,7 @@ void SetTemplate_Impl( const String &rFileName, pDoc->ResetFromTemplate( rLongName, rFileName ); } -//-------------------------------------------------------------------- - +//==================================================================== class SfxDocPasswordVerifier : public ::comphelper::IDocPasswordVerifier { public: @@ -248,21 +247,33 @@ public: mxStorage( rxStorage ) {} virtual ::comphelper::DocPasswordVerifierResult - verifyPassword( const ::rtl::OUString& rPassword ); + verifyPassword( const ::rtl::OUString& rPassword, uno::Sequence< beans::NamedValue >& o_rEncryptionData ); + virtual ::comphelper::DocPasswordVerifierResult + verifyEncryptionData( const uno::Sequence< beans::NamedValue >& rEncryptionData ); + private: Reference< embed::XStorage > mxStorage; }; -::comphelper::DocPasswordVerifierResult SfxDocPasswordVerifier::verifyPassword( const ::rtl::OUString& rPassword ) +//-------------------------------------------------------------------- +::comphelper::DocPasswordVerifierResult SfxDocPasswordVerifier::verifyPassword( const ::rtl::OUString& rPassword, uno::Sequence< beans::NamedValue >& o_rEncryptionData ) +{ + o_rEncryptionData = ::comphelper::OStorageHelper::CreatePackageEncryptionData( rPassword ); + return verifyEncryptionData( o_rEncryptionData ); +} + + +//-------------------------------------------------------------------- +::comphelper::DocPasswordVerifierResult SfxDocPasswordVerifier::verifyEncryptionData( const uno::Sequence< beans::NamedValue >& rEncryptionData ) { ::comphelper::DocPasswordVerifierResult eResult = ::comphelper::DocPasswordVerifierResult_WRONG_PASSWORD; try { - // check the password - // if the password correct is the stream will be opened successfuly + // check the encryption data + // if the data correct is the stream will be opened successfuly // and immediatelly closed - ::comphelper::OStorageHelper::SetCommonStoragePassword( mxStorage, rPassword ); + ::comphelper::OStorageHelper::SetCommonStorageEncryptionData( mxStorage, rEncryptionData ); mxStorage->openStreamElement( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "content.xml" ) ), @@ -283,6 +294,8 @@ private: return eResult; } +//==================================================================== + //-------------------------------------------------------------------- sal_uInt32 CheckPasswd_Impl @@ -300,7 +313,7 @@ sal_uInt32 CheckPasswd_Impl If the set does not exist the it is created. */ { - ULONG nRet = ERRCODE_NONE; + sal_uIntPtr nRet = ERRCODE_NONE; if( ( !pFile->GetFilter() || pFile->IsStorage() ) ) { @@ -336,14 +349,28 @@ sal_uInt32 CheckPasswd_Impl if( xInteractionHandler.is() ) { // use the comphelper password helper to request a password + ::rtl::OUString aPassword; + SFX_ITEMSET_ARG( pSet, pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False); + if ( pPasswordItem ) + aPassword = pPasswordItem->GetValue(); + + uno::Sequence< beans::NamedValue > aEncryptionData; + SFX_ITEMSET_ARG( pSet, pEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA, sal_False); + if ( pEncryptionDataItem ) + pEncryptionDataItem->GetValue() >>= aEncryptionData; + ::rtl::OUString aDocumentName = INetURLObject( pFile->GetOrigURL() ).GetMainURL( INetURLObject::DECODE_WITH_CHARSET ); + SfxDocPasswordVerifier aVerifier( xStorage ); - ::rtl::OUString aPassword = ::comphelper::DocPasswordHelper::requestAndVerifyDocPassword( - aVerifier, ::rtl::OUString(), xInteractionHandler, aDocumentName, comphelper::DocPasswordRequestType_STANDARD ); + aEncryptionData = ::comphelper::DocPasswordHelper::requestAndVerifyDocPassword( + aVerifier, aEncryptionData, aPassword, xInteractionHandler, aDocumentName, comphelper::DocPasswordRequestType_STANDARD ); + + pSet->ClearItem( SID_PASSWORD ); + pSet->ClearItem( SID_ENCRYPTIONDATA ); - if ( aPassword.getLength() > 0 ) + if ( aEncryptionData.getLength() > 0 ) { - pSet->Put( SfxStringItem( SID_PASSWORD, aPassword ) ); + pSet->Put( SfxUnoAnyItem( SID_ENCRYPTIONDATA, uno::makeAny( aEncryptionData ) ) ); try { @@ -377,10 +404,10 @@ sal_uInt32 CheckPasswd_Impl //-------------------------------------------------------------------- -ULONG SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const String &rFileName, BOOL bCopy, SfxItemSet* pSet ) +sal_uIntPtr SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const String &rFileName, sal_Bool bCopy, SfxItemSet* pSet ) { const SfxFilter* pFilter = NULL; - SfxMedium aMedium( rFileName, ( STREAM_READ | STREAM_SHARE_DENYNONE ), FALSE ); + SfxMedium aMedium( rFileName, ( STREAM_READ | STREAM_SHARE_DENYNONE ), sal_False ); if ( !aMedium.GetStorage( sal_True ).is() ) aMedium.GetInStream(); @@ -391,8 +418,8 @@ ULONG SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const String &rFil return aMedium.GetErrorCode(); } - aMedium.UseInteractionHandler( TRUE ); - ULONG nErr = GetFilterMatcher().GuessFilter( aMedium,&pFilter,SFX_FILTER_TEMPLATE, 0 ); + aMedium.UseInteractionHandler( sal_True ); + sal_uIntPtr nErr = GetFilterMatcher().GuessFilter( aMedium,&pFilter,SFX_FILTER_TEMPLATE, 0 ); if ( 0 != nErr) { delete pSet; @@ -412,7 +439,7 @@ ULONG SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const String &rFil SfxStringItem aName( SID_FILE_NAME, rFileName ); SfxStringItem aReferer( SID_REFERER, String::CreateFromAscii("private:user") ); SfxStringItem aFlags( SID_OPTIONS, String::CreateFromAscii("T") ); - SfxBoolItem aHidden( SID_HIDDEN, TRUE ); + SfxBoolItem aHidden( SID_HIDDEN, sal_True ); const SfxPoolItem *pRet = GetDispatcher_Impl()->Execute( SID_OPENDOC, SFX_CALLMODE_SYNCHRON, &aName, &aHidden, &aReferer, &aFlags, 0L ); const SfxObjectItem *pObj = PTR_CAST( SfxObjectItem, pRet ); if ( pObj ) @@ -436,7 +463,7 @@ ULONG SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const String &rFil if ( !xDoc.Is() ) xDoc = SfxObjectShell::CreateObject( pFilter->GetServiceName() ); - SfxMedium *pMedium = new SfxMedium( rFileName, STREAM_STD_READ, FALSE, pFilter, pSet ); + SfxMedium *pMedium = new SfxMedium( rFileName, STREAM_STD_READ, sal_False, pFilter, pSet ); if(!xDoc->DoLoad(pMedium)) { ErrCode nErrCode = xDoc->GetErrorCode(); @@ -477,7 +504,7 @@ ULONG SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const String &rFil xDoc->SetNoName(); xDoc->InvalidateName(); - xDoc->SetModified(FALSE); + xDoc->SetModified(sal_False); xDoc->ResetError(); ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > xModel ( xDoc->GetModel(), ::com::sun::star::uno::UNO_QUERY ); @@ -505,7 +532,7 @@ void SfxApplication::NewDocDirectExec_Impl( SfxRequest& rReq ) { DBG_MEMTEST(); - SFX_REQUEST_ARG( rReq, pFactoryItem, SfxStringItem, SID_NEWDOCDIRECT, FALSE); + SFX_REQUEST_ARG( rReq, pFactoryItem, SfxStringItem, SID_NEWDOCDIRECT, sal_False); String aFactName; if ( pFactoryItem ) aFactName = pFactoryItem->GetValue(); @@ -521,10 +548,10 @@ void SfxApplication::NewDocDirectExec_Impl( SfxRequest& rReq ) aReq.AppendItem( SfxStringItem( SID_TARGETNAME, String::CreateFromAscii( "_default" ) ) ); // TODO/LATER: Should the other arguments be transfered as well? - SFX_REQUEST_ARG( rReq, pDefaultPathItem, SfxStringItem, SID_DEFAULTFILEPATH, FALSE); + SFX_REQUEST_ARG( rReq, pDefaultPathItem, SfxStringItem, SID_DEFAULTFILEPATH, sal_False); if ( pDefaultPathItem ) aReq.AppendItem( *pDefaultPathItem ); - SFX_REQUEST_ARG( rReq, pDefaultNameItem, SfxStringItem, SID_DEFAULTFILENAME, FALSE); + SFX_REQUEST_ARG( rReq, pDefaultNameItem, SfxStringItem, SID_DEFAULTFILENAME, sal_False); if ( pDefaultNameItem ) aReq.AppendItem( *pDefaultNameItem ); @@ -541,14 +568,14 @@ void SfxApplication::NewDocExec_Impl( SfxRequest& rReq ) DBG_MEMTEST(); // No Parameter from BASIC only Factory given? - SFX_REQUEST_ARG(rReq, pTemplNameItem, SfxStringItem, SID_TEMPLATE_NAME, FALSE); - SFX_REQUEST_ARG(rReq, pTemplFileNameItem, SfxStringItem, SID_FILE_NAME, FALSE); - SFX_REQUEST_ARG(rReq, pTemplRegionNameItem, SfxStringItem, SID_TEMPLATE_REGIONNAME, FALSE); + SFX_REQUEST_ARG(rReq, pTemplNameItem, SfxStringItem, SID_TEMPLATE_NAME, sal_False); + SFX_REQUEST_ARG(rReq, pTemplFileNameItem, SfxStringItem, SID_FILE_NAME, sal_False); + SFX_REQUEST_ARG(rReq, pTemplRegionNameItem, SfxStringItem, SID_TEMPLATE_REGIONNAME, sal_False); SfxObjectShellLock xDoc; String aTemplateRegion, aTemplateName, aTemplateFileName; - BOOL bDirect = FALSE; // through FileName instead of Region/Template + sal_Bool bDirect = sal_False; // through FileName instead of Region/Template SfxErrorContext aEc(ERRCTX_SFX_NEWDOC); if ( !pTemplNameItem && !pTemplFileNameItem ) { @@ -589,13 +616,13 @@ void SfxApplication::NewDocExec_Impl( SfxRequest& rReq ) if ( pTemplFileNameItem ) { aTemplateFileName = pTemplFileNameItem->GetValue(); - bDirect = TRUE; + bDirect = sal_True; } } - ULONG lErr = 0; + sal_uIntPtr lErr = 0; SfxItemSet* pSet = new SfxAllItemSet( GetPool() ); - pSet->Put( SfxBoolItem( SID_TEMPLATE, TRUE ) ); + pSet->Put( SfxBoolItem( SID_TEMPLATE, sal_True ) ); if ( !bDirect ) { SfxDocumentTemplates aTmpFac; @@ -611,7 +638,7 @@ void SfxApplication::NewDocExec_Impl( SfxRequest& rReq ) if ( lErr != ERRCODE_NONE ) { - ULONG lFatalErr = ERRCODE_TOERROR(lErr); + sal_uIntPtr lFatalErr = ERRCODE_TOERROR(lErr); if ( lFatalErr ) ErrorHandler::HandleError(lErr); } @@ -671,8 +698,8 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) { DBG_MEMTEST(); - USHORT nSID = rReq.GetSlot(); - SFX_REQUEST_ARG( rReq, pFileNameItem, SfxStringItem, SID_FILE_NAME, FALSE ); + sal_uInt16 nSID = rReq.GetSlot(); + SFX_REQUEST_ARG( rReq, pFileNameItem, SfxStringItem, SID_FILE_NAME, sal_False ); if ( pFileNameItem ) { String aCommand( pFileNameItem->GetValue() ); @@ -686,7 +713,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) sal_Int32 nIndex = aCommand.SearchAscii("slot:"); if ( !nIndex ) { - USHORT nSlotId = (USHORT) String( aCommand, 5, aCommand.Len()-5 ).ToInt32(); + sal_uInt16 nSlotId = (sal_uInt16) String( aCommand, 5, aCommand.Len()-5 ).ToInt32(); if ( nSlotId == SID_OPENDOC ) pFileNameItem = NULL; } @@ -700,7 +727,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) String aFilter; SfxItemSet* pSet = NULL; String aPath; - SFX_REQUEST_ARG( rReq, pFolderNameItem, SfxStringItem, SID_PATH, FALSE ); + SFX_REQUEST_ARG( rReq, pFolderNameItem, SfxStringItem, SID_PATH, sal_False ); if ( pFolderNameItem ) aPath = pFolderNameItem->GetValue(); else if ( nSID == SID_OPENTEMPLATE ) @@ -714,24 +741,24 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) } sal_Int16 nDialog = SFX2_IMPL_DIALOG_CONFIG; - SFX_REQUEST_ARG( rReq, pSystemDialogItem, SfxBoolItem, SID_FILE_DIALOG, FALSE ); + SFX_REQUEST_ARG( rReq, pSystemDialogItem, SfxBoolItem, SID_FILE_DIALOG, sal_False ); if ( pSystemDialogItem ) nDialog = pSystemDialogItem->GetValue() ? SFX2_IMPL_DIALOG_SYSTEM : SFX2_IMPL_DIALOG_OOO; String sStandardDir; - SFX_REQUEST_ARG( rReq, pStandardDirItem, SfxStringItem, SID_STANDARD_DIR, FALSE ); + SFX_REQUEST_ARG( rReq, pStandardDirItem, SfxStringItem, SID_STANDARD_DIR, sal_False ); if ( pStandardDirItem ) sStandardDir = pStandardDirItem->GetValue(); ::com::sun::star::uno::Sequence< ::rtl::OUString > aBlackList; - SFX_REQUEST_ARG( rReq, pBlackListItem, SfxStringListItem, SID_BLACK_LIST, FALSE ); + SFX_REQUEST_ARG( rReq, pBlackListItem, SfxStringListItem, SID_BLACK_LIST, sal_False ); if ( pBlackListItem ) pBlackListItem->GetStringList( aBlackList ); - ULONG nErr = sfx2::FileOpenDialog_Impl( + sal_uIntPtr nErr = sfx2::FileOpenDialog_Impl( WB_OPEN | SFXWB_MULTISELECTION | SFXWB_SHOWVERSIONS, String(), pURLList, aFilter, pSet, &aPath, nDialog, sStandardDir, aBlackList ); if ( nErr == ERRCODE_ABORT ) @@ -750,7 +777,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) if ( pURLList->Count() ) { if ( nSID == SID_OPENTEMPLATE ) - rReq.AppendItem( SfxBoolItem( SID_TEMPLATE, FALSE ) ); + rReq.AppendItem( SfxBoolItem( SID_TEMPLATE, sal_False ) ); // This helper wraps an existing (or may new created InteractionHandler) // intercept all incoming interactions and provide usefull informations @@ -761,7 +788,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) css::uno::Reference< css::task::XInteractionHandler > xWrappedHandler; // wrap existing handler or create new UUI handler - SFX_REQUEST_ARG(rReq, pInteractionItem, SfxUnoAnyItem, SID_INTERACTIONHANDLER, FALSE); + SFX_REQUEST_ARG(rReq, pInteractionItem, SfxUnoAnyItem, SID_INTERACTIONHANDLER, sal_False); if (pInteractionItem) { pInteractionItem->GetValue() >>= xWrappedHandler; @@ -778,7 +805,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) ::framework::PreventDuplicateInteraction::InteractionInfo aRule (aInteraction, 1); pHandler->addInteractionRule(aRule); - for ( USHORT i = 0; i < pURLList->Count(); ++i ) + for ( sal_uInt16 i = 0; i < pURLList->Count(); ++i ) { String aURL = *(pURLList->GetObject(i)); rReq.RemoveItem( SID_FILE_NAME ); @@ -824,7 +851,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) // return; } - BOOL bHyperlinkUsed = FALSE; + sal_Bool bHyperlinkUsed = sal_False; if ( SID_OPENURL == nSID ) { @@ -834,7 +861,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) } else if ( nSID == SID_OPENTEMPLATE ) { - rReq.AppendItem( SfxBoolItem( SID_TEMPLATE, FALSE ) ); + rReq.AppendItem( SfxBoolItem( SID_TEMPLATE, sal_False ) ); } // pass URL to OS by using ShellExecuter or open it internal // if it seams to be an own format. @@ -847,28 +874,28 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) { rReq.SetSlot( SID_OPENDOC ); nSID = SID_OPENDOC; - bHyperlinkUsed = TRUE; + bHyperlinkUsed = sal_True; } // no else here! It's optional ... if (!bHyperlinkUsed) { - SFX_REQUEST_ARG(rReq, pHyperLinkUsedItem, SfxBoolItem, SID_BROWSE, FALSE); + SFX_REQUEST_ARG(rReq, pHyperLinkUsedItem, SfxBoolItem, SID_BROWSE, sal_False); if ( pHyperLinkUsedItem ) bHyperlinkUsed = pHyperLinkUsedItem->GetValue(); // no "official" item, so remove it from ItemSet before using UNO-API rReq.RemoveItem( SID_BROWSE ); } - SFX_REQUEST_ARG( rReq, pFileName, SfxStringItem, SID_FILE_NAME, FALSE ); + SFX_REQUEST_ARG( rReq, pFileName, SfxStringItem, SID_FILE_NAME, sal_False ); String aFileName = pFileName->GetValue(); String aReferer; - SFX_REQUEST_ARG( rReq, pRefererItem, SfxStringItem, SID_REFERER, FALSE ); + SFX_REQUEST_ARG( rReq, pRefererItem, SfxStringItem, SID_REFERER, sal_False ); if ( pRefererItem ) aReferer = pRefererItem->GetValue(); - SFX_REQUEST_ARG( rReq, pFileFlagsItem, SfxStringItem, SID_OPTIONS, FALSE); + SFX_REQUEST_ARG( rReq, pFileFlagsItem, SfxStringItem, SID_OPTIONS, sal_False); if ( pFileFlagsItem ) { String aFileFlags = pFileFlagsItem->GetValue(); @@ -876,25 +903,25 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) if ( STRING_NOTFOUND != aFileFlags.Search( 0x0054 ) ) // T = 54h { rReq.RemoveItem( SID_TEMPLATE ); - rReq.AppendItem( SfxBoolItem( SID_TEMPLATE, TRUE ) ); + rReq.AppendItem( SfxBoolItem( SID_TEMPLATE, sal_True ) ); } if ( STRING_NOTFOUND != aFileFlags.Search( 0x0048 ) ) // H = 48h { rReq.RemoveItem( SID_HIDDEN ); - rReq.AppendItem( SfxBoolItem( SID_HIDDEN, TRUE ) ); + rReq.AppendItem( SfxBoolItem( SID_HIDDEN, sal_True ) ); } if ( STRING_NOTFOUND != aFileFlags.Search( 0x0052 ) ) // R = 52h { rReq.RemoveItem( SID_DOC_READONLY ); - rReq.AppendItem( SfxBoolItem( SID_DOC_READONLY, TRUE ) ); + rReq.AppendItem( SfxBoolItem( SID_DOC_READONLY, sal_True ) ); } if ( STRING_NOTFOUND != aFileFlags.Search( 0x0042 ) ) // B = 42h { rReq.RemoveItem( SID_PREVIEW ); - rReq.AppendItem( SfxBoolItem( SID_PREVIEW, TRUE ) ); + rReq.AppendItem( SfxBoolItem( SID_PREVIEW, sal_True ) ); } rReq.RemoveItem( SID_OPTIONS ); @@ -1030,7 +1057,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) if ( !bFound ) { - BOOL bLoadInternal = FALSE; + sal_Bool bLoadInternal = sal_False; // security reservation: => we have to check the referer before executing if (SFX_APP()->IsSecureURL(rtl::OUString(), &aReferer)) @@ -1060,7 +1087,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) { rReq.RemoveItem( SID_TARGETNAME ); rReq.AppendItem( SfxStringItem( SID_TARGETNAME, String::CreateFromAscii("_default") ) ); - bLoadInternal = TRUE; + bLoadInternal = sal_True; } } } @@ -1095,13 +1122,13 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) SfxFrame* pTargetFrame = NULL; Reference< XFrame > xTargetFrame; - SFX_REQUEST_ARG(rReq, pFrameItem, SfxFrameItem, SID_DOCFRAME, FALSE); + SFX_REQUEST_ARG(rReq, pFrameItem, SfxFrameItem, SID_DOCFRAME, sal_False); if ( pFrameItem ) pTargetFrame = pFrameItem->GetFrame(); if ( !pTargetFrame ) { - SFX_REQUEST_ARG(rReq, pUnoFrameItem, SfxUnoFrameItem, SID_FILLFRAME, FALSE); + SFX_REQUEST_ARG(rReq, pUnoFrameItem, SfxUnoFrameItem, SID_FILLFRAME, sal_False); if ( pUnoFrameItem ) xTargetFrame = pUnoFrameItem->GetFrame(); } @@ -1110,7 +1137,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) pTargetFrame = &SfxViewFrame::Current()->GetFrame(); // check if caller has set a callback - SFX_REQUEST_ARG(rReq, pLinkItem, SfxLinkItem, SID_DONELINK, FALSE ); + SFX_REQUEST_ARG(rReq, pLinkItem, SfxLinkItem, SID_DONELINK, sal_False ); // remove from Itemset, because it confuses the parameter transformation if ( pLinkItem ) @@ -1119,20 +1146,20 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) rReq.RemoveItem( SID_DONELINK ); // check if the view must be hidden - BOOL bHidden = FALSE; - SFX_REQUEST_ARG(rReq, pHidItem, SfxBoolItem, SID_HIDDEN, FALSE); + sal_Bool bHidden = sal_False; + SFX_REQUEST_ARG(rReq, pHidItem, SfxBoolItem, SID_HIDDEN, sal_False); if ( pHidItem ) bHidden = pHidItem->GetValue(); // This request is a UI call. We have to set the right values inside the MediaDescriptor // for: InteractionHandler, StatusIndicator, MacroExecutionMode and DocTemplate. // But we have to look for already existing values or for real hidden requests. - SFX_REQUEST_ARG(rReq, pPreviewItem, SfxBoolItem, SID_PREVIEW, FALSE); + SFX_REQUEST_ARG(rReq, pPreviewItem, SfxBoolItem, SID_PREVIEW, sal_False); if (!bHidden && ( !pPreviewItem || !pPreviewItem->GetValue() ) ) { - SFX_REQUEST_ARG(rReq, pInteractionItem, SfxUnoAnyItem, SID_INTERACTIONHANDLER, FALSE); - SFX_REQUEST_ARG(rReq, pMacroExecItem , SfxUInt16Item, SID_MACROEXECMODE , FALSE); - SFX_REQUEST_ARG(rReq, pDocTemplateItem, SfxUInt16Item, SID_UPDATEDOCMODE , FALSE); + SFX_REQUEST_ARG(rReq, pInteractionItem, SfxUnoAnyItem, SID_INTERACTIONHANDLER, sal_False); + SFX_REQUEST_ARG(rReq, pMacroExecItem , SfxUInt16Item, SID_MACROEXECMODE , sal_False); + SFX_REQUEST_ARG(rReq, pDocTemplateItem, SfxUInt16Item, SID_UPDATEDOCMODE , sal_False); if (!pInteractionItem) { @@ -1148,12 +1175,12 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) // extract target name ::rtl::OUString aTarget; - SFX_REQUEST_ARG(rReq, pTargetItem, SfxStringItem, SID_TARGETNAME, FALSE); + SFX_REQUEST_ARG(rReq, pTargetItem, SfxStringItem, SID_TARGETNAME, sal_False); if ( pTargetItem ) aTarget = pTargetItem->GetValue(); else { - SFX_REQUEST_ARG( rReq, pNewViewItem, SfxBoolItem, SID_OPEN_NEW_VIEW, FALSE ); + SFX_REQUEST_ARG( rReq, pNewViewItem, SfxBoolItem, SID_OPEN_NEW_VIEW, sal_False ); if ( pNewViewItem && pNewViewItem->GetValue() ) aTarget = String::CreateFromAscii("_blank" ); } @@ -1180,7 +1207,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) } // make URL ready - SFX_REQUEST_ARG( rReq, pURLItem, SfxStringItem, SID_FILE_NAME, FALSE ); + SFX_REQUEST_ARG( rReq, pURLItem, SfxStringItem, SID_FILE_NAME, sal_False ); aFileName = pURLItem->GetValue(); if( aFileName.Len() && aFileName.GetChar(0) == '#' ) // Mark without URL { @@ -1240,7 +1267,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) { // try to find the SfxFrame for the controller SfxFrame* pCntrFrame = NULL; - for ( SfxViewShell* pShell = SfxViewShell::GetFirst( 0, FALSE ); pShell; pShell = SfxViewShell::GetNext( *pShell, 0, FALSE ) ) + for ( SfxViewShell* pShell = SfxViewShell::GetFirst( 0, sal_False ); pShell; pShell = SfxViewShell::GetNext( *pShell, 0, sal_False ) ) { if ( pShell->GetController() == xController ) { diff --git a/sfx2/source/appl/appquit.cxx b/sfx2/source/appl/appquit.cxx index 06d1359ea074..993406e41399 100644..100755 --- a/sfx2/source/appl/appquit.cxx +++ b/sfx2/source/appl/appquit.cxx @@ -31,9 +31,6 @@ #include <basic/basmgr.hxx> #include <basic/sbstar.hxx> -#ifdef WIN -#define _TL_LANG_SPECIAL -#endif #include <svl/svdde.hxx> #include <vcl/msgbox.hxx> #include <svl/eitem.hxx> @@ -43,15 +40,15 @@ #include "app.hrc" #include <sfx2/app.hxx> +#include <sfx2/evntconf.hxx> #include <sfx2/unoctitm.hxx> #include "appdata.hxx" #include <sfx2/viewsh.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/printer.hxx> #include "arrdecl.hxx" -#include "sfxresid.hxx" +#include "sfx2/sfxresid.hxx" #include <sfx2/event.hxx> -#include <sfx2/macrconf.hxx> #include <sfx2/mnumgr.hxx> #include <sfx2/templdlg.hxx> #include <sfx2/msgpool.hxx> @@ -71,9 +68,9 @@ using ::basic::BasicManagerRepository; //=================================================================== -BOOL SfxApplication::QueryExit_Impl() +sal_Bool SfxApplication::QueryExit_Impl() { - BOOL bQuit = TRUE; + sal_Bool bQuit = sal_True; // Does some instance, that can not be shut down, still require the app? if ( !bQuit ) @@ -81,11 +78,11 @@ BOOL SfxApplication::QueryExit_Impl() // Not really exit, only minimize InfoBox aInfoBox( NULL, SfxResId(MSG_CANT_QUIT) ); aInfoBox.Execute(); - OSL_TRACE( "QueryExit => FALSE (in use)" ); - return FALSE; + OSL_TRACE( "QueryExit => sal_False (in use)" ); + return sal_False; } - return TRUE; + return sal_True; } //------------------------------------------------------------------------- @@ -104,7 +101,7 @@ void SfxApplication::Deinitialize() SaveBasicAndDialogContainer(); - pAppData_Impl->bDowning = TRUE; // due to Timer from DecAliveCount and QueryExit + pAppData_Impl->bDowning = sal_True; // due to Timer from DecAliveCount and QueryExit DELETEZ( pAppData_Impl->pTemplates ); @@ -112,15 +109,15 @@ void SfxApplication::Deinitialize() // this method. Therefore this call makes no sense and is the source of // some stack traces, which we don't understand. // For more information see: - pAppData_Impl->bDowning = FALSE; + pAppData_Impl->bDowning = sal_False; DBG_ASSERT( !SfxViewFrame::GetFirst(), "existing SfxViewFrame after Execute" ); DBG_ASSERT( !SfxObjectShell::GetFirst(), "existing SfxObjectShell after Execute" ); pAppData_Impl->pAppDispat->Pop( *this, SFX_SHELL_POP_UNTIL ); pAppData_Impl->pAppDispat->Flush(); - pAppData_Impl->bDowning = TRUE; - pAppData_Impl->pAppDispat->DoDeactivate_Impl( TRUE, NULL ); + pAppData_Impl->bDowning = sal_True; + pAppData_Impl->pAppDispat->DoDeactivate_Impl( sal_True, NULL ); // call derived application-exit Exit(); @@ -143,11 +140,7 @@ void SfxApplication::Deinitialize() // from here no SvObjects have to exists DELETEZ(pAppData_Impl->pMatcher); - delete pAppData_Impl->pLabelResMgr; - DELETEX(pAppData_Impl->pSlotPool); - DELETEX(pAppData_Impl->pEventConfig); - SfxMacroConfig::Release_Impl(); DELETEX(pAppData_Impl->pFactArr); DELETEX(pAppData_Impl->pInitLinkList); diff --git a/sfx2/source/appl/appreg.cxx b/sfx2/source/appl/appreg.cxx index f80f3895d6e5..743c783471a3 100644..100755 --- a/sfx2/source/appl/appreg.cxx +++ b/sfx2/source/appl/appreg.cxx @@ -34,11 +34,11 @@ #include <sfx2/app.hxx> #include "appdata.hxx" #include "arrdecl.hxx" -#include "sfxhelp.hxx" +#include "sfx2/sfxhelp.hxx" #include <sfx2/templdlg.hxx> #include "objmnctl.hxx" #include "inettbc.hxx" -#include "stbitem.hxx" +#include "sfx2/stbitem.hxx" #include <sfx2/navigat.hxx> #include <sfx2/taskpane.hxx> #include <sfx2/module.hxx> @@ -63,9 +63,9 @@ void SfxApplication::Registrations_Impl() // ChildWindows SfxRecordingFloatWrapper_Impl::RegisterChildWindow(); - SfxNavigatorWrapper::RegisterChildWindow( FALSE, NULL, SFX_CHILDWIN_NEVERHIDE ); + SfxNavigatorWrapper::RegisterChildWindow( sal_False, NULL, SFX_CHILDWIN_NEVERHIDE ); SfxPartChildWnd_Impl::RegisterChildWindow(); - SfxTemplateDialogWrapper::RegisterChildWindow(TRUE); + SfxTemplateDialogWrapper::RegisterChildWindow(sal_True); SfxDockingWrapper::RegisterChildWindow(); // Controller @@ -86,7 +86,7 @@ void SfxApplication::RegisterToolBoxControl_Impl( SfxModule *pMod, SfxTbxCtrlFac } #ifdef DBG_UTIL - for ( USHORT n=0; n<pAppData_Impl->pTbxCtrlFac->Count(); n++ ) + for ( sal_uInt16 n=0; n<pAppData_Impl->pTbxCtrlFac->Count(); n++ ) { SfxTbxCtrlFactory *pF = (*pAppData_Impl->pTbxCtrlFac)[n]; if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId && @@ -111,7 +111,7 @@ void SfxApplication::RegisterStatusBarControl_Impl( SfxModule *pMod, SfxStbCtrlF } #ifdef DBG_UTIL - for ( USHORT n=0; n<pAppData_Impl->pStbCtrlFac->Count(); n++ ) + for ( sal_uInt16 n=0; n<pAppData_Impl->pStbCtrlFac->Count(); n++ ) { SfxStbCtrlFactory *pF = (*pAppData_Impl->pStbCtrlFac)[n]; if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId && @@ -136,7 +136,7 @@ void SfxApplication::RegisterMenuControl_Impl( SfxModule *pMod, SfxMenuCtrlFacto } #ifdef DBG_UTIL - for ( USHORT n=0; n<pAppData_Impl->pMenuCtrlFac->Count(); n++ ) + for ( sal_uInt16 n=0; n<pAppData_Impl->pMenuCtrlFac->Count(); n++ ) { SfxMenuCtrlFactory *pF = (*pAppData_Impl->pMenuCtrlFac)[n]; if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId && diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index ce56b6cc7e27..e3c7fd09be5c 100644..100755 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -91,7 +91,6 @@ #include <com/sun/star/frame/XModuleManager.hpp> #include <com/sun/star/beans/XPropertySet.hpp> -#include "about.hxx" #include "frmload.hxx" #include "referers.hxx" #include <sfx2/app.hxx> @@ -111,19 +110,17 @@ #include <sfx2/new.hxx> #include <sfx2/templdlg.hxx> #include "sfxtypes.hxx" -#include "sfxbasic.hxx" #include <sfx2/tabdlg.hxx> #include "arrdecl.hxx" #include "fltfnc.hxx" #include <sfx2/sfx.hrc> #include "app.hrc" #include <sfx2/passwd.hxx> -#include "sfxresid.hxx" +#include "sfx2/sfxresid.hxx" #include "arrdecl.hxx" #include <sfx2/childwin.hxx> #include "appdata.hxx" -#include <sfx2/macrconf.hxx> -#include "minfitem.hxx" +#include "sfx2/minfitem.hxx" #include <sfx2/event.hxx> #include <sfx2/module.hxx> #include <sfx2/viewfrm.hxx> @@ -132,7 +129,8 @@ #include <sfx2/sfxdlg.hxx> #include <sfx2/dialogs.hrc> #include "sorgitm.hxx" -#include "sfxhelp.hxx" +#include "sfx2/sfxhelp.hxx" +#include <tools/svlibrary.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::beans; @@ -230,7 +228,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) continue; if ( pObjSh->PrepareClose(2) ) - pObjSh->SetModified( FALSE ); + pObjSh->SetModified( sal_False ); else return; } @@ -251,21 +249,21 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) if this dialog is closed by the user ... So we ignore this request now and wait for a new user decision. */ - OSL_TRACE( "QueryExit => FALSE (DispatchLevel == %u)", Application::GetDispatchLevel() ); + OSL_TRACE( "QueryExit => sal_False (DispatchLevel == %u)", Application::GetDispatchLevel() ); return; } // block reentrant calls - pAppData_Impl->bInQuit = TRUE; + pAppData_Impl->bInQuit = sal_True; Reference < XDesktop > xDesktop ( ::comphelper::getProcessServiceFactory()->createInstance( DEFINE_CONST_UNICODE("com.sun.star.frame.Desktop") ), UNO_QUERY ); rReq.ForgetAllArgs(); - // if terminate() failed, pAppData_Impl->bInQuit will now be FALSE, allowing further calls of SID_QUITAPP - BOOL bTerminated = xDesktop->terminate(); + // if terminate() failed, pAppData_Impl->bInQuit will now be sal_False, allowing further calls of SID_QUITAPP + sal_Bool bTerminated = xDesktop->terminate(); if (!bTerminated) // if terminate() was successful, SfxApplication is now dead! - pAppData_Impl->bInQuit = FALSE; + pAppData_Impl->bInQuit = sal_False; // Set return value, terminate if possible rReq.SetReturnValue( SfxBoolItem( rReq.GetSlot(), bTerminated ) ); @@ -298,7 +296,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) Reference< XFrame > xFrame; const SfxItemSet* pIntSet = rReq.GetInternalArgs_Impl(); - SFX_ITEMSET_ARG( pIntSet, pFrameItem, SfxUnoFrameItem, SID_FILLFRAME, FALSE ); + SFX_ITEMSET_ARG( pIntSet, pFrameItem, SfxUnoFrameItem, SID_FILLFRAME, sal_False ); if ( pFrameItem ) xFrame = pFrameItem->GetFrame(); @@ -348,7 +346,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) } while( sal_True ); - BOOL bOk = ( n == 0); + sal_Bool bOk = ( n == 0); rReq.SetReturnValue( SfxBoolItem( 0, bOk ) ); bDone = true; break; @@ -356,7 +354,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) case SID_SAVEDOCS: { - BOOL bOK = TRUE; + sal_Bool bOK = sal_True; for ( SfxObjectShell *pObjSh = SfxObjectShell::GetFirst(); pObjSh; pObjSh = SfxObjectShell::GetNext( *pObjSh ) ) @@ -367,7 +365,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) pObjSh->ExecuteSlot( aReq ); SfxBoolItem *pItem = PTR_CAST( SfxBoolItem, aReq.GetReturnValue() ); if ( !pItem || !pItem->GetValue() ) - bOK = FALSE; + bOK = sal_False; } } @@ -430,8 +428,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) Help* pHelp = Application::GetHelp(); if ( pHelp ) { - ULONG nHelpId = 0; - pHelp->Start( nHelpId, NULL ); // show start page + pHelp->Start( String::CreateFromAscii(".uno:HelpIndex"), NULL ); // show start page bDone = true; } break; @@ -441,7 +438,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) case SID_HELPTIPS: { // Evaluate Parameter - SFX_REQUEST_ARG(rReq, pOnItem, SfxBoolItem, SID_HELPTIPS, FALSE); + SFX_REQUEST_ARG(rReq, pOnItem, SfxBoolItem, SID_HELPTIPS, sal_False); bool bOn = pOnItem ? ((SfxBoolItem*)pOnItem)->GetValue() : !Help::IsQuickHelpEnabled(); @@ -468,7 +465,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) case SID_HELPBALLOONS: { // Evaluate Parameter - SFX_REQUEST_ARG(rReq, pOnItem, SfxBoolItem, SID_HELPBALLOONS, FALSE); + SFX_REQUEST_ARG(rReq, pOnItem, SfxBoolItem, SID_HELPBALLOONS, sal_False); bool bOn = pOnItem ? ((SfxBoolItem*)pOnItem)->GetValue() : !Help::IsBalloonHelpEnabled(); @@ -491,7 +488,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) case SID_HELP_PI: { SvtHelpOptions aHelpOpt; - SFX_REQUEST_ARG(rReq, pOnItem, SfxBoolItem, SID_HELP_PI, FALSE); + SFX_REQUEST_ARG(rReq, pOnItem, SfxBoolItem, SID_HELP_PI, sal_False); sal_Bool bOn = pOnItem ? ((SfxBoolItem*)pOnItem)->GetValue() : !aHelpOpt.IsHelpAgentAutoStartMode(); @@ -504,85 +501,14 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - case SID_ABOUT: { - const String sCWSSchema( String::CreateFromAscii( "[CWS:" ) ); - rtl::OUString sDefault; - String sBuildId( utl::Bootstrap::getBuildIdData( sDefault ) ); - OSL_ENSURE( sBuildId.Len() > 0, "No BUILDID in bootstrap file" ); - if ( sBuildId.Len() > 0 && sBuildId.Search( sCWSSchema ) == STRING_NOTFOUND ) - { - // no cws part in brand buildid -> try basis buildid - rtl::OUString sBasisBuildId( DEFINE_CONST_OUSTRING( - "${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("version") ":buildid}" ) ); - rtl::Bootstrap::expandMacros( sBasisBuildId ); - sal_Int32 nIndex = sBasisBuildId.indexOf( sCWSSchema ); - if ( nIndex != -1 ) - sBuildId += String( sBasisBuildId.copy( nIndex ) ); - } - - String sProductSource( utl::Bootstrap::getProductSource( sDefault ) ); - OSL_ENSURE( sProductSource.Len() > 0, "No ProductSource in bootstrap file" ); - - // the product source is something like "DEV300", where the - // build id is something like "300m12(Build:12345)". For better readability, - // strip the duplicate UPD ("300"). - if ( sProductSource.Len() ) - { - bool bMatchingUPD = - ( sProductSource.Len() >= 3 ) - && ( sBuildId.Len() >= 3 ) - && ( sProductSource.Copy( sProductSource.Len() - 3 ) == sBuildId.Copy( 0, 3 ) ); - OSL_ENSURE( bMatchingUPD, "BUILDID and ProductSource do not match in their UPD" ); - if ( bMatchingUPD ) - sProductSource = sProductSource.Copy( 0, sProductSource.Len() - 3 ); - - // prepend the product source - sBuildId.Insert( sProductSource, 0 ); - } - - // Version information (in about box) (#i94693#) - /* if the build ids of the basis or ure layer are different from the build id - * of the brand layer then show them */ - rtl::OUString aBasisProductBuildId( DEFINE_CONST_OUSTRING( - "${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("version") ":ProductBuildid}" ) ); - rtl::Bootstrap::expandMacros( aBasisProductBuildId ); - rtl::OUString aUREProductBuildId( DEFINE_CONST_OUSTRING( - "${$URE_BIN_DIR/" SAL_CONFIGFILE("version") ":ProductBuildid}" ) ); - rtl::Bootstrap::expandMacros( aUREProductBuildId ); - if ( sBuildId.Search( String( aBasisProductBuildId ) ) == STRING_NOTFOUND - || sBuildId.Search( String( aUREProductBuildId ) ) == STRING_NOTFOUND ) - { - String sTemp( '-' ); - sTemp += String( aBasisProductBuildId ); - sTemp += '-'; - sTemp += String( aUREProductBuildId ); - sBuildId.Insert( sTemp, sBuildId.Search( ')' ) ); - } - - // the build id format is "milestone(build)[cwsname]". For readability, it would - // be nice to have some more spaces in there. - xub_StrLen nPos = 0; - if ( ( nPos = sBuildId.Search( sal_Unicode( '(' ) ) ) != STRING_NOTFOUND ) - sBuildId.Insert( sal_Unicode( ' ' ), nPos ); - if ( ( nPos = sBuildId.Search( sal_Unicode( '[' ) ) ) != STRING_NOTFOUND ) - sBuildId.Insert( sal_Unicode( ' ' ), nPos ); - - // search for the resource of the about box - ResId aDialogResId( RID_DEFAULTABOUT, *pAppData_Impl->pLabelResMgr ); - ResMgr* pResMgr = pAppData_Impl->pLabelResMgr; - if( ! pResMgr->IsAvailable( aDialogResId.SetRT( RSC_MODALDIALOG ) ) ) - pResMgr = GetOffResManager_Impl(); - - aDialogResId.SetResMgr( pResMgr ); - if ( !pResMgr->IsAvailable( aDialogResId ) ) + SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); + if ( pFact ) { - DBG_ERRORFILE( "No RID_DEFAULTABOUT in label-resource-dll" ); - } - - // then show the about box - AboutDialog* pDlg = new AboutDialog( 0, aDialogResId, sBuildId ); - pDlg->Execute(); - delete pDlg; + VclAbstractDialog* pDlg = pFact->CreateVclDialog( 0, RID_DEFAULTABOUT ); + pDlg->Execute(); + delete pDlg; bDone = true; + } break; } @@ -629,7 +555,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) TYPE(SfxBoolItem))); bool bShow = pItem == 0 ? !pAppData_Impl->m_xImeStatusWindow->isShowing() - : ( pItem->GetValue() == TRUE ); + : ( pItem->GetValue() == sal_True ); pAppData_Impl->m_xImeStatusWindow->show(bShow); if (pItem == 0) rReq.AppendItem(SfxBoolItem(SID_SHOW_IME_STATUS_WINDOW, @@ -676,7 +602,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) // Evaluate Parameter rtl::OUString aToolbarName( aBuf.makeStringAndClear() ); - BOOL bShow( !xLayoutManager->isElementVisible( aToolbarName )); + sal_Bool bShow( !xLayoutManager->isElementVisible( aToolbarName )); if ( bShow ) { @@ -707,11 +633,11 @@ void SfxApplication::MiscState_Impl(SfxItemSet &rSet) DBG_MEMTEST(); LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() ); - const USHORT *pRanges = rSet.GetRanges(); + const sal_uInt16 *pRanges = rSet.GetRanges(); DBG_ASSERT(pRanges && *pRanges, "Set without range"); while ( *pRanges ) { - for(USHORT nWhich = *pRanges++; nWhich <= *pRanges; ++nWhich) + for(sal_uInt16 nWhich = *pRanges++; nWhich <= *pRanges; ++nWhich) { switch(nWhich) { @@ -779,14 +705,14 @@ void SfxApplication::MiscState_Impl(SfxItemSet &rSet) case SID_SAVEDOCS: { - BOOL bModified = FALSE; + sal_Bool bModified = sal_False; for ( SfxObjectShell *pObjSh = SfxObjectShell::GetFirst(); pObjSh; pObjSh = SfxObjectShell::GetNext( *pObjSh ) ) { if ( pObjSh->IsModified() ) { - bModified = TRUE; + bModified = sal_True; break; } } @@ -821,20 +747,18 @@ static const ::rtl::OUString& getProductRegistrationServiceName( ) return s_sServiceName; } -typedef rtl_uString* (SAL_CALL *basicide_choose_macro)(XModel*, BOOL, rtl_uString*); -typedef void (SAL_CALL *basicide_macro_organizer)( INT16 ); +typedef rtl_uString* (SAL_CALL *basicide_choose_macro)(XModel*, sal_Bool, rtl_uString*); +typedef void (SAL_CALL *basicide_macro_organizer)( sal_Int16 ); #define DOSTRING( x ) #x #define STRING( x ) DOSTRING( x ) extern "C" { static void SAL_CALL thisModule() {} } -::rtl::OUString ChooseMacro( const Reference< XModel >& rxLimitToDocument, BOOL bChooseOnly, const ::rtl::OUString& rMacroDesc = ::rtl::OUString() ) +::rtl::OUString ChooseMacro( const Reference< XModel >& rxLimitToDocument, sal_Bool bChooseOnly, const ::rtl::OUString& rMacroDesc = ::rtl::OUString() ) { // get basctl dllname - String sLibName = String::CreateFromAscii( STRING( DLL_NAME ) ); - sLibName.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "sfx" ) ), String( RTL_CONSTASCII_USTRINGPARAM( "basctl" ) ) ); - ::rtl::OUString aLibName( sLibName ); + static ::rtl::OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "basctl" ) ) ); // load module oslModule handleMod = osl_loadModuleRelative( @@ -851,12 +775,10 @@ extern "C" { static void SAL_CALL thisModule() {} } return aScriptURL; } -void MacroOrganizer( INT16 nTabId ) +void MacroOrganizer( sal_Int16 nTabId ) { // get basctl dllname - String sLibName = String::CreateFromAscii( STRING( DLL_NAME ) ); - sLibName.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "sfx" ) ), String( RTL_CONSTASCII_USTRINGPARAM( "basctl" ) ) ); - ::rtl::OUString aLibName( sLibName ); + static ::rtl::OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "basctl" ) ) ); // load module oslModule handleMod = osl_loadModuleRelative( @@ -1017,7 +939,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) if (pObjSh) pObjSh->SetConfigOptionsChecked(false); } - pView->GetBindings().InvalidateAll(FALSE); + pView->GetBindings().InvalidateAll(sal_False); pView = SfxViewFrame::GetNext( *pView ); } } @@ -1100,7 +1022,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) { SfxObjectShell* pBasicIDE = SfxObjectShell::CreateObject( lcl_getBasicIDEServiceName() ); pBasicIDE->DoInitNew( 0 ); - pBasicIDE->SetModified( FALSE ); + pBasicIDE->SetModified( sal_False ); try { // load the Basic IDE via direct access to the SFX frame loader. A generic loadComponentFromURL @@ -1157,15 +1079,15 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) { const SfxItemSet* pArgs = rReq.GetArgs(); const SfxPoolItem* pItem; - BOOL bChooseOnly = FALSE; + sal_Bool bChooseOnly = sal_False; Reference< XModel > xLimitToModel; if(pArgs && SFX_ITEM_SET == pArgs->GetItemState(SID_RECORDMACRO, sal_False, &pItem) ) { - BOOL bRecord = ((SfxBoolItem*)pItem)->GetValue(); + sal_Bool bRecord = ((SfxBoolItem*)pItem)->GetValue(); if ( bRecord ) { // !Hack - bChooseOnly = FALSE; + bChooseOnly = sal_False; SfxObjectShell* pCurrentShell = SfxObjectShell::Current(); OSL_ENSURE( pCurrentShell, "macro recording outside an SFX document?" ); if ( pCurrentShell ) @@ -1183,7 +1105,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) OSL_TRACE("handling SID_MACROORGANIZER"); const SfxItemSet* pArgs = rReq.GetArgs(); const SfxPoolItem* pItem; - INT16 nTabId = 0; + sal_Int16 nTabId = 0; if(pArgs && SFX_ITEM_SET == pArgs->GetItemState(SID_MACROORGANIZER, sal_False, &pItem) ) { nTabId = ((SfxUInt16Item*)pItem)->GetValue(); @@ -1201,7 +1123,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) Reference< XFrame > xFrame; const SfxItemSet* pIntSet = rReq.GetInternalArgs_Impl(); - SFX_ITEMSET_ARG( pIntSet, pFrameItem, SfxUnoFrameItem, SID_FILLFRAME, FALSE ); + SFX_ITEMSET_ARG( pIntSet, pFrameItem, SfxUnoFrameItem, SID_FILLFRAME, sal_False ); if ( pFrameItem ) xFrame = pFrameItem->GetFrame(); @@ -1215,7 +1137,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) do // artificial loop for flow control { AbstractScriptSelectorDialog* pDlg = pFact->CreateScriptSelectorDialog( - lcl_getDialogParent( xFrame, GetTopWindow() ), FALSE, xFrame ); + lcl_getDialogParent( xFrame, GetTopWindow() ), sal_False, xFrame ); OSL_ENSURE( pDlg, "SfxApplication::OfaExec_Impl( SID_RUNMACRO ): no dialog!" ); if ( !pDlg ) break; @@ -1283,7 +1205,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) if ( pStringItem ) { String aPLZ = pStringItem->GetValue(); - bRet = TRUE /*!!!SfxIniManager::CheckPLZ( aPLZ )*/; + bRet = sal_True /*!!!SfxIniManager::CheckPLZ( aPLZ )*/; } else SbxBase::SetError( SbxERR_WRONG_ARGS ); @@ -1300,7 +1222,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) const SfxPoolItem* pItem=NULL; const SfxItemSet* pSet = rReq.GetArgs(); SfxItemPool* pSetPool = pSet ? pSet->GetPool() : NULL; - if ( pSet && pSet->GetItemState( pSetPool->GetWhich( SID_AUTO_CORRECT_DLG ), FALSE, &pItem ) == SFX_ITEM_SET ) + if ( pSet && pSet->GetItemState( pSetPool->GetWhich( SID_AUTO_CORRECT_DLG ), sal_False, &pItem ) == SFX_ITEM_SET ) aSet.Put( *pItem ); SfxAbstractTabDialog* pDlg = pFact->CreateTabDialog( RID_OFA_AUTOCORR_DLG, NULL, &aSet, NULL ); @@ -1389,7 +1311,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) if (xDialog.is()) xDialog->execute(); else - ShowServiceNotAvailableError(NULL, sDialogServiceName, TRUE); + ShowServiceNotAvailableError(NULL, sDialogServiceName, sal_True); } catch(::com::sun::star::uno::Exception&) { @@ -1410,11 +1332,11 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) void SfxApplication::OfaState_Impl(SfxItemSet &rSet) { - const USHORT *pRanges = rSet.GetRanges(); + const sal_uInt16 *pRanges = rSet.GetRanges(); DBG_ASSERT(pRanges && *pRanges, "Set without Region"); while ( *pRanges ) { - for(USHORT nWhich = *pRanges++; nWhich <= *pRanges; ++nWhich) + for(sal_uInt16 nWhich = *pRanges++; nWhich <= *pRanges; ++nWhich) { switch(nWhich) { diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index 9ecd8764fdad..252b3f6ab8e2 100644..100755 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -95,7 +95,9 @@ #include <tools/cachestr.hxx> #include <osl/mutex.hxx> #include <comphelper/sequence.hxx> +#include <framework/documentundoguard.hxx> #include <rtl/ustrbuf.hxx> +#include <comphelper/interaction.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::ucb; @@ -116,7 +118,6 @@ using namespace ::com::sun::star::io; #include <sfx2/fcontnr.hxx> #include "frmload.hxx" #include <sfx2/frame.hxx> -#include "sfxbasic.hxx" #include <sfx2/objsh.hxx> #include <sfx2/objuno.hxx> #include <sfx2/unoctitm.hxx> @@ -127,7 +128,7 @@ using namespace ::com::sun::star::io; #include "fltoptint.hxx" #include <sfx2/docfile.hxx> #include <sfx2/sfxbasecontroller.hxx> -#include "brokenpackageint.hxx" +#include <sfx2/brokenpackageint.hxx> #include "eventsupplier.hxx" #include "xpackcreator.hxx" #include "plugin.hxx" @@ -135,7 +136,6 @@ using namespace ::com::sun::star::io; #include <ownsubfilterservice.hxx> #include "SfxDocumentMetaData.hxx" - #define PROTOCOLHANDLER_SERVICENAME "com.sun.star.frame.ProtocolHandler" static char const sTemplateRegionName[] = "TemplateRegionName"; @@ -161,7 +161,7 @@ static char const sDontEdit[] = "DontEdit"; static char const sSilent[] = "Silent"; static char const sJumpMark[] = "JumpMark"; static char const sFileName[] = "FileName"; -static char const sSalvageURL[] = "SalvagedFile"; +static char const sSalvagedFile[] = "SalvagedFile"; static char const sStatusInd[] = "StatusIndicator"; static char const sModel[] = "Model"; static char const sFrame[] = "Frame"; @@ -187,6 +187,10 @@ static char const sUseSystemDialog[] = "UseSystemDialog"; static char const sStandardDir[] = "StandardDir"; static char const sBlackList[] = "BlackList"; static char const sModifyPasswordInfo[] = "ModifyPasswordInfo"; +static char const sSuggestedSaveAsDir[] = "SuggestedSaveAsDir"; +static char const sSuggestedSaveAsName[] = "SuggestedSaveAsName"; +static char const sEncryptionData[] = "EncryptionData"; + void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& rArgs, SfxAllItemSet& rSet, const SfxSlot* pSlot ) { @@ -221,10 +225,10 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque return; } - USHORT nWhich = rSet.GetPool()->GetWhich(nSlotId); - BOOL bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == SFX_MAPUNIT_TWIP ); + sal_uInt16 nWhich = rSet.GetPool()->GetWhich(nSlotId); + sal_Bool bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == SFX_MAPUNIT_TWIP ); pItem->SetWhich( nWhich ); - USHORT nSubCount = pType->nAttribs; + sal_uInt16 nSubCount = pType->nAttribs; const ::com::sun::star::beans::PropertyValue& rProp = pPropsVal[0]; String aName = rProp.Name; @@ -269,11 +273,11 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque } #endif // complex property; collect sub items from the parameter set and reconstruct complex item - USHORT nFound=0; + sal_uInt16 nFound=0; for ( sal_uInt16 n=0; n<nCount; n++ ) { const ::com::sun::star::beans::PropertyValue& rPropValue = pPropsVal[n]; - USHORT nSub; + sal_uInt16 nSub; for ( nSub=0; nSub<nSubCount; nSub++ ) { // search sub item by name @@ -283,7 +287,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque const char* pName = aStr.GetBuffer(); if ( rPropValue.Name.compareToAscii( pName ) == COMPARE_EQUAL ) { - BYTE nSubId = (BYTE) (sal_Int8) pType->aAttrib[nSub].nAID; + sal_uInt8 nSubId = (sal_uInt8) (sal_Int8) pType->aAttrib[nSub].nAID; if ( bConvertTwips ) nSubId |= CONVERT_TWIPS; if ( pItem->PutValue( rPropValue.Value, nSubId ) ) @@ -339,11 +343,11 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque return; } - USHORT nWhich = rSet.GetPool()->GetWhich(rArg.nSlotId); - BOOL bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == SFX_MAPUNIT_TWIP ); + sal_uInt16 nWhich = rSet.GetPool()->GetWhich(rArg.nSlotId); + sal_Bool bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == SFX_MAPUNIT_TWIP ); pItem->SetWhich( nWhich ); const SfxType* pType = rArg.pType; - USHORT nSubCount = pType->nAttribs; + sal_uInt16 nSubCount = pType->nAttribs; if ( nSubCount == 0 ) { // "simple" (base type) argument @@ -374,14 +378,14 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque else { // complex argument, could be passed in one struct - BOOL bAsWholeItem = FALSE; + sal_Bool bAsWholeItem = sal_False; for ( sal_uInt16 n=0; n<nCount; n++ ) { const ::com::sun::star::beans::PropertyValue& rProp = pPropsVal[n]; String aName = rProp.Name; if ( aName.CompareToAscii(rArg.pName) == COMPARE_EQUAL ) { - bAsWholeItem = TRUE; + bAsWholeItem = sal_True; #ifdef DBG_UTIL ++nFoundArgs; #endif @@ -404,11 +408,11 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque // complex argument; collect sub items from argument array and reconstruct complex item // only put item if at least one member was found and had the correct type // (is this a good idea?! Should we ask for *all* members?) - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; for ( sal_uInt16 n=0; n<nCount; n++ ) { const ::com::sun::star::beans::PropertyValue& rProp = pPropsVal[n]; - for ( USHORT nSub=0; nSub<nSubCount; nSub++ ) + for ( sal_uInt16 nSub=0; nSub<nSubCount; nSub++ ) { // search sub item by name ByteString aStr( rArg.pName ); @@ -418,17 +422,17 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if ( rProp.Name.compareToAscii( pName ) == COMPARE_EQUAL ) { // at least one member found ... - bRet = TRUE; + bRet = sal_True; #ifdef DBG_UTIL ++nFoundArgs; #endif - BYTE nSubId = (BYTE) (sal_Int8) pType->aAttrib[nSub].nAID; + sal_uInt8 nSubId = (sal_uInt8) (sal_Int8) pType->aAttrib[nSub].nAID; if ( bConvertTwips ) nSubId |= CONVERT_TWIPS; if (!pItem->PutValue( rProp.Value, nSubId ) ) { // ... but it was not convertable - bRet = FALSE; + bRet = sal_False; #ifdef DBG_UTIL ByteString aDbgStr( "Property not convertable: "); aDbgStr += rArg.pName; @@ -689,7 +693,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque { ::rtl::OUString sVal; sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength()); - DBG_ASSERT( bOK, "invalid type or value for StanadardDir" ); + DBG_ASSERT( bOK, "invalid type or value for StandardDir" ); if (bOK) rSet.Put( SfxStringItem( SID_STANDARD_DIR, sVal ) ); } @@ -713,11 +717,11 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxStringItem( SID_FILE_NAME, sVal ) ); } - else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sSalvageURL)) ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sSalvagedFile)) ) { ::rtl::OUString sVal; sal_Bool bOK = (rProp.Value >>= sVal); - DBG_ASSERT( bOK, "invalid type or value for SalvageURL" ); + DBG_ASSERT( bOK, "invalid type or value for SalvagedFile" ); if (bOK) rSet.Put( SfxStringItem( SID_DOC_SALVAGE, sVal ) ); } @@ -725,7 +729,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque { ::rtl::OUString sVal; sal_Bool bOK = (rProp.Value >>= sVal); - DBG_ASSERT( bOK, "invalid type or value for SalvageURL" ); + DBG_ASSERT( bOK, "invalid type or value for FolderName" ); if (bOK) rSet.Put( SfxStringItem( SID_PATH, sVal ) ); } @@ -854,6 +858,26 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque { rSet.Put( SfxUnoAnyItem( SID_MODIFYPASSWORDINFO, rProp.Value ) ); } + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sEncryptionData)) ) + { + rSet.Put( SfxUnoAnyItem( SID_ENCRYPTIONDATA, rProp.Value ) ); + } + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sSuggestedSaveAsDir)) ) + { + ::rtl::OUString sVal; + sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength()); + DBG_ASSERT( bOK, "invalid type or value for SuggestedSaveAsDir" ); + if (bOK) + rSet.Put( SfxStringItem( SID_SUGGESTEDSAVEASDIR, sVal ) ); + } + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sSuggestedSaveAsName)) ) + { + ::rtl::OUString sVal; + sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength()); + DBG_ASSERT( bOK, "invalid type or value for SuggestedSaveAsName" ); + if (bOK) + rSet.Put( SfxStringItem( SID_SUGGESTEDSAVEASNAME, sVal ) ); + } #ifdef DBG_UTIL else --nFoundArgs; @@ -919,10 +943,10 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta if ( !pSlot->IsMode(SFX_SLOT_METHOD) ) { // slot is a property - USHORT nWhich = rSet.GetPool()->GetWhich(nSlotId); + sal_uInt16 nWhich = rSet.GetPool()->GetWhich(nSlotId); if ( rSet.GetItemState( nWhich ) == SFX_ITEM_SET ) //??? { - USHORT nSubCount = pType->nAttribs; + sal_uInt16 nSubCount = pType->nAttribs; if ( nSubCount ) // it's a complex property, we want it split into simple types // so we expect to get as many items as we have (sub) members @@ -948,15 +972,15 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta else { // slot is a method - USHORT nFormalArgs = pSlot->GetFormalArgumentCount(); - for ( USHORT nArg=0; nArg<nFormalArgs; ++nArg ) + sal_uInt16 nFormalArgs = pSlot->GetFormalArgumentCount(); + for ( sal_uInt16 nArg=0; nArg<nFormalArgs; ++nArg ) { // check every formal argument of the method const SfxFormalArgument &rArg = pSlot->GetFormalArgument( nArg ); - USHORT nWhich = rSet.GetPool()->GetWhich( rArg.nSlotId ); + sal_uInt16 nWhich = rSet.GetPool()->GetWhich( rArg.nSlotId ); if ( rSet.GetItemState( nWhich ) == SFX_ITEM_SET ) //??? { - USHORT nSubCount = rArg.pType->nAttribs; + sal_uInt16 nSubCount = rArg.pType->nAttribs; if ( nSubCount ) // argument has a complex type, we want it split into simple types // so for this argument we expect to get as many items as we have (sub) members @@ -1069,6 +1093,13 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta nAdditional++; if ( rSet.GetItemState( SID_MODIFYPASSWORDINFO ) == SFX_ITEM_SET ) nAdditional++; + if ( rSet.GetItemState( SID_SUGGESTEDSAVEASDIR ) == SFX_ITEM_SET ) + nAdditional++; + if ( rSet.GetItemState( SID_ENCRYPTIONDATA ) == SFX_ITEM_SET ) + nAdditional++; + nAdditional++; + if ( rSet.GetItemState( SID_SUGGESTEDSAVEASNAME ) == SFX_ITEM_SET ) + nAdditional++; // consider additional arguments nProps += nAdditional; @@ -1084,10 +1115,10 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta if ( rSet.Count() != nItems ) { // detect unknown item and present error message - const USHORT *pRanges = rSet.GetRanges(); + const sal_uInt16 *pRanges = rSet.GetRanges(); while ( *pRanges ) { - for(USHORT nId = *pRanges++; nId <= *pRanges; ++nId) + for(sal_uInt16 nId = *pRanges++; nId <= *pRanges; ++nId) { if ( rSet.GetItemState(nId) < SFX_ITEM_SET ) //??? // not really set @@ -1096,12 +1127,12 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta if ( !pSlot->IsMode(SFX_SLOT_METHOD) && nId == rSet.GetPool()->GetWhich( pSlot->GetSlotId() ) ) continue; - USHORT nFormalArgs = pSlot->GetFormalArgumentCount(); - USHORT nArg; + sal_uInt16 nFormalArgs = pSlot->GetFormalArgumentCount(); + sal_uInt16 nArg; for ( nArg=0; nArg<nFormalArgs; ++nArg ) { const SfxFormalArgument &rArg = pSlot->GetFormalArgument( nArg ); - USHORT nWhich = rSet.GetPool()->GetWhich( rArg.nSlotId ); + sal_uInt16 nWhich = rSet.GetPool()->GetWhich( rArg.nSlotId ); if ( nId == nWhich ) break; } @@ -1204,12 +1235,18 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta continue; if ( nId == SID_NOAUTOSAVE ) continue; + if ( nId == SID_ENCRYPTIONDATA ) + continue; // used only internally if ( nId == SID_SAVETO ) continue; if ( nId == SID_MODIFYPASSWORDINFO ) continue; + if ( nId == SID_SUGGESTEDSAVEASDIR ) + continue; + if ( nId == SID_SUGGESTEDSAVEASNAME ) + continue; } ByteString aDbg( "Unknown item detected: "); @@ -1231,12 +1268,12 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta if ( !pSlot->IsMode(SFX_SLOT_METHOD) ) { // slot is a property - USHORT nWhich = rSet.GetPool()->GetWhich(nSlotId); - BOOL bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == SFX_MAPUNIT_TWIP ); + sal_uInt16 nWhich = rSet.GetPool()->GetWhich(nSlotId); + sal_Bool bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == SFX_MAPUNIT_TWIP ); SFX_ITEMSET_ARG( &rSet, pItem, SfxPoolItem, nWhich, sal_False ); if ( pItem ) //??? { - USHORT nSubCount = pType->nAttribs; + sal_uInt16 nSubCount = pType->nAttribs; if ( !nSubCount ) { pValue[nActProp].Name = String( String::CreateFromAscii( pSlot->pUnoName ) ) ; @@ -1250,9 +1287,9 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta else { // complex type, add a property value for every member of the struct - for ( USHORT n=1; n<=nSubCount; ++n ) + for ( sal_uInt16 n=1; n<=nSubCount; ++n ) { - BYTE nSubId = (BYTE) (sal_Int8) pType->aAttrib[n-1].nAID; + sal_uInt8 nSubId = (sal_uInt8) (sal_Int8) pType->aAttrib[n-1].nAID; if ( bConvertTwips ) nSubId |= CONVERT_TWIPS; @@ -1276,16 +1313,16 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta else { // slot is a method - USHORT nFormalArgs = pSlot->GetFormalArgumentCount(); - for ( USHORT nArg=0; nArg<nFormalArgs; ++nArg ) + sal_uInt16 nFormalArgs = pSlot->GetFormalArgumentCount(); + for ( sal_uInt16 nArg=0; nArg<nFormalArgs; ++nArg ) { const SfxFormalArgument &rArg = pSlot->GetFormalArgument( nArg ); - USHORT nWhich = rSet.GetPool()->GetWhich( rArg.nSlotId ); - BOOL bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == SFX_MAPUNIT_TWIP ); + sal_uInt16 nWhich = rSet.GetPool()->GetWhich( rArg.nSlotId ); + sal_Bool bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == SFX_MAPUNIT_TWIP ); SFX_ITEMSET_ARG( &rSet, pItem, SfxPoolItem, nWhich, sal_False ); if ( pItem ) //??? { - USHORT nSubCount = rArg.pType->nAttribs; + sal_uInt16 nSubCount = rArg.pType->nAttribs; if ( !nSubCount ) { pValue[nActProp].Name = String( String::CreateFromAscii( rArg.pName ) ) ; @@ -1299,9 +1336,9 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta else { // complex type, add a property value for every member of the struct - for ( USHORT n = 1; n <= nSubCount; ++n ) + for ( sal_uInt16 n = 1; n <= nSubCount; ++n ) { - BYTE nSubId = (BYTE) (sal_Int8) rArg.pType->aAttrib[n-1].nAID; + sal_uInt8 nSubId = (sal_uInt8) (sal_Int8) rArg.pType->aAttrib[n-1].nAID; if ( bConvertTwips ) nSubId |= CONVERT_TWIPS; @@ -1495,7 +1532,7 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta } if ( rSet.GetItemState( SID_DOC_SALVAGE, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sSalvageURL)); + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sSalvagedFile)); pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); } if ( rSet.GetItemState( SID_PATH, sal_False, &pItem ) == SFX_ITEM_SET ) @@ -1574,6 +1611,21 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sModifyPasswordInfo)); pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); } + if ( rSet.GetItemState( SID_ENCRYPTIONDATA, sal_False, &pItem ) == SFX_ITEM_SET ) + { + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sEncryptionData)); + pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); + } + if ( rSet.GetItemState( SID_SUGGESTEDSAVEASDIR, sal_False, &pItem ) == SFX_ITEM_SET ) + { + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sSuggestedSaveAsDir)); + pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); + } + if ( rSet.GetItemState( SID_SUGGESTEDSAVEASNAME, sal_False, &pItem ) == SFX_ITEM_SET ) + { + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sSuggestedSaveAsName)); + pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); + } } } @@ -1729,12 +1781,9 @@ void SAL_CALL SfxMacroLoader::removeStatusListener( { } -// ----------------------------------------------------------------------- ErrCode SfxMacroLoader::loadMacro( const ::rtl::OUString& rURL, com::sun::star::uno::Any& rRetval, SfxObjectShell* pSh ) throw ( ::com::sun::star::uno::RuntimeException ) { - SfxApplication* pApp = SFX_APP(); - pApp->EnterBasicCall(); SfxObjectShell* pCurrent = pSh; if ( !pCurrent ) // all not full qualified names use the BASIC of the given or current document @@ -1780,18 +1829,21 @@ ErrCode SfxMacroLoader::loadMacro( const ::rtl::OUString& rURL, com::sun::star:: if ( pBasMgr ) { - if ( pSh && pDoc ) + const bool bIsAppBasic = ( pBasMgr == pAppMgr ); + const bool bIsDocBasic = ( pBasMgr != pAppMgr ); + + if ( pDoc ) { - // security check for macros from document basic if an SFX context (pSh) is given + // security check for macros from document basic if an SFX doc is given if ( !pDoc->AdjustMacroMode( String() ) ) // check forbids execution return ERRCODE_IO_ACCESSDENIED; } - else if ( pSh && pSh->GetMedium() ) + else if ( pDoc && pDoc->GetMedium() ) { - pSh->AdjustMacroMode( String() ); - SFX_ITEMSET_ARG( pSh->GetMedium()->GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, sal_False); - SFX_ITEMSET_ARG( pSh->GetMedium()->GetItemSet(), pMacroExecModeItem, SfxUInt16Item, SID_MACROEXECMODE, sal_False); + pDoc->AdjustMacroMode( String() ); + SFX_ITEMSET_ARG( pDoc->GetMedium()->GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, sal_False); + SFX_ITEMSET_ARG( pDoc->GetMedium()->GetItemSet(), pMacroExecModeItem, SfxUInt16Item, SID_MACROEXECMODE, sal_False); if ( pUpdateDocItem && pMacroExecModeItem && pUpdateDocItem->GetValue() == document::UpdateDocMode::NO_UPDATE && pMacroExecModeItem->GetValue() == document::MacroExecMode::NEVER_EXECUTE ) @@ -1808,76 +1860,49 @@ ErrCode SfxMacroLoader::loadMacro( const ::rtl::OUString& rURL, com::sun::star:: aQualifiedMethod.Erase( nArgsPos - nHashPos - 1 ); } - SbxMethod *pMethod = SfxQueryMacro( pBasMgr, aQualifiedMethod ); - if ( pMethod ) + if ( pBasMgr->HasMacro( aQualifiedMethod ) ) { - // arguments must be quoted - String aQuotedArgs; - if ( aArgs.Len()<2 || aArgs.GetBuffer()[1] == '\"') - // no args or already quoted args - aQuotedArgs = aArgs; - else + Any aOldThisComponent; + const bool bSetDocMacroMode = ( pDoc != NULL ) && bIsDocBasic; + const bool bSetGlobalThisComponent = ( pDoc != NULL ) && bIsAppBasic; + if ( bSetDocMacroMode ) { - // quote parameters - aArgs.Erase(0,1); - aArgs.Erase( aArgs.Len()-1,1); - - aQuotedArgs = '('; - - sal_uInt16 nCount = aArgs.GetTokenCount(','); - for ( sal_uInt16 n=0; n<nCount; n++ ) - { - aQuotedArgs += '\"'; - aQuotedArgs += aArgs.GetToken( n, ',' ); - aQuotedArgs += '\"'; - if ( n<nCount-1 ) - aQuotedArgs += ','; - } - - aQuotedArgs += ')'; + // mark document: it executes an own macro, so it's in a modal mode + pDoc->SetMacroMode_Impl( sal_True ); } - Any aOldThisComponent; - if ( pSh ) + if ( bSetGlobalThisComponent ) { - if ( pBasMgr != pAppMgr ) - // mark document: it executes an own macro, so it's in a modal mode - pSh->SetMacroMode_Impl( TRUE ); - if ( pBasMgr == pAppMgr ) - { - // document is executed via AppBASIC, adjust ThisComponent variable - aOldThisComponent = pAppMgr->SetGlobalUNOConstant( "ThisComponent", makeAny( pSh->GetModel() ) ); - } + // document is executed via AppBASIC, adjust ThisComponent variable + aOldThisComponent = pAppMgr->SetGlobalUNOConstant( "ThisComponent", makeAny( pDoc->GetModel() ) ); } - // add quoted arguments and do the call - String aCall( '[' ); - aCall += pMethod->GetName(); - aCall += aQuotedArgs; - aCall += ']'; - // just to let the shell be alive - SfxObjectShellRef rSh = pSh; + SfxObjectShellRef xKeepDocAlive = pDoc; - // execute function using its Sbx parent, - SbxVariable* pRet = pMethod->GetParent()->Execute( aCall ); - if ( pRet ) { - USHORT nFlags = pRet->GetFlags(); - pRet->SetFlag( SBX_READWRITE | SBX_NO_BROADCAST ); - rRetval = sbxToUnoValue( pRet ); - pRet->SetFlags( nFlags ); + // attempt to protect the document against the script tampering with its Undo Context + ::std::auto_ptr< ::framework::DocumentUndoGuard > pUndoGuard; + if ( bIsDocBasic ) + pUndoGuard.reset( new ::framework::DocumentUndoGuard( pDoc->GetModel() ) ); + + // execute the method + SbxVariableRef retValRef = new SbxVariable; + nErr = pBasMgr->ExecuteMacro( aQualifiedMethod, aArgs, retValRef ); + if ( nErr == ERRCODE_NONE ) + rRetval = sbxToUnoValue( retValRef ); } - nErr = SbxBase::GetError(); - if ( ( pBasMgr == pAppMgr ) && pSh ) + if ( bSetGlobalThisComponent ) { pAppMgr->SetGlobalUNOConstant( "ThisComponent", aOldThisComponent ); } - if ( pSh && pSh->GetModel().is() ) - // remove flag for modal mode - pSh->SetMacroMode_Impl( FALSE ); + if ( bSetDocMacroMode ) + { + // remove flag for modal mode + pDoc->SetMacroMode_Impl( sal_False ); + } } else nErr = ERRCODE_BASIC_PROC_UNDEFINED; @@ -1896,7 +1921,6 @@ ErrCode SfxMacroLoader::loadMacro( const ::rtl::OUString& rURL, com::sun::star:: nErr = SbxBase::GetError(); } - pApp->LeaveBasicCall(); SbxBase::ResetError(); return nErr; } @@ -1919,7 +1943,7 @@ Reference < XDispatch > SAL_CALL SfxAppDispatchProvider::queryDispatch( const ::rtl::OUString& /*sTargetFrameName*/, FrameSearchFlags /*eSearchFlags*/ ) throw( RuntimeException ) { - USHORT nId( 0 ); + sal_uInt16 nId( 0 ); sal_Bool bMasterCommand( sal_False ); Reference < XDispatch > xDisp; const SfxSlot* pSlot = 0; @@ -1927,9 +1951,9 @@ Reference < XDispatch > SAL_CALL SfxAppDispatchProvider::queryDispatch( if ( aURL.Protocol.compareToAscii( "slot:" ) == COMPARE_EQUAL || aURL.Protocol.compareToAscii( "commandId:" ) == COMPARE_EQUAL ) { - nId = (USHORT) aURL.Path.toInt32(); + nId = (sal_uInt16) aURL.Path.toInt32(); SfxShell* pShell; - pAppDisp->GetShellAndSlot_Impl( nId, &pShell, &pSlot, TRUE, TRUE ); + pAppDisp->GetShellAndSlot_Impl( nId, &pShell, &pSlot, sal_True, sal_True ); } else if ( aURL.Protocol.compareToAscii( ".uno:" ) == COMPARE_EQUAL ) { @@ -1972,10 +1996,10 @@ throw (::com::sun::star::uno::RuntimeException) std::list< sal_Int16 > aGroupList; SfxSlotPool* pAppSlotPool = &SFX_APP()->GetAppSlotPool_Impl(); - const ULONG nMode( SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_MENUCONFIG ); + const sal_uIntPtr nMode( SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_MENUCONFIG ); // Gruppe anw"ahlen ( Gruppe 0 ist intern ) - for ( USHORT i=0; i<pAppSlotPool->GetGroupCount(); i++ ) + for ( sal_uInt16 i=0; i<pAppSlotPool->GetGroupCount(); i++ ) { String aName = pAppSlotPool->SeekGroup( i ); const SfxSlot* pSfxSlot = pAppSlotPool->FirstSlot(); @@ -2007,11 +2031,11 @@ throw (::com::sun::star::uno::RuntimeException) if ( pAppSlotPool ) { - const ULONG nMode( SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_MENUCONFIG ); + const sal_uIntPtr nMode( SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_MENUCONFIG ); rtl::OUString aCmdPrefix( RTL_CONSTASCII_USTRINGPARAM( ".uno:" )); // Gruppe anw"ahlen ( Gruppe 0 ist intern ) - for ( USHORT i=0; i<pAppSlotPool->GetGroupCount(); i++ ) + for ( sal_uInt16 i=0; i<pAppSlotPool->GetGroupCount(); i++ ) { String aName = pAppSlotPool->SeekGroup( i ); const SfxSlot* pSfxSlot = pAppSlotPool->FirstSlot(); @@ -2126,165 +2150,6 @@ SFX2_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment( *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ; } -SFX2_DLLPUBLIC sal_Bool SAL_CALL component_writeInfo( - void* , - void* pRegistryKey ) -{ - ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > xKey( reinterpret_cast< ::com::sun::star::registry::XRegistryKey* >( pRegistryKey ) ) ; - - // register actual implementations and their services - ::rtl::OUString aImpl; - ::rtl::OUString aTempStr; - ::rtl::OUString aKeyStr; - Reference< XRegistryKey > xNewKey; - Reference< XRegistryKey > xLoaderKey; - - // PluginObject - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += ::sfx2::PluginObject::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.SpecialEmbeddedObject")) ); - - // IFrameObject - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += ::sfx2::IFrameObject::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.SpecialEmbeddedObject")) ); - - // global app event broadcaster - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += SfxGlobalEvents_Impl::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.GlobalEventBroadcaster")) ); - - // global app dispatcher - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += SfxAppDispatchProvider::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.ProtocolHandler")) ); - - // standalone document info - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += SfxStandaloneDocumentInfoObject::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.StandaloneDocumentInfo")) ); - - // frame loader - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += SfxFrameLoader_Impl::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - Sequence < ::rtl::OUString > aServices = SfxFrameLoader_Impl::impl_getStaticSupportedServiceNames(); - sal_Int32 nCount = aServices.getLength(); - for ( sal_Int16 i=0; i<nCount; i++ ) - xNewKey->createKey( aServices.getConstArray()[i] ); - - // macro loader - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += SfxMacroLoader::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.ProtocolHandler")) ); - - // - sfx document templates - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += SfxDocTplService::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.DocumentTemplates")) ); - - // quickstart wrapper service - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += ShutdownIcon::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.office.Quickstart")) ); - - // application script library container service - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += SfxApplicationScriptLibraryContainer::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.ApplicationScriptLibraryContainer")) ); - - // application dialog library container service - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += SfxApplicationDialogLibraryContainer::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.ApplicationDialogLibraryContainer")) ); - - // converter of fs folders to packages - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += OPackageStructureCreator::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - Sequence< ::rtl::OUString > rServices = OPackageStructureCreator::impl_getStaticSupportedServiceNames(); - for( sal_Int32 ind = 0; ind < rServices.getLength(); ind++ ) - xNewKey->createKey( rServices.getConstArray()[ind] ); - - // subfilter to parse a stream in OASIS format generated by the filter - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += ::sfx2::OwnSubFilterService::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - rServices = ::sfx2::OwnSubFilterService::impl_getStaticSupportedServiceNames(); - for( sal_Int32 ind = 0; ind < rServices.getLength(); ind++ ) - xNewKey->createKey( rServices.getConstArray()[ind] ); - - // document meta data - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += comp_SfxDocumentMetaData::_getImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.DocumentProperties")) ); - - - // writer compatable document properties - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += comp_CompatWriterDocProps::_getImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.writer.DocumentProperties")) ); - - return sal_True; -} - SFX2_DLLPUBLIC void* SAL_CALL component_getFactory( const sal_Char* pImplementationName , void* pServiceManager , @@ -2381,18 +2246,18 @@ RequestFilterOptions::RequestFilterOptions( ::com::sun::star::uno::Reference< :: ::rtl::OUString temp; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > temp2; ::com::sun::star::document::FilterOptionsRequest aOptionsRequest( temp, - temp2, + temp2, rModel, rProperties ); - m_aRequest <<= aOptionsRequest; + m_aRequest <<= aOptionsRequest; - m_pAbort = new ContinuationAbort; - m_pOptions = new FilterOptionsContinuation; + m_pAbort = new comphelper::OInteractionAbort; + m_pOptions = new FilterOptionsContinuation; - m_lContinuations.realloc( 2 ); - m_lContinuations[0] = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation >( m_pAbort ); - m_lContinuations[1] = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation >( m_pOptions ); + m_lContinuations.realloc( 2 ); + m_lContinuations[0] = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation >( m_pAbort ); + m_lContinuations[1] = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation >( m_pOptions ); } ::com::sun::star::uno::Any SAL_CALL RequestFilterOptions::getRequest() @@ -2409,108 +2274,140 @@ RequestFilterOptions::RequestFilterOptions( ::com::sun::star::uno::Reference< :: } //========================================================================= +class RequestPackageReparation_Impl : public ::cppu::WeakImplHelper1< ::com::sun::star::task::XInteractionRequest > +{ + ::com::sun::star::uno::Any m_aRequest; + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > m_lContinuations; + comphelper::OInteractionApprove* m_pApprove; + comphelper::OInteractionDisapprove* m_pDisapprove; -RequestPackageReparation::RequestPackageReparation( ::rtl::OUString aName ) +public: + RequestPackageReparation_Impl( ::rtl::OUString aName ); + sal_Bool isApproved(); + virtual ::com::sun::star::uno::Any SAL_CALL getRequest() throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > SAL_CALL getContinuations() + throw( ::com::sun::star::uno::RuntimeException ); +}; + +RequestPackageReparation_Impl::RequestPackageReparation_Impl( ::rtl::OUString aName ) { ::rtl::OUString temp; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > temp2; ::com::sun::star::document::BrokenPackageRequest aBrokenPackageRequest( temp, temp2, aName ); - m_aRequest <<= aBrokenPackageRequest; - - m_pApprove = new ContinuationApprove; - m_pDisapprove = new ContinuationDisapprove; - + m_pApprove = new comphelper::OInteractionApprove; + m_pDisapprove = new comphelper::OInteractionDisapprove; m_lContinuations.realloc( 2 ); m_lContinuations[0] = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation >( m_pApprove ); m_lContinuations[1] = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation >( m_pDisapprove ); } -/*uno::*/Any SAL_CALL RequestPackageReparation::queryInterface( const /*uno::*/Type& rType ) throw (RuntimeException) +sal_Bool RequestPackageReparation_Impl::isApproved() { - return ::cppu::queryInterface ( rType, - // OWeakObject interfaces - dynamic_cast< XInterface* > ( (XInteractionRequest *) this ), - static_cast< XWeak* > ( this ), - // my own interfaces - static_cast< XInteractionRequest* > ( this ) ); + return m_pApprove->wasSelected(); } -void SAL_CALL RequestPackageReparation::acquire( ) throw () +::com::sun::star::uno::Any SAL_CALL RequestPackageReparation_Impl::getRequest() + throw( ::com::sun::star::uno::RuntimeException ) { - OWeakObject::acquire(); + return m_aRequest; } -void SAL_CALL RequestPackageReparation::release( ) throw () +::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > + SAL_CALL RequestPackageReparation_Impl::getContinuations() + throw( ::com::sun::star::uno::RuntimeException ) { - OWeakObject::release(); + return m_lContinuations; } -::com::sun::star::uno::Any SAL_CALL RequestPackageReparation::getRequest() - throw( ::com::sun::star::uno::RuntimeException ) +RequestPackageReparation::RequestPackageReparation( ::rtl::OUString aName ) { - return m_aRequest; + pImp = new RequestPackageReparation_Impl( aName ); + pImp->acquire(); } -::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > - SAL_CALL RequestPackageReparation::getContinuations() - throw( ::com::sun::star::uno::RuntimeException ) +RequestPackageReparation::~RequestPackageReparation() { - return m_lContinuations; + pImp->release(); +} + +sal_Bool RequestPackageReparation::isApproved() +{ + return pImp->isApproved(); +} + +com::sun::star::uno::Reference < ::com::sun::star::task::XInteractionRequest > RequestPackageReparation::GetRequest() +{ + return com::sun::star::uno::Reference < ::com::sun::star::task::XInteractionRequest >(pImp); } //========================================================================= +class NotifyBrokenPackage_Impl : public ::cppu::WeakImplHelper1< ::com::sun::star::task::XInteractionRequest > +{ + ::com::sun::star::uno::Any m_aRequest; + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > m_lContinuations; + comphelper::OInteractionAbort* m_pAbort; -NotifyBrokenPackage::NotifyBrokenPackage( ::rtl::OUString aName ) +public: + NotifyBrokenPackage_Impl( ::rtl::OUString aName ); + sal_Bool isAborted(); + virtual ::com::sun::star::uno::Any SAL_CALL getRequest() throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > SAL_CALL getContinuations() + throw( ::com::sun::star::uno::RuntimeException ); +}; + +NotifyBrokenPackage_Impl::NotifyBrokenPackage_Impl( ::rtl::OUString aName ) { ::rtl::OUString temp; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > temp2; ::com::sun::star::document::BrokenPackageRequest aBrokenPackageRequest( temp, temp2, aName ); - m_aRequest <<= aBrokenPackageRequest; - - m_pAbort = new ContinuationAbort; - + m_pAbort = new comphelper::OInteractionAbort; m_lContinuations.realloc( 1 ); m_lContinuations[0] = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation >( m_pAbort ); } -/*uno::*/Any SAL_CALL NotifyBrokenPackage::queryInterface( const /*uno::*/Type& rType ) throw (RuntimeException) +sal_Bool NotifyBrokenPackage_Impl::isAborted() { - return ::cppu::queryInterface ( rType, - // OWeakObject interfaces - dynamic_cast< XInterface* > ( (XInteractionRequest *) this ), - static_cast< XWeak* > ( this ), - // my own interfaces - static_cast< XInteractionRequest* > ( this ) ); + return m_pAbort->wasSelected(); } -void SAL_CALL NotifyBrokenPackage::acquire( ) throw () +::com::sun::star::uno::Any SAL_CALL NotifyBrokenPackage_Impl::getRequest() + throw( ::com::sun::star::uno::RuntimeException ) { - OWeakObject::acquire(); + return m_aRequest; } -void SAL_CALL NotifyBrokenPackage::release( ) throw () +::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > + SAL_CALL NotifyBrokenPackage_Impl::getContinuations() + throw( ::com::sun::star::uno::RuntimeException ) { - OWeakObject::release(); + return m_lContinuations; } -::com::sun::star::uno::Any SAL_CALL NotifyBrokenPackage::getRequest() - throw( ::com::sun::star::uno::RuntimeException ) +NotifyBrokenPackage::NotifyBrokenPackage( ::rtl::OUString aName ) { - return m_aRequest; + pImp = new NotifyBrokenPackage_Impl( aName ); + pImp->acquire(); } -::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > - SAL_CALL NotifyBrokenPackage::getContinuations() - throw( ::com::sun::star::uno::RuntimeException ) +NotifyBrokenPackage::~NotifyBrokenPackage() { - return m_lContinuations; + pImp->release(); +} + +sal_Bool NotifyBrokenPackage::isAborted() +{ + return pImp->isAborted(); } +com::sun::star::uno::Reference < ::com::sun::star::task::XInteractionRequest > NotifyBrokenPackage::GetRequest() +{ + return com::sun::star::uno::Reference < ::com::sun::star::task::XInteractionRequest >(pImp); +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx index 149cf8d96add..3473514de3fc 100644..100755 --- a/sfx2/source/appl/childwin.cxx +++ b/sfx2/source/appl/childwin.cxx @@ -342,7 +342,7 @@ SfxChildWinInfo SfxChildWindow::GetInfo() const aInfo.aSize = pWindow->GetSizePixel(); if ( pWindow->IsSystemWindow() ) { - ULONG nMask = WINDOWSTATE_MASK_POS | WINDOWSTATE_MASK_STATE; + sal_uIntPtr nMask = WINDOWSTATE_MASK_POS | WINDOWSTATE_MASK_STATE; if ( pWindow->GetStyle() & WB_SIZEABLE ) nMask |= ( WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT ); aInfo.aWinState = ((SystemWindow*)pWindow)->GetWindowState( nMask ); @@ -415,7 +415,7 @@ void SfxChildWindow::InitializeChildWinFactory_Impl( sal_uInt16 nId, SfxChildWin nPos = aWinData.Search( cToken ); if (nPos != STRING_NOTFOUND) { - USHORT nNextPos = aWinData.Search( cToken, 2 ); + sal_uInt16 nNextPos = aWinData.Search( cToken, 2 ); if ( nNextPos != STRING_NOTFOUND ) { // there is extra information @@ -594,7 +594,7 @@ sal_Bool SfxChildWindow::IsHideAtToggle() const return pImp->bHideAtToggle; } -void SfxChildWindow::SetWantsFocus( BOOL bSet ) +void SfxChildWindow::SetWantsFocus( sal_Bool bSet ) { pImp->bWantsFocus = bSet; } @@ -699,18 +699,18 @@ void SfxChildWindow::Hide() } } -void SfxChildWindow::Show( USHORT nFlags ) +void SfxChildWindow::Show( sal_uInt16 nFlags ) { switch ( pWindow->GetType() ) { case RSC_DOCKINGWINDOW : - ((DockingWindow*)pWindow)->Show( TRUE, nFlags ); + ((DockingWindow*)pWindow)->Show( sal_True, nFlags ); break; case RSC_TOOLBOX : - ((ToolBox*)pWindow)->Show( TRUE, nFlags ); + ((ToolBox*)pWindow)->Show( sal_True, nFlags ); break; default: - pWindow->Show( TRUE, nFlags ); + pWindow->Show( sal_True, nFlags ); break; } } @@ -787,7 +787,7 @@ sal_Bool SfxChildWindow::CanGetFocus() const return !(pImp->pFact->aInfo.nFlags & SFX_CHILDWIN_CANTGETFOCUS); } -void SfxChildWindowContext::RegisterChildWindowContext(SfxModule* pMod, USHORT nId, SfxChildWinContextFactory* pFact) +void SfxChildWindowContext::RegisterChildWindowContext(SfxModule* pMod, sal_uInt16 nId, SfxChildWinContextFactory* pFact) { SFX_APP()->RegisterChildWindowContext_Impl( pMod, nId, pFact ); } diff --git a/sfx2/source/appl/dde.hrc b/sfx2/source/appl/dde.hrc index d3e178606809..d3e178606809 100644..100755 --- a/sfx2/source/appl/dde.hrc +++ b/sfx2/source/appl/dde.hrc diff --git a/sfx2/source/appl/dde.src b/sfx2/source/appl/dde.src index 22df8eff16ba..18f6517f181c 100644..100755 --- a/sfx2/source/appl/dde.src +++ b/sfx2/source/appl/dde.src @@ -29,6 +29,7 @@ ModalDialog MD_DDE_LINKEDIT { + HelpID = "sfx2:ModalDialog:MD_DDE_LINKEDIT"; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 223 , 74 ) ; @@ -42,6 +43,7 @@ ModalDialog MD_DDE_LINKEDIT }; Edit ED_DDE_APP { + HelpID = "sfx2:Edit:MD_DDE_LINKEDIT:ED_DDE_APP"; Border = TRUE ; Pos = MAP_APPFONT ( 55 , 14 ) ; Size = MAP_APPFONT ( 100 , 12 ) ; @@ -54,6 +56,7 @@ ModalDialog MD_DDE_LINKEDIT }; Edit ED_DDE_TOPIC { + HelpID = "sfx2:Edit:MD_DDE_LINKEDIT:ED_DDE_TOPIC"; Border = TRUE ; Pos = MAP_APPFONT ( 55 , 32 ) ; Size = MAP_APPFONT ( 100 , 12 ) ; @@ -66,6 +69,7 @@ ModalDialog MD_DDE_LINKEDIT }; Edit ED_DDE_ITEM { + HelpID = "sfx2:Edit:MD_DDE_LINKEDIT:ED_DDE_ITEM"; Border = TRUE ; Pos = MAP_APPFONT ( 55 , 50 ) ; Size = MAP_APPFONT ( 100 , 12 ) ; diff --git a/sfx2/source/appl/fileobj.cxx b/sfx2/source/appl/fileobj.cxx index 0dff92fedf50..b16b673136ec 100644..100755 --- a/sfx2/source/appl/fileobj.cxx +++ b/sfx2/source/appl/fileobj.cxx @@ -49,7 +49,7 @@ #include <comphelper/processfactory.hxx> #include <sfx2/linkmgr.hxx> #include <sfx2/opengrf.hxx> -#include "sfxresid.hxx" +#include "sfx2/sfxresid.hxx" #include "fileobj.hxx" #include "app.hrc" @@ -82,9 +82,9 @@ struct Impl_DownLoadData SvFileObject::SvFileObject() : pDownLoadData( NULL ), pOldParent( NULL ), nType( FILETYPE_TEXT ) { - bLoadAgain = TRUE; + bLoadAgain = sal_True; bSynchron = bLoadError = bWaitForData = bDataReady = bNativFormat = - bClearMedium = bStateChangeCalled = bInCallDownLoad = FALSE; + bClearMedium = bStateChangeCalled = bInCallDownLoad = sal_False; } @@ -100,11 +100,11 @@ SvFileObject::~SvFileObject() } -BOOL SvFileObject::GetData( ::com::sun::star::uno::Any & rData, +sal_Bool SvFileObject::GetData( ::com::sun::star::uno::Any & rData, const String & rMimeType, - BOOL bGetSynchron ) + sal_Bool bGetSynchron ) { - ULONG nFmt = SotExchange::GetFormatStringId( rMimeType ); + sal_uIntPtr nFmt = SotExchange::GetFormatStringId( rMimeType ); switch( nType ) { case FILETYPE_TEXT: @@ -130,7 +130,7 @@ BOOL SvFileObject::GetData( ::com::sun::star::uno::Any & rData, // If the native format is reqested, has to be reset at the // end of the flag. Is solely in the sw/ndgrf.cxx used when // the link is removed form GraphicNode. - BOOL bOldNativFormat = bNativFormat; + sal_Bool bOldNativFormat = bNativFormat; // If about to print, waiting for the data to be available if( bGetSynchron ) @@ -146,7 +146,7 @@ BOOL SvFileObject::GetData( ::com::sun::star::uno::Any & rData, Application::Reschedule(); xMed = xTmpMed; - bClearMedium = TRUE; + bClearMedium = sal_True; } } @@ -204,7 +204,7 @@ BOOL SvFileObject::GetData( ::com::sun::star::uno::Any & rData, if( xMed.Is() && !bSynchron && bClearMedium ) { xMed.Clear(); - bClearMedium = FALSE; + bClearMedium = sal_False; } } } @@ -217,10 +217,10 @@ BOOL SvFileObject::GetData( ::com::sun::star::uno::Any & rData, return sal_True/*0 != aTypeList.Count()*/; } -BOOL SvFileObject::Connect( sfx2::SvBaseLink* pLink ) +sal_Bool SvFileObject::Connect( sfx2::SvBaseLink* pLink ) { if( !pLink || !pLink->GetLinkManager() ) - return FALSE; + return sal_False; // Test if not another link of the same connection already exists pLink->GetLinkManager()->GetDisplayNames( pLink, 0, &sFileNm, 0, &sFilter ); @@ -231,7 +231,7 @@ BOOL SvFileObject::Connect( sfx2::SvBaseLink* pLink ) if( pShell.Is() ) { if( pShell->IsAbortingImport() ) - return FALSE; + return sal_False; if( pShell->GetMedium() ) sReferer = pShell->GetMedium()->GetName(); @@ -255,24 +255,24 @@ BOOL SvFileObject::Connect( sfx2::SvBaseLink* pLink ) break; default: - return FALSE; + return sal_False; } SetUpdateTimeout( 0 ); // and now register by this or other found Pseudo-Object AddDataAdvise( pLink, SotExchange::GetFormatMimeType( pLink->GetContentType()), 0 ); - return TRUE; + return sal_True; } -BOOL SvFileObject::LoadFile_Impl() +sal_Bool SvFileObject::LoadFile_Impl() { // We are still at Loading!! if( bWaitForData || !bLoadAgain || xMed.Is() || pDownLoadData ) - return FALSE; + return sal_False; // at the moment on the current DocShell - xMed = new SfxMedium( sFileNm, STREAM_STD_READ, TRUE ); + xMed = new SfxMedium( sFileNm, STREAM_STD_READ, sal_True ); SvLinkSource::StreamToLoadFrom aStreamToLoadFrom = getStreamToLoadFrom(); xMed->setStreamToLoadFrom( @@ -283,14 +283,14 @@ BOOL SvFileObject::LoadFile_Impl() if( !bSynchron ) { - bLoadAgain = bDataReady = bInNewData = FALSE; - bWaitForData = TRUE; + bLoadAgain = bDataReady = bInNewData = sal_False; + bWaitForData = sal_True; SfxMediumRef xTmpMed = xMed; xMed->SetDataAvailableLink( STATIC_LINK( this, SvFileObject, LoadGrfNewData_Impl ) ); - bInCallDownLoad = TRUE; + bInCallDownLoad = sal_True; xMed->DownLoad( STATIC_LINK( this, SvFileObject, LoadGrfReady_Impl ) ); - bInCallDownLoad = FALSE; + bInCallDownLoad = sal_False; bClearMedium = !xMed.Is(); if( bClearMedium ) @@ -298,24 +298,24 @@ BOOL SvFileObject::LoadFile_Impl() return bDataReady; } - bWaitForData = TRUE; - bDataReady = bInNewData = FALSE; + bWaitForData = sal_True; + bDataReady = bInNewData = sal_False; xMed->DownLoad(); bLoadAgain = !xMed->IsRemote(); - bWaitForData = FALSE; + bWaitForData = sal_False; // Graphic is finished, also send DataChanged of the Status change: SendStateChg_Impl( xMed->GetInStream() && xMed->GetInStream()->GetError() ? sfx2::LinkManager::STATE_LOAD_ERROR : sfx2::LinkManager::STATE_LOAD_OK ); - return TRUE; + return sal_True; } -BOOL SvFileObject::GetGraphic_Impl( Graphic& rGrf, SvStream* pStream ) +sal_Bool SvFileObject::GetGraphic_Impl( Graphic& rGrf, SvStream* pStream ) { GraphicFilter* pGF = GraphicFilter::GetGraphicFilter(); - const USHORT nFilter = sFilter.Len() && pGF->GetImportFormatCount() + const sal_uInt16 nFilter = sFilter.Len() && pGF->GetImportFormatCount() ? pGF->GetImportFormatNumber( sFilter ) : GRFILTER_FORMAT_DONTKNOW; @@ -353,10 +353,10 @@ BOOL SvFileObject::GetGraphic_Impl( Graphic& rGrf, SvStream* pStream ) xMed->SetDataAvailableLink( Link() ); // xMed->SetDoneLink( Link() ); delete pDownLoadData, pDownLoadData = 0; - bDataReady = TRUE; - bWaitForData = FALSE; + bDataReady = sal_True; + bWaitForData = sal_False; } - else if( FALSE ) + else if( sal_False ) { // Set up Timer, to return back pDownLoadData->aTimer.Start(); @@ -506,14 +506,14 @@ void SvFileObject::Edit( Window* pParent, sfx2::SvBaseLink* pLink, const Link& r IMPL_STATIC_LINK( SvFileObject, LoadGrfReady_Impl, void*, EMPTYARG ) { // When we come form here there it can not be an error no more. - pThis->bLoadError = FALSE; - pThis->bWaitForData = FALSE; - pThis->bInCallDownLoad = FALSE; + pThis->bLoadError = sal_False; + pThis->bWaitForData = sal_False; + pThis->bInCallDownLoad = sal_False; if( !pThis->bInNewData && !pThis->bDataReady ) { // Graphic is finished, also send DataChanged from Status change - pThis->bDataReady = TRUE; + pThis->bDataReady = sal_True; pThis->SendStateChg_Impl( sfx2::LinkManager::STATE_LOAD_OK ); // and then send the data again @@ -522,7 +522,7 @@ IMPL_STATIC_LINK( SvFileObject, LoadGrfReady_Impl, void*, EMPTYARG ) if( pThis->bDataReady ) { - pThis->bLoadAgain = TRUE; + pThis->bLoadAgain = sal_True; if( pThis->xMed.Is() ) { pThis->xMed->SetDataAvailableLink( Link() ); @@ -553,8 +553,8 @@ IMPL_STATIC_LINK( SvFileObject, LoadGrfNewData_Impl, void*, EMPTYARG ) if( pThis->bInNewData ) return 0; - pThis->bInNewData = TRUE; - pThis->bLoadError = FALSE; + pThis->bInNewData = sal_True; + pThis->bLoadError = sal_False; if( !pThis->pDownLoadData ) { @@ -583,7 +583,7 @@ IMPL_STATIC_LINK( SvFileObject, LoadGrfNewData_Impl, void*, EMPTYARG ) // a DataReady in DataChanged? else if( pThis->bWaitForData && pThis->pDownLoadData ) { - pThis->bLoadError = TRUE; + pThis->bLoadError = sal_True; } } @@ -593,7 +593,7 @@ IMPL_STATIC_LINK( SvFileObject, LoadGrfNewData_Impl, void*, EMPTYARG ) pThis->SendStateChg_Impl( pStrm->GetError() ? sfx2::LinkManager::STATE_LOAD_ERROR : sfx2::LinkManager::STATE_LOAD_OK ); } - pThis->bInNewData = FALSE; + pThis->bInNewData = sal_False; return 0; } @@ -632,28 +632,28 @@ IMPL_LINK( SvFileObject, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg ) ERRCODE_SO_PENDING if it has not been completely read ERRCODE_SO_FALSE otherwise */ -BOOL SvFileObject::IsPending() const +sal_Bool SvFileObject::IsPending() const { return FILETYPE_GRF == nType && !bLoadError && ( pDownLoadData || bWaitForData ); } -BOOL SvFileObject::IsDataComplete() const +sal_Bool SvFileObject::IsDataComplete() const { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( FILETYPE_GRF != nType ) - bRet = TRUE; + bRet = sal_True; else if( !bLoadError && ( !bWaitForData && !pDownLoadData )) { SvFileObject* pThis = (SvFileObject*)this; if( bDataReady || ( bSynchron && pThis->LoadFile_Impl() && xMed.Is() ) ) - bRet = TRUE; + bRet = sal_True; else { INetURLObject aUrl( sFileNm ); if( aUrl.HasError() || INET_PROT_NOT_VALID == aUrl.GetProtocol() ) - bRet = TRUE; + bRet = sal_True; } } return bRet; @@ -667,8 +667,8 @@ void SvFileObject::CancelTransfers() if( !bDataReady ) { // Do not set-up again - bLoadAgain = FALSE; - bDataReady = bLoadError = bWaitForData = TRUE; + bLoadAgain = sal_False; + bDataReady = bLoadError = bWaitForData = sal_True; SendStateChg_Impl( sfx2::LinkManager::STATE_LOAD_ABORT ); } } @@ -682,7 +682,7 @@ void SvFileObject::SendStateChg_Impl( sfx2::LinkManager::LinkState nState ) aAny <<= rtl::OUString::valueOf( (sal_Int32)nState ); DataChanged( SotExchange::GetFormatName( sfx2::LinkManager::RegisterStatusInfoId()), aAny ); - bStateChangeCalled = TRUE; + bStateChangeCalled = sal_True; } } diff --git a/sfx2/source/appl/fileobj.hxx b/sfx2/source/appl/fileobj.hxx index a902b5875410..ceb0f14ea1bc 100644..100755 --- a/sfx2/source/appl/fileobj.hxx +++ b/sfx2/source/appl/fileobj.hxx @@ -47,22 +47,22 @@ class SvFileObject : public sfx2::SvLinkSource Impl_DownLoadData* pDownLoadData; Window* pOldParent; - BYTE nType; - - BOOL bLoadAgain : 1; - BOOL bSynchron : 1; - BOOL bLoadError : 1; - BOOL bWaitForData : 1; - BOOL bInNewData : 1; - BOOL bDataReady : 1; - BOOL bMedUseCache : 1; - BOOL bNativFormat : 1; - BOOL bClearMedium : 1; - BOOL bStateChangeCalled : 1; - BOOL bInCallDownLoad : 1; - - BOOL GetGraphic_Impl( Graphic&, SvStream* pStream = 0 ); - BOOL LoadFile_Impl(); + sal_uInt8 nType; + + sal_Bool bLoadAgain : 1; + sal_Bool bSynchron : 1; + sal_Bool bLoadError : 1; + sal_Bool bWaitForData : 1; + sal_Bool bInNewData : 1; + sal_Bool bDataReady : 1; + sal_Bool bMedUseCache : 1; + sal_Bool bNativFormat : 1; + sal_Bool bClearMedium : 1; + sal_Bool bStateChangeCalled : 1; + sal_Bool bInCallDownLoad : 1; + + sal_Bool GetGraphic_Impl( Graphic&, SvStream* pStream = 0 ); + sal_Bool LoadFile_Impl(); void SendStateChg_Impl( sfx2::LinkManager::LinkState nState ); DECL_STATIC_LINK( SvFileObject, DelMedium_Impl, SfxMediumRef* ); @@ -76,16 +76,16 @@ protected: public: SvFileObject(); - virtual BOOL GetData( ::com::sun::star::uno::Any & rData /*out param*/, + virtual sal_Bool GetData( ::com::sun::star::uno::Any & rData /*out param*/, const String & rMimeType, - BOOL bSynchron = FALSE ); + sal_Bool bSynchron = sal_False ); - virtual BOOL Connect( sfx2::SvBaseLink* ); + virtual sal_Bool Connect( sfx2::SvBaseLink* ); virtual void Edit( Window *, sfx2::SvBaseLink *, const Link& rEndEditHdl ); // Ask whether you can access data directly or whether it has to be triggered - virtual BOOL IsPending() const; - virtual BOOL IsDataComplete() const; + virtual sal_Bool IsPending() const; + virtual sal_Bool IsDataComplete() const; void CancelTransfers(); }; diff --git a/sfx2/source/appl/fwkhelper.cxx b/sfx2/source/appl/fwkhelper.cxx index 60ae5499cc8e..60ae5499cc8e 100644..100755 --- a/sfx2/source/appl/fwkhelper.cxx +++ b/sfx2/source/appl/fwkhelper.cxx diff --git a/sfx2/source/appl/helpdispatch.cxx b/sfx2/source/appl/helpdispatch.cxx index 4a7a2f5c0254..4a7a2f5c0254 100644..100755 --- a/sfx2/source/appl/helpdispatch.cxx +++ b/sfx2/source/appl/helpdispatch.cxx diff --git a/sfx2/source/appl/helpdispatch.hxx b/sfx2/source/appl/helpdispatch.hxx index f99c054a3063..f99c054a3063 100644..100755 --- a/sfx2/source/appl/helpdispatch.hxx +++ b/sfx2/source/appl/helpdispatch.hxx diff --git a/sfx2/source/appl/helpinterceptor.cxx b/sfx2/source/appl/helpinterceptor.cxx index 9e05fbfe38e2..26f0117aa566 100644..100755 --- a/sfx2/source/appl/helpinterceptor.cxx +++ b/sfx2/source/appl/helpinterceptor.cxx @@ -136,7 +136,7 @@ void HelpInterceptor_Impl::SetStartURL( const String& rURL ) { m_pHistory = new HelpHistoryList_Impl; Any aEmptyViewData; - m_pHistory->insert( m_pHistory->begin(), new HelpHistoryEntry_Impl( rURL, aEmptyViewData ) ); + m_pHistory->insert( m_pHistory->begin(), new HelpHistoryEntry_Impl( rURL, aEmptyViewData)); m_nCurPos = m_pHistory->size() - 1; m_pWindow->UpdateToolbox(); @@ -169,7 +169,7 @@ Reference< XDispatch > SAL_CALL HelpInterceptor_Impl::queryDispatch( if ( m_xSlaveDispatcher.is() ) xResult = m_xSlaveDispatcher->queryDispatch( aURL, aTargetFrameName, nSearchFlags ); - BOOL bHelpURL = aURL.Complete.toAsciiLowerCase().match(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.help")),0); + sal_Bool bHelpURL = aURL.Complete.toAsciiLowerCase().match(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.help")),0); if ( bHelpURL ) { @@ -277,7 +277,7 @@ void SAL_CALL HelpInterceptor_Impl::dispatch( } } - ULONG nPos = ( bBack && m_nCurPos > 0 ) ? --m_nCurPos + sal_uIntPtr nPos = ( bBack && m_nCurPos > 0 ) ? --m_nCurPos : ( !bBack && m_nCurPos < m_pHistory->size() - 1 ) ? ++m_nCurPos : ULONG_MAX; diff --git a/sfx2/source/appl/helpinterceptor.hxx b/sfx2/source/appl/helpinterceptor.hxx index 60adf2d6d934..e912fcdf2364 100644..100755 --- a/sfx2/source/appl/helpinterceptor.hxx +++ b/sfx2/source/appl/helpinterceptor.hxx @@ -74,7 +74,7 @@ friend class SfxHelpWindow_Impl; HelpHistoryList_Impl* m_pHistory; SfxHelpWindow_Impl* m_pWindow; - ULONG m_nCurPos; + sal_uIntPtr m_nCurPos; String m_aCurrentURL; com::sun::star::uno::Any m_aViewData; diff --git a/sfx2/source/appl/imagemgr.cxx b/sfx2/source/appl/imagemgr.cxx index c9c52342a139..d4c410a2a7ac 100644..100755 --- a/sfx2/source/appl/imagemgr.cxx +++ b/sfx2/source/appl/imagemgr.cxx @@ -28,7 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" -#include "imagemgr.hxx" +#include "sfx2/imagemgr.hxx" #include <com/sun/star/frame/XController.hpp> #include <com/sun/star/ui/XImageManager.hpp> #include <com/sun/star/frame/XModuleManager.hpp> @@ -42,7 +42,7 @@ #include <rtl/ustring.hxx> #include <rtl/logfile.hxx> -#include "imgmgr.hxx" +#include "sfx2/imgmgr.hxx" #include <sfx2/app.hxx> #include <sfx2/unoctitm.hxx> #include <sfx2/dispatch.hxx> @@ -71,7 +71,7 @@ typedef boost::unordered_map< ::rtl::OUString, Image SAL_CALL GetImage( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& aURL, - BOOL bBig + bool bBig ) { // TODO/LATeR: shouldn't this become a method at SfxViewFrame?! That would save the UnoTunnel @@ -91,7 +91,7 @@ Image SAL_CALL GetImage( rtl::OUString aCommandURL( aURL ); if ( nProtocol == INET_PROT_SLOT ) { - USHORT nId = ( USHORT ) String(aURL).Copy(5).ToInt32(); + sal_uInt16 nId = ( sal_uInt16 ) String(aURL).Copy(5).ToInt32(); const SfxSlot* pSlot = 0; if ( xModel.is() ) { diff --git a/sfx2/source/appl/imestatuswindow.cxx b/sfx2/source/appl/imestatuswindow.cxx index 092ace28428b..092ace28428b 100644..100755 --- a/sfx2/source/appl/imestatuswindow.cxx +++ b/sfx2/source/appl/imestatuswindow.cxx diff --git a/sfx2/source/appl/imestatuswindow.hxx b/sfx2/source/appl/imestatuswindow.hxx index 184cdc721a6b..184cdc721a6b 100644..100755 --- a/sfx2/source/appl/imestatuswindow.hxx +++ b/sfx2/source/appl/imestatuswindow.hxx diff --git a/sfx2/source/appl/impldde.cxx b/sfx2/source/appl/impldde.cxx index efafab525c12..0aa33ae82c5a 100644..100755 --- a/sfx2/source/appl/impldde.cxx +++ b/sfx2/source/appl/impldde.cxx @@ -29,7 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" -#if defined(WIN) || defined(WNT) +#if defined(WNT) #include <tools/svwin.h> #endif @@ -46,7 +46,7 @@ #include "dde.hrc" #include <sfx2/lnkbase.hxx> #include <sfx2/linkmgr.hxx> -#include "sfxresid.hxx" +#include "sfx2/sfxresid.hxx" #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Sequence.hxx> @@ -132,7 +132,7 @@ SvDDEObject::SvDDEObject() : pConnection( 0 ), pLink( 0 ), pRequest( 0 ), pGetData( 0 ), nError( 0 ) { SetUpdateTimeout( 100 ); - bWaitForData = FALSE; + bWaitForData = sal_False; } SvDDEObject::~SvDDEObject() @@ -142,12 +142,12 @@ SvDDEObject::~SvDDEObject() delete pConnection; } -BOOL SvDDEObject::GetData( ::com::sun::star::uno::Any & rData /*out param*/, +sal_Bool SvDDEObject::GetData( ::com::sun::star::uno::Any & rData /*out param*/, const String & rMimeType, - BOOL bSynchron ) + sal_Bool bSynchron ) { if( !pConnection ) - return FALSE; + return sal_False; if( pConnection->GetError() ) // then we try once more { @@ -161,10 +161,10 @@ BOOL SvDDEObject::GetData( ::com::sun::star::uno::Any & rData /*out param*/, } if( bWaitForData ) // we are in an rekursive loop, get out again - return FALSE; + return sal_False; // Lock against Reentrance - bWaitForData = TRUE; + bWaitForData = sal_True; // if you want to print, we'll wait until the data is available if( bSynchron ) @@ -182,7 +182,7 @@ BOOL SvDDEObject::GetData( ::com::sun::star::uno::Any & rData /*out param*/, if( pConnection->GetError() ) nError = DDELINK_ERROR_DATA; - bWaitForData = FALSE; + bWaitForData = sal_False; } else { @@ -206,12 +206,12 @@ BOOL SvDDEObject::GetData( ::com::sun::star::uno::Any & rData /*out param*/, } -BOOL SvDDEObject::Connect( SvBaseLink * pSvLink ) +sal_Bool SvDDEObject::Connect( SvBaseLink * pSvLink ) { -#if defined(WIN) || defined(WNT) - static BOOL bInWinExec = FALSE; +#if defined(WNT) + static sal_Bool bInWinExec = sal_False; #endif - USHORT nLinkType = pSvLink->GetUpdateMode(); + sal_uInt16 nLinkType = pSvLink->GetUpdateMode(); if( pConnection ) // Connection is already made { // well, then just add it as dependent @@ -222,17 +222,17 @@ BOOL SvDDEObject::Connect( SvBaseLink * pSvLink ) : 0 ); AddConnectAdvise( pSvLink ); - return TRUE; + return sal_True; } if( !pSvLink->GetLinkManager() ) - return FALSE; + return sal_False; String sServer, sTopic; pSvLink->GetLinkManager()->GetDisplayNames( pSvLink, &sServer, &sTopic, &sItem ); if( !sServer.Len() || !sTopic.Len() || !sItem.Len() ) - return FALSE; + return sal_False; pConnection = new DdeConnection( sServer, sTopic ); if( pConnection->GetError() ) @@ -241,7 +241,7 @@ BOOL SvDDEObject::Connect( SvBaseLink * pSvLink ) // then the server is up, it just does not know the topic! if( sTopic.EqualsIgnoreCaseAscii( "SYSTEM" ) ) { - BOOL bSysTopic; + sal_Bool bSysTopic; { DdeConnection aTmp( sServer, String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "SYSTEM" ) ) ); bSysTopic = !aTmp.GetError(); @@ -250,12 +250,12 @@ BOOL SvDDEObject::Connect( SvBaseLink * pSvLink ) if( bSysTopic ) { nError = DDELINK_ERROR_DATA; - return FALSE; + return sal_False; } // otherwise in Win/WinNT, start the Application directly } -#if defined(WIN) || defined(WNT) +#if defined(WNT) // Server not up, try once more to start it. if( !bInWinExec ) @@ -268,12 +268,12 @@ BOOL SvDDEObject::Connect( SvBaseLink * pSvLink ) nError = DDELINK_ERROR_APP; else { - USHORT i; + sal_uInt16 i; for( i=0; i<5; i++ ) { - bInWinExec = TRUE; + bInWinExec = sal_True; Application::Reschedule(); - bInWinExec = FALSE; + bInWinExec = sal_False; delete pConnection; pConnection = new DdeConnection( sServer, sTopic ); @@ -288,7 +288,7 @@ BOOL SvDDEObject::Connect( SvBaseLink * pSvLink ) } } else -#endif // WIN / WNT +#endif // WNT { nError = DDELINK_ERROR_APP; } @@ -305,7 +305,7 @@ BOOL SvDDEObject::Connect( SvBaseLink * pSvLink ) } if( pConnection->GetError() ) - return FALSE; + return sal_False; AddDataAdvise( pSvLink, SotExchange::GetFormatMimeType( pSvLink->GetContentType()), @@ -314,7 +314,7 @@ BOOL SvDDEObject::Connect( SvBaseLink * pSvLink ) : 0 ); AddConnectAdvise( pSvLink ); SetUpdateTimeout( 0 ); - return TRUE; + return sal_True; } void SvDDEObject::Edit( Window* pParent, sfx2::SvBaseLink* pBaseLink, const Link& rEndEditHdl ) @@ -327,9 +327,9 @@ void SvDDEObject::Edit( Window* pParent, sfx2::SvBaseLink* pBaseLink, const Link } } -BOOL SvDDEObject::ImplHasOtherFormat( DdeTransaction& rReq ) +sal_Bool SvDDEObject::ImplHasOtherFormat( DdeTransaction& rReq ) { - USHORT nFmt = 0; + sal_uInt16 nFmt = 0; switch( rReq.GetFormat() ) { case FORMAT_RTF: @@ -356,7 +356,7 @@ BOOL SvDDEObject::ImplHasOtherFormat( DdeTransaction& rReq ) return 0 != nFmt; } -BOOL SvDDEObject::IsPending() const +sal_Bool SvDDEObject::IsPending() const /* [Description] The method determines whether the data-object can be read from a DDE. @@ -370,14 +370,14 @@ BOOL SvDDEObject::IsPending() const return bWaitForData; } -BOOL SvDDEObject::IsDataComplete() const +sal_Bool SvDDEObject::IsDataComplete() const { return bWaitForData; } IMPL_LINK( SvDDEObject, ImplGetDDEData, DdeData*, pData ) { - ULONG nFmt = pData->GetFormat(); + sal_uIntPtr nFmt = pData->GetFormat(); switch( nFmt ) { case FORMAT_GDIMETAFILE: @@ -403,7 +403,7 @@ IMPL_LINK( SvDDEObject, ImplGetDDEData, DdeData*, pData ) aVal <<= aSeq; DataChanged( SotExchange::GetFormatMimeType( pData->GetFormat() ), aVal ); - bWaitForData = FALSE; + bWaitForData = sal_False; } } } @@ -413,7 +413,7 @@ IMPL_LINK( SvDDEObject, ImplGetDDEData, DdeData*, pData ) IMPL_LINK( SvDDEObject, ImplDoneDDEData, void*, pData ) { - BOOL bValid = (BOOL)(ULONG)pData; + sal_Bool bValid = (sal_Bool)(sal_uIntPtr)pData; if( !bValid && ( pRequest || pLink )) { DdeTransaction* pReq = 0; @@ -430,13 +430,13 @@ IMPL_LINK( SvDDEObject, ImplDoneDDEData, void*, pData ) } else if( pReq == pRequest ) { - bWaitForData = FALSE; + bWaitForData = sal_False; } } } else // End waiting - bWaitForData = FALSE; + bWaitForData = sal_False; return 0; } diff --git a/sfx2/source/appl/impldde.hxx b/sfx2/source/appl/impldde.hxx index 8f37ca0a6807..3a2a84c2b685 100644..100755 --- a/sfx2/source/appl/impldde.hxx +++ b/sfx2/source/appl/impldde.hxx @@ -49,11 +49,11 @@ class SvDDEObject : public SvLinkSource DdeRequest* pRequest; ::com::sun::star::uno::Any * pGetData; - BYTE bWaitForData : 1; // waiting for data? - BYTE nError : 7; // Error code for dialogue + sal_uInt8 bWaitForData : 1; // waiting for data? + sal_uInt8 nError : 7; // Error code for dialogue - BOOL ImplHasOtherFormat( DdeTransaction& ); + sal_Bool ImplHasOtherFormat( DdeTransaction& ); DECL_LINK( ImplGetDDEData, DdeData* ); DECL_LINK( ImplDoneDDEData, void* ); @@ -63,15 +63,15 @@ protected: public: SvDDEObject(); - virtual BOOL GetData( ::com::sun::star::uno::Any & rData /*out param*/, + virtual sal_Bool GetData( ::com::sun::star::uno::Any & rData /*out param*/, const String & aMimeType, - BOOL bSynchron = FALSE ); + sal_Bool bSynchron = sal_False ); - virtual BOOL Connect( SvBaseLink * ); + virtual sal_Bool Connect( SvBaseLink * ); virtual void Edit( Window* pParent, sfx2::SvBaseLink* pBaseLink, const Link& rEndEditHdl ); - virtual BOOL IsPending() const; - virtual BOOL IsDataComplete() const; + virtual sal_Bool IsPending() const; + virtual sal_Bool IsDataComplete() const; }; } diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx index 06c3e1bd741c..410640750ec3 100644..100755 --- a/sfx2/source/appl/linkmgr2.cxx +++ b/sfx2/source/appl/linkmgr2.cxx @@ -51,7 +51,7 @@ #include "fileobj.hxx" #include "impldde.hxx" #include "app.hrc" -#include "sfxresid.hxx" +#include "sfx2/sfxresid.hxx" #define _SVSTDARR_STRINGSDTOR #include <svl/svstdarr.hxx> @@ -74,7 +74,7 @@ class SvxInternalLink : public sfx2::SvLinkSource public: SvxInternalLink() {} - virtual BOOL Connect( sfx2::SvBaseLink* ); + virtual sal_Bool Connect( sfx2::SvBaseLink* ); }; @@ -89,7 +89,7 @@ LinkManager::LinkManager(SfxObjectShell* p) LinkManager::~LinkManager() { SvBaseLinkRef** ppRef = (SvBaseLinkRef**)aLinkTbl.GetData(); - for( USHORT n = aLinkTbl.Count(); n; --n, ++ppRef ) + for( sal_uInt16 n = aLinkTbl.Count(); n; --n, ++ppRef ) { if( (*ppRef)->Is() ) { @@ -124,16 +124,16 @@ void LinkManager::CloseCachedComps() void LinkManager::Remove( SvBaseLink *pLink ) { // No duplicate links inserted - int bFound = FALSE; + int bFound = sal_False; SvBaseLinkRef** ppRef = (SvBaseLinkRef**)aLinkTbl.GetData(); - for( USHORT n = aLinkTbl.Count(); n; --n, ++ppRef ) + for( sal_uInt16 n = aLinkTbl.Count(); n; --n, ++ppRef ) { if( pLink == *(*ppRef) ) { (*(*ppRef))->Disconnect(); (*(*ppRef))->SetLinkManager( NULL ); (*(*ppRef)).Clear(); - bFound = TRUE; + bFound = sal_True; } // Remove emty ones if they exist @@ -149,7 +149,7 @@ void LinkManager::Remove( SvBaseLink *pLink ) } -void LinkManager::Remove( USHORT nPos, USHORT nCnt ) +void LinkManager::Remove( sal_uInt16 nPos, sal_uInt16 nCnt ) { if( nCnt && nPos < aLinkTbl.Count() ) { @@ -157,7 +157,7 @@ void LinkManager::Remove( USHORT nPos, USHORT nCnt ) nCnt = aLinkTbl.Count() - nPos; SvBaseLinkRef** ppRef = (SvBaseLinkRef**)aLinkTbl.GetData() + nPos; - for( USHORT n = nCnt; n; --n, ++ppRef ) + for( sal_uInt16 n = nCnt; n; --n, ++ppRef ) { if( (*ppRef)->Is() ) { @@ -171,29 +171,29 @@ void LinkManager::Remove( USHORT nPos, USHORT nCnt ) } -BOOL LinkManager::Insert( SvBaseLink* pLink ) +sal_Bool LinkManager::Insert( SvBaseLink* pLink ) { // No duplicate links inserted - for( USHORT n = 0; n < aLinkTbl.Count(); ++n ) + for( sal_uInt16 n = 0; n < aLinkTbl.Count(); ++n ) { SvBaseLinkRef* pTmp = aLinkTbl[ n ]; if( !pTmp->Is() ) aLinkTbl.DeleteAndDestroy( n-- ); if( pLink == *pTmp ) - return FALSE; + return sal_False; } SvBaseLinkRef* pTmp = new SvBaseLinkRef( pLink ); pLink->SetLinkManager( this ); aLinkTbl.Insert( pTmp, aLinkTbl.Count() ); - return TRUE; + return sal_True; } -BOOL LinkManager::InsertLink( SvBaseLink * pLink, - USHORT nObjType, - USHORT nUpdateMode, +sal_Bool LinkManager::InsertLink( SvBaseLink * pLink, + sal_uInt16 nObjType, + sal_uInt16 nUpdateMode, const String* pName ) { // This First @@ -205,13 +205,13 @@ BOOL LinkManager::InsertLink( SvBaseLink * pLink, } -BOOL LinkManager::InsertDDELink( SvBaseLink * pLink, +sal_Bool LinkManager::InsertDDELink( SvBaseLink * pLink, const String& rServer, const String& rTopic, const String& rItem ) { if( !( OBJECT_CLIENT_SO & pLink->GetObjType() ) ) - return FALSE; + return sal_False; String sCmd; ::sfx2::MakeLnkName( sCmd, &rServer, rTopic, rItem ); @@ -222,11 +222,11 @@ BOOL LinkManager::InsertDDELink( SvBaseLink * pLink, } -BOOL LinkManager::InsertDDELink( SvBaseLink * pLink ) +sal_Bool LinkManager::InsertDDELink( SvBaseLink * pLink ) { DBG_ASSERT( OBJECT_CLIENT_SO & pLink->GetObjType(), "no OBJECT_CLIENT_SO" ); if( !( OBJECT_CLIENT_SO & pLink->GetObjType() ) ) - return FALSE; + return sal_False; if( pLink->GetObjType() == OBJECT_CLIENT_SO ) pLink->SetObjType( OBJECT_CLIENT_DDE ); @@ -236,13 +236,13 @@ BOOL LinkManager::InsertDDELink( SvBaseLink * pLink ) // Obtain the string for the dialog -BOOL LinkManager::GetDisplayNames( const SvBaseLink * pLink, +sal_Bool LinkManager::GetDisplayNames( const SvBaseLink * pLink, String* pType, String* pFile, String* pLinkStr, String* pFilter ) const { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; const String sLNm( pLink->GetLinkSourceName() ); if( sLNm.Len() ) { @@ -252,7 +252,7 @@ BOOL LinkManager::GetDisplayNames( const SvBaseLink * pLink, case OBJECT_CLIENT_GRF: case OBJECT_CLIENT_OLE: { - USHORT nPos = 0; + sal_uInt16 nPos = 0; String sFile( sLNm.GetToken( 0, ::sfx2::cTokenSeperator, nPos ) ); String sRange( sLNm.GetToken( 0, ::sfx2::cTokenSeperator, nPos ) ); @@ -271,12 +271,12 @@ BOOL LinkManager::GetDisplayNames( const SvBaseLink * pLink, ? RID_SVXSTR_FILELINK : RID_SVXSTR_GRAFIKLINK )); } - bRet = TRUE; + bRet = sal_True; } break; case OBJECT_CLIENT_DDE: { - USHORT nTmp = 0; + sal_uInt16 nTmp = 0; String sCmd( sLNm ); String sServer( sCmd.GetToken( 0, cTokenSeperator, nTmp ) ); String sTopic( sCmd.GetToken( 0, cTokenSeperator, nTmp ) ); @@ -287,7 +287,7 @@ BOOL LinkManager::GetDisplayNames( const SvBaseLink * pLink, *pFile = sTopic; if( pLinkStr ) *pLinkStr = sCmd.Copy( nTmp ); - bRet = TRUE; + bRet = sal_True; } break; default: @@ -300,9 +300,9 @@ BOOL LinkManager::GetDisplayNames( const SvBaseLink * pLink, void LinkManager::UpdateAllLinks( - BOOL bAskUpdate, - BOOL /*bCallErrHdl*/, - BOOL bUpdateGrfLinks, + sal_Bool bAskUpdate, + sal_Bool /*bCallErrHdl*/, + sal_Bool bUpdateGrfLinks, Window* pParentWin ) { SvStringsDtor aApps, aTopics, aItems; @@ -311,7 +311,7 @@ void LinkManager::UpdateAllLinks( // First make a copy of the array in order to update links // links in ... no contact between them! SvPtrarr aTmpArr( 255, 50 ); - USHORT n; + sal_uInt16 n; for( n = 0; n < aLinkTbl.Count(); ++n ) { SvBaseLink* pLink = *aLinkTbl[ n ]; @@ -328,8 +328,8 @@ void LinkManager::UpdateAllLinks( SvBaseLink* pLink = (SvBaseLink*)aTmpArr[ n ]; // search first in the array after the entry - USHORT nFndPos = USHRT_MAX; - for( USHORT i = 0; i < aLinkTbl.Count(); ++i ) + sal_uInt16 nFndPos = USHRT_MAX; + for( sal_uInt16 i = 0; i < aLinkTbl.Count(); ++i ) if( pLink == *aLinkTbl[ i ] ) { nFndPos = i; @@ -349,7 +349,7 @@ void LinkManager::UpdateAllLinks( int nRet = QueryBox( pParentWin, WB_YES_NO | WB_DEF_YES, SfxResId( STR_QUERY_UPDATE_LINKS ) ).Execute(); if( RET_YES != nRet ) return ; // nothing should be updated - bAskUpdate = FALSE; // once is enough + bAskUpdate = sal_False; // once is enough } pLink->Update(); @@ -376,20 +376,20 @@ SvLinkSourceRef LinkManager::CreateObj( SvBaseLink * pLink ) } } -BOOL LinkManager::InsertServer( SvLinkSource* pObj ) +sal_Bool LinkManager::InsertServer( SvLinkSource* pObj ) { // no duplicate inserts if( !pObj || USHRT_MAX != aServerTbl.GetPos( pObj ) ) - return FALSE; + return sal_False; aServerTbl.Insert( pObj, aServerTbl.Count() ); - return TRUE; + return sal_True; } void LinkManager::RemoveServer( SvLinkSource* pObj ) { - USHORT nPos = aServerTbl.GetPos( pObj ); + sal_uInt16 nPos = aServerTbl.GetPos( pObj ); if( USHRT_MAX != nPos ) aServerTbl.Remove( nPos, 1 ); } @@ -459,14 +459,14 @@ void LinkManager::LinkServerShell(const OUString& rPath, SfxObjectShell& rServer } } -BOOL LinkManager::InsertFileLink( sfx2::SvBaseLink& rLink, - USHORT nFileType, +sal_Bool LinkManager::InsertFileLink( sfx2::SvBaseLink& rLink, + sal_uInt16 nFileType, const String& rFileNm, const String* pFilterNm, const String* pRange ) { if( !( OBJECT_CLIENT_SO & rLink.GetObjType() )) - return FALSE; + return sal_False; String sCmd( rFileNm ); sCmd += ::sfx2::cTokenSeperator; @@ -478,11 +478,11 @@ BOOL LinkManager::InsertFileLink( sfx2::SvBaseLink& rLink, return InsertLink( &rLink, nFileType, sfx2::LINKUPDATE_ONCALL, &sCmd ); } -BOOL LinkManager::InsertFileLink( sfx2::SvBaseLink& rLink ) +sal_Bool LinkManager::InsertFileLink( sfx2::SvBaseLink& rLink ) { if( OBJECT_CLIENT_FILE == ( OBJECT_CLIENT_FILE & rLink.GetObjType() )) return InsertLink( &rLink, rLink.GetObjType(), sfx2::LINKUPDATE_ONCALL ); - return FALSE; + return sal_False; } // A transfer is aborted, so cancel all download media @@ -493,7 +493,7 @@ void LinkManager::CancelTransfers() sfx2::SvBaseLink* pLnk; const sfx2::SvBaseLinks& rLnks = GetLinks(); - for( USHORT n = rLnks.Count(); n; ) + for( sal_uInt16 n = rLnks.Count(); n; ) if( 0 != ( pLnk = &(*rLnks[ --n ])) && OBJECT_CLIENT_FILE == (OBJECT_CLIENT_FILE & pLnk->GetObjType()) && 0 != ( pFileObj = (SvFileObject*)pLnk->GetObj() ) ) @@ -504,9 +504,9 @@ void LinkManager::CancelTransfers() // gets the appropriate information as a string // For now this is required for file object in conjunction with JavaScript // - needs information about Load/Abort/Error -ULONG LinkManager::RegisterStatusInfoId() +sal_uIntPtr LinkManager::RegisterStatusInfoId() { - static ULONG nFormat = 0; + static sal_uIntPtr nFormat = 0; if( !nFormat ) { @@ -521,11 +521,11 @@ ULONG LinkManager::RegisterStatusInfoId() // ---------------------------------------------------------------------- -BOOL LinkManager::GetGraphicFromAny( const String& rMimeType, +sal_Bool LinkManager::GetGraphicFromAny( const String& rMimeType, const ::com::sun::star::uno::Any & rValue, Graphic& rGrf ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; ::com::sun::star::uno::Sequence< sal_Int8 > aSeq; if( rValue.hasValue() && ( rValue >>= aSeq ) ) { @@ -538,7 +538,7 @@ BOOL LinkManager::GetGraphicFromAny( const String& rMimeType, case SOT_FORMATSTR_ID_SVXB: { aMemStm >> rGrf; - bRet = TRUE; + bRet = sal_True; } break; case FORMAT_GDIMETAFILE: @@ -546,7 +546,7 @@ BOOL LinkManager::GetGraphicFromAny( const String& rMimeType, GDIMetaFile aMtf; aMtf.Read( aMemStm ); rGrf = aMtf; - bRet = TRUE; + bRet = sal_True; } break; case FORMAT_BITMAP: @@ -554,7 +554,7 @@ BOOL LinkManager::GetGraphicFromAny( const String& rMimeType, Bitmap aBmp; aMemStm >> aBmp; rGrf = aBmp; - bRet = TRUE; + bRet = sal_True; } break; } @@ -575,10 +575,10 @@ String lcl_DDE_RelToAbs( const String& rTopic, const String& rBaseURL ) return sRet; } -BOOL SvxInternalLink::Connect( sfx2::SvBaseLink* pLink ) +sal_Bool SvxInternalLink::Connect( sfx2::SvBaseLink* pLink ) { SfxObjectShell* pFndShell = 0; - USHORT nUpdateMode = com::sun::star::document::UpdateDocMode::NO_UPDATE; + sal_uInt16 nUpdateMode = com::sun::star::document::UpdateDocMode::NO_UPDATE; String sTopic, sItem, sReferer; LinkManager* pLinkMgr = pLink->GetLinkManager(); if (pLinkMgr && pLinkMgr->GetDisplayNames(pLink, 0, &sTopic, &sItem) && sTopic.Len()) @@ -594,7 +594,7 @@ BOOL SvxInternalLink::Connect( sfx2::SvBaseLink* pLink ) TypeId aType( TYPE(SfxObjectShell) ); - BOOL bFirst = TRUE; + sal_Bool bFirst = sal_True; SfxObjectShell* pShell = pLinkMgr->GetPersist(); if( pShell && pShell->GetMedium() ) { @@ -609,7 +609,7 @@ BOOL SvxInternalLink::Connect( sfx2::SvBaseLink* pLink ) if ( !pShell ) { - bFirst = FALSE; + bFirst = sal_False; pShell = SfxObjectShell::GetFirst( &aType, sal_False ); } @@ -631,7 +631,7 @@ BOOL SvxInternalLink::Connect( sfx2::SvBaseLink* pLink ) if( bFirst ) { - bFirst = FALSE; + bFirst = sal_False; pShell = SfxObjectShell::GetFirst( &aType, sal_False ); } else @@ -643,7 +643,7 @@ BOOL SvxInternalLink::Connect( sfx2::SvBaseLink* pLink ) // empty topics are not allowed - which document is it if( !sTopic.Len() ) - return FALSE; + return sal_False; if (pFndShell) { @@ -671,8 +671,8 @@ BOOL SvxInternalLink::Connect( sfx2::SvBaseLink* pLink ) INET_PROT_HTTP != aURL.GetProtocol() ) { SfxStringItem aName( SID_FILE_NAME, sTopic ); - SfxBoolItem aMinimized(SID_MINIMIZED, TRUE); - SfxBoolItem aHidden(SID_HIDDEN, TRUE); + SfxBoolItem aMinimized(SID_MINIMIZED, sal_True); + SfxBoolItem aHidden(SID_HIDDEN, sal_True); SfxStringItem aTarget( SID_TARGETNAME, String::CreateFromAscii("_blank") ); SfxStringItem aReferer( SID_REFERER, sReferer ); SfxUInt16Item aUpdate( SID_UPDATEDOCMODE, nUpdateMode ); diff --git a/sfx2/source/appl/linksrc.cxx b/sfx2/source/appl/linksrc.cxx index 38beca9a8294..70aa59578c2d 100644..100755 --- a/sfx2/source/appl/linksrc.cxx +++ b/sfx2/source/appl/linksrc.cxx @@ -67,7 +67,7 @@ void SvLinkSourceTimer::Timeout() } static void StartTimer( SvLinkSourceTimer ** ppTimer, SvLinkSource * pOwner, - ULONG nTimeout ) + sal_uIntPtr nTimeout ) { if( !*ppTimer ) { @@ -82,17 +82,17 @@ struct SvLinkSource_Entry_Impl { SvBaseLinkRef xSink; String aDataMimeType; - USHORT nAdviseModes; - BOOL bIsDataSink; + sal_uInt16 nAdviseModes; + sal_Bool bIsDataSink; SvLinkSource_Entry_Impl( SvBaseLink* pLink, const String& rMimeType, - USHORT nAdvMode ) + sal_uInt16 nAdvMode ) : xSink( pLink ), aDataMimeType( rMimeType ), - nAdviseModes( nAdvMode ), bIsDataSink( TRUE ) + nAdviseModes( nAdvMode ), bIsDataSink( sal_True ) {} SvLinkSource_Entry_Impl( SvBaseLink* pLink ) - : xSink( pLink ), nAdviseModes( 0 ), bIsDataSink( FALSE ) + : xSink( pLink ), nAdviseModes( 0 ), bIsDataSink( sal_False ) {} ~SvLinkSource_Entry_Impl(); @@ -110,7 +110,7 @@ class SvLinkSource_EntryIter_Impl { SvLinkSource_Array_Impl aArr; const SvLinkSource_Array_Impl& rOrigArr; - USHORT nPos; + sal_uInt16 nPos; public: SvLinkSource_EntryIter_Impl( const SvLinkSource_Array_Impl& rArr ); ~SvLinkSource_EntryIter_Impl(); @@ -168,7 +168,7 @@ struct SvLinkSource_Impl SvLinkSource_Array_Impl aArr; String aDataMimeType; SvLinkSourceTimer * pTimer; - ULONG nTimeout; + sal_uIntPtr nTimeout; com::sun::star::uno::Reference<com::sun::star::io::XInputStream> m_xInputStreamToLoadFrom; sal_Bool m_bIsReadOnly; @@ -222,12 +222,12 @@ void SvLinkSource::Closed() p->xSink->Closed(); } -ULONG SvLinkSource::GetUpdateTimeout() const +sal_uIntPtr SvLinkSource::GetUpdateTimeout() const { return pImpl->nTimeout; } -void SvLinkSource::SetUpdateTimeout( ULONG nTimeout ) +void SvLinkSource::SetUpdateTimeout( sal_uIntPtr nTimeout ) { pImpl->nTimeout = nTimeout; if( pImpl->pTimer ) @@ -247,7 +247,7 @@ void SvLinkSource::SendDataChanged() Any aVal; if( ( p->nAdviseModes & ADVISEMODE_NODATA ) || - GetData( aVal, sDataMimeType, TRUE ) ) + GetData( aVal, sDataMimeType, sal_True ) ) { p->xSink->DataChanged( sDataMimeType, aVal ); @@ -256,7 +256,7 @@ void SvLinkSource::SendDataChanged() if( p->nAdviseModes & ADVISEMODE_ONLYONCE ) { - USHORT nFndPos = pImpl->aArr.GetPos( p ); + sal_uInt16 nFndPos = pImpl->aArr.GetPos( p ); if( USHRT_MAX != nFndPos ) pImpl->aArr.DeleteAndDestroy( nFndPos ); } @@ -284,7 +284,7 @@ void SvLinkSource::NotifyDataChanged() { Any aVal; if( ( p->nAdviseModes & ADVISEMODE_NODATA ) || - GetData( aVal, p->aDataMimeType, TRUE ) ) + GetData( aVal, p->aDataMimeType, sal_True ) ) { p->xSink->DataChanged( p->aDataMimeType, aVal ); @@ -293,7 +293,7 @@ void SvLinkSource::NotifyDataChanged() if( p->nAdviseModes & ADVISEMODE_ONLYONCE ) { - USHORT nFndPos = pImpl->aArr.GetPos( p ); + sal_uInt16 nFndPos = pImpl->aArr.GetPos( p ); if( USHRT_MAX != nFndPos ) pImpl->aArr.DeleteAndDestroy( nFndPos ); } @@ -333,7 +333,7 @@ void SvLinkSource::DataChanged( const String & rMimeType, if( p->nAdviseModes & ADVISEMODE_ONLYONCE ) { - USHORT nFndPos = pImpl->aArr.GetPos( p ); + sal_uInt16 nFndPos = pImpl->aArr.GetPos( p ); if( USHRT_MAX != nFndPos ) pImpl->aArr.DeleteAndDestroy( nFndPos ); } @@ -351,7 +351,7 @@ void SvLinkSource::DataChanged( const String & rMimeType, // only one link is correct void SvLinkSource::AddDataAdvise( SvBaseLink * pLink, const String& rMimeType, - USHORT nAdviseModes ) + sal_uInt16 nAdviseModes ) { SvLinkSource_Entry_ImplPtr pNew = new SvLinkSource_Entry_Impl( pLink, rMimeType, nAdviseModes ); @@ -364,7 +364,7 @@ void SvLinkSource::RemoveAllDataAdvise( SvBaseLink * pLink ) for( SvLinkSource_Entry_ImplPtr p = aIter.Curr(); p; p = aIter.Next() ) if( p->bIsDataSink && &p->xSink == pLink ) { - USHORT nFndPos = pImpl->aArr.GetPos( p ); + sal_uInt16 nFndPos = pImpl->aArr.GetPos( p ); if( USHRT_MAX != nFndPos ) pImpl->aArr.DeleteAndDestroy( nFndPos ); } @@ -383,46 +383,46 @@ void SvLinkSource::RemoveConnectAdvise( SvBaseLink * pLink ) for( SvLinkSource_Entry_ImplPtr p = aIter.Curr(); p; p = aIter.Next() ) if( !p->bIsDataSink && &p->xSink == pLink ) { - USHORT nFndPos = pImpl->aArr.GetPos( p ); + sal_uInt16 nFndPos = pImpl->aArr.GetPos( p ); if( USHRT_MAX != nFndPos ) pImpl->aArr.DeleteAndDestroy( nFndPos ); } } -BOOL SvLinkSource::HasDataLinks( const SvBaseLink* pLink ) const +sal_Bool SvLinkSource::HasDataLinks( const SvBaseLink* pLink ) const { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; const SvLinkSource_Entry_Impl* p; - for( USHORT n = 0, nEnd = pImpl->aArr.Count(); n < nEnd; ++n ) + for( sal_uInt16 n = 0, nEnd = pImpl->aArr.Count(); n < nEnd; ++n ) if( ( p = pImpl->aArr[ n ] )->bIsDataSink && ( !pLink || &p->xSink == pLink ) ) { - bRet = TRUE; + bRet = sal_True; break; } return bRet; } -// TRUE => waitinmg for data -BOOL SvLinkSource::IsPending() const +// sal_True => waitinmg for data +sal_Bool SvLinkSource::IsPending() const { - return FALSE; + return sal_False; } -// TRUE => data complete loaded -BOOL SvLinkSource::IsDataComplete() const +// sal_True => data complete loaded +sal_Bool SvLinkSource::IsDataComplete() const { - return TRUE; + return sal_True; } -BOOL SvLinkSource::Connect( SvBaseLink* ) +sal_Bool SvLinkSource::Connect( SvBaseLink* ) { - return TRUE; + return sal_True; } -BOOL SvLinkSource::GetData( ::com::sun::star::uno::Any &, const String &, BOOL ) +sal_Bool SvLinkSource::GetData( ::com::sun::star::uno::Any &, const String &, sal_Bool ) { - return FALSE; + return sal_False; } void SvLinkSource::Edit( Window *, SvBaseLink *, const Link& ) diff --git a/sfx2/source/appl/lnkbase2.cxx b/sfx2/source/appl/lnkbase2.cxx index f37b672acbc9..598b08988cbb 100644..100755 --- a/sfx2/source/appl/lnkbase2.cxx +++ b/sfx2/source/appl/lnkbase2.cxx @@ -37,7 +37,7 @@ #include <sfx2/linkmgr.hxx> #include <vcl/svapp.hxx> #include "app.hrc" -#include "sfxresid.hxx" +#include "sfx2/sfxresid.hxx" #include <sfx2/filedlghelper.hxx> #include <tools/debug.hxx> #include <svl/svdde.hxx> @@ -49,7 +49,7 @@ namespace sfx2 TYPEINIT0( SvBaseLink ) -static DdeTopic* FindTopic( const String &, USHORT* = 0 ); +static DdeTopic* FindTopic( const String &, sal_uInt16* = 0 ); class ImplDdeItem; @@ -78,10 +78,10 @@ struct ImplBaseLinkData struct tClientType { // applies for all links - ULONG nCntntType; // Update Format + sal_uIntPtr nCntntType; // Update Format // Not Ole-Links - BOOL bIntrnlLnk; // It is an internal link - USHORT nUpdateMode; // UpdateMode + sal_Bool bIntrnlLnk; // It is an internal link + sal_uInt16 nUpdateMode; // UpdateMode }; struct tDDEType @@ -96,7 +96,7 @@ struct ImplBaseLinkData ImplBaseLinkData() { ClientType.nCntntType = 0; - ClientType.bIntrnlLnk = FALSE; + ClientType.bIntrnlLnk = sal_False; ClientType.nUpdateMode = 0; DDEType.pItem = NULL; } @@ -108,26 +108,26 @@ class ImplDdeItem : public DdeGetPutItem SvBaseLink* pLink; DdeData aData; Sequence< sal_Int8 > aSeq; // Datacontainer for DdeData !!! - BOOL bIsValidData : 1; - BOOL bIsInDTOR : 1; + sal_Bool bIsValidData : 1; + sal_Bool bIsInDTOR : 1; public: ImplDdeItem( SvBaseLink& rLink, const String& rStr ) - : DdeGetPutItem( rStr ), pLink( &rLink ), bIsValidData( FALSE ), - bIsInDTOR( FALSE ) + : DdeGetPutItem( rStr ), pLink( &rLink ), bIsValidData( sal_False ), + bIsInDTOR( sal_False ) {} virtual ~ImplDdeItem(); - virtual DdeData* Get( ULONG ); - virtual BOOL Put( const DdeData* ); - virtual void AdviseLoop( BOOL ); + virtual DdeData* Get( sal_uIntPtr ); + virtual sal_Bool Put( const DdeData* ); + virtual void AdviseLoop( sal_Bool ); void Notify() { - bIsValidData = FALSE; + bIsValidData = sal_False; DdeGetPutItem::NotifyClient(); } - BOOL IsInDTOR() const { return bIsInDTOR; } + sal_Bool IsInDTOR() const { return bIsInDTOR; } }; //-------------------------------------------------------------------------- @@ -137,32 +137,32 @@ SvBaseLink::SvBaseLink() pImpl = new BaseLink_Impl(); nObjType = OBJECT_CLIENT_SO; pImplData = new ImplBaseLinkData; - bVisible = bSynchron = bUseCache = TRUE; - bWasLastEditOK = FALSE; + bVisible = bSynchron = bUseCache = sal_True; + bWasLastEditOK = sal_False; } //-------------------------------------------------------------------------- -SvBaseLink::SvBaseLink( USHORT nUpdateMode, ULONG nContentType ) +SvBaseLink::SvBaseLink( sal_uInt16 nUpdateMode, sal_uIntPtr nContentType ) { pImpl = new BaseLink_Impl(); nObjType = OBJECT_CLIENT_SO; pImplData = new ImplBaseLinkData; - bVisible = bSynchron = bUseCache = TRUE; - bWasLastEditOK = FALSE; + bVisible = bSynchron = bUseCache = sal_True; + bWasLastEditOK = sal_False; // It it going to be a Ole-Link, pImplData->ClientType.nUpdateMode = nUpdateMode; pImplData->ClientType.nCntntType = nContentType; - pImplData->ClientType.bIntrnlLnk = FALSE; + pImplData->ClientType.bIntrnlLnk = sal_False; } //-------------------------------------------------------------------------- -SvBaseLink::SvBaseLink( const String& rLinkName, USHORT nObjectType, SvLinkSource* pObj ) +SvBaseLink::SvBaseLink( const String& rLinkName, sal_uInt16 nObjectType, SvLinkSource* pObj ) { - bVisible = bSynchron = bUseCache = TRUE; - bWasLastEditOK = FALSE; + bVisible = bSynchron = bUseCache = sal_True; + bWasLastEditOK = sal_False; aLinkName = rLinkName; pImplData = new ImplBaseLinkData; nObjType = nObjectType; @@ -175,7 +175,7 @@ SvBaseLink::SvBaseLink( const String& rLinkName, USHORT nObjectType, SvLinkSourc if( OBJECT_DDE_EXTERN == nObjType ) { - USHORT nItemStt = 0; + sal_uInt16 nItemStt = 0; DdeTopic* pTopic = FindTopic( aLinkName, &nItemStt ); if( pTopic ) { @@ -226,7 +226,7 @@ IMPL_LINK( SvBaseLink, EndEditHdl, String*, _pNewName ) //-------------------------------------------------------------------------- -void SvBaseLink::SetObjType( USHORT nObjTypeP ) +void SvBaseLink::SetObjType( sal_uInt16 nObjTypeP ) { DBG_ASSERT( nObjType != OBJECT_CLIENT_DDE, "type already set" ); DBG_ASSERT( !xObj.Is(), "object exist" ); @@ -286,7 +286,7 @@ String SvBaseLink::GetLinkSourceName() const //-------------------------------------------------------------------------- -void SvBaseLink::SetUpdateMode( USHORT nMode ) +void SvBaseLink::SetUpdateMode( sal_uInt16 nMode ) { if( ( OBJECT_CLIENT_SO & nObjType ) && pImplData->ClientType.nUpdateMode != nMode ) @@ -310,7 +310,7 @@ void SvBaseLink::clearStreamToLoadFrom() } } -BOOL SvBaseLink::Update() +sal_Bool SvBaseLink::Update() { if( OBJECT_CLIENT_SO & nObjType ) { @@ -333,13 +333,13 @@ BOOL SvBaseLink::Update() if( OBJECT_CLIENT_DDE == nObjType && LINKUPDATE_ONCALL == GetUpdateMode() && xObj.Is() ) xObj->RemoveAllDataAdvise( this ); - return TRUE; + return sal_True; } if( xObj.Is() ) { // should be asynschron? if( xObj->IsPending() ) - return TRUE; + return sal_True; // we do not need the object anymore AddNextRef(); @@ -348,19 +348,19 @@ BOOL SvBaseLink::Update() } } } - return FALSE; + return sal_False; } -USHORT SvBaseLink::GetUpdateMode() const +sal_uInt16 SvBaseLink::GetUpdateMode() const { return ( OBJECT_CLIENT_SO & nObjType ) ? pImplData->ClientType.nUpdateMode - : sal::static_int_cast< USHORT >( LINKUPDATE_ONCALL ); + : sal::static_int_cast< sal_uInt16 >( LINKUPDATE_ONCALL ); } -void SvBaseLink::_GetRealObject( BOOL bConnect) +void SvBaseLink::_GetRealObject( sal_Bool bConnect) { if( !pImpl->m_pLinkMgr ) return; @@ -377,12 +377,12 @@ void SvBaseLink::_GetRealObject( BOOL bConnect) nObjType = OBJECT_INTERN; xObj = pImpl->m_pLinkMgr->CreateObj( this ); - pImplData->ClientType.bIntrnlLnk = TRUE; + pImplData->ClientType.bIntrnlLnk = sal_True; nObjType = OBJECT_CLIENT_DDE; // so we know what it once was! } else { - pImplData->ClientType.bIntrnlLnk = FALSE; + pImplData->ClientType.bIntrnlLnk = sal_False; xObj = pImpl->m_pLinkMgr->CreateObj( this ); } } @@ -393,7 +393,7 @@ void SvBaseLink::_GetRealObject( BOOL bConnect) Disconnect(); } -ULONG SvBaseLink::GetContentType() const +sal_uIntPtr SvBaseLink::GetContentType() const { if( OBJECT_CLIENT_SO & nObjType ) return pImplData->ClientType.nCntntType; @@ -402,14 +402,14 @@ ULONG SvBaseLink::GetContentType() const } -BOOL SvBaseLink::SetContentType( ULONG nType ) +sal_Bool SvBaseLink::SetContentType( sal_uIntPtr nType ) { if( OBJECT_CLIENT_SO & nObjType ) { pImplData->ClientType.nCntntType = nType; - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } LinkManager* SvBaseLink::GetLinkManager() @@ -480,7 +480,7 @@ void SvBaseLink::Edit( Window* pParent, const Link& rEndEditHdl ) if ( !bAsync ) { ExecuteEdit( String() ); - bWasLastEditOK = FALSE; + bWasLastEditOK = sal_False; if ( pImpl->m_aEndEditLink.IsSet() ) pImpl->m_aEndEditLink.Call( this ); } @@ -499,7 +499,7 @@ bool SvBaseLink::ExecuteEdit( const String& _rNewName ) { sError = SfxResId( STR_DDE_ERROR ); - USHORT nFndPos = sError.Search( '%' ); + sal_uInt16 nFndPos = sError.Search( '%' ); if( STRING_NOTFOUND != nFndPos ) { sError.Erase( nFndPos, 1 ).Insert( sApp, nFndPos ); @@ -541,13 +541,13 @@ FileDialogHelper* SvBaseLink::GetFileDialog( sal_uInt32 nFlags, const String& rF ImplDdeItem::~ImplDdeItem() { - bIsInDTOR = TRUE; + bIsInDTOR = sal_True; // So that no-one gets the idea to delete the pointer when Disconnecting! SvBaseLinkRef aRef( pLink ); aRef->Disconnect(); } -DdeData* ImplDdeItem::Get( ULONG nFormat ) +DdeData* ImplDdeItem::Get( sal_uIntPtr nFormat ) { if( pLink->GetObj() ) { @@ -563,25 +563,25 @@ DdeData* ImplDdeItem::Get( ULONG nFormat ) { aData = DdeData( (const char *)aSeq.getConstArray(), aSeq.getLength(), nFormat ); - bIsValidData = TRUE; + bIsValidData = sal_True; return &aData; } } } aSeq.realloc( 0 ); - bIsValidData = FALSE; + bIsValidData = sal_False; return 0; } -BOOL ImplDdeItem::Put( const DdeData* ) +sal_Bool ImplDdeItem::Put( const DdeData* ) { OSL_FAIL( "ImplDdeItem::Put not implemented" ); - return FALSE; + return sal_False; } -void ImplDdeItem::AdviseLoop( BOOL bOpen ) +void ImplDdeItem::AdviseLoop( sal_Bool bOpen ) { // Connection is closed, so also unsubscribe link if( pLink->GetObj() ) @@ -606,13 +606,13 @@ void ImplDdeItem::AdviseLoop( BOOL bOpen ) } -static DdeTopic* FindTopic( const String & rLinkName, USHORT* pItemStt ) +static DdeTopic* FindTopic( const String & rLinkName, sal_uInt16* pItemStt ) { if( 0 == rLinkName.Len() ) return 0; String sNm( rLinkName ); - USHORT nTokenPos = 0; + sal_uInt16 nTokenPos = 0; String sService( sNm.GetToken( 0, cTokenSeperator, nTokenPos ) ); DdeServices& rSvc = DdeService::GetServices(); diff --git a/sfx2/source/appl/makefile.mk b/sfx2/source/appl/makefile.mk deleted file mode 100644 index b1e633402234..000000000000 --- a/sfx2/source/appl/makefile.mk +++ /dev/null @@ -1,163 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/.. - -PRJNAME=sfx2 -TARGET=appl -ENABLE_EXCEPTIONS=TRUE -LIBTARGET=NO - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/makefile.pmk - -# due to compilerbugs -.IF "$(GUI)"=="WNT" -.IF "$(COM)"!="GCC" -CFLAGS+=-Od -CFLAGS+=-DENABLE_QUICKSTART_APPLET -.ENDIF -.ENDIF - -.IF "$(GUIBASE)"=="aqua" -CFLAGS+=-DENABLE_QUICKSTART_APPLET -.ENDIF - -.IF "$(GUI)"=="UNX" - CDEFS+=-DDLL_NAME=libsfx$(DLLPOSTFIX)$(DLLPOST) -.IF "$(ENABLE_SYSTRAY_GTK)"=="TRUE" - PKGCONFIG_MODULES=gtk+-2.0 -.IF "$(ENABLE_GIO)"!="" - PKGCONFIG_MODULES+=gio-2.0 - CDEFS+=-DENABLE_GIO -.ENDIF - .INCLUDE: pkg_config.mk - CFLAGS+=$(PKGCONFIG_CFLAGS) - CFLAGS+=-DENABLE_QUICKSTART_APPLET - CDEFS+=-DPLUGIN_NAME=libqstart_gtk$(DLLPOSTFIX)$(DLLPOST) -.ENDIF # "$(ENABLE_SYSTRAY_GTK)"=="TRUE" -.ELSE - CDEFS+=-DDLL_NAME=sfx$(DLLPOSTFIX)$(DLLPOST) -.ENDIF - -# --- Files -------------------------------------------------------- - -SRS1NAME=appl -SRC1FILES = \ - app.src newhelp.src dde.src - -SRS2NAME=sfx -SRC2FILES = \ - sfx.src - -SFX_OBJECTS = \ - $(SLO)$/app.obj \ - $(SLO)$/appbas.obj \ - $(SLO)$/appcfg.obj \ - $(SLO)$/appchild.obj \ - $(SLO)$/appdata.obj \ - $(SLO)$/appdde.obj \ - $(SLO)$/appinit.obj \ - $(SLO)$/appmain.obj \ - $(SLO)$/appmisc.obj \ - $(SLO)$/appopen.obj \ - $(SLO)$/appquit.obj \ - $(SLO)$/appreg.obj \ - $(SLO)$/appserv.obj \ - $(SLO)$/appuno.obj \ - $(SLO)$/appbaslib.obj \ - $(SLO)$/childwin.obj \ - $(SLO)$/fileobj.obj \ - $(SLO)$/helpdispatch.obj \ - $(SLO)$/helpinterceptor.obj \ - $(SLO)$/imagemgr.obj\ - $(SLO)$/imestatuswindow.obj \ - $(SLO)$/impldde.obj \ - $(SLO)$/linkmgr2.obj \ - $(SLO)$/linksrc.obj \ - $(SLO)$/lnkbase2.obj \ - $(SLO)$/module.obj \ - $(SLO)$/newhelp.obj \ - $(SLO)$/opengrf.obj \ - $(SLO)$/sfxdll.obj \ - $(SLO)$/sfxhelp.obj \ - $(SLO)$/sfxpicklist.obj \ - $(SLO)$/shutdownicon.obj \ - $(SLO)$/shutdowniconw32.obj \ - $(SLO)$/workwin.obj \ - $(SLO)$/xpackcreator.obj \ - $(SLO)$/fwkhelper.obj - -.IF "$(GUI)"=="OS2" -SFX_OBJECTS += $(SLO)$/shutdowniconOs2.obj -.ENDIF - -.IF "$(GUIBASE)"=="aqua" -SFX_OBJECTS += $(SLO)$/shutdowniconaqua.obj -.ENDIF - -SLOFILES = $(SFX_OBJECTS) -LIB1TARGET= $(SLB)$/$(TARGET).lib -LIB1OBJFILES= $(SFX_OBJECTS) - -.IF "$(ENABLE_SYSTRAY_GTK)"=="TRUE" -QUICKSTART_OBJECTS = $(SLO)$/shutdowniconunx.obj -SLOFILES += $(QUICKSTART_OBJECTS) - -LIB2TARGET= $(SLB)$/quickstart.lib -LIB2OBJFILES= $(QUICKSTART_OBJECTS) -.ENDIF - -.IF "$(GUI)"=="OS2" -SLOFILES += $(SLO)$/shutdowniconOs2.obj -.ENDIF - -EXCEPTIONSFILES=\ - $(SLO)$/imagemgr.obj \ - $(SLO)$/appopen.obj \ - $(SLO)$/appmain.obj \ - $(SLO)$/appmisc.obj \ - $(SLO)$/appinit.obj \ - $(SLO)$/appcfg.obj \ - $(SLO)$/fileobj.obj \ - $(SLO)$/helpinterceptor.obj \ - $(SLO)$/newhelp.obj \ - $(SLO)$/opengrf.obj \ - $(SLO)$/sfxhelp.obj \ - $(SLO)$/shutdownicon.obj \ - $(SLO)$/shutdowniconw32.obj \ - $(SLO)$/sfxpicklist.obj \ - $(SLO)$/helpdispatch.obj \ - $(SLO)$/xpackcreator.obj - - -# --- Targets ------------------------------------------------------- - -.INCLUDE : target.mk - diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx index a8d2c24b939a..1a92d59ea464 100644..100755 --- a/sfx2/source/appl/module.cxx +++ b/sfx2/source/appl/module.cxx @@ -36,10 +36,10 @@ #include <sfx2/module.hxx> #include <sfx2/app.hxx> #include "arrdecl.hxx" -#include "sfxresid.hxx" +#include "sfx2/sfxresid.hxx" #include <sfx2/msgpool.hxx> #include <sfx2/tbxctrl.hxx> -#include "stbitem.hxx" +#include "sfx2/stbitem.hxx" #include <sfx2/mnuitem.hxx> #include <sfx2/childwin.hxx> #include <sfx2/mnumgr.hxx> @@ -69,7 +69,7 @@ public: SfxModule_Impl(); ~SfxModule_Impl(); - ImageList* GetImageList( ResMgr* pResMgr, BOOL bBig ); + ImageList* GetImageList( ResMgr* pResMgr, bool bBig ); }; SfxModule_Impl::SfxModule_Impl() @@ -88,7 +88,7 @@ SfxModule_Impl::~SfxModule_Impl() delete pImgListBig; } -ImageList* SfxModule_Impl::GetImageList( ResMgr* pResMgr, BOOL bBig ) +ImageList* SfxModule_Impl::GetImageList( ResMgr* pResMgr, bool bBig ) { ImageList*& rpList = bBig ? pImgListBig : pImgListSmall; if ( !rpList ) @@ -124,7 +124,7 @@ ResMgr* SfxModule::GetResMgr() //==================================================================== -SfxModule::SfxModule( ResMgr* pMgrP, BOOL bDummyP, +SfxModule::SfxModule( ResMgr* pMgrP, sal_Bool bDummyP, SfxObjectFactory* pFactoryP, ... ) : pResMgr( pMgrP ), bDummy( bDummyP ), pImpl(0L) { @@ -170,7 +170,7 @@ SfxModule::~SfxModule() // The module will be destroyed before the Deinitialize, // so remove from the array SfxModuleArr_Impl& rArr = GetModules_Impl(); - for( USHORT nPos = rArr.Count(); nPos--; ) + for( sal_uInt16 nPos = rArr.Count(); nPos--; ) { if( rArr[ nPos ] == this ) { @@ -202,7 +202,7 @@ void SfxModule::RegisterChildWindow(SfxChildWinFactory *pFact) if (!pImpl->pFactArr) pImpl->pFactArr = new SfxChildWinFactArr_Impl; - for (USHORT nFactory=0; nFactory<pImpl->pFactArr->Count(); ++nFactory) + for (sal_uInt16 nFactory=0; nFactory<pImpl->pFactArr->Count(); ++nFactory) { if (pFact->nId == (*pImpl->pFactArr)[nFactory]->nId) { @@ -218,13 +218,13 @@ void SfxModule::RegisterChildWindow(SfxChildWinFactory *pFact) //------------------------------------------------------------------------- -void SfxModule::RegisterChildWindowContext( USHORT nId, +void SfxModule::RegisterChildWindowContext( sal_uInt16 nId, SfxChildWinContextFactory *pFact) { DBG_ASSERT( pImpl, "No real Module!" ); - USHORT nCount = pImpl->pFactArr->Count(); - for (USHORT nFactory=0; nFactory<nCount; ++nFactory) + sal_uInt16 nCount = pImpl->pFactArr->Count(); + for (sal_uInt16 nFactory=0; nFactory<nCount; ++nFactory) { SfxChildWinFactory *pF = (*pImpl->pFactArr)[nFactory]; if ( nId == pF->nId ) @@ -247,7 +247,7 @@ void SfxModule::RegisterToolBoxControl( SfxTbxCtrlFactory *pFact ) pImpl->pTbxCtrlFac = new SfxTbxCtrlFactArr_Impl; #ifdef DBG_UTIL - for ( USHORT n=0; n<pImpl->pTbxCtrlFac->Count(); n++ ) + for ( sal_uInt16 n=0; n<pImpl->pTbxCtrlFac->Count(); n++ ) { SfxTbxCtrlFactory *pF = (*pImpl->pTbxCtrlFac)[n]; if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId && @@ -269,7 +269,7 @@ void SfxModule::RegisterStatusBarControl( SfxStbCtrlFactory *pFact ) pImpl->pStbCtrlFac = new SfxStbCtrlFactArr_Impl; #ifdef DBG_UTIL - for ( USHORT n=0; n<pImpl->pStbCtrlFac->Count(); n++ ) + for ( sal_uInt16 n=0; n<pImpl->pStbCtrlFac->Count(); n++ ) { SfxStbCtrlFactory *pF = (*pImpl->pStbCtrlFac)[n]; if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId && @@ -291,7 +291,7 @@ void SfxModule::RegisterMenuControl( SfxMenuCtrlFactory *pFact ) pImpl->pMenuCtrlFac = new SfxMenuCtrlFactArr_Impl; #ifdef DBG_UTIL - for ( USHORT n=0; n<pImpl->pMenuCtrlFac->Count(); n++ ) + for ( sal_uInt16 n=0; n<pImpl->pMenuCtrlFac->Count(); n++ ) { SfxMenuCtrlFactory *pF = (*pImpl->pMenuCtrlFac)[n]; if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId && @@ -333,12 +333,12 @@ SfxChildWinFactArr_Impl* SfxModule::GetChildWinFactories_Impl() const return pImpl->pFactArr; } -ImageList* SfxModule::GetImageList_Impl( BOOL bBig ) +ImageList* SfxModule::GetImageList_Impl( sal_Bool bBig ) { return pImpl->GetImageList( pResMgr, bBig ); } -SfxTabPage* SfxModule::CreateTabPage( USHORT, Window*, const SfxItemSet& ) +SfxTabPage* SfxModule::CreateTabPage( sal_uInt16, Window*, const SfxItemSet& ) { return NULL; } @@ -355,7 +355,7 @@ void SfxModule::DestroyModules_Impl() if ( pModules ) { SfxModuleArr_Impl& rModules = *pModules; - for( USHORT nPos = rModules.Count(); nPos--; ) + for( sal_uInt16 nPos = rModules.Count(); nPos--; ) { SfxModule* pMod = rModules.GetObject(nPos); delete pMod; @@ -363,22 +363,22 @@ void SfxModule::DestroyModules_Impl() } } -void SfxModule::Invalidate( USHORT nId ) +void SfxModule::Invalidate( sal_uInt16 nId ) { for( SfxViewFrame* pFrame = SfxViewFrame::GetFirst(); pFrame; pFrame = SfxViewFrame::GetNext( *pFrame ) ) if ( pFrame->GetObjectShell()->GetModule() == this ) Invalidate_Impl( pFrame->GetBindings(), nId ); } -BOOL SfxModule::IsActive() const +sal_Bool SfxModule::IsActive() const { SfxViewFrame* pFrame = SfxViewFrame::Current(); if ( pFrame && pFrame->GetObjectShell()->GetFactory().GetModule() == this ) - return TRUE; - return FALSE; + return sal_True; + return sal_False; } -bool SfxModule::IsChildWindowAvailable( const USHORT i_nId, const SfxViewFrame* i_pViewFrame ) const +bool SfxModule::IsChildWindowAvailable( const sal_uInt16 i_nId, const SfxViewFrame* i_pViewFrame ) const { if ( i_nId != SID_TASKPANE ) // by default, assume it is diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 17f0087109f4..605b674e23ab 100644..100755 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -31,16 +31,16 @@ #include "newhelp.hxx" #include <sfx2/sfxuno.hxx> -#include "sfxresid.hxx" +#include "sfx2/sfxresid.hxx" #include "helpinterceptor.hxx" #include "helper.hxx" #include <sfx2/msgpool.hxx> #include <sfx2/app.hxx> #include "sfxtypes.hxx" #include "panelist.hxx" -#include "imgmgr.hxx" +#include "sfx2/imgmgr.hxx" #include "srchdlg.hxx" -#include "sfxhelp.hxx" +#include "sfx2/sfxhelp.hxx" #include "app.hrc" #include "newhelp.hrc" @@ -182,7 +182,7 @@ namespace sfx2 { //......................................................................... - void HandleTaskPaneList( Window* pWindow, BOOL bAddToList ) + void HandleTaskPaneList( Window* pWindow, sal_Bool bAddToList ) { Window* pParent = pWindow->GetParent(); DBG_ASSERT( pParent, "HandleTaskPaneList(): every window here should have a parent" ); @@ -224,7 +224,7 @@ namespace sfx2 { nStartPos = aBoundary.endPos; String sSearchToken( rSearchString.Copy( - (USHORT)aBoundary.startPos, (USHORT)aBoundary.endPos - (USHORT)aBoundary.startPos ) ); + (sal_uInt16)aBoundary.startPos, (sal_uInt16)aBoundary.endPos - (sal_uInt16)aBoundary.startPos ) ); if ( sSearchToken.Len() > 0 && ( sSearchToken.Len() > 1 || sSearchToken.GetChar(0) != '.' ) ) { if ( bForSearch && sSearchToken.GetChar( sSearchToken.Len() - 1 ) != '*' ) @@ -266,7 +266,7 @@ struct IndexEntry_Impl }; #define NEW_ENTRY( url, bool ) \ - (void*)(ULONG)( new IndexEntry_Impl( url, bool ) ) + (void*)(sal_uIntPtr)( new IndexEntry_Impl( url, bool ) ) // struct ContentEntry_Impl ---------------------------------------------- @@ -290,7 +290,7 @@ ContentListBox_Impl::ContentListBox_Impl( Window* pParent, const ResId& rResId ) aDocumentImage ( SfxResId( IMG_HELP_CONTENT_DOC ) ) { - SetWindowBits( WB_HIDESELECTION | WB_HSCROLL ); + SetStyle( GetStyle() | WB_HIDESELECTION | WB_HSCROLL ); SetEntryHeight( 16 ); SetSelectionMode( SINGLE_SELECTION ); @@ -307,7 +307,7 @@ ContentListBox_Impl::ContentListBox_Impl( Window* pParent, const ResId& rResId ) ContentListBox_Impl::~ContentListBox_Impl() { - USHORT nPos = 0; + sal_uInt16 nPos = 0; SvLBoxEntry* pEntry = GetEntry( nPos++ ); while ( pEntry ) { @@ -327,7 +327,7 @@ void ContentListBox_Impl::InitRoot() SfxContentHelper::GetHelpTreeViewContents( aHelpTreeviewURL ); const ::rtl::OUString* pEntries = aList.getConstArray(); - UINT32 i, nCount = aList.getLength(); + sal_uInt32 i, nCount = aList.getLength(); for ( i = 0; i < nCount; ++i ) { String aRow( pEntries[i] ); @@ -337,7 +337,7 @@ void ContentListBox_Impl::InitRoot() aURL = aRow.GetToken( 0, '\t', nIdx ); sal_Unicode cFolder = aRow.GetToken( 0, '\t', nIdx ).GetChar(0); sal_Bool bIsFolder = ( '1' == cFolder ); - SvLBoxEntry* pEntry = InsertEntry( aTitle, aOpenBookImage, aClosedBookImage, NULL, TRUE ); + SvLBoxEntry* pEntry = InsertEntry( aTitle, aOpenBookImage, aClosedBookImage, NULL, sal_True ); if ( bIsFolder ) pEntry->SetUserData( new ContentEntry_Impl( aURL, sal_True ) ); } @@ -372,7 +372,7 @@ void ContentListBox_Impl::RequestingChilds( SvLBoxEntry* pParent ) SfxContentHelper::GetHelpTreeViewContents( aTmpURL ); const ::rtl::OUString* pEntries = aList.getConstArray(); - UINT32 i, nCount = aList.getLength(); + sal_uInt32 i, nCount = aList.getLength(); for ( i = 0; i < nCount; ++i ) { String aRow( pEntries[i] ); @@ -385,7 +385,7 @@ void ContentListBox_Impl::RequestingChilds( SvLBoxEntry* pParent ) SvLBoxEntry* pEntry = NULL; if ( bIsFolder ) { - pEntry = InsertEntry( aTitle, aOpenBookImage, aClosedBookImage, pParent, TRUE ); + pEntry = InsertEntry( aTitle, aOpenBookImage, aClosedBookImage, pParent, sal_True ); pEntry->SetUserData( new ContentEntry_Impl( aURL, sal_True ) ); } else @@ -490,15 +490,15 @@ IndexBox_Impl::IndexBox_Impl( Window* pParent, const ResId& rResId ) : ComboBox( pParent, rResId ) { - EnableAutocomplete( TRUE ); - EnableUserDraw( TRUE ); + EnableAutocomplete( sal_True ); + EnableUserDraw( sal_True ); } // ----------------------------------------------------------------------- void IndexBox_Impl::UserDraw( const UserDrawEvent& rUDEvt ) { - IndexEntry_Impl* pEntry = (IndexEntry_Impl*)(ULONG)GetEntryData( rUDEvt.GetItemId() ); + IndexEntry_Impl* pEntry = (IndexEntry_Impl*)(sal_uIntPtr)GetEntryData( rUDEvt.GetItemId() ); if ( pEntry && pEntry->m_bSubEntry ) { // indent sub entries @@ -506,11 +506,11 @@ void IndexBox_Impl::UserDraw( const UserDrawEvent& rUDEvt ) aPos.X() += 8; aPos.Y() += ( rUDEvt.GetRect().GetHeight() - rUDEvt.GetDevice()->GetTextHeight() ) / 2; String aEntry( GetEntry( rUDEvt.GetItemId() ) ); - USHORT nPos = aEntry.Search( ';' ); + sal_uInt16 nPos = aEntry.Search( ';' ); rUDEvt.GetDevice()->DrawText( aPos, ( nPos != STRING_NOTFOUND ) ? aEntry.Copy( nPos + 1 ) : aEntry ); } else - DrawEntry( rUDEvt, FALSE, TRUE, TRUE ); + DrawEntry( rUDEvt, sal_False, sal_True, sal_True ); } // ----------------------------------------------------------------------- @@ -532,16 +532,16 @@ long IndexBox_Impl::Notify( NotifyEvent& rNEvt ) void IndexBox_Impl::SelectExecutableEntry() { - USHORT nPos = GetEntryPos( GetText() ); + sal_uInt16 nPos = GetEntryPos( GetText() ); if ( nPos != COMBOBOX_ENTRY_NOTFOUND ) { - USHORT nOldPos = nPos; + sal_uInt16 nOldPos = nPos; String aEntryText; - IndexEntry_Impl* pEntry = (IndexEntry_Impl*)(ULONG)GetEntryData( nPos ); - USHORT nCount = GetEntryCount(); + IndexEntry_Impl* pEntry = (IndexEntry_Impl*)(sal_uIntPtr)GetEntryData( nPos ); + sal_uInt16 nCount = GetEntryCount(); while ( nPos < nCount && ( !pEntry || pEntry->m_aURL.Len() == 0 ) ) { - pEntry = (IndexEntry_Impl*)(ULONG)GetEntryData( ++nPos ); + pEntry = (IndexEntry_Impl*)(sal_uIntPtr)GetEntryData( ++nPos ); aEntryText = GetEntry( nPos ); } @@ -635,7 +635,7 @@ void IndexTabPage_Impl::InitializeIndex() append[k] = sal_Unicode( ' ' ); sfx2::KeywordInfo aInfo; - aIndexCB.SetUpdateMode( FALSE ); + aIndexCB.SetUpdateMode( sal_False ); try { @@ -669,7 +669,7 @@ void IndexTabPage_Impl::InitializeIndex() ( aAnySeq[2] >>= aAnchorRefList ) && ( aAnySeq[3] >>= aTitleRefList ) ) { sal_Bool insert; - USHORT nPos; + sal_uInt16 nPos; int ndx,tmp; ::rtl::OUString aIndex, aTempString; ::rtl::OUStringBuffer aData( 128 ); // Capacity of up to 128 characters @@ -735,7 +735,7 @@ void IndexTabPage_Impl::InitializeIndex() OSL_FAIL( "IndexTabPage_Impl::InitializeIndex(): unexpected exception" ); } - aIndexCB.SetUpdateMode( TRUE ); + aIndexCB.SetUpdateMode( sal_True ); if ( sKeyword.Len() > 0 ) aKeywordLink.Call( this ); @@ -748,9 +748,9 @@ void IndexTabPage_Impl::InitializeIndex() void IndexTabPage_Impl::ClearIndex() { - USHORT nCount = aIndexCB.GetEntryCount(); - for ( USHORT i = 0; i < nCount; ++i ) - delete (IndexEntry_Impl*)(ULONG)aIndexCB.GetEntryData(i); + sal_uInt16 nCount = aIndexCB.GetEntryCount(); + for ( sal_uInt16 i = 0; i < nCount; ++i ) + delete (IndexEntry_Impl*)(sal_uIntPtr)aIndexCB.GetEntryData(i); aIndexCB.Clear(); } @@ -859,7 +859,7 @@ void IndexTabPage_Impl::SetFactory( const String& rFactory ) String IndexTabPage_Impl::GetSelectEntry() const { String aRet; - IndexEntry_Impl* pEntry = (IndexEntry_Impl*)(ULONG)aIndexCB.GetEntryData( aIndexCB.GetEntryPos( aIndexCB.GetText() ) ); + IndexEntry_Impl* pEntry = (IndexEntry_Impl*)(sal_uIntPtr)aIndexCB.GetEntryData( aIndexCB.GetEntryPos( aIndexCB.GetText() ) ); if ( pEntry ) aRet = pEntry->m_aURL; return aRet; @@ -884,7 +884,7 @@ sal_Bool IndexTabPage_Impl::HasKeyword() const sal_Bool bRet = sal_False; if ( sKeyword.Len() > 0 ) { - USHORT nPos = aIndexCB.GetEntryPos( sKeyword ); + sal_uInt16 nPos = aIndexCB.GetEntryPos( sKeyword ); bRet = ( nPos != LISTBOX_ENTRY_NOTFOUND ); } @@ -898,10 +898,10 @@ sal_Bool IndexTabPage_Impl::HasKeywordIgnoreCase() sal_Bool bRet = sal_False; if ( sKeyword.Len() > 0 ) { - USHORT nEntries = aIndexCB.GetEntryCount(); + sal_uInt16 nEntries = aIndexCB.GetEntryCount(); String sIndexItem; const vcl::I18nHelper& rI18nHelper = GetSettings().GetLocaleI18nHelper(); - for ( USHORT n = 0; n < nEntries; n++) + for ( sal_uInt16 n = 0; n < nEntries; n++) { sIndexItem = aIndexCB.GetEntry( n ); if (rI18nHelper.MatchString( sIndexItem, sKeyword )) @@ -1001,12 +1001,12 @@ SearchTabPage_Impl::SearchTabPage_Impl( Window* pParent, SfxHelpIndexWindow_Impl if ( aUserItem >>= aTemp ) { aUserData = String( aTemp ); - BOOL bChecked = ( 1 == aUserData.GetToken(0).ToInt32() ) ? TRUE : FALSE; + sal_Bool bChecked = ( 1 == aUserData.GetToken(0).ToInt32() ) ? sal_True : sal_False; aFullWordsCB.Check( bChecked ); - bChecked = ( 1 == aUserData.GetToken(1).ToInt32() ) ? TRUE : FALSE; + bChecked = ( 1 == aUserData.GetToken(1).ToInt32() ) ? sal_True : sal_False; aScopeCB.Check( bChecked ); - for ( USHORT i = 2; i < aUserData.GetTokenCount(); ++i ) + for ( sal_uInt16 i = 2; i < aUserData.GetTokenCount(); ++i ) { String aToken = aUserData.GetToken(i); aSearchED.InsertEntry( INetURLObject::decode( @@ -1029,9 +1029,9 @@ SearchTabPage_Impl::~SearchTabPage_Impl() nChecked = aScopeCB.IsChecked() ? 1 : 0; aUserData += String::CreateFromInt32( nChecked ); aUserData += ';'; - USHORT nCount = Min( aSearchED.GetEntryCount(), (USHORT)10 ); // save only 10 entries + sal_uInt16 nCount = Min( aSearchED.GetEntryCount(), (sal_uInt16)10 ); // save only 10 entries - for ( USHORT i = 0; i < nCount; ++i ) + for ( sal_uInt16 i = 0; i < nCount; ++i ) { rtl::OUString aText = aSearchED.GetEntry(i); aUserData += String(INetURLObject::encode( @@ -1049,9 +1049,9 @@ SearchTabPage_Impl::~SearchTabPage_Impl() void SearchTabPage_Impl::ClearSearchResults() { - USHORT nCount = aResultsLB.GetEntryCount(); - for ( USHORT i = 0; i < nCount; ++i ) - delete (String*)(ULONG)aResultsLB.GetEntryData(i); + sal_uInt16 nCount = aResultsLB.GetEntryCount(); + for ( sal_uInt16 i = 0; i < nCount; ++i ) + delete (String*)(sal_uIntPtr)aResultsLB.GetEntryData(i); aResultsLB.Clear(); aResultsLB.Update(); } @@ -1060,7 +1060,7 @@ void SearchTabPage_Impl::ClearSearchResults() void SearchTabPage_Impl::RememberSearchText( const String& rSearchText ) { - for ( USHORT i = 0; i < aSearchED.GetEntryCount(); ++i ) + for ( sal_uInt16 i = 0; i < aSearchED.GetEntryCount(); ++i ) { if ( rSearchText == aSearchED.GetEntry(i) ) { @@ -1093,7 +1093,7 @@ IMPL_LINK( SearchTabPage_Impl, SearchHdl, PushButton*, EMPTYARG ) aSearchURL += DEFINE_CONST_UNICODE("&Scope=Heading"); Sequence< ::rtl::OUString > aFactories = SfxContentHelper::GetResultSet( aSearchURL ); const ::rtl::OUString* pFacs = aFactories.getConstArray(); - UINT32 i, nCount = aFactories.getLength(); + sal_uInt32 i, nCount = aFactories.getLength(); for ( i = 0; i < nCount; ++i ) { String aRow( pFacs[i] ); @@ -1102,8 +1102,8 @@ IMPL_LINK( SearchTabPage_Impl, SearchHdl, PushButton*, EMPTYARG ) aTitle = aRow.GetToken( 0, '\t', nIdx ); aType = aRow.GetToken( 0, '\t', nIdx ); String* pURL = new String( aRow.GetToken( 0, '\t', nIdx ) ); - USHORT nPos = aResultsLB.InsertEntry( aTitle ); - aResultsLB.SetEntryData( nPos, (void*)(ULONG)pURL ); + sal_uInt16 nPos = aResultsLB.InsertEntry( aTitle ); + aResultsLB.SetEntryData( nPos, (void*)(sal_uIntPtr)pURL ); } LeaveWait(); @@ -1204,7 +1204,7 @@ void SearchTabPage_Impl::SetDoubleClickHdl( const Link& rLink ) String SearchTabPage_Impl::GetSelectEntry() const { String aRet; - String* pData = (String*)(ULONG)aResultsLB.GetEntryData( aResultsLB.GetSelectEntryPos() ); + String* pData = (String*)(sal_uIntPtr)aResultsLB.GetEntryData( aResultsLB.GetSelectEntryPos() ); if ( pData ) aRet = String( *pData ); return aRet; @@ -1272,11 +1272,11 @@ BookmarksBox_Impl::~BookmarksBox_Impl() SvtHistoryOptions aHistOpt; aHistOpt.Clear( eHELPBOOKMARKS ); rtl::OUString sEmpty; - USHORT nCount = GetEntryCount(); - for ( USHORT i = 0; i < nCount; ++i ) + sal_uInt16 nCount = GetEntryCount(); + for ( sal_uInt16 i = 0; i < nCount; ++i ) { String aTitle = GetEntry(i); - String* pURL = (String*)(ULONG)GetEntryData(i); + String* pURL = (String*)(sal_uIntPtr)GetEntryData(i); aHistOpt.AppendItem( eHELPBOOKMARKS, rtl::OUString( *pURL ), sEmpty, rtl::OUString( aTitle ), sEmpty ); delete pURL; } @@ -1284,7 +1284,7 @@ BookmarksBox_Impl::~BookmarksBox_Impl() // ----------------------------------------------------------------------- -void BookmarksBox_Impl::DoAction( USHORT nAction ) +void BookmarksBox_Impl::DoAction( sal_uInt16 nAction ) { switch ( nAction ) { @@ -1294,19 +1294,19 @@ void BookmarksBox_Impl::DoAction( USHORT nAction ) case MID_RENAME : { - USHORT nPos = GetSelectEntryPos(); + sal_uInt16 nPos = GetSelectEntryPos(); if ( nPos != LISTBOX_ENTRY_NOTFOUND ) { SfxAddHelpBookmarkDialog_Impl aDlg( this, sal_True ); aDlg.SetTitle( GetEntry( nPos ) ); if ( aDlg.Execute() == RET_OK ) { - String* pURL = (String*)(ULONG)GetEntryData( nPos ); + String* pURL = (String*)(sal_uIntPtr)GetEntryData( nPos ); RemoveEntry( nPos ); rtl::OUString aImageURL = IMAGE_URL; aImageURL += INetURLObject( *pURL ).GetHost(); nPos = InsertEntry( aDlg.GetTitle(), SvFileInformationManager::GetImage( aImageURL, false ) ); - SetEntryData( nPos, (void*)(ULONG)( new String( *pURL ) ) ); + SetEntryData( nPos, (void*)(sal_uIntPtr)( new String( *pURL ) ) ); SelectEntryPos( nPos ); delete pURL; } @@ -1316,11 +1316,11 @@ void BookmarksBox_Impl::DoAction( USHORT nAction ) case MID_DELETE : { - USHORT nPos = GetSelectEntryPos(); + sal_uInt16 nPos = GetSelectEntryPos(); if ( nPos != LISTBOX_ENTRY_NOTFOUND ) { RemoveEntry( nPos ); - USHORT nCount = GetEntryCount(); + sal_uInt16 nCount = GetEntryCount(); if ( nCount ) { if ( nPos >= nCount ) @@ -1338,10 +1338,10 @@ void BookmarksBox_Impl::DoAction( USHORT nAction ) long BookmarksBox_Impl::Notify( NotifyEvent& rNEvt ) { long nRet = 0; - USHORT nType = rNEvt.GetType(); + sal_uInt16 nType = rNEvt.GetType(); if ( EVENT_KEYINPUT == nType ) { - USHORT nCode = rNEvt.GetKeyEvent()->GetKeyCode().GetCode(); + sal_uInt16 nCode = rNEvt.GetKeyEvent()->GetKeyCode().GetCode(); if ( KEY_DELETE == nCode && GetEntryCount() > 0 ) { DoAction( MID_DELETE ); @@ -1393,7 +1393,7 @@ BookmarksTabPage_Impl::BookmarksTabPage_Impl( Window* pParent, SfxHelpIndexWindo ::rtl::OUString aTitle; ::rtl::OUString aURL; - UINT32 i, nCount = aBookmarkSeq.getLength(); + sal_uInt32 i, nCount = aBookmarkSeq.getLength(); for ( i = 0; i < nCount; ++i ) { GetBookmarkEntry_Impl( aBookmarkSeq[i], aTitle, aURL ); @@ -1466,7 +1466,7 @@ void BookmarksTabPage_Impl::SetDoubleClickHdl( const Link& rLink ) String BookmarksTabPage_Impl::GetSelectEntry() const { String aRet; - String* pData = (String*)(ULONG)aBookmarksBox.GetEntryData( aBookmarksBox.GetSelectEntryPos() ); + String* pData = (String*)(sal_uIntPtr)aBookmarksBox.GetEntryData( aBookmarksBox.GetSelectEntryPos() ); if ( pData ) aRet = String( *pData ); return aRet; @@ -1478,8 +1478,8 @@ void BookmarksTabPage_Impl::AddBookmarks( const String& rTitle, const String& rU { rtl::OUString aImageURL = IMAGE_URL; aImageURL += INetURLObject( rURL ).GetHost(); - USHORT nPos = aBookmarksBox.InsertEntry( rTitle, SvFileInformationManager::GetImage( aImageURL, false ) ); - aBookmarksBox.SetEntryData( nPos, (void*)(ULONG)( new String( rURL ) ) ); + sal_uInt16 nPos = aBookmarksBox.InsertEntry( rTitle, SvFileInformationManager::GetImage( aImageURL, false ) ); + aBookmarksBox.SetEntryData( nPos, (void*)(sal_uIntPtr)( new String( rURL ) ) ); } // class SfxHelpIndexWindow_Impl ----------------------------------------- @@ -1599,7 +1599,7 @@ SfxHelpIndexWindow_Impl::SfxHelpIndexWindow_Impl( SfxHelpWindow_Impl* _pParent ) SvtViewOptions aViewOpt( E_TABDIALOG, CONFIGNAME_INDEXWIN ); if ( aViewOpt.Exists() ) nPageId = aViewOpt.GetPageID(); - aTabCtrl.SetCurPageId( (USHORT)nPageId ); + aTabCtrl.SetCurPageId( (sal_uInt16)nPageId ); ActivatePageHdl( &aTabCtrl ); aActiveLB.SetSelectHdl( LINK( this, SfxHelpIndexWindow_Impl, SelectHdl ) ); nMinWidth = ( aActiveLB.GetSizePixel().Width() / 2 ); @@ -1620,8 +1620,8 @@ SfxHelpIndexWindow_Impl::~SfxHelpIndexWindow_Impl() DELETEZ( pSPage ); DELETEZ( pBPage ); - for ( USHORT i = 0; i < aActiveLB.GetEntryCount(); ++i ) - delete (String*)(ULONG)aActiveLB.GetEntryData(i); + for ( sal_uInt16 i = 0; i < aActiveLB.GetEntryCount(); ++i ) + delete (String*)(sal_uIntPtr)aActiveLB.GetEntryData(i); SvtViewOptions aViewOpt( E_TABDIALOG, CONFIGNAME_INDEXWIN ); aViewOpt.SetPageID( (sal_Int32)aTabCtrl.GetCurPageId() ); @@ -1635,7 +1635,7 @@ void SfxHelpIndexWindow_Impl::Initialize() AppendConfigToken( aHelpURL, sal_True ); Sequence< ::rtl::OUString > aFactories = SfxContentHelper::GetResultSet( aHelpURL ); const ::rtl::OUString* pFacs = aFactories.getConstArray(); - UINT32 i, nCount = aFactories.getLength(); + sal_uInt32 i, nCount = aFactories.getLength(); for ( i = 0; i < nCount; ++i ) { String aRow( pFacs[i] ); @@ -1645,11 +1645,11 @@ void SfxHelpIndexWindow_Impl::Initialize() aType = aRow.GetToken( 0, '\t', nIdx ); aURL = aRow.GetToken( 0, '\t', nIdx ); String* pFactory = new String( INetURLObject( aURL ).GetHost() ); - USHORT nPos = aActiveLB.InsertEntry( aTitle ); - aActiveLB.SetEntryData( nPos, (void*)(ULONG)pFactory ); + sal_uInt16 nPos = aActiveLB.InsertEntry( aTitle ); + aActiveLB.SetEntryData( nPos, (void*)(sal_uIntPtr)pFactory ); } - aActiveLB.SetDropDownLineCount( (USHORT)nCount ); + aActiveLB.SetDropDownLineCount( (sal_uInt16)nCount ); if ( aActiveLB.GetSelectEntryPos() == LISTBOX_ENTRY_NOTFOUND ) SetActiveFactory(); } @@ -1665,9 +1665,9 @@ void SfxHelpIndexWindow_Impl::SetActiveFactory() InitHdl( NULL ); } - for ( USHORT i = 0; i < aActiveLB.GetEntryCount(); ++i ) + for ( sal_uInt16 i = 0; i < aActiveLB.GetEntryCount(); ++i ) { - String* pFactory = (String*)(ULONG)aActiveLB.GetEntryData(i); + String* pFactory = (String*)(sal_uIntPtr)aActiveLB.GetEntryData(i); pFactory->ToLowerAscii(); if ( *pFactory == pIPage->GetFactory() ) { @@ -1683,7 +1683,7 @@ void SfxHelpIndexWindow_Impl::SetActiveFactory() // ----------------------------------------------------------------------- -HelpTabPage_Impl* SfxHelpIndexWindow_Impl::GetCurrentPage( USHORT& rCurId ) +HelpTabPage_Impl* SfxHelpIndexWindow_Impl::GetCurrentPage( sal_uInt16& rCurId ) { rCurId = aTabCtrl.GetCurPageId(); HelpTabPage_Impl* pPage = NULL; @@ -1723,7 +1723,7 @@ HelpTabPage_Impl* SfxHelpIndexWindow_Impl::GetCurrentPage( USHORT& rCurId ) IMPL_LINK( SfxHelpIndexWindow_Impl, ActivatePageHdl, TabControl *, pTabCtrl ) { - USHORT nId = 0; + sal_uInt16 nId = 0; TabPage* pPage = GetCurrentPage( nId ); pTabCtrl->SetTabPage( nId, pPage ); return 0; @@ -1756,7 +1756,7 @@ IMPL_LINK( SfxHelpIndexWindow_Impl, InitHdl, Timer *, EMPTYARG ) IMPL_LINK( SfxHelpIndexWindow_Impl, SelectFactoryHdl, Timer *, EMPTYARG ) { - String* pFactory = (String*)(ULONG)aActiveLB.GetEntryData( aActiveLB.GetSelectEntryPos() ); + String* pFactory = (String*)(sal_uIntPtr)aActiveLB.GetEntryData( aActiveLB.GetSelectEntryPos() ); if ( pFactory ) { String aFactory( *pFactory ); @@ -1778,7 +1778,7 @@ IMPL_LINK( SfxHelpIndexWindow_Impl, KeywordHdl, IndexTabPage_Impl *, EMPTYARG ) if( !bIndex) bIndex = pIPage->HasKeywordIgnoreCase(); // then set index or search page as current. - USHORT nPageId = ( bIndex ) ? HELP_INDEX_PAGE_INDEX : HELP_INDEX_PAGE_SEARCH; + sal_uInt16 nPageId = ( bIndex ) ? HELP_INDEX_PAGE_INDEX : HELP_INDEX_PAGE_SEARCH; if ( nPageId != aTabCtrl.GetCurPageId() ) { aTabCtrl.SetCurPageId( nPageId ); @@ -1822,20 +1822,20 @@ void SfxHelpIndexWindow_Impl::Resize() long SfxHelpIndexWindow_Impl::PreNotify( NotifyEvent& rNEvt ) { long nDone = 0; - USHORT nType = rNEvt.GetType(); + sal_uInt16 nType = rNEvt.GetType(); if ( EVENT_KEYINPUT == nType && rNEvt.GetKeyEvent() ) { const KeyCode& rKeyCode = rNEvt.GetKeyEvent()->GetKeyCode(); - USHORT nCode = rKeyCode.GetCode(); + sal_uInt16 nCode = rKeyCode.GetCode(); if ( KEY_TAB == nCode ) { // don't exit index pane with <TAB> - USHORT nPageId = 0; + sal_uInt16 nPageId = 0; HelpTabPage_Impl* pCurPage = GetCurrentPage( nPageId ); Control* pControl = pCurPage->GetLastFocusControl(); - BOOL bShift = rKeyCode.IsShift(); - BOOL bCtrl = rKeyCode.IsMod1(); + sal_Bool bShift = rKeyCode.IsShift(); + sal_Bool bCtrl = rKeyCode.IsMod1(); if ( !bCtrl && bShift && aActiveLB.HasChildPathFocus() ) { pControl->GrabFocus(); @@ -1853,7 +1853,7 @@ long SfxHelpIndexWindow_Impl::PreNotify( NotifyEvent& rNEvt ) nPageId++; else nPageId = HELP_INDEX_PAGE_FIRST; - aTabCtrl.SetCurPageId( (USHORT)nPageId ); + aTabCtrl.SetCurPageId( (sal_uInt16)nPageId ); ActivatePageHdl( &aTabCtrl ); nDone = 1; } @@ -1951,9 +1951,9 @@ void SfxHelpIndexWindow_Impl::AddBookmarks( const String& rTitle, const String& bool SfxHelpIndexWindow_Impl::IsValidFactory( const String& _rFactory ) { bool bValid = false; - for ( USHORT i = 0; i < aActiveLB.GetEntryCount(); ++i ) + for ( sal_uInt16 i = 0; i < aActiveLB.GetEntryCount(); ++i ) { - String* pFactory = (String*)(ULONG)aActiveLB.GetEntryData(i); + String* pFactory = (String*)(sal_uIntPtr)aActiveLB.GetEntryData(i); if ( *pFactory == _rFactory ) { bValid = true; @@ -2126,7 +2126,7 @@ SfxHelpTextWindow_Impl::SfxHelpTextWindow_Impl( SfxHelpWindow_Impl* pParent ) : SvtMiscOptions().AddListenerLink( LINK( this, SfxHelpTextWindow_Impl, NotifyHdl ) ); - if ( aOnStartupCB.GetHelpId() == 0 ) + if ( !aOnStartupCB.GetHelpId().getLength() ) aOnStartupCB.SetHelpId( HID_HELP_ONSTARTUP_BOX ); } @@ -2216,7 +2216,7 @@ void SfxHelpTextWindow_Impl::InitOnStartupBox( bool bOnlyText ) // Attention: This check boy knows two states: // 1) Reading of the config key fails with an exception or by getting an empty Any (!) => check box must be hidden - // 2) We read TRUE/FALSE => check box must be shown and enabled/disabled + // 2) We read sal_True/sal_False => check box must be shown and enabled/disabled bool bHideBox = true; sal_Bool bHelpAtStartup = sal_False; @@ -2353,7 +2353,7 @@ Reference< XTextRange > SfxHelpTextWindow_Impl::getCursor() const bool SfxHelpTextWindow_Impl::isHandledKey( const KeyCode& _rKeyCode ) { bool bRet = false; - USHORT nCode = _rKeyCode.GetCode(); + sal_uInt16 nCode = _rKeyCode.GetCode(); // the keys <STRG><A> (select all), <STRG><C> (copy), // <STRG><F> (find), <STRG><P> (print) and <STRG><W> (close window) @@ -2562,7 +2562,7 @@ void SfxHelpTextWindow_Impl::Resize() long SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& rNEvt ) { long nDone = 0; - USHORT nType = rNEvt.GetType(); + sal_uInt16 nType = rNEvt.GetType(); if ( EVENT_COMMAND == nType && rNEvt.GetCommandEvent() ) { const CommandEvent* pCmdEvt = rNEvt.GetCommandEvent(); @@ -2640,8 +2640,8 @@ long SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& rNEvt ) aMenu.InsertItem( TBI_COPY, String( SfxResId( STR_HELP_MENU_TEXT_COPY ) ), Image( SfxResId( IMG_HELP_TOOLBOX_COPY ) ) - ); - aMenu.SetHelpId( TBI_COPY, SID_COPY ); + ); + aMenu.SetHelpId( TBI_COPY, ".uno:Copy" ); aMenu.EnableItem( TBI_COPY, HasSelection() ); if ( bIsDebug ) @@ -2653,7 +2653,7 @@ long SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& rNEvt ) if( SvtMenuOptions().IsEntryHidingEnabled() == sal_False ) aMenu.SetMenuFlags( aMenu.GetMenuFlags() | MENU_FLAG_HIDEDISABLEDENTRIES ); - USHORT nId = aMenu.Execute( this, aPos ); + sal_uInt16 nId = aMenu.Execute( this, aPos ); pHelpWin->DoAction( nId ); nDone = 1; } @@ -2662,8 +2662,8 @@ long SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& rNEvt ) { const KeyEvent* pKEvt = rNEvt.GetKeyEvent(); const KeyCode& rKeyCode = pKEvt->GetKeyCode(); - USHORT nKeyGroup = rKeyCode.GetGroup(); - USHORT nKey = rKeyCode.GetCode(); + sal_uInt16 nKeyGroup = rKeyCode.GetGroup(); + sal_uInt16 nKey = rKeyCode.GetCode(); if ( KEYGROUP_ALPHA == nKeyGroup && !isHandledKey( rKeyCode ) ) { // do nothing disables the writer accelerators @@ -2869,23 +2869,23 @@ void SfxHelpWindow_Impl::Split() nIndexSize = GetItemSize( INDEXWIN_ID ); nTextSize = GetItemSize( TEXTWIN_ID ); - BOOL bMod = FALSE; + sal_Bool bMod = sal_False; if( nIndexSize < nMinSplitSize ) { nIndexSize = nMinSplitSize; nTextSize = nMaxSplitSize; - bMod = TRUE; + bMod = sal_True; } else if( nTextSize < nMinSplitSize ) { nTextSize = nMinSplitSize; nIndexSize = nMaxSplitSize; - bMod = TRUE; + bMod = sal_True; } else - bMod = FALSE; + bMod = sal_False; if( bMod ) { @@ -2991,7 +2991,7 @@ void SfxHelpWindow_Impl::LoadConfig() { aUserData = String( aTemp ); DBG_ASSERT( aUserData.GetTokenCount() == 6, "invalid user data" ); - USHORT nIdx = 0; + sal_uInt16 nIdx = 0; nIndexSize = aUserData.GetToken( 0, ';', nIdx ).ToInt32(); nTextSize = aUserData.GetToken( 0, ';', nIdx ).ToInt32(); sal_Int32 nWidth = aUserData.GetToken( 0, ';', nIdx ).ToInt32(); @@ -3083,7 +3083,7 @@ IMPL_LINK( SfxHelpWindow_Impl, OpenHdl, SfxHelpIndexWindow_Impl* , EMPTYARG ) ::rtl::OUString sHelpURL; - BOOL bComplete = rtl::OUString(aEntry).toAsciiLowerCase().match(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.help")),0); + bool bComplete = rtl::OUString(aEntry).toAsciiLowerCase().match(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.help")),0); if (bComplete) sHelpURL = ::rtl::OUString(aEntry); @@ -3175,7 +3175,7 @@ void SfxHelpWindow_Impl::openDone(const ::rtl::OUString& sURL , xViewProps->setPropertyValue( DEFINE_CONST_OUSTRING("PreventHelpTips"), aBoolAny ); xViewProps->setPropertyValue( DEFINE_CONST_OUSTRING("ShowGraphics"), aBoolAny ); xViewProps->setPropertyValue( DEFINE_CONST_OUSTRING("ShowTables"), aBoolAny ); - xViewProps->setPropertyValue( DEFINE_CONST_OUSTRING("HelpURL"), makeAny( DEFINE_CONST_OUSTRING("HID:68245") ) ); + xViewProps->setPropertyValue( DEFINE_CONST_OUSTRING("HelpURL"), makeAny( DEFINE_CONST_OUSTRING("HID:SFX2_HID_HELP_ONHELP") ) ); ::rtl::OUString sProperty( DEFINE_CONST_OUSTRING("IsExecuteHyperlinks") ); if ( xInfo->hasPropertyByName( sProperty ) ) xViewProps->setPropertyValue( sProperty, aBoolAny ); @@ -3261,7 +3261,7 @@ long SfxHelpWindow_Impl::PreNotify( NotifyEvent& rNEvt ) { // Backward == <ALT><LEFT> or <BACKSPACE> Forward == <ALT><RIGHT> const KeyCode& rKeyCode = rNEvt.GetKeyEvent()->GetKeyCode(); - USHORT nKey = rKeyCode.GetCode(); + sal_uInt16 nKey = rKeyCode.GetCode(); if ( ( rKeyCode.IsMod2() && ( KEY_LEFT == nKey || KEY_RIGHT == nKey ) ) || ( !rKeyCode.GetModifier() && KEY_BACKSPACE == nKey && !pIndexWin->HasFocusOnEdit() ) ) { @@ -3304,7 +3304,7 @@ void SfxHelpWindow_Impl::SetHelpURL( const String& rURL ) // ----------------------------------------------------------------------- -void SfxHelpWindow_Impl::DoAction( USHORT nActionId ) +void SfxHelpWindow_Impl::DoAction( sal_uInt16 nActionId ) { switch ( nActionId ) { diff --git a/sfx2/source/appl/newhelp.hrc b/sfx2/source/appl/newhelp.hrc index 7bb9aa85678c..7bb9aa85678c 100644..100755 --- a/sfx2/source/appl/newhelp.hrc +++ b/sfx2/source/appl/newhelp.hrc diff --git a/sfx2/source/appl/newhelp.hxx b/sfx2/source/appl/newhelp.hxx index 7c9bd4c90c46..ff983671fa8e 100644..100755 --- a/sfx2/source/appl/newhelp.hxx +++ b/sfx2/source/appl/newhelp.hxx @@ -65,7 +65,7 @@ private: String m_sURL; public: - OpenStatusListener_Impl() : m_bFinished( FALSE ), m_bSuccess( FALSE ) {} + OpenStatusListener_Impl() : m_bFinished( sal_False ), m_bSuccess( sal_False ) {} virtual void SAL_CALL dispatchFinished( const ::com::sun::star::frame::DispatchResultEvent& Event ) throw(::com::sun::star::uno::RuntimeException); virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException); @@ -268,7 +268,7 @@ public: class BookmarksBox_Impl : public ListBox { private: - void DoAction( USHORT nAction ); + void DoAction( sal_uInt16 nAction ); public: BookmarksBox_Impl( Window* pParent, const ResId& rResId ); @@ -332,7 +332,7 @@ private: void Initialize(); void SetActiveFactory(); - HelpTabPage_Impl* GetCurrentPage( USHORT& rCurId ); + HelpTabPage_Impl* GetCurrentPage( sal_uInt16& rCurId ); inline ContentTabPage_Impl* GetContentPage(); inline IndexTabPage_Impl* GetIndexPage(); @@ -567,7 +567,7 @@ public: void SetFactory( const String& rFactory ); void SetHelpURL( const String& rURL ); - void DoAction( USHORT nActionId ); + void DoAction( sal_uInt16 nActionId ); void CloseWindow(); void UpdateToolbox(); diff --git a/sfx2/source/appl/newhelp.src b/sfx2/source/appl/newhelp.src index c59eb50b193b..da59e0a35f07 100644..100755 --- a/sfx2/source/appl/newhelp.src +++ b/sfx2/source/appl/newhelp.src @@ -93,12 +93,14 @@ TabPage TP_HELP_INDEX }; ComboBox CB_INDEX { + HelpID = "sfx2:ComboBox:TP_HELP_INDEX:CB_INDEX"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 17 ) ; Size = MAP_APPFONT ( 108 , 97 ) ; }; PushButton PB_OPEN_INDEX { + HelpID = "sfx2:PushButton:TP_HELP_INDEX:PB_OPEN_INDEX"; Pos = MAP_APPFONT ( 64 , 115 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Display" ; @@ -119,6 +121,7 @@ TabPage TP_HELP_SEARCH }; ComboBox ED_SEARCH { + HelpID = "sfx2:ComboBox:TP_HELP_SEARCH:ED_SEARCH"; Border = TRUE ; DropDown = TRUE; Pos = MAP_APPFONT ( 6 , 17 ) ; @@ -126,30 +129,35 @@ TabPage TP_HELP_SEARCH }; PushButton PB_SEARCH { + HelpID = "sfx2:PushButton:TP_HELP_SEARCH:PB_SEARCH"; Pos = MAP_APPFONT ( 101 , 17 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Find"; }; CheckBox CB_FULLWORDS { + HelpID = "sfx2:CheckBox:TP_HELP_SEARCH:CB_FULLWORDS"; Pos = MAP_APPFONT ( 6, 34 ) ; Size = MAP_APPFONT ( 128 , 10 ) ; Text [ en-US ] = "~Complete words only"; }; CheckBox CB_SCOPE { + HelpID = "sfx2:CheckBox:TP_HELP_SEARCH:CB_SCOPE"; Pos = MAP_APPFONT ( 6, 47 ) ; Size = MAP_APPFONT ( 128 , 10 ) ; Text [ en-US ] = "Find in ~headings only"; }; ListBox LB_RESULT { + HelpID = "sfx2:ListBox:TP_HELP_SEARCH:LB_RESULT"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 60 ) ; Size = MAP_APPFONT ( 128 , 30 ) ; }; PushButton PB_OPEN_SEARCH { + HelpID = "sfx2:PushButton:TP_HELP_SEARCH:PB_OPEN_SEARCH"; Pos = MAP_APPFONT ( 84 , 182 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Display" ; @@ -170,6 +178,7 @@ TabPage TP_HELP_BOOKMARKS }; ListBox LB_BOOKMARKS { + HelpID = "sfx2:ListBox:TP_HELP_BOOKMARKS:LB_BOOKMARKS"; Border = TRUE ; Sort = TRUE; Pos = MAP_APPFONT ( 6 , 19 ) ; @@ -177,6 +186,7 @@ TabPage TP_HELP_BOOKMARKS }; PushButton PB_BOOKMARKS { + HelpID = "sfx2:PushButton:TP_HELP_BOOKMARKS:PB_BOOKMARKS"; Pos = MAP_APPFONT ( 64 , 119 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Display" ; @@ -346,6 +356,7 @@ String STR_HELP_MENU_TEXT_COPY ModalDialog DLG_HELP_ADDBOOKMARK { + HelpID = "sfx2:ModalDialog:DLG_HELP_ADDBOOKMARK"; Size = MAP_APPFONT ( 208 , 43 ) ; Text [ en-US ] = "Add to Bookmarks"; MOVEABLE = TRUE ; @@ -362,6 +373,7 @@ ModalDialog DLG_HELP_ADDBOOKMARK }; Edit ED_BOOKMARK_TITLE { + HelpID = "sfx2:Edit:DLG_HELP_ADDBOOKMARK:ED_BOOKMARK_TITLE"; PosSize = MAP_APPFONT ( 6 , 19 , 140 , 12 ) ; TABSTOP = TRUE ; BORDER = TRUE ; diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx index 1c393a21a40c..0eb111dae184 100644..100755 --- a/sfx2/source/appl/opengrf.cxx +++ b/sfx2/source/appl/opengrf.cxx @@ -55,7 +55,7 @@ #include <unotools/pathoptions.hxx> #include <sfx2/opengrf.hxx> #include "app.hrc" -#include "sfxresid.hxx" +#include "sfx2/sfxresid.hxx" //----------------------------------------------------------------------------- @@ -69,7 +69,7 @@ using namespace ::cppu; //----------------------------------------------------------------------------- -USHORT SvxOpenGrfErr2ResId( short err ) +sal_uInt16 SvxOpenGrfErr2ResId( short err ) { switch( err ) { @@ -119,10 +119,10 @@ SvxOpenGraphicDialog::~SvxOpenGraphicDialog() short SvxOpenGraphicDialog::Execute() { - USHORT nImpRet; - BOOL bQuitLoop(FALSE); + sal_uInt16 nImpRet; + sal_Bool bQuitLoop(sal_False); - while( bQuitLoop == FALSE && + while( bQuitLoop == sal_False && mpImpl->aFileDlg.Execute() == ERRCODE_NONE ) { if( GetPath().Len() ) @@ -132,14 +132,14 @@ short SvxOpenGraphicDialog::Execute() // check whether we can load the graphic String aCurFilter( GetCurrentFilter() ); - USHORT nFormatNum = pFilter->GetImportFormatNumber( aCurFilter ); - USHORT nRetFormat = 0; - USHORT nFound = USHRT_MAX; + sal_uInt16 nFormatNum = pFilter->GetImportFormatNumber( aCurFilter ); + sal_uInt16 nRetFormat = 0; + sal_uInt16 nFound = USHRT_MAX; // non-local? if ( INET_PROT_FILE != aObj.GetProtocol() ) { - SfxMedium aMed( aObj.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ, TRUE ); + SfxMedium aMed( aObj.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ, sal_True ); aMed.DownLoad(); SvStream* pStream = aMed.GetInStream(); @@ -170,7 +170,7 @@ short SvxOpenGraphicDialog::Execute() if ( nFound == USHRT_MAX ) { WarningBox aWarningBox( NULL, WB_3DLOOK | WB_RETRY_CANCEL, String( SfxResId( SvxOpenGrfErr2ResId(nImpRet) ) ) ); - bQuitLoop = aWarningBox.Execute()==RET_RETRY ? FALSE : TRUE; + bQuitLoop = aWarningBox.Execute()==RET_RETRY ? sal_False : sal_True; } else { @@ -285,14 +285,11 @@ void SvxOpenGraphicDialog::SetCurrentFilter(const String& rStr) mpImpl->aFileDlg.SetCurrentFilter(rStr); } -void SvxOpenGraphicDialog::SetControlHelpIds( const INT16* _pControlId, const INT32* _pHelpId ) +void SvxOpenGraphicDialog::SetControlHelpIds( const sal_Int16* _pControlId, const char** _pHelpId ) { mpImpl->aFileDlg.SetControlHelpIds( _pControlId, _pHelpId ); } -void SvxOpenGraphicDialog::SetDialogHelpId( const INT32 _nHelpId ) -{ - mpImpl->aFileDlg.SetDialogHelpId( _nHelpId ); -} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/panelist.hxx b/sfx2/source/appl/panelist.hxx index 83fa3b73b902..e5924071a64e 100644..100755 --- a/sfx2/source/appl/panelist.hxx +++ b/sfx2/source/appl/panelist.hxx @@ -34,17 +34,17 @@ namespace sfx2 { // source in newhelp.cxx - void HandleTaskPaneList( Window* pWindow, BOOL bAddToList ); + void HandleTaskPaneList( Window* pWindow, sal_Bool bAddToList ); // pWindow: just a system window or something which is child of a system window inline void AddToTaskPaneList( Window* pWindowToBeHandled ) { - HandleTaskPaneList( pWindowToBeHandled, TRUE ); + HandleTaskPaneList( pWindowToBeHandled, sal_True ); } inline void RemoveFromTaskPaneList( Window* pWindowToBeHandled ) { - HandleTaskPaneList( pWindowToBeHandled, FALSE ); + HandleTaskPaneList( pWindowToBeHandled, sal_False ); } } diff --git a/sfx2/source/appl/sfx.src b/sfx2/source/appl/sfx.src index 7d4bb0db1726..3bca517c5fd5 100644..100755 --- a/sfx2/source/appl/sfx.src +++ b/sfx2/source/appl/sfx.src @@ -27,107 +27,21 @@ #include <sfx2/sfx.hrc> -String STR_NONAME -{ - Text [ en-US ] = "Untitled" ; -}; - -String STR_NONE -{ - Text [ en-US ] = "- None -" ; -}; - -String STR_CLOSE -{ - Text [ en-US ] = "Close" ; -}; - -String STR_STYLE_FILTER_AUTO -{ - Text [ en-US ] = "Automatic" ; -}; - String STR_STYLE_FILTER_USED { Text [ en-US ] = "Applied Styles" ; }; - - - String STR_STYLE_FILTER_USERDEF { Text [ en-US ] = "Custom Styles" ; }; - String STR_STYLE_FILTER_ALL { Text [ en-US ] = "All Styles" ; }; -String STR_STANDARD -{ - Text [ en-US ] = "Standard" ; -}; -String STR_STANDARD_SHORTCUT -{ - Text [ en-US ] = "Standard" ; -}; - -String STR_SFX_FILTERNAME_ALL -{ - Text [ en-US ] = "All files (*.*)" ; -}; - -String STR_BYTES -{ - Text [ en-US ] = "Bytes" ; -}; - -String STR_KB -{ - Text [ en-US ] = "KB" ; -}; - -String STR_MB -{ - Text [ en-US ] = "MB" ; -}; - - -String STR_GB -{ - Text [ en-US ] = "GB" ; -}; - -String STR_UNDO -{ - Text [ en-US ] = "Undo: " ; -}; - -String STR_REDO -{ - Text [ en-US ] = "Re~do: " ; -}; - -String STR_REPEAT -{ - Text [ en-US ] = "~Repeat: " ; -}; - -String RID_STR_NEW_TASK -{ - Text [ en-US ] = "New task"; -}; -QueryBox MSG_QUERY_LASTVERSION -{ - Buttons = WB_YES_NO ; - DefButton = WB_DEF_NO ; - Message [ en-US ] = "Cancel all changes?" ; -}; - -// i66948 used in project scripting -String STR_ERRUNOEVENTBINDUNG +String STR_ACCTITLE_PRODUCTIVITYTOOLS { - Text [ en-US ] = "An appropriate component method %1\ncould not be found.\n\nCheck spelling of method name."; + Text [ en-US ] = "%PRODUCTNAME"; }; diff --git a/sfx2/source/appl/sfxdll.cxx b/sfx2/source/appl/sfxdll.cxx deleted file mode 100644 index 18951978b426..000000000000 --- a/sfx2/source/appl/sfxdll.cxx +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sfx2.hxx" - -#ifdef WIN -#include <svwin.h> - -// Static DLL Administrative variables -static HINSTANCE hDLLInst = 0; - -//========================================================================== - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ -#ifndef WNT - if ( nHeap ) - UnlockData( 0 ); -#endif - - hDLLInst = hDLL; - - return TRUE; -} - - -//-------------------------------------------------------------------------- - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - - -//========================================================================== - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 237513dba64a..22c4afff1722 100644..100755 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -29,8 +29,9 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" -#include "sfxhelp.hxx" +#include "sfx2/sfxhelp.hxx" +#include <set> #include <algorithm> #include <com/sun/star/uno/Reference.h> #include <com/sun/star/frame/XFrame.hpp> @@ -73,12 +74,15 @@ #include <svl/svstdarr.hxx> #include "newhelp.hxx" -#include "sfxresid.hxx" +#include <sfx2/objsh.hxx> +#include <sfx2/docfac.hxx> +#include "sfx2/sfxresid.hxx" #include "helper.hxx" #include "app.hrc" #include <sfx2/sfxuno.hxx> #include <vcl/svapp.hxx> #include <sfx2/frame.hxx> +#include <rtl/string.hxx> using namespace ::com::sun::star::beans; using namespace ::com::sun::star::frame; @@ -219,13 +223,13 @@ sal_Bool GetHelpAnchor_Impl( const String& _rURL, String& _rAnchor ) class SfxHelpOptions_Impl : public utl::ConfigItem { private: - SvULongsSort* m_pIds; + std::set < rtl::OString > m_aIds; public: SfxHelpOptions_Impl(); ~SfxHelpOptions_Impl(); - BOOL HasId( ULONG nId ) { USHORT nDummy; return m_pIds ? m_pIds->Seek_Entry( nId, &nDummy ) : FALSE; } + bool HasId( const rtl::OString& rId ) { return m_aIds.size() ? m_aIds.find( rId ) != m_aIds.end() : false; } virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ); virtual void Commit(); }; @@ -250,7 +254,6 @@ static Sequence< ::rtl::OUString > GetPropertyNames() SfxHelpOptions_Impl::SfxHelpOptions_Impl() : ConfigItem( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Office.SFX/Help")) ) - , m_pIds( NULL ) { Sequence< ::rtl::OUString > aNames = GetPropertyNames(); Sequence< Any > aValues = GetProperties( aNames ); @@ -271,11 +274,15 @@ SfxHelpOptions_Impl::SfxHelpOptions_Impl() ::rtl::OUString aCodedList; if ( pValues[nProp] >>= aCodedList ) { - String aTmp( aCodedList ); - USHORT nCount = aTmp.GetTokenCount( ',' ); - m_pIds = new SvULongsSort(); - for ( USHORT n=0; n<nCount; n++ ) - m_pIds->Insert( (ULONG) aTmp.GetToken( n, ',' ).ToInt64() ); + rtl::OString aTmp( aCodedList, aCodedList.getLength(), RTL_TEXTENCODING_UTF8 ); + sal_Int32 nIndex = 0; + do + { + rtl::OString aToken = aTmp.getToken( 0, ',', nIndex ); + if ( aToken.getLength() ) + m_aIds.insert( aToken ); + } + while ( nIndex >= 0 ); } else { DBG_ERRORFILE( "Wrong property type!" ); @@ -295,7 +302,6 @@ SfxHelpOptions_Impl::SfxHelpOptions_Impl() SfxHelpOptions_Impl::~SfxHelpOptions_Impl() { - delete m_pIds; } @@ -320,8 +326,7 @@ public: ~SfxHelp_Impl(); SfxHelpOptions_Impl* GetOptions(); - String GetHelpText( ULONG nHelpId, const String& rModule ); // get "Active Help" - String GetHelpText( const rtl::OUString& aCommandURL, const String& rModule ); + static String GetHelpText( const rtl::OUString& aCommandURL, const String& rModule ); sal_Bool HasModule( const ::rtl::OUString& rModule ); // module installed sal_Bool IsHelpInstalled(); // module list not empty }; @@ -364,16 +369,6 @@ void SfxHelp_Impl::Load() } } -String SfxHelp_Impl::GetHelpText( ULONG nHelpId, const String& rModule ) -{ - // create help url - String aHelpURL = SfxHelp::CreateHelpURL( nHelpId, rModule ); - // added 'active' parameter - aHelpURL.Insert( String( DEFINE_CONST_UNICODE("&Active=true") ), aHelpURL.SearchBackward( '#' ) ); - // load help string - return SfxContentHelper::GetActiveHelpString( aHelpURL ); -} - String SfxHelp_Impl::GetHelpText( const rtl::OUString& aCommandURL, const String& rModule ) { // create help url @@ -573,76 +568,6 @@ String SfxHelp::GetHelpModuleName_Impl() return sModuleName; } -String SfxHelp::CreateHelpURL_Impl( ULONG nHelpId, const String& rModuleName ) -{ - String aModuleName( rModuleName ); - if ( aModuleName.Len() == 0 ) - aModuleName = getDefaultModule_Impl(); - - // build up the help URL - String aHelpURL; - if ( aTicket.Len() ) - { - // if there is a ticket, we are inside a plugin, so a special Help URL must be sent - aHelpURL = DEFINE_CONST_UNICODE("vnd.sun.star.cmd:help?"); - aHelpURL += DEFINE_CONST_UNICODE("HELP_Request_Mode=contextIndex&HELP_Session_Mode=context&HELP_CallMode=portal&HELP_Device=html"); - - if ( !nHelpId ) - { - // no help id -> start page - aHelpURL += DEFINE_CONST_UNICODE("&HELP_ContextID=start"); - } - else - { - aHelpURL += DEFINE_CONST_UNICODE("&HELP_ContextID="); - aHelpURL += String::CreateFromInt64( nHelpId ); - } - - aHelpURL += DEFINE_CONST_UNICODE("&HELP_ProgramID="); - aHelpURL += aModuleName; - aHelpURL += DEFINE_CONST_UNICODE("&HELP_User="); - aHelpURL += aUser; - aHelpURL += DEFINE_CONST_UNICODE("&HELP_Ticket="); - aHelpURL += aTicket; - aHelpURL += DEFINE_CONST_UNICODE("&HELP_Language="); - aHelpURL += aLanguageStr; - if ( aCountryStr.Len() ) - { - aHelpURL += DEFINE_CONST_UNICODE("&HELP_Country="); - aHelpURL += aCountryStr; - } - } - else - { - sal_Bool bHasAnchor = sal_False; - String aAnchor; - aHelpURL = String::CreateFromAscii("vnd.sun.star.help://"); - aHelpURL += aModuleName; - - if ( !nHelpId ) - aHelpURL += String::CreateFromAscii("/start"); - else - { - aHelpURL += '/'; - aHelpURL += String::CreateFromInt64( nHelpId ); - - String aTempURL = aHelpURL; - AppendConfigToken( aTempURL, sal_True ); - bHasAnchor = GetHelpAnchor_Impl( aTempURL, aAnchor ); - } - - AppendConfigToken( aHelpURL, sal_True ); - - if ( bHasAnchor ) - { - aHelpURL += '#'; - aHelpURL += aAnchor; - } - } - - return aHelpURL; -} - String SfxHelp::CreateHelpURL_Impl( const String& aCommandURL, const String& rModuleName ) { // build up the help URL @@ -665,7 +590,7 @@ String SfxHelp::CreateHelpURL_Impl( const String& aCommandURL, const String& rM aHelpURL += String( rtl::Uri::encode( aCommandURL, rtl_UriCharClassRelSegment, rtl_UriEncodeKeepEscapes, - RTL_TEXTENCODING_ASCII_US )); + RTL_TEXTENCODING_UTF8 )); String aTempURL = aHelpURL; AppendConfigToken( aTempURL, sal_True ); @@ -733,16 +658,68 @@ SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame >& rHelpTask , return pHelpWindow; } +XubString SfxHelp::GetHelpText( const String& aCommandURL, const Window* pWindow ) +{ + String sModuleName = GetHelpModuleName_Impl(); + String sHelpText = pImp->GetHelpText( aCommandURL, sModuleName ); + + ByteString aNewHelpId; + + if ( pWindow && !sHelpText.Len() ) + { + // no help text found -> try with parent help id. + Window* pParent = pWindow->GetParent(); + while ( pParent ) + { + aNewHelpId = pParent->GetHelpId(); + sHelpText = pImp->GetHelpText( String( aNewHelpId, RTL_TEXTENCODING_UTF8 ), sModuleName ); + if ( sHelpText.Len() > 0 ) + pParent = NULL; + else + pParent = pParent->GetParent(); + } + + if ( bIsDebug && !sHelpText.Len() ) + aNewHelpId.Erase(); + } + + // add some debug information? + if ( bIsDebug ) + { + sHelpText += DEFINE_CONST_UNICODE("\n-------------\n"); + sHelpText += String( sModuleName ); + sHelpText += DEFINE_CONST_UNICODE(": "); + sHelpText += aCommandURL; + if ( aNewHelpId.Len() ) + { + sHelpText += DEFINE_CONST_UNICODE(" - "); + sHelpText += String( aNewHelpId, RTL_TEXTENCODING_UTF8 ); + } + } + + return sHelpText; +} + /// Check for built-in help static bool impl_hasHelpInstalled( const rtl::OUString &rLang = rtl::OUString() ) { String aHelpRootURL( DEFINE_CONST_OUSTRING("vnd.sun.star.help://") ); - AppendConfigToken( aHelpRootURL, sal_True, rLang ); + AppendConfigToken( aHelpRootURL, sal_True ); Sequence< ::rtl::OUString > aFactories = SfxContentHelper::GetResultSet( aHelpRootURL ); return ( aFactories.getLength() != 0 ); } +sal_Bool SfxHelp::SearchKeyword( const XubString& rKeyword ) +{ + return Start_Impl( String(), NULL, rKeyword ); +} + +sal_Bool SfxHelp::Start( const String& rURL, const Window* pWindow ) +{ + return Start_Impl( rURL, pWindow, String() ); +} + /// Redirect the vnd.sun.star.help:// urls to http://help.libreoffice.org static bool impl_showOnlineHelp( const String& rURL ) { @@ -771,69 +748,87 @@ static bool impl_showOnlineHelp( const String& rURL ) return false; } -BOOL SfxHelp::Start( const String& rURL, const Window* pWindow ) +sal_Bool SfxHelp::Start_Impl( const String& rURL, const Window* pWindow, const String& rKeyword ) { - String aHelpURL( rURL ); - INetURLObject aParser( aHelpURL ); + String aHelpRootURL( DEFINE_CONST_OUSTRING("vnd.sun.star.help://") ); + AppendConfigToken( aHelpRootURL, sal_True); + Sequence< ::rtl::OUString > aFactories = SfxContentHelper::GetResultSet( aHelpRootURL ); + + /* rURL may be + - a "real" URL + - a HelpID (formerly a long, now a string) + If rURL is a URL, CreateHelpURL should be called for this URL + If rURL is an arbitrary string, the same should happen, but the URL should be tried out + if it delivers real help content. In case only the Help Error Document is returned, the + parent of the window for that help was called, is asked for its HelpID. + For compatibility reasons this upward search is not implemented for "real" URLs. + Help keyword search now is implemented as own method; in former versions it + was done via Help::Start, but this implementation conflicted with the upward search. + */ + String aHelpURL; + INetURLObject aParser( rURL ); INetProtocol nProtocol = aParser.GetProtocol(); + String aHelpModuleName( GetHelpModuleName_Impl() ); - // check if it's an URL or a jump mark! ::rtl::OUString sKeyword; - if ( nProtocol != INET_PROT_VND_SUN_STAR_HELP ) + switch ( nProtocol ) { - // #i90162 Accept anything that is not invalid as help id, as both - // uno: URLs used as commands/help ids in the Office and the scheme - // used in extension help ids (e.g. com.foocorp.foo-ext:FooDialogButton) - // are accepted as INET_PROT_UNO respectively INET_PROT_GENERIC - bool bAcceptAsURL = ( nProtocol != INET_PROT_NOT_VALID ); - - // #i94891 As in some extensions help ids like foo.bar.dummy without - // any : have been used that worked before the fix of #i90162 (see - // above) strings containing . will be also accepted to avoid brea- - // king the help of existing extensions. - if( !bAcceptAsURL ) - bAcceptAsURL = ( rURL.Search( '.' ) != STRING_NOTFOUND ); - - if ( bAcceptAsURL ) - { - aHelpURL = CreateHelpURL_Impl( rURL, GetHelpModuleName_Impl( ) ); - } - else + case INET_PROT_VND_SUN_STAR_HELP: + // already a vnd.sun.star.help URL -> nothing to do + aHelpURL = rURL; + break; + default: { - aHelpURL = CreateHelpURL_Impl( 0, GetHelpModuleName_Impl( ) ); + // no URL, just a HelpID (maybe empty in case of keyword search) + aHelpURL = CreateHelpURL_Impl( rURL, aHelpModuleName ); // pb i91715: strings begin with ".HelpId:" are not words of the basic ide // they are helpid-strings used by the testtool -> so we ignore them static const String sHelpIdScheme( DEFINE_CONST_OUSTRING(".HelpId:") ); if ( rURL.Search( sHelpIdScheme ) != 0 ) sKeyword = ::rtl::OUString( rURL ); + + if ( pWindow && SfxContentHelper::IsHelpErrorDocument( aHelpURL ) ) + { + // no help found -> try with parent help id. + Window* pParent = pWindow->GetParent(); + while ( pParent ) + { + ByteString aHelpId = pParent->GetHelpId(); + aHelpURL = CreateHelpURL( String( aHelpId, RTL_TEXTENCODING_UTF8 ), aHelpModuleName ); + if ( !SfxContentHelper::IsHelpErrorDocument( aHelpURL ) ) + break; + else + { + pParent = pParent->GetParent(); + if ( !pParent ) + // create help url of start page ( helpid == 0 -> start page) + aHelpURL = CreateHelpURL( String(), aHelpModuleName ); + } + } + } + break; } } if ( !impl_hasHelpInstalled() ) { if ( impl_showOnlineHelp( aHelpURL ) ) - return TRUE; + return sal_True; else { NoHelpErrorBox aErrBox( const_cast< Window* >( pWindow ) ); aErrBox.Execute(); - return FALSE; + return sal_False; } } Reference < XFrame > xDesktop( ::comphelper::getProcessServiceFactory()->createInstance( DEFINE_CONST_UNICODE("com.sun.star.frame.Desktop") ), UNO_QUERY ); - // check if help is still open - // If not - create new one and return acces directly - // to the internal sub frame, which shows the help content. - - // Note further: We search for this sub frame here directly instead of - // the real top level help task ... It's needed to have the same - // sub frame available - so we can use it for loading (which is done - // in both cases)! - + // check if help window is still open + // If not, create a new one and return access directly to the internal sub frame showing the help content + // search must be done here; search one desktop level could return an arbitraty frame Reference< XFrame > xHelp = xDesktop->findFrame( ::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP_TASK")), FrameSearchFlag::CHILDREN); @@ -847,113 +842,24 @@ BOOL SfxHelp::Start( const String& rURL, const Window* pWindow ) else pHelpWindow = (SfxHelpWindow_Impl*)VCLUnoHelper::GetWindow(xHelp->getComponentWindow()); if (!xHelp.is() || !xHelpContent.is() || !pHelpWindow) - return FALSE; + return sal_False; + +#ifdef DBG_UTIL + ByteString aTmp("SfxHelp: HelpId = "); + aTmp += ByteString( aHelpURL, RTL_TEXTENCODING_UTF8 ); + DBG_TRACE( aTmp.GetBuffer() ); +#endif pHelpWindow->SetHelpURL( aHelpURL ); pHelpWindow->loadHelpContent(aHelpURL); - if ( sKeyword.getLength() > 0 ) - pHelpWindow->OpenKeyword( sKeyword ); + if ( rKeyword.Len() ) + pHelpWindow->OpenKeyword( rKeyword ); Reference < ::com::sun::star::awt::XTopWindow > xTopWindow( xHelp->getContainerWindow(), UNO_QUERY ); if ( xTopWindow.is() ) xTopWindow->toFront(); - return TRUE; -} - -BOOL SfxHelp::Start( ULONG nHelpId, const Window* pWindow ) -{ - String aHelpModuleName( GetHelpModuleName_Impl() ); - String aHelpURL = CreateHelpURL( nHelpId, aHelpModuleName ); - if ( impl_hasHelpInstalled() && pWindow && SfxContentHelper::IsHelpErrorDocument( aHelpURL ) ) - { - // no help found -> try with parent help id. - Window* pParent = pWindow->GetParent(); - while ( pParent ) - { - nHelpId = pParent->GetSmartUniqueOrHelpId().GetNum(); - aHelpURL = CreateHelpURL( nHelpId, aHelpModuleName ); - - if ( !SfxContentHelper::IsHelpErrorDocument( aHelpURL ) ) - break; - else - { - pParent = pParent->GetParent(); - if ( !pParent ) - // create help url of start page ( helpid == 0 -> start page) - aHelpURL = CreateHelpURL( 0, aHelpModuleName ); - } - } - } - - return Start( aHelpURL, pWindow ); -} - -XubString SfxHelp::GetHelpText( ULONG nHelpId, const Window* pWindow ) -{ - String aModuleName = GetHelpModuleName_Impl(); - String aHelpText = pImp->GetHelpText( nHelpId, aModuleName ); - ULONG nNewHelpId = 0; - - if ( pWindow && aHelpText.Len() == 0 ) - { - // no help text found -> try with parent help id. - Window* pParent = pWindow->GetParent(); - while ( pParent ) - { - nNewHelpId = pParent->GetHelpId(); - aHelpText = pImp->GetHelpText( nNewHelpId, aModuleName ); - - if ( aHelpText.Len() > 0 ) - pParent = NULL; - else - pParent = pParent->GetParent(); - } - - if ( bIsDebug && aHelpText.Len() == 0 ) - nNewHelpId = 0; - } - - if ( bIsDebug ) - { - aHelpText += DEFINE_CONST_UNICODE("\n\n"); - aHelpText += aModuleName; - aHelpText += DEFINE_CONST_UNICODE(" - "); - aHelpText += String::CreateFromInt64( nHelpId ); - if ( nNewHelpId ) - { - aHelpText += DEFINE_CONST_UNICODE(" - "); - aHelpText += String::CreateFromInt64( nNewHelpId ); - } - } - - return aHelpText; -} - -XubString SfxHelp::GetHelpText( const String& aCommandURL, const Window* ) -{ - String sModuleName = GetHelpModuleName_Impl(); - String sHelpText = pImp->GetHelpText( aCommandURL, sModuleName ); - - // add some debug information? - if ( bIsDebug ) - { - sHelpText += DEFINE_CONST_UNICODE("\n-------------\n"); - sHelpText += String( sModuleName ); - sHelpText += DEFINE_CONST_UNICODE(": "); - sHelpText += aCommandURL; - } - - return sHelpText; -} - -String SfxHelp::CreateHelpURL( ULONG nHelpId, const String& rModuleName ) -{ - String aURL; - SfxHelp* pHelp = SAL_STATIC_CAST( SfxHelp*, Application::GetHelp() ); - if ( pHelp ) - aURL = pHelp->CreateHelpURL_Impl( nHelpId, rModuleName ); - return aURL; + return sal_True; } String SfxHelp::CreateHelpURL( const String& aCommandURL, const String& rModuleName ) @@ -965,25 +871,25 @@ String SfxHelp::CreateHelpURL( const String& aCommandURL, const String& rModuleN return aURL; } -void SfxHelp::OpenHelpAgent( SfxFrame*, ULONG nHelpId ) +void SfxHelp::OpenHelpAgent( SfxFrame*, const rtl::OString& sHelpId ) { - SfxHelp* pHelp = SAL_STATIC_CAST( SfxHelp*, Application::GetHelp() ); - if ( pHelp ) - pHelp->OpenHelpAgent( nHelpId ); + SfxHelp* pHelp = SAL_STATIC_CAST( SfxHelp*, Application::GetHelp() ); + if ( pHelp ) + pHelp->OpenHelpAgent( sHelpId ); } -void SfxHelp::OpenHelpAgent( ULONG nHelpId ) +void SfxHelp::OpenHelpAgent( const rtl::OString& sHelpId ) { if ( SvtHelpOptions().IsHelpAgentAutoStartMode() ) { SfxHelpOptions_Impl *pOpt = pImp->GetOptions(); - if ( !pOpt->HasId( nHelpId ) ) + if ( !pOpt->HasId( sHelpId ) ) return; try { URL aURL; - aURL.Complete = CreateHelpURL_Impl( nHelpId, GetHelpModuleName_Impl() ); + aURL.Complete = CreateHelpURL_Impl( String( ByteString(sHelpId), RTL_TEXTENCODING_UTF8 ), GetHelpModuleName_Impl() ); Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer")) ), UNO_QUERY ); xTrans->parseStrict(aURL); diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx index 9637ce790b11..727241fd299e 100644..100755 --- a/sfx2/source/appl/sfxpicklist.cxx +++ b/sfx2/source/appl/sfxpicklist.cxx @@ -101,7 +101,7 @@ osl::Mutex* SfxPickList::GetOrCreateMutex() return pMutex; } -void SfxPickList::CreatePicklistMenuTitle( Menu* pMenu, USHORT nItemId, const String& aURLString, sal_uInt32 nNo ) +void SfxPickList::CreatePicklistMenuTitle( Menu* pMenu, sal_uInt16 nItemId, const String& aURLString, sal_uInt32 nNo ) { String aPickEntry; @@ -291,8 +291,8 @@ void SfxPickList::CreateMenuEntries( Menu* pMenu ) { PickListEntry* pEntry = GetPickListEntry( i ); - pMenu->InsertItem( (USHORT)(START_ITEMID_PICKLIST + i), aEmptyString ); - CreatePicklistMenuTitle( pMenu, (USHORT)(START_ITEMID_PICKLIST + i), pEntry->aName, i ); + pMenu->InsertItem( (sal_uInt16)(START_ITEMID_PICKLIST + i), aEmptyString ); + CreatePicklistMenuTitle( pMenu, (sal_uInt16)(START_ITEMID_PICKLIST + i), pEntry->aName, i ); } bPickListMenuInitializing = sal_False; @@ -313,7 +313,7 @@ void SfxPickList::ExecuteEntry( sal_uInt32 nIndex ) String aFilter( pPick->aFilter ); aGuard.clear(); - USHORT nPos=aFilter.Search('|'); + sal_uInt16 nPos=aFilter.Search('|'); if( nPos != STRING_NOTFOUND ) { String aOptions(aFilter.Copy( nPos ).GetBuffer()+1); @@ -327,7 +327,7 @@ void SfxPickList::ExecuteEntry( sal_uInt32 nIndex ) } } -void SfxPickList::ExecuteMenuEntry( USHORT nId ) +void SfxPickList::ExecuteMenuEntry( sal_uInt16 nId ) { ExecuteEntry( (sal_uInt32)( nId - START_ITEMID_PICKLIST ) ); } @@ -445,7 +445,7 @@ void SfxPickList::Notify( SfxBroadcaster&, const SfxHint& rHint ) return; // ignore hidden documents - if ( !SfxViewFrame::GetFirst( pDocSh, TRUE ) ) + if ( !SfxViewFrame::GetFirst( pDocSh, sal_True ) ) return; ::rtl::OUString aTitle = pDocSh->GetTitle(SFX_TITLE_PICKLIST); diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx index 138f48271233..abbcc16e388f 100644..100755 --- a/sfx2/source/appl/shutdownicon.cxx +++ b/sfx2/source/appl/shutdownicon.cxx @@ -67,7 +67,7 @@ #endif #include <vcl/timer.hxx> -#include "sfxresid.hxx" +#include "sfx2/sfxresid.hxx" using namespace ::com::sun::star::uno; using namespace ::com::sun::star::frame; @@ -77,7 +77,11 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::util; using namespace ::com::sun::star::ui::dialogs; +#ifdef WNT +using ::rtl::OUString; +#else using namespace ::rtl; +#endif using namespace ::sfx2; #ifdef ENABLE_QUICKSTART_APPLET @@ -86,6 +90,10 @@ extern "C" { static void SAL_CALL thisModule() {} } # endif #endif +#if defined(UNX) && defined(ENABLE_SYSTRAY_GTK) +#define PLUGIN_NAME "libqstart_gtkli.so" +#endif + class SfxNotificationListener_Impl : public cppu::WeakImplHelper1< XDispatchResultListener > { public: @@ -754,14 +762,14 @@ void SAL_CALL ShutdownIcon::initialize( const ::com::sun::star::uno::Sequence< : void ShutdownIcon::EnterModalMode() { - bModalMode = TRUE; + bModalMode = sal_True; } // ------------------------------- void ShutdownIcon::LeaveModalMode() { - bModalMode = FALSE; + bModalMode = sal_False; } #ifdef WNT diff --git a/sfx2/source/appl/shutdownicon.hxx b/sfx2/source/appl/shutdownicon.hxx index 7ce6c1e8918d..7ce6c1e8918d 100644..100755 --- a/sfx2/source/appl/shutdownicon.hxx +++ b/sfx2/source/appl/shutdownicon.hxx diff --git a/sfx2/source/appl/shutdowniconOs2.cxx b/sfx2/source/appl/shutdowniconOs2.cxx index 9a3ab850ae36..9a3ab850ae36 100644..100755 --- a/sfx2/source/appl/shutdowniconOs2.cxx +++ b/sfx2/source/appl/shutdowniconOs2.cxx diff --git a/sfx2/source/appl/shutdowniconaqua.mm b/sfx2/source/appl/shutdowniconaqua.mm index f30f940e8bac..f30f940e8bac 100644..100755 --- a/sfx2/source/appl/shutdowniconaqua.mm +++ b/sfx2/source/appl/shutdowniconaqua.mm diff --git a/sfx2/source/appl/shutdowniconunx.cxx b/sfx2/source/appl/shutdowniconunx.cxx index bb296a5e98f0..d8c33ecbb67a 100644..100755 --- a/sfx2/source/appl/shutdowniconunx.cxx +++ b/sfx2/source/appl/shutdowniconunx.cxx @@ -83,7 +83,7 @@ static void menu_deactivate_cb( GtkWidget *pMenu ) gtk_menu_popdown( GTK_MENU( pMenu ) ); } -static GdkPixbuf * ResIdToPixbuf( USHORT nResId ) +static GdkPixbuf * ResIdToPixbuf( sal_uInt16 nResId ) { ResId aResId( SV_ICON_SMALL_START + nResId, *pVCLResMgr ); BitmapEx aIcon( aResId ); @@ -128,7 +128,7 @@ static GdkPixbuf * ResIdToPixbuf( USHORT nResId ) pInSalAlpha.ReleaseAccess( pSalAlpha ); return gdk_pixbuf_new_from_data( pPixbufData, - GDK_COLORSPACE_RGB, TRUE, 8, + GDK_COLORSPACE_RGB, sal_True, 8, aSize.Width(), aSize.Height(), aSize.Width() * 4, (GdkPixbufDestroyNotify) g_free, @@ -146,7 +146,7 @@ static void oustring_delete (gpointer data, static void add_item( GtkMenuShell *pMenuShell, const char *pAsciiURL, OUString *pOverrideLabel, - USHORT nResId, GCallback pFnCallback ) + sal_uInt16 nResId, GCallback pFnCallback ) { OUString *pURL = new OUString (OStringToOUString( pAsciiURL, RTL_TEXTENCODING_UTF8 )); @@ -179,7 +179,7 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; static void add_ugly_db_item( GtkMenuShell *pMenuShell, const char *pAsciiURL, - USHORT nResId, GCallback pFnCallback ) + sal_uInt16 nResId, GCallback pFnCallback ) { SvtDynamicMenuOptions aOpt; Sequence < Sequence < PropertyValue > > aMenu = aOpt.GetMenu( E_NEWMENU ); @@ -304,7 +304,7 @@ static gboolean display_menu_cb( GtkWidget *, GdkEventButton *event, GtkWidget *pMenu ) { if (event->button == 2) - return FALSE; + return sal_False; refresh_menu( pMenu ); @@ -312,7 +312,7 @@ static gboolean display_menu_cb( GtkWidget *, gtk_status_icon_position_menu, pTrayIcon, 0, event->time ); - return TRUE; + return sal_True; } #ifdef ENABLE_GIO diff --git a/sfx2/source/appl/shutdowniconw32.cxx b/sfx2/source/appl/shutdowniconw32.cxx index 72bd91ae1727..72bd91ae1727 100644..100755 --- a/sfx2/source/appl/shutdowniconw32.cxx +++ b/sfx2/source/appl/shutdowniconw32.cxx diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx index 5c655496f439..5036790bfe70 100644..100755 --- a/sfx2/source/appl/workwin.cxx +++ b/sfx2/source/appl/workwin.cxx @@ -45,7 +45,7 @@ #include <sfx2/viewsh.hxx> #include "splitwin.hxx" #include <sfx2/msgpool.hxx> -#include "sfxresid.hxx" +#include "sfx2/sfxresid.hxx" #include <sfx2/objsh.hxx> #include <sfx2/request.hxx> // SFX_ITEMSET_SET #include <vcl/taskpanelist.hxx> @@ -72,7 +72,7 @@ namespace css = ::com::sun::star; struct ResIdToResName { - USHORT nId; + sal_uInt16 nId; const char* pName; }; @@ -302,23 +302,23 @@ throw (css::uno::RuntimeException) { if ( eLayoutEvent == css::frame::LayoutManagerEvents::VISIBLE ) { - m_pWrkWin->MakeVisible_Impl( TRUE ); + m_pWrkWin->MakeVisible_Impl( sal_True ); m_pWrkWin->ShowChilds_Impl(); - m_pWrkWin->ArrangeChilds_Impl( TRUE ); + m_pWrkWin->ArrangeChilds_Impl( sal_True ); } else if ( eLayoutEvent == css::frame::LayoutManagerEvents::INVISIBLE ) { - m_pWrkWin->MakeVisible_Impl( FALSE ); + m_pWrkWin->MakeVisible_Impl( sal_False ); m_pWrkWin->HideChilds_Impl(); - m_pWrkWin->ArrangeChilds_Impl( TRUE ); + m_pWrkWin->ArrangeChilds_Impl( sal_True ); } else if ( eLayoutEvent == css::frame::LayoutManagerEvents::LOCK ) { - m_pWrkWin->Lock_Impl( TRUE ); + m_pWrkWin->Lock_Impl( sal_True ); } else if ( eLayoutEvent == css::frame::LayoutManagerEvents::UNLOCK ) { - m_pWrkWin->Lock_Impl( FALSE ); + m_pWrkWin->Lock_Impl( sal_False ); } } } @@ -330,7 +330,7 @@ typedef boost::unordered_map< sal_Int32, rtl::OUString > ToolBarResIdToResourceU static sal_Bool bMapInitialized = sal_False; static ToolBarResIdToResourceURLMap aResIdToResourceURLMap; -static rtl::OUString GetResourceURLFromResId( USHORT nResId ) +static rtl::OUString GetResourceURLFromResId( sal_uInt16 nResId ) { if ( !bMapInitialized ) { @@ -356,20 +356,20 @@ static rtl::OUString GetResourceURLFromResId( USHORT nResId ) return rtl::OUString(); } -BOOL IsAppWorkWinToolbox_Impl( USHORT nPos ) +sal_Bool IsAppWorkWinToolbox_Impl( sal_uInt16 nPos ) { switch ( nPos ) { case SFX_OBJECTBAR_APPLICATION : case SFX_OBJECTBAR_MACRO: case SFX_OBJECTBAR_FULLSCREEN: - return TRUE; + return sal_True; default: - return FALSE; + return sal_False; } } -USHORT TbxMatch( USHORT nPos ) +sal_uInt16 TbxMatch( sal_uInt16 nPos ) { switch ( nPos ) { @@ -392,9 +392,9 @@ USHORT TbxMatch( USHORT nPos ) } } -USHORT ChildAlignValue(SfxChildAlignment eAlign) +sal_uInt16 ChildAlignValue(SfxChildAlignment eAlign) { - USHORT ret = 17; + sal_uInt16 ret = 17; switch (eAlign) { @@ -453,9 +453,9 @@ USHORT ChildAlignValue(SfxChildAlignment eAlign) return ret; } -USHORT ChildTravelValue( SfxChildAlignment eAlign ) +sal_uInt16 ChildTravelValue( SfxChildAlignment eAlign ) { - USHORT ret = 17; + sal_uInt16 ret = 17; switch (eAlign) { @@ -517,12 +517,12 @@ USHORT ChildTravelValue( SfxChildAlignment eAlign ) void SfxWorkWindow::Sort_Impl() { aSortedList.Remove(0, aSortedList.Count()); - for (USHORT i=0; i<pChilds->Count(); i++) + for (sal_uInt16 i=0; i<pChilds->Count(); i++) { SfxChild_Impl *pCli = (*pChilds)[i]; if (pCli) { - USHORT k; + sal_uInt16 k; for (k=0; k<aSortedList.Count(); k++) if (ChildAlignValue((*pChilds)[aSortedList[k]]->eAlign) > ChildAlignValue(pCli->eAlign)) @@ -531,7 +531,7 @@ void SfxWorkWindow::Sort_Impl() } } - bSorted = TRUE; + bSorted = sal_True; } @@ -555,7 +555,7 @@ SfxFrameWorkWin_Impl::SfxFrameWorkWin_Impl( Window *pWin, SfxFrame *pFrm, SfxFra } // The required split windows (one for each side) can be created - for ( USHORT n=0; n<SFX_SPLITWINDOWS_MAX; n++ ) + for ( sal_uInt16 n=0; n<SFX_SPLITWINDOWS_MAX; n++ ) { // The SplitWindows excludes direct ChildWindows of the WorkWindows // and receives the docked window. @@ -584,12 +584,12 @@ SfxWorkWindow::SfxWorkWindow( Window *pWin, SfxBindings& rB, SfxWorkWindow* pPar pActiveChild( 0 ), nChilds( 0 ), nOrigMode( 0 ), - bSorted( TRUE ), - bDockingAllowed(TRUE), - bInternalDockingAllowed(TRUE), - bAllChildsVisible(TRUE), - bIsFullScreen( FALSE ), - bShowStatusBar( TRUE ), + bSorted( sal_True ), + bDockingAllowed(sal_True), + bInternalDockingAllowed(sal_True), + bAllChildsVisible(sal_True), + bIsFullScreen( sal_False ), + bShowStatusBar( sal_True ), m_nLock( 0 ), m_aStatusBarResName( RTL_CONSTASCII_USTRINGPARAM( "private:resource/statusbar/statusbar" )), m_aLayoutManagerPropName( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" )), @@ -607,7 +607,7 @@ SfxWorkWindow::SfxWorkWindow( Window *pWin, SfxBindings& rB, SfxWorkWindow* pPar // For the ObjectBars a integral place in the Childlist is reserved, // so that they always come in a defined order. SfxChild_Impl* pChild=0; - for (USHORT n=0; n < SFX_OBJECTBAR_MAX; ++n) + for (sal_uInt16 n=0; n < SFX_OBJECTBAR_MAX; ++n) pChilds->Insert(0,pChild); // create and initialize layout manager listener @@ -627,7 +627,7 @@ SfxWorkWindow::~SfxWorkWindow() DBG_DTOR(SfxWorkWindow, 0); // Delete SplitWindows - for ( USHORT n=0; n<SFX_SPLITWINDOWS_MAX; n++ ) + for ( sal_uInt16 n=0; n<SFX_SPLITWINDOWS_MAX; n++ ) { SfxSplitWindow *p = pSplit[n]; if (p->GetWindowCount()) @@ -652,7 +652,7 @@ SystemWindow* SfxWorkWindow::GetTopWindow() const return (SystemWindow*) pRet; } -void SfxWorkWindow::Lock_Impl( BOOL bLock ) +void SfxWorkWindow::Lock_Impl( sal_Bool bLock ) { if ( bLock ) m_nLock++; @@ -672,7 +672,7 @@ void SfxWorkWindow::ChangeWindow_Impl( Window *pNew ) { Window *pOld = pWorkWin; pWorkWin = pNew; - for ( USHORT nPos = 0; nPos < pChilds->Count(); ++nPos ) + for ( sal_uInt16 nPos = 0; nPos < pChilds->Count(); ++nPos ) { SfxChild_Impl *pCli = (*pChilds)[nPos]; if ( pCli && pCli->pWin && pCli->pWin->GetParent() == pOld ) @@ -684,14 +684,14 @@ void SfxWorkWindow::ChangeWindow_Impl( Window *pNew ) void SfxWorkWindow::SaveStatus_Impl() { - USHORT nCount = pChildWins->Count(); - for ( USHORT n=0; n<nCount; n++ ) + sal_uInt16 nCount = pChildWins->Count(); + for ( sal_uInt16 n=0; n<nCount; n++ ) { SfxChildWin_Impl* pCW = (*pChildWins)[n]; SfxChildWindow *pChild = pCW->pWin; if (pChild) { - USHORT nFlags = pCW->aInfo.nFlags; + sal_uInt16 nFlags = pCW->aInfo.nFlags; pCW->aInfo = pChild->GetInfo(); pCW->aInfo.nFlags |= nFlags; SaveStatus_Impl(pChild, pCW->aInfo); @@ -711,7 +711,7 @@ void SfxWorkWindow::DeleteControllers_Impl() // Lock SplitWindows (which means supressing the Resize-Reaction of the // DockingWindows) - USHORT n; + sal_uInt16 n; for ( n=0; n<SFX_SPLITWINDOWS_MAX; n++ ) { SfxSplitWindow *p = pSplit[n]; @@ -773,10 +773,10 @@ void SfxWorkWindow::DeleteControllers_Impl() // Delete ObjectBars (this is done last, so that pChilds does not // receive dead Pointers) - for ( USHORT i = 0; i < aObjBarList.size(); i++ ) + for ( sal_uInt16 i = 0; i < aObjBarList.size(); i++ ) { // Not every position must be occupied - USHORT nId = aObjBarList[i].nId; + sal_uInt16 nId = aObjBarList[i].nId; if ( nId ) aObjBarList[i].nId = 0; } @@ -785,7 +785,7 @@ void SfxWorkWindow::DeleteControllers_Impl() // ObjectBars are all released at once, since they occupy a // fixed contiguous area in the array pChild pChilds->Remove(0, SFX_OBJECTBAR_MAX); - bSorted = FALSE; + bSorted = sal_False; nChilds = 0; } @@ -793,12 +793,12 @@ void SfxWorkWindow::DeleteControllers_Impl() //==================================================================== // Virtual method for placing the child window. -void SfxWorkWindow::ArrangeChilds_Impl( BOOL /*bForce*/) +void SfxWorkWindow::ArrangeChilds_Impl( sal_Bool /*bForce*/) { Arrange_Impl(); } -void SfxFrameWorkWin_Impl::ArrangeChilds_Impl( BOOL bForce ) +void SfxFrameWorkWin_Impl::ArrangeChilds_Impl( sal_Bool bForce ) { if ( pFrame->IsClosing_Impl() || ( m_nLock && !bForce )) return; @@ -864,7 +864,7 @@ SvBorder SfxWorkWindow::Arrange_Impl() Size aSize; Rectangle aTmp( aClientArea ); - for ( USHORT n=0; n<aSortedList.Count(); ++n ) + for ( sal_uInt16 n=0; n<aSortedList.Count(); ++n ) { SfxChild_Impl* pCli = (*pChilds)[aSortedList[n]]; if ( !pCli->pWin ) @@ -883,7 +883,7 @@ SvBorder SfxWorkWindow::Arrange_Impl() aSize = pCli->pWin->GetSizePixel(); SvBorder aTemp = aBorder; - BOOL bAllowHiding = TRUE; + sal_Bool bAllowHiding = sal_True; switch ( pCli->eAlign ) { case SFX_ALIGN_HIGHESTTOP: @@ -893,7 +893,7 @@ SvBorder SfxWorkWindow::Arrange_Impl() aSize.Width() = aTmp.GetWidth(); if ( pCli->pWin->GetType() == WINDOW_SPLITWINDOW ) aSize = ((SplitWindow *)(pCli->pWin))->CalcLayoutSizePixel( aSize ); - bAllowHiding = FALSE; + bAllowHiding = sal_False; aBorder.Top() += aSize.Height(); aPos = aTmp.TopLeft(); aTmp.Top() += aSize.Height(); @@ -923,7 +923,7 @@ SvBorder SfxWorkWindow::Arrange_Impl() aSize.Height() = aTmp.GetHeight(); if ( pCli->pWin->GetType() == WINDOW_SPLITWINDOW ) aSize = ((SplitWindow *)(pCli->pWin))->CalcLayoutSizePixel( aSize ); - bAllowHiding = FALSE; + bAllowHiding = sal_False; aBorder.Left() += aSize.Width(); aPos = aTmp.TopLeft(); aTmp.Left() += aSize.Width(); @@ -948,12 +948,12 @@ SvBorder SfxWorkWindow::Arrange_Impl() default: pCli->aSize = pCli->pWin->GetSizePixel(); - pCli->bResize = FALSE; + pCli->bResize = sal_False; continue; } pCli->pWin->SetPosSizePixel( aPos, aSize ); - pCli->bResize = FALSE; + pCli->bResize = sal_False; pCli->aSize = aSize; if( bAllowHiding && !RequestTopToolSpacePixel_Impl( aBorder ) ) { @@ -995,13 +995,13 @@ SvBorder SfxWorkWindow::Arrange_Impl() void SfxWorkWindow::Close_Impl() { - for (USHORT n=0; n<pChildWins->Count(); n++) + for (sal_uInt16 n=0; n<pChildWins->Count(); n++) { SfxChildWin_Impl *pCW = (*pChildWins)[n]; SfxChildWindow *pChild = pCW->pWin; if (pChild) { - USHORT nFlags = pCW->aInfo.nFlags; + sal_uInt16 nFlags = pCW->aInfo.nFlags; pCW->aInfo = pChild->GetInfo(); pCW->aInfo.nFlags |= nFlags; SaveStatus_Impl(pChild, pCW->aInfo); @@ -1009,23 +1009,23 @@ void SfxWorkWindow::Close_Impl() } } -BOOL SfxWorkWindow::PrepareClose_Impl() +sal_Bool SfxWorkWindow::PrepareClose_Impl() { - for (USHORT n=0; n<pChildWins->Count(); n++) + for (sal_uInt16 n=0; n<pChildWins->Count(); n++) { SfxChildWin_Impl *pCW = (*pChildWins)[n]; SfxChildWindow *pChild = pCW->pWin; if ( pChild && !pChild->QueryClose() ) - return FALSE; + return sal_False; } - return TRUE; + return sal_True; } //-------------------------------------------------------------------- SfxChild_Impl* SfxWorkWindow::RegisterChild_Impl( Window& rWindow, - SfxChildAlignment eAlign, BOOL bCanGetFocus ) + SfxChildAlignment eAlign, sal_Bool bCanGetFocus ) { DBG_CHKTHIS(SfxWorkWindow, 0); DBG_ASSERT( pChilds->Count() < 255, "too many children" ); @@ -1041,7 +1041,7 @@ SfxChild_Impl* SfxWorkWindow::RegisterChild_Impl( Window& rWindow, pChild->bCanGetFocus = bCanGetFocus; pChilds->Insert(pChilds->Count(), pChild); - bSorted = FALSE; + bSorted = sal_False; nChilds++; return (*pChilds)[pChilds->Count()-1]; } @@ -1059,11 +1059,11 @@ void SfxWorkWindow::AlignChild_Impl( Window& rWindow, if ( pChild ) { if (pChild->eAlign != eAlign) - bSorted = FALSE; + bSorted = sal_False; pChild->eAlign = eAlign; pChild->aSize = rNewSize; - pChild->bResize = TRUE; + pChild->bResize = sal_True; } else { OSL_FAIL( "aligning unregistered child" ); @@ -1077,7 +1077,7 @@ void SfxWorkWindow::ReleaseChild_Impl( Window& rWindow ) DBG_CHKTHIS(SfxWorkWindow, 0); SfxChild_Impl *pChild = 0; - USHORT nPos; + sal_uInt16 nPos; for ( nPos = 0; nPos < pChilds->Count(); ++nPos ) { pChild = (*pChilds)[nPos]; @@ -1088,7 +1088,7 @@ void SfxWorkWindow::ReleaseChild_Impl( Window& rWindow ) if ( nPos < pChilds->Count() ) { - bSorted = FALSE; + bSorted = sal_False; nChilds--; pChilds->Remove(nPos); delete pChild; @@ -1105,8 +1105,8 @@ SfxChild_Impl* SfxWorkWindow::FindChild_Impl( const Window& rWindow ) const DBG_CHKTHIS(SfxWorkWindow, 0); SfxChild_Impl *pChild = 0; - USHORT nCount = pChilds->Count(); - for ( USHORT nPos = 0; nPos < nCount; ++nPos ) + sal_uInt16 nCount = pChilds->Count(); + for ( sal_uInt16 nPos = 0; nPos < nCount; ++nPos ) { pChild = (*pChilds)[nPos]; if ( pChild ) @@ -1126,7 +1126,7 @@ void SfxWorkWindow::ShowChilds_Impl() bool bInvisible = ( !IsVisible_Impl() || ( !pWorkWin->IsReallyVisible() && !pWorkWin->IsReallyShown() )); SfxChild_Impl *pCli = 0; - for ( USHORT nPos = 0; nPos < pChilds->Count(); ++nPos ) + for ( sal_uInt16 nPos = 0; nPos < pChilds->Count(); ++nPos ) { SfxChildWin_Impl* pCW = 0; pCli = (*pChilds)[nPos]; @@ -1135,7 +1135,7 @@ void SfxWorkWindow::ShowChilds_Impl() { // We have to find the SfxChildWin_Impl to retrieve the // SFX_CHILDWIN flags that can influence visibility. - for (USHORT n=0; n<pChildWins->Count(); n++) + for (sal_uInt16 n=0; n<pChildWins->Count(); n++) { SfxChildWin_Impl* pCWin = (*pChildWins)[n]; SfxChild_Impl* pChild = pCWin->pCli; @@ -1158,21 +1158,21 @@ void SfxWorkWindow::ShowChilds_Impl() if ( CHILD_VISIBLE == (pCli->nVisible & CHILD_VISIBLE) && bVisible ) { - USHORT nFlags = pCli->bSetFocus ? 0 : SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE; + sal_uInt16 nFlags = pCli->bSetFocus ? 0 : SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE; switch ( pCli->pWin->GetType() ) { case RSC_DOCKINGWINDOW : - ((DockingWindow*)pCli->pWin)->Show( TRUE, nFlags ); + ((DockingWindow*)pCli->pWin)->Show( sal_True, nFlags ); break; case RSC_SPLITWINDOW : - ((SplitWindow*)pCli->pWin)->Show( TRUE, nFlags ); + ((SplitWindow*)pCli->pWin)->Show( sal_True, nFlags ); break; default: - pCli->pWin->Show( TRUE, nFlags ); + pCli->pWin->Show( sal_True, nFlags ); break; } - pCli->bSetFocus = FALSE; + pCli->bSetFocus = sal_False; } else { @@ -1195,7 +1195,7 @@ void SfxWorkWindow::ShowChilds_Impl() void SfxWorkWindow::HideChilds_Impl() { SfxChild_Impl *pChild = 0; - for ( USHORT nPos = pChilds->Count(); nPos > 0; --nPos ) + for ( sal_uInt16 nPos = pChilds->Count(); nPos > 0; --nPos ) { pChild = (*pChilds)[nPos-1]; if (pChild && pChild->pWin) @@ -1217,7 +1217,7 @@ void SfxWorkWindow::HideChilds_Impl() void SfxWorkWindow::ResetObjectBars_Impl() { - USHORT n; + sal_uInt16 n; for ( n = 0; n < aObjBarList.size(); n++ ) aObjBarList[n].bDestroy = sal_True; @@ -1225,24 +1225,24 @@ void SfxWorkWindow::ResetObjectBars_Impl() (*pChildWins)[n]->nId = 0; } -void SfxWorkWindow::NextObjectBar_Impl( USHORT ) +void SfxWorkWindow::NextObjectBar_Impl( sal_uInt16 ) { } -USHORT SfxWorkWindow::HasNextObjectBar_Impl( USHORT, String* ) +sal_uInt16 SfxWorkWindow::HasNextObjectBar_Impl( sal_uInt16, String* ) { return 0; } //------------------------------------------------------------------------ -void SfxWorkWindow::SetObjectBar_Impl( USHORT nPos, sal_uInt32 nResId, +void SfxWorkWindow::SetObjectBar_Impl( sal_uInt16 nPos, sal_uInt32 nResId, SfxInterface* pIFace, const String *pName) { DBG_ASSERT( (nPos & SFX_POSITION_MASK) < SFX_OBJECTBAR_MAX, "object bar position overflow" ); - USHORT nRealPos = nPos & SFX_POSITION_MASK; + sal_uInt16 nRealPos = nPos & SFX_POSITION_MASK; if ( pParent && IsAppWorkWinToolbox_Impl( nRealPos ) ) { pParent->SetObjectBar_Impl( nPos, nResId, pIFace, pName ); @@ -1251,7 +1251,7 @@ void SfxWorkWindow::SetObjectBar_Impl( USHORT nPos, sal_uInt32 nResId, SfxObjectBar_Impl aObjBar; aObjBar.pIFace = pIFace; - aObjBar.nId = sal::static_int_cast<USHORT>(nResId); + aObjBar.nId = sal::static_int_cast<sal_uInt16>(nResId); aObjBar.nPos = nRealPos; aObjBar.nMode = (nPos & SFX_VISIBILITY_MASK); if (pName) @@ -1259,7 +1259,7 @@ void SfxWorkWindow::SetObjectBar_Impl( USHORT nPos, sal_uInt32 nResId, else aObjBar.aName.Erase(); - for ( USHORT n=0; n<aObjBarList.size(); n++ ) + for ( sal_uInt16 n=0; n<aObjBarList.size(); n++ ) { if ( aObjBarList[n].nId == aObjBar.nId ) { @@ -1273,7 +1273,7 @@ void SfxWorkWindow::SetObjectBar_Impl( USHORT nPos, sal_uInt32 nResId, //------------------------------------------------------------------------ -bool SfxWorkWindow::KnowsObjectBar_Impl( USHORT nPos ) const +bool SfxWorkWindow::KnowsObjectBar_Impl( sal_uInt16 nPos ) const /* [Description] @@ -1282,29 +1282,29 @@ bool SfxWorkWindow::KnowsObjectBar_Impl( USHORT nPos ) const */ { - USHORT nRealPos = nPos & SFX_POSITION_MASK; + sal_uInt16 nRealPos = nPos & SFX_POSITION_MASK; if ( pParent && IsAppWorkWinToolbox_Impl( nRealPos ) ) return pParent->KnowsObjectBar_Impl( nPos ); - for ( USHORT n=0; n<aObjBarList.size(); n++ ) + for ( sal_uInt16 n=0; n<aObjBarList.size(); n++ ) { if ( aObjBarList[n].nPos == nRealPos ) - return TRUE; + return true; } - return FALSE; + return false; } //------------------------------------------------------------------------ -BOOL SfxWorkWindow::IsVisible_Impl( USHORT nMode ) const +sal_Bool SfxWorkWindow::IsVisible_Impl( sal_uInt16 nMode ) const { switch( nUpdateMode ) { case SFX_VISIBILITY_STANDARD: - return TRUE; + return sal_True; case SFX_VISIBILITY_UNVISIBLE: - return FALSE; + return sal_False; case SFX_VISIBILITY_PLUGSERVER: case SFX_VISIBILITY_PLUGCLIENT: case SFX_VISIBILITY_CLIENT: @@ -1316,7 +1316,7 @@ BOOL SfxWorkWindow::IsVisible_Impl( USHORT nMode ) const } } -Window* SfxWorkWindow::GetObjectBar_Impl( USHORT, sal_uInt32 ) +Window* SfxWorkWindow::GetObjectBar_Impl( sal_uInt16, sal_uInt32 ) { return NULL; } @@ -1344,7 +1344,7 @@ void SfxFrameWorkWin_Impl::UpdateObjectBars_Impl() pWork = pWork->GetParent_Impl(); } - ArrangeChilds_Impl( FALSE ); + ArrangeChilds_Impl( sal_False ); pWork = pParent; while ( pWork ) @@ -1424,7 +1424,7 @@ void SfxWorkWindow::UpdateObjectBars_Impl() { // Lock SplitWindows (which means supressing the Resize-Reaction of the // DockingWindows) - USHORT n; + sal_uInt16 n; for ( n=0; n<SFX_SPLITWINDOWS_MAX; n++ ) { SfxSplitWindow *p = pSplit[n]; @@ -1461,11 +1461,11 @@ void SfxWorkWindow::UpdateObjectBars_Impl() xLayoutManager->lock(); for ( n = 0; n < aObjBarList.size(); ++n ) { - USHORT nId = aObjBarList[n].nId; + sal_uInt16 nId = aObjBarList[n].nId; sal_Bool bDestroy = aObjBarList[n].bDestroy; // Determine the vaild mode for the ToolBox - USHORT nTbxMode = aObjBarList[n].nMode; + sal_uInt16 nTbxMode = aObjBarList[n].nMode; bool bFullScreenTbx = SFX_VISIBILITY_FULLSCREEN == ( nTbxMode & SFX_VISIBILITY_FULLSCREEN ); nTbxMode &= ~SFX_VISIBILITY_FULLSCREEN; @@ -1514,7 +1514,7 @@ void SfxWorkWindow::UpdateObjectBars_Impl() { SfxSplitWindow *p = pSplit[n]; if (p->GetWindowCount()) - p->Lock(FALSE); + p->Lock(sal_False); } } @@ -1531,11 +1531,11 @@ bool SfxWorkWindow::AllowChildWindowCreation_Impl( const SfxChildWin_Impl& i_rCW void SfxWorkWindow::UpdateChildWindows_Impl() { // any current or in the context available Childwindows - for ( USHORT n=0; n<pChildWins->Count(); n++ ) + for ( sal_uInt16 n=0; n<pChildWins->Count(); n++ ) { SfxChildWin_Impl *pCW = (*pChildWins)[n]; SfxChildWindow *pChildWin = pCW->pWin; - BOOL bCreate = FALSE; + sal_Bool bCreate = sal_False; if ( pCW->nId && !pCW->bDisabled && (pCW->aInfo.nFlags & SFX_CHILDWIN_ALWAYSAVAILABLE || IsVisible_Impl( pCW->nVisibility ) ) ) { // In the context is an appropriate ChildWindow allowed; @@ -1559,7 +1559,7 @@ void SfxWorkWindow::UpdateChildWindows_Impl() bCreate = ( eAlign == SFX_ALIGN_NOALIGNMENT ); } else - bCreate = TRUE; + bCreate = sal_True; if ( bCreate ) bCreate = AllowChildWindowCreation_Impl( *pCW ); @@ -1567,7 +1567,7 @@ void SfxWorkWindow::UpdateChildWindows_Impl() // Currently, no window here, but it is enabled; windows // Create window and if possible theContext if ( bCreate ) - CreateChildWin_Impl( pCW, FALSE ); + CreateChildWin_Impl( pCW, sal_False ); if ( !bAllChildsVisible ) { @@ -1622,10 +1622,10 @@ void SfxWorkWindow::UpdateChildWindows_Impl() } } -void SfxWorkWindow::CreateChildWin_Impl( SfxChildWin_Impl *pCW, BOOL bSetFocus ) +void SfxWorkWindow::CreateChildWin_Impl( SfxChildWin_Impl *pCW, sal_Bool bSetFocus ) { if ( pCW->aInfo.bVisible != 42 ) - pCW->aInfo.bVisible = TRUE; + pCW->aInfo.bVisible = sal_True; SfxChildWindow *pChildWin = SfxChildWindow::CreateChildWindow( pCW->nId, pWorkWin, &GetBindings(), pCW->aInfo); if (pChildWin) @@ -1644,7 +1644,7 @@ void SfxWorkWindow::CreateChildWin_Impl( SfxChildWin_Impl *pCW, BOOL bSetFocus ) // The creation was successful GetBindings().Invalidate(pCW->nId); - USHORT nPos = pChildWin->GetPosition(); + sal_uInt16 nPos = pChildWin->GetPosition(); if (nPos != CHILDWIN_NOPOS) { DBG_ASSERT(nPos < SFX_OBJECTBAR_MAX, "Illegal objectbar position!"); @@ -1687,11 +1687,11 @@ void SfxWorkWindow::CreateChildWin_Impl( SfxChildWin_Impl *pCW, BOOL bSetFocus ) void SfxWorkWindow::RemoveChildWin_Impl( SfxChildWin_Impl *pCW ) { - USHORT nId = pCW->nSaveId; + sal_uInt16 nId = pCW->nSaveId; SfxChildWindow *pChildWin = pCW->pWin; // Save the information in the INI file - USHORT nFlags = pCW->aInfo.nFlags; + sal_uInt16 nFlags = pCW->aInfo.nFlags; pCW->aInfo = pChildWin->GetInfo(); pCW->aInfo.nFlags |= nFlags; SaveStatus_Impl(pChildWin, pCW->aInfo); @@ -1727,25 +1727,25 @@ void SfxWorkWindow::ResetStatusBar_Impl() void SfxWorkWindow::SetStatusBar_Impl( sal_uInt32 nResId, SfxShell*, SfxBindings& ) { if ( nResId && bShowStatusBar && IsVisible_Impl() ) - aStatBar.nId = sal::static_int_cast<USHORT>(nResId); + aStatBar.nId = sal::static_int_cast<sal_uInt16>(nResId); } #define SFX_ITEMTYPE_STATBAR 4 -void SfxWorkWindow::SetTempStatusBar_Impl( BOOL bSet ) +void SfxWorkWindow::SetTempStatusBar_Impl( sal_Bool bSet ) { if ( aStatBar.bTemp != bSet && bShowStatusBar && IsVisible_Impl() ) { - BOOL bOn = FALSE; - BOOL bReset = FALSE; + sal_Bool bOn = sal_False; + sal_Bool bReset = sal_False; if ( bSet && !aStatBar.nId ) { - bReset = TRUE; + bReset = sal_True; SetStatusBar_Impl( SFX_ITEMTYPE_STATBAR, SFX_APP(), GetBindings() ); } if ( aStatBar.nId && aStatBar.bOn && !bIsFullScreen ) - bOn = TRUE; + bOn = sal_True; aStatBar.bTemp = bSet; if ( !bOn || bReset || (!bSet && aStatBar.nId ) ) @@ -1789,7 +1789,7 @@ void SfxWorkWindow::UpdateStatusBar_Impl() } } -void SfxWorkWindow::MakeVisible_Impl( BOOL bVis ) +void SfxWorkWindow::MakeVisible_Impl( sal_Bool bVis ) { if ( bVis ) nOrigMode = SFX_VISIBILITY_STANDARD; @@ -1800,15 +1800,15 @@ void SfxWorkWindow::MakeVisible_Impl( BOOL bVis ) nUpdateMode = nOrigMode; } -BOOL SfxWorkWindow::IsVisible_Impl() +sal_Bool SfxWorkWindow::IsVisible_Impl() { return nOrigMode != SFX_VISIBILITY_UNVISIBLE; } //------------------------------------------------------------------------ -void SfxWorkWindow::HidePopups_Impl(BOOL bHide, BOOL bParent, USHORT nId ) +void SfxWorkWindow::HidePopups_Impl(sal_Bool bHide, sal_Bool bParent, sal_uInt16 nId ) { - for ( USHORT n = 0; n < pChildWins->Count(); ++n ) + for ( sal_uInt16 n = 0; n < pChildWins->Count(); ++n ) { SfxChildWindow *pCW = (*pChildWins)[n]->pWin; if (pCW && pCW->GetAlignment() == SFX_ALIGN_NOALIGNMENT && pCW->GetType() != nId) @@ -1836,10 +1836,10 @@ void SfxWorkWindow::HidePopups_Impl(BOOL bHide, BOOL bParent, USHORT nId ) //------------------------------------------------------------------------ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild, - SfxDockingConfig eConfig, USHORT nId) + SfxDockingConfig eConfig, sal_uInt16 nId) { SfxDockingWindow* pDockWin=0; - USHORT nPos = USHRT_MAX; + sal_uInt16 nPos = USHRT_MAX; Window *pWin=0; SfxChildWin_Impl *pCW = 0; @@ -1850,7 +1850,7 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild, else { // configure direct childwindow - for (USHORT n=0; n<pChildWins->Count(); n++) + for (sal_uInt16 n=0; n<pChildWins->Count(); n++) { pCW = (*pChildWins)[n]; SfxChildWindow *pChild = pCW->pWin; @@ -1896,7 +1896,7 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild, pWin = pSplitWin->GetSplitWindow(); if ( pSplitWin->GetWindowCount() == 1 ) - ((SplitWindow*)pWin)->Show( TRUE, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); + ((SplitWindow*)pWin)->Show( sal_True, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); } } @@ -1913,7 +1913,7 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild, Sort_Impl(); SfxChild_Impl *pChild = 0; - USHORT n; + sal_uInt16 n; for ( n=0; n<aSortedList.Count(); ++n ) { pChild = (*pChilds)[aSortedList[n]]; @@ -1936,13 +1936,13 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild, Rectangle aOuterRect( GetTopRect_Impl() ); aOuterRect.SetPos( pWorkWin->OutputToScreenPixel( aOuterRect.TopLeft() )); Rectangle aInnerRect( aOuterRect ); - BOOL bTbx = (eChild == SFX_CHILDWIN_OBJECTBAR); + sal_Bool bTbx = (eChild == SFX_CHILDWIN_OBJECTBAR); // The current affected window is included in the calculation of // the inner rectangle! - for ( USHORT m=0; m<aSortedList.Count(); ++m ) + for ( sal_uInt16 m=0; m<aSortedList.Count(); ++m ) { - USHORT i=aSortedList[m]; + sal_uInt16 i=aSortedList[m]; SfxChild_Impl* pCli = (*pChilds)[i]; if ( pCli && pCli->nVisible == CHILD_VISIBLE && pCli->pWin ) @@ -2061,7 +2061,7 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild, if ( eChild == SFX_CHILDWIN_DOCKINGWINDOW || eAlign == SFX_ALIGN_NOALIGNMENT) { // configuration inside the SplitWindow, no change for the SplitWindows' configuration - pCli->bResize = TRUE; + pCli->bResize = sal_True; pCli->aSize = pDockWin->GetSizePixel(); } } @@ -2070,7 +2070,7 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild, { if( pCli->eAlign != eAlign ) { - bSorted = FALSE; + bSorted = sal_False; pCli->eAlign = eAlign; } @@ -2081,7 +2081,7 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild, if ( pCW && pCW->pWin ) { // store changed configuration - USHORT nFlags = pCW->aInfo.nFlags; + sal_uInt16 nFlags = pCW->aInfo.nFlags; pCW->aInfo = pCW->pWin->GetInfo(); pCW->aInfo.nFlags |= nFlags; if ( eConfig != SFX_MOVEDOCKINGWINDOW ) @@ -2095,10 +2095,10 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild, //-------------------------------------------------------------------- -void SfxWorkWindow::SetChildWindowVisible_Impl( sal_uInt32 lId, BOOL bEnabled, USHORT nMode ) +void SfxWorkWindow::SetChildWindowVisible_Impl( sal_uInt32 lId, sal_Bool bEnabled, sal_uInt16 nMode ) { - USHORT nInter = (USHORT) ( lId >> 16 ); - USHORT nId = (USHORT) ( lId & 0xFFFF ); + sal_uInt16 nInter = (sal_uInt16) ( lId >> 16 ); + sal_uInt16 nId = (sal_uInt16) ( lId & 0xFFFF ); SfxChildWin_Impl *pCW=NULL; SfxWorkWindow *pWork = pParent; @@ -2111,8 +2111,8 @@ void SfxWorkWindow::SetChildWindowVisible_Impl( sal_uInt32 lId, BOOL bEnabled, U if ( pWork ) { // The Parent already known? - USHORT nCount = pWork->pChildWins->Count(); - for (USHORT n=0; n<nCount; n++) + sal_uInt16 nCount = pWork->pChildWins->Count(); + for (sal_uInt16 n=0; n<nCount; n++) if ((*pWork->pChildWins)[n]->nSaveId == nId) { pCW = (*pWork->pChildWins)[n]; @@ -2123,8 +2123,8 @@ void SfxWorkWindow::SetChildWindowVisible_Impl( sal_uInt32 lId, BOOL bEnabled, U if ( !pCW ) { // If no Parent or the Parent us still unknown, then search here - USHORT nCount = pChildWins->Count(); - for (USHORT n=0; n<nCount; n++) + sal_uInt16 nCount = pChildWins->Count(); + for (sal_uInt16 n=0; n<nCount; n++) if ((*pChildWins)[n]->nSaveId == nId) { pCW = (*pChildWins)[n]; @@ -2156,10 +2156,10 @@ void SfxWorkWindow::SetChildWindowVisible_Impl( sal_uInt32 lId, BOOL bEnabled, U //-------------------------------------------------------------------- // The on/of-Status of a ChildWindows is switched -void SfxWorkWindow::ToggleChildWindow_Impl(USHORT nId, BOOL bSetFocus) +void SfxWorkWindow::ToggleChildWindow_Impl(sal_uInt16 nId, sal_Bool bSetFocus) { - USHORT nCount = pChildWins->Count(); - USHORT n; + sal_uInt16 nCount = pChildWins->Count(); + sal_uInt16 n; for (n=0; n<nCount; n++) if ((*pChildWins)[n]->nId == nId) break; @@ -2186,15 +2186,15 @@ void SfxWorkWindow::ToggleChildWindow_Impl(USHORT nId, BOOL bSetFocus) { if ( pChild->QueryClose() ) { - pCW->bCreate = FALSE; + pCW->bCreate = sal_False; if ( pChild->IsHideAtToggle() ) { - ShowChildWindow_Impl( nId, FALSE, bSetFocus ); + ShowChildWindow_Impl( nId, sal_False, bSetFocus ); } else { // The Window should be switched off - pChild->SetVisible_Impl( FALSE ); + pChild->SetVisible_Impl( sal_False ); RemoveChildWin_Impl( pCW ); } } @@ -2202,7 +2202,7 @@ void SfxWorkWindow::ToggleChildWindow_Impl(USHORT nId, BOOL bSetFocus) else { // no actual Window exists, yet => just remember the "switched off" state - pCW->bCreate = FALSE; + pCW->bCreate = sal_False; } } else @@ -2212,7 +2212,7 @@ void SfxWorkWindow::ToggleChildWindow_Impl(USHORT nId, BOOL bSetFocus) { if ( pChild ) { - ShowChildWindow_Impl( nId, TRUE, bSetFocus ); + ShowChildWindow_Impl( nId, sal_True, bSetFocus ); } else { @@ -2220,7 +2220,7 @@ void SfxWorkWindow::ToggleChildWindow_Impl(USHORT nId, BOOL bSetFocus) CreateChildWin_Impl( pCW, bSetFocus ); if ( !pCW->pWin ) // no success - pCW->bCreate = FALSE; + pCW->bCreate = sal_False; } } } @@ -2267,10 +2267,10 @@ void SfxWorkWindow::ToggleChildWindow_Impl(USHORT nId, BOOL bSetFocus) //-------------------------------------------------------------------- -BOOL SfxWorkWindow::HasChildWindow_Impl(USHORT nId) +sal_Bool SfxWorkWindow::HasChildWindow_Impl(sal_uInt16 nId) { - USHORT nCount = pChildWins->Count(); - USHORT n; + sal_uInt16 nCount = pChildWins->Count(); + sal_uInt16 n; for (n=0; n<nCount; n++) if ((*pChildWins)[n]->nSaveId == nId) break; @@ -2285,10 +2285,10 @@ BOOL SfxWorkWindow::HasChildWindow_Impl(USHORT nId) if ( pParent ) return pParent->HasChildWindow_Impl( nId ); - return FALSE; + return sal_False; } -BOOL SfxWorkWindow::IsFloating( USHORT nId ) +sal_Bool SfxWorkWindow::IsFloating( sal_uInt16 nId ) { SfxChildWin_Impl *pCW=NULL; SfxWorkWindow *pWork = pParent; @@ -2301,8 +2301,8 @@ BOOL SfxWorkWindow::IsFloating( USHORT nId ) if ( pWork ) { // The Parent already known? - USHORT nCount = pWork->pChildWins->Count(); - for (USHORT n=0; n<nCount; n++) + sal_uInt16 nCount = pWork->pChildWins->Count(); + for (sal_uInt16 n=0; n<nCount; n++) if ((*pWork->pChildWins)[n]->nSaveId == nId) { pCW = (*pWork->pChildWins)[n]; @@ -2313,8 +2313,8 @@ BOOL SfxWorkWindow::IsFloating( USHORT nId ) if ( !pCW ) { // If no Parent or the Parent us still unknown, then search here - USHORT nCount = pChildWins->Count(); - for (USHORT n=0; n<nCount; n++) + sal_uInt16 nCount = pChildWins->Count(); + for (sal_uInt16 n=0; n<nCount; n++) if ((*pChildWins)[n]->nSaveId == nId) { pCW = (*pChildWins)[n]; @@ -2327,7 +2327,7 @@ BOOL SfxWorkWindow::IsFloating( USHORT nId ) // If new, then initialize, add this here depending on the flag or // the Parent pCW = new SfxChildWin_Impl( nId ); - pCW->bEnable = FALSE; + pCW->bEnable = sal_False; pCW->nId = 0; pCW->nVisibility = 0; InitializeChild_Impl( pCW ); @@ -2341,16 +2341,16 @@ BOOL SfxWorkWindow::IsFloating( USHORT nId ) if ( pCW->aInfo.GetExtraData_Impl( &eAlign ) ) return( eAlign == SFX_ALIGN_NOALIGNMENT ); else - return TRUE; + return sal_True; } //-------------------------------------------------------------------- -BOOL SfxWorkWindow::KnowsChildWindow_Impl(USHORT nId) +sal_Bool SfxWorkWindow::KnowsChildWindow_Impl(sal_uInt16 nId) { SfxChildWin_Impl *pCW=0; - USHORT nCount = pChildWins->Count(); - USHORT n; + sal_uInt16 nCount = pChildWins->Count(); + sal_uInt16 n; for (n=0; n<nCount; n++) { pCW = (*pChildWins)[n]; @@ -2361,18 +2361,18 @@ BOOL SfxWorkWindow::KnowsChildWindow_Impl(USHORT nId) if (n<nCount) { if ( !(pCW->aInfo.nFlags & SFX_CHILDWIN_ALWAYSAVAILABLE) && !IsVisible_Impl( pCW->nVisibility ) ) - return FALSE; + return sal_False; return pCW->bEnable; } else if ( pParent ) return pParent->KnowsChildWindow_Impl( nId ); else - return FALSE; + return sal_False; } //-------------------------------------------------------------------- -void SfxWorkWindow::SetChildWindow_Impl(USHORT nId, BOOL bOn, BOOL bSetFocus) +void SfxWorkWindow::SetChildWindow_Impl(sal_uInt16 nId, sal_Bool bOn, sal_Bool bSetFocus) { SfxChildWin_Impl *pCW=NULL; SfxWorkWindow *pWork = pParent; @@ -2385,8 +2385,8 @@ void SfxWorkWindow::SetChildWindow_Impl(USHORT nId, BOOL bOn, BOOL bSetFocus) if ( pWork ) { // The Parent already known? - USHORT nCount = pWork->pChildWins->Count(); - for (USHORT n=0; n<nCount; n++) + sal_uInt16 nCount = pWork->pChildWins->Count(); + for (sal_uInt16 n=0; n<nCount; n++) if ((*pWork->pChildWins)[n]->nSaveId == nId) { pCW = (*pWork->pChildWins)[n]; @@ -2397,8 +2397,8 @@ void SfxWorkWindow::SetChildWindow_Impl(USHORT nId, BOOL bOn, BOOL bSetFocus) if ( !pCW ) { // If no Parent or the Parent us still unknown, then search here - USHORT nCount = pChildWins->Count(); - for (USHORT n=0; n<nCount; n++) + sal_uInt16 nCount = pChildWins->Count(); + for (sal_uInt16 n=0; n<nCount; n++) if ((*pChildWins)[n]->nSaveId == nId) { pCW = (*pChildWins)[n]; @@ -2424,11 +2424,11 @@ void SfxWorkWindow::SetChildWindow_Impl(USHORT nId, BOOL bOn, BOOL bSetFocus) //-------------------------------------------------------------------- -void SfxWorkWindow::ShowChildWindow_Impl(USHORT nId, BOOL bVisible, BOOL bSetFocus) +void SfxWorkWindow::ShowChildWindow_Impl(sal_uInt16 nId, sal_Bool bVisible, sal_Bool bSetFocus) { - USHORT nCount = pChildWins->Count(); + sal_uInt16 nCount = pChildWins->Count(); SfxChildWin_Impl* pCW=0; - USHORT n; + sal_uInt16 n; for (n=0; n<nCount; n++) { pCW = (*pChildWins)[n]; @@ -2470,14 +2470,14 @@ void SfxWorkWindow::ShowChildWindow_Impl(USHORT nId, BOOL bVisible, BOOL bSetFoc } else if ( bVisible ) { - SetChildWindow_Impl( nId, TRUE, bSetFocus ); + SetChildWindow_Impl( nId, sal_True, bSetFocus ); pChildWin = pCW->pWin; } if ( pChildWin ) { pChildWin->SetVisible_Impl( bVisible ); - USHORT nFlags = pCW->aInfo.nFlags; + sal_uInt16 nFlags = pCW->aInfo.nFlags; pCW->aInfo = pChildWin->GetInfo(); pCW->aInfo.nFlags |= nFlags; if ( !pCW->bCreate ) @@ -2512,10 +2512,10 @@ void SfxWorkWindow::ShowChildWindow_Impl(USHORT nId, BOOL bVisible, BOOL bSetFoc //-------------------------------------------------------------------- -SfxChildWindow* SfxWorkWindow::GetChildWindow_Impl(USHORT nId) +SfxChildWindow* SfxWorkWindow::GetChildWindow_Impl(sal_uInt16 nId) { - USHORT nCount = pChildWins->Count(); - USHORT n; + sal_uInt16 nCount = pChildWins->Count(); + sal_uInt16 n; for (n=0; n<nCount; n++) if ((*pChildWins)[n]->nSaveId == nId) break; @@ -2531,10 +2531,10 @@ SfxChildWindow* SfxWorkWindow::GetChildWindow_Impl(USHORT nId) void SfxWorkWindow::ResetChildWindows_Impl() { - for ( USHORT n = 0; n < pChildWins->Count(); ++n ) + for ( sal_uInt16 n = 0; n < pChildWins->Count(); ++n ) { (*pChildWins)[n]->nId = 0; - (*pChildWins)[n]->bEnable = FALSE; + (*pChildWins)[n]->bEnable = sal_False; } } @@ -2560,14 +2560,14 @@ Rectangle SfxFrameWorkWin_Impl::GetTopRect_Impl() // Virtual method to find out if there is room for a ChildWindow in the // client area of the parent. -BOOL SfxWorkWindow::RequestTopToolSpacePixel_Impl( SvBorder aBorder ) +sal_Bool SfxWorkWindow::RequestTopToolSpacePixel_Impl( SvBorder aBorder ) { if ( !IsDockingAllowed() || aClientArea.GetWidth() < aBorder.Left() + aBorder.Right() || aClientArea.GetHeight() < aBorder.Top() + aBorder.Bottom() ) - return FALSE; + return sal_False; else - return TRUE;; + return sal_True;; } void SfxWorkWindow::SaveStatus_Impl(SfxChildWindow *pChild, const SfxChildWinInfo &rInfo) @@ -2583,7 +2583,7 @@ void SfxWorkWindow::InitializeChild_Impl(SfxChildWin_Impl *pCW) SfxApplication *pApp = SFX_APP(); { SfxChildWinFactArr_Impl &rFactories = pApp->GetChildWinFactories_Impl(); - for ( USHORT nFactory = 0; nFactory < rFactories.Count(); ++nFactory ) + for ( sal_uInt16 nFactory = 0; nFactory < rFactories.Count(); ++nFactory ) { pFact = rFactories[nFactory]; if ( pFact->nId == pCW->nSaveId ) @@ -2592,7 +2592,7 @@ void SfxWorkWindow::InitializeChild_Impl(SfxChildWin_Impl *pCW) SfxChildWindow::InitializeChildWinFactory_Impl( pCW->nSaveId, pCW->aInfo); pCW->bCreate = pCW->aInfo.bVisible; - USHORT nFlags = pFact->aInfo.nFlags; + sal_uInt16 nFlags = pFact->aInfo.nFlags; if ( nFlags & SFX_CHILDWIN_TASK ) pCW->aInfo.nFlags |= SFX_CHILDWIN_TASK; if ( nFlags & SFX_CHILDWIN_CANTGETFOCUS ) @@ -2613,7 +2613,7 @@ void SfxWorkWindow::InitializeChild_Impl(SfxChildWin_Impl *pCW) if ( pFactories ) { SfxChildWinFactArr_Impl &rFactories = *pFactories; - for ( USHORT nFactory = 0; nFactory < rFactories.Count(); ++nFactory ) + for ( sal_uInt16 nFactory = 0; nFactory < rFactories.Count(); ++nFactory ) { pFact = rFactories[nFactory]; if ( pFact->nId == pCW->nSaveId ) @@ -2622,7 +2622,7 @@ void SfxWorkWindow::InitializeChild_Impl(SfxChildWin_Impl *pCW) SfxChildWindow::InitializeChildWinFactory_Impl( pCW->nSaveId, pCW->aInfo); pCW->bCreate = pCW->aInfo.bVisible; - USHORT nFlags = pFact->aInfo.nFlags; + sal_uInt16 nFlags = pFact->aInfo.nFlags; if ( nFlags & SFX_CHILDWIN_TASK ) pCW->aInfo.nFlags |= SFX_CHILDWIN_TASK; if ( nFlags & SFX_CHILDWIN_CANTGETFOCUS ) @@ -2660,7 +2660,7 @@ SfxSplitWindow* SfxWorkWindow::GetSplitWindow_Impl( SfxChildAlignment eAlign ) } } -void SfxWorkWindow::MakeChildsVisible_Impl( BOOL bVis ) +void SfxWorkWindow::MakeChildsVisible_Impl( sal_Bool bVis ) { if ( pParent ) pParent->MakeChildsVisible_Impl( bVis ); @@ -2670,7 +2670,7 @@ void SfxWorkWindow::MakeChildsVisible_Impl( BOOL bVis ) { if ( !bSorted ) Sort_Impl(); - for ( USHORT n=0; n<aSortedList.Count(); ++n ) + for ( sal_uInt16 n=0; n<aSortedList.Count(); ++n ) { SfxChild_Impl* pCli = (*pChilds)[aSortedList[n]]; if ( (pCli->eAlign == SFX_ALIGN_NOALIGNMENT) || (IsDockingAllowed() && bInternalDockingAllowed) ) @@ -2681,7 +2681,7 @@ void SfxWorkWindow::MakeChildsVisible_Impl( BOOL bVis ) { if ( !bSorted ) Sort_Impl(); - for ( USHORT n=0; n<aSortedList.Count(); ++n ) + for ( sal_uInt16 n=0; n<aSortedList.Count(); ++n ) { SfxChild_Impl* pCli = (*pChilds)[aSortedList[n]]; pCli->nVisible &= ~CHILD_ACTIVE; @@ -2689,14 +2689,14 @@ void SfxWorkWindow::MakeChildsVisible_Impl( BOOL bVis ) } } -BOOL SfxWorkWindow::IsAutoHideMode( const SfxSplitWindow *pSplitWin ) +sal_Bool SfxWorkWindow::IsAutoHideMode( const SfxSplitWindow *pSplitWin ) { - for ( USHORT n=0; n<SFX_SPLITWINDOWS_MAX; n++ ) + for ( sal_uInt16 n=0; n<SFX_SPLITWINDOWS_MAX; n++ ) { - if ( pSplit[n] != pSplitWin && pSplit[n]->IsAutoHide( TRUE ) ) - return TRUE; + if ( pSplit[n] != pSplitWin && pSplit[n]->IsAutoHide( sal_True ) ) + return sal_True; } - return FALSE; + return sal_False; } @@ -2705,7 +2705,7 @@ void SfxWorkWindow::EndAutoShow_Impl( Point aPos ) if ( pParent ) pParent->EndAutoShow_Impl( aPos ); - for ( USHORT n=0; n<SFX_SPLITWINDOWS_MAX; n++ ) + for ( sal_uInt16 n=0; n<SFX_SPLITWINDOWS_MAX; n++ ) { SfxSplitWindow *p = pSplit[n]; if ( p && p->IsAutoHide() ) @@ -2728,14 +2728,14 @@ void SfxWorkWindow::ArrangeAutoHideWindows( SfxSplitWindow *pActSplitWin ) pParent->ArrangeAutoHideWindows( pActSplitWin ); Rectangle aArea( aUpperClientArea ); - for ( USHORT n=0; n<SFX_SPLITWINDOWS_MAX; n++ ) + for ( sal_uInt16 n=0; n<SFX_SPLITWINDOWS_MAX; n++ ) { // Either dummy window or window in the auto-show-mode are processed // (not pinned, FadeIn). // Only the abandoned window may be invisible, because perhaps its // size is just beeing calculated before it is displayed. SfxSplitWindow* pSplitWin = pSplit[n]; - BOOL bDummyWindow = !pSplitWin->IsFadeIn(); + sal_Bool bDummyWindow = !pSplitWin->IsFadeIn(); Window *pDummy = pSplitWin->GetSplitWindow(); Window *pWin = bDummyWindow ? pDummy : pSplitWin; if ( (pSplitWin->IsPinned() && !bDummyWindow) || (!pWin->IsVisible() && pActSplitWin != pSplitWin) ) @@ -2847,12 +2847,12 @@ void SfxWorkWindow::ArrangeAutoHideWindows( SfxSplitWindow *pActSplitWin ) } } -Rectangle SfxWorkWindow::GetFreeArea( BOOL bAutoHide ) const +Rectangle SfxWorkWindow::GetFreeArea( sal_Bool bAutoHide ) const { if ( bAutoHide ) { Rectangle aArea( aClientArea ); - for ( USHORT n=0; n<SFX_SPLITWINDOWS_MAX; n++ ) + for ( sal_uInt16 n=0; n<SFX_SPLITWINDOWS_MAX; n++ ) { if ( pSplit[n]->IsPinned() || !pSplit[n]->IsVisible() ) continue; @@ -2881,7 +2881,7 @@ Rectangle SfxWorkWindow::GetFreeArea( BOOL bAutoHide ) const return aClientArea; } -SfxChildWinController_Impl::SfxChildWinController_Impl( USHORT nID, SfxWorkWindow *pWork ) +SfxChildWinController_Impl::SfxChildWinController_Impl( sal_uInt16 nID, SfxWorkWindow *pWork ) : SfxControllerItem( nID, pWork->GetBindings() ) , pWorkwin( pWork ) {} @@ -2892,15 +2892,15 @@ SfxChildWinController_Impl::SfxChildWinController_Impl( USHORT nID, SfxWorkWindo } void SfxChildWinController_Impl::StateChanged( - USHORT nSID, SfxItemState eState, const SfxPoolItem* ) + sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* ) { pWorkwin->DisableChildWindow_Impl( nSID, eState == SFX_ITEM_DISABLED ); } -void SfxWorkWindow::DisableChildWindow_Impl( USHORT nId, BOOL bDisable ) +void SfxWorkWindow::DisableChildWindow_Impl( sal_uInt16 nId, sal_Bool bDisable ) { - USHORT nCount = pChildWins->Count(); - USHORT n; + sal_uInt16 nCount = pChildWins->Count(); + sal_uInt16 n; for (n=0; n<nCount; n++) if ((*pChildWins)[n]->nSaveId == nId) break; @@ -2923,16 +2923,16 @@ Window* SfxWorkWindow::GetActiveChild_Impl() return pActiveChild; } -BOOL SfxWorkWindow::ActivateNextChild_Impl( BOOL bForward ) +sal_Bool SfxWorkWindow::ActivateNextChild_Impl( sal_Bool bForward ) { // Sort all children under list SvUShorts aList; - for ( USHORT i=SFX_OBJECTBAR_MAX; i<pChilds->Count(); i++) + for ( sal_uInt16 i=SFX_OBJECTBAR_MAX; i<pChilds->Count(); i++) { SfxChild_Impl *pCli = (*pChilds)[i]; if ( pCli && pCli->bCanGetFocus && pCli->pWin ) { - USHORT k; + sal_uInt16 k; for (k=0; k<aList.Count(); k++) if ( ChildTravelValue((*pChilds)[aList[k]]->eAlign) > ChildTravelValue(pCli->eAlign) ) break; @@ -2941,17 +2941,17 @@ BOOL SfxWorkWindow::ActivateNextChild_Impl( BOOL bForward ) } if ( aList.Count() == 0 ) - return FALSE; + return sal_False; - USHORT nTopValue = ChildTravelValue( SFX_ALIGN_LOWESTTOP ); - for ( USHORT i=0; i<aList.Count(); i++ ) + sal_uInt16 nTopValue = ChildTravelValue( SFX_ALIGN_LOWESTTOP ); + for ( sal_uInt16 i=0; i<aList.Count(); i++ ) { SfxChild_Impl* pCli = (*pChilds)[aList[i]]; if ( pCli->pWin && ChildTravelValue( pCli->eAlign ) > nTopValue ) break; } - USHORT n = bForward ? 0 : aList.Count()-1; + sal_uInt16 n = bForward ? 0 : aList.Count()-1; SfxChild_Impl *pAct=NULL; if ( pActiveChild ) { @@ -2973,14 +2973,14 @@ BOOL SfxWorkWindow::ActivateNextChild_Impl( BOOL bForward ) n = n + 1; if ( pAct ) { - for ( USHORT i=0; i<SFX_SPLITWINDOWS_MAX; i++ ) + for ( sal_uInt16 i=0; i<SFX_SPLITWINDOWS_MAX; i++ ) { // Maybe the pNext is a Splitwindow SfxSplitWindow *p = pSplit[i]; if ( pAct->pWin == p ) { if( p->ActivateNextChild_Impl( bForward ) ) - return TRUE; + return sal_True; break; } } @@ -2993,7 +2993,7 @@ BOOL SfxWorkWindow::ActivateNextChild_Impl( BOOL bForward ) n = n-1; if ( n == 0 || n == aList.Count()-1 ) - return FALSE; + return sal_False; } for( ;; ) @@ -3002,7 +3002,7 @@ BOOL SfxWorkWindow::ActivateNextChild_Impl( BOOL bForward ) if ( pCli->pWin ) { SfxChild_Impl* pNext = pCli; - for ( USHORT i=0; n<SFX_SPLITWINDOWS_MAX; n++ ) + for ( sal_uInt16 i=0; n<SFX_SPLITWINDOWS_MAX; n++ ) { // Maybe the pNext is a Splitwindow SfxSplitWindow *p = pSplit[i]; @@ -3012,7 +3012,7 @@ BOOL SfxWorkWindow::ActivateNextChild_Impl( BOOL bForward ) p->SetActiveWindow_Impl( NULL ); pNext = NULL; if( p->ActivateNextChild_Impl( bForward ) ) - return TRUE; + return sal_True; break; } } @@ -3021,7 +3021,7 @@ BOOL SfxWorkWindow::ActivateNextChild_Impl( BOOL bForward ) { pNext->pWin->GrabFocus(); pActiveChild = pNext->pWin; - return TRUE; + return sal_True; } } @@ -3034,17 +3034,17 @@ BOOL SfxWorkWindow::ActivateNextChild_Impl( BOOL bForward ) break; } - return FALSE; + return sal_False; } -void SfxWorkWindow::SetObjectBarCustomizeMode_Impl( BOOL ) +void SfxWorkWindow::SetObjectBarCustomizeMode_Impl( sal_Bool ) { } void SfxWorkWindow::DataChanged_Impl( const DataChangedEvent& ) { - USHORT n; - USHORT nCount = pChildWins->Count(); + sal_uInt16 n; + sal_uInt16 nCount = pChildWins->Count(); for (n=0; n<nCount; n++) { SfxChildWin_Impl*pCW = (*pChildWins)[n]; diff --git a/sfx2/source/appl/xpackcreator.cxx b/sfx2/source/appl/xpackcreator.cxx index 17a27c6c8ce9..17a27c6c8ce9 100644..100755 --- a/sfx2/source/appl/xpackcreator.cxx +++ b/sfx2/source/appl/xpackcreator.cxx diff --git a/sfx2/source/appl/xpackcreator.hxx b/sfx2/source/appl/xpackcreator.hxx index 03ef58e27e03..03ef58e27e03 100644..100755 --- a/sfx2/source/appl/xpackcreator.hxx +++ b/sfx2/source/appl/xpackcreator.hxx |