Convert ImplWindowStateFromStr to WindowData(str)

To have a constructor as the counterpart of the toStr() function.
Better then some unrelated independant function.

Change-Id: Iba4cb3d400a92704753db6b35d12f2189b23077e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135807
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
This commit is contained in:
Jan-Marek Glogowski 2022-06-12 17:42:05 +02:00
parent 5e0b954940
commit 2e509b886f
4 changed files with 5 additions and 10 deletions

View file

@ -80,6 +80,7 @@ public:
, mnMaximizedHeight(0)
{
}
WindowData(std::string_view rStr);
// serialize values to a string (the original WindowState representation)
OString toStr() const;

View file

@ -433,8 +433,6 @@ bool ImplLOKHandleMouseEvent( const VclPtr<vcl::Window>& xWindow, MouseNotifyEve
void ImplHandleResize( vcl::Window* pWindow, tools::Long nNewWidth, tools::Long nNewHeight );
VCL_DLLPUBLIC void ImplWindowStateFromStr(vcl::WindowData& rData, std::string_view rStr);
VCL_DLLPUBLIC css::uno::Reference<css::accessibility::XAccessibleEditableText>
FindFocusedEditableText(css::uno::Reference<css::accessibility::XAccessibleContext> const&);

View file

@ -399,8 +399,9 @@ const Size& SystemWindow::GetMaxOutputSizePixel() const
return mpImplData->maMaxOutSize;
}
void ImplWindowStateFromStr(vcl::WindowData& rData, std::string_view rStr)
vcl::WindowData::WindowData(std::string_view rStr)
{
vcl::WindowData& rData = *this;
vcl::WindowDataMask nValidMask = vcl::WindowDataMask::NONE;
sal_Int32 nIndex = 0;
@ -826,10 +827,7 @@ void SystemWindow::SetWindowState(std::string_view rStr)
{
if (rStr.empty())
return;
vcl::WindowData aData;
ImplWindowStateFromStr( aData, rStr );
SetWindowState( aData );
SetWindowState(vcl::WindowData(rStr));
}
OString SystemWindow::GetWindowState(vcl::WindowDataMask nMask) const

View file

@ -6334,9 +6334,7 @@ public:
virtual void set_window_state(const OString& rStr) override
{
vcl::WindowData aData;
ImplWindowStateFromStr( aData, rStr );
const vcl::WindowData aData(rStr);
const auto nMask = aData.mask();
const auto nState = aData.state() & vcl::WindowState::SystemMask;