Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Hi all,

There has been a heap of discussion about this in another thread, and
I posted a patch there, but I though I should post a [PATCH] one too.

This is version 3 of the patch. LGPLv3/MIT.

Josh
From 8cea17536d1be944db3e74711e2e0d92594a2d43 Mon Sep 17 00:00:00 2001
From: Josh Heidenreich <josh.sickmate@gmail.com>
Date: Thu, 11 Aug 2011 12:25:48 +0930
Subject: [PATCH] Changes to the "alien" save dialog

This is part one.
Part two will contain additional improvements to the dialog.

This one changes the button text and dialog header.
---
 sfx2/source/dialog/alienwarn.cxx |    7 ++++++-
 sfx2/source/dialog/alienwarn.hrc |    2 +-
 sfx2/source/dialog/alienwarn.src |    6 +++---
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/sfx2/source/dialog/alienwarn.cxx b/sfx2/source/dialog/alienwarn.cxx
index 6e2dd84..c9e95bd 100644
--- a/sfx2/source/dialog/alienwarn.cxx
+++ b/sfx2/source/dialog/alienwarn.cxx
@@ -59,11 +59,16 @@ SfxAlienWarningDialog::SfxAlienWarningDialog( Window* pParent, const String& _rF
     // set questionmark image
     m_aQueryImage.SetImage( QueryBox::GetStandardImage() );
 
-    // replace formatname
+    // replace formatname (text)
     String sInfoText = m_aInfoText.GetText();
     sInfoText.SearchAndReplaceAll( DEFINE_CONST_UNICODE("%FORMATNAME"), _rFormatName );
     m_aInfoText.SetText( sInfoText );
 
+    // replace formatname (button)
+    sInfoText = m_aKeepCurrentBtn.GetText();
+    sInfoText.SearchAndReplaceAll( DEFINE_CONST_UNICODE("%FORMATNAME"), _rFormatName );
+    m_aKeepCurrentBtn.SetText( sInfoText );
+
     // load value of "warning on" checkbox from save options
     m_aWarningOnBox.Check( SvtSaveOptions().IsWarnAlienFormat() == sal_True );
 
@@ -165,21 +165,13 @@ void SfxAlienWarningDialog::InitSize()
     // recalculate the size and position of the buttons
     m_aMoreInfoBtn.Hide();
     nTxtW = m_aKeepCurrentBtn.GetCtrlTextWidth( m_aKeepCurrentBtn.GetText() );
-    long nTemp = m_aSaveODFBtn.GetCtrlTextWidth( m_aSaveODFBtn.GetText() );
-    if ( nTemp > nTxtW )
-        nTxtW = nTemp;
     nTxtW += IMPL_EXTRA_BUTTON_WIDTH;
-    Size a3Size = LogicToPixel( Size( 3, 3 ), MAP_APPFONT );
-    Point aPos = m_aKeepCurrentBtn.GetPosPixel();
-    aPos.X() = ( aNewSize.Width() - (2*nTxtW) - a3Size.Width() ) / 2;
-    long nDefX = m_aWarningOnBox.GetPosPixel().X();
-    if ( nDefX < aPos.X() )
-        aPos.X() = nDefX;
     aNewSize = m_aKeepCurrentBtn.GetSizePixel();
     aNewSize.Width() = nTxtW;
-    m_aKeepCurrentBtn.SetPosSizePixel( aPos, aNewSize );
-    aPos.X() += nTxtW + a3Size.Width();
-    m_aSaveODFBtn.SetPosSizePixel( aPos, aNewSize );
+    m_aKeepCurrentBtn.SetSizePixel( aNewSize );
+    Point aPos = m_aSaveODFBtn.GetPosPixel();
+    aPos.X() = AW_COL_3 + nTxtW;
+    m_aSaveODFBtn.SetPosPixel( aPos );
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/dialog/alienwarn.hrc b/sfx2/source/dialog/alienwarn.hrc
index e3a23dc..9183daf 100755
--- a/sfx2/source/dialog/alienwarn.hrc
+++ b/sfx2/source/dialog/alienwarn.hrc
@@ -42,7 +42,7 @@
 // --------- general metrics ---------
 
 #define SYMBOL_EDGE         20
-#define DIALOG_WIDTH        220
+#define DIALOG_WIDTH        250
 #define INFO_TEXT_LINES     11
 
 #define AW_COL_1            (RSC_SP_DLG_INNERBORDER_LEFT)
diff --git a/sfx2/source/dialog/alienwarn.src b/sfx2/source/dialog/alienwarn.src
index ae07b28..f4f77b4 100644
--- a/sfx2/source/dialog/alienwarn.src
+++ b/sfx2/source/dialog/alienwarn.src
@@ -38,7 +38,7 @@ ModalDialog RID_DLG_ALIEN_WARNING
     Moveable = TRUE;
     SVLook = TRUE;
 
-    Text = "%PRODUCTNAME %PRODUCTVERSION %PRODUCTEXTENSION";
+    Text = "Save";
 
     FixedImage FI_QUERY
     {
@@ -52,20 +52,20 @@ ModalDialog RID_DLG_ALIEN_WARNING
         NoLabel = TRUE;
         Wordbreak = TRUE;
         Text [ en-US-old ] = "This document may contain formatting or content that cannot be saved 
in the %FORMATNAME file format. Do you want to save the document in this format anyway?\n\n- Click 
'Yes' to save in %FORMATNAME file format.\n- Click 'No' to use the latest OpenDocument file format 
and be sure all formatting and content is saved correctly.";
-        Text [ en-US ] = "This document may contain formatting or content that cannot be saved in 
the %FORMATNAME file format. Do you want to save the document in this format anyway?\n\nUse the 
latest ODF file format and be sure all formatting and content is saved correctly.";
+        Text [ en-US ] = "This document may contain formatting or content that cannot be saved in 
the currently selected file format \"%FORMATNAME\".\n\nUse the default ODF file format to be sure 
that the document is saved correctly.";
     };
     OKButton PB_NO
     {
         Pos = MAP_APPFONT( AW_COL_2, AW_ROW_2 );
         Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT );
         DefButton = TRUE ;
-        Text [ en-US ] = "~Keep Current Format";
+        Text [ en-US ] = "~Use %FORMATNAME Format";
     };
     CancelButton PB_YES
     {
         Pos = MAP_APPFONT( AW_COL_3, AW_ROW_2 );
         Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT );
-        Text [ en-US ] = "~Save in ODF Format";
+        Text [ en-US ] = "Use ~ODF Format";
     };
     HelpButton PB_MOREINFO
     {
-- 
1.7.0.4


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.