summaryrefslogtreecommitdiff
path: root/vcl/source/app
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/app')
-rw-r--r--vcl/source/app/help.cxx8
-rw-r--r--vcl/source/app/salvtables.cxx25
-rw-r--r--vcl/source/app/svapp.cxx18
-rw-r--r--vcl/source/app/svdata.cxx1
-rw-r--r--vcl/source/app/svmain.cxx1
-rw-r--r--vcl/source/app/weldutils.cxx6
6 files changed, 30 insertions, 29 deletions
diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx
index b630bc086aee..662cfa26ac6b 100644
--- a/vcl/source/app/help.cxx
+++ b/vcl/source/app/help.cxx
@@ -264,9 +264,9 @@ HelpTextWindow::HelpTextWindow( vcl::Window* pParent, const OUString& rText, sal
if( mnStyle & QuickHelpFlags::BiDiRtl )
{
- ComplexTextLayoutFlags nLayoutMode = GetLayoutMode();
+ ComplexTextLayoutFlags nLayoutMode = GetOutDev()->GetLayoutMode();
nLayoutMode |= ComplexTextLayoutFlags::BiDiRtl | ComplexTextLayoutFlags::TextOriginLeft;
- SetLayoutMode( nLayoutMode );
+ GetOutDev()->SetLayoutMode( nLayoutMode );
}
SetHelpText( rText );
Window::SetHelpText( rText );
@@ -326,13 +326,13 @@ void HelpTextWindow::dispose()
void HelpTextWindow::SetHelpText( const OUString& rHelpText )
{
maHelpText = rHelpText;
- ApplySettings(*this);
+ ApplySettings(*GetOutDev());
if ( mnHelpWinStyle == HELPWINSTYLE_QUICK && maHelpText.getLength() < HELPTEXTMAXLEN && maHelpText.indexOf('\n') < 0)
{
Size aSize;
aSize.setHeight( GetTextHeight() );
if ( mnStyle & QuickHelpFlags::CtrlText )
- aSize.setWidth( GetCtrlTextWidth( maHelpText ) );
+ aSize.setWidth( GetOutDev()->GetCtrlTextWidth( maHelpText ) );
else
aSize.setWidth( GetTextWidth( maHelpText ) );
maTextRect = tools::Rectangle( Point( HELPTEXTMARGIN_QUICK, HELPTEXTMARGIN_QUICK ), aSize );
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 20ad4154d23f..813d74470139 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -321,7 +321,7 @@ Size SalInstanceWidget::get_pixel_size(const OUString& rText) const
return Size(m_xWidget->GetTextWidth(rText), m_xWidget->GetTextHeight());
}
-vcl::Font SalInstanceWidget::get_font() { return m_xWidget->GetPointFont(*m_xWidget); }
+vcl::Font SalInstanceWidget::get_font() { return m_xWidget->GetPointFont(*m_xWidget->GetOutDev()); }
OString SalInstanceWidget::get_buildable_name() const { return m_xWidget->get_id().toUtf8(); }
@@ -1251,7 +1251,7 @@ std::unique_ptr<weld::Container> SalInstanceWidget::weld_parent() const
void SalInstanceWidget::DoRecursivePaint(vcl::Window* pWindow, const Point& rRenderLogicPos,
OutputDevice& rOutput)
{
- pWindow->Push();
+ rOutput.Push();
bool bOldMapModeEnabled = pWindow->IsMapModeEnabled();
if (pWindow->GetMapMode().GetMapUnit() != rOutput.GetMapMode().GetMapUnit())
@@ -1297,7 +1297,7 @@ void SalInstanceWidget::DoRecursivePaint(vcl::Window* pWindow, const Point& rRen
xOutput.disposeAndClear();
pWindow->EnableMapMode(bOldMapModeEnabled);
- pWindow->Pop();
+ rOutput.Pop();
for (vcl::Window* pChild = pWindow->GetWindow(GetWindowType::FirstChild); pChild;
pChild = pChild->GetWindow(GetWindowType::Next))
@@ -3303,7 +3303,7 @@ void SalInstanceEntry::set_message_type(weld::EntryMessageType eType)
void SalInstanceEntry::set_font(const vcl::Font& rFont)
{
- m_xEntry->SetPointFont(*m_xEntry, rFont);
+ m_xEntry->SetPointFont(*m_xEntry->GetOutDev(), rFont);
m_xEntry->Invalidate();
}
@@ -5765,8 +5765,9 @@ void SalInstanceTextView::set_monospace(bool bMonospace)
vcl::Font aOrigFont = m_xTextView->GetControlFont();
vcl::Font aFont;
if (bMonospace)
- aFont = OutputDevice::GetDefaultFont(DefaultFontType::UI_FIXED, LANGUAGE_DONTKNOW,
- GetDefaultFontFlags::OnlyOne, m_xTextView);
+ aFont
+ = OutputDevice::GetDefaultFont(DefaultFontType::UI_FIXED, LANGUAGE_DONTKNOW,
+ GetDefaultFontFlags::OnlyOne, m_xTextView->GetOutDev());
else
aFont = Application::GetSettings().GetStyleSettings().GetFieldFont();
aFont.SetFontHeight(aOrigFont.GetFontHeight());
@@ -6062,7 +6063,7 @@ SalInstanceDrawingArea::~SalInstanceDrawingArea()
Link<std::pair<vcl::RenderContext&, const tools::Rectangle&>, void>());
}
-OutputDevice& SalInstanceDrawingArea::get_ref_device() { return *m_xDrawingArea; }
+OutputDevice& SalInstanceDrawingArea::get_ref_device() { return *m_xDrawingArea->GetOutDev(); }
void SalInstanceDrawingArea::click(const Point& rPos)
{
@@ -6384,7 +6385,7 @@ void SalInstanceComboBoxWithEdit::set_entry_font(const vcl::Font& rFont)
{
Edit* pEdit = m_xComboBox->GetSubEdit();
assert(pEdit);
- pEdit->SetPointFont(*pEdit, rFont);
+ pEdit->SetPointFont(*pEdit->GetOutDev(), rFont);
m_xComboBox->SetControlFont(rFont); // tdf#134601 set it as control font to take effect properly
pEdit->Invalidate();
}
@@ -6393,7 +6394,7 @@ vcl::Font SalInstanceComboBoxWithEdit::get_entry_font()
{
Edit* pEdit = m_xComboBox->GetSubEdit();
assert(pEdit);
- return pEdit->GetPointFont(*pEdit);
+ return pEdit->GetPointFont(*pEdit->GetOutDev());
}
void SalInstanceComboBoxWithEdit::set_custom_renderer(bool bOn)
@@ -6438,7 +6439,7 @@ void SalInstanceComboBoxWithEdit::HandleEventListener(VclWindowEvent& rEvent)
{
if (rEvent.GetId() == VclEventId::DropdownPreOpen)
{
- Size aRowSize(signal_custom_get_size(*m_xComboBox));
+ Size aRowSize(signal_custom_get_size(*m_xComboBox->GetOutDev()));
m_xComboBox->SetUserItemSize(aRowSize);
}
CallHandleEventListener(rEvent);
@@ -6520,14 +6521,14 @@ public:
virtual void set_entry_font(const vcl::Font& rFont) override
{
Edit& rEntry = m_pEntry->getEntry();
- rEntry.SetPointFont(rEntry, rFont);
+ rEntry.SetPointFont(*rEntry.GetOutDev(), rFont);
rEntry.Invalidate();
}
virtual vcl::Font get_entry_font() override
{
Edit& rEntry = m_pEntry->getEntry();
- return rEntry.GetPointFont(rEntry);
+ return rEntry.GetPointFont(*rEntry.GetOutDev());
}
virtual void set_entry_placeholder_text(const OUString& rText) override
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 963a2a2f9457..0e74c7b8ee7e 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -670,8 +670,8 @@ void Application::SetSettings( const AllSettings& rSettings )
tools::Long nOldDPIY = 0;
if ( pFirstFrame )
{
- nOldDPIX = pFirstFrame->GetDPIX();
- nOldDPIY = pFirstFrame->GetDPIY();
+ nOldDPIX = pFirstFrame->GetOutDev()->GetDPIX();
+ nOldDPIY = pFirstFrame->GetOutDev()->GetDPIY();
vcl::Window::ImplInitAppFontData(pFirstFrame);
}
vcl::Window* pFrame = pFirstFrame;
@@ -702,8 +702,8 @@ void Application::SetSettings( const AllSettings& rSettings )
pFirstFrame = pSVData->maFrameData.mpFirstFrame;
if ( pFirstFrame )
{
- if ( (pFirstFrame->GetDPIX() != nOldDPIX) ||
- (pFirstFrame->GetDPIY() != nOldDPIY) )
+ if ( (pFirstFrame->GetOutDev()->GetDPIX() != nOldDPIX) ||
+ (pFirstFrame->GetOutDev()->GetDPIY() != nOldDPIY) )
{
VirtualDevice* pVirDev = pSVData->maGDIData.mpFirstVirDev;
while ( pVirDev )
@@ -712,8 +712,8 @@ void Application::SetSettings( const AllSettings& rSettings )
(pVirDev->GetDPIX() == nOldDPIX) &&
(pVirDev->GetDPIY() == nOldDPIY) )
{
- pVirDev->SetDPIX( pFirstFrame->GetDPIX() );
- pVirDev->SetDPIY( pFirstFrame->GetDPIY() );
+ pVirDev->SetDPIX( pFirstFrame->GetOutDev()->GetDPIX() );
+ pVirDev->SetDPIY( pFirstFrame->GetOutDev()->GetDPIY() );
if ( pVirDev->IsMapModeEnabled() )
{
MapMode aMapMode = pVirDev->GetMapMode();
@@ -1037,10 +1037,6 @@ ImplSVEvent * Application::PostUserEvent( const Link<void*,void>& rLink, void* p
if (bReferenceLink)
{
SolarMutexGuard aGuard;
- // Double check that this is indeed a vcl::Window instance.
- assert(dynamic_cast<vcl::Window *>(
- static_cast<OutputDevice *>(rLink.GetInstance())) ==
- static_cast<vcl::Window *>(rLink.GetInstance()));
pSVEvent->mpInstanceRef = static_cast<vcl::Window *>(rLink.GetInstance());
}
@@ -1072,7 +1068,7 @@ vcl::Window* Application::GetFocusWindow()
OutputDevice* Application::GetDefaultDevice()
{
- return ImplGetDefaultWindow();
+ return ImplGetDefaultWindow()->GetOutDev();
}
vcl::Window* Application::GetFirstTopLevelWindow()
diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx
index a0a52b91e591..ba5fce26278a 100644
--- a/vcl/source/app/svdata.cxx
+++ b/vcl/source/app/svdata.cxx
@@ -44,6 +44,7 @@
#include <salgdi.hxx>
#include <svdata.hxx>
#include <salsys.hxx>
+#include <windowdev.hxx>
#include <units.hrc>
#include <print.h>
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index 7eb83ab10ecf..d5a305103faa 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -51,6 +51,7 @@
#include <vcl/print.hxx>
#include <debugevent.hxx>
#include <scrwnd.hxx>
+#include <windowdev.hxx>
#ifdef _WIN32
#include <svsys.h>
diff --git a/vcl/source/app/weldutils.cxx b/vcl/source/app/weldutils.cxx
index b35121b78850..e9d557430b42 100644
--- a/vcl/source/app/weldutils.cxx
+++ b/vcl/source/app/weldutils.cxx
@@ -615,8 +615,10 @@ weld::Window* GetPopupParent(vcl::Window& rOutWin, tools::Rectangle& rRect)
void SetPointFont(OutputDevice& rDevice, const vcl::Font& rFont)
{
- if (vcl::Window* pDefaultDevice = dynamic_cast<vcl::Window*>(Application::GetDefaultDevice()))
- pDefaultDevice->SetPointFont(rDevice, rFont);
+ auto pDefaultDevice = Application::GetDefaultDevice();
+ if (pDefaultDevice)
+ if (vcl::Window* pDefaultWindow = pDefaultDevice->GetOwnerWindow())
+ pDefaultWindow->SetPointFont(rDevice, rFont);
}
}