diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2012-11-25 00:33:44 -0600 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2012-11-27 22:59:29 -0600 |
commit | 1a8ac8b2df40edd0b17825e2ca0cb170061d0ff1 (patch) | |
tree | ed2f435b817f5dcfc7e5df588966de3337f78ea0 /xmloff | |
parent | 739146b75d8f3e537759925ba6e17cddd28e1acf (diff) |
String and OUString cleaning in xmloff
Change-Id: I85d7fd7733814c60a048a7f87d43fbcbb83b0eb0
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/inc/xmloff/xmlimp.hxx | 101 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLAxisContext.cxx | 107 | ||||
-rw-r--r-- | xmloff/source/draw/shapeexport.cxx | 118 | ||||
-rw-r--r-- | xmloff/source/draw/shapeexport4.cxx | 73 | ||||
-rw-r--r-- | xmloff/source/style/styleexp.cxx | 20 | ||||
-rw-r--r-- | xmloff/source/style/xmlnumfe.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/style/xmlnumfi.cxx | 98 | ||||
-rw-r--r-- | xmloff/source/style/xmlnumi.cxx | 9 | ||||
-rw-r--r-- | xmloff/source/style/xmlstyle.cxx | 44 | ||||
-rw-r--r-- | xmloff/source/text/txtimp.cxx | 181 |
10 files changed, 370 insertions, 385 deletions
diff --git a/xmloff/inc/xmloff/xmlimp.hxx b/xmloff/inc/xmloff/xmlimp.hxx index 77910e0704a3..125728fbb726 100644 --- a/xmloff/inc/xmloff/xmlimp.hxx +++ b/xmloff/inc/xmloff/xmlimp.hxx @@ -49,7 +49,6 @@ #include <com/sun/star/beans/NamedValue.hpp> -namespace rtl { class OUString; } namespace com { namespace sun { namespace star { namespace uno { class XComponentContext; } namespace frame { class XModel; } @@ -68,7 +67,6 @@ class XMLFontStylesContext; class XMLEventImportHelper; class XMLErrors; class StyleMap; -class String; namespace xmloff { class RDFaImportHelper; @@ -134,7 +132,7 @@ class XMLOFF_DLLPUBLIC SvXMLImport : public ::cppu::WeakImplHelper6< XMLEventImportHelper *mpEventImportHelper; XMLErrors *mpXMLErrors; StyleMap *mpStyleMap; - ::rtl::OUString msPackageProtocol; + OUString msPackageProtocol; SAL_DLLPRIVATE void _InitCtor(); @@ -153,8 +151,8 @@ protected: // This method is called after the namespace map has been updated, but // before a context for the current element has been pushed. virtual SvXMLImportContext *CreateContext( sal_uInt16 nPrefix, - const ::rtl::OUString& rLocalName, - const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); + const OUString& rLocalName, + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); virtual XMLTextImportHelper* CreateTextImport(); virtual XMLShapeImportHelper* CreateShapeImport(); @@ -169,7 +167,7 @@ protected: void SetAutoStyles( SvXMLStylesContext *pAutoStyles ); void SetMasterStyles( SvXMLStylesContext *pMasterStyles ); - sal_Bool IsODFVersionConsistent( const ::rtl::OUString& aODFVersion ); + sal_Bool IsODFVersionConsistent( const OUString& aODFVersion ); const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEmbeddedObjectResolver >& GetEmbeddedResolver() const { return mxEmbeddedResolver; } inline void SetEmbeddedResolver( com::sun::star::uno::Reference< com::sun::star::document::XEmbeddedObjectResolver >& _xEmbeddedResolver ); @@ -197,17 +195,17 @@ public: throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); virtual void SAL_CALL endDocument(void) throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL startElement(const ::rtl::OUString& aName, - const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttribs) + virtual void SAL_CALL startElement(const OUString& aName, + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttribs) throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL endElement(const ::rtl::OUString& aName) + virtual void SAL_CALL endElement(const OUString& aName) throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL characters(const ::rtl::OUString& aChars) + virtual void SAL_CALL characters(const OUString& aChars) throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL ignorableWhitespace(const ::rtl::OUString& aWhitespaces) + virtual void SAL_CALL ignorableWhitespace(const OUString& aWhitespaces) throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL processingInstruction(const ::rtl::OUString& aTarget, - const ::rtl::OUString& aData) + virtual void SAL_CALL processingInstruction(const OUString& aTarget, + const OUString& aData) throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); virtual void SAL_CALL setDocumentLocator(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > & xLocator) throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); @@ -215,11 +213,11 @@ public: // ::com::sun::star::xml::sax::XExtendedDocumentHandler virtual void SAL_CALL startCDATA(void) throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); virtual void SAL_CALL endCDATA(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL comment(const ::rtl::OUString& sComment) + virtual void SAL_CALL comment(const OUString& sComment) throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); virtual void SAL_CALL allowLineBreak(void) throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL unknown(const ::rtl::OUString& sString) + virtual void SAL_CALL unknown(const OUString& sString) throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); // XImporter @@ -236,9 +234,12 @@ public: virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); // XServiceInfo - virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException); + virtual OUString SAL_CALL getImplementationName( ) + throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) + throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) + throw(::com::sun::star::uno::RuntimeException); // may be called by certain subclasses that handle document meta-data // override to provide customized handling of document statistics @@ -288,36 +289,36 @@ public: // Convert a local packe URL into either a graphic manager or a // internal package URL. The later one happens only if bLoadURL is true - ::rtl::OUString ResolveGraphicObjectURL( const ::rtl::OUString& rURL, sal_Bool bLoadOnDemand ); + OUString ResolveGraphicObjectURL( const OUString& rURL, sal_Bool bLoadOnDemand ); ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > - GetStreamForGraphicObjectURLFromBase64(); - ::rtl::OUString ResolveGraphicObjectURLFromBase64( + GetStreamForGraphicObjectURLFromBase64(); + OUString ResolveGraphicObjectURLFromBase64( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& rOut ); - sal_Bool IsPackageURL( const ::rtl::OUString& rURL ) const; - ::rtl::OUString ResolveEmbeddedObjectURL( const ::rtl::OUString& rURL, - const ::rtl::OUString& rClassId ); + sal_Bool IsPackageURL( const OUString& rURL ) const; + OUString ResolveEmbeddedObjectURL( const OUString& rURL, + const OUString& rClassId ); ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > GetStreamForEmbeddedObjectURLFromBase64(); - ::rtl::OUString ResolveEmbeddedObjectURLFromBase64(); + OUString ResolveEmbeddedObjectURLFromBase64(); // get source storage we're importing from (if available) ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > GetSourceStorage(); void AddStyleDisplayName( sal_uInt16 nFamily, - const ::rtl::OUString& rName, - const ::rtl::OUString& rDisplayName ); - ::rtl::OUString GetStyleDisplayName( sal_uInt16 nFamily, - const ::rtl::OUString& rName ) const; + const OUString& rName, + const OUString& rDisplayName ); + OUString GetStyleDisplayName( sal_uInt16 nFamily, + const OUString& rName ) const; ProgressBarHelper* GetProgressBarHelper(); - void AddNumberStyle(sal_Int32 nKey, const rtl::OUString& sName); + void AddNumberStyle(sal_Int32 nKey, const OUString& sName); virtual void SetViewSettings(const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aViewProps); virtual void SetConfigurationSettings(const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aConfigProps); - virtual void SetDocumentSpecificSettings(const ::rtl::OUString& _rSettingsGroupName, + virtual void SetDocumentSpecificSettings(const OUString& _rSettingsGroupName, const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& _rSettings); XMLFontStylesContext *GetFontDecls(); @@ -329,14 +330,14 @@ public: sal_uInt16 getImportFlags() const { return mnImportFlags; } sal_Bool IsFormsSupported() const { return mbIsFormsSupported; } - rtl::OUString GetAbsoluteReference(const rtl::OUString& rValue) const; + OUString GetAbsoluteReference(const OUString& rValue) const; sal_Unicode ConvStarBatsCharToStarSymbol( sal_Unicode c ); sal_Unicode ConvStarMathCharToStarSymbol( sal_Unicode c ); bool IsTableShapeSupported() const { return mbIsTableShapeSupported; } - ::rtl::OUString GetODFVersion() const; + OUString GetODFVersion() const; /** * Record an error condition that occurred during import. The @@ -347,21 +348,21 @@ public: /// error ID, may contain an error flag sal_Int32 nId, /// string parameters for the error message - const ::com::sun::star::uno::Sequence< ::rtl::OUString> & rMsgParams, + const ::com::sun::star::uno::Sequence< OUString > & rMsgParams, /// original exception message (if applicable) - const ::rtl::OUString& rExceptionMessage, + const OUString& rExceptionMessage, /// error location (if applicable) const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator> & rLocator ); void SetError( sal_Int32 nId, - const ::com::sun::star::uno::Sequence< ::rtl::OUString> & rMsgParams); + const ::com::sun::star::uno::Sequence< OUString> & rMsgParams); void SetError( sal_Int32 nId ); - void SetError( sal_Int32 nId, const rtl::OUString& rMsg1 ); - void SetError( sal_Int32 nId, const rtl::OUString& rMsg1, - const rtl::OUString& rMsg2 ); + void SetError( sal_Int32 nId, const OUString& rMsg1 ); + void SetError( sal_Int32 nId, const OUString& rMsg1, + const OUString& rMsg2 ); /** return current error flags */ sal_uInt16 GetErrorFlags() { return mnErrorFlags; } @@ -381,25 +382,23 @@ public: sal_Bool IsTextDocInOOoFileFormat() const; - ::rtl::OUString GetBaseURL() const; - ::rtl::OUString GetDocumentBase() const; + OUString GetBaseURL() const; + OUString GetDocumentBase() const; /// name of stream in package, e.g., "content.xml" - ::rtl::OUString GetStreamName() const; + OUString GetStreamName() const; /// set the XmlId attribute of given UNO object (for RDF metadata) void SetXmlId(::com::sun::star::uno::Reference< - ::com::sun::star::uno::XInterface> const & i_xIfc, - ::rtl::OUString const & i_rXmlId); + ::com::sun::star::uno::XInterface> const & i_xIfc, + OUString const & i_rXmlId); /// Add a RDFa statement; parameters are XML attribute values - void AddRDFa( - ::com::sun::star::uno::Reference< ::com::sun::star::rdf::XMetadatable> - i_xObject, - ::rtl::OUString const & i_rAbout, - ::rtl::OUString const & i_rProperty, - ::rtl::OUString const & i_rContent, - ::rtl::OUString const & i_rDatatype); + void AddRDFa( ::com::sun::star::uno::Reference< ::com::sun::star::rdf::XMetadatable> i_xObject, + OUString const & i_rAbout, + OUString const & i_rProperty, + OUString const & i_rContent, + OUString const & i_rDatatype); /// do not dllexport this; only for advanced cases (bookmark-start) SAL_DLLPRIVATE ::xmloff::RDFaImportHelper & GetRDFaImportHelper(); diff --git a/xmloff/source/chart/SchXMLAxisContext.cxx b/xmloff/source/chart/SchXMLAxisContext.cxx index 36411fa91879..3ddf60b4b9c9 100644 --- a/xmloff/source/chart/SchXMLAxisContext.cxx +++ b/xmloff/source/chart/SchXMLAxisContext.cxx @@ -50,7 +50,6 @@ using namespace ::xmloff::token; using namespace com::sun::star; -using rtl::OUString; using com::sun::star::uno::Reference; //---------------------------------------- @@ -162,23 +161,23 @@ Reference< drawing::XShape > SchXMLAxisContext::getTitleShape() if( !xDiaProp.is() || !xAxis.is() ) return xResult; - rtl::OUString aPropName; + OUString aPropName; switch( m_aCurrentAxis.eDimension ) { case SCH_XML_AXIS_X: if( m_aCurrentAxis.nAxisIndex == 0 ) - aPropName = OUString(RTL_CONSTASCII_USTRINGPARAM( "HasXAxisTitle" )); + aPropName = "HasXAxisTitle"; else - aPropName = OUString(RTL_CONSTASCII_USTRINGPARAM( "HasSecondaryXAxisTitle" )); + aPropName = "HasSecondaryXAxisTitle"; break; case SCH_XML_AXIS_Y: if( m_aCurrentAxis.nAxisIndex == 0 ) - aPropName = OUString(RTL_CONSTASCII_USTRINGPARAM( "HasYAxisTitle" )); + aPropName = "HasYAxisTitle"; else - aPropName = OUString(RTL_CONSTASCII_USTRINGPARAM( "HasSecondaryYAxisTitle" )); + aPropName = "HasSecondaryYAxisTitle"; break; case SCH_XML_AXIS_Z: - aPropName = OUString(RTL_CONSTASCII_USTRINGPARAM( "HasZAxisTitle" )); + aPropName = "HasZAxisTitle"; break; case SCH_XML_AXIS_UNDEF: OSL_TRACE( "Invalid axis" ); @@ -196,26 +195,26 @@ void SchXMLAxisContext::CreateGrid( OUString sAutoStyleName, bool bIsMajor ) if( !xDiaProp.is() || !xAxis.is() ) return; - rtl::OUString aPropName; + OUString aPropName; switch( m_aCurrentAxis.eDimension ) { case SCH_XML_AXIS_X: if( bIsMajor ) - aPropName = OUString(RTL_CONSTASCII_USTRINGPARAM("HasXAxisGrid")); + aPropName = "HasXAxisGrid"; else - aPropName = OUString(RTL_CONSTASCII_USTRINGPARAM("HasXAxisHelpGrid")); + aPropName = "HasXAxisHelpGrid"; break; case SCH_XML_AXIS_Y: if( bIsMajor ) - aPropName = OUString(RTL_CONSTASCII_USTRINGPARAM("HasYAxisGrid")); + aPropName = "HasYAxisGrid"; else - aPropName = OUString(RTL_CONSTASCII_USTRINGPARAM("HasYAxisHelpGrid")); + aPropName = "HasYAxisHelpGrid"; break; case SCH_XML_AXIS_Z: if( bIsMajor ) - aPropName = OUString(RTL_CONSTASCII_USTRINGPARAM("HasZAxisGrid")); + aPropName = "HasZAxisGrid"; else - aPropName = OUString(RTL_CONSTASCII_USTRINGPARAM("HasZAxisHelpGrid")); + aPropName = "HasZAxisHelpGrid"; break; case SCH_XML_AXIS_UNDEF: OSL_TRACE( "Invalid axis" ); @@ -233,7 +232,7 @@ void SchXMLAxisContext::CreateGrid( OUString sAutoStyleName, bool bIsMajor ) if( xGridProp.is()) { // the line color is black as default, in the model it is a light gray - xGridProp->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "LineColor" )), + xGridProp->setPropertyValue( OUString( "LineColor" ), uno::makeAny( COL_BLACK )); if( !sAutoStyleName.isEmpty()) { @@ -402,26 +401,26 @@ void SchXMLAxisContext::CreateAxis() Reference< beans::XPropertySet > xDiaProp( m_rImportHelper.GetChartDocument()->getDiagram(), uno::UNO_QUERY ); if( !xDiaProp.is() ) return; - rtl::OUString aPropName; + OUString aPropName; switch( m_aCurrentAxis.eDimension ) { case SCH_XML_AXIS_X: if( m_aCurrentAxis.nAxisIndex == 0 ) - aPropName = OUString(RTL_CONSTASCII_USTRINGPARAM("HasXAxis")); + aPropName = "HasXAxis"; else - aPropName = OUString(RTL_CONSTASCII_USTRINGPARAM("HasSecondaryXAxis")); + aPropName = "HasSecondaryXAxis"; break; case SCH_XML_AXIS_Y: if( m_aCurrentAxis.nAxisIndex == 0 ) - aPropName = OUString(RTL_CONSTASCII_USTRINGPARAM("HasYAxis")); + aPropName = "HasYAxis"; else - aPropName = OUString(RTL_CONSTASCII_USTRINGPARAM("HasSecondaryYAxis")); + aPropName = "HasSecondaryYAxis"; break; case SCH_XML_AXIS_Z: if( m_aCurrentAxis.nAxisIndex == 0 ) - aPropName = OUString(RTL_CONSTASCII_USTRINGPARAM("HasXAxis")); + aPropName = "HasXAxis"; else - aPropName = OUString(RTL_CONSTASCII_USTRINGPARAM("HasSecondaryXAxis")); + aPropName = "HasSecondaryXAxis"; break; case SCH_XML_AXIS_UNDEF: OSL_TRACE( "Invalid axis" ); @@ -457,7 +456,7 @@ void SchXMLAxisContext::CreateAxis() { try { - xDiaProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM( "HasXAxis" )), uno::makeAny(sal_True) ); + xDiaProp->setPropertyValue( OUString( "HasXAxis" ), uno::makeAny(sal_True) ); } catch( beans::UnknownPropertyException & ) { @@ -472,16 +471,16 @@ void SchXMLAxisContext::CreateAxis() uno::Any aFalseBool( uno::makeAny( sal_False )); // #i109879# the line color is black as default, in the model it is a light gray - m_xAxisProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "LineColor" )), + m_xAxisProps->setPropertyValue( OUString( "LineColor" ), uno::makeAny( COL_BLACK )); - m_xAxisProps->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM( "DisplayLabels" )), aFalseBool ); + m_xAxisProps->setPropertyValue( OUString( "DisplayLabels" ), aFalseBool ); // #88077# AutoOrigin 'on' is default - m_xAxisProps->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM( "AutoOrigin" )), aTrueBool ); + m_xAxisProps->setPropertyValue( OUString( "AutoOrigin" ), aTrueBool ); if( m_bAxisTypeImported ) - m_xAxisProps->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM( "AxisType" )), uno::makeAny(m_nAxisType) ); + m_xAxisProps->setPropertyValue( OUString( "AxisType" ), uno::makeAny(m_nAxisType) ); if( !m_aAutoStyleName.isEmpty()) { @@ -537,7 +536,7 @@ void SchXMLAxisContext::CreateAxis() Reference< beans::XPropertySet > xNewAxisProp( xAxis, uno::UNO_QUERY ); if( xNewAxisProp.is() ) { - xNewAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("LineStyle")) + xNewAxisProp->setPropertyValue( OUString("LineStyle") , uno::makeAny(drawing::LineStyle_NONE)); } } @@ -545,7 +544,7 @@ void SchXMLAxisContext::CreateAxis() if( m_bAdaptXAxisOrientationForOld2DBarCharts && m_aCurrentAxis.eDimension == SCH_XML_AXIS_X ) { bool bIs3DChart = false; - if( xDiaProp.is() && ( xDiaProp->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Dim3D"))) >>= bIs3DChart ) + if( xDiaProp.is() && ( xDiaProp->getPropertyValue(OUString("Dim3D")) >>= bIs3DChart ) && !bIs3DChart ) { Reference< chart2::XChartDocument > xChart2Document( GetImport().GetModel(), uno::UNO_QUERY ); @@ -560,7 +559,7 @@ void SchXMLAxisContext::CreateAxis() bool bSwapXandYAxis = false; Reference< chart2::XCoordinateSystem > xCooSys( aCooSysSeq[0] ); Reference< beans::XPropertySet > xCooSysProp( xCooSys, uno::UNO_QUERY ); - if( xCooSysProp.is() && ( xCooSysProp->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("SwapXAndYAxis"))) >>= bSwapXandYAxis ) + if( xCooSysProp.is() && ( xCooSysProp->getPropertyValue( OUString("SwapXAndYAxis")) >>= bSwapXandYAxis ) && bSwapXandYAxis ) { Reference< chart2::XAxis > xAxis = xCooSys->getAxisByDimension( 0, m_aCurrentAxis.nAxisIndex ); @@ -578,7 +577,7 @@ void SchXMLAxisContext::CreateAxis() } m_rbAxisPositionAttributeImported = m_rbAxisPositionAttributeImported || SchXMLTools::getPropertyFromContext( - OUString(RTL_CONSTASCII_USTRINGPARAM("CrossoverPosition")), pPropStyleContext, pStylesCtxt ).hasValue(); + OUString("CrossoverPosition"), pPropStyleContext, pStylesCtxt ).hasValue(); } } } @@ -599,7 +598,7 @@ void SchXMLAxisContext::SetAxisTitle() { try { - xTitleProp->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "String" )), uno::makeAny(m_aCurrentAxis.aTitle) ); + xTitleProp->setPropertyValue( OUString( "String" ), uno::makeAny(m_aCurrentAxis.aTitle) ); } catch( beans::UnknownPropertyException & ) { @@ -782,31 +781,31 @@ void SchXMLAxisContext::CorrectAxisPositions( const Reference< chart2::XChartDoc chart2::ScaleData aMainXScale = xMainXAxis->getScaleData(); if( 0 == rChartTypeServiceName.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart2.ScatterChartType" ) ) ) { - xMainYAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("CrossoverPosition")) + xMainYAxisProp->setPropertyValue( OUString("CrossoverPosition") , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_VALUE) ); double fCrossoverValue = 0.0; aMainXScale.Origin >>= fCrossoverValue; - xMainYAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("CrossoverValue")) + xMainYAxisProp->setPropertyValue( OUString("CrossoverValue") , uno::makeAny( fCrossoverValue ) ); if( aMainXScale.Orientation == chart2::AxisOrientation_REVERSE ) { - xMainYAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("LabelPosition")) + xMainYAxisProp->setPropertyValue( OUString("LabelPosition") , uno::makeAny( ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_END) ); - xMainYAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("MarkPosition")) + xMainYAxisProp->setPropertyValue( OUString("MarkPosition") , uno::makeAny( ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS) ); if( xSecondaryYAxisProp.is() ) - xSecondaryYAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("CrossoverPosition")) + xSecondaryYAxisProp->setPropertyValue( OUString("CrossoverPosition") , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_START) ); } else { - xMainYAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("LabelPosition")) + xMainYAxisProp->setPropertyValue( OUString("LabelPosition") , uno::makeAny( ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_START) ); - xMainYAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("MarkPosition")) + xMainYAxisProp->setPropertyValue( OUString("MarkPosition") , uno::makeAny( ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS) ); if( xSecondaryYAxisProp.is() ) - xSecondaryYAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("CrossoverPosition")) + xSecondaryYAxisProp->setPropertyValue( OUString("CrossoverPosition") , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_END) ); } } @@ -814,48 +813,48 @@ void SchXMLAxisContext::CorrectAxisPositions( const Reference< chart2::XChartDoc { if( aMainXScale.Orientation == chart2::AxisOrientation_REVERSE ) { - xMainYAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("CrossoverPosition")) + xMainYAxisProp->setPropertyValue( OUString("CrossoverPosition") , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_END) ); if( xSecondaryYAxisProp.is() ) - xSecondaryYAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("CrossoverPosition")) + xSecondaryYAxisProp->setPropertyValue( OUString("CrossoverPosition") , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_START) ); } else { - xMainYAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("CrossoverPosition")) + xMainYAxisProp->setPropertyValue( OUString("CrossoverPosition") , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_START) ); if( xSecondaryYAxisProp.is() ) - xSecondaryYAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("CrossoverPosition")) + xSecondaryYAxisProp->setPropertyValue( OUString("CrossoverPosition") , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_END) ); } } chart2::ScaleData aMainYScale = xMainYAxis->getScaleData(); - xMainXAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("CrossoverPosition")) + xMainXAxisProp->setPropertyValue( OUString("CrossoverPosition") , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_VALUE) ); double fCrossoverValue = 0.0; aMainYScale.Origin >>= fCrossoverValue; - xMainXAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("CrossoverValue")) + xMainXAxisProp->setPropertyValue( OUString("CrossoverValue") , uno::makeAny( fCrossoverValue ) ); if( aMainYScale.Orientation == chart2::AxisOrientation_REVERSE ) { - xMainXAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("LabelPosition")) + xMainXAxisProp->setPropertyValue( OUString("LabelPosition") , uno::makeAny( ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_END) ); - xMainXAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("MarkPosition")) + xMainXAxisProp->setPropertyValue( OUString("MarkPosition") , uno::makeAny( ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS) ); if( xSecondaryXAxisProp.is() ) - xSecondaryXAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("CrossoverPosition")) + xSecondaryXAxisProp->setPropertyValue( OUString("CrossoverPosition") , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_START) ); } else { - xMainXAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("LabelPosition")) + xMainXAxisProp->setPropertyValue( OUString("LabelPosition") , uno::makeAny( ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_START) ); - xMainXAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("MarkPosition")) + xMainXAxisProp->setPropertyValue( OUString("MarkPosition") , uno::makeAny( ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS) ); if( xSecondaryXAxisProp.is() ) - xSecondaryXAxisProp->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("CrossoverPosition")) + xSecondaryXAxisProp->setPropertyValue( OUString("CrossoverPosition") , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_END) ); } } @@ -974,7 +973,7 @@ void DateScaleContext::StartElement( const Reference< xml::sax::XAttributeList > bool bSetNewIncrement=false; chart::TimeIncrement aIncrement; - m_xAxisProps->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM( "TimeIncrement" ))) >>= aIncrement; + m_xAxisProps->getPropertyValue( OUString( "TimeIncrement" )) >>= aIncrement; for( sal_Int16 i = 0; i < nAttrCount; i++ ) { @@ -1031,7 +1030,7 @@ void DateScaleContext::StartElement( const Reference< xml::sax::XAttributeList > } if( bSetNewIncrement ) - m_xAxisProps->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM( "TimeIncrement" )), uno::makeAny( aIncrement ) ); + m_xAxisProps->setPropertyValue( OUString( "TimeIncrement" ), uno::makeAny( aIncrement ) ); } // ======================================== diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index cfb56490d075..8a39d027d57b 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -54,9 +54,6 @@ #include "xmloff/xmlnmspe.hxx" -using ::rtl::OUString; -using ::rtl::OUStringBuffer; - using namespace ::com::sun::star; using namespace ::xmloff::token; @@ -140,17 +137,18 @@ uno::Reference< drawing::XShape > XMLShapeExport::checkForCustomShapeReplacement if( ( GetExport().getExportFlags() & EXPORT_OASIS ) == 0 ) { - String aType( (OUString)xShape->getShapeType() ); - if( aType.EqualsAscii( (const sal_Char*)"com.sun.star.drawing.CustomShape" ) ) + OUString aType( xShape->getShapeType() ); + if( aType.equalsAscii( "com.sun.star.drawing.CustomShape" ) ) { uno::Reference< beans::XPropertySet > xSet( xShape, uno::UNO_QUERY ); if( xSet.is() ) { - rtl::OUString aEngine; + OUString aEngine; xSet->getPropertyValue( OUString( "CustomShapeEngine" ) ) >>= aEngine; if ( aEngine.isEmpty() ) - aEngine = OUString( "com.sun.star.drawing.EnhancedCustomShapeEngine" ); - + { + aEngine = "com.sun.star.drawing.EnhancedCustomShapeEngine"; + } uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); if ( !aEngine.isEmpty() && xFactory.is() ) @@ -1032,43 +1030,43 @@ void XMLShapeExport::ImpCalcShapeType(const uno::Reference< drawing::XShape >& x uno::Reference< drawing::XShapeDescriptor > xShapeDescriptor(xShape, uno::UNO_QUERY); if(xShapeDescriptor.is()) { - String aType((OUString)xShapeDescriptor->getShapeType()); + OUString aType(xShapeDescriptor->getShapeType()); - if(aType.EqualsAscii((const sal_Char*)"com.sun.star.", 0, 13)) + if(aType.match("com.sun.star.")) { - if(aType.EqualsAscii("drawing.", 13, 8)) + if(aType.match("drawing.", 13)) { // drawing shapes - if (aType.EqualsAscii("Rectangle", 21, 9)) { eShapeType = XmlShapeTypeDrawRectangleShape; } + if (aType.match("Rectangle", 21)) { eShapeType = XmlShapeTypeDrawRectangleShape; } // #i72177# Note: Correcting CustomShape, CustomShape->Custom, len from 9 (was wrong anyways) to 6. // As can be seen at the other compares, the appendix "Shape" is left out of the comparison. - else if(aType.EqualsAscii("Custom", 21, 6)) { eShapeType = XmlShapeTypeDrawCustomShape; } + else if(aType.match("Custom", 21)) { eShapeType = XmlShapeTypeDrawCustomShape; } - else if(aType.EqualsAscii("Ellipse", 21, 7)) { eShapeType = XmlShapeTypeDrawEllipseShape; } - else if(aType.EqualsAscii("Control", 21, 7)) { eShapeType = XmlShapeTypeDrawControlShape; } - else if(aType.EqualsAscii("Connector", 21, 9)) { eShapeType = XmlShapeTypeDrawConnectorShape; } - else if(aType.EqualsAscii("Measure", 21, 7)) { eShapeType = XmlShapeTypeDrawMeasureShape; } - else if(aType.EqualsAscii("Line", 21, 4)) { eShapeType = XmlShapeTypeDrawLineShape; } + else if(aType.match("Ellipse", 21)) { eShapeType = XmlShapeTypeDrawEllipseShape; } + else if(aType.match("Control", 21)) { eShapeType = XmlShapeTypeDrawControlShape; } + else if(aType.match("Connector", 21)) { eShapeType = XmlShapeTypeDrawConnectorShape; } + else if(aType.match("Measure", 21)) { eShapeType = XmlShapeTypeDrawMeasureShape; } + else if(aType.match("Line", 21)) { eShapeType = XmlShapeTypeDrawLineShape; } // #i72177# Note: This covers two types by purpose, PolyPolygonShape and PolyPolygonPathShape - else if(aType.EqualsAscii("PolyPolygon", 21, 11)) { eShapeType = XmlShapeTypeDrawPolyPolygonShape; } + else if(aType.match("PolyPolygon", 21)) { eShapeType = XmlShapeTypeDrawPolyPolygonShape; } // #i72177# Note: This covers two types by purpose, PolyLineShape and PolyLinePathShape - else if(aType.EqualsAscii("PolyLine", 21, 8)) { eShapeType = XmlShapeTypeDrawPolyLineShape; } + else if(aType.match("PolyLine", 21)) { eShapeType = XmlShapeTypeDrawPolyLineShape; } - else if(aType.EqualsAscii("OpenBezier", 21, 10)) { eShapeType = XmlShapeTypeDrawOpenBezierShape; } - else if(aType.EqualsAscii("ClosedBezier", 21, 12)) { eShapeType = XmlShapeTypeDrawClosedBezierShape; } + else if(aType.match("OpenBezier", 21)) { eShapeType = XmlShapeTypeDrawOpenBezierShape; } + else if(aType.match("ClosedBezier", 21)) { eShapeType = XmlShapeTypeDrawClosedBezierShape; } // #i72177# FreeHand (opened and closed) now supports the types OpenFreeHandShape and // ClosedFreeHandShape respectively. Represent them as bezier shapes - else if(aType.EqualsAscii("OpenFreeHand", 21, 12)) { eShapeType = XmlShapeTypeDrawOpenBezierShape; } - else if(aType.EqualsAscii("ClosedFreeHand", 21, 14)) { eShapeType = XmlShapeTypeDrawClosedBezierShape; } + else if(aType.match("OpenFreeHand", 21)) { eShapeType = XmlShapeTypeDrawOpenBezierShape; } + else if(aType.match("ClosedFreeHand", 21)) { eShapeType = XmlShapeTypeDrawClosedBezierShape; } - else if(aType.EqualsAscii("GraphicObject", 21, 13)) { eShapeType = XmlShapeTypeDrawGraphicObjectShape; } - else if(aType.EqualsAscii("Group", 21, 5)) { eShapeType = XmlShapeTypeDrawGroupShape; } - else if(aType.EqualsAscii("Text", 21, 4)) { eShapeType = XmlShapeTypeDrawTextShape; } - else if(aType.EqualsAscii("OLE2", 21, 4)) + else if(aType.match("GraphicObject", 21)) { eShapeType = XmlShapeTypeDrawGraphicObjectShape; } + else if(aType.match("Group", 21)) { eShapeType = XmlShapeTypeDrawGroupShape; } + else if(aType.match("Text", 21)) { eShapeType = XmlShapeTypeDrawTextShape; } + else if(aType.match("OLE2", 21)) { eShapeType = XmlShapeTypeDrawOLE2Shape; @@ -1100,30 +1098,30 @@ void XMLShapeExport::ImpCalcShapeType(const uno::Reference< drawing::XShape >& x } } } - else if(aType.EqualsAscii("Page", 21, 4)) { eShapeType = XmlShapeTypeDrawPageShape; } - else if(aType.EqualsAscii("Frame", 21, 5)) { eShapeType = XmlShapeTypeDrawFrameShape; } - else if(aType.EqualsAscii("Caption", 21, 7)) { eShapeType = XmlShapeTypeDrawCaptionShape; } - else if(aType.EqualsAscii("Plugin", 21, 6)) { eShapeType = XmlShapeTypeDrawPluginShape; } - else if(aType.EqualsAscii("Applet", 21, 6)) { eShapeType = XmlShapeTypeDrawAppletShape; } - else if(aType.EqualsAscii("MediaShape", 21, 10)) { eShapeType = XmlShapeTypeDrawMediaShape; } - else if(aType.EqualsAscii("TableShape", 21, 10)) { eShapeType = XmlShapeTypeDrawTableShape; } + else if(aType.match("Page", 21)) { eShapeType = XmlShapeTypeDrawPageShape; } + else if(aType.match("Frame", 21)) { eShapeType = XmlShapeTypeDrawFrameShape; } + else if(aType.match("Caption", 21)) { eShapeType = XmlShapeTypeDrawCaptionShape; } + else if(aType.match("Plugin", 21)) { eShapeType = XmlShapeTypeDrawPluginShape; } + else if(aType.match("Applet", 21)) { eShapeType = XmlShapeTypeDrawAppletShape; } + else if(aType.match("MediaShape", 21)) { eShapeType = XmlShapeTypeDrawMediaShape; } + else if(aType.match("TableShape", 21)) { eShapeType = XmlShapeTypeDrawTableShape; } // 3D shapes - else if(aType.EqualsAscii("Scene", 21 + 7, 5)) { eShapeType = XmlShapeTypeDraw3DSceneObject; } - else if(aType.EqualsAscii("Cube", 21 + 7, 4)) { eShapeType = XmlShapeTypeDraw3DCubeObject; } - else if(aType.EqualsAscii("Sphere", 21 + 7, 6)) { eShapeType = XmlShapeTypeDraw3DSphereObject; } - else if(aType.EqualsAscii("Lathe", 21 + 7, 5)) { eShapeType = XmlShapeTypeDraw3DLatheObject; } - else if(aType.EqualsAscii("Extrude", 21 + 7, 7)) { eShapeType = XmlShapeTypeDraw3DExtrudeObject; } + else if(aType.match("Scene", 21 + 7)) { eShapeType = XmlShapeTypeDraw3DSceneObject; } + else if(aType.match("Cube", 21 + 7)) { eShapeType = XmlShapeTypeDraw3DCubeObject; } + else if(aType.match("Sphere", 21 + 7)) { eShapeType = XmlShapeTypeDraw3DSphereObject; } + else if(aType.match("Lathe", 21 + 7)) { eShapeType = XmlShapeTypeDraw3DLatheObject; } + else if(aType.match("Extrude", 21 + 7)) { eShapeType = XmlShapeTypeDraw3DExtrudeObject; } } - else if(aType.EqualsAscii("presentation.", 13, 13)) + else if(aType.match("presentation.", 13)) { // presentation shapes - if (aType.EqualsAscii("TitleText", 26, 9)) { eShapeType = XmlShapeTypePresTitleTextShape; } - else if(aType.EqualsAscii("Outliner", 26, 8)) { eShapeType = XmlShapeTypePresOutlinerShape; } - else if(aType.EqualsAscii("Subtitle", 26, 8)) { eShapeType = XmlShapeTypePresSubtitleShape; } - else if(aType.EqualsAscii("GraphicObject", 26, 13)) { eShapeType = XmlShapeTypePresGraphicObjectShape; } - else if(aType.EqualsAscii("Page", 26, 4)) { eShapeType = XmlShapeTypePresPageShape; } - else if(aType.EqualsAscii("OLE2", 26, 4)) + if (aType.match("TitleText", 26)) { eShapeType = XmlShapeTypePresTitleTextShape; } + else if(aType.match("Outliner", 26)) { eShapeType = XmlShapeTypePresOutlinerShape; } + else if(aType.match("Subtitle", 26)) { eShapeType = XmlShapeTypePresSubtitleShape; } + else if(aType.match("GraphicObject", 26)) { eShapeType = XmlShapeTypePresGraphicObjectShape; } + else if(aType.match("Page", 26)) { eShapeType = XmlShapeTypePresPageShape; } + else if(aType.match("OLE2", 26)) { eShapeType = XmlShapeTypePresOLE2Shape; @@ -1135,8 +1133,8 @@ void XMLShapeExport::ImpCalcShapeType(const uno::Reference< drawing::XShape >& x rtl::OUString sCLSID; if(xPropSet->getPropertyValue(OUString("CLSID")) >>= sCLSID) { - if( sCLSID.equals(rtl::OUString( SvGlobalName( SO3_SC_CLASSID ).GetHexName())) || - sCLSID.equals(rtl::OUString( SvGlobalName( BF_SO3_SC_CLASSID ).GetHexName())) ) + if( sCLSID.equals(OUString( SvGlobalName( SO3_SC_CLASSID ).GetHexName())) || + sCLSID.equals(OUString( SvGlobalName( BF_SO3_SC_CLASSID ).GetHexName())) ) { eShapeType = XmlShapeTypePresSheetShape; } @@ -1147,17 +1145,17 @@ void XMLShapeExport::ImpCalcShapeType(const uno::Reference< drawing::XShape >& x OSL_FAIL( "XMLShapeExport::ImpCalcShapeType(), expected ole shape to have the CLSID property?" ); } } - else if(aType.EqualsAscii("Chart", 26, 5)) { eShapeType = XmlShapeTypePresChartShape; } - else if(aType.EqualsAscii("OrgChart", 26, 8)) { eShapeType = XmlShapeTypePresOrgChartShape; } - else if(aType.EqualsAscii("CalcShape", 26, 9)) { eShapeType = XmlShapeTypePresSheetShape; } - else if(aType.EqualsAscii("TableShape", 26, 10)) { eShapeType = XmlShapeTypePresTableShape; } - else if(aType.EqualsAscii("Notes", 26, 5)) { eShapeType = XmlShapeTypePresNotesShape; } - else if(aType.EqualsAscii("HandoutShape", 26, 12)) { eShapeType = XmlShapeTypeHandoutShape; } - else if(aType.EqualsAscii("HeaderShape", 26, 11)) { eShapeType = XmlShapeTypePresHeaderShape; } - else if(aType.EqualsAscii("FooterShape", 26, 11)) { eShapeType = XmlShapeTypePresFooterShape; } - else if(aType.EqualsAscii("SlideNumberShape", 26, 16)) { eShapeType = XmlShapeTypePresSlideNumberShape; } - else if(aType.EqualsAscii("DateTimeShape", 26, 13)) { eShapeType = XmlShapeTypePresDateTimeShape; } - else if(aType.EqualsAscii("MediaShape", 26, 10)) { eShapeType = XmlShapeTypePresMediaShape; } + else if(aType.match("Chart", 26)) { eShapeType = XmlShapeTypePresChartShape; } + else if(aType.match("OrgChart", 26)) { eShapeType = XmlShapeTypePresOrgChartShape; } + else if(aType.match("CalcShape", 26)) { eShapeType = XmlShapeTypePresSheetShape; } + else if(aType.match("TableShape", 26)) { eShapeType = XmlShapeTypePresTableShape; } + else if(aType.match("Notes", 26)) { eShapeType = XmlShapeTypePresNotesShape; } + else if(aType.match("HandoutShape", 26)) { eShapeType = XmlShapeTypeHandoutShape; } + else if(aType.match("HeaderShape", 26)) { eShapeType = XmlShapeTypePresHeaderShape; } + else if(aType.match("FooterShape", 26)) { eShapeType = XmlShapeTypePresFooterShape; } + else if(aType.match("SlideNumberShape", 26)) { eShapeType = XmlShapeTypePresSlideNumberShape; } + else if(aType.match("DateTimeShape", 26)) { eShapeType = XmlShapeTypePresDateTimeShape; } + else if(aType.match("MediaShape", 26)) { eShapeType = XmlShapeTypePresMediaShape; } } } } diff --git a/xmloff/source/draw/shapeexport4.cxx b/xmloff/source/draw/shapeexport4.cxx index 6c84f5147427..d47b6bbd1a86 100644 --- a/xmloff/source/draw/shapeexport4.cxx +++ b/xmloff/source/draw/shapeexport4.cxx @@ -63,9 +63,6 @@ #include "XMLBase64Export.hxx" #include <comphelper/processfactory.hxx> -using ::rtl::OUString; -using ::rtl::OUStringBuffer; - using namespace ::com::sun::star; using namespace ::com::sun::star::io; using namespace ::xmloff::token; @@ -79,7 +76,7 @@ using ::com::sun::star::uno::Sequence; ////////////////////////////////////////////////////////////////////////////// -void ExportParameter( rtl::OUStringBuffer& rStrBuffer, const com::sun::star::drawing::EnhancedCustomShapeParameter& rParameter ) +void ExportParameter( OUStringBuffer& rStrBuffer, const com::sun::star::drawing::EnhancedCustomShapeParameter& rParameter ) { if ( rStrBuffer.getLength() ) rStrBuffer.append( (sal_Unicode)' ' ); @@ -100,14 +97,14 @@ void ExportParameter( rtl::OUStringBuffer& rStrBuffer, const com::sun::star::dra { rStrBuffer.append( (sal_Unicode)'?' ); rStrBuffer.append( (sal_Unicode)'f' ); - rStrBuffer.append( rtl::OUString::valueOf( nValue ) ); + rStrBuffer.append( OUString::valueOf( nValue ) ); } break; case com::sun::star::drawing::EnhancedCustomShapeParameterType::ADJUSTMENT : { rStrBuffer.append( (sal_Unicode)'$' ); - rStrBuffer.append( rtl::OUString::valueOf( nValue ) ); + rStrBuffer.append( OUString::valueOf( nValue ) ); } break; @@ -136,18 +133,18 @@ void ExportParameter( rtl::OUStringBuffer& rStrBuffer, const com::sun::star::dra case com::sun::star::drawing::EnhancedCustomShapeParameterType::LOGHEIGHT : rStrBuffer.append( GetXMLToken( XML_LOGHEIGHT ) ); break; default : - rStrBuffer.append( rtl::OUString::valueOf( nValue ) ); + rStrBuffer.append( OUString::valueOf( nValue ) ); } } } -void ImpExportEquations( SvXMLExport& rExport, const uno::Sequence< rtl::OUString >& rEquations ) +void ImpExportEquations( SvXMLExport& rExport, const uno::Sequence< OUString >& rEquations ) { sal_Int32 i; for ( i = 0; i < rEquations.getLength(); i++ ) { - rtl::OUString aStr(static_cast<sal_Unicode>('f')); - aStr += rtl::OUString::valueOf( i ); + OUString aStr(static_cast<sal_Unicode>('f')); + aStr += OUString::valueOf( i ); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME, aStr ); aStr = rEquations[ i ]; @@ -157,8 +154,8 @@ void ImpExportEquations( SvXMLExport& rExport, const uno::Sequence< rtl::OUStrin nIndex = aStr.indexOf( (sal_Unicode)'?', nIndex ); if ( nIndex != -1 ) { - rtl::OUString aNew( aStr.copy( 0, nIndex + 1 ) ); - aNew += rtl::OUString(static_cast<sal_Unicode>('f')); + OUString aNew( aStr.copy( 0, nIndex + 1 ) ); + aNew += OUString(static_cast<sal_Unicode>('f')); aNew += aStr.copy( nIndex + 1, ( aStr.getLength() - nIndex ) - 1 ); aStr = aNew; nIndex++; @@ -174,8 +171,8 @@ void ImpExportHandles( SvXMLExport& rExport, const uno::Sequence< beans::Propert sal_uInt32 i, j, nElements = rHandles.getLength(); if ( nElements ) { - rtl::OUString aStr; - rtl::OUStringBuffer aStrBuffer; + OUString aStr; + OUStringBuffer aStrBuffer; for ( i = 0; i < nElements; i++ ) { @@ -319,8 +316,8 @@ void ImpExportEnhancedPath( SvXMLExport& rExport, bool bExtended = false ) { - rtl::OUString aStr; - rtl::OUStringBuffer aStrBuffer; + OUString aStr; + OUStringBuffer aStrBuffer; bool bNeedExtended = false; sal_Int32 i, j, k, l; @@ -452,7 +449,7 @@ void ImpExportEnhancedPath( SvXMLExport& rExport, void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< beans::XPropertySet >& xPropSet ) { sal_Bool bEquations = sal_False; - uno::Sequence< rtl::OUString > aEquations; + uno::Sequence< OUString > aEquations; sal_Bool bHandles = sal_False; uno::Sequence< beans::PropertyValues > aHandles; @@ -463,14 +460,14 @@ void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< bean uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue > aAdjustmentValues; - rtl::OUString aStr; - rtl::OUStringBuffer aStrBuffer; + OUString aStr; + OUStringBuffer aStrBuffer; SvXMLUnitConverter& rUnitConverter = rExport.GetMM100UnitConverter(); uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() ); // geometry - const rtl::OUString sCustomShapeGeometry( RTL_CONSTASCII_USTRINGPARAM( "CustomShapeGeometry" ) ); + const OUString sCustomShapeGeometry( "CustomShapeGeometry" ); if ( xPropSetInfo.is() && xPropSetInfo->hasPropertyByName( sCustomShapeGeometry ) ) { uno::Any aGeoPropSet( xPropSet->getPropertyValue( sCustomShapeGeometry ) ); @@ -478,8 +475,8 @@ void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< bean if ( aGeoPropSet >>= aGeoPropSeq ) { - const rtl::OUString sCustomShapeType( RTL_CONSTASCII_USTRINGPARAM( "NonPrimitive" ) ); - rtl::OUString aCustomShapeType( sCustomShapeType ); + const OUString sCustomShapeType( "NonPrimitive" ); + OUString aCustomShapeType( sCustomShapeType ); sal_Int32 j, nGeoPropCount = aGeoPropSeq.getLength(); for ( j = 0; j < nGeoPropCount; j++ ) @@ -603,7 +600,7 @@ void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< bean { sal_Int32 nExtrusionNumberOfLineSegments = 0; if ( rProp.Value >>= nExtrusionNumberOfLineSegments ) - rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_EXTRUSION_NUMBER_OF_LINE_SEGMENTS, rtl::OUString::valueOf( nExtrusionNumberOfLineSegments ) ); + rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_EXTRUSION_NUMBER_OF_LINE_SEGMENTS, OUString::valueOf( nExtrusionNumberOfLineSegments ) ); } break; case EAS_LightFace : @@ -986,14 +983,14 @@ void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< bean { sal_Int32 nStretchPoint = 0; if ( rProp.Value >>= nStretchPoint ) - rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_PATH_STRETCHPOINT_X, rtl::OUString::valueOf( nStretchPoint ) ); + rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_PATH_STRETCHPOINT_X, OUString::valueOf( nStretchPoint ) ); } break; case EAS_StretchY : { sal_Int32 nStretchPoint = 0; if ( rProp.Value >>= nStretchPoint ) - rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_PATH_STRETCHPOINT_Y, rtl::OUString::valueOf( nStretchPoint ) ); + rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_PATH_STRETCHPOINT_Y, OUString::valueOf( nStretchPoint ) ); } break; case EAS_TextFrames : @@ -1097,7 +1094,7 @@ void XMLShapeExport::ImpExportCustomShape( const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY); if ( xPropSet.is() ) { - rtl::OUString aStr; + OUString aStr; uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() ); // Transformation @@ -1105,14 +1102,14 @@ void XMLShapeExport::ImpExportCustomShape( if ( xPropSetInfo.is() ) { - const rtl::OUString sCustomShapeEngine( RTL_CONSTASCII_USTRINGPARAM( "CustomShapeEngine" ) ); + const OUString sCustomShapeEngine( "CustomShapeEngine" ); if ( xPropSetInfo->hasPropertyByName( sCustomShapeEngine ) ) { uno::Any aEngine( xPropSet->getPropertyValue( sCustomShapeEngine ) ); if ( ( aEngine >>= aStr ) && !aStr.isEmpty() ) mrExport.AddAttribute( XML_NAMESPACE_DRAW, XML_ENGINE, aStr ); } - const rtl::OUString sCustomShapeData( RTL_CONSTASCII_USTRINGPARAM( "CustomShapeData" ) ); + const OUString sCustomShapeData( "CustomShapeData" ); if ( xPropSetInfo->hasPropertyByName( sCustomShapeData ) ) { uno::Any aData( xPropSet->getPropertyValue( sCustomShapeData ) ); @@ -1157,7 +1154,7 @@ void XMLShapeExport::ImpExportTableShape( const uno::Reference< drawing::XShape { if( !bIsEmptyPresObj ) { - uno::Reference< container::XNamed > xTemplate( xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "TableTemplate" ) ) ), uno::UNO_QUERY ); + uno::Reference< container::XNamed > xTemplate( xPropSet->getPropertyValue( OUString( "TableTemplate" ) ), uno::UNO_QUERY ); if( xTemplate.is() ) { const OUString sTemplate( xTemplate->getName() ); @@ -1192,7 +1189,7 @@ void XMLShapeExport::ImpExportTableShape( const uno::Reference< drawing::XShape if( !bIsEmptyPresObj ) { - uno::Reference< graphic::XGraphic > xGraphic( xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "ReplacementGraphic" ) ) ), uno::UNO_QUERY ); + uno::Reference< graphic::XGraphic > xGraphic( xPropSet->getPropertyValue( OUString( "ReplacementGraphic" ) ), uno::UNO_QUERY ); if( xGraphic.is() ) try { Reference< lang::XMultiServiceFactory > xSM( GetExport().getServiceFactory(), UNO_QUERY_THROW ); @@ -1204,15 +1201,15 @@ void XMLShapeExport::ImpExportTableShape( const uno::Reference< drawing::XShape OUString sPictureName; if( bExportEmbedded ) { - xPictureStream.set( xSM->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.MemoryStream" ) ) ), UNO_QUERY_THROW ); + xPictureStream.set( xSM->createInstance( OUString( "com.sun.star.comp.MemoryStream" ) ), UNO_QUERY_THROW ); } else { xStorage.set( GetExport().GetTargetStorage(), UNO_QUERY_THROW ); - xPictureStorage.set( xStorage->openStorageElement( OUString( RTL_CONSTASCII_USTRINGPARAM( "Pictures" ) ), ::embed::ElementModes::READWRITE ), uno::UNO_QUERY_THROW ); - const OUString sPrefix( RTL_CONSTASCII_USTRINGPARAM("TablePreview") ); - const OUString sSuffix( RTL_CONSTASCII_USTRINGPARAM(".svm") ); + xPictureStorage.set( xStorage->openStorageElement( OUString( "Pictures" ), ::embed::ElementModes::READWRITE ), uno::UNO_QUERY_THROW ); + const OUString sPrefix( "TablePreview" ); + const OUString sSuffix( ".svm" ); sal_Int32 nIndex = 0; do @@ -1228,9 +1225,9 @@ void XMLShapeExport::ImpExportTableShape( const uno::Reference< drawing::XShape Reference< graphic::XGraphicProvider > xProvider( graphic::GraphicProvider::create(comphelper::getComponentContext(xSM)) ); Sequence< beans::PropertyValue > aArgs( 2 ); - aArgs[ 0 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "MimeType" ) ); - aArgs[ 0 ].Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM( "image/x-vclgraphic" ) ); - aArgs[ 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "OutputStream" ) ); + aArgs[ 0 ].Name = OUString( "MimeType" ); + aArgs[ 0 ].Value <<= OUString( "image/x-vclgraphic" ); + aArgs[ 1 ].Name = OUString( "OutputStream" ); aArgs[ 1 ].Value <<= xPictureStream->getOutputStream(); xProvider->storeGraphic( xGraphic, aArgs ); @@ -1243,7 +1240,7 @@ void XMLShapeExport::ImpExportTableShape( const uno::Reference< drawing::XShape if( !bExportEmbedded ) { - OUString sURL( RTL_CONSTASCII_USTRINGPARAM( "Pictures/" ) ); + OUString sURL( "Pictures/" ); sURL += sPictureName; mrExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, sURL ); mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE ); diff --git a/xmloff/source/style/styleexp.cxx b/xmloff/source/style/styleexp.cxx index ef20a9796a7d..2970392078fa 100644 --- a/xmloff/source/style/styleexp.cxx +++ b/xmloff/source/style/styleexp.cxx @@ -18,7 +18,6 @@ */ #include <tools/debug.hxx> -#include <tools/string.hxx> #include <xmloff/nmspmap.hxx> #include "xmloff/xmlnmspe.hxx" #include <xmloff/xmltoken.hxx> @@ -42,9 +41,6 @@ #include <set> #include <boost/scoped_ptr.hpp> -using ::rtl::OUString; -using ::rtl::OUStringBuffer; - using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::style; @@ -57,7 +53,7 @@ using ::com::sun::star::document::XEventsSupplier; XMLStyleExport::XMLStyleExport( SvXMLExport& rExp, - const ::rtl::OUString& rPoolStyleName, + const OUString& rPoolStyleName, SvXMLAutoStylePoolP *pAutoStyleP ) : rExport( rExp ), sIsPhysical( RTL_CONSTASCII_USTRINGPARAM( "IsPhysical" ) ), @@ -84,7 +80,7 @@ void XMLStyleExport::exportStyleContent( const Reference< XStyle >& ) sal_Bool XMLStyleExport::exportStyle( const Reference< XStyle >& rStyle, - const OUString& rXMLFamily, + const OUString& rXMLFamily, const UniReference < SvXMLExportPropertyMapper >& rPropMapper, const Reference< XNameAccess >& xStyles, const OUString* pPrefix ) @@ -396,12 +392,12 @@ void XMLStyleExport::exportStyleFamily( // If next styles are supported and used styles should be exported only, // the next style may be unused but has to be exported, too. In this case // the names of all exported styles are remembered. - boost::scoped_ptr<std::set<String> > pExportedStyles(0); + boost::scoped_ptr<std::set<OUString> > pExportedStyles(0); sal_Bool bFirstStyle = sal_True; - const uno::Sequence< ::rtl::OUString> aSeq = xStyles->getElementNames(); - const ::rtl::OUString* pIter = aSeq.getConstArray(); - const ::rtl::OUString* pEnd = pIter + aSeq.getLength(); + const uno::Sequence< OUString> aSeq = xStyles->getElementNames(); + const OUString* pIter = aSeq.getConstArray(); + const OUString* pEnd = pIter + aSeq.getLength(); for(;pIter != pEnd;++pIter) { Reference< XStyle > xStyle; @@ -434,7 +430,7 @@ void XMLStyleExport::exportStyleFamily( xPropSet->getPropertySetInfo(); if( xPropSetInfo->hasPropertyByName( sFollowStyle ) ) - pExportedStyles.reset(new std::set<String>()); + pExportedStyles.reset(new std::set<OUString>()); bFirstStyle = sal_False; } @@ -487,7 +483,7 @@ void XMLStyleExport::exportStyleFamily( OUString sNextName; xPropSet->getPropertyValue( sFollowStyle ) >>= sNextName; - String sTmp( sNextName ); + OUString sTmp( sNextName ); // if the next style hasn't been exported by now, export it now // and remember its name. if( xStyle->getName() != sNextName && diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx index 0eb79339ca6e..694d939386c5 100644 --- a/xmloff/source/style/xmlnumfe.cxx +++ b/xmloff/source/style/xmlnumfe.cxx @@ -1795,7 +1795,7 @@ sal_uInt32 SvXMLNumFmtExport::ForceSystemLanguage( sal_uInt32 nKey ) { DBG_ASSERT( pFormatter != NULL, "format without formatter?" ); - xub_StrLen nErrorPos; + sal_Int32 nErrorPos; short nType = pFormat->GetType(); sal_uInt32 nNewKey = pFormatter->GetFormatForLanguageIfBuiltIn( @@ -1807,7 +1807,7 @@ sal_uInt32 SvXMLNumFmtExport::ForceSystemLanguage( sal_uInt32 nKey ) } else { - String aFormatString( pFormat->GetFormatstring() ); + OUString aFormatString( pFormat->GetFormatstring() ); pFormatter->PutandConvertEntry( aFormatString, nErrorPos, nType, nNewKey, diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx index b9a105d6a5dc..d53e004701dd 100644 --- a/xmloff/source/style/xmlnumfi.cxx +++ b/xmloff/source/style/xmlnumfi.cxx @@ -868,13 +868,12 @@ static void lcl_EnquoteIfNecessary( rtl::OUStringBuffer& rContent, const SvXMLNu if ( bQuote ) { // #i55469# quotes in the string itself have to be escaped - rtl::OUString aString( rContent.getStr() ); - bool bEscape = ( aString.indexOf( (sal_Unicode) '"' ) >= 0 ); + bool bEscape = ( rContent.indexOf( (sal_Unicode) '"' ) >= 0 ); if ( bEscape ) { // A quote is turned into "\"" - a quote to end quoted text, an escaped quote, // and a quote to resume quoting. - rtl::OUString aInsert( "\"\\\"" ); + OUString aInsert( "\"\\\"" ); sal_Int32 nPos = 0; while ( nPos < rContent.getLength() ) @@ -899,8 +898,7 @@ static void lcl_EnquoteIfNecessary( rtl::OUStringBuffer& rContent, const SvXMLNu rContent[0] == (sal_Unicode) '"' && rContent[1] == (sal_Unicode) '"' ) { - String aTrimmed( rContent.makeStringAndClear().copy(2) ); - rContent = rtl::OUStringBuffer( aTrimmed ); + rContent.remove(0, 2); } sal_Int32 nLen = rContent.getLength(); @@ -908,8 +906,7 @@ static void lcl_EnquoteIfNecessary( rtl::OUStringBuffer& rContent, const SvXMLNu rContent[nLen - 1] == (sal_Unicode) '"' && rContent[nLen - 2] == (sal_Unicode) '"' ) { - String aTrimmed( rContent.makeStringAndClear().copy( 0, nLen - 2 ) ); - rContent = rtl::OUStringBuffer( aTrimmed ); + rContent.remove(nLen - 2); } } } @@ -1632,14 +1629,14 @@ sal_Int32 SvXMLNumFormatContext::CreateAndInsert(SvNumberFormatter* pFormatter) { // insert by format string - String aFormatStr( sFormat ); + OUString aFormatStr( sFormat ); nIndex = pFormatter->GetEntryKey( aFormatStr, nFormatLang ); if ( nIndex == NUMBERFORMAT_ENTRY_NOT_FOUND ) { - xub_StrLen nErrPos = 0; + sal_Int32 nErrPos = 0; short l_nType = 0; sal_Bool bOk = pFormatter->PutEntry( aFormatStr, nErrPos, l_nType, nIndex, nFormatLang ); - if ( !bOk && nErrPos == 0 && aFormatStr != String(sFormat) ) + if ( !bOk && nErrPos == 0 && aFormatStr != sFormat ) { // if the string was modified by PutEntry, look for an existing format // with the modified string @@ -1682,8 +1679,7 @@ sal_Int32 SvXMLNumFormatContext::CreateAndInsert(SvNumberFormatter* pFormatter) SvNumberformat* pFormat = const_cast<SvNumberformat*>(pFormatter->GetEntry( nIndex )); if (pFormat) { - String sTitle (sFormatTitle); - pFormat->SetComment(sTitle); + pFormat->SetComment(sFormatTitle); } } @@ -1780,15 +1776,15 @@ void SvXMLNumFormatContext::AddNumber( const SvXMLNumberInfo& rInfo ) bGrouping = sal_False; // grouping and embedded characters can't be used together sal_uInt32 nStdIndex = pFormatter->GetStandardIndex( nFormatLang ); - String aNumStr = pFormatter->GenerateFormat( nStdIndex, nFormatLang, - bGrouping, sal_False, nGenPrec, nLeading ); + OUStringBuffer aNumStr = pFormatter->GenerateFormat( nStdIndex, nFormatLang, + bGrouping, sal_False, nGenPrec, nLeading ); if ( rInfo.nExpDigits >= 0 && nLeading == 0 && !bGrouping && nEmbeddedCount == 0 ) { // #i43959# For scientific numbers, "#" in the integer part forces a digit, // so it has to be removed if nLeading is 0 (".00E+0", not "#.00E+0"). - aNumStr = comphelper::string::stripStart(aNumStr, '#'); + aNumStr.stripStart((sal_Unicode)'#'); } if ( nEmbeddedCount ) @@ -1797,9 +1793,11 @@ void SvXMLNumFormatContext::AddNumber( const SvXMLNumberInfo& rInfo ) // only the integer part is supported // nZeroPos is the string position where format position 0 is inserted - xub_StrLen nZeroPos = aNumStr.Search( pData->GetLocaleData( nFormatLang ).getNumDecimalSep() ); - if ( nZeroPos == STRING_NOTFOUND ) - nZeroPos = aNumStr.Len(); + sal_Int32 nZeroPos = aNumStr.indexOf( pData->GetLocaleData( nFormatLang ).getNumDecimalSep() ); + if ( nZeroPos < 0 ) + { + nZeroPos = aNumStr.getLength(); + } // aEmbeddedElements is sorted - last entry has the largest position (leftmost) const SvXMLEmbeddedElement* pLastObj = &*rInfo.aEmbeddedElements.rbegin(); @@ -1809,10 +1807,11 @@ void SvXMLNumFormatContext::AddNumber( const SvXMLNumberInfo& rInfo ) // add '#' characters so all embedded texts are really embedded in digits // (there always has to be a digit before the leftmost embedded text) - xub_StrLen nAddCount = (xub_StrLen)nLastFormatPos + 1 - nZeroPos; - OUStringBuffer aDigitStr; - comphelper::string::padToLength(aDigitStr, nAddCount, (sal_Unicode)'#'); - aNumStr.Insert(aDigitStr.makeStringAndClear(), 0); + sal_Int32 nAddCount = nLastFormatPos + 1 - nZeroPos; + for(sal_Int32 index = 0; index < nAddCount; ++index) + { + aNumStr.insert(0, (sal_Unicode)'#'); + } nZeroPos = nZeroPos + nAddCount; } @@ -1825,18 +1824,17 @@ void SvXMLNumFormatContext::AddNumber( const SvXMLNumberInfo& rInfo ) sal_Int32 nInsertPos = nZeroPos - nFormatPos; if ( nFormatPos >= 0 && nInsertPos >= 0 ) { - rtl::OUStringBuffer aContent( pObj->aText ); // #107805# always quote embedded strings - even space would otherwise // be recognized as thousands separator in French. - aContent.insert( 0, (sal_Unicode) '"' ); - aContent.append( (sal_Unicode) '"' ); - aNumStr.Insert( String( aContent.makeStringAndClear() ), (xub_StrLen)nInsertPos ); + aNumStr.insert(nInsertPos, '"'); + aNumStr.insert(nInsertPos, pObj->aText); + aNumStr.insert(nInsertPos, '"'); } } } - aFormatCode.append( aNumStr ); + aFormatCode.append( aNumStr.makeStringAndClear() ); if ( ( rInfo.bDecReplace || rInfo.bVarDecimals ) && nPrec ) // add decimal replacement (dashes) { @@ -1948,7 +1946,7 @@ void SvXMLNumFormatContext::AddNfKeyword( sal_uInt16 nIndex ) bHasLongDoW = sal_True; // to remove string constant with separator } - String sKeyword = pFormatter->GetKeyword( nFormatLang, nIndex ); + OUString sKeyword = pFormatter->GetKeyword( nFormatLang, nIndex ); if ( nIndex == NF_KEY_H || nIndex == NF_KEY_HH || nIndex == NF_KEY_MI || nIndex == NF_KEY_MMI || @@ -1957,15 +1955,20 @@ void SvXMLNumFormatContext::AddNfKeyword( sal_uInt16 nIndex ) if ( !bTruncate && !bHasDateTime ) { // with truncate-on-overflow = false, add "[]" to first time part - - sKeyword.Insert( (sal_Unicode) '[', 0 ); - sKeyword.Append( (sal_Unicode) ']' ); + aFormatCode.append( (sal_Unicode)'[' ); + aFormatCode.append( sKeyword ); + aFormatCode.append( (sal_Unicode)']' ); + } + else + { + aFormatCode.append( sKeyword ); } bHasDateTime = sal_True; } - - aFormatCode.append( sKeyword ); - + else + { + aFormatCode.append( sKeyword ); + } // collect the date elements that the format contains, to recognize default date formats switch ( nIndex ) { @@ -1993,17 +1996,17 @@ void SvXMLNumFormatContext::AddNfKeyword( sal_uInt16 nIndex ) } } -static sal_Bool lcl_IsAtEnd( rtl::OUStringBuffer& rBuffer, const String& rToken ) +static sal_Bool lcl_IsAtEnd( rtl::OUStringBuffer& rBuffer, const OUString& rToken ) { sal_Int32 nBufLen = rBuffer.getLength(); - xub_StrLen nTokLen = rToken.Len(); + sal_Int32 nTokLen = rToken.getLength(); if ( nTokLen > nBufLen ) return sal_False; sal_Int32 nStartPos = nBufLen - nTokLen; - for ( xub_StrLen nTokPos = 0; nTokPos < nTokLen; nTokPos++ ) - if ( rToken.GetChar( nTokPos ) != rBuffer[nStartPos + nTokPos] ) + for ( sal_Int32 nTokPos = 0; nTokPos < nTokLen; nTokPos++ ) + if ( rToken[ nTokPos ] != rBuffer[nStartPos + nTokPos] ) return sal_False; return sal_True; @@ -2017,14 +2020,14 @@ sal_Bool SvXMLNumFormatContext::ReplaceNfKeyword( sal_uInt16 nOld, sal_uInt16 nN if (!pFormatter) return sal_False; - String sOldStr = pFormatter->GetKeyword( nFormatLang, nOld ); + OUString sOldStr = pFormatter->GetKeyword( nFormatLang, nOld ); if ( lcl_IsAtEnd( aFormatCode, sOldStr ) ) { // remove old keyword - aFormatCode.setLength( aFormatCode.getLength() - sOldStr.Len() ); + aFormatCode.setLength( aFormatCode.getLength() - sOldStr.getLength() ); // add new keyword - String sNewStr = pFormatter->GetKeyword( nFormatLang, nNew ); + OUString sNewStr = pFormatter->GetKeyword( nFormatLang, nNew ); aFormatCode.append( sNewStr ); return sal_True; // changed @@ -2034,8 +2037,8 @@ sal_Bool SvXMLNumFormatContext::ReplaceNfKeyword( sal_uInt16 nOld, sal_uInt16 nN void SvXMLNumFormatContext::AddCondition( const sal_Int32 nIndex ) { - rtl::OUString rApplyName = aMyConditions[nIndex].sMapName; - rtl::OUString rCondition = aMyConditions[nIndex].sCondition; + OUString rApplyName = aMyConditions[nIndex].sMapName; + OUString rCondition = aMyConditions[nIndex].sCondition; SvNumberFormatter* pFormatter = pData->GetNumberFormatter(); sal_uInt32 l_nKey = pData->GetKeyForName( rApplyName ); OUString sValue("value()"); //! define constant @@ -2067,10 +2070,13 @@ void SvXMLNumFormatContext::AddCondition( const sal_Int32 nIndex ) { sal_Int32 nPos = sRealCond.indexOf( '.' ); if ( nPos >= 0 ) - { // #i8026# #103991# localize decimal separator - const String& rDecSep = GetLocaleData().getNumDecimalSep(); - if ( rDecSep.Len() > 1 || rDecSep.GetChar(0) != '.' ) + { + // #i8026# #103991# localize decimal separator + const OUString& rDecSep = GetLocaleData().getNumDecimalSep(); + if ( rDecSep.getLength() > 1 || rDecSep[0] != '.' ) + { sRealCond = sRealCond.replaceAt( nPos, 1, rDecSep ); + } } aConditions.append( (sal_Unicode) '[' ); aConditions.append( sRealCond ); diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx index 8f93f909e2df..9d0dec5ffc91 100644 --- a/xmloff/source/style/xmlnumi.cxx +++ b/xmloff/source/style/xmlnumi.cxx @@ -34,7 +34,6 @@ #include <tools/debug.hxx> #include <tools/fontenum.hxx> -#include <tools/string.hxx> #include <sax/tools/converter.hxx> @@ -55,9 +54,6 @@ #include <xmloff/xmlnumi.hxx> -using ::rtl::OUString; -using ::rtl::OUStringBuffer; - using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::style; @@ -69,9 +65,6 @@ using namespace ::com::sun::star::frame; using namespace ::xmloff::token; using namespace ::com::sun::star::io; -using rtl::OUString; -using rtl::OUStringBuffer; - static sal_Char const XML_UNO_NAME_NRULE_SYMBOL_TEXT_DISTANCE[] = "SymbolTextDistance"; static sal_Char const XML_UNO_NAME_NRULE_PARENT_NUMBERING[] = @@ -491,7 +484,7 @@ Sequence<beans::PropertyValue> SvxXMLListLevelStyleContext_Impl::GetProperties( || ((300 == nUPD) && (nBuildId <= 9573)))) { // #i93908# OOo < 3.4 wrote a bogus suffix for bullet chars - sSuffix = ::rtl::OUString(); // clear it + sSuffix = OUString(); // clear it } } diff --git a/xmloff/source/style/xmlstyle.cxx b/xmloff/source/style/xmlstyle.cxx index 5817e4ccce53..fe28e57d7bfe 100644 --- a/xmloff/source/style/xmlstyle.cxx +++ b/xmloff/source/style/xmlstyle.cxx @@ -56,8 +56,6 @@ #include <set> #include <vector> -using ::rtl::OUString; -using ::rtl::OUStringBuffer; using ::std::vector; using namespace ::com::sun::star; @@ -101,7 +99,7 @@ const SvXMLTokenMap& SvXMLStylesContext::GetStyleStylesElemTokenMap() void SvXMLStyleContext::SetAttribute( sal_uInt16 nPrefixKey, const OUString& rLocalName, - const OUString& rValue ) + const OUString& rValue ) { // TODO: use a map here if( XML_NAMESPACE_STYLE == nPrefixKey ) @@ -164,8 +162,8 @@ SvXMLStyleContext::~SvXMLStyleContext() } SvXMLImportContext *SvXMLStyleContext::CreateChildContext( sal_uInt16 nPrefix, - const OUString& rLocalName, - const uno::Reference< xml::sax::XAttributeList > & ) + const OUString& rLocalName, + const uno::Reference< xml::sax::XAttributeList > & ) { return new SvXMLImportContext( GetImport(), nPrefix, rLocalName ); } @@ -290,7 +288,8 @@ public: void Clear(); const SvXMLStyleContext *FindStyleChildContext( sal_uInt16 nFamily, - const OUString& rName, sal_Bool bCreateIndex ) const; + const OUString& rName, + sal_Bool bCreateIndex ) const; sal_Bool IsAutomaticStyle() const { return bAutomaticStyle; } }; @@ -334,10 +333,9 @@ void SvXMLStylesContext_Impl::Clear() aStyles.clear(); } -const SvXMLStyleContext *SvXMLStylesContext_Impl::FindStyleChildContext( - sal_uInt16 nFamily, - const OUString& rName, - sal_Bool bCreateIndex ) const +const SvXMLStyleContext *SvXMLStylesContext_Impl::FindStyleChildContext( sal_uInt16 nFamily, + const OUString& rName, + sal_Bool bCreateIndex ) const { const SvXMLStyleContext *pStyle = 0; @@ -399,10 +397,9 @@ sal_Bool SvXMLStylesContext::IsAutomaticStyle() const return mpImpl->IsAutomaticStyle(); } -SvXMLStyleContext *SvXMLStylesContext::CreateStyleChildContext( - sal_uInt16 p_nPrefix, - const OUString& rLocalName, - const uno::Reference< xml::sax::XAttributeList > & xAttrList ) +SvXMLStyleContext *SvXMLStylesContext::CreateStyleChildContext( sal_uInt16 p_nPrefix, + const OUString& rLocalName, + const uno::Reference< xml::sax::XAttributeList > & xAttrList ) { SvXMLStyleContext *pStyle = NULL; @@ -566,8 +563,7 @@ sal_Bool SvXMLStylesContext::InsertStyleFamily( sal_uInt16 ) const return sal_True; } -sal_uInt16 SvXMLStylesContext::GetFamily( - const ::rtl::OUString& rValue ) const +sal_uInt16 SvXMLStylesContext::GetFamily( const OUString& rValue ) const { sal_uInt16 nFamily = 0U; if( IsXMLToken( rValue, XML_PARAGRAPH ) ) @@ -716,9 +712,7 @@ Reference < XAutoStyleFamily > SvXMLStylesContext::GetAutoStyles( sal_uInt16 nFa xAutoStyles = mxParaAutoStyles; else { - sName = bPara ? - OUString( RTL_CONSTASCII_USTRINGPARAM( "ParagraphStyles" ) ): - OUString( RTL_CONSTASCII_USTRINGPARAM( "CharacterStyles" ) ); + sName = bPara ? OUString( "ParagraphStyles" ): OUString( "CharacterStyles" ); Reference< XAutoStylesSupplier > xAutoStylesSupp( GetImport().GetModel(), UNO_QUERY ); Reference< XAutoStyles > xAutoStyleFamilies = xAutoStylesSupp->getAutoStyles(); if (xAutoStyleFamilies->hasByName(sName)) @@ -746,16 +740,14 @@ Reference < XNameContainer > SvXMLStylesContext::GetStylesContainer( if( mxParaStyles.is() ) xStyles = mxParaStyles; else - sName = - OUString( RTL_CONSTASCII_USTRINGPARAM( "ParagraphStyles" ) ); + sName = "ParagraphStyles"; break; case XML_STYLE_FAMILY_TEXT_TEXT: if( mxTextStyles.is() ) xStyles = mxTextStyles; else - sName = - OUString( RTL_CONSTASCII_USTRINGPARAM( "CharacterStyles" ) ); + sName = "CharacterStyles"; break; } if( !xStyles.is() && !sName.isEmpty() ) @@ -788,7 +780,7 @@ Reference < XNameContainer > SvXMLStylesContext::GetStylesContainer( OUString SvXMLStylesContext::GetServiceName( sal_uInt16 nFamily ) const { - String sServiceName; + OUString sServiceName; switch( nFamily ) { case XML_STYLE_FAMILY_TEXT_PARAGRAPH: @@ -822,8 +814,8 @@ SvXMLStylesContext::~SvXMLStylesContext() } SvXMLImportContext *SvXMLStylesContext::CreateChildContext( sal_uInt16 nPrefix, - const OUString& rLocalName, - const uno::Reference< xml::sax::XAttributeList > & xAttrList ) + const OUString& rLocalName, + const uno::Reference< xml::sax::XAttributeList > & xAttrList ) { SvXMLImportContext *pContext = 0; diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index 134c239237ef..b48225aac68d 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -59,10 +59,7 @@ #include <txtlists.hxx> #include <xmloff/odffields.hxx> #include <comphelper/stlunosequence.hxx> -#include <tools/string.hxx> -using ::rtl::OUString; -using ::rtl::OUStringBuffer; using ::com::sun::star::ucb::XAnyCompare; using namespace ::std; @@ -504,8 +501,8 @@ struct SAL_DLLPRIVATE XMLTextImportHelper::Impl ::std::auto_ptr<SvXMLTokenMap> m_pTextContourAttrTokenMap; ::std::auto_ptr<SvXMLTokenMap> m_pTextHyperlinkAttrTokenMap; ::std::auto_ptr<SvXMLTokenMap> m_pTextMasterPageElemTokenMap; - ::std::auto_ptr< std::vector<rtl::OUString> > m_pPrevFrmNames; - ::std::auto_ptr< std::vector<rtl::OUString> > m_pNextFrmNames; + ::std::auto_ptr< std::vector<OUString> > m_pPrevFrmNames; + ::std::auto_ptr< std::vector<OUString> > m_pNextFrmNames; ::std::auto_ptr<XMLTextListsHelper> m_pTextListsHelper; SAL_WNODEPRECATED_DECLARATIONS_POP @@ -527,23 +524,23 @@ struct SAL_DLLPRIVATE XMLTextImportHelper::Impl - data structure contains more than one candidate for each list level of the outline style (#i69629#) */ - ::boost::scoped_array< ::std::vector< ::rtl::OUString > > + ::boost::scoped_array< ::std::vector< OUString > > m_pOutlineStylesCandidates; // start range, xml:id, RDFa stuff typedef ::boost::tuple< - uno::Reference<text::XTextRange>, ::rtl::OUString, + uno::Reference<text::XTextRange>, OUString, ::boost::shared_ptr< ::xmloff::ParsedRDFaAttributes > > BookmarkMapEntry_t; /// start ranges for open bookmarks - ::std::map< ::rtl::OUString, BookmarkMapEntry_t, + ::std::map< OUString, BookmarkMapEntry_t, ::comphelper::UStringLess> m_BookmarkStartRanges; - typedef ::std::vector< ::rtl::OUString > BookmarkVector_t; + typedef ::std::vector< OUString > BookmarkVector_t; BookmarkVector_t m_BookmarkVector; /// name of the last 'open' redline that started between paragraphs - ::rtl::OUString m_sOpenRedlineIdentifier; + OUString m_sOpenRedlineIdentifier; uno::Reference<text::XText> m_xText; uno::Reference<text::XTextCursor> m_xCursor; @@ -572,15 +569,15 @@ struct SAL_DLLPRIVATE XMLTextImportHelper::Impl // One more flag to remember if we are inside a deleted redline section bool m_bInsideDeleteContext : 1; - typedef ::std::pair< ::rtl::OUString, ::rtl::OUString> field_name_type_t; - typedef ::std::pair< ::rtl::OUString, ::rtl::OUString > field_param_t; + typedef ::std::pair< OUString, OUString> field_name_type_t; + typedef ::std::pair< OUString, OUString > field_param_t; typedef ::std::vector< field_param_t > field_params_t; typedef ::std::pair< field_name_type_t, field_params_t > field_stack_item_t; typedef ::std::stack< field_stack_item_t > field_stack_t; field_stack_t m_FieldStack; - ::rtl::OUString m_sCellParaStyleDefault; + OUString m_sCellParaStyleDefault; Impl( uno::Reference<frame::XModel> const& rModel, SvXMLImport & rImport, @@ -623,7 +620,7 @@ struct SAL_DLLPRIVATE XMLTextImportHelper::Impl { size_t const size(m_xChapterNumbering->getCount()); m_pOutlineStylesCandidates.reset( - new ::std::vector< ::rtl::OUString >[size] ); + new ::std::vector< OUString >[size] ); } } @@ -906,8 +903,7 @@ XMLTextImportHelper::XMLTextImportHelper( bProgress, bBlockMode, bOrganizerMode) ) , m_pBackpatcherImpl( MakeBackpatcherImpl() ) { - static ::rtl::OUString s_PropNameDefaultListId( - "DefaultListId"); + static OUString s_PropNameDefaultListId( "DefaultListId"); Reference< XChapterNumberingSupplier > xCNSupplier( rModel, UNO_QUERY ); @@ -926,7 +922,7 @@ XMLTextImportHelper::XMLTextImportHelper( xNumRulePropSetInfo->hasPropertyByName( s_PropNameDefaultListId)) { - ::rtl::OUString sListId; + OUString sListId; xNumRuleProps->getPropertyValue(s_PropNameDefaultListId) >>= sListId; DBG_ASSERT( !sListId.isEmpty(), @@ -940,7 +936,7 @@ XMLTextImportHelper::XMLTextImportHelper( m_pImpl->m_pTextListsHelper->KeepListAsProcessed( sListId, xChapterNumNamed->getName(), - ::rtl::OUString() ); + OUString() ); } } } @@ -1125,7 +1121,7 @@ void XMLTextImportHelper::InsertString( const OUString& rChars ) } void XMLTextImportHelper::InsertString( const OUString& rChars, - sal_Bool& rIgnoreLeadingSpace ) + sal_Bool& rIgnoreLeadingSpace ) { DBG_ASSERT(m_pImpl->m_xText.is(), "no text"); DBG_ASSERT(m_pImpl->m_xCursorAsRange.is(), "no range"); @@ -1154,7 +1150,7 @@ void XMLTextImportHelper::InsertString( const OUString& rChars, } } m_pImpl->m_xText->insertString(m_pImpl->m_xCursorAsRange, - sChars.makeStringAndClear(), sal_False); + sChars.makeStringAndClear(), sal_False); } } @@ -1211,7 +1207,7 @@ void XMLTextImportHelper::DeleteParagraph() { OUString sEmpty; m_pImpl->m_xText->insertString(m_pImpl->m_xCursorAsRange, - sEmpty, sal_True); + sEmpty, sal_True); } } } @@ -1219,7 +1215,7 @@ void XMLTextImportHelper::DeleteParagraph() OUString XMLTextImportHelper::ConvertStarFonts( const OUString& rChars, const OUString& rStyleName, sal_uInt8& rFlags, - sal_Bool bPara, + sal_Bool bPara, SvXMLImport& rImport ) const { OUStringBuffer sChars( rChars ); @@ -1304,10 +1300,10 @@ OUString XMLTextImportHelper::ConvertStarFonts( const OUString& rChars, to the found list styles of the parent styles. (#i73973#) */ static sal_Bool lcl_HasListStyle( OUString sStyleName, - const Reference < XNameContainer >& xParaStyles, - SvXMLImport& rImport, - const OUString& sNumberingStyleName, - const OUString& sOutlineStyleName ) + const Reference < XNameContainer >& xParaStyles, + SvXMLImport& rImport, + const OUString& sNumberingStyleName, + const OUString& sOutlineStyleName ) { sal_Bool bRet( sal_False ); @@ -1426,19 +1422,19 @@ OUString XMLTextImportHelper::SetStyleAndAttrs( // Numberings/Bullets in table not visible aftzer save/reload (#i80724#) sal_Bool bSetListAttrs ) { - static ::rtl::OUString s_ParaStyleName( "ParaStyleName"); - static ::rtl::OUString s_CharStyleName( "CharStyleName"); - static ::rtl::OUString s_NumberingRules( "NumberingRules"); - static ::rtl::OUString s_NumberingIsNumber( "NumberingIsNumber"); - static ::rtl::OUString s_NumberingLevel( "NumberingLevel"); - static ::rtl::OUString s_ParaIsNumberingRestart( "ParaIsNumberingRestart"); - static ::rtl::OUString s_NumberingStartValue( "NumberingStartValue"); - static ::rtl::OUString s_PropNameListId( "ListId"); - static ::rtl::OUString s_PageDescName( "PageDescName"); - static ::rtl::OUString s_ServiceCombinedCharacters( "com.sun.star.text.TextField.CombinedCharacters"); - static ::rtl::OUString s_Content("Content"); - static ::rtl::OUString s_OutlineLevel( "OutlineLevel"); - static ::rtl::OUString s_NumberingStyleName( "NumberingStyleName"); + static OUString s_ParaStyleName( "ParaStyleName"); + static OUString s_CharStyleName( "CharStyleName"); + static OUString s_NumberingRules( "NumberingRules"); + static OUString s_NumberingIsNumber( "NumberingIsNumber"); + static OUString s_NumberingLevel( "NumberingLevel"); + static OUString s_ParaIsNumberingRestart( "ParaIsNumberingRestart"); + static OUString s_NumberingStartValue( "NumberingStartValue"); + static OUString s_PropNameListId( "ListId"); + static OUString s_PageDescName( "PageDescName"); + static OUString s_ServiceCombinedCharacters( "com.sun.star.text.TextField.CombinedCharacters"); + static OUString s_Content("Content"); + static OUString s_OutlineLevel( "OutlineLevel"); + static OUString s_NumberingStyleName( "NumberingStyleName"); const sal_uInt16 nFamily = bPara ? XML_STYLE_FAMILY_TEXT_PARAGRAPH : XML_STYLE_FAMILY_TEXT_TEXT; @@ -1462,7 +1458,7 @@ OUString XMLTextImportHelper::SetStyleAndAttrs( if( !sStyleName.isEmpty() ) { sStyleName = rImport.GetStyleDisplayName( nFamily, sStyleName ); - const String& rPropName = (bPara) ? s_ParaStyleName : s_CharStyleName; + const OUString& rPropName = (bPara) ? s_ParaStyleName : s_CharStyleName; const Reference < XNameContainer > & rStyles = (bPara) ? m_pImpl->m_xParaStyles : m_pImpl->m_xTextStyles; @@ -1499,7 +1495,7 @@ OUString XMLTextImportHelper::SetStyleAndAttrs( Reference < XIndexReplace > xNewNumRules; sal_Int8 nLevel(-1); - ::rtl::OUString sListId; + OUString sListId; sal_Int16 nStartValue(-1); bool bNumberingIsNumber(true); @@ -1740,7 +1736,7 @@ OUString XMLTextImportHelper::SetStyleAndAttrs( pStyle->FillPropertySet( xCrsrProperties ); xCrsr->collapseToEnd(); xCrsr->gotoRange( xRange->getEnd(), true ); - xCrsr->setString( ::rtl::OUString() ); + xCrsr->setString( OUString() ); } catch(const uno::Exception&) { @@ -1865,11 +1861,10 @@ OUString XMLTextImportHelper::SetStyleAndAttrs( return sStyleName; } -void XMLTextImportHelper::FindOutlineStyleName( ::rtl::OUString& rStyleName, +void XMLTextImportHelper::FindOutlineStyleName( OUString& rStyleName, sal_Int8 nOutlineLevel ) { - static ::rtl::OUString s_HeadingStyleName( - "HeadingStyleName"); + static OUString s_HeadingStyleName( "HeadingStyleName"); // style name empty? if( rStyleName.isEmpty() ) @@ -1897,7 +1892,7 @@ void XMLTextImportHelper::FindOutlineStyleName( ::rtl::OUString& rStyleName, { if (aProperties[i].Name == s_HeadingStyleName) { - rtl::OUString aOutlineStyle; + OUString aOutlineStyle; aProperties[i].Value >>= aOutlineStyle; m_pImpl->m_pOutlineStylesCandidates[nOutlineLevel] .push_back( aOutlineStyle ); @@ -1933,8 +1928,8 @@ void XMLTextImportHelper::AddOutlineStyleCandidate( const sal_Int8 nOutlineLevel void XMLTextImportHelper::SetOutlineStyles( sal_Bool bSetEmptyLevels ) { - static ::rtl::OUString s_NumberingStyleName( "NumberingStyleName"); - static ::rtl::OUString s_HeadingStyleName( "HeadingStyleName"); + static OUString s_NumberingStyleName( "NumberingStyleName"); + static OUString s_HeadingStyleName( "HeadingStyleName"); if ((m_pImpl->m_pOutlineStylesCandidates != NULL || bSetEmptyLevels) && m_pImpl->m_xChapterNumbering.is() && @@ -2039,12 +2034,12 @@ void XMLTextImportHelper::SetHyperlink( const OUString& rVisitedStyleName, XMLEventsImportContext* pEvents) { - static ::rtl::OUString s_HyperLinkURL( "HyperLinkURL"); - static ::rtl::OUString s_HyperLinkName( "HyperLinkName"); - static ::rtl::OUString s_HyperLinkTarget( "HyperLinkTarget"); - static ::rtl::OUString s_UnvisitedCharStyleName( "UnvisitedCharStyleName"); - static ::rtl::OUString s_VisitedCharStyleName( "VisitedCharStyleName"); - static ::rtl::OUString s_HyperLinkEvents( "HyperLinkEvents"); + static OUString s_HyperLinkURL( "HyperLinkURL"); + static OUString s_HyperLinkName( "HyperLinkName"); + static OUString s_HyperLinkTarget( "HyperLinkTarget"); + static OUString s_UnvisitedCharStyleName( "UnvisitedCharStyleName"); + static OUString s_VisitedCharStyleName( "VisitedCharStyleName"); + static OUString s_HyperLinkEvents( "HyperLinkEvents"); Reference < XPropertySet > xPropSet( rCursor, UNO_QUERY ); Reference < XPropertySetInfo > xPropSetInfo( @@ -2557,7 +2552,8 @@ sal_Bool XMLTextImportHelper::FindAndRemoveBookmarkStartRange( { ++it; } - if (it!=m_pImpl->m_BookmarkVector.end()) { + if (it!=m_pImpl->m_BookmarkVector.end()) + { m_pImpl->m_BookmarkVector.erase(it); } return sal_True; @@ -2568,14 +2564,19 @@ sal_Bool XMLTextImportHelper::FindAndRemoveBookmarkStartRange( } } -::rtl::OUString XMLTextImportHelper::FindActiveBookmarkName() +OUString XMLTextImportHelper::FindActiveBookmarkName() { - if (!m_pImpl->m_BookmarkVector.empty()) { + if (!m_pImpl->m_BookmarkVector.empty()) + { return m_pImpl->m_BookmarkVector.back(); - } else return ::rtl::OUString(); // return the empty string on error... + } + else + { + return OUString(); // return the empty string on error... + } } -void XMLTextImportHelper::pushFieldCtx( ::rtl::OUString name, ::rtl::OUString type ) +void XMLTextImportHelper::pushFieldCtx( OUString name, OUString type ) { m_pImpl->m_FieldStack.push(Impl::field_stack_item_t( Impl::field_name_type_t(name, type), Impl::field_params_t())); @@ -2587,7 +2588,7 @@ void XMLTextImportHelper::popFieldCtx() m_pImpl->m_FieldStack.pop(); } -void XMLTextImportHelper::addFieldParam( ::rtl::OUString name, ::rtl::OUString value ) +void XMLTextImportHelper::addFieldParam( OUString name, OUString value ) { DBG_ASSERT(!m_pImpl->m_FieldStack.empty(), "stack is empty: not good! Do a pushFieldCtx before..."); @@ -2597,13 +2598,18 @@ void XMLTextImportHelper::addFieldParam( ::rtl::OUString name, ::rtl::OUString v } } -::rtl::OUString XMLTextImportHelper::getCurrentFieldType() +OUString XMLTextImportHelper::getCurrentFieldType() { DBG_ASSERT(!m_pImpl->m_FieldStack.empty(), "stack is empty: not good! Do a pushFieldCtx before..."); - if (!m_pImpl->m_FieldStack.empty()) { + if (!m_pImpl->m_FieldStack.empty()) + { return m_pImpl->m_FieldStack.top().first.second; - } else return ::rtl::OUString(); + } + else + { + return OUString(); + } } bool XMLTextImportHelper::hasCurrentFieldCtx() @@ -2628,8 +2634,8 @@ void XMLTextImportHelper::ConnectFrameChains( const OUString& rNextFrmName, const Reference < XPropertySet >& rFrmPropSet ) { - static ::rtl::OUString s_ChainNextName( "ChainNextName"); - static ::rtl::OUString s_ChainPrevName( "ChainPrevName"); + static OUString s_ChainNextName( "ChainNextName"); + static OUString s_ChainPrevName( "ChainPrevName"); if( rFrmName.isEmpty() ) return; @@ -2648,8 +2654,8 @@ void XMLTextImportHelper::ConnectFrameChains( { if (!m_pImpl->m_pPrevFrmNames.get()) { - m_pImpl->m_pPrevFrmNames.reset( new std::vector<rtl::OUString> ); - m_pImpl->m_pNextFrmNames.reset( new std::vector<rtl::OUString> ); + m_pImpl->m_pPrevFrmNames.reset( new std::vector<OUString> ); + m_pImpl->m_pNextFrmNames.reset( new std::vector<OUString> ); } m_pImpl->m_pPrevFrmNames->push_back(rFrmName); m_pImpl->m_pNextFrmNames->push_back(sNextFrmName); @@ -2657,7 +2663,7 @@ void XMLTextImportHelper::ConnectFrameChains( } if (m_pImpl->m_pPrevFrmNames.get() && !m_pImpl->m_pPrevFrmNames->empty()) { - for(std::vector<rtl::OUString>::iterator i = m_pImpl->m_pPrevFrmNames->begin(), j = m_pImpl->m_pNextFrmNames->begin(); i != m_pImpl->m_pPrevFrmNames->end() && j != m_pImpl->m_pNextFrmNames->end(); ++i, ++j) + for(std::vector<OUString>::iterator i = m_pImpl->m_pPrevFrmNames->begin(), j = m_pImpl->m_pNextFrmNames->begin(); i != m_pImpl->m_pPrevFrmNames->end() && j != m_pImpl->m_pNextFrmNames->end(); ++i, ++j) { if((*j).equals(rFrmName)) { @@ -2677,7 +2683,7 @@ void XMLTextImportHelper::ConnectFrameChains( sal_Bool XMLTextImportHelper::IsInFrame() const { - static ::rtl::OUString s_TextFrame( "TextFrame"); + static OUString s_TextFrame( "TextFrame"); sal_Bool bIsInFrame = sal_False; @@ -2730,26 +2736,26 @@ Reference< XPropertySet> XMLTextImportHelper::createAndInsertOOoLink( Reference< XPropertySet> XMLTextImportHelper::createAndInsertApplet( const OUString& /*rCode*/, - const OUString& /*rName*/, - sal_Bool /*bMayScript*/, - const OUString& /*rHRef*/, + const OUString& /*rName*/, + sal_Bool /*bMayScript*/, + const OUString& /*rHRef*/, sal_Int32 /*nWidth*/, sal_Int32 /*nHeight*/ ) { Reference< XPropertySet> xPropSet; return xPropSet; } Reference< XPropertySet> XMLTextImportHelper::createAndInsertPlugin( - const OUString& /*rMimeType*/, - const OUString& /*rHRef*/, + const OUString& /*rMimeType*/, + const OUString& /*rHRef*/, sal_Int32 /*nWidth*/, sal_Int32 /*nHeight*/ ) { Reference< XPropertySet> xPropSet; return xPropSet; } Reference< XPropertySet> XMLTextImportHelper::createAndInsertFloatingFrame( - const OUString& /*rName*/, - const OUString& /*rHRef*/, - const OUString& /*rStyleName*/, + const OUString& /*rName*/, + const OUString& /*rHRef*/, + const OUString& /*rStyleName*/, sal_Int32 /*nWidth*/, sal_Int32 /*nHeight*/ ) { Reference< XPropertySet> xPropSet; @@ -2758,17 +2764,16 @@ Reference< XPropertySet> XMLTextImportHelper::createAndInsertFloatingFrame( void XMLTextImportHelper::endAppletOrPlugin( const Reference < XPropertySet> &, - std::map < const rtl::OUString, rtl::OUString, UStringLess > &) + std::map < const OUString, OUString, UStringLess > &) { } // redline helper: dummy implementation to be overridden in sw/filter/xml -void XMLTextImportHelper::RedlineAdd( - const OUString& /*rType*/, - const OUString& /*rId*/, - const OUString& /*rAuthor*/, - const OUString& /*rComment*/, - const DateTime& /*rDateTime*/, - sal_Bool /*bMergeLastPara*/) +void XMLTextImportHelper::RedlineAdd( const OUString& /*rType*/, + const OUString& /*rId*/, + const OUString& /*rAuthor*/, + const OUString& /*rComment*/, + const DateTime& /*rDateTime*/, + sal_Bool /*bMergeLastPara*/) { // dummy implementation: do nothing } @@ -2815,7 +2820,7 @@ OUString XMLTextImportHelper::GetOpenRedlineId() return m_pImpl->m_sOpenRedlineIdentifier; } -void XMLTextImportHelper::SetOpenRedlineId( ::rtl::OUString& rId) +void XMLTextImportHelper::SetOpenRedlineId( OUString& rId) { m_pImpl->m_sOpenRedlineIdentifier = rId; } @@ -2827,12 +2832,12 @@ void XMLTextImportHelper::ResetOpenRedlineId() } void -XMLTextImportHelper::SetCellParaStyleDefault(::rtl::OUString const& rNewValue) +XMLTextImportHelper::SetCellParaStyleDefault(OUString const& rNewValue) { m_pImpl->m_sCellParaStyleDefault = rNewValue; } -::rtl::OUString const& XMLTextImportHelper::GetCellParaStyleDefault() +OUString const& XMLTextImportHelper::GetCellParaStyleDefault() { return m_pImpl->m_sCellParaStyleDefault; } |