Kaydet (Commit) 1abd8d9e authored tarafından Andrzej Hunt's avatar Andrzej Hunt

Convert to range based for

(This was also used for testing loplugin:rangedforcopy)

Change-Id: I246994feb7bf66d337b76e3f02d7fea2cb13d42a
üst 96ee91ae
...@@ -2025,7 +2025,7 @@ struct SvxStyleToolBoxControl::Impl ...@@ -2025,7 +2025,7 @@ struct SvxStyleToolBoxControl::Impl
Reference<container::XNameAccess> xParaStyles; Reference<container::XNameAccess> xParaStyles;
xStylesSupplier->getStyleFamilies()->getByName("ParagraphStyles") >>= xStylesSupplier->getStyleFamilies()->getByName("ParagraphStyles") >>=
xParaStyles; xParaStyles;
static const sal_Char* aWriterStyles[] = static const std::vector<OUString> aWriterStyles =
{ {
"Text body", "Text body",
"Quotations", "Quotations",
...@@ -2035,12 +2035,12 @@ struct SvxStyleToolBoxControl::Impl ...@@ -2035,12 +2035,12 @@ struct SvxStyleToolBoxControl::Impl
"Heading 2", "Heading 2",
"Heading 3" "Heading 3"
}; };
for( sal_uInt32 nStyle = 0; nStyle < sizeof( aWriterStyles ) / sizeof( sal_Char*); ++nStyle ) for( const OUString& aStyle: aWriterStyles )
{ {
try try
{ {
Reference< beans::XPropertySet > xStyle; Reference< beans::XPropertySet > xStyle;
xParaStyles->getByName( OUString::createFromAscii( aWriterStyles[nStyle] )) >>= xStyle; xParaStyles->getByName( aStyle ) >>= xStyle;
OUString sName; OUString sName;
xStyle->getPropertyValue("DisplayName") >>= sName; xStyle->getPropertyValue("DisplayName") >>= sName;
if( !sName.isEmpty() ) if( !sName.isEmpty() )
......
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