summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Timofeev <timofeev.i.s@gmail.com>2012-11-08 12:47:21 +0400
committerMiklos Vajna <vmiklos@suse.cz>2012-11-09 09:01:46 +0000
commit3d303cb331ab273538d63b226250a6950718ea1f (patch)
treec39acbb1aaeca8022aeaba46dbb9fdee80958567
parentc23a44e1de0faad6328ed0ece7247da3ae24b6cd (diff)
fdo#35427: repair Tools > Options > Writer > View - Show Scroll Slider options
Change-Id: I2bacd52a182a2dba3dbe6c6d63861470e87b6066 Reviewed-on: https://gerrit.libreoffice.org/1008 Reviewed-by: Miklos Vajna <vmiklos@suse.cz> Tested-by: Miklos Vajna <vmiklos@suse.cz>
-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 186ae80c5eb8..24630bdbafce 100644
--- a/sw/source/ui/app/swmodul1.cxx
+++ b/sw/source/ui/app/swmodul1.cxx
@@ -93,11 +93,11 @@ void lcl_SetUIPrefs(const SwViewOption &rPref, SwView* pView, ViewShell* pSh )
// 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)
@@ -172,8 +172,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 329ba5e567d9..f9242b49a44f 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 229e8f5d810c..2d9dbe8f3913 100644
--- a/sw/source/ui/inc/view.hxx
+++ b/sw/source/ui/inc/view.hxx
@@ -221,6 +221,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
@@ -517,6 +520,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 ecdc27d8e58c..ad005520017f 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 93e643a0c606..ae55a7194c51 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 27949cff51e9..2a20f440cb97 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 7acaa98250e1..1b0f1824150e 100644
--- a/sw/source/ui/uiview/viewport.cxx
+++ b/sw/source/ui/uiview/viewport.cxx
@@ -1080,6 +1080,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 )