Kaydet (Commit) d36ccd2a authored tarafından Noel Grandin's avatar Noel Grandin

use unique_ptr for mpControlFont

Change-Id: I71eed3254cf073b754c1a634315e6e739a816606
Reviewed-on: https://gerrit.libreoffice.org/42264Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst de12ff18
......@@ -235,7 +235,8 @@ public:
Pointer maPointer;
Fraction maZoom;
OUString maText;
vcl::Font* mpControlFont;
std::unique_ptr<vcl::Font>
mpControlFont;
Color maControlForeground;
Color maControlBackground;
sal_Int32 mnLeftBorder;
......
......@@ -617,7 +617,6 @@ WindowImpl::WindowImpl( WindowType nType )
mnEventListenersIteratingCount = 0;
mnChildEventListenersIteratingCount = 0;
mpCursor = nullptr; // cursor
mpControlFont = nullptr; // font properties
mpVCLXWindow = nullptr;
mpAccessibleInfos = nullptr;
maControlForeground = Color( COL_TRANSPARENT ); // no foreground set
......@@ -743,7 +742,6 @@ WindowImpl::~WindowImpl()
{
delete mpChildClipRegion;
delete mpAccessibleInfos;
delete mpControlFont;
}
ImplWinData::ImplWinData() :
......
......@@ -475,8 +475,7 @@ void Window::SetControlFont()
{
if (mpWindowImpl && mpWindowImpl->mpControlFont)
{
delete mpWindowImpl->mpControlFont;
mpWindowImpl->mpControlFont = nullptr;
mpWindowImpl->mpControlFont.reset();
CompatStateChanged(StateChangedType::ControlFont);
}
}
......@@ -496,7 +495,7 @@ void Window::SetControlFont(const vcl::Font& rFont)
*mpWindowImpl->mpControlFont = rFont;
}
else
mpWindowImpl->mpControlFont = new vcl::Font(rFont);
mpWindowImpl->mpControlFont.reset( new vcl::Font(rFont) );
CompatStateChanged(StateChangedType::ControlFont);
}
......@@ -1110,7 +1109,7 @@ const InputContext& Window::GetInputContext() const
bool Window::IsControlFont() const
{
return (mpWindowImpl->mpControlFont != nullptr);
return bool(mpWindowImpl->mpControlFont);
}
const Color& Window::GetControlForeground() const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment