vcl: rename VclReference to VclPtr
and remove the typedefs. The code is more obvious this way. Change-Id: I4c8f5b5ab050dd96216302a03e760ed0e3ab3464
This commit is contained in:
parent
10981bc4e3
commit
a632fa5f2e
@ -72,7 +72,7 @@ bool VCLWidgets::VisitFieldDecl(const FieldDecl * fieldDecl) {
|
||||
|
||||
report(
|
||||
DiagnosticsEngine::Warning,
|
||||
"vcl::Window subclass allocated as a class member, should be allocated via VclReference.",
|
||||
"vcl::Window subclass allocated as a class member, should be allocated via VclPtr.",
|
||||
fieldDecl->getLocation())
|
||||
<< fieldDecl->getSourceRange();
|
||||
return true;
|
||||
|
@ -1029,7 +1029,7 @@ namespace pcr
|
||||
{
|
||||
SetCompoundControl( true );
|
||||
|
||||
m_pImplEdit = MultiLineEditRef( new MultiLineEdit( this, WB_TABSTOP | WB_IGNORETAB | WB_NOBORDER | (_nStyle & WB_READONLY) ) );
|
||||
m_pImplEdit = VclPtr<MultiLineEdit>( new MultiLineEdit( this, WB_TABSTOP | WB_IGNORETAB | WB_NOBORDER | (_nStyle & WB_READONLY) ) );
|
||||
SetSubEdit( m_pImplEdit.get() );
|
||||
m_pImplEdit->Show();
|
||||
|
||||
@ -1064,7 +1064,7 @@ namespace pcr
|
||||
boost::scoped_ptr<vcl::Window> aTemp(m_pFloatingEdit);
|
||||
m_pFloatingEdit = NULL;
|
||||
}
|
||||
SetSubEdit(EditRef());
|
||||
SetSubEdit(VclPtr<Edit>());
|
||||
{
|
||||
boost::scoped_ptr<vcl::Window> aTemp(m_pDropdownButton);
|
||||
m_pDropdownButton = NULL;
|
||||
|
@ -375,7 +375,7 @@ namespace pcr
|
||||
{
|
||||
private:
|
||||
OMultilineFloatingEdit* m_pFloatingEdit;
|
||||
VclReference<MultiLineEdit> m_pImplEdit;
|
||||
VclPtr<MultiLineEdit> m_pImplEdit;
|
||||
PushButton* m_pDropdownButton;
|
||||
MultiLineOperationMode m_nOperationMode;
|
||||
bool m_bDropdown : 1;
|
||||
|
@ -35,7 +35,6 @@ public:
|
||||
virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >
|
||||
GetComponentInterface(bool bCreate = true) SAL_OVERRIDE;
|
||||
};
|
||||
typedef VclReference<MultiLineEdit> MultiLineEditRef;
|
||||
|
||||
|
||||
#endif // INCLUDED_SVTOOLS_SVMEDIT_HXX
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include <vcl/bitmap.hxx>
|
||||
#include <vcl/salnativewidgets.hxx>
|
||||
#include <rsc/rsc-vcl-shared-types.hxx>
|
||||
#include <vcl/vclref.hxx>
|
||||
#include <vcl/vclptr.hxx>
|
||||
#include <vector>
|
||||
|
||||
class UserDrawEvent;
|
||||
@ -200,8 +200,6 @@ public:
|
||||
virtual bool set_property(const OString &rKey, const OString &rValue) SAL_OVERRIDE;
|
||||
};
|
||||
|
||||
typedef VclReference<PushButton> PushButtonPtr;
|
||||
|
||||
inline void PushButton::Check( bool bCheck )
|
||||
{
|
||||
SetState( (bCheck) ? TRISTATE_TRUE : TRISTATE_FALSE );
|
||||
@ -228,8 +226,6 @@ public:
|
||||
virtual void Click() SAL_OVERRIDE;
|
||||
};
|
||||
|
||||
typedef VclReference<OKButton> OKButtonPtr;
|
||||
|
||||
class VCL_DLLPUBLIC CancelButton : public PushButton
|
||||
{
|
||||
protected:
|
||||
@ -246,8 +242,6 @@ public:
|
||||
virtual void Click() SAL_OVERRIDE;
|
||||
};
|
||||
|
||||
typedef VclReference<CancelButton> CancelButtonPtr;
|
||||
|
||||
class VCL_DLLPUBLIC CloseButton : public CancelButton
|
||||
{
|
||||
public:
|
||||
@ -275,7 +269,6 @@ public:
|
||||
virtual void Click() SAL_OVERRIDE;
|
||||
};
|
||||
|
||||
typedef VclReference<HelpButton> HelpButtonPtr;
|
||||
|
||||
// - RadioButton -
|
||||
class VCL_DLLPUBLIC RadioButton : public Button
|
||||
@ -499,8 +492,6 @@ public:
|
||||
virtual bool set_property(const OString &rKey, const OString &rValue) SAL_OVERRIDE;
|
||||
};
|
||||
|
||||
typedef VclReference<CheckBox> CheckBoxPtr;
|
||||
|
||||
inline void CheckBox::Check( bool bCheck )
|
||||
{
|
||||
SetState( (bCheck) ? TRISTATE_TRUE : TRISTATE_FALSE );
|
||||
@ -561,8 +552,6 @@ public:
|
||||
virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
|
||||
};
|
||||
|
||||
typedef VclReference<DisclosureButton> DisclosureButtonPtr;
|
||||
|
||||
#endif // INCLUDED_VCL_BUTTON_HXX
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
@ -39,7 +39,7 @@ class ImplBtn;
|
||||
class VCL_DLLPUBLIC ComboBox : public Edit
|
||||
{
|
||||
private:
|
||||
VclReference<Edit> mpSubEdit;
|
||||
VclPtr<Edit> mpSubEdit;
|
||||
ImplListBox* mpImplLB;
|
||||
ImplBtn* mpBtn;
|
||||
ImplListBoxFloatingWindow* mpFloatWin;
|
||||
@ -225,7 +225,6 @@ public:
|
||||
|
||||
virtual bool set_property(const OString &rKey, const OString &rValue) SAL_OVERRIDE;
|
||||
};
|
||||
typedef VclReference<ComboBox> ComboBoxPtr;
|
||||
|
||||
#endif // _COMBOBOX_HXX
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include <vcl/dllapi.h>
|
||||
#include <vcl/syswin.hxx>
|
||||
#include <vcl/timer.hxx>
|
||||
#include <vcl/vclref.hxx>
|
||||
#include <vcl/vclptr.hxx>
|
||||
|
||||
// parameter to pass to the dialog constructor if really no parent is wanted
|
||||
// whereas NULL chooses the default dialog parent
|
||||
@ -48,8 +48,8 @@ private:
|
||||
bool mbInClose;
|
||||
bool mbModalMode;
|
||||
|
||||
VclReference<VclButtonBox> mpActionArea;
|
||||
VclReference<VclBox> mpContentArea;
|
||||
VclPtr<VclButtonBox> mpActionArea;
|
||||
VclPtr<VclBox> mpContentArea;
|
||||
|
||||
SAL_DLLPRIVATE void ImplInitDialogData();
|
||||
SAL_DLLPRIVATE void ImplInitSettings();
|
||||
@ -75,8 +75,8 @@ protected:
|
||||
|
||||
protected:
|
||||
friend class VclBuilder;
|
||||
void set_action_area(const VclReference<VclButtonBox> &xBox);
|
||||
void set_content_area(const VclReference<VclBox> &xBox);
|
||||
void set_action_area(const VclPtr<VclButtonBox> &xBox);
|
||||
void set_content_area(const VclPtr<VclBox> &xBox);
|
||||
|
||||
public:
|
||||
explicit Dialog( vcl::Window* pParent, WinBits nStyle = WB_STDDIALOG );
|
||||
@ -122,7 +122,6 @@ public:
|
||||
|
||||
void GrabFocusToFirstControl();
|
||||
};
|
||||
typedef VclReference<Dialog> DialogRef;
|
||||
|
||||
// - ModelessDialog -
|
||||
class VCL_DLLPUBLIC ModelessDialog : public Dialog
|
||||
@ -133,7 +132,6 @@ class VCL_DLLPUBLIC ModelessDialog : public Dialog
|
||||
public:
|
||||
explicit ModelessDialog( vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription );
|
||||
};
|
||||
typedef VclReference<ModelessDialog> ModelessDialogRef;
|
||||
|
||||
// - ModalDialog -
|
||||
class VCL_DLLPUBLIC ModalDialog : public Dialog
|
||||
@ -153,7 +151,6 @@ private:
|
||||
SAL_DLLPRIVATE ModalDialog (const ModalDialog &) SAL_DELETED_FUNCTION;
|
||||
SAL_DLLPRIVATE ModalDialog & operator= (const ModalDialog &) SAL_DELETED_FUNCTION;
|
||||
};
|
||||
typedef VclReference<ModalDialog> ModalDialogRef;
|
||||
|
||||
#endif // INCLUDED_VCL_DIALOG_HXX
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include <vcl/ctrl.hxx>
|
||||
#include <vcl/menu.hxx>
|
||||
#include <vcl/dndhelp.hxx>
|
||||
#include <vcl/vclref.hxx>
|
||||
#include <vcl/vclptr.hxx>
|
||||
#include <com/sun/star/uno/Reference.h>
|
||||
|
||||
namespace com {
|
||||
@ -69,7 +69,7 @@ enum AutocompleteAction{ AUTOCOMPLETE_KEYINPUT, AUTOCOMPLETE_TABFORWARD, AUTOCOM
|
||||
class VCL_DLLPUBLIC Edit : public Control, public vcl::unohelper::DragAndDropClient
|
||||
{
|
||||
private:
|
||||
VclReference<Edit> mpSubEdit;
|
||||
VclPtr<Edit> mpSubEdit;
|
||||
Timer* mpUpdateDataTimer;
|
||||
TextFilter* mpFilterText;
|
||||
DDInfo* mpDDInfo;
|
||||
@ -237,7 +237,7 @@ public:
|
||||
virtual const Link& GetModifyHdl() const { return maModifyHdl; }
|
||||
virtual void SetUpdateDataHdl( const Link& rLink ) { maUpdateDataHdl = rLink; }
|
||||
|
||||
void SetSubEdit( VclReference<Edit> pEdit );
|
||||
void SetSubEdit( VclPtr<Edit> pEdit );
|
||||
Edit* GetSubEdit() const { return mpSubEdit; }
|
||||
|
||||
boost::signals2::signal< void ( Edit* ) > autocompleteSignal;
|
||||
@ -270,7 +270,6 @@ public:
|
||||
// global style settings (needed by sc's inputwin.cxx)
|
||||
static Size GetMinimumEditSize();
|
||||
};
|
||||
typedef VclReference<Edit> EditRef;
|
||||
|
||||
#endif // INCLUDED_VCL_EDIT_HXX
|
||||
|
||||
|
@ -83,8 +83,6 @@ public:
|
||||
vcl::Window* get_mnemonic_widget() const { return m_pMnemonicWindow; }
|
||||
};
|
||||
|
||||
typedef VclReference<FixedText> FixedTextPtr;
|
||||
|
||||
class VCL_DLLPUBLIC SelectableFixedText : public Edit
|
||||
{
|
||||
public:
|
||||
@ -127,8 +125,6 @@ public:
|
||||
virtual Size GetOptimalSize() const SAL_OVERRIDE;
|
||||
};
|
||||
|
||||
typedef VclReference<FixedLine> FixedLinePtr;
|
||||
|
||||
// - FixedBitmap -
|
||||
class VCL_DLLPUBLIC FixedBitmap : public Control
|
||||
{
|
||||
|
@ -55,8 +55,6 @@ public:
|
||||
virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
|
||||
};
|
||||
|
||||
typedef VclReference<GroupBox> GroupBoxPtr;
|
||||
|
||||
#endif // INCLUDED_VCL_GROUP_HXX
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
@ -51,8 +51,6 @@ protected:
|
||||
void ImplDraw( OutputDevice& rDev, sal_uLong nDrawFlags, const Point& rPos, const Size& rSize ) const;
|
||||
};
|
||||
|
||||
typedef VclReference<ImageControl> ImageControlPtr;
|
||||
|
||||
#endif // INCLUDED_VCL_IMGCTRL_HXX
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include <vcl/scrbar.hxx>
|
||||
#include <vcl/vclmedit.hxx>
|
||||
#include <vcl/window.hxx>
|
||||
#include <vcl/vclref.hxx>
|
||||
#include <vcl/vclptr.hxx>
|
||||
#include <boost/multi_array.hpp>
|
||||
#include <set>
|
||||
|
||||
@ -59,7 +59,6 @@ public:
|
||||
private:
|
||||
bool m_bLayoutDirty;
|
||||
};
|
||||
typedef VclReference<VclContainer> VclContainerRef;
|
||||
|
||||
class VCL_DLLPUBLIC VclBox : public VclContainer
|
||||
{
|
||||
@ -111,7 +110,6 @@ protected:
|
||||
|
||||
virtual bool getPrimaryDimensionChildExpand(const vcl::Window &rWindow) const = 0;
|
||||
};
|
||||
typedef VclReference<VclBox> VclBoxRef;
|
||||
|
||||
class VCL_DLLPUBLIC VclVBox : public VclBox
|
||||
{
|
||||
@ -159,7 +157,6 @@ protected:
|
||||
return rWindow.get_expand() || rWindow.get_vexpand();
|
||||
}
|
||||
};
|
||||
typedef VclReference<VclVBox> VclVBoxRef;
|
||||
|
||||
class VCL_DLLPUBLIC VclHBox : public VclBox
|
||||
{
|
||||
@ -207,7 +204,6 @@ protected:
|
||||
return rWindow.get_expand() || rWindow.get_hexpand();
|
||||
}
|
||||
};
|
||||
typedef VclReference<VclHBox> VclHBoxRef;
|
||||
|
||||
enum VclButtonBoxStyle
|
||||
{
|
||||
@ -253,7 +249,6 @@ private:
|
||||
Requisition calculatePrimarySecondaryRequisitions() const;
|
||||
Size addReqGroups(const VclButtonBox::Requisition &rReq) const;
|
||||
};
|
||||
typedef VclReference<VclButtonBox> VclButtonBoxRef;
|
||||
|
||||
class VCL_DLLPUBLIC VclVButtonBox : public VclButtonBox
|
||||
{
|
||||
@ -301,7 +296,6 @@ protected:
|
||||
return rWindow.get_expand() || rWindow.get_vexpand();
|
||||
}
|
||||
};
|
||||
typedef VclReference<VclVButtonBox> VclVButtonBoxRef;
|
||||
|
||||
class VCL_DLLPUBLIC VclHButtonBox : public VclButtonBox
|
||||
{
|
||||
@ -349,7 +343,6 @@ protected:
|
||||
return rWindow.get_expand() || rWindow.get_hexpand();
|
||||
}
|
||||
};
|
||||
typedef VclReference<VclHButtonBox> VclHButtonBoxRef;
|
||||
|
||||
class VCL_DLLPUBLIC VclGrid : public VclContainer
|
||||
{
|
||||
@ -443,7 +436,6 @@ public:
|
||||
}
|
||||
virtual bool set_property(const OString &rKey, const OString &rValue) SAL_OVERRIDE;
|
||||
};
|
||||
typedef VclReference<VclGrid> VclGridRef;
|
||||
|
||||
VCL_DLLPUBLIC void setGridAttach(vcl::Window &rWidget, sal_Int32 nLeft, sal_Int32 nTop,
|
||||
sal_Int32 nWidth = 1, sal_Int32 nHeight = 1);
|
||||
@ -460,7 +452,6 @@ public:
|
||||
virtual Size calculateRequisition() const SAL_OVERRIDE;
|
||||
virtual void setAllocation(const Size &rAllocation) SAL_OVERRIDE;
|
||||
};
|
||||
typedef VclReference<VclBin> VclBinRef;
|
||||
|
||||
class VCL_DLLPUBLIC VclFrame : public VclBin
|
||||
{
|
||||
@ -487,7 +478,6 @@ protected:
|
||||
virtual void setAllocation(const Size &rAllocation) SAL_OVERRIDE;
|
||||
virtual OUString getDefaultAccessibleName() const SAL_OVERRIDE;
|
||||
};
|
||||
typedef VclReference<VclFrame> VclFrameRef;
|
||||
|
||||
class VCL_DLLPUBLIC VclAlignment : public VclBin
|
||||
{
|
||||
@ -518,7 +508,6 @@ private:
|
||||
float m_fYAlign;
|
||||
float m_fYScale;
|
||||
};
|
||||
typedef VclReference<VclAlignment> VclAlignmentRef;
|
||||
|
||||
class VCL_DLLPUBLIC VclExpander : public VclBin
|
||||
{
|
||||
@ -559,11 +548,10 @@ protected:
|
||||
void dispose() SAL_OVERRIDE { m_pDisclosureButton.disposeAndClear(); VclBin::dispose(); }
|
||||
private:
|
||||
bool m_bResizeTopLevel;
|
||||
DisclosureButtonPtr m_pDisclosureButton;
|
||||
VclPtr<DisclosureButton> m_pDisclosureButton;
|
||||
Link maExpandedHdl;
|
||||
DECL_DLLPRIVATE_LINK(ClickHdl, DisclosureButton* pBtn);
|
||||
};
|
||||
typedef VclReference<VclExpander> VclExpanderRef;
|
||||
|
||||
class VCL_DLLPUBLIC VclScrolledWindow : public VclBin
|
||||
{
|
||||
@ -587,11 +575,10 @@ protected:
|
||||
void dispose() SAL_OVERRIDE { m_pVScroll.disposeAndClear(); m_pHScroll.disposeAndClear(); VclBin::dispose(); }
|
||||
private:
|
||||
bool m_bUserManagedScrolling;
|
||||
ScrollBarPtr m_pVScroll;
|
||||
ScrollBarPtr m_pHScroll;
|
||||
VclPtr<ScrollBar> m_pVScroll;
|
||||
VclPtr<ScrollBar> m_pHScroll;
|
||||
ScrollBarBox m_aScrollBarBox;
|
||||
};
|
||||
typedef VclReference<VclScrolledWindow> VclScrolledWindowRef;
|
||||
|
||||
class VCL_DLLPUBLIC VclViewport : public VclBin
|
||||
{
|
||||
@ -603,7 +590,6 @@ public:
|
||||
protected:
|
||||
virtual void setAllocation(const Size &rAllocation) SAL_OVERRIDE;
|
||||
};
|
||||
typedef VclReference<VclViewport> VclViewportRef;
|
||||
|
||||
//Enforces that its children are always the same size as itself.
|
||||
//Intercepts any Commands intended for its children.
|
||||
@ -648,7 +634,6 @@ public:
|
||||
|
||||
virtual void Command(const CommandEvent& rCEvt) SAL_OVERRIDE;
|
||||
};
|
||||
typedef VclReference<VclEventBox> VclEventBoxRef;
|
||||
|
||||
enum VclSizeGroupMode
|
||||
{
|
||||
@ -700,7 +685,6 @@ public:
|
||||
}
|
||||
bool set_property(const OString &rKey, const OString &rValue);
|
||||
};
|
||||
typedef VclReference<VclSizeGroup> VclSizeGroupRef;
|
||||
|
||||
enum VclButtonsType
|
||||
{
|
||||
@ -725,13 +709,13 @@ class VCL_DLLPUBLIC MessageDialog : public Dialog
|
||||
private:
|
||||
VclButtonsType m_eButtonsType;
|
||||
VclMessageType m_eMessageType;
|
||||
VclBoxRef m_pOwnedContentArea;
|
||||
VclButtonBoxRef m_pOwnedActionArea;
|
||||
VclGridRef m_pGrid;
|
||||
VclPtr<VclBox> m_pOwnedContentArea;
|
||||
VclPtr<VclButtonBox> m_pOwnedActionArea;
|
||||
VclPtr<VclGrid> m_pGrid;
|
||||
FixedImage* m_pImage;
|
||||
VclMultiLineEdit* m_pPrimaryMessage;
|
||||
VclMultiLineEdit* m_pSecondaryMessage;
|
||||
std::vector<PushButtonPtr> m_aOwnedButtons;
|
||||
std::vector<VclPtr<PushButton> > m_aOwnedButtons;
|
||||
std::map<const vcl::Window*, short> m_aResponses;
|
||||
OUString m_sPrimaryString;
|
||||
OUString m_sSecondaryString;
|
||||
@ -764,7 +748,6 @@ public:
|
||||
static void SetMessagesWidths(vcl::Window *pParent, VclMultiLineEdit *pPrimaryMessage,
|
||||
VclMultiLineEdit *pSecondaryMessage);
|
||||
};
|
||||
typedef VclReference<MessageDialog> MessageDialogRef;
|
||||
|
||||
VCL_DLLPUBLIC Size bestmaxFrameSizeForScreenSize(const Size &rScreenSize);
|
||||
|
||||
|
@ -239,7 +239,6 @@ public:
|
||||
void EnableQuickSelection( const bool& b );
|
||||
};
|
||||
|
||||
typedef VclReference<ListBox> ListBoxPtr;
|
||||
|
||||
// - MultiListBox -
|
||||
|
||||
|
@ -82,8 +82,6 @@ public:
|
||||
const Link& GetSelectHdl() const { return maSelectHdl; }
|
||||
};
|
||||
|
||||
typedef VclReference<MenuButton> MenuButtonPtr;
|
||||
|
||||
#endif // INCLUDED_VCL_MENUBTN_HXX
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
@ -141,8 +141,6 @@ public:
|
||||
virtual Size GetOptimalSize() const SAL_OVERRIDE;
|
||||
};
|
||||
|
||||
typedef VclReference<ScrollBar> ScrollBarPtr;
|
||||
|
||||
|
||||
// - ScrollBarBox -
|
||||
|
||||
|
@ -130,7 +130,6 @@ public:
|
||||
|
||||
virtual bool set_property(const OString &rKey, const OString &rValue) SAL_OVERRIDE;
|
||||
};
|
||||
typedef VclReference<VclMultiLineEdit> VclMultiLineEditRef;
|
||||
|
||||
#endif // INCLUDED_VCL_VCLMEDIT_HXX
|
||||
|
||||
|
@ -17,8 +17,8 @@
|
||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
*/
|
||||
|
||||
#ifndef INCLUDED_VCL_REFERENCE_HXX
|
||||
#define INCLUDED_VCL_REFERENCE_HXX
|
||||
#ifndef INCLUDED_VCL_PTR_HXX
|
||||
#define INCLUDED_VCL_PTR_HXX
|
||||
|
||||
#include <rtl/ref.hxx>
|
||||
|
||||
@ -73,7 +73,7 @@ public:
|
||||
* @param reference_type must be a subclass of vcl::Window
|
||||
*/
|
||||
template <class reference_type>
|
||||
class VclReference
|
||||
class VclPtr
|
||||
{
|
||||
|
||||
::rtl::Reference<reference_type> m_rInnerRef;
|
||||
@ -81,21 +81,21 @@ class VclReference
|
||||
public:
|
||||
/** Constructor...
|
||||
*/
|
||||
inline VclReference()
|
||||
inline VclPtr()
|
||||
: m_rInnerRef()
|
||||
{}
|
||||
|
||||
|
||||
/** Constructor...
|
||||
*/
|
||||
inline VclReference (reference_type * pBody)
|
||||
inline VclPtr (reference_type * pBody)
|
||||
: m_rInnerRef(pBody)
|
||||
{}
|
||||
|
||||
|
||||
/** Copy constructor...
|
||||
*/
|
||||
inline VclReference (const VclReference<reference_type> & handle)
|
||||
inline VclPtr (const VclPtr<reference_type> & handle)
|
||||
: m_rInnerRef (handle.m_rInnerRef)
|
||||
{}
|
||||
|
||||
@ -108,8 +108,8 @@ public:
|
||||
@param rRef another reference
|
||||
*/
|
||||
template< class derived_type >
|
||||
inline VclReference(
|
||||
const VclReference< derived_type > & rRef,
|
||||
inline VclPtr(
|
||||
const VclPtr< derived_type > & rRef,
|
||||
typename ::vcl::detail::UpCast< reference_type, derived_type >::t = 0 )
|
||||
: m_rInnerRef( static_cast<reference_type*>(rRef) )
|
||||
{
|
||||
@ -150,8 +150,8 @@ public:
|
||||
aTmp->dispose();
|
||||
}
|
||||
|
||||
}; // class VclReference
|
||||
}; // class VclPtr
|
||||
|
||||
#endif // INCLUDED_VCL_REFERENCE_HXX
|
||||
#endif // INCLUDED_VCL_PTR_HXX
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -119,7 +119,7 @@ namespace vcl {
|
||||
|
||||
namespace svt { class PopupWindowControllerImpl; }
|
||||
|
||||
template<class T> class VclReference;
|
||||
template<class T> class VclPtr;
|
||||
|
||||
|
||||
// - WindowTypes -
|
||||
@ -502,7 +502,7 @@ public:
|
||||
|
||||
private:
|
||||
template<typename T> friend class ::rtl::Reference;
|
||||
template<typename T> friend class ::VclReference;
|
||||
template<typename T> friend class ::VclPtr;
|
||||
|
||||
inline void acquire() const
|
||||
{
|
||||
|
@ -320,7 +320,7 @@ Control* FontPropertyBox::getControl()
|
||||
class DropdownMenuBox : public Edit
|
||||
{
|
||||
public:
|
||||
DropdownMenuBox( vcl::Window* pParent, const EditRef &pSubControl, PopupMenu* pMenu );
|
||||
DropdownMenuBox( vcl::Window* pParent, const VclPtr<Edit> &pSubControl, PopupMenu* pMenu );
|
||||
virtual ~DropdownMenuBox();
|
||||
|
||||
void Resize() SAL_OVERRIDE;
|
||||
@ -329,12 +329,12 @@ public:
|
||||
void SetMenuSelectHdl( const Link& rLink ) { mpDropdownButton->SetSelectHdl( rLink ); }
|
||||
|
||||
private:
|
||||
EditRef mpSubControl;
|
||||
MenuButton* mpDropdownButton;
|
||||
PopupMenu* mpMenu;
|
||||
VclPtr<Edit> mpSubControl;
|
||||
MenuButton* mpDropdownButton;
|
||||
PopupMenu* mpMenu;
|
||||
};
|
||||
|
||||
DropdownMenuBox::DropdownMenuBox( vcl::Window* pParent, const EditRef &pSubControl, PopupMenu* pMenu )
|
||||
DropdownMenuBox::DropdownMenuBox( vcl::Window* pParent, const VclPtr<Edit> &pSubControl, PopupMenu* pMenu )
|
||||
: Edit( pParent, WB_BORDER|WB_TABSTOP| WB_DIALOGCONTROL ),
|
||||
mpSubControl(pSubControl),mpDropdownButton(0),mpMenu(pMenu)
|
||||
{
|
||||
@ -350,7 +350,7 @@ DropdownMenuBox::DropdownMenuBox( vcl::Window* pParent, const EditRef &pSubContr
|
||||
|
||||
DropdownMenuBox::~DropdownMenuBox()
|
||||
{
|
||||
SetSubEdit(EditRef());
|
||||
SetSubEdit(VclPtr<Edit>());
|
||||
delete mpDropdownButton;
|
||||
delete mpMenu;
|
||||
}
|
||||
@ -406,7 +406,7 @@ public:
|
||||
private:
|
||||
DropdownMenuBox* mpControl;
|
||||
PopupMenu* mpMenu;
|
||||
VclReference<MetricField> mpMetric;
|
||||
VclPtr<MetricField> mpMetric;
|
||||
};
|
||||
|
||||
CharHeightPropertyBox::CharHeightPropertyBox( sal_Int32 nControlType, vcl::Window* pParent, const Any& rValue, const Link& rModifyHdl )
|
||||
@ -486,7 +486,7 @@ public:
|
||||
private:
|
||||
DropdownMenuBox* mpControl;
|
||||
PopupMenu* mpMenu;
|
||||
VclReference<MetricField> mpMetric;
|
||||
VclPtr<MetricField> mpMetric;
|
||||
Link maModifyHdl;
|
||||
};
|
||||
|
||||
@ -590,7 +590,7 @@ public:
|
||||
private:
|
||||
DropdownMenuBox* mpControl;
|
||||
PopupMenu* mpMenu;
|
||||
VclReference<MetricField> mpMetric;
|
||||
VclPtr<MetricField> mpMetric;
|
||||
Link maModifyHdl;
|
||||
};
|
||||
|
||||
@ -715,7 +715,7 @@ public:
|
||||
private:
|
||||
DropdownMenuBox* mpControl;
|
||||
PopupMenu* mpMenu;
|
||||
VclReference<MetricField> mpMetric;
|
||||
VclPtr<MetricField> mpMetric;
|
||||
Link maModifyHdl;
|
||||
int mnDirection;
|
||||
};
|
||||
@ -877,7 +877,7 @@ public:
|
||||
private:
|
||||
DropdownMenuBox* mpControl;
|
||||
PopupMenu* mpMenu;
|
||||
EditRef mpEdit;
|
||||
VclPtr<Edit> mpEdit;
|
||||
Link maModifyHdl;
|
||||
|
||||
float mfFontWeight;
|
||||
|
@ -53,11 +53,11 @@ namespace vcl
|
||||
Size maPreviewSize;
|
||||
VirtualDevice maPageVDev;
|
||||
Bitmap maPreviewBitmap;
|
||||
OUString maReplacementString;
|
||||
OUString maToolTipString;
|
||||
OUString maReplacementString;
|
||||
OUString maToolTipString;
|
||||
bool mbGreyscale;
|
||||
FixedLinePtr maHorzDim;
|
||||
FixedLinePtr maVertDim;
|
||||
VclPtr<FixedLine> maHorzDim;
|
||||
VclPtr<FixedLine> maVertDim;
|
||||
|
||||
void preparePreviewBitmap();
|
||||
|
||||
|
@ -39,21 +39,21 @@ public:
|
||||
// A compile time sanity check
|
||||
void LifecycleTest::testCast()
|
||||
{
|
||||
VclReference<PushButton> xButton(new PushButton(NULL, 0));
|
||||
VclReference<vcl::Window> xWindow(xButton);
|
||||
VclPtr<PushButton> xButton(new PushButton(NULL, 0));
|
||||
VclPtr<vcl::Window> xWindow(xButton);
|
||||
|
||||
VclReference<MetricField> xField(new MetricField(NULL, 0));
|
||||
VclReference<SpinField> xSpin(xField);
|
||||
VclReference<Edit> xEdit(xField);
|
||||
VclPtr<MetricField> xField(new MetricField(NULL, 0));
|
||||
VclPtr<SpinField> xSpin(xField);
|
||||
VclPtr<Edit> xEdit(xField);
|
||||
|
||||
// the following line should NOT compile
|
||||
// VclReference<PushButton> xButton2(xWindow);
|
||||
// VclPtr<PushButton> xButton2(xWindow);
|
||||
}
|
||||
|
||||
void LifecycleTest::testMultiDispose()
|
||||
{
|
||||
VclReference<WorkWindow> xWin(new WorkWindow((vcl::Window *)NULL,
|
||||
WB_APP|WB_STDWORK));
|
||||
VclPtr<WorkWindow> xWin(new WorkWindow((vcl::Window *)NULL,
|
||||
WB_APP|WB_STDWORK));
|
||||
CPPUNIT_ASSERT(xWin.get() != NULL);
|
||||
xWin->dispose();
|
||||
xWin->dispose();
|
||||
@ -65,19 +65,19 @@ void LifecycleTest::testMultiDispose()
|
||||
|
||||
void LifecycleTest::testWidgets(vcl::Window *pParent)
|
||||
{
|
||||
{ PushButtonPtr aPtr(new PushButton(pParent)); }
|
||||
{ OKButtonPtr aPtr(new OKButton(pParent)); }
|
||||
{ CancelButtonPtr aPtr(new CancelButton(pParent)); }
|
||||
{ HelpButtonPtr aPtr(new HelpButton(pParent)); }
|
||||
{ VclPtr<PushButton> aPtr(new PushButton(pParent)); }
|
||||
{ VclPtr<OKButton> aPtr(new OKButton(pParent)); }
|
||||
{ VclPtr<CancelButton> aPtr(new CancelButton(pParent)); }
|
||||
{ VclPtr<HelpButton> aPtr(new HelpButton(pParent)); }
|
||||
|
||||
// Some widgets really insist on adoption.
|
||||
if (pParent)
|
||||
{
|
||||
{ CheckBoxPtr aPtr(new CheckBox(pParent)); }
|
||||
// { EditRef aPtr(new Edit(pParent)); }
|
||||
// { ComboBoxPtr aPtr(new ComboBox(pParent)); }
|
||||
{ VclPtr<CheckBox> aPtr(new CheckBox(pParent)); }
|
||||
// { VclPtr<Edit> aPtr(new Edit(pParent)); }
|
||||
// { VclPtr<ComboBox> aPtr(new ComboBox(pParent)); }
|
||||
}
|
||||
// { RadioButtonPtr aPtr(new RadioButton(pParent)); }
|
||||
// { VclPtr<RadioButton> aPtr(new RadioButton(pParent)); }
|
||||
}
|
||||
|
||||
void LifecycleTest::testIsolatedWidgets()
|
||||
@ -87,7 +87,7 @@ void LifecycleTest::testIsolatedWidgets()
|
||||
|
||||
void LifecycleTest::testParentedWidgets()
|
||||
{
|
||||
VclReference<WorkWindow> xWin(new WorkWindow((vcl::Window *)NULL,
|
||||
VclPtr<WorkWindow> xWin(new WorkWindow((vcl::Window *)NULL,
|
||||
WB_APP|WB_STDWORK));
|
||||
CPPUNIT_ASSERT(xWin.get() != NULL);
|
||||
testWidgets(xWin);
|
||||
|
@ -207,9 +207,9 @@ NULL
|
||||
class DbgInfoDialog : public ModalDialog
|
||||
{
|
||||
private:
|
||||
ListBoxPtr maListBox;
|
||||
OKButtonPtr maOKButton;
|
||||
bool mbHelpText;
|
||||
VclPtr<ListBox> maListBox;
|
||||
VclPtr<OKButton> maOKButton;
|
||||
bool mbHelpText;
|
||||
|
||||
public:
|
||||
DbgInfoDialog( vcl::Window* pParent, bool bHelpText = false );
|
||||
@ -222,14 +222,14 @@ private:
|
||||
class DbgDialog : public ModalDialog
|
||||
{
|
||||
private:
|
||||
CheckBoxPtr maRes;
|
||||
CheckBoxPtr maDialog;
|
||||
CheckBoxPtr maBoldAppFont;
|
||||
GroupBoxPtr maBox3;
|
||||
VclPtr<CheckBox> maRes;
|
||||
VclPtr<CheckBox> maDialog;
|
||||
VclPtr<CheckBox> maBoldAppFont;
|
||||
VclPtr<GroupBox> maBox3;
|
||||
|
||||
OKButtonPtr maOKButton;
|
||||
CancelButtonPtr maCancelButton;
|
||||
HelpButtonPtr maHelpButton;
|
||||
VclPtr<OKButton> maOKButton;
|
||||
VclPtr<CancelButton> maCancelButton;
|
||||
VclPtr<HelpButton> maHelpButton;
|
||||
|
||||
public:
|
||||
DbgDialog();
|
||||
|
@ -68,7 +68,7 @@ ComboBox::ComboBox( vcl::Window* pParent, const ResId& rResId ) :
|
||||
|
||||
ComboBox::~ComboBox()
|
||||
{
|
||||
SetSubEdit(VclReference<Edit>());
|
||||
SetSubEdit(VclPtr<Edit>());
|
||||
|
||||
ImplListBox *pImplLB = mpImplLB;
|
||||
mpImplLB = NULL;
|
||||
|
@ -285,7 +285,7 @@ void Edit::dispose()
|
||||
|
||||
void Edit::ImplInitEditData()
|
||||
{
|
||||
mpSubEdit = EditRef();
|
||||
mpSubEdit = VclPtr<Edit>();
|
||||
mpUpdateDataTimer = NULL;
|
||||
mpFilterText = NULL;
|
||||
mnXOffset = 0;
|
||||
@ -2706,7 +2706,7 @@ void Edit::ClearModifyFlag()
|
||||
mbModified = false;
|
||||
}
|
||||
|
||||
void Edit::SetSubEdit( VclReference<Edit> pEdit )
|
||||
void Edit::SetSubEdit( VclPtr<Edit> pEdit )
|
||||
{
|
||||
mpSubEdit.disposeAndClear();
|
||||
mpSubEdit = pEdit;
|
||||
|
@ -509,12 +509,12 @@ Dialog::Dialog(vcl::Window* pParent, WinBits nStyle)
|
||||
ImplInit( pParent, nStyle );
|
||||
}
|
||||
|
||||
void Dialog::set_action_area(const VclButtonBoxRef &xBox)
|
||||
void Dialog::set_action_area(const VclPtr<VclButtonBox> &xBox)
|
||||
{
|
||||
mpActionArea = xBox;
|
||||
}
|
||||
|
||||
void Dialog::set_content_area(const VclBoxRef &xBox)
|
||||
void Dialog::set_content_area(const VclPtr<VclBox> &xBox)
|
||||
{
|
||||
mpContentArea = xBox;
|
||||
}
|
||||
|
@ -2159,7 +2159,7 @@ short MessageDialog::Execute()
|
||||
VclButtonBox *pButtonBox = get_action_area();
|
||||
assert(pButtonBox);
|
||||
|
||||
PushButtonPtr pBtn;
|
||||
VclPtr<PushButton> pBtn;
|
||||
switch (m_eButtonsType)
|
||||
{
|
||||
case VCL_BUTTONS_NONE:
|
||||
|
@ -52,8 +52,6 @@ public:
|
||||
Image maImage;
|
||||
};
|
||||
|
||||
typedef VclReference<DecoToolBox> DecoToolBoxPtr;
|
||||
|
||||
|
||||
/** Class that implements the actual window of the menu bar.
|
||||
*/
|
||||
@ -81,9 +79,9 @@ private:
|
||||
bool bIgnoreFirstMove;
|
||||
bool bStayActive;
|
||||
|
||||
DecoToolBoxPtr aCloseBtn;
|
||||
PushButtonPtr aFloatBtn;
|
||||
PushButtonPtr aHideBtn;
|
||||
VclPtr<DecoToolBox> aCloseBtn;
|
||||
VclPtr<PushButton> aFloatBtn;
|
||||
VclPtr<PushButton> aHideBtn;
|
||||
|
||||
std::map< sal_uInt16, AddButtonEntry > m_aAddButtons;
|
||||
|
||||
|
@ -77,7 +77,7 @@ namespace vcl {
|
||||
|
||||
class XIMStatusWindow : public StatusWindow
|
||||
{
|
||||
FixedTextPtr m_aStatusText;
|
||||
VclPtr<FixedText> m_aStatusText;
|
||||
SalFrame* m_pLastParent;
|
||||
Size m_aWindowSize;
|
||||
bool m_bAnchoredAtRight;
|
||||
@ -302,7 +302,7 @@ namespace vcl {
|
||||
|
||||
class IIIMPStatusWindow : public StatusWindow
|
||||
{
|
||||
MenuButtonPtr m_aStatusBtn;
|
||||
VclPtr<MenuButton> m_aStatusBtn;
|
||||
PopupMenu m_aMenu;
|
||||
SalFrame* m_pResetFocus;
|
||||
bool m_bShow;
|
||||
|
@ -92,10 +92,10 @@ SAL_IMPLEMENT_MAIN()
|
||||
|
||||
class MyWin : public WorkWindow
|
||||
{
|
||||
PushButtonPtr m_aListButton;
|
||||
ListBoxPtr m_aSvpBitmaps;
|
||||
ImageControlPtr m_aImage;
|
||||
PushButtonPtr m_aQuitButton;
|
||||
VclPtr<PushButton> m_aListButton;
|
||||
VclPtr<ListBox> m_aSvpBitmaps;
|
||||
VclPtr<ImageControl> m_aImage;
|
||||
VclPtr<PushButton> m_aQuitButton;
|
||||
public:
|
||||
MyWin( vcl::Window* pParent, WinBits nWinStyle );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user