[Libreoffice-commits] core.git: 2 commits - sfx2/source
Cédric Bosdonnat
cedric.bosdonnat at free.fr
Wed Mar 20 09:29:45 PDT 2013
sfx2/source/control/thumbnailview.cxx | 19 ++++++++++++++++++-
sfx2/source/doc/templatedlg.cxx | 2 +-
2 files changed, 19 insertions(+), 2 deletions(-)
New commits:
commit ec2f84b376f595b0553297d25b7716f6b97e1b87
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date: Wed Mar 20 17:06:31 2013 +0100
Template Manager: select first item when getting focus if no selection
Change-Id: Ie012e010ca92728725535345c76fc9f5eb31a254
diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx
index 78f8e32..3695068 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -576,12 +576,29 @@ void ThumbnailView::Paint( const Rectangle &aRect)
void ThumbnailView::GetFocus()
{
- Control::GetFocus();
+ // Select the first item if nothing selected
+ int nSelected = -1;
+ for (size_t i = 0, n = mItemList.size(); i < n && nSelected == -1; ++i)
+ {
+ if (mItemList[i]->isSelected())
+ nSelected = i;
+ }
+
+ if ( nSelected == -1 && mItemList.size( ) > 0 )
+ {
+ mItemList[0]->setSelection(true);
+ maItemStateHdl.Call(mItemList[0]);
+
+ if (IsReallyVisible() && IsUpdateMode())
+ Invalidate();
+ }
// Tell the accessible object that we got the focus.
ThumbnailViewAcc* pAcc = ThumbnailViewAcc::getImplementation( GetAccessible( sal_False ) );
if( pAcc )
pAcc->GetFocus();
+
+ Control::GetFocus();
}
void ThumbnailView::LoseFocus()
commit 5fa5f9561dddd2c53511fb951660b4ad397321e8
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date: Wed Mar 20 16:03:29 2013 +0100
Template Manager: fixed control WinBits reset... was breaking tabstop
Change-Id: I6e542ecc0e0f5a2b3e0ca59a52bb809b1a23284f
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 6a828ce..5f18109 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -164,7 +164,7 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
mpSearchEdit->SetUpdateDataHdl(LINK(this,SfxTemplateManagerDlg,SearchUpdateHdl));
mpSearchEdit->EnableUpdateData();
- maView->SetStyle(WB_VSCROLL);
+ maView->SetStyle(maView->GetStyle() | WB_VSCROLL);
maView->setItemMaxTextLength(TEMPLATE_ITEM_MAX_TEXT_LENGTH);
maView->setItemDimensions(TEMPLATE_ITEM_MAX_WIDTH,TEMPLATE_ITEM_THUMBNAIL_MAX_HEIGHT,
More information about the Libreoffice-commits
mailing list