[Libreoffice-commits] .: Branch 'libreoffice-3-6' - sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Nov 9 01:02:06 PST 2012
sw/source/ui/app/swmodul1.cxx | 8 ++++----
sw/source/ui/inc/pview.hxx | 5 ++++-
sw/source/ui/inc/view.hxx | 6 ++++++
sw/source/ui/uiview/pview.cxx | 27 +++++++++++++++++++++++++++
sw/source/ui/uiview/view.cxx | 4 ++--
sw/source/ui/uiview/viewmdi.cxx | 19 +++++++++++++++++--
sw/source/ui/uiview/viewport.cxx | 9 +++++++++
7 files changed, 69 insertions(+), 9 deletions(-)
New commits:
commit 3d303cb331ab273538d63b226250a6950718ea1f
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date: Thu Nov 8 12:47:21 2012 +0400
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 at suse.cz>
Tested-by: Miklos Vajna <vmiklos at suse.cz>
diff --git a/sw/source/ui/app/swmodul1.cxx b/sw/source/ui/app/swmodul1.cxx
index 186ae80..24630bd 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 329ba5e..f9242b4 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 229e8f5..2d9dbe8 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 ecdc27d..ad00552 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 93e643a..ae55a71 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 27949cf..2a20f44 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 7acaa98..1b0f182 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 )
More information about the Libreoffice-commits
mailing list