diff options
author | Andrzej Hunt <andrzej@ahunt.org> | 2015-11-12 14:30:40 +0100 |
---|---|---|
committer | Andrzej Hunt <andrzej@ahunt.org> | 2015-11-12 15:09:30 +0100 |
commit | d5545979fb27e317cce4d374a5a913790d8a2adf (patch) | |
tree | cb478d8212755c25cf0655a08cc2c7e4542fbc5e /desktop | |
parent | fbc3965dc117967d2b5f51aa3902823da7c69d12 (diff) |
Use std::vector instead of an array of strings
This makes the code much more readable / sane.
Change-Id: I1d60f4102b6c619fa2fefac4a3644b7f04c0b9c0
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/lib/init.cxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 048215e71b5b..b205cf0d19b0 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1252,7 +1252,7 @@ static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand) uno::Reference<container::XNameAccess> xStyleFamilies(xStyleFamiliesSupplier->getStyleFamilies(), uno::UNO_QUERY); uno::Sequence<OUString> aStyleFamilies = xStyleFamilies->getElementNames(); - static const sal_Char* aWriterStyles[] = + static const std::vector<OUString> aWriterStyles = { "Text body", "Quotations", @@ -1263,6 +1263,8 @@ static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand) "Heading 3" }; + // static const std::vector<OUString> aList = { "aaaa", "bbb" }; + boost::property_tree::ptree aValues; for (sal_Int32 nStyleFam = 0; nStyleFam < aStyleFamilies.getLength(); ++nStyleFam) { @@ -1276,10 +1278,10 @@ static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand) if (sStyleFam == "ParagraphStyles" && doc_getDocumentType(pThis) == LOK_DOCTYPE_TEXT) { - for( sal_uInt32 nStyle = 0; nStyle < sizeof( aWriterStyles ) / sizeof( sal_Char*); ++nStyle ) + for( OUString aStyle: aWriterStyles ) { uno::Reference< beans::XPropertySet > xStyle; - xStyleFamily->getByName( OUString::createFromAscii( aWriterStyles[nStyle] )) >>= xStyle; + xStyleFamily->getByName( aStyle ) >>= xStyle; OUString sName; xStyle->getPropertyValue("DisplayName") >>= sName; if( !sName.isEmpty() ) |