Kaydet (Commit) 6ed2f211 authored tarafından Olivier Hallot's avatar Olivier Hallot

More OUString cleanup in vbahelper

Change-Id: Ie9c650da762e9d5afea9018dd2c6496fcd14ca6f
Reviewed-on: https://gerrit.libreoffice.org/577Reviewed-by: 's avatarOlivier Hallot <olivier.hallot@alta.org.br>
Tested-by: 's avatarOlivier Hallot <olivier.hallot@alta.org.br>
üst 1b9c7dae
...@@ -53,7 +53,7 @@ using namespace ::ooo::vba; ...@@ -53,7 +53,7 @@ using namespace ::ooo::vba;
#define OFFICEVERSION "11.0" #define OFFICEVERSION "11.0"
// ====VbaTimerInfo================================== // ====VbaTimerInfo==================================
typedef ::std::pair< ::rtl::OUString, ::std::pair< double, double > > VbaTimerInfo; typedef ::std::pair< OUString, ::std::pair< double, double > > VbaTimerInfo;
// ====VbaTimer================================== // ====VbaTimer==================================
class VbaTimer class VbaTimer
...@@ -98,10 +98,10 @@ public: ...@@ -98,10 +98,10 @@ public:
return (sal_Int32) nResult; return (sal_Int32) nResult;
} }
void Start( const ::rtl::Reference< VbaApplicationBase > xBase, const ::rtl::OUString& aFunction, double nFrom, double nTo ) void Start( const ::rtl::Reference< VbaApplicationBase > xBase, const OUString& aFunction, double nFrom, double nTo )
{ {
if ( !xBase.is() || aFunction.isEmpty() ) if ( !xBase.is() || aFunction.isEmpty() )
throw uno::RuntimeException( ::rtl::OUString( "Unexpected arguments!" ), uno::Reference< uno::XInterface >() ); throw uno::RuntimeException( "Unexpected arguments!" , uno::Reference< uno::XInterface >() );
m_xBase = xBase; m_xBase = xBase;
m_aTimerInfo = VbaTimerInfo( aFunction, ::std::pair< double, double >( nFrom, nTo ) ); m_aTimerInfo = VbaTimerInfo( aFunction, ::std::pair< double, double >( nFrom, nTo ) );
...@@ -206,8 +206,8 @@ VbaApplicationBase::getDisplayStatusBar() throw (uno::RuntimeException) ...@@ -206,8 +206,8 @@ VbaApplicationBase::getDisplayStatusBar() throw (uno::RuntimeException)
uno::Reference< beans::XPropertySet > xProps( xFrame, uno::UNO_QUERY_THROW ); uno::Reference< beans::XPropertySet > xProps( xFrame, uno::UNO_QUERY_THROW );
if( xProps.is() ){ if( xProps.is() ){
uno::Reference< frame::XLayoutManager > xLayoutManager( xProps->getPropertyValue( rtl::OUString("LayoutManager") ), uno::UNO_QUERY_THROW ); uno::Reference< frame::XLayoutManager > xLayoutManager( xProps->getPropertyValue( "LayoutManager"), uno::UNO_QUERY_THROW );
rtl::OUString url( "private:resource/statusbar/statusbar" ); OUString url( "private:resource/statusbar/statusbar" );
if( xLayoutManager.is() && xLayoutManager->isElementVisible( url ) ){ if( xLayoutManager.is() && xLayoutManager->isElementVisible( url ) ){
return sal_True; return sal_True;
} }
...@@ -223,8 +223,8 @@ VbaApplicationBase::setDisplayStatusBar(sal_Bool bDisplayStatusBar) throw (uno:: ...@@ -223,8 +223,8 @@ VbaApplicationBase::setDisplayStatusBar(sal_Bool bDisplayStatusBar) throw (uno::
uno::Reference< beans::XPropertySet > xProps( xFrame, uno::UNO_QUERY_THROW ); uno::Reference< beans::XPropertySet > xProps( xFrame, uno::UNO_QUERY_THROW );
if( xProps.is() ){ if( xProps.is() ){
uno::Reference< frame::XLayoutManager > xLayoutManager( xProps->getPropertyValue( rtl::OUString("LayoutManager") ), uno::UNO_QUERY_THROW ); uno::Reference< frame::XLayoutManager > xLayoutManager( xProps->getPropertyValue( "LayoutManager" ), uno::UNO_QUERY_THROW );
rtl::OUString url( "private:resource/statusbar/statusbar" ); OUString url( "private:resource/statusbar/statusbar" );
if( xLayoutManager.is() ){ if( xLayoutManager.is() ){
if( bDisplayStatusBar && !xLayoutManager->isElementVisible( url ) ){ if( bDisplayStatusBar && !xLayoutManager->isElementVisible( url ) ){
if( !xLayoutManager->showElement( url ) ) if( !xLayoutManager->showElement( url ) )
...@@ -270,11 +270,11 @@ void SAL_CALL VbaApplicationBase::setVisible( sal_Bool bVisible ) throw (uno::Ru ...@@ -270,11 +270,11 @@ void SAL_CALL VbaApplicationBase::setVisible( sal_Bool bVisible ) throw (uno::Ru
void SAL_CALL void SAL_CALL
VbaApplicationBase::OnKey( const ::rtl::OUString& Key, const uno::Any& Procedure ) throw (uno::RuntimeException) VbaApplicationBase::OnKey( const OUString& Key, const uno::Any& Procedure ) throw (uno::RuntimeException)
{ {
// parse the Key & modifiers // parse the Key & modifiers
awt::KeyEvent aKeyEvent = parseKeyEvent( Key ); awt::KeyEvent aKeyEvent = parseKeyEvent( Key );
rtl::OUString MacroName; OUString MacroName;
Procedure >>= MacroName; Procedure >>= MacroName;
uno::Reference< frame::XModel > xModel; uno::Reference< frame::XModel > xModel;
SbMethod* pMeth = StarBASIC::GetActiveMethod(); SbMethod* pMeth = StarBASIC::GetActiveMethod();
...@@ -300,15 +300,15 @@ VbaApplicationBase::CommandBars( const uno::Any& aIndex ) throw (uno::RuntimeExc ...@@ -300,15 +300,15 @@ VbaApplicationBase::CommandBars( const uno::Any& aIndex ) throw (uno::RuntimeExc
return uno::makeAny( xCommandBars ); return uno::makeAny( xCommandBars );
} }
::rtl::OUString SAL_CALL OUString SAL_CALL
VbaApplicationBase::getVersion() throw (uno::RuntimeException) VbaApplicationBase::getVersion() throw (uno::RuntimeException)
{ {
return rtl::OUString(OFFICEVERSION); return OUString(OFFICEVERSION);
} }
uno::Any SAL_CALL VbaApplicationBase::Run( const ::rtl::OUString& MacroName, const uno::Any& varg1, const uno::Any& varg2, const uno::Any& varg3, const uno::Any& varg4, const uno::Any& varg5, const uno::Any& varg6, const uno::Any& varg7, const uno::Any& varg8, const uno::Any& varg9, const uno::Any& varg10, const uno::Any& varg11, const uno::Any& varg12, const uno::Any& varg13, const uno::Any& varg14, const uno::Any& varg15, const uno::Any& varg16, const uno::Any& varg17, const uno::Any& varg18, const uno::Any& varg19, const uno::Any& varg20, const uno::Any& varg21, const uno::Any& varg22, const uno::Any& varg23, const uno::Any& varg24, const uno::Any& varg25, const uno::Any& varg26, const uno::Any& varg27, const uno::Any& varg28, const uno::Any& varg29, const uno::Any& varg30 ) throw (uno::RuntimeException) uno::Any SAL_CALL VbaApplicationBase::Run( const OUString& MacroName, const uno::Any& varg1, const uno::Any& varg2, const uno::Any& varg3, const uno::Any& varg4, const uno::Any& varg5, const uno::Any& varg6, const uno::Any& varg7, const uno::Any& varg8, const uno::Any& varg9, const uno::Any& varg10, const uno::Any& varg11, const uno::Any& varg12, const uno::Any& varg13, const uno::Any& varg14, const uno::Any& varg15, const uno::Any& varg16, const uno::Any& varg17, const uno::Any& varg18, const uno::Any& varg19, const uno::Any& varg20, const uno::Any& varg21, const uno::Any& varg22, const uno::Any& varg23, const uno::Any& varg24, const uno::Any& varg25, const uno::Any& varg26, const uno::Any& varg27, const uno::Any& varg28, const uno::Any& varg29, const uno::Any& varg30 ) throw (uno::RuntimeException)
{ {
::rtl::OUString aMacroName = MacroName.trim(); OUString aMacroName = MacroName.trim();
if (0 == aMacroName.indexOf('!')) if (0 == aMacroName.indexOf('!'))
aMacroName = aMacroName.copy(1).trim(); aMacroName = aMacroName.copy(1).trim();
...@@ -352,21 +352,21 @@ uno::Any SAL_CALL VbaApplicationBase::Run( const ::rtl::OUString& MacroName, con ...@@ -352,21 +352,21 @@ uno::Any SAL_CALL VbaApplicationBase::Run( const ::rtl::OUString& MacroName, con
} }
else else
{ {
throw uno::RuntimeException( rtl::OUString( "The macro doesn't exist" ), uno::Reference< uno::XInterface >() ); throw uno::RuntimeException( "The macro doesn't exist" , uno::Reference< uno::XInterface >() );
} }
} }
void SAL_CALL VbaApplicationBase::OnTime( const uno::Any& aEarliestTime, const ::rtl::OUString& aFunction, const uno::Any& aLatestTime, const uno::Any& aSchedule ) void SAL_CALL VbaApplicationBase::OnTime( const uno::Any& aEarliestTime, const OUString& aFunction, const uno::Any& aLatestTime, const uno::Any& aSchedule )
throw ( uno::RuntimeException ) throw ( uno::RuntimeException )
{ {
if ( aFunction.isEmpty() ) if ( aFunction.isEmpty() )
throw uno::RuntimeException( ::rtl::OUString( "Unexpected function name!" ), uno::Reference< uno::XInterface >() ); throw uno::RuntimeException( "Unexpected function name!" , uno::Reference< uno::XInterface >() );
double nEarliestTime = 0; double nEarliestTime = 0;
double nLatestTime = 0; double nLatestTime = 0;
if ( !( aEarliestTime >>= nEarliestTime ) if ( !( aEarliestTime >>= nEarliestTime )
|| ( aLatestTime.hasValue() && !( aLatestTime >>= nLatestTime ) ) ) || ( aLatestTime.hasValue() && !( aLatestTime >>= nLatestTime ) ) )
throw uno::RuntimeException( ::rtl::OUString( "Only double is supported as time for now!" ), uno::Reference< uno::XInterface >() ); throw uno::RuntimeException( "Only double is supported as time for now!" , uno::Reference< uno::XInterface >() );
sal_Bool bSetTimer = sal_True; sal_Bool bSetTimer = sal_True;
aSchedule >>= bSetTimer; aSchedule >>= bSetTimer;
...@@ -405,7 +405,7 @@ uno::Any SAL_CALL VbaApplicationBase::getVBE() throw (uno::RuntimeException) ...@@ -405,7 +405,7 @@ uno::Any SAL_CALL VbaApplicationBase::getVBE() throw (uno::RuntimeException)
aArgs[ 0 ] <<= getCurrentDocument(); aArgs[ 0 ] <<= getCurrentDocument();
uno::Reference< lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_SET_THROW ); uno::Reference< lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_SET_THROW );
uno::Reference< uno::XInterface > xVBE = xServiceManager->createInstanceWithArgumentsAndContext( uno::Reference< uno::XInterface > xVBE = xServiceManager->createInstanceWithArgumentsAndContext(
::rtl::OUString( "ooo.vba.vbide.VBE" ), aArgs, mxContext ); "ooo.vba.vbide.VBE" , aArgs, mxContext );
return uno::Any( xVBE ); return uno::Any( xVBE );
} }
catch( const uno::Exception& ) catch( const uno::Exception& )
...@@ -414,20 +414,20 @@ uno::Any SAL_CALL VbaApplicationBase::getVBE() throw (uno::RuntimeException) ...@@ -414,20 +414,20 @@ uno::Any SAL_CALL VbaApplicationBase::getVBE() throw (uno::RuntimeException)
return uno::Any(); return uno::Any();
} }
rtl::OUString OUString
VbaApplicationBase::getServiceImplName() VbaApplicationBase::getServiceImplName()
{ {
return rtl::OUString("VbaApplicationBase"); return OUString("VbaApplicationBase");
} }
uno::Sequence<rtl::OUString> uno::Sequence<OUString>
VbaApplicationBase::getServiceNames() VbaApplicationBase::getServiceNames()
{ {
static uno::Sequence< rtl::OUString > aServiceNames; static uno::Sequence< OUString > aServiceNames;
if ( aServiceNames.getLength() == 0 ) if ( aServiceNames.getLength() == 0 )
{ {
aServiceNames.realloc( 1 ); aServiceNames.realloc( 1 );
aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.VbaApplicationBase" ); aServiceNames[ 0 ] = "ooo.vba.VbaApplicationBase";
} }
return aServiceNames; return aServiceNames;
} }
...@@ -436,7 +436,7 @@ void SAL_CALL VbaApplicationBase::Undo() ...@@ -436,7 +436,7 @@ void SAL_CALL VbaApplicationBase::Undo()
throw (uno::RuntimeException) throw (uno::RuntimeException)
{ {
uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW );
dispatchRequests( xModel, ::rtl::OUString( ".uno:Undo" ) ); dispatchRequests( xModel, ".uno:Undo" );
} }
void VbaApplicationBase::Quit() throw (uno::RuntimeException) void VbaApplicationBase::Quit() throw (uno::RuntimeException)
......
...@@ -62,20 +62,20 @@ ScVbaColorFormat::getRGB() throw (uno::RuntimeException) ...@@ -62,20 +62,20 @@ ScVbaColorFormat::getRGB() throw (uno::RuntimeException)
switch( m_nColorFormatType ) switch( m_nColorFormatType )
{ {
case ColorFormatType::LINEFORMAT_FORECOLOR: case ColorFormatType::LINEFORMAT_FORECOLOR:
m_xPropertySet->getPropertyValue( rtl::OUString("LineColor") ) >>= nRGB; m_xPropertySet->getPropertyValue( "LineColor" ) >>= nRGB;
break; break;
case ColorFormatType::LINEFORMAT_BACKCOLOR: case ColorFormatType::LINEFORMAT_BACKCOLOR:
//TODO BackColor not supported //TODO BackColor not supported
// m_xPropertySet->setPropertyValue( rtl::OUString("Color"), uno::makeAny( nRGB ) ); // m_xPropertySet->setPropertyValue( rtl::OUString("Color"), uno::makeAny( nRGB ) );
break; break;
case ColorFormatType::FILLFORMAT_FORECOLOR: case ColorFormatType::FILLFORMAT_FORECOLOR:
m_xPropertySet->getPropertyValue( rtl::OUString("FillColor") ) >>= nRGB; m_xPropertySet->getPropertyValue( "FillColor" ) >>= nRGB;
break; break;
case ColorFormatType::FILLFORMAT_BACKCOLOR: case ColorFormatType::FILLFORMAT_BACKCOLOR:
nRGB = m_nFillFormatBackColor; nRGB = m_nFillFormatBackColor;
break; break;
default: default:
throw uno::RuntimeException( rtl::OUString("Second parameter of ColorFormat is wrong."), uno::Reference< uno::XInterface >() ); throw uno::RuntimeException( "Second parameter of ColorFormat is wrong." , uno::Reference< uno::XInterface >() );
} }
nRGB = OORGBToXLRGB( nRGB ); nRGB = OORGBToXLRGB( nRGB );
return nRGB; return nRGB;
...@@ -88,13 +88,13 @@ ScVbaColorFormat::setRGB( sal_Int32 _rgb ) throw (uno::RuntimeException) ...@@ -88,13 +88,13 @@ ScVbaColorFormat::setRGB( sal_Int32 _rgb ) throw (uno::RuntimeException)
switch( m_nColorFormatType ) switch( m_nColorFormatType )
{ {
case ColorFormatType::LINEFORMAT_FORECOLOR: case ColorFormatType::LINEFORMAT_FORECOLOR:
m_xPropertySet->setPropertyValue( rtl::OUString("LineColor"), uno::makeAny( nRGB ) ); m_xPropertySet->setPropertyValue( "LineColor" , uno::makeAny( nRGB ) );
break; break;
case ColorFormatType::LINEFORMAT_BACKCOLOR: case ColorFormatType::LINEFORMAT_BACKCOLOR:
// TODO BackColor not supported // TODO BackColor not supported
break; break;
case ColorFormatType::FILLFORMAT_FORECOLOR: case ColorFormatType::FILLFORMAT_FORECOLOR:
m_xPropertySet->setPropertyValue( rtl::OUString("FillColor"), uno::makeAny( nRGB ) ); m_xPropertySet->setPropertyValue( "FillColor" , uno::makeAny( nRGB ) );
if( m_pFillFormat ) if( m_pFillFormat )
{ {
m_pFillFormat->setForeColorAndInternalStyle(nRGB); m_pFillFormat->setForeColorAndInternalStyle(nRGB);
...@@ -108,7 +108,7 @@ ScVbaColorFormat::setRGB( sal_Int32 _rgb ) throw (uno::RuntimeException) ...@@ -108,7 +108,7 @@ ScVbaColorFormat::setRGB( sal_Int32 _rgb ) throw (uno::RuntimeException)
} }
break; break;
default: default:
throw uno::RuntimeException( rtl::OUString("Second parameter of ColorFormat is wrong."), uno::Reference< uno::XInterface >() ); throw uno::RuntimeException( "Second parameter of ColorFormat is wrong." , uno::Reference< uno::XInterface >() );
} }
} }
...@@ -151,20 +151,20 @@ ScVbaColorFormat::setSchemeColor( sal_Int32 _schemecolor ) throw (uno::RuntimeEx ...@@ -151,20 +151,20 @@ ScVbaColorFormat::setSchemeColor( sal_Int32 _schemecolor ) throw (uno::RuntimeEx
setRGB( nColor ); setRGB( nColor );
} }
rtl::OUString OUString
ScVbaColorFormat::getServiceImplName() ScVbaColorFormat::getServiceImplName()
{ {
return rtl::OUString("ScVbaColorFormat"); return OUString("ScVbaColorFormat");
} }
uno::Sequence< rtl::OUString > uno::Sequence< OUString >
ScVbaColorFormat::getServiceNames() ScVbaColorFormat::getServiceNames()
{ {
static uno::Sequence< rtl::OUString > aServiceNames; static uno::Sequence< OUString > aServiceNames;
if ( aServiceNames.getLength() == 0 ) if ( aServiceNames.getLength() == 0 )
{ {
aServiceNames.realloc( 1 ); aServiceNames.realloc( 1 );
aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.msforms.ColorFormat" ); aServiceNames[ 0 ] = "ooo.vba.msforms.ColorFormat";
} }
return aServiceNames; return aServiceNames;
} }
......
...@@ -100,8 +100,8 @@ private: ...@@ -100,8 +100,8 @@ private:
sal_Int16 m_nColorFormatType; sal_Int16 m_nColorFormatType;
sal_Int32 m_nFillFormatBackColor; sal_Int32 m_nFillFormatBackColor;
protected: protected:
virtual rtl::OUString getServiceImplName(); virtual OUString getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames(); virtual css::uno::Sequence<OUString> getServiceNames();
public: public:
ScVbaColorFormat( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< ov::XHelperInterface > xInternalParent, const css::uno::Reference< css::drawing::XShape > xShape, const sal_Int16 nColorFormatType ); ScVbaColorFormat( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< ov::XHelperInterface > xInternalParent, const css::uno::Reference< css::drawing::XShape > xShape, const sal_Int16 nColorFormatType );
......
...@@ -29,17 +29,17 @@ ...@@ -29,17 +29,17 @@
using namespace com::sun::star; using namespace com::sun::star;
using namespace ooo::vba; using namespace ooo::vba;
ScVbaCommandBar::ScVbaCommandBar( const uno::Reference< ov::XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, VbaCommandBarHelperRef pHelper, const uno::Reference< container::XIndexAccess >& xBarSettings, const rtl::OUString& sResourceUrl, sal_Bool bIsMenu ) throw( uno::RuntimeException ) : CommandBar_BASE( xParent, xContext ), pCBarHelper( pHelper ), m_xBarSettings( xBarSettings ), m_sResourceUrl( sResourceUrl ), m_bIsMenu( bIsMenu ) ScVbaCommandBar::ScVbaCommandBar( const uno::Reference< ov::XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, VbaCommandBarHelperRef pHelper, const uno::Reference< container::XIndexAccess >& xBarSettings, const OUString& sResourceUrl, sal_Bool bIsMenu ) throw( uno::RuntimeException ) : CommandBar_BASE( xParent, xContext ), pCBarHelper( pHelper ), m_xBarSettings( xBarSettings ), m_sResourceUrl( sResourceUrl ), m_bIsMenu( bIsMenu )
{ {
} }
::rtl::OUString SAL_CALL OUString SAL_CALL
ScVbaCommandBar::getName() throw ( uno::RuntimeException ) ScVbaCommandBar::getName() throw ( uno::RuntimeException )
{ {
// This will get a "NULL length string" when Name is not set. // This will get a "NULL length string" when Name is not set.
uno::Reference< beans::XPropertySet > xPropertySet( m_xBarSettings, uno::UNO_QUERY_THROW ); uno::Reference< beans::XPropertySet > xPropertySet( m_xBarSettings, uno::UNO_QUERY_THROW );
uno::Any aName = xPropertySet->getPropertyValue( rtl::OUString("UIName") ); uno::Any aName = xPropertySet->getPropertyValue( "UIName" );
rtl::OUString sName; OUString sName;
aName >>= sName; aName >>= sName;
if( sName.isEmpty() ) if( sName.isEmpty() )
{ {
...@@ -48,9 +48,9 @@ ScVbaCommandBar::getName() throw ( uno::RuntimeException ) ...@@ -48,9 +48,9 @@ ScVbaCommandBar::getName() throw ( uno::RuntimeException )
if( m_sResourceUrl.equalsAscii( ITEM_MENUBAR_URL ) ) if( m_sResourceUrl.equalsAscii( ITEM_MENUBAR_URL ) )
{ {
if( pCBarHelper->getModuleId() == "com.sun.star.sheet.SpreadsheetDocument" ) if( pCBarHelper->getModuleId() == "com.sun.star.sheet.SpreadsheetDocument" )
sName = rtl::OUString( "Worksheet Menu Bar" ); sName = "Worksheet Menu Bar";
else if( pCBarHelper->getModuleId() == "com.sun.star.text.TextDocument" ) else if( pCBarHelper->getModuleId() == "com.sun.star.text.TextDocument" )
sName = rtl::OUString( "Menu Bar" ); sName = "Menu Bar";
return sName; return sName;
} }
} }
...@@ -60,16 +60,16 @@ ScVbaCommandBar::getName() throw ( uno::RuntimeException ) ...@@ -60,16 +60,16 @@ ScVbaCommandBar::getName() throw ( uno::RuntimeException )
{ {
uno::Sequence< beans::PropertyValue > aToolBar; uno::Sequence< beans::PropertyValue > aToolBar;
xNameAccess->getByName( m_sResourceUrl ) >>= aToolBar; xNameAccess->getByName( m_sResourceUrl ) >>= aToolBar;
getPropertyValue( aToolBar, rtl::OUString( "UIName" ) ) >>= sName; getPropertyValue( aToolBar, "UIName" ) >>= sName;
} }
} }
return sName; return sName;
} }
void SAL_CALL void SAL_CALL
ScVbaCommandBar::setName( const ::rtl::OUString& _name ) throw (uno::RuntimeException) ScVbaCommandBar::setName( const OUString& _name ) throw (uno::RuntimeException)
{ {
uno::Reference< beans::XPropertySet > xPropertySet( m_xBarSettings, uno::UNO_QUERY_THROW ); uno::Reference< beans::XPropertySet > xPropertySet( m_xBarSettings, uno::UNO_QUERY_THROW );
xPropertySet->setPropertyValue( rtl::OUString("UIName"), uno::makeAny( _name ) ); xPropertySet->setPropertyValue( "UIName" , uno::makeAny( _name ) );
pCBarHelper->ApplyChange( m_sResourceUrl, m_xBarSettings ); pCBarHelper->ApplyChange( m_sResourceUrl, m_xBarSettings );
} }
...@@ -88,7 +88,7 @@ ScVbaCommandBar::getVisible() throw (uno::RuntimeException) ...@@ -88,7 +88,7 @@ ScVbaCommandBar::getVisible() throw (uno::RuntimeException)
{ {
uno::Sequence< beans::PropertyValue > aToolBar; uno::Sequence< beans::PropertyValue > aToolBar;
xNameAccess->getByName( m_sResourceUrl ) >>= aToolBar; xNameAccess->getByName( m_sResourceUrl ) >>= aToolBar;
getPropertyValue( aToolBar, rtl::OUString( "Visible" ) ) >>= bVisible; getPropertyValue( aToolBar, "Visible" ) >>= bVisible;
} }
} }
catch (const uno::Exception&) catch (const uno::Exception&)
...@@ -170,20 +170,20 @@ ScVbaCommandBar::FindControl( const uno::Any& /*aType*/, const uno::Any& /*aId*/ ...@@ -170,20 +170,20 @@ ScVbaCommandBar::FindControl( const uno::Any& /*aType*/, const uno::Any& /*aId*/
return uno::makeAny( uno::Reference< XCommandBarControl > () ); return uno::makeAny( uno::Reference< XCommandBarControl > () );
} }
rtl::OUString OUString
ScVbaCommandBar::getServiceImplName() ScVbaCommandBar::getServiceImplName()
{ {
return rtl::OUString("ScVbaCommandBar"); return OUString("ScVbaCommandBar");
} }
uno::Sequence<rtl::OUString> uno::Sequence<OUString>
ScVbaCommandBar::getServiceNames() ScVbaCommandBar::getServiceNames()
{ {
static uno::Sequence< rtl::OUString > aServiceNames; static uno::Sequence< OUString > aServiceNames;
if ( aServiceNames.getLength() == 0 ) if ( aServiceNames.getLength() == 0 )
{ {
aServiceNames.realloc( 1 ); aServiceNames.realloc( 1 );
aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.CommandBar" ); aServiceNames[ 0 ] = "ooo.vba.CommandBar";
} }
return aServiceNames; return aServiceNames;
} }
...@@ -192,19 +192,19 @@ ScVbaCommandBar::getServiceNames() ...@@ -192,19 +192,19 @@ ScVbaCommandBar::getServiceNames()
VbaDummyCommandBar::VbaDummyCommandBar( VbaDummyCommandBar::VbaDummyCommandBar(
const uno::Reference< ov::XHelperInterface > xParent, const uno::Reference< ov::XHelperInterface > xParent,
const uno::Reference< uno::XComponentContext > xContext, const uno::Reference< uno::XComponentContext > xContext,
const ::rtl::OUString& rName, sal_Int32 nType ) throw( uno::RuntimeException ) : const OUString& rName, sal_Int32 nType ) throw( uno::RuntimeException ) :
CommandBar_BASE( xParent, xContext ), CommandBar_BASE( xParent, xContext ),
maName( rName ), maName( rName ),
mnType( nType ) mnType( nType )
{ {
} }
::rtl::OUString SAL_CALL VbaDummyCommandBar::getName() throw ( uno::RuntimeException ) OUString SAL_CALL VbaDummyCommandBar::getName() throw ( uno::RuntimeException )
{ {
return maName; return maName;
} }
void SAL_CALL VbaDummyCommandBar::setName( const ::rtl::OUString& _name ) throw (uno::RuntimeException) void SAL_CALL VbaDummyCommandBar::setName( const OUString& _name ) throw (uno::RuntimeException)
{ {
maName = _name; maName = _name;
} }
...@@ -256,18 +256,18 @@ uno::Any SAL_CALL VbaDummyCommandBar::FindControl( const uno::Any& /*aType*/, co ...@@ -256,18 +256,18 @@ uno::Any SAL_CALL VbaDummyCommandBar::FindControl( const uno::Any& /*aType*/, co
return uno::Any( uno::Reference< XCommandBarControl >() ); return uno::Any( uno::Reference< XCommandBarControl >() );
} }
rtl::OUString VbaDummyCommandBar::getServiceImplName() OUString VbaDummyCommandBar::getServiceImplName()
{ {
return rtl::OUString("VbaDummyCommandBar"); return OUString("VbaDummyCommandBar");
} }
uno::Sequence< rtl::OUString > VbaDummyCommandBar::getServiceNames() uno::Sequence< OUString > VbaDummyCommandBar::getServiceNames()
{ {
static uno::Sequence< rtl::OUString > aServiceNames; static uno::Sequence< OUString > aServiceNames;
if ( aServiceNames.getLength() == 0 ) if ( aServiceNames.getLength() == 0 )
{ {
aServiceNames.realloc( 1 ); aServiceNames.realloc( 1 );
aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.CommandBar" ); aServiceNames[ 0 ] = "ooo.vba.CommandBar";
} }
return aServiceNames; return aServiceNames;
} }
......
...@@ -37,17 +37,17 @@ class ScVbaCommandBar : public CommandBar_BASE ...@@ -37,17 +37,17 @@ class ScVbaCommandBar : public CommandBar_BASE
private: private:
VbaCommandBarHelperRef pCBarHelper; VbaCommandBarHelperRef pCBarHelper;
css::uno::Reference< css::container::XIndexAccess > m_xBarSettings; css::uno::Reference< css::container::XIndexAccess > m_xBarSettings;
rtl::OUString m_sResourceUrl; OUString m_sResourceUrl;
sal_Bool m_bIsMenu; sal_Bool m_bIsMenu;
public: public:
ScVbaCommandBar( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const rtl::OUString& sResourceUrl, sal_Bool bIsMenu ) throw( css::uno::RuntimeException ); ScVbaCommandBar( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const OUString& sResourceUrl, sal_Bool bIsMenu ) throw( css::uno::RuntimeException );
sal_Bool IsMenu() const { return m_bIsMenu; } sal_Bool IsMenu() const { return m_bIsMenu; }
// Attributes // Attributes
virtual ::rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException); virtual OUString SAL_CALL getName() throw (css::uno::RuntimeException);
virtual void SAL_CALL setName( const ::rtl::OUString& _name ) throw (css::uno::RuntimeException); virtual void SAL_CALL setName( const OUString& _name ) throw (css::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException); virtual ::sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException);
virtual void SAL_CALL setVisible( ::sal_Bool _visible ) throw (css::uno::RuntimeException); virtual void SAL_CALL setVisible( ::sal_Bool _visible ) throw (css::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL getEnabled() throw (css::uno::RuntimeException); virtual ::sal_Bool SAL_CALL getEnabled() throw (css::uno::RuntimeException);
...@@ -60,8 +60,8 @@ public: ...@@ -60,8 +60,8 @@ public:
virtual css::uno::Any SAL_CALL FindControl( const css::uno::Any& aType, const css::uno::Any& aId, const css::uno::Any& aTag, const css::uno::Any& aVisible, const css::uno::Any& aRecursive ) throw (css::script::BasicErrorException, css::uno::RuntimeException); virtual css::uno::Any SAL_CALL FindControl( const css::uno::Any& aType, const css::uno::Any& aId, const css::uno::Any& aTag, const css::uno::Any& aVisible, const css::uno::Any& aRecursive ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
// XHelperInterface // XHelperInterface
virtual rtl::OUString getServiceImplName(); virtual OUString getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames(); virtual css::uno::Sequence<OUString> getServiceNames();
}; };
/** Dummy command bar implementation. Does nothing but provide its name. */ /** Dummy command bar implementation. Does nothing but provide its name. */
...@@ -71,12 +71,12 @@ public: ...@@ -71,12 +71,12 @@ public:
VbaDummyCommandBar( VbaDummyCommandBar(
const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< ov::XHelperInterface > xParent,
const css::uno::Reference< css::uno::XComponentContext > xContext, const css::uno::Reference< css::uno::XComponentContext > xContext,
const ::rtl::OUString& rName, const OUString& rName,
sal_Int32 nType ) throw( css::uno::RuntimeException ); sal_Int32 nType ) throw( css::uno::RuntimeException );
// Attributes // Attributes
virtual ::rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException); virtual OUString SAL_CALL getName() throw (css::uno::RuntimeException);
virtual void SAL_CALL setName( const ::rtl::OUString& _name ) throw (css::uno::RuntimeException); virtual void SAL_CALL setName( const OUString& _name ) throw (css::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException); virtual ::sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException);
virtual void SAL_CALL setVisible( ::sal_Bool _visible ) throw (css::uno::RuntimeException); virtual void SAL_CALL setVisible( ::sal_Bool _visible ) throw (css::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL getEnabled() throw (css::uno::RuntimeException); virtual ::sal_Bool SAL_CALL getEnabled() throw (css::uno::RuntimeException);
...@@ -89,11 +89,11 @@ public: ...@@ -89,11 +89,11 @@ public:
virtual css::uno::Any SAL_CALL FindControl( const css::uno::Any& aType, const css::uno::Any& aId, const css::uno::Any& aTag, const css::uno::Any& aVisible, const css::uno::Any& aRecursive ) throw (css::script::BasicErrorException, css::uno::RuntimeException); virtual css::uno::Any SAL_CALL FindControl( const css::uno::Any& aType, const css::uno::Any& aId, const css::uno::Any& aTag, const css::uno::Any& aVisible, const css::uno::Any& aRecursive ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
// XHelperInterface // XHelperInterface
virtual rtl::OUString getServiceImplName(); virtual OUString getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames(); virtual css::uno::Sequence<OUString> getServiceNames();
private: private:
::rtl::OUString maName; OUString maName;
sal_Int32 mnType; sal_Int32 mnType;
}; };
......
...@@ -34,7 +34,7 @@ class ScVbaCommandBarControl : public CommandBarControl_BASE ...@@ -34,7 +34,7 @@ class ScVbaCommandBarControl : public CommandBarControl_BASE
{ {
protected: protected:
VbaCommandBarHelperRef pCBarHelper; VbaCommandBarHelperRef pCBarHelper;
rtl::OUString m_sResourceUrl; OUString m_sResourceUrl;
css::uno::Reference< css::container::XIndexAccess > m_xCurrentSettings; css::uno::Reference< css::container::XIndexAccess > m_xCurrentSettings;
css::uno::Reference< css::container::XIndexAccess > m_xBarSettings; css::uno::Reference< css::container::XIndexAccess > m_xBarSettings;
css::uno::Sequence< css::beans::PropertyValue > m_aPropertyValues; css::uno::Sequence< css::beans::PropertyValue > m_aPropertyValues;
...@@ -46,13 +46,13 @@ private: ...@@ -46,13 +46,13 @@ private:
void ApplyChange() throw (css::uno::RuntimeException); void ApplyChange() throw (css::uno::RuntimeException);
public: public:
ScVbaCommandBarControl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xSettings, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const rtl::OUString& sResourceUrl ) throw (css::uno::RuntimeException); ScVbaCommandBarControl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xSettings, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const OUString& sResourceUrl ) throw (css::uno::RuntimeException);
// Attributes // Attributes
virtual ::rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException); virtual OUString SAL_CALL getCaption() throw (css::uno::RuntimeException);
virtual void SAL_CALL setCaption( const ::rtl::OUString& _caption ) throw (css::uno::RuntimeException); virtual void SAL_CALL setCaption( const OUString& _caption ) throw (css::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getOnAction() throw (css::uno::RuntimeException); virtual OUString SAL_CALL getOnAction() throw (css::uno::RuntimeException);
virtual void SAL_CALL setOnAction( const ::rtl::OUString& _onaction ) throw (css::uno::RuntimeException); virtual void SAL_CALL setOnAction( const OUString& _onaction ) throw (css::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException); virtual ::sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException);
virtual void SAL_CALL setVisible( ::sal_Bool _visible ) throw (css::uno::RuntimeException); virtual void SAL_CALL setVisible( ::sal_Bool _visible ) throw (css::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL getEnabled() throw (css::uno::RuntimeException); virtual ::sal_Bool SAL_CALL getEnabled() throw (css::uno::RuntimeException);
...@@ -69,38 +69,38 @@ public: ...@@ -69,38 +69,38 @@ public:
virtual css::uno::Any SAL_CALL Controls( const css::uno::Any& aIndex ) throw (css::script::BasicErrorException, css::uno::RuntimeException); virtual css::uno::Any SAL_CALL Controls( const css::uno::Any& aIndex ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
// XHelperInterface // XHelperInterface
virtual rtl::OUString getServiceImplName(); virtual OUString getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames(); virtual css::uno::Sequence<OUString> getServiceNames();
}; };
typedef cppu::ImplInheritanceHelper1< ScVbaCommandBarControl, ov::XCommandBarPopup > CommandBarPopup_BASE; typedef cppu::ImplInheritanceHelper1< ScVbaCommandBarControl, ov::XCommandBarPopup > CommandBarPopup_BASE;
class ScVbaCommandBarPopup : public CommandBarPopup_BASE class ScVbaCommandBarPopup : public CommandBarPopup_BASE
{ {
public: public:
ScVbaCommandBarPopup( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xSettings, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const rtl::OUString& sResourceUrl, sal_Int32 nPosition, sal_Bool bTemporary ) throw (css::uno::RuntimeException); ScVbaCommandBarPopup( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xSettings, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const OUString& sResourceUrl, sal_Int32 nPosition, sal_Bool bTemporary ) throw (css::uno::RuntimeException);
virtual sal_Int32 SAL_CALL getType() throw (css::uno::RuntimeException) virtual sal_Int32 SAL_CALL getType() throw (css::uno::RuntimeException)
{ {
return ov::office::MsoControlType::msoControlPopup; return ov::office::MsoControlType::msoControlPopup;
} }
// XHelperInterface // XHelperInterface
virtual rtl::OUString getServiceImplName(); virtual OUString getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames(); virtual css::uno::Sequence<OUString> getServiceNames();
}; };
typedef cppu::ImplInheritanceHelper1< ScVbaCommandBarControl, ov::XCommandBarButton > CommandBarButton_BASE; typedef cppu::ImplInheritanceHelper1< ScVbaCommandBarControl, ov::XCommandBarButton > CommandBarButton_BASE;
class ScVbaCommandBarButton : public CommandBarButton_BASE class ScVbaCommandBarButton : public CommandBarButton_BASE
{ {
public: public:
ScVbaCommandBarButton( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xSettings, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const rtl::OUString& sResourceUrl, sal_Int32 nPosition, sal_Bool bTemporary ) throw (css::uno::RuntimeException); ScVbaCommandBarButton( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xSettings, VbaCommandBarHelperRef pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const OUString& sResourceUrl, sal_Int32 nPosition, sal_Bool bTemporary ) throw (css::uno::RuntimeException);
virtual sal_Int32 SAL_CALL getType() throw (css::uno::RuntimeException) virtual sal_Int32 SAL_CALL getType() throw (css::uno::RuntimeException)
{ {
return ov::office::MsoControlType::msoControlButton; return ov::office::MsoControlType::msoControlButton;
} }
// XHelperInterface // XHelperInterface
virtual rtl::OUString getServiceImplName(); virtual OUString getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames(); virtual css::uno::Sequence<OUString> getServiceNames();
}; };
#endif//SC_VBA_COMMANDBARCONTROL_HXX #endif//SC_VBA_COMMANDBARCONTROL_HXX
......
...@@ -47,14 +47,14 @@ public: ...@@ -47,14 +47,14 @@ public:
} }
}; };
ScVbaCommandBarControls::ScVbaCommandBarControls( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XIndexAccess>& xIndexAccess, VbaCommandBarHelperRef pHelper, const uno::Reference< container::XIndexAccess>& xBarSettings, const rtl::OUString& sResourceUrl ) throw (uno::RuntimeException) : CommandBarControls_BASE( xParent, xContext, xIndexAccess ), pCBarHelper( pHelper ), m_xBarSettings( xBarSettings ), m_sResourceUrl( sResourceUrl ) ScVbaCommandBarControls::ScVbaCommandBarControls( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XIndexAccess>& xIndexAccess, VbaCommandBarHelperRef pHelper, const uno::Reference< container::XIndexAccess>& xBarSettings, const OUString& sResourceUrl ) throw (uno::RuntimeException) : CommandBarControls_BASE( xParent, xContext, xIndexAccess ), pCBarHelper( pHelper ), m_xBarSettings( xBarSettings ), m_sResourceUrl( sResourceUrl )
{ {
m_bIsMenu = sResourceUrl.equalsAscii( ITEM_MENUBAR_URL ) ? sal_True : sal_False; m_bIsMenu = sResourceUrl.equalsAscii( ITEM_MENUBAR_URL ) ? sal_True : sal_False;
} }
uno::Sequence< beans::PropertyValue > ScVbaCommandBarControls::CreateMenuItemData( const rtl::OUString& sCommandURL, uno::Sequence< beans::PropertyValue > ScVbaCommandBarControls::CreateMenuItemData( const OUString& sCommandURL,
const rtl::OUString& sHelpURL, const OUString& sHelpURL,
const rtl::OUString& sLabel, const OUString& sLabel,
sal_uInt16 nType, sal_uInt16 nType,
const uno::Any& aSubMenu, const uno::Any& aSubMenu,
sal_Bool isVisible, sal_Bool isVisible,
...@@ -62,41 +62,41 @@ uno::Sequence< beans::PropertyValue > ScVbaCommandBarControls::CreateMenuItemDat ...@@ -62,41 +62,41 @@ uno::Sequence< beans::PropertyValue > ScVbaCommandBarControls::CreateMenuItemDat
{ {
uno::Sequence< beans::PropertyValue > aProps(7); uno::Sequence< beans::PropertyValue > aProps(7);
aProps[0].Name = rtl::OUString( ITEM_DESCRIPTOR_COMMANDURL ); aProps[0].Name = ITEM_DESCRIPTOR_COMMANDURL;
aProps[0].Value <<= sCommandURL; aProps[0].Value <<= sCommandURL;
aProps[1].Name = rtl::OUString( ITEM_DESCRIPTOR_HELPURL ); aProps[1].Name = ITEM_DESCRIPTOR_HELPURL;
aProps[1].Value <<= sHelpURL; aProps[1].Value <<= sHelpURL;
aProps[2].Name = rtl::OUString( ITEM_DESCRIPTOR_LABEL ); aProps[2].Name = ITEM_DESCRIPTOR_LABEL;
aProps[2].Value <<= sLabel; aProps[2].Value <<= sLabel;
aProps[3].Name = rtl::OUString( ITEM_DESCRIPTOR_TYPE ); aProps[3].Name = ITEM_DESCRIPTOR_TYPE;
aProps[3].Value <<= nType; aProps[3].Value <<= nType;
aProps[4].Name = rtl::OUString( ITEM_DESCRIPTOR_CONTAINER ); aProps[4].Name = ITEM_DESCRIPTOR_CONTAINER;
aProps[4].Value = aSubMenu; aProps[4].Value = aSubMenu;
aProps[5].Name = rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_ISVISIBLE ); aProps[5].Name = ITEM_DESCRIPTOR_ISVISIBLE;
aProps[5].Value <<= isVisible; aProps[5].Value <<= isVisible;
aProps[6].Name = rtl::OUString::createFromAscii( ITEM_DESCRIPTOR_ENABLED ); aProps[6].Name = ITEM_DESCRIPTOR_ENABLED;
aProps[6].Value <<= isEnabled; aProps[6].Value <<= isEnabled;
return aProps; return aProps;
} }
uno::Sequence< beans::PropertyValue > ScVbaCommandBarControls::CreateToolbarItemData( const rtl::OUString& sCommandURL, const rtl::OUString& sHelpURL, const rtl::OUString& sLabel, sal_uInt16 nType, const uno::Any& aSubMenu, sal_Bool isVisible, sal_Int32 nStyle ) uno::Sequence< beans::PropertyValue > ScVbaCommandBarControls::CreateToolbarItemData( const OUString& sCommandURL, const OUString& sHelpURL, const OUString& sLabel, sal_uInt16 nType, const uno::Any& aSubMenu, sal_Bool isVisible, sal_Int32 nStyle )
{ {
uno::Sequence< beans::PropertyValue > aProps(7); uno::Sequence< beans::PropertyValue > aProps(7);
aProps[0].Name = rtl::OUString( ITEM_DESCRIPTOR_COMMANDURL ); aProps[0].Name = ITEM_DESCRIPTOR_COMMANDURL;
aProps[0].Value <<= sCommandURL; aProps[0].Value <<= sCommandURL;
aProps[1].Name = rtl::OUString( ITEM_DESCRIPTOR_HELPURL ); aProps[1].Name = ITEM_DESCRIPTOR_HELPURL;
aProps[1].Value <<= sHelpURL; aProps[1].Value <<= sHelpURL;
aProps[2].Name = rtl::OUString( ITEM_DESCRIPTOR_LABEL ); aProps[2].Name = ITEM_DESCRIPTOR_LABEL;
aProps[2].Value <<= sLabel; aProps[2].Value <<= sLabel;
aProps[3].Name = rtl::OUString( ITEM_DESCRIPTOR_TYPE ); aProps[3].Name = ITEM_DESCRIPTOR_TYPE;
aProps[3].Value <<= nType; aProps[3].Value <<= nType;
aProps[4].Name = rtl::OUString( ITEM_DESCRIPTOR_CONTAINER ); aProps[4].Name = ITEM_DESCRIPTOR_CONTAINER;
aProps[4].Value = aSubMenu; aProps[4].Value = aSubMenu;
aProps[5].Name = rtl::OUString( ITEM_DESCRIPTOR_ISVISIBLE ); aProps[5].Name = ITEM_DESCRIPTOR_ISVISIBLE;
aProps[5].Value <<= isVisible; aProps[5].Value <<= isVisible;
aProps[6].Name = rtl::OUString( ITEM_DESCRIPTOR_STYLE ); aProps[6].Name = ITEM_DESCRIPTOR_STYLE;
aProps[6].Value <<= nStyle; aProps[6].Value <<= nStyle;
return aProps; return aProps;
...@@ -123,7 +123,7 @@ ScVbaCommandBarControls::createCollectionObject( const uno::Any& aSource ) ...@@ -123,7 +123,7 @@ ScVbaCommandBarControls::createCollectionObject( const uno::Any& aSource )
uno::Sequence< beans::PropertyValue > aProps; uno::Sequence< beans::PropertyValue > aProps;
m_xIndexAccess->getByIndex( nPosition ) >>= aProps; m_xIndexAccess->getByIndex( nPosition ) >>= aProps;
uno::Reference< container::XIndexAccess > xSubMenu; uno::Reference< container::XIndexAccess > xSubMenu;
getPropertyValue( aProps, rtl::OUString( ITEM_DESCRIPTOR_CONTAINER ) ) >>= xSubMenu; getPropertyValue( aProps, ITEM_DESCRIPTOR_CONTAINER ) >>= xSubMenu;
ScVbaCommandBarControl* pNewCommandBarControl = NULL; ScVbaCommandBarControl* pNewCommandBarControl = NULL;
if( xSubMenu.is() ) if( xSubMenu.is() )
pNewCommandBarControl = new ScVbaCommandBarPopup( this, mxContext, m_xIndexAccess, pCBarHelper, m_xBarSettings, m_sResourceUrl, nPosition, sal_True ); pNewCommandBarControl = new ScVbaCommandBarPopup( this, mxContext, m_xIndexAccess, pCBarHelper, m_xBarSettings, m_sResourceUrl, nPosition, sal_True );
...@@ -140,7 +140,7 @@ ScVbaCommandBarControls::Item( const uno::Any& aIndex, const uno::Any& /*aIndex* ...@@ -140,7 +140,7 @@ ScVbaCommandBarControls::Item( const uno::Any& aIndex, const uno::Any& /*aIndex*
sal_Int32 nPosition = -1; sal_Int32 nPosition = -1;
if( aIndex.getValueTypeClass() == uno::TypeClass_STRING ) if( aIndex.getValueTypeClass() == uno::TypeClass_STRING )
{ {
rtl::OUString sName; OUString sName;
aIndex >>= sName; aIndex >>= sName;
nPosition = VbaCommandBarHelper::findControlByName( m_xIndexAccess, sName, m_bIsMenu ); nPosition = VbaCommandBarHelper::findControlByName( m_xIndexAccess, sName, m_bIsMenu );
} }
...@@ -162,8 +162,8 @@ ScVbaCommandBarControls::Add( const uno::Any& Type, const uno::Any& Id, const un ...@@ -162,8 +162,8 @@ ScVbaCommandBarControls::Add( const uno::Any& Type, const uno::Any& Id, const un
{ {
// Parameter is not supported // Parameter is not supported
// the following name needs to be individually created; // the following name needs to be individually created;
rtl::OUString sLabel("Custom"); OUString sLabel("Custom");
rtl::OUString sCommandUrl(rtl::OUString( CUSTOM_MENU_STR) + sLabel); OUString sCommandUrl( CUSTOM_MENU_STR + sLabel);
sal_Int32 nType = office::MsoControlType::msoControlButton; sal_Int32 nType = office::MsoControlType::msoControlButton;
sal_Int32 nPosition = 0; sal_Int32 nPosition = 0;
sal_Bool bTemporary = sal_True; sal_Bool bTemporary = sal_True;
...@@ -175,11 +175,11 @@ ScVbaCommandBarControls::Add( const uno::Any& Type, const uno::Any& Id, const un ...@@ -175,11 +175,11 @@ ScVbaCommandBarControls::Add( const uno::Any& Type, const uno::Any& Id, const un
if( nType != office::MsoControlType::msoControlButton && if( nType != office::MsoControlType::msoControlButton &&
nType != office::MsoControlType::msoControlPopup ) nType != office::MsoControlType::msoControlPopup )
throw uno::RuntimeException( rtl::OUString( "Not implemented" ), uno::Reference< uno::XInterface >() ); throw uno::RuntimeException( "Not implemented" , uno::Reference< uno::XInterface >() );
if( Id.hasValue() || Parameter.hasValue( ) ) if( Id.hasValue() || Parameter.hasValue( ) )
{ {
throw uno::RuntimeException( rtl::OUString( "Not implemented" ), uno::Reference< uno::XInterface >() ); throw uno::RuntimeException( "Not implemented" , uno::Reference< uno::XInterface >() );
} }
if( Before.hasValue() ) if( Before.hasValue() )
...@@ -200,7 +200,7 @@ ScVbaCommandBarControls::Add( const uno::Any& Type, const uno::Any& Id, const un ...@@ -200,7 +200,7 @@ ScVbaCommandBarControls::Add( const uno::Any& Type, const uno::Any& Id, const un
// create control // create control
uno::Sequence< beans::PropertyValue > aProps; uno::Sequence< beans::PropertyValue > aProps;
rtl::OUString sHelpUrl; OUString sHelpUrl;
sal_uInt16 nItemType = 0; sal_uInt16 nItemType = 0;
if( IsMenu() ) if( IsMenu() )
{ {
...@@ -229,20 +229,20 @@ ScVbaCommandBarControls::Add( const uno::Any& Type, const uno::Any& Id, const un ...@@ -229,20 +229,20 @@ ScVbaCommandBarControls::Add( const uno::Any& Type, const uno::Any& Id, const un
} }
// XHelperInterface // XHelperInterface
rtl::OUString OUString
ScVbaCommandBarControls::getServiceImplName() ScVbaCommandBarControls::getServiceImplName()
{ {
return rtl::OUString("ScVbaCommandBarControls"); return OUString("ScVbaCommandBarControls");
} }
uno::Sequence<rtl::OUString> uno::Sequence<OUString>
ScVbaCommandBarControls::getServiceNames() ScVbaCommandBarControls::getServiceNames()
{ {
static uno::Sequence< rtl::OUString > aServiceNames; static uno::Sequence< OUString > aServiceNames;
if ( aServiceNames.getLength() == 0 ) if ( aServiceNames.getLength() == 0 )
{ {
aServiceNames.realloc( 1 ); aServiceNames.realloc( 1 );
aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.CommandBarControls" ); aServiceNames[ 0 ] = "ooo.vba.CommandBarControls";
} }
return aServiceNames; return aServiceNames;
} }
...@@ -303,18 +303,18 @@ uno::Reference< XCommandBarControl > SAL_CALL VbaDummyCommandBarControls::Add( ...@@ -303,18 +303,18 @@ uno::Reference< XCommandBarControl > SAL_CALL VbaDummyCommandBarControls::Add(
} }
// XHelperInterface // XHelperInterface
rtl::OUString VbaDummyCommandBarControls::getServiceImplName() OUString VbaDummyCommandBarControls::getServiceImplName()
{ {
return rtl::OUString("VbaDummyCommandBarControls"); return OUString("VbaDummyCommandBarControls");
} }
uno::Sequence<rtl::OUString> VbaDummyCommandBarControls::getServiceNames() uno::Sequence<OUString> VbaDummyCommandBarControls::getServiceNames()
{ {
static uno::Sequence< rtl::OUString > aServiceNames; static uno::Sequence< OUString > aServiceNames;
if ( aServiceNames.getLength() == 0 ) if ( aServiceNames.getLength() == 0 )
{ {
aServiceNames.realloc( 1 ); aServiceNames.realloc( 1 );
aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.CommandBarControls" ); aServiceNames[ 0 ] = "ooo.vba.CommandBarControls";
} }
return aServiceNames; return aServiceNames;
} }
......
...@@ -32,20 +32,20 @@ class ScVbaCommandBarControls : public CommandBarControls_BASE ...@@ -32,20 +32,20 @@ class ScVbaCommandBarControls : public CommandBarControls_BASE
private: private:
VbaCommandBarHelperRef pCBarHelper; VbaCommandBarHelperRef pCBarHelper;
css::uno::Reference< css::container::XIndexAccess > m_xBarSettings; css::uno::Reference< css::container::XIndexAccess > m_xBarSettings;
rtl::OUString m_sResourceUrl; OUString m_sResourceUrl;
sal_Bool m_bIsMenu; sal_Bool m_bIsMenu;
css::uno::Sequence< css::beans::PropertyValue > CreateMenuItemData( const rtl::OUString& sCommandURL, css::uno::Sequence< css::beans::PropertyValue > CreateMenuItemData( const OUString& sCommandURL,
const rtl::OUString& sHelpURL, const OUString& sHelpURL,
const rtl::OUString& sLabel, const OUString& sLabel,
sal_uInt16 nType, sal_uInt16 nType,
const css::uno::Any& aSubMenu, const css::uno::Any& aSubMenu,
sal_Bool isVisible, sal_Bool isVisible,
sal_Bool isEnabled ); sal_Bool isEnabled );
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 ); css::uno::Sequence< css::beans::PropertyValue > CreateToolbarItemData( const OUString& sCommandURL, const OUString& sHelpURL, const OUString& sLabel, sal_uInt16 nType, const css::uno::Any& aSubMenu, sal_Bool isVisible, sal_Int32 nStyle );
public: 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 ) 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 OUString& sResourceUrl ) throw( css::uno::RuntimeException );
sal_Bool IsMenu(){ return m_bIsMenu; } sal_Bool IsMenu(){ return m_bIsMenu; }
// XEnumerationAccess // XEnumerationAccess
...@@ -57,8 +57,8 @@ public: ...@@ -57,8 +57,8 @@ public:
virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index, const css::uno::Any& /*Index2*/ ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index, const css::uno::Any& /*Index2*/ ) throw (css::uno::RuntimeException);
virtual css::uno::Reference< ov::XCommandBarControl > SAL_CALL Add( const css::uno::Any& Type, const css::uno::Any& Id, const css::uno::Any& Parameter, const css::uno::Any& Before, const css::uno::Any& Temporary ) throw (css::script::BasicErrorException, css::uno::RuntimeException); virtual css::uno::Reference< ov::XCommandBarControl > SAL_CALL Add( const css::uno::Any& Type, const css::uno::Any& Id, const css::uno::Any& Parameter, const css::uno::Any& Before, const css::uno::Any& Temporary ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
// XHelperInterface // XHelperInterface
virtual rtl::OUString getServiceImplName(); virtual OUString getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames(); virtual css::uno::Sequence<OUString> getServiceNames();
}; };
class VbaDummyCommandBarControls : public CommandBarControls_BASE class VbaDummyCommandBarControls : public CommandBarControls_BASE
...@@ -77,8 +77,8 @@ public: ...@@ -77,8 +77,8 @@ public:
virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index, const css::uno::Any& /*Index2*/ ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index, const css::uno::Any& /*Index2*/ ) throw (css::uno::RuntimeException);
virtual css::uno::Reference< ov::XCommandBarControl > SAL_CALL Add( const css::uno::Any& Type, const css::uno::Any& Id, const css::uno::Any& Parameter, const css::uno::Any& Before, const css::uno::Any& Temporary ) throw (css::script::BasicErrorException, css::uno::RuntimeException); virtual css::uno::Reference< ov::XCommandBarControl > SAL_CALL Add( const css::uno::Any& Type, const css::uno::Any& Id, const css::uno::Any& Parameter, const css::uno::Any& Before, const css::uno::Any& Temporary ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
// XHelperInterface // XHelperInterface
virtual rtl::OUString getServiceImplName(); virtual OUString getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames(); virtual css::uno::Sequence<OUString> getServiceNames();
}; };
#endif//SC_VBA_COMMANDBARCONTROLS_HXX #endif//SC_VBA_COMMANDBARCONTROLS_HXX
......
...@@ -57,10 +57,10 @@ private: ...@@ -57,10 +57,10 @@ private:
css::uno::Reference< css::ui::XUIConfigurationManager > m_xDocCfgMgr; // current document css::uno::Reference< css::ui::XUIConfigurationManager > m_xDocCfgMgr; // current document
css::uno::Reference< css::ui::XUIConfigurationManager > m_xAppCfgMgr; css::uno::Reference< css::ui::XUIConfigurationManager > m_xAppCfgMgr;
css::uno::Reference< css::container::XNameAccess > m_xWindowState; css::uno::Reference< css::container::XNameAccess > m_xWindowState;
rtl::OUString maModuleId; OUString maModuleId;
void Init() throw (css::uno::RuntimeException); void Init() throw (css::uno::RuntimeException);
sal_Bool hasToolbar( const rtl::OUString& sResourceUrl, const rtl::OUString& sName ) throw (css::uno::RuntimeException); sal_Bool hasToolbar( const OUString& sResourceUrl, const OUString& sName ) throw (css::uno::RuntimeException);
public: public:
VbaCommandBarHelper( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::frame::XModel >& xModel ) throw( css::uno::RuntimeException ); VbaCommandBarHelper( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::frame::XModel >& xModel ) throw( css::uno::RuntimeException );
...@@ -79,16 +79,16 @@ public: ...@@ -79,16 +79,16 @@ public:
return m_xWindowState; return m_xWindowState;
} }
sal_Bool persistChanges() throw (css::uno::RuntimeException); sal_Bool persistChanges() throw (css::uno::RuntimeException);
css::uno::Reference< css::container::XIndexAccess > getSettings( const rtl::OUString& sResourceUrl ) throw (css::uno::RuntimeException); css::uno::Reference< css::container::XIndexAccess > getSettings( const OUString& sResourceUrl ) throw (css::uno::RuntimeException);
void removeSettings( const rtl::OUString& sResourceUrl ) throw (css::uno::RuntimeException); void removeSettings( const OUString& sResourceUrl ) throw (css::uno::RuntimeException);
void ApplyChange( const rtl::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, sal_Bool bTemporary = sal_True ) throw (css::uno::RuntimeException);
css::uno::Reference< css::frame::XLayoutManager > getLayoutManager() throw (css::uno::RuntimeException); css::uno::Reference< css::frame::XLayoutManager > getLayoutManager() throw (css::uno::RuntimeException);
const rtl::OUString getModuleId() const { return maModuleId; } const OUString getModuleId() const { return maModuleId; }
rtl::OUString findToolbarByName( const css::uno::Reference< css::container::XNameAccess >& xNameAccess, const rtl::OUString& sName ) throw (css::uno::RuntimeException); OUString findToolbarByName( const css::uno::Reference< css::container::XNameAccess >& xNameAccess, const OUString& sName ) throw (css::uno::RuntimeException);
static sal_Int32 findControlByName( const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess, const rtl::OUString& sName, bool bMenu = false ) throw (css::uno::RuntimeException); static sal_Int32 findControlByName( const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess, const OUString& sName, bool bMenu = false ) throw (css::uno::RuntimeException);
static rtl::OUString generateCustomURL(); static OUString generateCustomURL();
}; };
#endif //VBA_COMMANDBARHELPER_HXX #endif //VBA_COMMANDBARHELPER_HXX
......
...@@ -48,8 +48,8 @@ public: ...@@ -48,8 +48,8 @@ public:
virtual sal_Int32 SAL_CALL getCount() throw(css::uno::RuntimeException); virtual sal_Int32 SAL_CALL getCount() throw(css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL Item( const css::uno::Any& aIndex, const css::uno::Any& /*aIndex2*/ ) throw( css::uno::RuntimeException); virtual css::uno::Any SAL_CALL Item( const css::uno::Any& aIndex, const css::uno::Any& /*aIndex2*/ ) throw( css::uno::RuntimeException);
// XHelperInterface // XHelperInterface
virtual rtl::OUString getServiceImplName(); virtual OUString getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames(); virtual css::uno::Sequence<OUString> getServiceNames();
}; };
#endif//SC_VBA_COMMANDBARS_HXX #endif//SC_VBA_COMMANDBARS_HXX
......
...@@ -57,9 +57,9 @@ using namespace ::com::sun::star; ...@@ -57,9 +57,9 @@ using namespace ::com::sun::star;
static const char aSpreadsheetDocument[] = "com.sun.star.sheet.SpreadsheetDocument"; static const char aSpreadsheetDocument[] = "com.sun.star.sheet.SpreadsheetDocument";
static const char aTextDocument[] = "com.sun.star.text.TextDocument"; static const char aTextDocument[] = "com.sun.star.text.TextDocument";
typedef boost::unordered_map< rtl::OUString, typedef boost::unordered_map< OUString,
sal_Int32, ::rtl::OUStringHash, sal_Int32, OUStringHash,
::std::equal_to< ::rtl::OUString > > NameIndexHash; ::std::equal_to< OUString > > NameIndexHash;
typedef std::vector < uno::Reference< frame::XModel > > Documents; typedef std::vector < uno::Reference< frame::XModel > > Documents;
...@@ -85,7 +85,7 @@ public: ...@@ -85,7 +85,7 @@ public:
m_xContext->getServiceManager(), uno::UNO_QUERY_THROW ); m_xContext->getServiceManager(), uno::UNO_QUERY_THROW );
uno::Reference< frame::XDesktop > xDesktop uno::Reference< frame::XDesktop > xDesktop
(xSMgr->createInstanceWithContext(::rtl::OUString("com.sun.star.frame.Desktop"), m_xContext), uno::UNO_QUERY_THROW ); (xSMgr->createInstanceWithContext( "com.sun.star.frame.Desktop" , m_xContext), uno::UNO_QUERY_THROW );
uno::Reference< container::XEnumeration > mxComponents = xDesktop->getComponents()->createEnumeration(); uno::Reference< container::XEnumeration > mxComponents = xDesktop->getComponents()->createEnumeration();
while( mxComponents->hasMoreElements() ) while( mxComponents->hasMoreElements() )
{ {
...@@ -137,12 +137,12 @@ public: ...@@ -137,12 +137,12 @@ public:
{ {
uno::Reference< lang::XServiceInfo > xServiceInfo( xEnum->nextElement(), uno::UNO_QUERY ); uno::Reference< lang::XServiceInfo > xServiceInfo( xEnum->nextElement(), uno::UNO_QUERY );
if ( xServiceInfo.is() if ( xServiceInfo.is()
&& ( ( xServiceInfo->supportsService( rtl::OUString(aSpreadsheetDocument) ) && meDocType == VbaDocumentsBase::EXCEL_DOCUMENT ) && ( ( xServiceInfo->supportsService( OUString(aSpreadsheetDocument) ) && meDocType == VbaDocumentsBase::EXCEL_DOCUMENT )
|| ( xServiceInfo->supportsService( rtl::OUString(aTextDocument) ) && meDocType == VbaDocumentsBase::WORD_DOCUMENT ) ) ) || ( xServiceInfo->supportsService( OUString(aTextDocument) ) && meDocType == VbaDocumentsBase::WORD_DOCUMENT ) ) )
{ {
uno::Reference< frame::XModel > xModel( xServiceInfo, uno::UNO_QUERY_THROW ); // that the spreadsheetdocument is a xmodel is a given uno::Reference< frame::XModel > xModel( xServiceInfo, uno::UNO_QUERY_THROW ); // that the spreadsheetdocument is a xmodel is a given
m_documents.push_back( xModel ); m_documents.push_back( xModel );
rtl::OUString sName; OUString sName;
uno::Reference< ::ooo::vba::XDocumentBase > xVbaDocument = new VbaDocumentBase( uno::Reference< XHelperInterface >(), xContext, xModel ); uno::Reference< ::ooo::vba::XDocumentBase > xVbaDocument = new VbaDocumentBase( uno::Reference< XHelperInterface >(), xContext, xModel );
if ( xVbaDocument.is() ) if ( xVbaDocument.is() )
{ {
...@@ -184,7 +184,7 @@ public: ...@@ -184,7 +184,7 @@ public:
} }
//XNameAccess //XNameAccess
virtual uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) virtual uno::Any SAL_CALL getByName( const OUString& aName ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{ {
NameIndexHash::const_iterator it = namesToIndices.find( aName ); NameIndexHash::const_iterator it = namesToIndices.find( aName );
if ( it == namesToIndices.end() ) if ( it == namesToIndices.end() )
...@@ -193,10 +193,10 @@ public: ...@@ -193,10 +193,10 @@ public:
} }
virtual uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw (uno::RuntimeException) virtual uno::Sequence< OUString > SAL_CALL getElementNames( ) throw (uno::RuntimeException)
{ {
uno::Sequence< ::rtl::OUString > names( namesToIndices.size() ); uno::Sequence< OUString > names( namesToIndices.size() );
::rtl::OUString* pString = names.getArray(); OUString* pString = names.getArray();
NameIndexHash::const_iterator it = namesToIndices.begin(); NameIndexHash::const_iterator it = namesToIndices.begin();
NameIndexHash::const_iterator it_end = namesToIndices.end(); NameIndexHash::const_iterator it_end = namesToIndices.end();
for ( ; it != it_end; ++it, ++pString ) for ( ; it != it_end; ++it, ++pString )
...@@ -204,7 +204,7 @@ public: ...@@ -204,7 +204,7 @@ public:
return names; return names;
} }
virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (uno::RuntimeException) virtual ::sal_Bool SAL_CALL hasByName( const OUString& aName ) throw (uno::RuntimeException)
{ {
NameIndexHash::const_iterator it = namesToIndices.find( aName ); NameIndexHash::const_iterator it = namesToIndices.find( aName );
return (it != namesToIndices.end()); return (it != namesToIndices.end());
...@@ -253,26 +253,23 @@ uno::Any VbaDocumentsBase::createDocument() throw (uno::RuntimeException) ...@@ -253,26 +253,23 @@ uno::Any VbaDocumentsBase::createDocument() throw (uno::RuntimeException)
mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); mxContext->getServiceManager(), uno::UNO_QUERY_THROW );
uno::Reference< frame::XComponentLoader > xLoader( uno::Reference< frame::XComponentLoader > xLoader(
xSMgr->createInstanceWithContext( xSMgr->createInstanceWithContext("com.sun.star.frame.Desktop" , mxContext), uno::UNO_QUERY_THROW );
::rtl::OUString("com.sun.star.frame.Desktop"), OUString sURL;
mxContext), uno::UNO_QUERY_THROW );
rtl::OUString sURL;
if( meDocType == WORD_DOCUMENT ) if( meDocType == WORD_DOCUMENT )
sURL = rtl::OUString( "private:factory/swriter" ); sURL = "private:factory/swriter";
else if( meDocType == EXCEL_DOCUMENT ) else if( meDocType == EXCEL_DOCUMENT )
sURL = rtl::OUString( "private:factory/scalc" ); sURL = "private:factory/scalc";
else else
throw uno::RuntimeException( rtl::OUString( "Not implemented" ), uno::Reference< uno::XInterface >() ); throw uno::RuntimeException( "Not implemented" , uno::Reference< uno::XInterface >() );
// prepare the media descriptor // prepare the media descriptor
::comphelper::MediaDescriptor aMediaDesc; ::comphelper::MediaDescriptor aMediaDesc;
aMediaDesc[ ::comphelper::MediaDescriptor::PROP_MACROEXECUTIONMODE() ] <<= document::MacroExecMode::USE_CONFIG; aMediaDesc[ ::comphelper::MediaDescriptor::PROP_MACROEXECUTIONMODE() ] <<= document::MacroExecMode::USE_CONFIG;
aMediaDesc.setComponentDataEntry( ::rtl::OUString( "ApplyFormDesignMode" ), uno::Any( false ) ); aMediaDesc.setComponentDataEntry( "ApplyFormDesignMode" , uno::Any( false ) );
// craete the new document // create the new document
uno::Reference< lang::XComponent > xComponent = xLoader->loadComponentFromURL( uno::Reference< lang::XComponent > xComponent = xLoader->loadComponentFromURL(
sURL , sURL , "_blank", 0,
rtl::OUString( "_blank" ), 0,
aMediaDesc.getAsConstPropertyValueList() ); aMediaDesc.getAsConstPropertyValueList() );
// #163808# lock document controllers and container window if specified by application // #163808# lock document controllers and container window if specified by application
...@@ -295,7 +292,7 @@ void VbaDocumentsBase::closeDocuments() throw (uno::RuntimeException) ...@@ -295,7 +292,7 @@ void VbaDocumentsBase::closeDocuments() throw (uno::RuntimeException)
} }
// #TODO# #FIXME# can any of the unused params below be used? // #TODO# #FIXME# can any of the unused params below be used?
uno::Any VbaDocumentsBase::openDocument( const rtl::OUString& rFileName, const uno::Any& ReadOnly, const uno::Sequence< beans::PropertyValue >& rProps ) throw (uno::RuntimeException) uno::Any VbaDocumentsBase::openDocument( const OUString& rFileName, const uno::Any& ReadOnly, const uno::Sequence< beans::PropertyValue >& rProps ) throw (uno::RuntimeException)
{ {
// #163808# determine state of Application.ScreenUpdating and Application.Interactive symbols (before new document is opened) // #163808# determine state of Application.ScreenUpdating and Application.Interactive symbols (before new document is opened)
uno::Reference< XApplicationBase > xApplication( Application(), uno::UNO_QUERY ); uno::Reference< XApplicationBase > xApplication( Application(), uno::UNO_QUERY );
...@@ -303,7 +300,7 @@ uno::Any VbaDocumentsBase::openDocument( const rtl::OUString& rFileName, const u ...@@ -303,7 +300,7 @@ uno::Any VbaDocumentsBase::openDocument( const rtl::OUString& rFileName, const u
sal_Bool bInteractive = !xApplication.is() || xApplication->getInteractive(); sal_Bool bInteractive = !xApplication.is() || xApplication->getInteractive();
// we need to detect if this is a URL, if not then assume its a file path // we need to detect if this is a URL, if not then assume its a file path
rtl::OUString aURL; OUString aURL;
INetURLObject aObj; INetURLObject aObj;
aObj.SetURL( rFileName ); aObj.SetURL( rFileName );
bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID; bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID;
...@@ -313,18 +310,13 @@ uno::Any VbaDocumentsBase::openDocument( const rtl::OUString& rFileName, const u ...@@ -313,18 +310,13 @@ uno::Any VbaDocumentsBase::openDocument( const rtl::OUString& rFileName, const u
osl::FileBase::getFileURLFromSystemPath( rFileName, aURL ); osl::FileBase::getFileURLFromSystemPath( rFileName, aURL );
uno::Reference< lang::XMultiComponentFactory > xSMgr( uno::Reference< lang::XMultiComponentFactory > xSMgr(
mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); mxContext->getServiceManager(), uno::UNO_QUERY_THROW );
uno::Reference< frame::XDesktop > xDesktop uno::Reference< frame::XDesktop > xDesktop(xSMgr->createInstanceWithContext( "com.sun.star.frame.Desktop" , mxContext), uno::UNO_QUERY_THROW );
(xSMgr->createInstanceWithContext(::rtl::OUString("com.sun.star.frame.Desktop") , mxContext),
uno::UNO_QUERY_THROW );
uno::Reference< frame::XComponentLoader > xLoader( uno::Reference< frame::XComponentLoader > xLoader(
xSMgr->createInstanceWithContext( xSMgr->createInstanceWithContext( "com.sun.star.frame.Desktop" , mxContext), uno::UNO_QUERY_THROW );
::rtl::OUString("com.sun.star.frame.Desktop"),
mxContext),
uno::UNO_QUERY_THROW );
uno::Sequence< beans::PropertyValue > sProps( rProps ); uno::Sequence< beans::PropertyValue > sProps( rProps );
sProps.realloc( sProps.getLength() + 1 ); sProps.realloc( sProps.getLength() + 1 );
sProps[ sProps.getLength() - 1 ].Name = rtl::OUString( "MacroExecutionMode" ); sProps[ sProps.getLength() - 1 ].Name = "MacroExecutionMode";
sProps[ sProps.getLength() - 1 ].Value <<= document::MacroExecMode::ALWAYS_EXECUTE_NO_WARN; sProps[ sProps.getLength() - 1 ].Value <<= document::MacroExecMode::ALWAYS_EXECUTE_NO_WARN;
if ( ReadOnly.hasValue() ) if ( ReadOnly.hasValue() )
...@@ -333,13 +325,13 @@ uno::Any VbaDocumentsBase::openDocument( const rtl::OUString& rFileName, const u ...@@ -333,13 +325,13 @@ uno::Any VbaDocumentsBase::openDocument( const rtl::OUString& rFileName, const u
if ( bIsReadOnly ) if ( bIsReadOnly )
{ {
sProps.realloc( sProps.getLength() + 1 ); sProps.realloc( sProps.getLength() + 1 );
sProps[ sProps.getLength() - 1 ].Name = rtl::OUString( "ReadOnly" ); sProps[ sProps.getLength() - 1 ].Name = "ReadOnly";
sProps[ sProps.getLength() - 1 ].Value <<= true; sProps[ sProps.getLength() - 1 ].Value <<= true;
} }
} }
uno::Reference< lang::XComponent > xComponent = xLoader->loadComponentFromURL( aURL, uno::Reference< lang::XComponent > xComponent = xLoader->loadComponentFromURL( aURL,
rtl::OUString( "_default" ), "_default" ,
frame::FrameSearchFlag::CREATE, frame::FrameSearchFlag::CREATE,
sProps); sProps);
......
...@@ -41,7 +41,7 @@ ScVbaFillFormat::setFillStyle( drawing::FillStyle nFillStyle ) throw (uno::Runti ...@@ -41,7 +41,7 @@ ScVbaFillFormat::setFillStyle( drawing::FillStyle nFillStyle ) throw (uno::Runti
m_nFillStyle = nFillStyle; m_nFillStyle = nFillStyle;
if( m_nFillStyle == drawing::FillStyle_GRADIENT ) if( m_nFillStyle == drawing::FillStyle_GRADIENT )
{ {
m_xPropertySet->setPropertyValue( rtl::OUString("FillStyle"), uno::makeAny( drawing::FillStyle_GRADIENT ) ); m_xPropertySet->setPropertyValue( "FillStyle" , uno::makeAny( drawing::FillStyle_GRADIENT ) );
awt::Gradient aGradient; awt::Gradient aGradient;
// AXIAL // AXIAL
// RADIAL // RADIAL
...@@ -58,11 +58,11 @@ ScVbaFillFormat::setFillStyle( drawing::FillStyle nFillStyle ) throw (uno::Runti ...@@ -58,11 +58,11 @@ ScVbaFillFormat::setFillStyle( drawing::FillStyle nFillStyle ) throw (uno::Runti
aGradient.StartIntensity = 100; aGradient.StartIntensity = 100;
aGradient.EndIntensity = 100; aGradient.EndIntensity = 100;
aGradient.StepCount = 1; aGradient.StepCount = 1;
m_xPropertySet->setPropertyValue( rtl::OUString("FillGradient"), uno::makeAny( aGradient ) ); m_xPropertySet->setPropertyValue( "FillGradient" , uno::makeAny( aGradient ) );
} }
else if( m_nFillStyle == drawing::FillStyle_SOLID ) else if( m_nFillStyle == drawing::FillStyle_SOLID )
{ {
m_xPropertySet->setPropertyValue( rtl::OUString("FillStyle"), uno::makeAny(drawing::FillStyle_SOLID) ); m_xPropertySet->setPropertyValue( "FillStyle" , uno::makeAny(drawing::FillStyle_SOLID) );
} }
} }
...@@ -78,7 +78,7 @@ sal_Bool SAL_CALL ...@@ -78,7 +78,7 @@ sal_Bool SAL_CALL
ScVbaFillFormat::getVisible() throw (uno::RuntimeException) ScVbaFillFormat::getVisible() throw (uno::RuntimeException)
{ {
drawing::FillStyle nFillStyle; drawing::FillStyle nFillStyle;
m_xPropertySet->getPropertyValue( rtl::OUString("FillStyle") ) >>= nFillStyle; m_xPropertySet->getPropertyValue( "FillStyle" ) >>= nFillStyle;
if( nFillStyle == drawing::FillStyle_NONE ) if( nFillStyle == drawing::FillStyle_NONE )
return sal_False; return sal_False;
return sal_True; return sal_True;
...@@ -88,10 +88,10 @@ void SAL_CALL ...@@ -88,10 +88,10 @@ void SAL_CALL
ScVbaFillFormat::setVisible( sal_Bool _visible ) throw (uno::RuntimeException) ScVbaFillFormat::setVisible( sal_Bool _visible ) throw (uno::RuntimeException)
{ {
drawing::FillStyle aFillStyle; drawing::FillStyle aFillStyle;
m_xPropertySet->getPropertyValue( rtl::OUString("FillStyle") ) >>= aFillStyle; m_xPropertySet->getPropertyValue( "FillStyle" ) >>= aFillStyle;
if( !_visible ) if( !_visible )
{ {
m_xPropertySet->setPropertyValue( rtl::OUString("FillStyle"), uno::makeAny( drawing::FillStyle_NONE ) ); m_xPropertySet->setPropertyValue( "FillStyle" , uno::makeAny( drawing::FillStyle_NONE ) );
} }
else else
{ {
...@@ -107,7 +107,7 @@ ScVbaFillFormat::getTransparency() throw (uno::RuntimeException) ...@@ -107,7 +107,7 @@ ScVbaFillFormat::getTransparency() throw (uno::RuntimeException)
{ {
sal_Int16 nTransparence = 0; sal_Int16 nTransparence = 0;
double dTransparence = 0; double dTransparence = 0;
m_xPropertySet->getPropertyValue( rtl::OUString("FillTransparence") ) >>= nTransparence; m_xPropertySet->getPropertyValue( "FillTransparence" ) >>= nTransparence;
dTransparence = static_cast<double>( nTransparence ); dTransparence = static_cast<double>( nTransparence );
dTransparence /= 100; dTransparence /= 100;
return dTransparence; return dTransparence;
...@@ -117,7 +117,7 @@ void SAL_CALL ...@@ -117,7 +117,7 @@ void SAL_CALL
ScVbaFillFormat::setTransparency( double _transparency ) throw (uno::RuntimeException) ScVbaFillFormat::setTransparency( double _transparency ) throw (uno::RuntimeException)
{ {
sal_Int16 nTransparence = static_cast< sal_Int16 >( _transparency * 100 ); sal_Int16 nTransparence = static_cast< sal_Int16 >( _transparency * 100 );
m_xPropertySet->setPropertyValue( rtl::OUString("FillTransparence"), uno::makeAny( nTransparence ) ); m_xPropertySet->setPropertyValue( "FillTransparence" , uno::makeAny( nTransparence ) );
} }
...@@ -169,20 +169,20 @@ ScVbaFillFormat::ForeColor() throw (uno::RuntimeException) ...@@ -169,20 +169,20 @@ ScVbaFillFormat::ForeColor() throw (uno::RuntimeException)
return m_xColorFormat; return m_xColorFormat;
} }
rtl::OUString OUString
ScVbaFillFormat::getServiceImplName() ScVbaFillFormat::getServiceImplName()
{ {
return rtl::OUString("ScVbaFillFormat"); return OUString("ScVbaFillFormat");
} }
uno::Sequence< rtl::OUString > uno::Sequence< OUString >
ScVbaFillFormat::getServiceNames() ScVbaFillFormat::getServiceNames()
{ {
static uno::Sequence< rtl::OUString > aServiceNames; static uno::Sequence< OUString > aServiceNames;
if ( aServiceNames.getLength() == 0 ) if ( aServiceNames.getLength() == 0 )
{ {
aServiceNames.realloc( 1 ); aServiceNames.realloc( 1 );
aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.msforms.FillFormat" ); aServiceNames[ 0 ] = "ooo.vba.msforms.FillFormat";
} }
return aServiceNames; return aServiceNames;
} }
......
...@@ -39,8 +39,8 @@ private: ...@@ -39,8 +39,8 @@ private:
private: private:
void setFillStyle( css::drawing::FillStyle nFillStyle ) throw (css::uno::RuntimeException); void setFillStyle( css::drawing::FillStyle nFillStyle ) throw (css::uno::RuntimeException);
protected: protected:
virtual rtl::OUString getServiceImplName(); virtual OUString getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames(); virtual css::uno::Sequence<OUString> getServiceNames();
public: public:
ScVbaFillFormat( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape > xShape ); ScVbaFillFormat( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape > xShape );
......
...@@ -36,7 +36,7 @@ const uno::Reference< ov::XHelperInterface >& xParent, ...@@ -36,7 +36,7 @@ const uno::Reference< ov::XHelperInterface >& xParent,
const uno::Reference< uno::XComponentContext >& xContext, const OUString& sDocCtxName ) const uno::Reference< uno::XComponentContext >& xContext, const OUString& sDocCtxName )
: Globals_BASE( xParent, xContext ) : Globals_BASE( xParent, xContext )
, msDocCtxName( sDocCtxName ) , msDocCtxName( sDocCtxName )
, msApplication( RTL_CONSTASCII_USTRINGPARAM("Application") ) , msApplication( "Application" )
{ {
// overwrite context with custom one ( that contains the application ) // overwrite context with custom one ( that contains the application )
// wrap the service manager as we don't want the disposing context to tear down the 'normal' ServiceManager ( or at least thats what the code appears like it wants to do ) // wrap the service manager as we don't want the disposing context to tear down the 'normal' ServiceManager ( or at least thats what the code appears like it wants to do )
......
...@@ -34,10 +34,10 @@ private: ...@@ -34,10 +34,10 @@ private:
sal_Int32 m_nLineDashStyle; sal_Int32 m_nLineDashStyle;
double m_nLineWeight; double m_nLineWeight;
protected: protected:
virtual rtl::OUString getServiceImplName(); virtual OUString getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames(); virtual css::uno::Sequence<OUString> getServiceNames();
sal_Int32 convertLineStartEndNameToArrowheadStyle( rtl::OUString sLineName ); sal_Int32 convertLineStartEndNameToArrowheadStyle( OUString sLineName );
rtl::OUString convertArrowheadStyleToLineStartEndName( sal_Int32 nArrowheadStyle ) throw (css::uno::RuntimeException); OUString convertArrowheadStyleToLineStartEndName( sal_Int32 nArrowheadStyle ) throw (css::uno::RuntimeException);
public: public:
ScVbaLineFormat( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape > xShape ); ScVbaLineFormat( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape > xShape );
......
...@@ -34,11 +34,11 @@ ScVbaPictureFormat::checkParameterRangeInDouble( double nRange, double nMin, dou ...@@ -34,11 +34,11 @@ ScVbaPictureFormat::checkParameterRangeInDouble( double nRange, double nMin, dou
{ {
if( nRange < nMin ) if( nRange < nMin )
{ {
throw uno::RuntimeException( rtl::OUString("Parameter out of range, value is too small.") , uno::Reference< uno::XInterface >() ); throw uno::RuntimeException( "Parameter out of range, value is too small." , uno::Reference< uno::XInterface >() );
} }
if( nRange > nMax ) if( nRange > nMax )
{ {
throw uno::RuntimeException( rtl::OUString("Parameter out of range, value is too high.") , uno::Reference< uno::XInterface >() ); throw uno::RuntimeException( "Parameter out of range, value is too high." , uno::Reference< uno::XInterface >() );
} }
} }
...@@ -47,7 +47,7 @@ double SAL_CALL ...@@ -47,7 +47,7 @@ double SAL_CALL
ScVbaPictureFormat::getBrightness() throw (uno::RuntimeException) ScVbaPictureFormat::getBrightness() throw (uno::RuntimeException)
{ {
sal_Int16 nLuminance = 0; sal_Int16 nLuminance = 0;
m_xPropertySet->getPropertyValue( rtl::OUString("AdjustLuminance") ) >>= nLuminance; m_xPropertySet->getPropertyValue( "AdjustLuminance" ) >>= nLuminance;
double fBrightness = static_cast< double >( nLuminance ); double fBrightness = static_cast< double >( nLuminance );
fBrightness = ( fBrightness +100 ) / 200; fBrightness = ( fBrightness +100 ) / 200;
return fBrightness; return fBrightness;
...@@ -59,14 +59,14 @@ ScVbaPictureFormat::setBrightness( double _brightness ) throw (uno::RuntimeExcep ...@@ -59,14 +59,14 @@ ScVbaPictureFormat::setBrightness( double _brightness ) throw (uno::RuntimeExcep
checkParameterRangeInDouble( _brightness, 0.0, 1.0 ); checkParameterRangeInDouble( _brightness, 0.0, 1.0 );
double fLuminance = _brightness * 200 - 100; double fLuminance = _brightness * 200 - 100;
sal_Int16 nLuminance = static_cast< sal_Int16 >( fLuminance ); sal_Int16 nLuminance = static_cast< sal_Int16 >( fLuminance );
m_xPropertySet->setPropertyValue( rtl::OUString("AdjustLuminance"), uno::makeAny( nLuminance ) ); m_xPropertySet->setPropertyValue( "AdjustLuminance" , uno::makeAny( nLuminance ) );
} }
double SAL_CALL double SAL_CALL
ScVbaPictureFormat::getContrast() throw (uno::RuntimeException) ScVbaPictureFormat::getContrast() throw (uno::RuntimeException)
{ {
sal_Int16 nContrast = 0; sal_Int16 nContrast = 0;
m_xPropertySet->getPropertyValue( rtl::OUString("AdjustContrast") ) >>= nContrast; m_xPropertySet->getPropertyValue( "AdjustContrast" ) >>= nContrast;
double fContrast = static_cast< double >( nContrast ); double fContrast = static_cast< double >( nContrast );
fContrast = ( fContrast + 100 ) / 200; fContrast = ( fContrast + 100 ) / 200;
return fContrast; return fContrast;
...@@ -78,7 +78,7 @@ ScVbaPictureFormat::setContrast( double _contrast ) throw (uno::RuntimeException ...@@ -78,7 +78,7 @@ ScVbaPictureFormat::setContrast( double _contrast ) throw (uno::RuntimeException
checkParameterRangeInDouble( _contrast, 0.0, 1.0 ); checkParameterRangeInDouble( _contrast, 0.0, 1.0 );
double fContrast = _contrast * 200 - 100; double fContrast = _contrast * 200 - 100;
sal_Int16 nContrast = static_cast< sal_Int16 >( fContrast ); sal_Int16 nContrast = static_cast< sal_Int16 >( fContrast );
m_xPropertySet->setPropertyValue( rtl::OUString("AdjustContrast"), uno::makeAny( nContrast ) ); m_xPropertySet->setPropertyValue( "AdjustContrast" , uno::makeAny( nContrast ) );
} }
...@@ -115,20 +115,20 @@ ScVbaPictureFormat::IncrementContrast( double increment ) throw (uno::RuntimeExc ...@@ -115,20 +115,20 @@ ScVbaPictureFormat::IncrementContrast( double increment ) throw (uno::RuntimeExc
setContrast( nContrast ); setContrast( nContrast );
} }
rtl::OUString OUString
ScVbaPictureFormat::getServiceImplName() ScVbaPictureFormat::getServiceImplName()
{ {
return rtl::OUString("ScVbaPictureFormat"); return OUString("ScVbaPictureFormat");
} }
uno::Sequence< rtl::OUString > uno::Sequence< OUString >
ScVbaPictureFormat::getServiceNames() ScVbaPictureFormat::getServiceNames()
{ {
static uno::Sequence< rtl::OUString > aServiceNames; static uno::Sequence< OUString > aServiceNames;
if ( aServiceNames.getLength() == 0 ) if ( aServiceNames.getLength() == 0 )
{ {
aServiceNames.realloc( 1 ); aServiceNames.realloc( 1 );
aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.msform.PictureFormat" ); aServiceNames[ 0 ] = "ooo.vba.msform.PictureFormat";
} }
return aServiceNames; return aServiceNames;
} }
......
...@@ -32,8 +32,8 @@ private: ...@@ -32,8 +32,8 @@ private:
css::uno::Reference< css::drawing::XShape > m_xShape; css::uno::Reference< css::drawing::XShape > m_xShape;
css::uno::Reference< css::beans::XPropertySet > m_xPropertySet; css::uno::Reference< css::beans::XPropertySet > m_xPropertySet;
protected: protected:
virtual rtl::OUString getServiceImplName(); virtual OUString getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames(); virtual css::uno::Sequence<OUString> getServiceNames();
private: private:
void checkParameterRangeInDouble( double nRange, double nMin, double nMax ) throw (css::uno::RuntimeException); void checkParameterRangeInDouble( double nRange, double nMin, double nMax ) throw (css::uno::RuntimeException);
public: public:
......
...@@ -117,7 +117,7 @@ ScVbaShapeRange::IncrementTop( double Increment ) throw (uno::RuntimeException) ...@@ -117,7 +117,7 @@ ScVbaShapeRange::IncrementTop( double Increment ) throw (uno::RuntimeException)
} }
} }
rtl::OUString SAL_CALL ScVbaShapeRange::getName() throw (uno::RuntimeException) OUString SAL_CALL ScVbaShapeRange::getName() throw (uno::RuntimeException)
{ {
sal_Int32 nLen = getCount(); sal_Int32 nLen = getCount();
for ( sal_Int32 index = 1; index <= nLen; /* ++index unreachable */ ) for ( sal_Int32 index = 1; index <= nLen; /* ++index unreachable */ )
...@@ -128,7 +128,7 @@ rtl::OUString SAL_CALL ScVbaShapeRange::getName() throw (uno::RuntimeException) ...@@ -128,7 +128,7 @@ rtl::OUString SAL_CALL ScVbaShapeRange::getName() throw (uno::RuntimeException)
throw uno::RuntimeException(); throw uno::RuntimeException();
} }
void SAL_CALL ScVbaShapeRange::setName( const rtl::OUString& _name ) throw (uno::RuntimeException) void SAL_CALL ScVbaShapeRange::setName( const OUString& _name ) throw (uno::RuntimeException)
{ {
sal_Int32 nLen = getCount(); sal_Int32 nLen = getCount();
for ( sal_Int32 index = 1; index <= nLen; ++index ) for ( sal_Int32 index = 1; index <= nLen; ++index )
...@@ -382,20 +382,20 @@ ScVbaShapeRange:: createCollectionObject( const css::uno::Any& aSource ) ...@@ -382,20 +382,20 @@ ScVbaShapeRange:: createCollectionObject( const css::uno::Any& aSource )
return uno::makeAny( xVbShape ); return uno::makeAny( xVbShape );
} }
rtl::OUString OUString
ScVbaShapeRange::getServiceImplName() ScVbaShapeRange::getServiceImplName()
{ {
return rtl::OUString("ScVbaShapeRange"); return OUString("ScVbaShapeRange");
} }
uno::Sequence< rtl::OUString > uno::Sequence< OUString >
ScVbaShapeRange::getServiceNames() ScVbaShapeRange::getServiceNames()
{ {
static uno::Sequence< rtl::OUString > aServiceNames; static uno::Sequence< OUString > aServiceNames;
if ( aServiceNames.getLength() == 0 ) if ( aServiceNames.getLength() == 0 )
{ {
aServiceNames.realloc( 1 ); aServiceNames.realloc( 1 );
aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.msform.ShapeRange" ); aServiceNames[ 0 ] = "ooo.vba.msform.ShapeRange";
} }
return aServiceNames; return aServiceNames;
} }
......
...@@ -35,11 +35,11 @@ VbaTextFrame::setAsMSObehavior() ...@@ -35,11 +35,11 @@ VbaTextFrame::setAsMSObehavior()
//set property TextWordWrap default as False. //set property TextWordWrap default as False.
// TextFitToSize control the text content. it seems we should set the default as False. // TextFitToSize control the text content. it seems we should set the default as False.
// com.sun.star.drawing.TextFitToSizeType.NONE // com.sun.star.drawing.TextFitToSizeType.NONE
m_xPropertySet->setPropertyValue( rtl::OUString("TextWordWrap"), uno::makeAny( sal_False ) ); m_xPropertySet->setPropertyValue( "TextWordWrap", uno::makeAny( sal_False ) );
m_xPropertySet->setPropertyValue( rtl::OUString("TextFitToSize"), uno::makeAny( drawing::TextFitToSizeType_NONE ) ); m_xPropertySet->setPropertyValue( "TextFitToSize", uno::makeAny( drawing::TextFitToSizeType_NONE ) );
} }
sal_Int32 VbaTextFrame::getMargin( rtl::OUString sMarginType ) sal_Int32 VbaTextFrame::getMargin( OUString sMarginType )
{ {
sal_Int32 nMargin = 0; sal_Int32 nMargin = 0;
uno::Any aMargin = m_xPropertySet->getPropertyValue( sMarginType ); uno::Any aMargin = m_xPropertySet->getPropertyValue( sMarginType );
...@@ -47,7 +47,7 @@ sal_Int32 VbaTextFrame::getMargin( rtl::OUString sMarginType ) ...@@ -47,7 +47,7 @@ sal_Int32 VbaTextFrame::getMargin( rtl::OUString sMarginType )
return nMargin; return nMargin;
} }
void VbaTextFrame::setMargin( rtl::OUString sMarginType, float fMargin ) void VbaTextFrame::setMargin( OUString sMarginType, float fMargin )
{ {
sal_Int32 nMargin = Millimeter::getInHundredthsOfOneMillimeter( fMargin ); sal_Int32 nMargin = Millimeter::getInHundredthsOfOneMillimeter( fMargin );
m_xPropertySet->setPropertyValue( sMarginType, uno::makeAny( nMargin ) ); m_xPropertySet->setPropertyValue( sMarginType, uno::makeAny( nMargin ) );
...@@ -61,7 +61,7 @@ VbaTextFrame::getAutoSize() throw (uno::RuntimeException) ...@@ -61,7 +61,7 @@ VbaTextFrame::getAutoSize() throw (uno::RuntimeException)
// TextFitToSize control the text content. // TextFitToSize control the text content.
// and in mso, there isnot option TextWordWrap which means auto wrap. the default is False. // and in mso, there isnot option TextWordWrap which means auto wrap. the default is False.
sal_Bool bAutosize = sal_False; sal_Bool bAutosize = sal_False;
uno::Any aTextAutoGrowHeight = m_xPropertySet->getPropertyValue( rtl::OUString("TextAutoGrowHeight") ); uno::Any aTextAutoGrowHeight = m_xPropertySet->getPropertyValue( "TextAutoGrowHeight" );
aTextAutoGrowHeight >>= bAutosize; aTextAutoGrowHeight >>= bAutosize;
return bAutosize; return bAutosize;
} }
...@@ -70,13 +70,13 @@ void SAL_CALL ...@@ -70,13 +70,13 @@ void SAL_CALL
VbaTextFrame::setAutoSize( sal_Bool _autosize ) throw (uno::RuntimeException) VbaTextFrame::setAutoSize( sal_Bool _autosize ) throw (uno::RuntimeException)
{ {
setAsMSObehavior(); setAsMSObehavior();
m_xPropertySet->setPropertyValue( rtl::OUString("TextAutoGrowHeight"), uno::makeAny( _autosize ) ); m_xPropertySet->setPropertyValue( "TextAutoGrowHeight", uno::makeAny( _autosize ) );
} }
float SAL_CALL float SAL_CALL
VbaTextFrame::getMarginBottom() throw (uno::RuntimeException) VbaTextFrame::getMarginBottom() throw (uno::RuntimeException)
{ {
sal_Int32 nMargin = getMargin( rtl::OUString("TextLowerDistance") ); sal_Int32 nMargin = getMargin( "TextLowerDistance" );
float fMargin = (float)Millimeter::getInPoints( nMargin ); float fMargin = (float)Millimeter::getInPoints( nMargin );
return fMargin; return fMargin;
} }
...@@ -84,13 +84,13 @@ VbaTextFrame::getMarginBottom() throw (uno::RuntimeException) ...@@ -84,13 +84,13 @@ VbaTextFrame::getMarginBottom() throw (uno::RuntimeException)
void SAL_CALL void SAL_CALL
VbaTextFrame::setMarginBottom( float _marginbottom ) throw (uno::RuntimeException) VbaTextFrame::setMarginBottom( float _marginbottom ) throw (uno::RuntimeException)
{ {
setMargin( rtl::OUString("TextLowerDistance"), _marginbottom ); setMargin( "TextLowerDistance", _marginbottom );
} }
float SAL_CALL float SAL_CALL
VbaTextFrame::getMarginTop() throw (uno::RuntimeException) VbaTextFrame::getMarginTop() throw (uno::RuntimeException)
{ {
sal_Int32 nMargin = getMargin( rtl::OUString("TextUpperDistance") ); sal_Int32 nMargin = getMargin( "TextUpperDistance" );
float fMargin = (float)Millimeter::getInPoints( nMargin ); float fMargin = (float)Millimeter::getInPoints( nMargin );
return fMargin; return fMargin;
} }
...@@ -98,13 +98,13 @@ VbaTextFrame::getMarginTop() throw (uno::RuntimeException) ...@@ -98,13 +98,13 @@ VbaTextFrame::getMarginTop() throw (uno::RuntimeException)
void SAL_CALL void SAL_CALL
VbaTextFrame::setMarginTop( float _margintop ) throw (uno::RuntimeException) VbaTextFrame::setMarginTop( float _margintop ) throw (uno::RuntimeException)
{ {
setMargin( rtl::OUString("TextUpperDistance"), _margintop ); setMargin( "TextUpperDistance", _margintop );
} }
float SAL_CALL float SAL_CALL
VbaTextFrame::getMarginLeft() throw (uno::RuntimeException) VbaTextFrame::getMarginLeft() throw (uno::RuntimeException)
{ {
sal_Int32 nMargin = getMargin( rtl::OUString("TextLeftDistance") ); sal_Int32 nMargin = getMargin( "TextLeftDistance" );
float fMargin = (float)Millimeter::getInPoints( nMargin ); float fMargin = (float)Millimeter::getInPoints( nMargin );
return fMargin; return fMargin;
} }
...@@ -112,13 +112,13 @@ VbaTextFrame::getMarginLeft() throw (uno::RuntimeException) ...@@ -112,13 +112,13 @@ VbaTextFrame::getMarginLeft() throw (uno::RuntimeException)
void SAL_CALL void SAL_CALL
VbaTextFrame::setMarginLeft( float _marginleft ) throw (uno::RuntimeException) VbaTextFrame::setMarginLeft( float _marginleft ) throw (uno::RuntimeException)
{ {
setMargin( rtl::OUString("TextLeftDistance"), _marginleft ); setMargin( "TextLeftDistance", _marginleft );
} }
float SAL_CALL float SAL_CALL
VbaTextFrame::getMarginRight() throw (uno::RuntimeException) VbaTextFrame::getMarginRight() throw (uno::RuntimeException)
{ {
sal_Int32 nMargin = getMargin( rtl::OUString("TextRightDistance") ); sal_Int32 nMargin = getMargin( "TextRightDistance" );
float fMargin = (float)Millimeter::getInPoints( nMargin ); float fMargin = (float)Millimeter::getInPoints( nMargin );
return fMargin; return fMargin;
} }
...@@ -126,7 +126,7 @@ VbaTextFrame::getMarginRight() throw (uno::RuntimeException) ...@@ -126,7 +126,7 @@ VbaTextFrame::getMarginRight() throw (uno::RuntimeException)
void SAL_CALL void SAL_CALL
VbaTextFrame::setMarginRight( float _marginright ) throw (uno::RuntimeException) VbaTextFrame::setMarginRight( float _marginright ) throw (uno::RuntimeException)
{ {
setMargin( rtl::OUString("TextRightDistance"), _marginright ); setMargin( "TextRightDistance" , _marginright );
} }
...@@ -134,23 +134,23 @@ VbaTextFrame::setMarginRight( float _marginright ) throw (uno::RuntimeException) ...@@ -134,23 +134,23 @@ VbaTextFrame::setMarginRight( float _marginright ) throw (uno::RuntimeException)
uno::Any SAL_CALL uno::Any SAL_CALL
VbaTextFrame::Characters() throw (uno::RuntimeException) VbaTextFrame::Characters() throw (uno::RuntimeException)
{ {
throw uno::RuntimeException( rtl::OUString( "Not implemented" ), uno::Reference< uno::XInterface >() ); throw uno::RuntimeException( "Not implemented" , uno::Reference< uno::XInterface >() );
} }
rtl::OUString OUString
VbaTextFrame::getServiceImplName() VbaTextFrame::getServiceImplName()
{ {
return rtl::OUString("VbaTextFrame"); return OUString("VbaTextFrame");
} }
uno::Sequence< rtl::OUString > uno::Sequence< OUString >
VbaTextFrame::getServiceNames() VbaTextFrame::getServiceNames()
{ {
static uno::Sequence< rtl::OUString > aServiceNames; static uno::Sequence< OUString > aServiceNames;
if ( aServiceNames.getLength() == 0 ) if ( aServiceNames.getLength() == 0 )
{ {
aServiceNames.realloc( 1 ); aServiceNames.realloc( 1 );
aServiceNames[ 0 ] = rtl::OUString( "ooo.vba.msforms.TextFrame" ); aServiceNames[ 0 ] = "ooo.vba.msforms.TextFrame";
} }
return aServiceNames; return aServiceNames;
} }
......
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