[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 174 commits - android/source basctl/source bin/check-elf-dynamic-objects bin/oss-fuzz-build.sh canvas/source chart2/qa chart2/source comphelper/Library_comphelper.mk comphelper/qa comphelper/source compilerplugins/clang configure.ac cppcanvas/source cppuhelper/source cppu/qa cui/source desktop/qa download.lst drawinglayer/source embeddedobj/source extensions/CustomTarget_automationtest.mk extensions/Module_extensions.mk extensions/qa extensions/source external/libnumbertext external/mariadb-connector-c filter/source helpcontent2 i18nlangtag/qa i18npool/qa include/comphelper include/drawinglayer include/filter include/IwyuFilter_include.yaml include/svtools include/svx include/vbahelper include/vcl linguistic/source o3tl/qa offapi/com oovbaapi/ooo oovbaapi/UnoApi_oovbaapi.mk oox/source readlicense_oo/docs reportdesign/source sal/qa sax/qa sc/CppunitTest_sc_addin_functions_test.mk sc/CppunitTest_sc_anchor_test.mk sc/CppunitTest_sc_array_fu nctions_test.mk sc/CppunitTest_sc_bugfix_test.mk sc/CppunitTest_sc_chart2dataprovider.mk sc/CppunitTest_sc_cond_format_merge.mk sc/CppunitTest_sc_copypaste.mk sc/CppunitTest_sc_database_functions_test.mk sc/CppunitTest_sc_dataprovider.mk sc/CppunitTest_sc_datatransformation.mk sc/CppunitTest_sc_datetime_functions_test.mk sc/CppunitTest_sc_filters_test.mk sc/CppunitTest_sc_financial_functions_test.mk sc/CppunitTest_sc_functions_test_old.mk sc/CppunitTest_sc_html_export_test.mk sc/CppunitTest_sc_information_functions_test.mk sc/CppunitTest_sc_logical_functions_test.mk sc/CppunitTest_sc_mathematical_functions_test.mk sc/CppunitTest_sc_opencl_test.mk sc/CppunitTest_sc_parallelism.mk sc/CppunitTest_sc_pivottable_filters_test.mk sc/CppunitTest_sc_spreadsheet_functions_test.mk sc/CppunitTest_sc_statistical_functions_test.mk sc/CppunitTest_sc_subsequent_export_test.mk sc/CppunitTest_sc_subsequent_filters_test.mk sc/CppunitTest_sc_text_functions_test.mk sc/CppunitTest_sc_ucalc.mk sc/inc sc/L ibrary_scd.mk sc/Library_scfilt.mk sc/Library_sc.mk sc/Library_scqahelper.mk sc/Library_scui.mk scp2/source sc/qa sc/source sc/uiconfig sd/qa sd/source sfx2/qa sfx2/source solenv/clang-format solenv/flatpak-manifest.in starmath/source stoc/source svl/qa svtools/CppunitTest_svtools_graphic.mk svtools/qa svtools/source svx/source sw/CppunitTest_sw_docbookexport.mk sw/CppunitTest_sw_filters_test.mk sw/CppunitTest_sw_fodfexport.mk sw/CppunitTest_sw_globalfilter.mk sw/CppunitTest_sw_htmlexport.mk sw/CppunitTest_sw_htmlimport.mk sw/CppunitTest_sw_layoutwriter.mk sw/CppunitTest_sw_mailmerge.mk sw/CppunitTest_sw_odfexport.mk sw/CppunitTest_sw_odfimport.mk sw/CppunitTest_sw_ooxmlencryption.mk sw/CppunitTest_sw_ooxmlexport8.mk sw/CppunitTest_sw_ooxmlfieldexport.mk sw/CppunitTest_sw_ooxmlimport2.mk sw/CppunitTest_sw_ooxmlimport.mk sw/CppunitTest_sw_ooxmllinks.mk sw/CppunitTest_sw_ooxmlw14export.mk sw/CppunitTest_sw_rtfexport2.mk sw/CppunitTest_sw_rtfexport3.mk sw/CppunitTest_sw_rtfexport.mk sw /CppunitTest_sw_rtfimport.mk sw/CppunitTest_sw_tiledrendering.mk sw/CppunitTest_sw_txtexport.mk sw/CppunitTest_sw_uiwriter.mk sw/CppunitTest_sw_uwriter.mk sw/CppunitTest_sw_ww8export2.mk sw/CppunitTest_sw_ww8export.mk sw/CppunitTest_sw_ww8import.mk sw/inc sw/Library_msword.mk sw/Library_sw.mk sw/Library_swui.mk sw/ooxmlexport_setup.mk sw/qa sw/source sysui/desktop test/source tools/qa vbahelper/source vcl/CustomTarget_kde5_moc.mk vcl/CustomTarget_qt5_moc.mk vcl/headless vcl/inc vcl/Library_vcl.mk vcl/Library_vclplug_kde5.mk vcl/Library_vclplug_qt5.mk vcl/qa vcl/qt5 vcl/source vcl/unx vcl/workben writerperfect/qa xmlsecurity/qa xmlsecurity/source
Katarina Behrens
Katarina.Behrens at cib.de
Mon Jun 4 14:10:54 UTC 2018
Rebased ref, commits from common ancestor:
commit a4186c6c0d413c557c199dbb9814c5e787e8608b
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Mon Jun 4 15:39:40 2018 +0200
Basic structures of KDE5 native filepicker build now
Change-Id: I174a4a01f2191d935ea069a0e04b5c88f4bf8193
diff --git a/vcl/CustomTarget_kde5_moc.mk b/vcl/CustomTarget_kde5_moc.mk
index 8bcaf1ed3700..5c7fea94428b 100644
--- a/vcl/CustomTarget_kde5_moc.mk
+++ b/vcl/CustomTarget_kde5_moc.mk
@@ -10,6 +10,7 @@
$(eval $(call gb_CustomTarget_CustomTarget,vcl/unx/kde5))
$(call gb_CustomTarget_get_target,vcl/unx/kde5) : \
+ $(call gb_CustomTarget_get_workdir,vcl/unx/kde5)/KDE5FilePicker.moc \
$(call gb_CustomTarget_get_workdir,vcl/unx/kde5)/tst_exclude_socket_notifiers.moc \
$(call gb_CustomTarget_get_workdir,vcl/unx/kde5)/tst_exclude_posted_events.moc
diff --git a/vcl/Library_vclplug_kde5.mk b/vcl/Library_vclplug_kde5.mk
index 377698d1f93c..37a830b068dd 100644
--- a/vcl/Library_vclplug_kde5.mk
+++ b/vcl/Library_vclplug_kde5.mk
@@ -87,6 +87,8 @@ $(eval $(call gb_Library_add_libs,vclplug_kde5,\
))
$(eval $(call gb_Library_add_exception_objects,vclplug_kde5,\
+ vcl/unx/kde5/KDE5FilePicker \
+ vcl/unx/kde5/KDE5FilePicker2 \
vcl/unx/kde5/KDE5SalData \
vcl/unx/kde5/KDE5SalDisplay \
vcl/unx/kde5/KDE5SalFrame \
diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx
index f3b48b837836..bda9de9b9ae3 100644
--- a/vcl/unx/kde5/KDE5FilePicker.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "kde5_filepicker.hxx"
+#include "KDE5FilePicker.hxx"
#include <KWindowSystem>
#include <KFileWidget>
@@ -241,6 +241,6 @@ bool KDE5FilePicker::eventFilter(QObject* o, QEvent* e)
return QObject::eventFilter(o, e);
}
-#include <kde5_filepicker.moc>
+#include <KDE5FilePicker.moc>
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx
index 011769091f6d..b2bafcdda95b 100644
--- a/vcl/unx/kde5/KDE5FilePicker2.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker2.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "gtk3_kde5_filepicker.hxx"
+#include "KDE5FilePicker2.hxx"
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -88,33 +88,19 @@ void SAL_CALL KDE5FilePicker2::removeFilePickerListener(const uno::Reference<XFi
m_xListener.clear();
}
-void SAL_CALL KDE5FilePicker2::setTitle(const OUString& title)
-{
- m_ipc.sendCommand(Commands::SetTitle, title);
-}
+void SAL_CALL KDE5FilePicker2::setTitle(const OUString& title) {}
-sal_Int16 SAL_CALL KDE5FilePicker2::execute() { return m_ipc.execute(); }
+sal_Int16 SAL_CALL KDE5FilePicker2::execute() { return 0; }
-void SAL_CALL KDE5FilePicker2::setMultiSelectionMode(sal_Bool multiSelect)
-{
- m_ipc.sendCommand(Commands::SetMultiSelectionMode, bool(multiSelect));
-}
+void SAL_CALL KDE5FilePicker2::setMultiSelectionMode(sal_Bool multiSelect) {}
-void SAL_CALL KDE5FilePicker2::setDefaultName(const OUString& name)
-{
- m_ipc.sendCommand(Commands::SetDefaultName, name);
-}
+void SAL_CALL KDE5FilePicker2::setDefaultName(const OUString& name) {}
-void SAL_CALL KDE5FilePicker2::setDisplayDirectory(const OUString& dir)
-{
- m_ipc.sendCommand(Commands::SetDisplayDirectory, dir);
-}
+void SAL_CALL KDE5FilePicker2::setDisplayDirectory(const OUString& dir) {}
OUString SAL_CALL KDE5FilePicker2::getDisplayDirectory()
{
- auto id = m_ipc.sendCommand(Commands::GetDisplayDirectory);
OUString dir;
- m_ipc.readResponse(id, dir);
return dir;
}
@@ -128,27 +114,17 @@ uno::Sequence<OUString> SAL_CALL KDE5FilePicker2::getFiles()
uno::Sequence<OUString> SAL_CALL KDE5FilePicker2::getSelectedFiles()
{
- auto id = m_ipc.sendCommand(Commands::GetSelectedFiles);
uno::Sequence<OUString> seq;
- m_ipc.readResponse(id, seq);
return seq;
}
-void SAL_CALL KDE5FilePicker2::appendFilter(const OUString& title, const OUString& filter)
-{
- m_ipc.sendCommand(Commands::AppendFilter, title, filter);
-}
+void SAL_CALL KDE5FilePicker2::appendFilter(const OUString& title, const OUString& filter) {}
-void SAL_CALL KDE5FilePicker2::setCurrentFilter(const OUString& title)
-{
- m_ipc.sendCommand(Commands::SetCurrentFilter, title);
-}
+void SAL_CALL KDE5FilePicker2::setCurrentFilter(const OUString& title) {}
OUString SAL_CALL KDE5FilePicker2::getCurrentFilter()
{
- auto id = m_ipc.sendCommand(Commands::GetCurrentFilter);
OUString filter;
- m_ipc.readResponse(id, filter);
return filter;
}
@@ -166,14 +142,6 @@ void SAL_CALL KDE5FilePicker2::appendFilterGroup(const OUString& /*rGroupTitle*/
void SAL_CALL KDE5FilePicker2::setValue(sal_Int16 controlId, sal_Int16 nControlAction,
const uno::Any& value)
{
- if (value.has<bool>())
- {
- m_ipc.sendCommand(Commands::SetValue, controlId, nControlAction, value.get<bool>());
- }
- else
- {
- OSL_TRACE("set value of unhandled type %d", controlId);
- }
}
uno::Any SAL_CALL KDE5FilePicker2::getValue(sal_Int16 controlId, sal_Int16 nControlAction)
@@ -186,29 +154,18 @@ uno::Any SAL_CALL KDE5FilePicker2::getValue(sal_Int16 controlId, sal_Int16 nCont
// saves the value of the setting, so LO core is not needed for that either.
return uno::Any(false);
- auto id = m_ipc.sendCommand(Commands::GetValue, controlId, nControlAction);
-
bool value = false;
- m_ipc.readResponse(id, value);
return uno::Any(value);
}
-void SAL_CALL KDE5FilePicker2::enableControl(sal_Int16 controlId, sal_Bool enable)
-{
- m_ipc.sendCommand(Commands::EnableControl, controlId, bool(enable));
-}
+void SAL_CALL KDE5FilePicker2::enableControl(sal_Int16 controlId, sal_Bool enable) {}
-void SAL_CALL KDE5FilePicker2::setLabel(sal_Int16 controlId, const OUString& label)
-{
- m_ipc.sendCommand(Commands::SetLabel, controlId, label);
-}
+void SAL_CALL KDE5FilePicker2::setLabel(sal_Int16 controlId, const OUString& label) {}
OUString SAL_CALL KDE5FilePicker2::getLabel(sal_Int16 controlId)
{
- auto id = m_ipc.sendCommand(Commands::GetLabel, controlId);
OUString label;
- m_ipc.readResponse(id, label);
return label;
}
@@ -279,9 +236,6 @@ void KDE5FilePicker2::addCustomControl(sal_Int16 controlId)
// the checkbox is created even for CHECKBOX_AUTOEXTENSION to simplify
// code, but the checkbox is hidden and ignored
bool hidden = controlId == CHECKBOX_AUTOEXTENSION;
-
- m_ipc.sendCommand(Commands::AddCheckBox, controlId, hidden, getResString(resId));
-
break;
}
case PUSHBUTTON_PLAY:
@@ -402,9 +356,7 @@ void SAL_CALL KDE5FilePicker2::initialize(const uno::Sequence<uno::Any>& args)
return;
}
- setTitle(getResString(saveDialog ? STR_FPICKER_SAVE : STR_FPICKER_OPEN));
-
- m_ipc.sendCommand(Commands::Initialize, saveDialog);
+ setTitle(VclResId(saveDialog ? STR_FPICKER_SAVE : STR_FPICKER_OPEN));
}
void SAL_CALL KDE5FilePicker2::cancel()
diff --git a/vcl/unx/kde5/KDE5FilePicker2.hxx b/vcl/unx/kde5/KDE5FilePicker2.hxx
index ca98191def89..0271d8900a0d 100644
--- a/vcl/unx/kde5/KDE5FilePicker2.hxx
+++ b/vcl/unx/kde5/KDE5FilePicker2.hxx
@@ -32,8 +32,6 @@
#include <rtl/ustrbuf.hxx>
-#include "gtk3_kde5_filepicker_ipc.hxx"
-
#include <functional>
typedef ::cppu::WeakComponentImplHelper<css::ui::dialogs::XFilePicker3,
@@ -49,7 +47,6 @@ protected:
css::uno::Reference<css::ui::dialogs::XFilePickerListener> m_xListener;
osl::Mutex _helperMutex;
- KDE5FilePicker2Ipc m_ipc;
public:
explicit KDE5FilePicker2(const css::uno::Reference<css::uno::XComponentContext>&);
commit f9b11c4037558711f75879829391346ae5590ec5
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Fri Jun 1 16:15:44 2018 +0200
Copy filepicker classes from gtk3_kde5, don't build yet
Change-Id: Ic18add9e1e0a6a7e4480df17885670a0796f074a
diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx
new file mode 100644
index 000000000000..f3b48b837836
--- /dev/null
+++ b/vcl/unx/kde5/KDE5FilePicker.cxx
@@ -0,0 +1,246 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include "kde5_filepicker.hxx"
+
+#include <KWindowSystem>
+#include <KFileWidget>
+
+#include <QtCore/QDebug>
+#include <QtCore/QUrl>
+#include <QtGui/QClipboard>
+#include <QtGui/QWindow>
+#include <QtWidgets/QCheckBox>
+#include <QtWidgets/QFileDialog>
+#include <QtWidgets/QGridLayout>
+#include <QtWidgets/QWidget>
+#include <QtWidgets/QApplication>
+
+// KDE5FilePicker
+
+KDE5FilePicker::KDE5FilePicker(QObject* parent)
+ : QObject(parent)
+ , _dialog(new QFileDialog(nullptr, {}, QDir::homePath()))
+ , _extraControls(new QWidget)
+ , _layout(new QGridLayout(_extraControls))
+ , _winId(0)
+ , allowRemoteUrls(false)
+{
+ _dialog->setSupportedSchemes({
+ QStringLiteral("file"),
+ QStringLiteral("ftp"),
+ QStringLiteral("http"),
+ QStringLiteral("https"),
+ QStringLiteral("webdav"),
+ QStringLiteral("webdavs"),
+ QStringLiteral("smb"),
+ });
+
+ setMultiSelectionMode(false);
+
+ connect(_dialog, &QFileDialog::filterSelected, this, &KDE5FilePicker::filterChanged);
+ connect(_dialog, &QFileDialog::fileSelected, this, &KDE5FilePicker::selectionChanged);
+
+ qApp->installEventFilter(this);
+}
+
+void KDE5FilePicker::enableFolderMode()
+{
+ _dialog->setOption(QFileDialog::ShowDirsOnly, true);
+ _dialog->setFileMode(QFileDialog::Directory);
+}
+
+KDE5FilePicker::~KDE5FilePicker()
+{
+ delete _extraControls;
+ delete _dialog;
+}
+
+void KDE5FilePicker::setTitle(const QString& title) { _dialog->setWindowTitle(title); }
+
+bool KDE5FilePicker::execute()
+{
+ if (!_filters.isEmpty())
+ _dialog->setNameFilters(_filters);
+ if (!_currentFilter.isEmpty())
+ _dialog->selectNameFilter(_currentFilter);
+
+ _dialog->show();
+ //block and wait for user input
+ return _dialog->exec() == QFileDialog::Accepted;
+}
+
+void KDE5FilePicker::setMultiSelectionMode(bool multiSelect)
+{
+ _dialog->setFileMode(multiSelect ? QFileDialog::ExistingFiles : QFileDialog::ExistingFile);
+}
+
+void KDE5FilePicker::setDefaultName(const QString& name) { _dialog->selectUrl(QUrl(name)); }
+
+void KDE5FilePicker::setDisplayDirectory(const QString& dir) { _dialog->selectUrl(QUrl(dir)); }
+
+QString KDE5FilePicker::getDisplayDirectory() const { return _dialog->directoryUrl().url(); }
+
+QList<QUrl> KDE5FilePicker::getSelectedFiles() const { return _dialog->selectedUrls(); }
+
+void KDE5FilePicker::appendFilter(const QString& title, const QString& filter)
+{
+ QString t = title;
+ QString f = filter;
+ // '/' need to be escaped else they are assumed to be mime types by kfiledialog
+ //see the docs
+ t.replace("/", "\\/");
+
+ // openoffice gives us filters separated by ';' qt dialogs just want space separated
+ f.replace(";", " ");
+
+ // make sure "*.*" is not used as "all files"
+ f.replace("*.*", "*");
+
+ _filters << QStringLiteral("%1 (%2)").arg(t, f);
+ _titleToFilters[t] = _filters.constLast();
+}
+
+void KDE5FilePicker::setCurrentFilter(const QString& title)
+{
+ _currentFilter = _titleToFilters.value(title);
+}
+
+QString KDE5FilePicker::getCurrentFilter() const
+{
+ QString filter = _titleToFilters.key(_dialog->selectedNameFilter());
+
+ //default if not found
+ if (filter.isEmpty())
+ filter = "ODF Text Document (.odt)";
+
+ return filter;
+}
+
+void KDE5FilePicker::setValue(sal_Int16 controlId, sal_Int16 /*nControlAction*/, bool value)
+{
+ if (_customWidgets.contains(controlId))
+ {
+ QCheckBox* cb = dynamic_cast<QCheckBox*>(_customWidgets.value(controlId));
+ if (cb)
+ cb->setChecked(value);
+ }
+ else
+ qWarning() << "set value on unknown control" << controlId;
+}
+
+bool KDE5FilePicker::getValue(sal_Int16 controlId, sal_Int16 /*nControlAction*/) const
+{
+ bool ret = false;
+ if (_customWidgets.contains(controlId))
+ {
+ QCheckBox* cb = dynamic_cast<QCheckBox*>(_customWidgets.value(controlId));
+ if (cb)
+ ret = cb->isChecked();
+ }
+ else
+ qWarning() << "get value on unknown control" << controlId;
+
+ return ret;
+}
+
+void KDE5FilePicker::enableControl(sal_Int16 controlId, bool enable)
+{
+ if (_customWidgets.contains(controlId))
+ _customWidgets.value(controlId)->setEnabled(enable);
+ else
+ qWarning() << "enable on unknown control" << controlId;
+}
+
+void KDE5FilePicker::setLabel(sal_Int16 controlId, const QString& label)
+{
+ if (_customWidgets.contains(controlId))
+ {
+ QCheckBox* cb = dynamic_cast<QCheckBox*>(_customWidgets.value(controlId));
+ if (cb)
+ cb->setText(label);
+ }
+ else
+ qWarning() << "set label on unknown control" << controlId;
+}
+
+QString KDE5FilePicker::getLabel(sal_Int16 controlId) const
+{
+ QString label;
+ if (_customWidgets.contains(controlId))
+ {
+ QCheckBox* cb = dynamic_cast<QCheckBox*>(_customWidgets.value(controlId));
+ if (cb)
+ label = cb->text();
+ }
+ else
+ qWarning() << "get label on unknown control" << controlId;
+
+ return label;
+}
+
+void KDE5FilePicker::addCheckBox(sal_Int16 controlId, const QString& label, bool hidden)
+{
+ auto resString = label;
+ resString.replace('~', '&');
+
+ auto widget = new QCheckBox(resString, _extraControls);
+ widget->setHidden(hidden);
+ if (!hidden)
+ {
+ _layout->addWidget(widget);
+ }
+ _customWidgets.insert(controlId, widget);
+}
+
+void KDE5FilePicker::initialize(bool saveDialog)
+{
+ //default is opening
+ QFileDialog::AcceptMode operationMode
+ = saveDialog ? QFileDialog::AcceptSave : QFileDialog::AcceptOpen;
+
+ _dialog->setAcceptMode(operationMode);
+
+ if (saveDialog)
+ {
+ _dialog->setConfirmOverwrite(true);
+ _dialog->setFileMode(QFileDialog::AnyFile);
+ }
+}
+
+void KDE5FilePicker::setWinId(sal_uIntPtr winId) { _winId = winId; }
+
+bool KDE5FilePicker::eventFilter(QObject* o, QEvent* e)
+{
+ if (e->type() == QEvent::Show && o->isWidgetType())
+ {
+ auto* w = static_cast<QWidget*>(o);
+ if (!w->parentWidget() && w->isModal())
+ {
+ KWindowSystem::setMainWindow(w, _winId);
+ if (auto* fileWidget = w->findChild<KFileWidget*>({}, Qt::FindDirectChildrenOnly))
+ fileWidget->setCustomWidget(_extraControls);
+ }
+ }
+ return QObject::eventFilter(o, e);
+}
+
+#include <kde5_filepicker.moc>
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx
new file mode 100644
index 000000000000..d999f7bf7a09
--- /dev/null
+++ b/vcl/unx/kde5/KDE5FilePicker.hxx
@@ -0,0 +1,110 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <QtCore/QObject>
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+#include <QtCore/QHash>
+
+#include <sal/types.h>
+
+class QFileDialog;
+class QWidget;
+class QGridLayout;
+
+class KDE5FilePicker : public QObject
+{
+ Q_OBJECT
+protected:
+ //the dialog to display
+ QFileDialog* _dialog;
+
+ //running filter string to add to dialog
+ QStringList _filters;
+ // map of filter titles to full filter for selection
+ QHash<QString, QString> _titleToFilters;
+ // string to set the current filter
+ QString _currentFilter;
+
+ //mapping of SAL control ID's to created custom controls
+ QHash<sal_Int16, QWidget*> _customWidgets;
+
+ //widget to contain extra custom controls
+ QWidget* _extraControls;
+
+ //layout for extra custom controls
+ QGridLayout* _layout;
+
+ sal_uIntPtr _winId;
+
+ bool allowRemoteUrls;
+
+public:
+ explicit KDE5FilePicker(QObject* parent = nullptr);
+ ~KDE5FilePicker() override;
+
+ void enableFolderMode();
+
+ // XExecutableDialog functions
+ void setTitle(const QString& rTitle);
+ bool execute();
+
+ // XFilePicker functions
+ void setMultiSelectionMode(bool bMode);
+ void setDefaultName(const QString& rName);
+ void setDisplayDirectory(const QString& rDirectory);
+ QString getDisplayDirectory() const;
+
+ // XFilterManager functions
+ void appendFilter(const QString& rTitle, const QString& rFilter);
+ void setCurrentFilter(const QString& rTitle);
+ QString getCurrentFilter() const;
+
+ // XFilePickerControlAccess functions
+ void setValue(sal_Int16 nControlId, sal_Int16 nControlAction, bool rValue);
+ bool getValue(sal_Int16 nControlId, sal_Int16 nControlAction) const;
+ void enableControl(sal_Int16 nControlId, bool bEnable);
+ void setLabel(sal_Int16 nControlId, const QString& rLabel);
+ QString getLabel(sal_Int16 nControlId) const;
+
+ // XFilePicker2 functions
+ QList<QUrl> getSelectedFiles() const;
+
+ // XInitialization
+ void initialize(bool saveDialog);
+
+ //add a custom control widget to the file dialog
+ void addCheckBox(sal_Int16 nControlId, const QString& label, bool hidden);
+
+ void setWinId(sal_uIntPtr winId);
+
+private:
+ Q_DISABLE_COPY(KDE5FilePicker)
+
+protected:
+ bool eventFilter(QObject* watched, QEvent* event) override;
+
+Q_SIGNALS:
+ void filterChanged();
+ void selectionChanged();
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx
new file mode 100644
index 000000000000..011769091f6d
--- /dev/null
+++ b/vcl/unx/kde5/KDE5FilePicker2.cxx
@@ -0,0 +1,457 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include "gtk3_kde5_filepicker.hxx"
+
+#include <com/sun/star/lang/DisposedException.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <cppuhelper/interfacecontainer.h>
+#include <cppuhelper/supportsservice.hxx>
+#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
+#include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp>
+#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
+#include <com/sun/star/ui/dialogs/ControlActions.hpp>
+#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
+
+#include <osl/mutex.hxx>
+
+#include <fpicker/strings.hrc>
+
+#include "FPServiceInfo.hxx"
+
+#undef Region
+
+#include <unx/geninst.h>
+
+#include <strings.hrc>
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::ui::dialogs;
+using namespace ::com::sun::star::ui::dialogs::TemplateDescription;
+using namespace ::com::sun::star::ui::dialogs::ExtendedFilePickerElementIds;
+using namespace ::com::sun::star::ui::dialogs::CommonFilePickerElementIds;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::uno;
+
+// helper functions
+
+namespace
+{
+uno::Sequence<OUString> FilePicker_getSupportedServiceNames()
+{
+ uno::Sequence<OUString> aRet(3);
+ aRet[0] = "com.sun.star.ui.dialogs.FilePicker";
+ aRet[1] = "com.sun.star.ui.dialogs.SystemFilePicker";
+ aRet[2] = "com.sun.star.ui.dialogs.KDE5FilePicker2";
+ return aRet;
+}
+}
+
+// KDE5FilePicker2
+
+KDE5FilePicker2::KDE5FilePicker2(const uno::Reference<uno::XComponentContext>&)
+ : KDE5FilePicker2_Base(_helperMutex)
+{
+ setMultiSelectionMode(false);
+}
+
+KDE5FilePicker2::~KDE5FilePicker2() = default;
+
+void SAL_CALL
+KDE5FilePicker2::addFilePickerListener(const uno::Reference<XFilePickerListener>& xListener)
+{
+ SolarMutexGuard aGuard;
+ m_xListener = xListener;
+}
+
+void SAL_CALL KDE5FilePicker2::removeFilePickerListener(const uno::Reference<XFilePickerListener>&)
+{
+ SolarMutexGuard aGuard;
+ m_xListener.clear();
+}
+
+void SAL_CALL KDE5FilePicker2::setTitle(const OUString& title)
+{
+ m_ipc.sendCommand(Commands::SetTitle, title);
+}
+
+sal_Int16 SAL_CALL KDE5FilePicker2::execute() { return m_ipc.execute(); }
+
+void SAL_CALL KDE5FilePicker2::setMultiSelectionMode(sal_Bool multiSelect)
+{
+ m_ipc.sendCommand(Commands::SetMultiSelectionMode, bool(multiSelect));
+}
+
+void SAL_CALL KDE5FilePicker2::setDefaultName(const OUString& name)
+{
+ m_ipc.sendCommand(Commands::SetDefaultName, name);
+}
+
+void SAL_CALL KDE5FilePicker2::setDisplayDirectory(const OUString& dir)
+{
+ m_ipc.sendCommand(Commands::SetDisplayDirectory, dir);
+}
+
+OUString SAL_CALL KDE5FilePicker2::getDisplayDirectory()
+{
+ auto id = m_ipc.sendCommand(Commands::GetDisplayDirectory);
+ OUString dir;
+ m_ipc.readResponse(id, dir);
+ return dir;
+}
+
+uno::Sequence<OUString> SAL_CALL KDE5FilePicker2::getFiles()
+{
+ uno::Sequence<OUString> seq = getSelectedFiles();
+ if (seq.getLength() > 1)
+ seq.realloc(1);
+ return seq;
+}
+
+uno::Sequence<OUString> SAL_CALL KDE5FilePicker2::getSelectedFiles()
+{
+ auto id = m_ipc.sendCommand(Commands::GetSelectedFiles);
+ uno::Sequence<OUString> seq;
+ m_ipc.readResponse(id, seq);
+ return seq;
+}
+
+void SAL_CALL KDE5FilePicker2::appendFilter(const OUString& title, const OUString& filter)
+{
+ m_ipc.sendCommand(Commands::AppendFilter, title, filter);
+}
+
+void SAL_CALL KDE5FilePicker2::setCurrentFilter(const OUString& title)
+{
+ m_ipc.sendCommand(Commands::SetCurrentFilter, title);
+}
+
+OUString SAL_CALL KDE5FilePicker2::getCurrentFilter()
+{
+ auto id = m_ipc.sendCommand(Commands::GetCurrentFilter);
+ OUString filter;
+ m_ipc.readResponse(id, filter);
+ return filter;
+}
+
+void SAL_CALL KDE5FilePicker2::appendFilterGroup(const OUString& /*rGroupTitle*/,
+ const uno::Sequence<beans::StringPair>& filters)
+{
+ const sal_uInt16 length = filters.getLength();
+ for (sal_uInt16 i = 0; i < length; ++i)
+ {
+ beans::StringPair aPair = filters[i];
+ appendFilter(aPair.First, aPair.Second);
+ }
+}
+
+void SAL_CALL KDE5FilePicker2::setValue(sal_Int16 controlId, sal_Int16 nControlAction,
+ const uno::Any& value)
+{
+ if (value.has<bool>())
+ {
+ m_ipc.sendCommand(Commands::SetValue, controlId, nControlAction, value.get<bool>());
+ }
+ else
+ {
+ OSL_TRACE("set value of unhandled type %d", controlId);
+ }
+}
+
+uno::Any SAL_CALL KDE5FilePicker2::getValue(sal_Int16 controlId, sal_Int16 nControlAction)
+{
+ if (CHECKBOX_AUTOEXTENSION == controlId)
+ // We ignore this one and rely on QFileDialog to provide the function.
+ // Always return false, to pretend we do not support this, otherwise
+ // LO core would try to be smart and cut the extension in some places,
+ // interfering with QFileDialog's handling of it. QFileDialog also
+ // saves the value of the setting, so LO core is not needed for that either.
+ return uno::Any(false);
+
+ auto id = m_ipc.sendCommand(Commands::GetValue, controlId, nControlAction);
+
+ bool value = false;
+ m_ipc.readResponse(id, value);
+
+ return uno::Any(value);
+}
+
+void SAL_CALL KDE5FilePicker2::enableControl(sal_Int16 controlId, sal_Bool enable)
+{
+ m_ipc.sendCommand(Commands::EnableControl, controlId, bool(enable));
+}
+
+void SAL_CALL KDE5FilePicker2::setLabel(sal_Int16 controlId, const OUString& label)
+{
+ m_ipc.sendCommand(Commands::SetLabel, controlId, label);
+}
+
+OUString SAL_CALL KDE5FilePicker2::getLabel(sal_Int16 controlId)
+{
+ auto id = m_ipc.sendCommand(Commands::GetLabel, controlId);
+ OUString label;
+ m_ipc.readResponse(id, label);
+ return label;
+}
+
+void KDE5FilePicker2::addCustomControl(sal_Int16 controlId)
+{
+ const char* resId = nullptr;
+
+ switch (controlId)
+ {
+ case CHECKBOX_AUTOEXTENSION:
+ resId = STR_FPICKER_AUTO_EXTENSION;
+ break;
+ case CHECKBOX_PASSWORD:
+ resId = STR_FPICKER_PASSWORD;
+ break;
+ case CHECKBOX_FILTEROPTIONS:
+ resId = STR_FPICKER_FILTER_OPTIONS;
+ break;
+ case CHECKBOX_READONLY:
+ resId = STR_FPICKER_READONLY;
+ break;
+ case CHECKBOX_LINK:
+ resId = STR_FPICKER_INSERT_AS_LINK;
+ break;
+ case CHECKBOX_PREVIEW:
+ resId = STR_FPICKER_SHOW_PREVIEW;
+ break;
+ case CHECKBOX_SELECTION:
+ resId = STR_FPICKER_SELECTION;
+ break;
+ case CHECKBOX_GPGENCRYPTION:
+ resId = STR_FPICKER_GPGENCRYPT;
+ break;
+ case PUSHBUTTON_PLAY:
+ resId = STR_FPICKER_PLAY;
+ break;
+ case LISTBOX_VERSION:
+ resId = STR_FPICKER_VERSION;
+ break;
+ case LISTBOX_TEMPLATE:
+ resId = STR_FPICKER_TEMPLATES;
+ break;
+ case LISTBOX_IMAGE_TEMPLATE:
+ resId = STR_FPICKER_IMAGE_TEMPLATE;
+ break;
+ case LISTBOX_IMAGE_ANCHOR:
+ resId = STR_FPICKER_IMAGE_ANCHOR;
+ break;
+ case LISTBOX_VERSION_LABEL:
+ case LISTBOX_TEMPLATE_LABEL:
+ case LISTBOX_IMAGE_TEMPLATE_LABEL:
+ case LISTBOX_IMAGE_ANCHOR_LABEL:
+ case LISTBOX_FILTER_SELECTOR:
+ break;
+ }
+
+ switch (controlId)
+ {
+ case CHECKBOX_AUTOEXTENSION:
+ case CHECKBOX_PASSWORD:
+ case CHECKBOX_FILTEROPTIONS:
+ case CHECKBOX_READONLY:
+ case CHECKBOX_LINK:
+ case CHECKBOX_PREVIEW:
+ case CHECKBOX_SELECTION:
+ case CHECKBOX_GPGENCRYPTION:
+ {
+ // the checkbox is created even for CHECKBOX_AUTOEXTENSION to simplify
+ // code, but the checkbox is hidden and ignored
+ bool hidden = controlId == CHECKBOX_AUTOEXTENSION;
+
+ m_ipc.sendCommand(Commands::AddCheckBox, controlId, hidden, getResString(resId));
+
+ break;
+ }
+ case PUSHBUTTON_PLAY:
+ case LISTBOX_VERSION:
+ case LISTBOX_TEMPLATE:
+ case LISTBOX_IMAGE_TEMPLATE:
+ case LISTBOX_IMAGE_ANCHOR:
+ case LISTBOX_VERSION_LABEL:
+ case LISTBOX_TEMPLATE_LABEL:
+ case LISTBOX_IMAGE_TEMPLATE_LABEL:
+ case LISTBOX_IMAGE_ANCHOR_LABEL:
+ case LISTBOX_FILTER_SELECTOR:
+ break;
+ }
+}
+
+void SAL_CALL KDE5FilePicker2::initialize(const uno::Sequence<uno::Any>& args)
+{
+ // parameter checking
+ uno::Any arg;
+ if (args.getLength() == 0)
+ {
+ throw lang::IllegalArgumentException("no arguments", static_cast<XFilePicker2*>(this), 1);
+ }
+
+ arg = args[0];
+
+ if ((arg.getValueType() != cppu::UnoType<sal_Int16>::get())
+ && (arg.getValueType() != cppu::UnoType<sal_Int8>::get()))
+ {
+ throw lang::IllegalArgumentException("invalid argument type",
+ static_cast<XFilePicker2*>(this), 1);
+ }
+
+ sal_Int16 templateId = -1;
+ arg >>= templateId;
+
+ bool saveDialog = false;
+ switch (templateId)
+ {
+ case FILEOPEN_SIMPLE:
+ break;
+
+ case FILESAVE_SIMPLE:
+ saveDialog = true;
+ break;
+
+ case FILESAVE_AUTOEXTENSION:
+ saveDialog = true;
+ addCustomControl(CHECKBOX_AUTOEXTENSION);
+ break;
+
+ case FILESAVE_AUTOEXTENSION_PASSWORD:
+ {
+ saveDialog = true;
+ addCustomControl(CHECKBOX_PASSWORD);
+ addCustomControl(CHECKBOX_GPGENCRYPTION);
+ break;
+ }
+ case FILESAVE_AUTOEXTENSION_PASSWORD_FILTEROPTIONS:
+ {
+ saveDialog = true;
+ addCustomControl(CHECKBOX_AUTOEXTENSION);
+ addCustomControl(CHECKBOX_PASSWORD);
+ addCustomControl(CHECKBOX_GPGENCRYPTION);
+ addCustomControl(CHECKBOX_FILTEROPTIONS);
+ break;
+ }
+ case FILESAVE_AUTOEXTENSION_SELECTION:
+ saveDialog = true;
+ addCustomControl(CHECKBOX_AUTOEXTENSION);
+ addCustomControl(CHECKBOX_SELECTION);
+ break;
+
+ case FILESAVE_AUTOEXTENSION_TEMPLATE:
+ saveDialog = true;
+ addCustomControl(CHECKBOX_AUTOEXTENSION);
+ addCustomControl(LISTBOX_TEMPLATE);
+ break;
+
+ case FILEOPEN_LINK_PREVIEW_IMAGE_TEMPLATE:
+ addCustomControl(CHECKBOX_LINK);
+ addCustomControl(CHECKBOX_PREVIEW);
+ addCustomControl(LISTBOX_IMAGE_TEMPLATE);
+ break;
+
+ case FILEOPEN_LINK_PREVIEW_IMAGE_ANCHOR:
+ addCustomControl(CHECKBOX_LINK);
+ addCustomControl(CHECKBOX_PREVIEW);
+ addCustomControl(LISTBOX_IMAGE_ANCHOR);
+ break;
+
+ case FILEOPEN_PLAY:
+ addCustomControl(PUSHBUTTON_PLAY);
+ break;
+
+ case FILEOPEN_LINK_PLAY:
+ addCustomControl(CHECKBOX_LINK);
+ addCustomControl(PUSHBUTTON_PLAY);
+ break;
+
+ case FILEOPEN_READONLY_VERSION:
+ addCustomControl(CHECKBOX_READONLY);
+ addCustomControl(LISTBOX_VERSION);
+ break;
+
+ case FILEOPEN_LINK_PREVIEW:
+ addCustomControl(CHECKBOX_LINK);
+ addCustomControl(CHECKBOX_PREVIEW);
+ break;
+
+ case FILEOPEN_PREVIEW:
+ addCustomControl(CHECKBOX_PREVIEW);
+ break;
+
+ default:
+ OSL_TRACE("Unknown templates %d", templateId);
+ return;
+ }
+
+ setTitle(getResString(saveDialog ? STR_FPICKER_SAVE : STR_FPICKER_OPEN));
+
+ m_ipc.sendCommand(Commands::Initialize, saveDialog);
+}
+
+void SAL_CALL KDE5FilePicker2::cancel()
+{
+ // TODO
+}
+
+void KDE5FilePicker2::disposing(const lang::EventObject& rEvent)
+{
+ uno::Reference<XFilePickerListener> xFilePickerListener(rEvent.Source, uno::UNO_QUERY);
+
+ if (xFilePickerListener.is())
+ {
+ removeFilePickerListener(xFilePickerListener);
+ }
+}
+
+OUString SAL_CALL KDE5FilePicker2::getImplementationName()
+{
+ return OUString(FILE_PICKER_IMPL_NAME);
+}
+
+sal_Bool SAL_CALL KDE5FilePicker2::supportsService(const OUString& ServiceName)
+{
+ return cppu::supportsService(this, ServiceName);
+}
+
+uno::Sequence<OUString> SAL_CALL KDE5FilePicker2::getSupportedServiceNames()
+{
+ return FilePicker_getSupportedServiceNames();
+}
+
+void KDE5FilePicker2::filterChanged()
+{
+ FilePickerEvent aEvent;
+ aEvent.ElementId = LISTBOX_FILTER;
+ OSL_TRACE("filter changed");
+ if (m_xListener.is())
+ m_xListener->controlStateChanged(aEvent);
+}
+
+void KDE5FilePicker2::selectionChanged()
+{
+ FilePickerEvent aEvent;
+ OSL_TRACE("file selection changed");
+ if (m_xListener.is())
+ m_xListener->fileSelectionChanged(aEvent);
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde5/KDE5FilePicker2.hxx b/vcl/unx/kde5/KDE5FilePicker2.hxx
new file mode 100644
index 000000000000..ca98191def89
--- /dev/null
+++ b/vcl/unx/kde5/KDE5FilePicker2.hxx
@@ -0,0 +1,136 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <cppuhelper/compbase.hxx>
+
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/ui/dialogs/XFilePicker3.hpp>
+#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+
+#include <osl/conditn.hxx>
+#include <osl/mutex.hxx>
+
+#include <rtl/ustrbuf.hxx>
+
+#include "gtk3_kde5_filepicker_ipc.hxx"
+
+#include <functional>
+
+typedef ::cppu::WeakComponentImplHelper<css::ui::dialogs::XFilePicker3,
+ css::ui::dialogs::XFilePickerControlAccess
+ // TODO css::ui::dialogs::XFilePreview
+ ,
+ css::lang::XInitialization, css::lang::XServiceInfo>
+ KDE5FilePicker2_Base;
+
+class KDE5FilePicker2 : public KDE5FilePicker2_Base
+{
+protected:
+ css::uno::Reference<css::ui::dialogs::XFilePickerListener> m_xListener;
+
+ osl::Mutex _helperMutex;
+ KDE5FilePicker2Ipc m_ipc;
+
+public:
+ explicit KDE5FilePicker2(const css::uno::Reference<css::uno::XComponentContext>&);
+ virtual ~KDE5FilePicker2() override;
+
+ // XFilePickerNotifier
+ virtual void SAL_CALL addFilePickerListener(
+ const css::uno::Reference<css::ui::dialogs::XFilePickerListener>& xListener) override;
+ virtual void SAL_CALL removeFilePickerListener(
+ const css::uno::Reference<css::ui::dialogs::XFilePickerListener>& xListener) override;
+
+ // XExecutableDialog functions
+ virtual void SAL_CALL setTitle(const OUString& rTitle) override;
+ virtual sal_Int16 SAL_CALL execute() override;
+
+ // XFilePicker functions
+ virtual void SAL_CALL setMultiSelectionMode(sal_Bool bMode) override;
+ virtual void SAL_CALL setDefaultName(const OUString& rName) override;
+ virtual void SAL_CALL setDisplayDirectory(const OUString& rDirectory) override;
+ virtual OUString SAL_CALL getDisplayDirectory() override;
+ virtual css::uno::Sequence<OUString> SAL_CALL getFiles() override;
+
+ // XFilterManager functions
+ virtual void SAL_CALL appendFilter(const OUString& rTitle, const OUString& rFilter) override;
+ virtual void SAL_CALL setCurrentFilter(const OUString& rTitle) override;
+ virtual OUString SAL_CALL getCurrentFilter() override;
+
+ // XFilterGroupManager functions
+ virtual void SAL_CALL
+ appendFilterGroup(const OUString& rGroupTitle,
+ const css::uno::Sequence<css::beans::StringPair>& rFilters) override;
+
+ // XFilePickerControlAccess functions
+ virtual void SAL_CALL setValue(sal_Int16 nControlId, sal_Int16 nControlAction,
+ const css::uno::Any& rValue) override;
+ virtual css::uno::Any SAL_CALL getValue(sal_Int16 nControlId,
+ sal_Int16 nControlAction) override;
+ virtual void SAL_CALL enableControl(sal_Int16 nControlId, sal_Bool bEnable) override;
+ virtual void SAL_CALL setLabel(sal_Int16 nControlId, const OUString& rLabel) override;
+ virtual OUString SAL_CALL getLabel(sal_Int16 nControlId) override;
+
+ /* TODO XFilePreview
+
+ virtual css::uno::Sequence< sal_Int16 > SAL_CALL getSupportedImageFormats( );
+ virtual sal_Int32 SAL_CALL getTargetColorDepth( );
+ virtual sal_Int32 SAL_CALL getAvailableWidth( );
+ virtual sal_Int32 SAL_CALL getAvailableHeight( );
+ virtual void SAL_CALL setImage( sal_Int16 aImageFormat, const css::uno::Any &rImage );
+ virtual sal_Bool SAL_CALL setShowState( sal_Bool bShowState );
+ virtual sal_Bool SAL_CALL getShowState( );
+ */
+
+ // XFilePicker2 functions
+ virtual css::uno::Sequence<OUString> SAL_CALL getSelectedFiles() override;
+
+ // XInitialization
+ virtual void SAL_CALL initialize(const css::uno::Sequence<css::uno::Any>& rArguments) override;
+
+ // XCancellable
+ virtual void SAL_CALL cancel() override;
+
+ // XEventListener
+ virtual void disposing(const css::lang::EventObject& rEvent);
+ using cppu::WeakComponentImplHelperBase::disposing;
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() override;
+ virtual sal_Bool SAL_CALL supportsService(const OUString& rServiceName) override;
+ virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
+
+private:
+ KDE5FilePicker2(const KDE5FilePicker2&) = delete;
+ KDE5FilePicker2& operator=(const KDE5FilePicker2&) = delete;
+
+ //add a custom control widget to the file dialog
+ void addCustomControl(sal_Int16 controlId);
+
+ // emit XFilePickerListener controlStateChanged event
+ void filterChanged();
+ // emit XFilePickerListener fileSelectionChanged event
+ void selectionChanged();
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 5924ea65b73ca956d67423cd5e50f23909d297b8
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Jun 1 16:43:43 2018 +0200
Remove unused Qt5MenuItem::mpVCLMenu
Change-Id: Ia7f28a54f253f0263cc781feb5997bb51bb640b2
Reviewed-on: https://gerrit.libreoffice.org/55193
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/vcl/inc/qt5/Qt5Menu.hxx b/vcl/inc/qt5/Qt5Menu.hxx
index 21f33eaece84..4b4081e09545 100644
--- a/vcl/inc/qt5/Qt5Menu.hxx
+++ b/vcl/inc/qt5/Qt5Menu.hxx
@@ -72,7 +72,6 @@ public:
sal_uInt16 mnId; // Item ID
MenuItemType mnType; // Item type
bool mbVisible; // Item visibility.
- Menu* mpVCLMenu;
Qt5Menu* mpParentMenu; // The menu into which this menu item is inserted
Qt5Menu* mpSubMenu; // Submenu of this item (if defined)
};
diff --git a/vcl/qt5/Qt5Menu.cxx b/vcl/qt5/Qt5Menu.cxx
index d4f0763d00f2..5b915775f338 100644
--- a/vcl/qt5/Qt5Menu.cxx
+++ b/vcl/qt5/Qt5Menu.cxx
@@ -193,7 +193,6 @@ void Qt5Menu::NativeItemText(OUString& rItemText) { rItemText = rItemText.replac
Qt5MenuItem::Qt5MenuItem(const SalItemParams* pItemData)
: mnId(pItemData->nId)
, mnType(pItemData->eType)
- , mpVCLMenu(pItemData->pMenu)
, mpParentMenu(nullptr)
, mpSubMenu(nullptr)
{
commit f25dcb4a8dc1a18b0aa57b45e3b3d6b1176829f7
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Jun 1 17:47:39 2018 +0200
Fix various Clang and loplugin warnings in --enable-kde5
Change-Id: Ia79f97ca589720dbdfd14ea03560713fd2d22db9
Reviewed-on: https://gerrit.libreoffice.org/55195
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/vcl/unx/kde5/KDE5SalData.hxx b/vcl/unx/kde5/KDE5SalData.hxx
index 32b24da1f4ea..500aab2da24f 100644
--- a/vcl/unx/kde5/KDE5SalData.hxx
+++ b/vcl/unx/kde5/KDE5SalData.hxx
@@ -25,7 +25,7 @@ class KDE5SalData : public Qt5Data
{
public:
KDE5SalData(SalInstance* pInstance);
- virtual ~KDE5SalData();
+ virtual ~KDE5SalData() override;
static void initNWF();
};
diff --git a/vcl/unx/kde5/KDE5SalDisplay.cxx b/vcl/unx/kde5/KDE5SalDisplay.cxx
index e6cec3677ba3..fa5e40f56ff9 100644
--- a/vcl/unx/kde5/KDE5SalDisplay.cxx
+++ b/vcl/unx/kde5/KDE5SalDisplay.cxx
@@ -55,8 +55,7 @@ void SalKDE5Display::Yield()
if (XEventsQueued(pDisp_, QueuedAfterReading) == 0)
return;
- DBG_ASSERT(GetSalData()->m_pInstance->GetYieldMutex()->IsCurrentThread()
- == osl::Thread::getCurrentIdentifier(),
+ DBG_ASSERT(GetSalData()->m_pInstance->GetYieldMutex()->IsCurrentThread(),
"will crash soon since solar mutex not locked in SalKDE5Display::Yield");
/*XEvent event;
diff --git a/vcl/unx/kde5/KDE5SalFrame.cxx b/vcl/unx/kde5/KDE5SalFrame.cxx
index 8caa9b9f30ec..d282a083959a 100644
--- a/vcl/unx/kde5/KDE5SalFrame.cxx
+++ b/vcl/unx/kde5/KDE5SalFrame.cxx
@@ -39,7 +39,7 @@
#include <vcl/font.hxx>
#include <vcl/settings.hxx>
-#include "unx/fontmanager.hxx"
+#include <unx/fontmanager.hxx>
#include <svdata.hxx>
diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx
index 1ef53d0e35ae..6ec1e6e385ea 100644
--- a/vcl/unx/kde5/KDE5SalGraphics.cxx
+++ b/vcl/unx/kde5/KDE5SalGraphics.cxx
@@ -519,17 +519,17 @@ bool KDE5SalGraphics::drawNativeControl(ControlType type, ControlPart part,
if (value.getType() == ControlType::SpinButtons)
{
const SpinbuttonValue* pSpinVal = static_cast<const SpinbuttonValue*>(&value);
- if ((pSpinVal->mnUpperState & ControlState::PRESSED))
+ if (pSpinVal->mnUpperState & ControlState::PRESSED)
option.activeSubControls |= QStyle::SC_SpinBoxUp;
- if ((pSpinVal->mnLowerState & ControlState::PRESSED))
+ if (pSpinVal->mnLowerState & ControlState::PRESSED)
option.activeSubControls |= QStyle::SC_SpinBoxDown;
- if ((pSpinVal->mnUpperState & ControlState::ENABLED))
+ if (pSpinVal->mnUpperState & ControlState::ENABLED)
option.stepEnabled |= QAbstractSpinBox::StepUpEnabled;
- if ((pSpinVal->mnLowerState & ControlState::ENABLED))
+ if (pSpinVal->mnLowerState & ControlState::ENABLED)
option.stepEnabled |= QAbstractSpinBox::StepDownEnabled;
- if ((pSpinVal->mnUpperState & ControlState::ROLLOVER))
+ if (pSpinVal->mnUpperState & ControlState::ROLLOVER)
option.state = QStyle::State_MouseOver;
- if ((pSpinVal->mnLowerState & ControlState::ROLLOVER))
+ if (pSpinVal->mnLowerState & ControlState::ROLLOVER)
option.state = QStyle::State_MouseOver;
}
@@ -601,7 +601,9 @@ bool KDE5SalGraphics::drawNativeControl(ControlType type, ControlPart part,
}
else if (type == ControlType::Progress && part == ControlPart::Entire)
{
+ SAL_WNODEPRECATED_DECLARATIONS_PUSH
QStyleOptionProgressBarV2 option;
+ SAL_WNODEPRECATED_DECLARATIONS_POP
option.minimum = 0;
option.maximum = widgetRect.width();
option.progress = value.getNumericVal();
diff --git a/vcl/unx/kde5/KDE5SalInstance.hxx b/vcl/unx/kde5/KDE5SalInstance.hxx
index 9afe49c15c86..cc7d7ad7cbce 100644
--- a/vcl/unx/kde5/KDE5SalInstance.hxx
+++ b/vcl/unx/kde5/KDE5SalInstance.hxx
@@ -29,7 +29,7 @@ class KDE5SalInstance : public Qt5Instance
{
public:
explicit KDE5SalInstance(SalYieldMutex* pMutex);
- virtual SalFrame* CreateFrame(SalFrame* pParent, SalFrameStyleFlags nStyle);
+ virtual SalFrame* CreateFrame(SalFrame* pParent, SalFrameStyleFlags nStyle) override;
virtual bool hasNativeFileSelection() const override { return true; }
diff --git a/vcl/unx/kde5/VCLKDE5Application.hxx b/vcl/unx/kde5/VCLKDE5Application.hxx
index 6c6fb42dcd9f..5503db32c901 100644
--- a/vcl/unx/kde5/VCLKDE5Application.hxx
+++ b/vcl/unx/kde5/VCLKDE5Application.hxx
@@ -17,8 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef _VCLKDE5APPLICATION_HXX_
-#define _VCLKDE5APPLICATION_HXX_
+#ifndef INCLUDED_VCL_UNX_KDE5_VCLKDE5APPLICATION_HXX
+#define INCLUDED_VCL_UNX_KDE5_VCLKDE5APPLICATION_HXX
#pragma once
commit b1e5056435f4ab06b1f3ae782085546fbc805764
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Jun 1 15:28:26 2018 +0200
Various trivial loplugin fixes in --enable-qt5
Change-Id: I9539eb77f663e1174919ae801495801f81571710
diff --git a/vcl/inc/qt5/Qt5FilePicker.hxx b/vcl/inc/qt5/Qt5FilePicker.hxx
index 9133c4353295..e1cb95344987 100644
--- a/vcl/inc/qt5/Qt5FilePicker.hxx
+++ b/vcl/inc/qt5/Qt5FilePicker.hxx
@@ -119,7 +119,7 @@ public:
// XEventListener
/// @throws css::uno::RuntimeException
- virtual void SAL_CALL disposing(const css::lang::EventObject& rEvent);
+ virtual void disposing(const css::lang::EventObject& rEvent);
using cppu::WeakComponentImplHelperBase::disposing;
// XServiceInfo
diff --git a/vcl/qt5/Qt5Bitmap.cxx b/vcl/qt5/Qt5Bitmap.cxx
index 7ec43af5179b..ff44143a16f2 100644
--- a/vcl/qt5/Qt5Bitmap.cxx
+++ b/vcl/qt5/Qt5Bitmap.cxx
@@ -17,9 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "Qt5Bitmap.hxx"
-#include "Qt5Tools.hxx"
-#include "Qt5Graphics.hxx"
+#include <Qt5Bitmap.hxx>
+#include <Qt5Tools.hxx>
+#include <Qt5Graphics.hxx>
#include <QtGui/QImage>
#include <QtCore/QVector>
diff --git a/vcl/qt5/Qt5Data.cxx b/vcl/qt5/Qt5Data.cxx
index e2eabefe6871..350db44c3c16 100644
--- a/vcl/qt5/Qt5Data.cxx
+++ b/vcl/qt5/Qt5Data.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "Qt5Data.hxx"
+#include <Qt5Data.hxx>
#include <QtGui/QCursor>
#include <QtGui/QBitmap>
diff --git a/vcl/qt5/Qt5FilePicker.cxx b/vcl/qt5/Qt5FilePicker.cxx
index 7bc561a7d594..1ffa1b993756 100644
--- a/vcl/qt5/Qt5FilePicker.cxx
+++ b/vcl/qt5/Qt5FilePicker.cxx
@@ -17,12 +17,12 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "Qt5FilePicker.hxx"
+#include <Qt5FilePicker.hxx>
#include <Qt5FilePicker.moc>
-#include "Qt5Frame.hxx"
-#include "Qt5Tools.hxx"
-#include "Qt5Widget.hxx"
+#include <Qt5Frame.hxx>
+#include <Qt5Tools.hxx>
+#include <Qt5Widget.hxx>
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
@@ -65,7 +65,7 @@ using namespace ::com::sun::star::uno;
namespace
{
-uno::Sequence<OUString> SAL_CALL FilePicker_getSupportedServiceNames()
+uno::Sequence<OUString> FilePicker_getSupportedServiceNames()
{
uno::Sequence<OUString> aRet(3);
aRet[0] = "com.sun.star.ui.dialogs.FilePicker";
@@ -750,7 +750,7 @@ void SAL_CALL Qt5FilePicker::initialize(const uno::Sequence<uno::Any>& args)
void SAL_CALL Qt5FilePicker::cancel() {}
-void SAL_CALL Qt5FilePicker::disposing(const lang::EventObject& rEvent)
+void Qt5FilePicker::disposing(const lang::EventObject& rEvent)
{
uno::Reference<XFilePickerListener> xFilePickerListener(rEvent.Source, uno::UNO_QUERY);
diff --git a/vcl/qt5/Qt5Font.hxx b/vcl/qt5/Qt5Font.hxx
index fd496348c9b6..4e37f7d28bdd 100644
--- a/vcl/qt5/Qt5Font.hxx
+++ b/vcl/qt5/Qt5Font.hxx
@@ -23,7 +23,7 @@
#include <QtGui/QFont>
-#include "Qt5FontFace.hxx"
+#include <Qt5FontFace.hxx>
class Qt5Font final : public QFont, public LogicalFontInstance
{
diff --git a/vcl/qt5/Qt5FontFace.cxx b/vcl/qt5/Qt5FontFace.cxx
index b7a0f0b12f9e..ade0f1c95c72 100644
--- a/vcl/qt5/Qt5FontFace.cxx
+++ b/vcl/qt5/Qt5FontFace.cxx
@@ -17,9 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "Qt5FontFace.hxx"
+#include <Qt5FontFace.hxx>
#include "Qt5Font.hxx"
-#include "Qt5Tools.hxx"
+#include <Qt5Tools.hxx>
#include <sft.hxx>
#include <impfontcharmap.hxx>
diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx
index e86e10d15f43..9c5b8edbc5be 100644
--- a/vcl/qt5/Qt5Frame.cxx
+++ b/vcl/qt5/Qt5Frame.cxx
@@ -17,13 +17,13 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "Qt5Frame.hxx"
+#include <Qt5Frame.hxx>
-#include "Qt5Tools.hxx"
-#include "Qt5Instance.hxx"
-#include "Qt5Graphics.hxx"
-#include "Qt5Widget.hxx"
-#include "Qt5Data.hxx"
+#include <Qt5Tools.hxx>
+#include <Qt5Instance.hxx>
+#include <Qt5Graphics.hxx>
+#include <Qt5Widget.hxx>
+#include <Qt5Data.hxx>
#include <Qt5Menu.hxx>
#include <QtCore/QPoint>
diff --git a/vcl/qt5/Qt5Graphics.cxx b/vcl/qt5/Qt5Graphics.cxx
index 8bf37adddff8..c7ca69a8a606 100644
--- a/vcl/qt5/Qt5Graphics.cxx
+++ b/vcl/qt5/Qt5Graphics.cxx
@@ -17,11 +17,11 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "Qt5Graphics.hxx"
+#include <Qt5Graphics.hxx>
#include "Qt5Font.hxx"
-#include "Qt5Frame.hxx"
-#include "Qt5Painter.hxx"
+#include <Qt5Frame.hxx>
+#include <Qt5Painter.hxx>
#include <QtGui/QImage>
#include <QtGui/QPainter>
diff --git a/vcl/qt5/Qt5Graphics_Controls.cxx b/vcl/qt5/Qt5Graphics_Controls.cxx
index ca064ece5e13..11a1decc58aa 100644
--- a/vcl/qt5/Qt5Graphics_Controls.cxx
+++ b/vcl/qt5/Qt5Graphics_Controls.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "Qt5Graphics.hxx"
+#include <Qt5Graphics.hxx>
bool Qt5Graphics::IsNativeControlSupported(ControlType /*nType*/, ControlPart /*nPart*/)
{
diff --git a/vcl/qt5/Qt5Graphics_GDI.cxx b/vcl/qt5/Qt5Graphics_GDI.cxx
index 61b92b109bfe..43e54b8b1385 100644
--- a/vcl/qt5/Qt5Graphics_GDI.cxx
+++ b/vcl/qt5/Qt5Graphics_GDI.cxx
@@ -17,10 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "Qt5Graphics.hxx"
+#include <Qt5Graphics.hxx>
-#include "Qt5Bitmap.hxx"
-#include "Qt5Painter.hxx"
+#include <Qt5Bitmap.hxx>
+#include <Qt5Painter.hxx>
#include <QtGui/QPainter>
#include <QtGui/QScreen>
diff --git a/vcl/qt5/Qt5Graphics_Text.cxx b/vcl/qt5/Qt5Graphics_Text.cxx
index e5fc79e0445b..cf244d3f4d78 100644
--- a/vcl/qt5/Qt5Graphics_Text.cxx
+++ b/vcl/qt5/Qt5Graphics_Text.cxx
@@ -17,10 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "Qt5Graphics.hxx"
-#include "Qt5FontFace.hxx"
+#include <Qt5Graphics.hxx>
+#include <Qt5FontFace.hxx>
#include "Qt5Font.hxx"
-#include "Qt5Painter.hxx"
+#include <Qt5Painter.hxx>
#include <vcl/fontcharmap.hxx>
diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx
index 6cc083f8f865..7551a1f0721c 100644
--- a/vcl/qt5/Qt5Instance.cxx
+++ b/vcl/qt5/Qt5Instance.cxx
@@ -17,17 +17,17 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "Qt5Instance.hxx"
+#include <Qt5Instance.hxx>
#include <Qt5Instance.moc>
-#include "Qt5Bitmap.hxx"
-#include "Qt5Data.hxx"
-#include "Qt5FilePicker.hxx"
-#include "Qt5Frame.hxx"
-#include "Qt5Menu.hxx"
-#include "Qt5Object.hxx"
-#include "Qt5Timer.hxx"
-#include "Qt5VirtualDevice.hxx"
+#include <Qt5Bitmap.hxx>
+#include <Qt5Data.hxx>
+#include <Qt5FilePicker.hxx>
+#include <Qt5Frame.hxx>
+#include <Qt5Menu.hxx>
+#include <Qt5Object.hxx>
+#include <Qt5Timer.hxx>
+#include <Qt5VirtualDevice.hxx>
#include <headless/svpvd.hxx>
diff --git a/vcl/qt5/Qt5Instance_Print.cxx b/vcl/qt5/Qt5Instance_Print.cxx
index 802f2591ccfe..a0bfed1d2f9f 100644
--- a/vcl/qt5/Qt5Instance_Print.cxx
+++ b/vcl/qt5/Qt5Instance_Print.cxx
@@ -17,8 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "Qt5Instance.hxx"
-#include "Qt5Printer.hxx"
+#include <Qt5Instance.hxx>
+#include <Qt5Printer.hxx>
#include <vcl/svapp.hxx>
#include <vcl/timer.hxx>
diff --git a/vcl/qt5/Qt5Menu.cxx b/vcl/qt5/Qt5Menu.cxx
index ce95da1a94d7..d4f0763d00f2 100644
--- a/vcl/qt5/Qt5Menu.cxx
+++ b/vcl/qt5/Qt5Menu.cxx
@@ -7,8 +7,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#include "Qt5Frame.hxx"
-#include "Qt5Menu.hxx"
+#include <Qt5Frame.hxx>
+#include <Qt5Menu.hxx>
#include <Qt5Menu.moc>
#include <QtWidgets/QtWidgets>
@@ -46,7 +46,7 @@ void Qt5Menu::RemoveItem(unsigned nPos)
maItems.erase(maItems.begin() + nPos);
}
-void Qt5Menu::SetSubMenu(SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned nPos)
+void Qt5Menu::SetSubMenu(SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned)
{
SolarMutexGuard aGuard;
Qt5MenuItem* pItem = static_cast<Qt5MenuItem*>(pSalMenuItem);
@@ -146,22 +146,19 @@ void Qt5Menu::DoFullMenuUpdate(Menu* pMenuBar, QMenu* pParentMenu)
}
}
-void Qt5Menu::ShowItem(unsigned nPos, bool bCheck) {}
+void Qt5Menu::ShowItem(unsigned, bool) {}
-void Qt5Menu::CheckItem(unsigned nPos, bool bCheck) {}
+void Qt5Menu::CheckItem(unsigned, bool) {}
-void Qt5Menu::EnableItem(unsigned nPos, bool bEnable) {}
+void Qt5Menu::EnableItem(unsigned, bool) {}
-void Qt5Menu::SetItemText(unsigned nPos, SalMenuItem* pSalMenuItem, const rtl::OUString& rText) {}
+void Qt5Menu::SetItemText(unsigned, SalMenuItem*, const rtl::OUString&) {}
-void Qt5Menu::SetItemImage(unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage) {}
+void Qt5Menu::SetItemImage(unsigned, SalMenuItem*, const Image&) {}
-void Qt5Menu::SetAccelerator(unsigned nPos, SalMenuItem* pSalMenuItem, const vcl::KeyCode& rKeyCode,
- const OUString& rKeyName)
-{
-}
+void Qt5Menu::SetAccelerator(unsigned, SalMenuItem*, const vcl::KeyCode&, const OUString&) {}
-void Qt5Menu::GetSystemMenuData(SystemMenuData* pData) {}
+void Qt5Menu::GetSystemMenuData(SystemMenuData*) {}
Qt5Menu* Qt5Menu::GetTopLevel()
{
diff --git a/vcl/qt5/Qt5Object.cxx b/vcl/qt5/Qt5Object.cxx
index d00f3fc14719..eb31301ccf5e 100644
--- a/vcl/qt5/Qt5Object.cxx
+++ b/vcl/qt5/Qt5Object.cxx
@@ -17,9 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "Qt5Object.hxx"
+#include <Qt5Object.hxx>
-#include "Qt5Frame.hxx"
+#include <Qt5Frame.hxx>
#include <QtWidgets/QWidget>
diff --git a/vcl/qt5/Qt5Painter.cxx b/vcl/qt5/Qt5Painter.cxx
index 88e9b10b1885..7fa5c40f7e87 100644
--- a/vcl/qt5/Qt5Painter.cxx
+++ b/vcl/qt5/Qt5Painter.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "Qt5Painter.hxx"
+#include <Qt5Painter.hxx>
#include <QtGui/QColor>
diff --git a/vcl/qt5/Qt5Printer.cxx b/vcl/qt5/Qt5Printer.cxx
index 34fce3da5984..a62cb925c592 100644
--- a/vcl/qt5/Qt5Printer.cxx
+++ b/vcl/qt5/Qt5Printer.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "Qt5Printer.hxx"
+#include <Qt5Printer.hxx>
bool Qt5InfoPrinter::Setup(weld::Window*, ImplJobSetup*) { return false; }
diff --git a/vcl/qt5/Qt5Timer.cxx b/vcl/qt5/Qt5Timer.cxx
index a43a876fdb8d..2fa07886f60f 100644
--- a/vcl/qt5/Qt5Timer.cxx
+++ b/vcl/qt5/Qt5Timer.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "Qt5Timer.hxx"
+#include <Qt5Timer.hxx>
#include <Qt5Timer.moc>
#include <QtWidgets/QApplication>
diff --git a/vcl/qt5/Qt5Tools.cxx b/vcl/qt5/Qt5Tools.cxx
index dc809675e790..54ac3f99e26f 100644
--- a/vcl/qt5/Qt5Tools.cxx
+++ b/vcl/qt5/Qt5Tools.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "Qt5Tools.hxx"
+#include <Qt5Tools.hxx>
#include <cairo.h>
diff --git a/vcl/qt5/Qt5VirtualDevice.cxx b/vcl/qt5/Qt5VirtualDevice.cxx
index fc0c66232853..c1ab6a0b5cdb 100644
--- a/vcl/qt5/Qt5VirtualDevice.cxx
+++ b/vcl/qt5/Qt5VirtualDevice.cxx
@@ -17,10 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "Qt5VirtualDevice.hxx"
+#include <Qt5VirtualDevice.hxx>
-#include "Qt5Graphics.hxx"
-#include "Qt5Tools.hxx"
+#include <Qt5Graphics.hxx>
+#include <Qt5Tools.hxx>
#include <QtGui/QImage>
diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx
index 7dc2e17d6e79..8c62280d3f99 100644
--- a/vcl/qt5/Qt5Widget.cxx
+++ b/vcl/qt5/Qt5Widget.cxx
@@ -17,12 +17,12 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "Qt5Widget.hxx"
+#include <Qt5Widget.hxx>
#include <Qt5Widget.moc>
-#include "Qt5Frame.hxx"
-#include "Qt5Graphics.hxx"
-#include "Qt5Tools.hxx"
+#include <Qt5Frame.hxx>
+#include <Qt5Graphics.hxx>
+#include <Qt5Tools.hxx>
#include <QtGui/QFocusEvent>
#include <QtGui/QImage>
commit 8815acd18f8995cbbf45c2a70629379cb9bfbf15
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Thu May 31 12:14:55 2018 +0200
Make clang-format happy, remove vcl/unx/kde5 from blacklist
just between us girls, I hate you clang-format
Change-Id: I4cd041eff7a9fa01eb9192cf357e3f07a26fa6ad
diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist
index 7dcd63136243..79c639c82cb9 100644
--- a/solenv/clang-format/blacklist
+++ b/solenv/clang-format/blacklist
@@ -18501,24 +18501,6 @@ vcl/unx/kde4/VCLKDEApplication.hxx
vcl/unx/kde4/main.cxx
vcl/unx/kde4/tst_exclude_posted_events.hxx
vcl/unx/kde4/tst_exclude_socket_notifiers.hxx
-vcl/unx/kde5/FPServiceInfo.hxx
-vcl/unx/kde5/KDE5Data.cxx
-vcl/unx/kde5/KDE5Data.hxx
-vcl/unx/kde5/KDE5SalDisplay.cxx
-vcl/unx/kde5/KDE5SalDisplay.hxx
-vcl/unx/kde5/KDE5SalFrame.cxx
-vcl/unx/kde5/KDE5SalFrame.hxx
-vcl/unx/kde5/KDE5SalGraphics.cxx
-vcl/unx/kde5/KDE5SalGraphics.hxx
-vcl/unx/kde5/KDE5SalInstance.cxx
-vcl/unx/kde5/KDE5SalInstance.hxx
-vcl/unx/kde5/KDE5XLib.cxx
-vcl/unx/kde5/KDE5XLib.hxx
-vcl/unx/kde5/VCLKDE5Application.cxx
-vcl/unx/kde5/VCLKDE5Application.hxx
-vcl/unx/kde5/main.cxx
-vcl/unx/kde5/tst_exclude_posted_events.hxx
-vcl/unx/kde5/tst_exclude_socket_notifiers.hxx
vcl/unx/x11/x11sys.cxx
vcl/unx/x11/xlimits.cxx
vcl/win/app/saldata.cxx
diff --git a/vcl/inc/qt5/Qt5FilePicker.hxx b/vcl/inc/qt5/Qt5FilePicker.hxx
index 1aa19b3459f4..9133c4353295 100644
--- a/vcl/inc/qt5/Qt5FilePicker.hxx
+++ b/vcl/inc/qt5/Qt5FilePicker.hxx
@@ -43,190 +43,218 @@ class QGridLayout;
class QLabel;
class QWidget;
-typedef ::cppu::WeakComponentImplHelper
- < css::ui::dialogs::XFilePicker3
- , css::ui::dialogs::XFilePickerControlAccess
- , css::ui::dialogs::XFolderPicker2
- , css::lang::XInitialization
- , css::lang::XServiceInfo
- > Qt5FilePicker_Base;
-
-class Qt5FilePicker
- : public QObject
- , public Qt5FilePicker_Base
+typedef ::cppu::WeakComponentImplHelper<
+ css::ui::dialogs::XFilePicker3, css::ui::dialogs::XFilePickerControlAccess,
+ css::ui::dialogs::XFolderPicker2, css::lang::XInitialization, css::lang::XServiceInfo>
+ Qt5FilePicker_Base;
+
+class Qt5FilePicker : public QObject, public Qt5FilePicker_Base
{
Q_OBJECT
protected:
- css::uno::Reference< css::ui::dialogs::XFilePickerListener > m_xListener;
+ css::uno::Reference<css::ui::dialogs::XFilePickerListener> m_xListener;
- QFileDialog* m_pFileDialog; ///< the non-extendable file picker dialog
+ QFileDialog* m_pFileDialog; ///< the non-extendable file picker dialog
- osl::Mutex m_aHelperMutex; ///< mutex used by the WeakComponentImplHelper
+ osl::Mutex m_aHelperMutex; ///< mutex used by the WeakComponentImplHelper
- QStringList m_aNamedFilterList; ///< named filter list for the QFileDialog
- QStringList m_aFilterTitleList; ///< the original filter titles
- QString m_aCurrentFilterTitle; ///< the current filter title
+ QStringList m_aNamedFilterList; ///< named filter list for the QFileDialog
+ QStringList m_aFilterTitleList; ///< the original filter titles
+ QString m_aCurrentFilterTitle; ///< the current filter title
- QDialog *m_pOptionsDialog; ///< an extra options dialog window
- QLabel *m_pFilenameLabel; ///< label to display the filename
- QLabel *m_pFilterLabel; ///< label to display the filter
- QHash<sal_Int16, QWidget*> m_aCustomWidgetsMap; ///< map of SAL control ID's to widget
+ QDialog* m_pOptionsDialog; ///< an extra options dialog window
+ QLabel* m_pFilenameLabel; ///< label to display the filename
+ QLabel* m_pFilterLabel; ///< label to display the filter
+ QHash<sal_Int16, QWidget*> m_aCustomWidgetsMap; ///< map of SAL control ID's to widget
public:
- explicit Qt5FilePicker( QFileDialog::FileMode );
+ explicit Qt5FilePicker(QFileDialog::FileMode);
virtual ~Qt5FilePicker() override;
// XFilePickerNotifier
- virtual void SAL_CALL addFilePickerListener( const css::uno::Reference< css::ui::dialogs::XFilePickerListener >& xListener ) override;
- virtual void SAL_CALL removeFilePickerListener( const css::uno::Reference< css::ui::dialogs::XFilePickerListener >& xListener ) override;
+ virtual void SAL_CALL addFilePickerListener(
+ const css::uno::Reference<css::ui::dialogs::XFilePickerListener>& xListener) override;
+ virtual void SAL_CALL removeFilePickerListener(
+ const css::uno::Reference<css::ui::dialogs::XFilePickerListener>& xListener) override;
// XFilterManager functions
- virtual void SAL_CALL appendFilter( const OUString &rTitle, const OUString &rFilter ) override;
- virtual void SAL_CALL setCurrentFilter( const OUString &rTitle ) override;
+ virtual void SAL_CALL appendFilter(const OUString& rTitle, const OUString& rFilter) override;
+ virtual void SAL_CALL setCurrentFilter(const OUString& rTitle) override;
virtual OUString SAL_CALL getCurrentFilter() override;
// XFilterGroupManager functions
- virtual void SAL_CALL appendFilterGroup( const OUString &rGroupTitle, const css::uno::Sequence< css::beans::StringPair > &rFilters ) override;
+ virtual void SAL_CALL
+ appendFilterGroup(const OUString& rGroupTitle,
+ const css::uno::Sequence<css::beans::StringPair>& rFilters) override;
// XCancellable
- virtual void SAL_CALL cancel( ) override;
+ virtual void SAL_CALL cancel() override;
// XExecutableDialog functions
- virtual void SAL_CALL setTitle( const OUString &rTitle ) override;
+ virtual void SAL_CALL setTitle(const OUString& rTitle) override;
virtual sal_Int16 SAL_CALL execute() override;
// XFilePicker functions
- virtual void SAL_CALL setMultiSelectionMode( sal_Bool bMode ) override;
- virtual void SAL_CALL setDefaultName( const OUString &rName ) override;
- virtual void SAL_CALL setDisplayDirectory( const OUString &rDirectory ) override;
+ virtual void SAL_CALL setMultiSelectionMode(sal_Bool bMode) override;
+ virtual void SAL_CALL setDefaultName(const OUString& rName) override;
+ virtual void SAL_CALL setDisplayDirectory(const OUString& rDirectory) override;
virtual OUString SAL_CALL getDisplayDirectory() override;
- virtual css::uno::Sequence< OUString > SAL_CALL getFiles() override;
+ virtual css::uno::Sequence<OUString> SAL_CALL getFiles() override;
// XFilePickerControlAccess functions
- virtual void SAL_CALL setValue( sal_Int16 nControlId, sal_Int16 nControlAction, const css::uno::Any &rValue ) override;
- virtual css::uno::Any SAL_CALL getValue( sal_Int16 nControlId, sal_Int16 nControlAction ) override;
- virtual void SAL_CALL enableControl( sal_Int16 nControlId, sal_Bool bEnable ) override;
- virtual void SAL_CALL setLabel( sal_Int16 nControlId, const OUString &rLabel ) override;
- virtual OUString SAL_CALL getLabel( sal_Int16 nControlId ) override;
+ virtual void SAL_CALL setValue(sal_Int16 nControlId, sal_Int16 nControlAction,
+ const css::uno::Any& rValue) override;
+ virtual css::uno::Any SAL_CALL getValue(sal_Int16 nControlId,
+ sal_Int16 nControlAction) override;
+ virtual void SAL_CALL enableControl(sal_Int16 nControlId, sal_Bool bEnable) override;
+ virtual void SAL_CALL setLabel(sal_Int16 nControlId, const OUString& rLabel) override;
+ virtual OUString SAL_CALL getLabel(sal_Int16 nControlId) override;
// XFilePicker2 functions
- virtual css::uno::Sequence< OUString > SAL_CALL getSelectedFiles() override;
+ virtual css::uno::Sequence<OUString> SAL_CALL getSelectedFiles() override;
// XInitialization
- virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any > &rArguments ) override;
+ virtual void SAL_CALL initialize(const css::uno::Sequence<css::uno::Any>& rArguments) override;
// XEventListener
/// @throws css::uno::RuntimeException
- virtual void SAL_CALL disposing( const css::lang::EventObject &rEvent );
+ virtual void SAL_CALL disposing(const css::lang::EventObject& rEvent);
using cppu::WeakComponentImplHelperBase::disposing;
// XServiceInfo
virtual OUString SAL_CALL getImplementationName() override;
- virtual sal_Bool SAL_CALL supportsService( const OUString &rServiceName ) override;
- virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
+ virtual sal_Bool SAL_CALL supportsService(const OUString& rServiceName) override;
+ virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
// XFolderPicker functions
virtual OUString SAL_CALL getDirectory() override;
- virtual void SAL_CALL setDescription( const OUString& rDescription ) override;
+ virtual void SAL_CALL setDescription(const OUString& rDescription) override;
private Q_SLOTS:
// XExecutableDialog functions
/// @throws css::uno::RuntimeException
- void setTitleSlot( const OUString &rTitle ) { return setTitle( rTitle ); }
+ void setTitleSlot(const OUString& rTitle) { return setTitle(rTitle); }
/// @throws css::uno::RuntimeException
sal_Int16 executeSlot() { return execute(); }
// XFilePicker functions
/// @throws css::uno::RuntimeException
- void setMultiSelectionModeSlot( bool bMode ) { return setMultiSelectionMode( bMode ); }
+ void setMultiSelectionModeSlot(bool bMode) { return setMultiSelectionMode(bMode); }
/// @throws css::uno::RuntimeException
- void setDefaultNameSlot( const OUString &rName ) { return setDefaultName( rName ); }
+ void setDefaultNameSlot(const OUString& rName) { return setDefaultName(rName); }
/// @throws css::uno::RuntimeException
- void setDisplayDirectorySlot( const OUString &rDirectory ) { return setDisplayDirectory( rDirectory ); }
+ void setDisplayDirectorySlot(const OUString& rDirectory)
+ {
+ return setDisplayDirectory(rDirectory);
+ }
/// @throws css::uno::RuntimeException
OUString getDisplayDirectorySlot() { return getDisplayDirectory(); }
/// @throws css::uno::RuntimeException
- css::uno::Sequence< OUString > getFilesSlot() { return getFiles(); }
+ css::uno::Sequence<OUString> getFilesSlot() { return getFiles(); }
// XFilterManager functions
/// @throws css::lang::IllegalArgumentException
/// @throws css::uno::RuntimeException
- void appendFilterSlot( const OUString &rTitle, const OUString &rFilter ) { return appendFilter( rTitle, rFilter ); }
+ void appendFilterSlot(const OUString& rTitle, const OUString& rFilter)
+ {
+ return appendFilter(rTitle, rFilter);
+ }
/// @throws css::lang::IllegalArgumentException
/// @throws css::uno::RuntimeException
- void setCurrentFilterSlot( const OUString &rTitle ) { return setCurrentFilter( rTitle ); }
+ void setCurrentFilterSlot(const OUString& rTitle) { return setCurrentFilter(rTitle); }
/// @throws css::uno::RuntimeException
OUString getCurrentFilterSlot() { return getCurrentFilter(); }
// XFilterGroupManager functions
/// @throws css::lang::IllegalArgumentException
/// @throws css::uno::RuntimeException
- void appendFilterGroupSlot( const OUString &rGroupTitle, const css::uno::Sequence< css::beans::StringPair > &rFilters ) { return appendFilterGroup( rGroupTitle, rFilters ); }
+ void appendFilterGroupSlot(const OUString& rGroupTitle,
+ const css::uno::Sequence<css::beans::StringPair>& rFilters)
+ {
+ return appendFilterGroup(rGroupTitle, rFilters);
+ }
// XFilePickerControlAccess functions
/// @throws css::uno::RuntimeException
- void setValueSlot( sal_Int16 nControlId, sal_Int16 nControlAction, const css::uno::Any &rValue ) { return setValue( nControlId, nControlAction, rValue ); }
+ void setValueSlot(sal_Int16 nControlId, sal_Int16 nControlAction, const css::uno::Any& rValue)
+ {
+ return setValue(nControlId, nControlAction, rValue);
+ }
/// @throws css::uno::RuntimeException
- css::uno::Any getValueSlot( sal_Int16 nControlId, sal_Int16 nControlAction ) { return getValue( nControlId, nControlAction ); }
+ css::uno::Any getValueSlot(sal_Int16 nControlId, sal_Int16 nControlAction)
+ {
+ return getValue(nControlId, nControlAction);
+ }
/// @throws css::uno::RuntimeException
- void enableControlSlot( sal_Int16 nControlId, bool bEnable ) { return enableControl( nControlId, bEnable ); }
+ void enableControlSlot(sal_Int16 nControlId, bool bEnable)
+ {
+ return enableControl(nControlId, bEnable);
+ }
/// @throws css::uno::RuntimeException
- void setLabelSlot( sal_Int16 nControlId, const OUString &rLabel ) { return setLabel( nControlId, rLabel ); }
+ void setLabelSlot(sal_Int16 nControlId, const OUString& rLabel)
+ {
+ return setLabel(nControlId, rLabel);
+ }
/// @throws css::uno::RuntimeException
- OUString getLabelSlot( sal_Int16 nControlId ) { return getLabel( nControlId ); }
+ OUString getLabelSlot(sal_Int16 nControlId) { return getLabel(nControlId); }
// XFilePicker2 functions
/// @throws css::uno::RuntimeException
- css::uno::Sequence< OUString > getSelectedFilesSlot() { return getSelectedFiles(); }
+ css::uno::Sequence<OUString> getSelectedFilesSlot() { return getSelectedFiles(); }
// XInitialization
/// @throws css::uno::Exception
/// @throws css::uno::RuntimeException
- void initializeSlot( const css::uno::Sequence< css::uno::Any > &rArguments ) { return initialize( rArguments ); }
+ void initializeSlot(const css::uno::Sequence<css::uno::Any>& rArguments)
+ {
+ return initialize(rArguments);
+ }
Q_SIGNALS:
// XExecutableDialog functions
- void setTitleSignal( const OUString &rTitle );
+ void setTitleSignal(const OUString& rTitle);
sal_Int16 executeSignal();
// XFilePicker functions
- void setMultiSelectionModeSignal( bool bMode );
- void setDefaultNameSignal( const OUString &rName );
- void setDisplayDirectorySignal( const OUString &rDirectory );
+ void setMultiSelectionModeSignal(bool bMode);
+ void setDefaultNameSignal(const OUString& rName);
+ void setDisplayDirectorySignal(const OUString& rDirectory);
OUString getDisplayDirectorySignal();
- css::uno::Sequence< OUString > getFilesSignal();
+ css::uno::Sequence<OUString> getFilesSignal();
// XFilterManager functions
- void appendFilterSignal( const OUString &rTitle, const OUString &rFilter );
- void setCurrentFilterSignal( const OUString &rTitle );
+ void appendFilterSignal(const OUString& rTitle, const OUString& rFilter);
+ void setCurrentFilterSignal(const OUString& rTitle);
OUString getCurrentFilterSignal();
// XFilterGroupManager functions
- void appendFilterGroupSignal( const OUString &rGroupTitle, const css::uno::Sequence< css::beans::StringPair > &rFilters );
+ void appendFilterGroupSignal(const OUString& rGroupTitle,
+ const css::uno::Sequence<css::beans::StringPair>& rFilters);
// XFilePickerControlAccess functions
- void setValueSignal( sal_Int16 nControlId, sal_Int16 nControlAction, const css::uno::Any &rValue );
- css::uno::Any getValueSignal( sal_Int16 nControlId, sal_Int16 nControlAction );
- void enableControlSignal( sal_Int16 nControlId, bool bEnable );
- void setLabelSignal( sal_Int16 nControlId, const OUString &rLabel );
- OUString getLabelSignal( sal_Int16 nControlId );
+ void setValueSignal(sal_Int16 nControlId, sal_Int16 nControlAction,
+ const css::uno::Any& rValue);
+ css::uno::Any getValueSignal(sal_Int16 nControlId, sal_Int16 nControlAction);
+ void enableControlSignal(sal_Int16 nControlId, bool bEnable);
+ void setLabelSignal(sal_Int16 nControlId, const OUString& rLabel);
+ OUString getLabelSignal(sal_Int16 nControlId);
// XFilePicker2 functions
- css::uno::Sequence< OUString > getSelectedFilesSignal() ;
+ css::uno::Sequence<OUString> getSelectedFilesSignal();
// XInitialization
- void initializeSignal( const css::uno::Sequence< css::uno::Any > &rArguments );
+ void initializeSignal(const css::uno::Sequence<css::uno::Any>& rArguments);
// Destructor proxy
void cleanupProxySignal();
private:
- Qt5FilePicker( const Qt5FilePicker& ) = delete;
- Qt5FilePicker& operator=( const Qt5FilePicker& ) = delete;
+ Qt5FilePicker(const Qt5FilePicker&) = delete;
+ Qt5FilePicker& operator=(const Qt5FilePicker&) = delete;
// add a custom control widget to the options dialog
- void addCustomControl(QGridLayout *pLayout, sal_Int16 controlId);
+ void addCustomControl(QGridLayout* pLayout, sal_Int16 controlId);
static QString getResString(const char* pRedId);
@@ -234,9 +262,9 @@ private Q_SLOTS:
void cleanupProxy();
// emit XFilePickerListener controlStateChanged event
- void filterSelected(const QString &);
+ void filterSelected(const QString&);
// emit XFilePickerListener fileSelectionChanged event
-// void urlSelected(const QUrl &);
+ // void urlSelected(const QUrl &);
void selectionChanged();
};
diff --git a/vcl/inc/qt5/Qt5Frame.hxx b/vcl/inc/qt5/Qt5Frame.hxx
index 1f881d706881..268441ea688a 100644
--- a/vcl/inc/qt5/Qt5Frame.hxx
+++ b/vcl/inc/qt5/Qt5Frame.hxx
@@ -87,7 +87,7 @@ public:
void Damage(sal_Int32 nExtentsX, sal_Int32 nExtentsY, sal_Int32 nExtentsWidth,
sal_Int32 nExtentsHeight) const;
- virtual void InitSvpSalGraphics( SvpSalGraphics* pSvpSalGraphics );
+ virtual void InitSvpSalGraphics(SvpSalGraphics* pSvpSalGraphics);
virtual SalGraphics* AcquireGraphics() override;
virtual void ReleaseGraphics(SalGraphics* pGraphics) override;
diff --git a/vcl/inc/qt5/Qt5Instance.hxx b/vcl/inc/qt5/Qt5Instance.hxx
index 24085b2af92d..cd0e91124412 100644
--- a/vcl/inc/qt5/Qt5Instance.hxx
+++ b/vcl/inc/qt5/Qt5Instance.hxx
@@ -31,7 +31,9 @@ class QApplication;
class SalYieldMutex;
class SalFrame;
-class VCLPLUG_QT5_PUBLIC Qt5Instance : public QObject, public SalGenericInstance, public SalUserEventList
+class VCLPLUG_QT5_PUBLIC Qt5Instance : public QObject,
+ public SalGenericInstance,
+ public SalUserEventList
{
Q_OBJECT
@@ -79,10 +81,10 @@ public:
virtual OUString GetDefaultPrinter() override;
virtual void PostPrintersChanged() override;
- virtual SalMenu* CreateMenu( bool, Menu* ) override;
- virtual void DestroyMenu( SalMenu* pMenu ) override;
- virtual SalMenuItem* CreateMenuItem( const SalItemParams* ) override;
- virtual void DestroyMenuItem( SalMenuItem* pItem ) override;
+ virtual SalMenu* CreateMenu(bool, Menu*) override;
+ virtual void DestroyMenu(SalMenu* pMenu) override;
+ virtual SalMenuItem* CreateMenuItem(const SalItemParams*) override;
+ virtual void DestroyMenuItem(SalMenuItem* pItem) override;
virtual SalTimer* CreateSalTimer() override;
virtual SalSystem* CreateSalSystem() override;
@@ -107,11 +109,11 @@ public:
virtual void TriggerUserEventProcessing() override;
virtual void ProcessEvent(SalUserEvent aEvent) override;
- virtual css::uno::Reference< css::ui::dialogs::XFilePicker2 > createFilePicker(
- const css::uno::Reference< css::uno::XComponentContext >& ) override;
+ virtual css::uno::Reference<css::ui::dialogs::XFilePicker2>
+ createFilePicker(const css::uno::Reference<css::uno::XComponentContext>&) override;
- virtual css::uno::Reference< css::ui::dialogs::XFolderPicker2 > createFolderPicker(
- const css::uno::Reference< css::uno::XComponentContext >& ) override;
+ virtual css::uno::Reference<css::ui::dialogs::XFolderPicker2>
+ createFolderPicker(const css::uno::Reference<css::uno::XComponentContext>&) override;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/qt5/Qt5Menu.hxx b/vcl/inc/qt5/Qt5Menu.hxx
index 37887045506f..21f33eaece84 100644
--- a/vcl/inc/qt5/Qt5Menu.hxx
+++ b/vcl/inc/qt5/Qt5Menu.hxx
@@ -21,57 +21,60 @@ class Qt5Menu : public QObject, public SalMenu
{
Q_OBJECT
private:
- std::vector< Qt5MenuItem* > maItems;
- VclPtr<Menu> mpVCLMenu;
- Qt5Menu* mpParentSalMenu;
- Qt5Frame* mpFrame;
- bool mbMenuBar;
- QMenuBar* mpQMenuBar;
+ std::vector<Qt5MenuItem*> maItems;
+ VclPtr<Menu> mpVCLMenu;
+ Qt5Menu* mpParentSalMenu;
+ Qt5Frame* mpFrame;
+ bool mbMenuBar;
+ QMenuBar* mpQMenuBar;
- void DoFullMenuUpdate( Menu* pMenuBar, QMenu* pParentMenu = nullptr );
- void NativeItemText( OUString &rItemText );
+ void DoFullMenuUpdate(Menu* pMenuBar, QMenu* pParentMenu = nullptr);
+ void NativeItemText(OUString& rItemText);
public:
- Qt5Menu( bool bMenuBar );
+ Qt5Menu(bool bMenuBar);
virtual ~Qt5Menu() override;
- virtual bool VisibleMenuBar() override; // must return TRUE to actually DISPLAY native menu bars
+ virtual bool VisibleMenuBar() override; // must return TRUE to actually DISPLAY native menu bars
- virtual void InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos ) override;
- virtual void RemoveItem( unsigned nPos ) override;
- virtual void SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned nPos ) override;
- virtual void SetFrame( const SalFrame* pFrame ) override;
- const Qt5Frame* GetFrame() const;
- Qt5Menu* GetTopLevel();
- virtual void CheckItem( unsigned nPos, bool bCheck ) override;
- virtual void EnableItem( unsigned nPos, bool bEnable ) override;
- virtual void ShowItem( unsigned nPos, bool bShow ) override;
- virtual void SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const OUString& rText ) override;
- virtual void SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage) override;
- virtual void SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const vcl::KeyCode& rKeyCode, const OUString& rKeyName ) override;
- virtual void GetSystemMenuData( SystemMenuData* pData ) override;
+ virtual void InsertItem(SalMenuItem* pSalMenuItem, unsigned nPos) override;
+ virtual void RemoveItem(unsigned nPos) override;
+ virtual void SetSubMenu(SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned nPos) override;
+ virtual void SetFrame(const SalFrame* pFrame) override;
+ const Qt5Frame* GetFrame() const;
+ Qt5Menu* GetTopLevel();
+ virtual void CheckItem(unsigned nPos, bool bCheck) override;
+ virtual void EnableItem(unsigned nPos, bool bEnable) override;
+ virtual void ShowItem(unsigned nPos, bool bShow) override;
+ virtual void SetItemText(unsigned nPos, SalMenuItem* pSalMenuItem,
+ const OUString& rText) override;
+ virtual void SetItemImage(unsigned nPos, SalMenuItem* pSalMenuItem,
+ const Image& rImage) override;
+ virtual void SetAccelerator(unsigned nPos, SalMenuItem* pSalMenuItem,
+ const vcl::KeyCode& rKeyCode, const OUString& rKeyName) override;
+ virtual void GetSystemMenuData(SystemMenuData* pData) override;
- void SetMenu( Menu* pMenu ) { mpVCLMenu = pMenu; }
- Menu* GetMenu() { return mpVCLMenu; }
- unsigned GetItemCount() { return maItems.size(); }
- Qt5MenuItem* GetItemAtPos( unsigned nPos ) { return maItems[ nPos ]; }
+ void SetMenu(Menu* pMenu) { mpVCLMenu = pMenu; }
+ Menu* GetMenu() { return mpVCLMenu; }
+ unsigned GetItemCount() { return maItems.size(); }
+ Qt5MenuItem* GetItemAtPos(unsigned nPos) { return maItems[nPos]; }
private slots:
- void DispatchCommand( Qt5MenuItem* pQItem );
+ void DispatchCommand(Qt5MenuItem* pQItem);
};
class Qt5MenuItem : public SalMenuItem
{
public:
- Qt5MenuItem( const SalItemParams* );
+ Qt5MenuItem(const SalItemParams*);
virtual ~Qt5MenuItem() override;
- sal_uInt16 mnId; // Item ID
- MenuItemType mnType; // Item type
- bool mbVisible; // Item visibility.
- Menu* mpVCLMenu;
- Qt5Menu* mpParentMenu; // The menu into which this menu item is inserted
- Qt5Menu* mpSubMenu; // Submenu of this item (if defined)
+ sal_uInt16 mnId; // Item ID
+ MenuItemType mnType; // Item type
+ bool mbVisible; // Item visibility.
+ Menu* mpVCLMenu;
+ Qt5Menu* mpParentMenu; // The menu into which this menu item is inserted
+ Qt5Menu* mpSubMenu; // Submenu of this item (if defined)
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/qt5/Qt5Tools.hxx b/vcl/inc/qt5/Qt5Tools.hxx
index 06c02572473c..a714f19e8a87 100644
--- a/vcl/inc/qt5/Qt5Tools.hxx
+++ b/vcl/inc/qt5/Qt5Tools.hxx
@@ -58,7 +58,7 @@ inline Size toSize(const QSize& rSize) { return Size(rSize.width(), rSize.height
inline QColor toQColor(const Color& rColor)
{
- return QColor( rColor.GetRed(), rColor.GetGreen(), rColor.GetBlue(), rColor.GetTransparency() );
+ return QColor(rColor.GetRed(), rColor.GetGreen(), rColor.GetBlue(), rColor.GetTransparency());
}
static constexpr QImage::Format Qt5_DefaultFormat32 = QImage::Format_ARGB32;
diff --git a/vcl/inc/qt5/Qt5Widget.hxx b/vcl/inc/qt5/Qt5Widget.hxx
index c95bc94c1f0c..32daa2bfef38 100644
--- a/vcl/inc/qt5/Qt5Widget.hxx
+++ b/vcl/inc/qt5/Qt5Widget.hxx
@@ -21,8 +21,8 @@
#include <QtWidgets/QWidget>
-#include "Qt5Frame.hxx"
+#include "Qt5Frame.hxx"
-QWidget* createQt5Widget(Qt5Frame &rFrame, QWidget* parent, Qt::WindowFlags f);
+QWidget* createQt5Widget(Qt5Frame& rFrame, QWidget* parent, Qt::WindowFlags f);
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/qt5/Qt5FilePicker.cxx b/vcl/qt5/Qt5FilePicker.cxx
index 7dee36de35d3..7bc561a7d594 100644
--- a/vcl/qt5/Qt5FilePicker.cxx
+++ b/vcl/qt5/Qt5FilePicker.cxx
@@ -54,7 +54,6 @@
#include <unx/geninst.h>
#include <strings.hrc>
-
using namespace ::com::sun::star;
using namespace ::com::sun::star::ui::dialogs;
using namespace ::com::sun::star::ui::dialogs::TemplateDescription;
@@ -66,266 +65,281 @@ using namespace ::com::sun::star::uno;
namespace
{
- uno::Sequence<OUString> SAL_CALL FilePicker_getSupportedServiceNames()
- {
- uno::Sequence<OUString> aRet(3);
- aRet[0] = "com.sun.star.ui.dialogs.FilePicker";
- aRet[1] = "com.sun.star.ui.dialogs.SystemFilePicker";
- aRet[2] = "com.sun.star.ui.dialogs.Qt5FilePicker";
- return aRet;
- }
+uno::Sequence<OUString> SAL_CALL FilePicker_getSupportedServiceNames()
+{
+ uno::Sequence<OUString> aRet(3);
+ aRet[0] = "com.sun.star.ui.dialogs.FilePicker";
+ aRet[1] = "com.sun.star.ui.dialogs.SystemFilePicker";
+ aRet[2] = "com.sun.star.ui.dialogs.Qt5FilePicker";
+ return aRet;
+}
}
-Qt5FilePicker::Qt5FilePicker( QFileDialog::FileMode eMode )
- : Qt5FilePicker_Base( m_aHelperMutex )
+Qt5FilePicker::Qt5FilePicker(QFileDialog::FileMode eMode)
+ : Qt5FilePicker_Base(m_aHelperMutex)
{
-SAL_DEBUG( "Qt5FilePicker::Qt5FilePicker" );
m_pFileDialog = new QFileDialog();
m_pOptionsDialog = new QDialog();
- m_pFileDialog->setFileMode( eMode );
-// m_pFileDialog->setWindowModality( Qt::WindowModal );
- m_pFileDialog->setWindowModality( Qt::ApplicationModal );
- m_pOptionsDialog->setWindowModality( Qt::WindowModal );
+ m_pFileDialog->setFileMode(eMode);
+ // m_pFileDialog->setWindowModality( Qt::WindowModal );
+ m_pFileDialog->setWindowModality(Qt::ApplicationModal);
+ m_pOptionsDialog->setWindowModality(Qt::WindowModal);
- setMultiSelectionMode( false );
+ setMultiSelectionMode(false);
// XExecutableDialog functions
- connect( this, SIGNAL( setTitleSignal( const OUString & ) ),
- this, SLOT( setTitleSlot( const OUString & ) ), Qt::BlockingQueuedConnection );
- connect( this, SIGNAL( executeSignal() ),
- this, SLOT( executeSlot() ), Qt::BlockingQueuedConnection );
+ connect(this, SIGNAL(setTitleSignal(const OUString&)), this,
+ SLOT(setTitleSlot(const OUString&)), Qt::BlockingQueuedConnection);
+ connect(this, SIGNAL(executeSignal()), this, SLOT(executeSlot()), Qt::BlockingQueuedConnection);
// XFilePicker functions
- connect( this, SIGNAL( setMultiSelectionModeSignal( bool ) ),
- this, SLOT( setMultiSelectionModeSlot( bool ) ), Qt::BlockingQueuedConnection );
- connect( this, SIGNAL( setDefaultNameSignal( const OUString & ) ),
- this, SLOT( setDefaultNameSlot( const OUString & ) ), Qt::BlockingQueuedConnection );
- connect( this, SIGNAL( setDisplayDirectorySignal( const OUString & ) ),
- this, SLOT( setDisplayDirectorySlot( const OUString & ) ), Qt::BlockingQueuedConnection );
- connect( this, SIGNAL( getDisplayDirectorySignal() ),
- this, SLOT( getDisplayDirectorySlot() ), Qt::BlockingQueuedConnection );
- connect( this, SIGNAL( getFilesSignal() ),
- this, SLOT( getFilesSlot() ), Qt::BlockingQueuedConnection );
+ connect(this, SIGNAL(setMultiSelectionModeSignal(bool)), this,
+ SLOT(setMultiSelectionModeSlot(bool)), Qt::BlockingQueuedConnection);
+ connect(this, SIGNAL(setDefaultNameSignal(const OUString&)), this,
+ SLOT(setDefaultNameSlot(const OUString&)), Qt::BlockingQueuedConnection);
+ connect(this, SIGNAL(setDisplayDirectorySignal(const OUString&)), this,
+ SLOT(setDisplayDirectorySlot(const OUString&)), Qt::BlockingQueuedConnection);
+ connect(this, SIGNAL(getDisplayDirectorySignal()), this, SLOT(getDisplayDirectorySlot()),
+ Qt::BlockingQueuedConnection);
+ connect(this, SIGNAL(getFilesSignal()), this, SLOT(getFilesSlot()),
+ Qt::BlockingQueuedConnection);
// XFilterManager functions
- connect( this, SIGNAL( appendFilterSignal( const OUString &, const OUString & ) ),
- this, SLOT( appendFilterSlot( const OUString &, const OUString & ) ), Qt::BlockingQueuedConnection );
- connect( this, SIGNAL( setCurrentFilterSignal( const OUString & ) ),
- this, SLOT( setCurrentFilterSlot( const OUString & ) ), Qt::BlockingQueuedConnection );
- connect( this, SIGNAL( getCurrentFilterSignal() ),
- this, SLOT( getCurrentFilterSlot() ), Qt::BlockingQueuedConnection );
+ connect(this, SIGNAL(appendFilterSignal(const OUString&, const OUString&)), this,
+ SLOT(appendFilterSlot(const OUString&, const OUString&)), Qt::BlockingQueuedConnection);
+ connect(this, SIGNAL(setCurrentFilterSignal(const OUString&)), this,
+ SLOT(setCurrentFilterSlot(const OUString&)), Qt::BlockingQueuedConnection);
+ connect(this, SIGNAL(getCurrentFilterSignal()), this, SLOT(getCurrentFilterSlot()),
+ Qt::BlockingQueuedConnection);
// XFilterGroupManager functions
- connect( this, SIGNAL( appendFilterGroupSignal( const OUString &, const css::uno::Sequence< css::beans::StringPair > & ) ),
- this, SLOT( appendFilterGroupSlot( const OUString &, const css::uno::Sequence< css::beans::StringPair > & ) ), Qt::BlockingQueuedConnection );
+ connect(this,
+ SIGNAL(appendFilterGroupSignal(const OUString&,
+ const css::uno::Sequence<css::beans::StringPair>&)),
+ this,
+ SLOT(appendFilterGroupSlot(const OUString&,
+ const css::uno::Sequence<css::beans::StringPair>&)),
+ Qt::BlockingQueuedConnection);
// XFilePickerControlAccess functions
- connect( this, SIGNAL( setValueSignal( sal_Int16, sal_Int16, const css::uno::Any & ) ),
- this, SLOT( setValueSlot( sal_Int16, sal_Int16, const css::uno::Any & ) ), Qt::BlockingQueuedConnection );
- connect( this, SIGNAL( getValueSignal( sal_Int16, sal_Int16 ) ),
- this, SLOT( getValueSlot( sal_Int16, sal_Int16 ) ), Qt::BlockingQueuedConnection );
- connect( this, SIGNAL( enableControlSignal( sal_Int16, bool ) ),
- this, SLOT( enableControlSlot( sal_Int16, bool ) ), Qt::BlockingQueuedConnection );
- connect( this, SIGNAL( setLabelSignal( sal_Int16, const OUString & ) ),
- this, SLOT( setLabelSlot( sal_Int16, const OUString & ) ), Qt::BlockingQueuedConnection );
- connect( this, SIGNAL( getLabelSignal( sal_Int16 ) ),
- this, SLOT( getLabelSlot( sal_Int16 ) ), Qt::BlockingQueuedConnection );
+ connect(this, SIGNAL(setValueSignal(sal_Int16, sal_Int16, const css::uno::Any&)), this,
+ SLOT(setValueSlot(sal_Int16, sal_Int16, const css::uno::Any&)),
+ Qt::BlockingQueuedConnection);
+ connect(this, SIGNAL(getValueSignal(sal_Int16, sal_Int16)), this,
+ SLOT(getValueSlot(sal_Int16, sal_Int16)), Qt::BlockingQueuedConnection);
+ connect(this, SIGNAL(enableControlSignal(sal_Int16, bool)), this,
+ SLOT(enableControlSlot(sal_Int16, bool)), Qt::BlockingQueuedConnection);
+ connect(this, SIGNAL(setLabelSignal(sal_Int16, const OUString&)), this,
+ SLOT(setLabelSlot(sal_Int16, const OUString&)), Qt::BlockingQueuedConnection);
+ connect(this, SIGNAL(getLabelSignal(sal_Int16)), this, SLOT(getLabelSlot(sal_Int16)),
+ Qt::BlockingQueuedConnection);
// XFilePicker2 functions
- connect( this, SIGNAL( getSelectedFilesSignal() ),
- this, SLOT( getSelectedFilesSlot() ), Qt::BlockingQueuedConnection );
+ connect(this, SIGNAL(getSelectedFilesSignal()), this, SLOT(getSelectedFilesSlot()),
+ Qt::BlockingQueuedConnection);
// XInitialization
- connect( this, SIGNAL( initializeSignal( const css::uno::Sequence< css::uno::Any > & ) ),
- this, SLOT( initializeSlot( const css::uno::Sequence< css::uno::Any > & ) ), Qt::BlockingQueuedConnection );
+ connect(this, SIGNAL(initializeSignal(const css::uno::Sequence<css::uno::Any>&)), this,
+ SLOT(initializeSlot(const css::uno::Sequence<css::uno::Any>&)),
+ Qt::BlockingQueuedConnection);
// Destructor proxy
- connect( this, SIGNAL( cleanupProxySignal() ), this, SLOT( cleanupProxy() ), Qt::BlockingQueuedConnection );
+ connect(this, SIGNAL(cleanupProxySignal()), this, SLOT(cleanupProxy()),
+ Qt::BlockingQueuedConnection);
// XFilePickerListener notifications
- connect( m_pFileDialog, SIGNAL( filterSelected(const QString&) ), this, SLOT( filterSelected(const QString&) ));
- connect( m_pFileDialog, SIGNAL( selectionChanged() ), this, SLOT( selectionChanged() ));
+ connect(m_pFileDialog, SIGNAL(filterSelected(const QString&)), this,
+ SLOT(filterSelected(const QString&)));
+ connect(m_pFileDialog, SIGNAL(selectionChanged()), this, SLOT(selectionChanged()));
}
-Qt5FilePicker::~Qt5FilePicker()
-{
- cleanupProxy();
-}
+Qt5FilePicker::~Qt5FilePicker() { cleanupProxy(); }
void Qt5FilePicker::cleanupProxy()
{
- if( qApp->thread() != QThread::currentThread() ) {
+ if (qApp->thread() != QThread::currentThread())
+ {
SolarMutexReleaser aReleaser;
return Q_EMIT cleanupProxySignal();
}
delete m_pOptionsDialog;
}
-void SAL_CALL Qt5FilePicker::addFilePickerListener( const uno::Reference<XFilePickerListener>& xListener )
+void SAL_CALL
+Qt5FilePicker::addFilePickerListener(const uno::Reference<XFilePickerListener>& xListener)
{
SolarMutexGuard aGuard;
m_xListener = xListener;
}
-void SAL_CALL Qt5FilePicker::removeFilePickerListener( const uno::Reference<XFilePickerListener>& )
+void SAL_CALL Qt5FilePicker::removeFilePickerListener(const uno::Reference<XFilePickerListener>&)
{
SolarMutexGuard aGuard;
m_xListener.clear();
}
-void SAL_CALL Qt5FilePicker::setTitle( const OUString &title )
+void SAL_CALL Qt5FilePicker::setTitle(const OUString& title)
{
- if( qApp->thread() != QThread::currentThread() ) {
+ if (qApp->thread() != QThread::currentThread())
+ {
SolarMutexReleaser aReleaser;
- return Q_EMIT setTitleSignal( title );
+ return Q_EMIT setTitleSignal(title);
}
- m_pOptionsDialog->setWindowTitle( toQString(title) );
+ m_pOptionsDialog->setWindowTitle(toQString(title));
}
sal_Int16 SAL_CALL Qt5FilePicker::execute()
{
- if( qApp->thread() != QThread::currentThread() ) {
+ if (qApp->thread() != QThread::currentThread())
+ {
SolarMutexReleaser aReleaser;
return Q_EMIT executeSignal();
}
- vcl::Window *pWindow = ::Application::GetActiveTopWindow();
- assert( pWindow );
- QWidget *pTransientParent = nullptr;
- QWindow *pTransientWindow = nullptr;
- if( pWindow )
+ vcl::Window* pWindow = ::Application::GetActiveTopWindow();
+ assert(pWindow);
+ QWidget* pTransientParent = nullptr;
+ QWindow* pTransientWindow = nullptr;
+ if (pWindow)
{
- Qt5Frame *pFrame = dynamic_cast<Qt5Frame *>( pWindow->ImplGetFrame() );
- assert( pFrame );
- if( pFrame )
+ Qt5Frame* pFrame = dynamic_cast<Qt5Frame*>(pWindow->ImplGetFrame());
+ assert(pFrame);
+ if (pFrame)
{
pTransientParent = pFrame->GetQWidget();
pTransientWindow = pTransientParent->window()->windowHandle();
}
}
- m_pFileDialog->setNameFilters( m_aNamedFilterList );
- if( !m_aCurrentFilterTitle.isNull() )
+ m_pFileDialog->setNameFilters(m_aNamedFilterList);
+ if (!m_aCurrentFilterTitle.isNull())
{
int i = 0;
- for( ; i < m_aFilterTitleList.size(); ++i )
- if( m_aCurrentFilterTitle == m_aFilterTitleList[ i ] )
+ for (; i < m_aFilterTitleList.size(); ++i)
+ if (m_aCurrentFilterTitle == m_aFilterTitleList[i])
{
- m_pFileDialog->selectNameFilter( m_aNamedFilterList[ i ] );
+ m_pFileDialog->selectNameFilter(m_aNamedFilterList[i]);
break;
}
- assert( i < m_aFilterTitleList.size() );
+ assert(i < m_aFilterTitleList.size());
}
- if( pTransientParent )
+ if (pTransientParent)
{
m_pFileDialog->show();
- m_pFileDialog->window()->windowHandle()->setTransientParent( pTransientWindow );
- m_pFileDialog->setFocusProxy( pTransientParent );
-// pTransientParent->setMouseTracking( false );
+ m_pFileDialog->window()->windowHandle()->setTransientParent(pTransientWindow);
+ m_pFileDialog->setFocusProxy(pTransientParent);
+ // pTransientParent->setMouseTracking( false );
}
int result = m_pFileDialog->exec();
- if( pTransientParent )
-// pTransientParent->setMouseTracking( true );
- if( QFileDialog::Rejected == result )
- return ExecutableDialogResults::CANCEL;
+ if (pTransientParent)
+ // pTransientParent->setMouseTracking( true );
+ if (QFileDialog::Rejected == result)
+ return ExecutableDialogResults::CANCEL;
- if ( !m_aCustomWidgetsMap.empty() )
+ if (!m_aCustomWidgetsMap.empty())
{
- m_pFilenameLabel->setText( m_pFileDialog->selectedUrls()[ 0 ].url() );
+ m_pFilenameLabel->setText(m_pFileDialog->selectedUrls()[0].url());
QString filter = m_pFileDialog->selectedNameFilter();
int pos = filter.indexOf(" (");
- if( pos >= 0 )
- filter.truncate( pos );
- m_pFilterLabel->setText( filter );
+ if (pos >= 0)
+ filter.truncate(pos);
+ m_pFilterLabel->setText(filter);
- if( pTransientParent )
+ if (pTransientParent)
{
m_pOptionsDialog->show();
- m_pOptionsDialog->window()->windowHandle()->setTransientParent( pTransientWindow );
- m_pOptionsDialog->setFocusProxy( pTransientParent );
+ m_pOptionsDialog->window()->windowHandle()->setTransientParent(pTransientWindow);
+ m_pOptionsDialog->setFocusProxy(pTransientParent);
}
result = m_pOptionsDialog->exec();
- if( QFileDialog::Rejected == result )
+ if (QFileDialog::Rejected == result)
return ExecutableDialogResults::CANCEL;
}
return ExecutableDialogResults::OK;
}
-void SAL_CALL Qt5FilePicker::setMultiSelectionMode( sal_Bool multiSelect )
+void SAL_CALL Qt5FilePicker::setMultiSelectionMode(sal_Bool multiSelect)
{
- if( qApp->thread() != QThread::currentThread() ) {
+ if (qApp->thread() != QThread::currentThread())
+ {
SolarMutexReleaser aReleaser;
- return Q_EMIT setMultiSelectionModeSignal( multiSelect );
+ return Q_EMIT setMultiSelectionModeSignal(multiSelect);
}
- if( multiSelect )
- m_pFileDialog->setFileMode( QFileDialog::ExistingFiles );
+ if (multiSelect)
+ m_pFileDialog->setFileMode(QFileDialog::ExistingFiles);
else
- m_pFileDialog->setFileMode( QFileDialog::ExistingFile );
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list