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

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