diff options
-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 ); } |