summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/layout/layact.cxx5
-rw-r--r--sw/source/core/layout/pagechg.cxx11
-rw-r--r--sw/source/core/layout/wsfrm.cxx16
-rw-r--r--sw/source/core/view/viewsh.cxx43
-rw-r--r--sw/source/core/view/vprint.cxx2
-rw-r--r--sw/source/uibase/app/docsh2.cxx60
-rw-r--r--sw/source/uibase/uiview/pview.cxx1
-rw-r--r--sw/source/uibase/uiview/view0.cxx26
-rw-r--r--sw/source/uibase/uiview/view2.cxx4
-rw-r--r--sw/source/uibase/uiview/viewport.cxx4
-rw-r--r--sw/source/uibase/uno/unomod.cxx31
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx4
12 files changed, 126 insertions, 81 deletions
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index f5d265ab8f7f..e8a03f3343bb 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -1293,12 +1293,13 @@ bool SwLayAction::FormatLayout( OutputDevice *pRenderContext, SwLayoutFrm *pLay,
// between pages (not only for in online mode).
if ( pLay->IsPageFrm() )
{
- const SwTwips nHalfDocBorder = GAPBETWEENPAGES;
+ const SwViewShell *pSh = pLay->getRootFrm()->GetCurrShell();
+ const SwTwips nHalfDocBorder = pSh ? pSh->GetViewOptions()->GetGapBetweenPages()
+ : SwViewOption::GetDefGapBetweenPages();
const bool bLeftToRightViewLayout = pRoot->IsLeftToRightViewLayout();
const bool bPrev = bLeftToRightViewLayout ? pLay->GetPrev() : pLay->GetNext();
const bool bNext = bLeftToRightViewLayout ? pLay->GetNext() : pLay->GetPrev();
SwPageFrm* pPageFrm = static_cast<SwPageFrm*>(pLay);
- const SwViewShell *pSh = pLay->getRootFrm()->GetCurrShell();
SwRect aPageRect( pLay->Frm() );
if(pSh)
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 2bf79201f05f..b806c2a6e3a8 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -1895,8 +1895,8 @@ void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVi
{
assert(pViewOpt && "CheckViewLayout required ViewOptions");
- const sal_uInt16 nColumns = pViewOpt->GetViewLayoutColumns();
- const bool bBookMode = pViewOpt->IsViewLayoutBookMode();
+ const sal_uInt16 nColumns = pViewOpt->GetViewLayoutColumns();
+ const bool bBookMode = pViewOpt->IsViewLayoutBookMode();
if ( nColumns == mnColumns && bBookMode == mbBookMode && pVisArea->Width() == mnViewWidth && !mbSidebarChanged )
return;
@@ -1922,7 +1922,10 @@ void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVi
const long nBorder = Frm().Pos().getX();
const long nVisWidth = mnViewWidth - 2 * nBorder;
- const long nGapBetweenPages = GAPBETWEENPAGES;
+ SwViewShell* pSh = GetCurrShell();
+ const long nGapBetweenPages = pViewOpt ? pViewOpt->GetGapBetweenPages()
+ : (pSh ? pSh->GetViewOptions()->GetGapBetweenPages()
+ : SwViewOption::GetDefGapBetweenPages());
// check how many pages fit into the first page layout row:
SwPageFrm* pPageFrm = static_cast<SwPageFrm*>(Lower());
@@ -2182,8 +2185,6 @@ void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVi
::AdjustSizeChgNotify( this );
Calc(pRenderContext);
- SwViewShell* pSh = GetCurrShell();
-
if ( pSh && pSh->GetDoc()->GetDocShell() )
{
pSh->SetFirstVisPageInvalid();
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index bc75b1bec98a..ae2fbc0667b8 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -2927,18 +2927,20 @@ void SwLayoutFrm::ChgLowersProp( const Size& rOldSize )
*/
void SwLayoutFrm::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderAttrs *pAttrs )
{
- OSL_ENSURE( pAttrs, "LayoutFrm::Format, pAttrs ist 0." );
+ OSL_ENSURE( pAttrs, "LayoutFrm::Format, pAttrs is 0." );
if ( mbValidPrtArea && mbValidSize )
return;
SwViewShell *pSh = getRootFrm()->GetCurrShell();
- const bool hideWhitespace = (pSh && pSh->GetViewOptions()->IsHideWhitespaceMode());
- const sal_uInt16 nLeft = (sal_uInt16)pAttrs->CalcLeft( this );
- const sal_uInt16 nUpper = hideWhitespace ? 0 : pAttrs->CalcTop();
-
- const sal_uInt16 nRight = (sal_uInt16)pAttrs->CalcRight( this );
- const sal_uInt16 nLower = hideWhitespace ? 0 : pAttrs->CalcBottom();
+ const bool hideWS = (pSh && pSh->GetViewOptions()->IsHideWhitespaceMode());
+ const long hideWSBorderSize = (pSh ? pSh->GetViewOptions()->GetDocumentBorder() : 0);
+ const bool hideSideWS = (pSh && pSh->GetViewOptions()->IsMultipageView());
+ const sal_uInt16 nLeft = hideSideWS ? hideWSBorderSize * 2 : (sal_uInt16)pAttrs->CalcLeft(this);
+ const sal_uInt16 nUpper = hideWS ? hideWSBorderSize : pAttrs->CalcTop();
+
+ const sal_uInt16 nRight = hideSideWS ? hideWSBorderSize * 2 : (sal_uInt16)pAttrs->CalcRight(this);
+ const sal_uInt16 nLower = hideWS ? hideWSBorderSize : pAttrs->CalcBottom();
bool bVert = IsVertical() && !IsPageFrm();
SwRectFn fnRect = bVert ? ( IsVertLR() ? fnRectVertL2R : fnRectVert ) : fnRectHori;
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index cd4bd172749f..aaf026cdc31b 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -915,7 +915,6 @@ void SwViewShell::Reformat()
if( GetLayout()->IsCallbackActionEnabled() )
{
-
StartAction();
GetLayout()->InvalidateAllContent( INV_SIZE | INV_POS | INV_PRTAREA );
EndAction();
@@ -1900,7 +1899,7 @@ void SwViewShell::SetBrowseBorder( const Size& rNew )
{
maBrowseBorder = rNew;
if ( maVisArea.HasArea() )
- CheckBrowseView( false );
+ InvalidateLayout( false );
}
}
@@ -1923,9 +1922,10 @@ sal_Int32 SwViewShell::GetBrowseWidth() const
return maVisArea.Width() - 2 * GetOut()->PixelToLogic(maBrowseBorder).Width();
}
-void SwViewShell::CheckBrowseView( bool bBrowseChgd )
+void SwViewShell::InvalidateLayout( bool bSizeChanged )
{
- if ( !bBrowseChgd && !GetViewOptions()->getBrowseMode() )
+ if ( !bSizeChanged && !GetViewOptions()->getBrowseMode() &&
+ !GetViewOptions()->IsHideWhitespaceMode() )
return;
SET_CURR_SHELL( this );
@@ -1955,7 +1955,7 @@ void SwViewShell::CheckBrowseView( bool bBrowseChgd )
{ pPg->InvalidateSize();
pPg->_InvalidatePrt();
pPg->InvaPercentLowers();
- if ( bBrowseChgd )
+ if ( bSizeChanged )
{
pPg->PrepareHeader();
pPg->PrepareFooter();
@@ -1966,9 +1966,9 @@ void SwViewShell::CheckBrowseView( bool bBrowseChgd )
// When the size ratios in browse mode change,
// the Position and PrtArea of the Content and Tab frames must be Invalidated.
sal_uInt8 nInv = INV_PRTAREA | INV_TABLE | INV_POS;
- // In case of browse mode change the ContentFrms need a size-Invalidate
- // because of printer/screen formatting
- if( bBrowseChgd )
+ // In case of layout or mode change, the ContentFrms need a size-Invalidate
+ // because of printer/screen formatting.
+ if ( bSizeChanged )
nInv |= INV_SIZE | INV_DIRECTION;
GetLayout()->InvalidateAllContent( nInv );
@@ -2025,7 +2025,6 @@ SfxItemPool& SwViewShell::GetAttrPool()
void SwViewShell::ApplyViewOptions( const SwViewOption &rOpt )
{
-
for(SwViewShell& rSh : GetRingContainer())
rSh.StartAction();
@@ -2041,11 +2040,12 @@ void SwViewShell::ApplyViewOptions( const SwViewOption &rOpt )
continue;
SwViewOption aOpt( *rSh.GetViewOptions() );
aOpt.SetFieldName( rOpt.IsFieldName() );
- aOpt.SetShowHiddenField( rOpt.IsShowHiddenField() );
+ aOpt.SetShowHiddenField( rOpt.IsShowHiddenField() );
aOpt.SetShowHiddenPara( rOpt.IsShowHiddenPara() );
- aOpt.SetShowHiddenChar( rOpt.IsShowHiddenChar() );
- aOpt.SetViewLayoutBookMode( rOpt.IsViewLayoutBookMode() );
- aOpt.SetViewLayoutColumns( rOpt.GetViewLayoutColumns() );
+ aOpt.SetShowHiddenChar( rOpt.IsShowHiddenChar() );
+ aOpt.SetViewLayoutBookMode( rOpt.IsViewLayoutBookMode() );
+ aOpt.SetHideWhitespaceMode(rOpt.IsHideWhitespaceMode());
+ aOpt.SetViewLayoutColumns(rOpt.GetViewLayoutColumns());
aOpt.SetPostIts(rOpt.IsPostIts());
if ( !(aOpt == *rSh.GetViewOptions()) )
rSh.ImplApplyViewOptions( aOpt );
@@ -2110,7 +2110,7 @@ void SwViewShell::ImplApplyViewOptions( const SwViewOption &rOpt )
pMyWin->SetMapMode( aMode );
// if not a reference device (printer) is used for formatting,
// but the screen, new formatting is needed for zoomfactor changes.
- if( mpOpt->getBrowseMode() )
+ if (mpOpt->getBrowseMode() || mpOpt->IsHideWhitespaceMode())
bReformat = true;
}
@@ -2123,6 +2123,17 @@ void SwViewShell::ImplApplyViewOptions( const SwViewOption &rOpt )
else if( mpOpt->getBrowseMode() && mpOpt->IsPrtFormat() != rOpt.IsPrtFormat() )
bReformat = true;
+ bool bHideWhitespaceModeChanged = false;
+ if (mpOpt->IsHideWhitespaceMode() != rOpt.IsHideWhitespaceMode() ||
+ (rOpt.IsHideWhitespaceMode() &&
+ (mpOpt->IsViewLayoutBookMode() != rOpt.IsViewLayoutBookMode() ||
+ mpOpt->GetViewLayoutColumns() != rOpt.GetViewLayoutColumns())))
+ {
+ // When whitespace is hidden, view change needs reformatting.
+ bHideWhitespaceModeChanged = true;
+ bReformat = true;
+ }
+
if ( HasDrawView() || rOpt.IsGridVisible() )
{
if ( !HasDrawView() )
@@ -2160,12 +2171,12 @@ void SwViewShell::ImplApplyViewOptions( const SwViewOption &rOpt )
mpDoc->GetDocumentSettingManager().set(DocumentSettingId::HTML_MODE, 0 != ::GetHtmlMode(mpDoc->GetDocShell()));
- if( bBrowseModeChanged )
+ if( bBrowseModeChanged || bHideWhitespaceModeChanged )
{
// #i44963# Good occasion to check if page sizes in
// page descriptions are still set to (LONG_MAX, LONG_MAX) (html import)
mpDoc->CheckDefaultPageFormat();
- CheckBrowseView( true );
+ InvalidateLayout( true );
}
pMyWin->Invalidate();
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index 2407dda521ae..3567ff0c663c 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -604,7 +604,7 @@ void SwViewShell::PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, const SwPrintD
if ( pSh->GetViewOptions()->getBrowseMode() &&
pSh->GetRingContainer().size() == 1 )
{
- pSh->CheckBrowseView( false );
+ pSh->InvalidateLayout( false );
pSh->GetLayout()->Lower()->InvalidateSize();
}
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index 1f28a9fe6cbf..6a7b55d6d1a9 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -156,44 +156,38 @@ VclPtr<SfxDocumentInfoDialog> SwDocShell::CreateDocumentInfoDialog(
return pDlg;
}
-// Disable "multiple layout"
-
-void SwDocShell::ToggleBrowserMode(bool bSet, SwView* _pView )
+void SwDocShell::ToggleLayoutMode(SwView* pView)
{
- GetDoc()->getIDocumentSettingAccess().set(DocumentSettingId::BROWSE_MODE, bSet );
- UpdateFontList();
- SwView* pTempView = _pView ? _pView : GetView();
- if( pTempView )
+ OSL_ENSURE( pView, "SwDocShell::ToggleLayoutMode, pView is null." );
+
+ const SwViewOption& rViewOptions = *pView->GetWrtShell().GetViewOptions();
+
+ //TODO: Should HideWhitespace flag be saved in the document settings?
+ GetDoc()->getIDocumentSettingAccess().set(DocumentSettingId::BROWSE_MODE, rViewOptions.getBrowseMode());
+ UpdateFontList(); // Why is this necessary here?
+
+ pView->GetViewFrame()->GetBindings().Invalidate(FN_SHADOWCURSOR);
+ if( !GetDoc()->getIDocumentDeviceAccess().getPrinter( false ) )
+ pView->SetPrinter( GetDoc()->getIDocumentDeviceAccess().getPrinter( false ), SfxPrinterChangeFlags::PRINTER | SfxPrinterChangeFlags::JOBSETUP );
+ GetDoc()->CheckDefaultPageFormat();
+ SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this, false);
+ while (pTmpFrm)
{
- pTempView->GetViewFrame()->GetBindings().Invalidate(FN_SHADOWCURSOR);
- if( !GetDoc()->getIDocumentDeviceAccess().getPrinter( false ) )
- pTempView->SetPrinter( GetDoc()->getIDocumentDeviceAccess().getPrinter( false ), SfxPrinterChangeFlags::PRINTER | SfxPrinterChangeFlags::JOBSETUP );
- GetDoc()->CheckDefaultPageFormat();
- SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this, false);
- while (pTmpFrm)
- {
- if( pTmpFrm != pTempView->GetViewFrame() )
- {
- pTmpFrm->DoClose();
- pTmpFrm = SfxViewFrame::GetFirst(this, false);
- }
- else
- pTmpFrm = SfxViewFrame::GetNext(*pTmpFrm, this, false);
- }
- const SwViewOption& rViewOptions = *pTempView->GetWrtShell().GetViewOptions();
- pTempView->GetWrtShell().CheckBrowseView( true );
- pTempView->CheckVisArea();
- if( bSet )
+ if( pTmpFrm != pView->GetViewFrame() )
{
- const SvxZoomType eType = (SvxZoomType)rViewOptions.GetZoomType();
- if ( SvxZoomType::PERCENT != eType)
- static_cast<SwView*>(GetView())->SetZoom( eType );
+ pTmpFrm->DoClose();
+ pTmpFrm = SfxViewFrame::GetFirst(this, false);
}
- pTempView->InvalidateBorder();
- pTempView->SetNewWindowAllowed(!bSet);
+ else
+ pTmpFrm = SfxViewFrame::GetNext(*pTmpFrm, this, false);
}
+
+ pView->GetWrtShell().InvalidateLayout(true);
+
+ pView->RecheckBrowseMode();
+
+ pView->SetNewWindowAllowed(!rViewOptions.getBrowseMode());
}
-// End of disabled "multiple layout"
// update text fields on document properties changes
void SwDocShell::DoFlushDocInfo()
@@ -1365,7 +1359,7 @@ void SwDocShell::ReloadFromHtml( const OUString& rStreamName, SwSrcView* pSrcVie
{
SwWrtShell& rWrtSh = pCurrView->GetWrtShell();
if( rWrtSh.GetLayout())
- rWrtSh.CheckBrowseView( true );
+ rWrtSh.InvalidateLayout( true );
}
// Take HTTP-Header-Attibutes over into the DokInfo again.
diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx
index 0daf3076b953..6f16f8bcdbcd 100644
--- a/sw/source/uibase/uiview/pview.cxx
+++ b/sw/source/uibase/uiview/pview.cxx
@@ -1144,6 +1144,7 @@ void SwPagePreview::Init(const SwViewOption * pPrefs)
aOpt.SetTable( true );
aOpt.SetSnap( false );
aOpt.SetGridVisible( false );
+ aOpt.SetHideWhitespaceMode( false );
GetViewShell()->ApplyViewOptions( aOpt );
GetViewShell()->ApplyAccessiblityOptions(SW_MOD()->GetAccessibilityOptions());
diff --git a/sw/source/uibase/uiview/view0.cxx b/sw/source/uibase/uiview/view0.cxx
index edd0b4211c93..6173af8596af 100644
--- a/sw/source/uibase/uiview/view0.cxx
+++ b/sw/source/uibase/uiview/view0.cxx
@@ -302,6 +302,17 @@ void SwView::StateViewOptions(SfxItemSet &rSet)
}
case FN_VIEW_HIDDEN_PARA:
aBool.SetValue( pOpt->IsShowHiddenPara()); break;
+ case FN_VIEW_HIDE_WHITESPACE:
+ {
+ if (pOpt->getBrowseMode())
+ {
+ rSet.DisableItem(nWhich);
+ nWhich = 0;
+ }
+ else
+ aBool.SetValue(pOpt->IsHideWhitespaceMode());
+ }
+ break;
case SID_GRID_VISIBLE:
aBool.SetValue( pOpt->IsGridVisible() ); break;
case SID_GRID_USE:
@@ -356,6 +367,7 @@ 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();
@@ -418,8 +430,6 @@ void SwView::ExecViewOptions(SfxRequest &rReq)
else if( nSlot == FN_PRINT_LAYOUT )
bFlag = !bFlag;
bBrowseModeChanged = bFlag != pOpt->getBrowseMode();
- // Disable "multiple layout"
- GetDocShell()->ToggleBrowserMode( bFlag, this );
pOpt->setBrowseMode( bFlag );
break;
@@ -440,6 +450,13 @@ void SwView::ExecViewOptions(SfxRequest &rReq)
pOpt->SetShowHiddenPara( bFlag );
break;
+ case FN_VIEW_HIDE_WHITESPACE:
+ if ( STATE_TOGGLE == eState )
+ bFlag = !pOpt->IsHideWhitespaceMode();
+ bHideWhitespaceModeChanged = (bFlag != pOpt->IsHideWhitespaceMode());
+ pOpt->SetHideWhitespaceMode(bFlag);
+ break;
+
case FN_VIEW_SMOOTH_SCROLL:
if ( STATE_TOGGLE == eState )
@@ -560,10 +577,9 @@ void SwView::ExecViewOptions(SfxRequest &rReq)
if( !(*rSh.GetViewOptions() == *pOpt ))
{
rSh.ApplyViewOptions( *pOpt );
- if( bBrowseModeChanged )
+ if( bBrowseModeChanged || bHideWhitespaceModeChanged )
{
- RecheckBrowseMode();
- CheckVisArea();
+ GetDocShell()->ToggleLayoutMode(this);
}
// The UsrPref must be marked as modified.
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index a050e583a94d..1006837cb787 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -1437,7 +1437,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
const Size& rEditSize = GetEditWin().GetOutputSizePixel();
const Size aWindowSize( GetEditWin().PixelToLogic( rEditSize, aTmpMap ) );
- const long nOf = DOCUMENTBORDER * 2L;
+ const long nOf = pVOpt->GetDocumentBorder() * 2L;
long nTmpWidth = bAutomaticViewLayout ? aPageSize.Width() : aRootSize.Width();
nTmpWidth += nOf;
aPageSize.Height() += nOf;
@@ -1450,7 +1450,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
if ( bAutomaticViewLayout )
{
- nTmpWidth += aPageSize.Width() + GAPBETWEENPAGES;
+ nTmpWidth += aPageSize.Width() + pVOpt->GetGapBetweenPages();
nFac = aWindowSize.Width() * 100 / nTmpWidth;
nFac = std::min( nFac, nVisPercent );
aZoomSliderItem.AddSnappingPoint( nFac );
diff --git a/sw/source/uibase/uiview/viewport.cxx b/sw/source/uibase/uiview/viewport.cxx
index 0560f11398b5..231ef09ae9ba 100644
--- a/sw/source/uibase/uiview/viewport.cxx
+++ b/sw/source/uibase/uiview/viewport.cxx
@@ -265,7 +265,7 @@ void SwView::SetVisArea( const Rectangle &rRect, bool bUpdateScrollbar )
if ( aOldSz != m_pWrtShell->VisArea().SSize() &&
( std::abs(aOldSz.Width() - m_pWrtShell->VisArea().Width()) > 2 ||
std::abs(aOldSz.Height() - m_pWrtShell->VisArea().Height()) > 2 ) )
- m_pWrtShell->CheckBrowseView( false );
+ m_pWrtShell->InvalidateLayout( false );
}
if ( !bProtectDocShellVisArea )
@@ -329,7 +329,7 @@ void SwView::SetVisArea( const Point &rPt, bool bUpdateScrollbar )
void SwView::CheckVisArea()
{
m_pHScrollbar->SetAuto( m_pWrtShell->GetViewOptions()->getBrowseMode() &&
- !GetViewFrame()->GetFrame().IsInPlace() );
+ !GetViewFrame()->GetFrame().IsInPlace() );
if ( IsDocumentBorder() )
{
if ( m_aVisArea.Left() != DOCUMENTBORDER ||
diff --git a/sw/source/uibase/uno/unomod.cxx b/sw/source/uibase/uno/unomod.cxx
index 1215a943ae85..2cb78d2fa7ee 100644
--- a/sw/source/uibase/uno/unomod.cxx
+++ b/sw/source/uibase/uno/unomod.cxx
@@ -90,7 +90,8 @@ enum SwViewSettingsPropertyHandles
HANDLE_VIEWSET_RASTER_SUBDIVISION_Y,
HANDLE_VIEWSET_HORI_RULER_METRIC,
HANDLE_VIEWSET_VERT_RULER_METRIC,
- HANDLE_VIEWSET_SCROLLBAR_TIPS
+ HANDLE_VIEWSET_SCROLLBAR_TIPS,
+ HANDLE_VIEWSET_HIDE_WHITESPACE
};
enum SwPrintSettingsPropertyHandles
@@ -136,6 +137,7 @@ static ChainablePropertySetInfo * lcl_createViewSettingsInfo()
{ OUString( "ShowFootnoteBackground"),HANDLE_VIEWSET_FOOTNOTE_BACKGROUND , cppu::UnoType<bool>::get(), PROPERTY_NONE, 0},
{ OUString( "ShowGraphics"), HANDLE_VIEWSET_GRAPHICS , cppu::UnoType<bool>::get(), PROPERTY_NONE, 0},
{ OUString( "ShowHiddenCharacters"), HANDLE_VIEWSET_HIDDEN_CHARACTERS , cppu::UnoType<bool>::get(), PROPERTY_NONE, 0},
+ { OUString( "HideWhitespace"), HANDLE_VIEWSET_HIDE_WHITESPACE , cppu::UnoType<bool>::get(), PROPERTY_NONE, 0},
{ OUString( "ShowHiddenParagraphs"), HANDLE_VIEWSET_HIDDEN_PARAGRAPHS , cppu::UnoType<bool>::get(), PROPERTY_NONE, 0},
{ OUString( "ShowHiddenText"), HANDLE_VIEWSET_HIDDEN_TEXT , cppu::UnoType<bool>::get(), PROPERTY_NONE, 0},
{ OUString( "HideWhitespace"), HANDLE_VIEWSET_HIDE_WHITESPACE, cppu::UnoType<bool>::get(), PROPERTY_NONE, 0 },
@@ -708,23 +710,37 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c
break;
case HANDLE_VIEWSET_ONLINE_LAYOUT :
{
- if( pView && !bVal != !pView->GetWrtShell().GetViewOptions()->getBrowseMode() )
+ SwViewOption aOpt(*pView->GetWrtShell().GetViewOptions());
+ if (pView && !bVal != !aOpt.getBrowseMode())
{
- SwViewOption aOpt( *pView->GetWrtShell().GetViewOptions() );
aOpt.setBrowseMode( bVal );
pView->GetWrtShell().ApplyViewOptions( aOpt );
- pView->RecheckBrowseMode();
// must be set in mpViewOption as this will overwrite settings in _post!
if(mpViewOption)
mpViewOption->setBrowseMode(bVal);
- // disable multiple layout
- pView->GetDocShell()->ToggleBrowserMode(bVal, pView );
+ pView->GetDocShell()->ToggleLayoutMode(pView);
}
}
break;
- case HANDLE_VIEWSET_HELP_URL :
+ case HANDLE_VIEWSET_HIDE_WHITESPACE:
+ {
+ SwViewOption aOpt(*pView->GetWrtShell().GetViewOptions());
+ if (pView && !bVal != !aOpt.IsHideWhitespaceMode())
+ {
+ aOpt.SetHideWhitespaceMode( bVal );
+ pView->GetWrtShell().ApplyViewOptions( aOpt );
+
+ // must be set in mpViewOption as this will overwrite settings in _post!
+ if(mpViewOption)
+ mpViewOption->SetHideWhitespaceMode(bVal);
+
+ pView->GetDocShell()->ToggleLayoutMode(pView);
+ }
+ }
+ break;
+ case HANDLE_VIEWSET_HELP_URL:
{
if ( pView )
{
@@ -853,6 +869,7 @@ void SwXViewSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, u
case HANDLE_VIEWSET_HIDDEN_TEXT : bBoolVal = mpConstViewOption->IsShowHiddenField(); break;
case HANDLE_VIEWSET_HIDE_WHITESPACE: bBoolVal = mpConstViewOption->IsHideWhitespaceMode(); break;
case HANDLE_VIEWSET_HIDDEN_CHARACTERS : bBoolVal = mpConstViewOption->IsShowHiddenChar(true); break;
+ case HANDLE_VIEWSET_HIDE_WHITESPACE : bBoolVal = mpConstViewOption->IsHideWhitespaceMode(); break;
case HANDLE_VIEWSET_HIDDEN_PARAGRAPHS : bBoolVal = mpConstViewOption->IsShowHiddenPara(); break;
case HANDLE_VIEWSET_TABLE_BOUNDARIES : bBoolVal = SwViewOption::IsTableBoundaries(); break;
case HANDLE_VIEWSET_TEXT_BOUNDARIES : bBoolVal = SwViewOption::IsDocBoundaries(); break;
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index 0cdf83fb1d69..fe75178f1329 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -2554,10 +2554,12 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
if (bFormat)
{
// #i38289
- if( pViewShell->GetViewOptions()->getBrowseMode() )
+ if( pViewShell->GetViewOptions()->getBrowseMode() ||
+ pViewShell->GetViewOptions()->IsHideWhitespaceMode() )
{
SwViewOption aOpt( *pViewShell->GetViewOptions() );
aOpt.setBrowseMode( false );
+ aOpt.SetHideWhitespaceMode( false );
pViewShell->ApplyViewOptions( aOpt );
if (pSwView)
{