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