/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2010 Red Hat, Inc., David Tardon * (initial developer) * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 3 or later (the "GPLv3+"), or * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable * instead of those above. */ namespace detail { template struct has_clone { template struct test; typedef char yes; typedef struct { char a[2]; } no; template static yes& check_sig(U*, test* = 0); template static no& check_sig(...); enum { value = sizeof(check_sig(0)) == sizeof(yes) }; }; template struct cloner { static T* clone(T* const other) { return new T(*other); } }; template struct cloner { static T* clone(T* const other) { return other->clone(); } }; } /** Creates a new copy of the passed object. If other is 0, just returns 0. Otherwise, if other has function named clone with signature T* (T::*)() const, the function is called. Otherwise, copy constructor is used. @returns 0 or newly allocated object */ template T* clone(T* const other) { return other ? ::detail::cloner::value>::clone(other) : 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ collabora/co-2021 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2013-05-08zlib: remove ExternalPackage_zlibMichael Stahl
2013-04-15fdo#60724 correct spellingThomas Arnhold
2013-04-15fdo#60724 informations -> informationThomas Arnhold
2013-04-07mass removal of rtl:: prefixes for O(U)String*Luboš Luňák
2013-03-27-Wunused-macrosStephan Bergmann
2013-03-25Remove unused macros from checked-in Flex/Bison outputStephan Bergmann
2013-03-25Reduce confusion by removing #line directivesStephan Bergmann
2013-03-19reduce whitespaces between include and filenameThomas Arnhold
2013-03-06coverity#983009: Resource leakJulien Nabet
2013-03-06fdo#60148 Clean up warnings from the Clang compiler pluginnccuong
2013-03-04doubled namespacesThomas Arnhold
2013-03-04doubled includesThomas Arnhold
2013-02-25loplugin: improve indentationThomas Arnhold
2013-02-23Fix typo "sucessfully" -> "successfully"Julien Nabet
2012-12-27More MSC -> _MSC_VER, sorryTor Lillqvist
2012-12-21Remove unused cppuhelper/servicefactory.hxx includesStephan Bergmann
2012-10-17More useless code, "#if 0" blocks in lingucomponent, sal, and rscMarcos Paulo de Souza
2012-10-04sal_Bool->bool in hwpfilterNoel Grandin
2012-10-04sal_Bool -> bool in hwpfilterNoel Grandin
2012-09-14Improvement on previous commit, UCB clean upStephan Bergmann
2012-09-01add more component prefixesMatúš Kukan
2012-08-14-Werror,-Wunused-private-field (Clang towards 3.2)Stephan Bergmann
2012-08-08Fix windows build where min and max are macrosAndras Timar
2012-07-24-Werror=formatIvan Timofeev
2012-07-24hwpfilter: improve text import and error handlingMichael Stahl
2012-07-03coverity: idx == 0x1F cannot be trueDavid Tardon
2012-06-30Some cppcheck cleaningJulien Nabet
2012-06-22re-base on ALv2 code. Includes:Michael Meeks
2012-06-22re-base on ALv2 code.Michael Meeks
2012-06-21re-base on ALv2 code.Michael Meeks
2012-05-31targeted string re-workNorbert Thiebaud
2012-04-16WaE: "isnan" redefinedDavid Tardon
2012-04-13sigh, need a 64bit zlib too on windows, revertingCaolán McNamara
2012-04-13gbuildize internal zlibCaolán McNamara
2012-04-12remove formfeedsThomas Arnhold
2012-04-08Replaced a few equal calls with ==Szabolcs Dezsi
2012-04-06Replaced equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(...)) with == operatorSzabolcs Dezsi
2012-03-10write unsigned char[] contents as numbers rather than string literalLuboš Luňák
2012-03-10mark static data that is const as constLuboš Luňák
2012-03-05WaE: calling delete on the wrong thingCaolán McNamara
2012-03-05Kill LinkedList in hwpfilterSzabolcs Dezsi
2012-03-03Avoid temporary rtl::OUStringJulien Nabet
2012-03-01WaE: function 'yyinput' is not needed and will not be emittedTor Lillqvist
2012-03-01#pragma interface and #pragma implementation are obsolete and pointlessTor Lillqvist
2012-02-21WaE: duplicateBranchThomas Arnhold
2012-02-13EasyHack: Removed gcc conditionalsAlexander Bergmann
2012-02-13Fix typos in commentsElton Chung