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 : #ifndef INCLUDED_SW_SOURCE_FILTER_WW8_WW8PAR_HXX
21 : #define INCLUDED_SW_SOURCE_FILTER_WW8_WW8PAR_HXX
22 :
23 : #include "rtl/ustring.hxx"
24 : #include <filter/msfilter/msdffimp.hxx>
25 : #include <filter/msfilter/util.hxx>
26 : #include <editeng/frmdir.hxx>
27 : #include <fltshell.hxx>
28 :
29 : #include <svx/svdobj.hxx>
30 : #define SW_DRAWLAYER 0x30334353
31 : #define SW_UD_IMAPDATA 2
32 :
33 : #include <vector>
34 : #include <stack>
35 : #include <deque>
36 : #include <map>
37 : #include <utility>
38 :
39 : #include "ww8struc.hxx"
40 : #include "ww8scan.hxx"
41 : #include "ww8glsy.hxx"
42 : #include "wrtww8.hxx"
43 : #include "../inc/msfilter.hxx"
44 : #include <xmloff/odffields.hxx>
45 : #include <IMark.hxx>
46 :
47 : #include <swtypes.hxx>
48 : #include <fmtfsize.hxx>
49 : #include <fmtornt.hxx>
50 : #include <fmtsrnd.hxx>
51 : #include <editeng/lrspitem.hxx>
52 : #include <oox/ole/olehelper.hxx>
53 :
54 : #include <boost/noncopyable.hpp>
55 :
56 : class SwDoc;
57 : class SwPaM;
58 : class SfxPoolItem;
59 : class SwTxtFmtColl;
60 : class SwPageDesc;
61 : class SvxBoxItem;
62 : class SwFmt;
63 : class SwNodeIndex;
64 : class SwFlyFrmFmt;
65 : class SwAttrSet;
66 : class SwNumRule;
67 : class SwFrmFmt;
68 : class Writer;
69 : class SwFmtFld;
70 : class WW8Fib;
71 : class WW8PLCFMan;
72 : struct WW8PLCFManResult;
73 : class WW8RStyle;
74 : class WW8PLCF_HdFt;
75 : class WW8Dop;
76 : class WW8ScannerBase;
77 : struct WW8FieldDesc;
78 : struct WW8FlyPara;
79 : struct WW8SwFlyPara;
80 : struct WW8_PIC;
81 : class WW8TabDesc;
82 : struct WW8_SHD;
83 : struct WW8_OLST;
84 : class SwNumFmt;
85 : struct WW8_ANLD;
86 : struct WW8_ANLV;
87 : struct WW8_DO;
88 : struct WW8_DPHEAD;
89 : struct WW8_FSPA;
90 : class SdrModel;
91 : class SdrPage;
92 : class SdrObject;
93 : class SdrTextObj;
94 : class Size;
95 : class EditEngine;
96 : struct SwPosition;
97 : class WW8ReaderSave;
98 : struct WW8PicDesc;
99 : class Graphic;
100 : class SwFieldType;
101 : class SvStorage;
102 : // alt: class SvStorageRef;
103 : class SwAttrSet;
104 : class GDIMetaFile;
105 : struct ESelection;
106 : class SfxItemSet;
107 : class wwZOrderer;
108 : class OutlinerParaObject;
109 :
110 : namespace com{namespace sun {namespace star{
111 : namespace beans{ class XPropertySet;}
112 : namespace form { class XFormComponent;}
113 : namespace drawing{class XShape;}
114 : namespace lang{class XMultiServiceFactory;}
115 : }}}
116 :
117 : using namespace msfilter::util;
118 :
119 : // defines nur fuer die WW8-variable der INI-Datei
120 : #define WW8FL_NO_TEXT 1
121 : #define WW8FL_NO_STYLES 2
122 : #define WW8FL_NO_ZSTYLES 4 // keine Zeichenstyles importieren
123 : #define WW8FL_NO_GRAF 0x80
124 :
125 : // falls gestetzt, werden fuer Writer-Def-Styles neue Styles mit den
126 : // WW8-Def-Style-Eigenschaften erzeugt, statt die Writer-Standards zu
127 : // ueberschreiben
128 : #define WW8FL_NO_DEFSTYLES 0x400
129 :
130 : #define WW8FL_NO_OUTLINE 0x1000
131 : #define WW8FL_NO_IMPLPASP 0x4000 // no implicit para space
132 : #define WW8FL_NO_GRAFLAYER 0x8000
133 :
134 : // Zusatz-Filter-Flags, gueltig ab Winword 8
135 : #define WW8FL_NO_FLY_FOR_TXBX 1
136 :
137 : // Listen-Manager (ab Ver8)
138 :
139 : struct WW8LFOInfo;
140 :
141 21 : class WW8Reader : public StgReader
142 : {
143 : virtual sal_uLong Read(SwDoc &, const OUString& rBaseURL, SwPaM &, const OUString &) SAL_OVERRIDE;
144 : sal_uLong OpenMainStream( SvStorageStreamRef& rRef, sal_uInt16& rBuffSize );
145 : public:
146 : virtual int GetReaderType() SAL_OVERRIDE;
147 :
148 : virtual sal_Bool HasGlossaries() const SAL_OVERRIDE;
149 : virtual sal_Bool ReadGlossaries( SwTextBlocks&, sal_Bool bSaveRelFiles ) const SAL_OVERRIDE;
150 : };
151 :
152 : class SwWW8ImplReader;
153 : struct WW8LSTInfo;
154 : class WW8ListManager
155 : {
156 : public:
157 : WW8ListManager(SvStream& rSt_, SwWW8ImplReader& rReader_);
158 : //Min and Max possible List Levels in Word
159 : enum ListLevel {nMinLevel=1, nMaxLevel=9};
160 : //the rParaSprms returns back the original word paragraph indent
161 : //sprms which were attached to the original numbering format
162 : SwNumRule* GetNumRuleForActivation(sal_uInt16 nLFOPosition, const sal_uInt8 nLevel,
163 : std::vector<sal_uInt8> &rParaSprms, SwTxtNode *pNode=0);
164 : SwNumRule* CreateNextRule(bool bSimple);
165 : ~WW8ListManager();
166 : SwNumRule* GetNumRule(size_t i);
167 0 : size_t GetWW8LSTInfoNum() const{return maLSTInfos.size();}
168 : private:
169 : wwSprmParser maSprmParser;
170 : SwWW8ImplReader& rReader;
171 : SwDoc& rDoc;
172 : const WW8Fib& rFib;
173 : SvStream& rSt;
174 : std::vector<WW8LSTInfo* > maLSTInfos;
175 : boost::ptr_vector<WW8LFOInfo > pLFOInfos;// D. aus PLF LFO, sortiert genau wie im WW8 Stream
176 : sal_uInt16 nUniqueList; // current number for creating unique list names
177 : sal_uInt8* GrpprlHasSprm(sal_uInt16 nId, sal_uInt8& rSprms, sal_uInt8 nLen);
178 : WW8LSTInfo* GetLSTByListId( sal_uInt32 nIdLst ) const;
179 : //the rParaSprms returns back the original word paragraph indent
180 : //sprms which are attached to this numbering level
181 : bool ReadLVL(SwNumFmt& rNumFmt, SfxItemSet*& rpItemSet, sal_uInt16 nLevelStyle,
182 : bool bSetStartNo, std::deque<bool> &rNotReallyThere, sal_uInt16 nLevel,
183 : ww::bytes &rParaSprms);
184 :
185 : // Zeichenattribute aus GrpprlChpx
186 : typedef SfxItemSet* WW8aISet[nMaxLevel];
187 : // Zeichen Style Pointer
188 : typedef SwCharFmt* WW8aCFmt[nMaxLevel];
189 :
190 : void AdjustLVL(sal_uInt8 nLevel, SwNumRule& rNumRule, WW8aISet& rListItemSet,
191 : WW8aCFmt& aCharFmt, bool& bNewCharFmtCreated,
192 : const OUString& aPrefix = OUString());
193 :
194 : //No copying
195 : WW8ListManager(const WW8ListManager&);
196 : WW8ListManager& operator=(const WW8ListManager&);
197 : sal_uInt16 nLastLFOPosition;
198 : };
199 :
200 : struct WW8FlyPara
201 : { // WinWord-Attribute
202 : // Achtung: *Nicht* umsortieren, da Teile mit
203 : // memcmp verglichen werden
204 : bool bVer67;
205 : sal_Int16 nSp26, nSp27; // rohe Position
206 : sal_Int16 nSp45, nSp28; // Breite / Hoehe
207 : sal_Int16 nLeMgn, nRiMgn, nUpMgn, nLoMgn; // Raender
208 : sal_uInt8 nSp29; // rohe Bindung + Alignment
209 : sal_uInt8 nSp37; // Wrap-Mode ( 1 / 2; 0 = no Apo ? )
210 : WW8_BRCVer9_5 brc; // Umrandung Top, Left, Bottom, Right, Between
211 : bool bBorderLines; // Umrandungslinien
212 : bool bGrafApo; // true: Dieser Rahmen dient allein dazu, die
213 : // enthaltene Grafik anders als zeichengebunden
214 : // zu positionieren
215 : bool mbVertSet; // true if vertical positioning has been set
216 :
217 : WW8FlyPara(bool bIsVer67, const WW8FlyPara* pSrc = 0);
218 : bool operator==(const WW8FlyPara& rSrc) const;
219 : void Read(sal_uInt8 nSprm29, WW8PLCFx_Cp_FKP* pPap);
220 : void ReadFull(sal_uInt8 nSprm29, SwWW8ImplReader* pIo);
221 : void Read(sal_uInt8 nSprm29, WW8RStyle* pStyle);
222 : void ApplyTabPos(const WW8_TablePos *pTabPos);
223 : bool IsEmpty() const;
224 : };
225 :
226 789 : class SwWW8StyInf
227 : {
228 : OUString sWWStyleName;
229 : sal_uInt16 nWWStyleId;
230 : public:
231 : rtl_TextEncoding eLTRFontSrcCharSet; // rtl_TextEncoding fuer den Font
232 : rtl_TextEncoding eRTLFontSrcCharSet; // rtl_TextEncoding fuer den Font
233 : rtl_TextEncoding eCJKFontSrcCharSet; // rtl_TextEncoding fuer den Font
234 : SwFmt* pFmt;
235 : WW8FlyPara* pWWFly;
236 : SwNumRule* pOutlineNumrule;
237 : long nFilePos;
238 : sal_uInt16 nBase;
239 : sal_uInt16 nFollow;
240 : sal_uInt16 nLFOIndex;
241 : sal_uInt8 nListLevel;
242 : sal_uInt8 nOutlineLevel; // falls Gliederungs-Style
243 : sal_uInt16 n81Flags; // Fuer Bold, Italic, ...
244 : sal_uInt16 n81BiDiFlags; // Fuer Bold, Italic, ...
245 : SvxLRSpaceItem maWordLR;
246 : bool bValid; // leer oder Valid
247 : bool bImported; // fuers rekursive Importieren
248 : bool bColl; // true-> pFmt ist SwTxtFmtColl
249 : bool bImportSkipped; // nur true bei !bNewDoc && vorh. Style
250 : bool bHasStyNumRule; // true-> Benannter NumRule in Style
251 : bool bHasBrokenWW6List; // true-> WW8+ style has a WW7- list
252 : bool bListReleventIndentSet; //true if this style's indent has
253 : //been explicitly set, it's set to the value
254 : //of pFmt->GetItemState(RES_LR_SPACE, false)
255 : //if it was possible to get the ItemState
256 : //for L of the LR space independently
257 : bool bParaAutoBefore; // For Auto spacing before a paragraph
258 : bool bParaAutoAfter; // For Auto Spacing after a paragraph
259 :
260 2794 : SwWW8StyInf() :
261 : sWWStyleName( OUString() ),
262 : nWWStyleId( 0 ),
263 : eLTRFontSrcCharSet(0),
264 : eRTLFontSrcCharSet(0),
265 : eCJKFontSrcCharSet(0),
266 : pFmt( 0 ),
267 : pWWFly( 0 ),
268 : pOutlineNumrule( 0 ),
269 : nFilePos( 0 ),
270 : nBase( 0 ),
271 : nFollow( 0 ),
272 : nLFOIndex( USHRT_MAX ),
273 : nListLevel(WW8ListManager::nMaxLevel),
274 : nOutlineLevel( MAXLEVEL ),
275 : n81Flags( 0 ),
276 : n81BiDiFlags(0),
277 : maWordLR( RES_LR_SPACE ),
278 : bValid(false),
279 : bImported(false),
280 : bColl(false),
281 : bImportSkipped(false),
282 : bHasStyNumRule(false),
283 : bHasBrokenWW6List(false),
284 : bListReleventIndentSet(false),
285 : bParaAutoBefore(false),
286 2794 : bParaAutoAfter(false)
287 :
288 2794 : {}
289 :
290 2794 : ~SwWW8StyInf()
291 2794 : {
292 2794 : delete pWWFly;
293 2794 : }
294 :
295 975 : void SetOrgWWIdent( const OUString& rName, const sal_uInt16 nId )
296 : {
297 975 : sWWStyleName = rName;
298 975 : nWWStyleId = nId;
299 975 : }
300 331 : sal_uInt16 GetWWStyleId() const { return nWWStyleId; }
301 1374 : const OUString& GetOrgWWName() const
302 : {
303 1374 : return sWWStyleName;
304 : }
305 14 : bool IsOutline() const
306 : {
307 14 : return (pFmt && (MAXLEVEL > nOutlineLevel));
308 : }
309 2005 : bool IsOutlineNumbered() const
310 : {
311 2005 : return pOutlineNumrule && IsOutline();
312 : }
313 0 : const SwNumRule* GetOutlineNumrule() const
314 : {
315 0 : return pOutlineNumrule;
316 : }
317 : rtl_TextEncoding GetCharSet() const;
318 : rtl_TextEncoding GetCJKCharSet() const;
319 : };
320 :
321 : // Stack
322 :
323 580 : class SwWW8FltControlStack : public SwFltControlStack
324 : {
325 : private:
326 : SwWW8ImplReader& rReader;
327 : sal_uInt16 nToggleAttrFlags;
328 : sal_uInt16 nToggleBiDiAttrFlags;
329 : //No copying
330 : SwWW8FltControlStack(const SwWW8FltControlStack&);
331 : SwWW8FltControlStack& operator=(const SwWW8FltControlStack&);
332 : const SwNumFmt* GetNumFmtFromStack(const SwPosition &rPos,
333 : const SwTxtNode &rTxtNode);
334 : protected:
335 : virtual void SetAttrInDoc(const SwPosition& rTmpPos,
336 : SwFltStackEntry& rEntry) SAL_OVERRIDE;
337 :
338 : virtual sal_Int32 GetCurrAttrCP() const SAL_OVERRIDE;
339 : virtual bool IsParaEndInCPs(sal_Int32 nStart,sal_Int32 nEnd,bool bSdOD=true) const SAL_OVERRIDE;
340 : //Clear the para end position recorded in reader intermittently for the least impact on loading performance
341 : virtual void ClearParaEndPosition() SAL_OVERRIDE;
342 : virtual bool CheckSdOD(sal_Int32 nStart,sal_Int32 nEnd) SAL_OVERRIDE;
343 :
344 : public:
345 290 : SwWW8FltControlStack(SwDoc* pDo, sal_uLong nFieldFl, SwWW8ImplReader& rReader_ )
346 : : SwFltControlStack( pDo, nFieldFl ), rReader( rReader_ ),
347 290 : nToggleAttrFlags(0), nToggleBiDiAttrFlags(0)
348 290 : {}
349 :
350 : void NewAttr(const SwPosition& rPos, const SfxPoolItem& rAttr);
351 :
352 : virtual SwFltStackEntry* SetAttr(const SwPosition& rPos, sal_uInt16 nAttrId=0, sal_Bool bTstEnde=sal_True, long nHand=LONG_MAX, sal_Bool consumedByField=sal_False) SAL_OVERRIDE;
353 :
354 2320 : void SetToggleAttr(sal_uInt8 nId, bool bOn)
355 : {
356 2320 : if( bOn )
357 1095 : nToggleAttrFlags |= (1 << nId);
358 : else
359 1225 : nToggleAttrFlags &= ~(1 << nId);
360 2320 : }
361 :
362 1982 : sal_uInt16 GetToggleAttrFlags() const { return nToggleAttrFlags; }
363 :
364 706 : void SetToggleBiDiAttr(sal_uInt8 nId, bool bOn)
365 : {
366 706 : if( bOn )
367 360 : nToggleBiDiAttrFlags |= (1 << nId);
368 : else
369 346 : nToggleBiDiAttrFlags &= ~(1 << nId);
370 706 : }
371 :
372 1706 : sal_uInt16 GetToggleBiDiAttrFlags() const { return nToggleBiDiAttrFlags; }
373 1669 : void SetToggleAttrFlags(sal_uInt16 nFlags) { nToggleAttrFlags = nFlags; }
374 1669 : void SetToggleBiDiAttrFlags(sal_uInt16 nFlags) {nToggleBiDiAttrFlags = nFlags;}
375 :
376 : const SfxPoolItem* GetFmtAttr(const SwPosition& rPos, sal_uInt16 nWhich);
377 : const SfxPoolItem* GetStackAttr(const SwPosition& rPos, sal_uInt16 nWhich);
378 : };
379 :
380 : //The only thing this is for is RES_FLTR_ANCHOR, anything else is an error.
381 : //For graphics whose anchoring position would otherwise be automatically moved
382 : //along by the insertion of text.
383 596 : class SwWW8FltAnchorStack : public SwFltControlStack
384 : {
385 : public:
386 298 : SwWW8FltAnchorStack(SwDoc* pDo, sal_uLong nFieldFl)
387 298 : : SwFltControlStack( pDo, nFieldFl ) {}
388 : void AddAnchor(const SwPosition& rPos,SwFrmFmt *pFmt);
389 : void Flush();
390 : private:
391 : //No copying
392 : SwWW8FltAnchorStack(const SwWW8FltAnchorStack&);
393 : SwWW8FltAnchorStack& operator=(const SwWW8FltAnchorStack&);
394 : };
395 :
396 : //For fields whose handling cannot be fully resolved until we hit the end of
397 : //the document.
398 : class Position
399 : {
400 : public:
401 : SwNodeIndex maMkNode;
402 : SwNodeIndex maPtNode;
403 : sal_Int32 mnMkCntnt;
404 : sal_Int32 mnPtCntnt;
405 : Position(const SwPaM &rPaM);
406 : Position(const Position &rEntry);
407 : private:
408 : //No assignment
409 : Position& operator=(const Position&);
410 : };
411 :
412 : namespace SwWW8
413 : {
414 : struct ltstr
415 : {
416 0 : bool operator()(const OUString &r1, const OUString &r2) const
417 : {
418 0 : return r1.compareToIgnoreAsciiCase(r2)<0;
419 : }
420 : };
421 : };
422 :
423 146 : class SwWW8ReferencedFltEndStack : public SwFltEndStack
424 : {
425 : public:
426 73 : SwWW8ReferencedFltEndStack( SwDoc* pDo, sal_uLong nFieldFl )
427 : : SwFltEndStack( pDo, nFieldFl )
428 73 : , aReferencedTOCBookmarks()
429 73 : {}
430 :
431 : // Keep track of referenced TOC bookmarks in order to suppress the import
432 : // of unreferenced ones.
433 : std::set<OUString, SwWW8::ltstr> aReferencedTOCBookmarks;
434 : protected:
435 : virtual void SetAttrInDoc( const SwPosition& rTmpPos,
436 : SwFltStackEntry& rEntry ) SAL_OVERRIDE;
437 : };
438 :
439 146 : class SwWW8FltRefStack : public SwFltEndStack
440 : {
441 : public:
442 73 : SwWW8FltRefStack(SwDoc* pDo, sal_uLong nFieldFl)
443 : : SwFltEndStack( pDo, nFieldFl )
444 73 : , aFieldVarNames()
445 73 : {}
446 : bool IsFtnEdnBkmField(const SwFmtFld& rFmtFld, sal_uInt16& rBkmNo);
447 :
448 : //Keep track of variable names created with fields, and the bookmark
449 : //mapped to their position, hopefully the same, but very possibly
450 : //an additional pseudo bookmark
451 : std::map<OUString, OUString, SwWW8::ltstr> aFieldVarNames;
452 : protected:
453 : SwFltStackEntry *RefToVar(const SwField* pFld,SwFltStackEntry& rEntry);
454 : virtual void SetAttrInDoc(const SwPosition& rTmpPos,
455 : SwFltStackEntry& rEntry) SAL_OVERRIDE;
456 : private:
457 : //No copying
458 : SwWW8FltRefStack(const SwWW8FltRefStack&);
459 : SwWW8FltRefStack& operator=(const SwWW8FltRefStack&);
460 : };
461 :
462 : template< typename Type >
463 5 : inline bool get_flag( Type nBitField, Type nMask )
464 5 : { return (nBitField & nMask) != 0; }
465 :
466 : template< typename ReturnType, typename Type >
467 2 : inline ReturnType ulimit_cast( Type nValue, ReturnType nMax )
468 2 : { return static_cast< ReturnType >( ::std::min< Type >( nValue, nMax ) ); }
469 :
470 : template< typename ReturnType, typename Type >
471 2 : inline ReturnType ulimit_cast( Type nValue )
472 2 : { return ulimit_cast( nValue, ::std::numeric_limits< ReturnType >::max() ); }
473 :
474 0 : class SwMacroInfo : public SdrObjUserData
475 : {
476 : public:
477 : SwMacroInfo();
478 : virtual ~SwMacroInfo();
479 :
480 : virtual SdrObjUserData* Clone( SdrObject* pObj ) const SAL_OVERRIDE;
481 :
482 1 : void SetHlink( const OUString& rHlink ) { maHlink = rHlink; }
483 0 : const OUString& GetHlink() const { return maHlink; }
484 0 : void SetTarFrm( const OUString& rTarFrm ) { maTarFrm = rTarFrm; }
485 0 : const OUString& GetTarFrm() const { return maTarFrm; }
486 1 : void SetShapeId( const sal_Int32& rShapeId ) { mnShapeId = rShapeId; }
487 0 : const sal_Int32& GetShapeId() const { return mnShapeId; }
488 0 : void SetName( const OUString& rName ) { maNameStr = rName; }
489 0 : const OUString& GetName() const { return maNameStr; }
490 :
491 : private:
492 : sal_Int32 mnShapeId;
493 : OUString maHlink;
494 : OUString maNameStr;
495 : OUString maTarFrm;
496 : };
497 :
498 2 : struct HyperLinksTable
499 : {
500 : OUString hLinkAddr;
501 : OUString tarFrm;
502 : };
503 :
504 : namespace sw
505 : {
506 : namespace hack
507 : {
508 52 : class Position
509 : {
510 : private:
511 : SwNodeIndex maPtNode;
512 : sal_Int32 mnPtCntnt;
513 : public:
514 : Position(const SwPosition &rPos);
515 : Position(const Position &rPos);
516 : operator SwPosition() const;
517 1 : SwNodeIndex GetPtNode() { return maPtNode; };
518 1 : sal_Int32 GetPtCntnt() { return mnPtCntnt; };
519 : };
520 : }
521 : }
522 :
523 52 : class WW8FieldEntry
524 : {
525 : private:
526 : OUString msBookmarkName;
527 : OUString msMarkType;
528 : OUString msMarkCode;
529 : ::sw::mark::IFieldmark::parameter_map_t maParams;
530 :
531 : public:
532 : sw::hack::Position maStartPos;
533 : sal_uInt16 mnFieldId;
534 : sal_uLong mnObjLocFc;
535 : WW8FieldEntry(SwPosition &rPos, sal_uInt16 nFieldId) throw();
536 : WW8FieldEntry(const WW8FieldEntry &rOther) throw();
537 : WW8FieldEntry &operator=(const WW8FieldEntry &rOther) throw();
538 : void Swap(WW8FieldEntry &rOther) throw();
539 :
540 1 : SwNodeIndex GetPtNode() { return maStartPos.GetPtNode(); };
541 1 : sal_Int32 GetPtCntnt() { return maStartPos.GetPtCntnt(); };
542 :
543 : OUString GetBookmarkName();
544 : OUString GetBookmarkCode();
545 : void SetBookmarkName(const OUString& bookmarkName);
546 : void SetBookmarkType(const OUString& bookmarkType);
547 : void SetBookmarkCode(const OUString& bookmarkCode);
548 : ::sw::mark::IFieldmark::parameter_map_t& getParameters();
549 : };
550 :
551 : // Mini-Merker fuer einige Flags
552 :
553 217 : class WW8ReaderSave
554 : {
555 : private:
556 : WW8PLCFxSaveAll maPLCFxSave;
557 : SwPosition maTmpPos;
558 : std::deque<bool> maOldApos;
559 : std::deque<WW8FieldEntry> maOldFieldStack;
560 : SwWW8FltControlStack* mpOldStck;
561 : SwWW8FltAnchorStack* mpOldAnchorStck;
562 : sw::util::RedlineStack *mpOldRedlines;
563 : WW8PLCFMan* mpOldPlcxMan;
564 : WW8FlyPara* mpWFlyPara;
565 : WW8SwFlyPara* mpSFlyPara;
566 : SwPaM* mpPreviousNumPaM;
567 : const SwNumRule* mpPrevNumRule;
568 : WW8TabDesc* mpTableDesc;
569 : int mnInTable;
570 : sal_uInt16 mnAktColl;
571 : sal_Unicode mcSymbol;
572 : bool mbIgnoreText;
573 : bool mbSymbol;
574 : bool mbHdFtFtnEdn;
575 : bool mbTxbxFlySection;
576 : bool mbAnl;
577 : bool mbInHyperlink;
578 : bool mbPgSecBreak;
579 : bool mbWasParaEnd;
580 : bool mbHasBorder;
581 : bool mbFirstPara;
582 : public:
583 : WW8ReaderSave(SwWW8ImplReader* pRdr, WW8_CP nStart=-1);
584 : void Restore(SwWW8ImplReader* pRdr);
585 6 : const SwPosition &GetStartPos() const { return maTmpPos; }
586 : };
587 :
588 : enum eF_ResT{ FLD_OK, FLD_TEXT, FLD_TAGIGN, FLD_TAGTXT, FLD_READ_FSPA };
589 :
590 : class SwWW8Shade
591 : {
592 : public:
593 : Color aColor;
594 : SwWW8Shade(bool bVer67, const WW8_SHD& rSHD);
595 572 : SwWW8Shade(ColorData nFore, ColorData nBack, sal_uInt16 nIndex)
596 572 : {
597 572 : SetShade(nFore, nBack, nIndex);
598 572 : }
599 : private:
600 : void SetShade(ColorData nFore, ColorData nBack, sal_uInt16 nIndex);
601 : };
602 :
603 : // Formulas
604 :
605 : enum SwWw8ControlType
606 : {
607 : WW8_CT_EDIT,
608 : WW8_CT_CHECKBOX,
609 : WW8_CT_DROPDOWN
610 : };
611 :
612 : class WW8FormulaControl : private ::boost::noncopyable
613 : {
614 : protected:
615 : SwWW8ImplReader &rRdr;
616 : public:
617 1 : WW8FormulaControl(const OUString& rN, SwWW8ImplReader &rR)
618 : : rRdr(rR), fUnknown(0), fDropdownIndex(0),
619 : fToolTip(0), fNoMark(0), fUseSize(0), fNumbersOnly(0), fDateOnly(0),
620 1 : fUnused(0), nSize(0), hpsCheckBox(20), nChecked(0), sName( rN )
621 : {
622 1 : }
623 : sal_uInt8 fUnknown:2;
624 : sal_uInt8 fDropdownIndex:6;
625 : sal_uInt8 fToolTip:1;
626 : sal_uInt8 fNoMark:1;
627 : sal_uInt8 fUseSize:1;
628 : sal_uInt8 fNumbersOnly:1;
629 : sal_uInt8 fDateOnly:1;
630 : sal_uInt8 fUnused:3;
631 : sal_uInt16 nSize;
632 :
633 : sal_uInt16 hpsCheckBox;
634 : sal_uInt16 nChecked;
635 :
636 : OUString sTitle;
637 : OUString sDefault;
638 : OUString sFormatting;
639 : OUString sHelp;
640 : OUString sToolTip;
641 : std::vector<OUString> maListEntries;
642 1 : virtual ~WW8FormulaControl() {}
643 : void FormulaRead(SwWw8ControlType nWhich,SvStream *pD);
644 : virtual sal_Bool Import(const com::sun::star::uno::Reference <
645 : com::sun::star::lang::XMultiServiceFactory> &rServiceFactory,
646 : com::sun::star::uno::Reference <
647 : com::sun::star::form::XFormComponent> &rFComp,
648 : com::sun::star::awt::Size &rSz) = 0;
649 : OUString sName;
650 : };
651 :
652 0 : class WW8FormulaCheckBox : public WW8FormulaControl
653 : {
654 : private:
655 : //No copying
656 : WW8FormulaCheckBox(const WW8FormulaCheckBox&);
657 : WW8FormulaCheckBox& operator=(const WW8FormulaCheckBox&);
658 :
659 : public:
660 : WW8FormulaCheckBox(SwWW8ImplReader &rR);
661 :
662 : virtual sal_Bool Import(const com::sun::star::uno::Reference <
663 : com::sun::star::lang::XMultiServiceFactory> &rServiceFactory,
664 : com::sun::star::uno::Reference <
665 : com::sun::star::form::XFormComponent> &rFComp,
666 : com::sun::star::awt::Size &rSz) SAL_OVERRIDE;
667 : };
668 :
669 0 : class WW8FormulaListBox : public WW8FormulaControl
670 : {
671 : private:
672 : //No copying
673 : WW8FormulaListBox(const WW8FormulaListBox&);
674 : WW8FormulaListBox& operator=(const WW8FormulaListBox&);
675 :
676 : public:
677 : WW8FormulaListBox(SwWW8ImplReader &rR);
678 :
679 : virtual sal_Bool Import(const com::sun::star::uno::Reference <
680 : com::sun::star::lang::XMultiServiceFactory> &rServiceFactory,
681 : com::sun::star::uno::Reference <
682 : com::sun::star::form::XFormComponent> &rFComp,
683 : com::sun::star::awt::Size &rSz) SAL_OVERRIDE;
684 : };
685 :
686 1 : class WW8FormulaEditBox : public WW8FormulaControl
687 : {
688 : private:
689 : //No copying
690 : WW8FormulaEditBox(const WW8FormulaEditBox&);
691 : WW8FormulaEditBox& operator=(const WW8FormulaEditBox&);
692 : public:
693 : WW8FormulaEditBox(SwWW8ImplReader &rR);
694 : //no real implementation, return false
695 0 : virtual sal_Bool Import(const com::sun::star::uno::Reference <
696 : com::sun::star::lang::XMultiServiceFactory> & /* rServiceFactory */,
697 : com::sun::star::uno::Reference <
698 : com::sun::star::form::XFormComponent> & /* rFComp */,
699 0 : com::sun::star::awt::Size & /* rSz */) SAL_OVERRIDE { return sal_False; }
700 : };
701 :
702 758 : class SwMSConvertControls: public oox::ole::MSConvertOCXControls
703 : {
704 : public:
705 : SwMSConvertControls( SfxObjectShell *pDSh,SwPaM *pP );
706 : virtual sal_Bool InsertFormula( WW8FormulaControl &rFormula);
707 : virtual bool InsertControl(const com::sun::star::uno::Reference<
708 : com::sun::star::form::XFormComponent >& rFComp,
709 : const ::com::sun::star::awt::Size& rSize,
710 : com::sun::star::uno::Reference <
711 : com::sun::star::drawing::XShape > *pShape, bool bFloatingCtrl) SAL_OVERRIDE;
712 : bool ExportControl(WW8Export &rWrt, const SdrObject *pObj);
713 : virtual sal_Bool ReadOCXStream( SotStorageRef& rSrc1,
714 : com::sun::star::uno::Reference<
715 : com::sun::star::drawing::XShape > *pShapeRef=0,
716 : sal_Bool bFloatingCtrl=false );
717 : private:
718 : sal_uInt32 GenerateObjectID();
719 : SwPaM *pPaM;
720 : sal_uInt32 mnObjectId;
721 : };
722 :
723 80 : class SwMSDffManager : public SvxMSDffManager
724 : {
725 : private:
726 : SwWW8ImplReader& rReader;
727 : SvStream *pFallbackStream;
728 : std::map<sal_uInt32,OString> aOldEscherBlipCache;
729 :
730 : virtual bool GetOLEStorageName( long nOLEId, OUString& rStorageName,
731 : SvStorageRef& rSrcStorage, com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& rDestStorage ) const SAL_OVERRIDE;
732 : virtual bool ShapeHasText( sal_uLong nShapeId, sal_uLong nFilePos ) const SAL_OVERRIDE;
733 : // #i32596# - new parameter <_nCalledByGroup>, which
734 : // indicates, if the OLE object is imported inside a group object
735 : virtual SdrObject* ImportOLE( long nOLEId,
736 : const Graphic& rGrf,
737 : const Rectangle& rBoundRect,
738 : const Rectangle& rVisArea,
739 : const int _nCalledByGroup,
740 : sal_Int64 nAspect ) const SAL_OVERRIDE;
741 :
742 : //No copying
743 : SwMSDffManager(const SwMSDffManager&);
744 : SwMSDffManager& operator=(const SwMSDffManager&);
745 : public:
746 : static sal_uInt32 GetFilterFlags();
747 : static sal_Int32 GetEscherLineMatch(MSO_LineStyle eStyle, MSO_SPT eShapeType,
748 : sal_Int32 &rThick);
749 : SwMSDffManager( SwWW8ImplReader& rRdr );
750 : void DisableFallbackStream();
751 : void EnableFallbackStream();
752 : protected:
753 : virtual SdrObject* ProcessObj( SvStream& rSt, DffObjData& rObjData, void* pData, Rectangle& rTextRect, SdrObject* pObj ) SAL_OVERRIDE;
754 : };
755 :
756 357 : class wwSection
757 : {
758 : public:
759 : wwSection(const SwPosition &rPos);
760 : SEPr maSep;
761 : WW8_BRCVer9 brc[4];
762 : SwNodeIndex maStart;
763 : SwSection *mpSection;
764 : SwPageDesc *mpPage;
765 : SvxFrameDirection meDir;
766 : short mLinkId;
767 :
768 : sal_uInt32 nPgWidth;
769 : sal_uInt32 nPgLeft;
770 : sal_uInt32 nPgRight;
771 :
772 : sal_uInt8 mnBorders;
773 : bool mbHasFootnote;
774 : void SetDirection();
775 : void SetLinkId(short sLinkId) { mLinkId = sLinkId; }
776 : bool DoesContainFootnote() const { return mbHasFootnote; }
777 25 : bool IsContinuous() const { return maSep.bkc == 0; }
778 : bool IsLinked() const { return mLinkId != 0; }
779 2 : bool IsNotProtected() const { return maSep.fUnlocked != 0; }
780 : bool IsVertical() const;
781 85 : sal_Int16 NoCols() const { return maSep.ccolM1 + 1; }
782 1 : sal_Int32 StandardColSeparation() const { return maSep.dxaColumns; }
783 85 : bool HasTitlePage() const { return maSep.fTitlePage ? true : false; }
784 4 : sal_uInt16 PageStartAt() const { return maSep.pgnStart; }
785 85 : bool PageRestartNo() const { return maSep.fPgnRestart ? true : false; }
786 0 : bool IsBiDi() const { return maSep.fBiDi ? true : false; }
787 2104 : sal_uInt32 GetPageWidth() const { return nPgWidth; }
788 1813 : sal_uInt32 GetTextAreaWidth() const
789 1813 : { return GetPageWidth() - GetPageLeft() - GetPageRight(); }
790 281 : sal_uInt32 GetPageHeight() const { return maSep.yaPage; }
791 1898 : sal_uInt32 GetPageLeft() const { return nPgLeft; }
792 1898 : sal_uInt32 GetPageRight() const { return nPgRight; }
793 281 : bool IsLandScape() const { return maSep.dmOrientPage ? true : false; }
794 84 : bool IsFixedHeightHeader() const { return maSep.dyaTop < 0; }
795 89 : bool IsFixedHeightFooter() const { return maSep.dyaBottom < 0; }
796 : };
797 :
798 75 : class wwSectionManager
799 : {
800 : private:
801 : /*
802 : A queue of the ms sections in the document
803 : */
804 : SwWW8ImplReader& mrReader;
805 : std::deque<wwSection> maSegments;
806 : typedef ::std::deque<wwSection>::iterator mySegIter;
807 : typedef ::std::deque<wwSection>::reverse_iterator mySegrIter;
808 :
809 : //Num of page desc's entered into the document
810 : sal_uInt16 mnDesc;
811 :
812 : struct wwULSpaceData
813 : {
814 : bool bHasHeader, bHasFooter;
815 : sal_uInt32 nSwHLo, nSwFUp, nSwUp, nSwLo;
816 85 : wwULSpaceData()
817 : : bHasHeader(false)
818 : , bHasFooter(false)
819 : , nSwHLo(0)
820 : , nSwFUp(0)
821 : , nSwUp(0)
822 85 : , nSwLo(0)
823 85 : {}
824 : };
825 :
826 : void SetSegmentToPageDesc(const wwSection &rSection, bool bIgnoreCols);
827 :
828 : void GetPageULData(const wwSection &rNewSection,
829 : wwULSpaceData& rData) const;
830 : void SetPageULSpaceItems(SwFrmFmt &rFmt, wwULSpaceData& rData,
831 : const wwSection &rSection) const;
832 :
833 : void SetPage(SwPageDesc &rPageDesc, SwFrmFmt &rFmt,
834 : const wwSection &rSection, bool bIgnoreCols) const;
835 :
836 : void SetNumberingType(const wwSection &rNewSection, SwPageDesc &rPageDesc)
837 : const;
838 :
839 : void SetUseOn(wwSection &rSection);
840 : void SetHdFt(wwSection &rSection, int nSect, const wwSection *pPrevious);
841 :
842 : SwSectionFmt *InsertSection(SwPaM& rMyPaM, wwSection &rSection);
843 : bool SetCols(SwFrmFmt &rFmt, const wwSection &rSection,
844 : sal_uInt32 nNettoWidth) const;
845 : bool SectionIsProtected(const wwSection &rSection) const;
846 : void SetLeftRight(wwSection &rSection);
847 : bool IsNewDoc() const;
848 : /*
849 : The segment we're inserting, the start of the segments container, and the
850 : nodeindex of where we want the page break to (normally the segments start
851 : position
852 : */
853 : SwFmtPageDesc SetSwFmtPageDesc(mySegIter &rIter, mySegIter &rStart,
854 : bool bIgnoreCols);
855 :
856 : //No copying
857 : wwSectionManager(const wwSectionManager&);
858 : wwSectionManager& operator=(const wwSectionManager&);
859 : public:
860 75 : wwSectionManager(SwWW8ImplReader &rReader) : mrReader(rReader), mnDesc(0)
861 75 : {};
862 : void SetCurrentSectionHasFootnote();
863 : bool CurrentSectionIsVertical() const;
864 : bool CurrentSectionIsProtected() const;
865 : void PrependedInlineNode(const SwPosition &rPos, const SwNode &rNode);
866 : sal_uInt16 CurrentSectionColCount() const;
867 : bool WillHavePageDescHere(SwNodeIndex aIdx) const;
868 : void CreateSep(const long nTxtPos, bool bMustHaveBreak);
869 : void InsertSegments();
870 : void JoinNode(const SwPosition &rPos, const SwNode &rNode);
871 : sal_uInt32 GetPageLeft() const;
872 : sal_uInt32 GetPageRight() const;
873 : sal_uInt32 GetPageWidth() const;
874 : sal_uInt32 GetWWPageTopMargin() const;
875 : bool empty() const { return maSegments.empty(); }
876 : sal_uInt32 GetTextAreaWidth() const;
877 : };
878 :
879 : //Various writer elements like frames start off containing a blank paragraph,
880 : //sometimes this paragraph turns out to be extraneous, e.g. the frame should
881 : //only contain a table with no trailing paragraph.
882 :
883 : //We want to remove these extra paragraphs, but removing them during the parse
884 : //is problematic, because we don't want to remove any paragraphs that are still
885 : //addressed by property entries in a SwFltControlStack which have not yet been
886 : //committed to the document.
887 :
888 : //Safest thing is to not delete SwTxtNodes from a document during import, and
889 : //remove these extraneous paragraphs at the end after all SwFltControlStack are
890 : //destroyed.
891 : class wwExtraneousParas : private ::boost::noncopyable
892 : {
893 : private:
894 : /*
895 : A vector of SwTxtNodes to erase from a document after import is complete
896 : */
897 : std::vector<SwTxtNode*> m_aTxtNodes;
898 : SwDoc& m_rDoc;
899 : public:
900 75 : wwExtraneousParas(SwDoc &rDoc) : m_rDoc(rDoc) {}
901 75 : ~wwExtraneousParas() { delete_all_from_doc(); }
902 1 : void push_back(SwTxtNode *pTxtNode) { m_aTxtNodes.push_back(pTxtNode); }
903 : void delete_all_from_doc();
904 : };
905 :
906 75 : class wwFrameNamer : private ::boost::noncopyable
907 : {
908 : private:
909 : OUString msSeed;
910 : sal_Int32 mnImportedGraphicsCount;
911 : bool mbIsDisabled;
912 : public:
913 : void SetUniqueGraphName(SwFrmFmt *pFrmFmt, const OUString &rFixedPart);
914 75 : wwFrameNamer(bool bIsDisabled, const OUString &rSeed)
915 75 : : msSeed(rSeed), mnImportedGraphicsCount(0), mbIsDisabled(bIsDisabled)
916 : {
917 75 : }
918 : };
919 :
920 75 : class wwSectionNamer
921 : {
922 : private:
923 : const SwDoc &mrDoc;
924 : OUString msFileLinkSeed;
925 : int mnFileSectionNo;
926 : //No copying
927 : wwSectionNamer(const wwSectionNamer&);
928 : wwSectionNamer& operator=(const wwSectionNamer&);
929 : public:
930 : OUString UniqueName();
931 75 : wwSectionNamer(const SwDoc &rDoc, const OUString &rSeed)
932 75 : : mrDoc(rDoc), msFileLinkSeed(rSeed), mnFileSectionNo(0)
933 75 : { }
934 : };
935 :
936 : class FtnDescriptor
937 : {
938 : public:
939 : ManTypes meType;
940 : bool mbAutoNum;
941 : WW8_CP mnStartCp;
942 : WW8_CP mnLen;
943 : };
944 :
945 : struct ApoTestResults
946 : {
947 : bool mbStartApo;
948 : bool mbStopApo;
949 : bool m_bHasSprm37;
950 : bool m_bHasSprm29;
951 : sal_uInt8 m_nSprm29;
952 : WW8FlyPara* mpStyleApo;
953 4022 : ApoTestResults()
954 : : mbStartApo(false), mbStopApo(false), m_bHasSprm37(false)
955 4022 : , m_bHasSprm29(false), m_nSprm29(0), mpStyleApo(0) {}
956 1194 : bool HasStartStop() const { return (mbStartApo || mbStopApo); }
957 4124 : bool HasFrame() const { return (m_bHasSprm29 || m_bHasSprm37 || mpStyleApo); }
958 : };
959 :
960 : struct ANLDRuleMap
961 : {
962 : SwNumRule* mpOutlineNumRule; // WinWord 6 numbering, variant 1
963 : SwNumRule* mpNumberingNumRule; // WinWord 6 numbering, variant 2
964 : SwNumRule* GetNumRule(sal_uInt8 nNumType);
965 : void SetNumRule(SwNumRule*, sal_uInt8 nNumType);
966 75 : ANLDRuleMap() : mpOutlineNumRule(0), mpNumberingNumRule(0) {}
967 : };
968 :
969 : struct SprmReadInfo;
970 : class SwDocShell;
971 0 : struct WW8PostProcessAttrsInfo
972 : {
973 : bool mbCopy;
974 : WW8_CP mnCpStart;
975 : WW8_CP mnCpEnd;
976 : SwPaM mPaM;
977 : SfxItemSet mItemSet;
978 :
979 : WW8PostProcessAttrsInfo(WW8_CP nCpStart, WW8_CP nCpEnd, SwPaM & rPaM);
980 : };
981 :
982 : #define MAX_COL 64 // WW6-description: 32, WW6-UI: 31 & WW8-UI: 63!
983 :
984 : struct WW8TabBandDesc
985 : {
986 : WW8TabBandDesc* pNextBand;
987 : short nGapHalf;
988 : short mnDefaultLeft;
989 : short mnDefaultTop;
990 : short mnDefaultRight;
991 : short mnDefaultBottom;
992 : bool mbHasSpacing;
993 : short nLineHeight;
994 : short nRows;
995 : sal_uInt16 maDirections[MAX_COL + 1];
996 : short nCenter[MAX_COL + 1]; // X-edge of all cells of this band
997 : short nWidth[MAX_COL + 1]; // length of all cells of this band
998 : short nWwCols; // sal_uInt8 would be sufficient, alignment -> short
999 : short nSwCols; // SW: number of columns for the writer
1000 : bool bLEmptyCol; // SW: an additional empty column at the left
1001 : bool bREmptyCol; // SW: same at the right
1002 : bool bCantSplit;
1003 : bool bCantSplit90;
1004 : WW8_TCell* pTCs;
1005 : sal_uInt8 nOverrideSpacing[MAX_COL + 1];
1006 : short nOverrideValues[MAX_COL + 1][4];
1007 : WW8_SHD* pSHDs;
1008 : sal_uInt32* pNewSHDs;
1009 : WW8_BRCVer9 aDefBrcs[6];
1010 :
1011 : bool bExist[MAX_COL]; // does this cell exist ?
1012 : sal_uInt8 nTransCell[MAX_COL + 2]; // translation WW-Index -> SW-Index
1013 :
1014 1394 : sal_uInt8 transCell(sal_uInt8 nWwCol) const
1015 : {
1016 1394 : return nWwCol < SAL_N_ELEMENTS(nTransCell) ? nTransCell[nWwCol] : 0xFF;
1017 : }
1018 :
1019 : WW8TabBandDesc();
1020 : WW8TabBandDesc(WW8TabBandDesc& rBand); // deep copy
1021 : ~WW8TabBandDesc();
1022 : static void setcelldefaults(WW8_TCell *pCells, short nCells);
1023 : void ReadDef(bool bVer67, const sal_uInt8* pS);
1024 : void ProcessDirection(const sal_uInt8* pParams);
1025 : void ProcessSprmTSetBRC(int nBrcVer, const sal_uInt8* pParamsTSetBRC);
1026 : void ProcessSprmTTableBorders(int nBrcVer, const sal_uInt8* pParams);
1027 : void ProcessSprmTDxaCol(const sal_uInt8* pParamsTDxaCol);
1028 : void ProcessSprmTDelete(const sal_uInt8* pParamsTDelete);
1029 : void ProcessSprmTInsert(const sal_uInt8* pParamsTInsert);
1030 : void ProcessSpacing(const sal_uInt8* pParamsTInsert);
1031 : void ProcessSpecificSpacing(const sal_uInt8* pParamsTInsert);
1032 : void ReadShd(const sal_uInt8* pS );
1033 : void ReadNewShd(const sal_uInt8* pS, bool bVer67);
1034 :
1035 : enum wwDIR {wwTOP = 0, wwLEFT = 1, wwBOTTOM = 2, wwRIGHT = 3};
1036 : };
1037 :
1038 : // Storage-Reader
1039 :
1040 : typedef std::set<WW8_CP> cp_set;
1041 : typedef std::vector<WW8_CP> cp_vector;
1042 :
1043 75 : class SwWW8ImplReader
1044 : {
1045 : private:
1046 : SwDocShell *mpDocShell; // The Real DocShell
1047 :
1048 : friend class WW8RStyle;
1049 : friend class WW8TabDesc;
1050 : friend class WW8ReaderSave;
1051 : friend struct WW8FlyPara;
1052 : friend struct WW8SwFlyPara;
1053 : friend class WW8FlySet;
1054 : friend class SwMSDffManager;
1055 : friend class SwWW8FltControlStack;
1056 : friend class WW8FormulaControl;
1057 : friend class wwSectionManager;
1058 :
1059 : private:
1060 :
1061 : SvStorage* pStg; // Input-Storage
1062 : SvStream* pStrm; // Input-(Storage)Stream
1063 : SvStream* pTableStream; // Input-(Storage)Stream
1064 : SvStream* pDataStream; // Input-(Storage)Stream
1065 :
1066 : // allgemeines
1067 : SwDoc& rDoc;
1068 : SwPaM* pPaM;
1069 :
1070 : SwWW8FltControlStack* pCtrlStck; // Stack fuer die Attribute
1071 :
1072 : /*
1073 : This stack is for redlines, because their sequence of discovery can
1074 : be out of order of their order of insertion into the document.
1075 : */
1076 : sw::util::RedlineStack *mpRedlineStack;
1077 :
1078 : /*
1079 : This stack is for fields that get referenced later, e.g. BookMarks and TOX.
1080 : They get inserted at the end of the document, it is the same stack for
1081 : headers/footers/main text/textboxes/tables etc...
1082 : */
1083 : SwWW8ReferencedFltEndStack *pReffedStck;
1084 :
1085 : /*
1086 : This stack is for fields whose true conversion cannot be determined until
1087 : the end of the document, it is the same stack for headers/footers/main
1088 : text/textboxes/tables etc... They are things that reference other things
1089 : e.g. NoteRef and Ref, they are processed after pReffedStck
1090 : */
1091 : SwWW8FltRefStack *pReffingStck;
1092 :
1093 : /*
1094 : For graphics anchors. Determines the graphics whose anchors are in the
1095 : current paragraph, and works around the difficulty in inserting a graphic
1096 : anchored to character before a character to be anchored to has been
1097 : inserted. Is emptied at the end of each paragraph.
1098 : */
1099 : SwWW8FltAnchorStack* pAnchorStck;
1100 :
1101 : /*
1102 : A stack of fields identifiers to keep track of any open fields that need
1103 : to be closed. Generally word fields are inserted as writer fields as soon
1104 : as they are encountered, and so their end point is normally unimportant.
1105 : But hyperlink fields need to be applied as attributes to text and it is
1106 : far easier and safer to set the end point of an attribute when we
1107 : encounter the end marker of the field instead of caculating in advance
1108 : where the end point will fall, to do so fully correctly duplicates the
1109 : main logic of the filter itself.
1110 : */
1111 : std::deque<WW8FieldEntry> maFieldStack;
1112 : typedef std::deque<WW8FieldEntry>::const_iterator mycFieldIter;
1113 :
1114 : /*
1115 : A stack of open footnotes. Should only be one in it at any time.
1116 : */
1117 : std::deque<FtnDescriptor> maFtnStack;
1118 :
1119 : /*
1120 : A queue of the ms sections in the document
1121 : */
1122 : wwSectionManager maSectionManager;
1123 :
1124 : /*
1125 : A vector of surplus-to-requirements paragraph in the final document,
1126 : that exist because of quirks of the SwDoc document model and/or API,
1127 : which need to be removed.
1128 : */
1129 : wwExtraneousParas m_aExtraneousParas;
1130 :
1131 : /*
1132 : A map of of tables to their follow nodes for use in inserting tables into
1133 : already existing document, i.e. insert file
1134 : */
1135 : sw::util::InsertedTablesManager maInsertedTables;
1136 :
1137 : /*
1138 : Creates unique names to give to (file link) sections (WW1/WW2/...)
1139 : */
1140 : wwSectionNamer maSectionNameGenerator;
1141 :
1142 : /*
1143 : Knows how to split a series of bytes into sprms and their arguments
1144 : */
1145 : wwSprmParser *mpSprmParser;
1146 :
1147 : /*
1148 : Creates unique names to give to graphics
1149 : */
1150 : wwFrameNamer maGrfNameGenerator;
1151 :
1152 : /*
1153 : Knows which writer style a given word style should be imported as.
1154 : */
1155 : sw::util::ParaStyleMapper maParaStyleMapper;
1156 : sw::util::CharStyleMapper maCharStyleMapper;
1157 :
1158 : /*
1159 : Stack of textencoding being used as we progress through the document text
1160 : */
1161 : std::stack<rtl_TextEncoding> maFontSrcCharSets;
1162 : std::stack<rtl_TextEncoding> maFontSrcCJKCharSets;
1163 :
1164 : /*
1165 : Winword numbering gets imported as SwNumRules, there is a problem that
1166 : winword can have multiple outline numberings, only one gets chosen as
1167 : the writer outline numbering rule. The one that gets chosen is set here
1168 : as mpChosenOutlineNumRule
1169 : */
1170 : SwNumRule *mpChosenOutlineNumRule;
1171 :
1172 : SwMSConvertControls *pFormImpl; // Control-Implementierung
1173 :
1174 : SwFlyFrmFmt* pFlyFmtOfJustInsertedGraphic;
1175 : SwFrmFmt* pFmtOfJustInsertedApo;
1176 : SwPaM* pPreviousNumPaM;
1177 : const SwNumRule* pPrevNumRule;
1178 :
1179 : //Keep track of APO environments
1180 : std::deque<bool> maApos;
1181 : typedef std::deque<bool>::const_iterator mycApoIter;
1182 : /*
1183 : Keep track of generated Ruby character formats we we can minimize the
1184 : number of character formats created
1185 : */
1186 : std::vector<const SwCharFmt*> aRubyCharFmts;
1187 :
1188 : WW8PostProcessAttrsInfo * mpPostProcessAttrsInfo;
1189 :
1190 : WW8Fib* pWwFib;
1191 : WW8Fonts* pFonts;
1192 : WW8Dop* pWDop;
1193 : WW8ListManager* pLstManager;
1194 : WW8ScannerBase* pSBase;
1195 : WW8PLCFMan* pPlcxMan;
1196 : std::map<short, OUString> aLinkStringMap;
1197 :
1198 : std::set<const SwNode*> maTxtNodesHavingFirstLineOfstSet; // #i103711#
1199 : std::set<const SwNode*> maTxtNodesHavingLeftIndentSet; // #i105414#
1200 :
1201 : WW8RStyle* pStyles; // Pointer auf die Style-Einleseklasse
1202 : SwFmt* pAktColl; // gerade zu erzeugende Collection
1203 : // ( ist ausserhalb einer Style-Def immer 0 )
1204 : SfxItemSet* pAktItemSet;// gerade einzulesende Zeichenattribute
1205 : // (ausserhalb des WW8ListManager Ctor's immer 0)
1206 : std::vector<SwWW8StyInf> vColl;
1207 : const SwTxtFmtColl* pDfltTxtFmtColl; // Default
1208 : SwFmt* pStandardFmtColl;// "Standard"
1209 :
1210 : WW8PLCF_HdFt* pHdFt; // Pointer auf Header / Footer - Scannerklasse
1211 :
1212 : WW8FlyPara* pWFlyPara; // WW-Parameter
1213 : WW8SwFlyPara* pSFlyPara; // daraus erzeugte Sw-Parameter
1214 :
1215 : WW8TabDesc* pTableDesc; // Beschreibung der Tabelleneigenschaften
1216 : //Keep track of tables within tables
1217 : std::stack<WW8TabDesc*> maTableStack;
1218 :
1219 : ANLDRuleMap maANLDRules;
1220 : WW8_OLST* pNumOlst; // Gliederung im Text
1221 :
1222 : SwNode* pNode_FLY_AT_PARA; // set: WW8SwFlyPara() read: CreateSwTable()
1223 :
1224 : SdrModel* pDrawModel;
1225 : SdrPage* pDrawPg;
1226 : EditEngine* mpDrawEditEngine;
1227 : wwZOrderer *pWWZOrder;
1228 :
1229 : SwFieldType* pNumFldType; // fuer Nummernkreis
1230 :
1231 : SwMSDffManager* pMSDffManager;
1232 :
1233 : std::vector<OUString>* mpAtnNames;
1234 : boost::shared_ptr< std::map<sal_uInt32, int> > mpAtnIndexes;
1235 : boost::shared_ptr<WW8PLCFspecial> mpAtnStarts;
1236 : boost::shared_ptr<WW8PLCFspecial> mpAtnEnds;
1237 :
1238 : sw::util::AuthorInfos m_aAuthorInfos;
1239 : OUString sBaseURL;
1240 :
1241 : // Ini-Flags:
1242 : sal_uInt32 nIniFlags; // Flags aus der writer.ini
1243 : sal_uInt32 nIniFlags1; // dito ( zusaetzliche Flags )
1244 : sal_uInt32 nFieldFlags; // dito fuer Feldern
1245 : sal_uInt32 nFieldTagAlways[3]; // dito fuers Taggen von Feldern
1246 : sal_uInt32 nFieldTagBad[3]; // dito fuers Taggen von nicht importierbaren F.
1247 : bool m_bRegardHindiDigits; // import digits in CTL scripts as Hindi numbers
1248 :
1249 : WW8_CP nDrawCpO; // Anfang der Txbx-SubDocs
1250 :
1251 : sal_uLong nPicLocFc; // Picture Location in File (FC)
1252 : sal_uLong nObjLocFc; // Object Location in File (FC)
1253 :
1254 : sal_Int32 nIniFlyDx; // X-Verschiebung von Flys
1255 : sal_Int32 nIniFlyDy; // Y-Verschiebung von Flys
1256 :
1257 : rtl_TextEncoding eTextCharSet; // Default charset for Text
1258 : rtl_TextEncoding eStructCharSet; // rtl_TextEncoding for structures
1259 : rtl_TextEncoding eHardCharSet; // Hard rtl_TextEncoding-Attribute
1260 : sal_uInt16 nProgress; // %-Angabe fuer Progressbar
1261 : sal_uInt16 nAktColl; // gemaess WW-Zaehlung
1262 : sal_uInt16 nFldNum; // laufende Nummer dafuer
1263 : sal_uInt16 nLFOPosition;
1264 :
1265 : short nCharFmt; // gemaess WW-Zaehlung, <0 fuer keine
1266 :
1267 : short nDrawXOfs, nDrawYOfs;
1268 : short nDrawXOfs2, nDrawYOfs2;
1269 :
1270 : sal_Unicode cSymbol; // aktuell einzulesendes Symbolzeichen
1271 :
1272 : sal_uInt8 nWantedVersion; // urspruenglich vom Writer
1273 : // angeforderte WW-Doc-Version
1274 :
1275 : sal_uInt8 nSwNumLevel; // LevelNummer fuer Outline / Nummerierung
1276 : sal_uInt8 nWwNumType; // Gliederung / Nummerg / Aufzaehlg
1277 : sal_uInt8 nListLevel;
1278 :
1279 : sal_uInt8 nPgChpDelim; // ChapterDelim from PageNum
1280 : sal_uInt8 nPgChpLevel; // ChapterLevel of Heading from PageNum
1281 :
1282 : bool mbNewDoc; // Neues Dokument ?
1283 : bool bReadNoTbl; // Keine Tabellen
1284 : bool bPgSecBreak; // Page- oder Sectionbreak ist noch einzufuegen
1285 : bool bSpec; // Special-Char im Text folgt
1286 : bool bObj; // Obj im Text
1287 : bool bTxbxFlySection; // FlyFrame, der als Ersatz fuer Winword Textbox eingefuegt wurde
1288 : bool bHasBorder; // fuer Buendelung der Border
1289 : bool bSymbol; // z.B. Symbol statt Times
1290 : bool bIgnoreText; // z.B. fuer FieldVanish
1291 : int nInTable; // wird gerade eine Tabelle eingelesen
1292 : bool bWasTabRowEnd; // Tabelle : Row End Mark
1293 : bool bWasTabCellEnd; // table: Cell End Mark
1294 :
1295 : bool bShdTxtCol; // Textfarbe indirekt gesetzt ( Hintergrund sw )
1296 : bool bCharShdTxtCol; // Textfarbe indirekt gesetzt ( Zeichenhintergrund sw )
1297 : bool bAnl; // Nummerierung in Bearbeitung
1298 : // Anl heisst Autonumber level
1299 :
1300 : bool bHdFtFtnEdn; // Spezialtext: Kopf- Fuss- usw.
1301 : bool bFtnEdn; // Fussnote oder Endnote
1302 : bool bIsHeader; // Text aus Header wird gelesen ( Zeilenhoehe )
1303 : bool bIsFooter; // Text aus Footer wird gelesen ( Zeilenhoehe )
1304 :
1305 : bool bIsUnicode; // aktuelles Text-Stueck ist als 2-Bytiger-Unicode kodiert
1306 : // bitte NICHT als Bitfeld kodieren!
1307 :
1308 : bool bCpxStyle; // Style im Complex Part
1309 : bool bStyNormal; // Style mit Id 0 wird gelesen
1310 : bool bWWBugNormal; // WW-Version nit Bug Dya in Style Normal
1311 : bool bNoAttrImport; // Attribute ignorieren zum Ignorieren v. Styles
1312 : bool bInHyperlink; // Sonderfall zum einlesen eines 0x01
1313 : // siehe: SwWW8ImplReader::Read_F_Hyperlink()
1314 : bool bWasParaEnd;
1315 :
1316 : // praktische Hilfsvariablen:
1317 : bool bVer67; // ( (6 == nVersion) || (7 == nVersion) );
1318 : bool bVer6; // (6 == nVersion);
1319 : bool bVer7; // (7 == nVersion);
1320 : bool bVer8; // (8 == nVersion);
1321 :
1322 : bool bEmbeddObj; // EmbeddField gelesen
1323 :
1324 : bool bAktAND_fNumberAcross; // current active Annotated List Deskriptor - ROW flag
1325 :
1326 : bool bNoLnNumYet; // no Line Numbering has been activated yet (we import
1327 : // the very 1st Line Numbering and ignore the rest)
1328 :
1329 : bool bFirstPara; // first paragraph?
1330 : bool bFirstParaOfPage;
1331 : bool bParaAutoBefore;
1332 : bool bParaAutoAfter;
1333 :
1334 : bool bDropCap;
1335 : sal_Int32 nDropCap;
1336 :
1337 : int nIdctHint;
1338 : bool bBidi;
1339 : bool bReadTable;
1340 : boost::shared_ptr<SwPaM> mpTableEndPaM;
1341 : // Indicate that currently on loading a TOC, managed by Read_F_TOX() and End_Field()
1342 : bool mbLoadingTOCCache;
1343 : // Indicate that current on loading a hyperlink, which is inside a TOC; Managed by Read_F_Hyperlink() and End_Field()
1344 : bool mbLoadingTOCHyperlink;
1345 : // a document position recorded the after-position of TOC section, managed by Read_F_TOX() and End_Field()
1346 : SwPaM* mpPosAfterTOC;
1347 :
1348 : bool mbCareFirstParaEndInToc;
1349 : bool mbCareLastParaEndInToc;
1350 : cp_set maTOXEndCps;
1351 :
1352 : cp_vector maEndParaPos;
1353 : WW8_CP maCurrAttrCP;
1354 : bool mbOnLoadingMain:1;
1355 :
1356 : const SprmReadInfo& GetSprmReadInfo(sal_uInt16 nId) const;
1357 :
1358 10312 : bool StyleExists(unsigned int nColl) const { return (nColl < vColl.size()); }
1359 : SwWW8StyInf *GetStyle(sal_uInt16 nColl) const;
1360 : void AppendTxtNode(SwPosition& rPos);
1361 :
1362 : void Read_HdFt(int nSect, const SwPageDesc *pPrev,
1363 : const wwSection &rSection);
1364 : void Read_HdFtText(long nStartCp, long nLen, SwFrmFmt* pHdFtFmt);
1365 : void Read_HdFtTextAsHackedFrame(long nStart, long nLen,
1366 : SwFrmFmt &rHdFtFmt, sal_uInt16 nPageWidth);
1367 :
1368 : bool isValid_HdFt_CP(WW8_CP nHeaderCP) const;
1369 :
1370 : bool HasOwnHeaderFooter(sal_uInt8 nWhichItems, sal_uInt8 grpfIhdt, int nSect);
1371 :
1372 : void HandleLineNumbering(const wwSection &rSection);
1373 :
1374 : void CopyPageDescHdFt( const SwPageDesc* pOrgPageDesc,
1375 : SwPageDesc* pNewPageDesc, sal_uInt8 nCode );
1376 :
1377 : void DeleteStk(SwFltControlStack* prStck);
1378 290 : void DeleteCtrlStk() { DeleteStk( pCtrlStck ); pCtrlStck = 0; }
1379 73 : void DeleteRefStks()
1380 : {
1381 73 : DeleteStk( pReffedStck );
1382 73 : pReffedStck = 0;
1383 73 : DeleteStk( pReffingStck );
1384 73 : pReffingStck = 0;
1385 73 : }
1386 298 : void DeleteAnchorStk() { DeleteStk( pAnchorStck ); pAnchorStck = 0; }
1387 : void emulateMSWordAddTextToParagraph(const OUString& rAddString);
1388 : void simpleAddTextToParagraph(const OUString& rAddString);
1389 : bool HandlePageBreakChar();
1390 : bool ReadChar(long nPosCp, long nCpOfs);
1391 : bool ReadPlainChars(WW8_CP& rPos, sal_Int32 nEnd, sal_Int32 nCpOfs);
1392 : bool ReadChars(WW8_CP& rPos, WW8_CP nNextAttr, long nTextEnd, long nCpOfs);
1393 : bool LangUsesHindiNumbers(sal_uInt16 nLang);
1394 : sal_Unicode TranslateToHindiNumbers(sal_Unicode);
1395 :
1396 : void SetDocumentGrid(SwFrmFmt &rFmt, const wwSection &rSection);
1397 :
1398 : void ProcessAktCollChange(WW8PLCFManResult& rRes, bool* pStartAttr,
1399 : bool bCallProcessSpecial);
1400 : long ReadTextAttr(WW8_CP& rTxtPos, bool& rbStartLine);
1401 : void ReadAttrs(WW8_CP& rNext, WW8_CP& rTxtPos, bool& rbStartLine);
1402 : void CloseAttrEnds();
1403 : bool ReadText(long nStartCp, long nTextLen, ManTypes nType);
1404 :
1405 : void ReadRevMarkAuthorStrTabl( SvStream& rStrm, sal_Int32 nTblPos,
1406 : sal_Int32 nTblSiz, SwDoc& rDoc );
1407 :
1408 : void Read_HdFtFtnText( const SwNodeIndex* pSttIdx, long nStartCp,
1409 : long nLen, ManTypes nType );
1410 :
1411 : void ImportTox( int nFldId, const OUString& aStr );
1412 :
1413 : void EndSprm( sal_uInt16 nId );
1414 : // #i103711#
1415 : // #i105414#
1416 : void NewAttr( const SfxPoolItem& rAttr,
1417 : const bool bFirstLineOfStSet = false,
1418 : const bool bLeftIndentSet = false );
1419 :
1420 : bool GetFontParams(sal_uInt16, FontFamily&, OUString&, FontPitch&,
1421 : rtl_TextEncoding&);
1422 : bool SetNewFontAttr(sal_uInt16 nFCode, bool bSetEnums, sal_uInt16 nWhich);
1423 : void ResetCharSetVars();
1424 : void ResetCJKCharSetVars();
1425 :
1426 : const SfxPoolItem* GetFmtAttr( sal_uInt16 nWhich );
1427 : bool JoinNode(SwPaM &rPam, bool bStealAttr = false);
1428 :
1429 : bool IsBorder(const WW8_BRCVer9* pbrc, bool bChkBtwn = false) const;
1430 :
1431 : //Set closest writer border equivalent into rBox from pbrc, optionally
1432 : //recording true winword dimensions in pSizeArray. nSetBorders to mark a
1433 : //border which has been previously set to a value and for which becoming
1434 : //empty is valid. Set bCheBtwn to work with paragraphs that have a special
1435 : //between paragraphs border
1436 :
1437 : // Note #i20672# we can't properly support between lines so best to ignore
1438 : // them for now
1439 : bool SetBorder(SvxBoxItem& rBox, const WW8_BRCVer9* pbrc,
1440 : short *pSizeArray=0, sal_uInt8 nSetBorders=0xFF) const;
1441 : void GetBorderDistance(const WW8_BRCVer9* pbrc, Rectangle& rInnerDist) const;
1442 : sal_uInt16 GetParagraphAutoSpace(bool fDontUseHTMLAutoSpacing);
1443 : bool SetShadow(SvxShadowItem& rShadow, const short *pSizeArray,
1444 : const WW8_BRCVer9& aRightBrc) const;
1445 : //returns true is a shadow was set
1446 : bool SetFlyBordersShadow(SfxItemSet& rFlySet, const WW8_BRCVer9 *pbrc,
1447 : short *SizeArray=0) const;
1448 : void SetPageBorder(SwFrmFmt &rFmt, const wwSection &rSection) const;
1449 :
1450 : sal_Int32 MatchSdrBoxIntoFlyBoxItem( const Color& rLineColor,
1451 : MSO_LineStyle eLineStyle, MSO_LineDashing eDashing, MSO_SPT eShapeType, sal_Int32 &rLineWidth,
1452 : SvxBoxItem& rBox );
1453 : void MatchSdrItemsIntoFlySet( SdrObject* pSdrObj, SfxItemSet &aFlySet,
1454 : MSO_LineStyle eLineStyle, MSO_LineDashing eDashing, MSO_SPT eShapeType, Rectangle &rInnerDist );
1455 : void AdjustLRWrapForWordMargins(const SvxMSDffImportRec &rRecord,
1456 : SvxLRSpaceItem &rLR);
1457 : void AdjustULWrapForWordMargins(const SvxMSDffImportRec &rRecord,
1458 : SvxULSpaceItem &rUL);
1459 : void MapWrapIntoFlyFmt(SvxMSDffImportRec* pRecord, SwFrmFmt* pFlyFmt);
1460 :
1461 : void SetAttributesAtGrfNode(SvxMSDffImportRec const* pRecord,
1462 : SwFrmFmt *pFlyFmt, WW8_FSPA *pF);
1463 :
1464 : bool IsDropCap();
1465 5220 : bool IsListOrDropcap() { return (!pAktItemSet || bDropCap); };
1466 :
1467 : WW8FlyPara *ConstructApo(const ApoTestResults &rApo,
1468 : const WW8_TablePos *pTabPos);
1469 : bool StartApo(const ApoTestResults &rApo, const WW8_TablePos *pTabPos);
1470 : void StopApo();
1471 : bool TestSameApo(const ApoTestResults &rApo, const WW8_TablePos *pTabPos);
1472 : ApoTestResults TestApo(int nCellLevel, bool bTableRowEnd,
1473 : const WW8_TablePos *pTabPos);
1474 :
1475 : void EndSpecial();
1476 : bool ProcessSpecial(bool &rbReSync, WW8_CP nStartCp);
1477 : sal_uInt16 TabRowSprm(int nLevel) const;
1478 :
1479 : bool ReadGrafFile(OUString& rFileName, Graphic*& rpGraphic,
1480 : const WW8_PIC& rPic, SvStream* pSt, sal_uLong nFilePos, bool* pDelIt);
1481 :
1482 : void ReplaceObj(const SdrObject &rReplaceTextObj,
1483 : SdrObject &rSubObj);
1484 :
1485 : SwFlyFrmFmt* MakeGrafNotInCntnt(const WW8PicDesc& rPD,
1486 : const Graphic* pGraph, const OUString& rFileName,
1487 : const SfxItemSet& rGrfSet);
1488 :
1489 : SwFrmFmt* MakeGrafInCntnt(const WW8_PIC& rPic, const WW8PicDesc& rPD,
1490 : const Graphic* pGraph, const OUString& rFileName,
1491 : const SfxItemSet& rGrfSet);
1492 :
1493 : SwFrmFmt *AddAutoAnchor(SwFrmFmt *pFmt);
1494 : SwFrmFmt* ImportGraf1(WW8_PIC& rPic, SvStream* pSt, sal_uLong nFilePos);
1495 : SwFrmFmt* ImportGraf(SdrTextObj* pTextObj = 0, SwFrmFmt* pFlyFmt = 0);
1496 :
1497 : SdrObject* ImportOleBase( Graphic& rGraph, const Graphic* pGrf=0,
1498 : const SfxItemSet* pFlySet=0, const Rectangle& aVisArea = Rectangle() );
1499 :
1500 : SwFrmFmt* ImportOle( const Graphic* = 0, const SfxItemSet* pFlySet = 0,
1501 : const SfxItemSet* pGrfSet = 0, const Rectangle& aVisArea = Rectangle() );
1502 : SwFlyFrmFmt* InsertOle(SdrOle2Obj &rObject, const SfxItemSet &rFlySet,
1503 : const SfxItemSet &rGrfSet);
1504 :
1505 : bool ImportFormulaControl(WW8FormulaControl &rBox,WW8_CP nStart,
1506 : SwWw8ControlType nWhich);
1507 :
1508 : void ImportDop();
1509 :
1510 : //This converts MS Asian Typography information into OOo's
1511 : void ImportDopTypography(const WW8DopTypography &rTypo);
1512 :
1513 : sal_uLong LoadThroughDecryption(SwPaM& rPaM ,WW8Glossary *pGloss);
1514 : sal_uLong SetSubStreams(SvStorageStreamRef &rTableStream, SvStorageStreamRef &rDataStream);
1515 : sal_uLong CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos);
1516 :
1517 : void ReadDocVars();
1518 :
1519 : bool StartTable(WW8_CP nStartCp);
1520 : bool InEqualApo(int nLvl) const;
1521 239 : bool InLocalApo() const { return InEqualApo(nInTable); }
1522 : bool InEqualOrHigherApo(int nLvl) const;
1523 17 : bool InAnyApo() const { return InEqualOrHigherApo(1); }
1524 : void TabCellEnd();
1525 : void StopTable();
1526 : short GetTableLeft();
1527 : bool IsInvalidOrToBeMergedTabCell() const;
1528 :
1529 : // Nummerierungen / Aufzaehlungen ( Autonumbered List Data Descriptor )
1530 : // Liste: ANLD ( Autonumbered List Data Descriptor )
1531 : // eine Ebene: ANLV ( Autonumber Level Descriptor )
1532 :
1533 : // Chg7-8:
1534 : // Listen sind in WW8 eigene Strukturen, die ueber folgende drei Tabellen
1535 : // verwaltet werden: rglst, hpllfo und hsttbListNames
1536 : // die Strukturen hierfuer sind: LSTF, LVLF, LFO LFOLVL
1537 :
1538 : void SetAnlvStrings(SwNumFmt &rNum, WW8_ANLV &rAV, const sal_uInt8* pTxt,
1539 : bool bOutline);
1540 : void SetAnld(SwNumRule* pNumR, WW8_ANLD* pAD, sal_uInt8 nSwLevel, bool bOutLine);
1541 : void SetNumOlst( SwNumRule* pNumR, WW8_OLST* pO, sal_uInt8 nSwLevel );
1542 : SwNumRule* GetStyRule();
1543 :
1544 : void StartAnl(const sal_uInt8* pSprm13);
1545 : void NextAnlLine(const sal_uInt8* pSprm13);
1546 : void StopAllAnl(bool bGoBack = true);
1547 : void StopAnlToRestart(sal_uInt8 nType, bool bGoBack = true);
1548 :
1549 : // GrafikLayer
1550 :
1551 : bool ReadGrafStart(void* pData, short nDataSiz, WW8_DPHEAD* pHd,
1552 : const WW8_DO* pDo, SfxAllItemSet &rSet);
1553 : SdrObject *ReadLine(WW8_DPHEAD* pHd, const WW8_DO* pDo,
1554 : SfxAllItemSet &rSet);
1555 : SdrObject *ReadRect(WW8_DPHEAD* pHd, const WW8_DO* pDo,
1556 : SfxAllItemSet &rSet);
1557 : SdrObject *ReadElipse(WW8_DPHEAD* pHd, const WW8_DO* pDo,
1558 : SfxAllItemSet &rSet);
1559 : SdrObject *ReadArc(WW8_DPHEAD* pHd, const WW8_DO* pDo,
1560 : SfxAllItemSet &rSet);
1561 : SdrObject *ReadPolyLine(WW8_DPHEAD* pHd, const WW8_DO* pDo,
1562 : SfxAllItemSet &rSet);
1563 : ESelection GetESelection( long nCpStart, long nCpEnd );
1564 : void InsertTxbxStyAttrs( SfxItemSet& rS, sal_uInt16 nColl );
1565 : void InsertAttrsAsDrawingAttrs(long nStartCp, long nEndCp, ManTypes eType, bool bONLYnPicLocFc=false);
1566 :
1567 : bool GetTxbxTextSttEndCp(WW8_CP& rStartCp, WW8_CP& rEndCp, sal_uInt16 nTxBxS,
1568 : sal_uInt16 nSequence);
1569 : bool GetRangeAsDrawingString(OUString& rString, long StartCp, long nEndCp, ManTypes eType);
1570 : OutlinerParaObject* ImportAsOutliner(OUString &rString, WW8_CP nStartCp, WW8_CP nEndCp, ManTypes eType);
1571 : SwFrmFmt* InsertTxbxText(SdrTextObj* pTextObj, Size* pObjSiz,
1572 : sal_uInt16 nTxBxS, sal_uInt16 nSequence, long nPosCp, SwFrmFmt* pFlyFmt,
1573 : bool bMakeSdrGrafObj, bool& rbEraseTextObj,
1574 : bool* pbTestTxbxContainsText = 0, long* pnStartCp = 0,
1575 : long* pnEndCp = 0, bool* pbContainsGraphics = 0,
1576 : SvxMSDffImportRec* pRecord = 0);
1577 : bool TxbxChainContainsRealText( sal_uInt16 nTxBxS,
1578 : long& rStartCp,
1579 : long& rEndCp );
1580 : SdrObject *ReadTxtBox(WW8_DPHEAD* pHd, const WW8_DO* pDo,
1581 : SfxAllItemSet &rSet);
1582 : SdrObject *ReadCaptionBox(WW8_DPHEAD* pHd, const WW8_DO* pDo,
1583 : SfxAllItemSet &rSet);
1584 : SdrObject *ReadGroup(WW8_DPHEAD* pHd, const WW8_DO* pDo,
1585 : SfxAllItemSet &rSet);
1586 : SdrObject *ReadGrafPrimitive(short& rLeft, const WW8_DO* pDo,
1587 : SfxAllItemSet &rSet);
1588 : void ReadGrafLayer1( WW8PLCFspecial* pPF, long nGrafAnchorCp );
1589 : SdrObject* CreateContactObject(SwFrmFmt* pFlyFmt);
1590 : RndStdIds ProcessEscherAlign(SvxMSDffImportRec* pRecord, WW8_FSPA *pFSPA,
1591 : SfxItemSet &rFlySet, bool bOrgObjectWasReplace);
1592 : bool MiserableRTLGraphicsHack(SwTwips &rLeft, SwTwips nWidth,
1593 : sal_Int16 eHoriOri, sal_Int16 eHoriRel);
1594 : SwFrmFmt* Read_GrafLayer( long nGrafAnchorCp );
1595 : SwFlyFrmFmt* ImportReplaceableDrawables( SdrObject* &rpObject,
1596 : SdrObject* &rpOurNewObject, SvxMSDffImportRec* pRecord, WW8_FSPA *pF,
1597 : SfxItemSet &rFlySet );
1598 : SwFlyFrmFmt *ConvertDrawTextToFly( SdrObject* &rpObject,
1599 : SdrObject* &rpOurNewObject, SvxMSDffImportRec* pRecord,
1600 : RndStdIds eAnchor, WW8_FSPA *pF, SfxItemSet &rFlySet );
1601 : SwFrmFmt* MungeTextIntoDrawBox(SdrObject* pTrueObject,
1602 : SvxMSDffImportRec *pRecord, long nGrafAnchorCp, SwFrmFmt *pRetFrmFmt);
1603 :
1604 : void GrafikCtor();
1605 : void GrafikDtor();
1606 :
1607 : // anderes
1608 : OUString GetFieldResult( WW8FieldDesc* pF );
1609 : void MakeTagString( OUString& rStr, const OUString& rOrg );
1610 : void UpdateFields();
1611 : OUString ConvertFFileName(const OUString& rRaw);
1612 : long Read_F_Tag( WW8FieldDesc* pF );
1613 : void InsertTagField( const sal_uInt16 nId, const OUString& rTagText );
1614 : long ImportExtSprm(WW8PLCFManResult* pRes);
1615 : void EndExtSprm(sal_uInt16 nSprmId);
1616 : void ReadDocInfo();
1617 :
1618 : // Ver8-Listen
1619 :
1620 : void RegisterNumFmtOnTxtNode(sal_uInt16 nActLFO, sal_uInt8 nActLevel,
1621 : bool bSetAttr = true);
1622 : void RegisterNumFmtOnStyle(sal_uInt16 nStyle);
1623 : void SetStylesList(sal_uInt16 nStyle, sal_uInt16 nActLFO,
1624 : sal_uInt8 nActLevel);
1625 : void RegisterNumFmt(sal_uInt16 nActLFO, sal_uInt8 nActLevel);
1626 :
1627 : // spaeter zu ersetzen durch Aufruf in entsprechend erweiterten SvxMSDffManager
1628 :
1629 : const OUString* GetAnnotationAuthor(sal_uInt16 nIdx);
1630 : int GetAnnotationIndex(sal_uInt32 nTag);
1631 : /// Return the end index based on the start one.
1632 : sal_uInt16 GetAnnotationEndIndex(sal_uInt16 nStart);
1633 : WW8_CP GetAnnotationStart(int nIndex);
1634 : WW8_CP GetAnnotationEnd(int nIndex);
1635 :
1636 : // Schnittstellen fuer die Toggle-Attribute
1637 : void SetToggleAttr(sal_uInt8 nAttrId, bool bOn);
1638 : void SetToggleBiDiAttr(sal_uInt8 nAttrId, bool bOn);
1639 : void _ChkToggleAttr( sal_uInt16 nOldStyle81Mask, sal_uInt16 nNewStyle81Mask );
1640 :
1641 5989 : void ChkToggleAttr( sal_uInt16 nOldStyle81Mask, sal_uInt16 nNewStyle81Mask )
1642 : {
1643 6302 : if( nOldStyle81Mask != nNewStyle81Mask &&
1644 313 : pCtrlStck->GetToggleAttrFlags() )
1645 0 : _ChkToggleAttr( nOldStyle81Mask, nNewStyle81Mask );
1646 5989 : }
1647 :
1648 : void _ChkToggleBiDiAttr( sal_uInt16 nOldStyle81Mask, sal_uInt16 nNewStyle81Mask );
1649 :
1650 5989 : void ChkToggleBiDiAttr( sal_uInt16 nOldStyle81Mask, sal_uInt16 nNewStyle81Mask )
1651 : {
1652 6026 : if( nOldStyle81Mask != nNewStyle81Mask &&
1653 37 : pCtrlStck->GetToggleBiDiAttrFlags() )
1654 0 : _ChkToggleBiDiAttr( nOldStyle81Mask, nNewStyle81Mask );
1655 5989 : }
1656 :
1657 : void PopTableDesc();
1658 : void MoveInsideFly(const SwFrmFmt *pFlyFmt);
1659 : SwTwips MoveOutsideFly(SwFrmFmt *pFlyFmt, const SwPosition &rPos,
1660 : bool bTableJoin = true);
1661 :
1662 : void SetOutLineStyles();
1663 :
1664 : bool SetSpacing(SwPaM &rMyPam, int nSpace, bool bIsUpper);
1665 : bool SetUpperSpacing(SwPaM &pMyPam, int nSpace);
1666 : bool SetLowerSpacing(SwPaM &rMyPam, int nSpace);
1667 :
1668 253 : bool IsInlineEscherHack() const
1669 253 : {return !maFieldStack.empty() ? maFieldStack.back().mnFieldId == 95 : false; };
1670 :
1671 : void StoreMacroCmds();
1672 :
1673 : // #i84783#
1674 : // determine object attribute "Layout in Table Cell"
1675 : bool IsObjectLayoutInTableCell( const sal_uInt32 nLayoutInTableCell ) const;
1676 : bool ReadGlobalTemplateSettings( const OUString& sCreatedFrom, const com::sun::star::uno::Reference< com::sun::star::container::XNameContainer >& xPrjNameMap );
1677 : //No copying
1678 : SwWW8ImplReader(const SwWW8ImplReader &);
1679 : SwWW8ImplReader& operator=(const SwWW8ImplReader&);
1680 : public: // eigentlich private, geht aber leider nur public
1681 : sal_uInt16 GetToggleAttrFlags() const;
1682 : sal_uInt16 GetToggleBiDiAttrFlags() const;
1683 : void SetToggleAttrFlags(sal_uInt16 nFlags);
1684 : void SetToggleBiDiAttrFlags(sal_uInt16 nFlags);
1685 47178 : WW8_CP GetCurrAttrCP() const {return maCurrAttrCP;}
1686 : bool IsParaEndInCPs(sal_Int32 , sal_Int32,bool bSdOD=true) const;
1687 : //Clear the para end position recorded in reader intermittently for the least impact on loading performance
1688 : void ClearParaEndPosition();
1689 :
1690 : long Read_Ftn(WW8PLCFManResult* pRes);
1691 : sal_uInt16 End_Ftn();
1692 : long Read_Field(WW8PLCFManResult* pRes);
1693 : sal_uInt16 End_Field();
1694 : long Read_Book(WW8PLCFManResult*);
1695 : long Read_And(WW8PLCFManResult* pRes);
1696 :
1697 : // Attribute
1698 :
1699 : void Read_Special(sal_uInt16, const sal_uInt8*, short nLen);
1700 : void Read_Obj(sal_uInt16, const sal_uInt8*, short nLen);
1701 : void Read_PicLoc(sal_uInt16, const sal_uInt8* pData, short nLen );
1702 : void Read_BoldUsw(sal_uInt16 nId, const sal_uInt8*, short nLen);
1703 : void Read_Bidi(sal_uInt16 nId, const sal_uInt8*, short nLen);
1704 : void Read_BoldBiDiUsw(sal_uInt16 nId, const sal_uInt8*, short nLen);
1705 : void Read_SubSuper( sal_uInt16, const sal_uInt8*, short nLen );
1706 : bool ConvertSubToGraphicPlacement();
1707 : SwFrmFmt *ContainsSingleInlineGraphic(const SwPaM &rRegion);
1708 : void Read_SubSuperProp( sal_uInt16, const sal_uInt8*, short nLen );
1709 : void Read_Underline( sal_uInt16, const sal_uInt8*, short nLen );
1710 : void Read_TxtColor( sal_uInt16, const sal_uInt8*, short nLen );
1711 : void openFont(sal_uInt16 nFCode, sal_uInt16 nId);
1712 : void closeFont(sal_uInt16 nId);
1713 : void Read_FontCode( sal_uInt16, const sal_uInt8*, short nLen );
1714 : void Read_FontSize( sal_uInt16, const sal_uInt8*, short nLen );
1715 : void Read_CharSet(sal_uInt16 , const sal_uInt8* pData, short nLen);
1716 : void Read_Language( sal_uInt16, const sal_uInt8*, short nLen );
1717 : void Read_CColl( sal_uInt16, const sal_uInt8*, short nLen );
1718 : void Read_Kern( sal_uInt16, const sal_uInt8* pData, short nLen );
1719 : void Read_FontKern( sal_uInt16, const sal_uInt8* pData, short nLen );
1720 : void Read_Emphasis( sal_uInt16, const sal_uInt8* pData, short nLen );
1721 : void Read_ScaleWidth( sal_uInt16, const sal_uInt8* pData, short nLen );
1722 : void Read_Relief( sal_uInt16, const sal_uInt8* pData, short nLen);
1723 : void Read_TxtAnim( sal_uInt16, const sal_uInt8* pData, short nLen);
1724 :
1725 : void Read_NoLineNumb( sal_uInt16 nId, const sal_uInt8* pData, short nLen );
1726 :
1727 : void Read_LR( sal_uInt16 nId, const sal_uInt8*, short nLen );
1728 : void Read_UL( sal_uInt16 nId, const sal_uInt8*, short nLen );
1729 : void Read_ParaAutoBefore(sal_uInt16 , const sal_uInt8 *pData, short nLen);
1730 : void Read_ParaAutoAfter(sal_uInt16 , const sal_uInt8 *pData, short nLen);
1731 : void Read_ParaContextualSpacing( sal_uInt16 nId, const sal_uInt8* pData, short nLen );
1732 : void Read_LineSpace( sal_uInt16, const sal_uInt8*, short nLen );
1733 : void Read_Justify(sal_uInt16, const sal_uInt8*, short nLen);
1734 : void Read_IdctHint(sal_uInt16, const sal_uInt8*, short nLen);
1735 : bool IsRightToLeft();
1736 : void Read_RTLJustify(sal_uInt16, const sal_uInt8*, short nLen);
1737 : void Read_Hyphenation( sal_uInt16, const sal_uInt8* pData, short nLen );
1738 : void Read_WidowControl( sal_uInt16, const sal_uInt8* pData, short nLen );
1739 : void Read_AlignFont( sal_uInt16, const sal_uInt8* pData, short nLen );
1740 : void Read_UsePgsuSettings( sal_uInt16, const sal_uInt8* pData, short nLen );
1741 : void Read_KeepLines( sal_uInt16, const sal_uInt8* pData, short nLen );
1742 : void Read_KeepParas( sal_uInt16, const sal_uInt8* pData, short nLen );
1743 : void Read_BreakBefore( sal_uInt16, const sal_uInt8* pData, short nLen );
1744 : void Read_Apo(sal_uInt16 nId, const sal_uInt8* pData, short nLen);
1745 : void Read_ApoPPC(sal_uInt16, const sal_uInt8* pData, short);
1746 :
1747 : void Read_BoolItem( sal_uInt16 nId, const sal_uInt8*, short nLen );
1748 :
1749 : void Read_Border( sal_uInt16 nId, const sal_uInt8* pData, short nLen );
1750 : void Read_CharBorder(sal_uInt16 nId, const sal_uInt8* pData, short nLen );
1751 : void Read_Tab( sal_uInt16 nId, const sal_uInt8* pData, short nLen );
1752 : void Read_Symbol(sal_uInt16, const sal_uInt8* pData, short nLen);
1753 : void Read_FldVanish( sal_uInt16 nId, const sal_uInt8* pData, short nLen );
1754 :
1755 : // Revision Marks ( == Redlining )
1756 :
1757 : // insert or delete content (change char attributes resp.)
1758 : void Read_CRevisionMark(RedlineType_t eType, const sal_uInt8* pData, short nLen);
1759 : // insert new content
1760 : void Read_CFRMark(sal_uInt16 , const sal_uInt8* pData, short nLen);
1761 : // delete old content
1762 : void Read_CFRMarkDel(sal_uInt16 , const sal_uInt8* pData, short nLen);
1763 : // change properties of content (e.g. char formatting)
1764 : void Read_CPropRMark(sal_uInt16 , const sal_uInt8* pData, short nLen); // complex!
1765 :
1766 : void Read_TabRowEnd( sal_uInt16, const sal_uInt8* pData, short nLen );
1767 : void Read_TabCellEnd( sal_uInt16, const sal_uInt8* pData, short nLen );
1768 : bool ParseTabPos(WW8_TablePos *aTabPos, WW8PLCFx_Cp_FKP* pPap);
1769 : void Read_Shade( sal_uInt16, const sal_uInt8* pData, short nLen );
1770 : void Read_ANLevelNo( sal_uInt16, const sal_uInt8* pData, short nLen );
1771 : void Read_ANLevelDesc( sal_uInt16, const sal_uInt8* pData, short nLen );
1772 :
1773 : // Gliederungsebene Ver8
1774 : void Read_POutLvl(sal_uInt16, const sal_uInt8* pData, short nLen);
1775 :
1776 : void Read_OLST( sal_uInt16, const sal_uInt8* pData, short nLen );
1777 :
1778 : void Read_CharShadow( sal_uInt16, const sal_uInt8* pData, short nLen );
1779 : void Read_CharHighlight( sal_uInt16, const sal_uInt8* pData, short nLen );
1780 : // Ver8-Listen
1781 :
1782 : void Read_ListLevel( sal_uInt16 nId, const sal_uInt8* pData, short nLen);
1783 :
1784 : /**
1785 : * read and interpret the sprmPIlfo used to determine which list
1786 : * contains the paragraph.
1787 : * @param nId unused (sprm value, 0x460b for sprmPIlfo).
1788 : * @param[in] pData operand.
1789 : * @param[in] nLen size of the operand (pData) in byte, should be 2.
1790 : * -1 to indicate the actual level is finished.
1791 : */
1792 : void Read_LFOPosition( sal_uInt16 nId, const sal_uInt8* pData, short nLen);
1793 : bool SetTxtFmtCollAndListLevel(const SwPaM& rRg, SwWW8StyInf& rStyleInfo);
1794 :
1795 : void Read_StyleCode(sal_uInt16, const sal_uInt8* pData, short nLen);
1796 : void Read_Majority(sal_uInt16, const sal_uInt8* , short );
1797 : void Read_DoubleLine_Rotate( sal_uInt16, const sal_uInt8* pDATA, short nLen);
1798 :
1799 : void Read_TxtForeColor(sal_uInt16, const sal_uInt8* pData, short nLen);
1800 : void Read_TxtBackColor(sal_uInt16, const sal_uInt8* pData, short nLen);
1801 : void Read_ParaBackColor(sal_uInt16, const sal_uInt8* pData, short nLen);
1802 : void Read_ParaBiDi(sal_uInt16, const sal_uInt8* pData, short nLen);
1803 : static sal_uInt32 ExtractColour(const sal_uInt8* &rpData, bool bVer67);
1804 :
1805 : void Read_UnderlineColor(sal_uInt16, const sal_uInt8* pData, short nLen);
1806 : long MapBookmarkVariables(const WW8FieldDesc* pF, OUString &rOrigName,
1807 : const OUString &rData);
1808 : OUString GetMappedBookmark(const OUString &rOrigName);
1809 :
1810 : // Felder
1811 : eF_ResT Read_F_Input(WW8FieldDesc*, OUString& rStr);
1812 : eF_ResT Read_F_InputVar(WW8FieldDesc*, OUString& rStr);
1813 : eF_ResT Read_F_ANumber( WW8FieldDesc*, OUString& );
1814 : eF_ResT Read_F_DocInfo( WW8FieldDesc* pF, OUString& rStr );
1815 : eF_ResT Read_F_Author( WW8FieldDesc*, OUString& );
1816 : eF_ResT Read_F_TemplName( WW8FieldDesc*, OUString& );
1817 : short GetTimeDatePara(OUString& rStr, sal_uInt32& rFormat, sal_uInt16 &rLang,
1818 : int nWhichDefault, bool bHijri = false);
1819 : bool ForceFieldLanguage(SwField &rFld, sal_uInt16 nLang);
1820 : eF_ResT Read_F_DateTime( WW8FieldDesc*, OUString& rStr );
1821 : eF_ResT Read_F_FileName( WW8FieldDesc*, OUString& rStr);
1822 : eF_ResT Read_F_Anz( WW8FieldDesc* pF, OUString& );
1823 : eF_ResT Read_F_CurPage( WW8FieldDesc*, OUString& );
1824 : eF_ResT Read_F_Ref( WW8FieldDesc* pF, OUString& );
1825 :
1826 : eF_ResT Read_F_Set( WW8FieldDesc*, OUString& rStr );
1827 : eF_ResT Read_F_PgRef( WW8FieldDesc*, OUString& rStr );
1828 : eF_ResT Read_F_NoteReference( WW8FieldDesc* pF, OUString& rStr );
1829 :
1830 : eF_ResT Read_F_Tox( WW8FieldDesc* pF, OUString& rStr );
1831 : bool AddExtraOutlinesAsExtraStyles(SwTOXBase& rBase);
1832 : eF_ResT Read_F_Symbol( WW8FieldDesc*, OUString& rStr );
1833 : eF_ResT Read_F_Embedd( WW8FieldDesc*, OUString& rStr );
1834 : eF_ResT Read_F_FormTextBox( WW8FieldDesc* pF, OUString& rStr);
1835 : eF_ResT Read_F_FormCheckBox( WW8FieldDesc* pF, OUString& rStr );
1836 : eF_ResT Read_F_FormListBox( WW8FieldDesc* pF, OUString& rStr);
1837 : com::sun::star::awt::Size MiserableDropDownFormHack(const OUString &rString,
1838 : com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>&
1839 : rPropSet);
1840 :
1841 : eF_ResT Read_F_Macro( WW8FieldDesc*, OUString& rStr);
1842 : eF_ResT Read_F_DBField( WW8FieldDesc*, OUString& rStr );
1843 : eF_ResT Read_F_DBNext( WW8FieldDesc*, OUString& );
1844 : eF_ResT Read_F_DBNum( WW8FieldDesc*, OUString& );
1845 : eF_ResT Read_F_Equation( WW8FieldDesc*, OUString& );
1846 : void Read_SubF_Ruby( WW8ReadFieldParams& rReadParam);
1847 : eF_ResT Read_F_IncludePicture( WW8FieldDesc*, OUString& rStr );
1848 : eF_ResT Read_F_IncludeText( WW8FieldDesc*, OUString& rStr );
1849 : eF_ResT Read_F_Seq( WW8FieldDesc*, OUString& rStr );
1850 :
1851 : eF_ResT Read_F_OCX(WW8FieldDesc*, OUString&);
1852 : eF_ResT Read_F_Hyperlink(WW8FieldDesc*, OUString& rStr);
1853 : eF_ResT Read_F_Shape(WW8FieldDesc* pF, OUString& rStr);
1854 : eF_ResT Read_F_HTMLControl( WW8FieldDesc* pF, OUString& rStr);
1855 :
1856 : void DeleteFormImpl();
1857 :
1858 : short ImportSprm( const sal_uInt8* pPos, sal_uInt16 nId = 0 );
1859 :
1860 : bool SearchRowEnd(WW8PLCFx_Cp_FKP* pPap,WW8_CP &rStartCp, int nLevel) const;
1861 :
1862 9893 : const WW8Fib& GetFib() const { return *pWwFib; }
1863 73 : SwDoc& GetDoc() const { return rDoc; }
1864 1669 : sal_uInt16 GetNAktColl() const { return nAktColl; }
1865 5122 : void SetNAktColl( sal_uInt16 nColl ) { nAktColl = nColl; }
1866 3338 : void SetAktItemSet( SfxItemSet* pItemSet ) { pAktItemSet = pItemSet; }
1867 : sal_uInt16 StyleUsingLFO( sal_uInt16 nLFOIndex ) const ;
1868 : const SwFmt* GetStyleWithOrgWWName( OUString& rName ) const ;
1869 :
1870 : static bool GetPictGrafFromStream(Graphic& rGraphic, SvStream& rSrc);
1871 : static void PicRead( SvStream *pDataStream, WW8_PIC *pPic, bool bVer67);
1872 : static bool ImportOleWMF( SvStorageRef xSrc1, GDIMetaFile &rWMF,
1873 : long &rX, long &rY);
1874 : static ColorData GetCol(sal_uInt8 nIco);
1875 :
1876 : SwWW8ImplReader( sal_uInt8 nVersionPara, SvStorage* pStorage, SvStream* pSt,
1877 : SwDoc& rD, const OUString& rBaseURL, bool bNewDoc );
1878 :
1879 40 : const OUString& GetBaseURL() const { return sBaseURL; }
1880 : // Laden eines kompletten DocFiles
1881 : sal_uLong LoadDoc( SwPaM&,WW8Glossary *pGloss=0);
1882 : rtl_TextEncoding GetCurrentCharSet();
1883 : rtl_TextEncoding GetCurrentCJKCharSet();
1884 :
1885 : void PostProcessAttrs();
1886 : static void ReadEmbeddedData(SvMemoryStream& rStrm, SwDocShell* pDocShell, struct HyperLinksTable& hlStr);
1887 : static OUString ReadRawUniString(SvMemoryStream& rStrm, sal_uInt16 nChars, bool b16Bit);
1888 : };
1889 :
1890 : bool CanUseRemoteLink(const OUString &rGrfName);
1891 : void UseListIndent(SwWW8StyInf &rStyle, const SwNumFmt &rFmt);
1892 : void SetStyleIndent(SwWW8StyInf &rStyleInfo, const SwNumFmt &rFmt);
1893 : // #i103711#
1894 : // #i105414#
1895 : void SyncIndentWithList( SvxLRSpaceItem &rLR,
1896 : const SwNumFmt &rFmt,
1897 : const bool bFirstLineOfStSet,
1898 : const bool bLeftIndentSet );
1899 : long GetListFirstLineIndent(const SwNumFmt &rFmt);
1900 : OUString BookmarkToWriter(const OUString &rBookmark);
1901 : bool RTLGraphicsHack(SwTwips &rLeft, SwTwips nWidth,
1902 : sal_Int16 eHoriOri, sal_Int16 eHoriRel, SwTwips nPageLeft,
1903 : SwTwips nPageRight, SwTwips nPageSize);
1904 : void MatchEscherMirrorIntoFlySet(const SvxMSDffImportRec &rRecord,
1905 : SfxItemSet &rFlySet);
1906 : bool RTLDrawingsHack(long &rLeft, long nWidth,
1907 : sal_Int16 eHoriOri, sal_Int16 eHoriRel, SwTwips nPageLeft,
1908 : SwTwips nPageRight, SwTwips nPageSize);
1909 : #endif
1910 :
1911 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|