/* -*- 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 . */ #include #include #include @implementation AquaPrintView -(id)initWithController: (vcl::PrinterController*)pController withInfoPrinter: (AquaSalInfoPrinter*)pInfoPrinter { NSRect aRect = { NSZeroPoint, [pInfoPrinter->getPrintInfo() paperSize] }; if( (self = [super initWithFrame: aRect]) != nil ) { mpController = pController; mpInfoPrinter = pInfoPrinter; } return self; } -(BOOL)knowsPageRange: (NSRangePointer)range { range->location = 1; range->length = mpInfoPrinter->getCurPageRangeCount(); return YES; } -(NSRect)rectForPage: (int)page { NSSize aPaperSize = [mpInfoPrinter->getPrintInfo() paperSize]; int nWidth = static_cast(aPaperSize.width); // #i101108# sanity check if( nWidth < 1 ) nWidth = 1; NSRect aRect = { { static_cast(page % nWidth), static_cast(page / nWidth) }, aPaperSize }; return aRect; } -(NSPoint)locationOfPrintRect: (NSRect)aRect { (void)aRect; return NSZeroPoint; } -(void)drawRect: (NSRect)rect { mpInfoPrinter->setStartPageOffset( static_cast(rect.origin.x), static_cast(rect.origin.y) ); NSSize aPaperSize = [mpInfoPrinter->getPrintInfo() paperSize]; int nPage = static_cast(aPaperSize.width * rect.origin.y + rect.origin.x); // page count is 1 based if( nPage - 1 < (mpInfoPrinter->getCurPageRangeStart() + mpInfoPrinter->getCurPageRangeCount() ) ) mpController->printFilteredPage( nPage-1 ); } @end /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ istro/collabora/co-22.05-testflight LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
ky 2-17 07:52:09 +0200'>2017-02-17
AgeCommit message (Expand)Author
2019-10-30Upgrade to ICU 65.1Eike Rathke
2017-12-22request installation of langpack via packagekitCaolán McNamara
2013-10-23fixincludeguards.sh: include/s*Thomas Arnhold
2013-07-26targetted clean of redundant header piece from 62badf3828Michael Meeks
2013-04-23execute move of global headersBjoern Michaelsen
remove unused KeywordsOnly from IdentifierTranslationModeNoel Grandin
2017-02-01loplugin:useuniqueptr extend to check local varsNoel Grandin
2017-01-26Remove dynamic exception specificationsStephan Bergmann
2017-01-24loplugin: unnecessary destructor: basctl..codemakerNoel Grandin
2017-01-19New loplugin:dynexcspec: Add @throws documentation, codemakerStephan Bergmann
2016-11-08loplugin:unnecessaryvirtual in basctl..chart2Noel Grandin
2016-09-24we shouldn't need explicit lt_rtl_OUString, etc things anymoreCaolán McNamara
2016-09-13loplugin:override: No more need for the "MSVC dtor override" workaroundStephan Bergmann
2016-07-27improve passstuffbyref return analysisNoel Grandin
2016-04-13loplugin:passstuffbyref in codemakerNoel Grandin
2016-03-03loplugin:unuseddefaultparams variousNoel Grandin
2016-02-24convert codemaker::UnoType::Sort to scoped enumNoel Grandin
2016-02-24unused enum FileAccessModeNoel Grandin
2016-02-24convert codemaker::cpp::IdentifierTranslationMode to scoped enumNoel Grandin
2016-02-09Remove excess newlinesChris Sherlock
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann
2015-10-12Replace "SAL_DELETED_FUNCTION" with "= delete" in LIBO_INTERNAL_ONLY codeStephan Bergmann
2015-06-23Revert "Typo: iff->if"Julien Nabet
2015-06-23Typo: iff->ifJulien Nabet
2015-02-07loplugin:deletedspecialStephan Bergmann
2015-01-02boost::unordered_map->std::unordered_mapCaolán McNamara
2014-11-06Revert "use the new OUString::fromUtf8 method"Stephan Bergmann
2014-11-06use the new OUString::fromUtf8 methodNoel Grandin
2014-09-18fdo#83512 Make use of OUStringHash and OStringHashDaniel Sikeler
2014-06-24new compilerplugin returnbyrefNoel Grandin
2014-06-17improve the inlinesimplememberfunctions clang pluginNoel Grandin
2014-06-09loplugin: inlinesimplememberfunctionsNoel Grandin