Blame SOURCES/0315-lok-Use-reference-instead-of-copy-constructing-in-ra.patch

f325b2
From 5b7391b183885ce1d85b76d2d6ddc46a771abc35 Mon Sep 17 00:00:00 2001
f325b2
From: Jan Holesovsky <kendy@collabora.com>
f325b2
Date: Thu, 12 Nov 2015 18:22:06 +0100
f325b2
Subject: [PATCH 315/398] lok: Use reference instead of copy constructing in
f325b2
 range-based for.
f325b2
f325b2
Change-Id: Ie5bf5d4ab139f22e67f3654b0bb31e10b8c9f337
f325b2
(cherry picked from commit addd884799b88213df813fd8501c3ab8306593e1)
f325b2
---
f325b2
 desktop/source/lib/init.cxx | 10 +++++-----
f325b2
 1 file changed, 5 insertions(+), 5 deletions(-)
f325b2
f325b2
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
f325b2
index 1d56f2e8abae..04a902780e6c 100644
f325b2
--- a/desktop/source/lib/init.cxx
f325b2
+++ b/desktop/source/lib/init.cxx
f325b2
@@ -1281,10 +1281,10 @@ static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand)
f325b2
         if (sStyleFam == "ParagraphStyles"
f325b2
             && doc_getDocumentType(pThis) == LOK_DOCTYPE_TEXT)
f325b2
         {
f325b2
-            for( OUString aStyle: aWriterStyles )
f325b2
+            for (const OUString& rStyle: aWriterStyles)
f325b2
             {
f325b2
                 uno::Reference< beans::XPropertySet > xStyle;
f325b2
-                xStyleFamily->getByName( aStyle ) >>= xStyle;
f325b2
+                xStyleFamily->getByName(rStyle) >>= xStyle;
f325b2
                 OUString sName;
f325b2
                 xStyle->getPropertyValue("DisplayName") >>= sName;
f325b2
                 if( !sName.isEmpty() )
f325b2
@@ -1299,14 +1299,14 @@ static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand)
f325b2
         }
f325b2
 
f325b2
         uno::Sequence<OUString> aStyles = xStyleFamily->getElementNames();
f325b2
-        for ( OUString aStyle: aStyles )
f325b2
+        for (const OUString& rStyle: aStyles )
f325b2
         {
f325b2
             // Filter out the default styles - they are already at the top
f325b2
             // of the list
f325b2
-            if (aDefaultStyleNames.find(aStyle) == aDefaultStyleNames.end())
f325b2
+            if (aDefaultStyleNames.find(rStyle) == aDefaultStyleNames.end())
f325b2
             {
f325b2
                 boost::property_tree::ptree aChild;
f325b2
-                aChild.put("", aStyle);
f325b2
+                aChild.put("", rStyle);
f325b2
                 aChildren.push_back(std::make_pair("", aChild));
f325b2
             }
f325b2
         }
f325b2
-- 
f325b2
2.12.0
f325b2