avmedia/source/framework/MediaControlBase.cxx | 3 ++- avmedia/source/framework/mediacontrol.cxx | 6 ++++-- cui/source/customize/acccfg.cxx | 8 ++++---- cui/source/inc/acccfg.hxx | 4 +++- include/tools/wintypes.hxx | 5 ----- include/vcl/slider.hxx | 2 ++ vcl/source/control/slider.cxx | 5 +++-- 7 files changed, 18 insertions(+), 15 deletions(-)
New commits: commit b4ac906cd07c06abcda427f70787b9b6c213b354 Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Fri Aug 18 16:42:24 2017 +0200 convert to WB_SAVEAS to flags on SfxAcceleratorConfigPage::StartFileDialog Change-Id: I52ff0b4ba892a74d1dad9ce8c6c7638e3463affe Reviewed-on: https://gerrit.libreoffice.org/41303 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx index 1d0af8c3d45d..04d055a5537b 100644 --- a/cui/source/customize/acccfg.cxx +++ b/cui/source/customize/acccfg.cxx @@ -1054,12 +1054,12 @@ IMPL_LINK_NOARG(SfxAcceleratorConfigPage, SearchUpdateHdl, Edit&, void) IMPL_LINK_NOARG(SfxAcceleratorConfigPage, Load, Button*, void) { // ask for filename, where we should load the new config data from - StartFileDialog( 0, aLoadAccelConfigStr ); + StartFileDialog( StartFileDialogType::Open, aLoadAccelConfigStr ); } IMPL_LINK_NOARG(SfxAcceleratorConfigPage, Save, Button*, void) { - StartFileDialog( WB_SAVEAS, aSaveAccelConfigStr ); + StartFileDialog( StartFileDialogType::SaveAs, aSaveAccelConfigStr ); } IMPL_LINK_NOARG(SfxAcceleratorConfigPage, Default, Button*, void) @@ -1391,9 +1391,9 @@ IMPL_LINK_NOARG(SfxAcceleratorConfigPage, SaveHdl, sfx2::FileDialogHelper*, void } -void SfxAcceleratorConfigPage::StartFileDialog( WinBits nBits, const OUString& rTitle ) +void SfxAcceleratorConfigPage::StartFileDialog( StartFileDialogType nType, const OUString& rTitle ) { - bool bSave = ( ( nBits & WB_SAVEAS ) == WB_SAVEAS ); + bool bSave = nType == StartFileDialogType::SaveAs; short nDialogType = bSave ? ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION : ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE; delete m_pFileDlg; diff --git a/cui/source/inc/acccfg.hxx b/cui/source/inc/acccfg.hxx index adc67e208885..cc78f437d913 100644 --- a/cui/source/inc/acccfg.hxx +++ b/cui/source/inc/acccfg.hxx @@ -103,6 +103,8 @@ namespace sfx2 class FileDialogHelper; } +enum class StartFileDialogType { Open, SaveAs }; + class SfxAcceleratorConfigPage : public SfxTabPage { friend class SfxAccCfgTabListBox_Impl; @@ -159,7 +161,7 @@ private: SvTreeListEntry* applySearchFilter(OUString const & rSearchTerm, SvTreeListBox* rListBox); void InitAccCfg(); sal_uLong MapKeyCodeToPos( const vcl::KeyCode &rCode ) const; - void StartFileDialog( WinBits nBits, const OUString& rTitle ); + void StartFileDialog( StartFileDialogType nType, const OUString& rTitle ); void Init(const css::uno::Reference< css::ui::XAcceleratorConfiguration >& pAccMgr); void ResetConfig(); diff --git a/include/tools/wintypes.hxx b/include/tools/wintypes.hxx index 0eccec5cc259..cd1e5750d5a0 100644 --- a/include/tools/wintypes.hxx +++ b/include/tools/wintypes.hxx @@ -265,7 +265,6 @@ WinBits const WB_QUICK_SEARCH = SAL_CONST_INT64(0x010000000000); // For FileOpen Dialog WinBits const WB_PATH = 0x00100000; WinBits const WB_OPEN = 0x00200000; -WinBits const WB_SAVEAS = 0x00400000; commit 50acead19bd13a344f8ca9b3879f8e8cb0b24eb7 Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Fri Aug 18 16:38:48 2017 +0200 convert WB_SLIDERSET to a bool field Change-Id: I8a3767e162a14069937d52f5eb57ae5cd7f3fa7b Reviewed-on: https://gerrit.libreoffice.org/41302 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/avmedia/source/framework/MediaControlBase.cxx b/avmedia/source/framework/MediaControlBase.cxx index 09bd5bf146af..a0a03f9eb783 100644 --- a/avmedia/source/framework/MediaControlBase.cxx +++ b/avmedia/source/framework/MediaControlBase.cxx @@ -133,7 +133,8 @@ void MediaControlBase::InitializeWidgets() mpTimeSlider->SetRange( Range( 0, AVMEDIA_TIME_RANGE ) ); mpTimeSlider->SetUpdateMode( true ); - mpTimeSlider->SetStyle(WB_HORZ | WB_DRAG | WB_3DLOOK | WB_SLIDERSET); + mpTimeSlider->SetStyle(WB_HORZ | WB_DRAG | WB_3DLOOK); + mpTimeSlider->SetScrollTypeSet(true); } void MediaControlBase::UpdateToolBoxes(MediaItem aMediaItem) diff --git a/avmedia/source/framework/mediacontrol.cxx b/avmedia/source/framework/mediacontrol.cxx index 614430a325ae..b3dbf8f21cef 100644 --- a/avmedia/source/framework/mediacontrol.cxx +++ b/avmedia/source/framework/mediacontrol.cxx @@ -46,9 +46,11 @@ MediaControl::MediaControl( vcl::Window* pParent, MediaControlStyle eControlStyl meControlStyle( eControlStyle ) { mpPlayToolBox = VclPtr<ToolBox>::Create(this, WB_3DLOOK) ; - mpTimeSlider = VclPtr<Slider>::Create(this, WB_HORZ | WB_DRAG | WB_3DLOOK | WB_SLIDERSET) ; + mpTimeSlider = VclPtr<Slider>::Create(this, WB_HORZ | WB_DRAG | WB_3DLOOK) ; + mpTimeSlider->SetScrollTypeSet(true); mpMuteToolBox = VclPtr<ToolBox>::Create(this, WB_3DLOOK) ; - mpVolumeSlider = VclPtr<Slider>::Create(this, WB_HORZ | WB_DRAG | WB_SLIDERSET) ; + mpVolumeSlider = VclPtr<Slider>::Create(this, WB_HORZ | WB_DRAG) ; + mpVolumeSlider->SetScrollTypeSet(true); mpZoomToolBox = VclPtr<ToolBox>::Create(this, WB_3DLOOK) ; mpZoomListBox = VclPtr<ListBox>::Create( mpZoomToolBox.get(), WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL | WB_3DLOOK ) ; mpTimeEdit = VclPtr<Edit>::Create(this, WB_CENTER | WB_READONLY | WB_BORDER | WB_3DLOOK ) ; diff --git a/include/tools/wintypes.hxx b/include/tools/wintypes.hxx index def5ffd6bb09..0eccec5cc259 100644 --- a/include/tools/wintypes.hxx +++ b/include/tools/wintypes.hxx @@ -267,11 +267,7 @@ WinBits const WB_PATH = 0x00100000; WinBits const WB_OPEN = 0x00200000; WinBits const WB_SAVEAS = 0x00400000; -// For Slider -// Window-Bits for TabControl -WinBits const WB_SLIDERSET = 0x02000000; -// WindowAlign enum class WindowAlign { Left, Top, Right, Bottom }; diff --git a/include/vcl/slider.hxx b/include/vcl/slider.hxx index f4536b4c9af6..879340fc387f 100644 --- a/include/vcl/slider.hxx +++ b/include/vcl/slider.hxx @@ -49,6 +49,7 @@ private: ScrollType meScrollType; bool mbCalcSize; bool mbFullDrag; + bool mbScrollTypeSet; VclPtr<NumericField> mpLinkedField; @@ -104,6 +105,7 @@ public: long GetLineSize() const { return mnLineSize; } void SetPageSize( long nNewSize ) { mnPageSize = nNewSize; } long GetPageSize() const { return mnPageSize; } + void SetScrollTypeSet(bool b) { mbScrollTypeSet = b; } Size CalcWindowSizePixel(); diff --git a/vcl/source/control/slider.cxx b/vcl/source/control/slider.cxx index 1bbf92750f25..102e10aae82a 100644 --- a/vcl/source/control/slider.cxx +++ b/vcl/source/control/slider.cxx @@ -57,6 +57,7 @@ void Slider::ImplInit( vcl::Window* pParent, WinBits nStyle ) meScrollType = ScrollType::DontKnow; mbCalcSize = true; mbFullDrag = true; + mbScrollTypeSet = false; mpLinkedField = nullptr; @@ -627,7 +628,7 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt ) } else if ( ImplIsPageUp( rMousePos ) ) { - if( GetStyle() & WB_SLIDERSET ) + if( mbScrollTypeSet ) meScrollType = ScrollType::Set; else { @@ -637,7 +638,7 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt ) } else if ( ImplIsPageDown( rMousePos ) ) { - if( GetStyle() & WB_SLIDERSET ) + if( mbScrollTypeSet ) meScrollType = ScrollType::Set; else { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits