Kaydet (Commit) 95c04e21 authored tarafından Caolán McNamara's avatar Caolán McNamara

SfxControllerItems shouldn't be SAL_WARN_UNUSED

unwind some removals and some other cleanup

Change-Id: I81a734ed07a05a5922c31003928c493c2df1652f
üst dd7778a7
......@@ -29,6 +29,27 @@
#include <svx/dlgctrl.hxx>
/*************************************************************************
|*
|* class SvxBmpMaskSelectItem
|*
\************************************************************************/
class SvxBmpMask;
class SvxBmpMaskSelectItem : public SfxControllerItem
{
private:
SvxBmpMask &rBmpMask;
protected:
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
const SfxPoolItem* pState ) SAL_OVERRIDE;
public:
SvxBmpMaskSelectItem( sal_uInt16 nId, SvxBmpMask& rMask,
SfxBindings& rBindings );
};
/*************************************************************************
|*
|* Derivative from SfxChildWindow as 'container' for Float
......@@ -90,11 +111,10 @@ class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxBmpMask : public SfxDockingWindow
XColorListRef pColLst;
Color aPipetteColor;
SvxBmpMaskSelectItem aSelItem;
virtual bool Close() SAL_OVERRIDE;
#ifdef BMPMASK_PRIVATE
sal_uInt16 InitColorArrays( Color* pSrcCols, Color* pDstCols,
sal_uIntPtr* pTols );
......@@ -111,8 +131,6 @@ class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxBmpMask : public SfxDockingWindow
GDIMetaFile ImpReplaceTransparency( const GDIMetaFile& rMtf,
const Color& rColor );
#endif // BMPMASK_PRIVATE
public:
SvxBmpMask(SfxBindings *pBindinx, SfxChildWindow *pCW, vcl::Window* pParent);
......@@ -124,6 +142,8 @@ public:
bool NeedsColorList() const;
void SetColorList( const XColorListRef &pColorList );
void SetExecState( bool bEnable );
Graphic Mask( const Graphic& rGraphic );
bool IsEyedropping() const;
......
......@@ -26,7 +26,7 @@
// class SvxCheckListBox -------------------------------------------------
class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxCheckListBox : public SvTreeListBox
class SVX_DLLPUBLIC SvxCheckListBox : public SvTreeListBox
{
using Window::GetText;
......
......@@ -41,9 +41,6 @@ public:
SFX_DECL_CHILDWINDOW_WITHID( SvxContourDlgChildWindow );
};
#ifndef _REDUCED_ContourDlg_HXX_
#define _REDUCED INCLUDED_SVX_CONTDLG_HXX
class SvxSuperContourDlg;
class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxContourDlg : public SfxFloatingWindow
......@@ -78,7 +75,6 @@ public:
const sal_uIntPtr nFlags = 0L );
};
#endif // _REDUCED INCLUDED_SVX_CONTDLG_HXX
#endif // INCLUDED_SVX_CONTDLG_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -237,7 +237,7 @@ public:
|*
\************************************************************************/
class SAL_WARN_UNUSED Svx3DCtrlItem : public SfxControllerItem
class Svx3DCtrlItem : public SfxControllerItem
{
protected:
virtual void StateChanged( sal_uInt16 nSId, SfxItemState eState,
......@@ -254,7 +254,7 @@ class SAL_WARN_UNUSED Svx3DCtrlItem : public SfxControllerItem
|*
\************************************************************************/
class SAL_WARN_UNUSED SvxConvertTo3DItem : public SfxControllerItem
class SvxConvertTo3DItem : public SfxControllerItem
{
bool bState;
......
......@@ -22,7 +22,7 @@
#include <svx/unomod.hxx>
#include <svx/svxdllapi.h>
class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxFmMSFactory : public SvxUnoDrawMSFactory
class SVX_DLLPUBLIC SvxFmMSFactory : public SvxUnoDrawMSFactory
{
public:
......
......@@ -27,7 +27,7 @@
// SvxFmDrawPage
class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxFmDrawPage :public SvxDrawPage
class SVX_DLLPUBLIC SvxFmDrawPage :public SvxDrawPage
,public ::com::sun::star::form::XFormsSupplier2
{
protected:
......
......@@ -32,7 +32,7 @@ class SbxArray;
class SbxValue;
struct FmFormModelImplData;
class SVX_DLLPUBLIC SAL_WARN_UNUSED FmFormModel :
class SVX_DLLPUBLIC FmFormModel :
public SdrModel
{
private:
......
......@@ -38,7 +38,7 @@ namespace com { namespace sun { namespace star {
class SdrView;
class HelpEvent;
class SVX_DLLPUBLIC SAL_WARN_UNUSED FmFormPage : public SdrPage
class SVX_DLLPUBLIC FmFormPage : public SdrPage
{
FmFormPage& operator=(const FmFormPage&) SAL_DELETED_FUNCTION;
......
......@@ -66,7 +66,7 @@ public:
bool GetDesignMode() const { return m_bDesignMode; }
};
class SVX_DLLPUBLIC SAL_WARN_UNUSED FmFormShell : public SfxShell
class SVX_DLLPUBLIC FmFormShell : public SfxShell
{
friend class FmFormView;
friend class FmXFormShell;
......
......@@ -53,7 +53,7 @@ namespace com { namespace sun { namespace star { namespace form {
}
} } } }
class SVX_DLLPUBLIC SAL_WARN_UNUSED FmFormView : public E3dView
class SVX_DLLPUBLIC FmFormView : public E3dView
{
FmXFormView* pImpl;
FmFormShell* pFormShell;
......
......@@ -55,7 +55,7 @@ class XFormTextShadowYValItem;
class SvxFontWorkDialog;
class SAL_WARN_UNUSED SvxFontWorkControllerItem : public SfxControllerItem
class SvxFontWorkControllerItem : public SfxControllerItem
{
SvxFontWorkDialog &rFontWorkDlg;
......
......@@ -25,8 +25,6 @@
#include <sfx2/dispatch.hxx>
#include <svtools/colrdlg.hxx>
#define BMPMASK_PRIVATE
#include <svx/dialmgr.hxx>
#include <svx/bmpmask.hxx>
#include <svx/dialogs.hrc>
......@@ -170,6 +168,8 @@ class MaskData
public:
MaskData( SvxBmpMask* pBmpMask, SfxBindings& rBind );
bool IsCbxReady() const { return bIsReady; }
void SetExecState( bool bState ) { bExecState = bState; }
bool IsExecReady() const { return bExecState; }
DECL_LINK( PipetteHdl, ToolBox* pTbx );
......@@ -335,6 +335,27 @@ void ColorWindow::Paint( const Rectangle &/*Rect*/ )
SetFillColor( rOldFillColor );
}
SvxBmpMaskSelectItem::SvxBmpMaskSelectItem( sal_uInt16 nId_, SvxBmpMask& rMask,
SfxBindings& rBindings ) :
SfxControllerItem ( nId_, rBindings ),
rBmpMask ( rMask)
{
}
void SvxBmpMaskSelectItem::StateChanged( sal_uInt16 nSID, SfxItemState /*eState*/,
const SfxPoolItem* pItem )
{
if ( ( nSID == SID_BMPMASK_EXEC ) && pItem )
{
const SfxBoolItem* pStateItem = PTR_CAST( SfxBoolItem, pItem );
assert(pStateItem); //SfxBoolItem erwartet
if (pStateItem)
rBmpMask.SetExecState( pStateItem->GetValue() );
}
}
SvxBmpMaskChildWindow::SvxBmpMaskChildWindow(vcl::Window* pParent_, sal_uInt16 nId,
SfxBindings* pBindings,
SfxChildWinInfo* pInfo)
......@@ -354,6 +375,7 @@ SvxBmpMask::SvxBmpMask(SfxBindings *pBindinx, SfxChildWindow *pCW, vcl::Window*
"svx/ui/dockingcolorreplace.ui" )
, pData(new MaskData(this, *pBindinx))
, aPipetteColor(COL_WHITE)
, aSelItem(SID_BMPMASK_EXEC, *this, *pBindinx)
{
get(m_pTbxPipette, "toolbar");
m_pTbxPipette->SetItemBits(m_pTbxPipette->GetItemId(0),
......@@ -565,6 +587,18 @@ void SvxBmpMask::PipetteClicked()
pData->PipetteHdl(m_pTbxPipette);
}
void SvxBmpMask::SetExecState( bool bEnable )
{
pData->SetExecState( bEnable );
if ( pData->IsExecReady() && pData->IsCbxReady() )
m_pBtnExec->Enable();
else
m_pBtnExec->Disable();
}
sal_uInt16 SvxBmpMask::InitColorArrays( Color* pSrcCols, Color* pDstCols, sal_uIntPtr* pTols )
{
sal_uInt16 nCount = 0;
......
......@@ -46,6 +46,23 @@
SFX_IMPL_FLOATINGWINDOW_WITHID( SvxContourDlgChildWindow, SID_CONTOUR_DLG );
SvxContourDlgItem::SvxContourDlgItem( sal_uInt16 _nId, SvxSuperContourDlg& rContourDlg, SfxBindings& rBindings ) :
SfxControllerItem ( _nId, rBindings ),
rDlg ( rContourDlg )
{
}
void SvxContourDlgItem::StateChanged( sal_uInt16 nSID, SfxItemState /*eState*/, const SfxPoolItem* pItem )
{
if ( pItem && ( SID_CONTOUR_EXEC == nSID ) )
{
const SfxBoolItem* pStateItem = PTR_CAST( SfxBoolItem, pItem );
assert(pStateItem); //SfxBoolItem expected
if (pStateItem)
rDlg.SetExecState(!pStateItem->GetValue());
}
}
SvxContourDlgChildWindow::SvxContourDlgChildWindow( vcl::Window* _pParent, sal_uInt16 nId,
SfxBindings* pBindings, SfxChildWinInfo* pInfo ) :
SfxChildWindow( _pParent, nId )
......@@ -186,6 +203,7 @@ SvxSuperContourDlg::SvxSuperContourDlg(SfxBindings *_pBindings, SfxChildWindow *
SvxContourDlg ( _pBindings, pCW, _pParent ),
pUpdateEditingObject( NULL ),
pCheckObj ( NULL ),
aContourItem ( SID_CONTOUR_EXEC, *this, *_pBindings ),
nGrfChanged ( 0UL ),
bExecState ( false ),
bUpdateGraphicLinked( false ),
......@@ -291,6 +309,13 @@ bool SvxSuperContourDlg::Close()
return( bRet ? SfxFloatingWindow::Close() : sal_False );
}
// Enabled or disabled all Controls
void SvxSuperContourDlg::SetExecState( bool bEnable )
{
bExecState = bEnable;
}
void SvxSuperContourDlg::SetGraphic( const Graphic& rGraphic )
{
aUndoGraphic = aRedoGraphic = Graphic();
......
......@@ -27,6 +27,21 @@
#define CONT_RESID(nId) ResId( nId, DIALOG_MGR() )
class SvxSuperContourDlg;
class SvxContourDlgItem : public SfxControllerItem
{
SvxSuperContourDlg& rDlg;
protected:
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) SAL_OVERRIDE;
public:
SvxContourDlgItem( sal_uInt16 nId, SvxSuperContourDlg& rDlg, SfxBindings& rBindings );
};
class SvxSuperContourDlg : public SvxContourDlg
{
using SvxContourDlg::GetPolyPolygon;
......@@ -41,6 +56,7 @@ class SvxSuperContourDlg : public SvxContourDlg
Size aLastSize;
void* pUpdateEditingObject;
void* pCheckObj;
SvxContourDlgItem aContourItem;
ToolBox* m_pTbx1;
MetricField* m_pMtfTolerance;
ContourWindow* m_pContourWnd;
......@@ -84,6 +100,8 @@ public:
vcl::Window* pParent);
virtual ~SvxSuperContourDlg();
void SetExecState( bool bEnable );
void SetGraphic( const Graphic& rGraphic );
void SetGraphicLinked( bool bLinked ) { bGraphicLinked = bLinked; }
const Graphic& GetGraphic() const { return aGraphic; }
......
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