diff options
author | Uray M. János <uray.janos@gmail.com> | 2012-08-07 08:36:40 +0200 |
---|---|---|
committer | Tor Lillqvist <tlillqvist@suse.com> | 2012-08-07 11:01:01 +0300 |
commit | 13b9c0513319623fd56a5a0ead5bdddecf90a10f (patch) | |
tree | 0e20a62643c2c44023222bcc63b451c7c4b6947a /basctl/source/basicide/baside3.cxx | |
parent | 67f688b97aa5afde455674dbe28297a89d817503 (diff) |
IDE: sal_Bool to bool
Convert all occurences of sal_Bool, sal_True and sal_False in basctl
to bool, true and false -- except in prototypes of virtual function
overrides. (The virtual functions that are internal to basctl can be
and was converted.) Note that since sal_Bool and bool are implicitly
convertible to each other, for functions that take a sal_Bool (by
value), true and false can be given too.
Change-Id: Ie44740fa87f89e9fedd913840ca2b38e95e6b957
Diffstat (limited to 'basctl/source/basicide/baside3.cxx')
-rw-r--r-- | basctl/source/basicide/baside3.cxx | 52 |
1 files changed, 19 insertions, 33 deletions
diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx index 6083fbd30cb6..adf4581e9ecd 100644 --- a/basctl/source/basicide/baside3.cxx +++ b/basctl/source/basicide/baside3.cxx @@ -92,10 +92,10 @@ DialogWindow::DialogWindow( Window* pParent, const ScriptDocument& rDocument, :: // set readonly mode for readonly libraries Reference< script::XLibraryContainer2 > xDlgLibContainer( GetDocument().getLibraryContainer( E_DIALOGS ), UNO_QUERY ); if ( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aLibName ) && xDlgLibContainer->isLibraryReadOnly( aLibName ) ) - SetReadOnly( sal_True ); + SetReadOnly(true); if ( rDocument.isDocument() && rDocument.isReadOnly() ) - SetReadOnly( sal_True ); + SetReadOnly(true); } DialogWindow::~DialogWindow() @@ -311,13 +311,9 @@ void DialogWindow::GetState( SfxItemSet& rSet ) case SID_DIALOG_TESTMODE: { // is the IDE still active? - if( BasicIDEGlobals::GetShell()->GetFrame() ) - { - rSet.Put( SfxBoolItem( SID_DIALOG_TESTMODE, - (pEditor->GetMode() == DLGED_TEST) ? sal_True : sal_False) ); - } - else - rSet.Put( SfxBoolItem( SID_DIALOG_TESTMODE,sal_False )); + bool const bBool = BasicIDEGlobals::GetShell()->GetFrame() && + pEditor->GetMode() == DLGED_TEST; + rSet.Put(SfxBoolItem(SID_DIALOG_TESTMODE, bBool)); } break; @@ -709,9 +705,9 @@ bool DialogWindow::SaveDialog() } Reference< XFilePickerControlAccess > xFPControl(xFP, UNO_QUERY); - xFPControl->enableControl(ExtendedFilePickerElementIds::CHECKBOX_PASSWORD, sal_False); + xFPControl->enableControl(ExtendedFilePickerElementIds::CHECKBOX_PASSWORD, false); Any aValue; - aValue <<= (sal_Bool) sal_True; + aValue <<= sal_True; xFPControl->setValue(ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION, 0, aValue); if ( !aCurPath.isEmpty() ) @@ -796,7 +792,7 @@ bool DialogWindow::SaveDialog() ::rtl::OUString aDialogName( aURLObj.getName() ); aURLObj.removeSegment(); ::rtl::OUString aURL( aURLObj.GetMainURL( INetURLObject::NO_DECODE ) ); - sal_Bool bReadOnly = sal_False; + bool bReadOnly = false; ::rtl::OUString aComment( RTL_CONSTASCII_USTRINGPARAM( "# " )); aComment += aDialogName; aComment += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " strings" )); @@ -971,9 +967,9 @@ bool implImportDialog( Window* pWin, const ::rtl::OUString& rCurPath, const Scri } Reference< XFilePickerControlAccess > xFPControl(xFP, UNO_QUERY); - xFPControl->enableControl(ExtendedFilePickerElementIds::CHECKBOX_PASSWORD, sal_False); + xFPControl->enableControl(ExtendedFilePickerElementIds::CHECKBOX_PASSWORD, false); Any aValue; - aValue <<= (sal_Bool) sal_True; + aValue <<= sal_True; xFPControl->setValue(ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION, 0, aValue); ::rtl::OUString aCurPath( rCurPath ); @@ -1088,7 +1084,7 @@ bool implImportDialog( Window* pWin, const ::rtl::OUString& rCurPath, const Scri Sequence< lang::Locale > aImportLocaleSeq = xImportStringResource->getLocales(); sal_Int32 nImportLocaleCount = aImportLocaleSeq.getLength(); - Reference< container::XNameContainer > xDialogLib( rDocument.getLibrary( E_DIALOGS, aLibName, sal_True ) ); + Reference< container::XNameContainer > xDialogLib( rDocument.getLibrary( E_DIALOGS, aLibName, true ) ); Reference< resource::XStringResourceManager > xLibStringResourceManager = LocalizationMgr::getStringResourceFromDialogLibrary( xDialogLib ); sal_Int32 nLibLocaleCount = 0; Sequence< lang::Locale > aLibLocaleSeq; @@ -1280,7 +1276,7 @@ DlgEdView* DialogWindow::GetView() const return pEditor ? pEditor->GetView() : NULL; } -sal_Bool DialogWindow::IsModified() +bool DialogWindow::IsModified() { return pEditor->IsModified(); } @@ -1304,30 +1300,20 @@ BasicEntryDescriptor DialogWindow::CreateEntryDescriptor() return BasicEntryDescriptor( aDocument, eLocation, aLibName, aLibSubName, GetName(), OBJ_TYPE_DIALOG ); } -void DialogWindow::SetReadOnly( sal_Bool b ) +void DialogWindow::SetReadOnly (bool bReadOnly) { - if ( pEditor ) - { - if ( b ) - pEditor->SetMode( DLGED_READONLY ); - else - pEditor->SetMode( DLGED_SELECT ); - } + if (pEditor) + pEditor->SetMode(bReadOnly ? DLGED_READONLY : DLGED_SELECT); } -sal_Bool DialogWindow::IsReadOnly() +bool DialogWindow::IsReadOnly () { - sal_Bool bReadOnly = sal_False; - - if ( pEditor && pEditor->GetMode() == DLGED_READONLY ) - bReadOnly = sal_True; - - return bReadOnly; + return pEditor && pEditor->GetMode() == DLGED_READONLY; } -sal_Bool DialogWindow::IsPasteAllowed() +bool DialogWindow::IsPasteAllowed() { - return pEditor ? pEditor->IsPasteAllowed() : sal_False; + return pEditor && pEditor->IsPasteAllowed(); } void DialogWindow::StoreData() |