[Libreoffice-commits] .: Branch 'feature/cmclayouttrans' - sw/source

2012-09-11 Thread Libreoffice Gerrit user
 sw/source/ui/misc/linenum.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 429235f5603bb136b12ad7c8c1ce187995aa894e
Author: Caolán McNamara 
Date:   Tue Sep 11 14:29:58 2012 +0100

desensitive row seperator with global on/off numbering

Change-Id: I380249ab6e3d2fc77768b3d1680c7e49fc3a18ba

diff --git a/sw/source/ui/misc/linenum.cxx b/sw/source/ui/misc/linenum.cxx
index 7d37e28..eae93c3 100644
--- a/sw/source/ui/misc/linenum.cxx
+++ b/sw/source/ui/misc/linenum.cxx
@@ -207,11 +207,11 @@ IMPL_LINK_NOARG(SwLineNumberingDlg, OKHdl)
  */
 IMPL_LINK_NOARG(SwLineNumberingDlg, ModifyHdl)
 {
-bool bHasValue = m_pDivisorED->GetText().Len() != 0;
+bool bEnable = m_pNumberingOnCB->IsChecked() && 
m_pDivisorED->GetText().Len() != 0;
 
-m_pDivIntervalFT->Enable(bHasValue);
-m_pDivIntervalNF->Enable(bHasValue);
-m_pDivRowsFT->Enable(bHasValue);
+m_pDivIntervalFT->Enable(bEnable);
+m_pDivIntervalNF->Enable(bEnable);
+m_pDivRowsFT->Enable(bEnable);
 
 return 0;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'feature/cmclayouttrans' - sw/source vcl/inc

2012-08-29 Thread Libreoffice Gerrit user
 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 
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");
+ 

[Libreoffice-commits] .: Branch 'feature/cmclayouttrans' - sw/source vcl/inc vcl/source

2012-08-23 Thread Libreoffice Gerrit user
 sw/source/ui/misc/linenum.cxx |4 ++--
 vcl/inc/vcl/builder.hxx   |2 +-
 vcl/source/window/builder.cxx |2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 45a8c44d5f39d8055003130595f7201b2cd8645a
Author: Caolán McNamara 
Date:   Thu Aug 23 13:33:53 2012 +0100

c++11ism won't wash

Change-Id: I86ce5203998f8e23533c01243b5aac5ac6b4fc53

diff --git a/sw/source/ui/misc/linenum.cxx b/sw/source/ui/misc/linenum.cxx
index 45ceb9d..22196bc 100644
--- a/sw/source/ui/misc/linenum.cxx
+++ b/sw/source/ui/misc/linenum.cxx
@@ -75,8 +75,8 @@ SwLineNumberingDlg::SwLineNumberingDlg(SwView *pVw)
 sIntervalName += String::CreateFromAscii(")");
 m_pDivIntervalNF->SetAccessibleName(sIntervalName);
 
-Window *pNumIntervalFT = m_pUIBuilder->get("interval");
-Window *pNumRowsFT = m_pUIBuilder->get("intervallines");
+Window *pNumIntervalFT = m_pUIBuilder->get("interval");
+Window *pNumRowsFT = m_pUIBuilder->get("intervallines");
 sIntervalName = pNumIntervalFT->GetAccessibleName();
 sIntervalName += String::CreateFromAscii("(");
 sIntervalName += pNumRowsFT->GetAccessibleName();
diff --git a/vcl/inc/vcl/builder.hxx b/vcl/inc/vcl/builder.hxx
index f8703cc..7ee38b5 100644
--- a/vcl/inc/vcl/builder.hxx
+++ b/vcl/inc/vcl/builder.hxx
@@ -145,7 +145,7 @@ public:
 
 return ret;
 }
