sfx2,svl: prefer passing OUString and OString by reference

Change-Id: I9833265f6e635a057cea2c4a945cc73809b1e2ef
This commit is contained in:
Noel Grandin 2014-03-13 09:34:37 +02:00
parent 3075b06226
commit 0dc38bdde0
24 changed files with 51 additions and 50 deletions

View File

@ -28,7 +28,7 @@ class SFX2_DLLPUBLIC RequestPackageReparation
{
RequestPackageReparation_Impl* pImp;
public:
RequestPackageReparation( OUString aName );
RequestPackageReparation( const OUString& aName );
~RequestPackageReparation();
sal_Bool isApproved();
com::sun::star::uno::Reference < ::com::sun::star::task::XInteractionRequest > GetRequest();
@ -39,7 +39,7 @@ class SFX2_DLLPUBLIC NotifyBrokenPackage
{
NotifyBrokenPackage_Impl* pImp;
public:
NotifyBrokenPackage( OUString aName );
NotifyBrokenPackage( const OUString& aName );
~NotifyBrokenPackage();
sal_Bool isAborted();
com::sun::star::uno::Reference < ::com::sun::star::task::XInteractionRequest > GetRequest();

View File

@ -110,13 +110,13 @@ public:
sal_Int32 getAutoloadDelay() const { return m_AutoloadDelay; }
void setAutoloadDelay(sal_Int32 i_val) { m_AutoloadDelay = i_val; }
OUString getAutoloadURL() const { return m_AutoloadURL; }
void setAutoloadURL(OUString i_val) { m_AutoloadURL = i_val; }
void setAutoloadURL(const OUString& i_val) { m_AutoloadURL = i_val; }
OUString getDefaultTarget() const { return m_DefaultTarget; }
void setDefaultTarget(OUString i_val) { m_DefaultTarget = i_val; }
void setDefaultTarget(const OUString& i_val) { m_DefaultTarget = i_val; }
OUString getTemplateName() const { return m_TemplateName; }
void setTemplateName(OUString i_val) { m_TemplateName = i_val; }
void setTemplateName(const OUString& i_val) { m_TemplateName = i_val; }
OUString getAuthor() const { return m_Author; }
void setAuthor(OUString i_val) { m_Author = i_val; }
void setAuthor(const OUString& i_val) { m_Author = i_val; }
::com::sun::star::util::DateTime
getCreationDate() const { return m_CreationDate; }
@ -124,7 +124,7 @@ public:
m_CreationDate = i_val;
}
OUString getModifiedBy() const { return m_ModifiedBy; }
void setModifiedBy(OUString i_val) { m_ModifiedBy = i_val; }
void setModifiedBy(const OUString& i_val) { m_ModifiedBy = i_val; }
::com::sun::star::util::DateTime
getModificationDate() const { return m_ModificationDate; }
@ -132,7 +132,7 @@ public:
m_ModificationDate = i_val;
}
OUString getPrintedBy() const { return m_PrintedBy; }
void setPrintedBy(OUString i_val) { m_PrintedBy = i_val; }
void setPrintedBy(const OUString& i_val) { m_PrintedBy = i_val; }
::com::sun::star::util::DateTime
getPrintDate() const { return m_PrintDate; }
void setPrintDate(::com::sun::star::util::DateTime i_val) {
@ -143,13 +143,13 @@ public:
sal_Int32 getEditingDuration() const { return m_EditingDuration; }
void setEditingDuration(sal_Int32 i_val) { m_EditingDuration = i_val; }
OUString getDescription() const { return m_Description; }
void setDescription(OUString i_val) { m_Description = i_val; }
void setDescription(const OUString& i_val) { m_Description = i_val; }
OUString getKeywords() const { return m_Keywords; }
void setKeywords(OUString i_val) { m_Keywords = i_val; }
void setKeywords(const OUString& i_val) { m_Keywords = i_val; }
OUString getSubject() const { return m_Subject; }
void setSubject(OUString i_val) { m_Subject = i_val; }
void setSubject(const OUString& i_val) { m_Subject = i_val; }
OUString getTitle() const { return m_Title; }
void setTitle(OUString i_val) { m_Title = i_val; }
void setTitle(const OUString& i_val) { m_Title = i_val; }
/// reset user-specific data (author, modified-by, ...)
void resetUserData(const OUString & i_rAuthor);

View File

@ -105,7 +105,7 @@ public:
class SFX2_DLLPUBLIC SfxEventConfiguration
{
public:
static void ConfigureEvent( OUString aName, const SvxMacro&, SfxObjectShell* pObjSh);
static void ConfigureEvent( const OUString& aName, const SvxMacro&, SfxObjectShell* pObjSh);
static SvxMacro* ConvertToMacro( const com::sun::star::uno::Any& rElement, SfxObjectShell* pDoc, sal_Bool bBlowUp );
};

View File

@ -604,9 +604,9 @@ public:
SAL_DLLPRIVATE sal_Bool DisconnectStorage_Impl( SfxMedium& rSrcMedium, SfxMedium& rTargetMedium );
SAL_DLLPRIVATE sal_Bool PutURLContentsToVersionStream_Impl(
OUString aURL,
const OUString& aURL,
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xDocStorage,
OUString aStreamName );
const OUString& aStreamName );
SAL_DLLPRIVATE OUString CreateTempCopyOfStorage_Impl(
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );

