update dev300-m57
[ooovba.git] / applied_patches / 0168-svtools-unsort-template-dialogentries.diff
blob8640392583fc87bb561c08e56e411b8dc1618cf8
1 --- svtools/source/contnr/templwin.cxx.old 2009-04-06 16:41:53.000000000 +0000
2 +++ svtools/source/contnr/templwin.cxx 2009-04-06 16:41:53.000000000 +0000
3 @@ -108,6 +108,7 @@ using namespace ::com::sun::star::view;
4 using namespace svtools;
6 extern ::rtl::OUString CreateExactSizeText_Impl( sal_Int64 nSize ); // fileview.cxx
7 +#define aSeparatorStr "----------------------------------"
9 #define SPLITSET_ID 0
10 #define COLSET_ID 1
11 @@ -606,7 +607,7 @@ SvtFileViewWindow_Impl::SvtFileViewWindo
12 Window( pParent, WB_DIALOGCONTROL | WB_TABSTOP | WB_BORDER | WB_3DLOOK ),
14 rParent ( *pParent ),
15 - aFileView ( this, SvtResId( CTRL_FILEVIEW ), FILEVIEW_SHOW_TITLE ),
16 + aFileView ( this, SvtResId( CTRL_FILEVIEW ), FILEVIEW_SHOW_NONE ),
17 bIsTemplateFolder ( sal_False )
20 @@ -662,9 +663,14 @@ Sequence< ::rtl::OUString > SvtFileViewW
21 for ( i = 0; i < nCount; ++i )
23 GetMenuEntry_Impl( aDynamicMenuEntries[i], aTitle, aURL, aTargetFrame, aImageURL );
25 - if ( aURL == sSeparator || aURL == sSlotURL )
26 + if( aURL == sSlotURL )
27 continue;
28 + if( aURL == sSeparator )
29 + {
30 + String aSeparator( ASCII_STR( aSeparatorStr ) );
31 + ::rtl::OUString* pSeparator = new ::rtl::OUString( aSeparator );
32 + aNewDocs.Insert( pSeparator, LIST_APPEND );
33 + }
34 else
36 // title
37 --- svtools/source/contnr/fileview.cxx.old 2009-04-02 11:06:15.000000000 +0000
38 +++ svtools/source/contnr/fileview.cxx 2009-04-06 16:41:53.000000000 +0000
39 @@ -103,6 +103,8 @@ using ::rtl::OUString;
41 DECLARE_LIST( StringList_Impl, OUString* )
43 +#define aSeparatorStr "----------------------------------"
45 #define ROW_HEIGHT 17 // the height of a row has to be a little higher than the bitmap
46 #define QUICK_SEARCH_TIMEOUT 1500 // time in mSec before the quicksearch string will be reseted
48 @@ -750,6 +752,7 @@ ViewTabListBox_Impl::ViewTabListBox_Impl
49 mbEnableDelete ( sal_True )
52 + sal_Bool bViewHeader = true;
53 Size aBoxSize = pParentWin->GetSizePixel();
54 mpHeaderBar = new HeaderBar( pParentWin, WB_BUTTONSTYLE | WB_BOTTOMBORDER );
55 mpHeaderBar->SetPosSizePixel( Point( 0, 0 ), mpHeaderBar->CalcWindowSizePixel() );
56 @@ -762,6 +765,8 @@ ViewTabListBox_Impl::ViewTabListBox_Impl
57 mpHeaderBar->InsertItem( COLUMN_SIZE, String( SvtResId( STR_SVT_FILEVIEW_COLUMN_SIZE ) ), 80, nBits );
58 mpHeaderBar->InsertItem( COLUMN_DATE, String( SvtResId( STR_SVT_FILEVIEW_COLUMN_DATE ) ), 500, nBits );
60 + if( ( nFlags & FILEVIEW_SHOW_NONE ) == FILEVIEW_SHOW_NONE )
61 + bViewHeader = false;
62 else
63 mpHeaderBar->InsertItem( COLUMN_TITLE, String( SvtResId( STR_SVT_FILEVIEW_COLUMN_TITLE ) ), 600, nBits );
65 @@ -773,7 +778,8 @@ ViewTabListBox_Impl::ViewTabListBox_Impl
66 SetEntryHeight( ROW_HEIGHT );
68 Show();
69 - mpHeaderBar->Show();
70 + if( bViewHeader )
71 + mpHeaderBar->Show();
73 maResetQuickSearch.SetTimeout( QUICK_SEARCH_TIMEOUT );
74 maResetQuickSearch.SetTimeoutHdl( LINK( this, ViewTabListBox_Impl, ResetQuickSearch_Impl ) );
75 @@ -1133,6 +1139,7 @@ SvtFileView::SvtFileView( Window* pParen
77 mpImp = new SvtFileView_Impl( this, xCmdEnv, nFlags, bOnlyFolder );
78 mpImp->mpView->ForbidEmptyText();
79 + SetSortColumn( true );
81 long pTabs[] = { 5, 20, 180, 320, 400, 600 };
82 mpImp->mpView->SetTabs( &pTabs[0], MAP_PIXEL );
83 @@ -1155,6 +1162,7 @@ SvtFileView::SvtFileView( Window* pParen
84 Reference < XCommandEnvironment > xCmdEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< XProgressHandler >() );
85 mpImp = new SvtFileView_Impl( this, xCmdEnv, nFlags,
86 ( nFlags & FILEVIEW_ONLYFOLDER ) == FILEVIEW_ONLYFOLDER );
87 + SetSortColumn( true );
89 if ( ( nFlags & FILEVIEW_SHOW_ALL ) == FILEVIEW_SHOW_ALL )
91 @@ -1168,7 +1176,8 @@ SvtFileView::SvtFileView( Window* pParen
92 long pTabs[] = { 2, 20, 600 };
93 mpImp->mpView->SetTabs( &pTabs[0], MAP_PIXEL );
96 + if ( ( nFlags & FILEVIEW_SHOW_NONE ) == FILEVIEW_SHOW_NONE )
97 + SetSortColumn( false );
98 if ( ( nFlags & FILEVIEW_MULTISELECTION ) == FILEVIEW_MULTISELECTION )
99 mpImp->mpView->SetSelectionMode( MULTIPLE_SELECTION );
101 @@ -1426,7 +1435,8 @@ sal_Bool SvtFileView::Initialize( const
103 mpImp->Clear();
104 mpImp->CreateVector_Impl( aContents );
105 - mpImp->SortFolderContent_Impl();
106 + if( GetSortColumn() )
107 + mpImp->SortFolderContent_Impl();
109 mpImp->OpenFolder_Impl();
111 @@ -2330,9 +2340,11 @@ void SvtFileView_Impl::CreateVector_Impl
112 pEntry->maDisplayText = aDisplayText;
114 // detect the image
115 - INetURLObject aObj( pEntry->maImageURL.getLength() ? pEntry->maImageURL : pEntry->maTargetURL );
116 - pEntry->maImage = SvFileInformationManager::GetImage( aObj, FALSE, isHighContrast( mpView ) );
118 + if( aValue != rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(aSeparatorStr) ) )
120 + INetURLObject aObj( pEntry->maImageURL.getLength() ? pEntry->maImageURL : pEntry->maTargetURL );
121 + pEntry->maImage = SvFileInformationManager::GetImage( aObj, FALSE, isHighContrast( mpView ) );
123 maContent.push_back( pEntry );
126 --- svtools/inc/fileview.hxx.old 2009-04-02 11:06:22.000000000 +0000
127 +++ svtools/inc/fileview.hxx 2009-04-06 16:41:53.000000000 +0000
128 @@ -51,6 +51,7 @@
129 #define FILEVIEW_SHOW_SIZE 0x0020
130 #define FILEVIEW_SHOW_DATE 0x0040
131 #define FILEVIEW_SHOW_ALL 0x0070
132 +#define FILEVIEW_SHOW_NONE 0x00A0
134 class ViewTabListBox_Impl;
135 class SvtFileView_Impl;
136 @@ -84,6 +85,7 @@ class SVT_DLLPUBLIC SvtFileView : public
138 private:
139 SvtFileView_Impl* mpImp;
140 + sal_Bool bSortColumn;
142 ::com::sun::star::uno::Sequence< ::rtl::OUString > mpBlackList;
144 @@ -112,6 +114,8 @@ public:
145 void SetSizePixel( const Size& rNewSize );
146 using Window::SetPosSizePixel;
147 virtual void SetPosSizePixel( const Point& rNewPos, const Size& rNewSize );
148 + void SetSortColumn( sal_Bool bValue ) { bSortColumn = bValue; }
149 + sal_Bool GetSortColumn() { return bSortColumn; }
151 /** initialize the view with the content of a folder given by URL, and aply an immediate filter