summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorCaolán McNamara <cmc@openoffice.org>2010-08-03 10:25:58 +0100
committerCaolán McNamara <cmc@openoffice.org>2010-08-03 10:25:58 +0100
commit3833427a35230616627fe633d34edcd314581e6a (patch)
tree530222e2d51a940322dc4bab65444e555bfe667b /svtools
parent6b16723121bffd8ebf9b8e688af5457235f687ef (diff)
parentdeee1f03fb16af83c642121a5682af3398d90ece (diff)
cmcfixes77: merge with DEV300 m86
Diffstat (limited to 'svtools')
-rw-r--r--svtools/inc/svtools/svlbitm.hxx2
-rw-r--r--svtools/source/contnr/svimpbox.cxx14
-rw-r--r--svtools/source/contnr/svlbitm.cxx51
-rw-r--r--svtools/source/contnr/svtreebx.cxx2
-rw-r--r--svtools/source/control/toolbarmenu.cxx23
-rw-r--r--svtools/source/filter.vcl/wmf/winmtf.cxx2
-rw-r--r--svtools/source/inc/unoiface.hxx5
-rwxr-xr-xsvtools/source/toolpanel/paneltabbar.cxx10
-rw-r--r--svtools/source/uno/toolboxcontroller.cxx2
-rw-r--r--svtools/source/uno/unoiface.cxx2
-rw-r--r--svtools/source/uno/unoimap.cxx4
11 files changed, 76 insertions, 41 deletions
diff --git a/svtools/inc/svtools/svlbitm.hxx b/svtools/inc/svtools/svlbitm.hxx
index c28b8d5db10c..5158c38fbd87 100644
--- a/svtools/inc/svtools/svlbitm.hxx
+++ b/svtools/inc/svtools/svlbitm.hxx
@@ -176,6 +176,8 @@ class SVT_DLLPUBLIC SvLBoxButton : public SvLBoxItem
USHORT nItemFlags;
USHORT nImgArrOffs;
USHORT nBaseOffs;
+
+ void ImplAdjustBoxSize( Size& io_rCtrlSize, ControlType i_eType, Window* pParent );
public:
// An SvLBoxButton can be of three different kinds: an
// enabled checkbox (the normal kind), a disabled checkbox
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
index 7111a29a6a8a..484584828b9f 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -1067,14 +1067,14 @@ void SvImpLBox::DrawNet()
//so that SvImpLBox::DrawNet() doesn't draw anything too
if(pView->IsNativeControlSupported( CTRL_LISTNET, PART_ENTIRE_CONTROL)) {
ImplControlValue aControlValue;
- Point aTemp(0,0); // temporary needed for g++ 3.3.5
- Region aCtrlRegion( Rectangle(aTemp, Size( 0, 0 )) );
+ Point aTemp(0,0); // temporary needed for g++ 3.3.5
+ Rectangle aCtrlRegion( aTemp, Size( 0, 0 ) );
ControlState nState = CTRL_STATE_ENABLED;
- if( pView->DrawNativeControl( CTRL_LISTNET, PART_ENTIRE_CONTROL,
- aCtrlRegion, nState, aControlValue, rtl::OUString() ) )
- {
- return;
- }
+ if( pView->DrawNativeControl( CTRL_LISTNET, PART_ENTIRE_CONTROL,
+ aCtrlRegion, nState, aControlValue, rtl::OUString() ) )
+ {
+ return;
+ }
}
diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx
index 82321b53259e..d260f984c2b0 100644
--- a/svtools/source/contnr/svlbitm.cxx
+++ b/svtools/source/contnr/svlbitm.cxx
@@ -406,7 +406,7 @@ BOOL SvLBoxButton::ClickHdl( SvLBox*, SvLBoxEntry* pEntry )
}
void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */,
- SvLBoxEntry* )
+ SvLBoxEntry* /*pEntry*/ )
{
DBG_CHKTHIS(SvLBoxButton,0);
USHORT nIndex = eKind == SvLBoxButtonKind_staticImage
@@ -418,14 +418,13 @@ void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */,
//Native drawing
///
BOOL bNativeOK = FALSE;
- Window *pWin = NULL;
- if( rDev.GetOutDevType() == OUTDEV_WINDOW )
- pWin = (Window*) &rDev;
-
- if ( nIndex != SV_BMP_STATICIMAGE && pWin && pWin->IsNativeControlSupported( (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX, PART_ENTIRE_CONTROL) )
+ ControlType eCtrlType = (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX;
+ if ( nIndex != SV_BMP_STATICIMAGE && rDev.IsNativeControlSupported( eCtrlType, PART_ENTIRE_CONTROL) )
{
+ Size aSize(pData->Width(), pData->Height());
+ ImplAdjustBoxSize( aSize, eCtrlType, &rDev );
ImplControlValue aControlValue;
- Region aCtrlRegion( Rectangle(rPos, Size(pData->Width(), pData->Height())) );
+ Rectangle aCtrlRegion( rPos, aSize );
ControlState nState = 0;
//states CTRL_STATE_DEFAULT, CTRL_STATE_PRESSED and CTRL_STATE_ROLLOVER are not implemented
@@ -439,7 +438,7 @@ void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */,
else if ( IsStateTristate() )
aControlValue.setTristateVal( BUTTONVALUE_MIXED );
- bNativeOK = pWin->DrawNativeControl( (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX, PART_ENTIRE_CONTROL,
+ bNativeOK = rDev.DrawNativeControl( eCtrlType, PART_ENTIRE_CONTROL,
aCtrlRegion, nState, aControlValue, rtl::OUString() );
}
@@ -459,13 +458,47 @@ void SvLBoxButton::Clone( SvLBoxItem* pSource )
pData = ((SvLBoxButton*)pSource)->pData;
}
+void SvLBoxButton::ImplAdjustBoxSize( Size& io_rSize, ControlType i_eType, Window* i_pParent )
+{
+ if ( i_pParent->IsNativeControlSupported( i_eType, PART_ENTIRE_CONTROL) )
+ {
+ ImplControlValue aControlValue;
+ Rectangle aCtrlRegion( Point( 0, 0 ), io_rSize );
+ ControlState nState = CTRL_STATE_ENABLED;
+
+ aControlValue.setTristateVal( BUTTONVALUE_ON );
+
+ Rectangle aNativeBounds, aNativeContent;
+ bool bNativeOK = i_pParent->GetNativeControlRegion( i_eType,
+ PART_ENTIRE_CONTROL,
+ aCtrlRegion,
+ nState,
+ aControlValue,
+ rtl::OUString(),
+ aNativeBounds,
+ aNativeContent );
+ if( bNativeOK )
+ {
+ Size aContentSize( aNativeContent.GetSize() );
+ // leave a little space around the box image (looks better
+ if( aContentSize.Height() + 2 > io_rSize.Height() )
+ io_rSize.Height() = aContentSize.Height() + 2;
+ }
+ }
+}
+
void SvLBoxButton::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry,
SvViewDataItem* pViewData )
{
DBG_CHKTHIS(SvLBoxButton,0);
if( !pViewData )
pViewData = pView->GetViewDataItem( pEntry, this );
- pViewData->aSize = Size( pData->Width(), pData->Height() );
+ Size aSize( pData->Width(), pData->Height() );
+
+ ControlType eCtrlType = (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX;
+ if ( eKind != SvLBoxButtonKind_staticImage && pView )
+ ImplAdjustBoxSize( aSize, eCtrlType, pView );
+ pViewData->aSize = aSize;
}
bool SvLBoxButton::CheckModification() const
diff --git a/svtools/source/contnr/svtreebx.cxx b/svtools/source/contnr/svtreebx.cxx
index bf6e41f93f36..b11a3f12ddf3 100644
--- a/svtools/source/contnr/svtreebx.cxx
+++ b/svtools/source/contnr/svtreebx.cxx
@@ -1814,7 +1814,7 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags,
if ( IsNativeControlSupported( CTRL_LISTNODE, PART_ENTIRE_CONTROL) )
{
ImplControlValue aControlValue;
- Region aCtrlRegion( Rectangle(aPos, pImg->GetSizePixel() ) );
+ Rectangle aCtrlRegion( aPos, pImg->GetSizePixel() );
ControlState nState = 0;
if ( IsEnabled() ) nState |= CTRL_STATE_ENABLED;
diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx
index fa393da3d5a8..f0bd192fc02c 100644
--- a/svtools/source/control/toolbarmenu.cxx
+++ b/svtools/source/control/toolbarmenu.cxx
@@ -920,7 +920,7 @@ void ToolbarMenu::implHighlightEntry( int nHighlightEntry, bool bHighlight )
IntersectClipRegion( Rectangle( Point( nX, nY ), Size( aSz.Width(), pEntry->maSize.Height() ) ) );
Rectangle aCtrlRect( Point( nX, 0 ), Size( aPxSize.Width()-nX, aPxSize.Height() ) );
DrawNativeControl( CTRL_MENU_POPUP, PART_ENTIRE_CONTROL,
- Region( aCtrlRect ),
+ aCtrlRect,
CTRL_STATE_ENABLED,
ImplControlValue(),
OUString() );
@@ -928,7 +928,7 @@ void ToolbarMenu::implHighlightEntry( int nHighlightEntry, bool bHighlight )
{
bDrawItemRect = false;
if( FALSE == DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_ITEM,
- Region( aItemRect ),
+ aItemRect,
CTRL_STATE_SELECTED | ( pEntry->mbEnabled? CTRL_STATE_ENABLED: 0 ),
ImplControlValue(),
OUString() ) )
@@ -1312,13 +1312,12 @@ static void ImplPaintCheckBackground( Window* i_pWindow, const Rectangle& i_rRec
if( i_pWindow->IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ) )
{
ImplControlValue aControlValue;
- Region aCtrlRegion( i_rRect );
ControlState nState = CTRL_STATE_PRESSED | CTRL_STATE_ENABLED;
aControlValue.setTristateVal( BUTTONVALUE_ON );
bNativeOk = i_pWindow->DrawNativeControl( CTRL_TOOLBAR, PART_BUTTON,
- aCtrlRegion, nState, aControlValue,
+ i_rRect, nState, aControlValue,
rtl::OUString() );
}
@@ -1335,10 +1334,10 @@ static long ImplGetNativeCheckAndRadioSize( Window* pWin, long& rCheckHeight, lo
rMaxWidth = rCheckHeight = rRadioHeight = 0;
ImplControlValue aVal;
- Region aNativeBounds;
- Region aNativeContent;
+ Rectangle aNativeBounds;
+ Rectangle aNativeContent;
Point tmp( 0, 0 );
- Region aCtrlRegion( Rectangle( tmp, Size( 100, 15 ) ) );
+ Rectangle aCtrlRegion( tmp, Size( 100, 15 ) );
if( pWin->IsNativeControlSupported( CTRL_MENU_POPUP, PART_MENU_ITEM_CHECK_MARK ) )
{
if( pWin->GetNativeControlRegion( ControlType(CTRL_MENU_POPUP),
@@ -1351,8 +1350,8 @@ static long ImplGetNativeCheckAndRadioSize( Window* pWin, long& rCheckHeight, lo
aNativeContent )
)
{
- rCheckHeight = aNativeBounds.GetBoundRect().GetHeight();
- rMaxWidth = aNativeContent.GetBoundRect().GetWidth();
+ rCheckHeight = aNativeBounds.GetHeight();
+ rMaxWidth = aNativeContent.GetWidth();
}
}
if( pWin->IsNativeControlSupported( CTRL_MENU_POPUP, PART_MENU_ITEM_RADIO_MARK ) )
@@ -1367,8 +1366,8 @@ static long ImplGetNativeCheckAndRadioSize( Window* pWin, long& rCheckHeight, lo
aNativeContent )
)
{
- rRadioHeight = aNativeBounds.GetBoundRect().GetHeight();
- rMaxWidth = Max (rMaxWidth, aNativeContent.GetBoundRect().GetWidth());
+ rRadioHeight = aNativeBounds.GetHeight();
+ rMaxWidth = Max (rMaxWidth, aNativeContent.GetWidth());
}
}
return (rCheckHeight > rRadioHeight) ? rCheckHeight : rRadioHeight;
@@ -1492,7 +1491,7 @@ void ToolbarMenu::implPaint( ToolbarMenuEntry* pThisOnly, bool bHighlighted )
aTmpPos.Y() = aOuterCheckRect.Top() + (aOuterCheckRect.GetHeight() - nCtrlHeight)/2;
Rectangle aCheckRect( aTmpPos, Size( nCtrlHeight, nCtrlHeight ) );
- DrawNativeControl( CTRL_MENU_POPUP, nPart, Region( aCheckRect ), nState, ImplControlValue(), OUString() );
+ DrawNativeControl( CTRL_MENU_POPUP, nPart, aCheckRect, nState, ImplControlValue(), OUString() );
}
else if ( pEntry->mbChecked ) // by default do nothing for unchecked items
{
diff --git a/svtools/source/filter.vcl/wmf/winmtf.cxx b/svtools/source/filter.vcl/wmf/winmtf.cxx
index bf176015fd77..787e6522b890 100644
--- a/svtools/source/filter.vcl/wmf/winmtf.cxx
+++ b/svtools/source/filter.vcl/wmf/winmtf.cxx
@@ -2043,7 +2043,7 @@ void WinMtfOutput::ModifyWorldTransform( const XForm& rXForm, UINT32 nMode )
case MWT_IDENTITY :
{
maXForm.eM11 = maXForm.eM12 = maXForm.eM21 = maXForm.eM22 = 1.0f;
- maXForm.eDx = maXForm.eDx = 0.0f;
+ maXForm.eDx = maXForm.eDy = 0.0f;
}
break;
diff --git a/svtools/source/inc/unoiface.hxx b/svtools/source/inc/unoiface.hxx
index 5d34ea6f47ed..f15cb7c10d4c 100644
--- a/svtools/source/inc/unoiface.hxx
+++ b/svtools/source/inc/unoiface.hxx
@@ -39,7 +39,6 @@
#include <com/sun/star/awt/XTextLayoutConstrains.hpp>
#include <svtools/svmedit.hxx>
#include <svtools/fmtfield.hxx>
-#include <com/sun/star/awt/XImageConsumer.hpp>
#include <comphelper/uno3.hxx>
@@ -243,7 +242,7 @@ struct RMItemData
::rtl::OUString Label;
};
-typedef ::cppu::ImplInheritanceHelper3 < VCLXImageConsumer
+typedef ::cppu::ImplInheritanceHelper3 < VCLXGraphicControl
, ::com::sun::star::container::XContainerListener
, ::com::sun::star::beans::XPropertyChangeListener
, ::com::sun::star::awt::XItemEventBroadcaster
@@ -288,7 +287,7 @@ public:
protected:
- // VCLXImageConsumer overridables
+ // VCLXGraphicControl overridables
virtual void ImplSetNewImage();
static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
diff --git a/svtools/source/toolpanel/paneltabbar.cxx b/svtools/source/toolpanel/paneltabbar.cxx
index 38aee00c8f55..23067d3ee5d0 100755
--- a/svtools/source/toolpanel/paneltabbar.cxx
+++ b/svtools/source/toolpanel/paneltabbar.cxx
@@ -296,19 +296,18 @@ namespace svt
const ControlState nState( lcl_ItemToControlState( i_nItemFlags ) );
TabitemValue tiValue;
- ImplControlValue aControlValue( (void*)(&tiValue) );
- Region aBoundingRegion, aContentRegion;
+ Rectangle aBoundingRegion, aContentRegion;
bool bNativeOK = getTargetDevice().GetNativeControlRegion(
CTRL_TAB_ITEM, PART_ENTIRE_CONTROL,
i_rContentArea, nState,
- aControlValue, ::rtl::OUString(),
+ tiValue, ::rtl::OUString(),
aBoundingRegion, aContentRegion
);
(void)bNativeOK;
OSL_ENSURE( bNativeOK, "NWFTabItemRenderer::calculateDecorations: GetNativeControlRegion not implemented for CTRL_TAB_ITEM?!" );
- return aBoundingRegion.GetBoundRect();
+ return aBoundingRegion;
}
//------------------------------------------------------------------------------------------------------------------
@@ -322,9 +321,8 @@ namespace svt
if ( i_nItemFlags & ITEM_POSITION_LAST )
tiValue.mnAlignment |= TABITEM_LAST_IN_GROUP;
- ImplControlValue aControlValue( (void *)(&tiValue) );
- bool bNativeOK = getTargetDevice().DrawNativeControl( CTRL_TAB_ITEM, PART_ENTIRE_CONTROL, i_rContentRect, nState, aControlValue, rtl::OUString() );
+ bool bNativeOK = getTargetDevice().DrawNativeControl( CTRL_TAB_ITEM, PART_ENTIRE_CONTROL, i_rContentRect, nState, tiValue, rtl::OUString() );
(void)bNativeOK;
OSL_ENSURE( bNativeOK, "NWFTabItemRenderer::preRenderItem: inconsistent NWF implementation!" );
// IsNativeControlSupported returned true, previously, otherwise we would not be here ...
diff --git a/svtools/source/uno/toolboxcontroller.cxx b/svtools/source/uno/toolboxcontroller.cxx
index 92ae93f5080d..bdb2256a07e8 100644
--- a/svtools/source/uno/toolboxcontroller.cxx
+++ b/svtools/source/uno/toolboxcontroller.cxx
@@ -806,7 +806,7 @@ sal_Bool SAL_CALL ToolboxController::convertFastPropertyValue( com::sun::star::u
{
case TOOLBARCONTROLLER_PROPHANDLE_SUPPORTSVISIABLE:
{
- sal_Bool aNewValue;
+ sal_Bool aNewValue(sal_False);
aValue >>= aNewValue;
if (aNewValue != m_bSupportVisiable)
{
diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx
index f2090be1655f..2d22d9cedb33 100644
--- a/svtools/source/uno/unoiface.cxx
+++ b/svtools/source/uno/unoiface.cxx
@@ -1664,7 +1664,7 @@ void SVTXRoadmap::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
BASEPROPERTY_TEXT,
0);
VCLXWindow::ImplGetPropertyIds( rIds, true );
- VCLXImageConsumer::ImplGetPropertyIds( rIds );
+ VCLXGraphicControl::ImplGetPropertyIds( rIds );
}
// ----------------------------------------------------
diff --git a/svtools/source/uno/unoimap.cxx b/svtools/source/uno/unoimap.cxx
index 6b6e35482ae9..88f22f0c8402 100644
--- a/svtools/source/uno/unoimap.cxx
+++ b/svtools/source/uno/unoimap.cxx
@@ -210,6 +210,8 @@ PropertySetInfo* SvUnoImageMapObject::createPropertySetInfo( UINT16 nType )
SvUnoImageMapObject::SvUnoImageMapObject( UINT16 nType, const SvEventDescription* pSupportedMacroItems )
: PropertySetHelper( createPropertySetInfo( nType ) ),
mnType( nType )
+, mbIsActive( true )
+, mnRadius( 0 )
{
mpEvents = new SvMacroTableEventDescriptor( pSupportedMacroItems );
mpEvents->acquire();
@@ -218,6 +220,8 @@ SvUnoImageMapObject::SvUnoImageMapObject( UINT16 nType, const SvEventDescription
SvUnoImageMapObject::SvUnoImageMapObject( const IMapObject& rMapObject, const SvEventDescription* pSupportedMacroItems )
: PropertySetHelper( createPropertySetInfo( rMapObject.GetType() ) ),
mnType( rMapObject.GetType() )
+, mbIsActive( true )
+, mnRadius( 0 )
{
maURL = rMapObject.GetURL();
maAltText = rMapObject.GetAltText();