Kaydet (Commit) 17dcf76e authored tarafından Noel Grandin's avatar Noel Grandin

vbahelper: sal_Bool->bool

Change-Id: Ibf21ce17a8e743701f1011e1620f26b93f952991
üst 7ae4102f
......@@ -64,7 +64,7 @@ ScVbaCheckbox::setValue( const uno::Any& _value ) throw (css::uno::RuntimeExcept
m_xProps->getPropertyValue( "State" ) >>= nOldValue;
if( !( _value >>= nValue ) )
{
sal_Bool bValue = false;
bool bValue = false;
_value >>= bValue;
if ( bValue )
nValue = -1;
......
......@@ -177,7 +177,7 @@ void ScVbaControl::removeResouce() throw( uno::RuntimeException )
sal_Bool SAL_CALL ScVbaControl::getEnabled() throw (uno::RuntimeException, std::exception)
{
uno::Any aValue = m_xProps->getPropertyValue ( "Enabled" );
sal_Bool bRet = false;
bool bRet = false;
aValue >>= bRet;
return bRet;
}
......@@ -191,7 +191,7 @@ void SAL_CALL ScVbaControl::setEnabled( sal_Bool bVisible ) throw (uno::RuntimeE
sal_Bool SAL_CALL ScVbaControl::getVisible() throw (uno::RuntimeException, std::exception)
{
sal_Bool bVisible( sal_True );
bool bVisible( true );
m_xProps->getPropertyValue ( "EnableVisible" ) >>= bVisible;
uno::Reference< drawing::XControlShape > xControlShape( m_xControl, uno::UNO_QUERY );
if ( xControlShape.is() )
......@@ -618,7 +618,7 @@ void SAL_CALL ScVbaControl::setTabIndex( sal_Int32 /*nTabIndex*/ ) throw (uno::R
return new ScVbaComboBox( xVbaParent, xContext, xControlShape, xModel, xGeoHelper.release() );
case form::FormComponentType::COMMANDBUTTON:
{
sal_Bool bToggle = sal_False;
bool bToggle = false;
xProps->getPropertyValue( "Toggle" ) >>= bToggle;
if ( bToggle )
return new ScVbaToggleButton( xVbaParent, xContext, xControlShape, xModel, xGeoHelper.release() );
......@@ -666,7 +666,7 @@ void SAL_CALL ScVbaControl::setTabIndex( sal_Int32 /*nTabIndex*/ ) throw (uno::R
xVBAControl.set( new ScVbaTextBox( xVbaParent, xContext, xControl, xModel, xGeoHelper.release(), true ) );
else if ( xServiceInfo->supportsService( "com.sun.star.awt.UnoControlButtonModel" ) )
{
sal_Bool bToggle = sal_False;
bool bToggle = false;
xProps->getPropertyValue( "Toggle" ) >>= bToggle;
if ( bToggle )
xVBAControl.set( new ScVbaToggleButton( xVbaParent, xContext, xControl, xModel, xGeoHelper.release() ) );
......@@ -740,7 +740,7 @@ void ScVbaControl::setBackColor( sal_Int32 nBackColor ) throw (uno::RuntimeExcep
m_xProps->setPropertyValue( "BackgroundColor" , uno::makeAny( XLRGBToOORGB( nBackColor ) ) );
}
sal_Bool ScVbaControl::getAutoSize() throw (uno::RuntimeException)
bool ScVbaControl::getAutoSize() throw (uno::RuntimeException)
{
bool bIsResizeEnabled = false;
uno::Reference< uno::XInterface > xIf( m_xControl, uno::UNO_QUERY_THROW );
......@@ -751,7 +751,7 @@ sal_Bool ScVbaControl::getAutoSize() throw (uno::RuntimeException)
}
// currently no implementation for this
void ScVbaControl::setAutoSize( sal_Bool bAutoSize ) throw (uno::RuntimeException)
void ScVbaControl::setAutoSize( bool bAutoSize ) throw (uno::RuntimeException)
{
uno::Reference< uno::XInterface > xIf( m_xControl, uno::UNO_QUERY_THROW );
SdrObject* pObj = SdrObject::getSdrObjectFromXShape( xIf );
......@@ -759,14 +759,14 @@ void ScVbaControl::setAutoSize( sal_Bool bAutoSize ) throw (uno::RuntimeExceptio
pObj->SetResizeProtect( !bAutoSize );
}
sal_Bool ScVbaControl::getLocked() throw (uno::RuntimeException)
bool ScVbaControl::getLocked() throw (uno::RuntimeException)
{
sal_Bool bRes( sal_False );
bool bRes( false );
m_xProps->getPropertyValue( "ReadOnly" ) >>= bRes;
return bRes;
}
void ScVbaControl::setLocked( sal_Bool bLocked ) throw (uno::RuntimeException)
void ScVbaControl::setLocked( bool bLocked ) throw (uno::RuntimeException)
{
m_xProps->setPropertyValue( "ReadOnly" , uno::makeAny( bLocked ) );
}
......
......@@ -111,10 +111,10 @@ public:
//controls
sal_Int32 getBackColor() throw (css::uno::RuntimeException);
void setBackColor( sal_Int32 nBackColor ) throw (css::uno::RuntimeException);
sal_Bool getAutoSize() throw (css::uno::RuntimeException);
void setAutoSize( sal_Bool bAutoSize ) throw (css::uno::RuntimeException);
sal_Bool getLocked() throw (css::uno::RuntimeException);
void setLocked( sal_Bool bAutoSize ) throw (css::uno::RuntimeException);
bool getAutoSize() throw (css::uno::RuntimeException);
void setAutoSize( bool bAutoSize ) throw (css::uno::RuntimeException);
bool getLocked() throw (css::uno::RuntimeException);
void setLocked( bool bAutoSize ) throw (css::uno::RuntimeException);
};
......
......@@ -119,7 +119,7 @@ ScVbaListBox::setText( const OUString& _text ) throw (uno::RuntimeException, std
sal_Int32 SAL_CALL
ScVbaListBox::getMultiSelect() throw (css::uno::RuntimeException, std::exception)
{
sal_Bool bMultiSelect = sal_False;
bool bMultiSelect = false;
m_xProps->getPropertyValue( "MultiSelection" ) >>= bMultiSelect;
return bMultiSelect ? msforms::fmMultiSelect::fmMultiSelectMulti : msforms::fmMultiSelect::fmMultiSelectSingle;
......@@ -128,15 +128,15 @@ ScVbaListBox::getMultiSelect() throw (css::uno::RuntimeException, std::exception
void SAL_CALL
ScVbaListBox::setMultiSelect( sal_Int32 _multiselect ) throw (css::uno::RuntimeException, std::exception)
{
sal_Bool bBoolVal = false;
bool bBoolVal = false;
switch ( _multiselect )
{
case msforms::fmMultiSelect::fmMultiSelectMulti:
case msforms::fmMultiSelect::fmMultiSelectExtended:
bBoolVal = sal_True;
bBoolVal = true;
break;
case msforms::fmMultiSelect::fmMultiSelectSingle:
bBoolVal = sal_False;
bBoolVal = false;
break;
default:
throw lang::IllegalArgumentException();
......@@ -187,7 +187,7 @@ ScVbaListBox::Clear( ) throw (uno::RuntimeException, std::exception)
void
ScVbaListBox::setValueEvent( const uno::Any& value )
{
sal_Bool bValue = sal_False;
bool bValue = false;
if( !(value >>= bValue) )
throw uno::RuntimeException( "Invalid type\n. need boolean." , uno::Reference< uno::XInterface >() );
uno::Sequence< sal_Int16 > nList;
......
......@@ -65,7 +65,7 @@ ScVbaRadioButton::setValue( const uno::Any& _value ) throw (uno::RuntimeExceptio
if( !( _value >>= nValue ) )
{
sal_Bool bValue = sal_False;
bool bValue = false;
_value >>= bValue;
if ( bValue )
nValue = -1;
......
......@@ -94,7 +94,7 @@ ScVbaTextBox::getMultiline() throw (css::uno::RuntimeException, std::exception)
{
uno::Any aValue;
aValue = m_xProps->getPropertyValue( "MultiLine" );
sal_Bool bRet = false;
bool bRet = false;
aValue >>= bRet;
return bRet;
}
......
......@@ -64,7 +64,7 @@ ScVbaToggleButton::setValue( const uno::Any& _value ) throw (uno::RuntimeExcepti
sal_Int16 nState = 0;
if ( ! ( _value >>= nState ) )
{
sal_Bool bState = false;
bool bState = false;
_value >>= bState;
if ( bState )
nState = -1;
......
......@@ -150,9 +150,9 @@ typedef ::boost::unordered_map< VbaTimerInfo, VbaTimer*, VbaTimerInfoHash, ::std
struct VbaApplicationBase_Impl
{
VbaTimerHashMap m_aTimerHash;
sal_Bool mbVisible;
bool mbVisible;
inline VbaApplicationBase_Impl() : mbVisible( sal_True ) {}
inline VbaApplicationBase_Impl() : mbVisible( true ) {}
virtual ~VbaApplicationBase_Impl()
{
......@@ -364,7 +364,7 @@ void SAL_CALL VbaApplicationBase::OnTime( const uno::Any& aEarliestTime, const O
|| ( aLatestTime.hasValue() && !( aLatestTime >>= nLatestTime ) ) )
throw uno::RuntimeException( "Only double is supported as time for now!" , uno::Reference< uno::XInterface >() );
sal_Bool bSetTimer = sal_True;
bool bSetTimer = true;
aSchedule >>= bSetTimer;
VbaTimerInfo aTimerIndex( aFunction, ::std::pair< double, double >( nEarliestTime, nLatestTime ) );
......
......@@ -143,7 +143,7 @@ void VbaCommandBarHelper::removeSettings( const OUString& sResourceUrl ) throw (
// persistChanges();
}
void VbaCommandBarHelper::ApplyChange( const OUString& sResourceUrl, const css::uno::Reference< css::container::XIndexAccess >& xSettings, sal_Bool bTemporary ) throw (css::uno::RuntimeException)
void VbaCommandBarHelper::ApplyChange( const OUString& sResourceUrl, const css::uno::Reference< css::container::XIndexAccess >& xSettings, bool bTemporary ) throw (css::uno::RuntimeException)
{
if( m_xDocCfgMgr->hasSettings( sResourceUrl ) )
{
......@@ -159,14 +159,14 @@ void VbaCommandBarHelper::ApplyChange( const OUString& sResourceUrl, const css::
}
}
sal_Bool VbaCommandBarHelper::persistChanges() throw (css::uno::RuntimeException)
bool VbaCommandBarHelper::persistChanges() throw (css::uno::RuntimeException)
{
uno::Reference< css::ui::XUIConfigurationPersistence > xConfigPersistence( m_xDocCfgMgr, uno::UNO_QUERY_THROW );
sal_Bool result = sal_False;
bool result = false;
if( xConfigPersistence->isModified() )
{
xConfigPersistence->store();
result = sal_True;
result = true;
}
return result;
}
......@@ -179,7 +179,7 @@ uno::Reference< frame::XLayoutManager > VbaCommandBarHelper::getLayoutManager()
return xLayoutManager;
}
sal_Bool VbaCommandBarHelper::hasToolbar( const OUString& sResourceUrl, const OUString& sName ) throw (css::uno::RuntimeException)
bool VbaCommandBarHelper::hasToolbar( const OUString& sResourceUrl, const OUString& sName ) throw (css::uno::RuntimeException)
{
if( m_xDocCfgMgr->hasSettings( sResourceUrl ) )
{
......@@ -187,9 +187,9 @@ sal_Bool VbaCommandBarHelper::hasToolbar( const OUString& sResourceUrl, const OU
uno::Reference< beans::XPropertySet > xPropertySet( m_xDocCfgMgr->getSettings( sResourceUrl, sal_False ), uno::UNO_QUERY_THROW );
xPropertySet->getPropertyValue( ITEM_DESCRIPTOR_UINAME ) >>= sUIName;
if( sName.equalsIgnoreAsciiCase( sUIName ) )
return sal_True;
return true;
}
return sal_False;
return false;
}
// return the resource url if found
......
......@@ -60,7 +60,7 @@ private:
OUString maModuleId;
void Init() throw (css::uno::RuntimeException);
sal_Bool hasToolbar( const OUString& sResourceUrl, const OUString& sName ) throw (css::uno::RuntimeException);
bool hasToolbar( const OUString& sResourceUrl, const OUString& sName ) throw (css::uno::RuntimeException);
public:
VbaCommandBarHelper( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::frame::XModel >& xModel ) throw( css::uno::RuntimeException );
......@@ -78,10 +78,10 @@ public:
{
return m_xWindowState;
}
sal_Bool persistChanges() throw (css::uno::RuntimeException);
bool persistChanges() throw (css::uno::RuntimeException);
css::uno::Reference< css::container::XIndexAccess > getSettings( const OUString& sResourceUrl ) throw (css::uno::RuntimeException);
void removeSettings( const OUString& sResourceUrl ) throw (css::uno::RuntimeException);
void ApplyChange( const OUString& sResourceUrl, const css::uno::Reference< css::container::XIndexAccess >& xSettings, sal_Bool bTemporary = sal_True ) throw (css::uno::RuntimeException);
void ApplyChange( const OUString& sResourceUrl, const css::uno::Reference< css::container::XIndexAccess >& xSettings, bool bTemporary = true ) throw (css::uno::RuntimeException);
css::uno::Reference< css::frame::XLayoutManager > getLayoutManager() throw (css::uno::RuntimeException);
......
......@@ -100,12 +100,12 @@ void
VbaDocumentBase::Close( const uno::Any &rSaveArg, const uno::Any &rFileArg,
const uno::Any &rRouteArg ) throw (uno::RuntimeException, std::exception)
{
sal_Bool bSaveChanges = sal_False;
bool bSaveChanges = false;
OUString aFileName;
sal_Bool bRouteWorkbook = sal_True;
bool bRouteWorkbook = true;
rSaveArg >>= bSaveChanges;
sal_Bool bFileName = ( rFileArg >>= aFileName );
bool bFileName = ( rFileArg >>= aFileName );
rRouteArg >>= bRouteWorkbook;
uno::Reference< frame::XStorable > xStorable( getModel(), uno::UNO_QUERY_THROW );
uno::Reference< util::XModifiable > xModifiable( getModel(), uno::UNO_QUERY_THROW );
......@@ -125,7 +125,7 @@ VbaDocumentBase::Close( const uno::Any &rSaveArg, const uno::Any &rFileArg,
xModifiable->setModified( false );
// first try to close the document using UI dispatch functionality
sal_Bool bUIClose = sal_False;
bool bUIClose = false;
try
{
uno::Reference< frame::XController > xController( getModel()->getCurrentController(), uno::UNO_SET_THROW );
......@@ -142,7 +142,7 @@ VbaDocumentBase::Close( const uno::Any &rSaveArg, const uno::Any &rFileArg,
xDispatchProvider->queryDispatch( aURL, "_self" , 0 ),
uno::UNO_SET_THROW );
xDispatch->dispatch( aURL, uno::Sequence< beans::PropertyValue >() );
bUIClose = sal_True;
bUIClose = true;
}
catch(const uno::Exception&)
{
......
......@@ -55,7 +55,7 @@ VbaFontBase::setSuperscript( const uno::Any& aValue ) throw ( uno::RuntimeExcept
if( mbFormControl )
return;
sal_Bool bValue = sal_False;
bool bValue = false;
aValue >>= bValue;
sal_Int16 nValue = NORMAL;
sal_Int8 nValue2 = NORMALHEIGHT;
......@@ -86,7 +86,7 @@ VbaFontBase::setSubscript( const uno::Any& aValue ) throw ( uno::RuntimeExceptio
if( mbFormControl )
return;
sal_Bool bValue = sal_False;
bool bValue = false;
aValue >>= bValue;
sal_Int16 nValue = NORMAL;
sal_Int8 nValue2 = NORMALHEIGHT;
......@@ -171,7 +171,7 @@ VbaFontBase::getColorIndex() throw ( uno::RuntimeException, std::exception )
void SAL_CALL
VbaFontBase::setBold( const uno::Any& aValue ) throw( uno::RuntimeException, std::exception )
{
sal_Bool bValue = sal_False;
bool bValue = false;
aValue >>= bValue;
double fBoldValue = awt::FontWeight::NORMAL;
if( bValue )
......@@ -191,7 +191,7 @@ VbaFontBase::getBold() throw ( uno::RuntimeException, std::exception )
void SAL_CALL
VbaFontBase::setStrikethrough( const uno::Any& aValue ) throw ( uno::RuntimeException, std::exception )
{
sal_Bool bValue = sal_False;
bool bValue = false;
aValue >>= bValue;
short nValue = awt::FontStrikeout::NONE;
if( bValue )
......@@ -223,7 +223,7 @@ VbaFontBase::getShadow() throw (uno::RuntimeException, std::exception)
void SAL_CALL
VbaFontBase::setItalic( const uno::Any& aValue ) throw ( uno::RuntimeException, std::exception )
{
sal_Bool bValue = sal_False;
bool bValue = false;
aValue >>= bValue;
short nValue = awt::FontSlant_NONE;
if( bValue )
......
......@@ -344,9 +344,9 @@ void PrintOutHelper( SfxViewShell* pViewShell, const uno::Any& From, const uno::
sal_Int32 nTo = 0;
sal_Int32 nFrom = 0;
sal_Int16 nCopies = 1;
sal_Bool bPreview = sal_False;
sal_Bool bCollate = sal_False;
sal_Bool bSelection = bUseSelection;
bool bPreview = false;
bool bCollate = false;
bool bSelection = bUseSelection;
From >>= nFrom;
To >>= nTo;
Copies >>= nCopies;
......@@ -477,7 +477,7 @@ OUString extractStringFromAny( const uno::Any& rAny, bool bUppercaseBool ) throw
case uno::TypeClass_BOOLEAN:
return bUppercaseBool ?
(rAny.get< bool >() ? OUString( "TRUE" ) : OUString( "FALSE" )) :
OUString::boolean( (sal_Bool)rAny.get< bool >() );
OUString::boolean( rAny.get< bool >() );
case uno::TypeClass_FLOAT:
return OUString::number( rAny.get< float >() );
case uno::TypeClass_DOUBLE:
......
......@@ -31,7 +31,7 @@ VbaPageSetupBase::VbaPageSetupBase(const uno::Reference< XHelperInterface >& xPa
double SAL_CALL VbaPageSetupBase::getTopMargin() throw (css::uno::RuntimeException, std::exception)
{
sal_Bool headerOn = sal_False;
bool headerOn = false;
sal_Int32 topMargin = 0;
sal_Int32 headerHeight = 0;
......@@ -60,7 +60,7 @@ double SAL_CALL VbaPageSetupBase::getTopMargin() throw (css::uno::RuntimeExcepti
void SAL_CALL VbaPageSetupBase::setTopMargin( double margin ) throw (css::uno::RuntimeException, std::exception)
{
sal_Int32 topMargin = Millimeter::getInHundredthsOfOneMillimeter( margin );
sal_Bool headerOn = sal_False;
bool headerOn = false;
sal_Int32 headerHeight = 0;
try
......@@ -85,7 +85,7 @@ void SAL_CALL VbaPageSetupBase::setTopMargin( double margin ) throw (css::uno::R
double SAL_CALL VbaPageSetupBase::getBottomMargin() throw (css::uno::RuntimeException, std::exception)
{
sal_Bool footerOn = sal_False;
bool footerOn = false;
sal_Int32 bottomMargin = 0;
sal_Int32 footerHeight = 0;
......@@ -114,7 +114,7 @@ double SAL_CALL VbaPageSetupBase::getBottomMargin() throw (css::uno::RuntimeExce
void SAL_CALL VbaPageSetupBase::setBottomMargin( double margin ) throw (css::uno::RuntimeException, std::exception)
{
sal_Int32 bottomMargin = Millimeter::getInHundredthsOfOneMillimeter( margin );
sal_Bool footerOn = sal_False;
bool footerOn = false;
sal_Int32 footerHeight = 0;
try
......@@ -259,7 +259,7 @@ sal_Int32 SAL_CALL VbaPageSetupBase::getOrientation() throw (css::uno::RuntimeEx
sal_Int32 orientation = mnOrientPortrait;
try
{
sal_Bool isLandscape = sal_False;
bool isLandscape = false;
uno::Any aValue = mxPageProps->getPropertyValue( "IsLandscape" );
aValue >>= isLandscape;
......@@ -284,15 +284,15 @@ void SAL_CALL VbaPageSetupBase::setOrientation( sal_Int32 orientation ) throw (c
try
{
sal_Bool isLandscape = sal_False;
bool isLandscape = false;
uno::Any aValue = mxPageProps->getPropertyValue( "IsLandscape" );
aValue >>= isLandscape;
sal_Bool switchOrientation = sal_False;
bool switchOrientation = false;
if(( isLandscape && orientation != mnOrientLandscape ) ||
( !isLandscape && orientation != mnOrientPortrait ))
{
switchOrientation = sal_True;
switchOrientation = true;
}
if( switchOrientation )
......
......@@ -60,7 +60,7 @@ VbaTextFrame::getAutoSize() throw (uno::RuntimeException, std::exception)
// I don't know why, but in OOo, TextAutoGrowHeight is the property control autosize. not TextFitToSize.
// TextFitToSize control the text content.
// and in mso, there isnot option TextWordWrap which means auto wrap. the default is False.
sal_Bool bAutosize = sal_False;
bool bAutosize = false;
uno::Any aTextAutoGrowHeight = m_xPropertySet->getPropertyValue( "TextAutoGrowHeight" );
aTextAutoGrowHeight >>= bAutosize;
return bAutosize;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment