diff options
29 files changed, 88 insertions, 133 deletions
diff --git a/basctl/source/dlged/dlgedfac.cxx b/basctl/source/dlged/dlgedfac.cxx index 83d3d48da8b2..7ddd166b9f50 100644 --- a/basctl/source/dlged/dlgedfac.cxx +++ b/basctl/source/dlged/dlgedfac.cxx @@ -116,8 +116,7 @@ IMPL_LINK_TYPED( DlgEdFactory, MakeObject, SdrObjFactory *, pObjFactory, void ) uno::Reference< beans::XPropertySet > xPSet(pNew->GetUnoControlModel(), uno::UNO_QUERY); if (xPSet.is()) { - sal_Bool bB = true; - xPSet->setPropertyValue( DLGED_PROP_DROPDOWN, uno::Any(&bB,cppu::UnoType<bool>::get())); + xPSet->setPropertyValue( DLGED_PROP_DROPDOWN, uno::Any(true)); } } catch(...) diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index 5c475d2584a5..d0bd0477659e 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -1415,8 +1415,7 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper case TypeClass_BOOLEAN: { - sal_Bool b = pVar->GetBool(); - aRetVal.setValue( &b, cppu::UnoType<bool>::get() ); + aRetVal <<= pVar->GetBool(); break; } case TypeClass_CHAR: diff --git a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx index a7e32f7d611e..fea97b414a11 100644 --- a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx +++ b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx @@ -2469,7 +2469,7 @@ namespace OUString currentSchema = xRow->getString( C_SCHEMA ); OUString currentTable = xRow->getString( C_TABLENAME ); OUString currentIndexName = xRow->getString( C_INDEXNAME ); - sal_Bool isNonUnique = ! xRow->getBoolean( C_IS_UNIQUE ); + bool isNonUnique = ! xRow->getBoolean( C_IS_UNIQUE ); bool isPrimary = xRow->getBoolean( C_IS_PRIMARY ); (void)isPrimary; sal_Int32 indexType = xRow->getBoolean( C_IS_CLUSTERED ) ? @@ -2490,8 +2490,7 @@ namespace result[R_TABLE_SCHEM] = makeAny(currentSchema); result[R_TABLE_NAME] = makeAny(currentTable); result[R_INDEX_NAME] = makeAny(currentIndexName); - result[R_NON_UNIQUE] = - Any( &isNonUnique, cppu::UnoType<bool>::get() ); + result[R_NON_UNIQUE] <<= isNonUnique; result[R_TYPE] = makeAny( indexType ); result[R_COLUMN_NAME] = makeAny( rowColumn->getString(2) ); sal_Int32 nPos = (sal_Int32)(findIt - columns.begin() +1); // MSVC++ nonsense diff --git a/connectivity/source/drivers/postgresql/pq_resultset.cxx b/connectivity/source/drivers/postgresql/pq_resultset.cxx index fd2b4d435ea8..4cc7254b2523 100644 --- a/connectivity/source/drivers/postgresql/pq_resultset.cxx +++ b/connectivity/source/drivers/postgresql/pq_resultset.cxx @@ -92,16 +92,15 @@ ResultSet::ResultSet( const ::rtl::Reference< RefCountedMutex > & refMutex, m_ppSettings( ppSettings ) { // LEM TODO: shouldn't these things be inherited from the statement or something like that? - sal_Bool b = false; // Positioned update/delete not supported, so no cursor name // Fetch direction and size are cursor-specific things, so not used now. // Fetch size not set m_props[ BASERESULTSET_FETCH_DIRECTION ] = makeAny( com::sun::star::sdbc::FetchDirection::UNKNOWN); // No escape processing for now - m_props[ BASERESULTSET_ESCAPE_PROCESSING ] = Any( &b, cppu::UnoType<bool>::get() ); + m_props[ BASERESULTSET_ESCAPE_PROCESSING ] <<= false; // Bookmarks not implemented for now - m_props[ BASERESULTSET_IS_BOOKMARKABLE ] = Any( &b, cppu::UnoType<bool>::get() ); + m_props[ BASERESULTSET_IS_BOOKMARKABLE ] <<= false; m_props[ BASERESULTSET_RESULT_SET_CONCURRENCY ] = makeAny( com::sun::star::sdbc::ResultSetConcurrency::READ_ONLY ); m_props[ BASERESULTSET_RESULT_SET_TYPE ] = makeAny( diff --git a/connectivity/source/drivers/postgresql/pq_updateableresultset.hxx b/connectivity/source/drivers/postgresql/pq_updateableresultset.hxx index 4131e3239a00..2181efd664b6 100644 --- a/connectivity/source/drivers/postgresql/pq_updateableresultset.hxx +++ b/connectivity/source/drivers/postgresql/pq_updateableresultset.hxx @@ -94,16 +94,15 @@ protected: // Why is an updatable ResultSet a sequenceresultset in the first place? // This seems to imply that the whole data is fetched once and kept in memory. BAAAAD. // LEM TODO: shouldn't these things be inherited from the statement or something like that? - sal_Bool b = false; // Positioned update/delete not supported, so no cursor name // Fetch direction and size are cursor-specific things, so not used now. // Fetch size not set m_props[ BASERESULTSET_FETCH_DIRECTION ] = com::sun::star::uno::makeAny( com::sun::star::sdbc::FetchDirection::UNKNOWN); // No escape processing for now - m_props[ BASERESULTSET_ESCAPE_PROCESSING ] = com::sun::star::uno::Any( &b, cppu::UnoType<bool>::get() ); + m_props[ BASERESULTSET_ESCAPE_PROCESSING ] <<= false; // Bookmarks not implemented for now - m_props[ BASERESULTSET_IS_BOOKMARKABLE ] = com::sun::star::uno::Any( &b, cppu::UnoType<bool>::get() ); + m_props[ BASERESULTSET_IS_BOOKMARKABLE ] <<= false; m_props[ BASERESULTSET_RESULT_SET_CONCURRENCY ] = com::sun::star::uno::makeAny( com::sun::star::sdbc::ResultSetConcurrency::UPDATABLE ); m_props[ BASERESULTSET_RESULT_SET_TYPE ] = com::sun::star::uno::makeAny( diff --git a/connectivity/source/drivers/postgresql/pq_xcolumns.cxx b/connectivity/source/drivers/postgresql/pq_xcolumns.cxx index a26b582e1a3a..cf97b369d991 100644 --- a/connectivity/source/drivers/postgresql/pq_xcolumns.cxx +++ b/connectivity/source/drivers/postgresql/pq_xcolumns.cxx @@ -74,8 +74,7 @@ namespace pq_sdbc_driver static Any isCurrency( const OUString & typeName ) { - sal_Bool b = typeName.equalsIgnoreAsciiCase("money"); - return Any( &b, cppu::UnoType<bool>::get() ); + return Any( typeName.equalsIgnoreAsciiCase("money") ); } // static sal_Bool isAutoIncrement8( const OUString & typeName ) @@ -86,7 +85,7 @@ static Any isCurrency( const OUString & typeName ) static Any isAutoIncrement( const OUString & defaultValue ) { - sal_Bool ret = defaultValue.startsWith( "nextval(" ); + bool ret = defaultValue.startsWith( "nextval(" ); // printf( "%s %d\n", // OUStringToOString(defaultValue, RTL_TEXTENCODING_ASCII_US).getStr(), // ret ); @@ -100,7 +99,7 @@ static Any isAutoIncrement( const OUString & defaultValue ) // { // b = b || typeName.equalsIgnoreAsciiCaseAscii( serials[i] ); // } - return Any ( &ret, cppu::UnoType<bool>::get() ); + return Any ( ret ); } Columns::Columns( diff --git a/connectivity/source/drivers/postgresql/pq_xindexes.cxx b/connectivity/source/drivers/postgresql/pq_xindexes.cxx index 39824eff7a7b..7b415fe2e5c7 100644 --- a/connectivity/source/drivers/postgresql/pq_xindexes.cxx +++ b/connectivity/source/drivers/postgresql/pq_xindexes.cxx @@ -148,16 +148,16 @@ void Indexes::refresh() m_schemaName, m_tableName ); (void) C_SCHEMA; (void) C_TABLENAME; - sal_Bool isUnique = row->getBoolean( C_IS_UNIQUE ); - sal_Bool isPrimary = row->getBoolean( C_IS_PRIMARY ); - sal_Bool isClusterd = row->getBoolean( C_IS_CLUSTERED ); + bool isUnique = row->getBoolean( C_IS_UNIQUE ); + bool isPrimary = row->getBoolean( C_IS_PRIMARY ); + bool isClusterd = row->getBoolean( C_IS_CLUSTERED ); Reference< com::sun::star::beans::XPropertySet > prop = pIndex; pIndex->setPropertyValue_NoBroadcast_public( - st.IS_UNIQUE, Any( &isUnique, cppu::UnoType<bool>::get() ) ); + st.IS_UNIQUE, Any( isUnique ) ); pIndex->setPropertyValue_NoBroadcast_public( - st.IS_PRIMARY_KEY_INDEX, Any( &isPrimary, cppu::UnoType<bool>::get() ) ); + st.IS_PRIMARY_KEY_INDEX, Any( isPrimary ) ); pIndex->setPropertyValue_NoBroadcast_public( - st.IS_CLUSTERED, Any( &isClusterd, cppu::UnoType<bool>::get() ) ); + st.IS_CLUSTERED, Any( isClusterd ) ); pIndex->setPropertyValue_NoBroadcast_public( st.NAME, makeAny( currentIndexName ) ); diff --git a/cui/source/options/connpoolconfig.cxx b/cui/source/options/connpoolconfig.cxx index 00b46cde8e1d..6a2292ac216c 100644 --- a/cui/source/options/connpoolconfig.cxx +++ b/cui/source/options/connpoolconfig.cxx @@ -153,8 +153,8 @@ namespace offapp const SfxBoolItem* pEnabled = _rSourceItems.GetItem<SfxBoolItem>(SID_SB_POOLING_ENABLED); if (pEnabled) { - sal_Bool bEnabled = pEnabled->GetValue(); - aConnectionPoolRoot.setNodeValue(getEnablePoolingNodeName(), Any(&bEnabled, cppu::UnoType<bool>::get())); + bool bEnabled = pEnabled->GetValue(); + aConnectionPoolRoot.setNodeValue(getEnablePoolingNodeName(), Any(bEnabled)); bNeedCommit = true; } diff --git a/dbaccess/source/core/api/resultcolumn.cxx b/dbaccess/source/core/api/resultcolumn.cxx index 5c9f5b0b4e13..cc5381a4f846 100644 --- a/dbaccess/source/core/api/resultcolumn.cxx +++ b/dbaccess/source/core/api/resultcolumn.cxx @@ -276,13 +276,11 @@ void OResultColumn::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) const case PROPERTY_ID_ISCURRENCY: case PROPERTY_ID_ISSIGNED: { - sal_Bool bVal = false; - rValue.setValue(&bVal, cppu::UnoType<bool>::get()); + rValue <<= false; } break; case PROPERTY_ID_ISREADONLY: { - sal_Bool bVal = true; - rValue.setValue(&bVal, cppu::UnoType<bool>::get()); + rValue <<= true; } break; case PROPERTY_ID_SCALE: case PROPERTY_ID_PRECISION: diff --git a/dbaccess/source/core/api/resultset.cxx b/dbaccess/source/core/api/resultset.cxx index 917c7b45b607..eeab01fc6c5d 100644 --- a/dbaccess/source/core/api/resultset.cxx +++ b/dbaccess/source/core/api/resultset.cxx @@ -242,8 +242,7 @@ void OResultSet::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) const { case PROPERTY_ID_ISBOOKMARKABLE: { - sal_Bool bVal = m_bIsBookmarkable; - rValue.setValue(&bVal, cppu::UnoType<bool>::get()); + rValue <<= m_bIsBookmarkable; } break; default: { diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx index ff9315d8a0d0..52cdbc3f6d95 100644 --- a/editeng/source/items/paraitem.cxx +++ b/editeng/source/items/paraitem.cxx @@ -350,8 +350,7 @@ bool SvxAdjustItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const case MID_LAST_LINE_ADJUST : rVal <<= (sal_Int16)GetLastBlock(); break; case MID_EXPAND_SINGLE : { - sal_Bool bValue = bOneBlock; - rVal.setValue( &bValue, cppu::UnoType<bool>::get() ); + rVal <<= bOneBlock; break; } default: ;//prevent warning diff --git a/editeng/source/misc/acorrcfg.cxx b/editeng/source/misc/acorrcfg.cxx index b838791ef00e..7357d457edf2 100644 --- a/editeng/source/misc/acorrcfg.cxx +++ b/editeng/source/misc/acorrcfg.cxx @@ -242,60 +242,46 @@ void SvxBaseAutoCorrCfg::ImplCommit() Sequence<Any> aValues(aNames.getLength()); Any* pValues = aValues.getArray(); - const Type& rType = cppu::UnoType<bool>::get(); - sal_Bool bVal; const long nFlags = rParent.pAutoCorrect->GetFlags(); for(int nProp = 0; nProp < aNames.getLength(); nProp++) { switch(nProp) { case 0: - bVal = 0 != (nFlags & SaveWordCplSttLst); - pValues[nProp].setValue(&bVal, rType); + pValues[nProp] <<= ((nFlags & SaveWordCplSttLst) != 0); break;//"Exceptions/TwoCapitalsAtStart", case 1: - bVal = 0 != (nFlags & SaveWordWrdSttLst); - pValues[nProp].setValue(&bVal, rType); + pValues[nProp] <<= ((nFlags & SaveWordWrdSttLst) != 0); break;//"Exceptions/CapitalAtStartSentence", case 2: - bVal = 0 != (nFlags & Autocorrect); - pValues[nProp].setValue(&bVal, rType); + pValues[nProp] <<= ((nFlags & Autocorrect) != 0); break;//"UseReplacementTable", case 3: - bVal = 0 != (nFlags & CapitalStartWord); - pValues[nProp].setValue(&bVal, rType); + pValues[nProp] <<= ((nFlags & CapitalStartWord) != 0); break;//"TwoCapitalsAtStart", case 4: - bVal = 0 != (nFlags & CapitalStartSentence); - pValues[nProp].setValue(&bVal, rType); + pValues[nProp] <<= ((nFlags & CapitalStartSentence) != 0); break;//"CapitalAtStartSentence", case 5: - bVal = 0 != (nFlags & ChgWeightUnderl); - pValues[nProp].setValue(&bVal, rType); + pValues[nProp] <<= ((nFlags & ChgWeightUnderl) != 0); break;//"ChangeUnderlineWeight", case 6: - bVal = 0 != (nFlags & SetINetAttr); - pValues[nProp].setValue(&bVal, rType); + pValues[nProp] <<= ((nFlags & SetINetAttr) != 0); break;//"SetInetAttribute", case 7: - bVal = 0 != (nFlags & ChgOrdinalNumber); - pValues[nProp].setValue(&bVal, rType); + pValues[nProp] <<= ((nFlags & ChgOrdinalNumber) != 0); break;//"ChangeOrdinalNumber", case 8: - bVal = 0 != (nFlags & AddNonBrkSpace); - pValues[nProp].setValue(&bVal, rType); + pValues[nProp] <<= ((nFlags & AddNonBrkSpace) != 0); break;//"AddNonBreakingSpace" case 9: - bVal = 0 != (nFlags & ChgToEnEmDash); - pValues[nProp].setValue(&bVal, rType); + pValues[nProp] <<= ((nFlags & ChgToEnEmDash) != 0); break;//"ChangeDash", case 10: - bVal = 0 != (nFlags & IgnoreDoubleSpace); - pValues[nProp].setValue(&bVal, rType); + pValues[nProp] <<= ((nFlags & IgnoreDoubleSpace) != 0); break;//"RemoveDoubleSpaces", case 11: - bVal = 0 != (nFlags & ChgSglQuotes); - pValues[nProp].setValue(&bVal, rType); + pValues[nProp] <<= ((nFlags & ChgSglQuotes) != 0); break;//"ReplaceSingleQuote", case 12: pValues[nProp] <<= (sal_Int32)rParent.pAutoCorrect->GetStartSingleQuote(); @@ -304,8 +290,7 @@ void SvxBaseAutoCorrCfg::ImplCommit() pValues[nProp] <<= (sal_Int32) rParent.pAutoCorrect->GetEndSingleQuote(); break;//"SingleQuoteAtEnd", case 14: - bVal = 0 != (nFlags & ChgQuotes); - pValues[nProp].setValue(&bVal, rType); + pValues[nProp] <<= ((nFlags & ChgQuotes) != 0); break;//"ReplaceDoubleQuote", case 15: pValues[nProp] <<= (sal_Int32) rParent.pAutoCorrect->GetStartDoubleQuote(); @@ -314,8 +299,7 @@ void SvxBaseAutoCorrCfg::ImplCommit() pValues[nProp] <<= (sal_Int32) rParent.pAutoCorrect->GetEndDoubleQuote(); break;//"DoubleQuoteAtEnd" case 17: - bVal = 0 != (nFlags & CorrectCapsLock); - pValues[nProp].setValue(&bVal, rType); + pValues[nProp] <<= ((nFlags & CorrectCapsLock) != 0); break;//"CorrectAccidentalCapsLock" } } diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx index dce92b1d00c2..844c0cc0bbc4 100644 --- a/extensions/source/bibliography/datman.cxx +++ b/extensions/source/bibliography/datman.cxx @@ -688,7 +688,7 @@ void BibDataManager::InsertFields(const Reference< XFormComponent > & _rxGrid) const OUString sType("Type"); sal_Int32 nType = 0; bool bIsFormatted = false; - sal_Bool bFormattedIsNumeric = true; + bool bFormattedIsNumeric = true; xField->getPropertyValue(sType) >>= nType; switch(nType) { @@ -721,7 +721,7 @@ void BibDataManager::InsertFields(const Reference< XFormComponent > & _rxGrid) { OUString sFormatKey("FormatKey"); xCurrentCol->setPropertyValue(sFormatKey, xField->getPropertyValue(sFormatKey)); - Any aFormatted(&bFormattedIsNumeric, cppu::UnoType<bool>::get()); + Any aFormatted(bFormattedIsNumeric); xCurrentCol->setPropertyValue("TreatAsNumber", aFormatted); } Any aColName = makeAny( *pFields ); diff --git a/filter/source/graphicfilter/icgm/actimpr.cxx b/filter/source/graphicfilter/icgm/actimpr.cxx index 3d055095fa7d..1a2dd6f36d81 100644 --- a/filter/source/graphicfilter/icgm/actimpr.cxx +++ b/filter/source/graphicfilter/icgm/actimpr.cxx @@ -788,8 +788,7 @@ void CGMImpressOutAct::DrawText( awt::Point& rTextPos, awt::Size& rTextSize, cha } if ( nWidth == -1 ) { - sal_Bool bTrue( true ); - aAny.setValue( &bTrue, cppu::UnoType<sal_Bool>::get()); + aAny <<= true; maXPropSet->setPropertyValue( "TextAutoGrowWidth", aAny ); drawing::TextAdjust eTextAdjust; @@ -812,8 +811,7 @@ void CGMImpressOutAct::DrawText( awt::Point& rTextPos, awt::Size& rTextSize, cha } if ( nHeight == -1 ) { - sal_Bool bTrue = true; - aAny.setValue( &bTrue, cppu::UnoType<sal_Bool>::get()); + aAny <<= true; maXPropSet->setPropertyValue( "TextAutoGrowHeight", aAny ); } uno::Reference< text::XText > xText; @@ -854,8 +852,7 @@ void CGMImpressOutAct::DrawText( awt::Point& rTextPos, awt::Size& rTextSize, cha } if ( nWidth > 0 && nHeight > 0 ) // restricted text { - sal_Bool bTrue = true; - aAny.setValue( &bTrue, cppu::UnoType<sal_Bool>::get()); + aAny <<= true; maXPropSet->setPropertyValue( "TextFitToSize", aAny ); } aCursorText->setString( aStr ); diff --git a/include/com/sun/star/uno/Any.h b/include/com/sun/star/uno/Any.h index 7ed67e2ab4e0..26127f4add37 100644 --- a/include/com/sun/star/uno/Any.h +++ b/include/com/sun/star/uno/Any.h @@ -113,6 +113,9 @@ public: Any(bool const *, Type const &) = delete; Any(bool const *, typelib_TypeDescription *) = delete; Any(bool const *, typelib_TypeDescriptionReference *) = delete; + Any(sal_Bool const *, Type const &) = delete; + Any(sal_Bool const *, typelib_TypeDescription *) = delete; + Any(sal_Bool const *, typelib_TypeDescriptionReference *) = delete; Any(std::nullptr_t, Type const & type): Any(static_cast<void *>(nullptr), type) {} Any(std::nullptr_t, typelib_TypeDescription * type): @@ -221,6 +224,10 @@ public: void setValue(bool const *, Type const &) = delete; void setValue(bool const *, typelib_TypeDescriptionReference *) = delete; void setValue(bool const *, typelib_TypeDescription *) = delete; + void setValue(sal_Bool const *, Type const &) = delete; + void setValue(sal_Bool const *, typelib_TypeDescriptionReference *) + = delete; + void setValue(sal_Bool const *, typelib_TypeDescription *) = delete; void setValue(std::nullptr_t, Type const & type) { setValue(static_cast<void *>(nullptr), type); } void setValue(std::nullptr_t, typelib_TypeDescriptionReference * type) diff --git a/include/comphelper/property.hxx b/include/comphelper/property.hxx index bc13cd0bc42d..74c318388ba7 100644 --- a/include/comphelper/property.hxx +++ b/include/comphelper/property.hxx @@ -131,7 +131,7 @@ inline bool tryPropertyValue(css::uno::Any& /*out*/_rConvertedValue, css::uno::A ::cppu::convertPropertyValue(bNewValue, _rValueToSet); if (bool(bNewValue) != _bCurrentValue) { - _rConvertedValue.setValue(&bNewValue, cppu::UnoType<bool>::get()); + _rConvertedValue <<= bNewValue; _rOldValue <<= _bCurrentValue; bModified = true; } diff --git a/pyuno/source/module/pyuno_runtime.cxx b/pyuno/source/module/pyuno_runtime.cxx index 7a481f98cacb..0669360fafc7 100644 --- a/pyuno/source/module/pyuno_runtime.cxx +++ b/pyuno/source/module/pyuno_runtime.cxx @@ -692,13 +692,11 @@ Any Runtime::pyObject2Any ( const PyRef & source, enum ConversionMode mode ) con // Convert the Python 3 booleans that are actually of type PyLong. if(o == Py_True) { - sal_Bool b = true; - a = Any(&b, cppu::UnoType<bool>::get()); + a <<= true; } else if(o == Py_False) { - sal_Bool b = false; - a = Any(&b, cppu::UnoType<bool>::get()); + a <<= false; } else { diff --git a/sc/source/ui/unoobj/miscuno.cxx b/sc/source/ui/unoobj/miscuno.cxx index 074286cc1f02..bc20a47e8e72 100644 --- a/sc/source/ui/unoobj/miscuno.cxx +++ b/sc/source/ui/unoobj/miscuno.cxx @@ -164,8 +164,7 @@ sal_Int32 ScUnoHelpFunctions::GetEnumFromAny( const uno::Any& aAny ) void ScUnoHelpFunctions::SetBoolInAny( uno::Any& rAny, bool bValue ) { - sal_Bool bTemp = bValue ? 1 : 0; - rAny.setValue( &bTemp, cppu::UnoType<bool>::get() ); + rAny <<= bValue; } void ScUnoHelpFunctions::SetOptionalPropertyValue( diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx index 10cea81039c9..cda93d4b3995 100644 --- a/starmath/source/unomodel.cxx +++ b/starmath/source/unomodel.cxx @@ -770,10 +770,7 @@ void SmModel::_getPropertyValues( const PropertyMapEntry **ppEntries, Any *pValu break; case HANDLE_IS_TEXT_MODE : - { - sal_Bool bVal = aFormat.IsTextmode(); - (*pValue).setValue(&bVal, cppu::UnoType<bool>::get()); - } + *pValue <<= aFormat.IsTextmode(); break; case HANDLE_GREEK_CHAR_STYLE : @@ -812,10 +809,7 @@ void SmModel::_getPropertyValues( const PropertyMapEntry **ppEntries, Any *pValu *pValue <<= static_cast<sal_Int16>(aFormat.GetDistance((*ppEntries)->mnMemberId)); break; case HANDLE_IS_SCALE_ALL_BRACKETS : - { - sal_Bool bVal = aFormat.IsScaleNormalBrackets(); - (*pValue).setValue(&bVal, cppu::UnoType<bool>::get()); - } + *pValue <<= aFormat.IsScaleNormalBrackets(); break; case HANDLE_PRINTER_NAME: { diff --git a/stoc/source/typeconv/convert.cxx b/stoc/source/typeconv/convert.cxx index b7ec72cba391..1c864f0864d1 100644 --- a/stoc/source/typeconv/convert.cxx +++ b/stoc/source/typeconv/convert.cxx @@ -729,8 +729,7 @@ Any TypeConverter_Impl::convertToSimpleType( const Any& rVal, TypeClass aDestina { default: { - sal_Bool bTmp = (toDouble( rVal ) != 0.0); - aRet.setValue( &bTmp, cppu::UnoType<bool>::get() ); + aRet <<= (toDouble( rVal ) != 0.0); } case TypeClass_ENUM: // exclude enums break; @@ -740,13 +739,11 @@ Any TypeConverter_Impl::convertToSimpleType( const Any& rVal, TypeClass aDestina const OUString & aStr = *static_cast<const OUString *>(rVal.getValue()); if ( aStr == "0" || aStr.equalsIgnoreAsciiCase( "false" )) { - sal_Bool bFalse = false; - aRet.setValue( &bFalse, cppu::UnoType<bool>::get() ); + aRet <<= false; } else if ( aStr == "1" || aStr.equalsIgnoreAsciiCase( "true" )) { - sal_Bool bTrue = true; - aRet.setValue( &bTrue, cppu::UnoType<bool>::get() ); + aRet <<= true; } else { diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx index 6c088737152f..5cfac694d78f 100644 --- a/svx/source/dialog/rubydialog.cxx +++ b/svx/source/dialog/rubydialog.cxx @@ -628,8 +628,7 @@ IMPL_LINK_TYPED(SvxRubyDialog, AdjustHdl_Impl, ListBox&, rBox, void) IMPL_LINK_TYPED(SvxRubyDialog, PositionHdl_Impl, ListBox&, rBox, void) { AssertOneEntry(); - sal_Bool bAbove = !rBox.GetSelectEntryPos(); - const Type& rType = cppu::UnoType<bool>::get(); + bool bAbove = !rBox.GetSelectEntryPos(); Sequence<PropertyValues>& aRubyValues = pImpl->GetRubyValues(); for (sal_Int32 nRuby = 0; nRuby < aRubyValues.getLength(); nRuby++) { @@ -638,7 +637,7 @@ IMPL_LINK_TYPED(SvxRubyDialog, PositionHdl_Impl, ListBox&, rBox, void) for (sal_Int32 nProp = 0; nProp < rProps.getLength(); nProp++) { if (pProps[nProp].Name == cRubyIsAbove) - pProps[nProp].Value.setValue(&bAbove, rType); + pProps[nProp].Value <<= bAbove; } SetModified(true); } diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index 0dca9bff4a88..8cf9565d4be4 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -1357,30 +1357,26 @@ void FmXFormShell::LoopGrids(LoopGridsSync nSync, LoopGridsFlags nFlags) { case LoopGridsSync::DISABLE_SYNC: { - sal_Bool bB(false); - xModelSet->setPropertyValue(FM_PROP_DISPLAYSYNCHRON, Any(&bB,cppu::UnoType<bool>::get())); + xModelSet->setPropertyValue(FM_PROP_DISPLAYSYNCHRON, Any(false)); } break; case LoopGridsSync::FORCE_SYNC: { Any aOldVal( xModelSet->getPropertyValue(FM_PROP_DISPLAYSYNCHRON) ); - sal_Bool bB(true); - xModelSet->setPropertyValue(FM_PROP_DISPLAYSYNCHRON, Any(&bB,cppu::UnoType<bool>::get())); + xModelSet->setPropertyValue(FM_PROP_DISPLAYSYNCHRON, Any(true)); xModelSet->setPropertyValue(FM_PROP_DISPLAYSYNCHRON, aOldVal); } break; case LoopGridsSync::ENABLE_SYNC: { - sal_Bool bB(true); - xModelSet->setPropertyValue(FM_PROP_DISPLAYSYNCHRON, Any(&bB,cppu::UnoType<bool>::get())); + xModelSet->setPropertyValue(FM_PROP_DISPLAYSYNCHRON, Any(true)); } break; } if (nFlags & LoopGridsFlags::DISABLE_ROCTRLR) { - sal_Bool bB(false); - xModelSet->setPropertyValue(FM_PROP_ALWAYSSHOWCURSOR, Any(&bB,cppu::UnoType<bool>::get())); + xModelSet->setPropertyValue(FM_PROP_ALWAYSSHOWCURSOR, Any(false)); Reference< XPropertyState> xModelPropState(xModelSet, UNO_QUERY); if (xModelPropState.is()) xModelPropState->setPropertyToDefault(FM_PROP_CURSORCOLOR); diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx index 486a3f60be7f..bd44214921a5 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -2038,8 +2038,8 @@ bool XLineStartCenterItem::GetPresentation bool XLineStartCenterItem::QueryValue( css::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const { - sal_Bool bValue = GetValue(); - rVal.setValue( &bValue, cppu::UnoType<bool>::get() ); + bool bValue = GetValue(); + rVal <<= bValue; return true; } @@ -2089,8 +2089,8 @@ bool XLineEndCenterItem::GetPresentation bool XLineEndCenterItem::QueryValue( css::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const { - sal_Bool bValue = GetValue(); - rVal.setValue( &bValue, cppu::UnoType<bool>::get() ); + bool bValue = GetValue(); + rVal <<= bValue; return true; } diff --git a/sw/source/uibase/uno/unotxvw.cxx b/sw/source/uibase/uno/unotxvw.cxx index da3dffb4537a..3411f39c5a98 100644 --- a/sw/source/uibase/uno/unotxvw.cxx +++ b/sw/source/uibase/uno/unotxvw.cxx @@ -561,8 +561,7 @@ Sequence< Sequence< PropertyValue > > SwXTextView::getRubyList( sal_Bool /*bAuto pValues[3].Name = UNO_NAME_RUBY_ADJUST; pValues[3].Value <<= (sal_Int16)rAttr.GetAdjustment(); pValues[4].Name = UNO_NAME_RUBY_IS_ABOVE; - sal_Bool bVal = !rAttr.GetPosition(); - pValues[4].Value.setValue(&bVal, cppu::UnoType<bool>::get()); + pValues[4].Value <<= !rAttr.GetPosition(); } return aRet; } diff --git a/testtools/source/bridgetest/bridgetest.cxx b/testtools/source/bridgetest/bridgetest.cxx index df7e87a3865f..b4261947049c 100644 --- a/testtools/source/bridgetest/bridgetest.cxx +++ b/testtools/source/bridgetest/bridgetest.cxx @@ -270,7 +270,7 @@ static bool performAnyTest( const Reference< XBridgeTest > &xLBT, const TestData Any a; { - a.setValue( &(data.Bool) , cppu::UnoType<bool>::get() ); + a <<= data.Bool; OSL_ASSERT( xLBT->transportAny( a ) == a ); } @@ -643,10 +643,9 @@ static bool performTest( // compared with the results: sal_Int32 _arLong[] = { static_cast< sal_Int32 >(0x80000000), 1, 0x7FFFFFFF }; - sal_Bool _aBool = true; sal_Int32 _aInt = 0xBABEBABE; float _aFloat = 3.14f; - Any _any1(&_aBool, cppu::UnoType<bool>::get()); + Any _any1(true); Any _any2(&_aInt, cppu::UnoType<sal_Int32>::get()); Any _any3(&_aFloat, cppu::UnoType<float>::get()); Any _arAny[] = { _any1, _any2, _any3 }; diff --git a/unotools/source/config/fltrcfg.cxx b/unotools/source/config/fltrcfg.cxx index ad19c6b3d856..95fd797f58e1 100644 --- a/unotools/source/config/fltrcfg.cxx +++ b/unotools/source/config/fltrcfg.cxx @@ -371,12 +371,10 @@ void SvtFilterOptions::ImplCommit() Sequence<Any> aValues(aNames.getLength()); Any* pValues = aValues.getArray(); - const Type& rType = cppu::UnoType<bool>::get(); for(int nProp = 0; nProp < aNames.getLength(); nProp++) { sal_uLong nFlag = lcl_GetFlag(nProp); - sal_Bool bVal = pImp->IsFlag( nFlag); - pValues[nProp].setValue(&bVal, rType); + pValues[nProp] <<= pImp->IsFlag(nFlag); } PutProperties(aNames, aValues); diff --git a/xmloff/source/text/XMLSectionSourceDDEImportContext.cxx b/xmloff/source/text/XMLSectionSourceDDEImportContext.cxx index b2bc4be9a291..b1b690e9e319 100644 --- a/xmloff/source/text/XMLSectionSourceDDEImportContext.cxx +++ b/xmloff/source/text/XMLSectionSourceDDEImportContext.cxx @@ -92,7 +92,7 @@ void XMLSectionSourceDDEImportContext::StartElement( OUString sApplication; OUString sTopic; OUString sItem; - sal_Bool bAutomaticUpdate = false; + bool bAutomaticUpdate = false; sal_Int16 nLength = xAttrList->getLength(); for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++) @@ -146,7 +146,7 @@ void XMLSectionSourceDDEImportContext::StartElement( aValues[2] <<= sItem; aNames[2] = sDdeCommandElement; - aValues[3].setValue(&bAutomaticUpdate, cppu::UnoType<bool>::get()); + aValues[3] <<= bAutomaticUpdate; aNames[3] = sIsAutomaticUpdate; Reference<XMultiPropertySet> rMultiPropSet(rSectionPropertySet, diff --git a/xmloff/source/text/txtdropi.cxx b/xmloff/source/text/txtdropi.cxx index 85622bea7a6d..ef6e2c86a0dd 100644 --- a/xmloff/source/text/txtdropi.cxx +++ b/xmloff/source/text/txtdropi.cxx @@ -62,7 +62,7 @@ void XMLTextDropCapImportContext::ProcessAttrs( SvXMLTokenMap aTokenMap( aDropAttrTokenMap ); DropCapFormat aFormat; - sal_Bool bWholeWord = false; + bool bWholeWord = false; sal_Int32 nTmp; sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; @@ -115,7 +115,7 @@ void XMLTextDropCapImportContext::ProcessAttrs( aProp.maValue <<= aFormat; - aWholeWordProp.maValue.setValue( &bWholeWord, cppu::UnoType<bool>::get() ); + aWholeWordProp.maValue <<= bWholeWord; } XMLTextDropCapImportContext::XMLTextDropCapImportContext( diff --git a/xmloff/source/text/txtprhdl.cxx b/xmloff/source/text/txtprhdl.cxx index d2c5779659fd..6d3a22735d73 100644 --- a/xmloff/source/text/txtprhdl.cxx +++ b/xmloff/source/text/txtprhdl.cxx @@ -334,14 +334,14 @@ bool XMLOpaquePropHdl_Impl::importXML( const SvXMLUnitConverter& ) const { bool bRet = true; - sal_Bool bVal = false; + bool bVal = false; if( IsXMLToken( rStrImpValue, XML_FOREGROUND ) ) bVal = true; else if( !IsXMLToken( rStrImpValue, XML_BACKGROUND ) ) bRet = false; if( bRet ) - rValue.setValue( &bVal, cppu::UnoType<bool>::get() ); + rValue <<= bVal; return bRet; } @@ -384,14 +384,14 @@ bool XMLContourModePropHdl_Impl::importXML( const SvXMLUnitConverter& ) const { bool bRet = true; - sal_Bool bVal = false; + bool bVal = false; if( IsXMLToken( rStrImpValue, XML_OUTSIDE ) ) bVal = true; else if( ! IsXMLToken( rStrImpValue, XML_FULL ) ) bRet = false; if( bRet ) - rValue.setValue( &bVal, cppu::UnoType<bool>::get() ); + rValue <<= bVal; return bRet; } @@ -434,7 +434,7 @@ bool XMLParagraphOnlyPropHdl_Impl::importXML( const SvXMLUnitConverter& ) const { bool bRet = true; - sal_Bool bVal = false; + bool bVal = false; if( ! IsXMLToken( rStrImpValue, XML_NO_LIMIT ) ) { @@ -444,7 +444,7 @@ bool XMLParagraphOnlyPropHdl_Impl::importXML( } if( bRet ) - rValue.setValue( &bVal, cppu::UnoType<bool>::get() ); + rValue <<= bVal; return bRet; } @@ -552,7 +552,7 @@ bool XMLFrameProtectPropHdl_Impl::importXML( const SvXMLUnitConverter& ) const { bool bRet = true; - sal_Bool bVal = false; + bool bVal = false; if( ! IsXMLToken( rStrImpValue, XML_NONE ) ) { bRet = false; @@ -570,7 +570,7 @@ bool XMLFrameProtectPropHdl_Impl::importXML( } if( bRet ) - rValue.setValue( &bVal, cppu::UnoType<bool>::get() ); + rValue <<= bVal; return bRet; } @@ -746,8 +746,7 @@ bool XMLHoriMirrorPropHdl_Impl::importXML( if( bRet ) { - sal_Bool bTmp = nHoriMirror != 0; - rValue.setValue( &bTmp, cppu::UnoType<bool>::get() ); + rValue <<= (nHoriMirror != 0); } return bRet; @@ -794,7 +793,7 @@ bool XMLGrfMirrorPropHdl_Impl::importXML( const SvXMLUnitConverter& ) const { bool bRet = true; - sal_Bool bVal = false; + bool bVal = false; if( ! IsXMLToken( rStrImpValue, XML_NONE ) ) { bRet = false; @@ -813,7 +812,7 @@ bool XMLGrfMirrorPropHdl_Impl::importXML( } if( bRet ) - rValue.setValue( &bVal, cppu::UnoType<bool>::get() ); + rValue <<= bVal; return bRet; } @@ -1087,8 +1086,7 @@ bool XMLTextSyncWidthHeightPropHdl_Impl::importXML( Any& rValue, const SvXMLUnitConverter& ) const { - sal_Bool bValue = (rStrImpValue == sValue ); - rValue.setValue( &bValue, cppu::UnoType<bool>::get() ); + rValue <<= (rStrImpValue == sValue); return true; } |