Kaydet (Commit) d812cee7 authored tarafından Olivier Hallot's avatar Olivier Hallot Kaydeden (comit) Muthu Subramanian

OUString cleanup in Chart2

Include C2U macro removal and rtl prefix

Change-Id: I3de75446e53618862e50c69382a7ddaf0d482fa7
üst 1e34ec4c
......@@ -75,7 +75,6 @@
using namespace ::com::sun::star;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Reference;
using ::rtl::OUString;
using namespace ::svt;
......@@ -580,7 +579,7 @@ void DataBrowser::RenewTable()
GetDataWindow().LogicToPixel( Size( 42, 0 )).getWidth() ));
OUString aDefaultSeriesName(SCH_RESSTR(STR_COLUMN_LABEL));
replaceParamterInString( aDefaultSeriesName, C2U("%COLUMNNUMBER"), OUString::valueOf( sal_Int32(24) ) );
replaceParamterInString( aDefaultSeriesName, "%COLUMNNUMBER", OUString::valueOf( sal_Int32(24) ) );
sal_Int32 nColumnWidth = GetDataWindow().GetTextWidth( aDefaultSeriesName )
+ GetDataWindow().LogicToPixel( Point( 4 + impl::SeriesHeader::GetRelativeAppFontXPosForNameField(), 0 ), MAP_APPFONT ).X();
sal_Int32 nColumnCount = m_apDataBrowserModel->getColumnCount();
......@@ -613,7 +612,7 @@ void DataBrowser::RenewTable()
sal_Int32 nColor = 0;
// @todo: Set "DraftColor", i.e. interpolated colors for gradients, bitmaps, etc.
if( xSeriesProp.is() &&
( xSeriesProp->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("Color"))) >>= nColor ))
( xSeriesProp->getPropertyValue( "Color" ) >>= nColor ))
spHeader->SetColor( Color( nColor ));
spHeader->SetChartType( aIt->m_xChartType, aIt->m_bSwapXAndYAxis );
spHeader->SetSeriesName(
......@@ -621,7 +620,7 @@ void DataBrowser::RenewTable()
aIt->m_xDataSeries,
(aIt->m_xChartType.is() ?
aIt->m_xChartType->getRoleOfSequenceForSeriesLabel() :
OUString( RTL_CONSTASCII_USTRINGPARAM("values-y"))))));
OUString("values-y")))));
// index is 1-based, as 0 is for the column that contains the row-numbers
spHeader->SetRange( aIt->m_nStartColumn + 1, aIt->m_nEndColumn + 1 );
spHeader->SetGetFocusHdl( aFocusLink );
......@@ -646,7 +645,7 @@ String DataBrowser::GetColString( sal_Int32 nColumnId ) const
String DataBrowser::GetRowString( sal_Int32 nRow ) const
{
return rtl::OUString::valueOf(nRow + 1);
return OUString::valueOf(nRow + 1);
}
String DataBrowser::GetCellText( long nRow, sal_uInt16 nColumnId ) const
......@@ -1119,7 +1118,7 @@ sal_uInt32 DataBrowser::GetNumberFormatKey( sal_Int32 nRow, sal_uInt16 nCol ) co
return m_apDataBrowserModel->getNumberFormatKey( lcl_getColumnInData( nCol ), lcl_getRowInData( nRow ));
}
bool DataBrowser::isDateString( rtl::OUString aInputString, double& fOutDateValue )
bool DataBrowser::isDateString( OUString aInputString, double& fOutDateValue )
{
sal_uInt32 nNumberFormat=0;
SvNumberFormatter* pSvNumberFormatter = m_spNumberFormatterWrapper.get() ? m_spNumberFormatterWrapper->getSvNumberFormatter() : 0;
......@@ -1259,7 +1258,7 @@ void DataBrowser::RenewSeriesHeaders()
Reference< beans::XPropertySet > xSeriesProp( aIt->m_xDataSeries, uno::UNO_QUERY );
sal_Int32 nColor = 0;
if( xSeriesProp.is() &&
( xSeriesProp->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("Color"))) >>= nColor ))
( xSeriesProp->getPropertyValue( "Color" ) >>= nColor ))
spHeader->SetColor( Color( nColor ));
spHeader->SetChartType( aIt->m_xChartType, aIt->m_bSwapXAndYAxis );
spHeader->SetSeriesName(
......@@ -1267,7 +1266,7 @@ void DataBrowser::RenewSeriesHeaders()
aIt->m_xDataSeries,
(aIt->m_xChartType.is() ?
aIt->m_xChartType->getRoleOfSequenceForSeriesLabel() :
OUString( RTL_CONSTASCII_USTRINGPARAM("values-y"))))));
OUString( "values-y")))));
spHeader->SetRange( aIt->m_nStartColumn + 1, aIt->m_nEndColumn + 1 );
spHeader->SetGetFocusHdl( aFocusLink );
spHeader->SetEditChangedHdl( aSeriesHeaderChangedLink );
......
......@@ -57,7 +57,7 @@ using namespace ::com::sun::star;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
using ::rtl::OUString;
namespace
{
......@@ -70,7 +70,7 @@ OUString lcl_getRole(
{
try
{
xProp->getPropertyValue( C2U("Role")) >>= aResult;
xProp->getPropertyValue( "Role" ) >>= aResult;
}
catch( const uno::Exception & ex )
{
......@@ -235,8 +235,8 @@ struct DataBrowserModel::tDataColumn
{
::com::sun::star::uno::Reference<
::com::sun::star::chart2::XDataSeries > m_xDataSeries;
sal_Int32 m_nIndexInDataSeries;
::rtl::OUString m_aUIRoleName;
sal_Int32 m_nIndexInDataSeries;
OUString m_aUIRoleName;
::com::sun::star::uno::Reference<
::com::sun::star::chart2::data::XLabeledDataSequence > m_xLabeledDataSequence;
eCellType m_eCellType;
......@@ -249,7 +249,7 @@ struct DataBrowserModel::tDataColumn
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XDataSeries > & xDataSeries,
sal_Int32 nIndexInDataSeries,
::rtl::OUString aUIRoleName,
OUString aUIRoleName,
::com::sun::star::uno::Reference<
::com::sun::star::chart2::data::XLabeledDataSequence > xLabeledDataSequence,
eCellType aCellType,
......@@ -336,7 +336,7 @@ void DataBrowserModel::insertDataSeries( sal_Int32 nAfterColumnIndex )
Reference< beans::XPropertySet > xSeriesProps( xSeries, uno::UNO_QUERY );
if( xSeriesProps.is() )
xSeriesProps->getPropertyValue( C2U( "NumberFormat" )) >>= nSeriesNumberFormat;
xSeriesProps->getPropertyValue( "NumberFormat" ) >>= nSeriesNumberFormat;
}
else
{
......@@ -394,7 +394,7 @@ void DataBrowserModel::insertDataSeries( sal_Int32 nAfterColumnIndex )
// labels
Reference< chart2::data::XDataSequence > xNewLabelSeq(
xDataProvider->createDataSequenceByRangeRepresentation(
OUString( RTL_CONSTASCII_USTRINGPARAM( "label " )) +
"label " +
OUString::valueOf( nIndex )));
lcl_copyDataSequenceProperties(
aLSequences[nSeqIdx]->getLabel(), xNewLabelSeq );
......@@ -409,7 +409,7 @@ void DataBrowserModel::insertDataSeries( sal_Int32 nAfterColumnIndex )
//give the new series the same number format as the former series especially for bubble charts thus the bubble size values can be edited with same format immidiately
Reference< beans::XPropertySet > xNewSeriesProps( xNewSeries, uno::UNO_QUERY );
if( xNewSeriesProps.is() )
xNewSeriesProps->setPropertyValue( C2U( "NumberFormat" ), uno::makeAny( nSeriesNumberFormat ) );
xNewSeriesProps->setPropertyValue( "NumberFormat" , uno::makeAny( nSeriesNumberFormat ) );
}
updateFromModel();
......@@ -704,7 +704,7 @@ bool DataBrowserModel::setCellNumber( sal_Int32 nAtColumn, sal_Int32 nAtRow, dou
setCellAny( nAtColumn, nAtRow, uno::makeAny( fValue ));
}
bool DataBrowserModel::setCellText( sal_Int32 nAtColumn, sal_Int32 nAtRow, const ::rtl::OUString & rText )
bool DataBrowserModel::setCellText( sal_Int32 nAtColumn, sal_Int32 nAtRow, const OUString & rText )
{
return (getCellType( nAtColumn, nAtRow ) == TEXT) &&
setCellAny( nAtColumn, nAtRow, uno::makeAny( rText ));
......@@ -831,7 +831,7 @@ void DataBrowserModel::updateFromModel()
Reference< chart2::XDataSeriesContainer > xSeriesCnt( aChartTypes[nCTIdx], uno::UNO_QUERY );
if( xSeriesCnt.is())
{
rtl::OUString aRoleForDataLabelNumberFormat = ChartTypeHelper::getRoleOfSequenceForDataLabelNumberFormatDetection( aChartTypes[nCTIdx] );
OUString aRoleForDataLabelNumberFormat = ChartTypeHelper::getRoleOfSequenceForDataLabelNumberFormatDetection( aChartTypes[nCTIdx] );
Sequence< Reference< chart2::XDataSeries > > aSeries( xSeriesCnt->getDataSeries());
lcl_tSharedSeqVec aSharedSequences( lcl_getSharedSequences( aSeries ));
......@@ -877,7 +877,7 @@ void DataBrowserModel::updateFromModel()
nSequenceNumberFormatKey = ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel(
Reference< beans::XPropertySet >( xSeries, uno::UNO_QUERY ), xSeries, -1, xDiagram );
}
else if( aRole.equals( C2U( "values-x" ) ) )
else if( aRole.equals( "values-x" ) )
nSequenceNumberFormatKey = nXAxisNumberFormat;
if( ::std::find_if( aSharedSequences.begin(), aSharedSequences.end(),
......@@ -900,7 +900,7 @@ void DataBrowserModel::updateFromModel()
try
{
Reference< beans::XPropertySet > xProp( aCooSysSeq[nCooSysIdx], uno::UNO_QUERY );
xProp->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("SwapXAndYAxis"))) >>= bSwapXAndYAxis;
xProp->getPropertyValue( "SwapXAndYAxis" ) >>= bSwapXAndYAxis;
}
catch( const beans::UnknownPropertyException & ex )
{
......
......@@ -38,7 +38,6 @@ using namespace ::com::sun::star;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
using ::rtl::OUString;
// ----------------------------------------
......@@ -124,17 +123,17 @@ bool RangeSelectionHelper::chooseRange(
{
Sequence< beans::PropertyValue > aArgs( 4 );
aArgs[0] = beans::PropertyValue(
C2U("InitialValue"), -1, uno::makeAny( aCurrentRange ),
"InitialValue", -1, uno::makeAny( aCurrentRange ),
beans::PropertyState_DIRECT_VALUE );
aArgs[1] = beans::PropertyValue(
C2U("Title"), -1,
"Title", -1,
uno::makeAny( aUIString ),
beans::PropertyState_DIRECT_VALUE );
aArgs[2] = beans::PropertyValue(
C2U("CloseOnMouseRelease"), -1, uno::makeAny( true ),
"CloseOnMouseRelease", -1, uno::makeAny( true ),
beans::PropertyState_DIRECT_VALUE );
aArgs[3] = beans::PropertyValue(
C2U("MultiSelectionMode"), -1, uno::makeAny( true ),
"MultiSelectionMode", -1, uno::makeAny( true ),
beans::PropertyState_DIRECT_VALUE );
if( m_xRangeSelectionListener.is() )
......
......@@ -54,7 +54,7 @@ CreationWizardUnoDlg::CreationWizardUnoDlg( const uno::Reference< uno::XComponen
{
uno::Reference< frame::XDesktop > xDesktop(
m_xCC->getServiceManager()->createInstanceWithContext(
C2U( "com.sun.star.frame.Desktop" ), m_xCC ), uno::UNO_QUERY );
"com.sun.star.frame.Desktop" , m_xCC ), uno::UNO_QUERY );
if( xDesktop.is() )
{
uno::Reference< frame::XTerminateListener > xListener( this );
......@@ -74,10 +74,10 @@ CreationWizardUnoDlg::~CreationWizardUnoDlg()
// lang::XServiceInfo
APPHELPER_XSERVICEINFO_IMPL(CreationWizardUnoDlg,CHART_WIZARD_DIALOG_SERVICE_IMPLEMENTATION_NAME)
uno::Sequence< rtl::OUString > CreationWizardUnoDlg
uno::Sequence< OUString > CreationWizardUnoDlg
::getSupportedServiceNames_Static()
{
uno::Sequence< rtl::OUString > aSNS( 1 );
uno::Sequence< OUString > aSNS( 1 );
aSNS.getArray()[ 0 ] = CHART_WIZARD_DIALOG_SERVICE_NAME;
return aSNS;
}
......@@ -191,7 +191,7 @@ void SAL_CALL CreationWizardUnoDlg::disposing( const lang::EventObject& /*Source
}
//-------------------------------------------------------------------------
void SAL_CALL CreationWizardUnoDlg::setTitle( const ::rtl::OUString& /*rTitle*/ ) throw(uno::RuntimeException)
void SAL_CALL CreationWizardUnoDlg::setTitle( const OUString& /*rTitle*/ ) throw(uno::RuntimeException)
{
}
//-------------------------------------------------------------------------
......@@ -292,7 +292,7 @@ void SAL_CALL CreationWizardUnoDlg::disposing()
{
uno::Reference< frame::XDesktop > xDesktop(
m_xCC->getServiceManager()->createInstanceWithContext(
C2U( "com.sun.star.frame.Desktop" ), m_xCC ), uno::UNO_QUERY );
"com.sun.star.frame.Desktop" , m_xCC ), uno::UNO_QUERY );
if( xDesktop.is() )
{
uno::Reference< frame::XTerminateListener > xListener( this );
......@@ -313,16 +313,16 @@ uno::Reference< beans::XPropertySetInfo > SAL_CALL CreationWizardUnoDlg::getProp
return 0;
}
void SAL_CALL CreationWizardUnoDlg::setPropertyValue( const ::rtl::OUString& rPropertyName
void SAL_CALL CreationWizardUnoDlg::setPropertyValue( const OUString& rPropertyName
, const uno::Any& rValue )
throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException
, lang::WrappedTargetException, uno::RuntimeException)
{
if( rPropertyName.equals(C2U("Position")) )
if( rPropertyName == "Position" )
{
awt::Point aPos;
if( ! (rValue >>= aPos) )
throw lang::IllegalArgumentException( C2U("Property 'Position' requires value of type awt::Point"), 0, 0 );
throw lang::IllegalArgumentException( "Property 'Position' requires value of type awt::Point", 0, 0 );
//set left upper outer corner relative to screen
//pixels, screen position
......@@ -337,24 +337,24 @@ void SAL_CALL CreationWizardUnoDlg::setPropertyValue( const ::rtl::OUString& rPr
m_pDialog->SetPosPixel( aNewOuterPos );
}
}
else if( rPropertyName.equals(C2U("Size")) )
else if( rPropertyName == "Size")
{
//read only property, do nothing
}
else if( rPropertyName.equals(C2U("UnlockControllersOnExecute")) )
else if( rPropertyName == "UnlockControllersOnExecute" )
{
if( ! (rValue >>= m_bUnlockControllersOnExecute) )
throw lang::IllegalArgumentException( C2U("Property 'UnlockControllers' requires value of type boolean"), 0, 0 );
throw lang::IllegalArgumentException( "Property 'UnlockControllers' requires value of type boolean" , 0, 0 );
}
else
throw beans::UnknownPropertyException( C2U("unknown property was tried to set to chart wizard"), 0 );
throw beans::UnknownPropertyException( "unknown property was tried to set to chart wizard" , 0 );
}
uno::Any SAL_CALL CreationWizardUnoDlg::getPropertyValue( const ::rtl::OUString& rPropertyName )
uno::Any SAL_CALL CreationWizardUnoDlg::getPropertyValue( const OUString& rPropertyName )
throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
uno::Any aRet;
if( rPropertyName.equals(C2U("Position")) )
if( rPropertyName == "Position" )
{
//get left upper outer corner relative to screen
//pixels, screen position
......@@ -367,7 +367,7 @@ uno::Any SAL_CALL CreationWizardUnoDlg::getPropertyValue( const ::rtl::OUString&
aRet = uno::makeAny( aPoint );
}
}
else if( rPropertyName.equals(C2U("Size")) )
else if( rPropertyName == "Size" )
{
//get outer size inclusive decoration
//pixels, screen position
......@@ -380,35 +380,35 @@ uno::Any SAL_CALL CreationWizardUnoDlg::getPropertyValue( const ::rtl::OUString&
aRet = uno::makeAny( aSize );
}
}
else if( rPropertyName.equals(C2U("UnlockControllersOnExecute")) )
else if( rPropertyName == "UnlockControllersOnExecute" )
{
aRet = uno::makeAny( m_bUnlockControllersOnExecute );
}
else
throw beans::UnknownPropertyException( C2U("unknown property was tried to get from chart wizard"), 0 );
throw beans::UnknownPropertyException( "unknown property was tried to get from chart wizard" , 0 );
return aRet;
}
void SAL_CALL CreationWizardUnoDlg::addPropertyChangeListener(
const ::rtl::OUString& /* aPropertyName */, const uno::Reference< beans::XPropertyChangeListener >& /* xListener */ )
const OUString& /* aPropertyName */, const uno::Reference< beans::XPropertyChangeListener >& /* xListener */ )
throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
OSL_FAIL("not implemented");
}
void SAL_CALL CreationWizardUnoDlg::removePropertyChangeListener(
const ::rtl::OUString& /* aPropertyName */, const uno::Reference< beans::XPropertyChangeListener >& /* aListener */ )
const OUString& /* aPropertyName */, const uno::Reference< beans::XPropertyChangeListener >& /* aListener */ )
throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
OSL_FAIL("not implemented");
}
void SAL_CALL CreationWizardUnoDlg::addVetoableChangeListener( const ::rtl::OUString& /* PropertyName */, const uno::Reference< beans::XVetoableChangeListener >& /* aListener */ )
void SAL_CALL CreationWizardUnoDlg::addVetoableChangeListener( const OUString& /* PropertyName */, const uno::Reference< beans::XVetoableChangeListener >& /* aListener */ )
throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
OSL_FAIL("not implemented");
}
void SAL_CALL CreationWizardUnoDlg::removeVetoableChangeListener( const ::rtl::OUString& /* PropertyName */, const uno::Reference< beans::XVetoableChangeListener >& /* aListener */ )
void SAL_CALL CreationWizardUnoDlg::removeVetoableChangeListener( const OUString& /* PropertyName */, const uno::Reference< beans::XVetoableChangeListener >& /* aListener */ )
throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
OSL_FAIL("not implemented");
......
......@@ -79,7 +79,7 @@ using ::com::sun::star::uno::Reference;
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
ObjectPropertiesDialogParameter::ObjectPropertiesDialogParameter( const rtl::OUString& rObjectCID )
ObjectPropertiesDialogParameter::ObjectPropertiesDialogParameter( const OUString& rObjectCID )
: m_aObjectCID( rObjectCID )
, m_eObjectType( ObjectIdentifier::getObjectType( m_aObjectCID ) )
, m_bAffectsMultipleObjects(false)
......@@ -103,8 +103,8 @@ ObjectPropertiesDialogParameter::ObjectPropertiesDialogParameter( const rtl::OUS
, m_xChartDocument( 0 )
, m_bComplexCategoriesAxis( false )
{
rtl::OUString aParticleID = ObjectIdentifier::getParticleID( m_aObjectCID );
m_bAffectsMultipleObjects = aParticleID.equals(C2U("ALLELEMENTS"));
OUString aParticleID = ObjectIdentifier::getParticleID( m_aObjectCID );
m_bAffectsMultipleObjects = (aParticleID == "ALLELEMENTS");
}
ObjectPropertiesDialogParameter::~ObjectPropertiesDialogParameter()
{
......@@ -113,7 +113,7 @@ ObjectType ObjectPropertiesDialogParameter::getObjectType() const
{
return m_eObjectType;
}
rtl::OUString ObjectPropertiesDialogParameter::getLocalizedName() const
OUString ObjectPropertiesDialogParameter::getLocalizedName() const
{
return m_aLocalizedName;
}
......@@ -296,7 +296,7 @@ bool ObjectPropertiesDialogParameter::IsCrossingAxisIsCategoryAxis() const
{
return m_bIsCrossingAxisIsCategoryAxis;
}
const uno::Sequence< rtl::OUString >& ObjectPropertiesDialogParameter::GetCategories() const
const uno::Sequence< OUString >& ObjectPropertiesDialogParameter::GetCategories() const
{
return m_aCategories;
}
......
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