summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorIvan Timofeev <timofeev.i.s@gmail.com>2012-11-08 12:47:21 +0400
committerIvan Timofeev <timofeev.i.s@gmail.com>2012-11-08 13:11:10 +0400
commit28f2c6b826f1693dc5136d552e5446d3d52aa329 (patch)
tree188d71f63939d5c35579cd9dfb229691bd6e0838 /sw/source
parent7f26dac751473045b894e97ca4090957bbb865cd (diff)
fdo#35427: repair Tools > Options > Writer > View - Show Scroll Slider options
Change-Id: I2bacd52a182a2dba3dbe6c6d63861470e87b6066
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/ui/app/swmodul1.cxx8
-rw-r--r--sw/source/ui/inc/pview.hxx5
-rw-r--r--sw/source/ui/inc/view.hxx6
-rw-r--r--sw/source/ui/uiview/pview.cxx27
-rw-r--r--sw/source/ui/uiview/view.cxx4
-rw-r--r--sw/source/ui/uiview/viewmdi.cxx19
-rw-r--r--sw/source/ui/uiview/viewport.cxx9
7 files changed, 69 insertions, 9 deletions
diff --git a/sw/source/ui/app/swmodul1.cxx b/sw/source/ui/app/swmodul1.cxx
index 0e5027a7c0b7..b0621bdb2681 100644
--- a/sw/source/ui/app/swmodul1.cxx
+++ b/sw/source/ui/app/swmodul1.cxx
@@ -84,11 +84,11 @@ static void lcl_SetUIPrefs(const SwViewOption &rPref, SwView* pView, ViewShell*
// Scrollbars on / off
if(bVScrollChanged)
{
- pView->ShowVScrollbar(pNewPref->IsViewVScrollBar());
+ pView->EnableVScrollbar(pNewPref->IsViewVScrollBar());
}
if(bHScrollChanged)
{
- pView->ShowHScrollbar( pNewPref->IsViewHScrollBar() || pNewPref->getBrowseMode() );
+ pView->EnableHScrollbar( pNewPref->IsViewHScrollBar() || pNewPref->getBrowseMode() );
}
//if only the position of the vertical ruler has been changed initiate an update
if(bVAlignChanged && !bHScrollChanged && !bVScrollChanged)
@@ -163,8 +163,8 @@ void SwModule::ApplyUsrPref(const SwViewOption &rUsrPref, SwView* pActView,
{
if(!bViewOnly)
pPref->SetUIOptions( rUsrPref );
- pPPView->ShowVScrollbar(pPref->IsViewVScrollBar());
- pPPView->ShowHScrollbar(pPref->IsViewHScrollBar());
+ pPPView->EnableVScrollbar(pPref->IsViewVScrollBar());
+ pPPView->EnableHScrollbar(pPref->IsViewHScrollBar());
if(!bViewOnly)
{
pPref->SetPagePrevRow(rUsrPref.GetPagePrevRow());
diff --git a/sw/source/ui/inc/pview.hxx b/sw/source/ui/inc/pview.hxx
index 9cd0870a6746..0ccf30196f50 100644
--- a/sw/source/ui/inc/pview.hxx
+++ b/sw/source/ui/inc/pview.hxx
@@ -193,6 +193,8 @@ class SW_DLLPUBLIC SwPagePreView: public SfxViewShell
// MDI control elements
SwScrollbar *pHScrollbar;
SwScrollbar *pVScrollbar;
+ bool mbHScrollbarEnabled;
+ bool mbVScrollbarEnabled;
ImageButton *pPageUpBtn,
*pPageDownBtn;
// dummy window for filling the lower right edge when both scrollbars are active
@@ -269,8 +271,9 @@ public:
void ScrollViewSzChg();
void ScrollDocSzChg();
void ShowHScrollbar(sal_Bool bShow);
-
void ShowVScrollbar(sal_Bool bShow);
+ void EnableHScrollbar(bool bEnable);
+ void EnableVScrollbar(bool bEnable);
sal_uInt16 GetPageCount() const { return mnPageCount; }
sal_uInt16 GetSelectedPage() const {return aViewWin.SelectedPage();}
diff --git a/sw/source/ui/inc/view.hxx b/sw/source/ui/inc/view.hxx
index 3494ed953f10..f32fcd937ed3 100644
--- a/sw/source/ui/inc/view.hxx
+++ b/sw/source/ui/inc/view.hxx
@@ -210,6 +210,9 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
SwScrollbar *pHScrollbar, // MDI control elements
*pVScrollbar;
+ bool mbHScrollbarEnabled;
+ bool mbVScrollbarEnabled;
+
Window *pScrollFill; // dummy window for filling the lower right edge
// when both scrollbars are active
@@ -506,6 +509,9 @@ public:
void ShowVScrollbar(sal_Bool bShow);
sal_Bool IsVScrollbarVisible()const;
+ void EnableHScrollbar(bool bEnable);
+ void EnableVScrollbar(bool bEnable);
+
int CreateVLineal();
int KillVLineal();
int CreateTab();
diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx
index f91e676d39b0..b06fc44a5861 100644
--- a/sw/source/ui/uiview/pview.cxx
+++ b/sw/source/ui/uiview/pview.cxx
@@ -1142,6 +1142,9 @@ void SwPagePreView::Init(const SwViewOption * pPrefs)
if( !pPrefs )
pPrefs = SW_MOD()->GetUsrPref(sal_False);
+ mbHScrollbarEnabled = pPrefs->IsViewHScrollBar();
+ mbVScrollbarEnabled = pPrefs->IsViewVScrollBar();
+
// die Felder aktualisieren
// ACHTUNG: hochcasten auf die EditShell, um die SS zu nutzen.
// In den Methoden wird auf die akt. Shell abgefragt!
@@ -1661,6 +1664,9 @@ void SwPagePreView::ScrollViewSzChg()
bShowVScrollbar = true;
}
+ if (!mbVScrollbarEnabled)
+ bShowVScrollbar = false;
+
ShowVScrollbar(bShowVScrollbar);
pPageUpBtn->Show(bShowVScrollbar);
pPageDownBtn->Show(bShowVScrollbar);
@@ -1689,6 +1695,9 @@ void SwPagePreView::ScrollViewSzChg()
pHScrollbar->SetPageSize( nVisWidth / 2 );
}
+ if (!mbHScrollbarEnabled)
+ bShowHScrollbar = false;
+
ShowHScrollbar(bShowHScrollbar);
}
pScrollFill->Show(bShowVScrollbar && bShowHScrollbar);
@@ -1903,6 +1912,24 @@ void SwPagePreView::ShowVScrollbar(sal_Bool bShow)
InvalidateBorder();
}
+void SwPagePreView::EnableHScrollbar(bool bEnable)
+{
+ if (mbHScrollbarEnabled != bEnable)
+ {
+ mbHScrollbarEnabled = bEnable;
+ ScrollViewSzChg();
+ }
+}
+
+void SwPagePreView::EnableVScrollbar(bool bEnable)
+{
+ if (mbVScrollbarEnabled != bEnable)
+ {
+ mbVScrollbarEnabled = bEnable;
+ ScrollViewSzChg();
+ }
+}
+
void SwPagePreView::SetZoom(SvxZoomType eType, sal_uInt16 nFactor)
{
ViewShell& rSh = *GetViewShell();
diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx
index eae63ecfb110..2b01ba5abf93 100644
--- a/sw/source/ui/uiview/view.cxx
+++ b/sw/source/ui/uiview/view.cxx
@@ -956,8 +956,8 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
SetNewWindowAllowed(!bBrowse);
// End of disabled multiple window
- ShowVScrollbar(aUsrPref.IsViewVScrollBar());
- ShowHScrollbar(aUsrPref.IsViewHScrollBar());
+ mbVScrollbarEnabled = aUsrPref.IsViewVScrollBar();
+ mbHScrollbarEnabled = aUsrPref.IsViewHScrollBar();
pHScrollbar->SetAuto(bBrowse);
if( aUsrPref.IsViewHRuler() )
CreateTab();
diff --git a/sw/source/ui/uiview/viewmdi.cxx b/sw/source/ui/uiview/viewmdi.cxx
index 01522518664c..ee8c36418b1d 100644
--- a/sw/source/ui/uiview/viewmdi.cxx
+++ b/sw/source/ui/uiview/viewmdi.cxx
@@ -320,8 +320,6 @@ int SwView::_CreateScrollbar( sal_Bool bHori )
(*ppScrollbar)->EnableDrag( sal_True );
- (*ppScrollbar)->SetAuto( sal_True );
-
if(GetWindow())
InvalidateBorder();
@@ -670,5 +668,22 @@ sal_Bool SwView::IsVScrollbarVisible()const
return pVScrollbar->IsVisible( sal_False );
}
+void SwView::EnableHScrollbar(bool bEnable)
+{
+ if (mbHScrollbarEnabled != bEnable)
+ {
+ mbHScrollbarEnabled = bEnable;
+ InvalidateBorder();
+ }
+}
+
+void SwView::EnableVScrollbar(bool bEnable)
+{
+ if (mbVScrollbarEnabled != bEnable)
+ {
+ mbVScrollbarEnabled = bEnable;
+ InvalidateBorder();
+ }
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uiview/viewport.cxx b/sw/source/ui/uiview/viewport.cxx
index e60273dcbeab..6b0b80668eac 100644
--- a/sw/source/ui/uiview/viewport.cxx
+++ b/sw/source/ui/uiview/viewport.cxx
@@ -1076,6 +1076,15 @@ void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize )
bShowV = pVOpt->IsViewVScrollBar();
}
+ if (!mbHScrollbarEnabled)
+ {
+ bHAuto = bShowH = false;
+ }
+ if (!mbVScrollbarEnabled)
+ {
+ bAuto = bShowV = false;
+ }
+
SwDocShell* pDocSh = GetDocShell();
sal_Bool bIsPreview = pDocSh->IsPreview();
if( bIsPreview )