[Libreoffice-commits] .: Branch 'libreoffice-4-0' - basctl/source cui/source svtools/source svx/source sw/source vcl/inc vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Dec 12 05:30:04 PST 2012


 basctl/source/basicide/bastype2.cxx        |    2 +-
 cui/source/customize/selector.cxx          |    4 ++--
 cui/source/dialogs/hyphen.cxx              |    2 +-
 cui/source/dialogs/scriptdlg.cxx           |    2 +-
 cui/source/dialogs/thesdlg.cxx             |    4 ++--
 svtools/source/contnr/treelistbox.cxx      |    2 +-
 svtools/source/control/ctrlbox.cxx         |    8 ++++----
 svx/source/dialog/charmap.cxx              |    2 +-
 svx/source/dialog/langbox.cxx              |    2 +-
 sw/source/ui/cctrl/actctrl.cxx             |    8 ++++----
 sw/source/ui/misc/numberingtypelistbox.cxx |    2 +-
 vcl/inc/vcl/layout.hxx                     |   13 +++++++++++++
 vcl/source/control/edit.cxx                |   14 +++++++++++++-
 vcl/source/window/dialog.cxx               |   10 ++++++++++
 vcl/source/window/dlgctrl.cxx              |    2 +-
 15 files changed, 56 insertions(+), 21 deletions(-)

New commits:
commit 7d34a702136765cab15edb47aecae9181edd2802
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Dec 12 12:49:58 2012 +0000

    Resolves: fdo#57469 allow tab to traverse into custom widgets
    
    The magic WB_TABSTOP bit is the one that allows a widget to be accepted as a
    candidate for getting focus when pressing tab
    
    (cherry picked from commit 166d8257979aac6775319a9e1f305bc94df97e29)
    
    Conflicts:
    	svx/source/dialog/fontlb.cxx
    
    Change-Id: I7d964bae6b84184ccbc4652d66cf3d2637566405

diff --git a/basctl/source/basicide/bastype2.cxx b/basctl/source/basicide/bastype2.cxx
index 7ea6699..4d2e7e9 100644
--- a/basctl/source/basicide/bastype2.cxx
+++ b/basctl/source/basicide/bastype2.cxx
@@ -194,7 +194,7 @@ TreeListBox::TreeListBox (Window* pParent, ResId const& rRes)
 }
 
 TreeListBox::TreeListBox (Window* pParent)
-    : SvTreeListBox(pParent)
+    : SvTreeListBox(pParent, WB_TABSTOP)
     , m_aNotifier( *this )
 {
     Init();
diff --git a/cui/source/customize/selector.cxx b/cui/source/customize/selector.cxx
index 8d4af3e..dfa8af7 100644
--- a/cui/source/customize/selector.cxx
+++ b/cui/source/customize/selector.cxx
@@ -72,7 +72,7 @@ using namespace ::com::sun::star::container;
  * SvxConfigGroupListBox are copied from sfx2/source/dialog/cfg.cxx
  */
 SvxConfigFunctionListBox::SvxConfigFunctionListBox(Window* pParent)
-    : SvTreeListBox(pParent, WB_CLIPCHILDREN | WB_HSCROLL | WB_SORT)
+    : SvTreeListBox(pParent, WB_CLIPCHILDREN | WB_HSCROLL | WB_SORT | WB_TABSTOP)
     , pCurEntry(0)
     , m_pDraggingEntry(0)
 {
@@ -187,7 +187,7 @@ SvxConfigFunctionListBox::AcceptDrop( const AcceptDropEvent& /*rEvt*/ )
 
 SvxConfigGroupListBox::SvxConfigGroupListBox(Window* pParent)
     : SvTreeListBox(pParent,
-            WB_CLIPCHILDREN | WB_HSCROLL | WB_HASBUTTONS | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONSATROOT)
+            WB_CLIPCHILDREN | WB_HSCROLL | WB_HASBUTTONS | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONSATROOT | WB_TABSTOP)
     , m_bShowSlots(false)
     , m_hdImage(CUI_RES(RID_CUIIMG_HARDDISK))
     , m_libImage(CUI_RES(RID_CUIIMG_LIB))
diff --git a/cui/source/dialogs/hyphen.cxx b/cui/source/dialogs/hyphen.cxx
index de16810..1579941 100644
--- a/cui/source/dialogs/hyphen.cxx
+++ b/cui/source/dialogs/hyphen.cxx
@@ -36,7 +36,7 @@
 #define CUR_HYPH_POS_CHAR   '-'
 
 HyphenEdit::HyphenEdit(Window* pParent)
-    : Edit(pParent, WB_LEFT|WB_VCENTER|WB_BORDER|WB_3DLOOK)
+    : Edit(pParent, WB_LEFT|WB_VCENTER|WB_BORDER|WB_3DLOOK|WB_TABSTOP)
 {
 }
 
diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx
index f149a59..c3ee488 100644
--- a/cui/source/dialogs/scriptdlg.cxx
+++ b/cui/source/dialogs/scriptdlg.cxx
@@ -85,7 +85,7 @@ SFTreeListBox::SFTreeListBox(Window* pParent)
 
     SetStyle( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL |
                    WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HIDESELECTION |
-                   WB_HASLINES | WB_HASLINESATROOT );
+                   WB_HASLINES | WB_HASLINESATROOT | WB_TABSTOP );
     SetNodeDefaultImages();
 
     nMode = 0xFF;    // everything
