diff options
Diffstat (limited to 'dbaccess/source/ui/dlg/CollectionView.cxx')
-rw-r--r-- | dbaccess/source/ui/dlg/CollectionView.cxx | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/dbaccess/source/ui/dlg/CollectionView.cxx b/dbaccess/source/ui/dlg/CollectionView.cxx index 6b978bc301c4..63f018f9e176 100644 --- a/dbaccess/source/ui/dlg/CollectionView.cxx +++ b/dbaccess/source/ui/dlg/CollectionView.cxx @@ -18,7 +18,7 @@ */ #include <CollectionView.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <core_resource.hxx> #include <strings.hrc> #include <comphelper/interaction.hxx> @@ -26,6 +26,7 @@ #include <cppuhelper/exc_hlp.hxx> #include <com/sun/star/container/XChild.hpp> #include <com/sun/star/container/XNameContainer.hpp> +#include <o3tl/safeint.hxx> #include <vcl/svapp.hxx> #include <vcl/weld.hxx> #include <UITools.hxx> @@ -41,14 +42,13 @@ #include <ucbhelper/commandenvironment.hxx> #include <ucbhelper/content.hxx> #include <connectivity/dbexception.hxx> +#include <utility> namespace dbaui { using namespace ::com::sun::star::uno; using namespace ::com::sun::star::ucb; -using namespace ::com::sun::star::lang; -using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; using namespace ::com::sun::star::task; using namespace ::com::sun::star::sdbc; @@ -57,10 +57,10 @@ using namespace comphelper; OCollectionView::OCollectionView(weld::Window* pParent, const Reference< XContent>& _xContent, const OUString& _sDefaultName, - const css::uno::Reference< css::uno::XComponentContext >& _rxContext) + css::uno::Reference< css::uno::XComponentContext > _xContext) : GenericDialogController(pParent, "dbaccess/ui/collectionviewdialog.ui", "CollectionView") , m_xContent(_xContent) - , m_xContext(_rxContext) + , m_xContext(std::move(_xContext)) , m_bCreateForm(true) , m_xFTCurrentPath(m_xBuilder->weld_label("currentPathLabel")) , m_xNewFolder(m_xBuilder->weld_button("newFolderButton")) @@ -141,12 +141,11 @@ IMPL_LINK_NOARG(OCollectionView, Save_Click, weld::Button&, void) Reference<XInteractionHandler2> xHandler( InteractionHandler::createWithParent(m_xContext, m_xDialog->GetXWindow())); - OInteractionRequest* pRequest = new OInteractionRequest(makeAny(aException)); - Reference< XInteractionRequest > xRequest(pRequest); + rtl::Reference<OInteractionRequest> pRequest = new OInteractionRequest(Any(aException)); - OInteractionApprove* pApprove = new OInteractionApprove; + rtl::Reference<OInteractionApprove> pApprove = new OInteractionApprove; pRequest->addContinuation(pApprove); - xHandler->handle(xRequest); + xHandler->handle(pRequest); return; } @@ -178,7 +177,7 @@ IMPL_LINK_NOARG(OCollectionView, NewFolder_Click, weld::Button&, void) try { Reference<XHierarchicalNameContainer> xNameContainer(m_xContent,UNO_QUERY); - if ( dbaui::insertHierachyElement(m_xDialog.get(),m_xContext,xNameContainer,OUString(),m_bCreateForm) ) + if ( dbaui::insertHierarchyElement(m_xDialog.get(),m_xContext,xNameContainer,OUString(),m_bCreateForm) ) Initialize(); } catch( const SQLException& ) @@ -257,9 +256,9 @@ void OCollectionView::initCurrentPath() static const char s_sReportsCID[] = "private:reports"; m_bCreateForm = s_sFormsCID == sCID; OUString sPath("/"); - if ( m_bCreateForm && sCID.getLength() != static_cast<sal_Int32>(strlen(s_sFormsCID))) + if ( m_bCreateForm && o3tl::make_unsigned(sCID.getLength()) != strlen(s_sFormsCID)) sPath = sCID.copy(strlen(s_sFormsCID)); - else if ( !m_bCreateForm && sCID.getLength() != static_cast<sal_Int32>(strlen(s_sReportsCID)) ) + else if ( !m_bCreateForm && o3tl::make_unsigned(sCID.getLength()) != strlen(s_sReportsCID) ) sPath = sCID.copy(strlen(s_sReportsCID) - 2); m_xFTCurrentPath->set_label(sPath); @@ -291,9 +290,7 @@ void OCollectionView::Initialize() try { ::ucbhelper::Content aContent(m_xContent, m_xCmdEnv, comphelper::getProcessComponentContext()); - Sequence<OUString> aProps(2); - aProps[0] = "Title"; - aProps[1] = "IsFolder"; + Sequence<OUString> aProps { "Title", "IsFolder" }; auto xDynResultSet = aContent.createDynamicCursor(aProps, ucbhelper::INCLUDE_FOLDERS_ONLY); if (!xDynResultSet.is()) return; |