[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - cppcanvas/source cppuhelper/source cppu/source
cppcanvas/source/mtfrenderer/textaction.cxx |6 cppu/source/threadpool/jobqueue.cxx |8 cppu/source/typelib/typelib.cxx | 56 +- cppu/source/uno/lbenv.cxx | 23 -- cppu/source/uno/lbmap.cxx |5 cppuhelper/source/component_context.cxx | 23 -- cppuhelper/source/interfacecontainer.cxx| 92 ++ cppuhelper/source/propertysetmixin.cxx | 44 +--- cppuhelper/source/servicemanager.cxx| 249 ++-- cppuhelper/source/typemanager.cxx | 40 +--- cppuhelper/source/weak.cxx | 12 - 11 files changed, 197 insertions(+), 361 deletions(-) New commits: commit 58ef4b593bba3d592e07e0f25140808c74f8aa0f Author: Arkadiy Illarionov AuthorDate: Sun Mar 3 13:10:45 2019 +0300 Commit: Aron Budea CommitDate: Fri Nov 22 17:26:27 2019 +0100 Simplify containers iterations in cppcanvas, cppu, cppuhelper Use range-based loop or replace with STL functions Change-Id: I72bf7cdb632c04e2fc8d4f7ab85cb6571222aa07 Reviewed-on: https://gerrit.libreoffice.org/68636 Tested-by: Jenkins Reviewed-by: Noel Grandin Reviewed-on: https://gerrit.libreoffice.org/83472 Reviewed-by: Aron Budea Tested-by: Aron Budea diff --git a/cppcanvas/source/mtfrenderer/textaction.cxx b/cppcanvas/source/mtfrenderer/textaction.cxx index 422a92279659..93c0d617a22b 100644 --- a/cppcanvas/source/mtfrenderer/textaction.cxx +++ b/cppcanvas/source/mtfrenderer/textaction.cxx @@ -2025,13 +2025,11 @@ namespace cppcanvas aMapModeTransform.set(0,2, 0.0); aMapModeTransform.set(1,2, 0.0); -PolyPolyVector::const_iterator aIter( aVCLPolyPolyVector.begin() ); -const PolyPolyVector::const_iterator aEnd( aVCLPolyPolyVector.end() ); -for( ; aIter!= aEnd; ++aIter ) +for( const auto& rVCLPolyPolygon : aVCLPolyPolyVector ) { ::basegfx::B2DPolyPolygon aPolyPolygon; -aPolyPolygon = aIter->getB2DPolyPolygon(); +aPolyPolygon = rVCLPolyPolygon.getB2DPolyPolygon(); aPolyPolygon.transform( aMapModeTransform ); // append result to collecting polypoly diff --git a/cppu/source/threadpool/jobqueue.cxx b/cppu/source/threadpool/jobqueue.cxx index 2d375dcf8bbd..6c9324521f40 100644 --- a/cppu/source/threadpool/jobqueue.cxx +++ b/cppu/source/threadpool/jobqueue.cxx @@ -129,13 +129,11 @@ namespace cppu_threadpool { void JobQueue::dispose( sal_Int64 nDisposeId ) { MutexGuard guard( m_mutex ); -for( auto ii = m_lstCallstack.begin() ; - ii != m_lstCallstack.end() ; - ++ii ) +for( auto& rId : m_lstCallstack ) { -if( (*ii) == nDisposeId ) +if( rId == nDisposeId ) { -(*ii) = 0; +rId = 0; } } diff --git a/cppu/source/typelib/typelib.cxx b/cppu/source/typelib/typelib.cxx index ccfe85c9abe7..124065b2ef34 100644 --- a/cppu/source/typelib/typelib.cxx +++ b/cppu/source/typelib/typelib.cxx @@ -18,6 +18,7 @@ */ +#include #include #include #include @@ -226,14 +227,11 @@ inline void TypeDescriptor_Init_Impl::callChain( assert(*ppRet == nullptr); if (pCallbacks) { -CallbackSet_Impl::const_iterator aIt = pCallbacks->begin(); -while( aIt != pCallbacks->end() ) +for( const CallbackEntry & rEntry : *pCallbacks ) { -const CallbackEntry & rEntry = *aIt; (*rEntry.second)( rEntry.first, ppRet, pName ); if( *ppRet ) return; -++aIt; } } } @@ -243,11 +241,9 @@ TypeDescriptor_Init_Impl::~TypeDescriptor_Init_Impl() { if( pCache ) { -TypeDescriptionList_Impl::const_iterator aIt = pCache->begin(); -while( aIt != pCache->end() ) +for( typelib_TypeDescription* pItem : *pCache ) { -typelib_typedescription_release( *aIt ); -++aIt; +typelib_typedescription_release( pItem ); } } @@ -257,19 +253,14 @@ TypeDescriptor_Init_Impl::~TypeDescriptor_Init_Impl() ppTDR.reserve( pWeakMap->size() ); // save all weak references -WeakMap_Impl::const_iterator aIt = pWeakMap->begin(); -while( aIt != pWeakMap->end() ) +for( const auto& rEntry : *pWeakMap ) { -ppTDR.push_back( (*aIt).second ); +ppTDR.push_back( rEntry.second ); typelib_typedescriptionreference_acquire( ppTDR.back() ); -++aIt; } -for( std::vector< typelib_TypeDescriptionReference * >::iterator i( - ppTDR.begin() ); - i != ppTDR.end(); ++i ) +for( typelib_TypeDescriptionReference * pTDR : ppTDR )
[Libreoffice-commits] core.git: i18npool/source
i18npool/source/breakiterator/breakiterator_unicode.cxx |2 i18npool/source/calendar/calendarImpl.cxx | 33 +-- i18npool/source/calendar/calendar_gregorian.cxx |8 i18npool/source/collator/collatorImpl.cxx | 39 +-- i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx |7 i18npool/source/indexentry/indexentrysupplier.cxx | 13 - i18npool/source/localedata/LocaleNode.cxx | 11 - i18npool/source/localedata/localedata.cxx | 45 +--- i18npool/source/localedata/saxparser.cxx |4 i18npool/source/numberformatcode/numberformatcode.cxx | 107 -- i18npool/source/ordinalsuffix/ordinalsuffix.cxx | 10 i18npool/source/search/textsearch.cxx |6 i18npool/source/textconversion/textconversion_ko.cxx | 19 - i18npool/source/transliteration/ignoreDiacritics_CTL.cxx | 15 - i18npool/source/transliteration/ignoreIandEfollowedByYa_ja_JP.cxx | 15 - i18npool/source/transliteration/ignoreIterationMark_ja_JP.cxx | 12 - i18npool/source/transliteration/ignoreKiKuFollowedBySa_ja_JP.cxx | 15 - i18npool/source/transliteration/ignoreProlongedSoundMark_ja_JP.cxx| 12 - i18npool/source/transliteration/transliterationImpl.cxx | 57 ++--- i18npool/source/transliteration/transliteration_OneToOne.cxx |9 i18npool/source/transliteration/transliteration_body.cxx | 98 +++-- 21 files changed, 218 insertions(+), 319 deletions(-) New commits: commit 00e2f118d7f4f070ebddf16b2cf4e89cf9d551a7 Author: Arkadiy Illarionov AuthorDate: Sat Sep 7 23:10:33 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Mon Oct 21 19:41:43 2019 +0200 Simplify Sequence iterations in i18npool Use range-based loops, STL and comphelper functions. Change-Id: Ibbc1c14e921585819872f26e8def2a60594e6a63 Reviewed-on: https://gerrit.libreoffice.org/78754 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/i18npool/source/breakiterator/breakiterator_unicode.cxx b/i18npool/source/breakiterator/breakiterator_unicode.cxx index fee0b19dae38..e1675ec6a41d 100644 --- a/i18npool/source/breakiterator/breakiterator_unicode.cxx +++ b/i18npool/source/breakiterator/breakiterator_unicode.cxx @@ -142,7 +142,7 @@ void BreakIterator_Unicode::loadICUBreakIterator(const css::lang::Locale& rLocal icuBI->mpValue.reset(); if (!bInMap && rule) do { -uno::Sequence< OUString > breakRules = LocaleDataImpl::get()->getBreakIteratorRules(rLocale); +const uno::Sequence< OUString > breakRules = LocaleDataImpl::get()->getBreakIteratorRules(rLocale); status = U_ZERO_ERROR; udata_setAppData("OpenOffice", OpenOffice_dat, ); diff --git a/i18npool/source/calendar/calendarImpl.cxx b/i18npool/source/calendar/calendarImpl.cxx index d2e9801338dd..2cb659560489 100644 --- a/i18npool/source/calendar/calendarImpl.cxx +++ b/i18npool/source/calendar/calendarImpl.cxx @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -42,14 +43,11 @@ CalendarImpl::~CalendarImpl() void SAL_CALL CalendarImpl::loadDefaultCalendarTZ( const css::lang::Locale& rLocale, const OUString& rTimeZone ) { -Sequence< Calendar2 > xC = LocaleDataImpl::get()->getAllCalendars2(rLocale); -for (sal_Int32 i = 0; i < xC.getLength(); i++) { -if (xC[i].Default) { -loadCalendarTZ(xC[i].Name, rLocale, rTimeZone); -return; -} -} -throw ERROR; +const Sequence< Calendar2 > xC = LocaleDataImpl::get()->getAllCalendars2(rLocale); +auto pCal = std::find_if(xC.begin(), xC.end(), [](const Calendar2& rCal) { return rCal.Default; }); +if (pCal == xC.end()) +throw ERROR; +loadCalendarTZ(pCal->Name, rLocale, rTimeZone); } void SAL_CALL @@ -74,13 +72,9 @@ CalendarImpl::loadCalendarTZ( const OUString& uniqueID, const css::lang::Locale& if ( ! xI.is() ) { // check if the calendar is defined in localedata, load gregorian calendar service. -Sequence< Calendar2 > xC = LocaleDataImpl::get()->getAllCalendars2(rLocale); -for (i = 0; i < xC.getLength(); i++) { -if (uniqueID == xC[i].Name) { -xI = m_xContext->getServiceManager()->createInstanceWithContext("com.sun.star.i18n.Calendar_gregorian", m_xContext); -break; -} -} +const Sequence< Calendar2 > xC = LocaleDataImpl::get()->getAllCalendars2(rLocale); +if (std::any_of(xC.begin(), xC.end(), [](const Calendar2& rCal) { return uniqueID == rCal.Name; })) +xI =
[Libreoffice-commits] core.git: i18npool/source
i18npool/source/transliteration/transliteration_body.cxx | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) New commits: commit a2b46aa93fe1ce1d98e8fed5a0987b106aeacec8 Author: Arkadiy Illarionov AuthorDate: Sun Oct 20 11:57:11 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Sun Oct 20 11:46:05 2019 +0200 Drop redundant conditions nMappingType is checked in lcl_getMappingTypeForToggleCase Change-Id: I5e13ffad9028ca40d23e5ca19d765b3ee43c5724 Reviewed-on: https://gerrit.libreoffice.org/81151 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/i18npool/source/transliteration/transliteration_body.cxx b/i18npool/source/transliteration/transliteration_body.cxx index a320b46d36aa..6d6c710b57c2 100644 --- a/i18npool/source/transliteration/transliteration_body.cxx +++ b/i18npool/source/transliteration/transliteration_body.cxx @@ -100,9 +100,7 @@ Transliteration_body::transliterateImpl( for (i = 0; i < nCount; i++) { // take care of TOGGLE_CASE transliteration: -MappingType nTmpMappingType = nMappingType; -if (nMappingType == (MappingType::LowerToUpper | MappingType::UpperToLower)) -nTmpMappingType = lcl_getMappingTypeForToggleCase( nMappingType, in[i] ); +MappingType nTmpMappingType = lcl_getMappingTypeForToggleCase( nMappingType, in[i] ); const i18nutil::Mapping = i18nutil::casefolding::getValue( in, i, nCount, aLocale, nTmpMappingType ); nOffCount += map.nmap; @@ -118,9 +116,7 @@ Transliteration_body::transliterateImpl( for (i = 0; i < nCount; i++) { // take care of TOGGLE_CASE transliteration: -MappingType nTmpMappingType = nMappingType; -if (nMappingType == (MappingType::LowerToUpper | MappingType::UpperToLower)) -nTmpMappingType = lcl_getMappingTypeForToggleCase( nMappingType, in[i] ); +MappingType nTmpMappingType = lcl_getMappingTypeForToggleCase( nMappingType, in[i] ); const i18nutil::Mapping = i18nutil::casefolding::getValue( in, i, nCount, aLocale, nTmpMappingType ); for (sal_Int32 k = 0; k < map.nmap; k++) @@ -158,9 +154,7 @@ Transliteration_body::transliterateImpl( for ( sal_Int32 i = 0; i < nCount; i++) { // take care of TOGGLE_CASE transliteration: -MappingType nTmpMappingType = nMappingType; -if (nMappingType == (MappingType::LowerToUpper | MappingType::UpperToLower)) -nTmpMappingType = lcl_getMappingTypeForToggleCase( nMappingType, in[i] ); +MappingType nTmpMappingType = lcl_getMappingTypeForToggleCase( nMappingType, in[i] ); const i18nutil::Mapping = i18nutil::casefolding::getValue( in, i, nCount, aLocale, nTmpMappingType ); for (sal_Int32 k = 0; k < map.nmap; k++) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: vcl/unx
vcl/unx/gtk/gloactiongroup.cxx | 13 ++--- 1 file changed, 2 insertions(+), 11 deletions(-) New commits: commit efc1d001821747dc72140aeb3e0f0b48b1eed005 Author: Arkadiy Illarionov AuthorDate: Fri Sep 27 00:25:57 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Sat Sep 28 14:23:53 2019 +0200 Use G_ADD_PRIVATE and *_get_instance_private G_TYPE_INSTANCE_GET_PRIVATE and g_type_class_add_private are deprecated Change-Id: Id2a03e1ddc523d088682fd29f6b9d4e25f0cd4a2 Reviewed-on: https://gerrit.libreoffice.org/79663 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/vcl/unx/gtk/gloactiongroup.cxx b/vcl/unx/gtk/gloactiongroup.cxx index 73a432769a08..56782e2cd46f 100644 --- a/vcl/unx/gtk/gloactiongroup.cxx +++ b/vcl/unx/gtk/gloactiongroup.cxx @@ -112,6 +112,7 @@ static void g_lo_action_group_iface_init (GActionGroupInterface *); #endif G_DEFINE_TYPE_WITH_CODE (GLOActionGroup, g_lo_action_group, G_TYPE_OBJECT, +G_ADD_PRIVATE(GLOActionGroup) G_IMPLEMENT_INTERFACE (G_TYPE_ACTION_GROUP, g_lo_action_group_iface_init)); #ifdef __GNUC__ @@ -314,9 +315,7 @@ static void g_lo_action_group_init (GLOActionGroup *group) { SAL_INFO("vcl.unity", "g_lo_action_group_init on " << group); -group->priv = G_TYPE_INSTANCE_GET_PRIVATE (group, - G_TYPE_LO_ACTION_GROUP, - GLOActionGroupPrivate); +group->priv = static_cast(g_lo_action_group_get_instance_private (group)); group->priv->table = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); } @@ -327,14 +326,6 @@ g_lo_action_group_class_init (GLOActionGroupClass *klass) GObjectClass *object_class = G_OBJECT_CLASS (klass); object_class->finalize = g_lo_action_group_finalize; -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif -g_type_class_add_private (klass, sizeof (GLOActionGroupPrivate)); -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif } static void ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: chart2/source connectivity/source dbaccess/source reportdesign/source sc/source sd/source sfx2/source starmath/source svl/source svtools/source sw/source vcl/source
chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx | 12 -- chart2/source/controller/drawinglayer/DrawViewWrapper.cxx |5 - chart2/source/view/diagram/VDiagram.cxx |5 - chart2/source/view/main/ChartView.cxx | 17 +-- connectivity/source/drivers/dbase/DDatabaseMetaData.cxx | 13 +- connectivity/source/drivers/dbase/DIndexes.cxx| 12 -- connectivity/source/drivers/dbase/DResultSet.cxx | 27 ++ connectivity/source/drivers/dbase/DTables.cxx | 35 +++ connectivity/source/drivers/file/FDatabaseMetaData.cxx| 37 +++- connectivity/source/drivers/hsqldb/HDriver.cxx| 11 -- connectivity/source/drivers/mysql_jdbc/YDriver.cxx| 45 -- dbaccess/source/core/api/RowSet.cxx | 20 +--- dbaccess/source/ui/misc/DExport.cxx |3 dbaccess/source/ui/misc/UITools.cxx |3 dbaccess/source/ui/querydesign/JoinExchange.cxx | 10 -- reportdesign/source/core/api/ReportDefinition.cxx |9 -- sc/source/filter/xml/xmlexprt.cxx |3 sc/source/ui/unoobj/textuno.cxx |6 - sd/source/core/sdpage.cxx | 10 -- sd/source/ui/framework/factories/PresentationFactory.cxx | 16 +-- sd/source/ui/framework/module/CenterViewFocusModule.cxx | 18 +--- sd/source/ui/framework/module/ShellStackGuard.cxx | 12 -- sd/source/ui/framework/module/ToolBarModule.cxx | 12 -- sd/source/ui/sidebar/PanelFactory.cxx | 12 -- sfx2/source/control/thumbnailviewacc.cxx |9 -- starmath/source/mathmlexport.cxx | 21 +--- starmath/source/mathmlimport.cxx | 17 --- starmath/source/view.cxx | 13 -- svl/source/items/style.cxx|6 - svtools/source/control/valueacc.cxx | 12 -- sw/source/core/layout/atrfrm.cxx |9 -- sw/source/core/layout/dumpfilter.cxx |3 sw/source/core/unocore/unochart.cxx | 39 +++- sw/source/core/unocore/unocrsrhelper.cxx | 10 -- sw/source/core/unocore/unodraw.cxx| 34 +-- sw/source/core/unocore/unoframe.cxx |5 - sw/source/core/unocore/unoobj.cxx |8 - sw/source/core/unocore/unoobj2.cxx|4 sw/source/core/unocore/unorefmk.cxx |3 sw/source/core/unocore/unostyle.cxx | 12 -- sw/source/core/unocore/unotext.cxx| 23 + sw/source/filter/html/htmlform.cxx| 12 -- sw/source/filter/xml/xmlimp.cxx | 10 -- sw/source/ui/dbui/mmlayoutpage.cxx|3 sw/source/ui/index/cntex.cxx |3 sw/source/uibase/dochdl/swdtflvr.cxx | 13 -- sw/source/uibase/misc/glosdoc.cxx | 23 - sw/source/uibase/shells/basesh.cxx|3 sw/source/uibase/uiview/uivwimp.cxx | 24 + sw/source/uibase/uno/SwXFilterOptions.cxx | 10 -- sw/source/uibase/uno/unomailmerge.cxx |9 -- sw/source/uibase/uno/unotxdoc.cxx |6 - sw/source/uibase/utlui/uiitems.cxx|4 sw/source/uibase/utlui/unotools.cxx | 18 vcl/source/gdi/graph.cxx |6 - 55 files changed, 221 insertions(+), 504 deletions(-) New commits: commit 1d398fb983d8f8b53a78e7c47b588fc1f1e7f748 Author: Arkadiy Illarionov AuthorDate: Sun Sep 22 18:20:39 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Mon Sep 23 15:47:12 2019 +0200 tdf#39593 use getUnoTunnelImplementation Change-Id: I78eb67913a568c610e38e5002f914773c4906dfd Reviewed-on: https://gerrit.libreoffice.org/79350 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx index 046f8bd87ea4..406df92db13a 100644 ---
[Libreoffice-commits] core.git: sc/inc sc/source
sc/inc/dapiuno.hxx|3 +-- sc/source/filter/oox/pivottablebuffer.cxx |2 +- sc/source/ui/unoobj/dapiuno.cxx | 11 +-- 3 files changed, 3 insertions(+), 13 deletions(-) New commits: commit 4342aaef0c4d6cd5c51fd2b74328bb4df5fb71dd Author: Arkadiy Illarionov AuthorDate: Thu Sep 19 00:08:37 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Fri Sep 20 08:31:02 2019 +0200 tdf#39593 Drop ScDataPilotDescriptorBase::getImplementation Replace with comphelper::getUnoTunnelImplementation. Change-Id: Ice068fcce262014a812a9e0a5d92b8bac173fa39 Reviewed-on: https://gerrit.libreoffice.org/79112 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/sc/inc/dapiuno.hxx b/sc/inc/dapiuno.hxx index 22d7c4302d3a..14842615dab6 100644 --- a/sc/inc/dapiuno.hxx +++ b/sc/inc/dapiuno.hxx @@ -202,8 +202,7 @@ public: virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; -static const css::uno::Sequence& getUnoTunnelId(); -SC_DLLPUBLIC static ScDataPilotDescriptorBase* getImplementation(const css::uno::Reference& rObj); +SC_DLLPUBLIC static const css::uno::Sequence& getUnoTunnelId(); // XTypeProvider (override in ScDataPilotTableObj) virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; diff --git a/sc/source/filter/oox/pivottablebuffer.cxx b/sc/source/filter/oox/pivottablebuffer.cxx index e9cc4010b673..5464a0eabbbf 100644 --- a/sc/source/filter/oox/pivottablebuffer.cxx +++ b/sc/source/filter/oox/pivottablebuffer.cxx @@ -1230,7 +1230,7 @@ void PivotTable::finalizeImport() mxDPDescriptor->setTag( maDefModel.maTag ); // TODO: This is a hack. Eventually we need to convert the whole thing to the internal API. -ScDataPilotDescriptorBase* pImpl = ScDataPilotDescriptorBase::getImplementation(mxDPDescriptor); +auto pImpl = comphelper::getUnoTunnelImplementation(mxDPDescriptor); if (!pImpl) return; diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx index 3d37f6f9d3d4..e36b21b8aa98 100644 --- a/sc/source/ui/unoobj/dapiuno.cxx +++ b/sc/source/ui/unoobj/dapiuno.cxx @@ -417,7 +417,7 @@ void SAL_CALL ScDataPilotTablesObj::insertNewByName( const OUString& aNewName, if (!pDocShell) throw RuntimeException("DocShell is null", static_cast(this)); -ScDataPilotDescriptorBase* pImp = ScDataPilotDescriptorBase::getImplementation( xDescriptor ); +auto pImp = comphelper::getUnoTunnelImplementation( xDescriptor ); if (!pImp) throw RuntimeException("Failed to get ScDataPilotDescriptor", static_cast(this)); @@ -1041,15 +1041,6 @@ const Sequence& ScDataPilotDescriptorBase::getUnoTunnelId() return theScDataPilotDescriptorBaseUnoTunnelId::get().getSeq(); } -ScDataPilotDescriptorBase* ScDataPilotDescriptorBase::getImplementation(const Reference& rObj ) -{ -ScDataPilotDescriptorBase* pRet = nullptr; -Reference xUT(rObj, UNO_QUERY); -if (xUT.is()) -pRet = reinterpret_cast(sal::static_int_cast(xUT->getSomething(getUnoTunnelId(; -return pRet; -} - ScDataPilotTableObj::ScDataPilotTableObj(ScDocShell* pDocSh, SCTAB nT, const OUString& rN) : ScDataPilotDescriptorBase( pDocSh ), nTab( nT ), ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/svdmodel.hxx |2 +- sd/source/ui/unoidl/unomodel.cxx |5 + svx/source/gallery2/galobj.cxx |2 +- svx/source/svdraw/svdmodel.cxx |2 +- 4 files changed, 4 insertions(+), 7 deletions(-) New commits: commit b883e3d58db404a92bee044091b6cfd3892311c2 Author: Arkadiy Illarionov AuthorDate: Wed Sep 18 20:54:55 2019 +0300 Commit: Stephan Bergmann CommitDate: Wed Sep 18 21:53:27 2019 +0200 tdf#39593 use isUnoTunnelId in sd Rename SdrModel::getUnoTunnelImplementationId() Change-Id: I364a05efe8ddc04b2b2ca393416c9b974ded43df Reviewed-on: https://gerrit.libreoffice.org/79108 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx index f7ffa515a0e0..d5c14c0baa57 100644 --- a/include/svx/svdmodel.hxx +++ b/include/svx/svdmodel.hxx @@ -585,7 +585,7 @@ public: bool IsInDestruction() const { return mbInDestruction;} -static const css::uno::Sequence< sal_Int8 >& getUnoTunnelImplementationId(); +static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId(); /** enables (true) or disables (false) recording of undo actions If undo actions are added while undo is disabled, they are deleted. diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 878db5a6175f..cf31dfa902e7 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -343,11 +343,8 @@ sal_Int64 SAL_CALL SdXImpressDocument::getSomething( const css::uno::Sequence< s if( isUnoTunnelId(rIdentifier) ) return sal::static_int_cast(reinterpret_cast(this)); -if( (rIdentifier.getLength() == 16) && -(0 == memcmp( SdrModel::getUnoTunnelImplementationId().getConstArray(), rIdentifier.getConstArray(), 16 ))) -{ +if( isUnoTunnelId(rIdentifier) ) return sal::static_int_cast(reinterpret_cast(mpDoc)); -} return SfxBaseModel::getSomething( rIdentifier ); } diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx index c08b84809cfe..23b1e3cda851 100644 --- a/svx/source/gallery2/galobj.cxx +++ b/svx/source/gallery2/galobj.cxx @@ -405,7 +405,7 @@ SvxGalleryDrawModel::SvxGalleryDrawModel() if( xTunnel.is() ) { mpFormModel = dynamic_cast< FmFormModel* >( - reinterpret_cast(xTunnel->getSomething(SdrModel::getUnoTunnelImplementationId(; + reinterpret_cast(xTunnel->getSomething(SdrModel::getUnoTunnelId(; if( mpFormModel ) { mpFormModel->InsertPage( mpFormModel->AllocPage( false ) ); diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index a833a85baec7..eec87abcdf73 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -2004,7 +2004,7 @@ namespace class theSdrModelUnoTunnelImplementationId : public rtl::Static< UnoTunnelIdInit, theSdrModelUnoTunnelImplementationId > {}; } -const css::uno::Sequence< sal_Int8 >& SdrModel::getUnoTunnelImplementationId() +const css::uno::Sequence< sal_Int8 >& SdrModel::getUnoTunnelId() { return theSdrModelUnoTunnelImplementationId::get().getSeq(); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: pyuno/source
pyuno/source/module/pyuno.cxx | 13 + pyuno/source/module/pyuno_adapter.cxx |2 +- pyuno/source/module/pyuno_impl.hxx|2 +- pyuno/source/module/pyuno_runtime.cxx |7 ++- 4 files changed, 9 insertions(+), 15 deletions(-) New commits: commit 8e53efa926bc05d73c48579f63c3d662a96bd35e Author: Arkadiy Illarionov AuthorDate: Wed Sep 18 00:18:33 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Wed Sep 18 14:40:48 2019 +0200 tdf#39593 use getUnoTunnelImplementation in pyuno Change-Id: I2cbbaad921b0a3d2ea6def4da2a2527dc4d94549 Reviewed-on: https://gerrit.libreoffice.org/79075 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/pyuno/source/module/pyuno.cxx b/pyuno/source/module/pyuno.cxx index a4d0ddc4e314..d9c9dacbb3fd 100644 --- a/pyuno/source/module/pyuno.cxx +++ b/pyuno/source/module/pyuno.cxx @@ -41,6 +41,7 @@ #include #include #include +#include #include "pyuno_impl.hxx" @@ -1711,14 +1712,10 @@ PyRef PyUNO_new ( xInvocation.set( ssf->createInstanceWithArguments( Sequence( , 1 ) ), css::uno::UNO_QUERY_THROW ); -Reference xUnoTunnel ( - xInvocation->getIntrospection()->queryAdapter(cppu::UnoType::get()), UNO_QUERY ); -if( xUnoTunnel.is() ) -{ -sal_Int64 that = xUnoTunnel->getSomething( ::pyuno::Adapter::getUnoTunnelImplementationId() ); -if( that ) -return reinterpret_cast(that)->getWrappedObject(); -} +auto that = comphelper::getUnoTunnelImplementation( + xInvocation->getIntrospection()->queryAdapter(cppu::UnoType::get())); +if( that ) +return that->getWrappedObject(); } if( !Py_IsInitialized() ) throw RuntimeException(); diff --git a/pyuno/source/module/pyuno_adapter.cxx b/pyuno/source/module/pyuno_adapter.cxx index 1c392989d744..a8efd4153831 100644 --- a/pyuno/source/module/pyuno_adapter.cxx +++ b/pyuno/source/module/pyuno_adapter.cxx @@ -68,7 +68,7 @@ Adapter::~Adapter() static cppu::OImplementationId g_id( false ); -Sequence Adapter::getUnoTunnelImplementationId() +Sequence Adapter::getUnoTunnelId() { return g_id.getImplementationId(); } diff --git a/pyuno/source/module/pyuno_impl.hxx b/pyuno/source/module/pyuno_impl.hxx index 000f2660469d..91c24b4e7a88 100644 --- a/pyuno/source/module/pyuno_impl.hxx +++ b/pyuno/source/module/pyuno_impl.hxx @@ -347,7 +347,7 @@ public: Adapter( const PyRef , const css::uno::Sequence< css::uno::Type > & types ); -static css::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId(); +static css::uno::Sequence< sal_Int8 > getUnoTunnelId(); const PyRef& getWrappedObject() const { return mWrappedObject; } const css::uno::Sequence< css::uno::Type >& getWrappedTypes() const { return mTypes; } virtual ~Adapter() override; diff --git a/pyuno/source/module/pyuno_runtime.cxx b/pyuno/source/module/pyuno_runtime.cxx index d307f9af363c..62b3861288c3 100644 --- a/pyuno/source/module/pyuno_runtime.cxx +++ b/pyuno/source/module/pyuno_runtime.cxx @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -832,11 +833,7 @@ Any Runtime::pyObject2Any ( const PyRef & source, enum ConversionMode mode ) con if( adapterObject.is() ) { // object got already bridged ! -Reference< css::lang::XUnoTunnel > tunnel( adapterObject, UNO_QUERY ); - -Adapter *pAdapter = reinterpret_cast( -tunnel->getSomething( -::pyuno::Adapter::getUnoTunnelImplementationId() ) ); +auto pAdapter = comphelper::getUnoTunnelImplementation(adapterObject); mappedObject = impl->cargo->xAdapterFactory->createAdapter( adapterObject, pAdapter->getWrappedTypes() ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: dbaccess/source
dbaccess/source/core/api/querydescriptor.cxx |8 +++- dbaccess/source/core/api/querydescriptor.hxx |2 +- 2 files changed, 4 insertions(+), 6 deletions(-) New commits: commit eef2795aa105ae52607cc158504c455da87dfd2a Author: Arkadiy Illarionov AuthorDate: Wed Sep 18 00:36:25 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Wed Sep 18 14:39:12 2019 +0200 tdf#39593 use isUnoTunnelId in dbaccess Change-Id: I796d010c25e5d59f473b2b2f38736aebe16fe114 Reviewed-on: https://gerrit.libreoffice.org/79076 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/dbaccess/source/core/api/querydescriptor.cxx b/dbaccess/source/core/api/querydescriptor.cxx index ea31bbc7275e..ab4fa02b7409 100644 --- a/dbaccess/source/core/api/querydescriptor.cxx +++ b/dbaccess/source/core/api/querydescriptor.cxx @@ -22,6 +22,7 @@ #include "querydescriptor.hxx" #include #include +#include #include #include #include @@ -142,16 +143,13 @@ OQueryDescriptor_Base::~OQueryDescriptor_Base() sal_Int64 SAL_CALL OQueryDescriptor_Base::getSomething( const Sequence< sal_Int8 >& _rIdentifier ) { -if (_rIdentifier.getLength() != 16) -return 0; - -if (0 == memcmp(getUnoTunnelImplementationId().getConstArray(), _rIdentifier.getConstArray(), 16 ) ) +if (isUnoTunnelId(_rIdentifier)) return reinterpret_cast(this); return 0; } -css::uno::Sequence OQueryDescriptor_Base::getUnoTunnelImplementationId() +css::uno::Sequence OQueryDescriptor_Base::getUnoTunnelId() { static cppu::OImplementationId aId; return aId.getImplementationId(); diff --git a/dbaccess/source/core/api/querydescriptor.hxx b/dbaccess/source/core/api/querydescriptor.hxx index 0d2f9fe1da80..077792906126 100644 --- a/dbaccess/source/core/api/querydescriptor.hxx +++ b/dbaccess/source/core/api/querydescriptor.hxx @@ -79,7 +79,7 @@ public: // css::lang::XUnoTunnel virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; virtual css::uno::Sequence SAL_CALL getImplementationId( ) override; -static css::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId(); +static css::uno::Sequence< sal_Int8 > getUnoTunnelId(); // css::lang::XServiceInfo ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/xmloff xmloff/source
include/xmloff/xmlimp.hxx |1 + xmloff/source/core/xmlimp.cxx |9 ++--- xmloff/source/transform/MutableAttrList.cxx |9 ++--- xmloff/source/transform/MutableAttrList.hxx |1 + xmloff/source/transform/OOo2Oasis.cxx | 15 --- xmloff/source/transform/OOo2Oasis.hxx |1 + xmloff/source/transform/Oasis2OOo.cxx | 15 --- xmloff/source/transform/Oasis2OOo.hxx |1 + 8 files changed, 32 insertions(+), 20 deletions(-) New commits: commit 5c4ba7cb99a7d4e4eefaa132e64d08fdc82ba759 Author: Arkadiy Illarionov AuthorDate: Sat Sep 7 16:03:28 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Sat Sep 14 09:57:48 2019 +0200 tdf#39593 use isUnoTunnelId in xmloff Add getUnoTunnelId methods. Change-Id: I80d3568e65ac66ee65ad589755a20270a27e62a7 Reviewed-on: https://gerrit.libreoffice.org/78744 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index d609ae099888..78bc26a7c234 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -343,6 +343,7 @@ public: virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override; // XUnoTunnel +static const css::uno::Sequence& getUnoTunnelId() throw(); virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; // XServiceInfo diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 6c832c7bc8d5..ba715329736a 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -449,12 +449,15 @@ namespace class theSvXMLImportUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSvXMLImportUnoTunnelId> {}; } +const css::uno::Sequence& SvXMLImport::getUnoTunnelId() throw() +{ +return theSvXMLImportUnoTunnelId::get().getSeq(); +} + // XUnoTunnel sal_Int64 SAL_CALL SvXMLImport::getSomething( const uno::Sequence< sal_Int8 >& rId ) { -if( rId.getLength() == 16 && -0 == memcmp( theSvXMLImportUnoTunnelId::get().getSeq().getConstArray(), - rId.getConstArray(), 16 ) ) +if( isUnoTunnelId(rId) ) { return sal::static_int_cast(reinterpret_cast(this)); } diff --git a/xmloff/source/transform/MutableAttrList.cxx b/xmloff/source/transform/MutableAttrList.cxx index ae06de27d3c0..38c500ce23f2 100644 --- a/xmloff/source/transform/MutableAttrList.cxx +++ b/xmloff/source/transform/MutableAttrList.cxx @@ -66,13 +66,16 @@ namespace class theXMLMutableAttributeListUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theXMLMutableAttributeListUnoTunnelId> {}; } +const css::uno::Sequence& XMLMutableAttributeList::getUnoTunnelId() throw() +{ +return theXMLMutableAttributeListUnoTunnelId::get().getSeq(); +} + // XUnoTunnel sal_Int64 SAL_CALL XMLMutableAttributeList::getSomething( const Sequence< sal_Int8 >& rId ) { -if( rId.getLength() == 16 && -0 == memcmp( theXMLMutableAttributeListUnoTunnelId::get().getSeq().getConstArray(), - rId.getConstArray(), 16 ) ) +if( isUnoTunnelId(rId) ) { return sal::static_int_cast(reinterpret_cast(this)); } diff --git a/xmloff/source/transform/MutableAttrList.hxx b/xmloff/source/transform/MutableAttrList.hxx index dd311560c655..ed8950042bee 100644 --- a/xmloff/source/transform/MutableAttrList.hxx +++ b/xmloff/source/transform/MutableAttrList.hxx @@ -47,6 +47,7 @@ public: virtual ~XMLMutableAttributeList() override; // XUnoTunnel +static const css::uno::Sequence& getUnoTunnelId() throw(); virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; // css::xml::sax::XAttributeList diff --git a/xmloff/source/transform/OOo2Oasis.cxx b/xmloff/source/transform/OOo2Oasis.cxx index d2c2ea35f23c..e5060c3846cd 100644 --- a/xmloff/source/transform/OOo2Oasis.cxx +++ b/xmloff/source/transform/OOo2Oasis.cxx @@ -1934,19 +1934,20 @@ namespace class theOOo2OasisTransformerUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theOOo2OasisTransformerUnoTunnelId> {}; } +const css::uno::Sequence& OOo2OasisTransformer::getUnoTunnelId() throw() +{ +return theOOo2OasisTransformerUnoTunnelId::get().getSeq(); +} + // XUnoTunnel sal_Int64 SAL_CALL OOo2OasisTransformer::getSomething( const Sequence< sal_Int8 >& rId ) { -if( rId.getLength() == 16 -&& 0 == memcmp( theOOo2OasisTransformerUnoTunnelId::get().getSeq().getConstArray(), -rId.getConstArray(), 16 ) ) +if( isUnoTunnelId(rId) ) { return reinterpret_cast< sal_Int64 >( this ); } -else -{ -return sal_Int64(0); -} + +return sal_Int64(0); } // XServiceInfo diff --git a/xmloff/source/transform/OOo2Oasis.hxx b/xmloff/source/transform/OOo2Oasis.hxx index
[Libreoffice-commits] core.git: framework/inc framework/source
framework/inc/uielement/rootitemcontainer.hxx |3 -- framework/source/fwi/uielement/rootitemcontainer.cxx | 11 +- framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx |7 +++--- framework/source/uiconfiguration/uiconfigurationmanager.cxx |7 +++--- 4 files changed, 11 insertions(+), 17 deletions(-) New commits: commit 8f35bb1fcc9c1efd7edc52efbfc33509de2c00f2 Author: Arkadiy Illarionov AuthorDate: Sat Sep 7 16:25:24 2019 +0300 Commit: Stephan Bergmann CommitDate: Wed Sep 11 23:45:08 2019 +0200 tdf#39593 Drop RootItemContainer::GetImplementation Replace with comphelper::getUnoTunnelImplementation. Also use isUnoTunnelId(). Change-Id: I014d27fd985836e9232b7f4772696b946eec907e Reviewed-on: https://gerrit.libreoffice.org/78745 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/framework/inc/uielement/rootitemcontainer.hxx b/framework/inc/uielement/rootitemcontainer.hxx index ce0aa4a426ec..a0238b94579e 100644 --- a/framework/inc/uielement/rootitemcontainer.hxx +++ b/framework/inc/uielement/rootitemcontainer.hxx @@ -69,8 +69,7 @@ class RootItemContainer final : private cppu::BaseMutex, virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; // XUnoTunnel -static FWI_DLLPUBLIC const css::uno::Sequence< sal_Int8 >& GetUnoTunnelId() throw(); -static FWI_DLLPUBLIC RootItemContainer* GetImplementation( const css::uno::Reference< css::uno::XInterface >& rxIFace ) throw(); +static FWI_DLLPUBLIC const css::uno::Sequence< sal_Int8 >& getUnoTunnelId() throw(); sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& rIdentifier ) override; // XIndexContainer diff --git a/framework/source/fwi/uielement/rootitemcontainer.cxx b/framework/source/fwi/uielement/rootitemcontainer.cxx index 4571b3b61603..f7e7eb28dbb7 100644 --- a/framework/source/fwi/uielement/rootitemcontainer.cxx +++ b/framework/source/fwi/uielement/rootitemcontainer.cxx @@ -142,7 +142,7 @@ Reference< XIndexAccess > RootItemContainer::deepCopyContainer( const Reference< // XUnoTunnel sal_Int64 RootItemContainer::getSomething( const css::uno::Sequence< sal_Int8 >& rIdentifier ) { -if( ( rIdentifier.getLength() == 16 ) && ( 0 == memcmp( RootItemContainer::GetUnoTunnelId().getConstArray(), rIdentifier.getConstArray(), 16 ) ) ) +if( isUnoTunnelId(rIdentifier) ) return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( this )); return 0; } @@ -152,18 +152,11 @@ namespace class theRootItemContainerUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theRootItemContainerUnoTunnelId > {}; } -const Sequence< sal_Int8 >& RootItemContainer::GetUnoTunnelId() throw() +const Sequence< sal_Int8 >& RootItemContainer::getUnoTunnelId() throw() { return theRootItemContainerUnoTunnelId::get().getSeq(); } -RootItemContainer* RootItemContainer::GetImplementation( const css::uno::Reference< css::uno::XInterface >& rxIFace ) throw() -{ -css::uno::Reference< css::lang::XUnoTunnel > xUT( rxIFace, css::uno::UNO_QUERY ); -return xUT.is() ? reinterpret_cast< RootItemContainer* >(sal::static_int_cast< sal_IntPtr >( - xUT->getSomething( RootItemContainer::GetUnoTunnelId() ))) : nullptr; -} - // XElementAccess sal_Bool SAL_CALL RootItemContainer::hasElements() { diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx index b629dbaefca3..36631222539e 100644 --- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx +++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx @@ -60,6 +60,7 @@ #include #include #include +#include #include using namespace css; @@ -427,7 +428,7 @@ void ModuleUIConfigurationManager::impl_requestUIElementData( sal_Int16 nElement { MenuConfiguration aMenuCfg( m_xContext ); Reference< XIndexAccess > xContainer( aMenuCfg.CreateMenuBarConfigurationFromXML( xInputStream )); -RootItemContainer* pRootItemContainer = RootItemContainer::GetImplementation( xContainer ); +auto pRootItemContainer = comphelper::getUnoTunnelImplementation( xContainer ); if ( pRootItemContainer ) aUIElementData.xSettings.set( static_cast< OWeakObject * >( new ConstItemContainer( pRootItemContainer, true ) ), UNO_QUERY ); else @@ -446,7 +447,7 @@ void ModuleUIConfigurationManager::impl_requestUIElementData( sal_Int16 nElement { Reference< XIndexContainer >
[Libreoffice-commits] core.git: unoxml/source
unoxml/source/dom/node.cxx |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) New commits: commit 694784687e502f2e68fde5c2e5d7fb860517cbf8 Author: Arkadiy Illarionov AuthorDate: Sat Sep 7 15:09:33 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Sat Sep 7 14:54:03 2019 +0200 tdf#39593 use isUnoTunnelId in unoxml Change-Id: I8f29df9763030ff69791bf978a359f36d553dda4 Reviewed-on: https://gerrit.libreoffice.org/78742 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/unoxml/source/dom/node.cxx b/unoxml/source/dom/node.cxx index 7171e6c2f791..cdeab8e2d419 100644 --- a/unoxml/source/dom/node.cxx +++ b/unoxml/source/dom/node.cxx @@ -993,9 +993,7 @@ namespace DOM ::sal_Int64 SAL_CALL CNode::getSomething(Sequence< ::sal_Int8 > const& rId) { -if ((rId.getLength() == 16) && -(0 == memcmp(getUnoTunnelId().getConstArray(), -rId.getConstArray(), 16))) +if (isUnoTunnelId(rId)) { return ::sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: connectivity/source include/comphelper
connectivity/source/drivers/ado/AColumns.cxx |3 ++- connectivity/source/drivers/ado/AGroups.cxx |3 ++- connectivity/source/drivers/ado/AIndexes.cxx |3 ++- connectivity/source/drivers/ado/AKeys.cxx|3 ++- connectivity/source/drivers/ado/ATable.cxx |2 +- connectivity/source/drivers/ado/ATables.cxx |3 ++- connectivity/source/drivers/ado/AUsers.cxx |3 ++- connectivity/source/drivers/ado/AViews.cxx |3 ++- include/comphelper/types.hxx | 10 -- 9 files changed, 15 insertions(+), 18 deletions(-) New commits: commit c1e1806c9c01d2ac2f62f95dd79cbb2037bc87af Author: Arkadiy Illarionov AuthorDate: Sat Sep 7 01:14:48 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Sat Sep 7 12:34:16 2019 +0200 tdf#39593 drop comphelper::getImplementation Replace with comphelper::getUnoTunnelImplementation. Change-Id: I96277aa9c17532ea6e2781dbc3305b2dbaa4e5c2 Reviewed-on: https://gerrit.libreoffice.org/78733 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/connectivity/source/drivers/ado/AColumns.cxx b/connectivity/source/drivers/ado/AColumns.cxx index ef010cfb4062..e9dc7720fc99 100644 --- a/connectivity/source/drivers/ado/AColumns.cxx +++ b/connectivity/source/drivers/ado/AColumns.cxx @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -59,7 +60,7 @@ Reference< XPropertySet > OColumns::createDescriptor() // XAppend sdbcx::ObjectType OColumns::appendObject( const OUString&, const Reference< XPropertySet >& descriptor ) { -OAdoColumn* pColumn = getImplementation( descriptor ); +OAdoColumn* pColumn = getUnoTunnelImplementation( descriptor ); Reference< XPropertySet > xColumn; if ( pColumn == nullptr ) { diff --git a/connectivity/source/drivers/ado/AGroups.cxx b/connectivity/source/drivers/ado/AGroups.cxx index 506aead14f7d..211f34f6bebe 100644 --- a/connectivity/source/drivers/ado/AGroups.cxx +++ b/connectivity/source/drivers/ado/AGroups.cxx @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -57,7 +58,7 @@ Reference< XPropertySet > OGroups::createDescriptor() // XAppend sdbcx::ObjectType OGroups::appendObject( const OUString& _rForName, const Reference< XPropertySet >& descriptor ) { -OAdoGroup* pGroup = getImplementation(descriptor); +OAdoGroup* pGroup = getUnoTunnelImplementation(descriptor); if ( pGroup == nullptr ) m_pCatalog->getConnection()->throwGenericSQLException( STR_INVALID_GROUP_DESCRIPTOR_ERROR,static_cast(this) ); diff --git a/connectivity/source/drivers/ado/AIndexes.cxx b/connectivity/source/drivers/ado/AIndexes.cxx index 46cd1c1a4b86..616cd863ada4 100644 --- a/connectivity/source/drivers/ado/AIndexes.cxx +++ b/connectivity/source/drivers/ado/AIndexes.cxx @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -57,7 +58,7 @@ Reference< XPropertySet > OIndexes::createDescriptor() // XAppend sdbcx::ObjectType OIndexes::appendObject( const OUString& _rForName, const Reference< XPropertySet >& descriptor ) { -OAdoIndex* pIndex = getImplementation(descriptor); +OAdoIndex* pIndex = getUnoTunnelImplementation(descriptor); if ( pIndex == nullptr ) m_pConnection->throwGenericSQLException( STR_INVALID_INDEX_DESCRIPTOR_ERROR,static_cast(this) ); diff --git a/connectivity/source/drivers/ado/AKeys.cxx b/connectivity/source/drivers/ado/AKeys.cxx index e306f918a726..19027e79ffb6 100644 --- a/connectivity/source/drivers/ado/AKeys.cxx +++ b/connectivity/source/drivers/ado/AKeys.cxx @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -57,7 +58,7 @@ Reference< XPropertySet > OKeys::createDescriptor() // XAppend sdbcx::ObjectType OKeys::appendObject( const OUString&, const Reference< XPropertySet >& descriptor ) { -OAdoKey* pKey = getImplementation( descriptor ); +OAdoKey* pKey = getUnoTunnelImplementation( descriptor ); if ( pKey == nullptr) m_pConnection->throwGenericSQLException( STR_INVALID_KEY_DESCRIPTOR_ERROR,static_cast(this) ); diff --git a/connectivity/source/drivers/ado/ATable.cxx b/connectivity/source/drivers/ado/ATable.cxx index 807dbb19055c..209255598476 100644 --- a/connectivity/source/drivers/ado/ATable.cxx +++ b/connectivity/source/drivers/ado/ATable.cxx @@ -164,7 +164,7 @@ void SAL_CALL OAdoTable::alterColumnByName( const OUString& colName, const Refer checkDisposed(OTableDescriptor_BASE_TYPEDEF::rBHelper.bDisposed); bool bError = true; -OAdoColumn* pColumn = ::comphelper::getImplementation(descriptor); +OAdoColumn* pColumn = comphelper::getUnoTunnelImplementation(descriptor); if(pColumn != nullptr) { WpADOColumns aColumns = m_aTable.get_Columns(); diff --git a/connectivity/source/drivers/ado/ATables.cxx b/connectivity/source/drivers/ado/ATables.cxx
[Libreoffice-commits] core.git: connectivity/source include/comphelper
connectivity/source/drivers/ado/AColumn.cxx|5 +++-- connectivity/source/drivers/ado/AConnection.cxx|5 +++-- connectivity/source/drivers/ado/ADriver.cxx|2 +- connectivity/source/drivers/ado/AGroup.cxx |5 +++-- connectivity/source/drivers/ado/AIndex.cxx |5 +++-- connectivity/source/drivers/ado/AKey.cxx |5 +++-- connectivity/source/drivers/ado/ATable.cxx |5 +++-- connectivity/source/drivers/ado/AUser.cxx |5 +++-- connectivity/source/drivers/ado/AView.cxx |5 +++-- connectivity/source/drivers/dbase/DIndex.cxx |2 +- connectivity/source/drivers/file/FDatabaseMetaData.cxx |2 +- connectivity/source/drivers/file/FResultSet.cxx|7 --- connectivity/source/drivers/file/FStatement.cxx|2 +- connectivity/source/drivers/file/FTable.cxx|5 +++-- connectivity/source/inc/ado/AColumn.hxx|2 +- connectivity/source/inc/ado/AConnection.hxx|2 +- connectivity/source/inc/ado/AGroup.hxx |2 +- connectivity/source/inc/ado/AIndex.hxx |2 +- connectivity/source/inc/ado/AKey.hxx |2 +- connectivity/source/inc/ado/ATable.hxx |2 +- connectivity/source/inc/ado/AUser.hxx |2 +- connectivity/source/inc/ado/AView.hxx |2 +- connectivity/source/inc/file/FResultSet.hxx|2 +- connectivity/source/inc/file/FTable.hxx|2 +- include/comphelper/types.hxx |2 +- 25 files changed, 46 insertions(+), 36 deletions(-) New commits: commit 03747db026a5b4959ec0700d9addf0482e6f5977 Author: Arkadiy Illarionov AuthorDate: Sat Sep 7 00:15:12 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Sat Sep 7 00:05:26 2019 +0200 tdf#39593 use isUnoTunnelId in connectivity Change-Id: I458049e23e9fc1855cb4ba9519b9b940f170b024 Reviewed-on: https://gerrit.libreoffice.org/78732 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/connectivity/source/drivers/ado/AColumn.cxx b/connectivity/source/drivers/ado/AColumn.cxx index 236d758760d1..c7d5a5fce5c2 100644 --- a/connectivity/source/drivers/ado/AColumn.cxx +++ b/connectivity/source/drivers/ado/AColumn.cxx @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -74,7 +75,7 @@ OAdoColumn::OAdoColumn(bool _bCase,OConnection* _pConnection) } -Sequence< sal_Int8 > OAdoColumn::getUnoTunnelImplementationId() +Sequence< sal_Int8 > OAdoColumn::getUnoTunnelId() { static ::cppu::OImplementationId implId; @@ -85,7 +86,7 @@ Sequence< sal_Int8 > OAdoColumn::getUnoTunnelImplementationId() sal_Int64 OAdoColumn::getSomething( const Sequence< sal_Int8 > & rId ) { -return (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) ) +return isUnoTunnelId(rId) ? reinterpret_cast< sal_Int64 >( this ) : OColumn_ADO::getSomething(rId); } diff --git a/connectivity/source/drivers/ado/AConnection.cxx b/connectivity/source/drivers/ado/AConnection.cxx index 32e0bcd4d2b6..c9251a9be88b 100644 --- a/connectivity/source/drivers/ado/AConnection.cxx +++ b/connectivity/source/drivers/ado/AConnection.cxx @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -487,14 +488,14 @@ void OConnection::disposing() sal_Int64 SAL_CALL OConnection::getSomething( const css::uno::Sequence< sal_Int8 >& rId ) { -return (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) ) +return isUnoTunnelId(rId) ? reinterpret_cast< sal_Int64 >( this ) : OConnection_BASE::getSomething(rId); } -Sequence< sal_Int8 > OConnection::getUnoTunnelImplementationId() +Sequence< sal_Int8 > OConnection::getUnoTunnelId() { static ::cppu::OImplementationId implId; diff --git a/connectivity/source/drivers/ado/ADriver.cxx b/connectivity/source/drivers/ado/ADriver.cxx index d97d018bc202..eae5ee686996 100644 --- a/connectivity/source/drivers/ado/ADriver.cxx +++ b/connectivity/source/drivers/ado/ADriver.cxx @@ -199,7 +199,7 @@ Reference< XTablesSupplier > SAL_CALL ODriver::getDataDefinitionByConnection( co Reference< css::lang::XUnoTunnel> xTunnel(connection,UNO_QUERY); if(xTunnel.is()) { -OConnection* pSearchConnection = reinterpret_cast< OConnection* >( xTunnel->getSomething(OConnection::getUnoTunnelImplementationId()) ); +OConnection* pSearchConnection = reinterpret_cast< OConnection* >( xTunnel->getSomething(OConnection::getUnoTunnelId()) ); auto foundConnection = std::any_of(m_xConnections.begin(), m_xConnections.end(),
[Libreoffice-commits] core.git: chart2/source connectivity/source dbaccess/source forms/source framework/source include/connectivity include/svl package/inc package/source reportdesign/inc reportdesig
chart2/source/model/main/ChartModel.cxx|3 -- chart2/source/view/main/ChartView.cxx |3 -- connectivity/source/commontools/ConnectionWrapper.cxx |5 ++- connectivity/source/commontools/TConnection.cxx|5 ++- connectivity/source/drivers/calc/CTable.cxx|5 ++- connectivity/source/drivers/dbase/DDatabaseMetaData.cxx|2 - connectivity/source/drivers/dbase/DIndex.cxx |5 ++- connectivity/source/drivers/dbase/DIndexes.cxx |4 +- connectivity/source/drivers/dbase/DResultSet.cxx |2 - connectivity/source/drivers/dbase/DTable.cxx | 11 --- connectivity/source/drivers/dbase/DTables.cxx |4 +- connectivity/source/drivers/file/FConnection.cxx |5 ++- connectivity/source/drivers/file/FDriver.cxx |2 - connectivity/source/drivers/flat/ETable.cxx|5 ++- connectivity/source/drivers/hsqldb/HDriver.cxx |2 - connectivity/source/drivers/hsqldb/HTable.cxx |5 ++- connectivity/source/drivers/mysql_jdbc/YDriver.cxx |4 +- connectivity/source/drivers/mysql_jdbc/YTable.cxx |9 ++ connectivity/source/drivers/writer/WTable.cxx |9 ++ connectivity/source/inc/TConnection.hxx|2 - connectivity/source/inc/calc/CTable.hxx|2 - connectivity/source/inc/dbase/DIndex.hxx |2 - connectivity/source/inc/dbase/DTable.hxx |2 - connectivity/source/inc/file/FConnection.hxx |2 - connectivity/source/inc/flat/ETable.hxx|2 - connectivity/source/inc/hsqldb/HTable.hxx |2 - connectivity/source/inc/mysql/YTable.hxx |2 - connectivity/source/inc/writer/WTable.hxx |2 - connectivity/source/sdbcx/VDescriptor.cxx |2 - dbaccess/source/core/api/RowSet.cxx| 13 dbaccess/source/core/api/RowSet.hxx|4 +- dbaccess/source/core/api/TableDeco.cxx |5 ++- dbaccess/source/core/api/table.cxx |5 ++- dbaccess/source/core/dataaccess/ContentHelper.cxx |3 +- dbaccess/source/core/dataaccess/databasecontext.cxx|5 ++- dbaccess/source/core/dataaccess/databasedocument.cxx |2 - dbaccess/source/core/inc/TableDeco.hxx |2 - dbaccess/source/core/inc/databasecontext.hxx |2 - dbaccess/source/core/inc/table.hxx |2 - dbaccess/source/ui/inc/JoinExchange.hxx|3 -- dbaccess/source/ui/querydesign/JoinExchange.cxx|7 ++-- forms/source/component/Columns.cxx |4 -- framework/source/fwi/uielement/constitemcontainer.cxx |2 - include/connectivity/ConnectionWrapper.hxx |2 - include/svl/style.hxx |4 -- package/inc/ZipPackage.hxx |2 - package/inc/ZipPackageFolder.hxx |2 - package/inc/ZipPackageStream.hxx |2 - package/source/zippackage/ZipPackage.cxx | 11 --- package/source/zippackage/ZipPackageEntry.cxx |2 - package/source/zippackage/ZipPackageFolder.cxx | 10 +++--- package/source/zippackage/ZipPackageStream.cxx |6 ++-- reportdesign/inc/ReportDefinition.hxx |2 - reportdesign/source/core/api/ReportDefinition.cxx |7 ++-- reportdesign/source/core/api/Section.cxx |2 - sc/source/ui/unoobj/docuno.cxx |4 -- sc/source/ui/vba/vbaworkbook.cxx |3 -- sd/source/ui/inc/ViewTabBar.hxx|3 +- sd/source/ui/unoidl/unomodel.cxx | 12 sd/source/ui/view/ViewTabBar.cxx |3 -- sfx2/source/control/thumbnailviewacc.cxx |6 ++-- sfx2/source/control/thumbnailviewacc.hxx |9 ++ svl/source/items/style.cxx | 12 +++- svtools/source/control/valueacc.cxx|8 ++--- svtools/source/control/valueimp.hxx| 12 ++-- sw/source/uibase/uno/unotxdoc.cxx |4 -- xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx |
[Libreoffice-commits] core.git: accessibility/source
accessibility/source/extended/AccessibleBrowseBoxHeaderBar.cxx |2 accessibility/source/extended/AccessibleGridControlTable.cxx | 11 accessibility/source/extended/textwindowaccessibility.cxx| 148 +++--- accessibility/source/standard/vclxaccessiblecombobox.cxx |7 accessibility/source/standard/vclxaccessibledropdowncombobox.cxx |7 accessibility/source/standard/vclxaccessibledropdownlistbox.cxx |7 accessibility/source/standard/vclxaccessiblelist.cxx |7 accessibility/source/standard/vclxaccessiblelistbox.cxx |7 accessibility/source/standard/vclxaccessibleradiobutton.cxx |8 accessibility/source/standard/vclxaccessibletextfield.cxx|7 accessibility/source/standard/vclxaccessibletoolbox.cxx |7 11 files changed, 78 insertions(+), 140 deletions(-) New commits: commit 396869e0e71bd33f5d962779abf72f35d01245e5 Author: Arkadiy Illarionov AuthorDate: Tue Sep 3 20:24:49 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Thu Sep 5 14:53:10 2019 +0200 Simplify Sequence iterations in accessibility Use range-based loops, STL and comphelper functions. Change-Id: I600f6eeffd606859c24cdce8faeaead29abfb843 Reviewed-on: https://gerrit.libreoffice.org/78573 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/accessibility/source/extended/AccessibleBrowseBoxHeaderBar.cxx b/accessibility/source/extended/AccessibleBrowseBoxHeaderBar.cxx index f22238fd1b17..5a88993125aa 100644 --- a/accessibility/source/extended/AccessibleBrowseBoxHeaderBar.cxx +++ b/accessibility/source/extended/AccessibleBrowseBoxHeaderBar.cxx @@ -343,7 +343,7 @@ sal_Int32 AccessibleBrowseBoxHeaderBar::implGetChildIndexFromSelectedIndex( if( (nSelectedChildIndex < 0) || (nSelectedChildIndex >= aSelSeq.getLength()) ) throw lang::IndexOutOfBoundsException(); -return aSelSeq[ nSelectedChildIndex ]; +return aSelSeq.getConstArray()[ nSelectedChildIndex ]; } void AccessibleBrowseBoxHeaderBar::ensureIsValidHeaderIndex( sal_Int32 nIndex ) diff --git a/accessibility/source/extended/AccessibleGridControlTable.cxx b/accessibility/source/extended/AccessibleGridControlTable.cxx index 587c8fb7b9dc..dabafb4b719e 100644 --- a/accessibility/source/extended/AccessibleGridControlTable.cxx +++ b/accessibility/source/extended/AccessibleGridControlTable.cxx @@ -165,17 +165,8 @@ sal_Bool SAL_CALL AccessibleGridControlTable::isAccessibleRowSelected( sal_Int32 ensureIsAlive(); ensureIsValidRow( nRow ); -bool bSelected = false; Sequence< sal_Int32 > selectedRows = getSelectedAccessibleRows(); -for(int i=0; i Document::retrieveCharacterAttributes( Paragraph const * pParagraph, ::sal_Int32 nIndex, @@ -929,81 +916,65 @@ Document::retrieveCharacterAttributes( vcl::Font aFont = m_rEngine.GetFont(); const sal_Int32 AttributeCount = 9; -sal_Int32 i = 0; -css::uno::Sequence< css::beans::PropertyValue > aAttribs( AttributeCount ); +std::vector< css::beans::PropertyValue > aAttribs; +aAttribs.reserve(AttributeCount); + +css::beans::PropertyValue aAttrib; +aAttrib.Handle = -1; +aAttrib.State = css::beans::PropertyState_DIRECT_VALUE; //character background color -aAttribs[i].Name = "CharBackColor"; -aAttribs[i].Handle = -1; -aAttribs[i].Value = mapFontColor( aFont.GetFillColor() ); -aAttribs[i].State = css::beans::PropertyState_DIRECT_VALUE; -i++; +aAttrib.Name = "CharBackColor"; +aAttrib.Value = mapFontColor( aFont.GetFillColor() ); +aAttribs.push_back(aAttrib); //character color -aAttribs[i].Name = "CharColor"; -aAttribs[i].Handle = -1; -//aAttribs[i].Value = mapFontColor( aFont.GetColor() ); -aAttribs[i].Value = mapFontColor( m_rEngine.GetTextColor() ); -aAttribs[i].State = css::beans::PropertyState_DIRECT_VALUE; -i++; +aAttrib.Name = "CharColor"; +//aAttrib.Value = mapFontColor( aFont.GetColor() ); +aAttrib.Value = mapFontColor( m_rEngine.GetTextColor() ); +aAttribs.push_back(aAttrib); //character font name -aAttribs[i].Name = "CharFontName"; -aAttribs[i].Handle = -1; -aAttribs[i].Value <<= aFont.GetFamilyName(); -aAttribs[i].State = css::beans::PropertyState_DIRECT_VALUE; -i++; +aAttrib.Name = "CharFontName"; +aAttrib.Value <<= aFont.GetFamilyName(); +aAttribs.push_back(aAttrib); //character height -aAttribs[i].Name = "CharHeight"; -aAttribs[i].Handle = -1; -aAttribs[i].Value <<= static_cast(aFont.GetFontHeight()); -aAttribs[i].State = css::beans::PropertyState_DIRECT_VALUE; -i++; +aAttrib.Name = "CharHeight"; +aAttrib.Value <<= static_cast(aFont.GetFontHeight()); +aAttribs.push_back(aAttrib); //character posture -aAttribs[i].Name = "CharPosture"; -aAttribs[i].Handle = -1; -aAttribs[i].Value <<= static_cast(aFont.GetItalic()); -
[Libreoffice-commits] core.git: accessibility/source
accessibility/source/standard/vclxaccessibletoolbox.cxx | 48 1 file changed, 13 insertions(+), 35 deletions(-) New commits: commit ed5064d819ff423766311516f2cdf0707b41cab3 Author: Arkadiy Illarionov AuthorDate: Tue Sep 3 01:26:56 2019 +0300 Commit: Stephan Bergmann CommitDate: Tue Sep 3 08:40:50 2019 +0200 tdf#39593 Drop OToolBoxWindowItem::isWindowItem Replace with comphelper::getUnoTunnelImplementation. Also use isUnoTunnelId(). Change-Id: I1cf42a483a5c2c9734e4c1f8dd3ba76fd9c7f5e6 Reviewed-on: https://gerrit.libreoffice.org/78429 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/accessibility/source/standard/vclxaccessibletoolbox.cxx b/accessibility/source/standard/vclxaccessibletoolbox.cxx index 7683923ce4b8..7d266d2b6de1 100644 --- a/accessibility/source/standard/vclxaccessibletoolbox.cxx +++ b/accessibility/source/standard/vclxaccessibletoolbox.cxx @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -93,7 +94,7 @@ namespace sal_Int32getIndexInParent() const{ return m_nIndexInParent; } void setIndexInParent( sal_Int32 _nNewIndex ){ m_nIndexInParent = _nNewIndex; } -static boolisWindowItem( const Reference< XAccessible >& _rxAcc, OToolBoxWindowItem** /* [out] */ _ppImplementation ); +static Sequence< sal_Int8 > getUnoTunnelId(); public: OToolBoxWindowItem(sal_Int32 _nIndexInParent, @@ -120,7 +121,6 @@ namespace // XUnoTunnel virtual sal_Int64 SAL_CALL getSomething( const Sequence< sal_Int8 >& aIdentifier ) override; -static Sequence< sal_Int8 > getUnoTunnelImplementationId(); }; IMPLEMENT_FORWARD_XINTERFACE2( OToolBoxWindowItem, OAccessibleWrapper, OToolBoxWindowItem_Base ) @@ -132,21 +132,7 @@ namespace return new OToolBoxWindowItemContext( m_nIndexInParent, getComponentContext(), _rxInnerContext, this, getParent() ); } -bool OToolBoxWindowItem::isWindowItem( const Reference< XAccessible >& _rxAcc, OToolBoxWindowItem** /* [out] */ _ppImplementation ) -{ -OToolBoxWindowItem* pImplementation = nullptr; - -Reference< XUnoTunnel > xTunnel( _rxAcc, UNO_QUERY ); -if ( xTunnel.is() ) -pImplementation = reinterpret_cast< OToolBoxWindowItem* >( xTunnel->getSomething( getUnoTunnelImplementationId() ) ); - -if ( _ppImplementation ) -*_ppImplementation = pImplementation; - -return pImplementation != nullptr; -} - -Sequence< sal_Int8 > OToolBoxWindowItem::getUnoTunnelImplementationId() +Sequence< sal_Int8 > OToolBoxWindowItem::getUnoTunnelId() { static ::cppu::OImplementationId implId; @@ -155,9 +141,7 @@ namespace sal_Int64 SAL_CALL OToolBoxWindowItem::getSomething( const Sequence< sal_Int8 >& _rId ) { -if ( ( _rId.getLength() == 16 ) -&& ( memcmp( getUnoTunnelImplementationId().getConstArray(), _rId.getConstArray(), 16 ) == 0 ) -) +if (isUnoTunnelId(_rId)) return reinterpret_cast< sal_Int64>( this ); return 0; @@ -316,19 +300,16 @@ void VCLXAccessibleToolBox::implReleaseToolboxItem( ToolBoxItemsMap::iterator co NotifyAccessibleEvent( AccessibleEventId::CHILD, Any( xItemAcc ), Any() ); } -OToolBoxWindowItem* pWindowItem = nullptr; -if ( !OToolBoxWindowItem::isWindowItem( xItemAcc, ) ) +auto pWindowItem = comphelper::getUnoTunnelImplementation(xItemAcc); +if ( !pWindowItem ) { static_cast< VCLXAccessibleToolBoxItem* >( xItemAcc.get() )->ReleaseToolBox(); ::comphelper::disposeComponent( xItemAcc ); } else { -if ( pWindowItem ) -{ -Reference< XAccessibleContext > xContext( pWindowItem->getContextNoCreate() ); -::comphelper::disposeComponent( xContext ); -} +Reference< XAccessibleContext > xContext( pWindowItem->getContextNoCreate() ); +::comphelper::disposeComponent( xContext ); } } @@ -350,8 +331,8 @@ void VCLXAccessibleToolBox::UpdateItem_Impl( ToolBox::ImplToolItems::size_type _ { Reference< XAccessible > xItemAcc( aIndexAdjust->second ); -OToolBoxWindowItem* pWindowItem = nullptr; -if ( !OToolBoxWindowItem::isWindowItem( xItemAcc, ) ) +auto pWindowItem = comphelper::getUnoTunnelImplementation(xItemAcc); +if ( !pWindowItem ) { VCLXAccessibleToolBoxItem* pItem = static_cast< VCLXAccessibleToolBoxItem* >( xItemAcc.get() ); if ( pItem ) @@ -363,12 +344,9 @@ void VCLXAccessibleToolBox::UpdateItem_Impl( ToolBox::ImplToolItems::size_type _ } else { -if ( pWindowItem ) -{ -sal_Int32 nIndex =
[Libreoffice-commits] core.git: io/source
io/source/TextInputStream/TextInputStream.cxx | 19 +++-- io/source/stm/odata.cxx | 50 +- io/source/stm/streamhelper.cxx| 13 +++--- 3 files changed, 30 insertions(+), 52 deletions(-) New commits: commit 01837a85004a6f891a09c0a63ed7eff75d634827 Author: Arkadiy Illarionov AuthorDate: Sat Aug 31 17:40:19 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Sun Sep 1 02:04:50 2019 +0200 Simplify Sequence iterations in io Use comphelper::findValue and initializer lists. Change-Id: I4ebaf556a21b263e48b82a7290093eb8a832d9da Reviewed-on: https://gerrit.libreoffice.org/78351 Tested-by: Jenkins Reviewed-by: Mike Kaganski Reviewed-by: Arkadiy Illarionov diff --git a/io/source/TextInputStream/TextInputStream.cxx b/io/source/TextInputStream/TextInputStream.cxx index c1ae805571f6..d90f30976ec8 100644 --- a/io/source/TextInputStream/TextInputStream.cxx +++ b/io/source/TextInputStream/TextInputStream.cxx @@ -19,6 +19,7 @@ #include +#include #include #include @@ -167,8 +168,6 @@ OUString OTextInputStream::implReadString( const Sequence< sal_Unicode >& Delimi bool bFound = false; bool bFoundFirstLineEndChar = false; sal_Unicode cFirstLineEndChar = 0; -const sal_Unicode* pDelims = Delimiters.getConstArray(); -const sal_Int32 nDelimCount = Delimiters.getLength(); while( !bFound ) { // Still characters available? @@ -213,18 +212,12 @@ OUString OTextInputStream::implReadString( const Sequence< sal_Unicode >& Delimi cFirstLineEndChar = c; } } -else +else if( comphelper::findValue(Delimiters, c) != -1 ) { -for( sal_Int32 i = 0 ; i < nDelimCount ; i++ ) -{ -if( c == pDelims[ i ] ) -{ -bFound = true; -nCopyLen = nBufferReadPos; -if( bRemoveDelimiter ) -nCopyLen--; -} -} +bFound = true; +nCopyLen = nBufferReadPos; +if( bRemoveDelimiter ) +nCopyLen--; } } diff --git a/io/source/stm/odata.cxx b/io/source/stm/odata.cxx index 260280216c11..0c1dd29f9bb1 100644 --- a/io/source/stm/odata.cxx +++ b/io/source/stm/odata.cxx @@ -167,7 +167,7 @@ sal_Int8 ODataInputStream::readByte() { throw UnexpectedEOFException(); } -return aTmp.getArray()[0]; +return aTmp.getConstArray()[0]; } sal_Unicode ODataInputStream::readChar() @@ -522,54 +522,40 @@ void ODataOutputStream::writeBoolean(sal_Bool Value) void ODataOutputStream::writeByte(sal_Int8 Value) { -Sequence aTmp( 1 ); -aTmp.getArray()[0] = Value; -writeBytes( aTmp ); +writeBytes( { Value } ); } void ODataOutputStream::writeChar(sal_Unicode Value) { -Sequence aTmp( 2 ); -sal_Int8 * pBytes = aTmp.getArray(); -pBytes[0] = sal_Int8(Value >> 8); -pBytes[1] = sal_Int8(Value); -writeBytes( aTmp ); +writeBytes( { sal_Int8(Value >> 8), + sal_Int8(Value) } ); } void ODataOutputStream::writeShort(sal_Int16 Value) { -Sequence aTmp( 2 ); -sal_Int8 * pBytes = aTmp.getArray(); -pBytes[0] = sal_Int8(Value >> 8); -pBytes[1] = sal_Int8(Value); -writeBytes( aTmp ); +writeBytes( { sal_Int8(Value >> 8), + sal_Int8(Value) } ); } void ODataOutputStream::writeLong(sal_Int32 Value) { -Sequence aTmp( 4 ); -sal_Int8 * pBytes = aTmp.getArray(); -pBytes[0] = sal_Int8(Value >> 24); -pBytes[1] = sal_Int8(Value >> 16); -pBytes[2] = sal_Int8(Value >> 8); -pBytes[3] = sal_Int8(Value); -writeBytes( aTmp ); +writeBytes( { sal_Int8(Value >> 24), + sal_Int8(Value >> 16), + sal_Int8(Value >> 8), + sal_Int8(Value) } ); } void ODataOutputStream::writeHyper(sal_Int64 Value) { -Sequence aTmp( 8 ); -sal_Int8 * pBytes = aTmp.getArray(); -pBytes[0] = sal_Int8(Value >> 56); -pBytes[1] = sal_Int8(Value >> 48); -pBytes[2] = sal_Int8(Value >> 40); -pBytes[3] = sal_Int8(Value >> 32); -pBytes[4] = sal_Int8(Value >> 24); -pBytes[5] = sal_Int8(Value >> 16); -pBytes[6] = sal_Int8(Value >> 8); -pBytes[7] = sal_Int8(Value); -writeBytes( aTmp ); +writeBytes( { sal_Int8(Value >> 56), + sal_Int8(Value >> 48), + sal_Int8(Value >> 40), + sal_Int8(Value >> 32), + sal_Int8(Value >> 24), + sal_Int8(Value >> 16), + sal_Int8(Value >> 8), + sal_Int8(Value) } ); } diff --git a/io/source/stm/streamhelper.cxx b/io/source/stm/streamhelper.cxx index 20280b850563..be0644d5e1b2 100644 --- a/io/source/stm/streamhelper.cxx +++ b/io/source/stm/streamhelper.cxx @@ -118,7 +118,7 @@ void
[Libreoffice-commits] core.git: lingucomponent/source linguistic/source lotuswordpro/source
lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx | 60 +-- lingucomponent/source/languageguessing/guesslang.cxx| 18 - lingucomponent/source/spellcheck/spell/sspellimp.cxx|7 lingucomponent/source/thesaurus/libnth/nthesimp.cxx | 63 +-- linguistic/source/convdic.cxx | 47 -- linguistic/source/convdiclist.cxx | 34 - linguistic/source/dlistimp.cxx | 13 linguistic/source/gciterator.cxx| 19 - linguistic/source/hyphdsp.cxx | 18 - linguistic/source/lngopt.cxx| 30 - linguistic/source/lngprophelp.cxx | 149 +++- linguistic/source/lngsvcmgr.cxx | 279 +--- linguistic/source/misc.cxx | 65 +-- linguistic/source/misc2.cxx | 26 - linguistic/source/spelldsp.cxx | 38 -- linguistic/source/spelldta.cxx |8 linguistic/source/thesdsp.cxx | 29 - lotuswordpro/source/filter/LotusWordProImportFilter.cxx | 26 - 18 files changed, 341 insertions(+), 588 deletions(-) New commits: commit 760a377f7148e623e9e16d24e66f54a401ecb946 Author: Arkadiy Illarionov AuthorDate: Thu Aug 29 00:51:02 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Fri Aug 30 14:15:57 2019 +0200 Simplify Sequence iterations in lingucomponent..lotuswordpro Use range-based loops, STL and comphelper functions. Change-Id: I975a9c09265976d5ce4a1d7ac2023cbb75bb7f28 Reviewed-on: https://gerrit.libreoffice.org/78242 Reviewed-by: Mike Kaganski Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx index bd38e3d470d4..2008395319e0 100644 --- a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx +++ b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx @@ -19,6 +19,7 @@ #include +#include #include #include #include @@ -51,6 +52,7 @@ #include #include +#include #include #include #include @@ -113,11 +115,10 @@ Sequence< Locale > SAL_CALL Hyphenator::getLocales() uno::Sequence< OUString > aFormatList; aLinguCfg.GetSupportedDictionaryFormatsFor( "Hyphenators", "org.openoffice.lingu.LibHnjHyphenator", aFormatList ); -sal_Int32 nLen = aFormatList.getLength(); -for (sal_Int32 i = 0; i < nLen; ++i) +for (const auto& rFormat : std::as_const(aFormatList)) { std::vector< SvtLinguConfigDictionaryEntry > aTmpDic( -aLinguCfg.GetActiveDictionariesByFormat( aFormatList[i] ) ); +aLinguCfg.GetActiveDictionariesByFormat( rFormat ) ); aDics.insert( aDics.end(), aTmpDic.begin(), aTmpDic.end() ); } @@ -132,57 +133,50 @@ Sequence< Locale > SAL_CALL Hyphenator::getLocales() // is not yet supported by the list of new style dictionaries MergeNewStyleDicsAndOldStyleDics( aDics, aOldStyleDics ); -sal_Int32 numdict = aDics.size(); -if (numdict) +if (!aDics.empty()) { // get supported locales from the dictionaries-to-use... -sal_Int32 k = 0; std::set aLocaleNamesSet; for (auto const& dict : aDics) { -uno::Sequence< OUString > aLocaleNames( dict.aLocaleNames ); -sal_Int32 nLen2 = aLocaleNames.getLength(); -for (k = 0; k < nLen2; ++k) +for (const auto& rLocaleName : dict.aLocaleNames) { -aLocaleNamesSet.insert( aLocaleNames[k] ); +aLocaleNamesSet.insert( rLocaleName ); } } // ... and add them to the resulting sequence -aSuppLocales.realloc( aLocaleNamesSet.size() ); -k = 0; -for (auto const& localeName : aLocaleNamesSet) -{ -Locale aTmp( LanguageTag::convertToLocale(localeName)); -aSuppLocales[k++] = aTmp; -} +std::vector aLocalesVec; +aLocalesVec.reserve(aLocaleNamesSet.size()); + +std::transform(aLocaleNamesSet.begin(), aLocaleNamesSet.end(), std::back_inserter(aLocalesVec), +[](const OUString& localeName) { return LanguageTag::convertToLocale(localeName); }); + +aSuppLocales = comphelper::containerToSequence(aLocalesVec); //! For each dictionary and each locale we need a separate entry. //! If this results in more than one dictionary per locale than (for now) //! it is undefined which dictionary gets used. //! In the future the implementation should support
[Libreoffice-commits] core.git: oox/source
oox/source/core/filterbase.cxx | 11 oox/source/core/xmlfilterbase.cxx | 59 -- oox/source/docprop/docprophandler.cxx | 25 oox/source/docprop/ooxmldocpropimport.cxx | 46 - oox/source/drawingml/chart/chartspaceconverter.cxx | 20 oox/source/drawingml/customshapeproperties.cxx | 26 oox/source/drawingml/diagram/diagram.cxx | 10 oox/source/drawingml/shape.cxx | 30 - oox/source/drawingml/textcharacterproperties.cxx | 12 oox/source/export/chartexport.cxx | 119 +--- oox/source/export/drawingml.cxx| 606 + oox/source/export/shapes.cxx | 11 oox/source/helper/propertyset.cxx |6 oox/source/mathml/importutils.cxx | 10 oox/source/ole/vbaexport.cxx |8 oox/source/ppt/timenode.cxx|9 oox/source/shape/ShapeFilterBase.cxx |6 oox/source/vml/vmlformatting.cxx |3 oox/source/vml/vmlshape.cxx| 55 - 19 files changed, 482 insertions(+), 590 deletions(-) New commits: commit 36543fc426f0358086484f9b8e439cf051d0e12b Author: Arkadiy Illarionov AuthorDate: Mon Aug 12 23:07:08 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Tue Aug 27 12:58:33 2019 +0200 Simplify Sequence iterations in oox Use range-based loops, STL and comphelper functions Change-Id: Ic3a186e7381bd8391ab85a2602a30f06fe5db740 Reviewed-on: https://gerrit.libreoffice.org/78089 Tested-by: Jenkins Reviewed-by: Mike Kaganski Reviewed-by: Arkadiy Illarionov diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx index 1346353c9d22..c99c77ba870f 100644 --- a/oox/source/core/filterbase.cxx +++ b/oox/source/core/filterbase.cxx @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -430,14 +431,8 @@ void SAL_CALL FilterBase::initialize( const Sequence< Any >& rArgs ) { css::uno::Sequence aUserDataSeq; rVal.Value >>= aUserDataSeq; -sal_Int32 nUserDataSeqLen = aUserDataSeq.getLength(); -for (sal_Int32 j = 0; j < nUserDataSeqLen; ++j) -{ -if (aUserDataSeq[j] == "macro-enabled") -{ -mxImpl->mbExportVBA = true; -} -} +if (comphelper::findValue(aUserDataSeq, "macro-enabled") != -1) +mxImpl->mbExportVBA = true; } else if (rVal.Name == "Flags") { diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index d62250344686..48e1ad66f079 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -163,8 +163,8 @@ void registerNamespaces( FastParser& rParser ) // Filter out duplicates: a namespace can have multiple URLs, think of // strict vs transitional. std::set aSet; -for (sal_Int32 i = 0; i < ids.getLength(); ++i) -aSet.insert(ids[i].Second); +for (const auto& rId : ids) +aSet.insert(rId.Second); for (auto const& elem : aSet) rParser.registerNamespace(elem); @@ -878,20 +878,16 @@ Reference< XInputStream > XmlFilterBase::implGetInputStream( MediaDescriptor& rM Reference XmlFilterBase::implGetOutputStream( MediaDescriptor& rMediaDescriptor ) const { -Sequence< NamedValue > aMediaEncData = rMediaDescriptor.getUnpackedValueOrDefault( +const Sequence< NamedValue > aMediaEncData = rMediaDescriptor.getUnpackedValueOrDefault( MediaDescriptor::PROP_ENCRYPTIONDATA(), Sequence< NamedValue >() ); OUString aPassword; -for (int i=0; i>= aPassword; -break; -} -} +auto pProp = std::find_if(aMediaEncData.begin(), aMediaEncData.end(), +[](const NamedValue& rProp) { return rProp.Name == "OOXPassword"; }); +if (pProp != aMediaEncData.end()) +pProp->Value >>= aPassword; + if (aPassword.isEmpty()) { return FilterBase::implGetOutputStream( rMediaDescriptor ); @@ -909,21 +905,16 @@ bool XmlFilterBase::implFinalizeExport( MediaDescriptor& rMediaDescriptor ) { bool bRet = true; -Sequence< NamedValue > aMediaEncData = rMediaDescriptor.getUnpackedValueOrDefault( +const Sequence< NamedValue > aMediaEncData = rMediaDescriptor.getUnpackedValueOrDefault( MediaDescriptor::PROP_ENCRYPTIONDATA(), Sequence< NamedValue >() ); OUString aPassword; -for (int i=0; i>= aPassword; -break; -} -} +auto pProp = std::find_if(aMediaEncData.begin(),
[Libreoffice-commits] core.git: animations/source editeng/source include/comphelper include/toolkit sc/source sd/source starmath/source svx/source sw/inc sw/source toolkit/source vcl/source xmloff/sou
animations/source/animcore/animcore.cxx |2 - editeng/source/uno/unofield.cxx |3 -- editeng/source/uno/unotext.cxx|6 +--- include/comphelper/servicehelper.hxx | 13 ++ include/toolkit/controls/unocontrolmodel.hxx |2 - sc/source/ui/app/drwtrans.cxx |3 -- sc/source/ui/app/transobj.cxx |3 -- sc/source/ui/unoobj/dapiuno.cxx |4 --- sc/source/ui/unoobj/docuno.cxx|4 --- sc/source/ui/unoobj/nameuno.cxx |4 --- sc/source/ui/unoobj/textuno.cxx |4 --- sc/source/ui/vba/vbaworksheet.cxx |3 -- sd/source/ui/app/sdxfer.cxx |3 -- sd/source/ui/dlg/sdtreelb.cxx |3 -- sd/source/ui/framework/factories/Pane.cxx |3 -- sd/source/ui/framework/factories/ViewShellWrapper.cxx |3 -- sd/source/ui/unoidl/DrawController.cxx|3 -- sd/source/ui/unoidl/unopage.cxx |3 -- starmath/source/mathmlexport.cxx |4 --- starmath/source/mathmlimport.cxx |4 --- starmath/source/unomodel.cxx |6 +--- svx/source/fmcomp/gridcell.cxx|4 --- svx/source/unodraw/unoshape.cxx |2 - sw/inc/unobaseclass.hxx |5 +-- sw/source/core/unocore/TextCursorHelper.cxx | 10 +++ sw/source/core/unocore/unochart.cxx |4 --- sw/source/core/unocore/unodraw.cxx|4 --- sw/source/core/unocore/unoframe.cxx |4 --- sw/source/core/unocore/unoport.cxx|4 --- sw/source/core/unocore/unoportenum.cxx|4 --- sw/source/core/unocore/unosett.cxx|8 +- sw/source/core/unocore/unosrch.cxx|4 --- sw/source/core/unocore/unotbl.cxx | 11 ++-- sw/source/filter/xml/xmlexp.cxx |4 --- sw/source/filter/xml/xmlimp.cxx |4 --- sw/source/uibase/dochdl/swdtflvr.cxx |3 -- sw/source/uibase/uno/unoatxt.cxx | 12 +++-- sw/source/uibase/uno/unodispatch.cxx |6 +--- sw/source/uibase/uno/unotxdoc.cxx |6 +--- sw/source/uibase/uno/unotxvw.cxx | 10 +++ toolkit/source/controls/grid/gridcolumn.cxx |3 +- toolkit/source/controls/unocontrolmodel.cxx |4 +-- vcl/source/graphic/UnoGraphic.cxx |3 +- vcl/source/treelist/transfer.cxx |3 -- xmloff/source/core/unoatrcn.cxx |3 -- xmlsecurity/source/gpg/CertificateImpl.cxx|2 - xmlsecurity/source/gpg/SecurityEnvironment.cxx|2 - xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx |2 - xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx |2 - 49 files changed, 77 insertions(+), 139 deletions(-) New commits: commit 24c17dab2f10ad1b7ba342fbd40dc65b7d8f9b24 Author: Arkadiy Illarionov AuthorDate: Wed Jun 12 12:18:07 2019 +0300 Commit: Stephan Bergmann CommitDate: Fri Aug 23 09:10:49 2019 +0200 tdf#39593 extract UnoTunnelId comparison to template function Change-Id: Ia2b5dea273c8de7b8c54e74780193a8d4cba7b45 Reviewed-on: https://gerrit.libreoffice.org/73874 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/animations/source/animcore/animcore.cxx b/animations/source/animcore/animcore.cxx index 9078b2fe4649..b7e28dc15c6d 100644 --- a/animations/source/animcore/animcore.cxx +++ b/animations/source/animcore/animcore.cxx @@ -1935,7 +1935,7 @@ void SAL_CALL AnimationNode::removeChangesListener( const Reference< XChangesLis // XUnoTunnel ::sal_Int64 SAL_CALL AnimationNode::getSomething( const Sequence< ::sal_Int8 >& rId ) { -if( rId.getLength() == 16 && memcmp( getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) == 0 ) +if( isUnoTunnelId(rId) ) { return sal::static_int_cast< sal_Int64 >(reinterpret_cast< sal_IntPtr >(this)); diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx index ab1b0927dceb..94ca091bead8 100644 --- a/editeng/source/uno/unofield.cxx +++
[Libreoffice-commits] core.git: package/source
package/source/manifest/ManifestExport.cxx | 105 +++ package/source/xstor/ocompinstream.cxx | 109 +++ package/source/xstor/owriteablestream.cxx | 345 ++--- package/source/xstor/xfactory.cxx | 27 + package/source/xstor/xstorage.cxx | 277 package/source/zippackage/ZipPackage.cxx | 114 +++- package/source/zippackage/ZipPackageStream.cxx |6 package/source/zippackage/zipfileaccess.cxx|4 8 files changed, 441 insertions(+), 546 deletions(-) New commits: commit 38001018fa06f721cf87edae923b54ce9a5ab5a7 Author: Arkadiy Illarionov AuthorDate: Sat Aug 10 18:34:33 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Thu Aug 22 18:03:16 2019 +0200 Simplify Sequence iterations in package Use range-based loops, STL and comphelper functions Change-Id: Ibd836b9b2df2f30b42f2d7a621188d78f5b53196 Reviewed-on: https://gerrit.libreoffice.org/77246 Tested-by: Jenkins Reviewed-by: Mike Kaganski Reviewed-by: Arkadiy Illarionov diff --git a/package/source/manifest/ManifestExport.cxx b/package/source/manifest/ManifestExport.cxx index f8c2d0399d4f..4b4d57ce9294 100644 --- a/package/source/manifest/ManifestExport.cxx +++ b/package/source/manifest/ManifestExport.cxx @@ -111,33 +111,30 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con const OUString sPGP_Name( PGP_NAME ); ::comphelper::AttributeList * pRootAttrList = new ::comphelper::AttributeList; -const uno::Sequence < beans::PropertyValue > *pSequence = rManList.getConstArray(); -const sal_uInt32 nManLength = rManList.getLength(); // find the mediatype of the document if any OUString aDocMediaType; OUString aDocVersion; -sal_Int32 nRootFolderPropIndex=-1; -for (sal_uInt32 nInd = 0; nInd < nManLength ; nInd++ ) +const uno::Sequence* pRootFolderPropSeq = nullptr; +for (const uno::Sequence < beans::PropertyValue >& rSequence : rManList) { OUString aMediaType; OUString aPath; OUString aVersion; -const beans::PropertyValue *pValue = pSequence[nInd].getConstArray(); -for (sal_uInt32 j = 0, nNum = pSequence[nInd].getLength(); j < nNum; j++, pValue++) +for (const beans::PropertyValue& rValue : rSequence) { -if (pValue->Name == sMediaTypeProperty ) +if (rValue.Name == sMediaTypeProperty ) { -pValue->Value >>= aMediaType; +rValue.Value >>= aMediaType; } -else if (pValue->Name == sFullPathProperty ) +else if (rValue.Name == sFullPathProperty ) { -pValue->Value >>= aPath; +rValue.Value >>= aPath; } -else if (pValue->Name == sVersionProperty ) +else if (rValue.Name == sVersionProperty ) { -pValue->Value >>= aVersion; +rValue.Value >>= aVersion; } if ( !aPath.isEmpty() && !aMediaType.isEmpty() && !aVersion.isEmpty() ) @@ -148,7 +145,7 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con { aDocMediaType = aMediaType; aDocVersion = aVersion; -nRootFolderPropIndex = nInd; +pRootFolderPropSeq = break; } } @@ -217,15 +214,13 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con xHandler->startElement( sManifestElement, xRootAttrList ); const uno::Any *pKeyInfoProperty = nullptr; -if ( nRootFolderPropIndex >= 0 ) +if ( pRootFolderPropSeq ) { // do we have package-wide encryption info? -const beans::PropertyValue *pValue = -pSequence[nRootFolderPropIndex].getConstArray(); -for (sal_uInt32 j = 0, nNum = pSequence[nRootFolderPropIndex].getLength(); j < nNum; j++, pValue++) +for (const beans::PropertyValue& rValue : *pRootFolderPropSeq) { -if (pValue->Name == sKeyInfo ) -pKeyInfoProperty = >Value; +if (rValue.Name == sKeyInfo ) +pKeyInfoProperty = } if ( pKeyInfoProperty ) @@ -242,22 +237,19 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con uno::Sequence< uno::Sequence < beans::NamedValue > > aKeyInfoSequence; *pKeyInfoProperty >>= aKeyInfoSequence; -const uno::Sequence < beans::NamedValue > *pKeyInfoSequence = aKeyInfoSequence.getConstArray(); -const sal_uInt32 nKeyInfoLength = aKeyInfoSequence.getLength(); -for (sal_uInt32 nInd = 0; nInd < nKeyInfoLength ; nInd++ ) +for (const uno::Sequence& rKeyInfoSequence : std::as_const(aKeyInfoSequence)) { uno::Sequence
[Libreoffice-commits] core.git: postprocess/CppunitTest_services.mk postprocess/qa pyuno/source reportdesign/source sax/source
postprocess/CppunitTest_services.mk |1 postprocess/qa/services.cxx | 54 pyuno/source/module/pyuno_adapter.cxx | 38 ++-- reportdesign/source/core/api/ReportDefinition.cxx | 21 +--- reportdesign/source/core/sdr/RptObject.cxx | 11 +- reportdesign/source/filter/xml/xmlExport.cxx|7 - reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx | 12 +- reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx |9 -- reportdesign/source/filter/xml/xmlfilter.cxx| 28 ++ reportdesign/source/ui/dlg/AddField.cxx | 18 +--- reportdesign/source/ui/dlg/DateTime.cxx |6 - reportdesign/source/ui/dlg/GroupsSorting.cxx| 18 +--- reportdesign/source/ui/dlg/Navigator.cxx|6 - reportdesign/source/ui/inspection/GeometryHandler.cxx |8 - reportdesign/source/ui/misc/RptUndo.cxx | 10 -- reportdesign/source/ui/report/ReportController.cxx | 27 ++ reportdesign/source/ui/report/ReportSection.cxx | 17 +-- reportdesign/source/ui/report/ViewsWindow.cxx | 14 +-- sax/source/expatwrap/xml2utf.cxx| 11 -- sax/source/fastparser/fastparser.cxx|7 - sax/source/fastparser/legacyfastparser.cxx | 18 +--- sax/source/tools/fastserializer.cxx |4 22 files changed, 132 insertions(+), 213 deletions(-) New commits: commit edcdfe5477559ca6c62897f0cad47d4d6149d77a Author: Arkadiy Illarionov AuthorDate: Sat Aug 10 19:07:30 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Sat Aug 17 14:08:33 2019 +0200 Simplify Sequence iterations in postprocess..sax Use range-based loops, STL and comphelper functions Change-Id: If738d8f4e792c4686870183b0c0fdfbb61fd3351 Reviewed-on: https://gerrit.libreoffice.org/77245 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/postprocess/CppunitTest_services.mk b/postprocess/CppunitTest_services.mk index d886cb4961d8..9371443b5d6a 100644 --- a/postprocess/CppunitTest_services.mk +++ b/postprocess/CppunitTest_services.mk @@ -18,6 +18,7 @@ $(eval $(call gb_CppunitTest_use_externals,services, \ )) $(eval $(call gb_CppunitTest_use_libraries,services, \ + comphelper \ cppu \ cppuhelper \ sal \ diff --git a/postprocess/qa/services.cxx b/postprocess/qa/services.cxx index a807a037e80e..3c0fa8f7c6cf 100644 --- a/postprocess/qa/services.cxx +++ b/postprocess/qa/services.cxx @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -77,12 +78,7 @@ bool unique(css::uno::Sequence const & strings) { bool contains( css::uno::Sequence const & strings, OUString const & string) { -for (sal_Int32 i = 0; i != strings.getLength(); ++i) { -if (string == strings[i]) { -return true; -} -} -return false; +return comphelper::findValue(strings, string) != -1; } bool contains( @@ -90,12 +86,8 @@ bool contains( css::uno::Sequence const & strings2) { // Assumes small sequences for which quadratic algorithm is acceptable: -for (sal_Int32 i = 0; i != strings2.getLength(); ++i) { -if (!contains(strings1, strings2[i])) { -return false; -} -} -return true; +return std::all_of(strings2.begin(), strings2.end(), +[](const OUString& rStr) { return contains(strings1, rStr); }); } void addService( @@ -157,7 +149,7 @@ void Test::test() { m_xContext->getValueByName( "/singletons/com.sun.star.reflection.theTypeDescriptionManager"), css::uno::UNO_QUERY_THROW); -css::uno::Sequence serviceNames( +const css::uno::Sequence serviceNames( m_xContext->getServiceManager()->getAvailableServiceNames()); struct Constructor { Constructor( @@ -181,9 +173,9 @@ void Test::test() { bool accumulationBased; }; std::map impls; -for (sal_Int32 i = 0; i != serviceNames.getLength(); ++i) { +for (const auto& rServiceName : serviceNames) { css::uno::Reference serviceImpls1( -enumAcc->createContentEnumeration(serviceNames[i]), +enumAcc->createContentEnumeration(rServiceName), css::uno::UNO_SET_THROW); std::vector> serviceImpls2; while (serviceImpls1->hasMoreElements()) { @@ -191,9 +183,9 @@ void Test::test() { serviceImpls1->nextElement(), css::uno::UNO_QUERY_THROW); } css::uno::Reference desc; -if (typeMgr->hasByHierarchicalName(serviceNames[i])) { +if (typeMgr->hasByHierarchicalName(rServiceName)) { desc.set( -
[Libreoffice-commits] core.git: stoc/source
stoc/source/defaultregistry/defaultregistry.cxx | 24 +--- 1 file changed, 9 insertions(+), 15 deletions(-) New commits: commit 3e64065612acec2eb29aa21e2b515953422256d7 Author: Arkadiy Illarionov AuthorDate: Wed Aug 14 22:27:06 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Thu Aug 15 23:44:41 2019 +0200 Optimize NestedKeyImpl::openKeys * Use const methods of Sequence * Get rid of extra loop over localSeq * Simplify default keys insert condition Change-Id: I112c0a53d3ebfc2ff54a4ac904e6e112beaf3cdd Reviewed-on: https://gerrit.libreoffice.org/77472 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/stoc/source/defaultregistry/defaultregistry.cxx b/stoc/source/defaultregistry/defaultregistry.cxx index bfa698b13b91..71a637309c5a 100644 --- a/stoc/source/defaultregistry/defaultregistry.cxx +++ b/stoc/source/defaultregistry/defaultregistry.cxx @@ -755,33 +755,27 @@ Sequence< Reference< XRegistryKey > > SAL_CALL NestedKeyImpl::openKeys( ) defaultSeq = m_defaultKey->getKeyNames(); } -sal_uInt32 local = localSeq.getLength(); -sal_uInt32 def = defaultSeq.getLength(); -sal_uInt32 len = static_cast(std::count_if(localSeq.begin(), localSeq.end(), -[](const OUString& rLocal) { return comphelper::findValue(defaultSeq, rLocal) != -1; })); - -Sequence< Reference > retSeq(local + def - len); +std::vector< Reference > retVec; +retVec.reserve(localSeq.getLength() + defaultSeq.getLength()); auto lKeyNameToRegKey = [this](const OUString& rName) -> Reference { sal_Int32 lastIndex = rName.lastIndexOf('/'); OUString name = rName.copy(lastIndex); return new NestedKeyImpl(name, this); }; -std::transform(localSeq.begin(), localSeq.end(), retSeq.begin(), lKeyNameToRegKey); -sal_uInt32 k = local; -for (const auto& rDef : std::as_const(defaultSeq)) -{ -bool insert = std::none_of(retSeq.begin(), std::next(retSeq.begin(), local), -[](const Reference& rKey) { return rKey->getKeyName() == rDef; }); +for (const auto& rKeyName : std::as_const(localSeq)) +retVec.push_back(lKeyNameToRegKey(rKeyName)); -if ( insert ) +for (const auto& rKeyName : std::as_const(defaultSeq)) +{ +if ( comphelper::findValue(localSeq, rKeyName) == -1 ) { -retSeq.getArray()[k++] = lKeyNameToRegKey(rDef); +retVec.push_back(lKeyNameToRegKey(rKeyName)); } } -return retSeq; +return comphelper::containerToSequence(retVec); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/source
sc/source/core/data/documen5.cxx |4 +-- sc/source/core/data/dpobject.cxx |2 - sc/source/core/data/dpoutput.cxx | 29 --- sc/source/core/data/dptabsrc.cxx |2 - sc/source/core/tool/addincol.cxx | 10 +++ sc/source/core/tool/charthelper.cxx |2 - sc/source/core/tool/unitconv.cxx |2 - sc/source/core/tool/userlist.cxx |2 - sc/source/filter/excel/xechart.cxx | 12 - sc/source/filter/xcl97/xcl97rec.cxx |2 - sc/source/filter/xml/XMLExportDatabaseRanges.cxx |4 +-- sc/source/ui/dbgui/dapidata.cxx | 18 +- sc/source/ui/dbgui/tpsort.cxx|2 - sc/source/ui/docshell/docsh2.cxx |2 - sc/source/ui/miscdlgs/solverutil.cxx |2 - sc/source/ui/unoobj/cellsuno.cxx |8 ++ sc/source/ui/unoobj/chart2uno.cxx|2 - sc/source/ui/unoobj/chartuno.cxx |2 - sc/source/ui/unoobj/condformatuno.cxx|4 +-- sc/source/ui/unoobj/cursuno.cxx |4 +-- sc/source/ui/unoobj/dapiuno.cxx |2 - sc/source/ui/unoobj/docuno.cxx |2 - sc/source/ui/vba/vbachartobjects.cxx |6 ++-- sc/source/ui/vba/vbapagebreaks.cxx |4 +-- sc/source/ui/vba/vbapagesetup.cxx|2 - sc/source/ui/vba/vbarange.cxx|6 ++-- sc/source/ui/vba/vbasheetobject.cxx |2 - sc/source/ui/view/drawvie4.cxx |8 +++--- sc/source/ui/view/viewdata.cxx |2 - 29 files changed, 68 insertions(+), 81 deletions(-) New commits: commit 4721cbb1bb118d33ac9fcf93dda8c083b364003d Author: Arkadiy Illarionov AuthorDate: Sat Aug 10 22:20:30 2019 +0300 Commit: Mike Kaganski CommitDate: Mon Aug 12 15:23:53 2019 +0200 Mark Sequence const in sc It ensures that const begin()/end() methods will be called, removing any overhead. fca94779872b8ba0b0583d0b7068f1a46beb88c5 follow-up. Change-Id: Id680744abb1b3887f25c9bfa033106de18a9c2d0 Reviewed-on: https://gerrit.libreoffice.org/77250 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sc/source/core/data/documen5.cxx b/sc/source/core/data/documen5.cxx index 198cba53017e..2000121fa892 100644 --- a/sc/source/core/data/documen5.cxx +++ b/sc/source/core/data/documen5.cxx @@ -55,7 +55,7 @@ static void lcl_GetChartParameters( const uno::Reference< chart2::XChartDocument if ( xProvider.is() ) { -uno::Sequence< beans::PropertyValue > aArgs( xProvider->detectArguments( xDataSource ) ); +const uno::Sequence< beans::PropertyValue > aArgs( xProvider->detectArguments( xDataSource ) ); for (const beans::PropertyValue& rProp : aArgs) { @@ -372,7 +372,7 @@ void ScDocument::RestoreChartListener( const OUString& rName ) uno::Reference< chart2::data::XDataReceiver > xReceiver( xComponent, uno::UNO_QUERY ); if ( xChartDoc.is() && xReceiver.is() && !xChartDoc->hasInternalDataProvider()) { -uno::Sequence aRepresentations( xReceiver->getUsedRangeRepresentations() ); +const uno::Sequence aRepresentations( xReceiver->getUsedRangeRepresentations() ); ScRangeListRef aRanges = new ScRangeList; for ( const auto& rRepresentation : aRepresentations ) { diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index 16e8e794d019..4c7d02baa957 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -1174,7 +1174,7 @@ bool ScDPObject::IsDimNameInUse(const OUString& rName) const return false; Reference xDims = xSource->getDimensions(); -Sequence aDimNames = xDims->getElementNames(); +const Sequence aDimNames = xDims->getElementNames(); for (const OUString& rDimName : aDimNames) { if (rDimName.equalsIgnoreAsciiCase(rName)) diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx index 1fc5a06a4739..2ea984303bbf 100644 --- a/sc/source/core/data/dpoutput.cxx +++ b/sc/source/core/data/dpoutput.cxx @@ -466,7 +466,7 @@ uno::Sequence getVisiblePageMembersAsResults( const uno::Re return uno::Sequence(); std::vector aRes; -uno::Sequence aNames = xNA->getElementNames(); +const uno::Sequence aNames = xNA->getElementNames(); for (const OUString& rName : aNames) { xNA->getByName(rName); @@ -1158,31 +1158,24 @@ void ScDPOutput::GetMemberResultNames(ScDPUniqueStringSet& rNames, long nDimensi // Only the dimension has to be compared because this is only used with table data, // where each dimension occurs only once. -uno::Sequence
[Libreoffice-commits] core.git: sc/qa sc/source
sc/qa/unit/helper/qahelper.cxx |4 sc/source/core/data/documen5.cxx | 10 -- sc/source/core/data/dpobject.cxx | 10 -- sc/source/core/data/dpoutput.cxx | 22 +--- sc/source/core/data/dpresfilter.cxx | 10 -- sc/source/core/data/dptabsrc.cxx | 24 ++-- sc/source/core/data/tabprotection.cxx| 11 -- sc/source/core/tool/addincol.cxx | 64 - sc/source/core/tool/appoptio.cxx |4 sc/source/core/tool/charthelper.cxx |9 + sc/source/core/tool/rangeseq.cxx | 18 +-- sc/source/core/tool/rangeutl.cxx |4 sc/source/core/tool/unitconv.cxx |6 - sc/source/core/tool/userlist.cxx |8 - sc/source/filter/excel/xechart.cxx | 72 ++ sc/source/filter/excel/xeescher.cxx | 16 +-- sc/source/filter/ftools/fapihelper.cxx |7 - sc/source/filter/oox/formulabase.cxx | 12 -- sc/source/filter/oox/workbookhelper.cxx | 18 +-- sc/source/filter/xcl97/xcl97esc.cxx |7 - sc/source/filter/xcl97/xcl97rec.cxx |4 sc/source/filter/xml/XMLCodeNameProvider.cxx |7 - sc/source/filter/xml/XMLExportDatabaseRanges.cxx | 11 -- sc/source/filter/xml/xmlcvali.cxx| 16 +-- sc/source/filter/xml/xmlimprt.cxx| 69 ++ sc/source/filter/xml/xmlstyli.cxx|4 sc/source/ui/Accessibility/AccessibleCell.cxx| 13 -- sc/source/ui/Accessibility/AccessibleGlobal.cxx | 11 -- sc/source/ui/cctrl/tbzoomsliderctrl.cxx |7 - sc/source/ui/dbgui/dapidata.cxx | 10 -- sc/source/ui/dbgui/tpsort.cxx|4 sc/source/ui/docshell/docsh2.cxx |7 - sc/source/ui/miscdlgs/optsolver.cxx | 16 +-- sc/source/ui/miscdlgs/solveroptions.cxx |4 sc/source/ui/miscdlgs/solverutil.cxx |3 sc/source/ui/unoobj/appluno.cxx |5 - sc/source/ui/unoobj/celllistsource.cxx |9 + sc/source/ui/unoobj/cellsuno.cxx | 85 ++--- sc/source/ui/unoobj/cellvaluebinding.cxx |9 + sc/source/ui/unoobj/chart2uno.cxx| 41 sc/source/ui/unoobj/chartuno.cxx | 31 +- sc/source/ui/unoobj/condformatuno.cxx|8 - sc/source/ui/unoobj/cursuno.cxx |4 sc/source/ui/unoobj/dapiuno.cxx | 39 +++ sc/source/ui/unoobj/datauno.cxx | 18 +-- sc/source/ui/unoobj/defltuno.cxx |6 - sc/source/ui/unoobj/dispuno.cxx | 10 -- sc/source/ui/unoobj/docuno.cxx | 66 + sc/source/ui/unoobj/eventuno.cxx |4 sc/source/ui/unoobj/filtuno.cxx |5 - sc/source/ui/unoobj/fmtuno.cxx |6 - sc/source/ui/unoobj/funcuno.cxx |7 - sc/source/ui/unoobj/shapeuno.cxx | 19 +-- sc/source/ui/unoobj/styleuno.cxx | 28 ++--- sc/source/ui/unoobj/viewuno.cxx |5 - sc/source/ui/vba/vbachart.cxx|7 - sc/source/ui/vba/vbachartobjects.cxx | 14 +- sc/source/ui/vba/vbaeventshelper.cxx | 10 -- sc/source/ui/vba/vbapagebreaks.cxx | 18 +-- sc/source/ui/vba/vbapagesetup.cxx|7 - sc/source/ui/vba/vbarange.cxx| 27 ++--- sc/source/ui/vba/vbasheetobject.cxx | 13 +- sc/source/ui/vba/vbaworkbook.cxx | 69 ++ sc/source/ui/vba/vbaworksheets.cxx |5 - sc/source/ui/vba/vbawsfunction.cxx |6 - sc/source/ui/view/dbfunc3.cxx|7 - sc/source/ui/view/drawvie4.cxx | 14 +- sc/source/ui/view/viewdata.cxx | 113 +++ 68 files changed, 494 insertions(+), 743 deletions(-) New commits: commit fca94779872b8ba0b0583d0b7068f1a46beb88c5 Author: Arkadiy Illarionov AuthorDate: Sat Aug 3 22:59:04 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Fri Aug 9 16:58:06 2019 +0200 Simplify Sequence iterations in sc Use range-based loops, STL and comphelper functions Change-Id: I047fb2e6ec9591166339b9748c5013a32185f14b Reviewed-on: https://gerrit.libreoffice.org/76912 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx index c5f183161a78..219d47635feb 100644 --- a/sc/qa/unit/helper/qahelper.cxx +++ b/sc/qa/unit/helper/qahelper.cxx @@ -11,6 +11,7 @@ #include "csv_handler.hxx" #include "debughelper.hxx" #include +#include
[Libreoffice-commits] core.git: ucb/source
ucb/source/ucp/tdoc/tdoc_docmgr.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 909c81028d75d672a914c7169d8ecd31de5c8afa Author: Arkadiy Illarionov AuthorDate: Sun Aug 4 18:18:49 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Mon Aug 5 21:26:05 2019 +0200 Fix OSL_ENSURE argument Change-Id: Ie1e63055b9603b7903fe1dcfaeb4eb7aa7c12cc1 Reviewed-on: https://gerrit.libreoffice.org/76956 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/ucb/source/ucp/tdoc/tdoc_docmgr.cxx b/ucb/source/ucp/tdoc/tdoc_docmgr.cxx index 3de939721de9..ab08a355e9c8 100644 --- a/ucb/source/ucp/tdoc/tdoc_docmgr.cxx +++ b/ucb/source/ucp/tdoc/tdoc_docmgr.cxx @@ -444,7 +444,7 @@ void OfficeDocumentsManager::buildDocumentsList() uno::Reference< embed::XStorage > xStorage = xDoc->getDocumentStorage(); -OSL_ENSURE( xDoc.is(), "Got no document storage!" ); +OSL_ENSURE( xStorage.is(), "Got no document storage!" ); { osl::MutexGuard aGuard( m_aMtx ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: connectivity/source include/connectivity
connectivity/source/sdbcx/VCollection.cxx |3 ++- connectivity/source/sdbcx/VDescriptor.cxx | 16 include/connectivity/sdbcx/VDescriptor.hxx |3 +-- 3 files changed, 7 insertions(+), 15 deletions(-) New commits: commit f0390929d3e71ab434f9ce8d88c2dc2f4cc0ea6e Author: Arkadiy Illarionov AuthorDate: Sun Aug 4 15:55:12 2019 +0300 Commit: Stephan Bergmann CommitDate: Mon Aug 5 09:48:03 2019 +0200 tdf#39593 Drop connectivity::sdbcx::ODescriptor::getImplementation Replace with comphelper::getUnoTunnelImplementation. Change-Id: Ia08561c11872a4ede9077863f81040633c30aebc Reviewed-on: https://gerrit.libreoffice.org/76914 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/connectivity/source/sdbcx/VCollection.cxx b/connectivity/source/sdbcx/VCollection.cxx index 7ccb08c4d21c..56060cb2ea9a 100644 --- a/connectivity/source/sdbcx/VCollection.cxx +++ b/connectivity/source/sdbcx/VCollection.cxx @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -373,7 +374,7 @@ void SAL_CALL OCollection::appendByDescriptor( const Reference< XPropertySet >& if ( !xNewlyCreated.is() ) throw RuntimeException(); -ODescriptor* pDescriptor = ODescriptor::getImplementation( xNewlyCreated ); +ODescriptor* pDescriptor = comphelper::getUnoTunnelImplementation( xNewlyCreated ); if ( pDescriptor ) pDescriptor->setNew( false ); diff --git a/connectivity/source/sdbcx/VDescriptor.cxx b/connectivity/source/sdbcx/VDescriptor.cxx index 0be99ce8b164..cde97530a186 100644 --- a/connectivity/source/sdbcx/VDescriptor.cxx +++ b/connectivity/source/sdbcx/VDescriptor.cxx @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -48,21 +49,12 @@ namespace connectivity // css::lang::XUnoTunnel sal_Int64 SAL_CALL ODescriptor::getSomething( const Sequence< sal_Int8 >& rId ) { -return (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) ) +return (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) ) ? reinterpret_cast< sal_Int64 >( this ) : 0; } -ODescriptor* ODescriptor::getImplementation( const Reference< XInterface >& _rxSomeComp ) -{ -Reference< XUnoTunnel > xTunnel( _rxSomeComp, UNO_QUERY ); -if ( xTunnel.is() ) -return reinterpret_cast< ODescriptor* >( xTunnel->getSomething( getUnoTunnelImplementationId() ) ); -return nullptr; -} - - namespace { struct ResetROAttribute @@ -98,12 +90,12 @@ namespace connectivity bool ODescriptor::isNew( const Reference< XInterface >& _rxDescriptor ) { -ODescriptor* pImplementation = getImplementation( _rxDescriptor ); +ODescriptor* pImplementation = comphelper::getUnoTunnelImplementation( _rxDescriptor ); return pImplementation && pImplementation->isNew(); } -Sequence< sal_Int8 > ODescriptor::getUnoTunnelImplementationId() +Sequence< sal_Int8 > ODescriptor::getUnoTunnelId() { static ::cppu::OImplementationId implId; diff --git a/include/connectivity/sdbcx/VDescriptor.hxx b/include/connectivity/sdbcx/VDescriptor.hxx index b68689d16035..51737e190f0f 100644 --- a/include/connectivity/sdbcx/VDescriptor.hxx +++ b/include/connectivity/sdbcx/VDescriptor.hxx @@ -72,9 +72,8 @@ namespace connectivity // css::lang::XUnoTunnel virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; -static css::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId(); +static css::uno::Sequence< sal_Int8 > getUnoTunnelId(); -static ODescriptor* getImplementation( const css::uno::Reference< css::uno::XInterface >& _rxSomeComp ); // retrieves the ODescriptor implementation of a given UNO component, and returns its ->isNew flag static bool isNew( const css::uno::Reference< css::uno::XInterface >& _rxDescriptor ); }; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/source
sc/source/core/data/dptabsrc.cxx | 16 +++- 1 file changed, 3 insertions(+), 13 deletions(-) New commits: commit 3ab2df3cf755ecd0e3e31ad06872426d24222c31 Author: Arkadiy Illarionov AuthorDate: Sat Aug 3 21:15:57 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Sat Aug 3 21:00:59 2019 +0200 tdf#39593 Drop lcl_GetIndexFromName Use comphelper::findValue instead Change-Id: Id8490034b0f957084680fef18ba07974b5373fb2 Reviewed-on: https://gerrit.libreoffice.org/76896 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx index 0b3f79e35a0d..c72f34a559cc 100644 --- a/sc/source/core/data/dptabsrc.cxx +++ b/sc/source/core/data/dptabsrc.cxx @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -589,17 +590,6 @@ static long lcl_CountMinMembers(const vector& ppDim, const vecto return nTotal; } -static long lcl_GetIndexFromName( const OUString& rName, const uno::Sequence& rElements ) -{ -long nCount = rElements.getLength(); -const OUString* pArray = rElements.getConstArray(); -for (long nPos=0; nPos& rDims = bIsRow ? maRowDims : maColDims; @@ -796,8 +786,8 @@ void ScDPSource::CreateRes_Impl() eRefType == sheet::DataPilotFieldReferenceType::ITEM_PERCENTAGE_DIFFERENCE || eRefType == sheet::DataPilotFieldReferenceType::RUNNING_TOTAL ) { -long nColumn = lcl_GetIndexFromName( -aDataRefValues.back().ReferenceField, GetDimensionsObject()->getElementNames()); +long nColumn = comphelper::findValue( +GetDimensionsObject()->getElementNames(), aDataRefValues.back().ReferenceField); if ( nColumn >= 0 ) { nDataRefOrient = GetOrientation(nColumn); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/source
sc/source/core/tool/addincol.cxx | 42 --- 1 file changed, 18 insertions(+), 24 deletions(-) New commits: commit 9307a23a40a0a18d86dade102354ba4871825c5a Author: Arkadiy Illarionov AuthorDate: Sat Aug 3 19:25:32 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Sat Aug 3 19:28:12 2019 +0200 tdf#39593 extract getting max row length to template function Change-Id: I23c81ac7dbd8785b12620aaf8ae2c090ae1785f8 Reviewed-on: https://gerrit.libreoffice.org/76894 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx index 78104c11ef2e..7279aa4029ec 100644 --- a/sc/source/core/tool/addincol.cxx +++ b/sc/source/core/tool/addincol.cxx @@ -1463,6 +1463,18 @@ void ScUnoAddInCall::ExecuteCallWithArgs(uno::Sequence& rCallArgs) } } +template +static long lcl_GetMaxColCount(const uno::Sequence< uno::Sequence >* pRowSeq) +{ +if (!pRowSeq->hasElements()) +return 0; + +auto pRow = std::max_element(pRowSeq->begin(), pRowSeq->end(), +[](const uno::Sequence& a, const uno::Sequence& b) { +return a.getLength() < b.getLength(); }); +return pRow->getLength(); +} + void ScUnoAddInCall::SetResult( const uno::Any& rNewRes ) { nErrCode = FormulaError::NONE; @@ -1528,16 +1540,10 @@ void ScUnoAddInCall::SetResult( const uno::Any& rNewRes ) if ( pRowSeq ) { long nRowCount = pRowSeq->getLength(); -const uno::Sequence* pRowArr = pRowSeq->getConstArray(); -long nMaxColCount = 0; -for (long nRow=0; nRow nMaxColCount ) -nMaxColCount = nTmp; -} +long nMaxColCount = lcl_GetMaxColCount(pRowSeq); if ( nMaxColCount && nRowCount ) { +const uno::Sequence* pRowArr = pRowSeq->getConstArray(); xMatrix = new ScMatrix( static_cast(nMaxColCount), static_cast(nRowCount), 0.0); @@ -1569,16 +1575,10 @@ void ScUnoAddInCall::SetResult( const uno::Any& rNewRes ) if ( pRowSeq ) { long nRowCount = pRowSeq->getLength(); -const uno::Sequence* pRowArr = pRowSeq->getConstArray(); -long nMaxColCount = 0; -for (long nRow=0; nRow nMaxColCount ) -nMaxColCount = nTmp; -} +long nMaxColCount = lcl_GetMaxColCount(pRowSeq); if ( nMaxColCount && nRowCount ) { +const uno::Sequence* pRowArr = pRowSeq->getConstArray(); xMatrix = new ScMatrix( static_cast(nMaxColCount), static_cast(nRowCount), 0.0); @@ -1610,16 +1610,10 @@ void ScUnoAddInCall::SetResult( const uno::Any& rNewRes ) if ( pRowSeq ) { long nRowCount = pRowSeq->getLength(); -const uno::Sequence* pRowArr = pRowSeq->getConstArray(); -long nMaxColCount = 0; -for (long nRow=0; nRow nMaxColCount ) -nMaxColCount = nTmp; -} +long nMaxColCount = lcl_GetMaxColCount(pRowSeq); if ( nMaxColCount && nRowCount ) { +const uno::Sequence* pRowArr = pRowSeq->getConstArray(); xMatrix = new ScMatrix( static_cast(nMaxColCount), static_cast(nRowCount), 0.0); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: scaddins/source sccomp/source scripting/source
scaddins/source/analysis/analysis.cxx | 14 scaddins/source/analysis/analysishelper.cxx | 62 +--- sccomp/source/solver/CoinMPSolver.cxx | 17 ++--- sccomp/source/solver/LpsolveSolver.cxx | 25 +++- scripting/source/basprov/basmethnode.cxx| 16 + scripting/source/basprov/basprov.cxx|7 -- scripting/source/dlgprov/dlgevtatt.cxx | 13 +--- scripting/source/protocolhandler/scripthandler.cxx | 19 ++ scripting/source/provider/BrowseNodeFactoryImpl.cxx | 25 +++- scripting/source/provider/ProviderCache.cxx | 27 +--- scripting/source/provider/ProviderCache.hxx | 14 scripting/source/provider/URIHelper.cxx | 26 +++- scripting/source/stringresource/stringresource.cxx |5 - scripting/source/vbaevents/eventhelper.cxx | 22 +-- 14 files changed, 107 insertions(+), 185 deletions(-) New commits: commit 5ba84c3c7080d55d86b8b39db077b6da36cb700a Author: Arkadiy Illarionov AuthorDate: Sat Jul 27 23:20:29 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Tue Jul 30 11:16:00 2019 +0200 Simplify Sequence iterations in scaddins, sccomp, scripting Use range-based loops, STL and comphelper functions Change-Id: I836422a1c81a3dc9585687ed2e506eb59bb4ec91 Reviewed-on: https://gerrit.libreoffice.org/76484 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/scaddins/source/analysis/analysis.cxx b/scaddins/source/analysis/analysis.cxx index 3587d859c2d6..ce3c866aba2b 100644 --- a/scaddins/source/analysis/analysis.cxx +++ b/scaddins/source/analysis/analysis.cxx @@ -571,19 +571,11 @@ double SAL_CALL AnalysisAddIn::getSeriessum( double fX, double fN, double fM, co if( fX != 0.0 ) { -sal_Int32 n1, n2; -sal_Int32 nE1 = aCoeffList.getLength(); -sal_Int32 nE2; - -for( n1 = 0 ; n1 < nE1 ; n1++ ) +for( const uno::Sequence< double >& rList : aCoeffList ) { -const uno::Sequence< double >&rList = aCoeffList[ n1 ]; -nE2 = rList.getLength(); -const double* pList = rList.getConstArray(); - -for( n2 = 0 ; n2 < nE2 ; n2++ ) +for( const double fCoef : rList ) { -fRet += pList[ n2 ] * pow( fX, fN ); +fRet += fCoef * pow( fX, fN ); fN += fM; } diff --git a/scaddins/source/analysis/analysishelper.cxx b/scaddins/source/analysis/analysishelper.cxx index c44c55f763db..c608732b14d6 100644 --- a/scaddins/source/analysis/analysishelper.cxx +++ b/scaddins/source/analysis/analysishelper.cxx @@ -1481,14 +1481,10 @@ void SortedIndividualInt32List::InsertHolidayList( if( !(rHolAny >>= aAnySeq) ) throw lang::IllegalArgumentException(); -const uno::Sequence< uno::Any >* pSeqArray = aAnySeq.getConstArray(); -for( sal_Int32 nIndex1 = 0; nIndex1 < aAnySeq.getLength(); nIndex1++ ) +for( const uno::Sequence< uno::Any >& rSubSeq : aAnySeq ) { -const uno::Sequence< uno::Any >& rSubSeq = pSeqArray[ nIndex1 ]; -const uno::Any* pAnyArray = rSubSeq.getConstArray(); - -for( sal_Int32 nIndex2 = 0; nIndex2 < rSubSeq.getLength(); nIndex2++ ) -InsertHolidayList( rAnyConv, pAnyArray[ nIndex2 ], nNullDate, false/*bInsertOnWeekend*/ ); +for( const uno::Any& rAny : rSubSeq ) +InsertHolidayList( rAnyConv, rAny, nNullDate, false/*bInsertOnWeekend*/ ); } } else @@ -1499,13 +1495,10 @@ void SortedIndividualInt32List::InsertHolidayList( void ScaDoubleList::Append( const uno::Sequence< uno::Sequence< double > >& rValueSeq ) { -const uno::Sequence< double >* pSeqArray = rValueSeq.getConstArray(); -for( sal_Int32 nIndex1 = 0; nIndex1 < rValueSeq.getLength(); nIndex1++ ) +for( const uno::Sequence< double >& rSubSeq : rValueSeq ) { -const uno::Sequence< double >& rSubSeq = pSeqArray[ nIndex1 ]; -const double* pArray = rSubSeq.getConstArray(); -for( sal_Int32 nIndex2 = 0; nIndex2 < rSubSeq.getLength(); nIndex2++ ) -Append( pArray[ nIndex2 ] ); +for( const double fValue : rSubSeq ) +Append( fValue ); } } @@ -1513,13 +1506,10 @@ void ScaDoubleList::Append( void ScaDoubleList::Append( const uno::Sequence< uno::Sequence< sal_Int32 > >& rValueSeq ) { -const uno::Sequence< sal_Int32 >* pSeqArray = rValueSeq.getConstArray(); -for( sal_Int32 nIndex1 = 0; nIndex1 < rValueSeq.getLength(); nIndex1++ ) +for( const uno::Sequence< sal_Int32 >& rSubSeq : rValueSeq ) { -const uno::Sequence< sal_Int32 >& rSubSeq = pSeqArray[ nIndex1 ]; -const sal_Int32* pArray = rSubSeq.getConstArray(); -for( sal_Int32 nIndex2 = 0;
[Libreoffice-commits] core.git: 3 commits - sc/inc sc/source sdext/source sd/source
sc/inc/dapiuno.hxx |1 sc/source/ui/unoobj/dapiuno.cxx | 17 sd/source/core/CustomAnimationCloner.cxx |8 sd/source/core/CustomAnimationEffect.cxx | 127 ++- sd/source/core/CustomAnimationPreset.cxx | 47 -- sd/source/core/TransitionPreset.cxx | 18 - sd/source/core/drawdoc.cxx |8 sd/source/core/stlpool.cxx |5 sd/source/core/stlsheet.cxx | 19 - sd/source/filter/eppt/eppt.cxx |7 sd/source/filter/eppt/epptso.cxx |8 sd/source/filter/eppt/pptexanimations.cxx| 55 +-- sd/source/filter/eppt/pptx-animations.cxx|4 sd/source/filter/eppt/pptx-text.cxx | 35 - sd/source/filter/grf/sdgrffilter.cxx | 18 - sd/source/filter/html/HtmlOptionsDialog.cxx | 23 - sd/source/filter/html/htmlex.cxx | 110 ++ sd/source/filter/ppt/pptinanimations.cxx | 25 - sd/source/ui/app/optsitem.cxx|2 sd/source/ui/dlg/PhotoAlbumDialog.cxx|4 sd/source/ui/dlg/tpaction.cxx|3 sd/source/ui/framework/configuration/Configuration.cxx | 27 - sd/source/ui/framework/configuration/ConfigurationClassifier.cxx | 37 -- sd/source/ui/framework/configuration/ConfigurationController.cxx | 11 sd/source/ui/framework/configuration/ResourceId.cxx | 15 sd/source/ui/framework/factories/ViewShellWrapper.cxx|5 sd/source/ui/framework/tools/FrameworkHelper.cxx |4 sd/source/ui/remotecontrol/Server.cxx| 29 - sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx |9 sd/source/ui/slideshow/PaneHider.cxx |3 sd/source/ui/slideshow/slideshowimpl.cxx | 24 - sd/source/ui/table/TableDesignPane.cxx | 11 sd/source/ui/tools/ConfigurationAccess.cxx |3 sd/source/ui/unoidl/SdUnoSlideView.cxx |5 sd/source/ui/unoidl/UnoDocumentSettings.cxx |8 sd/source/ui/unoidl/unomodel.cxx | 21 - sd/source/ui/unoidl/unomodule.cxx|9 sd/source/ui/unoidl/unoobj.cxx | 45 +- sd/source/ui/unoidl/unopage.cxx | 48 +- sd/source/ui/unoidl/unopback.cxx |6 sd/source/ui/view/DocumentRenderer.cxx |4 sd/source/ui/view/ViewShellBase.cxx | 47 +- sd/source/ui/view/drviews5.cxx | 10 sd/source/ui/view/frmview.cxx| 177 -- sdext/source/minimizer/configurationaccess.cxx | 16 sdext/source/minimizer/fileopendialog.cxx| 25 - sdext/source/minimizer/impoptimizer.cxx | 46 +- sdext/source/minimizer/optimizationstats.cxx |4 sdext/source/minimizer/pppoptimizerdialog.cxx|9 sdext/source/pdfimport/filterdet.cxx |8 sdext/source/pdfimport/pdfiadaptor.cxx | 42 +- sdext/source/presenter/PresenterAccessibility.cxx| 10 sdext/source/presenter/PresenterConfigurationAccess.cxx | 12 sdext/source/presenter/PresenterScreen.cxx | 30 - sdext/source/presenter/PresenterTheme.cxx| 13 55 files changed, 530 insertions(+), 787 deletions(-) New commits: commit 515cce5e6ec92b80f524e1925660bdf5a8c90c13 Author: Arkadiy Illarionov AuthorDate: Sun Jul 28 17:50:33 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Mon Jul 29 18:45:21 2019 +0200 Drop ScDataPilotFieldObj::HasString Use comphelper::findValue instead Change-Id: I59a3ef2781643dfdb7ecbfe578fb9e1faebb0c42 Reviewed-on: https://gerrit.libreoffice.org/76502 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/sc/inc/dapiuno.hxx b/sc/inc/dapiuno.hxx index ad6f9b275502..22d7c4302d3a 100644 --- a/sc/inc/dapiuno.hxx +++ b/sc/inc/dapiuno.hxx @@ -466,7 +466,6 @@ public: void setGroupInfo(const css::sheet::DataPilotFieldGroupInfo* pInfo); // XDataPilotFieldGrouping -static bool HasString(const
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/appl/appcfg.cxx |6 sfx2/source/appl/appdispatchprovider.cxx |7 - sfx2/source/appl/appopen.cxx | 22 +-- sfx2/source/appl/appserv.cxx | 19 +- sfx2/source/appl/appuno.cxx | 56 +++- sfx2/source/appl/childwin.cxx|2 sfx2/source/appl/fileobj.cxx |6 sfx2/source/appl/helpdispatch.cxx|8 - sfx2/source/appl/helpinterceptor.cxx |9 - sfx2/source/appl/macroloader.cxx |9 - sfx2/source/appl/newhelp.cxx | 12 - sfx2/source/appl/preventduplicateinteraction.cxx | 12 - sfx2/source/appl/sfxhelp.cxx | 12 - sfx2/source/bastyp/fltfnc.cxx| 73 -- sfx2/source/bastyp/frmhtmlw.cxx |4 sfx2/source/control/charmapcontrol.cxx | 20 -- sfx2/source/control/recentdocsview.cxx |8 - sfx2/source/control/shell.cxx|9 - sfx2/source/control/templatelocalview.cxx| 20 -- sfx2/source/control/unoctitm.cxx |5 sfx2/source/dialog/backingcomp.cxx |5 sfx2/source/dialog/dinfdlg.cxx | 105 ++- sfx2/source/dialog/dockwin.cxx |6 sfx2/source/dialog/filedlghelper.cxx | 31 +--- sfx2/source/dialog/filtergrouping.cxx| 11 - sfx2/source/dialog/mailmodel.cxx | 23 +-- sfx2/source/dialog/versdlg.cxx | 20 +- sfx2/source/doc/DocumentMetadataAccess.cxx | 29 +--- sfx2/source/doc/SfxDocumentMetaData.cxx | 20 +- sfx2/source/doc/docfac.cxx |6 sfx2/source/doc/docfile.cxx | 29 +--- sfx2/source/doc/docinf.cxx |6 sfx2/source/doc/docinsert.cxx| 10 - sfx2/source/doc/docmacromode.cxx | 21 +-- sfx2/source/doc/doctemplates.cxx | 54 +++ sfx2/source/doc/guisaveas.cxx| 87 +--- sfx2/source/doc/objmisc.cxx | 11 - sfx2/source/doc/objserv.cxx | 34 ++-- sfx2/source/doc/objstor.cxx | 152 + sfx2/source/doc/printhelper.cxx | 32 +--- sfx2/source/doc/sfxbasemodel.cxx | 115 ++-- sfx2/source/doc/templatedlg.cxx | 14 +- sfx2/source/doc/zoomitem.cxx | 14 +- sfx2/source/inet/inettbc.cxx |9 - sfx2/source/notebookbar/SfxNotebookBar.cxx | 25 +-- sfx2/source/notify/eventsupplier.cxx | 160 +-- sfx2/source/sidebar/ResourceManager.cxx | 32 +--- sfx2/source/view/sfxbasecontroller.cxx | 19 +- sfx2/source/view/viewprn.cxx | 56 +++- 49 files changed, 608 insertions(+), 847 deletions(-) New commits: commit 25b200ff79c71c831bc7e6fe8b1ec0b5315e96d6 Author: Arkadiy Illarionov AuthorDate: Sun Jul 21 19:39:26 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Mon Jul 29 18:44:33 2019 +0200 Simplify Sequence iterations in sfx2 Use range-based loops, STL and comphelper functions Change-Id: I6a0d18493db7a25e8b41925f2d45cb221b5065a7 Reviewed-on: https://gerrit.libreoffice.org/76074 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx index 5ad63a9869f4..323c87432d55 100644 --- a/sfx2/source/appl/appcfg.cxx +++ b/sfx2/source/appl/appcfg.cxx @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -335,10 +336,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet ) if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::EOption::SecureUrls)) { css::uno::Sequence< OUString > seqURLs = aSecurityOptions.GetSecureURLs(); -std::vector aList; -sal_uInt32 nCount = seqURLs.getLength(); -for( sal_uInt32 nURL=0; nURL>(seqURLs); if( !rSet.Put( SfxStringListItem( rPool.GetWhich(SID_SECURE_URL), ) ) ) bRet = false; diff --git a/sfx2/source/appl/appdispatchprovider.cxx b/sfx2/source/appl/appdispatchprovider.cxx index edab1b761f32..5c197bf92eaf 100644 --- a/sfx2/source/appl/appdispatchprovider.cxx +++ b/sfx2/source/appl/appdispatchprovider.cxx @@ -164,10 +164,9 @@ Sequence< Reference < XDispatch > > SAL_CALL SfxAppDispatchProvider::queryDispat { sal_Int32 nCount = seqDescriptor.getLength(); uno::Sequence< uno::Reference < frame::XDispatch > > lDispatcher(nCount); -for( sal_Int32 i=0; i uno::Reference { +
[Libreoffice-commits] core.git: starmath/source
starmath/source/cfgitem.cxx | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) New commits: commit 1ba34e905f717f15afabb514d9740d53c85e4af4 Author: Arkadiy Illarionov AuthorDate: Tue Jul 23 22:20:47 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Tue Jul 23 23:32:46 2019 +0200 Optimize names transforming Remove lambda and one extra begin() call. 6ffdc88e79904882e319bdd0b901e7491abae0b3 follow-up Change-Id: Ieb427704112f4d52c044147a5162921448f0590d Reviewed-on: https://gerrit.libreoffice.org/76205 Tested-by: Jenkins Reviewed-by: Mike Kaganski Reviewed-by: Arkadiy Illarionov diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx index 5b6b900e051c..4636df044b08 100644 --- a/starmath/source/cfgitem.cxx +++ b/starmath/source/cfgitem.cxx @@ -373,9 +373,8 @@ void SmMathConfig::ReadSymbol( SmSym , sal_Int32 nProps = aNames.getLength(); OUString aDelim( "/" ); -std::transform(aNames.begin(), aNames.end(), aNames.begin(), -[, , ](const OUString& rName) -> OUString { -return rBaseNode + aDelim + rSymbolName + aDelim + rName; }); +for (auto& rName : aNames) +rName = rBaseNode + aDelim + rSymbolName + aDelim + rName; const Sequence< Any > aValues = const_cast(this)->GetProperties(aNames); @@ -580,9 +579,8 @@ void SmMathConfig::ReadFontFormat( SmFontFormat , sal_Int32 nProps = aNames.getLength(); OUString aDelim( "/" ); -std::transform(aNames.begin(), aNames.end(), aNames.begin(), -[, , ](const OUString& rName) -> OUString { -return rBaseNode + aDelim + rSymbolName + aDelim + rName; }); +for (auto& rName : aNames) +rName = rBaseNode + aDelim + rSymbolName + aDelim + rName; const Sequence< Any > aValues = const_cast(this)->GetProperties(aNames); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: shell/source slideshow/source sot/source starmath/source stoc/Library_bootstrap.mk stoc/source svgio/qa
shell/source/cmdmail/cmdmailsuppl.cxx| 15 - slideshow/source/engine/activities/activitiesfactory.cxx |4 slideshow/source/engine/opengl/TransitionerImpl.cxx | 93 ++ slideshow/source/engine/shapes/shapeimporter.cxx |7 slideshow/source/engine/slide/slideimpl.cxx | 16 - slideshow/source/engine/tools.cxx|6 sot/source/sdstor/ucbstorage.cxx | 12 sot/source/unoolestorage/xolesimplestorage.cxx |8 starmath/source/cfgitem.cxx | 38 -- starmath/source/mathmlimport.cxx | 39 +- starmath/source/unomodel.cxx | 28 - stoc/Library_bootstrap.mk|1 stoc/source/corereflection/criface.cxx |8 stoc/source/defaultregistry/defaultregistry.cxx | 96 -- stoc/source/implementationregistration/implreg.cxx | 215 --- stoc/source/inspect/introspection.cxx| 55 +-- stoc/source/invocation/invocation.cxx|8 stoc/source/servicemanager/servicemanager.cxx| 50 +-- stoc/source/simpleregistry/simpleregistry.cxx| 18 - svgio/qa/cppunit/SvgImportTest.cxx | 14 20 files changed, 221 insertions(+), 510 deletions(-) New commits: commit 6ffdc88e79904882e319bdd0b901e7491abae0b3 Author: Arkadiy Illarionov AuthorDate: Sat Jul 20 20:03:15 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Mon Jul 22 18:42:35 2019 +0200 Simplify Sequence iterations in shell..svgio Use range-based loops, STL and comphelper functions Change-Id: I612d36abcc09a91c60f7212de6747a1a1bdcfc69 Reviewed-on: https://gerrit.libreoffice.org/76056 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/shell/source/cmdmail/cmdmailsuppl.cxx b/shell/source/cmdmail/cmdmailsuppl.cxx index 6a076a632806..b4e4322a2ff2 100644 --- a/shell/source/cmdmail/cmdmailsuppl.cxx +++ b/shell/source/cmdmail/cmdmailsuppl.cxx @@ -237,20 +237,18 @@ void SAL_CALL CmdMailSuppl::sendSimpleMailMessage( const Reference< XSimpleMailM // Append carbon copy recipients set in the message Sequence< OUString > aStringList = xSimpleMailMessage->getCcRecipient(); -sal_Int32 n, nmax = aStringList.getLength(); -for ( n = 0; n < nmax; n++ ) +for ( const auto& rString : aStringList ) { aBuffer.append(" --cc "); -appendShellWord(aBuffer, aStringList[n], false); +appendShellWord(aBuffer, rString, false); } // Append blind carbon copy recipients set in the message aStringList = xSimpleMailMessage->getBccRecipient(); -nmax = aStringList.getLength(); -for ( n = 0; n < nmax; n++ ) +for ( const auto& rString : aStringList ) { aBuffer.append(" --bcc "); -appendShellWord(aBuffer, aStringList[n], false); +appendShellWord(aBuffer, rString, false); } // Append subject if set in the message @@ -262,11 +260,10 @@ void SAL_CALL CmdMailSuppl::sendSimpleMailMessage( const Reference< XSimpleMailM // Append attachments set in the message aStringList = xSimpleMailMessage->getAttachement(); -nmax = aStringList.getLength(); -for ( n = 0; n < nmax; n++ ) +for ( const auto& rString : aStringList ) { OUString aSystemPath; -if ( FileBase::E_None == FileBase::getSystemPathFromFileURL(aStringList[n], aSystemPath) ) +if ( FileBase::E_None == FileBase::getSystemPathFromFileURL(rString, aSystemPath) ) { aBuffer.append(" --attach "); appendShellWord(aBuffer, aSystemPath, true); diff --git a/slideshow/source/engine/activities/activitiesfactory.cxx b/slideshow/source/engine/activities/activitiesfactory.cxx index ba75b46eb5a1..e2cc9987e998 100644 --- a/slideshow/source/engine/activities/activitiesfactory.cxx +++ b/slideshow/source/engine/activities/activitiesfactory.cxx @@ -621,11 +621,11 @@ AnimationActivitySharedPtr createValueListActivity( ValueVectorType aValueVector; aValueVector.reserve( rValues.getLength() ); -for( ::std::size_t i=0, nLen=rValues.getLength(); i SAL_CALL convertFromRGB( const uno::Sequence< rendering::RGBColor >& rgbColor ) override { -const rendering::RGBColor* pIn( rgbColor.getConstArray() ); -const std::size_t nLen( rgbColor.getLength() ); +const sal_Int32 nLen( rgbColor.getLength() ); uno::Sequence< double > aRes(nLen*4); double* pColors=aRes.getArray(); -for( std::size_t i=0; iRed; -*pColors++ = pIn->Green; -*pColors++ = pIn->Blue; +*pColors++ = rIn.Red; +*pColors++ = rIn.Green; +*pColors++ = rIn.Blue; *pColors++ = 1.0; -++pIn; } return aRes; }
[Libreoffice-commits] core.git: svl/source
svl/source/config/asiancfg.cxx |6 - svl/source/items/ilstitem.cxx |4 svl/source/items/itemprop.cxx | 14 +- svl/source/items/slstitm.cxx |4 svl/source/items/srchitem.cxx | 54 - svl/source/misc/ownlist.cxx|7 - svl/source/numbers/supservs.cxx|7 - svl/source/numbers/zforlist.cxx| 116 - svl/source/numbers/zformat.cxx | 22 +-- svl/source/passwordcontainer/passwordcontainer.cxx | 34 ++ svl/source/passwordcontainer/syscreds.cxx |5 11 files changed, 120 insertions(+), 153 deletions(-) New commits: commit c9cce0d931b41ede0eca14b2ed2b84453f048362 Author: Arkadiy Illarionov AuthorDate: Sat Jul 13 21:29:10 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Mon Jul 15 18:57:11 2019 +0200 Simplify Sequence iterations in svl Use range-based loops, STL and comphelper functions Change-Id: I1c3dbf194600bec60c0881d2d19ff07b89d8333b Reviewed-on: https://gerrit.libreoffice.org/75563 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/svl/source/config/asiancfg.cxx b/svl/source/config/asiancfg.cxx index af8b6e95b230..43a6d19351c2 100644 --- a/svl/source/config/asiancfg.cxx +++ b/svl/source/config/asiancfg.cxx @@ -103,9 +103,9 @@ css::uno::Sequence< css::lang::Locale > SvxAsianConfig::GetStartEndCharLocales() impl_->context)-> getElementNames()); css::uno::Sequence< css::lang::Locale > ls(ns.getLength()); -for (sal_Int32 i = 0; i < ns.getLength(); ++i) { -ls[i] = LanguageTag::convertToLocale( ns[i], false); -} +std::transform(ns.begin(), ns.end(), ls.begin(), +[](const OUString& rName) -> css::lang::Locale { +return LanguageTag::convertToLocale( rName, false); }); return ls; } diff --git a/svl/source/items/ilstitem.cxx b/svl/source/items/ilstitem.cxx index 75499d772252..a63055c7ffef 100644 --- a/svl/source/items/ilstitem.cxx +++ b/svl/source/items/ilstitem.cxx @@ -40,9 +40,7 @@ SfxIntegerListItem::SfxIntegerListItem( sal_uInt16 which, const ::std::vector < SfxIntegerListItem::SfxIntegerListItem( sal_uInt16 which, const css::uno::Sequence < sal_Int32 >& rList ) : SfxPoolItem( which ) { -m_aList.resize( rList.getLength() ); -for ( sal_Int32 n=0; n const & SfxItemPropertyMap::getProperties() const { -if( !m_pImpl->m_aPropSeq.getLength() ) +if( !m_pImpl->m_aPropSeq.hasElements() ) { m_pImpl->m_aPropSeq.realloc( m_pImpl->size() ); beans::Property* pPropArray = m_pImpl->m_aPropSeq.getArray(); @@ -125,15 +125,13 @@ bool SfxItemPropertyMap::hasPropertyByName( const OUString& rName ) const void SfxItemPropertyMap::mergeProperties( const uno::Sequence< beans::Property >& rPropSeq ) { -const beans::Property* pPropArray = rPropSeq.getConstArray(); -sal_uInt32 nElements = rPropSeq.getLength(); -for( sal_uInt32 nElement = 0; nElement < nElements; ++nElement ) +for( const beans::Property& rProp : rPropSeq ) { SfxItemPropertySimpleEntry aTemp( -sal::static_int_cast< sal_Int16 >( pPropArray[nElement].Handle ), //nWID -pPropArray[nElement].Type, //aType -pPropArray[nElement].Attributes); //nFlags -(*m_pImpl)[pPropArray[nElement].Name] = aTemp; +sal::static_int_cast< sal_Int16 >( rProp.Handle ), //nWID +rProp.Type, //aType +rProp.Attributes); //nFlags +(*m_pImpl)[rProp.Name] = aTemp; } } diff --git a/svl/source/items/slstitm.cxx b/svl/source/items/slstitm.cxx index db0b781bbac1..225c43f08cfe 100644 --- a/svl/source/items/slstitm.cxx +++ b/svl/source/items/slstitm.cxx @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -147,8 +148,7 @@ void SfxStringListItem::SetStringList( const css::uno::Sequence< OUString >& rLi mpList.reset(new std::vector); // String belongs to the list -for ( sal_Int32 n = 0; n < rList.getLength(); n++ ) -mpList->push_back(rList[n]); +comphelper::sequenceToContainer(*mpList, rList); } void SfxStringListItem::GetStringList( css::uno::Sequence< OUString >& rList ) const diff --git a/svl/source/items/srchitem.cxx b/svl/source/items/srchitem.cxx index e53df3a77518..5443cc06539b 100644 --- a/svl/source/items/srchitem.cxx +++ b/svl/source/items/srchitem.cxx @@ -508,91 +508,91 @@ bool SvxSearchItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) if ( ( rVal >>= aSeq ) && ( aSeq.getLength() == SRCH_PARAMS ) ) { sal_Int16 nConvertedCount( 0 ); -for ( sal_Int32 i = 0; i < aSeq.getLength(); ++i ) +for ( const auto& rProp : aSeq ) { -if ( aSeq[i].Name
[Libreoffice-commits] core.git: svtools/source
svtools/source/config/extcolorcfg.cxx |7 svtools/source/config/fontsubstconfig.cxx | 16 - svtools/source/config/helpopt.cxx | 14 - svtools/source/config/miscopt.cxx | 14 - svtools/source/config/slidesorterbaropt.cxx | 14 - svtools/source/contnr/DocumentInfoPreview.cxx |4 svtools/source/contnr/contentenumeration.cxx|9 - svtools/source/control/inettbc.cxx | 174 svtools/source/dialogs/PlaceEditDialog.cxx |3 svtools/source/dialogs/addresstemplate.cxx | 40 +--- svtools/source/dialogs/colrdlg.cxx |6 svtools/source/dialogs/insdlg.cxx |5 svtools/source/filter/DocumentToGraphicRenderer.cxx | 18 +- svtools/source/filter/SvFilterOptionsDialog.cxx | 30 +-- svtools/source/filter/exportdialog.cxx |5 svtools/source/java/javainteractionhandler.cxx |9 - svtools/source/misc/embedhlp.cxx| 12 - svtools/source/misc/imagemgr.cxx|4 svtools/source/misc/langhelp.cxx| 19 -- svtools/source/misc/langtab.cxx |4 svtools/source/uno/genericunodialog.cxx |5 svtools/source/uno/popupmenucontrollerbase.cxx | 13 - svtools/source/uno/statusbarcontroller.cxx |4 svtools/source/uno/toolboxcontroller.cxx|4 svtools/source/uno/unocontroltablemodel.cxx |6 svtools/source/uno/unoevent.cxx |4 svtools/source/uno/wizard/unowizard.cxx | 28 +-- svtools/source/uno/wizard/wizardshell.cxx |4 28 files changed, 186 insertions(+), 289 deletions(-) New commits: commit 579b5bcd0477c411d2ae94be9aa33e653d8a38b6 Author: Arkadiy Illarionov AuthorDate: Fri Jul 12 00:45:46 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Mon Jul 15 18:56:33 2019 +0200 Simplify Sequence iterations in svtools Use range-based loops, STL and comphelper functions Change-Id: I4197b5083327998169a39389b968e1ff99f13339 Reviewed-on: https://gerrit.libreoffice.org/75440 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/svtools/source/config/extcolorcfg.cxx b/svtools/source/config/extcolorcfg.cxx index 6fdcf0ead67c..634344521d77 100644 --- a/svtools/source/config/extcolorcfg.cxx +++ b/svtools/source/config/extcolorcfg.cxx @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -436,11 +437,7 @@ bool ExtendedColorConfig_Impl::ExistsScheme(const OUString& _sSchemeName) uno::Sequence < OUString > aComponentNames = GetPropertyNames(sBase); sBase += "/" + _sSchemeName; -const OUString* pCompIter = aComponentNames.getConstArray(); -const OUString* pCompEnd = pCompIter + aComponentNames.getLength(); -for(;pCompIter != pCompEnd && *pCompIter != sBase;++pCompIter) -; -return pCompIter != pCompEnd; +return comphelper::findValue(aComponentNames, sBase) != -1; } void ExtendedColorConfig_Impl::SetColorConfigValue(const OUString& _sName, const ExtendedColorConfigValue& rValue ) diff --git a/svtools/source/config/fontsubstconfig.cxx b/svtools/source/config/fontsubstconfig.cxx index 7db21e021ba2..ffcc6399002d 100644 --- a/svtools/source/config/fontsubstconfig.cxx +++ b/svtools/source/config/fontsubstconfig.cxx @@ -60,24 +60,22 @@ SvtFontSubstConfig::SvtFontSubstConfig() : OUString sPropPrefix(cFontPairs); Sequence aNodeNames = GetNodeNames(sPropPrefix, ConfigNameFormat::LocalPath); -const OUString* pNodeNames = aNodeNames.getConstArray(); Sequence aPropNames(aNodeNames.getLength() * 4); OUString* pNames = aPropNames.getArray(); sal_Int32 nName = 0; sPropPrefix += "/"; -sal_Int32 nNode; -for(nNode = 0; nNode < aNodeNames.getLength(); nNode++) +for(const OUString& rNodeName : aNodeNames) { -OUString sStart = sPropPrefix + pNodeNames[nNode] + "/"; -pNames[nName] = sStart; pNames[nName++] += cReplaceFont; -pNames[nName] = sStart; pNames[nName++] += cSubstituteFont; -pNames[nName] = sStart; pNames[nName++] += cAlways; -pNames[nName] = sStart; pNames[nName++] += cOnScreenOnly; +OUString sStart = sPropPrefix + rNodeName + "/"; +pNames[nName++] = sStart + cReplaceFont; +pNames[nName++] = sStart + cSubstituteFont; +pNames[nName++] = sStart + cAlways; +pNames[nName++] = sStart + cOnScreenOnly; } Sequence aNodeValues = GetProperties(aPropNames); const Any* pNodeValues = aNodeValues.getConstArray(); nName = 0; -for(nNode = 0; nNode < aNodeNames.getLength(); nNode++) +for(sal_Int32 nNode = 0; nNode < aNodeNames.getLength(); nNode++) { SubstitutionStruct aInsert; pNodeValues[nName++] >>=
[Libreoffice-commits] core.git: include/svx reportdesign/source sc/source svx/source sw/source
include/svx/unomod.hxx|4 reportdesign/source/core/api/ReportDefinition.cxx |2 +- sc/source/ui/unoobj/docuno.cxx| 10 ++ svx/source/form/fmdmod.cxx|2 +- svx/source/unodraw/unomod.cxx |5 - sw/source/uibase/uno/unotxdoc.cxx |2 +- 6 files changed, 5 insertions(+), 20 deletions(-) New commits: commit f926de93c455f7cede505ad8cf849fe81eb514cf Author: Arkadiy Illarionov AuthorDate: Tue Jul 9 01:51:19 2019 +0300 Commit: Stephan Bergmann CommitDate: Mon Jul 15 13:06:38 2019 +0200 tdf#39593 Remove SvxUnoDrawMSFactory::concatServiceNames Replace with comphelper::concatSequences Change-Id: I6b16104fac6ac5fdfcb6f322da4a5b8405d5d999 Reviewed-on: https://gerrit.libreoffice.org/75315 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/include/svx/unomod.hxx b/include/svx/unomod.hxx index f8ecfd6fc965..d616a78650a6 100644 --- a/include/svx/unomod.hxx +++ b/include/svx/unomod.hxx @@ -50,10 +50,6 @@ public: /// @throws css::uno::Exception /// @throws css::uno::RuntimeException static css::uno::Reference< css::uno::XInterface > createTextField( const OUString& aServiceSpecifier ); -// internal -static css::uno::Sequence< OUString > -concatServiceNames( css::uno::Sequence< OUString >& rServices1, -css::uno::Sequence< OUString >& rServices2 ) throw(); /** fills the given EventObject from the given SdrHint. @returns diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx index 67f74d58458f..600dd78628b1 100644 --- a/reportdesign/source/core/api/ReportDefinition.cxx +++ b/reportdesign/source/core/api/ReportDefinition.cxx @@ -2169,7 +2169,7 @@ uno::Sequence< OUString > SAL_CALL OReportDefinition::getAvailableServiceNames() pStrings[nIdx] = aSvxComponentServiceNameList[nIdx]; uno::Sequence< OUString > aParentSeq( SvxUnoDrawMSFactory::getAvailableServiceNames() ); -return concatServiceNames( aParentSeq, aSeq ); +return comphelper::concatSequences( aParentSeq, aSeq ); } // XShape diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index e6c7495203c4..c16b992cd03b 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -2838,14 +2838,8 @@ uno::Sequence SAL_CALL ScModelObj::getAvailableServiceNames() { SolarMutexGuard aGuard; -//! why are the parameters of concatServiceNames not const ??? -//! return concatServiceNames( ScServiceProvider::GetAllServiceNames(), -//!SvxFmMSFactory::getAvailableServiceNames() ); - -uno::Sequence aMyServices(ScServiceProvider::GetAllServiceNames()); -uno::Sequence aDrawServices(SvxFmMSFactory::getAvailableServiceNames()); - -return concatServiceNames( aMyServices, aDrawServices ); +return comphelper::concatSequences( ScServiceProvider::GetAllServiceNames(), + SvxFmMSFactory::getAvailableServiceNames() ); } // XServiceInfo diff --git a/svx/source/form/fmdmod.cxx b/svx/source/form/fmdmod.cxx index 6f34a16d4d5f..894dea39cb21 100644 --- a/svx/source/form/fmdmod.cxx +++ b/svx/source/form/fmdmod.cxx @@ -85,7 +85,7 @@ using namespace ::svxform; auto aSeq( comphelper::arrayToSequence< OUString >(aSvxComponentServiceNameList, nSvxComponentServiceNameListCount) ); ::com::sun::star::uno::Sequence< OUString > aParentSeq( SvxUnoDrawMSFactory::getAvailableServiceNames() ); -return concatServiceNames( aParentSeq, aSeq ); +return comphelper::concatSequences( aParentSeq, aSeq ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/unodraw/unomod.cxx b/svx/source/unodraw/unomod.cxx index 4df6688e4523..530d3983d5e2 100644 --- a/svx/source/unodraw/unomod.cxx +++ b/svx/source/unodraw/unomod.cxx @@ -222,11 +222,6 @@ uno::Sequence< OUString > SAL_CALL SvxUnoDrawMSFactory::getAvailableServiceNames return UHashMap::getServiceNames(); } -uno::Sequence< OUString > SvxUnoDrawMSFactory::concatServiceNames( uno::Sequence< OUString >& rServices1, uno::Sequence< OUString >& rServices2 ) throw() -{ -return comphelper::concatSequences(rServices1, rServices2); -} - SdrModel& SvxUnoDrawingModel::getSdrModelFromUnoModel() const { OSL_ENSURE(mpDoc, "No SdrModel in UnoDrawingModel, should not happen"); diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index a73f4fd5d791..ccb0497d4179 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -1773,7 +1773,7 @@ Sequence< OUString > SwXTextDocument::getAvailableServiceNames() aRet.realloc( nLength - 1 ); } Sequence< OUString > aOwn = SwXServiceProvider::GetAllServiceNames(); -aServices =
[Libreoffice-commits] core.git: include/ucbhelper ucbhelper/source
include/ucbhelper/propertyvalueset.hxx |9 ucbhelper/source/provider/propertyvalueset.cxx | 241 - 2 files changed, 129 insertions(+), 121 deletions(-) New commits: commit 9d8bac40899b656ca5173fec880102f54e996382 Author: Arkadiy Illarionov AuthorDate: Sun Jun 30 19:22:37 2019 +0300 Commit: Stephan Bergmann CommitDate: Mon Jul 15 10:00:46 2019 +0200 Drop GETVALUE_IMPL/SETVALUE_IMPL macros Replace with PropertyValueSet getValue/appendValue templates Change-Id: I5714e6c4e6daf5ba6a4a9f9b363de3a1541834da Reviewed-on: https://gerrit.libreoffice.org/74930 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/include/ucbhelper/propertyvalueset.hxx b/include/ucbhelper/propertyvalueset.hxx index a0ecaf0df86d..97ee7c6ec889 100644 --- a/include/ucbhelper/propertyvalueset.hxx +++ b/include/ucbhelper/propertyvalueset.hxx @@ -40,6 +40,9 @@ namespace com { namespace sun { namespace star { namespace beans { namespace com { namespace sun { namespace star { namespace uno { class XComponentContext; } } } } +enum class PropsSet; +namespace ucbhelper_impl { struct PropertyValue; } + namespace ucbhelper { class PropertyValues; @@ -69,6 +72,12 @@ private: UCBHELPER_DLLPRIVATE const css::uno::Reference< css::script::XTypeConverter >& getTypeConverter(); +template +T getValue(PropsSet nTypeName, sal_Int32 columnIndex); + +template +void appendValue(const OUString& rPropName, PropsSet nTypeName, const T& rValue); + public: PropertyValueSet( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); diff --git a/ucbhelper/source/provider/propertyvalueset.cxx b/ucbhelper/source/provider/propertyvalueset.cxx index d1adaad4e6f2..486ac962aa34 100644 --- a/ucbhelper/source/provider/propertyvalueset.cxx +++ b/ucbhelper/source/provider/propertyvalueset.cxx @@ -130,101 +130,6 @@ class PropertyValues : public std::vector< ucbhelper_impl::PropertyValue > {}; } // namespace ucbhelper -// Welcome to the macro hell... - - -#define GETVALUE_IMPL( _type_, _type_name_, _member_name_ ) \ - \ -osl::MutexGuard aGuard( m_aMutex ); \ - \ -_type_ aValue {}; /* default ctor */\ - \ -m_bWasNull = true;\ - \ -if ( ( columnIndex < 1 ) \ - || ( columnIndex > sal_Int32( m_pValues->size() ) ) )\ -{ \ -OSL_FAIL( "PropertyValueSet - index out of range!" ); \ -return aValue;\ -} \ -ucbhelper_impl::PropertyValue& rValue \ -= (*m_pValues)[ columnIndex - 1 ];\ - \ -if ( rValue.nOrigValue == PropsSet::NONE )\ -return aValue;\ - \ -if ( rValue.nPropsSet & _type_name_ ) \ -{ \ -/* Values is present natively... */ \ -aValue = rValue._member_name_;\ -m_bWasNull = false; \ -return aValue;\ -} \ - \ -if ( !(rValue.nPropsSet & PropsSet::Object) ) \ -{ \ -/* Value is not (yet) available as Any. Create it. */ \ -getObject( columnIndex, Reference< XNameAccess >() ); \ -} \ - \ -if ( rValue.nPropsSet & PropsSet::Object )\ -{ \ -/* Value is available as Any. */ \ - \ -if ( rValue.aObject.hasValue() ) \ -{ \ -/* Try to convert into native value. */ \ -if ( rValue.aObject >>= aValue ) \ -{
[Libreoffice-commits] core.git: svx/source
svx/source/accessibility/AccessibleControlShape.cxx| 8 svx/source/accessibility/AccessibleShape.cxx | 34 -- svx/source/accessibility/lookupcolorname.cxx | 6 svx/source/core/graphichelper.cxx | 18 - svx/source/customshapes/EnhancedCustomShape2d.cxx | 26 -- svx/source/customshapes/EnhancedCustomShapeEngine.cxx | 8 svx/source/dialog/SvxNumOptionsTabPageHelper.cxx | 8 svx/source/dialog/charmap.cxx | 10 svx/source/dialog/langbox.cxx | 22 - svx/source/dialog/rubydialog.cxx | 26 -- svx/source/dialog/srchdlg.cxx | 12 svx/source/fmcomp/dbaexchange.cxx | 6 svx/source/fmcomp/fmgridcl.cxx | 30 -- svx/source/fmcomp/fmgridif.cxx | 31 -- svx/source/fmcomp/gridcell.cxx | 34 +- svx/source/fmcomp/gridctrl.cxx | 6 svx/source/form/dataaccessdescriptor.cxx | 17 - svx/source/form/datanavi.cxx | 51 +--- svx/source/form/filtnav.cxx| 14 - svx/source/form/fmdmod.cxx | 6 svx/source/form/fmexch.cxx | 10 svx/source/form/fmshimp.cxx| 63 +--- svx/source/form/fmsrcimp.cxx | 17 - svx/source/form/fmtextcontrolshell.cxx | 9 svx/source/form/formcontrolfactory.cxx | 14 - svx/source/form/formcontroller.cxx | 127 +++--- svx/source/form/formdispatchinterceptor.cxx| 9 svx/source/form/tabwin.cxx | 10 svx/source/gallery2/galbrws2.cxx | 8 svx/source/items/customshapeitem.cxx | 30 +- svx/source/items/galleryitem.cxx | 24 - svx/source/items/viewlayoutitem.cxx| 10 svx/source/items/zoomslideritem.cxx| 18 - svx/source/sidebar/nbdtmg.cxx | 32 +- svx/source/smarttags/SmartTagMgr.cxx | 12 svx/source/stbctrls/zoomsliderctrl.cxx | 3 svx/source/table/accessiblecell.cxx| 16 - svx/source/table/cell.cxx | 46 +-- svx/source/table/propertyset.cxx | 15 - svx/source/tbxctrls/tbunosearchcontrollers.cxx | 5 svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx | 6 svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx | 5 svx/source/unodraw/UnoGraphicExporter.cxx | 124 - svx/source/unodraw/unomod.cxx | 20 - svx/source/unodraw/unoshape.cxx| 15 - svx/source/unogallery/unogalthemeprovider.cxx | 9 svx/source/xml/xmlxtexp.cxx| 9 svx/source/xoutdev/xattr.cxx | 30 +- svx/source/xoutdev/xattrbmp.cxx| 14 - 49 files changed, 422 insertions(+), 661 deletions(-) New commits: commit 44a6335f49a64ac77207d3aa46c267503c65c5ff Author: Arkadiy Illarionov AuthorDate: Sun Jul 7 16:20:12 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Tue Jul 9 17:48:06 2019 +0200 Simplify Sequence iterations in svx Use range-based loops, STL and comphelper functions Change-Id: If6d190cf72b8653c1c3fbe9a6a6e47f10f1a6765 Reviewed-on: https://gerrit.libreoffice.org/75255 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/svx/source/accessibility/AccessibleControlShape.cxx b/svx/source/accessibility/AccessibleControlShape.cxx index 09dd1fb887bb..8b7de6c3a3bd 100644 --- a/svx/source/accessibility/AccessibleControlShape.cxx +++
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/docvw/edtwin.cxx |7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) New commits: commit ec00f4ed642344364b6de7afa3f03501fec05994 Author: Arkadiy Illarionov AuthorDate: Mon Jul 8 22:39:49 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Tue Jul 9 00:25:23 2019 +0200 Replace array with initializer list in QuickHelpData::FillStrArr 1e4fa857873c0bc728143087ec692c4b75aaf820 follow-up Change-Id: I788d3516d363820d6d49d7443ad99640bd3248bd Reviewed-on: https://gerrit.libreoffice.org/75244 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index efd52d8ab2c9..692b1acddca0 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -5967,11 +5967,7 @@ void QuickHelpData::FillStrArr( SwWrtShell const & rSh, const OUString& rWord ) (*pCalendar)->LoadDefaultCalendar( rSh.GetCurLang() ); // Add matching calendar month and day names -const std::array, 2> aCalendarItems = { -(*pCalendar)->getMonths(), -(*pCalendar)->getDays() -}; -for ( const auto& aNames : aCalendarItems ) +for ( const auto& aNames : { (*pCalendar)->getMonths(), (*pCalendar)->getDays() } ) { for ( const auto& rName : aNames ) { @@ -6056,7 +6052,6 @@ void QuickHelpData::FillStrArr( SwWrtShell const & rSh, const OUString& rWord ) m_aHelpStrings.push_back( aCompletedString ); } } - } namespace { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: ucb/source
ucb/source/ucp/file/filrow.cxx | 37 - 1 file changed, 8 insertions(+), 29 deletions(-) New commits: commit b35ae1efee703c0faa0cbf5ed4c1949456d83099 Author: Arkadiy Illarionov AuthorDate: Sat Jul 6 19:15:13 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Mon Jul 8 21:47:50 2019 +0200 tdf#39593 Reduce copy-paste in XRow_impl::get* some more Add value initialization to template Change-Id: I89ff656bfd5df56ead7e976ff3b532ddb662c374 Reviewed-on: https://gerrit.libreoffice.org/75169 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/ucb/source/ucp/file/filrow.cxx b/ucb/source/ucp/file/filrow.cxx index 67845ea426d7..60081f340c54 100644 --- a/ucb/source/ucp/file/filrow.cxx +++ b/ucb/source/ucp/file/filrow.cxx @@ -112,10 +112,7 @@ XRow_impl::getBoolean( { if( isIndexOutOfBounds( columnIndex ) ) throw sdbc::SQLException( THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() ); -bool Value( false ); -osl::MutexGuard aGuard( m_aMutex ); -m_nWasNull = ::convert( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value ); -return Value; +return getValue(columnIndex); } @@ -125,10 +122,7 @@ XRow_impl::getByte( { if( isIndexOutOfBounds( columnIndex ) ) throw sdbc::SQLException( THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() ); -sal_Int8 Value( 0 ); -osl::MutexGuard aGuard( m_aMutex ); -m_nWasNull = ::convert( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value ); -return Value; +return getValue(columnIndex); } sal_Int16 SAL_CALL @@ -137,10 +131,7 @@ XRow_impl::getShort( { if( isIndexOutOfBounds( columnIndex ) ) throw sdbc::SQLException( THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() ); -sal_Int16 Value( 0 ); -osl::MutexGuard aGuard( m_aMutex ); -m_nWasNull = ::convert( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value ); -return Value; +return getValue(columnIndex); } @@ -150,10 +141,7 @@ XRow_impl::getInt( { if( isIndexOutOfBounds( columnIndex ) ) throw sdbc::SQLException( THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() ); -sal_Int32 Value( 0 ); -osl::MutexGuard aGuard( m_aMutex ); -m_nWasNull = ::convert( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value ); -return Value; +return getValue(columnIndex); } sal_Int64 SAL_CALL @@ -162,10 +150,7 @@ XRow_impl::getLong( { if( isIndexOutOfBounds( columnIndex ) ) throw sdbc::SQLException( THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() ); -sal_Int64 Value( 0 ); -osl::MutexGuard aGuard( m_aMutex ); -m_nWasNull = ::convert( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value ); -return Value; +return getValue(columnIndex); } float SAL_CALL @@ -174,10 +159,7 @@ XRow_impl::getFloat( { if( isIndexOutOfBounds( columnIndex ) ) throw sdbc::SQLException( THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() ); -float Value( 0 ); -osl::MutexGuard aGuard( m_aMutex ); -m_nWasNull = ::convert( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value ); -return Value; +return getValue(columnIndex); } double SAL_CALL @@ -186,10 +168,7 @@ XRow_impl::getDouble( { if( isIndexOutOfBounds( columnIndex ) ) throw sdbc::SQLException( THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() ); -double Value( 0 ); -osl::MutexGuard aGuard( m_aMutex ); -m_nWasNull = ::convert( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value ); -return Value; +return getValue(columnIndex); } uno::Sequence< sal_Int8 > SAL_CALL @@ -308,7 +287,7 @@ XRow_impl::isIndexOutOfBounds(sal_Int32 nIndex) template T XRow_impl::getValue(sal_Int32 columnIndex) { -T aValue; +T aValue{}; osl::MutexGuard aGuard( m_aMutex ); m_nWasNull = ::convert( m_pMyShell, m_xTypeConverter, m_aValueMap[ --columnIndex ], aValue ); return aValue; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/source
sw/source/core/unocore/unoidx.cxx | 125 +++--- 1 file changed, 51 insertions(+), 74 deletions(-) New commits: commit 499c54334a40ae969e3c7c85590a991a53b8de2e Author: Arkadiy Illarionov AuthorDate: Sat Jul 6 17:45:51 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Mon Jul 8 21:46:36 2019 +0200 tdf#39593 Replace copy-pasted functions with template Change-Id: If61852ec6294a7b411fe506b46c6bea3c000b055 Reviewed-on: https://gerrit.libreoffice.org/75168 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index 48ac53e30dcd..d8c0f3a538c2 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -71,39 +71,16 @@ using namespace ::com::sun::star; /// @throws lang::IllegalArgumentException -static OUString -lcl_AnyToString(uno::Any const& rVal) -{ -OUString sRet; -if(!(rVal >>= sRet)) -{ -throw lang::IllegalArgumentException(); -} -return sRet; -} - -/// @throws lang::IllegalArgumentException -static sal_Int16 -lcl_AnyToInt16(uno::Any const& rVal) -{ -sal_Int16 nRet = 0; -if(!(rVal >>= nRet)) -{ -throw lang::IllegalArgumentException(); -} -return nRet; -} - -/// @throws lang::IllegalArgumentException -static bool -lcl_AnyToBool(uno::Any const& rVal) +template +static T +lcl_AnyToType(uno::Any const& rVal) { -bool bRet = false; -if(!(rVal >>= bRet)) +T aRet{}; +if(!(rVal >>= aRet)) { throw lang::IllegalArgumentException(); } -return bRet; +return aRet; } /// @throws lang::IllegalArgumentException @@ -111,7 +88,7 @@ template static void lcl_AnyToBitMask(uno::Any const& rValue, T & rBitMask, const T nBit) { -rBitMask = lcl_AnyToBool(rValue) +rBitMask = lcl_AnyToType(rValue) ? (rBitMask | nBit) : (rBitMask & ~nBit); } @@ -650,19 +627,19 @@ SwXDocumentIndex::setPropertyValue( break; case WID_LEVEL: { -rTOXBase.SetLevel(lcl_AnyToInt16(rValue)); +rTOXBase.SetLevel(lcl_AnyToType(rValue)); } break; case WID_TOC_BOOKMARK: { - rTOXBase.SetBookmarkName(lcl_AnyToString(rValue)); + rTOXBase.SetBookmarkName(lcl_AnyToType(rValue)); nCreate = SwTOXElement::Bookmark; rTOXBase.SetCreate(nCreate); } break; case WID_INDEX_ENTRY_TYPE: { -rTOXBase.SetEntryTypeName(lcl_AnyToString(rValue)); +rTOXBase.SetEntryTypeName(lcl_AnyToType(rValue)); nCreate = SwTOXElement::IndexEntryType; rTOXBase.SetCreate(nCreate); } @@ -688,14 +665,14 @@ SwXDocumentIndex::setPropertyValue( lcl_AnyToBitMask(rValue, nCreate, SwTOXElement::TableLeader); break ; case WID_CREATE_FROM_CHAPTER: -rTOXBase.SetFromChapter(lcl_AnyToBool(rValue)); +rTOXBase.SetFromChapter(lcl_AnyToType(rValue)); break; case WID_CREATE_FROM_LABELS: -rTOXBase.SetFromObjectNames(! lcl_AnyToBool(rValue)); +rTOXBase.SetFromObjectNames(! lcl_AnyToType(rValue)); break; case WID_PROTECTED: { -bool bSet = lcl_AnyToBool(rValue); +bool bSet = lcl_AnyToType(rValue); rTOXBase.SetProtected(bSet); if (pSectionFormat) { @@ -731,19 +708,19 @@ SwXDocumentIndex::setPropertyValue( break; case WID_IS_COMMA_SEPARATED: bForm = true; -aForm.SetCommaSeparated(lcl_AnyToBool(rValue)); +aForm.SetCommaSeparated(lcl_AnyToType(rValue)); break; case WID_LABEL_CATEGORY: { // convert file-format/API/external programmatic english name // to internal UI name before usage rTOXBase.SetSequenceName( SwStyleNameMapper::GetSpecialExtraUIName( -lcl_AnyToString(rValue) ) ); +lcl_AnyToType(rValue) ) ); } break; case WID_LABEL_DISPLAY_TYPE: { -const sal_Int16 nVal = lcl_AnyToInt16(rValue); +const sal_Int16 nVal = lcl_AnyToType(rValue); sal_uInt16 nSet = CAPTION_COMPLETE; switch (nVal) { @@ -763,12 +740,12 @@ SwXDocumentIndex::setPropertyValue( } break; case WID_USE_LEVEL_FROM_SOURCE: -rTOXBase.SetLevelFromChapter(lcl_AnyToBool(rValue)); +rTOXBase.SetLevelFromChapter(lcl_AnyToType(rValue)); break; case WID_MAIN_ENTRY_CHARACTER_STYLE_NAME: { OUString aString; -SwStyleNameMapper::FillUIName(lcl_AnyToString(rValue), +SwStyleNameMapper::FillUIName(lcl_AnyToType(rValue), aString,
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/extras/globalfilter/globalfilter.cxx |7 +-- sw/qa/extras/inc/bordertest.hxx|7 +-- sw/qa/extras/inc/swmodeltestbase.hxx | 13 +- sw/qa/extras/mailmerge/mailmerge.cxx |8 +-- sw/qa/extras/tiledrendering/tiledrendering.cxx |2 sw/qa/extras/uiwriter/uiwriter.cxx | 27 ++-- sw/source/core/access/acchyperlink.cxx |5 -- sw/source/core/access/accpara.cxx | 53 ++--- sw/source/core/access/accselectionhelper.cxx |8 --- sw/source/core/doc/docglos.cxx | 10 ++-- sw/source/core/doc/docxforms.cxx |6 -- sw/source/core/edit/edlingu.cxx| 32 +-- sw/source/core/fields/authfld.cxx | 23 +- sw/source/core/fields/flddropdown.cxx |4 - sw/source/core/unocore/SwXTextDefaults.cxx |6 -- sw/source/core/unocore/unochart.cxx| 46 - sw/source/core/unocore/unocoll.cxx | 13 ++ sw/source/core/unocore/unocrsrhelper.cxx |4 - sw/source/core/unocore/unodraw.cxx | 16 ++- sw/source/core/unocore/unoevent.cxx|4 - sw/source/core/unocore/unoflatpara.cxx |8 +-- sw/source/core/unocore/unoframe.cxx| 10 +--- sw/source/core/unocore/unoidx.cxx |8 +-- sw/source/core/unocore/unoobj.cxx | 31 ++ sw/source/core/unocore/unoparagraph.cxx| 17 ++-- sw/source/core/unocore/unoport.cxx |7 --- sw/source/core/unocore/unosett.cxx | 15 ++- sw/source/core/unocore/unosrch.cxx |9 +--- sw/source/core/unocore/unostyle.cxx| 12 ++--- sw/source/core/unocore/unotext.cxx | 31 +- sw/source/core/unocore/unotextmarkup.cxx | 27 31 files changed, 176 insertions(+), 293 deletions(-) New commits: commit 3e8989d47e3116a99d4b9f6d03800464ff235de8 Author: Arkadiy Illarionov AuthorDate: Sat Jul 6 17:07:05 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Mon Jul 8 21:23:39 2019 +0200 Simplify Sequence iterations in sw/qa/* and sw/source/core/* Use range-based loops, STL and comphelper functions Change-Id: I5bd910a86bd80c553cd4a0c044a8eb61084f77ae Reviewed-on: https://gerrit.libreoffice.org/75167 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/sw/qa/extras/globalfilter/globalfilter.cxx b/sw/qa/extras/globalfilter/globalfilter.cxx index 012e16eb3de2..337d182b4809 100644 --- a/sw/qa/extras/globalfilter/globalfilter.cxx +++ b/sw/qa/extras/globalfilter/globalfilter.cxx @@ -634,9 +634,8 @@ void Test::testMSCharBackgroundEditing() xRun->setPropertyValue("CharHighlight", uno::makeAny(static_cast(COL_TRANSPARENT))); // Remove shading marker uno::Sequence aGrabBag = getProperty >(xRun,"CharInteropGrabBag"); -for (int j = 0; j < aGrabBag.getLength(); ++j) +for (beans::PropertyValue& rProp : aGrabBag) { -beans::PropertyValue& rProp = aGrabBag[j]; if (rProp.Name == "CharShadingMarker") { CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), true, rProp.Value.get()); @@ -1207,7 +1206,7 @@ void Test::testDropDownFormField() { pListEntries->second >>= vListEntries; -if(vListEntries.getLength()) +if(vListEntries.hasElements()) { auto pResult = pParameters->find(ODF_FORMDROPDOWN_RESULT); if (pResult != pParameters->end()) @@ -1220,7 +1219,7 @@ void Test::testDropDownFormField() // The first one is empty if(nIndex == 0) { -CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), sal_Int32(0), vListEntries.getLength()); +CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(), !vListEntries.hasElements()); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), sal_Int32(-1), nSelection); } else // The second one has list and also a selected item diff --git a/sw/qa/extras/inc/bordertest.hxx b/sw/qa/extras/inc/bordertest.hxx index b1376ee36530..52776c38e012 100644 --- a/sw/qa/extras/inc/bordertest.hxx +++ b/sw/qa/extras/inc/bordertest.hxx @@ -155,7 +155,6 @@ public: { uno::Reference const xTextTable(xServiceInfo, uno::UNO_QUERY_THROW); uno::Sequence const cells = xTextTable->getCellNames(); -sal_Int32 nLength = cells.getLength(); if(currentTable == sal_Int32(1)) tempMap = @@ -174,13 +173,13 @@ public: BorderLineMap::iterator it = tempMap->begin(); -for (sal_Int32 i = 0; i <
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/docvw/edtwin.cxx | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) New commits: commit 1e4fa857873c0bc728143087ec692c4b75aaf820 Author: Arkadiy Illarionov AuthorDate: Sun Jul 7 16:36:30 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Sun Jul 7 17:12:58 2019 +0200 Iterate over explicit array of sequences in QuickHelpData::FillStrArr Change-Id: Ibce0ce85c8447b9b0d0f464f062306fde7e4a07a Reviewed-on: https://gerrit.libreoffice.org/75177 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 5ed8668e2e0b..efd52d8ab2c9 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -5967,8 +5967,11 @@ void QuickHelpData::FillStrArr( SwWrtShell const & rSh, const OUString& rWord ) (*pCalendar)->LoadDefaultCalendar( rSh.GetCurLang() ); // Add matching calendar month and day names -uno::Sequence< i18n::CalendarItem2 > aNames( (*pCalendar)->getMonths() ); -for ( sal_uInt16 i = 0; i < 2; ++i ) +const std::array, 2> aCalendarItems = { +(*pCalendar)->getMonths(), +(*pCalendar)->getDays() +}; +for ( const auto& aNames : aCalendarItems ) { for ( const auto& rName : aNames ) { @@ -5996,9 +5999,6 @@ void QuickHelpData::FillStrArr( SwWrtShell const & rSh, const OUString& rWord ) m_aHelpStrings.push_back( rStr ); } } -// Data for second loop iteration -if ( i == 0 ) -aNames = (*pCalendar)->getDays(); } // Add matching current date in ISO 8601 format, for example 2016-01-30 ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/source
sw/source/filter/html/htmlforw.cxx| 20 - sw/source/filter/ww8/docxattributeoutput.cxx | 352 +++- sw/source/filter/ww8/docxexport.cxx | 139 +++-- sw/source/filter/ww8/docxsdrexport.cxx| 66 +--- sw/source/filter/ww8/docxtablestyleexport.cxx | 370 -- sw/source/filter/ww8/rtfattributeoutput.cxx |6 sw/source/filter/ww8/ww8par.cxx |9 sw/source/filter/xml/wrtxml.cxx |3 sw/source/filter/xml/xmlimp.cxx | 125 +++- sw/source/filter/xml/xmlmeta.cxx |6 10 files changed, 498 insertions(+), 598 deletions(-) New commits: commit 310cbbd5866f19d2a82bef35da66f56af90c2d08 Author: Arkadiy Illarionov AuthorDate: Thu Jul 4 22:34:01 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Fri Jul 5 20:20:34 2019 +0200 Simplify Sequence iterations in sw/source/filter/* Use range-based loops, STL and comphelper functions Change-Id: I8ec58bdd38061936f621cdfdbfde59a38ac86705 Reviewed-on: https://gerrit.libreoffice.org/75103 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx index 3b0715581352..eb8697d99291 100644 --- a/sw/source/filter/html/htmlforw.cxx +++ b/sw/source/filter/html/htmlforw.cxx @@ -127,15 +127,13 @@ static void lcl_html_outEvents( SvStream& rStrm, uno::Sequence< script::ScriptEventDescriptor > aDescs = xEventManager->getScriptEvents( nPos ); -nCount = aDescs.getLength(); -if( !nCount ) +if( !aDescs.hasElements() ) return; -const script::ScriptEventDescriptor *pDescs = aDescs.getConstArray(); -for( sal_Int32 i = 0; i < nCount; i++ ) +for( const script::ScriptEventDescriptor& rDesc : aDescs ) { ScriptType eScriptType = EXTENDED_STYPE; -OUString aScriptType( pDescs[i].ScriptType ); +OUString aScriptType( rDesc.ScriptType ); if( aScriptType.equalsIgnoreAsciiCase(SVX_MACRO_LANGUAGE_JAVASCRIPT) ) eScriptType = JAVASCRIPT; else if( aScriptType.equalsIgnoreAsciiCase(SVX_MACRO_LANGUAGE_STARBASIC ) ) @@ -143,7 +141,7 @@ static void lcl_html_outEvents( SvStream& rStrm, if( JAVASCRIPT != eScriptType && !bCfgStarBasic ) continue; -OUString sListener( pDescs[i].ListenerType ); +OUString sListener( rDesc.ListenerType ); if (!sListener.isEmpty()) { const sal_Int32 nIdx { sListener.lastIndexOf('.')+1 }; @@ -159,7 +157,7 @@ static void lcl_html_outEvents( SvStream& rStrm, } } } -OUString sMethod( pDescs[i].EventMethod ); +OUString sMethod( rDesc.EventMethod ); const sal_Char *pOpt = nullptr; for( int j=0; aEventListenerTable[j]; j++ ) @@ -175,7 +173,7 @@ static void lcl_html_outEvents( SvStream& rStrm, OString sOut = " "; if( pOpt && (EXTENDED_STYPE != eScriptType || - pDescs[i].AddListenerParam.isEmpty()) ) + rDesc.AddListenerParam.isEmpty()) ) sOut += OString(pOpt); else { @@ -185,16 +183,16 @@ static void lcl_html_outEvents( SvStream& rStrm, } sOut += "=\""; rStrm.WriteOString( sOut ); -HTMLOutFuncs::Out_String( rStrm, pDescs[i].ScriptCode, eDestEnc, pNonConvertableChars ); +HTMLOutFuncs::Out_String( rStrm, rDesc.ScriptCode, eDestEnc, pNonConvertableChars ); rStrm.WriteChar( '\"' ); if( EXTENDED_STYPE == eScriptType && -!pDescs[i].AddListenerParam.isEmpty() ) +!rDesc.AddListenerParam.isEmpty() ) { sOut = " " OOO_STRING_SVTOOLS_HTML_O_sdaddparam + OUStringToOString(sListener, RTL_TEXTENCODING_ASCII_US) + "-" + OUStringToOString(sMethod, RTL_TEXTENCODING_ASCII_US) + "=\""; rStrm.WriteOString( sOut ); -HTMLOutFuncs::Out_String( rStrm, pDescs[i].AddListenerParam, +HTMLOutFuncs::Out_String( rStrm, rDesc.AddListenerParam, eDestEnc, pNonConvertableChars ); rStrm.WriteChar( '\"' ); } diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 2414c7efcb75..ac88e97d32eb 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -616,15 +616,10 @@ bool DocxAttributeOutput::TextBoxIsFramePr(const SwFrameFormat& rFrameFormat) { uno::Sequence< beans::PropertyValue > propList; xPropertySet->getPropertyValue("FrameInteropGrabBag") >>= propList; -for (sal_Int32 nProp=0; nProp < propList.getLength(); ++nProp) -{ -OUString propName = propList[nProp].Name; -if (propName == "ParaFrameProperties") -
[Libreoffice-commits] core.git: sw/source
sw/source/ui/config/optcomp.cxx |8 --- sw/source/ui/dbui/addresslistdialog.cxx | 21 +++- sw/source/ui/dbui/dbinsdlg.cxx| 32 sw/source/ui/dbui/dbtablepreviewdialog.cxx| 17 ++ sw/source/ui/dbui/mmaddressblockpage.cxx | 42 +--- sw/source/ui/dbui/mmdocselectpage.cxx |4 - sw/source/ui/dbui/mmgreetingspage.cxx | 12 ++-- sw/source/ui/dbui/mmlayoutpage.cxx| 14 ++--- sw/source/ui/dbui/mmoutputtypepage.cxx|4 - sw/source/ui/dbui/mmresultdialogs.cxx |5 - sw/source/ui/dbui/selectdbtabledialog.cxx |6 -- sw/source/ui/envelp/envlop1.cxx |5 - sw/source/ui/envelp/label1.cxx|5 - sw/source/ui/envelp/mailmrge.cxx | 19 ++- sw/source/ui/fldui/DropDownFieldDialog.cxx|5 - sw/source/ui/fldui/changedb.cxx | 11 sw/source/ui/fldui/flddinf.cxx|4 - sw/source/ui/fldui/fldfunc.cxx|5 - sw/source/ui/index/swuiidxmrk.cxx | 28 -- sw/source/ui/vba/vbaaddins.cxx|4 - sw/source/ui/vba/vbadocumentproperties.cxx| 36 - sw/source/ui/vba/vbafilterpropsfromformat.hxx | 67 -- sw/source/ui/vba/vbastyles.cxx| 12 +--- sw/source/ui/vba/vbatabstops.cxx | 30 +-- sw/source/ui/vba/vbavariable.cxx |9 +-- sw/source/ui/vba/vbavariables.cxx |5 + 26 files changed, 165 insertions(+), 245 deletions(-) New commits: commit 890a59934985ee73d15be10fc083d325858c4f4b Author: Arkadiy Illarionov AuthorDate: Tue Jul 2 19:15:51 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Wed Jul 3 21:00:41 2019 +0200 Simplify Sequence iterations in sw/source/ui/* Use range-based loops, STL and comphelper functions Change-Id: I0832f526cc549c76b423f5d5d7a5d2928ce117dc Reviewed-on: https://gerrit.libreoffice.org/75005 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx index fff81e5e82a5..439fbb8285a6 100644 --- a/sw/source/ui/config/optcomp.cxx +++ b/sw/source/ui/config/optcomp.cxx @@ -242,14 +242,10 @@ void SwCompatibilityOptPage::InitControls( const SfxItemSet& rSet ) SvtCompatibilityEntry aEntry; aEntry.setValue( SvtCompatibilityEntry::Index::ExpandWordSpace, false ); -const sal_Int32 nCount = aList.getLength(); -for ( sal_Int32 i = 0; i < nCount; ++i ) +for ( const Sequence< PropertyValue >& rEntry : aList ) { -const Sequence< PropertyValue >& rEntry = aList[i]; -const sal_Int32 nEntries = rEntry.getLength(); -for ( sal_Int32 j = 0; j < nEntries; j++ ) +for ( const PropertyValue& aValue : rEntry ) { -PropertyValue aValue = rEntry[j]; aEntry.setValue( SvtCompatibilityEntry::getIndex(aValue.Name), aValue.Value ); } diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx index 93446315ee55..21c2a19dfef1 100644 --- a/sw/source/ui/dbui/addresslistdialog.cxx +++ b/sw/source/ui/dbui/addresslistdialog.cxx @@ -99,12 +99,12 @@ static OUString lcl_getFlatURL( uno::Reference const & xSou { OUString sExtension; OUString sCharSet; -for(sal_Int32 nInfo = 0; nInfo < aInfo.getLength(); ++nInfo) +for(const auto& rInfo : aInfo) { -if(aInfo[nInfo].Name == "Extension") -aInfo[nInfo].Value >>= sExtension; -else if(aInfo[nInfo].Name == "CharSet") -aInfo[nInfo].Value >>= sCharSet; +if(rInfo.Name == "Extension") +rInfo.Value >>= sExtension; +else if(rInfo.Name == "CharSet") +rInfo.Value >>= sCharSet; } if (sCharSet=="UTF-8") { @@ -168,17 +168,16 @@ SwAddressListDialog::SwAddressListDialog(SwMailMergeAddressBlockPage* pParent) SwDBConfig aDb; const OUString sBibliography = aDb.GetBibliographySource().sDataSource; uno::Sequence< OUString> aNames = m_xDBContext->getElementNames(); -const OUString* pNames = aNames.getConstArray(); -for(sal_Int32 nName = 0; nName < aNames.getLength(); ++nName) +for(const OUString& rName : aNames) { -if ( pNames[nName] == sBibliography ) +if ( rName == sBibliography ) continue; m_xListLB->append(m_xIter.get()); -m_xListLB->set_text(*m_xIter, pNames[nName], 0); +m_xListLB->set_text(*m_xIter, rName, 0); m_aUserData.emplace_back(new AddressUserData_Impl); AddressUserData_Impl* pUserData = m_aUserData.back().get();
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/app/docsh.cxx |5 - sw/source/uibase/app/docshini.cxx | 14 +-- sw/source/uibase/dbui/dbmgr.cxx| 93 ++- sw/source/uibase/dbui/dbtree.cxx | 32 ++-- sw/source/uibase/dbui/mailmergehelper.cxx |5 - sw/source/uibase/dbui/mmconfigitem.cxx | 99 ++--- sw/source/uibase/docvw/edtwin.cxx |4 - sw/source/uibase/envelp/labelcfg.cxx | 43 +++--- sw/source/uibase/fldui/fldmgr.cxx | 29 ++- sw/source/uibase/lingu/olmenu.cxx | 41 -- sw/source/uibase/misc/numberingtypelistbox.cxx | 29 +-- sw/source/uibase/shells/textsh1.cxx|4 - sw/source/uibase/uiview/view.cxx | 58 +++--- sw/source/uibase/uno/SwXFilterOptions.cxx |5 - sw/source/uibase/uno/unodispatch.cxx | 10 -- sw/source/uibase/uno/unomailmerge.cxx | 21 ++--- sw/source/uibase/uno/unomodule.cxx |9 -- sw/source/uibase/uno/unotxdoc.cxx | 82 ++-- sw/source/uibase/uno/unotxvw.cxx | 34 19 files changed, 234 insertions(+), 383 deletions(-) New commits: commit 671517c462c51b356a35a2d51aa27e90bd3f9531 Author: Arkadiy Illarionov AuthorDate: Tue Jul 2 17:18:03 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Wed Jul 3 21:00:07 2019 +0200 Simplify Sequence iterations in sw/source/uibase/ Use range-based loops, STL and comphelper functions Change-Id: Ia67ebfa0aa0abad855975b13e86e699811ef713a Reviewed-on: https://gerrit.libreoffice.org/75003 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx index 96c7634ea5c3..229decaf2a9c 100644 --- a/sw/source/uibase/app/docsh.cxx +++ b/sw/source/uibase/app/docsh.cxx @@ -652,10 +652,9 @@ bool SwDocShell::ConvertTo( SfxMedium& rMedium ) uno::Reference< XLibraryContainer > xLibCont(GetBasicContainer(), UNO_QUERY); uno::Reference< XNameAccess > xLib; Sequence aNames = xLibCont->getElementNames(); -const OUString* pNames = aNames.getConstArray(); -for(sal_Int32 nLib = 0; nLib < aNames.getLength(); nLib++) +for(const OUString& rName : aNames) { -Any aLib = xLibCont->getByName(pNames[nLib]); +Any aLib = xLibCont->getByName(rName); aLib >>= xLib; if(xLib.is()) { diff --git a/sw/source/uibase/app/docshini.cxx b/sw/source/uibase/app/docshini.cxx index 537be6405bfd..5bbc20421fbc 100644 --- a/sw/source/uibase/app/docshini.cxx +++ b/sw/source/uibase/app/docshini.cxx @@ -127,16 +127,12 @@ bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) { SvxAsianConfig aAsian; Sequence aLocales = aAsian.GetStartEndCharLocales(); -if (aLocales.hasElements()) +for(const lang::Locale& rLocale : aLocales) { -const lang::Locale* pLocales = aLocales.getConstArray(); -for(sal_Int32 i = 0; i < aLocales.getLength(); i++) -{ -ForbiddenCharacters aForbidden; -aAsian.GetStartEndChars( pLocales[i], aForbidden.beginLine, aForbidden.endLine); -LanguageType eLang = LanguageTag::convertToLanguageType(pLocales[i]); - m_xDoc->getIDocumentSettingAccess().setForbiddenCharacters( eLang, aForbidden); -} +ForbiddenCharacters aForbidden; +aAsian.GetStartEndChars( rLocale, aForbidden.beginLine, aForbidden.endLine); +LanguageType eLang = LanguageTag::convertToLanguageType(rLocale); +m_xDoc->getIDocumentSettingAccess().setForbiddenCharacters( eLang, aForbidden); } m_xDoc->getIDocumentSettingAccess().set(DocumentSettingId::KERN_ASIAN_PUNCTUATION, !aAsian.IsKerningWesternTextOnly()); diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index 3b1adf7ea7ba..48ce4dc80a5a 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -730,18 +730,16 @@ bool SwDBManager::GetTableNames(weld::ComboBox& rBox, const OUString& rDBName) { uno::Reference xTables = xTSupplier->getTables(); uno::Sequence aTables = xTables->getElementNames(); -const OUString* pTables = aTables.getConstArray(); -for (sal_Int32 i = 0; i < aTables.getLength(); ++i) -rBox.append("0", pTables[i]); +for (const OUString& rTable : aTables) +rBox.append("0", rTable); } uno::Reference xQSupplier(xConnection, uno::UNO_QUERY);
[Libreoffice-commits] core.git: test/source
test/source/beans/xpropertyset.cxx |3 - test/source/sheet/databaseimportdescriptor.cxx | 42 - test/source/sheet/xdatabaserange.cxx |3 - test/source/sheet/xdatapilottable2.cxx | 15 test/source/sheet/xsubtotalfield.cxx |4 +- test/source/text/textcontent.cxx |2 - 6 files changed, 34 insertions(+), 35 deletions(-) New commits: commit 706798376f42771f9c644852eeaeed5540f421ef Author: Arkadiy Illarionov AuthorDate: Sun Jun 30 20:50:45 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Mon Jul 1 07:18:16 2019 +0200 Simplify Sequence iterations in test Use range-based loops or replace with STL functions Change-Id: I93efa86f49eb49dbdd3b7572dbd538bc300ded05 Reviewed-on: https://gerrit.libreoffice.org/74932 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/test/source/beans/xpropertyset.cxx b/test/source/beans/xpropertyset.cxx index f8ac7d17f206..c1638ca0e548 100644 --- a/test/source/beans/xpropertyset.cxx +++ b/test/source/beans/xpropertyset.cxx @@ -283,9 +283,8 @@ void XPropertySet::fillPropsToTest(const uno::Reference aSkip.insert("CharRelief"); aSkip.insert("IsLayerMode"); -for (sal_Int32 i = 0; i < aProps.getLength(); ++i) +for (const beans::Property& aProp : aProps) { -beans::Property aProp = aProps[i]; if (aSkip.count(aProp.Name) > 0) continue; diff --git a/test/source/sheet/databaseimportdescriptor.cxx b/test/source/sheet/databaseimportdescriptor.cxx index acbe44b1ff71..482af249e5e9 100644 --- a/test/source/sheet/databaseimportdescriptor.cxx +++ b/test/source/sheet/databaseimportdescriptor.cxx @@ -30,69 +30,69 @@ void DatabaseImportDescriptor::testDatabaseImportDescriptorProperties() uno::Reference xImportable(getXImportable(), UNO_QUERY_THROW); uno::Sequence aPropValues = xImportable->createImportDescriptor(true); -for (auto i = 0; i < aPropValues.getLength(); i++) +for (auto& rPropValue : aPropValues) { uno::Any aOldValue; uno::Any aNewValue; -if (aPropValues[i].Name == "DatabaseName" || aPropValues[i].Name == "SourceObject" -|| aPropValues[i].Name == "ConnectionResource") +if (rPropValue.Name == "DatabaseName" || rPropValue.Name == "SourceObject" +|| rPropValue.Name == "ConnectionResource") { OUString aValue; -aOldValue = aPropValues[i].Value; +aOldValue = rPropValue.Value; aOldValue >>= aValue; OString aMsgGet = "Unable to get PropertyValue " - + OUStringToOString(aPropValues[i].Name, RTL_TEXTENCODING_UTF8); + + OUStringToOString(rPropValue.Name, RTL_TEXTENCODING_UTF8); CPPUNIT_ASSERT_EQUAL_MESSAGE(aMsgGet.getStr(), OUString(""), aValue); aNewValue <<= OUString("New"); -aPropValues[i].Value = aNewValue; +rPropValue.Value = aNewValue; -aOldValue = aPropValues[i].Value; +aOldValue = rPropValue.Value; aOldValue >>= aValue; OString aMsgSet = "Unable to set PropertyValue " - + OUStringToOString(aPropValues[i].Name, RTL_TEXTENCODING_UTF8); + + OUStringToOString(rPropValue.Name, RTL_TEXTENCODING_UTF8); CPPUNIT_ASSERT_EQUAL_MESSAGE(aMsgSet.getStr(), OUString("New"), aValue); } -else if (aPropValues[i].Name == "IsNative") +else if (rPropValue.Name == "IsNative") { bool aValue = true; -aOldValue = aPropValues[i].Value; +aOldValue = rPropValue.Value; aOldValue >>= aValue; OString aMsgGet = "Unable to get PropertyValue " - + OUStringToOString(aPropValues[i].Name, RTL_TEXTENCODING_UTF8); + + OUStringToOString(rPropValue.Name, RTL_TEXTENCODING_UTF8); CPPUNIT_ASSERT_MESSAGE(aMsgGet.getStr(), !aValue); aNewValue <<= true; -aPropValues[i].Value = aNewValue; +rPropValue.Value = aNewValue; -aOldValue = aPropValues[i].Value; +aOldValue = rPropValue.Value; aOldValue >>= aValue; OString aMsgSet = "Unable to set PropertyValue " - + OUStringToOString(aPropValues[i].Name, RTL_TEXTENCODING_UTF8); + + OUStringToOString(rPropValue.Name, RTL_TEXTENCODING_UTF8); CPPUNIT_ASSERT_MESSAGE(aMsgSet.getStr(), aValue); } -else if (aPropValues[i].Name == "SourceType") +else if (rPropValue.Name == "SourceType") { sheet::DataImportMode aValue; -aOldValue = aPropValues[i].Value; +aOldValue = rPropValue.Value;
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/awt/animatedimagespeer.cxx |4 toolkit/source/awt/vclxtoolkit.cxx| 24 +--- toolkit/source/awt/vclxwindow1.cxx| 12 -- toolkit/source/awt/vclxwindows.cxx| 22 +-- toolkit/source/controls/controlmodelcontainerbase.cxx | 91 ++- toolkit/source/controls/dialogcontrol.cxx | 11 - toolkit/source/controls/geometrycontrolmodel.cxx | 24 +--- toolkit/source/controls/grid/defaultgriddatamodel.cxx | 18 +-- toolkit/source/controls/stdtabcontroller.cxx | 108 -- toolkit/source/controls/stdtabcontrollermodel.cxx | 10 - toolkit/source/controls/tabpagecontainer.cxx |6 - toolkit/source/controls/tabpagemodel.cxx | 10 - toolkit/source/controls/unocontrol.cxx| 32 ++--- toolkit/source/controls/unocontrolcontainer.cxx | 32 ++--- toolkit/source/controls/unocontrolmodel.cxx | 44 +++ toolkit/source/controls/unocontrols.cxx | 53 ++-- toolkit/source/helper/formpdfexport.cxx |9 - toolkit/source/helper/unopropertyarrayhelper.cxx |6 - toolkit/source/helper/vclunohelper.cxx|5 19 files changed, 214 insertions(+), 307 deletions(-) New commits: commit 172a5e3306edbef3d40d9850c446dba00b7ada06 Author: Arkadiy Illarionov AuthorDate: Sun Jun 30 13:39:03 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Sun Jun 30 17:17:49 2019 +0200 Simplify Sequence iterations in toolkit Use range-based loops or replace with STL functions Change-Id: I8129ca201dd7017fc4064b04834f41d69cc01274 Reviewed-on: https://gerrit.libreoffice.org/74926 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/toolkit/source/awt/animatedimagespeer.cxx b/toolkit/source/awt/animatedimagespeer.cxx index 4d1be4be96e7..5277841af3e6 100644 --- a/toolkit/source/awt/animatedimagespeer.cxx +++ b/toolkit/source/awt/animatedimagespeer.cxx @@ -169,9 +169,9 @@ namespace toolkit o_images.resize(0); size_t count = size_t( i_imageURLs.getLength() ); o_images.reserve( count ); -for ( size_t i = 0; i < count; ++i ) +for ( const auto& rImageURL : i_imageURLs ) { -o_images.emplace_back( i_imageURLs[i] ); +o_images.emplace_back( rImageURL ); } } diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index 904f95fd5e38..42c135c7b889 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -1413,14 +1413,12 @@ vcl::Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp, css::uno::Sequence< css::beans::NamedValue > aProps; if( anyHandle >>= aProps ) { -const int nProps = aProps.getLength(); -const css::beans::NamedValue* pProps = aProps.getConstArray(); -for( int i = 0; i < nProps; i++ ) +for( const css::beans::NamedValue& rProp : aProps ) { -if ( pProps[i].Name == "WINDOW" ) -pProps[i].Value >>= nWindowHandle; -else if ( pProps[i].Name == "XEMBED" ) -pProps[i].Value >>= bXEmbed; +if ( rProp.Name == "WINDOW" ) +rProp.Value >>= nWindowHandle; +else if ( rProp.Name == "XEMBED" ) +rProp.Value >>= bXEmbed; } } else @@ -1645,14 +1643,12 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::createSystemChild( con css::uno::Sequence< css::beans::NamedValue > aProps; if( Parent >>= aProps ) { -const int nProps = aProps.getLength(); -const css::beans::NamedValue* pProps = aProps.getConstArray(); -for( int i = 0; i < nProps; i++ ) +for( const css::beans::NamedValue& rProp : aProps ) { -if ( pProps[i].Name == "WINDOW" ) -pProps[i].Value >>= nWindowHandle; -else if ( pProps[i].Name == "XEMBED" ) -pProps[i].Value >>= bXEmbed; +if ( rProp.Name == "WINDOW" ) +rProp.Value >>= nWindowHandle; +
[Libreoffice-commits] core.git: ucb/source
ucb/source/cacher/dynamicresultsetwrapper.cxx|6 ucb/source/core/FileAccess.cxx | 12 - ucb/source/core/ucb.cxx | 17 - ucb/source/core/ucbcmds.cxx | 198 +-- ucb/source/core/ucbprops.cxx | 14 - ucb/source/core/ucbstore.cxx | 15 - ucb/source/sorter/sortdynres.cxx |3 ucb/source/ucp/cmis/cmis_content.cxx | 75 +++- ucb/source/ucp/cmis/cmis_repo_content.cxx| 10 - ucb/source/ucp/ext/ucpext_content.cxx| 15 - ucb/source/ucp/file/bc.cxx | 26 +-- ucb/source/ucp/file/filcmd.cxx | 28 +-- ucb/source/ucp/file/filnot.cxx | 23 +- ucb/source/ucp/file/filprp.cxx | 13 - ucb/source/ucp/file/filrset.cxx | 30 +-- ucb/source/ucp/file/filtask.cxx | 78 - ucb/source/ucp/file/prov.cxx | 13 - ucb/source/ucp/ftp/ftpcontent.cxx| 45 ++--- ucb/source/ucp/ftp/ftpresultsetI.cxx | 22 +- ucb/source/ucp/ftp/ftpresultsetbase.cxx | 13 - ucb/source/ucp/gio/gio_content.cxx | 10 - ucb/source/ucp/hierarchy/hierarchycontent.cxx| 19 -- ucb/source/ucp/package/pkgcontent.cxx| 17 - ucb/source/ucp/tdoc/tdoc_content.cxx | 17 - ucb/source/ucp/webdav-neon/ContentProperties.cxx | 15 - ucb/source/ucp/webdav-neon/DAVResourceAccess.cxx |6 ucb/source/ucp/webdav-neon/LinkSequence.cxx | 19 -- ucb/source/ucp/webdav-neon/NeonSession.cxx | 22 -- ucb/source/ucp/webdav-neon/webdavcontent.cxx | 53 ++ 29 files changed, 326 insertions(+), 508 deletions(-) New commits: commit 02872ceafb8adca47cce856d0e44107494ba2e21 Author: Arkadiy Illarionov AuthorDate: Sat Jun 29 22:24:22 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Sun Jun 30 12:40:20 2019 +0200 Simplify Sequence iterations in ucb Use range-based loops or replace with STL functions Change-Id: I755dec47aeeed879a032eecd50dee585c392ec59 Reviewed-on: https://gerrit.libreoffice.org/74915 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/ucb/source/cacher/dynamicresultsetwrapper.cxx b/ucb/source/cacher/dynamicresultsetwrapper.cxx index fc6d0dbf90de..042a63c57c55 100644 --- a/ucb/source/cacher/dynamicresultsetwrapper.cxx +++ b/ucb/source/cacher/dynamicresultsetwrapper.cxx @@ -223,9 +223,11 @@ void DynamicResultSetWrapper::impl_notify( const ListEvent& Changes ) { osl::Guard< osl::Mutex > aGuard( m_aMutex ); -for( long i=0; !m_bGotWelcome && i aInfo = aCnt.queryCreatableContentsInfo(); -sal_Int32 nCount = aInfo.getLength(); -if ( nCount == 0 ) -return; -for ( sal_Int32 i = 0; i < nCount; ++i ) +for ( const ContentInfo & rCurr : aInfo ) { // Simply look for the first KIND_FOLDER... -const ContentInfo & rCurr = aInfo[i]; if ( rCurr.Attributes & ContentInfoAttribute::KIND_FOLDER ) { // Make sure the only required bootstrap property is "Title", @@ -591,13 +587,9 @@ bool OFileAccess::createNewFile( const OUString & rParentURL, ucbhelper::Content aParentCnt( rParentURL, mxEnvironment.get(), comphelper::getProcessComponentContext() ); Sequence< ContentInfo > aInfo = aParentCnt.queryCreatableContentsInfo(); -sal_Int32 nCount = aInfo.getLength(); -if ( nCount == 0 ) -return false; -for ( sal_Int32 i = 0; i < nCount; ++i ) +for ( const ContentInfo & rCurr : aInfo ) { -const ContentInfo & rCurr = aInfo[i]; if ( ( rCurr.Attributes & ContentInfoAttribute::KIND_DOCUMENT ) && ( rCurr.Attributes diff --git a/ucb/source/core/ucb.cxx b/ucb/source/core/ucb.cxx index 907cef806449..1246d6483051 100644 --- a/ucb/source/core/ucb.cxx +++ b/ucb/source/core/ucb.cxx @@ -710,21 +710,16 @@ void SAL_CALL UniversalContentBroker::abort( sal_Int32 ) // virtual void SAL_CALL UniversalContentBroker::changesOccurred( const util::ChangesEvent& Event ) { -sal_Int32 nCount = Event.Changes.getLength(); -if ( nCount ) +if ( Event.Changes.hasElements() ) { uno::Reference< container::XHierarchicalNameAccess > xHierNameAccess; Event.Base >>= xHierNameAccess; OSL_ASSERT( xHierNameAccess.is() ); -const util::ElementChange* pElementChanges -= Event.Changes.getConstArray(); - ContentProviderDataList aData; -for ( sal_Int32 n = 0; n < nCount; ++n ) +for ( const util::ElementChange& rElem : Event.Changes ) { -const util::ElementChange& rElem = pElementChanges[ n ]; OUString aKey; rElem.Accessor >>= aKey; @@ -870,16 +865,14 @@ bool
[Libreoffice-commits] core.git: ucb/source
ucb/source/ucp/file/filrow.cxx | 118 +++-- ucb/source/ucp/file/filrow.hxx |4 + 2 files changed, 48 insertions(+), 74 deletions(-) New commits: commit 639698862d16310b60514277d59227eec37eb02a Author: Arkadiy Illarionov AuthorDate: Sat Jun 29 16:44:52 2019 +0300 Commit: Noel Grandin CommitDate: Sun Jun 30 11:46:28 2019 +0200 tdf#39593 Reduce copy-paste in XRow_impl::get* Add isIndexOutOfBounds and template getValue methods Change-Id: I2eab7a86329b68d659b4780be50826da42c631aa Reviewed-on: https://gerrit.libreoffice.org/74885 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/ucb/source/ucp/file/filrow.cxx b/ucb/source/ucp/file/filrow.cxx index a6156823bbf0..67845ea426d7 100644 --- a/ucb/source/ucp/file/filrow.cxx +++ b/ucb/source/ucp/file/filrow.cxx @@ -101,19 +101,16 @@ OUString SAL_CALL XRow_impl::getString( sal_Int32 columnIndex ) { - if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() ) + if( isIndexOutOfBounds( columnIndex ) ) throw sdbc::SQLException( THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() ); - OUString Value; - osl::MutexGuard aGuard( m_aMutex ); - m_nWasNull = ::convert( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value ); - return Value; + return getValue(columnIndex); } sal_Bool SAL_CALL XRow_impl::getBoolean( sal_Int32 columnIndex ) { -if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() ) +if( isIndexOutOfBounds( columnIndex ) ) throw sdbc::SQLException( THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() ); bool Value( false ); osl::MutexGuard aGuard( m_aMutex ); @@ -126,7 +123,7 @@ sal_Int8 SAL_CALL XRow_impl::getByte( sal_Int32 columnIndex ) { -if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() ) +if( isIndexOutOfBounds( columnIndex ) ) throw sdbc::SQLException( THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() ); sal_Int8 Value( 0 ); osl::MutexGuard aGuard( m_aMutex ); @@ -138,7 +135,7 @@ sal_Int16 SAL_CALL XRow_impl::getShort( sal_Int32 columnIndex ) { -if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() ) +if( isIndexOutOfBounds( columnIndex ) ) throw sdbc::SQLException( THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() ); sal_Int16 Value( 0 ); osl::MutexGuard aGuard( m_aMutex ); @@ -151,7 +148,7 @@ sal_Int32 SAL_CALL XRow_impl::getInt( sal_Int32 columnIndex ) { -if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() ) +if( isIndexOutOfBounds( columnIndex ) ) throw sdbc::SQLException( THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() ); sal_Int32 Value( 0 ); osl::MutexGuard aGuard( m_aMutex ); @@ -163,7 +160,7 @@ sal_Int64 SAL_CALL XRow_impl::getLong( sal_Int32 columnIndex ) { -if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() ) +if( isIndexOutOfBounds( columnIndex ) ) throw sdbc::SQLException( THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() ); sal_Int64 Value( 0 ); osl::MutexGuard aGuard( m_aMutex ); @@ -175,7 +172,7 @@ float SAL_CALL XRow_impl::getFloat( sal_Int32 columnIndex ) { -if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() ) +if( isIndexOutOfBounds( columnIndex ) ) throw sdbc::SQLException( THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() ); float Value( 0 ); osl::MutexGuard aGuard( m_aMutex ); @@ -187,7 +184,7 @@ double SAL_CALL XRow_impl::getDouble( sal_Int32 columnIndex ) { -if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() ) +if( isIndexOutOfBounds( columnIndex ) ) throw sdbc::SQLException( THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() ); double Value( 0 ); osl::MutexGuard aGuard( m_aMutex ); @@ -199,48 +196,36 @@ uno::Sequence< sal_Int8 > SAL_CALL XRow_impl::getBytes( sal_Int32 columnIndex ) { -if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() ) +if( isIndexOutOfBounds( columnIndex ) ) throw sdbc::SQLException( THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() ); -uno::Sequence< sal_Int8 > Value(0); -osl::MutexGuard aGuard( m_aMutex ); -m_nWasNull = ::convert >( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value ); -return Value; +return getValue>(columnIndex); } util::Date SAL_CALL XRow_impl::getDate( sal_Int32 columnIndex ) { -if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() ) +if( isIndexOutOfBounds( columnIndex ) ) throw sdbc::SQLException( THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() ); -util::Date Value;
[Libreoffice-commits] core.git: ucb/source
ucb/source/ucp/file/filtask.cxx | 145 +++- ucb/source/ucp/file/filtask.hxx |3 2 files changed, 73 insertions(+), 75 deletions(-) New commits: commit 894880f40889b8f03dff8bb3d6f48b7a473d89b7 Author: Arkadiy Illarionov AuthorDate: Sat Jun 29 14:47:35 2019 +0300 Commit: Noel Grandin CommitDate: Sat Jun 29 20:09:45 2019 +0200 Flatten TaskManager::erasePersistentSet and TaskManager::copyPersistentSet Explicitly do operations without children Change-Id: Ice1d9562f6b40620c53c398bc6cc707e11be8f96 Reviewed-on: https://gerrit.libreoffice.org/74876 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/ucb/source/ucp/file/filtask.cxx b/ucb/source/ucp/file/filtask.cxx index 5a81536bdf38..656d84ca4e67 100644 --- a/ucb/source/ucp/file/filtask.cxx +++ b/ucb/source/ucp/file/filtask.cxx @@ -2788,6 +2788,26 @@ void TaskManager::notifyPropertyChanges( // void +TaskManager::erasePersistentSetWithoutChildren( const OUString& aUnqPath ) +{ +{ +// Release possible references +osl::MutexGuard aGuard( m_aMutex ); +ContentMap::iterator it = m_aContent.find( aUnqPath ); +if( it != m_aContent.end() ) +{ +it->second.xS = nullptr; +it->second.xC = nullptr; +it->second.xA = nullptr; + +it->second.properties.clear(); +} +} + +m_xFileRegistry->removePropertySet( aUnqPath ); +} + +void TaskManager::erasePersistentSet( const OUString& aUnqPath, bool withChildren ) { @@ -2797,45 +2817,25 @@ TaskManager::erasePersistentSet( const OUString& aUnqPath, return; } -uno::Sequence< OUString > seqNames; - -if( withChildren ) +if( ! withChildren ) { -uno::Reference< container::XNameAccess > xName( m_xFileRegistry,uno::UNO_QUERY ); -seqNames = xName->getElementNames(); +erasePersistentSetWithoutChildren(aUnqPath); +return; } -sal_Int32 count = withChildren ? seqNames.getLength() : 1; +uno::Reference< container::XNameAccess > xName( m_xFileRegistry,uno::UNO_QUERY ); +uno::Sequence< OUString > seqNames = xName->getElementNames(); -OUString -old_Name = aUnqPath; +OUString old_Name = aUnqPath; -for( sal_Int32 j = 0; j < count; ++j ) +for( const auto& rName : seqNames ) { -if( withChildren && ! ( isChild( old_Name,seqNames[j] ) ) ) +if( ! ( isChild( old_Name,rName ) ) ) continue; -if( withChildren ) -{ -old_Name = seqNames[j]; -} - -{ -// Release possible references -osl::MutexGuard aGuard( m_aMutex ); -ContentMap::iterator it = m_aContent.find( old_Name ); -if( it != m_aContent.end() ) -{ -it->second.xS = nullptr; -it->second.xC = nullptr; -it->second.xA = nullptr; +old_Name = rName; -it->second.properties.clear(); -} -} - -if( m_xFileRegistry.is() ) -m_xFileRegistry->removePropertySet( old_Name ); +erasePersistentSetWithoutChildren(old_Name); } } @@ -2845,6 +2845,35 @@ TaskManager::erasePersistentSet( const OUString& aUnqPath, /* from srcUnqPath to dstUnqPath */ // +void +TaskManager::copyPersistentSetWithoutChildren( const OUString& srcUnqPath, + const OUString& dstUnqPath ) +{ +uno::Reference< XPersistentPropertySet > x_src = +m_xFileRegistry->openPropertySet( srcUnqPath,false ); +m_xFileRegistry->removePropertySet( dstUnqPath ); + +if( ! x_src.is() ) +return; + +uno::Sequence< beans::Property > seqProperty = +x_src->getPropertySetInfo()->getProperties(); + +if( ! seqProperty.hasElements() ) +return; + +uno::Reference< XPersistentPropertySet > +x_dstS = m_xFileRegistry->openPropertySet( dstUnqPath,true ); +uno::Reference< beans::XPropertyContainer > +x_dstC( x_dstS,uno::UNO_QUERY ); + +for( const auto& rProperty : seqProperty ) +{ +x_dstC->addProperty( rProperty.Name, + rProperty.Attributes, + x_src->getPropertyValue( rProperty.Name ) ); +} +} void TaskManager::copyPersistentSet( const OUString& srcUnqPath, @@ -2857,60 +2886,26 @@ TaskManager::copyPersistentSet( const OUString& srcUnqPath, return; } -uno::Sequence< OUString > seqNames; - -if( withChildren ) +if( ! withChildren ) { -uno::Reference< container::XNameAccess > xName( m_xFileRegistry,uno::UNO_QUERY ); -seqNames =
[Libreoffice-commits] core.git: ucb/source
ucb/source/ucp/file/filnot.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit b8cb558c4e36c8aaa6af6dd0a90046641d5b8d56 Author: Arkadiy Illarionov AuthorDate: Sat Jun 29 16:59:40 2019 +0300 Commit: Noel Grandin CommitDate: Sat Jun 29 20:09:04 2019 +0200 Use proper index in loop body Change-Id: I80bc0d8f23ad436c9f1d1b1501bbcba6f3cb29ff Reviewed-on: https://gerrit.libreoffice.org/74890 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/ucb/source/ucp/file/filnot.cxx b/ucb/source/ucp/file/filnot.cxx index c63dae89dcf6..ae659c4bceb3 100644 --- a/ucb/source/ucp/file/filnot.cxx +++ b/ucb/source/ucp/file/filnot.cxx @@ -238,7 +238,7 @@ void PropertyChangeNotifier::notifyPropertyChanged( for( sal_Int32 i = 0; i < seqList.getLength(); ++i ) { -uno::Reference< beans::XPropertiesChangeListener > aListener( seqList[j],uno::UNO_QUERY ); +uno::Reference< beans::XPropertiesChangeListener > aListener( seqList[i],uno::UNO_QUERY ); if( aListener.is() ) { aListener->propertiesChange( seq ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: ucbhelper/source
ucbhelper/source/provider/providerhelper.cxx | 208 --- 1 file changed, 97 insertions(+), 111 deletions(-) New commits: commit 195b11b4eed1cabc6090b926901bd17c8c8c9dbd Author: Arkadiy Illarionov AuthorDate: Sat Jun 29 13:19:51 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Sat Jun 29 13:22:10 2019 +0200 Flatten ContentProviderImplHelper Change-Id: I0461ccfb2d9a9750b91863d9dee29cc5515201dc Reviewed-on: https://gerrit.libreoffice.org/74868 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/ucbhelper/source/provider/providerhelper.cxx b/ucbhelper/source/provider/providerhelper.cxx index e4b6d4dab704..52935962f9be 100644 --- a/ucbhelper/source/provider/providerhelper.cxx +++ b/ucbhelper/source/provider/providerhelper.cxx @@ -280,47 +280,43 @@ bool ContentProviderImplHelper::renameAdditionalPropertySet( // Get propertyset registry. getAdditionalPropertySetRegistry(); -if ( m_pImpl->m_xPropertySetRegistry.is() ) +if ( !m_pImpl->m_xPropertySetRegistry.is() ) +return false; + +uno::Reference< container::XNameAccess > xNameAccess( +m_pImpl->m_xPropertySetRegistry, uno::UNO_QUERY ); +if ( !xNameAccess.is() ) +return false; + +uno::Sequence< OUString > aKeys += xNameAccess->getElementNames(); +if ( aKeys.hasElements() ) { -uno::Reference< container::XNameAccess > xNameAccess( -m_pImpl->m_xPropertySetRegistry, uno::UNO_QUERY ); -if ( xNameAccess.is() ) +OUString aOldKeyWithSlash = rOldKey; +OUString aOldKeyWithoutSlash; +if ( !aOldKeyWithSlash.endsWith("/") ) { -uno::Sequence< OUString > aKeys -= xNameAccess->getElementNames(); -if ( aKeys.hasElements() ) +aOldKeyWithSlash += "/"; +aOldKeyWithoutSlash = rOldKey; +} +else if ( !rOldKey.isEmpty() ) +aOldKeyWithoutSlash += rOldKey.copy( 0, rOldKey.getLength() - 1 ); + +for ( const OUString& rKey : aKeys ) +{ +if ( rKey.startsWith( aOldKeyWithSlash ) + || rKey == aOldKeyWithoutSlash ) { -OUString aOldKeyWithSlash = rOldKey; -OUString aOldKeyWithoutSlash; -if ( !aOldKeyWithSlash.endsWith("/") ) -{ -aOldKeyWithSlash += "/"; -aOldKeyWithoutSlash = rOldKey; -} -else if ( !rOldKey.isEmpty() ) -aOldKeyWithoutSlash -= rOldKey.copy( 0, rOldKey.getLength() - 1 ); - -for ( const OUString& rKey : aKeys ) -{ -if ( rKey.startsWith( aOldKeyWithSlash ) - || rKey == aOldKeyWithoutSlash ) -{ -OUString aNewKey -= rKey.replaceAt( -0, rOldKey.getLength(), rNewKey ); -if ( !renameAdditionalPropertySet( -rKey, aNewKey, false ) ) -return false; -} -} +OUString aNewKey += rKey.replaceAt( +0, rOldKey.getLength(), rNewKey ); +if ( !renameAdditionalPropertySet( +rKey, aNewKey, false ) ) +return false; } } -else -return false; } -else -return false; } else { @@ -332,13 +328,11 @@ bool ContentProviderImplHelper::renameAdditionalPropertySet( // Rename property set. uno::Reference< container::XNamed > xNamed( xOldSet, uno::UNO_QUERY ); -if ( xNamed.is() ) -{ -// ??? throws no exceptions and has no return value ??? -xNamed->setName( rNewKey ); -} -else +if ( !xNamed.is() ) return false; + +// ??? throws no exceptions and has no return value ??? +xNamed->setName( rNewKey ); } } return true; @@ -359,47 +353,43 @@ bool ContentProviderImplHelper::copyAdditionalPropertySet( // Get propertyset registry. getAdditionalPropertySetRegistry(); -if ( m_pImpl->m_xPropertySetRegistry.is() ) +if ( !m_pImpl->m_xPropertySetRegistry.is() ) +return false; + +uno::Reference< container::XNameAccess > xNameAccess( +m_pImpl->m_xPropertySetRegistry,
[Libreoffice-commits] core.git: ucbhelper/source
ucbhelper/source/client/interceptedinteraction.cxx | 18 +- ucbhelper/source/client/proxydecider.cxx | 129 + ucbhelper/source/provider/contenthelper.cxx| 21 --- ucbhelper/source/provider/contentinfo.cxx |8 - ucbhelper/source/provider/propertyvalueset.cxx | 28 +--- ucbhelper/source/provider/providerhelper.cxx | 40 +- ucbhelper/source/provider/resultsetmetadata.cxx| 21 --- 7 files changed, 100 insertions(+), 165 deletions(-) New commits: commit e1c62463433824c3bdfb3245a19366881544afb9 Author: Arkadiy Illarionov AuthorDate: Fri Jun 28 01:35:35 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Fri Jun 28 17:37:54 2019 +0200 Simplify Sequence iterations in ucbhelper Use range-based loops or replace with STL functions Change-Id: I4e9f5ae006ecbc7513db7574e0f8e08c6940cdb7 Reviewed-on: https://gerrit.libreoffice.org/74828 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/ucbhelper/source/client/interceptedinteraction.cxx b/ucbhelper/source/client/interceptedinteraction.cxx index afc2f3bf9576..682732958aee 100644 --- a/ucbhelper/source/client/interceptedinteraction.cxx +++ b/ucbhelper/source/client/interceptedinteraction.cxx @@ -48,17 +48,13 @@ InterceptedInteraction::EInterceptionState InterceptedInteraction::intercepted( css::uno::Reference< css::task::XInteractionContinuation > InterceptedInteraction::extractContinuation(const css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > >& lContinuations, const css::uno::Type& aType ) { -const css::uno::Reference< css::task::XInteractionContinuation >* pContinuations = lContinuations.getConstArray(); - -sal_Int32 c = lContinuations.getLength(); -sal_Int32 i = 0; - -for (i=0; i xCheck(pContinuations[i], css::uno::UNO_QUERY); -if (xCheck->queryInterface(aType).hasValue()) -return pContinuations[i]; -} +const css::uno::Reference< css::task::XInteractionContinuation >* pContinuations = std::find_if(lContinuations.begin(), lContinuations.end(), +[](const css::uno::Reference< css::task::XInteractionContinuation >& rContinuation) { +css::uno::Reference< css::uno::XInterface > xCheck(rContinuation, css::uno::UNO_QUERY); +return xCheck->queryInterface(aType).hasValue(); +}); +if (pContinuations != lContinuations.end()) +return *pContinuations; return css::uno::Reference< css::task::XInteractionContinuation >(); } diff --git a/ucbhelper/source/client/proxydecider.cxx b/ucbhelper/source/client/proxydecider.cxx index 0e290006e94a..e80fa5b708f6 100644 --- a/ucbhelper/source/client/proxydecider.cxx +++ b/ucbhelper/source/client/proxydecider.cxx @@ -707,92 +707,85 @@ void SAL_CALL InternetProxyDecider_Impl::changesOccurred( { osl::Guard< osl::Mutex > aGuard( m_aMutex ); -sal_Int32 nCount = Event.Changes.getLength(); -if ( nCount ) +for ( const util::ElementChange& rElem : Event.Changes ) { -const util::ElementChange* pElementChanges -= Event.Changes.getConstArray(); -for ( sal_Int32 n = 0; n < nCount; ++n ) +OUString aKey; +if ( ( rElem.Accessor >>= aKey ) && !aKey.isEmpty() ) { -const util::ElementChange& rElem = pElementChanges[ n ]; -OUString aKey; -if ( ( rElem.Accessor >>= aKey ) && !aKey.isEmpty() ) +if ( aKey == PROXY_TYPE_KEY ) { -if ( aKey == PROXY_TYPE_KEY ) +sal_Int32 tmp; +if ( !( rElem.Element >>= tmp ) ) { -sal_Int32 tmp; -if ( !( rElem.Element >>= tmp ) ) -{ -OSL_FAIL( "InternetProxyDecider - changesOccurred - " -"Error getting config item value!" ); -} -else -m_nProxyType = static_cast(tmp); +OSL_FAIL( "InternetProxyDecider - changesOccurred - " +"Error getting config item value!" ); } -else if ( aKey == NO_PROXY_LIST_KEY ) +else +m_nProxyType = static_cast(tmp); +} +else if ( aKey == NO_PROXY_LIST_KEY ) +{ +OUString aNoProxyList; +if ( !( rElem.Element >>= aNoProxyList ) ) { -OUString aNoProxyList; -if ( !( rElem.Element >>= aNoProxyList ) ) -{ -OSL_FAIL( "InternetProxyDecider - changesOccurred - " -"Error
[Libreoffice-commits] core.git: unotools/source
unotools/source/config/cmdoptions.cxx |8 - unotools/source/config/compatibility.cxx | 10 - unotools/source/config/configitem.cxx | 125 +++--- unotools/source/config/confignode.cxx |5 unotools/source/config/dynamicmenuoptions.cxx |3 unotools/source/config/eventcfg.cxx | 17 +- unotools/source/config/fontcfg.cxx| 25 +--- unotools/source/config/historyoptions.cxx |9 - unotools/source/config/lingucfg.cxx | 21 +-- unotools/source/config/moduleoptions.cxx | 54 +++-- unotools/source/config/optionsdlg.cxx | 14 -- unotools/source/config/pathoptions.cxx|3 unotools/source/config/securityoptions.cxx| 24 +--- unotools/source/config/viewoptions.cxx| 21 +-- unotools/source/i18n/localedatawrapper.cxx| 90 +-- unotools/source/ucbhelper/progresshandlerwrap.cxx |8 - unotools/source/ucbhelper/ucbhelper.cxx |8 - unotools/source/ucbhelper/ucblockbytes.cxx|9 - 18 files changed, 172 insertions(+), 282 deletions(-) New commits: commit 1e084caf573255a93ce86053d584976f317074df Author: Arkadiy Illarionov AuthorDate: Thu Jun 27 23:29:01 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Fri Jun 28 17:33:40 2019 +0200 Simplify Sequence iterations in unotools Use range-based loops or replace with STL functions Change-Id: I220c5cd5dcc19fc35e1ad729ae69246f4a79ce2d Reviewed-on: https://gerrit.libreoffice.org/74825 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/unotools/source/config/cmdoptions.cxx b/unotools/source/config/cmdoptions.cxx index 2c8f18e76aea..56b61ad2704a 100644 --- a/unotools/source/config/cmdoptions.cxx +++ b/unotools/source/config/cmdoptions.cxx @@ -277,11 +277,9 @@ Sequence< OUString > SvtCommandOptions_Impl::impl_GetPropertyNames() Sequence< OUString > lDisabledItems = GetNodeNames( SETNODE_DISABLED, utl::ConfigNameFormat::LocalPath ); // Expand all keys -for (sal_Int32 i=0; i OUString { +return SETNODE_DISABLED PATHDELIMITER + rItem + PATHDELIMITER PROPERTYNAME_CMD; }); // Return result. return lDisabledItems; diff --git a/unotools/source/config/compatibility.cxx b/unotools/source/config/compatibility.cxx index a1523d3aae41..f0d211de6957 100644 --- a/unotools/source/config/compatibility.cxx +++ b/unotools/source/config/compatibility.cxx @@ -159,7 +159,6 @@ SvtCompatibilityOptions_Impl::SvtCompatibilityOptions_Impl() : ConfigItem( ROOTN // See impl_GetPropertyNames() for further information. Sequence< OUString > lNodes; Sequence< OUString > lNames = impl_GetPropertyNames( lNodes ); -sal_uInt32 nCount = lNodes.getLength(); Sequence< Any > lValues = GetProperties( lNames ); // Safe impossible cases. @@ -171,11 +170,11 @@ SvtCompatibilityOptions_Impl::SvtCompatibilityOptions_Impl() : ConfigItem( ROOTN // 4 subkeys for every item! bool bDefaultFound = false; sal_Int32 nDestStep= 0; -for ( sal_uInt32 nItem = 0; nItem < nCount; ++nItem ) +for ( const auto& rNode : lNodes ) { SvtCompatibilityEntry aItem; -aItem.setValue( SvtCompatibilityEntry::Index::Name, lNodes[ nItem ] ); +aItem.setValue( SvtCompatibilityEntry::Index::Name, rNode ); for ( int i = static_cast(SvtCompatibilityEntry::Index::Module); i < static_cast(SvtCompatibilityEntry::Index::INVALID); ++i ) { @@ -292,14 +291,13 @@ Sequence< OUString > SvtCompatibilityOptions_Impl::impl_GetPropertyNames( Sequen // expand list to result list ... Sequence< OUString > lProperties( rItems.getLength() * ( SvtCompatibilityEntry::getElementCount() - 1 ) ); -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 ) +for ( const auto& rItem : rItems ) { OUString sFixPath = SETNODE_ALLFILEFORMATS; sFixPath += PATHDELIMITER; -sFixPath += rItems[ nSourceStep ]; +sFixPath += rItem; sFixPath += PATHDELIMITER; for ( int i = static_cast(SvtCompatibilityEntry::Index::Module); i < static_cast(SvtCompatibilityEntry::Index::INVALID); ++i ) { diff --git a/unotools/source/config/configitem.cxx b/unotools/source/config/configitem.cxx index 6f5e99940703..4af2eb3bc977 100644 --- a/unotools/source/config/configitem.cxx +++ b/unotools/source/config/configitem.cxx @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -98,34 +99,21 @@ ConfigChangeListener_Impl::ConfigChangeListener_Impl( { } -static bool lcl_Find( -const OUString& rTemp, -
[Libreoffice-commits] core.git: unoxml/qa unoxml/source
unoxml/qa/unit/domtest.cxx |2 +- unoxml/source/dom/document.cxx | 24 +--- unoxml/source/dom/saxbuilder.cxx|9 - unoxml/source/rdf/librdf_repository.cxx | 10 -- 4 files changed, 18 insertions(+), 27 deletions(-) New commits: commit 9a2fbfa3cc1da8bd9388d5b4c780e86f0dccc791 Author: Arkadiy Illarionov AuthorDate: Sun Jun 23 16:10:50 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Tue Jun 25 21:42:40 2019 +0200 Simplify Sequence iterations in unoxml Use range-based loops or replace with STL functions Change-Id: Ib1c49834a2c5c67a73ec05ba8f30c1d39a5c019c Reviewed-on: https://gerrit.libreoffice.org/74600 Reviewed-by: Michael Stahl Tested-by: Jenkins diff --git a/unoxml/qa/unit/domtest.cxx b/unoxml/qa/unit/domtest.cxx index 15e337772314..0a80d2a4cadc 100644 --- a/unoxml/qa/unit/domtest.cxx +++ b/unoxml/qa/unit/domtest.cxx @@ -181,7 +181,7 @@ struct TokenHandler { virtual ::sal_Int32 SAL_CALL getTokenFromUTF8( const uno::Sequence< ::sal_Int8 >& Identifier ) override { -return Identifier.getLength() ? Identifier[0] : 0; +return Identifier.hasElements() ? Identifier[0] : 0; } virtual uno::Sequence< ::sal_Int8 > SAL_CALL getUTF8Identifier( ::sal_Int32 ) override diff --git a/unoxml/source/dom/document.cxx b/unoxml/source/dom/document.cxx index 94dce24255ac..fc89b8aa4980 100644 --- a/unoxml/source/dom/document.cxx +++ b/unoxml/source/dom/document.cxx @@ -965,12 +965,10 @@ namespace DOM // add new namespaces to root node xmlNodePtr const pRoot = lcl_getDocumentRootPtr(m_aDocPtr); if (nullptr != pRoot) { -const beans::StringPair * pSeq = i_rNamespaces.getConstArray(); -for (const beans::StringPair *pNsDef = pSeq; - pNsDef < pSeq + i_rNamespaces.getLength(); ++pNsDef) { -OString prefix = OUStringToOString(pNsDef->First, +for (const beans::StringPair& rNsDef : i_rNamespaces) { +OString prefix = OUStringToOString(rNsDef.First, RTL_TEXTENCODING_UTF8); -OString href = OUStringToOString(pNsDef->Second, +OString href = OUStringToOString(rNsDef.Second, RTL_TEXTENCODING_UTF8); // this will only add the ns if it does not exist already xmlNewNs(pRoot, reinterpret_cast(href.getStr()), @@ -993,12 +991,10 @@ namespace DOM // add new namespaces to root node xmlNodePtr const pRoot = lcl_getDocumentRootPtr(m_aDocPtr); if (nullptr != pRoot) { -const beans::StringPair * pSeq = i_rNamespaces.getConstArray(); -for (const beans::StringPair *pNsDef = pSeq; - pNsDef < pSeq + i_rNamespaces.getLength(); ++pNsDef) { -OString prefix = OUStringToOString(pNsDef->First, +for (const beans::StringPair& rNsDef : i_rNamespaces) { +OString prefix = OUStringToOString(rNsDef.First, RTL_TEXTENCODING_UTF8); -OString href = OUStringToOString(pNsDef->Second, +OString href = OUStringToOString(rNsDef.Second, RTL_TEXTENCODING_UTF8); // this will only add the ns if it does not exist already xmlNewNs(pRoot, reinterpret_cast(href.getStr()), @@ -1012,13 +1008,11 @@ namespace DOM i_xTokenHandler); // register namespace ids -const beans::Pair* pSeq = i_rRegisterNamespaces.getConstArray(); -for (const beans::Pair* pNs = pSeq; - pNs < pSeq + i_rRegisterNamespaces.getLength(); ++pNs) +for (const beans::Pair& rNs : i_rRegisterNamespaces) { -OSL_ENSURE(pNs->Second >= FastToken::NAMESPACE, +OSL_ENSURE(rNs.Second >= FastToken::NAMESPACE, "CDocument::fastSerialize(): invalid NS token id"); -aContext.maNamespaceMap[ pNs->First ] = pNs->Second; +aContext.maNamespaceMap[ rNs.First ] = rNs.Second; } fastSaxify(aContext); diff --git a/unoxml/source/dom/saxbuilder.cxx b/unoxml/source/dom/saxbuilder.cxx index 994a6c0392f6..968971f29d2c 100644 --- a/unoxml/source/dom/saxbuilder.cxx +++ b/unoxml/source/dom/saxbuilder.cxx @@ -254,12 +254,11 @@ namespace DOM { setElementFastAttributes(aElement, xAttribs); Sequence< css::xml::Attribute > unknownAttribs = xAttribs->getUnknownAttributes(); -sal_Int32 len = unknownAttribs.getLength(); -for ( sal_Int32 i = 0; i < len; i++ ) +for ( const auto& rUnknownAttrib : unknownAttribs ) { -const OUString& rAttrValue = unknownAttribs[i].Value; -const OUString& rAttrName = unknownAttribs[i].Name; -
[Libreoffice-commits] core.git: uui/source
uui/source/getcontinuations.hxx | 24 - uui/source/iahndl-authentication.cxx |6 +- uui/source/iahndl-filter.cxx | 86 --- uui/source/iahndl-ssl.cxx| 19 +++ uui/source/iahndl.cxx|8 +-- uui/source/passwordcontainer.cxx |4 - 6 files changed, 68 insertions(+), 79 deletions(-) New commits: commit 75957a96c43b83418d387e9174415b6d90cf9c63 Author: Arkadiy Illarionov AuthorDate: Sun Jun 23 15:42:31 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Tue Jun 25 21:39:40 2019 +0200 Simplify Sequence iterations in uui Use range-based loops or replace with STL functions Change-Id: I36ca6016d23360d121935d9f25e8cc8d2dad08c3 Reviewed-on: https://gerrit.libreoffice.org/74625 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/uui/source/getcontinuations.hxx b/uui/source/getcontinuations.hxx index 8175b002b974..03dc049f45d1 100644 --- a/uui/source/getcontinuations.hxx +++ b/uui/source/getcontinuations.hxx @@ -50,11 +50,11 @@ void getContinuations( css::uno::Reference< t1 > * pContinuation1, css::uno::Reference< t2 > * pContinuation2) { -for (sal_Int32 i = 0; i < rContinuations.getLength(); ++i) +for (const auto& rContinuation : rContinuations) { -if (setContinuation(rContinuations[i], pContinuation1)) +if (setContinuation(rContinuation, pContinuation1)) continue; -if (setContinuation(rContinuations[i], pContinuation2)) +if (setContinuation(rContinuation, pContinuation2)) continue; } } @@ -67,13 +67,13 @@ void getContinuations( css::uno::Reference< t2 > * pContinuation2, css::uno::Reference< t3 > * pContinuation3) { -for (sal_Int32 i = 0; i < rContinuations.getLength(); ++i) +for (const auto& rContinuation : rContinuations) { -if (setContinuation(rContinuations[i], pContinuation1)) +if (setContinuation(rContinuation, pContinuation1)) continue; -if (setContinuation(rContinuations[i], pContinuation2)) +if (setContinuation(rContinuation, pContinuation2)) continue; -if (setContinuation(rContinuations[i], pContinuation3)) +if (setContinuation(rContinuation, pContinuation3)) continue; } } @@ -87,15 +87,15 @@ void getContinuations( css::uno::Reference< t3 > * pContinuation3, css::uno::Reference< t4 > * pContinuation4) { -for (sal_Int32 i = 0; i < rContinuations.getLength(); ++i) +for (const auto& rContinuation : rContinuations) { -if (setContinuation(rContinuations[i], pContinuation1)) +if (setContinuation(rContinuation, pContinuation1)) continue; -if (setContinuation(rContinuations[i], pContinuation2)) +if (setContinuation(rContinuation, pContinuation2)) continue; -if (setContinuation(rContinuations[i], pContinuation3)) +if (setContinuation(rContinuation, pContinuation3)) continue; -if (setContinuation(rContinuations[i], pContinuation4)) +if (setContinuation(rContinuation, pContinuation4)) continue; } } diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx index 114cf8b87563..b6c74f4926db 100644 --- a/uui/source/iahndl-authentication.cxx +++ b/uui/source/iahndl-authentication.cxx @@ -137,9 +137,9 @@ void getRememberModes( bool bHasRememberModeSession = false; bool bHasRememberModePersistent = false; -for (sal_Int32 i = 0; i < nCount; ++i) +for (const auto& rRememberMode : rRememberModes) { -switch ( rRememberModes[i] ) +switch ( rRememberMode ) { case ucb::RememberAuthentication_NO: break; @@ -150,7 +150,7 @@ void getRememberModes( bHasRememberModePersistent = true; break; default: -SAL_WARN( "uui", "Unsupported RememberAuthentication value" << static_cast(rRememberModes[i]) ); +SAL_WARN( "uui", "Unsupported RememberAuthentication value" << static_cast(rRememberMode) ); break; } } diff --git a/uui/source/iahndl-filter.cxx b/uui/source/iahndl-filter.cxx index 64bc7fe7ebc5..a2cdb255a6d9 100644 --- a/uui/source/iahndl-filter.cxx +++ b/uui/source/iahndl-filter.cxx @@ -205,68 +205,62 @@ handleFilterOptionsRequest_( try { OUString aFilterName; -sal_Int32 nPropCount = rRequest.rProperties.getLength(); -for( sal_Int32 ind = 0; ind < nPropCount; ++ind ) +auto pProperty = std::find_if(rRequest.rProperties.begin(), rRequest.rProperties.end(), +[](const beans::PropertyValue& rProp) { return rProp.Name == "FilterName"; }); +if (pProperty != rRequest.rProperties.end())
[Libreoffice-commits] core.git: sw/inc sw/source
sw/inc/unobaseclass.hxx |4 -- sw/source/core/unocore/unobkm.cxx | 15 +++ sw/source/core/unocore/unoftn.cxx | 18 - sw/source/core/unocore/unoidx.cxx | 26 ++- sw/source/core/unocore/unoobj.cxx | 26 +++ sw/source/core/unocore/unoobj2.cxx | 40 ++--- sw/source/core/unocore/unoparagraph.cxx | 26 +++ sw/source/core/unocore/unorefmk.cxx | 43 +--- sw/source/core/unocore/unosect.cxx | 15 +++ sw/source/core/unocore/unotext.cxx | 10 --- 10 files changed, 73 insertions(+), 150 deletions(-) New commits: commit c9a49cdaf0f9e17f0d899b9bc48d1ab51cc1d583 Author: Arkadiy Illarionov AuthorDate: Sun Jun 23 00:10:00 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Mon Jun 24 21:36:32 2019 +0200 Drop sw::GetSupportedServiceNamesImpl Use braced initializer lists and std::transform. Change-Id: I5d1a57d766e39663a55f4921f486210d41fa917d Reviewed-on: https://gerrit.libreoffice.org/74588 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/sw/inc/unobaseclass.hxx b/sw/inc/unobaseclass.hxx index 2d93c7b5a2cf..674901c36a12 100644 --- a/sw/inc/unobaseclass.hxx +++ b/sw/inc/unobaseclass.hxx @@ -124,10 +124,6 @@ namespace sw { return 0; } -css::uno::Sequence< OUString > -GetSupportedServiceNamesImpl( -size_t const nServices, char const*const pServices[]); - } // namespace sw #endif // INCLUDED_SW_INC_UNOBASECLASS_HXX diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx index 0a53c27c4516..80d187be70a9 100644 --- a/sw/source/core/unocore/unobkm.cxx +++ b/sw/source/core/unocore/unobkm.cxx @@ -361,14 +361,6 @@ SwXBookmark::getImplementationName() return OUString("SwXBookmark"); } -static char const*const g_ServicesBookmark[] = -{ -"com.sun.star.text.TextContent", -"com.sun.star.text.Bookmark", -"com.sun.star.document.LinkTarget", -}; -static const size_t g_nServicesBookmark(SAL_N_ELEMENTS(g_ServicesBookmark)); - sal_Bool SAL_CALL SwXBookmark::supportsService(const OUString& rServiceName) { return cppu::supportsService(this, rServiceName); @@ -377,8 +369,11 @@ sal_Bool SAL_CALL SwXBookmark::supportsService(const OUString& rServiceName) uno::Sequence< OUString > SAL_CALL SwXBookmark::getSupportedServiceNames() { -return ::sw::GetSupportedServiceNamesImpl( -g_nServicesBookmark, g_ServicesBookmark); +return { +"com.sun.star.text.TextContent", +"com.sun.star.text.Bookmark", +"com.sun.star.document.LinkTarget" +}; } // MetadatableMixin diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx index 0a8ae616032e..3318bcce85a0 100644 --- a/sw/source/core/unocore/unoftn.cxx +++ b/sw/source/core/unocore/unoftn.cxx @@ -47,6 +47,22 @@ using namespace ::com::sun::star; +namespace { + +uno::Sequence< OUString > +GetSupportedServiceNamesImpl( +size_t const nServices, char const*const pServices[]) +{ +uno::Sequence< OUString > ret(static_cast(nServices)); + +std::transform(pServices, pServices + nServices, ret.begin(), +[](const char* pService) -> OUString { return OUString::createFromAscii(pService); }); + +return ret; +} + +} + class SwXFootnote::Impl : public SvtListener { @@ -199,7 +215,7 @@ uno::Sequence< OUString > SAL_CALL SwXFootnote::getSupportedServiceNames() { SolarMutexGuard g; -return ::sw::GetSupportedServiceNamesImpl( +return GetSupportedServiceNamesImpl( (m_pImpl->m_bIsEndnote) ? g_nServicesEndnote : g_nServicesFootnote, g_ServicesFootnote); } diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index 6ac2e5f33232..f9bae53a53fc 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -2357,11 +2357,6 @@ SwXDocumentIndexes::getImplementationName() return OUString("SwXDocumentIndexes"); } -static char const*const g_ServicesDocumentIndexes[] = -{ -"com.sun.star.text.DocumentIndexes", -}; - sal_Bool SAL_CALL SwXDocumentIndexes::supportsService(const OUString& rServiceName) { return cppu::supportsService(this, rServiceName); @@ -2370,8 +2365,7 @@ sal_Bool SAL_CALL SwXDocumentIndexes::supportsService(const OUString& rServiceNa uno::Sequence< OUString > SAL_CALL SwXDocumentIndexes::getSupportedServiceNames() { -return ::sw::GetSupportedServiceNamesImpl( -SAL_N_ELEMENTS(g_ServicesDocumentIndexes), g_ServicesDocumentIndexes); +return { "com.sun.star.text.DocumentIndexes" }; } sal_Int32 SAL_CALL @@ -2542,11 +2536,6 @@ SwXDocumentIndex::StyleAccess_Impl::getImplementationName() return OUString("SwXDocumentIndex::StyleAccess_Impl"); } -static char const*const g_ServicesIndexStyleAccess[] = -{ -
[Libreoffice-commits] core.git: connectivity/source include/comphelper
connectivity/source/drivers/ado/AColumns.cxx |4 ++-- connectivity/source/drivers/ado/AGroups.cxx |4 ++-- connectivity/source/drivers/ado/AIndexes.cxx |4 ++-- connectivity/source/drivers/ado/AKeys.cxx|4 ++-- connectivity/source/drivers/ado/ATable.cxx |4 ++-- connectivity/source/drivers/ado/ATables.cxx |4 ++-- connectivity/source/drivers/ado/AUsers.cxx |4 ++-- connectivity/source/drivers/ado/AViews.cxx |4 ++-- include/comphelper/types.hxx |7 +++ 9 files changed, 19 insertions(+), 20 deletions(-) New commits: commit 3d4b1c0eee7a3055e67df6b0b342ea25b0f5bf55 Author: Arkadiy Illarionov AuthorDate: Sat Jun 22 00:17:00 2019 +0300 Commit: Stephan Bergmann CommitDate: Mon Jun 24 09:09:50 2019 +0200 tdf#39593 Change comphelper::getImplementation signature To merge with comphelper::getUnoTunnelImplementation Change-Id: I976d768d7fb159d50fa90e27ec36f2bea91ea2cb Reviewed-on: https://gerrit.libreoffice.org/74542 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/connectivity/source/drivers/ado/AColumns.cxx b/connectivity/source/drivers/ado/AColumns.cxx index e72681b8d41f..ef010cfb4062 100644 --- a/connectivity/source/drivers/ado/AColumns.cxx +++ b/connectivity/source/drivers/ado/AColumns.cxx @@ -59,9 +59,9 @@ Reference< XPropertySet > OColumns::createDescriptor() // XAppend sdbcx::ObjectType OColumns::appendObject( const OUString&, const Reference< XPropertySet >& descriptor ) { -OAdoColumn* pColumn = nullptr; +OAdoColumn* pColumn = getImplementation( descriptor ); Reference< XPropertySet > xColumn; -if ( !getImplementation( pColumn, descriptor ) || pColumn == nullptr ) +if ( pColumn == nullptr ) { // m_pConnection->throwGenericSQLException( STR_INVALID_COLUMN_DESCRIPTOR_ERROR,static_cast(this) ); pColumn = new OAdoColumn(isCaseSensitive(),m_pConnection); diff --git a/connectivity/source/drivers/ado/AGroups.cxx b/connectivity/source/drivers/ado/AGroups.cxx index 80d23e20f9dc..506aead14f7d 100644 --- a/connectivity/source/drivers/ado/AGroups.cxx +++ b/connectivity/source/drivers/ado/AGroups.cxx @@ -57,8 +57,8 @@ Reference< XPropertySet > OGroups::createDescriptor() // XAppend sdbcx::ObjectType OGroups::appendObject( const OUString& _rForName, const Reference< XPropertySet >& descriptor ) { -OAdoGroup* pGroup = nullptr; -if ( !getImplementation(pGroup,descriptor) || pGroup == nullptr ) +OAdoGroup* pGroup = getImplementation(descriptor); +if ( pGroup == nullptr ) m_pCatalog->getConnection()->throwGenericSQLException( STR_INVALID_GROUP_DESCRIPTOR_ERROR,static_cast(this) ); m_aCollection.Append( pGroup->getImpl() ); diff --git a/connectivity/source/drivers/ado/AIndexes.cxx b/connectivity/source/drivers/ado/AIndexes.cxx index a54887d2832e..46cd1c1a4b86 100644 --- a/connectivity/source/drivers/ado/AIndexes.cxx +++ b/connectivity/source/drivers/ado/AIndexes.cxx @@ -57,8 +57,8 @@ Reference< XPropertySet > OIndexes::createDescriptor() // XAppend sdbcx::ObjectType OIndexes::appendObject( const OUString& _rForName, const Reference< XPropertySet >& descriptor ) { -OAdoIndex* pIndex = nullptr; -if ( !getImplementation(pIndex,descriptor) || pIndex == nullptr ) +OAdoIndex* pIndex = getImplementation(descriptor); +if ( pIndex == nullptr ) m_pConnection->throwGenericSQLException( STR_INVALID_INDEX_DESCRIPTOR_ERROR,static_cast(this) ); ADOIndexes* pIndexes = m_aCollection; diff --git a/connectivity/source/drivers/ado/AKeys.cxx b/connectivity/source/drivers/ado/AKeys.cxx index 559d7a7f101d..e306f918a726 100644 --- a/connectivity/source/drivers/ado/AKeys.cxx +++ b/connectivity/source/drivers/ado/AKeys.cxx @@ -57,8 +57,8 @@ Reference< XPropertySet > OKeys::createDescriptor() // XAppend sdbcx::ObjectType OKeys::appendObject( const OUString&, const Reference< XPropertySet >& descriptor ) { -OAdoKey* pKey = nullptr; -if ( !getImplementation( pKey, descriptor ) || pKey == nullptr) +OAdoKey* pKey = getImplementation( descriptor ); +if ( pKey == nullptr) m_pConnection->throwGenericSQLException( STR_INVALID_KEY_DESCRIPTOR_ERROR,static_cast(this) ); // To pass as column parameter to Key's Append method diff --git a/connectivity/source/drivers/ado/ATable.cxx b/connectivity/source/drivers/ado/ATable.cxx index 09c4c397051d..34597d55fff5 100644 --- a/connectivity/source/drivers/ado/ATable.cxx +++ b/connectivity/source/drivers/ado/ATable.cxx @@ -163,8 +163,8 @@ void SAL_CALL OAdoTable::alterColumnByName( const OUString& colName, const Refer checkDisposed(OTableDescriptor_BASE_TYPEDEF::rBHelper.bDisposed); bool bError = true; -OAdoColumn* pColumn = nullptr; -if(::comphelper::getImplementation(pColumn,descriptor) && pColumn != nullptr) +OAdoColumn* pColumn = ::comphelper::getImplementation(descriptor); +if(pColumn != nullptr)
[Libreoffice-commits] core.git: uui/source
uui/source/iahndl-ioexceptions.cxx | 51 ++--- 1 file changed, 15 insertions(+), 36 deletions(-) New commits: commit aed859c4825e10f0981686b9d8476538255b666f Author: Arkadiy Illarionov AuthorDate: Sun Jun 23 13:35:31 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Mon Jun 24 09:08:12 2019 +0200 tdf#39593 Replace copy-pasted functions with template Change-Id: Idcb6c3e13713a9c7cc545d1e287481fe6ccadba8 Reviewed-on: https://gerrit.libreoffice.org/74595 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/uui/source/iahndl-ioexceptions.cxx b/uui/source/iahndl-ioexceptions.cxx index bd85abbdcb1e..6da1ea3a6fab 100644 --- a/uui/source/iahndl-ioexceptions.cxx +++ b/uui/source/iahndl-ioexceptions.cxx @@ -30,17 +30,18 @@ using namespace com::sun::star; namespace { +template bool -getStringRequestArgument(uno::Sequence< uno::Any > const & rArguments, - OUString const & rKey, - OUString * pValue) +getRequestArgument(uno::Sequence< uno::Any > const & rArguments, + OUString const & rKey, + T * pValue) { -for (sal_Int32 i = 0; i < rArguments.getLength(); ++i) +for (const auto& rArgument : rArguments) { beans::PropertyValue aProperty; -if ((rArguments[i] >>= aProperty) && aProperty.Name == rKey) +if ((rArgument >>= aProperty) && aProperty.Name == rKey) { -OUString aValue; +T aValue; if (aProperty.Value >>= aValue) { if (pValue) @@ -53,36 +54,14 @@ getStringRequestArgument(uno::Sequence< uno::Any > const & rArguments, } bool -getBoolRequestArgument(uno::Sequence< uno::Any > const & rArguments, - OUString const & rKey, - bool * pValue) -{ -for (sal_Int32 i = 0; i < rArguments.getLength(); ++i) -{ -beans::PropertyValue aProperty; -if ((rArguments[i] >>= aProperty) && aProperty.Name == rKey) -{ -bool bValue; -if (aProperty.Value >>= bValue) -{ -if (pValue) -*pValue = bValue; -return true; -} -} -} -return false; -} - -bool getResourceNameRequestArgument(uno::Sequence< uno::Any > const & rArguments, OUString * pValue) { -if (!getStringRequestArgument(rArguments, "Uri", pValue)) +if (!getRequestArgument(rArguments, "Uri", pValue)) return false; // Use the resource name only for file URLs, to avoid confusion: if (pValue && comphelper::isFileUrl(*pValue)) -getStringRequestArgument(rArguments, "ResourceName", pValue); +getRequestArgument(rArguments, "ResourceName", pValue); return true; } @@ -183,7 +162,7 @@ UUIInteractionHelper::handleInteractiveIOException( case ucb::IOErrorCode_CANT_CREATE: { OUString aArgFolder; -if (getStringRequestArgument(aRequestArguments, "Folder", )) +if (getRequestArgument(aRequestArguments, "Folder", )) { OUString aArgUri; if (getResourceNameRequestArgument(aRequestArguments, @@ -212,9 +191,9 @@ UUIInteractionHelper::handleInteractiveIOException( )) { OUString aResourceType; -getStringRequestArgument(aRequestArguments, "ResourceType", ); +getRequestArgument(aRequestArguments, "ResourceType", ); bool bRemovable = false; -getBoolRequestArgument(aRequestArguments, "Removable", ); +getRequestArgument(aRequestArguments, "Removable", ); nErrorCode = aResourceType == "volume" ? (bRemovable ? ERRCODE_UUI_IO_NOTREADY_VOLUME_REMOVABLE @@ -233,8 +212,8 @@ UUIInteractionHelper::handleInteractiveIOException( { OUString aArgVolume; OUString aArgOtherVolume; -if (getStringRequestArgument(aRequestArguments, "Volume", ) -&& getStringRequestArgument(aRequestArguments, "OtherVolume", +if (getRequestArgument(aRequestArguments, "Volume", ) +&& getRequestArgument(aRequestArguments, "OtherVolume", )) { nErrorCode = aErrorCode[static_cast(aIoException.Code)][1]; @@ -254,7 +233,7 @@ UUIInteractionHelper::handleInteractiveIOException( )) { OUString aResourceType; -getStringRequestArgument(aRequestArguments, "ResourceType", +getRequestArgument(aRequestArguments, "ResourceType",
[Libreoffice-commits] core.git: unotools/source
unotools/source/accessibility/accessiblestatesethelper.cxx | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) New commits: commit 78e2faad8487bea76bd36004a9acc2491b7a72d8 Author: Arkadiy Illarionov AuthorDate: Sun Jun 23 19:24:40 2019 +0300 Commit: Noel Grandin CommitDate: Mon Jun 24 09:05:40 2019 +0200 Fix AccessibleStateSetHelper::containsAll Check if all states of the given state set are members of this object's state set. Previously it checked only last state. Change-Id: I79ffe54a5783aa1c3574bd099d2ea4bdc49a5c2d Reviewed-on: https://gerrit.libreoffice.org/74608 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/unotools/source/accessibility/accessiblestatesethelper.cxx b/unotools/source/accessibility/accessiblestatesethelper.cxx index fc867063c82d..9a180a4677ad 100644 --- a/unotools/source/accessibility/accessiblestatesethelper.cxx +++ b/unotools/source/accessibility/accessiblestatesethelper.cxx @@ -188,16 +188,8 @@ sal_Bool SAL_CALL AccessibleStateSetHelper::containsAll (const uno::Sequence& rStateSet) { osl::MutexGuard aGuard (maMutex); -sal_Int32 nCount(rStateSet.getLength()); -const sal_Int16* pStates = rStateSet.getConstArray(); -sal_Int32 i = 0; -bool bFound(true); -while (i < nCount) -{ -bFound = mpHelperImpl->Contains(pStates[i]); -i++; -} -return bFound; +return std::all_of(rStateSet.begin(), rStateSet.end(), +[this](const sal_Int16 nState) { return mpHelperImpl->Contains(nState); }); } uno::Sequence SAL_CALL AccessibleStateSetHelper::getStates() ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: reportdesign/source
reportdesign/source/core/api/Section.cxx | 16 ++-- reportdesign/source/core/inc/Section.hxx |3 +-- reportdesign/source/core/sdr/RptPage.cxx |4 ++-- 3 files changed, 5 insertions(+), 18 deletions(-) New commits: commit a4261757b89f6a198261006a8c9aa6b4eb8e19fb Author: Arkadiy Illarionov AuthorDate: Fri Jun 21 00:11:43 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Fri Jun 21 19:38:17 2019 +0200 tdf#39593 Remove reportdesign::OSection::getImplementation Replace with comphelper::getUnoTunnelImplementation. Change-Id: I3d0837ff3f47392e09ef276f141a8459add7a5ad Reviewed-on: https://gerrit.libreoffice.org/74471 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/reportdesign/source/core/api/Section.cxx b/reportdesign/source/core/api/Section.cxx index 69be4b7fc3c8..b030ae5508e7 100644 --- a/reportdesign/source/core/api/Section.cxx +++ b/reportdesign/source/core/api/Section.cxx @@ -571,24 +571,12 @@ sal_Bool SAL_CALL OSection::hasForms() sal_Int64 OSection::getSomething( const uno::Sequence< sal_Int8 > & rId ) { -if (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) ) +if (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) ) return reinterpret_cast(this); return (m_xDrawPage_Tunnel.is()) ? m_xDrawPage_Tunnel->getSomething(rId) : 0; } - -OSection* OSection::getImplementation( const uno::Reference< uno::XInterface >& _rxComponent ) -{ -OSection* pContent( nullptr ); - -uno::Reference< lang::XUnoTunnel > xUnoTunnel( _rxComponent, uno::UNO_QUERY ); -if ( xUnoTunnel.is() ) -pContent = reinterpret_cast< OSection* >( xUnoTunnel->getSomething( getUnoTunnelImplementationId() ) ); - -return pContent; -} - -uno::Sequence< sal_Int8 > OSection::getUnoTunnelImplementationId() +uno::Sequence< sal_Int8 > OSection::getUnoTunnelId() { static ::cppu::OImplementationId implId; diff --git a/reportdesign/source/core/inc/Section.hxx b/reportdesign/source/core/inc/Section.hxx index fb4fe75172ad..77a92db780bd 100644 --- a/reportdesign/source/core/inc/Section.hxx +++ b/reportdesign/source/core/inc/Section.hxx @@ -223,8 +223,7 @@ namespace reportdesign // css::lang::XUnoTunnel virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; -static OSection* getImplementation( const css::uno::Reference< css::uno::XInterface >& _rxComponent ); -static css::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId(); +static css::uno::Sequence< sal_Int8 > getUnoTunnelId(); void notifyElementAdded(const css::uno::Reference< css::drawing::XShape >& xShape); void notifyElementRemoved(const css::uno::Reference< css::drawing::XShape >& xShape); diff --git a/reportdesign/source/core/sdr/RptPage.cxx b/reportdesign/source/core/sdr/RptPage.cxx index c20f11f363cd..18484851739b 100644 --- a/reportdesign/source/core/sdr/RptPage.cxx +++ b/reportdesign/source/core/sdr/RptPage.cxx @@ -92,7 +92,7 @@ SdrObject* OReportPage::RemoveObject(size_t nObjNum) } // this code is evil, but what else shall I do -reportdesign::OSection* pSection = reportdesign::OSection::getImplementation(m_xSection); +reportdesign::OSection* pSection = comphelper::getUnoTunnelImplementation(m_xSection); uno::Reference< drawing::XShape> xShape(pObj->getUnoShape(),uno::UNO_QUERY); pSection->notifyElementRemoved(xShape); if (dynamic_cast< const OUnoObject *>( pObj ) != nullptr) @@ -177,7 +177,7 @@ void OReportPage::NbcInsertObject(SdrObject* pObj, size_t nPos) } // this code is evil, but what else shall I do -reportdesign::OSection* pSection = reportdesign::OSection::getImplementation(m_xSection); +reportdesign::OSection* pSection = comphelper::getUnoTunnelImplementation(m_xSection); uno::Reference< drawing::XShape> xShape(pObj->getUnoShape(),uno::UNO_QUERY); pSection->notifyElementAdded(xShape); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: forms/source
forms/source/component/Columns.cxx |4 ++-- forms/source/component/Columns.hxx |2 +- forms/source/component/Grid.cxx| 16 forms/source/component/Grid.hxx|2 -- 4 files changed, 7 insertions(+), 17 deletions(-) New commits: commit fbead41b7d6c0346ff3373279f9c01dc4c7e61fd Author: Arkadiy Illarionov AuthorDate: Fri Jun 21 00:43:56 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Fri Jun 21 19:32:06 2019 +0200 tdf#39593 Remove frm::OGridControlModel::getColumnImplementation Replace with comphelper::getUnoTunnelImplementation. Change-Id: I3b662136778340a95216ac08035f7c25d5882349 Reviewed-on: https://gerrit.libreoffice.org/74472 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/forms/source/component/Columns.cxx b/forms/source/component/Columns.cxx index 42de375a20b9..5fd625f3191c 100644 --- a/forms/source/component/Columns.cxx +++ b/forms/source/component/Columns.cxx @@ -115,7 +115,7 @@ namespace class theOGridColumnImplementationId : public rtl::Static< UnoTunnelIdInit, theOGridColumnImplementationId > {}; } -const Sequence& OGridColumn::getUnoTunnelImplementationId() +const Sequence& OGridColumn::getUnoTunnelId() { return theOGridColumnImplementationId::get().getSeq(); } @@ -126,7 +126,7 @@ sal_Int64 SAL_CALL OGridColumn::getSomething( const Sequence& _rIdenti sal_Int64 nReturn(0); if ( (_rIdentifier.getLength() == 16) -&& (0 == memcmp( getUnoTunnelImplementationId().getConstArray(), _rIdentifier.getConstArray(), 16 )) +&& (0 == memcmp( getUnoTunnelId().getConstArray(), _rIdentifier.getConstArray(), 16 )) ) { nReturn = reinterpret_cast(this); diff --git a/forms/source/component/Columns.hxx b/forms/source/component/Columns.hxx index d98fdbd02e0e..2db0bfb2218a 100644 --- a/forms/source/component/Columns.hxx +++ b/forms/source/component/Columns.hxx @@ -70,7 +70,7 @@ public: DECLARE_UNO3_AGG_DEFAULTS(OGridControlModel, OGridColumn_BASE) virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type& _rType ) override; -static const css::uno::Sequence& getUnoTunnelImplementationId(); +static const css::uno::Sequence& getUnoTunnelId(); // XUnoTunnel virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence& _rIdentifier) override; diff --git a/forms/source/component/Grid.cxx b/forms/source/component/Grid.cxx index ba3bfd222bf8..80294635082f 100644 --- a/forms/source/component/Grid.cxx +++ b/forms/source/component/Grid.cxx @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -688,15 +689,6 @@ Any OGridControlModel::getPropertyDefaultByHandle( sal_Int32 nHandle ) const return aReturn; } -OGridColumn* OGridControlModel::getColumnImplementation(const css::uno::Reference& _rxIFace) -{ -OGridColumn* pImplementation = nullptr; -Reference< XUnoTunnel > xUnoTunnel( _rxIFace, UNO_QUERY ); -if ( xUnoTunnel.is() ) -pImplementation = reinterpret_cast(xUnoTunnel->getSomething(OGridColumn::getUnoTunnelImplementationId())); -return pImplementation; -} - void OGridControlModel::gotColumn( const Reference< XInterface >& _rxColumn ) { Reference< XSQLErrorBroadcaster > xBroadcaster( _rxColumn, UNO_QUERY ); @@ -753,7 +745,7 @@ ElementDescription* OGridControlModel::createElementMetaData( ) void OGridControlModel::approveNewElement( const Reference< XPropertySet >& _rxObject, ElementDescription* _pElement ) { -OGridColumn* pCol = getColumnImplementation( _rxObject ); +OGridColumn* pCol = comphelper::getUnoTunnelImplementation( _rxObject ); if ( !pCol ) throw IllegalArgumentException(); OInterfaceContainer::approveNewElement( _rxObject, _pElement ); @@ -777,7 +769,7 @@ void OGridControlModel::write(const Reference& _rxOutStream for (sal_Int32 i = 0; i < nLen; i++) { // first the service name for the underlying model -OGridColumn* pCol = getColumnImplementation(m_aItems[i]); +OGridColumn* pCol = comphelper::getUnoTunnelImplementation(m_aItems[i]); DBG_ASSERT(pCol != nullptr, "OGridControlModel::write : such items should never reach it into my container !"); _rxOutStream << pCol->getModelName(); // then the object itself @@ -881,7 +873,7 @@ void OGridControlModel::read(const Reference& _rxInStream) sal_Int32 nMark = xMark->createMark(); if (xCol.is()) { -OGridColumn* pCol = getColumnImplementation(xCol); +OGridColumn* pCol = comphelper::getUnoTunnelImplementation(xCol); pCol->read(_rxInStream); } xMark->jumpToMark(nMark); diff --git a/forms/source/component/Grid.hxx b/forms/source/component/Grid.hxx index 43c3d277d064..6afaeb171472 100644 --- a/forms/source/component/Grid.hxx +++
[Libreoffice-commits] core.git: forms/source
forms/source/xforms/binding.cxx | 13 ++--- forms/source/xforms/binding.hxx |1 - 2 files changed, 2 insertions(+), 12 deletions(-) New commits: commit e2814bc4d3a3c8b63018e2733b1ac182adbd96e6 Author: Arkadiy Illarionov AuthorDate: Thu Jun 20 00:03:05 2019 +0300 Commit: Stephan Bergmann CommitDate: Thu Jun 20 10:20:23 2019 +0200 tdf#39593 Remove static xforms::Binding::getModelImpl Replace with comphelper::getUnoTunnelImplementation. Change-Id: I001293ca25387a34cff9872c6db2ab72c6c4d617 Reviewed-on: https://gerrit.libreoffice.org/74385 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/forms/source/xforms/binding.cxx b/forms/source/xforms/binding.cxx index 0601babdf72e..b36d2bf074df 100644 --- a/forms/source/xforms/binding.cxx +++ b/forms/source/xforms/binding.cxx @@ -53,6 +53,7 @@ #include #include +#include #include using namespace com::sun::star::xml::xpath; @@ -454,17 +455,7 @@ bool Binding::isLive() const Model* Binding::getModelImpl() const { -return getModelImpl( mxModel ); -} - -Model* Binding::getModelImpl( const css::uno::Reference& xModel ) -{ -Reference xTunnel( xModel, UNO_QUERY ); -Model* pModel = xTunnel.is() -? reinterpret_cast( -xTunnel->getSomething( Model::getUnoTunnelId() ) ) -: nullptr; -return pModel; +return comphelper::getUnoTunnelImplementation( mxModel ); } static void lcl_addListenerToNode( const Reference& xNode, diff --git a/forms/source/xforms/binding.hxx b/forms/source/xforms/binding.hxx index ba65c9bd7c18..a49d0e4567a6 100644 --- a/forms/source/xforms/binding.hxx +++ b/forms/source/xforms/binding.hxx @@ -273,7 +273,6 @@ private: /// get the model implementation xforms::Model* getModelImpl() const; -static xforms::Model* getModelImpl( const css::uno::Reference& xModel ); /// get MIP evaluation contexts /// (only valid if control has already been bound) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: vbahelper/source
vbahelper/source/msforms/vbacombobox.cxx |8 +- vbahelper/source/msforms/vbalistbox.cxx| 31 ++ vbahelper/source/msforms/vbalistcontrolhelper.cxx | 27 ++-- vbahelper/source/msforms/vbauserform.cxx |6 - vbahelper/source/vbahelper/vbacommandbarhelper.cxx | 16 ++--- vbahelper/source/vbahelper/vbacommandbars.cxx | 13 vbahelper/source/vbahelper/vbaeventshelperbase.cxx |3 vbahelper/source/vbahelper/vbaglobalbase.cxx | 20 ++ vbahelper/source/vbahelper/vbahelper.cxx | 64 ++--- vbahelper/source/vbahelper/vbashapes.cxx |9 +- 10 files changed, 64 insertions(+), 133 deletions(-) New commits: commit 71a7e17dd7a6425a3df3c5dca25a3dac24ef6fa7 Author: Arkadiy Illarionov AuthorDate: Tue Jun 18 23:43:16 2019 +0300 Commit: Noel Grandin CommitDate: Thu Jun 20 09:44:52 2019 +0200 Simplify Sequence iterations in vbahelper Use range-based loops or replace with comphelper or STL functions Change-Id: I7613057ba7063e04ca39a654f8a15c0354694783 Reviewed-on: https://gerrit.libreoffice.org/74309 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/vbahelper/source/msforms/vbacombobox.cxx b/vbahelper/source/msforms/vbacombobox.cxx index 851cee0a4098..3f4468d7d07a 100644 --- a/vbahelper/source/msforms/vbacombobox.cxx +++ b/vbahelper/source/msforms/vbacombobox.cxx @@ -21,6 +21,7 @@ #include #include #include +#include #include "vbanewfont.hxx" #include #include @@ -96,15 +97,14 @@ ScVbaComboBox::getListIndex() if ( sItems.hasElements() ) { OUString sText = getText(); -sal_Int32 nLen = sItems.getLength(); -for ( sal_Int32 index = 0; !sText.isEmpty() && index < nLen; ++index ) +if (!sText.isEmpty()) { -if ( sItems[ index ] == sText ) +sal_Int32 index = comphelper::findValue(sItems, sText); +if (index != -1) { SAL_INFO("vbahelper", "getListIndex returning " << index ); return uno::makeAny( index ); } - } } SAL_INFO("vbahelper", "getListIndex returning -1" ); diff --git a/vbahelper/source/msforms/vbalistbox.cxx b/vbahelper/source/msforms/vbalistbox.cxx index 13c878440193..cb35e7b58b40 100644 --- a/vbahelper/source/msforms/vbalistbox.cxx +++ b/vbahelper/source/msforms/vbalistbox.cxx @@ -20,6 +20,7 @@ #include "vbalistbox.hxx" #include "vbanewfont.hxx" #include +#include #include using namespace com::sun::star; @@ -77,17 +78,7 @@ ScVbaListBox::setValue( const uno::Any& _value ) OUString sValue = getAnyAsString( _value ); uno::Sequence< OUString > sList; m_xProps->getPropertyValue( "StringItemList" ) >>= sList; -sal_Int16 nLength = static_cast( sList.getLength() ); -sal_Int16 nValue = -1; -sal_Int16 i = 0; -for( i = 0; i < nLength; i++ ) -{ -if( sList[i] == sValue ) -{ -nValue = i; -break; -} -} +sal_Int16 nValue = static_cast(comphelper::findValue(sList, sValue)); if( nValue == -1 ) throw uno::RuntimeException( "Attribute use invalid." ); @@ -164,7 +155,7 @@ void SAL_CALL ScVbaListBox::AddItem( const uno::Any& pvargItem, const uno::Any& pvargIndex ) { mpListHelper->AddItem( pvargItem, pvargIndex ); -} +} void SAL_CALL ScVbaListBox::removeItem( const uno::Any& index ) @@ -196,9 +187,7 @@ ScVbaListBox::setValueEvent( const uno::Any& value ) { if( nList[i] == nIndex ) { -if( bValue ) -return; -else +if( !bValue ) { for( ; i < nLength - 1; i++ ) { @@ -208,8 +197,8 @@ ScVbaListBox::setValueEvent( const uno::Any& value ) //m_xProps->setPropertyValue( sSourceName, uno::makeAny( nList ) ); fireClickEvent(); m_xProps->setPropertyValue( "SelectedItems", uno::makeAny( nList ) ); -return; } +return; } } if( bValue ) @@ -239,16 +228,10 @@ ScVbaListBox::getValueEvent() { uno::Sequence< sal_Int16 > nList; m_xProps->getPropertyValue( "SelectedItems" ) >>= nList; -sal_Int32 nLength = nList.getLength(); sal_Int32 nIndex = m_nIndex; +bool bRet = std::find(nList.begin(), nList.end(), nIndex) != nList.end(); -for( sal_Int32 i = 0; i < nLength; i++ ) -{ -if( nList[i] == nIndex ) -return uno::makeAny( true ); -} - -return uno::makeAny( false ); +return uno::makeAny( bRet ); } void SAL_CALL diff --git a/vbahelper/source/msforms/vbalistcontrolhelper.cxx b/vbahelper/source/msforms/vbalistcontrolhelper.cxx index 9f72bda981c1..dfbbb19a3bde 100644 --- a/vbahelper/source/msforms/vbalistcontrolhelper.cxx +++ b/vbahelper/source/msforms/vbalistcontrolhelper.cxx @@ -21,6 +21,7
[Libreoffice-commits] core.git: forms/source
forms/source/xforms/binding.cxx|2 +- forms/source/xforms/model.cxx | 18 ++ forms/source/xforms/model.hxx |5 + forms/source/xforms/submission.cxx |8 4 files changed, 8 insertions(+), 25 deletions(-) New commits: commit 9950aab9f02ab6aff71feca820575ed5a4e215d5 Author: Arkadiy Illarionov AuthorDate: Wed Jun 19 23:37:31 2019 +0300 Commit: Stephan Bergmann CommitDate: Thu Jun 20 08:04:47 2019 +0200 tdf#39593 Remove xforms::Model::getModel Replace with comphelper::getUnoTunnelImplementation. Change-Id: I52f780059be7626a03bf79044cfc580bb33f3fd3 Reviewed-on: https://gerrit.libreoffice.org/74383 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/forms/source/xforms/binding.cxx b/forms/source/xforms/binding.cxx index 378cd39a71fd..0601babdf72e 100644 --- a/forms/source/xforms/binding.cxx +++ b/forms/source/xforms/binding.cxx @@ -462,7 +462,7 @@ Model* Binding::getModelImpl( const css::uno::Reference& xM Reference xTunnel( xModel, UNO_QUERY ); Model* pModel = xTunnel.is() ? reinterpret_cast( -xTunnel->getSomething( Model::getUnoTunnelID() ) ) +xTunnel->getSomething( Model::getUnoTunnelId() ) ) : nullptr; return pModel; } diff --git a/forms/source/xforms/model.cxx b/forms/source/xforms/model.cxx index 7fc703a74f1c..2bddfea5db30 100644 --- a/forms/source/xforms/model.cxx +++ b/forms/source/xforms/model.cxx @@ -108,20 +108,6 @@ Model::~Model() throw() { } -static Model* lcl_getModel( const Reference& xTunnel ) -{ -Model* pModel = nullptr; -if( xTunnel.is() ) -pModel = reinterpret_cast( -xTunnel->getSomething( Model::getUnoTunnelID() ) ); -return pModel; -} - -Model* Model::getModel( const Reference& xModel ) -{ -return lcl_getModel( Reference( xModel, UNO_QUERY ) ); -} - EvaluationContext Model::getEvaluationContext() { // the default context is the top-level element node. A default @@ -144,7 +130,7 @@ EvaluationContext Model::getEvaluationContext() } -css::uno::Sequence Model::getUnoTunnelID() +css::uno::Sequence Model::getUnoTunnelId() { static cppu::OImplementationId aImplementationId; return aImplementationId.getImplementationId(); @@ -604,7 +590,7 @@ void Model::update() sal_Int64 Model::getSomething( const css::uno::Sequence& xId ) { -return reinterpret_cast( ( xId == getUnoTunnelID() ) ? this : nullptr ); +return reinterpret_cast( ( xId == getUnoTunnelId() ) ? this : nullptr ); } Sequence Model::getImplementationId() diff --git a/forms/source/xforms/model.hxx b/forms/source/xforms/model.hxx index 6d956576778c..a56554c0888f 100644 --- a/forms/source/xforms/model.hxx +++ b/forms/source/xforms/model.hxx @@ -113,13 +113,10 @@ public: Model(); virtual ~Model() throw() override; -// get Model implementation from API object -static Model* getModel( const css::uno::Reference& ); - xforms::EvaluationContext getEvaluationContext(); -static css::uno::Sequence getUnoTunnelID(); +static css::uno::Sequence getUnoTunnelId(); // get/set that part of the schema, that we can't interpret as data types diff --git a/forms/source/xforms/submission.cxx b/forms/source/xforms/submission.cxx index 32066cdf5507..c4d786877674 100644 --- a/forms/source/xforms/submission.cxx +++ b/forms/source/xforms/submission.cxx @@ -216,12 +216,12 @@ bool Submission::doSubmit( const Reference< XInteractionHandler >& xHandler ) else if( !maRef.getExpression().isEmpty() ) { aExpression.setExpression( maRef.getExpression() ); -aEvalContext = Model::getModel( mxModel )->getEvaluationContext(); +aEvalContext = comphelper::getUnoTunnelImplementation( mxModel )->getEvaluationContext(); } else { aExpression.setExpression( "/" ); -aEvalContext = Model::getModel( mxModel )->getEvaluationContext(); +aEvalContext = comphelper::getUnoTunnelImplementation( mxModel )->getEvaluationContext(); } aExpression.evaluate( aEvalContext ); Reference xResult = aExpression.getXPath(); @@ -283,7 +283,7 @@ Model* Submission::getModelImpl() const { Model* pModel = nullptr; if( mxModel.is() ) -pModel = Model::getModel( mxModel ); +pModel = comphelper::getUnoTunnelImplementation( mxModel ); return pModel; } @@ -401,7 +401,7 @@ void SAL_CALL Submission::submitWithInteraction( *this ); -Model* pModel = Model::getModel( xModel ); +Model* pModel = comphelper::getUnoTunnelImplementation( xModel ); OSL_ENSURE( pModel != nullptr, "illegal model?" ); // #i36765# #i47248# warning on submission of illegal data ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: forms/source
forms/source/xforms/binding.cxx | 12 ++-- forms/source/xforms/binding.hxx |3 +-- forms/source/xforms/model.cxx|6 +++--- forms/source/xforms/model_helper.hxx | 12 +++- forms/source/xforms/model_ui.cxx |8 forms/source/xforms/submission.cxx |3 ++- 6 files changed, 19 insertions(+), 25 deletions(-) New commits: commit 9e1fa327b161c24c3d588563d6a91aced50b85dd Author: Arkadiy Illarionov AuthorDate: Wed Jun 19 23:20:46 2019 +0300 Commit: Stephan Bergmann CommitDate: Thu Jun 20 08:03:59 2019 +0200 tdf#39593 Remove xforms::Binding::getBinding Replace with comphelper::getUnoTunnelImplementation. Change-Id: Ic569783ae01f731f54b54775b8e0eba162cc4b78 Reviewed-on: https://gerrit.libreoffice.org/74381 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/forms/source/xforms/binding.cxx b/forms/source/xforms/binding.cxx index f4f6c64d07a7..378cd39a71fd 100644 --- a/forms/source/xforms/binding.cxx +++ b/forms/source/xforms/binding.cxx @@ -304,20 +304,12 @@ EvaluationContext Binding::getEvaluationContext() const } -css::uno::Sequence Binding::getUnoTunnelID() +css::uno::Sequence Binding::getUnoTunnelId() { static cppu::OImplementationId aImplementationId; return aImplementationId.getImplementationId(); } -Binding* Binding::getBinding( const Reference& xPropertySet ) -{ -Reference xTunnel( xPropertySet, UNO_QUERY ); -return xTunnel.is() -? reinterpret_cast( xTunnel->getSomething(getUnoTunnelID())) -: nullptr; -} - void Binding::setBindingID( const OUString& sBindingID ) { @@ -1194,7 +1186,7 @@ void Binding::handleEvent( const css::uno::Reference& xId ) { -return reinterpret_cast( ( xId == getUnoTunnelID() ) ? this : nullptr ); +return reinterpret_cast( ( xId == getUnoTunnelId() ) ? this : nullptr ); } diff --git a/forms/source/xforms/binding.hxx b/forms/source/xforms/binding.hxx index b75f66bfde6e..ba65c9bd7c18 100644 --- a/forms/source/xforms/binding.hxx +++ b/forms/source/xforms/binding.hxx @@ -257,8 +257,7 @@ public: // the ID for XUnoTunnel calls -static css::uno::Sequence getUnoTunnelID(); -static Binding* getBinding( const css::uno::Reference& ); +static css::uno::Sequence getUnoTunnelId(); private: diff --git a/forms/source/xforms/model.cxx b/forms/source/xforms/model.cxx index c41358199ae8..7fc703a74f1c 100644 --- a/forms/source/xforms/model.cxx +++ b/forms/source/xforms/model.cxx @@ -245,7 +245,7 @@ void Model::rebind() sal_Int32 nCount = mxBindings->countItems(); for( sal_Int32 i = 0; i < nCount; i++ ) { -Binding* pBind = Binding::getBinding( mxBindings->Collection::getItem( i ) ); +Binding* pBind = comphelper::getUnoTunnelImplementation( mxBindings->Collection::getItem( i ) ); OSL_ENSURE( pBind != nullptr, "binding?" ); pBind->update(); } @@ -258,7 +258,7 @@ void Model::deferNotifications( bool bDefer ) sal_Int32 nCount = mxBindings->countItems(); for( sal_Int32 i = 0; i < nCount; i++ ) { -Binding* pBind = Binding::getBinding( mxBindings->Collection::getItem( i ) ); +Binding* pBind = comphelper::getUnoTunnelImplementation( mxBindings->Collection::getItem( i ) ); OSL_ENSURE( pBind != nullptr, "binding?" ); pBind->deferNotifications( bDefer ); } @@ -381,7 +381,7 @@ bool Model::isValid() const sal_Int32 nCount = mxBindings->countItems(); for( sal_Int32 i = 0; bValid && i < nCount; i++ ) { -Binding* pBind = Binding::getBinding( mxBindings->Collection::getItem( i ) ); +Binding* pBind = comphelper::getUnoTunnelImplementation( mxBindings->Collection::getItem( i ) ); OSL_ENSURE( pBind != nullptr, "binding?" ); bValid = pBind->isValid(); } diff --git a/forms/source/xforms/model_helper.hxx b/forms/source/xforms/model_helper.hxx index f0a6c46d58a4..592649f839de 100644 --- a/forms/source/xforms/model_helper.hxx +++ b/forms/source/xforms/model_helper.hxx @@ -57,20 +57,22 @@ public: virtual bool isValid( const T& t ) const override { -return Binding::getBinding( t ) != nullptr; +return comphelper::getUnoTunnelImplementation( t ) != nullptr; } protected: virtual void _insert( const T& t ) override { -OSL_ENSURE( Binding::getBinding( t ) != nullptr, "invalid item?" ); -Binding::getBinding( t )->_setModel( css::uno::Reference( mpModel ) ); +auto pBinding = comphelper::getUnoTunnelImplementation( t ); +OSL_ENSURE( pBinding != nullptr, "invalid item?" ); +pBinding->_setModel( css::uno::Reference( mpModel ) ); } virtual void _remove( const T& t ) override { -OSL_ENSURE( Binding::getBinding( t ) != nullptr, "invalid item?" ); -Binding::getBinding( t )->_setModel( css::uno::Reference() ); +auto pBinding =
[Libreoffice-commits] core.git: forms/source
forms/source/xforms/model.cxx|2 +- forms/source/xforms/model_helper.hxx | 13 - forms/source/xforms/submission.cxx | 14 ++ forms/source/xforms/submission.hxx |3 +-- 4 files changed, 12 insertions(+), 20 deletions(-) New commits: commit d6a45af91bf1df9ab8aac3d8e83dba7474e15a95 Author: Arkadiy Illarionov AuthorDate: Thu Jun 20 00:29:40 2019 +0300 Commit: Stephan Bergmann CommitDate: Thu Jun 20 08:02:26 2019 +0200 tdf#39593 Remove xforms::Submission::getSubmission Replace with comphelper::getUnoTunnelImplementation. Change-Id: I8dcd0bf1cfbaa02fbb7c128421506f1c30d87773 Reviewed-on: https://gerrit.libreoffice.org/74387 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/forms/source/xforms/model.cxx b/forms/source/xforms/model.cxx index f92e8392eb4e..c41358199ae8 100644 --- a/forms/source/xforms/model.cxx +++ b/forms/source/xforms/model.cxx @@ -449,7 +449,7 @@ void SAL_CALL Model::submitWithInteraction( if( mxSubmissions->hasItem( sID ) ) { Submission* pSubmission = -Submission::getSubmission( mxSubmissions->getItem( sID ) ); +comphelper::getUnoTunnelImplementation( mxSubmissions->getItem( sID ) ); OSL_ENSURE( pSubmission != nullptr, "no submission?" ); OSL_ENSURE( pSubmission->getModel() == Reference( this ), "wrong model" ); diff --git a/forms/source/xforms/model_helper.hxx b/forms/source/xforms/model_helper.hxx index b70bc23c9c1c..f0a6c46d58a4 100644 --- a/forms/source/xforms/model_helper.hxx +++ b/forms/source/xforms/model_helper.hxx @@ -34,6 +34,7 @@ #include #include #include +#include namespace xforms { @@ -82,20 +83,22 @@ public: virtual bool isValid( const T& t ) const override { -return Submission::getSubmission( t ) != nullptr; +return comphelper::getUnoTunnelImplementation( t ) != nullptr; } protected: virtual void _insert( const T& t ) override { -OSL_ENSURE( Submission::getSubmission( t ) != nullptr, "invalid item?" ); -Submission::getSubmission( t )->setModel( css::uno::Reference( mpModel ) ); +auto pSubmission = comphelper::getUnoTunnelImplementation( t ); +OSL_ENSURE( pSubmission != nullptr, "invalid item?" ); +pSubmission->setModel( css::uno::Reference( mpModel ) ); } virtual void _remove( const T& t ) override { -OSL_ENSURE( Submission::getSubmission( t ) != nullptr, "invalid item?" ); -Submission::getSubmission( t )->setModel( css::uno::Reference( ) ); +auto pSubmission = comphelper::getUnoTunnelImplementation( t ); +OSL_ENSURE( pSubmission != nullptr, "invalid item?" ); +pSubmission->setModel( css::uno::Reference( ) ); } }; diff --git a/forms/source/xforms/submission.cxx b/forms/source/xforms/submission.cxx index 3074619981c9..9c7a0fb72abe 100644 --- a/forms/source/xforms/submission.cxx +++ b/forms/source/xforms/submission.cxx @@ -263,22 +263,12 @@ bool Submission::doSubmit( const Reference< XInteractionHandler >& xHandler ) return ( aResult == CSubmission::SUCCESS ); } -Sequence Submission::getUnoTunnelID() +Sequence Submission::getUnoTunnelId() { static cppu::OImplementationId aImplementationId; return aImplementationId.getImplementationId(); } -Submission* Submission::getSubmission( -const Reference& xPropertySet ) -{ -Reference xTunnel( xPropertySet, UNO_QUERY ); -return xTunnel.is() -? reinterpret_cast( -xTunnel->getSomething( getUnoTunnelID() ) ) -: nullptr; -} - void Submission::liveCheck() { @@ -386,7 +376,7 @@ void SAL_CALL Submission::setName( const OUString& sID ) sal_Int64 SAL_CALL Submission::getSomething( const Sequence& aId ) { -return ( aId == getUnoTunnelID() ) ? reinterpret_cast(this) : 0; +return ( aId == getUnoTunnelId() ) ? reinterpret_cast(this) : 0; } diff --git a/forms/source/xforms/submission.hxx b/forms/source/xforms/submission.hxx index fc095d7c3965..3f3921f9aaa5 100644 --- a/forms/source/xforms/submission.hxx +++ b/forms/source/xforms/submission.hxx @@ -158,8 +158,7 @@ public: bool doSubmit( const css::uno::Reference< css::task::XInteractionHandler >& aHandler ); // helpers for UNO tunnel -static css::uno::Sequence getUnoTunnelID(); -static Submission* getSubmission( const css::uno::Reference& ); +static css::uno::Sequence getUnoTunnelId(); private: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: chart2/source
chart2/source/controller/accessibility/AccessibleBase.cxx |3 + chart2/source/controller/accessibility/AccessibleChartView.cxx |4 +- chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx |4 +- chart2/source/controller/main/ChartController.cxx |2 - chart2/source/controller/main/ChartController_Position.cxx |3 + chart2/source/controller/main/ChartController_Properties.cxx |3 + chart2/source/controller/main/ChartController_Window.cxx |6 +-- chart2/source/controller/uitest/uiobject.cxx |4 +- chart2/source/inc/chartview/ExplicitValueProvider.hxx |1 chart2/source/view/main/ChartView.cxx | 16 -- 10 files changed, 20 insertions(+), 26 deletions(-) New commits: commit 336b9a14f65222936d000551ed9728ab13514479 Author: Arkadiy Illarionov AuthorDate: Wed Jun 19 22:35:40 2019 +0300 Commit: Stephan Bergmann CommitDate: Thu Jun 20 07:51:48 2019 +0200 tdf#39593 Remove chart::ExplicitValueProvider::getExplicitValueProvider Replace with comphelper::getUnoTunnelImplementation. Change-Id: I8a457dc2aa701957f463b31bd6cc112337999aad Reviewed-on: https://gerrit.libreoffice.org/74377 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/chart2/source/controller/accessibility/AccessibleBase.cxx b/chart2/source/controller/accessibility/AccessibleBase.cxx index 7f545b35c018..ff1008abedd9 100644 --- a/chart2/source/controller/accessibility/AccessibleBase.cxx +++ b/chart2/source/controller/accessibility/AccessibleBase.cxx @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -631,7 +632,7 @@ Reference< XAccessible > SAL_CALL AccessibleBase::getAccessibleAtPoint( const aw awt::Rectangle SAL_CALL AccessibleBase::getBounds() { ExplicitValueProvider *pExplicitValueProvider( -ExplicitValueProvider::getExplicitValueProvider( m_aAccInfo.m_xView )); +comphelper::getUnoTunnelImplementation( m_aAccInfo.m_xView )); if( pExplicitValueProvider ) { VclPtr pWindow( VCLUnoHelper::GetWindow( m_aAccInfo.m_xWindow )); diff --git a/chart2/source/controller/accessibility/AccessibleChartView.cxx b/chart2/source/controller/accessibility/AccessibleChartView.cxx index 15ec18a6517b..4d5e1d89ae7f 100644 --- a/chart2/source/controller/accessibility/AccessibleChartView.cxx +++ b/chart2/source/controller/accessibility/AccessibleChartView.cxx @@ -30,6 +30,8 @@ #include #include +#include + #include #include #include @@ -296,7 +298,7 @@ void SAL_CALL AccessibleChartView::initialize( const Sequence< Any >& rArguments Reference< chart2::XChartDocument > xChartDoc( xChartModel, uno::UNO_QUERY ); if( xChartDoc.is()) m_spObjectHierarchy.reset( -new ObjectHierarchy( xChartDoc, ExplicitValueProvider::getExplicitValueProvider(m_xChartView) )); +new ObjectHierarchy( xChartDoc, comphelper::getUnoTunnelImplementation(m_xChartView) )); else m_spObjectHierarchy.reset(); } diff --git a/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx b/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx index 65c201232352..634840e367b6 100644 --- a/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx +++ b/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx @@ -27,6 +27,8 @@ #include #include +#include + using ::com::sun::star::uno::Reference; using namespace ::com::sun::star; using namespace ::com::sun::star::chart2; @@ -67,7 +69,7 @@ double InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals( { double fStepWidth = 0.001; -ExplicitValueProvider* pExplicitValueProvider( ExplicitValueProvider::getExplicitValueProvider(xChartView) ); +ExplicitValueProvider* pExplicitValueProvider( comphelper::getUnoTunnelImplementation(xChartView) ); if( pExplicitValueProvider ) { Reference< XAxis > xAxis; diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index 15a30767c63c..6473cd683d24 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -1466,7 +1466,7 @@ DrawModelWrapper* ChartController::GetDrawModelWrapper() { if( !m_pDrawModelWrapper.get() ) { -ExplicitValueProvider* pProvider = ExplicitValueProvider::getExplicitValueProvider( m_xChartView ); +ExplicitValueProvider* pProvider = comphelper::getUnoTunnelImplementation( m_xChartView ); if( pProvider ) m_pDrawModelWrapper = pProvider->getDrawModelWrapper(); if ( m_pDrawModelWrapper.get() ) diff --git a/chart2/source/controller/main/ChartController_Position.cxx b/chart2/source/controller/main/ChartController_Position.cxx index 8df27d382153..4033a8272d7d 100644 ---
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/text/XMLTextCharStyleNamesElementExport.cxx | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) New commits: commit 1dade9d64dc579e4e68c033a539b3df25dc89f3e Author: Arkadiy Illarionov AuthorDate: Tue Jun 18 21:46:33 2019 +0300 Commit: Noel Grandin CommitDate: Wed Jun 19 09:04:01 2019 +0200 Use for loop with explicit number of iterations 96be3821f7dad19004a43696555eaa4fa2e1aef5 follow-up Change-Id: I1e585a1f4bcd68757cce7b6327757cd7e9ee660f Reviewed-on: https://gerrit.libreoffice.org/74306 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmloff/source/text/XMLTextCharStyleNamesElementExport.cxx b/xmloff/source/text/XMLTextCharStyleNamesElementExport.cxx index 55beb5f027f3..a9a22991eac7 100644 --- a/xmloff/source/text/XMLTextCharStyleNamesElementExport.cxx +++ b/xmloff/source/text/XMLTextCharStyleNamesElementExport.cxx @@ -54,14 +54,11 @@ XMLTextCharStyleNamesElementExport::XMLTextCharStyleNamesElementExport( { aName = rExport.GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_TEXT, GetXMLToken(XML_SPAN) ); -sal_Int32 i = nCount; -const OUString *pName = aNames.getConstArray(); -while( --i ) +for( sal_Int32 i = 1; i < nCount; ++i ) { rExport.AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME, - rExport.EncodeStyleName( *pName ) ); + rExport.EncodeStyleName( aNames[i - 1] ) ); rExport.StartElement( aName, false ); -++pName; } } } @@ -72,8 +69,7 @@ XMLTextCharStyleNamesElementExport::~XMLTextCharStyleNamesElementExport() { if( nCount > 1 ) { -sal_Int32 i = nCount; -while( --i ) +for( sal_Int32 i = 1; i < nCount; ++i ) rExport.EndElement( aName, false ); } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: framework/inc framework/source
framework/inc/uielement/constitemcontainer.hxx|3 +-- framework/inc/uielement/itemcontainer.hxx |3 +-- framework/source/fwi/uielement/constitemcontainer.cxx | 13 +++-- framework/source/fwi/uielement/itemcontainer.cxx | 11 ++- framework/source/fwi/uielement/rootitemcontainer.cxx |2 +- 5 files changed, 8 insertions(+), 24 deletions(-) New commits: commit 60271c4433372097ef5ecc74e522532ebf5af8e0 Author: Arkadiy Illarionov AuthorDate: Wed Jun 19 00:10:12 2019 +0300 Commit: Stephan Bergmann CommitDate: Wed Jun 19 07:53:35 2019 +0200 tdf#39593 Remove GetImplementation from ConstItemContainer and ItemContainer Replace with comphelper::getUnoTunnelImplementation. Change-Id: I87e1d3afd3a742926c7054179092d3b58b6b4563 Reviewed-on: https://gerrit.libreoffice.org/74310 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/framework/inc/uielement/constitemcontainer.hxx b/framework/inc/uielement/constitemcontainer.hxx index 5efc22b30fdb..9ed27693829d 100644 --- a/framework/inc/uielement/constitemcontainer.hxx +++ b/framework/inc/uielement/constitemcontainer.hxx @@ -56,8 +56,7 @@ class FWI_DLLPUBLIC ConstItemContainer : public ::cppu::WeakImplHelper< virtual ~ConstItemContainer() override; // XUnoTunnel -static const css::uno::Sequence< sal_Int8 >& GetUnoTunnelId() throw(); -static ConstItemContainer* GetImplementation( const css::uno::Reference< css::uno::XInterface >& rxIFace ) throw(); +static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId() throw(); sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& rIdentifier ) override; // XIndexAccess diff --git a/framework/inc/uielement/itemcontainer.hxx b/framework/inc/uielement/itemcontainer.hxx index d3fb00b56952..156d7ffd4904 100644 --- a/framework/inc/uielement/itemcontainer.hxx +++ b/framework/inc/uielement/itemcontainer.hxx @@ -48,8 +48,7 @@ class FWI_DLLPUBLIC ItemContainer : public ::cppu::WeakImplHelper< css::contai // XInterface, XTypeProvider // XUnoTunnel -static const css::uno::Sequence< sal_Int8 >& GetUnoTunnelId() throw(); -static ItemContainer* GetImplementation( const css::uno::Reference< css::uno::XInterface >& rxIFace ) throw(); +static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId() throw(); // XIndexContainer virtual void SAL_CALL insertByIndex( sal_Int32 Index, const css::uno::Any& Element ) override; diff --git a/framework/source/fwi/uielement/constitemcontainer.cxx b/framework/source/fwi/uielement/constitemcontainer.cxx index d1e45af96492..03d638f10ae6 100644 --- a/framework/source/fwi/uielement/constitemcontainer.cxx +++ b/framework/source/fwi/uielement/constitemcontainer.cxx @@ -151,7 +151,7 @@ Reference< XIndexAccess > ConstItemContainer::deepCopyContainer( const Reference Reference< XIndexAccess > xReturn; if ( rSubContainer.is() ) { -ItemContainer* pSource = ItemContainer::GetImplementation( rSubContainer ); +ItemContainer* pSource = comphelper::getUnoTunnelImplementation( rSubContainer ); ConstItemContainer* pSubContainer( nullptr ); if ( pSource ) pSubContainer = new ConstItemContainer( *pSource ); @@ -166,7 +166,7 @@ Reference< XIndexAccess > ConstItemContainer::deepCopyContainer( const Reference // XUnoTunnel sal_Int64 ConstItemContainer::getSomething( const css::uno::Sequence< sal_Int8 >& rIdentifier ) { -if( ( rIdentifier.getLength() == 16 ) && ( 0 == memcmp( ConstItemContainer::GetUnoTunnelId().getConstArray(), rIdentifier.getConstArray(), 16 ) ) ) +if( ( rIdentifier.getLength() == 16 ) && ( 0 == memcmp( ConstItemContainer::getUnoTunnelId().getConstArray(), rIdentifier.getConstArray(), 16 ) ) ) { return reinterpret_cast< sal_Int64 >( this ); } @@ -178,18 +178,11 @@ namespace class theConstItemContainerUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theConstItemContainerUnoTunnelId > {}; } -const Sequence< sal_Int8 >& ConstItemContainer::GetUnoTunnelId() throw() +const Sequence< sal_Int8 >& ConstItemContainer::getUnoTunnelId() throw() { return theConstItemContainerUnoTunnelId::get().getSeq(); } -ConstItemContainer* ConstItemContainer::GetImplementation( const css::uno::Reference< css::uno::XInterface >& rxIFace ) throw() -{ -css::uno::Reference< css::lang::XUnoTunnel > xUT( rxIFace, css::uno::UNO_QUERY ); -return xUT.is() ? reinterpret_cast< ConstItemContainer* >(sal::static_int_cast< sal_IntPtr >( - xUT->getSomething( ConstItemContainer::GetUnoTunnelId() ))) : nullptr; -} - // XElementAccess sal_Bool SAL_CALL ConstItemContainer::hasElements() { diff --git
[Libreoffice-commits] core.git: toolkit/source
toolkit/source/controls/grid/defaultgridcolumnmodel.cxx |7 --- toolkit/source/controls/grid/gridcolumn.cxx |9 - toolkit/source/controls/grid/gridcolumn.hxx |1 - 3 files changed, 4 insertions(+), 13 deletions(-) New commits: commit b0efb1be8ed02f34ab4a2bc0c933c4378b2715e3 Author: Arkadiy Illarionov AuthorDate: Tue Jun 18 00:22:09 2019 +0300 Commit: Stephan Bergmann CommitDate: Tue Jun 18 13:26:45 2019 +0200 tdf#39593 Remove toolkit::GridColumn::getImplementation Replace with comphelper::getUnoTunnelImplementation. Change-Id: I6b32cf388f32e7aa8f073daea0423fcbf169386d Reviewed-on: https://gerrit.libreoffice.org/74235 Reviewed-by: Stephan Bergmann Tested-by: Stephan Bergmann diff --git a/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx b/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx index 00a34fc696c2..3883f662a48b 100644 --- a/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx +++ b/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -115,7 +116,7 @@ private: Reference< css::util::XCloneable > const xCloneable( *col, UNO_QUERY_THROW ); Reference< XGridColumn > const xClone( xCloneable->createClone(), UNO_QUERY_THROW ); -GridColumn* const pGridColumn = GridColumn::getImplementation( xClone ); +GridColumn* const pGridColumn = comphelper::getUnoTunnelImplementation( xClone ); if ( pGridColumn == nullptr ) throw RuntimeException( "invalid clone source implementation", *this ); // that's indeed a RuntimeException, not an IllegalArgumentException or some such: @@ -151,7 +152,7 @@ private: { ::comphelper::ComponentGuard aGuard( *this, rBHelper ); -GridColumn* const pGridColumn = GridColumn::getImplementation( i_column ); +GridColumn* const pGridColumn = comphelper::getUnoTunnelImplementation( i_column ); if ( pGridColumn == nullptr ) throw css::lang::IllegalArgumentException( "invalid column implementation", *this, 1 ); @@ -190,7 +191,7 @@ private: ++updatePos, ++columnIndex ) { -GridColumn* pColumnImpl = GridColumn::getImplementation( *updatePos ); +GridColumn* pColumnImpl = comphelper::getUnoTunnelImplementation( *updatePos ); if ( !pColumnImpl ) { SAL_WARN( "toolkit.controls", "DefaultGridColumnModel::removeColumn: invalid column implementation!" ); diff --git a/toolkit/source/controls/grid/gridcolumn.cxx b/toolkit/source/controls/grid/gridcolumn.cxx index 6cf9b0639fdf..acb64eccf76c 100644 --- a/toolkit/source/controls/grid/gridcolumn.cxx +++ b/toolkit/source/controls/grid/gridcolumn.cxx @@ -298,15 +298,6 @@ namespace toolkit static ::cppu::OImplementationId const aId; return aId.getImplementationId(); } - - -GridColumn* GridColumn::getImplementation( const Reference< XInterface >& i_component ) -{ -Reference< XUnoTunnel > const xTunnel( i_component, UNO_QUERY ); -if ( xTunnel.is() ) -return reinterpret_cast< GridColumn* >( ::sal::static_int_cast< sal_IntPtr >( xTunnel->getSomething( getUnoTunnelId() ) ) ); -return nullptr; -} } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * diff --git a/toolkit/source/controls/grid/gridcolumn.hxx b/toolkit/source/controls/grid/gridcolumn.hxx index 65a61363d7e6..4986fb164b8c 100644 --- a/toolkit/source/controls/grid/gridcolumn.hxx +++ b/toolkit/source/controls/grid/gridcolumn.hxx @@ -88,7 +88,6 @@ public: // XUnoTunnel and friends virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& i_identifier ) override; static css::uno::Sequence< sal_Int8 > getUnoTunnelId() throw(); -static GridColumn* getImplementation( const css::uno::Reference< css::uno::XInterface >& i_component ); // attribute access void setIndex( sal_Int32 const i_index ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/inc sc/qa sc/source
sc/inc/docuno.hxx |1 - sc/qa/unit/copy_paste_test.cxx |2 +- sc/source/core/data/documen8.cxx |5 +++-- sc/source/filter/excel/xlroot.cxx |3 ++- sc/source/filter/xml/XMLConverter.cxx |3 ++- sc/source/filter/xml/XMLTableShapeImportHelper.cxx |2 +- sc/source/filter/xml/xmlbodyi.cxx |7 --- sc/source/filter/xml/xmlcelli.cxx |8 +--- sc/source/filter/xml/xmlcoli.cxx |3 ++- sc/source/filter/xml/xmlexprt.cxx | 12 ++-- sc/source/filter/xml/xmlimprt.cxx | 14 +++--- sc/source/filter/xml/xmlrowi.cxx |3 ++- sc/source/filter/xml/xmlstyli.cxx |2 +- sc/source/filter/xml/xmlsubti.cxx |3 ++- sc/source/filter/xml/xmltabi.cxx |3 ++- sc/source/filter/xml/xmlwrap.cxx |2 +- sc/source/ui/docshell/docsh.cxx|2 +- sc/source/ui/docshell/docsh4.cxx |2 +- sc/source/ui/drawfunc/fusel.cxx|2 +- sc/source/ui/inc/docsh.hxx |3 ++- sc/source/ui/unoobj/docuno.cxx | 13 ++--- sc/source/ui/view/tabview.cxx |4 ++-- sc/source/ui/view/tabview3.cxx |2 +- sc/source/ui/view/tabview5.cxx |2 +- sc/source/ui/view/viewfun3.cxx |2 +- sc/source/ui/view/viewfun7.cxx |4 ++-- 26 files changed, 55 insertions(+), 54 deletions(-) New commits: commit e062d42f587ad758ecfc42967bf257a9e2e37a3d Author: Arkadiy Illarionov AuthorDate: Tue Jun 18 01:12:00 2019 +0300 Commit: Stephan Bergmann CommitDate: Tue Jun 18 13:21:01 2019 +0200 tdf#39593 Remove ScModelObj::getImplementation Replace with comphelper::getUnoTunnelImplementation. Change-Id: I06a8db37b5c5c38c52a15a76e6e2df3b431a2040 Reviewed-on: https://gerrit.libreoffice.org/74237 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx index 501028b7340a..b5a5e71b1a60 100644 --- a/sc/inc/docuno.hxx +++ b/sc/inc/docuno.hxx @@ -260,7 +260,6 @@ public: virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; static const css::uno::Sequence& getUnoTunnelId(); -static ScModelObj* getImplementation(const css::uno::Reference& rObj); /// XTypeProvider virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; diff --git a/sc/qa/unit/copy_paste_test.cxx b/sc/qa/unit/copy_paste_test.cxx index 967faaadf13a..8a65609b51b1 100644 --- a/sc/qa/unit/copy_paste_test.cxx +++ b/sc/qa/unit/copy_paste_test.cxx @@ -205,7 +205,7 @@ void ScCopyPasteTest::testTdf84411() // 3. Disable OpenCL -ScModelObj* pModel = ScModelObj::getImplementation(pFoundShell->GetModel()); +ScModelObj* pModel = comphelper::getUnoTunnelImplementation(pFoundShell->GetModel()); CPPUNIT_ASSERT(pModel != nullptr); bool bOpenCLState = ScCalcConfig::isOpenCLEnabled(); pModel->enableOpenCL(false); diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx index aefbcb293d70..059293291eee 100644 --- a/sc/source/core/data/documen8.cxx +++ b/sc/source/core/data/documen8.cxx @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -708,7 +709,7 @@ void ScDocument::RepaintRange( const ScRange& rRange ) { if ( bIsVisible && mpShell ) { -ScModelObj* pModel = ScModelObj::getImplementation( mpShell->GetModel() ); +ScModelObj* pModel = comphelper::getUnoTunnelImplementation( mpShell->GetModel() ); if ( pModel ) pModel->RepaintRange( rRange ); // locked repaints are checked there } @@ -718,7 +719,7 @@ void ScDocument::RepaintRange( const ScRangeList& rRange ) { if ( bIsVisible && mpShell ) { -ScModelObj* pModel = ScModelObj::getImplementation( mpShell->GetModel() ); +ScModelObj* pModel = comphelper::getUnoTunnelImplementation( mpShell->GetModel() ); if ( pModel ) pModel->RepaintRange( rRange ); // locked repaints are checked there } diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx index 7d054c52204c..3f559b285703 100644 --- a/sc/source/filter/excel/xlroot.cxx +++ b/sc/source/filter/excel/xlroot.cxx @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -291,7 +292,7 @@ SfxObjectShell* XclRoot::GetDocShell() const ScModelObj* XclRoot::GetDocModelObj() const { SfxObjectShell* pDocShell = GetDocShell(); -return pDocShell ? ScModelObj::getImplementation(
[Libreoffice-commits] core.git: vcl/inc vcl/source
vcl/inc/graphic/UnoGraphic.hxx|2 -- vcl/source/graphic/UnoGraphic.cxx |7 --- vcl/source/graphic/UnoGraphicProvider.cxx |3 ++- 3 files changed, 2 insertions(+), 10 deletions(-) New commits: commit 086c186209e33faa38403c1d9122fd2e90921b3a Author: Arkadiy Illarionov AuthorDate: Mon Jun 17 22:37:08 2019 +0300 Commit: Stephan Bergmann CommitDate: Tue Jun 18 13:17:29 2019 +0200 tdf#39593 Remove Graphic::getImplementation Replace with comphelper::getUnoTunnelImplementation. Change-Id: Ic0e2e78fea575af6da4870fbd372f2148a328e26 Reviewed-on: https://gerrit.libreoffice.org/74203 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/vcl/inc/graphic/UnoGraphic.hxx b/vcl/inc/graphic/UnoGraphic.hxx index 0bef26bcbd86..5728debf6a47 100644 --- a/vcl/inc/graphic/UnoGraphic.hxx +++ b/vcl/inc/graphic/UnoGraphic.hxx @@ -44,8 +44,6 @@ public: using ::unographic::GraphicDescriptor::init; void init( const ::Graphic& rGraphic ) throw(); -static const ::Graphic* getImplementation( const css::uno::Reference< css::uno::XInterface >& rxIFace ) throw(); - protected: // XInterface diff --git a/vcl/source/graphic/UnoGraphic.cxx b/vcl/source/graphic/UnoGraphic.cxx index 4fe9d88ada8e..b13860caa734 100644 --- a/vcl/source/graphic/UnoGraphic.cxx +++ b/vcl/source/graphic/UnoGraphic.cxx @@ -181,13 +181,6 @@ uno::Sequence SAL_CALL Graphic::getMaskDIB() } } -const ::Graphic* Graphic::getImplementation( const uno::Reference< uno::XInterface >& rxIFace ) -throw() -{ -uno::Reference< lang::XUnoTunnel > xTunnel( rxIFace, uno::UNO_QUERY ); -return( xTunnel.is() ? reinterpret_cast< ::Graphic* >( xTunnel->getSomething( ::Graphic::getUnoTunnelId() ) ) : nullptr ); -} - sal_Int64 SAL_CALL Graphic::getSomething( const uno::Sequence< sal_Int8 >& rId ) { return( ( rId.getLength() == 16 && 0 == memcmp( ::Graphic::getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) ) ? diff --git a/vcl/source/graphic/UnoGraphicProvider.cxx b/vcl/source/graphic/UnoGraphicProvider.cxx index d7dcee4b183c..eed36dbc0fe6 100644 --- a/vcl/source/graphic/UnoGraphicProvider.cxx +++ b/vcl/source/graphic/UnoGraphicProvider.cxx @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -805,7 +806,7 @@ void SAL_CALL GraphicProvider::storeGraphic( const uno::Reference< ::graphic::XG { const uno::Reference< XInterface > xIFace( rxGraphic, uno::UNO_QUERY ); -const ::Graphic*pGraphic = ::unographic::Graphic::getImplementation( xIFace ); +const ::Graphic*pGraphic = comphelper::getUnoTunnelImplementation<::Graphic>( xIFace ); if( pGraphic && ( pGraphic->GetType() != GraphicType::NONE ) ) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: unoxml/inc unoxml/source
unoxml/inc/node.hxx |3 +-- unoxml/source/dom/element.cxx|5 +++-- unoxml/source/dom/node.cxx | 24 +--- unoxml/source/xpath/xpathapi.cxx |7 --- 4 files changed, 17 insertions(+), 22 deletions(-) New commits: commit cc0dc723c7d8354b5203310ef1381bbf54258eba Author: Arkadiy Illarionov AuthorDate: Tue Jun 18 00:10:57 2019 +0300 Commit: Michael Stahl CommitDate: Tue Jun 18 12:50:43 2019 +0200 tdf#39593 Remove DOM::CNode::GetImplementation Replace with comphelper::getUnoTunnelImplementation. Change-Id: If98801fd85bf0967c54e1924a04b6de371868942 Reviewed-on: https://gerrit.libreoffice.org/74234 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/unoxml/inc/node.hxx b/unoxml/inc/node.hxx index 216f80eda3d5..e35ab3aafda5 100644 --- a/unoxml/inc/node.hxx +++ b/unoxml/inc/node.hxx @@ -119,8 +119,7 @@ namespace DOM virtual ~CNode() override; -static CNode * GetImplementation(css::uno::Reference< -css::uno::XInterface> const& xNode); +static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw(); xmlNodePtr GetNodePtr() { return m_aNodePtr; } diff --git a/unoxml/source/dom/element.cxx b/unoxml/source/dom/element.cxx index f7cae19fdbdc..6ed9ba1ebd1e 100644 --- a/unoxml/source/dom/element.cxx +++ b/unoxml/source/dom/element.cxx @@ -29,6 +29,7 @@ #include #include +#include #include #include "attr.hxx" @@ -472,7 +473,7 @@ namespace DOM } ::rtl::Reference const pCNode( -CNode::GetImplementation(Reference(oldAttr.get(; + comphelper::getUnoTunnelImplementation(Reference(oldAttr.get(; if (!pCNode.is()) { throw RuntimeException(); } xmlNodePtr const pNode = pCNode->GetNodePtr(); @@ -532,7 +533,7 @@ namespace DOM // get the implementation CAttr *const pCAttr = dynamic_cast( -CNode::GetImplementation(xNewAttr)); +comphelper::getUnoTunnelImplementation(xNewAttr)); if (!pCAttr) { throw RuntimeException(); } xmlAttrPtr const pAttr = reinterpret_cast(pCAttr->GetNodePtr()); diff --git a/unoxml/source/dom/node.cxx b/unoxml/source/dom/node.cxx index f486182eca83..7171e6c2f791 100644 --- a/unoxml/source/dom/node.cxx +++ b/unoxml/source/dom/node.cxx @@ -168,15 +168,9 @@ namespace DOM } } -CNode * -CNode::GetImplementation(uno::Reference const& xNode) +const css::uno::Sequence< sal_Int8 > & CNode::getUnoTunnelId() throw() { -uno::Reference const xUnoTunnel(xNode, UNO_QUERY); -if (!xUnoTunnel.is()) { return nullptr; } -CNode *const pCNode( reinterpret_cast< CNode* >( -::sal::static_int_cast< sal_IntPtr >( - xUnoTunnel->getSomething(theCNodeUnoTunnelId::get().getSeq(); -return pCNode; +return theCNodeUnoTunnelId::get().getSeq(); } CDocument & CNode::GetOwnerDocument() @@ -290,7 +284,7 @@ namespace DOM if (nullptr == m_aNodePtr) { return nullptr; } -CNode *const pNewChild(CNode::GetImplementation(xNewChild)); +CNode *const pNewChild(comphelper::getUnoTunnelImplementation(xNewChild)); if (!pNewChild) { throw RuntimeException(); } xmlNodePtr const cur = pNewChild->GetNodePtr(); if (!cur) { throw RuntimeException(); } @@ -645,8 +639,8 @@ namespace DOM ::osl::ClearableMutexGuard guard(m_rMutex); -CNode *const pNewNode(CNode::GetImplementation(newChild)); -CNode *const pRefNode(CNode::GetImplementation(refChild)); +CNode *const pNewNode(comphelper::getUnoTunnelImplementation(newChild)); +CNode *const pRefNode(comphelper::getUnoTunnelImplementation(refChild)); if (!pNewNode || !pRefNode) { throw RuntimeException(); } xmlNodePtr const pNewChild(pNewNode->GetNodePtr()); xmlNodePtr const pRefChild(pRefNode->GetNodePtr()); @@ -753,7 +747,7 @@ namespace DOM Reference xReturn( xOldChild ); -::rtl::Reference const pOld(CNode::GetImplementation(xOldChild)); +::rtl::Reference const pOld(comphelper::getUnoTunnelImplementation(xOldChild)); if (!pOld.is()) { throw RuntimeException(); } xmlNodePtr const old = pOld->GetNodePtr(); if (!old) { throw RuntimeException(); } @@ -825,9 +819,9 @@ namespace DOM ::osl::ClearableMutexGuard guard(m_rMutex); ::rtl::Reference const pOldNode( -CNode::GetImplementation(xOldChild)); +comphelper::getUnoTunnelImplementation(xOldChild)); ::rtl::Reference const pNewNode( -CNode::GetImplementation(xNewChild)); +comphelper::getUnoTunnelImplementation(xNewChild)); if (!pOldNode.is() || !pNewNode.is()) { throw RuntimeException(); } xmlNodePtr const pOld =
[Libreoffice-commits] core.git: vcl/qa vcl/source vcl/unx vcl/workben
vcl/qa/cppunit/canvasbitmaptest.cxx | 46 - vcl/source/components/fontident.cxx |6 -- vcl/source/control/edit.cxx | 18 ++-- vcl/source/filter/FilterConfigCache.cxx |4 - vcl/source/filter/FilterConfigItem.cxx | 39 ++ vcl/source/filter/graphicfilter.cxx | 32 +++--- vcl/source/filter/jpeg/JpegWriter.cxx |9 +--- vcl/source/filter/png/pngwrite.cxx | 15 +++ vcl/source/filter/wmf/wmfexternal.cxx | 10 ++-- vcl/source/font/fontmetric.cxx | 10 +--- vcl/source/gdi/configsettings.cxx | 14 ++ vcl/source/gdi/print3.cxx | 49 -- vcl/source/graphic/UnoGraphic.cxx |3 - vcl/source/graphic/UnoGraphicProvider.cxx | 60 +++- vcl/source/helper/canvasbitmap.cxx | 56 +- vcl/source/helper/canvastools.cxx | 34 ++- vcl/source/helper/commandinfoprovider.cxx | 47 + vcl/source/uitest/logger.cxx|7 --- vcl/source/uitest/uitest.cxx|6 -- vcl/source/uitest/uno/uiobject_uno.cxx |6 +- vcl/source/window/printdlg.cxx | 15 +++ vcl/unx/generic/dtrans/X11_selection.cxx| 21 +++-- vcl/unx/generic/dtrans/X11_transferable.cxx | 11 ++--- vcl/unx/gtk/a11y/atkaction.cxx | 18 vcl/unx/gtk/a11y/atktable.cxx |4 - vcl/unx/gtk/a11y/atktextattributes.cxx | 14 ++ vcl/unx/gtk/a11y/atkwrapper.cxx | 11 ++--- vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx| 40 ++ vcl/unx/gtk/salprn-gtk.cxx | 15 +++ vcl/unx/gtk3/gtk3gtkinst.cxx|4 - vcl/workben/vcldemo.cxx |8 +-- 31 files changed, 270 insertions(+), 362 deletions(-) New commits: commit 452a8e4abe0c416d664078baddff67c1561025ec Author: Arkadiy Illarionov AuthorDate: Sat Jun 15 17:13:48 2019 +0300 Commit: Noel Grandin CommitDate: Tue Jun 18 09:43:08 2019 +0200 Simplify Sequence iterations in vcl Use range-based loops or replace with comphelper or STL functions Change-Id: If046738084c2d13cc1eaea6a03aaf60b63f62767 Reviewed-on: https://gerrit.libreoffice.org/74104 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/vcl/qa/cppunit/canvasbitmaptest.cxx b/vcl/qa/cppunit/canvasbitmaptest.cxx index 070b8b6217a4..cf7a82c653ad 100644 --- a/vcl/qa/cppunit/canvasbitmaptest.cxx +++ b/vcl/qa/cppunit/canvasbitmaptest.cxx @@ -482,15 +482,13 @@ private: virtual uno::Sequence< rendering::RGBColor > SAL_CALL convertIntegerToRGB( const uno::Sequence< ::sal_Int8 >& deviceColor ) override { const uno::Sequence< rendering::ARGBColor > aTemp( convertIntegerToARGB(deviceColor) ); -const std::size_t nLen(aTemp.getLength()); -uno::Sequence< rendering::RGBColor > aRes( nLen ); -rendering::RGBColor* pOut = aRes.getArray(); -for( std::size_t i=0; i aRes( aTemp.getLength() ); +std::transform(aTemp.begin(), aTemp.end(), aRes.begin(), +[](const rendering::ARGBColor& rColor) { +return rendering::RGBColor(rColor.Red, + rColor.Green, + rColor.Blue); +}); return aRes; } @@ -503,21 +501,18 @@ private: 0, static_cast(nLen%nBytesPerPixel)); uno::Sequence< rendering::ARGBColor > aRes( nLen / nBytesPerPixel ); -rendering::ARGBColor* pOut( aRes.getArray() ); if( getPalette().is() ) { -for( std::size_t i=0; i(nLen%nBytesPerPixel)); uno::Sequence< rendering::ARGBColor > aRes( nLen / nBytesPerPixel ); -rendering::ARGBColor* pOut( aRes.getArray() ); if( getPalette().is() ) { -for( std::size_t i=0; i& i_rArgs ) if( !ImplGetSVData() ) return; // VCL not initialized -sal_uInt32 nArgs = i_rArgs.getLength(); -const Any* pArgs = i_rArgs.getConstArray(); Sequence< sal_Int8 > aFontBuf; -for( sal_uInt32 i = 0; i < nArgs; i++ ) +for( const auto& rArg : i_rArgs ) { -if( pArgs[i] >>= aFontBuf ) +if( rArg >>= aFontBuf ) { m_aFont = Font::identifyFont( aFontBuf.getConstArray(), aFontBuf.getLength() ); break; diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index a1b1af252dc5..57d037546c5f 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -2924,18 +2924,12 @@ void Edit::dragEnter( const css::datatransfer::dnd::DropTargetDragEnterEvent& rD } // search for string data type const Sequence< css::datatransfer::DataFlavor >& rFlavors( rDTDE.SupportedDataFlavors
[Libreoffice-commits] core.git: basctl/source chart2/source dbaccess/source drawinglayer/source editeng/source extensions/source filter/source forms/source framework/source include/comphelper oox/sour
basctl/source/basicide/basicrenderable.cxx |2 chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx |2 chart2/source/controller/main/ChartController.cxx |2 chart2/source/controller/main/ChartController_Window.cxx|2 chart2/source/tools/NumberFormatterWrapper.cxx |2 chart2/source/view/axes/VCartesianAxis.cxx |2 chart2/source/view/charttypes/BarChart.cxx |2 chart2/source/view/main/ChartView.cxx |4 - dbaccess/source/ui/browser/brwview.cxx |2 dbaccess/source/ui/browser/genericcontroller.cxx|2 dbaccess/source/ui/browser/sbagrid.cxx |2 dbaccess/source/ui/control/FieldDescControl.cxx |2 dbaccess/source/ui/misc/TokenWriter.cxx |2 dbaccess/source/ui/uno/ColumnControl.cxx|2 drawinglayer/source/primitive2d/controlprimitive2d.cxx |2 editeng/source/uno/unofield.cxx |2 editeng/source/uno/unonrule.cxx |6 - editeng/source/uno/unotext.cxx | 29 +++-- editeng/source/uno/unotext2.cxx |2 extensions/source/bibliography/bibload.cxx |2 extensions/source/propctrlr/propcontroller.cxx |2 filter/source/msfilter/eschesdo.cxx |4 - filter/source/svg/svgexport.cxx |8 +- filter/source/svg/svgfilter.cxx |2 forms/source/richtext/richtextcontrol.cxx |2 forms/source/solar/component/navbarcontrol.cxx |2 framework/source/layoutmanager/layoutmanager.cxx|4 - framework/source/uielement/controlmenucontroller.cxx|8 +- framework/source/uielement/fontmenucontroller.cxx |2 framework/source/uielement/fontsizemenucontroller.cxx |4 - framework/source/uielement/headermenucontroller.cxx |2 framework/source/uielement/langselectionmenucontroller.cxx |2 framework/source/uielement/macrosmenucontroller.cxx |2 framework/source/uielement/newmenucontroller.cxx|6 - framework/source/uielement/objectmenucontroller.cxx |2 framework/source/uielement/popuptoolbarcontroller.cxx |4 - framework/source/uielement/recentfilesmenucontroller.cxx|2 framework/source/uielement/resourcemenucontroller.cxx |8 +- framework/source/uielement/thesaurusmenucontroller.cxx |2 framework/source/uielement/toolbarmodemenucontroller.cxx|4 - framework/source/uielement/toolbarsmenucontroller.cxx |8 +- include/comphelper/servicehelper.hxx| 27 +--- oox/source/drawingml/shape.cxx |4 - oox/source/export/chartexport.cxx |2 reportdesign/source/core/api/Shape.cxx |2 reportdesign/source/core/sdr/RptObject.cxx |2 reportdesign/source/core/sdr/RptPage.cxx|2 reportdesign/source/core/sdr/UndoActions.cxx|2 reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx |6 - reportdesign/source/ui/misc/RptUndo.cxx |2 reportdesign/source/ui/report/ReportSection.cxx |4 - reportdesign/source/ui/report/ViewsWindow.cxx |2 sc/source/filter/xml/XMLTableShapeImportHelper.cxx |4 - sc/source/filter/xml/xmlexprt.cxx |8 +- sc/source/filter/xml/xmlstyli.cxx |4 - sc/source/filter/xml/xmlwrap.cxx|2 sc/source/ui/Accessibility/AccessibleDocument.cxx |2 sc/source/ui/app/transobj.cxx |4 - sc/source/ui/unoobj/afmtuno.cxx |2 sc/source/ui/unoobj/cellsuno.cxx| 38 ++-- sc/source/ui/unoobj/docuno.cxx | 16 ++--- sc/source/ui/unoobj/funcuno.cxx |2 sc/source/ui/unoobj/shapeuno.cxx| 12 +-- sc/source/ui/unoobj/styleuno.cxx|2 sc/source/ui/unoobj/textuno.cxx |6 - sc/source/ui/unoobj/viewuno.cxx |8 +- sc/source/ui/vba/excelvbahelper.cxx |2 sc/source/ui/vba/vbaeventshelper.cxx|4 - sc/source/ui/vba/vbaformat.cxx |2 sc/source/ui/vba/vbarange.cxx |8 +- sc/source/ui/vba/vbasheetobject.cxx |4 - sc/source/ui/view/drawview.cxx
[Libreoffice-commits] core.git: writerfilter/source writerperfect/qa writerperfect/source xmlhelp/source
writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 40 ++--- writerfilter/source/dmapper/DomainMapper_Impl.cxx| 109 ++- writerfilter/source/dmapper/GraphicImport.cxx| 16 -- writerfilter/source/dmapper/NumberingManager.cxx | 25 +-- writerfilter/source/dmapper/PropertyMap.cxx | 24 +-- writerfilter/source/dmapper/StyleSheetTable.cxx | 19 +- writerfilter/source/dmapper/ThemeTable.cxx |8 - writerfilter/source/ooxml/OOXMLDocumentImpl.cxx | 15 -- writerfilter/source/ooxml/OOXMLStreamImpl.cxx| 15 -- writerperfect/qa/unit/WpftLoader.cxx | 17 +- writerperfect/source/calc/MSWorksCalcImportFilter.cxx| 20 +- writerperfect/source/common/WPXSvInputStream.cxx |8 - writerperfect/source/writer/EPUBExportFilter.cxx | 24 +-- writerperfect/source/writer/WordPerfectImportFilter.cxx | 12 - writerperfect/source/writer/exp/xmlimp.cxx | 61 +++- xmlhelp/source/cxxhelp/provider/content.cxx | 19 +- xmlhelp/source/cxxhelp/provider/databases.cxx| 26 +-- xmlhelp/source/cxxhelp/provider/resultsetbase.cxx| 13 - xmlhelp/source/treeview/tvfactory.cxx|4 xmlhelp/source/treeview/tvread.cxx | 26 +-- 20 files changed, 212 insertions(+), 289 deletions(-) New commits: commit 54afdbd1b442d93313a01e58dba8fe3b84f596d1 Author: Arkadiy Illarionov AuthorDate: Wed Jun 12 11:21:20 2019 +0300 Commit: Noel Grandin CommitDate: Thu Jun 13 19:43:13 2019 +0200 Simplify Sequence iterations in writerfilter, writerperfect, xmlhelp Use range-based loops or replace with comphelper or STL functions Change-Id: I9113e04d15ad84d0abac087afc627969e8ebc354 Reviewed-on: https://gerrit.libreoffice.org/73867 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index 0844050c37a7..27a710f5a0b6 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -889,7 +889,7 @@ static bool lcl_emptyRow(std::vector& rTableRanges, sal_Int32 nRo } RowSequence_t rRowSeq = rTableRanges[nRow]; -if (rRowSeq.getLength() == 0) +if (!rRowSeq.hasElements()) { SAL_WARN("writerfilter.dmapper", "m_aCellProperties not in sync with rTableRanges?"); return false; @@ -906,12 +906,14 @@ static bool lcl_emptyRow(std::vector& rTableRanges, sal_Int32 nRo uno::Reference xTextRangeCompare(rRowSeq[0][0]->getText(), uno::UNO_QUERY); try { -for (sal_Int32 nCell = 0; nCell < rRowSeq.getLength(); ++nCell) -// See SwXText::Impl::ConvertCell(), we need to compare the start of -// the start and the end of the end. However for our text ranges, only -// the starts are set, so compareRegionStarts() does what we need. -if (xTextRangeCompare->compareRegionStarts(rRowSeq[nCell][0], rRowSeq[nCell][1]) != 0) -return false; +// See SwXText::Impl::ConvertCell(), we need to compare the start of +// the start and the end of the end. However for our text ranges, only +// the starts are set, so compareRegionStarts() does what we need. +bool bRangesAreNotEqual = std::any_of(rRowSeq.begin(), rRowSeq.end(), +[](const CellSequence_t& rCellSeq) { +return xTextRangeCompare->compareRegionStarts(rCellSeq[0], rCellSeq[1]) != 0; }); +if (bRangesAreNotEqual) +return false; } catch (const lang::IllegalArgumentException& e) { @@ -1083,21 +1085,19 @@ void DomainMapperTableHandler::endTable(unsigned int nestedTableLevel, bool bTab } // OOXML table style may container paragraph properties, apply these now. -for (int i = 0; i < aTableInfo.aTableProperties.getLength(); ++i) +auto pTableProp = std::find_if(aTableInfo.aTableProperties.begin(), aTableInfo.aTableProperties.end(), +[](const beans::PropertyValue& rProp) { return rProp.Name == "ParaBottomMargin"; }); +if (pTableProp != aTableInfo.aTableProperties.end()) { -if (aTableInfo.aTableProperties[i].Name == "ParaBottomMargin") +uno::Reference xCellRange(xTable, uno::UNO_QUERY); +uno::Any aBottomMargin = pTableProp->Value; +sal_Int32 nRows = aCellProperties.getLength(); +for (sal_Int32 nRow = 0; nRow < nRows; ++nRow) { -uno::Reference xCellRange(xTable, uno::UNO_QUERY); -uno::Any aBottomMargin = aTableInfo.aTableProperties[i].Value; -
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/chart/SchXMLChartContext.cxx | 18 -- xmloff/source/chart/SchXMLExport.cxx | 154 ++- xmloff/source/chart/SchXMLImport.cxx | 20 -- xmloff/source/chart/SchXMLSeries2Context.cxx |7 xmloff/source/chart/SchXMLSeriesHelper.cxx | 25 --- xmloff/source/chart/SchXMLTableContext.cxx | 20 +- xmloff/source/chart/SchXMLTools.cxx |5 xmloff/source/core/DocumentSettingsContext.cxx |5 xmloff/source/core/PropertySetMerger.cxx |7 xmloff/source/core/SettingsExportHelper.cxx | 36 +--- xmloff/source/core/XMLEmbeddedObjectExportFilter.cxx | 11 - xmloff/source/core/xmlexp.cxx| 57 +-- xmloff/source/core/xmlictxt.cxx |7 xmloff/source/core/xmlimp.cxx|7 xmloff/source/core/xmluconv.cxx | 21 +- 15 files changed, 144 insertions(+), 256 deletions(-) New commits: commit 9a18e4e0bfee4d29ee02258c70cc9edf4e7b086b Author: Arkadiy Illarionov AuthorDate: Sun May 12 16:51:02 2019 +0300 Commit: Noel Grandin CommitDate: Thu Jun 13 09:18:42 2019 +0200 Simplify Sequence iterations in xmloff/source/{chart..core} Use range-based loops or replace with comphelper or STL functions Change-Id: I131b77ad7d68897fcfe07284edcf38397589278f Reviewed-on: https://gerrit.libreoffice.org/72192 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx index 7c3d355f9c64..6cc3a29a7828 100644 --- a/xmloff/source/chart/SchXMLChartContext.cxx +++ b/xmloff/source/chart/SchXMLChartContext.cxx @@ -963,19 +963,17 @@ void SchXMLChartContext::MergeSeriesForStockChart() uno::Reference< chart2::XDataSeriesContainer > xDSContainer; uno::Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( xDiagram, uno::UNO_QUERY_THROW ); uno::Sequence< uno::Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems()); -for( sal_Int32 nCooSysIdx=0; nCooSysIdx xCTCnt( aCooSysSeq[nCooSysIdx], uno::UNO_QUERY_THROW ); +uno::Reference< chart2::XChartTypeContainer > xCTCnt( rCooSys, uno::UNO_QUERY_THROW ); uno::Sequence< uno::Reference< chart2::XChartType > > aChartTypes( xCTCnt->getChartTypes()); -for( sal_Int32 nCTIdx=0; nCTIdxgetChartType() == "com.sun.star.chart2.CandleStickChartType"; }); +if (pChartType != aChartTypes.end()) { -if( aChartTypes[nCTIdx]->getChartType() == "com.sun.star.chart2.CandleStickChartType" ) -{ -xDSContainer.set( aChartTypes[nCTIdx], uno::UNO_QUERY_THROW ); -uno::Reference< beans::XPropertySet > xCTProp( aChartTypes[nCTIdx], uno::UNO_QUERY_THROW ); -xCTProp->getPropertyValue("Japanese") >>= bHasJapaneseCandlestick; -break; -} +xDSContainer.set( *pChartType, uno::UNO_QUERY_THROW ); +uno::Reference< beans::XPropertySet > xCTProp( *pChartType, uno::UNO_QUERY_THROW ); +xCTProp->getPropertyValue("Japanese") >>= bHasJapaneseCandlestick; } } diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index 6507cb91b926..b1785d5330f4 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -53,6 +53,7 @@ #include #include #include +#include #include #include @@ -320,9 +321,9 @@ Reference< chart2::data::XLabeledDataSequence > lcl_getCategories( const Referen xDiagram, uno::UNO_QUERY_THROW ); Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems()); -for( sal_Int32 i=0; i xCooSys( aCooSysSeq[i] ); +Reference< chart2::XCoordinateSystem > xCooSys( rCooSys ); SAL_WARN_IF( !xCooSys.is(), "xmloff.chart", "xCooSys is NULL" ); for( sal_Int32 nN = xCooSys->getDimension(); nN--; ) { @@ -426,11 +427,8 @@ Reference< chart2::data::XDataSource > lcl_pressUsedDataIntoRectangularFormat( c //add all other sequences now without x-values lcl_MatchesRole aHasXValues( "values-x" ); -for( sal_Int32 nN=0; nN > aSeq( comphelper::containerToSequence(aLabeledSeqVector) ); @@ -516,13 +514,13 @@ OUString lcl_flattenStringSequence( const Sequence< OUString > & rSequence ) { OUStringBuffer aResult; bool bPrecedeWithSpace = false; -for( sal_Int32 nIndex=0; nIndex lcl_DataSequenceToStringSequence( if( aRole.match("values-x") ) { //lcl_clearIfNoValuesButTextIsContained - replace by indices if the values are not appropriate -bool bHasValue=false; -
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/draw/SignatureLineContext.cxx| 57 - xmloff/source/draw/XMLImageMapExport.cxx |5 xmloff/source/draw/animationexport.cxx | 128 - xmloff/source/draw/sdxmlexp.cxx| 16 +- xmloff/source/draw/sdxmlimp.cxx| 44 ++- xmloff/source/draw/shapeexport.cxx | 108 +++-- xmloff/source/draw/ximpcustomshape.cxx | 17 +- xmloff/source/draw/ximpshap.cxx| 12 - xmloff/source/forms/elementexport.cxx | 10 - xmloff/source/forms/elementimport.cxx | 33 + xmloff/source/forms/eventexport.cxx| 19 +-- xmloff/source/forms/propertyexport.cxx | 11 - xmloff/source/meta/xmlmetae.cxx| 30 ++-- xmloff/source/meta/xmlversion.cxx |3 xmloff/source/script/XMLEventExport.cxx| 72 +-- xmloff/source/script/XMLScriptExportHandler.cxx|7 - xmloff/source/script/XMLStarBasicExportHandler.cxx | 11 - 17 files changed, 246 insertions(+), 337 deletions(-) New commits: commit e1011ee3ee92ab043f0de547ec870ed87153e983 Author: Arkadiy Illarionov AuthorDate: Sun May 12 16:34:32 2019 +0300 Commit: Noel Grandin CommitDate: Wed Jun 12 14:34:34 2019 +0200 Simplify Sequence iterations in xmloff/source/{draw..script} Use range-based loops or replace with comphelper or STL functions Change-Id: I1d25ad2badccff476f3221829e8f1caf22ad3975 Reviewed-on: https://gerrit.libreoffice.org/72191 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmloff/source/draw/SignatureLineContext.cxx b/xmloff/source/draw/SignatureLineContext.cxx index c95dfc8c72da..880d613e3f3f 100644 --- a/xmloff/source/draw/SignatureLineContext.cxx +++ b/xmloff/source/draw/SignatureLineContext.cxx @@ -82,37 +82,38 @@ SignatureLineContext::SignatureLineContext(SvXMLImport& rImport, sal_uInt16 nPrf Sequence xSignatureInfo = xSignatures->verifyDocumentContentSignatures(xStorage, Reference()); -for (int i = 0; i < xSignatureInfo.getLength(); i++) +// Try to find matching signature line image - if none exists that is fine, +// then the signature line is not digitally signed. +auto pSignatureInfo = std::find_if( +xSignatureInfo.begin(), xSignatureInfo.end(), +[](const DocumentSignatureInformation& rSignatureInfo) { +return rSignatureInfo.SignatureLineId == xAttrList->getValueByName("loext:id"); +}); +if (pSignatureInfo != xSignatureInfo.end()) { -// Try to find matching signature line image - if none exists that is fine, -// then the signature line is not digitally signed. -if (xSignatureInfo[i].SignatureLineId == xAttrList->getValueByName("loext:id")) +bIsSigned = true; +if (pSignatureInfo->SignatureIsValid) { -bIsSigned = true; -if (xSignatureInfo[i].SignatureIsValid) -{ -// Signature is valid, use the 'valid' image - SAL_WARN_IF(!xSignatureInfo[i].ValidSignatureLineImage.is(), "xmloff", -"No ValidSignatureLineImage!"); -xGraphic = xSignatureInfo[i].ValidSignatureLineImage; -} -else -{ -// Signature is invalid, use the 'invalid' image - SAL_WARN_IF(!xSignatureInfo[i].InvalidSignatureLineImage.is(), "xmloff", -"No InvalidSignatureLineImage!"); -xGraphic = xSignatureInfo[i].InvalidSignatureLineImage; -} - -// Save unsigned graphic -Reference xUnsignedGraphic; -xPropSet->getPropertyValue("Graphic") >>= xUnsignedGraphic; -if (xUnsignedGraphic.is()) -xPropSet->setPropertyValue("SignatureLineUnsignedImage", Any(xUnsignedGraphic)); - -xPropSet->setPropertyValue("Graphic", Any(xGraphic)); -break; +// Signature is valid, use the 'valid' image +SAL_WARN_IF(!pSignatureInfo->ValidSignatureLineImage.is(), "xmloff", +"No ValidSignatureLineImage!"); +xGraphic = pSignatureInfo->ValidSignatureLineImage; } +else +{ +// Signature is invalid, use the 'invalid' image +SAL_WARN_IF(!pSignatureInfo->InvalidSignatureLineImage.is(), "xmloff", +"No InvalidSignatureLineImage!"); +xGraphic = pSignatureInfo->InvalidSignatureLineImage; +} + +// Save unsigned graphic +Reference xUnsignedGraphic; +
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/style/AttributeContainerHandler.cxx | 13 -- xmloff/source/style/XMLPageExport.cxx |6 xmloff/source/style/styleexp.cxx| 14 -- xmloff/source/style/tabsthdl.cxx| 32 + xmloff/source/style/xmlexppr.cxx| 28 +--- xmloff/source/style/xmlimppr.cxx| 45 +++ xmloff/source/style/xmlnume.cxx |6 xmloff/source/style/xmlnumfe.cxx| 20 --- xmloff/source/style/xmltabe.cxx |9 - xmloff/source/table/XMLTableExport.cxx | 17 +- xmloff/source/table/XMLTableImport.cxx | 12 - xmloff/source/text/XMLAutoTextEventImport.cxx |9 - xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx | 22 --- xmloff/source/text/XMLRedlineExport.cxx | 21 +-- xmloff/source/text/XMLSectionExport.cxx | 62 +++--- xmloff/source/text/XMLTextCharStyleNamesElementExport.cxx |7 - xmloff/source/text/XMLTextColumnsExport.cxx | 10 - xmloff/source/text/XMLTextNumRuleInfo.cxx | 14 -- xmloff/source/text/txtflde.cxx | 57 ++--- xmloff/source/text/txtfldi.cxx | 17 +- xmloff/source/text/txtimp.cxx | 16 +- xmloff/source/text/txtprhdl.cxx | 24 --- xmloff/source/transform/OOo2Oasis.cxx |3 xmloff/source/transform/TransformerBase.cxx | 17 +- xmloff/source/xforms/xformsapi.cxx |9 - xmloff/source/xforms/xformsexport.cxx | 19 --- 26 files changed, 177 insertions(+), 332 deletions(-) New commits: commit 79d58ee14da8fbf636fb087453834abb7173d3fc Author: Arkadiy Illarionov AuthorDate: Sun May 12 16:07:58 2019 +0300 Commit: Noel Grandin CommitDate: Tue Jun 11 20:32:49 2019 +0200 Simplify Sequence iterations in xmloff/source/{style..xforms} Use range-based loops or replace with comphelper or STL functions Change-Id: Ie268d80b9c01d38c745c14a81c219d9930860562 Reviewed-on: https://gerrit.libreoffice.org/72189 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmloff/source/style/AttributeContainerHandler.cxx b/xmloff/source/style/AttributeContainerHandler.cxx index 2c6a1857dd9b..5db11689e28d 100644 --- a/xmloff/source/style/AttributeContainerHandler.cxx +++ b/xmloff/source/style/AttributeContainerHandler.cxx @@ -49,22 +49,19 @@ bool XMLAttributeContainerHandler::equals( { uno::Sequence< OUString > aAttribNames1( xContainer1->getElementNames() ); uno::Sequence< OUString > aAttribNames2( xContainer2->getElementNames() ); -const sal_Int32 nCount = aAttribNames1.getLength(); -if( aAttribNames2.getLength() == nCount ) +if( aAttribNames1.getLength() == aAttribNames2.getLength() ) { -const OUString* pAttribName = aAttribNames1.getConstArray(); - xml::AttributeData aData1; xml::AttributeData aData2; -for( sal_Int32 i=0; i < nCount; i++, pAttribName++ ) +for( const OUString& rAttribName : aAttribNames1 ) { -if( !xContainer2->hasByName( *pAttribName ) ) +if( !xContainer2->hasByName( rAttribName ) ) return false; -xContainer1->getByName( *pAttribName ) >>= aData1; -xContainer2->getByName( *pAttribName ) >>= aData2; +xContainer1->getByName( rAttribName ) >>= aData1; +xContainer2->getByName( rAttribName ) >>= aData2; if( ( aData1.Namespace != aData2.Namespace ) || ( aData1.Type != aData2.Type ) || diff --git a/xmloff/source/style/XMLPageExport.cxx b/xmloff/source/style/XMLPageExport.cxx index c5f3efe60c46..64c7645e4980 100644 --- a/xmloff/source/style/XMLPageExport.cxx +++ b/xmloff/source/style/XMLPageExport.cxx @@ -200,11 +200,9 @@ void XMLPageExport::exportStyles( bool bUsed, bool bAutoStyles ) if( xPageStyles.is() ) { uno::Sequence< OUString> aSeq = xPageStyles->getElementNames(); -const OUString* pIter = aSeq.getConstArray(); -const OUString* pEnd = pIter + aSeq.getLength(); -for(;pIter != pEnd;++pIter) +for(const auto& rName : aSeq) { -Reference< XStyle > xStyle(xPageStyles->getByName( *pIter ),uno::UNO_QUERY); +Reference< XStyle > xStyle(xPageStyles->getByName( rName ),uno::UNO_QUERY); if( !bUsed || xStyle->isInUse() ) exportStyle( xStyle,
[Libreoffice-commits] core.git: accessibility/source basctl/source basic/qa basic/source binaryurp/source canvas/source
accessibility/source/extended/textwindowaccessibility.cxx |2 +- accessibility/source/helper/characterattributeshelper.cxx |2 +- basctl/source/basicide/baside2b.cxx |4 ++-- basctl/source/basicide/baside3.cxx|3 +-- basctl/source/basicide/localizationmgr.cxx| 10 +- basctl/source/basicide/moduldlg.cxx |6 +++--- basctl/source/dlged/dlged.cxx |2 +- basctl/source/dlged/propbrw.cxx |2 +- basic/qa/cppunit/basictest.cxx|2 +- basic/source/classes/sbunoobj.cxx |4 ++-- basic/source/classes/sbxmod.cxx |4 ++-- basic/source/runtime/methods.cxx |7 +++ binaryurp/source/reader.cxx |2 +- canvas/source/cairo/cairo_canvas.cxx |2 +- canvas/source/cairo/cairo_canvashelper.cxx|4 ++-- canvas/source/cairo/cairo_spritecanvas.cxx|2 +- canvas/source/cairo/cairo_textlayout.cxx | 12 ++-- canvas/source/opengl/ogl_canvashelper.cxx |4 ++-- canvas/source/opengl/ogl_spritecanvas.cxx |2 +- canvas/source/opengl/ogl_textlayout.cxx |2 +- canvas/source/simplecanvas/simplecanvasimpl.cxx |2 +- canvas/source/tools/canvastools.cxx |2 +- canvas/source/vcl/canvas.cxx |2 +- canvas/source/vcl/canvashelper.cxx|2 +- canvas/source/vcl/canvashelper_texturefill.cxx|4 ++-- canvas/source/vcl/spritecanvas.cxx|4 ++-- canvas/source/vcl/textlayout.cxx |4 ++-- 27 files changed, 48 insertions(+), 50 deletions(-) New commits: commit c88f76035cd1d088cc06067270677618340fd839 Author: Arkadiy Illarionov AuthorDate: Sat May 4 23:42:17 2019 +0300 Commit: Noel Grandin CommitDate: Tue Jun 11 20:24:40 2019 +0200 Use hasElements to check Sequence emptiness in accessibility..canvas Similar to clang-tidy readability-container-size-empty Change-Id: I24c3f04b4eed3c1cd973166885660f113a26844f Reviewed-on: https://gerrit.libreoffice.org/71805 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx index 3cebc2ba295e..63ea654a3728 100644 --- a/accessibility/source/extended/textwindowaccessibility.cxx +++ b/accessibility/source/extended/textwindowaccessibility.cxx @@ -1080,7 +1080,7 @@ void Document::retrieveRunAttributesImpl( aPropVal.State = css::beans::PropertyState_DIRECT_VALUE; aRunAttrSeq[ aPropVal.Name ] = aPropVal; } -if ( RequestedAttributes.getLength() == 0 ) +if ( !RequestedAttributes.hasElements() ) { rRunAttrSeq = aRunAttrSeq; } diff --git a/accessibility/source/helper/characterattributeshelper.cxx b/accessibility/source/helper/characterattributeshelper.cxx index 4935c4865de5..9cbeaaee8a7c 100644 --- a/accessibility/source/helper/characterattributeshelper.cxx +++ b/accessibility/source/helper/characterattributeshelper.cxx @@ -59,7 +59,7 @@ std::vector< PropertyValue > CharacterAttributesHelper::GetCharacterAttributes() Sequence< PropertyValue > CharacterAttributesHelper::GetCharacterAttributes( const css::uno::Sequence< OUString >& aRequestedAttributes ) { -if ( aRequestedAttributes.getLength() == 0 ) +if ( !aRequestedAttributes.hasElements() ) return comphelper::containerToSequence(GetCharacterAttributes()); std::vector< PropertyValue > aValues; diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index df2b10ef5ab1..4421e78cb6ff 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -2897,7 +2897,7 @@ std::vector< OUString > UnoTypeCodeCompletetor::GetXIdlClassMethods() const if( bCanComplete && ( xClass != nullptr ) ) { Sequence< Reference< reflection::XIdlMethod > > aMethods = xClass->getMethods(); -if( aMethods.getLength() != 0 ) +if( aMethods.hasElements() ) { for(sal_Int32 l = 0; l < aMethods.getLength(); ++l) { @@ -2914,7 +2914,7 @@ std::vector< OUString > UnoTypeCodeCompletetor::GetXIdlClassFields() const if( bCanComplete && ( xClass != nullptr ) ) { Sequence< Reference< reflection::XIdlField > > aFields = xClass->getFields(); -if( aFields.getLength() != 0 ) +if( aFields.hasElements() ) { for(sal_Int32 l = 0; l < aFields.getLength(); ++l) { diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx index
[Libreoffice-commits] core.git: chart2/qa chart2/source comphelper/source configmgr/source connectivity/source
chart2/qa/extras/chart2export.cxx |4 - chart2/source/controller/accessibility/AccessibleChartView.cxx |2 chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx |2 chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx|4 - chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx | 10 ++-- chart2/source/controller/chartapiwrapper/TitleWrapper.cxx |2 chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx |6 +- chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx | 16 +++ chart2/source/controller/dialogs/DataBrowserModel.cxx |2 chart2/source/controller/dialogs/dlg_ObjectProperties.cxx |6 +- chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx |8 +-- chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx |4 - chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx |4 - chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx |4 - chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx |2 chart2/source/controller/main/ChartController.cxx |2 chart2/source/controller/main/ChartDropTargetHelper.cxx|2 chart2/source/controller/sidebar/ChartElementsPanel.cxx|4 - chart2/source/controller/sidebar/ChartSeriesPanel.cxx |2 chart2/source/model/filter/XMLFilter.cxx |2 chart2/source/model/main/Axis.cxx |2 chart2/source/model/main/ChartModel.cxx|2 chart2/source/model/main/ChartModel_Persistence.cxx|2 chart2/source/model/main/Diagram.cxx |2 chart2/source/model/template/ChartTypeTemplate.cxx | 22 +- chart2/source/model/template/ColumnLineChartTypeTemplate.cxx |2 chart2/source/model/template/DataInterpreter.cxx |4 - chart2/source/model/template/PieChartTypeTemplate.cxx |4 - chart2/source/model/template/StockChartTypeTemplate.cxx|8 +-- chart2/source/model/template/StockDataInterpreter.cxx |2 chart2/source/tools/AxisHelper.cxx |2 chart2/source/tools/CachedDataSequence.cxx |6 +- chart2/source/tools/ChartModelHelper.cxx |4 - chart2/source/tools/ConfigColorScheme.cxx |2 chart2/source/tools/DataSeriesHelper.cxx |8 +-- chart2/source/tools/DataSourceHelper.cxx |2 chart2/source/tools/DiagramHelper.cxx | 16 +++ chart2/source/tools/ExplicitCategoriesProvider.cxx |4 - chart2/source/tools/InternalDataProvider.cxx |2 chart2/source/tools/RegressionCurveHelper.cxx |4 - chart2/source/tools/TitleHelper.cxx|2 chart2/source/tools/WrappedPropertySet.cxx |6 +- chart2/source/view/axes/VCartesianGrid.cxx |4 - chart2/source/view/axes/VPolarGrid.cxx |2 chart2/source/view/charttypes/AreaChart.cxx|2 chart2/source/view/charttypes/CandleStickChart.cxx |2 chart2/source/view/charttypes/NetChart.cxx |2 chart2/source/view/charttypes/VSeriesPlotter.cxx |2 chart2/source/view/main/ChartView.cxx |6 +- chart2/source/view/main/Clipping.cxx |2 chart2/source/view/main/ShapeFactory.cxx | 16 +++ chart2/source/view/main/VDataSeries.cxx|6 +- chart2/source/view/main/VTitle.cxx |2 comphelper/source/compare/AnyCompareFactory.cxx|2 comphelper/source/container/enumerablemap.cxx |2 comphelper/source/misc/docpasswordhelper.cxx | 10 ++-- comphelper/source/misc/mimeconfighelper.cxx|6 +- comphelper/source/property/ChainablePropertySetInfo.cxx|2 comphelper/source/property/MasterPropertySetInfo.cxx |2 comphelper/source/xml/ofopxmlhelper.cxx|6 +- configmgr/source/access.cxx|2
[Libreoffice-commits] core.git: cppcanvas/source cppuhelper/source cui/source dbaccess/source desktop/source
cppcanvas/source/mtfrenderer/implrenderer.cxx| 18 +-- cppcanvas/source/mtfrenderer/polypolyaction.cxx |4 +- cppcanvas/source/mtfrenderer/textaction.cxx |4 +- cppuhelper/source/component_context.cxx |6 +-- cppuhelper/source/factory.cxx|4 +- cppuhelper/source/shlib.cxx |2 - cppuhelper/source/tdmgr.cxx |4 +- cppuhelper/source/typemanager.cxx|2 - cui/source/customize/SvxConfigPageHelper.cxx |2 - cui/source/customize/cfg.cxx |4 +- cui/source/dialogs/SignSignatureLineDialog.cxx |2 - cui/source/dialogs/SpellDialog.cxx |2 - cui/source/dialogs/hangulhanjadlg.cxx|2 - cui/source/dialogs/insdlg.cxx|2 - cui/source/dialogs/screenshotannotationdlg.cxx |2 - cui/source/dialogs/scriptdlg.cxx |2 - cui/source/dialogs/thesdlg.cxx |4 +- cui/source/options/cfgchart.cxx |2 - cui/source/options/optlingu.cxx | 16 - cui/source/options/treeopt.cxx |2 - dbaccess/source/core/api/FilteredContainer.cxx |4 +- dbaccess/source/core/api/RowSetCache.cxx |2 - dbaccess/source/core/api/SingleSelectQueryComposer.cxx |2 - dbaccess/source/core/dataaccess/ContentHelper.cxx|2 - dbaccess/source/core/dataaccess/databasecontext.cxx |2 - dbaccess/source/core/dataaccess/documentcontainer.cxx|6 +-- dbaccess/source/core/dataaccess/documentdefinition.cxx | 14 dbaccess/source/core/dataaccess/documentevents.cxx |2 - dbaccess/source/core/misc/DatabaseDataProvider.cxx |6 +-- dbaccess/source/filter/xml/xmlDataSourceSetting.cxx |2 - dbaccess/source/filter/xml/xmlExport.cxx | 10 +++--- dbaccess/source/filter/xml/xmlfilter.cxx |2 - dbaccess/source/ui/app/AppController.cxx |6 +-- dbaccess/source/ui/browser/exsrcbrw.cxx |2 - dbaccess/source/ui/browser/unodatbr.cxx |2 - dbaccess/source/ui/dlg/DbAdminImpl.cxx |2 - dbaccess/source/ui/dlg/tablespage.cxx|2 - dbaccess/source/ui/misc/DExport.cxx |2 - dbaccess/source/ui/misc/RowSetDrop.cxx |2 - dbaccess/source/ui/misc/TokenWriter.cxx |8 ++-- dbaccess/source/ui/misc/WCopyTable.cxx |4 +- dbaccess/source/ui/misc/linkeddocuments.cxx |2 - dbaccess/source/ui/querydesign/querycontroller.cxx |6 +-- dbaccess/source/ui/relationdesign/RTableConnectionData.cxx |2 - dbaccess/source/ui/tabledesign/TableController.cxx |2 - dbaccess/source/ui/uno/copytablewizard.cxx |6 +-- desktop/source/deployment/gui/dp_gui_dialog2.cxx |4 +- desktop/source/deployment/gui/dp_gui_updatedialog.cxx|6 +-- desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx |2 - desktop/source/deployment/manager/dp_informationprovider.cxx |2 - desktop/source/deployment/misc/dp_update.cxx |4 +- desktop/source/deployment/registry/package/dp_package.cxx|2 - desktop/source/lib/init.cxx |2 - desktop/source/migration/migration.cxx |2 - desktop/source/migration/services/oo3extensionmigration.cxx |2 - desktop/source/splash/splash.cxx |2 - 56 files changed, 108 insertions(+), 108 deletions(-) New commits: commit 2ed3d691b42525f6c1cc430d5863febcb102816e Author: Arkadiy Illarionov AuthorDate: Sat May 4 21:20:18 2019 +0300 Commit: Noel Grandin CommitDate: Wed Jun 5 19:24:57 2019 +0200 Use hasElements to check Sequence emptiness in cppcanvas..desktop Similar to clang-tidy readability-container-size-empty Change-Id: I81c0ff78d2ecc7d984e3ed5e5ce60efe327fc162 Reviewed-on: https://gerrit.libreoffice.org/71799 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index 241443aa39a9..5de65e350bc7 100644 --- a/cppcanvas/source/mtfrenderer/implrenderer.cxx +++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx @@ -392,8 +392,8 @@ namespace cppcanvas const OutDevState& rState( rParms.mrStates.getState() ); if(
[Libreoffice-commits] core.git: basctl/source chart2/source dbaccess/source drawinglayer/source extensions/source forms/source framework/source include/toolkit sc/source sd/source sfx2/source starmath
basctl/source/basicide/basicrenderable.cxx |2 chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx |2 chart2/source/controller/main/ChartController.cxx |2 chart2/source/controller/main/ChartController_Window.cxx|2 dbaccess/source/ui/browser/genericcontroller.cxx|2 dbaccess/source/ui/uno/ColumnControl.cxx|2 drawinglayer/source/primitive2d/controlprimitive2d.cxx |2 extensions/source/bibliography/bibload.cxx |2 extensions/source/propctrlr/propcontroller.cxx |2 forms/source/richtext/richtextcontrol.cxx |2 forms/source/solar/component/navbarcontrol.cxx |2 framework/source/layoutmanager/layoutmanager.cxx|4 - framework/source/uielement/controlmenucontroller.cxx|6 +- framework/source/uielement/fontmenucontroller.cxx |2 framework/source/uielement/fontsizemenucontroller.cxx |2 framework/source/uielement/headermenucontroller.cxx |2 framework/source/uielement/langselectionmenucontroller.cxx |2 framework/source/uielement/macrosmenucontroller.cxx |2 framework/source/uielement/newmenucontroller.cxx|6 +- framework/source/uielement/objectmenucontroller.cxx |2 framework/source/uielement/popuptoolbarcontroller.cxx |4 - framework/source/uielement/recentfilesmenucontroller.cxx|2 framework/source/uielement/resourcemenucontroller.cxx |8 +-- framework/source/uielement/thesaurusmenucontroller.cxx |2 framework/source/uielement/toolbarmodemenucontroller.cxx|4 - framework/source/uielement/toolbarsmenucontroller.cxx |8 +-- include/toolkit/awt/vclxbitmap.hxx |5 -- include/toolkit/awt/vclxdevice.hxx |5 -- include/toolkit/awt/vclxfont.hxx|5 -- include/toolkit/awt/vclxgraphics.hxx|5 -- include/toolkit/awt/vclxmenu.hxx|5 -- include/toolkit/awt/vclxpointer.hxx |5 -- include/toolkit/awt/vclxregion.hxx |5 -- include/toolkit/awt/vclxwindow.hxx |5 -- include/toolkit/helper/macros.hxx | 27 sc/source/ui/unoobj/docuno.cxx |2 sd/source/ui/unoidl/unomodel.cxx|2 sd/source/ui/view/DocumentRenderer.cxx |2 sfx2/source/control/dispatch.cxx|2 sfx2/source/doc/guisaveas.cxx |2 sfx2/source/notebookbar/NotebookbarTabControl.cxx |2 starmath/source/unomodel.cxx|2 svtools/source/hatchwindow/hatchwindow.cxx |2 svx/source/fmcomp/fmgridif.cxx |2 svx/source/mnuctrls/smarttagmenu.cxx|2 sw/source/core/view/printdata.cxx |2 sw/source/uibase/uno/unotxdoc.cxx |2 toolkit/source/awt/vclxbitmap.cxx |2 toolkit/source/awt/vclxdevice.cxx |2 toolkit/source/awt/vclxfont.cxx |2 toolkit/source/awt/vclxgraphics.cxx |4 - toolkit/source/awt/vclxmenu.cxx |5 -- toolkit/source/awt/vclxpointer.cxx |3 - toolkit/source/awt/vclxregion.cxx |2 toolkit/source/awt/vclxtoolkit.cxx |2 toolkit/source/awt/vclxtopwindow.cxx|2 toolkit/source/awt/vclxwindow.cxx | 24 -- toolkit/source/controls/stdtabcontroller.cxx|2 toolkit/source/controls/unocontrolmodel.cxx | 20 toolkit/source/helper/unowrapper.cxx|2 toolkit/source/helper/vclunohelper.cxx | 16 +++ 61 files changed, 108 insertions(+), 149 deletions(-) New commits: commit 32eeb405d7fd6788aaa34e1bf8a04388d7a3958f Author: Arkadiy Illarionov AuthorDate: Tue Jun 4 02:29:43 2019 +0300 Commit: Stephan Bergmann CommitDate: Tue Jun 4 09:06:43 2019 +0200 tdf#39593 remove IMPL_XUNOTUNNEL* macros Replace with UNO3_GETIMPLEMENTATION* macros. Replace single usage of IMPL_XUNOTUNNEL_MINIMAL with it's body. Change-Id: I7d4ad76399b999ebb2178ecf57edcf6bd2aa6c3e Reviewed-on: https://gerrit.libreoffice.org/73424 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/basctl/source/basicide/basicrenderable.cxx b/basctl/source/basicide/basicrenderable.cxx index
[Libreoffice-commits] core.git: dbaccess/source include/comphelper include/sfx2 include/svl include/svx include/xmloff sc/inc sc/source sfx2/source svl/source svx/source xmloff/inc xmloff/source xmlse
dbaccess/source/ui/browser/sbagrid.cxx| 29 --- dbaccess/source/ui/inc/sbagrid.hxx|5 include/comphelper/servicehelper.hxx |2 include/sfx2/asyncfunc.hxx|7 include/svl/numuno.hxx|7 include/svx/AccessibleShape.hxx |5 include/svx/fmgridif.hxx |5 include/xmloff/attrlist.hxx |6 include/xmloff/xmlexp.hxx |6 sc/inc/afmtuno.hxx|7 sc/inc/cellsuno.hxx | 12 - sc/inc/datauno.hxx|6 sc/inc/fielduno.hxx |6 sc/inc/fmtuno.hxx | 11 - sc/inc/srchuno.hxx|7 sc/inc/styleuno.hxx |7 sc/inc/textuno.hxx| 16 - sc/inc/viewuno.hxx|7 sc/source/ui/unoobj/afmtuno.cxx | 32 --- sc/source/ui/unoobj/cellsuno.cxx | 64 -- sc/source/ui/unoobj/datauno.cxx | 32 --- sc/source/ui/unoobj/fielduno.cxx | 32 --- sc/source/ui/unoobj/fmtuno.cxx| 63 -- sc/source/ui/unoobj/srchuno.cxx | 32 --- sc/source/ui/unoobj/styleuno.cxx | 31 --- sc/source/ui/unoobj/textuno.cxx | 94 -- sc/source/ui/unoobj/viewuno.cxx | 32 --- sfx2/source/control/asyncfunc.cxx | 35 --- svl/source/numbers/numuno.cxx | 36 --- svx/source/accessibility/AccessibleShape.cxx | 39 svx/source/fmcomp/fmgridif.cxx| 39 xmloff/inc/StyleMap.hxx |8 xmloff/source/core/attrlist.cxx | 36 --- xmloff/source/core/xmlexp.cxx | 36 --- xmloff/source/style/StyleMap.cxx | 39 xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx | 29 --- xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx |6 xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx | 27 -- xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.hxx |6 39 files changed, 66 insertions(+), 833 deletions(-) New commits: commit 09c657ebe69fe1c2516a10a4452996870f4237d2 Author: Arkadiy Illarionov AuthorDate: Sat Jun 1 20:50:37 2019 +0300 Commit: Stephan Bergmann CommitDate: Mon Jun 3 09:32:50 2019 +0200 tdf#39593 use UNO3_GETIMPLEMENTATION* macros Change-Id: I4e9af3b43a5baf19e100f42b3f37a2ade89ada5d Reviewed-on: https://gerrit.libreoffice.org/73320 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx index c41a4e395c67..0bf3e8a4fec8 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -71,7 +71,6 @@ #include #include #include -#include #include #include #include @@ -506,16 +505,6 @@ void SAL_CALL SbaXGridPeer::removeStatusListener(const Reference< css::frame::XS pCont->removeInterface(xControl); } -namespace -{ -class theSbaXGridPeerUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSbaXGridPeerUnoTunnelId > {}; -} - -const Sequence< sal_Int8 > & SbaXGridPeer::getUnoTunnelId() -{ -return theSbaXGridPeerUnoTunnelId::get().getSeq(); -} - Sequence< Type > SAL_CALL SbaXGridPeer::getTypes() { return comphelper::concatSequences( @@ -523,23 +512,7 @@ Sequence< Type > SAL_CALL SbaXGridPeer::getTypes() Sequence { cppu::UnoType::get() }); } -// return implementation specific data -sal_Int64 SAL_CALL SbaXGridPeer::getSomething( const Sequence< sal_Int8 > & rId ) -{ -if( rId.getLength() == 16 && 0 == memcmp( getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) ) -return reinterpret_cast< sal_Int64 >( this ); - -return FmXGridPeer::getSomething(rId); -} - -SbaXGridPeer*
[Libreoffice-commits] core.git: editeng/source embeddedobj/source eventattacher/source extensions/source filter/source forms/source formula/source fpicker/source framework/source i18npool/source inclu
editeng/source/accessibility/AccessibleEditableTextPara.cxx |2 - editeng/source/misc/hangulhanja.cxx |2 - editeng/source/uno/unofield.cxx |2 - embeddedobj/source/commonembedding/persistence.cxx |2 - embeddedobj/source/commonembedding/xfactory.cxx | 14 - eventattacher/source/eventattacher.cxx |2 - extensions/source/bibliography/bibconfig.cxx|2 - extensions/source/bibliography/bibload.cxx |4 +- extensions/source/bibliography/datman.cxx |8 ++--- extensions/source/dbpilots/controlwizard.cxx|4 +- extensions/source/dbpilots/groupboxwiz.cxx |6 ++-- extensions/source/logging/consolehandler.cxx|2 - extensions/source/logging/loggerconfig.cxx |2 - extensions/source/propctrlr/formcomponenthandler.cxx|8 ++--- extensions/source/propctrlr/genericpropertyhandler.cxx |2 - extensions/source/propctrlr/objectinspectormodel.cxx|6 ++-- extensions/source/propctrlr/pcrcommon.hxx |2 - extensions/source/propctrlr/propcontroller.cxx |2 - extensions/source/propctrlr/stringrepresentation.cxx|4 +- filter/source/config/cache/filtercache.cxx |4 +- filter/source/msfilter/escherex.cxx |6 ++-- filter/source/msfilter/mstoolbar.cxx|2 - filter/source/pdf/pdfexport.cxx |6 ++-- filter/source/pdf/pdffilter.cxx |2 - filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx |3 -- forms/source/component/DatabaseForm.cxx |4 +- forms/source/component/ListBox.cxx |6 ++-- forms/source/component/entrylisthelper.cxx | 18 ++-- forms/source/misc/InterfaceContainer.cxx|2 - forms/source/richtext/attributedispatcher.cxx |2 - formula/source/ui/dlg/formula.cxx |2 - fpicker/source/office/OfficeControlAccess.cxx |2 - fpicker/source/office/OfficeFilePicker.cxx |6 ++-- fpicker/source/office/RemoteFilesDialog.cxx |6 ++-- framework/source/dispatch/closedispatcher.cxx |2 - framework/source/dispatch/dispatchdisabler.cxx |2 - framework/source/dispatch/interceptionhelper.cxx|2 - framework/source/fwe/classes/addonmenu.cxx |6 ++-- framework/source/fwe/classes/addonsoptions.cxx | 10 +++--- framework/source/fwe/helper/actiontriggerhelper.cxx |2 - framework/source/fwi/helper/mischelper.cxx |2 - framework/source/helper/persistentwindowstate.cxx |2 - framework/source/helper/statusindicatorfactory.cxx |2 - framework/source/helper/tagwindowasmodified.cxx |2 - framework/source/helper/titlebarupdate.cxx |2 - framework/source/jobs/job.cxx |6 ++-- framework/source/layoutmanager/toolbarlayoutmanager.cxx |2 - framework/source/services/autorecovery.cxx |6 ++-- framework/source/services/sessionlistener.cxx |2 - framework/source/uiconfiguration/graphicnameaccess.cxx |2 - framework/source/uielement/addonstoolbarwrapper.cxx |4 +- framework/source/uielement/toolbarmanager.cxx |2 - framework/source/uifactory/addonstoolbarfactory.cxx |2 - i18npool/source/indexentry/indexentrysupplier.cxx |2 - i18npool/source/indexentry/indexentrysupplier_default.cxx |4 +- i18npool/source/localedata/localedata.cxx |2 - i18npool/source/textconversion/textconversion_zh.cxx| 10 +++--- include/comphelper/proparrhlp.hxx |2 - include/sfx2/dinfdlg.hxx|2 - 59 files changed, 114 insertions(+), 115 deletions(-) New commits: commit 966f40eecfc60f20c309bc2477149442d753763a Author: Arkadiy Illarionov AuthorDate: Sat May 4 17:06:38 2019 +0300 Commit: Noel Grandin CommitDate: Fri May 31 16:10:17 2019 +0200 Use hasElements to check Sequence emptiness in [e-i]* Similar to clang-tidy readability-container-size-empty Change-Id: I79e31919db8f4132216f09a7868d18835eeb154b Reviewed-on: https://gerrit.libreoffice.org/71795 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx index 14d67b5c2ccc..7914e65383a5 100644 ---
[Libreoffice-commits] core.git: lingucomponent/source linguistic/source oox/source package/source pyuno/source reportdesign/source
lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx |6 ++--- lingucomponent/source/spellcheck/spell/sspellimp.cxx |6 ++--- lingucomponent/source/thesaurus/libnth/nthesimp.cxx | 14 ++-- linguistic/source/gciterator.cxx |4 +-- linguistic/source/hyphdsp.cxx | 14 ++-- linguistic/source/lngsvcmgr.cxx | 20 +- linguistic/source/spelldsp.cxx|8 +++ linguistic/source/thesdsp.cxx |8 +++ oox/source/core/filterbase.cxx|2 - oox/source/core/filterdetect.cxx |2 - oox/source/core/xmlfilterbase.cxx |2 - oox/source/drawingml/chart/chartspaceconverter.cxx|4 +-- oox/source/drawingml/customshapeproperties.cxx|2 - oox/source/drawingml/shape.cxx|6 ++--- oox/source/export/chartexport.cxx | 10 - oox/source/export/drawingml.cxx | 20 +- oox/source/export/shapes.cxx |2 - oox/source/helper/zipstorage.cxx |2 - oox/source/ole/olestorage.cxx |2 - package/source/xstor/owriteablestream.cxx |8 +++ package/source/xstor/xstorage.cxx |2 - package/source/zipapi/XBufferedThreadedStream.cxx |2 - package/source/zipapi/XUnbufferedStream.cxx |8 +++ package/source/zipapi/ZipFile.cxx | 20 +- package/source/zipapi/ZipOutputEntry.cxx |2 - package/source/zippackage/ZipPackage.cxx | 16 +++--- package/source/zippackage/ZipPackageFolder.cxx|2 - package/source/zippackage/ZipPackageStream.cxx| 16 +++--- package/source/zippackage/zipfileaccess.cxx |2 - pyuno/source/module/pyuno_adapter.cxx |2 - reportdesign/source/core/api/ReportDefinition.cxx |2 - reportdesign/source/filter/xml/xmlControlProperty.cxx |2 - reportdesign/source/filter/xml/xmlExport.cxx |2 - reportdesign/source/ui/dlg/GroupExchange.cxx |2 - reportdesign/source/ui/dlg/GroupsSorting.cxx |8 +++ reportdesign/source/ui/dlg/Navigator.cxx |2 - reportdesign/source/ui/report/ReportController.cxx| 16 +++--- reportdesign/source/ui/report/ReportSection.cxx |2 - reportdesign/source/ui/report/ViewsWindow.cxx |2 - reportdesign/source/ui/report/propbrw.cxx |4 +-- 40 files changed, 128 insertions(+), 128 deletions(-) New commits: commit 0e4c542f7a862e681baf25f042bc3a928c14004f Author: Arkadiy Illarionov AuthorDate: Fri May 3 22:11:02 2019 +0300 Commit: Michael Stahl CommitDate: Fri May 17 11:20:15 2019 +0200 Use hasElements to check Sequence emptiness in [l-r]* Similar to clang-tidy readability-container-size-empty Change-Id: Idd67f332b04857a39df26bad1733aae21236f105 Reviewed-on: https://gerrit.libreoffice.org/71764 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx index 8ad50fa36915..bc4d91038a25 100644 --- a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx +++ b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx @@ -171,8 +171,8 @@ Sequence< Locale > SAL_CALL Hyphenator::getLocales() k = 0; for (auto const& dict : aDics) { -if (dict.aLocaleNames.getLength() > 0 && -dict.aLocations.getLength() > 0) +if (dict.aLocaleNames.hasElements() && +dict.aLocations.hasElements()) { uno::Sequence< OUString > aLocaleNames(dict.aLocaleNames); sal_Int32 nLocales = aLocaleNames.getLength(); @@ -218,7 +218,7 @@ sal_Bool SAL_CALL Hyphenator::hasLocale(const Locale& rLocale) MutexGuard aGuard( GetLinguMutex() ); bool bRes = false; -if (!aSuppLocales.getLength()) +if (!aSuppLocales.hasElements()) getLocales(); const Locale *pLocale = aSuppLocales.getConstArray(); diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx index 3462899714a2..64032ad14b2d 100644 --- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx +++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx @@ -197,8 +197,8 @@ Sequence< Locale > SAL_CALL SpellChecker::getLocales() m_DictItems.reserve(nDictSize); for (auto const& dict : aDics) { -if (dict.aLocaleNames.getLength() > 0 && -dict.aLocations.getLength() > 0) +
[Libreoffice-commits] core.git: chart2/source solenv/clang-format
chart2/source/controller/dialogs/DialogModel.cxx |7 - chart2/source/controller/main/ChartController_Window.cxx |4 chart2/source/inc/ContainerHelper.hxx| 73 --- chart2/source/model/main/BaseCoordinateSystem.cxx|3 chart2/source/model/main/DataSeries.cxx |5 - chart2/source/model/main/Title.cxx | 13 +- chart2/source/tools/DataSeriesHelper.cxx |9 - chart2/source/tools/DiagramHelper.cxx|5 - chart2/source/tools/ErrorBar.cxx |3 chart2/source/tools/InternalDataProvider.cxx |7 - chart2/source/tools/PropertyHelper.cxx |4 chart2/source/tools/RegressionEquation.cxx |7 - chart2/source/view/axes/VCoordinateSystem.cxx|3 solenv/clang-format/blacklist|1 14 files changed, 33 insertions(+), 111 deletions(-) New commits: commit 1bf1c56ce05a08e09c3f7def4962ef7f7ae885d9 Author: Arkadiy Illarionov AuthorDate: Sun May 12 12:13:42 2019 +0300 Commit: Noel Grandin CommitDate: Mon May 13 10:02:02 2019 +0200 Remove ContainerHelper.hxx Use comphelper::sequenceToContainer instead of ContainerHelper::SequenceToVector Change-Id: I4834255a1349ac7a29127a84a54fcfa98d678d00 Reviewed-on: https://gerrit.libreoffice.org/72186 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/chart2/source/controller/dialogs/DialogModel.cxx b/chart2/source/controller/dialogs/DialogModel.cxx index 11a616a34f8e..a363c6cc6fc8 100644 --- a/chart2/source/controller/dialogs/DialogModel.cxx +++ b/chart2/source/controller/dialogs/DialogModel.cxx @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -489,7 +488,7 @@ void addNewSeriesToContainer( const Reference& xNewSeries ) { Reference xSeriesCnt(xChartType, uno::UNO_QUERY_THROW); -std::vector > aSeries = ContainerHelper::SequenceToVector(xSeriesCnt->getDataSeries()); +auto aSeries = comphelper::sequenceToContainer >>(xSeriesCnt->getDataSeries()); std::vector >::iterator aIt = std::find( aSeries.begin(), aSeries.end(), xSeries); @@ -819,8 +818,8 @@ void DialogModel::applyInterpretedData( // data series std::vector< Reference< XDataSeriesContainer > > aSeriesCnt( getAllDataSeriesContainers()); -std::vector< Sequence< Reference< XDataSeries > > > aNewSeries( -ContainerHelper::SequenceToVector( rNewData.Series )); +auto aNewSeries( +comphelper::sequenceToContainer > >>( rNewData.Series )); OSL_ASSERT( aSeriesCnt.size() == aNewSeries.size()); diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx index f63126747058..c928be0e3a17 100644 --- a/chart2/source/controller/main/ChartController_Window.cxx +++ b/chart2/source/controller/main/ChartController_Window.cxx @@ -39,7 +39,6 @@ #include #include #include -#include #include #include #include @@ -63,6 +62,7 @@ #include #include #include +#include #include @@ -1054,7 +1054,7 @@ void ChartController::execute_Command( const CommandEvent& rCEvt ) { if( bIsPoint ) { -std::vector< sal_Int32 > aIndices( ContainerHelper::SequenceToVector( aAttributedDataPointIndexList ) ); +auto aIndices( comphelper::sequenceToContainer>( aAttributedDataPointIndexList ) ); std::vector< sal_Int32 >::iterator aIt = std::find( aIndices.begin(), aIndices.end(), nPointIndex ); if( aIt != aIndices.end()) bSelectedPointIsFormatted = true; diff --git a/chart2/source/inc/ContainerHelper.hxx b/chart2/source/inc/ContainerHelper.hxx deleted file mode 100644 index 014d3c1033d5.. --- a/chart2/source/inc/ContainerHelper.hxx +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file -
[Libreoffice-commits] core.git: sax/qa sax/source sc/inc sc/qa scripting/source sc/source sdext/source sd/source
sax/qa/cppunit/attributes.cxx|2 +- sax/source/expatwrap/sax_expat.cxx |2 +- sax/source/expatwrap/xml2utf.cxx |6 +++--- sax/source/fastparser/fastparser.cxx |2 +- sax/source/fastparser/legacyfastparser.cxx |2 +- sax/source/tools/fastserializer.cxx |6 +++--- sc/inc/chgtrack.hxx |2 +- sc/qa/unit/helper/qahelper.cxx |2 +- sc/source/core/data/dpoutput.cxx |4 ++-- sc/source/core/data/dptabres.cxx |2 +- sc/source/core/data/globalx.cxx |2 +- sc/source/core/data/tabprotection.cxx|4 ++-- sc/source/core/tool/userlist.cxx |4 ++-- sc/source/filter/excel/xechart.cxx |4 ++-- sc/source/filter/excel/xeescher.cxx |2 +- sc/source/filter/excel/xeroot.cxx|7 ++- sc/source/filter/excel/xichart.cxx |4 ++-- sc/source/filter/excel/xistream.cxx | 12 ++-- sc/source/filter/ftools/fapihelper.cxx |2 +- sc/source/filter/xcl97/xcl97rec.cxx |4 ++-- sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx |2 +- sc/source/filter/xml/xmlexprt.cxx|2 +- sc/source/filter/xml/xmlimprt.cxx|4 ++-- sc/source/filter/xml/xmlwrap.cxx |4 ++-- sc/source/ui/Accessibility/AccessibleDocument.cxx|2 +- sc/source/ui/docshell/docsh2.cxx |2 +- sc/source/ui/miscdlgs/optsolver.cxx |6 +++--- sc/source/ui/miscdlgs/solveroptions.cxx |2 +- sc/source/ui/unoobj/cellsuno.cxx |2 +- sc/source/ui/unoobj/chart2uno.cxx|8 sc/source/ui/unoobj/docuno.cxx |2 +- sc/source/ui/unoobj/fmtuno.cxx |8 sc/source/ui/unoobj/linkuno.cxx |2 +- sc/source/ui/vba/vbaeventshelper.cxx |2 +- sc/source/ui/vba/vbaglobals.cxx |2 +- sc/source/ui/vba/vbatitle.hxx|2 +- sc/source/ui/vba/vbaworkbook.cxx |2 +- sc/source/ui/view/viewfun5.cxx |2 +- sc/source/ui/xmlsource/xmlsourcedlg.cxx |2 +- scripting/source/basprov/basscript.cxx |2 +- scripting/source/protocolhandler/scripthandler.cxx |6 +++--- scripting/source/provider/ProviderCache.cxx |2 +- scripting/source/vbaevents/eventhelper.cxx |6 +++--- sd/source/filter/eppt/eppt.cxx |2 +- sd/source/filter/eppt/pptexanimations.cxx|6 +++--- sd/source/filter/eppt/pptx-animations.cxx|2 +- sd/source/filter/eppt/pptx-epptooxml.cxx |2 +- sd/source/filter/xml/sdxmlwrp.cxx|2 +- sd/source/ui/app/optsitem.cxx|4 ++-- sd/source/ui/dlg/PhotoAlbumDialog.cxx|2 +- sd/source/ui/framework/factories/BasicPaneFactory.cxx|2 +- sd/source/ui/framework/factories/BasicToolBarFactory.cxx |2 +- sd/source/ui/framework/factories/BasicViewFactory.cxx|2 +- sd/source/ui/framework/factories/PresentationFactory.cxx |2 +- sd/source/ui/framework/module/CenterViewFocusModule.cxx |2 +- sd/source/ui/framework/module/ModuleController.cxx |2 +- sd/source/ui/framework/tools/FrameworkHelper.cxx |2 +- sd/source/ui/presenter/PresenterPreviewCache.cxx |2 +- sd/source/ui/presenter/SlideRenderer.cxx |2 +- sd/source/ui/unoidl/unopage.cxx |4 ++-- sd/source/ui/unoidl/unosrch.cxx |2 +- sd/source/ui/view/drviews2.cxx |4 ++-- sdext/source/minimizer/fileopendialog.cxx|4 ++-- sdext/source/minimizer/optimizerdialog.cxx |4 ++-- sdext/source/minimizer/optimizerdialogcontrols.cxx |4 ++-- sdext/source/pdfimport/test/tests.cxx|2 +- sdext/source/presenter/PresenterTextView.cxx |2 +- 67 files changed, 105 insertions(+), 108 deletions(-) New commits: commit 038e4b3b1e10d072b432cb06234521ae9a262a70 Author: Arkadiy Illarionov AuthorDate: Fri May 3 19:51:47 2019 +0300 Commit: Noel Grandin CommitDate: Sun May 12 14:18:12 2019 +0200 Use hasElements to check Sequence emptiness in sax..sdext Similar to clang-tidy
[Libreoffice-commits] core.git: xmlscript/source xmlsecurity/source
xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx| 19 +--- xmlscript/source/xmldlg_imexp/xmldlg_export.cxx |5 - xmlscript/source/xmlflat_imexp/xmlbas_export.cxx | 39 -- xmlscript/source/xmllib_imexp/xmllib_export.cxx | 19 +--- xmlsecurity/source/component/documentdigitalsignatures.cxx| 19 +--- xmlsecurity/source/dialogs/certificatechooser.cxx | 16 ++-- xmlsecurity/source/dialogs/macrosecurity.cxx |5 - xmlsecurity/source/framework/xmlsignaturetemplateimpl.cxx |8 -- xmlsecurity/source/helper/documentsignaturehelper.cxx | 30 +++ xmlsecurity/source/helper/documentsignaturemanager.cxx|7 - xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx | 13 +-- xmlsecurity/source/xmlsec/saxhelper.cxx |7 + 12 files changed, 72 insertions(+), 115 deletions(-) New commits: commit fac093e5e63bd53bae3de552fedba927bd5c4561 Author: Arkadiy Illarionov AuthorDate: Thu May 9 15:17:26 2019 +0300 Commit: Noel Grandin CommitDate: Thu May 9 18:21:59 2019 +0200 Simplify Sequence iterations in xmlscript, xmlsecurity Use range-based loops or replace with comphelper or STL functions Change-Id: I3d63811caf80c87a9d560087e1f0d933ebcc0d55 Reviewed-on: https://gerrit.libreoffice.org/72040 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx index 186dc6923f61..cf0a13e39235 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx @@ -318,11 +318,10 @@ void ElementDescriptor::readComboBoxModel( StyleBag * all_styles ) { ElementDescriptor * popup = new ElementDescriptor( _xProps, _xPropState, XMLNS_DIALOGS_PREFIX ":menupopup", _xDocument ); -OUString const * pItemValues = itemValues.getConstArray(); -for ( sal_Int32 nPos = 0; nPos < itemValues.getLength(); ++nPos ) +for ( const auto& rItemValue : itemValues ) { ElementDescriptor * item = new ElementDescriptor( _xProps, _xPropState, XMLNS_DIALOGS_PREFIX ":menuitem", _xDocument ); -item->addAttribute( XMLNS_DIALOGS_PREFIX ":value", pItemValues[ nPos ] ); +item->addAttribute( XMLNS_DIALOGS_PREFIX ":value", rItemValue ); popup->addSubElement( item ); } @@ -366,12 +365,10 @@ void ElementDescriptor::readListBoxModel( StyleBag * all_styles ) { ElementDescriptor * popup = new ElementDescriptor( _xProps, _xPropState, XMLNS_DIALOGS_PREFIX ":menupopup", _xDocument ); -OUString const * pItemValues = itemValues.getConstArray(); -sal_Int32 nPos; -for ( nPos = 0; nPos < itemValues.getLength(); ++nPos ) +for ( const auto& rItemValue : itemValues ) { ElementDescriptor * item = new ElementDescriptor(_xProps, _xPropState, XMLNS_DIALOGS_PREFIX ":menuitem", _xDocument ); -item->addAttribute( XMLNS_DIALOGS_PREFIX ":value", pItemValues[ nPos ] ); +item->addAttribute( XMLNS_DIALOGS_PREFIX ":value", rItemValue ); popup->addSubElement( item ); } @@ -379,7 +376,7 @@ void ElementDescriptor::readListBoxModel( StyleBag * all_styles ) if (readProp( "SelectedItems" ) >>= selected) { sal_Int16 const * pSelected = selected.getConstArray(); -for ( nPos = selected.getLength(); nPos--; ) +for ( sal_Int32 nPos = selected.getLength(); nPos--; ) { ElementDescriptor * item = static_cast< ElementDescriptor * >( popup->getSubElement( pSelected[ nPos ] ).get() ); @@ -1090,14 +1087,12 @@ void ElementDescriptor::readBullitinBoard( StyleBag * all_styles ) if ( !xDialogModel.is() ) return; // #TODO throw??? Sequence< OUString > aElements( xDialogModel->getElementNames() ); -OUString const * pElements = aElements.getConstArray(); ElementDescriptor * pRadioGroup = nullptr; -sal_Int32 nPos; -for ( nPos = 0; nPos < aElements.getLength(); ++nPos ) +for ( const auto& rElement : aElements ) { -Any aControlModel( xDialogModel->getByName( pElements[ nPos ] ) ); +Any aControlModel( xDialogModel->getByName( rElement ) ); Reference< beans::XPropertySet > xProps; OSL_VERIFY( aControlModel >>= xProps ); if (! xProps.is()) diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx index 9341952eef35..eca2feb26fa0 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx @@ -1152,11 +1152,10 @@ void ElementDescriptor::readEvents() if (xEvents.is()) { Sequence< OUString > aNames(
[Libreoffice-commits] core.git: UnoControls/source
UnoControls/source/base/basecontainercontrol.cxx |5 ++--- UnoControls/source/base/multiplexer.cxx | 12 2 files changed, 6 insertions(+), 11 deletions(-) New commits: commit a11572dc27b5fea1935b63208c779a20eb56 Author: Arkadiy Illarionov AuthorDate: Wed May 8 23:47:55 2019 +0300 Commit: Noel Grandin CommitDate: Thu May 9 08:48:32 2019 +0200 Simplify Sequence iterations in UnoControls Use range-based loops Change-Id: I4d3be75bb83c74267b9dec6f1dcdc105c292be9d Reviewed-on: https://gerrit.libreoffice.org/72011 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/UnoControls/source/base/basecontainercontrol.cxx b/UnoControls/source/base/basecontainercontrol.cxx index 91efd22a28f7..3c6469def44a 100644 --- a/UnoControls/source/base/basecontainercontrol.cxx +++ b/UnoControls/source/base/basecontainercontrol.cxx @@ -117,11 +117,10 @@ void SAL_CALL BaseContainerControl::createPeer( const Reference< XToolkit >& // create peers at all children Sequence< Reference< XControl > > seqControlList = getControls(); -sal_uInt32 nControls = seqControlList.getLength(); -for ( sal_uInt32 n=0; ncreatePeer( xToolkit, getPeer() ); +rxControl->createPeer( xToolkit, getPeer() ); } } } diff --git a/UnoControls/source/base/multiplexer.cxx b/UnoControls/source/base/multiplexer.cxx index e1353add0d80..d7008c652083 100644 --- a/UnoControls/source/base/multiplexer.cxx +++ b/UnoControls/source/base/multiplexer.cxx @@ -156,22 +156,18 @@ void OMRCListenerMultiplexerHelper::setPeer( const Reference< XWindow >& xPeer ) { // get all types from the listener added to the peer Sequence< Type >aContainedTypes = m_aListenerHolder.getContainedTypes(); -const Type* pArray = aContainedTypes.getConstArray(); -sal_Int32 nCount = aContainedTypes.getLength(); // loop over all listener types and remove the listeners from the peer -for( sal_Int32 i=0; iaContainedTypes = m_aListenerHolder.getContainedTypes(); -const Type* pArray = aContainedTypes.getConstArray(); -sal_Int32 nCount = aContainedTypes.getLength(); // loop over all listener types and add the listeners to the peer -for( sal_Int32 i = 0; i < nCount; i++ ) -impl_adviseToPeer( m_xPeer, pArray[i] ); +for( const auto& rContainedType : aContainedTypes ) +impl_adviseToPeer( m_xPeer, rContainedType ); } } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/core/PropertySetMerger.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 6934a55ebe724a2011179473bb4b762d1834b9ce Author: Arkadiy Illarionov AuthorDate: Tue May 7 10:21:38 2019 +0300 Commit: Michael Stahl CommitDate: Tue May 7 10:39:01 2019 +0200 Get properties from both sets Fix copypaste typo Change-Id: I59fe87a8739b968404012b41796f1092dc0e0f7f Reviewed-on: https://gerrit.libreoffice.org/71890 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/xmloff/source/core/PropertySetMerger.cxx b/xmloff/source/core/PropertySetMerger.cxx index ad059a2b95d1..356d6d14f83f 100644 --- a/xmloff/source/core/PropertySetMerger.cxx +++ b/xmloff/source/core/PropertySetMerger.cxx @@ -201,7 +201,7 @@ Any SAL_CALL PropertySetMergerImpl::getPropertyDefault( const OUString& aPropert Sequence< Property > SAL_CALL PropertySetMergerImpl::getProperties() { Sequence< Property > aProps1( mxPropSet1Info->getProperties() ); -Sequence< Property > aProps2( mxPropSet1Info->getProperties() ); +Sequence< Property > aProps2( mxPropSet2Info->getProperties() ); return comphelper::concatSequences(aProps1, aProps2); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/chart/SchXMLTableContext.cxx | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) New commits: commit ddd5587d48eb685cbfc1106f694fb6b582fac6b8 Author: Arkadiy Illarionov AuthorDate: Sun May 5 19:14:24 2019 +0300 Commit: Noel Grandin CommitDate: Sun May 5 19:24:18 2019 +0200 Drop lcl_SequenceToVector in favor of comphelper::sequenceToContainer Change-Id: I86284553e1b0229d0b576ef1d92efd040b524a1b Reviewed-on: https://gerrit.libreoffice.org/71825 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx index cb0423c92976..996f2b82c287 100644 --- a/xmloff/source/chart/SchXMLTableContext.cxx +++ b/xmloff/source/chart/SchXMLTableContext.cxx @@ -196,14 +196,6 @@ bool lcl_tableOfRangeMatches( (rRange.indexOf( rTableName ) != -1 )); } -template< typename T > -::std::vector< T > lcl_SequenceToVector( const uno::Sequence< T > & rSequence ) -{ -::std::vector< T > aResult( rSequence.getLength()); -::std::copy( rSequence.begin(), rSequence.end(), aResult.begin()); -return aResult; -} - } // anonymous namespace // class SchXMLTableContext @@ -298,7 +290,7 @@ void SchXMLTableContext::EndElement() if( mbHasColumnPermutation ) { SAL_WARN_IF( mbHasRowPermutation, "xmloff.chart", "mbHasColumnPermutation is true" ); -::std::vector< sal_Int32 > aPermutation( lcl_SequenceToVector( maColumnPermutation )); +auto aPermutation( comphelper::sequenceToContainer>( maColumnPermutation )); SAL_WARN_IF( aPermutation.empty(), "xmloff.chart", "aPermutation is NULL"); if( aPermutation.empty()) return; @@ -338,7 +330,7 @@ void SchXMLTableContext::EndElement() } else if( mbHasRowPermutation ) { -::std::vector< sal_Int32 > aPermutation( lcl_SequenceToVector( maRowPermutation )); +auto aPermutation( comphelper::sequenceToContainer>( maRowPermutation )); SAL_WARN_IF( aPermutation.empty(), "xmloff.chart", "aPermutation is NULL"); if( aPermutation.empty()) return; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/inc sw/source
sw/inc/PostItMgr.hxx|4 ++-- sw/source/core/access/accpara.cxx | 10 +- sw/source/core/crsr/DropDownFormFieldButton.cxx |2 +- sw/source/core/doc/docedt.cxx |8 sw/source/core/edit/edlingu.cxx |6 +++--- sw/source/core/tox/txmsrt.cxx |2 +- sw/source/core/unocore/unochart.cxx |4 ++-- sw/source/core/unocore/unocrsrhelper.cxx|4 ++-- sw/source/core/unocore/unofield.cxx |2 +- sw/source/core/unocore/unoobj.cxx |8 sw/source/core/unocore/unosect.cxx |2 +- sw/source/core/unocore/unosett.cxx |2 +- sw/source/core/unocore/unotext.cxx |2 +- sw/source/filter/ww8/docxattributeoutput.cxx|2 +- sw/source/filter/ww8/docxexport.cxx |2 +- sw/source/filter/ww8/docxtablestyleexport.cxx |2 +- sw/source/filter/ww8/rtfattributeoutput.cxx |4 ++-- sw/source/filter/ww8/wrtw8esh.cxx |3 +-- sw/source/filter/ww8/wrtww8.cxx |6 +++--- sw/source/filter/ww8/ww8par.cxx |8 sw/source/filter/xml/swxml.cxx |4 ++-- sw/source/filter/xml/wrtxml.cxx |2 +- sw/source/ui/dbui/addresslistdialog.cxx |4 ++-- sw/source/ui/dbui/dbinsdlg.cxx |2 +- sw/source/ui/dbui/mmdocselectpage.cxx |2 +- sw/source/ui/dialog/uiregionsw.cxx | 12 ++-- sw/source/ui/envelp/mailmrge.cxx|4 ++-- sw/source/ui/fldui/flddinf.cxx |2 +- sw/source/ui/vba/vbaglobals.cxx |2 +- sw/source/uibase/app/docsh.cxx |8 sw/source/uibase/app/docshini.cxx |2 +- sw/source/uibase/dbui/dbmgr.cxx | 10 +- sw/source/uibase/dbui/mmconfigitem.cxx |5 ++--- sw/source/uibase/envelp/labelcfg.cxx|2 +- sw/source/uibase/lingu/olmenu.cxx |2 +- sw/source/uibase/misc/redlndlg.cxx |4 ++-- sw/source/uibase/sidebar/PageMarginControl.cxx | 10 +- sw/source/uibase/uiview/uivwimp.cxx |4 ++-- sw/source/uibase/uiview/view2.cxx | 10 +- sw/source/uibase/uiview/viewling.cxx|6 +++--- sw/source/uibase/uiview/viewstat.cxx|2 +- sw/source/uibase/uno/SwXDocumentSettings.cxx|2 +- sw/source/uibase/uno/unomailmerge.cxx |2 +- sw/source/uibase/uno/unotxdoc.cxx |4 ++-- sw/source/uibase/uno/unotxvw.cxx|2 +- 45 files changed, 95 insertions(+), 97 deletions(-) New commits: commit 2ddc66e6981a7d819cd6196a7ccbc811ca213be2 Author: Arkadiy Illarionov AuthorDate: Thu May 2 17:53:27 2019 +0300 Commit: Noel Grandin CommitDate: Sat May 4 13:57:07 2019 +0200 Use hasElements to check Sequence emptiness in sw Similar to clang-tidy readability-container-size-empty Change-Id: If44f20a7aa678915e32d12101e1af71476f4b590 Reviewed-on: https://gerrit.libreoffice.org/71679 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx index d34ae3f34b72..19ba52b7aa18 100644 --- a/sw/inc/PostItMgr.hxx +++ b/sw/inc/PostItMgr.hxx @@ -101,7 +101,7 @@ class SwNoteProps: public utl::ConfigItem css::uno::Sequence< css::uno::Any > aValues = GetProperties(rNames); const css::uno::Any* pValues = aValues.getConstArray(); SAL_WARN_IF(aValues.getLength() != rNames.getLength(), "sw", "GetProperties failed"); -if (aValues.getLength()) +if (aValues.hasElements()) pValues[0]>>=m_bIsShowAnchor; } @@ -112,7 +112,7 @@ class SwNoteProps: public utl::ConfigItem static css::uno::Sequence< OUString >& GetPropertyNames() { static css::uno::Sequence< OUString > aNames; -if(!aNames.getLength()) +if(!aNames.hasElements()) { aNames.realloc(1); OUString* pNames = aNames.getArray(); diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index dc2938ab286b..30d28c9c2183 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -1359,7 +1359,7 @@ uno::Sequence SwAccessibleParagraph::getCharacterAttributes( bool bSupplementalMode = false; uno::Sequence< OUString > aNames = aRequestedAttributes; -if (aNames.getLength() == 0) +if (!aNames.hasElements()) { bSupplementalMode = true; aNames = getAttributeNames(); @@ -1392,7 +1392,7 @@ uno::Sequence SwAccessibleParagraph::getCharacterAttributes( if( bSupplementalMode ) { uno::Sequence< OUString >
[Libreoffice-commits] core.git: sfx2/source shell/source starmath/source stoc/source svl/source svtools/source svx/source
sfx2/source/dialog/mailmodel.cxx|2 sfx2/source/dialog/securitypage.cxx |2 sfx2/source/doc/docinf.cxx |2 sfx2/source/doc/docinsert.cxx |2 sfx2/source/doc/docmacromode.cxx|2 sfx2/source/doc/doctemplates.cxx| 10 ++-- sfx2/source/doc/guisaveas.cxx | 14 +++--- sfx2/source/doc/iframe.cxx |2 sfx2/source/doc/objmisc.cxx |4 - sfx2/source/doc/objserv.cxx |2 sfx2/source/doc/objstor.cxx |6 +- sfx2/source/doc/oleprops.cxx|4 - sfx2/source/doc/printhelper.cxx |2 sfx2/source/doc/sfxbasemodel.cxx|6 +- sfx2/source/doc/sfxmodelfactory.cxx |2 sfx2/source/notify/eventsupplier.cxx|5 -- sfx2/source/view/sfxbasecontroller.cxx |2 sfx2/source/view/viewfrm.cxx|8 +-- sfx2/source/view/viewfrm2.cxx |2 shell/source/cmdmail/cmdmailmsg.cxx | 20 - starmath/source/view.cxx|2 stoc/source/corereflection/crcomp.cxx |2 stoc/source/corereflection/criface.cxx |2 stoc/source/implementationregistration/implreg.cxx | 33 stoc/source/inspect/introspection.cxx |2 stoc/source/invocation_adapterfactory/iafactory.cxx |2 stoc/source/servicemanager/servicemanager.cxx |8 +-- svl/source/config/cjkoptions.cxx|2 svl/source/config/ctloptions.cxx|2 svl/source/config/languageoptions.cxx |2 svl/source/fsstor/ostreamcontainer.cxx |4 - svl/source/items/lckbitem.cxx |2 svl/source/numbers/zforfind.cxx |8 +-- svl/source/passwordcontainer/passwordcontainer.cxx |4 - svtools/source/config/extcolorcfg.cxx |4 - svtools/source/control/filectrl.cxx |2 svtools/source/misc/embedtransfer.cxx |2 svtools/source/misc/imagemgr.cxx|2 svtools/source/uno/treecontrolpeer.cxx |2 svtools/source/uno/wizard/unowizard.cxx |6 +- svtools/source/uno/wizard/wizardshell.cxx |2 svx/source/customshapes/EnhancedCustomShape2d.cxx | 13 ++ svx/source/dialog/rubydialog.cxx|4 - svx/source/fmcomp/gridcell.cxx |4 - svx/source/form/databaselocationinput.cxx |4 - svx/source/form/fmexch.cxx |8 +-- svx/source/form/fmobj.cxx |2 svx/source/form/fmscriptingenv.cxx |2 svx/source/form/fmshimp.cxx |4 - svx/source/form/fmtextcontrolshell.cxx |4 - svx/source/form/fmvwimp.cxx |6 +- svx/source/form/formcontroller.cxx |2 svx/source/form/formfeaturedispatcher.cxx |2 svx/source/form/navigatortree.cxx |2 svx/source/gallery2/galbrws2.cxx|2 svx/source/items/customshapeitem.cxx|2 svx/source/mnuctrls/smarttagmenu.cxx|2 svx/source/sidebar/line/LineWidthPopup.cxx |2 svx/source/sidebar/text/TextCharacterSpacingControl.cxx |2 svx/source/tbxctrls/tbunosearchcontrollers.cxx |2 svx/source/unodraw/unomod.cxx |2 svx/source/xml/xmlgrhlp.cxx |2 62 files changed, 131 insertions(+), 136 deletions(-) New commits: commit f20810f7829d9f3b7167df316e1303810b746366 Author: Arkadiy Illarionov AuthorDate: Thu May 2 22:56:03 2019 +0300 Commit: Noel Grandin CommitDate: Fri May 3 10:08:31 2019 +0200 Use hasElements to check Sequence emptiness in sfx2..svx Similar to clang-tidy readability-container-size-empty Change-Id: Icabd773f3b924d465b33e8581175f1fcf70c282e Reviewed-on: https://gerrit.libreoffice.org/71704 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx index 498433ad9f42..8450baad99b4 100644 --- a/sfx2/source/dialog/mailmodel.cxx +++ b/sfx2/source/dialog/mailmodel.cxx @@ -432,7 +432,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( uno::Sequence< OUString >
[Libreoffice-commits] core.git: accessibility/source
accessibility/source/standard/accessiblemenubasecomponent.cxx |4 +++- accessibility/source/standard/vclxaccessibletoolboxitem.cxx |4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) New commits: commit f1ba393af4f08f8502906c9221f8b6f1be2a7bad Author: Arkadiy Illarionov AuthorDate: Wed Apr 10 00:22:00 2019 +0300 Commit: Noel Grandin CommitDate: Fri May 3 10:01:28 2019 +0200 clang-tidy modernize-avoid-c-arrays in accessibility Change-Id: Ic9c759fa78d47f0a8b989464ce1f65438da9064b Reviewed-on: https://gerrit.libreoffice.org/70478 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/accessibility/source/standard/accessiblemenubasecomponent.cxx b/accessibility/source/standard/accessiblemenubasecomponent.cxx index 2534eb40eda7..6f0df60870e2 100644 --- a/accessibility/source/standard/accessiblemenubasecomponent.cxx +++ b/accessibility/source/standard/accessiblemenubasecomponent.cxx @@ -32,6 +32,8 @@ #include #include +#include + using namespace ::com::sun::star; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::uno; @@ -114,7 +116,7 @@ void OAccessibleMenuBaseComponent::SetEnabled( bool bEnabled ) { nStateType = AccessibleStateType::VISIBLE; } -Any aOldValue[2], aNewValue[2]; +std::array aOldValue, aNewValue; if ( m_bEnabled ) { aOldValue[0] <<= AccessibleStateType::SENSITIVE; diff --git a/accessibility/source/standard/vclxaccessibletoolboxitem.cxx b/accessibility/source/standard/vclxaccessibletoolboxitem.cxx index e9bc3b34ed9d..4b90f7bcd259 100644 --- a/accessibility/source/standard/vclxaccessibletoolboxitem.cxx +++ b/accessibility/source/standard/vclxaccessibletoolboxitem.cxx @@ -47,6 +47,8 @@ #include +#include + // class VCLXAccessibleToolBoxItem -- using namespace ::com::sun::star::accessibility; @@ -217,7 +219,7 @@ void VCLXAccessibleToolBoxItem::NotifyChildEvent( const Reference< XAccessible > void VCLXAccessibleToolBoxItem::ToggleEnableState() { -Any aOldValue[2], aNewValue[2]; +std::array aOldValue, aNewValue; if ( m_pToolBox->IsItemEnabled( m_nItemId ) ) { aNewValue[0] <<= AccessibleStateType::SENSITIVE; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: svtools/source
svtools/source/dialogs/PlaceEditDialog.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 213be7a209884b4dadff49f0d378cd4919a3f9a5 Author: Arkadiy Illarionov AuthorDate: Thu May 2 21:08:04 2019 +0300 Commit: Noel Grandin CommitDate: Fri May 3 09:13:49 2019 +0200 Fix loop condition Change-Id: I8061e2bf839a4864eb5af1adb92b4b669e71e98c Reviewed-on: https://gerrit.libreoffice.org/71697 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx b/svtools/source/dialogs/PlaceEditDialog.cxx index 089a7f525dc4..cd6c7022ac20 100644 --- a/svtools/source/dialogs/PlaceEditDialog.cxx +++ b/svtools/source/dialogs/PlaceEditDialog.cxx @@ -192,7 +192,7 @@ void PlaceEditDialog::InitDetails( ) Sequence< OUString > aTypesNamesList( officecfg::Office::Common::Misc::CmisServersNames::get( xContext ) ); int nPos = 0; -for ( sal_Int32 i = 0; i < aTypesUrlsList.getLength( ) && aTypesNamesList.getLength( ); ++i ) +for ( sal_Int32 i = 0; i < aTypesUrlsList.getLength( ) && i < aTypesNamesList.getLength( ); ++i ) { OUString sUrl = aTypesUrlsList[i].replaceFirst("", SvtResId(STR_SVT_PORT) + ">"); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits