summaryrefslogtreecommitdiff
path: root/sw/source/ui/uiview
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/ui/uiview
parent7f26dac751473045b894e97ca4090957bbb865cd (diff)
fdo#35427: repair Tools > Options > Writer > View - Show Scroll Slider options
Change-Id: I2bacd52a182a2dba3dbe6c6d63861470e87b6066
Diffstat (limited to 'sw/source/ui/uiview')
-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
4 files changed, 55 insertions, 4 deletions
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 )