summaryrefslogtreecommitdiffstats
path: root/libreoffice/3.6.0/patches/libreoffice-fix-tde-vcl.diff
blob: a3335deef2a94573b4e419a95b940e90dc06df5c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
--- a/vcl/unx/generic/plugadapt/salplug.cxx
+++ b/vcl/unx/generic/plugadapt/salplug.cxx
@@ -189,10 +189,7 @@
     else if ( desktop == DESKTOP_GNOME )
         pList = pStandardFallbackList;
     else if( desktop == DESKTOP_TDE )
-    {
         pList = pTDEFallbackList;
-        nListEntry = 1;
-    }
     else if( desktop == DESKTOP_KDE )
     {
         pList = pKDEFallbackList;
--- a/vcl/unx/kde/salnativewidgets-kde.cxx
+++ b/vcl/unx/kde/salnativewidgets-kde.cxx
@@ -44,6 +44,48 @@
 #include <vcl/vclenum.hxx>
 #include <rtl/ustrbuf.hxx>
 
+#ifdef ENABLE_TDE
+#define QPushButton_String	"TQPushButton"
+#define QRadioButton_String	"TQRadioButton"
+#define QCheckBox_String	"TQCheckBox"
+#define QComboBox_String	"TQComboBox"
+#define QLineEdit_String	"TQLineEdit"
+#define QSpinWidget_String	"TQSpinWidget"
+#define QTabBar_String		"TQTabBar"
+#define QTabWidget_String	"TQTabWidget"
+#define QListView_String	"TQListView"
+#define QScrollBar_String	"TQScrollBar"
+#define QMotifPlusStyle_String	"TQMotifPlusStyle"
+#define QSGIStyle_String	"TQSGIStyle"
+#define QToolBar_String		"TQToolBar"
+#define QToolButton_String	"TQToolButton"
+#define QMenuBar_String		"TQMenuBar"
+#define QPopupMenu_String	"TQPopupMenu"
+#define QProgressBar_String	"TQProgressBar"
+#define QMotifStyle_String	"TQMotifStyle"
+#define QWindowsStyle_String	"TQWindowsStyle"
+#else // ENABLE_TDE
+#define QPushButton_String	"QPushButton"
+#define QRadioButton_String	"QRadioButton"
+#define QCheckBox_String	"QCheckBox"
+#define QComboBox_String	"QComboBox"
+#define QLineEdit_String	"QLineEdit"
+#define QSpinWidget_String	"QSpinWidget"
+#define QTabBar_String		"QTabBar"
+#define QTabWidget_String	"QTabWidget"
+#define QListView_String	"QListView"
+#define QScrollBar_String	"QScrollBar"
+#define QMotifPlusStyle_String	"QMotifPlusStyle"
+#define QSGIStyle_String	"QSGIStyle"
+#define QToolBar_String		"QToolBar"
+#define QToolButton_String	"QToolButton"
+#define QMenuBar_String		"QMenuBar"
+#define QPopupMenu_String	"QPopupMenu"
+#define QProgressBar_String	"QProgressBar"
+#define QMotifStyle_String	"QMotifStyle"
+#define QWindowsStyle_String	"QWindowsStyle"
+#endif // ENABLE_TDE
+
 using namespace ::com::sun::star;
 using namespace ::rtl;
 
@@ -461,11 +503,11 @@
     const char *pClassName = pWidget->className();
 
     // Draw the widget to the pixmap
-    if ( strcmp( "QPushButton", pClassName ) == 0 )
+    if ( strcmp( QPushButton_String, pClassName ) == 0 )
     {
     // Workaround for the Platinum style.
     // Platinum takes the state directly from the widget, not from SFlags.
-    QPushButton *pPushButton = static_cast<QPushButton *>( pWidget->qt_cast( "QPushButton" ) );
+    QPushButton *pPushButton = static_cast<QPushButton *>( pWidget->qt_cast( QPushButton_String ) );
     if ( pPushButton )
     {
         pPushButton->setDown   ( nStyle & QStyle::Style_Down );
@@ -477,7 +519,7 @@
         &qPainter, pWidget, qRect,
         pWidget->colorGroup(), nStyle );
     }
-    else if ( strcmp( "QRadioButton", pClassName ) == 0 )
+    else if ( strcmp( QRadioButton_String, pClassName ) == 0 )
     {
     // Bitblt from the screen, because the radio buttons are usually not
     // rectangular, and there could be a bitmap under them
@@ -495,20 +537,20 @@
         &qPainter, pWidget, qRect,
         pWidget->colorGroup(), nStyle );
     }
-    else if ( strcmp( "QCheckBox", pClassName ) == 0 )
+    else if ( strcmp( QCheckBox_String, pClassName ) == 0 )
     {
     kapp->style().drawControl( QStyle::CE_CheckBox,
         &qPainter, pWidget, qRect,
         pWidget->colorGroup(), nStyle );
     }
-    else if ( strcmp( "QComboBox", pClassName ) == 0 )
+    else if ( strcmp( QComboBox_String, pClassName ) == 0 )
     {
     kapp->style().drawComplexControl( QStyle::CC_ComboBox,
         &qPainter, pWidget, qRect,
         pWidget->colorGroup(), nStyle );
 
     // Editable combo box uses the background of the associated edit box
-    QComboBox *pComboBox = static_cast<QComboBox *>( pWidget->qt_cast( "QComboBox" ) );
+    QComboBox *pComboBox = static_cast<QComboBox *>( pWidget->qt_cast( QComboBox_String ) );
     if ( pComboBox && pComboBox->editable() && pComboBox->lineEdit() )
     {
         QColorGroup::ColorRole eColorRole = ( pComboBox->isEnabled() )?
@@ -519,13 +561,13 @@
             pComboBox->lineEdit()->colorGroup().brush( eColorRole ) );
     }
     }
-    else if ( strcmp( "QLineEdit", pClassName ) == 0 )
+    else if ( strcmp( QLineEdit_String, pClassName ) == 0 )
     {
     kapp->style().drawPrimitive( QStyle::PE_PanelLineEdit,
         &qPainter, qRect,
         pWidget->colorGroup(), nStyle | QStyle::Style_Sunken );
     }
-    else if ( strcmp( "QSpinWidget", pClassName ) == 0 )
+    else if ( strcmp( QSpinWidget_String, pClassName ) == 0 )
     {
     const SpinbuttonValue *pValue = static_cast<const SpinbuttonValue *> ( &aValue );
 
@@ -556,7 +598,7 @@
     }
 
     // Spin widget uses the background of the associated edit box
-    QSpinWidget *pSpinWidget = static_cast<QSpinWidget *>( pWidget->qt_cast( "QSpinWidget" ) );
+    QSpinWidget *pSpinWidget = static_cast<QSpinWidget *>( pWidget->qt_cast( QSpinWidget_String ) );
     if ( pSpinWidget && pSpinWidget->editWidget() )
     {
         QColorGroup::ColorRole eColorRole = ( pSpinWidget->isEnabled() )?
@@ -576,7 +618,7 @@
         pWidget->colorGroup(), nStyle,
         QStyle::SC_All, eActive );
     }
-    else if ( strcmp( "QTabBar", pClassName ) == 0 )
+    else if ( strcmp( QTabBar_String, pClassName ) == 0 )
     {
     const TabitemValue *pValue = static_cast<const TabitemValue *> ( &aValue );
 
@@ -602,19 +644,19 @@
         pWidget->colorGroup(), nStyle,
         QStyleOption( pTab ) );
     }
-    else if ( strcmp( "QTabWidget", pClassName ) == 0 )
+    else if ( strcmp( QTabWidget_String, pClassName ) == 0 )
     {
     kapp->style().drawPrimitive( QStyle::PE_PanelTabWidget,
         &qPainter, qRect,
         pWidget->colorGroup(), nStyle );
     }
-    else if ( strcmp( "QListView", pClassName ) == 0 )
+    else if ( strcmp( QListView_String, pClassName ) == 0 )
     {
     kapp->style().drawPrimitive( QStyle::PE_Panel,
         &qPainter, qRect,
         pWidget->colorGroup(), nStyle | QStyle::Style_Sunken );
     }
-    else if ( strcmp( "QScrollBar", pClassName ) == 0 )
+    else if ( strcmp( QScrollBar_String, pClassName ) == 0 )
     {
     const ScrollbarValue *pValue = static_cast<const ScrollbarValue *> ( &aValue );
 
@@ -624,13 +666,13 @@
         // Workaround for Style_MouseOver-aware themes.
         // Quite ugly, but I do not know about a better solution.
         const char *pStyleName = kapp->style().className();
-        if ( strcmp( "QMotifPlusStyle", pStyleName ) == 0 )
+        if ( strcmp( QMotifPlusStyle_String, pStyleName ) == 0 )
         {
         nStyle |= QStyle::Style_MouseOver;
         if ( pValue->mnThumbState & CTRL_STATE_ROLLOVER )
             eActive = QStyle::SC_ScrollBarSlider;
         }
-        else if ( strcmp( "QSGIStyle", pStyleName ) == 0 )
+        else if ( strcmp( QSGIStyle_String, pStyleName ) == 0 )
         {
         nStyle |= QStyle::Style_MouseOver;
         if ( pValue->mnButton1State & CTRL_STATE_ROLLOVER )
@@ -668,7 +710,7 @@
     }
 
     // Is it a horizontal scroll bar?
-    QScrollBar *pScrollBar = static_cast<QScrollBar *> ( pWidget->qt_cast( "QScrollBar" ) );
+    QScrollBar *pScrollBar = static_cast<QScrollBar *> ( pWidget->qt_cast( QScrollBar_String ) );
     QStyle::StyleFlags eHoriz = QStyle::Style_Default;
     if ( pScrollBar && pScrollBar->orientation() == Qt::Horizontal )
         eHoriz = QStyle::Style_Horizontal;
@@ -678,9 +720,9 @@
         pWidget->colorGroup(), nStyle | eHoriz,
         QStyle::SC_All, eActive );
     }
-    else if ( strcmp( "QToolBar", pClassName ) == 0 )
+    else if ( strcmp( QToolBar_String, pClassName ) == 0 )
     {
-        QToolBar *pToolBar = static_cast< QToolBar * >( pWidget->qt_cast( "QToolBar" ) );
+        QToolBar *pToolBar = static_cast< QToolBar * >( pWidget->qt_cast( QToolBar_String ) );
         bool bIsHorizontal = false;
         if ( pToolBar && pToolBar->orientation() == Qt::Horizontal )
         {
@@ -723,7 +765,7 @@
                         &qPainter, qThumbRect, pWidget->colorGroup(), nStyle );
         }
     }
-    else if ( strcmp( "QToolButton", pClassName ) == 0 )
+    else if ( strcmp( QToolButton_String, pClassName ) == 0 )
     {
         if( (nStyle & QStyle::Style_MouseOver) )
             nStyle &= ~QStyle::Style_Off;
@@ -732,7 +774,7 @@
                 pWidget->colorGroup(), nStyle,
                 QStyle::SC_ToolButton );
     }
-    else if ( strcmp( "QMenuBar", pClassName ) == 0 )
+    else if ( strcmp( QMenuBar_String, pClassName ) == 0 )
     {
         if ( nPart == PART_ENTIRE_CONTROL )
         {
@@ -754,7 +796,7 @@
                     QStyleOption( pMenuItem ) );
         }
     }
-    else if ( strcmp( "QPopupMenu", pClassName ) == 0 )
+    else if ( strcmp( QPopupMenu_String, pClassName ) == 0 )
     {
         int nMenuItem = ( nStyle & QStyle::Style_Enabled )? m_nPopupMenuEnabledItem: m_nPopupMenuDisabledItem;
         QMenuItem *pMenuItem = static_cast<QPopupMenu*>( pWidget )->findItem( nMenuItem );
@@ -767,7 +809,7 @@
                 pWidget->colorGroup(), nStyle,
                 QStyleOption( pMenuItem, 0, 0 ) );
     }
