/[pkgs]/devel/openoffice.org/openoffice.org-3.0.1.oooXXXXX.fpicker.allformatsonsave.patch
ViewVC logotype

Contents of /devel/openoffice.org/openoffice.org-3.0.1.oooXXXXX.fpicker.allformatsonsave.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download) (as text)
Wed Jan 14 16:16:30 2009 UTC (10 months, 1 week ago) by caolanm
Branch: MAIN
CVS Tags: openoffice_org-3_1_1-18_1_fc12, openoffice_org-3_1_0-1_2_fc11, F-12-split, openoffice_org-3_1_1-16_1_fc12, openoffice_org-3_1_0-5_2_fc11, openoffice_org-3_1_0-7_1_fc11, openoffice_org-3_0_1-15_7_fc11, openoffice_org-3_1_1-19_7_fc12, openoffice_org-3_1_0-3_3_fc11, openoffice_org-3_0_1-15_3_fc11, openoffice_org-3_1_1-19_9_fc12, openoffice_org-3_2_0-2_2_fc13, openoffice_org-3_1_0-3_4_fc11, openoffice_org-3_1_1-19_6_fc12, openoffice_org-3_1_0-4_2_fc11, openoffice_org-3_1_1-19_4_fc12, openoffice_org-3_1_1-19_5_fc12, openoffice_org-3_1_1-18_2_fc12, openoffice_org-3_1_0-2_3_fc11, openoffice_org-3_1_1-14_1_fc12, openoffice_org-3_2_0-2_1_fc13, openoffice_org-3_2_0-4_2_fc13, openoffice_org-3_2_0-2_4_fc13, openoffice_org-3_1_1-12_1_fc12, openoffice_org-3_2_0-1_2_fc13, openoffice_org-3_2_0-4_1_fc13, openoffice_org-3_1_0-3_1_fc11, openoffice_org-3_1_1-12_2_fc12, F-11-split, openoffice_org-3_1_0-5_1_fc11, openoffice_org-3_1_0-2_2_fc11, openoffice_org-3_1_1-13_1_fc12, openoffice_org-3_1_0-6_2_fc11, openoffice_org-3_1_1-15_2_fc12, openoffice_org-3_1_1-19_1_fc12, openoffice_org-3_1_0-8_1_fc11, openoffice_org-3_1_1-15_1_fc12, openoffice_org-3_1_0-11_3_fc12, openoffice_org-3_1_1-19_1_fc12_1, openoffice_org-3_1_1-17_1_fc12, openoffice_org-3_0_1-15_6_fc11, openoffice_org-3_0_1-15_4_fc11, openoffice_org-3_1_0-3_2_fc11, openoffice_org-3_1_0-2_1_fc11, openoffice_org-3_1_1-19_8_fc12, openoffice_org-3_1_0-1_3_fc11, openoffice_org-3_2_0-2_3_fc13, openoffice_org-3_2_0-5_1_fc13, openoffice_org-3_2_0-3_1_fc13, openoffice_org-3_1_1-13_2_fc12, openoffice_org-3_2_0-3_2_fc13, openoffice_org-3_1_0-1_1_fc11, openoffice_org-3_0_1-15_5_fc11, openoffice_org-3_1_1-19_2_fc12, openoffice_org-3_2_0-5_2_fc13, openoffice_org-3_1_0-9_3_fc12, openoffice_org-3_1_0-9_1_fc11, openoffice_org-3_2_0-1_1_fc13, openoffice_org-3_1_1-16_2_fc12, openoffice_org-3_0_1-15_2_fc11, openoffice_org-3_1_1-13_3_fc12, openoffice_org-3_2_0-2_5_fc13, openoffice_org-3_0_1-15_8_fc11, openoffice_org-3_1_0-6_1_fc11, openoffice_org-3_1_0-10_1_fc12, openoffice_org-3_2_0-3_4_fc13, openoffice_org-3_1_0-4_1_fc11, openoffice_org-3_1_0-9_2_fc11, HEAD
Changes since 1.1: +29 -3 lines
File MIME type: text/x-patch
Resolves: rhbz#479163 openoffice.org-3.0.1.oooXXXXX.fpicker.allformatsonsave.patch
1 diff -ru svtools.orig/inc/svtools/svtools.hrc svtools/inc/svtools/svtools.hrc
2 --- openoffice.org.orig/svtools/inc/svtools/svtools.hrc 2009-01-14 15:52:54.000000000 +0000
3 +++ openoffice.org/svtools/inc/svtools/svtools.hrc 2009-01-14 15:53:18.000000000 +0000
4 @@ -73,6 +73,7 @@
5 #define RID_FILEOPEN_INVALIDFOLDER (RID_SVTOOLS_START + 34)
6 #define RID_FILEOPEN_NOTEXISTENTFILE (RID_SVTOOLS_START + 35)
7 #define STR_SVT_NOREMOVABLEDEVICE (RID_SVTOOLS_START + 36)
8 +#define STR_SVT_ALLFORMATS (RID_SVTOOLS_START + 37)
9
10 // doc template dialog
11 #define DLG_DOCTEMPLATE (RID_SVTOOLS_START+50)
12 diff -ru fpicker.orig/source/office/iodlg.src fpicker/source/office/iodlg.src
13 --- openoffice.org.orig/fpicker/source/office/iodlg.src 2009-01-14 11:56:02.000000000 +0000
14 +++ openoffice.org/fpicker/source/office/iodlg.src 2009-01-14 15:59:44.000000000 +0000
15 @@ -317,5 +312,10 @@
16 Text [ en-US ] = "No removable storage device detected.\nMake sure it is plugged in properly and try again." ;
17 };
18
19 +String STR_SVT_ALLFORMATS
20 +{
21 + Text [ en-US ] = "All Formats" ;
22 +};
23 +
24 //******************************************************************** EOF
25
26 diff -ru fpicker.orig/source/unx/gnome/resourceprovider.cxx fpicker/source/unx/gnome/resourceprovider.cxx
27 --- openoffice.org.orig/fpicker/source/unx/gnome/resourceprovider.cxx 2009-01-14 11:56:02.000000000 +0000
28 +++ openoffice.org/fpicker/source/unx/gnome/resourceprovider.cxx 2009-01-14 15:42:26.000000000 +0000
29 @@ -85,7 +85,8 @@
30 { CHECKBOX_SELECTION, STR_SVT_FILEPICKER_SELECTION },
31 { FOLDERPICKER_TITLE, STR_SVT_FOLDERPICKER_DEFAULT_TITLE },
32 { FOLDER_PICKER_DEF_DESCRIPTION, STR_SVT_FOLDERPICKER_DEFAULT_DESCRIPTION },
33 - { FILE_PICKER_OVERWRITE, STR_SVT_ALREADYEXISTOVERWRITE }
34 + { FILE_PICKER_OVERWRITE, STR_SVT_ALREADYEXISTOVERWRITE },
35 + { FILE_PICKER_ALLFORMATS, STR_SVT_ALLFORMATS }
36 };
37
38 _Entry OtherCtrlIdToResIdTable[] = {
39 diff -ru fpicker.orig/source/unx/gnome/resourceprovider.hxx fpicker/source/unx/gnome/resourceprovider.hxx
40 --- openoffice.org.orig/fpicker/source/unx/gnome/resourceprovider.hxx 2009-01-14 11:56:02.000000000 +0000
41 +++ openoffice.org/fpicker/source/unx/gnome/resourceprovider.hxx 2009-01-14 15:40:34.000000000 +0000
42 @@ -48,6 +48,7 @@
43 #define FILE_PICKER_TITLE_SAVE 503
44 #define FILE_PICKER_FILE_TYPE 504
45 #define FILE_PICKER_OVERWRITE 505
46 +#define FILE_PICKER_ALLFORMATS 506
47
48 //------------------------------------------------------------------------
49 // deklarations
50 diff -ru fpicker.orig/source/unx/gnome/SalGtkFilePicker.cxx fpicker/source/unx/gnome/SalGtkFilePicker.cxx
51 --- openoffice.org.orig/fpicker/source/unx/gnome/SalGtkFilePicker.cxx 2009-01-14 11:56:02.000000000 +0000
52 +++ openoffice.org/fpicker/source/unx/gnome/SalGtkFilePicker.cxx 2009-01-14 15:42:05.000000000 +0000
53 @@ -55,6 +55,7 @@
54
55 #include <iostream>
56 #include <algorithm>
57 +#include <set>
58 #include "resourceprovider.hxx"
59 #ifndef _SV_RC_H
60 #include <tools/rc.hxx>
61 @@ -180,6 +181,7 @@
62 mbPreviewState( sal_False ),
63 mHID_Preview( 0 ),
64 m_pPreview( NULL ),
65 + m_pPseudoFilter( NULL ),
66 m_PreviewImageWidth( 256 ),
67 m_PreviewImageHeight( 256 )
68 {
69 @@ -689,7 +691,7 @@
70 m_pFilterList = new FilterList;
71
72 // set the first filter to the current filter
73 - if( ( !m_aCurrentFilter ) || ( !m_aCurrentFilter.getLength() ) )
74 + if ( !m_aCurrentFilter.getLength() )
75 m_aCurrentFilter = _rInitialCurrentFilter;
76 }
77 }
78 @@ -713,7 +715,6 @@
79
80 // append the filter
81 m_pFilterList->insert( m_pFilterList->end(), FilterEntry( aTitle, aFilter ) );
82 - // implAddFilter( aTitle, aFilter );
83 }
84
85 //-----------------------------------------------------------------------------------------
86 @@ -778,7 +779,10 @@
87 }
88 else if( GtkFileFilter *filter = gtk_file_chooser_get_filter(GTK_FILE_CHOOSER(m_pDialog)))
89 {
90 - updateCurrentFilterFromName(gtk_file_filter_get_name( filter ));
91 + if (m_pPseudoFilter != filter)
92 + updateCurrentFilterFromName(gtk_file_filter_get_name( filter ));
93 + else
94 + updateCurrentFilterFromName(OUStringToOString( m_aInitialFilter, RTL_TEXTENCODING_UTF8 ).getStr());
95 }
96 }
97
98 @@ -945,9 +949,15 @@
99 }
100 }
101
102 - const gchar* filtername =
103 - gtk_file_filter_get_name( gtk_file_chooser_get_filter( GTK_FILE_CHOOSER( m_pDialog ) ) );
104 - sFilterName = OUString( filtername, strlen( filtername ), RTL_TEXTENCODING_UTF8 );
105 + GtkFileFilter *filter = gtk_file_chooser_get_filter(GTK_FILE_CHOOSER(m_pDialog));
106 + if (m_pPseudoFilter != filter)
107 + {
108 + const gchar* filtername =
109 + gtk_file_filter_get_name( filter );
110 + sFilterName = OUString( filtername, strlen( filtername ), RTL_TEXTENCODING_UTF8 );
111 + }
112 + else
113 + sFilterName = m_aInitialFilter;
114 }
115
116 OSL_TRACE( "2: current filter is %s\n",
117 @@ -1904,7 +1914,7 @@
118 }
119 }
120
121 -int SalGtkFilePicker::implAddFilter( const OUString& rFilter, const OUString& rType )
122 +GtkFileFilter * SalGtkFilePicker::implAddFilter( const OUString& rFilter, const OUString& rType )
123 {
124 GtkFileFilter *filter = gtk_file_filter_new();
125
126 @@ -1953,7 +1963,6 @@
127
128 gtk_file_chooser_add_filter( GTK_FILE_CHOOSER( m_pDialog ), filter );
129
130 - int nAdded = 0;
131 if (!bAllGlob)
132 {
133 GtkTreeIter iter;
134 @@ -1964,27 +1973,66 @@
135 2, aFilterName.getStr(),
136 3, OUStringToOString(rType, RTL_TEXTENCODING_UTF8).getStr(),
137 -1);
138 - nAdded = 1;
139 }
140 - return nAdded;
141 +
142 + return filter;
143 }
144
145 -int SalGtkFilePicker::implAddFilterGroup( const OUString& /*_rFilter*/, const Sequence< StringPair >& _rFilters )
146 +void SalGtkFilePicker::implAddFilterGroup( const OUString& /*_rFilter*/, const Sequence< StringPair >& _rFilters )
147 {
148 // Gtk+ has no filter group concept I think so ...
149 // implAddFilter( _rFilter, String() );
150 - int nAdded = 0;
151 const StringPair* pSubFilters = _rFilters.getConstArray();
152 const StringPair* pSubFiltersEnd = pSubFilters + _rFilters.getLength();
153 for( ; pSubFilters != pSubFiltersEnd; ++pSubFilters )
154 - nAdded += implAddFilter( pSubFilters->First, pSubFilters->Second );
155 - return nAdded;
156 + implAddFilter( pSubFilters->First, pSubFilters->Second );
157 }
158
159 void SalGtkFilePicker::SetFilters()
160 {
161 - OSL_TRACE( "start setting filters\n");
162 - int nAdded = 0;
163 + if (!m_aInitialFilter.getLength())
164 + m_aInitialFilter = m_aCurrentFilter;
165 +
166 + rtl::OUString sPseudoFilter;
167 + if( GTK_FILE_CHOOSER_ACTION_SAVE == gtk_file_chooser_get_action( GTK_FILE_CHOOSER( m_pDialog ) ) )
168 + {
169 + std::set<OUString> aAllFormats;
170 + if( m_pFilterList && !m_pFilterList->empty() )
171 + {
172 + for ( FilterList::iterator aListIter = m_pFilterList->begin();
173 + aListIter != m_pFilterList->end();
174 + ++aListIter
175 + )
176 + {
177 + if( aListIter->hasSubFilters() )
178 + { // it's a filter group
179 + UnoFilterList aSubFilters;
180 + aListIter->getSubFilters( aSubFilters );
181 + const StringPair* pSubFilters = aSubFilters.getConstArray();
182 + const StringPair* pSubFiltersEnd = pSubFilters + aSubFilters.getLength();
183 + for( ; pSubFilters != pSubFiltersEnd; ++pSubFilters )
184 + aAllFormats.insert(pSubFilters->Second);
185 + }
186 + else
187 + aAllFormats.insert(aListIter->getFilter());
188 + }
189 + }
190 + if (aAllFormats.size() > 1)
191 + {
192 + rtl::OUString sAllFilter;
193 + std::set<OUString>::const_iterator aEnd = aAllFormats.end();
194 + for (std::set<OUString>::const_iterator aIter = aAllFormats.begin(); aIter != aEnd; ++aIter)
195 + {
196 + if (sAllFilter.getLength())
197 + sAllFilter += OUString(sal_Unicode(';'));
198 + sAllFilter += *aIter;
199 + }
200 + CResourceProvider aResProvider;
201 + sPseudoFilter = aResProvider.getResString(FILE_PICKER_ALLFORMATS);
202 + m_pPseudoFilter = implAddFilter( sPseudoFilter, sAllFilter );
203 + }
204 + }
205 +
206 if( m_pFilterList && !m_pFilterList->empty() )
207 {
208 for ( FilterList::iterator aListIter = m_pFilterList->begin();
209 @@ -1998,30 +2046,27 @@
210 UnoFilterList aSubFilters;
211 aListIter->getSubFilters( aSubFilters );
212
213 - nAdded += implAddFilterGroup( aListIter->getTitle(), aSubFilters );
214 + implAddFilterGroup( aListIter->getTitle(), aSubFilters );
215 }
216 else
217 {
218 // it's a single filter
219
220 - nAdded += implAddFilter( aListIter->getTitle(), aListIter->getFilter() );
221 + implAddFilter( aListIter->getTitle(), aListIter->getFilter() );
222 }
223 }
224 }
225
226 - if (nAdded)
227 + if (gtk_tree_model_iter_n_children(GTK_TREE_MODEL(m_pFilterStore), NULL)) //If m_pFilterStore is not empty
228 gtk_widget_show( m_pFilterExpander );
229 else
230 gtk_widget_hide( m_pFilterExpander );
231
232 // set the default filter
233 - if( m_aCurrentFilter && (m_aCurrentFilter.getLength() > 0) )
234 - {
235 - OSL_TRACE( "Setting current filter to %s\n",
236 - OUStringToOString( m_aCurrentFilter, RTL_TEXTENCODING_UTF8 ).getStr() );
237 -
238 + if (sPseudoFilter.getLength())
239 + SetCurFilter( sPseudoFilter );
240 + else if(m_aCurrentFilter.getLength())
241 SetCurFilter( m_aCurrentFilter );
242 - }
243
244 OSL_TRACE( "end setting filters\n");
245 }
246 diff -ru fpicker.orig/source/unx/gnome/SalGtkFilePicker.hxx fpicker/source/unx/gnome/SalGtkFilePicker.hxx
247 --- openoffice.org.orig/fpicker/source/unx/gnome/SalGtkFilePicker.hxx 2009-01-14 11:56:02.000000000 +0000
248 +++ openoffice.org/fpicker/source/unx/gnome/SalGtkFilePicker.hxx 2009-01-14 15:34:41.000000000 +0000
249 @@ -317,11 +317,13 @@
250 gulong mnHID_SelectionChange;
251
252 ::rtl::OUString m_aCurrentFilter;
253 + ::rtl::OUString m_aInitialFilter;
254
255 bool bVersionWidthUnset;
256 sal_Bool mbPreviewState;
257 gulong mHID_Preview;
258 GtkWidget* m_pPreview;
259 + GtkFileFilter* m_pPseudoFilter;
260 sal_Int32 m_PreviewImageWidth;
261 sal_Int32 m_PreviewImageHeight;
262
263 @@ -332,8 +334,8 @@
264 void UpdateFilterfromUI();
265
266 void implChangeType( GtkTreeSelection *selection );
267 - int implAddFilter( const OUString& rFilter, const OUString& rType);
268 - int implAddFilterGroup( const OUString& rFilter,
269 + GtkFileFilter * implAddFilter( const OUString& rFilter, const OUString& rType );
270 + void implAddFilterGroup( const OUString& rFilter,
271 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair>& _rFilters );
272 void updateCurrentFilterFromName(const gchar* filtername);
273 void unselect_type();

admin@fedoraproject.org
ViewVC Help
Powered by ViewVC 1.1.2