richstring.cxx (ca5ec200) richstring.cxx (768bfd82)
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

--- 5 unchanged lines hidden (view full) ---

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
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

--- 5 unchanged lines hidden (view full) ---

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/xls/richstring.hxx"
25
26#include <com/sun/star/text/XText.hpp>
27#include <rtl/ustrbuf.hxx>
28#include "oox/helper/attributelist.hxx"
29#include "oox/helper/propertyset.hxx"
30#include "oox/xls/biffinputstream.hxx"
31

--- 22 unchanged lines hidden (view full) ---

54}
55
56} // namespace
57
58// ============================================================================
59
60RichStringPortion::RichStringPortion( const WorkbookHelper& rHelper ) :
61 WorkbookHelper( rHelper ),
22#include "oox/xls/richstring.hxx"
23
24#include <com/sun/star/text/XText.hpp>
25#include <rtl/ustrbuf.hxx>
26#include "oox/helper/attributelist.hxx"
27#include "oox/helper/propertyset.hxx"
28#include "oox/xls/biffinputstream.hxx"
29

--- 22 unchanged lines hidden (view full) ---

52}
53
54} // namespace
55
56// ============================================================================
57
58RichStringPortion::RichStringPortion( const WorkbookHelper& rHelper ) :
59 WorkbookHelper( rHelper ),
62 mnFontId( -1 )
60 mnFontId( -1 ),
61 mbConverted( false )
63{
64}
65
66void RichStringPortion::setText( const OUString& rText )
67{
68 maText = rText;
69}
70

--- 13 unchanged lines hidden (view full) ---

84 if( mxFont.get() )
85 mxFont->finalizeImport();
86 else if( mnFontId >= 0 )
87 mxFont = getStyles().getFont( mnFontId );
88}
89
90void RichStringPortion::convert( const Reference< XText >& rxText, const Font* pFont, bool bReplace )
91{
62{
63}
64
65void RichStringPortion::setText( const OUString& rText )
66{
67 maText = rText;
68}
69

--- 13 unchanged lines hidden (view full) ---

83 if( mxFont.get() )
84 mxFont->finalizeImport();
85 else if( mnFontId >= 0 )
86 mxFont = getStyles().getFont( mnFontId );
87}
88
89void RichStringPortion::convert( const Reference< XText >& rxText, const Font* pFont, bool bReplace )
90{
91 if ( mbConverted )
92 return;
93
92 Reference< XTextRange > xRange;
93 if( bReplace )
94 xRange.set( rxText, UNO_QUERY );
95 else
96 xRange = rxText->getEnd();
97 OSL_ENSURE( xRange.is(), "RichStringPortion::convert - cannot get text range interface" );
98
99 if( xRange.is() )

--- 8 unchanged lines hidden (view full) ---

108 require to use rich formatting, e.g. font escapement. But do not
109 use the passed font if this portion has its own font. */
110 else if( lclNeedsRichTextFormat( pFont ) )
111 {
112 PropertySet aPropSet( xRange );
113 pFont->writeToPropertySet( aPropSet, FONT_PROPTYPE_TEXT );
114 }
115 }
94 Reference< XTextRange > xRange;
95 if( bReplace )
96 xRange.set( rxText, UNO_QUERY );
97 else
98 xRange = rxText->getEnd();
99 OSL_ENSURE( xRange.is(), "RichStringPortion::convert - cannot get text range interface" );
100
101 if( xRange.is() )

--- 8 unchanged lines hidden (view full) ---

110 require to use rich formatting, e.g. font escapement. But do not
111 use the passed font if this portion has its own font. */
112 else if( lclNeedsRichTextFormat( pFont ) )
113 {
114 PropertySet aPropSet( xRange );
115 pFont->writeToPropertySet( aPropSet, FONT_PROPTYPE_TEXT );
116 }
117 }
118
119 mbConverted = true;
116}
117
118// ----------------------------------------------------------------------------
119
120void FontPortionModel::read( SequenceInputStream& rStrm )
121{
122 mnPos = rStrm.readuInt16();
123 mnFontId = rStrm.readuInt16();

--- 516 unchanged lines hidden ---
120}
121
122// ----------------------------------------------------------------------------
123
124void FontPortionModel::read( SequenceInputStream& rStrm )
125{
126 mnPos = rStrm.readuInt16();
127 mnFontId = rStrm.readuInt16();

--- 516 unchanged lines hidden ---