diff options
Diffstat (limited to 'fpicker/source/office/iodlg.cxx')
-rw-r--r-- | fpicker/source/office/iodlg.cxx | 48 |
1 files changed, 17 insertions, 31 deletions
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index 67388582b7..b11e8dacd8 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -1,10 +1,11 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2000, 2010 Oracle and/or its affiliates. * - * OpenOffice.org - a multi-platform office productivity suite + * Copyright 2000, 2010 Oracle and/or its affiliates. * * This file is part of OpenOffice.org. * @@ -29,7 +30,7 @@ #include "precompiled_fpicker.hxx" // includes -------------------------------------------------------------- - +#include <sal/macros.h> #include "iodlg.hxx" #include <tools/stream.hxx> #include <tools/urlobj.hxx> @@ -56,24 +57,16 @@ #include <toolkit/helper/vclunohelper.hxx> #include <unotools/localfilehelper.hxx> -#ifndef _SVTOOLS_HRC #include "svtools/svtools.hrc" -#endif -#ifndef _SVT_HELPID_HRC #include "svtools/helpid.hrc" -#endif -#ifndef _SVTOOLS_IODLGIMPL_HRC #include "iodlg.hrc" -#endif #include "rtl/instance.hxx" #include "asyncfilepicker.hxx" #include "iodlgimp.hxx" #include "svtools/inettbc.hxx" #include "unotools/syslocale.hxx" #include "svtools/QueryFolderName.hxx" -#ifndef _RTL_USTRING_HXX #include <rtl/ustring.hxx> -#endif #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/ucb/XContentProviderManager.hpp> #include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp> @@ -89,9 +82,7 @@ #include <com/sun/star/uno/RuntimeException.hpp> #include <com/sun/star/beans/XPropertySet.hpp> -#ifndef _UNOTOOLS_PROCESSFACTORY_HXX #include <comphelper/processfactory.hxx> -#endif #include <osl/file.h> #include <vcl/waitobj.hxx> @@ -530,7 +521,7 @@ SvtFileDialog::~SvtFileDialog() SvtViewOptions aDlgOpt( E_DIALOG, _pImp->_aIniKey ); aDlgOpt.SetWindowState( String( GetWindowState(), osl_getThreadTextEncoding() ) ); String sUserData = _pFileView->GetConfigString(); - aDlgOpt.SetUserItem( ::rtl::OUString::createFromAscii( "UserData" ), + aDlgOpt.SetUserItem( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "UserData" )), makeAny( ::rtl::OUString( sUserData ) ) ); } @@ -557,8 +548,7 @@ void SvtFileDialog::Init_Impl WinBits nStyle ) { - sal_Bool bIsHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); - m_aImages = ImageList( SvtResId( bIsHighContrast ? RID_FILEPICKER_IMAGES_HC : RID_FILEPICKER_IMAGES ) ); + m_aImages = ImageList( SvtResId( RID_FILEPICKER_IMAGES ) ); _pImp->_nStyle = nStyle; _pImp->_a6Size = LogicToPixel( Size( 6, 6 ), MAP_APPFONT ); @@ -2072,7 +2062,7 @@ short SvtFileDialog::PrepareExecute() { rtl::OUString aEnvValue; if ( getEnvironmentValue( "WorkDirMustContainRemovableMedia", aEnvValue ) && - aEnvValue.equalsAscii( "1" ) ) + aEnvValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "1" ) ) ) { try { @@ -2081,8 +2071,8 @@ short SvtFileDialog::PrepareExecute() INetURLObject::NO_DECODE ) ), Reference< XCommandEnvironment >() ); Sequence< rtl::OUString > aProps(2); - aProps[0] = rtl::OUString::createFromAscii( "IsVolume" ); - aProps[1] = rtl::OUString::createFromAscii( "IsRemoveable" ); + aProps[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "IsVolume" )); + aProps[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "IsRemoveable" )); Reference< XResultSet > xResultSet = aCnt.createCursor( aProps, ::ucbhelper::INCLUDE_FOLDERS_ONLY ); @@ -2512,7 +2502,7 @@ void SvtFileDialog::InitSize() { SetWindowState( ByteString( String( aDlgOpt.GetWindowState() ), osl_getThreadTextEncoding() ) ); - Any aUserData = aDlgOpt.GetUserItem( ::rtl::OUString::createFromAscii( "UserData" ) ); + Any aUserData = aDlgOpt.GetUserItem( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "UserData" ) )); ::rtl::OUString sCfgStr; if ( aUserData >>= sCfgStr ) _pFileView->SetConfigString( String( sCfgStr ) ); @@ -2580,7 +2570,7 @@ void SvtFileDialog::implArrangeControls() // loop through all these controls and adjust the z-order Window* pPreviousWin = NULL; Control** pCurrent = pControls; - for ( sal_Int32 i = 0; i < sal_Int32(sizeof( pControls ) / sizeof( pControls[ 0 ] )); ++i, ++pCurrent ) + for ( sal_Int32 i = 0; i < sal_Int32(SAL_N_ELEMENTS( pControls )); ++i, ++pCurrent ) { if ( !*pCurrent ) // this control is not available in the current operation mode -> skip @@ -2681,11 +2671,7 @@ BOOL SvtFileDialog::IsolateFilterFromPath_Impl( String& rPath, String& rFilter ) //----------------------------------------------------------------------------- void SvtFileDialog::implUpdateImages( ) { - // determine high contrast mode - { - sal_Bool bIsHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); - m_aImages = ImageList( SvtResId( bIsHighContrast ? RID_FILEPICKER_IMAGES_HC : RID_FILEPICKER_IMAGES ) ); - } + m_aImages = ImageList( SvtResId( RID_FILEPICKER_IMAGES ) ); // set the appropriate images on the buttons if ( _pImp->_pBtnUp ) @@ -2760,7 +2746,7 @@ void SvtFileDialog::Resize() _pPbPlay, _pImp->_pCbPassword, _pImp->_pCbAutoExtension, _pImp->_pCbOptions, _pCbSelection }; Control** ppMoveControls = aMoveControlsVert; - Control** ppMoveControlsEnd = ppMoveControls + sizeof( aMoveControlsVert ) / sizeof( aMoveControlsVert[0] ); + Control** ppMoveControlsEnd = ppMoveControls + SAL_N_ELEMENTS( aMoveControlsVert ); for ( ; ppMoveControls != ppMoveControlsEnd; ++ppMoveControls ) lcl_MoveControl( *ppMoveControls, 0, nDeltaY ); } @@ -2772,7 +2758,7 @@ void SvtFileDialog::Resize() _pImp->_pBtnFileOpen, _pImp->_pBtnCancel, _pImp->_pBtnHelp }; Control** ppMoveControls = aMoveControlsBoth; - Control** ppMoveControlsEnd = ppMoveControls + sizeof( aMoveControlsBoth ) / sizeof( aMoveControlsBoth[0] ); + Control** ppMoveControlsEnd = ppMoveControls + SAL_N_ELEMENTS( aMoveControlsBoth ); for ( ; ppMoveControls != ppMoveControlsEnd; ++ppMoveControls ) lcl_MoveControl( *ppMoveControls, nDeltaX, nDeltaY ); } @@ -2784,7 +2770,7 @@ void SvtFileDialog::Resize() _pImp->_pBtnUp, _pImp->_pBtnNewFolder, _pImp->_pBtnStandard }; Control** ppMoveControls = aMoveControlsHor; - Control** ppMoveControlsEnd = ppMoveControls + sizeof( aMoveControlsHor ) / sizeof( aMoveControlsHor[0] ); + Control** ppMoveControlsEnd = ppMoveControls + SAL_N_ELEMENTS( aMoveControlsHor ); for ( ; ppMoveControls != ppMoveControlsEnd; ++ppMoveControls ) lcl_MoveControl( *ppMoveControls, nDeltaX, 0 ); } @@ -2797,7 +2783,7 @@ void SvtFileDialog::Resize() _pImp->_pEdFileName, _pImp->_pLbFileVersion, _pImp->_pLbTemplates, _pImp->_pLbImageTemplates, _pImp->GetFilterListControl(), _pImp->_pFtCurrentPath, }; - sal_Int32 nSizeControls = sizeof( aSizeControls ) / sizeof( aSizeControls[0] ); + sal_Int32 nSizeControls = SAL_N_ELEMENTS( aSizeControls ); Control** ppSizeControls = aSizeControls; for ( sal_Int32 j=0; j<nSizeControls; ++j, ++ppSizeControls ) { @@ -3273,7 +3259,6 @@ BOOL SvtFileDialog::AddControl( Window* pControl, BOOL bNewLine ) Point aNewControlPos; Size* pNewDlgSize = NULL; BOOL bNewRow = bNewLine; - FASTBOOL bFirstNewRow = FALSE; if ( nType == WINDOW_WINDOW ) { @@ -3306,7 +3291,6 @@ BOOL SvtFileDialog::AddControl( Window* pControl, BOOL bNewLine ) { // Create a new row if there was no usercontrol before. bNewRow = TRUE; - bFirstNewRow = TRUE; } // Check if a new row has to be created. @@ -3480,3 +3464,5 @@ IMPL_LINK( QueryFolderNameDialog, NameHdl, Edit *, EMPTYARG ) } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |