summaryrefslogtreecommitdiff
path: root/sfx2/source/dialog
diff options
context:
space:
mode:
authorJuan A. Suarez Romero <jasuarez@igalia.com>2014-12-15 19:13:24 +0100
committerJacobo Aragunde Pérez <jaragunde@igalia.com>2015-04-13 09:08:05 +0000
commite904e6ad4876c095ab5ee7bd40540635c520c9de (patch)
treeed4b74b785cf4e8d83ae5b91eb73359f3d3f2783 /sfx2/source/dialog
parent3618909684a892d912482844b81606bca4e0c29c (diff)
tdf#90478: Show the right default format when saving
When saving a file that is not in ODF format (the default format), there is a dialog asking if should keep the original format or rather use ODF. But the default format can be changed to a different one than ODF. And the dialog will still assume the ODF is the default one. This commit fixes the wording in the dialog to use the the default format instead of hard-coded ODF. In order to keep the text simple, instead of using the long name for the default format, it uses the proper file extension. So if for example changes from ODF to Microsoft Word 97 default format, and saving a non-Word document, the dialog will ask user if document should be saved in default DOC format. Change-Id: I0b259af9eca61161ec8a3d7e72d4722b5afdf4b4 Reviewed-on: https://gerrit.libreoffice.org/15170 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jacobo Aragunde Pérez <jaragunde@igalia.com>
Diffstat (limited to 'sfx2/source/dialog')
-rw-r--r--sfx2/source/dialog/alienwarn.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/sfx2/source/dialog/alienwarn.cxx b/sfx2/source/dialog/alienwarn.cxx
index d1dc6ea1c136..e6c8234964b5 100644
--- a/sfx2/source/dialog/alienwarn.cxx
+++ b/sfx2/source/dialog/alienwarn.cxx
@@ -25,7 +25,7 @@
#include <vcl/msgbox.hxx>
#include "alienwarn.hxx"
-SfxAlienWarningDialog::SfxAlienWarningDialog(vcl::Window* pParent, const OUString& _rFormatName)
+SfxAlienWarningDialog::SfxAlienWarningDialog(vcl::Window* pParent, const OUString& _rFormatName, const OUString& _rDefaultExtension)
: MessageDialog(pParent, "AlienWarnDialog", "sfx/ui/alienwarndialog.ui")
{
get(m_pWarningOnBox, "ask");
@@ -34,6 +34,9 @@ SfxAlienWarningDialog::SfxAlienWarningDialog(vcl::Window* pParent, const OUStrin
m_pWarningOnBox->set_margin_left(QueryBox::GetStandardImage().GetSizePixel().Width() + 12);
get(m_pKeepCurrentBtn, "save");
+ get(m_pUseDefaultFormatBtn, "cancel");
+
+ OUString aExtension = _rDefaultExtension.toAsciiUpperCase();
// replace formatname (text)
OUString sInfoText = get_primary_text();
@@ -45,6 +48,11 @@ SfxAlienWarningDialog::SfxAlienWarningDialog(vcl::Window* pParent, const OUStrin
sInfoText = sInfoText.replaceAll( "%FORMATNAME", _rFormatName );
m_pKeepCurrentBtn->SetText( sInfoText );
+ // replace defaultextension (button)
+ sInfoText = m_pUseDefaultFormatBtn->GetText();
+ sInfoText = sInfoText.replaceAll( "%DEFAULTEXTENSION", aExtension );
+ m_pUseDefaultFormatBtn->SetText( sInfoText );
+
// load value of "warning on" checkbox from save options
m_pWarningOnBox->Check( SvtSaveOptions().IsWarnAlienFormat() );
}