View File

@ -91,7 +91,7 @@ public:
bool isTemplateNameUnique (const sal_uInt16 nRegionItemId, const OUString &rName) const;
virtual bool renameItem(ThumbnailViewItem* pItem, OUString sNewTitle);
virtual bool renameItem(ThumbnailViewItem* pItem, const OUString& sNewTitle);
private:

View File

@ -241,7 +241,7 @@ public:
virtual void Resize();
virtual bool renameItem(ThumbnailViewItem* pItem, OUString sNewTitle);
virtual bool renameItem(ThumbnailViewItem* pItem, const OUString& sNewTitle);
static BitmapEx readThumbnail(const OUString &msURL);

View File

@ -91,7 +91,7 @@ public:
const SfxItemPropertySimpleEntry* getByName( const OUString &rName ) const;
com::sun::star::uno::Sequence< com::sun::star::beans::Property > getProperties() const;
com::sun::star::beans::Property getPropertyByName( const OUString rName ) const
com::sun::star::beans::Property getPropertyByName( const OUString & rName ) const
throw( ::com::sun::star::beans::UnknownPropertyException );
bool hasPropertyByName( const OUString& rName ) const;

View File

@ -166,7 +166,7 @@ class SVL_DLLPUBLIC SfxListUndoAction : public SfxUndoAction, public SfxUndoArra
TYPEINFO();
SfxListUndoAction( const OUString &rComment,
const OUString rRepeatComment, sal_uInt16 Id, SfxUndoArray *pFather);
const OUString& rRepeatComment, sal_uInt16 Id, SfxUndoArray *pFather);
virtual void Undo();
virtual void UndoWithContext( SfxUndoContext& i_context );
virtual void Redo();

View File

@ -62,7 +62,7 @@ public:
const OUString& aSlotName,
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgsSequence,
sal_Bool bPreselectPassword,
OUString aUserSelectedName,
const OUString& aUserSelectedName,
sal_uInt16 nDocumentSignatureState = SIGNATURESTATE_NOSIGNATURES );
static sal_Bool CheckFilterOptionsAppearence(
@ -78,8 +78,8 @@ public:
static sal_Bool WarnUnacceptableFormat(
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel,
OUString aOldUIName,
OUString aDefUIName,
const OUString& aOldUIName,
const OUString& aDefUIName,
sal_Bool bCanProceedFurther );
static Window* GetModelWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel );

View File

