Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #include "oox/vml/vmltextbox.hxx"
21 :
22 : #include <rtl/ustrbuf.hxx>
23 :
24 : namespace oox {
25 : namespace vml {
26 :
27 : using ::rtl::OUString;
28 : using ::rtl::OUStringBuffer;
29 :
30 52 : TextFontModel::TextFontModel()
31 : {
32 52 : }
33 :
34 2 : TextPortionModel::TextPortionModel( const TextFontModel& rFont, const OUString& rText ) :
35 : maFont( rFont ),
36 2 : maText( rText )
37 : {
38 2 : }
39 :
40 26 : TextBox::TextBox()
41 26 : : borderDistanceSet( false )
42 : {
43 26 : }
44 :
45 2 : void TextBox::appendPortion( const TextFontModel& rFont, const OUString& rText )
46 : {
47 2 : maPortions.push_back( TextPortionModel( rFont, rText ) );
48 2 : }
49 :
50 2 : const TextFontModel* TextBox::getFirstFont() const
51 : {
52 2 : return maPortions.empty() ? 0 : &maPortions.front().maFont;
53 : }
54 :
55 2 : OUString TextBox::getText() const
56 : {
57 2 : OUStringBuffer aBuffer;
58 4 : for( PortionVector::const_iterator aIt = maPortions.begin(), aEnd = maPortions.end(); aIt != aEnd; ++aIt )
59 2 : aBuffer.append( aIt->maText );
60 2 : return aBuffer.makeStringAndClear();
61 : }
62 :
63 : } // namespace vml
64 : } // namespace oox
65 :
66 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|