[Libreoffice-commits] core.git: editeng/source include/svl svx/source

Stephan Bergmann sbergman at redhat.com
Wed Jun 10 13:43:47 PDT 2015


 editeng/source/items/frmitems.cxx |    6 +++---
 editeng/source/items/paraitem.cxx |    2 +-
 editeng/source/items/textitem.cxx |   18 +++++++++---------
 include/svl/poolitem.hxx          |    5 -----
 svx/source/items/pageitem.cxx     |    2 +-
 5 files changed, 14 insertions(+), 19 deletions(-)

New commits:
commit f222de1de0f4be3ee01162aa3c62ca928dc8476f
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jun 10 22:40:41 2015 +0200

    Remove unnecessary Bool2Any
    
    (It feels better to use explicitly bool-typed css::uno::makeAny<bool>(x) rather
    than implicitly typed css::uno::makeAny(x) or css::uno::Any(x), in case x is not
    already of type bool.)
    
    Change-Id: I282b3764bb207aeae9f13cc981e68e8ef2b8ab93

diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index d872838..357eb8b 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -468,7 +468,7 @@ bool SvxLRSpaceItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
             break;
 
         case MID_FIRST_AUTO:
-            rVal = Bool2Any(IsAutoFirst());
+            rVal = css::uno::makeAny<bool>(IsAutoFirst());
             break;
 
         default:
@@ -1206,7 +1206,7 @@ bool SvxProtectItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
             return false;
     }
 
-    rVal = Bool2Any( bValue );
+    rVal = css::uno::makeAny<bool>( bValue );
     return true;
 }
 
@@ -3600,7 +3600,7 @@ bool SvxBrushItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
         break;
 
         case MID_GRAPHIC_TRANSPARENT:
-            rVal = Bool2Any( aColor.GetTransparency() == 0xff );
+            rVal = css::uno::makeAny<bool>( aColor.GetTransparency() == 0xff );
         break;
 
         case MID_GRAPHIC_URL:
diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx
index 452704b..c1402d9 100644
--- a/editeng/source/items/paraitem.cxx
+++ b/editeng/source/items/paraitem.cxx
@@ -655,7 +655,7 @@ bool    SvxHyphenZoneItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) con
     switch(nMemberId)
     {
         case  MID_IS_HYPHEN:
-            rVal = Bool2Any(bHyphen);
+            rVal = css::uno::makeAny<bool>(bHyphen);
         break;
         case MID_HYPHEN_MIN_LEAD:
             rVal <<= (sal_Int16)nMinLead;
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index 0c9fbad..69d4d38 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -547,7 +547,7 @@ bool SvxPostureItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
     switch( nMemberId )
     {
         case MID_ITALIC:
-            rVal = Bool2Any(GetBoolValue());
+            rVal = css::uno::makeAny<bool>(GetBoolValue());
             break;
         case MID_POSTURE:
             rVal <<= (awt::FontSlant)GetValue();    // values from awt::FontSlant and FontItalic are equal
@@ -699,7 +699,7 @@ bool SvxWeightItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
     switch( nMemberId )
     {
         case MID_BOLD   :
-            rVal = Bool2Any(GetBoolValue());
+            rVal = css::uno::makeAny<bool>(GetBoolValue());
         break;
         case MID_WEIGHT:
         {
@@ -1349,7 +1349,7 @@ bool SvxTextLineItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
     switch(nMemberId)
     {
     case MID_TEXTLINED:
-        rVal = Bool2Any(GetBoolValue());
+        rVal = css::uno::makeAny<bool>(GetBoolValue());
         break;
     case MID_TL_STYLE:
         rVal <<= (sal_Int16)(GetValue());
@@ -1358,7 +1358,7 @@ bool SvxTextLineItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
         rVal <<= (sal_Int32)( mColor.GetColor() );
         break;
     case MID_TL_HASCOLOR:
-        rVal = Bool2Any( !mColor.GetTransparency() );
+        rVal = css::uno::makeAny<bool>( !mColor.GetTransparency() );
         break;
     }
     return true;
@@ -1565,7 +1565,7 @@ bool SvxCrossedOutItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
     switch(nMemberId)
     {
         case MID_CROSSED_OUT:
-            rVal = Bool2Any(GetBoolValue());
+            rVal = css::uno::makeAny<bool>(GetBoolValue());
         break;
         case MID_CROSS_OUT:
             rVal <<= (sal_Int16)(GetValue());
@@ -1880,7 +1880,7 @@ bool SvxBackgroundColorItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) c
     {
         case MID_GRAPHIC_TRANSPARENT:
         {
-            rVal <<= Bool2Any (aColor.GetTransparency() == 0xff);
+            rVal <<= css::uno::makeAny<bool>(aColor.GetTransparency() == 0xff);
             break;
         }
         default:
@@ -2445,7 +2445,7 @@ bool SvxEscapementItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
             rVal <<= (sal_Int8)(nProp);
         break;
         case MID_AUTO_ESC:
-            rVal = Bool2Any(DFLT_ESC_AUTO_SUB == nEsc || DFLT_ESC_AUTO_SUPER == nEsc);
+            rVal = css::uno::makeAny<bool>(DFLT_ESC_AUTO_SUB == nEsc || DFLT_ESC_AUTO_SUPER == nEsc);
         break;
     }
     return true;
@@ -2946,7 +2946,7 @@ bool SvxTwoLinesItem::QueryValue( com::sun::star::uno::Any& rVal,
     switch( nMemberId )
     {
     case MID_TWOLINES:
-        rVal = Bool2Any( bOn );
+        rVal = css::uno::makeAny<bool>( bOn );
         break;
     case MID_START_BRACKET:
         {
@@ -3109,7 +3109,7 @@ bool SvxCharRotateItem::QueryValue( com::sun::star::uno::Any& rVal,
         rVal <<= (sal_Int16)GetValue();
         break;
     case MID_FITTOLINE:
-        rVal = Bool2Any( IsFitToLine() );
+        rVal = css::uno::makeAny<bool>( IsFitToLine() );
         break;
     default:
         bRet = false;
diff --git a/include/svl/poolitem.hxx b/include/svl/poolitem.hxx
index 518c875..156ea48 100644
--- a/include/svl/poolitem.hxx
+++ b/include/svl/poolitem.hxx
@@ -75,11 +75,6 @@ inline bool Any2Bool( const ::com::sun::star::uno::Any&rValue )
     return nValue;
 }
 
-inline ::com::sun::star::uno::Any Bool2Any( bool bValue )
-{
-    return ::com::sun::star::uno::Any( &bValue, cppu::UnoType<bool>::get() );
-}
-
 enum SfxMapUnit
 {
     SFX_MAPUNIT_100TH_MM,
diff --git a/svx/source/items/pageitem.cxx b/svx/source/items/pageitem.cxx
index b92e946..6468aca 100644
--- a/svx/source/items/pageitem.cxx
+++ b/svx/source/items/pageitem.cxx
@@ -152,7 +152,7 @@ bool SvxPageItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
         break;
         case MID_PAGE_ORIENTATION:
             //Landscape= sal_True
-            rVal = Bool2Any(bLandscape);
+            rVal = css::uno::makeAny<bool>(bLandscape);
         break;
         case MID_PAGE_LAYOUT     :
         {


More information about the Libreoffice-commits mailing list