You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
thirdparty/libreoffice/3.6.0/patches/libreoffice-fix-tde-vcl.diff

389 lines
15 KiB

--- 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 TDEFileDialog::fileHighlightedCommand( const TQString & )
+#else // ENABLE_TDE
void TDEFileDialog::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 );