diff options
author | Supriyo Paul <paulsupriyo64nk@gmail.com> | 2023-03-02 20:17:30 +0530 |
---|---|---|
committer | Hossein <hossein@libreoffice.org> | 2023-05-13 00:54:00 +0200 |
commit | e08c910f9ee520ce00fe99d6dab9988138996ee3 (patch) | |
tree | 97e8069e125716b02a106c24542a707ee1c4ce23 | |
parent | 717bdd06a7ac1a2a266f36a43d7f1e695559d056 (diff) |
tdf#145538: traditional for loops to range-based for loops
changes traditional for to ranged based for in localizationmgr.cxx
goal: better readability for programmers
Change-Id: Ifde48037b27a794a9cdc3b1183f825651896cafb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148127
Tested-by: Jenkins
Reviewed-by: Hossein <hossein@libreoffice.org>
-rw-r--r-- | basctl/source/basicide/localizationmgr.cxx | 64 |
1 files changed, 17 insertions, 47 deletions
diff --git a/basctl/source/basicide/localizationmgr.cxx b/basctl/source/basicide/localizationmgr.cxx index ef3a1ed9ff90..22e44c09c6aa 100644 --- a/basctl/source/basicide/localizationmgr.cxx +++ b/basctl/source/basicide/localizationmgr.cxx @@ -926,15 +926,10 @@ void LocalizationMgr::renameStringResourceIDs( const ScriptDocument& rDocument, xDummyStringResolver, RENAME_DIALOG_IDS ); // Handle all controls - Sequence< OUString > aNames = xDialogModel->getElementNames(); - const OUString* pNames = aNames.getConstArray(); - sal_Int32 nCtrls = aNames.getLength(); - for( sal_Int32 i = 0 ; i < nCtrls ; ++i ) - { - OUString aCtrlName( pNames[i] ); - Any aCtrl = xDialogModel->getByName( aCtrlName ); + for(const auto& rCtrlName : xDialogModel->getElementNames()) { + Any aCtrl = xDialogModel->getByName( rCtrlName ); implHandleControlResourceProperties( aCtrl, aDlgName, - aCtrlName, xStringResourceManager, + rCtrlName, xStringResourceManager, xDummyStringResolver, RENAME_DIALOG_IDS ); } } @@ -957,15 +952,10 @@ void LocalizationMgr::removeResourceForDialog( const ScriptDocument& rDocument, xDummyStringResolver, REMOVE_IDS_FROM_RESOURCE ); // Handle all controls - Sequence< OUString > aNames = xDialogModel->getElementNames(); - const OUString* pNames = aNames.getConstArray(); - sal_Int32 nCtrls = aNames.getLength(); - for( sal_Int32 i = 0 ; i < nCtrls ; ++i ) - { - OUString aCtrlName( pNames[i] ); - Any aCtrl = xDialogModel->getByName( aCtrlName ); + for(const auto& rCtrlName : xDialogModel->getElementNames()) { + Any aCtrl = xDialogModel->getByName( rCtrlName ); implHandleControlResourceProperties( aCtrl, aDlgName, - aCtrlName, xStringResourceManager, + rCtrlName, xStringResourceManager, xDummyStringResolver, REMOVE_IDS_FROM_RESOURCE ); } } @@ -985,15 +975,10 @@ void LocalizationMgr::resetResourceForDialog( const Reference< container::XNameC aDummyName, xStringResourceManager, xDummyStringResolver, RESET_IDS ); // Handle all controls - Sequence< OUString > aNames = xDialogModel->getElementNames(); - const OUString* pNames = aNames.getConstArray(); - sal_Int32 nCtrls = aNames.getLength(); - for( sal_Int32 i = 0 ; i < nCtrls ; ++i ) - { - OUString aCtrlName( pNames[i] ); - Any aCtrl = xDialogModel->getByName( aCtrlName ); + for(const auto& rCtrlName : xDialogModel->getElementNames()){ + Any aCtrl = xDialogModel->getByName( rCtrlName ); implHandleControlResourceProperties( aCtrl, aDummyName, - aCtrlName, xStringResourceManager, xDummyStringResolver, RESET_IDS ); + rCtrlName, xStringResourceManager, xDummyStringResolver, RESET_IDS ); } } @@ -1012,15 +997,10 @@ void LocalizationMgr::setResourceIDsForDialog( const Reference< container::XName aDummyName, xStringResourceManager, xDummyStringResolver, SET_IDS ); // Handle all controls - Sequence< OUString > aNames = xDialogModel->getElementNames(); - const OUString* pNames = aNames.getConstArray(); - sal_Int32 nCtrls = aNames.getLength(); - for( sal_Int32 i = 0 ; i < nCtrls ; ++i ) - { - OUString aCtrlName( pNames[i] ); - Any aCtrl = xDialogModel->getByName( aCtrlName ); + for(const auto& rCtrlName : xDialogModel->getElementNames()) { + Any aCtrl = xDialogModel->getByName( rCtrlName ); implHandleControlResourceProperties( aCtrl, aDummyName, - aCtrlName, xStringResourceManager, xDummyStringResolver, SET_IDS ); + rCtrlName, xStringResourceManager, xDummyStringResolver, SET_IDS ); } } @@ -1066,15 +1046,10 @@ void LocalizationMgr::copyResourceForDroppedDialog( const Reference< container:: std::u16string_view(), xStringResourceManager, xSourceStringResolver, MOVE_RESOURCES ); // Handle all controls - Sequence< OUString > aNames = xDialogModel->getElementNames(); - const OUString* pNames = aNames.getConstArray(); - sal_Int32 nCtrls = aNames.getLength(); - for( sal_Int32 i = 0 ; i < nCtrls ; ++i ) - { - OUString aCtrlName( pNames[i] ); - Any aCtrl = xDialogModel->getByName( aCtrlName ); + for(const auto& rCtrlName : xDialogModel->getElementNames()) { + Any aCtrl = xDialogModel->getByName( rCtrlName ); implHandleControlResourceProperties( aCtrl, aDialogName, - aCtrlName, xStringResourceManager, xSourceStringResolver, MOVE_RESOURCES ); + rCtrlName, xStringResourceManager, xSourceStringResolver, MOVE_RESOURCES ); } } @@ -1094,13 +1069,8 @@ void LocalizationMgr::copyResourceForDialog( xSourceStringResolver, COPY_RESOURCES ); // Handle all controls - Sequence< OUString > aNames = xDialogModel->getElementNames(); - const OUString* pNames = aNames.getConstArray(); - sal_Int32 nCtrls = aNames.getLength(); - for( sal_Int32 i = 0 ; i < nCtrls ; ++i ) - { - OUString aCtrlName( pNames[i] ); - Any aCtrl = xDialogModel->getByName( aCtrlName ); + for(const auto& rCtrlName : xDialogModel->getElementNames()) { + Any aCtrl = xDialogModel->getByName( rCtrlName ); implHandleControlResourceProperties( aCtrl, aDummyName, aDummyName, xTargetStringResourceManager, xSourceStringResolver, COPY_RESOURCES ); } |