[Libreoffice-commits] .: dbaccess/source svtools/inc svtools/source
Ivan Timofeev
ivantimofeev at kemper.freedesktop.org
Wed Dec 28 09:50:57 PST 2011
dbaccess/source/ui/dlg/CollectionView.cxx | 2 -
svtools/inc/svtools/fileview.hxx | 7 +--
svtools/source/contnr/fileview.cxx | 60 +++++++++++-------------------
svtools/source/contnr/templwin.cxx | 2 -
4 files changed, 26 insertions(+), 45 deletions(-)
New commits:
commit f10fc42189b3d3f6dd180234da9777e53e92b7e4
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date: Wed Dec 28 20:00:03 2011 +0400
fdo#44204: shrink the first column in the open dialog, remove unused flags
diff --git a/dbaccess/source/ui/dlg/CollectionView.cxx b/dbaccess/source/ui/dlg/CollectionView.cxx
index 8370e39..a41a366 100644
--- a/dbaccess/source/ui/dlg/CollectionView.cxx
+++ b/dbaccess/source/ui/dlg/CollectionView.cxx
@@ -80,7 +80,7 @@ OCollectionView::OCollectionView( Window * pParent
, m_aFTCurrentPath( this, ModuleRes( FT_EXPLORERFILE_CURRENTPATH ) )
, m_aNewFolder( this, ModuleRes( BTN_EXPLORERFILE_NEWFOLDER ) )
, m_aUp( this, ModuleRes( BTN_EXPLORERFILE_UP ) )
- , m_aView( this, ModuleRes( CTRL_VIEW ) ,FILEVIEW_SHOW_TITLE )
+ , m_aView( this, ModuleRes( CTRL_VIEW ), FILEVIEW_SHOW_ONLYTITLE )
, m_aFTName( this, ModuleRes( FT_EXPLORERFILE_FILENAME ) )
, m_aName( this, ModuleRes( ED_EXPLORERFILE_FILENAME ) )
, m_aFL( this, ModuleRes( FL_1 ) )
diff --git a/svtools/inc/svtools/fileview.hxx b/svtools/inc/svtools/fileview.hxx
index d56826f..ec40c05 100644
--- a/svtools/inc/svtools/fileview.hxx
+++ b/svtools/inc/svtools/fileview.hxx
@@ -43,11 +43,8 @@
#define FILEVIEW_ONLYFOLDER 0x0001
#define FILEVIEW_MULTISELECTION 0x0002
-#define FILEVIEW_SHOW_TITLE 0x0010
-#define FILEVIEW_SHOW_SIZE 0x0020
-#define FILEVIEW_SHOW_DATE 0x0040
-#define FILEVIEW_SHOW_ALL 0x0070
-#define FILEVIEW_SHOW_NONE 0x0080
+#define FILEVIEW_SHOW_ONLYTITLE 0x0010
+#define FILEVIEW_SHOW_NONE 0x0020
class ViewTabListBox_Impl;
class SvtFileView_Impl;
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index 4f17f34..f726a09 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -722,24 +722,29 @@ ViewTabListBox_Impl::ViewTabListBox_Impl( Window* pParentWin,
mbEnableRename ( sal_True )
{
- sal_Bool bViewHeader = true;
+ const bool bViewHeader = (nFlags & FILEVIEW_SHOW_NONE) == 0;
Size aBoxSize = pParentWin->GetSizePixel();
mpHeaderBar = new HeaderBar( pParentWin, WB_BUTTONSTYLE | WB_BOTTOMBORDER );
mpHeaderBar->SetPosSizePixel( Point( 0, 0 ), mpHeaderBar->CalcWindowSizePixel() );
HeaderBarItemBits nBits = ( HIB_LEFT | HIB_VCENTER | HIB_CLICKABLE );
- if ((nFlags & FILEVIEW_SHOW_NONE) == FILEVIEW_SHOW_NONE)
- bViewHeader = false;
+ if (nFlags & FILEVIEW_SHOW_ONLYTITLE)
+ {
+ long pTabs[] = { 2, 20, 600 };
+ SetTabs(&pTabs[0], MAP_PIXEL);
+
+ mpHeaderBar->InsertItem(COLUMN_TITLE, String(SvtResId(STR_SVT_FILEVIEW_COLUMN_TITLE)), 600, nBits | HIB_UPARROW);
+ }
else
{
- if (nFlags & FILEVIEW_SHOW_TITLE)
- mpHeaderBar->InsertItem(COLUMN_TITLE, String(SvtResId(STR_SVT_FILEVIEW_COLUMN_TITLE)), 600, nBits | HIB_UPARROW);
- if (nFlags & FILEVIEW_SHOW_ALL)
- mpHeaderBar->InsertItem(COLUMN_TYPE, String(SvtResId(STR_SVT_FILEVIEW_COLUMN_TYPE)), 140, nBits);
- if (nFlags & FILEVIEW_SHOW_SIZE)
- mpHeaderBar->InsertItem(COLUMN_SIZE, String(SvtResId(STR_SVT_FILEVIEW_COLUMN_SIZE)), 80, nBits);
- if (nFlags & FILEVIEW_SHOW_DATE)
- mpHeaderBar->InsertItem(COLUMN_DATE, String(SvtResId(STR_SVT_FILEVIEW_COLUMN_DATE)), 500, nBits);
+ long pTabs[] = { 5, 20, 180, 320, 400, 600 };
+ SetTabs(&pTabs[0], MAP_PIXEL);
+ SetTabJustify(2, AdjustRight); // column "Size"
+
+ mpHeaderBar->InsertItem(COLUMN_TITLE, String(SvtResId(STR_SVT_FILEVIEW_COLUMN_TITLE)), 180, nBits | HIB_UPARROW);
+ mpHeaderBar->InsertItem(COLUMN_TYPE, String(SvtResId(STR_SVT_FILEVIEW_COLUMN_TYPE)), 140, nBits);
+ mpHeaderBar->InsertItem(COLUMN_SIZE, String(SvtResId(STR_SVT_FILEVIEW_COLUMN_SIZE)), 80, nBits);
+ mpHeaderBar->InsertItem(COLUMN_DATE, String(SvtResId(STR_SVT_FILEVIEW_COLUMN_DATE)), 500, nBits);
}
Size aHeadSize = mpHeaderBar->GetSizePixel();
@@ -748,6 +753,8 @@ ViewTabListBox_Impl::ViewTabListBox_Impl( Window* pParentWin,
InitHeaderBar( mpHeaderBar );
SetHighlightRange();
SetEntryHeight( ROW_HEIGHT );
+ if (nFlags & FILEVIEW_MULTISELECTION)
+ SetSelectionMode( MULTIPLE_SELECTION );
Show();
if( bViewHeader )
@@ -1211,7 +1218,7 @@ SvtFileView::SvtFileView( Window* pParent, const ResId& rResId,
Control( pParent, rResId )
{
- sal_Int8 nFlags = FILEVIEW_SHOW_ALL;
+ sal_Int8 nFlags = 0;
if ( bOnlyFolder )
nFlags |= FILEVIEW_ONLYFOLDER;
if ( bMultiSelection )
@@ -1225,13 +1232,6 @@ SvtFileView::SvtFileView( Window* pParent, const ResId& rResId,
mpImp->mpView->ForbidEmptyText();
SetSortColumn( true );
- long pTabs[] = { 5, 20, 180, 320, 400, 600 };
- mpImp->mpView->SetTabs( &pTabs[0], MAP_PIXEL );
- mpImp->mpView->SetTabJustify( 2, AdjustRight ); // column "Size"
-
- if ( bMultiSelection )
- mpImp->mpView->SetSelectionMode( MULTIPLE_SELECTION );
-
HeaderBar* pHeaderBar = mpImp->mpView->GetHeaderBar();
pHeaderBar->SetSelectHdl( LINK( this, SvtFileView, HeaderSelect_Impl ) );
pHeaderBar->SetEndDragHdl( LINK( this, SvtFileView, HeaderEndDrag_Impl ) );
@@ -1244,26 +1244,10 @@ SvtFileView::SvtFileView( Window* pParent, const ResId& rResId, sal_uInt8 nFlags
Reference< XInteractionHandler > xInteractionHandler = Reference< XInteractionHandler > (
::comphelper::getProcessServiceFactory()->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uui.InteractionHandler") ) ), UNO_QUERY );
Reference < XCommandEnvironment > xCmdEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< XProgressHandler >() );
- mpImp = new SvtFileView_Impl( this, xCmdEnv, nFlags,
- ( nFlags & FILEVIEW_ONLYFOLDER ) == FILEVIEW_ONLYFOLDER );
- SetSortColumn( true );
- if ( ( nFlags & FILEVIEW_SHOW_ALL ) == FILEVIEW_SHOW_ALL )
- {
- long pTabs[] = { 5, 20, 180, 320, 400, 600 };
- mpImp->mpView->SetTabs( &pTabs[0], MAP_PIXEL );
- mpImp->mpView->SetTabJustify( 2, AdjustRight ); // column "Size"
- }
- else
- {
- // show only title
- long pTabs[] = { 2, 20, 600 };
- mpImp->mpView->SetTabs( &pTabs[0], MAP_PIXEL );
- }
- if ( ( nFlags & FILEVIEW_SHOW_NONE ) == FILEVIEW_SHOW_NONE )
- SetSortColumn( false );
- if ( ( nFlags & FILEVIEW_MULTISELECTION ) == FILEVIEW_MULTISELECTION )
- mpImp->mpView->SetSelectionMode( MULTIPLE_SELECTION );
+ mpImp = new SvtFileView_Impl( this, xCmdEnv, nFlags, nFlags & FILEVIEW_ONLYFOLDER );
+
+ SetSortColumn( (nFlags & FILEVIEW_SHOW_NONE) == 0 );
HeaderBar *pHeaderBar = mpImp->mpView->GetHeaderBar();
pHeaderBar->SetSelectHdl( LINK( this, SvtFileView, HeaderSelect_Impl ) );
diff --git a/svtools/source/contnr/templwin.cxx b/svtools/source/contnr/templwin.cxx
index c2daae8..66f80a4 100644
--- a/svtools/source/contnr/templwin.cxx
+++ b/svtools/source/contnr/templwin.cxx
@@ -585,7 +585,7 @@ SvtFileViewWindow_Impl::SvtFileViewWindow_Impl( SvtTemplateWindow* pParent ) :
Window( pParent, WB_DIALOGCONTROL | WB_TABSTOP | WB_BORDER | WB_3DLOOK ),
rParent ( *pParent ),
- aFileView ( this, SvtResId( CTRL_FILEVIEW ), FILEVIEW_SHOW_NONE ),
+ aFileView ( this, SvtResId( CTRL_FILEVIEW ), FILEVIEW_SHOW_NONE | FILEVIEW_SHOW_ONLYTITLE ),
bIsTemplateFolder ( sal_False )
{
More information about the Libreoffice-commits
mailing list