[Libreoffice-commits] core.git: desktop/source
Jan Holesovsky
kendy at collabora.com
Thu Nov 12 11:49:52 PST 2015
desktop/source/lib/init.cxx | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
New commits:
commit addd884799b88213df813fd8501c3ab8306593e1
Author: Jan Holesovsky <kendy at collabora.com>
Date: Thu Nov 12 18:22:06 2015 +0100
lok: Use reference instead of copy constructing in range-based for.
Change-Id: Ie5bf5d4ab139f22e67f3654b0bb31e10b8c9f337
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index bc25f3e..e33544a 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));
}
}
More information about the Libreoffice-commits
mailing list