diff options
author | Jan Holesovsky <kendy@collabora.com> | 2015-11-12 18:22:06 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2015-11-12 20:49:10 +0100 |
commit | addd884799b88213df813fd8501c3ab8306593e1 (patch) | |
tree | ff6d9fc9ebbe58c78c0bb3cf63f4d399e1142dcf /desktop | |
parent | 99cc76e41bc418aff8cc14e646b42b3c59ffac9e (diff) |
lok: Use reference instead of copy constructing in range-based for.
Change-Id: Ie5bf5d4ab139f22e67f3654b0bb31e10b8c9f337
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/lib/init.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index bc25f3e15cde..e33544abec90 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1281,10 +1281,10 @@ static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand) if (sStyleFam == "ParagraphStyles" && doc_getDocumentType(pThis) == LOK_DOCTYPE_TEXT) { - for( OUString aStyle: aWriterStyles ) + for (const OUString& rStyle: aWriterStyles) { uno::Reference< beans::XPropertySet > xStyle; - xStyleFamily->getByName( aStyle ) >>= xStyle; + xStyleFamily->getByName(rStyle) >>= xStyle; OUString sName; xStyle->getPropertyValue("DisplayName") >>= sName; if( !sName.isEmpty() ) @@ -1299,14 +1299,14 @@ static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand) } uno::Sequence<OUString> aStyles = xStyleFamily->getElementNames(); - for ( OUString aStyle: aStyles ) + for (const OUString& rStyle: aStyles ) { // Filter out the default styles - they are already at the top // of the list - if (aDefaultStyleNames.find(aStyle) == aDefaultStyleNames.end()) + if (aDefaultStyleNames.find(rStyle) == aDefaultStyleNames.end()) { boost::property_tree::ptree aChild; - aChild.put("", aStyle); + aChild.put("", rStyle); aChildren.push_back(std::make_pair("", aChild)); } } |