[Libreoffice-commits] core.git: include/svtools sfx2/source

Caolán McNamara caolanm at redhat.com
Sat Oct 8 19:50:31 UTC 2016


 include/svtools/controldims.hrc |    2 --
 sfx2/source/dialog/dinfdlg.cxx  |   40 ++++++++++++++++++++++------------------
 sfx2/source/dialog/dinfdlg.hrc  |    5 -----
 sfx2/source/dialog/dinfdlg.src  |   14 --------------
 4 files changed, 22 insertions(+), 39 deletions(-)

New commits:
commit 45758da19a376233fd7bc4fdf26bd3d012c5c135
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Oct 8 16:51:46 2016 +0100

    de-src last two RadioButtons
    
    Change-Id: I8e6f7ec86a17b2ee87a62a5fbe235047413ec403

diff --git a/include/svtools/controldims.hrc b/include/svtools/controldims.hrc
index 5473390..af9ace9 100644
--- a/include/svtools/controldims.hrc
+++ b/include/svtools/controldims.hrc
@@ -37,8 +37,6 @@
 
 #define RSC_CD_TEXTBOX_HEIGHT               12      // also numeric fields etc.
 
-#define RSC_CD_RADIOBUTTON_HEIGHT           10
-
 // spacings
 #define RSC_SP_CTRL_X                       6       // controls that are unrelated
 #define RSC_SP_CTRL_Y                       7
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 3d28a70..62176bf 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -17,17 +17,18 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <svl/eitem.hxx>
+#include <svl/urihelper.hxx>
+#include <tools/datetime.hxx>
 #include <tools/urlobj.hxx>
 #include <vcl/layout.hxx>
-#include <svl/eitem.hxx>
+#include <vcl/mnemonic.hxx>
 #include <vcl/svapp.hxx>
 #include <unotools/localedatawrapper.hxx>
 #include <unotools/cmdoptions.hxx>
 #include <comphelper/processfactory.hxx>
-#include <svl/urihelper.hxx>
 #include <unotools/useroptions.hxx>
 #include <svtools/imagemgr.hxx>
-#include <tools/datetime.hxx>
 
 #include <memory>
 
@@ -1230,12 +1231,16 @@ void SfxDocumentInfoDialog::AddFontTabPage()
 
 // class CustomPropertiesYesNoButton -------------------------------------
 
-CustomPropertiesYesNoButton::CustomPropertiesYesNoButton( vcl::Window* pParent, const ResId& rResId ) :
-    Control( pParent, rResId ),
-    m_aYesButton( VclPtr<RadioButton>::Create(this, ResId( RB_PROPERTY_YES, *rResId.GetResMgr() )) ),
-    m_aNoButton ( VclPtr<RadioButton>::Create(this, ResId( RB_PROPERTY_NO, *rResId.GetResMgr() )) )
+CustomPropertiesYesNoButton::CustomPropertiesYesNoButton(vcl::Window* pParent, const ResId& rResId)
+    : Control(pParent, rResId)
+    , m_aYesButton(VclPtr<RadioButton>::Create(this, WB_TABSTOP))
+    , m_aNoButton(VclPtr<RadioButton>::Create(this, WB_TABSTOP))
 {
     FreeResource();
+    m_aYesButton->SetText(MnemonicGenerator::EraseAllMnemonicChars(Button::GetStandardText(StandardButtonType::Yes)));
+    m_aYesButton->Show();
+    m_aNoButton->SetText(MnemonicGenerator::EraseAllMnemonicChars(Button::GetStandardText(StandardButtonType::No)));
+    m_aNoButton->Show();
     SetBackground( Wallpaper( GetSettings().GetStyleSettings().GetFieldColor() ) );
     SetBorderStyle( WindowBorderStyle::MONO  );
     CheckNo();
@@ -1244,7 +1249,6 @@ CustomPropertiesYesNoButton::CustomPropertiesYesNoButton( vcl::Window* pParent,
     m_aNoButton->SetBackground( aWall );
 }
 
-
 CustomPropertiesYesNoButton::~CustomPropertiesYesNoButton()
 {
     disposeOnce();
@@ -1386,16 +1390,16 @@ IMPL_LINK_NOARG(CustomPropertiesEditButton, ClickHdl, Button*, void)
 
 void CustomPropertiesYesNoButton::Resize()
 {
-    const long nWidth = GetSizePixel().Width();
-    const long n3Width = LogicToPixel( Size( 3, 3 ), MapUnit::MapAppFont ).Width();
-    const long nNewWidth = ( nWidth / 2 ) - n3Width - 2;
-    Size aSize = m_aYesButton->GetSizePixel();
-    const long nDelta = aSize.Width() - nNewWidth;
-    aSize.Width() = nNewWidth;
-    m_aYesButton->SetSizePixel( aSize );
-    Point aPos = m_aNoButton->GetPosPixel();
-    aPos.X() -= nDelta;
-    m_aNoButton->SetPosSizePixel( aPos, aSize );
+    Size aParentSize(GetSizePixel());
+    const long nWidth = aParentSize.Width();
+    Size a1Size = LogicToPixel(Size(1, 1), MapUnit::MapAppFont);
+    const long n3Width = LogicToPixel(Size(3, 3), MapUnit::MapAppFont).Width();
+    const long nNewWidth = (nWidth / 2) - n3Width - 2;
+    Size aSize(nNewWidth, aParentSize.Height() - 2 * a1Size.Height());
+    Point aPos(a1Size.Width(), a1Size.Height());
+    m_aYesButton->SetPosSizePixel(aPos, aSize);
+    aPos.X() += aSize.Width() + n3Width;
+    m_aNoButton->SetPosSizePixel(aPos, aSize);
 }
 
 // struct CustomPropertyLine ---------------------------------------------
diff --git a/sfx2/source/dialog/dinfdlg.hrc b/sfx2/source/dialog/dinfdlg.hrc
index 615aa4d..5d0e855 100644
--- a/sfx2/source/dialog/dinfdlg.hrc
+++ b/sfx2/source/dialog/dinfdlg.hrc
@@ -37,11 +37,6 @@
 #define CMIS_TYPE_DATETIME    "Datetime"
 #define CMIS_TYPE_BOOL        "Bool"
 
-// defines ---------------------------------------------------------------
-
-#define RB_PROPERTY_YES     100
-#define RB_PROPERTY_NO      101
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/dialog/dinfdlg.src b/sfx2/source/dialog/dinfdlg.src
index f981589..2a92900 100644
--- a/sfx2/source/dialog/dinfdlg.src
+++ b/sfx2/source/dialog/dinfdlg.src
@@ -108,20 +108,6 @@ Control SFX_WIN_PROPERTY_YESNO
     Size = MAP_APPFONT ( 61 , RSC_CD_TEXTBOX_HEIGHT ) ;
     Border = TRUE ;
     DialogControl = TRUE ;
-    RadioButton RB_PROPERTY_YES
-    {
-        TabStop = TRUE ;
-        Pos = MAP_APPFONT( 1 , 1 ) ;
-        Size = MAP_APPFONT( 28 , RSC_CD_RADIOBUTTON_HEIGHT ) ;
-        Text [ en-US ] = "Yes" ;
-    };
-    RadioButton RB_PROPERTY_NO
-    {
-        TabStop = TRUE ;
-        Pos = MAP_APPFONT( 32 , 1 ) ;
-        Size = MAP_APPFONT( 29 , RSC_CD_RADIOBUTTON_HEIGHT ) ;
-        Text [ en-US ] = "No" ;
-    };
 };
 
 String STR_SFX_REMOVE_PROPERTY


More information about the Libreoffice-commits mailing list