@ -1720,14 +1720,14 @@ class RequestPackageReparation_Impl : public ::cppu::WeakImplHelper1< task::XInt
comphelper::OInteractionDisapprove* m_pDisapprove;
public:
RequestPackageReparation_Impl( OUString aName );
RequestPackageReparation_Impl( const OUString& aName );
sal_Bool isApproved();
virtual uno::Any SAL_CALL getRequest() throw( uno::RuntimeException, std::exception );
virtual uno::Sequence< uno::Reference< task::XInteractionContinuation > > SAL_CALL getContinuations()
throw( uno::RuntimeException, std::exception );
};
RequestPackageReparation_Impl::RequestPackageReparation_Impl( OUString aName )
RequestPackageReparation_Impl::RequestPackageReparation_Impl( const OUString& aName )
{
OUString temp;
uno::Reference< uno::XInterface > temp2;
@ -1760,7 +1760,7 @@ uno::Sequence< uno::Reference< task::XInteractionContinuation > >
return m_lContinuations;
}
RequestPackageReparation::RequestPackageReparation( OUString aName )
RequestPackageReparation::RequestPackageReparation( const OUString& aName )
{
pImp = new RequestPackageReparation_Impl( aName );
pImp->acquire();
@ -1789,13 +1789,13 @@ class NotifyBrokenPackage_Impl : public ::cppu::WeakImplHelper1< task::XInteract
comphelper::OInteractionAbort* m_pAbort;
public:
NotifyBrokenPackage_Impl( OUString aName );
NotifyBrokenPackage_Impl( const OUString& aName );
virtual uno::Any SAL_CALL getRequest() throw( uno::RuntimeException, std::exception );
virtual uno::Sequence< uno::Reference< task::XInteractionContinuation > > SAL_CALL getContinuations()
throw( uno::RuntimeException, std::exception );
};
NotifyBrokenPackage_Impl::NotifyBrokenPackage_Impl( OUString aName )
NotifyBrokenPackage_Impl::NotifyBrokenPackage_Impl( const OUString& aName )
{
OUString temp;
uno::Reference< uno::XInterface > temp2;
@ -1821,7 +1821,7 @@ uno::Sequence< uno::Reference< task::XInteractionContinuation > >
return m_lContinuations;
}
NotifyBrokenPackage::NotifyBrokenPackage( OUString aName )
NotifyBrokenPackage::NotifyBrokenPackage( const OUString& aName )
{
pImp = new NotifyBrokenPackage_Impl( aName );
pImp->acquire();

View File

@ -224,7 +224,7 @@ static void add_ugly_db_item( GtkMenuShell *pMenuShell, const char *pAsciiURL,
static GtkWidget *
add_image_menu_item( GtkMenuShell *pMenuShell,
const gchar *stock_id,
OUString aLabel,
const OUString& aLabel,
GCallback activate_cb )
{
OString aUtfLabel = OUStringToOString (aLabel, RTL_TEXTENCODING_UTF8 );

View File

@ -222,7 +222,7 @@ uno::Any CreateEventData_Impl( const SvxMacro *pMacro )
}
void PropagateEvent_Impl( SfxObjectShell *pDoc, OUString aEventName, const SvxMacro* pMacro )
void PropagateEvent_Impl( SfxObjectShell *pDoc, const OUString& aEventName, const SvxMacro* pMacro )
{
uno::Reference < document::XEventsSupplier > xSupplier;
if ( pDoc )
@ -263,7 +263,7 @@ void PropagateEvent_Impl( SfxObjectShell *pDoc, OUString aEventName, const SvxMa
}
void SfxEventConfiguration::ConfigureEvent( OUString aName, const SvxMacro& rMacro, SfxObjectShell *pDoc )
void SfxEventConfiguration::ConfigureEvent( const OUString& aName, const SvxMacro& rMacro, SfxObjectShell *pDoc )
{
boost::scoped_ptr<SvxMacro> pMacro;
if ( rMacro.HasMacro() )

View File

@ -824,7 +824,7 @@ bool TemplateLocalView::isTemplateNameUnique(const sal_uInt16 nRegionItemId, con
return true;
}
bool TemplateLocalView::renameItem(ThumbnailViewItem* pItem, OUString sNewTitle)
bool TemplateLocalView::renameItem(ThumbnailViewItem* pItem, const OUString& sNewTitle)
{
sal_uInt16 nRegionId = 0;
sal_uInt16 nDocId = USHRT_MAX;

View File

@ -1247,7 +1247,7 @@ void ThumbnailView::sortItems (const boost::function<bool (const ThumbnailViewIt
Invalidate();
}
bool ThumbnailView::renameItem(ThumbnailViewItem*, OUString)
bool ThumbnailView::renameItem(ThumbnailViewItem*, const OUString&)
{
// Do nothing by default
return false;

View File

@ -118,7 +118,7 @@ namespace sfx2
namespace
{
bool lclSupportsOOXMLEncryption(OUString aFilterName)
bool lclSupportsOOXMLEncryption(const OUString& aFilterName)
{
return aFilterName == "Calc MS Excel 2007 XML"
|| aFilterName == "MS Word 2007 XML"

View File

@ -490,7 +490,7 @@ handleError( ucb::InteractiveAugmentedIOException const & i_rException,
e.g. ODB files seem to only have content.xml */
static void
collectFilesFromStorage(uno::Reference<embed::XStorage> const& i_xStorage,
OUString i_Path,
const OUString& i_Path,
std::set< OUString > & o_rFiles)
{
static OUString content(s_content);
@ -587,7 +587,7 @@ importFile(struct DocumentMetadataAccess_Impl & i_rImpl,
uno::Reference<embed::XStorage> const & i_xStorage,
OUString const & i_rBaseURI,
uno::Reference<task::XInteractionHandler> const & i_xHandler,
OUString i_rPath)
const OUString& i_rPath)
{
retry:
try {

View File

@ -520,7 +520,7 @@ OUString SAL_CALL getNameSpace(const char* i_qname) throw ()
bool SAL_CALL
textToDateOrDateTime(css::util::Date & io_rd, css::util::DateTime & io_rdt,
bool & o_rIsDateTime, boost::optional<sal_Int16> & o_rTimeZone,
OUString i_text) throw ()
const OUString& i_text) throw ()
{
if (::sax::Converter::parseDateOrDateTime(
&io_rd, io_rdt, o_rIsDateTime, &o_rTimeZone, i_text)) {
@ -534,7 +534,7 @@ textToDateOrDateTime(css::util::Date & io_rd, css::util::DateTime & io_rdt,
// convert string to date/time
bool SAL_CALL
textToDateTime(css::util::DateTime & io_rdt, OUString i_text) throw ()
textToDateTime(css::util::DateTime & io_rdt, const OUString& i_text) throw ()
{
if (::sax::Converter::parseDateTime(io_rdt, 0, i_text)) {
return true;
@ -547,7 +547,7 @@ textToDateTime(css::util::DateTime & io_rdt, OUString i_text) throw ()
// convert string to date/time with default return value
css::util::DateTime SAL_CALL
textToDateTimeDefault(OUString i_text) throw ()
textToDateTimeDefault(const OUString& i_text) throw ()
{
css::util::DateTime dt;
static_cast<void> (textToDateTime(dt, i_text));

View File

@ -1352,9 +1352,10 @@ sal_Bool SfxStoringHelper::GUIStoreModel( uno::Reference< frame::XModel > xModel
const OUString& aSlotName,
uno::Sequence< beans::PropertyValue >& aArgsSequence,
sal_Bool bPreselectPassword,
OUString aSuggestedName,
const OUString& _aSuggestedName,
sal_uInt16 nDocumentSignatureState )
{
OUString aSuggestedName = _aSuggestedName;
ModelData_Impl aModelData( *this, xModel, aArgsSequence );
sal_Bool bDialogUsed = sal_False;
@ -1839,8 +1840,8 @@ void SfxStoringHelper::SetDocInfoState(
// static
sal_Bool SfxStoringHelper::WarnUnacceptableFormat( const uno::Reference< frame::XModel >& xModel,
OUString aOldUIName,
OUString /*aDefUIName*/,
const OUString& aOldUIName,
const OUString& /*aDefUIName*/,
sal_Bool /*bCanProceedFurther*/ )
{
if ( !SvtSaveOptions().IsWarnAlienFormat() )

View File

@ -213,9 +213,9 @@ bool GetEncryptionData_Impl( const SfxItemSet* pSet, uno::Sequence< beans::Named
sal_Bool SfxObjectShell::PutURLContentsToVersionStream_Impl(
OUString aURL,
const OUString& aURL,
const uno::Reference< embed::XStorage >& xDocStorage,
OUString aStreamName )
const OUString& aStreamName )
{
sal_Bool bResult = sal_False;
try

View File

@ -64,7 +64,7 @@ using namespace ::com::sun::star;
// TODO: move to a standard helper
bool isLocalFile_Impl( OUString aURL )
bool isLocalFile_Impl( const OUString& aURL )
{
OUString aSystemPath;

View File

@ -97,7 +97,7 @@ public:
NamePassRecord( const OUString& aName,
bool bHasMemoryList, const ::std::vector< OUString >& aMemoryList,
bool bHasPersistentList, const OUString aPersistentList )
bool bHasPersistentList, const OUString & aPersistentList )
: m_aName( aName )
, m_bHasMemPass( bHasMemoryList )
, m_bHasPersPass( bHasPersistentList )

View File

@ -112,7 +112,7 @@ uno::Sequence<beans::Property> SfxItemPropertyMap::getProperties() const
return m_pImpl->m_aPropSeq;
}
beans::Property SfxItemPropertyMap::getPropertyByName( const OUString rName ) const
beans::Property SfxItemPropertyMap::getPropertyByName( const OUString & rName ) const
throw( beans::UnknownPropertyException )
{
SfxItemPropertyHashMap_t::const_iterator aIter = m_pImpl->find(rName);

View File

@ -78,7 +78,7 @@ static OUString createIndex( vector< OUString > lines )
}
static vector< OUString > getInfoFromInd( OUString aInd )
static vector< OUString > getInfoFromInd( const OUString& aInd )
{
vector< OUString > aResult;
bool aStart = true;
@ -162,7 +162,7 @@ static OUString getAsciiLine( const ::rtl::ByteSequence& buf )
}
static ::rtl::ByteSequence getBufFromAsciiLine( OUString line )
static ::rtl::ByteSequence getBufFromAsciiLine( const OUString& line )
{
OSL_ENSURE( line.getLength() % 2 == 0, "Wrong syntax!\n" );
OString tmpLine = OUStringToOString( line, RTL_TEXTENCODING_ASCII_US );

View File

@ -1241,7 +1241,7 @@ OUString SfxListUndoAction::GetRepeatComment(SfxRepeatTarget &) const
SfxListUndoAction::SfxListUndoAction
(
const OUString &rComment,
const OUString rRepeatComment,
const OUString &rRepeatComment,
sal_uInt16 Id,
SfxUndoArray *pFather
)