[Libreoffice-commits] core.git: 2 commits - oox/source sfx2/source

Noel Power noel.power at suse.com
Thu Apr 18 04:33:40 PDT 2013


 oox/source/ole/axcontrol.cxx |    1 
 sfx2/source/doc/zoomitem.cxx |  124 +++++++++++++++++++++++++++++--------------
 2 files changed, 85 insertions(+), 40 deletions(-)

New commits:
commit b850ab574c11cf1d597035eca875181c6de31ea6
Author: Noel Power <noel.power at suse.com>
Date:   Thu Apr 18 12:32:24 2013 +0100

    fix Frame import for oox filter
    
    Change-Id: Ie165b509ea7668a3064e16b537bf2e51345324ba

diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx
index 38b959e..d5303a4 100644
--- a/oox/source/ole/axcontrol.cxx
+++ b/oox/source/ole/axcontrol.cxx
@@ -623,6 +623,7 @@ OUString ControlModelBase::getServiceName() const
         case API_CONTROL_SCROLLBAR:     return OUString( "com.sun.star.form.component.ScrollBar" );
         case API_CONTROL_PROGRESSBAR:   return OUString( "com.sun.star.awt.UnoControlProgressBarModel" );
         case API_CONTROL_GROUPBOX:      return OUString( "com.sun.star.form.component.GroupBox" );
+        case API_CONTROL_FRAME:         return OUString( "com.sun.star.awt.UnoFrameModel" );
         case API_CONTROL_PAGE:          return OUString( "com.sun.star.awt.UnoPageModel" );
         case API_CONTROL_MULTIPAGE:     return OUString( "com.sun.star.awt.UnoMultiPageModel" );
         case API_CONTROL_DIALOG:        return OUString( "com.sun.star.awt.UnoControlDialogModel" );
commit c903c377ec885465e422d6acf0e8eb75483dff30
Author: Noel Power <noel.power at suse.com>
Date:   Thu Apr 18 11:54:42 2013 +0100

    fix fdo#63659 restore handling of ZOOM MID, MID_VALUESET & MID_TYPE sub parmas
    
    Change-Id: I01eff3bb8b194e1437a263e527cb8e6d2defa4de

diff --git a/sfx2/source/doc/zoomitem.cxx b/sfx2/source/doc/zoomitem.cxx
index 939141b..09b2ae7 100644
--- a/sfx2/source/doc/zoomitem.cxx
+++ b/sfx2/source/doc/zoomitem.cxx
@@ -23,7 +23,7 @@
 #include <sfx2/zoomitem.hxx>
 #include <com/sun/star/uno/Sequence.hxx>
 #include <com/sun/star/beans/PropertyValue.hpp>
-
+#include "sfx.hrc"
 // -----------------------------------------------------------------------
 
 TYPEINIT1_FACTORY(SvxZoomItem,SfxUInt16Item, new SvxZoomItem);
@@ -107,19 +107,28 @@ int SvxZoomItem::operator==( const SfxPoolItem& rAttr ) const
 
 bool SvxZoomItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const
 {
-//  sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
     nMemberId &= ~CONVERT_TWIPS;
+    switch( nMemberId )
+    {
+        case 0:
+        {
+            ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aSeq( ZOOM_PARAMS );
+            aSeq[0].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( ZOOM_PARAM_VALUE ));
+            aSeq[0].Value <<= sal_Int32( GetValue() );
+            aSeq[1].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( ZOOM_PARAM_VALUESET ));
+            aSeq[1].Value <<= sal_Int16( nValueSet );
+            aSeq[2].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( ZOOM_PARAM_TYPE ));
+            aSeq[2].Value <<= sal_Int16( eType );
+            rVal <<= aSeq;
+        }
 
-    assert(nMemberId == 0);
-
-    ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aSeq( ZOOM_PARAMS );
-    aSeq[0].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( ZOOM_PARAM_VALUE ));
-    aSeq[0].Value <<= sal_Int32( GetValue() );
-    aSeq[1].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( ZOOM_PARAM_VALUESET ));
-    aSeq[1].Value <<= sal_Int16( nValueSet );
-    aSeq[2].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( ZOOM_PARAM_TYPE ));
-    aSeq[2].Value <<= sal_Int16( eType );
-    rVal <<= aSeq;
+        case MID_VALUE: rVal <<= (sal_Int32) GetValue(); break;
+        case MID_VALUESET: rVal <<= (sal_Int16) nValueSet; break;
+        case MID_TYPE: rVal <<= (sal_Int16) eType; break;
+        default:
+            OSL_FAIL("sfx2::SvxZoomItem::QueryValue(), Wrong MemberId!");
+            return false;
+    }
 
     return true;
 }
