Kaydet (Commit) c66229bf authored tarafından Noel Grandin's avatar Noel Grandin

oox: prefer passing OUString by reference

Change-Id: Iace276878e7ae668bba5bb6e36af1e5d5d72d6cb
üst bd8ce8b9
...@@ -41,7 +41,7 @@ public: ...@@ -41,7 +41,7 @@ public:
DocumentEncryption( DocumentEncryption(
com::sun::star::uno::Reference< com::sun::star::io::XStream > xDocumentStream, com::sun::star::uno::Reference< com::sun::star::io::XStream > xDocumentStream,
oox::ole::OleStorage& rOleStorage, oox::ole::OleStorage& rOleStorage,
OUString aPassword); const OUString& aPassword);
bool encrypt(); bool encrypt();
......
...@@ -61,7 +61,7 @@ public: ...@@ -61,7 +61,7 @@ public:
/** Sets a scheme color from the a:schemeClr element. */ /** Sets a scheme color from the a:schemeClr element. */
void setSchemeClr( sal_Int32 nToken ); void setSchemeClr( sal_Int32 nToken );
/** Sets the scheme name from the a:schemeClr element for interoperability purposes */ /** Sets the scheme name from the a:schemeClr element for interoperability purposes */
void setSchemeName( OUString sSchemeName ) { msSchemeName = sSchemeName; } void setSchemeName( const OUString& sSchemeName ) { msSchemeName = sSchemeName; }
/** Sets a system color from the a:sysClr element. */ /** Sets a system color from the a:sysClr element. */
void setSysClr( sal_Int32 nToken, sal_Int32 nLastRgb ); void setSysClr( sal_Int32 nToken, sal_Int32 nLastRgb );
/** Sets a palette color index. */ /** Sets a palette color index. */
...@@ -102,7 +102,7 @@ public: ...@@ -102,7 +102,7 @@ public:
/** Translates between color transformation tokens and their names */ /** Translates between color transformation tokens and their names */
static OUString getColorTransformationName( sal_Int32 nElement ); static OUString getColorTransformationName( sal_Int32 nElement );
/** Translates between color transformation token names and the corresponding token */ /** Translates between color transformation token names and the corresponding token */
static sal_Int32 getColorTransformationToken( OUString sName ); static sal_Int32 getColorTransformationToken( const OUString& sName );
private: private:
/** Internal helper for getColor(). */ /** Internal helper for getColor(). */
......
...@@ -179,7 +179,7 @@ public: ...@@ -179,7 +179,7 @@ public:
getDiagramDoms() { return maDiagramDoms; } getDiagramDoms() { return maDiagramDoms; }
void setDiagramDoms(const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& rDiagramDoms) { maDiagramDoms = rDiagramDoms; } void setDiagramDoms(const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& rDiagramDoms) { maDiagramDoms = rDiagramDoms; }
com::sun::star::uno::Sequence< com::sun::star::uno::Sequence< com::sun::star::uno::Any > >resolveRelationshipsOfTypeFromOfficeDoc( com::sun::star::uno::Sequence< com::sun::star::uno::Sequence< com::sun::star::uno::Any > >resolveRelationshipsOfTypeFromOfficeDoc(
core::XmlFilterBase& rFilter, OUString sFragment, OUString sType ); core::XmlFilterBase& rFilter, const OUString& sFragment, const OUString& sType );
protected: protected:
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
......
...@@ -95,10 +95,10 @@ protected: ...@@ -95,10 +95,10 @@ protected:
/// If set, this is the parent of the currently handled shape. /// If set, this is the parent of the currently handled shape.
com::sun::star::uno::Reference<com::sun::star::drawing::XShape> m_xParent; com::sun::star::uno::Reference<com::sun::star::drawing::XShape> m_xParent;
bool GetProperty( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet, OUString aName ); bool GetProperty( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet, const OUString& aName );
bool GetPropertyAndState( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet, bool GetPropertyAndState( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet,
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState > rXPropState, ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState > rXPropState,
OUString aName, ::com::sun::star::beans::PropertyState& eState ); const OUString& aName, ::com::sun::star::beans::PropertyState& eState );
const char* GetFieldType( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > rRun, sal_Bool& bIsField ); const char* GetFieldType( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > rRun, sal_Bool& bIsField );
...@@ -123,14 +123,14 @@ public: ...@@ -123,14 +123,14 @@ public:
OUString WriteImage( const Graphic &rGraphic , bool bRelPathToMedia = false); OUString WriteImage( const Graphic &rGraphic , bool bRelPathToMedia = false);
void WriteColor( sal_uInt32 nColor, sal_Int32 nAlpha = MAX_PERCENT ); void WriteColor( sal_uInt32 nColor, sal_Int32 nAlpha = MAX_PERCENT );
void WriteColor( OUString sColorSchemeName, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aTransformations ); void WriteColor( const OUString& sColorSchemeName, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aTransformations );
void WriteColorTransformations( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aTransformations ); void WriteColorTransformations( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aTransformations );
void WriteGradientStop( sal_uInt16 nStop, sal_uInt32 nColor ); void WriteGradientStop( sal_uInt16 nStop, sal_uInt32 nColor );
void WriteLineArrow( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet, sal_Bool bLineStart ); void WriteLineArrow( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet, sal_Bool bLineStart );
void WriteConnectorConnections( EscherConnectorListEntry& rConnectorEntry, sal_Int32 nStartID, sal_Int32 nEndID ); void WriteConnectorConnections( EscherConnectorListEntry& rConnectorEntry, sal_Int32 nStartID, sal_Int32 nEndID );
void WriteSolidFill( sal_uInt32 nColor, sal_Int32 nAlpha = MAX_PERCENT ); void WriteSolidFill( sal_uInt32 nColor, sal_Int32 nAlpha = MAX_PERCENT );
void WriteSolidFill( OUString sSchemeName, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aTransformations ); void WriteSolidFill( const OUString& sSchemeName, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aTransformations );
void WriteSolidFill( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet ); void WriteSolidFill( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet );
void WriteGradientFill( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet ); void WriteGradientFill( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet );
void WriteGradientFill( ::com::sun::star::awt::Gradient rGradient ); void WriteGradientFill( ::com::sun::star::awt::Gradient rGradient );
......
...@@ -34,7 +34,7 @@ private: ...@@ -34,7 +34,7 @@ private:
GrabBagStackElement mCurrentElement; GrabBagStackElement mCurrentElement;
public: public:
GrabBagStack(OUString aName); GrabBagStack(const OUString& aName);
virtual ~GrabBagStack(); virtual ~GrabBagStack();
...@@ -42,11 +42,11 @@ public: ...@@ -42,11 +42,11 @@ public:
css::beans::PropertyValue getRootProperty(); css::beans::PropertyValue getRootProperty();
void appendElement(OUString aName, css::uno::Any aAny); void appendElement(const OUString& aName, css::uno::Any aAny);
void push(OUString aKey); void push(const OUString& aKey);
void pop(); void pop();
void addInt32(OUString aElementName, sal_Int32 aIntValue); void addInt32(const OUString& aElementName, sal_Int32 aIntValue);
void addString(OUString aElementName, OUString aStringValue); void addString(const OUString& aElementName, const OUString& aStringValue);
bool isStackEmpty(); bool isStackEmpty();
}; };
......
...@@ -57,7 +57,7 @@ class Comment ...@@ -57,7 +57,7 @@ class Comment
OUString text; OUString text;
::com::sun::star::util::DateTime aDateTime; ::com::sun::star::util::DateTime aDateTime;
void setDateTime (OUString datetime); void setDateTime (const OUString& datetime);
public: public:
void setAuthorId(const OUString& _aId) void setAuthorId(const OUString& _aId)
......
...@@ -286,7 +286,7 @@ class SimpleShape : public ShapeBase ...@@ -286,7 +286,7 @@ class SimpleShape : public ShapeBase
public: public:
explicit SimpleShape( Drawing& rDrawing, const OUString& rService ); explicit SimpleShape( Drawing& rDrawing, const OUString& rService );
void setService( OUString aService ) { maService = aService; } void setService( const OUString& aService ) { maService = aService; }
protected: protected:
/** Creates the corresponding XShape and inserts it into the passed container. */ /** Creates the corresponding XShape and inserts it into the passed container. */
......
...@@ -25,7 +25,7 @@ using namespace css::uno; ...@@ -25,7 +25,7 @@ using namespace css::uno;
using namespace std; using namespace std;
DocumentEncryption::DocumentEncryption(Reference< XStream > xDocumentStream, oox::ole::OleStorage& rOleStorage, OUString aPassword) : DocumentEncryption::DocumentEncryption(Reference< XStream > xDocumentStream, oox::ole::OleStorage& rOleStorage, const OUString& aPassword) :
mxDocumentStream(xDocumentStream), mxDocumentStream(xDocumentStream),
mrOleStorage(rOleStorage), mrOleStorage(rOleStorage),
maPassword(aPassword) maPassword(aPassword)
......
...@@ -382,7 +382,7 @@ OUString Color::getColorTransformationName( sal_Int32 nElement ) ...@@ -382,7 +382,7 @@ OUString Color::getColorTransformationName( sal_Int32 nElement )
return OUString(); return OUString();
} }
sal_Int32 Color::getColorTransformationToken( OUString sName ) sal_Int32 Color::getColorTransformationToken( const OUString& sName )
{ {
if( sName == "red" ) if( sName == "red" )
return XML_red; return XML_red;
......
...@@ -1207,7 +1207,7 @@ void Shape::putPropertiesToGrabBag( const Sequence< PropertyValue >& aProperties ...@@ -1207,7 +1207,7 @@ void Shape::putPropertiesToGrabBag( const Sequence< PropertyValue >& aProperties
} }
} }
uno::Sequence< uno::Sequence< uno::Any > > Shape::resolveRelationshipsOfTypeFromOfficeDoc(core::XmlFilterBase& rFilter, OUString sFragment, OUString sType ) uno::Sequence< uno::Sequence< uno::Any > > Shape::resolveRelationshipsOfTypeFromOfficeDoc(core::XmlFilterBase& rFilter, const OUString& sFragment, const OUString& sType )
{ {
uno::Sequence< uno::Sequence< uno::Any > > xRelListTemp; uno::Sequence< uno::Sequence< uno::Any > > xRelListTemp;
sal_Int32 counter = 0; sal_Int32 counter = 0;
......
...@@ -123,7 +123,7 @@ void DrawingML::ResetCounters() ...@@ -123,7 +123,7 @@ void DrawingML::ResetCounters()
mnImageCounter = 1; mnImageCounter = 1;
} }
bool DrawingML::GetProperty( Reference< XPropertySet > rXPropSet, OUString aName ) bool DrawingML::GetProperty( Reference< XPropertySet > rXPropSet, const OUString& aName )
{ {
bool bRetValue = false; bool bRetValue = false;
...@@ -136,7 +136,7 @@ bool DrawingML::GetProperty( Reference< XPropertySet > rXPropSet, OUString aName ...@@ -136,7 +136,7 @@ bool DrawingML::GetProperty( Reference< XPropertySet > rXPropSet, OUString aName
return bRetValue; return bRetValue;
} }
bool DrawingML::GetPropertyAndState( Reference< XPropertySet > rXPropSet, Reference< XPropertyState > rXPropState, OUString aName, PropertyState& eState ) bool DrawingML::GetPropertyAndState( Reference< XPropertySet > rXPropSet, Reference< XPropertyState > rXPropState, const OUString& aName, PropertyState& eState )
{ {
bool bRetValue = false; bool bRetValue = false;
...@@ -180,7 +180,7 @@ void DrawingML::WriteColor( sal_uInt32 nColor, sal_Int32 nAlpha ) ...@@ -180,7 +180,7 @@ void DrawingML::WriteColor( sal_uInt32 nColor, sal_Int32 nAlpha )
} }
} }
void DrawingML::WriteColor( OUString sColorSchemeName, Sequence< PropertyValue > aTransformations ) void DrawingML::WriteColor( const OUString& sColorSchemeName, Sequence< PropertyValue > aTransformations )
{ {
// prevent writing a tag with empty val attribute // prevent writing a tag with empty val attribute
if( sColorSchemeName.isEmpty() ) if( sColorSchemeName.isEmpty() )
...@@ -220,7 +220,7 @@ void DrawingML::WriteSolidFill( sal_uInt32 nColor, sal_Int32 nAlpha ) ...@@ -220,7 +220,7 @@ void DrawingML::WriteSolidFill( sal_uInt32 nColor, sal_Int32 nAlpha )
mpFS->endElementNS( XML_a, XML_solidFill ); mpFS->endElementNS( XML_a, XML_solidFill );
} }
void DrawingML::WriteSolidFill( OUString sSchemeName, Sequence< PropertyValue > aTransformations ) void DrawingML::WriteSolidFill( const OUString& sSchemeName, Sequence< PropertyValue > aTransformations )
{ {
mpFS->startElementNS( XML_a, XML_solidFill, FSEND ); mpFS->startElementNS( XML_a, XML_solidFill, FSEND );
WriteColor( sSchemeName, aTransformations ); WriteColor( sSchemeName, aTransformations );
......
...@@ -17,7 +17,7 @@ namespace oox ...@@ -17,7 +17,7 @@ namespace oox
using namespace css::beans; using namespace css::beans;
using namespace css::uno; using namespace css::uno;
GrabBagStack::GrabBagStack(OUString aName) GrabBagStack::GrabBagStack(const OUString& aName)
{ {
mCurrentElement.maName = aName; mCurrentElement.maName = aName;
} }
...@@ -54,7 +54,7 @@ PropertyValue GrabBagStack::getRootProperty() ...@@ -54,7 +54,7 @@ PropertyValue GrabBagStack::getRootProperty()
return aProperty; return aProperty;
} }
void GrabBagStack::appendElement(OUString aName, Any aAny) void GrabBagStack::appendElement(const OUString& aName, Any aAny)
{ {
PropertyValue aValue; PropertyValue aValue;
aValue.Name = aName; aValue.Name = aName;
...@@ -62,7 +62,7 @@ void GrabBagStack::appendElement(OUString aName, Any aAny) ...@@ -62,7 +62,7 @@ void GrabBagStack::appendElement(OUString aName, Any aAny)
mCurrentElement.maPropertyList.push_back(aValue); mCurrentElement.maPropertyList.push_back(aValue);
} }
void GrabBagStack::push(OUString aKey) void GrabBagStack::push(const OUString& aKey)
{ {
mStack.push(mCurrentElement); mStack.push(mCurrentElement);
mCurrentElement.maName = aKey; mCurrentElement.maName = aKey;
...@@ -83,12 +83,12 @@ void GrabBagStack::pop() ...@@ -83,12 +83,12 @@ void GrabBagStack::pop()
appendElement(aName, makeAny(aSequence)); appendElement(aName, makeAny(aSequence));
} }
void GrabBagStack::addInt32(OUString aElementName, sal_Int32 aIntValue) void GrabBagStack::addInt32(const OUString& aElementName, sal_Int32 aIntValue)
{ {
appendElement(aElementName, makeAny(aIntValue)); appendElement(aElementName, makeAny(aIntValue));
} }
void GrabBagStack::addString(OUString aElementName, OUString aStringValue) void GrabBagStack::addString(const OUString& aElementName, const OUString& aStringValue)
{ {
appendElement(aElementName, makeAny(aStringValue)); appendElement(aElementName, makeAny(aStringValue));
} }
......
...@@ -37,8 +37,9 @@ using namespace ::com::sun::star::uno; ...@@ -37,8 +37,9 @@ using namespace ::com::sun::star::uno;
namespace { namespace {
void lclSplitFirstElement( OUString& orElement, OUString& orRemainder, OUString aFullName ) void lclSplitFirstElement( OUString& orElement, OUString& orRemainder, const OUString& _aFullName )
{ {
OUString aFullName = _aFullName;
sal_Int32 nSlashPos = aFullName.indexOf( '/' ); sal_Int32 nSlashPos = aFullName.indexOf( '/' );
// strip leading slashes // strip leading slashes
......
...@@ -30,8 +30,9 @@ void CommentAuthorList::setValues(const CommentAuthorList& list) ...@@ -30,8 +30,9 @@ void CommentAuthorList::setValues(const CommentAuthorList& list)
} }
//DateTime is saved as : 2013-01-10T15:53:26.000 //DateTime is saved as : 2013-01-10T15:53:26.000
void Comment::setDateTime (OUString datetime) void Comment::setDateTime (const OUString& _datetime)
{ {
OUString datetime = _datetime;
aDateTime.Year = datetime.getToken(0,'-').toInt32(); aDateTime.Year = datetime.getToken(0,'-').toInt32();
aDateTime.Month = datetime.getToken(1,'-').toInt32(); aDateTime.Month = datetime.getToken(1,'-').toInt32();
aDateTime.Day = datetime.getToken(2,'-').toInt32(); aDateTime.Day = datetime.getToken(2,'-').toInt32();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment