summaryrefslogtreecommitdiff
path: root/vcl/source/gdi
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/gdi')
-rw-r--r--vcl/source/gdi/outdevnative.cxx54
-rw-r--r--vcl/source/gdi/salgdilayout.cxx35
2 files changed, 70 insertions, 19 deletions
diff --git a/vcl/source/gdi/outdevnative.cxx b/vcl/source/gdi/outdevnative.cxx
index 50c2ac0540c6..f37417ebeca2 100644
--- a/vcl/source/gdi/outdevnative.cxx
+++ b/vcl/source/gdi/outdevnative.cxx
@@ -63,38 +63,92 @@ ImplControlValue::~ImplControlValue()
{
}
+ImplControlValue* ImplControlValue::clone() const
+{
+ assert( typeid( const ImplControlValue ) == typeid( *this ));
+ return new ImplControlValue( *this );
+}
+
ScrollbarValue::~ScrollbarValue()
{
}
+ScrollbarValue* ScrollbarValue::clone() const
+{
+ assert( typeid( const ScrollbarValue ) == typeid( *this ));
+ return new ScrollbarValue( *this );
+}
+
SliderValue::~SliderValue()
{
}
+SliderValue* SliderValue::clone() const
+{
+ assert( typeid( const SliderValue ) == typeid( *this ));
+ return new SliderValue( *this );
+}
+
TabitemValue::~TabitemValue()
{
}
+TabitemValue* TabitemValue::clone() const
+{
+ assert( typeid( const TabitemValue ) == typeid( *this ));
+ return new TabitemValue( *this );
+}
+
SpinbuttonValue::~SpinbuttonValue()
{
}
+SpinbuttonValue* SpinbuttonValue::clone() const
+{
+ assert( typeid( const SpinbuttonValue ) == typeid( *this ));
+ return new SpinbuttonValue( *this );
+}
+
ToolbarValue::~ToolbarValue()
{
}
+ToolbarValue* ToolbarValue::clone() const
+{
+ assert( typeid( const ToolbarValue ) == typeid( *this ));
+ return new ToolbarValue( *this );
+}
+
MenubarValue::~MenubarValue()
{
}
+MenubarValue* MenubarValue::clone() const
+{
+ assert( typeid( const MenubarValue ) == typeid( *this ));
+ return new MenubarValue( *this );
+}
+
MenupopupValue::~MenupopupValue()
{
}
+MenupopupValue* MenupopupValue::clone() const
+{
+ assert( typeid( const MenupopupValue ) == typeid( *this ));
+ return new MenupopupValue( *this );
+}
+
PushButtonValue::~PushButtonValue()
{
}
+PushButtonValue* PushButtonValue::clone() const
+{
+ assert( typeid( const PushButtonValue ) == typeid( *this ));
+ return new PushButtonValue( *this );
+}
+
// -----------------------------------------------------------------------
// These functions are mainly passthrough functions that allow access to
// the SalFrame behind a Window object for native widget rendering purposes.
diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx
index 1e0d25683848..e38838087fea 100644
--- a/vcl/source/gdi/salgdilayout.cxx
+++ b/vcl/source/gdi/salgdilayout.cxx
@@ -51,6 +51,7 @@
#include <svdata.hxx>
#include <outdata.hxx>
+#include <boost/scoped_ptr.hpp>
#include "basegfx/polygon/b2dpolygon.hxx"
@@ -691,19 +692,19 @@ sal_Bool SalGraphics::HitTestNativeControl( ControlType nType, ControlPart nPart
return hitTestNativeControl( nType, nPart, rControlRegion, aPos, rIsInside );
}
-void SalGraphics::mirror( ControlType , const ImplControlValue& rVal, const OutputDevice* pOutDev, bool bBack ) const
+void SalGraphics::mirror( ImplControlValue& rVal, const OutputDevice* pOutDev, bool bBack ) const
{
switch( rVal.getType() )
{
case CTRL_SLIDER:
{
- SliderValue* pSlVal = static_cast<SliderValue*>(const_cast<ImplControlValue*>(&rVal));
+ SliderValue* pSlVal = static_cast<SliderValue*>(&rVal);
mirror(pSlVal->maThumbRect,pOutDev,bBack);
}
break;
case CTRL_SCROLLBAR:
{
- ScrollbarValue* pScVal = static_cast<ScrollbarValue*>(const_cast<ImplControlValue*>(&rVal));
+ ScrollbarValue* pScVal = static_cast<ScrollbarValue*>(&rVal);
mirror(pScVal->maThumbRect,pOutDev,bBack);
mirror(pScVal->maButton1Rect,pOutDev,bBack);
mirror(pScVal->maButton2Rect,pOutDev,bBack);
@@ -712,14 +713,14 @@ void SalGraphics::mirror( ControlType , const ImplControlValue& rVal, const Outp
case CTRL_SPINBOX:
case CTRL_SPINBUTTONS:
{
- SpinbuttonValue* pSpVal = static_cast<SpinbuttonValue*>(const_cast<ImplControlValue*>(&rVal));
+ SpinbuttonValue* pSpVal = static_cast<SpinbuttonValue*>(&rVal);
mirror(pSpVal->maUpperRect,pOutDev,bBack);
mirror(pSpVal->maLowerRect,pOutDev,bBack);
}
break;
case CTRL_TOOLBAR:
{
- ToolbarValue* pTVal = static_cast<ToolbarValue*>(const_cast<ImplControlValue*>(&rVal));
+ ToolbarValue* pTVal = static_cast<ToolbarValue*>(&rVal);
mirror(pTVal->maGripRect,pOutDev,bBack);
}
break;
@@ -734,9 +735,9 @@ sal_Bool SalGraphics::DrawNativeControl( ControlType nType, ControlPart nPart, c
{
Rectangle rgn( rControlRegion );
mirror( rgn, pOutDev );
- mirror( nType, aValue, pOutDev );
- sal_Bool bRet = drawNativeControl( nType, nPart, rgn, nState, aValue, aCaption );
- mirror( nType, aValue, pOutDev, true );
+ boost::scoped_ptr< ImplControlValue > mirrorValue( aValue.clone());
+ mirror( *mirrorValue, pOutDev );
+ sal_Bool bRet = drawNativeControl( nType, nPart, rgn, nState, *mirrorValue, aCaption );
return bRet;
}
else
@@ -751,9 +752,9 @@ sal_Bool SalGraphics::DrawNativeControlText( ControlType nType, ControlPart nPar
{
Rectangle rgn( rControlRegion );
mirror( rgn, pOutDev );
- mirror( nType, aValue, pOutDev );
- sal_Bool bRet = drawNativeControlText( nType, nPart, rgn, nState, aValue, aCaption );
- mirror( nType, aValue, pOutDev, true );
+ boost::scoped_ptr< ImplControlValue > mirrorValue( aValue.clone());
+ mirror( *mirrorValue, pOutDev );
+ sal_Bool bRet = drawNativeControlText( nType, nPart, rgn, nState, *mirrorValue, aCaption );
return bRet;
}
else
@@ -768,20 +769,16 @@ sal_Bool SalGraphics::GetNativeControlRegion( ControlType nType, ControlPart nPa
{
Rectangle rgn( rControlRegion );
mirror( rgn, pOutDev );
- mirror( nType, aValue, pOutDev );
- if( getNativeControlRegion( nType, nPart, rgn, nState, aValue, aCaption,
+ boost::scoped_ptr< ImplControlValue > mirrorValue( aValue.clone());
+ mirror( *mirrorValue, pOutDev );
+ if( getNativeControlRegion( nType, nPart, rgn, nState, *mirrorValue, aCaption,
rNativeBoundingRegion, rNativeContentRegion ) )
{
mirror( rNativeBoundingRegion, pOutDev, true );
mirror( rNativeContentRegion, pOutDev, true );
- mirror( nType, aValue, pOutDev, true );
return sal_True;
}
- else
- {
- mirror( nType, aValue, pOutDev, true );
- return sal_False;
- }
+ return sal_False;
}
else
return getNativeControlRegion( nType, nPart, rControlRegion, nState, aValue, aCaption,