@@ -127,45 +136,80 @@ bool SvxZoomItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberI
 bool SvxZoomItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId )
 {
     nMemberId &= ~CONVERT_TWIPS;
-    assert(nMemberId == 0);
-
-    ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aSeq;
-    if (( rVal >>= aSeq ) && ( aSeq.getLength() == ZOOM_PARAMS ))
+    switch( nMemberId )
     {
-        sal_Int32 nValueTmp( 0 );
-        sal_Int16 nValueSetTmp( 0 );
-        sal_Int16 nTypeTmp( 0 );
-        sal_Bool  bAllConverted( sal_True );
-        sal_Int16 nConvertedCount( 0 );
-        for ( sal_Int32 i = 0; i < aSeq.getLength(); i++ )
+        case 0:
         {
-            if ( aSeq[i].Name.equalsAscii( ZOOM_PARAM_VALUE ))
-            {
-                bAllConverted &= ( aSeq[i].Value >>= nValueTmp );
-                ++nConvertedCount;
-            }
-            else if ( aSeq[i].Name.equalsAscii( ZOOM_PARAM_VALUESET ))
+            ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aSeq;
+            if (( rVal >>= aSeq ) && ( aSeq.getLength() == ZOOM_PARAMS ))
             {
-                bAllConverted &= ( aSeq[i].Value >>= nValueSetTmp );
-                ++nConvertedCount;
+                sal_Int32 nValueTmp( 0 );
+                sal_Int16 nValueSetTmp( 0 );
+                sal_Int16 nTypeTmp( 0 );
+                sal_Bool  bAllConverted( sal_True );
+                sal_Int16 nConvertedCount( 0 );
+                for ( sal_Int32 i = 0; i < aSeq.getLength(); i++ )
+                {
+                    if ( aSeq[i].Name.equalsAscii( ZOOM_PARAM_VALUE ))
+                    {
+                        bAllConverted &= ( aSeq[i].Value >>= nValueTmp );
+                        ++nConvertedCount;
+                    }
+                    else if ( aSeq[i].Name.equalsAscii( ZOOM_PARAM_VALUESET ))
+                    {
+                        bAllConverted &= ( aSeq[i].Value >>= nValueSetTmp );
+                        ++nConvertedCount;
+                    }
+                    else if ( aSeq[i].Name.equalsAscii( ZOOM_PARAM_TYPE ))
+                    {
+                        bAllConverted &= ( aSeq[i].Value >>= nTypeTmp );
+                        ++nConvertedCount;
+                    }
+                }
+
+                if ( bAllConverted && nConvertedCount == ZOOM_PARAMS )
+                {
+                    SetValue( (sal_uInt16)nValueTmp );
+                    nValueSet = nValueSetTmp;
+                    eType = SvxZoomType( nTypeTmp );
+                    return true;
+                }
             }
-            else if ( aSeq[i].Name.equalsAscii( ZOOM_PARAM_TYPE ))
+            return false;
+        }
+        case MID_VALUE:
+        {
+            sal_Int32 nVal = 0;
+            if ( rVal >>= nVal )
             {
-                bAllConverted &= ( aSeq[i].Value >>= nTypeTmp );
-                ++nConvertedCount;
+                SetValue( (sal_uInt16)nVal );
+                return true;
             }
+            else
+                return false;
         }
 
-        if ( bAllConverted && nConvertedCount == ZOOM_PARAMS )
+        case MID_VALUESET:
+        case MID_TYPE:
         {
-            SetValue( (sal_uInt16)nValueTmp );
-            nValueSet = nValueSetTmp;
-            eType = SvxZoomType( nTypeTmp );
-            return true;
+            sal_Int16 nVal = sal_Int16();
+            if ( rVal >>= nVal )
+            {
+                if ( nMemberId == MID_VALUESET )
+                    nValueSet = (sal_Int16) nVal;
+                else if ( nMemberId == MID_TYPE )
+                    eType = SvxZoomType( (sal_Int16) nVal );
+                return true;
+            }
+            else
+                return false;
         }
-    }
 
-    return false;
+        default:
+            OSL_FAIL("sfx2::SvxZoomItem::PutValue(), Wrong MemberId!");
+            return false;
+    }
+    return true;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list