-    else if ( strcmp( "QProgressBar", pClassName ) == 0 )
+    else if ( strcmp( QProgressBar_String, pClassName ) == 0 )
     {
         long nProgressWidth = aValue.getNumericVal();
         QProgressBar* pProgress = static_cast<QProgressBar*>(pWidget);
@@ -1944,8 +1986,8 @@
         Color aMenuBack = toColor( qMenuCG.background() );
         if ( kapp->style().inherits( "LightStyleV2" ) ||
              kapp->style().inherits( "LightStyleV3" ) ||
-             ( kapp->style().inherits( "QMotifStyle" ) && !kapp->style().inherits( "QSGIStyle" ) ) ||
-             kapp->style().inherits( "QWindowsStyle" ) )
+             ( kapp->style().inherits( QMotifStyle_String ) && !kapp->style().inherits( QSGIStyle_String ) ) ||
+             kapp->style().inherits( QWindowsStyle_String ) )
         {
             aMenuFore = toColor( qMenuCG.buttonText() );
             aMenuBack = toColor( qMenuCG.button() );
@@ -1961,7 +2003,7 @@
         // Menu items higlight text color, theme specific
         if ( kapp->style().inherits( "HighContrastStyle" ) ||
              kapp->style().inherits( "KeramikStyle" ) ||
-             kapp->style().inherits( "QWindowsStyle" ) ||
+             kapp->style().inherits( QWindowsStyle_String ) ||
              kapp->style().inherits( "ThinKeramikStyle" ) ||
              kapp->style().inherits( "PlastikStyle" ) )
         {
--- a/vcl/unx/kde/fpicker/kdefilepicker.cxx
+++ b/vcl/unx/kde/fpicker/kdefilepicker.cxx
@@ -85,6 +85,14 @@
 
 #endif // ENABLE_TDE
 
+#ifdef ENABLE_TDE
+#define QCheckBox_String	"TQCheckBox"
+#define QComboBox_String	"TQComboBox"
+#else // ENABLE_TDE
+#define QCheckBox_String	"QCheckBox"
+#define QComboBox_String	"QComboBox"
+#endif // ENABLE_TDE
+
 #include <algorithm>
 #include <iostream>
 
@@ -104,8 +112,13 @@
       m_bIsExecuting( false ),
       m_bCanNotifySelection( true )
 {
+#ifdef ENABLE_TDE
+    connect( this, SIGNAL( fileHighlighted( const TQString & ) ),
+             this, SLOT( fileHighlightedCommand( const TQString & ) ) );
+#else // ENABLE_TDE
     connect( this, SIGNAL( fileHighlighted( const QString & ) ),
              this, SLOT( fileHighlightedCommand( const QString & ) ) );
+#endif // ENABLE_TDE
 
     connect( this, SIGNAL( selectionChanged() ),
              this, SLOT( selectionChangedCommand() ) );
@@ -434,7 +447,7 @@
     if ( pWidget )
     {
         QCString qClassName = pWidget->className();
-        if ( qClassName == "QCheckBox" )
+        if ( qClassName == QCheckBox_String )
         {
             QCheckBox *pCheckBox = static_cast< QCheckBox* >( pWidget );
 
@@ -443,7 +456,7 @@
             else
                 qString.append( " bool false" );
         }
-        else if ( qClassName == "QComboBox" )
+        else if ( qClassName == QComboBox_String )
         {
             QComboBox *pComboBox = static_cast< QComboBox* >( pWidget );
             if ( rAction == "getItems" )
@@ -480,14 +493,14 @@
     if ( pWidget )
     {
         QCString qClassName = pWidget->className();
-        if ( qClassName == "QCheckBox" )
+        if ( qClassName == QCheckBox_String )
         {
             QCheckBox *pCheckBox = static_cast< QCheckBox* >( pWidget );
 
             bool bValue = ( !rValue.isEmpty() ) && ( rValue.front().lower() == "true" );
             pCheckBox->setChecked( bValue );
         }
-        else if ( qClassName == "QComboBox" )
+        else if ( qClassName == QComboBox_String )
         {
             QComboBox *pComboBox = static_cast< QComboBox* >( pWidget );
             if ( rAction == "addItem" )
@@ -562,7 +575,7 @@
     QString qExtension;
 
     QWidget *pExtensionWidget = findControl( "100" ); // CHECKBOX_AUTOEXTENSION
-    QCheckBox *pExtensionCB = pExtensionWidget? static_cast< QCheckBox* >( pExtensionWidget->qt_cast( "QCheckBox" ) ): NULL;
+    QCheckBox *pExtensionCB = pExtensionWidget? static_cast< QCheckBox* >( pExtensionWidget->qt_cast( QCheckBox_String ) ): NULL;
     if ( pExtensionCB && pExtensionCB->isChecked() )
     {
         // FIXME: qFilter can be a MIME; we ignore it now...
@@ -660,7 +673,11 @@
     return qDestURL.url();
 }
 
+#ifdef ENABLE_TDE
+void KDEFileDialog::fileHighlightedCommand( const TQString & )
+#else // ENABLE_TDE
 void KDEFileDialog::fileHighlightedCommand( const QString & )
+#endif // ENABLE_TDE
 {
     if ( canNotifySelection() )
     {
--- a/vcl/unx/kde/fpicker/kdefilepicker.hxx
+++ b/vcl/unx/kde/fpicker/kdefilepicker.hxx
@@ -114,7 +114,11 @@
     bool                        canNotifySelection( void ) const { return m_bCanNotifySelection; }
 
 protected slots:
+#ifdef ENABLE_TDE
+    void                        fileHighlightedCommand( const TQString & );
+#else // ENABLE_TDE
     void                        fileHighlightedCommand( const QString & );
+#endif // ENABLE_TDE
     void                        selectionChangedCommand();
 
 protected:
--- a/vcl/unx/kde/UnxFilePicker.cxx
+++ b/vcl/unx/kde/UnxFilePicker.cxx
@@ -81,7 +81,11 @@
         uno::Sequence<rtl::OUString> aRet(3);
         aRet[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.dialogs.FilePicker"));
         aRet[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.dialogs.SystemFilePicker"));
+#ifdef ENABLE_TDE
+        aRet[2] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.dialogs.TDEFilePicker"));
+#else // ENABLE_TDE
         aRet[2] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.dialogs.KDEFilePicker"));
+#endif // ENABLE_TDE
         return aRet;
     }
 }
@@ -717,7 +721,11 @@
 #endif
 
         // The executable name
+#ifdef ENABLE_TDE
+        rtl::OUString helperurl( RTL_CONSTASCII_USTRINGPARAM("${ORIGIN}/tdefilepicker"));
+#else // ENABLE_TDE
         rtl::OUString helperurl( RTL_CONSTASCII_USTRINGPARAM("${ORIGIN}/kdefilepicker"));
+#endif // ENABLE_TDE
         rtl::Bootstrap::expandMacros( helperurl );
         rtl::OUString helperpath;
         osl::FileBase::getSystemPathFromFileURL( helperurl, helperpath );