summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-04-12 16:39:03 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-04-18 07:37:31 +0000
commit789055bc2acb4c71483fd60ea258d158bd5aec10 (patch)
tree7849de841a71f667a30b2a971ad0c3d406110396
parent150ac9cf05ed9da6a2af5bc3f820280fd853e519 (diff)
clang-tidy performance-unnecessary-copy-initialization
probably not much performance benefit, but it sure is good at identifying leftover intermediate variables from previous refactorings. Change-Id: I3ce16fe496ac2733c1cb0a35f74c0fc9193cc657 Reviewed-on: https://gerrit.libreoffice.org/24026 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r--basctl/source/basicide/basides1.cxx16
-rw-r--r--basegfx/source/curve/b2dbeziertools.cxx2
-rw-r--r--basic/source/sbx/sbxscan.cxx2
-rw-r--r--connectivity/source/commontools/predicateinput.cxx8
-rw-r--r--connectivity/source/drivers/mork/MConnection.cxx4
-rw-r--r--cppcanvas/source/mtfrenderer/implrenderer.cxx3
-rw-r--r--cui/source/customize/cfg.cxx2
-rw-r--r--cui/source/customize/macropg.cxx5
-rw-r--r--cui/source/dialogs/about.cxx2
-rw-r--r--cui/source/dialogs/cuigaldlg.cxx3
-rw-r--r--cui/source/options/optopencl.cxx2
-rw-r--r--cui/source/options/treeopt.cxx3
-rw-r--r--cui/source/tabpages/backgrnd.cxx4
-rw-r--r--cui/source/tabpages/paragrph.cxx2
-rw-r--r--dbaccess/source/core/dataaccess/databasecontext.cxx2
-rw-r--r--dbaccess/source/core/misc/dsntypes.cxx16
-rw-r--r--dbaccess/source/core/recovery/subcomponentrecovery.cxx2
-rw-r--r--dbaccess/source/ui/app/AppDetailPageHelper.cxx3
-rw-r--r--dbaccess/source/ui/browser/unodatbr.cxx7
-rw-r--r--dbaccess/source/ui/control/SqlNameEdit.cxx9
-rw-r--r--dbaccess/source/ui/dlg/dbwizsetup.cxx5
-rw-r--r--dbaccess/source/ui/misc/UITools.cxx7
-rw-r--r--dbaccess/source/ui/misc/indexcollection.cxx16
-rw-r--r--dbaccess/source/ui/querydesign/QueryDesignView.cxx17
-rw-r--r--dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx7
-rw-r--r--dbaccess/source/ui/querydesign/limitboxcontroller.cxx3
-rw-r--r--dbaccess/source/ui/querydesign/querycontroller.cxx3
-rw-r--r--desktop/source/app/sofficemain.cxx2
-rw-r--r--desktop/source/deployment/misc/dp_misc.cxx3
-rw-r--r--desktop/source/lib/init.cxx2
-rw-r--r--drawinglayer/source/primitive2d/metafileprimitive2d.cxx4
-rw-r--r--drawinglayer/source/primitive2d/sceneprimitive2d.cxx2
-rw-r--r--drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx2
-rw-r--r--drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx2
-rw-r--r--drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx5
-rw-r--r--drawinglayer/source/processor2d/vclpixelprocessor2d.cxx2
-rw-r--r--drawinglayer/source/processor3d/cutfindprocessor3d.cxx2
-rw-r--r--drawinglayer/source/processor3d/defaultprocessor3d.cxx4
-rw-r--r--drawinglayer/source/processor3d/geometry2dextractor.cxx2
-rw-r--r--drawinglayer/source/tools/converters.cxx3
-rw-r--r--editeng/source/editeng/eehtml.cxx5
-rw-r--r--editeng/source/editeng/impedit3.cxx13
-rw-r--r--editeng/source/misc/svxacorr.cxx20
-rw-r--r--extensions/source/bibliography/bibload.cxx10
-rw-r--r--extensions/source/bibliography/toolbar.cxx3
-rw-r--r--extensions/source/propctrlr/eformspropertyhandler.cxx2
-rw-r--r--extensions/source/propctrlr/stringrepresentation.cxx13
-rw-r--r--extensions/source/resource/oooresourceloader.cxx3
-rw-r--r--filter/source/config/cache/cacheitem.cxx4
-rw-r--r--filter/source/flash/swfwriter1.cxx3
-rw-r--r--filter/source/msfilter/escherex.cxx7
-rw-r--r--filter/source/msfilter/msdffimp.cxx4
-rw-r--r--filter/source/svg/svgfontexport.cxx2
-rw-r--r--filter/source/svg/svgreader.cxx5
-rw-r--r--filter/source/svg/svgwriter.cxx18
-rw-r--r--filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx5
-rw-r--r--formula/source/ui/dlg/FormulaHelper.cxx3
-rw-r--r--formula/source/ui/dlg/funcpage.cxx4
-rw-r--r--framework/inc/uielement/toolbarmerger.hxx12
-rw-r--r--framework/source/dispatch/dispatchprovider.cxx22
-rw-r--r--framework/source/fwe/classes/addonsoptions.cxx14
-rw-r--r--framework/source/fwe/xml/menudocumenthandler.cxx15
-rw-r--r--framework/source/layoutmanager/layoutmanager.cxx10
-rw-r--r--framework/source/layoutmanager/toolbarlayoutmanager.cxx11
-rw-r--r--framework/source/services/pathsettings.cxx3
-rw-r--r--framework/source/uielement/menubarmanager.cxx3
-rw-r--r--framework/source/uielement/toolbarmanager.cxx6
-rw-r--r--framework/source/uielement/toolbarmerger.cxx38
-rw-r--r--i18npool/source/search/textsearch.cxx50
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/util.cxx3
-rw-r--r--lingucomponent/source/spellcheck/spell/sspellimp.cxx3
-rw-r--r--linguistic/source/dicimp.cxx26
-rw-r--r--linguistic/source/lngsvcmgr.cxx12
-rw-r--r--linguistic/source/misc.cxx5
-rw-r--r--oox/source/drawingml/shape3dproperties.cxx2
-rw-r--r--oox/source/ole/axcontrol.cxx32
-rw-r--r--reportdesign/source/core/api/ReportDefinition.cxx3
-rw-r--r--reportdesign/source/filter/xml/xmlExport.cxx2
-rw-r--r--sc/source/core/data/document.cxx4
-rw-r--r--sc/source/core/data/global2.cxx13
-rw-r--r--sc/source/core/tool/addincol.cxx6
-rw-r--r--sc/source/core/tool/compiler.cxx7
-rw-r--r--sc/source/core/tool/editutil.cxx2
-rw-r--r--sc/source/core/tool/queryparam.cxx31
-rw-r--r--sc/source/core/tool/userlist.cxx3
-rw-r--r--sc/source/filter/excel/xehelper.cxx16
-rw-r--r--sc/source/filter/excel/xihelper.cxx2
-rw-r--r--sc/source/filter/html/htmlexp.cxx9
-rw-r--r--sc/source/filter/xcl97/xcl97rec.cxx2
-rw-r--r--sc/source/filter/xml/xmlimprt.cxx11
-rw-r--r--sc/source/ui/condformat/condformatmgr.cxx2
-rw-r--r--sc/source/ui/docshell/docfunc.cxx2
-rw-r--r--sc/source/ui/docshell/docsh.cxx6
-rw-r--r--sc/source/ui/docshell/docsh6.cxx6
-rw-r--r--sc/source/ui/docshell/docsh8.cxx5
-rw-r--r--sc/source/ui/undo/undostyl.cxx4
-rw-r--r--sc/source/ui/unoobj/addruno.cxx25
-rw-r--r--sc/source/ui/unoobj/afmtuno.cxx29
-rw-r--r--sc/source/ui/unoobj/appluno.cxx77
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx56
-rw-r--r--sc/source/ui/unoobj/dapiuno.cxx123
-rw-r--r--sc/source/ui/unoobj/datauno.cxx141
-rw-r--r--sc/source/ui/unoobj/docuno.cxx193
-rw-r--r--sc/source/ui/unoobj/fmtuno.cxx52
-rw-r--r--sc/source/ui/unoobj/funcuno.cxx2
-rw-r--r--sc/source/ui/unoobj/linkuno.cxx72
-rw-r--r--sc/source/ui/unoobj/shapeuno.cxx45
-rw-r--r--sc/source/ui/unoobj/srchuno.cxx64
-rw-r--r--sc/source/ui/unoobj/styleuno.cxx22
-rw-r--r--sc/source/ui/unoobj/targuno.cxx11
-rw-r--r--sc/source/ui/unoobj/textuno.cxx3
-rw-r--r--sc/source/ui/unoobj/tokenuno.cxx26
-rw-r--r--sc/source/ui/unoobj/viewuno.cxx86
-rw-r--r--sc/source/ui/vba/vbarange.cxx11
-rw-r--r--sc/source/ui/view/viewdata.cxx5
-rw-r--r--sc/source/ui/view/viewfun2.cxx3
-rw-r--r--scripting/source/dlgprov/dlgevtatt.cxx9
-rw-r--r--sd/source/core/CustomAnimationEffect.cxx7
-rw-r--r--sd/source/core/drawdoc2.cxx5
-rw-r--r--sd/source/filter/xml/sdtransform.cxx2
-rw-r--r--sd/source/ui/animations/SlideTransitionPane.cxx3
-rw-r--r--sd/source/ui/app/sdmod1.cxx8
-rw-r--r--sd/source/ui/dlg/navigatr.cxx2
-rw-r--r--sd/source/ui/docshell/docshel4.cxx13
-rw-r--r--sd/source/ui/slideshow/slideshow.cxx6
-rw-r--r--sd/source/ui/slidesorter/controller/SlideSorterController.cxx3
-rw-r--r--sd/source/ui/slidesorter/view/SlideSorterView.cxx9
-rw-r--r--sd/source/ui/unoidl/unocpres.cxx6
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx6
-rw-r--r--sd/source/ui/unoidl/unoobj.cxx8
-rw-r--r--sd/source/ui/unoidl/unopage.cxx7
-rw-r--r--sd/source/ui/view/drviews3.cxx5
-rw-r--r--sd/source/ui/view/sdview.cxx3
-rw-r--r--sdext/source/minimizer/impoptimizer.cxx2
-rw-r--r--sfx2/source/appl/appopen.cxx2
-rw-r--r--sfx2/source/appl/linkmgr2.cxx7
-rw-r--r--sfx2/source/appl/macroloader.cxx2
-rw-r--r--sfx2/source/bastyp/frmhtml.cxx6
-rw-r--r--sfx2/source/control/templatelocalview.cxx6
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx2
-rw-r--r--sfx2/source/dialog/filedlghelper.cxx4
-rw-r--r--sfx2/source/dialog/filtergrouping.cxx4
-rw-r--r--sfx2/source/dialog/srchdlg.cxx5
-rw-r--r--sfx2/source/doc/objmisc.cxx2
-rw-r--r--sfx2/source/doc/printhelper.cxx2
-rw-r--r--slideshow/source/engine/slide/layer.cxx2
-rw-r--r--starmath/source/symbol.cxx2
-rw-r--r--stoc/source/implementationregistration/implreg.cxx15
-rw-r--r--stoc/source/typeconv/convert.cxx4
-rw-r--r--svl/source/numbers/zformat.cxx27
-rw-r--r--svtools/source/brwbox/brwbox1.cxx3
-rw-r--r--svtools/source/graphic/grfcache.cxx2
-rw-r--r--svtools/source/graphic/grfmgr.cxx8
-rw-r--r--svtools/source/graphic/grfmgr2.cxx13
-rw-r--r--svtools/source/misc/templatefoldercache.cxx2
-rw-r--r--svtools/source/misc/transfer2.cxx3
-rw-r--r--svtools/source/uno/unoevent.cxx6
-rw-r--r--svx/source/core/extedit.cxx2
-rw-r--r--svx/source/core/graphichelper.cxx3
-rw-r--r--svx/source/dialog/fntctrl.cxx4
-rw-r--r--svx/source/engine3d/dragmt3d.cxx10
-rw-r--r--svx/source/engine3d/helperhittest3d.cxx2
-rw-r--r--svx/source/engine3d/helperminimaldepth3d.cxx2
-rw-r--r--svx/source/engine3d/obj3d.cxx4
-rw-r--r--svx/source/engine3d/scene3d.cxx2
-rw-r--r--svx/source/engine3d/view3d.cxx5
-rw-r--r--svx/source/fmcomp/dbaexchange.cxx3
-rw-r--r--svx/source/fmcomp/fmgridif.cxx5
-rw-r--r--svx/source/form/navigatortree.cxx2
-rw-r--r--svx/source/gallery2/galbrws1.cxx3
-rw-r--r--svx/source/gallery2/galbrws2.cxx2
-rw-r--r--svx/source/gallery2/gallery1.cxx4
-rw-r--r--svx/source/gallery2/galmisc.cxx8
-rw-r--r--svx/source/gallery2/galtheme.cxx3
-rw-r--r--svx/source/sdr/contact/viewcontactofe3dscene.cxx6
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx6
-rw-r--r--svx/source/svdraw/svdedtv1.cxx5
-rw-r--r--svx/source/svdraw/svdmodel.cxx2
-rw-r--r--svx/source/svdraw/svdoashp.cxx17
-rw-r--r--svx/source/svdraw/svdomedia.cxx2
-rw-r--r--svx/source/svdraw/svdtrans.cxx2
-rw-r--r--svx/source/tbxctrls/PaletteManager.cxx2
-rw-r--r--svx/source/tbxctrls/lboxctrl.cxx2
-rw-r--r--svx/source/tbxctrls/tbunocontroller.cxx3
-rw-r--r--svx/source/tbxctrls/tbunosearchcontrollers.cxx9
-rw-r--r--svx/source/unodraw/UnoGraphicExporter.cxx6
-rw-r--r--svx/source/unodraw/unomod.cxx5
-rw-r--r--svx/source/unodraw/unomtabl.cxx22
-rw-r--r--svx/source/unodraw/unoshape.cxx3
-rw-r--r--svx/source/xml/xmlgrhlp.cxx16
-rw-r--r--svx/source/xoutdev/_xoutbmp.cxx2
-rw-r--r--sw/source/core/doc/acmplwrd.cxx4
-rw-r--r--sw/source/core/doc/dbgoutsw.cxx2
-rw-r--r--sw/source/core/doc/doccorr.cxx1
-rw-r--r--sw/source/core/doc/docedt.cxx2
-rw-r--r--sw/source/core/doc/doctxm.cxx2
-rw-r--r--sw/source/core/doc/extinput.cxx2
-rw-r--r--sw/source/core/doc/number.cxx4
-rw-r--r--sw/source/core/docnode/node.cxx3
-rw-r--r--sw/source/core/docnode/nodes.cxx3
-rw-r--r--sw/source/core/edit/edlingu.cxx4
-rw-r--r--sw/source/core/frmedt/fews.cxx2
-rw-r--r--sw/source/core/layout/paintfrm.cxx21
-rw-r--r--sw/source/core/swg/SwXMLTextBlocks1.cxx5
-rw-r--r--sw/source/core/text/txtfly.cxx2
-rw-r--r--sw/source/core/text/xmldump.cxx4
-rw-r--r--sw/source/core/txtnode/txtatr2.cxx2
-rw-r--r--sw/source/core/txtnode/txtedt.cxx13
-rw-r--r--sw/source/core/unocore/unoflatpara.cxx6
-rw-r--r--sw/source/core/unocore/unosett.cxx3
-rw-r--r--sw/source/filter/html/css1atr.cxx2
-rw-r--r--sw/source/filter/html/htmlatr.cxx2
-rw-r--r--sw/source/filter/html/htmlforw.cxx6
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx23
-rw-r--r--sw/source/filter/ww8/docxsdrexport.cxx8
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx5
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx2
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx6
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx6
-rw-r--r--sw/source/filter/ww8/ww8par.cxx2
-rw-r--r--sw/source/filter/xml/xmlimp.cxx2
-rw-r--r--sw/source/ui/misc/glossary.cxx5
-rw-r--r--sw/source/ui/vba/vbabookmarks.cxx9
-rw-r--r--sw/source/ui/vba/vbafield.cxx3
-rw-r--r--sw/source/ui/vba/vbatablehelper.cxx10
-rw-r--r--sw/source/uibase/dbui/dbmgr.cxx14
-rw-r--r--sw/source/uibase/envelp/labelcfg.cxx5
-rw-r--r--sw/source/uibase/fldui/fldmgr.cxx7
-rw-r--r--sw/source/uibase/fldui/xfldui.cxx3
-rw-r--r--sw/source/uibase/misc/glosdoc.cxx3
-rw-r--r--sw/source/uibase/misc/redlndlg.cxx4
-rw-r--r--sw/source/uibase/shells/textsh1.cxx2
-rw-r--r--sw/source/uibase/sidebar/ThemePanel.cxx2
-rw-r--r--sw/source/uibase/uiview/viewprt.cxx2
-rw-r--r--sw/source/uibase/uiview/viewtab.cxx2
-rw-r--r--sw/source/uibase/uno/unoatxt.cxx4
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx44
-rw-r--r--sw/source/uibase/uno/unotxvw.cxx2
-rw-r--r--sw/source/uibase/utlui/content.cxx2
-rw-r--r--toolkit/source/awt/stylesettings.cxx10
-rw-r--r--toolkit/source/awt/vclxfont.cxx3
-rw-r--r--toolkit/source/awt/vclxwindows.cxx3
-rw-r--r--toolkit/source/controls/controlmodelcontainerbase.cxx2
-rw-r--r--toolkit/source/controls/eventcontainer.cxx4
-rw-r--r--toolkit/source/controls/unocontrolbase.cxx2
-rw-r--r--toolkit/source/controls/unocontrolmodel.cxx4
-rw-r--r--toolkit/source/controls/unocontrols.cxx6
-rw-r--r--toolkit/source/helper/listenermultiplexer.cxx3
-rw-r--r--tools/source/datetime/datetimeutils.cxx2
-rw-r--r--ucb/source/ucp/webdav-neon/webdavcontent.cxx3
-rw-r--r--vcl/source/control/edit.cxx2
-rw-r--r--vcl/source/control/field2.cxx5
-rw-r--r--vcl/source/filter/graphicfilter.cxx9
-rw-r--r--vcl/source/filter/wmf/emfwr.cxx2
-rw-r--r--vcl/source/font/fontcache.cxx2
-rw-r--r--vcl/source/gdi/salgdilayout.cxx12
-rw-r--r--vcl/source/outdev/map.cxx4
-rw-r--r--vcl/source/outdev/mask.cxx2
-rw-r--r--vcl/source/outdev/polygon.cxx2
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx2
-rw-r--r--xmlhelp/source/cxxhelp/provider/databases.cxx7
-rw-r--r--xmlhelp/source/treeview/tvread.cxx36
-rw-r--r--xmloff/source/chart/SchXMLChartContext.cxx2
-rw-r--r--xmloff/source/core/nmspmap.cxx4
-rw-r--r--xmloff/source/core/xmlexp.cxx2
-rw-r--r--xmloff/source/core/xmlimp.cxx4
-rw-r--r--xmloff/source/draw/shapeexport.cxx2
-rw-r--r--xmloff/source/style/GradientStyle.cxx5
-rw-r--r--xmloff/source/style/MarkerStyle.cxx5
-rw-r--r--xmloff/source/style/xmlaustp.cxx8
-rw-r--r--xmloff/source/text/XMLTextFrameContext.cxx2
-rw-r--r--xmloff/source/text/XMLTextListItemContext.cxx2
-rw-r--r--xmloff/source/text/txtparae.cxx8
-rw-r--r--xmloff/source/transform/DlgOASISTContext.cxx8
-rw-r--r--xmloff/source/transform/EventOASISTContext.cxx4
-rw-r--r--xmloff/source/transform/EventOOoTContext.cxx2
-rw-r--r--xmloff/source/transform/OOo2Oasis.cxx9
-rw-r--r--xmloff/source/transform/Oasis2OOo.cxx10
-rw-r--r--xmloff/source/transform/PersAttrListTContext.cxx4
-rw-r--r--xmloff/source/transform/StyleOASISTContext.cxx6
-rw-r--r--xmloff/source/transform/StyleOOoTContext.cxx12
-rw-r--r--xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx7
282 files changed, 1151 insertions, 1524 deletions
diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx
index 23e25cb7a3ea..926c9ad4f918 100644
--- a/basctl/source/basicide/basides1.cxx
+++ b/basctl/source/basicide/basides1.cxx
@@ -304,7 +304,7 @@ void Shell::ExecuteGlobal( SfxRequest& rReq )
{
if ( !rInfo.GetModule().isEmpty() || pBasic->GetModules().empty() )
{
- OUString aModName = rInfo.GetModule();
+ const OUString& aModName = rInfo.GetModule();
OUString sModuleCode;
if ( aDocument.createModule( aLibName, aModName, false, sModuleCode ) )
@@ -505,9 +505,9 @@ void Shell::ExecuteGlobal( SfxRequest& rReq )
{
DBG_ASSERT( rReq.GetArgs(), "arguments expected" );
const SbxItem& rSbxItem = static_cast<const SbxItem&>(rReq.GetArgs()->Get(SID_BASICIDE_ARG_SBX ));
- ScriptDocument aDocument( rSbxItem.GetDocument() );
- OUString aLibName( rSbxItem.GetLibName() );
- OUString aName( rSbxItem.GetName() );
+ const ScriptDocument& aDocument( rSbxItem.GetDocument() );
+ const OUString& aLibName( rSbxItem.GetLibName() );
+ const OUString& aName( rSbxItem.GetName() );
if ( m_aCurLibName.isEmpty() || ( aDocument == m_aCurDocument && aLibName == m_aCurLibName ) )
{
if ( rSbxItem.GetType() == TYPE_MODULE )
@@ -521,7 +521,7 @@ void Shell::ExecuteGlobal( SfxRequest& rReq )
{
DBG_ASSERT( rReq.GetArgs(), "arguments expected" );
const SbxItem& rSbxItem = static_cast<const SbxItem&>(rReq.GetArgs()->Get(SID_BASICIDE_ARG_SBX ));
- ScriptDocument aDocument( rSbxItem.GetDocument() );
+ const ScriptDocument& aDocument( rSbxItem.GetDocument() );
BaseWindow* pWin = FindWindow( aDocument, rSbxItem.GetLibName(), rSbxItem.GetName(), rSbxItem.GetType(), true );
if ( pWin )
RemoveWindow( pWin, true );
@@ -531,9 +531,9 @@ void Shell::ExecuteGlobal( SfxRequest& rReq )
{
DBG_ASSERT( rReq.GetArgs(), "arguments expected" );
const SbxItem& rSbxItem = static_cast<const SbxItem&>(rReq.GetArgs()->Get(SID_BASICIDE_ARG_SBX ));
- ScriptDocument aDocument( rSbxItem.GetDocument() );
- OUString aLibName( rSbxItem.GetLibName() );
- OUString aName( rSbxItem.GetName() );
+ const ScriptDocument& aDocument( rSbxItem.GetDocument() );
+ const OUString& aLibName( rSbxItem.GetLibName() );
+ const OUString& aName( rSbxItem.GetName() );
SetCurLib( aDocument, aLibName );
BaseWindow* pWin = nullptr;
if ( rSbxItem.GetType() == TYPE_DIALOG )
diff --git a/basegfx/source/curve/b2dbeziertools.cxx b/basegfx/source/curve/b2dbeziertools.cxx
index 58d1f1e14f7a..d1e98c980f8e 100644
--- a/basegfx/source/curve/b2dbeziertools.cxx
+++ b/basegfx/source/curve/b2dbeziertools.cxx
@@ -64,7 +64,7 @@ namespace basegfx
}
else
{
- const B2DPoint aLastNext(rBase.getEndPoint());
+ const B2DPoint& aLastNext(rBase.getEndPoint());
const B2DVector aLastEdge(aLastNext - aNext);
fLength += aLastEdge.getLength();
diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx
index 3aac5c637cd5..bf681897c491 100644
--- a/basic/source/sbx/sbxscan.cxx
+++ b/basic/source/sbx/sbxscan.cxx
@@ -825,7 +825,7 @@ void SbxValue::Format( OUString& rRes, const OUString* pFmt ) const
const LocaleDataWrapper& rData = aSysLocale.GetLocaleData();
sal_Unicode cComma = rData.getNumDecimalSep()[0];
sal_Unicode c1000 = rData.getNumThousandSep()[0];
- OUString aCurrencyStrg = rData.getCurrSymbol();
+ const OUString& aCurrencyStrg = rData.getCurrSymbol();
// initialize the Basic-formater help object:
// get resources for predefined output
diff --git a/connectivity/source/commontools/predicateinput.cxx b/connectivity/source/commontools/predicateinput.cxx
index 29119e7da367..c32f225c0436 100644
--- a/connectivity/source/commontools/predicateinput.cxx
+++ b/connectivity/source/commontools/predicateinput.cxx
@@ -279,13 +279,11 @@ namespace dbtools
OUString sReturn;
if ( _rxField.is() )
{
- OUString sValue( _rPredicateValue );
-
// The following is mostly stolen from the former implementation in the parameter dialog
// (dbaccess/source/ui/dlg/paramdialog.cxx). I do not fully understand this .....
OUString sError;
- OSQLParseNode* pParseNode = implPredicateTree( sError, sValue, _rxField );
+ OSQLParseNode* pParseNode = implPredicateTree( sError, _rPredicateValue, _rxField );
implParseNode(pParseNode, true) >>= sReturn;
}
@@ -353,13 +351,11 @@ namespace dbtools
if ( _rxField.is() )
{
- OUString sValue( _rPredicateValue );
-
// The following is mostly stolen from the former implementation in the parameter dialog
// (dbaccess/source/ui/dlg/paramdialog.cxx). I do not fully understand this .....
OUString sError;
- OSQLParseNode* pParseNode = implPredicateTree( sError, sValue, _rxField );
+ OSQLParseNode* pParseNode = implPredicateTree( sError, _rPredicateValue, _rxField );
return implParseNode(pParseNode, false);
}
diff --git a/connectivity/source/drivers/mork/MConnection.cxx b/connectivity/source/drivers/mork/MConnection.cxx
index c034f1613520..688da518f2fb 100644
--- a/connectivity/source/drivers/mork/MConnection.cxx
+++ b/connectivity/source/drivers/mork/MConnection.cxx
@@ -382,7 +382,7 @@ void OConnection::throwSQLException( const ErrorDescriptor& _rError, const Refer
OSL_ENSURE( ( _rError.getErrorCondition() == 0 ),
"OConnection::throwSQLException: unsupported error code combination!" );
- OUString sParameter( _rError.getParameter() );
+ const OUString& sParameter( _rError.getParameter() );
if ( !sParameter.isEmpty() )
{
const OUString sError( getResources().getResourceStringWithSubstitution(
@@ -400,7 +400,7 @@ void OConnection::throwSQLException( const ErrorDescriptor& _rError, const Refer
if ( _rError.getErrorCondition() != 0 )
{
SQLError aErrorHelper( comphelper::getComponentContext(getDriver()->getFactory()) );
- OUString sParameter( _rError.getParameter() );
+ const OUString& sParameter( _rError.getParameter() );
if ( !sParameter.isEmpty() )
aErrorHelper.raiseException( _rError.getErrorCondition(), _rxContext, sParameter );
else
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index 15f4ce83ac77..8d2b32ddc0f3 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -1051,7 +1051,6 @@ namespace cppcanvas
bool bIntersect )
{
::cppcanvas::internal::OutDevState& rState( rParms.mrStates.getState() );
- ::basegfx::B2DPolyPolygon aClipPoly( rClipPoly );
const bool bEmptyClipRect( rState.clipRect.IsEmpty() );
const bool bEmptyClipPoly( rState.clip.count() == 0 );
@@ -1086,7 +1085,7 @@ namespace cppcanvas
// AW: Simplified
rState.clip = basegfx::tools::clipPolyPolygonOnPolyPolygon(
- aClipPoly, rState.clip, true, false);
+ rClipPoly, rState.clip, true, false);
}
// by now, our clip resides in the OutDevState::clip
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 8f5c1c4c5395..f995d46017ce 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -1520,7 +1520,7 @@ bool ContextMenuSaveInData::Apply()
css::uno::Reference< css::lang::XSingleComponentFactory > xFactory( xIndexContainer, css::uno::UNO_QUERY );
ApplyMenu( xIndexContainer, xFactory, pEntry );
- OUString aUrl = pEntry->GetCommand();
+ const OUString& aUrl = pEntry->GetCommand();
try
{
if ( GetConfigManager()->hasSettings( aUrl ) )
diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx
index efffa6716992..cbeb45adba8c 100644
--- a/cui/source/customize/macropg.cxx
+++ b/cui/source/customize/macropg.cxx
@@ -466,10 +466,9 @@ IconLBoxString::IconLBoxString( const OUString& sText,
void IconLBoxString::Paint(const Point& aPos, SvTreeListBox& /*aDevice*/, vcl::RenderContext& rRenderContext,
const SvViewDataEntry* /*pView*/, const SvTreeListEntry& /*rEntry*/)
{
- OUString aTxt(GetText());
- if (!aTxt.isEmpty())
+ OUString aURL(GetText());
+ if (!aURL.isEmpty())
{
- OUString aURL(aTxt);
sal_Int32 nIndex = aURL.indexOf(aVndSunStarUNO);
bool bUNO = nIndex == 0;
diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index f26a1761ca2a..de838b0d2bf5 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -160,7 +160,7 @@ void AboutDialog::StyleControls()
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
- vcl::Font aLabelFont = rStyleSettings.GetLabelFont();
+ const vcl::Font& aLabelFont = rStyleSettings.GetLabelFont();
vcl::Font aLargeFont = aLabelFont;
aLargeFont.SetFontSize(Size( 0, aLabelFont.GetFontSize().Height() * 3));
diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx
index 92d542389383..6175603eccdc 100644
--- a/cui/source/dialogs/cuigaldlg.cxx
+++ b/cui/source/dialogs/cuigaldlg.cxx
@@ -831,9 +831,8 @@ OUString TPGalleryThemeProperties::addExtension( const OUString& _rDisplayText,
if ( sRet.indexOf( sAllFilter ) == -1 )
{
- OUString sExt = _rExtension;
sRet += sOpenBracket;
- sRet += sExt;
+ sRet += _rExtension;
sRet += sCloseBracket;
}
return sRet;
diff --git a/cui/source/options/optopencl.cxx b/cui/source/options/optopencl.cxx
index db1470e290c7..250cae9b6ad5 100644
--- a/cui/source/options/optopencl.cxx
+++ b/cui/source/options/optopencl.cxx
@@ -373,7 +373,7 @@ long SvxOpenCLTabPage::DeleteHdl(SvSimpleTable* pListBox, OpenCLConfig::ImplMatc
if (!pListBox->FirstSelected())
return 0;
- OpenCLConfig::ImplMatcher rEntry(findCurrentEntry(rSet, pListBox));
+ const OpenCLConfig::ImplMatcher& rEntry(findCurrentEntry(rSet, pListBox));
rSet.erase(rEntry);
fillListBox(pListBox, rSet);
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 8357b71482c4..536f0b45894c 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -2068,7 +2068,6 @@ VectorOfNodes OfaTreeOptionsDialog::LoadNodes(
static sal_uInt16 lcl_getGroupId( const OUString& rGroupName, const SvTreeListBox& rTreeLB )
{
- OUString sGroupName( rGroupName );
sal_uInt16 nRet = 0;
SvTreeListEntry* pEntry = rTreeLB.First();
while( pEntry )
@@ -2076,7 +2075,7 @@ static sal_uInt16 lcl_getGroupId( const OUString& rGroupName, const SvTreeListBo
if ( !rTreeLB.GetParent( pEntry ) )
{
OUString sTemp( rTreeLB.GetEntryText( pEntry ) );
- if ( sTemp == sGroupName )
+ if ( sTemp == rGroupName )
return nRet;
nRet++;
}
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index 2256096cd2bc..aa9c595d3eb2 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -1443,8 +1443,8 @@ void SvxBackgroundTabPage::FillControls_Impl( const SvxBrushItem& rBgdAttr,
}
else
{
- const OUString aStrLink = rBgdAttr.GetGraphicLink();
- const OUString aStrFilter = rBgdAttr.GetGraphicFilter();
+ const OUString& aStrLink = rBgdAttr.GetGraphicLink();
+ const OUString& aStrFilter = rBgdAttr.GetGraphicFilter();
lcl_setFillStyle(m_pLbSelect, drawing::FillStyle_BITMAP);
ShowBitmapUI_Impl();
diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index 49bbfeb5c99c..a85ec88437d0 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -1615,7 +1615,7 @@ void SvxExtParagraphTabPage::Reset( const SfxItemSet* rSet )
const SvxPageModelItem& rModel =
static_cast<const SvxPageModelItem&>(rSet->Get( _nWhich ));
- OUString aStr( rModel.GetValue() );
+ const OUString& aStr( rModel.GetValue() );
if ( !aStr.isEmpty() &&
m_pApplyCollBox->GetEntryPos( aStr ) != LISTBOX_ENTRY_NOTFOUND )
diff --git a/dbaccess/source/core/dataaccess/databasecontext.cxx b/dbaccess/source/core/dataaccess/databasecontext.cxx
index a82d2273ae07..9c28241fba3d 100644
--- a/dbaccess/source/core/dataaccess/databasecontext.cxx
+++ b/dbaccess/source/core/dataaccess/databasecontext.cxx
@@ -697,7 +697,7 @@ void ODatabaseContext::registerDatabaseDocument( ODatabaseModelImpl& _rModelImpl
void ODatabaseContext::revokeDatabaseDocument( const ODatabaseModelImpl& _rModelImpl )
{
- OUString sURL( _rModelImpl.getURL() );
+ const OUString& sURL( _rModelImpl.getURL() );
SAL_INFO("dbaccess.core", "DatabaseContext: deregistering " << sURL);
m_aDatabaseObjects.erase( sURL );
}
diff --git a/dbaccess/source/core/misc/dsntypes.cxx b/dbaccess/source/core/misc/dsntypes.cxx
index 54494f171498..a3f8039d8a6f 100644
--- a/dbaccess/source/core/misc/dsntypes.cxx
+++ b/dbaccess/source/core/misc/dsntypes.cxx
@@ -84,7 +84,6 @@ OUString ODsnTypeCollection::getTypeDisplayName(const OUString& _sURL) const
OUString ODsnTypeCollection::cutPrefix(const OUString& _sURL) const
{
- OUString sURL( _sURL);
OUString sRet;
OUString sOldPattern;
StringVector::const_iterator aIter = m_aDsnPrefixes.begin();
@@ -99,8 +98,8 @@ OUString ODsnTypeCollection::cutPrefix(const OUString& _sURL) const
// foo*
// that is, the very concept of "prefix" applies.
OUString prefix(comphelper::string::stripEnd(*aIter, '*'));
- OSL_ENSURE(prefix.getLength() <= sURL.getLength(), "How can A match B when A shorter than B?");
- sRet = sURL.copy(prefix.getLength());
+ OSL_ENSURE(prefix.getLength() <= _sURL.getLength(), "How can A match B when A shorter than B?");
+ sRet = _sURL.copy(prefix.getLength());
sOldPattern = *aIter;
}
}
@@ -110,7 +109,6 @@ OUString ODsnTypeCollection::cutPrefix(const OUString& _sURL) const
OUString ODsnTypeCollection::getPrefix(const OUString& _sURL) const
{
- OUString sURL( _sURL);
OUString sRet;
OUString sOldPattern;
StringVector::const_iterator aIter = m_aDsnPrefixes.begin();
@@ -118,13 +116,13 @@ OUString ODsnTypeCollection::getPrefix(const OUString& _sURL) const
for(;aIter != aEnd;++aIter)
{
WildCard aWildCard(*aIter);
- if ( sOldPattern.getLength() < aIter->getLength() && aWildCard.Matches(sURL) )
+ if ( sOldPattern.getLength() < aIter->getLength() && aWildCard.Matches(_sURL) )
{
// This relies on the fact that all patterns are of the form
// foo*
// that is, the very concept of "prefix" applies.
sRet = comphelper::string::stripEnd(*aIter, '*');
- OSL_ENSURE(sRet.getLength() <= sURL.getLength(), "How can A match B when A shorter than B?");
+ OSL_ENSURE(sRet.getLength() <= _sURL.getLength(), "How can A match B when A shorter than B?");
sOldPattern = *aIter;
}
}
@@ -140,7 +138,6 @@ bool ODsnTypeCollection::hasDriver( const sal_Char* _pAsciiPattern ) const
bool ODsnTypeCollection::isConnectionUrlRequired(const OUString& _sURL) const
{
- OUString sURL( _sURL);
OUString sRet;
OUString sOldPattern;
StringVector::const_iterator aIter = m_aDsnPrefixes.begin();
@@ -148,7 +145,7 @@ bool ODsnTypeCollection::isConnectionUrlRequired(const OUString& _sURL) const
for(;aIter != aEnd;++aIter)
{
WildCard aWildCard(*aIter);
- if ( sOldPattern.getLength() < aIter->getLength() && aWildCard.Matches(sURL) )
+ if ( sOldPattern.getLength() < aIter->getLength() && aWildCard.Matches(_sURL) )
{
sRet = *aIter;
sOldPattern = *aIter;
@@ -507,14 +504,13 @@ OUString ODsnTypeCollection::getType(const OUString& _sURL) const
sal_Int32 ODsnTypeCollection::getIndexOf(const OUString& _sURL) const
{
sal_Int32 nRet = -1;
- OUString sURL( _sURL);
OUString sOldPattern;
StringVector::const_iterator aIter = m_aDsnPrefixes.begin();
StringVector::const_iterator aEnd = m_aDsnPrefixes.end();
for(sal_Int32 i = 0;aIter != aEnd;++aIter,++i)
{
WildCard aWildCard(*aIter);
- if ( sOldPattern.getLength() < aIter->getLength() && aWildCard.Matches(sURL) )
+ if ( sOldPattern.getLength() < aIter->getLength() && aWildCard.Matches(_sURL) )
{
nRet = i;
sOldPattern = *aIter;
diff --git a/dbaccess/source/core/recovery/subcomponentrecovery.cxx b/dbaccess/source/core/recovery/subcomponentrecovery.cxx
index 00439934be32..d36b11ef6e1d 100644
--- a/dbaccess/source/core/recovery/subcomponentrecovery.cxx
+++ b/dbaccess/source/core/recovery/subcomponentrecovery.cxx
@@ -562,7 +562,7 @@ namespace dbaccess
aDesignInput.import( pDocHandler.get() );
const ::comphelper::NamedValueCollection& rSettings( pDocHandler->getSettings() );
- const Any aCurrentQueryDesign = rSettings.get( sCurrentQueryDesignName );
+ const Any& aCurrentQueryDesign = rSettings.get( sCurrentQueryDesignName );
#if OSL_DEBUG_LEVEL > 0
Sequence< PropertyValue > aQueryDesignLayout;
OSL_VERIFY( aCurrentQueryDesign >>= aQueryDesignLayout );
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
index 29dffc9ba562..822ca0ce7bec 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
@@ -786,7 +786,6 @@ void OAppDetailPageHelper::elementReplaced(ElementType _eType
DBTreeListBox* pTreeView = getCurrentView();
if ( pTreeView )
{
- OUString sNewName = _rNewName;
SvTreeListEntry* pEntry = nullptr;
switch( _eType )
{
@@ -808,7 +807,7 @@ void OAppDetailPageHelper::elementReplaced(ElementType _eType
OSL_ENSURE(pEntry,"Do you know that the name isn't existence!");
if ( pEntry )
{
- pTreeView->SetEntryText(pEntry,sNewName);
+ pTreeView->SetEntryText(pEntry,_rNewName);
}
}
}
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index 1f04843d3ee6..297dd921eecd 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -1190,7 +1190,6 @@ SvTreeListEntry* SbaTableQueryBrowser::getObjectEntry(const OUString& _rDataSour
}
// look for the object
- OUString sCommand = _rCommand;
sal_Int32 nIndex = 0;
do
{
@@ -1198,7 +1197,7 @@ SvTreeListEntry* SbaTableQueryBrowser::getObjectEntry(const OUString& _rDataSour
switch (_nCommandType)
{
case CommandType::TABLE:
- sPath = sCommand;
+ sPath = _rCommand;
nIndex = -1;
break;
@@ -1206,7 +1205,7 @@ SvTreeListEntry* SbaTableQueryBrowser::getObjectEntry(const OUString& _rDataSour
assert(false);
// in non-debug builds, fall through.
case CommandType::QUERY:
- sPath = sCommand.getToken( 0, '/', nIndex );
+ sPath = _rCommand.getToken( 0, '/', nIndex );
break;
}
pObject = m_pTreeView->getListBox().GetEntryPosByName(sPath, pCommandType);
@@ -1218,7 +1217,7 @@ SvTreeListEntry* SbaTableQueryBrowser::getObjectEntry(const OUString& _rDataSour
DBTreeListUserData* pParentData = static_cast< DBTreeListUserData* >( pObject->GetUserData() );
Reference< XNameAccess > xCollection( pParentData->xContainer, UNO_QUERY );
sal_Int32 nIndex2 = nIndex;
- sPath = sCommand.getToken( 0, '/', nIndex2 );
+ sPath = _rCommand.getToken( 0, '/', nIndex2 );
try
{
if ( xCollection->hasByName(sPath) )
diff --git a/dbaccess/source/ui/control/SqlNameEdit.cxx b/dbaccess/source/ui/control/SqlNameEdit.cxx
index 2816c9866241..5c025afd9655 100644
--- a/dbaccess/source/ui/control/SqlNameEdit.cxx
+++ b/dbaccess/source/ui/control/SqlNameEdit.cxx
@@ -38,18 +38,17 @@ namespace dbaui
bool bCorrected = false;
if ( m_bCheck )
{
- OUString sText = _sToCheck;
sal_Int32 nMatch = 0;
- for (sal_Int32 i = nMatch; i < sText.getLength(); ++i)
+ for (sal_Int32 i = nMatch; i < _sToCheck.getLength(); ++i)
{
- if ( !isCharOk( sText[i], i == 0, m_bOnlyUpperCase, m_sAllowedChars ) )
+ if ( !isCharOk( _sToCheck[i], i == 0, m_bOnlyUpperCase, m_sAllowedChars ) )
{
- _rsCorrected += sText.copy(nMatch, i - nMatch);
+ _rsCorrected += _sToCheck.copy(nMatch, i - nMatch);
bCorrected = true;
nMatch = i + 1;
}
}
- _rsCorrected += sText.copy( nMatch, sText.getLength() - nMatch );
+ _rsCorrected += _sToCheck.copy( nMatch, _sToCheck.getLength() - nMatch );
}
return bCorrected;
}
diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx
index 81e6e0660a87..520d962d1d6f 100644
--- a/dbaccess/source/ui/dlg/dbwizsetup.cxx
+++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx
@@ -755,7 +755,7 @@ bool ODbTypeWizDialogSetup::SaveDatabaseDocument()
void ODbTypeWizDialogSetup::CreateDatabase()
{
OUString sUrl;
- OUString eType = m_pGeneralPage->GetSelectedType();
+ const OUString eType = m_pGeneralPage->GetSelectedType();
if ( dbaccess::ODsnTypeCollection::isEmbeddedDatabase(eType) )
{
sUrl = eType;
@@ -771,10 +771,9 @@ bool ODbTypeWizDialogSetup::SaveDatabaseDocument()
INetURLObject aDBPathURL(m_sWorkPath);
aDBPathURL.Append(m_aDocURL.getBase());
createUniqueFolderName(&aDBPathURL);
- OUString sPrefix = eType;
sUrl = aDBPathURL.GetMainURL( INetURLObject::NO_DECODE);
xSimpleFileAccess->createFolder(sUrl);
- sUrl = sPrefix.concat(sUrl);
+ sUrl = eType.concat(sUrl);
}
m_pOutSet->Put(SfxStringItem(DSID_CONNECTURL, sUrl));
m_pImpl->saveChanges(*m_pOutSet);
diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx
index c618a1bcae50..c178dfb22a81 100644
--- a/dbaccess/source/ui/misc/UITools.cxx
+++ b/dbaccess/source/ui/misc/UITools.cxx
@@ -1397,10 +1397,9 @@ bool insertHierachyElement( vcl::Window* _pParent, const Reference< XComponentCo
return false;
Reference<XNameAccess> xNameAccess( _xNames, UNO_QUERY );
- OUString sName = _sParentFolder;
- if ( _xNames->hasByHierarchicalName(sName) )
+ if ( _xNames->hasByHierarchicalName(_sParentFolder) )
{
- Reference<XChild> xChild(_xNames->getByHierarchicalName(sName),UNO_QUERY);
+ Reference<XChild> xChild(_xNames->getByHierarchicalName(_sParentFolder),UNO_QUERY);
xNameAccess.set(xChild,UNO_QUERY);
if ( !xNameAccess.is() && xChild.is() )
xNameAccess.set(xChild->getParent(),UNO_QUERY);
@@ -1428,7 +1427,7 @@ bool insertHierachyElement( vcl::Window* _pParent, const Reference< XComponentCo
sTargetName = ::dbtools::createUniqueName(xNameAccess,sTargetName);
// here we have everything needed to create a new query object ...
- HierarchicalNameCheck aNameChecker( _xNames.get(), sName );
+ HierarchicalNameCheck aNameChecker( _xNames.get(), _sParentFolder );
// ... ehm, except a new name
ScopedVclPtrInstance<OSaveAsDlg> aAskForName(
_pParent,
diff --git a/dbaccess/source/ui/misc/indexcollection.cxx b/dbaccess/source/ui/misc/indexcollection.cxx
index 94790d3a7efe..971a25fe0f29 100644
--- a/dbaccess/source/ui/misc/indexcollection.cxx
+++ b/dbaccess/source/ui/misc/indexcollection.cxx
@@ -67,13 +67,11 @@ namespace dbaui
Indexes::const_iterator OIndexCollection::find(const OUString& _rName) const
{
- OUString sNameCompare(_rName);
-
// loop'n'compare
Indexes::const_iterator aSearch = m_aIndexes.begin();
Indexes::const_iterator aEnd = m_aIndexes.end();
for (; aSearch != aEnd; ++aSearch)
- if (aSearch->sName == sNameCompare)
+ if (aSearch->sName == _rName)
break;
return aSearch;
@@ -81,13 +79,11 @@ namespace dbaui
Indexes::iterator OIndexCollection::find(const OUString& _rName)
{
- OUString sNameCompare(_rName);
-
// loop'n'compare
Indexes::iterator aSearch = m_aIndexes.begin();
Indexes::const_iterator aEnd = m_aIndexes.end();
for (; aSearch != aEnd; ++aSearch)
- if (aSearch->sName == sNameCompare)
+ if (aSearch->sName == _rName)
break;
return aSearch;
@@ -95,13 +91,11 @@ namespace dbaui
Indexes::const_iterator OIndexCollection::findOriginal(const OUString& _rName) const
{
- OUString sNameCompare(_rName);
-
// loop'n'compare
Indexes::const_iterator aSearch = m_aIndexes.begin();
Indexes::const_iterator aEnd = m_aIndexes.end();
for (; aSearch != aEnd; ++aSearch)
- if (aSearch->getOriginalName() == sNameCompare)
+ if (aSearch->getOriginalName() == _rName)
break;
return aSearch;
@@ -109,13 +103,11 @@ namespace dbaui
Indexes::iterator OIndexCollection::findOriginal(const OUString& _rName)
{
- OUString sNameCompare(_rName);
-
// loop'n'compare
Indexes::iterator aSearch = m_aIndexes.begin();
Indexes::const_iterator aEnd = m_aIndexes.end();
for (; aSearch != aEnd; ++aSearch)
- if (aSearch->getOriginalName() == sNameCompare)
+ if (aSearch->getOriginalName() == _rName)
break;
return aSearch;
diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
index 8d88ec3408f7..6d303db5b019 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
@@ -788,10 +788,9 @@ namespace
else
aHavingStr += aWork;
- OUString aTmp = aCriteria;
OUString aErrorMsg;
Reference<XPropertySet> xColumn;
- std::unique_ptr< ::connectivity::OSQLParseNode> pParseNode(_pView->getPredicateTreeFromEntry(pEntryField,aTmp,aErrorMsg,xColumn));
+ std::unique_ptr< ::connectivity::OSQLParseNode> pParseNode(_pView->getPredicateTreeFromEntry(pEntryField,aCriteria,aErrorMsg,xColumn));
if (pParseNode.get())
{
if (bMulti && !(pEntryField->isOtherFunction() || (aFieldName.toChar() == '*')))
@@ -819,10 +818,9 @@ namespace
aWhereStr += " ";
// aCriteria could have some german numbers so I have to be sure here
- OUString aTmp = aCriteria;
OUString aErrorMsg;
Reference<XPropertySet> xColumn;
- std::unique_ptr< ::connectivity::OSQLParseNode> pParseNode( _pView->getPredicateTreeFromEntry(pEntryField,aTmp,aErrorMsg,xColumn));
+ std::unique_ptr< ::connectivity::OSQLParseNode> pParseNode( _pView->getPredicateTreeFromEntry(pEntryField,aCriteria,aErrorMsg,xColumn));
if (pParseNode.get())
{
if (bMulti && !(pEntryField->isOtherFunction() || (aFieldName.toChar() == '*')))
@@ -888,7 +886,7 @@ namespace
OUString& _rsRet)
{
const OQueryController& rController = static_cast<OQueryController&>(_pView->getController());
- Reference< XConnection> xConnection = rController.getConnection();
+ const Reference< XConnection>& xConnection = rController.getConnection();
if ( !xConnection.is() )
return eNoConnection;
@@ -964,8 +962,7 @@ namespace
if ( !aWorkStr.isEmpty() )
{
const sal_Int32 nMaxOrder = xMetaData->getMaxColumnsInOrderBy();
- OUString sToken(aWorkStr);
- if ( nMaxOrder && nMaxOrder < comphelper::string::getTokenCount(sToken, ',') )
+ if ( nMaxOrder && nMaxOrder < comphelper::string::getTokenCount(aWorkStr, ',') )
eErrorCode = eStatementTooLong;
else
{
@@ -2239,8 +2236,7 @@ namespace
if ( SQL_ISRULE(pColumnRef,general_set_fct) )
{
aInfo->SetFunctionType(nFunctionType|FKT_AGGREGATE);
- OUString aCol(aColumns);
- aInfo->SetFunction(comphelper::string::stripEnd(aCol.getToken(0,'('), ' '));
+ aInfo->SetFunction(comphelper::string::stripEnd(aColumns.getToken(0,'('), ' '));
}
else
aInfo->SetFunctionType(nFunctionType|FKT_OTHER);
@@ -3081,7 +3077,6 @@ OSQLParseNode* OQueryDesignView::getPredicateTreeFromEntry(const OTableFieldDesc
}
}
- OUString sTest(_sCriteria);
// _rxColumn, if it is a "lookup" column, not a computed column,
// is guaranteed to be the column taken from the *source* of the column,
// that is either a table or another query.
@@ -3095,7 +3090,7 @@ OSQLParseNode* OQueryDesignView::getPredicateTreeFromEntry(const OTableFieldDesc
// We are currently treating the entry "C='foo'"
// Then _rxColumn has Name "C" and RealName "cee". We should *obviously* use "C", not "cee".
OSQLParseNode* pParseNode = rParser.predicateTree( _rsErrorMessage,
- sTest,
+ _sCriteria,
static_cast<OQueryController&>(getController()).getNumberFormatter(),
_rxColumn,
false);
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index a35cdc43727f..ae0e953233de 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -66,10 +66,9 @@ namespace
bool bAsterisk = !(!_sFieldName.isEmpty() && _sFieldName.toChar() != '*');
if ( !bAsterisk )
{
- OUString sName = _sFieldName;
- sal_Int32 nTokenCount = comphelper::string::getTokenCount(sName, '.');
- if ( (nTokenCount == 2 && sName.getToken(1,'.')[0] == '*' )
- || (nTokenCount == 3 && sName.getToken(2,'.')[0] == '*' ) )
+ sal_Int32 nTokenCount = comphelper::string::getTokenCount(_sFieldName, '.');
+ if ( (nTokenCount == 2 && _sFieldName.getToken(1,'.')[0] == '*' )
+ || (nTokenCount == 3 && _sFieldName.getToken(2,'.')[0] == '*' ) )
{
bAsterisk = true;
}
diff --git a/dbaccess/source/ui/querydesign/limitboxcontroller.cxx b/dbaccess/source/ui/querydesign/limitboxcontroller.cxx
index 46c6154ceb6c..19b60e6f13e2 100644
--- a/dbaccess/source/ui/querydesign/limitboxcontroller.cxx
+++ b/dbaccess/source/ui/querydesign/limitboxcontroller.cxx
@@ -190,11 +190,10 @@ throw (uno::RuntimeException, std::exception)
}
uno::Reference< awt::XWindow > SAL_CALL LimitBoxController::createItemWindow(
- const uno::Reference< awt::XWindow >& Parent )
+ const uno::Reference< awt::XWindow >& xParent )
throw (uno::RuntimeException, std::exception)
{
uno::Reference< awt::XWindow > xItemWindow;
- uno::Reference< awt::XWindow > xParent( Parent );
vcl::Window* pParent = VCLUnoHelper::GetWindow( xParent );
if ( pParent )
diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx
index a0f844c9b891..3db08021bf1e 100644
--- a/dbaccess/source/ui/querydesign/querycontroller.cxx
+++ b/dbaccess/source/ui/querydesign/querycontroller.cxx
@@ -1756,8 +1756,7 @@ OUString OQueryController::translateStatement( bool _bFireStatementChange )
{
ModuleRes aModuleRes(STR_QRY_NOSELECT);
OUString sTmpStr(aModuleRes);
- OUString sError(sTmpStr);
- showError(SQLException(sError,nullptr,"S1000",1000,Any()));
+ showError(SQLException(sTmpStr,nullptr,"S1000",1000,Any()));
}
else
sTranslatedStmt = m_sStatement;
diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx
index e86d901df603..4a7ddfc13355 100644
--- a/desktop/source/app/sofficemain.cxx
+++ b/desktop/source/app/sofficemain.cxx
@@ -112,7 +112,7 @@ extern "C" int DESKTOP_DLLPUBLIC soffice_main()
// handle --version and --help already here, otherwise they would be handled
// after VCL initialization that might fail if $DISPLAY is not set
const desktop::CommandLineArgs& rCmdLineArgs = desktop::Desktop::GetCommandLineArgs();
- OUString aUnknown( rCmdLineArgs.GetUnknown() );
+ const OUString& aUnknown( rCmdLineArgs.GetUnknown() );
if ( !aUnknown.isEmpty() )
{
desktop::Desktop::InitApplicationServiceManager();
diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx
index 28cf3d17b3c2..e02b84d87bd7 100644
--- a/desktop/source/deployment/misc/dp_misc.cxx
+++ b/desktop/source/deployment/misc/dp_misc.cxx
@@ -294,9 +294,8 @@ OUString makeURL( OUString const & baseURL, OUString const & relPath_ )
return buf.makeStringAndClear();
}
-OUString makeURLAppendSysPathSegment( OUString const & baseURL, OUString const & relPath_ )
+OUString makeURLAppendSysPathSegment( OUString const & baseURL, OUString const & segment )
{
- OUString segment = relPath_;
OSL_ASSERT(segment.indexOf(static_cast<sal_Unicode>('/')) == -1);
::rtl::Uri::encode(
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 12d0555f66ab..b58f23e14691 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1623,7 +1623,7 @@ unsigned char* doc_renderFont(LibreOfficeKitDocument* /*pThis*/,
for (sal_uInt16 i = 0; i < nFontCount; ++i)
{
const FontMetric& rFontMetric = pList->GetFontName(i);
- OUString aFontName = rFontMetric.GetFamilyName();
+ const OUString& aFontName = rFontMetric.GetFamilyName();
if (!aSearchedFontName.equals(aFontName.toUtf8().getStr()))
continue;
diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
index e12e128027dd..26875142fcf7 100644
--- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
@@ -371,9 +371,7 @@ namespace
if(!rRegion.IsEmpty())
{
- vcl::Region aRegion(rRegion);
-
- aRetval = aRegion.GetAsB2DPolyPolygon();
+ aRetval = rRegion.GetAsB2DPolyPolygon();
}
return aRetval;
diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
index a8d9562a865f..27a4e0dc3943 100644
--- a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
@@ -259,7 +259,7 @@ namespace drawinglayer
}
// calculate logic render size in world coordinates for usage in renderer
- const basegfx::B2DHomMatrix aInverseOToV(rViewInformation.getInverseObjectToViewTransformation());
+ const basegfx::B2DHomMatrix& aInverseOToV(rViewInformation.getInverseObjectToViewTransformation());
const double fLogicX((aInverseOToV * basegfx::B2DVector(aDiscreteRange.getWidth() * fReduceFactor, 0.0)).getLength());
const double fLogicY((aInverseOToV * basegfx::B2DVector(0.0, aDiscreteRange.getHeight() * fReduceFactor)).getLength());
diff --git a/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx b/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
index b7218e6014cb..eaae44d8e5a5 100644
--- a/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
@@ -161,7 +161,7 @@ namespace drawinglayer
// support for single word mode; split to single word primitives
// using TextBreakupHelper
const TextBreakupHelper aTextBreakupHelper(*this);
- const Primitive2DContainer aBroken(aTextBreakupHelper.getResult(BreakupUnit_word));
+ const Primitive2DContainer& aBroken(aTextBreakupHelper.getResult(BreakupUnit_word));
if(!aBroken.empty())
{
diff --git a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
index 722d2db9eaac..ae60358e065d 100644
--- a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
@@ -68,7 +68,7 @@ namespace drawinglayer
{
// polyPolygonMaterialPrimitive3D, check texturing and hatching
const PolyPolygonMaterialPrimitive3D& rPrimitive = static_cast< const PolyPolygonMaterialPrimitive3D& >(*pBasePrimitive);
- const basegfx::B3DPolyPolygon aFillPolyPolygon(rPrimitive.getB3DPolyPolygon());
+ const basegfx::B3DPolyPolygon& aFillPolyPolygon(rPrimitive.getB3DPolyPolygon());
if(maHatch.isFillBackground())
{
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 52b23c8b08d2..ca7af47b7b32 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -995,8 +995,7 @@ namespace drawinglayer
case drawinglayer::primitive2d::FIELD_TYPE_URL :
{
const OUString& rURL = rFieldPrimitive.getString();
- const OUString aOldString(rURL);
- mpMetaFile->AddAction(new MetaCommentAction(aCommentStringCommon, 0, reinterpret_cast< const sal_uInt8* >(aOldString.getStr()), 2 * aOldString.getLength()));
+ mpMetaFile->AddAction(new MetaCommentAction(aCommentStringCommon, 0, reinterpret_cast< const sal_uInt8* >(rURL.getStr()), 2 * rURL.getLength()));
break;
}
}
@@ -1816,7 +1815,7 @@ namespace drawinglayer
// - uses DrawTransparent for single PolyPoylgons directly. Can be detected by
// checking the content for single PolyPolygonColorPrimitive2D
const primitive2d::UnifiedTransparencePrimitive2D& rUniTransparenceCandidate = static_cast< const primitive2d::UnifiedTransparencePrimitive2D& >(rCandidate);
- const primitive2d::Primitive2DContainer rContent = rUniTransparenceCandidate.getChildren();
+ const primitive2d::Primitive2DContainer& rContent = rUniTransparenceCandidate.getChildren();
if(!rContent.empty())
{
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index da004b0244d1..6d7832f66ef8 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -866,7 +866,7 @@ namespace drawinglayer
// Detect if a single PolyPolygonColorPrimitive2D is contained; in that case,
// use the faster OutputDevice::DrawTransparent method
const primitive2d::UnifiedTransparencePrimitive2D& rUniTransparenceCandidate = static_cast< const primitive2d::UnifiedTransparencePrimitive2D& >(rCandidate);
- const primitive2d::Primitive2DContainer rContent = rUniTransparenceCandidate.getChildren();
+ const primitive2d::Primitive2DContainer& rContent = rUniTransparenceCandidate.getChildren();
if(!rContent.empty())
{
diff --git a/drawinglayer/source/processor3d/cutfindprocessor3d.cxx b/drawinglayer/source/processor3d/cutfindprocessor3d.cxx
index 5b8a79018baa..b54f6de3a44e 100644
--- a/drawinglayer/source/processor3d/cutfindprocessor3d.cxx
+++ b/drawinglayer/source/processor3d/cutfindprocessor3d.cxx
@@ -134,7 +134,7 @@ namespace drawinglayer
case PRIMITIVE3D_ID_UNIFIEDTRANSPARENCETEXTUREPRIMITIVE3D :
{
const primitive3d::UnifiedTransparenceTexturePrimitive3D& rPrimitive = static_cast< const primitive3d::UnifiedTransparenceTexturePrimitive3D& >(rCandidate);
- const primitive3d::Primitive3DContainer rChildren = rPrimitive.getChildren();
+ const primitive3d::Primitive3DContainer& rChildren = rPrimitive.getChildren();
if(rChildren.size())
{
diff --git a/drawinglayer/source/processor3d/defaultprocessor3d.cxx b/drawinglayer/source/processor3d/defaultprocessor3d.cxx
index 6dfe5c7b4171..f83eb1fe3daa 100644
--- a/drawinglayer/source/processor3d/defaultprocessor3d.cxx
+++ b/drawinglayer/source/processor3d/defaultprocessor3d.cxx
@@ -62,8 +62,8 @@ namespace drawinglayer
const basegfx::B2DRange aOutlineRange(0.0, 0.0, rPrimitive.getTextureSize().getX(), rPrimitive.getTextureSize().getY());
const attribute::GradientStyle aGradientStyle(rFillGradient.getStyle());
sal_uInt32 nSteps(rFillGradient.getSteps());
- const basegfx::BColor aStart(rFillGradient.getStartColor());
- const basegfx::BColor aEnd(rFillGradient.getEndColor());
+ const basegfx::BColor& aStart(rFillGradient.getStartColor());
+ const basegfx::BColor& aEnd(rFillGradient.getEndColor());
const sal_uInt32 nMaxSteps(sal_uInt32((aStart.getMaximumDistance(aEnd) * 127.5) + 0.5));
std::shared_ptr< texture::GeoTexSvx > pNewTex;
diff --git a/drawinglayer/source/processor3d/geometry2dextractor.cxx b/drawinglayer/source/processor3d/geometry2dextractor.cxx
index ccc63728b33e..5279e7fa560a 100644
--- a/drawinglayer/source/processor3d/geometry2dextractor.cxx
+++ b/drawinglayer/source/processor3d/geometry2dextractor.cxx
@@ -119,7 +119,7 @@ namespace drawinglayer
{
// TexturePrimitive3D: Process children, do not try to decompose
const primitive3d::TexturePrimitive3D& rTexturePrimitive = static_cast< const primitive3d::TexturePrimitive3D& >(rCandidate);
- const primitive3d::Primitive3DContainer aChildren(rTexturePrimitive.getChildren());
+ const primitive3d::Primitive3DContainer& aChildren(rTexturePrimitive.getChildren());
if(!aChildren.empty())
{
diff --git a/drawinglayer/source/tools/converters.cxx b/drawinglayer/source/tools/converters.cxx
index bae038763469..635f37aa71ec 100644
--- a/drawinglayer/source/tools/converters.cxx
+++ b/drawinglayer/source/tools/converters.cxx
@@ -71,7 +71,6 @@ namespace drawinglayer
const Point aEmptyPoint;
const Size aSizePixel(nDiscreteWidth, nDiscreteHeight);
- geometry::ViewInformation2D aViewInformation2D(rViewInformation2D);
ScopedVclPtrInstance< VirtualDevice > maContent;
// prepare vdev
@@ -87,7 +86,7 @@ namespace drawinglayer
// not wanted, change after this call as needed
processor2d::BaseProcessor2D* pContentProcessor = processor2d::createPixelProcessor2DFromOutputDevice(
*maContent.get(),
- aViewInformation2D);
+ rViewInformation2D);
if(pContentProcessor)
{
diff --git a/editeng/source/editeng/eehtml.cxx b/editeng/source/editeng/eehtml.cxx
index d250b7800673..cb3c14442f34 100644
--- a/editeng/source/editeng/eehtml.cxx
+++ b/editeng/source/editeng/eehtml.cxx
@@ -665,15 +665,14 @@ void EditHTMLParser::ImpSetStyleSheet( sal_uInt16 nHLevel )
void EditHTMLParser::ImpInsertText( const OUString& rText )
{
- OUString aText( rText );
if (mpEditEngine->IsImportHandlerSet())
{
ImportInfo aImportInfo(HTMLIMP_INSERTTEXT, this, mpEditEngine->CreateESelection(aCurSel));
- aImportInfo.aText = aText;
+ aImportInfo.aText = rText;
mpEditEngine->CallImportHandler(aImportInfo);
}
- aCurSel = mpEditEngine->InsertText(aCurSel, aText);
+ aCurSel = mpEditEngine->InsertText(aCurSel, rText);
}
void EditHTMLParser::SkipGroup( int nEndToken )
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 07285a99e94b..7a2b9ac1eaed 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -1861,7 +1861,7 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te
if ( ( nWordEnd >= nMaxBreakPos ) && ( nWordLen > 3 ) )
{
// May happen, because getLineBreak may differ from getWordBoudary with DICTIONARY_WORD
- OUString aWord = pNode->GetString().copy(nWordStart, nWordLen);
+ const OUString aWord = pNode->GetString().copy(nWordStart, nWordLen);
sal_Int32 nMinTrail = nWordEnd-nMaxBreakPos+1; //+1: Before the dickey letter
Reference< XHyphenatedWord > xHyphWord;
if (xHyphenator.is())
@@ -1882,12 +1882,11 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te
{
// TODO: handle all alternative hyphenations (see hyphen-1.2.8/tests/unicode.*)
OUString aAlt( xHyphWord->getHyphenatedWord() );
- OUString aWord2(aWord);
OUString aAltLeft(aAlt.copy(0, _nWordLen));
OUString aAltRight(aAlt.copy(_nWordLen));
- bAltFullLeft = aWord2.startsWith(aAltLeft);
- bAltFullRight = aWord2.endsWith(aAltRight);
- nAltDelChar = aWord2.getLength() - aAlt.getLength() + static_cast<int>(!bAltFullLeft) + static_cast<int>(!bAltFullRight);
+ bAltFullLeft = aWord.startsWith(aAltLeft);
+ bAltFullRight = aWord.endsWith(aAltRight);
+ nAltDelChar = aWord.getLength() - aAlt.getLength() + static_cast<int>(!bAltFullLeft) + static_cast<int>(!bAltFullRight);
// NOTE: improved for other cases, see fdo#63711
@@ -1900,7 +1899,7 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te
// compound words because the Hyphenator separates
// all position of the word. [This is not true for libhyphen.]
// "Schiffahrtsbrennesseln" -> "Schifffahrtsbrennnesseln"
- // We can thus actually not directly connect the index of the
+ // We can thus actually not directly connect the index of the
// AlternativeWord to aWord. The whole issue will be simplified
// by a function in the Hyphenator as soon as AMA builds this in...
sal_Int32 nAltStart = _nWordLen - 1;
@@ -1935,7 +1934,7 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te
bHyphenated = true;
nBreakPos = nWordStart + nTxtStart;
- if ( cAlternateReplChar || aAlt.getLength() < aWord2.getLength() || !bAltFullRight) // also for "oma-tje", "re-eel"
+ if ( cAlternateReplChar || aAlt.getLength() < aWord.getLength() || !bAltFullRight) // also for "oma-tje", "re-eel"
nBreakPos++;
}
}
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 2ec8405b1881..cafb0c0e5998 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -1752,14 +1752,12 @@ bool SvxAutoCorrect::FindInWrdSttExceptList( LanguageType eLang,
// First search for eLang, then primary language of eLang
// and last in LANGUAGE_UNDETERMINED
- OUString sTemp(sWord);
if (m_pLangTable->find(aLanguageTag) != m_pLangTable->end() || CreateLanguageFile(aLanguageTag, false))
{
//the language is available - so bring it on
auto const& pList = m_pLangTable->find(aLanguageTag)->second;
- OUString _sTemp(sWord);
- if(pList->GetWrdSttExceptList()->find(_sTemp) != pList->GetWrdSttExceptList()->end() )
+ if(pList->GetWrdSttExceptList()->find(sWord) != pList->GetWrdSttExceptList()->end() )
return true;
}
@@ -1773,7 +1771,7 @@ bool SvxAutoCorrect::FindInWrdSttExceptList( LanguageType eLang,
{
//the language is available - so bring it on
auto const& pList = m_pLangTable->find(aLanguageTag)->second;
- if(pList->GetWrdSttExceptList()->find(sTemp) != pList->GetWrdSttExceptList()->end() )
+ if(pList->GetWrdSttExceptList()->find(sWord) != pList->GetWrdSttExceptList()->end() )
return true;
}
@@ -1782,7 +1780,7 @@ bool SvxAutoCorrect::FindInWrdSttExceptList( LanguageType eLang,
{
//the language is available - so bring it on
auto const& pList = m_pLangTable->find(aLanguageTag)->second;
- if(pList->GetWrdSttExceptList()->find(sTemp) != pList->GetWrdSttExceptList()->end() )
+ if(pList->GetWrdSttExceptList()->find(sWord) != pList->GetWrdSttExceptList()->end() )
return true;
}
return false;
@@ -1831,13 +1829,12 @@ bool SvxAutoCorrect::FindInCplSttExceptList(LanguageType eLang,
// First search for eLang, then primary language of eLang
// and last in LANGUAGE_UNDETERMINED
- OUString sTemp( sWord );
if (m_pLangTable->find(aLanguageTag) != m_pLangTable->end() || CreateLanguageFile(aLanguageTag, false))
{
//the language is available - so bring it on
const SvStringsISortDtor* pList = m_pLangTable->find(aLanguageTag)->second->GetCplSttExceptList();
- if(bAbbreviation ? lcl_FindAbbreviation(pList, sWord) : pList->find(sTemp) != pList->end() )
+ if(bAbbreviation ? lcl_FindAbbreviation(pList, sWord) : pList->find(sWord) != pList->end() )
return true;
}
@@ -1851,7 +1848,7 @@ bool SvxAutoCorrect::FindInCplSttExceptList(LanguageType eLang,
{
//the language is available - so bring it on
const SvStringsISortDtor* pList = m_pLangTable->find(aLanguageTag)->second->GetCplSttExceptList();
- if(bAbbreviation ? lcl_FindAbbreviation(pList, sWord) : pList->find(sTemp) != pList->end() )
+ if(bAbbreviation ? lcl_FindAbbreviation(pList, sWord) : pList->find(sWord) != pList->end() )
return true;
}
@@ -1860,7 +1857,7 @@ bool SvxAutoCorrect::FindInCplSttExceptList(LanguageType eLang,
{
//the language is available - so bring it on
const SvStringsISortDtor* pList = m_pLangTable->find(aLanguageTag)->second->GetCplSttExceptList();
- if(bAbbreviation ? lcl_FindAbbreviation(pList, sWord) : pList->find(sTemp) != pList->end() )
+ if(bAbbreviation ? lcl_FindAbbreviation(pList, sWord) : pList->find(sWord) != pList->end() )
return true;
}
return false;
@@ -1967,12 +1964,11 @@ void SvxAutoCorrectLanguageLists::LoadXMLExceptList_Imp(
rpLst = new SvStringsISortDtor;
{
- OUString sStrmName( pStrmName, strlen(pStrmName), RTL_TEXTENCODING_MS_1252 );
- OUString sTmp( sStrmName );
+ const OUString sStrmName( pStrmName, strlen(pStrmName), RTL_TEXTENCODING_MS_1252 );
if( rStg.Is() && rStg->IsStream( sStrmName ) )
{
- tools::SvRef<SotStorageStream> xStrm = rStg->OpenSotStream( sTmp,
+ tools::SvRef<SotStorageStream> xStrm = rStg->OpenSotStream( sStrmName,
( StreamMode::READ | StreamMode::SHARE_DENYWRITE | StreamMode::NOCREATE ) );
if( SVSTREAM_OK != xStrm->GetError())
{
diff --git a/extensions/source/bibliography/bibload.cxx b/extensions/source/bibliography/bibload.cxx
index 4c6929fe7b40..d60e21bf2af2 100644
--- a/extensions/source/bibliography/bibload.cxx
+++ b/extensions/source/bibliography/bibload.cxx
@@ -228,8 +228,7 @@ void BibliographyLoader::load(const Reference< XFrame > & rFrame, const OUString
m_pBibMod = OpenBibModul();
- OUString aURLStr( rURL );
- OUString aPartName = aURLStr.getToken( 1, '/' );
+ OUString aPartName = rURL.getToken( 1, '/' );
Reference<XPropertySet> xPrSet(rFrame, UNO_QUERY);
if(xPrSet.is())
{
@@ -459,11 +458,10 @@ Any BibliographyLoader::getByName(const OUString& rName) throw
if (!xColumns.is())
return aRet;
- OUString sIdentifierMapping = pDatMan->GetIdentifierMapping();
- OUString sId = sIdentifierMapping;
+ const OUString sIdentifierMapping = pDatMan->GetIdentifierMapping();
Reference< sdb::XColumn > xColumn;
- if (xColumns->hasByName(sId))
- xColumn.set(*static_cast<Reference< XInterface > const *>(xColumns->getByName(sId).getValue()), UNO_QUERY);
+ if (xColumns->hasByName(sIdentifierMapping))
+ xColumn.set(*static_cast<Reference< XInterface > const *>(xColumns->getByName(sIdentifierMapping).getValue()), UNO_QUERY);
if (xColumn.is())
{
do
diff --git a/extensions/source/bibliography/toolbar.cxx b/extensions/source/bibliography/toolbar.cxx
index e2eb753e4f30..109c05b69816 100644
--- a/extensions/source/bibliography/toolbar.cxx
+++ b/extensions/source/bibliography/toolbar.cxx
@@ -481,8 +481,7 @@ IMPL_LINK_NOARG_TYPED( BibToolBar, SendSelHdl, Idle*, void )
PropertyValue* pPropertyVal = const_cast<PropertyValue*>(aPropVal.getConstArray());
pPropertyVal[0].Name = "DataSourceName";
OUString aEntry( MnemonicGenerator::EraseAllMnemonicChars( aLBSource->GetSelectEntry() ) );
- OUString aSelection = aEntry;
- pPropertyVal[0].Value <<= aSelection;
+ pPropertyVal[0].Value <<= aEntry;
SendDispatch(nTBC_LB_SOURCE, aPropVal);
}
diff --git a/extensions/source/propctrlr/eformspropertyhandler.cxx b/extensions/source/propctrlr/eformspropertyhandler.cxx
index d4870a456f99..b63e96b0a2b2 100644
--- a/extensions/source/propctrlr/eformspropertyhandler.cxx
+++ b/extensions/source/propctrlr/eformspropertyhandler.cxx
@@ -501,7 +501,7 @@ namespace pcr
// the binding for the dialog to work with
Reference< XPropertySet > xBinding( m_pHelper->getCurrentBinding() );
// the aspect of the binding which the dialog should modify
- OUString sFacetName( _rPropertyName );
+ const OUString& sFacetName( _rPropertyName );
OSL_ENSURE( xModel.is() && xBinding.is() && !sFacetName.isEmpty(),
"EFormsPropertyHandler::onInteractivePropertySelection: something is missing for the dialog initialization!" );
diff --git a/extensions/source/propctrlr/stringrepresentation.cxx b/extensions/source/propctrlr/stringrepresentation.cxx
index 8c0c9dfc0985..c570ef989549 100644
--- a/extensions/source/propctrlr/stringrepresentation.cxx
+++ b/extensions/source/propctrlr/stringrepresentation.cxx
@@ -527,48 +527,47 @@ bool StringRepresentation::convertStringToGenericValue( const OUString& _rString
{
uno::Type aElementType = ::comphelper::getSequenceElementType( _rTargetType );
- OUString aStr( _rStringRep );
switch ( aElementType.getTypeClass() )
{
case uno::TypeClass_STRING:
{
Sequence< OUString > aElements;
- splitComposedStringToSequence( aStr, aElements, StringIdentity() );
+ splitComposedStringToSequence( _rStringRep, aElements, StringIdentity() );
_rValue <<= aElements;
}
break;
case uno::TypeClass_SHORT:
{
Sequence< sal_Int16 > aElements;
- splitComposedStringToSequence( aStr, aElements, ConvertIntegerFromAndToString() );
+ splitComposedStringToSequence( _rStringRep, aElements, ConvertIntegerFromAndToString() );
_rValue <<= aElements;
}
break;
case uno::TypeClass_UNSIGNED_SHORT:
{
Sequence< sal_uInt16 > aElements;
- splitComposedStringToSequence( aStr, aElements, ConvertIntegerFromAndToString() );
+ splitComposedStringToSequence( _rStringRep, aElements, ConvertIntegerFromAndToString() );
_rValue <<= aElements;
}
break;
case uno::TypeClass_LONG:
{
Sequence< sal_Int32 > aElements;
- splitComposedStringToSequence( aStr, aElements, ConvertIntegerFromAndToString() );
+ splitComposedStringToSequence( _rStringRep, aElements, ConvertIntegerFromAndToString() );
_rValue <<= aElements;
}
break;
case uno::TypeClass_UNSIGNED_LONG:
{
Sequence< sal_uInt32 > aElements;
- splitComposedStringToSequence( aStr, aElements, ConvertIntegerFromAndToString() );
+ splitComposedStringToSequence( _rStringRep, aElements, ConvertIntegerFromAndToString() );
_rValue <<= aElements;
}
break;
case uno::TypeClass_BYTE:
{
Sequence< sal_Int8 > aElements;
- splitComposedStringToSequence( aStr, aElements, ConvertIntegerFromAndToString() );
+ splitComposedStringToSequence( _rStringRep, aElements, ConvertIntegerFromAndToString() );
_rValue <<= aElements;
}
break;
diff --git a/extensions/source/resource/oooresourceloader.cxx b/extensions/source/resource/oooresourceloader.cxx
index a79bfc4484e4..cc41be8f571c 100644
--- a/extensions/source/resource/oooresourceloader.cxx
+++ b/extensions/source/resource/oooresourceloader.cxx
@@ -177,8 +177,7 @@ namespace extensions { namespace resource
:m_aLocale( _rLocale )
,m_pResourceManager( nullptr )
{
- OUString sBaseName( _rBaseName );
- m_pResourceManager = new SimpleResMgr( OUStringToOString( sBaseName, RTL_TEXTENCODING_UTF8 ).getStr(),
+ m_pResourceManager = new SimpleResMgr( OUStringToOString( _rBaseName, RTL_TEXTENCODING_UTF8 ).getStr(),
LanguageTag( m_aLocale) );
if ( !m_pResourceManager->IsValid() )
diff --git a/filter/source/config/cache/cacheitem.cxx b/filter/source/config/cache/cacheitem.cxx
index 57c69adc7399..b21d2fcea365 100644
--- a/filter/source/config/cache/cacheitem.cxx
+++ b/filter/source/config/cache/cacheitem.cxx
@@ -118,8 +118,8 @@ css::uno::Sequence< css::beans::PropertyValue > CacheItem::getAsPackedPropertyVa
bool isSubSet(const css::uno::Any& aSubSet,
const css::uno::Any& aSet )
{
- css::uno::Type aT1 = aSubSet.getValueType();
- css::uno::Type aT2 = aSet.getValueType();
+ const css::uno::Type& aT1 = aSubSet.getValueType();
+ const css::uno::Type& aT2 = aSet.getValueType();
if (!aT1.equals(aT2))
{
diff --git a/filter/source/flash/swfwriter1.cxx b/filter/source/flash/swfwriter1.cxx
index 2379fe71f861..05613b7c31ac 100644
--- a/filter/source/flash/swfwriter1.cxx
+++ b/filter/source/flash/swfwriter1.cxx
@@ -485,8 +485,7 @@ void Writer::Impl_writeText( const Point& rPos, const OUString& rText, const lon
Reference < XBreakIterator > xBI( Impl_GetBreakIterator() );
if( xBI.is() )
{
- const OUString oText( rText );
- nScriptType = xBI->getScriptType( oText, 0 );
+ nScriptType = xBI->getScriptType( rText, 0 );
}
// if the text is either right to left or complex or asian, we
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index b15cbd0e0822..c56d27a4eca2 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -1348,14 +1348,13 @@ void EscherPropertyContainer::CreateEmbeddedBitmapProperties(
const OUString& rBitmapUrl, css::drawing::BitmapMode eBitmapMode )
{
OUString aVndUrl( "vnd.sun.star.GraphicObject:" );
- OUString aBmpUrl( rBitmapUrl );
- sal_Int32 nIndex = aBmpUrl.indexOf( aVndUrl );
+ sal_Int32 nIndex = rBitmapUrl.indexOf( aVndUrl );
if( nIndex != -1 )
{
nIndex += aVndUrl.getLength();
- if( aBmpUrl.getLength() > nIndex )
+ if( rBitmapUrl.getLength() > nIndex )
{
- OString aUniqueId(OUStringToOString(aBmpUrl.copy(nIndex, aBmpUrl.getLength() - nIndex), RTL_TEXTENCODING_UTF8));
+ OString aUniqueId(OUStringToOString(rBitmapUrl.copy(nIndex, rBitmapUrl.getLength() - nIndex), RTL_TEXTENCODING_UTF8));
bool bRetValue = ImplCreateEmbeddedBmp( aUniqueId );
if( bRetValue )
{
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 29ae6d8cb76a..43b409bd0a70 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -6564,11 +6564,11 @@ bool SvxMSDffManager::MakeContentStream( SotStorage * pStor, const GDIMetaFile &
// If a not applicable MapUnit (device dependent) is used,
// SV tries to guess a best match for the right value
Size aSize = rMtf.GetPrefSize();
- MapMode aMMSrc = rMtf.GetPrefMapMode();
+ const MapMode& aMMSrc = rMtf.GetPrefMapMode();
MapMode aMMDst( MAP_100TH_MM );
aSize = OutputDevice::LogicToLogic( aSize, aMMSrc, aMMDst );
aEle.SetSize( aSize );
- aEle.SetAspect( nAspect );
+ aEle.SetAspect( nAspect );
aEle.SetAdviseFlags( nAdviseModes );
aEle.SetMtf( rMtf );
aEle.Write( *xStm );
diff --git a/filter/source/svg/svgfontexport.cxx b/filter/source/svg/svgfontexport.cxx
index 121704a93738..366c673bbb79 100644
--- a/filter/source/svg/svgfontexport.cxx
+++ b/filter/source/svg/svgfontexport.cxx
@@ -47,7 +47,7 @@ SVGFontExport::GlyphSet& SVGFontExport::implGetGlyphSet( const vcl::Font& rFont
{
FontWeight eWeight( WEIGHT_NORMAL );
FontItalic eItalic( ITALIC_NONE );
- OUString aFontName( rFont.GetFamilyName() );
+ const OUString& aFontName( rFont.GetFamilyName() );
sal_Int32 nNextTokenPos( 0 );
switch( rFont.GetWeight() )
diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx
index 4dcde82bc265..a81b3767c012 100644
--- a/filter/source/svg/svgreader.cxx
+++ b/filter/source/svg/svgreader.cxx
@@ -1853,14 +1853,13 @@ struct ShapeWritingVisitor
void writePathShape( rtl::Reference<SvXMLAttributeList>& xAttrs,
const uno::Reference<xml::sax::XAttributeList>& xUnoAttrs,
const uno::Reference<xml::dom::XElement>& xElem,
- const OUString& rStyleId,
+ const OUString& rStyleId,
const basegfx::B2DPolyPolygon& rPoly )
{
// we might need to split up polypolygon into multiple path
// shapes (e.g. when emulating line stroking)
std::vector<basegfx::B2DPolyPolygon> aPolys(1,rPoly);
State aState = maCurrState;
- OUString aStyleId(rStyleId);
xAttrs->Clear();
@@ -1889,7 +1888,7 @@ struct ShapeWritingVisitor
fillShapeProperties(xAttrs,
xElem,
aBounds,
- "svggraphicstyle"+aStyleId);
+ "svggraphicstyle"+rStyleId);
// force path coordinates to 100th millimeter, after
// putting polygon data at origin (ODF viewbox
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 33d250109848..e3ea5b170319 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -1668,8 +1668,6 @@ void SVGTextWriter::implWriteTextPortion( const Point& rPos,
mpContext->AddPaintAttr( COL_TRANSPARENT, aTextColor );
- OUString sTextContent = rText;
-
// <a> tag for link should be the innermost tag, inside <tspan>
if( !mbIsPlaceholderShape && mbIsURLField && !msUrl.isEmpty() )
{
@@ -1680,16 +1678,16 @@ void SVGTextWriter::implWriteTextPortion( const Point& rPos,
mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrXLinkHRef, msUrl );
{
SvXMLElementExport aSVGAElem( mrExport, XML_NAMESPACE_NONE, aXMLElemA, mbIWS, mbIWS );
- mrExport.GetDocHandler()->characters( sTextContent );
+ mrExport.GetDocHandler()->characters( rText );
}
}
else
{
SvXMLElementExport aSVGTspanElem( mrExport, XML_NAMESPACE_NONE, aXMLElemTspan, mbIWS, mbIWS );
- mrExport.GetDocHandler()->characters( sTextContent );
+ mrExport.GetDocHandler()->characters( rText );
}
- mnTextWidth += mpVDev->GetTextWidth( sTextContent );
+ mnTextWidth += mpVDev->GetTextWidth( rText );
}
@@ -2512,16 +2510,15 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const OUString& rText,
if( mbIsPlaceholderShape )
{
- OUString sTextContent = rText;
- bIsPlaceholderField = sTextContent.match( sPlaceholderTag );
+ bIsPlaceholderField = rText.match( sPlaceholderTag );
// for a placeholder text field we export only one <text> svg element
if( bIsPlaceholderField )
{
OUString sCleanTextContent;
static const sal_Int32 nFrom = sPlaceholderTag.getLength();
- if( sTextContent.getLength() > nFrom )
+ if( rText.getLength() > nFrom )
{
- sCleanTextContent = sTextContent.copy( nFrom );
+ sCleanTextContent = rText.copy( nFrom );
}
mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", "PlaceholderText" );
mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrX, OUString::number( aPos.X() ) );
@@ -3686,8 +3683,7 @@ void SAL_CALL SVGWriter::write( const Reference<XDocumentHandler>& rxDocHandler,
ReadGDIMetaFile( aMemStm, aMtf );
- const Reference< XDocumentHandler > xDocumentHandler( rxDocHandler );
- Reference<SVGExport> pWriter(new SVGExport( mxContext, xDocumentHandler, maFilterData ));
+ Reference<SVGExport> pWriter(new SVGExport( mxContext, rxDocHandler, maFilterData ));
pWriter->writeMtf( aMtf );
}
diff --git a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx
index 429fdc5f9033..d177204a726d 100644
--- a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx
+++ b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx
@@ -67,8 +67,8 @@ using namespace ::com::sun::star::task;
bool SAL_CALL XmlFilterAdaptor::importImpl( const Sequence< css::beans::PropertyValue >& aDescriptor )
throw (RuntimeException, std::exception)
{
- OUString udConvertClass=msUserData[0];
- OUString udImport =msUserData[2];
+ OUString udConvertClass = msUserData[0];
+ const OUString sXMLImportService = msUserData[2];
sal_Int32 nSteps= 0;
sal_Int32 nProgressRange = 4;
@@ -80,7 +80,6 @@ bool SAL_CALL XmlFilterAdaptor::importImpl( const Sequence< css::beans::Property
xStatusIndicator->start( "Loading :",nProgressRange);
}
- OUString sXMLImportService ( udImport );
Reference < XParser > xSaxParser = Parser::create( mxContext );
Sequence< Any > aAnys(1);
diff --git a/formula/source/ui/dlg/FormulaHelper.cxx b/formula/source/ui/dlg/FormulaHelper.cxx
index 73a5dd695292..2ffe25e35c0c 100644
--- a/formula/source/ui/dlg/FormulaHelper.cxx
+++ b/formula/source/ui/dlg/FormulaHelper.cxx
@@ -91,7 +91,6 @@ bool FormulaHelper::GetNextFunc( const OUString& rFormula,
if ( ppFDesc )
{
*ppFDesc = nullptr;
- const OUString sTemp( aFname );
const sal_uInt32 nCategoryCount = m_pFunctionManager->getCount();
for(sal_uInt32 j= 0; j < nCategoryCount && !*ppFDesc; ++j)
{
@@ -100,7 +99,7 @@ bool FormulaHelper::GetNextFunc( const OUString& rFormula,
for(sal_uInt32 i = 0 ; i < nCount; ++i)
{
const IFunctionDescription* pCurrent = pCategory->getFunction(i);
- if ( pCurrent->getFunctionName().equalsIgnoreAsciiCase(sTemp) )
+ if ( pCurrent->getFunctionName().equalsIgnoreAsciiCase(aFname) )
{
*ppFDesc = pCurrent;
break;
diff --git a/formula/source/ui/dlg/funcpage.cxx b/formula/source/ui/dlg/funcpage.cxx
index d629ca3bea3f..77bf5167536b 100644
--- a/formula/source/ui/dlg/funcpage.cxx
+++ b/formula/source/ui/dlg/funcpage.cxx
@@ -38,9 +38,7 @@ FormulaListBox::FormulaListBox( vcl::Window* pParent, WinBits nBits ):
void FormulaListBox::KeyInput( const KeyEvent& rKEvt )
{
- KeyEvent aKEvt=rKEvt;
-
- if(aKEvt.GetCharCode()==' ')
+ if(rKEvt.GetCharCode()==' ')
DoubleClick();
}
diff --git a/framework/inc/uielement/toolbarmerger.hxx b/framework/inc/uielement/toolbarmerger.hxx
index 4ad1467bbe64..683af8635d5e 100644
--- a/framework/inc/uielement/toolbarmerger.hxx
+++ b/framework/inc/uielement/toolbarmerger.hxx
@@ -87,8 +87,7 @@ class ToolBarMerger
static ReferenceToolbarPathInfo FindReferencePoint( ToolBox* pToolbar,
const OUString& rReferencePoint );
- static bool ProcessMergeOperation( const css::uno::Reference< css::frame::XFrame >& xFrame,
- ToolBox* pToolbar,
+ static bool ProcessMergeOperation( ToolBox* pToolbar,
sal_uInt16 nPos,
sal_uInt16& rItemId,
CommandToInfoMap& rCommandMap,
@@ -97,8 +96,7 @@ class ToolBarMerger
const OUString& rMergeCommandParameter,
const AddonToolbarItemContainer& rItems );
- static bool ProcessMergeFallback( const css::uno::Reference< css::frame::XFrame >& xFrame,
- ToolBox* pToolbar,
+ static bool ProcessMergeFallback( ToolBox* pToolbar,
sal_uInt16 nPos,
sal_uInt16& rItemId,
CommandToInfoMap& rCommandMap,
@@ -107,8 +105,7 @@ class ToolBarMerger
const OUString& rMergeFallback,
const AddonToolbarItemContainer& rItems );
- static bool MergeItems( const css::uno::Reference< css::frame::XFrame >& xFrame,
- ToolBox* pToolbar,
+ static bool MergeItems( ToolBox* pToolbar,
sal_uInt16 nPos,
sal_uInt16 nModIndex,
sal_uInt16& rItemId,
@@ -116,8 +113,7 @@ class ToolBarMerger
const OUString& rModuleIdentifier,
const AddonToolbarItemContainer& rAddonToolbarItems );
- static bool ReplaceItem( const css::uno::Reference< css::frame::XFrame >& xFrame,
- ToolBox* pToolbar,
+ static bool ReplaceItem( ToolBox* pToolbar,
sal_uInt16 nPos,
sal_uInt16& rItemId,
CommandToInfoMap& rCommandMap,
diff --git a/framework/source/dispatch/dispatchprovider.cxx b/framework/source/dispatch/dispatchprovider.cxx
index 28ab6e4a5ce1..846b12146dec 100644
--- a/framework/source/dispatch/dispatchprovider.cxx
+++ b/framework/source/dispatch/dispatchprovider.cxx
@@ -251,8 +251,6 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_queryFrame
// 0) Some URLs are dispatched in a generic way (e.g. by the menu) using the default target "".
// But they are specified to use her own fix target. Detect such URLs here and use the correct target.
- OUString sTargetName = sTargetFrameName;
-
// I) handle special cases which not right for using findFrame() first
// I.I) "_blank", "_default"
@@ -261,20 +259,20 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_queryFrame
// here. Thats why we must "intercept" here.
if (
- (sTargetName==SPECIALTARGET_BLANK ) ||
- (sTargetName==SPECIALTARGET_DEFAULT)
+ (sTargetFrameName==SPECIALTARGET_BLANK ) ||
+ (sTargetFrameName==SPECIALTARGET_DEFAULT)
)
{
css::uno::Reference< css::frame::XDispatchProvider > xParent( xFrame->getCreator(), css::uno::UNO_QUERY );
if (xParent.is())
- xDispatcher = xParent->queryDispatch(aURL, sTargetName, 0); // it's a special target - ignore search flags
+ xDispatcher = xParent->queryDispatch(aURL, sTargetFrameName, 0); // it's a special target - ignore search flags
}
// I.II) "_beamer"
// Special sub frame of a top frame only. Search or create it. ... OK it's currently a little bit HACKI.
// Only the sfx (means the controller) can create it.
- else if (sTargetName==SPECIALTARGET_BEAMER)
+ else if (sTargetFrameName==SPECIALTARGET_BEAMER)
{
css::uno::Reference< css::frame::XDispatchProvider > xBeamer( xFrame->findFrame( SPECIALTARGET_BEAMER, css::frame::FrameSearchFlag::CHILDREN | css::frame::FrameSearchFlag::SELF ), css::uno::UNO_QUERY );
if (xBeamer.is())
@@ -294,7 +292,7 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_queryFrame
// I.IV) "_parent"
// Our parent frame (if it exist) should handle this URL.
- else if (sTargetName==SPECIALTARGET_PARENT)
+ else if (sTargetFrameName==SPECIALTARGET_PARENT)
{
css::uno::Reference< css::frame::XDispatchProvider > xParent( xFrame->getCreator(), css::uno::UNO_QUERY );
if (xParent.is())
@@ -306,7 +304,7 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_queryFrame
// This request must be forwarded to any parent frame, till we reach a top frame.
// If no parent exist, we can handle itself.
- else if (sTargetName==SPECIALTARGET_TOP)
+ else if (sTargetFrameName==SPECIALTARGET_TOP)
{
if (xFrame->isTop())
{
@@ -332,8 +330,8 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_queryFrame
// we load it into the frame by returning specilized dispatch object.
else if (
- (sTargetName==SPECIALTARGET_SELF) ||
- (sTargetName.isEmpty())
+ (sTargetFrameName==SPECIALTARGET_SELF) ||
+ (sTargetFrameName.isEmpty())
)
{
// There exist a hard coded interception for special URLs.
@@ -396,7 +394,7 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_queryFrame
nRightFlags &= ~css::frame::FrameSearchFlag::CREATE;
// try to find any existing target and ask him for his dispatcher
- css::uno::Reference< css::frame::XFrame > xFoundFrame = xFrame->findFrame(sTargetName, nRightFlags);
+ css::uno::Reference< css::frame::XFrame > xFoundFrame = xFrame->findFrame(sTargetFrameName, nRightFlags);
if (xFoundFrame.is())
{
// Attention: Found target is our own owner frame!
@@ -423,7 +421,7 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_queryFrame
{
css::uno::Reference< css::frame::XDispatchProvider > xParent( xFrame->getCreator(), css::uno::UNO_QUERY );
if (xParent.is())
- xDispatcher = xParent->queryDispatch(aURL, sTargetName, css::frame::FrameSearchFlag::CREATE);
+ xDispatcher = xParent->queryDispatch(aURL, sTargetFrameName, css::frame::FrameSearchFlag::CREATE);
}
}
diff --git a/framework/source/fwe/classes/addonsoptions.cxx b/framework/source/fwe/classes/addonsoptions.cxx
index 82a519b6244f..406e4663bcf1 100644
--- a/framework/source/fwe/classes/addonsoptions.cxx
+++ b/framework/source/fwe/classes/addonsoptions.cxx
@@ -771,16 +771,15 @@ void AddonsOptions_Impl::ReadMenuMergeInstructions( MergeMenuInstructionContaine
const OUString aMenuMergeRootName( "AddonUI/OfficeMenuBarMerging/" );
Sequence< OUString > aAddonMergeNodesSeq = GetNodeNames( aMenuMergeRootName );
- OUString aAddonMergeNode( aMenuMergeRootName );
- sal_uInt32 nCount = aAddonMergeNodesSeq.getLength();
+ sal_uInt32 nCount = aAddonMergeNodesSeq.getLength();
// Init the property value sequence
Sequence< OUString > aNodePropNames( 5 );
for ( sal_uInt32 i = 0; i < nCount; i++ )
{
- OUString aMergeAddonInstructions( aAddonMergeNode + aAddonMergeNodesSeq[i] );
+ OUString aMergeAddonInstructions( aMenuMergeRootName + aAddonMergeNodesSeq[i] );
Sequence< OUString > aAddonInstMergeNodesSeq = GetNodeNames( aMergeAddonInstructions );
sal_uInt32 nCountAddons = aAddonInstMergeNodesSeq.getLength();
@@ -849,16 +848,14 @@ void AddonsOptions_Impl::ReadToolbarMergeInstructions( ToolbarMergingInstruction
const OUString aToolbarMergeRootName( "AddonUI/OfficeToolbarMerging/" );
Sequence< OUString > aAddonMergeNodesSeq = GetNodeNames( aToolbarMergeRootName );
- OUString aAddonMergeNode( aToolbarMergeRootName );
-
- sal_uInt32 nCount = aAddonMergeNodesSeq.getLength();
+ sal_uInt32 nCount = aAddonMergeNodesSeq.getLength();
// Init the property value sequence
Sequence< OUString > aNodePropNames( 6 );
for ( sal_uInt32 i = 0; i < nCount; i++ )
{
- OUString aMergeAddonInstructions( aAddonMergeNode + aAddonMergeNodesSeq[i] );
+ OUString aMergeAddonInstructions( aToolbarMergeRootName + aAddonMergeNodesSeq[i] );
Sequence< OUString > aAddonInstMergeNodesSeq = GetNodeNames( aMergeAddonInstructions );
sal_uInt32 nCountAddons = aAddonInstMergeNodesSeq.getLength();
@@ -929,14 +926,13 @@ void AddonsOptions_Impl::ReadStatusbarMergeInstructions( MergeStatusbarInstructi
const ::rtl::OUString aStatusbarMergeRootName( "AddonUI/OfficeStatusbarMerging/" );
Sequence< ::rtl::OUString > aAddonMergeNodesSeq = GetNodeNames( aStatusbarMergeRootName );
- ::rtl::OUString aAddonMergeNode( aStatusbarMergeRootName );
sal_uInt32 nCount = aAddonMergeNodesSeq.getLength();
Sequence< ::rtl::OUString > aNodePropNames( 5 );
for ( sal_uInt32 i = 0; i < nCount; i++ )
{
- ::rtl::OUString aMergeAddonInstructions( aAddonMergeNode + aAddonMergeNodesSeq[i] );
+ ::rtl::OUString aMergeAddonInstructions( aStatusbarMergeRootName + aAddonMergeNodesSeq[i] );
Sequence< ::rtl::OUString > aAddonInstMergeNodesSeq = GetNodeNames( aMergeAddonInstructions );
sal_uInt32 nCountAddons = aAddonInstMergeNodesSeq.getLength();
diff --git a/framework/source/fwe/xml/menudocumenthandler.cxx b/framework/source/fwe/xml/menudocumenthandler.cxx
index e3cb6b54f176..8055034ad041 100644
--- a/framework/source/fwe/xml/menudocumenthandler.cxx
+++ b/framework/source/fwe/xml/menudocumenthandler.cxx
@@ -362,7 +362,7 @@ throw( SAXException, RuntimeException, std::exception )
for ( sal_Int16 i=0; i< xAttrList->getLength(); i++ )
{
OUString aName = xAttrList->getNameByIndex( i );
- OUString aValue = xAttrList->getValueByIndex( i );
+ const OUString aValue = xAttrList->getValueByIndex( i );
if ( aName == ATTRIBUTE_ID )
aCommandId = aValue;
else if ( aName == ATTRIBUTE_LABEL )
@@ -371,11 +371,10 @@ throw( SAXException, RuntimeException, std::exception )
aHelpId = aValue;
else if ( aName == ATTRIBUTE_STYLE )
{
- OUString aTemp( aValue );
sal_Int32 nIndex = 0;
do
{
- OUString aToken = aTemp.getToken( 0, '+', nIndex );
+ OUString aToken = aValue.getToken( 0, '+', nIndex );
if ( !aToken.isEmpty() )
{
if ( aToken == ATTRIBUTE_ITEMSTYLE_TEXT )
@@ -573,7 +572,7 @@ throw( SAXException, RuntimeException, std::exception )
for ( sal_Int16 i=0; i< xAttrList->getLength(); i++ )
{
OUString aName = xAttrList->getNameByIndex( i );
- OUString aValue = xAttrList->getValueByIndex( i );
+ const OUString aValue = xAttrList->getValueByIndex( i );
if ( aName == ATTRIBUTE_ID )
aCommandId = aValue;
else if ( aName == ATTRIBUTE_LABEL )
@@ -582,11 +581,10 @@ throw( SAXException, RuntimeException, std::exception )
aHelpId = aValue;
else if ( aName == ATTRIBUTE_STYLE )
{
- OUString aTemp( aValue );
sal_Int32 nIndex = 0;
do
{
- OUString aToken = aTemp.getToken( 0, '+', nIndex );
+ OUString aToken = aValue.getToken( 0, '+', nIndex );
if ( !aToken.isEmpty() )
{
if ( aToken == ATTRIBUTE_ITEMSTYLE_TEXT )
@@ -630,7 +628,7 @@ throw( SAXException, RuntimeException, std::exception )
for ( sal_Int16 i=0; i< xAttrList->getLength(); i++ )
{
OUString aName = xAttrList->getNameByIndex( i );
- OUString aValue = xAttrList->getValueByIndex( i );
+ const OUString aValue = xAttrList->getValueByIndex( i );
if ( aName == ATTRIBUTE_ID )
aCommandId = aValue;
else if ( aName == ATTRIBUTE_LABEL )
@@ -639,11 +637,10 @@ throw( SAXException, RuntimeException, std::exception )
aHelpId = aValue;
else if ( aName == ATTRIBUTE_STYLE )
{
- OUString aTemp( aValue );
sal_Int32 nIndex = 0;
do
{
- OUString aToken = aTemp.getToken( 0, '+', nIndex );
+ OUString aToken = aValue.getToken( 0, '+', nIndex );
if ( !aToken.isEmpty() )
{
if ( aToken == ATTRIBUTE_ITEMSTYLE_TEXT )
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index f2c598a9efc2..4dede28936c1 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -490,15 +490,11 @@ bool LayoutManager::readWindowStateData( const OUString& aName, UIElement& rElem
GlobalSettings* &rGlobalSettings, bool &bInGlobalSettings,
const Reference< XComponentContext > &rComponentContext )
{
- SolarMutexResettableGuard aWriteLock;
- Reference< XNameAccess > xPersistentWindowState( rPersistentWindowState );
- aWriteLock.clear();
-
- if ( xPersistentWindowState.is() )
+ if ( rPersistentWindowState.is() )
{
bool bGetSettingsState( false );
- aWriteLock.reset();
+ SolarMutexResettableGuard aWriteLock;
bool bGlobalSettings( bInGlobalSettings );
GlobalSettings* pGlobalSettings( nullptr );
if ( rGlobalSettings == nullptr )
@@ -512,7 +508,7 @@ bool LayoutManager::readWindowStateData( const OUString& aName, UIElement& rElem
try
{
Sequence< PropertyValue > aWindowState;
- if ( xPersistentWindowState->hasByName( aName ) && (xPersistentWindowState->getByName( aName ) >>= aWindowState) )
+ if ( rPersistentWindowState->hasByName( aName ) && (rPersistentWindowState->getByName( aName ) >>= aWindowState) )
{
bool bValue( false );
for ( sal_Int32 n = 0; n < aWindowState.getLength(); n++ )
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
index 9dff9b9c1fd3..785ca6f9ca81 100644
--- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
@@ -1406,13 +1406,12 @@ void ToolbarLayoutManager::implts_setElementData( UIElement& rElement, const uno
bool bShowElement( rElement.m_bVisible && !rElement.m_bMasterHide && implts_isParentWindowVisible() );
aReadLock.clear();
- uno::Reference< awt::XDockableWindow > xDockWindow( rDockWindow );
- uno::Reference< awt::XWindow2 > xWindow( xDockWindow, uno::UNO_QUERY );
+ uno::Reference< awt::XWindow2 > xWindow( rDockWindow, uno::UNO_QUERY );
vcl::Window* pWindow( nullptr );
ToolBox* pToolBox( nullptr );
- if ( xDockWindow.is() && xWindow.is() )
+ if ( rDockWindow.is() && xWindow.is() )
{
{
SolarMutexGuard aGuard;
@@ -1450,7 +1449,7 @@ void ToolbarLayoutManager::implts_setElementData( UIElement& rElement, const uno
bool bUndefPos = hasDefaultPosValue( rElement.m_aFloatingData.m_aPos );
bool bSetSize = ( rElement.m_aFloatingData.m_aSize.Width != 0 &&
rElement.m_aFloatingData.m_aSize.Height != 0 );
- xDockWindow->setFloatingMode( sal_True );
+ rDockWindow->setFloatingMode( sal_True );
if ( bUndefPos )
{
aPos = implts_findNextCascadeFloatingPos();
@@ -1501,9 +1500,9 @@ void ToolbarLayoutManager::implts_setElementData( UIElement& rElement, const uno
SolarMutexGuard aGuard;
pToolBox->SetAlign( ImplConvertAlignment(rElement.m_aDockedData.m_nDockedArea ) );
pToolBox->SetLineCount( 1 );
- xDockWindow->setFloatingMode( sal_False );
+ rDockWindow->setFloatingMode( sal_False );
if ( rElement.m_aDockedData.m_bLocked )
- xDockWindow->lock();
+ rDockWindow->lock();
aSize = pToolBox->CalcWindowSizePixel();
bSetSize = true;
diff --git a/framework/source/services/pathsettings.cxx b/framework/source/services/pathsettings.cxx
index befd73f17dbc..8172e015f907 100644
--- a/framework/source/services/pathsettings.cxx
+++ b/framework/source/services/pathsettings.cxx
@@ -840,7 +840,6 @@ PathSettings::EChangeOp PathSettings::impl_updatePath(const OUString& sPath
css::uno::Sequence< sal_Int32 > PathSettings::impl_mapPathName2IDList(const OUString& sPath)
{
- OUString sOldStyleProp = sPath;
OUString sInternalProp = sPath+POSTFIX_INTERNAL_PATHS;
OUString sUserProp = sPath+POSTFIX_USER_PATHS;
OUString sWriteProp = sPath+POSTFIX_WRITE_PATH;
@@ -865,7 +864,7 @@ css::uno::Sequence< sal_Int32 > PathSettings::impl_mapPathName2IDList(const OUSt
{
const css::beans::Property& rProp = m_lPropDesc[i];
- if (rProp.Name.equals(sOldStyleProp))
+ if (rProp.Name.equals(sPath))
lIDs[IDGROUP_OLDSTYLE] = rProp.Handle;
else
if (rProp.Name.equals(sInternalProp))
diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx
index 3c7493619477..902e277afffb 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -1293,8 +1293,7 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF
// Set image for the addon popup menu item
if ( bItemShowMenuImages && !pPopup->GetItemImage( ITEMID_ADDONLIST ))
{
- Reference< XFrame > xTemp( rFrame );
- Image aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand( aItemCommand, false, xTemp );
+ Image aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand( aItemCommand, false, rFrame );
if ( !!aImage )
pPopup->SetItemImage( ITEMID_ADDONLIST, aImage );
}
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index 09f754b73da0..f0ae7ef86e4c 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -1109,8 +1109,7 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine
if ( aRefPoint.bResult )
{
- ToolBarMerger::ProcessMergeOperation( m_xFrame,
- m_pToolBar,
+ ToolBarMerger::ProcessMergeOperation( m_pToolBar,
aRefPoint.nPos,
nItemId,
m_aCommandMap,
@@ -1121,8 +1120,7 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine
}
else
{
- ToolBarMerger::ProcessMergeFallback( m_xFrame,
- m_pToolBar,
+ ToolBarMerger::ProcessMergeFallback( m_pToolBar,
aRefPoint.nPos,
nItemId,
m_aCommandMap,
diff --git a/framework/source/uielement/toolbarmerger.cxx b/framework/source/uielement/toolbarmerger.cxx
index 0a7fb0299a58..db77987a0f17 100644
--- a/framework/source/uielement/toolbarmerger.cxx
+++ b/framework/source/uielement/toolbarmerger.cxx
@@ -264,11 +264,6 @@ ReferenceToolbarPathInfo ToolBarMerger::FindReferencePoint(
Processes a merge operation.
@param
- xFrame
-
- Must be a valid reference to a frame.
-
- @param
pToolbar
A valid pointer to the toolbar where the merge
@@ -312,7 +307,6 @@ ReferenceToolbarPathInfo ToolBarMerger::FindReferencePoint(
false.
*/
bool ToolBarMerger::ProcessMergeOperation(
- const uno::Reference< frame::XFrame >& xFrame,
ToolBox* pToolbar,
sal_uInt16 nPos,
sal_uInt16& rItemId,
@@ -323,11 +317,11 @@ bool ToolBarMerger::ProcessMergeOperation(
const AddonToolbarItemContainer& rItems )
{
if ( rMergeCommand == MERGECOMMAND_ADDAFTER )
- return MergeItems( xFrame, pToolbar, nPos, 1, rItemId, rCommandMap, rModuleIdentifier, rItems );
+ return MergeItems( pToolbar, nPos, 1, rItemId, rCommandMap, rModuleIdentifier, rItems );
else if ( rMergeCommand == MERGECOMMAND_ADDBEFORE )
- return MergeItems( xFrame, pToolbar, nPos, 0, rItemId, rCommandMap, rModuleIdentifier, rItems );
+ return MergeItems( pToolbar, nPos, 0, rItemId, rCommandMap, rModuleIdentifier, rItems );
else if ( rMergeCommand == MERGECOMMAND_REPLACE )
- return ReplaceItem( xFrame, pToolbar, nPos, rItemId, rCommandMap, rModuleIdentifier, rItems );
+ return ReplaceItem( pToolbar, nPos, rItemId, rCommandMap, rModuleIdentifier, rItems );
else if ( rMergeCommand == MERGECOMMAND_REMOVE )
return RemoveItems( pToolbar, nPos, rMergeCommandParameter );
@@ -338,11 +332,6 @@ bool ToolBarMerger::ProcessMergeOperation(
Processes a merge fallback operation.
@param
- xFrame
-
- Must be a valid reference to a frame.
-
- @param
pToolbar
A valid pointer to the toolbar where the merge
@@ -381,7 +370,6 @@ bool ToolBarMerger::ProcessMergeOperation(
false.
*/
bool ToolBarMerger::ProcessMergeFallback(
- const css::uno::Reference< css::frame::XFrame >& xFrame,
ToolBox* pToolbar,
sal_uInt16 /*nPos*/,
sal_uInt16& rItemId,
@@ -401,9 +389,9 @@ bool ToolBarMerger::ProcessMergeFallback(
( rMergeCommand == MERGECOMMAND_ADDAFTER ) )
{
if ( rMergeFallback == MERGEFALLBACK_ADDFIRST )
- return MergeItems( xFrame, pToolbar, 0, 0, rItemId, rCommandMap, rModuleIdentifier, rItems );
+ return MergeItems( pToolbar, 0, 0, rItemId, rCommandMap, rModuleIdentifier, rItems );
else if ( rMergeFallback == MERGEFALLBACK_ADDLAST )
- return MergeItems( xFrame, pToolbar, TOOLBOX_APPEND, 0, rItemId, rCommandMap, rModuleIdentifier, rItems );
+ return MergeItems( pToolbar, TOOLBOX_APPEND, 0, rItemId, rCommandMap, rModuleIdentifier, rItems );
}
return false;
@@ -413,11 +401,6 @@ bool ToolBarMerger::ProcessMergeFallback(
Merges (adds) toolbar items into an existing toolbar.
@param
- xFrame
-
- Must be a valid reference to a frame.
-
- @param
pToolbar
A valid pointer to the toolbar where the merge
@@ -451,7 +434,6 @@ bool ToolBarMerger::ProcessMergeFallback(
false.
*/
bool ToolBarMerger::MergeItems(
- const uno::Reference< frame::XFrame >& rFrame,
ToolBox* pToolbar,
sal_uInt16 nPos,
sal_uInt16 nModIndex,
@@ -462,8 +444,6 @@ bool ToolBarMerger::MergeItems(
{
const sal_Int32 nSize( rAddonToolbarItems.size() );
- uno::Reference< frame::XFrame > xFrame( rFrame );
-
sal_uInt16 nIndex( 0 );
for ( sal_Int32 i = 0; i < nSize; i++ )
{
@@ -507,11 +487,6 @@ bool ToolBarMerger::MergeItems(
existing toolbar.
@param
- xFrame
-
- Must be a valid reference to a frame.
-
- @param
pToolbar
A valid pointer to the toolbar where the merge
@@ -545,7 +520,6 @@ bool ToolBarMerger::MergeItems(
false.
*/
bool ToolBarMerger::ReplaceItem(
- const uno::Reference< frame::XFrame >& xFrame,
ToolBox* pToolbar,
sal_uInt16 nPos,
sal_uInt16& rItemId,
@@ -554,7 +528,7 @@ bool ToolBarMerger::ReplaceItem(
const AddonToolbarItemContainer& rAddonToolbarItems )
{
pToolbar->RemoveItem( nPos );
- return MergeItems( xFrame, pToolbar, nPos, 0, rItemId, rCommandMap, rModuleIdentifier, rAddonToolbarItems );
+ return MergeItems( pToolbar, nPos, 0, rItemId, rCommandMap, rModuleIdentifier, rAddonToolbarItems );
}
/**
diff --git a/i18npool/source/search/textsearch.cxx b/i18npool/source/search/textsearch.cxx
index dab32d11b1a5..060450947998 100644
--- a/i18npool/source/search/textsearch.cxx
+++ b/i18npool/source/search/textsearch.cxx
@@ -685,8 +685,7 @@ SearchResult TextSearch::NSrchFrwrd( const OUString& searchStr, sal_Int32 startP
OUString sSearchKey = bUsePrimarySrchStr ? sSrchStr : sSrchStr2;
- OUString aStr( searchStr );
- sal_Int32 nSuchIdx = aStr.getLength();
+ sal_Int32 nSuchIdx = searchStr.getLength();
sal_Int32 nEnde = endPos;
if( !nSuchIdx || !sSearchKey.getLength() || sSearchKey.getLength() > nSuchIdx )
return aRet;
@@ -704,15 +703,15 @@ SearchResult TextSearch::NSrchFrwrd( const OUString& searchStr, sal_Int32 startP
for (sal_Int32 nCmpIdx = startPos; // start position for the search
nCmpIdx <= nEnde;
- nCmpIdx += GetDiff( aStr[nCmpIdx + sSearchKey.getLength()-1]))
+ nCmpIdx += GetDiff( searchStr[nCmpIdx + sSearchKey.getLength()-1]))
{
// if the match would be the completed cells, skip it.
- if ( (checkCTLStart && !isCellStart( aStr, nCmpIdx )) || (checkCTLEnd
- && !isCellStart( aStr, nCmpIdx + sSearchKey.getLength())) )
+ if ( (checkCTLStart && !isCellStart( searchStr, nCmpIdx )) || (checkCTLEnd
+ && !isCellStart( searchStr, nCmpIdx + sSearchKey.getLength())) )
continue;
nSuchIdx = sSearchKey.getLength() - 1;
- while( nSuchIdx >= 0 && sSearchKey[nSuchIdx] == aStr[nCmpIdx + nSuchIdx])
+ while( nSuchIdx >= 0 && sSearchKey[nSuchIdx] == searchStr[nCmpIdx + nSuchIdx])
{
if( nSuchIdx == 0 )
{
@@ -721,8 +720,8 @@ SearchResult TextSearch::NSrchFrwrd( const OUString& searchStr, sal_Int32 startP
sal_Int32 nFndEnd = nCmpIdx + sSearchKey.getLength();
bool bAtStart = !nCmpIdx;
bool bAtEnd = nFndEnd == endPos;
- bool bDelimBefore = bAtStart || IsDelimiter( aStr, nCmpIdx-1 );
- bool bDelimBehind = bAtEnd || IsDelimiter( aStr, nFndEnd );
+ bool bDelimBefore = bAtStart || IsDelimiter( searchStr, nCmpIdx-1 );
+ bool bDelimBehind = bAtEnd || IsDelimiter( searchStr, nFndEnd );
// * 1 -> only one word in the paragraph
// * 2 -> at begin of paragraph
// * 3 -> at end of paragraph
@@ -757,8 +756,7 @@ SearchResult TextSearch::NSrchBkwrd( const OUString& searchStr, sal_Int32 startP
OUString sSearchKey = bUsePrimarySrchStr ? sSrchStr : sSrchStr2;
- OUString aStr( searchStr );
- sal_Int32 nSuchIdx = aStr.getLength();
+ sal_Int32 nSuchIdx = searchStr.getLength();
sal_Int32 nEnde = endPos;
if( nSuchIdx == 0 || sSearchKey.isEmpty() || sSearchKey.getLength() > nSuchIdx)
return aRet;
@@ -778,13 +776,13 @@ SearchResult TextSearch::NSrchBkwrd( const OUString& searchStr, sal_Int32 startP
while (nCmpIdx >= nEnde)
{
// if the match would be the completed cells, skip it.
- if ( (!checkCTLStart || isCellStart( aStr, nCmpIdx -
+ if ( (!checkCTLStart || isCellStart( searchStr, nCmpIdx -
sSearchKey.getLength() )) && (!checkCTLEnd ||
- isCellStart( aStr, nCmpIdx)))
+ isCellStart( searchStr, nCmpIdx)))
{
nSuchIdx = 0;
while( nSuchIdx < sSearchKey.getLength() && sSearchKey[nSuchIdx] ==
- aStr[nCmpIdx + nSuchIdx - sSearchKey.getLength()] )
+ searchStr[nCmpIdx + nSuchIdx - sSearchKey.getLength()] )
nSuchIdx++;
if( nSuchIdx >= sSearchKey.getLength() )
{
@@ -793,9 +791,9 @@ SearchResult TextSearch::NSrchBkwrd( const OUString& searchStr, sal_Int32 startP
sal_Int32 nFndStt = nCmpIdx - sSearchKey.getLength();
bool bAtStart = !nFndStt;
bool bAtEnd = nCmpIdx == startPos;
- bool bDelimBehind = bAtEnd || IsDelimiter( aStr, nCmpIdx );
+ bool bDelimBehind = bAtEnd || IsDelimiter( searchStr, nCmpIdx );
bool bDelimBefore = bAtStart || // begin of paragraph
- IsDelimiter( aStr, nFndStt-1 );
+ IsDelimiter( searchStr, nFndStt-1 );
// * 1 -> only one word in the paragraph
// * 2 -> at begin of paragraph
// * 3 -> at end of paragraph
@@ -824,7 +822,7 @@ SearchResult TextSearch::NSrchBkwrd( const OUString& searchStr, sal_Int32 startP
}
}
}
- nSuchIdx = GetDiff( aStr[nCmpIdx - sSearchKey.getLength()] );
+ nSuchIdx = GetDiff( searchStr[nCmpIdx - sSearchKey.getLength()] );
if( nCmpIdx < nSuchIdx )
return aRet;
nCmpIdx -= nSuchIdx;
@@ -1050,11 +1048,9 @@ SearchResult TextSearch::ApproxSrchFrwrd( const OUString& searchStr,
if( !xBreak.is() )
return aRet;
- OUString aWTemp( searchStr );
-
sal_Int32 nStt, nEnd;
- Boundary aWBnd = xBreak->getWordBoundary( aWTemp, startPos,
+ Boundary aWBnd = xBreak->getWordBoundary( searchStr, startPos,
aSrchPara.Locale,
WordType::ANYWORD_IGNOREWHITESPACES, sal_True );
@@ -1066,7 +1062,7 @@ SearchResult TextSearch::ApproxSrchFrwrd( const OUString& searchStr,
nEnd = aWBnd.endPos > endPos ? endPos : aWBnd.endPos;
if( nStt < nEnd &&
- pWLD->WLD( aWTemp.getStr() + nStt, nEnd - nStt ) <= nLimit )
+ pWLD->WLD( searchStr.getStr() + nStt, nEnd - nStt ) <= nLimit )
{
aRet.subRegExpressions = 1;
aRet.startOffset.realloc( 1 );
@@ -1077,10 +1073,10 @@ SearchResult TextSearch::ApproxSrchFrwrd( const OUString& searchStr,
}
nStt = nEnd - 1;
- aWBnd = xBreak->nextWord( aWTemp, nStt, aSrchPara.Locale,
+ aWBnd = xBreak->nextWord( searchStr, nStt, aSrchPara.Locale,
WordType::ANYWORD_IGNOREWHITESPACES);
} while( aWBnd.startPos != aWBnd.endPos ||
- (aWBnd.endPos != aWTemp.getLength() && aWBnd.endPos != nEnd) );
+ (aWBnd.endPos != searchStr.getLength() && aWBnd.endPos != nEnd) );
// #i50244# aWBnd.endPos != nEnd : in case there is _no_ word (only
// whitespace) in searchStr, getWordBoundary() returned startPos,startPos
// and nextWord() does also => don't loop forever.
@@ -1097,11 +1093,9 @@ SearchResult TextSearch::ApproxSrchBkwrd( const OUString& searchStr,
if( !xBreak.is() )
return aRet;
- OUString aWTemp( searchStr );
-
sal_Int32 nStt, nEnd;
- Boundary aWBnd = xBreak->getWordBoundary( aWTemp, startPos,
+ Boundary aWBnd = xBreak->getWordBoundary( searchStr, startPos,
aSrchPara.Locale,
WordType::ANYWORD_IGNOREWHITESPACES, sal_True );
@@ -1113,7 +1107,7 @@ SearchResult TextSearch::ApproxSrchBkwrd( const OUString& searchStr,
nEnd = aWBnd.endPos > startPos ? startPos : aWBnd.endPos;
if( nStt < nEnd &&
- pWLD->WLD( aWTemp.getStr() + nStt, nEnd - nStt ) <= nLimit )
+ pWLD->WLD( searchStr.getStr() + nStt, nEnd - nStt ) <= nLimit )
{
aRet.subRegExpressions = 1;
aRet.startOffset.realloc( 1 );
@@ -1125,9 +1119,9 @@ SearchResult TextSearch::ApproxSrchBkwrd( const OUString& searchStr,
if( !nStt )
break;
- aWBnd = xBreak->previousWord( aWTemp, nStt, aSrchPara.Locale,
+ aWBnd = xBreak->previousWord( searchStr, nStt, aSrchPara.Locale,
WordType::ANYWORD_IGNOREWHITESPACES);
- } while( aWBnd.startPos != aWBnd.endPos || aWBnd.endPos != aWTemp.getLength() );
+ } while( aWBnd.startPos != aWBnd.endPos || aWBnd.endPos != searchStr.getLength() );
return aRet;
}
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index e2f5ff9dd46d..f05028888977 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -729,9 +729,8 @@ void bubbleSortVersion(vector<rtl::Reference<VendorBase> >& vec)
}
if(nCmp == 1) // cur > next
{
- rtl::Reference<VendorBase> less = next;
vec.at(j-1)= cur;
- vec.at(j)= less;
+ vec.at(j)= next;
}
}
++cIter;
diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
index e5c6a3d0bc04..6979a33e4b04 100644
--- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx
+++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
@@ -494,8 +494,7 @@ Reference< XSpellAlternatives >
}
// now return an empty alternative for no suggestions or the list of alternatives if some found
- OUString aTmp(rWord);
- xRes = SpellAlternatives::CreateSpellAlternatives( aTmp, nLang, SpellFailure::SPELLING_ERROR, aStr );
+ xRes = SpellAlternatives::CreateSpellAlternatives( rWord, nLang, SpellFailure::SPELLING_ERROR, aStr );
return xRes;
}
return xRes;
diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx
index b243a25cb225..2df71c08f171 100644
--- a/linguistic/source/dicimp.cxx
+++ b/linguistic/source/dicimp.cxx
@@ -514,16 +514,14 @@ int DictionaryNeo::cmpDicEntry(const OUString& rWord1,
int nRes = 0;
- OUString aWord1( rWord1 ),
- aWord2( rWord2 );
- sal_Int32 nLen1 = aWord1.getLength(),
- nLen2 = aWord2.getLength();
+ sal_Int32 nLen1 = rWord1.getLength(),
+ nLen2 = rWord2.getLength();
if (bSimilarOnly)
{
const sal_Unicode cChar = '.';
- if (nLen1 && cChar == aWord1[ nLen1 - 1 ])
+ if (nLen1 && cChar == rWord1[ nLen1 - 1 ])
nLen1--;
- if (nLen2 && cChar == aWord2[ nLen2 - 1 ])
+ if (nLen2 && cChar == rWord2[ nLen2 - 1 ])
nLen2--;
}
@@ -543,7 +541,7 @@ int DictionaryNeo::cmpDicEntry(const OUString& rWord1,
{
// skip chars to be ignored
IgnState = false;
- while (nIdx1 < nLen1 && ((cChar1 = aWord1[ nIdx1 ]) == cIgnChar || cChar1 == cIgnBeg || IgnState ))
+ while (nIdx1 < nLen1 && ((cChar1 = rWord1[ nIdx1 ]) == cIgnChar || cChar1 == cIgnBeg || IgnState ))
{
if ( cChar1 == cIgnBeg )
IgnState = true;
@@ -553,7 +551,7 @@ int DictionaryNeo::cmpDicEntry(const OUString& rWord1,
nNumIgnChar1++;
}
IgnState = false;
- while (nIdx2 < nLen2 && ((cChar2 = aWord2[ nIdx2 ]) == cIgnChar || cChar2 == cIgnBeg || IgnState ))
+ while (nIdx2 < nLen2 && ((cChar2 = rWord2[ nIdx2 ]) == cIgnChar || cChar2 == cIgnBeg || IgnState ))
{
if ( cChar2 == cIgnBeg )
IgnState = true;
@@ -584,22 +582,22 @@ int DictionaryNeo::cmpDicEntry(const OUString& rWord1,
IgnState = false;
while (nIdx1 < nLen1 )
{
- if (aWord1[ nIdx1 ] == cIgnBeg)
+ if (rWord1[ nIdx1 ] == cIgnBeg)
IgnState = true;
- if (IgnState || aWord1[ nIdx1 ] == cIgnChar)
+ if (IgnState || rWord1[ nIdx1 ] == cIgnChar)
nNumIgnChar1++;
- if (aWord1[ nIdx1] == cIgnEnd)
+ if (rWord1[ nIdx1] == cIgnEnd)
IgnState = false;
nIdx1++;
}
IgnState = false;
while (nIdx2 < nLen2 )
{
- if (aWord2[ nIdx2 ] == cIgnBeg)
+ if (rWord2[ nIdx2 ] == cIgnBeg)
IgnState = true;
- if (IgnState || aWord2[ nIdx2 ] == cIgnChar)
+ if (IgnState || rWord2[ nIdx2 ] == cIgnChar)
nNumIgnChar2++;
- if (aWord2[ nIdx2 ] == cIgnEnd)
+ if (rWord2[ nIdx2 ] == cIgnEnd)
IgnState = false;
nIdx2++;
}
diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index bb83b7a7b730..988bb26a8f27 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -829,10 +829,9 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames )
// delete old cached data, needs to be acquired new on demand
clearSvcInfoArray(pAvailSpellSvcs);
- OUString aNode( aSpellCheckerList );
if (lcl_SeqHasString( aSpellCheckerListEntries, aKeyText ))
{
- pNames[0] = aNode + "/" + aKeyText;
+ pNames[0] = aSpellCheckerList + "/" + aKeyText;
aValues = /*aCfg.*/GetProperties( aNames );
uno::Sequence< OUString > aSvcImplNames;
if (aValues.getLength())
@@ -853,10 +852,9 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames )
// delete old cached data, needs to be acquired new on demand
clearSvcInfoArray(pAvailGrammarSvcs);
- OUString aNode( aGrammarCheckerList );
if (lcl_SeqHasString( aGrammarCheckerListEntries, aKeyText ))
{
- pNames[0] = aNode + "/" + aKeyText;
+ pNames[0] = aGrammarCheckerList + "/" + aKeyText;
aValues = /*aCfg.*/GetProperties( aNames );
uno::Sequence< OUString > aSvcImplNames;
if (aValues.getLength())
@@ -880,10 +878,9 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames )
// delete old cached data, needs to be acquired new on demand
clearSvcInfoArray(pAvailHyphSvcs);
- OUString aNode( aHyphenatorList );
if (lcl_SeqHasString( aHyphenatorListEntries, aKeyText ))
{
- pNames[0] = aNode + "/" + aKeyText;
+ pNames[0] = aHyphenatorList + "/" + aKeyText;
aValues = /*aCfg.*/GetProperties( aNames );
uno::Sequence< OUString > aSvcImplNames;
if (aValues.getLength())
@@ -904,10 +901,9 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames )
// delete old cached data, needs to be acquired new on demand
clearSvcInfoArray(pAvailThesSvcs);
- OUString aNode( aThesaurusList );
if (lcl_SeqHasString( aThesaurusListEntries, aKeyText ))
{
- pNames[0] = aNode + "/" + aKeyText;
+ pNames[0] = aThesaurusList + "/" + aKeyText;
aValues = /*aCfg.*/GetProperties( aNames );
uno::Sequence< OUString > aSvcImplNames;
if (aValues.getLength())
diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx
index a44fb0ed10ca..4cb427d805be 100644
--- a/linguistic/source/misc.cxx
+++ b/linguistic/source/misc.cxx
@@ -610,11 +610,10 @@ CapType SAL_CALL capitalType(const OUString& aTerm, CharClass * pCC)
sal_Int32 tlen = aTerm.getLength();
if ((pCC) && (tlen))
{
- OUString aStr(aTerm);
sal_Int32 nc = 0;
for (sal_Int32 tindex = 0; tindex < tlen; ++tindex)
{
- if (pCC->getCharacterType(aStr,tindex) &
+ if (pCC->getCharacterType(aTerm,tindex) &
css::i18n::KCharacterType::UPPER) nc++;
}
@@ -622,7 +621,7 @@ CapType SAL_CALL capitalType(const OUString& aTerm, CharClass * pCC)
return CapType::NOCAP;
if (nc == tlen)
return CapType::ALLCAP;
- if ((nc == 1) && (pCC->getCharacterType(aStr,0) &
+ if ((nc == 1) && (pCC->getCharacterType(aTerm,0) &
css::i18n::KCharacterType::UPPER))
return CapType::INITCAP;
diff --git a/oox/source/drawingml/shape3dproperties.cxx b/oox/source/drawingml/shape3dproperties.cxx
index 00e6bb59c55a..cf1930afdafe 100644
--- a/oox/source/drawingml/shape3dproperties.cxx
+++ b/oox/source/drawingml/shape3dproperties.cxx
@@ -323,7 +323,7 @@ css::uno::Sequence< css::beans::PropertyValue > Shape3DProperties::getColorAttri
const Color& rColor, const GraphicHelper& rGraphicHelper, sal_Int32 rPhClr )
{
css::uno::Sequence<css::beans::PropertyValue> aSeq(2);
- OUString sColorScheme = rColor.getSchemeName();
+ const OUString& sColorScheme = rColor.getSchemeName();
if( sColorScheme.isEmpty() )
{
// RGB color and transparency value
diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx
index 7ba5d357a6a8..64993a28bb1b 100644
--- a/oox/source/ole/axcontrol.cxx
+++ b/oox/source/ole/axcontrol.cxx
@@ -2616,23 +2616,21 @@ EmbeddedControl::~EmbeddedControl()
ControlModelBase* EmbeddedControl::createModelFromGuid( const OUString& rClassId )
{
- OUString aClassId = rClassId;//.toAsciiUpperCase();
-
- if( aClassId.equalsIgnoreAsciiCase( AX_GUID_COMMANDBUTTON ) ) return &createModel< AxCommandButtonModel >();
- if( aClassId.equalsIgnoreAsciiCase( AX_GUID_LABEL ) ) return &createModel< AxLabelModel >();
- if( aClassId.equalsIgnoreAsciiCase( AX_GUID_IMAGE ) ) return &createModel< AxImageModel >();
- if( aClassId.equalsIgnoreAsciiCase( AX_GUID_TOGGLEBUTTON ) ) return &createModel< AxToggleButtonModel >();
- if( aClassId.equalsIgnoreAsciiCase( AX_GUID_CHECKBOX ) ) return &createModel< AxCheckBoxModel >();
- if( aClassId.equalsIgnoreAsciiCase( AX_GUID_OPTIONBUTTON ) ) return &createModel< AxOptionButtonModel >();
- if( aClassId.equalsIgnoreAsciiCase( AX_GUID_TEXTBOX ) ) return &createModel< AxTextBoxModel >();
- if( aClassId.equalsIgnoreAsciiCase( AX_GUID_LISTBOX ) ) return &createModel< AxListBoxModel >();
- if( aClassId.equalsIgnoreAsciiCase( AX_GUID_COMBOBOX ) ) return &createModel< AxComboBoxModel >();
- if( aClassId.equalsIgnoreAsciiCase( AX_GUID_SPINBUTTON ) ) return &createModel< AxSpinButtonModel >();
- if( aClassId.equalsIgnoreAsciiCase( AX_GUID_SCROLLBAR ) ) return &createModel< AxScrollBarModel >();
- if( aClassId.equalsIgnoreAsciiCase( AX_GUID_FRAME ) ) return &createModel< AxFrameModel >();
- if( aClassId.equalsIgnoreAsciiCase( COMCTL_GUID_SCROLLBAR_60 ) ) return &createModel< ComCtlScrollBarModel >( COMCTL_VERSION_60 );
- if( aClassId.equalsIgnoreAsciiCase( HTML_GUID_SELECT ) ) return &createModel< HtmlSelectModel >();
- if( aClassId.equalsIgnoreAsciiCase( HTML_GUID_TEXTBOX ) ) return &createModel< HtmlTextBoxModel >();
+ if( rClassId.equalsIgnoreAsciiCase( AX_GUID_COMMANDBUTTON ) ) return &createModel< AxCommandButtonModel >();
+ if( rClassId.equalsIgnoreAsciiCase( AX_GUID_LABEL ) ) return &createModel< AxLabelModel >();
+ if( rClassId.equalsIgnoreAsciiCase( AX_GUID_IMAGE ) ) return &createModel< AxImageModel >();
+ if( rClassId.equalsIgnoreAsciiCase( AX_GUID_TOGGLEBUTTON ) ) return &createModel< AxToggleButtonModel >();
+ if( rClassId.equalsIgnoreAsciiCase( AX_GUID_CHECKBOX ) ) return &createModel< AxCheckBoxModel >();
+ if( rClassId.equalsIgnoreAsciiCase( AX_GUID_OPTIONBUTTON ) ) return &createModel< AxOptionButtonModel >();
+ if( rClassId.equalsIgnoreAsciiCase( AX_GUID_TEXTBOX ) ) return &createModel< AxTextBoxModel >();
+ if( rClassId.equalsIgnoreAsciiCase( AX_GUID_LISTBOX ) ) return &createModel< AxListBoxModel >();
+ if( rClassId.equalsIgnoreAsciiCase( AX_GUID_COMBOBOX ) ) return &createModel< AxComboBoxModel >();
+ if( rClassId.equalsIgnoreAsciiCase( AX_GUID_SPINBUTTON ) ) return &createModel< AxSpinButtonModel >();
+ if( rClassId.equalsIgnoreAsciiCase( AX_GUID_SCROLLBAR ) ) return &createModel< AxScrollBarModel >();
+ if( rClassId.equalsIgnoreAsciiCase( AX_GUID_FRAME ) ) return &createModel< AxFrameModel >();
+ if( rClassId.equalsIgnoreAsciiCase( COMCTL_GUID_SCROLLBAR_60 ) ) return &createModel< ComCtlScrollBarModel >( COMCTL_VERSION_60 );
+ if( rClassId.equalsIgnoreAsciiCase( HTML_GUID_SELECT ) ) return &createModel< HtmlSelectModel >();
+ if( rClassId.equalsIgnoreAsciiCase( HTML_GUID_TEXTBOX ) ) return &createModel< HtmlTextBoxModel >();
mxModel.reset();
return nullptr;
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx
index cebe09651612..3b151981fe14 100644
--- a/reportdesign/source/core/api/ReportDefinition.cxx
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -1527,10 +1527,9 @@ bool OReportDefinition::WriteThroughComponent(
OSL_ENSURE( nullptr != pServiceName, "Need service name!" );
try
{
- uno::Reference<embed::XStorage> xMyStorage = _xStorageToSaveTo;
// open stream
OUString sStreamName = OUString::createFromAscii( pStreamName );
- uno::Reference<io::XStream> xStream = xMyStorage->openStreamElement( sStreamName,embed::ElementModes::READWRITE | embed::ElementModes::TRUNCATE );
+ uno::Reference<io::XStream> xStream = _xStorageToSaveTo->openStreamElement( sStreamName,embed::ElementModes::READWRITE | embed::ElementModes::TRUNCATE );
if ( !xStream.is() )
return false;
uno::Reference<io::XOutputStream> xOutputStream = xStream->getOutputStream();
diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx
index b6d936e41d3f..206c9b8443e2 100644
--- a/reportdesign/source/filter/xml/xmlExport.cxx
+++ b/reportdesign/source/filter/xml/xmlExport.cxx
@@ -289,7 +289,7 @@ ORptExport::ORptExport(const Reference< XComponentContext >& _rxContext, OUStrin
rtl::Reference < XMLPropertySetMapper > xPropMapper(new XMLTextPropertySetMapper( TextPropMap::PARA, true ));
m_xParaPropMapper = new OSpecialHandleXMLExportPropertyMapper( xPropMapper);
- OUString sFamily( GetXMLToken(XML_PARAGRAPH) );
+ const OUString& sFamily( GetXMLToken(XML_PARAGRAPH) );
OUString aPrefix( 'P');
GetAutoStylePool()->AddFamily( XML_STYLE_FAMILY_TEXT_PARAGRAPH, sFamily,
m_xParaPropMapper, aPrefix );
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index bf608c3efc27..39c86340391a 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -377,7 +377,7 @@ void ScDocument::CreateValidTabName(OUString& rName) const
// Get Custom prefix
const ScDefaultsOptions& rOpt = SC_MOD()->GetDefaultsOptions();
- OUString aStrTable = rOpt.GetInitTabPrefix();
+ const OUString& aStrTable = rOpt.GetInitTabPrefix();
bool bOk = false;
@@ -425,7 +425,7 @@ void ScDocument::CreateValidTabNames(std::vector<OUString>& aNames, SCTAB nCount
// Get Custom prefix
const ScDefaultsOptions& rOpt = SC_MOD()->GetDefaultsOptions();
- OUString aStrTable = rOpt.GetInitTabPrefix();
+ const OUString& aStrTable = rOpt.GetInitTabPrefix();
OUStringBuffer rName;
diff --git a/sc/source/core/data/global2.cxx b/sc/source/core/data/global2.cxx
index 5825e39339a0..87a3ae0b049b 100644
--- a/sc/source/core/data/global2.cxx
+++ b/sc/source/core/data/global2.cxx
@@ -441,18 +441,17 @@ Label_fallback_to_unambiguous:
break;
}
- OUString aStr( rStr);
rtl_math_ConversionStatus eStatus;
sal_Int32 nParseEnd;
// Decimal and group separator 0 => only integer and possibly exponent,
// stops at first non-digit non-sign.
- fValue = ::rtl::math::stringToDouble( aStr, 0, 0, &eStatus, &nParseEnd);
+ fValue = ::rtl::math::stringToDouble( rStr, 0, 0, &eStatus, &nParseEnd);
sal_Int32 nLen;
- if (eStatus == rtl_math_ConversionStatus_Ok && nParseEnd < (nLen = aStr.getLength()))
+ if (eStatus == rtl_math_ConversionStatus_Ok && nParseEnd < (nLen = rStr.getLength()))
{
// Not at string end, check for trailing blanks or switch to date or
// time parsing or bail out.
- const sal_Unicode* const pStart = aStr.getStr();
+ const sal_Unicode* const pStart = rStr.getStr();
const sal_Unicode* p = pStart + nParseEnd;
const sal_Unicode* const pStop = pStart + nLen;
switch (*p++)
@@ -472,7 +471,7 @@ Label_fallback_to_unambiguous:
const sal_Int32 nLimit[done] = {0,12,31,0,59,59,0};
State eState = (bDate ? month : minute);
rCurFmtType = (bDate ? css::util::NumberFormat::DATE : css::util::NumberFormat::TIME);
- nUnit[eState-1] = aStr.copy( 0, nParseEnd).toInt32();
+ nUnit[eState-1] = rStr.copy( 0, nParseEnd).toInt32();
const sal_Unicode* pLastStart = p;
// Ensure there's no preceding sign. Negative dates
// currently aren't handled correctly. Also discard
@@ -498,7 +497,7 @@ Label_fallback_to_unambiguous:
// We had at least one digit.
if (eState < done)
{
- nUnit[eState] = aStr.copy( pLastStart - pStart, p - pLastStart).toInt32();
+ nUnit[eState] = rStr.copy( pLastStart - pStart, p - pLastStart).toInt32();
if (nLimit[eState] && nLimit[eState] < nUnit[eState])
rError = nStringNoValueError;
}
@@ -569,7 +568,7 @@ Label_fallback_to_unambiguous:
// Catch the very last unit at end of string.
if (p > pLastStart && eState < done)
{
- nUnit[eState] = aStr.copy( pLastStart - pStart, p - pLastStart).toInt32();
+ nUnit[eState] = rStr.copy( pLastStart - pStart, p - pLastStart).toInt32();
if (nLimit[eState] && nLimit[eState] < nUnit[eState])
rError = nStringNoValueError;
}
diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx
index ff9aaaca8f5b..d31542b08f4e 100644
--- a/sc/source/core/tool/addincol.cxx
+++ b/sc/source/core/tool/addincol.cxx
@@ -582,7 +582,7 @@ void ScUnoAddInCollection::ReadConfiguration()
void ScUnoAddInCollection::LoadComponent( const ScUnoAddInFuncData& rFuncData )
{
- OUString aFullName = rFuncData.GetOriginalName();
+ const OUString& aFullName = rFuncData.GetOriginalName();
sal_Int32 nPos = aFullName.lastIndexOf( (sal_Unicode) '.' );
if ( nPos > 0 )
{
@@ -975,7 +975,7 @@ void ScUnoAddInCollection::ReadFromAddIn( const uno::Reference<uno::XInterface>&
static void lcl_UpdateFunctionList( ScFunctionList& rFunctionList, const ScUnoAddInFuncData& rFuncData )
{
- OUString aCompare = rFuncData.GetUpperLocal(); // as used in FillFunctionDescFromData
+ const OUString& aCompare = rFuncData.GetUpperLocal(); // as used in FillFunctionDescFromData
sal_uLong nCount = rFunctionList.GetCount();
for (sal_uLong nPos=0; nPos<nCount; nPos++)
@@ -1509,7 +1509,7 @@ void ScUnoAddInCall::SetResult( const uno::Any& rNewRes )
// Reflection* pRefl = rNewRes.getReflection();
uno::TypeClass eClass = rNewRes.getValueTypeClass();
- uno::Type aType = rNewRes.getValueType();
+ const uno::Type& aType = rNewRes.getValueType();
switch (eClass)
{
case uno::TypeClass_VOID:
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 51cb1e9a893b..e16446a8606a 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -4962,7 +4962,7 @@ void ScCompiler::fillAddInToken(::std::vector< css::sheet::FormulaOpCodeMapEntry
bool ScCompiler::HandleColRowName()
{
ScSingleRefData& rRef = *mpToken.get()->GetSingleRef();
- ScAddress aAbs = rRef.toAbs(aPos);
+ const ScAddress aAbs = rRef.toAbs(aPos);
if (!ValidAddress(aAbs))
{
SetError( errNoRef );
@@ -4971,7 +4971,6 @@ bool ScCompiler::HandleColRowName()
SCCOL nCol = aAbs.Col();
SCROW nRow = aAbs.Row();
SCTAB nTab = aAbs.Tab();
- ScAddress aLook = aAbs;
bool bColName = rRef.IsColRel();
SCCOL nMyCol = aPos.Col();
SCROW nMyRow = aPos.Row();
@@ -4983,7 +4982,7 @@ bool ScCompiler::HandleColRowName()
for ( size_t i = 0, nPairs = pRL->size(); i < nPairs; ++i )
{
ScRangePair* pR = (*pRL)[i];
- if ( pR->GetRange(0).In( aLook ) )
+ if ( pR->GetRange(0).In( aAbs ) )
{
bInList = bValidName = true;
aRange = pR->GetRange(1);
@@ -5002,7 +5001,7 @@ bool ScCompiler::HandleColRowName()
}
if ( !bInList && pDoc->GetDocOptions().IsLookUpColRowNames() )
{ // automagically or created by copying and NamePos isn't in list
- ScRefCellValue aCell(*pDoc, aLook);
+ ScRefCellValue aCell(*pDoc, aAbs);
bool bString = aCell.hasString();
if (!bString && aCell.isEmpty())
bString = true; // empty cell is ok
diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx
index 13e50c16e012..4b2836d7871d 100644
--- a/sc/source/core/tool/editutil.cxx
+++ b/sc/source/core/tool/editutil.cxx
@@ -199,7 +199,7 @@ OUString ScEditUtil::GetCellFieldValue(
case text::textfield::Type::URL:
{
const SvxURLField& rField = static_cast<const SvxURLField&>(rFieldData);
- OUString aURL = rField.GetURL();
+ const OUString& aURL = rField.GetURL();
switch (rField.GetFormat())
{
diff --git a/sc/source/core/tool/queryparam.cxx b/sc/source/core/tool/queryparam.cxx
index ebc4b550762a..5131a31f7e1f 100644
--- a/sc/source/core/tool/queryparam.cxx
+++ b/sc/source/core/tool/queryparam.cxx
@@ -178,58 +178,57 @@ void ScQueryParamBase::Resize(size_t nNew)
}
void ScQueryParamBase::FillInExcelSyntax(
- svl::SharedStringPool& rPool, const OUString& rStr, SCSIZE nIndex, SvNumberFormatter* pFormatter )
+ svl::SharedStringPool& rPool, const OUString& rCellStr, SCSIZE nIndex, SvNumberFormatter* pFormatter )
{
- const OUString aCellStr = rStr;
if (nIndex >= m_Entries.size())
Resize(nIndex+1);
ScQueryEntry& rEntry = GetEntry(nIndex);
ScQueryEntry::Item& rItem = rEntry.GetQueryItem();
- if (aCellStr.isEmpty())
+ if (rCellStr.isEmpty())
rItem.maString = svl::SharedString::getEmptyString();
else
{
rEntry.bDoQuery = true;
// Operatoren herausfiltern
- if (aCellStr[0] == '<')
+ if (rCellStr[0] == '<')
{
- if (aCellStr[1] == '>')
+ if (rCellStr[1] == '>')
{
- rItem.maString = rPool.intern(aCellStr.copy(2));
+ rItem.maString = rPool.intern(rCellStr.copy(2));
rEntry.eOp = SC_NOT_EQUAL;
}
- else if (aCellStr[1] == '=')
+ else if (rCellStr[1] == '=')
{
- rItem.maString = rPool.intern(aCellStr.copy(2));
+ rItem.maString = rPool.intern(rCellStr.copy(2));
rEntry.eOp = SC_LESS_EQUAL;
}
else
{
- rItem.maString = rPool.intern(aCellStr.copy(1));
+ rItem.maString = rPool.intern(rCellStr.copy(1));
rEntry.eOp = SC_LESS;
}
}
- else if (aCellStr[0]== '>')
+ else if (rCellStr[0]== '>')
{
- if (aCellStr[1] == '=')
+ if (rCellStr[1] == '=')
{
- rItem.maString = rPool.intern(aCellStr.copy(2));
+ rItem.maString = rPool.intern(rCellStr.copy(2));
rEntry.eOp = SC_GREATER_EQUAL;
}
else
{
- rItem.maString = rPool.intern(aCellStr.copy(1));
+ rItem.maString = rPool.intern(rCellStr.copy(1));
rEntry.eOp = SC_GREATER;
}
}
else
{
- if (aCellStr[0] == '=')
- rItem.maString = rPool.intern(aCellStr.copy(1));
+ if (rCellStr[0] == '=')
+ rItem.maString = rPool.intern(rCellStr.copy(1));
else
- rItem.maString = rPool.intern(aCellStr);
+ rItem.maString = rPool.intern(rCellStr);
rEntry.eOp = SC_EQUAL;
}
}
diff --git a/sc/source/core/tool/userlist.cxx b/sc/source/core/tool/userlist.cxx
index e84a2db7bd6a..ae9977668e89 100644
--- a/sc/source/core/tool/userlist.cxx
+++ b/sc/source/core/tool/userlist.cxx
@@ -124,8 +124,7 @@ bool ScUserListData::GetSubIndex(const OUString& rSubStr, sal_uInt16& rIndex, bo
}
// When that fails, do a case insensitive search.
- OUString aTmp = ScGlobal::pCharClass->uppercase(rSubStr);
- OUString aUpStr = aTmp;
+ OUString aUpStr = ScGlobal::pCharClass->uppercase(rSubStr);
itr = ::std::find_if(
maSubStrings.begin(), maSubStrings.end(), FindByName(aUpStr, true));
if (itr != maSubStrings.end())
diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx
index ab0c3b5dfebc..1df1135f7303 100644
--- a/sc/source/filter/excel/xehelper.cxx
+++ b/sc/source/filter/excel/xehelper.cxx
@@ -365,14 +365,13 @@ XclExpStringRef lclCreateFormattedString(
const SfxItemSet& rItemSet = pCellAttr ? pCellAttr->GetItemSet() : rRoot.GetDoc().GetDefPattern()->GetItemSet();
// process all script portions
- OUString aOUText( rText );
sal_Int32 nPortionPos = 0;
- sal_Int32 nTextLen = aOUText.getLength();
+ sal_Int32 nTextLen = rText.getLength();
while( nPortionPos < nTextLen )
{
// get script type and end position of next script portion
- sal_Int16 nScript = xBreakIt->getScriptType( aOUText, nPortionPos );
- sal_Int32 nPortionEnd = xBreakIt->endOfScript( aOUText, nPortionPos, nScript );
+ sal_Int16 nScript = xBreakIt->getScriptType( rText, nPortionPos );
+ sal_Int32 nPortionEnd = xBreakIt->endOfScript( rText, nPortionPos, nScript );
// reuse previous script for following weak portions
if( nScript == ApiScriptType::WEAK )
@@ -384,7 +383,7 @@ XclExpStringRef lclCreateFormattedString(
// Excel start position of this portion
sal_Int32 nXclPortionStart = xString->Len();
// add portion text to Excel string
- XclExpStringHelper::AppendString( *xString, rRoot, aOUText.copy( nPortionPos, nPortionEnd - nPortionPos ) );
+ XclExpStringHelper::AppendString( *xString, rRoot, rText.copy( nPortionPos, nPortionEnd - nPortionPos ) );
if( nXclPortionStart < xString->Len() )
{
// insert font into buffer
@@ -641,14 +640,13 @@ sal_Int16 XclExpStringHelper::GetLeadingScriptType( const XclExpRoot& rRoot, con
{
namespace ApiScriptType = ::com::sun::star::i18n::ScriptType;
Reference< XBreakIterator > xBreakIt = rRoot.GetDoc().GetBreakIterator();
- OUString aOUString( rString );
sal_Int32 nStrPos = 0;
- sal_Int32 nStrLen = aOUString.getLength();
+ sal_Int32 nStrLen = rString.getLength();
sal_Int16 nScript = ApiScriptType::WEAK;
while( (nStrPos < nStrLen) && (nScript == ApiScriptType::WEAK) )
{
- nScript = xBreakIt->getScriptType( aOUString, nStrPos );
- nStrPos = xBreakIt->endOfScript( aOUString, nStrPos, nScript );
+ nScript = xBreakIt->getScriptType( rString, nStrPos );
+ nStrPos = xBreakIt->endOfScript( rString, nStrPos, nScript );
}
return (nScript == ApiScriptType::WEAK) ? rRoot.GetDefApiScript() : nScript;
}
diff --git a/sc/source/filter/excel/xihelper.cxx b/sc/source/filter/excel/xihelper.cxx
index 6b1bc9497ddc..56774dd66342 100644
--- a/sc/source/filter/excel/xihelper.cxx
+++ b/sc/source/filter/excel/xihelper.cxx
@@ -236,7 +236,7 @@ void XclImpStringHelper::SetToDocument(
}
else
{
- OUString aStr = rString.GetText();
+ const OUString& aStr = rString.GetText();
if (aStr.indexOf('\n') != -1 || aStr.indexOf(CHAR_CR) != -1)
{
// Multiline content.
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index 073d6595356e..108cd63774d7 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -1191,8 +1191,7 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab )
}
else
{
- OUString aStr = aStrOut;
- sal_Int32 nPos = aStr.indexOf( '\n' );
+ sal_Int32 nPos = aStrOut.indexOf( '\n' );
if ( nPos == -1 )
{
OUT_STR( aStrOut );
@@ -1202,13 +1201,13 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab )
sal_Int32 nStartPos = 0;
do
{
- OUString aSingleLine = aStr.copy( nStartPos, nPos - nStartPos );
+ OUString aSingleLine = aStrOut.copy( nStartPos, nPos - nStartPos );
OUT_STR( aSingleLine );
TAG_ON( OOO_STRING_SVTOOLS_HTML_linebreak );
nStartPos = nPos + 1;
}
- while( ( nPos = aStr.indexOf( '\n', nStartPos ) ) != -1 );
- OUString aSingleLine = aStr.copy( nStartPos, aStr.getLength() - nStartPos );
+ while( ( nPos = aStrOut.indexOf( '\n', nStartPos ) ) != -1 );
+ OUString aSingleLine = aStrOut.copy( nStartPos, aStrOut.getLength() - nStartPos );
OUT_STR( aSingleLine );
}
}
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index 88b7d3a19e72..0860a8c16c03 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -797,7 +797,7 @@ XclTxo::XclTxo( const XclExpRoot& rRoot, const EditTextObject& rEditObj, SdrObje
OUString aParaText( rEditObj.GetText( 0 ) );
if( !aParaText.isEmpty() )
{
- SfxItemSet aSet( rEditObj.GetParaAttribs( 0));
+ const SfxItemSet& aSet( rEditObj.GetParaAttribs( 0));
const SfxPoolItem* pItem = nullptr;
if( aSet.GetItemState( EE_PARA_JUST, true, &pItem ) == SfxItemState::SET )
{
diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx
index 3cae9c9713af..2701b9c63359 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -2480,8 +2480,7 @@ void ScXMLImport::SetChangeTrackingViewSettings(const css::uno::Sequence<css::be
OUString sOUName;
if (rChangeProps[i].Value >>= sOUName)
{
- OUString sAuthorName(sOUName);
- pViewSettings->SetTheAuthorToShow(sAuthorName);
+ pViewSettings->SetTheAuthorToShow(sOUName);
}
}
else if (sName == "ShowChangesByComment")
@@ -2491,8 +2490,7 @@ void ScXMLImport::SetChangeTrackingViewSettings(const css::uno::Sequence<css::be
OUString sOUComment;
if (rChangeProps[i].Value >>= sOUComment)
{
- OUString sComment(sOUComment);
- pViewSettings->SetTheComment(sComment);
+ pViewSettings->SetTheComment(sOUComment);
}
}
else if (sName == "ShowChangesByRanges")
@@ -3198,10 +3196,9 @@ void SAL_CALL ScXMLImport::endDocument()
OUString sName(aSeq[i].Name);
if (sName == SC_ACTIVETABLE)
{
- OUString sValue;
- if(aSeq[i].Value >>= sValue)
+ OUString sTabName;
+ if(aSeq[i].Value >>= sTabName)
{
- OUString sTabName(sValue);
SCTAB nTab(0);
if (pDoc->GetTable(sTabName, nTab))
{
diff --git a/sc/source/ui/condformat/condformatmgr.cxx b/sc/source/ui/condformat/condformatmgr.cxx
index 86a08ac9f85d..69ad5a2d3601 100644
--- a/sc/source/ui/condformat/condformatmgr.cxx
+++ b/sc/source/ui/condformat/condformatmgr.cxx
@@ -35,7 +35,7 @@ ScCondFormatManagerWindow::ScCondFormatManagerWindow(SvSimpleTableContainer& rPa
OUString ScCondFormatManagerWindow::createEntryString(const ScConditionalFormat& rFormat)
{
- ScRangeList aRange = rFormat.GetRange();
+ const ScRangeList& aRange = rFormat.GetRange();
OUString aStr;
aRange.Format(aStr, ScRefFlags::VALID, mpDoc, mpDoc->GetAddressConvention());
aStr += "\t";
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index c69493a20f29..e7918c6efa01 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -467,7 +467,7 @@ bool ScDocFunc::DetectiveRefresh( bool bAutomatic )
for (size_t i=0; i < nCount; ++i)
{
const ScDetOpData& rData = pList->GetObject(i);
- ScAddress aPos = rData.GetPos();
+ const ScAddress& aPos = rData.GetPos();
ScDetectiveFunc aFunc( &rDoc, aPos.Tab() );
SCCOL nCol = aPos.Col();
SCROW nRow = aPos.Row();
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index c86fc9287466..c3bb306c66da 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -639,9 +639,9 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
// (handled by AddInitial)
const ScAutoStyleHint& rStlHint = static_cast<const ScAutoStyleHint&>(rHint);
- ScRange aRange = rStlHint.GetRange();
- OUString aName1 = rStlHint.GetStyle1();
- OUString aName2 = rStlHint.GetStyle2();
+ const ScRange& aRange = rStlHint.GetRange();
+ const OUString& aName1 = rStlHint.GetStyle1();
+ const OUString& aName2 = rStlHint.GetStyle2();
sal_uInt32 nTimeout = rStlHint.GetTimeout();
if (!pAutoStyleList)
diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx
index 729e93173518..9198313c19c4 100644
--- a/sc/source/ui/docshell/docsh6.cxx
+++ b/sc/source/ui/docshell/docsh6.cxx
@@ -483,9 +483,9 @@ void ScDocShell::CheckConfigOptions()
ScModule* pScMod = SC_MOD();
const ScFormulaOptions& rOpt=pScMod->GetFormulaOptions();
- OUString aSepArg = rOpt.GetFormulaSepArg();
- OUString aSepArrRow = rOpt.GetFormulaSepArrayRow();
- OUString aSepArrCol = rOpt.GetFormulaSepArrayCol();
+ const OUString& aSepArg = rOpt.GetFormulaSepArg();
+ const OUString& aSepArrRow = rOpt.GetFormulaSepArrayRow();
+ const OUString& aSepArrCol = rOpt.GetFormulaSepArrayCol();
if (aDecSep == aSepArg || aDecSep == aSepArrRow || aDecSep == aSepArrCol)
{
diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx
index 2ea750ff808d..9b5df568fc8b 100644
--- a/sc/source/ui/docshell/docsh8.cxx
+++ b/sc/source/ui/docshell/docsh8.cxx
@@ -1101,9 +1101,8 @@ sal_uLong ScDocShell::DBaseExport( const OUString& rFullFileName, rtl_TextEncodi
sal_Int32 nLen;
if (bIsOctetTextEncoding)
{
- OUString aOUString( aString);
OString aOString;
- if (!aOUString.convertToString( &aOString, eCharSet,
+ if (!aString.convertToString( &aOString, eCharSet,
RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR |
RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR))
{
@@ -1112,7 +1111,7 @@ sal_uLong ScDocShell::DBaseExport( const OUString& rFullFileName, rtl_TextEncodi
}
nLen = aOString.getLength();
if (!bTest)
- SAL_WARN("sc", "ScDocShell::DBaseExport encoding error, string with default replacements: ``" << aOUString << "''\n");
+ SAL_WARN("sc", "ScDocShell::DBaseExport encoding error, string with default replacements: ``" << aString << "''\n");
}
else
nLen = aString.getLength() * sizeof(sal_Unicode);
diff --git a/sc/source/ui/undo/undostyl.cxx b/sc/source/ui/undo/undostyl.cxx
index 9dcbfb21f133..9d336faef5c2 100644
--- a/sc/source/ui/undo/undostyl.cxx
+++ b/sc/source/ui/undo/undostyl.cxx
@@ -121,7 +121,7 @@ void ScUndoModifyStyle::DoChange( ScDocShell* pDocSh, const OUString& rName,
{
ScDocument& rDoc = pDocSh->GetDocument();
ScStyleSheetPool* pStlPool = rDoc.GetStyleSheetPool();
- OUString aNewName = rData.GetName();
+ const OUString& aNewName = rData.GetName();
bool bDelete = aNewName.isEmpty(); // no new name -> delete style
bool bNew = ( rName.isEmpty() && !bDelete ); // creating new style
@@ -163,7 +163,7 @@ void ScUndoModifyStyle::DoChange( ScDocShell* pDocSh, const OUString& rName,
{
// modify style
- OUString aNewParent = rData.GetParent();
+ const OUString& aNewParent = rData.GetParent();
if ( aNewParent != pStyle->GetParent() )
pStyle->SetParent( aNewParent );
diff --git a/sc/source/ui/unoobj/addruno.cxx b/sc/source/ui/unoobj/addruno.cxx
index e31d80c3627a..c44ea24353dc 100644
--- a/sc/source/ui/unoobj/addruno.cxx
+++ b/sc/source/ui/unoobj/addruno.cxx
@@ -139,8 +139,7 @@ void SAL_CALL ScAddressConversionObj::setPropertyValue( const OUString& aPropert
throw uno::RuntimeException();
bool bSuccess = false;
- OUString aNameStr(aPropertyName);
- if ( aNameStr == SC_UNONAME_ADDRESS )
+ if ( aPropertyName == SC_UNONAME_ADDRESS )
{
// read the cell/range address from API struct
if ( bIsRange )
@@ -162,7 +161,7 @@ void SAL_CALL ScAddressConversionObj::setPropertyValue( const OUString& aPropert
}
}
}
- else if ( aNameStr == SC_UNONAME_REFSHEET )
+ else if ( aPropertyName == SC_UNONAME_REFSHEET )
{
// set the reference sheet
sal_Int32 nIntVal = 0;
@@ -172,19 +171,18 @@ void SAL_CALL ScAddressConversionObj::setPropertyValue( const OUString& aPropert
bSuccess = true;
}
}
- else if ( aNameStr == SC_UNONAME_UIREPR )
+ else if ( aPropertyName == SC_UNONAME_UIREPR )
{
// parse the UI representation string
OUString sRepresentation;
if (aValue >>= sRepresentation)
{
- OUString aUIString = sRepresentation;
- bSuccess = ParseUIString( aUIString );
+ bSuccess = ParseUIString( sRepresentation );
}
}
- else if ( aNameStr == SC_UNONAME_PERSREPR || aNameStr == SC_UNONAME_XLA1REPR )
+ else if ( aPropertyName == SC_UNONAME_PERSREPR || aPropertyName == SC_UNONAME_XLA1REPR )
{
- ::formula::FormulaGrammar::AddressConvention eConv = aNameStr == SC_UNONAME_XLA1REPR ?
+ ::formula::FormulaGrammar::AddressConvention eConv = aPropertyName == SC_UNONAME_XLA1REPR ?
::formula::FormulaGrammar::CONV_XL_A1 : ::formula::FormulaGrammar::CONV_OOO;
// parse the file format string
@@ -227,8 +225,7 @@ uno::Any SAL_CALL ScAddressConversionObj::getPropertyValue( const OUString& aPro
ScDocument& rDoc = pDocShell->GetDocument();
uno::Any aRet;
- OUString aNameStr(aPropertyName);
- if ( aNameStr == SC_UNONAME_ADDRESS )
+ if ( aPropertyName == SC_UNONAME_ADDRESS )
{
if ( bIsRange )
{
@@ -243,11 +240,11 @@ uno::Any SAL_CALL ScAddressConversionObj::getPropertyValue( const OUString& aPro
aRet <<= aCellAddress;
}
}
- else if ( aNameStr == SC_UNONAME_REFSHEET )
+ else if ( aPropertyName == SC_UNONAME_REFSHEET )
{
aRet <<= nRefSheet;
}
- else if ( aNameStr == SC_UNONAME_UIREPR )
+ else if ( aPropertyName == SC_UNONAME_UIREPR )
{
// generate UI representation string - include sheet only if different from ref sheet
OUString aFormatStr;
@@ -260,9 +257,9 @@ uno::Any SAL_CALL ScAddressConversionObj::getPropertyValue( const OUString& aPro
aFormatStr = aRange.aStart.Format(nFlags, &rDoc);
aRet <<= aFormatStr;
}
- else if ( aNameStr == SC_UNONAME_PERSREPR || aNameStr == SC_UNONAME_XLA1REPR )
+ else if ( aPropertyName == SC_UNONAME_PERSREPR || aPropertyName == SC_UNONAME_XLA1REPR )
{
- ::formula::FormulaGrammar::AddressConvention eConv = aNameStr == SC_UNONAME_XLA1REPR ?
+ ::formula::FormulaGrammar::AddressConvention eConv = aPropertyName == SC_UNONAME_XLA1REPR ?
::formula::FormulaGrammar::CONV_XL_A1 : ::formula::FormulaGrammar::CONV_OOO;
// generate file format string - always include sheet
diff --git a/sc/source/ui/unoobj/afmtuno.cxx b/sc/source/ui/unoobj/afmtuno.cxx
index 0bd1abeb64b3..8f044626cc51 100644
--- a/sc/source/ui/unoobj/afmtuno.cxx
+++ b/sc/source/ui/unoobj/afmtuno.cxx
@@ -191,10 +191,9 @@ ScAutoFormatObj* ScAutoFormatsObj::GetObjectByIndex_Impl(sal_uInt16 nIndex)
ScAutoFormatObj* ScAutoFormatsObj::GetObjectByName_Impl(const OUString& aName)
{
- OUString aString(aName);
sal_uInt16 nIndex;
if (lcl_FindAutoFormatIndex(
- *ScGlobal::GetOrCreateAutoFormat(), aString, nIndex ))
+ *ScGlobal::GetOrCreateAutoFormat(), aName, nIndex ))
return GetObjectByIndex_Impl(nIndex);
return nullptr;
}
@@ -215,14 +214,13 @@ void SAL_CALL ScAutoFormatsObj::insertByName( const OUString& aName, const uno::
ScAutoFormatObj* pFormatObj = ScAutoFormatObj::getImplementation( xInterface );
if ( pFormatObj && !pFormatObj->IsInserted() ) // noch nicht eingefuegt?
{
- OUString aNameStr(aName);
ScAutoFormat* pFormats = ScGlobal::GetOrCreateAutoFormat();
sal_uInt16 nDummy;
- if (!lcl_FindAutoFormatIndex( *pFormats, aNameStr, nDummy ))
+ if (!lcl_FindAutoFormatIndex( *pFormats, aName, nDummy ))
{
ScAutoFormatData* pNew = new ScAutoFormatData();
- pNew->SetName( aNameStr );
+ pNew->SetName( aName );
if (pFormats->insert(pNew))
{
@@ -230,7 +228,7 @@ void SAL_CALL ScAutoFormatsObj::insertByName( const OUString& aName, const uno::
pFormats->Save(); // sofort speichern
sal_uInt16 nNewIndex;
- if (lcl_FindAutoFormatIndex( *pFormats, aNameStr, nNewIndex ))
+ if (lcl_FindAutoFormatIndex( *pFormats, aName, nNewIndex ))
{
pFormatObj->InitFormat( nNewIndex ); // kann jetzt benutzt werden
bDone = true;
@@ -359,10 +357,9 @@ sal_Bool SAL_CALL ScAutoFormatsObj::hasByName( const OUString& aName )
throw(uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- OUString aString(aName);
sal_uInt16 nDummy;
return lcl_FindAutoFormatIndex(
- *ScGlobal::GetOrCreateAutoFormat(), aString, nDummy );
+ *ScGlobal::GetOrCreateAutoFormat(), aName, nDummy );
}
ScAutoFormatObj::ScAutoFormatObj(sal_uInt16 nIndex) :
@@ -504,7 +501,6 @@ void SAL_CALL ScAutoFormatObj::setName( const OUString& aNewName )
throw (uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- OUString aNewString(aNewName);
ScAutoFormat* pFormats = ScGlobal::GetOrCreateAutoFormat();
sal_uInt16 nDummy;
@@ -517,7 +513,7 @@ void SAL_CALL ScAutoFormatObj::setName( const OUString& aNewName )
OSL_ENSURE(pData,"AutoFormat Daten nicht da");
ScAutoFormatData* pNew = new ScAutoFormatData(*pData);
- pNew->SetName( aNewString );
+ pNew->SetName( aNewName );
pFormats->erase(it);
if (pFormats->insert(pNew))
@@ -565,19 +561,18 @@ void SAL_CALL ScAutoFormatObj::setPropertyValue(
ScAutoFormatData* pData = pFormats->findByIndex(nFormatIndex);
OSL_ENSURE(pData,"AutoFormat Daten nicht da");
- OUString aPropString(aPropertyName);
bool bBool;
- if (aPropString == SC_UNONAME_INCBACK && (aValue >>= bBool))
+ if (aPropertyName == SC_UNONAME_INCBACK && (aValue >>= bBool))
pData->SetIncludeBackground( bBool );
- else if (aPropString == SC_UNONAME_INCBORD && (aValue >>= bBool))
+ else if (aPropertyName == SC_UNONAME_INCBORD && (aValue >>= bBool))
pData->SetIncludeFrame( bBool );
- else if (aPropString == SC_UNONAME_INCFONT && (aValue >>= bBool))
+ else if (aPropertyName == SC_UNONAME_INCFONT && (aValue >>= bBool))
pData->SetIncludeFont( bBool );
- else if (aPropString == SC_UNONAME_INCJUST && (aValue >>= bBool))
+ else if (aPropertyName == SC_UNONAME_INCJUST && (aValue >>= bBool))
pData->SetIncludeJustify( bBool );
- else if (aPropString == SC_UNONAME_INCNUM && (aValue >>= bBool))
+ else if (aPropertyName == SC_UNONAME_INCNUM && (aValue >>= bBool))
pData->SetIncludeValueFormat( bBool );
- else if (aPropString == SC_UNONAME_INCWIDTH && (aValue >>= bBool))
+ else if (aPropertyName == SC_UNONAME_INCWIDTH && (aValue >>= bBool))
pData->SetIncludeWidthHeight( bBool );
// else Fehler
diff --git a/sc/source/ui/unoobj/appluno.cxx b/sc/source/ui/unoobj/appluno.cxx
index a5e09ed1a6a3..2c632b58243e 100644
--- a/sc/source/ui/unoobj/appluno.cxx
+++ b/sc/source/ui/unoobj/appluno.cxx
@@ -233,7 +233,6 @@ void SAL_CALL ScSpreadsheetSettings::setPropertyValue(
uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- OUString aString(aPropertyName);
ScModule* pScMod = SC_MOD();
ScAppOptions aAppOpt(pScMod->GetAppOptions());
@@ -242,27 +241,27 @@ void SAL_CALL ScSpreadsheetSettings::setPropertyValue(
bool bSaveInp = false;
// print options aren't loaded until needed
- if (aString == SC_UNONAME_DOAUTOCP)
+ if (aPropertyName == SC_UNONAME_DOAUTOCP)
{
aAppOpt.SetAutoComplete( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
bSaveApp = true;
}
- else if (aString == SC_UNONAME_ENTERED)
+ else if (aPropertyName == SC_UNONAME_ENTERED)
{
aInpOpt.SetEnterEdit( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
bSaveInp = true;
}
- else if (aString == SC_UNONAME_EXPREF)
+ else if (aPropertyName == SC_UNONAME_EXPREF)
{
aInpOpt.SetExpandRefs( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
bSaveInp = true;
}
- else if (aString == SC_UNONAME_EXTFMT)
+ else if (aPropertyName == SC_UNONAME_EXTFMT)
{
aInpOpt.SetExtendFormat( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
bSaveInp = true;
}
- else if (aString == SC_UNONAME_LINKUPD)
+ else if (aPropertyName == SC_UNONAME_LINKUPD)
{
sal_Int16 n;
if (!(aValue >>= n) || n < css::document::LinkUpdateModes::NEVER
@@ -279,47 +278,47 @@ void SAL_CALL ScSpreadsheetSettings::setPropertyValue(
aAppOpt.SetLinkMode( static_cast<ScLkUpdMode>(n) );
bSaveApp = true;
}
- else if (aString == SC_UNONAME_MARKHDR)
+ else if (aPropertyName == SC_UNONAME_MARKHDR)
{
aInpOpt.SetMarkHeader( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
bSaveInp = true;
}
- else if (aString == SC_UNONAME_MOVESEL)
+ else if (aPropertyName == SC_UNONAME_MOVESEL)
{
aInpOpt.SetMoveSelection( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
bSaveInp = true;
}
- else if (aString == SC_UNONAME_RANGEFIN)
+ else if (aPropertyName == SC_UNONAME_RANGEFIN)
{
aInpOpt.SetRangeFinder( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
bSaveInp = true;
}
- else if (aString == SC_UNONAME_USETABCOL)
+ else if (aPropertyName == SC_UNONAME_USETABCOL)
{
aInpOpt.SetUseTabCol( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
bSaveInp = true;
}
- else if (aString == SC_UNONAME_PRMETRICS)
+ else if (aPropertyName == SC_UNONAME_PRMETRICS)
{
aInpOpt.SetTextWysiwyg( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
bSaveInp = true;
}
- else if (aString == SC_UNONAME_REPLWARN)
+ else if (aPropertyName == SC_UNONAME_REPLWARN)
{
aInpOpt.SetReplaceCellsWarn( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
bSaveInp = true;
}
- else if (aString == SC_UNONAME_METRIC)
+ else if (aPropertyName == SC_UNONAME_METRIC)
{
aAppOpt.SetAppMetric( (FieldUnit) ScUnoHelpFunctions::GetInt16FromAny( aValue ) );
bSaveApp = true;
}
- else if (aString == SC_UNONAME_MOVEDIR)
+ else if (aPropertyName == SC_UNONAME_MOVEDIR)
{
aInpOpt.SetMoveDir( ScUnoHelpFunctions::GetInt16FromAny( aValue ) );
bSaveInp = true;
}
- else if (aString == SC_UNONAME_SCALE)
+ else if (aPropertyName == SC_UNONAME_SCALE)
{
short nVal = ScUnoHelpFunctions::GetInt16FromAny( aValue );
if ( nVal < 0 )
@@ -340,12 +339,12 @@ void SAL_CALL ScSpreadsheetSettings::setPropertyValue(
}
bSaveApp = true;
}
- else if (aString == SC_UNONAME_STBFUNC)
+ else if (aPropertyName == SC_UNONAME_STBFUNC)
{
aAppOpt.SetStatusFunc( ScUnoHelpFunctions::GetInt16FromAny( aValue ) );
bSaveApp = true;
}
- else if (aString == SC_UNONAME_ULISTS)
+ else if (aPropertyName == SC_UNONAME_ULISTS)
{
ScUserList* pUserList = ScGlobal::GetUserList();
uno::Sequence<OUString> aSeq;
@@ -366,13 +365,13 @@ void SAL_CALL ScSpreadsheetSettings::setPropertyValue(
bSaveApp = true; // Liste wird mit den App-Optionen gespeichert
}
}
- else if (aString == SC_UNONAME_PRALLSH)
+ else if (aPropertyName == SC_UNONAME_PRALLSH)
{
ScPrintOptions aPrintOpt(pScMod->GetPrintOptions());
aPrintOpt.SetAllSheets( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
pScMod->SetPrintOptions( aPrintOpt );
}
- else if (aString == SC_UNONAME_PREMPTY)
+ else if (aPropertyName == SC_UNONAME_PREMPTY)
{
ScPrintOptions aPrintOpt(pScMod->GetPrintOptions());
aPrintOpt.SetSkipEmpty( !ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); // reversed
@@ -391,7 +390,6 @@ uno::Any SAL_CALL ScSpreadsheetSettings::getPropertyValue( const OUString& aProp
uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- OUString aString = aPropertyName;
uno::Any aRet;
ScModule* pScMod = SC_MOD();
@@ -399,21 +397,21 @@ uno::Any SAL_CALL ScSpreadsheetSettings::getPropertyValue( const OUString& aProp
ScInputOptions aInpOpt = pScMod->GetInputOptions();
// print options aren't loaded until needed
- if (aString == SC_UNONAME_DOAUTOCP) ScUnoHelpFunctions::SetBoolInAny( aRet, aAppOpt.GetAutoComplete() );
- else if (aString == SC_UNONAME_ENTERED ) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetEnterEdit() );
- else if (aString == SC_UNONAME_EXPREF ) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetExpandRefs() );
- else if (aString == SC_UNONAME_EXTFMT ) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetExtendFormat() );
- else if (aString == SC_UNONAME_LINKUPD ) aRet <<= (sal_Int16) aAppOpt.GetLinkMode();
- else if (aString == SC_UNONAME_MARKHDR ) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetMarkHeader() );
- else if (aString == SC_UNONAME_MOVESEL ) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetMoveSelection() );
- else if (aString == SC_UNONAME_RANGEFIN ) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetRangeFinder() );
- else if (aString == SC_UNONAME_USETABCOL ) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetUseTabCol() );
- else if (aString == SC_UNONAME_PRMETRICS ) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetTextWysiwyg() );
- else if (aString == SC_UNONAME_REPLWARN ) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetReplaceCellsWarn() );
- else if (aString == SC_UNONAME_METRIC ) aRet <<= (sal_Int16) aAppOpt.GetAppMetric();
- else if (aString == SC_UNONAME_MOVEDIR ) aRet <<= (sal_Int16) aInpOpt.GetMoveDir();
- else if (aString == SC_UNONAME_STBFUNC ) aRet <<= (sal_Int16) aAppOpt.GetStatusFunc();
- else if (aString == SC_UNONAME_SCALE )
+ if (aPropertyName == SC_UNONAME_DOAUTOCP) ScUnoHelpFunctions::SetBoolInAny( aRet, aAppOpt.GetAutoComplete() );
+ else if (aPropertyName == SC_UNONAME_ENTERED ) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetEnterEdit() );
+ else if (aPropertyName == SC_UNONAME_EXPREF ) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetExpandRefs() );
+ else if (aPropertyName == SC_UNONAME_EXTFMT ) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetExtendFormat() );
+ else if (aPropertyName == SC_UNONAME_LINKUPD ) aRet <<= (sal_Int16) aAppOpt.GetLinkMode();
+ else if (aPropertyName == SC_UNONAME_MARKHDR ) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetMarkHeader() );
+ else if (aPropertyName == SC_UNONAME_MOVESEL ) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetMoveSelection() );
+ else if (aPropertyName == SC_UNONAME_RANGEFIN ) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetRangeFinder() );
+ else if (aPropertyName == SC_UNONAME_USETABCOL ) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetUseTabCol() );
+ else if (aPropertyName == SC_UNONAME_PRMETRICS ) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetTextWysiwyg() );
+ else if (aPropertyName == SC_UNONAME_REPLWARN ) ScUnoHelpFunctions::SetBoolInAny( aRet, aInpOpt.GetReplaceCellsWarn() );
+ else if (aPropertyName == SC_UNONAME_METRIC ) aRet <<= (sal_Int16) aAppOpt.GetAppMetric();
+ else if (aPropertyName == SC_UNONAME_MOVEDIR ) aRet <<= (sal_Int16) aInpOpt.GetMoveDir();
+ else if (aPropertyName == SC_UNONAME_STBFUNC ) aRet <<= (sal_Int16) aAppOpt.GetStatusFunc();
+ else if (aPropertyName == SC_UNONAME_SCALE )
{
sal_Int16 nZoomVal = 0;
switch ( aAppOpt.GetZoomType() )
@@ -429,7 +427,7 @@ uno::Any SAL_CALL ScSpreadsheetSettings::getPropertyValue( const OUString& aProp
}
aRet <<= (sal_Int16) nZoomVal;
}
- else if (aString == SC_UNONAME_ULISTS )
+ else if (aPropertyName == SC_UNONAME_ULISTS )
{
ScUserList* pUserList = ScGlobal::GetUserList();
if (pUserList)
@@ -445,9 +443,9 @@ uno::Any SAL_CALL ScSpreadsheetSettings::getPropertyValue( const OUString& aProp
aRet <<= aSeq;
}
}
- else if (aString == SC_UNONAME_PRALLSH )
+ else if (aPropertyName == SC_UNONAME_PRALLSH )
ScUnoHelpFunctions::SetBoolInAny( aRet, pScMod->GetPrintOptions().GetAllSheets() );
- else if (aString == SC_UNONAME_PREMPTY )
+ else if (aPropertyName == SC_UNONAME_PREMPTY )
ScUnoHelpFunctions::SetBoolInAny( aRet, !pScMod->GetPrintOptions().GetSkipEmpty() ); // reversed
return aRet;
@@ -620,7 +618,6 @@ uno::Any SAL_CALL ScFunctionListObj::getByName( const OUString& aName )
lang::WrappedTargetException, uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- OUString aNameStr(aName);
const ScFunctionList* pFuncList = ScGlobal::GetStarCalcFunctionList();
if ( pFuncList )
{
@@ -629,7 +626,7 @@ uno::Any SAL_CALL ScFunctionListObj::getByName( const OUString& aName )
{
const ScFuncDesc* pDesc = pFuncList->GetFunction(nIndex);
//! Case-insensitiv ???
- if ( pDesc && pDesc->pFuncName && aNameStr == *pDesc->pFuncName )
+ if ( pDesc && pDesc->pFuncName && aName == *pDesc->pFuncName )
{
uno::Sequence<beans::PropertyValue> aSeq( SC_FUNCDESC_PROPCOUNT );
lcl_FillSequence( aSeq, *pDesc );
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index a7370d5a8344..fcc1266e88d5 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -4436,13 +4436,12 @@ void SAL_CALL ScCellRangesObj::insertByName( const OUString& aName, const uno::A
{
// if explicit name is given and already existing, throw exception
- OUString aNamStr(aName);
- if ( !aNamStr.isEmpty() )
+ if ( !aName.isEmpty() )
{
size_t nNamedCount = m_pImpl->m_aNamedEntries.size();
for (size_t n = 0; n < nNamedCount; n++)
{
- if (m_pImpl->m_aNamedEntries[n].GetName() == aNamStr)
+ if (m_pImpl->m_aNamedEntries[n].GetName() == aName)
throw container::ElementExistException();
}
}
@@ -4460,7 +4459,7 @@ void SAL_CALL ScCellRangesObj::insertByName( const OUString& aName, const uno::A
// if a name is given, also insert into list of named entries
// (only possible for a single range)
// name is not in m_pImpl->m_aNamedEntries (tested above)
- m_pImpl->m_aNamedEntries.push_back(ScNamedEntry( aNamStr, *rAddRanges[ 0 ] ));
+ m_pImpl->m_aNamedEntries.push_back(ScNamedEntry( aName, *rAddRanges[ 0 ] ));
}
}
}
@@ -4552,11 +4551,10 @@ void SAL_CALL ScCellRangesObj::removeByName( const OUString& aName )
{
SolarMutexGuard aGuard;
bool bDone = false;
- OUString aNameStr(aName);
ScDocShell* pDocSh = GetDocShell();
const ScRangeList& rRanges = GetRangeList();
size_t nIndex = 0;
- if ( lcl_FindRangeByName( rRanges, pDocSh, aNameStr, nIndex ) )
+ if ( lcl_FindRangeByName( rRanges, pDocSh, aName, nIndex ) )
{
// einzelnen Range weglassen
ScRangeList aNew;
@@ -4570,13 +4568,13 @@ void SAL_CALL ScCellRangesObj::removeByName( const OUString& aName )
{
// deselect any ranges (parsed or named entry)
ScRangeList aDiff;
- bool bValid = ( aDiff.Parse( aNameStr, &pDocSh->GetDocument() ) & ScRefFlags::VALID )
+ bool bValid = ( aDiff.Parse( aName, &pDocSh->GetDocument() ) & ScRefFlags::VALID )
== ScRefFlags::VALID;
if (!bValid && !m_pImpl->m_aNamedEntries.empty())
{
sal_uInt16 nCount = m_pImpl->m_aNamedEntries.size();
for (sal_uInt16 n=0; n<nCount && !bValid; n++)
- if (m_pImpl->m_aNamedEntries[n].GetName() == aNameStr)
+ if (m_pImpl->m_aNamedEntries[n].GetName() == aName)
{
aDiff.RemoveAll();
aDiff.Append(m_pImpl->m_aNamedEntries[n].GetRange());
@@ -4604,7 +4602,7 @@ void SAL_CALL ScCellRangesObj::removeByName( const OUString& aName )
}
if (!m_pImpl->m_aNamedEntries.empty())
- lcl_RemoveNamedEntry(m_pImpl->m_aNamedEntries, aNameStr);
+ lcl_RemoveNamedEntry(m_pImpl->m_aNamedEntries, aName);
if (!bDone)
throw container::NoSuchElementException(); // not found
@@ -4631,12 +4629,11 @@ uno::Any SAL_CALL ScCellRangesObj::getByName( const OUString& aName )
SolarMutexGuard aGuard;
uno::Any aRet;
- OUString aNameStr(aName);
ScDocShell* pDocSh = GetDocShell();
const ScRangeList& rRanges = GetRangeList();
ScRange aRange;
if (lcl_FindRangeOrEntry(m_pImpl->m_aNamedEntries, rRanges,
- pDocSh, aNameStr, aRange))
+ pDocSh, aName, aRange))
{
uno::Reference<table::XCellRange> xRange;
if ( aRange.aStart == aRange.aEnd )
@@ -4698,12 +4695,11 @@ sal_Bool SAL_CALL ScCellRangesObj::hasByName( const OUString& aName )
throw(uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- OUString aNameStr(aName);
ScDocShell* pDocSh = GetDocShell();
const ScRangeList& rRanges = GetRangeList();
ScRange aRange;
return lcl_FindRangeOrEntry(m_pImpl->m_aNamedEntries, rRanges, pDocSh,
- aNameStr, aRange);
+ aName, aRange);
}
// XEnumerationAccess
@@ -4971,8 +4967,7 @@ uno::Reference<table::XCellRange> ScCellRangeObj::getCellRangeByName(
ScRange aCellRange;
bool bFound = false;
- OUString aString(aName);
- ScRefFlags nParse = aCellRange.ParseAny( aString, &rDoc, rDetails );
+ ScRefFlags nParse = aCellRange.ParseAny( aName, &rDoc, rDetails );
if ( nParse & ScRefFlags::VALID )
{
if ( !(nParse & ScRefFlags::TAB_3D) ) // keine Tabelle angegeben -> auf dieser Tabelle
@@ -4985,8 +4980,8 @@ uno::Reference<table::XCellRange> ScCellRangeObj::getCellRangeByName(
else
{
ScRangeUtil aRangeUtil;
- if ( ScRangeUtil::MakeRangeFromName( aString, &rDoc, nTab, aCellRange ) ||
- ScRangeUtil::MakeRangeFromName( aString, &rDoc, nTab, aCellRange, RUTL_DBASE ) )
+ if ( ScRangeUtil::MakeRangeFromName( aName, &rDoc, nTab, aCellRange ) ||
+ ScRangeUtil::MakeRangeFromName( aName, &rDoc, nTab, aCellRange, RUTL_DBASE ) )
bFound = true;
}
@@ -6217,20 +6212,19 @@ void ScCellObj::InputEnglishString( const OUString& rText )
if (!pDocSh)
return;
- OUString aString(rText);
ScDocument& rDoc = pDocSh->GetDocument();
SvNumberFormatter* pFormatter = rDoc.GetFormatTable();
sal_uInt32 nOldFormat = rDoc.GetNumberFormat( aCellPos );
if (pFormatter->GetType(nOldFormat) == css::util::NumberFormat::TEXT)
{
- SetString_Impl(aString, false, false); // text cell
+ SetString_Impl(rText, false, false); // text cell
return;
}
ScDocFunc &rFunc = pDocSh->GetDocFunc();
ScInputStringType aRes =
- ScStringUtil::parseInputString(*pFormatter, aString, LANGUAGE_ENGLISH_US);
+ ScStringUtil::parseInputString(*pFormatter, rText, LANGUAGE_ENGLISH_US);
if (aRes.meType != ScInputStringType::Unknown)
{
@@ -6262,7 +6256,7 @@ void ScCellObj::InputEnglishString( const OUString& rText )
rFunc.SetStringOrEditCell(aCellPos, aRes.maText, false);
break;
default:
- SetString_Impl(aString, false, false); // probably empty string
+ SetString_Impl(rText, false, false); // probably empty string
}
}
@@ -6307,12 +6301,11 @@ OUString SAL_CALL ScCellObj::getString() throw(uno::RuntimeException, std::excep
void SAL_CALL ScCellObj::setString( const OUString& aText ) throw(uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- OUString aString(aText);
- SetString_Impl(aString, false, false); // immer Text
+ SetString_Impl(aText, false, false); // immer Text
// don't create pUnoText here if not there
if (mxUnoText.is())
- mxUnoText->SetSelection(ESelection( 0,0, 0,aString.getLength() ));
+ mxUnoText->SetSelection(ESelection( 0,0, 0,aText.getLength() ));
}
void SAL_CALL ScCellObj::insertString( const uno::Reference<text::XTextRange>& xRange,
@@ -6453,8 +6446,7 @@ OUString SAL_CALL ScCellObj::getFormula() throw(uno::RuntimeException, std::exce
void SAL_CALL ScCellObj::setFormula( const OUString& aFormula ) throw(uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- OUString aString(aFormula);
- SetString_Impl(aString, true, true); // Interpret as English
+ SetString_Impl(aFormula, true, true); // Interpret as English
}
double SAL_CALL ScCellObj::getValue() throw(uno::RuntimeException, std::exception)
@@ -7157,8 +7149,7 @@ void SAL_CALL ScTableSheetObj::setName( const OUString& aNewName )
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
- OUString aString(aNewName);
- pDocSh->GetDocFunc().RenameTable( GetTab_Impl(), aString, true, true );
+ pDocSh->GetDocFunc().RenameTable( GetTab_Impl(), aNewName, true, true );
}
}
@@ -7639,7 +7630,6 @@ void SAL_CALL ScTableSheetObj::link( const OUString& aUrl, const OUString& aShee
OUString aFileString = aUrl;
OUString aFilterString = aFilterName;
OUString aOptString = aFilterOptions;
- OUString aSheetString = aSheetName;
aFileString = ScGlobal::GetAbsDocName( aFileString, pDocSh );
if (aFilterString.isEmpty())
@@ -7656,7 +7646,7 @@ void SAL_CALL ScTableSheetObj::link( const OUString& aUrl, const OUString& aShee
nLinkMode = ScLinkMode::VALUE;
sal_uLong nRefresh = 0;
- rDoc.SetLink( nTab, nLinkMode, aFileString, aFilterString, aOptString, aSheetString, nRefresh );
+ rDoc.SetLink( nTab, nLinkMode, aFileString, aFilterString, aOptString, aSheetName, nRefresh );
pDocSh->UpdateLinks(); // ggf. Link eintragen oder loeschen
SfxBindings* pBindings = pDocSh->GetViewBindings();
@@ -7899,8 +7889,7 @@ void SAL_CALL ScTableSheetObj::protect( const OUString& aPassword )
// #i108245# if already protected, don't change anything
if ( pDocSh && !pDocSh->GetDocument().IsTabProtected( GetTab_Impl() ) )
{
- OUString aString(aPassword);
- pDocSh->GetDocFunc().Protect( GetTab_Impl(), aString, true );
+ pDocSh->GetDocFunc().Protect( GetTab_Impl(), aPassword, true );
}
}
@@ -7911,8 +7900,7 @@ void SAL_CALL ScTableSheetObj::unprotect( const OUString& aPassword )
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
- OUString aString(aPassword);
- bool bDone = pDocSh->GetDocFunc().Unprotect( GetTab_Impl(), aString, true );
+ bool bDone = pDocSh->GetDocFunc().Unprotect( GetTab_Impl(), aPassword, true );
if (!bDone)
throw lang::IllegalArgumentException();
}
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index d5881deef641..f19bb887853e 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -435,8 +435,7 @@ void SAL_CALL ScDataPilotTablesObj::removeByName( const OUString& aName )
throw(RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- OUString aNameStr(aName);
- ScDPObject* pDPObj = lcl_GetDPObject( pDocShell, nTab, aNameStr );
+ ScDPObject* pDPObj = lcl_GetDPObject( pDocShell, nTab, aName );
if (pDPObj && pDocShell)
{
ScDBDocFunc aFunc(*pDocShell);
@@ -760,38 +759,37 @@ void SAL_CALL ScDataPilotDescriptorBase::setPropertyValue( const OUString& aProp
{
ScDPSaveData aNewData( *pOldData );
- OUString aNameString = aPropertyName;
- if ( aNameString == SC_UNO_DP_COLGRAND )
+ if ( aPropertyName == SC_UNO_DP_COLGRAND )
{
aNewData.SetColumnGrand(::cppu::any2bool( aValue ));
}
- else if ( aNameString == SC_UNO_DP_IGNORE_EMPTYROWS )
+ else if ( aPropertyName == SC_UNO_DP_IGNORE_EMPTYROWS )
{
aNewData.SetIgnoreEmptyRows(::cppu::any2bool( aValue ));
}
- else if ( aNameString == SC_UNO_DP_REPEATEMPTY )
+ else if ( aPropertyName == SC_UNO_DP_REPEATEMPTY )
{
aNewData.SetRepeatIfEmpty(::cppu::any2bool( aValue ));
}
- else if ( aNameString == SC_UNO_DP_ROWGRAND )
+ else if ( aPropertyName == SC_UNO_DP_ROWGRAND )
{
aNewData.SetRowGrand(::cppu::any2bool( aValue ));
}
- else if ( aNameString == SC_UNO_DP_SHOWFILTER )
+ else if ( aPropertyName == SC_UNO_DP_SHOWFILTER )
{
aNewData.SetFilterButton(::cppu::any2bool( aValue ));
}
- else if ( aNameString == SC_UNO_DP_DRILLDOWN )
+ else if ( aPropertyName == SC_UNO_DP_DRILLDOWN )
{
aNewData.SetDrillDown(::cppu::any2bool( aValue ));
}
- else if ( aNameString == SC_UNO_DP_GRANDTOTAL_NAME )
+ else if ( aPropertyName == SC_UNO_DP_GRANDTOTAL_NAME )
{
OUString aStrVal;
if ( aValue >>= aStrVal )
aNewData.SetGrandTotalName(aStrVal);
}
- else if ( aNameString == SC_UNO_DP_IMPORTDESC )
+ else if ( aPropertyName == SC_UNO_DP_IMPORTDESC )
{
uno::Sequence<beans::PropertyValue> aArgSeq;
if ( aValue >>= aArgSeq )
@@ -823,7 +821,7 @@ void SAL_CALL ScDataPilotDescriptorBase::setPropertyValue( const OUString& aProp
pDPObject->SetImportDesc( aImportDesc );
}
}
- else if ( aNameString == SC_UNO_DP_SOURCESERVICE )
+ else if ( aPropertyName == SC_UNO_DP_SOURCESERVICE )
{
OUString aStrVal;
if ( aValue >>= aStrVal )
@@ -839,7 +837,7 @@ void SAL_CALL ScDataPilotDescriptorBase::setPropertyValue( const OUString& aProp
pDPObject->SetServiceData( aServiceDesc );
}
}
- else if ( aNameString == SC_UNO_DP_SERVICEARG )
+ else if ( aPropertyName == SC_UNO_DP_SERVICEARG )
{
uno::Sequence<beans::PropertyValue> aArgSeq;
if ( aValue >>= aArgSeq )
@@ -908,38 +906,37 @@ Any SAL_CALL ScDataPilotDescriptorBase::getPropertyValue( const OUString& aPrope
{
ScDPSaveData aNewData( *pOldData );
- OUString aNameString = aPropertyName;
- if ( aNameString == SC_UNO_DP_COLGRAND )
+ if ( aPropertyName == SC_UNO_DP_COLGRAND )
{
aRet <<= aNewData.GetColumnGrand();
}
- else if ( aNameString == SC_UNO_DP_IGNORE_EMPTYROWS )
+ else if ( aPropertyName == SC_UNO_DP_IGNORE_EMPTYROWS )
{
aRet <<= aNewData.GetIgnoreEmptyRows();
}
- else if ( aNameString == SC_UNO_DP_REPEATEMPTY )
+ else if ( aPropertyName == SC_UNO_DP_REPEATEMPTY )
{
aRet <<= aNewData.GetRepeatIfEmpty();
}
- else if ( aNameString == SC_UNO_DP_ROWGRAND )
+ else if ( aPropertyName == SC_UNO_DP_ROWGRAND )
{
aRet <<= aNewData.GetRowGrand();
}
- else if ( aNameString == SC_UNO_DP_SHOWFILTER )
+ else if ( aPropertyName == SC_UNO_DP_SHOWFILTER )
{
aRet <<= aNewData.GetFilterButton();
}
- else if ( aNameString == SC_UNO_DP_DRILLDOWN )
+ else if ( aPropertyName == SC_UNO_DP_DRILLDOWN )
{
aRet <<= aNewData.GetDrillDown();
}
- else if ( aNameString == SC_UNO_DP_GRANDTOTAL_NAME )
+ else if ( aPropertyName == SC_UNO_DP_GRANDTOTAL_NAME )
{
const OUString* pGrandTotalName = aNewData.GetGrandTotalName();
if (pGrandTotalName)
aRet <<= *pGrandTotalName; // same behavior as in ScDPSource
}
- else if ( aNameString == SC_UNO_DP_IMPORTDESC )
+ else if ( aPropertyName == SC_UNO_DP_IMPORTDESC )
{
const ScImportSourceDesc* pImportDesc = pDPObject->GetImportSourceDesc();
if ( pImportDesc )
@@ -964,7 +961,7 @@ Any SAL_CALL ScDataPilotDescriptorBase::getPropertyValue( const OUString& aPrope
aRet <<= aEmpty;
}
}
- else if ( aNameString == SC_UNO_DP_SOURCESERVICE )
+ else if ( aPropertyName == SC_UNO_DP_SOURCESERVICE )
{
OUString aServiceName;
const ScDPServiceDesc* pServiceDesc = pDPObject->GetDPServiceDesc();
@@ -972,7 +969,7 @@ Any SAL_CALL ScDataPilotDescriptorBase::getPropertyValue( const OUString& aPrope
aServiceName = pServiceDesc->aServiceName;
aRet <<= aServiceName; // empty string if no ServiceDesc set
}
- else if ( aNameString == SC_UNO_DP_SERVICEARG )
+ else if ( aPropertyName == SC_UNO_DP_SERVICEARG )
{
const ScDPServiceDesc* pServiceDesc = pDPObject->GetDPServiceDesc();
if (pServiceDesc)
@@ -1177,9 +1174,8 @@ void SAL_CALL ScDataPilotTableObj::setName( const OUString& aNewName )
{
//! test for existing names !!!
- OUString aString(aNewName);
- pDPObj->SetName( aString ); //! Undo - DBDocFunc ???
- aName = aString;
+ pDPObj->SetName( aNewName ); //! Undo - DBDocFunc ???
+ aName = aNewName;
// DataPilotUpdate would do too much (output table is not changed)
GetDocShell()->SetDocumentModified();
@@ -1861,97 +1857,96 @@ void SAL_CALL ScDataPilotFieldObj::setPropertyValue( const OUString& aPropertyNa
RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- OUString aNameString(aPropertyName);
- if ( aNameString == SC_UNONAME_FUNCTION )
+ if ( aPropertyName == SC_UNONAME_FUNCTION )
{
// #i109350# use GetEnumFromAny because it also allows sal_Int32
GeneralFunction eFunction = (GeneralFunction)
ScUnoHelpFunctions::GetEnumFromAny( aValue );
setFunction( eFunction );
}
- else if ( aNameString == SC_UNONAME_SUBTOTALS )
+ else if ( aPropertyName == SC_UNONAME_SUBTOTALS )
{
Sequence< GeneralFunction > aSubtotals;
if( aValue >>= aSubtotals )
setSubtotals( aSubtotals );
}
- else if ( aNameString == SC_UNONAME_ORIENT )
+ else if ( aPropertyName == SC_UNONAME_ORIENT )
{
//! test for correct enum type?
DataPilotFieldOrientation eOrient = (DataPilotFieldOrientation)
ScUnoHelpFunctions::GetEnumFromAny( aValue );
setOrientation( eOrient );
}
- else if ( aNameString == SC_UNONAME_SELPAGE )
+ else if ( aPropertyName == SC_UNONAME_SELPAGE )
{
OUString sCurrentPage;
if (aValue >>= sCurrentPage)
setCurrentPage(sCurrentPage);
}
- else if ( aNameString == SC_UNONAME_USESELPAGE )
+ else if ( aPropertyName == SC_UNONAME_USESELPAGE )
{
setUseCurrentPage(cppu::any2bool(aValue));
}
- else if ( aNameString == SC_UNONAME_HASAUTOSHOW )
+ else if ( aPropertyName == SC_UNONAME_HASAUTOSHOW )
{
if (!cppu::any2bool(aValue))
setAutoShowInfo(nullptr);
}
- else if ( aNameString == SC_UNONAME_AUTOSHOW )
+ else if ( aPropertyName == SC_UNONAME_AUTOSHOW )
{
DataPilotFieldAutoShowInfo aInfo;
if (aValue >>= aInfo)
setAutoShowInfo(&aInfo);
}
- else if ( aNameString == SC_UNONAME_HASLAYOUTINFO )
+ else if ( aPropertyName == SC_UNONAME_HASLAYOUTINFO )
{
if (!cppu::any2bool(aValue))
setLayoutInfo(nullptr);
}
- else if ( aNameString == SC_UNONAME_LAYOUTINFO )
+ else if ( aPropertyName == SC_UNONAME_LAYOUTINFO )
{
DataPilotFieldLayoutInfo aInfo;
if (aValue >>= aInfo)
setLayoutInfo(&aInfo);
}
- else if ( aNameString == SC_UNONAME_HASREFERENCE )
+ else if ( aPropertyName == SC_UNONAME_HASREFERENCE )
{
if (!cppu::any2bool(aValue))
setReference(nullptr);
}
- else if ( aNameString == SC_UNONAME_REFERENCE )
+ else if ( aPropertyName == SC_UNONAME_REFERENCE )
{
DataPilotFieldReference aRef;
if (aValue >>= aRef)
setReference(&aRef);
}
- else if ( aNameString == SC_UNONAME_HASSORTINFO )
+ else if ( aPropertyName == SC_UNONAME_HASSORTINFO )
{
if (!cppu::any2bool(aValue))
setSortInfo(nullptr);
}
- else if ( aNameString == SC_UNONAME_SORTINFO )
+ else if ( aPropertyName == SC_UNONAME_SORTINFO )
{
DataPilotFieldSortInfo aInfo;
if (aValue >>= aInfo)
setSortInfo(&aInfo);
}
- else if ( aNameString == SC_UNONAME_ISGROUP )
+ else if ( aPropertyName == SC_UNONAME_ISGROUP )
{
if (!cppu::any2bool(aValue))
setGroupInfo(nullptr);
}
- else if ( aNameString == SC_UNONAME_GROUPINFO )
+ else if ( aPropertyName == SC_UNONAME_GROUPINFO )
{
DataPilotFieldGroupInfo aInfo;
if (aValue >>= aInfo)
setGroupInfo(&aInfo);
}
- else if ( aNameString == SC_UNONAME_SHOWEMPTY )
+ else if ( aPropertyName == SC_UNONAME_SHOWEMPTY )
{
setShowEmpty(cppu::any2bool(aValue));
}
- else if ( aNameString == SC_UNONAME_REPEATITEMLABELS )
+ else if ( aPropertyName == SC_UNONAME_REPEATITEMLABELS )
{
setRepeatItemLabels(cppu::any2bool(aValue));
}
@@ -1962,60 +1957,59 @@ Any SAL_CALL ScDataPilotFieldObj::getPropertyValue( const OUString& aPropertyNam
RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- OUString aNameString(aPropertyName);
Any aRet;
- if ( aNameString == SC_UNONAME_FUNCTION )
+ if ( aPropertyName == SC_UNONAME_FUNCTION )
aRet <<= getFunction();
- else if ( aNameString == SC_UNONAME_SUBTOTALS )
+ else if ( aPropertyName == SC_UNONAME_SUBTOTALS )
aRet <<= getSubtotals();
- else if ( aNameString == SC_UNONAME_ORIENT )
+ else if ( aPropertyName == SC_UNONAME_ORIENT )
aRet <<= getOrientation();
- else if ( aNameString == SC_UNONAME_SELPAGE )
+ else if ( aPropertyName == SC_UNONAME_SELPAGE )
aRet <<= getCurrentPage();
- else if ( aNameString == SC_UNONAME_USESELPAGE )
+ else if ( aPropertyName == SC_UNONAME_USESELPAGE )
aRet <<= false;
- else if ( aNameString == SC_UNONAME_HASAUTOSHOW )
+ else if ( aPropertyName == SC_UNONAME_HASAUTOSHOW )
aRet <<= (getAutoShowInfo() != nullptr);
- else if ( aNameString == SC_UNONAME_AUTOSHOW )
+ else if ( aPropertyName == SC_UNONAME_AUTOSHOW )
{
const DataPilotFieldAutoShowInfo* pInfo = getAutoShowInfo();
if (pInfo)
aRet <<= DataPilotFieldAutoShowInfo(*pInfo);
}
- else if ( aNameString == SC_UNONAME_HASLAYOUTINFO )
+ else if ( aPropertyName == SC_UNONAME_HASLAYOUTINFO )
aRet <<= (getLayoutInfo() != nullptr);
- else if ( aNameString == SC_UNONAME_LAYOUTINFO )
+ else if ( aPropertyName == SC_UNONAME_LAYOUTINFO )
{
const DataPilotFieldLayoutInfo* pInfo = getLayoutInfo();
if (pInfo)
aRet <<= DataPilotFieldLayoutInfo(*pInfo);
}
- else if ( aNameString == SC_UNONAME_HASREFERENCE )
+ else if ( aPropertyName == SC_UNONAME_HASREFERENCE )
aRet <<= (getReference() != nullptr);
- else if ( aNameString == SC_UNONAME_REFERENCE )
+ else if ( aPropertyName == SC_UNONAME_REFERENCE )
{
const DataPilotFieldReference* pRef = getReference();
if (pRef)
aRet <<= DataPilotFieldReference(*pRef);
}
- else if ( aNameString == SC_UNONAME_HASSORTINFO )
+ else if ( aPropertyName == SC_UNONAME_HASSORTINFO )
aRet <<= (getSortInfo() != nullptr);
- else if ( aNameString == SC_UNONAME_SORTINFO )
+ else if ( aPropertyName == SC_UNONAME_SORTINFO )
{
const DataPilotFieldSortInfo* pInfo = getSortInfo();
if (pInfo)
aRet <<= DataPilotFieldSortInfo(*pInfo);
}
- else if ( aNameString == SC_UNONAME_ISGROUP )
+ else if ( aPropertyName == SC_UNONAME_ISGROUP )
aRet <<= (hasGroupInfo());
- else if ( aNameString == SC_UNONAME_GROUPINFO )
+ else if ( aPropertyName == SC_UNONAME_GROUPINFO )
{
aRet <<= getGroupInfo();
}
- else if ( aNameString == SC_UNONAME_SHOWEMPTY )
+ else if ( aPropertyName == SC_UNONAME_SHOWEMPTY )
aRet <<= getShowEmpty();
- else if ( aNameString == SC_UNONAME_REPEATITEMLABELS )
+ else if ( aPropertyName == SC_UNONAME_REPEATITEMLABELS )
aRet <<= getRepeatItemLabels();
return aRet;
@@ -3429,11 +3423,10 @@ void SAL_CALL ScDataPilotItemObj::setPropertyValue( const OUString& aPropertyNam
if ( bGetNewIndex ) // after SetDPObject, get the new index
{
- OUString aOUName( sName );
Sequence< OUString > aItemNames = xMembers->getElementNames();
sal_Int32 nItemCount = aItemNames.getLength();
for (sal_Int32 nItem=0; nItem<nItemCount; ++nItem)
- if (aItemNames[nItem] == aOUName)
+ if (aItemNames[nItem] == sName)
mnIndex = nItem;
}
}
diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx
index 342f956e371a..60401b936362 100644
--- a/sc/source/ui/unoobj/datauno.cxx
+++ b/sc/source/ui/unoobj/datauno.cxx
@@ -683,29 +683,27 @@ void SAL_CALL ScSubTotalDescriptorBase::setPropertyValue(
ScSubTotalParam aParam;
GetData(aParam);
- OUString aString(aPropertyName);
-
// some old property names are for 5.2 compatibility
- if (aString == SC_UNONAME_CASE || aString == SC_UNONAME_ISCASE )
+ if (aPropertyName == SC_UNONAME_CASE || aPropertyName == SC_UNONAME_ISCASE )
aParam.bCaseSens = ScUnoHelpFunctions::GetBoolFromAny( aValue );
- else if (aString == SC_UNONAME_FORMATS || aString == SC_UNONAME_BINDFMT )
+ else if (aPropertyName == SC_UNONAME_FORMATS || aPropertyName == SC_UNONAME_BINDFMT )
aParam.bIncludePattern = ScUnoHelpFunctions::GetBoolFromAny( aValue );
- else if (aString == SC_UNONAME_ENABSORT )
+ else if (aPropertyName == SC_UNONAME_ENABSORT )
aParam.bDoSort = ScUnoHelpFunctions::GetBoolFromAny( aValue );
- else if (aString == SC_UNONAME_SORTASC )
+ else if (aPropertyName == SC_UNONAME_SORTASC )
aParam.bAscending = ScUnoHelpFunctions::GetBoolFromAny( aValue );
- else if (aString == SC_UNONAME_INSBRK )
+ else if (aPropertyName == SC_UNONAME_INSBRK )
aParam.bPagebreak = ScUnoHelpFunctions::GetBoolFromAny( aValue );
- else if (aString == SC_UNONAME_ULIST || aString == SC_UNONAME_ENUSLIST )
+ else if (aPropertyName == SC_UNONAME_ULIST || aPropertyName == SC_UNONAME_ENUSLIST )
aParam.bUserDef = ScUnoHelpFunctions::GetBoolFromAny( aValue );
- else if (aString == SC_UNONAME_UINDEX || aString == SC_UNONAME_USINDEX )
+ else if (aPropertyName == SC_UNONAME_UINDEX || aPropertyName == SC_UNONAME_USINDEX )
{
sal_Int32 nVal = 0;
if ( aValue >>= nVal )
aParam.nUserIndex = (sal_uInt16)nVal;
}
- else if (aString == SC_UNONAME_MAXFLD )
+ else if (aPropertyName == SC_UNONAME_MAXFLD )
{
sal_Int32 nVal = 0;
if ( (aValue >>= nVal) && nVal > sal::static_int_cast<sal_Int32>(MAXSUBTOTAL) )
@@ -725,26 +723,25 @@ uno::Any SAL_CALL ScSubTotalDescriptorBase::getPropertyValue( const OUString& aP
ScSubTotalParam aParam;
GetData(aParam);
- OUString aString(aPropertyName);
uno::Any aRet;
// some old property names are for 5.2 compatibility
- if (aString == SC_UNONAME_CASE || aString == SC_UNONAME_ISCASE )
+ if (aPropertyName == SC_UNONAME_CASE || aPropertyName == SC_UNONAME_ISCASE )
ScUnoHelpFunctions::SetBoolInAny( aRet, aParam.bCaseSens );
- else if (aString == SC_UNONAME_FORMATS || aString == SC_UNONAME_BINDFMT )
+ else if (aPropertyName == SC_UNONAME_FORMATS || aPropertyName == SC_UNONAME_BINDFMT )
ScUnoHelpFunctions::SetBoolInAny( aRet, aParam.bIncludePattern );
- else if (aString == SC_UNONAME_ENABSORT )
+ else if (aPropertyName == SC_UNONAME_ENABSORT )
ScUnoHelpFunctions::SetBoolInAny( aRet, aParam.bDoSort );
- else if (aString == SC_UNONAME_SORTASC )
+ else if (aPropertyName == SC_UNONAME_SORTASC )
ScUnoHelpFunctions::SetBoolInAny( aRet, aParam.bAscending );
- else if (aString == SC_UNONAME_INSBRK )
+ else if (aPropertyName == SC_UNONAME_INSBRK )
ScUnoHelpFunctions::SetBoolInAny( aRet, aParam.bPagebreak );
- else if (aString == SC_UNONAME_ULIST || aString == SC_UNONAME_ENUSLIST )
+ else if (aPropertyName == SC_UNONAME_ULIST || aPropertyName == SC_UNONAME_ENUSLIST )
ScUnoHelpFunctions::SetBoolInAny( aRet, aParam.bUserDef );
- else if (aString == SC_UNONAME_UINDEX || aString == SC_UNONAME_USINDEX )
+ else if (aPropertyName == SC_UNONAME_UINDEX || aPropertyName == SC_UNONAME_USINDEX )
aRet <<= (sal_Int32) aParam.nUserIndex;
- else if (aString == SC_UNONAME_MAXFLD )
+ else if (aPropertyName == SC_UNONAME_MAXFLD )
aRet <<= (sal_Int32) MAXSUBTOTAL;
return aRet;
@@ -1438,25 +1435,24 @@ void SAL_CALL ScFilterDescriptorBase::setPropertyValue(
ScQueryParam aParam;
GetData(aParam);
- OUString aString(aPropertyName);
- if (aString == SC_UNONAME_CONTHDR)
+ if (aPropertyName == SC_UNONAME_CONTHDR)
aParam.bHasHeader = ScUnoHelpFunctions::GetBoolFromAny( aValue );
- else if (aString == SC_UNONAME_COPYOUT)
+ else if (aPropertyName == SC_UNONAME_COPYOUT)
aParam.bInplace = !(ScUnoHelpFunctions::GetBoolFromAny( aValue ));
- else if (aString == SC_UNONAME_ISCASE)
+ else if (aPropertyName == SC_UNONAME_ISCASE)
aParam.bCaseSens = ScUnoHelpFunctions::GetBoolFromAny( aValue );
- else if (aString == SC_UNONAME_MAXFLD)
+ else if (aPropertyName == SC_UNONAME_MAXFLD)
{
// silently ignored
}
- else if (aString == SC_UNONAME_ORIENT)
+ else if (aPropertyName == SC_UNONAME_ORIENT)
{
//! test for correct enum type?
table::TableOrientation eOrient = (table::TableOrientation)
ScUnoHelpFunctions::GetEnumFromAny( aValue );
aParam.bByRow = ( eOrient != table::TableOrientation_COLUMNS );
}
- else if (aString == SC_UNONAME_OUTPOS)
+ else if (aPropertyName == SC_UNONAME_OUTPOS)
{
table::CellAddress aAddress;
if ( aValue >>= aAddress )
@@ -1466,11 +1462,11 @@ void SAL_CALL ScFilterDescriptorBase::setPropertyValue(
aParam.nDestRow = (SCROW)aAddress.Row;
}
}
- else if (aString == SC_UNONAME_SAVEOUT)
+ else if (aPropertyName == SC_UNONAME_SAVEOUT)
aParam.bDestPers = ScUnoHelpFunctions::GetBoolFromAny( aValue );
- else if (aString == SC_UNONAME_SKIPDUP)
+ else if (aPropertyName == SC_UNONAME_SKIPDUP)
aParam.bDuplicate = !(ScUnoHelpFunctions::GetBoolFromAny( aValue ));
- else if (aString == SC_UNONAME_USEREGEX)
+ else if (aPropertyName == SC_UNONAME_USEREGEX)
aParam.eSearchType = ScUnoHelpFunctions::GetBoolFromAny( aValue ) ? utl::SearchParam::SRCH_REGEXP :
utl::SearchParam::SRCH_NORMAL;
@@ -1485,24 +1481,23 @@ uno::Any SAL_CALL ScFilterDescriptorBase::getPropertyValue( const OUString& aPro
ScQueryParam aParam;
GetData(aParam);
- OUString aString(aPropertyName);
uno::Any aRet;
- if (aString == SC_UNONAME_CONTHDR )
+ if (aPropertyName == SC_UNONAME_CONTHDR )
ScUnoHelpFunctions::SetBoolInAny( aRet, aParam.bHasHeader );
- else if (aString == SC_UNONAME_COPYOUT )
+ else if (aPropertyName == SC_UNONAME_COPYOUT )
ScUnoHelpFunctions::SetBoolInAny( aRet, !(aParam.bInplace) );
- else if (aString == SC_UNONAME_ISCASE )
+ else if (aPropertyName == SC_UNONAME_ISCASE )
ScUnoHelpFunctions::SetBoolInAny( aRet, aParam.bCaseSens );
- else if (aString == SC_UNONAME_MAXFLD )
+ else if (aPropertyName == SC_UNONAME_MAXFLD )
aRet <<= (sal_Int32) aParam.GetEntryCount();
- else if (aString == SC_UNONAME_ORIENT )
+ else if (aPropertyName == SC_UNONAME_ORIENT )
{
table::TableOrientation eOrient = aParam.bByRow ? table::TableOrientation_ROWS :
table::TableOrientation_COLUMNS;
aRet <<= eOrient;
}
- else if (aString == SC_UNONAME_OUTPOS )
+ else if (aPropertyName == SC_UNONAME_OUTPOS )
{
table::CellAddress aOutPos;
aOutPos.Sheet = aParam.nDestTab;
@@ -1510,11 +1505,11 @@ uno::Any SAL_CALL ScFilterDescriptorBase::getPropertyValue( const OUString& aPro
aOutPos.Row = aParam.nDestRow;
aRet <<= aOutPos;
}
- else if (aString == SC_UNONAME_SAVEOUT )
+ else if (aPropertyName == SC_UNONAME_SAVEOUT )
ScUnoHelpFunctions::SetBoolInAny( aRet, aParam.bDestPers );
- else if (aString == SC_UNONAME_SKIPDUP )
+ else if (aPropertyName == SC_UNONAME_SKIPDUP )
ScUnoHelpFunctions::SetBoolInAny( aRet, !(aParam.bDuplicate) );
- else if (aString == SC_UNONAME_USEREGEX )
+ else if (aPropertyName == SC_UNONAME_USEREGEX )
ScUnoHelpFunctions::SetBoolInAny( aRet, aParam.eSearchType == utl::SearchParam::SRCH_REGEXP );
return aRet;
@@ -1699,10 +1694,9 @@ void SAL_CALL ScDatabaseRangeObj::setName( const OUString& aNewName )
if (pDocShell)
{
ScDBDocFunc aFunc(*pDocShell);
- OUString aNewStr(aNewName);
- bool bOk = aFunc.RenameDBRange( aName, aNewStr );
+ bool bOk = aFunc.RenameDBRange( aName, aNewName );
if (bOk)
- aName = aNewStr;
+ aName = aNewName;
}
}
@@ -2008,14 +2002,13 @@ void SAL_CALL ScDatabaseRangeObj::setPropertyValue(
ScDBData aNewData( *pData );
bool bDo = true;
- OUString aString(aPropertyName);
- if ( aString == SC_UNONAME_KEEPFORM )
+ if ( aPropertyName == SC_UNONAME_KEEPFORM )
aNewData.SetKeepFmt( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if ( aString == SC_UNONAME_MOVCELLS )
+ else if ( aPropertyName == SC_UNONAME_MOVCELLS )
aNewData.SetDoSize( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if ( aString == SC_UNONAME_STRIPDAT )
+ else if ( aPropertyName == SC_UNONAME_STRIPDAT )
aNewData.SetStripData( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if (aString == SC_UNONAME_AUTOFLT )
+ else if (aPropertyName == SC_UNONAME_AUTOFLT )
{
bool bAutoFilter(ScUnoHelpFunctions::GetBoolFromAny( aValue ));
aNewData.SetAutoFilter(bAutoFilter);
@@ -2034,7 +2027,7 @@ void SAL_CALL ScDatabaseRangeObj::setPropertyValue(
aPaintRange.aEnd.SetRow(aPaintRange.aStart.Row());
pDocShell->PostPaint(aPaintRange, PAINT_GRID);
}
- else if (aString == SC_UNONAME_USEFLTCRT )
+ else if (aPropertyName == SC_UNONAME_USEFLTCRT )
{
if (ScUnoHelpFunctions::GetBoolFromAny( aValue ))
{
@@ -2046,7 +2039,7 @@ void SAL_CALL ScDatabaseRangeObj::setPropertyValue(
else
aNewData.SetAdvancedQuerySource(nullptr);
}
- else if (aString == SC_UNONAME_FLTCRT )
+ else if (aPropertyName == SC_UNONAME_FLTCRT )
{
table::CellRangeAddress aRange;
if (aValue >>= aRange)
@@ -2057,11 +2050,11 @@ void SAL_CALL ScDatabaseRangeObj::setPropertyValue(
aNewData.SetAdvancedQuerySource(&aCoreRange);
}
}
- else if (aString == SC_UNONAME_FROMSELECT )
+ else if (aPropertyName == SC_UNONAME_FROMSELECT )
{
aNewData.SetImportSelection(::cppu::any2bool(aValue));
}
- else if (aString == SC_UNONAME_REFPERIOD )
+ else if (aPropertyName == SC_UNONAME_REFPERIOD )
{
sal_Int32 nRefresh = 0;
if (aValue >>= nRefresh)
@@ -2075,12 +2068,12 @@ void SAL_CALL ScDatabaseRangeObj::setPropertyValue(
}
}
}
- else if (aString == SC_UNONAME_CONRES )
+ else if (aPropertyName == SC_UNONAME_CONRES )
{
}
- else if ( aString == SC_UNONAME_TOTALSROW )
+ else if ( aPropertyName == SC_UNONAME_TOTALSROW )
aNewData.SetTotals( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if ( aString == SC_UNONAME_CONTHDR )
+ else if ( aPropertyName == SC_UNONAME_CONTHDR )
aNewData.SetHeader( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
else
bDo = false;
@@ -2102,40 +2095,39 @@ uno::Any SAL_CALL ScDatabaseRangeObj::getPropertyValue( const OUString& aPropert
ScDBData* pData = GetDBData_Impl();
if ( pData )
{
- OUString aString(aPropertyName);
- if ( aString == SC_UNONAME_KEEPFORM )
+ if ( aPropertyName == SC_UNONAME_KEEPFORM )
ScUnoHelpFunctions::SetBoolInAny( aRet, pData->IsKeepFmt() );
- else if ( aString == SC_UNONAME_MOVCELLS )
+ else if ( aPropertyName == SC_UNONAME_MOVCELLS )
ScUnoHelpFunctions::SetBoolInAny( aRet, pData->IsDoSize() );
- else if ( aString == SC_UNONAME_STRIPDAT )
+ else if ( aPropertyName == SC_UNONAME_STRIPDAT )
ScUnoHelpFunctions::SetBoolInAny( aRet, pData->IsStripData() );
- else if ( aString == SC_UNONAME_ISUSER )
+ else if ( aPropertyName == SC_UNONAME_ISUSER )
{
// all database ranges except "unnamed" are user defined
ScUnoHelpFunctions::SetBoolInAny(
aRet, pData->GetName() != STR_DB_LOCAL_NONAME);
}
- else if ( aString == SC_UNO_LINKDISPBIT )
+ else if ( aPropertyName == SC_UNO_LINKDISPBIT )
{
// no target bitmaps for individual entries (would be all equal)
// ScLinkTargetTypeObj::SetLinkTargetBitmap( aRet, SC_LINKTARGETTYPE_DBAREA );
}
- else if ( aString == SC_UNO_LINKDISPNAME )
+ else if ( aPropertyName == SC_UNO_LINKDISPNAME )
aRet <<= OUString( aName );
- else if (aString == SC_UNONAME_AUTOFLT )
+ else if (aPropertyName == SC_UNONAME_AUTOFLT )
{
bool bAutoFilter(GetDBData_Impl()->HasAutoFilter());
ScUnoHelpFunctions::SetBoolInAny( aRet, bAutoFilter );
}
- else if (aString == SC_UNONAME_USEFLTCRT )
+ else if (aPropertyName == SC_UNONAME_USEFLTCRT )
{
ScRange aRange;
bool bIsAdvancedSource(GetDBData_Impl()->GetAdvancedQuerySource(aRange));
ScUnoHelpFunctions::SetBoolInAny( aRet, bIsAdvancedSource );
}
- else if (aString == SC_UNONAME_FLTCRT )
+ else if (aPropertyName == SC_UNONAME_FLTCRT )
{
table::CellRangeAddress aRange;
ScRange aCoreRange;
@@ -2144,30 +2136,30 @@ uno::Any SAL_CALL ScDatabaseRangeObj::getPropertyValue( const OUString& aPropert
aRet <<= aRange;
}
- else if (aString == SC_UNONAME_FROMSELECT )
+ else if (aPropertyName == SC_UNONAME_FROMSELECT )
{
ScUnoHelpFunctions::SetBoolInAny( aRet, GetDBData_Impl()->HasImportSelection() );
}
- else if (aString == SC_UNONAME_REFPERIOD )
+ else if (aPropertyName == SC_UNONAME_REFPERIOD )
{
sal_Int32 nRefresh(GetDBData_Impl()->GetRefreshDelay());
aRet <<= nRefresh;
}
- else if (aString == SC_UNONAME_CONRES )
+ else if (aPropertyName == SC_UNONAME_CONRES )
{
}
- else if (aString == SC_UNONAME_TOKENINDEX )
+ else if (aPropertyName == SC_UNONAME_TOKENINDEX )
{
// get index for use in formula tokens (read-only)
aRet <<= static_cast<sal_Int32>(GetDBData_Impl()->GetIndex());
}
- else if (aString == SC_UNONAME_TOTALSROW )
+ else if (aPropertyName == SC_UNONAME_TOTALSROW )
{
bool bTotals(GetDBData_Impl()->HasTotals());
ScUnoHelpFunctions::SetBoolInAny( aRet, bTotals );
}
- else if (aString == SC_UNONAME_CONTHDR )
+ else if (aPropertyName == SC_UNONAME_CONTHDR )
{
bool bHeader(GetDBData_Impl()->HasHeader());
@@ -2250,8 +2242,7 @@ ScDatabaseRangeObj* ScDatabaseRangesObj::GetObjectByName_Impl(const OUString& aN
{
if ( pDocShell && hasByName(aName) )
{
- OUString aString(aName);
- return new ScDatabaseRangeObj( pDocShell, aString );
+ return new ScDatabaseRangeObj( pDocShell, aName );
}
return nullptr;
}
@@ -2266,10 +2257,9 @@ void SAL_CALL ScDatabaseRangesObj::addNewByName( const OUString& aName,
{
ScDBDocFunc aFunc(*pDocShell);
- OUString aString(aName);
ScRange aNameRange( (SCCOL)aRange.StartColumn, (SCROW)aRange.StartRow, aRange.Sheet,
(SCCOL)aRange.EndColumn, (SCROW)aRange.EndRow, aRange.Sheet );
- bDone = aFunc.AddDBRange( aString, aNameRange, true );
+ bDone = aFunc.AddDBRange( aName, aNameRange, true );
}
if (!bDone)
throw uno::RuntimeException(); // no other exceptions specified
@@ -2283,8 +2273,7 @@ void SAL_CALL ScDatabaseRangesObj::removeByName( const OUString& aName )
if (pDocShell)
{
ScDBDocFunc aFunc(*pDocShell);
- OUString aString(aName);
- bDone = aFunc.DeleteDBRange( aString );
+ bDone = aFunc.DeleteDBRange( aName );
}
if (!bDone)
throw uno::RuntimeException(); // no other exceptions specified
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 81af766093c6..ffab4b206629 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -1926,8 +1926,7 @@ void SAL_CALL ScModelObj::protect( const OUString& aPassword ) throw(uno::Runtim
// #i108245# if already protected, don't change anything
if ( pDocShell && !pDocShell->GetDocument().IsDocProtected() )
{
- OUString aString(aPassword);
- pDocShell->GetDocFunc().Protect( TABLEID_DOC, aString, true );
+ pDocShell->GetDocFunc().Protect( TABLEID_DOC, aPassword, true );
}
}
@@ -1937,8 +1936,7 @@ void SAL_CALL ScModelObj::unprotect( const OUString& aPassword )
SolarMutexGuard aGuard;
if (pDocShell)
{
- OUString aString(aPassword);
- bool bDone = pDocShell->GetDocFunc().Unprotect( TABLEID_DOC, aString, true );
+ bool bDone = pDocShell->GetDocFunc().Unprotect( TABLEID_DOC, aPassword, true );
if (!bDone)
throw lang::IllegalArgumentException();
}
@@ -1981,13 +1979,12 @@ sheet::GoalResult SAL_CALL ScModelObj::seekGoal(
if (pDocShell)
{
WaitObject aWait( ScDocShell::GetActiveDialogParent() );
- OUString aGoalString(aGoalValue);
ScDocument& rDoc = pDocShell->GetDocument();
double fValue = 0.0;
bool bFound = rDoc.Solver(
(SCCOL)aFormulaPosition.Column, (SCROW)aFormulaPosition.Row, aFormulaPosition.Sheet,
(SCCOL)aVariablePosition.Column, (SCROW)aVariablePosition.Row, aVariablePosition.Sheet,
- aGoalString, fValue );
+ aGoalValue, fValue );
aResult.Result = fValue;
if (bFound)
aResult.Divergence = 0.0; //! das ist gelogen
@@ -2094,7 +2091,6 @@ void SAL_CALL ScModelObj::setPropertyValue(
uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- OUString aString(aPropertyName);
if (pDocShell)
{
@@ -2109,13 +2105,13 @@ void SAL_CALL ScModelObj::setPropertyValue(
if (bOpt)
{
// done...
- if ( aString == SC_UNO_IGNORECASE ||
- aString == SC_UNONAME_REGEXP ||
- aString == SC_UNONAME_WILDCARDS ||
- aString == SC_UNO_LOOKUPLABELS )
+ if ( aPropertyName == SC_UNO_IGNORECASE ||
+ aPropertyName == SC_UNONAME_REGEXP ||
+ aPropertyName == SC_UNONAME_WILDCARDS ||
+ aPropertyName == SC_UNO_LOOKUPLABELS )
bHardRecalc = false;
}
- else if ( aString == SC_UNONAME_CLOCAL )
+ else if ( aPropertyName == SC_UNONAME_CLOCAL )
{
lang::Locale aLocale;
if ( aValue >>= aLocale )
@@ -2126,13 +2122,13 @@ void SAL_CALL ScModelObj::setPropertyValue(
rDoc.SetLanguage( eLatin, eCjk, eCtl );
}
}
- else if ( aString == SC_UNO_CODENAME )
+ else if ( aPropertyName == SC_UNO_CODENAME )
{
OUString sCodeName;
if ( aValue >>= sCodeName )
rDoc.SetCodeName( sCodeName );
}
- else if ( aString == SC_UNO_CJK_CLOCAL )
+ else if ( aPropertyName == SC_UNO_CJK_CLOCAL )
{
lang::Locale aLocale;
if ( aValue >>= aLocale )
@@ -2143,7 +2139,7 @@ void SAL_CALL ScModelObj::setPropertyValue(
rDoc.SetLanguage( eLatin, eCjk, eCtl );
}
}
- else if ( aString == SC_UNO_CTL_CLOCAL )
+ else if ( aPropertyName == SC_UNO_CTL_CLOCAL )
{
lang::Locale aLocale;
if ( aValue >>= aLocale )
@@ -2154,7 +2150,7 @@ void SAL_CALL ScModelObj::setPropertyValue(
rDoc.SetLanguage( eLatin, eCjk, eCtl );
}
}
- else if ( aString == SC_UNO_APPLYFMDES )
+ else if ( aPropertyName == SC_UNO_APPLYFMDES )
{
// model is created if not there
ScDrawLayer* pModel = pDocShell->MakeDrawLayer();
@@ -2164,7 +2160,7 @@ void SAL_CALL ScModelObj::setPropertyValue(
if (pBindings)
pBindings->Invalidate( SID_FM_OPEN_READONLY );
}
- else if ( aString == SC_UNO_AUTOCONTFOC )
+ else if ( aPropertyName == SC_UNO_AUTOCONTFOC )
{
// model is created if not there
ScDrawLayer* pModel = pDocShell->MakeDrawLayer();
@@ -2174,11 +2170,11 @@ void SAL_CALL ScModelObj::setPropertyValue(
if (pBindings)
pBindings->Invalidate( SID_FM_AUTOCONTROLFOCUS );
}
- else if ( aString == SC_UNO_ISLOADED )
+ else if ( aPropertyName == SC_UNO_ISLOADED )
{
pDocShell->SetEmpty( !ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
}
- else if ( aString == SC_UNO_ISUNDOENABLED )
+ else if ( aPropertyName == SC_UNO_ISUNDOENABLED )
{
bool bUndoEnabled = ScUnoHelpFunctions::GetBoolFromAny( aValue );
rDoc.EnableUndo( bUndoEnabled );
@@ -2186,7 +2182,7 @@ void SAL_CALL ScModelObj::setPropertyValue(
bUndoEnabled
? officecfg::Office::Common::Undo::Steps::get() : 0);
}
- else if ( aString == SC_UNO_RECORDCHANGES )
+ else if ( aPropertyName == SC_UNO_RECORDCHANGES )
{
bool bRecordChangesEnabled = ScUnoHelpFunctions::GetBoolFromAny( aValue );
@@ -2197,33 +2193,33 @@ void SAL_CALL ScModelObj::setPropertyValue(
if (bChangeAllowed)
pDocShell->SetChangeRecording(bRecordChangesEnabled);
}
- else if ( aString == SC_UNO_ISADJUSTHEIGHTENABLED )
+ else if ( aPropertyName == SC_UNO_ISADJUSTHEIGHTENABLED )
{
bool bOldAdjustHeightEnabled = rDoc.IsAdjustHeightEnabled();
bool bAdjustHeightEnabled = ScUnoHelpFunctions::GetBoolFromAny( aValue );
if( bOldAdjustHeightEnabled != bAdjustHeightEnabled )
rDoc.EnableAdjustHeight( bAdjustHeightEnabled );
}
- else if ( aString == SC_UNO_ISEXECUTELINKENABLED )
+ else if ( aPropertyName == SC_UNO_ISEXECUTELINKENABLED )
{
rDoc.EnableExecuteLink( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
}
- else if ( aString == SC_UNO_ISCHANGEREADONLYENABLED )
+ else if ( aPropertyName == SC_UNO_ISCHANGEREADONLYENABLED )
{
rDoc.EnableChangeReadOnly( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
}
- else if ( aString == "BuildId" )
+ else if ( aPropertyName == "BuildId" )
{
aValue >>= maBuildId;
}
- else if ( aString == "SavedObject" ) // set from chart after saving
+ else if ( aPropertyName == "SavedObject" ) // set from chart after saving
{
OUString aObjName;
aValue >>= aObjName;
if ( !aObjName.isEmpty() )
rDoc.RestoreChartListener( aObjName );
}
- else if ( aString == SC_UNO_INTEROPGRABBAG )
+ else if ( aPropertyName == SC_UNO_INTEROPGRABBAG )
{
setGrabBagItem(aValue);
}
@@ -2244,7 +2240,6 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const OUString& aPropertyName )
uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- OUString aString(aPropertyName);
uno::Any aRet;
if (pDocShell)
@@ -2256,7 +2251,7 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const OUString& aPropertyName )
{
// done...
}
- else if ( aString == SC_UNONAME_CLOCAL )
+ else if ( aPropertyName == SC_UNONAME_CLOCAL )
{
LanguageType eLatin, eCjk, eCtl;
rDoc.GetLanguage( eLatin, eCjk, eCtl );
@@ -2265,13 +2260,13 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const OUString& aPropertyName )
ScUnoConversion::FillLocale( aLocale, eLatin );
aRet <<= aLocale;
}
- else if ( aString == SC_UNO_CODENAME )
+ else if ( aPropertyName == SC_UNO_CODENAME )
{
OUString sCodeName = rDoc.GetCodeName();
aRet <<= sCodeName;
}
- else if ( aString == SC_UNO_CJK_CLOCAL )
+ else if ( aPropertyName == SC_UNO_CJK_CLOCAL )
{
LanguageType eLatin, eCjk, eCtl;
rDoc.GetLanguage( eLatin, eCjk, eCtl );
@@ -2280,7 +2275,7 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const OUString& aPropertyName )
ScUnoConversion::FillLocale( aLocale, eCjk );
aRet <<= aLocale;
}
- else if ( aString == SC_UNO_CTL_CLOCAL )
+ else if ( aPropertyName == SC_UNO_CTL_CLOCAL )
{
LanguageType eLatin, eCjk, eCtl;
rDoc.GetLanguage( eLatin, eCjk, eCtl );
@@ -2289,73 +2284,73 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const OUString& aPropertyName )
ScUnoConversion::FillLocale( aLocale, eCtl );
aRet <<= aLocale;
}
- else if ( aString == SC_UNO_NAMEDRANGES )
+ else if ( aPropertyName == SC_UNO_NAMEDRANGES )
{
aRet <<= uno::Reference<sheet::XNamedRanges>(new ScGlobalNamedRangesObj( pDocShell ));
}
- else if ( aString == SC_UNO_DATABASERNG )
+ else if ( aPropertyName == SC_UNO_DATABASERNG )
{
aRet <<= uno::Reference<sheet::XDatabaseRanges>(new ScDatabaseRangesObj( pDocShell ));
}
- else if ( aString == SC_UNO_UNNAMEDDBRNG )
+ else if ( aPropertyName == SC_UNO_UNNAMEDDBRNG )
{
aRet <<= uno::Reference<sheet::XUnnamedDatabaseRanges>(new ScUnnamedDatabaseRangesObj(pDocShell));
}
- else if ( aString == SC_UNO_COLLABELRNG )
+ else if ( aPropertyName == SC_UNO_COLLABELRNG )
{
aRet <<= uno::Reference<sheet::XLabelRanges>(new ScLabelRangesObj( pDocShell, true ));
}
- else if ( aString == SC_UNO_ROWLABELRNG )
+ else if ( aPropertyName == SC_UNO_ROWLABELRNG )
{
aRet <<= uno::Reference<sheet::XLabelRanges>(new ScLabelRangesObj( pDocShell, false ));
}
- else if ( aString == SC_UNO_AREALINKS )
+ else if ( aPropertyName == SC_UNO_AREALINKS )
{
aRet <<= uno::Reference<sheet::XAreaLinks>(new ScAreaLinksObj( pDocShell ));
}
- else if ( aString == SC_UNO_DDELINKS )
+ else if ( aPropertyName == SC_UNO_DDELINKS )
{
aRet <<= uno::Reference<container::XNameAccess>(new ScDDELinksObj( pDocShell ));
}
- else if ( aString == SC_UNO_EXTERNALDOCLINKS )
+ else if ( aPropertyName == SC_UNO_EXTERNALDOCLINKS )
{
aRet <<= uno::Reference<sheet::XExternalDocLinks>(new ScExternalDocLinksObj(pDocShell));
}
- else if ( aString == SC_UNO_SHEETLINKS )
+ else if ( aPropertyName == SC_UNO_SHEETLINKS )
{
aRet <<= uno::Reference<container::XNameAccess>(new ScSheetLinksObj( pDocShell ));
}
- else if ( aString == SC_UNO_APPLYFMDES )
+ else if ( aPropertyName == SC_UNO_APPLYFMDES )
{
// default for no model is TRUE
ScDrawLayer* pModel = rDoc.GetDrawLayer();
bool bOpenInDesign = pModel == nullptr || pModel->GetOpenInDesignMode();
ScUnoHelpFunctions::SetBoolInAny( aRet, bOpenInDesign );
}
- else if ( aString == SC_UNO_AUTOCONTFOC )
+ else if ( aPropertyName == SC_UNO_AUTOCONTFOC )
{
// default for no model is FALSE
ScDrawLayer* pModel = rDoc.GetDrawLayer();
bool bAutoControlFocus = pModel && pModel->GetAutoControlFocus();
ScUnoHelpFunctions::SetBoolInAny( aRet, bAutoControlFocus );
}
- else if ( aString == SC_UNO_FORBIDDEN )
+ else if ( aPropertyName == SC_UNO_FORBIDDEN )
{
aRet <<= uno::Reference<i18n::XForbiddenCharacters>(new ScForbiddenCharsObj( pDocShell ));
}
- else if ( aString == SC_UNO_HASDRAWPAGES )
+ else if ( aPropertyName == SC_UNO_HASDRAWPAGES )
{
ScUnoHelpFunctions::SetBoolInAny( aRet, (pDocShell->GetDocument().GetDrawLayer() != nullptr) );
}
- else if ( aString == SC_UNO_BASICLIBRARIES )
+ else if ( aPropertyName == SC_UNO_BASICLIBRARIES )
{
aRet <<= pDocShell->GetBasicContainer();
}
- else if ( aString == SC_UNO_DIALOGLIBRARIES )
+ else if ( aPropertyName == SC_UNO_DIALOGLIBRARIES )
{
aRet <<= pDocShell->GetDialogContainer();
}
- else if ( aString == SC_UNO_VBAGLOBNAME )
+ else if ( aPropertyName == SC_UNO_VBAGLOBNAME )
{
/* #i111553# This property provides the name of the constant that
will be used to store this model in the global Basic manager.
@@ -2364,57 +2359,57 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const OUString& aPropertyName )
constant can co-exist, as required by VBA. */
aRet <<= OUString( "ThisExcelDoc" );
}
- else if ( aString == SC_UNO_RUNTIMEUID )
+ else if ( aPropertyName == SC_UNO_RUNTIMEUID )
{
aRet <<= getRuntimeUID();
}
- else if ( aString == SC_UNO_HASVALIDSIGNATURES )
+ else if ( aPropertyName == SC_UNO_HASVALIDSIGNATURES )
{
aRet <<= hasValidSignatures();
}
- else if ( aString == SC_UNO_ISLOADED )
+ else if ( aPropertyName == SC_UNO_ISLOADED )
{
ScUnoHelpFunctions::SetBoolInAny( aRet, !pDocShell->IsEmpty() );
}
- else if ( aString == SC_UNO_ISUNDOENABLED )
+ else if ( aPropertyName == SC_UNO_ISUNDOENABLED )
{
ScUnoHelpFunctions::SetBoolInAny( aRet, rDoc.IsUndoEnabled() );
}
- else if ( aString == SC_UNO_RECORDCHANGES )
+ else if ( aPropertyName == SC_UNO_RECORDCHANGES )
{
ScUnoHelpFunctions::SetBoolInAny( aRet, pDocShell->IsChangeRecording() );
}
- else if ( aString == SC_UNO_ISRECORDCHANGESPROTECTED )
+ else if ( aPropertyName == SC_UNO_ISRECORDCHANGESPROTECTED )
{
ScUnoHelpFunctions::SetBoolInAny( aRet, pDocShell->HasChangeRecordProtection() );
}
- else if ( aString == SC_UNO_ISADJUSTHEIGHTENABLED )
+ else if ( aPropertyName == SC_UNO_ISADJUSTHEIGHTENABLED )
{
ScUnoHelpFunctions::SetBoolInAny( aRet, rDoc.IsAdjustHeightEnabled() );
}
- else if ( aString == SC_UNO_ISEXECUTELINKENABLED )
+ else if ( aPropertyName == SC_UNO_ISEXECUTELINKENABLED )
{
ScUnoHelpFunctions::SetBoolInAny( aRet, rDoc.IsExecuteLinkEnabled() );
}
- else if ( aString == SC_UNO_ISCHANGEREADONLYENABLED )
+ else if ( aPropertyName == SC_UNO_ISCHANGEREADONLYENABLED )
{
ScUnoHelpFunctions::SetBoolInAny( aRet, rDoc.IsChangeReadOnlyEnabled() );
}
- else if ( aString == SC_UNO_REFERENCEDEVICE )
+ else if ( aPropertyName == SC_UNO_REFERENCEDEVICE )
{
VCLXDevice* pXDev = new VCLXDevice();
pXDev->SetOutputDevice( rDoc.GetRefDevice() );
aRet <<= uno::Reference< awt::XDevice >( pXDev );
}
- else if ( aString == "BuildId" )
+ else if ( aPropertyName == "BuildId" )
{
aRet <<= maBuildId;
}
- else if ( aString == "InternalDocument" )
+ else if ( aPropertyName == "InternalDocument" )
{
ScUnoHelpFunctions::SetBoolInAny( aRet, (pDocShell->GetCreateMode() == SfxObjectCreateMode::INTERNAL) );
}
- else if ( aString == SC_UNO_INTEROPGRABBAG )
+ else if ( aPropertyName == SC_UNO_INTEROPGRABBAG )
{
getGrabBagItem(aRet);
}
@@ -2434,8 +2429,7 @@ css::uno::Reference<css::uno::XInterface> ScModelObj::create(
using ServiceType = ScServiceProvider::Type;
uno::Reference<uno::XInterface> xRet;
- OUString aNameStr(aServiceSpecifier);
- ServiceType nType = ScServiceProvider::GetProviderType(aNameStr);
+ ServiceType nType = ScServiceProvider::GetProviderType(aServiceSpecifier);
if ( nType != ServiceType::INVALID )
{
// drawing layer tables must be kept as long as the model is alive
@@ -3144,8 +3138,7 @@ void SAL_CALL ScTableSheetsObj::insertNewByName( const OUString& aName, sal_Int1
bool bDone = false;
if (pDocShell)
{
- OUString aNamStr(aName);
- bDone = pDocShell->GetDocFunc().InsertTable( nPosition, aNamStr, true, true );
+ bDone = pDocShell->GetDocFunc().InsertTable( nPosition, aName, true, true );
}
if (!bDone)
throw uno::RuntimeException(); // no other exceptions specified
@@ -3174,7 +3167,6 @@ void SAL_CALL ScTableSheetsObj::copyByName( const OUString& aName,
bool bDone = false;
if (pDocShell)
{
- OUString aNewStr(aCopy);
SCTAB nSource;
if ( pDocShell->GetDocument().GetTable( aName, nSource ) )
{
@@ -3187,7 +3179,7 @@ void SAL_CALL ScTableSheetsObj::copyByName( const OUString& aName,
if (nResultTab >= nTabCount)
nResultTab = nTabCount - 1;
- bDone = pDocShell->GetDocFunc().RenameTable( nResultTab, aNewStr,
+ bDone = pDocShell->GetDocFunc().RenameTable( nResultTab, aCopy,
true, true );
}
}
@@ -3215,9 +3207,8 @@ void SAL_CALL ScTableSheetsObj::insertByName( const OUString& aName, const uno::
if ( pSheetObj && !pSheetObj->GetDocShell() ) // noch nicht eingefuegt?
{
ScDocument& rDoc = pDocShell->GetDocument();
- OUString aNamStr(aName);
SCTAB nDummy;
- if ( rDoc.GetTable( aNamStr, nDummy ) )
+ if ( rDoc.GetTable( aName, nDummy ) )
{
// name already exists
throw container::ElementExistException();
@@ -3225,7 +3216,7 @@ void SAL_CALL ScTableSheetsObj::insertByName( const OUString& aName, const uno::
else
{
SCTAB nPosition = rDoc.GetTableCount();
- bDone = pDocShell->GetDocFunc().InsertTable( nPosition, aNamStr,
+ bDone = pDocShell->GetDocFunc().InsertTable( nPosition, aName,
true, true );
if (bDone)
pSheetObj->InitInsertSheet( pDocShell, nPosition );
@@ -3272,8 +3263,7 @@ void SAL_CALL ScTableSheetsObj::replaceByName( const OUString& aName, const uno:
if ( pDocShell->GetDocFunc().DeleteTable( nPosition, true, true ) )
{
// InsertTable kann jetzt eigentlich nicht schiefgehen...
- OUString aNamStr(aName);
- bDone = pDocShell->GetDocFunc().InsertTable( nPosition, aNamStr, true, true );
+ bDone = pDocShell->GetDocFunc().InsertTable( nPosition, aName, true, true );
if (bDone)
pSheetObj->InitInsertSheet( pDocShell, nPosition );
}
@@ -3542,8 +3532,7 @@ ScTableColumnObj* ScTableColumnsObj::GetObjectByIndex_Impl(sal_Int32 nIndex) con
ScTableColumnObj* ScTableColumnsObj::GetObjectByName_Impl(const OUString& aName) const
{
SCCOL nCol = 0;
- OUString aString(aName);
- if ( ::AlphaToCol( nCol, aString) )
+ if ( ::AlphaToCol( nCol, aName) )
if ( pDocShell && nCol >= nStartCol && nCol <= nEndCol )
return new ScTableColumnObj( pDocShell, nCol, nTab );
@@ -3653,8 +3642,7 @@ sal_Bool SAL_CALL ScTableColumnsObj::hasByName( const OUString& aName )
{
SolarMutexGuard aGuard;
SCCOL nCol = 0;
- OUString aString(aName);
- if ( ::AlphaToCol( nCol, aString) )
+ if ( ::AlphaToCol( nCol, aName) )
if ( pDocShell && nCol >= nStartCol && nCol <= nEndCol )
return sal_True;
@@ -3683,24 +3671,23 @@ void SAL_CALL ScTableColumnsObj::setPropertyValue(
throw uno::RuntimeException();
std::vector<sc::ColRowSpan> aColArr(1, sc::ColRowSpan(nStartCol,nEndCol));
- OUString aNameString(aPropertyName);
ScDocFunc& rFunc = pDocShell->GetDocFunc();
- if ( aNameString == SC_UNONAME_CELLWID )
+ if ( aPropertyName == SC_UNONAME_CELLWID )
{
sal_Int32 nNewWidth = 0;
if ( aValue >>= nNewWidth )
rFunc.SetWidthOrHeight(
true, aColArr, nTab, SC_SIZE_ORIGINAL, (sal_uInt16)HMMToTwips(nNewWidth), true, true);
}
- else if ( aNameString == SC_UNONAME_CELLVIS )
+ else if ( aPropertyName == SC_UNONAME_CELLVIS )
{
bool bVis = ScUnoHelpFunctions::GetBoolFromAny( aValue );
ScSizeMode eMode = bVis ? SC_SIZE_SHOW : SC_SIZE_DIRECT;
rFunc.SetWidthOrHeight(true, aColArr, nTab, eMode, 0, true, true);
// SC_SIZE_DIRECT with size 0: hide
}
- else if ( aNameString == SC_UNONAME_OWIDTH )
+ else if ( aPropertyName == SC_UNONAME_OWIDTH )
{
bool bOpt = ScUnoHelpFunctions::GetBoolFromAny( aValue );
if (bOpt)
@@ -3708,7 +3695,7 @@ void SAL_CALL ScTableColumnsObj::setPropertyValue(
true, aColArr, nTab, SC_SIZE_OPTIMAL, STD_EXTRA_WIDTH, true, true);
// sal_False for columns currently has no effect
}
- else if ( aNameString == SC_UNONAME_NEWPAGE || aNameString == SC_UNONAME_MANPAGE )
+ else if ( aPropertyName == SC_UNONAME_NEWPAGE || aPropertyName == SC_UNONAME_MANPAGE )
{
//! single function to set/remove all breaks?
bool bSet = ScUnoHelpFunctions::GetBoolFromAny( aValue );
@@ -3729,33 +3716,32 @@ uno::Any SAL_CALL ScTableColumnsObj::getPropertyValue( const OUString& aProperty
throw uno::RuntimeException();
ScDocument& rDoc = pDocShell->GetDocument();
- OUString aNameString(aPropertyName);
uno::Any aAny;
//! loop over all columns for current state?
- if ( aNameString == SC_UNONAME_CELLWID )
+ if ( aPropertyName == SC_UNONAME_CELLWID )
{
// for hidden column, return original height
sal_uInt16 nWidth = rDoc.GetOriginalWidth( nStartCol, nTab );
aAny <<= (sal_Int32)TwipsToHMM(nWidth);
}
- else if ( aNameString == SC_UNONAME_CELLVIS )
+ else if ( aPropertyName == SC_UNONAME_CELLVIS )
{
bool bVis = !rDoc.ColHidden(nStartCol, nTab);
ScUnoHelpFunctions::SetBoolInAny( aAny, bVis );
}
- else if ( aNameString == SC_UNONAME_OWIDTH )
+ else if ( aPropertyName == SC_UNONAME_OWIDTH )
{
bool bOpt = !(rDoc.GetColFlags( nStartCol, nTab ) & CR_MANUALSIZE);
ScUnoHelpFunctions::SetBoolInAny( aAny, bOpt );
}
- else if ( aNameString == SC_UNONAME_NEWPAGE )
+ else if ( aPropertyName == SC_UNONAME_NEWPAGE )
{
ScBreakType nBreak = rDoc.HasColBreak(nStartCol, nTab);
ScUnoHelpFunctions::SetBoolInAny( aAny, nBreak != BREAK_NONE );
}
- else if ( aNameString == SC_UNONAME_MANPAGE )
+ else if ( aPropertyName == SC_UNONAME_MANPAGE )
{
ScBreakType nBreak = rDoc.HasColBreak(nStartCol, nTab);
ScUnoHelpFunctions::SetBoolInAny( aAny, (nBreak & BREAK_MANUAL) != 0 );
@@ -3904,9 +3890,8 @@ void SAL_CALL ScTableRowsObj::setPropertyValue(
ScDocFunc& rFunc = pDocShell->GetDocFunc();
ScDocument& rDoc = pDocShell->GetDocument();
std::vector<sc::ColRowSpan> aRowArr(1, sc::ColRowSpan(nStartRow,nEndRow));
- OUString aNameString(aPropertyName);
- if ( aNameString == SC_UNONAME_OHEIGHT )
+ if ( aPropertyName == SC_UNONAME_OHEIGHT )
{
sal_Int32 nNewHeight = 0;
if ( rDoc.IsImportingXML() && ( aValue >>= nNewHeight ) )
@@ -3928,7 +3913,7 @@ void SAL_CALL ScTableRowsObj::setPropertyValue(
}
}
}
- else if ( aNameString == SC_UNONAME_CELLHGT )
+ else if ( aPropertyName == SC_UNONAME_CELLHGT )
{
sal_Int32 nNewHeight = 0;
if ( aValue >>= nNewHeight )
@@ -3946,20 +3931,20 @@ void SAL_CALL ScTableRowsObj::setPropertyValue(
false, aRowArr, nTab, SC_SIZE_ORIGINAL, (sal_uInt16)HMMToTwips(nNewHeight), true, true);
}
}
- else if ( aNameString == SC_UNONAME_CELLVIS )
+ else if ( aPropertyName == SC_UNONAME_CELLVIS )
{
bool bVis = ScUnoHelpFunctions::GetBoolFromAny( aValue );
ScSizeMode eMode = bVis ? SC_SIZE_SHOW : SC_SIZE_DIRECT;
rFunc.SetWidthOrHeight(false, aRowArr, nTab, eMode, 0, true, true);
// SC_SIZE_DIRECT with size 0: hide
}
- else if ( aNameString == SC_UNONAME_VISFLAG )
+ else if ( aPropertyName == SC_UNONAME_VISFLAG )
{
// #i116460# Shortcut to only set the flag, without drawing layer update etc.
// Should only be used from import filters.
rDoc.SetRowHidden(nStartRow, nEndRow, nTab, !ScUnoHelpFunctions::GetBoolFromAny( aValue ));
}
- else if ( aNameString == SC_UNONAME_CELLFILT )
+ else if ( aPropertyName == SC_UNONAME_CELLFILT )
{
//! undo etc.
if (ScUnoHelpFunctions::GetBoolFromAny( aValue ))
@@ -3967,7 +3952,7 @@ void SAL_CALL ScTableRowsObj::setPropertyValue(
else
rDoc.SetRowFiltered(nStartRow, nEndRow, nTab, false);
}
- else if ( aNameString == SC_UNONAME_NEWPAGE || aNameString == SC_UNONAME_MANPAGE )
+ else if ( aPropertyName == SC_UNONAME_NEWPAGE || aPropertyName == SC_UNONAME_MANPAGE )
{
//! single function to set/remove all breaks?
bool bSet = ScUnoHelpFunctions::GetBoolFromAny( aValue );
@@ -3977,7 +3962,7 @@ void SAL_CALL ScTableRowsObj::setPropertyValue(
else
rFunc.RemovePageBreak( false, ScAddress(0,nRow,nTab), true, true, true );
}
- else if ( aNameString == SC_UNONAME_CELLBACK || aNameString == SC_UNONAME_CELLTRAN )
+ else if ( aPropertyName == SC_UNONAME_CELLBACK || aPropertyName == SC_UNONAME_CELLTRAN )
{
// #i57867# Background color is specified for row styles in the file format,
// so it has to be supported along with the row properties (import only).
@@ -4000,44 +3985,43 @@ uno::Any SAL_CALL ScTableRowsObj::getPropertyValue( const OUString& aPropertyNam
throw uno::RuntimeException();
ScDocument& rDoc = pDocShell->GetDocument();
- OUString aNameString(aPropertyName);
uno::Any aAny;
//! loop over all rows for current state?
- if ( aNameString == SC_UNONAME_CELLHGT )
+ if ( aPropertyName == SC_UNONAME_CELLHGT )
{
// for hidden row, return original height
sal_uInt16 nHeight = rDoc.GetOriginalHeight( nStartRow, nTab );
aAny <<= (sal_Int32)TwipsToHMM(nHeight);
}
- else if ( aNameString == SC_UNONAME_CELLVIS )
+ else if ( aPropertyName == SC_UNONAME_CELLVIS )
{
SCROW nLastRow;
bool bVis = !rDoc.RowHidden(nStartRow, nTab, nullptr, &nLastRow);
ScUnoHelpFunctions::SetBoolInAny( aAny, bVis );
}
- else if ( aNameString == SC_UNONAME_CELLFILT )
+ else if ( aPropertyName == SC_UNONAME_CELLFILT )
{
bool bVis = rDoc.RowFiltered(nStartRow, nTab);
ScUnoHelpFunctions::SetBoolInAny( aAny, bVis );
}
- else if ( aNameString == SC_UNONAME_OHEIGHT )
+ else if ( aPropertyName == SC_UNONAME_OHEIGHT )
{
bool bOpt = !(rDoc.GetRowFlags( nStartRow, nTab ) & CR_MANUALSIZE);
ScUnoHelpFunctions::SetBoolInAny( aAny, bOpt );
}
- else if ( aNameString == SC_UNONAME_NEWPAGE )
+ else if ( aPropertyName == SC_UNONAME_NEWPAGE )
{
ScBreakType nBreak = rDoc.HasRowBreak(nStartRow, nTab);
ScUnoHelpFunctions::SetBoolInAny( aAny, nBreak != BREAK_NONE );
}
- else if ( aNameString == SC_UNONAME_MANPAGE )
+ else if ( aPropertyName == SC_UNONAME_MANPAGE )
{
ScBreakType nBreak = rDoc.HasRowBreak(nStartRow, nTab);
ScUnoHelpFunctions::SetBoolInAny( aAny, (nBreak & BREAK_MANUAL) != 0 );
}
- else if ( aNameString == SC_UNONAME_CELLBACK || aNameString == SC_UNONAME_CELLTRAN )
+ else if ( aPropertyName == SC_UNONAME_CELLBACK || aPropertyName == SC_UNONAME_CELLTRAN )
{
// Use ScCellRangeObj to get the property from the cell range
// (for completeness only, this is not used by the XML filter).
@@ -4325,13 +4309,10 @@ void SAL_CALL ScScenariosObj::addNewByName( const OUString& aName,
}
}
- OUString aNameStr(aName);
- OUString aCommStr(aComment);
-
Color aColor( COL_LIGHTGRAY ); // Default
sal_uInt16 nFlags = SC_SCENARIO_SHOWFRAME | SC_SCENARIO_PRINTFRAME | SC_SCENARIO_TWOWAY | SC_SCENARIO_PROTECT;
- pDocShell->MakeScenario( nTab, aNameStr, aCommStr, aColor, nFlags, aMarkData );
+ pDocShell->MakeScenario( nTab, aName, aComment, aColor, nFlags, aMarkData );
}
}
diff --git a/sc/source/ui/unoobj/fmtuno.cxx b/sc/source/ui/unoobj/fmtuno.cxx
index 1c83d4a5b353..f626ba271a5c 100644
--- a/sc/source/ui/unoobj/fmtuno.cxx
+++ b/sc/source/ui/unoobj/fmtuno.cxx
@@ -833,37 +833,36 @@ void SAL_CALL ScTableValidationObj::setPropertyValue(
uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- OUString aString(aPropertyName);
- if ( aString == SC_UNONAME_SHOWINP ) bShowInput = ScUnoHelpFunctions::GetBoolFromAny( aValue );
- else if ( aString == SC_UNONAME_SHOWERR ) bShowError = ScUnoHelpFunctions::GetBoolFromAny( aValue );
- else if ( aString == SC_UNONAME_IGNOREBL ) bIgnoreBlank = ScUnoHelpFunctions::GetBoolFromAny( aValue );
- else if ( aString == SC_UNONAME_SHOWLIST ) aValue >>= nShowList;
- else if ( aString == SC_UNONAME_INPTITLE )
+ if ( aPropertyName == SC_UNONAME_SHOWINP ) bShowInput = ScUnoHelpFunctions::GetBoolFromAny( aValue );
+ else if ( aPropertyName == SC_UNONAME_SHOWERR ) bShowError = ScUnoHelpFunctions::GetBoolFromAny( aValue );
+ else if ( aPropertyName == SC_UNONAME_IGNOREBL ) bIgnoreBlank = ScUnoHelpFunctions::GetBoolFromAny( aValue );
+ else if ( aPropertyName == SC_UNONAME_SHOWLIST ) aValue >>= nShowList;
+ else if ( aPropertyName == SC_UNONAME_INPTITLE )
{
OUString aStrVal;
if ( aValue >>= aStrVal )
aInputTitle = aStrVal;
}
- else if ( aString == SC_UNONAME_INPMESS )
+ else if ( aPropertyName == SC_UNONAME_INPMESS )
{
OUString aStrVal;
if ( aValue >>= aStrVal )
aInputMessage = aStrVal;
}
- else if ( aString == SC_UNONAME_ERRTITLE )
+ else if ( aPropertyName == SC_UNONAME_ERRTITLE )
{
OUString aStrVal;
if ( aValue >>= aStrVal )
aErrorTitle = aStrVal;
}
- else if ( aString == SC_UNONAME_ERRMESS )
+ else if ( aPropertyName == SC_UNONAME_ERRMESS )
{
OUString aStrVal;
if ( aValue >>= aStrVal )
aErrorMessage = aStrVal;
}
- else if ( aString == SC_UNONAME_TYPE )
+ else if ( aPropertyName == SC_UNONAME_TYPE )
{
sheet::ValidationType eType = (sheet::ValidationType)
ScUnoHelpFunctions::GetEnumFromAny( aValue );
@@ -883,7 +882,7 @@ void SAL_CALL ScTableValidationObj::setPropertyValue(
}
}
}
- else if ( aString == SC_UNONAME_ERRALSTY )
+ else if ( aPropertyName == SC_UNONAME_ERRALSTY )
{
sheet::ValidationAlertStyle eStyle = (sheet::ValidationAlertStyle)
ScUnoHelpFunctions::GetEnumFromAny( aValue );
@@ -899,7 +898,7 @@ void SAL_CALL ScTableValidationObj::setPropertyValue(
}
}
}
- else if ( aString == SC_UNONAME_SOURCESTR )
+ else if ( aPropertyName == SC_UNONAME_SOURCESTR )
{
// internal - only for XML filter, not in PropertySetInfo, only set
@@ -907,7 +906,7 @@ void SAL_CALL ScTableValidationObj::setPropertyValue(
if ( aValue >>= aStrVal )
aPosString = aStrVal;
}
- else if ( aString == SC_UNONAME_FORMULANMSP1 )
+ else if ( aPropertyName == SC_UNONAME_FORMULANMSP1 )
{
// internal - only for XML filter, not in PropertySetInfo, only set
@@ -915,7 +914,7 @@ void SAL_CALL ScTableValidationObj::setPropertyValue(
if ( aValue >>= aStrVal )
maExprNmsp1 = aStrVal;
}
- else if ( aString == SC_UNONAME_FORMULANMSP2 )
+ else if ( aPropertyName == SC_UNONAME_FORMULANMSP2 )
{
// internal - only for XML filter, not in PropertySetInfo, only set
@@ -923,7 +922,7 @@ void SAL_CALL ScTableValidationObj::setPropertyValue(
if ( aValue >>= aStrVal )
maExprNmsp2 = aStrVal;
}
- else if ( aString == SC_UNONAME_GRAMMAR1 )
+ else if ( aPropertyName == SC_UNONAME_GRAMMAR1 )
{
// internal - only for XML filter, not in PropertySetInfo, only set
@@ -931,7 +930,7 @@ void SAL_CALL ScTableValidationObj::setPropertyValue(
if ( aValue >>= nVal )
meGrammar1 = static_cast< FormulaGrammar::Grammar >(nVal);
}
- else if ( aString == SC_UNONAME_GRAMMAR2 )
+ else if ( aPropertyName == SC_UNONAME_GRAMMAR2 )
{
// internal - only for XML filter, not in PropertySetInfo, only set
@@ -946,18 +945,17 @@ uno::Any SAL_CALL ScTableValidationObj::getPropertyValue( const OUString& aPrope
uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- OUString aString(aPropertyName);
uno::Any aRet;
- if ( aString == SC_UNONAME_SHOWINP ) ScUnoHelpFunctions::SetBoolInAny( aRet, bShowInput );
- else if ( aString == SC_UNONAME_SHOWERR ) ScUnoHelpFunctions::SetBoolInAny( aRet, bShowError );
- else if ( aString == SC_UNONAME_IGNOREBL ) ScUnoHelpFunctions::SetBoolInAny( aRet, bIgnoreBlank );
- else if ( aString == SC_UNONAME_SHOWLIST ) aRet <<= nShowList;
- else if ( aString == SC_UNONAME_INPTITLE ) aRet <<= OUString( aInputTitle );
- else if ( aString == SC_UNONAME_INPMESS ) aRet <<= OUString( aInputMessage );
- else if ( aString == SC_UNONAME_ERRTITLE ) aRet <<= OUString( aErrorTitle );
- else if ( aString == SC_UNONAME_ERRMESS ) aRet <<= OUString( aErrorMessage );
- else if ( aString == SC_UNONAME_TYPE )
+ if ( aPropertyName == SC_UNONAME_SHOWINP ) ScUnoHelpFunctions::SetBoolInAny( aRet, bShowInput );
+ else if ( aPropertyName == SC_UNONAME_SHOWERR ) ScUnoHelpFunctions::SetBoolInAny( aRet, bShowError );
+ else if ( aPropertyName == SC_UNONAME_IGNOREBL ) ScUnoHelpFunctions::SetBoolInAny( aRet, bIgnoreBlank );
+ else if ( aPropertyName == SC_UNONAME_SHOWLIST ) aRet <<= nShowList;
+ else if ( aPropertyName == SC_UNONAME_INPTITLE ) aRet <<= OUString( aInputTitle );
+ else if ( aPropertyName == SC_UNONAME_INPMESS ) aRet <<= OUString( aInputMessage );
+ else if ( aPropertyName == SC_UNONAME_ERRTITLE ) aRet <<= OUString( aErrorTitle );
+ else if ( aPropertyName == SC_UNONAME_ERRMESS ) aRet <<= OUString( aErrorMessage );
+ else if ( aPropertyName == SC_UNONAME_TYPE )
{
sheet::ValidationType eType = sheet::ValidationType_ANY;
switch (nValMode)
@@ -973,7 +971,7 @@ uno::Any SAL_CALL ScTableValidationObj::getPropertyValue( const OUString& aPrope
}
aRet <<= eType;
}
- else if ( aString == SC_UNONAME_ERRALSTY )
+ else if ( aPropertyName == SC_UNONAME_ERRALSTY )
{
sheet::ValidationAlertStyle eStyle = sheet::ValidationAlertStyle_STOP;
switch (nErrorStyle)
diff --git a/sc/source/ui/unoobj/funcuno.cxx b/sc/source/ui/unoobj/funcuno.cxx
index 90ecc9caec54..0ec86590bee2 100644
--- a/sc/source/ui/unoobj/funcuno.cxx
+++ b/sc/source/ui/unoobj/funcuno.cxx
@@ -519,7 +519,7 @@ uno::Any SAL_CALL ScFunctionAccess::callFunction( const OUString& aName,
const uno::Any& rArg = pArgArr[nPos];
uno::TypeClass eClass = rArg.getValueTypeClass();
- uno::Type aType = rArg.getValueType();
+ const uno::Type& aType = rArg.getValueType();
if ( eClass == uno::TypeClass_BYTE ||
eClass == uno::TypeClass_BOOLEAN ||
eClass == uno::TypeClass_SHORT ||
diff --git a/sc/source/ui/unoobj/linkuno.cxx b/sc/source/ui/unoobj/linkuno.cxx
index f2addd6df475..1f19686d0720 100644
--- a/sc/source/ui/unoobj/linkuno.cxx
+++ b/sc/source/ui/unoobj/linkuno.cxx
@@ -214,30 +214,29 @@ void SAL_CALL ScSheetLinkObj::setPropertyValue(
uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- OUString aNameString(aPropertyName);
OUString aValStr;
- if ( aNameString == SC_UNONAME_LINKURL )
+ if ( aPropertyName == SC_UNONAME_LINKURL )
{
if ( aValue >>= aValStr )
setFileName( aValStr );
}
- else if ( aNameString == SC_UNONAME_FILTER )
+ else if ( aPropertyName == SC_UNONAME_FILTER )
{
if ( aValue >>= aValStr )
setFilter( aValStr );
}
- else if ( aNameString == SC_UNONAME_FILTOPT )
+ else if ( aPropertyName == SC_UNONAME_FILTOPT )
{
if ( aValue >>= aValStr )
setFilterOptions( aValStr );
}
- else if ( aNameString == SC_UNONAME_REFPERIOD )
+ else if ( aPropertyName == SC_UNONAME_REFPERIOD )
{
sal_Int32 nRefresh = 0;
if ( aValue >>= nRefresh )
setRefreshDelay( nRefresh );
}
- else if ( aNameString == SC_UNONAME_REFDELAY )
+ else if ( aPropertyName == SC_UNONAME_REFDELAY )
{
sal_Int32 nRefresh = 0;
if ( aValue >>= nRefresh )
@@ -250,17 +249,16 @@ uno::Any SAL_CALL ScSheetLinkObj::getPropertyValue( const OUString& aPropertyNam
uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- OUString aNameString(aPropertyName);
uno::Any aRet;
- if ( aNameString == SC_UNONAME_LINKURL )
+ if ( aPropertyName == SC_UNONAME_LINKURL )
aRet <<= getFileName();
- else if ( aNameString == SC_UNONAME_FILTER )
+ else if ( aPropertyName == SC_UNONAME_FILTER )
aRet <<= getFilter();
- else if ( aNameString == SC_UNONAME_FILTOPT )
+ else if ( aPropertyName == SC_UNONAME_FILTOPT )
aRet <<= getFilterOptions();
- else if ( aNameString == SC_UNONAME_REFPERIOD )
+ else if ( aPropertyName == SC_UNONAME_REFPERIOD )
aRet <<= getRefreshDelay();
- else if ( aNameString == SC_UNONAME_REFDELAY )
+ else if ( aPropertyName == SC_UNONAME_REFDELAY )
aRet <<= getRefreshDelay();
return aRet;
}
@@ -321,14 +319,13 @@ OUString ScSheetLinkObj::getFilter() const
return aRet;
}
-void ScSheetLinkObj::setFilter(const OUString& Filter)
+void ScSheetLinkObj::setFilter(const OUString& rFilter)
{
SolarMutexGuard aGuard;
ScTableLink* pLink = GetLink_Impl();
if (pLink)
{
- OUString aFilterStr(Filter);
- pLink->Refresh( aFileName, aFilterStr, nullptr, pLink->GetRefreshDelay() );
+ pLink->Refresh( aFileName, rFilter, nullptr, pLink->GetRefreshDelay() );
}
}
@@ -430,8 +427,6 @@ ScSheetLinkObj* ScSheetLinksObj::GetObjectByName_Impl(const OUString& aName)
if (pDocShell)
{
- OUString aNameStr(aName);
-
ScDocument& rDoc = pDocShell->GetDocument();
SCTAB nTabCount = rDoc.GetTableCount();
for (SCTAB nTab=0; nTab<nTabCount; nTab++)
@@ -439,8 +434,8 @@ ScSheetLinkObj* ScSheetLinksObj::GetObjectByName_Impl(const OUString& aName)
{
//! case-insensitive ???
OUString aLinkDoc = rDoc.GetLinkDoc( nTab );
- if ( aLinkDoc == aNameStr )
- return new ScSheetLinkObj( pDocShell, aNameStr );
+ if ( aLinkDoc == aName )
+ return new ScSheetLinkObj( pDocShell, aName );
}
}
@@ -526,8 +521,6 @@ sal_Bool SAL_CALL ScSheetLinksObj::hasByName( const OUString& aName )
if (pDocShell)
{
- OUString aNameStr(aName);
-
ScDocument& rDoc = pDocShell->GetDocument();
SCTAB nTabCount = rDoc.GetTableCount();
for (SCTAB nTab=0; nTab<nTabCount; nTab++)
@@ -535,7 +528,7 @@ sal_Bool SAL_CALL ScSheetLinksObj::hasByName( const OUString& aName )
{
//! case-insensitiv ???
OUString aLinkDoc(rDoc.GetLinkDoc( nTab ));
- if ( aLinkDoc == aNameStr )
+ if ( aLinkDoc == aName )
return sal_True;
}
}
@@ -757,30 +750,29 @@ void SAL_CALL ScAreaLinkObj::setPropertyValue(
uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- OUString aNameString(aPropertyName);
OUString aValStr;
- if ( aNameString == SC_UNONAME_LINKURL )
+ if ( aPropertyName == SC_UNONAME_LINKURL )
{
if ( aValue >>= aValStr )
setFileName( aValStr );
}
- else if ( aNameString == SC_UNONAME_FILTER )
+ else if ( aPropertyName == SC_UNONAME_FILTER )
{
if ( aValue >>= aValStr )
setFilter( aValStr );
}
- else if ( aNameString == SC_UNONAME_FILTOPT )
+ else if ( aPropertyName == SC_UNONAME_FILTOPT )
{
if ( aValue >>= aValStr )
setFilterOptions( aValStr );
}
- else if ( aNameString == SC_UNONAME_REFPERIOD )
+ else if ( aPropertyName == SC_UNONAME_REFPERIOD )
{
sal_Int32 nRefresh = 0;
if ( aValue >>= nRefresh )
setRefreshDelay( nRefresh );
}
- else if ( aNameString == SC_UNONAME_REFDELAY )
+ else if ( aPropertyName == SC_UNONAME_REFDELAY )
{
sal_Int32 nRefresh = 0;
if ( aValue >>= nRefresh )
@@ -793,17 +785,16 @@ uno::Any SAL_CALL ScAreaLinkObj::getPropertyValue( const OUString& aPropertyName
uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- OUString aNameString(aPropertyName);
uno::Any aRet;
- if ( aNameString == SC_UNONAME_LINKURL )
+ if ( aPropertyName == SC_UNONAME_LINKURL )
aRet <<= getFileName();
- else if ( aNameString == SC_UNONAME_FILTER )
+ else if ( aPropertyName == SC_UNONAME_FILTER )
aRet <<= getFilter();
- else if ( aNameString == SC_UNONAME_FILTOPT )
+ else if ( aPropertyName == SC_UNONAME_FILTOPT )
aRet <<= getFilterOptions();
- else if ( aNameString == SC_UNONAME_REFPERIOD )
+ else if ( aPropertyName == SC_UNONAME_REFPERIOD )
aRet <<= getRefreshDelay();
- else if ( aNameString == SC_UNONAME_REFDELAY )
+ else if ( aPropertyName == SC_UNONAME_REFDELAY )
aRet <<= getRefreshDelay();
return aRet;
}
@@ -958,14 +949,11 @@ void SAL_CALL ScAreaLinksObj::insertAtPosition( const table::CellAddress& aDestP
if (pDocShell)
{
OUString aFileStr (aFileName);
- OUString aFilterStr (aFilter);
- OUString aOptionStr (aFilterOptions);
- OUString aSourceStr (aSourceArea);
ScAddress aDestAddr( (SCCOL)aDestPos.Column, (SCROW)aDestPos.Row, aDestPos.Sheet );
aFileStr = ScGlobal::GetAbsDocName( aFileStr, pDocShell ); //! in InsertAreaLink ???
- pDocShell->GetDocFunc().InsertAreaLink( aFileStr, aFilterStr, aOptionStr,
- aSourceStr, ScRange(aDestAddr),
+ pDocShell->GetDocFunc().InsertAreaLink( aFileStr, aFilter, aFilterOptions,
+ aSourceArea, ScRange(aDestAddr),
0, false, true ); // don't move contents
}
}
@@ -1279,7 +1267,6 @@ ScDDELinkObj* ScDDELinksObj::GetObjectByName_Impl(const OUString& aName)
{
if (pDocShell)
{
- OUString aNamStr(aName);
OUString aAppl, aTopic, aItem;
ScDocument& rDoc = pDocShell->GetDocument();
@@ -1287,7 +1274,7 @@ ScDDELinkObj* ScDDELinksObj::GetObjectByName_Impl(const OUString& aName)
for (size_t i=0; i<nCount; i++)
{
rDoc.GetDdeLinkData( i, aAppl, aTopic, aItem );
- if ( lcl_BuildDDEName(aAppl, aTopic, aItem) == aNamStr )
+ if ( lcl_BuildDDEName(aAppl, aTopic, aItem) == aName )
return new ScDDELinkObj( pDocShell, aAppl, aTopic, aItem );
}
}
@@ -1378,7 +1365,6 @@ sal_Bool SAL_CALL ScDDELinksObj::hasByName( const OUString& aName )
SolarMutexGuard aGuard;
if (pDocShell)
{
- OUString aNamStr(aName);
OUString aAppl, aTopic, aItem;
ScDocument& rDoc = pDocShell->GetDocument();
@@ -1386,7 +1372,7 @@ sal_Bool SAL_CALL ScDDELinksObj::hasByName( const OUString& aName )
for (size_t i=0; i<nCount; i++)
{
rDoc.GetDdeLinkData( i, aAppl, aTopic, aItem );
- if ( lcl_BuildDDEName(aAppl, aTopic, aItem) == aNamStr )
+ if ( lcl_BuildDDEName(aAppl, aTopic, aItem) == aName )
return sal_True;
}
}
diff --git a/sc/source/ui/unoobj/shapeuno.cxx b/sc/source/ui/unoobj/shapeuno.cxx
index 7b68557c944c..14d399db2015 100644
--- a/sc/source/ui/unoobj/shapeuno.cxx
+++ b/sc/source/ui/unoobj/shapeuno.cxx
@@ -326,9 +326,8 @@ void SAL_CALL ScShapeObj::setPropertyValue(const OUString& aPropertyName, const
uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- OUString aNameString(aPropertyName);
- if ( aNameString == SC_UNONAME_ANCHOR )
+ if ( aPropertyName == SC_UNONAME_ANCHOR )
{
uno::Reference<sheet::XCellRangeAddressable> xRangeAdd(aValue, uno::UNO_QUERY);
if (xRangeAdd.is())
@@ -436,7 +435,7 @@ void SAL_CALL ScShapeObj::setPropertyValue(const OUString& aPropertyName, const
else
throw lang::IllegalArgumentException("only XCell or XSpreadsheet objects allowed", static_cast<cppu::OWeakObject*>(this), 0);
}
- else if ( aNameString == SC_UNONAME_IMAGEMAP )
+ else if ( aPropertyName == SC_UNONAME_IMAGEMAP )
{
SdrObject* pObj = GetSdrObject();
if ( pObj )
@@ -460,7 +459,7 @@ void SAL_CALL ScShapeObj::setPropertyValue(const OUString& aPropertyName, const
}
}
}
- else if ( aNameString == SC_UNONAME_HORIPOS )
+ else if ( aPropertyName == SC_UNONAME_HORIPOS )
{
sal_Int32 nPos = 0;
if (aValue >>= nPos)
@@ -558,7 +557,7 @@ void SAL_CALL ScShapeObj::setPropertyValue(const OUString& aPropertyName, const
}
}
}
- else if ( aNameString == SC_UNONAME_VERTPOS )
+ else if ( aPropertyName == SC_UNONAME_VERTPOS )
{
sal_Int32 nPos = 0;
if (aValue >>= nPos)
@@ -627,15 +626,15 @@ void SAL_CALL ScShapeObj::setPropertyValue(const OUString& aPropertyName, const
}
}
}
- else if ( aNameString == SC_UNONAME_HYPERLINK ||
- aNameString == SC_UNONAME_URL )
+ else if ( aPropertyName == SC_UNONAME_HYPERLINK ||
+ aPropertyName == SC_UNONAME_URL )
{
OUString sHlink;
ScMacroInfo* pInfo = ScShapeObj_getShapeHyperMacroInfo(this, true);
if ( ( aValue >>= sHlink ) && pInfo )
pInfo->SetHlink( sHlink );
}
- else if ( aNameString == SC_UNONAME_MOVEPROTECT )
+ else if ( aPropertyName == SC_UNONAME_MOVEPROTECT )
{
if( SdrObject* pObj = this->GetSdrObject() )
{
@@ -657,10 +656,9 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const OUString& aPropertyName )
uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- OUString aNameString = aPropertyName;
uno::Any aAny;
- if ( aNameString == SC_UNONAME_ANCHOR )
+ if ( aPropertyName == SC_UNONAME_ANCHOR )
{
SdrObject *pObj = GetSdrObject();
if (pObj)
@@ -691,7 +689,7 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const OUString& aPropertyName )
}
}
}
- else if ( aNameString == SC_UNONAME_IMAGEMAP )
+ else if ( aPropertyName == SC_UNONAME_IMAGEMAP )
{
uno::Reference< uno::XInterface > xImageMap;
SdrObject* pObj = GetSdrObject();
@@ -708,7 +706,7 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const OUString& aPropertyName )
}
aAny <<= uno::Reference< container::XIndexContainer >::query( xImageMap );
}
- else if ( aNameString == SC_UNONAME_HORIPOS )
+ else if ( aPropertyName == SC_UNONAME_HORIPOS )
{
SdrObject *pObj = GetSdrObject();
if (pObj)
@@ -767,7 +765,7 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const OUString& aPropertyName )
}
}
}
- else if ( aNameString == SC_UNONAME_VERTPOS )
+ else if ( aPropertyName == SC_UNONAME_VERTPOS )
{
SdrObject *pObj = GetSdrObject();
if (pObj)
@@ -812,15 +810,15 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const OUString& aPropertyName )
}
}
}
- else if ( aNameString == SC_UNONAME_HYPERLINK ||
- aNameString == SC_UNONAME_URL )
+ else if ( aPropertyName == SC_UNONAME_HYPERLINK ||
+ aPropertyName == SC_UNONAME_URL )
{
OUString sHlink;
if ( ScMacroInfo* pInfo = ScShapeObj_getShapeHyperMacroInfo(this) )
sHlink = pInfo->GetHlink();
aAny <<= sHlink;
}
- else if ( aNameString == SC_UNONAME_MOVEPROTECT )
+ else if ( aPropertyName == SC_UNONAME_MOVEPROTECT )
{
bool aProt = false;
if ( SdrObject* pObj = this->GetSdrObject() )
@@ -904,22 +902,21 @@ beans::PropertyState SAL_CALL ScShapeObj::getPropertyState( const OUString& aPro
throw(beans::UnknownPropertyException, uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- OUString aNameString(aPropertyName);
beans::PropertyState eRet = beans::PropertyState_DIRECT_VALUE;
- if ( aNameString == SC_UNONAME_IMAGEMAP )
+ if ( aPropertyName == SC_UNONAME_IMAGEMAP )
{
// ImageMap is always "direct"
}
- else if ( aNameString == SC_UNONAME_ANCHOR )
+ else if ( aPropertyName == SC_UNONAME_ANCHOR )
{
// Anchor is always "direct"
}
- else if ( aNameString == SC_UNONAME_HORIPOS )
+ else if ( aPropertyName == SC_UNONAME_HORIPOS )
{
// HoriPos is always "direct"
}
- else if ( aNameString == SC_UNONAME_VERTPOS )
+ else if ( aPropertyName == SC_UNONAME_VERTPOS )
{
// VertPos is always "direct"
}
@@ -954,9 +951,8 @@ void SAL_CALL ScShapeObj::setPropertyToDefault( const OUString& aPropertyName )
std::exception)
{
SolarMutexGuard aGuard;
- OUString aNameString(aPropertyName);
- if ( aNameString == SC_UNONAME_IMAGEMAP )
+ if ( aPropertyName == SC_UNONAME_IMAGEMAP )
{
SdrObject* pObj = GetSdrObject();
if ( pObj )
@@ -986,10 +982,9 @@ uno::Any SAL_CALL ScShapeObj::getPropertyDefault( const OUString& aPropertyName
uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- OUString aNameString = aPropertyName;
uno::Any aAny;
- if ( aNameString == SC_UNONAME_IMAGEMAP )
+ if ( aPropertyName == SC_UNONAME_IMAGEMAP )
{
// default: empty ImageMap
uno::Reference< uno::XInterface > xImageMap(SvUnoImageMap_createInstance( GetSupportedMacroItems() ));
diff --git a/sc/source/ui/unoobj/srchuno.cxx b/sc/source/ui/unoobj/srchuno.cxx
index 1ad31eb41f5e..eb17c17af103 100644
--- a/sc/source/ui/unoobj/srchuno.cxx
+++ b/sc/source/ui/unoobj/srchuno.cxx
@@ -142,23 +142,22 @@ void SAL_CALL ScCellSearchObj::setPropertyValue(
uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- OUString aString(aPropertyName);
-
- if (aString == SC_UNO_SRCHBACK) pSearchItem->SetBackward( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if (aString == SC_UNO_SRCHBYROW) pSearchItem->SetRowDirection( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if (aString == SC_UNO_SRCHCASE) pSearchItem->SetExact( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if (aString == SC_UNO_SRCHREGEXP) pSearchItem->SetRegExp( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if (aString == SC_UNO_SRCHWILDCARD) pSearchItem->SetWildcard( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if (aString == SC_UNO_SRCHSIM) pSearchItem->SetLevenshtein( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if (aString == SC_UNO_SRCHSIMREL) pSearchItem->SetLEVRelaxed( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if (aString == SC_UNO_SRCHSTYLES) pSearchItem->SetPattern( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if (aString == SC_UNO_SRCHWORDS) pSearchItem->SetWordOnly( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if (aString == SC_UNO_SRCHSIMADD) pSearchItem->SetLEVLonger( ScUnoHelpFunctions::GetInt16FromAny( aValue ) );
- else if (aString == SC_UNO_SRCHSIMEX) pSearchItem->SetLEVOther( ScUnoHelpFunctions::GetInt16FromAny( aValue ) );
- else if (aString == SC_UNO_SRCHSIMREM) pSearchItem->SetLEVShorter( ScUnoHelpFunctions::GetInt16FromAny( aValue ) );
- else if (aString == SC_UNO_SRCHTYPE) pSearchItem->SetCellType( static_cast<SvxSearchCellType>(ScUnoHelpFunctions::GetInt16FromAny( aValue )) );
- else if (aString == SC_UNO_SRCHFILTERED) pSearchItem->SetSearchFiltered( ScUnoHelpFunctions::GetBoolFromAny(aValue) );
- else if (aString == SC_UNO_SRCHFORMATTED) pSearchItem->SetSearchFormatted( ScUnoHelpFunctions::GetBoolFromAny(aValue) );
+
+ if (aPropertyName == SC_UNO_SRCHBACK) pSearchItem->SetBackward( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
+ else if (aPropertyName == SC_UNO_SRCHBYROW) pSearchItem->SetRowDirection( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
+ else if (aPropertyName == SC_UNO_SRCHCASE) pSearchItem->SetExact( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
+ else if (aPropertyName == SC_UNO_SRCHREGEXP) pSearchItem->SetRegExp( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
+ else if (aPropertyName == SC_UNO_SRCHWILDCARD) pSearchItem->SetWildcard( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
+ else if (aPropertyName == SC_UNO_SRCHSIM) pSearchItem->SetLevenshtein( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
+ else if (aPropertyName == SC_UNO_SRCHSIMREL) pSearchItem->SetLEVRelaxed( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
+ else if (aPropertyName == SC_UNO_SRCHSTYLES) pSearchItem->SetPattern( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
+ else if (aPropertyName == SC_UNO_SRCHWORDS) pSearchItem->SetWordOnly( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
+ else if (aPropertyName == SC_UNO_SRCHSIMADD) pSearchItem->SetLEVLonger( ScUnoHelpFunctions::GetInt16FromAny( aValue ) );
+ else if (aPropertyName == SC_UNO_SRCHSIMEX) pSearchItem->SetLEVOther( ScUnoHelpFunctions::GetInt16FromAny( aValue ) );
+ else if (aPropertyName == SC_UNO_SRCHSIMREM) pSearchItem->SetLEVShorter( ScUnoHelpFunctions::GetInt16FromAny( aValue ) );
+ else if (aPropertyName == SC_UNO_SRCHTYPE) pSearchItem->SetCellType( static_cast<SvxSearchCellType>(ScUnoHelpFunctions::GetInt16FromAny( aValue )) );
+ else if (aPropertyName == SC_UNO_SRCHFILTERED) pSearchItem->SetSearchFiltered( ScUnoHelpFunctions::GetBoolFromAny(aValue) );
+ else if (aPropertyName == SC_UNO_SRCHFORMATTED) pSearchItem->SetSearchFormatted( ScUnoHelpFunctions::GetBoolFromAny(aValue) );
}
uno::Any SAL_CALL ScCellSearchObj::getPropertyValue( const OUString& aPropertyName )
@@ -166,24 +165,23 @@ uno::Any SAL_CALL ScCellSearchObj::getPropertyValue( const OUString& aPropertyNa
uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- OUString aString(aPropertyName);
uno::Any aRet;
- if (aString == SC_UNO_SRCHBACK) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetBackward() );
- else if (aString == SC_UNO_SRCHBYROW) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetRowDirection() );
- else if (aString == SC_UNO_SRCHCASE) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetExact() );
- else if (aString == SC_UNO_SRCHREGEXP) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetRegExp() );
- else if (aString == SC_UNO_SRCHWILDCARD) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetWildcard() );
- else if (aString == SC_UNO_SRCHSIM) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->IsLevenshtein() );
- else if (aString == SC_UNO_SRCHSIMREL) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->IsLEVRelaxed() );
- else if (aString == SC_UNO_SRCHSTYLES) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetPattern() );
- else if (aString == SC_UNO_SRCHWORDS) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetWordOnly() );
- else if (aString == SC_UNO_SRCHSIMADD) aRet <<= (sal_Int16) pSearchItem->GetLEVLonger();
- else if (aString == SC_UNO_SRCHSIMEX) aRet <<= (sal_Int16) pSearchItem->GetLEVOther();
- else if (aString == SC_UNO_SRCHSIMREM) aRet <<= (sal_Int16) pSearchItem->GetLEVShorter();
- else if (aString == SC_UNO_SRCHTYPE) aRet <<= (sal_Int16) pSearchItem->GetCellType();
- else if (aString == SC_UNO_SRCHFILTERED) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->IsSearchFiltered() );
- else if (aString == SC_UNO_SRCHFORMATTED) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->IsSearchFormatted() );
+ if (aPropertyName == SC_UNO_SRCHBACK) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetBackward() );
+ else if (aPropertyName == SC_UNO_SRCHBYROW) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetRowDirection() );
+ else if (aPropertyName == SC_UNO_SRCHCASE) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetExact() );
+ else if (aPropertyName == SC_UNO_SRCHREGEXP) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetRegExp() );
+ else if (aPropertyName == SC_UNO_SRCHWILDCARD) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetWildcard() );
+ else if (aPropertyName == SC_UNO_SRCHSIM) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->IsLevenshtein() );
+ else if (aPropertyName == SC_UNO_SRCHSIMREL) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->IsLEVRelaxed() );
+ else if (aPropertyName == SC_UNO_SRCHSTYLES) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetPattern() );
+ else if (aPropertyName == SC_UNO_SRCHWORDS) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetWordOnly() );
+ else if (aPropertyName == SC_UNO_SRCHSIMADD) aRet <<= (sal_Int16) pSearchItem->GetLEVLonger();
+ else if (aPropertyName == SC_UNO_SRCHSIMEX) aRet <<= (sal_Int16) pSearchItem->GetLEVOther();
+ else if (aPropertyName == SC_UNO_SRCHSIMREM) aRet <<= (sal_Int16) pSearchItem->GetLEVShorter();
+ else if (aPropertyName == SC_UNO_SRCHTYPE) aRet <<= (sal_Int16) pSearchItem->GetCellType();
+ else if (aPropertyName == SC_UNO_SRCHFILTERED) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->IsSearchFiltered() );
+ else if (aPropertyName == SC_UNO_SRCHFORMATTED) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->IsSearchFormatted() );
return aRet;
}
diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx
index 6dd6b5701a47..cbe5f23dd7f1 100644
--- a/sc/source/ui/unoobj/styleuno.cxx
+++ b/sc/source/ui/unoobj/styleuno.cxx
@@ -447,10 +447,9 @@ ScStyleFamilyObj* ScStyleFamiliesObj::GetObjectByName_Impl(const OUString& aName
{
if ( pDocShell )
{
- OUString aNameStr( aName );
- if ( aNameStr == SC_FAMILYNAME_CELL )
+ if ( aName == SC_FAMILYNAME_CELL )
return new ScStyleFamilyObj( pDocShell, SFX_STYLE_FAMILY_PARA );
- else if ( aNameStr == SC_FAMILYNAME_PAGE )
+ else if ( aName == SC_FAMILYNAME_PAGE )
return new ScStyleFamilyObj( pDocShell, SFX_STYLE_FAMILY_PAGE );
}
// no assertion - called directly from getByName
@@ -518,9 +517,7 @@ uno::Sequence<OUString> SAL_CALL ScStyleFamiliesObj::getElementNames()
sal_Bool SAL_CALL ScStyleFamiliesObj::hasByName( const OUString& aName )
throw(uno::RuntimeException, std::exception)
{
- SolarMutexGuard aGuard;
- OUString aNameStr( aName );
- return aNameStr == SC_FAMILYNAME_CELL || aNameStr == SC_FAMILYNAME_PAGE;
+ return aName == SC_FAMILYNAME_CELL || aName == SC_FAMILYNAME_PAGE;
}
// style::XStyleLoader
@@ -663,12 +660,10 @@ ScStyleObj* ScStyleFamilyObj::GetObjectByName_Impl(const OUString& aName)
{
if ( pDocShell )
{
- OUString aString(aName);
-
ScDocument& rDoc = pDocShell->GetDocument();
ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
- if ( pStylePool->Find( aString, eFamily ) )
- return new ScStyleObj( pDocShell, eFamily, aString );
+ if ( pStylePool->Find( aName, eFamily ) )
+ return new ScStyleObj( pDocShell, eFamily, aName );
}
return nullptr;
}
@@ -1144,15 +1139,14 @@ void SAL_CALL ScStyleObj::setName( const OUString& aNewName )
//! DocFunc-Funktion??
//! Undo ?????????????
- OUString aString(aNewName);
- bool bOk = pStyle->SetName( aString );
+ bool bOk = pStyle->SetName( aNewName );
if (bOk)
{
- aStyleName = aString; //! notify other objects for this style?
+ aStyleName = aNewName; //! notify other objects for this style?
ScDocument& rDoc = pDocShell->GetDocument();
if ( eFamily == SFX_STYLE_FAMILY_PARA && !rDoc.IsImportingXML() )
- rDoc.GetPool()->CellStyleCreated( aString, &rDoc );
+ rDoc.GetPool()->CellStyleCreated( aNewName, &rDoc );
// Zellvorlagen = 2, Seitenvorlagen = 4
sal_uInt16 nId = ( eFamily == SFX_STYLE_FAMILY_PARA ) ?
diff --git a/sc/source/ui/unoobj/targuno.cxx b/sc/source/ui/unoobj/targuno.cxx
index 17da342e3ab8..ead87f8fecd5 100644
--- a/sc/source/ui/unoobj/targuno.cxx
+++ b/sc/source/ui/unoobj/targuno.cxx
@@ -95,9 +95,8 @@ uno::Any SAL_CALL ScLinkTargetTypesObj::getByName(const OUString& aName)
{
if (pDocShell)
{
- OUString aNameStr(aName);
for (sal_uInt16 i=0; i<SC_LINKTARGETTYPE_COUNT; i++)
- if ( aNames[i] == aNameStr )
+ if ( aNames[i] == aName )
return uno::makeAny(uno::Reference< beans::XPropertySet >(new ScLinkTargetTypeObj( pDocShell, i )));
}
@@ -115,9 +114,8 @@ uno::Sequence<OUString> SAL_CALL ScLinkTargetTypesObj::getElementNames() throw(
sal_Bool SAL_CALL ScLinkTargetTypesObj::hasByName(const OUString& aName) throw( uno::RuntimeException, std::exception )
{
- OUString aNameStr = aName;
for (sal_uInt16 i=0; i<SC_LINKTARGETTYPE_COUNT; i++)
- if ( aNames[i] == aNameStr )
+ if ( aNames[i] == aName )
return sal_True;
return false;
}
@@ -236,10 +234,9 @@ uno::Any SAL_CALL ScLinkTargetTypeObj::getPropertyValue(const OUString& Property
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception )
{
uno::Any aRet;
- OUString aNameStr(PropertyName);
- if ( aNameStr == SC_UNO_LINKDISPBIT )
+ if ( PropertyName == SC_UNO_LINKDISPBIT )
SetLinkTargetBitmap( aRet, nType );
- else if ( aNameStr == SC_UNO_LINKDISPNAME )
+ else if ( PropertyName == SC_UNO_LINKDISPNAME )
aRet <<= OUString( aName );
return aRet;
diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx
index 53b23feed53f..bcf96185422c 100644
--- a/sc/source/ui/unoobj/textuno.cxx
+++ b/sc/source/ui/unoobj/textuno.cxx
@@ -363,11 +363,10 @@ OUString SAL_CALL ScHeaderFooterTextObj::getString() throw(uno::RuntimeException
void SAL_CALL ScHeaderFooterTextObj::setString( const OUString& aText ) throw(uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- OUString aString(aText);
// for pure text, no font info is needed in pool defaults
ScHeaderEditEngine aEditEngine(EditEngine::CreatePool());
- aEditEngine.SetText( aString );
+ aEditEngine.SetText( aText );
aTextData.UpdateData(aEditEngine);
}
diff --git a/sc/source/ui/unoobj/tokenuno.cxx b/sc/source/ui/unoobj/tokenuno.cxx
index a684a61991a8..b1800ced542e 100644
--- a/sc/source/ui/unoobj/tokenuno.cxx
+++ b/sc/source/ui/unoobj/tokenuno.cxx
@@ -191,12 +191,11 @@ void SAL_CALL ScFormulaParserObj::setPropertyValue(
uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- OUString aString(aPropertyName);
- if ( aString == SC_UNO_COMPILEFAP )
+ if ( aPropertyName == SC_UNO_COMPILEFAP )
{
aValue >>= mbCompileFAP;
}
- else if ( aString == SC_UNO_COMPILEENGLISH )
+ else if ( aPropertyName == SC_UNO_COMPILEENGLISH )
{
bool bOldEnglish = mbEnglish;
if (aValue >>= mbEnglish)
@@ -215,15 +214,15 @@ void SAL_CALL ScFormulaParserObj::setPropertyValue(
else
throw lang::IllegalArgumentException();
}
- else if ( aString == SC_UNO_FORMULACONVENTION )
+ else if ( aPropertyName == SC_UNO_FORMULACONVENTION )
{
aValue >>= mnConv;
}
- else if ( aString == SC_UNO_IGNORELEADING )
+ else if ( aPropertyName == SC_UNO_IGNORELEADING )
{
aValue >>= mbIgnoreSpaces;
}
- else if ( aString == SC_UNO_OPCODEMAP )
+ else if ( aPropertyName == SC_UNO_OPCODEMAP )
{
if (aValue >>= maOpCodeMapping)
{
@@ -235,7 +234,7 @@ void SAL_CALL ScFormulaParserObj::setPropertyValue(
else
throw lang::IllegalArgumentException();
}
- else if ( aString == SC_UNO_EXTERNALLINKS )
+ else if ( aPropertyName == SC_UNO_EXTERNALLINKS )
{
if (!(aValue >>= maExternalLinks))
throw lang::IllegalArgumentException();
@@ -250,28 +249,27 @@ uno::Any SAL_CALL ScFormulaParserObj::getPropertyValue( const OUString& aPropert
{
SolarMutexGuard aGuard;
uno::Any aRet;
- OUString aString(aPropertyName);
- if ( aString == SC_UNO_COMPILEFAP )
+ if ( aPropertyName == SC_UNO_COMPILEFAP )
{
aRet <<= mbCompileFAP;
}
- else if ( aString == SC_UNO_COMPILEENGLISH )
+ else if ( aPropertyName == SC_UNO_COMPILEENGLISH )
{
aRet <<= mbEnglish;
}
- else if ( aString == SC_UNO_FORMULACONVENTION )
+ else if ( aPropertyName == SC_UNO_FORMULACONVENTION )
{
aRet <<= mnConv;
}
- else if ( aString == SC_UNO_IGNORELEADING )
+ else if ( aPropertyName == SC_UNO_IGNORELEADING )
{
aRet <<= mbIgnoreSpaces;
}
- else if ( aString == SC_UNO_OPCODEMAP )
+ else if ( aPropertyName == SC_UNO_OPCODEMAP )
{
aRet <<= maOpCodeMapping;
}
- else if ( aString == SC_UNO_EXTERNALLINKS )
+ else if ( aPropertyName == SC_UNO_EXTERNALLINKS )
{
aRet <<= maExternalLinks;
}
diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx
index 1a17d1a67a7b..3d0aaa4d2950 100644
--- a/sc/source/ui/unoobj/viewuno.cxx
+++ b/sc/source/ui/unoobj/viewuno.cxx
@@ -1786,9 +1786,8 @@ void SAL_CALL ScTabViewObj::setPropertyValue(
uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- OUString aString(aPropertyName);
- if ( aString == SC_UNO_FILTERED_RANGE_SELECTION )
+ if ( aPropertyName == SC_UNO_FILTERED_RANGE_SELECTION )
{
bFilteredRangeSelection = ScUnoHelpFunctions::GetBoolFromAny(aValue);
return;
@@ -1801,33 +1800,33 @@ void SAL_CALL ScTabViewObj::setPropertyValue(
const ScViewOptions& rOldOpt = pViewSh->GetViewData().GetOptions();
ScViewOptions aNewOpt(rOldOpt);
- if ( aString == SC_UNO_COLROWHDR || aString == OLD_UNO_COLROWHDR )
+ if ( aPropertyName == SC_UNO_COLROWHDR || aPropertyName == OLD_UNO_COLROWHDR )
aNewOpt.SetOption( VOPT_HEADER, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if ( aString == SC_UNO_HORSCROLL || aString == OLD_UNO_HORSCROLL )
+ else if ( aPropertyName == SC_UNO_HORSCROLL || aPropertyName == OLD_UNO_HORSCROLL )
aNewOpt.SetOption( VOPT_HSCROLL, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if ( aString == SC_UNO_OUTLSYMB || aString == OLD_UNO_OUTLSYMB )
+ else if ( aPropertyName == SC_UNO_OUTLSYMB || aPropertyName == OLD_UNO_OUTLSYMB )
aNewOpt.SetOption( VOPT_OUTLINER, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if ( aString == SC_UNO_SHEETTABS || aString == OLD_UNO_SHEETTABS )
+ else if ( aPropertyName == SC_UNO_SHEETTABS || aPropertyName == OLD_UNO_SHEETTABS )
aNewOpt.SetOption( VOPT_TABCONTROLS, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if ( aString == SC_UNO_SHOWANCHOR )
+ else if ( aPropertyName == SC_UNO_SHOWANCHOR )
aNewOpt.SetOption( VOPT_ANCHOR, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if ( aString == SC_UNO_SHOWFORM )
+ else if ( aPropertyName == SC_UNO_SHOWFORM )
aNewOpt.SetOption( VOPT_FORMULAS, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if ( aString == SC_UNO_SHOWGRID )
+ else if ( aPropertyName == SC_UNO_SHOWGRID )
aNewOpt.SetOption( VOPT_GRID, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if ( aString == SC_UNO_SHOWHELP )
+ else if ( aPropertyName == SC_UNO_SHOWHELP )
aNewOpt.SetOption( VOPT_HELPLINES, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if ( aString == SC_UNO_SHOWNOTES )
+ else if ( aPropertyName == SC_UNO_SHOWNOTES )
aNewOpt.SetOption( VOPT_NOTES, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if ( aString == SC_UNO_SHOWPAGEBR )
+ else if ( aPropertyName == SC_UNO_SHOWPAGEBR )
aNewOpt.SetOption( VOPT_PAGEBREAKS, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if ( aString == SC_UNO_SHOWZERO )
+ else if ( aPropertyName == SC_UNO_SHOWZERO )
aNewOpt.SetOption( VOPT_NULLVALS, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if ( aString == SC_UNO_VALUEHIGH || aString == OLD_UNO_VALUEHIGH )
+ else if ( aPropertyName == SC_UNO_VALUEHIGH || aPropertyName == OLD_UNO_VALUEHIGH )
aNewOpt.SetOption( VOPT_SYNTAX, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if ( aString == SC_UNO_VERTSCROLL || aString == OLD_UNO_VERTSCROLL )
+ else if ( aPropertyName == SC_UNO_VERTSCROLL || aPropertyName == OLD_UNO_VERTSCROLL )
aNewOpt.SetOption( VOPT_VSCROLL, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if ( aString == SC_UNO_SHOWOBJ )
+ else if ( aPropertyName == SC_UNO_SHOWOBJ )
{
sal_Int16 nIntVal = 0;
if ( aValue >>= nIntVal )
@@ -1838,7 +1837,7 @@ void SAL_CALL ScTabViewObj::setPropertyValue(
aNewOpt.SetObjMode( VOBJ_TYPE_OLE, (ScVObjMode)nIntVal);
}
}
- else if ( aString == SC_UNO_SHOWCHARTS )
+ else if ( aPropertyName == SC_UNO_SHOWCHARTS )
{
sal_Int16 nIntVal = 0;
if ( aValue >>= nIntVal )
@@ -1849,7 +1848,7 @@ void SAL_CALL ScTabViewObj::setPropertyValue(
aNewOpt.SetObjMode( VOBJ_TYPE_CHART, (ScVObjMode)nIntVal);
}
}
- else if ( aString == SC_UNO_SHOWDRAW )
+ else if ( aPropertyName == SC_UNO_SHOWDRAW )
{
sal_Int16 nIntVal = 0;
if ( aValue >>= nIntVal )
@@ -1860,19 +1859,19 @@ void SAL_CALL ScTabViewObj::setPropertyValue(
aNewOpt.SetObjMode( VOBJ_TYPE_DRAW, (ScVObjMode)nIntVal);
}
}
- else if ( aString == SC_UNO_GRIDCOLOR )
+ else if ( aPropertyName == SC_UNO_GRIDCOLOR )
{
sal_Int32 nIntVal = 0;
if ( aValue >>= nIntVal )
aNewOpt.SetGridColor( nIntVal, OUString() );
}
- else if ( aString == SC_UNO_ZOOMTYPE )
+ else if ( aPropertyName == SC_UNO_ZOOMTYPE )
{
sal_Int16 nIntVal = 0;
if ( aValue >>= nIntVal )
SetZoomType(nIntVal);
}
- else if ( aString == SC_UNO_ZOOMVALUE )
+ else if ( aPropertyName == SC_UNO_ZOOMVALUE )
{
sal_Int16 nIntVal = 0;
if ( aValue >>= nIntVal )
@@ -1909,10 +1908,9 @@ uno::Any SAL_CALL ScTabViewObj::getPropertyValue( const OUString& aPropertyName
uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- OUString aString(aPropertyName);
uno::Any aRet;
- if ( aString == SC_UNO_FILTERED_RANGE_SELECTION )
+ if ( aPropertyName == SC_UNO_FILTERED_RANGE_SELECTION )
{
ScUnoHelpFunctions::SetBoolInAny(aRet, bFilteredRangeSelection);
return aRet;
@@ -1923,33 +1921,33 @@ uno::Any SAL_CALL ScTabViewObj::getPropertyValue( const OUString& aPropertyName
{
const ScViewOptions& rOpt = pViewSh->GetViewData().GetOptions();
- if ( aString == SC_UNO_COLROWHDR || aString == OLD_UNO_COLROWHDR )
+ if ( aPropertyName == SC_UNO_COLROWHDR || aPropertyName == OLD_UNO_COLROWHDR )
ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_HEADER ) );
- else if ( aString == SC_UNO_HORSCROLL || aString == OLD_UNO_HORSCROLL )
+ else if ( aPropertyName == SC_UNO_HORSCROLL || aPropertyName == OLD_UNO_HORSCROLL )
ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_HSCROLL ) );
- else if ( aString == SC_UNO_OUTLSYMB || aString == OLD_UNO_OUTLSYMB )
+ else if ( aPropertyName == SC_UNO_OUTLSYMB || aPropertyName == OLD_UNO_OUTLSYMB )
ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_OUTLINER ) );
- else if ( aString == SC_UNO_SHEETTABS || aString == OLD_UNO_SHEETTABS )
+ else if ( aPropertyName == SC_UNO_SHEETTABS || aPropertyName == OLD_UNO_SHEETTABS )
ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_TABCONTROLS ) );
- else if ( aString == SC_UNO_SHOWANCHOR ) ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_ANCHOR ) );
- else if ( aString == SC_UNO_SHOWFORM ) ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_FORMULAS ) );
- else if ( aString == SC_UNO_SHOWGRID ) ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_GRID ) );
- else if ( aString == SC_UNO_SHOWHELP ) ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_HELPLINES ) );
- else if ( aString == SC_UNO_SHOWNOTES ) ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_NOTES ) );
- else if ( aString == SC_UNO_SHOWPAGEBR ) ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_PAGEBREAKS ) );
- else if ( aString == SC_UNO_SHOWZERO ) ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_NULLVALS ) );
- else if ( aString == SC_UNO_VALUEHIGH || aString == OLD_UNO_VALUEHIGH )
+ else if ( aPropertyName == SC_UNO_SHOWANCHOR ) ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_ANCHOR ) );
+ else if ( aPropertyName == SC_UNO_SHOWFORM ) ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_FORMULAS ) );
+ else if ( aPropertyName == SC_UNO_SHOWGRID ) ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_GRID ) );
+ else if ( aPropertyName == SC_UNO_SHOWHELP ) ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_HELPLINES ) );
+ else if ( aPropertyName == SC_UNO_SHOWNOTES ) ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_NOTES ) );
+ else if ( aPropertyName == SC_UNO_SHOWPAGEBR ) ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_PAGEBREAKS ) );
+ else if ( aPropertyName == SC_UNO_SHOWZERO ) ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_NULLVALS ) );
+ else if ( aPropertyName == SC_UNO_VALUEHIGH || aPropertyName == OLD_UNO_VALUEHIGH )
ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_SYNTAX ) );
- else if ( aString == SC_UNO_VERTSCROLL || aString == OLD_UNO_VERTSCROLL )
+ else if ( aPropertyName == SC_UNO_VERTSCROLL || aPropertyName == OLD_UNO_VERTSCROLL )
ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_VSCROLL ) );
- else if ( aString == SC_UNO_SHOWOBJ ) aRet <<= (sal_Int16)( rOpt.GetObjMode( VOBJ_TYPE_OLE ) );
- else if ( aString == SC_UNO_SHOWCHARTS ) aRet <<= (sal_Int16)( rOpt.GetObjMode( VOBJ_TYPE_CHART ) );
- else if ( aString == SC_UNO_SHOWDRAW ) aRet <<= (sal_Int16)( rOpt.GetObjMode( VOBJ_TYPE_DRAW ) );
- else if ( aString == SC_UNO_GRIDCOLOR ) aRet <<= (sal_Int32)( rOpt.GetGridColor().GetColor() );
- else if ( aString == SC_UNO_VISAREA ) aRet <<= GetVisArea();
- else if ( aString == SC_UNO_ZOOMTYPE ) aRet <<= GetZoomType();
- else if ( aString == SC_UNO_ZOOMVALUE ) aRet <<= GetZoom();
- else if ( aString == SC_UNO_VISAREASCREEN )
+ else if ( aPropertyName == SC_UNO_SHOWOBJ ) aRet <<= (sal_Int16)( rOpt.GetObjMode( VOBJ_TYPE_OLE ) );
+ else if ( aPropertyName == SC_UNO_SHOWCHARTS ) aRet <<= (sal_Int16)( rOpt.GetObjMode( VOBJ_TYPE_CHART ) );
+ else if ( aPropertyName == SC_UNO_SHOWDRAW ) aRet <<= (sal_Int16)( rOpt.GetObjMode( VOBJ_TYPE_DRAW ) );
+ else if ( aPropertyName == SC_UNO_GRIDCOLOR ) aRet <<= (sal_Int32)( rOpt.GetGridColor().GetColor() );
+ else if ( aPropertyName == SC_UNO_VISAREA ) aRet <<= GetVisArea();
+ else if ( aPropertyName == SC_UNO_ZOOMTYPE ) aRet <<= GetZoomType();
+ else if ( aPropertyName == SC_UNO_ZOOMVALUE ) aRet <<= GetZoom();
+ else if ( aPropertyName == SC_UNO_VISAREASCREEN )
{
ScViewData& rViewData = pViewSh->GetViewData();
vcl::Window* pActiveWin = rViewData.GetActiveWin();
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index db7e146c5e5f..9ad878153c41 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -2158,21 +2158,18 @@ ScVbaRange::CellsHelper( const uno::Reference< ov::XHelperInterface >& xParent,
// set in the Any, we should convert as appropriate
// #FIXME - perhaps worth turning this into some sort of
// conversion routine e.g. bSuccess = getValueFromAny( nRow, nRowIndex, cppu::UnoType<sal_Int32>::get() )
- uno::Any aRowIndexAny = nRowIndex;
- if ( aRowIndexAny.hasValue() && !( aRowIndexAny >>= nRow ) )
+ if ( nRowIndex.hasValue() && !( nRowIndex >>= nRow ) )
{
uno::Reference< script::XTypeConverter > xConverter = getTypeConverter( xContext );
uno::Any aConverted;
try
{
- aConverted = xConverter->convertTo( aRowIndexAny, cppu::UnoType<sal_Int32>::get() );
+ aConverted = xConverter->convertTo( nRowIndex, cppu::UnoType<sal_Int32>::get() );
bIsIndex = ( aConverted >>= nRow );
}
catch( uno::Exception& ) {} // silence any errors
}
- uno::Any aColumnAny = nColumnIndex;
-
if ( bIsColumnIndex )
{
// Column index can be a col address e.g Cells( 1, "B" ) etc.
@@ -2188,13 +2185,13 @@ ScVbaRange::CellsHelper( const uno::Reference< ov::XHelperInterface >& xParent,
}
else
{
- if ( !( aColumnAny >>= nColumn ) )
+ if ( !( nColumnIndex >>= nColumn ) )
{
uno::Reference< script::XTypeConverter > xConverter = getTypeConverter( xContext );
uno::Any aConverted;
try
{
- aConverted = xConverter->convertTo( aColumnAny, cppu::UnoType<sal_Int32>::get() );
+ aConverted = xConverter->convertTo( nColumnIndex, cppu::UnoType<sal_Int32>::get() );
bIsColumnIndex = ( aConverted >>= nColumn );
}
catch( uno::Exception& ) {} // silence any errors
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index c7b7b2e39843..4bfa4e76b620 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -2775,10 +2775,9 @@ void ScViewData::ReadUserDataSequence(const uno::Sequence <beans::PropertyValue>
}
else if (sName == SC_ACTIVETABLE)
{
- OUString sValue;
- if(rSettings[i].Value >>= sValue)
+ OUString sTabName;
+ if(rSettings[i].Value >>= sTabName)
{
- OUString sTabName(sValue);
SCTAB nTab(0);
if (GetDocument()->GetTable(sTabName, nTab))
nTabNo = nTab;
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index fb47310614bd..18cccbf4123d 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -2380,8 +2380,7 @@ void ScViewFunc::InsertTableLink( const OUString& rFile,
{
OUString aFilterName = rFilter;
OUString aOpt = rOptions;
- OUString aURL = rFile;
- ScDocumentLoader aLoader( aURL, aFilterName, aOpt );
+ ScDocumentLoader aLoader( rFile, aFilterName, aOpt );
if (!aLoader.IsError())
{
ScDocShell* pSrcSh = aLoader.GetDocShell();
diff --git a/scripting/source/dlgprov/dlgevtatt.cxx b/scripting/source/dlgprov/dlgevtatt.cxx
index dd2d18f92e7c..b0a51fe1047c 100644
--- a/scripting/source/dlgprov/dlgevtatt.cxx
+++ b/scripting/source/dlgprov/dlgevtatt.cxx
@@ -624,17 +624,16 @@ namespace dlgprov
if( pResMgr )
{
OUString aRes( ResId(STR_ERRUNOEVENTBINDUNG, *pResMgr) );
- OUString aQuoteChar( "\"" );
+ OUString aQuoteChar( "\"" );
- OUString aOURes = aRes;
- sal_Int32 nIndex = aOURes.indexOf( '%' );
+ sal_Int32 nIndex = aRes.indexOf( '%' );
OUString aOUFinal;
- aOUFinal += aOURes.copy( 0, nIndex );
+ aOUFinal += aRes.copy( 0, nIndex );
aOUFinal += aQuoteChar;
aOUFinal += aMethodName;
aOUFinal += aQuoteChar;
- aOUFinal += aOURes.copy( nIndex + 2 );
+ aOUFinal += aRes.copy( nIndex + 2 );
ScopedVclPtrInstance<MessageDialog>::Create(nullptr, aOUFinal)->Execute();
}
diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx
index 9f3988e9d0b4..a0bbae746b29 100644
--- a/sd/source/core/CustomAnimationEffect.cxx
+++ b/sd/source/core/CustomAnimationEffect.cxx
@@ -1732,17 +1732,16 @@ CustomAnimationEffectPtr EffectSequenceHelper::append( const CustomAnimationPres
}
// check target, maybe we need to force it to text
- Any aTarget( rTarget );
sal_Int16 nSubItem = ShapeAnimationSubType::AS_WHOLE;
- if( aTarget.getValueType() == ::cppu::UnoType<ParagraphTarget>::get() )
+ if( rTarget.getValueType() == ::cppu::UnoType<ParagraphTarget>::get() )
{
nSubItem = ShapeAnimationSubType::ONLY_TEXT;
}
else if( pPreset->isTextOnly() )
{
Reference< XShape > xShape;
- aTarget >>= xShape;
+ rTarget >>= xShape;
if( xShape.is() )
{
// thats bad, we target a shape here but the effect is only for text
@@ -1754,7 +1753,7 @@ CustomAnimationEffectPtr EffectSequenceHelper::append( const CustomAnimationPres
// now create effect from preset
pEffect.reset( new CustomAnimationEffect( xNode ) );
pEffect->setEffectSequence( this );
- pEffect->setTarget( aTarget );
+ pEffect->setTarget( rTarget );
pEffect->setTargetSubItem( nSubItem );
if( fDuration != -1.0 )
pEffect->setDuration( fDuration );
diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx
index 6587a46f010d..fdc5c8fa229f 100644
--- a/sd/source/core/drawdoc2.cxx
+++ b/sd/source/core/drawdoc2.cxx
@@ -1368,7 +1368,6 @@ sal_uInt16 SdDrawDocument::InsertPageSet (
SdPage* pPreviousNotesPage;
sal_uInt16 nStandardPageNum;
sal_uInt16 nNotesPageNum;
- OUString aStandardPageName(sStandardPageName);
OUString aNotesPageName(sNotesPageName);
// Gather some information about the standard page and the notes page
@@ -1387,7 +1386,7 @@ sal_uInt16 SdDrawDocument::InsertPageSet (
nStandardPageNum = pPreviousStandardPage->GetPageNum() + 2;
pPreviousNotesPage = static_cast<SdPage*>( GetPage(nStandardPageNum - 1) );
nNotesPageNum = nStandardPageNum + 1;
- aNotesPageName = aStandardPageName;
+ aNotesPageName = sStandardPageName;
}
OSL_ASSERT(nNotesPageNum==nStandardPageNum+1);
@@ -1398,7 +1397,7 @@ sal_uInt16 SdDrawDocument::InsertPageSet (
SetupNewPage (
pPreviousStandardPage,
pStandardPage,
- aStandardPageName,
+ sStandardPageName,
nInsertPosition,
bIsPageBack,
bIsPageObj);
diff --git a/sd/source/filter/xml/sdtransform.cxx b/sd/source/filter/xml/sdtransform.cxx
index f87a333c3882..855e63dcde3a 100644
--- a/sd/source/filter/xml/sdtransform.cxx
+++ b/sd/source/filter/xml/sdtransform.cxx
@@ -283,7 +283,7 @@ bool SdTransformOOo2xDocument::getBulletState( const SfxItemSet& rSet, sal_uInt1
{
if( ( rAttr.GetAttrLName( nItem ) == msEnableNumbering ) && ( rAttr.GetAttrNamespace( nItem ) == msTextNamespace ) )
{
- const OUString sValue( rAttr.GetAttrValue( nItem ) );
+ const OUString& sValue( rAttr.GetAttrValue( nItem ) );
rState = sValue.equals(msTrue);
return true;
}
diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx
index 3c4017905ccf..fb6057cfc4e0 100644
--- a/sd/source/ui/animations/SlideTransitionPane.cxx
+++ b/sd/source/ui/animations/SlideTransitionPane.cxx
@@ -1115,9 +1115,8 @@ IMPL_LINK_NOARG_TYPED(SlideTransitionPane, LateInitCallback, Timer *, void)
const TransitionPresetList& rPresetList = TransitionPreset::getTransitionPresetList();
size_t nPresetOffset = 0;
- for( const auto& aIter: rPresetList )
+ for( const TransitionPresetPtr& pPreset: rPresetList )
{
- TransitionPresetPtr pPreset = aIter;
const OUString sLabel( pPreset->getSetLabel() );
if( !sLabel.isEmpty() )
{
diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx
index c3606cae3f83..4d45f0a72165 100644
--- a/sd/source/ui/app/sdmod1.cxx
+++ b/sd/source/ui/app/sdmod1.cxx
@@ -567,14 +567,12 @@ SfxFrame* SdModule::ExecuteNewDocument( SfxRequest& rReq )
if( pPilotDlg->GetStartType() == ST_OPEN )
{
- OUString aFileToOpen = aDocPath;
-
- DBG_ASSERT( !aFileToOpen.isEmpty(), "The autopilot should have asked for a file itself already!" );
- if (!aFileToOpen.isEmpty())
+ DBG_ASSERT( !aDocPath.isEmpty(), "The autopilot should have asked for a file itself already!" );
+ if (!aDocPath.isEmpty())
{
css::uno::Sequence< css::beans::NamedValue > aPasswrd( pPilotDlg->GetPassword() );
- SfxStringItem aFile( SID_FILE_NAME, aFileToOpen );
+ SfxStringItem aFile( SID_FILE_NAME, aDocPath );
SfxStringItem aReferer( SID_REFERER, OUString());
SfxUnoAnyItem aPassword( SID_ENCRYPTIONDATA, css::uno::makeAny(aPasswrd) );
diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx
index 92c42153758d..bf796ac55d08 100644
--- a/sd/source/ui/dlg/navigatr.cxx
+++ b/sd/source/ui/dlg/navigatr.cxx
@@ -913,7 +913,7 @@ void SdPageNameControllerItem::StateChanged( sal_uInt16 nSId,
if( pInfo && pInfo->IsActive() )
{
const SfxStringItem& rStateItem = dynamic_cast<const SfxStringItem&>(*pItem);
- OUString aPageName = rStateItem.GetValue();
+ const OUString& aPageName = rStateItem.GetValue();
if( !pNavigatorWin->maTlbObjects->HasSelectedChildren( aPageName ) )
{
diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index a2552e2ec565..3f74cc3cbfc2 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -678,14 +678,13 @@ bool DrawDocShell::GotoBookmark(const OUString& rBookmark)
sal_uInt16 nPageNumber = SDRPAGE_NOTFOUND;
SdrObject* pObj = nullptr;
- OUString sBookmark( rBookmark );
const OUString sInteraction( "action?" );
- if ( sBookmark.match( sInteraction ) )
+ if ( rBookmark.match( sInteraction ) )
{
const OUString sJump( "jump=" );
- if ( sBookmark.match( sJump, sInteraction.getLength() ) )
+ if ( rBookmark.match( sJump, sInteraction.getLength() ) )
{
- OUString aDestination( sBookmark.copy( sInteraction.getLength() + sJump.getLength() ) );
+ OUString aDestination( rBookmark.copy( sInteraction.getLength() + sJump.getLength() ) );
if ( aDestination.match( "firstslide" ) )
{
nPageNumber = 1;
@@ -711,15 +710,13 @@ bool DrawDocShell::GotoBookmark(const OUString& rBookmark)
}
else
{
- OUString aBookmark( rBookmark );
-
// Is the bookmark a page?
- nPageNumber = mpDoc->GetPageByName( aBookmark, bIsMasterPage );
+ nPageNumber = mpDoc->GetPageByName( rBookmark, bIsMasterPage );
if (nPageNumber == SDRPAGE_NOTFOUND)
{
// Is the bookmark a object?
- pObj = mpDoc->GetObj(aBookmark);
+ pObj = mpDoc->GetObj(rBookmark);
if (pObj)
{
diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx
index 32b389cfe92a..e879ade7672f 100644
--- a/sd/source/ui/slideshow/slideshow.cxx
+++ b/sd/source/ui/slideshow/slideshow.cxx
@@ -321,13 +321,11 @@ void SAL_CALL SlideShow::setPropertyValue( const OUString& aPropertyName, const
}
case ATTR_PRESENT_CUSTOMSHOW:
{
- OUString aShow;
- if( aValue >>= aShow )
+ OUString aShowName;
+ if( aValue >>= aShowName )
{
bIllegalArgument = false;
- const OUString aShowName( aShow );
-
SdCustomShowList* pCustomShowList = mpDoc->GetCustomShowList();
if(pCustomShowList)
{
diff --git a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
index 703d0c5fed36..a9f691e35de7 100644
--- a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
+++ b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
@@ -864,11 +864,10 @@ void SlideSorterController::PageNameHasChanged (int nPageIndex, const OUString&
if (pChild == nullptr || pChild->GetPage() == nullptr)
return;
- OUString sOldName (rsOldName);
OUString sNewName (pChild->GetPage()->GetName());
pChild->FireAccessibleEvent(
css::accessibility::AccessibleEventId::NAME_CHANGED,
- makeAny(sOldName),
+ makeAny(rsOldName),
makeAny(sNewName));
}
diff --git a/sd/source/ui/slidesorter/view/SlideSorterView.cxx b/sd/source/ui/slidesorter/view/SlideSorterView.cxx
index c361dd3a713a..edb97445ae7d 100644
--- a/sd/source/ui/slidesorter/view/SlideSorterView.cxx
+++ b/sd/source/ui/slidesorter/view/SlideSorterView.cxx
@@ -815,22 +815,21 @@ bool SlideSorterView::SetState (
const PageDescriptor::State eState,
const bool bStateValue)
{
- model::SharedPageDescriptor pDescriptor (rpDescriptor);
- if ( ! pDescriptor)
+ if ( ! rpDescriptor)
return false;
- const bool bModified (pDescriptor->SetState(eState, bStateValue));
+ const bool bModified (rpDescriptor->SetState(eState, bStateValue));
if ( ! bModified)
return false;
// When the page object is not visible (i.e. not on the screen then
// nothing has to be painted.
- if (pDescriptor->HasState(PageDescriptor::ST_Visible))
+ if (rpDescriptor->HasState(PageDescriptor::ST_Visible))
{
// For most states a change of that state leads to visible
// difference and we have to request a repaint.
if (eState != PageDescriptor::ST_WasSelected)
- RequestRepaint(pDescriptor);
+ RequestRepaint(rpDescriptor);
}
return bModified;
diff --git a/sd/source/ui/unoidl/unocpres.cxx b/sd/source/ui/unoidl/unocpres.cxx
index 17450372efdd..d7835157dd78 100644
--- a/sd/source/ui/unoidl/unocpres.cxx
+++ b/sd/source/ui/unoidl/unocpres.cxx
@@ -467,19 +467,17 @@ sal_Bool SAL_CALL SdXCustomPresentationAccess::hasElements()
return pList && !pList->empty();
}
-SdCustomShow * SdXCustomPresentationAccess::getSdCustomShow( const OUString& Name ) const throw()
+SdCustomShow * SdXCustomPresentationAccess::getSdCustomShow( const OUString& rName ) const throw()
{
sal_uInt32 nIdx = 0;
SdCustomShowList* pList = GetCustomShowList();
const sal_uInt32 nCount = pList ? pList->size() : 0;
- const OUString aName( Name );
-
while( nIdx < nCount )
{
SdCustomShow* pShow = (*pList)[nIdx];
- if( pShow->GetName() == aName )
+ if( pShow->GetName() == rName )
return pShow;
nIdx++;
}
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 9380a183852c..449b54a1a60b 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -3370,15 +3370,13 @@ SdPage* SdDocLinkTargets::FindPage( const OUString& rName ) const throw(std::exc
sal_uInt16 nPage;
SdPage* pPage;
- const OUString aName( rName );
-
const bool bDraw = mpDoc->GetDocumentType() == DOCUMENT_TYPE_DRAW;
// standard pages
for( nPage = 0; nPage < nMaxPages; nPage++ )
{
pPage = static_cast<SdPage*>(mpDoc->GetPage( nPage ));
- if( (pPage->GetName() == aName) && (!bDraw || (pPage->GetPageKind() == PK_STANDARD)) )
+ if( (pPage->GetName() == rName) && (!bDraw || (pPage->GetPageKind() == PK_STANDARD)) )
return pPage;
}
@@ -3386,7 +3384,7 @@ SdPage* SdDocLinkTargets::FindPage( const OUString& rName ) const throw(std::exc
for( nPage = 0; nPage < nMaxMasterPages; nPage++ )
{
pPage = static_cast<SdPage*>(mpDoc->GetMasterPage( nPage ));
- if( (pPage->GetName() == aName) && (!bDraw || (pPage->GetPageKind() == PK_STANDARD)) )
+ if( (pPage->GetName() == rName) && (!bDraw || (pPage->GetPageKind() == PK_STANDARD)) )
return pPage;
}
diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx
index ff0768d2ed9b..9267fd83d6f4 100644
--- a/sd/source/ui/unoidl/unoobj.cxx
+++ b/sd/source/ui/unoidl/unoobj.cxx
@@ -1421,11 +1421,9 @@ void SAL_CALL SdUnoEventsAccess::replaceByName( const OUString& aName, const uno
}
else
{
- OUString aMacro = aStrMacro;
-
- OUString aLibName = aMacro.getToken(0, '.');
- OUString aModulName = aMacro.getToken(1, '.');
- OUString aMacroName = aMacro.getToken(2, '.');
+ OUString aLibName = aStrMacro.getToken(0, '.');
+ OUString aModulName = aStrMacro.getToken(1, '.');
+ OUString aMacroName = aStrMacro.getToken(2, '.');
OUStringBuffer sBuffer;
sBuffer.append( aMacroName );
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 83826053ddbe..d09b0566a853 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -3057,16 +3057,15 @@ void SAL_CALL SdMasterPage::setName( const OUString& rName )
{
SdDrawDocument* pDoc = GetModel()->GetDoc();
bool bOutDummy;
- OUString aNewName( rName );
// Slide Name has to be unique
- if( pDoc && pDoc->GetPageByName( aNewName, bOutDummy ) != SDRPAGE_NOTFOUND )
+ if( pDoc && pDoc->GetPageByName( rName, bOutDummy ) != SDRPAGE_NOTFOUND )
return; // throw Exception ?
- GetPage()->SetName( aNewName );
+ GetPage()->SetName( rName );
if( pDoc )
- pDoc->RenameLayoutTemplate( GetPage()->GetLayoutName(), aNewName );
+ pDoc->RenameLayoutTemplate( GetPage()->GetLayoutName(), rName );
// fake a mode change to repaint the page tab bar
::sd::DrawDocShell* pDocSh = GetModel()->GetDocShell();
diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx
index bfe2c56465a7..6da4626265d7 100644
--- a/sd/source/ui/view/drviews3.cxx
+++ b/sd/source/ui/view/drviews3.cxx
@@ -829,9 +829,8 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq)
if( rFormat != aFormat )
{
// put all items
- SvxNumBulletItem aNumBulletItem(rNumBulletItem);
- aNumBulletItem.GetNumRule()->SetLevel(nOutlineLevel,aFormat);
- aEditAttr.Put( aNumBulletItem );
+ rNumBulletItem.GetNumRule()->SetLevel(nOutlineLevel,aFormat);
+ aEditAttr.Put( rNumBulletItem );
aEditAttr.Put( aLRSpaceItem );
mpDrawView->SetAttributes( aEditAttr );
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index c569d19bee33..d10826382acb 100644
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -400,7 +400,6 @@ drawinglayer::primitive2d::Primitive2DContainer ViewRedirector::createRedirected
: (aTranslate.getY() + aScale.getY()) - fVerDist);
// get font attributes; use normally scaled font
- const basegfx::BColor aFontColor(aRGBColor);
vcl::Font aVclFont;
basegfx::B2DVector aTextSizeAttribute;
@@ -436,7 +435,7 @@ drawinglayer::primitive2d::Primitive2DContainer ViewRedirector::createRedirected
aDXArray,
aFontAttribute,
aLocale,
- aFontColor));
+ aRGBColor));
xRetval.push_back(xRef);
}
}
diff --git a/sdext/source/minimizer/impoptimizer.cxx b/sdext/source/minimizer/impoptimizer.cxx
index 33c4e02ce122..4f5bcbd901d5 100644
--- a/sdext/source/minimizer/impoptimizer.cxx
+++ b/sdext/source/minimizer/impoptimizer.cxx
@@ -352,7 +352,7 @@ Reference< XGraphic > ImpCompressGraphic( const Reference< XComponentContext >&
}
else // this is a metafile
{
- OUString aDestMimeType( aSourceMimeType );
+ const OUString& aDestMimeType( aSourceMimeType );
Reference< XStream > xTempFile( io::TempFile::create(rxContext), UNO_QUERY_THROW );
Reference< XOutputStream > xOutputStream( xTempFile->getOutputStream() );
Reference< XGraphicProvider > xGraphicProvider( GraphicProvider::create( rxContext ) );
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index 9a685a00628a..e2a00eda4538 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -551,7 +551,7 @@ bool lcl_isFilterNativelySupported(const SfxFilter& rFilter)
if (rFilter.IsOwnFormat())
return true;
- OUString aName = rFilter.GetFilterName();
+ const OUString& aName = rFilter.GetFilterName();
if (aName.startsWith("MS Excel"))
// We can handle all Excel variants natively.
return true;
diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx
index 2794ea263d55..d2926c2a0f1d 100644
--- a/sfx2/source/appl/linkmgr2.cxx
+++ b/sfx2/source/appl/linkmgr2.cxx
@@ -257,16 +257,15 @@ bool LinkManager::GetDisplayNames( const SvBaseLink * pLink,
case OBJECT_CLIENT_DDE:
{
sal_Int32 nTmp = 0;
- OUString sCmd( sLNm );
- OUString sServer( sCmd.getToken( 0, cTokenSeparator, nTmp ) );
- OUString sTopic( sCmd.getToken( 0, cTokenSeparator, nTmp ) );
+ OUString sServer( sLNm.getToken( 0, cTokenSeparator, nTmp ) );
+ OUString sTopic( sLNm.getToken( 0, cTokenSeparator, nTmp ) );
if( pType )
*pType = sServer;
if( pFile )
*pFile = sTopic;
if( pLinkStr )
- *pLinkStr = nTmp != -1 ? sCmd.copy(nTmp) : OUString();
+ *pLinkStr = nTmp != -1 ? sLNm.copy(nTmp) : OUString();
bRet = true;
}
break;
diff --git a/sfx2/source/appl/macroloader.cxx b/sfx2/source/appl/macroloader.cxx
index afddd82160ce..9cf3dade9e30 100644
--- a/sfx2/source/appl/macroloader.cxx
+++ b/sfx2/source/appl/macroloader.cxx
@@ -204,7 +204,7 @@ ErrCode SfxMacroLoader::loadMacro( const OUString& rURL, css::uno::Any& rRetval,
// 'macro:///lib.mod.proc(args)' => macro of App-BASIC
// 'macro://[docname|.]/lib.mod.proc(args)' => macro of current or qualified document
// 'macro://obj.method(args)' => direct API call, execute it via App-BASIC
- OUString aMacro( rURL );
+ const OUString& aMacro( rURL );
sal_Int32 nHashPos = aMacro.indexOf( '/', 8 );
sal_Int32 nArgsPos = aMacro.indexOf( '(' );
BasicManager *pAppMgr = SfxApplication::GetBasicManager();
diff --git a/sfx2/source/bastyp/frmhtml.cxx b/sfx2/source/bastyp/frmhtml.cxx
index 779f26ebd922..fe458c7e9605 100644
--- a/sfx2/source/bastyp/frmhtml.cxx
+++ b/sfx2/source/bastyp/frmhtml.cxx
@@ -100,7 +100,7 @@ void SfxFrameHTMLParser::ParseFrameOptions(
break;
case HTML_O_FRAMEBORDER:
{
- OUString aStr = aOption.GetString();
+ const OUString& aStr = aOption.GetString();
bool bBorder = true;
if ( aStr.equalsIgnoreAsciiCase("NO") ||
aStr.equalsIgnoreAsciiCase("0") )
@@ -114,7 +114,7 @@ void SfxFrameHTMLParser::ParseFrameOptions(
default:
if (aOption.GetTokenString().equalsIgnoreAsciiCase(HTML_O_READONLY))
{
- OUString aStr = aOption.GetString();
+ const OUString& aStr = aOption.GetString();
bool bReadonly = true;
if ( aStr.equalsIgnoreAsciiCase("FALSE") )
bReadonly = false;
@@ -122,7 +122,7 @@ void SfxFrameHTMLParser::ParseFrameOptions(
}
else if (aOption.GetTokenString().equalsIgnoreAsciiCase(HTML_O_EDIT))
{
- OUString aStr = aOption.GetString();
+ const OUString& aStr = aOption.GetString();
bool bEdit = true;
if ( aStr.equalsIgnoreAsciiCase("FALSE") )
bEdit = false;
diff --git a/sfx2/source/control/templatelocalview.cxx b/sfx2/source/control/templatelocalview.cxx
index 7c82737e2b18..dd5788d48c96 100644
--- a/sfx2/source/control/templatelocalview.cxx
+++ b/sfx2/source/control/templatelocalview.cxx
@@ -262,18 +262,16 @@ sal_uInt16 TemplateLocalView::createRegion(const OUString &rName)
if (!mpDocTemplates->InsertDir(rName,nRegionId))
return 0;
- OUString aRegionName = rName;
-
// Insert to the region cache list and to the thumbnail item list
TemplateContainerItem* pItem = new TemplateContainerItem( *this, nItemId );
pItem->mnRegionId = nRegionId;
- pItem->maTitle = aRegionName;
+ pItem->maTitle = rName;
maRegions.push_back(pItem);
pItem = new TemplateContainerItem(*this, nItemId);
pItem->mnRegionId = nRegionId;
- pItem->maTitle = aRegionName;
+ pItem->maTitle = rName;
AppendItem(pItem);
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index a2bf84e0dee5..94f529949829 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -1185,7 +1185,7 @@ SfxDocumentInfoDialog::SfxDocumentInfoDialog( vcl::Window* pParent,
rItemSet.GetItemState( SID_EXPLORER_PROPS_START, false, &pItem ) )
{
// File name
- OUString aFile( rInfoItem.GetValue() );
+ const OUString& aFile( rInfoItem.GetValue() );
INetURLObject aURL;
aURL.SetSmartProtocol( INetProtocol::File );
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index dd45218bcc46..a5f9a04340dc 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -1038,11 +1038,9 @@ FileDialogHelper_Impl::FileDialogHelper_Impl(
makeAny( nTemplateDescription )
);
- OUString sStandardDirTemp = sStandardDir;
-
aInitArguments[1] <<= NamedValue(
OUString( "StandardDir" ),
- makeAny( sStandardDirTemp )
+ makeAny( sStandardDir )
);
aInitArguments[2] <<= NamedValue(
diff --git a/sfx2/source/dialog/filtergrouping.cxx b/sfx2/source/dialog/filtergrouping.cxx
index ff86a2d8e6b6..33948a46d0df 100644
--- a/sfx2/source/dialog/filtergrouping.cxx
+++ b/sfx2/source/dialog/filtergrouping.cxx
@@ -621,8 +621,6 @@ namespace sfx2
if ( aServiceName != aCurrentServiceName )
{ // we reached a new group
- OUString sDocServName = aServiceName;
-
// look for the place in _rAllFilters where this ne group belongs - this is determined
// by the order of classes in aGlobalClassNames
GroupedFilterList::iterator aGroupPos = _rAllFilters.begin();
@@ -633,7 +631,7 @@ namespace sfx2
StringArray::iterator aGlobalIter = aGlobalClassNames.begin();
while ( ( aGroupPos != _rAllFilters.end() )
&& ( aGlobalIter != aGlobalClassNames.end() )
- && ( *aGlobalIter != sDocServName )
+ && ( *aGlobalIter != aServiceName )
)
{
++aGlobalIter;
diff --git a/sfx2/source/dialog/srchdlg.cxx b/sfx2/source/dialog/srchdlg.cxx
index c3aad423cf7f..1c4a139ae0f1 100644
--- a/sfx2/source/dialog/srchdlg.cxx
+++ b/sfx2/source/dialog/srchdlg.cxx
@@ -84,10 +84,9 @@ void SearchDialog::LoadConfig()
{
m_sWinState = OUStringToOString(aViewOpt.GetWindowState(), RTL_TEXTENCODING_ASCII_US);
Any aUserItem = aViewOpt.GetUserItem( "UserItem" );
- OUString aTemp;
- if ( aUserItem >>= aTemp )
+ OUString sUserData;
+ if ( aUserItem >>= sUserData )
{
- OUString sUserData( aTemp );
DBG_ASSERT( comphelper::string::getTokenCount(sUserData, ';') == 5, "invalid config data" );
sal_Int32 nIdx = 0;
OUString sSearchText = sUserData.getToken( 0, ';', nIdx );
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index a48f6dfc58ae..65786cf8997a 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -1561,7 +1561,7 @@ void SfxHeaderAttributes_Impl::SetAttributes()
void SfxHeaderAttributes_Impl::SetAttribute( const SvKeyValue& rKV )
{
- OUString aValue = rKV.GetValue();
+ const OUString& aValue = rKV.GetValue();
if( rKV.GetKey().equalsIgnoreAsciiCase("refresh") && !rKV.GetValue().isEmpty() )
{
sal_uInt32 nTime = aValue.getToken( 0, ';' ).toInt32() ;
diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx
index 8ce5f7824e5b..fa13268c64e0 100644
--- a/sfx2/source/doc/printhelper.cxx
+++ b/sfx2/source/doc/printhelper.cxx
@@ -646,7 +646,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >&
// No ucb or thread will be necessary then. In case it couldnt be
// converted its not an URL nor a system path. Then we can't accept
// this parameter and have to throw an exception.
- OUString sSystemPath(sTemp);
+ const OUString& sSystemPath(sTemp);
OUString sFileURL;
if (::osl::FileBase::getFileURLFromSystemPath(sSystemPath,sFileURL)!=::osl::FileBase::E_None)
throw css::lang::IllegalArgumentException();
diff --git a/slideshow/source/engine/slide/layer.cxx b/slideshow/source/engine/slide/layer.cxx
index 8b2bc42437a7..cc2f3e6be3ce 100644
--- a/slideshow/source/engine/slide/layer.cxx
+++ b/slideshow/source/engine/slide/layer.cxx
@@ -226,7 +226,7 @@ namespace slideshow
{
for( const auto& rViewEntry : maViewEntries )
{
- ViewLayerSharedPtr pViewLayer = rViewEntry.getViewLayer();
+ const ViewLayerSharedPtr& pViewLayer = rViewEntry.getViewLayer();
// set clip to all view layers and
pViewLayer->setClip( aClip );
diff --git a/starmath/source/symbol.cxx b/starmath/source/symbol.cxx
index 46e71a2eb838..0b3b54e2a6ab 100644
--- a/starmath/source/symbol.cxx
+++ b/starmath/source/symbol.cxx
@@ -162,7 +162,7 @@ bool SmSymbolManager::AddOrReplaceSymbol( const SmSym &rSymbol, bool bForceChang
{
bool bAdded = false;
- const OUString aSymbolName( rSymbol.GetName() );
+ const OUString& aSymbolName( rSymbol.GetName() );
if (aSymbolName.getLength() > 0 && rSymbol.GetSymbolSetName().getLength() > 0)
{
const SmSym *pFound = GetSymbolByName( aSymbolName );
diff --git a/stoc/source/implementationregistration/implreg.cxx b/stoc/source/implementationregistration/implreg.cxx
index 438ee792e1e9..a5c663d2ff93 100644
--- a/stoc/source/implementationregistration/implreg.cxx
+++ b/stoc/source/implementationregistration/implreg.cxx
@@ -467,8 +467,7 @@ void deletePathIfPossible(const Reference < XRegistryKey >& xRootKey,
{
xRootKey->deleteKey(path);
- OUString tmpPath(path);
- OUString newPath = tmpPath.copy(0, tmpPath.lastIndexOf('/'));
+ OUString newPath = path.copy(0, path.lastIndexOf('/'));
if (newPath.getLength() > 1)
deletePathIfPossible(xRootKey, newPath);
@@ -576,8 +575,7 @@ void deleteUserLink(const Reference < XRegistryKey >& xRootKey,
if (bClean)
{
- OUString tmpName(linkName);
- OUString path = tmpName.copy(0, tmpName.lastIndexOf('/'));
+ OUString path = linkName.copy(0, linkName.lastIndexOf('/'));
deletePathIfPossible(xRootKey, path);
}
}
@@ -1437,14 +1435,12 @@ void ImplementationRegistration::prepareRegister(
const Reference < XSimpleRegistry > & xReg)
// throw( CannotRegisterImplementationException, RuntimeException )
{
- OUString implLoaderUrl(implementationLoaderUrl);
OUString activatorName;
if (!implementationLoaderUrl.isEmpty())
{
- OUString tmpActivator(implementationLoaderUrl);
sal_Int32 nIndex = 0;
- activatorName = tmpActivator.getToken(0, ':', nIndex );
+ activatorName = implementationLoaderUrl.getToken(0, ':', nIndex );
} else
{
// check locationUrl to find out what kind of loader is needed
@@ -1472,7 +1468,7 @@ void ImplementationRegistration::prepareRegister(
if ( xRegistry.is())
{
- doRegister(m_xSMgr, m_xCtx, xAct, xRegistry, implLoaderUrl,
+ doRegister(m_xSMgr, m_xCtx, xAct, xRegistry, implementationLoaderUrl,
locationUrl, registeredLocationUrl);
}
}
@@ -1591,9 +1587,8 @@ Sequence< OUString > ImplementationRegistration::getImplementations(
if (!implementationLoaderUrl.isEmpty())
{
- OUString tmpActivator(implementationLoaderUrl);
sal_Int32 nIndex = 0;
- activatorName = tmpActivator.getToken(0, ':', nIndex );
+ activatorName = implementationLoaderUrl.getToken(0, ':', nIndex );
} else
{
// check locationUrl to find out what kind of loader is needed
diff --git a/stoc/source/typeconv/convert.cxx b/stoc/source/typeconv/convert.cxx
index c595c17a4588..b0bfb0c4fc6a 100644
--- a/stoc/source/typeconv/convert.cxx
+++ b/stoc/source/typeconv/convert.cxx
@@ -486,7 +486,7 @@ double TypeConverter_Impl::toDouble( const Any& rAny, double min, double max )
Any SAL_CALL TypeConverter_Impl::convertTo( const Any& rVal, const Type& aDestType )
throw( IllegalArgumentException, CannotConvertException, RuntimeException, std::exception)
{
- Type aSourceType = rVal.getValueType();
+ const Type& aSourceType = rVal.getValueType();
if (aSourceType == aDestType)
return rVal;
@@ -705,7 +705,7 @@ Any TypeConverter_Impl::convertToSimpleType( const Any& rVal, TypeClass aDestina
Reference< XInterface >(), (sal_Int16) 1 );
}
- Type aSourceType = rVal.getValueType();
+ const Type& aSourceType = rVal.getValueType();
TypeClass aSourceClass = aSourceType.getTypeClass();
if (aDestinationClass == aSourceClass)
return rVal;
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 8238315111c2..00f7b4bd6c14 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -1649,36 +1649,35 @@ OUString SvNumberformat::StripNewCurrencyDelimiters( const OUString& rStr,
bool bQuoteSymbol )
{
OUString aTmp;
- OUString aSource(rStr);
sal_Int32 nStartPos, nPos, nLen;
- nLen = aSource.getLength();
+ nLen = rStr.getLength();
nStartPos = 0;
- while ( (nPos = aSource.indexOf( "[$", nStartPos )) >= 0 )
+ while ( (nPos = rStr.indexOf( "[$", nStartPos )) >= 0 )
{
sal_Int32 nEnd;
- if ( (nEnd = GetQuoteEnd( aSource, nPos )) >= 0 )
+ if ( (nEnd = GetQuoteEnd( rStr, nPos )) >= 0 )
{
- aTmp += aSource.copy( nStartPos, ++nEnd - nStartPos );
+ aTmp += rStr.copy( nStartPos, ++nEnd - nStartPos );
nStartPos = nEnd;
}
else
{
- aTmp += aSource.copy( nStartPos, nPos - nStartPos );
+ aTmp += rStr.copy( nStartPos, nPos - nStartPos );
nStartPos = nPos + 2;
sal_Int32 nDash;
nEnd = nStartPos - 1;
do
{
- nDash = aSource.indexOf( '-', ++nEnd );
+ nDash = rStr.indexOf( '-', ++nEnd );
}
- while ( (nEnd = GetQuoteEnd( aSource, nDash )) >= 0 );
+ while ( (nEnd = GetQuoteEnd( rStr, nDash )) >= 0 );
sal_Int32 nClose;
nEnd = nStartPos - 1;
do
{
- nClose = aSource.indexOf( ']', ++nEnd );
+ nClose = rStr.indexOf( ']', ++nEnd );
}
- while ( (nEnd = GetQuoteEnd( aSource, nClose )) >= 0 );
+ while ( (nEnd = GetQuoteEnd( rStr, nClose )) >= 0 );
if(nClose < 0)
{
@@ -1694,14 +1693,14 @@ OUString SvNumberformat::StripNewCurrencyDelimiters( const OUString& rStr,
{
nPos = nDash;
}
- if ( !bQuoteSymbol || aSource[ nStartPos ] == '"' )
+ if ( !bQuoteSymbol || rStr[ nStartPos ] == '"' )
{
- aTmp += aSource.copy( nStartPos, nPos - nStartPos );
+ aTmp += rStr.copy( nStartPos, nPos - nStartPos );
}
else
{
aTmp += "\"";
- aTmp += aSource.copy( nStartPos, nPos - nStartPos );
+ aTmp += rStr.copy( nStartPos, nPos - nStartPos );
aTmp += "\"";
}
nStartPos = nClose + 1;
@@ -1709,7 +1708,7 @@ OUString SvNumberformat::StripNewCurrencyDelimiters( const OUString& rStr,
}
if ( nLen > nStartPos )
{
- aTmp += aSource.copy( nStartPos, nLen - nStartPos );
+ aTmp += rStr.copy( nStartPos, nLen - nStartPos );
}
return aTmp;
}
diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx
index a1dfe8588dbe..5b6229d6d33a 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -505,7 +505,6 @@ void BrowseBox::SetColumnTitle( sal_uInt16 nItemId, const OUString& rTitle )
BrowserColumn *pCol = (*pCols)[ nItemPos ];
if ( pCol->Title() != rTitle )
{
- OUString sNew(rTitle);
OUString sOld(pCol->Title());
pCol->Title() = rTitle;
@@ -524,7 +523,7 @@ void BrowseBox::SetColumnTitle( sal_uInt16 nItemId, const OUString& rTitle )
if ( isAccessibleAlive() )
{
commitTableEvent( TABLE_COLUMN_DESCRIPTION_CHANGED,
- makeAny( sNew ),
+ makeAny( rTitle ),
makeAny( sOld )
);
}
diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx
index a9fd3386460b..10432aff3e6e 100644
--- a/svtools/source/graphic/grfcache.cxx
+++ b/svtools/source/graphic/grfcache.cxx
@@ -516,7 +516,7 @@ bool GraphicDisplayCacheEntry::IsCacheableAsBitmap( const GDIMetaFile& rMtf,
bool bNonBitmapActionEncountered(false);
if( aNewSize.Width() && aNewSize.Height() && rSz.Width() && rSz.Height() )
{
- const MapMode rPrefMapMode( rMtf.GetPrefMapMode() );
+ const MapMode& rPrefMapMode( rMtf.GetPrefMapMode() );
const Size rSizePix( pOut->LogicToPixel( aNewSize, rPrefMapMode ) );
sal_uInt32 nCurPos;
diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx
index c148e8b86b7a..064b77a15666 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -1092,8 +1092,8 @@ IMPL_LINK_NOARG_TYPED(GraphicObject, ImplAutoSwapOutHdl, Timer *, void)
GraphicObject GraphicObject::CreateGraphicObjectFromURL( const OUString &rURL )
{
- const OUString aURL( rURL ), aPrefix( UNO_NAME_GRAPHOBJ_URLPREFIX );
- if( aURL.startsWith( aPrefix ) )
+ const OUString aPrefix( UNO_NAME_GRAPHOBJ_URLPREFIX );
+ if( rURL.startsWith( aPrefix ) )
{
// graphic manager url
OString aUniqueID(OUStringToOString(rURL.copy(sizeof(UNO_NAME_GRAPHOBJ_URLPREFIX) - 1), RTL_TEXTENCODING_UTF8));
@@ -1102,9 +1102,9 @@ GraphicObject GraphicObject::CreateGraphicObjectFromURL( const OUString &rURL )
else
{
Graphic aGraphic;
- if ( !aURL.isEmpty() )
+ if ( !rURL.isEmpty() )
{
- std::unique_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream( aURL, StreamMode::READ ));
+ std::unique_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream( rURL, StreamMode::READ ));
if( pStream )
GraphicConverter::Import( *pStream, aGraphic );
}
diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx
index 8e3dd65c4e42..dca98660e3bb 100644
--- a/svtools/source/graphic/grfmgr2.cxx
+++ b/svtools/source/graphic/grfmgr2.cxx
@@ -902,7 +902,6 @@ bool GraphicManager::ImplCreateOutput( OutputDevice* pOutputDevice,
if( aUnrotatedSizePix.Width() && aUnrotatedSizePix.Height() )
{
- BitmapEx aBmpEx( rBitmapEx );
BitmapEx aOutBmpEx;
Point aOutPoint;
Size aOutSize;
@@ -961,14 +960,14 @@ bool GraphicManager::ImplCreateOutput( OutputDevice* pOutputDevice,
{
if( bSimple )
{
- bRet = ( aOutBmpEx = aBmpEx ).Scale( aUnrotatedSizePix );
+ bRet = ( aOutBmpEx = rBitmapEx ).Scale( aUnrotatedSizePix );
if( bRet )
aOutBmpEx.Rotate( nRot10, COL_TRANSPARENT );
}
else
{
- bRet = ImplCreateRotatedScaled( aBmpEx, rAttributes,
+ bRet = ImplCreateRotatedScaled( rBitmapEx, rAttributes,
nRot10, aUnrotatedSizePix,
nStartX, nEndX, nStartY, nEndY,
aOutBmpEx );
@@ -980,18 +979,18 @@ bool GraphicManager::ImplCreateOutput( OutputDevice* pOutputDevice,
{
aOutPoint = pOutputDevice->PixelToLogic( aOutputPointPix );
aOutSize = pOutputDevice->PixelToLogic( aOutputSizePix );
- aOutBmpEx = aBmpEx;
+ aOutBmpEx = rBitmapEx;
bRet = true;
}
else
{
if( bSimple )
{
- bRet = ( aOutBmpEx = aBmpEx ).Scale( Size( nEndX - nStartX + 1, nEndY - nStartY + 1 ) );
+ bRet = ( aOutBmpEx = rBitmapEx ).Scale( Size( nEndX - nStartX + 1, nEndY - nStartY + 1 ) );
}
else
{
- bRet = ImplCreateRotatedScaled( aBmpEx, rAttributes,
+ bRet = ImplCreateRotatedScaled( rBitmapEx, rAttributes,
nRot10, aUnrotatedSizePix,
nStartX, nEndX, nStartY, nEndY,
aOutBmpEx );
@@ -1111,7 +1110,7 @@ bool GraphicManager::ImplCreateOutput( OutputDevice* pOut,
const double fScaleX = fOutWH / fGrfWH;
const double fScaleY = 1.0;
- const MapMode rPrefMapMode( rMtf.GetPrefMapMode() );
+ const MapMode& rPrefMapMode( rMtf.GetPrefMapMode() );
const Size rSizePix( pOut->LogicToPixel( aNewSize, rPrefMapMode ) );
// NOTE: If you do changes in this function, check GraphicDisplayCacheEntry::IsCacheableAsBitmap
diff --git a/svtools/source/misc/templatefoldercache.cxx b/svtools/source/misc/templatefoldercache.cxx
index 7157e0933885..b9ca359dd8ea 100644
--- a/svtools/source/misc/templatefoldercache.cxx
+++ b/svtools/source/misc/templatefoldercache.cxx
@@ -637,7 +637,7 @@ namespace svt
// the template directories from the config
const SvtPathOptions aPathOptions;
- OUString aDirs = aPathOptions.GetTemplatePath();
+ const OUString& aDirs = aPathOptions.GetTemplatePath();
// loop through all the root-level template folders
sal_Int32 nIndex = 0;
diff --git a/svtools/source/misc/transfer2.cxx b/svtools/source/misc/transfer2.cxx
index 6288f8ef808e..263f8e253d5a 100644
--- a/svtools/source/misc/transfer2.cxx
+++ b/svtools/source/misc/transfer2.cxx
@@ -491,8 +491,7 @@ void TransferDataContainer::CopyString( SotClipboardFormatId nFmt, const OUStrin
{
TDataCntnrEntry_Impl aEntry;
aEntry.nId = nFmt;
- OUString aStr( rStr );
- aEntry.aAny <<= aStr;
+ aEntry.aAny <<= rStr;
pImpl->aFmtList.push_back( aEntry );
AddFormat( aEntry.nId );
}
diff --git a/svtools/source/uno/unoevent.cxx b/svtools/source/uno/unoevent.cxx
index 4b62d2d98655..7cc356abd861 100644
--- a/svtools/source/uno/unoevent.cxx
+++ b/svtools/source/uno/unoevent.cxx
@@ -70,7 +70,7 @@ void getAnyFromMacro(Any& rAny, const SvxMacro& rMacro)
// macro name
PropertyValue aNameValue;
aNameValue.Name = sMacroName;
- OUString sNameTmp(rMacro.GetMacName());
+ const OUString& sNameTmp(rMacro.GetMacName());
aTmp <<= sNameTmp;
aNameValue.Value = aTmp;
aSequence[1] = aNameValue;
@@ -78,7 +78,7 @@ void getAnyFromMacro(Any& rAny, const SvxMacro& rMacro)
// library name
PropertyValue aLibValue;
aLibValue.Name = sLibrary;
- OUString sLibTmp(rMacro.GetLibName());
+ const OUString& sLibTmp(rMacro.GetLibName());
aTmp <<= sLibTmp;
aLibValue.Value = aTmp;
aSequence[2] = aLibValue;
@@ -103,7 +103,7 @@ void getAnyFromMacro(Any& rAny, const SvxMacro& rMacro)
// macro name
PropertyValue aNameValue;
aNameValue.Name = sScript;
- OUString sNameTmp(rMacro.GetMacName());
+ const OUString& sNameTmp(rMacro.GetMacName());
aTmp <<= sNameTmp;
aNameValue.Value = aTmp;
aSequence[1] = aNameValue;
diff --git a/svx/source/core/extedit.cxx b/svx/source/core/extedit.cxx
index 1267671a9e0f..d3b16b65a356 100644
--- a/svx/source/core/extedit.cxx
+++ b/svx/source/core/extedit.cxx
@@ -103,7 +103,7 @@ void ExternalToolEditThread::execute()
void ExternalToolEdit::Edit(GraphicObject const*const pGraphicObject)
{
//Get the graphic from the GraphicObject
- const Graphic aGraphic = pGraphicObject->GetGraphic();
+ const Graphic& aGraphic = pGraphicObject->GetGraphic();
//get the Preferred File Extension for this graphic
OUString fExtension;
diff --git a/svx/source/core/graphichelper.cxx b/svx/source/core/graphichelper.cxx
index 954766e30a2f..abfbaa01995e 100644
--- a/svx/source/core/graphichelper.cxx
+++ b/svx/source/core/graphichelper.cxx
@@ -105,12 +105,11 @@ OUString GraphicHelper::ExportGraphic( const Graphic& rGraphic, const OUString&
aPath.SetSmartURL( sGraphicsPath );
// fish out the graphic's name
- OUString aName = rGraphicName;
aDialogHelper.SetTitle( SVX_RESSTR(RID_SVXSTR_EXPORT_GRAPHIC_TITLE));
aDialogHelper.SetDisplayDirectory( aPath.GetMainURL(INetURLObject::DECODE_TO_IURI) );
INetURLObject aURL;
- aURL.SetSmartURL( aName );
+ aURL.SetSmartURL( rGraphicName );
aDialogHelper.SetFileName( aURL.GetName() );
GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter();
diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index 3a451f40169b..897fe70532ef 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -945,7 +945,7 @@ void SvxFontPrevWindow::SetFromItemSet(const SfxItemSet &rSet, bool bPreviewBack
if( GetWhich( rSet, SID_CHAR_DLG_PREVIEW_STRING, nWhich ) )
{
const SfxStringItem& rItem = static_cast<const SfxStringItem&>( rSet.Get( nWhich ) );
- OUString aString = rItem.GetValue();
+ const OUString& aString = rItem.GetValue();
if( !aString.isEmpty() )
SetPreviewText( aString );
else
@@ -1180,7 +1180,7 @@ void SvxFontPrevWindow::Init(const SfxItemSet& rSet)
if (ISITEMSET)
{
const SfxStringItem& rItem = static_cast<const SfxStringItem&>( rSet.Get( nWhich ) );
- OUString aString = rItem.GetValue();
+ const OUString& aString = rItem.GetValue();
if( !aString.isEmpty() )
SetPreviewText( aString );
else
diff --git a/svx/source/engine3d/dragmt3d.cxx b/svx/source/engine3d/dragmt3d.cxx
index 1f6150ada67d..6083bd7441b4 100644
--- a/svx/source/engine3d/dragmt3d.cxx
+++ b/svx/source/engine3d/dragmt3d.cxx
@@ -226,7 +226,7 @@ void E3dDragMethod::CreateOverlayGeometry(sdr::overlay::OverlayManager& rOverlay
if(nPlyCnt)
{
const sdr::contact::ViewContactOfE3dScene& rVCScene = static_cast< sdr::contact::ViewContactOfE3dScene& >(rCandidate.mp3DObj->GetScene()->GetViewContact());
- const drawinglayer::geometry::ViewInformation3D aViewInfo3D(rVCScene.getViewInformation3D());
+ const drawinglayer::geometry::ViewInformation3D& aViewInfo3D(rVCScene.getViewInformation3D());
const basegfx::B3DHomMatrix aWorldToView(aViewInfo3D.getDeviceToView() * aViewInfo3D.getProjection() * aViewInfo3D.getOrientation());
const basegfx::B3DHomMatrix aTransform(aWorldToView * rCandidate.maDisplayTransform);
@@ -267,7 +267,7 @@ E3dDragRotate::E3dDragRotate(SdrDragView &_rView,
if(pScene)
{
const sdr::contact::ViewContactOfE3dScene& rVCScene = static_cast< sdr::contact::ViewContactOfE3dScene& >(pScene->GetViewContact());
- const drawinglayer::geometry::ViewInformation3D aViewInfo3D(rVCScene.getViewInformation3D());
+ const drawinglayer::geometry::ViewInformation3D& aViewInfo3D(rVCScene.getViewInformation3D());
for(sal_uInt32 nOb(0); nOb < nCnt; nOb++)
{
@@ -389,7 +389,7 @@ void E3dDragRotate::MoveSdrDrag(const Point& rPnt)
// Transformation in eye coordinates, there rotate then and back
const sdr::contact::ViewContactOfE3dScene& rVCScene = static_cast< sdr::contact::ViewContactOfE3dScene& >(rCandidate.mp3DObj->GetScene()->GetViewContact());
- const drawinglayer::geometry::ViewInformation3D aViewInfo3D(rVCScene.getViewInformation3D());
+ const drawinglayer::geometry::ViewInformation3D& aViewInfo3D(rVCScene.getViewInformation3D());
basegfx::B3DHomMatrix aInverseOrientation(aViewInfo3D.getOrientation());
aInverseOrientation.invert();
@@ -506,7 +506,7 @@ void E3dDragMove::MoveSdrDrag(const Point& rPnt)
{
E3dDragMethodUnit& rCandidate = maGrp[nOb];
const sdr::contact::ViewContactOfE3dScene& rVCScene = static_cast< sdr::contact::ViewContactOfE3dScene& >(rCandidate.mp3DObj->GetScene()->GetViewContact());
- const drawinglayer::geometry::ViewInformation3D aViewInfo3D(rVCScene.getViewInformation3D());
+ const drawinglayer::geometry::ViewInformation3D& aViewInfo3D(rVCScene.getViewInformation3D());
// move coor from 2d world to 3d Eye
basegfx::B2DPoint aGlobalMoveHead2D((double)(rPnt.X() - maLastPos.X()), (double)(rPnt.Y() - maLastPos.Y()));
@@ -580,7 +580,7 @@ void E3dDragMove::MoveSdrDrag(const Point& rPnt)
// transform from 2D world view to 3D eye
const sdr::contact::ViewContactOfE3dScene& rVCScene = static_cast< sdr::contact::ViewContactOfE3dScene& >(rCandidate.mp3DObj->GetScene()->GetViewContact());
- const drawinglayer::geometry::ViewInformation3D aViewInfo3D(rVCScene.getViewInformation3D());
+ const drawinglayer::geometry::ViewInformation3D& aViewInfo3D(rVCScene.getViewInformation3D());
basegfx::B2DPoint aGlobalScaleStart2D((double)(aStartPos.X()), (double)(aStartPos.Y()));
basegfx::B2DPoint aGlobalScaleNext2D((double)(rPnt.X()), (double)(rPnt.Y()));
diff --git a/svx/source/engine3d/helperhittest3d.cxx b/svx/source/engine3d/helperhittest3d.cxx
index 62bcafb99971..d0f1376fc719 100644
--- a/svx/source/engine3d/helperhittest3d.cxx
+++ b/svx/source/engine3d/helperhittest3d.cxx
@@ -133,7 +133,7 @@ E3dScene* fillViewInformation3DForCompoundObject(drawinglayer::geometry::ViewInf
else
{
// build new ViewInformation containing all transforms for the candidate
- const drawinglayer::geometry::ViewInformation3D aViewInfo3D(rVCScene.getViewInformation3D());
+ const drawinglayer::geometry::ViewInformation3D& aViewInfo3D(rVCScene.getViewInformation3D());
o_rViewInformation3D = drawinglayer::geometry::ViewInformation3D(
aViewInfo3D.getObjectTransformation() * aInBetweenSceneMatrix,
diff --git a/svx/source/engine3d/helperminimaldepth3d.cxx b/svx/source/engine3d/helperminimaldepth3d.cxx
index 19db8ee885f4..acc655f2cbf1 100644
--- a/svx/source/engine3d/helperminimaldepth3d.cxx
+++ b/svx/source/engine3d/helperminimaldepth3d.cxx
@@ -161,7 +161,7 @@ double getMinimalDepthInViewCoordinates(const E3dCompoundObject& rObject)
{
// get ViewInformation3D from scene using VC
const sdr::contact::ViewContactOfE3dScene& rVCScene = static_cast< sdr::contact::ViewContactOfE3dScene& >(pScene->GetViewContact());
- const drawinglayer::geometry::ViewInformation3D aViewInfo3D(rVCScene.getViewInformation3D());
+ const drawinglayer::geometry::ViewInformation3D& aViewInfo3D(rVCScene.getViewInformation3D());
// the scene's object transformation is already part of aViewInfo3D.getObjectTransformation()
// for historical reasons (see ViewContactOfE3dScene::createViewInformation3D for more info)
diff --git a/svx/source/engine3d/obj3d.cxx b/svx/source/engine3d/obj3d.cxx
index 91fa02ca747a..4777944069e0 100644
--- a/svx/source/engine3d/obj3d.cxx
+++ b/svx/source/engine3d/obj3d.cxx
@@ -333,7 +333,7 @@ void E3dObject::NbcResize(const Point& rRef, const Fraction& xFact, const Fracti
{
// transform pos from 2D world to 3D eye
const sdr::contact::ViewContactOfE3dScene& rVCScene = static_cast< sdr::contact::ViewContactOfE3dScene& >(pScene->GetViewContact());
- const drawinglayer::geometry::ViewInformation3D aViewInfo3D(rVCScene.getViewInformation3D());
+ const drawinglayer::geometry::ViewInformation3D& aViewInfo3D(rVCScene.getViewInformation3D());
basegfx::B2DPoint aScaleCenter2D((double)rRef.X(), (double)rRef.Y());
basegfx::B2DHomMatrix aInverseSceneTransform(rVCScene.getObjectTransformation());
@@ -395,7 +395,7 @@ void E3dObject::NbcMove(const Size& rSize)
// BoundVolume from 3d world to 3d eye
const sdr::contact::ViewContactOfE3dScene& rVCScene = static_cast< sdr::contact::ViewContactOfE3dScene& >(pScene->GetViewContact());
- const drawinglayer::geometry::ViewInformation3D aViewInfo3D(rVCScene.getViewInformation3D());
+ const drawinglayer::geometry::ViewInformation3D& aViewInfo3D(rVCScene.getViewInformation3D());
basegfx::B3DRange aEyeVol(pScene->GetBoundVolume());
aEyeVol.transform(aViewInfo3D.getOrientation());
diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx
index 869c0d5b26ff..8075e70fe6a7 100644
--- a/svx/source/engine3d/scene3d.cxx
+++ b/svx/source/engine3d/scene3d.cxx
@@ -237,7 +237,7 @@ E3dScene::~E3dScene()
basegfx::B2DPolyPolygon E3dScene::TakeXorPoly() const
{
const sdr::contact::ViewContactOfE3dScene& rVCScene = static_cast< sdr::contact::ViewContactOfE3dScene& >(GetViewContact());
- const drawinglayer::geometry::ViewInformation3D aViewInfo3D(rVCScene.getViewInformation3D());
+ const drawinglayer::geometry::ViewInformation3D& aViewInfo3D(rVCScene.getViewInformation3D());
const basegfx::B3DPolyPolygon aCubePolyPolygon(CreateWireframe());
basegfx::B2DPolyPolygon aRetval(basegfx::tools::createB2DPolyPolygonFromB3DPolyPolygon(aCubePolyPolygon,
diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx
index 7eac614b28be..9deb51d57111 100644
--- a/svx/source/engine3d/view3d.cxx
+++ b/svx/source/engine3d/view3d.cxx
@@ -501,11 +501,6 @@ bool E3dView::ImpCloneAll3DObjectsToDestScene(E3dScene* pSrcScene, E3dScene* pDs
if(pSrcScene && pDstScene)
{
- const sdr::contact::ViewContactOfE3dScene& rVCSceneDst = static_cast< sdr::contact::ViewContactOfE3dScene& >(pDstScene->GetViewContact());
- const drawinglayer::geometry::ViewInformation3D aViewInfo3DDst(rVCSceneDst.getViewInformation3D());
- const sdr::contact::ViewContactOfE3dScene& rVCSceneSrc = static_cast< sdr::contact::ViewContactOfE3dScene& >(pSrcScene->GetViewContact());
- const drawinglayer::geometry::ViewInformation3D aViewInfo3DSrc(rVCSceneSrc.getViewInformation3D());
-
for(size_t i = 0; i < pSrcScene->GetSubList()->GetObjCount(); ++i)
{
E3dCompoundObject* pCompoundObj = dynamic_cast< E3dCompoundObject* >(pSrcScene->GetSubList()->GetObj(i));
diff --git a/svx/source/fmcomp/dbaexchange.cxx b/svx/source/fmcomp/dbaexchange.cxx
index bd7ba5a4ec05..d166af11b394 100644
--- a/svx/source/fmcomp/dbaexchange.cxx
+++ b/svx/source/fmcomp/dbaexchange.cxx
@@ -568,7 +568,6 @@ namespace svx
// extract the single values from the sequence
OUString sObjectName;
- OUString sDatasourceName = _rDatasource;
sObjectName = _rCommand;
// for compatibility: create a string which can be used for the SotClipboardFormatId::SBA_DATAEXCHANGE format
@@ -583,7 +582,7 @@ namespace svx
const sal_Unicode cQueryMark = '0';
// build the descriptor string
- m_sCompatibleObjectDescription += sDatasourceName;
+ m_sCompatibleObjectDescription += _rDatasource;
m_sCompatibleObjectDescription += sSeparator;
m_sCompatibleObjectDescription += bTreatAsStatement ? OUString() : sObjectName;
m_sCompatibleObjectDescription += sSeparator;
diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx
index 299c7331f4ad..91846cf73e1a 100644
--- a/svx/source/fmcomp/fmgridif.cxx
+++ b/svx/source/fmcomp/fmgridif.cxx
@@ -1714,10 +1714,9 @@ void FmXGridPeer::elementInserted(const ContainerEvent& evt) throw( RuntimeExcep
if (!pGrid || !m_xColumns.is() || pGrid->IsInColumnMove() || m_xColumns->getCount() == ((sal_Int32)pGrid->GetModelColCount()))
return;
- Reference< XPropertySet > xSet(evt.Element, css::uno::UNO_QUERY);
- addColumnListeners(xSet);
+ Reference< XPropertySet > xNewColumn(evt.Element, css::uno::UNO_QUERY);
+ addColumnListeners(xNewColumn);
- Reference< XPropertySet > xNewColumn(xSet);
OUString aName = ::comphelper::getString(xNewColumn->getPropertyValue(FM_PROP_LABEL));
Any aWidth = xNewColumn->getPropertyValue(FM_PROP_WIDTH);
sal_Int32 nWidth = 0;
diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx
index 854289b31cec..f95131ffc442 100644
--- a/svx/source/form/navigatortree.cxx
+++ b/svx/source/form/navigatortree.cxx
@@ -960,7 +960,7 @@ namespace svxform
// because i want to select all targets (and only them)
SelectAll(false);
- Sequence< Reference< XInterface > > aControls = _rData.hiddenControls();
+ const Sequence< Reference< XInterface > >& aControls = _rData.hiddenControls();
sal_Int32 nCount = aControls.getLength();
const Reference< XInterface >* pControls = aControls.getConstArray();
diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx
index 610ac8eb87f6..b193f7f1fc5c 100644
--- a/svx/source/gallery2/galbrws1.cxx
+++ b/svx/source/gallery2/galbrws1.cxx
@@ -290,7 +290,6 @@ void GalleryBrowser1::ImplEndGalleryThemeProperties(Dialog* pDialog, bool bCreat
if( !mpExchangeData->aEditedTitle.isEmpty() && aName != mpExchangeData->aEditedTitle )
{
- const OUString aOldName( aName );
OUString aTitle( mpExchangeData->aEditedTitle );
sal_uInt16 nCount = 0;
@@ -301,7 +300,7 @@ void GalleryBrowser1::ImplEndGalleryThemeProperties(Dialog* pDialog, bool bCreat
aTitle += OUString::number( nCount );
}
- mpGallery->RenameTheme( aOldName, aTitle );
+ mpGallery->RenameTheme( aName, aTitle );
}
if ( bCreateNew )
diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx
index fecc083650bc..d9e7ca056dba 100644
--- a/svx/source/gallery2/galbrws2.cxx
+++ b/svx/source/gallery2/galbrws2.cxx
@@ -1239,7 +1239,7 @@ OUString GalleryBrowser2::GetItemText( const GalleryTheme& rTheme, const SgaObje
{
OUString aRet;
- INetURLObject aURL(rObj.GetURL());
+ const INetURLObject& aURL(rObj.GetURL());
if( nItemTextFlags & GALLERY_ITEM_THEMENAME )
{
diff --git a/svx/source/gallery2/gallery1.cxx b/svx/source/gallery2/gallery1.cxx
index 94e51e36e81e..f86971271b8d 100644
--- a/svx/source/gallery2/gallery1.cxx
+++ b/svx/source/gallery2/gallery1.cxx
@@ -532,12 +532,10 @@ void Gallery::RenameTheme( const OUString& rOldName, const OUString& rNewName )
if( pThm )
{
- const OUString aOldName( rOldName );
-
pThemeEntry->SetName( rNewName );
pThm->ImplWrite();
- Broadcast( GalleryHint( GalleryHintType::THEME_RENAMED, aOldName, pThm->GetName() ) );
+ Broadcast( GalleryHint( GalleryHintType::THEME_RENAMED, rOldName, pThm->GetName() ) );
ReleaseTheme( pThm, aListener );
}
}
diff --git a/svx/source/gallery2/galmisc.cxx b/svx/source/gallery2/galmisc.cxx
index e9ebccda2bd3..8b6d25c51f10 100644
--- a/svx/source/gallery2/galmisc.cxx
+++ b/svx/source/gallery2/galmisc.cxx
@@ -273,16 +273,16 @@ bool CreateDir( const INetURLObject& rURL )
try
{
uno::Reference< ucb::XCommandEnvironment > aCmdEnv;
- INetURLObject aNewFolderURL( rURL );
- INetURLObject aParentURL( aNewFolderURL ); aParentURL.removeSegment();
+ INetURLObject aParentURL( rURL );
+ aParentURL.removeSegment();
::ucbhelper::Content aParent( aParentURL.GetMainURL( INetURLObject::NO_DECODE ), aCmdEnv, comphelper::getProcessComponentContext() );
uno::Sequence< OUString > aProps( 1 );
uno::Sequence< uno::Any > aValues( 1 );
aProps[0] = "Title";
- aValues[0] = uno::makeAny( OUString( aNewFolderURL.GetName() ) );
+ aValues[0] = uno::makeAny( OUString( rURL.GetName() ) );
- ::ucbhelper::Content aContent( aNewFolderURL.GetMainURL( INetURLObject::NO_DECODE ), aCmdEnv, comphelper::getProcessComponentContext() );
+ ::ucbhelper::Content aContent( rURL.GetMainURL( INetURLObject::NO_DECODE ), aCmdEnv, comphelper::getProcessComponentContext() );
bRet = aParent.insertNewContent( "application/vnd.sun.staroffice.fsys-folder", aProps, aValues, aContent );
}
catch( const ucb::ContentCreationException& )
diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx
index a9e1acacac0f..795134c3b027 100644
--- a/svx/source/gallery2/galtheme.cxx
+++ b/svx/source/gallery2/galtheme.cxx
@@ -743,8 +743,7 @@ GalleryThemeEntry* GalleryTheme::CreateThemeEntry( const INetURLObject& rURL, bo
}
}
- INetURLObject aPathURL( rURL );
- pRet = new GalleryThemeEntry( false, aPathURL, aThemeName,
+ pRet = new GalleryThemeEntry( false, rURL, aThemeName,
bReadOnly, false, nThemeId,
bThemeNameFromResource );
}
diff --git a/svx/source/sdr/contact/viewcontactofe3dscene.cxx b/svx/source/sdr/contact/viewcontactofe3dscene.cxx
index 3f6206d8a8ad..902cf3a0782b 100644
--- a/svx/source/sdr/contact/viewcontactofe3dscene.cxx
+++ b/svx/source/sdr/contact/viewcontactofe3dscene.cxx
@@ -174,9 +174,9 @@ void ViewContactOfE3dScene::createViewInformation3D(const basegfx::B3DRange& rCo
{
// calculate orientation from VRP, VPN and VUV
const B3dCamera& rSceneCamera = GetE3dScene().GetCameraSet();
- const basegfx::B3DPoint aVRP(rSceneCamera.GetVRP());
- const basegfx::B3DVector aVPN(rSceneCamera.GetVPN());
- const basegfx::B3DVector aVUV(rSceneCamera.GetVUV());
+ const basegfx::B3DPoint& aVRP(rSceneCamera.GetVRP());
+ const basegfx::B3DVector& aVPN(rSceneCamera.GetVPN());
+ const basegfx::B3DVector& aVUV(rSceneCamera.GetVUV());
aOrientation.orientation(aVRP, aVPN, aVUV);
}
diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
index 9565e59053c9..baaf6ae6798e 100644
--- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
@@ -856,7 +856,7 @@ namespace sdr { namespace contact {
#endif
::basegfx::B2DHomMatrix aScaleNormalization;
- MapMode aCurrentDeviceMapMode( rPageViewDevice.GetMapMode() );
+ const MapMode& aCurrentDeviceMapMode( rPageViewDevice.GetMapMode() );
aScaleNormalization.set( 0, 0, (double)aCurrentDeviceMapMode.GetScaleX() );
aScaleNormalization.set( 1, 1, (double)aCurrentDeviceMapMode.GetScaleY() );
m_aZoomLevelNormalization *= aScaleNormalization;
@@ -1090,7 +1090,7 @@ namespace sdr { namespace contact {
{
_out_rControl.clear();
- Reference< XControlModel > xControlModel( _rUnoObject.GetUnoControlModel() );
+ const Reference< XControlModel >& xControlModel( _rUnoObject.GetUnoControlModel() );
DBG_ASSERT( xControlModel.is(), "ViewObjectContactOfUnoControl_Impl::createControlForDevice: no control model at the SdrUnoObject!?" );
if ( !xControlModel.is() )
return false;
@@ -1098,7 +1098,7 @@ namespace sdr { namespace contact {
bool bSuccess = false;
try
{
- const OUString sControlServiceName( _rUnoObject.GetUnoControlTypeName() );
+ const OUString& sControlServiceName( _rUnoObject.GetUnoControlTypeName() );
Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
_out_rControl = Reference<XControl>( xContext->getServiceManager()->createInstanceWithContext(sControlServiceName, xContext), UNO_QUERY_THROW );
diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx
index 47544bb0d3fd..38d52217aff5 100644
--- a/svx/source/svdraw/svdedtv1.cxx
+++ b/svx/source/svdraw/svdedtv1.cxx
@@ -680,15 +680,14 @@ void SdrEditView::DistortMarkedObj(const Rectangle& rRef, const XPolygon& rDisto
AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pO));
Rectangle aRefRect(rRef);
- XPolygon aRefPoly(rDistortedRect);
const SdrObjList* pOL=pO->GetSubList();
if (bNoContortion || pOL==nullptr) {
- ImpDistortObj(pO,aRefRect,aRefPoly,bNoContortion);
+ ImpDistortObj(pO,aRefRect,rDistortedRect,bNoContortion);
} else {
SdrObjListIter aIter(*pOL,IM_DEEPNOGROUPS);
while (aIter.IsMore()) {
SdrObject* pO1=aIter.Next();
- ImpDistortObj(pO1,aRefRect,aRefPoly,bNoContortion);
+ ImpDistortObj(pO1,aRefRect,rDistortedRect,bNoContortion);
}
}
}
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 2511e5dd7a68..ffa16dc62dc5 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -1313,7 +1313,7 @@ void SdrModel::TakeMetricStr(long nVal, OUString& rStr, bool bNoUnitChars, sal_I
// if necessary, add separators before every third digit
if( nVorKomma > 3 )
{
- OUString aThoSep( rLoc.getNumThousandSep() );
+ const OUString& aThoSep( rLoc.getNumThousandSep() );
if ( !aThoSep.isEmpty() )
{
sal_Unicode cTho( aThoSep[0] );
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index 8b6bd6492246..d21cd0b10813 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -1557,25 +1557,22 @@ void SdrObjCustomShape::Resize( const Point& rRef, const Fraction& xFact, const
void SdrObjCustomShape::NbcResize( const Point& rRef, const Fraction& rxFact, const Fraction& ryFact )
{
- Fraction xFact( rxFact );
- Fraction yFact( ryFact );
-
// taking care of handles that should not been changed
Rectangle aOld( maRect );
std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles() );
- SdrTextObj::NbcResize( rRef, xFact, yFact );
+ SdrTextObj::NbcResize( rRef, rxFact, ryFact );
- if ( ( xFact.GetNumerator() != xFact.GetDenominator() )
- || ( yFact.GetNumerator()!= yFact.GetDenominator() ) )
+ if ( ( rxFact.GetNumerator() != rxFact.GetDenominator() )
+ || ( ryFact.GetNumerator()!= ryFact.GetDenominator() ) )
{
- if ( ( ( xFact.GetNumerator() < 0 ) && ( xFact.GetDenominator() > 0 ) ) ||
- ( ( xFact.GetNumerator() > 0 ) && ( xFact.GetDenominator() < 0 ) ) )
+ if ( ( ( rxFact.GetNumerator() < 0 ) && ( rxFact.GetDenominator() > 0 ) ) ||
+ ( ( rxFact.GetNumerator() > 0 ) && ( rxFact.GetDenominator() < 0 ) ) )
{
SetMirroredX( !IsMirroredX() );
}
- if ( ( ( yFact.GetNumerator() < 0 ) && ( yFact.GetDenominator() > 0 ) ) ||
- ( ( yFact.GetNumerator() > 0 ) && ( yFact.GetDenominator() < 0 ) ) )
+ if ( ( ( ryFact.GetNumerator() < 0 ) && ( ryFact.GetDenominator() > 0 ) ) ||
+ ( ( ryFact.GetNumerator() > 0 ) && ( ryFact.GetDenominator() < 0 ) ) )
{
SetMirroredY( !IsMirroredY() );
}
diff --git a/svx/source/svdraw/svdomedia.cxx b/svx/source/svdraw/svdomedia.cxx
index 2f36bfd460a2..ada1c4aaa57f 100644
--- a/svx/source/svdraw/svdomedia.cxx
+++ b/svx/source/svdraw/svdomedia.cxx
@@ -425,7 +425,7 @@ void SdrMediaObj::mediaPropertiesChanged( const ::avmedia::MediaItem& rNewProper
( rNewProperties.getURL() != getURL() ))
{
m_xImpl->m_xCachedSnapshot.clear();
- OUString const url(rNewProperties.getURL());
+ OUString const& url(rNewProperties.getURL());
if (url.startsWithIgnoreAsciiCase("vnd.sun.star.Package:"))
{
if ( !m_xImpl->m_pTempFile
diff --git a/svx/source/svdraw/svdtrans.cxx b/svx/source/svdraw/svdtrans.cxx
index c14ede928427..414de974842b 100644
--- a/svx/source/svdraw/svdtrans.cxx
+++ b/svx/source/svdraw/svdtrans.cxx
@@ -853,7 +853,7 @@ void SdrFormatter::TakeStr(long nVal, OUString& rStr) const
// add in thousands separator (if necessary)
if( nForComma > 3 )
{
- OUString aThoSep( rLoc.getNumThousandSep() );
+ const OUString& aThoSep( rLoc.getNumThousandSep() );
if ( aThoSep.getLength() > 0 )
{
sal_Unicode cTho( aThoSep[0] );
diff --git a/svx/source/tbxctrls/PaletteManager.cxx b/svx/source/tbxctrls/PaletteManager.cxx
index 535134f344de..4acf2e469be0 100644
--- a/svx/source/tbxctrls/PaletteManager.cxx
+++ b/svx/source/tbxctrls/PaletteManager.cxx
@@ -227,7 +227,7 @@ void PaletteManager::SetColorSelectFunction(const std::function<void(const OUStr
void PaletteManager::PopupColorPicker(const OUString& aCommand)
{
// The calling object goes away during aColorDlg.Execute(), so we must copy this
- OUString aCommandCopy = aCommand;
+ const OUString& aCommandCopy = aCommand;
SvColorDialog aColorDlg( nullptr );
aColorDlg.SetColor ( mLastColor );
aColorDlg.SetMode( svtools::ColorPickerMode_MODIFY );
diff --git a/svx/source/tbxctrls/lboxctrl.cxx b/svx/source/tbxctrls/lboxctrl.cxx
index ca300c45be28..e500aa4d9952 100644
--- a/svx/source/tbxctrls/lboxctrl.cxx
+++ b/svx/source/tbxctrls/lboxctrl.cxx
@@ -235,7 +235,7 @@ void SvxUndoRedoControl::StateChanged(
{
const SfxStringItem& rItem = *static_cast<const SfxStringItem *>(pState);
ToolBox& rBox = GetToolBox();
- OUString aQuickHelpText = rItem.GetValue();
+ const OUString& aQuickHelpText = rItem.GetValue();
rBox.SetQuickHelpText( GetId(), aQuickHelpText );
}
SvxListBoxControl::StateChanged( nSID, eState, pState );
diff --git a/svx/source/tbxctrls/tbunocontroller.cxx b/svx/source/tbxctrls/tbunocontroller.cxx
index 692cefdfebdc..f0e32a7af069 100644
--- a/svx/source/tbxctrls/tbunocontroller.cxx
+++ b/svx/source/tbxctrls/tbunocontroller.cxx
@@ -380,11 +380,10 @@ throw (css::uno::RuntimeException, std::exception)
}
uno::Reference< awt::XWindow > SAL_CALL FontHeightToolBoxControl::createItemWindow(
- const uno::Reference< awt::XWindow >& Parent )
+ const uno::Reference< awt::XWindow >& xParent )
throw (css::uno::RuntimeException, std::exception)
{
uno::Reference< awt::XWindow > xItemWindow;
- uno::Reference< awt::XWindow > xParent( Parent );
vcl::Window* pParent = VCLUnoHelper::GetWindow( xParent );
if ( pParent )
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index cec62ab16da9..f050ca6487e7 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -465,11 +465,10 @@ void SAL_CALL FindTextToolbarController::initialize( const css::uno::Sequence< c
SearchToolbarControllersManager::createControllersManager().registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL);
}
-css::uno::Reference< css::awt::XWindow > SAL_CALL FindTextToolbarController::createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) throw ( css::uno::RuntimeException, std::exception )
+css::uno::Reference< css::awt::XWindow > SAL_CALL FindTextToolbarController::createItemWindow( const css::uno::Reference< css::awt::XWindow >& xParent ) throw ( css::uno::RuntimeException, std::exception )
{
css::uno::Reference< css::awt::XWindow > xItemWindow;
- css::uno::Reference< css::awt::XWindow > xParent( Parent );
vcl::Window* pParent = VCLUnoHelper::GetWindow( xParent );
if ( pParent )
{
@@ -684,11 +683,10 @@ void SAL_CALL MatchCaseToolboxController::initialize( const css::uno::Sequence<
SearchToolbarControllersManager::createControllersManager().registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL);
}
-css::uno::Reference< css::awt::XWindow > SAL_CALL MatchCaseToolboxController::createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) throw ( css::uno::RuntimeException, std::exception )
+css::uno::Reference< css::awt::XWindow > SAL_CALL MatchCaseToolboxController::createItemWindow( const css::uno::Reference< css::awt::XWindow >& xParent ) throw ( css::uno::RuntimeException, std::exception )
{
css::uno::Reference< css::awt::XWindow > xItemWindow;
- css::uno::Reference< css::awt::XWindow > xParent( Parent );
vcl::Window* pParent = VCLUnoHelper::GetWindow( xParent );
if ( pParent )
{
@@ -777,11 +775,10 @@ void SAL_CALL SearchFormattedToolboxController::initialize( const css::uno::Sequ
SearchToolbarControllersManager::createControllersManager().registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL);
}
-css::uno::Reference< css::awt::XWindow > SAL_CALL SearchFormattedToolboxController::createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) throw ( css::uno::RuntimeException, std::exception )
+css::uno::Reference< css::awt::XWindow > SAL_CALL SearchFormattedToolboxController::createItemWindow( const css::uno::Reference< css::awt::XWindow >& xParent ) throw ( css::uno::RuntimeException, std::exception )
{
css::uno::Reference< css::awt::XWindow > xItemWindow;
- css::uno::Reference< css::awt::XWindow > xParent( Parent );
vcl::Window* pParent = VCLUnoHelper::GetWindow( xParent );
if ( pParent )
{
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index e6b74d32cdda..735c6a5de16e 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -1216,16 +1216,14 @@ Sequence< OUString > SAL_CALL GraphicExporter::getSupportedServiceNames( )
}
// XMimeTypeInfo
-sal_Bool SAL_CALL GraphicExporter::supportsMimeType( const OUString& MimeTypeName ) throw (RuntimeException, std::exception)
+sal_Bool SAL_CALL GraphicExporter::supportsMimeType( const OUString& rMimeTypeName ) throw (RuntimeException, std::exception)
{
- const OUString aMimeTypeName( MimeTypeName );
-
GraphicFilter &rFilter = GraphicFilter::GetGraphicFilter();
sal_uInt16 nCount = rFilter.GetExportFormatCount();
sal_uInt16 nFilter;
for( nFilter = 0; nFilter < nCount; nFilter++ )
{
- if( aMimeTypeName == rFilter.GetExportFormatMediaType( nFilter ) )
+ if( rMimeTypeName == rFilter.GetExportFormatMediaType( nFilter ) )
{
return sal_True;
}
diff --git a/svx/source/unodraw/unomod.cxx b/svx/source/unodraw/unomod.cxx
index 456ae108c559..7aa925377f91 100644
--- a/svx/source/unodraw/unomod.cxx
+++ b/svx/source/unodraw/unomod.cxx
@@ -418,14 +418,13 @@ uno::Reference< uno::XInterface > SAL_CALL SvxUnoDrawingModel::createInstance( c
uno::Reference< uno::XInterface > xRet;
- const OUString aType( aServiceSpecifier );
const OUString aPackagePrefix( "com.sun.star.presentation." );
- if( aType.startsWith( aPackagePrefix ) )
+ if( aServiceSpecifier.startsWith( aPackagePrefix ) )
{
SvxShape* pShape = nullptr;
sal_uInt16 nType = OBJ_TEXT;
- OUString aTypeName = aType.copy( aPackagePrefix.getLength() );
+ OUString aTypeName = aServiceSpecifier.copy( aPackagePrefix.getLength() );
// create a shape wrapper
if( aTypeName.startsWith("TitleTextShape") )
{
diff --git a/svx/source/unodraw/unomtabl.cxx b/svx/source/unodraw/unomtabl.cxx
index aea0bd644884..70997655e0f6 100644
--- a/svx/source/unodraw/unomtabl.cxx
+++ b/svx/source/unodraw/unomtabl.cxx
@@ -191,17 +191,15 @@ void SAL_CALL SvxUnoMarkerTable::removeByName( const OUString& aApiName )
return;
}
- OUString Name = SvxUnogetInternalNameForItem(XATTR_LINEEND, aApiName);
+ OUString aName = SvxUnogetInternalNameForItem(XATTR_LINEEND, aApiName);
ItemPoolVector::iterator aIter = maItemSetVector.begin();
const ItemPoolVector::iterator aEnd = maItemSetVector.end();
- const OUString aSearchName( Name );
-
while( aIter != aEnd )
{
const NameOrIndex *pItem = static_cast<const NameOrIndex *>(&((*aIter)->Get( XATTR_LINEEND ) ));
- if( pItem->GetName() == aSearchName )
+ if( pItem->GetName() == aName )
{
delete (*aIter);
maItemSetVector.erase( aIter );
@@ -210,7 +208,7 @@ void SAL_CALL SvxUnoMarkerTable::removeByName( const OUString& aApiName )
++aIter;
}
- if( !hasByName( Name ) )
+ if( !hasByName( aName ) )
throw container::NoSuchElementException();
}
@@ -220,27 +218,25 @@ void SAL_CALL SvxUnoMarkerTable::replaceByName( const OUString& aApiName, const
{
SolarMutexGuard aGuard;
- OUString aName = SvxUnogetInternalNameForItem(XATTR_LINEEND, aApiName);
+ const OUString aName = SvxUnogetInternalNameForItem(XATTR_LINEEND, aApiName);
ItemPoolVector::iterator aIter = maItemSetVector.begin();
const ItemPoolVector::iterator aEnd = maItemSetVector.end();
- const OUString aSearchName( aName );
-
while( aIter != aEnd )
{
const NameOrIndex *pItem = static_cast<const NameOrIndex *>(&((*aIter)->Get( XATTR_LINEEND ) ));
- if( pItem->GetName() == aSearchName )
+ if( pItem->GetName() == aName )
{
XLineEndItem aEndMarker;
- aEndMarker.SetName( aSearchName );
+ aEndMarker.SetName( aName );
if( !aEndMarker.PutValue( aElement, 0 ) )
throw lang::IllegalArgumentException();
(*aIter)->Put( aEndMarker, XATTR_LINEEND );
XLineStartItem aStartMarker;
- aStartMarker.SetName( aSearchName );
+ aStartMarker.SetName( aName );
aStartMarker.PutValue( aElement, 0 );
(*aIter)->Put( aStartMarker, XATTR_LINESTART );
@@ -257,7 +253,7 @@ void SAL_CALL SvxUnoMarkerTable::replaceByName( const OUString& aApiName, const
for( nSurrogate = 0; nSurrogate < nStartCount; nSurrogate++ )
{
NameOrIndex *pItem = const_cast<NameOrIndex*>(static_cast<const NameOrIndex*>(mpModelPool->GetItem2( XATTR_LINESTART, nSurrogate)));
- if( pItem && pItem->GetName() == aSearchName )
+ if( pItem && pItem->GetName() == aName )
{
pItem->PutValue( aElement, 0 );
bFound = true;
@@ -269,7 +265,7 @@ void SAL_CALL SvxUnoMarkerTable::replaceByName( const OUString& aApiName, const
for( nSurrogate = 0; nSurrogate < nEndCount; nSurrogate++ )
{
NameOrIndex *pItem = const_cast<NameOrIndex*>(static_cast<const NameOrIndex*>(mpModelPool->GetItem2( XATTR_LINEEND, nSurrogate)));
- if( pItem && pItem->GetName() == aSearchName )
+ if( pItem && pItem->GetName() == aName )
{
pItem->PutValue( aElement, 0 );
bFound = true;
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 5df66bbd6469..51cfdcae1f7c 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -1577,13 +1577,12 @@ bool SAL_CALL SvxShape::SetFillAttribute( sal_Int32 nWID, const OUString& rName,
const SfxItemPool* pPool = rSet.GetPool();
- const OUString aSearchName( aName );
const sal_uInt32 nCount = pPool->GetItemCount2((sal_uInt16)nWID);
for( sal_uInt32 nSurrogate = 0; nSurrogate < nCount; nSurrogate++ )
{
const NameOrIndex* pItem = static_cast<const NameOrIndex*>(pPool->GetItem2((sal_uInt16)nWID, nSurrogate));
- if( pItem && ( pItem->GetName() == aSearchName ) )
+ if( pItem && ( pItem->GetName() == aName ) )
{
rSet.Put( *pItem );
return true;
diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx
index 25299ca7c9dc..7afceb1fe8b2 100644
--- a/svx/source/xml/xmlgrhlp.cxx
+++ b/svx/source/xml/xmlgrhlp.cxx
@@ -622,20 +622,19 @@ bool SvXMLGraphicHelper::ImplWriteGraphic( const OUString& rPictureStorageName,
void SvXMLGraphicHelper::ImplInsertGraphicURL( const OUString& rURLStr, sal_uInt32 nInsertPos, OUString& rRequestedFileName )
{
- OUString aURLString( rURLStr );
OUString aPictureStorageName, aPictureStreamName;
- if( ( maURLSet.find( aURLString ) != maURLSet.end() ) )
+ if( ( maURLSet.find( rURLStr ) != maURLSet.end() ) )
{
for (URLPairVector::const_iterator aIter( maGrfURLs.begin() ), aEnd( maGrfURLs.end() ); aIter != aEnd ; ++aIter)
{
- if( aURLString == (*aIter).first )
+ if( rURLStr == (*aIter).first )
{
maGrfURLs[ nInsertPos ].second = (*aIter).second;
break;
}
}
}
- else if( ImplGetStreamNames( aURLString, aPictureStorageName, aPictureStreamName ) )
+ else if( ImplGetStreamNames( rURLStr, aPictureStorageName, aPictureStreamName ) )
{
URLPair& rURLPair = maGrfURLs[ nInsertPos ];
@@ -657,12 +656,11 @@ void SvXMLGraphicHelper::ImplInsertGraphicURL( const OUString& rURLStr, sal_uInt
}
else
{
- const OUString aGraphicObjectId( aPictureStreamName );
- const OString aAsciiObjectID(OUStringToOString(aGraphicObjectId, RTL_TEXTENCODING_ASCII_US));
+ const OString aAsciiObjectID(OUStringToOString(aPictureStreamName, RTL_TEXTENCODING_ASCII_US));
const GraphicObject aGrfObject( aAsciiObjectID );
if( aGrfObject.GetType() != GRAPHIC_NONE )
{
- OUString aStreamName( aGraphicObjectId );
+ OUString aStreamName( aPictureStreamName );
Graphic aGraphic( (Graphic&) aGrfObject.GetGraphic() );
const GfxLink aGfxLink( aGraphic.GetLink() );
OUString aExtension;
@@ -744,7 +742,7 @@ void SvXMLGraphicHelper::ImplInsertGraphicURL( const OUString& rURLStr, sal_uInt
aStreamName += aExtension;
if( mbDirect && !aStreamName.isEmpty() )
- ImplWriteGraphic( aPictureStorageName, aStreamName, aGraphicObjectId, bUseGfxLink );
+ ImplWriteGraphic( aPictureStorageName, aStreamName, aPictureStreamName, bUseGfxLink );
rURLPair.second = sPictures;
rURLPair.second += aStreamName;
@@ -760,7 +758,7 @@ void SvXMLGraphicHelper::ImplInsertGraphicURL( const OUString& rURLStr, sal_uInt
#endif
}
- maURLSet.insert( aURLString );
+ maURLSet.insert( rURLStr );
}
}
diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx
index 923d67babfe6..0e7aeceef7e8 100644
--- a/svx/source/xoutdev/_xoutbmp.cxx
+++ b/svx/source/xoutdev/_xoutbmp.cxx
@@ -145,7 +145,7 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileNam
}
// #i121128# use shortcut to write SVG data in original form (if possible)
- const SvgDataPtr aSvgDataPtr(rGraphic.getSvgData());
+ const SvgDataPtr& aSvgDataPtr(rGraphic.getSvgData());
if(aSvgDataPtr.get()
&& aSvgDataPtr->getSvgDataArrayLength()
diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx
index 694370b6b717..8d8c7ebe9238 100644
--- a/sw/source/core/doc/acmplwrd.cxx
+++ b/sw/source/core/doc/acmplwrd.cxx
@@ -349,10 +349,8 @@ void SwAutoCompleteWord::SetMinWordLen( sal_uInt16 n )
*/
bool SwAutoCompleteWord::GetWordsMatching(const OUString& aMatch, std::vector<OUString>& aWords) const
{
- OUString aStringRoot = aMatch;
-
std::vector<OUString> suggestions;
- m_LookupTree.findSuggestions(aStringRoot, suggestions);
+ m_LookupTree.findSuggestions(aMatch, suggestions);
if (suggestions.empty())
{
diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx
index b07da5a08ab2..23770384b36e 100644
--- a/sw/source/core/doc/dbgoutsw.cxx
+++ b/sw/source/core/doc/dbgoutsw.cxx
@@ -625,7 +625,7 @@ static OUString lcl_dbg_out(const SwNode & rNode)
const SwNumRuleItem & rItem =
static_cast<const SwNumRuleItem &>
(pColl->GetFormatAttr(RES_PARATR_NUMRULE));
- const OUString sNumruleName = rItem.GetValue();
+ const OUString& sNumruleName = rItem.GetValue();
if (!sNumruleName.isEmpty())
{
diff --git a/sw/source/core/doc/doccorr.cxx b/sw/source/core/doc/doccorr.cxx
index 3b88d7d95440..a93cc46acb04 100644
--- a/sw/source/core/doc/doccorr.cxx
+++ b/sw/source/core/doc/doccorr.cxx
@@ -213,7 +213,6 @@ void SwDoc::CorrAbs(
{
SwPosition aStart(*rRange.Start());
SwPosition aEnd(*rRange.End());
- SwPosition aNewPos(rNewPos);
_DelBookmarks( aStart.nNode, aEnd.nNode, nullptr, &aStart.nContent, &aEnd.nContent );
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index fe173a69568a..02df0f3e5605 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -593,7 +593,7 @@ uno::Any SwDoc::Spell( SwPaM& rPaM,
uno::Reference< lang::XComponent > xDoc( GetDocShell()->GetBaseModel(), uno::UNO_QUERY );
// Expand the string:
const ModelToViewHelper aConversionMap(*pNd->GetTextNode());
- OUString aExpandText = aConversionMap.getViewText();
+ const OUString& aExpandText = aConversionMap.getViewText();
// get XFlatParagraph to use...
uno::Reference< text::XFlatParagraph > xFlatPara = new SwXFlatParagraph( *pNd->GetTextNode(), aExpandText, aConversionMap );
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 2eb305a5aa6b..ae2fda623a03 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -612,7 +612,7 @@ OUString SwDoc::GetUniqueTOXBaseName( const SwTOXType& rType,
}
bool bUseChkStr = !sChkStr.isEmpty();
- const OUString aName( rType.GetTypeName() );
+ const OUString& aName( rType.GetTypeName() );
const sal_Int32 nNmLen = aName.getLength();
SwSectionFormats::size_type nNum = 0;
diff --git a/sw/source/core/doc/extinput.cxx b/sw/source/core/doc/extinput.cxx
index 8fdf1767b93a..a681747b11b3 100644
--- a/sw/source/core/doc/extinput.cxx
+++ b/sw/source/core/doc/extinput.cxx
@@ -148,7 +148,7 @@ void SwExtTextInput::SetInputData( const CommandExtTextInputData& rData )
}
SwIndex aIdx( pTNd, nSttCnt );
- const OUString rNewStr = rData.GetText();
+ const OUString& rNewStr = rData.GetText();
if( bIsOverwriteCursor && !sOverwriteText.isEmpty() )
{
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index b6bc8cfc5491..8bedd5747c2c 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -708,8 +708,8 @@ OUString SwNumRule::MakeNumString( const SwNumberTree::tNumberVector & rNumVecto
SVX_NUM_CHAR_SPECIAL != rMyNFormat.GetNumberingType() &&
SVX_NUM_BITMAP != rMyNFormat.GetNumberingType() )
{
- const OUString sPrefix = rMyNFormat.GetPrefix();
- const OUString sSuffix = rMyNFormat.GetSuffix();
+ const OUString& sPrefix = rMyNFormat.GetPrefix();
+ const OUString& sSuffix = rMyNFormat.GetSuffix();
aStr = sPrefix + aStr + sSuffix;
if ( pExtremities )
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 0dff01656efb..392143c44e96 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -1592,8 +1592,7 @@ bool SwContentNode::ResetAttr( const std::vector<sal_uInt16>& rWhichArr )
sal_uInt16 nDel = 0;
if( IsModifyLocked() )
{
- std::vector<sal_uInt16> aClearWhichIds(rWhichArr);
- nDel = ClearItemsFromAttrSet( aClearWhichIds );
+ nDel = ClearItemsFromAttrSet( rWhichArr );
}
else
{
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index d28606e7d0d2..479fcfd722f4 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -197,7 +197,6 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz,
bSavePersData = bRestPersData = true;
OUString sNumRule;
- SwNodeIndex aInsPos( rInsPos );
for( sal_uLong n = 0; n < nSz; n++ )
{
SwNode* pNd = &rDelPos.GetNode();
@@ -241,7 +240,7 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz,
RemoveNode( rDelPos.GetIndex(), 1, false ); // move indices
SwContentNode * pCNd = pNd->GetContentNode();
- rNds.InsertNode( pNd, aInsPos );
+ rNds.InsertNode( pNd, rInsPos );
if( pCNd )
{
diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx
index 185e17e14b7c..85c4283380aa 100644
--- a/sw/source/core/edit/edlingu.cxx
+++ b/sw/source/core/edit/edlingu.cxx
@@ -980,7 +980,7 @@ bool SwEditShell::GetGrammarCorrection(
// Expand the string:
const ModelToViewHelper aConversionMap(*pNode);
- OUString aExpandText = aConversionMap.getViewText();
+ const OUString& aExpandText = aConversionMap.getViewText();
// get XFlatParagraph to use...
uno::Reference< text::XFlatParagraph > xFlatPara = new SwXFlatParagraph( *pNode, aExpandText, aConversionMap );
@@ -1445,7 +1445,7 @@ bool SwSpellIter::SpellSentence(svx::SpellPortions& rPortions, bool bIsGrammarCh
if( bGrammarErrorFound )
{
const ModelToViewHelper aConversionMap(static_cast<SwTextNode&>(pCursor->GetNode()));
- OUString aExpandText = aConversionMap.getViewText();
+ const OUString& aExpandText = aConversionMap.getViewText();
sal_Int32 nSentenceEnd =
aConversionMap.ConvertToViewPosition( aGrammarResult.nBehindEndOfSentencePosition );
// remove trailing space
diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx
index d3cbf43758c1..32b4f8e0a1ce 100644
--- a/sw/source/core/frmedt/fews.cxx
+++ b/sw/source/core/frmedt/fews.cxx
@@ -884,7 +884,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
aEnvOfObj.GetHoriEnvironmentLayoutFrame( *pFrame );
const SwLayoutFrame& rVertEnvironLayFrame =
aEnvOfObj.GetVertEnvironmentLayoutFrame( *pFrame );
- SwRect aHoriEnvironRect( rHoriEnvironLayFrame.Frame() );
+ const SwRect& aHoriEnvironRect( rHoriEnvironLayFrame.Frame() );
SwRect aVertEnvironRect;
if ( _bFollowTextFlow )
{
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 36ab1611372b..4f856fb11545 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -4295,10 +4295,7 @@ void SwFlyFrame::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect,
// OD 06.08.2002 #99657# - paint border before painting background
// paint border
- {
- SwRect aTmp( rRect );
- PaintBorder( aTmp, pPage, rAttrs );
- }
+ PaintBorder( rRect, pPage, rAttrs );
rRenderContext.Pop();
}
@@ -6720,8 +6717,7 @@ void SwPageFrame::RefreshSubsidiary( const SwRect &rRect ) const
{
if ( IS_SUBS || isTableBoundariesEnabled() || IS_SUBS_SECTION || IS_SUBS_FLYS )
{
- SwRect aRect( rRect );
- if ( aRect.HasArea() )
+ if ( rRect.HasArea() )
{
//During paint using the root, the array is controlled from there.
//Otherwise we'll handle it for our self.
@@ -6734,7 +6730,7 @@ void SwPageFrame::RefreshSubsidiary( const SwRect &rRect ) const
bDelSubs = true;
}
- RefreshLaySubsidiary( this, aRect );
+ RefreshLaySubsidiary( this, rRect );
if ( bDelSubs )
{
@@ -7411,15 +7407,14 @@ void SwFrame::Retouch( const SwPageFrame * pPage, const SwRect &rRect ) const
for ( size_t i = 0; i < aRegion.size(); ++i )
{
- SwRect &rRetouche = aRegion[i];
+ const SwRect &rRetouche = aRegion[i];
GetUpper()->PaintBaBo( rRetouche, pPage );
//Hell and Heaven need to be refreshed too.
//To avoid recursion my retouch flag needs to be reset first!
ResetRetouche();
- SwRect aRetouchePart( rRetouche );
- if ( aRetouchePart.HasArea() )
+ if ( rRetouche.HasArea() )
{
const Color aPageBackgrdColor(pPage->GetDrawBackgrdColor());
const IDocumentDrawModelAccess& rIDDMA = pSh->getIDocumentDrawModelAccess();
@@ -7428,11 +7423,11 @@ void SwFrame::Retouch( const SwPageFrame * pPage, const SwRect &rRect ) const
// <--
pSh->Imp()->PaintLayer( rIDDMA.GetHellId(), nullptr,
- aRetouchePart, &aPageBackgrdColor,
+ rRetouche, &aPageBackgrdColor,
pPage->IsRightToLeft(),
&aSwRedirector );
pSh->Imp()->PaintLayer( rIDDMA.GetHeavenId(), nullptr,
- aRetouchePart, &aPageBackgrdColor,
+ rRetouche, &aPageBackgrdColor,
pPage->IsRightToLeft(),
&aSwRedirector );
}
@@ -7441,7 +7436,7 @@ void SwFrame::Retouch( const SwPageFrame * pPage, const SwRect &rRect ) const
//Because we leave all paint areas, we need to refresh the
//subsidiary lines.
- pPage->RefreshSubsidiary( aRetouchePart );
+ pPage->RefreshSubsidiary( rRetouche );
}
}
if ( SwViewShell::IsLstEndAction() )
diff --git a/sw/source/core/swg/SwXMLTextBlocks1.cxx b/sw/source/core/swg/SwXMLTextBlocks1.cxx
index 278b063fd352..1d76da96cc27 100644
--- a/sw/source/core/swg/SwXMLTextBlocks1.cxx
+++ b/sw/source/core/swg/SwXMLTextBlocks1.cxx
@@ -345,8 +345,7 @@ sal_uLong SwXMLTextBlocks::PutBlockText( const OUString& rShort, const OUString&
xBlkRoot->Commit ( );
}
*/
- OUString aFolderName( rPackageName );
- OUString aStreamName = aFolderName + ".xml";
+ OUString aStreamName = rPackageName + ".xml";
uno::Reference< uno::XComponentContext > xContext =
comphelper::getProcessComponentContext();
@@ -356,7 +355,7 @@ sal_uLong SwXMLTextBlocks::PutBlockText( const OUString& rShort, const OUString&
try
{
- xRoot = xBlkRoot->openStorageElement( aFolderName, embed::ElementModes::WRITE );
+ xRoot = xBlkRoot->openStorageElement( rPackageName, embed::ElementModes::WRITE );
uno::Reference < io::XStream > xDocStream = xRoot->openStreamElement( aStreamName,
embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE );
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index 91c6d8d4cba3..ff280299bc0a 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -669,7 +669,7 @@ bool SwTextFly::GetTop( const SwAnchoredObject* _pAnchoredObj,
if ( bInFooterOrHeader )
{
- SwFormatVertOrient aVert( rFrameFormat.GetVertOrient() );
+ const SwFormatVertOrient& aVert( rFrameFormat.GetVertOrient() );
bool bVertPrt = aVert.GetRelationOrient() == text::RelOrientation::PRINT_AREA ||
aVert.GetRelationOrient() == text::RelOrientation::PAGE_PRINT_AREA;
if( bVertPrt )
diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx
index bfb5615f40e1..cedffc9dee73 100644
--- a/sw/source/core/text/xmldump.cxx
+++ b/sw/source/core/text/xmldump.cxx
@@ -161,9 +161,7 @@ class XmlPortionDumper:public SwPortionHandler
xmlTextWriterWriteFormatAttribute( writer,
BAD_CAST( "nType" ),
"%s", getTypeName( nType ) );
- OUString sText( rText );
- OString sText8 =OUStringToOString( sText,
- RTL_TEXTENCODING_UTF8 );
+ OString sText8 = OUStringToOString( rText, RTL_TEXTENCODING_UTF8 );
xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "rText" ),
"%s", sText8.getStr( ) );
diff --git a/sw/source/core/txtnode/txtatr2.cxx b/sw/source/core/txtnode/txtatr2.cxx
index 4bebebc673cb..244e8cd4b58d 100644
--- a/sw/source/core/txtnode/txtatr2.cxx
+++ b/sw/source/core/txtnode/txtatr2.cxx
@@ -253,7 +253,7 @@ SwCharFormat* SwTextRuby::GetCharFormat()
if( !rFormat.GetText().isEmpty() )
{
const SwDoc* pDoc = GetTextNode().GetDoc();
- const OUString rStr = rFormat.GetCharFormatName();
+ const OUString& rStr = rFormat.GetCharFormatName();
const sal_uInt16 nId = rStr.isEmpty()
? static_cast<sal_uInt16>(RES_POOLCHR_RUBYTEXT)
: rFormat.GetCharFormatId();
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index aea49647eb09..8ce9787f4495 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -1264,7 +1264,6 @@ SwRect SwTextFrame::_AutoSpell( const SwContentNode* pActNode, sal_Int32 nActPos
}
// a change of data indicates that at least one word has been modified
- const bool bRedlineChg = (pNode->GetText().getStr() != aOldText.getStr());
sal_Int32 nBegin = 0;
sal_Int32 nEnd = pNode->GetText().getLength();
@@ -1371,13 +1370,7 @@ SwRect SwTextFrame::_AutoSpell( const SwContentNode* pActNode, sal_Int32 nActPos
}
else if( bAddAutoCmpl && rACW.GetMinWordLen() <= rWord.getLength() )
{
- if ( bRedlineChg )
- {
- OUString rNewWord( rWord );
- rACW.InsertWord( rNewWord, *pDoc );
- }
- else
- rACW.InsertWord( rWord, *pDoc );
+ rACW.InsertWord( rWord, *pDoc );
}
}
}
@@ -1488,7 +1481,7 @@ SwRect SwTextFrame::SmartTagScan( SwContentNode* /*pActNode*/, sal_Int32 /*nActP
{
// Expand the string:
const ModelToViewHelper aConversionMap(*pNode /*TODO - replace or expand fields for smart tags?*/);
- OUString aExpandText = aConversionMap.getViewText();
+ const OUString& aExpandText = aConversionMap.getViewText();
// Ownership ov ConversionMap is passed to SwXTextMarkup object!
uno::Reference<text::XTextMarkup> const xTextMarkup =
@@ -2015,7 +2008,7 @@ bool SwTextNode::CountWords( SwDocStat& rStat,
// ConversionMap to expand fields, remove invisible and redline deleted text for scanner
const ModelToViewHelper aConversionMap(*this, ExpandMode::ExpandFields | ExpandMode::ExpandFootnote | ExpandMode::HideInvisible | ExpandMode::HideDeletions);
- OUString aExpandText = aConversionMap.getViewText();
+ const OUString& aExpandText = aConversionMap.getViewText();
if (aExpandText.isEmpty() && !bCountNumbering)
{
diff --git a/sw/source/core/unocore/unoflatpara.cxx b/sw/source/core/unocore/unoflatpara.cxx
index bf288eb39a31..a40c10302bbc 100644
--- a/sw/source/core/unocore/unoflatpara.cxx
+++ b/sw/source/core/unocore/unoflatpara.cxx
@@ -470,7 +470,7 @@ uno::Reference< text::XFlatParagraph > SwXFlatParagraphIterator::getNextPara()
{
// Expand the string:
const ModelToViewHelper aConversionMap(*pRet);
- OUString aExpandText = aConversionMap.getViewText();
+ const OUString& aExpandText = aConversionMap.getViewText();
xRet = new SwXFlatParagraph( *pRet, aExpandText, aConversionMap );
// keep hard references...
@@ -522,7 +522,7 @@ uno::Reference< text::XFlatParagraph > SwXFlatParagraphIterator::getParaAfter(co
{
// Expand the string:
const ModelToViewHelper aConversionMap(*pNextTextNode);
- OUString aExpandText = aConversionMap.getViewText();
+ const OUString& aExpandText = aConversionMap.getViewText();
xRet = new SwXFlatParagraph( *pNextTextNode, aExpandText, aConversionMap );
// keep hard references...
@@ -568,7 +568,7 @@ uno::Reference< text::XFlatParagraph > SwXFlatParagraphIterator::getParaBefore(c
{
// Expand the string:
const ModelToViewHelper aConversionMap(*pPrevTextNode);
- OUString aExpandText = aConversionMap.getViewText();
+ const OUString& aExpandText = aConversionMap.getViewText();
xRet = new SwXFlatParagraph( *pPrevTextNode, aExpandText, aConversionMap );
// keep hard references...
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index 39589aad681e..d21d7813eb93 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -1373,10 +1373,9 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetPropertiesForNumFormat
aPropertyValues.push_back(comphelper::makePropertyValue("Suffix", aUString));
//char style name
- OUString CharStyleName(rCharFormatName);
aUString.clear();
- SwStyleNameMapper::FillProgName( CharStyleName, aUString, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, true );
+ SwStyleNameMapper::FillProgName( rCharFormatName, aUString, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, true );
aPropertyValues.push_back(comphelper::makePropertyValue("CharStyleName", aUString));
//startvalue
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx
index ba607ed812c9..e16bb4d642c9 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -1600,7 +1600,7 @@ static Writer& OutCSS1_SwFormat( Writer& rWrt, const SwFormat& rFormat,
if( USER_FMT & nPoolFormatId )
{
// user templates
- const OUString aNm(rFormat.GetName());
+ const OUString& aNm(rFormat.GetName());
if (aNm == "DD 1" || aNm == "DT 1")
rHTMLWrt.m_nDfltBottomMargin = 0;
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx
index fe8597ea5979..884bd34b24af 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -1679,7 +1679,7 @@ void HTMLEndPosLst::InsertNoScript( const SfxPoolItem& rItem,
case HTML_AUTOFMT_VALUE:
{
const SwFormatAutoFormat& rAutoFormat = static_cast<const SwFormatAutoFormat&>(rItem);
- const std::shared_ptr<SfxItemSet> pSet = rAutoFormat.GetStyleHandle();
+ const std::shared_ptr<SfxItemSet>& pSet = rAutoFormat.GetStyleHandle();
if( pSet.get() )
Insert( *pSet.get(), nStart, nEnd, rFormatInfos, true, bParaAttrs );
}
diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx
index 591a0cebecfc..23ab86eb0ca6 100644
--- a/sw/source/filter/html/htmlforw.cxx
+++ b/sw/source/filter/html/htmlforw.cxx
@@ -641,7 +641,7 @@ const SdrObject *SwHTMLWriter::GetHTMLControl( const SwDrawFrameFormat& rFormat
return nullptr;
const SdrUnoObj& rFormObj = dynamic_cast<const SdrUnoObj&>(*pObj);
- uno::Reference< awt::XControlModel > xControlModel =
+ const uno::Reference< awt::XControlModel >& xControlModel =
rFormObj.GetUnoControlModel();
OSL_ENSURE( xControlModel.is(), "UNO-Control ohne Model" );
@@ -691,7 +691,7 @@ Writer& OutHTML_DrawFrameFormatAsControl( Writer& rWrt,
const SdrUnoObj& rFormObj,
bool bInCntnr )
{
- uno::Reference< awt::XControlModel > xControlModel =
+ const uno::Reference< awt::XControlModel >& xControlModel =
rFormObj.GetUnoControlModel();
OSL_ENSURE( xControlModel.is(), "UNO-Control ohne Model" );
@@ -1280,7 +1280,7 @@ static void AddControl( HTMLControls& rControls,
const SdrUnoObj& rFormObj,
sal_uInt32 nNodeIdx )
{
- uno::Reference< awt::XControlModel > xControlModel =
+ const uno::Reference< awt::XControlModel >& xControlModel =
rFormObj.GetUnoControlModel();
if( !xControlModel.is() )
return;
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 4a4035ada22d..383d7c57671c 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2355,10 +2355,9 @@ bool DocxAttributeOutput::StartURL( const OUString& rUrl, const OUString& rTarge
OUStringToOString( sMark, RTL_TEXTENCODING_UTF8 ).getStr( ) );
}
- OUString sTarget( rTarget );
- if ( !sTarget.isEmpty() )
+ if ( !rTarget.isEmpty() )
{
- OString soTarget = OUStringToOString( sTarget, RTL_TEXTENCODING_UTF8 );
+ OString soTarget = OUStringToOString( rTarget, RTL_TEXTENCODING_UTF8 );
m_pHyperlinkAttrList->add(FSNS( XML_w, XML_tgtFrame ), soTarget.getStr());
}
}
@@ -6060,12 +6059,11 @@ void DocxAttributeOutput::NumberingLevel( sal_uInt8 nLevel,
FSEND );
// text
- OUString aText( rNumberingString );
- OUStringBuffer aBuffer( aText.getLength() + WW8ListManager::nMaxLevel );
+ OUStringBuffer aBuffer( rNumberingString.getLength() + WW8ListManager::nMaxLevel );
- const sal_Unicode *pPrev = aText.getStr();
- const sal_Unicode *pIt = aText.getStr();
- while ( pIt < aText.getStr() + aText.getLength() )
+ const sal_Unicode *pPrev = rNumberingString.getStr();
+ const sal_Unicode *pIt = rNumberingString.getStr();
+ while ( pIt < rNumberingString.getStr() + rNumberingString.getLength() )
{
// convert the level values to %NUMBER form
// (we don't use pNumLvlPos at all)
@@ -6084,7 +6082,7 @@ void DocxAttributeOutput::NumberingLevel( sal_uInt8 nLevel,
aBuffer.append( pPrev, pIt - pPrev );
// If bullet char is empty, set lvlText as empty
- if ( aText.equals ( OUString(sal_Unicode(0)) ) && nNumberingType == SVX_NUM_CHAR_SPECIAL )
+ if ( rNumberingString.equals ( OUString(sal_Unicode(0)) ) && nNumberingType == SVX_NUM_CHAR_SPECIAL )
{
m_pSerializer->singleElementNS( XML_w, XML_lvlText, FSNS( XML_w, XML_val ), "", FSEND );
}
@@ -6271,7 +6269,7 @@ void DocxAttributeOutput::CharEscapement( const SvxEscapementItem& rEscapement )
void DocxAttributeOutput::CharFont( const SvxFontItem& rFont)
{
GetExport().GetId( rFont ); // ensure font info is written to fontTable.xml
- OUString sFontName(rFont.GetFamilyName());
+ const OUString& sFontName(rFont.GetFamilyName());
OString sFontNameUtf8 = OUStringToOString(sFontName, RTL_TEXTENCODING_UTF8);
if (!sFontNameUtf8.isEmpty())
AddToAttrList( m_pFontsAttrList, 2,
@@ -6427,7 +6425,7 @@ void DocxAttributeOutput::CharBackground( const SvxBrushItem& rBrush )
void DocxAttributeOutput::CharFontCJK( const SvxFontItem& rFont )
{
- OUString sFontName(rFont.GetFamilyName());
+ const OUString& sFontName(rFont.GetFamilyName());
OString sFontNameUtf8 = OUStringToOString(sFontName, RTL_TEXTENCODING_UTF8);
AddToAttrList( m_pFontsAttrList, FSNS( XML_w, XML_eastAsia ), sFontNameUtf8.getStr() );
}
@@ -6450,10 +6448,9 @@ void DocxAttributeOutput::CharWeightCJK( const SvxWeightItem& rWeight )
void DocxAttributeOutput::CharFontCTL( const SvxFontItem& rFont )
{
- OUString sFontName(rFont.GetFamilyName());
+ const OUString& sFontName(rFont.GetFamilyName());
OString sFontNameUtf8 = OUStringToOString(sFontName, RTL_TEXTENCODING_UTF8);
AddToAttrList( m_pFontsAttrList, FSNS( XML_w, XML_cs ), sFontNameUtf8.getStr() );
-
}
void DocxAttributeOutput::CharPostureCTL( const SvxPostureItem& rPosture)
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
index 00f50162f861..475e678d9083 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -770,8 +770,8 @@ void DocxSdrExport::writeVMLDrawing(const SdrObject* sdrObj, const SwFrameFormat
m_pImpl->m_pDrawingML->SetFS(m_pImpl->m_pSerializer);
// See WinwordAnchoring::SetAnchoring(), these are not part of the SdrObject, have to be passed around manually.
- SwFormatHoriOrient rHoriOri = (rFrameFormat).GetHoriOrient();
- SwFormatVertOrient rVertOri = (rFrameFormat).GetVertOrient();
+ const SwFormatHoriOrient& rHoriOri = rFrameFormat.GetHoriOrient();
+ const SwFormatVertOrient& rVertOri = rFrameFormat.GetVertOrient();
m_pImpl->m_rExport.VMLExporter().AddSdrObject(*(sdrObj),
rHoriOri.GetHoriOrient(), rVertOri.GetVertOrient(),
rHoriOri.GetRelationOrient(),
@@ -879,7 +879,7 @@ void DocxSdrExport::writeDMLDrawing(const SdrObject* pSdrObject, const SwFrameFo
void DocxSdrExport::Impl::textFrameShadow(const SwFrameFormat& rFrameFormat)
{
- SvxShadowItem aShadowItem = rFrameFormat.GetShadow();
+ const SvxShadowItem& aShadowItem = rFrameFormat.GetShadow();
if (aShadowItem.GetLocation() == SVX_SHADOW_NONE)
return;
@@ -980,7 +980,7 @@ OString lcl_ConvertTransparency(const Color& rColor)
void DocxSdrExport::writeDMLEffectLst(const SwFrameFormat& rFrameFormat)
{
- SvxShadowItem aShadowItem = rFrameFormat.GetShadow();
+ const SvxShadowItem& aShadowItem = rFrameFormat.GetShadow();
// Output effects
if (aShadowItem.GetLocation() != SVX_SHADOW_NONE)
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 20b361a1fb5b..39b4a68fc5ae 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -560,9 +560,8 @@ bool RtfAttributeOutput::StartURL(const OUString& rUrl, const OUString& rTarget)
m_aStyles.append(OOO_STRING_SVTOOLS_RTF_FLDINST);
m_aStyles.append(" HYPERLINK ");
- OUString sURL(rUrl);
m_aStyles.append("\"");
- m_aStyles.append(msfilter::rtfutil::OutString(sURL, m_rExport.m_eCurrentEncoding));
+ m_aStyles.append(msfilter::rtfutil::OutString(rUrl, m_rExport.m_eCurrentEncoding));
m_aStyles.append("\" ");
if (!rTarget.isEmpty())
@@ -1691,7 +1690,7 @@ namespace
void lcl_TextFrameShadow(std::vector< std::pair<OString, OString> >& rFlyProperties, const SwFrameFormat& rFrameFormat)
{
- SvxShadowItem aShadowItem = rFrameFormat.GetShadow();
+ const SvxShadowItem& aShadowItem = rFrameFormat.GetShadow();
if (aShadowItem.GetLocation() == SVX_SHADOW_NONE)
return;
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index 7cb827cf89a5..1ac6ae80164c 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -3174,7 +3174,7 @@ bool SwMSConvertControls::ReadOCXStream( tools::SvRef<SotStorage>& rSrc1,
void SwMSConvertControls::ExportControl(WW8Export &rWW8Wrt, const SdrUnoObj& rFormObj)
{
- uno::Reference< awt::XControlModel > xControlModel =
+ const uno::Reference< awt::XControlModel >& xControlModel =
rFormObj.GetUnoControlModel();
//Why oh lord do we use so many different units ?
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 5717ae4bfd10..39b787907e99 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -429,7 +429,7 @@ void SwWW8AttrIter::OutAttr( sal_Int32 nSwPos, bool bRuby )
if (nWhich == RES_TXTATR_AUTOFMT)
{
const SwFormatAutoFormat& rAutoFormat = static_cast<const SwFormatAutoFormat&>(pHt->GetAttr());
- const std::shared_ptr<SfxItemSet> pSet = rAutoFormat.GetStyleHandle();
+ const std::shared_ptr<SfxItemSet>& pSet = rAutoFormat.GetStyleHandle();
SfxWhichIter aIter( *pSet );
const SfxPoolItem* pItem;
sal_uInt16 nWhichId = aIter.FirstWhich();
@@ -2108,7 +2108,7 @@ void MSWordExportBase::OutputTextNode( const SwTextNode& rNode )
AppendWordBookmark( sBkmkName );
}
- OUString aStr( rNode.GetText() );
+ const OUString& aStr( rNode.GetText() );
sal_Int32 nAktPos = 0;
sal_Int32 const nEnd = aStr.getLength();
@@ -2979,7 +2979,7 @@ void WW8AttributeOutput::OutputFlyFrame_Impl( const ww8::Frame& rFormat, const P
// because we deliver the normal content of the table cell, and no border
// ( Flag was deleted above in aSaveData() )
m_rWW8Export.m_bOutTable = true;
- const OUString aName = rFrameFormat.GetName();
+ const OUString& aName = rFrameFormat.GetName();
m_rWW8Export.StartCommentOutput(aName);
m_rWW8Export.WriteText();
m_rWW8Export.EndCommentOutput(aName);
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 96674f9cdeb5..cf98b68152b0 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -762,7 +762,7 @@ void MSWordExportBase::OutputFormat( const SwFormat& rFormat, bool bPapFormat, b
if ( m_bStyDef && DisallowInheritingOutlineNumbering(rFormat) )
{
SfxItemSet aSet( rFormat.GetAttrSet() );
- SvxLRSpaceItem aLR(
+ const SvxLRSpaceItem& aLR(
ItemGet<SvxLRSpaceItem>(aSet, RES_LR_SPACE));
aSet.Put( aLR );
OutputItemSet( aSet, bPapFormat, bChpFormat,
@@ -1727,7 +1727,7 @@ void WW8Export::OutputField( const SwField* pField, ww::eField eFieldType,
if ( nSubType == REF_SETREFATTR ||
nSubType == REF_BOOKMARK )
{
- const OUString aRefName(rRField.GetSetRefName());
+ const OUString& aRefName(rRField.GetSetRefName());
aLinkStr = GetBookmarkName( nSubType, &aRefName, 0 );
}
else if ( nSubType == REF_FOOTNOTE ||
@@ -2756,7 +2756,7 @@ void AttributeOutputBase::TextField( const SwFormatField& rField )
break;
}
{
- const OUString aRefName(rRField.GetSetRefName());
+ const OUString& aRefName(rRField.GetSetRefName());
sStr = FieldString(eField)
+ MSWordExportBase::GetBookmarkName(nSubType, &aRefName, 0);
}
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index b1d72b99a9a7..d45992f04145 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -5366,7 +5366,7 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss)
{
Graphic aGraphic = vecBulletGrf[nGrfBulletCP]->GetGrf();
SvxBrushItem aBrush(aGraphic, GPOS_AREA, SID_ATTR_BRUSH);
- vcl::Font aFont = numfunc::GetDefBulletFont();
+ const vcl::Font& aFont = numfunc::GetDefBulletFont();
int nHeight = aFont.GetFontHeight() * 12;
Size aPrefSize( aGraphic.GetPrefSize());
if (aPrefSize.Height() * aPrefSize.Width() != 0 )
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index f74e3f2fb441..748021074ee2 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -899,7 +899,7 @@ void SwXMLImport::endDocument()
{
Sequence< beans::PropertyValue > aXFormsSettings;
- const OUString sXFormsSettingsName( GetXMLToken( XML_XFORM_MODEL_SETTINGS ) );
+ const OUString& sXFormsSettingsName( GetXMLToken( XML_XFORM_MODEL_SETTINGS ) );
if ( m_xLateInitSettings.is() && m_xLateInitSettings->hasByName( sXFormsSettingsName ) )
{
OSL_VERIFY( m_xLateInitSettings->getByName( sXFormsSettingsName ) >>= aXFormsSettings );
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index f2aa4a11616e..5043c77d6933 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -1102,10 +1102,9 @@ void SwGlossaryDlg::ResumeShowAutoText()
{
uno::Any aGroup = m_xAutoText->getByName(sGroup);
uno::Reference< XAutoTextGroup > xGroup;
- OUString uShortName(sShortName);
- if((aGroup >>= xGroup) && xGroup->hasByName(uShortName))
+ if((aGroup >>= xGroup) && xGroup->hasByName(sShortName))
{
- uno::Any aEntry(xGroup->getByName(uShortName));
+ uno::Any aEntry(xGroup->getByName(sShortName));
uno::Reference< XAutoTextEntry > xEntry;
aEntry >>= xEntry;
uno::Reference< XTextRange > xRange(xCursor, uno::UNO_QUERY);
diff --git a/sw/source/ui/vba/vbabookmarks.cxx b/sw/source/ui/vba/vbabookmarks.cxx
index 5a295b99c285..ceb5af2f2359 100644
--- a/sw/source/ui/vba/vbabookmarks.cxx
+++ b/sw/source/ui/vba/vbabookmarks.cxx
@@ -164,13 +164,12 @@ SwVbaBookmarks::Add( const OUString& rName, const uno::Any& rRange ) throw (uno:
}
// remove the exist bookmark
- OUString aName = rName;
- if( m_xNameAccess->hasByName( aName ) )
- removeBookmarkByName( aName );
+ if( m_xNameAccess->hasByName( rName ) )
+ removeBookmarkByName( rName );
- addBookmarkByName( mxModel, aName, xTextRange );
+ addBookmarkByName( mxModel, rName, xTextRange );
- return uno::makeAny( uno::Reference< word::XBookmark >( new SwVbaBookmark( getParent(), mxContext, mxModel, aName ) ) );
+ return uno::makeAny( uno::Reference< word::XBookmark >( new SwVbaBookmark( getParent(), mxContext, mxModel, rName ) ) );
}
sal_Int32 SAL_CALL
diff --git a/sw/source/ui/vba/vbafield.cxx b/sw/source/ui/vba/vbafield.cxx
index bbae48f0f564..8bef2126c165 100644
--- a/sw/source/ui/vba/vbafield.cxx
+++ b/sw/source/ui/vba/vbafield.cxx
@@ -468,8 +468,7 @@ uno::Reference< text::XTextField > SwVbaFields::Create_Field_DocProperty( const
if( bCustom )
{
uno::Reference< beans::XPropertySet > xProps( xTextField, uno::UNO_QUERY_THROW );
- OUString sDocPropertyName( aDocProperty );
- xProps->setPropertyValue("Name", uno::makeAny( sDocPropertyName ) );
+ xProps->setPropertyValue("Name", uno::makeAny( aDocProperty ) );
}
return xTextField;
diff --git a/sw/source/ui/vba/vbatablehelper.cxx b/sw/source/ui/vba/vbatablehelper.cxx
index 8ffa710dcba8..7ba020dae59a 100644
--- a/sw/source/ui/vba/vbatablehelper.cxx
+++ b/sw/source/ui/vba/vbatablehelper.cxx
@@ -71,11 +71,10 @@ sal_Int32 SwVbaTableHelper::getTabColumnsMaxCount( ) throw (uno::RuntimeExceptio
return nRet;
}
-sal_Int32 SwVbaTableHelper::getTabRowIndex( const OUString& CellName ) throw (uno::RuntimeException)
+sal_Int32 SwVbaTableHelper::getTabRowIndex( const OUString& rCellName ) throw (uno::RuntimeException)
{
sal_Int32 nRet = 0;
- OUString sCellName(CellName);
- SwTableBox* pBox = const_cast<SwTableBox*>(pTable->GetTableBox( sCellName ));
+ SwTableBox* pBox = const_cast<SwTableBox*>(pTable->GetTableBox( rCellName ));
if( !pBox )
throw uno::RuntimeException();
@@ -86,11 +85,10 @@ sal_Int32 SwVbaTableHelper::getTabRowIndex( const OUString& CellName ) throw (un
return nRet;
}
-sal_Int32 SwVbaTableHelper::getTabColIndex( const OUString& CellName ) throw (uno::RuntimeException)
+sal_Int32 SwVbaTableHelper::getTabColIndex( const OUString& rCellName ) throw (uno::RuntimeException)
{
sal_Int32 nRet = 0;
- OUString sCellName(CellName);
- const SwTableBox* pBox = pTable->GetTableBox( sCellName );
+ const SwTableBox* pBox = pTable->GetTableBox( rCellName );
if( !pBox )
throw uno::RuntimeException();
const SwTableBoxes* pBoxes = &pBox->GetUpper()->GetTabBoxes();
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 92c6112919cc..8b9d6d5341fa 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -717,9 +717,8 @@ bool SwDBManager::GetTableNames(ListBox* pListBox, const OUString& rDBName)
xConnection = pParam->xConnection;
else
{
- OUString sDBName(rDBName);
- if ( !sDBName.isEmpty() )
- xConnection = RegisterConnection( sDBName );
+ if ( !rDBName.isEmpty() )
+ xConnection = RegisterConnection( rDBName );
}
if(xConnection.is())
{
@@ -768,8 +767,7 @@ void SwDBManager::GetColumnNames(ListBox* pListBox,
xConnection = pParam->xConnection;
else
{
- OUString sDBName(rDBName);
- xConnection = RegisterConnection( sDBName );
+ xConnection = RegisterConnection( rDBName );
}
GetColumnNames(pListBox, xConnection, rTableName);
}
@@ -1666,8 +1664,7 @@ sal_uLong SwDBManager::GetColumnFormat( const OUString& rDBName,
}
else
{
- OUString sDBName(rDBName);
- xConnection = RegisterConnection( sDBName );
+ xConnection = RegisterConnection( rDBName );
bDisposeConnection = true;
}
if(bUseMergeData)
@@ -1812,8 +1809,7 @@ sal_Int32 SwDBManager::GetColumnType( const OUString& rDBName,
}
else
{
- OUString sDBName(rDBName);
- xConnection = RegisterConnection( sDBName );
+ xConnection = RegisterConnection( rDBName );
}
if( !xColsSupp.is() )
{
diff --git a/sw/source/uibase/envelp/labelcfg.cxx b/sw/source/uibase/envelp/labelcfg.cxx
index 21bfbf52c16e..72b22f2351dc 100644
--- a/sw/source/uibase/envelp/labelcfg.cxx
+++ b/sw/source/uibase/envelp/labelcfg.cxx
@@ -182,11 +182,10 @@ static std::unique_ptr<SwLabRec> lcl_CreateSwLabRec(const OUString& rType, const
pNewRec->aType = rType;
//all values are contained as colon-separated 1/100 mm values
//except for the continuous flag ('C'/'S') and nCols, nRows (sal_Int32)
- OUString sMeasure(rMeasure);
- sal_uInt16 nTokenCount = comphelper::string::getTokenCount(sMeasure, ';');
+ sal_uInt16 nTokenCount = comphelper::string::getTokenCount(rMeasure, ';');
for(sal_uInt16 i = 0; i < nTokenCount; i++)
{
- OUString sToken(sMeasure.getToken(i, ';' ));
+ OUString sToken(rMeasure.getToken(i, ';' ));
int nVal = sToken.toInt32();
switch(i)
{
diff --git a/sw/source/uibase/fldui/fldmgr.cxx b/sw/source/uibase/fldui/fldmgr.cxx
index f2119ac00909..38b413ad1770 100644
--- a/sw/source/uibase/fldui/fldmgr.cxx
+++ b/sw/source/uibase/fldui/fldmgr.cxx
@@ -1383,7 +1383,6 @@ void SwFieldMgr::UpdateCurField(sal_uLong nFormat,
bool bSetPar2 = true;
bool bSetPar1 = true;
- OUString sPar1( rPar1 );
OUString sPar2( rPar2 );
// Order to Format
@@ -1472,7 +1471,7 @@ void SwFieldMgr::UpdateCurField(sal_uLong nFormat,
for(sal_Int32 nToken = 0; nToken < nTokenCount; nToken++)
pArray[nToken] = sPar2.getToken(nToken, DB_DELIM);
static_cast<SwDropDownField*>(pTmpField)->SetItems(aEntries);
- static_cast<SwDropDownField*>(pTmpField)->SetName(sPar1);
+ static_cast<SwDropDownField*>(pTmpField)->SetName(rPar1);
bSetPar1 = bSetPar2 = false;
}
break;
@@ -1503,8 +1502,8 @@ void SwFieldMgr::UpdateCurField(sal_uLong nFormat,
// setup format before SetPar2 because of NumberFormatter!
pTmpField->ChangeFormat(nFormat);
- if(bSetPar1)
- pTmpField->SetPar1( sPar1 );
+ if( bSetPar1 )
+ pTmpField->SetPar1( rPar1 );
if( bSetPar2 )
pTmpField->SetPar2( sPar2 );
diff --git a/sw/source/uibase/fldui/xfldui.cxx b/sw/source/uibase/fldui/xfldui.cxx
index c7164e5e771d..ef4e713c9a14 100644
--- a/sw/source/uibase/fldui/xfldui.cxx
+++ b/sw/source/uibase/fldui/xfldui.cxx
@@ -55,9 +55,8 @@ bool SwFieldMgr::IsDBNumeric( const OUString& rDBName, const OUString& rTableQry
SwDBManager* pDBManager = pWrtShell ? pWrtShell->GetDBManager() :
::GetActiveView()->GetWrtShell().GetDBManager();
- OUString sSource(rDBName);
Reference< XConnection> xConnection =
- pDBManager->RegisterConnection(sSource);
+ pDBManager->RegisterConnection(rDBName);
if( !xConnection.is() )
return bNumeric;
diff --git a/sw/source/uibase/misc/glosdoc.cxx b/sw/source/uibase/misc/glosdoc.cxx
index fa503d054a33..44426548e9ab 100644
--- a/sw/source/uibase/misc/glosdoc.cxx
+++ b/sw/source/uibase/misc/glosdoc.cxx
@@ -440,7 +440,6 @@ void SwGlossaries::RemoveFileFromList( const OUString& rGroup )
{
if (*it == rGroup)
{
- OUString aUName = rGroup;
{
// tell the UNO AutoTextGroup object that it's not valid anymore
for ( UnoAutoTextGroups::iterator aLoop = m_aGlossaryGroups.begin();
@@ -449,7 +448,7 @@ void SwGlossaries::RemoveFileFromList( const OUString& rGroup )
)
{
Reference< container::XNamed > xNamed( aLoop->get(), UNO_QUERY );
- if ( xNamed.is() && ( xNamed->getName() == aUName ) )
+ if ( xNamed.is() && ( xNamed->getName() == rGroup ) )
{
static_cast< SwXAutoTextGroup* >( xNamed.get() )->Invalidate();
// note that this static_cast works because we know that the array only
diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx
index dcdce1d6a3ed..6928993639ef 100644
--- a/sw/source/uibase/misc/redlndlg.cxx
+++ b/sw/source/uibase/misc/redlndlg.cxx
@@ -467,7 +467,7 @@ void SwRedlineAcceptDlg::Activate()
if (pParent->pTLBParent)
{
// update only comment
- OUString sComment(rRedln.GetComment());
+ const OUString& sComment(rRedln.GetComment());
m_pTable->SetEntryText(sComment.replace('\n', ' '), pParent->pTLBParent, 3);
}
pParent->sComment = rRedln.GetComment();
@@ -757,7 +757,7 @@ void SwRedlineAcceptDlg::InsertParents(sal_uInt16 nStart, sal_uInt16 nEnd)
pRedlineParent = new SwRedlineDataParent;
pRedlineParent->pData = pRedlineData;
pRedlineParent->pNext = nullptr;
- OUString sComment(rRedln.GetComment());
+ const OUString& sComment(rRedln.GetComment());
pRedlineParent->sComment = sComment.replace('\n', ' ');
m_RedlineParents.insert(m_RedlineParents.begin() + i,
std::unique_ptr<SwRedlineDataParent>(pRedlineParent));
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index ffa42b4147ee..e105efb0d442 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1797,7 +1797,7 @@ void SwTextShell::GetState( SfxItemSet &rSet )
uno::Reference <frame::XController> xController = GetView().GetController();
const lang::Locale aLocale( SW_BREAKITER()->GetLocale( GetAppLanguageTag() ) );
- const OUString aApplicationName( rSmartTagMgr.GetApplicationName() );
+ const OUString& aApplicationName( rSmartTagMgr.GetApplicationName() );
const OUString aRangeText = xRange->getString();
const SvxSmartTagItem aItem( nWhich,
diff --git a/sw/source/uibase/sidebar/ThemePanel.cxx b/sw/source/uibase/sidebar/ThemePanel.cxx
index 81bf6a486ae2..2047c2aab5cb 100644
--- a/sw/source/uibase/sidebar/ThemePanel.cxx
+++ b/sw/source/uibase/sidebar/ThemePanel.cxx
@@ -465,7 +465,7 @@ ThemePanel::ThemePanel(vcl::Window* pParent,
{
const svx::ColorSet& rColorSet = aColorSets[i];
- OUString aName = rColorSet.getName();
+ const OUString& aName = rColorSet.getName();
BitmapEx aPreview = GenerateColorPreview(rColorSet);
mpValueSetColors->InsertItem(i, Image(aPreview), aName);
}
diff --git a/sw/source/uibase/uiview/viewprt.cxx b/sw/source/uibase/uiview/viewprt.cxx
index 79228e460ccf..e7855d887172 100644
--- a/sw/source/uibase/uiview/viewprt.cxx
+++ b/sw/source/uibase/uiview/viewprt.cxx
@@ -278,7 +278,7 @@ VclPtr<SfxTabPage> CreatePrintOptionsPage( vcl::Window *pParent,
void SetAppPrintOptions( SwViewShell* pSh, bool bWeb )
{
const IDocumentDeviceAccess& rIDDA = pSh->getIDocumentDeviceAccess();
- SwPrintData aPrtData = rIDDA.getPrintData();
+ const SwPrintData& aPrtData = rIDDA.getPrintData();
if( rIDDA.getPrinter( false ) )
{
diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx
index d7512009a491..7b94a1dad07f 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -1049,7 +1049,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
sal_uInt16 nColumnType = 0;
const SwFrameFormat& rMaster = rDesc.GetMaster();
- SwFormatCol aCol(rMaster.GetCol());
+ const SwFormatCol& aCol(rMaster.GetCol());
const sal_uInt16 nCols = aCol.GetNumCols();
if ( nCols == 0 )
{
diff --git a/sw/source/uibase/uno/unoatxt.cxx b/sw/source/uibase/uno/unoatxt.cxx
index c4ed4e58bcf8..51511337f51a 100644
--- a/sw/source/uibase/uno/unoatxt.cxx
+++ b/sw/source/uibase/uno/unoatxt.cxx
@@ -348,8 +348,8 @@ uno::Reference< text::XAutoTextEntry > SwXAutoTextGroup::insertNewByName(const
throw uno::RuntimeException();
SwTextBlocks* pGlosGroup = pGlossaries ? pGlossaries->GetGroupDoc(m_sGroupName) : nullptr;
- OUString sShortName(aName);
- OUString sLongName(aTitle);
+ const OUString& sShortName(aName);
+ const OUString& sLongName(aTitle);
if (pGlosGroup && !pGlosGroup->GetError())
{
uno::Reference<lang::XUnoTunnel> xRangeTunnel( xTextRange, uno::UNO_QUERY);
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index 5a7d25211b92..31216c5434e3 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3707,62 +3707,61 @@ Any SwXLinkTargetSupplier::getByName(const OUString& rName)
Any aRet;
if(!pxDoc)
throw RuntimeException();
- OUString sToCompare(rName);
OUString sSuffix("|");
- if(sToCompare == sTables)
+ if(rName == sTables)
{
sSuffix += "table";
Reference< XNameAccess > xTables = new SwXLinkNameAccessWrapper(
- pxDoc->getTextTables(), sToCompare, sSuffix );
+ pxDoc->getTextTables(), rName, sSuffix );
Reference< XPropertySet > xRet(xTables, UNO_QUERY);
aRet.setValue(&xRet, cppu::UnoType<XPropertySet>::get());
}
- else if(sToCompare == sFrames)
+ else if(rName == sFrames)
{
sSuffix += "frame";
Reference< XNameAccess > xTables = new SwXLinkNameAccessWrapper(
- pxDoc->getTextFrames(), sToCompare, sSuffix );
+ pxDoc->getTextFrames(), rName, sSuffix );
Reference< XPropertySet > xRet(xTables, UNO_QUERY);
aRet.setValue(&xRet, cppu::UnoType<XPropertySet>::get());
}
- else if(sToCompare == sSections)
+ else if(rName == sSections)
{
sSuffix += "region";
Reference< XNameAccess > xTables = new SwXLinkNameAccessWrapper(
- pxDoc->getTextSections(), sToCompare, sSuffix );
+ pxDoc->getTextSections(), rName, sSuffix );
Reference< XPropertySet > xRet(xTables, UNO_QUERY);
aRet.setValue(&xRet, cppu::UnoType<XPropertySet>::get());
}
- else if(sToCompare == sGraphics)
+ else if(rName == sGraphics)
{
sSuffix += "graphic";
Reference< XNameAccess > xTables = new SwXLinkNameAccessWrapper(
- pxDoc->getGraphicObjects(), sToCompare, sSuffix );
+ pxDoc->getGraphicObjects(), rName, sSuffix );
Reference< XPropertySet > xRet(xTables, UNO_QUERY);
aRet.setValue(&xRet, cppu::UnoType<XPropertySet>::get());
}
- else if(sToCompare == sOLEs)
+ else if(rName == sOLEs)
{
sSuffix += "ole";
Reference< XNameAccess > xTables = new SwXLinkNameAccessWrapper(
- pxDoc->getEmbeddedObjects(), sToCompare, sSuffix );
+ pxDoc->getEmbeddedObjects(), rName, sSuffix );
Reference< XPropertySet > xRet(xTables, UNO_QUERY);
aRet.setValue(&xRet, cppu::UnoType<XPropertySet>::get());
}
- else if(sToCompare == sOutlines)
+ else if(rName == sOutlines)
{
sSuffix += "outline";
Reference< XNameAccess > xTables = new SwXLinkNameAccessWrapper(
- *pxDoc, sToCompare, sSuffix );
+ *pxDoc, rName, sSuffix );
Reference< XPropertySet > xRet(xTables, UNO_QUERY);
aRet.setValue(&xRet, cppu::UnoType<XPropertySet>::get());
}
- else if(sToCompare == sBookmarks)
+ else if(rName == sBookmarks)
{
sSuffix.clear();
Reference< XNameAccess > xBkms = new SwXLinkNameAccessWrapper(
- pxDoc->getBookmarks(), sToCompare, sSuffix );
+ pxDoc->getBookmarks(), rName, sSuffix );
Reference< XPropertySet > xRet(xBkms, UNO_QUERY);
aRet.setValue(&xRet, cppu::UnoType<XPropertySet>::get());
}
@@ -3789,14 +3788,13 @@ Sequence< OUString > SwXLinkTargetSupplier::getElementNames()
sal_Bool SwXLinkTargetSupplier::hasByName(const OUString& rName)
throw( RuntimeException, std::exception )
{
- OUString sToCompare(rName);
- if( sToCompare == sTables ||
- sToCompare == sFrames ||
- sToCompare == sGraphics||
- sToCompare == sOLEs ||
- sToCompare == sSections ||
- sToCompare == sOutlines ||
- sToCompare == sBookmarks )
+ if( rName == sTables ||
+ rName == sFrames ||
+ rName == sGraphics||
+ rName == sOLEs ||
+ rName == sSections ||
+ rName == sOutlines ||
+ rName == sBookmarks )
return sal_True;
return sal_False;
}
diff --git a/sw/source/uibase/uno/unotxvw.cxx b/sw/source/uibase/uno/unotxvw.cxx
index ef20d115eca4..1fe0dcfe0ac8 100644
--- a/sw/source/uibase/uno/unotxvw.cxx
+++ b/sw/source/uibase/uno/unotxvw.cxx
@@ -911,7 +911,7 @@ awt::Point SwXTextViewCursor::getPosition() throw( uno::RuntimeException, std::e
if(m_pView)
{
const SwWrtShell& rSh = m_pView->GetWrtShell();
- const SwRect aCharRect(rSh.GetCharRect());
+ const SwRect& aCharRect(rSh.GetCharRect());
const SwFrameFormat& rMaster = rSh.GetPageDesc( rSh.GetCurPageDesc() ).GetMaster();
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 5ad5c931aa18..476c95e36b30 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -531,7 +531,7 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged)
for(size_t i = 0; i < nMemberCount; ++i)
{
const SwFrameFormat& rTableFormat = pWrtShell->GetTableFrameFormat(i, true);
- const OUString sTableName( rTableFormat.GetName() );
+ const OUString& sTableName( rTableFormat.GetName() );
SwContent* pCnt = new SwContent(this, sTableName,
rTableFormat.FindLayoutRect(false, &aNullPt).Top() );
diff --git a/toolkit/source/awt/stylesettings.cxx b/toolkit/source/awt/stylesettings.cxx
index 69f486f728c8..0aad2ed2e0b1 100644
--- a/toolkit/source/awt/stylesettings.cxx
+++ b/toolkit/source/awt/stylesettings.cxx
@@ -136,7 +136,7 @@ namespace toolkit
{
const vcl::Window* pWindow = i_rData.pOwningWindow->GetWindow();
const AllSettings aAllSettings = pWindow->GetSettings();
- const StyleSettings aStyleSettings = aAllSettings.GetStyleSettings();
+ const StyleSettings& aStyleSettings = aAllSettings.GetStyleSettings();
return (aStyleSettings.*i_pGetter)().GetColor();
}
@@ -154,7 +154,7 @@ namespace toolkit
{
const vcl::Window* pWindow = i_rData.pOwningWindow->GetWindow();
const AllSettings aAllSettings = pWindow->GetSettings();
- const StyleSettings aStyleSettings = aAllSettings.GetStyleSettings();
+ const StyleSettings& aStyleSettings = aAllSettings.GetStyleSettings();
return VCLUnoHelper::CreateFontDescriptor( (aStyleSettings.*i_pGetter)() );
}
@@ -387,7 +387,7 @@ namespace toolkit
StyleMethodGuard aGuard( *m_pData );
const vcl::Window* pWindow = m_pData->pOwningWindow->GetWindow();
const AllSettings aAllSettings = pWindow->GetSettings();
- const StyleSettings aStyleSettings = aAllSettings.GetStyleSettings();
+ const StyleSettings& aStyleSettings = aAllSettings.GetStyleSettings();
return aStyleSettings.GetFaceGradientColor().GetColor();
}
@@ -691,7 +691,7 @@ namespace toolkit
StyleMethodGuard aGuard( *m_pData );
const vcl::Window* pWindow = m_pData->pOwningWindow->GetWindow();
const AllSettings aAllSettings = pWindow->GetSettings();
- const StyleSettings aStyleSettings = aAllSettings.GetStyleSettings();
+ const StyleSettings& aStyleSettings = aAllSettings.GetStyleSettings();
return aStyleSettings.GetSeparatorColor().GetColor();
}
@@ -757,7 +757,7 @@ namespace toolkit
StyleMethodGuard aGuard( *m_pData );
const vcl::Window* pWindow = m_pData->pOwningWindow->GetWindow();
const AllSettings aAllSettings = pWindow->GetSettings();
- const StyleSettings aStyleSettings = aAllSettings.GetStyleSettings();
+ const StyleSettings& aStyleSettings = aAllSettings.GetStyleSettings();
return aStyleSettings.GetHighContrastMode();
}
diff --git a/toolkit/source/awt/vclxfont.cxx b/toolkit/source/awt/vclxfont.cxx
index bea6aed231ac..6504346055b6 100644
--- a/toolkit/source/awt/vclxfont.cxx
+++ b/toolkit/source/awt/vclxfont.cxx
@@ -205,8 +205,7 @@ sal_Bool VCLXFont::hasGlyphs( const OUString& aText )
OutputDevice* pOutDev = VCLUnoHelper::GetOutputDevice( mxDevice );
if ( pOutDev )
{
- OUString aStr( aText );
- if ( pOutDev->HasGlyphs( maFont, aStr ) == -1 )
+ if ( pOutDev->HasGlyphs( maFont, aText ) == -1 )
{
return sal_True;
}
diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx
index 53ccd5184750..bf946a1c8748 100644
--- a/toolkit/source/awt/vclxwindows.cxx
+++ b/toolkit/source/awt/vclxwindows.cxx
@@ -1725,8 +1725,7 @@ void VCLXListBox::selectItem( const OUString& rItemText, sal_Bool bSelect ) thro
VclPtr< ListBox > pBox = GetAs< ListBox >();
if ( pBox )
{
- OUString aItemText( rItemText );
- selectItemPos( pBox->GetEntryPos( aItemText ), bSelect );
+ selectItemPos( pBox->GetEntryPos( rItemText ), bSelect );
}
}
diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx
index 5358cc26e8d2..8be65bfa7a7c 100644
--- a/toolkit/source/controls/controlmodelcontainerbase.cxx
+++ b/toolkit/source/controls/controlmodelcontainerbase.cxx
@@ -566,7 +566,7 @@ void ControlModelContainerBase::insertByName( const OUString& aName, const Any&
Reference< beans::XPropertySetInfo > xPropInfo = xProps.get()->getPropertySetInfo();
- OUString sImageSourceProperty = GetPropertyName( BASEPROPERTY_IMAGEURL );
+ const OUString& sImageSourceProperty = GetPropertyName( BASEPROPERTY_IMAGEURL );
if ( xPropInfo.get()->hasPropertyByName( sImageSourceProperty ) && ImplHasProperty(BASEPROPERTY_DIALOGSOURCEURL) )
{
Any aUrl = xProps.get()->getPropertyValue( sImageSourceProperty );
diff --git a/toolkit/source/controls/eventcontainer.cxx b/toolkit/source/controls/eventcontainer.cxx
index 8b495da657a3..418e3370431f 100644
--- a/toolkit/source/controls/eventcontainer.cxx
+++ b/toolkit/source/controls/eventcontainer.cxx
@@ -87,7 +87,7 @@ sal_Bool NameContainer_Impl::hasByName( const OUString& aName )
void NameContainer_Impl::replaceByName( const OUString& aName, const Any& aElement )
throw(IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException, std::exception)
{
- Type aAnyType = aElement.getValueType();
+ const Type& aAnyType = aElement.getValueType();
if( mType != aAnyType )
throw IllegalArgumentException();
@@ -114,7 +114,7 @@ void NameContainer_Impl::replaceByName( const OUString& aName, const Any& aEleme
void NameContainer_Impl::insertByName( const OUString& aName, const Any& aElement )
throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException, std::exception)
{
- Type aAnyType = aElement.getValueType();
+ const Type& aAnyType = aElement.getValueType();
if( mType != aAnyType )
throw IllegalArgumentException();
diff --git a/toolkit/source/controls/unocontrolbase.cxx b/toolkit/source/controls/unocontrolbase.cxx
index 81732d148cdc..0993d75a7d28 100644
--- a/toolkit/source/controls/unocontrolbase.cxx
+++ b/toolkit/source/controls/unocontrolbase.cxx
@@ -34,7 +34,7 @@ using namespace com::sun::star;
bool UnoControlBase::ImplHasProperty( sal_uInt16 nPropId )
{
- OUString aPropName( GetPropertyName( nPropId ) );
+ const OUString& aPropName( GetPropertyName( nPropId ) );
return ImplHasProperty( aPropName );
}
diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx
index fd711d1cd3c3..57bd9dbe8a20 100644
--- a/toolkit/source/controls/unocontrolmodel.cxx
+++ b/toolkit/source/controls/unocontrolmodel.cxx
@@ -683,7 +683,7 @@ void UnoControlModel::write( const css::uno::Reference< css::io::XObjectOutputSt
OUString sTypeName( rType.getTypeName() );
sMessage += OString( sTypeName.getStr(), sTypeName.getLength(), RTL_TEXTENCODING_ASCII_US );
sMessage += "'.\n(Currently handling property '";
- OUString sPropertyName( GetPropertyName( *it ) );
+ const OUString& sPropertyName( GetPropertyName( *it ) );
sMessage += OString( sPropertyName.getStr(), sPropertyName.getLength(), osl_getThreadTextEncoding() );
sMessage += "'.)";
OSL_FAIL( sMessage.getStr() );
@@ -895,7 +895,7 @@ void UnoControlModel::read( const css::uno::Reference< css::io::XObjectInputStre
OUString sTypeName( pType->getTypeName() );
sMessage += OString( sTypeName.getStr(), sTypeName.getLength(), RTL_TEXTENCODING_ASCII_US );
sMessage += "'.\n(Currently handling property '";
- OUString sPropertyName( GetPropertyName( nPropId ) );
+ const OUString& sPropertyName( GetPropertyName( nPropId ) );
sMessage += OString( sPropertyName.getStr(), sPropertyName.getLength(), osl_getThreadTextEncoding() );
sMessage += "'.)";
OSL_FAIL( sMessage.getStr() );
diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx
index 7fa42777cb70..6597313c7ba0 100644
--- a/toolkit/source/controls/unocontrols.cxx
+++ b/toolkit/source/controls/unocontrols.cxx
@@ -2753,7 +2753,7 @@ void UnoListBoxControl::updateFromModel()
// notify the change of the SelectedItems property, again. While our base class, in updateFromModel,
// already did this, our peer(s) can only legitimately set the selection after they have the string
// item list, which we just notified with the itemListChanged call.
- const OUString sSelectedItemsPropName( GetPropertyName( BASEPROPERTY_SELECTEDITEMS ) );
+ const OUString& sSelectedItemsPropName( GetPropertyName( BASEPROPERTY_SELECTEDITEMS ) );
ImplSetPeerProperty( sSelectedItemsPropName, ImplGetPropertyValue( sSelectedItemsPropName ) );
}
@@ -3773,7 +3773,7 @@ void UnoDateFieldControl::textChanged( const awt::TextEvent& e ) throw(uno::Runt
// also change the text property (#i25106#)
if ( xPeer.is() )
{
- OUString sTextPropertyName = GetPropertyName( BASEPROPERTY_TEXT );
+ const OUString& sTextPropertyName = GetPropertyName( BASEPROPERTY_TEXT );
ImplSetPropertyValue( sTextPropertyName, xPeer->getProperty( sTextPropertyName ), false );
}
@@ -4055,7 +4055,7 @@ void UnoTimeFieldControl::textChanged( const awt::TextEvent& e ) throw(uno::Runt
{
// also change the text property (#i25106#)
uno::Reference< awt::XVclWindowPeer > xPeer( getPeer(), uno::UNO_QUERY );
- OUString sTextPropertyName = GetPropertyName( BASEPROPERTY_TEXT );
+ const OUString& sTextPropertyName = GetPropertyName( BASEPROPERTY_TEXT );
ImplSetPropertyValue( sTextPropertyName, xPeer->getProperty( sTextPropertyName ), false );
// re-calc the Time property
diff --git a/toolkit/source/helper/listenermultiplexer.cxx b/toolkit/source/helper/listenermultiplexer.cxx
index b744864c258c..2cd81736eb72 100644
--- a/toolkit/source/helper/listenermultiplexer.cxx
+++ b/toolkit/source/helper/listenermultiplexer.cxx
@@ -164,7 +164,6 @@ IMPL_TABLISTENERMULTIPLEXER_LISTENERMETHOD_BODY_1PARAM( TabListenerMultiplexer,
void TabListenerMultiplexer::changed( sal_Int32 evt, const css::uno::Sequence< css::beans::NamedValue >& evt2 ) throw(css::uno::RuntimeException, std::exception)
{
sal_Int32 aMulti( evt );
- css::uno::Sequence< css::beans::NamedValue > aMulti2( evt2 );
::comphelper::OInterfaceIteratorHelper2 aIt( *this );
while( aIt.hasMoreElements() )
{
@@ -172,7 +171,7 @@ void TabListenerMultiplexer::changed( sal_Int32 evt, const css::uno::Sequence< c
static_cast< css::awt::XTabListener* >( aIt.next() ) );
try
{
- xListener->changed( aMulti, aMulti2 );
+ xListener->changed( aMulti, evt2 );
}
catch(const css::lang::DisposedException& e)
{
diff --git a/tools/source/datetime/datetimeutils.cxx b/tools/source/datetime/datetimeutils.cxx
index cc34d8e316e2..bc1747e670a1 100644
--- a/tools/source/datetime/datetimeutils.cxx
+++ b/tools/source/datetime/datetimeutils.cxx
@@ -28,7 +28,7 @@ static void lcl_AppendTwoDigits( OStringBuffer &rBuffer, sal_Int32 nNum )
OString DateTimeToOString( const DateTime& rDateTime )
{
- DateTime aInUTC( rDateTime );
+ const DateTime& aInUTC( rDateTime );
// HACK: this is correct according to the spec, but MSOffice believes everybody lives
// in UTC+0 when reading it back
// aInUTC.ConvertToUTC();
diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx
index 50dce422bb68..f91d3cd74713 100644
--- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx
@@ -1835,11 +1835,10 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
uno::Reference< ucb::XContentIdentifier > xNewId
= new ::ucbhelper::ContentIdentifier( aNewURL );
- uno::Reference< ucb::XContentIdentifier > xOldId = xIdentifier;
try
{
- NeonUri sourceURI( xOldId->getContentIdentifier() );
+ NeonUri sourceURI( xIdentifier->getContentIdentifier() );
NeonUri targetURI( xNewId->getContentIdentifier() );
targetURI.SetScheme( sourceURI.GetScheme() );
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 91f620080269..9fda579dda51 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -402,7 +402,7 @@ void Edit::ApplySettings(vcl::RenderContext& rRenderContext)
const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
- vcl::Font aFont = rStyleSettings.GetFieldFont();
+ const vcl::Font& aFont = rStyleSettings.GetFieldFont();
ApplyControlFont(rRenderContext, aFont);
ImplClearLayoutData();
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index 24158a92a6e6..b3e7c8fb0534 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -227,7 +227,6 @@ static OUString ImplPatternReformat( const OUString& rStr,
if (rEditMask.isEmpty())
return rStr;
- OUString aStr = rStr;
OUStringBuffer aOutStr = OUString(rLiteralMask);
sal_Unicode cTempChar;
sal_Unicode cChar;
@@ -239,10 +238,10 @@ static OUString ImplPatternReformat( const OUString& rStr,
while ( i < rEditMask.getLength() )
{
- if ( nStrIndex >= aStr.getLength() )
+ if ( nStrIndex >= rStr.getLength() )
break;
- cChar = aStr[nStrIndex];
+ cChar = rStr[nStrIndex];
cLiteral = rLiteralMask[i];
cMask = rEditMask[i];
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx
index e025f4829aa9..6f0bff7b02a1 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -2039,7 +2039,7 @@ sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString
bool bDone(false);
// do we have a native SVG RenderGraphic, whose data can be written directly?
- const SvgDataPtr aSvgDataPtr(rGraphic.getSvgData());
+ const SvgDataPtr& aSvgDataPtr(rGraphic.getSvgData());
if (aSvgDataPtr.get() && aSvgDataPtr->getSvgDataArrayLength())
{
@@ -2110,12 +2110,11 @@ sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString
osl::Module aLibrary( aPhysicalName );
PFilterCall pFunc = nullptr;
- OUString tmpFilterName = aExternalFilterName;
- if (tmpFilterName == "egi")
+ if (aExternalFilterName == "egi")
pFunc = reinterpret_cast<PFilterCall>(aLibrary.getFunctionSymbol("egiGraphicExport"));
- else if (tmpFilterName == "eps")
+ else if (aExternalFilterName == "eps")
pFunc = reinterpret_cast<PFilterCall>(aLibrary.getFunctionSymbol("epsGraphicExport"));
- else if (tmpFilterName == "eti")
+ else if (aExternalFilterName == "eti")
pFunc = reinterpret_cast<PFilterCall>(aLibrary.getFunctionSymbol("etiGraphicExport"));
// Execute dialog in DLL
#else
diff --git a/vcl/source/filter/wmf/emfwr.cxx b/vcl/source/filter/wmf/emfwr.cxx
index 7f33702e1838..6accc01300d8 100644
--- a/vcl/source/filter/wmf/emfwr.cxx
+++ b/vcl/source/filter/wmf/emfwr.cxx
@@ -504,7 +504,7 @@ void EMFWriter::ImplCheckTextAttr()
if( mbTextChanged && ImplPrepareHandleSelect( mnTextHandle, TEXT_SELECT ) )
{
const vcl::Font& rFont = maVDev->GetFont();
- OUString aFontName( rFont.GetFamilyName() );
+ const OUString& aFontName( rFont.GetFamilyName() );
sal_Int32 nWeight;
sal_uInt16 i;
sal_uInt8 nPitchAndFamily;
diff --git a/vcl/source/font/fontcache.cxx b/vcl/source/font/fontcache.cxx
index b3e8971da2ad..f0e0dbf9ff27 100644
--- a/vcl/source/font/fontcache.cxx
+++ b/vcl/source/font/fontcache.cxx
@@ -109,7 +109,7 @@ ImplFontCache::~ImplFontCache()
LogicalFontInstance* ImplFontCache::GetFontInstance( PhysicalFontCollection* pFontList,
const vcl::Font& rFont, const Size& rSize, float fExactHeight )
{
- OUString aSearchName = rFont.GetFamilyName();
+ const OUString& aSearchName = rFont.GetFamilyName();
// initialize internal font request object
FontSelectPattern aFontSelData( rFont, aSearchName, rSize, fExactHeight );
diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx
index d8abefa6d93c..8244e023c4c2 100644
--- a/vcl/source/gdi/salgdilayout.cxx
+++ b/vcl/source/gdi/salgdilayout.cxx
@@ -758,15 +758,11 @@ bool SalGraphics::DrawTransformedBitmap(
{
if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
- basegfx::B2DPoint aNull(rNull);
- basegfx::B2DPoint aX(rX);
- basegfx::B2DPoint aY(rY);
+ mirror(rNull, pOutDev);
+ mirror(rX, pOutDev);
+ mirror(rY, pOutDev);
- mirror(aNull, pOutDev);
- mirror(aX, pOutDev);
- mirror(aY, pOutDev);
-
- return drawTransformedBitmap(aNull, aX, aY, rSourceBitmap, pAlphaBitmap);
+ return drawTransformedBitmap(rNull, rX, rY, rSourceBitmap, pAlphaBitmap);
}
else
{
diff --git a/vcl/source/outdev/map.cxx b/vcl/source/outdev/map.cxx
index 6b3ce3e0c6da..950a08898852 100644
--- a/vcl/source/outdev/map.cxx
+++ b/vcl/source/outdev/map.cxx
@@ -241,8 +241,8 @@ static void ImplCalcMapResolution( const MapMode& rMapMode,
break;
}
- Fraction aScaleX = rMapMode.GetScaleX();
- Fraction aScaleY = rMapMode.GetScaleY();
+ const Fraction& aScaleX = rMapMode.GetScaleX();
+ const Fraction& aScaleY = rMapMode.GetScaleY();
// set offset according to MapMode
Point aOrigin = rMapMode.GetOrigin();
diff --git a/vcl/source/outdev/mask.cxx b/vcl/source/outdev/mask.cxx
index 5c8409c4c82c..eaa9ac060fa5 100644
--- a/vcl/source/outdev/mask.cxx
+++ b/vcl/source/outdev/mask.cxx
@@ -106,7 +106,7 @@ void OutputDevice::DrawDeviceMask( const Bitmap& rMask, const Color& rMaskColor,
{
assert(!is_double_buffered_window());
- std::shared_ptr<ImpBitmap> xImpBmp = rMask.ImplGetImpBitmap();
+ const std::shared_ptr<ImpBitmap>& xImpBmp = rMask.ImplGetImpBitmap();
if (xImpBmp)
{
SalTwoRect aPosAry(rSrcPtPixel.X(), rSrcPtPixel.Y(), rSrcSizePixel.Width(), rSrcSizePixel.Height(),
diff --git a/vcl/source/outdev/polygon.cxx b/vcl/source/outdev/polygon.cxx
index 1ca1d87b706b..0f36e30a8e00 100644
--- a/vcl/source/outdev/polygon.cxx
+++ b/vcl/source/outdev/polygon.cxx
@@ -112,7 +112,7 @@ void OutputDevice::DrawPolyPolygon( const tools::PolyPolygon& rPolyPoly )
if ( nPoly == 1 )
{
// #100127# Map to DrawPolygon
- tools::Polygon aPoly = rPolyPoly.GetObject( 0 );
+ const tools::Polygon& aPoly = rPolyPoly.GetObject( 0 );
if( aPoly.GetSize() >= 2 )
{
GDIMetaFile* pOldMF = mpMetaFile;
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 4210cc99b55f..d24cbe922565 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -4201,7 +4201,7 @@ void DomainMapper_Impl::CloseFieldCommand()
{
xTextAppend->insertTextContent(xCrsr,xTextContent, sal_True);
}
- const uno::Reference<uno::XInterface> xContent(xTextContent);
+ uno::Reference<uno::XInterface> xContent(xTextContent);
uno::Reference< text::XFormField> xFormField(xContent, uno::UNO_QUERY);
xFormField->setFieldType(aCode);
m_bStartGenericField = true;
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx
index 8c7fae0a0eba..53e5cb3a3c50 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -1819,17 +1819,16 @@ OUString IndexFolderIterator::implGetIndexFolderFromPackage( bool& o_rbTemporary
::osl::FileBase::RC eErr = ::osl::File::createTempFile( nullptr, nullptr, &aTempFileURL );
if( eErr == ::osl::FileBase::E_None )
{
- OUString aTempDirURL = aTempFileURL;
try
{
- m_xSFA->kill( aTempDirURL );
+ m_xSFA->kill( aTempFileURL );
}
catch (const Exception &)
{
}
- m_xSFA->createFolder( aTempDirURL );
+ m_xSFA->createFolder( aTempFileURL );
- aZipDir = aTempDirURL;
+ aZipDir = aTempFileURL;
o_rbTemporary = true;
}
}
diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx
index 3dffd29d251d..53b56c71d358 100644
--- a/xmlhelp/source/treeview/tvread.cxx
+++ b/xmlhelp/source/treeview/tvread.cxx
@@ -312,13 +312,12 @@ TVRead::getByHierarchicalName( const OUString& aName )
RuntimeException, std::exception )
{
sal_Int32 idx;
- OUString name( aName );
- if( ( idx = name.indexOf( '/' ) ) != -1 &&
- name.copy( 0,idx ) == "Children" )
- return Children->getByHierarchicalName( name.copy( 1 + idx ) );
+ if( ( idx = aName.indexOf( '/' ) ) != -1 &&
+ aName.copy( 0,idx ) == "Children" )
+ return Children->getByHierarchicalName( aName.copy( 1 + idx ) );
- return getByName( name );
+ return getByName( aName );
}
sal_Bool SAL_CALL
@@ -326,13 +325,12 @@ TVRead::hasByHierarchicalName( const OUString& aName )
throw( RuntimeException, std::exception )
{
sal_Int32 idx;
- OUString name( aName );
- if( ( idx = name.indexOf( '/' ) ) != -1 &&
- name.copy( 0,idx ) == "Children" )
- return Children->hasByHierarchicalName( name.copy( 1 + idx ) );
+ if( ( idx = aName.indexOf( '/' ) ) != -1 &&
+ aName.copy( 0,idx ) == "Children" )
+ return Children->hasByHierarchicalName( aName.copy( 1 + idx ) );
- return hasByName( name );
+ return hasByName( aName );
}
/**************************************************************************/
@@ -573,20 +571,19 @@ TVChildTarget::getByHierarchicalName( const OUString& aName )
RuntimeException, std::exception )
{
sal_Int32 idx;
- OUString name( aName );
- if( ( idx = name.indexOf( '/' ) ) != -1 )
+ if( ( idx = aName.indexOf( '/' ) ) != -1 )
{
- OUString num( name.getStr()+2,idx-4 );
+ OUString num( aName.getStr()+2,idx-4 );
sal_Int32 pref = num.toInt32() - 1;
if( pref < 0 || Elements.size() <= sal_uInt32( pref ) )
throw NoSuchElementException();
- return Elements[pref]->getByHierarchicalName( name.copy( 1 + idx ) );
+ return Elements[pref]->getByHierarchicalName( aName.copy( 1 + idx ) );
}
else
- return getByName( name );
+ return getByName( aName );
}
sal_Bool SAL_CALL
@@ -594,19 +591,18 @@ TVChildTarget::hasByHierarchicalName( const OUString& aName )
throw( RuntimeException, std::exception )
{
sal_Int32 idx;
- OUString name( aName );
- if( ( idx = name.indexOf( '/' ) ) != -1 )
+ if( ( idx = aName.indexOf( '/' ) ) != -1 )
{
- OUString num( name.getStr()+2,idx-4 );
+ OUString num( aName.getStr()+2,idx-4 );
sal_Int32 pref = num.toInt32() - 1;
if( pref < 0 || Elements.size() <= sal_uInt32( pref ) )
return false;
- return Elements[pref]->hasByHierarchicalName( name.copy( 1 + idx ) );
+ return Elements[pref]->hasByHierarchicalName( aName.copy( 1 + idx ) );
}
else
- return hasByName( name );
+ return hasByName( aName );
}
ConfigData TVChildTarget::init( const Reference< XComponentContext >& xContext )
diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx
index 4161ba834bb6..abc91100c06d 100644
--- a/xmloff/source/chart/SchXMLChartContext.cxx
+++ b/xmloff/source/chart/SchXMLChartContext.cxx
@@ -332,7 +332,7 @@ void SchXMLChartContext::StartElement( const uno::Reference< xml::sax::XAttribut
{
SAL_WARN("xmloff.chart", "need a charttype to create a diagram" );
//set a fallback value:
- OUString aChartClass_Bar( GetXMLToken(XML_BAR ) );
+ const OUString& aChartClass_Bar( GetXMLToken(XML_BAR ) );
aOldChartTypeName = SchXMLTools::GetChartTypeByClassName( aChartClass_Bar, true /* bUseOldNames */ );
maChartTypeServiceName = SchXMLTools::GetChartTypeByClassName( aChartClass_Bar, false /* bUseOldNames */ );
}
diff --git a/xmloff/source/core/nmspmap.cxx b/xmloff/source/core/nmspmap.cxx
index f75d65f3c26e..8392c2016008 100644
--- a/xmloff/source/core/nmspmap.cxx
+++ b/xmloff/source/core/nmspmap.cxx
@@ -455,10 +455,10 @@ bool SvXMLNamespaceMap::NormalizeW3URI( OUString& rName )
// - xforms
bool bSuccess = false;
- const OUString sURIPrefix = GetXMLToken( XML_URI_W3_PREFIX );
+ const OUString& sURIPrefix = GetXMLToken( XML_URI_W3_PREFIX );
if( rName.startsWith( sURIPrefix ) )
{
- const OUString sURISuffix = GetXMLToken( XML_URI_XFORMS_SUFFIX );
+ const OUString& sURISuffix = GetXMLToken( XML_URI_XFORMS_SUFFIX );
sal_Int32 nCompareFrom = rName.getLength() - sURISuffix.getLength();
if( rName.copy( nCompareFrom ).equals( sURISuffix ) )
{
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 6586867f0cbc..44cfd31a4048 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -1128,7 +1128,7 @@ void SvXMLExport::ImplExportSettings()
if ( !settings->aSettings.getLength() )
continue;
- OUString sSettingsName( GetXMLToken( settings->eGroupName ) );
+ const OUString& sSettingsName( GetXMLToken( settings->eGroupName ) );
OUString sQName = GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_OOO, sSettingsName );
aSettingsExportHelper.exportAllSettings( settings->aSettings, sQName );
}
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index 513f6100b8ef..d8358a7bf1a5 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -1550,10 +1550,10 @@ XMLEventImportHelper& SvXMLImport::GetEventImport()
// construct event helper and register StarBasic handler and standard
// event tables
mpEventImportHelper = new XMLEventImportHelper();
- OUString sStarBasic(GetXMLToken(XML_STARBASIC));
+ const OUString& sStarBasic(GetXMLToken(XML_STARBASIC));
mpEventImportHelper->RegisterFactory(sStarBasic,
new XMLStarBasicContextFactory());
- OUString sScript(GetXMLToken(XML_SCRIPT));
+ const OUString& sScript(GetXMLToken(XML_SCRIPT));
mpEventImportHelper->RegisterFactory(sScript,
new XMLScriptContextFactory());
mpEventImportHelper->AddTranslationTable(aStandardEventTable);
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index 976cf1afd8dc..392dcf0d656b 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -1733,7 +1733,7 @@ void XMLShapeExport::ImpExportEvents( const uno::Reference< drawing::XShape >& x
if( nFound & FOUND_LIBRARY )
{
- OUString sLocation( GetXMLToken(
+ const OUString& sLocation( GetXMLToken(
(aStrLibrary.equalsIgnoreAsciiCase("StarOffice") ||
aStrLibrary.equalsIgnoreAsciiCase("application") ) ? XML_APPLICATION
: XML_DOCUMENT ) );
diff --git a/xmloff/source/style/GradientStyle.cxx b/xmloff/source/style/GradientStyle.cxx
index 141fcc901a3c..fd72968f93a3 100644
--- a/xmloff/source/style/GradientStyle.cxx
+++ b/xmloff/source/style/GradientStyle.cxx
@@ -217,13 +217,12 @@ void XMLGradientStyleExport::exportXML(
{
// Name
bool bEncoded = false;
- OUString aStrName( rStrName );
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME,
- rExport.EncodeStyleName( aStrName,
+ rExport.EncodeStyleName( rStrName,
&bEncoded ) );
if( bEncoded )
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DISPLAY_NAME,
- aStrName );
+ rStrName );
aStrValue = aOut.makeStringAndClear();
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_STYLE, aStrValue );
diff --git a/xmloff/source/style/MarkerStyle.cxx b/xmloff/source/style/MarkerStyle.cxx
index bd0f35b59b29..e109c78581dc 100644
--- a/xmloff/source/style/MarkerStyle.cxx
+++ b/xmloff/source/style/MarkerStyle.cxx
@@ -162,13 +162,12 @@ void XMLMarkerStyleExport::exportXML(
{
// Name
bool bEncoded(false);
- OUString aStrName( rStrName );
- rExport.AddAttribute(XML_NAMESPACE_DRAW, XML_NAME, rExport.EncodeStyleName( aStrName, &bEncoded ) );
+ rExport.AddAttribute(XML_NAMESPACE_DRAW, XML_NAME, rExport.EncodeStyleName( rStrName, &bEncoded ) );
if( bEncoded )
{
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DISPLAY_NAME, aStrName );
+ rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DISPLAY_NAME, rStrName );
}
const basegfx::B2DPolyPolygon aPolyPolygon(
diff --git a/xmloff/source/style/xmlaustp.cxx b/xmloff/source/style/xmlaustp.cxx
index 582d541c7998..493d46913733 100644
--- a/xmloff/source/style/xmlaustp.cxx
+++ b/xmloff/source/style/xmlaustp.cxx
@@ -69,7 +69,7 @@ void SvXMLAutoStylePoolP::exportStyleAttributes(
{
if ( XML_STYLE_FAMILY_CONTROL_ID == nFamily )
{ // it's a control-related style
- rtl::Reference< XMLPropertySetMapper > aPropertyMapper = rPropExp.getPropertySetMapper();
+ const rtl::Reference< XMLPropertySetMapper >& aPropertyMapper = rPropExp.getPropertySetMapper();
for ( vector< XMLPropertyState >::const_iterator pProp = rProperties.begin();
pProp != rProperties.end();
@@ -87,7 +87,7 @@ void SvXMLAutoStylePoolP::exportStyleAttributes(
if( (XML_STYLE_FAMILY_SD_GRAPHICS_ID == nFamily) || (XML_STYLE_FAMILY_SD_PRESENTATION_ID == nFamily) )
{ // it's a graphics style
- rtl::Reference< XMLPropertySetMapper > aPropertyMapper = rPropExp.getPropertySetMapper();
+ const rtl::Reference< XMLPropertySetMapper >& aPropertyMapper = rPropExp.getPropertySetMapper();
assert(aPropertyMapper.is());
bool bFoundControlShapeDataStyle = false;
@@ -150,7 +150,7 @@ void SvXMLAutoStylePoolP::exportStyleAttributes(
{
if (pProp->mnIndex > -1)
{
- rtl::Reference< XMLPropertySetMapper > aPropMapper = rPropExp.getPropertySetMapper();
+ const rtl::Reference< XMLPropertySetMapper >& aPropMapper = rPropExp.getPropertySetMapper();
sal_Int32 nIndex = pProp->mnIndex;
sal_Int16 nContextID = aPropMapper->GetEntryContextId( nIndex );
switch( nContextID )
@@ -194,7 +194,7 @@ void SvXMLAutoStylePoolP::exportStyleContent(
bool bFooterStartIndex(false);
bool bFooterEndIndex(false);
- rtl::Reference< XMLPropertySetMapper > aPropMapper = rPropExp.getPropertySetMapper();
+ const rtl::Reference< XMLPropertySetMapper >& aPropMapper = rPropExp.getPropertySetMapper();
sal_Int32 nIndex(0);
while(nIndex < aPropMapper->GetEntryCount())
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index e032bdd770f6..0e6704220f24 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -1056,7 +1056,7 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl(
{
OUString sValue( rValue );
sValue = sValue.trim();
- const OUString aRotate(GetXMLToken(XML_ROTATE));
+ const OUString& aRotate(GetXMLToken(XML_ROTATE));
const sal_Int32 nRotateLen(aRotate.getLength());
sal_Int32 nLen = sValue.getLength();
if( nLen >= nRotateLen+3 &&
diff --git a/xmloff/source/text/XMLTextListItemContext.cxx b/xmloff/source/text/XMLTextListItemContext.cxx
index d95fca4a0794..a255ecf88410 100644
--- a/xmloff/source/text/XMLTextListItemContext.cxx
+++ b/xmloff/source/text/XMLTextListItemContext.cxx
@@ -70,7 +70,7 @@ XMLTextListItemContext::XMLTextListItemContext(
else if ( nPrefix == XML_NAMESPACE_TEXT &&
IsXMLToken( aLocalName, XML_STYLE_OVERRIDE ) )
{
- const OUString sListStyleOverrideName = rValue;
+ const OUString& sListStyleOverrideName = rValue;
if ( !sListStyleOverrideName.isEmpty() )
{
OUString sDisplayStyleName(
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index c7e03bbbeae3..9b4ff7354ae3 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -382,7 +382,7 @@ void FieldParamExporter::Export()
for(const OUString* pCurrent = vParameters.begin(); pCurrent != vParameters.end(); ++pCurrent)
{
const Any aValue = m_xFieldParams->getByName(*pCurrent);
- const Type aValueType = aValue.getValueType();
+ const Type& aValueType = aValue.getValueType();
if(aValueType == aStringType)
{
OUString sValue;
@@ -855,10 +855,10 @@ void XMLTextParagraphExport::exportListChange(
if ( nListLevelsToBeOpened > 0 )
{
- const OUString sListStyleName( rNextInfo.GetNumRulesName() );
+ const OUString& sListStyleName( rNextInfo.GetNumRulesName() );
// Currently only the text documents support <ListId>.
// Thus, for other document types <sListId> is empty.
- const OUString sListId( rNextInfo.GetListId() );
+ const OUString& sListId( rNextInfo.GetListId() );
bool bExportListStyle( true );
bool bRestartNumberingAtContinuedList( false );
sal_Int32 nRestartValueForContinuedList( -1 );
@@ -1093,7 +1093,7 @@ void XMLTextParagraphExport::exportListChange(
if ( ( GetExport().getExportFlags() & SvXMLExportFlags::OASIS ) &&
GetExport().getDefaultVersion() >= SvtSaveOptions::ODFVER_012 )
{
- const OUString sListStyleName( rNextInfo.GetNumRulesName() );
+ const OUString& sListStyleName( rNextInfo.GetNumRulesName() );
if ( !mpTextListsHelper->EqualsToTopListStyleOnStack( sListStyleName ) )
{
GetExport().AddAttribute( XML_NAMESPACE_TEXT,
diff --git a/xmloff/source/transform/DlgOASISTContext.cxx b/xmloff/source/transform/DlgOASISTContext.cxx
index af17e79a2ae0..0397c3746cb7 100644
--- a/xmloff/source/transform/DlgOASISTContext.cxx
+++ b/xmloff/source/transform/DlgOASISTContext.cxx
@@ -77,11 +77,9 @@ void XMLDlgOASISTransformerContext::StartElement(
{
case XML_ATACTION_DLG_BORDER:
{
- OUString aAttrValue( rAttrValue );
-
- if ( !aAttrValue.equals( GetXMLToken( XML_NONE ) ) &&
- !aAttrValue.equals( GetXMLToken( XML_SIMPLE ) ) &&
- !aAttrValue.equals( GetXMLToken( XML_3D ) ) )
+ if ( !rAttrValue.equals( GetXMLToken( XML_NONE ) ) &&
+ !rAttrValue.equals( GetXMLToken( XML_SIMPLE ) ) &&
+ !rAttrValue.equals( GetXMLToken( XML_3D ) ) )
{
pMutableAttrList->SetValueByIndex(
i, GetXMLToken( XML_NONE ) );
diff --git a/xmloff/source/transform/EventOASISTContext.cxx b/xmloff/source/transform/EventOASISTContext.cxx
index cb529c34f6da..7781631123e6 100644
--- a/xmloff/source/transform/EventOASISTContext.cxx
+++ b/xmloff/source/transform/EventOASISTContext.cxx
@@ -138,7 +138,7 @@ bool ParseURL(
if ( xUrl.is() )
{
- OUString aLanguageKey = GetXMLToken( XML_LANGUAGE );
+ const OUString& aLanguageKey = GetXMLToken( XML_LANGUAGE );
if ( xUrl.is() && xUrl->hasParameter( aLanguageKey ) )
{
OUString aLanguage = xUrl->getParameter( aLanguageKey );
@@ -150,7 +150,7 @@ bool ParseURL(
OUString tmp =
xUrl->getParameter( GetXMLToken( XML_LOCATION ) );
- OUString doc = GetXMLToken( XML_DOCUMENT );
+ const OUString& doc = GetXMLToken( XML_DOCUMENT );
if ( tmp.equalsIgnoreAsciiCase( doc ) )
{
diff --git a/xmloff/source/transform/EventOOoTContext.cxx b/xmloff/source/transform/EventOOoTContext.cxx
index 7abb9977a369..cc7b17365247 100644
--- a/xmloff/source/transform/EventOOoTContext.cxx
+++ b/xmloff/source/transform/EventOOoTContext.cxx
@@ -116,7 +116,7 @@ sal_uInt16 XMLEventOOoTransformerContext::GetEventName(
OUString& rNewName,
XMLTransformerOOoEventMap_Impl& rMap )
{
- XMLTransformerOOoEventMap_Impl::key_type aKey( rName );
+ const XMLTransformerOOoEventMap_Impl::key_type& aKey( rName );
XMLTransformerOOoEventMap_Impl::const_iterator aIter = rMap.find( aKey );
if( aIter == rMap.end() )
{
diff --git a/xmloff/source/transform/OOo2Oasis.cxx b/xmloff/source/transform/OOo2Oasis.cxx
index d444f3c938e3..ed4ff6db9cc9 100644
--- a/xmloff/source/transform/OOo2Oasis.cxx
+++ b/xmloff/source/transform/OOo2Oasis.cxx
@@ -1416,11 +1416,10 @@ XMLTrackedChangesOOoTContext_Impl::~XMLTrackedChangesOOoTContext_Impl()
void XMLTrackedChangesOOoTContext_Impl::StartElement(
const Reference< XAttributeList >& rAttrList )
{
- Reference< XAttributeList > xAttrList( rAttrList );
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
+ sal_Int16 nAttrCount = rAttrList.is() ? rAttrList->getLength() : 0;
for( sal_Int16 i=0; i < nAttrCount; i++ )
{
- const OUString& rAttrName = xAttrList->getNameByIndex( i );
+ const OUString& rAttrName = rAttrList->getNameByIndex( i );
OUString aLocalName;
sal_uInt16 nPrefix =
GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName,
@@ -1441,7 +1440,7 @@ void XMLTrackedChangesOOoTContext_Impl::StartElement(
{
Sequence < sal_Int8 > aKey;
::sax::Converter::decodeBase64( aKey,
- xAttrList->getValueByIndex( i ) );
+ rAttrList->getValueByIndex( i ) );
rPropSet->setPropertyValue( aPropName, makeAny( aKey ) );
}
else
@@ -1452,7 +1451,7 @@ void XMLTrackedChangesOOoTContext_Impl::StartElement(
break;
}
}
- XMLTransformerContext::StartElement( xAttrList );
+ XMLTransformerContext::StartElement( rAttrList );
}
class XMLTableOOoTransformerContext_Impl : public XMLTransformerContext
diff --git a/xmloff/source/transform/Oasis2OOo.cxx b/xmloff/source/transform/Oasis2OOo.cxx
index e23b5e128228..03b99f35f704 100644
--- a/xmloff/source/transform/Oasis2OOo.cxx
+++ b/xmloff/source/transform/Oasis2OOo.cxx
@@ -1459,12 +1459,10 @@ XMLConfigItemTContext_Impl::~XMLConfigItemTContext_Impl()
void XMLConfigItemTContext_Impl::StartElement(
const Reference< XAttributeList >& rAttrList )
{
- Reference< XAttributeList > xAttrList( rAttrList );
-
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
+ sal_Int16 nAttrCount = rAttrList.is() ? rAttrList->getLength() : 0;
for( sal_Int16 i=0; i < nAttrCount; i++ )
{
- const OUString& rAttrName = xAttrList->getNameByIndex( i );
+ const OUString& rAttrName = rAttrList->getNameByIndex( i );
OUString aLocalName;
sal_uInt16 nPrefix =
GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName,
@@ -1473,7 +1471,7 @@ void XMLConfigItemTContext_Impl::StartElement(
{
if ( IsXMLToken( aLocalName, XML_NAME ) )
{
- const OUString& rValue = xAttrList->getValueByIndex( i );
+ const OUString& rValue = rAttrList->getValueByIndex( i );
if( rValue == "RedlineProtectionKey" )
m_bIsRedlineProtectionKey = true;
else if( rValue == "CursorPositionX" )
@@ -1486,7 +1484,7 @@ void XMLConfigItemTContext_Impl::StartElement(
}
}
- XMLTransformerContext::StartElement( xAttrList );
+ XMLTransformerContext::StartElement( rAttrList );
}
void XMLConfigItemTContext_Impl::Characters( const OUString& rChars )
diff --git a/xmloff/source/transform/PersAttrListTContext.cxx b/xmloff/source/transform/PersAttrListTContext.cxx
index 3f708fd482ae..21bd235c3a30 100644
--- a/xmloff/source/transform/PersAttrListTContext.cxx
+++ b/xmloff/source/transform/PersAttrListTContext.cxx
@@ -34,7 +34,7 @@ void XMLPersAttrListTContext::AddAttribute(
::xmloff::token::XMLTokenEnum eAToken,
::xmloff::token::XMLTokenEnum eVToken )
{
- OUString aAttrValue( ::xmloff::token::GetXMLToken( eVToken ) );
+ const OUString& aAttrValue( ::xmloff::token::GetXMLToken( eVToken ) );
AddAttribute( nAPrefix, eAToken, aAttrValue );
}
@@ -45,7 +45,7 @@ void XMLPersAttrListTContext::AddAttribute(
{
OUString aAttrQName( GetTransformer().GetNamespaceMap().GetQNameByKey(
nAPrefix, ::xmloff::token::GetXMLToken( eAToken ) ) );
- OUString aAttrValue( rValue );
+ const OUString& aAttrValue( rValue );
XMLMutableAttributeList *pMutableAttrList;
if( m_xAttrList.is() )
diff --git a/xmloff/source/transform/StyleOASISTContext.cxx b/xmloff/source/transform/StyleOASISTContext.cxx
index 060336798936..65f72b3562a2 100644
--- a/xmloff/source/transform/StyleOASISTContext.cxx
+++ b/xmloff/source/transform/StyleOASISTContext.cxx
@@ -263,7 +263,7 @@ void XMLPropertiesTContext_Impl::StartElement(
}
else
{
- OUString aAttrValue( GetXMLToken( bWordMode
+ const OUString& aAttrValue( GetXMLToken( bWordMode
? XML_FALSE
: XML_TRUE ) );
pAttrList->AddAttribute( aAttrQName, aAttrValue );
@@ -272,7 +272,7 @@ void XMLPropertiesTContext_Impl::StartElement(
break;
case XML_OPTACTION_KEEP_WITH_NEXT:
{
- OUString aAttrValue( GetXMLToken(
+ const OUString& aAttrValue( GetXMLToken(
IsXMLToken( rAttrValue, XML_ALWAYS )
? XML_TRUE
: XML_FALSE) );
@@ -517,7 +517,7 @@ void XMLPropertiesTContext_Impl::StartElement(
pAttrList->AddAttribute( rAttrName, aNewAttrValue );
// create old draw:mirror for drawing graphic objects
- OUString aAttrValue( GetXMLToken( IsXMLToken( rAttrValue, XML_HORIZONTAL ) ? XML_TRUE : XML_FALSE ) );
+ const OUString& aAttrValue( GetXMLToken( IsXMLToken( rAttrValue, XML_HORIZONTAL ) ? XML_TRUE : XML_FALSE ) );
pAttrList->AddAttribute( GetTransformer().GetNamespaceMap().GetQNameByKey(
XML_NAMESPACE_DRAW,
GetXMLToken( XML_MIRROR )), aAttrValue );
diff --git a/xmloff/source/transform/StyleOOoTContext.cxx b/xmloff/source/transform/StyleOOoTContext.cxx
index 4f30727767d6..a7321722ee96 100644
--- a/xmloff/source/transform/StyleOOoTContext.cxx
+++ b/xmloff/source/transform/StyleOOoTContext.cxx
@@ -392,8 +392,6 @@ rtl::Reference<XMLTransformerContext> XMLPropertiesOOoTContext_Impl::CreateChild
void XMLPropertiesOOoTContext_Impl::StartElement(
const Reference< XAttributeList >& rAttrList )
{
- Reference< XAttributeList > xAttrList( rAttrList );
-
XMLTypedPropertiesOOoTContext_Impl * pIntervalMinorDivisorContext = nullptr;
double fIntervalMajor = 0.0;
double fIntervalMinor = 0.0;
@@ -412,11 +410,11 @@ void XMLPropertiesOOoTContext_Impl::StartElement(
OUString aDrawMirrorAttrValue;
XMLTypedPropertiesOOoTContext_Impl* pMirrorContext( nullptr );
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
+ sal_Int16 nAttrCount = rAttrList.is() ? rAttrList->getLength() : 0;
for( sal_Int16 i=0; i < nAttrCount; i++ )
{
- const OUString sAttrName = xAttrList->getNameByIndex( i );
- const OUString sAttrValue = xAttrList->getValueByIndex( i );
+ const OUString sAttrName = rAttrList->getNameByIndex( i );
+ const OUString sAttrValue = rAttrList->getValueByIndex( i );
OUString aLocalName;
sal_uInt16 nPrefix =
GetTransformer().GetNamespaceMap().GetKeyByAttrName( sAttrName,
@@ -506,7 +504,7 @@ void XMLPropertiesOOoTContext_Impl::StartElement(
break;
case XML_PTACTION_LINE_MODE:
{
- OUString aAttrValue( GetXMLToken(
+ const OUString& aAttrValue( GetXMLToken(
IsXMLToken( sAttrValue, XML_TRUE )
? XML_CONTINUOUS
: XML_SKIP_WHITE_SPACE) );
@@ -525,7 +523,7 @@ void XMLPropertiesOOoTContext_Impl::StartElement(
break;
case XML_PTACTION_KEEP_WITH_NEXT:
{
- OUString aAttrValue( GetXMLToken(
+ const OUString& aAttrValue( GetXMLToken(
IsXMLToken( sAttrValue, XML_TRUE )
? XML_ALWAYS
: XML_AUTO) );
diff --git a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx
index b05f7c89a50f..5f525caf5b5f 100644
--- a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx
+++ b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx
@@ -748,20 +748,19 @@ void SAL_CALL XMLDocumentWrapper_XmlSecImpl::getTree( const cssu::Reference< css
m_pCurrentElement = m_pRootElement;
m_nCurrentPosition = NODEPOSITION_STARTELEMENT;
- cssu::Reference< cssxs::XDocumentHandler > xHandler = handler;
while(true)
{
switch (m_nCurrentPosition)
{
case NODEPOSITION_STARTELEMENT:
- sendStartElement(nullptr, xHandler, m_pCurrentElement);
+ sendStartElement(nullptr, handler, m_pCurrentElement);
break;
case NODEPOSITION_ENDELEMENT:
- sendEndElement(nullptr, xHandler, m_pCurrentElement);
+ sendEndElement(nullptr, handler, m_pCurrentElement);
break;
case NODEPOSITION_NORMAL:
- sendNode(nullptr, xHandler, m_pCurrentElement);
+ sendNode(nullptr, handler, m_pCurrentElement);
break;
}