diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-06-30 08:17:41 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-06-30 07:06:41 +0000 |
commit | 79e8a15ae49540ac107808b03328fad90557e381 (patch) | |
tree | 703e026bbdc723bd3e40233e56ec2691417e53cc | |
parent | fbd23182ee1804fd87a13d79a71e231549767408 (diff) |
RTF export: it's enough to pass these by const ref, no need to copy
Change-Id: I6854c3c8e9a2b5c6d478551c5f9bba19e114152c
Reviewed-on: https://gerrit.libreoffice.org/26787
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r-- | oox/source/shape/WpsContext.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.cxx | 3 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfexport.cxx | 16 |
3 files changed, 10 insertions, 11 deletions
diff --git a/oox/source/shape/WpsContext.cxx b/oox/source/shape/WpsContext.cxx index 15a102200ae3..d3beeb846499 100644 --- a/oox/source/shape/WpsContext.cxx +++ b/oox/source/shape/WpsContext.cxx @@ -181,7 +181,7 @@ oox::core::ContextHandlerRef WpsContext::onCreateContext(sal_Int32 nElementToken { uno::Reference<beans::XPropertySet> xPropertySet(mxShape, uno::UNO_QUERY); oox::OptValue<OUString> presetShapeName = rAttribs.getString(XML_prst); - OUString preset = presetShapeName.get(); + const OUString& preset = presetShapeName.get(); comphelper::SequenceAsHashMap aCustomShapeGeometry(xPropertySet->getPropertyValue("CustomShapeGeometry")); aCustomShapeGeometry["PresetTextWarp"] = uno::makeAny(preset); xPropertySet->setPropertyValue("CustomShapeGeometry", uno::makeAny(aCustomShapeGeometry.getAsConstPropertyValueList())); diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index e74fbcf28e7c..572afaa0cb45 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -1961,8 +1961,7 @@ void RtfAttributeOutput::OutputFlyFrame_Impl(const ww8::Frame& rFrame, const Poi { if (const SdrUnoObj* pFormObj = dynamic_cast< const SdrUnoObj*>(pObject)) { - uno::Reference< awt::XControlModel > xControlModel = - pFormObj->GetUnoControlModel(); + const uno::Reference<awt::XControlModel>& xControlModel = pFormObj->GetUnoControlModel(); uno::Reference< lang::XServiceInfo > xInfo(xControlModel, uno::UNO_QUERY); if (xInfo.is()) { diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index 1a772bf72772..9189cf7a9279 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -318,24 +318,24 @@ void RtfExport::DoComboBox(const OUString& /*rName*/, void RtfExport::DoFormText(const SwInputField* pField) { OUString sResult = pField->ExpandField(true); - OUString sHelp(pField->GetHelp()); + const OUString& rHelp = pField->GetHelp(); OUString sName = pField->GetPar2(); - OUString sStatus = pField->GetToolTip(); + const OUString& rStatus = pField->GetToolTip(); m_pAttrOutput->RunText().append("{" OOO_STRING_SVTOOLS_RTF_FIELD "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FLDINST "{ FORMTEXT }"); m_pAttrOutput->RunText().append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FORMFIELD " {" OOO_STRING_SVTOOLS_RTF_FFTYPE "0"); - if (!sHelp.isEmpty()) + if (!rHelp.isEmpty()) m_pAttrOutput->RunText().append(OOO_STRING_SVTOOLS_RTF_FFOWNHELP); - if (!sStatus.isEmpty()) + if (!rStatus.isEmpty()) m_pAttrOutput->RunText().append(OOO_STRING_SVTOOLS_RTF_FFOWNSTAT); m_pAttrOutput->RunText().append(OOO_STRING_SVTOOLS_RTF_FFTYPETXT "0"); if (!sName.isEmpty()) m_pAttrOutput->RunText().append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFNAME " ").append(msfilter::rtfutil::OutString(sName, m_eDefaultEncoding)).append("}"); - if (!sHelp.isEmpty()) - m_pAttrOutput->RunText().append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFHELPTEXT " ").append(msfilter::rtfutil::OutString(sHelp, m_eDefaultEncoding)).append("}"); + if (!rHelp.isEmpty()) + m_pAttrOutput->RunText().append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFHELPTEXT " ").append(msfilter::rtfutil::OutString(rHelp, m_eDefaultEncoding)).append("}"); m_pAttrOutput->RunText().append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFDEFTEXT " ").append(msfilter::rtfutil::OutString(sResult, m_eDefaultEncoding)).append("}"); - if (!sStatus.isEmpty()) - m_pAttrOutput->RunText().append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFSTATTEXT " ").append(msfilter::rtfutil::OutString(sStatus, m_eDefaultEncoding)).append("}"); + if (!rStatus.isEmpty()) + m_pAttrOutput->RunText().append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFSTATTEXT " ").append(msfilter::rtfutil::OutString(rStatus, m_eDefaultEncoding)).append("}"); m_pAttrOutput->RunText().append("}}}{" OOO_STRING_SVTOOLS_RTF_FLDRSLT " "); m_pAttrOutput->RunText().append(msfilter::rtfutil::OutString(sResult, m_eDefaultEncoding)).append("}}"); } |