/* -*- 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 #include "ios/iosinst.hxx" #include "headless/svpdummies.hxx" #include "generic/gendata.hxx" #include "quartz/utils.h" #include #include // Horrible hack static int viewWidth = 1, viewHeight = 1; class IosSalData : public SalGenericData { public: explicit IosSalData(SalInstance *pInstance) : SalGenericData(SAL_DATA_IOS, pInstance) { } virtual void ErrorTrapPush() {} virtual bool ErrorTrapPop( bool ) { return false; } }; void IosSalInstance::GetWorkArea( Rectangle& rRect ) { rRect = Rectangle( Point( 0, 0 ), Size( viewWidth, viewHeight ) ); } IosSalInstance *IosSalInstance::getInstance() { if (!ImplGetSVData()) return NULL; IosSalData *pData = static_cast(ImplGetSVData()->mpSalData); if (!pData) return NULL; return static_cast(pData->m_pInstance); } IosSalInstance::IosSalInstance( SalYieldMutex *pMutex ) : SvpSalInstance( pMutex ) { } IosSalInstance::~IosSalInstance() { } class IosSalSystem : public SvpSalSystem { public: IosSalSystem() : SvpSalSystem() {} virtual ~IosSalSystem() {} virtual int ShowNativeDialog( const OUString& rTitle, const OUString& rMessage, const std::list< OUString >& rButtons, int nDefButton ); }; SalSystem *IosSalInstance::CreateSalSystem() { return new IosSalSystem(); } class IosSalFrame : public SvpSalFrame { public: IosSalFrame( IosSalInstance *pInstance, SalFrame *pParent, SalFrameStyleFlags nSalFrameStyle, SystemParentData *pSysParent ) : SvpSalFrame( pInstance, pParent, nSalFrameStyle, pSysParent ) { if (pParent == NULL && viewWidth > 1 && viewHeight > 1) SetPosSize(0, 0, viewWidth, viewHeight, SAL_FRAME_POSSIZE_WIDTH | SAL_FRAME_POSSIZE_HEIGHT); } virtual void GetWorkArea( Rectangle& rRect ) override { IosSalInstance::getInstance()->GetWorkArea( rRect ); } virtual void ShowFullScreen( bool, sal_Int32 ) override { SetPosSize( 0, 0, viewWidth, viewHeight, SAL_FRAME_POSSIZE_WIDTH | SAL_FRAME_POSSIZE_HEIGHT ); } virtual void UpdateSettings( AllSettings &rSettings ) override { // Clobber the UI fonts vcl::Font aFont( OUString( "Helvetica" ), Size( 0, 14 ) ); StyleSettings aStyleSet = rSettings.GetStyleSettings(); aStyleSet.SetAppFont( aFont ); aStyleSet.SetHelpFont( aFont ); aStyleSet.SetMenuFont( aFont ); aStyleSet.SetToolFont( aFont ); aStyleSet.SetLabelFont( aFont ); aStyleSet.SetInfoFont( aFont ); aStyleSet.SetRadioCheckFont( aFont ); aStyleSet.SetPushButtonFont( aFont ); aStyleSet.SetFieldFont( aFont ); aStyleSet.SetIconFont( aFont ); aStyleSet.SetTabFont( aFont ); aStyleSet.SetGroupFont( aFont ); rSettings.SetStyleSettings( aStyleSet ); } }; SalFrame *IosSalInstance::CreateChildFrame( SystemParentData* pParent, SalFrameStyleFlags nStyle ) { return new IosSalFrame( this, NULL, nStyle, pParent ); } SalFrame *IosSalInstance::CreateFrame( SalFrame* pParent, SalFrameStyleFlags nStyle ) { return new IosSalFrame( this, pParent, nStyle, NULL ); } // All the interesting stuff is slaved from the IosSalInstance void InitSalData() {} void DeInitSalData() {} void InitSalMain() {} void SalAbort( const OUString& rErrorText, bool bDumpCore ) { (void) bDumpCore; NSLog(@"SalAbort: %s", OUStringToOString(rErrorText, osl_getThreadTextEncoding()).getStr() ); } const OUString& SalGetDesktopEnvironment() { static OUString aEnv( "iOS" ); return aEnv; } SalData::SalData() : m_pInstance( 0 ), mpFontList( 0 ), mxRGBSpace( CGColorSpaceCreateDeviceRGB() ), mxGraySpace( CGColorSpaceCreateDeviceGray() ) { } SalData::~SalData() { } // This is our main entry point: SalInstance *CreateSalInstance() { IosSalInstance* pInstance = new IosSalInstance( new SalYieldMutex() ); new IosSalData( pInstance ); pInstance->AcquireYieldMutex(1); return pInstance; } void DestroySalInstance( SalInstance *pInst ) { pInst->ReleaseYieldMutex(); delete pInst; } int IosSalSystem::ShowNativeDialog( const OUString& rTitle, const OUString& rMessage, const std::list< OUString >& rButtons, int nDefButton ) { (void)rButtons; (void)nDefButton; NSLog(@"%@: %@", CreateNSString(rTitle), CreateNSString(rMessage)); return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ rts'>distro/lhm/libreoffice-6-4+backports LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-03-25new loplugin:unoqueryNoel Grandin
look for places we are doing code like: Reference<XProperty>(model, css::uno::UNO_QUERY)->getAsProperty() which might result in a SIGSEGV is the query fails Change-Id: I5cbdbc9e64bd0bed588297c512bf60cbacb9442e Reviewed-on: https://gerrit.libreoffice.org/69044 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-12tdf#42949 Fix IWYU warnings in include/connectivity/*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I02f75be483529ba1f7a6e460e34c4752b4265221 Reviewed-on: https://gerrit.libreoffice.org/68893 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-03-06loplugin:unnecessaryparen improve member expressionNoel Grandin
Change-Id: I304621018cb1e2a47e478e86df4229bcf2176741 Reviewed-on: https://gerrit.libreoffice.org/68757 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-05Use index only where getToken() needs itMatteo Casalin
Change-Id: I28da64c9ef9b36288f380300f6622d48483e6c0d Reviewed-on: https://gerrit.libreoffice.org/68125 Tested-by: Jenkins Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
2019-02-27loplugin:unnecessaryoverride look for more patternsNoel Grandin
like bool Foo::bar() { b = Super::bar(); return b; } Change-Id: I5e4c8005a3da7d7487c9039c35dcbb1d17e65bd7 Reviewed-on: https://gerrit.libreoffice.org/68418 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-25loplugin:unusedfields in variousNoel Grandin
Change-Id: I31d0e6c3559af2e322fb474b97f3bbf4d5064831 Reviewed-on: https://gerrit.libreoffice.org/68280 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-23loplugin:unusedfields in l10ntools..saxNoel Grandin
Change-Id: I6e4ff4853c3995072b020af54549dc81303a4fde Reviewed-on: https://gerrit.libreoffice.org/68225 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-13Pointer is pointlessNoel Grandin
since it is just a wrapper around PointerStyle Change-Id: I51f065e0d4ad8bd91f5c84c5819048c720a19267 Reviewed-on: https://gerrit.libreoffice.org/67711 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-12Simplify containers iterations in reportdesign, sal, saxArkadiy Illarionov
Use range-based loop or replace with STL functions Change-Id: If6b734dab12a7298fce16003d3d175305fbe798d Reviewed-on: https://gerrit.libreoffice.org/67701 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-11new loplugin writeonlyvarsNoel Grandin
largely based on the relevant portion of the unusedfields loplugin, but adapted for local vars Change-Id: Ic522a941573940e8f75c88f90ba5f37508ca49b1 Reviewed-on: https://gerrit.libreoffice.org/66835 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-11tdf#120703 PVS: V560 A part of conditional expression is always true/falseMike Kaganski
Change-Id: I4449fead67459bdcbdc0e9320129e7a5b36aecd9 Reviewed-on: https://gerrit.libreoffice.org/67545 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-02-11tdf#120703 PVS: V560 A part of conditional expression is always true/falseMike Kaganski
Change-Id: I67462369d93e9d9ff3c056800947c4b75f71ba5f Reviewed-on: https://gerrit.libreoffice.org/67486 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-02-11remove ControlDependencyManagerNoel Grandin
and just use our normal handlers, instead of this weird magic Change-Id: I8245787bec2a755ce6aba31ed681577771537ca1 Reviewed-on: https://gerrit.libreoffice.org/67534 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-09loplugin:indentation in registry..saxNoel Grandin
Change-Id: I4b877751818febaec8e64018335dca691a476a43 Reviewed-on: https://gerrit.libreoffice.org/67561 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-05tdf#42949 Fix IWYU warnings in include/svtools/*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I937ed12f2a96943664087ddcdd035f1347e84a57 Reviewed-on: https://gerrit.libreoffice.org/67102 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-01-22tdf#42949 Fix IWYU warnings in include/xmloff/*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Id20e0bc42e39f868a7c5d49d756f2ad5e14a86c0 Reviewed-on: https://gerrit.libreoffice.org/66637 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-01-22o3tl::make_unique -> std::make_unique in i18npool...reportdesignGabor Kelemen
Since it is now possible to use C++14, it's time to replace the temporary solution with the standard one Change-Id: I8bee1344f7df82536f31bc5e4ec4fd379cac1d04 Reviewed-on: https://gerrit.libreoffice.org/66704 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-07tdf#42949 Fix IWYU warnings in include/vcl/[v-x]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I98f49765c6b74808dcbd692e0f375dd2848fcfd4 Reviewed-on: https://gerrit.libreoffice.org/65614 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>