summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2012-10-06 17:57:07 +0200
committerDavid Tardon <dtardon@redhat.com>2012-10-06 17:57:31 +0200
commit0e7e65d0480f63000b46b8009becf749e8a1d765 (patch)
treea89b118e2eda8d9cd04630409ceb2a4a8601e8f2 /sc/source/ui
parent5e47d8ca9a4282d2c7b6e1e561d7f2eb46166bd7 (diff)
get rid of CREATE_OUSTRING
Change-Id: I67cd3213c7c92a4a782906a7250c176efeb01633
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/Accessibility/AccessibleCsvControl.cxx22
-rw-r--r--sc/source/ui/vba/vbasheetobject.cxx54
-rw-r--r--sc/source/ui/vba/vbasheetobjects.cxx14
3 files changed, 44 insertions, 46 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx
index febd32795a25..7dc366eec041 100644
--- a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx
+++ b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx
@@ -80,8 +80,6 @@ const sal_uInt16 nRulerRole = AccessibleRole::TEXT;
const sal_uInt16 nGridRole = AccessibleRole::TABLE;
const sal_uInt16 nCellRole = AccessibleRole::TEXT;
-#define CREATE_OUSTRING( name ) OUString( RTL_CONSTASCII_USTRINGPARAM( name ) )
-
#define RULER_IMPL_NAME "ScAccessibleCsvRuler"
#define GRID_IMPL_NAME "ScAccessibleCsvGrid"
#define CELL_IMPL_NAME "ScAccessibleCsvCell"
@@ -342,13 +340,13 @@ void lcl_FillFontAttributes( Sequence< PropertyValue >& rSeq, const Font& rFont
SvxLanguageItem aLangItem( rFont.GetLanguage(), ATTR_FONT_LANGUAGE );
sal_Int32 nIndex = lcl_ExpandSequence( rSeq, 7 );
- lcl_FillProperty( rSeq[ nIndex++ ], CREATE_OUSTRING( "CharFontName" ), aFontItem, MID_FONT_FAMILY_NAME );
- lcl_FillProperty( rSeq[ nIndex++ ], CREATE_OUSTRING( "CharFontFamily" ), aFontItem, MID_FONT_FAMILY );
- lcl_FillProperty( rSeq[ nIndex++ ], CREATE_OUSTRING( "CharFontStyleName" ), aFontItem, MID_FONT_STYLE_NAME );
- lcl_FillProperty( rSeq[ nIndex++ ], CREATE_OUSTRING( "CharFontCharSet" ), aFontItem, MID_FONT_PITCH );
- lcl_FillProperty( rSeq[ nIndex++ ], CREATE_OUSTRING( "CharFontPitch" ), aFontItem, MID_FONT_CHAR_SET );
- lcl_FillProperty( rSeq[ nIndex++ ], CREATE_OUSTRING( "CharHeight" ), aHeightItem, MID_FONTHEIGHT );
- lcl_FillProperty( rSeq[ nIndex++ ], CREATE_OUSTRING( "CharLocale" ), aLangItem, MID_LANG_LOCALE );
+ lcl_FillProperty( rSeq[ nIndex++ ], "CharFontName", aFontItem, MID_FONT_FAMILY_NAME );
+ lcl_FillProperty( rSeq[ nIndex++ ], "CharFontFamily", aFontItem, MID_FONT_FAMILY );
+ lcl_FillProperty( rSeq[ nIndex++ ], "CharFontStyleName", aFontItem, MID_FONT_STYLE_NAME );
+ lcl_FillProperty( rSeq[ nIndex++ ], "CharFontCharSet", aFontItem, MID_FONT_PITCH );
+ lcl_FillProperty( rSeq[ nIndex++ ], "CharFontPitch", aFontItem, MID_FONT_CHAR_SET );
+ lcl_FillProperty( rSeq[ nIndex++ ], "CharHeight", aHeightItem, MID_FONTHEIGHT );
+ lcl_FillProperty( rSeq[ nIndex++ ], "CharLocale", aLangItem, MID_LANG_LOCALE );
}
@@ -757,7 +755,7 @@ void SAL_CALL ScAccessibleCsvRuler::release() throw ()
OUString SAL_CALL ScAccessibleCsvRuler::getImplementationName() throw( RuntimeException )
{
- return CREATE_OUSTRING( RULER_IMPL_NAME );
+ return OUString( RULER_IMPL_NAME );
}
@@ -1267,7 +1265,7 @@ void SAL_CALL ScAccessibleCsvGrid::release() throw ()
OUString SAL_CALL ScAccessibleCsvGrid::getImplementationName() throw( RuntimeException )
{
- return CREATE_OUSTRING( GRID_IMPL_NAME );
+ return OUString( GRID_IMPL_NAME );
}
@@ -1564,7 +1562,7 @@ IMPLEMENT_FORWARD_XTYPEPROVIDER2( ScAccessibleCsvCell, ScAccessibleCsvControl, A
OUString SAL_CALL ScAccessibleCsvCell::getImplementationName() throw( RuntimeException )
{
- return CREATE_OUSTRING( CELL_IMPL_NAME );
+ return OUString( CELL_IMPL_NAME );
}
// helpers --------------------------------------------------------------------
diff --git a/sc/source/ui/vba/vbasheetobject.cxx b/sc/source/ui/vba/vbasheetobject.cxx
index 7e0431cc5a05..74cc65fbed36 100644
--- a/sc/source/ui/vba/vbasheetobject.cxx
+++ b/sc/source/ui/vba/vbasheetobject.cxx
@@ -155,12 +155,12 @@ VBAHELPER_IMPL_XHELPERINTERFACE( ScVbaButtonCharacters, "ooo.vba.excel.Character
OUString ScVbaButtonCharacters::getFullString() const throw (uno::RuntimeException)
{
- return mxPropSet->getPropertyValue( CREATE_OUSTRING( "Label" ) ).get< OUString >();
+ return mxPropSet->getPropertyValue( "Label" ).get< OUString >();
}
void ScVbaButtonCharacters::setFullString( const OUString& rString ) throw (uno::RuntimeException)
{
- mxPropSet->setPropertyValue( CREATE_OUSTRING( "Label" ), uno::Any( rString ) );
+ mxPropSet->setPropertyValue( "Label", uno::Any( rString ) );
}
// ============================================================================
@@ -230,12 +230,12 @@ void SAL_CALL ScVbaSheetObjectBase::setHeight( double fHeight ) throw (uno::Runt
OUString SAL_CALL ScVbaSheetObjectBase::getName() throw (uno::RuntimeException)
{
- return mxShapeProps->getPropertyValue( CREATE_OUSTRING( "Name" ) ).get< OUString >();
+ return mxShapeProps->getPropertyValue( "Name" ).get< OUString >();
}
void SAL_CALL ScVbaSheetObjectBase::setName( const OUString& rName ) throw (uno::RuntimeException)
{
- mxShapeProps->setPropertyValue( CREATE_OUSTRING( "Name" ), uno::Any( rName ) );
+ mxShapeProps->setPropertyValue( "Name", uno::Any( rName ) );
}
sal_Int32 SAL_CALL ScVbaSheetObjectBase::getPlacement() throw (uno::RuntimeException)
@@ -319,24 +319,24 @@ ScVbaControlObjectBase::ScVbaControlObjectBase(
switch( eListenerType )
{
case LISTENER_ACTION:
- maListenerType = CREATE_OUSTRING( "XActionListener" );
- maEventMethod = CREATE_OUSTRING( "actionPerformed" );
+ maListenerType = "XActionListener";
+ maEventMethod = "actionPerformed";
break;
case LISTENER_MOUSE:
- maListenerType = CREATE_OUSTRING( "XMouseListener" );
- maEventMethod = CREATE_OUSTRING( "mouseReleased" );
+ maListenerType = "XMouseListener";
+ maEventMethod = "mouseReleased";
break;
case LISTENER_TEXT:
- maListenerType = CREATE_OUSTRING( "XTextListener" );
- maEventMethod = CREATE_OUSTRING( "textChanged" );
+ maListenerType = "XTextListener";
+ maEventMethod = "textChanged";
break;
case LISTENER_VALUE:
- maListenerType = CREATE_OUSTRING( "XAdjustmentListener" );
- maEventMethod = CREATE_OUSTRING( "adjustmentValueChanged" );
+ maListenerType = "XAdjustmentListener";
+ maEventMethod = "adjustmentValueChanged";
break;
case LISTENER_CHANGE:
- maListenerType = CREATE_OUSTRING( "XChangeListener" );
- maEventMethod = CREATE_OUSTRING( "changed" );
+ maListenerType = "XChangeListener";
+ maEventMethod = "changed";
break;
// no default, to let the compiler complain about missing case
}
@@ -346,12 +346,12 @@ ScVbaControlObjectBase::ScVbaControlObjectBase(
OUString SAL_CALL ScVbaControlObjectBase::getName() throw (uno::RuntimeException)
{
- return mxControlProps->getPropertyValue( CREATE_OUSTRING( "Name" ) ).get< OUString >();
+ return mxControlProps->getPropertyValue( "Name" ).get< OUString >();
}
void SAL_CALL ScVbaControlObjectBase::setName( const OUString& rName ) throw (uno::RuntimeException)
{
- mxControlProps->setPropertyValue( CREATE_OUSTRING( "Name" ), uno::Any( rName ) );
+ mxControlProps->setPropertyValue( "Name", uno::Any( rName ) );
}
OUString SAL_CALL ScVbaControlObjectBase::getOnAction() throw (uno::RuntimeException)
@@ -363,7 +363,7 @@ OUString SAL_CALL ScVbaControlObjectBase::getOnAction() throw (uno::RuntimeExcep
{
const script::ScriptEventDescriptor* pEvent = aEvents.getConstArray();
const script::ScriptEventDescriptor* pEventEnd = pEvent + aEvents.getLength();
- const OUString aScriptType = CREATE_OUSTRING( "Script" );
+ const OUString aScriptType = "Script";
for( ; pEvent < pEventEnd; ++pEvent )
if( (pEvent->ListenerType == maListenerType) && (pEvent->EventMethod == maEventMethod) && (pEvent->ScriptType == aScriptType) )
return extractMacroName( pEvent->ScriptCode );
@@ -388,7 +388,7 @@ void SAL_CALL ScVbaControlObjectBase::setOnAction( const OUString& rMacroName )
script::ScriptEventDescriptor aDescriptor;
aDescriptor.ListenerType = maListenerType;
aDescriptor.EventMethod = maEventMethod;
- aDescriptor.ScriptType = CREATE_OUSTRING( "Script" );
+ aDescriptor.ScriptType = "Script";
aDescriptor.ScriptCode = makeMacroURL( aResolvedMacro.msResolvedMacro );
xEventMgr->registerScriptEvent( nIndex, aDescriptor );
}
@@ -396,12 +396,12 @@ void SAL_CALL ScVbaControlObjectBase::setOnAction( const OUString& rMacroName )
sal_Bool SAL_CALL ScVbaControlObjectBase::getPrintObject() throw (uno::RuntimeException)
{
- return mxControlProps->getPropertyValue( CREATE_OUSTRING( "Printable" ) ).get< sal_Bool >();
+ return mxControlProps->getPropertyValue( "Printable" ).get< sal_Bool >();
}
void SAL_CALL ScVbaControlObjectBase::setPrintObject( sal_Bool bPrintObject ) throw (uno::RuntimeException)
{
- mxControlProps->setPropertyValue( CREATE_OUSTRING( "Printable" ), uno::Any( bPrintObject ) );
+ mxControlProps->setPropertyValue( "Printable", uno::Any( bPrintObject ) );
}
// XControlObject attributes
@@ -446,12 +446,12 @@ ScVbaButton::ScVbaButton(
OUString SAL_CALL ScVbaButton::getCaption() throw (uno::RuntimeException)
{
- return mxControlProps->getPropertyValue( CREATE_OUSTRING( "Label" ) ).get< OUString >();
+ return mxControlProps->getPropertyValue( "Label" ).get< OUString >();
}
void SAL_CALL ScVbaButton::setCaption( const OUString& rCaption ) throw (uno::RuntimeException)
{
- mxControlProps->setPropertyValue( CREATE_OUSTRING( "Label" ), uno::Any( rCaption ) );
+ mxControlProps->setPropertyValue( "Label", uno::Any( rCaption ) );
}
uno::Reference< excel::XFont > SAL_CALL ScVbaButton::getFont() throw (uno::RuntimeException)
@@ -466,7 +466,7 @@ void SAL_CALL ScVbaButton::setFont( const uno::Reference< excel::XFont >& /*rxFo
sal_Int32 SAL_CALL ScVbaButton::getHorizontalAlignment() throw (uno::RuntimeException)
{
- switch( mxControlProps->getPropertyValue( CREATE_OUSTRING( "Align" ) ).get< sal_Int16 >() )
+ switch( mxControlProps->getPropertyValue( "Align" ).get< sal_Int16 >() )
{
case awt::TextAlign::LEFT: return excel::Constants::xlLeft;
case awt::TextAlign::RIGHT: return excel::Constants::xlRight;
@@ -485,12 +485,12 @@ void SAL_CALL ScVbaButton::setHorizontalAlignment( sal_Int32 nAlign ) throw (uno
case excel::Constants::xlCenter: nAwtAlign = awt::TextAlign::CENTER; break;
}
// form controls expect short value
- mxControlProps->setPropertyValue( CREATE_OUSTRING( "Align" ), uno::Any( static_cast< sal_Int16 >( nAwtAlign ) ) );
+ mxControlProps->setPropertyValue( "Align", uno::Any( static_cast< sal_Int16 >( nAwtAlign ) ) );
}
sal_Int32 SAL_CALL ScVbaButton::getVerticalAlignment() throw (uno::RuntimeException)
{
- switch( mxControlProps->getPropertyValue( CREATE_OUSTRING( "VerticalAlign" ) ).get< style::VerticalAlignment >() )
+ switch( mxControlProps->getPropertyValue( "VerticalAlign" ).get< style::VerticalAlignment >() )
{
case style::VerticalAlignment_TOP: return excel::Constants::xlTop;
case style::VerticalAlignment_BOTTOM: return excel::Constants::xlBottom;
@@ -509,7 +509,7 @@ void SAL_CALL ScVbaButton::setVerticalAlignment( sal_Int32 nAlign ) throw (uno::
case excel::Constants::xlBottom: eAwtAlign = style::VerticalAlignment_BOTTOM; break;
case excel::Constants::xlCenter: eAwtAlign = style::VerticalAlignment_MIDDLE; break;
}
- mxControlProps->setPropertyValue( CREATE_OUSTRING( "VerticalAlign" ), uno::Any( eAwtAlign ) );
+ mxControlProps->setPropertyValue( "VerticalAlign", uno::Any( eAwtAlign ) );
}
sal_Int32 SAL_CALL ScVbaButton::getOrientation() throw (uno::RuntimeException)
@@ -538,7 +538,7 @@ VBAHELPER_IMPL_XHELPERINTERFACE( ScVbaButton, "ooo.vba.excel.Button" )
OUString ScVbaButton::implGetBaseName() const
{
- return CREATE_OUSTRING( "Button" );
+ return OUString( "Button" );
}
void ScVbaButton::implSetDefaultProperties() throw (uno::RuntimeException)
diff --git a/sc/source/ui/vba/vbasheetobjects.cxx b/sc/source/ui/vba/vbasheetobjects.cxx
index 76a7cdc6de18..cb05330f7bbc 100644
--- a/sc/source/ui/vba/vbasheetobjects.cxx
+++ b/sc/source/ui/vba/vbasheetobjects.cxx
@@ -243,7 +243,7 @@ sal_Bool SAL_CALL ScVbaObjectContainer::hasElements() throw (uno::RuntimeExcepti
OUString ScVbaObjectContainer::implGetShapeName( const uno::Reference< drawing::XShape >& rxShape ) const throw (uno::RuntimeException)
{
uno::Reference< beans::XPropertySet > xPropSet( rxShape, uno::UNO_QUERY_THROW );
- return xPropSet->getPropertyValue( CREATE_OUSTRING( "Name" ) ).get< OUString >();
+ return xPropSet->getPropertyValue( "Name" ).get< OUString >();
}
void ScVbaObjectContainer::implOnShapeCreated( const uno::Reference< drawing::XShape >& /*rxShape*/ ) throw (uno::RuntimeException)
@@ -404,14 +404,14 @@ uno::Reference< container::XIndexContainer > ScVbaControlContainer::createForm()
{
uno::Reference< form::XFormsSupplier > xFormsSupp( mxShapes, uno::UNO_QUERY_THROW );
uno::Reference< container::XNameContainer > xFormsNC( xFormsSupp->getForms(), uno::UNO_SET_THROW );
- OUString aFormName = CREATE_OUSTRING( "Standard" );
+ OUString aFormName = "Standard";
if( xFormsNC->hasByName( aFormName ) )
{
mxFormIC.set( xFormsNC->getByName( aFormName ), uno::UNO_QUERY_THROW );
}
else
{
- uno::Reference< form::XForm > xForm( mxFactory->createInstance( CREATE_OUSTRING( "com.sun.star.form.component.Form" ) ), uno::UNO_QUERY_THROW );
+ uno::Reference< form::XForm > xForm( mxFactory->createInstance( "com.sun.star.form.component.Form" ), uno::UNO_QUERY_THROW );
xFormsNC->insertByName( aFormName, uno::Any( xForm ) );
mxFormIC.set( xForm, uno::UNO_QUERY_THROW );
}
@@ -426,7 +426,7 @@ bool ScVbaControlContainer::implPickShape( const uno::Reference< drawing::XShape
uno::Reference< drawing::XControlShape > xControlShape( rxShape, uno::UNO_QUERY_THROW );
uno::Reference< beans::XPropertySet > xModelProps( xControlShape->getControl(), uno::UNO_QUERY_THROW );
sal_Int16 nClassId = -1;
- return lclGetProperty( nClassId, xModelProps, CREATE_OUSTRING( "ClassId" ) ) &&
+ return lclGetProperty( nClassId, xModelProps, "ClassId" ) &&
(nClassId == mnComponentType) && implCheckProperties( xModelProps );
}
catch( uno::Exception& )
@@ -437,7 +437,7 @@ bool ScVbaControlContainer::implPickShape( const uno::Reference< drawing::XShape
OUString ScVbaControlContainer::implGetShapeServiceName() const
{
- return CREATE_OUSTRING( "com.sun.star.drawing.ControlShape" );
+ return OUString( "com.sun.star.drawing.ControlShape" );
}
bool ScVbaControlContainer::implCheckProperties( const uno::Reference< beans::XPropertySet >& /*rxModelProps*/ ) const
@@ -494,7 +494,7 @@ ScVbaButtonContainer::ScVbaButtonContainer(
ScVbaControlContainer(
rxParent, rxContext, rxModel, rxSheet,
excel::XButton::static_type( 0 ),
- CREATE_OUSTRING( "com.sun.star.form.component.CommandButton" ),
+ "com.sun.star.form.component.CommandButton",
form::FormComponentType::COMMANDBUTTON )
{
}
@@ -509,7 +509,7 @@ bool ScVbaButtonContainer::implCheckProperties( const uno::Reference< beans::XPr
{
// do not insert toggle buttons into the 'Buttons' collection
bool bToggle = false;
- return lclGetProperty( bToggle, rxModelProps, CREATE_OUSTRING( "Toggle" ) ) && !bToggle;
+ return lclGetProperty( bToggle, rxModelProps, "Toggle" ) && !bToggle;
}
// ============================================================================