diff options
Diffstat (limited to 'uui/source/iahndl.cxx')
-rwxr-xr-x | uui/source/iahndl.cxx | 73 |
1 files changed, 23 insertions, 50 deletions
diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index 0879e3574da3..ee233f5ac9de 100755 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -89,6 +89,7 @@ #include "newerverwarn.hxx" #include "iahndl.hxx" +#include "nameclashdlg.hxx" /** === begin UNO using === **/ using ::com::sun::star::uno::Sequence; @@ -867,8 +868,6 @@ UUIInteractionHelper::handleRequest_impl( if ( handleCertificateValidationRequest( rRequest ) ) return true; -// @@@ Todo #i29340#: activate! -#if 0 ucb::NameClashResolveRequest aNameClashResolveRequest; if (aAnyRequest >>= aNameClashResolveRequest) { @@ -876,7 +875,7 @@ UUIInteractionHelper::handleRequest_impl( rRequest->getContinuations()); return true; } -#endif + if ( handleMasterPasswordRequest( rRequest ) ) return true; @@ -1188,40 +1187,26 @@ executeMessageBox( return aResult; } -// @@@ Todo #i29340#: activate! -#if 0 -enum NameClashResolveDialogResult { ABORT, RENAME, OVERWRITE }; - -NameClashResolveDialogResult -executeNameClashResolveDialog( - Window * /*pParent*/, - rtl::OUString const & /*rTargetFolderURL*/, - rtl::OUString const & /*rClashingName*/, - rtl::OUString & /*rProposedNewName*/) +NameClashResolveDialogResult executeSimpleNameClashResolveDialog( Window *pParent, + rtl::OUString const & rTargetFolderURL, + rtl::OUString const & rClashingName, + rtl::OUString & rProposedNewName, + bool bAllowOverwrite ) { - // @@@ Todo DV: execute overwrite-rename dialog, deliver result - OSL_ENSURE( false, - "executeNameClashResolveDialog not yet implemented!" ); - return ABORT; -} + std::auto_ptr< ResMgr > xManager( ResMgr::CreateResMgr( CREATEVERSIONRESMGR_NAME( uui ) ) ); + if ( !xManager.get() ) + return ABORT; -NameClashResolveDialogResult -executeSimpleNameClashResolveDialog( - Window * /*pParent*/, - rtl::OUString const & /*rTargetFolderURL*/, - rtl::OUString const & /*rClashingName*/, - rtl::OUString & /*rProposedNewName*/) -{ - // @@@ Todo DV: execute rename-only dialog, deliver result - OSL_ENSURE( false, - "executeSimpleNameClashResolveDialog not yet implemented!" ); - return ABORT; + NameClashDialog aDialog( pParent, xManager.get(), rTargetFolderURL, + rClashingName, rProposedNewName, bAllowOverwrite ); + + NameClashResolveDialogResult eResult = (NameClashResolveDialogResult) aDialog.Execute(); + rProposedNewName = aDialog.getNewName(); + return eResult; } -#endif + } // namespace -// @@@ Todo #i29340#: activate! -#if 0 void UUIInteractionHelper::handleNameClashResolveRequest( ucb::NameClashResolveRequest const & rRequest, @@ -1251,18 +1236,12 @@ UUIInteractionHelper::handleNameClashResolveRequest( NameClashResolveDialogResult eResult = ABORT; rtl::OUString aProposedNewName( rRequest.ProposedNewName ); - if ( xReplaceExistingData.is() ) - eResult = executeNameClashResolveDialog( - getParentProperty(), - rRequest.TargetFolderURL, - rRequest.ClashingName, - aProposedNewName); - else - eResult = executeSimpleNameClashResolveDialog( - getParentProperty(), - rRequest.TargetFolderURL, - rRequest.ClashingName, - aProposedNewName); + + eResult = executeSimpleNameClashResolveDialog( getParentProperty(), + rRequest.TargetFolderURL, + rRequest.ClashingName, + aProposedNewName, + xReplaceExistingData.is() ); switch ( eResult ) { @@ -1282,14 +1261,8 @@ UUIInteractionHelper::handleNameClashResolveRequest( "No ReplaceExistingData continuation available!" ); xReplaceExistingData->select(); break; - - default: - OSL_ENSURE( false, "Unknown NameClashResolveDialogResult value. " - "Interaction Request not handled!" ); - break; } } -#endif void UUIInteractionHelper::handleGenericErrorRequest( |