diff options
-rw-r--r-- | include/svl/dateitem.hxx | 76 | ||||
-rw-r--r-- | sd/source/ui/dlg/dlgassim.hxx | 1 | ||||
-rw-r--r-- | sfx2/inc/pch/precompiled_sfx.hxx | 1 | ||||
-rw-r--r-- | sfx2/source/appl/appdata.cxx | 1 | ||||
-rw-r--r-- | svl/Library_svl.mk | 1 | ||||
-rw-r--r-- | svl/source/items/dateitem.cxx | 191 |
6 files changed, 0 insertions, 271 deletions
diff --git a/include/svl/dateitem.hxx b/include/svl/dateitem.hxx deleted file mode 100644 index 1a3a7c28ba0b..000000000000 --- a/include/svl/dateitem.hxx +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- 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 . - */ -#ifndef INCLUDED_SVL_DATEITEM_HXX -#define INCLUDED_SVL_DATEITEM_HXX - -#include <tools/rtti.hxx> -#include <tools/datetime.hxx> - -#include <svl/poolitem.hxx> - -class SvStream; - -DBG_NAMEEX(SfxDateTimeItem) - -// class SfxDateTimeItem ------------------------------------------------- - -class SfxDateTimeItem : public SfxPoolItem -{ -private: - DateTime aDateTime; - -public: - TYPEINFO(); - - SfxDateTimeItem( sal_uInt16 nWhich, - const DateTime& rDT ); - SfxDateTimeItem( const SfxDateTimeItem& rCpy ); - - ~SfxDateTimeItem() { - DBG_DTOR(SfxDateTimeItem, 0); } - - virtual int operator==( const SfxPoolItem& ) const; - using SfxPoolItem::Compare; - virtual int Compare( const SfxPoolItem &rWith ) const; - virtual SfxPoolItem* Create( SvStream&, sal_uInt16 nItemVersion ) const; - virtual SvStream& Store( SvStream&, sal_uInt16 nItemVersion ) const; - virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; - - virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, - SfxMapUnit eCoreMetric, - SfxMapUnit ePresMetric, - OUString &rText, - const IntlWrapper * pIntlWrapper = 0 ) - const; - - const DateTime& GetDateTime() const { return aDateTime; } - void SetDateTime( const DateTime& rDT ) { - DBG_ASSERT( GetRefCount() == 0, - "SetDateTime() with pooled item" ); - aDateTime = rDT; } - - virtual bool PutValue ( const com::sun::star::uno::Any& rVal, - sal_uInt8 nMemberId = 0 ); - virtual bool QueryValue( com::sun::star::uno::Any& rVal, - sal_uInt8 nMemberId = 0 ) const; -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/dlg/dlgassim.hxx b/sd/source/ui/dlg/dlgassim.hxx index f9918e713edd..a62d476e45dc 100644 --- a/sd/source/ui/dlg/dlgassim.hxx +++ b/sd/source/ui/dlg/dlgassim.hxx @@ -17,7 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <svl/dateitem.hxx> #include "drawdoc.hxx" #include <svx/svdotext.hxx> #include <svtools/treelistbox.hxx> diff --git a/sfx2/inc/pch/precompiled_sfx.hxx b/sfx2/inc/pch/precompiled_sfx.hxx index 8a145d642dc8..e11f7a584016 100644 --- a/sfx2/inc/pch/precompiled_sfx.hxx +++ b/sfx2/inc/pch/precompiled_sfx.hxx @@ -647,7 +647,6 @@ #include <svl/aeitem.hxx> #include <svl/ctloptions.hxx> #include <svl/ctypeitm.hxx> -#include <svl/dateitem.hxx> #include <svl/documentlockfile.hxx> #include <svl/eitem.hxx> #include <svl/flagitem.hxx> diff --git a/sfx2/source/appl/appdata.cxx b/sfx2/source/appl/appdata.cxx index ccc9eb1574ec..49b4825bff4f 100644 --- a/sfx2/source/appl/appdata.cxx +++ b/sfx2/source/appl/appdata.cxx @@ -24,7 +24,6 @@ #include <vcl/menu.hxx> #include <vcl/msgbox.hxx> -#include <svl/dateitem.hxx> #include <vcl/wrkwin.hxx> #include <comphelper/processfactory.hxx> diff --git a/svl/Library_svl.mk b/svl/Library_svl.mk index d6d83b5e0ceb..37325614de3c 100644 --- a/svl/Library_svl.mk +++ b/svl/Library_svl.mk @@ -69,7 +69,6 @@ $(eval $(call gb_Library_add_exception_objects,svl,\ svl/source/items/cntwall \ svl/source/items/ctypeitm \ svl/source/items/custritm \ - svl/source/items/dateitem \ svl/source/items/flagitem \ svl/source/items/globalnameitem \ svl/source/items/grabbagitem \ diff --git a/svl/source/items/dateitem.cxx b/svl/source/items/dateitem.cxx deleted file mode 100644 index a734b3569f77..000000000000 --- a/svl/source/items/dateitem.cxx +++ /dev/null @@ -1,191 +0,0 @@ -/* -*- 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 <svl/dateitem.hxx> - -#include <unotools/intlwrapper.hxx> -#include <comphelper/processfactory.hxx> - -#include <tools/stream.hxx> -#include <tools/debug.hxx> -#include <tools/datetime.hxx> -#include <com/sun/star/uno/Any.hxx> -#include <com/sun/star/util/DateTime.hpp> -#include <com/sun/star/lang/Locale.hpp> - - -// STATIC DATA ----------------------------------------------------------- - -DBG_NAME(SfxDateTimeItem) - - -// ----------------------------------------------------------------------- - -TYPEINIT1(SfxDateTimeItem, SfxPoolItem); - -// ----------------------------------------------------------------------- - -SfxDateTimeItem::SfxDateTimeItem( sal_uInt16 which, const DateTime& rDT ) : - SfxPoolItem( which ), - aDateTime( rDT ) - -{ - DBG_CTOR(SfxDateTimeItem, 0); -} - -// ----------------------------------------------------------------------- - -SfxDateTimeItem::SfxDateTimeItem( const SfxDateTimeItem& rItem ) : - SfxPoolItem( rItem ), - aDateTime( rItem.aDateTime ) -{ - DBG_CTOR(SfxDateTimeItem, 0); -} - -// ----------------------------------------------------------------------- - -int SfxDateTimeItem::operator==( const SfxPoolItem& rItem ) const -{ - DBG_CHKTHIS(SfxDateTimeItem, 0); - DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" ); - return ( ( (SfxDateTimeItem&)rItem ).aDateTime == aDateTime ); -} - -// ----------------------------------------------------------------------- - -int SfxDateTimeItem::Compare( const SfxPoolItem& rItem ) const -{ - DBG_CHKTHIS(SfxDateTimeItem, 0); - DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" ); - - // da X.Compare( Y ) am String einem Compare( Y, X ) entspricht, - // vergleichen wir hier Y mit X - if ( ( (const SfxDateTimeItem&)rItem ).aDateTime < aDateTime ) - return -1; - else if ( ( (const SfxDateTimeItem&)rItem ).aDateTime == aDateTime ) - return 0; - else - return 1; -} - -// ----------------------------------------------------------------------- - -SfxPoolItem* SfxDateTimeItem::Create( SvStream& rStream, sal_uInt16 ) const -{ - DBG_CHKTHIS(SfxDateTimeItem, 0); - sal_uInt32 nDate = 0; - sal_Int64 nTime = 0; - rStream >> nDate; - rStream.ReadInt64(nTime); - DateTime aDT(nDate, nTime); - return new SfxDateTimeItem( Which(), aDT ); -} - -// ----------------------------------------------------------------------- - -SvStream& SfxDateTimeItem::Store( SvStream& rStream, sal_uInt16 ) const -{ - DBG_CHKTHIS(SfxDateTimeItem, 0); - rStream << aDateTime.GetDate(); - rStream.WriteInt64(aDateTime.GetTime()); - return rStream; -} - -// ----------------------------------------------------------------------- - -SfxPoolItem* SfxDateTimeItem::Clone( SfxItemPool* ) const -{ - DBG_CHKTHIS(SfxDateTimeItem, 0); - return new SfxDateTimeItem( *this ); -} - -// ----------------------------------------------------------------------- - -SfxItemPresentation SfxDateTimeItem::GetPresentation -( - SfxItemPresentation /*ePresentation*/, - SfxMapUnit /*eCoreMetric*/, - SfxMapUnit /*ePresentationMetric*/, - OUString& rText, - const IntlWrapper * pIntlWrapper -) const -{ - DBG_CHKTHIS(SfxDateTimeItem, 0); - if (aDateTime.IsValidDate()) - if (pIntlWrapper) - { - rText = pIntlWrapper->getLocaleData()->getDate(aDateTime) + - ", " + - pIntlWrapper->getLocaleData()->getTime(aDateTime); - } - else - { - DBG_WARNING("SfxDateTimeItem::GetPresentation():" - " Using default en_US IntlWrapper"); - const IntlWrapper aIntlWrapper( LanguageTag( LANGUAGE_ENGLISH_US) ); - rText = aIntlWrapper.getLocaleData()->getDate(aDateTime) + - ", " + - aIntlWrapper.getLocaleData()->getTime(aDateTime); - } - else - rText = OUString(); - return SFX_ITEM_PRESENTATION_NAMELESS; -} - -// virtual -bool SfxDateTimeItem::PutValue( const com::sun::star::uno::Any& rVal, - sal_uInt8 nMemberId ) -{ - nMemberId &= ~CONVERT_TWIPS; - com::sun::star::util::DateTime aValue; - if ( rVal >>= aValue ) - { - aDateTime = DateTime( Date( aValue.Day, - aValue.Month, - aValue.Year ), - Time( aValue.Hours, - aValue.Minutes, - aValue.Seconds, - aValue.NanoSeconds ) ); - return true; - } - - OSL_FAIL( "SfxDateTimeItem::PutValue - Wrong type!" ); - return false; -} - -// virtual -bool SfxDateTimeItem::QueryValue( com::sun::star::uno::Any& rVal, - sal_uInt8 nMemberId ) const -{ - nMemberId &= ~CONVERT_TWIPS; - com::sun::star::util::DateTime aValue( aDateTime.GetNanoSec(), - aDateTime.GetSec(), - aDateTime.GetMin(), - aDateTime.GetHour(), - aDateTime.GetDay(), - aDateTime.GetMonth(), - aDateTime.GetYear(), - false); - rVal <<= aValue; - return true; -} - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |