/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
// Scrollbars on / off if(bVScrollChanged)
{
pView->EnableVScrollbar(pNewPref->IsViewVScrollBar());
} if(bHScrollChanged)
{
pView->EnableHScrollbar( pNewPref->IsViewHScrollBar() || pNewPref->getBrowseMode() );
} //if only the position of the vertical ruler has been changed initiate an update if(bVAlignChanged && !bHScrollChanged && !bVScrollChanged)
pView->InvalidateBorder();
// Rulers on / off if(pNewPref->IsViewVRuler())
pView->CreateVRuler(); else
pView->KillVRuler();
// TabWindow on / off if(pNewPref->IsViewHRuler())
pView->CreateTab(); else
pView->KillTab();
bool bWeb = dynamic_cast<const SwWebView*>(pView) != nullptr;
SwModule* pModule = SwModule::get(); auto pUsrPref = const_cast<SwMasterUsrPref*>(pModule->GetUsrPref(bWeb)); if (rPref.GetZoomType() != pUsrPref->GetZoomType() || rPref.GetZoom() != pUsrPref->GetZoom())
{ // The current zoom is different, then set the new type and value. See how // SwView::SetZoom_() stores these applied values in SwMasterUsrPref.
pView->SetZoom(rPref.GetZoomType(), rPref.GetZoom(), true);
}
// New Master for the settings is set; this affects the current view and all following. void SwModule::ApplyUsrPref(const SwViewOption &rUsrPref, SwView* pActView,
SvViewOpt nDest )
{
SwView* pCurrView = pActView;
SwViewShell* pSh = pCurrView ? &pCurrView->GetWrtShell() : nullptr;
uno::Reference<XFrame> xBeamerFrame = xFrame->findFrame(u"_beamer"_ustr, FrameSearchFlag::CHILDREN); if (!xBeamerFrame.is()) return;
// the beamer has been opened by the SfxViewFrame
Reference<XController> xController = xBeamerFrame->getController();
Reference<XSelectionSupplier> xControllerSelection(xController, UNO_QUERY); if (xControllerSelection.is())
{
static Color lcl_GetAuthorColor(std::size_t nPos)
{ // same as SwPostItMgr::GetColorAnchor() switch (nPos % 9)
{ case 0: return SwModule::get()->GetColorConfig().GetColorValue(svtools::AUTHOR1).nColor; case 1: return SwModule::get()->GetColorConfig().GetColorValue(svtools::AUTHOR2).nColor; case 2: return SwModule::get()->GetColorConfig().GetColorValue(svtools::AUTHOR3).nColor; case 3: return SwModule::get()->GetColorConfig().GetColorValue(svtools::AUTHOR4).nColor; case 4: return SwModule::get()->GetColorConfig().GetColorValue(svtools::AUTHOR5).nColor; case 5: return SwModule::get()->GetColorConfig().GetColorValue(svtools::AUTHOR6).nColor; case 6: return SwModule::get()->GetColorConfig().GetColorValue(svtools::AUTHOR7).nColor; case 7: return SwModule::get()->GetColorConfig().GetColorValue(svtools::AUTHOR8).nColor; case 8: return SwModule::get()->GetColorConfig().GetColorValue(svtools::AUTHOR9).nColor; default: return COL_AUTO; // silence -Wreturn-type
}
}
/// Returns a JSON representation of a redline author. void SwModule::GetRedlineAuthorInfo(tools::JsonWriter& rJsonWriter)
{ auto authorsNode = rJsonWriter.startArray("authors"); for (std::size_t nAuthor = 0; nAuthor < m_pAuthorNames.size(); ++nAuthor)
{ auto authorNode = rJsonWriter.startStruct();
rJsonWriter.put("index", static_cast<sal_Int64>(nAuthor));
rJsonWriter.put("name", m_pAuthorNames[nAuthor]);
rJsonWriter.put("color", sal_uInt32(lcl_GetAuthorColor(nAuthor)));
}
}
// Passing-through of the ModuleConfig's Metric (for HTML-Export)
FieldUnit SwModule::GetMetric( bool bWeb ) const
{
SwMasterUsrPref* pPref; if(bWeb)
{ if(!m_pWebUsrPref)
GetUsrPref(true);
pPref = m_pWebUsrPref.get();
} else
{ if(!m_pUsrPref)
GetUsrPref(false);
pPref = m_pUsrPref.get();
}
assert(pPref && "pPref is set by here"); return pPref->GetMetric();
}
// Pass-through Update-Status
sal_uInt16 SwModule::GetLinkUpdMode() const
{ if (!m_pUsrPref)
GetUsrPref(false);
assert(m_pUsrPref && "m_pUsrPref is set by here"); return o3tl::narrowing<sal_uInt16>(m_pUsrPref->GetUpdateLinkMode());
}
SwFieldUpdateFlags SwModule::GetFieldUpdateFlags() const
{ if (!m_pUsrPref)
GetUsrPref(false);
assert(m_pUsrPref && "m_pUsrPref is set by here"); return m_pUsrPref->GetFieldUpdateFlags();
}
void SwModule::ApplyFieldUpdateFlags(SwFieldUpdateFlags eFieldFlags)
{ if (!m_pUsrPref)
GetUsrPref(false);
assert(m_pUsrPref && "m_pUsrPref is set by here");
m_pUsrPref->SetFieldUpdateFlags(eFieldFlags);
}
void SwModule::ApplyLinkMode(sal_Int32 nNewLinkMode)
{ if (!m_pUsrPref)
GetUsrPref(false);
assert(m_pUsrPref && "m_pUsrPref is set by here");
m_pUsrPref->SetUpdateLinkMode(nNewLinkMode);
}
void SwModule::ApplyDefaultPageMode(bool bIsSquaredPageMode)
{ if (!m_pUsrPref)
GetUsrPref(false);
assert(m_pUsrPref && "pPref is set by here");
m_pUsrPref->SetDefaultPageMode(bIsSquaredPageMode);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.