[Libreoffice-commits] .: Branch 'feature/cmclayouttrans' - sw/source vcl/inc
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Aug 29 17:01:07 PDT 2012
sw/source/ui/dialog/wordcountdialog.cxx | 14 +++++++-------
sw/source/ui/misc/linenum.cxx | 28 ++++++++++++++--------------
sw/source/ui/misc/titlepage.cxx | 24 ++++++++++++------------
vcl/inc/vcl/builder.hxx | 8 ++++++++
4 files changed, 41 insertions(+), 33 deletions(-)
New commits:
commit 9637bf0a2e34ec80b351ff47aa9e9af0a5191187
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Aug 30 00:56:52 2012 +0100
make a dialog basically a dictionary of child widgets
so call get("name") on a dialog to get the child widget of that name
Change-Id: Ib6ebe8e0165ec3e1f50de9295855042b65faf5d1
diff --git a/sw/source/ui/dialog/wordcountdialog.cxx b/sw/source/ui/dialog/wordcountdialog.cxx
index e3af18c..da028ef 100644
--- a/sw/source/ui/dialog/wordcountdialog.cxx
+++ b/sw/source/ui/dialog/wordcountdialog.cxx
@@ -83,13 +83,13 @@ SwWordCountFloatDlg::SwWordCountFloatDlg(SfxBindings* _pBindings,
SfxChildWinInfo* pInfo)
: SfxModelessDialog(_pBindings, pChild, pParent, "WordCountDialog", "modules/swriter/ui/wordcount.ui")
{
- 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");
+ get(m_pCurrentWordFT, "selectwords");
+ get(m_pCurrentCharacterFT, "selectchars");
+ get(m_pCurrentCharacterExcludingSpacesFT, "selectcharsnospaces");
+ get(m_pDocWordFT, "docwords");
+ get(m_pDocCharacterFT, "docchars");
+ get(m_pDocCharacterExcludingSpacesFT, "doccharsnospaces");
+ get(m_pClosePB, "close");
long nPrefWidth = m_pCurrentWordFT->get_preferred_size().Width();
diff --git a/sw/source/ui/misc/linenum.cxx b/sw/source/ui/misc/linenum.cxx
index 22196bc..cbbfb62 100644
--- a/sw/source/ui/misc/linenum.cxx
+++ b/sw/source/ui/misc/linenum.cxx
@@ -54,20 +54,20 @@ SwLineNumberingDlg::SwLineNumberingDlg(SwView *pVw)
"modules/swriter/ui/linenumbering.ui" )
, pSh(pVw->GetWrtShellPtr())
{
- m_pUIBuilder->get(m_pBodyContent, "content");
- m_pUIBuilder->get(m_pDivIntervalFT, "every");
- m_pUIBuilder->get(m_pDivIntervalNF, "linesspin");
- m_pUIBuilder->get(m_pDivRowsFT, "lines");
- m_pUIBuilder->get(m_pNumIntervalNF, "intervalspin");
- m_pUIBuilder->get(m_pCharStyleLB, "styledropdown");
- m_pUIBuilder->get(m_pFormatLB, "formatdropdown");
- m_pUIBuilder->get(m_pPosLB, "positiondropdown");
- m_pUIBuilder->get(m_pOffsetMF, "spacingspin");
- m_pUIBuilder->get(m_pDivisorED, "textentry");
- m_pUIBuilder->get(m_pCountEmptyLinesCB, "blanklines");
- m_pUIBuilder->get(m_pCountFrameLinesCB, "linesintextframes");
- m_pUIBuilder->get(m_pRestartEachPageCB, "restarteverynewpage");
- m_pUIBuilder->get(m_pNumberingOnCB, "shownumbering");
+ get(m_pBodyContent, "content");
+ get(m_pDivIntervalFT, "every");
+ get(m_pDivIntervalNF, "linesspin");
+ get(m_pDivRowsFT, "lines");
+ get(m_pNumIntervalNF, "intervalspin");
+ get(m_pCharStyleLB, "styledropdown");
+ get(m_pFormatLB, "formatdropdown");
+ get(m_pPosLB, "positiondropdown");
+ get(m_pOffsetMF, "spacingspin");
+ get(m_pDivisorED, "textentry");
+ get(m_pCountEmptyLinesCB, "blanklines");
+ get(m_pCountFrameLinesCB, "linesintextframes");
+ get(m_pRestartEachPageCB, "restarteverynewpage");
+ get(m_pNumberingOnCB, "shownumbering");
String sIntervalName = m_pDivIntervalFT->GetAccessibleName();
sIntervalName += String::CreateFromAscii("(");
diff --git a/sw/source/ui/misc/titlepage.cxx b/sw/source/ui/misc/titlepage.cxx
index fd9086a..1ba37c5 100644
--- a/sw/source/ui/misc/titlepage.cxx
+++ b/sw/source/ui/misc/titlepage.cxx
@@ -156,18 +156,18 @@ SwTitlePageDlg::SwTitlePageDlg( Window *pParent ) :
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("modules/swriter/ui/titlepage.ui")) ),
mpPageFmtDesc(0)
{
- m_pUIBuilder->get(m_pUseExistingPagesRB, "RB_USE_EXISTING_PAGES");
- m_pUIBuilder->get(m_pPageCountNF, "NF_PAGE_COUNT");
- m_pUIBuilder->get(m_pDocumentStartRB, "RB_DOCUMENT_START");
- m_pUIBuilder->get(m_pPageStartRB, "RB_PAGE_START");
- m_pUIBuilder->get(m_pPageStartNF, "NF_PAGE_START");
- m_pUIBuilder->get(m_pRestartNumberingCB, "CB_RESTART_NUMBERING");
- m_pUIBuilder->get(m_pRestartNumberingNF, "NF_RESTART_NUMBERING");
- m_pUIBuilder->get(m_pSetPageNumberCB, "CB_SET_PAGE_NUMBER");
- m_pUIBuilder->get(m_pSetPageNumberNF, "NF_SET_PAGE_NUMBER");
- m_pUIBuilder->get(m_pPagePropertiesLB, "LB_PAGE_PROPERTIES");
- m_pUIBuilder->get(m_pPagePropertiesPB, "PB_PAGE_PROPERTIES");
- m_pUIBuilder->get(m_pOkPB, "PB_OK");
+ get(m_pUseExistingPagesRB, "RB_USE_EXISTING_PAGES");
+ get(m_pPageCountNF, "NF_PAGE_COUNT");
+ get(m_pDocumentStartRB, "RB_DOCUMENT_START");
+ get(m_pPageStartRB, "RB_PAGE_START");
+ get(m_pPageStartNF, "NF_PAGE_START");
+ get(m_pRestartNumberingCB, "CB_RESTART_NUMBERING");
+ get(m_pRestartNumberingNF, "NF_RESTART_NUMBERING");
+ get(m_pSetPageNumberCB, "CB_SET_PAGE_NUMBER");
+ get(m_pSetPageNumberNF, "NF_SET_PAGE_NUMBER");
+ get(m_pPagePropertiesLB, "LB_PAGE_PROPERTIES");
+ get(m_pPagePropertiesPB, "PB_PAGE_PROPERTIES");
+ get(m_pOkPB, "PB_OK");
m_pOkPB->SetClickHdl(LINK(this, SwTitlePageDlg, OKHdl));
m_pRestartNumberingCB->SetClickHdl(LINK(this, SwTitlePageDlg, RestartNumberingHdl));
diff --git a/vcl/inc/vcl/builder.hxx b/vcl/inc/vcl/builder.hxx
index d77b139..0f6f228 100644
--- a/vcl/inc/vcl/builder.hxx
+++ b/vcl/inc/vcl/builder.hxx
@@ -223,6 +223,14 @@ public:
virtual ~VclBuilderContainer();
static VclBuilder* overrideResourceWithUIXML(Window *pWindow, const ResId& rResId);
static bool replace_buildable(Window *pParent, const ResId& rResId, Window &rReplacement);
+ template <typename T> T* get(T*& ret, rtl::OString sID)
+ {
+ return m_pUIBuilder->get<T>(ret, sID);
+ }
+ template <typename T /*=Window if we had c++11*/> T* get(rtl::OString sID)
+ {
+ return m_pUIBuilder->get<T>(sID);
+ }
};
More information about the Libreoffice-commits
mailing list