From dbc484ce448b682f70a774430942063e91ee1909 Mon Sep 17 00:00:00 2001 From: José Guilherme Vanz Date: Tue, 18 Dec 2012 22:38:21 -0200 Subject: Removel ::rtl:: prefixes and macros in oox MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit removes ::rtl:: prefixes, macros and replace old String class in oox Change-Id: I2672c859a45bc1221415479218c352bab4fe9b1a Signed-off-by: José Guilherme Vanz Reviewed-on: https://gerrit.libreoffice.org/1335 Reviewed-by: Luboš Luňák Tested-by: Luboš Luňák --- oox/source/export/ColorPropertySet.cxx | 1 - oox/source/export/ColorPropertySet.hxx | 22 +++++------ oox/source/export/SchXMLSeriesHelper.cxx | 5 +-- oox/source/export/chartexport.cxx | 64 +++++++++++++++----------------- oox/source/export/drawingml.cxx | 23 +++++------- oox/source/export/shapes.cxx | 8 +--- oox/source/export/vmlexport.cxx | 8 +--- 7 files changed, 55 insertions(+), 76 deletions(-) (limited to 'oox') diff --git a/oox/source/export/ColorPropertySet.cxx b/oox/source/export/ColorPropertySet.cxx index 8475cf0353ff..02c1d37cb836 100644 --- a/oox/source/export/ColorPropertySet.cxx +++ b/oox/source/export/ColorPropertySet.cxx @@ -27,7 +27,6 @@ using namespace ::com::sun::star::beans; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; -using ::rtl::OUString; using ::com::sun::star::uno::RuntimeException; // ================================================================================ diff --git a/oox/source/export/ColorPropertySet.hxx b/oox/source/export/ColorPropertySet.hxx index 7d5e2e53608c..ab594b2f85e7 100644 --- a/oox/source/export/ColorPropertySet.hxx +++ b/oox/source/export/ColorPropertySet.hxx @@ -44,7 +44,7 @@ protected: virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL setPropertyValue( - const ::rtl::OUString& aPropertyName, + const OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, @@ -52,30 +52,30 @@ protected: ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( - const ::rtl::OUString& PropertyName ) + const OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL addPropertyChangeListener( - const ::rtl::OUString& aPropertyName, + const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL removePropertyChangeListener( - const ::rtl::OUString& aPropertyName, + const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL addVetoableChangeListener( - const ::rtl::OUString& PropertyName, + const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL removeVetoableChangeListener( - const ::rtl::OUString& PropertyName, + const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, @@ -83,19 +83,19 @@ protected: // ____ XPropertyState ____ virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( - const ::rtl::OUString& PropertyName ) + const OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( - const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) + const ::com::sun::star::uno::Sequence< OUString >& aPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL setPropertyToDefault( - const ::rtl::OUString& PropertyName ) + const OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( - const ::rtl::OUString& aPropertyName ) + const OUString& aPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); @@ -103,7 +103,7 @@ protected: private: ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > m_xInfo; - ::rtl::OUString m_aColorPropName; + OUString m_aColorPropName; sal_Int32 m_nColor; bool m_bIsFillColor; sal_Int32 m_nDefaultColor; diff --git a/oox/source/export/SchXMLSeriesHelper.cxx b/oox/source/export/SchXMLSeriesHelper.cxx index e91f2efe1414..802fc017af74 100644 --- a/oox/source/export/SchXMLSeriesHelper.cxx +++ b/oox/source/export/SchXMLSeriesHelper.cxx @@ -32,12 +32,9 @@ #include using namespace ::com::sun::star; -using ::rtl::OUString; -using ::rtl::OUStringToOString; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; -using ::rtl::OUString; // ---------------------------------------- @@ -167,7 +164,7 @@ bool SchXMLSeriesHelper::isCandleStickSeries( xNewDiagram, xSeries ) ); if( xChartType.is() ) { - rtl::OUString aServiceName( xChartType->getChartType() ); + OUString aServiceName( xChartType->getChartType() ); if( aServiceName == "com.sun.star.chart2.CandleStickChartType" ) bRet = true; } diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 37abe5d0a04b..dcd4be12534c 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -99,10 +99,6 @@ using ::com::sun::star::table::CellAddress; using ::com::sun::star::sheet::XFormulaParser; using ::com::sun::star::sheet::XFormulaTokens; using ::oox::core::XmlFilterBase; -using ::rtl::OString; -using ::rtl::OStringBuffer; -using ::rtl::OUString; -using ::rtl::OUStringBuffer; using ::sax_fastparser::FSHelperPtr; DBG(extern void dump_pset(Reference< XPropertySet > rXPropSet)); @@ -189,7 +185,7 @@ Reference< chart2::data::XLabeledDataSequence > lcl_getCategories( const Referen catch( const uno::Exception & ex ) { (void)ex; // avoid warning for pro build - OSL_FAIL( rtl::OUStringToOString( + OSL_FAIL( OUStringToOString( OUString( "Exception caught. Type: " ) + OUString::createFromAscii( typeid( ex ).name()) + OUString( ", Message: " ) + @@ -306,7 +302,7 @@ bool lcl_isSeriesAttachedToFirstAxis( catch( const uno::Exception & ex ) { (void)ex; // avoid warning for pro build - OSL_FAIL( rtl::OUStringToOString( + OSL_FAIL( OUStringToOString( OUString( "Exception caught. Type: " ) + OUString::createFromAscii( typeid( ex ).name()) + OUString( ", Message: " ) + @@ -403,35 +399,35 @@ void lcl_fillCategoriesIntoStringVector( sal_Int32 lcl_getChartType( const OUString& sChartType ) { chart::TypeId eChartTypeId = chart::TYPEID_UNKNOWN; - if(( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.BarDiagram" ))) - || ( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.ColumnChartType") ) ) ) + if(( 0 == sChartType.reverseCompareTo( "com.sun.star.chart.BarDiagram" )) + || ( 0 == sChartType.reverseCompareTo( "com.sun.star.chart2.ColumnChartType" ))) eChartTypeId = chart::TYPEID_BAR; - else if(( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.AreaDiagram" ))) - || ( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.AreaChartType") ) ) ) + else if(( 0 == sChartType.reverseCompareTo( "com.sun.star.chart.AreaDiagram" )) + || ( 0 == sChartType.reverseCompareTo( "com.sun.star.chart2.AreaChartType" ) ) ) eChartTypeId = chart::TYPEID_AREA; - else if(( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.LineDiagram" ))) - || ( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.LineChartType") ) ) ) + else if(( 0 == sChartType.reverseCompareTo( "com.sun.star.chart.LineDiagram" )) + || ( 0 == sChartType.reverseCompareTo( "com.sun.star.chart2.LineChartType" ) ) ) eChartTypeId = chart::TYPEID_LINE; - else if(( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.PieDiagram" ))) - || ( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.PieChartType") ) ) ) + else if(( 0 == sChartType.reverseCompareTo( "com.sun.star.chart.PieDiagram" )) + || ( 0 == sChartType.reverseCompareTo( "com.sun.star.chart2.PieChartType") ) ) eChartTypeId = chart::TYPEID_PIE; - else if(( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.DonutDiagram" ))) - || ( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.DonutChartType") ) ) ) + else if(( 0 == sChartType.reverseCompareTo( "com.sun.star.chart.DonutDiagram")) + || ( 0 == sChartType.reverseCompareTo( "com.sun.star.chart2.DonutChartType") ) ) eChartTypeId = chart::TYPEID_DOUGHNUT; - else if(( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.XYDiagram" ))) - || ( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.ScatterChartType") ) ) ) + else if(( 0 == sChartType.reverseCompareTo( "com.sun.star.chart.XYDiagram")) + || ( 0 == sChartType.reverseCompareTo( "com.sun.star.chart2.ScatterChartType") ) ) eChartTypeId = chart::TYPEID_SCATTER; - else if(( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.NetDiagram" ))) - || ( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.NetChartType") ) ) ) + else if(( 0 == sChartType.reverseCompareTo( "com.sun.star.chart.NetDiagram")) + || ( 0 == sChartType.reverseCompareTo( "com.sun.star.chart2.NetChartType") ) ) eChartTypeId = chart::TYPEID_RADARLINE; - else if(( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.FilledNetDiagram" ))) - || ( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.FilledNetChartType") ) ) ) + else if(( 0 == sChartType.reverseCompareTo( "com.sun.star.chart.FilledNetDiagram")) + || ( 0 == sChartType.reverseCompareTo( "com.sun.star.chart2.FilledNetChartType") ) ) eChartTypeId = chart::TYPEID_RADARAREA; - else if(( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.StockDiagram" ))) - || ( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.CandleStickChartType") ) ) ) + else if(( 0 == sChartType.reverseCompareTo( "com.sun.star.chart.StockDiagram")) + || ( 0 == sChartType.reverseCompareTo( "com.sun.star.chart2.CandleStickChartType") ) ) eChartTypeId = chart::TYPEID_STOCK; - else if(( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.BubbleDiagram" ))) - || ( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.BubbleChartType") ) ) ) + else if(( 0 == sChartType.reverseCompareTo( "com.sun.star.chart.BubbleDiagram")) + || ( 0 == sChartType.reverseCompareTo( "com.sun.star.chart2.BubbleChartType") ) ) eChartTypeId = chart::TYPEID_BUBBLE; return eChartTypeId; @@ -507,14 +503,14 @@ OUString ChartExport::parseFormula( const OUString& rRange ) { OSL_TRACE("ChartExport::parseFormula, parser is invalid"); //FIXME: currently just using simple converter, e.g $Sheet1.$A$1:$C$1 -> Sheet1!$A$1:$C$1 - String aRange( rRange ); - if( aRange.SearchAscii("$") == 0 ) - aRange = aRange.Copy(1); - aRange.SearchAndReplaceAllAscii(".$", rtl::OUString("!$") ); + OUString aRange( rRange ); + if( aRange.indexOf("$") == 0 ) + aRange = aRange.copy(1); + aRange = aRange.replaceAll(".$", "!$" ); aResult = aRange; } - OSL_TRACE("ChartExport::parseFormula, the originla formula is %s, the new formula is %s ", rtl::OUStringToOString( rRange, RTL_TEXTENCODING_UTF8 ).getStr(), rtl::OUStringToOString( aResult, RTL_TEXTENCODING_UTF8 ).getStr()); + OSL_TRACE("ChartExport::parseFormula, the originla formula is %s, the new formula is %s ", OUStringToOString( rRange, RTL_TEXTENCODING_UTF8 ).getStr(), OUStringToOString( aResult, RTL_TEXTENCODING_UTF8 ).getStr()); return aResult; } @@ -631,7 +627,7 @@ void ChartExport::InitRangeSegmentationProperties( const Reference< chart2::XCha { Reference< chart2::data::XDataSource > xDataSource( lcl_pressUsedDataIntoRectangularFormat( xChartDoc, mbHasCategoryLabels )); Sequence< beans::PropertyValue > aArgs( xDataProvider->detectArguments( xDataSource )); - ::rtl::OUString sCellRange, sBrokenRange; + OUString sCellRange, sBrokenRange; bool bBrokenRangeAvailable = false; for( sal_Int32 i=0; i rXPropSet)); @@ -102,10 +98,10 @@ namespace oox { namespace drawingml { #define GETA(propName) \ - GetProperty( rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( #propName ) ) ) + GetProperty( rXPropSet, String( #propName ) ) #define GETAD(propName) \ - ( GetPropertyAndState( rXPropSet, rXPropState, String( RTL_CONSTASCII_USTRINGPARAM( #propName ) ), eState ) && eState == beans::PropertyState_DIRECT_VALUE ) + ( GetPropertyAndState( rXPropSet, rXPropState, String( #propName ), eState ) && eState == beans::PropertyState_DIRECT_VALUE ) #define GET(variable, propName) \ if ( GETA(propName) ) \ @@ -405,10 +401,10 @@ void DrawingML::WriteOutline( Reference< XPropertySet > rXPropSet ) OUString DrawingML::WriteImage( const OUString& rURL ) { - rtl::OString aURLBS(rtl::OUStringToOString(rURL, RTL_TEXTENCODING_UTF8)); + OString aURLBS(OUStringToOString(rURL, RTL_TEXTENCODING_UTF8)); const char aURLBegin[] = "vnd.sun.star.GraphicObject:"; - sal_Int32 index = aURLBS.indexOfL(RTL_CONSTASCII_STRINGPARAM(aURLBegin)); + sal_Int32 index = aURLBS.indexOf(aURLBegin); if ( index != -1 ) { @@ -841,14 +837,14 @@ const char* DrawingML::GetFieldType( ::com::sun::star::uno::Reference< ::com::su { const char* sType = NULL; Reference< XPropertySet > rXPropSet( rRun, UNO_QUERY ); - String aFieldType; + OUString aFieldType; if( GETA( TextPortionType ) ) { - aFieldType = String( *(::rtl::OUString*)mAny.getValue() ); + aFieldType = OUString( *(OUString*)mAny.getValue() ); DBG(printf ("field type: %s\n", USS(aFieldType) )); } - if( aFieldType == S( "TextField" ) ) { + if( aFieldType == "TextField" ) { Reference< XTextField > rXTextField; GET( rXTextField, TextField ); if( rXTextField.is() ) { @@ -1455,8 +1451,7 @@ void DrawingML::WriteConnectorConnections( EscherConnectorListEntry& rConnectorE sal_Unicode DrawingML::SubstituteBullet( sal_Unicode cBulletId, ::com::sun::star::awt::FontDescriptor& rFontDesc ) { - if ( rFontDesc.Name.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("starsymbol")) || - rFontDesc.Name.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("opensymbol")) ) + if ( rFontDesc.Name == "starsymbol" || rFontDesc.Name == "opensymbol" ) { rtl_TextEncoding eCharSet = rFontDesc.CharSet; cBulletId = msfilter::util::bestFitOpenSymbolToMSFont(cBulletId, eCharSet, rFontDesc.Name); @@ -1472,7 +1467,7 @@ sax_fastparser::FSHelperPtr DrawingML::CreateOutputStream ( const Reference< XOutputStream >& xParentRelation, const char* sContentType, const char* sRelationshipType, - ::rtl::OUString* pRelationshipId ) + OUString* pRelationshipId ) { OUString sRelationshipId; if (xParentRelation.is()) diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 87b8e5521899..862f839c120e 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -106,10 +106,6 @@ using ::com::sun::star::frame::XModel; using ::com::sun::star::sheet::XSpreadsheetDocument; using ::comphelper::MediaDescriptor; using ::oox::core::XmlFilterBase; -using ::rtl::OString; -using ::rtl::OStringBuffer; -using ::rtl::OUString; -using ::rtl::OUStringBuffer; using ::sax_fastparser::FSHelperPtr; #define IDS(x) OString(OStringLiteral(#x " ") + OString::valueOf( mnShapeIdMax++ )).getStr() @@ -557,10 +553,10 @@ static const char* lcl_GetPresetGeometry( const char* sShapeType ) namespace oox { namespace drawingml { #define GETA(propName) \ - GetProperty( rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( #propName ) ) ) + GetProperty( rXPropSet, OUString(#propName)) #define GETAD(propName) \ - ( GetPropertyAndState( rXPropSet, rXPropState, String( RTL_CONSTASCII_USTRINGPARAM( #propName ) ), eState ) && eState == beans::PropertyState_DIRECT_VALUE ) + ( GetPropertyAndState( rXPropSet, rXPropState, OUString(#propName), eState ) && eState == beans::PropertyState_DIRECT_VALUE ) #define GET(variable, propName) \ if ( GETA(propName) ) \ diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx index 254bee09e47a..b843baffcd5d 100644 --- a/oox/source/export/vmlexport.cxx +++ b/oox/source/export/vmlexport.cxx @@ -30,10 +30,6 @@ #include -using rtl::OString; -using rtl::OStringBuffer; -using rtl::OUString; -using rtl::OUStringBuffer; using namespace sax_fastparser; using namespace oox::vml; @@ -759,7 +755,7 @@ void VMLExport::AddLineDimensions( const Rectangle& rRectangle ) .makeStringAndClear() ); } -void VMLExport::AddRectangleDimensions( rtl::OStringBuffer& rBuffer, const Rectangle& rRectangle ) +void VMLExport::AddRectangleDimensions( OStringBuffer& rBuffer, const Rectangle& rRectangle ) { if ( rBuffer.getLength() ) rBuffer.append( ";" ); @@ -783,7 +779,7 @@ void VMLExport::AddRectangleDimensions( rtl::OStringBuffer& rBuffer, const Recta } } -void VMLExport::AddShapeAttribute( sal_Int32 nAttribute, const rtl::OString& rValue ) +void VMLExport::AddShapeAttribute( sal_Int32 nAttribute, const OString& rValue ) { m_pShapeAttrList->add( nAttribute, rValue ); } -- cgit