diff --git a/include/vcl/vclenum.hxx b/include/vcl/vclenum.hxx index f1938105a996..8d37156a3eec 100644 --- a/include/vcl/vclenum.hxx +++ b/include/vcl/vclenum.hxx @@ -111,11 +111,14 @@ enum class WindowBorderStyle : sal_Int16 MENU = 0x0010, NWF = 0x0020, NOBORDER = 0x1000, - REMOVEBORDER = 0x2000 + REMOVEBORDER = 0x2000, + // Never use native border, used to ensure consistency of form controls + // inside documents across platforms and in pdf/print output + NONATIVEBORDER = 0x4000, }; namespace o3tl { - template<> struct typed_flags : is_typed_flags {}; + template<> struct typed_flags : is_typed_flags {}; } enum class TimeFormat diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx index b13ffa02d20f..1065ca2f14ac 100644 --- a/toolkit/source/controls/unocontrol.cxx +++ b/toolkit/source/controls/unocontrol.cxx @@ -1292,6 +1292,11 @@ void UnoControl::createPeer( const Reference< XToolkit >& rxToolkit, const Refer if (bUseStandardTheme) { VclPtr pVclPeer = VCLUnoHelper::GetWindow(getPeer()); + + WindowBorderStyle nStyle = pVclPeer->GetBorderStyle(); + nStyle |= WindowBorderStyle::NONATIVEBORDER; + pVclPeer->SetBorderStyle(nStyle); + AllSettings aAllSettings = pVclPeer->GetSettings(); StyleSettings aStyleSettings = aAllSettings.GetStyleSettings(); aStyleSettings.SetStandardStyles(); diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx index fb7c3a1b2db4..8429ee33b52d 100644 --- a/vcl/source/window/brdwin.cxx +++ b/vcl/source/window/brdwin.cxx @@ -428,7 +428,7 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, tools::Long nWidth, to // control this border belongs to ControlType aCtrlType = ControlType::Generic; ControlPart aCtrlPart = ControlPart::Entire; - if (pCtrl) + if (pCtrl && !(pCtrl->GetBorderStyle() & WindowBorderStyle::NONATIVEBORDER)) { switch( pCtrl->GetType() ) {