summaryrefslogtreecommitdiff
path: root/extensions/source/bibliography/general.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/source/bibliography/general.hxx')
-rw-r--r--extensions/source/bibliography/general.hxx99
1 files changed, 58 insertions, 41 deletions
diff --git a/extensions/source/bibliography/general.hxx b/extensions/source/bibliography/general.hxx
index 2c0c17aaf5fe..e566c9f15e81 100644
--- a/extensions/source/bibliography/general.hxx
+++ b/extensions/source/bibliography/general.hxx
@@ -41,56 +41,70 @@ class BibDataManager;
#define TYPE_COUNT 22
#define FIELD_COUNT 31
-typedef cppu::WeakAggImplHelper1 < ::com::sun::star::awt::XFocusListener > BibGeneralPageBaseClass;
+/**
+ * We need to split off the listener because both it and the vcl::Window baseclass are ref-counted
+ */
+class BibGeneralPage;
+class BibGeneralPageFocusListener : public cppu::WeakAggImplHelper1 < ::com::sun::star::awt::XFocusListener >
+{
+private:
+ VclPtr<BibGeneralPage> mpBibGeneralPage;
+public:
+ BibGeneralPageFocusListener(BibGeneralPage *pBibGeneralPage);
+ virtual void SAL_CALL focusGained( const ::com::sun::star::awt::FocusEvent& e ) throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
+ virtual void SAL_CALL focusLost( const ::com::sun::star::awt::FocusEvent& e ) throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
-class BibGeneralPage: public BibGeneralPageBaseClass, public BibTabPage
+};
+
+class BibGeneralPage: public BibTabPage
{
- VclGrid* pGrid;
- VclScrolledWindow* pScrolledWindow;
+ VclPtr<VclGrid> pGrid;
+ VclPtr<VclScrolledWindow> pScrolledWindow;
- FixedText* pIdentifierFT;
- FixedText* pAuthTypeFT;
- FixedText* pYearFT;
+ VclPtr<FixedText> pIdentifierFT;
+ VclPtr<FixedText> pAuthTypeFT;
+ VclPtr<FixedText> pYearFT;
- FixedText* pAuthorFT;
- FixedText* pTitleFT;
+ VclPtr<FixedText> pAuthorFT;
+ VclPtr<FixedText> pTitleFT;
- FixedText* pPublisherFT;
- FixedText* pAddressFT;
- FixedText* pISBNFT;
+ VclPtr<FixedText> pPublisherFT;
+ VclPtr<FixedText> pAddressFT;
+ VclPtr<FixedText> pISBNFT;
- FixedText* pChapterFT;
- FixedText* pPagesFT;
+ VclPtr<FixedText> pChapterFT;
+ VclPtr<FixedText> pPagesFT;
- FixedText* pEditorFT;
- FixedText* pEditionFT;
+ VclPtr<FixedText> pEditorFT;
+ VclPtr<FixedText> pEditionFT;
- FixedText* pBooktitleFT;
- FixedText* pVolumeFT;
- FixedText* pHowpublishedFT;
+ VclPtr<FixedText> pBooktitleFT;
+ VclPtr<FixedText> pVolumeFT;
+ VclPtr<FixedText> pHowpublishedFT;
- FixedText* pOrganizationsFT;
- FixedText* pInstitutionFT;
- FixedText* pSchoolFT;
+ VclPtr<FixedText> pOrganizationsFT;
+ VclPtr<FixedText> pInstitutionFT;
+ VclPtr<FixedText> pSchoolFT;
- FixedText* pReportTypeFT;
- FixedText* pMonthFT;
+ VclPtr<FixedText> pReportTypeFT;
+ VclPtr<FixedText> pMonthFT;
- FixedText* pJournalFT;
- FixedText* pNumberFT;
- FixedText* pSeriesFT;
+ VclPtr<FixedText> pJournalFT;
+ VclPtr<FixedText> pNumberFT;
+ VclPtr<FixedText> pSeriesFT;
- FixedText* pAnnoteFT;
- FixedText* pNoteFT;
- FixedText* pURLFT;
+ VclPtr<FixedText> pAnnoteFT;
+ VclPtr<FixedText> pNoteFT;
+ VclPtr<FixedText> pURLFT;
- FixedText* pCustom1FT;
- FixedText* pCustom2FT;
- FixedText* pCustom3FT;
- FixedText* pCustom4FT;
- FixedText* pCustom5FT;
+ VclPtr<FixedText> pCustom1FT;
+ VclPtr<FixedText> pCustom2FT;
+ VclPtr<FixedText> pCustom3FT;
+ VclPtr<FixedText> pCustom4FT;
+ VclPtr<FixedText> pCustom5FT;
- FixedText* aFixedTexts[ FIELD_COUNT ];
+ VclPtr<FixedText> aFixedTexts[ FIELD_COUNT ];
sal_Int16 nFT2CtrlMap[ FIELD_COUNT ];
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >
@@ -113,6 +127,7 @@ class BibGeneralPage: public BibGeneralPageBaseClass, public BibTabPage
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSetListener >
xPosListener;
+ BibGeneralPageFocusListener maBibGeneralPageFocusListener;
BibDataManager* pDatMan;
@@ -130,6 +145,7 @@ protected:
public:
BibGeneralPage(vcl::Window* pParent, BibDataManager* pDatMan);
virtual ~BibGeneralPage();
+ virtual void dispose() SAL_OVERRIDE;
inline const OUString& GetErrorString() const;
@@ -142,16 +158,17 @@ public:
void CommitActiveControl();
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
-
- void SAL_CALL focusGained( const ::com::sun::star::awt::FocusEvent& e ) throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
- void SAL_CALL focusLost( const ::com::sun::star::awt::FocusEvent& e ) throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
-
void RemoveListeners();
virtual void GetFocus() SAL_OVERRIDE;
virtual bool HandleShortCutKey( const KeyEvent& rKeyEvent ) SAL_OVERRIDE; // returns true, if key was handled
+
+ inline BibGeneralPageFocusListener& GetFocusListener() { return maBibGeneralPageFocusListener; }
+
+ void focusGained(const css::awt::FocusEvent& rEvent) throw( css::uno::RuntimeException, std::exception );
+ void focusLost(const css::awt::FocusEvent& rEvent) throw( css::uno::RuntimeException, std::exception );
+
};