diff options
author | Vitaliy Anderson <vanderson@smartru.com> | 2017-01-31 05:11:12 -0800 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2017-01-31 16:36:16 +0000 |
commit | aaf41776b992a4552764f0fdf91671ffebc618fa (patch) | |
tree | 9b746495c26203ad3c14307dc5bf254f697aae93 /unotools/source | |
parent | 1478f81f236b88377293432a642def218e228145 (diff) |
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@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'unotools/source')
-rw-r--r-- | unotools/source/config/compatibility.cxx | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/unotools/source/config/compatibility.cxx b/unotools/source/config/compatibility.cxx index b13972b683b5..58522acc79ce 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 |