Files
Michael Weghorn 309e600a5b vcl: Deduplicate logic to get msg dialog title for VclMessageType
Both, MessageDialog::MessageDialog and
vclMessageTypeToQtTitle declared in QtTools.hxx
implement the same logic to return some string
to use as a dialog title for a certain VclMessageType.

Deduplicate by introducing a new
GetStandardMessageDialogText helper function,
using it from both places and dropping the two
other implementations.

Change-Id: Ic30cc73a611778d180683fbb5634eb6153470699
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201378
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-03-12 07:33:16 +01:00

56 lines
1.9 KiB
C++

/* -*- 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 .
*/
#ifndef INCLUDED_VCL_STDTEXT_HXX
#define INCLUDED_VCL_STDTEXT_HXX
#include <sal/config.h>
#include <string_view>
#include <rtl/ustring.hxx>
#include <vcl/dllapi.h>
#include <vcl/vclenum.hxx>
class Image;
namespace weld { class Widget; }
enum class StandardButtonType;
void VCL_DLLPUBLIC ShowServiceNotAvailableError(weld::Widget* pParent, std::u16string_view rServiceName, bool bError);
OUString VCL_DLLPUBLIC GetStandardText(StandardButtonType eButton);
VCL_DLLPUBLIC Image const & GetStandardInfoBoxImage();
VCL_DLLPUBLIC OUString GetStandardInfoBoxText();
VCL_DLLPUBLIC Image const & GetStandardWarningBoxImage();
VCL_DLLPUBLIC OUString GetStandardWarningBoxText();
VCL_DLLPUBLIC Image const & GetStandardErrorBoxImage();
VCL_DLLPUBLIC OUString GetStandardErrorBoxText();
VCL_DLLPUBLIC Image const & GetStandardQueryBoxImage();
VCL_DLLPUBLIC OUString GetStandardQueryBoxText();
VCL_DLLPUBLIC OUString GetStandardMessageDialogText(VclMessageType eType);
#endif // INCLUDED_VCL_STDTEXT_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */