dilfridge 15/07/12 20:54:02
Added: libreoffice-4.4.4.3-improve-KDE4FilePicker.patch
libreoffice-4.4.4.3-cleanup-IsNativeControlSupported.patch
libreoffice-4.4.4.3-fix-KDE4-FileDialog.patch
Log:
Version bump by Andreas Sturmlechner (genstorm)
(Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key
0B08240A96F66571)
Revision Changes Path
1.1
app-office/libreoffice/files/libreoffice-4.4.4.3-improve-KDE4FilePicker.patch
file :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-office/libreoffice/files/libreoffice-4.4.4.3-improve-KDE4FilePicker.patch?rev=1.1&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-office/libreoffice/files/libreoffice-4.4.4.3-improve-KDE4FilePicker.patch?rev=1.1&content-type=text/plain
Index: libreoffice-4.4.4.3-improve-KDE4FilePicker.patch
===================================================================
Merged upstream commits:
6fc55b9abd783b624241d56e34751ea495adbd7d "KDE4: actually apply file
dialog operation mode"
b613270a730ace29dd1b16b29be2222b34f34a5d "KDE4: improve default load and
save dialog titles"
2b999dd6da5a90db66afe852a007fab8c62ffaec "vcl: kde4:
loplugin:staticmethods"
3e8c14df67a43d3088ed7df0a2b0d96a4bc42d57 "tdf#92353 FileSave: Not
confirmed for overwrite a file (unix)"
diff -u b/vcl/unx/kde4/KDE4FilePicker.cxx b/vcl/unx/kde4/KDE4FilePicker.cxx
--- b/vcl/unx/kde4/KDE4FilePicker.cxx
+++ b/vcl/unx/kde4/KDE4FilePicker.cxx
@@ -58,6 +58,8 @@
#include "generic/geninst.h"
+#include "svids.hrc"
+
using namespace ::com::sun::star;
using namespace ::com::sun::star::ui::dialogs;
using namespace ::com::sun::star::ui::dialogs::TemplateDescription;
@@ -109,7 +111,6 @@
KDE4FilePicker::KDE4FilePicker( const uno::Reference<uno::XComponentContext>& )
: KDE4FilePicker_Base(_helperMutex)
- , _resMgr( ResMgr::CreateResMgr("fps_office") )
, allowRemoteUrls( false )
{
_extraControls = new QWidget();
@@ -128,8 +129,6 @@
#endif
setMultiSelectionMode( false );
- //default mode
- _dialog->setOperationMode(KFileDialog::Opening);
// XExecutableDialog functions
connect( this, SIGNAL( setTitleSignal( const OUString & ) ),
@@ -202,7 +201,6 @@
SalYieldMutexReleaser aReleaser;
return Q_EMIT cleanupProxySignal();
}
- delete _resMgr;
delete _dialog;
}
@@ -524,6 +522,24 @@
return toOUString(label);
}
+QString KDE4FilePicker::getResString( sal_Int16 aRedId )
+{
+ QString aResString;
+
+ if( aRedId < 0 )
+ return aResString;
+
+ try
+ {
+ aResString = toQString(ResId(aRedId, *ImplGetResMgr()).toString());
+ }
+ catch(...)
+ {
+ }
+
+ return aResString.replace('~', '&');
+}
+
void KDE4FilePicker::addCustomControl(sal_Int16 controlId)
{
QWidget* widget = 0;
@@ -532,37 +548,37 @@
switch (controlId)
{
case CHECKBOX_AUTOEXTENSION:
- resId = STR_SVT_FILEPICKER_AUTO_EXTENSION;
+ resId = STR_FPICKER_AUTO_EXTENSION;
break;
case CHECKBOX_PASSWORD:
- resId = STR_SVT_FILEPICKER_PASSWORD;
+ resId = STR_FPICKER_PASSWORD;
break;
case CHECKBOX_FILTEROPTIONS:
- resId = STR_SVT_FILEPICKER_FILTER_OPTIONS;
+ resId = STR_FPICKER_FILTER_OPTIONS;
break;
case CHECKBOX_READONLY:
- resId = STR_SVT_FILEPICKER_READONLY;
+ resId = STR_FPICKER_READONLY;
break;
case CHECKBOX_LINK:
- resId = STR_SVT_FILEPICKER_INSERT_AS_LINK;
+ resId = STR_FPICKER_INSERT_AS_LINK;
break;
case CHECKBOX_PREVIEW:
- resId = STR_SVT_FILEPICKER_SHOW_PREVIEW;
+ resId = STR_FPICKER_SHOW_PREVIEW;
break;
case CHECKBOX_SELECTION:
- resId = STR_SVT_FILEPICKER_SELECTION;
+ resId = STR_FPICKER_SELECTION;
break;
case PUSHBUTTON_PLAY:
- resId = STR_SVT_FILEPICKER_PLAY;
+ resId = STR_FPICKER_PLAY;
break;
case LISTBOX_VERSION:
- resId = STR_SVT_FILEPICKER_VERSION;
+ resId = STR_FPICKER_VERSION;
break;
case LISTBOX_TEMPLATE:
- resId = STR_SVT_FILEPICKER_TEMPLATES;
+ resId = STR_FPICKER_TEMPLATES;
break;
case LISTBOX_IMAGE_TEMPLATE:
- resId = STR_SVT_FILEPICKER_IMAGE_TEMPLATE;
+ resId = STR_FPICKER_IMAGE_TEMPLATE;
break;
case LISTBOX_VERSION_LABEL:
case LISTBOX_TEMPLATE_LABEL:
@@ -581,16 +597,7 @@
case CHECKBOX_PREVIEW:
case CHECKBOX_SELECTION:
{
- QString label;
-
- if (_resMgr && resId != -1)
- {
- OUString s(ResId(resId, *_resMgr).toString());
- label = toQString(s);
- label.replace("~", "&");
- }
-
- widget = new QCheckBox(label, _extraControls);
+ widget = new QCheckBox(getResString(resId), _extraControls);
// the checkbox is created even for CHECKBOX_AUTOEXTENSION to
simplify
// code, but the checkbox is hidden and ignored
@@ -719,8 +726,23 @@
1 );
}
- _dialog->setOperationMode(operationMode);
- _dialog->setConfirmOverwrite(true);
+ _dialog->setOperationMode( operationMode );
+
+ sal_Int16 resId = -1;
+ switch (_dialog->operationMode())
+ {
+ case KFileDialog::Opening:
+ resId = STR_FPICKER_OPEN;
+ break;
+ case KFileDialog::Saving:
+ resId = STR_FPICKER_SAVE;
+ _dialog->setConfirmOverwrite( true );
+ break;
+ default:
+ break;
+ }
+
+ _dialog->setCaption(getResString(resId));
}
void SAL_CALL KDE4FilePicker::cancel()
diff -u b/vcl/unx/kde4/KDE4FilePicker.hxx b/vcl/unx/kde4/KDE4FilePicker.hxx
--- b/vcl/unx/kde4/KDE4FilePicker.hxx
+++ b/vcl/unx/kde4/KDE4FilePicker.hxx
@@ -41,8 +41,6 @@
class QWidget;
class QLayout;
-class ResMgr;
-
typedef ::cppu::WeakComponentImplHelper5
< ::com::sun::star::ui::dialogs::XFilePicker2
, ::com::sun::star::ui::dialogs::XFilePicker3
@@ -61,8 +59,6 @@
::com::sun::star::uno::Reference<
::com::sun::star::ui::dialogs::XFilePickerListener > m_xListener;
- ResMgr *_resMgr;
-
//the dialog to display
KFileDialog* _dialog;
@@ -225,6 +221,8 @@
//add a custom control widget to the file dialog
void addCustomControl(sal_Int16 controlId);
+ static QString getResString( sal_Int16 aRedId );
+
private Q_SLOTS:
void cleanupProxy();
void checkProtocol();
1.1
app-office/libreoffice/files/libreoffice-4.4.4.3-cleanup-IsNativeControlSupported.patch
file :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-office/libreoffice/files/libreoffice-4.4.4.3-cleanup-IsNativeControlSupported.patch?rev=1.1&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-office/libreoffice/files/libreoffice-4.4.4.3-cleanup-IsNativeControlSupported.patch?rev=1.1&content-type=text/plain
Index: libreoffice-4.4.4.3-cleanup-IsNativeControlSupported.patch
===================================================================
Merged upstream commits:
88e16529fc7b0e312b68e38295348c93b437aad8 "tdf#92110 KDE4: cleanup
IsNativeControlSupported"
57792314c7b05f71c66834ee47bfaa09003df765 "tdf#92115 KDE4: better listbox
theming"
diff -u b/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx
--- b/vcl/unx/kde4/KDESalGraphics.cxx
+++ b/vcl/unx/kde4/KDESalGraphics.cxx
@@ -85,47 +85,43 @@
bool KDESalGraphics::IsNativeControlSupported( ControlType type, ControlPart
part )
{
- if (type == CTRL_PUSHBUTTON) return true;
-
- if (type == CTRL_MENUBAR) return true;
-
- if (type == CTRL_MENU_POPUP) return true;
-
- if (type == CTRL_EDITBOX) return true;
-
- if (type == CTRL_COMBOBOX) return true;
-
- if (type == CTRL_TOOLBAR) return true;
-
- if (type == CTRL_CHECKBOX) return true;
-
- if (type == CTRL_LISTBOX) return true;
-
- if (type == CTRL_LISTNODE) return true;
-
- if (type == CTRL_FRAME) return true;
-
- if (type == CTRL_SCROLLBAR) return true;
-
- if (type == CTRL_WINDOW_BACKGROUND) return true;
-
- if (type == CTRL_SPINBOX && (part == PART_ENTIRE_CONTROL || part ==
HAS_BACKGROUND_TEXTURE) ) return true;
-
- // no spinbuttons for KDE, paint spinbox complete
- //if (type == CTRL_SPINBUTTONS) return true;
-
- if (type == CTRL_GROUPBOX) return true;
-
- if (type == CTRL_FIXEDLINE) return true;
-
- if (type == CTRL_TOOLTIP) return true;
+ switch (type)
+ {
+ case CTRL_PUSHBUTTON:
+ case CTRL_RADIOBUTTON:
+ case CTRL_CHECKBOX:
+ case CTRL_TOOLTIP:
+ case CTRL_PROGRESS:
+ case CTRL_LISTNODE:
+ return (part == PART_ENTIRE_CONTROL);
+
+ case CTRL_MENUBAR:
+ case CTRL_MENU_POPUP:
+ case CTRL_EDITBOX:
+ case CTRL_COMBOBOX:
+ case CTRL_TOOLBAR:
+ case CTRL_FRAME:
+ case CTRL_SCROLLBAR:
+ case CTRL_WINDOW_BACKGROUND:
+ case CTRL_GROUPBOX:
+ case CTRL_FIXEDLINE:
+ return true;
+
+ case CTRL_LISTBOX:
+ return (part == PART_ENTIRE_CONTROL
+ || part == PART_SUB_EDIT
+ || part == PART_WINDOW
+ || part == PART_BUTTON_DOWN);
- if (type == CTRL_RADIOBUTTON) return true;
+ case CTRL_SPINBOX:
+ return (part == PART_ENTIRE_CONTROL || part ==
HAS_BACKGROUND_TEXTURE);
- if (type == CTRL_SLIDER && (part == PART_TRACK_HORZ_AREA || part ==
PART_TRACK_VERT_AREA) )
- return true;
+ case CTRL_SLIDER:
+ return (part == PART_TRACK_HORZ_AREA || part ==
PART_TRACK_VERT_AREA);
- if ( (type == CTRL_PROGRESS) && (part == PART_ENTIRE_CONTROL) ) return
true;
+ default:
+ break;
+ }
return false;
}
@@ -221,15 +217,15 @@
const ImplControlValue& value,
const OUString& )
{
- if( lastPopupRect.isValid() && ( type != CTRL_MENU_POPUP || part !=
PART_MENU_ITEM ))
- lastPopupRect = QRect();
-
- // put not implemented types here
- if (type == CTRL_SPINBUTTONS)
- {
+ bool nativeSupport = IsNativeControlSupported( type, part );
+ if( ! nativeSupport ) {
+ assert( ! nativeSupport && "drawNativeControl called without native
support!" );
return false;
}
+ if( lastPopupRect.isValid() && ( type != CTRL_MENU_POPUP || part !=
PART_MENU_ITEM ))
+ lastPopupRect = QRect();
+
bool returnVal = true;
QRect widgetRect = region2QRect(rControlRegion);
@@ -414,24 +410,26 @@
}
else if (type == CTRL_LISTBOX)
{
- if( part == PART_WINDOW )
- {
- lcl_drawFrame( QStyle::PE_Frame, m_image,
- vclStateValue2StateFlag(nControlState, value) );
- }
- else
- {
- QStyleOptionComboBox option;
- if (part == PART_SUB_EDIT)
- {
+ QStyleOptionComboBox option;
+ switch (part) {
+ case PART_WINDOW:
+ lcl_drawFrame( QStyle::PE_Frame, m_image,
+ vclStateValue2StateFlag(nControlState, value) );
+ break;
+ case PART_SUB_EDIT:
draw( QStyle::CE_ComboBoxLabel, &option, m_image,
vclStateValue2StateFlag(nControlState, value) );
- }
- else
- {
+ break;
+ case PART_ENTIRE_CONTROL:
+ draw( QStyle::CC_ComboBox, &option, m_image,
+ vclStateValue2StateFlag(nControlState, value) );
+ break;
+ case PART_BUTTON_DOWN:
+ m_image->fill( Qt::transparent );
+ option.subControls = QStyle::SC_ComboBoxArrow;
draw( QStyle::CC_ComboBox, &option, m_image,
vclStateValue2StateFlag(nControlState, value) );
- }
+ break;
}
}
else if (type == CTRL_LISTNODE)
@@ -652,6 +650,12 @@
const OUString&,
Rectangle &nativeBoundingRegion,
Rectangle &nativeContentRegion )
{
+ bool nativeSupport = IsNativeControlSupported( type, part );
+ if( ! nativeSupport ) {
+ assert( ! nativeSupport && "drawNativeControl called without native
support!" );
+ return false;
+ }
+
bool retVal = false;
QRect boundingRect = region2QRect( controlRegion );
@@ -733,8 +737,6 @@
{
case PART_ENTIRE_CONTROL:
{
- int size =
QApplication::style()->pixelMetric(QStyle::PM_ComboBoxFrameWidth) - 2;
-
// find out the minimum size that should be used
// assume contents is a text ling
int nHeight = QApplication::fontMetrics().height();
@@ -747,8 +749,10 @@
// FIXME: why this difference between comboboxes and
listboxes ?
// because a combobox has a sub edit and that is positioned
// inside the outer bordered control ?
- if( type == CTRL_COMBOBOX )
+ if( type == CTRL_COMBOBOX ) {
+ int size =
QApplication::style()->pixelMetric(QStyle::PM_ComboBoxFrameWidth) - 2;
contentRect.adjust(-size,-size,size,size);
+ }
retVal = true;
break;
}
@@ -761,13 +765,22 @@
retVal = true;
break;
case PART_SUB_EDIT:
+ {
contentRect = QApplication::style()->subControlRect(
QStyle::CC_ComboBox, &cbo,
QStyle::SC_ComboBoxEditField );
- contentRect.translate( boundingRect.left(),
boundingRect.top() );
+ int hmargin = QApplication::style()->pixelMetric(
+ QStyle::PM_FocusFrameHMargin, &styleOption);
+ int vmargin = QApplication::style()->pixelMetric(
+ QStyle::PM_FocusFrameVMargin, &styleOption);
+
+ contentRect.translate( boundingRect.left() + hmargin,
boundingRect.top() + vmargin );
+ contentRect.adjust( 0, 0, -2 * hmargin, -2 * vmargin );
+ boundingRect = contentRect;
retVal = true;
break;
+ }
case PART_WINDOW:
retVal = true;
break;
1.1
app-office/libreoffice/files/libreoffice-4.4.4.3-fix-KDE4-FileDialog.patch
file :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-office/libreoffice/files/libreoffice-4.4.4.3-fix-KDE4-FileDialog.patch?rev=1.1&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-office/libreoffice/files/libreoffice-4.4.4.3-fix-KDE4-FileDialog.patch?rev=1.1&content-type=text/plain
Index: libreoffice-4.4.4.3-fix-KDE4-FileDialog.patch
===================================================================
>From e7352d5ada69f212dc813c4cbd257d036e7a27c8 Mon Sep 17 00:00:00 2001
From: Juergen Funk <[email protected]>
Date: Fri, 3 Jul 2015 08:33:03 +0200
Subject: tdf#92517 KDE4-FileDialog: "Save as" has wrong Filter
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixing follow
- The order of calling: first should be set the filter, after
that can be set the current filter
- change the function from "setCurrentFilter" to "setCurrentItem"
When you set the filter over "setCurrentFilter" you need the full
search string "extention|description" e.g. "*.docx|Microsoft Word.."
- Not need the escape of slash (with that can not find
"Microsoft Word 2007/2010 XML (.docx))"
Change-Id: Ie4f7d6fd619b391487ee944c3e745c855600ee54
Reviewed-on: https://gerrit.libreoffice.org/16721
Tested-by: Jenkins <[email protected]>
Reviewed-by: Katarina Behrens <[email protected]>
(cherry picked from commit a93cfd5afb9072de00fc4b2a070f23ebdad6e4fe)
Reviewed-on: https://gerrit.libreoffice.org/16890
Reviewed-by: Caolán McNamara <[email protected]>
Tested-by: Caolán McNamara <[email protected]>
diff --git a/vcl/unx/kde4/KDE4FilePicker.cxx b/vcl/unx/kde4/KDE4FilePicker.cxx
index 4615bd4..a638955 100644
--- a/vcl/unx/kde4/KDE4FilePicker.cxx
+++ b/vcl/unx/kde4/KDE4FilePicker.cxx
@@ -250,6 +250,10 @@ sal_Int16 SAL_CALL KDE4FilePicker::execute()
_dialog->clearFilter();
_dialog->setFilter(_filter);
+
+ if(!_currentFilter.isNull())
+ _dialog->filterWidget()->setCurrentItem(_currentFilter);
+
_dialog->filterWidget()->setEditable(false);
VCLKDEApplication::preDialogSetup();
@@ -384,9 +388,7 @@ void SAL_CALL KDE4FilePicker::setCurrentFilter( const
OUString &title )
return Q_EMIT setCurrentFilterSignal( title );
}
- QString t = toQString(title);
- t.replace("/", "\\/");
- _dialog->filterWidget()->setCurrentFilter(t);
+ _currentFilter = toQString(title);
}
OUString SAL_CALL KDE4FilePicker::getCurrentFilter()
@@ -633,6 +635,7 @@ void SAL_CALL KDE4FilePicker::initialize( const
uno::Sequence<uno::Any> &args )
}
_filter.clear();
+ _currentFilter.clear();
// parameter checking
uno::Any arg;
diff --git a/vcl/unx/kde4/KDE4FilePicker.hxx b/vcl/unx/kde4/KDE4FilePicker.hxx
index 98e9af6..ff3a8602 100644
--- a/vcl/unx/kde4/KDE4FilePicker.hxx
+++ b/vcl/unx/kde4/KDE4FilePicker.hxx
@@ -66,6 +66,8 @@ protected:
//running filter string to add to dialog
QString _filter;
+ // string to set the current filter
+ QString _currentFilter;
//mapping of SAL control ID's to created custom controls
QHash<sal_Int16, QWidget*> _customWidgets;
--
cgit v0.10.2