Kaydet (Commit) 7e5f6bbc authored tarafından Jan Holesovsky's avatar Jan Holesovsky Kaydeden (comit) Andrzej Hunt

lok: Use reference instead of copy constructing in range-based for.

Change-Id: Ie5bf5d4ab139f22e67f3654b0bb31e10b8c9f337
(cherry picked from commit addd8847)
üst 374fdbed
...@@ -1290,10 +1290,10 @@ static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand) ...@@ -1290,10 +1290,10 @@ static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand)
if (sStyleFam == "ParagraphStyles" if (sStyleFam == "ParagraphStyles"
&& doc_getDocumentType(pThis) == LOK_DOCTYPE_TEXT) && doc_getDocumentType(pThis) == LOK_DOCTYPE_TEXT)
{ {
for( OUString aStyle: aWriterStyles ) for (const OUString& rStyle: aWriterStyles)
{ {
uno::Reference< beans::XPropertySet > xStyle; uno::Reference< beans::XPropertySet > xStyle;
xStyleFamily->getByName( aStyle ) >>= xStyle; xStyleFamily->getByName(rStyle) >>= xStyle;
OUString sName; OUString sName;
xStyle->getPropertyValue("DisplayName") >>= sName; xStyle->getPropertyValue("DisplayName") >>= sName;
if( !sName.isEmpty() ) if( !sName.isEmpty() )
...@@ -1308,14 +1308,14 @@ static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand) ...@@ -1308,14 +1308,14 @@ static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand)
} }
uno::Sequence<OUString> aStyles = xStyleFamily->getElementNames(); 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 // Filter out the default styles - they are already at the top
// of the list // of the list
if (aDefaultStyleNames.find(aStyle) == aDefaultStyleNames.end()) if (aDefaultStyleNames.find(rStyle) == aDefaultStyleNames.end())
{ {
boost::property_tree::ptree aChild; boost::property_tree::ptree aChild;
aChild.put("", aStyle); aChild.put("", rStyle);
aChildren.push_back(std::make_pair("", aChild)); aChildren.push_back(std::make_pair("", aChild));
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment