summaryrefslogtreecommitdiff
path: root/uui
diff options
context:
space:
mode:
authorPhilipp Hofer <philipp.hofer@protonmail.com>2020-11-12 13:25:07 +0100
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2020-11-16 11:46:15 +0100
commitf05246dc2ae1145f54e1b6e53b47fd53382add96 (patch)
treebb818cfec03717234c0eabf12cd708b3036ca186 /uui
parent580b4c5f945df4e98bc2bacdf3620da688b2dbdf (diff)
tdf#123936 Formatting files in module uui with clang-format
Change-Id: I0de0afa5dca5e5193d25927e76e42cbf29682d96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105726 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'uui')
-rw-r--r--uui/qa/unit/uui-dialogs-test.cxx9
-rw-r--r--uui/source/alreadyopen.hxx4
-rw-r--r--uui/source/authfallbackdlg.cxx23
-rw-r--r--uui/source/fltdlg.cxx84
-rw-r--r--uui/source/masterpassworddlg.hxx5
-rw-r--r--uui/source/openlocked.hxx6
-rw-r--r--uui/source/sslwarndlg.hxx11
-rw-r--r--uui/source/trylater.hxx4
-rw-r--r--uui/source/unknownauthdlg.cxx14
9 files changed, 76 insertions, 84 deletions
diff --git a/uui/qa/unit/uui-dialogs-test.cxx b/uui/qa/unit/uui-dialogs-test.cxx
index 3ad47fd79f1c..8aeeee6f6d16 100644
--- a/uui/qa/unit/uui-dialogs-test.cxx
+++ b/uui/qa/unit/uui-dialogs-test.cxx
@@ -36,19 +36,14 @@ public:
CPPUNIT_TEST_SUITE_END();
};
-UuiDialogsTest::UuiDialogsTest()
-{
-}
+UuiDialogsTest::UuiDialogsTest() {}
void UuiDialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/)
{
// fill map of known dialogs
}
-VclPtr<VclAbstractDialog> UuiDialogsTest::createDialogByID(sal_uInt32 /*nID*/)
-{
- return nullptr;
-}
+VclPtr<VclAbstractDialog> UuiDialogsTest::createDialogByID(sal_uInt32 /*nID*/) { return nullptr; }
void UuiDialogsTest::openAnyDialog()
{
diff --git a/uui/source/alreadyopen.hxx b/uui/source/alreadyopen.hxx
index 3d6e5a8fab80..685214fb1a5e 100644
--- a/uui/source/alreadyopen.hxx
+++ b/uui/source/alreadyopen.hxx
@@ -25,8 +25,10 @@ class AlreadyOpenQueryBox
{
private:
std::unique_ptr<weld::MessageDialog> m_xQueryBox;
+
public:
- AlreadyOpenQueryBox(weld::Window* pParent, const std::locale& rResLocale, const OUString& aMessage, bool bIsStoring);
+ AlreadyOpenQueryBox(weld::Window* pParent, const std::locale& rResLocale,
+ const OUString& aMessage, bool bIsStoring);
short run() { return m_xQueryBox->run(); }
};
diff --git a/uui/source/authfallbackdlg.cxx b/uui/source/authfallbackdlg.cxx
index 3fa4fc1655a9..daad28b77feb 100644
--- a/uui/source/authfallbackdlg.cxx
+++ b/uui/source/authfallbackdlg.cxx
@@ -12,7 +12,7 @@
AuthFallbackDlg::AuthFallbackDlg(weld::Window* pParent, const OUString& instructions,
const OUString& url)
: GenericDialogController(pParent, "uui/ui/authfallback.ui", "AuthFallbackDlg")
- , m_bGoogleMode( false )
+ , m_bGoogleMode(false)
, m_xTVInstructions(m_xBuilder->weld_label("instructions"))
, m_xEDUrl(m_xBuilder->weld_entry("url"))
, m_xEDCode(m_xBuilder->weld_entry("code"))
@@ -22,12 +22,12 @@ AuthFallbackDlg::AuthFallbackDlg(weld::Window* pParent, const OUString& instruct
, m_xGoogleBox(m_xBuilder->weld_widget("GDrive"))
, m_xOneDriveBox(m_xBuilder->weld_widget("OneDrive"))
{
- m_xBTOk->connect_clicked( LINK( this, AuthFallbackDlg, OKHdl) );
- m_xBTCancel->connect_clicked( LINK( this, AuthFallbackDlg, CancelHdl) );
+ m_xBTOk->connect_clicked(LINK(this, AuthFallbackDlg, OKHdl));
+ m_xBTCancel->connect_clicked(LINK(this, AuthFallbackDlg, CancelHdl));
m_xBTOk->set_sensitive(true);
m_xTVInstructions->set_label(instructions);
- if( url.isEmpty() )
+ if (url.isEmpty())
{
// Google 2FA
m_bGoogleMode = true;
@@ -41,28 +41,23 @@ AuthFallbackDlg::AuthFallbackDlg(weld::Window* pParent, const OUString& instruct
m_bGoogleMode = false;
m_xGoogleBox->hide();
m_xOneDriveBox->show();
- m_xEDUrl->set_text( url );
+ m_xEDUrl->set_text(url);
}
}
-AuthFallbackDlg::~AuthFallbackDlg()
-{
-}
+AuthFallbackDlg::~AuthFallbackDlg() {}
OUString AuthFallbackDlg::GetCode() const
{
- if( m_bGoogleMode )
+ if (m_bGoogleMode)
return m_xEDGoogleCode->get_text();
else
return m_xEDCode->get_text();
}
-IMPL_LINK_NOARG(AuthFallbackDlg, OKHdl, weld::Button&, void)
-{
- m_xDialog->response(RET_OK);
-}
+IMPL_LINK_NOARG(AuthFallbackDlg, OKHdl, weld::Button&, void) { m_xDialog->response(RET_OK); }
-IMPL_LINK_NOARG(AuthFallbackDlg, CancelHdl, weld::Button&, void)
+IMPL_LINK_NOARG(AuthFallbackDlg, CancelHdl, weld::Button&, void)
{
m_xDialog->response(RET_CANCEL);
}
diff --git a/uui/source/fltdlg.cxx b/uui/source/fltdlg.cxx
index 391cf5a70b25..748a2dc421a2 100644
--- a/uui/source/fltdlg.cxx
+++ b/uui/source/fltdlg.cxx
@@ -27,7 +27,6 @@
namespace uui
{
-
/*-************************************************************************************************************
@short initialize filter dialog with start values
@descr We set some necessary information on these instance for later working and create internal structures.
@@ -39,7 +38,7 @@ namespace uui
@param "pParentWindow" , parent window for dialog
@threadsafe no
-*//*-*************************************************************************************************************/
+*/ /*-*************************************************************************************************************/
FilterDialog::FilterDialog(weld::Window* pParentWindow)
: GenericDialogController(pParentWindow, "uui/ui/filterselect.ui", "FilterSelectDialog")
, m_pFilterNames(nullptr)
@@ -50,17 +49,15 @@ FilterDialog::FilterDialog(weld::Window* pParentWindow)
m_xLbFilters->get_height_rows(15));
}
-FilterDialog::~FilterDialog()
-{
-}
+FilterDialog::~FilterDialog() {}
/*-************************************************************************************************************
@short set file name on dialog control
@descr We convert given URL (it must be a URL!) into valid file name and show it on our dialog.
@param "sURL", URL for showing
@threadsafe no
-*//*-*************************************************************************************************************/
-void FilterDialog::SetURL( const OUString& sURL )
+*/ /*-*************************************************************************************************************/
+void FilterDialog::SetURL(const OUString& sURL)
{
// convert it and use given pure string as fallback if conversion failed
m_xFtURL->set_label(impl_buildUIFileName(sURL));
@@ -82,14 +79,14 @@ void FilterDialog::SetURL( const OUString& sURL )
@param "pFilterNames", pointer to list of filter names, which should be used for later operations.
@onerror We clear list box and forget our currently set filter information completely!
@threadsafe no
-*//*-*************************************************************************************************************/
-void FilterDialog::ChangeFilters( const FilterNameList* pFilterNames )
+*/ /*-*************************************************************************************************************/
+void FilterDialog::ChangeFilters(const FilterNameList* pFilterNames)
{
m_pFilterNames = pFilterNames;
m_xLbFilters->clear();
- if( m_pFilterNames != nullptr )
+ if (m_pFilterNames != nullptr)
{
- for( const auto& rItem : *m_pFilterNames )
+ for (const auto& rItem : *m_pFilterNames)
{
m_xLbFilters->append_text(rItem.sUI);
}
@@ -113,24 +110,24 @@ void FilterDialog::ChangeFilters( const FilterNameList* pFilterNames )
@onerror We return false ... but don't change pSelectedItem!
@threadsafe no
-*//*-*************************************************************************************************************/
-bool FilterDialog::AskForFilter( FilterNameListPtr& pSelectedItem )
+*/ /*-*************************************************************************************************************/
+bool FilterDialog::AskForFilter(FilterNameListPtr& pSelectedItem)
{
bool bSelected = false;
- if( m_pFilterNames != nullptr )
+ if (m_pFilterNames != nullptr)
{
if (m_xDialog->run() == RET_OK)
{
OUString sEntry = m_xLbFilters->get_selected_text();
- if( !sEntry.isEmpty() )
+ if (!sEntry.isEmpty())
{
int nPos = m_xLbFilters->get_selected_index();
- if( nPos < static_cast<int>(m_pFilterNames->size()) )
+ if (nPos < static_cast<int>(m_pFilterNames->size()))
{
- pSelectedItem = m_pFilterNames->begin();
+ pSelectedItem = m_pFilterNames->begin();
pSelectedItem += nPos;
- bSelected = ( pSelectedItem != m_pFilterNames->end() );
+ bSelected = (pSelectedItem != m_pFilterNames->end());
}
}
}
@@ -139,8 +136,8 @@ bool FilterDialog::AskForFilter( FilterNameListPtr& pSelectedItem )
return bSelected;
}
-namespace {
-
+namespace
+{
/*-************************************************************************************************************
@short helper class to calculate length of given string
@descr Instances of it can be used as callback for INetURLObject::getAbbreviated() method to build
@@ -149,24 +146,23 @@ namespace {
@seealso method OutputDevice::GetTextWidth()
@seealso method InetURLObject::getAbbreviated()
@threadsafe no
-*//*-*************************************************************************************************************/
-class StringCalculator : public ::cppu::WeakImplHelper< css::util::XStringWidth >
+*/ /*-*************************************************************************************************************/
+class StringCalculator : public ::cppu::WeakImplHelper<css::util::XStringWidth>
{
- public:
- explicit StringCalculator(weld::Widget* pDevice)
- : m_pDevice(pDevice)
- {
- }
+public:
+ explicit StringCalculator(weld::Widget* pDevice)
+ : m_pDevice(pDevice)
+ {
+ }
- sal_Int32 SAL_CALL queryStringWidth( const OUString& sString ) override
- {
- return static_cast<sal_Int32>(m_pDevice->get_pixel_size(sString).Width());
- }
+ sal_Int32 SAL_CALL queryStringWidth(const OUString& sString) override
+ {
+ return static_cast<sal_Int32>(m_pDevice->get_pixel_size(sString).Width());
+ }
- private:
- weld::Widget* m_pDevice;
+private:
+ weld::Widget* m_pDevice;
};
-
}
/*-************************************************************************************************************
@@ -181,10 +177,10 @@ class StringCalculator : public ::cppu::WeakImplHelper< css::util::XStringWidth
@onerror We return given name without any changes.
@threadsafe no
-*//*-*************************************************************************************************************/
-OUString FilterDialog::impl_buildUIFileName( const OUString& sName )
+*/ /*-*************************************************************************************************************/
+OUString FilterDialog::impl_buildUIFileName(const OUString& sName)
{
- OUString sShortName( sName );
+ OUString sShortName(sName);
if (osl::FileBase::getSystemPathFromFileURL(sName, sShortName) == osl::FileBase::E_None)
@@ -194,18 +190,20 @@ OUString FilterDialog::impl_buildUIFileName( const OUString& sName )
else
{
// otherwise it's really a URL... build short name by using INetURLObject
- css::uno::Reference< css::util::XStringWidth > xStringCalculator(new StringCalculator(m_xFtURL.get()));
- if( xStringCalculator.is() )
+ css::uno::Reference<css::util::XStringWidth> xStringCalculator(
+ new StringCalculator(m_xFtURL.get()));
+ if (xStringCalculator.is())
{
- INetURLObject aBuilder ( sName );
- Size aSize = m_xLbFilters->get_preferred_size();
- sShortName = aBuilder.getAbbreviated( xStringCalculator, aSize.Width(), INetURLObject::DecodeMechanism::Unambiguous );
+ INetURLObject aBuilder(sName);
+ Size aSize = m_xLbFilters->get_preferred_size();
+ sShortName = aBuilder.getAbbreviated(xStringCalculator, aSize.Width(),
+ INetURLObject::DecodeMechanism::Unambiguous);
}
}
return sShortName;
}
-} // namespace uui
+} // namespace uui
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/uui/source/masterpassworddlg.hxx b/uui/source/masterpassworddlg.hxx
index 6e3e94f29fdd..bbe67558ea6f 100644
--- a/uui/source/masterpassworddlg.hxx
+++ b/uui/source/masterpassworddlg.hxx
@@ -32,10 +32,11 @@ private:
DECL_LINK(OKHdl_Impl, weld::Button&, void);
public:
- MasterPasswordDialog(weld::Window* pParent, css::task::PasswordRequestMode nDlgMode, const std::locale& rLocale);
+ MasterPasswordDialog(weld::Window* pParent, css::task::PasswordRequestMode nDlgMode,
+ const std::locale& rLocale);
virtual ~MasterPasswordDialog() override;
- OUString GetMasterPassword() const { return m_xEDMasterPassword->get_text(); }
+ OUString GetMasterPassword() const { return m_xEDMasterPassword->get_text(); }
};
#endif // INCLUDED_UUI_SOURCE_MASTERPASSWORDDLG_HXX
diff --git a/uui/source/openlocked.hxx b/uui/source/openlocked.hxx
index c4835c8c1314..7fdcd49ac591 100644
--- a/uui/source/openlocked.hxx
+++ b/uui/source/openlocked.hxx
@@ -25,9 +25,11 @@ class OpenLockedQueryBox
{
private:
std::unique_ptr<weld::MessageDialog> m_xQueryBox;
+
public:
- OpenLockedQueryBox(weld::Window* pParent, const std::locale& rResLocale, const OUString& rMessage, bool bEnableOverride);
- short run() { return m_xQueryBox->run(); }
+ OpenLockedQueryBox(weld::Window* pParent, const std::locale& rResLocale,
+ const OUString& rMessage, bool bEnableOverride);
+ short run() { return m_xQueryBox->run(); }
};
#endif
diff --git a/uui/source/sslwarndlg.hxx b/uui/source/sslwarndlg.hxx
index bd02b00412fa..070379624941 100644
--- a/uui/source/sslwarndlg.hxx
+++ b/uui/source/sslwarndlg.hxx
@@ -23,24 +23,23 @@
#include <com/sun/star/security/XCertificate.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
-
//= Https_WarnDialog
class SSLWarnDialog : public weld::MessageDialogController
{
private:
std::unique_ptr<weld::Button> m_xView;
- const css::uno::Reference< css::uno::XComponentContext >& m_xContext;
- const css::uno::Reference< css::security::XCertificate >& m_rXCert;
+ const css::uno::Reference<css::uno::XComponentContext>& m_xContext;
+ const css::uno::Reference<css::security::XCertificate>& m_rXCert;
DECL_LINK(ViewCertHdl, weld::Button&, void);
public:
SSLWarnDialog(weld::Window* pParent,
- const css::uno::Reference< css::security::XCertificate >& rXCert,
- const css::uno::Reference< css::uno::XComponentContext >& xContext );
+ const css::uno::Reference<css::security::XCertificate>& rXCert,
+ const css::uno::Reference<css::uno::XComponentContext>& xContext);
- void setDescription1Text(const OUString &rText) { m_xDialog->set_primary_text(rText); }
+ void setDescription1Text(const OUString& rText) { m_xDialog->set_primary_text(rText); }
};
#endif // INCLUDED_UUI_SOURCE_SSLWARNDLG_HXX
diff --git a/uui/source/trylater.hxx b/uui/source/trylater.hxx
index 26b1d6714b9c..8d1fbe62fd05 100644
--- a/uui/source/trylater.hxx
+++ b/uui/source/trylater.hxx
@@ -25,8 +25,10 @@ class TryLaterQueryBox
{
private:
std::unique_ptr<weld::MessageDialog> m_xQueryBox;
+
public:
- TryLaterQueryBox(weld::Window* pParent, const std::locale& rLocale, const OUString& aMessage, bool bEnableOverride);
+ TryLaterQueryBox(weld::Window* pParent, const std::locale& rLocale, const OUString& aMessage,
+ bool bEnableOverride);
short run() { return m_xQueryBox->run(); }
};
diff --git a/uui/source/unknownauthdlg.cxx b/uui/source/unknownauthdlg.cxx
index ca84be3717f9..9c96c7ba1dd4 100644
--- a/uui/source/unknownauthdlg.cxx
+++ b/uui/source/unknownauthdlg.cxx
@@ -23,7 +23,6 @@
using namespace css;
-
IMPL_LINK_NOARG(UnknownAuthDialog, OKHdl_Impl, weld::Button&, void)
{
if (m_xOptionButtonAccept->get_active())
@@ -38,17 +37,16 @@ IMPL_LINK_NOARG(UnknownAuthDialog, OKHdl_Impl, weld::Button&, void)
IMPL_LINK_NOARG(UnknownAuthDialog, ViewCertHdl_Impl, weld::Button&, void)
{
- uno::Reference< css::security::XDocumentDigitalSignatures > xDocumentDigitalSignatures(
- css::security::DocumentDigitalSignatures::createDefault(m_xContext) );
+ uno::Reference<css::security::XDocumentDigitalSignatures> xDocumentDigitalSignatures(
+ css::security::DocumentDigitalSignatures::createDefault(m_xContext));
xDocumentDigitalSignatures->setParentWindow(m_xDialog->GetXWindow());
xDocumentDigitalSignatures->showCertificate(m_rXCert);
}
-UnknownAuthDialog::UnknownAuthDialog(weld::Window* pParent,
- const css::uno::Reference< css::security::XCertificate >& rXCert,
- const css::uno::Reference< css::uno::XComponentContext >& xContext)
- : MessageDialogController(pParent, "uui/ui/unknownauthdialog.ui",
- "UnknownAuthDialog")
+UnknownAuthDialog::UnknownAuthDialog(
+ weld::Window* pParent, const css::uno::Reference<css::security::XCertificate>& rXCert,
+ const css::uno::Reference<css::uno::XComponentContext>& xContext)
+ : MessageDialogController(pParent, "uui/ui/unknownauthdialog.ui", "UnknownAuthDialog")
, m_xCommandButtonOK(m_xBuilder->weld_button("ok"))
, m_xView_Certificate(m_xBuilder->weld_button("examine"))
, m_xOptionButtonAccept(m_xBuilder->weld_radio_button("accept"))