diff --git a/cui/source/dialogs/thesdlg.cxx b/cui/source/dialogs/thesdlg.cxx
index 0c4e1e0..a78ac3f 100644
--- a/cui/source/dialogs/thesdlg.cxx
+++ b/cui/source/dialogs/thesdlg.cxx
@@ -58,7 +58,7 @@ using ::rtl::OUString;
 // class LookUpComboBox --------------------------------------------------
 
 LookUpComboBox::LookUpComboBox(Window *pParent)
-    : ComboBox(pParent, WB_LEFT|WB_DROPDOWN|WB_VCENTER|WB_3DLOOK)
+    : ComboBox(pParent, WB_LEFT|WB_DROPDOWN|WB_VCENTER|WB_3DLOOK|WB_TABSTOP)
 {
     EnableAutoSize(true);
 
@@ -97,7 +97,7 @@ IMPL_LINK( LookUpComboBox, ModifyTimer_Hdl, Timer *, EMPTYARG /*pTimer*/ )
 // class ReplaceEdit --------------------------------------------------
 
 ReplaceEdit::ReplaceEdit(Window *pParent)
-    : Edit(pParent)
+    : Edit(pParent, WB_BORDER | WB_TABSTOP)
 {
 }
 
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index f55ef95..b6c9613 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -454,7 +454,7 @@ SvTreeListBox::SvTreeListBox(Window* pParent, const ResId& rResId) :
 
 extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvTreeListBox(Window *pParent, VclBuilder::stringmap &)
 {
-    return new SvTreeListBox(pParent);
+    return new SvTreeListBox(pParent, WB_TABSTOP);
 }
 
 void SvTreeListBox::Clear()
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index dd739d4..85eb235 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -133,7 +133,7 @@ namespace
 extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeColorListBox(Window *pParent, VclBuilder::stringmap &rMap)
 {
     bool bDropdown = extractDropdown(rMap);
-    WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK;
+    WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_TABSTOP;
     if (bDropdown)
         nWinBits |= WB_DROPDOWN;
     ColorListBox *pListBox = new ColorListBox(pParent, nWinBits);
@@ -1042,7 +1042,7 @@ FontNameBox::FontNameBox( Window* pParent, const ResId& rResId ) :
 extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeFontNameBox(Window *pParent, VclBuilder::stringmap &rMap)
 {
     bool bDropdown = extractDropdown(rMap);
-    WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK;
+    WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_TABSTOP;
     if (bDropdown)
         nWinBits |= WB_DROPDOWN;
     FontNameBox *pListBox = new FontNameBox(pParent, nWinBits);
@@ -1431,7 +1431,7 @@ FontStyleBox::FontStyleBox( Window* pParent, WinBits nBits ) :
 extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeFontStyleBox(Window *pParent, VclBuilder::stringmap &rMap)
 {
     bool bDropdown = extractDropdown(rMap);
-    WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK;
+    WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_TABSTOP;
     if (bDropdown)
         nWinBits |= WB_DROPDOWN;
     FontStyleBox *pListBox = new FontStyleBox(pParent, nWinBits);
@@ -1651,7 +1651,7 @@ FontSizeBox::FontSizeBox( Window* pParent, const ResId& rResId ) :
 extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeFontSizeBox(Window *pParent, VclBuilder::stringmap &rMap)
 {
     bool bDropdown = extractDropdown(rMap);
-    WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK;
+    WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_TABSTOP;
     if (bDropdown)
         nWinBits |= WB_DROPDOWN;
     FontSizeBox* pListBox = new FontSizeBox(pParent, nWinBits);
diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx
index 817f2dd..42b6417 100644
--- a/svx/source/dialog/charmap.cxx
+++ b/svx/source/dialog/charmap.cxx
@@ -66,7 +66,7 @@ SvxShowCharSet::SvxShowCharSet(Window* pParent, const ResId& rResId)
 }
 
 SvxShowCharSet::SvxShowCharSet(Window* pParent)
-    : Control(pParent)
+    : Control(pParent, WB_TABSTOP)
     , m_pAccessible(NULL)
     , aVscrollSB( this, WB_VERT)
 {
diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx
index 495ebd0..c36517d 100644
--- a/svx/source/dialog/langbox.cxx
+++ b/svx/source/dialog/langbox.cxx
@@ -139,7 +139,7 @@ SvxLanguageBox::SvxLanguageBox( Window* pParent, WinBits nBits, sal_Bool bCheck
 
 extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxLanguageBox(Window *pParent, VclBuilder::stringmap &)
 {
-    SvxLanguageBox *pListBox = new SvxLanguageBox(pParent, WB_LEFT|WB_DROPDOWN|WB_VCENTER|WB_3DLOOK);
+    SvxLanguageBox *pListBox = new SvxLanguageBox(pParent, WB_LEFT|WB_DROPDOWN|WB_VCENTER|WB_3DLOOK|WB_TABSTOP);
     pListBox->EnableAutoSize(true);
     return pListBox;
 }
diff --git a/sw/source/ui/cctrl/actctrl.cxx b/sw/source/ui/cctrl/actctrl.cxx
index 010f1a9..d930a46 100644
--- a/sw/source/ui/cctrl/actctrl.cxx
+++ b/sw/source/ui/cctrl/actctrl.cxx
@@ -51,14 +51,14 @@ long NumEditAction::Notify( NotifyEvent& rNEvt )
 }
 
 NoSpaceEdit::NoSpaceEdit( Window* pParent, const ResId& rResId)
-    : Edit(pParent, rResId),
-    sForbiddenChars(rtl::OUString(" "))
+    : Edit(pParent, rResId)
+    , sForbiddenChars(rtl::OUString(" "))
 {
 }
 
 NoSpaceEdit::NoSpaceEdit(Window* pParent)
-    : Edit(pParent),
-    sForbiddenChars(rtl::OUString(" "))
+    : Edit(pParent, WB_BORDER|WB_TABSTOP)
+    , sForbiddenChars(rtl::OUString(" "))
 {
 }
 
diff --git a/sw/source/ui/misc/numberingtypelistbox.cxx b/sw/source/ui/misc/numberingtypelistbox.cxx
index 83660cc..1344552 100644
--- a/sw/source/ui/misc/numberingtypelistbox.cxx
+++ b/sw/source/ui/misc/numberingtypelistbox.cxx
@@ -70,7 +70,7 @@ bool SwNumberingTypeListBox::set_property(const rtl::OString &rKey, const rtl::O
 
 extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSwNumberingTypeListBox(Window *pParent, VclBuilder::stringmap &)
 {
-    SwNumberingTypeListBox *pListBox = new SwNumberingTypeListBox(pParent, WB_LEFT|WB_DROPDOWN|WB_VCENTER|WB_3DLOOK);
+    SwNumberingTypeListBox *pListBox = new SwNumberingTypeListBox(pParent, WB_LEFT|WB_DROPDOWN|WB_VCENTER|WB_3DLOOK|WB_TABSTOP);
     pListBox->EnableAutoSize(true);
     return pListBox;
 }
diff --git a/vcl/inc/vcl/layout.hxx b/vcl/inc/vcl/layout.hxx
index b09b112..d9c5e63 100644
--- a/vcl/inc/vcl/layout.hxx
+++ b/vcl/inc/vcl/layout.hxx
@@ -547,12 +547,25 @@ bool isVisibleInLayout(const Window *pWindow);
 //return true if this window and its stack of containers are all enabled
 bool isEnabledInLayout(const Window *pWindow);
 
+//Get first window of a pTopLevel window as
+//if any intermediate layout widgets didn't exist
+//i.e. acts like pChild = pChild->GetWindow(WINDOW_FIRSTCHILD);
+//in a flat hierarchy where dialogs only have one layer
+//of children
+Window* firstLogicalChildOfParent(Window *pTopLevel);
+
 //Get next window after pChild of a pTopLevel window as
 //if any intermediate layout widgets didn't exist
 //i.e. acts like pChild = pChild->GetWindow(WINDOW_NEXT);
 //in a flat hierarchy where dialogs only have one layer
 //of children
 Window* nextLogicalChildOfParent(Window *pTopLevel, Window *pChild);
+
+//Get previous window before pChild of a pTopLevel window as
+//if any intermediate layout widgets didn't exist
+//i.e. acts like pChild = pChild->GetWindow(WINDOW_PREV);
+//in a flat hierarchy where dialogs only have one layer
+//of children
 Window* prevLogicalChildOfParent(Window *pTopLevel, Window *pChild);
 
 inline bool isContainerWindow(const Window &rWindow)
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index a82a465..f0c697e 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -229,7 +229,19 @@ bool Edit::set_property(const rtl::OString &rKey, const rtl::OString &rValue)
         SetMaxTextLen(nTextLen == 0 ? EDIT_NOLIMIT : nTextLen);
     }
     else if (rKey == "editable")
-        SetReadOnly(!toBool(rValue));
+    {
+        bool bReadOnly = !toBool(rValue);
+        SetReadOnly(bReadOnly);
+        //disable tab to traverse into readonly editables
+        WinBits nBits = GetStyle();
+        nBits &= ~(WB_TABSTOP|WB_NOTABSTOP);
+        if (!bReadOnly)
+            nBits |= WB_TABSTOP;
+        else
+            nBits |= WB_NOTABSTOP;
+        fprintf(stderr, "tabstop is %ld\n", nBits & WB_TABSTOP);
+        SetStyle(nBits);
+    }
     else if (rKey == "visibility")
     {
         WinBits nBits = GetStyle();
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 3ef0f44..513dd50 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -171,6 +171,16 @@ Window * prevLogicalChildOfParent(Window *pTopLevel, Window *pChild)
     return pChild;
 }
 
+//Get first window of a pTopLevel window as
+//if any intermediate layout widgets didn't exist
+Window * firstLogicalChildOfParent(Window *pTopLevel)
+{
+    Window *pChild = pTopLevel->GetWindow(WINDOW_FIRSTCHILD);
+    if (pChild && isContainerWindow(*pChild))
+        pChild = nextLogicalChildOfParent(pTopLevel, pChild);
+    return pChild;
+}
+
 // -----------------------------------------------------------------------
 
 void ImplWindowAutoMnemonic( Window* pWindow )
diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx
index 0ff589b..6c481da 100644
--- a/vcl/source/window/dlgctrl.cxx
+++ b/vcl/source/window/dlgctrl.cxx
@@ -78,7 +78,7 @@ static Window* ImplGetSubChildWindow( Window* pParent, sal_uInt16 n, sal_uInt16&
     Window*     pTabPage = NULL;
     Window*     pFoundWindow = NULL;
 
-    Window*     pWindow = pParent->GetWindow( WINDOW_FIRSTCHILD );
+    Window*     pWindow = firstLogicalChildOfParent(pParent);
     Window*     pNextWindow = pWindow;
     while ( pWindow )
     {


More information about the Libreoffice-commits mailing list