diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2020-08-01 15:43:47 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2020-08-08 09:34:15 +0200 |
commit | ba20c2b1874cac08e93c3a122c8723868a29e456 (patch) | |
tree | 31498b287cc2ec0ef1792cb2bbb7095e3423dc9f | |
parent | 7f8c2d8f965ca2cb570bb40a5f8fa06902ea580e (diff) |
tdf#58518: add message in case of not text file with "Insert->File" in Writer
Change-Id: I5d3d6153cdb58485043e80331e0b4f1e55a03412
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99941
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
-rw-r--r-- | include/sfx2/strings.hrc | 1 | ||||
-rw-r--r-- | sw/source/uibase/uiview/view2.cxx | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/include/sfx2/strings.hrc b/include/sfx2/strings.hrc index f27cd4dae1d0..796418e4cefb 100644 --- a/include/sfx2/strings.hrc +++ b/include/sfx2/strings.hrc @@ -165,6 +165,7 @@ #define RID_SVXSTR_GRFILTER_FORMATERROR NC_("RID_SVXSTR_GRFILTER_FORMATERROR", "Unknown image format") #define RID_SVXSTR_GRFILTER_VERSIONERROR NC_("RID_SVXSTR_GRFILTER_VERSIONERROR", "This version of the image file is not supported") #define RID_SVXSTR_GRFILTER_FILTERERROR NC_("RID_SVXSTR_GRFILTER_FILTERERROR", "Image filter not found") +#define RID_SVXSTR_TXTFILTER_FILTERERROR NC_("RID_SVXSTR_TXTFILTER_FILTERERROR", "This is not a text document") #define RID_SVXSTR_END_REDLINING_WARNING NC_("RID_SVXSTR_END_REDLINING_WARNING", "This action will exit the change recording mode.\nNo information about changes will be recorded from now on.\n\nExit change recording mode?\n\n") #define RID_SVXSTR_INCORRECT_PASSWORD NC_("RID_SVXSTR_INCORRECT_PASSWORD", "Incorrect password") #define RID_SVXSTR_GPG_ENCRYPT_FAILURE NC_("RID_SVXSTR_GPG_ENCRYPT_FAILURE", "OpenPGP key not trusted, damaged, or encryption failure. Please try again.") diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index 87d0a64f33bc..780bfba16c33 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -2537,7 +2537,13 @@ IMPL_LINK( SwView, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg, void ) std::unique_ptr<SfxMedium> pMed = m_pViewImpl->CreateMedium(); if ( !pMed ) + { + std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetEditWin().GetFrameWeld(), + VclMessageType::Info, VclButtonsType::Ok, + SwResId(RID_SVXSTR_TXTFILTER_FILTERERROR))); + xInfoBox->run(); return; + } const sal_uInt16 nSlot = m_pViewImpl->GetRequest()->GetSlot(); long nFound = InsertMedium( nSlot, std::move(pMed), m_pViewImpl->GetParam() ); |