summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-04-07 10:49:39 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-04-07 13:47:02 +0100
commitd913a5a9dfa44bb8061ff194e990c08cc40d7a69 (patch)
tree37c44088f47676e52baec75c5854a050b35f8384 /include
parentdrop out of date undef SfxTabDialog foo (diff)
downloadcore-d913a5a9dfa44bb8061ff194e990c08cc40d7a69.tar.gz
core-d913a5a9dfa44bb8061ff194e990c08cc40d7a69.zip
untangle the bFmt == 2 hack
Firstly, IsFormat is unused so there's no "escape" of bFmt back into the outside world. Then bFmt has two purposes. Purpose 1 is 'not be a format dialog, be a format dialog, be a format dialog but hide standard button' so, lets just add an explicit "Hide standard button" method and call it in the (apparently) one place where it's necessary. Purpose 2 is to flag that "BaseFmtHdl" was called from clicking the "Standard" button at which point its set to 2. SfxTabDialog::Init_Impl had... " // bFmt = temporary Flag passed on in the Constructor(), // if bFmt == 2, then also sal_True, // additional suppression of the standard button, // after the Initializing set to sal_True again if ( bFmtFlag != 2 ) m_pBaseFmtBtn->Show(); else bFmtFlag = sal_True; " but the variable acted on is bFmtFlag a copy of bFmt, and is never read again after that line, so setting it to sal_True is meaningless. The comment suggests that the intent is to reset bFmt to true if it was 2 during initialization, which fits with the later use of bFmt == 2 to indicate that the standard button was clicked, i.e. reset bFmt back to its standard value. So make bFmt a simple toggle of dialog as a format dialog or not, add a way to remove the standard button and add a second variable to indicate the standard button got pressed. Change-Id: I98a441f5f314845abe243e05b6d92fd71d7b0b04
Diffstat (limited to 'include')
-rw-r--r--include/sfx2/tabdlg.hxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx
index 79c750021511..80af1c430ec0 100644
--- a/include/sfx2/tabdlg.hxx
+++ b/include/sfx2/tabdlg.hxx
@@ -93,7 +93,7 @@ friend class SfxTabDialogController;
sal_uInt16* pRanges;
sal_uInt16 nAppPageId;
bool bItemsReset;
- sal_Bool bFmt; // sal_True, sal_False or 2(some kind of hack)
+ bool bStandardPushed;
DECL_DLLPRIVATE_LINK( ActivatePageHdl, TabControl * );
DECL_DLLPRIVATE_LINK( DeactivatePageHdl, TabControl * );
@@ -102,7 +102,7 @@ friend class SfxTabDialogController;
DECL_DLLPRIVATE_LINK(BaseFmtHdl, void *);
DECL_DLLPRIVATE_LINK(UserHdl, void *);
DECL_DLLPRIVATE_LINK(CancelHdl, void *);
- SAL_DLLPRIVATE void Init_Impl( sal_Bool bFmtFlag, const OUString* pUserButtonText, const ResId* pResId );
+ SAL_DLLPRIVATE void Init_Impl(bool bFmtFlag, const OUString* pUserButtonText, const ResId* pResId);
protected:
virtual short Ok();
@@ -128,12 +128,12 @@ protected:
void SavePosAndId();
public:
- SfxTabDialog( Window* pParent,
- const OString& rID, const OUString& rUIXMLDescription,
- const SfxItemSet * = 0, sal_Bool bEditFmt = sal_False );
- SfxTabDialog( SfxViewFrame *pViewFrame, Window* pParent,
- const OString& rID, const OUString& rUIXMLDescription,
- const SfxItemSet * = 0, sal_Bool bEditFmt = sal_False );
+ SfxTabDialog(Window* pParent,
+ const OString& rID, const OUString& rUIXMLDescription,
+ const SfxItemSet * = 0, bool bEditFmt = false);
+ SfxTabDialog(SfxViewFrame *pViewFrame, Window* pParent,
+ const OString& rID, const OUString& rUIXMLDescription,
+ const SfxItemSet * = 0, bool bEditFmt = false);
virtual ~SfxTabDialog();
sal_uInt16 AddTabPage( const OString& rName, // Name of the label for the page in the notebook .ui
@@ -198,7 +198,6 @@ public:
const sal_uInt16* GetInputRanges( const SfxItemPool& );
void SetInputSet( const SfxItemSet* pInSet );
const SfxItemSet* GetOutputItemSet() const { return pOutSet; }
- sal_Bool IsFormat() const { return bFmt; }
const PushButton& GetOKButton() const { return *m_pOKBtn; }
PushButton& GetOKButton() { return *m_pOKBtn; }
@@ -210,6 +209,7 @@ public:
const PushButton* GetUserButton() const { return m_pUserBtn; }
PushButton* GetUserButton() { return m_pUserBtn; }
void RemoveResetButton();
+ void RemoveStandardButton();
short Execute() SAL_OVERRIDE;
void StartExecuteModal( const Link& rEndDialogHdl ) SAL_OVERRIDE;