|
89 | 89 | #include <sfx2/sfxuno.hxx>
|
90 | 90 | #include <sfx2/viewsh.hxx>
|
91 | 91 | #include <sfx2/bindings.hxx>
|
92 |
| -#include <alienwarn.hxx> |
93 | 92 |
|
94 | 93 | #include <memory>
|
95 | 94 | #include <string_view>
|
|
103 | 102 | #include <osl/file.hxx>
|
104 | 103 | #include <svl/cryptosign.hxx>
|
105 | 104 |
|
| 105 | +#include <vcl/abstdlg.hxx> |
| 106 | + |
106 | 107 | #ifdef _WIN32
|
107 | 108 | #include <Shlobj.h>
|
108 | 109 | #ifdef GetTempPath
|
@@ -2100,9 +2101,31 @@ bool SfxStoringHelper::WarnUnacceptableFormat( const uno::Reference< frame::XMod
|
2100 | 2101 | return true;
|
2101 | 2102 |
|
2102 | 2103 | weld::Window* pWin = SfxStoringHelper::GetModelWindow(xModel);
|
2103 |
| - SfxAlienWarningDialog aDlg(pWin, aOldUIName,aExtension, aDefExtension, bDefIsAlien); |
2104 | 2104 |
|
2105 |
| - return aDlg.run() == RET_OK; |
| 2105 | + OUString sInfoText = SfxResId(STR_QUERY_ALIENFORMAT_TEXT); |
| 2106 | + sInfoText = sInfoText.replaceAll("%FORMATNAME", aOldUIName); |
| 2107 | + sInfoText = sInfoText.replaceAll("%EXTENSION", aExtension); |
| 2108 | + |
| 2109 | + OUString sExtension = u"ODF"_ustr; |
| 2110 | + OUString sQuestion = ""; |
| 2111 | + if (bDefIsAlien) { |
| 2112 | + sExtension = aDefExtension.toAsciiUpperCase(); |
| 2113 | + } |
| 2114 | + else |
| 2115 | + { |
| 2116 | + sQuestion = SfxResId(STR_QUERY_ALIENFORMAT_QUESTION); |
| 2117 | + sQuestion = sQuestion.replaceAll("%EXTENSION", aDefExtension); |
| 2118 | + } |
| 2119 | + |
| 2120 | + VclAbstractDialogFactory* pFact = VclAbstractDialogFactory::Create(); |
| 2121 | + auto pDlg = pFact->CreateQueryDialog(pWin, SfxResId(STR_QUERY_ALIENFORMAT_TTITLE), sInfoText, sQuestion, false); |
| 2122 | + pDlg->SetYesLabel(SfxResId(STR_QUERY_ALIENFORMAT_YES).replaceAll("%FORMATNAME", aOldUIName)); // "Use %FORMATNAME Format" |
| 2123 | + pDlg->SetNoLabel(SfxResId(STR_QUERY_ALIENFORMAT_NO).replaceAll("%DEFAULTEXTENSION", sExtension)); // "Use %DEFAULTEXTENSION _Format" |
| 2124 | + |
| 2125 | + sal_Int32 nResult = pDlg->Execute(); |
| 2126 | + pDlg->disposeOnce(); |
| 2127 | + |
| 2128 | + return nResult == RET_YES; |
2106 | 2129 | }
|
2107 | 2130 |
|
2108 | 2131 | uno::Reference<awt::XWindow> SfxStoringHelper::GetModelXWindow(const uno::Reference<frame::XModel>& xModel)
|
|
0 commit comments