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

Vitaliy Anderson vanderson at smartru.com
Tue Jan 31 16:36:47 UTC 2017


 unotools/source/config/compatibility.cxx |   33 ++++++++++---------------------
 1 file changed, 11 insertions(+), 22 deletions(-)

New commits:
commit aaf41776b992a4552764f0fdf91671ffebc618fa
Author: Vitaliy Anderson <vanderson at smartru.com>
Date:   Tue Jan 31 05:11:12 2017 -0800

    Compatibility options refactoring. Part 1 small fix
    
    SvtCompatibilityOptions_Impl::impl_GetPropertyNames() solve problem with wrong lProperties names
    
    Change-Id: I0b71a80d542d8175c3f6e6cdf5fe857143714acb
    Reviewed-on: https://gerrit.libreoffice.org/33752
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/unotools/source/config/compatibility.cxx b/unotools/source/config/compatibility.cxx
index b13972b..58522ac 100644
--- a/unotools/source/config/compatibility.cxx
+++ b/unotools/source/config/compatibility.cxx
@@ -145,17 +145,6 @@ class SvtCompatibilityOptions_Impl : public ConfigItem
         *//*-*****************************************************************************************************/
         Sequence< OUString > impl_GetPropertyNames( Sequence< OUString >& rItems );
 
-        /*-****************************************************************************************************
-            @short      expand the list for all well known properties to destination
-            @seealso    method impl_GetPropertyNames()
-
-            @param      "lSource"      ,   original list
-            @param      "lDestination" ,   destination of operation
-            @return     A list of configuration key names is returned.
-        *//*-*****************************************************************************************************/
-        static void impl_ExpandPropertyNames( const Sequence< OUString >& lSource,
-                                              Sequence< OUString >& lDestination );
-
     private:
         std::vector< SvtCompatibilityEntry > m_aOptions;
         SvtCompatibilityEntry                m_aDefOptions;
@@ -292,29 +281,29 @@ Sequence< OUString > SvtCompatibilityOptions_Impl::impl_GetPropertyNames( Sequen
 {
     // First get ALL names of current existing list items in configuration!
     rItems = GetNodeNames( SETNODE_ALLFILEFORMATS );
+
     // expand list to result list ...
     Sequence< OUString > lProperties( rItems.getLength() * ( SvtCompatibilityEntry::getElementCount() - 1 ) );
-    impl_ExpandPropertyNames( rItems, lProperties );
-    // Return result.
-    return lProperties;
-}
 
-void SvtCompatibilityOptions_Impl::impl_ExpandPropertyNames(
-    const Sequence< OUString >& lSource, Sequence< OUString >& lDestination )
-{
-    sal_Int32 nSourceCount = lSource.getLength();
+    sal_Int32 nSourceCount = rItems.getLength();
+    sal_Int32 nDestStep    = 0;
     // Copy entries to destination and expand every item with 2 supported sub properties.
     for ( sal_Int32 nSourceStep = 0; nSourceStep < nSourceCount; ++nSourceStep )
     {
         OUString sFixPath;
         sFixPath = SETNODE_ALLFILEFORMATS;
         sFixPath += PATHDELIMITER;
-        sFixPath += lSource[ nSourceStep ];
+        sFixPath += rItems[ nSourceStep ];
         sFixPath += PATHDELIMITER;
-
         for ( int i = static_cast<int>(SvtCompatibilityEntry::Index::Module); i < static_cast<int>(SvtCompatibilityEntry::Index::INVALID); ++i )
-            lDestination[ i - 1 ] = sFixPath + SvtCompatibilityEntry::getName( SvtCompatibilityEntry::Index(i) );
+        {
+            lProperties[ nDestStep ] = sFixPath + SvtCompatibilityEntry::getName( SvtCompatibilityEntry::Index(i) );
+            nDestStep++;
+        }
     }
+
+    // Return result.
+    return lProperties;
 }
 
 namespace


More information about the Libreoffice-commits mailing list