diff options
Diffstat (limited to 'writerperfect/source/writer/WordPerfectImportFilter.cxx')
-rw-r--r-- | writerperfect/source/writer/WordPerfectImportFilter.cxx | 92 |
1 files changed, 0 insertions, 92 deletions
diff --git a/writerperfect/source/writer/WordPerfectImportFilter.cxx b/writerperfect/source/writer/WordPerfectImportFilter.cxx index 5b13c67dda95..82912eac4813 100644 --- a/writerperfect/source/writer/WordPerfectImportFilter.cxx +++ b/writerperfect/source/writer/WordPerfectImportFilter.cxx @@ -256,98 +256,6 @@ throw (RuntimeException, std::exception) } -WordPerfectImportFilterDialog::WordPerfectImportFilterDialog() -{} - -WordPerfectImportFilterDialog::~WordPerfectImportFilterDialog() -{ -} - -void SAL_CALL WordPerfectImportFilterDialog::setTitle(const OUString &) -throw (RuntimeException, std::exception) -{ -} - -sal_Int16 SAL_CALL WordPerfectImportFilterDialog::execute() -throw (RuntimeException, std::exception) -{ - WPXSvInputStream input(mxInputStream); - - OString aUtf8Passwd; - - libwpd::WPDConfidence confidence = libwpd::WPDocument::isFileFormatSupported(&input); - - if (libwpd::WPD_CONFIDENCE_SUPPORTED_ENCRYPTION == confidence) - { - int unsuccessfulAttempts = 0; - while (true) - { - ScopedVclPtrInstance< SfxPasswordDialog > aPasswdDlg(nullptr); - aPasswdDlg->SetMinLen(0); - if (!aPasswdDlg->Execute()) - return css::ui::dialogs::ExecutableDialogResults::CANCEL; - msPassword = aPasswdDlg->GetPassword().getStr(); - aUtf8Passwd = OUStringToOString(msPassword, RTL_TEXTENCODING_UTF8); - if (libwpd::WPD_PASSWORD_MATCH_OK == libwpd::WPDocument::verifyPassword(&input, aUtf8Passwd.getStr())) - break; - else - unsuccessfulAttempts++; - if (unsuccessfulAttempts == 3) // timeout after 3 password atempts - return css::ui::dialogs::ExecutableDialogResults::CANCEL; - } - } - return css::ui::dialogs::ExecutableDialogResults::OK; -} - -Sequence<PropertyValue> SAL_CALL WordPerfectImportFilterDialog::getPropertyValues() throw(RuntimeException, std::exception) -{ - Sequence<PropertyValue> aRet(1); - PropertyValue *pArray = aRet.getArray(); - - pArray[0].Name = "Password"; - pArray[0].Value <<= msPassword; - - return aRet; -} - -void SAL_CALL WordPerfectImportFilterDialog::setPropertyValues(const Sequence<PropertyValue> &aProps) -throw(css::beans::UnknownPropertyException, css::beans::PropertyVetoException, - css::lang::IllegalArgumentException, css::lang::WrappedTargetException, RuntimeException, std::exception) -{ - const PropertyValue *pPropArray = aProps.getConstArray(); - long nPropCount = aProps.getLength(); - for (long i = 0; i < nPropCount; i++) - { - const PropertyValue &rProp = pPropArray[i]; - OUString aPropName = rProp.Name; - - if (aPropName == "Password") - rProp.Value >>= msPassword; - else if (aPropName == "InputStream") - rProp.Value >>= mxInputStream; - } -} - -// XServiceInfo -OUString SAL_CALL WordPerfectImportFilterDialog::getImplementationName() -throw (RuntimeException, std::exception) -{ - return OUString("com.sun.star.comp.Writer.WordPerfectImportFilterDialog"); -} - -sal_Bool SAL_CALL WordPerfectImportFilterDialog::supportsService(const OUString &rServiceName) -throw (RuntimeException, std::exception) -{ - return cppu::supportsService(this, rServiceName); -} - -Sequence< OUString > SAL_CALL WordPerfectImportFilterDialog::getSupportedServiceNames() -throw (RuntimeException, std::exception) -{ - Sequence < OUString > aRet { "com.sun.star.ui.dialogs.FilterOptionsDialog" }; - return aRet; -} - extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *SAL_CALL com_sun_star_comp_Writer_WordPerfectImportFilter_get_implementation( |