xref: /aoo4110/main/oox/source/drawingml/textbody.cxx (revision b1cdbd2c)
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 #include "oox/drawingml/textbody.hxx"
25 #include <com/sun/star/text/XText.hpp>
26 #include <com/sun/star/text/XTextCursor.hpp>
27 #include "oox/drawingml/textparagraph.hxx"
28 
29 using ::rtl::OUString;
30 using namespace ::com::sun::star::uno;
31 using namespace ::com::sun::star::text;
32 using namespace ::com::sun::star::frame;
33 
34 namespace oox { namespace drawingml {
35 
36 
TextBody()37 TextBody::TextBody()
38 {
39 }
40 
~TextBody()41 TextBody::~TextBody()
42 {
43 }
44 
addParagraph()45 TextParagraph& TextBody::addParagraph()
46 {
47     TextParagraphPtr xPara( new TextParagraph );
48     maParagraphs.push_back( xPara );
49     return *xPara;
50 }
51 
insertAt(const::oox::core::XmlFilterBase & rFilterBase,const Reference<XText> & xText,const Reference<XTextCursor> & xAt,const TextCharacterProperties & rTextStyleProperties,const TextListStylePtr & pMasterTextListStylePtr) const52 void TextBody::insertAt(
53         const ::oox::core::XmlFilterBase& rFilterBase,
54         const Reference < XText > & xText,
55         const Reference < XTextCursor > & xAt,
56         const TextCharacterProperties& rTextStyleProperties,
57         const TextListStylePtr& pMasterTextListStylePtr ) const
58 {
59     TextListStyle aCombinedTextStyle;
60     aCombinedTextStyle.apply( *pMasterTextListStylePtr );
61     aCombinedTextStyle.apply( maTextListStyle );
62 
63     for( TextParagraphVector::const_iterator aBeg = maParagraphs.begin(), aIt = aBeg, aEnd = maParagraphs.end(); aIt != aEnd; ++aIt )
64         (*aIt)->insertAt( rFilterBase, xText, xAt, rTextStyleProperties, aCombinedTextStyle, aIt == aBeg );
65 }
66 
67 
68 } }
69