[Libreoffice-commits] .: Branch 'integration/dev300_m106' - vbahelper/inc vbahelper/Library_msforms.mk vbahelper/Library_vbahelper.mk vbahelper/source

Jan Holesovsky kendy at kemper.freedesktop.org
Mon May 23 08:31:28 PDT 2011


 vbahelper/Library_msforms.mk                         |    1 
 vbahelper/Library_vbahelper.mk                       |    1 
 vbahelper/inc/vbahelper/vbaeventshelperbase.hxx      |    4 
 vbahelper/source/msforms/vbacontrol.cxx              |   33 +-
 vbahelper/source/msforms/vbaframe.cxx                |    8 
 vbahelper/source/msforms/vbalabel.cxx                |    2 
 vbahelper/source/vbahelper/vbacommandbar.cxx         |    9 
 vbahelper/source/vbahelper/vbacommandbarcontrols.hxx |    2 
 vbahelper/source/vbahelper/vbahelper.cxx             |  313 +++++++++----------
 9 files changed, 174 insertions(+), 199 deletions(-)

New commits:
commit a019d3e3c180b0ec41e2725e7cfe442afccf9cb0
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Mon May 23 17:27:25 2011 +0200

    vbahelper builds after the m106 merge.

diff --git a/vbahelper/Library_msforms.mk b/vbahelper/Library_msforms.mk
index 58a90a7..e1b00c7 100755
--- a/vbahelper/Library_msforms.mk
+++ b/vbahelper/Library_msforms.mk
@@ -56,7 +56,6 @@ $(eval $(call gb_Library_add_linked_libs,msforms,\
     svl \
     svt \
     svx \
-    stl \
     tk \
     tl \
     vbahelper \
diff --git a/vbahelper/Library_vbahelper.mk b/vbahelper/Library_vbahelper.mk
index af6b408..3b78599 100755
--- a/vbahelper/Library_vbahelper.mk
+++ b/vbahelper/Library_vbahelper.mk
@@ -57,7 +57,6 @@ $(eval $(call gb_Library_add_linked_libs,vbahelper,\
     sal \
     sb \
     sfx \
-    stl \
     svl \
     svt \
     tk \
diff --git a/vbahelper/inc/vbahelper/vbaeventshelperbase.hxx b/vbahelper/inc/vbahelper/vbaeventshelperbase.hxx
index 6341ed5..b5924e2 100644
--- a/vbahelper/inc/vbahelper/vbaeventshelperbase.hxx
+++ b/vbahelper/inc/vbahelper/vbaeventshelperbase.hxx
@@ -30,8 +30,8 @@
 #define VBAHELPER_VBAEVENTSHELPERBASE_HXX
 
 #include <deque>
-#include <hash_map>
 #include <map>
+#include <boost/unordered_map.hpp>
 #include <com/sun/star/document/XEventListener.hpp>
 #include <com/sun/star/script/vba/XVBAEventProcessor.hpp>
 #include <com/sun/star/util/XChangesListener.hpp>
@@ -177,7 +177,7 @@ protected:
 
 private:
     typedef ::std::map< sal_Int32, EventHandlerInfo > EventHandlerInfoMap;
-    typedef ::std::hash_map< ::rtl::OUString, ModulePathMap, ::rtl::OUStringHash > EventHandlerPathMap;
+    typedef boost::unordered_map< ::rtl::OUString, ModulePathMap, ::rtl::OUStringHash > EventHandlerPathMap;
 
     EventHandlerInfoMap maEventInfos;
     EventHandlerPathMap maEventPaths;
diff --git a/vbahelper/source/msforms/vbacontrol.cxx b/vbahelper/source/msforms/vbacontrol.cxx
index 09fdabc..e8df3a5 100644
--- a/vbahelper/source/msforms/vbacontrol.cxx
+++ b/vbahelper/source/msforms/vbacontrol.cxx
@@ -411,6 +411,18 @@ void SAL_CALL ScVbaControl::setTag( const ::rtl::OUString& aTag )
     m_aControlTag = aTag;
 }
 
+::sal_Int32 SAL_CALL ScVbaControl::getForeColor() throw (::com::sun::star::uno::RuntimeException)
+{
+    sal_Int32 nForeColor = -1;
+    m_xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TextColor" ) ) ) >>= nForeColor;
+    return OORGBToXLRGB( nForeColor );
+}
+
+void SAL_CALL ScVbaControl::setForeColor( ::sal_Int32 _forecolor ) throw (::com::sun::star::uno::RuntimeException)
+{
+     m_xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TextColor" ) ), uno::makeAny( XLRGBToOORGB( _forecolor ) ) );
+}
+
 void ScVbaControl::fireEvent( script::ScriptEvent& evt )
 {
     uno::Reference<lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_QUERY_THROW );
@@ -500,7 +512,8 @@ void SAL_CALL ScVbaControl::setTabIndex( sal_Int32 /*nTabIndex*/ ) throw (uno::R
     const static rtl::OUString sClassId( RTL_CONSTASCII_USTRINGPARAM("ClassId") );
     xProps->getPropertyValue( sClassId ) >>= nClassId;
     uno::Reference< XHelperInterface > xVbaParent; // #FIXME - should be worksheet I guess
-    sal_Bool bToggle = sal_False;
+    uno::Reference< drawing::XShape > xShape( xControlShape, uno::UNO_QUERY_THROW );
+    ::std::auto_ptr< ConcreteXShapeGeometryAttributes > xGeoHelper( new ConcreteXShapeGeometryAttributes( xContext, xShape ) );
     switch( nClassId )
     {
         case form::FormComponentType::COMBOBOX:
@@ -512,7 +525,7 @@ void SAL_CALL ScVbaControl::setTabIndex( sal_Int32 /*nTabIndex*/ ) throw (uno::R
         case form::FormComponentType::TEXTFIELD:
             return new ScVbaTextBox( xVbaParent, xContext, xControlShape, xModel, xGeoHelper.release() );
         case form::FormComponentType::CHECKBOX:
-            return new ScVbaCheckbox( xVbaParent, m_xContext, xControlShape, m_xModel, xGeoHelper.release() );
+            return new ScVbaCheckbox( xVbaParent, xContext, xControlShape, xModel, xGeoHelper.release() );
         case form::FormComponentType::RADIOBUTTON:
             return new ScVbaRadioButton( xVbaParent, xContext, xControlShape, xModel, xGeoHelper.release() );
         case form::FormComponentType::LISTBOX:
@@ -575,13 +588,13 @@ void SAL_CALL ScVbaControl::setTabIndex( sal_Int32 /*nTabIndex*/ ) throw (uno::R
         xVBAControl.set( new VbaSystemAXControl( xVbaParent, xContext, xControl, xModel, xGeoHelper.release() ) );
     // #FIXME implement a page control
     else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoPageModel") ) ) )
-        xVBAControl.set( new ScVbaControl( xVbaParent, m_xContext, xControl, m_xModel, xGeoHelper.release() ) );
+        xVBAControl.set( new ScVbaControl( xVbaParent, xContext, xControl, xModel, xGeoHelper.release() ) );
     else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoFrameModel") ) ) )
-        xVBAControl.set( new ScVbaFrame( xVbaParent, m_xContext, xControl, m_xModel, xGeoHelper.release() ) );
+        xVBAControl.set( new ScVbaFrame( xVbaParent, xContext, xControl, xModel, xGeoHelper.release(), xDialog ) );
     else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlSpinButtonModel") ) ) )
-        xVBAControl.set( new ScVbaSpinButton( xVbaParent, m_xContext, xControl, m_xModel, xGeoHelper.release() ) );
+        xVBAControl.set( new ScVbaSpinButton( xVbaParent, xContext, xControl, xModel, xGeoHelper.release() ) );
     else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.custom.awt.UnoControlSystemAXContainerModel") ) ) )
-        xVBAControl.set( new VbaSystemAXControl( xVbaParent, m_xContext, xControl, m_xModel, xGeoHelper.release() ) );
+        xVBAControl.set( new VbaSystemAXControl( xVbaParent, xContext, xControl, xModel, xGeoHelper.release() ) );
     if( xVBAControl.is() )
         return xVBAControl;
     throw uno::RuntimeException( rtl::OUString::createFromAscii("Unsupported control." ), uno::Reference< uno::XInterface >() );
@@ -624,14 +637,6 @@ ControlProviderImpl::createControl( const uno::Reference< drawing::XControlShape
     return xControlToReturn;
 
 }
-uno::Reference< msforms::XControl > SAL_CALL
-ControlProviderImpl::createUserformControl( const uno::Reference< awt::XControl >& xControl, const uno::Reference< awt::XControl >& xDialog, const uno::Reference< frame::XModel >& xDocOwner ) throw (uno::RuntimeException)
-{
-    uno::Reference< msforms::XControl > xControlToReturn;
-    if ( xControl.is() && xDialog.is() )
-        xControlToReturn = ScVbaControlFactory::createUserformControl( m_xCtx, xControl, xDialog, xDocOwner, 0.0, 0.0 );
-    return xControlToReturn;
-}
 
 namespace controlprovider
 {
diff --git a/vbahelper/source/msforms/vbaframe.cxx b/vbahelper/source/msforms/vbaframe.cxx
index f108807..7c5f102 100644
--- a/vbahelper/source/msforms/vbaframe.cxx
+++ b/vbahelper/source/msforms/vbaframe.cxx
@@ -69,14 +69,6 @@ sal_Int32 SAL_CALL ScVbaFrame::getSpecialEffect() throw (uno::RuntimeException)
     return msforms::fmSpecialEffect::fmSpecialEffectEtched;
 }
 
-void SAL_CALL
-ScVbaFrame::setValue( const uno::Any& _value ) throw (::com::sun::star::uno::RuntimeException)
-{
-    rtl::OUString sCaption;
-    _value >>= sCaption;
-    setCaption( sCaption );
-}
-
 ::sal_Int32 SAL_CALL ScVbaFrame::getForeColor() throw (::com::sun::star::uno::RuntimeException)
 {
     return 0;
diff --git a/vbahelper/source/msforms/vbalabel.cxx b/vbahelper/source/msforms/vbalabel.cxx
index a12aa65..4795a25 100644
--- a/vbahelper/source/msforms/vbalabel.cxx
+++ b/vbahelper/source/msforms/vbalabel.cxx
@@ -84,7 +84,7 @@ uno::Reference< msforms::XNewFont > SAL_CALL ScVbaLabel::getFont() throw (uno::R
     return new VbaNewFont( this, mxContext, m_xProps );
 }
 
-ScVbaLabel::getServiceImplName()
+rtl::OUString& ScVbaLabel::getServiceImplName()
 {
     static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaLabel") );
     return sImplName;
diff --git a/vbahelper/source/vbahelper/vbacommandbar.cxx b/vbahelper/source/vbahelper/vbacommandbar.cxx
index 68fada2..cf71425 100644
--- a/vbahelper/source/vbahelper/vbacommandbar.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbar.cxx
@@ -155,14 +155,7 @@ ScVbaCommandBar::Delete(  ) throw (script::BasicErrorException, uno::RuntimeExce
 uno::Any SAL_CALL 
 ScVbaCommandBar::Controls( const uno::Any& aIndex ) throw (script::BasicErrorException, uno::RuntimeException)
 {
-    uno::Reference< awt::XMenu > xMenu;
-    if( m_bIsMenu )
-    {
-        uno::Reference< frame::XLayoutManager > xLayoutManager = pCBarHelper->getLayoutManager();
-        uno::Reference< beans::XPropertySet > xPropertySet( xLayoutManager->getElement( m_sResourceUrl ), uno::UNO_QUERY_THROW );
-        xMenu.set( xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("XMenuBar")) ), uno::UNO_QUERY );
-    }
-    uno::Reference< XCommandBarControls > xCommandBarControls( new ScVbaCommandBarControls( this, mxContext, m_xBarSettings, pCBarHelper, m_xBarSettings, m_sResourceUrl, xMenu ) );
+    uno::Reference< XCommandBarControls > xCommandBarControls( new ScVbaCommandBarControls( this, mxContext, m_xBarSettings, pCBarHelper, m_xBarSettings, m_sResourceUrl ) );
     if( aIndex.hasValue() )
     {
         return xCommandBarControls->Item( aIndex, uno::Any() );
diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrols.hxx b/vbahelper/source/vbahelper/vbacommandbarcontrols.hxx
index 4b66b8c..7c6cff9 100644
--- a/vbahelper/source/vbahelper/vbacommandbarcontrols.hxx
+++ b/vbahelper/source/vbahelper/vbacommandbarcontrols.hxx
@@ -54,7 +54,7 @@ private:
     css::uno::Sequence< css::beans::PropertyValue > CreateToolbarItemData( const rtl::OUString& sCommandURL, const rtl::OUString& sHelpURL, const rtl::OUString& sLabel, sal_uInt16 nType, const css::uno::Any& aSubMenu, sal_Bool isVisible, sal_Int32 nStyle );
 
 public:
-    ScVbaCommandBarControls( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const rtl::OUString& sResourceUrl, const css::uno::Reference< css::awt::XMenu >& xMenu ) throw( css::uno::RuntimeException );
+    ScVbaCommandBarControls( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const rtl::OUString& sResourceUrl ) throw( css::uno::RuntimeException );
     sal_Bool IsMenu(){ return m_bIsMenu; }
 
     // XEnumerationAccess
diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx
index e5908ec..fcc0bf3 100644
--- a/vbahelper/source/vbahelper/vbahelper.cxx
+++ b/vbahelper/source/vbahelper/vbahelper.cxx
@@ -505,7 +505,6 @@ sal_Int32 extractIntFromAny( const uno::Any& rAny ) throw (uno::RuntimeException
 sal_Int32 extractIntFromAny( const uno::Any& rAny, sal_Int32 nDefault ) throw (uno::RuntimeException)
 {
     return rAny.hasValue() ? extractIntFromAny( rAny ) : nDefault;
->>>>>>> ooo/DEV300_m106
 }
 
 bool extractBoolFromAny( const uno::Any& rAny ) throw (uno::RuntimeException)
@@ -1055,202 +1054,190 @@ void UserFormGeometryHelper::implSetSize( double fSize, bool bHeight, bool bOute
 
 // ============================================================================
 
-    double ConcreteXShapeGeometryAttributes::getLeft() const
-    {
-        return m_pShapeHelper->getLeft();
-    }
-    void ConcreteXShapeGeometryAttributes::setLeft( double nLeft )
-    {
-        m_pShapeHelper->setLeft( nLeft );
-    }
-    double ConcreteXShapeGeometryAttributes::getTop() const
-    {
-        return m_pShapeHelper->getTop();
-    }
-    void ConcreteXShapeGeometryAttributes::setTop( double nTop )
-    {
-        m_pShapeHelper->setTop( nTop );
-    }
+double ConcreteXShapeGeometryAttributes::getLeft() const
+{
+    return m_pShapeHelper->getLeft();
+}
+void ConcreteXShapeGeometryAttributes::setLeft( double nLeft )
+{
+    m_pShapeHelper->setLeft( nLeft );
+}
+double ConcreteXShapeGeometryAttributes::getTop() const
+{
+    return m_pShapeHelper->getTop();
+}
+void ConcreteXShapeGeometryAttributes::setTop( double nTop )
+{
+    m_pShapeHelper->setTop( nTop );
+}
 
-    double ConcreteXShapeGeometryAttributes::getHeight() const
-    {
-        return m_pShapeHelper->getHeight();
-    }
-    void ConcreteXShapeGeometryAttributes::setHeight( double nHeight )
-    {
-        m_pShapeHelper->setHeight( nHeight );
-    }
-    double ConcreteXShapeGeometryAttributes::getWidth() const
-    {
-        return m_pShapeHelper->getWidth();
-    }
-    void ConcreteXShapeGeometryAttributes::setWidth( double nWidth)
-    {
-        m_pShapeHelper->setWidth( nWidth );
-    }
+double ConcreteXShapeGeometryAttributes::getHeight() const
+{
+    return m_pShapeHelper->getHeight();
+}
+void ConcreteXShapeGeometryAttributes::setHeight( double nHeight )
+{
+    m_pShapeHelper->setHeight( nHeight );
+}
+double ConcreteXShapeGeometryAttributes::getWidth() const
+{
+    return m_pShapeHelper->getWidth();
+}
+void ConcreteXShapeGeometryAttributes::setWidth( double nWidth)
+{
+    m_pShapeHelper->setWidth( nWidth );
+}
 
 
-    ShapeHelper::ShapeHelper( const css::uno::Reference< css::drawing::XShape >& _xShape) throw (css::script::BasicErrorException ) : xShape( _xShape )
-    {
-        if( !xShape.is() )
-            throw css::uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("No valid shape for helper")), css::uno::Reference< css::uno::XInterface >() );
+ShapeHelper::ShapeHelper( const css::uno::Reference< css::drawing::XShape >& _xShape) throw (css::script::BasicErrorException ) : xShape( _xShape )
+{
+    if( !xShape.is() )
+        throw css::uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("No valid shape for helper")), css::uno::Reference< css::uno::XInterface >() );
+}
+
+double ShapeHelper::getHeight() const
+{
+        return  Millimeter::getInPoints(xShape->getSize().Height);
     }
-    
-    double ShapeHelper::getHeight() const
-    {
-            return  Millimeter::getInPoints(xShape->getSize().Height);
-        }
 
 
-        void ShapeHelper::setHeight(double _fheight) throw ( css::script::BasicErrorException )
+    void ShapeHelper::setHeight(double _fheight) throw ( css::script::BasicErrorException )
+{
+    try
     {
-        try
-        {
-            css::awt::Size aSize = xShape->getSize();
-            aSize.Height = Millimeter::getInHundredthsOfOneMillimeter(_fheight);
-            xShape->setSize(aSize);
-        }
-        catch ( css::uno::Exception& /*e*/)
-        {
-            throw css::script::BasicErrorException( rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() );
-            }
+        css::awt::Size aSize = xShape->getSize();
+        aSize.Height = Millimeter::getInHundredthsOfOneMillimeter(_fheight);
+        xShape->setSize(aSize);
     }
-    double ShapeHelper::getWidth() const
-    { 
-        return Millimeter::getInPoints(xShape->getSize().Width);
+    catch ( css::uno::Exception& /*e*/)
+    {
+        throw css::script::BasicErrorException( rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() );
         }
+}
+double ShapeHelper::getWidth() const
+{
+    return Millimeter::getInPoints(xShape->getSize().Width);
+    }
 
-    void ShapeHelper::setWidth(double _fWidth) throw ( css::script::BasicErrorException )
+void ShapeHelper::setWidth(double _fWidth) throw ( css::script::BasicErrorException )
+{
+    try
     {
-        try
-        {
-            css::awt::Size aSize = xShape->getSize();
-            aSize.Width = Millimeter::getInHundredthsOfOneMillimeter(_fWidth);
-            xShape->setSize(aSize);
-        }
-        catch (css::uno::Exception& /*e*/)
-        {
-            throw css::script::BasicErrorException( rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() );
-        }
+        css::awt::Size aSize = xShape->getSize();
+        aSize.Width = Millimeter::getInHundredthsOfOneMillimeter(_fWidth);
+        xShape->setSize(aSize);
     }
-    
-    
-    double ShapeHelper::getLeft() const
+    catch (css::uno::Exception& /*e*/)
     {
-        return Millimeter::getInPoints(xShape->getPosition().X);
+        throw css::script::BasicErrorException( rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() );
     }
+}
 
 
-    void ShapeHelper::setLeft(double _fLeft)
-    {
-        css::awt::Point aPoint = xShape->getPosition();
-        aPoint.X = Millimeter::getInHundredthsOfOneMillimeter(_fLeft);
-        xShape->setPosition(aPoint);
-    }
+double ShapeHelper::getLeft() const
+{
+    return Millimeter::getInPoints(xShape->getPosition().X);
+}
 
 
-    double ShapeHelper::getTop() const
-    {
-            return Millimeter::getInPoints(xShape->getPosition().Y);
-    }
+void ShapeHelper::setLeft(double _fLeft)
+{
+    css::awt::Point aPoint = xShape->getPosition();
+    aPoint.X = Millimeter::getInHundredthsOfOneMillimeter(_fLeft);
+    xShape->setPosition(aPoint);
+}
 
 
-    void ShapeHelper::setTop(double _fTop)
-    {
-        css::awt::Point aPoint = xShape->getPosition();
-        aPoint.Y = Millimeter::getInHundredthsOfOneMillimeter(_fTop);
-        xShape->setPosition(aPoint);
-    }
+double ShapeHelper::getTop() const
+{
+        return Millimeter::getInPoints(xShape->getPosition().Y);
+}
 
-    void DebugHelper::exception( const rtl::OUString&  DetailedMessage, const css::uno::Exception& ex,  int err, const rtl::OUString& /*additionalArgument*/ ) throw( css::script::BasicErrorException )
-    {
-        // #TODO #FIXME ( do we want to support additionalArg here )
-        throw css::script::BasicErrorException( DetailedMessage.concat( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ")) ).concat( ex.Message ), css::uno::Reference< css::uno::XInterface >(), err, rtl::OUString() );
-    }
 
-    void DebugHelper::exception( int err,  const rtl::OUString& additionalArgument ) throw( css::script::BasicErrorException )
-    {
-        exception( rtl::OUString(), css::uno::Exception(), err, additionalArgument );
-    }
-    void DebugHelper::exception( const css::uno::Exception& ex ) throw( css::script::BasicErrorException )
-    {
-        exception( rtl::OUString(), ex, SbERR_INTERNAL_ERROR, rtl::OUString() );
-    }
+void ShapeHelper::setTop(double _fTop)
+{
+    css::awt::Point aPoint = xShape->getPosition();
+    aPoint.Y = Millimeter::getInHundredthsOfOneMillimeter(_fTop);
+    xShape->setPosition(aPoint);
+}
 
-    Millimeter::Millimeter():m_nMillimeter(0) {}
+void DebugHelper::exception( const rtl::OUString&  DetailedMessage, const css::uno::Exception& ex,  int err, const rtl::OUString& /*additionalArgument*/ ) throw( css::script::BasicErrorException )
+{
+    // #TODO #FIXME ( do we want to support additionalArg here )
+    throw css::script::BasicErrorException( DetailedMessage.concat( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ")) ).concat( ex.Message ), css::uno::Reference< css::uno::XInterface >(), err, rtl::OUString() );
+}
 
-    Millimeter::Millimeter(double mm):m_nMillimeter(mm) {}
+void DebugHelper::exception( int err,  const rtl::OUString& additionalArgument ) throw( css::script::BasicErrorException )
+{
+    exception( rtl::OUString(), css::uno::Exception(), err, additionalArgument );
+}
+void DebugHelper::exception( const css::uno::Exception& ex ) throw( css::script::BasicErrorException )
+{
+    exception( rtl::OUString(), ex, SbERR_INTERNAL_ERROR, rtl::OUString() );
+}
 
-    void Millimeter::set(double mm) { m_nMillimeter = mm; }
-    void Millimeter::setInPoints(double points)
-    {
-        m_nMillimeter = points * factor / 100.0;
-    }
+Millimeter::Millimeter():m_nMillimeter(0) {}
 
-    void Millimeter::setInHundredthsOfOneMillimeter(double hmm)
-    {
-        m_nMillimeter = hmm / 100;
-    }
+Millimeter::Millimeter(double mm):m_nMillimeter(mm) {}
 
-    double Millimeter::get()
-    {
-        return m_nMillimeter;
-    }
-    double Millimeter::getInHundredthsOfOneMillimeter()
-    {
-        return m_nMillimeter * 100;
-    }
-    double Millimeter::getInPoints()
-    {
-        return m_nMillimeter / factor * 100.0;
-    }
+void Millimeter::set(double mm) { m_nMillimeter = mm; }
+void Millimeter::setInPoints(double points)
+{
+    m_nMillimeter = points * factor / 100.0;
+}
 
-    sal_Int32 Millimeter::getInHundredthsOfOneMillimeter(double points)
-    {
-        sal_Int32 mm = static_cast<sal_Int32>(points * factor);
-        return mm;
-    }
+void Millimeter::setInHundredthsOfOneMillimeter(double hmm)
+{
+    m_nMillimeter = hmm / 100;
+}
 
-    double Millimeter::getInPoints(int _hmm)
-    {
-        double points = double( static_cast<double>(_hmm) / factor);
-        return points;
-    }
+double Millimeter::get()
+{
+    return m_nMillimeter;
+}
+double Millimeter::getInHundredthsOfOneMillimeter()
+{
+    return m_nMillimeter * 100;
+}
+double Millimeter::getInPoints()
+{
+    return m_nMillimeter / factor * 100.0;
+}
 
-    // Listener for XNotifyingDispatch
-    VBADispatchListener::VBADispatchListener() : m_State( sal_False )
-    {
-    }
+sal_Int32 Millimeter::getInHundredthsOfOneMillimeter(double points)
+{
+    sal_Int32 mm = static_cast<sal_Int32>(points * factor);
+    return mm;
+}
 
-    // Listener for XNotifyingDispatch
-    VBADispatchListener::~VBADispatchListener()
-    {
-    }
+double Millimeter::getInPoints(int _hmm)
+{
+    double points = double( static_cast<double>(_hmm) / factor);
+    return points;
+}
 
-    // Listener for XNotifyingDispatch
-    void SAL_CALL VBADispatchListener::dispatchFinished( const frame::DispatchResultEvent& aEvent ) throw ( uno::RuntimeException )
-    {
-        m_Result = aEvent.Result;
-        m_State = ( aEvent.State == frame::DispatchResultState::SUCCESS ) ? sal_True : sal_False;
-    }
+// Listener for XNotifyingDispatch
+VBADispatchListener::VBADispatchListener() : m_State( sal_False )
+{
+}
 
-    // Listener for XNotifyingDispatch
-    void SAL_CALL VBADispatchListener::disposing( const lang::EventObject& /*aEvent*/ ) throw( uno::RuntimeException )
-    {
-    }
+// Listener for XNotifyingDispatch
+VBADispatchListener::~VBADispatchListener()
+{
+}
+
+// Listener for XNotifyingDispatch
+void SAL_CALL VBADispatchListener::dispatchFinished( const frame::DispatchResultEvent& aEvent ) throw ( uno::RuntimeException )
+{
+    m_Result = aEvent.Result;
+    m_State = ( aEvent.State == frame::DispatchResultState::SUCCESS ) ? sal_True : sal_False;
+}
+
+// Listener for XNotifyingDispatch
+void SAL_CALL VBADispatchListener::disposing( const lang::EventObject& /*aEvent*/ ) throw( uno::RuntimeException )
+{
+}
 
-        SfxObjectShell* getSfxObjShell( const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException)
-        {
-            SfxObjectShell* pFoundShell = NULL;
-            if ( xModel.is() )
-            {
-                uno::Reference< lang::XUnoTunnel >  xObjShellTunnel( xModel, uno::UNO_QUERY_THROW );
-                pFoundShell = reinterpret_cast<SfxObjectShell*>( xObjShellTunnel->getSomething(SfxObjectShell::getUnoTunnelId()));
-            }
-            if ( !pFoundShell )
-                throw uno::RuntimeException();
-            return pFoundShell;
-        }
 uno::Reference< XHelperInterface > getVBADocument( const uno::Reference< frame::XModel >& xModel )
 {
     uno::Reference< XHelperInterface > xIf;


More information about the Libreoffice-commits mailing list