diff options
author | Ashod Nakashian <ashodnakashian@yahoo.com> | 2015-10-30 13:58:47 -0400 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-11-10 11:51:58 +0000 |
commit | 40f3a942448facb900b422d30f64b75d7cac7f0f (patch) | |
tree | 7240b0ed0481f93af893739d7895d92f2d7121ec /sw/source/uibase | |
parent | cec647c42a07091d946723cdf711aa3b56d0b6cf (diff) |
tdf#39080 Hide Whitespace improvements
Moved the page resizing from SwLayoutFrm::Format to
SwPageFrm::MakeAll and calculated the new page height
more accurately based on the content (stolen from
the browser-mode height calculation, to be refactored).
This fixes issues with repagination with certain contents.
Removed unnecessary ToggleLayoutMode calls and
prevented clicking between pages in single-view
mode to jump the cursor.
Change-Id: I5662dd26efff66d6e95b8fd4dcf8564588adbbb7
Reviewed-on: https://gerrit.libreoffice.org/19699
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/uibase')
-rw-r--r-- | sw/source/uibase/docvw/edtwin.cxx | 15 | ||||
-rw-r--r-- | sw/source/uibase/uiview/view0.cxx | 5 | ||||
-rw-r--r-- | sw/source/uibase/uno/unomod.cxx | 2 |
3 files changed, 11 insertions, 11 deletions
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 502620f5c1c9..498771aa7d95 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -2880,14 +2880,17 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) } // Toggle Hide-Whitespace if between pages. - if (_rMEvt.GetClicks() >= 2 && - rSh.GetViewOptions()->CanHideWhitespace() && + if (rSh.GetViewOptions()->CanHideWhitespace() && rSh.GetLayout()->IsBetweenPages(aDocPos)) { - SwViewOption aOpt(*rSh.GetViewOptions()); - aOpt.SetHideWhitespaceMode(!aOpt.IsHideWhitespaceMode()); - rSh.ApplyViewOptions(aOpt); - m_rView.GetDocShell()->ToggleLayoutMode(&m_rView); + if (_rMEvt.GetClicks() >= 2) + { + SwViewOption aOpt(*rSh.GetViewOptions()); + aOpt.SetHideWhitespaceMode(!aOpt.IsHideWhitespaceMode()); + rSh.ApplyViewOptions(aOpt); + } + + return; } } diff --git a/sw/source/uibase/uiview/view0.cxx b/sw/source/uibase/uiview/view0.cxx index 49c666e9d1f7..c762faa60e13 100644 --- a/sw/source/uibase/uiview/view0.cxx +++ b/sw/source/uibase/uiview/view0.cxx @@ -368,7 +368,6 @@ void SwView::ExecViewOptions(SfxRequest &rReq) int eState = STATE_TOGGLE; bool bSet = false; bool bBrowseModeChanged = false; - bool bHideWhitespaceModeChanged = false; const SfxItemSet *pArgs = rReq.GetArgs(); sal_uInt16 nSlot = rReq.GetSlot(); @@ -454,7 +453,7 @@ void SwView::ExecViewOptions(SfxRequest &rReq) case FN_VIEW_HIDE_WHITESPACE: if ( STATE_TOGGLE == eState ) bFlag = !pOpt->IsHideWhitespaceMode(); - bHideWhitespaceModeChanged = (bFlag != pOpt->IsHideWhitespaceMode()); + pOpt->SetHideWhitespaceMode(bFlag); break; @@ -578,7 +577,7 @@ void SwView::ExecViewOptions(SfxRequest &rReq) if( !(*rSh.GetViewOptions() == *pOpt )) { rSh.ApplyViewOptions( *pOpt ); - if( bBrowseModeChanged || bHideWhitespaceModeChanged ) + if( bBrowseModeChanged ) { GetDocShell()->ToggleLayoutMode(this); } diff --git a/sw/source/uibase/uno/unomod.cxx b/sw/source/uibase/uno/unomod.cxx index 15aef1f25db7..31114c711d52 100644 --- a/sw/source/uibase/uno/unomod.cxx +++ b/sw/source/uibase/uno/unomod.cxx @@ -733,8 +733,6 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c // must be set in mpViewOption as this will overwrite settings in _post! if(mpViewOption) mpViewOption->SetHideWhitespaceMode(bVal); - - pView->GetDocShell()->ToggleLayoutMode(pView); } } } |