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