/* -*- 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 .
*/
// our printer should always use TWIP. Don't rely on this being set in SwViewShell::InitPrt, there // are situations where this isn't called. #i108712# if ( mpPrt )
{
MapMode aMapMode( mpPrt->GetMapMode() );
aMapMode.SetMapUnit( MapUnit::MapTwip );
mpPrt->SetMapMode( aMapMode );
}
if ( bCallPrtDataChanged && // #i41075# Do not call PrtDataChanged() if we do not // use the printer for formatting:
!m_rDoc.GetDocumentSettingManager().get(DocumentSettingId::USE_VIRTUAL_DEVICE) )
PrtDataChanged();
}
VirtualDevice* DocumentDeviceManager::getVirtualDevice(/*[in]*/ bool bCreate ) const
{
VirtualDevice* pRet = nullptr; if ( !bCreate || mpVirDev )
pRet = mpVirDev; else
pRet = &CreateVirtualDevice_();
if( m_rDoc.getIDocumentDrawModelAccess().GetDrawModel() )
m_rDoc.getIDocumentDrawModelAccess().GetDrawModel()->SetRefDevice( pMyVirDev );
} else
{ // #i41075# // We have to take care that a printer exists before calling // PrtDataChanged() in order to prevent that PrtDataChanged() // triggers this funny situation: // getReferenceDevice()->getPrinter()->CreatePrinter_() // ->setPrinter()-> PrtDataChanged()
SfxPrinter* pPrinter = getPrinter( true ); if( m_rDoc.getIDocumentDrawModelAccess().GetDrawModel() )
m_rDoc.getIDocumentDrawModelAccess().GetDrawModel()->SetRefDevice( pPrinter );
}
// SwPrintData should be initialized from the configuration, // the respective config item is implemented by SwPrintOptions which // is also derived from SwPrintData const SwDocShell *pDocSh = m_rDoc.GetDocShell();
OSL_ENSURE( pDocSh, "pDocSh is 0, can't determine if this is a WebDoc or not" ); bool bWeb = dynamic_cast< const SwWebDocShell * >(pDocSh) != nullptr;
*pThis->mpPrtData = SwPrintOptions(bWeb);
}
assert(mpPrtData && "this will always be set by now"); return *mpPrtData;
}
// #i60945# External leading compatibility for unix systems. if ( m_rDoc.GetDocumentSettingManager().get(DocumentSettingId::UNIX_FORCE_ZERO_EXT_LEADING ) )
pNewVir->Compat_ZeroExtleadBug();
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.