[Libreoffice-commits] .: Branch 'feature/cmclayouttrans' - 6 commits - sfx2/inc sfx2/source sw/AllLangResTarget_sw.mk sw/inc sw/source sw/uiconfig sw/UI_swriter.mk vcl/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Aug 29 15:40:38 PDT 2012
sfx2/inc/sfx2/basedlgs.hxx | 4
sfx2/source/dialog/basedlgs.cxx | 26 +++--
sw/AllLangResTarget_sw.mk | 1
sw/UI_swriter.mk | 1
sw/inc/dialog.hrc | 2
sw/inc/helpid.h | 1
sw/inc/swabstdlg.hxx | 7 -
sw/source/ui/dialog/swdlgfact.cxx | 18 ---
sw/source/ui/dialog/swdlgfact.hxx | 7 -
sw/source/ui/dialog/wordcountdialog.cxx | 147 ++++++++---------------------
sw/source/ui/dialog/wordcountdialog.hrc | 41 --------
sw/source/ui/dialog/wordcountdialog.src | 156 -------------------------------
sw/source/ui/dialog/wordcountwrapper.cxx | 3
sw/source/ui/inc/wordcountdialog.hxx | 65 ++----------
sw/uiconfig/swriter/ui/wordcount.ui | 107 +++++++++++----------
vcl/source/window/builder.cxx | 16 ++-
16 files changed, 156 insertions(+), 446 deletions(-)
New commits:
commit bfbb24013514e6ab22354d6d6bb83126ce1bb99b
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Aug 29 23:39:25 2012 +0100
set a preferential width on the char/word count widgets
Change-Id: Icb0fa6e358fa3bc8281b8acdc7214b5cd8204c70
diff --git a/sw/source/ui/dialog/wordcountdialog.cxx b/sw/source/ui/dialog/wordcountdialog.cxx
index fec7055..e3af18c 100644
--- a/sw/source/ui/dialog/wordcountdialog.cxx
+++ b/sw/source/ui/dialog/wordcountdialog.cxx
@@ -34,12 +34,13 @@
#include <docstat.hxx>
#include <dialog.hrc>
#include <cmdid.h>
-#include "vcl/msgbox.hxx" // RET_CANCEL
#include <swmodule.hxx>
#include <wview.hxx>
-#include <sfx2/viewfrm.hxx>
#include <swwait.hxx>
#include <wrtsh.hxx>
+#include <comphelper/string.hxx>
+#include <sfx2/viewfrm.hxx>
+#include <vcl/msgbox.hxx>
IMPL_LINK_NOARG(SwWordCountFloatDlg, CloseHdl)
{
@@ -56,14 +57,23 @@ SwWordCountFloatDlg::~SwWordCountFloatDlg()
ViewShell::SetCareWin( 0 );
}
+namespace
+{
+ void setValue(FixedText *pWidget, sal_uLong nValue)
+ {
+ rtl::OUString sValue(rtl::OUString::valueOf(static_cast<sal_Int64>(nValue)));
+ pWidget->SetText(sValue);
+ }
+}
+
void SwWordCountFloatDlg::SetValues(const SwDocStat& rCurrent, const SwDocStat& rDoc)
{
- m_pCurrentWordFT->SetText(rtl::OUString::valueOf(static_cast<sal_Int64>(rCurrent.nWord)));
- m_pCurrentCharacterFT->SetText(rtl::OUString::valueOf(static_cast<sal_Int64>(rCurrent.nChar)));
- m_pCurrentCharacterExcludingSpacesFT->SetText(rtl::OUString::valueOf(static_cast<sal_Int64>(rCurrent.nCharExcludingSpaces)));
- m_pDocWordFT->SetText(rtl::OUString::valueOf(static_cast<sal_Int64>(rDoc.nWord)));
- m_pDocCharacterFT->SetText(rtl::OUString::valueOf(static_cast<sal_Int64>(rDoc.nChar)));
- m_pDocCharacterExcludingSpacesFT->SetText(rtl::OUString::valueOf(static_cast<sal_Int64>(rDoc.nCharExcludingSpaces)));
+ setValue(m_pCurrentWordFT, rCurrent.nWord);
+ setValue(m_pCurrentCharacterFT, rCurrent.nChar);
+ setValue(m_pCurrentCharacterExcludingSpacesFT, rCurrent.nCharExcludingSpaces);
+ setValue(m_pDocWordFT, rDoc.nWord);
+ setValue(m_pDocCharacterFT, rDoc.nChar);
+ setValue(m_pDocCharacterExcludingSpacesFT, rDoc.nCharExcludingSpaces);
}
//TODO, add asian/non-asian word count to UI when CJK mode is enabled.
@@ -81,6 +91,15 @@ SwWordCountFloatDlg::SwWordCountFloatDlg(SfxBindings* _pBindings,
m_pUIBuilder->get(m_pDocCharacterExcludingSpacesFT, "doccharsnospaces");
m_pUIBuilder->get(m_pClosePB, "close");
+ long nPrefWidth = m_pCurrentWordFT->get_preferred_size().Width();
+
+ m_pCurrentWordFT->set_width_request(nPrefWidth);
+ m_pCurrentCharacterFT->set_width_request(nPrefWidth);
+ m_pCurrentCharacterExcludingSpacesFT->set_width_request(nPrefWidth);
+ m_pDocWordFT->set_width_request(nPrefWidth);
+ m_pDocCharacterFT->set_width_request(nPrefWidth);
+ m_pDocCharacterExcludingSpacesFT->set_width_request(nPrefWidth);
+
Initialize(pInfo);
m_pClosePB->SetClickHdl(LINK(this, SwWordCountFloatDlg, CloseHdl));
diff --git a/sw/uiconfig/swriter/ui/wordcount.ui b/sw/uiconfig/swriter/ui/wordcount.ui
index ef9617f..88fd52d 100644
--- a/sw/uiconfig/swriter/ui/wordcount.ui
+++ b/sw/uiconfig/swriter/ui/wordcount.ui
@@ -133,7 +133,7 @@
<property name="halign">end</property>
<property name="hexpand">True</property>
<property name="xalign">1</property>
- <property name="label"> 0</property>
+ <property name="label"> 0</property>
<property name="justify">right</property>
</object>
<packing>
@@ -150,7 +150,7 @@
<property name="halign">end</property>
<property name="hexpand">True</property>
<property name="xalign">1</property>
- <property name="label"> 0</property>
+ <property name="label"> 0</property>
<property name="justify">right</property>
</object>
<packing>
@@ -167,7 +167,7 @@
<property name="halign">end</property>
<property name="hexpand">True</property>
<property name="xalign">1</property>
- <property name="label"> 0</property>
+ <property name="label"> 0</property>
<property name="justify">right</property>
</object>
<packing>
@@ -268,7 +268,7 @@
<property name="halign">end</property>
<property name="hexpand">True</property>
<property name="xalign">1</property>
- <property name="label"> 0</property>
+ <property name="label"> 0</property>
<property name="justify">right</property>
</object>
<packing>
@@ -285,7 +285,7 @@
<property name="halign">end</property>
<property name="hexpand">True</property>
<property name="xalign">1</property>
- <property name="label"> 0</property>
+ <property name="label"> 0</property>
<property name="justify">right</property>
</object>
<packing>
@@ -302,7 +302,7 @@
<property name="halign">end</property>
<property name="hexpand">True</property>
<property name="xalign">1</property>
- <property name="label"> 0</property>
+ <property name="label"> 0</property>
<property name="justify">right</property>
</object>
<packing>
commit e706694b1e9558a2ff310eacd02ae38504719373
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Aug 29 23:00:23 2012 +0100
missing wordcount.ui install
Change-Id: Ic48a4108e4ff9093f7d6a9724902fa4403c956cd
diff --git a/sw/UI_swriter.mk b/sw/UI_swriter.mk
index 9a561f1..c4a22f5 100644
--- a/sw/UI_swriter.mk
+++ b/sw/UI_swriter.mk
@@ -12,6 +12,7 @@ $(eval $(call gb_UI_UI,modules/swriter))
$(eval $(call gb_UI_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/linenumbering \
sw/uiconfig/swriter/ui/titlepage \
+ sw/uiconfig/swriter/ui/wordcount \
))
# vim: set noet sw=4 ts=4:
commit 16da24cb068ec3674c2aac36736d85e5e748b44d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Aug 29 22:26:53 2012 +0100
enable SfxModelessDialog to load from .ui as well
Change-Id: I31c93091778b9fd51521699c955df8834b9168ff
diff --git a/sfx2/inc/sfx2/basedlgs.hxx b/sfx2/inc/sfx2/basedlgs.hxx
index cfd1288..a8ebc09 100644
--- a/sfx2/inc/sfx2/basedlgs.hxx
+++ b/sfx2/inc/sfx2/basedlgs.hxx
@@ -108,9 +108,13 @@ class SFX2_DLLPUBLIC SfxModelessDialog: public ModelessDialog
SAL_DLLPRIVATE SfxModelessDialog(SfxModelessDialog &); // not defined
SAL_DLLPRIVATE void operator =(SfxModelessDialog &); // not defined
+ void Init(SfxBindings *pBindinx, SfxChildWindow *pCW);
+
protected:
SfxModelessDialog( SfxBindings*, SfxChildWindow*,
Window*, const ResId& );
+ SfxModelessDialog( SfxBindings*, SfxChildWindow*,
+ Window*, const rtl::OString& rID, const rtl::OUString& rUIXMLDescription );
~SfxModelessDialog();
virtual sal_Bool Close();
virtual void Resize();
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index 6733df1..8cbb34e 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -348,19 +348,29 @@ IMPL_LINK_NOARG(SfxModelessDialog, TimerHdl)
return 0;
}
-// -----------------------------------------------------------------------
+SfxModelessDialog::SfxModelessDialog(SfxBindings *pBindinx,
+ SfxChildWindow *pCW, Window *pParent, const ResId& rResId)
+ : ModelessDialog(pParent, rResId)
+{
+ Init(pBindinx, pCW);
+ SetHelpId("");
+}
-SfxModelessDialog::SfxModelessDialog( SfxBindings *pBindinx,
- SfxChildWindow *pCW, Window *pParent,
- const ResId& rResId ) :
- ModelessDialog(pParent, rResId),
- pBindings(pBindinx),
- pImp( new SfxModelessDialog_Impl )
+SfxModelessDialog::SfxModelessDialog(SfxBindings* pBindinx,
+ SfxChildWindow *pCW, Window *pParent, const rtl::OString& rID,
+ const rtl::OUString& rUIXMLDescription)
+ : ModelessDialog(pParent, rID, rUIXMLDescription)
{
+ Init(pBindinx, pCW);
+}
+
+void SfxModelessDialog::Init(SfxBindings *pBindinx, SfxChildWindow *pCW)
+{
+ pBindings = pBindinx;
+ pImp = new SfxModelessDialog_Impl;
pImp->pMgr = pCW;
pImp->bConstructed = sal_False;
SetUniqueId( GetHelpId() );
- SetHelpId("");
if ( pBindinx )
pImp->StartListening( *pBindinx );
pImp->aMoveTimer.SetTimeout(50);
commit 72b47a351a4fa485678f4c2ea3dc0b27747dc38d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Aug 29 22:17:19 2012 +0100
Drop hard-coded layout for wordcount and use Gokul's .ui
Take the opportunity to merge SwWordCountDialog and SwWordCountFloatDlg
together.
Now the cycle is complete, .src -> manual layout -> .ui
Change-Id: I4fb7840b8786ede82ffa1591effc9e4ff444504c
diff --git a/sw/AllLangResTarget_sw.mk b/sw/AllLangResTarget_sw.mk
index 566ce4b..5e6ae48 100644
--- a/sw/AllLangResTarget_sw.mk
+++ b/sw/AllLangResTarget_sw.mk
@@ -115,7 +115,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\
sw/source/ui/dialog/dialog.src \
sw/source/ui/dialog/docstdlg.src \
sw/source/ui/dialog/regionsw.src \
- sw/source/ui/dialog/wordcountdialog.src \
sw/source/ui/dochdl/dochdl.src \
sw/source/ui/dochdl/selglos.src \
sw/source/ui/docvw/annotation.src \
diff --git a/sw/inc/dialog.hrc b/sw/inc/dialog.hrc
index e7757a8..687c7a1 100644
--- a/sw/inc/dialog.hrc
+++ b/sw/inc/dialog.hrc
@@ -27,7 +27,7 @@
#define DLG_PASSWD (RC_DIALOG_BEGIN + 3)
#define DLG_INSERT_ABSTRACT (RC_DIALOG_BEGIN + 8)
#define DLG_ASCII_FILTER (RC_DIALOG_BEGIN + 9)
-#define DLG_WORDCOUNT (RC_DIALOG_BEGIN + 10)
+
#define RID_QB_SPELL_CONTINUE (RC_DIALOG_BEGIN + 11)
#define STR_SPELLING_COMPLETED (RC_DIALOG_BEGIN + 12)
diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h
index fb12c5c..4e596cc 100644
--- a/sw/inc/helpid.h
+++ b/sw/inc/helpid.h
@@ -907,7 +907,6 @@
#define HID_MM_SENDMAILS_STATUSLB "SW_HID_MM_SENDMAILS_STATUSLB"
#define HID_MAILMERGECHILD "SW_HID_MAILMERGECHILD"
#define HID_MM_CUSTOMFIELDS "SW_HID_MM_CUSTOMFIELDS"
-#define HID_DLG_WORDCOUNT "SW_HID_DLG_WORDCOUNT"
#define HID_MM_MAILSTATUS_TLB "SW_HID_MM_MAILSTATUS_TLB"
#define HID_RETURN_TO_MAILMERGE "SW_HID_RETURN_TO_MAILMERGE"
#define HID_MM_SAVEWARNING "SW_HID_MM_SAVEWARNING"
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index 2962991..e8f3994 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -353,11 +353,8 @@ public:
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame,
sal_uInt32 nResId
) = 0;
- virtual AbstractSwWordCountFloatDlg* CreateSwWordCountDialog(int nResId,
- SfxBindings* pBindings,
- SfxChildWindow* pChild,
- Window *pParent,
- SfxChildWinInfo* pInfo) = 0;
+ virtual AbstractSwWordCountFloatDlg* CreateSwWordCountDialog(SfxBindings* pBindings,
+ SfxChildWindow* pChild, Window *pParent, SfxChildWinInfo* pInfo) = 0;
virtual AbstractSwInsertAbstractDlg * CreateSwInsertAbstractDlg ( Window* pParent, int nResId) = 0; // add for SwInsertAbstractDlg
virtual AbstractSwAsciiFilterDlg* CreateSwAsciiFilterDlg ( Window* pParent, SwDocShell& rDocSh,
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index dd291aa..c46ab59 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -1540,24 +1540,14 @@ AbstractMarkFloatDlg * SwAbstractDialogFactory_Impl::CreateAuthMarkFloatDlg( int
return 0;
}
-AbstractSwWordCountFloatDlg * SwAbstractDialogFactory_Impl::CreateSwWordCountDialog( int nResId,
+AbstractSwWordCountFloatDlg * SwAbstractDialogFactory_Impl::CreateSwWordCountDialog(
SfxBindings* pBindings,
SfxChildWindow* pChild,
Window *pParent,
- SfxChildWinInfo* pInfo )
+ SfxChildWinInfo* pInfo)
{
- SwWordCountFloatDlg* pDlg=NULL;
- switch ( nResId )
- {
- case DLG_WORDCOUNT :
- pDlg = new SwWordCountFloatDlg( pBindings, pChild, pParent, pInfo );
- break;
- default:
- break;
- }
- if ( pDlg )
- return new AbstractSwWordCountFloatDlg_Impl( pDlg );
- return 0;
+ SwWordCountFloatDlg* pDlg = new SwWordCountFloatDlg( pBindings, pChild, pParent, pInfo );
+ return new AbstractSwWordCountFloatDlg_Impl( pDlg );
}
//add for SwIndexMarkModalDlg begin
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index f4a24da..37662eb 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -438,11 +438,8 @@ public:
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame,
sal_uInt32 nResId
);
- virtual AbstractSwWordCountFloatDlg* CreateSwWordCountDialog(int nResId,
- SfxBindings* pBindings,
- SfxChildWindow* pChild,
- Window *pParent,
- SfxChildWinInfo* pInfo);
+ virtual AbstractSwWordCountFloatDlg* CreateSwWordCountDialog(SfxBindings* pBindings,
+ SfxChildWindow* pChild, Window *pParent, SfxChildWinInfo* pInfo);
virtual AbstractSwInsertAbstractDlg * CreateSwInsertAbstractDlg( Window* pParent,int nResId );
virtual AbstractSwAsciiFilterDlg* CreateSwAsciiFilterDlg ( Window* pParent, SwDocShell& rDocSh,
SvStream* pStream, int nResId ); //add for SwAsciiFilterDlg
diff --git a/sw/source/ui/dialog/wordcountdialog.cxx b/sw/source/ui/dialog/wordcountdialog.cxx
index b33f17e..fec7055 100644
--- a/sw/source/ui/dialog/wordcountdialog.cxx
+++ b/sw/source/ui/dialog/wordcountdialog.cxx
@@ -33,7 +33,6 @@
#include <wordcountdialog.hxx>
#include <docstat.hxx>
#include <dialog.hrc>
-#include <wordcountdialog.hrc>
#include <cmdid.h>
#include "vcl/msgbox.hxx" // RET_CANCEL
#include <swmodule.hxx>
@@ -42,89 +41,7 @@
#include <swwait.hxx>
#include <wrtsh.hxx>
-//TODO, add asian/non-asian word count to UI when CJK mode is enabled.
-SwWordCountDialog::SwWordCountDialog(Dialog* pParent)
- : vbox(pParent)
- , content_area(&vbox)
- , aCurrentSelection(&content_area, false, 3)
- , aCurrentSelectionText(&aCurrentSelection, SW_RES(FT_CURRENT))
- , aCurrentSelectionLine(&aCurrentSelection, SW_RES(FL_CURRENT))
- , aSelectionBox(&content_area, false, 7)
- , aSelectionRow1(&aSelectionBox)
- , aCurrentWordFT(&aSelectionRow1, SW_RES(FT_CURRENTWORD))
- , aCurrentWordFI(&aSelectionRow1, SW_RES(FI_CURRENTWORD))
- , aSelectionRow2(&aSelectionBox)
- , aCurrentCharacterFT(&aSelectionRow2, SW_RES(FT_CURRENTCHARACTER))
- , aCurrentCharacterFI(&aSelectionRow2, SW_RES(FI_CURRENTCHARACTER))
- , aSelectionRow3(&aSelectionBox)
- , aCurrentCharacterExcludingSpacesFT(&aSelectionRow3, SW_RES(FT_CURRENTCHARACTEREXCLUDINGSPACES))
- , aCurrentCharacterExcludingSpacesFI(&aSelectionRow3, SW_RES(FI_CURRENTCHARACTEREXCLUDINGSPACES))
- , aDoc(&content_area, false, 3)
- , aDocText(&aDoc, SW_RES(FT_DOC))
- , aDocLine(&aDoc, SW_RES(FL_DOC))
- , aDocBox(&content_area, false, 7)
- , aDocRow1(&aDocBox)
- , aDocWordFT(&aDocRow1, SW_RES(FT_DOCWORD))
- , aDocWordFI(&aDocRow1, SW_RES(FI_DOCWORD))
- , aDocRow2(&aDocBox)
- , aDocCharacterFT(&aDocRow2, SW_RES(FT_DOCCHARACTER))
- , aDocCharacterFI(&aDocRow2, SW_RES(FI_DOCCHARACTER))
- , aDocRow3(&aDocBox)
- , aDocCharacterExcludingSpacesFT(&aDocRow3, SW_RES(FT_DOCCHARACTEREXCLUDINGSPACES))
- , aDocCharacterExcludingSpacesFI(&aDocRow3, SW_RES(FI_DOCCHARACTEREXCLUDINGSPACES))
- , aBottomFL(&vbox, SW_RES(FL_BOTTOM))
- , action_area(&vbox)
- , aOK(&action_area, SW_RES(PB_OK))
- , aHelp(&action_area, SW_RES(PB_HELP))
-{
- rtl::OUString sForceInitialSize(RTL_CONSTASCII_USTRINGPARAM(" "));
- aCurrentWordFI.SetText(sForceInitialSize);
- aCurrentCharacterFI.SetText(sForceInitialSize);
- aCurrentCharacterExcludingSpacesFI.SetText(sForceInitialSize);
- aDocWordFI.SetText(sForceInitialSize);
- aDocCharacterFI.SetText(sForceInitialSize);
- aDocCharacterExcludingSpacesFI.SetText(sForceInitialSize);
-
- content_area.set_expand(true);
-
- aCurrentSelectionLine.set_expand(true);
-
- aSelectionBox.set_border_width(7);
-
- aSelectionRow1.set_expand(true);
- aCurrentWordFI.set_expand(true);
-
- aSelectionRow2.set_expand(true);
- aCurrentCharacterFI.set_expand(true);
- aSelectionRow3.set_expand(true);
- aCurrentCharacterExcludingSpacesFI.set_expand(true);
-
- aDocLine.set_expand(true);
-
- aDocBox.set_border_width(7);
-
- aDocRow1.set_expand(true);
- aDocWordFT.set_expand(true);
-
- aDocRow2.set_expand(true);
- aDocCharacterFI.set_expand(true);
- aDocRow3.set_expand(true);
- aDocCharacterExcludingSpacesFI.set_expand(true);
-
- aOK.set_pack_type(VCL_PACK_END);
- aHelp.set_pack_type(VCL_PACK_END);
-
- aOK.SetClickHdl(LINK(this, SwWordCountDialog, OkHdl));
-
- pParent->SetMinOutputSizePixel(vbox.GetOptimalSize(WINDOWSIZE_PREFERRED));
-
-#if OSL_DEBUG_LEVEL > 2
- aDocCharacterExcludingSpacesFT.SetControlBackground(Color(180,0,0));
- aDocCharacterExcludingSpacesFI.SetControlBackground(Color(0,180,0));
-#endif
-}
-
-IMPL_LINK_NOARG(SwWordCountDialog, OkHdl)
+IMPL_LINK_NOARG(SwWordCountFloatDlg, CloseHdl)
{
SfxViewFrame* pVFrame = ::GetActiveView()->GetViewFrame();
if (pVFrame != NULL)
@@ -134,37 +51,40 @@ IMPL_LINK_NOARG(SwWordCountDialog, OkHdl)
return 0;
}
-SwWordCountDialog::~SwWordCountDialog()
+SwWordCountFloatDlg::~SwWordCountFloatDlg()
{
ViewShell::SetCareWin( 0 );
}
-void SwWordCountDialog::SetValues(const SwDocStat& rCurrent, const SwDocStat& rDoc)
+void SwWordCountFloatDlg::SetValues(const SwDocStat& rCurrent, const SwDocStat& rDoc)
{
- aCurrentWordFI.SetText( String::CreateFromInt32(rCurrent.nWord ));
- aCurrentCharacterFI.SetText(String::CreateFromInt32(rCurrent.nChar ));
- aCurrentCharacterExcludingSpacesFI.SetText(String::CreateFromInt32(rCurrent.nCharExcludingSpaces ));
- aDocWordFI.SetText( String::CreateFromInt32(rDoc.nWord ));
- aDocCharacterFI.SetText( String::CreateFromInt32(rDoc.nChar ));
- aDocCharacterExcludingSpacesFI.SetText( String::CreateFromInt32(rDoc.nCharExcludingSpaces ));
+ m_pCurrentWordFT->SetText(rtl::OUString::valueOf(static_cast<sal_Int64>(rCurrent.nWord)));
+ m_pCurrentCharacterFT->SetText(rtl::OUString::valueOf(static_cast<sal_Int64>(rCurrent.nChar)));
+ m_pCurrentCharacterExcludingSpacesFT->SetText(rtl::OUString::valueOf(static_cast<sal_Int64>(rCurrent.nCharExcludingSpaces)));
+ m_pDocWordFT->SetText(rtl::OUString::valueOf(static_cast<sal_Int64>(rDoc.nWord)));
+ m_pDocCharacterFT->SetText(rtl::OUString::valueOf(static_cast<sal_Int64>(rDoc.nChar)));
+ m_pDocCharacterExcludingSpacesFT->SetText(rtl::OUString::valueOf(static_cast<sal_Int64>(rDoc.nCharExcludingSpaces)));
}
-
+//TODO, add asian/non-asian word count to UI when CJK mode is enabled.
SwWordCountFloatDlg::SwWordCountFloatDlg(SfxBindings* _pBindings,
SfxChildWindow* pChild,
Window *pParent,
SfxChildWinInfo* pInfo)
- : SfxModelessDialog(_pBindings, pChild, pParent, SW_RES(DLG_WORDCOUNT)),
-#if defined _MSC_VER
-#pragma warning (disable : 4355)
-#endif
- aDlg(this)
-#if defined _MSC_VER
-#pragma warning (default : 4355)
-#endif
+ : SfxModelessDialog(_pBindings, pChild, pParent, "WordCountDialog", "modules/swriter/ui/wordcount.ui")
{
- FreeResource();
+ m_pUIBuilder->get(m_pCurrentWordFT, "selectwords");
+ m_pUIBuilder->get(m_pCurrentCharacterFT, "selectchars");
+ m_pUIBuilder->get(m_pCurrentCharacterExcludingSpacesFT, "selectcharsnospaces");
+ m_pUIBuilder->get(m_pDocWordFT, "docwords");
+ m_pUIBuilder->get(m_pDocCharacterFT, "docchars");
+ m_pUIBuilder->get(m_pDocCharacterExcludingSpacesFT, "doccharsnospaces");
+ m_pUIBuilder->get(m_pClosePB, "close");
+
Initialize(pInfo);
+
+ m_pClosePB->SetClickHdl(LINK(this, SwWordCountFloatDlg, CloseHdl));
+ m_pClosePB->GrabFocus();
}
void SwWordCountFloatDlg::Activate()
@@ -184,7 +104,7 @@ void SwWordCountFloatDlg::UpdateCounts()
aDocStat = rSh.GetUpdatedDocStat();
rSh.EndAction();
}
- aDlg.SetValues(aCurrCnt, aDocStat);
+ SetValues(aCurrCnt, aDocStat);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dialog/wordcountdialog.hrc b/sw/source/ui/dialog/wordcountdialog.hrc
deleted file mode 100644
index 7fcceb3..0000000
--- a/sw/source/ui/dialog/wordcountdialog.hrc
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef SW_WORDCOUNTDIALOG_HRC
-#define SW_WORDCOUNTDIALOG_HRC
-#define FL_CURRENT 1
-#define FT_CURRENTWORD 2
-#define FI_CURRENTWORD 3
-#define FT_CURRENTCHARACTER 4
-#define FI_CURRENTCHARACTER 5
-#define FT_CURRENTCHARACTEREXCLUDINGSPACES 6
-#define FI_CURRENTCHARACTEREXCLUDINGSPACES 7
-#define FL_DOC 8
-#define FT_DOCWORD 9
-#define FI_DOCWORD 10
-#define FT_DOCCHARACTER 11
-#define FI_DOCCHARACTER 12
-#define FT_DOCCHARACTEREXCLUDINGSPACES 13
-#define FI_DOCCHARACTEREXCLUDINGSPACES 14
-#define FL_BOTTOM 15
-#define PB_OK 16
-#define PB_HELP 17
-#define WINDOW_DLG 18
-#define FT_CURRENT 19
-#define FT_DOC 20
-
-#endif
diff --git a/sw/source/ui/dialog/wordcountdialog.src b/sw/source/ui/dialog/wordcountdialog.src
deleted file mode 100644
index 2675633..0000000
--- a/sw/source/ui/dialog/wordcountdialog.src
+++ /dev/null
@@ -1,156 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include <helpid.h>
-#include <dialog.hrc>
-#include <wordcountdialog.hrc>
-ModelessDialog DLG_WORDCOUNT
-{
- HelpID = HID_DLG_WORDCOUNT ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 170 , 136 ) ;
- Text [ en-US ] = "Word Count" ;
- Moveable = TRUE ;
-
- Closeable = TRUE;
- Sizeable = TRUE ;
- Hide = TRUE ;
-
- FixedText FT_CURRENT
- {
- Pos = MAP_APPFONT ( 5 , 5 ) ;
- Size = MAP_APPFONT ( 160 , 8 ) ;
- Text [ en-US ] = "Current selection";
- };
- FixedLine FL_CURRENT
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 158 , 8 ) ;
- };
- FixedText FT_CURRENTWORD
- {
- Pos = MAP_APPFONT ( 10 , 16 ) ;
- Size = MAP_APPFONT ( 80 , 8 ) ;
- Text [ en-US ] = "Words:";
- };
- FixedText FI_CURRENTWORD
- {
- Pos = MAP_APPFONT ( 114 , 16 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Right = TRUE;
- };
- FixedText FT_CURRENTCHARACTER
- {
- Pos = MAP_APPFONT ( 10 , 28 ) ;
- Size = MAP_APPFONT ( 80 , 8 ) ;
- Text [ en-US ] = "Characters:";
- };
- FixedText FI_CURRENTCHARACTER
- {
- Pos = MAP_APPFONT ( 114 , 28 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Right = TRUE;
- };
- FixedText FT_CURRENTCHARACTEREXCLUDINGSPACES
- {
- Pos = MAP_APPFONT ( 10 , 40 ) ;
- Size = MAP_APPFONT ( 98 , 8 ) ;
- Text [ en-US ] = "Characters excluding spaces:";
- };
- FixedText FI_CURRENTCHARACTEREXCLUDINGSPACES
- {
- Pos = MAP_APPFONT ( 114 , 40 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Right = TRUE;
- };
- FixedText FT_DOC
- {
- Pos = MAP_APPFONT ( 5, 54 ) ;
- Size = MAP_APPFONT ( 160 , 8 ) ;
- Text [ en-US ] = "Whole document";
- };
- FixedLine FL_DOC
- {
- Pos = MAP_APPFONT ( 6, 52 ) ;
- Size = MAP_APPFONT ( 158 , 8 ) ;
- };
- FixedText FT_DOCWORD
- {
- Pos = MAP_APPFONT ( 10, 65 ) ;
- Size = MAP_APPFONT ( 80 , 8 ) ;
- Text [ en-US ] = "Words:";
- };
- FixedText FI_DOCWORD
- {
- Pos = MAP_APPFONT ( 114 , 65 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Right = TRUE;
- };
- FixedText FT_DOCCHARACTER
- {
- Pos = MAP_APPFONT ( 10 , 77 ) ;
- Size = MAP_APPFONT ( 80 , 8 ) ;
- Text [ en-US ] = "Characters:";
- };
- FixedText FI_DOCCHARACTER
- {
- Pos = MAP_APPFONT ( 114, 77 ) ;
- Size = MAP_APPFONT ( 50, 8 ) ;
- Right = TRUE;
- };
- FixedText FT_DOCCHARACTEREXCLUDINGSPACES
- {
- Pos = MAP_APPFONT ( 10 , 89 ) ;
- Size = MAP_APPFONT ( 98 , 8 ) ;
- Text [ en-US ] = "Characters excluding spaces:";
- };
- FixedText FI_DOCCHARACTEREXCLUDINGSPACES
- {
- Pos = MAP_APPFONT ( 114, 89 ) ;
- Size = MAP_APPFONT ( 50, 8 ) ;
- Right = TRUE;
- };
- FixedLine FL_BOTTOM
- {
- Pos = MAP_APPFONT ( 0 , 103 ) ;
- Size = MAP_APPFONT ( 170 , 8 ) ;
- };
- HelpButton PB_HELP
- {
- HelpID = HID_DLG_WORDCOUNT ;
- Pos = MAP_APPFONT ( 5 , 114 ) ;
- Size = MAP_APPFONT ( 50 , 15 ) ;
- };
- OKButton PB_OK
- {
- HelpID = HID_DLG_WORDCOUNT ;
- Pos = MAP_APPFONT ( 115 , 114 ) ;
- Size = MAP_APPFONT ( 50 , 15 ) ;
- DefButton = TRUE ;
- Text [ en-US ] = "~Close";
- };
-};
diff --git a/sw/source/ui/dialog/wordcountwrapper.cxx b/sw/source/ui/dialog/wordcountwrapper.cxx
index aaca02d..70312cf 100644
--- a/sw/source/ui/dialog/wordcountwrapper.cxx
+++ b/sw/source/ui/dialog/wordcountwrapper.cxx
@@ -28,7 +28,6 @@
#include <wordcountdialog.hxx>
#include <docstat.hxx>
#include <dialog.hrc>
-#include <wordcountdialog.hrc>
#include <cmdid.h>
SFX_IMPL_CHILDWINDOW_WITHID(SwWordCountWrapper, FN_WORDCOUNT_DIALOG)
@@ -41,7 +40,7 @@ SwWordCountWrapper::SwWordCountWrapper( Window *pParentWindow,
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
- pAbstDlg = pFact->CreateSwWordCountDialog( DLG_WORDCOUNT, pBindings, this, pParentWindow, pInfo );
+ pAbstDlg = pFact->CreateSwWordCountDialog(pBindings, this, pParentWindow, pInfo);
OSL_ENSURE(pAbstDlg, "Dialog construction failed!");
pWindow = pAbstDlg->GetWindow();
diff --git a/sw/source/ui/inc/wordcountdialog.hxx b/sw/source/ui/inc/wordcountdialog.hxx
index 3ba3a84..db284f8 100644
--- a/sw/source/ui/inc/wordcountdialog.hxx
+++ b/sw/source/ui/inc/wordcountdialog.hxx
@@ -35,67 +35,26 @@ struct SwDocStat;
#include <sfx2/childwin.hxx>
#include "swabstdlg.hxx"
-class SwWordCountDialog
+class SwWordCountFloatDlg : public SfxModelessDialog
{
- VclVBox vbox;
- VclVBox content_area;
-
- VclHBox aCurrentSelection;
- FixedText aCurrentSelectionText;
- FixedLine aCurrentSelectionLine;
-
- VclVBox aSelectionBox;
- VclHBox aSelectionRow1;
- FixedText aCurrentWordFT;
- FixedInfo aCurrentWordFI;
- VclHBox aSelectionRow2;
- FixedText aCurrentCharacterFT;
- FixedInfo aCurrentCharacterFI;
- VclHBox aSelectionRow3;
- FixedText aCurrentCharacterExcludingSpacesFT;
- FixedInfo aCurrentCharacterExcludingSpacesFI;
-
- VclHBox aDoc;
- FixedText aDocText;
- FixedLine aDocLine;
-
- VclVBox aDocBox;
- VclHBox aDocRow1;
- FixedText aDocWordFT;
- FixedInfo aDocWordFI;
- VclHBox aDocRow2;
- FixedText aDocCharacterFT;
- FixedInfo aDocCharacterFI;
- VclHBox aDocRow3;
- FixedText aDocCharacterExcludingSpacesFT;
- FixedInfo aDocCharacterExcludingSpacesFI;
-
- FixedLine aBottomFL;
-
- VclHButtonBox action_area;
- OKButton aOK;
- HelpButton aHelp;
-
- void InitControls();
-
-public:
- SwWordCountDialog(Dialog* pParent);
- ~SwWordCountDialog();
-
+ virtual void Activate();
void SetValues(const SwDocStat& rCurrent, const SwDocStat& rDoc);
- SW_DLLPRIVATE DECL_LINK( OkHdl, void* );
-};
+ FixedText* m_pCurrentWordFT;
+ FixedText* m_pCurrentCharacterFT;
+ FixedText* m_pCurrentCharacterExcludingSpacesFT;
+ FixedText* m_pDocWordFT;
+ FixedText* m_pDocCharacterFT;
+ FixedText* m_pDocCharacterExcludingSpacesFT;
+ PushButton* m_pClosePB;
-class SwWordCountFloatDlg : public SfxModelessDialog
-{
- SwWordCountDialog aDlg;
- virtual void Activate();
- public:
+ SW_DLLPRIVATE DECL_LINK( CloseHdl, void* );
+public:
SwWordCountFloatDlg( SfxBindings* pBindings,
SfxChildWindow* pChild,
Window *pParent,
SfxChildWinInfo* pInfo);
+ ~SwWordCountFloatDlg();
void UpdateCounts();
};
diff --git a/sw/uiconfig/swriter/ui/wordcount.ui b/sw/uiconfig/swriter/ui/wordcount.ui
index 486e574..ef9617f 100644
--- a/sw/uiconfig/swriter/ui/wordcount.ui
+++ b/sw/uiconfig/swriter/ui/wordcount.ui
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
- <object class="GtkDialog" id="dialog1">
+ <object class="GtkDialog" id="WordCountDialog">
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="type_hint">dialog</property>
@@ -13,8 +13,9 @@
<child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area1">
<property name="can_focus">False</property>
+ <property name="layout_style">end</property>
<child>
- <object class="GtkButton" id="101">
+ <object class="GtkButton" id="help">
<property name="label">gtk-help</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
@@ -31,7 +32,7 @@
</packing>
</child>
<child>
- <object class="GtkButton" id="102">
+ <object class="GtkButton" id="close">
<property name="label">gtk-close</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
@@ -73,15 +74,15 @@
<property name="top_padding">7</property>
<property name="bottom_padding">5</property>
<property name="left_padding">5</property>
- <property name="right_padding">5</property>
<child>
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="hexpand">True</property>
<property name="row_spacing">2</property>
- <property name="column_spacing">100</property>
+ <property name="column_spacing">10</property>
<child>
- <object class="GtkLabel" id="3">
+ <object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
@@ -96,77 +97,77 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="4">
+ <object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="halign">center</property>
- <property name="valign">center</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">0</property>
- <property name="justify">right</property>
+ <property name="xalign">0</property>
+ <property name="xpad">10</property>
+ <property name="label" translatable="yes">Characters:</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="5">
+ <object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="xpad">10</property>
- <property name="label" translatable="yes">Characters:</property>
+ <property name="label" translatable="yes">Characters excluding spaces:</property>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="6">
+ <object class="GtkLabel" id="selectwords">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="halign">center</property>
- <property name="valign">end</property>
+ <property name="halign">end</property>
+ <property name="hexpand">True</property>
<property name="xalign">1</property>
- <property name="label" translatable="yes">0</property>
+ <property name="label"> 0</property>
<property name="justify">right</property>
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">1</property>
+ <property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="7">
+ <object class="GtkLabel" id="selectchars">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="xpad">10</property>
- <property name="label" translatable="yes">Characters excluding spaces:</property>
+ <property name="halign">end</property>
+ <property name="hexpand">True</property>
+ <property name="xalign">1</property>
+ <property name="label"> 0</property>
+ <property name="justify">right</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="8">
+ <object class="GtkLabel" id="selectcharsnospaces">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="halign">center</property>
- <property name="valign">end</property>
+ <property name="halign">end</property>
+ <property name="hexpand">True</property>
<property name="xalign">1</property>
- <property name="label" translatable="yes">0</property>
+ <property name="label"> 0</property>
<property name="justify">right</property>
</object>
<packing>
@@ -181,10 +182,10 @@
</object>
</child>
<child type="label">
- <object class="GtkLabel" id="1">
+ <object class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes"><b>Current selection </b></property>
+ <property name="label" translatable="yes">Current selection</property>
<property name="use_markup">True</property>
</object>
</child>
@@ -212,10 +213,11 @@
<object class="GtkGrid" id="grid2">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="hexpand">True</property>
<property name="row_spacing">2</property>
- <property name="column_spacing">100</property>
+ <property name="column_spacing">10</property>
<child>
- <object class="GtkLabel" id="9">
+ <object class="GtkLabel" id="label5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
@@ -230,7 +232,7 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="10">
+ <object class="GtkLabel" id="label6">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
@@ -245,7 +247,7 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="11">
+ <object class="GtkLabel" id="label7">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
@@ -260,12 +262,13 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="12">
+ <object class="GtkLabel" id="docwords">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="halign">center</property>
+ <property name="halign">end</property>
+ <property name="hexpand">True</property>
<property name="xalign">1</property>
- <property name="label" translatable="yes">0</property>
+ <property name="label"> 0</property>
<property name="justify">right</property>
</object>
<packing>
@@ -276,12 +279,13 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="13">
+ <object class="GtkLabel" id="docchars">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="halign">center</property>
+ <property name="halign">end</property>
+ <property name="hexpand">True</property>
<property name="xalign">1</property>
- <property name="label" translatable="yes">0</property>
+ <property name="label"> 0</property>
<property name="justify">right</property>
</object>
<packing>
@@ -292,12 +296,13 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="14">
+ <object class="GtkLabel" id="doccharsnospaces">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="halign">center</property>
+ <property name="halign">end</property>
+ <property name="hexpand">True</property>
<property name="xalign">1</property>
- <property name="label" translatable="yes">0</property>
+ <property name="label"> 0</property>
<property name="justify">right</property>
</object>
<packing>
@@ -312,10 +317,10 @@
</object>
</child>
<child type="label">
- <object class="GtkLabel" id="2">
+ <object class="GtkLabel" id="label8">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes"><b>Whole document</b></property>
+ <property name="label" translatable="yes">Whole document</property>
<property name="use_markup">True</property>
</object>
</child>
@@ -338,8 +343,8 @@
</object>
</child>
<action-widgets>
- <action-widget response="0">101</action-widget>
- <action-widget response="0">102</action-widget>
+ <action-widget response="0">help</action-widget>
+ <action-widget response="0">close</action-widget>
</action-widgets>
</object>
</interface>
commit bafe7d00ddebd03d250deec402c45cfd2d7b2db3
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Aug 29 22:17:02 2012 +0100
map gtk-close -> PushButton+SV_BUTTONTEXT_CLOSE
Change-Id: Ie8de8e23d72a8bad2c5edb097bd8b2c50a8ce4bf
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 8593efa..49373ee 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -267,6 +267,12 @@ namespace
pBtn->SetSymbol(SYMBOL_PREV);
pWindow = pBtn;
}
+ else if (sType.equalsL(RTL_CONSTASCII_STRINGPARAM("gtk-close")))
+ {
+ PushButton *pBtn = new PushButton(pParent, nBits);
+ pBtn->SetText(VclResId(SV_BUTTONTEXT_CLOSE).toString());
+ pWindow = pBtn;
+ }
else
fprintf(stderr, "unknown stock type %s\n", sType.getStr());
}
commit 24fe223dd8019db5311e573d2e1d34528146fe61
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Aug 29 22:08:56 2012 +0100
we need TEXT_RAW to retain leading/trailing label whitespace text
Change-Id: Ic0fe9dba4cb2efcb96830425626a3ae9636ce18c
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index c2f987d..8593efa 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -38,6 +38,8 @@
#include <vcl/svapp.hxx>
#include <vcl/tabctrl.hxx>
#include <vcl/tabpage.hxx>
+#include <svdata.hxx>
+#include <svids.hrc>
#include <window.h>
VclBuilder::VclBuilder(Window *pParent, rtl::OUString sUIDir, rtl::OUString sUIFile, rtl::OString sID)
@@ -158,7 +160,7 @@ void VclBuilder::handleTranslations(xmlreader::XmlReader &reader)
while(1)
{
xmlreader::XmlReader::Result res = reader.nextItem(
- xmlreader::XmlReader::TEXT_NORMALIZED, &name, &nsId);
+ xmlreader::XmlReader::TEXT_RAW, &name, &nsId);
if (res == xmlreader::XmlReader::RESULT_BEGIN)
{
@@ -810,7 +812,7 @@ void VclBuilder::handleListStore(xmlreader::XmlReader &reader, const rtl::OStrin
}
reader.nextItem(
- xmlreader::XmlReader::TEXT_NORMALIZED, &name, &nsId);
+ xmlreader::XmlReader::TEXT_RAW, &name, &nsId);
if (!bTranslated)
sValue = rtl::OString(name.begin, name.length);
@@ -968,7 +970,7 @@ void VclBuilder::applyPackingProperty(Window *pCurrent,
rtl::OString sKey(name.begin, name.length);
sKey = sKey.replace('_', '-');
reader.nextItem(
- xmlreader::XmlReader::TEXT_NORMALIZED, &name, &nsId);
+ xmlreader::XmlReader::TEXT_RAW, &name, &nsId);
rtl::OString sValue(name.begin, name.length);
if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("expand")))
@@ -1054,7 +1056,7 @@ void VclBuilder::collectProperty(xmlreader::XmlReader &reader, const rtl::OStrin
}
- reader.nextItem(xmlreader::XmlReader::TEXT_NORMALIZED, &name, &nsId);
+ reader.nextItem(xmlreader::XmlReader::TEXT_RAW, &name, &nsId);
if (!bTranslated)
sValue = rtl::OString(name.begin, name.length);
More information about the Libreoffice-commits
mailing list