[Libreoffice-commits] core.git: 2 commits - svx/source unotools/source

Andrzej Hunt andrzej at ahunt.org
Wed Nov 25 15:27:18 PST 2015


 svx/source/tbxctrls/tbcontrl.cxx    |    6 +++---
 unotools/source/config/eventcfg.cxx |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 1abd8d9e00497940c45ed70154ecb10dd806fe7b
Author: Andrzej Hunt <andrzej at ahunt.org>
Date:   Sat Nov 21 08:15:32 2015 -0800

    Convert to range based for
    
    (This was also used for testing loplugin:rangedforcopy)
    
    Change-Id: I246994feb7bf66d337b76e3f02d7fea2cb13d42a

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index ce7d877..ae696ae 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -2025,7 +2025,7 @@ struct SvxStyleToolBoxControl::Impl
                 Reference<container::XNameAccess> xParaStyles;
                     xStylesSupplier->getStyleFamilies()->getByName("ParagraphStyles") >>=
                     xParaStyles;
-                static const sal_Char* aWriterStyles[] =
+                static const std::vector<OUString> aWriterStyles =
                 {
                     "Text body",
                     "Quotations",
@@ -2035,12 +2035,12 @@ struct SvxStyleToolBoxControl::Impl
                     "Heading 2",
                     "Heading 3"
                 };
-                for( sal_uInt32 nStyle = 0; nStyle < sizeof( aWriterStyles ) / sizeof( sal_Char*); ++nStyle )
+                for( const OUString& aStyle: aWriterStyles )
                 {
                     try
                     {
                         Reference< beans::XPropertySet > xStyle;
-                        xParaStyles->getByName( OUString::createFromAscii( aWriterStyles[nStyle] )) >>= xStyle;
+                        xParaStyles->getByName( aStyle ) >>= xStyle;
                         OUString sName;
                         xStyle->getPropertyValue("DisplayName") >>= sName;
                         if( !sName.isEmpty() )
commit 96ee91aea6710dcc1797d677f8faef453ba919b2
Author: Andrzej Hunt <andrzej at ahunt.org>
Date:   Wed Nov 25 12:04:17 2015 -0800

    add const in ranged for
    
    Change-Id: I0f55705e101e39e9e6e5286f21cad8ccb96e7fad

diff --git a/unotools/source/config/eventcfg.cxx b/unotools/source/config/eventcfg.cxx
index eda8048..06e7a9f 100644
--- a/unotools/source/config/eventcfg.cxx
+++ b/unotools/source/config/eventcfg.cxx
@@ -112,7 +112,7 @@ GlobalEventConfig_Impl::GlobalEventConfig_Impl()
     :   ConfigItem( ROOTNODE_EVENTS, ConfigItemMode::ImmediateUpdate )
 {
     // the supported event names
-    for (GlobalEventId id : o3tl::enumrange<GlobalEventId>())
+    for (const GlobalEventId id : o3tl::enumrange<GlobalEventId>())
         m_supportedEvents[id] = OUString::createFromAscii( pEventAsciiNames[id] );
 
     initBindingInfo();


More information about the Libreoffice-commits mailing list