-template  T* get(rtl::OString sID)
+template  T* get(rtl::OString sID)
 {
 Window *w = get_by_name(sID);
 T* ret = static_cast(w);
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 6f0c9af..379a6fc 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -119,7 +119,7 @@ VclBuilder::VclBuilder(Window *pParent, rtl::OUString 
sUIDir, rtl::OUString sUIF
 for (std::vector::iterator aI = 
m_aAdjustmentMaps.begin(),
  aEnd = m_aAdjustmentMaps.end(); aI != aEnd; ++aI)
 {
-NumericFormatter *pTarget = 
dynamic_cast(get(aI->m_sID));
+NumericFormatter *pTarget = 
dynamic_cast(get(aI->m_sID));
 Adjustment *pAdjustment = get_adjustment_by_name(aI->m_sValue);
 SAL_WARN_IF(!pTarget || !pAdjustment, "vcl", "missing elements of 
spinbutton/adjustment");
 if (pTarget && pAdjustment)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'feature/cmclayouttrans' - sw/source

2012-08-20 Thread Libreoffice Gerrit user
 sw/source/ui/inc/numberingtypelistbox.hxx  |4 +++-
 sw/source/ui/misc/numberingtypelistbox.cxx |   12 ++--
 2 files changed, 13 insertions(+), 3 deletions(-)

New commits:
commit f9480348d46815f4a8242971d9b3d9e2963fb43f
Author: Caolán McNamara 
Date:   Mon Aug 20 11:15:58 2012 +0100

add support for custom property for custom widget

Change-Id: I166522cb801282ce7b887b694e9ab25c84bd7759

diff --git a/sw/source/ui/inc/numberingtypelistbox.hxx 
b/sw/source/ui/inc/numberingtypelistbox.hxx
index 43a20f6..15fdb89 100644
--- a/sw/source/ui/inc/numberingtypelistbox.hxx
+++ b/sw/source/ui/inc/numberingtypelistbox.hxx
@@ -37,9 +37,11 @@ class SW_DLLPUBLIC SwNumberingTypeListBox : public ListBox
 public:
 SwNumberingTypeListBox( Window* pWin, const ResId& rResId,
 sal_uInt16 nTypeFlags = 
INSERT_NUM_TYPE_PAGE_STYLE_NUMBERING|INSERT_NUM_TYPE_NO_NUMBERING|INSERT_NUM_EXTENDED_TYPES
 );
-SwNumberingTypeListBox( Window* pWin, WinBits nStyle = WB_BORDER, 
sal_uInt16 nTypeFlags = 
INSERT_NUM_TYPE_PAGE_STYLE_NUMBERING|INSERT_NUM_TYPE_NO_NUMBERING|INSERT_NUM_EXTENDED_TYPES
 );
+SwNumberingTypeListBox( Window* pWin, WinBits nStyle = WB_BORDER );
 ~SwNumberingTypeListBox();
 
+virtual bool set_property(const rtl::OString &rKey, const rtl::OString 
&rValue);
+
 voidReload(sal_uInt16 nTypeFlags);
 
 sal_Int16   GetSelectedNumberingType();
diff --git a/sw/source/ui/misc/numberingtypelistbox.cxx 
b/sw/source/ui/misc/numberingtypelistbox.cxx
index 82d81b8..1fa26fc 100644
--- a/sw/source/ui/misc/numberingtypelistbox.cxx
+++ b/sw/source/ui/misc/numberingtypelistbox.cxx
@@ -58,7 +58,7 @@ SwNumberingTypeListBox::SwNumberingTypeListBox( Window* pWin, 
const ResId& rResI
 Reload(nTypeFlags);
 }
 
-SwNumberingTypeListBox::SwNumberingTypeListBox( Window* pWin, WinBits nStyle, 
sal_uInt16 nTypeFlags ) :
+SwNumberingTypeListBox::SwNumberingTypeListBox( Window* pWin, WinBits nStyle ) 
:
 ListBox(pWin, nStyle),
 pImpl(new SwNumberingTypeListBox_Impl)
 {
@@ -66,7 +66,15 @@ SwNumberingTypeListBox::SwNumberingTypeListBox( Window* 
pWin, WinBits nStyle, sa
 uno::Reference xDefNum = 
text::DefaultNumberingProvider::create(xContext);
 
 pImpl->xInfo = uno::Reference(xDefNum, 
uno::UNO_QUERY);
-Reload(nTypeFlags);
+}
+
+bool SwNumberingTypeListBox::set_property(const rtl::OString &rKey, const 
rtl::OString &rValue)
+{
+if (rKey.equalsL(RTL_CONSTASCII_STRINGPARAM("type")))
+Reload(rValue.toInt32());
+else
+return ListBox::set_property(rKey, rValue);
+return true;
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL 
makeSwNumberingTypeListBox(Window *pParent)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'feature/cmclayouttrans' - sw/source

2012-08-20 Thread Libreoffice Gerrit user
 sw/source/ui/inc/numberingtypelistbox.hxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit f20676ef83ec128feae22192522444dbc4a2597a
Author: Caolán McNamara 
Date:   Mon Aug 20 10:52:15 2012 +0100

missing piece

Change-Id: Ia04a22f15d26be3cb9d99b0e4d948cd154803d8f

diff --git a/sw/source/ui/inc/numberingtypelistbox.hxx 
b/sw/source/ui/inc/numberingtypelistbox.hxx
index 0a9a339..43a20f6 100644
--- a/sw/source/ui/inc/numberingtypelistbox.hxx
+++ b/sw/source/ui/inc/numberingtypelistbox.hxx
@@ -37,6 +37,7 @@ class SW_DLLPUBLIC SwNumberingTypeListBox : public ListBox
 public:
 SwNumberingTypeListBox( Window* pWin, const ResId& rResId,
 sal_uInt16 nTypeFlags = 
INSERT_NUM_TYPE_PAGE_STYLE_NUMBERING|INSERT_NUM_TYPE_NO_NUMBERING|INSERT_NUM_EXTENDED_TYPES
 );
+SwNumberingTypeListBox( Window* pWin, WinBits nStyle = WB_BORDER, 
sal_uInt16 nTypeFlags = 
INSERT_NUM_TYPE_PAGE_STYLE_NUMBERING|INSERT_NUM_TYPE_NO_NUMBERING|INSERT_NUM_EXTENDED_TYPES
 );
 ~SwNumberingTypeListBox();
 
 voidReload(sal_uInt16 nTypeFlags);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'feature/cmclayouttrans' - sw/source vcl/inc vcl/source

2012-08-20 Thread Libreoffice Gerrit user
 sw/source/ui/misc/numberingtypelistbox.cxx |   18 ++
 vcl/inc/vcl/builder.hxx|1 +
 vcl/source/window/builder.cxx  |   10 +-
 3 files changed, 28 insertions(+), 1 deletion(-)

New commits:
commit 35ab221b8eda66d107bcc7122b7daf09d1229bc7
Author: Caolán McNamara 
Date:   Mon Aug 20 10:50:32 2012 +0100

add a mechanism to create custom widgets via VclBuilder

Change-Id: Ia78ba7126de6a1b3dac3877e3eef9a30194f8777

diff --git a/sw/source/ui/misc/numberingtypelistbox.cxx 
b/sw/source/ui/misc/numberingtypelistbox.cxx
index 4f25c4b..82d81b8 100644
--- a/sw/source/ui/misc/numberingtypelistbox.cxx
+++ b/sw/source/ui/misc/numberingtypelistbox.cxx
@@ -58,6 +58,24 @@ SwNumberingTypeListBox::SwNumberingTypeListBox( Window* 
pWin, const ResId& rResI
 Reload(nTypeFlags);
 }
 
+SwNumberingTypeListBox::SwNumberingTypeListBox( Window* pWin, WinBits nStyle, 
sal_uInt16 nTypeFlags ) :
+ListBox(pWin, nStyle),
+pImpl(new SwNumberingTypeListBox_Impl)
+{
+uno::Reference  xContext( 
::comphelper::getProcessComponentContext() );
+uno::Reference xDefNum = 
text::DefaultNumberingProvider::create(xContext);
+
+pImpl->xInfo = uno::Reference(xDefNum, 
uno::UNO_QUERY);
+Reload(nTypeFlags);
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL 
makeSwNumberingTypeListBox(Window *pParent)
+{
+SwNumberingTypeListBox *pListBox = new SwNumberingTypeListBox(pParent, 
WB_LEFT|WB_DROPDOWN|WB_VCENTER|WB_3DLOOK);
+pListBox->SetDropDownLineCount(16);
+return pListBox;
+}
+
 SwNumberingTypeListBox::~SwNumberingTypeListBox()
 {
 delete pImpl;
diff --git a/vcl/inc/vcl/builder.hxx b/vcl/inc/vcl/builder.hxx
index e43ac1b..48e8a47 100644
--- a/vcl/inc/vcl/builder.hxx
+++ b/vcl/inc/vcl/builder.hxx
@@ -42,6 +42,7 @@ class VCL_DLLPUBLIC VclBuilder
 {
 public:
 typedef std::map stringmap;
+typedef Window* (*customMakeWidget)(Window *pParent);
 private:
 struct WinAndId
 {
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index cd2b30b..b51ab9a 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -26,6 +26,7 @@
  * instead of those above.
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -451,7 +452,14 @@ Window *VclBuilder::makeObject(Window *pParent, const 
rtl::OString &name, const
 else if (name.equalsL(RTL_CONSTASCII_STRINGPARAM("GtkDrawingArea")))
 pWindow = new Window(pParent);
 else
-fprintf(stderr, "TO-DO, implement %s\n", name.getStr());
+{
+rtl::OString sFunction = rtl::OString("make") + name;
+customMakeWidget pFunction = 
(customMakeWidget)osl_getAsciiFunctionSymbol(NULL, sFunction.getStr());
+if (pFunction)
+pWindow = (*pFunction)(pParent);
+}
+if (!pWindow)
+fprintf(stderr, "TO-DO, implement %s or add a make%s function\n", 
name.getStr(), name.getStr());
 if (pWindow)
 {
 pWindow->SetHelpId(m_sHelpRoot + id);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits