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 <rtl/ustrbuf.hxx>
21 :
22 : #include <xmloff/nmspmap.hxx>
23 : #include <format.hxx>
24 : #include <fmtcol.hxx>
25 : #include <hints.hxx>
26 : #include <poolfmt.hxx>
27 : #include <charfmt.hxx>
28 : #include <paratr.hxx>
29 : #include <doc.hxx>
30 : #include "docary.hxx"
31 : #include "unostyle.hxx"
32 : #include "fmtpdsc.hxx"
33 : #include "pagedesc.hxx"
34 : #include <xmloff/xmlnmspe.hxx>
35 : #include <xmloff/i18nmap.hxx>
36 : #include <xmloff/xmltkmap.hxx>
37 : #include "xmlitem.hxx"
38 : #include <xmloff/xmlstyle.hxx>
39 : #include <xmloff/txtstyli.hxx>
40 : #include <xmloff/txtimp.hxx>
41 : #include <xmloff/families.hxx>
42 : #include <xmloff/XMLTextMasterStylesContext.hxx>
43 : #include <xmloff/XMLTextShapeStyleContext.hxx>
44 : #include <xmloff/XMLGraphicsDefaultStyle.hxx>
45 : #include "xmlimp.hxx"
46 : #include "xmltbli.hxx"
47 : #include "cellatr.hxx"
48 : #include <SwStyleNameMapper.hxx>
49 : #include <xmloff/attrlist.hxx>
50 : #include <unotxdoc.hxx>
51 : #include <docsh.hxx>
52 :
53 :
54 : using namespace ::com::sun::star;
55 : using ::rtl::OUString;
56 : using ::rtl::OUStringBuffer;
57 : using namespace ::xmloff::token;
58 :
59 0 : class SwXMLConditionParser_Impl
60 : {
61 : OUString sInput;
62 :
63 : sal_uInt32 nCondition;
64 : sal_uInt32 nSubCondition;
65 :
66 : sal_Int32 nPos;
67 : sal_Int32 nLength;
68 :
69 : inline sal_Bool SkipWS();
70 : inline sal_Bool MatchChar( sal_Unicode c );
71 : inline sal_Bool MatchName( OUString& rName );
72 : inline sal_Bool MatchNumber( sal_uInt32& rNumber );
73 :
74 : public:
75 :
76 : SwXMLConditionParser_Impl( const OUString& rInp );
77 :
78 0 : sal_Bool IsValid() const { return 0 != nCondition; }
79 :
80 0 : sal_uInt32 GetCondition() const { return nCondition; }
81 0 : sal_uInt32 GetSubCondition() const { return nSubCondition; }
82 : };
83 :
84 0 : inline sal_Bool SwXMLConditionParser_Impl::SkipWS()
85 : {
86 0 : while( nPos < nLength && ' ' == sInput[nPos] )
87 0 : nPos++;
88 0 : return sal_True;
89 : }
90 :
91 0 : inline sal_Bool SwXMLConditionParser_Impl::MatchChar( sal_Unicode c )
92 : {
93 0 : sal_Bool bRet = sal_False;
94 0 : if( nPos < nLength && c == sInput[nPos] )
95 : {
96 0 : nPos++;
97 0 : bRet = sal_True;
98 : }
99 0 : return bRet;
100 : }
101 :
102 0 : inline sal_Bool SwXMLConditionParser_Impl::MatchName( OUString& rName )
103 : {
104 0 : OUStringBuffer sBuffer( nLength );
105 0 : while( nPos < nLength &&
106 0 : ( ('a' <= sInput[nPos] && sInput[nPos] <= 'z') ||
107 0 : '-' == sInput[nPos] ) )
108 : {
109 0 : sBuffer.append( sInput[nPos] );
110 0 : nPos++;
111 : }
112 0 : rName = sBuffer.makeStringAndClear();
113 0 : return !rName.isEmpty();
114 : }
115 :
116 0 : inline sal_Bool SwXMLConditionParser_Impl::MatchNumber( sal_uInt32& rNumber )
117 : {
118 0 : OUStringBuffer sBuffer( nLength );
119 0 : while( nPos < nLength && '0' <= sInput[nPos] && sInput[nPos] <= '9' )
120 : {
121 0 : sBuffer.append( sInput[nPos] );
122 0 : nPos++;
123 : }
124 :
125 0 : OUString sNum( sBuffer.makeStringAndClear() );
126 0 : if( !sNum.isEmpty() )
127 0 : rNumber = sNum.toInt32();
128 0 : return !sNum.isEmpty();
129 : }
130 :
131 0 : SwXMLConditionParser_Impl::SwXMLConditionParser_Impl( const OUString& rInp ) :
132 : sInput( rInp ),
133 : nCondition( 0 ),
134 : nSubCondition( 0 ),
135 : nPos( 0 ),
136 0 : nLength( rInp.getLength() )
137 : {
138 0 : OUString sFunc;
139 0 : sal_Bool bHasSub = sal_False;
140 0 : sal_uInt32 nSub = 0;
141 0 : sal_Bool bOK = SkipWS() && MatchName( sFunc ) && SkipWS() &&
142 0 : MatchChar( '(' ) && SkipWS() && MatchChar( ')' ) && SkipWS();
143 0 : if( bOK && MatchChar( '=' ) )
144 : {
145 0 : bOK = SkipWS() && MatchNumber( nSub ) && SkipWS();
146 0 : bHasSub = sal_True;
147 : }
148 :
149 0 : bOK &= nPos == nLength;
150 :
151 0 : if( bOK )
152 : {
153 0 : if( IsXMLToken( sFunc, XML_ENDNOTE ) && !bHasSub )
154 0 : nCondition = PARA_IN_ENDNOTE;
155 0 : else if( IsXMLToken( sFunc, XML_FOOTER ) && !bHasSub )
156 0 : nCondition = PARA_IN_FOOTER;
157 0 : else if( IsXMLToken( sFunc, XML_FOOTNOTE ) && !bHasSub )
158 0 : nCondition = PARA_IN_FOOTENOTE;
159 0 : else if( IsXMLToken( sFunc, XML_HEADER ) && !bHasSub )
160 0 : nCondition = PARA_IN_HEADER;
161 0 : else if( IsXMLToken( sFunc, XML_LIST_LEVEL) &&
162 : nSub >=1 && nSub <= MAXLEVEL )
163 : {
164 0 : nCondition = PARA_IN_LIST;
165 0 : nSubCondition = nSub-1;
166 : }
167 0 : else if( IsXMLToken( sFunc, XML_OUTLINE_LEVEL) &&
168 : nSub >=1 && nSub <= MAXLEVEL )
169 : {
170 0 : nCondition = PARA_IN_OUTLINE;
171 0 : nSubCondition = nSub-1;
172 : }
173 0 : else if( IsXMLToken( sFunc, XML_SECTION ) && !bHasSub )
174 : {
175 0 : nCondition = PARA_IN_SECTION;
176 : }
177 0 : else if( IsXMLToken( sFunc, XML_TABLE ) && !bHasSub )
178 : {
179 0 : nCondition = PARA_IN_TABLEBODY;
180 : }
181 0 : else if( IsXMLToken( sFunc, XML_TABLE_HEADER ) && !bHasSub )
182 : {
183 0 : nCondition = PARA_IN_TABLEHEAD;
184 : }
185 0 : else if( IsXMLToken( sFunc, XML_TEXT_BOX ) && !bHasSub )
186 : {
187 0 : nCondition = PARA_IN_FRAME;
188 : }
189 0 : }
190 0 : }
191 :
192 : // ---------------------------------------------------------------------
193 :
194 : class SwXMLConditionContext_Impl : public SvXMLImportContext
195 : {
196 : sal_uInt32 nCondition;
197 : sal_uInt32 nSubCondition;
198 :
199 : OUString sApplyStyle;
200 :
201 : void ParseCondition( const OUString& rCond );
202 :
203 : public:
204 :
205 : SwXMLConditionContext_Impl(
206 : SvXMLImport& rImport, sal_uInt16 nPrfx,
207 : const OUString& rLName,
208 : const uno::Reference< xml::sax::XAttributeList > & xAttrList );
209 : virtual ~SwXMLConditionContext_Impl();
210 :
211 : TYPEINFO();
212 :
213 0 : sal_Bool IsValid() const { return 0 != nCondition; }
214 :
215 0 : sal_uInt32 GetCondition() const { return nCondition; }
216 0 : sal_uInt32 GetSubCondition() const { return nSubCondition; }
217 0 : const OUString& GetApplyStyle() const { return sApplyStyle; }
218 : };
219 :
220 0 : SwXMLConditionContext_Impl::SwXMLConditionContext_Impl(
221 : SvXMLImport& rImport, sal_uInt16 nPrfx,
222 : const OUString& rLName,
223 : const uno::Reference< xml::sax::XAttributeList > & xAttrList ) :
224 : SvXMLImportContext( rImport, nPrfx, rLName ),
225 : nCondition( 0 ),
226 0 : nSubCondition( 0 )
227 : {
228 0 : sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
229 0 : for( sal_Int16 i=0; i < nAttrCount; i++ )
230 : {
231 0 : const OUString& rAttrName = xAttrList->getNameByIndex( i );
232 0 : OUString aLocalName;
233 : sal_uInt16 nPrefix =
234 0 : GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName,
235 0 : &aLocalName );
236 0 : const OUString& rValue = xAttrList->getValueByIndex( i );
237 :
238 : // TODO: use a map here
239 0 : if( XML_NAMESPACE_STYLE == nPrefix )
240 : {
241 0 : if( IsXMLToken( aLocalName, XML_CONDITION ) )
242 : {
243 0 : SwXMLConditionParser_Impl aCondParser( rValue );
244 0 : if( aCondParser.IsValid() )
245 : {
246 0 : nCondition = aCondParser.GetCondition();
247 0 : nSubCondition = aCondParser.GetSubCondition();
248 0 : }
249 : }
250 0 : else if( IsXMLToken( aLocalName, XML_APPLY_STYLE_NAME ) )
251 : {
252 0 : sApplyStyle = rValue;
253 : }
254 : }
255 0 : }
256 0 : }
257 :
258 0 : SwXMLConditionContext_Impl::~SwXMLConditionContext_Impl()
259 : {
260 0 : }
261 :
262 0 : TYPEINIT1( SwXMLConditionContext_Impl, XMLTextStyleContext );
263 :
264 : // ---------------------------------------------------------------------
265 :
266 : typedef std::vector<SwXMLConditionContext_Impl*> SwXMLConditions_Impl;
267 :
268 : class SwXMLTextStyleContext_Impl : public XMLTextStyleContext
269 : {
270 : SwXMLConditions_Impl *pConditions;
271 :
272 : protected:
273 :
274 : virtual uno::Reference < style::XStyle > Create();
275 :
276 : public:
277 :
278 : TYPEINFO();
279 :
280 : SwXMLTextStyleContext_Impl( SwXMLImport& rImport, sal_uInt16 nPrfx,
281 : const OUString& rLName,
282 : const uno::Reference< xml::sax::XAttributeList > & xAttrList,
283 : sal_uInt16 nFamily,
284 : SvXMLStylesContext& rStyles );
285 : virtual ~SwXMLTextStyleContext_Impl();
286 :
287 : virtual SvXMLImportContext *CreateChildContext(
288 : sal_uInt16 nPrefix,
289 : const OUString& rLocalName,
290 : const uno::Reference< xml::sax::XAttributeList > & xAttrList );
291 :
292 : virtual void Finish( sal_Bool bOverwrite );
293 : };
294 :
295 363 : TYPEINIT1( SwXMLTextStyleContext_Impl, XMLTextStyleContext );
296 :
297 60 : uno::Reference < style::XStyle > SwXMLTextStyleContext_Impl::Create()
298 : {
299 60 : uno::Reference < style::XStyle > xNewStyle;
300 :
301 60 : if( pConditions && XML_STYLE_FAMILY_TEXT_PARAGRAPH == GetFamily() )
302 : {
303 0 : uno::Reference< lang::XMultiServiceFactory > xFactory( GetImport().GetModel(),
304 0 : uno::UNO_QUERY );
305 0 : if( xFactory.is() )
306 : {
307 : OUString sServiceName( RTL_CONSTASCII_USTRINGPARAM(
308 0 : "com.sun.star.style.ConditionalParagraphStyle" ) );
309 : uno::Reference < uno::XInterface > xIfc =
310 0 : xFactory->createInstance( sServiceName );
311 0 : if( xIfc.is() )
312 0 : xNewStyle = uno::Reference < style::XStyle >( xIfc, uno::UNO_QUERY );
313 0 : }
314 : }
315 : else
316 : {
317 60 : xNewStyle = XMLTextStyleContext::Create();
318 : }
319 :
320 60 : return xNewStyle;
321 : }
322 :
323 424 : SwXMLTextStyleContext_Impl::SwXMLTextStyleContext_Impl( SwXMLImport& rImport,
324 : sal_uInt16 nPrfx, const OUString& rLName,
325 : const uno::Reference< xml::sax::XAttributeList > & xAttrList,
326 : sal_uInt16 nFamily,
327 : SvXMLStylesContext& rStyles ) :
328 : XMLTextStyleContext( rImport, nPrfx, rLName, xAttrList, rStyles, nFamily ),
329 424 : pConditions( 0 )
330 : {
331 424 : }
332 :
333 1272 : SwXMLTextStyleContext_Impl::~SwXMLTextStyleContext_Impl()
334 : {
335 424 : if( pConditions )
336 : {
337 0 : while( !pConditions->empty() )
338 : {
339 0 : SwXMLConditionContext_Impl *pCond = &*pConditions->back();
340 0 : pConditions->pop_back();
341 0 : pCond->ReleaseRef();
342 : }
343 0 : delete pConditions;
344 : }
345 848 : }
346 :
347 554 : SvXMLImportContext *SwXMLTextStyleContext_Impl::CreateChildContext(
348 : sal_uInt16 nPrefix,
349 : const OUString& rLocalName,
350 : const uno::Reference< xml::sax::XAttributeList > & xAttrList )
351 : {
352 554 : SvXMLImportContext *pContext = 0;
353 :
354 554 : if( XML_NAMESPACE_STYLE == nPrefix && IsXMLToken( rLocalName, XML_MAP ) )
355 : {
356 : SwXMLConditionContext_Impl *pCond =
357 0 : new SwXMLConditionContext_Impl( GetImport(), nPrefix,
358 0 : rLocalName, xAttrList );
359 0 : if( pCond->IsValid() )
360 : {
361 0 : if( !pConditions )
362 0 : pConditions = new SwXMLConditions_Impl;
363 0 : pConditions->push_back( pCond );
364 0 : pCond->AddRef();
365 : }
366 0 : pContext = pCond;
367 : }
368 :
369 554 : if( !pContext )
370 : pContext = XMLTextStyleContext::CreateChildContext( nPrefix, rLocalName,
371 554 : xAttrList );
372 :
373 554 : return pContext;
374 : }
375 :
376 352 : void SwXMLTextStyleContext_Impl::Finish( sal_Bool bOverwrite )
377 : {
378 352 : XMLTextStyleContext::Finish( bOverwrite );
379 :
380 352 : if( !pConditions || XML_STYLE_FAMILY_TEXT_PARAGRAPH != GetFamily() )
381 : return;
382 :
383 0 : uno::Reference < style::XStyle > xStyle = GetStyle();
384 0 : if( !xStyle.is() )
385 : return;
386 :
387 0 : const SwXStyle* pStyle = 0;
388 0 : uno::Reference<lang::XUnoTunnel> xStyleTunnel( xStyle, uno::UNO_QUERY);
389 0 : if( xStyleTunnel.is() )
390 : {
391 : pStyle = reinterpret_cast< SwXStyle * >(
392 0 : sal::static_int_cast< sal_IntPtr >( xStyleTunnel->getSomething( SwXStyle::getUnoTunnelId() )));
393 : }
394 0 : if( !pStyle )
395 : return;
396 :
397 0 : const SwDoc *pDoc = pStyle->GetDoc();
398 :
399 0 : SwTxtFmtColl *pColl = pDoc->FindTxtFmtCollByName( pStyle->GetStyleName() );
400 : OSL_ENSURE( pColl, "Text collection not found" );
401 0 : if( !pColl || RES_CONDTXTFMTCOLL != pColl->Which() )
402 : return;
403 :
404 0 : sal_uInt16 nCount = pConditions->size();
405 0 : String aString;
406 0 : OUString sName;
407 0 : for( sal_uInt16 i = 0; i < nCount; i++ )
408 : {
409 0 : const SwXMLConditionContext_Impl *pCond = (*pConditions)[i];
410 : OUString aDisplayName(
411 0 : GetImport().GetStyleDisplayName( XML_STYLE_FAMILY_TEXT_PARAGRAPH,
412 0 : pCond->GetApplyStyle() ) );
413 : SwStyleNameMapper::FillUIName( aDisplayName,
414 : aString,
415 : nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL,
416 0 : true);
417 0 : sName = aString;
418 0 : SwTxtFmtColl* pCondColl = pDoc->FindTxtFmtCollByName( sName );
419 : OSL_ENSURE( pCondColl,
420 : "SwXMLItemSetStyleContext_Impl::ConnectConditions: cond coll missing" );
421 0 : if( pCondColl )
422 : {
423 : SwCollCondition aCond( pCondColl, pCond->GetCondition(),
424 0 : pCond->GetSubCondition() );
425 0 : ((SwConditionTxtFmtColl*)pColl)->InsertCondition( aCond );
426 : }
427 0 : }
428 : }
429 :
430 : // ---------------------------------------------------------------------
431 :
432 : class SwXMLItemSetStyleContext_Impl : public SvXMLStyleContext
433 : {
434 : OUString sMasterPageName;
435 : SfxItemSet *pItemSet;
436 : SwXMLTextStyleContext_Impl *pTextStyle;
437 : SvXMLStylesContext &rStyles;
438 :
439 : OUString sDataStyleName;
440 :
441 : sal_Bool bHasMasterPageName : 1;
442 : sal_Bool bPageDescConnected : 1;
443 : sal_Bool bDataStyleIsResolved;
444 :
445 : SvXMLImportContext *CreateItemSetContext(
446 : sal_uInt16 nPrefix,
447 : const OUString& rLName,
448 : const uno::Reference< xml::sax::XAttributeList > & xAttrList);
449 :
450 : protected:
451 :
452 : virtual void SetAttribute( sal_uInt16 nPrefixKey,
453 : const OUString& rLocalName,
454 : const OUString& rValue );
455 :
456 : const SwXMLImport& GetSwImport() const
457 : { return (const SwXMLImport&)GetImport(); }
458 76 : SwXMLImport& GetSwImport() { return (SwXMLImport&)GetImport(); }
459 :
460 : public:
461 :
462 : TYPEINFO();
463 :
464 : SwXMLItemSetStyleContext_Impl(
465 : SwXMLImport& rImport, sal_uInt16 nPrfx,
466 : const OUString& rLName,
467 : const uno::Reference< xml::sax::XAttributeList > & xAttrList,
468 : SvXMLStylesContext& rStylesC,
469 : sal_uInt16 nFamily);
470 : virtual ~SwXMLItemSetStyleContext_Impl();
471 :
472 : virtual void CreateAndInsert( sal_Bool bOverwrite );
473 : virtual SvXMLImportContext *CreateChildContext(
474 : sal_uInt16 nPrefix,
475 : const OUString& rLocalName,
476 : const uno::Reference< xml::sax::XAttributeList > & xAttrList );
477 :
478 : // The item set may be empty!
479 38 : SfxItemSet *GetItemSet() { return pItemSet; }
480 : const SfxItemSet *GetItemSet() const { return pItemSet; }
481 :
482 0 : const OUString& GetMasterPageName() const { return sMasterPageName; }
483 2 : sal_Bool HasMasterPageName() const { return bHasMasterPageName; }
484 :
485 0 : sal_Bool IsPageDescConnected() const { return bPageDescConnected; }
486 : void ConnectPageDesc();
487 :
488 : sal_Bool ResolveDataStyleName();
489 : };
490 :
491 76 : void SwXMLItemSetStyleContext_Impl::SetAttribute( sal_uInt16 nPrefixKey,
492 : const OUString& rLocalName,
493 : const OUString& rValue )
494 : {
495 76 : if( XML_NAMESPACE_STYLE == nPrefixKey )
496 : {
497 76 : if ( IsXMLToken( rLocalName, XML_MASTER_PAGE_NAME ) )
498 : {
499 0 : sMasterPageName = rValue;
500 0 : bHasMasterPageName = sal_True;
501 : }
502 76 : else if ( IsXMLToken( rLocalName, XML_DATA_STYLE_NAME ) )
503 : {
504 : // if we have a valid data style name
505 0 : if (!rValue.isEmpty())
506 : {
507 0 : sDataStyleName = rValue;
508 0 : bDataStyleIsResolved = sal_False; // needs to be resolved
509 : }
510 : }
511 : else
512 : {
513 76 : SvXMLStyleContext::SetAttribute( nPrefixKey, rLocalName, rValue );
514 : }
515 : }
516 : else
517 : {
518 0 : SvXMLStyleContext::SetAttribute( nPrefixKey, rLocalName, rValue );
519 : }
520 76 : }
521 :
522 38 : SvXMLImportContext *SwXMLItemSetStyleContext_Impl::CreateItemSetContext(
523 : sal_uInt16 nPrefix, const OUString& rLName,
524 : const uno::Reference< xml::sax::XAttributeList > & xAttrList )
525 : {
526 : OSL_ENSURE( !pItemSet,
527 : "SwXMLItemSetStyleContext_Impl::CreateItemSetContext: item set exists" );
528 :
529 38 : SvXMLImportContext *pContext = 0;
530 :
531 38 : SwDoc* pDoc = SwImport::GetDocFromXMLImport( GetSwImport() );
532 :
533 38 : SfxItemPool& rItemPool = pDoc->GetAttrPool();
534 38 : switch( GetFamily() )
535 : {
536 : case XML_STYLE_FAMILY_TABLE_TABLE:
537 2 : pItemSet = new SfxItemSet( rItemPool, aTableSetRange );
538 2 : break;
539 : case XML_STYLE_FAMILY_TABLE_COLUMN:
540 2 : pItemSet = new SfxItemSet( rItemPool, RES_FRM_SIZE, RES_FRM_SIZE, 0 );
541 2 : break;
542 : case XML_STYLE_FAMILY_TABLE_ROW:
543 0 : pItemSet = new SfxItemSet( rItemPool, aTableLineSetRange );
544 0 : break;
545 : case XML_STYLE_FAMILY_TABLE_CELL:
546 34 : pItemSet = new SfxItemSet( rItemPool, aTableBoxSetRange );
547 34 : break;
548 : default:
549 : OSL_ENSURE( !this,
550 : "SwXMLItemSetStyleContext_Impl::CreateItemSetContext: unknown family" );
551 0 : break;
552 : }
553 38 : if( pItemSet )
554 38 : pContext = GetSwImport().CreateTableItemImportContext(
555 38 : nPrefix, rLName, xAttrList, GetFamily(),
556 114 : *pItemSet );
557 38 : if( !pContext )
558 : {
559 0 : delete pItemSet;
560 0 : pItemSet = 0;
561 : }
562 :
563 38 : return pContext;
564 : }
565 :
566 152 : TYPEINIT1( SwXMLItemSetStyleContext_Impl, SvXMLStyleContext );
567 :
568 38 : SwXMLItemSetStyleContext_Impl::SwXMLItemSetStyleContext_Impl( SwXMLImport& rImport,
569 : sal_uInt16 nPrfx, const OUString& rLName,
570 : const uno::Reference< xml::sax::XAttributeList > & xAttrList,
571 : SvXMLStylesContext& rStylesC,
572 : sal_uInt16 nFamily ) :
573 : SvXMLStyleContext( rImport, nPrfx, rLName, xAttrList, nFamily ),
574 : pItemSet( 0 ),
575 : pTextStyle( 0 ),
576 : rStyles( rStylesC ),
577 : bHasMasterPageName( sal_False ),
578 : bPageDescConnected( sal_False ),
579 38 : bDataStyleIsResolved( sal_True )
580 : {
581 38 : }
582 :
583 114 : SwXMLItemSetStyleContext_Impl::~SwXMLItemSetStyleContext_Impl()
584 : {
585 38 : delete pItemSet;
586 76 : }
587 :
588 34 : void SwXMLItemSetStyleContext_Impl::CreateAndInsert( sal_Bool bOverwrite )
589 : {
590 34 : if( pTextStyle )
591 0 : pTextStyle->CreateAndInsert( bOverwrite );
592 34 : }
593 :
594 38 : SvXMLImportContext *SwXMLItemSetStyleContext_Impl::CreateChildContext(
595 : sal_uInt16 nPrefix,
596 : const OUString& rLocalName,
597 : const uno::Reference< xml::sax::XAttributeList > & xAttrList )
598 : {
599 38 : SvXMLImportContext *pContext = 0;
600 :
601 38 : if( XML_NAMESPACE_STYLE == nPrefix )
602 : {
603 142 : if( IsXMLToken( rLocalName, XML_TABLE_PROPERTIES ) ||
604 36 : IsXMLToken( rLocalName, XML_TABLE_COLUMN_PROPERTIES ) ||
605 34 : IsXMLToken( rLocalName, XML_TABLE_ROW_PROPERTIES ) ||
606 34 : IsXMLToken( rLocalName, XML_TABLE_CELL_PROPERTIES ) )
607 : {
608 38 : pContext = CreateItemSetContext( nPrefix, rLocalName, xAttrList );
609 : }
610 0 : else if( IsXMLToken( rLocalName, XML_TEXT_PROPERTIES ) ||
611 0 : IsXMLToken( rLocalName, XML_PARAGRAPH_PROPERTIES ))
612 : {
613 0 : if( !pTextStyle )
614 : {
615 0 : SvXMLAttributeList *pTmp = new SvXMLAttributeList;
616 0 : OUString aStr = GetImport().GetNamespaceMap().GetQNameByKey( nPrefix, GetXMLToken(XML_NAME) );
617 0 : pTmp->AddAttribute( aStr, GetName() );
618 0 : uno::Reference <xml::sax::XAttributeList> xTmpAttrList = pTmp;
619 : pTextStyle = new SwXMLTextStyleContext_Impl( GetSwImport(), nPrefix,
620 0 : rLocalName, xTmpAttrList, XML_STYLE_FAMILY_TEXT_PARAGRAPH, rStyles );
621 0 : pTextStyle->StartElement( xTmpAttrList );
622 0 : rStyles.AddStyle( *pTextStyle );
623 : }
624 0 : pContext = pTextStyle->CreateChildContext( nPrefix, rLocalName, xAttrList );
625 : }
626 : }
627 :
628 38 : if( !pContext )
629 : pContext = SvXMLStyleContext::CreateChildContext( nPrefix, rLocalName,
630 0 : xAttrList );
631 :
632 38 : return pContext;
633 : }
634 :
635 0 : void SwXMLItemSetStyleContext_Impl::ConnectPageDesc()
636 : {
637 0 : if( bPageDescConnected || !HasMasterPageName() )
638 : return;
639 0 : bPageDescConnected = sal_True;
640 :
641 0 : SwDoc *pDoc = SwImport::GetDocFromXMLImport( GetSwImport() );
642 :
643 0 : String sName;
644 : // #i40788# - first determine the display name of the page style,
645 : // then map this name to the corresponding user interface name.
646 0 : sName = GetImport().GetStyleDisplayName( XML_STYLE_FAMILY_MASTER_PAGE,
647 0 : GetMasterPageName() );
648 : SwStyleNameMapper::FillUIName( sName,
649 : sName,
650 : nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC,
651 0 : true);
652 0 : SwPageDesc *pPageDesc = pDoc->FindPageDescByName( sName );
653 0 : if( !pPageDesc )
654 : {
655 : // If the page style is a pool style, then we maybe have to create it
656 : // first if it hasn't been used by now.
657 0 : sal_uInt16 nPoolId = SwStyleNameMapper::GetPoolIdFromUIName( sName, nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC );
658 0 : if( USHRT_MAX != nPoolId )
659 0 : pPageDesc = pDoc->GetPageDescFromPool( nPoolId, false );
660 : }
661 :
662 0 : if( !pPageDesc )
663 : return;
664 :
665 0 : if( !pItemSet )
666 : {
667 0 : SfxItemPool& rItemPool = pDoc->GetAttrPool();
668 0 : pItemSet = new SfxItemSet( rItemPool, aTableSetRange );
669 : }
670 :
671 : const SfxPoolItem *pItem;
672 0 : SwFmtPageDesc *pFmtPageDesc = 0;
673 0 : if( SFX_ITEM_SET == pItemSet->GetItemState( RES_PAGEDESC, sal_False,
674 0 : &pItem ) )
675 : {
676 0 : if( ((SwFmtPageDesc *)pItem)->GetPageDesc() != pPageDesc )
677 0 : pFmtPageDesc = new SwFmtPageDesc( *(SwFmtPageDesc *)pItem );
678 : }
679 : else
680 0 : pFmtPageDesc = new SwFmtPageDesc();
681 :
682 0 : if( pFmtPageDesc )
683 : {
684 0 : pFmtPageDesc->RegisterToPageDesc( *pPageDesc );
685 0 : pItemSet->Put( *pFmtPageDesc );
686 0 : delete pFmtPageDesc;
687 0 : }
688 : }
689 :
690 34 : sal_Bool SwXMLItemSetStyleContext_Impl::ResolveDataStyleName()
691 : {
692 : // resolve, if not already done
693 34 : if (! bDataStyleIsResolved)
694 : {
695 : // get the format key
696 : sal_Int32 nFormat =
697 0 : GetImport().GetTextImport()->GetDataStyleKey(sDataStyleName);
698 :
699 : // if the key is valid, insert Item into ItemSet
700 0 : if( -1 != nFormat )
701 : {
702 0 : if( !pItemSet )
703 : {
704 0 : SwDoc *pDoc = SwImport::GetDocFromXMLImport( GetSwImport() );
705 :
706 0 : SfxItemPool& rItemPool = pDoc->GetAttrPool();
707 0 : pItemSet = new SfxItemSet( rItemPool, aTableBoxSetRange );
708 : }
709 0 : SwTblBoxNumFormat aNumFormatItem(nFormat);
710 0 : pItemSet->Put(aNumFormatItem);
711 : }
712 :
713 : // now resolved
714 0 : bDataStyleIsResolved = sal_True;
715 0 : return sal_True;
716 : }
717 : else
718 : {
719 : // was already resolved; nothing to do
720 34 : return sal_False;
721 : }
722 : }
723 :
724 : // ---------------------------------------------------------------------
725 : //
726 : class SwXMLStylesContext_Impl : public SvXMLStylesContext
727 : {
728 : SwXMLItemSetStyleContext_Impl *GetSwStyle( sal_uInt16 i ) const;
729 :
730 567 : SwXMLImport& GetSwImport() { return (SwXMLImport&)GetImport(); }
731 1905 : const SwXMLImport& GetSwImport() const
732 1905 : { return (const SwXMLImport&)GetImport(); }
733 :
734 : protected:
735 :
736 : virtual SvXMLStyleContext *CreateStyleStyleChildContext( sal_uInt16 nFamily,
737 : sal_uInt16 nPrefix, const OUString& rLocalName,
738 : const uno::Reference< xml::sax::XAttributeList > & xAttrList );
739 : virtual SvXMLStyleContext *CreateDefaultStyleStyleChildContext(
740 : sal_uInt16 nFamily, sal_uInt16 nPrefix, const OUString& rLocalName,
741 : const uno::Reference< xml::sax::XAttributeList > & xAttrList );
742 : // HACK
743 : virtual UniReference < SvXMLImportPropertyMapper > GetImportPropertyMapper(
744 : sal_uInt16 nFamily ) const;
745 :
746 : virtual uno::Reference < container::XNameContainer >
747 : GetStylesContainer( sal_uInt16 nFamily ) const;
748 : virtual ::rtl::OUString GetServiceName( sal_uInt16 nFamily ) const;
749 : // HACK
750 :
751 : public:
752 :
753 : TYPEINFO();
754 :
755 : SwXMLStylesContext_Impl(
756 : SwXMLImport& rImport, sal_uInt16 nPrfx,
757 : const OUString& rLName ,
758 : const uno::Reference< xml::sax::XAttributeList > & xAttrList,
759 : sal_Bool bAuto );
760 : virtual ~SwXMLStylesContext_Impl();
761 :
762 : virtual sal_Bool InsertStyleFamily( sal_uInt16 nFamily ) const;
763 :
764 : virtual void EndElement();
765 : };
766 :
767 0 : TYPEINIT1( SwXMLStylesContext_Impl, SvXMLStylesContext );
768 :
769 : inline SwXMLItemSetStyleContext_Impl *SwXMLStylesContext_Impl::GetSwStyle(
770 : sal_uInt16 i ) const
771 : {
772 : return PTR_CAST( SwXMLItemSetStyleContext_Impl, GetStyle( i ) );
773 : }
774 :
775 610 : SvXMLStyleContext *SwXMLStylesContext_Impl::CreateStyleStyleChildContext(
776 : sal_uInt16 nFamily, sal_uInt16 nPrefix, const OUString& rLocalName,
777 : const uno::Reference< xml::sax::XAttributeList > & xAttrList )
778 : {
779 610 : SvXMLStyleContext *pStyle = 0;
780 :
781 610 : switch( nFamily )
782 : {
783 : case XML_STYLE_FAMILY_TEXT_PARAGRAPH:
784 : pStyle = new SwXMLTextStyleContext_Impl( GetSwImport(), nPrefix,
785 424 : rLocalName, xAttrList, nFamily, *this );
786 424 : break;
787 : case XML_STYLE_FAMILY_TABLE_TABLE:
788 : case XML_STYLE_FAMILY_TABLE_COLUMN:
789 : case XML_STYLE_FAMILY_TABLE_ROW:
790 : case XML_STYLE_FAMILY_TABLE_CELL:
791 : pStyle = new SwXMLItemSetStyleContext_Impl( GetSwImport(), nPrefix,
792 38 : rLocalName, xAttrList, *this, nFamily );
793 38 : break;
794 : case XML_STYLE_FAMILY_SD_GRAPHICS_ID:
795 : // As long as there are no element items, we can use the text
796 : // style class.
797 25 : pStyle = new XMLTextShapeStyleContext( GetImport(), nPrefix,
798 25 : rLocalName, xAttrList, *this, nFamily );
799 25 : break;
800 : default:
801 : pStyle = SvXMLStylesContext::CreateStyleStyleChildContext( nFamily,
802 : nPrefix,
803 : rLocalName,
804 123 : xAttrList );
805 123 : break;
806 : }
807 :
808 610 : return pStyle;
809 : }
810 :
811 140 : SvXMLStyleContext *SwXMLStylesContext_Impl::CreateDefaultStyleStyleChildContext(
812 : sal_uInt16 nFamily, sal_uInt16 nPrefix, const OUString& rLocalName,
813 : const uno::Reference< xml::sax::XAttributeList > & xAttrList )
814 : {
815 140 : SvXMLStyleContext *pStyle = 0;
816 :
817 140 : switch( nFamily )
818 : {
819 : case XML_STYLE_FAMILY_TEXT_PARAGRAPH:
820 : case XML_STYLE_FAMILY_TABLE_TABLE:
821 : case XML_STYLE_FAMILY_TABLE_ROW:
822 105 : pStyle = new XMLTextStyleContext( GetImport(), nPrefix, rLocalName,
823 : xAttrList, *this, nFamily,
824 105 : sal_True );
825 105 : break;
826 : case XML_STYLE_FAMILY_SD_GRAPHICS_ID:
827 : // There are no writer specific defaults for graphic styles!
828 35 : pStyle = new XMLGraphicsDefaultStyle( GetImport(), nPrefix,
829 35 : rLocalName, xAttrList, *this );
830 35 : break;
831 : default:
832 : pStyle = SvXMLStylesContext::CreateDefaultStyleStyleChildContext( nFamily,
833 : nPrefix,
834 : rLocalName,
835 0 : xAttrList );
836 0 : break;
837 : }
838 :
839 140 : return pStyle;
840 : }
841 :
842 :
843 105 : SwXMLStylesContext_Impl::SwXMLStylesContext_Impl(
844 : SwXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName,
845 : const uno::Reference< xml::sax::XAttributeList > & xAttrList,
846 : sal_Bool bAuto ) :
847 105 : SvXMLStylesContext( rImport, nPrfx, rLName, xAttrList, bAuto )
848 : {
849 105 : }
850 :
851 210 : SwXMLStylesContext_Impl::~SwXMLStylesContext_Impl()
852 : {
853 210 : }
854 :
855 1905 : sal_Bool SwXMLStylesContext_Impl::InsertStyleFamily( sal_uInt16 nFamily ) const
856 : {
857 1905 : const SwXMLImport& rSwImport = GetSwImport();
858 1905 : sal_uInt16 nStyleFamilyMask = rSwImport.GetStyleFamilyMask();
859 :
860 1905 : sal_Bool bIns = sal_True;
861 1905 : switch( nFamily )
862 : {
863 : case XML_STYLE_FAMILY_TEXT_PARAGRAPH:
864 1056 : bIns = (nStyleFamilyMask & SFX_STYLE_FAMILY_PARA) != 0;
865 1056 : break;
866 : case XML_STYLE_FAMILY_TEXT_TEXT:
867 330 : bIns = (nStyleFamilyMask & SFX_STYLE_FAMILY_CHAR) != 0;
868 330 : break;
869 : case XML_STYLE_FAMILY_SD_GRAPHICS_ID:
870 36 : bIns = (nStyleFamilyMask & SFX_STYLE_FAMILY_FRAME) != 0;
871 36 : break;
872 : case XML_STYLE_FAMILY_TEXT_LIST:
873 63 : bIns = (nStyleFamilyMask & SFX_STYLE_FAMILY_PSEUDO) != 0;
874 63 : break;
875 : case XML_STYLE_FAMILY_TEXT_OUTLINE:
876 : case XML_STYLE_FAMILY_TEXT_FOOTNOTECONFIG:
877 : case XML_STYLE_FAMILY_TEXT_ENDNOTECONFIG:
878 : case XML_STYLE_FAMILY_TEXT_LINENUMBERINGCONFIG:
879 : case XML_STYLE_FAMILY_TEXT_BIBLIOGRAPHYCONFIG:
880 840 : bIns = !(rSwImport.IsInsertMode() || rSwImport.IsStylesOnlyMode() ||
881 840 : rSwImport.IsBlockMode());
882 420 : break;
883 : default:
884 0 : bIns = SvXMLStylesContext::InsertStyleFamily( nFamily );
885 0 : break;
886 : }
887 :
888 1905 : return bIns;
889 : }
890 :
891 2527 : UniReference < SvXMLImportPropertyMapper > SwXMLStylesContext_Impl::GetImportPropertyMapper(
892 : sal_uInt16 nFamily ) const
893 : {
894 2527 : UniReference < SvXMLImportPropertyMapper > xMapper;
895 2527 : if( nFamily == XML_STYLE_FAMILY_TABLE_TABLE )
896 : xMapper = XMLTextImportHelper::CreateTableDefaultExtPropMapper(
897 70 : const_cast<SwXMLStylesContext_Impl*>( this )->GetImport() );
898 2457 : else if( nFamily == XML_STYLE_FAMILY_TABLE_ROW )
899 : xMapper = XMLTextImportHelper::CreateTableRowDefaultExtPropMapper(
900 70 : const_cast<SwXMLStylesContext_Impl*>( this )->GetImport() );
901 : else
902 2387 : xMapper = SvXMLStylesContext::GetImportPropertyMapper( nFamily );
903 2527 : return xMapper;
904 : }
905 :
906 948 : uno::Reference < container::XNameContainer > SwXMLStylesContext_Impl::GetStylesContainer(
907 : sal_uInt16 nFamily ) const
908 : {
909 948 : uno::Reference < container::XNameContainer > xStyles;
910 948 : if( XML_STYLE_FAMILY_SD_GRAPHICS_ID == nFamily )
911 24 : xStyles = ((SvXMLImport *)&GetImport())->GetTextImport()->GetFrameStyles();
912 : else
913 924 : xStyles = SvXMLStylesContext::GetStylesContainer( nFamily );
914 :
915 948 : return xStyles;
916 : }
917 :
918 136 : OUString SwXMLStylesContext_Impl::GetServiceName( sal_uInt16 nFamily ) const
919 : {
920 136 : String sServiceName;
921 136 : if( XML_STYLE_FAMILY_SD_GRAPHICS_ID == nFamily )
922 0 : sServiceName = OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.style.FrameStyle") );
923 : else
924 136 : sServiceName = SvXMLStylesContext::GetServiceName( nFamily );
925 :
926 136 : return sServiceName;
927 : }
928 :
929 105 : void SwXMLStylesContext_Impl::EndElement()
930 : {
931 105 : GetSwImport().InsertStyles( IsAutomaticStyle() );
932 105 : }
933 :
934 : // ---------------------------------------------------------------------
935 : //
936 : class SwXMLMasterStylesContext_Impl : public XMLTextMasterStylesContext
937 : {
938 : protected:
939 : virtual sal_Bool InsertStyleFamily( sal_uInt16 nFamily ) const;
940 :
941 70 : SwXMLImport& GetSwImport() { return (SwXMLImport&)GetImport(); }
942 150 : const SwXMLImport& GetSwImport() const
943 150 : { return (const SwXMLImport&)GetImport(); }
944 :
945 : public:
946 :
947 : TYPEINFO();
948 :
949 : SwXMLMasterStylesContext_Impl(
950 : SwXMLImport& rImport, sal_uInt16 nPrfx,
951 : const OUString& rLName ,
952 : const uno::Reference< xml::sax::XAttributeList > & xAttrList );
953 : virtual ~SwXMLMasterStylesContext_Impl();
954 : virtual void EndElement();
955 : };
956 :
957 0 : TYPEINIT1( SwXMLMasterStylesContext_Impl, XMLTextMasterStylesContext );
958 :
959 35 : SwXMLMasterStylesContext_Impl::SwXMLMasterStylesContext_Impl(
960 : SwXMLImport& rImport, sal_uInt16 nPrfx,
961 : const OUString& rLName ,
962 : const uno::Reference< xml::sax::XAttributeList > & xAttrList ) :
963 35 : XMLTextMasterStylesContext( rImport, nPrfx, rLName, xAttrList )
964 : {
965 35 : }
966 :
967 70 : SwXMLMasterStylesContext_Impl::~SwXMLMasterStylesContext_Impl()
968 : {
969 70 : }
970 :
971 150 : sal_Bool SwXMLMasterStylesContext_Impl::InsertStyleFamily( sal_uInt16 nFamily ) const
972 : {
973 : sal_Bool bIns;
974 :
975 150 : const SwXMLImport& rSwImport = GetSwImport();
976 150 : sal_uInt16 nStyleFamilyMask = rSwImport.GetStyleFamilyMask();
977 150 : if( XML_STYLE_FAMILY_MASTER_PAGE == nFamily )
978 150 : bIns = (nStyleFamilyMask & SFX_STYLE_FAMILY_PAGE) != 0;
979 : else
980 0 : bIns = XMLTextMasterStylesContext::InsertStyleFamily( nFamily );
981 :
982 150 : return bIns;
983 : }
984 :
985 35 : void SwXMLMasterStylesContext_Impl::EndElement()
986 : {
987 35 : FinishStyles( !GetSwImport().IsInsertMode() );
988 35 : GetSwImport().FinishStyles();
989 35 : }
990 : // ---------------------------------------------------------------------
991 :
992 105 : SvXMLImportContext *SwXMLImport::CreateStylesContext(
993 : const OUString& rLocalName,
994 : const uno::Reference< xml::sax::XAttributeList > & xAttrList,
995 : sal_Bool bAuto )
996 : {
997 : SvXMLStylesContext *pContext =
998 : new SwXMLStylesContext_Impl( *this, XML_NAMESPACE_OFFICE, rLocalName,
999 105 : xAttrList, bAuto );
1000 105 : if( bAuto )
1001 70 : SetAutoStyles( pContext );
1002 : else
1003 35 : SetStyles( pContext );
1004 :
1005 105 : return pContext;
1006 : }
1007 :
1008 35 : SvXMLImportContext *SwXMLImport::CreateMasterStylesContext(
1009 : const OUString& rLocalName,
1010 : const uno::Reference< xml::sax::XAttributeList > & xAttrList )
1011 : {
1012 : SvXMLStylesContext *pContext =
1013 : new SwXMLMasterStylesContext_Impl( *this, XML_NAMESPACE_OFFICE, rLocalName,
1014 35 : xAttrList );
1015 35 : SetMasterStyles( pContext );
1016 :
1017 35 : return pContext;
1018 : }
1019 :
1020 105 : void SwXMLImport::InsertStyles( sal_Bool bAuto )
1021 : {
1022 105 : if( bAuto && GetAutoStyles() )
1023 70 : GetAutoStyles()->CopyAutoStylesToDoc();
1024 105 : if( !bAuto && GetStyles() )
1025 35 : GetStyles()->CopyStylesToDoc( !IsInsertMode(), sal_False );
1026 105 : }
1027 :
1028 35 : void SwXMLImport::FinishStyles()
1029 : {
1030 35 : if( GetStyles() )
1031 35 : GetStyles()->FinishStyles( !IsInsertMode() );
1032 35 : }
1033 :
1034 35 : void SwXMLImport::UpdateTxtCollConditions( SwDoc *pDoc )
1035 : {
1036 35 : if( !pDoc )
1037 0 : pDoc = SwImport::GetDocFromXMLImport( *this );
1038 :
1039 35 : const SwTxtFmtColls& rColls = *pDoc->GetTxtFmtColls();
1040 35 : sal_uInt16 nCount = rColls.size();
1041 422 : for( sal_uInt16 i=0; i < nCount; i++ )
1042 : {
1043 387 : SwTxtFmtColl *pColl = rColls[i];
1044 387 : if( pColl && RES_CONDTXTFMTCOLL == pColl->Which() )
1045 : {
1046 : const SwFmtCollConditions& rConditions =
1047 35 : ((const SwConditionTxtFmtColl *)pColl)->GetCondColls();
1048 35 : sal_Bool bSendModify = sal_False;
1049 35 : for( sal_uInt16 j=0; j < rConditions.size() && !bSendModify; j++ )
1050 : {
1051 0 : const SwCollCondition& rCond = rConditions[j];
1052 0 : switch( rCond.GetCondition() )
1053 : {
1054 : case PARA_IN_TABLEHEAD:
1055 : case PARA_IN_TABLEBODY:
1056 : case PARA_IN_FOOTER:
1057 : case PARA_IN_HEADER:
1058 0 : bSendModify = sal_True;
1059 0 : break;
1060 : }
1061 : }
1062 35 : if( bSendModify )
1063 : {
1064 0 : SwCondCollCondChg aMsg( pColl );
1065 0 : pColl->ModifyNotification( &aMsg, &aMsg );
1066 : }
1067 : }
1068 : }
1069 35 : }
1070 :
1071 38 : sal_Bool SwXMLImport::FindAutomaticStyle(
1072 : sal_uInt16 nFamily,
1073 : const OUString& rName,
1074 : const SfxItemSet **ppItemSet,
1075 : OUString *pParent ) const
1076 : {
1077 38 : SwXMLItemSetStyleContext_Impl *pStyle = 0;
1078 38 : if( GetAutoStyles() )
1079 : {
1080 114 : pStyle = PTR_CAST( SwXMLItemSetStyleContext_Impl,
1081 : GetAutoStyles()->
1082 : FindStyleChildContext( nFamily, rName,
1083 114 : sal_True ) );
1084 38 : if( pStyle )
1085 : {
1086 38 : if( ppItemSet )
1087 : {
1088 40 : if( XML_STYLE_FAMILY_TABLE_TABLE == pStyle->GetFamily() &&
1089 2 : pStyle->HasMasterPageName() &&
1090 0 : !pStyle->IsPageDescConnected() )
1091 0 : pStyle->ConnectPageDesc();
1092 38 : (*ppItemSet) = pStyle->GetItemSet();
1093 :
1094 : // resolve data style name late
1095 72 : if( XML_STYLE_FAMILY_TABLE_CELL == pStyle->GetFamily() &&
1096 34 : pStyle->ResolveDataStyleName() )
1097 : {
1098 0 : (*ppItemSet) = pStyle->GetItemSet();
1099 : }
1100 :
1101 : }
1102 :
1103 38 : if( pParent )
1104 0 : *pParent = pStyle->GetParentName();
1105 : }
1106 : }
1107 :
1108 38 : return pStyle != 0;
1109 : }
1110 :
1111 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|