/* -*- 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 #include #include #include #include using namespace ::com::sun::star::uno; using namespace ::com::sun::star::container; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::xml; SvXMLAttrContainerItem::SvXMLAttrContainerItem( sal_uInt16 _nWhich ) : SfxPoolItem( _nWhich ), pImpl( new SvXMLAttrContainerData ) { } SvXMLAttrContainerItem::SvXMLAttrContainerItem( const SvXMLAttrContainerItem& rItem ) : SfxPoolItem( rItem ), pImpl( new SvXMLAttrContainerData( *rItem.pImpl ) ) { } SvXMLAttrContainerItem::~SvXMLAttrContainerItem() { } bool SvXMLAttrContainerItem::operator==( const SfxPoolItem& rItem ) const { DBG_ASSERT( dynamic_cast< const SvXMLAttrContainerItem* >(&rItem) != nullptr, "SvXMLAttrContainerItem::operator ==(): Bad type"); return *pImpl.get() == *static_cast(rItem).pImpl.get(); } bool SvXMLAttrContainerItem::GetPresentation( SfxItemPresentation /*ePresentation*/, MapUnit /*eCoreMetric*/, MapUnit /*ePresentationMetric*/, OUString & /*rText*/, const IntlWrapper& /*rIntlWrapper*/ ) const { return false; } sal_uInt16 SvXMLAttrContainerItem::GetVersion( sal_uInt16 /*nFileFormatVersion*/ ) const { // This item should never be stored return USHRT_MAX; } bool SvXMLAttrContainerItem::QueryValue( css::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const { Reference xContainer = new SvUnoAttributeContainer( o3tl::make_unique( *pImpl.get() ) ); rVal <<= xContainer; return true; } bool SvXMLAttrContainerItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) { SvUnoAttributeContainer* pContainer = nullptr; Reference xTunnel(rVal, UNO_QUERY); if( xTunnel.is() ) pContainer = reinterpret_cast((sal_uLong)xTunnel->getSomething(SvUnoAttributeContainer::getUnoTunnelId())); if( pContainer ) { pImpl.reset( new SvXMLAttrContainerData( * pContainer->GetContainerImpl() ) ); } else { std::unique_ptr pNewImpl(new SvXMLAttrContainerData); try { Reference xContainer( rVal, UNO_QUERY ); if( !xContainer.is() ) return false; const Sequence< OUString > aNameSequence( xContainer->getElementNames() ); const OUString* pNames = aNameSequence.getConstArray(); const sal_Int32 nCount = aNameSequence.getLength(); Any aAny; sal_Int32 nAttr; for( nAttr = 0; nAttr < nCount; nAttr++ ) { const OUString aName( *pNames++ ); aAny = xContainer->getByName( aName ); auto pData = o3tl::tryAccess(aAny); if( !pData ) return false; sal_Int32 pos = aName.indexOf( ':' ); if( pos != -1 ) { const OUString aPrefix( aName.copy( 0, pos )); const OUString aLName( aName.copy( pos+1 )); if( pData->Namespace.isEmpty() ) { if( !pNewImpl->AddAttr( aPrefix, aLName, pData->Value ) ) break; } else { if( !pNewImpl->AddAttr( aPrefix, pData->Namespace, aLName, pData->Value ) ) break; } } else { if( !pNewImpl->AddAttr( aName, pData->Value ) ) break; } } if( nAttr == nCount ) pImpl = std::move(pNewImpl); else return false; } catch(...) { return false; } } return true; } bool SvXMLAttrContainerItem::AddAttr( const OUString& rLName, const OUString& rValue ) { return pImpl->AddAttr( rLName, rValue ); } bool SvXMLAttrContainerItem::AddAttr( const OUString& rPrefix, const OUString& rNamespace, const OUString& rLName, const OUString& rValue ) { return pImpl->AddAttr( rPrefix, rNamespace, rLName, rValue ); } sal_uInt16 SvXMLAttrContainerItem::GetAttrCount() const { return (sal_uInt16)pImpl->GetAttrCount(); } OUString SvXMLAttrContainerItem::GetAttrNamespace( sal_uInt16 i ) const { return pImpl->GetAttrNamespace( i ); } OUString SvXMLAttrContainerItem::GetAttrPrefix( sal_uInt16 i ) const { return pImpl->GetAttrPrefix( i ); } const OUString& SvXMLAttrContainerItem::GetAttrLName( sal_uInt16 i ) const { return pImpl->GetAttrLName( i ); } const OUString& SvXMLAttrContainerItem::GetAttrValue( sal_uInt16 i ) const { return pImpl->GetAttrValue( i ); } sal_uInt16 SvXMLAttrContainerItem::GetFirstNamespaceIndex() const { return pImpl->GetFirstNamespaceIndex(); } sal_uInt16 SvXMLAttrContainerItem::GetNextNamespaceIndex( sal_uInt16 nIdx ) const { return pImpl->GetNextNamespaceIndex( nIdx ); } const OUString& SvXMLAttrContainerItem::GetNamespace( sal_uInt16 i ) const { return pImpl->GetNamespace( i ); } const OUString& SvXMLAttrContainerItem::GetPrefix( sal_uInt16 i ) const { return pImpl->GetPrefix( i ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ o/mimo-6-0'>distro/mimo/mimo-6-0 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2020-09-24plus minus sidebar icon theme updateandreas kainz
2020-09-12Breeze,Colibre,elementary,KJ,Sukapura: tdf#136593 icon for new Distribution u...Rizal Muttaqin
2020-09-06Breeze, Colibre, elementary, KJ: tdf#136454 LibreLogo iconsRizal Muttaqin
2020-08-21tdf#135028 icons for Style InspectorRizal Muttaqin
2020-08-20tdf#135931 Breeze Line Numbering iconsRizal Muttaqin
2020-08-18Update Line Numbering iconsRizal Muttaqin
2020-08-14Breeze & Sifr tdf#131456 ^ Orientation iconsRizal Muttaqin
2020-08-13tdf#135265 Add icon variants in Manage Changes dialogRizal Muttaqin
2020-07-31tdf#134887 NewToolbarController: Use different icons for extra largeMaxim Monastirsky
2020-07-19Icons: tdf#134833 icons for AdditionsRizal Muttaqin
2020-07-13Icon themes: Fix for tdf#134768Rizal Muttaqin
2020-06-27Breeze: tdf#133538, tdf#126122, tdf#70102Rizal Muttaqin
2020-06-12Breeze: tdf#133753: base point, Calc left to right imagesRizal Muttaqin
2020-06-10tdf#133819 support for tristate checkboxesRizal Muttaqin
2020-06-09Icon theme: tdf#133582 missing checkbox and radio button in gen envRizal Muttaqin
2020-06-07All icons: Update MIME typeRizal Muttaqin
2020-06-06tdf#128743 remove completely Start Center's sidebar motifRizal Muttaqin
2020-05-15Breeze, Colibre, elementary, Sukapura: Add left sidebar motifRizal Muttaqin
2020-05-05Icons: fix for tdf#128689 wrong Korean vertical text iconsRizal Muttaqin
2020-04-28Breeze, elementary, KJ: Add Modify Layer iconsRizal Muttaqin
2020-04-20Breeze,elementary,KJ,Sifr: Fix for tdf#128689Rizal Muttaqin
2020-04-15Breeze: Add support for Korean UI tdf#128689Rizal Muttaqin
2020-04-10Breeze,elementary,KJ,Sifr:+ DB Record support 4 RTL UIRizal Muttaqin
2020-04-09Breeze, elementary, KJ, Sifr: Update localization supportRizal Muttaqin
2020-04-09Breeze: Fix for tdf#131984: missing icons for Writer's Data SourceRizal Muttaqin
2020-04-08All icons: fix for tdf#131975, Breeze, Sifr fix for tdf#131974Rizal Muttaqin
2020-03-30Breeze: Update MIME type icons in "New (CTRL+N)"Rizal Muttaqin
2020-03-29Breeze: Update MIME types, Gallery view type iconsRizal Muttaqin
2020-03-28Breeze & Colibre: Fix for tdf#131636 to Bg & to Fg iconsRizal Muttaqin
2020-02-26Breeze & Sifr: Fix for tdf#130939rizmut
2020-02-23Breeze: Add many Base iconsrizmut
2020-02-23Breeze: FIx for tdf#130879 (missing spacing char icons)rizmut
2020-02-23Breeze & Sifr: Fix for tdf#130875: add Envelope Orientation iconsrizmut
2020-02-23Breeze, Colibre. Sifr: Fix for tdf#130871rizmut
2020-02-15tdf#130648:+ icons for new .uno:ProtectBookmarks & .uno:ProtectFieldsrizmut
2020-01-28Breeze Dark: Fix for invisible icons (tdf#130205)rizmut
2020-01-28Breeze*, colibre, elementary, KJ, Sifr*: Fix for tdf#130204rizmut
2020-01-20tdf#128849: Added svg version of the breeze dark icon set.Luca Carlon