summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--basctl/source/basicide/bastypes.cxx2
-rw-r--r--basctl/source/inc/bastypes.hxx2
-rw-r--r--include/svtools/tabbar.hxx17
-rw-r--r--sc/source/ui/inc/tabcont.hxx4
-rw-r--r--sc/source/ui/view/tabcont.cxx10
-rw-r--r--sd/source/ui/dlg/LayerTabBar.cxx6
-rw-r--r--sd/source/ui/inc/LayerTabBar.hxx4
-rw-r--r--sd/source/ui/inc/TabControl.hxx6
-rw-r--r--sd/source/ui/view/tabcontr.cxx12
-rw-r--r--svtools/source/control/tabbar.cxx16
10 files changed, 40 insertions, 39 deletions
diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx
index 784de8749843..7da4f1797840 100644
--- a/basctl/source/basicide/bastypes.cxx
+++ b/basctl/source/basicide/bastypes.cxx
@@ -543,7 +543,7 @@ void TabBar::Command( const CommandEvent& rCEvt )
}
}
-long TabBar::AllowRenaming()
+TabBarAllowRenamingReturnCode TabBar::AllowRenaming()
{
bool const bValid = IsValidSbxName(GetEditText());
diff --git a/basctl/source/inc/bastypes.hxx b/basctl/source/inc/bastypes.hxx
index fbdf3d98183d..0d0db7e94072 100644
--- a/basctl/source/inc/bastypes.hxx
+++ b/basctl/source/inc/bastypes.hxx
@@ -122,7 +122,7 @@ protected:
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void Command( const CommandEvent& rCEvt ) SAL_OVERRIDE;
- virtual long AllowRenaming() SAL_OVERRIDE;
+ virtual TabBarAllowRenamingReturnCode AllowRenaming() SAL_OVERRIDE;
virtual void EndRenaming() SAL_OVERRIDE;
public:
diff --git a/include/svtools/tabbar.hxx b/include/svtools/tabbar.hxx
index 0c7751a404fe..4ca74cee1c7d 100644
--- a/include/svtools/tabbar.hxx
+++ b/include/svtools/tabbar.hxx
@@ -313,12 +313,13 @@ typedef sal_uInt16 TabBarPageBits;
#define TPB_SPECIAL ((TabBarPageBits)0x0001)
-// - TabBar-Types -
+// - TabBar-Types - used in TabBar::AllowRenaming
-
-#define TABBAR_RENAMING_YES ((long)sal_True)
-#define TABBAR_RENAMING_NO ((long)sal_False)
-#define TABBAR_RENAMING_CANCEL ((long)2)
+enum TabBarAllowRenamingReturnCode {
+ TABBAR_RENAMING_NO,
+ TABBAR_RENAMING_YES,
+ TABBAR_RENAMING_CANCEL
+};
// - TabBar -
@@ -425,9 +426,9 @@ public:
virtual void DoubleClick();
virtual void Split();
virtual void ActivatePage();
- virtual long DeactivatePage();
- virtual long StartRenaming();
- virtual long AllowRenaming();
+ virtual bool DeactivatePage();
+ virtual bool StartRenaming();
+ virtual TabBarAllowRenamingReturnCode AllowRenaming();
virtual void EndRenaming();
virtual void Mirror();
diff --git a/sc/source/ui/inc/tabcont.hxx b/sc/source/ui/inc/tabcont.hxx
index d04e02643f9f..644a2f9a8750 100644
--- a/sc/source/ui/inc/tabcont.hxx
+++ b/sc/source/ui/inc/tabcont.hxx
@@ -58,8 +58,8 @@ protected:
virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ) SAL_OVERRIDE;
- virtual long StartRenaming() SAL_OVERRIDE;
- virtual long AllowRenaming() SAL_OVERRIDE;
+ virtual bool StartRenaming() SAL_OVERRIDE;
+ virtual TabBarAllowRenamingReturnCode AllowRenaming() SAL_OVERRIDE;
virtual void EndRenaming() SAL_OVERRIDE;
virtual void Mirror() SAL_OVERRIDE;
diff --git a/sc/source/ui/view/tabcont.cxx b/sc/source/ui/view/tabcont.cxx
index b02984496df5..c6c41c029226 100644
--- a/sc/source/ui/view/tabcont.cxx
+++ b/sc/source/ui/view/tabcont.cxx
@@ -579,20 +579,20 @@ sal_Int8 ScTabControl::AcceptDrop( const AcceptDropEvent& rEvt )
return 0;
}
-long ScTabControl::StartRenaming()
+bool ScTabControl::StartRenaming()
{
if ( pViewData->GetDocument()->IsDocEditable() )
- return TABBAR_RENAMING_YES;
+ return true;
else
- return TABBAR_RENAMING_NO;
+ return false;
}
-long ScTabControl::AllowRenaming()
+TabBarAllowRenamingReturnCode ScTabControl::AllowRenaming()
{
ScTabViewShell* pViewSh = pViewData->GetViewShell();
OSL_ENSURE( pViewSh, "pViewData->GetViewShell()" );
- long nRet = TABBAR_RENAMING_CANCEL;
+ TabBarAllowRenamingReturnCode nRet = TABBAR_RENAMING_CANCEL;
sal_uInt16 nId = GetEditPageId();
if ( nId )
{
diff --git a/sd/source/ui/dlg/LayerTabBar.cxx b/sd/source/ui/dlg/LayerTabBar.cxx
index c6c9b0b0dde2..fa1406695333 100644
--- a/sd/source/ui/dlg/LayerTabBar.cxx
+++ b/sd/source/ui/dlg/LayerTabBar.cxx
@@ -174,7 +174,7 @@ void LayerTabBar::Command(const CommandEvent& rCEvt)
}
}
-long LayerTabBar::StartRenaming()
+bool LayerTabBar::StartRenaming()
{
bool bOK = true;
OUString aLayerName = GetPageText( GetEditPageId() );
@@ -204,7 +204,7 @@ long LayerTabBar::StartRenaming()
return bOK ? 1 : 0;
}
-long LayerTabBar::AllowRenaming()
+TabBarAllowRenamingReturnCode LayerTabBar::AllowRenaming()
{
bool bOK = true;
@@ -242,7 +242,7 @@ long LayerTabBar::AllowRenaming()
}
}
- return bOK ? 1 : 0;
+ return bOK ? TABBAR_RENAMING_YES : TABBAR_RENAMING_NO;
}
void LayerTabBar::EndRenaming()
diff --git a/sd/source/ui/inc/LayerTabBar.hxx b/sd/source/ui/inc/LayerTabBar.hxx
index 83453a7d78e9..6f42de10fd5c 100644
--- a/sd/source/ui/inc/LayerTabBar.hxx
+++ b/sd/source/ui/inc/LayerTabBar.hxx
@@ -66,8 +66,8 @@ protected:
virtual void Command(const CommandEvent& rCEvt) SAL_OVERRIDE;
- virtual long StartRenaming() SAL_OVERRIDE;
- virtual long AllowRenaming() SAL_OVERRIDE;
+ virtual bool StartRenaming() SAL_OVERRIDE;
+ virtual TabBarAllowRenamingReturnCode AllowRenaming() SAL_OVERRIDE;
virtual void EndRenaming() SAL_OVERRIDE;
virtual void ActivatePage() SAL_OVERRIDE;
diff --git a/sd/source/ui/inc/TabControl.hxx b/sd/source/ui/inc/TabControl.hxx
index cbc273b21573..2ec16b904d42 100644
--- a/sd/source/ui/inc/TabControl.hxx
+++ b/sd/source/ui/inc/TabControl.hxx
@@ -65,12 +65,12 @@ protected:
virtual void Command(const CommandEvent& rCEvt) SAL_OVERRIDE;
- virtual long StartRenaming() SAL_OVERRIDE;
- virtual long AllowRenaming() SAL_OVERRIDE;
+ virtual bool StartRenaming() SAL_OVERRIDE;
+ virtual TabBarAllowRenamingReturnCode AllowRenaming() SAL_OVERRIDE;
virtual void EndRenaming() SAL_OVERRIDE;
virtual void ActivatePage() SAL_OVERRIDE;
- virtual long DeactivatePage() SAL_OVERRIDE;
+ virtual bool DeactivatePage() SAL_OVERRIDE;
// DragSourceHelper
virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ) SAL_OVERRIDE;
diff --git a/sd/source/ui/view/tabcontr.cxx b/sd/source/ui/view/tabcontr.cxx
index 97c76b6d1932..827739acff84 100644
--- a/sd/source/ui/view/tabcontr.cxx
+++ b/sd/source/ui/view/tabcontr.cxx
@@ -307,7 +307,7 @@ void TabControl::Command(const CommandEvent& rCEvt)
}
}
-long TabControl::StartRenaming()
+bool TabControl::StartRenaming()
{
bool bOK = false;
@@ -321,10 +321,10 @@ long TabControl::StartRenaming()
pView->SdrEndTextEdit();
}
- return bOK ? 1 : 0;
+ return bOK;
}
-long TabControl::AllowRenaming()
+TabBarAllowRenamingReturnCode TabControl::AllowRenaming()
{
bool bOK = true;
@@ -344,7 +344,7 @@ long TabControl::AllowRenaming()
bOK = false;
}
}
- return bOK ? 1 : 0;
+ return bOK ? TABBAR_RENAMING_YES : TABBAR_RENAMING_NO;
}
void TabControl::EndRenaming()
@@ -363,9 +363,9 @@ void TabControl::ActivatePage()
}
}
-long TabControl::DeactivatePage()
+bool TabControl::DeactivatePage()
{
- return pDrViewSh->IsSwitchPageAllowed() ? 1 : 0;
+ return pDrViewSh->IsSwitchPageAllowed();
}
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index b3727f3820b1..5c118cbe25cf 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -1807,32 +1807,32 @@ Rectangle TabBar::ImplGetInsertTabRect(ImplTabBarItem* pItem) const
-long TabBar::DeactivatePage()
+bool TabBar::DeactivatePage()
{
if ( maDeactivatePageHdl.IsSet() )
return maDeactivatePageHdl.Call( this );
else
- return sal_True;
+ return true;
}
-long TabBar::StartRenaming()
+bool TabBar::StartRenaming()
{
if ( maStartRenamingHdl.IsSet() )
return maStartRenamingHdl.Call( this );
else
- return sal_True;
+ return true;
}
-long TabBar::AllowRenaming()
+TabBarAllowRenamingReturnCode TabBar::AllowRenaming()
{
if ( maAllowRenamingHdl.IsSet() )
- return maAllowRenamingHdl.Call( this );
+ return (TabBarAllowRenamingReturnCode) maAllowRenamingHdl.Call( this );
else
- return sal_True;
+ return TABBAR_RENAMING_YES;
}
@@ -2407,7 +2407,7 @@ void TabBar::EndEditMode( bool bCancel )
mpEdit->SetPostEvent();
if ( !bCancel )
{
- long nAllowRenaming = AllowRenaming();
+ TabBarAllowRenamingReturnCode nAllowRenaming = AllowRenaming();
if ( nAllowRenaming == TABBAR_RENAMING_YES )
SetPageText( mnEditId, maEditText );
else if ( nAllowRenaming == TABBAR_RENAMING_NO )