/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 3 * only, as published by the Free Software Foundation. * * OpenOffice.org is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License version 3 for more details * (a copy is included in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU Lesser General Public License * version 3 along with OpenOffice.org. If not, see * * for a copy of the LGPLv3 License. * ************************************************************************/ #include #include #include #include #include #include #include using rtl::OUString; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::ui::dialogs; // --------------- // - ColorDialog - // --------------- SvColorDialog::SvColorDialog( Window* pWindow ) : mpParent( pWindow ) , meMode( svtools::ColorPickerMode_SELECT ) { } SvColorDialog::~SvColorDialog() { } void SvColorDialog::SetColor( const Color& rColor ) { maColor = rColor; } // ----------------------------------------------------------------------- const Color& SvColorDialog::GetColor() const { return maColor; } // ----------------------------------------------------------------------- void SvColorDialog::SetMode( sal_Int16 eMode ) { meMode = eMode; } // ----------------------------------------------------------------------- short SvColorDialog::Execute() { short ret = 0; try { const OUString sColor( RTL_CONSTASCII_USTRINGPARAM( "Color" ) ); Reference< XMultiServiceFactory > xSMGR( ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW ); Reference< com::sun::star::awt::XWindow > xParent( VCLUnoHelper::GetInterface( mpParent ) ); Sequence< Any > args(1); args[0] = Any( xParent ); Reference< XExecutableDialog > xDialog( xSMGR->createInstanceWithArguments(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.cui.ColorPicker")), args), UNO_QUERY_THROW ); Reference< XPropertyAccess > xPropertyAccess( xDialog, UNO_QUERY_THROW ); Sequence< PropertyValue > props( 2 ); props[0].Name = sColor; props[0].Value <<= (sal_Int32) maColor.GetColor(); props[1].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Mode" ) ); props[1].Value <<= (sal_Int16) meMode; xPropertyAccess->setPropertyValues( props ); ret = xDialog->execute(); if( ret ) { props = xPropertyAccess->getPropertyValues(); for( sal_Int32 n = 0; n < props.getLength(); n++ ) { if( props[n].Name.equals( sColor ) ) { sal_Int32 nColor = 0; if( props[n].Value >>= nColor ) { maColor.SetColor( nColor ); } } } } } catch(Exception&) { OSL_ASSERT(false); } return ret; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ollabora/dcm-7.5 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2017-04-29some other places uiconfig_editeng should appearCaolán McNamara
2017-04-29tdf#107464 editeng ui files not packed in install setsCaolán McNamara
2017-04-27sdbcl is goneCaolán McNamara
2017-04-27remove wizards bitmaps from .src filesCaolán McNamara
2017-04-26remove extensions bitmaps from .src filesCaolán McNamara
2017-04-25tdf#106359: register text/x-ms-iqy MediaType default extensionMike Kaganski
2017-04-21gbuild: Remove MSVC 2013 legacy codeDavid Ostrovsky
2017-04-14remove the old collaboration feature based on telepathyMarkus Mohrhard
2017-04-06tdf#106359: register .iqy in MSI and treat them as templatesMike Kaganski
2017-03-19scp2: Removed unused Directory itemsStephan Bergmann
2017-03-16Remove extra spaceStephan Bergmann
2017-03-16Revert "Don't package unoinfo in case of Mac OS X like app structure"Stephan Bergmann
2017-02-15Support MSVC 15.0David Ostrovsky
2017-02-13AutoInstall oox filter data packages to ooo moduleMatúš Kukan
2017-02-10Remove MinGW supportStephan Bergmann
2017-02-02drop bundled ooo2gd (Google Docs) extensionDavid Tardon
2017-01-27SafeMode: Add Backup config to installationSamuel Mehrbrodt
2017-01-27Put crash directory config in soffice.ini, instead of own ini fileSamuel Mehrbrodt
2017-01-24Crashdump: Make crash directory configurableSamuel Mehrbrodt
2017-01-13Remove unused ini propertiesSamuel Mehrbrodt
2017-01-09tdf#90753 scp2: move firebirdsdbc packages to AutoInstallMichael Stahl
2017-01-07Clean up stale merge modulesDavid Ostrovsky
2016-12-25tdf#90753: AutoInstall libreofficekit_selectionhandles packageMatúš Kukan
2016-12-24tdf#90753: AutoInstall shell_senddoc packageMatúš Kukan
2016-12-24tdf#90753: AutoInstall xpdfimport_err.pdf as filelistMatúš Kukan
2016-12-24tdf#90753: AutoInstall postgresql-sdbc.ini as filelistMatúš Kukan
2016-12-12gid_File_Bin_Gnome_Open_Url was removedMatúš Kukan
2016-12-02scp2: Bin not defined gids and not used definesMatúš Kukan
2016-12-02tdf#90753: AutoInstall readlicense_oo packagesMatúš Kukan
2016-12-02tdf#90753: AutoInstall setup_native packagesMatúš Kukan
2016-12-01tdf#90753: AutoInstall gengal with filelist featureMatúš Kukan
2016-11-30tdf#90753: AutoInstall more packagesMatúš Kukan
2016-11-30tdf#90753: Autoinstall sdk packagesMatúš Kukan
2016-11-30Remove Noto Emoji fontAkshay Deep
2016-11-29EMOJI CONTROL: Add EmojiOne font for Emoji SupportAkshay Deep
2016-11-26tdf#90753: Move extras packages to AutoInstallMatúš Kukan
2016-11-25tdf#90753: Move brand packages to AutoInstallMatúš Kukan