1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 // MARKER(update_precomp.py): autogen include statement, do not remove 25 #include "precompiled_sw.hxx" 26 27 28 #include <svl/itempool.hxx> 29 #include <txatbase.hxx> 30 #include <fmtfld.hxx> 31 #include <docufld.hxx> 32 33 SwTxtAttr::SwTxtAttr( SfxPoolItem& rAttr, xub_StrLen nStart ) 34 : m_pAttr( &rAttr ) 35 , m_nStart( nStart ) 36 , m_bDontExpand( false ) 37 , m_bLockExpandFlag( false ) 38 , m_bDontMoveAttr( false ) 39 , m_bCharFmtAttr( false ) 40 , m_bOverlapAllowedAttr( false ) 41 , m_bPriorityAttr( false ) 42 , m_bDontExpandStart( false ) 43 , m_bNesting( false ) 44 , m_bHasDummyChar( false ) 45 { 46 } 47 48 SwTxtAttr::~SwTxtAttr( ) 49 { 50 } 51 52 xub_StrLen* SwTxtAttr::GetEnd() 53 { 54 return 0; 55 } 56 57 void SwTxtAttr::Destroy( SwTxtAttr * pToDestroy, SfxItemPool& rPool ) 58 { 59 if (!pToDestroy) return; 60 SfxPoolItem * const pAttr = pToDestroy->m_pAttr; 61 delete pToDestroy; 62 rPool.Remove( *pAttr ); 63 } 64 65 int SwTxtAttr::operator==( const SwTxtAttr& rAttr ) const 66 { 67 return GetAttr() == rAttr.GetAttr(); 68 } 69 70 SwTxtAttrEnd::SwTxtAttrEnd( SfxPoolItem& rAttr, 71 xub_StrLen nStart, xub_StrLen nEnd ) : 72 SwTxtAttr( rAttr, nStart ), m_nEnd( nEnd ) 73 { 74 } 75 76 xub_StrLen* SwTxtAttrEnd::GetEnd() 77 { 78 return & m_nEnd; 79 } 80 81