Update ooo320-m1
[ooovba.git] / applied_patches / 0302-cws-ooo11lotusfilter-lwp-xfilter.diff
blobeb662de0ab5e8f740f0ea992df80b81111042240
1 diff -urNp lotuswordpro.bak/source/filter/xfilter/ixfattrlist.hxx lotuswordpro/source/filter/xfilter/ixfattrlist.hxx
2 --- lotuswordpro.bak/source/filter/xfilter/ixfattrlist.hxx 1970-01-01 08:00:00.000000000 +0800
3 +++ lotuswordpro/source/filter/xfilter/ixfattrlist.hxx 2008-10-22 11:42:34.000000000 +0800
4 @@ -0,0 +1,90 @@
5 +/*************************************************************************
6 + *
7 + * The Contents of this file are made available subject to the terms of
8 + * either of the following licenses
9 + *
10 + * - GNU Lesser General Public License Version 2.1
11 + * - Sun Industry Standards Source License Version 1.1
12 + *
13 + * Sun Microsystems Inc., October, 2000
14 + *
15 + * GNU Lesser General Public License Version 2.1
16 + * =============================================
17 + * Copyright 2000 by Sun Microsystems, Inc.
18 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
19 + *
20 + * This library is free software; you can redistribute it and/or
21 + * modify it under the terms of the GNU Lesser General Public
22 + * License version 2.1, as published by the Free Software Foundation.
23 + *
24 + * This library is distributed in the hope that it will be useful,
25 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27 + * Lesser General Public License for more details.
28 + *
29 + * You should have received a copy of the GNU Lesser General Public
30 + * License along with this library; if not, write to the Free Software
31 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
32 + * MA 02111-1307 USA
33 + *
34 + *
35 + * Sun Industry Standards Source License Version 1.1
36 + * =================================================
37 + * The contents of this file are subject to the Sun Industry Standards
38 + * Source License Version 1.1 (the "License"); You may not use this file
39 + * except in compliance with the License. You may obtain a copy of the
40 + * License at http://www.openoffice.org/license.html.
41 + *
42 + * Software provided under this License is provided on an "AS IS" basis,
43 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
44 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
45 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
46 + * See the License for the specific provisions governing your rights and
47 + * obligations concerning the Software.
48 + *
49 + * The Initial Developer of the Original Code is: IBM Corporation
50 + *
51 + * Copyright: 2008 by IBM Corporation
52 + *
53 + * All Rights Reserved.
54 + *
55 + * Contributor(s): _______________________________________
56 + *
57 + *
58 + ************************************************************************/
59 +/*************************************************************************
60 + * @file
61 + * Interface for the attibute list of a xml element.
62 + ************************************************************************/
63 +/*************************************************************************
64 + * Change History
65 + * 2004-12-23 create this file.
66 + ************************************************************************/
67 +#ifndef _IXFATTRLIST_HXX
68 +#define _IXFATTRLIST_HXX
70 +#include <rtl/ustring.hxx>
72 +/**
73 + * @brief
74 + * Attribute list interface for sax writer.
75 + * Implemente this interface for different sax writer. For OOo,i use the XDocumentHandler stream;
76 + * for ouputting the local file system,It's just a vector container.
77 + */
78 +class IXFAttrList
80 +public:
81 + virtual ~IXFAttrList(){}
82 + /**
83 + * @descr: Add a attribute to the attribute list.
84 + */
85 + virtual void AddAttribute(const rtl::OUString& name, const rtl::OUString& value) = 0;
87 + /**
88 + * @descr: Clear all the attributes in the attribute list.
89 + */
90 + virtual void Clear() = 0;
91 +};
93 +#endif //_IXFATTRLIST_HXX
95 diff -urNp lotuswordpro.bak/source/filter/xfilter/ixfcontent.hxx lotuswordpro/source/filter/xfilter/ixfcontent.hxx
96 --- lotuswordpro.bak/source/filter/xfilter/ixfcontent.hxx 1970-01-01 08:00:00.000000000 +0800
97 +++ lotuswordpro/source/filter/xfilter/ixfcontent.hxx 2008-10-22 11:42:34.000000000 +0800
98 @@ -0,0 +1,102 @@
99 +/*************************************************************************
101 + * The Contents of this file are made available subject to the terms of
102 + * either of the following licenses
104 + * - GNU Lesser General Public License Version 2.1
105 + * - Sun Industry Standards Source License Version 1.1
107 + * Sun Microsystems Inc., October, 2000
109 + * GNU Lesser General Public License Version 2.1
110 + * =============================================
111 + * Copyright 2000 by Sun Microsystems, Inc.
112 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
114 + * This library is free software; you can redistribute it and/or
115 + * modify it under the terms of the GNU Lesser General Public
116 + * License version 2.1, as published by the Free Software Foundation.
118 + * This library is distributed in the hope that it will be useful,
119 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
120 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
121 + * Lesser General Public License for more details.
123 + * You should have received a copy of the GNU Lesser General Public
124 + * License along with this library; if not, write to the Free Software
125 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
126 + * MA 02111-1307 USA
129 + * Sun Industry Standards Source License Version 1.1
130 + * =================================================
131 + * The contents of this file are subject to the Sun Industry Standards
132 + * Source License Version 1.1 (the "License"); You may not use this file
133 + * except in compliance with the License. You may obtain a copy of the
134 + * License at http://www.openoffice.org/license.html.
136 + * Software provided under this License is provided on an "AS IS" basis,
137 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
138 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
139 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
140 + * See the License for the specific provisions governing your rights and
141 + * obligations concerning the Software.
143 + * The Initial Developer of the Original Code is: IBM Corporation
145 + * Copyright: 2008 by IBM Corporation
147 + * All Rights Reserved.
149 + * Contributor(s): _______________________________________
152 + ************************************************************************/
153 +/*************************************************************************
154 + * @file
155 + * Interface for the all content object,ie. text,paragraph,picture,and so on.
156 + ************************************************************************/
157 +/*************************************************************************
158 + * Change History
159 + * 2004-12-23 create this file.
160 + * 2005-04-08 add clone function.
161 + ************************************************************************/
162 +#ifndef _IXFCONTENT_HXX
163 +#define _IXFCONTENT_HXX
165 +#include "xfglobal.hxx"
167 +class IXFStyle;
169 +/**
170 + * @brief Base interface for all content object.Implementation classes include text span,paragraph,
171 + Drawing obejcts, image, ole and so on.
172 + */
173 +class IXFContent : public IXFObject
175 +public:
176 + virtual ~IXFContent(){}
177 + /**
178 + * @descr Fetch the content type,not quite useful.
179 + */
180 + virtual enumXFContent GetContentType() = 0;
182 + /**
183 + * @descr Set style to apply. You can get the style name by use XFStyleManager::AddStyle(pStyle),
184 + * or just set a fixed style name.
185 + */
186 + virtual void SetStyleName(rtl::OUString style) = 0;
188 + /**
189 + * @descr return the style name.
190 + */
191 + virtual rtl::OUString GetStyleName() = 0;
193 + /**
194 + * @descr Deep copy.
195 + */
196 + virtual IXFContent* Clone() = 0;
199 +#endif
201 diff -urNp lotuswordpro.bak/source/filter/xfilter/ixfobject.hxx lotuswordpro/source/filter/xfilter/ixfobject.hxx
202 --- lotuswordpro.bak/source/filter/xfilter/ixfobject.hxx 1970-01-01 08:00:00.000000000 +0800
203 +++ lotuswordpro/source/filter/xfilter/ixfobject.hxx 2008-10-22 11:42:34.000000000 +0800
204 @@ -0,0 +1,91 @@
205 +/*************************************************************************
207 + * The Contents of this file are made available subject to the terms of
208 + * either of the following licenses
210 + * - GNU Lesser General Public License Version 2.1
211 + * - Sun Industry Standards Source License Version 1.1
213 + * Sun Microsystems Inc., October, 2000
215 + * GNU Lesser General Public License Version 2.1
216 + * =============================================
217 + * Copyright 2000 by Sun Microsystems, Inc.
218 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
220 + * This library is free software; you can redistribute it and/or
221 + * modify it under the terms of the GNU Lesser General Public
222 + * License version 2.1, as published by the Free Software Foundation.
224 + * This library is distributed in the hope that it will be useful,
225 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
226 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
227 + * Lesser General Public License for more details.
229 + * You should have received a copy of the GNU Lesser General Public
230 + * License along with this library; if not, write to the Free Software
231 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
232 + * MA 02111-1307 USA
235 + * Sun Industry Standards Source License Version 1.1
236 + * =================================================
237 + * The contents of this file are subject to the Sun Industry Standards
238 + * Source License Version 1.1 (the "License"); You may not use this file
239 + * except in compliance with the License. You may obtain a copy of the
240 + * License at http://www.openoffice.org/license.html.
242 + * Software provided under this License is provided on an "AS IS" basis,
243 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
244 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
245 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
246 + * See the License for the specific provisions governing your rights and
247 + * obligations concerning the Software.
249 + * The Initial Developer of the Original Code is: IBM Corporation
251 + * Copyright: 2008 by IBM Corporation
253 + * All Rights Reserved.
255 + * Contributor(s): _______________________________________
258 + ************************************************************************/
259 +/*************************************************************************
260 + * @file
261 + * Interfer face for all object that will responsible for xml element output
262 + ************************************************************************/
263 +/*************************************************************************
264 + * Change History
265 + * 2004-12-23 create this file.
266 + ************************************************************************/
267 +#ifndef IXFOBJECT_INC
268 +#define IXFOBJECT_INC
270 +class IXFStream;
271 +/*************************************************************************
272 + * @descr
273 + * This is the root interface for all object which will ouput something to
274 + * the Sax Stream.
275 + * I'll add reference management code later.
276 + ************************************************************************/
277 +class IXFObject
279 +public:
280 + /**
281 + * Virtual destructure function for all class,This makes the XFilter module
282 + * a single-root framework.
283 + */
284 + virtual ~IXFObject(){}
286 + /**
287 + * The funciton to serial the object to the sax stream.
288 + * The objects that must implements ToXml is divided into two types:
289 + * 1. IXFStyle objects that has something to do with styles.
290 + * 2. IXFContent objects that contents text or picture.
291 + */
292 + virtual void ToXml(IXFStream *pSaxStream) = 0;
295 +#endif //IXFOBJECT_INC
296 diff -urNp lotuswordpro.bak/source/filter/xfilter/ixfproperty.hxx lotuswordpro/source/filter/xfilter/ixfproperty.hxx
297 --- lotuswordpro.bak/source/filter/xfilter/ixfproperty.hxx 1970-01-01 08:00:00.000000000 +0800
298 +++ lotuswordpro/source/filter/xfilter/ixfproperty.hxx 2008-10-22 11:42:34.000000000 +0800
299 @@ -0,0 +1,76 @@
300 +/*************************************************************************
302 + * The Contents of this file are made available subject to the terms of
303 + * either of the following licenses
305 + * - GNU Lesser General Public License Version 2.1
306 + * - Sun Industry Standards Source License Version 1.1
308 + * Sun Microsystems Inc., October, 2000
310 + * GNU Lesser General Public License Version 2.1
311 + * =============================================
312 + * Copyright 2000 by Sun Microsystems, Inc.
313 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
315 + * This library is free software; you can redistribute it and/or
316 + * modify it under the terms of the GNU Lesser General Public
317 + * License version 2.1, as published by the Free Software Foundation.
319 + * This library is distributed in the hope that it will be useful,
320 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
321 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
322 + * Lesser General Public License for more details.
324 + * You should have received a copy of the GNU Lesser General Public
325 + * License along with this library; if not, write to the Free Software
326 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
327 + * MA 02111-1307 USA
330 + * Sun Industry Standards Source License Version 1.1
331 + * =================================================
332 + * The contents of this file are subject to the Sun Industry Standards
333 + * Source License Version 1.1 (the "License"); You may not use this file
334 + * except in compliance with the License. You may obtain a copy of the
335 + * License at http://www.openoffice.org/license.html.
337 + * Software provided under this License is provided on an "AS IS" basis,
338 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
339 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
340 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
341 + * See the License for the specific provisions governing your rights and
342 + * obligations concerning the Software.
344 + * The Initial Developer of the Original Code is: IBM Corporation
346 + * Copyright: 2008 by IBM Corporation
348 + * All Rights Reserved.
350 + * Contributor(s): _______________________________________
353 + ************************************************************************/
354 +/*************************************************************************
355 + * @file
356 + * Property for styles. ie. Margins,shadow,columns and so on.
357 + ************************************************************************/
358 +/*************************************************************************
359 + * Change History
360 + * 2005-01-19 create this file.
361 + ************************************************************************/
362 +#ifndef _IXFPROPERTY_HXX
363 +#define _IXFPROPERTY_HXX
365 +#include "ixfobject.hxx"
367 +class IXFStream;
369 +class IXFProperty : public IXFObject
371 +public:
375 +#endif
376 \ No newline at end of file
377 diff -urNp lotuswordpro.bak/source/filter/xfilter/ixfstream.hxx lotuswordpro/source/filter/xfilter/ixfstream.hxx
378 --- lotuswordpro.bak/source/filter/xfilter/ixfstream.hxx 1970-01-01 08:00:00.000000000 +0800
379 +++ lotuswordpro/source/filter/xfilter/ixfstream.hxx 2008-10-22 11:42:34.000000000 +0800
380 @@ -0,0 +1,114 @@
381 +/*************************************************************************
383 + * The Contents of this file are made available subject to the terms of
384 + * either of the following licenses
386 + * - GNU Lesser General Public License Version 2.1
387 + * - Sun Industry Standards Source License Version 1.1
389 + * Sun Microsystems Inc., October, 2000
391 + * GNU Lesser General Public License Version 2.1
392 + * =============================================
393 + * Copyright 2000 by Sun Microsystems, Inc.
394 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
396 + * This library is free software; you can redistribute it and/or
397 + * modify it under the terms of the GNU Lesser General Public
398 + * License version 2.1, as published by the Free Software Foundation.
400 + * This library is distributed in the hope that it will be useful,
401 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
402 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
403 + * Lesser General Public License for more details.
405 + * You should have received a copy of the GNU Lesser General Public
406 + * License along with this library; if not, write to the Free Software
407 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
408 + * MA 02111-1307 USA
411 + * Sun Industry Standards Source License Version 1.1
412 + * =================================================
413 + * The contents of this file are subject to the Sun Industry Standards
414 + * Source License Version 1.1 (the "License"); You may not use this file
415 + * except in compliance with the License. You may obtain a copy of the
416 + * License at http://www.openoffice.org/license.html.
418 + * Software provided under this License is provided on an "AS IS" basis,
419 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
420 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
421 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
422 + * See the License for the specific provisions governing your rights and
423 + * obligations concerning the Software.
425 + * The Initial Developer of the Original Code is: IBM Corporation
427 + * Copyright: 2008 by IBM Corporation
429 + * All Rights Reserved.
431 + * Contributor(s): _______________________________________
434 + ************************************************************************/
435 +/*************************************************************************
436 + * @file
437 + * Sax stream to export xml to SODC.
438 + ************************************************************************/
439 +/*************************************************************************
440 + * Change History
441 + * 2004-12-23 create this file.
442 + ************************************************************************/
443 +#ifndef _IXFSTREAM_INC
444 +#define _IXFSTREAM_INC
447 +#include <rtl/ustring.hxx>
449 +class IXFAttrList;
451 +/**
452 + * @brief
453 + * Stream wrapper for sax writer.
454 + */
455 +class IXFStream
457 +public:
458 + virtual ~IXFStream(){}
459 + /**
460 + * @descr Called when start write.Usually you can output document type info and xml encoding info.
461 + */
462 + virtual void StartDocument() = 0;
464 + /**
465 + * @descr called when end output.
466 + */
467 + virtual void EndDocument() = 0;
469 + /**
470 + * @descr Wrap XDocumentHandler::startElement()
471 + * @param oustr element tag name.
472 + */
473 + virtual void StartElement(const rtl::OUString& oustr) = 0;
475 + /**
476 + * @descr Wrap XDocumentHandler::endElement()
477 + * @param oustr element tag name.
478 + */
479 + virtual void EndElement(const rtl::OUString& oustr) = 0;
481 + /**
482 + * @descr output text node.
483 + * @param oustr text content.
484 + */
485 + virtual void Characters(const rtl::OUString& oustr) = 0;
487 + /**
488 + * @descr return the Attribute list interface.
489 + * @return attribute list.
490 + */
491 + virtual IXFAttrList* GetAttrList() = 0;
494 +#endif //_IXFSTREAM_INC
495 \ No newline at end of file
496 diff -urNp lotuswordpro.bak/source/filter/xfilter/ixfstyle.hxx lotuswordpro/source/filter/xfilter/ixfstyle.hxx
497 --- lotuswordpro.bak/source/filter/xfilter/ixfstyle.hxx 1970-01-01 08:00:00.000000000 +0800
498 +++ lotuswordpro/source/filter/xfilter/ixfstyle.hxx 2008-10-22 11:42:34.000000000 +0800
499 @@ -0,0 +1,114 @@
500 +/*************************************************************************
502 + * The Contents of this file are made available subject to the terms of
503 + * either of the following licenses
505 + * - GNU Lesser General Public License Version 2.1
506 + * - Sun Industry Standards Source License Version 1.1
508 + * Sun Microsystems Inc., October, 2000
510 + * GNU Lesser General Public License Version 2.1
511 + * =============================================
512 + * Copyright 2000 by Sun Microsystems, Inc.
513 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
515 + * This library is free software; you can redistribute it and/or
516 + * modify it under the terms of the GNU Lesser General Public
517 + * License version 2.1, as published by the Free Software Foundation.
519 + * This library is distributed in the hope that it will be useful,
520 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
521 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
522 + * Lesser General Public License for more details.
524 + * You should have received a copy of the GNU Lesser General Public
525 + * License along with this library; if not, write to the Free Software
526 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
527 + * MA 02111-1307 USA
530 + * Sun Industry Standards Source License Version 1.1
531 + * =================================================
532 + * The contents of this file are subject to the Sun Industry Standards
533 + * Source License Version 1.1 (the "License"); You may not use this file
534 + * except in compliance with the License. You may obtain a copy of the
535 + * License at http://www.openoffice.org/license.html.
537 + * Software provided under this License is provided on an "AS IS" basis,
538 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
539 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
540 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
541 + * See the License for the specific provisions governing your rights and
542 + * obligations concerning the Software.
544 + * The Initial Developer of the Original Code is: IBM Corporation
546 + * Copyright: 2008 by IBM Corporation
548 + * All Rights Reserved.
550 + * Contributor(s): _______________________________________
553 + ************************************************************************/
554 +/*************************************************************************
555 + * @file
556 + * Interfer for all style object.
557 + ************************************************************************/
558 +/*************************************************************************
559 + * Change History
560 + * 2004-12-23 create this file.
561 + ************************************************************************/
563 +#ifndef _IXFSTYLE_HXX
564 +#define _IXFSTYLE_HXX
566 +#include "xfglobal.hxx"
567 +/**
568 + * @descr
569 + * Interface for all style object.
570 + */
571 +class IXFStyle : public IXFObject
573 +public:
574 + virtual ~IXFStyle(){}
575 + /**
576 + * @descr: return the style name.
577 + */
578 + virtual rtl::OUString GetStyleName() = 0;
580 + /**
581 + * @descr: set the name of the style.
582 + */
583 + virtual void SetStyleName(const rtl::OUString& styleName) = 0;
585 + /**
586 + * @descr return the parent style name.
587 + */
588 + virtual rtl::OUString GetParentStyleName() = 0;
589 + /**
590 + * @descr: Parant paragraph style.
591 + */
592 + virtual void SetParentStyleName(const rtl::OUString& parent) = 0;
593 + /**
594 + * @descr: return the style family. You can reference to enumXFStyle.
595 + */
596 + virtual enumXFStyle GetStyleFamily() = 0;
598 + /**
599 + * @descr: Set the style family,not quite useful.
600 + */
601 + virtual void SetStyleFamily(enumXFStyle family) = 0;
603 + /**
604 + * @descr: Compare wheather two style object are the same.Used only by XFStyleManager.
605 + * @param: pStyle the style to be compared.
606 + * @return: return sal_True if equals,else sal_False.
607 + */
608 + virtual sal_Bool Equal(IXFStyle *pStyle) = 0;
612 +#endif
614 diff -urNp lotuswordpro.bak/source/filter/xfilter/makefile.mk lotuswordpro/source/filter/xfilter/makefile.mk
615 --- lotuswordpro.bak/source/filter/xfilter/makefile.mk 1970-01-01 08:00:00.000000000 +0800
616 +++ lotuswordpro/source/filter/xfilter/makefile.mk 2008-10-22 11:42:34.000000000 +0800
617 @@ -0,0 +1,148 @@
618 +#*************************************************************************
620 +# The Contents of this file are made available subject to the terms of
621 +# either of the following licenses
623 +# - GNU Lesser General Public License Version 2.1
624 +# - Sun Industry Standards Source License Version 1.1
626 +# Sun Microsystems Inc., October, 2000
628 +# GNU Lesser General Public License Version 2.1
629 +# =============================================
630 +# Copyright 2000 by Sun Microsystems, Inc.
631 +# 901 San Antonio Road, Palo Alto, CA 94303, USA
633 +# This library is free software; you can redistribute it and/or
634 +# modify it under the terms of the GNU Lesser General Public
635 +# License version 2.1, as published by the Free Software Foundation.
637 +# This library is distributed in the hope that it will be useful,
638 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
639 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
640 +# Lesser General Public License for more details.
642 +# You should have received a copy of the GNU Lesser General Public
643 +# License along with this library; if not, write to the Free Software
644 +# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
645 +# MA 02111-1307 USA
648 +# Sun Industry Standards Source License Version 1.1
649 +# =================================================
650 +# The contents of this file are subject to the Sun Industry Standards
651 +# Source License Version 1.1 (the "License"); You may not use this file
652 +# except in compliance with the License. You may obtain a copy of the
653 +# License at http://www.openoffice.org/license.html.
655 +# Software provided under this License is provided on an "AS IS" basis,
656 +# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
657 +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
658 +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
659 +# See the License for the specific provisions governing your rights and
660 +# obligations concerning the Software.
662 +# The Initial Developer of the Original Code is: IBM Corporation
664 +# Copyright: 2008 by IBM Corporation
666 +# All Rights Reserved.
668 +# Contributor(s): _______________________________________
672 +#*************************************************************************
674 +PRJ=..$/..$/..
676 +PRJNAME=lwpfilter
677 +TARGET=xfilter
680 +#ENABLE_EXCEPTIONS=TRUE
682 +# --- Settings -----------------------------------------------------
684 +.INCLUDE : settings.mk
687 +SLOFILES= \
688 + $(SLO)$/xfsaxattrlist.obj \
689 + $(SLO)$/xfsaxstream.obj \
690 + $(SLO)$/xffilestream.obj \
691 + $(SLO)$/xffileattrlist.obj \
692 + $(SLO)$/xfstylemanager.obj \
693 + $(SLO)$/xfstyle.obj \
694 + $(SLO)$/xftextstyle.obj \
695 + $(SLO)$/xffont.obj \
696 + $(SLO)$/xffontdecl.obj \
697 + $(SLO)$/xfstylecont.obj \
698 + $(SLO)$/xfcontentcontainer.obj \
699 + $(SLO)$/xfutil.obj \
700 + $(SLO)$/xfparastyle.obj \
701 + $(SLO)$/xffontfactory.obj \
702 + $(SLO)$/xftextcontent.obj \
703 + $(SLO)$/xfparagraph.obj \
704 + $(SLO)$/xftextspan.obj \
705 + $(SLO)$/xfofficemeta.obj \
706 + $(SLO)$/xfglobal.obj \
707 + $(SLO)$/xflist.obj \
708 + $(SLO)$/xftextheading.obj \
709 + $(SLO)$/xfpagemaster.obj \
710 + $(SLO)$/xfmasterpage.obj \
711 + $(SLO)$/xfheaderstyle.obj \
712 + $(SLO)$/xfsectionstyle.obj \
713 + $(SLO)$/xfsection.obj \
714 + $(SLO)$/xfliststyle.obj \
715 + $(SLO)$/xfborders.obj \
716 + $(SLO)$/xfshadow.obj \
717 + $(SLO)$/xfcolor.obj \
718 + $(SLO)$/xfcolumns.obj \
719 + $(SLO)$/xfmargins.obj \
720 + $(SLO)$/xfdatestyle.obj \
721 + $(SLO)$/xftimestyle.obj \
722 + $(SLO)$/xftime.obj \
723 + $(SLO)$/xfdate.obj \
724 + $(SLO)$/xfframe.obj \
725 + $(SLO)$/xfframestyle.obj \
726 + $(SLO)$/xftable.obj \
727 + $(SLO)$/xfrow.obj \
728 + $(SLO)$/xfcell.obj \
729 + $(SLO)$/xfcolstyle.obj \
730 + $(SLO)$/xfcellstyle.obj \
731 + $(SLO)$/xfrowstyle.obj \
732 + $(SLO)$/xftablestyle.obj \
733 + $(SLO)$/xftabstyle.obj \
734 + $(SLO)$/xfoutlinestyle.obj \
735 + $(SLO)$/xfindex.obj \
736 + $(SLO)$/xfbookmarkref.obj \
737 + $(SLO)$/xfdrawobj.obj \
738 + $(SLO)$/xfdrawline.obj \
739 + $(SLO)$/xfdrawrect.obj \
740 + $(SLO)$/xfdrawcircle.obj \
741 + $(SLO)$/xfdrawellipse.obj \
742 + $(SLO)$/xfdrawpolyline.obj \
743 + $(SLO)$/xfdrawpolygon.obj \
744 + $(SLO)$/xfdrawpath.obj \
745 + $(SLO)$/xfdrawstyle.obj \
746 + $(SLO)$/xfdrawlinestyle.obj \
747 + $(SLO)$/xfdrawareastyle.obj \
748 + $(SLO)$/xfimage.obj \
749 + $(SLO)$/xfimagestyle.obj \
750 + $(SLO)$/xfbase64.obj \
751 + $(SLO)$/xfoleobj.obj \
752 + $(SLO)$/xfbgimage.obj \
753 + $(SLO)$/xfconfigmanager.obj \
754 + $(SLO)$/xfnumberstyle.obj \
755 + $(SLO)$/xffloatframe.obj \
756 + $(SLO)$/xfentry.obj \
757 + $(SLO)$/xfcrossref.obj \
758 + $(SLO)$/xfdocfield.obj \
759 + $(SLO)$/xfchange.obj \
760 + $(SLO)$/xftextboxstyle.obj
763 +# --- Targets ------------------------------------------------------
765 +.INCLUDE : target.mk
766 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfannotation.hxx lotuswordpro/source/filter/xfilter/xfannotation.hxx
767 --- lotuswordpro.bak/source/filter/xfilter/xfannotation.hxx 1970-01-01 08:00:00.000000000 +0800
768 +++ lotuswordpro/source/filter/xfilter/xfannotation.hxx 2008-10-22 11:42:34.000000000 +0800
769 @@ -0,0 +1,119 @@
770 +/*************************************************************************
772 + * The Contents of this file are made available subject to the terms of
773 + * either of the following licenses
775 + * - GNU Lesser General Public License Version 2.1
776 + * - Sun Industry Standards Source License Version 1.1
778 + * Sun Microsystems Inc., October, 2000
780 + * GNU Lesser General Public License Version 2.1
781 + * =============================================
782 + * Copyright 2000 by Sun Microsystems, Inc.
783 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
785 + * This library is free software; you can redistribute it and/or
786 + * modify it under the terms of the GNU Lesser General Public
787 + * License version 2.1, as published by the Free Software Foundation.
789 + * This library is distributed in the hope that it will be useful,
790 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
791 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
792 + * Lesser General Public License for more details.
794 + * You should have received a copy of the GNU Lesser General Public
795 + * License along with this library; if not, write to the Free Software
796 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
797 + * MA 02111-1307 USA
800 + * Sun Industry Standards Source License Version 1.1
801 + * =================================================
802 + * The contents of this file are subject to the Sun Industry Standards
803 + * Source License Version 1.1 (the "License"); You may not use this file
804 + * except in compliance with the License. You may obtain a copy of the
805 + * License at http://www.openoffice.org/license.html.
807 + * Software provided under this License is provided on an "AS IS" basis,
808 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
809 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
810 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
811 + * See the License for the specific provisions governing your rights and
812 + * obligations concerning the Software.
814 + * The Initial Developer of the Original Code is: IBM Corporation
816 + * Copyright: 2008 by IBM Corporation
818 + * All Rights Reserved.
820 + * Contributor(s): _______________________________________
823 + ************************************************************************/
824 +/*************************************************************************
825 + * @file
826 + * Annotation object.
827 + ************************************************************************/
828 +/*************************************************************************
829 + * Change History
830 + * 2005-01-31 create this file.
831 + ************************************************************************/
832 +#ifndef _XFANNOTATION_HXX
833 +#define _XFANNOTATION_HXX
835 +#include "xfglobal.hxx"
836 +#include "xfcontent.hxx"
837 +#include "xfcontentcontainer.hxx"
839 +class XFAnnotation : public XFContentContainer
841 +public:
842 + void SetDate(rtl::OUString date);
844 + void SetAuthor(rtl::OUString author);
846 + //void Add(IXFContent *pContent);
848 + virtual void ToXml(IXFStream *pStrm);
850 +private:
851 + rtl::OUString m_strDate;
852 + rtl::OUString m_strAuthor;
853 + //XFContentContainer m_aContents;
856 +inline void XFAnnotation::SetDate(rtl::OUString date)
858 + m_strDate = date;
861 +inline void XFAnnotation::SetAuthor(rtl::OUString author)
863 + m_strAuthor = author;
865 +/*
866 +inline void XFAnnotation::Add(IXFContent *pContent)
868 + m_aContents.Add(pContent);
871 +inline void XFAnnotation::ToXml(IXFStream *pStrm)
873 + IXFAttrList *pAttrList = pStrm->GetAttrList();
874 + pAttrList->Clear();
876 + if( m_strDate.getLength() )
877 + pAttrList->AddAttribute( A2OUSTR("office:create-date"), m_strDate );
878 + if( m_strAuthor.getLength() )
879 + pAttrList->AddAttribute( A2OUSTR("office:author"), m_strAuthor);
880 + pStrm->StartElement( A2OUSTR("office:annotation") );
882 + //m_aContents.ToXml(pStrm);
883 + XFContentContainer::ToXml(pStrm);
885 + pStrm->EndElement( A2OUSTR("office:annotation") );
888 +#endif
889 \ No newline at end of file
890 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfarrowstyle.hxx lotuswordpro/source/filter/xfilter/xfarrowstyle.hxx
891 --- lotuswordpro.bak/source/filter/xfilter/xfarrowstyle.hxx 1970-01-01 08:00:00.000000000 +0800
892 +++ lotuswordpro/source/filter/xfilter/xfarrowstyle.hxx 2008-10-22 11:42:34.000000000 +0800
893 @@ -0,0 +1,130 @@
894 +/*************************************************************************
896 + * The Contents of this file are made available subject to the terms of
897 + * either of the following licenses
899 + * - GNU Lesser General Public License Version 2.1
900 + * - Sun Industry Standards Source License Version 1.1
902 + * Sun Microsystems Inc., October, 2000
904 + * GNU Lesser General Public License Version 2.1
905 + * =============================================
906 + * Copyright 2000 by Sun Microsystems, Inc.
907 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
909 + * This library is free software; you can redistribute it and/or
910 + * modify it under the terms of the GNU Lesser General Public
911 + * License version 2.1, as published by the Free Software Foundation.
913 + * This library is distributed in the hope that it will be useful,
914 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
915 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
916 + * Lesser General Public License for more details.
918 + * You should have received a copy of the GNU Lesser General Public
919 + * License along with this library; if not, write to the Free Software
920 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
921 + * MA 02111-1307 USA
924 + * Sun Industry Standards Source License Version 1.1
925 + * =================================================
926 + * The contents of this file are subject to the Sun Industry Standards
927 + * Source License Version 1.1 (the "License"); You may not use this file
928 + * except in compliance with the License. You may obtain a copy of the
929 + * License at http://www.openoffice.org/license.html.
931 + * Software provided under this License is provided on an "AS IS" basis,
932 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
933 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
934 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
935 + * See the License for the specific provisions governing your rights and
936 + * obligations concerning the Software.
938 + * The Initial Developer of the Original Code is: IBM Corporation
940 + * Copyright: 2008 by IBM Corporation
942 + * All Rights Reserved.
944 + * Contributor(s): _______________________________________
947 + ************************************************************************/
948 +/*************************************************************************
949 + * @file
950 + * Line Arrow.
951 + ************************************************************************/
952 +/*************************************************************************
953 + * Change History
954 + * 2005-04-06 create this file.
955 + ************************************************************************/
956 +#ifndef _XFARROWSTYLE_HXX
957 +#define _XFARROWSTYLE_HXX
959 +#include "xfstyle.hxx"
961 +class XFArrowStyle : public XFStyle
963 +public:
964 + XFArrowStyle();
966 +public:
967 + void SetArrowName(rtl::OUString name);
969 + void SetViewbox(rtl::OUString viewBox);
971 + void SetSVGPath(rtl::OUString path);
973 + virtual enumXFStyle GetStyleFamily();
975 + virtual void ToXml(IXFStream *pStrm);
977 +private:
978 + rtl::OUString m_strName;
979 + rtl::OUString m_strViewBox;
980 + rtl::OUString m_strPath;
983 +inline XFArrowStyle::XFArrowStyle()
987 +inline void XFArrowStyle::SetArrowName(rtl::OUString name)
989 + m_strName = name;
992 +inline void XFArrowStyle::SetViewbox(rtl::OUString viewBox)
994 + m_strViewBox = viewBox;
997 +inline void XFArrowStyle::SetSVGPath(rtl::OUString path)
999 + m_strPath = path;
1002 +inline enumXFStyle XFArrowStyle::GetStyleFamily()
1004 + return enumXFStyleArrow;
1007 +inline void XFArrowStyle::ToXml(IXFStream *pStrm)
1009 + IXFAttrList *pAttrList = pStrm->GetAttrList();
1010 + pAttrList->Clear();
1012 + if( m_strName.getLength()>0 )
1013 + pAttrList->AddAttribute( A2OUSTR("draw:name"), m_strName );
1014 + else
1015 + pAttrList->AddAttribute( A2OUSTR("draw:name"), GetStyleName() );
1017 + pAttrList->AddAttribute( A2OUSTR("svg:viewBox"), m_strViewBox );
1018 + pAttrList->AddAttribute( A2OUSTR("svg:d"), m_strPath );
1019 + pStrm->StartElement(A2OUSTR("draw:marker"));
1020 + pStrm->EndElement(A2OUSTR("draw:marker"));
1023 +#endif
1024 \ No newline at end of file
1025 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfbase64.cxx lotuswordpro/source/filter/xfilter/xfbase64.cxx
1026 --- lotuswordpro.bak/source/filter/xfilter/xfbase64.cxx 1970-01-01 08:00:00.000000000 +0800
1027 +++ lotuswordpro/source/filter/xfilter/xfbase64.cxx 2008-10-22 11:42:34.000000000 +0800
1028 @@ -0,0 +1,136 @@
1029 +/*************************************************************************
1031 + * The Contents of this file are made available subject to the terms of
1032 + * either of the following licenses
1034 + * - GNU Lesser General Public License Version 2.1
1035 + * - Sun Industry Standards Source License Version 1.1
1037 + * Sun Microsystems Inc., October, 2000
1039 + * GNU Lesser General Public License Version 2.1
1040 + * =============================================
1041 + * Copyright 2000 by Sun Microsystems, Inc.
1042 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
1044 + * This library is free software; you can redistribute it and/or
1045 + * modify it under the terms of the GNU Lesser General Public
1046 + * License version 2.1, as published by the Free Software Foundation.
1048 + * This library is distributed in the hope that it will be useful,
1049 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1050 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1051 + * Lesser General Public License for more details.
1053 + * You should have received a copy of the GNU Lesser General Public
1054 + * License along with this library; if not, write to the Free Software
1055 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
1056 + * MA 02111-1307 USA
1059 + * Sun Industry Standards Source License Version 1.1
1060 + * =================================================
1061 + * The contents of this file are subject to the Sun Industry Standards
1062 + * Source License Version 1.1 (the "License"); You may not use this file
1063 + * except in compliance with the License. You may obtain a copy of the
1064 + * License at http://www.openoffice.org/license.html.
1066 + * Software provided under this License is provided on an "AS IS" basis,
1067 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
1068 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
1069 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
1070 + * See the License for the specific provisions governing your rights and
1071 + * obligations concerning the Software.
1073 + * The Initial Developer of the Original Code is: IBM Corporation
1075 + * Copyright: 2008 by IBM Corporation
1077 + * All Rights Reserved.
1079 + * Contributor(s): _______________________________________
1082 + ************************************************************************/
1083 +/*************************************************************************
1084 + * @file
1085 + * Base64 tool.
1086 + ************************************************************************/
1087 +/*************************************************************************
1088 + * Change History
1089 + * 2005-01-02 create this file.
1090 + * 2005-02-28 make Encode_(...) to be inline for speed.
1091 + ************************************************************************/
1092 +#include "xfbase64.hxx"
1094 +const sal_Char aBase64EncodeTable[] =
1095 +{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
1096 +'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
1097 +'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
1098 +'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
1099 +'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/' };
1101 +/**
1102 + * @descr Encode 3 byte to 4 byte.
1103 + * Please refer to RFC to get the base64 algorithm.
1104 + */
1105 +inline void Encode_(sal_uInt8 *src, sal_Char* dest)
1107 + sal_Int32 nBinaer = (((sal_uInt8)src[ 0]) << 16) +
1108 + (((sal_uInt8)src[1]) << 8) +
1109 + ((sal_uInt8)src[2]);
1111 + sal_uInt8 nIndex = ((nBinaer & 0xFC0000) >> 18);
1112 + dest[0] = aBase64EncodeTable [nIndex];
1114 + nIndex = (nBinaer & 0x3F000) >> 12;
1115 + dest[1] =aBase64EncodeTable [nIndex];
1117 + nIndex = (nBinaer & 0xFC0) >> 6;
1118 + dest[2] = aBase64EncodeTable [nIndex];
1120 + nIndex = (nBinaer & 0x3F);
1121 + dest[3] = aBase64EncodeTable [nIndex];
1124 +/**
1125 + * @descr Base64 encode.
1126 + */
1127 +rtl::OUString XFBase64::Encode(sal_uInt8 *buf, sal_Int32 len)
1129 + sal_Char *buffer;
1130 + sal_Int32 nNeeded;
1131 + sal_Int32 cycles = len/3;
1132 + sal_Int32 remain = len%3;
1134 + if( remain == 0 )
1135 + nNeeded = cycles*4;
1136 + else
1137 + nNeeded = (cycles+1)*4;
1138 + buffer = new sal_Char[nNeeded+1];
1140 + rtl_zeroMemory(buffer,nNeeded+1);
1142 + for( sal_Int32 i=0; i<cycles; i++ )
1143 + Encode_(buf+i*3,buffer+i*4);
1145 + sal_uInt8 last[3];
1146 + if( remain == 1 )
1148 + last[0] = buf[len-1];
1149 + last[1] = last[2] = 0;
1150 + Encode_(last,buffer+nNeeded+1-5);
1152 + else if( remain == 2 )
1154 + last[0] = buf[len-2];
1155 + last[1] = buf[len-1];
1156 + last[2] = 0;
1157 + Encode_(last,buffer+nNeeded+1-5);
1160 + rtl::OUString str = rtl::OUString::createFromAscii(buffer);
1161 + delete[] buffer;
1163 + return str;
1165 \ No newline at end of file
1166 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfbase64.hxx lotuswordpro/source/filter/xfilter/xfbase64.hxx
1167 --- lotuswordpro.bak/source/filter/xfilter/xfbase64.hxx 1970-01-01 08:00:00.000000000 +0800
1168 +++ lotuswordpro/source/filter/xfilter/xfbase64.hxx 2008-10-22 11:42:34.000000000 +0800
1169 @@ -0,0 +1,84 @@
1170 +/*************************************************************************
1172 + * The Contents of this file are made available subject to the terms of
1173 + * either of the following licenses
1175 + * - GNU Lesser General Public License Version 2.1
1176 + * - Sun Industry Standards Source License Version 1.1
1178 + * Sun Microsystems Inc., October, 2000
1180 + * GNU Lesser General Public License Version 2.1
1181 + * =============================================
1182 + * Copyright 2000 by Sun Microsystems, Inc.
1183 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
1185 + * This library is free software; you can redistribute it and/or
1186 + * modify it under the terms of the GNU Lesser General Public
1187 + * License version 2.1, as published by the Free Software Foundation.
1189 + * This library is distributed in the hope that it will be useful,
1190 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1191 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1192 + * Lesser General Public License for more details.
1194 + * You should have received a copy of the GNU Lesser General Public
1195 + * License along with this library; if not, write to the Free Software
1196 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
1197 + * MA 02111-1307 USA
1200 + * Sun Industry Standards Source License Version 1.1
1201 + * =================================================
1202 + * The contents of this file are subject to the Sun Industry Standards
1203 + * Source License Version 1.1 (the "License"); You may not use this file
1204 + * except in compliance with the License. You may obtain a copy of the
1205 + * License at http://www.openoffice.org/license.html.
1207 + * Software provided under this License is provided on an "AS IS" basis,
1208 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
1209 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
1210 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
1211 + * See the License for the specific provisions governing your rights and
1212 + * obligations concerning the Software.
1214 + * The Initial Developer of the Original Code is: IBM Corporation
1216 + * Copyright: 2008 by IBM Corporation
1218 + * All Rights Reserved.
1220 + * Contributor(s): _______________________________________
1223 + ************************************************************************/
1224 +/*************************************************************************
1225 + * @file
1226 + * Base64 tool.
1227 + ************************************************************************/
1228 +/*************************************************************************
1229 + * Change History
1230 + * 2005-01-02 create this file.
1231 + ************************************************************************/
1232 +#ifndef _XFBASE64_HXX
1233 +#define _XFBASE64_HXX
1235 +#include "xfglobal.hxx"
1237 +/**
1238 + * @brief
1239 + * Base64 algorithm implemetation.
1240 + * I only implements encode funtion now,i'll add decode if needed later.
1241 + * http://www.faqs.org/rfcs/rfc3548.html.
1242 + */
1244 +class XFBase64
1246 +public:
1247 + /**
1248 + * @descr Encode binary buffer to base64 encoding.
1249 + */
1250 + static rtl::OUString Encode(sal_uInt8 *buf, sal_Int32 len);
1253 +#endif
1254 \ No newline at end of file
1255 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfbgimage.cxx lotuswordpro/source/filter/xfilter/xfbgimage.cxx
1256 --- lotuswordpro.bak/source/filter/xfilter/xfbgimage.cxx 1970-01-01 08:00:00.000000000 +0800
1257 +++ lotuswordpro/source/filter/xfilter/xfbgimage.cxx 2008-10-22 11:42:34.000000000 +0800
1258 @@ -0,0 +1,165 @@
1259 +/*************************************************************************
1261 + * The Contents of this file are made available subject to the terms of
1262 + * either of the following licenses
1264 + * - GNU Lesser General Public License Version 2.1
1265 + * - Sun Industry Standards Source License Version 1.1
1267 + * Sun Microsystems Inc., October, 2000
1269 + * GNU Lesser General Public License Version 2.1
1270 + * =============================================
1271 + * Copyright 2000 by Sun Microsystems, Inc.
1272 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
1274 + * This library is free software; you can redistribute it and/or
1275 + * modify it under the terms of the GNU Lesser General Public
1276 + * License version 2.1, as published by the Free Software Foundation.
1278 + * This library is distributed in the hope that it will be useful,
1279 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1280 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1281 + * Lesser General Public License for more details.
1283 + * You should have received a copy of the GNU Lesser General Public
1284 + * License along with this library; if not, write to the Free Software
1285 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
1286 + * MA 02111-1307 USA
1289 + * Sun Industry Standards Source License Version 1.1
1290 + * =================================================
1291 + * The contents of this file are subject to the Sun Industry Standards
1292 + * Source License Version 1.1 (the "License"); You may not use this file
1293 + * except in compliance with the License. You may obtain a copy of the
1294 + * License at http://www.openoffice.org/license.html.
1296 + * Software provided under this License is provided on an "AS IS" basis,
1297 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
1298 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
1299 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
1300 + * See the License for the specific provisions governing your rights and
1301 + * obligations concerning the Software.
1303 + * The Initial Developer of the Original Code is: IBM Corporation
1305 + * Copyright: 2008 by IBM Corporation
1307 + * All Rights Reserved.
1309 + * Contributor(s): _______________________________________
1312 + ************************************************************************/
1313 +/*************************************************************************
1314 + * @file
1315 + * Background image.
1316 + ************************************************************************/
1317 +/*************************************************************************
1318 + * Change History
1319 + * 2005-03-01 created.
1320 + ************************************************************************/
1321 +#include "xfbgimage.hxx"
1322 +#include "xfbase64.hxx"
1324 +XFBGImage::XFBGImage()
1326 + m_bUserFileLink = sal_False;
1327 + m_bRepeate = sal_False;
1328 + m_bStretch = sal_False;
1329 + m_bPosition = sal_True;
1330 + m_eHoriAlign = enumXFAlignCenter;
1331 + m_eVertAlign = enumXFAlignCenter;
1334 +void XFBGImage::SetImageData(sal_uInt8 *buf, int len)
1336 + m_strData = XFBase64::Encode(buf,len);
1337 + m_bUserFileLink = sal_False;
1340 +sal_Bool XFBGImage::Equal(IXFStyle *pStyle)
1342 + return sal_False;
1345 +void XFBGImage::ToXml(IXFStream *pStrm)
1347 + IXFAttrList *pAttrList = pStrm->GetAttrList();
1348 + pAttrList->Clear();
1350 + if( m_bUserFileLink )
1352 + pAttrList->AddAttribute( A2OUSTR("xlink:href"), m_strFileName);
1355 + pAttrList->AddAttribute( A2OUSTR("xlink:type"), A2OUSTR("simple") );
1356 + pAttrList->AddAttribute( A2OUSTR("xlink:actuate"), A2OUSTR("onLoad"));
1358 + if( m_bPosition )
1360 + rtl::OUString str = GetAlignName(m_eVertAlign) + A2OUSTR(" ");
1361 + if( m_eHoriAlign == enumXFAlignStart )
1362 + str += A2OUSTR("left");
1363 + else if( m_eHoriAlign == enumXFAlignCenter )
1364 + str += A2OUSTR("center");
1365 + else if( m_eHoriAlign == enumXFAlignEnd )
1366 + str += A2OUSTR("right");
1368 + pAttrList->AddAttribute( A2OUSTR("style:position"), str );
1369 + pAttrList->AddAttribute( A2OUSTR("style:repeat"), A2OUSTR("no-repeat") );
1371 + else if( m_bRepeate )
1372 + pAttrList->AddAttribute( A2OUSTR("style:repeat"), A2OUSTR("repeat") );
1373 + else if( m_bStretch )
1374 + pAttrList->AddAttribute( A2OUSTR("style:repeat"), A2OUSTR("stretch") );
1376 + pStrm->StartElement( A2OUSTR("style:background-image") );
1378 + if( !m_bUserFileLink )
1380 + pAttrList->Clear();
1381 + pStrm->StartElement( A2OUSTR("office:binary-data") );
1382 + pStrm->Characters(m_strData);
1383 + pStrm->EndElement( A2OUSTR("office:binary-data") );
1386 + pStrm->EndElement( A2OUSTR("style:background-image") );
1389 +bool operator==(XFBGImage& img1, XFBGImage& img2)
1391 + if( img1.m_bUserFileLink != img2.m_bUserFileLink )
1392 + return false;
1393 + if( img1.m_bUserFileLink )
1395 + if( img1.m_strFileName != img2.m_strFileName )
1396 + return false;
1398 + else
1400 + //I'll not compare the content of the two buffer,it's time comsuming.
1401 + return sal_False;
1403 + if( img1.m_bPosition != img2.m_bPosition )
1404 + return false;
1405 + if( img1.m_bRepeate != img2.m_bRepeate )
1406 + return false;
1407 + if( img1.m_bStretch != img2.m_bStretch )
1408 + return false;
1409 + if( img1.m_bPosition )
1411 + if( (img1.m_eHoriAlign != img2.m_eHoriAlign) || (img1.m_eVertAlign != img2.m_eVertAlign) )
1412 + return false;
1414 + return true;
1417 +bool operator!=(XFBGImage& img1, XFBGImage& img2)
1419 + return !(img1==img2);
1424 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfbgimage.hxx lotuswordpro/source/filter/xfilter/xfbgimage.hxx
1425 --- lotuswordpro.bak/source/filter/xfilter/xfbgimage.hxx 1970-01-01 08:00:00.000000000 +0800
1426 +++ lotuswordpro/source/filter/xfilter/xfbgimage.hxx 2008-10-22 11:42:34.000000000 +0800
1427 @@ -0,0 +1,155 @@
1428 +/*************************************************************************
1430 + * The Contents of this file are made available subject to the terms of
1431 + * either of the following licenses
1433 + * - GNU Lesser General Public License Version 2.1
1434 + * - Sun Industry Standards Source License Version 1.1
1436 + * Sun Microsystems Inc., October, 2000
1438 + * GNU Lesser General Public License Version 2.1
1439 + * =============================================
1440 + * Copyright 2000 by Sun Microsystems, Inc.
1441 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
1443 + * This library is free software; you can redistribute it and/or
1444 + * modify it under the terms of the GNU Lesser General Public
1445 + * License version 2.1, as published by the Free Software Foundation.
1447 + * This library is distributed in the hope that it will be useful,
1448 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1449 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1450 + * Lesser General Public License for more details.
1452 + * You should have received a copy of the GNU Lesser General Public
1453 + * License along with this library; if not, write to the Free Software
1454 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
1455 + * MA 02111-1307 USA
1458 + * Sun Industry Standards Source License Version 1.1
1459 + * =================================================
1460 + * The contents of this file are subject to the Sun Industry Standards
1461 + * Source License Version 1.1 (the "License"); You may not use this file
1462 + * except in compliance with the License. You may obtain a copy of the
1463 + * License at http://www.openoffice.org/license.html.
1465 + * Software provided under this License is provided on an "AS IS" basis,
1466 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
1467 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
1468 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
1469 + * See the License for the specific provisions governing your rights and
1470 + * obligations concerning the Software.
1472 + * The Initial Developer of the Original Code is: IBM Corporation
1474 + * Copyright: 2008 by IBM Corporation
1476 + * All Rights Reserved.
1478 + * Contributor(s): _______________________________________
1481 + ************************************************************************/
1482 +/*************************************************************************
1483 + * @file
1484 + * Background image.
1485 + ************************************************************************/
1486 +/*************************************************************************
1487 + * Change History
1488 + * 2005-03-01 created.
1489 + ************************************************************************/
1490 +#ifndef _XFBGIMAGE_HXX
1491 +#define _XFBGIMAGE_HXX
1493 +#include "xfstyle.hxx"
1495 +/**
1496 + * @brief
1497 + * Background image object.
1498 + */
1499 +class XFBGImage : public XFStyle
1501 +public:
1502 + XFBGImage();
1504 +public:
1505 + /**
1506 + * @descr Use file link as image source.
1507 + */
1508 + void SetFileLink(rtl::OUString fileName);
1510 + /**
1511 + * @descr Use base64 stream as image source.
1512 + */
1513 + void SetImageData(sal_uInt8 *buf, int len);
1515 + /**
1516 + * @descr Set the iamge position type.
1517 + */
1518 + void SetPosition(enumXFAlignType horiAlign = enumXFAlignCenter, enumXFAlignType vertAlign = enumXFAlignCenter);
1520 + /**
1521 + * @descr Set background image repeat style.
1522 + */
1523 + void SetRepeate();
1525 + /**
1526 + * @descr Set whether the image should be streatched to fill the owner object.
1527 + */
1528 + void SetStretch();
1530 + /**
1531 + * @descr decide whether there has been a style that is the same as this object.
1532 + * If it use base64 stream, i'll simply return sal_False because it's too slow to compare two base64 stream.
1533 + */
1534 + virtual sal_Bool Equal(IXFStyle *pStyle);
1536 + virtual void ToXml(IXFStream *pStrm);
1538 + friend bool operator==(XFBGImage& img1, XFBGImage& img2);
1539 + friend bool operator!=(XFBGImage& img1, XFBGImage& img2);
1540 +private:
1541 + rtl::OUString m_strFileName;
1542 + rtl::OUString m_strData;
1543 + sal_Bool m_bUserFileLink;
1544 + sal_Bool m_bRepeate;
1545 + sal_Bool m_bStretch;
1546 + sal_Bool m_bPosition;
1547 + enumXFAlignType m_eHoriAlign;
1548 + enumXFAlignType m_eVertAlign;
1551 +inline void XFBGImage::SetFileLink(rtl::OUString fileName)
1553 + m_strFileName = fileName;
1554 + m_bUserFileLink = sal_True;
1557 +inline void XFBGImage::SetPosition(enumXFAlignType horiAlign, enumXFAlignType vertAlign)
1559 + m_bPosition = sal_True;
1560 + m_eHoriAlign = horiAlign;
1561 + m_eVertAlign = vertAlign;
1563 + m_bStretch = sal_False;
1564 + m_bRepeate = sal_False;
1567 +inline void XFBGImage::SetRepeate()
1569 + m_bRepeate = sal_True;
1570 + m_bStretch = sal_False;
1571 + m_bPosition = sal_False;
1574 +inline void XFBGImage::SetStretch()
1576 + m_bStretch = sal_True;
1577 + m_bRepeate = sal_False;
1578 + m_bPosition = sal_False;
1581 +#endif
1583 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfbookmark.hxx lotuswordpro/source/filter/xfilter/xfbookmark.hxx
1584 --- lotuswordpro.bak/source/filter/xfilter/xfbookmark.hxx 1970-01-01 08:00:00.000000000 +0800
1585 +++ lotuswordpro/source/filter/xfilter/xfbookmark.hxx 2008-10-22 11:42:34.000000000 +0800
1586 @@ -0,0 +1,130 @@
1587 +/*************************************************************************
1589 + * The Contents of this file are made available subject to the terms of
1590 + * either of the following licenses
1592 + * - GNU Lesser General Public License Version 2.1
1593 + * - Sun Industry Standards Source License Version 1.1
1595 + * Sun Microsystems Inc., October, 2000
1597 + * GNU Lesser General Public License Version 2.1
1598 + * =============================================
1599 + * Copyright 2000 by Sun Microsystems, Inc.
1600 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
1602 + * This library is free software; you can redistribute it and/or
1603 + * modify it under the terms of the GNU Lesser General Public
1604 + * License version 2.1, as published by the Free Software Foundation.
1606 + * This library is distributed in the hope that it will be useful,
1607 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1608 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1609 + * Lesser General Public License for more details.
1611 + * You should have received a copy of the GNU Lesser General Public
1612 + * License along with this library; if not, write to the Free Software
1613 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
1614 + * MA 02111-1307 USA
1617 + * Sun Industry Standards Source License Version 1.1
1618 + * =================================================
1619 + * The contents of this file are subject to the Sun Industry Standards
1620 + * Source License Version 1.1 (the "License"); You may not use this file
1621 + * except in compliance with the License. You may obtain a copy of the
1622 + * License at http://www.openoffice.org/license.html.
1624 + * Software provided under this License is provided on an "AS IS" basis,
1625 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
1626 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
1627 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
1628 + * See the License for the specific provisions governing your rights and
1629 + * obligations concerning the Software.
1631 + * The Initial Developer of the Original Code is: IBM Corporation
1633 + * Copyright: 2008 by IBM Corporation
1635 + * All Rights Reserved.
1637 + * Contributor(s): _______________________________________
1640 + ************************************************************************/
1641 +/*************************************************************************
1642 + * @file
1643 + * Bookmark ref.
1644 + ************************************************************************/
1645 +/*************************************************************************
1646 + * Change History
1647 + * 2005-02-03 create this file.
1648 + ************************************************************************/
1649 +#ifndef _XFBOOKMARK_HXX
1650 +#define _XFBOOKMARK_HXX
1652 +#include "xfcontent.hxx"
1654 +/**
1655 + * @brief
1656 + * Bookmark object.
1657 + */
1658 +class XFBookmark : public XFContent
1660 +public:
1661 + XFBookmark(sal_Bool isStart)
1663 + m_bStart = isStart;
1666 + rtl::OUString GetDivision(){return m_strDivision;}
1667 + void SetDivision(rtl::OUString sDivName){m_strDivision = sDivName;}
1668 + rtl::OUString GetName(){return m_strName;}
1670 +public:
1671 + /**
1672 + * @descr Set bookmark name, which will be used in bookmark-ref or formula.
1673 + */
1674 + void SetName(rtl::OUString name)
1676 + m_strName = name;
1679 + virtual void ToXml(IXFStream *pStrm)
1681 + IXFAttrList *pAttrList = pStrm->GetAttrList();
1682 + pAttrList->Clear();
1684 + pAttrList->AddAttribute( A2OUSTR("text:name"), m_strName );
1685 + if( m_bStart )
1687 + pStrm->StartElement( A2OUSTR("text:bookmark-start") );
1688 + pStrm->EndElement( A2OUSTR("text:bookmark-start") );
1690 + else
1692 + pStrm->StartElement( A2OUSTR("text:bookmark-end") );
1693 + pStrm->EndElement( A2OUSTR("text:bookmark-end") );
1697 +private:
1698 + sal_Bool m_bStart;
1699 + rtl::OUString m_strName;
1700 + rtl::OUString m_strDivision;
1703 +class XFBookmarkStart : public XFBookmark
1705 +public:
1706 + XFBookmarkStart():XFBookmark(sal_True){}
1709 +class XFBookmarkEnd : public XFBookmark
1711 +public:
1712 + XFBookmarkEnd():XFBookmark(sal_False){}
1715 +#endif
1717 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfbookmarkref.cxx lotuswordpro/source/filter/xfilter/xfbookmarkref.cxx
1718 --- lotuswordpro.bak/source/filter/xfilter/xfbookmarkref.cxx 1970-01-01 08:00:00.000000000 +0800
1719 +++ lotuswordpro/source/filter/xfilter/xfbookmarkref.cxx 2008-10-22 11:42:34.000000000 +0800
1720 @@ -0,0 +1,107 @@
1721 +/*************************************************************************
1723 + * The Contents of this file are made available subject to the terms of
1724 + * either of the following licenses
1726 + * - GNU Lesser General Public License Version 2.1
1727 + * - Sun Industry Standards Source License Version 1.1
1729 + * Sun Microsystems Inc., October, 2000
1731 + * GNU Lesser General Public License Version 2.1
1732 + * =============================================
1733 + * Copyright 2000 by Sun Microsystems, Inc.
1734 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
1736 + * This library is free software; you can redistribute it and/or
1737 + * modify it under the terms of the GNU Lesser General Public
1738 + * License version 2.1, as published by the Free Software Foundation.
1740 + * This library is distributed in the hope that it will be useful,
1741 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1742 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1743 + * Lesser General Public License for more details.
1745 + * You should have received a copy of the GNU Lesser General Public
1746 + * License along with this library; if not, write to the Free Software
1747 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
1748 + * MA 02111-1307 USA
1751 + * Sun Industry Standards Source License Version 1.1
1752 + * =================================================
1753 + * The contents of this file are subject to the Sun Industry Standards
1754 + * Source License Version 1.1 (the "License"); You may not use this file
1755 + * except in compliance with the License. You may obtain a copy of the
1756 + * License at http://www.openoffice.org/license.html.
1758 + * Software provided under this License is provided on an "AS IS" basis,
1759 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
1760 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
1761 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
1762 + * See the License for the specific provisions governing your rights and
1763 + * obligations concerning the Software.
1765 + * The Initial Developer of the Original Code is: IBM Corporation
1767 + * Copyright: 2008 by IBM Corporation
1769 + * All Rights Reserved.
1771 + * Contributor(s): _______________________________________
1774 + ************************************************************************/
1775 +/*************************************************************************
1776 + * @file
1777 + * Bookmark reference.
1778 + ************************************************************************/
1779 +/*************************************************************************
1780 + * Change History
1781 + * 2005-02-03 create this file.
1782 + ************************************************************************/
1783 +#include "xfbookmarkref.hxx"
1785 +XFBookmarkRef::XFBookmarkRef()
1787 + m_eRefType = enumXFBookmarkNone;
1790 +void XFBookmarkRef::ToXml(IXFStream *pStrm)
1792 + IXFAttrList *pAttrList = pStrm->GetAttrList();
1793 + pAttrList->Clear();
1795 + assert(m_strBookmark.getLength() > 0 );
1796 + if( m_eRefType == enumXFBookmarkNone )
1797 + return;
1798 + else if( m_eRefType == enumXFBookmarkPage )
1800 + pAttrList->AddAttribute( A2OUSTR("text:reference-format"), A2OUSTR("page") );
1801 + pAttrList->AddAttribute( A2OUSTR("text:ref-name"), m_strBookmark );
1803 + else if( m_eRefType == enumXFBookmarkChapter )
1805 + pAttrList->AddAttribute( A2OUSTR("text:reference-format"), A2OUSTR("chapter") );
1806 + pAttrList->AddAttribute( A2OUSTR("text:ref-name"), m_strBookmark );
1808 + else if( m_eRefType == enumXFBookmarkPage )
1810 + pAttrList->AddAttribute( A2OUSTR("text:reference-format"), A2OUSTR("text") );
1811 + pAttrList->AddAttribute( A2OUSTR("text:ref-name"), m_strBookmark );
1814 + else if( m_eRefType == enumXFBookmarkDir )
1816 + pAttrList->AddAttribute( A2OUSTR("text:reference-format"), A2OUSTR("direction") );
1817 + pAttrList->AddAttribute( A2OUSTR("text:ref-name"), m_strBookmark );
1819 + else if( m_eRefType == enumXFBookmarkDef )
1821 + pAttrList->AddAttribute( A2OUSTR("text:ref-name"), m_strBookmark );
1823 + pStrm->StartElement( A2OUSTR("text:bookmark-ref") );
1824 + if( m_strText.getLength() )
1825 + pStrm->Characters(m_strBookmark);
1826 + pStrm->EndElement( A2OUSTR("text:bookmark-ref") );
1828 \ No newline at end of file
1829 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfbookmarkref.hxx lotuswordpro/source/filter/xfilter/xfbookmarkref.hxx
1830 --- lotuswordpro.bak/source/filter/xfilter/xfbookmarkref.hxx 1970-01-01 08:00:00.000000000 +0800
1831 +++ lotuswordpro/source/filter/xfilter/xfbookmarkref.hxx 2008-10-22 11:42:34.000000000 +0800
1832 @@ -0,0 +1,103 @@
1833 +/*************************************************************************
1835 + * The Contents of this file are made available subject to the terms of
1836 + * either of the following licenses
1838 + * - GNU Lesser General Public License Version 2.1
1839 + * - Sun Industry Standards Source License Version 1.1
1841 + * Sun Microsystems Inc., October, 2000
1843 + * GNU Lesser General Public License Version 2.1
1844 + * =============================================
1845 + * Copyright 2000 by Sun Microsystems, Inc.
1846 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
1848 + * This library is free software; you can redistribute it and/or
1849 + * modify it under the terms of the GNU Lesser General Public
1850 + * License version 2.1, as published by the Free Software Foundation.
1852 + * This library is distributed in the hope that it will be useful,
1853 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1854 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1855 + * Lesser General Public License for more details.
1857 + * You should have received a copy of the GNU Lesser General Public
1858 + * License along with this library; if not, write to the Free Software
1859 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
1860 + * MA 02111-1307 USA
1863 + * Sun Industry Standards Source License Version 1.1
1864 + * =================================================
1865 + * The contents of this file are subject to the Sun Industry Standards
1866 + * Source License Version 1.1 (the "License"); You may not use this file
1867 + * except in compliance with the License. You may obtain a copy of the
1868 + * License at http://www.openoffice.org/license.html.
1870 + * Software provided under this License is provided on an "AS IS" basis,
1871 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
1872 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
1873 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
1874 + * See the License for the specific provisions governing your rights and
1875 + * obligations concerning the Software.
1877 + * The Initial Developer of the Original Code is: IBM Corporation
1879 + * Copyright: 2008 by IBM Corporation
1881 + * All Rights Reserved.
1883 + * Contributor(s): _______________________________________
1886 + ************************************************************************/
1887 +/*************************************************************************
1888 + * @file
1889 + * Bookmark ref.
1890 + ************************************************************************/
1891 +/*************************************************************************
1892 + * Change History
1893 + * 2005-02-03 create this file.
1894 + ************************************************************************/
1895 +#ifndef _XFBOOKMARKREF_HXX
1896 +#define _XFBOOKMARKREF_HXX
1898 +#include "xfcontent.hxx"
1900 +class XFBookmarkRef : public XFContent
1902 +public:
1903 + XFBookmarkRef();
1905 +public:
1906 + void SetRefType(enumXFBookmarkRef type);
1908 + void SetBookmark(rtl::OUString name);
1910 + void SetText(rtl::OUString text);
1912 + virtual void ToXml(IXFStream *pStrm);
1914 +private:
1915 + enumXFBookmarkRef m_eRefType;
1916 + rtl::OUString m_strBookmark;
1917 + rtl::OUString m_strText;
1920 +inline void XFBookmarkRef::SetRefType(enumXFBookmarkRef ref)
1922 + m_eRefType = ref;
1925 +inline void XFBookmarkRef::SetBookmark(rtl::OUString name)
1927 + m_strBookmark = name;
1930 +inline void XFBookmarkRef::SetText(rtl::OUString text)
1932 + m_strText = text;
1935 +#endif
1936 \ No newline at end of file
1937 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfborders.cxx lotuswordpro/source/filter/xfilter/xfborders.cxx
1938 --- lotuswordpro.bak/source/filter/xfilter/xfborders.cxx 1970-01-01 08:00:00.000000000 +0800
1939 +++ lotuswordpro/source/filter/xfilter/xfborders.cxx 2008-10-22 11:42:34.000000000 +0800
1940 @@ -0,0 +1,361 @@
1941 +/*************************************************************************
1943 + * The Contents of this file are made available subject to the terms of
1944 + * either of the following licenses
1946 + * - GNU Lesser General Public License Version 2.1
1947 + * - Sun Industry Standards Source License Version 1.1
1949 + * Sun Microsystems Inc., October, 2000
1951 + * GNU Lesser General Public License Version 2.1
1952 + * =============================================
1953 + * Copyright 2000 by Sun Microsystems, Inc.
1954 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
1956 + * This library is free software; you can redistribute it and/or
1957 + * modify it under the terms of the GNU Lesser General Public
1958 + * License version 2.1, as published by the Free Software Foundation.
1960 + * This library is distributed in the hope that it will be useful,
1961 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1962 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1963 + * Lesser General Public License for more details.
1965 + * You should have received a copy of the GNU Lesser General Public
1966 + * License along with this library; if not, write to the Free Software
1967 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
1968 + * MA 02111-1307 USA
1971 + * Sun Industry Standards Source License Version 1.1
1972 + * =================================================
1973 + * The contents of this file are subject to the Sun Industry Standards
1974 + * Source License Version 1.1 (the "License"); You may not use this file
1975 + * except in compliance with the License. You may obtain a copy of the
1976 + * License at http://www.openoffice.org/license.html.
1978 + * Software provided under this License is provided on an "AS IS" basis,
1979 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
1980 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
1981 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
1982 + * See the License for the specific provisions governing your rights and
1983 + * obligations concerning the Software.
1985 + * The Initial Developer of the Original Code is: IBM Corporation
1987 + * Copyright: 2008 by IBM Corporation
1989 + * All Rights Reserved.
1991 + * Contributor(s): _______________________________________
1994 + ************************************************************************/
1995 +/*************************************************************************
1996 + * @file
1997 + * Border object,now only used by paragraph object.
1998 + ************************************************************************/
1999 +/*************************************************************************
2000 + * Change History
2001 + * 2005-01-14 create this file.
2002 + * 2005-01-17 change for the XFColor object.
2003 + ************************************************************************/
2004 +#include "xfborders.hxx"
2006 +XFBorder::XFBorder()
2008 + m_fOffset = 0;
2009 + m_bDouble = sal_False;
2010 + m_bSameWidth = sal_False;
2011 + m_fWidthInner = 0;
2012 + m_fWidthSpace = 0;
2013 + m_fWidthOutter = 0;
2016 +void XFBorder::SetColor(XFColor& color)
2018 + m_aColor = color;
2021 +void XFBorder::SetWidth(double width)
2023 + if( !m_bDouble )
2025 + m_fWidthInner = width;
2026 + m_bSameWidth = sal_True;
2027 + }
2028 + else if( m_bDouble && m_bSameWidth )
2030 + m_fWidthInner = width;
2031 + m_fWidthOutter = width;
2032 + m_fWidthSpace = width;
2036 +void XFBorder::SetDoubleLine(sal_Bool dual,sal_Bool bSameWidth)
2038 + m_bDouble = dual;
2039 + m_bSameWidth = bSameWidth;
2042 +void XFBorder::SetWidthInner(double inner)
2044 + assert(m_bDouble);
2045 + m_fWidthInner = inner;
2048 +void XFBorder::SetWidthSpace(double space)
2050 + assert(m_bDouble);
2051 + m_fWidthSpace = space;
2054 +void XFBorder::SetWidthOutter(double outer)
2056 + assert(m_bDouble);
2057 + m_fWidthOutter = outer;
2060 +rtl::OUString XFBorder::GetLineWidth()
2062 + rtl::OUString str;
2064 + if( m_bDouble )
2066 + str = FloatToOUString(m_fWidthInner);
2067 + str += A2OUSTR("cm ") + DoubleToOUString(m_fWidthSpace);
2068 + str += A2OUSTR("cm ") + DoubleToOUString(m_fWidthOutter) + A2OUSTR("cm");
2070 + return str;
2073 +rtl::OUString XFBorder::ToString()
2075 + rtl::OUString str;
2077 + if( m_bDouble )
2079 + double width = m_fWidthInner + m_fWidthSpace + m_fWidthOutter;
2080 + if( width<FLOAT_MIN )
2082 + return str;
2085 + str = DoubleToOUString(width) + A2OUSTR("cm");
2086 + str += A2OUSTR(" double ") + m_aColor.ToString();
2088 + else
2090 + double width = m_fWidthInner;
2091 + if( width<FLOAT_MIN )
2093 + return str;
2095 + str = DoubleToOUString(width) + A2OUSTR("cm");
2096 + str += A2OUSTR(" solid ") + m_aColor.ToString();
2098 + return str;
2101 +bool operator==(XFBorder& b1, XFBorder& b2)
2103 + if( b1.m_fOffset != b2.m_fOffset )
2104 + return false;
2105 + if( b1.m_bDouble != b2.m_bDouble )
2106 + return false;
2107 + if( !b1.m_bDouble )
2109 + if( b1.m_fWidthInner != b2.m_fWidthInner )
2110 + return false;
2112 + else
2114 + if( b1.m_bSameWidth != b2.m_bSameWidth )
2115 + return true;
2116 + if( b1.m_fWidthInner != b2.m_fWidthInner ||
2117 + b1.m_fWidthSpace != b2.m_fWidthSpace ||
2118 + b1.m_fWidthOutter != b2.m_fWidthOutter
2120 + return false;
2122 + if( b1.m_aColor != b2.m_aColor )
2123 + return sal_False;
2124 + return true;
2127 +bool operator!=(XFBorder& b1, XFBorder& b2)
2129 + return !(b1 == b2);
2133 +//XFBorders:
2135 +void XFBorders::SetColor(enumXFBorder side, XFColor& color)
2137 + switch(side)
2139 + case enumXFBorderLeft:
2140 + m_aBorderLeft.SetColor(color);
2141 + break;
2142 + case enumXFBorderRight:
2143 + m_aBorderRight.SetColor(color);
2144 + break;
2145 + case enumXFBorderTop:
2146 + m_aBorderTop.SetColor(color);
2147 + break;
2148 + case enumXFBorderBottom:
2149 + m_aBorderBottom.SetColor(color);
2150 + break;
2154 +void XFBorders::SetWidth(enumXFBorder side, double width)
2156 + switch(side)
2158 + case enumXFBorderLeft:
2159 + m_aBorderLeft.SetWidth(width);
2160 + break;
2161 + case enumXFBorderRight:
2162 + m_aBorderRight.SetWidth(width);
2163 + break;
2164 + case enumXFBorderTop:
2165 + m_aBorderTop.SetWidth(width);
2166 + break;
2167 + case enumXFBorderBottom:
2168 + m_aBorderBottom.SetWidth(width);
2169 + break;
2173 +void XFBorders::SetDoubleLine(enumXFBorder side, sal_Bool dual,sal_Bool bSameWidth)
2175 + switch(side)
2177 + case enumXFBorderLeft:
2178 + m_aBorderLeft.SetDoubleLine(dual,bSameWidth);
2179 + break;
2180 + case enumXFBorderRight:
2181 + m_aBorderRight.SetDoubleLine(dual,bSameWidth);
2182 + break;
2183 + case enumXFBorderTop:
2184 + m_aBorderTop.SetDoubleLine(dual,bSameWidth);
2185 + break;
2186 + case enumXFBorderBottom:
2187 + m_aBorderBottom.SetDoubleLine(dual,bSameWidth);
2188 + break;
2192 +void XFBorders::SetWidthInner(enumXFBorder side, double inner)
2194 + switch(side)
2196 + case enumXFBorderLeft:
2197 + m_aBorderLeft.SetWidthInner(inner);
2198 + break;
2199 + case enumXFBorderRight:
2200 + m_aBorderRight.SetWidthInner(inner);
2201 + break;
2202 + case enumXFBorderTop:
2203 + m_aBorderTop.SetWidthInner(inner);
2204 + break;
2205 + case enumXFBorderBottom:
2206 + m_aBorderBottom.SetWidthInner(inner);
2207 + break;
2211 +void XFBorders::SetWidthSpace(enumXFBorder side, double space)
2213 + switch(side)
2215 + case enumXFBorderLeft:
2216 + m_aBorderLeft.SetWidthSpace(space);
2217 + break;
2218 + case enumXFBorderRight:
2219 + m_aBorderRight.SetWidthSpace(space);
2220 + break;
2221 + case enumXFBorderTop:
2222 + m_aBorderTop.SetWidthSpace(space);
2223 + break;
2224 + case enumXFBorderBottom:
2225 + m_aBorderBottom.SetWidthSpace(space);
2226 + break;
2230 +void XFBorders::SetWidthOutter(enumXFBorder side, double outer)
2232 + switch(side)
2234 + case enumXFBorderLeft:
2235 + m_aBorderLeft.SetWidthOutter(outer);
2236 + break;
2237 + case enumXFBorderRight:
2238 + m_aBorderRight.SetWidthOutter(outer);
2239 + break;
2240 + case enumXFBorderTop:
2241 + m_aBorderTop.SetWidthOutter(outer);
2242 + break;
2243 + case enumXFBorderBottom:
2244 + m_aBorderBottom.SetWidthOutter(outer);
2245 + break;
2249 +bool operator ==(XFBorders& b1, XFBorders& b2)
2251 + if( b1.m_aBorderLeft != b2.m_aBorderLeft )
2252 + return false;
2253 + if( b1.m_aBorderRight != b2.m_aBorderRight )
2254 + return false;
2255 + if( b1.m_aBorderTop != b2.m_aBorderTop )
2256 + return false;
2257 + if( b1.m_aBorderBottom != b2.m_aBorderBottom )
2258 + return false;
2259 + return true;
2262 +bool operator!=(XFBorders& b1, XFBorders& b2)
2264 + return !(b1 == b2);
2267 +void XFBorders::ToXml(IXFStream *pStrm)
2269 + IXFAttrList *pAttrList = pStrm->GetAttrList();
2271 + if( m_aBorderLeft.GetLineWidth().getLength() )
2272 + pAttrList->AddAttribute( A2OUSTR("style:border-line-width-left"), m_aBorderLeft.GetLineWidth() );
2273 + if( m_aBorderRight.GetLineWidth().getLength() )
2274 + pAttrList->AddAttribute( A2OUSTR("style:border-line-width-right"), m_aBorderRight.GetLineWidth() );
2275 + if( m_aBorderTop.GetLineWidth().getLength() )
2276 + pAttrList->AddAttribute( A2OUSTR("style:border-line-width-top"), m_aBorderTop.GetLineWidth() );
2277 + if( m_aBorderBottom.GetLineWidth().getLength() )
2278 + pAttrList->AddAttribute( A2OUSTR("style:border-line-width-bottom"), m_aBorderBottom.GetLineWidth() );
2280 + if( m_aBorderLeft.ToString().getLength() )
2281 + pAttrList->AddAttribute( A2OUSTR("fo:border-left"), m_aBorderLeft.ToString() );
2282 + else
2283 + pAttrList->AddAttribute( A2OUSTR("fo:border-left"), A2OUSTR("none") );
2285 + if( m_aBorderRight.ToString().getLength() )
2286 + pAttrList->AddAttribute( A2OUSTR("fo:border-right"), m_aBorderRight.ToString() );
2287 + else
2288 + pAttrList->AddAttribute( A2OUSTR("fo:border-right"), A2OUSTR("none") );
2290 + if( m_aBorderTop.ToString().getLength() )
2291 + pAttrList->AddAttribute( A2OUSTR("fo:border-top"), m_aBorderTop.ToString() );
2292 + else
2293 + pAttrList->AddAttribute( A2OUSTR("fo:border-top"), A2OUSTR("none") );
2295 + if( m_aBorderBottom.ToString().getLength() )
2296 + pAttrList->AddAttribute( A2OUSTR("fo:border-bottom"), m_aBorderBottom.ToString() );
2297 + else
2298 + pAttrList->AddAttribute( A2OUSTR("fo:border-bottom"), A2OUSTR("none") );
2302 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfborders.hxx lotuswordpro/source/filter/xfilter/xfborders.hxx
2303 --- lotuswordpro.bak/source/filter/xfilter/xfborders.hxx 1970-01-01 08:00:00.000000000 +0800
2304 +++ lotuswordpro/source/filter/xfilter/xfborders.hxx 2008-10-22 11:42:34.000000000 +0800
2305 @@ -0,0 +1,195 @@
2306 +/*************************************************************************
2308 + * The Contents of this file are made available subject to the terms of
2309 + * either of the following licenses
2311 + * - GNU Lesser General Public License Version 2.1
2312 + * - Sun Industry Standards Source License Version 1.1
2314 + * Sun Microsystems Inc., October, 2000
2316 + * GNU Lesser General Public License Version 2.1
2317 + * =============================================
2318 + * Copyright 2000 by Sun Microsystems, Inc.
2319 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
2321 + * This library is free software; you can redistribute it and/or
2322 + * modify it under the terms of the GNU Lesser General Public
2323 + * License version 2.1, as published by the Free Software Foundation.
2325 + * This library is distributed in the hope that it will be useful,
2326 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2327 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2328 + * Lesser General Public License for more details.
2330 + * You should have received a copy of the GNU Lesser General Public
2331 + * License along with this library; if not, write to the Free Software
2332 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
2333 + * MA 02111-1307 USA
2336 + * Sun Industry Standards Source License Version 1.1
2337 + * =================================================
2338 + * The contents of this file are subject to the Sun Industry Standards
2339 + * Source License Version 1.1 (the "License"); You may not use this file
2340 + * except in compliance with the License. You may obtain a copy of the
2341 + * License at http://www.openoffice.org/license.html.
2343 + * Software provided under this License is provided on an "AS IS" basis,
2344 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
2345 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
2346 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
2347 + * See the License for the specific provisions governing your rights and
2348 + * obligations concerning the Software.
2350 + * The Initial Developer of the Original Code is: IBM Corporation
2352 + * Copyright: 2008 by IBM Corporation
2354 + * All Rights Reserved.
2356 + * Contributor(s): _______________________________________
2359 + ************************************************************************/
2360 +/*************************************************************************
2361 + * @file
2362 + * Border object,now only used by paragraph object.
2363 + ************************************************************************/
2364 +/*************************************************************************
2365 + * Change History
2366 + * 2005-01-14 create this file.
2367 + * 2005-01-17 changed for the XFColor object.
2368 + ************************************************************************/
2369 +#ifndef _XFBORDERS_HXX
2370 +#define _XFBORDERS_HXX
2372 +#include "xfglobal.hxx"
2373 +#include "xfcolor.hxx"
2375 +/**
2376 + * @brief
2377 + * Single border obejct for all objects with borders.
2378 + */
2379 +class XFBorder
2381 +public:
2382 + XFBorder();
2384 +public:
2385 + /**
2386 + * @descr Set border color.
2387 + */
2388 + void SetColor(XFColor& color);
2390 + /**
2391 + * @descr Set border width in cm.
2392 + */
2393 + void SetWidth(double width);
2395 + /**
2396 + * @descr Set whether the border has double line.
2397 + */
2398 + void SetDoubleLine(sal_Bool dual,sal_Bool bSameWidth);
2400 + /**
2401 + * @descr Set inner line width for border with double line.
2402 + */
2403 + void SetWidthInner(double inner);
2405 + /**
2406 + * @descr Set space between double lines fo border.
2407 + */
2408 + void SetWidthSpace(double space);
2410 + /**
2411 + * @descr Set outter line width for border with double line.
2412 + */
2413 + void SetWidthOutter(double outer);
2415 +private:
2416 + /**
2417 + * @descr Forst line width to OOo border width format.
2418 + */
2419 + rtl::OUString GetLineWidth();
2421 + rtl::OUString ToString();
2423 + friend bool operator==(XFBorder& b1, XFBorder& b2);
2424 + friend bool operator!=(XFBorder& b1, XFBorder& b2);
2425 + friend class XFBorders;
2427 +private:
2428 + double m_fOffset;
2429 + XFColor m_aColor;
2430 + sal_Bool m_bDouble;
2431 + sal_Bool m_bSameWidth;
2432 + double m_fWidthInner;
2433 + double m_fWidthSpace;
2434 + double m_fWidthOutter;
2437 +/**
2438 + * @brief
2439 + * Borders for object with borders.
2440 + * Borders may include (right,left,top,bottom) borders.
2441 + */
2442 +class XFBorders
2444 +public:
2445 + XFBorders(){}
2447 +public:
2448 + /**
2449 + * @descr Set color of border side.
2450 + */
2451 + void SetColor(enumXFBorder side, XFColor& color);
2453 + /**
2454 + * @descr Set width or border side.
2455 + */
2456 + void SetWidth(enumXFBorder side, double width);
2458 + /**
2459 + * @descr Set border side as doubel line.
2460 + * @param bSameWidth whether two borders are same width.
2461 + */
2462 + void SetDoubleLine(enumXFBorder side, sal_Bool dual,sal_Bool bSameWidth);
2464 + /**
2465 + * @descr Set inner border with of border side.
2466 + */
2467 + void SetWidthInner(enumXFBorder side, double inner);
2469 + /**
2470 + * @descr Set space between two borders fo border side.
2471 + */
2472 + void SetWidthSpace(enumXFBorder side, double space);
2474 + /**
2475 + * @descr Set outter border width of border side.
2476 + */
2477 + void SetWidthOutter(enumXFBorder side, double outer);
2479 + XFBorder * GetLeft() {return &m_aBorderLeft;};
2481 + XFBorder * GetRight() {return &m_aBorderRight;};
2483 + XFBorder * GetTop() {return &m_aBorderTop;};
2485 + XFBorder * GetBottom() {return &m_aBorderBottom;};
2487 + void ToXml(IXFStream *pStrm);
2489 + friend bool operator==(XFBorders& b1, XFBorders& b2);
2490 + friend bool operator!=(XFBorders& b1, XFBorders& b2);
2492 +private:
2493 + XFBorder m_aBorderLeft;
2494 + XFBorder m_aBorderRight;
2495 + XFBorder m_aBorderTop;
2496 + XFBorder m_aBorderBottom;
2500 +#endif
2501 \ No newline at end of file
2502 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfbreaks.hxx lotuswordpro/source/filter/xfilter/xfbreaks.hxx
2503 --- lotuswordpro.bak/source/filter/xfilter/xfbreaks.hxx 1970-01-01 08:00:00.000000000 +0800
2504 +++ lotuswordpro/source/filter/xfilter/xfbreaks.hxx 2008-10-22 11:42:34.000000000 +0800
2505 @@ -0,0 +1,146 @@
2506 +/*************************************************************************
2508 + * The Contents of this file are made available subject to the terms of
2509 + * either of the following licenses
2511 + * - GNU Lesser General Public License Version 2.1
2512 + * - Sun Industry Standards Source License Version 1.1
2514 + * Sun Microsystems Inc., October, 2000
2516 + * GNU Lesser General Public License Version 2.1
2517 + * =============================================
2518 + * Copyright 2000 by Sun Microsystems, Inc.
2519 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
2521 + * This library is free software; you can redistribute it and/or
2522 + * modify it under the terms of the GNU Lesser General Public
2523 + * License version 2.1, as published by the Free Software Foundation.
2525 + * This library is distributed in the hope that it will be useful,
2526 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2527 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2528 + * Lesser General Public License for more details.
2530 + * You should have received a copy of the GNU Lesser General Public
2531 + * License along with this library; if not, write to the Free Software
2532 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
2533 + * MA 02111-1307 USA
2536 + * Sun Industry Standards Source License Version 1.1
2537 + * =================================================
2538 + * The contents of this file are subject to the Sun Industry Standards
2539 + * Source License Version 1.1 (the "License"); You may not use this file
2540 + * except in compliance with the License. You may obtain a copy of the
2541 + * License at http://www.openoffice.org/license.html.
2543 + * Software provided under this License is provided on an "AS IS" basis,
2544 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
2545 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
2546 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
2547 + * See the License for the specific provisions governing your rights and
2548 + * obligations concerning the Software.
2550 + * The Initial Developer of the Original Code is: IBM Corporation
2552 + * Copyright: 2008 by IBM Corporation
2554 + * All Rights Reserved.
2556 + * Contributor(s): _______________________________________
2559 + ************************************************************************/
2560 +/*************************************************************************
2561 + * @file
2562 + * Breaks of paragraph.
2563 + ************************************************************************/
2564 +/*************************************************************************
2565 + * Change History
2566 + * 2005-01-27 create this file.
2567 + ************************************************************************/
2568 +#ifndef _XFBREAKS_HXX
2569 +#define _XFBREAKS_HXX
2571 +#include "xfglobal.hxx"
2572 +#include "ixfproperty.hxx"
2574 +/**
2575 + * @descr Page|Column break object.
2576 + */
2577 +class XFBreaks : public IXFProperty
2579 +public:
2580 + XFBreaks();
2582 + XFBreaks(enumXFBreaks breaks);
2584 +public:
2585 + /**
2586 + * @descr Set break type, pls refer to enumXFBreaks.
2587 + */
2588 + void SetBreakType(enumXFBreaks breaks);
2590 + /**
2591 + * @descr Output breaks object.
2592 + */
2593 + virtual void ToXml(IXFStream *pStrm);
2595 + friend bool operator==(XFBreaks& b1, XFBreaks& b2);
2596 + friend bool operator!=(XFBreaks& b1, XFBreaks& b2);
2598 +private:
2599 + enumXFBreaks m_eBreaks;
2602 +inline XFBreaks::XFBreaks()
2604 + m_eBreaks = enumXFBreakAuto;
2607 +inline XFBreaks::XFBreaks(enumXFBreaks breaks):m_eBreaks(breaks)
2611 +inline void XFBreaks::SetBreakType(enumXFBreaks breaks)
2613 + m_eBreaks = breaks;
2616 +inline void XFBreaks::ToXml(IXFStream *pStrm)
2618 + IXFAttrList *pAttrList = pStrm->GetAttrList();
2619 + switch(m_eBreaks)
2621 + case enumXFBreakAuto:
2622 + break;
2623 + case enumXFBreakBefPage:
2624 + pAttrList->AddAttribute( A2OUSTR("fo:break-before"), A2OUSTR("page") );
2625 + break;
2626 + case enumXFBreakBefColumn:
2627 + pAttrList->AddAttribute( A2OUSTR("fo:break-before"), A2OUSTR("column") );
2628 + break;
2629 + case enumXFBreakAftPage:
2630 + pAttrList->AddAttribute( A2OUSTR("fo:break-after"), A2OUSTR("page") );
2631 + break;
2632 + case enumXFBreakAftColumn:
2633 + pAttrList->AddAttribute( A2OUSTR("fo:break-after"), A2OUSTR("column") );
2634 + break;
2635 + case enumXFBreakKeepWithNext:
2636 + pAttrList->AddAttribute( A2OUSTR("fo:keep-with-next"), A2OUSTR("true") );
2637 + break;
2641 +inline bool operator==(XFBreaks& b1, XFBreaks& b2)
2643 + return b1.m_eBreaks == b2.m_eBreaks;
2646 +inline bool operator!=(XFBreaks& b1, XFBreaks& b2)
2648 + return !(b1==b2);
2651 +#endif
2652 \ No newline at end of file
2653 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfcell.cxx lotuswordpro/source/filter/xfilter/xfcell.cxx
2654 --- lotuswordpro.bak/source/filter/xfilter/xfcell.cxx 1970-01-01 08:00:00.000000000 +0800
2655 +++ lotuswordpro/source/filter/xfilter/xfcell.cxx 2008-10-22 11:42:34.000000000 +0800
2656 @@ -0,0 +1,304 @@
2657 +/*************************************************************************
2659 + * The Contents of this file are made available subject to the terms of
2660 + * either of the following licenses
2662 + * - GNU Lesser General Public License Version 2.1
2663 + * - Sun Industry Standards Source License Version 1.1
2665 + * Sun Microsystems Inc., October, 2000
2667 + * GNU Lesser General Public License Version 2.1
2668 + * =============================================
2669 + * Copyright 2000 by Sun Microsystems, Inc.
2670 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
2672 + * This library is free software; you can redistribute it and/or
2673 + * modify it under the terms of the GNU Lesser General Public
2674 + * License version 2.1, as published by the Free Software Foundation.
2676 + * This library is distributed in the hope that it will be useful,
2677 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2678 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2679 + * Lesser General Public License for more details.
2681 + * You should have received a copy of the GNU Lesser General Public
2682 + * License along with this library; if not, write to the Free Software
2683 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
2684 + * MA 02111-1307 USA
2687 + * Sun Industry Standards Source License Version 1.1
2688 + * =================================================
2689 + * The contents of this file are subject to the Sun Industry Standards
2690 + * Source License Version 1.1 (the "License"); You may not use this file
2691 + * except in compliance with the License. You may obtain a copy of the
2692 + * License at http://www.openoffice.org/license.html.
2694 + * Software provided under this License is provided on an "AS IS" basis,
2695 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
2696 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
2697 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
2698 + * See the License for the specific provisions governing your rights and
2699 + * obligations concerning the Software.
2701 + * The Initial Developer of the Original Code is: IBM Corporation
2703 + * Copyright: 2008 by IBM Corporation
2705 + * All Rights Reserved.
2707 + * Contributor(s): _______________________________________
2710 + ************************************************************************/
2711 +/*************************************************************************
2712 + * @file
2713 + * Table cell.
2714 + ************************************************************************/
2715 +/*************************************************************************
2716 + * Change History
2717 + * 2005-01-21 create this file.
2718 + ************************************************************************/
2719 +#include "xfcell.hxx"
2720 +#include "xfparagraph.hxx"
2721 +#include "xftable.hxx"
2722 +#include "xfrow.hxx"
2724 +XFCell::XFCell()
2726 + m_pSubTable = NULL;
2727 + m_nCol = 0;
2728 + m_nColSpaned = 1;
2729 + m_nRepeated = 0;
2730 + m_eValueType = enumXFValueTypeNone;
2731 + m_bProtect = sal_False;
2734 +XFCell::XFCell(const XFCell& other)
2736 + if( other.m_pSubTable )
2737 + m_pSubTable = new XFTable(*other.m_pSubTable);
2738 + else
2739 + m_pSubTable = NULL;
2740 + m_pOwnerRow = NULL;
2741 + m_nCol = other.m_nCol;
2742 + m_nColSpaned = other.m_nColSpaned;
2743 + m_nRepeated = other.m_nRepeated;
2744 + m_eValueType = other.m_eValueType;
2745 + m_bProtect = other.m_bProtect;
2746 + m_strValue = other.m_strValue;
2747 + m_strDisplay = other.m_strDisplay;
2748 + m_strFormula = other.m_strFormula;
2751 +XFCell& XFCell::operator=(const XFCell& other)
2753 + if( m_pSubTable )
2754 + delete m_pSubTable;
2756 + if( other.m_pSubTable )
2757 + m_pSubTable = new XFTable(*other.m_pSubTable);
2758 + else
2759 + m_pSubTable = NULL;
2760 + m_pOwnerRow = NULL;
2761 + m_nCol = other.m_nCol;
2762 + m_nColSpaned = other.m_nColSpaned;
2763 + m_nRepeated = other.m_nRepeated;
2764 + m_eValueType = other.m_eValueType;
2765 + m_bProtect = other.m_bProtect;
2766 + m_strValue = other.m_strValue;
2767 + m_strDisplay = other.m_strDisplay;
2768 + m_strFormula = other.m_strFormula;
2770 + return *this;
2773 +XFCell::~XFCell()
2775 + if( m_pSubTable )
2776 + delete m_pSubTable;
2779 +void XFCell::Add(IXFContent *pContent)
2781 + if( m_eValueType != enumXFValueTypeNone )
2783 + Reset();
2784 + m_eValueType = enumXFValueTypeNone;
2786 + if( m_pSubTable )
2788 + assert(false);
2789 + return;
2791 + if( pContent->GetContentType() == enumXFContentTable )
2793 + XFTable *pTable = static_cast<XFTable*>(pContent);
2794 + if( !pTable )
2795 + return;
2796 + //the sub table will fill all the cell, there can't be other contents.
2797 + pTable->SetOwnerCell(this);
2798 + m_pSubTable = pTable;
2800 + else if( pContent->GetContentType() == enumXFContentText )
2802 + XFParagraph *pPara = new XFParagraph();
2803 + pPara->Add(pContent);
2804 + XFContentContainer::Add(pPara);
2806 + else if( pContent->GetContentType() == enumXFContentFrame )
2808 + XFParagraph *pPara = new XFParagraph();
2809 + pPara->Add(pContent);
2810 + XFContentContainer::Add(pPara);
2812 + else
2814 + XFContentContainer::Add(pContent);
2819 +void XFCell::SetValue(double value)
2821 + SetValue(DoubleToOUString(value,18));
2824 +void XFCell::SetValue(rtl::OUString value)
2826 + m_eValueType = enumXFValueTypeFloat;
2827 + m_strValue = value;
2829 + //Reset();
2830 + //XFParagraph *pPara = new XFParagraph();
2831 + //pPara->Add(m_strValue);
2832 + //XFContentContainer::Add(pPara);
2835 +void XFCell::SetString(rtl::OUString str)
2837 + m_eValueType = enumXFValueTypeString;
2838 + m_strValue = str;
2840 + Reset();
2841 + XFParagraph *pPara = new XFParagraph();
2842 + pPara->Add(m_strValue);
2843 + XFContentContainer::Add(pPara);
2846 +void XFCell::SetPercent(double percent)
2848 + SetPercent(DoubleToOUString(percent));
2851 +void XFCell::SetPercent(rtl::OUString percent)
2853 + m_eValueType = enumXFValueTypePercentage;
2854 + m_strValue = percent;
2856 + Reset();
2857 + XFParagraph *pPara = new XFParagraph();
2858 + pPara->Add(m_strValue);
2859 + XFContentContainer::Add(pPara);
2862 +void XFCell::SetDate(rtl::OUString date)
2864 + m_eValueType = enumXFValueTypeDate;
2865 + m_strValue = date;
2867 + Reset();
2868 + XFParagraph *pPara = new XFParagraph();
2869 + pPara->Add(m_strValue);
2870 + XFContentContainer::Add(pPara);
2873 +void XFCell::SetTime(rtl::OUString time)
2875 + m_eValueType = enumXFValueTypeTime;
2876 + m_strValue = time;
2878 + Reset();
2879 + XFParagraph *pPara = new XFParagraph();
2880 + pPara->Add(m_strValue);
2881 + XFContentContainer::Add(pPara);
2884 +void XFCell::SetCurrency(rtl::OUString currency)
2886 + m_eValueType = enumXFValueTypeCurrency;
2887 + m_strValue = currency;
2889 + Reset();
2890 + XFParagraph *pPara = new XFParagraph();
2891 + pPara->Add(m_strValue);
2892 + XFContentContainer::Add(pPara);
2895 +void XFCell::SetDisplay(rtl::OUString display)
2897 + m_strDisplay = display;
2899 + Reset();
2900 + XFParagraph *pPara = new XFParagraph();
2901 + pPara->Add(m_strDisplay);
2902 + XFContentContainer::Add(pPara);
2905 +rtl::OUString XFCell::GetCellName()
2907 + rtl::OUString name;
2908 + XFRow *pRow = m_pOwnerRow;
2909 + XFTable *pTable = pRow->GetOwnerTable();
2911 + if( !pRow || !pTable )
2912 + return A2OUSTR("");
2913 + if( pTable->IsSubTable() )
2915 + name = pTable->GetTableName() + A2OUSTR(".") + Int32ToOUString(m_nCol) + A2OUSTR(".") + Int32ToOUString(pRow->GetRow());
2917 + else
2919 + name = GetTableColName(m_nCol) + Int32ToOUString(pRow->GetRow());
2921 + return name;
2924 +void XFCell::ToXml(IXFStream *pStrm)
2926 + IXFAttrList *pAttrList = pStrm->GetAttrList();
2928 + pAttrList->Clear();
2929 + if( GetStyleName().getLength() )
2930 + pAttrList->AddAttribute( A2OUSTR("table:style-name"), GetStyleName() );
2931 + if( m_nColSpaned>1 )
2932 + pAttrList->AddAttribute( A2OUSTR("table:number-columns-spanned"), Int32ToOUString(m_nColSpaned) );
2933 + if( m_nRepeated )
2934 + pAttrList->AddAttribute( A2OUSTR("table:number-columns-repeated"), Int32ToOUString(m_nRepeated) );
2935 + if( m_eValueType != enumXFValueTypeNone )
2937 + pAttrList->AddAttribute( A2OUSTR("table:value-type"), GetValueType(m_eValueType) );
2938 + pAttrList->AddAttribute( A2OUSTR("table:value"), m_strValue );
2940 + if( m_strFormula.getLength() > 0 )
2941 + pAttrList->AddAttribute( A2OUSTR("table:formula"), m_strFormula );
2943 + if( m_bProtect )
2944 + pAttrList->AddAttribute( A2OUSTR("table:protected"), A2OUSTR("true") );
2946 + //for test only.
2947 +// pAttrList->AddAttribute( A2OUSTR("table:cell-name"), GetCellName() );
2949 + pStrm->StartElement( A2OUSTR("table:table-cell") );
2951 + if( m_pSubTable )
2952 + m_pSubTable->ToXml(pStrm);
2953 + else
2955 + XFContentContainer::ToXml(pStrm);
2958 + pStrm->EndElement( A2OUSTR("table:table-cell") );
2961 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfcell.hxx lotuswordpro/source/filter/xfilter/xfcell.hxx
2962 --- lotuswordpro.bak/source/filter/xfilter/xfcell.hxx 1970-01-01 08:00:00.000000000 +0800
2963 +++ lotuswordpro/source/filter/xfilter/xfcell.hxx 2008-10-22 11:42:34.000000000 +0800
2964 @@ -0,0 +1,261 @@
2965 +/*************************************************************************
2967 + * The Contents of this file are made available subject to the terms of
2968 + * either of the following licenses
2970 + * - GNU Lesser General Public License Version 2.1
2971 + * - Sun Industry Standards Source License Version 1.1
2973 + * Sun Microsystems Inc., October, 2000
2975 + * GNU Lesser General Public License Version 2.1
2976 + * =============================================
2977 + * Copyright 2000 by Sun Microsystems, Inc.
2978 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
2980 + * This library is free software; you can redistribute it and/or
2981 + * modify it under the terms of the GNU Lesser General Public
2982 + * License version 2.1, as published by the Free Software Foundation.
2984 + * This library is distributed in the hope that it will be useful,
2985 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2986 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2987 + * Lesser General Public License for more details.
2989 + * You should have received a copy of the GNU Lesser General Public
2990 + * License along with this library; if not, write to the Free Software
2991 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
2992 + * MA 02111-1307 USA
2995 + * Sun Industry Standards Source License Version 1.1
2996 + * =================================================
2997 + * The contents of this file are subject to the Sun Industry Standards
2998 + * Source License Version 1.1 (the "License"); You may not use this file
2999 + * except in compliance with the License. You may obtain a copy of the
3000 + * License at http://www.openoffice.org/license.html.
3002 + * Software provided under this License is provided on an "AS IS" basis,
3003 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
3004 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
3005 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
3006 + * See the License for the specific provisions governing your rights and
3007 + * obligations concerning the Software.
3009 + * The Initial Developer of the Original Code is: IBM Corporation
3011 + * Copyright: 2008 by IBM Corporation
3013 + * All Rights Reserved.
3015 + * Contributor(s): _______________________________________
3018 + ************************************************************************/
3019 +/*************************************************************************
3020 + * @file
3021 + * Table cell.
3022 + ************************************************************************/
3023 +/*************************************************************************
3024 + * Change History
3025 + * 2005-01-21 create this file.
3026 + ************************************************************************/
3027 +#ifndef _XFCell_HXX
3028 +#define _XFCell_HXX
3030 +#include "xfcontent.hxx"
3031 +#include "xfcontentcontainer.hxx"
3032 +#include <vector>
3034 +class XFTable;
3035 +class XFRow;
3037 +/**
3038 + * @descr Table cell object.
3039 + */
3040 +class XFCell : public XFContentContainer
3042 +public:
3043 + XFCell();
3045 + XFCell(const XFCell& other);
3047 + XFCell& operator=(const XFCell& other);
3049 + virtual ~XFCell();
3051 +public:
3052 + /**
3053 + * @descr Add content for table cell.
3054 + */
3055 + void Add(IXFContent *pContent);
3057 + /**
3058 + * @descr If cell spans more the one column, then set column span.
3059 + */
3060 + void SetColumnSpaned(sal_Int32 num);
3062 + /**
3063 + * @descr Set whether the following cells use the same style and content.
3064 + */
3065 + void SetRepeated(sal_Int32 num);
3067 + /**
3068 + * @descr Set cell number value.
3069 + */
3070 + void SetValue(double value);
3072 + /**
3073 + * @descr Set cell number value.
3074 + */
3075 + void SetValue(rtl::OUString value);
3077 + /**
3078 + * @descr Set cell string value.
3079 + */
3080 + void SetString(rtl::OUString str);
3082 + /**
3083 + * @descr Set cell as a percent value with value percent.
3084 + */
3085 + void SetPercent(double percent);
3087 + /**
3088 + * @descr Set cell as a percent value with value percent.
3089 + */
3090 + void SetPercent(rtl::OUString percent);
3092 + /**
3093 + * @descr Set cell as a date value.
3094 + */
3095 + void SetDate(rtl::OUString date);
3097 + /**
3098 + * @descr Set cell as a time value.
3099 + */
3100 + void SetTime(rtl::OUString time);
3102 + /**
3103 + * @descr Set cell as a currency value.
3104 + */
3105 + void SetCurrency(rtl::OUString currency);
3107 + /**
3108 + * @descr Set cell display string.
3109 + */
3110 + void SetDisplay(rtl::OUString display);
3112 + /**
3113 + * @descr Set cell formula.
3114 + */
3115 + void SetFormula(rtl::OUString formula);
3117 + /**
3118 + * @descr Set cell protected.
3119 + */
3120 + void SetProtect(sal_Bool protect=sal_True);
3122 + /**
3123 + * @descr Set cell column id.
3124 + */
3125 + void SetCol(sal_Int32 col);
3127 + /**
3128 + * @descr Set cell owner row.
3129 + */
3130 + void SetOwnerRow(XFRow *pRow);
3132 + /**
3133 + * @descr Return cell name. It's a tool function for formula.
3134 + */
3135 + rtl::OUString GetCellName();
3137 + /**
3138 + * @descr Return cell column id.
3139 + */
3140 + sal_Int32 GetCol();
3142 + /**
3143 + * @descr return cell'owner row.
3144 + */
3145 + XFRow* GetOwnerRow();
3147 + /**
3148 + * @descr If cell has a sub-table, return it, else return NULL.
3149 + */
3150 + XFTable* GetSubTable();
3152 + /**
3153 + * @descr return cell column span property.
3154 + */
3155 + sal_Int32 GetColSpaned();
3157 + /**
3158 + * @descr Output cell as xml element.
3159 + */
3160 + virtual void ToXml(IXFStream *pStrm);
3162 +private:
3163 + XFRow *m_pOwnerRow;
3164 + XFTable *m_pSubTable;
3165 + sal_Int32 m_nCol;
3166 + sal_Int32 m_nColSpaned;
3167 + sal_Int32 m_nRepeated;
3168 + enumXFValueType m_eValueType;
3169 + rtl::OUString m_strValue;
3170 + rtl::OUString m_strDisplay;
3171 + rtl::OUString m_strFormula;
3172 + sal_Bool m_bProtect;
3175 +inline void XFCell::SetColumnSpaned(sal_Int32 num)
3177 + m_nColSpaned = num;
3180 +inline void XFCell::SetRepeated(sal_Int32 repeated)
3182 + m_nRepeated = repeated;
3185 +inline void XFCell::SetFormula(rtl::OUString formula)
3187 + m_strFormula = formula;
3190 +inline void XFCell::SetProtect(sal_Bool protect/* =sal_True */)
3192 + m_bProtect = protect;
3195 +inline void XFCell::SetCol(sal_Int32 col)
3197 + m_nCol = col;
3200 +inline void XFCell::SetOwnerRow(XFRow *pRow)
3202 + m_pOwnerRow = pRow;
3205 +inline sal_Int32 XFCell::GetCol()
3207 + return m_nCol;
3210 +inline XFRow* XFCell::GetOwnerRow()
3212 + return m_pOwnerRow;
3215 +inline XFTable* XFCell::GetSubTable()
3217 + return m_pSubTable;
3220 +inline sal_Int32 XFCell::GetColSpaned()
3222 + return m_nColSpaned;
3225 +#endif
3226 \ No newline at end of file
3227 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfcellstyle.cxx lotuswordpro/source/filter/xfilter/xfcellstyle.cxx
3228 --- lotuswordpro.bak/source/filter/xfilter/xfcellstyle.cxx 1970-01-01 08:00:00.000000000 +0800
3229 +++ lotuswordpro/source/filter/xfilter/xfcellstyle.cxx 2008-10-22 11:42:34.000000000 +0800
3230 @@ -0,0 +1,308 @@
3231 +/*************************************************************************
3233 + * The Contents of this file are made available subject to the terms of
3234 + * either of the following licenses
3236 + * - GNU Lesser General Public License Version 2.1
3237 + * - Sun Industry Standards Source License Version 1.1
3239 + * Sun Microsystems Inc., October, 2000
3241 + * GNU Lesser General Public License Version 2.1
3242 + * =============================================
3243 + * Copyright 2000 by Sun Microsystems, Inc.
3244 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
3246 + * This library is free software; you can redistribute it and/or
3247 + * modify it under the terms of the GNU Lesser General Public
3248 + * License version 2.1, as published by the Free Software Foundation.
3250 + * This library is distributed in the hope that it will be useful,
3251 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
3252 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3253 + * Lesser General Public License for more details.
3255 + * You should have received a copy of the GNU Lesser General Public
3256 + * License along with this library; if not, write to the Free Software
3257 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
3258 + * MA 02111-1307 USA
3261 + * Sun Industry Standards Source License Version 1.1
3262 + * =================================================
3263 + * The contents of this file are subject to the Sun Industry Standards
3264 + * Source License Version 1.1 (the "License"); You may not use this file
3265 + * except in compliance with the License. You may obtain a copy of the
3266 + * License at http://www.openoffice.org/license.html.
3268 + * Software provided under this License is provided on an "AS IS" basis,
3269 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
3270 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
3271 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
3272 + * See the License for the specific provisions governing your rights and
3273 + * obligations concerning the Software.
3275 + * The Initial Developer of the Original Code is: IBM Corporation
3277 + * Copyright: 2008 by IBM Corporation
3279 + * All Rights Reserved.
3281 + * Contributor(s): _______________________________________
3284 + ************************************************************************/
3285 +/*************************************************************************
3286 + * @file
3287 + * Table cell style. Number format, string value, and so on...
3288 + ************************************************************************/
3289 +/*************************************************************************
3290 + * Change History
3291 + * 2005-01-28 create this file.
3292 + ************************************************************************/
3293 +#include "xfcellstyle.hxx"
3294 +#include "xfborders.hxx"
3295 +#include "xffont.hxx"
3296 +#include "xfbgimage.hxx"
3299 +XFCellStyle::XFCellStyle()
3301 + m_eHoriAlign = enumXFAlignNone;
3302 + m_eVertAlign = enumXFAlignNone;
3303 + m_fTextIndent = 0;
3304 + m_pBorders = NULL;
3305 + m_pFont = NULL;
3306 + m_pBackImage = NULL;
3307 + m_bWrapText = sal_False;
3310 +XFCellStyle::~XFCellStyle()
3312 + if( m_pBorders )
3313 + delete m_pBorders;
3317 +void XFCellStyle::SetParentStyle(rtl::OUString parent)
3319 + m_strParentStyleName = parent;
3322 +void XFCellStyle::SetFont(XFFont *pFont)
3324 + m_pFont = pFont;
3327 +void XFCellStyle::SetIndent(double indent )
3329 + m_fTextIndent = indent;
3332 +void XFCellStyle::SetMargins(double left, double right, double top, double bottom)
3334 + if( left != -1 )
3335 + m_aMargin.SetLeft(left);
3336 + if( right != -1 )
3337 + m_aMargin.SetRight(right);
3338 + if( top != -1 )
3339 + m_aMargin.SetTop(top);
3340 + if( bottom != -1 )
3341 + m_aMargin.SetBottom( bottom );
3344 +void XFCellStyle::SetPadding(double left, double right,double top, double bottom)
3346 + if( left != -1 )
3347 + m_aPadding.SetLeft(left);
3348 + if( right != -1 )
3349 + m_aPadding.SetRight(right);
3350 + if( top != -1 )
3351 + m_aPadding.SetTop(top);
3352 + if( bottom != -1 )
3353 + m_aPadding.SetBottom( bottom );
3356 +void XFCellStyle::SetShadow(enumXFShadowPos pos, double offset, XFColor& color)
3358 + m_aShadow.SetPosition(pos);
3359 + m_aShadow.SetOffset(offset);
3360 + m_aShadow.SetColor(color);
3363 +void XFCellStyle::SetBackColor(XFColor& color)
3365 + m_aBackColor = color;
3368 +void XFCellStyle::SetBackImage(XFBGImage *pImage)
3370 + if( m_pBackImage )
3371 + delete m_pBackImage;
3372 + m_pBackImage = pImage;
3375 +void XFCellStyle::SetBorders(XFBorders *pBorders)
3377 + if( m_pBorders )
3378 + delete m_pBorders;
3379 + m_pBorders = pBorders;
3382 +enumXFStyle XFCellStyle::GetStyleFamily()
3384 + return enumXFStyleTableCell;
3387 +/**
3388 + *Affirm whether two XFCellStyle objects are equal.
3389 + */
3390 +sal_Bool XFCellStyle::Equal(IXFStyle *pStyle)
3392 + if( this == pStyle )
3393 + return sal_True;
3394 + if( !pStyle || pStyle->GetStyleFamily() != enumXFStyleTableCell )
3395 + return sal_False;
3397 + XFCellStyle *pOther = static_cast<XFCellStyle*>(pStyle);
3398 + if( !pOther )
3399 + return sal_False;
3401 + if( m_strDataStyle != pOther->m_strDataStyle )
3402 + return sal_False;
3404 + if( m_strParentStyleName != pOther->m_strParentStyleName )
3405 + return sal_False;
3406 + if( m_fTextIndent != pOther->m_fTextIndent )
3407 + return sal_False;
3409 + //align:
3410 + if( m_eHoriAlign != pOther->m_eHoriAlign )
3411 + return sal_False;
3412 + if( m_eVertAlign != pOther->m_eVertAlign )
3413 + return sal_False;
3415 + if( m_aBackColor != pOther->m_aBackColor )
3416 + return sal_False;
3417 + //shadow:
3418 + if( m_aShadow != pOther->m_aShadow )
3419 + return sal_False;
3420 + //margin:
3421 + if( m_aMargin != pOther->m_aMargin )
3422 + return sal_False;
3423 + //padding:
3424 + if( m_aPadding != pOther->m_aPadding )
3425 + return sal_False;
3427 + //wrap:
3428 + if( m_bWrapText != pOther->m_bWrapText )
3429 + return sal_False;
3431 + //font:
3432 + if( m_pFont )
3434 + if( !pOther->m_pFont )
3435 + return sal_False;
3436 + if(*m_pFont != *pOther->m_pFont )
3437 + return sal_False;
3439 + else if( pOther->m_pFont )
3440 + return sal_False;
3442 + //border:
3443 + if( m_pBorders )
3445 + if( !pOther->m_pBorders )
3446 + return sal_False;
3447 + if( *m_pBorders != *pOther->m_pBorders )
3448 + return sal_False;
3450 + else if( pOther->m_pBorders )
3451 + return sal_False;
3453 + //if there is backimage
3454 + if( m_pBackImage )
3456 + if( !pOther->m_pBackImage )
3457 + return sal_False;
3458 + if( !m_pBackImage->Equal(pOther) )
3459 + return sal_False;
3461 + else
3463 + if( pOther->m_pBackImage )
3464 + return sal_False;
3467 + return sal_True;
3470 +void XFCellStyle::ToXml(IXFStream *pStrm)
3472 + IXFAttrList *pAttrList = pStrm->GetAttrList();
3473 + rtl::OUString style = GetStyleName();
3475 + pAttrList->Clear();
3476 + if( style.getLength() )
3477 + pAttrList->AddAttribute(A2OUSTR("style:name"),GetStyleName());
3478 + if( GetParentStyleName().getLength() > 0 )
3479 + pAttrList->AddAttribute(A2OUSTR("style:parent-style-name"),GetParentStyleName());
3481 + pAttrList->AddAttribute(A2OUSTR("style:family"), A2OUSTR("table-cell"));
3482 + if( m_strParentStyleName.getLength() > 0 )
3483 + pAttrList->AddAttribute(A2OUSTR("style:parent-style-name"),m_strParentStyleName);
3484 + if( m_strDataStyle.getLength()>0 )
3485 + pAttrList->AddAttribute( A2OUSTR("style:data-style-name"), m_strDataStyle );
3487 + pStrm->StartElement(A2OUSTR("style:style"));
3489 + //Paragraph properties:
3490 + pAttrList->Clear();
3492 + //text indent:
3493 + if( m_fTextIndent>FLOAT_MIN )
3495 + pAttrList->AddAttribute(A2OUSTR("fo:text-indent"), DoubleToOUString(m_fTextIndent) + A2OUSTR("cm") );
3497 + //padding:
3498 + m_aPadding.ToXml(pStrm);
3499 + //margin:
3500 + m_aMargin.ToXml(pStrm);
3502 + //text horizontal align:
3503 + if( m_eHoriAlign != enumXFAlignNone )
3505 + pAttrList->AddAttribute(A2OUSTR("fo:text-align"), GetAlignName(m_eHoriAlign) );
3507 + //text vertical align
3508 + if( m_eVertAlign != enumXFAlignNone )
3509 + pAttrList->AddAttribute( A2OUSTR("fo:vertical-align"), GetAlignName(m_eVertAlign) );
3511 + //wrap text:
3512 + if( m_bWrapText )
3513 + pAttrList->AddAttribute( A2OUSTR("fo:wrap-option"), A2OUSTR("wrap") );
3515 + //shadow:
3516 + m_aShadow.ToXml(pStrm);
3517 + //borders:
3518 + if( m_pBorders )
3519 + m_pBorders->ToXml(pStrm);
3521 + //background color:
3522 + if( m_aBackColor.IsValid() && !m_pBackImage )
3524 + pAttrList->AddAttribute(A2OUSTR("fo:background-color"), m_aBackColor.ToString() );
3526 + //Font properties:
3527 + if( m_pFont )
3528 + m_pFont->ToXml(pStrm);
3530 + pStrm->StartElement(A2OUSTR("style:properties"));
3532 + if( m_pBackImage )
3533 + m_pBackImage->ToXml(pStrm);
3535 + pStrm->EndElement(A2OUSTR("style:properties"));
3537 + pStrm->EndElement(A2OUSTR("style:style"));
3539 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfcellstyle.hxx lotuswordpro/source/filter/xfilter/xfcellstyle.hxx
3540 --- lotuswordpro.bak/source/filter/xfilter/xfcellstyle.hxx 1970-01-01 08:00:00.000000000 +0800
3541 +++ lotuswordpro/source/filter/xfilter/xfcellstyle.hxx 2008-10-22 11:42:34.000000000 +0800
3542 @@ -0,0 +1,204 @@
3543 +/*************************************************************************
3545 + * The Contents of this file are made available subject to the terms of
3546 + * either of the following licenses
3548 + * - GNU Lesser General Public License Version 2.1
3549 + * - Sun Industry Standards Source License Version 1.1
3551 + * Sun Microsystems Inc., October, 2000
3553 + * GNU Lesser General Public License Version 2.1
3554 + * =============================================
3555 + * Copyright 2000 by Sun Microsystems, Inc.
3556 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
3558 + * This library is free software; you can redistribute it and/or
3559 + * modify it under the terms of the GNU Lesser General Public
3560 + * License version 2.1, as published by the Free Software Foundation.
3562 + * This library is distributed in the hope that it will be useful,
3563 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
3564 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3565 + * Lesser General Public License for more details.
3567 + * You should have received a copy of the GNU Lesser General Public
3568 + * License along with this library; if not, write to the Free Software
3569 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
3570 + * MA 02111-1307 USA
3573 + * Sun Industry Standards Source License Version 1.1
3574 + * =================================================
3575 + * The contents of this file are subject to the Sun Industry Standards
3576 + * Source License Version 1.1 (the "License"); You may not use this file
3577 + * except in compliance with the License. You may obtain a copy of the
3578 + * License at http://www.openoffice.org/license.html.
3580 + * Software provided under this License is provided on an "AS IS" basis,
3581 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
3582 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
3583 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
3584 + * See the License for the specific provisions governing your rights and
3585 + * obligations concerning the Software.
3587 + * The Initial Developer of the Original Code is: IBM Corporation
3589 + * Copyright: 2008 by IBM Corporation
3591 + * All Rights Reserved.
3593 + * Contributor(s): _______________________________________
3596 + ************************************************************************/
3597 +/*************************************************************************
3598 + * @file
3599 + * Table cell style. Number format, string value, and so on...
3600 + ************************************************************************/
3601 +/*************************************************************************
3602 + * Change History
3603 + * 2005-01-28 create this file.
3604 + ************************************************************************/
3605 +#ifndef _XFCELLSTYLE_HXX
3606 +#define _XFCELLSTYLE_HXX
3608 +#include "xfstyle.hxx"
3609 +#include "xfcolor.hxx"
3610 +#include "xfmargins.hxx"
3611 +#include "xfpadding.hxx"
3612 +#include "xfshadow.hxx"
3614 +class XFBorders;
3615 +class XFFont;
3616 +class XFBorders;
3617 +class XFMargins;
3618 +class XFBGImage;
3620 +/**
3621 + * @descr Style obejct for cell.
3622 + */
3623 +class XFCellStyle : public XFStyle
3625 +public:
3626 + XFCellStyle();
3628 + virtual ~XFCellStyle();
3630 +public:
3631 + /**
3632 + * @descr Set cell data format style name.
3633 + */
3634 + void SetDataStyle(rtl::OUString style);
3636 + /**
3637 + * @descr: Parant paragraph style.
3638 + */
3639 + void SetParentStyle(rtl::OUString parent);
3641 + /**
3642 + * @descr: set the paragraph defaut font.
3643 + * @param: font font obejct to be setted.Font object are deleted by font-factory,so
3644 + * dont't delete it in the destructure function of para style.
3645 + */
3646 + void SetFont(XFFont *font);
3648 + /**
3649 + * @descr: Set the indent of the paragraph.This is the indent for
3650 + the first line.
3651 + * @param: indent value of the first-line indent.
3652 + */
3653 + void SetIndent(double indent );
3655 + /**
3656 + * @descr: Set the pading of the paragraph.This is the distance
3657 + between the border and the top of the text.
3658 + * @param: indent value of the padding.
3659 + */
3660 + void SetPadding(double left, double right = -1, double top = -1, double bottom = -1);
3662 + /**
3663 + * @descr: Set the Margins of the paragraph.
3664 + * @param: -1: don't change.
3665 + other: set value.
3666 + */
3667 + void SetMargins(double left, double right=-1,double top=-1, double bottom=-1);
3669 + /**
3670 + * @descr: Set alignment property of the cell.
3671 + * @param: eAlign alignment type,left,right,center or justify.
3672 + */
3673 + void SetAlignType(enumXFAlignType hori=enumXFAlignNone, enumXFAlignType vert = enumXFAlignBottom);
3675 + /**
3676 + * @descr: Set the shadow of the paragraph.there is 4 postions, you
3677 + can find it in the definition of enumShadowPos.
3678 + * @param: pos
3679 + * @param: offset the distance between the paragraph border and the shadow.
3680 + * @param: color color to fill the shadow.
3681 + */
3682 + void SetShadow(enumXFShadowPos pos, double offset, XFColor& color);
3684 + /**
3685 + * @descr: The borders is complex,so you have to create one before use.
3686 + Very few paragraphs will readly have borders property,this way
3687 + we can save much memory.
3688 + * @param: pBorders borders of the paragraph,please reference the XFBorders.
3689 + */
3690 + void SetBorders(XFBorders *pBorders);
3692 + /**
3693 + * @descr: Set background color of the cell.
3694 + * @param: color value of the back color.
3695 + */
3696 + void SetBackColor(XFColor& color);
3698 + /**
3699 + * descr: set cell background image.
3700 + */
3701 + void SetBackImage(XFBGImage *pImage);
3703 + /**
3704 + * @descr Set cell value to warp if it's content is too long to be placed in an single cell.
3705 + */
3706 + void SetWrapText(sal_Bool wrap);
3708 + virtual enumXFStyle GetStyleFamily();
3710 + virtual sal_Bool Equal(IXFStyle *pStyle);
3712 + virtual void ToXml(IXFStream *pStrm);
3714 +private:
3715 + rtl::OUString m_strDataStyle;
3716 + rtl::OUString m_strParentStyleName;
3717 + enumXFAlignType m_eHoriAlign;
3718 + enumXFAlignType m_eVertAlign;
3720 + double m_fTextIndent;
3721 + XFColor m_aBackColor;
3722 + XFBGImage *m_pBackImage;
3723 + XFMargins m_aMargin;
3724 + XFPadding m_aPadding;
3725 + XFFont *m_pFont;
3726 + XFShadow m_aShadow;
3727 + XFBorders *m_pBorders;
3728 + sal_Bool m_bWrapText;
3731 +inline void XFCellStyle::SetAlignType(enumXFAlignType hori, enumXFAlignType vert)
3733 + m_eHoriAlign = hori;
3734 + m_eVertAlign = vert;
3737 +inline void XFCellStyle::SetDataStyle(rtl::OUString style)
3739 + m_strDataStyle = style;
3742 +inline void XFCellStyle::SetWrapText(sal_Bool wrap)
3744 + m_bWrapText = wrap;
3746 +#endif
3747 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfchange.cxx lotuswordpro/source/filter/xfilter/xfchange.cxx
3748 --- lotuswordpro.bak/source/filter/xfilter/xfchange.cxx 1970-01-01 08:00:00.000000000 +0800
3749 +++ lotuswordpro/source/filter/xfilter/xfchange.cxx 2008-10-22 11:42:34.000000000 +0800
3750 @@ -0,0 +1,166 @@
3751 +/*************************************************************************
3753 + * The Contents of this file are made available subject to the terms of
3754 + * either of the following licenses
3756 + * - GNU Lesser General Public License Version 2.1
3757 + * - Sun Industry Standards Source License Version 1.1
3759 + * Sun Microsystems Inc., October, 2000
3761 + * GNU Lesser General Public License Version 2.1
3762 + * =============================================
3763 + * Copyright 2000 by Sun Microsystems, Inc.
3764 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
3766 + * This library is free software; you can redistribute it and/or
3767 + * modify it under the terms of the GNU Lesser General Public
3768 + * License version 2.1, as published by the Free Software Foundation.
3770 + * This library is distributed in the hope that it will be useful,
3771 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
3772 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3773 + * Lesser General Public License for more details.
3775 + * You should have received a copy of the GNU Lesser General Public
3776 + * License along with this library; if not, write to the Free Software
3777 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
3778 + * MA 02111-1307 USA
3781 + * Sun Industry Standards Source License Version 1.1
3782 + * =================================================
3783 + * The contents of this file are subject to the Sun Industry Standards
3784 + * Source License Version 1.1 (the "License"); You may not use this file
3785 + * except in compliance with the License. You may obtain a copy of the
3786 + * License at http://www.openoffice.org/license.html.
3788 + * Software provided under this License is provided on an "AS IS" basis,
3789 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
3790 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
3791 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
3792 + * See the License for the specific provisions governing your rights and
3793 + * obligations concerning the Software.
3795 + * The Initial Developer of the Original Code is: IBM Corporation
3797 + * Copyright: 2008 by IBM Corporation
3799 + * All Rights Reserved.
3801 + * Contributor(s): _______________________________________
3804 + ************************************************************************/
3805 +/*************************************************************************
3806 + * @file
3807 + * For LWP filter architecture prototype
3808 + ************************************************************************/
3809 +/*************************************************************************
3810 + * Change History
3811 + Jun 2005 Created
3812 + ************************************************************************/
3813 +#include "xfchange.hxx"
3815 +void XFChangeList::ToXml(IXFStream *pStrm)
3817 + if (XFContentContainer::GetCount() == 0)
3818 + return;
3819 + IXFAttrList *pAttrList = pStrm->GetAttrList();
3820 + pAttrList->Clear();
3821 +//Add by ,for disable change tracking,2005/11/21
3822 + pAttrList->AddAttribute( A2OUSTR("text:track-changes"),A2OUSTR("false"));
3823 +//Add end
3824 + pStrm->StartElement( A2OUSTR("text:tracked-changes") );
3825 + XFContentContainer::ToXml(pStrm);
3826 + pStrm->EndElement(A2OUSTR("text:tracked-changes"));
3829 +void XFChangeRegion::ToXml(IXFStream *pStrm)
3833 +void XFChangeInsert::ToXml(IXFStream *pStrm)
3835 + IXFAttrList *pAttrList = pStrm->GetAttrList();
3837 + pAttrList->Clear();
3838 + if(m_sID.getLength() == 0)
3839 + return;
3840 + pAttrList->AddAttribute( A2OUSTR("text:id"),m_sID);
3842 + pStrm->StartElement( A2OUSTR("text:changed-region") );
3843 + pStrm->StartElement( A2OUSTR("text:insertion") );
3844 + pAttrList->Clear();
3845 + pAttrList->AddAttribute( A2OUSTR("office:chg-author"),m_sEditor);
3846 + pAttrList->AddAttribute( A2OUSTR("office:chg-date-time"),A2OUSTR("0000-00-00T00:00:00"));
3847 + pStrm->StartElement( A2OUSTR("office:change-info") );
3848 + pStrm->EndElement( A2OUSTR("office:change-info") );
3849 + pStrm->EndElement( A2OUSTR("text:insertion") );
3850 + pStrm->EndElement( A2OUSTR("text:changed-region") );
3853 +void XFChangeDelete::ToXml(IXFStream *pStrm)
3855 + IXFAttrList *pAttrList = pStrm->GetAttrList();
3857 + pAttrList->Clear();
3858 + if(m_sID.getLength() == 0)
3859 + return;
3860 + pAttrList->AddAttribute( A2OUSTR("text:id"),m_sID);
3862 + pStrm->StartElement( A2OUSTR("text:changed-region") );
3863 + pStrm->StartElement( A2OUSTR("text:deletion") );
3864 + pAttrList->Clear();
3865 + pAttrList->AddAttribute( A2OUSTR("office:chg-author"),m_sEditor);
3866 + pAttrList->AddAttribute( A2OUSTR("office:chg-date-time"),A2OUSTR("0000-00-00T00:00:00"));
3867 + pStrm->StartElement( A2OUSTR("office:change-info") );
3868 + pStrm->EndElement( A2OUSTR("office:change-info") );
3870 +/// XFContentContainer::ToXml(pStrm);//delete , note by ,2005/7/1
3872 + pStrm->EndElement( A2OUSTR("text:deletion") );
3873 + pStrm->EndElement( A2OUSTR("text:changed-region") );
3876 +void XFChange::ToXml(IXFStream *pStrm)
3878 + IXFAttrList *pAttrList = pStrm->GetAttrList();
3880 + pAttrList->Clear();
3881 + if(m_sID.getLength() == 0)
3882 + return;
3883 + pAttrList->AddAttribute( A2OUSTR("text:change-id"),m_sID);
3885 + pStrm->StartElement( A2OUSTR("text:change") );
3886 + pStrm->EndElement( A2OUSTR("text:change") );
3889 +void XFChangeStart::ToXml(IXFStream *pStrm)
3891 + IXFAttrList *pAttrList = pStrm->GetAttrList();
3893 + pAttrList->Clear();
3894 + if(m_sID.getLength() == 0)
3895 + return;
3896 + pAttrList->AddAttribute( A2OUSTR("text:change-id"),m_sID);
3898 + pStrm->StartElement( A2OUSTR("text:change-start") );
3899 + pStrm->EndElement( A2OUSTR("text:change-start") );
3902 +void XFChangeEnd::ToXml(IXFStream *pStrm)
3904 + IXFAttrList *pAttrList = pStrm->GetAttrList();
3906 + pAttrList->Clear();
3907 + if(m_sID.getLength() == 0)
3908 + return;
3909 + pAttrList->AddAttribute( A2OUSTR("text:change-id"),m_sID);
3911 + pStrm->StartElement( A2OUSTR("text:change-end") );
3912 + pStrm->EndElement( A2OUSTR("text:change-end") );
3917 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfchange.hxx lotuswordpro/source/filter/xfilter/xfchange.hxx
3918 --- lotuswordpro.bak/source/filter/xfilter/xfchange.hxx 1970-01-01 08:00:00.000000000 +0800
3919 +++ lotuswordpro/source/filter/xfilter/xfchange.hxx 2008-10-22 11:42:34.000000000 +0800
3920 @@ -0,0 +1,146 @@
3921 +/*************************************************************************
3923 + * The Contents of this file are made available subject to the terms of
3924 + * either of the following licenses
3926 + * - GNU Lesser General Public License Version 2.1
3927 + * - Sun Industry Standards Source License Version 1.1
3929 + * Sun Microsystems Inc., October, 2000
3931 + * GNU Lesser General Public License Version 2.1
3932 + * =============================================
3933 + * Copyright 2000 by Sun Microsystems, Inc.
3934 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
3936 + * This library is free software; you can redistribute it and/or
3937 + * modify it under the terms of the GNU Lesser General Public
3938 + * License version 2.1, as published by the Free Software Foundation.
3940 + * This library is distributed in the hope that it will be useful,
3941 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
3942 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3943 + * Lesser General Public License for more details.
3945 + * You should have received a copy of the GNU Lesser General Public
3946 + * License along with this library; if not, write to the Free Software
3947 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
3948 + * MA 02111-1307 USA
3951 + * Sun Industry Standards Source License Version 1.1
3952 + * =================================================
3953 + * The contents of this file are subject to the Sun Industry Standards
3954 + * Source License Version 1.1 (the "License"); You may not use this file
3955 + * except in compliance with the License. You may obtain a copy of the
3956 + * License at http://www.openoffice.org/license.html.
3958 + * Software provided under this License is provided on an "AS IS" basis,
3959 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
3960 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
3961 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
3962 + * See the License for the specific provisions governing your rights and
3963 + * obligations concerning the Software.
3965 + * The Initial Developer of the Original Code is: IBM Corporation
3967 + * Copyright: 2008 by IBM Corporation
3969 + * All Rights Reserved.
3971 + * Contributor(s): _______________________________________
3974 + ************************************************************************/
3975 +/*************************************************************************
3976 + * @file
3977 + * For LWP filter architecture prototype
3978 + ************************************************************************/
3979 +/*************************************************************************
3980 + * Change History
3981 + Jun 2005 Created
3982 + ************************************************************************/
3983 +#ifndef _XFCHANGE_HXX_
3984 +#define _XFCHANGE_HXX_
3986 +#include "xfglobal.hxx"
3987 +#include "ixfstream.hxx"
3988 +#include "xfcontent.hxx"
3989 +#include "xfcontentcontainer.hxx"
3990 +#include <rtl/ustring.hxx>
3992 +class XFChangeList : public XFContentContainer
3994 +public:
3995 + XFChangeList(){};
3996 + ~XFChangeList(){};
3997 + virtual void ToXml(IXFStream *pStrm);
4000 +class XFChangeRegion : public XFContentContainer
4002 +public:
4003 + XFChangeRegion(){};
4004 + ~XFChangeRegion(){};
4005 + virtual void ToXml(IXFStream *pStrm);
4006 + void SetChangeID(rtl::OUString sID){m_sID=sID;}
4007 + rtl::OUString GetChangeID(){return m_sID;}
4008 + void SetEditor(rtl::OUString sEditor){m_sEditor=sEditor;}
4009 +protected:
4010 + rtl::OUString m_sID;
4011 + rtl::OUString m_sEditor;
4014 +class XFChangeInsert : public XFChangeRegion
4016 +public:
4017 + XFChangeInsert(){};
4018 + ~XFChangeInsert(){};
4019 + void ToXml(IXFStream *pStrm);
4022 +class XFChangeDelete : public XFChangeRegion
4024 +public:
4025 + XFChangeDelete(){};
4026 + ~XFChangeDelete(){};
4027 + void ToXml(IXFStream *pStrm);
4030 +class XFChange : public XFContent
4032 +public:
4033 + XFChange(){};
4034 + ~XFChange(){};
4035 + void ToXml(IXFStream *pStrm);
4036 + void SetChangeID(rtl::OUString sID){m_sID=sID;}
4037 + rtl::OUString GetChangeID(){return m_sID;}
4038 +private:
4039 + rtl::OUString m_sID;
4042 +class XFChangeStart : public XFContent
4044 +public:
4045 + XFChangeStart(){};
4046 + ~XFChangeStart(){};
4047 + void ToXml(IXFStream *pStrm);
4048 + void SetChangeID(rtl::OUString sID){m_sID=sID;}
4049 + rtl::OUString GetChangeID(){return m_sID;}
4050 +private:
4051 + rtl::OUString m_sID;
4054 +class XFChangeEnd : public XFContent
4056 +public:
4057 + XFChangeEnd(){};
4058 + ~XFChangeEnd(){};
4059 + void ToXml(IXFStream *pStrm);
4060 + void SetChangeID(rtl::OUString sID){m_sID=sID;}
4061 + rtl::OUString GetChangeID(){return m_sID;}
4062 +private:
4063 + rtl::OUString m_sID;
4066 +#endif
4067 \ No newline at end of file
4068 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfchartstreamtools.cxx lotuswordpro/source/filter/xfilter/xfchartstreamtools.cxx
4069 --- lotuswordpro.bak/source/filter/xfilter/xfchartstreamtools.cxx 1970-01-01 08:00:00.000000000 +0800
4070 +++ lotuswordpro/source/filter/xfilter/xfchartstreamtools.cxx 2008-10-22 11:42:34.000000000 +0800
4071 @@ -0,0 +1,117 @@
4072 +/*************************************************************************
4074 + * The Contents of this file are made available subject to the terms of
4075 + * either of the following licenses
4077 + * - GNU Lesser General Public License Version 2.1
4078 + * - Sun Industry Standards Source License Version 1.1
4080 + * Sun Microsystems Inc., October, 2000
4082 + * GNU Lesser General Public License Version 2.1
4083 + * =============================================
4084 + * Copyright 2000 by Sun Microsystems, Inc.
4085 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
4087 + * This library is free software; you can redistribute it and/or
4088 + * modify it under the terms of the GNU Lesser General Public
4089 + * License version 2.1, as published by the Free Software Foundation.
4091 + * This library is distributed in the hope that it will be useful,
4092 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
4093 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4094 + * Lesser General Public License for more details.
4096 + * You should have received a copy of the GNU Lesser General Public
4097 + * License along with this library; if not, write to the Free Software
4098 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
4099 + * MA 02111-1307 USA
4102 + * Sun Industry Standards Source License Version 1.1
4103 + * =================================================
4104 + * The contents of this file are subject to the Sun Industry Standards
4105 + * Source License Version 1.1 (the "License"); You may not use this file
4106 + * except in compliance with the License. You may obtain a copy of the
4107 + * License at http://www.openoffice.org/license.html.
4109 + * Software provided under this License is provided on an "AS IS" basis,
4110 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
4111 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
4112 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
4113 + * See the License for the specific provisions governing your rights and
4114 + * obligations concerning the Software.
4116 + * The Initial Developer of the Original Code is: IBM Corporation
4118 + * Copyright: 2008 by IBM Corporation
4120 + * All Rights Reserved.
4122 + * Contributor(s): _______________________________________
4125 + ************************************************************************/
4126 +/*****************************************************************************
4127 +* Change History
4128 +* <<Date>> <<Name of editor>> <<Description>>
4129 +2005/2 draft code for implementation of chart stream helpers
4130 +****************************************************************************/
4132 +/**
4133 + * @file
4134 + * For LWP filter architecture prototype
4137 +#include "xfchartstreamtools.hxx"
4138 +#include "xfdrawchart.hxx"
4139 +#include "xfparagraph.hxx"
4141 +#include <com/sun/star/xml/sax/SAXParseException.hpp>
4142 +#include <com/sun/star/lang/XMultiServiceFactory.hpp>
4144 +/**
4145 +* @short Parse the xml stream
4146 +* @param rInpStream the xml stream
4147 +* @param aHandler xml handler
4149 +void XFChartStreamTools::ParseStream(SvStorageStreamRef rInpStream, Reference<XDocumentHandler> aHandler)
4151 + //Create parser
4152 + uno::Reference< xml::sax::XParser > xParser;
4154 + uno::Reference< lang::XMultiServiceFactory>
4155 + xServiceFactory( ::comphelper::getProcessServiceFactory() );
4156 + if( !xServiceFactory.is() )
4158 + assert(false);
4159 + return;
4161 + xParser = uno::Reference< xml::sax::XParser > (
4162 + xServiceFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Parser" )),
4163 + uno::UNO_QUERY );
4165 + if( ! xParser.is() )
4167 + assert(false);
4168 + return;
4172 + xParser->setDocumentHandler( aHandler );
4173 + xml::sax::InputSource aParserInput;
4174 + aParserInput.aInputStream = rInpStream->GetXInputStream();
4175 + xParser->parseStream( aParserInput );
4178 +/**
4179 +* @short Parse the xml stream, content.xml & styles.xml for chart
4180 +* @param rStyleStream styles xml stream
4181 +* @param rCntStream the content xml stream
4182 +* @param pOutputStream the output stream
4184 +void XFChartStreamTools::ParseStream(SvStorageStreamRef rCntStream,IXFStream* pOutputStream)
4186 + Reference<XDocumentHandler> pHandler( new XFChartXMLHandler(pOutputStream) );
4187 + ParseStream(rCntStream,pHandler);
4189 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfchartstreamtools.hxx lotuswordpro/source/filter/xfilter/xfchartstreamtools.hxx
4190 --- lotuswordpro.bak/source/filter/xfilter/xfchartstreamtools.hxx 1970-01-01 08:00:00.000000000 +0800
4191 +++ lotuswordpro/source/filter/xfilter/xfchartstreamtools.hxx 2008-10-22 11:42:34.000000000 +0800
4192 @@ -0,0 +1,112 @@
4193 +/*************************************************************************
4195 + * The Contents of this file are made available subject to the terms of
4196 + * either of the following licenses
4198 + * - GNU Lesser General Public License Version 2.1
4199 + * - Sun Industry Standards Source License Version 1.1
4201 + * Sun Microsystems Inc., October, 2000
4203 + * GNU Lesser General Public License Version 2.1
4204 + * =============================================
4205 + * Copyright 2000 by Sun Microsystems, Inc.
4206 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
4208 + * This library is free software; you can redistribute it and/or
4209 + * modify it under the terms of the GNU Lesser General Public
4210 + * License version 2.1, as published by the Free Software Foundation.
4212 + * This library is distributed in the hope that it will be useful,
4213 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
4214 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4215 + * Lesser General Public License for more details.
4217 + * You should have received a copy of the GNU Lesser General Public
4218 + * License along with this library; if not, write to the Free Software
4219 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
4220 + * MA 02111-1307 USA
4223 + * Sun Industry Standards Source License Version 1.1
4224 + * =================================================
4225 + * The contents of this file are subject to the Sun Industry Standards
4226 + * Source License Version 1.1 (the "License"); You may not use this file
4227 + * except in compliance with the License. You may obtain a copy of the
4228 + * License at http://www.openoffice.org/license.html.
4230 + * Software provided under this License is provided on an "AS IS" basis,
4231 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
4232 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
4233 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
4234 + * See the License for the specific provisions governing your rights and
4235 + * obligations concerning the Software.
4237 + * The Initial Developer of the Original Code is: IBM Corporation
4239 + * Copyright: 2008 by IBM Corporation
4241 + * All Rights Reserved.
4243 + * Contributor(s): _______________________________________
4246 + ************************************************************************/
4247 +/*****************************************************************************
4248 +* Change History
4249 +* <<Date>> <<Name of editor>> <<Description>>
4250 +2005/2 draft code for chart stream helpers
4251 +****************************************************************************/
4253 +/**
4254 + * @file
4255 + * For LWP filter architecture prototype
4258 +#ifndef LWPCHARTSTREAMTOOLS_HXX_
4259 +#define LWPCHARTSTREAMTOOLS_HXX_
4261 +#include <tools/stream.hxx>
4262 +#include <tools/gen.hxx>
4264 +//For sax parser
4265 +#ifndef _COM_SUN_STAR_XML_SAX_INPUTSOURCE_HPP_
4266 +#include <com/sun/star/xml/sax/InputSource.hpp>
4267 +#endif
4269 +#ifndef _COM_SUN_STAR_XML_SAX_XDTDHANDLER_HPP_
4270 +#include <com/sun/star/xml/sax/XDTDHandler.hpp>
4271 +#endif
4273 +#ifndef _COM_SUN_STAR_XML_SAX_XPARSER_HPP_
4274 +#include <com/sun/star/xml/sax/XParser.hpp>
4275 +#endif
4277 +#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
4278 +#include <comphelper/processfactory.hxx>
4279 +#endif
4281 +using namespace ::com::sun::star;
4282 +using namespace ::rtl;
4283 +using namespace comphelper;
4285 +#include "xfchartxmlhandler.hxx"
4286 +#include "xfrect.hxx"
4287 +class IXFContent;
4289 +/**
4290 +* @brief
4291 +* tools class for chart stream process
4294 +class XFChartStreamTools
4296 +public:
4297 + static void ParseStream(SvStorageStreamRef rInpStream, Reference<XDocumentHandler> aHandler);
4299 + static void ParseStream( SvStorageStreamRef rCntStream,
4300 + IXFStream* pOutputStream);
4303 +#endif
4305 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfchartxmlhandler.cxx lotuswordpro/source/filter/xfilter/xfchartxmlhandler.cxx
4306 --- lotuswordpro.bak/source/filter/xfilter/xfchartxmlhandler.cxx 1970-01-01 08:00:00.000000000 +0800
4307 +++ lotuswordpro/source/filter/xfilter/xfchartxmlhandler.cxx 2008-10-22 11:42:34.000000000 +0800
4308 @@ -0,0 +1,125 @@
4309 +/*************************************************************************
4311 + * The Contents of this file are made available subject to the terms of
4312 + * either of the following licenses
4314 + * - GNU Lesser General Public License Version 2.1
4315 + * - Sun Industry Standards Source License Version 1.1
4317 + * Sun Microsystems Inc., October, 2000
4319 + * GNU Lesser General Public License Version 2.1
4320 + * =============================================
4321 + * Copyright 2000 by Sun Microsystems, Inc.
4322 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
4324 + * This library is free software; you can redistribute it and/or
4325 + * modify it under the terms of the GNU Lesser General Public
4326 + * License version 2.1, as published by the Free Software Foundation.
4328 + * This library is distributed in the hope that it will be useful,
4329 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
4330 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4331 + * Lesser General Public License for more details.
4333 + * You should have received a copy of the GNU Lesser General Public
4334 + * License along with this library; if not, write to the Free Software
4335 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
4336 + * MA 02111-1307 USA
4339 + * Sun Industry Standards Source License Version 1.1
4340 + * =================================================
4341 + * The contents of this file are subject to the Sun Industry Standards
4342 + * Source License Version 1.1 (the "License"); You may not use this file
4343 + * except in compliance with the License. You may obtain a copy of the
4344 + * License at http://www.openoffice.org/license.html.
4346 + * Software provided under this License is provided on an "AS IS" basis,
4347 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
4348 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
4349 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
4350 + * See the License for the specific provisions governing your rights and
4351 + * obligations concerning the Software.
4353 + * The Initial Developer of the Original Code is: IBM Corporation
4355 + * Copyright: 2008 by IBM Corporation
4357 + * All Rights Reserved.
4359 + * Contributor(s): _______________________________________
4362 + ************************************************************************/
4363 +/*****************************************************************************
4364 +* Change History
4365 +* <<Date>> <<Name of editor>> <<Description>>
4366 + 2005/2 draft code for Implementation of chart xml hander
4367 +****************************************************************************/
4368 +/**
4369 +* @file
4370 +* For LWP filter architecture prototype
4373 +#include "xfchartxmlhandler.hxx"
4375 +Any SAL_CALL XFChartXMLHandler::queryInterface( const Type & rType ) throw( RuntimeException )
4377 + Any a = ::cppu::queryInterface( rType ,SAL_STATIC_CAST( XDocumentHandler*, this ));
4378 + if ( a.hasValue() )
4379 + return a;
4380 + else
4381 + return OWeakObject::queryInterface( rType );
4384 +/**
4385 +* @short constructor of chart xml handler
4386 +* @descr
4387 +* @param pOutputStream the output stream
4389 +XFChartXMLHandler::XFChartXMLHandler(IXFStream* pOutputStream)
4391 + m_pOutputStream = pOutputStream;
4394 +/**
4395 +* @short handle the start element
4396 +* @descr ignore some elements here
4397 +* @param aName element name
4398 +* @param xAttribs the attribute list
4400 +void SAL_CALL XFChartXMLHandler::startElement( const ::rtl::OUString& aName, const Reference< XAttributeList >& xAttribs )
4401 +throw (SAXException, RuntimeException)
4403 + IXFAttrList* pList = m_pOutputStream->GetAttrList();
4404 + pList->Clear();
4406 + INT16 nLen = xAttribs->getLength();
4407 + for( INT16 nC=0;nC<nLen;nC++)
4409 + OUString aName = xAttribs->getNameByIndex(nC);
4410 + OUString aVal = xAttribs->getValueByIndex(nC);
4411 + pList->AddAttribute(aName, aVal);
4415 + m_pOutputStream->StartElement(aName);
4418 +/**
4419 +* @short handle the end element
4420 +* @descr ignore some elements here
4421 +* @param aName element name
4423 +void SAL_CALL XFChartXMLHandler::endElement( const ::rtl::OUString& aName )
4424 +throw (SAXException, RuntimeException)
4426 + m_pOutputStream->EndElement(aName);
4429 +void SAL_CALL XFChartXMLHandler::characters( const ::rtl::OUString& aChars )
4430 +throw (SAXException, RuntimeException)
4432 + m_pOutputStream->Characters(aChars);
4434 \ No newline at end of file
4435 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfchartxmlhandler.hxx lotuswordpro/source/filter/xfilter/xfchartxmlhandler.hxx
4436 --- lotuswordpro.bak/source/filter/xfilter/xfchartxmlhandler.hxx 1970-01-01 08:00:00.000000000 +0800
4437 +++ lotuswordpro/source/filter/xfilter/xfchartxmlhandler.hxx 2008-10-22 11:42:34.000000000 +0800
4438 @@ -0,0 +1,129 @@
4439 +/*************************************************************************
4441 + * The Contents of this file are made available subject to the terms of
4442 + * either of the following licenses
4444 + * - GNU Lesser General Public License Version 2.1
4445 + * - Sun Industry Standards Source License Version 1.1
4447 + * Sun Microsystems Inc., October, 2000
4449 + * GNU Lesser General Public License Version 2.1
4450 + * =============================================
4451 + * Copyright 2000 by Sun Microsystems, Inc.
4452 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
4454 + * This library is free software; you can redistribute it and/or
4455 + * modify it under the terms of the GNU Lesser General Public
4456 + * License version 2.1, as published by the Free Software Foundation.
4458 + * This library is distributed in the hope that it will be useful,
4459 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
4460 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4461 + * Lesser General Public License for more details.
4463 + * You should have received a copy of the GNU Lesser General Public
4464 + * License along with this library; if not, write to the Free Software
4465 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
4466 + * MA 02111-1307 USA
4469 + * Sun Industry Standards Source License Version 1.1
4470 + * =================================================
4471 + * The contents of this file are subject to the Sun Industry Standards
4472 + * Source License Version 1.1 (the "License"); You may not use this file
4473 + * except in compliance with the License. You may obtain a copy of the
4474 + * License at http://www.openoffice.org/license.html.
4476 + * Software provided under this License is provided on an "AS IS" basis,
4477 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
4478 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
4479 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
4480 + * See the License for the specific provisions governing your rights and
4481 + * obligations concerning the Software.
4483 + * The Initial Developer of the Original Code is: IBM Corporation
4485 + * Copyright: 2008 by IBM Corporation
4487 + * All Rights Reserved.
4489 + * Contributor(s): _______________________________________
4492 + ************************************************************************/
4493 +/*****************************************************************************
4494 +* Change History
4495 +* <<Date>> <<Name of editor>> <<Description>>
4496 +* 2005/2 draft code for XML handler of chart xml.
4497 +****************************************************************************/
4499 +/*************************************************************************
4500 + * @file
4501 + * For LWP filter architecture prototype
4502 + ************************************************************************/
4504 +#ifndef XFCHARTXMLHANDLER_HXX_
4505 +#define XFCHARTXMLHANDLER_HXX_
4507 +#include <cppuhelper/weak.hxx>
4508 +#include <com/sun/star/xml/sax/XAttributeList.hpp>
4509 +#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
4510 +#include <com/sun/star/xml/sax/SAXParseException.hpp>
4511 +#include <com/sun/star/uno/RuntimeException.hpp>
4513 +#include <so3/svstor.hxx>
4514 +#include "ixfstream.hxx"
4515 +#include "ixfattrlist.hxx"
4516 +#include <rtl/ustring.hxx>
4517 +using namespace rtl;
4518 +using namespace ::com::sun::star::xml::sax;
4519 +using namespace ::com::sun::star::uno;
4521 +/**
4522 +* @brief
4523 +* Chart xml handler
4526 +class XFChartXMLHandler: public XDocumentHandler,public ::cppu::OWeakObject
4528 +public:
4529 + XFChartXMLHandler(IXFStream* pOutputStream);
4531 + // XInterface
4532 + virtual void SAL_CALL acquire() throw()
4533 + { OWeakObject::acquire(); }
4534 + virtual void SAL_CALL release() throw()
4535 + { OWeakObject::release(); }
4536 + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
4537 + const ::com::sun::star::uno::Type & rType ) throw( ::com::sun::star::uno::RuntimeException );
4539 + virtual void SAL_CALL startDocument( )
4540 + throw (SAXException, RuntimeException) {}
4542 + virtual void SAL_CALL endDocument( )
4543 + throw (SAXException, RuntimeException) {}
4545 + virtual void SAL_CALL startElement( const ::rtl::OUString& aName, const Reference< XAttributeList >& xAttribs )
4546 + throw (SAXException, RuntimeException);
4548 + virtual void SAL_CALL endElement( const ::rtl::OUString& aName )
4549 + throw (SAXException, RuntimeException);
4551 + virtual void SAL_CALL characters( const ::rtl::OUString& aChars )
4552 + throw (SAXException, RuntimeException);
4554 + virtual void SAL_CALL ignorableWhitespace( const ::rtl::OUString& aWhitespaces )
4555 + throw (SAXException, RuntimeException){}
4557 + virtual void SAL_CALL processingInstruction( const ::rtl::OUString& aTarget, const ::rtl::OUString& aData )
4558 + throw (SAXException, RuntimeException){}
4560 + virtual void SAL_CALL setDocumentLocator( const Reference< XLocator >& xLocator )
4561 + throw (SAXException, RuntimeException){}
4562 +protected:
4563 + IXFStream* m_pOutputStream;
4566 +#endif
4568 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfcolor.cxx lotuswordpro/source/filter/xfilter/xfcolor.cxx
4569 --- lotuswordpro.bak/source/filter/xfilter/xfcolor.cxx 1970-01-01 08:00:00.000000000 +0800
4570 +++ lotuswordpro/source/filter/xfilter/xfcolor.cxx 2008-10-22 11:42:34.000000000 +0800
4571 @@ -0,0 +1,92 @@
4572 +/*************************************************************************
4574 + * The Contents of this file are made available subject to the terms of
4575 + * either of the following licenses
4577 + * - GNU Lesser General Public License Version 2.1
4578 + * - Sun Industry Standards Source License Version 1.1
4580 + * Sun Microsystems Inc., October, 2000
4582 + * GNU Lesser General Public License Version 2.1
4583 + * =============================================
4584 + * Copyright 2000 by Sun Microsystems, Inc.
4585 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
4587 + * This library is free software; you can redistribute it and/or
4588 + * modify it under the terms of the GNU Lesser General Public
4589 + * License version 2.1, as published by the Free Software Foundation.
4591 + * This library is distributed in the hope that it will be useful,
4592 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
4593 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4594 + * Lesser General Public License for more details.
4596 + * You should have received a copy of the GNU Lesser General Public
4597 + * License along with this library; if not, write to the Free Software
4598 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
4599 + * MA 02111-1307 USA
4602 + * Sun Industry Standards Source License Version 1.1
4603 + * =================================================
4604 + * The contents of this file are subject to the Sun Industry Standards
4605 + * Source License Version 1.1 (the "License"); You may not use this file
4606 + * except in compliance with the License. You may obtain a copy of the
4607 + * License at http://www.openoffice.org/license.html.
4609 + * Software provided under this License is provided on an "AS IS" basis,
4610 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
4611 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
4612 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
4613 + * See the License for the specific provisions governing your rights and
4614 + * obligations concerning the Software.
4616 + * The Initial Developer of the Original Code is: IBM Corporation
4618 + * Copyright: 2008 by IBM Corporation
4620 + * All Rights Reserved.
4622 + * Contributor(s): _______________________________________
4625 + ************************************************************************/
4626 +/*************************************************************************
4627 + * @file
4628 + * Color object to serial to xml filter.
4629 + ************************************************************************/
4630 +/*************************************************************************
4631 + * Change History
4632 + * 2005-01-17 create this file.
4633 + ************************************************************************/
4634 +#include <stdio.h>
4635 +#include "xfcolor.hxx"
4637 +rtl::OUString XFColor::ToString() const
4639 + char buf[8];
4641 + rtl_zeroMemory(buf,8);
4642 + sprintf(buf,"#%2x%2x%2x",m_nRed, m_nGreen, m_nBlue);
4643 + for( int i=1; i<7;i++ )
4645 + if( buf[i] == ' ' )
4646 + buf[i] = '0';
4648 + return rtl::OUString::createFromAscii(buf);
4651 +bool operator==(XFColor& c1, XFColor& c2)
4653 + return (
4654 + (c1.m_nRed==c2.m_nRed)&&
4655 + (c1.m_nGreen==c2.m_nGreen)&&
4656 + (c1.m_nBlue==c2.m_nBlue)
4657 + );
4660 +bool operator!=(XFColor& c1, XFColor& c2)
4662 + return !(c1==c2);
4664 \ No newline at end of file
4665 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfcolor.hxx lotuswordpro/source/filter/xfilter/xfcolor.hxx
4666 --- lotuswordpro.bak/source/filter/xfilter/xfcolor.hxx 1970-01-01 08:00:00.000000000 +0800
4667 +++ lotuswordpro/source/filter/xfilter/xfcolor.hxx 2008-10-22 11:42:34.000000000 +0800
4668 @@ -0,0 +1,133 @@
4669 +/*************************************************************************
4671 + * The Contents of this file are made available subject to the terms of
4672 + * either of the following licenses
4674 + * - GNU Lesser General Public License Version 2.1
4675 + * - Sun Industry Standards Source License Version 1.1
4677 + * Sun Microsystems Inc., October, 2000
4679 + * GNU Lesser General Public License Version 2.1
4680 + * =============================================
4681 + * Copyright 2000 by Sun Microsystems, Inc.
4682 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
4684 + * This library is free software; you can redistribute it and/or
4685 + * modify it under the terms of the GNU Lesser General Public
4686 + * License version 2.1, as published by the Free Software Foundation.
4688 + * This library is distributed in the hope that it will be useful,
4689 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
4690 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4691 + * Lesser General Public License for more details.
4693 + * You should have received a copy of the GNU Lesser General Public
4694 + * License along with this library; if not, write to the Free Software
4695 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
4696 + * MA 02111-1307 USA
4699 + * Sun Industry Standards Source License Version 1.1
4700 + * =================================================
4701 + * The contents of this file are subject to the Sun Industry Standards
4702 + * Source License Version 1.1 (the "License"); You may not use this file
4703 + * except in compliance with the License. You may obtain a copy of the
4704 + * License at http://www.openoffice.org/license.html.
4706 + * Software provided under this License is provided on an "AS IS" basis,
4707 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
4708 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
4709 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
4710 + * See the License for the specific provisions governing your rights and
4711 + * obligations concerning the Software.
4713 + * The Initial Developer of the Original Code is: IBM Corporation
4715 + * Copyright: 2008 by IBM Corporation
4717 + * All Rights Reserved.
4719 + * Contributor(s): _______________________________________
4722 + ************************************************************************/
4723 +/*************************************************************************
4724 + * @file
4725 + * Color object to serial to xml filter.
4726 + ************************************************************************/
4727 +/*************************************************************************
4728 + * Change History
4729 + * 2005-01-17 create this file.
4730 + ************************************************************************/
4731 +#ifndef _XFCOLOR_HXX
4732 +#define _XFCOLOR_HXX
4734 +#include "xfglobal.hxx"
4736 +/**
4737 + * @brief
4738 + * Color object.
4739 + */
4740 +class XFColor
4742 +public:
4743 + XFColor():m_nRed((sal_Int8)0),m_nGreen((sal_Int8)0),m_nBlue((sal_Int8)0)
4745 + m_bValid = sal_False;
4747 + XFColor(sal_Int32 red, sal_Int32 green, sal_Int32 blue)
4748 + :m_nRed((sal_Int8)red),m_nGreen((sal_Int8)green),m_nBlue((sal_Int8)blue)
4749 + {
4750 + m_bValid = sal_True;
4752 + XFColor(sal_uInt32 color)
4754 + unsigned int c = color&0x00ffffff;
4755 + unsigned int temp = c;
4756 + m_nRed = temp&0x000000ff;
4758 + temp = c;
4759 + m_nGreen = (temp&0x0000ff00)>>8;
4761 + temp = c;
4762 + m_nBlue = (temp&0x00ff0000)>>16;
4764 + m_bValid = sal_True;
4767 + /**
4768 + * @descr return red part of the color.
4769 + */
4770 + sal_uInt8 GetRed() const{ return m_nRed; }
4772 + /**
4773 + * @descr return green part of the color.
4774 + */
4775 + sal_uInt8 GetGreen() const{ return m_nGreen; }
4777 + /**
4778 + * @descr return blue part of the color.
4779 + */
4780 + sal_uInt8 GetBlue() const{ return m_nBlue; }
4782 + /**
4783 + * @descr helper function to assert whether a color is valid.
4784 + */
4785 + sal_Bool IsValid() const{ return m_bValid;};
4787 + rtl::OUString ToString ()const;
4789 + friend bool operator==(XFColor& c1, XFColor& c2);
4790 + friend bool operator!=(XFColor& c1, XFColor& c2);
4791 +private:
4792 + sal_uInt8 m_nRed;
4793 + sal_uInt8 m_nGreen;
4794 + sal_uInt8 m_nBlue;
4795 + sal_Bool m_bValid;
4798 +#endif
4802 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfcolstyle.cxx lotuswordpro/source/filter/xfilter/xfcolstyle.cxx
4803 --- lotuswordpro.bak/source/filter/xfilter/xfcolstyle.cxx 1970-01-01 08:00:00.000000000 +0800
4804 +++ lotuswordpro/source/filter/xfilter/xfcolstyle.cxx 2008-10-22 11:42:34.000000000 +0800
4805 @@ -0,0 +1,95 @@
4806 +/*************************************************************************
4808 + * The Contents of this file are made available subject to the terms of
4809 + * either of the following licenses
4811 + * - GNU Lesser General Public License Version 2.1
4812 + * - Sun Industry Standards Source License Version 1.1
4814 + * Sun Microsystems Inc., October, 2000
4816 + * GNU Lesser General Public License Version 2.1
4817 + * =============================================
4818 + * Copyright 2000 by Sun Microsystems, Inc.
4819 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
4821 + * This library is free software; you can redistribute it and/or
4822 + * modify it under the terms of the GNU Lesser General Public
4823 + * License version 2.1, as published by the Free Software Foundation.
4825 + * This library is distributed in the hope that it will be useful,
4826 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
4827 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4828 + * Lesser General Public License for more details.
4830 + * You should have received a copy of the GNU Lesser General Public
4831 + * License along with this library; if not, write to the Free Software
4832 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
4833 + * MA 02111-1307 USA
4836 + * Sun Industry Standards Source License Version 1.1
4837 + * =================================================
4838 + * The contents of this file are subject to the Sun Industry Standards
4839 + * Source License Version 1.1 (the "License"); You may not use this file
4840 + * except in compliance with the License. You may obtain a copy of the
4841 + * License at http://www.openoffice.org/license.html.
4843 + * Software provided under this License is provided on an "AS IS" basis,
4844 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
4845 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
4846 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
4847 + * See the License for the specific provisions governing your rights and
4848 + * obligations concerning the Software.
4850 + * The Initial Developer of the Original Code is: IBM Corporation
4852 + * Copyright: 2008 by IBM Corporation
4854 + * All Rights Reserved.
4856 + * Contributor(s): _______________________________________
4859 + ************************************************************************/
4860 +/*************************************************************************
4861 + * @file
4862 + * Column style object.
4863 + ************************************************************************/
4864 +/*************************************************************************
4865 + * Change History
4866 + * 2005-03-17 create this file.
4867 + ************************************************************************/
4868 +#include "xfcolstyle.hxx"
4870 +XFColStyle::XFColStyle()
4872 + m_fWidth = 0;
4875 +XFColStyle::~XFColStyle()
4879 +enumXFStyle XFColStyle::GetStyleFamily()
4881 + return enumXFStyleTableCol;
4884 +void XFColStyle::ToXml(IXFStream *pStrm)
4886 + IXFAttrList *pAttrList = pStrm->GetAttrList();
4888 + pAttrList->Clear();
4890 + pAttrList->AddAttribute( A2OUSTR("style:name"), GetStyleName() );
4891 + pAttrList->AddAttribute( A2OUSTR("style:family"), A2OUSTR("table-column") );
4892 + pStrm->StartElement( A2OUSTR("style:style") );
4894 + pAttrList->Clear();
4895 + pAttrList->AddAttribute( A2OUSTR("style:column-width"), DoubleToOUString(m_fWidth) + A2OUSTR("cm") );
4896 + pStrm->StartElement( A2OUSTR("style:properties") );
4897 + pStrm->EndElement( A2OUSTR("style:properties") );
4899 + pStrm->EndElement( A2OUSTR("style:style") );
4901 \ No newline at end of file
4902 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfcolstyle.hxx lotuswordpro/source/filter/xfilter/xfcolstyle.hxx
4903 --- lotuswordpro.bak/source/filter/xfilter/xfcolstyle.hxx 1970-01-01 08:00:00.000000000 +0800
4904 +++ lotuswordpro/source/filter/xfilter/xfcolstyle.hxx 2008-10-22 11:42:34.000000000 +0800
4905 @@ -0,0 +1,112 @@
4906 +/*************************************************************************
4908 + * The Contents of this file are made available subject to the terms of
4909 + * either of the following licenses
4911 + * - GNU Lesser General Public License Version 2.1
4912 + * - Sun Industry Standards Source License Version 1.1
4914 + * Sun Microsystems Inc., October, 2000
4916 + * GNU Lesser General Public License Version 2.1
4917 + * =============================================
4918 + * Copyright 2000 by Sun Microsystems, Inc.
4919 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
4921 + * This library is free software; you can redistribute it and/or
4922 + * modify it under the terms of the GNU Lesser General Public
4923 + * License version 2.1, as published by the Free Software Foundation.
4925 + * This library is distributed in the hope that it will be useful,
4926 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
4927 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4928 + * Lesser General Public License for more details.
4930 + * You should have received a copy of the GNU Lesser General Public
4931 + * License along with this library; if not, write to the Free Software
4932 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
4933 + * MA 02111-1307 USA
4936 + * Sun Industry Standards Source License Version 1.1
4937 + * =================================================
4938 + * The contents of this file are subject to the Sun Industry Standards
4939 + * Source License Version 1.1 (the "License"); You may not use this file
4940 + * except in compliance with the License. You may obtain a copy of the
4941 + * License at http://www.openoffice.org/license.html.
4943 + * Software provided under this License is provided on an "AS IS" basis,
4944 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
4945 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
4946 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
4947 + * See the License for the specific provisions governing your rights and
4948 + * obligations concerning the Software.
4950 + * The Initial Developer of the Original Code is: IBM Corporation
4952 + * Copyright: 2008 by IBM Corporation
4954 + * All Rights Reserved.
4956 + * Contributor(s): _______________________________________
4959 + ************************************************************************/
4960 +/*************************************************************************
4961 + * @file
4962 + * Column style object.
4963 + ************************************************************************/
4964 +/*************************************************************************
4965 + * Change History
4966 + * 2005-03-17 create this file.
4967 + ************************************************************************/
4968 +#ifndef _XFCOLSTYLE_HXX
4969 +#define _XFCOLSTYLE_HXX
4971 +#include "xfstyle.hxx"
4973 +/**
4974 + * @brief
4975 + * Column style, it has only one property-the column width.
4976 + */
4977 +class XFColStyle : public XFStyle
4979 +public:
4980 + XFColStyle();
4982 + virtual ~XFColStyle();
4984 +public:
4985 + /**
4986 + * @descr Set column width.
4987 + */
4988 + void SetWidth(double width);
4990 + /**
4991 + * @descr return column width.
4992 + */
4993 + double GetWidth();
4995 + virtual enumXFStyle GetStyleFamily();
4997 + /**
4998 + * @descr output column style as an xml node.
4999 + */
5000 + virtual void ToXml(IXFStream *pStrm);
5002 +private:
5003 + double m_fWidth;
5006 +inline void XFColStyle::SetWidth(double width)
5008 + m_fWidth = width;
5011 +inline double XFColStyle::GetWidth()
5013 + return m_fWidth;
5017 +#endif
5018 \ No newline at end of file
5019 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfcolumns.cxx lotuswordpro/source/filter/xfilter/xfcolumns.cxx
5020 --- lotuswordpro.bak/source/filter/xfilter/xfcolumns.cxx 1970-01-01 08:00:00.000000000 +0800
5021 +++ lotuswordpro/source/filter/xfilter/xfcolumns.cxx 2008-10-22 11:42:34.000000000 +0800
5022 @@ -0,0 +1,213 @@
5023 +/*************************************************************************
5025 + * The Contents of this file are made available subject to the terms of
5026 + * either of the following licenses
5028 + * - GNU Lesser General Public License Version 2.1
5029 + * - Sun Industry Standards Source License Version 1.1
5031 + * Sun Microsystems Inc., October, 2000
5033 + * GNU Lesser General Public License Version 2.1
5034 + * =============================================
5035 + * Copyright 2000 by Sun Microsystems, Inc.
5036 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
5038 + * This library is free software; you can redistribute it and/or
5039 + * modify it under the terms of the GNU Lesser General Public
5040 + * License version 2.1, as published by the Free Software Foundation.
5042 + * This library is distributed in the hope that it will be useful,
5043 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
5044 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5045 + * Lesser General Public License for more details.
5047 + * You should have received a copy of the GNU Lesser General Public
5048 + * License along with this library; if not, write to the Free Software
5049 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
5050 + * MA 02111-1307 USA
5053 + * Sun Industry Standards Source License Version 1.1
5054 + * =================================================
5055 + * The contents of this file are subject to the Sun Industry Standards
5056 + * Source License Version 1.1 (the "License"); You may not use this file
5057 + * except in compliance with the License. You may obtain a copy of the
5058 + * License at http://www.openoffice.org/license.html.
5060 + * Software provided under this License is provided on an "AS IS" basis,
5061 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
5062 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
5063 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
5064 + * See the License for the specific provisions governing your rights and
5065 + * obligations concerning the Software.
5067 + * The Initial Developer of the Original Code is: IBM Corporation
5069 + * Copyright: 2008 by IBM Corporation
5071 + * All Rights Reserved.
5073 + * Contributor(s): _______________________________________
5076 + ************************************************************************/
5077 +/*************************************************************************
5078 + * @file
5079 + * Columns styles for section, or paragraph.
5080 + ************************************************************************/
5081 +/*************************************************************************
5082 + * Change History
5083 + * 2005-01-17 create this file.
5084 + ************************************************************************/
5086 +#include "xfcolumns.hxx"
5088 +void XFColumn::SetRelWidth(sal_Int32 width)
5090 + m_nRelWidth = width;
5093 +sal_Int32 XFColumn::GetRelWidth()
5095 + return m_nRelWidth;
5098 +void XFColumn::SetMargins(double left, double right)
5100 + m_fMarginLeft = left;
5101 + m_fMarginRight = right;
5104 +double XFColumn::GetMarginLeft()
5106 + return m_fMarginLeft;
5108 +double XFColumn::GetMarginRight()
5110 + return m_fMarginRight;
5113 +void XFColumn::ToXml(IXFStream *pStrm)
5115 + IXFAttrList *pAttrList = pStrm->GetAttrList();
5116 + pAttrList->Clear();
5118 + pAttrList->AddAttribute( A2OUSTR("style:rel-width"), Int32ToOUString(m_nRelWidth) + A2OUSTR("*") );
5119 + pAttrList->AddAttribute( A2OUSTR("fo:margin-left"), DoubleToOUString(m_fMarginLeft) + A2OUSTR("cm") );
5120 + pAttrList->AddAttribute( A2OUSTR("fo:margin-right"), DoubleToOUString(m_fMarginRight) + A2OUSTR("cm") );
5122 + pStrm->StartElement( A2OUSTR("style:column") );
5123 + pStrm->EndElement( A2OUSTR("style:column") );
5126 +void XFColumnSep::SetRelHeight(sal_Int32 height)
5128 + assert(height>=0&&height<=100);
5129 + m_nRelHeight = height;
5131 +void XFColumnSep::SetWidth(double width)
5133 + m_fWidth = width;
5135 +void XFColumnSep::SetColor(XFColor& color)
5137 + m_aColor = color;
5139 +void XFColumnSep::SetVerticalAlign(enumXFAlignType align)
5141 + m_eVertAlign = align;
5144 +void XFColumnSep::ToXml(IXFStream *pStrm)
5146 + IXFAttrList *pAttrList = pStrm->GetAttrList();
5148 + pAttrList->Clear();
5149 + pAttrList->AddAttribute( A2OUSTR("style:width"), DoubleToOUString(m_fWidth) + A2OUSTR("cm") );
5150 + if( m_aColor.IsValid() )
5151 + pAttrList->AddAttribute( A2OUSTR("style:color"), m_aColor.ToString() );
5152 + pAttrList->AddAttribute( A2OUSTR("style:height"), Int32ToOUString(m_nRelHeight) + A2OUSTR("%") );
5153 + //text align:
5154 + if( m_eVertAlign == enumXFAlignTop )
5156 + pAttrList->AddAttribute(A2OUSTR("style:vertical-align"),A2OUSTR("top"));
5158 + else if( m_eVertAlign == enumXFAlignMiddle )
5160 + pAttrList->AddAttribute(A2OUSTR("style:vertical-align"),A2OUSTR("middle"));
5162 + else if( m_eVertAlign == enumXFAlignBottom )
5164 + pAttrList->AddAttribute(A2OUSTR("style:vertical-align"),A2OUSTR("bottom"));
5167 + pStrm->StartElement( A2OUSTR("style:column-sep") );
5168 + pStrm->EndElement( A2OUSTR("style:column-sep") );
5171 +void XFColumns::SetSeperator(sal_Int32 height, double width, XFColor color,enumXFAlignType align)
5173 + m_aSeperator.SetRelHeight(height);
5174 + m_aSeperator.SetWidth(0.1);
5175 + m_aSeperator.SetColor(color);
5176 + m_aSeperator.SetVerticalAlign(align);
5177 + m_nFlag |= XFCOLUMNS_FLAG_SEPERATOR;
5180 +void XFColumns::SetSeperator(XFColumnSep& aSeperator)
5182 + m_aSeperator = aSeperator;
5183 + m_nFlag |= XFCOLUMNS_FLAG_SEPERATOR;
5186 +void XFColumns::AddColumn(XFColumn& column)
5188 + m_aColumns.push_back(column);
5191 +sal_Int32 XFColumns::GetCount()
5193 + return m_aColumns.size();;
5196 +void XFColumns::SetGap(double fGap)
5198 + m_fGap = fGap;
5199 + m_nFlag |= XFCOLUMNS_FLAG_GAP;
5202 +void XFColumns::SetCount(sal_uInt16 nCount)
5204 + m_nCount = nCount;
5207 +void XFColumns::ToXml(IXFStream *pStrm)
5209 + IXFAttrList *pAttrList = pStrm->GetAttrList();
5210 + pAttrList->Clear();
5212 + //pAttrList->AddAttribute( A2OUSTR("fo:column-count"), Int32ToOUString(GetCount()) );
5213 + pAttrList->AddAttribute( A2OUSTR("fo:column-count"), Int32ToOUString(m_nCount));
5214 + if( m_nFlag&XFCOLUMNS_FLAG_GAP )
5216 + pAttrList->AddAttribute( A2OUSTR("fo:column-gap"), DoubleToOUString(m_fGap)+A2OUSTR("cm") );
5219 + pStrm->StartElement( A2OUSTR("style:columns") );
5221 + if( m_nFlag&XFCOLUMNS_FLAG_SEPERATOR ) //column-sep:
5223 + m_aSeperator.ToXml(pStrm);
5226 + if(!(m_nFlag&XFCOLUMNS_FLAG_GAP) )
5228 + std::vector<XFColumn>::iterator it;
5229 + for( it = m_aColumns.begin(); it != m_aColumns.end(); it++ )
5231 + (*it).ToXml(pStrm);
5234 + pStrm->EndElement( A2OUSTR("style:columns") );
5236 \ No newline at end of file
5237 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfcolumns.hxx lotuswordpro/source/filter/xfilter/xfcolumns.hxx
5238 --- lotuswordpro.bak/source/filter/xfilter/xfcolumns.hxx 1970-01-01 08:00:00.000000000 +0800
5239 +++ lotuswordpro/source/filter/xfilter/xfcolumns.hxx 2008-10-22 11:42:34.000000000 +0800
5240 @@ -0,0 +1,180 @@
5241 +/*************************************************************************
5243 + * The Contents of this file are made available subject to the terms of
5244 + * either of the following licenses
5246 + * - GNU Lesser General Public License Version 2.1
5247 + * - Sun Industry Standards Source License Version 1.1
5249 + * Sun Microsystems Inc., October, 2000
5251 + * GNU Lesser General Public License Version 2.1
5252 + * =============================================
5253 + * Copyright 2000 by Sun Microsystems, Inc.
5254 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
5256 + * This library is free software; you can redistribute it and/or
5257 + * modify it under the terms of the GNU Lesser General Public
5258 + * License version 2.1, as published by the Free Software Foundation.
5260 + * This library is distributed in the hope that it will be useful,
5261 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
5262 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5263 + * Lesser General Public License for more details.
5265 + * You should have received a copy of the GNU Lesser General Public
5266 + * License along with this library; if not, write to the Free Software
5267 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
5268 + * MA 02111-1307 USA
5271 + * Sun Industry Standards Source License Version 1.1
5272 + * =================================================
5273 + * The contents of this file are subject to the Sun Industry Standards
5274 + * Source License Version 1.1 (the "License"); You may not use this file
5275 + * except in compliance with the License. You may obtain a copy of the
5276 + * License at http://www.openoffice.org/license.html.
5278 + * Software provided under this License is provided on an "AS IS" basis,
5279 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
5280 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
5281 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
5282 + * See the License for the specific provisions governing your rights and
5283 + * obligations concerning the Software.
5285 + * The Initial Developer of the Original Code is: IBM Corporation
5287 + * Copyright: 2008 by IBM Corporation
5289 + * All Rights Reserved.
5291 + * Contributor(s): _______________________________________
5294 + ************************************************************************/
5295 +/*************************************************************************
5296 + * @file
5297 + * Columns styles for section, or paragraph.
5298 + ************************************************************************/
5299 +/*************************************************************************
5300 + * Change History
5301 + * 2005-01-17 create this file.
5302 + ************************************************************************/
5303 +#ifndef _XFCOLUMNS_HXX
5304 +#define _XFCOLUMNS_HXX
5306 +#include "xfglobal.hxx"
5307 +#include "xfcolor.hxx"
5308 +#include <vector>
5310 +#define XFCOLUMNS_FLAG_SEPERATOR 0X00000001
5311 +#define XFCOLUMNS_FLAG_GAP 0X00000010
5313 +/**
5314 + * @descr Columns object for page or section.
5315 + */
5316 +class XFColumn : public IXFObject
5318 +public:
5319 + XFColumn()
5321 + m_nRelWidth = 0;
5322 + m_fMarginLeft = 0;
5323 + m_fMarginRight = 0;
5326 +public:
5327 + /**
5328 + * @descr Set column relative width.
5329 + */
5330 + void SetRelWidth(sal_Int32 width);
5332 + /**
5333 + * @descr return column relative width.
5334 + */
5335 + sal_Int32 GetRelWidth();
5337 + /**
5338 + * @descr Set column margin left and margin right.
5339 + */
5340 + void SetMargins(double left, double right);
5342 + /**
5343 + * @descr return column left margin.
5344 + */
5345 + double GetMarginLeft();
5347 + /**
5348 + * @descr return column right margin.
5349 + */
5350 + double GetMarginRight();
5352 + /**
5353 + * @descr output column style as an xml node.
5354 + */
5355 + virtual void ToXml(IXFStream *pStrm);
5357 + friend bool operator==(XFColumn& c1, XFColumn& c2);
5358 + friend bool operator!=(XFColumn& c1, XFColumn& c2);
5359 + friend class XFColumns;
5361 +private:
5362 + sal_Int32 m_nRelWidth;
5363 + double m_fMarginLeft;
5364 + double m_fMarginRight;
5367 +class XFColumnSep : public IXFObject
5369 +public:
5370 + XFColumnSep()
5372 + m_nRelHeight = 100;
5373 + m_fWidth = 0;
5374 + m_eVertAlign = enumXFAlignMiddle;
5376 +public:
5377 + void SetRelHeight(sal_Int32 height);
5378 + void SetWidth(double width);
5379 + void SetColor(XFColor& color);
5380 + void SetVerticalAlign(enumXFAlignType align);
5382 + virtual void ToXml(IXFStream *pStrm);
5384 + friend bool operator==(XFColumnSep& sep1, XFColumnSep& sep2);
5385 + friend bool operator!=(XFColumnSep& sep1, XFColumnSep& sep2);
5386 + friend class XFColumns;
5387 +private:
5388 + sal_Int32 m_nRelHeight;
5389 + double m_fWidth;
5390 + XFColor m_aColor;
5391 + enumXFAlignType m_eVertAlign;
5394 +class XFColumns
5396 +public:
5397 + XFColumns()
5399 + m_nFlag = 0;
5400 + m_fGap = 0;
5402 +public:
5403 + void SetSeperator(sal_Int32 height, double width, XFColor color = XFColor(0,0,0),enumXFAlignType align = enumXFAlignMiddle);
5404 + void SetSeperator(XFColumnSep& aSeperator);
5405 + void SetGap(double fGap);
5406 + void SetCount(sal_uInt16 nCount);
5407 + void AddColumn(XFColumn& column);
5408 + sal_Int32 GetCount();
5410 + void ToXml(IXFStream *pStrm);
5411 +private:
5412 + sal_Int32 m_nFlag;
5413 + sal_uInt16 m_nCount;
5414 + double m_fGap;
5415 + std::vector<XFColumn> m_aColumns;
5416 + XFColumnSep m_aSeperator;
5420 +#endif
5421 \ No newline at end of file
5422 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfconditionformat.hxx lotuswordpro/source/filter/xfilter/xfconditionformat.hxx
5423 --- lotuswordpro.bak/source/filter/xfilter/xfconditionformat.hxx 1970-01-01 08:00:00.000000000 +0800
5424 +++ lotuswordpro/source/filter/xfilter/xfconditionformat.hxx 2008-10-22 11:42:34.000000000 +0800
5425 @@ -0,0 +1,70 @@
5426 +/*************************************************************************
5428 + * The Contents of this file are made available subject to the terms of
5429 + * either of the following licenses
5431 + * - GNU Lesser General Public License Version 2.1
5432 + * - Sun Industry Standards Source License Version 1.1
5434 + * Sun Microsystems Inc., October, 2000
5436 + * GNU Lesser General Public License Version 2.1
5437 + * =============================================
5438 + * Copyright 2000 by Sun Microsystems, Inc.
5439 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
5441 + * This library is free software; you can redistribute it and/or
5442 + * modify it under the terms of the GNU Lesser General Public
5443 + * License version 2.1, as published by the Free Software Foundation.
5445 + * This library is distributed in the hope that it will be useful,
5446 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
5447 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5448 + * Lesser General Public License for more details.
5450 + * You should have received a copy of the GNU Lesser General Public
5451 + * License along with this library; if not, write to the Free Software
5452 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
5453 + * MA 02111-1307 USA
5456 + * Sun Industry Standards Source License Version 1.1
5457 + * =================================================
5458 + * The contents of this file are subject to the Sun Industry Standards
5459 + * Source License Version 1.1 (the "License"); You may not use this file
5460 + * except in compliance with the License. You may obtain a copy of the
5461 + * License at http://www.openoffice.org/license.html.
5463 + * Software provided under this License is provided on an "AS IS" basis,
5464 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
5465 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
5466 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
5467 + * See the License for the specific provisions governing your rights and
5468 + * obligations concerning the Software.
5470 + * The Initial Developer of the Original Code is: IBM Corporation
5472 + * Copyright: 2008 by IBM Corporation
5474 + * All Rights Reserved.
5476 + * Contributor(s): _______________________________________
5479 + ************************************************************************/
5480 +#ifndef _XFCONDITIONFORMAT_HXX
5481 +#define _XFCONDITIONFORMAT_HXX
5483 +class XFConditionFormat
5485 +public:
5486 + XFConditionFormat();
5488 +public:
5489 + void SetCondition();
5491 +private:
5495 +#endif
5496 \ No newline at end of file
5497 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfconfigmanager.cxx lotuswordpro/source/filter/xfilter/xfconfigmanager.cxx
5498 --- lotuswordpro.bak/source/filter/xfilter/xfconfigmanager.cxx 1970-01-01 08:00:00.000000000 +0800
5499 +++ lotuswordpro/source/filter/xfilter/xfconfigmanager.cxx 2008-10-22 11:42:34.000000000 +0800
5500 @@ -0,0 +1,108 @@
5501 +/*************************************************************************
5503 + * The Contents of this file are made available subject to the terms of
5504 + * either of the following licenses
5506 + * - GNU Lesser General Public License Version 2.1
5507 + * - Sun Industry Standards Source License Version 1.1
5509 + * Sun Microsystems Inc., October, 2000
5511 + * GNU Lesser General Public License Version 2.1
5512 + * =============================================
5513 + * Copyright 2000 by Sun Microsystems, Inc.
5514 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
5516 + * This library is free software; you can redistribute it and/or
5517 + * modify it under the terms of the GNU Lesser General Public
5518 + * License version 2.1, as published by the Free Software Foundation.
5520 + * This library is distributed in the hope that it will be useful,
5521 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
5522 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5523 + * Lesser General Public License for more details.
5525 + * You should have received a copy of the GNU Lesser General Public
5526 + * License along with this library; if not, write to the Free Software
5527 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
5528 + * MA 02111-1307 USA
5531 + * Sun Industry Standards Source License Version 1.1
5532 + * =================================================
5533 + * The contents of this file are subject to the Sun Industry Standards
5534 + * Source License Version 1.1 (the "License"); You may not use this file
5535 + * except in compliance with the License. You may obtain a copy of the
5536 + * License at http://www.openoffice.org/license.html.
5538 + * Software provided under this License is provided on an "AS IS" basis,
5539 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
5540 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
5541 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
5542 + * See the License for the specific provisions governing your rights and
5543 + * obligations concerning the Software.
5545 + * The Initial Developer of the Original Code is: IBM Corporation
5547 + * Copyright: 2008 by IBM Corporation
5549 + * All Rights Reserved.
5551 + * Contributor(s): _______________________________________
5554 + ************************************************************************/
5555 +/*************************************************************************
5556 + * @file
5557 + * Manager for all config object,include line number config.
5558 + ************************************************************************/
5559 +/*************************************************************************
5560 + * Change History
5561 + * 2005-03-23 create this file.
5562 + ************************************************************************/
5563 +#include "xfconfigmanager.hxx"
5565 +XFConfigManager::XFConfigManager()
5567 + m_pLineNumberConfig = NULL;
5568 + m_pFootnoteConfig = NULL;
5569 + m_pEndnoteConfig = NULL;
5572 +void XFConfigManager::SetLineNumberConfig(XFLineNumberConfig *pLNConfig)
5574 + if( m_pLineNumberConfig )
5575 + delete m_pLineNumberConfig;
5576 + m_pLineNumberConfig = pLNConfig;
5579 +void XFConfigManager::SetFootnoteConfig(XFFootnoteConfig *pFNConfig)
5581 + if( m_pFootnoteConfig )
5582 + delete m_pFootnoteConfig;
5583 + m_pFootnoteConfig = pFNConfig;
5586 +void XFConfigManager::SetEndnoteConfig(XFEndnoteConfig *pENConfig)
5588 + if( m_pEndnoteConfig )
5589 + delete m_pEndnoteConfig;
5590 + m_pEndnoteConfig = pENConfig;
5593 +void XFConfigManager::ToXml(IXFStream *pStrm)
5595 + if( m_pLineNumberConfig )
5596 + AddStyle(m_pLineNumberConfig);
5597 + if( m_pFootnoteConfig )
5598 + AddStyle(m_pFootnoteConfig);
5599 + if( m_pEndnoteConfig )
5600 + AddStyle(m_pEndnoteConfig);
5602 + XFStyleContainer::ToXml(pStrm);
5603 + XFStyleContainer::Reset();
5604 + m_pLineNumberConfig = NULL;
5605 + m_pFootnoteConfig = NULL;
5606 + m_pEndnoteConfig = NULL;
5609 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfconfigmanager.hxx lotuswordpro/source/filter/xfilter/xfconfigmanager.hxx
5610 --- lotuswordpro.bak/source/filter/xfilter/xfconfigmanager.hxx 1970-01-01 08:00:00.000000000 +0800
5611 +++ lotuswordpro/source/filter/xfilter/xfconfigmanager.hxx 2008-10-22 11:42:34.000000000 +0800
5612 @@ -0,0 +1,110 @@
5613 +/*************************************************************************
5615 + * The Contents of this file are made available subject to the terms of
5616 + * either of the following licenses
5618 + * - GNU Lesser General Public License Version 2.1
5619 + * - Sun Industry Standards Source License Version 1.1
5621 + * Sun Microsystems Inc., October, 2000
5623 + * GNU Lesser General Public License Version 2.1
5624 + * =============================================
5625 + * Copyright 2000 by Sun Microsystems, Inc.
5626 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
5628 + * This library is free software; you can redistribute it and/or
5629 + * modify it under the terms of the GNU Lesser General Public
5630 + * License version 2.1, as published by the Free Software Foundation.
5632 + * This library is distributed in the hope that it will be useful,
5633 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
5634 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5635 + * Lesser General Public License for more details.
5637 + * You should have received a copy of the GNU Lesser General Public
5638 + * License along with this library; if not, write to the Free Software
5639 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
5640 + * MA 02111-1307 USA
5643 + * Sun Industry Standards Source License Version 1.1
5644 + * =================================================
5645 + * The contents of this file are subject to the Sun Industry Standards
5646 + * Source License Version 1.1 (the "License"); You may not use this file
5647 + * except in compliance with the License. You may obtain a copy of the
5648 + * License at http://www.openoffice.org/license.html.
5650 + * Software provided under this License is provided on an "AS IS" basis,
5651 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
5652 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
5653 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
5654 + * See the License for the specific provisions governing your rights and
5655 + * obligations concerning the Software.
5657 + * The Initial Developer of the Original Code is: IBM Corporation
5659 + * Copyright: 2008 by IBM Corporation
5661 + * All Rights Reserved.
5663 + * Contributor(s): _______________________________________
5666 + ************************************************************************/
5667 +/*************************************************************************
5668 + * @file
5669 + * Manager for all config object,include line number config.
5670 + ************************************************************************/
5671 +/*************************************************************************
5672 + * Change History
5673 + * 2005-03-23 create this file.
5674 + ************************************************************************/
5675 +#ifndef _XFCONFIGMANAGER_HXX
5676 +#define _XFCONFIGMANAGER_HXX
5678 +#include "xfstylecont.hxx"
5679 +#include "xflinenumberconfig.hxx"
5680 +#include "xffootnoteconfig.hxx"
5681 +#include "xfendnoteconfig.hxx"
5682 +#include "xfdefs.hxx"
5684 +/**
5685 + * @brief
5686 + * Config infomation for OOo document, ie, line count config, endnote and footnote config.
5687 + * This object should only exist one instance.
5688 + * Don't make this obejct an singleton because it's managed by XFStyleManager.
5689 + */
5690 +class XFConfigManager : public XFStyleContainer
5692 +public:
5693 + XFConfigManager();
5695 +public:
5696 + /**
5697 + * @descr Set line number config.
5698 + */
5699 + void SetLineNumberConfig(XFLineNumberConfig *pLNConfig);
5701 + /**
5702 + * @descr Set footnote config.
5703 + */
5704 + void SetFootnoteConfig(XFFootnoteConfig *pFNConfig);
5706 + /**
5707 + * @descr Set endnote config.
5708 + */
5709 + void SetEndnoteConfig(XFEndnoteConfig *pFNConfig);
5711 + /**
5712 + * @descr Output config information.
5713 + */
5714 + virtual void ToXml(IXFStream *pStrm);
5716 +private:
5717 + XFLineNumberConfig *m_pLineNumberConfig;
5718 + XFFootnoteConfig *m_pFootnoteConfig;
5719 + XFEndnoteConfig *m_pEndnoteConfig;
5722 +#endif
5723 \ No newline at end of file
5724 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfcontentcontainer.cxx lotuswordpro/source/filter/xfilter/xfcontentcontainer.cxx
5725 --- lotuswordpro.bak/source/filter/xfilter/xfcontentcontainer.cxx 1970-01-01 08:00:00.000000000 +0800
5726 +++ lotuswordpro/source/filter/xfilter/xfcontentcontainer.cxx 2008-10-22 11:42:34.000000000 +0800
5727 @@ -0,0 +1,218 @@
5728 +/*************************************************************************
5730 + * The Contents of this file are made available subject to the terms of
5731 + * either of the following licenses
5733 + * - GNU Lesser General Public License Version 2.1
5734 + * - Sun Industry Standards Source License Version 1.1
5736 + * Sun Microsystems Inc., October, 2000
5738 + * GNU Lesser General Public License Version 2.1
5739 + * =============================================
5740 + * Copyright 2000 by Sun Microsystems, Inc.
5741 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
5743 + * This library is free software; you can redistribute it and/or
5744 + * modify it under the terms of the GNU Lesser General Public
5745 + * License version 2.1, as published by the Free Software Foundation.
5747 + * This library is distributed in the hope that it will be useful,
5748 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
5749 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5750 + * Lesser General Public License for more details.
5752 + * You should have received a copy of the GNU Lesser General Public
5753 + * License along with this library; if not, write to the Free Software
5754 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
5755 + * MA 02111-1307 USA
5758 + * Sun Industry Standards Source License Version 1.1
5759 + * =================================================
5760 + * The contents of this file are subject to the Sun Industry Standards
5761 + * Source License Version 1.1 (the "License"); You may not use this file
5762 + * except in compliance with the License. You may obtain a copy of the
5763 + * License at http://www.openoffice.org/license.html.
5765 + * Software provided under this License is provided on an "AS IS" basis,
5766 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
5767 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
5768 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
5769 + * See the License for the specific provisions governing your rights and
5770 + * obligations concerning the Software.
5772 + * The Initial Developer of the Original Code is: IBM Corporation
5774 + * Copyright: 2008 by IBM Corporation
5776 + * All Rights Reserved.
5778 + * Contributor(s): _______________________________________
5781 + ************************************************************************/
5782 +/*************************************************************************
5783 + * @file
5784 + * Container for content.It will destroy all children when destroy.
5785 + ************************************************************************/
5786 +/*************************************************************************
5787 + * Change History
5788 + * 2005-01-27 create this file.
5789 + * 2005-04-08 add copy constructure.
5790 + ************************************************************************/
5791 +#include "xfcontentcontainer.hxx"
5792 +#include "xftextcontent.hxx"
5794 +XFContentContainer::XFContentContainer()
5798 +XFContentContainer::XFContentContainer(const XFContentContainer& other)
5800 + std::vector<IXFContent*>::const_iterator it;
5802 + for( it = other.m_aContents.begin(); it != other.m_aContents.end(); it++ )
5804 + IXFContent *pContent = *it;
5805 + if( pContent )
5807 + IXFContent *pClone = pContent->Clone();
5808 + if( pClone )
5809 + Add(pClone);
5814 +XFContentContainer& XFContentContainer::operator=(const XFContentContainer& other)
5816 + std::vector<IXFContent*>::const_iterator it;
5818 + for( it = other.m_aContents.begin(); it != other.m_aContents.end(); it++ )
5820 + IXFContent *pContent = *it;
5821 + if( pContent )
5823 + IXFContent *pClone = pContent->Clone();
5824 + if( pClone )
5825 + Add(pClone);
5828 + return *this;
5831 +XFContentContainer::~XFContentContainer()
5833 + std::vector<IXFContent*>::iterator it;
5835 + for( it = m_aContents.begin(); it != m_aContents.end(); it++ )
5837 + IXFContent *pContent = *it;
5838 + if( pContent )
5839 + delete pContent;
5843 +void XFContentContainer::Add(IXFContent *pContent)
5845 + m_aContents.push_back(pContent);
5848 +void XFContentContainer::InsertAtBegin(IXFContent * pContent)
5850 + m_aContents.insert(m_aContents.begin(), pContent);
5852 +void XFContentContainer::RemoveAt(sal_uInt32 nPos)
5854 + m_aContents.erase(m_aContents.begin()+nPos);
5856 +void XFContentContainer::Add(const rtl::OUString& text)
5858 + XFTextContent *pTC = new XFTextContent();
5859 + pTC->SetText(text);
5860 + Add(pTC);
5863 +int XFContentContainer::GetCount() const
5865 + return m_aContents.size();
5868 +void XFContentContainer::Reset()
5870 + std::vector<IXFContent*>::iterator it;
5872 + for( it = m_aContents.begin(); it != m_aContents.end(); it++ )
5874 + IXFContent *pContent = *it;
5875 + if( pContent )
5876 + delete pContent;
5878 + m_aContents.clear();
5882 +IXFContent* XFContentContainer::FindFirstContent(enumXFContent type)
5884 + IXFContent *pRet = NULL;
5885 + IXFContent *pContent = NULL;
5887 + for( int i=0; i<GetCount(); i++ )
5889 + pContent = GetContent(i);
5890 + if( !pContent )
5891 + continue;
5893 + enumXFContent eType = pContent->GetContentType();
5894 + if( eType == type )
5895 + return pContent;
5896 + else
5898 + XFContentContainer *pChildCont = static_cast<XFContentContainer*>(pContent);
5899 + if( pChildCont )
5901 + pRet = pChildCont->FindFirstContent(type);
5902 + if( pRet )
5903 + return pRet;
5907 + return pRet;
5910 +enumXFContent XFContentContainer::GetContentType()
5912 + return enumXFContentContainer;
5915 +void XFContentContainer::ToXml(IXFStream *pStrm)
5917 + std::vector<IXFContent*>::iterator it;
5919 + for( it = m_aContents.begin(); it != m_aContents.end(); it++ )
5921 + IXFContent *pContent = *it;
5922 + if( pContent )
5923 + pContent->ToXml(pStrm);
5927 +IXFContent* XFContentContainer::GetLastContent()
5929 + sal_uInt32 index = m_aContents.size()-1;
5930 + if(index >0)
5932 + return m_aContents[index];
5935 + return NULL;
5938 +void XFContentContainer::RemoveLastContent()
5940 + sal_uInt32 index = m_aContents.size()-1;
5941 + if(index >0)
5943 + m_aContents.erase(m_aContents.begin() + index);
5946 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfcontentcontainer.hxx lotuswordpro/source/filter/xfilter/xfcontentcontainer.hxx
5947 --- lotuswordpro.bak/source/filter/xfilter/xfcontentcontainer.hxx 1970-01-01 08:00:00.000000000 +0800
5948 +++ lotuswordpro/source/filter/xfilter/xfcontentcontainer.hxx 2008-10-22 11:42:34.000000000 +0800
5949 @@ -0,0 +1,143 @@
5950 +/*************************************************************************
5952 + * The Contents of this file are made available subject to the terms of
5953 + * either of the following licenses
5955 + * - GNU Lesser General Public License Version 2.1
5956 + * - Sun Industry Standards Source License Version 1.1
5958 + * Sun Microsystems Inc., October, 2000
5960 + * GNU Lesser General Public License Version 2.1
5961 + * =============================================
5962 + * Copyright 2000 by Sun Microsystems, Inc.
5963 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
5965 + * This library is free software; you can redistribute it and/or
5966 + * modify it under the terms of the GNU Lesser General Public
5967 + * License version 2.1, as published by the Free Software Foundation.
5969 + * This library is distributed in the hope that it will be useful,
5970 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
5971 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5972 + * Lesser General Public License for more details.
5974 + * You should have received a copy of the GNU Lesser General Public
5975 + * License along with this library; if not, write to the Free Software
5976 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
5977 + * MA 02111-1307 USA
5980 + * Sun Industry Standards Source License Version 1.1
5981 + * =================================================
5982 + * The contents of this file are subject to the Sun Industry Standards
5983 + * Source License Version 1.1 (the "License"); You may not use this file
5984 + * except in compliance with the License. You may obtain a copy of the
5985 + * License at http://www.openoffice.org/license.html.
5987 + * Software provided under this License is provided on an "AS IS" basis,
5988 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
5989 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
5990 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
5991 + * See the License for the specific provisions governing your rights and
5992 + * obligations concerning the Software.
5994 + * The Initial Developer of the Original Code is: IBM Corporation
5996 + * Copyright: 2008 by IBM Corporation
5998 + * All Rights Reserved.
6000 + * Contributor(s): _______________________________________
6003 + ************************************************************************/
6004 +/*************************************************************************
6005 + * @file
6006 + * Container for content.It will destroy all children when destroy.
6007 + ************************************************************************/
6008 +/*************************************************************************
6009 + * Change History
6010 + * 2005-01-27 create this file.
6011 + * 2005-04-20 change add to virtual.
6012 + ************************************************************************/
6013 +#ifndef _XFCONTENTCONTAINER_HXX
6014 +#define _XFCONTENTCONTAINER_HXX
6016 +#include "xfcontent.hxx"
6017 +#include <vector>
6019 +/**
6020 + * @brief
6021 + * A container for content.
6022 + * The contents will be deleted when delete container.
6023 + */
6024 +class XFContentContainer : public XFContent
6026 +public:
6027 + XFContentContainer();
6029 + XFContentContainer(const XFContentContainer& other);
6031 + XFContentContainer& operator=(const XFContentContainer& other);
6033 + /**
6034 + * @descr Destructure, all contents will be deleted too.
6035 + */
6036 + virtual ~XFContentContainer();
6038 +public:
6039 + /**
6040 + * @descr Add conent.
6041 + */
6042 + virtual void Add(IXFContent *pContent);
6044 + virtual void InsertAtBegin(IXFContent *pContent);
6045 + virtual void RemoveAt(sal_uInt32 nPos);
6046 + virtual IXFContent* GetLastContent();
6047 + virtual void RemoveLastContent();
6048 + /**
6049 + * @descr convience function for add text content.
6050 + */
6051 + virtual void Add(const rtl::OUString& text);
6053 + /**
6054 + * @descr return the number of contents in the container.
6055 + */
6056 + int GetCount() const;
6058 + /**
6059 + * @descr get content by index.
6060 + */
6061 + IXFContent* GetContent(sal_uInt32 index) const;
6063 + /**
6064 + * @descr clear all contents in the container.
6065 + */
6066 + void Reset();
6068 + /**
6069 + * @descr helper function, find first content by type.
6070 + */
6071 + IXFContent* FindFirstContent(enumXFContent type);
6073 + /**
6074 + * @descr return the content type.
6075 + */
6076 + virtual enumXFContent GetContentType();
6077 + /**
6078 + * @descr Output to OOo model or local file.
6079 + */
6080 + virtual void ToXml(IXFStream *pStrm);
6082 +private:
6083 + std::vector<IXFContent*> m_aContents;
6086 +inline IXFContent* XFContentContainer::GetContent(sal_uInt32 index) const
6088 + if( index<0 || index>m_aContents.size()-1 )
6089 + return NULL;
6090 + return m_aContents[index];
6092 +#endif
6093 \ No newline at end of file
6094 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfcontent.hxx lotuswordpro/source/filter/xfilter/xfcontent.hxx
6095 --- lotuswordpro.bak/source/filter/xfilter/xfcontent.hxx 1970-01-01 08:00:00.000000000 +0800
6096 +++ lotuswordpro/source/filter/xfilter/xfcontent.hxx 2008-10-22 11:42:34.000000000 +0800
6097 @@ -0,0 +1,100 @@
6098 +/*************************************************************************
6100 + * The Contents of this file are made available subject to the terms of
6101 + * either of the following licenses
6103 + * - GNU Lesser General Public License Version 2.1
6104 + * - Sun Industry Standards Source License Version 1.1
6106 + * Sun Microsystems Inc., October, 2000
6108 + * GNU Lesser General Public License Version 2.1
6109 + * =============================================
6110 + * Copyright 2000 by Sun Microsystems, Inc.
6111 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
6113 + * This library is free software; you can redistribute it and/or
6114 + * modify it under the terms of the GNU Lesser General Public
6115 + * License version 2.1, as published by the Free Software Foundation.
6117 + * This library is distributed in the hope that it will be useful,
6118 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
6119 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
6120 + * Lesser General Public License for more details.
6122 + * You should have received a copy of the GNU Lesser General Public
6123 + * License along with this library; if not, write to the Free Software
6124 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
6125 + * MA 02111-1307 USA
6128 + * Sun Industry Standards Source License Version 1.1
6129 + * =================================================
6130 + * The contents of this file are subject to the Sun Industry Standards
6131 + * Source License Version 1.1 (the "License"); You may not use this file
6132 + * except in compliance with the License. You may obtain a copy of the
6133 + * License at http://www.openoffice.org/license.html.
6135 + * Software provided under this License is provided on an "AS IS" basis,
6136 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
6137 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
6138 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
6139 + * See the License for the specific provisions governing your rights and
6140 + * obligations concerning the Software.
6142 + * The Initial Developer of the Original Code is: IBM Corporation
6144 + * Copyright: 2008 by IBM Corporation
6146 + * All Rights Reserved.
6148 + * Contributor(s): _______________________________________
6151 + ************************************************************************/
6152 +/*************************************************************************
6153 + * @file
6154 + * Base class for the all content object,ie. text,paragraph,picture,and so on.
6155 + ************************************************************************/
6156 +/*************************************************************************
6157 + * Change History
6158 + * 2004-12-23 create this file.
6159 + ************************************************************************/
6160 +#ifndef _XFCONTENT_HXX
6161 +#define _XFCONTENT_HXX
6163 +#include "ixfcontent.hxx"
6165 +/**
6166 + * @descr
6167 + * Base class for all content object.
6168 + * There is only two properties:style name and content type in this class.
6169 + */
6170 +class XFContent : public IXFContent
6172 +public:
6173 + /**
6174 + * @short: return the content type.
6175 + */
6176 + virtual enumXFContent GetContentType(){ return enumXFContentUnknown; }
6178 + /**
6179 + * @short: All content except XFTextContent can have a style.
6180 + */
6181 + virtual void SetStyleName(rtl::OUString style){m_strStyleName = style;}
6183 + /**
6184 + * @short: return the style name.
6185 + */
6186 + virtual rtl::OUString GetStyleName(){return m_strStyleName;}
6188 + /**
6189 + */
6190 + virtual IXFContent* Clone(){return NULL;}
6192 +protected:
6193 + rtl::OUString m_strStyleName;
6196 +#endif
6198 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfcrossref.cxx lotuswordpro/source/filter/xfilter/xfcrossref.cxx
6199 --- lotuswordpro.bak/source/filter/xfilter/xfcrossref.cxx 1970-01-01 08:00:00.000000000 +0800
6200 +++ lotuswordpro/source/filter/xfilter/xfcrossref.cxx 2008-10-22 11:42:34.000000000 +0800
6201 @@ -0,0 +1,105 @@
6202 +/*************************************************************************
6204 + * The Contents of this file are made available subject to the terms of
6205 + * either of the following licenses
6207 + * - GNU Lesser General Public License Version 2.1
6208 + * - Sun Industry Standards Source License Version 1.1
6210 + * Sun Microsystems Inc., October, 2000
6212 + * GNU Lesser General Public License Version 2.1
6213 + * =============================================
6214 + * Copyright 2000 by Sun Microsystems, Inc.
6215 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
6217 + * This library is free software; you can redistribute it and/or
6218 + * modify it under the terms of the GNU Lesser General Public
6219 + * License version 2.1, as published by the Free Software Foundation.
6221 + * This library is distributed in the hope that it will be useful,
6222 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
6223 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
6224 + * Lesser General Public License for more details.
6226 + * You should have received a copy of the GNU Lesser General Public
6227 + * License along with this library; if not, write to the Free Software
6228 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
6229 + * MA 02111-1307 USA
6232 + * Sun Industry Standards Source License Version 1.1
6233 + * =================================================
6234 + * The contents of this file are subject to the Sun Industry Standards
6235 + * Source License Version 1.1 (the "License"); You may not use this file
6236 + * except in compliance with the License. You may obtain a copy of the
6237 + * License at http://www.openoffice.org/license.html.
6239 + * Software provided under this License is provided on an "AS IS" basis,
6240 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
6241 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
6242 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
6243 + * See the License for the specific provisions governing your rights and
6244 + * obligations concerning the Software.
6246 + * The Initial Developer of the Original Code is: IBM Corporation
6248 + * Copyright: 2008 by IBM Corporation
6250 + * All Rights Reserved.
6252 + * Contributor(s): _______________________________________
6255 + ************************************************************************/
6256 +/*************************************************************************
6257 + * @file
6258 + * index entry object.
6259 + ************************************************************************/
6260 +/*************************************************************************
6261 + * Change History
6262 + * 2005-05-17 create this file.
6263 + ************************************************************************/
6264 +#include "xfcrossref.hxx"
6266 +XFCrossRefStart::XFCrossRefStart()
6270 +XFCrossRefStart::~XFCrossRefStart()
6274 +void XFCrossRefStart::ToXml(IXFStream *pStrm)
6276 + IXFAttrList *pAttrList = pStrm->GetAttrList();
6277 + pAttrList->Clear();
6279 + if( m_nType == CROSSREF_TEXT)
6281 + pAttrList->AddAttribute( A2OUSTR("text:reference-format"),A2OUSTR("text") );
6283 + else if( m_nType == CROSSREF_PAGE )
6285 + pAttrList->AddAttribute( A2OUSTR("text:reference-format"), A2OUSTR("page") );
6287 + else if( m_nType == CROSSREF_PARANUMBER )
6289 + pAttrList->AddAttribute( A2OUSTR("text:reference-format"), A2OUSTR("chapter") );
6291 + pAttrList->AddAttribute( A2OUSTR("text:ref-name"), m_strMarkName);
6292 + pStrm->StartElement( A2OUSTR("text:bookmark-ref") );
6295 +XFCrossRefEnd::XFCrossRefEnd()
6299 +XFCrossRefEnd::~XFCrossRefEnd()
6303 +void XFCrossRefEnd::ToXml(IXFStream *pStrm)
6305 + pStrm->EndElement( A2OUSTR("text:bookmark-ref") );
6307 \ No newline at end of file
6308 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfcrossref.hxx lotuswordpro/source/filter/xfilter/xfcrossref.hxx
6309 --- lotuswordpro.bak/source/filter/xfilter/xfcrossref.hxx 1970-01-01 08:00:00.000000000 +0800
6310 +++ lotuswordpro/source/filter/xfilter/xfcrossref.hxx 2008-10-22 11:42:34.000000000 +0800
6311 @@ -0,0 +1,109 @@
6312 +/*************************************************************************
6314 + * The Contents of this file are made available subject to the terms of
6315 + * either of the following licenses
6317 + * - GNU Lesser General Public License Version 2.1
6318 + * - Sun Industry Standards Source License Version 1.1
6320 + * Sun Microsystems Inc., October, 2000
6322 + * GNU Lesser General Public License Version 2.1
6323 + * =============================================
6324 + * Copyright 2000 by Sun Microsystems, Inc.
6325 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
6327 + * This library is free software; you can redistribute it and/or
6328 + * modify it under the terms of the GNU Lesser General Public
6329 + * License version 2.1, as published by the Free Software Foundation.
6331 + * This library is distributed in the hope that it will be useful,
6332 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
6333 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
6334 + * Lesser General Public License for more details.
6336 + * You should have received a copy of the GNU Lesser General Public
6337 + * License along with this library; if not, write to the Free Software
6338 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
6339 + * MA 02111-1307 USA
6342 + * Sun Industry Standards Source License Version 1.1
6343 + * =================================================
6344 + * The contents of this file are subject to the Sun Industry Standards
6345 + * Source License Version 1.1 (the "License"); You may not use this file
6346 + * except in compliance with the License. You may obtain a copy of the
6347 + * License at http://www.openoffice.org/license.html.
6349 + * Software provided under this License is provided on an "AS IS" basis,
6350 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
6351 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
6352 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
6353 + * See the License for the specific provisions governing your rights and
6354 + * obligations concerning the Software.
6356 + * The Initial Developer of the Original Code is: IBM Corporation
6358 + * Copyright: 2008 by IBM Corporation
6360 + * All Rights Reserved.
6362 + * Contributor(s): _______________________________________
6365 + ************************************************************************/
6366 +/*************************************************************************
6367 + * @file
6368 + * cross reference object.
6369 + ************************************************************************/
6370 +/*************************************************************************
6371 + * Change History
6372 + * 2005-05-17 create this file.
6373 + ************************************************************************/
6374 +#ifndef _XFCROSSREF_HXX
6375 +#define _XFCROSSREF_HXX
6377 +#include "xfcontent.hxx"
6379 +/**
6380 + * @brief
6381 + * Index entry obejct.
6382 + */
6383 +class XFCrossRefStart : public XFContent
6385 +public:
6386 + XFCrossRefStart();
6387 + ~XFCrossRefStart();
6388 + void SetRefType(sal_uInt8 nType);
6389 + void SetMarkName(rtl::OUString sName);
6390 + void ToXml(IXFStream *pStrm);
6391 +private:
6392 + enum{
6393 + CROSSREF_INVALID = 0,
6394 + CROSSREF_TEXT = 1,
6395 + CROSSREF_PAGE = 2,
6396 + CROSSREF_PARANUMBER = 3
6397 + };
6398 + sal_uInt8 m_nType;
6399 + rtl::OUString m_strMarkName;
6402 +inline void XFCrossRefStart::SetRefType(sal_uInt8 nType)
6404 + m_nType = nType;
6407 +inline void XFCrossRefStart::SetMarkName(rtl::OUString sName)
6409 + m_strMarkName = sName;
6412 +class XFCrossRefEnd : public XFContent
6414 +public:
6415 + XFCrossRefEnd();
6416 + ~XFCrossRefEnd();
6417 + void ToXml(IXFStream *pStrm);
6420 +#endif
6421 \ No newline at end of file
6422 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdate.cxx lotuswordpro/source/filter/xfilter/xfdate.cxx
6423 --- lotuswordpro.bak/source/filter/xfilter/xfdate.cxx 1970-01-01 08:00:00.000000000 +0800
6424 +++ lotuswordpro/source/filter/xfilter/xfdate.cxx 2008-10-22 11:42:34.000000000 +0800
6425 @@ -0,0 +1,118 @@
6426 +/*************************************************************************
6428 + * The Contents of this file are made available subject to the terms of
6429 + * either of the following licenses
6431 + * - GNU Lesser General Public License Version 2.1
6432 + * - Sun Industry Standards Source License Version 1.1
6434 + * Sun Microsystems Inc., October, 2000
6436 + * GNU Lesser General Public License Version 2.1
6437 + * =============================================
6438 + * Copyright 2000 by Sun Microsystems, Inc.
6439 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
6441 + * This library is free software; you can redistribute it and/or
6442 + * modify it under the terms of the GNU Lesser General Public
6443 + * License version 2.1, as published by the Free Software Foundation.
6445 + * This library is distributed in the hope that it will be useful,
6446 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
6447 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
6448 + * Lesser General Public License for more details.
6450 + * You should have received a copy of the GNU Lesser General Public
6451 + * License along with this library; if not, write to the Free Software
6452 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
6453 + * MA 02111-1307 USA
6456 + * Sun Industry Standards Source License Version 1.1
6457 + * =================================================
6458 + * The contents of this file are subject to the Sun Industry Standards
6459 + * Source License Version 1.1 (the "License"); You may not use this file
6460 + * except in compliance with the License. You may obtain a copy of the
6461 + * License at http://www.openoffice.org/license.html.
6463 + * Software provided under this License is provided on an "AS IS" basis,
6464 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
6465 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
6466 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
6467 + * See the License for the specific provisions governing your rights and
6468 + * obligations concerning the Software.
6470 + * The Initial Developer of the Original Code is: IBM Corporation
6472 + * Copyright: 2008 by IBM Corporation
6474 + * All Rights Reserved.
6476 + * Contributor(s): _______________________________________
6479 + ************************************************************************/
6480 +/*************************************************************************
6481 + * @file
6482 + * Date field with date style.
6483 + ************************************************************************/
6484 +/*************************************************************************
6485 + * Change History
6486 + * 2005-01-21 create this file.
6487 + ************************************************************************/
6488 +#include "xfdate.hxx"
6490 +XFDate::XFDate()
6492 + m_bFixed = 0;
6493 + rtl_zeroMemory(&m_aDateTime,sizeof(m_aDateTime));
6494 + m_bValued = sal_False;
6497 +XFDate::~XFDate()
6502 +void XFDate::ToXml(IXFStream *pStrm)
6504 + IXFAttrList *pAttrList = pStrm->GetAttrList();
6506 + pAttrList->Clear();
6507 + if( GetStyleName().getLength() > 0 )
6508 + pAttrList->AddAttribute( A2OUSTR("style:data-style-name"), GetStyleName() );
6509 + if (m_bValued)
6510 + pAttrList->AddAttribute( A2OUSTR("text:date-value"), m_strDate );
6512 + if( m_bFixed )
6513 + pAttrList->AddAttribute( A2OUSTR("text:fixed"), A2OUSTR("true") );
6515 + pStrm->StartElement( A2OUSTR("text:date") );
6516 + if (m_strText.getLength()>0)
6517 + pStrm->Characters(m_strText);
6518 + pStrm->EndElement( A2OUSTR("text:date") );
6521 +void XFDateStart::ToXml(IXFStream *pStrm)
6523 + IXFAttrList *pAttrList = pStrm->GetAttrList();
6525 + pAttrList->Clear();
6526 + if( GetStyleName().getLength() > 0 )
6527 + pAttrList->AddAttribute( A2OUSTR("style:data-style-name"), GetStyleName() );
6528 +/* if (m_bValued)
6529 + pAttrList->AddAttribute( A2OUSTR("text:date-value"), DateTimeToOUString(m_aDateTime) );
6530 + if( m_bFixed )
6531 + pAttrList->AddAttribute( A2OUSTR("text:fixed"), A2OUSTR("true") );
6533 + pStrm->StartElement( A2OUSTR("text:date") );
6534 + if (m_strText.getLength()>0)
6535 + pStrm->Characters(m_strText);
6537 + pStrm->StartElement( A2OUSTR("text:date") );
6540 +void XFDateEnd::ToXml(IXFStream *pStrm)
6542 + pStrm->EndElement( A2OUSTR("text:date") );
6544 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdate.hxx lotuswordpro/source/filter/xfilter/xfdate.hxx
6545 --- lotuswordpro.bak/source/filter/xfilter/xfdate.hxx 1970-01-01 08:00:00.000000000 +0800
6546 +++ lotuswordpro/source/filter/xfilter/xfdate.hxx 2008-10-22 11:42:34.000000000 +0800
6547 @@ -0,0 +1,135 @@
6548 +/*************************************************************************
6550 + * The Contents of this file are made available subject to the terms of
6551 + * either of the following licenses
6553 + * - GNU Lesser General Public License Version 2.1
6554 + * - Sun Industry Standards Source License Version 1.1
6556 + * Sun Microsystems Inc., October, 2000
6558 + * GNU Lesser General Public License Version 2.1
6559 + * =============================================
6560 + * Copyright 2000 by Sun Microsystems, Inc.
6561 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
6563 + * This library is free software; you can redistribute it and/or
6564 + * modify it under the terms of the GNU Lesser General Public
6565 + * License version 2.1, as published by the Free Software Foundation.
6567 + * This library is distributed in the hope that it will be useful,
6568 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
6569 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
6570 + * Lesser General Public License for more details.
6572 + * You should have received a copy of the GNU Lesser General Public
6573 + * License along with this library; if not, write to the Free Software
6574 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
6575 + * MA 02111-1307 USA
6578 + * Sun Industry Standards Source License Version 1.1
6579 + * =================================================
6580 + * The contents of this file are subject to the Sun Industry Standards
6581 + * Source License Version 1.1 (the "License"); You may not use this file
6582 + * except in compliance with the License. You may obtain a copy of the
6583 + * License at http://www.openoffice.org/license.html.
6585 + * Software provided under this License is provided on an "AS IS" basis,
6586 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
6587 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
6588 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
6589 + * See the License for the specific provisions governing your rights and
6590 + * obligations concerning the Software.
6592 + * The Initial Developer of the Original Code is: IBM Corporation
6594 + * Copyright: 2008 by IBM Corporation
6596 + * All Rights Reserved.
6598 + * Contributor(s): _______________________________________
6601 + ************************************************************************/
6602 +/*************************************************************************
6603 + * @file
6604 + * Date field with date style.
6605 + ************************************************************************/
6606 +/*************************************************************************
6607 + * Change History
6608 + * 2005-01-21 create this file.
6609 + ************************************************************************/
6610 +#ifndef _XFDATE_HXX
6611 +#define _XFDATE_HXX
6613 +#include "xfglobal.hxx"
6614 +#include "xfcontent.hxx"
6616 +/**
6617 + * @descr Date obejct.
6618 + */
6619 +class XFDate : public XFContent
6621 +public:
6622 + XFDate();
6624 + virtual ~XFDate();
6626 +public:
6627 + void SetDate(XFDateTime& dt);
6629 + void SetDate(const rtl::OUString& date);
6631 + void SetText(rtl::OUString& text);
6633 + void SetFixed(sal_Bool fixed = sal_True);
6635 + virtual void ToXml(IXFStream *pStrm);
6637 +private:
6638 + sal_Bool m_bFixed;
6639 + rtl::OUString m_strText;
6640 + XFDateTime m_aDateTime;
6641 + rtl::OUString m_strDate;
6642 + sal_Bool m_bValued;
6645 +inline void XFDate::SetDate(XFDateTime& dt)
6647 + m_aDateTime = dt;
6648 + m_strDate = DateTimeToOUString(m_aDateTime);
6649 + m_bValued = sal_True;
6652 +inline void XFDate::SetDate(const rtl::OUString& date)
6654 + m_strDate = date;
6655 + m_bValued = sal_True;
6658 +inline void XFDate::SetText(rtl::OUString& text)
6660 + m_strText = text;
6663 +inline void XFDate::SetFixed(sal_Bool fixed)
6665 + m_bFixed = fixed;
6668 +class XFDateStart : public XFDate
6670 +public:
6671 + virtual void ToXml(IXFStream *pStrm);
6674 +class XFDateEnd : public XFContent
6676 +public:
6677 + virtual void ToXml(IXFStream *pStrm);
6681 +#endif
6683 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdatestyle.cxx lotuswordpro/source/filter/xfilter/xfdatestyle.cxx
6684 --- lotuswordpro.bak/source/filter/xfilter/xfdatestyle.cxx 1970-01-01 08:00:00.000000000 +0800
6685 +++ lotuswordpro/source/filter/xfilter/xfdatestyle.cxx 2008-10-22 11:42:34.000000000 +0800
6686 @@ -0,0 +1,192 @@
6687 +/*************************************************************************
6689 + * The Contents of this file are made available subject to the terms of
6690 + * either of the following licenses
6692 + * - GNU Lesser General Public License Version 2.1
6693 + * - Sun Industry Standards Source License Version 1.1
6695 + * Sun Microsystems Inc., October, 2000
6697 + * GNU Lesser General Public License Version 2.1
6698 + * =============================================
6699 + * Copyright 2000 by Sun Microsystems, Inc.
6700 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
6702 + * This library is free software; you can redistribute it and/or
6703 + * modify it under the terms of the GNU Lesser General Public
6704 + * License version 2.1, as published by the Free Software Foundation.
6706 + * This library is distributed in the hope that it will be useful,
6707 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
6708 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
6709 + * Lesser General Public License for more details.
6711 + * You should have received a copy of the GNU Lesser General Public
6712 + * License along with this library; if not, write to the Free Software
6713 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
6714 + * MA 02111-1307 USA
6717 + * Sun Industry Standards Source License Version 1.1
6718 + * =================================================
6719 + * The contents of this file are subject to the Sun Industry Standards
6720 + * Source License Version 1.1 (the "License"); You may not use this file
6721 + * except in compliance with the License. You may obtain a copy of the
6722 + * License at http://www.openoffice.org/license.html.
6724 + * Software provided under this License is provided on an "AS IS" basis,
6725 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
6726 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
6727 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
6728 + * See the License for the specific provisions governing your rights and
6729 + * obligations concerning the Software.
6731 + * The Initial Developer of the Original Code is: IBM Corporation
6733 + * Copyright: 2008 by IBM Corporation
6735 + * All Rights Reserved.
6737 + * Contributor(s): _______________________________________
6740 + ************************************************************************/
6741 +/*************************************************************************
6742 + * @file
6743 + * Date style. The date format for date field.
6744 + ************************************************************************/
6745 +/*************************************************************************
6746 + * Change History
6747 + * 2005-01-20 create this file.
6748 + ************************************************************************/
6749 +#include "xfdatestyle.hxx"
6751 +XFDatePart::XFDatePart()
6753 + m_bTexture = sal_False;
6756 +void XFDatePart::ToXml(IXFStream *pStrm)
6758 + IXFAttrList *pAttrList = pStrm->GetAttrList();
6760 + switch(m_ePart)
6762 + case enumXFDateUnknown:
6763 + break;
6764 + case enumXFDateYear:
6765 + pAttrList->Clear();
6766 + if( m_bLongFmt )
6767 + pAttrList->AddAttribute( A2OUSTR("number:style"), A2OUSTR("long") );
6768 + pStrm->StartElement( A2OUSTR("number:year") );
6769 + pStrm->EndElement( A2OUSTR("number:year") );
6770 + break;
6771 + case enumXFDateMonth:
6772 + pAttrList->Clear();
6773 + if( m_bTexture )
6774 + pAttrList->AddAttribute( A2OUSTR("number:textual"), A2OUSTR("true") );
6775 + if( m_bLongFmt )
6776 + pAttrList->AddAttribute( A2OUSTR("number:style"), A2OUSTR("long") );
6777 + pStrm->StartElement( A2OUSTR("number:month") );
6778 + pStrm->EndElement( A2OUSTR("number:month") );
6779 + break;
6780 + case enumXFDateMonthDay:
6781 + pAttrList->Clear();
6782 + if( m_bLongFmt )
6783 + pAttrList->AddAttribute( A2OUSTR("number:style"), A2OUSTR("long") );
6784 + pStrm->StartElement( A2OUSTR("number:day") );
6785 + pStrm->EndElement( A2OUSTR("number:day") );
6786 + break;
6787 + case enumXFDateWeekDay:
6788 + pAttrList->Clear();
6789 + if( m_bLongFmt )
6790 + pAttrList->AddAttribute( A2OUSTR("number:style"), A2OUSTR("long") );
6791 + pStrm->StartElement( A2OUSTR("number:day-of-week") );
6792 + pStrm->EndElement( A2OUSTR("number:day-of-week") );
6793 + break;
6794 + case enumXFDateYearWeek:
6795 + pAttrList->Clear();
6796 + pStrm->StartElement( A2OUSTR("number:week-of-year") );
6797 + pStrm->EndElement( A2OUSTR("number:week-of-year") );
6798 + break;
6799 + case enumXFDateEra:
6800 + pAttrList->Clear();
6801 + if( m_bLongFmt )
6802 + pAttrList->AddAttribute( A2OUSTR("number:style"), A2OUSTR("long") );
6803 + pStrm->StartElement( A2OUSTR("number:era") );
6804 + pStrm->EndElement( A2OUSTR("number:era") );
6805 + break;
6806 + case enumXFDateQuarter:
6807 + pAttrList->Clear();
6808 + if( m_bLongFmt )
6809 + pAttrList->AddAttribute( A2OUSTR("number:style"), A2OUSTR("long") );
6810 + pStrm->StartElement( A2OUSTR("number:quarter") );
6811 + pStrm->EndElement( A2OUSTR("number:quarter") );
6812 + break;
6813 + case enumXFDateHour:
6814 + pAttrList->Clear();
6815 + if( m_bLongFmt )
6816 + pAttrList->AddAttribute( A2OUSTR("number:style"), A2OUSTR("long") );
6817 + pStrm->StartElement( A2OUSTR("number:hours") );
6818 + pStrm->EndElement( A2OUSTR("number:hours") );
6819 + break;
6820 + case enumXFDateMinute:
6821 + pAttrList->Clear();
6822 + if( m_bLongFmt )
6823 + pAttrList->AddAttribute( A2OUSTR("number:style"), A2OUSTR("long") );
6824 + pStrm->StartElement( A2OUSTR("number:minutes") );
6825 + pStrm->EndElement( A2OUSTR("number:minutes") );
6826 + break;
6827 + case enumXFDateSecond:
6828 + pAttrList->Clear();
6829 + if( m_bLongFmt )
6830 + pAttrList->AddAttribute( A2OUSTR("number:style"), A2OUSTR("long") );
6831 + if( m_nDecimalPos )
6832 + pAttrList->AddAttribute( A2OUSTR("number:decimal-places"), Int32ToOUString(m_nDecimalPos) );
6833 + pStrm->StartElement( A2OUSTR("number:seconds") );
6834 + pStrm->EndElement( A2OUSTR("number:seconds") );
6835 + break;
6836 + case enumXFDateAmPm:
6837 + pStrm->StartElement( A2OUSTR("number:am-pm") );
6838 + pStrm->EndElement( A2OUSTR("number:am-pm") );
6839 + break;
6840 + case enumXFDateText:
6841 + pAttrList->Clear();
6842 + pStrm->StartElement( A2OUSTR("number:text") );
6843 + pStrm->Characters( m_strText );
6844 + pStrm->EndElement( A2OUSTR("number:text") );
6845 + break;
6849 +XFDateStyle::XFDateStyle()
6851 + m_bFixed = sal_False;
6852 + m_bAutoOrder = sal_False;
6855 +XFDateStyle::~XFDateStyle()
6859 +enumXFStyle XFDateStyle::GetStyleFamily()
6861 + return enumXFStyleDate;
6864 +void XFDateStyle::ToXml(IXFStream *pStrm)
6866 + IXFAttrList *pAttrList = pStrm->GetAttrList();
6868 + pAttrList->Clear();
6869 + pAttrList->AddAttribute( A2OUSTR("style:name"), GetStyleName() );
6870 + pAttrList->AddAttribute( A2OUSTR("style:family"), A2OUSTR("data-style") );
6872 + pStrm->StartElement( A2OUSTR("number:date-style") );
6874 + m_aParts.ToXml(pStrm);
6876 + pStrm->EndElement( A2OUSTR("number:date-style") );
6879 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdatestyle.hxx lotuswordpro/source/filter/xfilter/xfdatestyle.hxx
6880 --- lotuswordpro.bak/source/filter/xfilter/xfdatestyle.hxx 1970-01-01 08:00:00.000000000 +0800
6881 +++ lotuswordpro/source/filter/xfilter/xfdatestyle.hxx 2008-10-22 11:42:34.000000000 +0800
6882 @@ -0,0 +1,260 @@
6883 +/*************************************************************************
6885 + * The Contents of this file are made available subject to the terms of
6886 + * either of the following licenses
6888 + * - GNU Lesser General Public License Version 2.1
6889 + * - Sun Industry Standards Source License Version 1.1
6891 + * Sun Microsystems Inc., October, 2000
6893 + * GNU Lesser General Public License Version 2.1
6894 + * =============================================
6895 + * Copyright 2000 by Sun Microsystems, Inc.
6896 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
6898 + * This library is free software; you can redistribute it and/or
6899 + * modify it under the terms of the GNU Lesser General Public
6900 + * License version 2.1, as published by the Free Software Foundation.
6902 + * This library is distributed in the hope that it will be useful,
6903 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
6904 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
6905 + * Lesser General Public License for more details.
6907 + * You should have received a copy of the GNU Lesser General Public
6908 + * License along with this library; if not, write to the Free Software
6909 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
6910 + * MA 02111-1307 USA
6913 + * Sun Industry Standards Source License Version 1.1
6914 + * =================================================
6915 + * The contents of this file are subject to the Sun Industry Standards
6916 + * Source License Version 1.1 (the "License"); You may not use this file
6917 + * except in compliance with the License. You may obtain a copy of the
6918 + * License at http://www.openoffice.org/license.html.
6920 + * Software provided under this License is provided on an "AS IS" basis,
6921 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
6922 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
6923 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
6924 + * See the License for the specific provisions governing your rights and
6925 + * obligations concerning the Software.
6927 + * The Initial Developer of the Original Code is: IBM Corporation
6929 + * Copyright: 2008 by IBM Corporation
6931 + * All Rights Reserved.
6933 + * Contributor(s): _______________________________________
6936 + ************************************************************************/
6937 +/*************************************************************************
6938 + * @file
6939 + * Date style. The date format for date field.
6940 + ************************************************************************/
6941 +/*************************************************************************
6942 + * Change History
6943 + * 2005-01-20 create this file.
6944 + ************************************************************************/
6945 +#ifndef _XFDATESTYLE_HXX
6946 +#define _XFDATESTYLE_HXX
6948 +#include "xfglobal.hxx"
6949 +#include "xfstyle.hxx"
6950 +#include "ixfproperty.hxx"
6951 +#include "xftimestyle.hxx"
6952 +#include "xfstylecont.hxx"
6953 +#include <vector>
6955 +class XFDatePart : public XFTimePart
6957 +public:
6958 + XFDatePart();
6959 +public:
6960 + void SetTexture(sal_Bool bTexture);
6962 + virtual void ToXml(IXFStream *pStrm);
6964 +private:
6965 + sal_Bool m_bTexture;
6968 +class XFDateStyle : public XFStyle
6970 +public:
6971 + XFDateStyle();
6973 + virtual ~XFDateStyle();
6975 +public:
6977 + void SetFixed(sal_Bool fixed);
6979 + void SetLanguage(rtl::OUString lang);
6981 + void SetCountry(rtl::OUString country);
6983 + void SetAutoOrder(sal_Bool bAutoOrder);
6985 + void AddYear( sal_Bool bLongFmt = sal_True );
6987 + void AddMonth( sal_Bool bLongFmt = sal_True, sal_Bool bTexture = sal_False );
6989 + void AddMonthDay( sal_Bool bLongFmt = sal_True );
6991 + void AddWeekDay( sal_Bool bLongFmt = sal_True );
6993 + void AddYearWeek();
6995 + void AddEra(sal_Bool bLongFmt = sal_False);
6997 + void AddQuarter(sal_Bool bLongFmt = sal_False);
6999 + void AddHour( sal_Bool bLongFmt = sal_True );
7001 + void AddMinute( sal_Bool bLongFmt = sal_True );
7003 + void AddSecond( sal_Bool bLongFmt = sal_True, sal_Int16 nDecimalPos = 2);
7005 + void AddAmPm(sal_Bool bAmPm);
7007 + void AddText( rtl::OUString part );
7009 + virtual enumXFStyle GetStyleFamily();
7011 + virtual void ToXml(IXFStream *pStrm);
7013 +private:
7014 + sal_Bool m_bFixed;
7015 + sal_Bool m_bAutoOrder;
7016 + rtl::OUString m_strLanguage;
7017 + rtl::OUString m_strCountry;
7018 + XFStyleContainer m_aParts;
7021 +inline void XFDatePart::SetTexture(sal_Bool bTexture)
7023 + m_bTexture = bTexture;
7026 +inline void XFDateStyle::SetFixed(sal_Bool fixed)
7028 + m_bFixed = fixed;
7031 +inline void XFDateStyle::SetLanguage(rtl::OUString lang)
7033 + m_strLanguage = lang;
7036 +inline void XFDateStyle::SetCountry(rtl::OUString country)
7038 + m_strCountry = country;
7041 +inline void XFDateStyle::SetAutoOrder(sal_Bool bAutoOrder)
7043 + m_bAutoOrder = bAutoOrder;
7046 +inline void XFDateStyle::AddYear( sal_Bool bLongFmt )
7048 + XFDatePart *part = new XFDatePart();
7049 + part->SetPartType(enumXFDateYear);
7050 + part->SetLongFmt(bLongFmt);
7051 + m_aParts.AddStyle(part);
7054 +inline void XFDateStyle::AddMonth( sal_Bool bLongFmt, sal_Bool bTexture )
7056 + XFDatePart *part = new XFDatePart();
7057 + part->SetPartType(enumXFDateMonth);
7058 + part->SetLongFmt(bLongFmt);
7059 + part->SetTexture(bTexture);
7060 + m_aParts.AddStyle(part);
7063 +inline void XFDateStyle::AddMonthDay( sal_Bool bLongFmt )
7065 + XFDatePart *part = new XFDatePart();
7066 + part->SetPartType(enumXFDateMonthDay);
7067 + part->SetLongFmt(bLongFmt);
7068 + m_aParts.AddStyle(part);
7071 +inline void XFDateStyle::AddWeekDay( sal_Bool bLongFmt )
7073 + XFDatePart *part = new XFDatePart();
7074 + part->SetPartType(enumXFDateWeekDay);
7075 + part->SetLongFmt(bLongFmt);
7076 + m_aParts.AddStyle(part);
7079 +inline void XFDateStyle::AddYearWeek()
7081 + XFDatePart *part = new XFDatePart();
7082 + part->SetPartType(enumXFDateYearWeek);
7083 + m_aParts.AddStyle(part);
7086 +inline void XFDateStyle::AddEra(sal_Bool bLongFmt)
7088 + XFDatePart *part = new XFDatePart();
7089 + part->SetPartType(enumXFDateEra);
7090 + part->SetLongFmt(bLongFmt);
7091 + m_aParts.AddStyle(part);
7094 +inline void XFDateStyle::AddQuarter(sal_Bool bLongFmt)
7096 + XFDatePart *part = new XFDatePart();
7097 + part->SetPartType(enumXFDateQuarter);
7098 + part->SetLongFmt(bLongFmt);
7099 + m_aParts.AddStyle(part);
7102 +inline void XFDateStyle::AddText( rtl::OUString text )
7104 + XFDatePart *part = new XFDatePart();
7105 + part->SetPartType(enumXFDateText);
7106 + part->SetText(text);
7107 + m_aParts.AddStyle(part);
7110 +inline void XFDateStyle::AddHour( sal_Bool bLongFmt )
7112 + XFDatePart *part = new XFDatePart();
7113 + part->SetPartType(enumXFDateHour);
7114 + part->SetLongFmt(bLongFmt);
7115 + m_aParts.AddStyle(part);
7118 +inline void XFDateStyle::AddMinute( sal_Bool bLongFmt )
7120 + XFDatePart *part = new XFDatePart();
7121 + part->SetPartType(enumXFDateMinute);
7122 + part->SetLongFmt(bLongFmt);
7123 + m_aParts.AddStyle(part);
7126 +inline void XFDateStyle::AddSecond( sal_Bool bLongFmt, sal_Int16 pos)
7128 + XFDatePart *part = new XFDatePart();
7129 + part->SetPartType(enumXFDateSecond);
7130 + part->SetLongFmt(bLongFmt);
7131 + part->SetDecimalPos(pos);
7132 + m_aParts.AddStyle(part);
7135 +inline void XFDateStyle::AddAmPm(sal_Bool bAmPm)
7137 + XFDatePart *part = new XFDatePart();
7138 + part->SetPartType(enumXFDateAmPm);
7139 + m_aParts.AddStyle(part);
7142 +#endif
7143 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdefs.hxx lotuswordpro/source/filter/xfilter/xfdefs.hxx
7144 --- lotuswordpro.bak/source/filter/xfilter/xfdefs.hxx 1970-01-01 08:00:00.000000000 +0800
7145 +++ lotuswordpro/source/filter/xfilter/xfdefs.hxx 2008-10-22 11:42:34.000000000 +0800
7146 @@ -0,0 +1,514 @@
7147 +/*************************************************************************
7149 + * The Contents of this file are made available subject to the terms of
7150 + * either of the following licenses
7152 + * - GNU Lesser General Public License Version 2.1
7153 + * - Sun Industry Standards Source License Version 1.1
7155 + * Sun Microsystems Inc., October, 2000
7157 + * GNU Lesser General Public License Version 2.1
7158 + * =============================================
7159 + * Copyright 2000 by Sun Microsystems, Inc.
7160 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
7162 + * This library is free software; you can redistribute it and/or
7163 + * modify it under the terms of the GNU Lesser General Public
7164 + * License version 2.1, as published by the Free Software Foundation.
7166 + * This library is distributed in the hope that it will be useful,
7167 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
7168 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
7169 + * Lesser General Public License for more details.
7171 + * You should have received a copy of the GNU Lesser General Public
7172 + * License along with this library; if not, write to the Free Software
7173 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
7174 + * MA 02111-1307 USA
7177 + * Sun Industry Standards Source License Version 1.1
7178 + * =================================================
7179 + * The contents of this file are subject to the Sun Industry Standards
7180 + * Source License Version 1.1 (the "License"); You may not use this file
7181 + * except in compliance with the License. You may obtain a copy of the
7182 + * License at http://www.openoffice.org/license.html.
7184 + * Software provided under this License is provided on an "AS IS" basis,
7185 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
7186 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
7187 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
7188 + * See the License for the specific provisions governing your rights and
7189 + * obligations concerning the Software.
7191 + * The Initial Developer of the Original Code is: IBM Corporation
7193 + * Copyright: 2008 by IBM Corporation
7195 + * All Rights Reserved.
7197 + * Contributor(s): _______________________________________
7200 + ************************************************************************/
7201 +/*************************************************************************
7202 + * @file
7203 + * enum const defines.
7204 + ************************************************************************/
7205 +/*************************************************************************
7206 + * Change History
7207 + * 2005-01-21 create this file.
7208 + ************************************************************************/
7209 +#ifndef _XFDEFS_HXX
7210 +#define _XFDEFS_HXX
7212 +#include "sal/types.h"
7214 +enum enumXFContent
7216 + enumXFContentUnknown,
7217 + enumXFContentText,
7218 + enumXFContentSpan,
7219 + enumXFContentPara,
7220 + enumXFContentHeading,
7221 + enumXFContentTable,
7222 + enumXFContentTableCell,
7223 + enumXFContentTableRow,
7224 + enumXFContentTableCol,
7225 + enumXFContentGraphics,
7226 + enumXFContentFrame,
7227 + enumXFContentContainer,
7230 +enum enumXFStyle
7232 + enumXFStyleUnknown,
7233 + enumXFStyleText,
7234 + enumXFStylePara,
7235 + enumXFStyleList,
7236 + enumXFStyleSection,
7237 + enumXFStyleGraphics,
7238 + enumXFStylePageMaster,
7239 + enumXFStyleMasterPage,
7240 + enumXFStyleDate,
7241 + enumXFStyleTime,
7242 + enumXFStylePercent,
7243 + enumXFStyleNumber,
7244 + enumXFStyleCurrency,
7245 + enumXFStyleTable,
7246 + enumXFStyleTableCell,
7247 + enumXFStyleTableRow,
7248 + enumXFStyleTableCol,
7249 + enumXFStyleOutline,
7250 + enumXFStyleStrokeDash,
7251 + enumXFStyleArea,
7252 + enumXFStyleArrow,
7253 + enumXFStyleRuby,
7254 + enumXFStyleDefaultPara,
7257 +enum enumXFFrameType
7259 + enumXFFrameUnknown,
7260 + enumXFFrameDrawing,
7261 + enumXFFrameImage,
7262 + enumXFFrameTextbox,
7265 +enum enumXFUnderline
7267 + enumXFUnderlineNone = 0,
7268 + enumXFUnderlineSingle,
7269 + enumXFUnderlineDouble,
7270 + enumXFUnderlineDotted,
7271 + enumXFUnderlineDash,
7272 + enumXFUnderlineLongDash,
7273 + enumXFUnderlineDotDash,
7274 + enumXFUnderlineDotDotDash,
7275 + enumXFUnderlineWave,
7276 + enumXFUnderlineBold,
7277 + enumXFUnderlineBoldDotted,
7278 + enumXFUnderlineBoldDash,
7279 + enumXFUnderlineBoldLongDash,
7280 + enumXFUnderlineBoldDotDash,
7281 + enumXFUnderlineBoldDotDotDash,
7282 + enumXFUnderlineBoldWave,
7283 + enumXFUnderlineDoubleWave,
7284 + enumXFUnderlineSmallWave
7285 +};
7287 +enum enumXFRelief
7289 + enumXFReliefNone = 0,
7290 + enumXFReliefEngraved,
7291 + enumXFReliefEmbossed,
7294 +enum enumXFCrossout
7296 + enumXFCrossoutNone = 0,
7297 + enumXFCrossoutSignel,
7298 + enumXFCrossoutDouble,
7299 + enumXFCrossoutThick,
7300 + enumXFCrossoutSlash,
7301 + enumXFCrossoutX
7304 +enum enumXFTransform
7306 + enumXFTransformNone = 0,
7307 + enumXFTransformUpper,
7308 + enumXFTransformLower,
7309 + enumXFTransformCapitalize,
7310 + enumXFTransformSmallCaps
7313 +enum enumXFEmphasize
7315 + enumXFEmphasizeNone = 0,
7316 + enumXFEmphasizeDot,
7317 + enumXFEmphasizeCircle,
7318 + enumXFEmphasizeDisc,
7319 + enumXFEmphasizeAccent
7323 +enum enumXFAlignType
7325 + enumXFAlignNone = 0,
7326 + enumXFAlignStart,
7327 + enumXFAlignCenter,
7328 + enumXFAlignEnd,
7329 + enumXFAlignJustify,
7330 + enumXFAlignTop,
7331 + enumXFAlignMiddle,
7332 + enumXFAlignBottom,
7333 + enumXFALignMargins,
7336 +enum enumXFShadowPos
7338 + enumXFShadowNone,
7339 + enumXFShadowRightBottom,
7340 + enumXFShadowRightTop,
7341 + enumXFShadowLeftBottom,
7342 + enumXFShadowLeftTop
7345 +enum enumXFBorder
7347 + enumXFBorderNone,
7348 + enumXFBorderLeft,
7349 + enumXFBorderRight,
7350 + enumXFBorderTop,
7351 + enumXFBorderBottom,
7354 +/**************************************************************************
7355 + * @descr
7356 + * Line height type.
7357 + * enumLHHeight: height of the line,in "cm".
7358 + * enumLHLeast: the height may be adjusted,but has a min value.
7359 + * enumLHPercent: the height is a centain times of the normal height.
7360 + * enumLHSpace: space between lines.
7361 + *************************************************************************/
7362 +enum enumLHType
7364 + enumLHNone,
7365 + enumLHHeight,
7366 + enumLHLeast,
7367 + enumLHPercent,
7368 + enumLHSpace,
7371 +enum enumXFBreaks
7373 + enumXFBreakAuto,
7374 + enumXFBreakBefPage,
7375 + enumXFBreakBefColumn,
7376 + enumXFBreakAftPage,
7377 + enumXFBreakAftColumn,
7378 + enumXFBreakKeepWithNext,
7381 +enum enumXFTab
7383 + enumXFTabNone,
7384 + enumXFTabLeft,
7385 + enumXFTabCenter,
7386 + enumXFTabRight,
7387 + enumXFTabChar,
7390 +enum enumXFDatePart
7392 + enumXFDateUnknown,
7393 + enumXFDateYear,
7394 + enumXFDateMonth,
7395 + enumXFDateMonthDay,
7396 + enumXFDateWeekDay,
7397 + enumXFDateYearWeek,
7398 + enumXFDateEra,
7399 + enumXFDateQuarter,
7400 + enumXFDateHour,
7401 + enumXFDateMinute,
7402 + enumXFDateSecond,
7403 + enumXFDateAmPm,
7404 + enumXFDateText
7407 +enum enumXFAnchor
7409 + enumXFAnchorNone,
7410 + enumXFAnchorPara,
7411 + enumXFAnchorPage,
7412 + enumXFAnchorChar,
7413 + enumXFAnchorAsChar,
7414 + enumXFAnchorFrame
7417 +enum enumXFWrap
7419 + enumXFWrapNone,
7420 + enumXFWrapLeft,
7421 + enumXFWrapRight,
7422 + enumXFWrapParallel,
7423 + enumXFWrapRunThrough,
7424 + enumXFWrapBest,
7425 + enumXFWrapBackground
7428 +enum enumXFTextDir
7430 + enumXFTextDirNone,
7431 + enumXFTextDirLR,
7432 + enumXFTextDirLR_TB,
7433 + enumXFTextDirPage,
7434 + enumXFTextDirRL,
7435 + enumXFTextDirRL_TB,
7436 + enumXFTextDirTB,
7437 + enumXFTextDirTB_LR,
7438 + enumXFTextDirTB_RL
7441 +enum enumXFFrameXRel
7443 + enumXFFrameXRelPage,
7444 + enumXFFrameXRelPageContent,
7445 + enumXFFrameXRelPageEndMargin,
7446 + enumXFFrameXRelPageStartMargin,
7447 + enumXFFrameXRelPara,
7448 + enumXFFrameXRelParaContent,
7449 + enumXFFrameXRelParaEndMargin,
7450 + enumXFFrameXRelParaStartMargin,
7451 + enumXFFrameXRelChar,
7452 + enumXFFrameXRelFrame,
7453 + enumXFFrameXRelFrameContent,
7454 + enumXFFrameXRelFrameEndMargin,
7455 + enumXFFrameXRelFrameStartMargin
7458 +enum enumXFFrameXPos
7460 + enumXFFrameXPosLeft,
7461 + enumXFFrameXPosRight,
7462 + enumXFFrameXPosCenter,
7463 + enumXFFrameXPosFromLeft
7466 +enum enumXFFrameYRel
7468 + enumXFFrameYRelBaseLine,
7469 + enumXFFrameYRelChar,
7470 + enumXFFrameYRelFrame,
7471 + enumXFFrameYRelFrameContent,
7472 + enumXFFrameYRelLine,
7473 + enumXFFrameYRelPage,
7474 + enumXFFrameYRelPageContent,
7475 + enumXFFrameYRelPara,
7476 + enumXFFrameYRelParaContent,
7477 + enumXFFrameYRelText
7480 +enum enumXFFrameYPos
7482 + enumXFFrameYPosTop,
7483 + enumXFFrameYPosMiddle,
7484 + enumXFFrameYPosBottom,
7485 + enumXFFrameYPosFromTop,
7486 + enumXFFrameYPosBelow,
7489 +enum enumXFTableColVisible
7491 + enumXFTableColVisibleYes,
7492 + enumXFTableColVisibleCollapse,
7493 + enumXFTableColVisibleFilter,
7496 +enum enumXFBookmarkRef
7498 + enumXFBookmarkNone,
7499 + enumXFBookmarkPage,
7500 + enumXFBookmarkChapter,
7501 + enumXFBookmarkDir,
7502 + enumXFBookmarkDef
7505 +enum enumXFDrawKind
7507 + enumXFDrawKindFull,
7508 + enumXFDrawKindSection,
7509 + enumXFDrawKindCut,
7510 + enumXFDrawKindArc
7513 +enum enumXFLineStyle
7515 + enumXFLineNone,
7516 + enumXFLineSolid,
7517 + enumXFLineDot,
7518 + enumXFLineDash,
7519 + enumXFLineDotDash,
7520 + enumXFLineDashDot
7523 +enum enumXFAreaStyle
7525 + enumXFAreaNone,
7526 + enumXFAreaSolid,
7527 + enumXFAreaGradient,
7528 + enumXFAreaBitmap,
7529 + enumXFAreaHatch
7532 +enum enumXFAreaLineStyle
7534 + enumXFAreaLineSingle,
7535 + enumXFAreaLineCrossed,
7536 + enumXFAreaLineTriple
7539 +enum enumXFColorMode
7541 + enumXFColorStandard,
7542 + enumXFColorGreyscale,
7543 + enumXFColorMono,
7544 + enumXFColorWatermark
7547 +enum enumXFPageUsage
7549 + enumXFPageUsageNone,
7550 + enumXFPageUsageAll,
7551 + enumXFPageUsageLeft,
7552 + enumXFPageUsageRight,
7553 + enumXFPageUsageMirror
7556 +enum enumXFValueType
7558 + enumXFValueTypeNone,
7559 + enumXFValueTypeBoolean,
7560 + enumXFValueTypeCurrency,
7561 + enumXFValueTypeDate,
7562 + enumXFValueTypeFloat,
7563 + enumXFValueTypePercentage,
7564 + enumXFValueTypeString,
7565 + enumXFValueTypeTime,
7568 +enum enumXFNumberType
7570 + enumXFNumberNumber,
7571 + enumXFNumberPercent,
7572 + enuMXFNumberCurrency,
7573 + enumXFNumberScientific,
7574 + enumXFText,
7577 +enum enumXFLineNumberPos
7579 + enumXFLineNumberLeft,
7580 + enumXFLineNumberRight,
7581 + enumXFLineNumberInner,
7582 + enumXFLineNumberOutter,
7585 +enum enumXFEntry
7587 + enumXFEntryTOC,
7588 + enumXFEntryAlphabetical,
7589 + enumXFEntryUserIndex,
7592 +enum enumXFIndex
7594 + enumXFIndexTOC,
7595 + enumXFIndexAlphabetical,
7596 + enumXFIndexUserIndex,
7597 + enumXFIndexObject,
7598 + enumXFIndexIllustration,
7599 + enumXFIndexTableIndex,
7602 +enum enumXFIndexTemplate
7604 + enumXFIndexTemplateUnknown,
7605 + enumXFIndexTemplateChapter,
7606 + enumXFIndexTemplateText,
7607 + enumXFIndexTemplateTab,
7608 + enumXFIndexTemplatePage,
7609 + enumXFIndexTemplateLinkStart,
7610 + enumXFIndexTemplateLinkEnd,
7611 + enumXFIndexTemplateSpan,
7612 + enumXFIndexTemplateBibliography,
7615 +struct XFDateTime
7617 + sal_Int32 nYear;
7618 + sal_Int32 nMonth;
7619 + sal_Int32 nDay;
7620 + sal_Int32 nHour;
7621 + sal_Int32 nMinute;
7622 + sal_Int32 nSecond;
7623 + sal_Int32 nMillSecond;
7626 +enum enumXFRubyPosition
7628 + enumXFRubyLeft = 4,
7629 + enumXFRubyRight = 5,
7630 + enumXFRubyCenter = 2,
7631 + enumXFRubyTop = 1,
7632 + enumXFRubyBottom = 3,
7634 +enum enumXFFWStyle
7636 + enumXFFWOff,
7637 + enumXFFWRotate,
7638 + enumXFFWUpright,
7639 + enumXFFWSlantX,//slant-x
7640 + enumXFFWSlantY//slant-y
7643 +enum enumXFFWAdjust
7645 + enumXFFWAdjustAutosize,//autosize
7646 + enumXFFWAdjustLeft,
7647 + enumXFFWAdjustCenter,//center
7648 + enumXFFWAdustRight//right
7651 +enum enumXFFWShadow
7653 + enumXFFWShadowNone,
7654 + enumXFFWShadowNormal,
7655 + enumXFFWShadowVertical,
7656 + enumXFFWShadowSlant
7660 +#endif
7661 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdocfield.cxx lotuswordpro/source/filter/xfilter/xfdocfield.cxx
7662 --- lotuswordpro.bak/source/filter/xfilter/xfdocfield.cxx 1970-01-01 08:00:00.000000000 +0800
7663 +++ lotuswordpro/source/filter/xfilter/xfdocfield.cxx 2008-10-22 11:42:34.000000000 +0800
7664 @@ -0,0 +1,234 @@
7665 +/*************************************************************************
7667 + * The Contents of this file are made available subject to the terms of
7668 + * either of the following licenses
7670 + * - GNU Lesser General Public License Version 2.1
7671 + * - Sun Industry Standards Source License Version 1.1
7673 + * Sun Microsystems Inc., October, 2000
7675 + * GNU Lesser General Public License Version 2.1
7676 + * =============================================
7677 + * Copyright 2000 by Sun Microsystems, Inc.
7678 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
7680 + * This library is free software; you can redistribute it and/or
7681 + * modify it under the terms of the GNU Lesser General Public
7682 + * License version 2.1, as published by the Free Software Foundation.
7684 + * This library is distributed in the hope that it will be useful,
7685 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
7686 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
7687 + * Lesser General Public License for more details.
7689 + * You should have received a copy of the GNU Lesser General Public
7690 + * License along with this library; if not, write to the Free Software
7691 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
7692 + * MA 02111-1307 USA
7695 + * Sun Industry Standards Source License Version 1.1
7696 + * =================================================
7697 + * The contents of this file are subject to the Sun Industry Standards
7698 + * Source License Version 1.1 (the "License"); You may not use this file
7699 + * except in compliance with the License. You may obtain a copy of the
7700 + * License at http://www.openoffice.org/license.html.
7702 + * Software provided under this License is provided on an "AS IS" basis,
7703 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
7704 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
7705 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
7706 + * See the License for the specific provisions governing your rights and
7707 + * obligations concerning the Software.
7709 + * The Initial Developer of the Original Code is: IBM Corporation
7711 + * Copyright: 2008 by IBM Corporation
7713 + * All Rights Reserved.
7715 + * Contributor(s): _______________________________________
7718 + ************************************************************************/
7719 +/*************************************************************************
7720 + * @file
7721 + * doc field.
7722 + ************************************************************************/
7723 +/*************************************************************************
7724 + * Change History
7725 + * 2005-05-27 create this file.
7726 + ************************************************************************/
7727 +#include "xfdocfield.hxx"
7729 +void XFFileName::SetType(rtl::OUString sType)
7731 + m_strType = sType;
7734 +void XFFileName::ToXml(IXFStream *pStrm)
7736 + IXFAttrList *pAttrList = pStrm->GetAttrList();
7737 + pAttrList->Clear();
7738 + if (m_strType.equals(A2OUSTR("FileName")))
7739 + pAttrList->AddAttribute( A2OUSTR("text:display"), A2OUSTR("name-and-extension") );
7740 + else if (m_strType.equals(A2OUSTR("Path")))
7741 + pAttrList->AddAttribute( A2OUSTR("text:display"), A2OUSTR("path") );
7742 + pStrm->StartElement( A2OUSTR("text:file-name") );
7743 + pStrm->EndElement( A2OUSTR("text:file-name") );
7746 +void XFWordCount::ToXml(IXFStream *pStrm)
7748 + IXFAttrList *pAttrList = pStrm->GetAttrList();
7749 + pAttrList->Clear();
7750 + pStrm->StartElement( A2OUSTR("text:word-count") );
7751 + pStrm->EndElement( A2OUSTR("text:word-count") );
7754 +void XFCharCount::ToXml(IXFStream *pStrm)
7756 + IXFAttrList *pAttrList = pStrm->GetAttrList();
7757 + pAttrList->Clear();
7758 + pStrm->StartElement( A2OUSTR("text:character-count") );
7759 + pStrm->EndElement( A2OUSTR("text:character-count") );
7762 +void XFDescription::ToXml(IXFStream *pStrm)
7764 + IXFAttrList *pAttrList = pStrm->GetAttrList();
7765 + pAttrList->Clear();
7766 + pStrm->StartElement( A2OUSTR("text:description") );
7767 + pStrm->EndElement( A2OUSTR("text:description") );
7770 +void XFPageCountStart::ToXml(IXFStream *pStrm)
7772 + IXFAttrList *pAttrList = pStrm->GetAttrList();
7773 + pAttrList->Clear();
7774 + pStrm->StartElement( A2OUSTR("text:page-count") );
7776 +void XFPageCountEnd::ToXml(IXFStream *pStrm)
7778 + pStrm->EndElement( A2OUSTR("text:page-count") );
7781 +void XFWordCountStart::ToXml(IXFStream *pStrm)
7783 + IXFAttrList *pAttrList = pStrm->GetAttrList();
7784 + pAttrList->Clear();
7785 + pStrm->StartElement( A2OUSTR("text:word-count") );
7788 +void XFCharCountStart::ToXml(IXFStream *pStrm)
7790 + IXFAttrList *pAttrList = pStrm->GetAttrList();
7791 + pAttrList->Clear();
7792 + pStrm->StartElement( A2OUSTR("text:character-count") );
7795 +void XFDescriptionStart::ToXml(IXFStream *pStrm)
7797 + IXFAttrList *pAttrList = pStrm->GetAttrList();
7798 + pAttrList->Clear();
7799 + pStrm->StartElement( A2OUSTR("text:description") );
7802 +void XFWordCountEnd::ToXml(IXFStream *pStrm)
7804 + pStrm->EndElement( A2OUSTR("text:word-count") );
7807 +void XFCharCountEnd::ToXml(IXFStream *pStrm)
7809 + pStrm->EndElement( A2OUSTR("text:character-count") );
7812 +void XFDescriptionEnd::ToXml(IXFStream *pStrm)
7814 + pStrm->EndElement( A2OUSTR("text:description") );
7817 +void XFKeywords::ToXml(IXFStream *pStrm)
7819 + IXFAttrList *pAttrList = pStrm->GetAttrList();
7820 + pAttrList->Clear();
7821 + pStrm->StartElement( A2OUSTR("text:keywords") );
7822 + pStrm->EndElement( A2OUSTR("text:keywords") );
7825 +void XFTotalEditTime::ToXml(IXFStream *pStrm)
7827 + IXFAttrList *pAttrList = pStrm->GetAttrList();
7828 + pAttrList->Clear();
7829 + if (m_strStyleName.getLength()>0)
7830 + pAttrList->AddAttribute( A2OUSTR("style:data-style-name"), m_strStyleName );
7831 + pStrm->StartElement( A2OUSTR("text:editing-duration" ) );
7832 + pStrm->EndElement( A2OUSTR("text:editing-duration") );
7834 +void XFTotalEditTimeStart::ToXml(IXFStream *pStrm)
7836 + IXFAttrList *pAttrList = pStrm->GetAttrList();
7837 + pAttrList->Clear();
7838 + if (m_strStyleName.getLength()>0)
7839 + pAttrList->AddAttribute( A2OUSTR("style:data-style-name"), m_strStyleName );
7840 + pStrm->StartElement( A2OUSTR("text:editing-duration" ) );
7842 +void XFTotalEditTimeEnd::ToXml(IXFStream *pStrm)
7844 + pStrm->EndElement( A2OUSTR("text:editing-duration") );
7846 +void XFCreateTime::ToXml(IXFStream *pStrm)
7848 + IXFAttrList *pAttrList = pStrm->GetAttrList();
7849 + pAttrList->Clear();
7850 + if (m_strStyleName.getLength()>0)
7851 + pAttrList->AddAttribute( A2OUSTR("style:data-style-name"), m_strStyleName );
7852 + pStrm->StartElement( A2OUSTR("text:creation-time") );
7853 + pStrm->EndElement( A2OUSTR("text:creation-time") );
7855 +void XFLastEditTime::ToXml(IXFStream *pStrm)
7857 + IXFAttrList *pAttrList = pStrm->GetAttrList();
7858 + pAttrList->Clear();
7859 + if (m_strStyleName.getLength()>0)
7860 + pAttrList->AddAttribute( A2OUSTR("style:data-style-name"), m_strStyleName );
7861 + pStrm->StartElement( A2OUSTR("text:modification-time") );
7862 + pStrm->EndElement( A2OUSTR("text:modification-time") );
7865 +void XFCreateTimeStart::ToXml(IXFStream *pStrm)
7867 + IXFAttrList *pAttrList = pStrm->GetAttrList();
7868 + pAttrList->Clear();
7869 + if (m_strStyleName.getLength()>0)
7870 + pAttrList->AddAttribute( A2OUSTR("style:data-style-name"), m_strStyleName );
7871 + pStrm->StartElement( A2OUSTR("text:creation-time") );
7874 +void XFLastEditTimeStart::ToXml(IXFStream *pStrm)
7876 + IXFAttrList *pAttrList = pStrm->GetAttrList();
7877 + pAttrList->Clear();
7878 + if (m_strStyleName.getLength()>0)
7879 + pAttrList->AddAttribute( A2OUSTR("style:data-style-name"), m_strStyleName );
7880 + pStrm->StartElement( A2OUSTR("text:modification-time") );
7882 +void XFCreateTimeEnd::ToXml(IXFStream *pStrm)
7884 + pStrm->EndElement( A2OUSTR("text:creation-time") );
7887 +void XFLastEditTimeEnd::ToXml(IXFStream *pStrm)
7889 + pStrm->EndElement( A2OUSTR("text:modification-time") );
7892 +void XFInitialCreator::ToXml(IXFStream *pStrm)
7894 + IXFAttrList *pAttrList = pStrm->GetAttrList();
7895 + pAttrList->Clear();
7896 + pStrm->StartElement( A2OUSTR("text:initial-creator") );
7897 + pStrm->EndElement( A2OUSTR("text:initial-creator") );
7899 \ No newline at end of file
7900 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdocfield.hxx lotuswordpro/source/filter/xfilter/xfdocfield.hxx
7901 --- lotuswordpro.bak/source/filter/xfilter/xfdocfield.hxx 1970-01-01 08:00:00.000000000 +0800
7902 +++ lotuswordpro/source/filter/xfilter/xfdocfield.hxx 2008-10-22 11:42:34.000000000 +0800
7903 @@ -0,0 +1,200 @@
7904 +/*************************************************************************
7906 + * The Contents of this file are made available subject to the terms of
7907 + * either of the following licenses
7909 + * - GNU Lesser General Public License Version 2.1
7910 + * - Sun Industry Standards Source License Version 1.1
7912 + * Sun Microsystems Inc., October, 2000
7914 + * GNU Lesser General Public License Version 2.1
7915 + * =============================================
7916 + * Copyright 2000 by Sun Microsystems, Inc.
7917 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
7919 + * This library is free software; you can redistribute it and/or
7920 + * modify it under the terms of the GNU Lesser General Public
7921 + * License version 2.1, as published by the Free Software Foundation.
7923 + * This library is distributed in the hope that it will be useful,
7924 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
7925 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
7926 + * Lesser General Public License for more details.
7928 + * You should have received a copy of the GNU Lesser General Public
7929 + * License along with this library; if not, write to the Free Software
7930 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
7931 + * MA 02111-1307 USA
7934 + * Sun Industry Standards Source License Version 1.1
7935 + * =================================================
7936 + * The contents of this file are subject to the Sun Industry Standards
7937 + * Source License Version 1.1 (the "License"); You may not use this file
7938 + * except in compliance with the License. You may obtain a copy of the
7939 + * License at http://www.openoffice.org/license.html.
7941 + * Software provided under this License is provided on an "AS IS" basis,
7942 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
7943 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
7944 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
7945 + * See the License for the specific provisions governing your rights and
7946 + * obligations concerning the Software.
7948 + * The Initial Developer of the Original Code is: IBM Corporation
7950 + * Copyright: 2008 by IBM Corporation
7952 + * All Rights Reserved.
7954 + * Contributor(s): _______________________________________
7957 + ************************************************************************/
7958 +/*************************************************************************
7959 + * @file
7960 + * doc field.
7961 + ************************************************************************/
7962 +/*************************************************************************
7963 + * Change History
7964 + * 2005-05-27 create this file.
7965 + ************************************************************************/
7966 +#ifndef _XFDOCFIELD_HXX
7967 +#define _XFDOCFIELD_HXX
7969 +#include "xfcontent.hxx"
7970 +#include "xfpagecount.hxx"
7972 +class XFFileName : public XFContent
7974 +public:
7975 + void SetType(rtl::OUString sType);
7976 + virtual void ToXml(IXFStream *pStrm);
7977 +private:
7978 + rtl::OUString m_strType;
7980 +class XFWordCount : public XFContent
7982 +public:
7983 + virtual void ToXml(IXFStream *pStrm);
7985 +class XFWordCountStart : public XFContent
7987 +public:
7988 + virtual void ToXml(IXFStream *pStrm);
7991 +class XFWordCountEnd : public XFContent
7993 +public:
7994 + virtual void ToXml(IXFStream *pStrm);
7997 +class XFPageCountStart : public XFContent
7999 +public:
8000 + virtual void ToXml(IXFStream *pStrm);
8003 +class XFPageCountEnd : public XFContent
8005 +public:
8006 + virtual void ToXml(IXFStream *pStrm);
8009 +class XFCharCount : public XFContent
8011 +public:
8012 + virtual void ToXml(IXFStream *pStrm);
8013 +};
8014 +class XFCharCountStart : public XFContent
8016 +public:
8017 + virtual void ToXml(IXFStream *pStrm);
8018 +};
8020 +class XFCharCountEnd : public XFContent
8022 +public:
8023 + virtual void ToXml(IXFStream *pStrm);
8025 +class XFDescription : public XFContent
8027 +public:
8028 + virtual void ToXml(IXFStream *pStrm);
8030 +class XFDescriptionStart : public XFContent
8032 +public:
8033 + virtual void ToXml(IXFStream *pStrm);
8036 +class XFDescriptionEnd : public XFContent
8038 +public:
8039 + virtual void ToXml(IXFStream *pStrm);
8042 +class XFKeywords : public XFContent
8044 +public:
8045 + virtual void ToXml(IXFStream *pStrm);
8047 +class XFTotalEditTime : public XFContent
8049 +public:
8050 + virtual void ToXml(IXFStream *pStrm);
8052 +class XFTotalEditTimeEnd : public XFContent
8054 +public:
8055 + virtual void ToXml(IXFStream *pStrm);
8058 +class XFTotalEditTimeStart : public XFContent
8060 +public:
8061 + virtual void ToXml(IXFStream *pStrm);
8063 +class XFCreateTime : public XFContent
8065 +public:
8066 + virtual void ToXml(IXFStream *pStrm);
8068 +class XFCreateTimeStart : public XFContent
8070 +public:
8071 + virtual void ToXml(IXFStream *pStrm);
8074 +class XFCreateTimeEnd : public XFContent
8076 +public:
8077 + virtual void ToXml(IXFStream *pStrm);
8079 +class XFLastEditTime : public XFContent
8081 +public:
8082 + virtual void ToXml(IXFStream *pStrm);
8084 +class XFLastEditTimeStart : public XFContent
8086 +public:
8087 + virtual void ToXml(IXFStream *pStrm);
8090 +class XFLastEditTimeEnd : public XFContent
8092 +public:
8093 + virtual void ToXml(IXFStream *pStrm);
8096 +class XFInitialCreator : public XFContent
8098 +public:
8099 + virtual void ToXml(IXFStream *pStrm);
8103 +#endif
8104 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawareastyle.cxx lotuswordpro/source/filter/xfilter/xfdrawareastyle.cxx
8105 --- lotuswordpro.bak/source/filter/xfilter/xfdrawareastyle.cxx 1970-01-01 08:00:00.000000000 +0800
8106 +++ lotuswordpro/source/filter/xfilter/xfdrawareastyle.cxx 2008-10-22 11:42:34.000000000 +0800
8107 @@ -0,0 +1,99 @@
8108 +/*************************************************************************
8110 + * The Contents of this file are made available subject to the terms of
8111 + * either of the following licenses
8113 + * - GNU Lesser General Public License Version 2.1
8114 + * - Sun Industry Standards Source License Version 1.1
8116 + * Sun Microsystems Inc., October, 2000
8118 + * GNU Lesser General Public License Version 2.1
8119 + * =============================================
8120 + * Copyright 2000 by Sun Microsystems, Inc.
8121 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
8123 + * This library is free software; you can redistribute it and/or
8124 + * modify it under the terms of the GNU Lesser General Public
8125 + * License version 2.1, as published by the Free Software Foundation.
8127 + * This library is distributed in the hope that it will be useful,
8128 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
8129 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
8130 + * Lesser General Public License for more details.
8132 + * You should have received a copy of the GNU Lesser General Public
8133 + * License along with this library; if not, write to the Free Software
8134 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
8135 + * MA 02111-1307 USA
8138 + * Sun Industry Standards Source License Version 1.1
8139 + * =================================================
8140 + * The contents of this file are subject to the Sun Industry Standards
8141 + * Source License Version 1.1 (the "License"); You may not use this file
8142 + * except in compliance with the License. You may obtain a copy of the
8143 + * License at http://www.openoffice.org/license.html.
8145 + * Software provided under this License is provided on an "AS IS" basis,
8146 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
8147 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
8148 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
8149 + * See the License for the specific provisions governing your rights and
8150 + * obligations concerning the Software.
8152 + * The Initial Developer of the Original Code is: IBM Corporation
8154 + * Copyright: 2008 by IBM Corporation
8156 + * All Rights Reserved.
8158 + * Contributor(s): _______________________________________
8161 + ************************************************************************/
8162 +/*************************************************************************
8163 + * @file
8164 + * Area style of Drawing object.
8165 + ************************************************************************/
8166 +/*************************************************************************
8167 + * Change History
8168 + * 2004-02-21 create this file.
8169 + ************************************************************************/
8170 +#include "xfdrawareastyle.hxx"
8172 +XFDrawAreaStyle::XFDrawAreaStyle()
8174 + m_eAreaStyle = enumXFAreaSolid;
8175 + m_eLineStyle = enumXFAreaLineSingle;
8176 + m_nAngle = 0;
8177 + m_fSpace = 0.18;
8180 +enumXFStyle XFDrawAreaStyle::GetStyleFamily()
8182 + return enumXFStyleArea;
8185 +void XFDrawAreaStyle::ToXml(IXFStream *pStrm)
8187 + IXFAttrList *pAttrList = pStrm->GetAttrList();
8189 + pAttrList->Clear();
8191 + pAttrList->AddAttribute( A2OUSTR("draw:name"), GetStyleName() );
8193 + if( m_eLineStyle == enumXFAreaLineSingle )
8194 + pAttrList->AddAttribute( A2OUSTR("draw:style"), A2OUSTR("single") );
8195 + else if( m_eLineStyle == enumXFAreaLineCrossed )
8196 + pAttrList->AddAttribute( A2OUSTR("draw:style"), A2OUSTR("double") );
8197 + else if( m_eLineStyle == enumXFAreaLineTriple )
8198 + pAttrList->AddAttribute( A2OUSTR("draw:style"), A2OUSTR("triple") );
8200 + pAttrList->AddAttribute( A2OUSTR("draw:color"), m_aLineColor.ToString() );
8201 + pAttrList->AddAttribute( A2OUSTR("draw:rotation"), Int32ToOUString(m_nAngle*10) );
8202 + pAttrList->AddAttribute( A2OUSTR("draw:distance"), DoubleToOUString(m_fSpace)+A2OUSTR("cm") );
8204 + pStrm->StartElement( A2OUSTR("draw:hatch") );
8205 + pStrm->EndElement( A2OUSTR("draw:hatch") );
8207 \ No newline at end of file
8208 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawareastyle.hxx lotuswordpro/source/filter/xfilter/xfdrawareastyle.hxx
8209 --- lotuswordpro.bak/source/filter/xfilter/xfdrawareastyle.hxx 1970-01-01 08:00:00.000000000 +0800
8210 +++ lotuswordpro/source/filter/xfilter/xfdrawareastyle.hxx 2008-10-22 11:42:34.000000000 +0800
8211 @@ -0,0 +1,145 @@
8212 +/*************************************************************************
8214 + * The Contents of this file are made available subject to the terms of
8215 + * either of the following licenses
8217 + * - GNU Lesser General Public License Version 2.1
8218 + * - Sun Industry Standards Source License Version 1.1
8220 + * Sun Microsystems Inc., October, 2000
8222 + * GNU Lesser General Public License Version 2.1
8223 + * =============================================
8224 + * Copyright 2000 by Sun Microsystems, Inc.
8225 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
8227 + * This library is free software; you can redistribute it and/or
8228 + * modify it under the terms of the GNU Lesser General Public
8229 + * License version 2.1, as published by the Free Software Foundation.
8231 + * This library is distributed in the hope that it will be useful,
8232 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
8233 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
8234 + * Lesser General Public License for more details.
8236 + * You should have received a copy of the GNU Lesser General Public
8237 + * License along with this library; if not, write to the Free Software
8238 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
8239 + * MA 02111-1307 USA
8242 + * Sun Industry Standards Source License Version 1.1
8243 + * =================================================
8244 + * The contents of this file are subject to the Sun Industry Standards
8245 + * Source License Version 1.1 (the "License"); You may not use this file
8246 + * except in compliance with the License. You may obtain a copy of the
8247 + * License at http://www.openoffice.org/license.html.
8249 + * Software provided under this License is provided on an "AS IS" basis,
8250 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
8251 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
8252 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
8253 + * See the License for the specific provisions governing your rights and
8254 + * obligations concerning the Software.
8256 + * The Initial Developer of the Original Code is: IBM Corporation
8258 + * Copyright: 2008 by IBM Corporation
8260 + * All Rights Reserved.
8262 + * Contributor(s): _______________________________________
8265 + ************************************************************************/
8266 +/*************************************************************************
8267 + * @file
8268 + * Area style of Drawing object.
8269 + * Only support fill color and fill pattern now.
8270 + ************************************************************************/
8271 +/*************************************************************************
8272 + * Change History
8273 + * 2004-02-21 create this file.
8274 + ************************************************************************/
8275 +#ifndef _XFDRAWAREASTYLE_HXX
8276 +#define _XFDRAWAREASTYLE_HXX
8278 +#include "xfstyle.hxx"
8279 +#include "xfcolor.hxx"
8281 +class XFDrawAreaStyle : public XFStyle
8283 +public:
8284 + XFDrawAreaStyle();
8286 +public:
8287 + void SetAreaStyle(enumXFAreaStyle style);
8289 + void SetLineStyle(enumXFAreaLineStyle style);
8291 + void SetBackColor(XFColor& color);
8293 + void SetLineColor(XFColor& color);
8295 + void SetLineAngle(sal_Int32 angle);
8297 + void SetLineSpace(double space);
8299 + enumXFAreaStyle GetAreaStyle();
8301 + XFColor GetBackColor();
8303 + virtual enumXFStyle GetStyleFamily();
8305 + virtual void ToXml(IXFStream *pStrm);
8307 +private:
8308 + enumXFAreaStyle m_eAreaStyle;
8309 + enumXFAreaLineStyle m_eLineStyle;
8310 + XFColor m_aBackColor;
8311 + XFColor m_aLineColor;
8312 + sal_Int32 m_nAngle;
8313 + double m_fSpace;
8316 +inline void XFDrawAreaStyle::SetAreaStyle(enumXFAreaStyle style)
8318 + m_eAreaStyle = style;
8321 +inline void XFDrawAreaStyle::SetLineStyle(enumXFAreaLineStyle style)
8323 + m_eLineStyle = style;
8326 +inline void XFDrawAreaStyle::SetBackColor(XFColor& color)
8328 + m_aBackColor = color;
8331 +inline void XFDrawAreaStyle::SetLineColor(XFColor& color)
8333 + m_aLineColor = color;
8336 +inline void XFDrawAreaStyle::SetLineAngle(sal_Int32 angle)
8338 + m_nAngle = angle;
8341 +inline void XFDrawAreaStyle::SetLineSpace(double space)
8343 + m_fSpace = space;
8346 +inline enumXFAreaStyle XFDrawAreaStyle::GetAreaStyle()
8348 + return m_eAreaStyle;
8351 +inline XFColor XFDrawAreaStyle::GetBackColor()
8353 + return m_aBackColor;
8356 +#endif
8357 \ No newline at end of file
8358 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawchart.cxx lotuswordpro/source/filter/xfilter/xfdrawchart.cxx
8359 --- lotuswordpro.bak/source/filter/xfilter/xfdrawchart.cxx 1970-01-01 08:00:00.000000000 +0800
8360 +++ lotuswordpro/source/filter/xfilter/xfdrawchart.cxx 2008-10-22 11:42:34.000000000 +0800
8361 @@ -0,0 +1,96 @@
8362 +/*************************************************************************
8364 + * The Contents of this file are made available subject to the terms of
8365 + * either of the following licenses
8367 + * - GNU Lesser General Public License Version 2.1
8368 + * - Sun Industry Standards Source License Version 1.1
8370 + * Sun Microsystems Inc., October, 2000
8372 + * GNU Lesser General Public License Version 2.1
8373 + * =============================================
8374 + * Copyright 2000 by Sun Microsystems, Inc.
8375 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
8377 + * This library is free software; you can redistribute it and/or
8378 + * modify it under the terms of the GNU Lesser General Public
8379 + * License version 2.1, as published by the Free Software Foundation.
8381 + * This library is distributed in the hope that it will be useful,
8382 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
8383 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
8384 + * Lesser General Public License for more details.
8386 + * You should have received a copy of the GNU Lesser General Public
8387 + * License along with this library; if not, write to the Free Software
8388 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
8389 + * MA 02111-1307 USA
8392 + * Sun Industry Standards Source License Version 1.1
8393 + * =================================================
8394 + * The contents of this file are subject to the Sun Industry Standards
8395 + * Source License Version 1.1 (the "License"); You may not use this file
8396 + * except in compliance with the License. You may obtain a copy of the
8397 + * License at http://www.openoffice.org/license.html.
8399 + * Software provided under this License is provided on an "AS IS" basis,
8400 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
8401 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
8402 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
8403 + * See the License for the specific provisions governing your rights and
8404 + * obligations concerning the Software.
8406 + * The Initial Developer of the Original Code is: IBM Corporation
8408 + * Copyright: 2008 by IBM Corporation
8410 + * All Rights Reserved.
8412 + * Contributor(s): _______________________________________
8415 + ************************************************************************/
8416 +/*************************************************************************
8417 + * @file
8418 + * chart object.
8419 + ************************************************************************/
8420 +/*************************************************************************
8421 + * Change History
8422 + * 2004-2-25 draft code for draw chart in XML.
8423 + ************************************************************************/
8425 +#include "xfdrawchart.hxx"
8427 +#include "xfchartstreamtools.hxx"
8429 +XFDrawChart::XFDrawChart()
8431 + m_strName=XFGlobal::GenObjName();
8434 +void XFDrawChart::Add(IXFContent* pXFChartStream)
8436 + m_pXFChartStream = pXFChartStream;
8439 +void XFDrawChart::ToXml(IXFStream *pStrm)
8441 + XFDrawObject::ToXml(pStrm);
8443 + pStrm->StartElement( A2OUSTR("draw:object") );
8444 + ContentToXml(pStrm);
8445 + m_pXFChartStream->ToXml(pStrm);
8446 + pStrm->EndElement( A2OUSTR("draw:object") );
8449 +void XFChartStream::SetChartStream(SvStorageStreamRef rCntStream)
8451 + m_rCntStream = rCntStream;
8454 +void XFChartStream::ToXml(IXFStream *pSaxStream)
8456 + XFChartStreamTools::ParseStream(m_rCntStream,pSaxStream);
8458 \ No newline at end of file
8459 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawchart.hxx lotuswordpro/source/filter/xfilter/xfdrawchart.hxx
8460 --- lotuswordpro.bak/source/filter/xfilter/xfdrawchart.hxx 1970-01-01 08:00:00.000000000 +0800
8461 +++ lotuswordpro/source/filter/xfilter/xfdrawchart.hxx 2008-10-22 11:42:34.000000000 +0800
8462 @@ -0,0 +1,98 @@
8463 +/*************************************************************************
8465 + * The Contents of this file are made available subject to the terms of
8466 + * either of the following licenses
8468 + * - GNU Lesser General Public License Version 2.1
8469 + * - Sun Industry Standards Source License Version 1.1
8471 + * Sun Microsystems Inc., October, 2000
8473 + * GNU Lesser General Public License Version 2.1
8474 + * =============================================
8475 + * Copyright 2000 by Sun Microsystems, Inc.
8476 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
8478 + * This library is free software; you can redistribute it and/or
8479 + * modify it under the terms of the GNU Lesser General Public
8480 + * License version 2.1, as published by the Free Software Foundation.
8482 + * This library is distributed in the hope that it will be useful,
8483 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
8484 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
8485 + * Lesser General Public License for more details.
8487 + * You should have received a copy of the GNU Lesser General Public
8488 + * License along with this library; if not, write to the Free Software
8489 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
8490 + * MA 02111-1307 USA
8493 + * Sun Industry Standards Source License Version 1.1
8494 + * =================================================
8495 + * The contents of this file are subject to the Sun Industry Standards
8496 + * Source License Version 1.1 (the "License"); You may not use this file
8497 + * except in compliance with the License. You may obtain a copy of the
8498 + * License at http://www.openoffice.org/license.html.
8500 + * Software provided under this License is provided on an "AS IS" basis,
8501 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
8502 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
8503 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
8504 + * See the License for the specific provisions governing your rights and
8505 + * obligations concerning the Software.
8507 + * The Initial Developer of the Original Code is: IBM Corporation
8509 + * Copyright: 2008 by IBM Corporation
8511 + * All Rights Reserved.
8513 + * Contributor(s): _______________________________________
8516 + ************************************************************************/
8517 +/*************************************************************************
8518 + * @file
8519 + * Chart object.
8520 + ************************************************************************/
8521 +/*************************************************************************
8522 + * Change History
8523 + * 2004-2-25 create this file,draft code for chart xml.
8524 + ************************************************************************/
8525 +#ifndef _XFDRAWECLIPSE_HXX
8526 +#define _XFDRAWECLIPSE_HXX
8528 +#include "xfdrawobj.hxx"
8529 +#include <so3/svstor.hxx>
8530 +/**
8531 +* @brief
8532 +* draw chart object in XML
8534 +class XFDrawChart : public XFDrawObject
8536 +public:
8537 + XFDrawChart();
8539 +public:
8540 + virtual void ToXml(IXFStream *pStrm);
8541 + virtual void Add(IXFContent* pXFChartStream);
8543 +private:
8544 + IXFContent* m_pXFChartStream;
8547 +/**
8548 +* @brief
8549 +* draw chart stream in XML
8551 +class XFChartStream:public XFContent
8553 +public:
8554 + virtual void ToXml(IXFStream *pSaxStream);
8555 + void SetChartStream(SvStorageStreamRef rCntStream);
8556 +protected:
8557 + SvStorageStreamRef m_rCntStream;
8559 +#endif
8561 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawcircle.cxx lotuswordpro/source/filter/xfilter/xfdrawcircle.cxx
8562 --- lotuswordpro.bak/source/filter/xfilter/xfdrawcircle.cxx 1970-01-01 08:00:00.000000000 +0800
8563 +++ lotuswordpro/source/filter/xfilter/xfdrawcircle.cxx 2008-10-22 11:42:34.000000000 +0800
8564 @@ -0,0 +1,134 @@
8565 +/*************************************************************************
8567 + * The Contents of this file are made available subject to the terms of
8568 + * either of the following licenses
8570 + * - GNU Lesser General Public License Version 2.1
8571 + * - Sun Industry Standards Source License Version 1.1
8573 + * Sun Microsystems Inc., October, 2000
8575 + * GNU Lesser General Public License Version 2.1
8576 + * =============================================
8577 + * Copyright 2000 by Sun Microsystems, Inc.
8578 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
8580 + * This library is free software; you can redistribute it and/or
8581 + * modify it under the terms of the GNU Lesser General Public
8582 + * License version 2.1, as published by the Free Software Foundation.
8584 + * This library is distributed in the hope that it will be useful,
8585 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
8586 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
8587 + * Lesser General Public License for more details.
8589 + * You should have received a copy of the GNU Lesser General Public
8590 + * License along with this library; if not, write to the Free Software
8591 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
8592 + * MA 02111-1307 USA
8595 + * Sun Industry Standards Source License Version 1.1
8596 + * =================================================
8597 + * The contents of this file are subject to the Sun Industry Standards
8598 + * Source License Version 1.1 (the "License"); You may not use this file
8599 + * except in compliance with the License. You may obtain a copy of the
8600 + * License at http://www.openoffice.org/license.html.
8602 + * Software provided under this License is provided on an "AS IS" basis,
8603 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
8604 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
8605 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
8606 + * See the License for the specific provisions governing your rights and
8607 + * obligations concerning the Software.
8609 + * The Initial Developer of the Original Code is: IBM Corporation
8611 + * Copyright: 2008 by IBM Corporation
8613 + * All Rights Reserved.
8615 + * Contributor(s): _______________________________________
8618 + ************************************************************************/
8619 +/*************************************************************************
8620 + * @file
8621 + * Circle object.
8622 + ************************************************************************/
8623 +/*************************************************************************
8624 + * Change History
8625 + * 2004-2-17 create this file.
8626 + ************************************************************************/
8627 +#include "xfdrawcircle.hxx"
8628 +#include <math.h>
8629 +#include <cstdlib>
8631 +XFDrawCircle::XFDrawCircle()
8633 + m_fRadius = 0;
8634 + m_fStartAngle = 0;
8635 + m_fEndAngle = 360;
8636 + m_eDrawKind = enumXFDrawKindFull;
8637 + m_bUseAngle = sal_False;
8640 +XFDrawCircle::XFDrawCircle(XFPoint pt, double radius)
8642 + m_aCenterPoint = pt;
8643 + m_fRadius = radius;
8644 + m_fStartAngle = 0;
8645 + m_fEndAngle = 360;
8646 + m_eDrawKind = enumXFDrawKindFull;
8647 + m_bUseAngle = sal_False;
8650 +void XFDrawCircle::ToXml(IXFStream *pStrm)
8652 + IXFAttrList *pAttrList = pStrm->GetAttrList();
8654 + pAttrList->Clear();
8655 + if( m_bUseAngle )
8657 + double x1 = m_aCenterPoint.GetX() + m_fRadius*cos(m_fStartAngle*2*PI/360);
8658 + double x2 = m_aCenterPoint.GetX() + m_fRadius*cos(m_fEndAngle*2*PI/360);
8659 + double y1 = m_aCenterPoint.GetY() + m_fRadius*sin(m_fStartAngle*2*PI/360);
8660 + double y2 = m_aCenterPoint.GetY() + m_fRadius*sin(m_fEndAngle*2*PI/360);
8661 + double width;
8662 + double height;
8664 + double x11 = MIN3(m_aCenterPoint.GetX()-m_fRadius,x1,x2);
8665 + double x12 = MAX3(m_aCenterPoint.GetX()+m_fRadius,x1,x2);
8666 + double y11 = MIN3(m_aCenterPoint.GetY()-m_fRadius,y1,y2);
8667 + double y12 = MAX3(m_aCenterPoint.GetY()+m_fRadius,y1,y2);
8668 + width = x12-x11;
8669 + height = y12-y11;
8671 + if (width > FLOAT_MIN || height > FLOAT_MIN)
8673 + SetPosition(x11,y11,width,height);
8676 + //
8677 + pAttrList->AddAttribute( A2OUSTR("draw:kind"), GetDrawKind(m_eDrawKind) );
8678 + pAttrList->AddAttribute( A2OUSTR("draw:start-angle"), DoubleToOUString(m_fStartAngle) );
8679 + pAttrList->AddAttribute( A2OUSTR("draw:end-angle"), DoubleToOUString(m_fEndAngle) );
8681 + else
8683 + double x = m_aCenterPoint.GetX() - m_fRadius;
8684 + double y = m_aCenterPoint.GetY() - m_fRadius;
8685 + double width = m_fRadius*2;
8686 + double height = m_fRadius*2;
8687 + if (width > FLOAT_MIN || height > FLOAT_MIN)
8689 + SetPosition(x,y,width,height);
8693 + XFDrawObject::ToXml(pStrm);
8695 + pStrm->StartElement( A2OUSTR("draw:circle") );
8696 + ContentToXml(pStrm);
8697 + pStrm->EndElement( A2OUSTR("draw:circle") );
8699 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawcircle.hxx lotuswordpro/source/filter/xfilter/xfdrawcircle.hxx
8700 --- lotuswordpro.bak/source/filter/xfilter/xfdrawcircle.hxx 1970-01-01 08:00:00.000000000 +0800
8701 +++ lotuswordpro/source/filter/xfilter/xfdrawcircle.hxx 2008-10-22 11:42:34.000000000 +0800
8702 @@ -0,0 +1,143 @@
8703 +/*************************************************************************
8705 + * The Contents of this file are made available subject to the terms of
8706 + * either of the following licenses
8708 + * - GNU Lesser General Public License Version 2.1
8709 + * - Sun Industry Standards Source License Version 1.1
8711 + * Sun Microsystems Inc., October, 2000
8713 + * GNU Lesser General Public License Version 2.1
8714 + * =============================================
8715 + * Copyright 2000 by Sun Microsystems, Inc.
8716 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
8718 + * This library is free software; you can redistribute it and/or
8719 + * modify it under the terms of the GNU Lesser General Public
8720 + * License version 2.1, as published by the Free Software Foundation.
8722 + * This library is distributed in the hope that it will be useful,
8723 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
8724 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
8725 + * Lesser General Public License for more details.
8727 + * You should have received a copy of the GNU Lesser General Public
8728 + * License along with this library; if not, write to the Free Software
8729 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
8730 + * MA 02111-1307 USA
8733 + * Sun Industry Standards Source License Version 1.1
8734 + * =================================================
8735 + * The contents of this file are subject to the Sun Industry Standards
8736 + * Source License Version 1.1 (the "License"); You may not use this file
8737 + * except in compliance with the License. You may obtain a copy of the
8738 + * License at http://www.openoffice.org/license.html.
8740 + * Software provided under this License is provided on an "AS IS" basis,
8741 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
8742 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
8743 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
8744 + * See the License for the specific provisions governing your rights and
8745 + * obligations concerning the Software.
8747 + * The Initial Developer of the Original Code is: IBM Corporation
8749 + * Copyright: 2008 by IBM Corporation
8751 + * All Rights Reserved.
8753 + * Contributor(s): _______________________________________
8756 + ************************************************************************/
8757 +/*************************************************************************
8758 + * @file
8759 + * Circle object.
8760 + ************************************************************************/
8761 +/*************************************************************************
8762 + * Change History
8763 + * 2004-2-17 create this file.
8764 + ************************************************************************/
8765 +#ifndef _XFDRAWCIRCLE_HXX
8766 +#define _XFDRAWCIRCLE_HXX
8768 +#include "xfdrawobj.hxx"
8770 +/**
8771 + * @brief
8772 + * Circle object.
8773 + */
8774 +class XFDrawCircle : public XFDrawObject
8776 +public:
8777 + XFDrawCircle();
8779 + XFDrawCircle(XFPoint pt, double radius);
8781 +public:
8782 + /**
8783 + * @descr Set the center point for the circle.
8784 + */
8785 + void SetCenterPoint(double x, double y);
8787 + /**
8788 + * @descr Set the center point for the circle
8789 + */
8790 + void SetCenterPoint(XFPoint pt);
8792 + /**
8793 + * @descr
8794 + */
8795 + void SetRadius(double radius);
8797 + void SetAngle(double start, double end);
8799 + void SetDrawKind(enumXFDrawKind kind);
8801 + virtual void ToXml(IXFStream *pStrm);
8803 +private:
8804 + XFPoint m_aCenterPoint;
8805 + double m_fRadius;
8806 + double m_fStartAngle;
8807 + double m_fEndAngle;
8808 + enumXFDrawKind m_eDrawKind;
8809 + sal_Bool m_bUseAngle;
8812 +inline void XFDrawCircle::SetCenterPoint(double x, double y)
8814 + m_aCenterPoint = XFPoint(x,y);
8817 +inline void XFDrawCircle::SetCenterPoint(XFPoint pt)
8819 + m_aCenterPoint = pt;
8822 +inline void XFDrawCircle::SetRadius(double radius)
8824 + m_fRadius = radius;
8827 +inline void XFDrawCircle::SetAngle(double start, double end)
8829 + assert(start>=0&&start<=360);
8830 + assert(end>=0&&end<=360);
8831 + m_fStartAngle = start;
8832 + m_fEndAngle = end;
8834 + m_bUseAngle = sal_True;
8835 + m_eDrawKind = enumXFDrawKindCut;
8838 +inline void XFDrawCircle::SetDrawKind(enumXFDrawKind kind)
8840 + m_eDrawKind = kind;
8844 +#endif
8846 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawellipse.cxx lotuswordpro/source/filter/xfilter/xfdrawellipse.cxx
8847 --- lotuswordpro.bak/source/filter/xfilter/xfdrawellipse.cxx 1970-01-01 08:00:00.000000000 +0800
8848 +++ lotuswordpro/source/filter/xfilter/xfdrawellipse.cxx 2008-10-22 11:42:34.000000000 +0800
8849 @@ -0,0 +1,118 @@
8850 +/*************************************************************************
8852 + * The Contents of this file are made available subject to the terms of
8853 + * either of the following licenses
8855 + * - GNU Lesser General Public License Version 2.1
8856 + * - Sun Industry Standards Source License Version 1.1
8858 + * Sun Microsystems Inc., October, 2000
8860 + * GNU Lesser General Public License Version 2.1
8861 + * =============================================
8862 + * Copyright 2000 by Sun Microsystems, Inc.
8863 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
8865 + * This library is free software; you can redistribute it and/or
8866 + * modify it under the terms of the GNU Lesser General Public
8867 + * License version 2.1, as published by the Free Software Foundation.
8869 + * This library is distributed in the hope that it will be useful,
8870 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
8871 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
8872 + * Lesser General Public License for more details.
8874 + * You should have received a copy of the GNU Lesser General Public
8875 + * License along with this library; if not, write to the Free Software
8876 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
8877 + * MA 02111-1307 USA
8880 + * Sun Industry Standards Source License Version 1.1
8881 + * =================================================
8882 + * The contents of this file are subject to the Sun Industry Standards
8883 + * Source License Version 1.1 (the "License"); You may not use this file
8884 + * except in compliance with the License. You may obtain a copy of the
8885 + * License at http://www.openoffice.org/license.html.
8887 + * Software provided under this License is provided on an "AS IS" basis,
8888 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
8889 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
8890 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
8891 + * See the License for the specific provisions governing your rights and
8892 + * obligations concerning the Software.
8894 + * The Initial Developer of the Original Code is: IBM Corporation
8896 + * Copyright: 2008 by IBM Corporation
8898 + * All Rights Reserved.
8900 + * Contributor(s): _______________________________________
8903 + ************************************************************************/
8904 +/*************************************************************************
8905 + * @file
8906 + * Eclipse object.
8907 + ************************************************************************/
8908 +/*************************************************************************
8909 + * Change History
8910 + * 2004-2-18 create this file.
8911 + ************************************************************************/
8912 +#include "xfdrawellipse.hxx"
8913 +#include <cmath>
8915 +XFDrawEllipse::XFDrawEllipse()
8917 + m_fRadiusX = 0;
8918 + m_fRadiusY = 0;
8919 + m_fStartAngle = 0;
8920 + m_fEndAngle = 360;
8921 + m_eDrawKind = enumXFDrawKindFull;
8922 + m_bUseAngle = sal_False;
8925 +void XFDrawEllipse::ToXml(IXFStream *pStrm)
8927 + IXFAttrList *pAttrList = pStrm->GetAttrList();
8929 + pAttrList->Clear();
8930 + //not support yet.
8931 + if( m_bUseAngle )
8933 + double x1 = m_aCenterPoint.GetX() + m_fRadiusX*cos(m_fStartAngle*2*PI/360);
8934 + double x2 = m_aCenterPoint.GetX() + m_fRadiusX*cos(m_fEndAngle*2*PI/360);
8935 + double y1 = m_aCenterPoint.GetY() + m_fRadiusY*sin(m_fStartAngle*2*PI/360);
8936 + double y2 = m_aCenterPoint.GetY() + m_fRadiusY*sin(m_fEndAngle*2*PI/360);
8937 + double width;
8938 + double height;
8940 + double x11 = MIN3(m_aCenterPoint.GetX()-m_fRadiusX,x1,x2);
8941 + double x12 = MAX3(m_aCenterPoint.GetX()+m_fRadiusX,x1,x2);
8942 + double y11 = MIN3(m_aCenterPoint.GetY()-m_fRadiusY,y1,y2);
8943 + double y12 = MAX3(m_aCenterPoint.GetY()+m_fRadiusY,y1,y2);
8944 + width = x12-x11;
8945 + height = y12-y11;
8946 + SetPosition(x11,y11,width,height);
8948 + //
8949 + pAttrList->AddAttribute( A2OUSTR("draw:kind"), GetDrawKind(m_eDrawKind) );
8950 + pAttrList->AddAttribute( A2OUSTR("draw:start-angle"), DoubleToOUString(m_fStartAngle) );
8951 + pAttrList->AddAttribute( A2OUSTR("draw:end-angle"), DoubleToOUString(m_fEndAngle) );
8953 + else
8955 + double x = m_aCenterPoint.GetX() - m_fRadiusX;
8956 + double y = m_aCenterPoint.GetY() - m_fRadiusY;
8957 + double width = m_fRadiusX*2;
8958 + double height = m_fRadiusY*2;
8959 + SetPosition(x,y,width,height);
8960 + }
8962 + XFDrawObject::ToXml(pStrm);
8964 + pStrm->StartElement( A2OUSTR("draw:ellipse") );
8965 + ContentToXml(pStrm);
8966 + pStrm->EndElement( A2OUSTR("draw:ellipse") );
8968 \ No newline at end of file
8969 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawellipse.hxx lotuswordpro/source/filter/xfilter/xfdrawellipse.hxx
8970 --- lotuswordpro.bak/source/filter/xfilter/xfdrawellipse.hxx 1970-01-01 08:00:00.000000000 +0800
8971 +++ lotuswordpro/source/filter/xfilter/xfdrawellipse.hxx 2008-10-22 11:42:34.000000000 +0800
8972 @@ -0,0 +1,157 @@
8973 +/*************************************************************************
8975 + * The Contents of this file are made available subject to the terms of
8976 + * either of the following licenses
8978 + * - GNU Lesser General Public License Version 2.1
8979 + * - Sun Industry Standards Source License Version 1.1
8981 + * Sun Microsystems Inc., October, 2000
8983 + * GNU Lesser General Public License Version 2.1
8984 + * =============================================
8985 + * Copyright 2000 by Sun Microsystems, Inc.
8986 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
8988 + * This library is free software; you can redistribute it and/or
8989 + * modify it under the terms of the GNU Lesser General Public
8990 + * License version 2.1, as published by the Free Software Foundation.
8992 + * This library is distributed in the hope that it will be useful,
8993 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
8994 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
8995 + * Lesser General Public License for more details.
8997 + * You should have received a copy of the GNU Lesser General Public
8998 + * License along with this library; if not, write to the Free Software
8999 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
9000 + * MA 02111-1307 USA
9003 + * Sun Industry Standards Source License Version 1.1
9004 + * =================================================
9005 + * The contents of this file are subject to the Sun Industry Standards
9006 + * Source License Version 1.1 (the "License"); You may not use this file
9007 + * except in compliance with the License. You may obtain a copy of the
9008 + * License at http://www.openoffice.org/license.html.
9010 + * Software provided under this License is provided on an "AS IS" basis,
9011 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
9012 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
9013 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
9014 + * See the License for the specific provisions governing your rights and
9015 + * obligations concerning the Software.
9017 + * The Initial Developer of the Original Code is: IBM Corporation
9019 + * Copyright: 2008 by IBM Corporation
9021 + * All Rights Reserved.
9023 + * Contributor(s): _______________________________________
9026 + ************************************************************************/
9027 +/*************************************************************************
9028 + * @file
9029 + * Eclipse object.
9030 + ************************************************************************/
9031 +/*************************************************************************
9032 + * Change History
9033 + * 2004-2-18 create this file.
9034 + ************************************************************************/
9035 +#ifndef _XFDRAWELLIPSE_HXX
9036 +#define _XFDRAWELLIPSE_HXX
9038 +#include "xfdrawobj.hxx"
9040 +/**
9041 + * @brief
9042 + * Ellipse obejct for drawing layer.
9043 + * You can set Ellipse position by setting it's center point and radius or calling XFDrawEllipse::SetPosition function.
9044 + * If you using the first method,i'll calc the real position.
9046 + * You can draw part of an ellipse by using SetAngle(), for example, use SetaAngle(0,180) to draw half a ellipse.
9047 + * When draw part of an ellipse, you can use SetDrawKind() to decide which kind of object to draw, an arch, a section,
9048 + * or a cut.
9049 + */
9050 +class XFDrawEllipse : public XFDrawObject
9052 +public:
9053 + XFDrawEllipse();
9055 +public:
9056 + /**
9057 + * @descr Set ellipse center point.
9058 + */
9059 + void SetCenterPoint(double x, double y);
9061 + /**
9062 + * @descr Set ellipse center point.
9063 + */
9064 + void SetCenterPoint(XFPoint pt);
9066 + /**
9067 + * @descr Set ellipse radius.
9068 + */
9069 + void SetRadius(double radiusX, double radiusY);
9071 + /**
9072 + * @descr If only draw part of the ellipse, set the start angle and end angle.
9073 + */
9074 + void SetAngle(double start, double end);
9076 + /**
9077 + * @descr Set ellipse draw type,please refer to enumXFDrawKind.
9078 + */
9079 + void SetDrawKind(enumXFDrawKind kind);
9081 + /**
9082 + * @descr Output ellipse obejct.
9083 + */
9084 + virtual void ToXml(IXFStream *pStrm);
9086 +private:
9087 + XFPoint m_aCenterPoint;
9088 + double m_fRadiusX;
9089 + double m_fRadiusY;
9090 + double m_fStartAngle;
9091 + double m_fEndAngle;
9092 + enumXFDrawKind m_eDrawKind;
9093 + sal_Bool m_bUseAngle;
9096 +inline void XFDrawEllipse::SetCenterPoint(double x, double y)
9098 + m_aCenterPoint = XFPoint(x,y);
9101 +inline void XFDrawEllipse::SetCenterPoint(XFPoint pt)
9103 + m_aCenterPoint = pt;
9106 +inline void XFDrawEllipse::SetRadius(double radiusX, double radiusY)
9108 + m_fRadiusX = radiusX;
9109 + m_fRadiusY = radiusY;
9112 +inline void XFDrawEllipse::SetAngle(double start, double end)
9114 + assert(start>=0&&start<=360);
9115 + assert(end>=0&&end<=360);
9117 + m_fStartAngle = start;
9118 + m_fEndAngle = end;
9119 + m_bUseAngle = sal_True;
9120 + m_eDrawKind = enumXFDrawKindCut;
9123 +inline void XFDrawEllipse::SetDrawKind(enumXFDrawKind kind)
9125 + m_eDrawKind = kind;
9128 +#endif
9130 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawgroup.hxx lotuswordpro/source/filter/xfilter/xfdrawgroup.hxx
9131 --- lotuswordpro.bak/source/filter/xfilter/xfdrawgroup.hxx 1970-01-01 08:00:00.000000000 +0800
9132 +++ lotuswordpro/source/filter/xfilter/xfdrawgroup.hxx 2008-10-22 11:42:34.000000000 +0800
9133 @@ -0,0 +1,115 @@
9134 +/*************************************************************************
9136 + * The Contents of this file are made available subject to the terms of
9137 + * either of the following licenses
9139 + * - GNU Lesser General Public License Version 2.1
9140 + * - Sun Industry Standards Source License Version 1.1
9142 + * Sun Microsystems Inc., October, 2000
9144 + * GNU Lesser General Public License Version 2.1
9145 + * =============================================
9146 + * Copyright 2000 by Sun Microsystems, Inc.
9147 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
9149 + * This library is free software; you can redistribute it and/or
9150 + * modify it under the terms of the GNU Lesser General Public
9151 + * License version 2.1, as published by the Free Software Foundation.
9153 + * This library is distributed in the hope that it will be useful,
9154 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
9155 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9156 + * Lesser General Public License for more details.
9158 + * You should have received a copy of the GNU Lesser General Public
9159 + * License along with this library; if not, write to the Free Software
9160 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
9161 + * MA 02111-1307 USA
9164 + * Sun Industry Standards Source License Version 1.1
9165 + * =================================================
9166 + * The contents of this file are subject to the Sun Industry Standards
9167 + * Source License Version 1.1 (the "License"); You may not use this file
9168 + * except in compliance with the License. You may obtain a copy of the
9169 + * License at http://www.openoffice.org/license.html.
9171 + * Software provided under this License is provided on an "AS IS" basis,
9172 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
9173 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
9174 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
9175 + * See the License for the specific provisions governing your rights and
9176 + * obligations concerning the Software.
9178 + * The Initial Developer of the Original Code is: IBM Corporation
9180 + * Copyright: 2008 by IBM Corporation
9182 + * All Rights Reserved.
9184 + * Contributor(s): _______________________________________
9187 + ************************************************************************/
9188 +/*************************************************************************
9189 + * @file
9190 + * Group of drawing objects.
9191 + ************************************************************************/
9192 +/*************************************************************************
9193 + * Change History
9194 + * 2004-2-21 create this file.
9195 + ************************************************************************/
9196 +#ifndef _XFDRAWGROUP_HXX
9197 +#define _XFDRAWGROUP_HXX
9199 +#include "xfdrawobj.hxx"
9200 +#include "xfframe.hxx"
9201 +#include "xfcontentcontainer.hxx"
9203 +/**
9204 + * @brief
9205 + * Group obejct for drawing.
9206 + */
9207 +class XFDrawGroup : public XFDrawObject
9209 +public:
9210 + XFDrawGroup(){}
9212 +public:
9213 + /**
9214 + * @descr Add a drawing object to the group.
9215 + */
9216 + void Add(XFFrame *pFrame);
9218 + /**
9219 + * @descr Output group obejct and all it's children.
9220 + */
9221 + virtual void ToXml(IXFStream *pStrm);
9223 +private:
9224 + XFContentContainer m_aChildren;
9227 +inline void XFDrawGroup::Add(XFFrame *pFrame)
9229 + if( pFrame )
9230 + m_aChildren.Add(pFrame);
9233 +inline void XFDrawGroup::ToXml(IXFStream *pStrm)
9235 + IXFAttrList *pAttrList = pStrm->GetAttrList();
9237 + pAttrList->Clear();
9238 + XFDrawObject::ToXml(pStrm);
9240 + pStrm->StartElement( A2OUSTR("draw:g") );
9242 + m_aChildren.ToXml(pStrm);
9244 + pStrm->EndElement( A2OUSTR("draw:g") );
9248 +#endif
9249 \ No newline at end of file
9250 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawline.cxx lotuswordpro/source/filter/xfilter/xfdrawline.cxx
9251 --- lotuswordpro.bak/source/filter/xfilter/xfdrawline.cxx 1970-01-01 08:00:00.000000000 +0800
9252 +++ lotuswordpro/source/filter/xfilter/xfdrawline.cxx 2008-10-22 11:42:34.000000000 +0800
9253 @@ -0,0 +1,123 @@
9254 +/*************************************************************************
9256 + * The Contents of this file are made available subject to the terms of
9257 + * either of the following licenses
9259 + * - GNU Lesser General Public License Version 2.1
9260 + * - Sun Industry Standards Source License Version 1.1
9262 + * Sun Microsystems Inc., October, 2000
9264 + * GNU Lesser General Public License Version 2.1
9265 + * =============================================
9266 + * Copyright 2000 by Sun Microsystems, Inc.
9267 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
9269 + * This library is free software; you can redistribute it and/or
9270 + * modify it under the terms of the GNU Lesser General Public
9271 + * License version 2.1, as published by the Free Software Foundation.
9273 + * This library is distributed in the hope that it will be useful,
9274 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
9275 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9276 + * Lesser General Public License for more details.
9278 + * You should have received a copy of the GNU Lesser General Public
9279 + * License along with this library; if not, write to the Free Software
9280 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
9281 + * MA 02111-1307 USA
9284 + * Sun Industry Standards Source License Version 1.1
9285 + * =================================================
9286 + * The contents of this file are subject to the Sun Industry Standards
9287 + * Source License Version 1.1 (the "License"); You may not use this file
9288 + * except in compliance with the License. You may obtain a copy of the
9289 + * License at http://www.openoffice.org/license.html.
9291 + * Software provided under this License is provided on an "AS IS" basis,
9292 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
9293 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
9294 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
9295 + * See the License for the specific provisions governing your rights and
9296 + * obligations concerning the Software.
9298 + * The Initial Developer of the Original Code is: IBM Corporation
9300 + * Copyright: 2008 by IBM Corporation
9302 + * All Rights Reserved.
9304 + * Contributor(s): _______________________________________
9307 + ************************************************************************/
9308 +/*************************************************************************
9309 + * @file
9310 + * Line object.
9311 + ************************************************************************/
9312 +/*************************************************************************
9313 + * Change History
9314 + * 2004-2-17 create this file.
9315 + ************************************************************************/
9316 +#include "xfdrawline.hxx"
9318 +XFDrawLine::XFDrawLine()
9322 +void XFDrawLine::ToXml(IXFStream *pStrm)
9324 + IXFAttrList *pAttrList = pStrm->GetAttrList();
9326 + if( GetStyleName().getLength() )
9327 + pAttrList->AddAttribute( A2OUSTR("draw:style-name"), GetStyleName() );
9329 + assert(m_strName.getLength()>0); //name should not be null.
9330 + if( m_strName.getLength() )
9331 + pAttrList->AddAttribute( A2OUSTR("draw:name"), m_strName );
9332 + //anchor type:
9333 + switch( m_eAnchor )
9335 + case enumXFAnchorPara:
9336 + pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("paragraph") );
9337 + break;
9338 + case enumXFAnchorPage:
9339 + pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("page") );
9340 + break;
9341 + case enumXFAnchorChar:
9342 + pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("char") );
9343 + break;
9344 + case enumXFAnchorAsChar:
9345 + pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("as-char") );
9346 + break;
9347 + case enumXFAnchorFrame:
9348 + pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("frame") );
9349 + break;
9351 + pAttrList->AddAttribute( A2OUSTR("draw:z-index"), Int32ToOUString(m_nZIndex) );
9353 + pAttrList->AddAttribute( A2OUSTR("svg:x1"), DoubleToOUString(m_aPoint1.GetX()) + A2OUSTR("cm") );
9354 + pAttrList->AddAttribute( A2OUSTR("svg:y1"), DoubleToOUString(m_aPoint1.GetY()) + A2OUSTR("cm") );
9355 + pAttrList->AddAttribute( A2OUSTR("svg:x2"), DoubleToOUString(m_aPoint2.GetX()) + A2OUSTR("cm") );
9356 + pAttrList->AddAttribute( A2OUSTR("svg:y2"), DoubleToOUString(m_aPoint2.GetY()) + A2OUSTR("cm") );
9358 + //transform
9359 + rtl::OUString strTransform;
9360 + if( m_nFlag&XFDRAWOBJECT_FLAG_ROTATE )
9361 + strTransform = A2OUSTR("rotate (") + DoubleToOUString(m_fRotate) + A2OUSTR(") ");
9362 + if( m_nFlag&XFDRAWOBJECT_FLAG_TRANLATE )
9363 + strTransform += A2OUSTR("translate (") + DoubleToOUString(m_aRotatePoint.GetX()) + A2OUSTR("cm ") + DoubleToOUString(m_aRotatePoint.GetY()) + A2OUSTR("cm) ");
9364 + if( m_nFlag&XFDRAWOBJECT_FLAG_SKEWX )
9365 + strTransform += A2OUSTR("skewX (") + DoubleToOUString(m_fSkewX) + A2OUSTR(" ");
9366 + if( m_nFlag&XFDRAWOBJECT_FLAG_SKEWY )
9367 + strTransform += A2OUSTR("skewY (") + DoubleToOUString(m_fSkewY) + A2OUSTR(" ");
9368 + strTransform = strTransform.trim();
9370 + if( strTransform.getLength() > 0 )
9371 + pAttrList->AddAttribute( A2OUSTR("draw:transform"), strTransform );
9373 + pStrm->StartElement( A2OUSTR("draw:line") );
9374 + ContentToXml(pStrm);
9375 + pStrm->EndElement( A2OUSTR("draw:line") );
9377 \ No newline at end of file
9378 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawline.hxx lotuswordpro/source/filter/xfilter/xfdrawline.hxx
9379 --- lotuswordpro.bak/source/filter/xfilter/xfdrawline.hxx 1970-01-01 08:00:00.000000000 +0800
9380 +++ lotuswordpro/source/filter/xfilter/xfdrawline.hxx 2008-10-22 11:42:34.000000000 +0800
9381 @@ -0,0 +1,112 @@
9382 +/*************************************************************************
9384 + * The Contents of this file are made available subject to the terms of
9385 + * either of the following licenses
9387 + * - GNU Lesser General Public License Version 2.1
9388 + * - Sun Industry Standards Source License Version 1.1
9390 + * Sun Microsystems Inc., October, 2000
9392 + * GNU Lesser General Public License Version 2.1
9393 + * =============================================
9394 + * Copyright 2000 by Sun Microsystems, Inc.
9395 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
9397 + * This library is free software; you can redistribute it and/or
9398 + * modify it under the terms of the GNU Lesser General Public
9399 + * License version 2.1, as published by the Free Software Foundation.
9401 + * This library is distributed in the hope that it will be useful,
9402 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
9403 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9404 + * Lesser General Public License for more details.
9406 + * You should have received a copy of the GNU Lesser General Public
9407 + * License along with this library; if not, write to the Free Software
9408 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
9409 + * MA 02111-1307 USA
9412 + * Sun Industry Standards Source License Version 1.1
9413 + * =================================================
9414 + * The contents of this file are subject to the Sun Industry Standards
9415 + * Source License Version 1.1 (the "License"); You may not use this file
9416 + * except in compliance with the License. You may obtain a copy of the
9417 + * License at http://www.openoffice.org/license.html.
9419 + * Software provided under this License is provided on an "AS IS" basis,
9420 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
9421 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
9422 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
9423 + * See the License for the specific provisions governing your rights and
9424 + * obligations concerning the Software.
9426 + * The Initial Developer of the Original Code is: IBM Corporation
9428 + * Copyright: 2008 by IBM Corporation
9430 + * All Rights Reserved.
9432 + * Contributor(s): _______________________________________
9435 + ************************************************************************/
9436 +/*************************************************************************
9437 + * @file
9438 + * Line object.
9439 + ************************************************************************/
9440 +/*************************************************************************
9441 + * Change History
9442 + * 2004-2-17 create this file.
9443 + ************************************************************************/
9444 +#ifndef _XFDRAWLINE_HXX
9445 +#define _XFDRAWLINE_HXX
9447 +#include "xfdrawobj.hxx"
9448 +#include "xfpoint.hxx"
9450 +/**
9451 + * @brief
9452 + * Line obejct of drawing layer.
9453 + */
9454 +class XFDrawLine : public XFDrawObject
9456 +public:
9457 + XFDrawLine();
9459 +public:
9460 + /**
9461 + * @descr Set line start point.
9462 + */
9463 + void SetStartPoint(double x, double y);
9465 + /**
9466 + * @descr Set line end point.
9467 + */
9468 + void SetEndPoint(double x, double y);
9470 + /**
9471 + * @descr Output line object.
9472 + */
9473 + virtual void ToXml(IXFStream *pStrm);
9475 +private:
9476 + XFPoint m_aPoint1;
9477 + XFPoint m_aPoint2;
9480 +inline void XFDrawLine::SetStartPoint(double x, double y)
9482 + m_aPoint1.SetX(x);
9483 + m_aPoint1.SetY(y);
9486 +inline void XFDrawLine::SetEndPoint(double x, double y)
9488 + m_aPoint2.SetX(x);
9489 + m_aPoint2.SetY(y);
9492 +#endif
9494 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawlinestyle.cxx lotuswordpro/source/filter/xfilter/xfdrawlinestyle.cxx
9495 --- lotuswordpro.bak/source/filter/xfilter/xfdrawlinestyle.cxx 1970-01-01 08:00:00.000000000 +0800
9496 +++ lotuswordpro/source/filter/xfilter/xfdrawlinestyle.cxx 2008-10-22 11:42:34.000000000 +0800
9497 @@ -0,0 +1,123 @@
9498 +/*************************************************************************
9500 + * The Contents of this file are made available subject to the terms of
9501 + * either of the following licenses
9503 + * - GNU Lesser General Public License Version 2.1
9504 + * - Sun Industry Standards Source License Version 1.1
9506 + * Sun Microsystems Inc., October, 2000
9508 + * GNU Lesser General Public License Version 2.1
9509 + * =============================================
9510 + * Copyright 2000 by Sun Microsystems, Inc.
9511 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
9513 + * This library is free software; you can redistribute it and/or
9514 + * modify it under the terms of the GNU Lesser General Public
9515 + * License version 2.1, as published by the Free Software Foundation.
9517 + * This library is distributed in the hope that it will be useful,
9518 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
9519 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9520 + * Lesser General Public License for more details.
9522 + * You should have received a copy of the GNU Lesser General Public
9523 + * License along with this library; if not, write to the Free Software
9524 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
9525 + * MA 02111-1307 USA
9528 + * Sun Industry Standards Source License Version 1.1
9529 + * =================================================
9530 + * The contents of this file are subject to the Sun Industry Standards
9531 + * Source License Version 1.1 (the "License"); You may not use this file
9532 + * except in compliance with the License. You may obtain a copy of the
9533 + * License at http://www.openoffice.org/license.html.
9535 + * Software provided under this License is provided on an "AS IS" basis,
9536 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
9537 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
9538 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
9539 + * See the License for the specific provisions governing your rights and
9540 + * obligations concerning the Software.
9542 + * The Initial Developer of the Original Code is: IBM Corporation
9544 + * Copyright: 2008 by IBM Corporation
9546 + * All Rights Reserved.
9548 + * Contributor(s): _______________________________________
9551 + ************************************************************************/
9552 +/*************************************************************************
9553 + * @file
9554 + * Line style of Drawing object.
9555 + ************************************************************************/
9556 +/*************************************************************************
9557 + * Change History
9558 + * 2004-02-21 create this file.
9559 + ************************************************************************/
9560 +#include "xfdrawlinestyle.hxx"
9562 +XFDrawLineStyle::XFDrawLineStyle()
9564 + m_eLineStyle = enumXFLineSolid;
9566 + m_fWidth = 0;
9567 + m_nTransparency = 0;
9568 + m_nNumber1 = 1;
9569 + m_nNumber2 = 1;
9570 + m_fSpace = 0;
9571 + m_fLength1 = 0;
9572 + m_fLength2 = 0;
9575 +enumXFStyle XFDrawLineStyle::GetStyleFamily()
9577 + return enumXFStyleStrokeDash;
9580 +void XFDrawLineStyle::ToXml(IXFStream *pStrm)
9582 + IXFAttrList *pAttrList = pStrm->GetAttrList();
9584 + pAttrList->Clear();
9585 + pAttrList->AddAttribute( A2OUSTR("draw:name"), GetStyleName());
9586 + //simple place here:
9587 + pAttrList->AddAttribute( A2OUSTR("draw:style"), A2OUSTR("rect"));
9589 + if( m_eLineStyle == enumXFLineDot )
9593 + else if( m_eLineStyle == enumXFLineDash )
9595 + pAttrList->AddAttribute( A2OUSTR("draw:dots1"), Int32ToOUString(m_nNumber1));
9596 + pAttrList->AddAttribute( A2OUSTR(" draw:dots1-length"), DoubleToOUString(m_fLength1) + A2OUSTR("cm"));
9598 + pAttrList->AddAttribute( A2OUSTR("draw:dots2"), Int32ToOUString(m_nNumber2));
9599 + pAttrList->AddAttribute( A2OUSTR(" draw:dots2-length"), DoubleToOUString(m_fLength2) + A2OUSTR("cm"));
9601 + else if( m_eLineStyle == enumXFLineDotDash )
9603 + pAttrList->AddAttribute( A2OUSTR("draw:dots1"), Int32ToOUString(m_nNumber1));
9605 + pAttrList->AddAttribute( A2OUSTR("draw:dots2"), Int32ToOUString(m_nNumber2));
9606 + pAttrList->AddAttribute( A2OUSTR(" draw:dots2-length"), DoubleToOUString(m_fLength2) + A2OUSTR("cm"));
9608 + else if( m_eLineStyle == enumXFLineDashDot )
9610 + pAttrList->AddAttribute( A2OUSTR("draw:dots1"), Int32ToOUString(m_nNumber1));
9611 + pAttrList->AddAttribute( A2OUSTR(" draw:dots1-length"), DoubleToOUString(m_fLength1) + A2OUSTR("cm"));
9613 + pAttrList->AddAttribute( A2OUSTR("draw:dots2"), Int32ToOUString(m_nNumber2));
9616 + pAttrList->AddAttribute( A2OUSTR("draw:distance"), DoubleToOUString(m_fSpace) + A2OUSTR("cm") );
9618 + pStrm->StartElement( A2OUSTR("draw:stroke-dash") );
9619 + pStrm->EndElement( A2OUSTR("draw:stroke-dash") );
9621 \ No newline at end of file
9622 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawlinestyle.hxx lotuswordpro/source/filter/xfilter/xfdrawlinestyle.hxx
9623 --- lotuswordpro.bak/source/filter/xfilter/xfdrawlinestyle.hxx 1970-01-01 08:00:00.000000000 +0800
9624 +++ lotuswordpro/source/filter/xfilter/xfdrawlinestyle.hxx 2008-10-22 11:42:34.000000000 +0800
9625 @@ -0,0 +1,217 @@
9626 +/*************************************************************************
9628 + * The Contents of this file are made available subject to the terms of
9629 + * either of the following licenses
9631 + * - GNU Lesser General Public License Version 2.1
9632 + * - Sun Industry Standards Source License Version 1.1
9634 + * Sun Microsystems Inc., October, 2000
9636 + * GNU Lesser General Public License Version 2.1
9637 + * =============================================
9638 + * Copyright 2000 by Sun Microsystems, Inc.
9639 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
9641 + * This library is free software; you can redistribute it and/or
9642 + * modify it under the terms of the GNU Lesser General Public
9643 + * License version 2.1, as published by the Free Software Foundation.
9645 + * This library is distributed in the hope that it will be useful,
9646 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
9647 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9648 + * Lesser General Public License for more details.
9650 + * You should have received a copy of the GNU Lesser General Public
9651 + * License along with this library; if not, write to the Free Software
9652 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
9653 + * MA 02111-1307 USA
9656 + * Sun Industry Standards Source License Version 1.1
9657 + * =================================================
9658 + * The contents of this file are subject to the Sun Industry Standards
9659 + * Source License Version 1.1 (the "License"); You may not use this file
9660 + * except in compliance with the License. You may obtain a copy of the
9661 + * License at http://www.openoffice.org/license.html.
9663 + * Software provided under this License is provided on an "AS IS" basis,
9664 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
9665 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
9666 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
9667 + * See the License for the specific provisions governing your rights and
9668 + * obligations concerning the Software.
9670 + * The Initial Developer of the Original Code is: IBM Corporation
9672 + * Copyright: 2008 by IBM Corporation
9674 + * All Rights Reserved.
9676 + * Contributor(s): _______________________________________
9679 + ************************************************************************/
9680 +/*************************************************************************
9681 + * @file
9682 + * Line style of Drawing object.
9683 + ************************************************************************/
9684 +/*************************************************************************
9685 + * Change History
9686 + * 2004-02-21 create this file.
9687 + ************************************************************************/
9688 +#ifndef _XFDRAWLINESTYLE_HXX
9689 +#define _XFDRAWLINESTYLE_HXX
9691 +#include "xfstyle.hxx"
9692 +#include "xfcolor.hxx"
9694 +/**
9695 + * @brief
9696 + * Border line style for drawing obejct.
9697 + */
9698 +class XFDrawLineStyle : public XFStyle
9700 +public:
9701 + XFDrawLineStyle();
9703 +public:
9704 + /**
9705 + * @descr Set line width.
9706 + */
9707 + void SetWidth(double width);
9709 + /**
9710 + * @descr Set line color.
9711 + */
9712 + void SetColor(const XFColor& color);
9714 + /**
9715 + * @descr Set line transparency.
9716 + */
9717 + void SetTransparency(sal_Int32 transparency);
9719 + /**
9720 + * @descr Set line type, solid,dash,dot?
9721 + */
9722 + void SetLineStyle(enumXFLineStyle style);
9724 + /**
9725 + * @descr Set first dot number of dash line.
9726 + */
9727 + void SetDot1Number(sal_Int32 number);
9729 + /**
9730 + * @descr Set second dot number of dash line.
9731 + */
9732 + void SetDot2Number(sal_Int32 number);
9734 + /**
9735 + * @descr Set first dot length.
9736 + */
9737 + void SetDot1Length(double length);
9739 + /**
9740 + * @descr Set second dot length.
9741 + */
9742 + void SetDot2Length(double length);
9744 + /**
9745 + * @descr Set space between dash dot.
9746 + */
9747 + void SetSpace(double space);
9749 + /**
9750 + * @descr decide whether it's a solid line.
9751 + */
9752 + sal_Bool IsSolid();
9754 + double GetWidth();
9756 + XFColor GetColor();
9758 + sal_Int32 GetTransparency();
9760 + virtual enumXFStyle GetStyleFamily();
9762 + virtual void ToXml(IXFStream *pStrm);
9764 +private:
9765 + enumXFLineStyle m_eLineStyle;
9766 + XFColor m_aColor;
9767 + double m_fWidth;
9768 + sal_Int32 m_nTransparency;
9769 + sal_Int32 m_nNumber1;
9770 + sal_Int32 m_nNumber2;
9771 + double m_fSpace;
9772 + double m_fLength1;
9773 + double m_fLength2;
9776 +inline void XFDrawLineStyle::SetWidth(double width)
9778 + m_fWidth = width;
9781 +inline void XFDrawLineStyle::SetColor(const XFColor& color)
9783 + m_aColor = color;
9786 +inline void XFDrawLineStyle::SetTransparency(sal_Int32 transparency)
9788 + m_nTransparency = transparency;
9791 +inline void XFDrawLineStyle::SetLineStyle(enumXFLineStyle style)
9793 + m_eLineStyle = style;
9796 +inline void XFDrawLineStyle::SetDot1Number(sal_Int32 number)
9798 + m_nNumber1 = number;
9801 +inline void XFDrawLineStyle::SetDot2Number(sal_Int32 number)
9803 + m_nNumber2 = number;
9806 +inline void XFDrawLineStyle::SetDot1Length(double length)
9808 + m_fLength1 = length;
9811 +inline void XFDrawLineStyle::SetDot2Length(double length)
9813 + m_fLength2 = length;
9816 +inline void XFDrawLineStyle::SetSpace(double space)
9818 + m_fSpace = space;
9821 +inline sal_Bool XFDrawLineStyle::IsSolid()
9823 + return (m_eLineStyle==enumXFLineSolid);
9826 +inline double XFDrawLineStyle::GetWidth()
9828 + return m_fWidth;
9831 +inline XFColor XFDrawLineStyle::GetColor()
9833 + return m_aColor;
9836 +inline sal_Int32 XFDrawLineStyle::GetTransparency()
9838 + return m_nTransparency;
9842 +#endif
9843 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawobj.cxx lotuswordpro/source/filter/xfilter/xfdrawobj.cxx
9844 --- lotuswordpro.bak/source/filter/xfilter/xfdrawobj.cxx 1970-01-01 08:00:00.000000000 +0800
9845 +++ lotuswordpro/source/filter/xfilter/xfdrawobj.cxx 2008-10-22 11:42:34.000000000 +0800
9846 @@ -0,0 +1,134 @@
9847 +/*************************************************************************
9849 + * The Contents of this file are made available subject to the terms of
9850 + * either of the following licenses
9852 + * - GNU Lesser General Public License Version 2.1
9853 + * - Sun Industry Standards Source License Version 1.1
9855 + * Sun Microsystems Inc., October, 2000
9857 + * GNU Lesser General Public License Version 2.1
9858 + * =============================================
9859 + * Copyright 2000 by Sun Microsystems, Inc.
9860 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
9862 + * This library is free software; you can redistribute it and/or
9863 + * modify it under the terms of the GNU Lesser General Public
9864 + * License version 2.1, as published by the Free Software Foundation.
9866 + * This library is distributed in the hope that it will be useful,
9867 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
9868 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9869 + * Lesser General Public License for more details.
9871 + * You should have received a copy of the GNU Lesser General Public
9872 + * License along with this library; if not, write to the Free Software
9873 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
9874 + * MA 02111-1307 USA
9877 + * Sun Industry Standards Source License Version 1.1
9878 + * =================================================
9879 + * The contents of this file are subject to the Sun Industry Standards
9880 + * Source License Version 1.1 (the "License"); You may not use this file
9881 + * except in compliance with the License. You may obtain a copy of the
9882 + * License at http://www.openoffice.org/license.html.
9884 + * Software provided under this License is provided on an "AS IS" basis,
9885 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
9886 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
9887 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
9888 + * See the License for the specific provisions governing your rights and
9889 + * obligations concerning the Software.
9891 + * The Initial Developer of the Original Code is: IBM Corporation
9893 + * Copyright: 2008 by IBM Corporation
9895 + * All Rights Reserved.
9897 + * Contributor(s): _______________________________________
9900 + ************************************************************************/
9901 +/*************************************************************************
9902 + * @file
9903 + * Interfer for all Drawing object.
9904 + ************************************************************************/
9905 +/*************************************************************************
9906 + * Change History
9907 + * 2004-2-17 create this file.
9908 + * 2005-4-1 revise for rotate.
9909 + ************************************************************************/
9910 +#include "xfdrawobj.hxx"
9912 +XFDrawObject::XFDrawObject()
9914 + m_fRotate = 0;
9915 + m_fScaleX = 0;
9916 + m_fScaleY = 0;
9917 + m_fSkewX = 0;
9918 + m_fSkewY = 0;
9919 + m_nFlag = 0;
9920 + m_eType = enumXFFrameDrawing;
9923 +void XFDrawObject::ContentToXml(IXFStream *pStrm)
9925 + XFContentContainer::ToXml(pStrm);
9928 +void XFDrawObject::ToXml(IXFStream *pStrm)
9930 + IXFAttrList *pAttrList = pStrm->GetAttrList();
9932 + if( GetStyleName().getLength() )
9933 + pAttrList->AddAttribute( A2OUSTR("draw:style-name"), GetStyleName() );
9935 + assert(m_strName.getLength()>0); //name should not be null.
9936 + if( m_strName.getLength() )
9937 + pAttrList->AddAttribute( A2OUSTR("draw:name"), m_strName );
9938 + //anchor type:
9939 + switch( m_eAnchor )
9941 + case enumXFAnchorPara:
9942 + pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("paragraph") );
9943 + break;
9944 + case enumXFAnchorPage:
9945 + pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("page") );
9946 + break;
9947 + case enumXFAnchorChar:
9948 + pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("char") );
9949 + break;
9950 + case enumXFAnchorAsChar:
9951 + pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("as-char") );
9952 + break;
9953 + case enumXFAnchorFrame:
9954 + pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("frame") );
9955 + break;
9957 + pAttrList->AddAttribute( A2OUSTR("draw:z-index"), Int32ToOUString(m_nZIndex) );
9959 + pAttrList->AddAttribute( A2OUSTR("svg:x"), DoubleToOUString(m_aRect.GetX()) + A2OUSTR("cm") );
9960 + pAttrList->AddAttribute( A2OUSTR("svg:y"), DoubleToOUString(m_aRect.GetY()) + A2OUSTR("cm") );
9961 + pAttrList->AddAttribute( A2OUSTR("svg:width"), DoubleToOUString(m_aRect.GetWidth()) + A2OUSTR("cm") );
9962 + pAttrList->AddAttribute( A2OUSTR("svg:height"), DoubleToOUString(m_aRect.GetHeight()) + A2OUSTR("cm") );
9964 + //transform
9965 + rtl::OUString strTransform;
9966 + if( m_nFlag&XFDRAWOBJECT_FLAG_ROTATE )
9967 + strTransform = A2OUSTR("rotate (") + DoubleToOUString(m_fRotate) + A2OUSTR(") ");
9968 + if( m_nFlag&XFDRAWOBJECT_FLAG_TRANLATE )
9969 + strTransform += A2OUSTR("translate (") + DoubleToOUString(m_aRotatePoint.GetX()) + A2OUSTR("cm ") + DoubleToOUString(m_aRotatePoint.GetY()) + A2OUSTR("cm) ");
9970 + if( m_nFlag&XFDRAWOBJECT_FLAG_SCALE )
9971 + strTransform += A2OUSTR("scale (") + DoubleToOUString(m_fScaleX) + A2OUSTR("cm ") + DoubleToOUString(m_fScaleY) + A2OUSTR("cm) ");
9972 + if( m_nFlag&XFDRAWOBJECT_FLAG_SKEWX )
9973 + strTransform += A2OUSTR("skewX (") + DoubleToOUString(m_fSkewX) + A2OUSTR(" ");
9974 + if( m_nFlag&XFDRAWOBJECT_FLAG_SKEWY )
9975 + strTransform += A2OUSTR("skewY (") + DoubleToOUString(m_fSkewY) + A2OUSTR(" ");
9976 + strTransform = strTransform.trim();
9978 + if( strTransform.getLength() > 0 )
9979 + pAttrList->AddAttribute( A2OUSTR("draw:transform"), strTransform );
9981 \ No newline at end of file
9982 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawobj.hxx lotuswordpro/source/filter/xfilter/xfdrawobj.hxx
9983 --- lotuswordpro.bak/source/filter/xfilter/xfdrawobj.hxx 1970-01-01 08:00:00.000000000 +0800
9984 +++ lotuswordpro/source/filter/xfilter/xfdrawobj.hxx 2008-10-22 11:42:34.000000000 +0800
9985 @@ -0,0 +1,179 @@
9986 +/*************************************************************************
9988 + * The Contents of this file are made available subject to the terms of
9989 + * either of the following licenses
9991 + * - GNU Lesser General Public License Version 2.1
9992 + * - Sun Industry Standards Source License Version 1.1
9994 + * Sun Microsystems Inc., October, 2000
9996 + * GNU Lesser General Public License Version 2.1
9997 + * =============================================
9998 + * Copyright 2000 by Sun Microsystems, Inc.
9999 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
10001 + * This library is free software; you can redistribute it and/or
10002 + * modify it under the terms of the GNU Lesser General Public
10003 + * License version 2.1, as published by the Free Software Foundation.
10005 + * This library is distributed in the hope that it will be useful,
10006 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
10007 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10008 + * Lesser General Public License for more details.
10010 + * You should have received a copy of the GNU Lesser General Public
10011 + * License along with this library; if not, write to the Free Software
10012 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
10013 + * MA 02111-1307 USA
10016 + * Sun Industry Standards Source License Version 1.1
10017 + * =================================================
10018 + * The contents of this file are subject to the Sun Industry Standards
10019 + * Source License Version 1.1 (the "License"); You may not use this file
10020 + * except in compliance with the License. You may obtain a copy of the
10021 + * License at http://www.openoffice.org/license.html.
10023 + * Software provided under this License is provided on an "AS IS" basis,
10024 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
10025 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
10026 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
10027 + * See the License for the specific provisions governing your rights and
10028 + * obligations concerning the Software.
10030 + * The Initial Developer of the Original Code is: IBM Corporation
10032 + * Copyright: 2008 by IBM Corporation
10034 + * All Rights Reserved.
10036 + * Contributor(s): _______________________________________
10039 + ************************************************************************/
10040 +/*************************************************************************
10041 + * @file
10042 + * Interfer for all Drawing object.
10043 + ************************************************************************/
10044 +/*************************************************************************
10045 + * Change History
10046 + * 2004-2-17 create this file.
10047 + ************************************************************************/
10048 +#ifndef _XFDRAWOBJ_HXX
10049 +#define _XFDRAWOBJ_HXX
10051 +#include "xfframe.hxx"
10052 +#include "xfrect.hxx"
10054 +#define XFDRAWOBJECT_FLAG_ROTATE 0X00000001
10055 +#define XFDRAWOBJECT_FLAG_TRANLATE 0X00000002
10056 +#define XFDRAWOBJECT_FLAG_SKEWX 0X00000004
10057 +#define XFDRAWOBJECT_FLAG_SKEWY 0X00000008
10058 +#define XFDRAWOBJECT_FLAG_SCALE 0X00000010
10060 +/**
10061 + * @brief
10062 + * Base class for all drawing object(ellipse,rect,circle,...).
10063 + * I can set Postions,anchor,rotate,text style name here.
10065 + * Drawing obejcts can be rotated,scaled and skewed, drawing objects must have positions setted,
10066 + * you can use SetPosition(...).
10067 + */
10068 +class XFDrawObject : public XFFrame
10070 +public:
10071 + XFDrawObject();
10073 +public:
10074 + /**
10075 + * @descr Set style name for drawing text.
10076 + */
10077 + void SetTextStyleName(rtl::OUString style);
10079 + /**
10080 + * @descr Set drawing obejct rotate.
10081 + */
10082 + void SetRotate(double degree, XFPoint aRotatePoint=XFPoint(0,0));
10084 + /**
10085 + * @descr Set drawing object scale.
10086 + */
10087 + void SetScale(double cx, double cy);
10089 + /**
10090 + * @descr Set drawing object skew.
10091 + */
10092 + void SetSkewX(double cx);
10094 + /**
10095 + * @descr Set drawing obejct y skew.
10096 + */
10097 + void SetSkewY(double cy);
10099 + void ContentToXml(IXFStream *pStrm);
10101 + virtual void ToXml(IXFStream *pStrm);
10103 +protected:
10104 + XFContentContainer m_aContents;
10105 + rtl::OUString m_strTextStyle;
10106 + double m_fRotate;
10107 + XFPoint m_aRotatePoint;
10108 + double m_fScaleX;
10109 + double m_fScaleY;
10110 + double m_fSkewX;
10111 + double m_fSkewY;
10113 + unsigned int m_nFlag;
10116 +inline void XFDrawObject::SetTextStyleName(rtl::OUString style)
10118 + m_strTextStyle = style;
10121 +inline void XFDrawObject::SetPosition(double x, double y, double width, double height)
10123 + SetX(x);
10124 + SetY(y);
10125 + SetWidth(width);
10126 + SetHeight(height);
10129 +inline void XFDrawObject::SetPosition(XFRect rect)
10131 + SetX(rect.GetX());
10132 + SetY(rect.GetY());
10133 + SetWidth(rect.GetWidth());
10134 + SetHeight(rect.GetHeight());
10137 +inline void XFDrawObject::SetRotate(double degree, XFPoint aRotatePoint)
10139 + m_nFlag |= XFDRAWOBJECT_FLAG_ROTATE;
10140 + m_fRotate = degree*2*PI/360;
10141 + m_aRotatePoint = aRotatePoint;
10144 +inline void XFDrawObject::SetScale(double cx, double cy)
10146 + m_nFlag |= XFDRAWOBJECT_FLAG_SCALE;
10147 + m_fScaleX = cx;
10148 + m_fScaleY = cy;
10151 +inline void XFDrawObject::SetSkewX(double cx)
10153 + m_nFlag |= XFDRAWOBJECT_FLAG_SKEWX;
10154 + m_fSkewX = cx*2*PI/360;
10157 +inline void XFDrawObject::SetSkewY(double cy)
10159 + m_nFlag |= XFDRAWOBJECT_FLAG_SKEWY;
10160 + m_fSkewY = cy*2*PI/360;
10164 +#endif
10165 \ No newline at end of file
10166 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawpath.cxx lotuswordpro/source/filter/xfilter/xfdrawpath.cxx
10167 --- lotuswordpro.bak/source/filter/xfilter/xfdrawpath.cxx 1970-01-01 08:00:00.000000000 +0800
10168 +++ lotuswordpro/source/filter/xfilter/xfdrawpath.cxx 2008-10-22 12:57:19.000000000 +0800
10169 @@ -0,0 +1,222 @@
10170 +/*************************************************************************
10172 + * The Contents of this file are made available subject to the terms of
10173 + * either of the following licenses
10175 + * - GNU Lesser General Public License Version 2.1
10176 + * - Sun Industry Standards Source License Version 1.1
10178 + * Sun Microsystems Inc., October, 2000
10180 + * GNU Lesser General Public License Version 2.1
10181 + * =============================================
10182 + * Copyright 2000 by Sun Microsystems, Inc.
10183 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
10185 + * This library is free software; you can redistribute it and/or
10186 + * modify it under the terms of the GNU Lesser General Public
10187 + * License version 2.1, as published by the Free Software Foundation.
10189 + * This library is distributed in the hope that it will be useful,
10190 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
10191 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10192 + * Lesser General Public License for more details.
10194 + * You should have received a copy of the GNU Lesser General Public
10195 + * License along with this library; if not, write to the Free Software
10196 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
10197 + * MA 02111-1307 USA
10200 + * Sun Industry Standards Source License Version 1.1
10201 + * =================================================
10202 + * The contents of this file are subject to the Sun Industry Standards
10203 + * Source License Version 1.1 (the "License"); You may not use this file
10204 + * except in compliance with the License. You may obtain a copy of the
10205 + * License at http://www.openoffice.org/license.html.
10207 + * Software provided under this License is provided on an "AS IS" basis,
10208 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
10209 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
10210 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
10211 + * See the License for the specific provisions governing your rights and
10212 + * obligations concerning the Software.
10214 + * The Initial Developer of the Original Code is: IBM Corporation
10216 + * Copyright: 2008 by IBM Corporation
10218 + * All Rights Reserved.
10220 + * Contributor(s): _______________________________________
10223 + ************************************************************************/
10224 +/*************************************************************************
10225 + * @file
10226 + * Draw path object.
10227 + ************************************************************************/
10228 +/*************************************************************************
10229 + * Change History
10230 + * 2004-2-18 create this file.
10231 + ************************************************************************/
10232 +#include "xfdrawpath.hxx"
10234 +XFSvgPathEntry::XFSvgPathEntry()
10238 +XFSvgPathEntry::XFSvgPathEntry(rtl::OUString cmd)
10240 + m_strCommand = cmd;
10243 +rtl::OUString XFSvgPathEntry::ToString()
10245 + assert(m_strCommand.getLength()>0);
10246 + rtl::OUString str = m_strCommand;
10247 + std::vector<XFPoint>::iterator it;
10249 + for( it = m_aPoints.begin(); it != m_aPoints.end(); it++ )
10251 + XFPoint aPt= *it;
10252 + str += DoubleToOUString(aPt.GetX()*1000) + A2OUSTR(" ") + DoubleToOUString(aPt.GetY()*1000) + A2OUSTR(" ");
10254 + return str.trim();
10257 +XFDrawPath::XFDrawPath()
10261 +void XFDrawPath::MoveTo(XFPoint pt, sal_Bool absPosition)
10263 + XFSvgPathEntry entry;
10265 + if( absPosition )
10266 + entry.SetCommand(A2OUSTR("M"));
10267 + else
10268 + entry.SetCommand(A2OUSTR("m"));
10269 + entry.AddPoint(pt);
10270 + m_aPaths.push_back(entry);
10273 +void XFDrawPath::LineTo(XFPoint pt, sal_Bool absPosition)
10275 + XFSvgPathEntry entry;
10277 + if( absPosition )
10278 + entry.SetCommand(A2OUSTR("L"));
10279 + else
10280 + entry.SetCommand(A2OUSTR("l"));
10281 + entry.AddPoint(pt);
10282 + m_aPaths.push_back(entry);
10285 +void XFDrawPath::CurveTo(XFPoint dest, XFPoint ctrl1, XFPoint ctrl2, sal_Bool absPosition)
10287 + XFSvgPathEntry entry;
10289 + if( absPosition )
10290 + entry.SetCommand(A2OUSTR("C"));
10291 + else
10292 + entry.SetCommand(A2OUSTR("c"));
10293 + entry.AddPoint(ctrl1);
10294 + entry.AddPoint(ctrl2);
10295 + entry.AddPoint(dest);
10297 + m_aPaths.push_back(entry);
10300 +void XFDrawPath::SmoothCurveTo(XFPoint dest, XFPoint ctrl, sal_Bool absPosition)
10302 + XFSvgPathEntry entry;
10304 + if( absPosition )
10305 + entry.SetCommand(A2OUSTR("C"));
10306 + else
10307 + entry.SetCommand(A2OUSTR("c"));
10308 + entry.AddPoint(ctrl);
10309 + entry.AddPoint(dest);
10311 + m_aPaths.push_back(entry);
10314 +void XFDrawPath::ClosePath(sal_Bool absPosition)
10316 + XFSvgPathEntry entry;
10318 + if( absPosition )
10319 + entry.SetCommand(A2OUSTR("Z"));
10320 + else
10321 + entry.SetCommand(A2OUSTR("z"));
10323 + m_aPaths.push_back(entry);
10326 +void XFDrawPath::ToXml(IXFStream *pStrm)
10328 + IXFAttrList *pAttrList = pStrm->GetAttrList();
10330 + pAttrList->Clear();
10331 + //view-box:
10332 + XFRect rect = m_aRect;
10334 + rtl::OUString strViewBox = A2OUSTR("0 0 ");
10335 + strViewBox += DoubleToOUString(rect.GetWidth()*1000) + A2OUSTR(" ");
10336 + strViewBox += DoubleToOUString(rect.GetHeight()*1000);
10337 + pAttrList->AddAttribute( A2OUSTR("svg:viewBox"), strViewBox);
10339 + //points
10340 + rtl::OUString strPath;
10341 + std::vector<XFSvgPathEntry>::iterator it;
10342 + for( it = m_aPaths.begin(); it != m_aPaths.end(); it++ )
10344 + XFSvgPathEntry aSvg = *it;
10345 + strPath += aSvg.ToString();
10346 + }
10347 + strPath = strPath.trim();
10348 + pAttrList->AddAttribute( A2OUSTR("svg:d"), strPath);
10350 + SetPosition(rect);
10351 + XFDrawObject::ToXml(pStrm);
10353 + pStrm->StartElement( A2OUSTR("draw:path") );
10354 + ContentToXml(pStrm);
10355 + pStrm->EndElement( A2OUSTR("draw:path") );
10359 +XFRect XFDrawPath::CalcViewBox()
10361 + double x1 = 65536;
10362 + double y1 = 65536;
10363 + double x2 = -1; //not quite safe.()
10364 + double y2 = -1;
10365 + XFSvgPathEntry aPath;
10366 + XFPoint aPoint;
10367 + std::vector<XFSvgPathEntry>::iterator itPath = m_aPaths.begin();
10368 + std::vector<XFPoint> points;
10369 + std::vector<XFPoint>::iterator itPoint;
10370 + do{
10371 + aPath = *itPath;
10372 + points = aPath.m_aPoints;
10374 + for( itPoint = points.begin(); itPoint != points.end(); itPoint++ )
10376 + aPoint = *itPoint;
10377 + if( x1>aPoint.GetX() )
10378 + x1 = aPoint.GetX();
10379 + if( x2<aPoint.GetX() )
10380 + x2 = aPoint.GetX();
10382 + if( y1>aPoint.GetY() )
10383 + y1 = aPoint.GetY();
10384 + if( y2<aPoint.GetY() )
10385 + y2 = aPoint.GetY();
10386 + }
10387 + itPath++;
10388 + }while(itPath!=m_aPaths.end());
10390 + return XFRect(x1,y1,x2-x1,y2-y1);
10392 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawpath.hxx lotuswordpro/source/filter/xfilter/xfdrawpath.hxx
10393 --- lotuswordpro.bak/source/filter/xfilter/xfdrawpath.hxx 1970-01-01 08:00:00.000000000 +0800
10394 +++ lotuswordpro/source/filter/xfilter/xfdrawpath.hxx 2008-10-22 11:42:34.000000000 +0800
10395 @@ -0,0 +1,154 @@
10396 +/*************************************************************************
10398 + * The Contents of this file are made available subject to the terms of
10399 + * either of the following licenses
10401 + * - GNU Lesser General Public License Version 2.1
10402 + * - Sun Industry Standards Source License Version 1.1
10404 + * Sun Microsystems Inc., October, 2000
10406 + * GNU Lesser General Public License Version 2.1
10407 + * =============================================
10408 + * Copyright 2000 by Sun Microsystems, Inc.
10409 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
10411 + * This library is free software; you can redistribute it and/or
10412 + * modify it under the terms of the GNU Lesser General Public
10413 + * License version 2.1, as published by the Free Software Foundation.
10415 + * This library is distributed in the hope that it will be useful,
10416 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
10417 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10418 + * Lesser General Public License for more details.
10420 + * You should have received a copy of the GNU Lesser General Public
10421 + * License along with this library; if not, write to the Free Software
10422 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
10423 + * MA 02111-1307 USA
10426 + * Sun Industry Standards Source License Version 1.1
10427 + * =================================================
10428 + * The contents of this file are subject to the Sun Industry Standards
10429 + * Source License Version 1.1 (the "License"); You may not use this file
10430 + * except in compliance with the License. You may obtain a copy of the
10431 + * License at http://www.openoffice.org/license.html.
10433 + * Software provided under this License is provided on an "AS IS" basis,
10434 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
10435 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
10436 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
10437 + * See the License for the specific provisions governing your rights and
10438 + * obligations concerning the Software.
10440 + * The Initial Developer of the Original Code is: IBM Corporation
10442 + * Copyright: 2008 by IBM Corporation
10444 + * All Rights Reserved.
10446 + * Contributor(s): _______________________________________
10449 + ************************************************************************/
10450 +/*************************************************************************
10451 + * @file
10452 + * Draw path object.
10453 + ************************************************************************/
10454 +/*************************************************************************
10455 + * Change History
10456 + * 2004-2-18 create this file.
10457 + ************************************************************************/
10458 +#ifndef _XFDRAWPATH_HXX
10459 +#define _XFDRAWPATH_HXX
10461 +#include "xfdrawobj.hxx"
10462 +#include <vector>
10464 +/**
10465 + * @brief
10466 + * SVG path segment wrapper.
10467 + */
10468 +class XFSvgPathEntry
10470 +public:
10471 + XFSvgPathEntry();
10473 + XFSvgPathEntry(rtl::OUString cmd);
10475 +public:
10476 + /**
10477 + * @descr Set svg path command,L for line,M for move,...
10478 + */
10479 + void SetCommand(rtl::OUString cmd);
10481 + /**
10482 + * @descr Set svg path point.
10483 + */
10484 + void AddPoint(XFPoint pt);
10486 + rtl::OUString ToString();
10488 + friend class XFDrawPath;
10489 +private:
10490 + rtl::OUString m_strCommand;
10491 + std::vector<XFPoint> m_aPoints;
10494 +/**
10495 + * @brief
10496 + * For svg path wrapper.
10497 + */
10498 +class XFDrawPath : public XFDrawObject
10500 +public:
10501 + XFDrawPath();
10503 +public:
10504 + /**
10505 + * @descr Move command.
10506 + */
10507 + void MoveTo(XFPoint pt, sal_Bool absPosition = sal_True);
10509 + /**
10510 + * @descr Line command.
10511 + */
10512 + void LineTo(XFPoint pt, sal_Bool absPosition = sal_True);
10514 + /**
10515 + * @descr Curve command.
10516 + */
10517 + void CurveTo(XFPoint dest, XFPoint ctrl1, XFPoint ctrl2, sal_Bool absPosition = sal_True);
10519 + /**
10520 + * @descr Smooth curve command.
10521 + */
10522 + void SmoothCurveTo(XFPoint dest, XFPoint ctrl, sal_Bool absPosition = sal_True);
10524 + /**
10525 + * @descr Close path command.
10526 + */
10527 + void ClosePath(sal_Bool absPosition = sal_True);
10529 + XFRect CalcViewBox();
10531 + virtual void ToXml(IXFStream *pStrm);
10533 +private:
10534 + std::vector<XFSvgPathEntry> m_aPaths;
10537 +inline void XFSvgPathEntry::SetCommand(rtl::OUString cmd)
10539 + m_strCommand = cmd;
10542 +inline void XFSvgPathEntry::AddPoint(XFPoint pt)
10544 + m_aPoints.push_back(pt);
10548 +#endif
10550 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawpolygon.cxx lotuswordpro/source/filter/xfilter/xfdrawpolygon.cxx
10551 --- lotuswordpro.bak/source/filter/xfilter/xfdrawpolygon.cxx 1970-01-01 08:00:00.000000000 +0800
10552 +++ lotuswordpro/source/filter/xfilter/xfdrawpolygon.cxx 2008-10-22 11:42:34.000000000 +0800
10553 @@ -0,0 +1,101 @@
10554 +/*************************************************************************
10556 + * The Contents of this file are made available subject to the terms of
10557 + * either of the following licenses
10559 + * - GNU Lesser General Public License Version 2.1
10560 + * - Sun Industry Standards Source License Version 1.1
10562 + * Sun Microsystems Inc., October, 2000
10564 + * GNU Lesser General Public License Version 2.1
10565 + * =============================================
10566 + * Copyright 2000 by Sun Microsystems, Inc.
10567 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
10569 + * This library is free software; you can redistribute it and/or
10570 + * modify it under the terms of the GNU Lesser General Public
10571 + * License version 2.1, as published by the Free Software Foundation.
10573 + * This library is distributed in the hope that it will be useful,
10574 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
10575 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10576 + * Lesser General Public License for more details.
10578 + * You should have received a copy of the GNU Lesser General Public
10579 + * License along with this library; if not, write to the Free Software
10580 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
10581 + * MA 02111-1307 USA
10584 + * Sun Industry Standards Source License Version 1.1
10585 + * =================================================
10586 + * The contents of this file are subject to the Sun Industry Standards
10587 + * Source License Version 1.1 (the "License"); You may not use this file
10588 + * except in compliance with the License. You may obtain a copy of the
10589 + * License at http://www.openoffice.org/license.html.
10591 + * Software provided under this License is provided on an "AS IS" basis,
10592 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
10593 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
10594 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
10595 + * See the License for the specific provisions governing your rights and
10596 + * obligations concerning the Software.
10598 + * The Initial Developer of the Original Code is: IBM Corporation
10600 + * Copyright: 2008 by IBM Corporation
10602 + * All Rights Reserved.
10604 + * Contributor(s): _______________________________________
10607 + ************************************************************************/
10608 +/*************************************************************************
10609 + * @file
10610 + * Polylon object.
10611 + ************************************************************************/
10612 +/*************************************************************************
10613 + * Change History
10614 + * 2004-2-18 create this file.
10615 + ************************************************************************/
10616 +#include "xfdrawpolygon.hxx"
10618 +XFDrawPolygon::XFDrawPolygon()
10622 +void XFDrawPolygon::ToXml(IXFStream *pStrm)
10624 + IXFAttrList *pAttrList = pStrm->GetAttrList();
10625 + std::vector<XFPoint>::iterator it;
10627 + pAttrList->Clear();
10628 + //view-box:
10629 + XFRect rect = CalcViewBox();
10630 + rtl::OUString strViewBox = A2OUSTR("0 0 ");
10631 + strViewBox += DoubleToOUString(rect.GetWidth()*1000) + A2OUSTR(" ");
10632 + strViewBox += DoubleToOUString(rect.GetHeight()*1000);
10633 + pAttrList->AddAttribute( A2OUSTR("svg:viewBox"), strViewBox);
10635 + //points
10636 + rtl::OUString strPoints;
10637 + for( it = m_aPoints.begin(); it != m_aPoints.end(); it++ )
10639 + XFPoint pt = *it;
10640 + double x = (pt.GetX()-rect.GetX())*1000;
10641 + double y = (pt.GetY()-rect.GetY())*1000;
10642 + strPoints += DoubleToOUString(x) + A2OUSTR(" ") + DoubleToOUString(y) + A2OUSTR(" ");
10643 + }
10644 + strPoints = strPoints.trim();
10645 + pAttrList->AddAttribute( A2OUSTR("draw:points"), strPoints);
10647 + //
10648 + SetPosition(rect.GetX(),rect.GetY(),rect.GetWidth(),rect.GetHeight());
10649 + XFDrawObject::ToXml(pStrm);
10651 + pStrm->StartElement( A2OUSTR("draw:polygon") );
10652 + ContentToXml(pStrm);
10653 + pStrm->EndElement( A2OUSTR("draw:polygon") );
10655 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawpolygon.hxx lotuswordpro/source/filter/xfilter/xfdrawpolygon.hxx
10656 --- lotuswordpro.bak/source/filter/xfilter/xfdrawpolygon.hxx 1970-01-01 08:00:00.000000000 +0800
10657 +++ lotuswordpro/source/filter/xfilter/xfdrawpolygon.hxx 2008-10-22 11:42:34.000000000 +0800
10658 @@ -0,0 +1,82 @@
10659 +/*************************************************************************
10661 + * The Contents of this file are made available subject to the terms of
10662 + * either of the following licenses
10664 + * - GNU Lesser General Public License Version 2.1
10665 + * - Sun Industry Standards Source License Version 1.1
10667 + * Sun Microsystems Inc., October, 2000
10669 + * GNU Lesser General Public License Version 2.1
10670 + * =============================================
10671 + * Copyright 2000 by Sun Microsystems, Inc.
10672 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
10674 + * This library is free software; you can redistribute it and/or
10675 + * modify it under the terms of the GNU Lesser General Public
10676 + * License version 2.1, as published by the Free Software Foundation.
10678 + * This library is distributed in the hope that it will be useful,
10679 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
10680 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10681 + * Lesser General Public License for more details.
10683 + * You should have received a copy of the GNU Lesser General Public
10684 + * License along with this library; if not, write to the Free Software
10685 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
10686 + * MA 02111-1307 USA
10689 + * Sun Industry Standards Source License Version 1.1
10690 + * =================================================
10691 + * The contents of this file are subject to the Sun Industry Standards
10692 + * Source License Version 1.1 (the "License"); You may not use this file
10693 + * except in compliance with the License. You may obtain a copy of the
10694 + * License at http://www.openoffice.org/license.html.
10696 + * Software provided under this License is provided on an "AS IS" basis,
10697 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
10698 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
10699 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
10700 + * See the License for the specific provisions governing your rights and
10701 + * obligations concerning the Software.
10703 + * The Initial Developer of the Original Code is: IBM Corporation
10705 + * Copyright: 2008 by IBM Corporation
10707 + * All Rights Reserved.
10709 + * Contributor(s): _______________________________________
10712 + ************************************************************************/
10713 +/*************************************************************************
10714 + * @file
10715 + * Polygon object.
10716 + ************************************************************************/
10717 +/*************************************************************************
10718 + * Change History
10719 + * 2004-2-18 create this file.
10720 + ************************************************************************/
10721 +#ifndef _XFPOLYGON_HXX
10722 +#define _XFPOLYGON_HXX
10724 +#include "xfdrawpolyline.hxx"
10725 +#include <vector>
10727 +/**
10728 + * @brief
10729 + * Polygon object.
10730 + */
10731 +class XFDrawPolygon : public XFDrawPolyline
10733 +public:
10734 + XFDrawPolygon();
10736 +public:
10737 + virtual void ToXml(IXFStream *pStrm);
10740 +#endif
10741 \ No newline at end of file
10742 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawpolyline.cxx lotuswordpro/source/filter/xfilter/xfdrawpolyline.cxx
10743 --- lotuswordpro.bak/source/filter/xfilter/xfdrawpolyline.cxx 1970-01-01 08:00:00.000000000 +0800
10744 +++ lotuswordpro/source/filter/xfilter/xfdrawpolyline.cxx 2008-10-22 12:05:47.000000000 +0800
10745 @@ -0,0 +1,133 @@
10746 +/*************************************************************************
10748 + * The Contents of this file are made available subject to the terms of
10749 + * either of the following licenses
10751 + * - GNU Lesser General Public License Version 2.1
10752 + * - Sun Industry Standards Source License Version 1.1
10754 + * Sun Microsystems Inc., October, 2000
10756 + * GNU Lesser General Public License Version 2.1
10757 + * =============================================
10758 + * Copyright 2000 by Sun Microsystems, Inc.
10759 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
10761 + * This library is free software; you can redistribute it and/or
10762 + * modify it under the terms of the GNU Lesser General Public
10763 + * License version 2.1, as published by the Free Software Foundation.
10765 + * This library is distributed in the hope that it will be useful,
10766 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
10767 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10768 + * Lesser General Public License for more details.
10770 + * You should have received a copy of the GNU Lesser General Public
10771 + * License along with this library; if not, write to the Free Software
10772 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
10773 + * MA 02111-1307 USA
10776 + * Sun Industry Standards Source License Version 1.1
10777 + * =================================================
10778 + * The contents of this file are subject to the Sun Industry Standards
10779 + * Source License Version 1.1 (the "License"); You may not use this file
10780 + * except in compliance with the License. You may obtain a copy of the
10781 + * License at http://www.openoffice.org/license.html.
10783 + * Software provided under this License is provided on an "AS IS" basis,
10784 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
10785 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
10786 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
10787 + * See the License for the specific provisions governing your rights and
10788 + * obligations concerning the Software.
10790 + * The Initial Developer of the Original Code is: IBM Corporation
10792 + * Copyright: 2008 by IBM Corporation
10794 + * All Rights Reserved.
10796 + * Contributor(s): _______________________________________
10799 + ************************************************************************/
10800 +/*************************************************************************
10801 + * @file
10802 + * Polyline.
10803 + ************************************************************************/
10804 +/*************************************************************************
10805 + * Change History
10806 + * 2004-2-18 create this file.
10807 + ************************************************************************/
10808 +#include "xfdrawpolyline.hxx"
10810 +XFDrawPolyline::XFDrawPolyline()
10814 +void XFDrawPolyline::ToXml(IXFStream *pStrm)
10816 + IXFAttrList *pAttrList = pStrm->GetAttrList();
10817 + std::vector<XFPoint>::iterator it;
10819 + pAttrList->Clear();
10820 + //view-box:
10821 + XFRect rect = CalcViewBox();
10822 + rtl::OUString strViewBox = A2OUSTR("0 0 ");
10823 + strViewBox += DoubleToOUString(rect.GetWidth()*1000) + A2OUSTR(" ");
10824 + strViewBox += DoubleToOUString(rect.GetHeight()*1000);
10825 + pAttrList->AddAttribute( A2OUSTR("svg:viewBox"), strViewBox);
10827 + //points
10828 + rtl::OUString strPoints;
10829 + for( it = m_aPoints.begin(); it != m_aPoints.end(); it++ )
10831 + XFPoint pt = *it;
10832 + double x = (pt.GetX()-rect.GetX())*1000;
10833 + double y = (pt.GetY()-rect.GetY())*1000;
10834 + strPoints += DoubleToOUString(x) + A2OUSTR(",") + DoubleToOUString(y) + A2OUSTR(" ");
10835 + }
10836 + strPoints = strPoints.trim();
10837 + pAttrList->AddAttribute( A2OUSTR("draw:points"), strPoints);
10839 + //
10840 + SetPosition(rect.GetX(),rect.GetY(),rect.GetWidth(),rect.GetHeight());
10841 + XFDrawObject::ToXml(pStrm);
10843 + pStrm->StartElement( A2OUSTR("draw:polyline") );
10844 + ContentToXml(pStrm);
10845 + pStrm->EndElement( A2OUSTR("draw:polyline") );
10848 +XFRect XFDrawPolyline::CalcViewBox()
10850 + double x1 = 0;
10851 + double y1 = 0;
10852 + double x2 = 0;
10853 + double y2 = 0;
10854 + XFPoint aPoint;
10855 + std::vector<XFPoint>::iterator it = m_aPoints.begin();
10857 + assert(m_aPoints.size()>0);
10859 + aPoint = *it;
10860 + x1 = aPoint.GetX();
10861 + x2 = aPoint.GetX();
10862 + y1 = aPoint.GetY();
10863 + y2 = aPoint.GetY();
10864 + for( ; it != m_aPoints.end(); it++ )
10866 + aPoint = *it;
10867 + if( x1>aPoint.GetX() )
10868 + x1 = aPoint.GetX();
10869 + if( x2<aPoint.GetX() )
10870 + x2 = aPoint.GetX();
10872 + if( y1>aPoint.GetY() )
10873 + y1 = aPoint.GetY();
10874 + if( y2<aPoint.GetY() )
10875 + y2 = aPoint.GetY();
10876 + }
10877 + return XFRect(x1,y1,x2-x1,y2-y1);
10879 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawpolyline.hxx lotuswordpro/source/filter/xfilter/xfdrawpolyline.hxx
10880 --- lotuswordpro.bak/source/filter/xfilter/xfdrawpolyline.hxx 1970-01-01 08:00:00.000000000 +0800
10881 +++ lotuswordpro/source/filter/xfilter/xfdrawpolyline.hxx 2008-10-22 11:42:34.000000000 +0800
10882 @@ -0,0 +1,99 @@
10883 +/*************************************************************************
10885 + * The Contents of this file are made available subject to the terms of
10886 + * either of the following licenses
10888 + * - GNU Lesser General Public License Version 2.1
10889 + * - Sun Industry Standards Source License Version 1.1
10891 + * Sun Microsystems Inc., October, 2000
10893 + * GNU Lesser General Public License Version 2.1
10894 + * =============================================
10895 + * Copyright 2000 by Sun Microsystems, Inc.
10896 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
10898 + * This library is free software; you can redistribute it and/or
10899 + * modify it under the terms of the GNU Lesser General Public
10900 + * License version 2.1, as published by the Free Software Foundation.
10902 + * This library is distributed in the hope that it will be useful,
10903 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
10904 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10905 + * Lesser General Public License for more details.
10907 + * You should have received a copy of the GNU Lesser General Public
10908 + * License along with this library; if not, write to the Free Software
10909 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
10910 + * MA 02111-1307 USA
10913 + * Sun Industry Standards Source License Version 1.1
10914 + * =================================================
10915 + * The contents of this file are subject to the Sun Industry Standards
10916 + * Source License Version 1.1 (the "License"); You may not use this file
10917 + * except in compliance with the License. You may obtain a copy of the
10918 + * License at http://www.openoffice.org/license.html.
10920 + * Software provided under this License is provided on an "AS IS" basis,
10921 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
10922 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
10923 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
10924 + * See the License for the specific provisions governing your rights and
10925 + * obligations concerning the Software.
10927 + * The Initial Developer of the Original Code is: IBM Corporation
10929 + * Copyright: 2008 by IBM Corporation
10931 + * All Rights Reserved.
10933 + * Contributor(s): _______________________________________
10936 + ************************************************************************/
10937 +/*************************************************************************
10938 + * @file
10939 + * Polyline.
10940 + ************************************************************************/
10941 +/*************************************************************************
10942 + * Change History
10943 + * 2004-2-18 create this file.
10944 + ************************************************************************/
10945 +#ifndef _XFPOLYLINE_HXX
10946 +#define _XFPOLYLINE_HXX
10948 +#include "xfdrawobj.hxx"
10949 +#include <vector>
10951 +class XFDrawPolyline : public XFDrawObject
10953 +public:
10954 + XFDrawPolyline();
10956 +public:
10957 + void AddPoint(double x, double y);
10959 + void AddPoint(XFPoint pt);
10961 + XFRect CalcViewBox();
10963 + virtual void ToXml(IXFStream *pStrm);
10965 +protected:
10966 + std::vector<XFPoint> m_aPoints;
10969 +inline void XFDrawPolyline::AddPoint(double x, double y)
10971 + assert(x>=0&&y>=0);
10972 + m_aPoints.push_back( XFPoint(x,y) );
10975 +inline void XFDrawPolyline::AddPoint(XFPoint pt)
10977 + assert(pt.GetX()>=0&&pt.GetY()>=0);
10978 + m_aPoints.push_back(pt);
10981 +#endif
10982 \ No newline at end of file
10983 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawrect.cxx lotuswordpro/source/filter/xfilter/xfdrawrect.cxx
10984 --- lotuswordpro.bak/source/filter/xfilter/xfdrawrect.cxx 1970-01-01 08:00:00.000000000 +0800
10985 +++ lotuswordpro/source/filter/xfilter/xfdrawrect.cxx 2008-10-22 11:42:34.000000000 +0800
10986 @@ -0,0 +1,83 @@
10987 +/*************************************************************************
10989 + * The Contents of this file are made available subject to the terms of
10990 + * either of the following licenses
10992 + * - GNU Lesser General Public License Version 2.1
10993 + * - Sun Industry Standards Source License Version 1.1
10995 + * Sun Microsystems Inc., October, 2000
10997 + * GNU Lesser General Public License Version 2.1
10998 + * =============================================
10999 + * Copyright 2000 by Sun Microsystems, Inc.
11000 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
11002 + * This library is free software; you can redistribute it and/or
11003 + * modify it under the terms of the GNU Lesser General Public
11004 + * License version 2.1, as published by the Free Software Foundation.
11006 + * This library is distributed in the hope that it will be useful,
11007 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
11008 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11009 + * Lesser General Public License for more details.
11011 + * You should have received a copy of the GNU Lesser General Public
11012 + * License along with this library; if not, write to the Free Software
11013 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
11014 + * MA 02111-1307 USA
11017 + * Sun Industry Standards Source License Version 1.1
11018 + * =================================================
11019 + * The contents of this file are subject to the Sun Industry Standards
11020 + * Source License Version 1.1 (the "License"); You may not use this file
11021 + * except in compliance with the License. You may obtain a copy of the
11022 + * License at http://www.openoffice.org/license.html.
11024 + * Software provided under this License is provided on an "AS IS" basis,
11025 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
11026 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
11027 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
11028 + * See the License for the specific provisions governing your rights and
11029 + * obligations concerning the Software.
11031 + * The Initial Developer of the Original Code is: IBM Corporation
11033 + * Copyright: 2008 by IBM Corporation
11035 + * All Rights Reserved.
11037 + * Contributor(s): _______________________________________
11040 + ************************************************************************/
11041 +/*************************************************************************
11042 + * @file
11043 + * Rect object.
11044 + ************************************************************************/
11045 +/*************************************************************************
11046 + * Change History
11047 + * 2004-2-17 create this file.
11048 + ************************************************************************/
11049 +#include "xfdrawrect.hxx"
11051 +XFDrawRect::XFDrawRect()
11053 + m_fCornerRadius = 0;
11056 +void XFDrawRect::ToXml(IXFStream *pStrm)
11058 + IXFAttrList *pAttrList = pStrm->GetAttrList();
11060 + pAttrList->Clear();
11062 + if( 0 != m_fCornerRadius )
11063 + pAttrList->AddAttribute( A2OUSTR("draw:corner-radius"), DoubleToOUString(m_fCornerRadius) + A2OUSTR("cm") );
11064 + XFDrawObject::ToXml(pStrm);
11066 + pStrm->StartElement( A2OUSTR("draw:rect") );
11067 + ContentToXml(pStrm);
11068 + pStrm->EndElement( A2OUSTR("draw:rect") );
11070 \ No newline at end of file
11071 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawrect.hxx lotuswordpro/source/filter/xfilter/xfdrawrect.hxx
11072 --- lotuswordpro.bak/source/filter/xfilter/xfdrawrect.hxx 1970-01-01 08:00:00.000000000 +0800
11073 +++ lotuswordpro/source/filter/xfilter/xfdrawrect.hxx 2008-10-22 11:42:34.000000000 +0800
11074 @@ -0,0 +1,116 @@
11075 +/*************************************************************************
11077 + * The Contents of this file are made available subject to the terms of
11078 + * either of the following licenses
11080 + * - GNU Lesser General Public License Version 2.1
11081 + * - Sun Industry Standards Source License Version 1.1
11083 + * Sun Microsystems Inc., October, 2000
11085 + * GNU Lesser General Public License Version 2.1
11086 + * =============================================
11087 + * Copyright 2000 by Sun Microsystems, Inc.
11088 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
11090 + * This library is free software; you can redistribute it and/or
11091 + * modify it under the terms of the GNU Lesser General Public
11092 + * License version 2.1, as published by the Free Software Foundation.
11094 + * This library is distributed in the hope that it will be useful,
11095 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
11096 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11097 + * Lesser General Public License for more details.
11099 + * You should have received a copy of the GNU Lesser General Public
11100 + * License along with this library; if not, write to the Free Software
11101 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
11102 + * MA 02111-1307 USA
11105 + * Sun Industry Standards Source License Version 1.1
11106 + * =================================================
11107 + * The contents of this file are subject to the Sun Industry Standards
11108 + * Source License Version 1.1 (the "License"); You may not use this file
11109 + * except in compliance with the License. You may obtain a copy of the
11110 + * License at http://www.openoffice.org/license.html.
11112 + * Software provided under this License is provided on an "AS IS" basis,
11113 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
11114 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
11115 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
11116 + * See the License for the specific provisions governing your rights and
11117 + * obligations concerning the Software.
11119 + * The Initial Developer of the Original Code is: IBM Corporation
11121 + * Copyright: 2008 by IBM Corporation
11123 + * All Rights Reserved.
11125 + * Contributor(s): _______________________________________
11128 + ************************************************************************/
11129 +/*************************************************************************
11130 + * @file
11131 + * Rect object.
11132 + ************************************************************************/
11133 +/*************************************************************************
11134 + * Change History
11135 + * 2004-2-17 create this file.
11136 + ************************************************************************/
11137 +#ifndef _XFDRAWRECT_HXX
11138 +#define _XFDRAWRECT_HXX
11140 +#include "xfdrawobj.hxx"
11142 +class XFDrawRect : public XFDrawObject
11144 +public:
11145 + XFDrawRect();
11147 +public:
11148 + void SetStartPoint(XFPoint pt);
11150 + void SetSize(double width, double height);
11152 + void SetWidth(double width);
11154 + void SetHeight(double height);
11156 + void SetCornerRadius(double fCornerRadius);
11158 + virtual void ToXml(IXFStream *pStrm);
11160 +private:
11161 + double m_fCornerRadius;
11164 +inline void XFDrawRect::SetStartPoint(XFPoint pt)
11166 + m_aRect.SetStartPoint(pt);
11169 +inline void XFDrawRect::SetSize(double width, double height)
11171 + m_aRect.SetSize(width,height);
11174 +inline void XFDrawRect::SetWidth(double width)
11176 + m_aRect.SetWidth(width);
11179 +inline void XFDrawRect::SetHeight(double height)
11181 + m_aRect.SetHeight(height);
11184 +inline void XFDrawRect::SetCornerRadius(double fCornerRadius)
11186 + m_fCornerRadius = fCornerRadius;
11189 +#endif
11191 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawstyle.cxx lotuswordpro/source/filter/xfilter/xfdrawstyle.cxx
11192 --- lotuswordpro.bak/source/filter/xfilter/xfdrawstyle.cxx 1970-01-01 08:00:00.000000000 +0800
11193 +++ lotuswordpro/source/filter/xfilter/xfdrawstyle.cxx 2008-10-22 11:42:34.000000000 +0800
11194 @@ -0,0 +1,349 @@
11195 +/*************************************************************************
11197 + * The Contents of this file are made available subject to the terms of
11198 + * either of the following licenses
11200 + * - GNU Lesser General Public License Version 2.1
11201 + * - Sun Industry Standards Source License Version 1.1
11203 + * Sun Microsystems Inc., October, 2000
11205 + * GNU Lesser General Public License Version 2.1
11206 + * =============================================
11207 + * Copyright 2000 by Sun Microsystems, Inc.
11208 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
11210 + * This library is free software; you can redistribute it and/or
11211 + * modify it under the terms of the GNU Lesser General Public
11212 + * License version 2.1, as published by the Free Software Foundation.
11214 + * This library is distributed in the hope that it will be useful,
11215 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
11216 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11217 + * Lesser General Public License for more details.
11219 + * You should have received a copy of the GNU Lesser General Public
11220 + * License along with this library; if not, write to the Free Software
11221 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
11222 + * MA 02111-1307 USA
11225 + * Sun Industry Standards Source License Version 1.1
11226 + * =================================================
11227 + * The contents of this file are subject to the Sun Industry Standards
11228 + * Source License Version 1.1 (the "License"); You may not use this file
11229 + * except in compliance with the License. You may obtain a copy of the
11230 + * License at http://www.openoffice.org/license.html.
11232 + * Software provided under this License is provided on an "AS IS" basis,
11233 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
11234 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
11235 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
11236 + * See the License for the specific provisions governing your rights and
11237 + * obligations concerning the Software.
11239 + * The Initial Developer of the Original Code is: IBM Corporation
11241 + * Copyright: 2008 by IBM Corporation
11243 + * All Rights Reserved.
11245 + * Contributor(s): _______________________________________
11248 + ************************************************************************/
11249 +/*************************************************************************
11250 + * @file
11251 + * Style for all draw object.
11252 + ************************************************************************/
11253 +/*************************************************************************
11254 + * Change History
11255 + * 2004-2-21 create this file.
11256 + ************************************************************************/
11257 +#include "xfdrawstyle.hxx"
11258 +#include "xfdrawlinestyle.hxx"
11259 +#include "xfdrawareastyle.hxx"
11260 +#include "xfstylemanager.hxx"
11261 +#include "xffontworkstyle.hxx"
11262 +#include "../lwpglobalmgr.hxx"
11263 +XFDrawStyle::XFDrawStyle()
11265 + m_eWrap = enumXFWrapNone;
11266 + m_nWrapLines = 0; //not limited.
11268 + m_pLineStyle = NULL;
11269 + m_pAreaStyle = NULL;
11271 + m_pFontWorkStyle = NULL;
11273 + m_fArrowStartSize = 0.3;
11274 + m_fArrowEndSize = 0.3;
11275 + m_bArrowStartCenter = sal_False;
11276 + m_bArrowStartCenter = sal_False;
11279 +XFDrawStyle::~XFDrawStyle()
11281 + //don't delete m_pLineStyle, it was managed by XFStyleManager.
11282 + if (m_pFontWorkStyle)
11284 + delete m_pFontWorkStyle;
11285 + m_pFontWorkStyle = NULL;
11289 +void XFDrawStyle::SetLineStyle(double width, XFColor color, sal_Int32 transparency)
11291 + if( !m_pLineStyle )
11293 + m_pLineStyle = new XFDrawLineStyle();
11294 + m_pLineStyle->SetStyleName( XFGlobal::GenStrokeDashName());
11296 + m_pLineStyle->SetWidth(width);
11297 + m_pLineStyle->SetColor(color);
11298 + m_pLineStyle->SetTransparency(transparency);
11301 +void XFDrawStyle::SetLineDashStyle(enumXFLineStyle style, int num1, int num2, double len1, double len2, double space )
11303 + if( !m_pLineStyle )
11305 + m_pLineStyle = new XFDrawLineStyle();
11306 + m_pLineStyle->SetStyleName( XFGlobal::GenStrokeDashName());
11308 + m_pLineStyle->SetLineStyle(style);
11309 + m_pLineStyle->SetDot1Number(num1);
11310 + m_pLineStyle->SetDot1Length(len1);
11311 + m_pLineStyle->SetDot2Number(num2);
11312 + m_pLineStyle->SetDot2Length(len2);
11313 + m_pLineStyle->SetSpace(space);
11314 + XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
11315 + pXFStyleManager->AddStyle(m_pLineStyle);
11318 +void XFDrawStyle::SetFontWorkStyle(sal_Int8 nForm, enumXFFWStyle eStyle, enumXFFWAdjust eAdjust)
11320 + if (!m_pFontWorkStyle)
11322 + m_pFontWorkStyle = new XFFontWorkStyle();
11325 + m_pFontWorkStyle->SetButtonForm(nForm);
11326 + m_pFontWorkStyle->SetFWStyleType(eStyle);
11327 + m_pFontWorkStyle->SetFWAdjustType(eAdjust);
11330 +void XFDrawStyle::SetAreaColor(XFColor& color)
11332 + if( !m_pAreaStyle )
11334 + m_pAreaStyle = new XFDrawAreaStyle();
11335 + m_pAreaStyle->SetStyleName( XFGlobal::GenAreaName());
11337 + m_pAreaStyle->SetBackColor(color);
11340 +void XFDrawStyle::SetAreaLineStyle(enumXFAreaLineStyle style, sal_Int32 angle, double space, XFColor lineColor)
11342 + if( !m_pAreaStyle )
11344 + m_pAreaStyle = new XFDrawAreaStyle();
11345 + m_pAreaStyle->SetStyleName( XFGlobal::GenAreaName());
11347 + m_pAreaStyle->SetAreaStyle(enumXFAreaHatch);
11349 + m_pAreaStyle->SetLineStyle(style);
11350 + m_pAreaStyle->SetLineAngle(angle);
11351 + m_pAreaStyle->SetLineSpace(space);
11352 + m_pAreaStyle->SetLineColor(lineColor);
11353 + XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
11354 + pXFStyleManager->AddStyle(m_pAreaStyle);
11357 +enumXFStyle XFDrawStyle::GetStyleFamily()
11359 + return enumXFStyleGraphics;
11362 +/**************************************************************************
11363 + *************************************************************************/
11364 +void XFDrawStyle::ToXml(IXFStream *pStrm)
11366 + IXFAttrList *pAttrList = pStrm->GetAttrList();
11368 + pAttrList->Clear();
11370 + pAttrList->AddAttribute( A2OUSTR("style:name"), GetStyleName() );
11371 + pAttrList->AddAttribute( A2OUSTR("style:family"), A2OUSTR("graphics") );
11372 + pStrm->StartElement( A2OUSTR("style:style") );
11374 + pAttrList->Clear();
11376 + if( m_eWrap == enumXFWrapBackground )
11378 + pAttrList->AddAttribute( A2OUSTR("style:run-through"), A2OUSTR("background") );
11380 + else
11382 + pAttrList->AddAttribute( A2OUSTR("style:run-through"), A2OUSTR("foreground") );
11384 + if( m_eWrap == enumXFWrapNone )
11385 + pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("none") );
11386 + else if( m_eWrap == enumXFWrapLeft )
11387 + pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("left") );
11388 + else if( m_eWrap == enumXFWrapRight )
11389 + pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("right") );
11390 + else if( m_eWrap == enumXFWrapParallel )
11391 + pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("parallel") );
11392 + else if( m_eWrap == enumXFWrapRunThrough )
11393 + pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("run-through") );
11394 + else if( m_eWrap == enumXFWrapBest )
11395 + pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("dynamic") );
11398 + //line style:
11399 + if( m_pLineStyle )
11401 + //1. if is a dash style, register the stroke-dash style first.
11402 + if( !m_pLineStyle->IsSolid() )
11403 + {
11404 +// pAttrList->Clear();
11405 + pAttrList->AddAttribute( A2OUSTR("draw:stroke"), A2OUSTR("dash") );
11406 + pAttrList->AddAttribute( A2OUSTR("draw:stroke-dash"), m_pLineStyle->GetStyleName() );
11408 + else
11410 + pAttrList->AddAttribute( A2OUSTR("draw:stroke"), A2OUSTR("solid") );
11413 + if( m_pLineStyle->GetWidth() > 0 )
11414 + pAttrList->AddAttribute( A2OUSTR("svg:stroke-width"), DoubleToOUString(m_pLineStyle->GetWidth()) + A2OUSTR("cm") );
11416 + XFColor color = m_pLineStyle->GetColor();
11417 + if( color.IsValid() )
11418 + pAttrList->AddAttribute( A2OUSTR("svg:stroke-color"), color.ToString() );
11420 + if( m_pLineStyle->GetTransparency()>0 )
11421 + pAttrList->AddAttribute( A2OUSTR("svg:stroke-opacity"), Int32ToOUString(m_pLineStyle->GetTransparency()) + A2OUSTR("%") );
11423 + else
11424 + pAttrList->AddAttribute( A2OUSTR("draw:stroke"), A2OUSTR("none") );
11425 + //area style:
11426 + if( m_pAreaStyle )
11428 + if( enumXFAreaSolid == m_pAreaStyle->GetAreaStyle() )
11430 + pAttrList->AddAttribute( A2OUSTR("draw:fill"), A2OUSTR("solid") );
11431 + XFColor color = m_pAreaStyle->GetBackColor();
11432 + if( color.IsValid() )
11433 + pAttrList->AddAttribute( A2OUSTR("draw:fill-color"), color.ToString() );
11435 + else if( enumXFAreaHatch == m_pAreaStyle->GetAreaStyle() )
11437 + pAttrList->AddAttribute( A2OUSTR("draw:fill"), A2OUSTR("hatch") );
11438 + pAttrList->AddAttribute( A2OUSTR("draw:fill-hatch-name"), m_pAreaStyle->GetStyleName() );
11439 + XFColor color = m_pAreaStyle->GetBackColor();
11440 + if( color.IsValid() )
11442 + pAttrList->AddAttribute( A2OUSTR("draw:fill-hatch-solid"), A2OUSTR("true") );
11443 + pAttrList->AddAttribute( A2OUSTR("draw:fill-color"), color.ToString() );
11445 + }
11446 + }
11447 + else
11448 + pAttrList->AddAttribute( A2OUSTR("draw:fill"), A2OUSTR("none") );
11450 + if( m_strArrowStart.getLength()>0 )
11452 + pAttrList->AddAttribute( A2OUSTR("draw:marker-start"), m_strArrowStart );
11453 + pAttrList->AddAttribute( A2OUSTR("draw:marker-start-width"), DoubleToOUString(m_fArrowStartSize)+A2OUSTR("cm") );
11454 + if( m_bArrowStartCenter )
11455 + pAttrList->AddAttribute( A2OUSTR("draw:draw:marker-start-center"), A2OUSTR("true") );
11457 + if( m_strArrowEnd.getLength()>0 )
11459 + pAttrList->AddAttribute( A2OUSTR("draw:marker-end"), m_strArrowEnd );
11460 + pAttrList->AddAttribute( A2OUSTR("draw:marker-end-width"), DoubleToOUString(m_fArrowEndSize)+A2OUSTR("cm") );
11461 + if( m_bArrowEndCenter )
11462 + pAttrList->AddAttribute( A2OUSTR("draw:draw:marker-end-center"), A2OUSTR("true") );
11464 + if (m_pFontWorkStyle)
11466 + // style
11467 + rtl::OUString aStr = A2OUSTR("");
11468 + switch (m_pFontWorkStyle->GetStyleType())
11470 + default: // fall through!
11471 + case enumXFFWOff:
11472 + break;
11473 + case enumXFFWRotate:
11474 + aStr = A2OUSTR("rotate");
11475 + break;
11476 + case enumXFFWUpright:
11477 + aStr = A2OUSTR("upright");
11478 + break;
11479 + case enumXFFWSlantX:
11480 + aStr = A2OUSTR("slant-x");
11481 + break;
11482 + case enumXFFWSlantY:
11483 + aStr = A2OUSTR("slant-y");
11484 + break;
11486 + if (aStr.getLength() > 0)
11488 + pAttrList->AddAttribute(A2OUSTR("draw:fontwork-style"), aStr);
11491 + //adjust
11492 + aStr = A2OUSTR("");
11493 + switch (m_pFontWorkStyle->GetAdjustType())
11495 + default: // fall througth
11496 + case enumXFFWAdjustAutosize:
11497 + aStr = A2OUSTR("autosize");
11498 + break;
11499 + case enumXFFWAdjustLeft:
11500 + aStr = A2OUSTR("left");
11501 + break;
11502 + case enumXFFWAdjustCenter:
11503 + aStr = A2OUSTR("center");
11504 + break;
11505 + case enumXFFWAdustRight:
11506 + aStr = A2OUSTR("right");
11507 + break;
11509 + if (aStr.getLength() > 0)
11511 + pAttrList->AddAttribute(A2OUSTR("draw:fontwork-adjust"), aStr);
11514 + //form
11515 + aStr = A2OUSTR("");
11516 + switch (m_pFontWorkStyle->GetButtonForm())
11518 + default: // fall through!
11519 + case -1:
11520 + break;
11521 + case 4:
11522 + aStr = A2OUSTR("top-arc");
11523 + break;
11524 + case 5:
11525 + aStr = A2OUSTR("bottom-arc");
11526 + break;
11528 + if (aStr.getLength() > 0)
11530 + pAttrList->AddAttribute(A2OUSTR("draw:fontwork-form"), aStr);
11533 + // distance
11534 + //pAttrList->AddAttribute(A2OUSTR("draw:fontwork-distance"),
11535 + // DoubleToOUString(m_pFontWorkStyle->GetFWDistance())+A2OUSTR("cm"));
11538 + pStrm->StartElement( A2OUSTR("style:properties") );
11540 + pStrm->EndElement( A2OUSTR("style:properties") );
11542 + pStrm->EndElement( A2OUSTR("style:style") );
11544 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawstyle.hxx lotuswordpro/source/filter/xfilter/xfdrawstyle.hxx
11545 --- lotuswordpro.bak/source/filter/xfilter/xfdrawstyle.hxx 1970-01-01 08:00:00.000000000 +0800
11546 +++ lotuswordpro/source/filter/xfilter/xfdrawstyle.hxx 2008-10-22 11:42:34.000000000 +0800
11547 @@ -0,0 +1,167 @@
11548 +/*************************************************************************
11550 + * The Contents of this file are made available subject to the terms of
11551 + * either of the following licenses
11553 + * - GNU Lesser General Public License Version 2.1
11554 + * - Sun Industry Standards Source License Version 1.1
11556 + * Sun Microsystems Inc., October, 2000
11558 + * GNU Lesser General Public License Version 2.1
11559 + * =============================================
11560 + * Copyright 2000 by Sun Microsystems, Inc.
11561 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
11563 + * This library is free software; you can redistribute it and/or
11564 + * modify it under the terms of the GNU Lesser General Public
11565 + * License version 2.1, as published by the Free Software Foundation.
11567 + * This library is distributed in the hope that it will be useful,
11568 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
11569 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11570 + * Lesser General Public License for more details.
11572 + * You should have received a copy of the GNU Lesser General Public
11573 + * License along with this library; if not, write to the Free Software
11574 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
11575 + * MA 02111-1307 USA
11578 + * Sun Industry Standards Source License Version 1.1
11579 + * =================================================
11580 + * The contents of this file are subject to the Sun Industry Standards
11581 + * Source License Version 1.1 (the "License"); You may not use this file
11582 + * except in compliance with the License. You may obtain a copy of the
11583 + * License at http://www.openoffice.org/license.html.
11585 + * Software provided under this License is provided on an "AS IS" basis,
11586 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
11587 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
11588 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
11589 + * See the License for the specific provisions governing your rights and
11590 + * obligations concerning the Software.
11592 + * The Initial Developer of the Original Code is: IBM Corporation
11594 + * Copyright: 2008 by IBM Corporation
11596 + * All Rights Reserved.
11598 + * Contributor(s): _______________________________________
11601 + ************************************************************************/
11602 +/*************************************************************************
11603 + * @file
11604 + * Style for all draw object.
11605 + ************************************************************************/
11606 +/*************************************************************************
11607 + * Change History
11608 + * 2004-2-21 create this file.
11609 + ************************************************************************/
11610 +#ifndef _XFDRAWSTYLE_HXX
11611 +#define _XFDRAWSTYLE_HXX
11613 +#include "xfstyle.hxx"
11614 +#include "xfcolor.hxx"
11615 +#include <cassert>
11617 +class XFDrawLineStyle;
11618 +class XFDrawAreaStyle;
11619 +class XFFontWorkStyle;
11621 +/**
11622 + * @brief
11623 + * Style for all drawing object, which can includes line style, area style, wrap style.
11624 + * Line style includes line type, line width and line color.
11625 + * Area style can be divided into 5 kinds, color fill, hatch, bitmap, gradient.I only support
11626 + * color fill and hatch now.
11627 + */
11628 +class XFDrawStyle : public XFStyle
11630 +public:
11631 + XFDrawStyle();
11633 + virtual ~XFDrawStyle();
11635 +public:
11636 + /**
11637 + * @descr Set drawing wrap type.
11638 + */
11639 + void SetWrapType(enumXFWrap wrap, sal_Int32 nParagraphs = 0);
11641 + /**
11642 + * @descr Set drawing object border line.
11643 + */
11644 + void SetLineStyle(double width, XFColor color = XFColor(0,0,0), sal_Int32 transparency = 0);
11646 + /**
11647 + * @descr Set drawing obejct dash border style.
11648 + */
11649 + void SetLineDashStyle(enumXFLineStyle style, int num1, int num2, double len1, double len2, double space );
11651 + /**
11652 + * @descr Set drawing object area fill color.
11653 + */
11654 + void SetAreaColor(XFColor& color);
11656 + /**
11657 + * @descr Set drawing obejct area grid style.
11658 + */
11659 + void SetAreaLineStyle(enumXFAreaLineStyle style, sal_Int32 angle = 0, double space = 0.102, XFColor lineColor = XFColor(0,0,0));
11661 + /**
11662 + * @descr Set drawing object arrow start style,only lines can have arrows.
11663 + */
11664 + void SetArrowStart(rtl::OUString start, double size=0.3, sal_Bool center = sal_False);
11666 + /**
11667 + * @descr Set drawing obejct arrow end style,only lines can have arrows.
11668 + */
11669 + void SetArrowEnd(rtl::OUString end, double size=0.3, sal_Bool center = sal_False);
11671 + void SetFontWorkStyle(sal_Int8 nForm, enumXFFWStyle eStyle, enumXFFWAdjust eAdjust);
11673 + virtual enumXFStyle GetStyleFamily();
11675 + virtual void ToXml(IXFStream *pStrm);
11677 +private:
11678 + XFFontWorkStyle* m_pFontWorkStyle;
11679 + enumXFWrap m_eWrap;
11680 + sal_Int32 m_nWrapLines;
11681 + XFDrawLineStyle *m_pLineStyle;
11682 + XFDrawAreaStyle *m_pAreaStyle;
11683 + rtl::OUString m_strArrowStart;
11684 + rtl::OUString m_strArrowEnd;
11685 + double m_fArrowStartSize;
11686 + double m_fArrowEndSize;
11687 + sal_Bool m_bArrowStartCenter;
11688 + sal_Bool m_bArrowEndCenter;
11691 +inline void XFDrawStyle::SetWrapType(enumXFWrap wrap, sal_Int32 nParagraphs)
11693 + m_eWrap = wrap;
11694 + m_nWrapLines = nParagraphs;
11698 +inline void XFDrawStyle::SetArrowStart(rtl::OUString start, double size, sal_Bool center)
11700 + assert(size>0);
11701 + m_strArrowStart = start;
11702 + m_fArrowStartSize = size;
11703 + m_bArrowStartCenter = center;
11706 +inline void XFDrawStyle::SetArrowEnd(rtl::OUString end, double size, sal_Bool center)
11708 + assert(size>0);
11709 + m_strArrowEnd = end;
11710 + m_fArrowEndSize = size;
11711 + m_bArrowEndCenter = center;
11714 +#endif
11715 \ No newline at end of file
11716 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdropcap.hxx lotuswordpro/source/filter/xfilter/xfdropcap.hxx
11717 --- lotuswordpro.bak/source/filter/xfilter/xfdropcap.hxx 1970-01-01 08:00:00.000000000 +0800
11718 +++ lotuswordpro/source/filter/xfilter/xfdropcap.hxx 2008-10-22 11:42:34.000000000 +0800
11719 @@ -0,0 +1,152 @@
11720 +/*************************************************************************
11722 + * The Contents of this file are made available subject to the terms of
11723 + * either of the following licenses
11725 + * - GNU Lesser General Public License Version 2.1
11726 + * - Sun Industry Standards Source License Version 1.1
11728 + * Sun Microsystems Inc., October, 2000
11730 + * GNU Lesser General Public License Version 2.1
11731 + * =============================================
11732 + * Copyright 2000 by Sun Microsystems, Inc.
11733 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
11735 + * This library is free software; you can redistribute it and/or
11736 + * modify it under the terms of the GNU Lesser General Public
11737 + * License version 2.1, as published by the Free Software Foundation.
11739 + * This library is distributed in the hope that it will be useful,
11740 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
11741 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11742 + * Lesser General Public License for more details.
11744 + * You should have received a copy of the GNU Lesser General Public
11745 + * License along with this library; if not, write to the Free Software
11746 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
11747 + * MA 02111-1307 USA
11750 + * Sun Industry Standards Source License Version 1.1
11751 + * =================================================
11752 + * The contents of this file are subject to the Sun Industry Standards
11753 + * Source License Version 1.1 (the "License"); You may not use this file
11754 + * except in compliance with the License. You may obtain a copy of the
11755 + * License at http://www.openoffice.org/license.html.
11757 + * Software provided under this License is provided on an "AS IS" basis,
11758 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
11759 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
11760 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
11761 + * See the License for the specific provisions governing your rights and
11762 + * obligations concerning the Software.
11764 + * The Initial Developer of the Original Code is: IBM Corporation
11766 + * Copyright: 2008 by IBM Corporation
11768 + * All Rights Reserved.
11770 + * Contributor(s): _______________________________________
11773 + ************************************************************************/
11774 +/*************************************************************************
11775 + * @file
11776 + * Drop cap of a paragraph.
11777 + ************************************************************************/
11778 +/*************************************************************************
11779 + * Change History
11780 + * 2005-01-28 create this file.
11781 + ************************************************************************/
11782 +#ifndef _XFDROPCAP_HXX
11783 +#define _XFDROPCAP_HXX
11785 +#include "xfglobal.hxx"
11786 +#include "ixfproperty.hxx"
11788 +class XFDropcap : public IXFProperty
11790 +public:
11791 + XFDropcap()
11793 + Reset();
11796 +public:
11797 + void SetCharCount(sal_Int32 count);
11799 + void SetLines(sal_Int32 lines);
11801 + void SetDistance(double distance);
11803 + void Reset();
11805 + virtual void ToXml(IXFStream *pStrm);
11807 + friend bool operator==(XFDropcap& dc1, XFDropcap& dc2);
11808 + friend bool operator!=(XFDropcap& dc1, XFDropcap& dc2);
11809 + friend class XFParaStyle;
11810 +private:
11811 + sal_Int32 m_nCharCount;
11812 + sal_Int32 m_nLines;
11813 + double m_fDistance;
11814 + rtl::OUString m_strStyleName;
11817 +inline void XFDropcap::SetCharCount(sal_Int32 count)
11819 + m_nCharCount = count;
11822 +inline void XFDropcap::SetLines(sal_Int32 lines)
11824 + m_nLines = lines;
11827 +inline void XFDropcap::SetDistance(double distance)
11829 + m_fDistance = distance;
11832 +inline void XFDropcap::Reset()
11834 + m_nCharCount = 0;
11835 + m_nLines = 0;
11836 + m_fDistance = 0;
11837 + m_strStyleName = A2OUSTR("");
11840 +inline void XFDropcap::ToXml(IXFStream *pStrm)
11842 + IXFAttrList *pAttrList = pStrm->GetAttrList();
11843 + pAttrList->Clear();
11845 + if( m_nCharCount < 1 || m_nLines < 2 )
11846 + return;
11847 + pAttrList->AddAttribute(A2OUSTR("style:length"), Int32ToOUString(m_nCharCount) );
11848 + pAttrList->AddAttribute(A2OUSTR("style:lines"), Int32ToOUString(m_nLines) );
11849 + pAttrList->AddAttribute(A2OUSTR("style:distance"), DoubleToOUString(m_fDistance) + A2OUSTR("cm") );
11850 + if( m_strStyleName.getLength() )
11851 + pAttrList->AddAttribute(A2OUSTR("style:style-name"), m_strStyleName );
11852 + pStrm->StartElement( A2OUSTR("style:drop-cap") );
11853 + pStrm->EndElement( A2OUSTR("style:drop-cap") );
11856 +inline bool operator==(XFDropcap& dc1, XFDropcap& dc2)
11858 + return (
11859 + (dc1.m_nCharCount == dc2.m_nCharCount)&&
11860 + (dc1.m_nLines == dc2.m_nLines)&&
11861 + (dc1.m_fDistance == dc2.m_fDistance)&&
11862 + (dc1.m_strStyleName == dc2.m_strStyleName)
11863 + );
11866 +inline bool operator!=(XFDropcap& dc1, XFDropcap& dc2)
11868 + return !(dc1==dc2);
11871 +#endif
11872 \ No newline at end of file
11873 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfendnoteconfig.hxx lotuswordpro/source/filter/xfilter/xfendnoteconfig.hxx
11874 --- lotuswordpro.bak/source/filter/xfilter/xfendnoteconfig.hxx 1970-01-01 08:00:00.000000000 +0800
11875 +++ lotuswordpro/source/filter/xfilter/xfendnoteconfig.hxx 2008-10-22 11:42:34.000000000 +0800
11876 @@ -0,0 +1,82 @@
11877 +/*************************************************************************
11879 + * The Contents of this file are made available subject to the terms of
11880 + * either of the following licenses
11882 + * - GNU Lesser General Public License Version 2.1
11883 + * - Sun Industry Standards Source License Version 1.1
11885 + * Sun Microsystems Inc., October, 2000
11887 + * GNU Lesser General Public License Version 2.1
11888 + * =============================================
11889 + * Copyright 2000 by Sun Microsystems, Inc.
11890 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
11892 + * This library is free software; you can redistribute it and/or
11893 + * modify it under the terms of the GNU Lesser General Public
11894 + * License version 2.1, as published by the Free Software Foundation.
11896 + * This library is distributed in the hope that it will be useful,
11897 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
11898 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11899 + * Lesser General Public License for more details.
11901 + * You should have received a copy of the GNU Lesser General Public
11902 + * License along with this library; if not, write to the Free Software
11903 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
11904 + * MA 02111-1307 USA
11907 + * Sun Industry Standards Source License Version 1.1
11908 + * =================================================
11909 + * The contents of this file are subject to the Sun Industry Standards
11910 + * Source License Version 1.1 (the "License"); You may not use this file
11911 + * except in compliance with the License. You may obtain a copy of the
11912 + * License at http://www.openoffice.org/license.html.
11914 + * Software provided under this License is provided on an "AS IS" basis,
11915 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
11916 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
11917 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
11918 + * See the License for the specific provisions governing your rights and
11919 + * obligations concerning the Software.
11921 + * The Initial Developer of the Original Code is: IBM Corporation
11923 + * Copyright: 2008 by IBM Corporation
11925 + * All Rights Reserved.
11927 + * Contributor(s): _______________________________________
11930 + ************************************************************************/
11931 +/*************************************************************************
11932 + * @file
11933 + * Endnote config.
11934 + ************************************************************************/
11935 +/*************************************************************************
11936 + * Change History
11937 + * 2005-03-29 create this file.
11938 + ************************************************************************/
11939 +#ifndef _XFENDNOTECONFIG_HXX
11940 +#define _XFENDNOTECONFIG_HXX
11942 +#include "xfendnoteconfig.hxx"
11944 +class XFEndnoteConfig : public XFFootnoteConfig
11946 +public:
11947 + XFEndnoteConfig() : XFFootnoteConfig()
11949 + m_bIsFootnote = sal_False;
11950 + m_bInsertInPage = sal_False;
11951 + m_strDefaultStyle = A2OUSTR("Endnote");
11952 + m_strMasterPage = A2OUSTR("Endnote");
11953 + m_strCitationStyle = A2OUSTR("Endnote Symbol");
11954 + m_strBodyStyle = A2OUSTR("Endnote anchor");
11958 +#endif
11959 \ No newline at end of file
11960 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfendnote.hxx lotuswordpro/source/filter/xfilter/xfendnote.hxx
11961 --- lotuswordpro.bak/source/filter/xfilter/xfendnote.hxx 1970-01-01 08:00:00.000000000 +0800
11962 +++ lotuswordpro/source/filter/xfilter/xfendnote.hxx 2008-10-22 11:42:34.000000000 +0800
11963 @@ -0,0 +1,128 @@
11964 +/*************************************************************************
11966 + * The Contents of this file are made available subject to the terms of
11967 + * either of the following licenses
11969 + * - GNU Lesser General Public License Version 2.1
11970 + * - Sun Industry Standards Source License Version 1.1
11972 + * Sun Microsystems Inc., October, 2000
11974 + * GNU Lesser General Public License Version 2.1
11975 + * =============================================
11976 + * Copyright 2000 by Sun Microsystems, Inc.
11977 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
11979 + * This library is free software; you can redistribute it and/or
11980 + * modify it under the terms of the GNU Lesser General Public
11981 + * License version 2.1, as published by the Free Software Foundation.
11983 + * This library is distributed in the hope that it will be useful,
11984 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
11985 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11986 + * Lesser General Public License for more details.
11988 + * You should have received a copy of the GNU Lesser General Public
11989 + * License along with this library; if not, write to the Free Software
11990 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
11991 + * MA 02111-1307 USA
11994 + * Sun Industry Standards Source License Version 1.1
11995 + * =================================================
11996 + * The contents of this file are subject to the Sun Industry Standards
11997 + * Source License Version 1.1 (the "License"); You may not use this file
11998 + * except in compliance with the License. You may obtain a copy of the
11999 + * License at http://www.openoffice.org/license.html.
12001 + * Software provided under this License is provided on an "AS IS" basis,
12002 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
12003 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
12004 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
12005 + * See the License for the specific provisions governing your rights and
12006 + * obligations concerning the Software.
12008 + * The Initial Developer of the Original Code is: IBM Corporation
12010 + * Copyright: 2008 by IBM Corporation
12012 + * All Rights Reserved.
12014 + * Contributor(s): _______________________________________
12017 + ************************************************************************/
12018 +/*************************************************************************
12019 + * @file
12020 + * End note object.
12021 + ************************************************************************/
12022 +/*************************************************************************
12023 + * Change History
12024 + * 2004-1-31 create this file.
12025 + ************************************************************************/
12026 +#ifndef _XFENDNOTE_HXX
12027 +#define _XFENDNOTE_HXX
12029 +#include "xfglobal.hxx"
12030 +#include "xfcontent.hxx"
12031 +#include "xfcontentcontainer.hxx"
12033 +/**
12034 + * @brief
12035 + * End note obejct.
12036 + */
12037 +class XFEndNote : public XFContentContainer
12039 +public:
12040 + XFEndNote();
12042 +public:
12043 + void SetLabel(sal_Unicode label);
12045 + virtual void ToXml(IXFStream *pStrm);
12047 +private:
12048 + rtl::OUString m_strID;
12049 + rtl::OUString m_strLabel;
12050 + XFContentContainer m_aContents;
12053 +inline XFEndNote::XFEndNote()
12055 + m_strID = XFGlobal::GenNoteName();
12058 +inline void XFEndNote::SetLabel(sal_Unicode label)
12060 + sal_Unicode chs[2];
12061 + chs[0] = label;
12062 + chs[1] = 0;
12064 + m_strLabel = rtl::OUString(chs);
12067 +inline void XFEndNote::ToXml(IXFStream *pStrm)
12069 + IXFAttrList *pAttrList = pStrm->GetAttrList();
12070 + pAttrList->Clear();
12072 + pAttrList->AddAttribute( A2OUSTR("text:id"), m_strID );
12073 + pStrm->StartElement( A2OUSTR("text:endnote") );
12075 + pAttrList->Clear();
12076 + if( m_strLabel.getLength() )
12077 + pAttrList->AddAttribute( A2OUSTR("text:label"), m_strLabel );
12078 + pStrm->StartElement( A2OUSTR("text:endnote-citation") );
12079 + if( m_strLabel.getLength())
12080 + pStrm->Characters(m_strLabel);
12081 + pStrm->EndElement( A2OUSTR("text:endnote-citation") );
12083 + pAttrList->Clear();
12084 + pStrm->StartElement( A2OUSTR("text:endnote-body") );
12085 + XFContentContainer::ToXml(pStrm);
12086 + pStrm->EndElement( A2OUSTR("text:endnote-body") );
12088 + pStrm->EndElement( A2OUSTR("text:endnote") );
12091 +#endif
12092 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfentry.cxx lotuswordpro/source/filter/xfilter/xfentry.cxx
12093 --- lotuswordpro.bak/source/filter/xfilter/xfentry.cxx 1970-01-01 08:00:00.000000000 +0800
12094 +++ lotuswordpro/source/filter/xfilter/xfentry.cxx 2008-10-22 11:42:34.000000000 +0800
12095 @@ -0,0 +1,108 @@
12096 +/*************************************************************************
12098 + * The Contents of this file are made available subject to the terms of
12099 + * either of the following licenses
12101 + * - GNU Lesser General Public License Version 2.1
12102 + * - Sun Industry Standards Source License Version 1.1
12104 + * Sun Microsystems Inc., October, 2000
12106 + * GNU Lesser General Public License Version 2.1
12107 + * =============================================
12108 + * Copyright 2000 by Sun Microsystems, Inc.
12109 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
12111 + * This library is free software; you can redistribute it and/or
12112 + * modify it under the terms of the GNU Lesser General Public
12113 + * License version 2.1, as published by the Free Software Foundation.
12115 + * This library is distributed in the hope that it will be useful,
12116 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
12117 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12118 + * Lesser General Public License for more details.
12120 + * You should have received a copy of the GNU Lesser General Public
12121 + * License along with this library; if not, write to the Free Software
12122 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
12123 + * MA 02111-1307 USA
12126 + * Sun Industry Standards Source License Version 1.1
12127 + * =================================================
12128 + * The contents of this file are subject to the Sun Industry Standards
12129 + * Source License Version 1.1 (the "License"); You may not use this file
12130 + * except in compliance with the License. You may obtain a copy of the
12131 + * License at http://www.openoffice.org/license.html.
12133 + * Software provided under this License is provided on an "AS IS" basis,
12134 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
12135 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
12136 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
12137 + * See the License for the specific provisions governing your rights and
12138 + * obligations concerning the Software.
12140 + * The Initial Developer of the Original Code is: IBM Corporation
12142 + * Copyright: 2008 by IBM Corporation
12144 + * All Rights Reserved.
12146 + * Contributor(s): _______________________________________
12149 + ************************************************************************/
12150 +/*************************************************************************
12151 + * @file
12152 + * index entry object.
12153 + ************************************************************************/
12154 +/*************************************************************************
12155 + * Change History
12156 + * 2005-04-26 create this file.
12157 + ************************************************************************/
12158 +#include "xfentry.hxx"
12160 +XFEntry::XFEntry()
12162 + m_eType = enumXFEntryTOC;
12163 + m_bMainEntry = sal_False;
12164 + m_nOutlineLevel = 1;
12167 +void XFEntry::ToXml(IXFStream *pStrm)
12169 + IXFAttrList *pAttrList = pStrm->GetAttrList();
12170 + pAttrList->Clear();
12172 + pAttrList->AddAttribute( A2OUSTR("text:string-value"), m_strValue );
12174 + if( m_eType == enumXFEntryTOC )
12176 + pAttrList->AddAttribute( A2OUSTR("text:outline-level"), Int32ToOUString(m_nOutlineLevel) );
12177 + pStrm->StartElement( A2OUSTR("text:toc-mark") );
12178 +// pStrm->Characters(m_strDisplay);
12179 + pStrm->EndElement( A2OUSTR("text:toc-mark") );
12181 + else if( m_eType == enumXFEntryAlphabetical )
12183 + pAttrList->AddAttribute( A2OUSTR("text:key1"), m_strKey1 );
12184 + if( m_strKey2.getLength()>0 )
12185 + pAttrList->AddAttribute( A2OUSTR("text:key2"), m_strKey2 );
12187 + if( m_bMainEntry )
12188 + pAttrList->AddAttribute( A2OUSTR("text:main-etry"), A2OUSTR("true") );
12190 + pStrm->StartElement( A2OUSTR("text:alphabetical-index-mark") );
12191 +// pStrm->Characters(m_strDisplay);
12192 + pStrm->EndElement( A2OUSTR("text:alphabetical-index-mark") );
12194 + else if( m_eType == enumXFEntryUserIndex )
12196 + pAttrList->AddAttribute( A2OUSTR("text:outline-level"), Int32ToOUString(m_nOutlineLevel) );
12197 + pAttrList->AddAttribute( A2OUSTR("text:index-name"), m_strName );
12199 + pStrm->StartElement( A2OUSTR("text:user-index-mark") );
12200 +// pStrm->Characters(m_strDisplay);
12201 + pStrm->EndElement( A2OUSTR("text:user-index-mark") );
12202 + }
12204 \ No newline at end of file
12205 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfentry.hxx lotuswordpro/source/filter/xfilter/xfentry.hxx
12206 --- lotuswordpro.bak/source/filter/xfilter/xfentry.hxx 1970-01-01 08:00:00.000000000 +0800
12207 +++ lotuswordpro/source/filter/xfilter/xfentry.hxx 2008-10-22 11:42:34.000000000 +0800
12208 @@ -0,0 +1,162 @@
12209 +/*************************************************************************
12211 + * The Contents of this file are made available subject to the terms of
12212 + * either of the following licenses
12214 + * - GNU Lesser General Public License Version 2.1
12215 + * - Sun Industry Standards Source License Version 1.1
12217 + * Sun Microsystems Inc., October, 2000
12219 + * GNU Lesser General Public License Version 2.1
12220 + * =============================================
12221 + * Copyright 2000 by Sun Microsystems, Inc.
12222 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
12224 + * This library is free software; you can redistribute it and/or
12225 + * modify it under the terms of the GNU Lesser General Public
12226 + * License version 2.1, as published by the Free Software Foundation.
12228 + * This library is distributed in the hope that it will be useful,
12229 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
12230 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12231 + * Lesser General Public License for more details.
12233 + * You should have received a copy of the GNU Lesser General Public
12234 + * License along with this library; if not, write to the Free Software
12235 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
12236 + * MA 02111-1307 USA
12239 + * Sun Industry Standards Source License Version 1.1
12240 + * =================================================
12241 + * The contents of this file are subject to the Sun Industry Standards
12242 + * Source License Version 1.1 (the "License"); You may not use this file
12243 + * except in compliance with the License. You may obtain a copy of the
12244 + * License at http://www.openoffice.org/license.html.
12246 + * Software provided under this License is provided on an "AS IS" basis,
12247 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
12248 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
12249 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
12250 + * See the License for the specific provisions governing your rights and
12251 + * obligations concerning the Software.
12253 + * The Initial Developer of the Original Code is: IBM Corporation
12255 + * Copyright: 2008 by IBM Corporation
12257 + * All Rights Reserved.
12259 + * Contributor(s): _______________________________________
12262 + ************************************************************************/
12263 +/*************************************************************************
12264 + * @file
12265 + * index entry object.
12266 + ************************************************************************/
12267 +/*************************************************************************
12268 + * Change History
12269 + * 2005-04-26 create this file.
12270 + ************************************************************************/
12271 +#ifndef _XFENTRY_HXX
12272 +#define _XFENTRY_HXX
12274 +#include "xfcontent.hxx"
12276 +/**
12277 + * @brief
12278 + * Index entry obejct.
12279 + */
12280 +class XFEntry : public XFContent
12282 +public:
12283 + XFEntry();
12285 +public:
12286 + /**
12287 + * @descr Set entry type.
12288 + */
12289 + void SetEntryType(enumXFEntry type);
12291 + /**
12292 + * @descr Set entry string value.
12293 + */
12294 + void SetStringValue(const rtl::OUString& value);
12296 + /**
12297 + * @descr Set display string.
12298 + */
12299 + void SetStringDisplay(const rtl::OUString& display);
12301 + /**
12302 + * @descr Set entry name.
12303 + */
12304 + void SetEntryName(const rtl::OUString& name);
12306 + /**
12307 + * @descr Set entry key. The keys is available only for enumXFEntryAlphabetical.
12308 + */
12309 + void SetKey(const rtl::OUString& key1, const rtl::OUString& key2=A2OUSTR(""));
12311 + /**
12312 + * @descr Set whether it's a main entry. This is available only for enumXFEntryAlphabetical.
12313 + */
12314 + void SetMainEntry(sal_Bool main);
12316 + /**
12317 + * @descr Set outline level. This is available for enumXFEntryTOC and enumXFEntryUserIndex.
12318 + */
12319 + void SetOutlineLevel(sal_Int32 level);
12321 + virtual void ToXml(IXFStream *pStrm);
12323 +private:
12324 + enumXFEntry m_eType;
12325 + rtl::OUString m_strValue;
12326 + rtl::OUString m_strDisplay;
12327 + rtl::OUString m_strKey1;
12328 + rtl::OUString m_strKey2;
12329 + rtl::OUString m_strName;
12330 + sal_Bool m_bMainEntry;
12331 + sal_Int32 m_nOutlineLevel;
12334 +inline void XFEntry::SetEntryType(enumXFEntry type)
12336 + m_eType = type;
12339 +inline void XFEntry::SetStringValue(const rtl::OUString& value)
12341 + m_strValue = value;
12344 +inline void XFEntry::SetStringDisplay(const rtl::OUString& display)
12346 + m_strDisplay = display;
12349 +inline void XFEntry::SetEntryName(const rtl::OUString& name)
12351 + m_strName = name;
12354 +inline void XFEntry::SetKey(const rtl::OUString& key1, const rtl::OUString& key2/* =A2OUSTR */)
12356 + m_strKey1 = key1;
12357 + m_strKey2 = key2;
12360 +inline void XFEntry::SetMainEntry(sal_Bool main)
12362 + m_bMainEntry = main;
12365 +inline void XFEntry::SetOutlineLevel(sal_Int32 level)
12367 + m_nOutlineLevel = level;
12370 +#endif
12371 \ No newline at end of file
12372 diff -urNp lotuswordpro.bak/source/filter/xfilter/xffileattrlist.cxx lotuswordpro/source/filter/xfilter/xffileattrlist.cxx
12373 --- lotuswordpro.bak/source/filter/xfilter/xffileattrlist.cxx 1970-01-01 08:00:00.000000000 +0800
12374 +++ lotuswordpro/source/filter/xfilter/xffileattrlist.cxx 2008-10-22 11:42:34.000000000 +0800
12375 @@ -0,0 +1,82 @@
12376 +/*************************************************************************
12378 + * The Contents of this file are made available subject to the terms of
12379 + * either of the following licenses
12381 + * - GNU Lesser General Public License Version 2.1
12382 + * - Sun Industry Standards Source License Version 1.1
12384 + * Sun Microsystems Inc., October, 2000
12386 + * GNU Lesser General Public License Version 2.1
12387 + * =============================================
12388 + * Copyright 2000 by Sun Microsystems, Inc.
12389 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
12391 + * This library is free software; you can redistribute it and/or
12392 + * modify it under the terms of the GNU Lesser General Public
12393 + * License version 2.1, as published by the Free Software Foundation.
12395 + * This library is distributed in the hope that it will be useful,
12396 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
12397 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12398 + * Lesser General Public License for more details.
12400 + * You should have received a copy of the GNU Lesser General Public
12401 + * License along with this library; if not, write to the Free Software
12402 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
12403 + * MA 02111-1307 USA
12406 + * Sun Industry Standards Source License Version 1.1
12407 + * =================================================
12408 + * The contents of this file are subject to the Sun Industry Standards
12409 + * Source License Version 1.1 (the "License"); You may not use this file
12410 + * except in compliance with the License. You may obtain a copy of the
12411 + * License at http://www.openoffice.org/license.html.
12413 + * Software provided under this License is provided on an "AS IS" basis,
12414 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
12415 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
12416 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
12417 + * See the License for the specific provisions governing your rights and
12418 + * obligations concerning the Software.
12420 + * The Initial Developer of the Original Code is: IBM Corporation
12422 + * Copyright: 2008 by IBM Corporation
12424 + * All Rights Reserved.
12426 + * Contributor(s): _______________________________________
12429 + ************************************************************************/
12430 +/*************************************************************************
12431 + * @file
12432 + * Attribute list for sax element,this is a help class to write xml to
12433 + * local file.
12434 + ************************************************************************/
12435 +/*************************************************************************
12436 + * Change History
12437 + * 2004-12-23 create this file.
12438 + ************************************************************************/
12439 +#include "xffileattrlist.hxx"
12441 +XFFileAttrList::XFFileAttrList()
12445 +XFFileAttrList::~XFFileAttrList()
12449 +void XFFileAttrList::AddAttribute(const rtl::OUString& name, const rtl::OUString& value)
12451 + m_aAttrList.push_back( std::pair<rtl::OUString,rtl::OUString>(name,value) );
12454 +void XFFileAttrList::Clear()
12456 + m_aAttrList.clear();
12458 \ No newline at end of file
12459 diff -urNp lotuswordpro.bak/source/filter/xfilter/xffileattrlist.hxx lotuswordpro/source/filter/xfilter/xffileattrlist.hxx
12460 --- lotuswordpro.bak/source/filter/xfilter/xffileattrlist.hxx 1970-01-01 08:00:00.000000000 +0800
12461 +++ lotuswordpro/source/filter/xfilter/xffileattrlist.hxx 2008-10-22 11:42:34.000000000 +0800
12462 @@ -0,0 +1,89 @@
12463 +/*************************************************************************
12465 + * The Contents of this file are made available subject to the terms of
12466 + * either of the following licenses
12468 + * - GNU Lesser General Public License Version 2.1
12469 + * - Sun Industry Standards Source License Version 1.1
12471 + * Sun Microsystems Inc., October, 2000
12473 + * GNU Lesser General Public License Version 2.1
12474 + * =============================================
12475 + * Copyright 2000 by Sun Microsystems, Inc.
12476 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
12478 + * This library is free software; you can redistribute it and/or
12479 + * modify it under the terms of the GNU Lesser General Public
12480 + * License version 2.1, as published by the Free Software Foundation.
12482 + * This library is distributed in the hope that it will be useful,
12483 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
12484 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12485 + * Lesser General Public License for more details.
12487 + * You should have received a copy of the GNU Lesser General Public
12488 + * License along with this library; if not, write to the Free Software
12489 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
12490 + * MA 02111-1307 USA
12493 + * Sun Industry Standards Source License Version 1.1
12494 + * =================================================
12495 + * The contents of this file are subject to the Sun Industry Standards
12496 + * Source License Version 1.1 (the "License"); You may not use this file
12497 + * except in compliance with the License. You may obtain a copy of the
12498 + * License at http://www.openoffice.org/license.html.
12500 + * Software provided under this License is provided on an "AS IS" basis,
12501 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
12502 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
12503 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
12504 + * See the License for the specific provisions governing your rights and
12505 + * obligations concerning the Software.
12507 + * The Initial Developer of the Original Code is: IBM Corporation
12509 + * Copyright: 2008 by IBM Corporation
12511 + * All Rights Reserved.
12513 + * Contributor(s): _______________________________________
12516 + ************************************************************************/
12517 +/*************************************************************************
12518 + * @file
12519 + * Wrapper the sax interface for xml output.
12520 + ************************************************************************/
12521 +/*************************************************************************
12522 + * Change History
12523 + * 2004-12-23 create this file.
12524 + ************************************************************************/
12526 +#ifndef _XFFILEATTRLIST_HXX
12527 +#define _XFFILEATTRLIST_HXX
12529 +#include "ixfattrlist.hxx"
12530 +#include "rtl/ustring.hxx"
12531 +#include <vector>
12532 +#include <utility>
12534 +class XFFileAttrList : public IXFAttrList
12536 +public:
12538 + XFFileAttrList();
12539 + virtual ~XFFileAttrList();
12540 + //Interface ISaxAttributeList:
12542 + virtual void AddAttribute(const rtl::OUString& name, const rtl::OUString& value);
12543 + virtual void Clear();
12545 + friend class XFFileStream;
12546 +private:
12547 + std::vector<std::pair<rtl::OUString,rtl::OUString> > m_aAttrList;
12551 +#endif //XFFILEATTRLIST
12552 \ No newline at end of file
12553 diff -urNp lotuswordpro.bak/source/filter/xfilter/xffilestream.cxx lotuswordpro/source/filter/xfilter/xffilestream.cxx
12554 --- lotuswordpro.bak/source/filter/xfilter/xffilestream.cxx 1970-01-01 08:00:00.000000000 +0800
12555 +++ lotuswordpro/source/filter/xfilter/xffilestream.cxx 2008-10-22 11:42:34.000000000 +0800
12556 @@ -0,0 +1,208 @@
12557 +/*************************************************************************
12559 + * The Contents of this file are made available subject to the terms of
12560 + * either of the following licenses
12562 + * - GNU Lesser General Public License Version 2.1
12563 + * - Sun Industry Standards Source License Version 1.1
12565 + * Sun Microsystems Inc., October, 2000
12567 + * GNU Lesser General Public License Version 2.1
12568 + * =============================================
12569 + * Copyright 2000 by Sun Microsystems, Inc.
12570 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
12572 + * This library is free software; you can redistribute it and/or
12573 + * modify it under the terms of the GNU Lesser General Public
12574 + * License version 2.1, as published by the Free Software Foundation.
12576 + * This library is distributed in the hope that it will be useful,
12577 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
12578 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12579 + * Lesser General Public License for more details.
12581 + * You should have received a copy of the GNU Lesser General Public
12582 + * License along with this library; if not, write to the Free Software
12583 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
12584 + * MA 02111-1307 USA
12587 + * Sun Industry Standards Source License Version 1.1
12588 + * =================================================
12589 + * The contents of this file are subject to the Sun Industry Standards
12590 + * Source License Version 1.1 (the "License"); You may not use this file
12591 + * except in compliance with the License. You may obtain a copy of the
12592 + * License at http://www.openoffice.org/license.html.
12594 + * Software provided under this License is provided on an "AS IS" basis,
12595 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
12596 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
12597 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
12598 + * See the License for the specific provisions governing your rights and
12599 + * obligations concerning the Software.
12601 + * The Initial Developer of the Original Code is: IBM Corporation
12603 + * Copyright: 2008 by IBM Corporation
12605 + * All Rights Reserved.
12607 + * Contributor(s): _______________________________________
12610 + ************************************************************************/
12611 +/*************************************************************************
12612 + * @file
12613 + * Interface for the all content object,ie. text,paragraph,picture,and so on.
12614 + ************************************************************************/
12615 +/*************************************************************************
12616 + * Change History
12617 + * 2004-12-23 create this file.
12618 + ************************************************************************/
12619 +#include "xffilestream.hxx"
12620 +#include "xffileattrlist.hxx"
12621 +#include "ixfattrlist.hxx"
12623 +void WriteStartTag(std::ofstream& ofs, const char *pStr, int len);
12624 +void WriteEndTag(std::ofstream& ofs, const char *pStr, int len);
12625 +void WriteString(std::ofstream& ofs, const char *pStr, int len);
12626 +void WriteXmlString(std::ofstream& ofs, const char *pStr, int len);
12627 +void WriteOUString(std::ofstream& ofs, const rtl::OUString& oustr);
12629 +XFFileStream::XFFileStream(std::string strFileName):m_aFile(strFileName.c_str())
12631 + m_pAttrList = new XFFileAttrList();
12634 +XFFileStream::~XFFileStream()
12636 + if( m_pAttrList )
12637 + delete m_pAttrList;
12640 +void XFFileStream::StartDocument()
12642 + std::string strXmlDecl = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
12643 + WriteString(m_aFile, strXmlDecl.c_str(),strXmlDecl.length());
12646 +void XFFileStream::EndDocument()
12648 + m_aFile.close();
12652 +void XFFileStream::StartElement(const rtl::OUString& oustr)
12654 + WriteString(m_aFile, "\n<",2);
12655 + WriteOUString(m_aFile, oustr);
12657 + //write attributes:
12658 + std::vector<std::pair<rtl::OUString,rtl::OUString> >::iterator it;
12659 + for( it = m_pAttrList->m_aAttrList.begin(); it != m_pAttrList->m_aAttrList.end(); it++ )
12661 + std::pair<rtl::OUString,rtl::OUString> pair = *it;
12662 + rtl::OUString name = pair.first;
12663 + rtl::OUString value = pair.second;
12665 + WriteString(m_aFile," ",1);
12666 + WriteOUString(m_aFile, name);
12667 + WriteString(m_aFile, "=\"",2);
12668 + WriteOUString(m_aFile, value);
12669 + WriteString(m_aFile, "\"",1);
12673 + WriteString(m_aFile, ">",1);
12674 + m_pAttrList->Clear();
12677 +void XFFileStream::EndElement(const rtl::OUString& oustr)
12679 + rtl::OString ostr;
12681 + ostr = rtl::OUStringToOString(oustr,RTL_TEXTENCODING_UTF8);
12682 + WriteEndTag(m_aFile, ostr.getStr(), ostr.getLength());
12685 +void XFFileStream::Characters(const rtl::OUString& oustr)
12687 + WriteOUString(m_aFile, oustr);
12690 +IXFAttrList* XFFileStream::GetAttrList()
12692 + return m_pAttrList;
12695 +//------------------------------------------------------------------------------
12697 +void WriteStartTag(std::ofstream& ofs, const char *pStr, int len)
12699 + ofs.write("\n<",2);
12700 + ofs.write(pStr,len);
12703 +void WriteEndTag(std::ofstream& ofs, const char *pStr, int len)
12705 + ofs.write("</",2);
12706 + ofs.write(pStr,len);
12707 + ofs.write(">\n",2);
12710 +void WriteString(std::ofstream& ofs, const char *pStr, int len)
12712 + ofs.write(pStr,len);
12715 +/**
12716 + * @descr: Replace some reserved characters of xml character into xml entity.Please refer to w3c xml spec.
12717 + */
12718 +void WriteXmlString(std::ofstream& ofs, const char *pStr, int len)
12720 + std::string str;
12722 + for( int i=0; i<len; i++ )
12724 + switch(pStr[i])
12726 + case '&':
12727 + str += "&amp;";
12728 + break;
12729 + case '<':
12730 + str += "&lt;";
12731 + break;
12732 + case '>':
12733 + str += "&gt;";
12734 + break;
12735 + case '\'':
12736 + str += "&apos;";
12737 + break;
12738 + case '\"':
12739 + str += "&quot;";
12740 + break;
12741 + case 13:
12742 + str += "&#x0d;";
12743 + break;
12744 + case 10:
12745 + str += "&#x0a;";
12746 + break;
12747 + case 9:
12748 + str += "&#x09;";
12749 + break;
12750 + default:
12751 + str += pStr[i];
12754 + ofs.write(str.c_str(),str.length());
12757 +void WriteOUString(std::ofstream& ofs, const rtl::OUString& oustr)
12759 + rtl::OString ostr;
12761 + ostr = rtl::OUStringToOString(oustr,RTL_TEXTENCODING_UTF8);
12763 + WriteXmlString(ofs, ostr.getStr(),ostr.getLength());
12765 \ No newline at end of file
12766 diff -urNp lotuswordpro.bak/source/filter/xfilter/xffilestream.hxx lotuswordpro/source/filter/xfilter/xffilestream.hxx
12767 --- lotuswordpro.bak/source/filter/xfilter/xffilestream.hxx 1970-01-01 08:00:00.000000000 +0800
12768 +++ lotuswordpro/source/filter/xfilter/xffilestream.hxx 2008-10-22 11:42:34.000000000 +0800
12769 @@ -0,0 +1,92 @@
12770 +/*************************************************************************
12772 + * The Contents of this file are made available subject to the terms of
12773 + * either of the following licenses
12775 + * - GNU Lesser General Public License Version 2.1
12776 + * - Sun Industry Standards Source License Version 1.1
12778 + * Sun Microsystems Inc., October, 2000
12780 + * GNU Lesser General Public License Version 2.1
12781 + * =============================================
12782 + * Copyright 2000 by Sun Microsystems, Inc.
12783 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
12785 + * This library is free software; you can redistribute it and/or
12786 + * modify it under the terms of the GNU Lesser General Public
12787 + * License version 2.1, as published by the Free Software Foundation.
12789 + * This library is distributed in the hope that it will be useful,
12790 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
12791 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12792 + * Lesser General Public License for more details.
12794 + * You should have received a copy of the GNU Lesser General Public
12795 + * License along with this library; if not, write to the Free Software
12796 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
12797 + * MA 02111-1307 USA
12800 + * Sun Industry Standards Source License Version 1.1
12801 + * =================================================
12802 + * The contents of this file are subject to the Sun Industry Standards
12803 + * Source License Version 1.1 (the "License"); You may not use this file
12804 + * except in compliance with the License. You may obtain a copy of the
12805 + * License at http://www.openoffice.org/license.html.
12807 + * Software provided under this License is provided on an "AS IS" basis,
12808 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
12809 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
12810 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
12811 + * See the License for the specific provisions governing your rights and
12812 + * obligations concerning the Software.
12814 + * The Initial Developer of the Original Code is: IBM Corporation
12816 + * Copyright: 2008 by IBM Corporation
12818 + * All Rights Reserved.
12820 + * Contributor(s): _______________________________________
12823 + ************************************************************************/
12824 +/*************************************************************************
12825 + * @file
12826 + * Wrapper for sax stream to write to local file.
12827 + ************************************************************************/
12828 +/*************************************************************************
12829 + * Change History
12830 + * 2004-12-23 create this file.
12831 + ************************************************************************/
12832 +#ifndef _XFFILESTREAM_HXX
12833 +#define _XFFILESTREAM_HXX
12835 +#include "ixfstream.hxx"
12836 +#include <fstream>
12837 +#include <rtl/ustring.hxx>
12839 +class XFFileAttrList;
12841 +class XFFileStream : public IXFStream
12843 +public:
12844 + XFFileStream(std::string strFileName);
12845 + virtual ~XFFileStream();
12847 + //interface IXFSaxStream
12848 + virtual void StartDocument();
12849 + virtual void EndDocument();
12850 + virtual void StartElement(const rtl::OUString& oustr);
12851 + virtual void EndElement(const rtl::OUString& oustr);
12852 + virtual void Characters(const rtl::OUString& oustr);
12853 + virtual IXFAttrList* GetAttrList();
12855 +private:
12856 + std::ofstream m_aFile;
12857 + XFFileAttrList *m_pAttrList;
12860 +#endif //XFFILESTREAM_INC
12862 diff -urNp lotuswordpro.bak/source/filter/xfilter/xffloatframe.cxx lotuswordpro/source/filter/xfilter/xffloatframe.cxx
12863 --- lotuswordpro.bak/source/filter/xfilter/xffloatframe.cxx 1970-01-01 08:00:00.000000000 +0800
12864 +++ lotuswordpro/source/filter/xfilter/xffloatframe.cxx 2008-10-22 11:42:34.000000000 +0800
12865 @@ -0,0 +1,91 @@
12866 +/*************************************************************************
12868 + * The Contents of this file are made available subject to the terms of
12869 + * either of the following licenses
12871 + * - GNU Lesser General Public License Version 2.1
12872 + * - Sun Industry Standards Source License Version 1.1
12874 + * Sun Microsystems Inc., October, 2000
12876 + * GNU Lesser General Public License Version 2.1
12877 + * =============================================
12878 + * Copyright 2000 by Sun Microsystems, Inc.
12879 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
12881 + * This library is free software; you can redistribute it and/or
12882 + * modify it under the terms of the GNU Lesser General Public
12883 + * License version 2.1, as published by the Free Software Foundation.
12885 + * This library is distributed in the hope that it will be useful,
12886 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
12887 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12888 + * Lesser General Public License for more details.
12890 + * You should have received a copy of the GNU Lesser General Public
12891 + * License along with this library; if not, write to the Free Software
12892 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
12893 + * MA 02111-1307 USA
12896 + * Sun Industry Standards Source License Version 1.1
12897 + * =================================================
12898 + * The contents of this file are subject to the Sun Industry Standards
12899 + * Source License Version 1.1 (the "License"); You may not use this file
12900 + * except in compliance with the License. You may obtain a copy of the
12901 + * License at http://www.openoffice.org/license.html.
12903 + * Software provided under this License is provided on an "AS IS" basis,
12904 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
12905 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
12906 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
12907 + * See the License for the specific provisions governing your rights and
12908 + * obligations concerning the Software.
12910 + * The Initial Developer of the Original Code is: IBM Corporation
12912 + * Copyright: 2008 by IBM Corporation
12914 + * All Rights Reserved.
12916 + * Contributor(s): _______________________________________
12919 + ************************************************************************/
12920 +/*************************************************************************
12921 + * @file
12922 + * Float frame whose anchor is page.
12923 + ************************************************************************/
12924 +/*************************************************************************
12925 + * Change History
12926 + * 2005-01-21 create this file.
12927 + ************************************************************************/
12928 +#include "xffloatframe.hxx"
12930 +XFFloatFrame::XFFloatFrame(sal_Int32 page)
12932 + m_nStart = page;
12933 + m_nEnd = page;
12936 +XFFloatFrame::XFFloatFrame(sal_Int32 start, sal_Int32 end, sal_Bool all)
12938 + m_nStart = start;
12939 + m_nEnd = end;
12940 + m_bAll = all;
12941 + SetAnchorType(enumXFAnchorPage);
12944 +void XFFloatFrame::ToXml(IXFStream *pStrm)
12946 + IXFAttrList *pAttrList = pStrm->GetAttrList();
12947 + pAttrList->Clear();
12949 + for( int i=m_nStart; i<=m_nEnd; i++ )
12951 + XFFrame::SetAnchorPage(i);
12952 + XFFrame::ToXml(pStrm);
12953 + if( !m_bAll )
12954 + i++;
12957 \ No newline at end of file
12958 diff -urNp lotuswordpro.bak/source/filter/xfilter/xffloatframe.hxx lotuswordpro/source/filter/xfilter/xffloatframe.hxx
12959 --- lotuswordpro.bak/source/filter/xfilter/xffloatframe.hxx 1970-01-01 08:00:00.000000000 +0800
12960 +++ lotuswordpro/source/filter/xfilter/xffloatframe.hxx 2008-10-22 11:42:34.000000000 +0800
12961 @@ -0,0 +1,94 @@
12962 +/*************************************************************************
12964 + * The Contents of this file are made available subject to the terms of
12965 + * either of the following licenses
12967 + * - GNU Lesser General Public License Version 2.1
12968 + * - Sun Industry Standards Source License Version 1.1
12970 + * Sun Microsystems Inc., October, 2000
12972 + * GNU Lesser General Public License Version 2.1
12973 + * =============================================
12974 + * Copyright 2000 by Sun Microsystems, Inc.
12975 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
12977 + * This library is free software; you can redistribute it and/or
12978 + * modify it under the terms of the GNU Lesser General Public
12979 + * License version 2.1, as published by the Free Software Foundation.
12981 + * This library is distributed in the hope that it will be useful,
12982 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
12983 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12984 + * Lesser General Public License for more details.
12986 + * You should have received a copy of the GNU Lesser General Public
12987 + * License along with this library; if not, write to the Free Software
12988 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
12989 + * MA 02111-1307 USA
12992 + * Sun Industry Standards Source License Version 1.1
12993 + * =================================================
12994 + * The contents of this file are subject to the Sun Industry Standards
12995 + * Source License Version 1.1 (the "License"); You may not use this file
12996 + * except in compliance with the License. You may obtain a copy of the
12997 + * License at http://www.openoffice.org/license.html.
12999 + * Software provided under this License is provided on an "AS IS" basis,
13000 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
13001 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
13002 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
13003 + * See the License for the specific provisions governing your rights and
13004 + * obligations concerning the Software.
13006 + * The Initial Developer of the Original Code is: IBM Corporation
13008 + * Copyright: 2008 by IBM Corporation
13010 + * All Rights Reserved.
13012 + * Contributor(s): _______________________________________
13015 + ************************************************************************/
13016 +/*************************************************************************
13017 + * @file
13018 + * Float frame whose anchor is page.
13019 + ************************************************************************/
13020 +/*************************************************************************
13021 + * Change History
13022 + * 2005-01-21 create this file.
13023 + ************************************************************************/
13024 +#ifndef _XFFLOATFRAME_HXX
13025 +#define _XFFLOATFRAME_HXX
13027 +#include "xfframe.hxx"
13028 +#include <vector>
13030 +/**
13031 + * @brief
13032 + * Floating frame on any page.
13033 + * You can specify it to be on all pages, on odd pages, or on even pages.
13034 + */
13035 +class XFFloatFrame : public XFFrame
13037 +public:
13038 + XFFloatFrame(sal_Int32 page);
13040 + /**
13041 + * @descr output range: [start,end], not [start,end).
13042 + */
13043 + XFFloatFrame(sal_Int32 start, sal_Int32 end, sal_Bool all=sal_False);
13045 +public:
13046 + void ToXml(IXFStream *pStrm);
13048 +private:
13049 + sal_Int32 m_nStart;
13050 + sal_Int32 m_nEnd;
13051 + sal_Bool m_bAll;
13054 +#endif
13056 diff -urNp lotuswordpro.bak/source/filter/xfilter/xffont.cxx lotuswordpro/source/filter/xfilter/xffont.cxx
13057 --- lotuswordpro.bak/source/filter/xfilter/xffont.cxx 1970-01-01 08:00:00.000000000 +0800
13058 +++ lotuswordpro/source/filter/xfilter/xffont.cxx 2008-10-22 11:42:34.000000000 +0800
13059 @@ -0,0 +1,415 @@
13060 +/*************************************************************************
13062 + * The Contents of this file are made available subject to the terms of
13063 + * either of the following licenses
13065 + * - GNU Lesser General Public License Version 2.1
13066 + * - Sun Industry Standards Source License Version 1.1
13068 + * Sun Microsystems Inc., October, 2000
13070 + * GNU Lesser General Public License Version 2.1
13071 + * =============================================
13072 + * Copyright 2000 by Sun Microsystems, Inc.
13073 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
13075 + * This library is free software; you can redistribute it and/or
13076 + * modify it under the terms of the GNU Lesser General Public
13077 + * License version 2.1, as published by the Free Software Foundation.
13079 + * This library is distributed in the hope that it will be useful,
13080 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
13081 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13082 + * Lesser General Public License for more details.
13084 + * You should have received a copy of the GNU Lesser General Public
13085 + * License along with this library; if not, write to the Free Software
13086 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
13087 + * MA 02111-1307 USA
13090 + * Sun Industry Standards Source License Version 1.1
13091 + * =================================================
13092 + * The contents of this file are subject to the Sun Industry Standards
13093 + * Source License Version 1.1 (the "License"); You may not use this file
13094 + * except in compliance with the License. You may obtain a copy of the
13095 + * License at http://www.openoffice.org/license.html.
13097 + * Software provided under this License is provided on an "AS IS" basis,
13098 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
13099 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
13100 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
13101 + * See the License for the specific provisions governing your rights and
13102 + * obligations concerning the Software.
13104 + * The Initial Developer of the Original Code is: IBM Corporation
13106 + * Copyright: 2008 by IBM Corporation
13108 + * All Rights Reserved.
13110 + * Contributor(s): _______________________________________
13113 + ************************************************************************/
13114 +/*************************************************************************
13115 + * @file
13116 + * Font object to serial to xml filter.
13117 + ************************************************************************/
13118 +/*************************************************************************
13119 + * Change History
13120 + * 2004-12-23 create this file.
13121 + * 2005-01-14 add scale,position,emphasize support.
13122 + * 2005-01-24 move some tool function to xfutil.hxx
13123 + ************************************************************************/
13124 +#include "xffont.hxx"
13126 +XFFont::XFFont()
13128 + m_nFontSize = 0;
13129 + m_nFontSizeAsia = 0;
13130 + m_nFontSizeComplex = 0;
13131 + m_bItalic = sal_False;
13132 + m_bItalicAsia = sal_False;
13133 + m_bItalicComplex = sal_False;
13134 + m_bBold = sal_False;
13135 + m_bBoldAsia = sal_False;
13136 + m_bBoldComplex = sal_False;
13137 + m_eUnderline = enumXFUnderlineNone;
13138 + m_eCrossout = enumXFCrossoutNone;
13139 + m_eRelief = enumXFReliefNone;
13140 + m_eTransform = enumXFTransformNone;
13141 + m_eEmphasize = enumXFEmphasizeNone;
13142 + m_bEmphasizeTop = sal_True;
13143 + m_bOutline = sal_False;
13144 + m_bShadow = sal_False;
13145 + m_bBlink = sal_False;
13146 + m_nPosition = 33;
13147 + m_nScale = 58;
13148 + m_fCharSpace = 0;
13149 + m_nWidthScale = 100;
13150 + m_bWordByWord = sal_False;
13151 + m_nFlag = 0;
13154 + The Following variable are to be compared:
13155 + rtl::OUString m_strFontName;
13156 + rtl::OUString m_strFontNameAsia;
13157 + rtl::OUString m_strFontNameComplex;
13158 + sal_Int16 m_nFontSize;
13159 + sal_Int16 m_nFontSizeAsia;
13160 + sal_Int16 m_nFontSizeComplex;
13161 + sal_Bool m_bItalic;
13162 + sal_Bool m_bItalicAsia;
13163 + sal_Bool m_bItalicComplex;
13164 + sal_Bool m_bBold;
13165 + sal_Bool m_bBoldAsia;
13166 + sal_Bool m_bBoldComplex;
13167 + sal_Int16 m_nUnderline;
13168 + sal_uInt32 m_nUnderlineColor;
13170 + sal_uInt32 m_nFlag;
13172 +bool operator==(XFFont& f1, XFFont& f2)
13174 + //The most possible entry be first:
13175 + if( f1.m_nFlag != f2.m_nFlag )
13176 + return false;
13178 + if( f1.m_strFontName != f2.m_strFontName ||
13179 + f1.m_strFontNameAsia != f2.m_strFontNameAsia ||
13180 + f1.m_strFontNameComplex != f2.m_strFontNameComplex
13182 + return false;
13184 + if( f1.m_nFontSize != f2.m_nFontSize ||
13185 + f1.m_nFontSizeAsia != f2.m_nFontSizeAsia ||
13186 + f1.m_nFontSizeComplex != f2.m_nFontSizeComplex
13188 + return false;
13190 + if( f1.m_bItalic != f2.m_bItalic ||
13191 + f1.m_bItalicAsia != f2.m_bItalicAsia ||
13192 + f1.m_bItalicComplex != f2.m_bItalicComplex
13194 + return false;
13196 + if( f1.m_bBold != f2.m_bBold ||
13197 + f1.m_bBoldAsia != f2.m_bBoldAsia ||
13198 + f1.m_bBoldComplex != f2.m_bBoldComplex
13200 + return false;
13202 + if( f1.m_nFlag&XFFONT_FLAG_UNDERLINE )
13204 + if( f1.m_eUnderline != f2.m_eUnderline )
13205 + return false;
13208 + if( f1.m_nFlag&XFFONT_FLAG_UNDERLINECOLOR )
13210 + if( f1.m_aUnderlineColor != f2.m_aUnderlineColor )
13211 + return false;
13212 + }
13214 + if( f1.m_nFlag&XFFONT_FLAG_CROSSOUT )
13216 + if( f1.m_eCrossout != f2.m_eCrossout )
13217 + return false;
13220 + if( f1.m_nFlag&XFFONT_FLAG_RELIEF )
13222 + if( f1.m_eRelief != f2.m_eRelief )
13223 + return false;
13226 + if( f1.m_nFlag&XFFONT_FLAG_TRANSFORM )
13228 + if( f1.m_eTransform != f2.m_eTransform )
13229 + return false;
13232 + if( f1.m_nFlag&XFFONT_FLAG_EMPHASIZE )
13234 + if( f1.m_eEmphasize != f2.m_eEmphasize )
13235 + return false;
13236 + if( f1.m_bEmphasizeTop != f2.m_bEmphasizeTop )
13237 + return false;
13240 + if( f1.m_bWordByWord != f2.m_bWordByWord )
13241 + return false;
13243 + if( f1.m_nFlag&XFFONT_FLAG_OUTLINE )
13245 + if( f1.m_bOutline != f2.m_bOutline )
13246 + return false;
13249 + if( f1.m_nFlag&XFFONT_FLAG_SHADOW )
13251 + if( f1.m_bShadow != f2.m_bShadow )
13252 + return false;
13255 + if( f1.m_nFlag&XFFONT_FLAG_BLINK )
13257 + if( f1.m_bBlink != f2.m_bBlink )
13258 + return false;
13261 + if( f1.m_nFlag&XFFONT_FLAG_POSITION )
13263 + if( f1.m_nPosition != f2.m_nPosition )
13264 + return false;
13267 + if( f1.m_nFlag&XFFONT_FLAG_SCALE )
13269 + if( f1.m_nScale != f2.m_nScale )
13270 + return false;
13273 + if( f1.m_nFlag&XFFONT_FLAG_CHARSPACE )
13275 + if( f1.m_fCharSpace != f2.m_fCharSpace )
13276 + return false;
13279 + if( f1.m_nFlag&XFFONT_FLAG_WIDTHSCALE )
13281 + if( f1.m_nWidthScale != f2.m_nWidthScale )
13282 + return false;
13285 + if( f1.m_nFlag&XFFONT_FLAG_COLOR )
13287 + if( f1.m_aColor != f2.m_aColor )
13288 + return false;
13291 + if( f1.m_nFlag&XFFONT_FLAG_BGCOLOR )
13293 + if( f1.m_aBackColor != f2.m_aBackColor )
13294 + return false;
13297 + return true;
13300 +bool operator!=(XFFont& f1, XFFont& f2)
13302 + return !(f1==f2);
13306 +void XFFont::ToXml(IXFStream *pStrm)
13308 + IXFAttrList *pAttrList = pStrm->GetAttrList();
13310 + if( m_nFlag & XFFONT_FLAG_NAME )
13312 + pAttrList->AddAttribute(A2OUSTR("style:font-name"),m_strFontName );
13315 + if( m_nFlag & XFFONT_FLAG_NAME_ASIA )
13317 + pAttrList->AddAttribute(A2OUSTR("style:font-name-asian"),m_strFontNameAsia );
13320 + if( m_nFlag & XFFONT_FLAG_NAME_COMPLEX )
13322 + pAttrList->AddAttribute(A2OUSTR("style:font-name-complex"), m_strFontNameComplex);
13325 + //font size:
13326 + if( (m_nFlag & XFFONT_FLAG_SIZE) && m_nFontSize != 0 )
13327 + {
13328 + rtl::OUString strSize = Int32ToOUString(m_nFontSize);
13329 + strSize += A2OUSTR("pt");
13330 + pAttrList->AddAttribute(A2OUSTR("fo:font-size"),strSize);
13332 + if( (m_nFlag & XFFONT_FLAG_SIZE_ASIA) && m_nFontSizeAsia )
13334 + rtl::OUString strSize = Int32ToOUString(m_nFontSizeAsia);
13335 + strSize += A2OUSTR("pt");
13336 + pAttrList->AddAttribute(A2OUSTR("style:font-size-asian"),strSize);
13338 + if( (m_nFlag & XFFONT_FLAG_SIZE_COMPLEX) && m_nFontSizeComplex )
13340 + rtl::OUString strSize = Int32ToOUString(m_nFontSizeComplex);
13341 + strSize += A2OUSTR("pt");
13342 + pAttrList->AddAttribute(A2OUSTR("style:font-size-complex"),strSize);
13345 + //italic flag:
13346 + if( ( m_nFlag & XFFONT_FLAG_ITALIC) && m_bItalic )
13348 + pAttrList->AddAttribute(A2OUSTR("fo:font-style"), A2OUSTR("italic"));
13350 + if( (m_nFlag & XFFONT_FLAG_ITALIC_ASIA) && m_bItalicAsia )
13352 + pAttrList->AddAttribute(A2OUSTR("style:font-style-asian"), A2OUSTR("italic"));
13354 + if( (m_nFlag & XFFONT_FLAG_ITALIC_COMPLEX) && m_bItalicComplex )
13356 + pAttrList->AddAttribute(A2OUSTR("style:font-style-complex"), A2OUSTR("italic"));
13359 + //Bold flag:
13360 + if( (m_nFlag & XFFONT_FLAG_BOLD) && m_bBold )
13362 + pAttrList->AddAttribute(A2OUSTR("fo:font-weight"), A2OUSTR("bold"));
13364 + if( (m_nFlag & XFFONT_FLAG_BOLD_ASIA) && m_bBoldAsia )
13366 + pAttrList->AddAttribute(A2OUSTR("style:font-weight-asian"), A2OUSTR("bold"));
13368 + if( (m_nFlag & XFFONT_FLAG_BOLD_ASIA) && m_bBoldComplex )
13370 + pAttrList->AddAttribute(A2OUSTR("style:font-weight-complex"), A2OUSTR("bold"));
13372 + //underline:
13373 + if( (m_nFlag & XFFONT_FLAG_UNDERLINE) && m_eUnderline )
13375 + pAttrList->AddAttribute(A2OUSTR("style:text-underline"), GetUnderlineName(m_eUnderline) );
13376 + if( (m_nFlag & XFFONT_FLAG_UNDERLINECOLOR) )
13378 + pAttrList->AddAttribute( A2OUSTR("style:text-underline-color"), m_aUnderlineColor.ToString() );
13380 + else
13381 + pAttrList->AddAttribute( A2OUSTR("style:text-underline-color"), A2OUSTR("font-color") );
13382 + }
13384 + //enumCrossoutType m_eCrossout;
13385 + if( (m_nFlag & XFFONT_FLAG_CROSSOUT) && m_eCrossout )
13387 + pAttrList->AddAttribute(A2OUSTR("style:text-crossing-out"), GetCrossoutName(m_eCrossout) );
13390 + if( m_nFlag & XFFONT_FLAG_UNDERLINE || m_nFlag & XFFONT_FLAG_CROSSOUT )
13392 + if( m_bWordByWord )
13393 + pAttrList->AddAttribute(A2OUSTR("fo:score-spaces"), A2OUSTR("false") );
13394 + else
13395 + pAttrList->AddAttribute(A2OUSTR("fo:score-spaces"), A2OUSTR("true") );
13398 + if( (m_nFlag & XFFONT_FLAG_RELIEF) && m_eRelief )
13400 + pAttrList->AddAttribute(A2OUSTR("style:font-relief"), GetReliefName(m_eRelief) );
13403 + if( (m_nFlag & XFFONT_FLAG_TRANSFORM) && m_eTransform )
13405 + //enumTransformSmallCap is different:
13406 + if( m_eTransform == enumXFTransformSmallCaps )
13407 + pAttrList->AddAttribute(A2OUSTR("fo:font-variant"), GetTransformName(m_eTransform) );
13408 + else
13409 + pAttrList->AddAttribute(A2OUSTR("fo:text-transform"), GetTransformName(m_eTransform) );
13412 + if( (m_nFlag & XFFONT_FLAG_EMPHASIZE) && m_eEmphasize )
13414 + rtl::OUString empha = GetEmphasizeName(m_eEmphasize);
13415 + empha += A2OUSTR(" ");
13416 + if( m_bEmphasizeTop )
13417 + empha += A2OUSTR("above");
13418 + pAttrList->AddAttribute(A2OUSTR("style:text-emphasize"), empha );
13421 + if( (m_nFlag & XFFONT_FLAG_OUTLINE) && m_bOutline )
13423 + pAttrList->AddAttribute(A2OUSTR("style:text-outline"), A2OUSTR("true") );
13426 + if( (m_nFlag & XFFONT_FLAG_SHADOW) && m_bShadow )
13428 + pAttrList->AddAttribute(A2OUSTR("fo:text-shadow"), A2OUSTR("1pt 1pt") );
13431 + if( (m_nFlag & XFFONT_FLAG_BLINK) && m_bBlink )
13433 + pAttrList->AddAttribute(A2OUSTR("style:text-blinking"), A2OUSTR("true") );
13437 + //position & sacle:
13438 + if( ((m_nFlag & XFFONT_FLAG_SCALE) && m_nScale>0 ) ||
13439 + ((m_nFlag & XFFONT_FLAG_POSITION) && m_nPosition != 0)
13442 + rtl::OUString tmp;
13443 + tmp = Int32ToOUString(m_nPosition) + A2OUSTR("% ");
13444 + tmp += Int32ToOUString(m_nScale) + A2OUSTR("%");
13445 + pAttrList->AddAttribute(A2OUSTR("style:text-position"), tmp );
13448 + //char space:
13449 + if( (m_nFlag & XFFONT_FLAG_CHARSPACE) && m_fCharSpace != 0 )
13451 + pAttrList->AddAttribute(A2OUSTR("fo:letter-spacing"), DoubleToOUString(m_fCharSpace)+A2OUSTR("cm") );
13454 + if( (m_nFlag&XFFONT_FLAG_WIDTHSCALE) && m_nWidthScale != 100 )
13456 + pAttrList->AddAttribute(A2OUSTR("style:text-scale"), DoubleToOUString(m_nWidthScale)+A2OUSTR("%") );
13459 + //Color:
13460 + if( (m_nFlag & XFFONT_FLAG_COLOR) )
13462 + pAttrList->AddAttribute( A2OUSTR("fo:color"), m_aColor.ToString() );
13465 + if( (m_nFlag & XFFONT_FLAG_BGCOLOR) )
13467 + if (m_bTransparent)
13468 + pAttrList->AddAttribute( A2OUSTR("style:text-background-color"), A2OUSTR("transparent"));
13469 + else
13470 + pAttrList->AddAttribute( A2OUSTR("style:text-background-color"), m_aBackColor.ToString() );
13475 diff -urNp lotuswordpro.bak/source/filter/xfilter/xffontdecl.cxx lotuswordpro/source/filter/xfilter/xffontdecl.cxx
13476 --- lotuswordpro.bak/source/filter/xfilter/xffontdecl.cxx 1970-01-01 08:00:00.000000000 +0800
13477 +++ lotuswordpro/source/filter/xfilter/xffontdecl.cxx 2008-10-22 11:42:34.000000000 +0800
13478 @@ -0,0 +1,104 @@
13479 +/*************************************************************************
13481 + * The Contents of this file are made available subject to the terms of
13482 + * either of the following licenses
13484 + * - GNU Lesser General Public License Version 2.1
13485 + * - Sun Industry Standards Source License Version 1.1
13487 + * Sun Microsystems Inc., October, 2000
13489 + * GNU Lesser General Public License Version 2.1
13490 + * =============================================
13491 + * Copyright 2000 by Sun Microsystems, Inc.
13492 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
13494 + * This library is free software; you can redistribute it and/or
13495 + * modify it under the terms of the GNU Lesser General Public
13496 + * License version 2.1, as published by the Free Software Foundation.
13498 + * This library is distributed in the hope that it will be useful,
13499 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
13500 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13501 + * Lesser General Public License for more details.
13503 + * You should have received a copy of the GNU Lesser General Public
13504 + * License along with this library; if not, write to the Free Software
13505 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
13506 + * MA 02111-1307 USA
13509 + * Sun Industry Standards Source License Version 1.1
13510 + * =================================================
13511 + * The contents of this file are subject to the Sun Industry Standards
13512 + * Source License Version 1.1 (the "License"); You may not use this file
13513 + * except in compliance with the License. You may obtain a copy of the
13514 + * License at http://www.openoffice.org/license.html.
13516 + * Software provided under this License is provided on an "AS IS" basis,
13517 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
13518 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
13519 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
13520 + * See the License for the specific provisions governing your rights and
13521 + * obligations concerning the Software.
13523 + * The Initial Developer of the Original Code is: IBM Corporation
13525 + * Copyright: 2008 by IBM Corporation
13527 + * All Rights Reserved.
13529 + * Contributor(s): _______________________________________
13532 + ************************************************************************/
13533 +/*************************************************************************
13534 + * @file
13535 + * Font decl of all used fonts.
13536 + ************************************************************************/
13537 +/*************************************************************************
13538 + * Change History
13539 + * 2005-01-21 create this file.
13540 + ************************************************************************/
13541 +#include "xffontdecl.hxx"
13543 +XFFontDecl::XFFontDecl()
13547 +XFFontDecl::XFFontDecl(rtl::OUString name, rtl::OUString family, sal_Bool fixed)
13549 + m_strFontName = name;
13550 + m_strFontFamily = family;
13551 + m_bPitchFixed = fixed;
13554 +rtl::OUString XFFontDecl::GetFontName()
13556 + return m_strFontName;
13559 +void XFFontDecl::SetFontName(rtl::OUString name)
13561 + m_strFontName = name;
13564 +rtl::OUString XFFontDecl::GetFontFamily()
13566 + return m_strFontFamily;
13569 +void XFFontDecl::SetFontFamily(rtl::OUString family)
13571 + m_strFontFamily = family;
13574 +sal_Bool XFFontDecl::GetFontPitchFixed()
13576 + return m_bPitchFixed;
13579 +void XFFontDecl::SetFontPitchFixed(sal_Bool fixed)
13581 + m_bPitchFixed = fixed;
13583 \ No newline at end of file
13584 diff -urNp lotuswordpro.bak/source/filter/xfilter/xffontdecl.hxx lotuswordpro/source/filter/xfilter/xffontdecl.hxx
13585 --- lotuswordpro.bak/source/filter/xfilter/xffontdecl.hxx 1970-01-01 08:00:00.000000000 +0800
13586 +++ lotuswordpro/source/filter/xfilter/xffontdecl.hxx 2008-10-22 11:42:34.000000000 +0800
13587 @@ -0,0 +1,112 @@
13588 +/*************************************************************************
13590 + * The Contents of this file are made available subject to the terms of
13591 + * either of the following licenses
13593 + * - GNU Lesser General Public License Version 2.1
13594 + * - Sun Industry Standards Source License Version 1.1
13596 + * Sun Microsystems Inc., October, 2000
13598 + * GNU Lesser General Public License Version 2.1
13599 + * =============================================
13600 + * Copyright 2000 by Sun Microsystems, Inc.
13601 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
13603 + * This library is free software; you can redistribute it and/or
13604 + * modify it under the terms of the GNU Lesser General Public
13605 + * License version 2.1, as published by the Free Software Foundation.
13607 + * This library is distributed in the hope that it will be useful,
13608 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
13609 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13610 + * Lesser General Public License for more details.
13612 + * You should have received a copy of the GNU Lesser General Public
13613 + * License along with this library; if not, write to the Free Software
13614 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
13615 + * MA 02111-1307 USA
13618 + * Sun Industry Standards Source License Version 1.1
13619 + * =================================================
13620 + * The contents of this file are subject to the Sun Industry Standards
13621 + * Source License Version 1.1 (the "License"); You may not use this file
13622 + * except in compliance with the License. You may obtain a copy of the
13623 + * License at http://www.openoffice.org/license.html.
13625 + * Software provided under this License is provided on an "AS IS" basis,
13626 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
13627 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
13628 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
13629 + * See the License for the specific provisions governing your rights and
13630 + * obligations concerning the Software.
13632 + * The Initial Developer of the Original Code is: IBM Corporation
13634 + * Copyright: 2008 by IBM Corporation
13636 + * All Rights Reserved.
13638 + * Contributor(s): _______________________________________
13641 + ************************************************************************/
13642 +/*************************************************************************
13643 + * @file
13644 + * Font declaration for OOo xml file.This is needed for every font that was
13645 + * used.
13646 + ************************************************************************/
13647 +/*************************************************************************
13648 + * Change History
13649 + * 2004-12-24 create this file.
13650 + ************************************************************************/
13651 +#ifndef _XFFONTDECL_HXX
13652 +#define _XFFONTDECL_HXX
13654 +#include "xfglobal.hxx"
13656 +/**
13657 + * @brief
13658 + * Font declaration in OOo xml file.
13659 + * Each font used should be declared.
13660 + */
13661 +class XFFontDecl
13663 +public:
13664 + XFFontDecl();
13666 + XFFontDecl(rtl::OUString name, rtl::OUString family, sal_Bool fixed = false);
13668 +public:
13669 + /**
13670 + * @descr Get font name.
13671 + */
13672 + rtl::OUString GetFontName();
13674 + /**
13675 + * @descr Set font name.
13676 + */
13677 + void SetFontName(rtl::OUString name);
13679 + /**
13680 + * @descr Get font family.
13681 + */
13682 + rtl::OUString GetFontFamily();
13684 + /**
13685 + * @descr Set font famuly.
13686 + */
13687 + void SetFontFamily(rtl::OUString family);
13689 + sal_Bool GetFontPitchFixed();
13691 + void SetFontPitchFixed(sal_Bool fixed);
13693 +private:
13694 + rtl::OUString m_strFontName;
13695 + rtl::OUString m_strFontFamily;
13696 + sal_Bool m_bPitchFixed;
13699 +#endif
13700 \ No newline at end of file
13701 diff -urNp lotuswordpro.bak/source/filter/xfilter/xffontfactory.cxx lotuswordpro/source/filter/xfilter/xffontfactory.cxx
13702 --- lotuswordpro.bak/source/filter/xfilter/xffontfactory.cxx 1970-01-01 08:00:00.000000000 +0800
13703 +++ lotuswordpro/source/filter/xfilter/xffontfactory.cxx 2008-10-22 11:42:34.000000000 +0800
13704 @@ -0,0 +1,102 @@
13705 +/*************************************************************************
13707 + * The Contents of this file are made available subject to the terms of
13708 + * either of the following licenses
13710 + * - GNU Lesser General Public License Version 2.1
13711 + * - Sun Industry Standards Source License Version 1.1
13713 + * Sun Microsystems Inc., October, 2000
13715 + * GNU Lesser General Public License Version 2.1
13716 + * =============================================
13717 + * Copyright 2000 by Sun Microsystems, Inc.
13718 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
13720 + * This library is free software; you can redistribute it and/or
13721 + * modify it under the terms of the GNU Lesser General Public
13722 + * License version 2.1, as published by the Free Software Foundation.
13724 + * This library is distributed in the hope that it will be useful,
13725 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
13726 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13727 + * Lesser General Public License for more details.
13729 + * You should have received a copy of the GNU Lesser General Public
13730 + * License along with this library; if not, write to the Free Software
13731 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
13732 + * MA 02111-1307 USA
13735 + * Sun Industry Standards Source License Version 1.1
13736 + * =================================================
13737 + * The contents of this file are subject to the Sun Industry Standards
13738 + * Source License Version 1.1 (the "License"); You may not use this file
13739 + * except in compliance with the License. You may obtain a copy of the
13740 + * License at http://www.openoffice.org/license.html.
13742 + * Software provided under this License is provided on an "AS IS" basis,
13743 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
13744 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
13745 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
13746 + * See the License for the specific provisions governing your rights and
13747 + * obligations concerning the Software.
13749 + * The Initial Developer of the Original Code is: IBM Corporation
13751 + * Copyright: 2008 by IBM Corporation
13753 + * All Rights Reserved.
13755 + * Contributor(s): _______________________________________
13758 + ************************************************************************/
13759 +/*************************************************************************
13760 + * @file
13761 + * Implement for font factory which will manage all font.
13762 + ************************************************************************/
13763 +/*************************************************************************
13764 + * Change History
13765 + * 2004-12-23 create this file.
13766 + ************************************************************************/
13767 +#include "xffontfactory.hxx"
13769 +XFFontFactory::XFFontFactory()
13773 +XFFontFactory::~XFFontFactory()
13775 + Reset();
13778 +void XFFontFactory::Reset()
13780 + std::vector<XFFont*>::iterator it;
13781 + for( it = s_aFonts.begin(); it != s_aFonts.end(); it++ )
13783 + XFFont *pFont = (*it);
13784 + if( !pFont )
13785 + continue;
13786 + delete pFont;
13788 + s_aFonts.clear();
13791 +void XFFontFactory::AddFont(XFFont *pFont)
13793 + s_aFonts.push_back( pFont );
13796 +XFFont* XFFontFactory::FindSameFont(XFFont *pFont)
13798 + std::vector<XFFont*>::iterator it;
13799 + for( it = s_aFonts.begin(); it != s_aFonts.end(); it++ )
13801 + if( *pFont == **it )
13802 + return *it;
13805 + return NULL;
13807 \ No newline at end of file
13808 diff -urNp lotuswordpro.bak/source/filter/xfilter/xffontfactory.hxx lotuswordpro/source/filter/xfilter/xffontfactory.hxx
13809 --- lotuswordpro.bak/source/filter/xfilter/xffontfactory.hxx 1970-01-01 08:00:00.000000000 +0800
13810 +++ lotuswordpro/source/filter/xfilter/xffontfactory.hxx 2008-10-22 11:42:34.000000000 +0800
13811 @@ -0,0 +1,110 @@
13812 +/*************************************************************************
13814 + * The Contents of this file are made available subject to the terms of
13815 + * either of the following licenses
13817 + * - GNU Lesser General Public License Version 2.1
13818 + * - Sun Industry Standards Source License Version 1.1
13820 + * Sun Microsystems Inc., October, 2000
13822 + * GNU Lesser General Public License Version 2.1
13823 + * =============================================
13824 + * Copyright 2000 by Sun Microsystems, Inc.
13825 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
13827 + * This library is free software; you can redistribute it and/or
13828 + * modify it under the terms of the GNU Lesser General Public
13829 + * License version 2.1, as published by the Free Software Foundation.
13831 + * This library is distributed in the hope that it will be useful,
13832 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
13833 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13834 + * Lesser General Public License for more details.
13836 + * You should have received a copy of the GNU Lesser General Public
13837 + * License along with this library; if not, write to the Free Software
13838 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
13839 + * MA 02111-1307 USA
13842 + * Sun Industry Standards Source License Version 1.1
13843 + * =================================================
13844 + * The contents of this file are subject to the Sun Industry Standards
13845 + * Source License Version 1.1 (the "License"); You may not use this file
13846 + * except in compliance with the License. You may obtain a copy of the
13847 + * License at http://www.openoffice.org/license.html.
13849 + * Software provided under this License is provided on an "AS IS" basis,
13850 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
13851 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
13852 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
13853 + * See the License for the specific provisions governing your rights and
13854 + * obligations concerning the Software.
13856 + * The Initial Developer of the Original Code is: IBM Corporation
13858 + * Copyright: 2008 by IBM Corporation
13860 + * All Rights Reserved.
13862 + * Contributor(s): _______________________________________
13865 + ************************************************************************/
13866 +/*************************************************************************
13867 + * @file
13868 + * Factory object for XFFont.It also manages all font life cycle.
13869 + ************************************************************************/
13870 +/*************************************************************************
13871 + * Change History
13872 + * 2004-12-23 create this file.
13873 + ************************************************************************/
13874 +#ifndef _XFFONTFACTORY_HXX
13875 +#define _XFFONTFACTORY_HXX
13877 +#include "xfglobal.hxx"
13878 +#include "xffont.hxx"
13879 +#include <vector>
13881 +/**
13882 + * @brief
13883 + * Font factory.
13884 + * Because font object are so used so offten, so make a factory to manager them.
13885 + * The fonts with same properties will only exist one instance.
13886 + */
13887 +class XFFontFactory
13889 +public:
13890 + XFFontFactory();
13891 + ~XFFontFactory();
13892 + XFFontFactory(const XFFontFactory& other){}
13894 + XFFontFactory operator=(XFFontFactory& other){}
13896 +public:
13897 + /**
13898 + * @descr Clear all fonts, this is called when load a file.
13899 + */
13900 + void Reset();
13902 +private:
13903 + /**
13904 + * @descr Add a font. if there exist a font with same properties with pFont, them the font obejct
13905 + * will not be added.
13906 + */
13907 + void AddFont(XFFont *pFont);
13909 + /**
13910 + * @descr Find whether same font obejct exists.
13911 + */
13912 + XFFont* FindSameFont(XFFont *pFont);
13914 + friend class XFStyleContainer;
13916 +private:
13917 + std::vector<XFFont*> s_aFonts;
13920 +#endif
13922 diff -urNp lotuswordpro.bak/source/filter/xfilter/xffont.hxx lotuswordpro/source/filter/xfilter/xffont.hxx
13923 --- lotuswordpro.bak/source/filter/xfilter/xffont.hxx 1970-01-01 08:00:00.000000000 +0800
13924 +++ lotuswordpro/source/filter/xfilter/xffont.hxx 2008-10-22 11:42:34.000000000 +0800
13925 @@ -0,0 +1,509 @@
13926 +/*************************************************************************
13928 + * The Contents of this file are made available subject to the terms of
13929 + * either of the following licenses
13931 + * - GNU Lesser General Public License Version 2.1
13932 + * - Sun Industry Standards Source License Version 1.1
13934 + * Sun Microsystems Inc., October, 2000
13936 + * GNU Lesser General Public License Version 2.1
13937 + * =============================================
13938 + * Copyright 2000 by Sun Microsystems, Inc.
13939 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
13941 + * This library is free software; you can redistribute it and/or
13942 + * modify it under the terms of the GNU Lesser General Public
13943 + * License version 2.1, as published by the Free Software Foundation.
13945 + * This library is distributed in the hope that it will be useful,
13946 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
13947 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13948 + * Lesser General Public License for more details.
13950 + * You should have received a copy of the GNU Lesser General Public
13951 + * License along with this library; if not, write to the Free Software
13952 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
13953 + * MA 02111-1307 USA
13956 + * Sun Industry Standards Source License Version 1.1
13957 + * =================================================
13958 + * The contents of this file are subject to the Sun Industry Standards
13959 + * Source License Version 1.1 (the "License"); You may not use this file
13960 + * except in compliance with the License. You may obtain a copy of the
13961 + * License at http://www.openoffice.org/license.html.
13963 + * Software provided under this License is provided on an "AS IS" basis,
13964 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
13965 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
13966 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
13967 + * See the License for the specific provisions governing your rights and
13968 + * obligations concerning the Software.
13970 + * The Initial Developer of the Original Code is: IBM Corporation
13972 + * Copyright: 2008 by IBM Corporation
13974 + * All Rights Reserved.
13976 + * Contributor(s): _______________________________________
13979 + ************************************************************************/
13980 +/*************************************************************************
13981 + * @file
13982 + * Font object to serial to xml filter.
13983 + ************************************************************************/
13984 +/*************************************************************************
13985 + * Change History
13986 + * 2004-12-23 create this file.
13987 + ************************************************************************/
13988 +#ifndef _XFFONT_HXX
13989 +#define _XFFONT_HXX
13991 +#include "xfglobal.hxx"
13992 +#include "xfcolor.hxx"
13994 +#define XFFONT_FLAG_NAME 0X00000001
13995 +#define XFFONT_FLAG_NAME_ASIA 0X00000002
13996 +#define XFFONT_FLAG_NAME_COMPLEX 0X00000004
13998 +#define XFFONT_FLAG_SIZE 0X00000008
13999 +#define XFFONT_FLAG_SIZE_ASIA 0X00000010
14000 +#define XFFONT_FLAG_SIZE_COMPLEX 0X00000020
14002 +#define XFFONT_FLAG_ITALIC 0X00000040
14003 +#define XFFONT_FLAG_ITALIC_ASIA 0X00000080
14004 +#define XFFONT_FLAG_ITALIC_COMPLEX 0X00000100
14006 +#define XFFONT_FLAG_BOLD 0X00000200
14007 +#define XFFONT_FLAG_BOLD_ASIA 0X00000400
14008 +#define XFFONT_FLAG_BOLD_COMPLEX 0X00000800
14010 +#define XFFONT_FLAG_UNDERLINE 0X00001000
14011 +#define XFFONT_FLAG_UNDERLINECOLOR 0X00002000
14013 +#define XFFONT_FLAG_POSITION 0X00004000
14014 +#define XFFONT_FLAG_SCALE 0X00008000
14015 +#define XFFONT_FLAG_CHARSPACE 0x00010000
14017 +#define XFFONT_FLAG_COLOR 0x00020000
14018 +#define XFFONT_FLAG_BGCOLOR 0x00040000
14020 +#define XFFONT_FLAG_CROSSOUT 0x00080000
14021 +#define XFFONT_FLAG_RELIEF 0x00100000
14022 +#define XFFONT_FLAG_TRANSFORM 0x00200000
14023 +#define XFFONT_FLAG_EMPHASIZE 0x00400000
14024 +#define XFFONT_FLAG_OUTLINE 0x00800000
14025 +#define XFFONT_FLAG_SHADOW 0x01000000
14026 +#define XFFONT_FLAG_BLINK 0x02000000
14027 +#define XFFONT_FLAG_WIDTHSCALE 0x04000000
14029 +/**
14030 + * @descr
14031 + * The font struct of openoffice xml filter.
14032 + * There should be some basic members,ie:
14034 + * font name
14035 + * font family
14036 + * font size
14037 + * font italic
14038 + * font bold
14039 + * font underline
14040 + * font underline color
14041 + */
14042 +class XFFont
14044 +public:
14045 + XFFont();
14047 +public:
14048 + /**
14049 + * @descr Set font name.
14050 + */
14051 + void SetFontName(rtl::OUString name);
14053 + /**
14054 + * @descr Set font name for asia locale.
14055 + */
14056 + void SetFontNameAsia(rtl::OUString name);
14058 + /**
14059 + * @descr Set font name for BIDI locale.
14060 + */
14061 + void SetFontNameComplex(rtl::OUString name);
14063 + /**
14064 + * @descr Set font size.
14065 + */
14066 + void SetFontSize(sal_Int16 size);
14068 + /**
14069 + * @descr Set font size for asia locale.
14070 + */
14071 + void SetFontSizeAsia(sal_Int16 size);
14073 + /**
14074 + * @descr Set font size for BIDI locale.
14075 + */
14076 + void SetFontSizeComplex(sal_Int16 size);
14078 + /**
14079 + * @descr Set whether font is italic.
14080 + */
14081 + void SetItalic(sal_Bool italic = true);
14083 + /**
14084 + * @descr Set whether font is italic for asia locale.
14085 + */
14086 + void SetItalicAsia(sal_Bool italic);
14088 + /**
14089 + * @descr Set whether font is italic for BIDI locale.
14090 + */
14091 + void SetItalicComplex(sal_Bool italic);
14093 + /**
14094 + * @descr Set font bold.
14095 + */
14096 + void SetBold(sal_Bool bold = true);
14098 + /**
14099 + * @descr Set font bold for asia locale.
14100 + */
14101 + void SetBoldAsia(sal_Bool bold);
14103 + /**
14104 + * @descr Set font bold for complex locale.
14105 + */
14106 + void SetBoldComplex(sal_Bool bold);
14108 + /**
14109 + * @descr Set underline style.
14110 + */
14111 + void SetUnderline(enumXFUnderline underline,sal_Bool wordByWord=sal_False);
14113 + /**
14114 + * @descr Set underline color.
14115 + */
14116 + void SetUnderlineColor(XFColor color=XFColor(128,128,0));
14118 + /**
14119 + * @descr Set crossout.
14120 + */
14121 + void SetCrossout(enumXFCrossout cross,sal_Bool wordByWord=sal_False);
14123 + /**
14124 + * @descr Set font relief.
14125 + */
14126 + void SetRelief(enumXFRelief relief);
14128 + /**
14129 + * @descr Set font transform type,pls refer to enumXFTransform.
14130 + */
14131 + void SetTransform(enumXFTransform transform);
14133 + /**
14134 + * @descr Set font emphasize effect.
14135 + */
14136 + void SetEmphasize(enumXFEmphasize emphasize, sal_Bool top = sal_True);
14138 + /**
14139 + * @descr Set outline effect.
14140 + */
14141 + void SetOutline(sal_Bool outline);
14143 + /**
14144 + * @descr Set font shadow.
14145 + */
14146 + void SetShadow(sal_Bool shadow);
14148 + /**
14149 + * @descr Set font blink effect.
14150 + */
14151 + void SetBlink(sal_Bool blink);
14153 + /**
14154 + * @descr Set upper script or lower script.
14155 + */
14156 + void SetPosition(sal_Bool bUpperScript = sal_True, sal_Int16 pos = 33, sal_Int16 scale = 58);
14158 + /**
14159 + * @descr Set space between chars in percent.
14160 + */
14161 + void SetCharSpace(sal_Int16 space);
14163 + /**
14164 + * @descr Set char width scale in percent.
14165 + */
14166 + void SetWidthScale(sal_Int16 widthScale);
14168 + /**
14169 + * @descr Set font color.
14170 + */
14171 + void SetColor(XFColor& color);
14173 + /**
14174 + * @descr Set font background color.
14175 + */
14176 + void SetBackColor(XFColor& color);
14177 + void SetBackColorTransparent();
14179 + //getter:
14180 + enumXFTransform GetTransform();
14182 + sal_Int16 GetFontSize();
14183 + XFColor GetColor();
14185 + sal_uInt32 GetFlag(){ return m_nFlag; }
14187 + void ToXml(IXFStream *pStrm);
14189 + friend bool operator==(XFFont& f1, XFFont& f2);
14190 + friend bool operator!=(XFFont& f1, XFFont& f2);
14191 + friend class XFFontFactory;
14192 +private:
14193 + rtl::OUString m_strFontName;
14194 + rtl::OUString m_strFontNameAsia;
14195 + rtl::OUString m_strFontNameComplex;
14196 + sal_Int16 m_nFontSize;
14197 + sal_Int16 m_nFontSizeAsia;
14198 + sal_Int16 m_nFontSizeComplex;
14199 + sal_Bool m_bItalic;
14200 + sal_Bool m_bItalicAsia;
14201 + sal_Bool m_bItalicComplex;
14202 + sal_Bool m_bBold;
14203 + sal_Bool m_bBoldAsia;
14204 + sal_Bool m_bBoldComplex;
14205 + XFColor m_aUnderlineColor;
14207 + enumXFUnderline m_eUnderline;
14208 + enumXFCrossout m_eCrossout;
14209 + enumXFRelief m_eRelief;
14210 + enumXFTransform m_eTransform;
14211 + enumXFEmphasize m_eEmphasize;
14212 + sal_Bool m_bWordByWord;
14213 + sal_Bool m_bEmphasizeTop;
14214 + sal_Bool m_bOutline;
14215 + sal_Bool m_bShadow;
14216 + sal_Bool m_bBlink;
14217 + sal_Int16 m_nPosition;
14218 + sal_Int16 m_nScale;
14219 + double m_fCharSpace;
14220 + sal_Int16 m_nWidthScale;
14221 + XFColor m_aColor;
14222 + XFColor m_aBackColor;
14223 + //The flag defines which variable will be funtional.
14224 + sal_uInt32 m_nFlag;
14225 + sal_Bool m_bTransparent;
14229 +inline void XFFont::SetFontName(rtl::OUString name)
14231 + m_strFontName = name;
14232 + m_nFlag |= XFFONT_FLAG_NAME;
14234 + SetFontNameAsia(name);
14235 + SetFontNameComplex(name);
14238 +inline void XFFont::SetFontNameAsia(rtl::OUString name)
14240 + m_strFontNameAsia = name;
14241 + m_nFlag |= XFFONT_FLAG_NAME_ASIA;
14244 +inline void XFFont::SetFontNameComplex(rtl::OUString name)
14246 + m_strFontNameComplex = name;
14247 + m_nFlag |= XFFONT_FLAG_NAME_COMPLEX;
14251 +inline void XFFont::SetFontSize(sal_Int16 size)
14253 + m_nFontSize = size;
14254 + m_nFlag |= XFFONT_FLAG_SIZE;
14256 + SetFontSizeAsia(size);
14257 + SetFontSizeComplex(size);
14260 +inline void XFFont::SetFontSizeAsia(sal_Int16 size)
14262 + m_nFontSizeAsia = size;
14263 + m_nFlag |= XFFONT_FLAG_SIZE_ASIA;
14266 +inline void XFFont::SetFontSizeComplex(sal_Int16 size)
14268 + m_nFontSizeComplex = size;
14269 + m_nFlag |= XFFONT_FLAG_SIZE_COMPLEX;
14272 +//---------Italic:
14273 +inline void XFFont::SetItalic(sal_Bool italic)
14275 + m_bItalic = italic;
14276 + m_nFlag |= XFFONT_FLAG_ITALIC;
14278 + SetItalicAsia(italic);
14279 + SetItalicComplex(italic);
14282 +inline void XFFont::SetItalicAsia(sal_Bool italic)
14284 + m_bItalicAsia = italic;
14285 + m_nFlag |= XFFONT_FLAG_ITALIC_ASIA;
14288 +inline void XFFont::SetItalicComplex(sal_Bool italic)
14290 + m_bItalicComplex = italic;
14291 + m_nFlag |= XFFONT_FLAG_ITALIC_COMPLEX;
14294 +//--------Bold
14295 +inline void XFFont::SetBold(sal_Bool bold)
14297 + m_bBold = bold;
14298 + m_nFlag |= XFFONT_FLAG_BOLD;
14299 + SetBoldAsia(bold);
14300 + SetBoldComplex(bold);
14303 +inline void XFFont::SetBoldAsia(sal_Bool bold)
14305 + m_bBoldAsia = bold;
14306 + m_nFlag |= XFFONT_FLAG_BOLD_ASIA;
14309 +inline void XFFont::SetBoldComplex(sal_Bool bold)
14311 + m_bBoldComplex = bold;
14312 + m_nFlag |= XFFONT_FLAG_BOLD_COMPLEX;
14315 +//--------Underline:
14316 +inline void XFFont::SetUnderline(enumXFUnderline underline, sal_Bool wordByWord)
14318 + m_eUnderline = underline;
14319 + m_bWordByWord = wordByWord;
14320 + m_nFlag |= XFFONT_FLAG_UNDERLINE;
14323 +inline void XFFont::SetUnderlineColor(XFColor color)
14325 + m_aUnderlineColor = color;
14326 + m_nFlag |= XFFONT_FLAG_UNDERLINECOLOR;
14329 +inline void XFFont::SetCrossout(enumXFCrossout cross, sal_Bool wordByWord)
14331 + m_eCrossout = cross;
14332 + m_bWordByWord = wordByWord;
14333 + m_nFlag |= XFFONT_FLAG_CROSSOUT;
14335 +inline void XFFont::SetRelief(enumXFRelief relief)
14337 + m_eRelief = relief;
14338 + m_nFlag |= XFFONT_FLAG_RELIEF;
14340 +inline void XFFont::SetTransform(enumXFTransform transform)
14342 + m_eTransform = transform;
14343 + m_nFlag |= XFFONT_FLAG_TRANSFORM;
14346 +inline void XFFont::SetEmphasize(enumXFEmphasize emphasize, sal_Bool top)
14348 + m_eEmphasize = emphasize;
14349 + m_bEmphasizeTop = top;
14350 + m_nFlag |= XFFONT_FLAG_EMPHASIZE;
14352 +inline void XFFont::SetOutline(sal_Bool outline)
14354 + m_bOutline = outline;
14355 + m_nFlag |= XFFONT_FLAG_OUTLINE;
14357 +inline void XFFont::SetShadow(sal_Bool shadow)
14359 + m_bShadow = shadow;
14360 + m_nFlag |= XFFONT_FLAG_SHADOW;
14362 +inline void XFFont::SetBlink(sal_Bool blink)
14364 + m_bBlink = blink;
14365 + m_nFlag |= XFFONT_FLAG_BLINK;
14368 +inline void XFFont::SetPosition(sal_Bool bUpperScript, sal_Int16 pos, sal_Int16 scale)
14370 + assert(pos>=0&&pos<=100);
14371 + assert(scale>0&&scale<=100);
14372 + m_nFlag |= XFFONT_FLAG_POSITION;
14373 + m_nPosition = pos;
14374 + m_nScale = scale;
14375 + if( bUpperScript )
14377 + if( m_nPosition <0 )
14378 + m_nPosition = -m_nPosition;
14380 + else
14382 + if( m_nPosition >0 )
14383 + m_nPosition = -m_nPosition;
14387 +inline void XFFont::SetCharSpace(sal_Int16 space)
14389 + m_nFlag |= XFFONT_FLAG_CHARSPACE;
14390 + m_fCharSpace = space;
14393 +inline void XFFont::SetWidthScale(sal_Int16 widthScale)
14395 + m_nFlag |= XFFONT_FLAG_WIDTHSCALE;
14396 + m_nWidthScale = widthScale;
14399 +inline void XFFont::SetColor(XFColor& color)
14401 + m_nFlag |= XFFONT_FLAG_COLOR;
14402 + m_aColor = color;
14405 +inline void XFFont::SetBackColor(XFColor& color)
14407 + m_bTransparent = sal_False;
14408 + m_nFlag |= XFFONT_FLAG_BGCOLOR;
14409 + m_aBackColor = color;
14412 +inline void XFFont::SetBackColorTransparent()
14414 + m_bTransparent = sal_True;
14415 + m_nFlag |= XFFONT_FLAG_BGCOLOR;
14418 +inline enumXFTransform XFFont::GetTransform()
14420 + return m_eTransform;
14423 +inline sal_Int16 XFFont::GetFontSize()
14425 + return m_nFontSize;
14428 +inline XFColor XFFont::GetColor()
14430 + return m_aColor;
14433 +#endif
14435 diff -urNp lotuswordpro.bak/source/filter/xfilter/xffontworkstyle.hxx lotuswordpro/source/filter/xfilter/xffontworkstyle.hxx
14436 --- lotuswordpro.bak/source/filter/xfilter/xffontworkstyle.hxx 1970-01-01 08:00:00.000000000 +0800
14437 +++ lotuswordpro/source/filter/xfilter/xffontworkstyle.hxx 2008-10-22 11:42:34.000000000 +0800
14438 @@ -0,0 +1,156 @@
14439 +/*************************************************************************
14441 + * The Contents of this file are made available subject to the terms of
14442 + * either of the following licenses
14444 + * - GNU Lesser General Public License Version 2.1
14445 + * - Sun Industry Standards Source License Version 1.1
14447 + * Sun Microsystems Inc., October, 2000
14449 + * GNU Lesser General Public License Version 2.1
14450 + * =============================================
14451 + * Copyright 2000 by Sun Microsystems, Inc.
14452 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
14454 + * This library is free software; you can redistribute it and/or
14455 + * modify it under the terms of the GNU Lesser General Public
14456 + * License version 2.1, as published by the Free Software Foundation.
14458 + * This library is distributed in the hope that it will be useful,
14459 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
14460 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14461 + * Lesser General Public License for more details.
14463 + * You should have received a copy of the GNU Lesser General Public
14464 + * License along with this library; if not, write to the Free Software
14465 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
14466 + * MA 02111-1307 USA
14469 + * Sun Industry Standards Source License Version 1.1
14470 + * =================================================
14471 + * The contents of this file are subject to the Sun Industry Standards
14472 + * Source License Version 1.1 (the "License"); You may not use this file
14473 + * except in compliance with the License. You may obtain a copy of the
14474 + * License at http://www.openoffice.org/license.html.
14476 + * Software provided under this License is provided on an "AS IS" basis,
14477 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
14478 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
14479 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
14480 + * See the License for the specific provisions governing your rights and
14481 + * obligations concerning the Software.
14483 + * The Initial Developer of the Original Code is: IBM Corporation
14485 + * Copyright: 2008 by IBM Corporation
14487 + * All Rights Reserved.
14489 + * Contributor(s): _______________________________________
14492 + ************************************************************************/
14493 +/*************************************************************************
14494 + * @file
14495 + * Style of Fontwork object.
14496 + ************************************************************************/
14497 +/*************************************************************************
14498 + * Change History
14499 + * 2005-06-20 create this file.
14500 + ************************************************************************/
14501 + #ifndef _XFFONTWORKSTYLE_HXX
14502 + #define _XFFONTWORKSTYLE_HXX
14504 +#include "xfstyle.hxx"
14506 +class XFFontWorkStyle
14508 +public:
14509 + XFFontWorkStyle() :
14510 + m_nButtonForm(-1),
14511 + m_bHideForm(sal_True),
14512 + m_fDistance(-0.10),
14513 + m_eStyleType(enumXFFWOff),
14514 + m_eAdjustType(enumXFFWAdjustAutosize),
14515 + m_eShadowType(enumXFFWShadowNone)
14516 + {};
14518 + ~XFFontWorkStyle(){}
14520 + inline void SetButtonForm(sal_Int8 nIndex);
14521 + inline void SetHideForm(sal_Bool bHide);
14522 + inline void SetFWDistance(double fDist);
14523 + inline void SetFWStyleType(enumXFFWStyle eStyle);
14524 + inline void SetFWAdjustType(enumXFFWAdjust eAdjust);
14525 + inline void SetFWShadowType(enumXFFWShadow eShadow);
14527 + inline sal_Int8 GetButtonForm() const;
14528 + inline double GetFWDistance() const;
14529 + inline enumXFFWStyle GetStyleType() const;
14530 + inline enumXFFWAdjust GetAdjustType() const;
14531 + inline enumXFFWShadow GetShadowType() const;
14533 +private:
14534 + sal_Int8 m_nButtonForm;
14535 + sal_Bool m_bHideForm;
14536 + double m_fDistance;
14537 + enumXFFWStyle m_eStyleType;
14538 + enumXFFWAdjust m_eAdjustType;
14539 + enumXFFWShadow m_eShadowType;
14542 +inline void XFFontWorkStyle::SetButtonForm(sal_Int8 nIndex)
14544 + m_nButtonForm = nIndex;
14547 +inline void XFFontWorkStyle::SetHideForm(sal_Bool bHide)
14549 + m_bHideForm = bHide;
14552 +inline void XFFontWorkStyle::SetFWDistance(double fDist)
14554 + m_fDistance = fDist;
14557 +inline void XFFontWorkStyle::SetFWStyleType(enumXFFWStyle eStyle)
14559 + m_eStyleType = eStyle;
14562 +inline void XFFontWorkStyle::SetFWAdjustType(enumXFFWAdjust eAdjust)
14564 + m_eAdjustType = eAdjust;
14567 +inline void XFFontWorkStyle::SetFWShadowType(enumXFFWShadow eShadow)
14569 + m_eShadowType = eShadow;
14572 +inline sal_Int8 XFFontWorkStyle::GetButtonForm() const
14574 + return m_nButtonForm;
14576 +inline double XFFontWorkStyle::GetFWDistance() const
14578 + return m_fDistance;
14581 +inline enumXFFWStyle XFFontWorkStyle::GetStyleType() const
14583 + return m_eStyleType;
14585 +inline enumXFFWAdjust XFFontWorkStyle::GetAdjustType() const
14587 + return m_eAdjustType;
14589 +inline enumXFFWShadow XFFontWorkStyle::GetShadowType() const
14591 + return m_eShadowType;
14594 +#endif
14595 diff -urNp lotuswordpro.bak/source/filter/xfilter/xffooter.hxx lotuswordpro/source/filter/xfilter/xffooter.hxx
14596 --- lotuswordpro.bak/source/filter/xfilter/xffooter.hxx 1970-01-01 08:00:00.000000000 +0800
14597 +++ lotuswordpro/source/filter/xfilter/xffooter.hxx 2008-10-22 11:42:34.000000000 +0800
14598 @@ -0,0 +1,90 @@
14599 +/*************************************************************************
14601 + * The Contents of this file are made available subject to the terms of
14602 + * either of the following licenses
14604 + * - GNU Lesser General Public License Version 2.1
14605 + * - Sun Industry Standards Source License Version 1.1
14607 + * Sun Microsystems Inc., October, 2000
14609 + * GNU Lesser General Public License Version 2.1
14610 + * =============================================
14611 + * Copyright 2000 by Sun Microsystems, Inc.
14612 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
14614 + * This library is free software; you can redistribute it and/or
14615 + * modify it under the terms of the GNU Lesser General Public
14616 + * License version 2.1, as published by the Free Software Foundation.
14618 + * This library is distributed in the hope that it will be useful,
14619 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
14620 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14621 + * Lesser General Public License for more details.
14623 + * You should have received a copy of the GNU Lesser General Public
14624 + * License along with this library; if not, write to the Free Software
14625 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
14626 + * MA 02111-1307 USA
14629 + * Sun Industry Standards Source License Version 1.1
14630 + * =================================================
14631 + * The contents of this file are subject to the Sun Industry Standards
14632 + * Source License Version 1.1 (the "License"); You may not use this file
14633 + * except in compliance with the License. You may obtain a copy of the
14634 + * License at http://www.openoffice.org/license.html.
14636 + * Software provided under this License is provided on an "AS IS" basis,
14637 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
14638 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
14639 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
14640 + * See the License for the specific provisions governing your rights and
14641 + * obligations concerning the Software.
14643 + * The Initial Developer of the Original Code is: IBM Corporation
14645 + * Copyright: 2008 by IBM Corporation
14647 + * All Rights Reserved.
14649 + * Contributor(s): _______________________________________
14652 + ************************************************************************/
14653 +/*************************************************************************
14654 + * @file
14655 + * Footer object.
14656 + ************************************************************************/
14657 +/*************************************************************************
14658 + * Change History
14659 + * 2005-01-19 create this file.
14660 + * 2005-04-05 make it derive from XFContentContainer.
14661 + ************************************************************************/
14662 +#ifndef _XFFOOTER_HXX
14663 +#define _XFFOOTER_HXX
14665 +#include "xfcontentcontainer.hxx"
14666 +#include <vector>
14668 +/**
14669 + * @descr Foot obejct. It's just a container.
14670 + */
14671 +class XFFooter : public XFContentContainer
14673 +public:
14674 + XFFooter()
14677 + virtual void ToXml(IXFStream *pStrm)
14679 + IXFAttrList *pAttrList = pStrm->GetAttrList();
14680 + pAttrList->Clear();
14681 + pStrm->StartElement( A2OUSTR("style:footer") );
14682 + XFContentContainer::ToXml(pStrm);
14683 + pStrm->EndElement( A2OUSTR("style:footer") );
14687 +#endif
14689 diff -urNp lotuswordpro.bak/source/filter/xfilter/xffooterstyle.hxx lotuswordpro/source/filter/xfilter/xffooterstyle.hxx
14690 --- lotuswordpro.bak/source/filter/xfilter/xffooterstyle.hxx 1970-01-01 08:00:00.000000000 +0800
14691 +++ lotuswordpro/source/filter/xfilter/xffooterstyle.hxx 2008-10-22 11:42:34.000000000 +0800
14692 @@ -0,0 +1,126 @@
14693 +/*************************************************************************
14695 + * The Contents of this file are made available subject to the terms of
14696 + * either of the following licenses
14698 + * - GNU Lesser General Public License Version 2.1
14699 + * - Sun Industry Standards Source License Version 1.1
14701 + * Sun Microsystems Inc., October, 2000
14703 + * GNU Lesser General Public License Version 2.1
14704 + * =============================================
14705 + * Copyright 2000 by Sun Microsystems, Inc.
14706 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
14708 + * This library is free software; you can redistribute it and/or
14709 + * modify it under the terms of the GNU Lesser General Public
14710 + * License version 2.1, as published by the Free Software Foundation.
14712 + * This library is distributed in the hope that it will be useful,
14713 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
14714 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14715 + * Lesser General Public License for more details.
14717 + * You should have received a copy of the GNU Lesser General Public
14718 + * License along with this library; if not, write to the Free Software
14719 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
14720 + * MA 02111-1307 USA
14723 + * Sun Industry Standards Source License Version 1.1
14724 + * =================================================
14725 + * The contents of this file are subject to the Sun Industry Standards
14726 + * Source License Version 1.1 (the "License"); You may not use this file
14727 + * except in compliance with the License. You may obtain a copy of the
14728 + * License at http://www.openoffice.org/license.html.
14730 + * Software provided under this License is provided on an "AS IS" basis,
14731 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
14732 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
14733 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
14734 + * See the License for the specific provisions governing your rights and
14735 + * obligations concerning the Software.
14737 + * The Initial Developer of the Original Code is: IBM Corporation
14739 + * Copyright: 2008 by IBM Corporation
14741 + * All Rights Reserved.
14743 + * Contributor(s): _______________________________________
14746 + ************************************************************************/
14747 +/*************************************************************************
14748 + * @file
14749 + * Footer style,exist in page-master object.
14750 + ************************************************************************/
14751 +/*************************************************************************
14752 + * Change History
14753 + * 2005-01-19 create this file.
14754 + * 2005-04-05 change to inherit from xfheaderstyle.
14755 + ************************************************************************/
14756 +#ifndef _XFFOOTERSTYLE_HXX
14757 +#define _XFFOOTERSTYLE_HXX
14759 +#include "xfheaderstyle.hxx"
14760 +#include "xfmargins.hxx"
14762 +class XFFooterStyle : public XFHeaderStyle
14764 +public:
14765 + XFFooterStyle() : XFHeaderStyle(sal_True)
14769 + void SetMargins(double left = -1, double right = -1, double top = -1)
14771 + if( left != -1 )
14772 + m_aMargin.SetLeft(left);
14773 + if( right != -1 )
14774 + m_aMargin.SetRight(right);
14775 + if( top != -1 )
14776 + m_aMargin.SetTop(top);
14779 + void SetHeight(float height)
14781 + m_fHeight = height;
14784 + void SetDynamicSpace(sal_Bool dynamic)
14786 + m_bDynamicSpace = dynamic;
14788 + virtual void ToXml(IXFStream *pStrm)
14790 + IXFAttrList *pAttrList = pStrm->GetAttrList();
14791 + pAttrList->Clear();
14793 + pStrm->StartElement( A2OUSTR("style:footer-style") );
14795 + if(m_fHeight!=-1)
14797 + pAttrList->AddAttribute( A2OUSTR("svg:height"), FloatToOUString(m_fHeight) + A2OUSTR("cm") );
14800 + m_aMargin.ToXml(pStrm);
14801 + if( m_bDynamicSpace )
14802 + pAttrList->AddAttribute( A2OUSTR("style:dynamic-spacing"), A2OUSTR("true") );
14803 + else
14804 + pAttrList->AddAttribute( A2OUSTR("style:dynamic-spacing"), A2OUSTR("false") );
14805 + pStrm->StartElement( A2OUSTR("style:properties") );
14806 + pStrm->EndElement( A2OUSTR("style:properties") );
14808 + pStrm->EndElement( A2OUSTR("style:footer-style") );
14811 +private:
14812 + XFMargins m_aMargin;
14813 + sal_Bool m_bDynamicSpace;
14814 + float m_fHeight;
14815 + */
14818 +#endif
14819 \ No newline at end of file
14820 diff -urNp lotuswordpro.bak/source/filter/xfilter/xffootnoteconfig.hxx lotuswordpro/source/filter/xfilter/xffootnoteconfig.hxx
14821 --- lotuswordpro.bak/source/filter/xfilter/xffootnoteconfig.hxx 1970-01-01 08:00:00.000000000 +0800
14822 +++ lotuswordpro/source/filter/xfilter/xffootnoteconfig.hxx 2008-10-22 11:42:34.000000000 +0800
14823 @@ -0,0 +1,269 @@
14824 +/*************************************************************************
14826 + * The Contents of this file are made available subject to the terms of
14827 + * either of the following licenses
14829 + * - GNU Lesser General Public License Version 2.1
14830 + * - Sun Industry Standards Source License Version 1.1
14832 + * Sun Microsystems Inc., October, 2000
14834 + * GNU Lesser General Public License Version 2.1
14835 + * =============================================
14836 + * Copyright 2000 by Sun Microsystems, Inc.
14837 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
14839 + * This library is free software; you can redistribute it and/or
14840 + * modify it under the terms of the GNU Lesser General Public
14841 + * License version 2.1, as published by the Free Software Foundation.
14843 + * This library is distributed in the hope that it will be useful,
14844 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
14845 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14846 + * Lesser General Public License for more details.
14848 + * You should have received a copy of the GNU Lesser General Public
14849 + * License along with this library; if not, write to the Free Software
14850 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
14851 + * MA 02111-1307 USA
14854 + * Sun Industry Standards Source License Version 1.1
14855 + * =================================================
14856 + * The contents of this file are subject to the Sun Industry Standards
14857 + * Source License Version 1.1 (the "License"); You may not use this file
14858 + * except in compliance with the License. You may obtain a copy of the
14859 + * License at http://www.openoffice.org/license.html.
14861 + * Software provided under this License is provided on an "AS IS" basis,
14862 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
14863 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
14864 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
14865 + * See the License for the specific provisions governing your rights and
14866 + * obligations concerning the Software.
14868 + * The Initial Developer of the Original Code is: IBM Corporation
14870 + * Copyright: 2008 by IBM Corporation
14872 + * All Rights Reserved.
14874 + * Contributor(s): _______________________________________
14877 + ************************************************************************/
14878 +/*************************************************************************
14879 + * @file
14880 + * Footnote config.
14881 + ************************************************************************/
14882 +/*************************************************************************
14883 + * Change History
14884 + * 2005-03-29 create this file.
14885 + ************************************************************************/
14886 +#ifndef _XFFOOTNOTECONFIG_HXX
14887 +#define _XFFOOTNOTECONFIG_HXX
14889 +#include "xfstyle.hxx"
14891 +class XFFootnoteConfig : public XFStyle
14893 +public:
14894 + XFFootnoteConfig();
14896 +public:
14897 + void SetBodyStyle(rtl::OUString style);
14899 + void SetCitationStyle(rtl::OUString style);
14901 + void SetDefaultStyle(rtl::OUString style);
14903 + void SetMasterPage(rtl::OUString masterPage);
14905 + void SetNumberFormat(rtl::OUString numberFormat);
14907 + void SetStartValue(sal_Int32 value=0);
14909 + void SetRestartOnPage();
14911 + void SetRestartOnChapter();
14913 + void SetInsertInPage(sal_Bool page=sal_True);
14915 + void SetNumPrefix(rtl::OUString numprefix);
14917 + void SetNumSuffix(rtl::OUString numsuffix);
14919 + void SetMessageOn(rtl::OUString message);
14921 + void SetMessageFrom(rtl::OUString message);
14923 + virtual void ToXml(IXFStream *pStrm);
14925 +protected:
14926 + rtl::OUString m_strBodyStyle;
14927 + rtl::OUString m_strCitationStyle;
14928 + rtl::OUString m_strDefaultStyle;
14929 + rtl::OUString m_strMasterPage;
14930 + rtl::OUString m_strNumFmt;
14931 + rtl::OUString m_strNumPrefix;
14932 + rtl::OUString m_strNumSuffix;
14933 + rtl::OUString m_strMessageFrom;
14934 + rtl::OUString m_strMessageOn;
14935 + sal_Int32 m_nStartValue;
14936 + sal_Int32 m_nRestartType;
14937 + sal_Bool m_bInsertInPage;
14938 + sal_Bool m_bIsFootnote;
14941 +inline XFFootnoteConfig::XFFootnoteConfig()
14943 + m_nStartValue = 0;
14944 + m_nRestartType = -1;
14945 + m_strNumFmt = A2OUSTR("1");
14946 + m_bInsertInPage = sal_True;
14947 + m_strDefaultStyle = A2OUSTR("Footnote");
14948 + m_strMasterPage = A2OUSTR("Footnote");
14949 + m_strCitationStyle = A2OUSTR("Footnote Symbol");
14950 + m_strBodyStyle = A2OUSTR("Footnote anchor");
14951 + m_bIsFootnote = sal_True;
14954 +inline void XFFootnoteConfig::SetBodyStyle(rtl::OUString style)
14956 + m_strBodyStyle = style;
14959 +inline void XFFootnoteConfig::SetCitationStyle(rtl::OUString style)
14961 + m_strCitationStyle = style;
14964 +inline void XFFootnoteConfig::SetDefaultStyle(rtl::OUString style)
14966 + m_strDefaultStyle = style;
14969 +inline void XFFootnoteConfig::SetMasterPage(rtl::OUString masterPage)
14971 + m_strMasterPage = masterPage;
14974 +inline void XFFootnoteConfig::SetNumberFormat(rtl::OUString numberFormat)
14976 + m_strNumFmt = numberFormat;
14979 +inline void XFFootnoteConfig::SetStartValue(sal_Int32 value)
14981 + if( value<0 )
14982 + return;
14983 + m_nStartValue = value;
14986 +inline void XFFootnoteConfig::SetRestartOnPage()
14988 + m_nRestartType = 0;
14991 +inline void XFFootnoteConfig::SetRestartOnChapter()
14993 + m_nRestartType = 1;
14996 +inline void XFFootnoteConfig::SetInsertInPage(sal_Bool page)
14998 + m_bInsertInPage = page;
15001 +inline void XFFootnoteConfig::SetNumPrefix(rtl::OUString numprefix)
15003 + m_strNumPrefix = numprefix;
15006 +inline void XFFootnoteConfig::SetNumSuffix(rtl::OUString numsuffix)
15008 + m_strNumSuffix = numsuffix;
15011 +inline void XFFootnoteConfig::SetMessageOn(rtl::OUString message)
15013 + m_strMessageOn = message;
15016 +inline void XFFootnoteConfig::SetMessageFrom(rtl::OUString message)
15018 + m_strMessageFrom = message;
15021 +inline void XFFootnoteConfig::ToXml(IXFStream *pStrm)
15023 + IXFAttrList *pAttrList = pStrm->GetAttrList();
15024 + pAttrList->Clear();
15026 + if( m_strCitationStyle.getLength()>0 )
15027 + pAttrList->AddAttribute( A2OUSTR("text:citation-style-name"), m_strCitationStyle);
15029 + if( m_strBodyStyle.getLength()>0 )
15030 + pAttrList->AddAttribute( A2OUSTR("text:citation-body-style-name"), m_strBodyStyle);
15032 + if( m_strNumPrefix.getLength()>0 )
15033 + pAttrList->AddAttribute( A2OUSTR("style:num-prefix"), m_strNumPrefix);
15035 + if( m_strNumSuffix.getLength()>0 )
15036 + pAttrList->AddAttribute( A2OUSTR("style:num-suffix"), m_strNumSuffix);
15038 + if( m_strNumFmt.getLength()>0 )
15039 + pAttrList->AddAttribute( A2OUSTR("style:num-format"), m_strNumFmt);
15041 + if( m_strDefaultStyle.getLength()>0 )
15042 + pAttrList->AddAttribute( A2OUSTR("text:default-style-name"), m_strDefaultStyle);
15044 + if( m_strMasterPage.getLength()>0 )
15045 + pAttrList->AddAttribute( A2OUSTR("text:master-page-name"), m_strMasterPage);
15048 + pAttrList->AddAttribute( A2OUSTR("text:start-value"), Int32ToOUString(m_nStartValue) );
15050 + if( m_bIsFootnote )
15052 + if( m_nRestartType == -1 )
15053 + pAttrList->AddAttribute( A2OUSTR("text:start-numbering-at"), A2OUSTR("document") );
15054 + else if( m_nRestartType == 0 )
15055 + pAttrList->AddAttribute( A2OUSTR("text:start-numbering-at"), A2OUSTR("page") );
15056 + else if( m_nRestartType == 1 )
15057 + pAttrList->AddAttribute( A2OUSTR("text:start-numbering-at"), A2OUSTR("chapter") );
15059 + if( m_bInsertInPage )
15060 + pAttrList->AddAttribute( A2OUSTR("text:footnotes-position"), A2OUSTR("page") );
15061 + else
15062 + pAttrList->AddAttribute( A2OUSTR("text:footnotes-position"), A2OUSTR("document") );
15065 + if(m_bIsFootnote)
15067 + pStrm->StartElement( A2OUSTR("text:footnotes-configuration") );
15068 + if( m_strMessageOn.getLength()>0 )
15070 + pStrm->StartElement( A2OUSTR("text:footnote-continuation-notice-forward") );
15071 + pStrm->Characters(m_strMessageOn);
15072 + pStrm->EndElement( A2OUSTR("text:footnote-continuation-notice-forward") );
15075 + if( m_strMessageFrom.getLength()>0 )
15077 + pStrm->StartElement( A2OUSTR("text:footnote-continuation-notice-backward") );
15078 + pStrm->Characters(m_strMessageFrom);
15079 + pStrm->EndElement( A2OUSTR("text:footnote-continuation-notice-backward") );
15082 + pStrm->EndElement( A2OUSTR("text:footnotes-configuration") );
15084 + else
15086 + pStrm->StartElement( A2OUSTR("text:endnotes-configuration") );
15087 + pStrm->EndElement( A2OUSTR("text:endnotes-configuration") );
15092 +#endif
15093 \ No newline at end of file
15094 diff -urNp lotuswordpro.bak/source/filter/xfilter/xffootnote.hxx lotuswordpro/source/filter/xfilter/xffootnote.hxx
15095 --- lotuswordpro.bak/source/filter/xfilter/xffootnote.hxx 1970-01-01 08:00:00.000000000 +0800
15096 +++ lotuswordpro/source/filter/xfilter/xffootnote.hxx 2008-10-22 11:42:34.000000000 +0800
15097 @@ -0,0 +1,128 @@
15098 +/*************************************************************************
15100 + * The Contents of this file are made available subject to the terms of
15101 + * either of the following licenses
15103 + * - GNU Lesser General Public License Version 2.1
15104 + * - Sun Industry Standards Source License Version 1.1
15106 + * Sun Microsystems Inc., October, 2000
15108 + * GNU Lesser General Public License Version 2.1
15109 + * =============================================
15110 + * Copyright 2000 by Sun Microsystems, Inc.
15111 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
15113 + * This library is free software; you can redistribute it and/or
15114 + * modify it under the terms of the GNU Lesser General Public
15115 + * License version 2.1, as published by the Free Software Foundation.
15117 + * This library is distributed in the hope that it will be useful,
15118 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
15119 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15120 + * Lesser General Public License for more details.
15122 + * You should have received a copy of the GNU Lesser General Public
15123 + * License along with this library; if not, write to the Free Software
15124 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
15125 + * MA 02111-1307 USA
15128 + * Sun Industry Standards Source License Version 1.1
15129 + * =================================================
15130 + * The contents of this file are subject to the Sun Industry Standards
15131 + * Source License Version 1.1 (the "License"); You may not use this file
15132 + * except in compliance with the License. You may obtain a copy of the
15133 + * License at http://www.openoffice.org/license.html.
15135 + * Software provided under this License is provided on an "AS IS" basis,
15136 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
15137 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
15138 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
15139 + * See the License for the specific provisions governing your rights and
15140 + * obligations concerning the Software.
15142 + * The Initial Developer of the Original Code is: IBM Corporation
15144 + * Copyright: 2008 by IBM Corporation
15146 + * All Rights Reserved.
15148 + * Contributor(s): _______________________________________
15151 + ************************************************************************/
15152 +/*************************************************************************
15153 + * @file
15154 + * Foot note object.
15155 + ************************************************************************/
15156 +/*************************************************************************
15157 + * Change History
15158 + * 2004-1-31 create this file.
15159 + ************************************************************************/
15160 +#ifndef _XFFOOTNOTE_HXX
15161 +#define _XFFOOTNOTE_HXX
15163 +#include "xfglobal.hxx"
15164 +#include "xfcontent.hxx"
15165 +#include "xfcontentcontainer.hxx"
15167 +/**
15168 + * @brief
15169 + * Foot note object.
15170 + * Foot note has a lable, which is used in page content, and footnote contents in the footnote section.
15171 + */
15172 +class XFFootNote : public XFContentContainer
15174 +public:
15175 + XFFootNote();
15177 +public:
15178 + void SetLabel(sal_Unicode label);
15180 + virtual void ToXml(IXFStream *pStrm);
15182 +private:
15183 + rtl::OUString m_strID;
15184 + rtl::OUString m_strLabel;
15187 +inline XFFootNote::XFFootNote()
15189 + m_strID = XFGlobal::GenNoteName();
15192 +inline void XFFootNote::SetLabel(sal_Unicode label)
15194 + sal_Unicode chs[2];
15195 + chs[0] = label;
15196 + chs[1] = 0;
15198 + m_strLabel = rtl::OUString(chs);
15201 +inline void XFFootNote::ToXml(IXFStream *pStrm)
15203 + IXFAttrList *pAttrList = pStrm->GetAttrList();
15204 + pAttrList->Clear();
15206 + pAttrList->AddAttribute( A2OUSTR("text:id"), m_strID );
15207 + pStrm->StartElement( A2OUSTR("text:footnote") );
15209 + pAttrList->Clear();
15210 + if( m_strLabel.getLength() )
15211 + pAttrList->AddAttribute( A2OUSTR("text:label"), m_strLabel );
15212 + pStrm->StartElement( A2OUSTR("text:footnote-citation") );
15213 + if( m_strLabel.getLength() )
15214 + pStrm->Characters(m_strLabel);
15215 + pStrm->EndElement( A2OUSTR("text:footnote-citation") );
15217 + pAttrList->Clear();
15218 + pStrm->StartElement( A2OUSTR("text:footnote-body") );
15219 + XFContentContainer::ToXml(pStrm);
15220 + pStrm->EndElement( A2OUSTR("text:footnote-body") );
15222 + pStrm->EndElement( A2OUSTR("text:footnote") );
15225 +#endif
15226 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfframe.cxx lotuswordpro/source/filter/xfilter/xfframe.cxx
15227 --- lotuswordpro.bak/source/filter/xfilter/xfframe.cxx 1970-01-01 08:00:00.000000000 +0800
15228 +++ lotuswordpro/source/filter/xfilter/xfframe.cxx 2008-10-22 11:42:34.000000000 +0800
15229 @@ -0,0 +1,208 @@
15230 +/*************************************************************************
15232 + * The Contents of this file are made available subject to the terms of
15233 + * either of the following licenses
15235 + * - GNU Lesser General Public License Version 2.1
15236 + * - Sun Industry Standards Source License Version 1.1
15238 + * Sun Microsystems Inc., October, 2000
15240 + * GNU Lesser General Public License Version 2.1
15241 + * =============================================
15242 + * Copyright 2000 by Sun Microsystems, Inc.
15243 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
15245 + * This library is free software; you can redistribute it and/or
15246 + * modify it under the terms of the GNU Lesser General Public
15247 + * License version 2.1, as published by the Free Software Foundation.
15249 + * This library is distributed in the hope that it will be useful,
15250 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
15251 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15252 + * Lesser General Public License for more details.
15254 + * You should have received a copy of the GNU Lesser General Public
15255 + * License along with this library; if not, write to the Free Software
15256 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
15257 + * MA 02111-1307 USA
15260 + * Sun Industry Standards Source License Version 1.1
15261 + * =================================================
15262 + * The contents of this file are subject to the Sun Industry Standards
15263 + * Source License Version 1.1 (the "License"); You may not use this file
15264 + * except in compliance with the License. You may obtain a copy of the
15265 + * License at http://www.openoffice.org/license.html.
15267 + * Software provided under this License is provided on an "AS IS" basis,
15268 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
15269 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
15270 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
15271 + * See the License for the specific provisions governing your rights and
15272 + * obligations concerning the Software.
15274 + * The Initial Developer of the Original Code is: IBM Corporation
15276 + * Copyright: 2008 by IBM Corporation
15278 + * All Rights Reserved.
15280 + * Contributor(s): _______________________________________
15283 + ************************************************************************/
15284 +/*************************************************************************
15285 + * @file
15286 + * Frame whose anchor is not page.
15287 + ************************************************************************/
15288 +/*************************************************************************
15289 + * Change History
15290 + * 2005-01-21 create this file.
15291 + ************************************************************************/
15292 +#include "xfframe.hxx"
15293 +#include "xfparagraph.hxx"
15294 +#define ZINDEX_MAX 0x7fffffff
15295 +#define ZINDEX_MIN 0
15296 +XFFrame::XFFrame()
15298 + m_isTextBox = sal_False;
15299 + m_eAnchor = enumXFAnchorPara;
15300 + m_nAnchorPage = 0;
15301 + m_nZIndex = ZINDEX_MIN;
15302 + //give it a default name:
15303 + m_strName = XFGlobal::GenFrameName();
15304 + m_fMinHeight = 0;
15305 + m_fMaxHeight = 0;
15306 + m_nFlag = 0;
15307 + m_eType = enumXFFrameTextbox;
15309 +XFFrame::XFFrame(sal_Bool isTextBox):m_isTextBox(isTextBox)
15311 + m_eAnchor = enumXFAnchorPara;
15312 + m_nAnchorPage = 0;
15313 + m_nZIndex = ZINDEX_MIN;
15314 + //give it a default name:
15315 + m_strName = XFGlobal::GenFrameName();
15316 + m_fMinHeight = 0;
15317 + m_fMaxHeight = 0;
15318 + m_nFlag = 0;
15319 + m_eType = enumXFFrameTextbox;
15322 +XFFrame::~XFFrame()
15326 +void XFFrame::Add(IXFContent *pContent)
15328 + XFContentContainer::Add(pContent);
15329 + if( pContent->GetContentType() == enumXFContentFrame )
15331 + XFFrame *pFrame = (XFFrame*)pContent;
15332 + if( pFrame )
15334 + pFrame->SetZIndex(pFrame->m_nZIndex + 1);
15340 +void XFFrame::SetZIndex(sal_Int32 zIndex)
15342 + if( zIndex == m_nZIndex )
15343 + return;
15344 + m_nZIndex = zIndex;
15345 + AdjustZIndex();
15348 +enumXFFrameType XFFrame::GetFrameType()
15350 + return m_eType;
15353 +enumXFContent XFFrame::GetContentType()
15355 + return enumXFContentFrame;
15358 +void XFFrame::ToXml(IXFStream *pStrm)
15360 + StartFrame(pStrm);
15362 + XFContentContainer::ToXml(pStrm);
15364 + EndFrame(pStrm);
15367 +void XFFrame::StartFrame(IXFStream *pStrm)
15369 + IXFAttrList *pAttrList = pStrm->GetAttrList();
15371 + if( GetStyleName().getLength() )
15372 + pAttrList->AddAttribute( A2OUSTR("draw:style-name"), GetStyleName() );
15374 + assert(m_strName.getLength()>0); //name should not be null.
15375 + if( m_strName.getLength()&&m_isTextBox == sal_False)
15376 + pAttrList->AddAttribute( A2OUSTR("draw:name"), m_strName );
15377 + //anchor type:
15378 + switch( m_eAnchor )
15380 + case enumXFAnchorPara:
15381 + pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("paragraph") );
15382 + break;
15383 + case enumXFAnchorPage:
15384 + pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("page") );
15385 + pAttrList->AddAttribute( A2OUSTR("text:anchor-page-number"), Int32ToOUString(m_nAnchorPage) );
15386 + break;
15387 + case enumXFAnchorChar:
15388 + pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("char") );
15389 + break;
15390 + case enumXFAnchorAsChar:
15391 + pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("as-char") );
15392 + break;
15393 + case enumXFAnchorFrame:
15394 + pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("frame") );
15395 + break;
15397 + pAttrList->AddAttribute( A2OUSTR("svg:x"), DoubleToOUString(m_aRect.GetX()) + A2OUSTR("cm") );
15398 + pAttrList->AddAttribute( A2OUSTR("svg:y"), DoubleToOUString(m_aRect.GetY()) + A2OUSTR("cm") );
15399 + pAttrList->AddAttribute( A2OUSTR("svg:width"), DoubleToOUString(m_aRect.GetWidth()) + A2OUSTR("cm") );
15400 + if( m_nFlag& XFFRAME_FLAG_MINHEIGHT )
15402 + pAttrList->AddAttribute( A2OUSTR("fo:min-height"), DoubleToOUString(m_fMinHeight) + A2OUSTR("cm") );
15403 + if( m_nFlag&XFFRAME_FLAG_MAXHEIGHT )
15404 + pAttrList->AddAttribute( A2OUSTR("fo:max-height"), DoubleToOUString(m_fMaxHeight) + A2OUSTR("cm") );
15406 + else
15407 + pAttrList->AddAttribute( A2OUSTR("svg:height"), DoubleToOUString(m_aRect.GetHeight()) + A2OUSTR("cm") );
15409 + pAttrList->AddAttribute( A2OUSTR("draw:z-index"), Int32ToOUString(m_nZIndex) );
15411 + if( m_strNextLink.getLength() > 0 )
15412 + pAttrList->AddAttribute( A2OUSTR("draw:chain-next-name"), m_strNextLink );
15414 + pStrm->StartElement( A2OUSTR("draw:text-box") );
15417 +void XFFrame::EndFrame(IXFStream *pStrm)
15419 + pStrm->EndElement( A2OUSTR("draw:text-box") );
15422 +void XFFrame::AdjustZIndex()
15424 + for( int i=0; i<GetCount(); i++ )
15426 + IXFContent *pContent = GetContent(i);
15427 + if( pContent )
15429 + if( pContent->GetContentType() == enumXFContentFrame )
15431 + XFFrame *pFrame = (XFFrame*)pContent;
15432 + pFrame->m_nZIndex = m_nZIndex + 1;
15433 + pFrame->AdjustZIndex();
15438 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfframe.hxx lotuswordpro/source/filter/xfilter/xfframe.hxx
15439 --- lotuswordpro.bak/source/filter/xfilter/xfframe.hxx 1970-01-01 08:00:00.000000000 +0800
15440 +++ lotuswordpro/source/filter/xfilter/xfframe.hxx 2008-10-22 11:42:34.000000000 +0800
15441 @@ -0,0 +1,265 @@
15442 +/*************************************************************************
15444 + * The Contents of this file are made available subject to the terms of
15445 + * either of the following licenses
15447 + * - GNU Lesser General Public License Version 2.1
15448 + * - Sun Industry Standards Source License Version 1.1
15450 + * Sun Microsystems Inc., October, 2000
15452 + * GNU Lesser General Public License Version 2.1
15453 + * =============================================
15454 + * Copyright 2000 by Sun Microsystems, Inc.
15455 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
15457 + * This library is free software; you can redistribute it and/or
15458 + * modify it under the terms of the GNU Lesser General Public
15459 + * License version 2.1, as published by the Free Software Foundation.
15461 + * This library is distributed in the hope that it will be useful,
15462 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
15463 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15464 + * Lesser General Public License for more details.
15466 + * You should have received a copy of the GNU Lesser General Public
15467 + * License along with this library; if not, write to the Free Software
15468 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
15469 + * MA 02111-1307 USA
15472 + * Sun Industry Standards Source License Version 1.1
15473 + * =================================================
15474 + * The contents of this file are subject to the Sun Industry Standards
15475 + * Source License Version 1.1 (the "License"); You may not use this file
15476 + * except in compliance with the License. You may obtain a copy of the
15477 + * License at http://www.openoffice.org/license.html.
15479 + * Software provided under this License is provided on an "AS IS" basis,
15480 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
15481 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
15482 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
15483 + * See the License for the specific provisions governing your rights and
15484 + * obligations concerning the Software.
15486 + * The Initial Developer of the Original Code is: IBM Corporation
15488 + * Copyright: 2008 by IBM Corporation
15490 + * All Rights Reserved.
15492 + * Contributor(s): _______________________________________
15495 + ************************************************************************/
15496 +/*************************************************************************
15497 + * @file
15498 + * Frame object for OOo.This is the basic object for all Shape Layer.
15499 + * You can reference to the XFFrame object.
15500 + ************************************************************************/
15501 +/*************************************************************************
15502 + * Change History
15503 + * 2005-01-10 create and implements.
15504 + ************************************************************************/
15505 +#ifndef _XFFRAME_HXX
15506 +#define _XFFRAME_HXX
15508 +#include "xfglobal.hxx"
15509 +#include "xfcontent.hxx"
15510 +#include "xfrect.hxx"
15511 +#include "xfcontentcontainer.hxx"
15513 +#define XFFRAME_FLAG_HEIGHT 0x00000001
15514 +#define XFFRAME_FLAG_MINHEIGHT 0x00000002
15515 +#define XFFRAME_FLAG_MAXHEIGHT 0x00000004
15516 +/**
15517 + * @brief
15518 + * Base class for all frame object,include drawing,image,text-box.
15519 + *
15520 + * Use SetX(),SetY(),SetWidth(),SetHeight() to set postion for the frame.
15521 + * Only if you set anchor type to enumXFAnchorPage, the SetAnchorPage functions.
15522 + */
15523 +class XFFrame : public XFContentContainer
15525 +public:
15526 + XFFrame();
15527 + XFFrame(sal_Bool isTextBox);
15529 + virtual ~XFFrame();
15531 +public:
15532 + /**
15533 + * @descr override the add function to adjust z-index.
15534 + */
15535 + virtual void Add(IXFContent *pContent);
15537 + /**
15538 + * @descr: Set the anchor type for the frame object.
15539 + */
15540 + void SetAnchorType(enumXFAnchor type);
15542 + /**
15543 + * @descr: if it's page anchor,set the page number.
15544 + */
15545 + void SetAnchorPage(sal_Int32 page);
15547 + /**
15548 + * @descr Set frame name.
15549 + */
15550 + void SetName(rtl::OUString name);
15552 + /**
15553 + * @descr Set z-index of the frame.
15554 + */
15555 + void SetZIndex(sal_Int32 zIndex);
15556 + /**
15557 + * @descr Set frame position X.
15558 + */
15559 + void SetX(double x);
15561 + /**
15562 + * @descr Set frame position Y.
15563 + */
15564 + void SetY(double y);
15566 + /**
15567 + * @descr Set frame wieth.
15568 + */
15569 + void SetWidth(double width);
15571 + /**
15572 + * @descr Set frame height. Be careful SetHeight and SetMinHeight will override each other.
15573 + */
15574 + void SetHeight(double height);
15576 + /**
15577 + * @descr Set frame min-height. Be careful SetHeight and SetMinHeight will override each other.
15578 + */
15579 + void SetMinHeight(double minHeight);
15581 + /**
15582 + * @descr Set frame max-height.
15583 + */
15584 + void SetMaxHeight(double minHeight);
15586 + /**
15587 + * @descr Set frame position.
15588 + */
15589 + void SetPosition(double x, double y, double width, double height);
15591 + /**
15592 + * @descr Set frame position.
15593 + */
15594 + void SetPosition(const XFRect& rect);
15596 + /**
15597 + * @descr: Link the text content of the two frame.
15598 + */
15599 + void SetNextLink(rtl::OUString next);
15601 + /**
15602 + * @descr Get the frame type. image, drawing or text-box.
15603 + */
15604 + virtual enumXFFrameType GetFrameType();
15606 + /**
15607 + * @descr Get content type, enumXFContentFrame.
15608 + */
15609 + virtual enumXFContent GetContentType();
15611 + /**
15612 + * @descr serialize.
15613 + */
15614 + virtual void ToXml(IXFStream *pStrm);
15616 +private:
15617 + void StartFrame(IXFStream *pStrm);
15619 + void EndFrame(IXFStream *pStrm);
15621 + void AdjustZIndex();
15623 +protected:
15624 + enumXFAnchor m_eAnchor;
15625 + sal_Int32 m_nAnchorPage;
15626 + rtl::OUString m_strName;
15627 + sal_uInt32 m_nZIndex;
15628 + XFRect m_aRect;
15629 + double m_fMinHeight;
15630 + double m_fMaxHeight;
15631 + rtl::OUString m_strNextLink;
15632 + enumXFFrameType m_eType;
15633 + sal_uInt32 m_nFlag;
15634 + sal_Bool m_isTextBox;
15637 +inline void XFFrame::SetAnchorType(enumXFAnchor anchor)
15639 + m_eAnchor = anchor;
15642 +inline void XFFrame::SetName(rtl::OUString name)
15644 + m_strName = name;
15647 +inline void XFFrame::SetX(double x)
15649 + m_aRect.SetX(x);
15652 +inline void XFFrame::SetY(double y)
15654 + m_aRect.SetY(y);
15657 +inline void XFFrame::SetWidth(double width)
15659 + m_aRect.SetWidth(width);
15662 +inline void XFFrame::SetHeight(double height)
15664 + m_aRect.SetHeight(height);
15665 + m_nFlag |= XFFRAME_FLAG_HEIGHT;
15666 + m_nFlag &= XFFRAME_FLAG_HEIGHT;
15669 +inline void XFFrame::SetMinHeight(double minHeight)
15671 + m_fMinHeight = minHeight;
15672 + m_nFlag |= XFFRAME_FLAG_MINHEIGHT;
15673 + m_nFlag &= XFFRAME_FLAG_MINHEIGHT;
15676 +inline void XFFrame::SetMaxHeight(double maxHeight)
15678 + m_fMaxHeight = maxHeight;
15679 + m_nFlag |= XFFRAME_FLAG_MAXHEIGHT;
15680 + m_nFlag &= XFFRAME_FLAG_MAXHEIGHT;
15683 +inline void XFFrame::SetPosition(double x, double y, double width, double height)
15685 + m_aRect.SetStartPoint(XFPoint(x,y));
15686 + m_aRect.SetSize(width,height);
15687 + m_nFlag |= XFFRAME_FLAG_HEIGHT;
15690 +inline void XFFrame::SetPosition(const XFRect& rect)
15692 + m_aRect = rect;
15695 +inline void XFFrame::SetNextLink(rtl::OUString next)
15697 + m_strNextLink = next;
15700 +inline void XFFrame::SetAnchorPage(sal_Int32 page)
15702 + m_nAnchorPage = page;
15705 +#endif
15707 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfframestyle.cxx lotuswordpro/source/filter/xfilter/xfframestyle.cxx
15708 --- lotuswordpro.bak/source/filter/xfilter/xfframestyle.cxx 1970-01-01 08:00:00.000000000 +0800
15709 +++ lotuswordpro/source/filter/xfilter/xfframestyle.cxx 2008-10-22 11:42:34.000000000 +0800
15710 @@ -0,0 +1,238 @@
15711 +/*************************************************************************
15713 + * The Contents of this file are made available subject to the terms of
15714 + * either of the following licenses
15716 + * - GNU Lesser General Public License Version 2.1
15717 + * - Sun Industry Standards Source License Version 1.1
15719 + * Sun Microsystems Inc., October, 2000
15721 + * GNU Lesser General Public License Version 2.1
15722 + * =============================================
15723 + * Copyright 2000 by Sun Microsystems, Inc.
15724 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
15726 + * This library is free software; you can redistribute it and/or
15727 + * modify it under the terms of the GNU Lesser General Public
15728 + * License version 2.1, as published by the Free Software Foundation.
15730 + * This library is distributed in the hope that it will be useful,
15731 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
15732 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15733 + * Lesser General Public License for more details.
15735 + * You should have received a copy of the GNU Lesser General Public
15736 + * License along with this library; if not, write to the Free Software
15737 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
15738 + * MA 02111-1307 USA
15741 + * Sun Industry Standards Source License Version 1.1
15742 + * =================================================
15743 + * The contents of this file are subject to the Sun Industry Standards
15744 + * Source License Version 1.1 (the "License"); You may not use this file
15745 + * except in compliance with the License. You may obtain a copy of the
15746 + * License at http://www.openoffice.org/license.html.
15748 + * Software provided under this License is provided on an "AS IS" basis,
15749 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
15750 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
15751 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
15752 + * See the License for the specific provisions governing your rights and
15753 + * obligations concerning the Software.
15755 + * The Initial Developer of the Original Code is: IBM Corporation
15757 + * Copyright: 2008 by IBM Corporation
15759 + * All Rights Reserved.
15761 + * Contributor(s): _______________________________________
15764 + ************************************************************************/
15765 +/*************************************************************************
15766 + * @file
15767 + * Frame style include position,size,rotation and so on.
15768 + ************************************************************************/
15769 +/*************************************************************************
15770 + * Change History
15771 + * 2005-01-17 create this file.
15772 + ************************************************************************/
15773 +#include "xfframestyle.hxx"
15774 +#include "xfcolumns.hxx"
15775 +#include "xfborders.hxx"
15776 +#include "xfshadow.hxx"
15777 +#include "xfbgimage.hxx"
15779 +XFFrameStyle::XFFrameStyle()
15781 + m_eWrap = enumXFWrapNone;
15782 + m_nWrapLines = 0; //not limited.
15783 + m_pBorders = NULL;
15784 + m_pColumns = NULL;
15785 + m_pShadow = NULL;
15786 + m_pBGImage = NULL;
15788 + m_bProtectContent = sal_False;
15789 + m_bProtectSize = sal_False;
15790 + m_bProtectPos = sal_False;
15791 + m_bEditable = sal_False;
15792 + m_bPrintable = sal_True;
15793 + m_bBackground = sal_False;
15794 + m_nTransparency = 0;
15796 + m_eTextDir = enumXFTextDirNone;
15797 + m_eXPos = enumXFFrameXPosCenter;
15798 + m_eXRel = enumXFFrameXRelParaContent;
15799 + m_eYPos = enumXFFrameYPosTop;
15800 + m_eYRel = enumXFFrameYRelPage;
15803 +XFFrameStyle::~XFFrameStyle()
15805 + if( m_pBorders )
15806 + delete m_pBorders;
15807 + if( m_pColumns )
15808 + delete m_pColumns;
15809 + if( m_pShadow )
15810 + delete m_pShadow;
15811 + if( m_pBGImage )
15812 + delete m_pBGImage;
15815 +void XFFrameStyle::SetBorders(XFBorders *pBorders)
15817 + if( m_pBorders )
15818 + delete m_pBorders;
15819 + m_pBorders = pBorders;
15822 +void XFFrameStyle::SetColumns(XFColumns *pColumns)
15824 + if( m_pColumns )
15825 + delete m_pColumns;
15826 + m_pColumns = pColumns;
15829 +void XFFrameStyle::SetShadow(XFShadow *pShadow)
15831 + if( m_pShadow )
15832 + delete m_pShadow;
15833 + m_pShadow = pShadow;
15836 +void XFFrameStyle::SetBackImage(XFBGImage *image)
15838 + if( m_pBGImage )
15839 + delete m_pBGImage;
15840 + m_pBGImage = image;
15843 +enumXFStyle XFFrameStyle::GetStyleFamily()
15845 + return enumXFStyleGraphics;
15848 +void XFFrameStyle::ToXml(IXFStream *pStrm)
15850 + IXFAttrList *pAttrList = pStrm->GetAttrList();
15852 + pAttrList->Clear();
15853 + pAttrList->AddAttribute( A2OUSTR("style:name"), GetStyleName() );
15854 + if( GetParentStyleName().getLength() > 0 )
15855 + pAttrList->AddAttribute(A2OUSTR("style:parent-style-name"),GetParentStyleName());
15856 + pAttrList->AddAttribute( A2OUSTR("style:family"), A2OUSTR("graphics") );
15857 + //parent style name ignore now.
15858 + pStrm->StartElement( A2OUSTR("style:style") );
15860 + m_aMargins.ToXml(pStrm);
15862 + pAttrList->Clear();
15864 + /*if( m_eWrap == enumXFWrapBackground )
15866 + pAttrList->AddAttribute( A2OUSTR("style:run-through"), A2OUSTR("background") );
15868 + else
15869 + {*/
15870 + if( m_bBackground)
15871 + pAttrList->AddAttribute( A2OUSTR("style:run-through"), A2OUSTR("background") );
15872 + else
15873 + pAttrList->AddAttribute( A2OUSTR("style:run-through"), A2OUSTR("foreground") );
15875 + if( m_eWrap == enumXFWrapNone )
15876 + pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("none") );
15877 + else if( m_eWrap == enumXFWrapLeft )
15878 + pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("left") );
15879 + else if( m_eWrap == enumXFWrapRight )
15880 + pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("right") );
15881 + else if( m_eWrap == enumXFWrapParallel )
15882 + pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("parallel") );
15883 + else if( m_eWrap == enumXFWrapRunThrough )
15884 + pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("run-through") );
15885 + else if( m_eWrap == enumXFWrapBest )
15886 + pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("dynamic") );
15887 + //}
15888 + //background
15889 + if( m_aBackColor.IsValid() )
15891 + pAttrList->AddAttribute( A2OUSTR("fo:background-color"), m_aBackColor.ToString() );
15892 + pAttrList->AddAttribute( A2OUSTR("style:background-transparency"), Int16ToOUString(m_nTransparency) + A2OUSTR("%"));
15895 + //pad
15896 + m_aPad.ToXml(pStrm);
15897 + //margin:
15898 + m_aMargins.ToXml(pStrm);
15899 + //border
15900 + if( m_pBorders )
15901 + m_pBorders->ToXml(pStrm);
15902 + else
15903 + pAttrList->AddAttribute( A2OUSTR("fo:border"), A2OUSTR("none") );
15904 + //shadow
15905 + if( m_pShadow )
15906 + m_pShadow->ToXml(pStrm);
15907 + //print
15908 + if( m_bPrintable )
15909 + pAttrList->AddAttribute( A2OUSTR("style:print-content"), A2OUSTR("true") );
15910 + //text directory
15911 + if( m_eTextDir != enumXFTextDirNone )
15912 + pAttrList->AddAttribute( A2OUSTR("style:writing-mode"), GetTextDirName(m_eTextDir) );
15913 + //protect:
15914 + if( m_bProtectContent || m_bProtectSize || m_bProtectPos )
15916 + rtl::OUString protect;
15917 + if( m_bProtectContent )
15918 + protect += A2OUSTR("content");
15919 + if( m_bProtectSize )
15921 + if( protect.getLength()>0 )
15922 + protect += A2OUSTR(" ");
15923 + protect += A2OUSTR("size");
15925 + if( m_bProtectPos )
15927 + if( protect.getLength()>0 )
15928 + protect += A2OUSTR(" ");
15929 + protect += A2OUSTR("position");
15931 + pAttrList->AddAttribute( A2OUSTR("style:protect"), protect );
15933 + //vertical pos and horizon pos:
15934 + pAttrList->AddAttribute( A2OUSTR("style:vertical-pos"), GetFrameYPos(m_eYPos) );
15935 + pAttrList->AddAttribute( A2OUSTR("style:vertical-rel"), GetFrameYRel(m_eYRel) );
15936 + pAttrList->AddAttribute( A2OUSTR("style:horizontal-pos"), GetFrameXPos(m_eXPos) );
15937 + pAttrList->AddAttribute( A2OUSTR("style:horizontal-rel"), GetFrameXRel(m_eXRel) );
15939 + //
15940 + pStrm->StartElement( A2OUSTR("style:properties") );
15941 + if( m_pColumns )
15942 + m_pColumns->ToXml(pStrm);
15943 + if( m_pBGImage )
15944 + m_pBGImage->ToXml(pStrm);
15945 + pStrm->EndElement( A2OUSTR("style:properties") );
15947 + pStrm->EndElement( A2OUSTR("style:style") );
15949 \ No newline at end of file
15950 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfframestyle.hxx lotuswordpro/source/filter/xfilter/xfframestyle.hxx
15951 --- lotuswordpro.bak/source/filter/xfilter/xfframestyle.hxx 1970-01-01 08:00:00.000000000 +0800
15952 +++ lotuswordpro/source/filter/xfilter/xfframestyle.hxx 2008-10-22 11:42:34.000000000 +0800
15953 @@ -0,0 +1,254 @@
15954 +/*************************************************************************
15956 + * The Contents of this file are made available subject to the terms of
15957 + * either of the following licenses
15959 + * - GNU Lesser General Public License Version 2.1
15960 + * - Sun Industry Standards Source License Version 1.1
15962 + * Sun Microsystems Inc., October, 2000
15964 + * GNU Lesser General Public License Version 2.1
15965 + * =============================================
15966 + * Copyright 2000 by Sun Microsystems, Inc.
15967 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
15969 + * This library is free software; you can redistribute it and/or
15970 + * modify it under the terms of the GNU Lesser General Public
15971 + * License version 2.1, as published by the Free Software Foundation.
15973 + * This library is distributed in the hope that it will be useful,
15974 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
15975 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15976 + * Lesser General Public License for more details.
15978 + * You should have received a copy of the GNU Lesser General Public
15979 + * License along with this library; if not, write to the Free Software
15980 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
15981 + * MA 02111-1307 USA
15984 + * Sun Industry Standards Source License Version 1.1
15985 + * =================================================
15986 + * The contents of this file are subject to the Sun Industry Standards
15987 + * Source License Version 1.1 (the "License"); You may not use this file
15988 + * except in compliance with the License. You may obtain a copy of the
15989 + * License at http://www.openoffice.org/license.html.
15991 + * Software provided under this License is provided on an "AS IS" basis,
15992 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
15993 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
15994 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
15995 + * See the License for the specific provisions governing your rights and
15996 + * obligations concerning the Software.
15998 + * The Initial Developer of the Original Code is: IBM Corporation
16000 + * Copyright: 2008 by IBM Corporation
16002 + * All Rights Reserved.
16004 + * Contributor(s): _______________________________________
16007 + ************************************************************************/
16008 +/*************************************************************************
16009 + * @file
16010 + * Frame object style for OOo.
16011 + * You can reference to the XFFrame object.
16012 + ************************************************************************/
16013 +/*************************************************************************
16014 + * Change History
16015 + * 2005-01-10 create and implements.
16016 + ************************************************************************/
16017 +#ifndef _XFFRAMESTYLE_HXX
16018 +#define _XFFRAMESTYLE_HXX
16020 +#include "xfglobal.hxx"
16021 +#include "xfstyle.hxx"
16022 +#include "xfmargins.hxx"
16023 +#include "xfcolor.hxx"
16024 +#include "xfpadding.hxx"
16026 +class XFBorders;
16027 +class XFColumns;
16028 +class XFShadow;
16029 +class XFBGImage;
16031 +/**
16032 + * @brief
16033 + * Style for all frame obejcts.
16034 + */
16035 +class XFFrameStyle : public XFStyle
16037 +public:
16038 + XFFrameStyle();
16040 + virtual ~XFFrameStyle();
16042 +public:
16043 + void SetWrapType(enumXFWrap wrap, sal_Int32 nParagraphs = 0);
16045 + /**
16046 + * @descr: space between frame and paragraph text.
16047 + */
16048 + void SetMargins(double left, double right=-1,double top=-1, double bottom=-1);
16050 + /**
16051 + * @descr: space between frame and text inside frame.
16052 + */
16053 + void SetPadding(double left, double right=-1,double top=-1, double bottom=-1);
16055 + /**
16056 + * @descr: set the border property of the frame.
16057 + */
16058 + void SetBorders(XFBorders *pBorders);
16060 + /**
16061 + * @descr: set the column property of the frame.
16062 + */
16063 + void SetColumns(XFColumns *pColumns);
16065 + /**
16066 + * @descr: set the shadow object the frame.
16067 + */
16068 + void SetShadow(XFShadow *pShadow);
16070 + /**
16071 + * @descr: set the background image of the frame.
16072 + */
16073 + void SetBackImage(XFBGImage *iamge);
16075 + /**
16076 + * @descr: set the background color of the frame.
16077 + */
16078 + void SetBackColor(XFColor& color);
16080 + /**
16081 + * @descr Set whether frame is protected. There are three properties that can be protected, content,size and position.
16082 + */
16083 + void SetProtect(sal_Bool content, sal_Bool size, sal_Bool pos);
16085 + /**
16086 + * @descr Set text dir.
16087 + */
16088 + void SetTextDir(enumXFTextDir dir);
16090 + /**
16091 + * @descr Set horizontal position type.
16092 + */
16093 + void SetXPosType(enumXFFrameXPos pos, enumXFFrameXRel rel);
16095 + /**
16096 + * @descr Set vertical position type.
16097 + */
16098 + void SetYPosType(enumXFFrameYPos pos, enumXFFrameYRel rel);
16100 + /**
16101 + * @descr Set frame background.
16102 + */
16103 + void SetBackGround(sal_Bool bBackground);
16105 + void SetTransparency(sal_Int16 nTransparency);
16107 + virtual enumXFStyle GetStyleFamily();
16109 + virtual void ToXml(IXFStream *pStrm);
16111 +protected:
16112 + enumXFWrap m_eWrap;
16113 + sal_Int32 m_nWrapLines;
16114 + XFPadding m_aPad;
16115 + XFMargins m_aMargins;
16116 + XFBorders *m_pBorders;
16117 + XFColumns *m_pColumns;
16118 + XFShadow *m_pShadow;
16119 + XFBGImage *m_pBGImage;
16120 + XFColor m_aBackColor;
16121 + sal_Bool m_bProtectContent;
16122 + sal_Bool m_bProtectSize;
16123 + sal_Bool m_bProtectPos;
16124 + sal_Bool m_bEditable;
16125 + sal_Bool m_bPrintable;
16126 + sal_Bool m_bBackground;
16127 + sal_Int16 m_nTransparency;
16129 + enumXFTextDir m_eTextDir;
16130 + enumXFFrameXPos m_eXPos;
16131 + enumXFFrameXRel m_eXRel;
16132 + enumXFFrameYPos m_eYPos;
16133 + enumXFFrameYRel m_eYRel;
16136 +inline void XFFrameStyle::SetWrapType(enumXFWrap wrap, sal_Int32 nParagraphs)
16138 + m_eWrap = wrap;
16141 +inline void XFFrameStyle::SetMargins(double left, double right,double top, double bottom)
16143 + if( left != -1 )
16144 + m_aMargins.SetLeft(left);
16145 + if( right != -1 )
16146 + m_aMargins.SetRight(right);
16147 + if( top != -1 )
16148 + m_aMargins.SetTop(top);
16149 + if( bottom != -1 )
16150 + m_aMargins.SetBottom( bottom );
16153 +inline void XFFrameStyle::SetPadding(double left, double right,double top, double bottom)
16155 + if( left != -1 )
16156 + m_aPad.SetLeft(left);
16157 + if( right != -1 )
16158 + m_aPad.SetRight(right);
16159 + if( top != -1 )
16160 + m_aPad.SetTop(top);
16161 + if( bottom != -1 )
16162 + m_aPad.SetBottom( bottom );
16165 +inline void XFFrameStyle::SetBackColor(XFColor& color)
16167 + m_aBackColor = color;
16170 +inline void XFFrameStyle::SetTextDir(enumXFTextDir dir)
16172 + m_eTextDir = dir;
16175 +inline void XFFrameStyle::SetProtect(sal_Bool content, sal_Bool size, sal_Bool pos)
16177 + m_bProtectContent = content;
16178 + m_bProtectSize = size;
16179 + m_bProtectPos = pos;
16182 +inline void XFFrameStyle::SetXPosType(enumXFFrameXPos pos, enumXFFrameXRel rel)
16184 + m_eXPos = pos;
16185 + m_eXRel = rel;
16188 +inline void XFFrameStyle::SetYPosType(enumXFFrameYPos pos, enumXFFrameYRel rel)
16190 + m_eYPos = pos;
16191 + m_eYRel = rel;
16194 +inline void XFFrameStyle::SetBackGround(sal_Bool bBackground)
16196 + m_bBackground = bBackground;
16199 +inline void XFFrameStyle::SetTransparency(sal_Int16 nTransparency)
16201 + m_nTransparency = nTransparency;
16204 +#endif
16208 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfframetable.hxx lotuswordpro/source/filter/xfilter/xfframetable.hxx
16209 --- lotuswordpro.bak/source/filter/xfilter/xfframetable.hxx 1970-01-01 08:00:00.000000000 +0800
16210 +++ lotuswordpro/source/filter/xfilter/xfframetable.hxx 2008-10-22 11:42:34.000000000 +0800
16211 @@ -0,0 +1,91 @@
16212 +/*************************************************************************
16214 + * The Contents of this file are made available subject to the terms of
16215 + * either of the following licenses
16217 + * - GNU Lesser General Public License Version 2.1
16218 + * - Sun Industry Standards Source License Version 1.1
16220 + * Sun Microsystems Inc., October, 2000
16222 + * GNU Lesser General Public License Version 2.1
16223 + * =============================================
16224 + * Copyright 2000 by Sun Microsystems, Inc.
16225 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
16227 + * This library is free software; you can redistribute it and/or
16228 + * modify it under the terms of the GNU Lesser General Public
16229 + * License version 2.1, as published by the Free Software Foundation.
16231 + * This library is distributed in the hope that it will be useful,
16232 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
16233 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16234 + * Lesser General Public License for more details.
16236 + * You should have received a copy of the GNU Lesser General Public
16237 + * License along with this library; if not, write to the Free Software
16238 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
16239 + * MA 02111-1307 USA
16242 + * Sun Industry Standards Source License Version 1.1
16243 + * =================================================
16244 + * The contents of this file are subject to the Sun Industry Standards
16245 + * Source License Version 1.1 (the "License"); You may not use this file
16246 + * except in compliance with the License. You may obtain a copy of the
16247 + * License at http://www.openoffice.org/license.html.
16249 + * Software provided under this License is provided on an "AS IS" basis,
16250 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
16251 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
16252 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
16253 + * See the License for the specific provisions governing your rights and
16254 + * obligations concerning the Software.
16256 + * The Initial Developer of the Original Code is: IBM Corporation
16258 + * Copyright: 2008 by IBM Corporation
16260 + * All Rights Reserved.
16262 + * Contributor(s): _______________________________________
16265 + ************************************************************************/
16266 +/*************************************************************************
16267 + * @file
16268 + * Table object exist in a frame.
16269 + ************************************************************************/
16270 +/*************************************************************************
16271 + * Change History
16272 + * 2005-04-4 create and implements.
16273 + ************************************************************************/
16274 +#ifndef _XFFRAMETABLE_HXX
16275 +#define _XFFRAMETABLE_HXX
16277 +#include "xftable.hxx"
16278 +#include "xfframe.hxx"
16280 +class XFFrameTable : public XFTable
16282 +public:
16283 + void SetFrameStyle(rtl::OUString style);
16285 + virtual void ToXml(IXFStream *pStrm);
16287 +private:
16288 + rtl::OUString m_strFrameStyle;
16291 +inline void XFFrameTable::ToXml(IXFStream *pStrm)
16293 + XFFrame *pFrame = new XFFrame();
16294 + pFrame->SetStyleName(m_strFrameStyle);
16295 + pFrame->Add(this);
16296 + pFrame->ToXml(pStrm);
16298 + delete pFrame;
16301 +#endif
16303 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfglobal.cxx lotuswordpro/source/filter/xfilter/xfglobal.cxx
16304 --- lotuswordpro.bak/source/filter/xfilter/xfglobal.cxx 1970-01-01 08:00:00.000000000 +0800
16305 +++ lotuswordpro/source/filter/xfilter/xfglobal.cxx 2008-10-22 11:42:34.000000000 +0800
16306 @@ -0,0 +1,146 @@
16307 +/*************************************************************************
16309 + * The Contents of this file are made available subject to the terms of
16310 + * either of the following licenses
16312 + * - GNU Lesser General Public License Version 2.1
16313 + * - Sun Industry Standards Source License Version 1.1
16315 + * Sun Microsystems Inc., October, 2000
16317 + * GNU Lesser General Public License Version 2.1
16318 + * =============================================
16319 + * Copyright 2000 by Sun Microsystems, Inc.
16320 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
16322 + * This library is free software; you can redistribute it and/or
16323 + * modify it under the terms of the GNU Lesser General Public
16324 + * License version 2.1, as published by the Free Software Foundation.
16326 + * This library is distributed in the hope that it will be useful,
16327 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
16328 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16329 + * Lesser General Public License for more details.
16331 + * You should have received a copy of the GNU Lesser General Public
16332 + * License along with this library; if not, write to the Free Software
16333 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
16334 + * MA 02111-1307 USA
16337 + * Sun Industry Standards Source License Version 1.1
16338 + * =================================================
16339 + * The contents of this file are subject to the Sun Industry Standards
16340 + * Source License Version 1.1 (the "License"); You may not use this file
16341 + * except in compliance with the License. You may obtain a copy of the
16342 + * License at http://www.openoffice.org/license.html.
16344 + * Software provided under this License is provided on an "AS IS" basis,
16345 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
16346 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
16347 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
16348 + * See the License for the specific provisions governing your rights and
16349 + * obligations concerning the Software.
16351 + * The Initial Developer of the Original Code is: IBM Corporation
16353 + * Copyright: 2008 by IBM Corporation
16355 + * All Rights Reserved.
16357 + * Contributor(s): _______________________________________
16360 + ************************************************************************/
16361 +/*************************************************************************
16362 + * @file
16363 + * Global functions or include files that are needed.
16364 + * It's all for the full filter.
16365 + ************************************************************************/
16366 +/*************************************************************************
16367 + * Change History
16368 + * 2004-12-23 create this file.
16369 + ************************************************************************/
16370 +#include "xfglobal.hxx"
16371 +#include "xffontfactory.hxx"
16372 +#include "xfstylemanager.hxx"
16374 +int XFGlobal::s_nFrameID = 1;
16375 +int XFGlobal::s_nGraphID = 1;
16376 +int XFGlobal::s_nSectionID = 1;
16377 +int XFGlobal::s_nTableID = 1;
16378 +int XFGlobal::s_nNoteID = 1;
16379 +int XFGlobal::s_nStrokeDashID = 1;
16380 +int XFGlobal::s_nAreaID = 1;
16382 +//For chart object, /2005/2
16383 +int XFGlobal::s_nObjID = 1;
16385 +int XFGlobal::s_nImageID = 1;
16387 +rtl::OUString XFGlobal::GenSectionName()
16389 + //give it a initial name:
16390 + return A2OUSTR("sect") + Int32ToOUString(s_nSectionID++);
16393 +rtl::OUString XFGlobal::GenFrameName()
16395 + //give it a initial name:
16396 + return A2OUSTR("frame") + Int32ToOUString(s_nFrameID++);
16399 +rtl::OUString XFGlobal::GenGraphName()
16401 + return A2OUSTR("gr") + Int32ToOUString(s_nGraphID++);
16404 +//For chart object, /2005/2
16405 +rtl::OUString XFGlobal::GenObjName()
16407 + return A2OUSTR("Object") + Int32ToOUString(s_nObjID++);
16410 +rtl::OUString XFGlobal::GenTableName()
16412 + return A2OUSTR("table") + Int32ToOUString(s_nFrameID++);
16415 +rtl::OUString XFGlobal::GenNoteName()
16417 + return A2OUSTR("ftn") + Int32ToOUString(s_nNoteID++);
16420 +rtl::OUString XFGlobal::GenStrokeDashName()
16422 + return A2OUSTR("stroke dash ") + Int32ToOUString(s_nStrokeDashID++);
16425 +rtl::OUString XFGlobal::GenAreaName()
16427 + return A2OUSTR("draw area") + Int32ToOUString(s_nAreaID++);
16430 +rtl::OUString XFGlobal::GenImageName()
16432 + return A2OUSTR("Graphic") + Int32ToOUString(s_nImageID++);
16435 +void XFGlobal::Reset()
16437 + s_nSectionID = 1;
16438 + s_nFrameID = 1;
16439 + s_nTableID = 1;
16440 + s_nNoteID = 1;
16441 + s_nStrokeDashID = 1;
16442 + s_nAreaID = 1;
16443 + s_nObjID = 1;
16446 +void XFGlobalReset()
16448 +// XFFontFactory::Reset();
16449 +// XFStyleManager::Reset();
16450 + XFGlobal::Reset();
16453 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfglobal.hxx lotuswordpro/source/filter/xfilter/xfglobal.hxx
16454 --- lotuswordpro.bak/source/filter/xfilter/xfglobal.hxx 1970-01-01 08:00:00.000000000 +0800
16455 +++ lotuswordpro/source/filter/xfilter/xfglobal.hxx 2008-10-22 11:42:34.000000000 +0800
16456 @@ -0,0 +1,178 @@
16457 +/*************************************************************************
16459 + * The Contents of this file are made available subject to the terms of
16460 + * either of the following licenses
16462 + * - GNU Lesser General Public License Version 2.1
16463 + * - Sun Industry Standards Source License Version 1.1
16465 + * Sun Microsystems Inc., October, 2000
16467 + * GNU Lesser General Public License Version 2.1
16468 + * =============================================
16469 + * Copyright 2000 by Sun Microsystems, Inc.
16470 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
16472 + * This library is free software; you can redistribute it and/or
16473 + * modify it under the terms of the GNU Lesser General Public
16474 + * License version 2.1, as published by the Free Software Foundation.
16476 + * This library is distributed in the hope that it will be useful,
16477 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
16478 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16479 + * Lesser General Public License for more details.
16481 + * You should have received a copy of the GNU Lesser General Public
16482 + * License along with this library; if not, write to the Free Software
16483 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
16484 + * MA 02111-1307 USA
16487 + * Sun Industry Standards Source License Version 1.1
16488 + * =================================================
16489 + * The contents of this file are subject to the Sun Industry Standards
16490 + * Source License Version 1.1 (the "License"); You may not use this file
16491 + * except in compliance with the License. You may obtain a copy of the
16492 + * License at http://www.openoffice.org/license.html.
16494 + * Software provided under this License is provided on an "AS IS" basis,
16495 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
16496 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
16497 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
16498 + * See the License for the specific provisions governing your rights and
16499 + * obligations concerning the Software.
16501 + * The Initial Developer of the Original Code is: IBM Corporation
16503 + * Copyright: 2008 by IBM Corporation
16505 + * All Rights Reserved.
16507 + * Contributor(s): _______________________________________
16510 + ************************************************************************/
16511 +/*************************************************************************
16512 + * @file
16513 + * Global functions or include files that are needed.
16514 + * It's all for the full filter.
16515 + ************************************************************************/
16516 +/*************************************************************************
16517 + * Change History
16518 + * 2004-12-23 create this file.
16519 + ************************************************************************/
16520 +#ifndef _GLOBAL_HXX
16521 +#define _GLOBAL_HXX
16523 +#include <cassert>
16525 +#ifndef _SAL_TYPES_H
16526 +#include "sal/types.h"
16527 +#endif
16529 +#ifndef _RTL_USTRING_HXX_
16530 +#include <rtl/ustring.hxx>
16531 +#endif
16533 +#ifndef _IXFOBJECT_HXX
16534 +#include "ixfobject.hxx"
16535 +#endif
16537 +#ifndef _IXFSTREAM_HXX
16538 +#include "ixfstream.hxx"
16539 +#endif
16541 +#ifndef _IXFATTRLIST_HXX
16542 +#include "ixfattrlist.hxx"
16543 +#endif
16545 +#ifndef _XFUTIL_HXX
16546 +#include "xfutil.hxx"
16547 +#endif
16549 +#ifndef _XFDEFS_HXX
16550 +#include "xfdefs.hxx"
16551 +#endif
16553 +#define PI 3.1415926
16554 +#define FLOAT_MIN 0.001
16555 +#define MAX2(a,b) (((a) > (b)) ? (a) : (b))
16556 +#define MAX3(a,b,c) MAX2(a,MAX2(b,c))
16557 +#define MIN2(a,b) (((a) < (b)) ? (a) : (b))
16558 +#define MIN3(a,b,c) MIN2(a,MIN2(b,c))
16559 +#define FABS(f) (f>0?f:-f)
16561 +void XFGlobalReset();
16563 +/**
16564 + * @brief
16565 + * Global object, it manages all global variables for the full filter.
16566 + * Before loading a file, we'll need to reset all global variables.
16567 + * XFGlobal::Reset can do this for you.
16568 + */
16569 +class XFGlobal
16571 +public:
16572 + /**
16573 + * @descr Generate a name for the section.
16574 + */
16575 + static rtl::OUString GenSectionName();
16577 + /**
16578 + * @descr Gen a name for the frame.
16579 + */
16580 + static rtl::OUString GenFrameName();
16582 + /**
16583 + * @descr Generate a name for graphics.
16584 + */
16585 + static rtl::OUString GenGraphName();
16587 + /**
16588 + * @descr Generate a name for a table.
16589 + */
16590 + static rtl::OUString GenTableName();
16592 + /**
16593 + * @descr Generate a name for a note.
16594 + */
16595 + static rtl::OUString GenNoteName();
16597 + /**
16598 + * @descr Generate a name for the stroke style.
16599 + */
16600 + static rtl::OUString GenStrokeDashName();
16602 + /**
16603 + * @descr Generate a name for the area fill style.
16604 + */
16605 + static rtl::OUString GenAreaName();
16607 + /**
16608 + * @descr Generate a name for a ole obejct.
16609 + */
16610 + static rtl::OUString GenObjName();
16612 + /**
16613 + * @descr Generate a name for an image object
16614 + */
16615 + static rtl::OUString GenImageName();
16617 + /**
16618 + * @descr Reset all global variables.
16619 + */
16620 + static void Reset();
16622 +public:
16623 + static int s_nSectionID;
16624 + static int s_nFrameID;
16625 + static int s_nGraphID;
16626 + static int s_nTableID;
16627 + static int s_nNoteID;
16628 + static int s_nStrokeDashID;
16629 + static int s_nAreaID;
16630 + static int s_nObjID;
16631 + static int s_nImageID;
16634 +#endif
16635 \ No newline at end of file
16636 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfheader.hxx lotuswordpro/source/filter/xfilter/xfheader.hxx
16637 --- lotuswordpro.bak/source/filter/xfilter/xfheader.hxx 1970-01-01 08:00:00.000000000 +0800
16638 +++ lotuswordpro/source/filter/xfilter/xfheader.hxx 2008-10-22 11:42:34.000000000 +0800
16639 @@ -0,0 +1,90 @@
16640 +/*************************************************************************
16642 + * The Contents of this file are made available subject to the terms of
16643 + * either of the following licenses
16645 + * - GNU Lesser General Public License Version 2.1
16646 + * - Sun Industry Standards Source License Version 1.1
16648 + * Sun Microsystems Inc., October, 2000
16650 + * GNU Lesser General Public License Version 2.1
16651 + * =============================================
16652 + * Copyright 2000 by Sun Microsystems, Inc.
16653 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
16655 + * This library is free software; you can redistribute it and/or
16656 + * modify it under the terms of the GNU Lesser General Public
16657 + * License version 2.1, as published by the Free Software Foundation.
16659 + * This library is distributed in the hope that it will be useful,
16660 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
16661 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16662 + * Lesser General Public License for more details.
16664 + * You should have received a copy of the GNU Lesser General Public
16665 + * License along with this library; if not, write to the Free Software
16666 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
16667 + * MA 02111-1307 USA
16670 + * Sun Industry Standards Source License Version 1.1
16671 + * =================================================
16672 + * The contents of this file are subject to the Sun Industry Standards
16673 + * Source License Version 1.1 (the "License"); You may not use this file
16674 + * except in compliance with the License. You may obtain a copy of the
16675 + * License at http://www.openoffice.org/license.html.
16677 + * Software provided under this License is provided on an "AS IS" basis,
16678 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
16679 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
16680 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
16681 + * See the License for the specific provisions governing your rights and
16682 + * obligations concerning the Software.
16684 + * The Initial Developer of the Original Code is: IBM Corporation
16686 + * Copyright: 2008 by IBM Corporation
16688 + * All Rights Reserved.
16690 + * Contributor(s): _______________________________________
16693 + ************************************************************************/
16694 +/*************************************************************************
16695 + * @file
16696 + * Header object. Sub object of master page.
16697 + ************************************************************************/
16698 +/*************************************************************************
16699 + * Change History
16700 + * 2005-01-19 create this file.
16701 + ************************************************************************/
16702 +#ifndef _XFHEADER_HXX
16703 +#define _XFHEADER_HXX
16705 +#include "xfcontentcontainer.hxx"
16706 +#include "xfparagraph.hxx"
16707 +#include <vector>
16709 +class XFHeader : public XFContentContainer
16711 +public:
16712 + XFHeader()
16715 +public:
16716 + virtual void ToXml(IXFStream *pStrm)
16718 + IXFAttrList *pAttrList = pStrm->GetAttrList();
16719 + pAttrList->Clear();
16721 + pStrm->StartElement( A2OUSTR("style:header") );
16722 + XFContentContainer::ToXml(pStrm);
16723 + pStrm->EndElement( A2OUSTR("style:header") );
16725 +private:
16726 + XFContentContainer m_aContents;
16729 +#endif
16730 \ No newline at end of file
16731 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfheaderstyle.cxx lotuswordpro/source/filter/xfilter/xfheaderstyle.cxx
16732 --- lotuswordpro.bak/source/filter/xfilter/xfheaderstyle.cxx 1970-01-01 08:00:00.000000000 +0800
16733 +++ lotuswordpro/source/filter/xfilter/xfheaderstyle.cxx 2008-10-22 11:42:34.000000000 +0800
16734 @@ -0,0 +1,192 @@
16735 +/*************************************************************************
16737 + * The Contents of this file are made available subject to the terms of
16738 + * either of the following licenses
16740 + * - GNU Lesser General Public License Version 2.1
16741 + * - Sun Industry Standards Source License Version 1.1
16743 + * Sun Microsystems Inc., October, 2000
16745 + * GNU Lesser General Public License Version 2.1
16746 + * =============================================
16747 + * Copyright 2000 by Sun Microsystems, Inc.
16748 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
16750 + * This library is free software; you can redistribute it and/or
16751 + * modify it under the terms of the GNU Lesser General Public
16752 + * License version 2.1, as published by the Free Software Foundation.
16754 + * This library is distributed in the hope that it will be useful,
16755 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
16756 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16757 + * Lesser General Public License for more details.
16759 + * You should have received a copy of the GNU Lesser General Public
16760 + * License along with this library; if not, write to the Free Software
16761 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
16762 + * MA 02111-1307 USA
16765 + * Sun Industry Standards Source License Version 1.1
16766 + * =================================================
16767 + * The contents of this file are subject to the Sun Industry Standards
16768 + * Source License Version 1.1 (the "License"); You may not use this file
16769 + * except in compliance with the License. You may obtain a copy of the
16770 + * License at http://www.openoffice.org/license.html.
16772 + * Software provided under this License is provided on an "AS IS" basis,
16773 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
16774 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
16775 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
16776 + * See the License for the specific provisions governing your rights and
16777 + * obligations concerning the Software.
16779 + * The Initial Developer of the Original Code is: IBM Corporation
16781 + * Copyright: 2008 by IBM Corporation
16783 + * All Rights Reserved.
16785 + * Contributor(s): _______________________________________
16788 + ************************************************************************/
16789 +/*************************************************************************
16790 + * @file
16791 + * Header style,exist in page-master object.
16792 + ************************************************************************/
16793 +/*************************************************************************
16794 + * Change History
16795 + * 2005-01-21 create this file.
16796 + ************************************************************************/
16797 +#include "xfheaderstyle.hxx"
16798 +#include "xfbgimage.hxx"
16800 +XFHeaderStyle::XFHeaderStyle(sal_Bool isFooter)
16802 + m_bIsFooter = isFooter;
16803 + m_bDynamicSpace = sal_True;
16804 + m_fHeight = -1;
16805 + m_fMinHeight = -1;
16806 + m_pBorders = NULL;
16807 + m_pShadow = NULL;
16808 + m_pBGImage = NULL;
16811 +XFHeaderStyle::~XFHeaderStyle()
16813 + if( m_pBorders )
16814 + delete m_pBorders;
16815 + if( m_pBGImage )
16816 + delete m_pBGImage;
16817 + if( m_pShadow )
16818 + delete m_pShadow;
16821 +void XFHeaderStyle::SetMargins(double left, double right, double bottom)
16823 + if( left != -1 )
16824 + m_aMargin.SetLeft(left);
16825 + if( right != -1 )
16826 + m_aMargin.SetRight(right);
16827 + if( bottom != -1 )
16828 + m_aMargin.SetBottom(bottom);
16830 +void XFHeaderStyle::SetDynamicSpace(sal_Bool dynamic)
16832 + m_bDynamicSpace = dynamic;
16835 +void XFHeaderStyle::SetHeight(double height)
16837 + m_fHeight = height;
16840 +void XFHeaderStyle::SetMinHeight(double minHeight)
16842 + m_fMinHeight = minHeight;
16845 +void XFHeaderStyle::SetPadding(double left, double right, double top, double bottom)
16847 + if( left != -1 )
16848 + m_aPadding.SetLeft(left);
16849 + if( right != -1 )
16850 + m_aPadding.SetRight(right);
16851 + if( top != -1 )
16852 + m_aPadding.SetTop(top);
16853 + if( bottom != -1 )
16854 + m_aPadding.SetBottom(bottom);
16857 +void XFHeaderStyle::SetShadow(XFShadow *pShadow)
16859 + if( m_pShadow && (pShadow != m_pShadow) )
16860 + delete m_pShadow;
16861 + m_pShadow = pShadow;
16864 +void XFHeaderStyle::SetBorders(XFBorders *pBorders)
16866 + if( m_pBorders )
16867 + delete m_pBorders;
16868 + m_pBorders = pBorders;
16871 +void XFHeaderStyle::SetBackImage(XFBGImage *image)
16873 + if( m_pBGImage )
16874 + delete m_pBGImage;
16875 + m_pBGImage = image;
16878 +void XFHeaderStyle::SetBackColor(XFColor color)
16880 + m_aBackColor = color;
16883 +void XFHeaderStyle::ToXml(IXFStream *pStrm)
16885 + IXFAttrList *pAttrList = pStrm->GetAttrList();
16886 + pAttrList->Clear();
16888 + if( m_bIsFooter )
16889 + pStrm->StartElement( A2OUSTR("style:footer-style") );
16890 + else
16891 + pStrm->StartElement( A2OUSTR("style:header-style") );
16893 + //height
16894 + if( m_fMinHeight>0 )
16895 + pAttrList->AddAttribute( A2OUSTR("fo:min-height"), DoubleToOUString(m_fMinHeight) + A2OUSTR("cm") );
16896 + else if( m_fHeight>0 )
16897 + pAttrList->AddAttribute( A2OUSTR("svg:height"), DoubleToOUString(m_fHeight) + A2OUSTR("cm") );
16899 + m_aMargin.ToXml(pStrm);
16900 + if(m_pShadow)
16901 + m_pShadow->ToXml(pStrm);
16902 + m_aPadding.ToXml(pStrm);
16903 + if( m_pBorders )
16904 + m_pBorders->ToXml(pStrm);
16906 + if( m_aBackColor.IsValid() )
16907 + pAttrList->AddAttribute( A2OUSTR("fo:background-color"), m_aBackColor.ToString() );
16909 + if( m_bDynamicSpace )
16910 + pAttrList->AddAttribute( A2OUSTR("style:dynamic-spacing"), A2OUSTR("true") );
16911 + else
16912 + pAttrList->AddAttribute( A2OUSTR("style:dynamic-spacing"), A2OUSTR("false") );
16914 + pStrm->StartElement( A2OUSTR("style:properties") );
16916 + // background image
16917 + if( m_pBGImage )
16918 + m_pBGImage->ToXml(pStrm);
16920 + pStrm->EndElement( A2OUSTR("style:properties") );
16922 + if( m_bIsFooter )
16923 + pStrm->EndElement( A2OUSTR("style:footer-style") );
16924 + else
16925 + pStrm->EndElement( A2OUSTR("style:header-style") );
16927 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfheaderstyle.hxx lotuswordpro/source/filter/xfilter/xfheaderstyle.hxx
16928 --- lotuswordpro.bak/source/filter/xfilter/xfheaderstyle.hxx 1970-01-01 08:00:00.000000000 +0800
16929 +++ lotuswordpro/source/filter/xfilter/xfheaderstyle.hxx 2008-10-22 11:42:34.000000000 +0800
16930 @@ -0,0 +1,142 @@
16931 +/*************************************************************************
16933 + * The Contents of this file are made available subject to the terms of
16934 + * either of the following licenses
16936 + * - GNU Lesser General Public License Version 2.1
16937 + * - Sun Industry Standards Source License Version 1.1
16939 + * Sun Microsystems Inc., October, 2000
16941 + * GNU Lesser General Public License Version 2.1
16942 + * =============================================
16943 + * Copyright 2000 by Sun Microsystems, Inc.
16944 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
16946 + * This library is free software; you can redistribute it and/or
16947 + * modify it under the terms of the GNU Lesser General Public
16948 + * License version 2.1, as published by the Free Software Foundation.
16950 + * This library is distributed in the hope that it will be useful,
16951 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
16952 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16953 + * Lesser General Public License for more details.
16955 + * You should have received a copy of the GNU Lesser General Public
16956 + * License along with this library; if not, write to the Free Software
16957 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
16958 + * MA 02111-1307 USA
16961 + * Sun Industry Standards Source License Version 1.1
16962 + * =================================================
16963 + * The contents of this file are subject to the Sun Industry Standards
16964 + * Source License Version 1.1 (the "License"); You may not use this file
16965 + * except in compliance with the License. You may obtain a copy of the
16966 + * License at http://www.openoffice.org/license.html.
16968 + * Software provided under this License is provided on an "AS IS" basis,
16969 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
16970 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
16971 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
16972 + * See the License for the specific provisions governing your rights and
16973 + * obligations concerning the Software.
16975 + * The Initial Developer of the Original Code is: IBM Corporation
16977 + * Copyright: 2008 by IBM Corporation
16979 + * All Rights Reserved.
16981 + * Contributor(s): _______________________________________
16984 + ************************************************************************/
16985 +/*************************************************************************
16986 + * @file
16987 + * Header style,exist in page-master object.
16988 + ************************************************************************/
16989 +/*************************************************************************
16990 + * Change History
16991 + * 2005-01-19 create this file.
16992 + ************************************************************************/
16993 +#ifndef _XFHEADERSTYLE_HXX
16994 +#define _XFHEADERSTYLE_HXX
16996 +#include "xfstyle.hxx"
16997 +#include "xfmargins.hxx"
16998 +#include "xfborders.hxx"
16999 +#include "xfpadding.hxx"
17000 +#include "xfshadow.hxx"
17002 +/**
17003 + * @brief
17004 + * Header style object.
17005 + */
17006 +class XFBGImage;
17007 +class XFHeaderStyle : public XFStyle
17009 +public:
17010 + explicit XFHeaderStyle(sal_Bool isFooter=sal_False);
17012 + virtual ~XFHeaderStyle();
17014 +public:
17015 + /**
17016 + * @descr Set margins for header style.
17017 + */
17018 + void SetMargins(double left = -1, double right = -1, double bottom = -1);
17020 + void SetDynamicSpace(sal_Bool dynamic);
17022 + /**
17023 + * @descr Set header fixed height.
17024 + */
17025 + void SetHeight(double height);
17027 + /**
17028 + * @descr Set header min height.
17029 + */
17030 + void SetMinHeight(double minHeight);
17032 + /**
17033 + * @descr Set padding for header. Padding is the space between header borde and header content.
17034 + */
17035 + void SetPadding(double left=-1, double right=-1, double top=-1, double bottom=-1);
17037 + /**
17038 + * @descr Set header shadow.
17039 + */
17040 + void SetShadow(XFShadow *pShadow);
17042 + /**
17043 + * @descr Set header borders.
17044 + */
17045 + void SetBorders(XFBorders *pBorders);
17047 + void SetBackImage(XFBGImage *image);
17049 + /**
17050 + * @descr Set header background color.
17051 + */
17052 + void SetBackColor(XFColor color);
17054 + /**
17055 + * @descr Output header style obejct.
17056 + */
17057 + virtual void ToXml(IXFStream *pStrm);
17059 +protected:
17060 + sal_Bool m_bIsFooter;
17061 + sal_Bool m_bDynamicSpace;
17062 + double m_fHeight;
17063 + double m_fMinHeight;
17064 + XFMargins m_aMargin;
17065 + XFShadow* m_pShadow;
17066 + XFPadding m_aPadding;
17067 + XFBorders *m_pBorders;
17068 + XFBGImage *m_pBGImage;
17069 + XFColor m_aBackColor;
17072 +#endif
17073 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfhyperlink.hxx lotuswordpro/source/filter/xfilter/xfhyperlink.hxx
17074 --- lotuswordpro.bak/source/filter/xfilter/xfhyperlink.hxx 1970-01-01 08:00:00.000000000 +0800
17075 +++ lotuswordpro/source/filter/xfilter/xfhyperlink.hxx 2008-10-22 11:42:34.000000000 +0800
17076 @@ -0,0 +1,140 @@
17077 +/*************************************************************************
17079 + * The Contents of this file are made available subject to the terms of
17080 + * either of the following licenses
17082 + * - GNU Lesser General Public License Version 2.1
17083 + * - Sun Industry Standards Source License Version 1.1
17085 + * Sun Microsystems Inc., October, 2000
17087 + * GNU Lesser General Public License Version 2.1
17088 + * =============================================
17089 + * Copyright 2000 by Sun Microsystems, Inc.
17090 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
17092 + * This library is free software; you can redistribute it and/or
17093 + * modify it under the terms of the GNU Lesser General Public
17094 + * License version 2.1, as published by the Free Software Foundation.
17096 + * This library is distributed in the hope that it will be useful,
17097 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
17098 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17099 + * Lesser General Public License for more details.
17101 + * You should have received a copy of the GNU Lesser General Public
17102 + * License along with this library; if not, write to the Free Software
17103 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
17104 + * MA 02111-1307 USA
17107 + * Sun Industry Standards Source License Version 1.1
17108 + * =================================================
17109 + * The contents of this file are subject to the Sun Industry Standards
17110 + * Source License Version 1.1 (the "License"); You may not use this file
17111 + * except in compliance with the License. You may obtain a copy of the
17112 + * License at http://www.openoffice.org/license.html.
17114 + * Software provided under this License is provided on an "AS IS" basis,
17115 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
17116 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
17117 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
17118 + * See the License for the specific provisions governing your rights and
17119 + * obligations concerning the Software.
17121 + * The Initial Developer of the Original Code is: IBM Corporation
17123 + * Copyright: 2008 by IBM Corporation
17125 + * All Rights Reserved.
17127 + * Contributor(s): _______________________________________
17130 + ************************************************************************/
17131 +/*************************************************************************
17132 + * @file
17133 + * Hyperlink object for OOo xml filter.
17134 + ************************************************************************/
17135 +/*************************************************************************
17136 + * Change History
17137 + * 2004-1-31 create this file.
17138 + ************************************************************************/
17139 +#ifndef _XFHYPERLINK_HXX
17140 +#define _XFHYPERLINK_HXX
17142 +class XFHyperlink : public XFContent
17144 +public:
17145 + XFHyperlink();
17147 +public:
17148 + void SetHRef(rtl::OUString href);
17150 + void SetText(rtl::OUString text);
17152 + void SetName(rtl::OUString name);
17154 + void SetTargetFrame(rtl::OUString frame=A2OUSTR("_self"));
17156 + virtual void ToXml(IXFStream *pStrm);
17158 +private:
17159 + rtl::OUString m_strHRef;
17160 + rtl::OUString m_strName;
17161 + rtl::OUString m_strFrame;
17162 + rtl::OUString m_strText;
17165 +inline XFHyperlink::XFHyperlink()
17167 + m_strFrame = A2OUSTR("_self");
17170 +inline void XFHyperlink::SetHRef(rtl::OUString href)
17172 + m_strHRef = href;
17175 +inline void XFHyperlink::SetName(rtl::OUString name)
17177 + m_strName = name;
17180 +inline void XFHyperlink::SetTargetFrame(rtl::OUString frame)
17182 + m_strFrame = frame;
17185 +inline void XFHyperlink::SetText(rtl::OUString text)
17187 + m_strText = text;
17190 +inline void XFHyperlink::ToXml(IXFStream *pStrm)
17192 + IXFAttrList *pAttrList = pStrm->GetAttrList();
17193 + pAttrList->Clear();
17195 + pAttrList->AddAttribute( A2OUSTR("xlink:type"), A2OUSTR("simple") );
17196 + pAttrList->AddAttribute( A2OUSTR("xlink:href"), m_strHRef );
17197 + if( m_strName.getLength() > 0 )
17198 + pAttrList->AddAttribute( A2OUSTR("office:name"), m_strName );
17199 + pAttrList->AddAttribute( A2OUSTR("office:target-frame-name"), m_strFrame );
17200 + pAttrList->AddAttribute( A2OUSTR("xlink:show"), A2OUSTR("replace") );
17201 + pStrm->StartElement( A2OUSTR("text:a") );
17203 + pAttrList->Clear();
17204 + if( GetStyleName().getLength()>0 )
17205 + pAttrList->AddAttribute( A2OUSTR("text:style-name"), GetStyleName() );
17206 + pStrm->StartElement( A2OUSTR("text:span") );
17207 + if( m_strText.getLength() )
17208 + pStrm->Characters(m_strText);
17209 + else
17210 + pStrm->Characters(m_strHRef);
17211 + pStrm->EndElement( A2OUSTR("text:span") );
17213 + pStrm->EndElement( A2OUSTR("text:a") );
17216 +#endif
17217 \ No newline at end of file
17218 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfimage.cxx lotuswordpro/source/filter/xfilter/xfimage.cxx
17219 --- lotuswordpro.bak/source/filter/xfilter/xfimage.cxx 1970-01-01 08:00:00.000000000 +0800
17220 +++ lotuswordpro/source/filter/xfilter/xfimage.cxx 2008-10-22 11:42:34.000000000 +0800
17221 @@ -0,0 +1,145 @@
17222 +/*************************************************************************
17224 + * The Contents of this file are made available subject to the terms of
17225 + * either of the following licenses
17227 + * - GNU Lesser General Public License Version 2.1
17228 + * - Sun Industry Standards Source License Version 1.1
17230 + * Sun Microsystems Inc., October, 2000
17232 + * GNU Lesser General Public License Version 2.1
17233 + * =============================================
17234 + * Copyright 2000 by Sun Microsystems, Inc.
17235 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
17237 + * This library is free software; you can redistribute it and/or
17238 + * modify it under the terms of the GNU Lesser General Public
17239 + * License version 2.1, as published by the Free Software Foundation.
17241 + * This library is distributed in the hope that it will be useful,
17242 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
17243 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17244 + * Lesser General Public License for more details.
17246 + * You should have received a copy of the GNU Lesser General Public
17247 + * License along with this library; if not, write to the Free Software
17248 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
17249 + * MA 02111-1307 USA
17252 + * Sun Industry Standards Source License Version 1.1
17253 + * =================================================
17254 + * The contents of this file are subject to the Sun Industry Standards
17255 + * Source License Version 1.1 (the "License"); You may not use this file
17256 + * except in compliance with the License. You may obtain a copy of the
17257 + * License at http://www.openoffice.org/license.html.
17259 + * Software provided under this License is provided on an "AS IS" basis,
17260 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
17261 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
17262 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
17263 + * See the License for the specific provisions governing your rights and
17264 + * obligations concerning the Software.
17266 + * The Initial Developer of the Original Code is: IBM Corporation
17268 + * Copyright: 2008 by IBM Corporation
17270 + * All Rights Reserved.
17272 + * Contributor(s): _______________________________________
17275 + ************************************************************************/
17276 +/*************************************************************************
17277 + * @file
17278 + * Image object.
17279 + ************************************************************************/
17280 +/*************************************************************************
17281 + * Change History
17282 + 2005-02-22 create and implemente.
17283 + ************************************************************************/
17284 +#include "xfimage.hxx"
17285 +#include "xfbase64.hxx"
17287 +XFImage::XFImage()
17289 + m_eType = enumXFFrameImage;
17290 + m_strName = XFGlobal::GenImageName();
17293 +void XFImage::SetFileURL(rtl::OUString url)
17295 + m_strImageFile = url;
17296 + m_bUseLink = sal_True;
17299 +void XFImage::SetImageData(sal_uInt8 *buf, int len)
17301 + m_strData = XFBase64::Encode(buf, len);
17302 + m_bUseLink = sal_False;
17306 + <text:p text:style-name="Standard">
17307 + <draw:image draw:style-name="fr1" draw:name="Graphic1"
17308 + text:anchor-type="paragraph" svg:width="4.981cm" svg:height="4.77cm"
17309 + draw:z-index="0" xlink:href="file:///d:/bee.wmf" xlink:type="simple"
17310 + xlink:show="embed" xlink:actuate="onLoad"/>
17311 + </text:p>
17312 + */
17313 +void XFImage::ToXml(IXFStream *pStrm)
17315 + IXFAttrList *pAttrList = pStrm->GetAttrList();
17317 + if( GetStyleName().getLength() )
17318 + pAttrList->AddAttribute( A2OUSTR("draw:style-name"), GetStyleName() );
17320 + assert(m_strName.getLength()>0); //name should not be null.
17321 + if( m_strName.getLength() )
17322 + pAttrList->AddAttribute( A2OUSTR("draw:name"), m_strName );
17323 + //anchor type:
17324 + switch( m_eAnchor )
17326 + case enumXFAnchorPara:
17327 + pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("paragraph") );
17328 + break;
17329 + case enumXFAnchorPage:
17330 + pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("page") );
17331 + pAttrList->AddAttribute( A2OUSTR("text:anchor-page-number"), Int32ToOUString(m_nAnchorPage) );
17332 + break;
17333 + case enumXFAnchorChar:
17334 + pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("char") );
17335 + break;
17336 + case enumXFAnchorAsChar:
17337 + pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("as-char") );
17338 + break;
17339 + case enumXFAnchorFrame:
17340 + pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("frame") );
17341 + break;
17343 + pAttrList->AddAttribute( A2OUSTR("svg:x"), DoubleToOUString(m_aRect.GetX()) + A2OUSTR("cm") );
17344 + pAttrList->AddAttribute( A2OUSTR("svg:y"), DoubleToOUString(m_aRect.GetY()) + A2OUSTR("cm") );
17345 + pAttrList->AddAttribute( A2OUSTR("svg:width"), DoubleToOUString(m_aRect.GetWidth()) + A2OUSTR("cm") );
17346 + pAttrList->AddAttribute( A2OUSTR("svg:height"), DoubleToOUString(m_aRect.GetHeight()) + A2OUSTR("cm") );
17347 + pAttrList->AddAttribute( A2OUSTR("draw:z-index"), Int32ToOUString(m_nZIndex) );
17349 + if( m_bUseLink )
17351 + pAttrList->AddAttribute( A2OUSTR("xlink:href"), m_strImageFile );
17352 + pAttrList->AddAttribute( A2OUSTR("xlink:type"), A2OUSTR("simple") );
17353 + pAttrList->AddAttribute( A2OUSTR("xlink:show"), A2OUSTR("embed") );
17354 + pAttrList->AddAttribute( A2OUSTR("xlink:actuate"), A2OUSTR("onLoad") );
17357 + pStrm->StartElement( A2OUSTR("draw:image") );
17358 + if( !m_bUseLink )
17360 + pAttrList->Clear();
17361 + pStrm->StartElement( A2OUSTR("office:binary-data") );
17362 + pStrm->Characters(m_strData);
17363 + pStrm->EndElement( A2OUSTR("office:binary-data") );
17365 + pStrm->EndElement( A2OUSTR("draw:image") );
17367 \ No newline at end of file
17368 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfimage.hxx lotuswordpro/source/filter/xfilter/xfimage.hxx
17369 --- lotuswordpro.bak/source/filter/xfilter/xfimage.hxx 1970-01-01 08:00:00.000000000 +0800
17370 +++ lotuswordpro/source/filter/xfilter/xfimage.hxx 2008-10-22 11:42:34.000000000 +0800
17371 @@ -0,0 +1,100 @@
17372 +/*************************************************************************
17374 + * The Contents of this file are made available subject to the terms of
17375 + * either of the following licenses
17377 + * - GNU Lesser General Public License Version 2.1
17378 + * - Sun Industry Standards Source License Version 1.1
17380 + * Sun Microsystems Inc., October, 2000
17382 + * GNU Lesser General Public License Version 2.1
17383 + * =============================================
17384 + * Copyright 2000 by Sun Microsystems, Inc.
17385 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
17387 + * This library is free software; you can redistribute it and/or
17388 + * modify it under the terms of the GNU Lesser General Public
17389 + * License version 2.1, as published by the Free Software Foundation.
17391 + * This library is distributed in the hope that it will be useful,
17392 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
17393 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17394 + * Lesser General Public License for more details.
17396 + * You should have received a copy of the GNU Lesser General Public
17397 + * License along with this library; if not, write to the Free Software
17398 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
17399 + * MA 02111-1307 USA
17402 + * Sun Industry Standards Source License Version 1.1
17403 + * =================================================
17404 + * The contents of this file are subject to the Sun Industry Standards
17405 + * Source License Version 1.1 (the "License"); You may not use this file
17406 + * except in compliance with the License. You may obtain a copy of the
17407 + * License at http://www.openoffice.org/license.html.
17409 + * Software provided under this License is provided on an "AS IS" basis,
17410 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
17411 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
17412 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
17413 + * See the License for the specific provisions governing your rights and
17414 + * obligations concerning the Software.
17416 + * The Initial Developer of the Original Code is: IBM Corporation
17418 + * Copyright: 2008 by IBM Corporation
17420 + * All Rights Reserved.
17422 + * Contributor(s): _______________________________________
17425 + ************************************************************************/
17426 +/*************************************************************************
17427 + * @file
17428 + * Image object.
17429 + ************************************************************************/
17430 +/*************************************************************************
17431 + * Change History
17432 + 2005-02-22 create and implemente.
17433 + ************************************************************************/
17434 +#ifndef _XFIMAGE_HXX
17435 +#define _XFIMAGE_HXX
17437 +#include "xfframe.hxx"
17439 +/**
17440 + * @brief
17441 + * Image obejct.
17442 + * There are two way to import an image, file link or base64 stream.
17443 + */
17444 +class XFImage : public XFFrame
17446 +public:
17447 + XFImage();
17449 +public:
17450 + /**
17451 + * @descr Use file link source.a
17452 + */
17453 + void SetFileURL(rtl::OUString url);
17455 + /**
17456 + * @descr Use base64 stream.
17457 + */
17458 + void SetImageData(sal_uInt8 *buf, int len);
17460 + /**
17461 + * @descr Output image.
17462 + */
17463 + virtual void ToXml(IXFStream *pStrm);
17465 +private:
17466 + rtl::OUString m_strImageFile;
17467 + rtl::OUString m_strData;
17468 + sal_Bool m_bUseLink;
17471 +#endif
17472 \ No newline at end of file
17473 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfimagestyle.cxx lotuswordpro/source/filter/xfilter/xfimagestyle.cxx
17474 --- lotuswordpro.bak/source/filter/xfilter/xfimagestyle.cxx 1970-01-01 08:00:00.000000000 +0800
17475 +++ lotuswordpro/source/filter/xfilter/xfimagestyle.cxx 2008-10-22 11:42:34.000000000 +0800
17476 @@ -0,0 +1,212 @@
17477 +/*************************************************************************
17479 + * The Contents of this file are made available subject to the terms of
17480 + * either of the following licenses
17482 + * - GNU Lesser General Public License Version 2.1
17483 + * - Sun Industry Standards Source License Version 1.1
17485 + * Sun Microsystems Inc., October, 2000
17487 + * GNU Lesser General Public License Version 2.1
17488 + * =============================================
17489 + * Copyright 2000 by Sun Microsystems, Inc.
17490 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
17492 + * This library is free software; you can redistribute it and/or
17493 + * modify it under the terms of the GNU Lesser General Public
17494 + * License version 2.1, as published by the Free Software Foundation.
17496 + * This library is distributed in the hope that it will be useful,
17497 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
17498 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17499 + * Lesser General Public License for more details.
17501 + * You should have received a copy of the GNU Lesser General Public
17502 + * License along with this library; if not, write to the Free Software
17503 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
17504 + * MA 02111-1307 USA
17507 + * Sun Industry Standards Source License Version 1.1
17508 + * =================================================
17509 + * The contents of this file are subject to the Sun Industry Standards
17510 + * Source License Version 1.1 (the "License"); You may not use this file
17511 + * except in compliance with the License. You may obtain a copy of the
17512 + * License at http://www.openoffice.org/license.html.
17514 + * Software provided under this License is provided on an "AS IS" basis,
17515 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
17516 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
17517 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
17518 + * See the License for the specific provisions governing your rights and
17519 + * obligations concerning the Software.
17521 + * The Initial Developer of the Original Code is: IBM Corporation
17523 + * Copyright: 2008 by IBM Corporation
17525 + * All Rights Reserved.
17527 + * Contributor(s): _______________________________________
17530 + ************************************************************************/
17531 +/*************************************************************************
17532 + * @file
17533 + * Image style object.
17534 + ************************************************************************/
17535 +/*************************************************************************
17536 + * Change History
17537 + 2005-02-22 create and implemente.
17538 + ************************************************************************/
17539 +#include "xfimagestyle.hxx"
17540 +#include "xfborders.hxx"
17541 +#include "xfshadow.hxx"
17543 +XFImageStyle::XFImageStyle()
17545 + m_nBrightness = 0;
17546 + m_nContrast = 0;
17547 + m_nGamma = 0;
17548 + m_nTransparent = 0;
17549 + m_nAdjustRed = 0;
17550 + m_nAdjustGreen = 0;
17551 + m_nAdjustBlue = 0;
17552 + m_fClipLeft = 0;
17553 + m_fClipRight = 0;
17554 + m_fClipTop = 0;
17555 + m_fClipBottom = 0;
17556 + m_bHoriFlip = sal_False;
17557 + m_bVertFlip = sal_False;
17558 + m_eColorMode = enumXFColorStandard;
17561 +void XFImageStyle::ToXml(IXFStream *pStrm)
17563 + IXFAttrList *pAttrList = pStrm->GetAttrList();
17565 + pAttrList->Clear();
17566 + pAttrList->AddAttribute( A2OUSTR("style:name"), GetStyleName() );
17567 + if( GetParentStyleName().getLength() > 0 )
17568 + pAttrList->AddAttribute(A2OUSTR("style:parent-style-name"),GetParentStyleName());
17569 + pAttrList->AddAttribute( A2OUSTR("style:family"), A2OUSTR("graphics") );
17570 + //parent style name ignore now.
17571 + pStrm->StartElement( A2OUSTR("style:style") );
17573 + m_aMargins.ToXml(pStrm);
17575 + pAttrList->Clear();
17577 + if( m_eWrap == enumXFWrapBackground )
17579 + pAttrList->AddAttribute( A2OUSTR("style:run-through"), A2OUSTR("background") );
17581 + else
17583 + pAttrList->AddAttribute( A2OUSTR("style:run-through"), A2OUSTR("foreground") );
17585 + if( m_eWrap == enumXFWrapNone )
17586 + pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("none") );
17587 + else if( m_eWrap == enumXFWrapLeft )
17588 + pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("left") );
17589 + else if( m_eWrap == enumXFWrapRight )
17590 + pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("right") );
17591 + else if( m_eWrap == enumXFWrapParallel )
17592 + pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("parallel") );
17593 + else if( m_eWrap == enumXFWrapRunThrough )
17594 + pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("run-through") );
17595 + else if( m_eWrap == enumXFWrapBest )
17596 + pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("dynamic") );
17598 + //background
17599 + if( m_aBackColor.IsValid() )
17600 + pAttrList->AddAttribute( A2OUSTR("fo:background-color"), m_aBackColor.ToString() );
17601 + //pad
17602 + m_aPad.ToXml(pStrm);
17603 + //margin:
17604 + m_aMargins.ToXml(pStrm);
17605 + //flip
17606 + if( m_bHoriFlip || m_bVertFlip )
17608 + if( m_bHoriFlip && m_bVertFlip )
17609 + pAttrList->AddAttribute( A2OUSTR("style:mirror"), A2OUSTR("horizontal-on-right-pages vertical") );
17610 + else if( m_bHoriFlip && !m_bVertFlip )
17611 + pAttrList->AddAttribute( A2OUSTR("style:mirror"), A2OUSTR("horizontal-on-right-pages") );
17612 + else if( !m_bHoriFlip && m_bVertFlip )
17613 + pAttrList->AddAttribute( A2OUSTR("style:mirror"), A2OUSTR("vertical") );
17615 + //color adjust
17616 + if( m_nAdjustRed )
17617 + pAttrList->AddAttribute( A2OUSTR("draw:red"), Int32ToOUString(m_nAdjustRed) + A2OUSTR("%") );
17618 + if( m_nAdjustGreen )
17619 + pAttrList->AddAttribute( A2OUSTR("draw:green"), Int32ToOUString(m_nAdjustGreen) + A2OUSTR("%") );
17620 + if( m_nAdjustBlue )
17621 + pAttrList->AddAttribute( A2OUSTR("draw:blue"), Int32ToOUString(m_nAdjustBlue) + A2OUSTR("%") );
17623 + if( m_nGamma )
17624 + pAttrList->AddAttribute( A2OUSTR("draw:gamma"), Int32ToOUString(m_nGamma) );
17625 + if( m_nBrightness )
17626 + pAttrList->AddAttribute( A2OUSTR("draw:luminance"), Int32ToOUString(m_nBrightness) + A2OUSTR("%") );
17627 + if( m_nContrast )
17628 + pAttrList->AddAttribute( A2OUSTR("draw:contrast"), Int32ToOUString(m_nContrast) + A2OUSTR("%") );
17630 + if( m_nTransparent )
17631 + pAttrList->AddAttribute( A2OUSTR("draw:transparency"), Int32ToOUString(m_nTransparent) + A2OUSTR("%") );
17633 + pAttrList->AddAttribute(A2OUSTR("draw:color-mode"), GetColorMode(m_eColorMode));
17634 + //border
17635 + if( m_pBorders )
17636 + m_pBorders->ToXml(pStrm);
17637 + //shadow
17638 + if( m_pShadow )
17639 + m_pShadow->ToXml(pStrm);
17641 + if( m_bPrintable )
17642 + pAttrList->AddAttribute( A2OUSTR("style:print-content"), A2OUSTR("true") );
17643 + //protect:
17644 + if( m_bProtectContent || m_bProtectSize || m_bProtectPos )
17646 + rtl::OUString protect;
17647 + if( m_bProtectContent )
17648 + protect += A2OUSTR("content");
17649 + if( m_bProtectSize )
17651 + if( protect.getLength()>0 )
17652 + protect += A2OUSTR(" ");
17653 + protect += A2OUSTR("size");
17655 + if( m_bProtectPos )
17657 + if( protect.getLength()>0 )
17658 + protect += A2OUSTR(" ");
17659 + protect += A2OUSTR("position");
17661 + pAttrList->AddAttribute( A2OUSTR("style:protect"), protect );
17663 + //vertical pos and horizon pos:
17664 + pAttrList->AddAttribute( A2OUSTR("style:vertical-pos"), GetFrameYPos(m_eYPos) );
17665 + pAttrList->AddAttribute( A2OUSTR("style:vertical-rel"), GetFrameYRel(m_eYRel) );
17666 + pAttrList->AddAttribute( A2OUSTR("style:horizontal-pos"), GetFrameXPos(m_eXPos) );
17667 + pAttrList->AddAttribute( A2OUSTR("style:horizontal-rel"), GetFrameXRel(m_eXRel) );
17669 + //clip:
17670 + if( FABS(m_fClipLeft)>FLOAT_MIN || FABS(m_fClipRight)>FLOAT_MIN || FABS(m_fClipTop)>FLOAT_MIN || FABS(m_fClipBottom)>FLOAT_MIN )
17671 + {
17672 + rtl::OUString clip = A2OUSTR("rect(");
17673 + clip += DoubleToOUString(m_fClipTop) + A2OUSTR("cm ");
17674 + clip += DoubleToOUString(m_fClipRight) + A2OUSTR("cm ");
17675 + clip += DoubleToOUString(m_fClipBottom) + A2OUSTR("cm ");
17676 + clip += DoubleToOUString(m_fClipLeft) + A2OUSTR("cm");
17677 + clip += A2OUSTR(")");
17678 + pAttrList->AddAttribute(A2OUSTR("fo:clip"),clip);
17681 + //
17682 + pStrm->StartElement( A2OUSTR("style:properties") );
17683 + pStrm->EndElement( A2OUSTR("style:properties") );
17685 + pStrm->EndElement( A2OUSTR("style:style") );
17689 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfimagestyle.hxx lotuswordpro/source/filter/xfilter/xfimagestyle.hxx
17690 --- lotuswordpro.bak/source/filter/xfilter/xfimagestyle.hxx 1970-01-01 08:00:00.000000000 +0800
17691 +++ lotuswordpro/source/filter/xfilter/xfimagestyle.hxx 2008-10-22 11:42:34.000000000 +0800
17692 @@ -0,0 +1,164 @@
17693 +/*************************************************************************
17695 + * The Contents of this file are made available subject to the terms of
17696 + * either of the following licenses
17698 + * - GNU Lesser General Public License Version 2.1
17699 + * - Sun Industry Standards Source License Version 1.1
17701 + * Sun Microsystems Inc., October, 2000
17703 + * GNU Lesser General Public License Version 2.1
17704 + * =============================================
17705 + * Copyright 2000 by Sun Microsystems, Inc.
17706 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
17708 + * This library is free software; you can redistribute it and/or
17709 + * modify it under the terms of the GNU Lesser General Public
17710 + * License version 2.1, as published by the Free Software Foundation.
17712 + * This library is distributed in the hope that it will be useful,
17713 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
17714 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17715 + * Lesser General Public License for more details.
17717 + * You should have received a copy of the GNU Lesser General Public
17718 + * License along with this library; if not, write to the Free Software
17719 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
17720 + * MA 02111-1307 USA
17723 + * Sun Industry Standards Source License Version 1.1
17724 + * =================================================
17725 + * The contents of this file are subject to the Sun Industry Standards
17726 + * Source License Version 1.1 (the "License"); You may not use this file
17727 + * except in compliance with the License. You may obtain a copy of the
17728 + * License at http://www.openoffice.org/license.html.
17730 + * Software provided under this License is provided on an "AS IS" basis,
17731 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
17732 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
17733 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
17734 + * See the License for the specific provisions governing your rights and
17735 + * obligations concerning the Software.
17737 + * The Initial Developer of the Original Code is: IBM Corporation
17739 + * Copyright: 2008 by IBM Corporation
17741 + * All Rights Reserved.
17743 + * Contributor(s): _______________________________________
17746 + ************************************************************************/
17747 +/*************************************************************************
17748 + * @file
17749 + * Image style object.
17750 + ************************************************************************/
17751 +/*************************************************************************
17752 + * Change History
17753 + 2005-02-22 create this file.
17754 + 2005-02-25 make it inherit from XFFrameStyle.
17755 + ************************************************************************/
17756 +#ifndef _XFIMAGESTYLE_HXX
17757 +#define _XFIMAGESTYLE_HXX
17759 +#include "xfframestyle.hxx"
17760 +#include "xfrect.hxx"
17762 +class XFImageStyle : public XFFrameStyle
17764 +public:
17765 + XFImageStyle();
17767 +public:
17768 + void SetBrightness(sal_Int32 brightness);
17770 + void SetContrast(sal_Int32 contrast);
17772 + void SetGamma(sal_Int32 gamma);
17774 + void SetTransparent(sal_Int32 transparent);
17776 + void SetAdjustRed(sal_Int32 red);
17778 + void SetAdjustGreen(sal_Int32 green);
17780 + void SetAdjustBlue(sal_Int32 blue);
17782 + void SetClip(double left, double right, double top, double bottom);
17784 + void SetFlip(sal_Bool hori, sal_Bool vert);
17786 + void SetColorMode(enumXFColorMode mode);
17788 + virtual void ToXml(IXFStream *pStrm);
17790 +private:
17791 + sal_Int32 m_nBrightness;
17792 + sal_Int32 m_nContrast;
17793 + sal_Int32 m_nGamma;
17794 + sal_Int32 m_nTransparent;
17795 + sal_Int32 m_nAdjustRed;
17796 + sal_Int32 m_nAdjustGreen;
17797 + sal_Int32 m_nAdjustBlue;
17798 + double m_fClipLeft;
17799 + double m_fClipRight;
17800 + double m_fClipTop;
17801 + double m_fClipBottom;
17802 + sal_Bool m_bHoriFlip;
17803 + sal_Bool m_bVertFlip;
17804 + enumXFColorMode m_eColorMode;
17807 +inline void XFImageStyle::SetBrightness(sal_Int32 brightness)
17809 + m_nBrightness = brightness;
17812 +inline void XFImageStyle::SetContrast(sal_Int32 contrast)
17814 + m_nContrast = contrast;
17817 +inline void XFImageStyle::SetGamma(sal_Int32 gamma)
17819 + m_nGamma = gamma;
17822 +inline void XFImageStyle::SetTransparent(sal_Int32 transparent)
17824 + m_nTransparent = transparent;
17827 +inline void XFImageStyle::SetAdjustRed(sal_Int32 red)
17829 + m_nAdjustRed = red;
17832 +inline void XFImageStyle::SetAdjustGreen(sal_Int32 green)
17834 + m_nAdjustGreen = green;
17837 +inline void XFImageStyle::SetAdjustBlue(sal_Int32 blue)
17839 + m_nAdjustBlue = blue;
17842 +inline void XFImageStyle::SetClip(double left, double right, double top, double bottom)
17844 + m_fClipLeft = left;
17845 + m_fClipRight = right;
17846 + m_fClipTop = top;
17847 + m_fClipBottom = bottom;
17850 +inline void XFImageStyle::SetFlip(sal_Bool hori, sal_Bool vert)
17852 + m_bHoriFlip = hori;
17853 + m_bVertFlip = vert;
17856 +#endif
17857 \ No newline at end of file
17858 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfindex.cxx lotuswordpro/source/filter/xfilter/xfindex.cxx
17859 --- lotuswordpro.bak/source/filter/xfilter/xfindex.cxx 1970-01-01 08:00:00.000000000 +0800
17860 +++ lotuswordpro/source/filter/xfilter/xfindex.cxx 2008-10-22 11:42:34.000000000 +0800
17861 @@ -0,0 +1,450 @@
17862 +/*************************************************************************
17864 + * The Contents of this file are made available subject to the terms of
17865 + * either of the following licenses
17867 + * - GNU Lesser General Public License Version 2.1
17868 + * - Sun Industry Standards Source License Version 1.1
17870 + * Sun Microsystems Inc., October, 2000
17872 + * GNU Lesser General Public License Version 2.1
17873 + * =============================================
17874 + * Copyright 2000 by Sun Microsystems, Inc.
17875 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
17877 + * This library is free software; you can redistribute it and/or
17878 + * modify it under the terms of the GNU Lesser General Public
17879 + * License version 2.1, as published by the Free Software Foundation.
17881 + * This library is distributed in the hope that it will be useful,
17882 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
17883 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17884 + * Lesser General Public License for more details.
17886 + * You should have received a copy of the GNU Lesser General Public
17887 + * License along with this library; if not, write to the Free Software
17888 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
17889 + * MA 02111-1307 USA
17892 + * Sun Industry Standards Source License Version 1.1
17893 + * =================================================
17894 + * The contents of this file are subject to the Sun Industry Standards
17895 + * Source License Version 1.1 (the "License"); You may not use this file
17896 + * except in compliance with the License. You may obtain a copy of the
17897 + * License at http://www.openoffice.org/license.html.
17899 + * Software provided under this License is provided on an "AS IS" basis,
17900 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
17901 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
17902 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
17903 + * See the License for the specific provisions governing your rights and
17904 + * obligations concerning the Software.
17906 + * The Initial Developer of the Original Code is: IBM Corporation
17908 + * Copyright: 2008 by IBM Corporation
17910 + * All Rights Reserved.
17912 + * Contributor(s): _______________________________________
17915 + ************************************************************************/
17916 +/*************************************************************************
17917 + * @file
17918 + * Represente index source,index body and index index entry.
17919 + ************************************************************************/
17920 +/*************************************************************************
17921 + * Change History
17922 + 2005-02-02 create and implemente.
17923 + ************************************************************************/
17924 +#include "xfindex.hxx"
17925 +#include "xfparagraph.hxx"
17927 +XFIndex::XFIndex()
17929 + m_pTitle = NULL;
17930 + m_eType = enumXFIndexTOC;
17931 + m_bProtect = sal_True;
17932 + m_bSeparator = sal_False;
17933 + m_nMaxLevel = 0;
17935 + for(sal_uInt16 i=1;i<MAX_TOC_LEVEL+1;i++)
17937 + m_aTOCSource[i].clear();
17941 +XFIndex::~XFIndex()
17943 + if( m_pTitle )
17944 + delete m_pTitle;
17946 + for(sal_uInt16 i=1;i<MAX_TOC_LEVEL+1;i++)
17948 + m_aTOCSource[i].clear();
17951 + while(m_aTemplates.size()>0)
17953 + XFIndexTemplate * pTemplate = m_aTemplates.back();
17954 + m_aTemplates.pop_back();
17955 + delete pTemplate;pTemplate=NULL;
17959 +void XFIndex::SetSectionStyle(rtl::OUString strSectStyleName)
17961 + SetStyleName(strSectStyleName);
17964 +void XFIndex::SetTitle(rtl::OUString title, rtl::OUString strParaStyle)
17966 + m_strTitle = title;
17968 + m_pTitle = new XFParagraph();
17969 + m_pTitle->SetStyleName(strParaStyle);
17970 + m_pTitle->Add(m_strTitle);
17973 +void XFIndex::AddTemplate(sal_uInt32 level,
17974 + rtl::OUString style,
17975 + enumXFIndexTemplate type1,
17976 + enumXFIndexTemplate type2,
17977 + enumXFIndexTemplate type3,
17978 + enumXFIndexTemplate type4 )
17980 + if( level<1 )
17981 + return;
17983 + if (level > m_nMaxLevel)
17984 + m_nMaxLevel = level;
17986 + XFIndexTemplate * templ = new XFIndexTemplate();
17988 + templ->AddEntry(type1);
17989 + templ->AddEntry(type2);
17990 + templ->AddEntry(type3);
17991 + templ->AddEntry(type4);
17992 + templ->SetLevel( rtl::OUString::valueOf( ( sal_Int64 ) level ) );
17994 + m_aTemplates.push_back( templ );
17997 +void XFIndex::AddTemplate(rtl::OUString level, rtl::OUString style, XFIndexTemplate* templ)
17999 +// if( level<1 || !templ )
18000 +// return;
18002 +// if (level > m_nMaxLevel)
18003 +// m_nMaxLevel = level;
18005 + templ->SetLevel( level );
18006 + if(m_eType != enumXFIndexTOC) // TOC's styles are applied to template entries separately
18007 + {
18008 + templ->SetStyleName( style );
18010 + m_aTemplates.push_back( templ );
18013 +void XFIndex::AddEntry(rtl::OUString entry, rtl::OUString strParaStyle)
18015 + XFParagraph *pPara = new XFParagraph();
18016 + pPara->SetStyleName(strParaStyle);
18017 + pPara->Add(entry);
18018 + pPara->Add(new XFTabStop());
18019 + XFContentContainer::Add(pPara);
18022 +sal_Int32 XFIndex::GetEntryCount()
18024 + return GetCount();
18027 +void XFIndex::SetProtected(sal_Bool protect)
18029 + m_bProtect = protect;
18032 +void XFIndex::SetSeparator(sal_Bool sep)
18034 + m_bSeparator = sep;
18037 +void XFIndex::AddTocSource(sal_uInt16 nLevel, const rtl::OUString sStyleName)
18039 + if (nLevel > MAX_TOC_LEVEL)
18041 + return;
18044 + m_aTOCSource[nLevel].push_back(sStyleName);
18047 +void XFIndex::SetDefaultAlphaIndex(rtl::OUString strDivision,sal_Bool bRunin, sal_Bool bSeparator)
18049 + XFIndexTemplate * pTemplateSep = new XFIndexTemplate();
18050 + if (bSeparator)
18052 + SetSeparator(sal_True);
18053 + pTemplateSep->AddEntry(enumXFIndexTemplateText,A2OUSTR(""));
18055 + AddTemplate(A2OUSTR("separator"),A2OUSTR("Separator"),pTemplateSep);
18057 + XFIndexTemplate * pTemplate1 = new XFIndexTemplate();
18058 + pTemplate1->AddEntry(enumXFIndexTemplateText,A2OUSTR(""));
18059 + pTemplate1->AddEntry(enumXFIndexTemplateTab,A2OUSTR(""));
18060 + pTemplate1->AddEntry(enumXFIndexTemplatePage,A2OUSTR(""));
18061 + AddTemplate(Int32ToOUString(1),A2OUSTR("Primary"),pTemplate1);
18063 + XFIndexTemplate * pTemplate2 = new XFIndexTemplate();
18064 + pTemplate2->AddEntry(enumXFIndexTemplateText,A2OUSTR(""));
18065 + pTemplate2->AddEntry(enumXFIndexTemplateTab,A2OUSTR(""));
18066 + pTemplate2->AddEntry(enumXFIndexTemplatePage,A2OUSTR(""));
18067 + XFIndexTemplate * pTemplate3 = new XFIndexTemplate();
18068 + pTemplate3->AddEntry(enumXFIndexTemplateText,A2OUSTR(""));
18069 + pTemplate3->AddEntry(enumXFIndexTemplateTab,A2OUSTR(""));
18070 + pTemplate3->AddEntry(enumXFIndexTemplatePage,A2OUSTR(""));
18072 + if (bRunin)
18074 + AddTemplate(Int32ToOUString(2),A2OUSTR("Primary"),pTemplate2);
18075 + AddTemplate(Int32ToOUString(3),A2OUSTR("Primary"),pTemplate3);
18077 + else
18079 + AddTemplate(Int32ToOUString(2),A2OUSTR("Secondary"),pTemplate2);
18080 + AddTemplate(Int32ToOUString(3),A2OUSTR("Secondary"),pTemplate3);
18084 +void XFIndex::ToXml(IXFStream *pStrm)
18086 + IXFAttrList *pAttrList = pStrm->GetAttrList();
18087 + pAttrList->Clear();
18088 + rtl::OUString strIndexName;
18089 + rtl::OUString strTplName;
18090 + rtl::OUString strSourceName;
18092 + if(m_eType == enumXFIndexTOC )
18094 + strIndexName = A2OUSTR("text:table-of-content");
18095 + strSourceName = A2OUSTR("text:table-of-content-source");
18096 + strTplName = A2OUSTR("text:table-of-content-entry-template");
18098 + else if( m_eType == enumXFIndexAlphabetical )
18100 + strIndexName = A2OUSTR("text:alphabetical-index");
18101 + strSourceName = A2OUSTR("text:alphabetical-index-source");
18102 + strTplName = A2OUSTR("text:alphabetical-index-entry-template");
18104 + else if( m_eType == enumXFIndexUserIndex )
18106 + strIndexName = A2OUSTR("text:user-index");
18107 + strSourceName = A2OUSTR("text:text:user-index-source");
18108 + strTplName = A2OUSTR("text:user-index-entry-template");
18110 + else if( m_eType == enumXFIndexObject )
18112 + strIndexName = A2OUSTR("text:object-index");
18113 + strSourceName = A2OUSTR("text:object-index-source");
18114 + strTplName = A2OUSTR("text:object-index-entry-template");
18116 + else if( m_eType == enumXFIndexIllustration )
18118 + strIndexName = A2OUSTR("text:illustration-index");
18119 + strSourceName = A2OUSTR("text:illustration-index-source");
18120 + strTplName = A2OUSTR("text:illustration-index-entry-template");
18122 + else if( m_eType == enumXFIndexTableIndex )
18124 + strIndexName = A2OUSTR("text:table-index");
18125 + strSourceName = A2OUSTR("text:table-index-source");
18126 + strTplName = A2OUSTR("text:table-index-entry-template");
18129 + if( GetStyleName().getLength() > 0 )
18130 + pAttrList->AddAttribute( A2OUSTR("text:style-name"), GetStyleName() );
18131 + if( m_bProtect )
18132 + pAttrList->AddAttribute( A2OUSTR("text:protected"), A2OUSTR("true") );
18133 + else
18134 + pAttrList->AddAttribute( A2OUSTR("text:protected"), A2OUSTR("false") );
18136 + pAttrList->AddAttribute( A2OUSTR("text:name"), m_strTitle );
18137 + pStrm->StartElement( strIndexName );
18139 + //text:table-of-content-source:
18140 + pAttrList->Clear();
18142 + if(m_eType == enumXFIndexTOC )
18144 + pAttrList->AddAttribute( A2OUSTR("text:outline-level"), Int32ToOUString(10));
18145 + pAttrList->AddAttribute( A2OUSTR("text:use-index-source-styles"), A2OUSTR("true"));
18146 + pAttrList->AddAttribute( A2OUSTR("text:use-index-marks"), A2OUSTR("true"));
18147 + pAttrList->AddAttribute( A2OUSTR("text:use-outline-level"), A2OUSTR("false"));
18149 + if (m_bSeparator)
18150 + pAttrList->AddAttribute( A2OUSTR("text:alphabetical-separators"), A2OUSTR("true") );
18152 + pStrm->StartElement( strSourceName );
18153 + //title template:
18154 + pAttrList->Clear();
18156 + pStrm->StartElement( A2OUSTR("text:index-title-template") );
18157 + pStrm->Characters( m_strTitle );
18158 + pStrm->EndElement( A2OUSTR("text:index-title-template") );
18160 + //entry templates:
18161 + std::vector<XFIndexTemplate *>::iterator it;
18162 + for (it = m_aTemplates.begin(); it != m_aTemplates.end(); it++)
18164 + (*it)->SetTagName( strTplName);
18165 + (*it)->ToXml(pStrm);
18168 + // by
18169 + if(m_eType == enumXFIndexTOC )
18171 + for(sal_uInt16 i=1; i <= MAX_TOC_LEVEL; i++)
18173 + if (m_aTOCSource[i].size() == 0)
18175 + // unnecessary to output this level
18176 + continue;
18179 + pAttrList->Clear();
18180 + pAttrList->AddAttribute( A2OUSTR("text:outline-level"), Int32ToOUString(i));
18181 + pStrm->StartElement( A2OUSTR("text:index-source-styles") );
18183 + std::vector<rtl::OUString>::iterator it;
18184 + for (it = m_aTOCSource[i].begin(); it != m_aTOCSource[i].end(); it++)
18186 + pAttrList->Clear();
18187 + pAttrList->AddAttribute( A2OUSTR("text:style-name"), *it);
18188 + pStrm->StartElement( A2OUSTR("text:index-source-style") );
18189 + pStrm->EndElement( A2OUSTR("text:index-source-style") );
18191 + pStrm->EndElement( A2OUSTR("text:index-source-styles") );
18195 + pStrm->EndElement( strSourceName );
18197 + //index-body:
18198 + pAttrList->Clear();
18199 + pStrm->StartElement( A2OUSTR("text:index-body") );
18200 + //index-title:
18201 + if(m_strTitle.getLength())
18203 + pAttrList->AddAttribute( A2OUSTR("text:name"), m_strTitle + A2OUSTR("_Head") );
18204 + pStrm->StartElement( A2OUSTR("text:index-title") );
18205 + if( m_pTitle )
18206 + m_pTitle->ToXml(pStrm);
18207 + pStrm->EndElement( A2OUSTR("text:index-title") );
18210 + XFContentContainer::ToXml(pStrm);
18211 + pStrm->EndElement( A2OUSTR("text:index-body") );
18213 + pStrm->EndElement( strIndexName );
18217 +void XFIndexTemplate::ToXml(IXFStream *pStrm)
18219 + IXFAttrList *pAttrList = pStrm->GetAttrList();
18220 + pAttrList->Clear();
18222 + pAttrList->AddAttribute( A2OUSTR("text:outline-level"), m_nLevel );
18223 + pAttrList->AddAttribute( A2OUSTR("text:style-name"), m_strStyle );
18224 + if( m_strTagName.getLength() == 0 )
18225 + m_strTagName = A2OUSTR("text:table-of-content-entry-template");
18226 + pStrm->StartElement( m_strTagName );
18228 + for( size_t i=0; i<m_aEntries.size(); i++ )
18230 + pAttrList->Clear();
18232 + switch( m_aEntries[i].first )
18234 + case enumXFIndexTemplateChapter:
18235 + if(m_aEntries[i].second.getLength() > 0)
18236 + pAttrList->AddAttribute( A2OUSTR("text:style-name"), m_aEntries[i].second );
18238 + pStrm->StartElement( A2OUSTR("text:index-entry-chapter-number") );
18239 + pStrm->EndElement( A2OUSTR("text:index-entry-chapter-number") );
18240 + break;
18241 + case enumXFIndexTemplateText:
18242 + if(m_aEntries[i].second.getLength() > 0)
18243 + pAttrList->AddAttribute( A2OUSTR("text:style-name"), m_aEntries[i].second );
18245 + pStrm->StartElement( A2OUSTR("text:index-entry-text") );
18246 + pStrm->EndElement( A2OUSTR("text:index-entry-text") );
18247 + break;
18248 + case enumXFIndexTemplateTab:
18249 + if( m_eTabType != enumXFTabRight )
18250 + pAttrList->AddAttribute( A2OUSTR("style:position"), DoubleToOUString(m_fTabLength) + A2OUSTR("cm") );
18252 + if(m_aEntries[i].second.getLength() > 0)
18253 + pAttrList->AddAttribute( A2OUSTR("text:style-name"), m_aEntries[i].second );
18255 + switch(m_eTabType)
18257 + case enumXFTabLeft:
18258 + pAttrList->AddAttribute( A2OUSTR("style:type"), A2OUSTR("left") );
18259 + break;
18260 + case enumXFTabCenter:
18261 + pAttrList->AddAttribute( A2OUSTR("style:type"), A2OUSTR("center") );
18262 + break;
18263 + case enumXFTabRight:
18264 + pAttrList->AddAttribute( A2OUSTR("style:type"), A2OUSTR("right") );
18265 + break;
18266 + case enumXFTabChar:
18267 + pAttrList->AddAttribute( A2OUSTR("style:type"), A2OUSTR("char") );
18268 + break;
18270 + //delimiter:
18271 + if( m_eTabType == enumXFTabChar )
18272 + pAttrList->AddAttribute( A2OUSTR("style:char"), m_strTabDelimiter );
18273 + //leader char:
18274 + if( m_strTabLeader.getLength() )
18275 + pAttrList->AddAttribute( A2OUSTR("style:leader-char"), m_strTabLeader );
18277 + pStrm->StartElement( A2OUSTR("text:index-entry-tab-stop") );
18278 + pStrm->EndElement( A2OUSTR("text:index-entry-tab-stop") );
18279 + break;
18280 + case enumXFIndexTemplatePage:
18281 + if(m_aEntries[i].second.getLength() > 0)
18282 + pAttrList->AddAttribute( A2OUSTR("text:style-name"), m_aEntries[i].second );
18284 + pStrm->StartElement( A2OUSTR("text:index-entry-page-number") );
18285 + pStrm->EndElement( A2OUSTR("text:index-entry-page-number") );
18286 + break;
18287 + case enumXFIndexTemplateLinkStart:
18288 + pStrm->StartElement( A2OUSTR("text:index-entry-link-start") );
18289 + pStrm->EndElement( A2OUSTR("text:index-entry-link-start") );
18290 + break;
18291 + case enumXFIndexTemplateLinkEnd:
18292 + pStrm->StartElement( A2OUSTR("text:index-entry-link-end") );
18293 + pStrm->EndElement( A2OUSTR("text:index-entry-link-end") );
18294 + break;
18295 + case enumXFIndexTemplateSpan:
18296 + pAttrList->Clear();
18297 + pAttrList->AddAttribute(A2OUSTR("text:style-name"), GetStyleName());
18298 + pStrm->StartElement( A2OUSTR("text:index-entry-span") );
18299 + pStrm->Characters(m_aTextEntries[i]);
18300 + pStrm->EndElement( A2OUSTR("text:index-entry-span") );
18301 + break;
18302 + case enumXFIndexTemplateBibliography:
18303 + pStrm->StartElement( A2OUSTR("text:index-entry-bibliography") );
18304 + pStrm->EndElement( A2OUSTR("text:index-entry-bibliography") );
18305 + break;
18309 + pStrm->EndElement( m_strTagName );
18312 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfindex.hxx lotuswordpro/source/filter/xfilter/xfindex.hxx
18313 --- lotuswordpro.bak/source/filter/xfilter/xfindex.hxx 1970-01-01 08:00:00.000000000 +0800
18314 +++ lotuswordpro/source/filter/xfilter/xfindex.hxx 2008-10-22 11:42:34.000000000 +0800
18315 @@ -0,0 +1,282 @@
18316 +/*************************************************************************
18318 + * The Contents of this file are made available subject to the terms of
18319 + * either of the following licenses
18321 + * - GNU Lesser General Public License Version 2.1
18322 + * - Sun Industry Standards Source License Version 1.1
18324 + * Sun Microsystems Inc., October, 2000
18326 + * GNU Lesser General Public License Version 2.1
18327 + * =============================================
18328 + * Copyright 2000 by Sun Microsystems, Inc.
18329 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
18331 + * This library is free software; you can redistribute it and/or
18332 + * modify it under the terms of the GNU Lesser General Public
18333 + * License version 2.1, as published by the Free Software Foundation.
18335 + * This library is distributed in the hope that it will be useful,
18336 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
18337 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18338 + * Lesser General Public License for more details.
18340 + * You should have received a copy of the GNU Lesser General Public
18341 + * License along with this library; if not, write to the Free Software
18342 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
18343 + * MA 02111-1307 USA
18346 + * Sun Industry Standards Source License Version 1.1
18347 + * =================================================
18348 + * The contents of this file are subject to the Sun Industry Standards
18349 + * Source License Version 1.1 (the "License"); You may not use this file
18350 + * except in compliance with the License. You may obtain a copy of the
18351 + * License at http://www.openoffice.org/license.html.
18353 + * Software provided under this License is provided on an "AS IS" basis,
18354 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
18355 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
18356 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
18357 + * See the License for the specific provisions governing your rights and
18358 + * obligations concerning the Software.
18360 + * The Initial Developer of the Original Code is: IBM Corporation
18362 + * Copyright: 2008 by IBM Corporation
18364 + * All Rights Reserved.
18366 + * Contributor(s): _______________________________________
18369 + ************************************************************************/
18370 +/*************************************************************************
18371 + * @file
18372 + * Represente index source,index body and index index entry.
18373 + ************************************************************************/
18374 +/*************************************************************************
18375 + * Change History
18376 + 2005-02-02 create and implemente.
18377 + ************************************************************************/
18378 +#ifndef _XFINDEX_HXX
18379 +#define _XFINDEX_HXX
18380 +#include <map>
18381 +#include <vector>
18383 +#include "xfcontent.hxx"
18384 +#include "ixfproperty.hxx"
18385 +#include "xfcontentcontainer.hxx"
18386 +#include "xftabstop.hxx"
18388 +class XFIndex;
18389 +class XFIndexEntry;
18390 +class XFIndexTemplate;
18391 +class XFParagraph;
18393 +/**
18394 + * @brief
18395 + * Index template.
18396 + * When index update, the template is used to decide the index body.
18397 + */
18398 +class XFIndexTemplate : public XFContent
18400 +public:
18401 + XFIndexTemplate();
18403 +public:
18404 + /**
18405 + * @descr Set template level.
18406 + */
18407 + void SetLevel(rtl::OUString level);
18408 + /**
18409 + * @descr Set style.
18410 + */
18411 + void SetStyleName(rtl::OUString style);
18412 + /**
18413 + * @descr Add a entry in the template.
18414 + */
18415 + void AddEntry(enumXFIndexTemplate entry, rtl::OUString styleName = A2OUSTR(""));
18417 + /**
18418 + * @descr Add a tab entry in the template.
18419 + */
18420 + void AddTabEntry(enumXFTab type, double len, sal_Unicode leader = '*', sal_Unicode delimiter='.', rtl::OUString styleName = A2OUSTR(""));
18422 + /**
18423 + * @descr Add a entry in the template.
18424 + */
18425 + void AddTextEntry(rtl::OUString sSpan, rtl::OUString styleName = A2OUSTR(""));
18427 + /**
18428 + * @descr clear all index template parts.
18429 + */
18430 + void Clear();
18431 + virtual void ToXml(IXFStream *pStrm);
18433 +private:
18434 + /**
18435 + * @descr Helper function.
18436 + */
18437 + void SetTagName(rtl::OUString tag);
18439 + friend class XFIndex;
18440 +private:
18441 + rtl::OUString m_nLevel;
18442 + rtl::OUString m_strStyle;
18443 + enumXFTab m_eTabType;
18444 + double m_fTabLength;
18445 + rtl::OUString m_strTabDelimiter;
18446 + rtl::OUString m_strTabLeader;
18447 + rtl::OUString m_strTagName;
18448 + typedef std::pair<enumXFIndexTemplate, rtl::OUString> TOCTEMPLATE_ENTRY_TYPE;
18449 + std::vector<TOCTEMPLATE_ENTRY_TYPE> m_aEntries; // template entry + text style
18450 + std::map<sal_uInt16, rtl::OUString> m_aTextEntries;
18452 + rtl::OUString m_strChapterTextStyle;
18455 +/**
18456 + * @brief
18457 + * Index, include index template, index body.
18458 + */
18459 +class XFIndex : public XFContentContainer
18461 +public:
18462 + XFIndex();
18464 + virtual ~XFIndex();
18466 +public:
18467 + /**
18468 + * @descr Set index type.
18469 + */
18470 + void SetIndexType(enumXFIndex type);
18472 + /**
18473 + * @descr Set index section style. Perhaps you should create a section style first.
18474 + */
18475 + void SetSectionStyle(rtl::OUString strSectStyleName);
18477 + /**
18478 + * @descr Set index title.
18479 + */
18480 + void SetTitle(rtl::OUString title, rtl::OUString strParaStyle);
18482 + /**
18483 + * @descr Set index entry template.
18484 + * @param level [1-10].
18485 + */
18486 + void AddTemplate(sal_uInt32 level,
18487 + rtl::OUString style,
18488 + enumXFIndexTemplate type1 = enumXFIndexTemplateChapter,
18489 + enumXFIndexTemplate type2 = enumXFIndexTemplateText,
18490 + enumXFIndexTemplate type3 = enumXFIndexTemplateTab,
18491 + enumXFIndexTemplate type4 = enumXFIndexTemplatePage);
18493 + /**
18494 + * @descr Add index templaet entry.
18495 + */
18496 + void AddTemplate(rtl::OUString level, rtl::OUString style, XFIndexTemplate* templ);
18498 + /**
18499 + * @descr Add index entry.
18500 + */
18501 + void AddEntry(rtl::OUString entry, rtl::OUString strParaStyle);
18503 + /**
18504 + * @descr return entry count.
18505 + */
18506 + sal_Int32 GetEntryCount();
18508 + /**
18509 + * @descr Set if protected index to prevent handly-revise.
18510 + */
18511 + void SetProtected(sal_Bool protect);
18513 + /**
18514 + * @descr Set separator.
18515 + */
18516 + void SetSeparator(sal_Bool sep);
18518 + virtual void ToXml(IXFStream *pStrm);
18520 + void AddTocSource(sal_uInt16 nLevel, const rtl::OUString sStyleName);
18522 + /**
18523 + * @descr Set default value for index.
18524 + */
18525 + void SetDefaultAlphaIndex(rtl::OUString strDivision,sal_Bool bRunin, sal_Bool bSeparator);
18527 +private:
18528 + enumXFIndex m_eType;
18529 + rtl::OUString m_strTitle;
18530 + rtl::OUString m_strSectStyle;
18531 + bool m_bProtect;
18532 + bool m_bSeparator;
18533 + XFParagraph *m_pTitle;
18535 + std::vector<XFIndexTemplate *> m_aTemplates; // template entry + style
18537 + #define MAX_TOC_LEVEL 10
18538 + std::vector<rtl::OUString> m_aTOCSource[MAX_TOC_LEVEL+1];
18540 + sal_uInt32 m_nMaxLevel;
18543 +inline XFIndexTemplate::XFIndexTemplate()
18545 + m_nLevel = Int32ToOUString(0);
18548 +inline void XFIndexTemplate::SetLevel(rtl::OUString level)
18550 + m_nLevel = level;
18552 +inline void XFIndexTemplate::SetStyleName(rtl::OUString style)
18554 + m_strStyle = style;
18557 +inline void XFIndexTemplate::SetTagName(rtl::OUString tag)
18559 + m_strTagName = tag;
18562 +inline void XFIndexTemplate::AddEntry(enumXFIndexTemplate entry, rtl::OUString styleName)
18564 + std::pair<enumXFIndexTemplate, rtl::OUString> pair(entry, styleName);
18565 + m_aEntries.push_back(pair);
18568 +inline void XFIndexTemplate::AddTabEntry(enumXFTab type, double len, sal_Unicode leader, sal_Unicode delimiter, rtl::OUString styleName)
18570 + m_eTabType = type;
18571 + m_strTabLeader = rtl::OUString( leader );
18572 + m_strTabDelimiter = rtl::OUString( delimiter );
18573 + m_fTabLength = len;
18575 + AddEntry(enumXFIndexTemplateTab, styleName);
18578 +inline void XFIndexTemplate::AddTextEntry(rtl::OUString sText, rtl::OUString styleName)
18580 + sal_uInt16 nLen = m_aEntries.size();
18581 + AddEntry(enumXFIndexTemplateSpan, styleName);
18583 + m_aTextEntries[nLen] = sText;
18587 +inline void XFIndexTemplate::Clear()
18589 + m_aEntries.clear();
18592 +inline void XFIndex::SetIndexType(enumXFIndex type)
18594 + m_eType = type;
18597 +#endif
18598 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfinputlist.hxx lotuswordpro/source/filter/xfilter/xfinputlist.hxx
18599 --- lotuswordpro.bak/source/filter/xfilter/xfinputlist.hxx 1970-01-01 08:00:00.000000000 +0800
18600 +++ lotuswordpro/source/filter/xfilter/xfinputlist.hxx 2008-10-22 11:42:34.000000000 +0800
18601 @@ -0,0 +1,115 @@
18602 +/*************************************************************************
18604 + * The Contents of this file are made available subject to the terms of
18605 + * either of the following licenses
18607 + * - GNU Lesser General Public License Version 2.1
18608 + * - Sun Industry Standards Source License Version 1.1
18610 + * Sun Microsystems Inc., October, 2000
18612 + * GNU Lesser General Public License Version 2.1
18613 + * =============================================
18614 + * Copyright 2000 by Sun Microsystems, Inc.
18615 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
18617 + * This library is free software; you can redistribute it and/or
18618 + * modify it under the terms of the GNU Lesser General Public
18619 + * License version 2.1, as published by the Free Software Foundation.
18621 + * This library is distributed in the hope that it will be useful,
18622 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
18623 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18624 + * Lesser General Public License for more details.
18626 + * You should have received a copy of the GNU Lesser General Public
18627 + * License along with this library; if not, write to the Free Software
18628 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
18629 + * MA 02111-1307 USA
18632 + * Sun Industry Standards Source License Version 1.1
18633 + * =================================================
18634 + * The contents of this file are subject to the Sun Industry Standards
18635 + * Source License Version 1.1 (the "License"); You may not use this file
18636 + * except in compliance with the License. You may obtain a copy of the
18637 + * License at http://www.openoffice.org/license.html.
18639 + * Software provided under this License is provided on an "AS IS" basis,
18640 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
18641 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
18642 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
18643 + * See the License for the specific provisions governing your rights and
18644 + * obligations concerning the Software.
18646 + * The Initial Developer of the Original Code is: IBM Corporation
18648 + * Copyright: 2008 by IBM Corporation
18650 + * All Rights Reserved.
18652 + * Contributor(s): _______________________________________
18655 + ************************************************************************/
18656 +/*************************************************************************
18657 + * @file
18658 + * input list field.
18659 + ************************************************************************/
18660 +/*************************************************************************
18661 + * Change History
18662 + * 2005-05-27 create this file.
18663 + ************************************************************************/
18664 +#ifndef _XFINPUTLIST_HXX
18665 +#define _XFINPUTLIST_HXX
18667 +#include "xfcontent.hxx"
18669 +/**
18670 + * @brief
18671 + * input list field.
18672 + */
18673 +class XFInputList : public XFContent
18675 +public:
18676 + void SetName(rtl::OUString sName);
18677 + void SetLabels(std::vector<rtl::OUString> list);
18678 + virtual void ToXml(IXFStream *pStrm);
18679 +private:
18680 + rtl::OUString m_strName;
18681 + std::vector<rtl::OUString> m_list;
18684 +inline void XFInputList::SetName(rtl::OUString sName)
18686 + m_strName = sName;
18689 +inline void XFInputList::SetLabels(std::vector<rtl::OUString> list)
18691 + m_list=list;
18694 +inline void XFInputList::ToXml(IXFStream *pStrm)
18696 + IXFAttrList *pAttrList = pStrm->GetAttrList();
18697 + pAttrList->Clear();
18699 + pAttrList->AddAttribute( A2OUSTR("text:name"), m_strName );
18700 + pStrm->StartElement( A2OUSTR("text:drop-down") );
18702 + pAttrList->Clear();
18703 + pAttrList->AddAttribute( A2OUSTR("text:value"), A2OUSTR(" ") );
18704 + pStrm->StartElement( A2OUSTR("text:label") );
18705 + pStrm->EndElement( A2OUSTR("text:label") );
18706 + for(sal_uInt32 i=0; i< m_list.size();i++)
18708 + pAttrList->Clear();
18709 + pAttrList->AddAttribute( A2OUSTR("text:value"), m_list[i] );
18710 + pStrm->StartElement( A2OUSTR("text:label") );
18711 + pStrm->EndElement( A2OUSTR("text:label") );
18713 + pStrm->EndElement( A2OUSTR("text:drop-down") );
18716 +#endif
18717 \ No newline at end of file
18718 diff -urNp lotuswordpro.bak/source/filter/xfilter/xflinebreak.hxx lotuswordpro/source/filter/xfilter/xflinebreak.hxx
18719 --- lotuswordpro.bak/source/filter/xfilter/xflinebreak.hxx 1970-01-01 08:00:00.000000000 +0800
18720 +++ lotuswordpro/source/filter/xfilter/xflinebreak.hxx 2008-10-22 11:42:34.000000000 +0800
18721 @@ -0,0 +1,84 @@
18722 +/*************************************************************************
18724 + * The Contents of this file are made available subject to the terms of
18725 + * either of the following licenses
18727 + * - GNU Lesser General Public License Version 2.1
18728 + * - Sun Industry Standards Source License Version 1.1
18730 + * Sun Microsystems Inc., October, 2000
18732 + * GNU Lesser General Public License Version 2.1
18733 + * =============================================
18734 + * Copyright 2000 by Sun Microsystems, Inc.
18735 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
18737 + * This library is free software; you can redistribute it and/or
18738 + * modify it under the terms of the GNU Lesser General Public
18739 + * License version 2.1, as published by the Free Software Foundation.
18741 + * This library is distributed in the hope that it will be useful,
18742 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
18743 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18744 + * Lesser General Public License for more details.
18746 + * You should have received a copy of the GNU Lesser General Public
18747 + * License along with this library; if not, write to the Free Software
18748 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
18749 + * MA 02111-1307 USA
18752 + * Sun Industry Standards Source License Version 1.1
18753 + * =================================================
18754 + * The contents of this file are subject to the Sun Industry Standards
18755 + * Source License Version 1.1 (the "License"); You may not use this file
18756 + * except in compliance with the License. You may obtain a copy of the
18757 + * License at http://www.openoffice.org/license.html.
18759 + * Software provided under this License is provided on an "AS IS" basis,
18760 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
18761 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
18762 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
18763 + * See the License for the specific provisions governing your rights and
18764 + * obligations concerning the Software.
18766 + * The Initial Developer of the Original Code is: IBM Corporation
18768 + * Copyright: 2008 by IBM Corporation
18770 + * All Rights Reserved.
18772 + * Contributor(s): _______________________________________
18775 + ************************************************************************/
18776 +/**************************************************************************
18777 + * @file
18778 + * Line break object,<text:line-break/>
18779 + *************************************************************************/
18780 +/**************************************************************************
18781 + * Change History
18782 + * 2004-01-11 create this file.
18783 + *************************************************************************/
18784 +#ifndef _XFLINEBREAK_HXX
18785 +#define _XFLINEBREAK_HXX
18787 +#include "xfglobal.hxx"
18788 +#include "xfcontent.hxx"
18790 +class XFLineBreak : public XFContent
18792 +public:
18793 + virtual void ToXml(IXFStream *pStrm);
18796 +inline void XFLineBreak::ToXml(IXFStream *pStrm)
18798 + IXFAttrList *pAttrList = pStrm->GetAttrList();
18800 + pAttrList->Clear();
18801 + pStrm->StartElement( A2OUSTR("text:line-break") );
18802 + pStrm->EndElement( A2OUSTR("text:line-break") );
18805 +#endif
18806 \ No newline at end of file
18807 diff -urNp lotuswordpro.bak/source/filter/xfilter/xflineheight.hxx lotuswordpro/source/filter/xfilter/xflineheight.hxx
18808 --- lotuswordpro.bak/source/filter/xfilter/xflineheight.hxx 1970-01-01 08:00:00.000000000 +0800
18809 +++ lotuswordpro/source/filter/xfilter/xflineheight.hxx 2008-10-22 11:42:34.000000000 +0800
18810 @@ -0,0 +1,176 @@
18811 +/*************************************************************************
18813 + * The Contents of this file are made available subject to the terms of
18814 + * either of the following licenses
18816 + * - GNU Lesser General Public License Version 2.1
18817 + * - Sun Industry Standards Source License Version 1.1
18819 + * Sun Microsystems Inc., October, 2000
18821 + * GNU Lesser General Public License Version 2.1
18822 + * =============================================
18823 + * Copyright 2000 by Sun Microsystems, Inc.
18824 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
18826 + * This library is free software; you can redistribute it and/or
18827 + * modify it under the terms of the GNU Lesser General Public
18828 + * License version 2.1, as published by the Free Software Foundation.
18830 + * This library is distributed in the hope that it will be useful,
18831 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
18832 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18833 + * Lesser General Public License for more details.
18835 + * You should have received a copy of the GNU Lesser General Public
18836 + * License along with this library; if not, write to the Free Software
18837 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
18838 + * MA 02111-1307 USA
18841 + * Sun Industry Standards Source License Version 1.1
18842 + * =================================================
18843 + * The contents of this file are subject to the Sun Industry Standards
18844 + * Source License Version 1.1 (the "License"); You may not use this file
18845 + * except in compliance with the License. You may obtain a copy of the
18846 + * License at http://www.openoffice.org/license.html.
18848 + * Software provided under this License is provided on an "AS IS" basis,
18849 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
18850 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
18851 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
18852 + * See the License for the specific provisions governing your rights and
18853 + * obligations concerning the Software.
18855 + * The Initial Developer of the Original Code is: IBM Corporation
18857 + * Copyright: 2008 by IBM Corporation
18859 + * All Rights Reserved.
18861 + * Contributor(s): _______________________________________
18864 + ************************************************************************/
18865 +/*************************************************************************
18866 + * @file
18867 + * Line height for paragraph.
18868 + ************************************************************************/
18869 +/*************************************************************************
18870 + * Change History
18871 + * 2004-12-23 create this file.
18872 + ************************************************************************/
18873 +#ifndef _XFLINEHEIGHT_HXX
18874 +#define _XFLINEHEIGHT_HXX
18876 +class XFLineHeight
18878 +public:
18879 + XFLineHeight()
18881 + Reset();
18883 +public:
18884 + void SetHeight(double value);
18886 + void SetLeastHeight(double value);
18888 + void SetPercent(sal_Int32 value);
18890 + void SetSpace(double value);
18892 + void Reset();
18894 + void ToXml(IXFStream *pStrm);
18896 + enumLHType GetType();
18898 + friend bool operator==(XFLineHeight& indent1, XFLineHeight& indent2);
18899 + friend bool operator!=(XFLineHeight& indent1, XFLineHeight& indent2);
18900 +private:
18901 + union{
18902 + sal_Int32 m_nValue;
18903 + double m_fValue;
18904 + }m_Value;
18905 + enumLHType m_eType;
18908 +inline void XFLineHeight::SetHeight(double value)
18910 + m_Value.m_fValue = value;
18911 + m_eType = enumLHHeight;
18914 +inline void XFLineHeight::SetLeastHeight(double value)
18916 + m_Value.m_fValue = value;
18917 + m_eType = enumLHLeast;
18920 +inline void XFLineHeight::SetPercent(sal_Int32 value)
18922 + m_Value.m_nValue = value;
18923 + m_eType = enumLHPercent;
18925 +inline void XFLineHeight::SetSpace(double value)
18927 + m_Value.m_fValue = value;
18928 + m_eType = enumLHSpace;
18930 +inline void XFLineHeight::Reset()
18932 + m_eType = enumLHNone;
18933 + rtl_zeroMemory(&m_Value,sizeof(m_Value));
18936 +inline enumLHType XFLineHeight::GetType()
18938 + return m_eType;
18941 +inline void XFLineHeight::ToXml(IXFStream *pStrm)
18943 + IXFAttrList *pAttrList = pStrm->GetAttrList();
18945 + switch(m_eType)
18947 + case enumLHNone:
18948 + return;
18949 + case enumLHHeight:
18950 + pAttrList->AddAttribute( A2OUSTR("fo:line-height"),DoubleToOUString(m_Value.m_fValue) + A2OUSTR("cm") );
18951 + break;
18952 + case enumLHLeast:
18953 + pAttrList->AddAttribute( A2OUSTR("style:line-height-at-least"),DoubleToOUString(m_Value.m_fValue) + A2OUSTR("cm") );
18954 + break;
18955 + case enumLHPercent:
18956 + pAttrList->AddAttribute( A2OUSTR("fo:line-height"), DoubleToOUString(m_Value.m_nValue) + A2OUSTR("%") );
18957 + break;
18958 + case enumLHSpace:
18959 + pAttrList->AddAttribute( A2OUSTR("style:line-spacing"), DoubleToOUString(m_Value.m_fValue) + A2OUSTR("cm") );
18960 + break;
18964 +inline bool operator==(XFLineHeight& lh1, XFLineHeight& lh2)
18966 + if( lh1.m_eType != lh2.m_eType )
18967 + return false;
18968 + if( lh1.m_eType == enumLHPercent )
18970 + if( lh1.m_Value.m_nValue != lh2.m_Value.m_nValue )
18971 + return false;
18973 + else
18975 + if( lh1.m_Value.m_fValue != lh2.m_Value.m_fValue )
18976 + return false;
18978 + return true;
18981 +inline bool operator!=(XFLineHeight& lh1, XFLineHeight& lh2)
18983 + return !(lh1==lh2);
18986 +#endif
18987 \ No newline at end of file
18988 diff -urNp lotuswordpro.bak/source/filter/xfilter/xflinenumberconfig.hxx lotuswordpro/source/filter/xfilter/xflinenumberconfig.hxx
18989 --- lotuswordpro.bak/source/filter/xfilter/xflinenumberconfig.hxx 1970-01-01 08:00:00.000000000 +0800
18990 +++ lotuswordpro/source/filter/xfilter/xflinenumberconfig.hxx 2008-10-22 11:42:34.000000000 +0800
18991 @@ -0,0 +1,211 @@
18992 +/*************************************************************************
18994 + * The Contents of this file are made available subject to the terms of
18995 + * either of the following licenses
18997 + * - GNU Lesser General Public License Version 2.1
18998 + * - Sun Industry Standards Source License Version 1.1
19000 + * Sun Microsystems Inc., October, 2000
19002 + * GNU Lesser General Public License Version 2.1
19003 + * =============================================
19004 + * Copyright 2000 by Sun Microsystems, Inc.
19005 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
19007 + * This library is free software; you can redistribute it and/or
19008 + * modify it under the terms of the GNU Lesser General Public
19009 + * License version 2.1, as published by the Free Software Foundation.
19011 + * This library is distributed in the hope that it will be useful,
19012 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
19013 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19014 + * Lesser General Public License for more details.
19016 + * You should have received a copy of the GNU Lesser General Public
19017 + * License along with this library; if not, write to the Free Software
19018 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
19019 + * MA 02111-1307 USA
19022 + * Sun Industry Standards Source License Version 1.1
19023 + * =================================================
19024 + * The contents of this file are subject to the Sun Industry Standards
19025 + * Source License Version 1.1 (the "License"); You may not use this file
19026 + * except in compliance with the License. You may obtain a copy of the
19027 + * License at http://www.openoffice.org/license.html.
19029 + * Software provided under this License is provided on an "AS IS" basis,
19030 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
19031 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
19032 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
19033 + * See the License for the specific provisions governing your rights and
19034 + * obligations concerning the Software.
19036 + * The Initial Developer of the Original Code is: IBM Corporation
19038 + * Copyright: 2008 by IBM Corporation
19040 + * All Rights Reserved.
19042 + * Contributor(s): _______________________________________
19045 + ************************************************************************/
19046 +/*************************************************************************
19047 + * @file
19048 + * Line numbering config for the full document.
19049 + ************************************************************************/
19050 +/*************************************************************************
19051 + * Change History
19052 + * 2005-03-23 create this file.
19053 + ************************************************************************/
19054 +#ifndef _XFLINENUMBERCONFIG_HXX
19055 +#define _XFLINENUMBERCONFIG_HXX
19057 +#include "xfstyle.hxx"
19059 +class XFLineNumberConfig : public XFStyle
19061 +public:
19062 + XFLineNumberConfig();
19064 +public:
19065 + void SetNumberOffset(double offset);
19067 + void SetNumberPosition(enumXFLineNumberPos pos);
19069 + void SetNumberIncrement(sal_Int32 increment);
19071 + void SetSeperator(sal_Int32 increment, rtl::OUString seperator);
19073 + void SetNumberFormat(rtl::OUString numfmt = A2OUSTR("1"));
19075 + void SetTextStyle(rtl::OUString style);
19077 + void SetRestartOnPage(sal_Bool restart = sal_True);
19079 + void SetCountEmptyLines(sal_Bool empty = sal_True);
19081 + void SetCountFrameLines(sal_Bool frame = sal_True);
19083 + virtual void ToXml(IXFStream *pStrm);
19085 +private:
19086 + enumXFLineNumberPos m_ePosition;
19087 + double m_fOffset;
19088 + sal_Int32 m_nIncrement;
19089 + sal_Int32 m_nSepIncrement;
19090 + rtl::OUString m_strSeparator;
19091 + rtl::OUString m_strNumFmt;
19092 + rtl::OUString m_strTextStyle;
19093 + sal_Bool m_bRestartOnPage;
19094 + sal_Bool m_bCountEmptyLines;
19095 + sal_Bool m_bCountFrameLines;
19098 +inline XFLineNumberConfig::XFLineNumberConfig()
19100 + m_fOffset = 0;
19101 + m_nIncrement = 5;
19102 + m_nSepIncrement = 3;
19103 + m_bRestartOnPage = sal_False;
19104 + m_bCountEmptyLines = sal_True;
19105 + m_bCountFrameLines = sal_False;
19108 +inline void XFLineNumberConfig::SetNumberOffset(double offset)
19110 + m_fOffset = offset;
19113 +inline void XFLineNumberConfig::SetNumberPosition(enumXFLineNumberPos position)
19115 + m_ePosition = position;
19118 +inline void XFLineNumberConfig::SetNumberIncrement(sal_Int32 increment)
19120 + m_nIncrement = increment;
19123 +inline void XFLineNumberConfig::SetSeperator(sal_Int32 increment, rtl::OUString seperator)
19125 + m_nSepIncrement = increment;
19126 + m_strSeparator = seperator;
19129 +inline void XFLineNumberConfig::SetNumberFormat(rtl::OUString numfmt)
19131 + m_strNumFmt = numfmt;
19134 +inline void XFLineNumberConfig::SetTextStyle(rtl::OUString style)
19136 + m_strTextStyle = style;
19139 +inline void XFLineNumberConfig::SetRestartOnPage(sal_Bool restart)
19141 + m_bRestartOnPage = restart;
19144 +inline void XFLineNumberConfig::SetCountEmptyLines(sal_Bool empty)
19146 + m_bCountEmptyLines = empty;
19149 +inline void XFLineNumberConfig::SetCountFrameLines(sal_Bool frame)
19151 + m_bCountFrameLines = frame;
19154 +inline void XFLineNumberConfig::ToXml(IXFStream *pStrm)
19156 + IXFAttrList *pAttrList = pStrm->GetAttrList();
19158 + if( m_strTextStyle.getLength() > 0 )
19159 + pAttrList->AddAttribute( A2OUSTR("text:style-name"), m_strTextStyle );
19160 + pAttrList->AddAttribute( A2OUSTR("text:offset"), DoubleToOUString(m_fOffset) + A2OUSTR("cm") );
19161 + pAttrList->AddAttribute( A2OUSTR("style:num-format"), m_strNumFmt );
19162 + //position:
19163 + if( m_ePosition == enumXFLineNumberLeft )
19164 + pAttrList->AddAttribute( A2OUSTR("text:number-position"), A2OUSTR("left") );
19165 + else if( m_ePosition == enumXFLineNumberRight )
19166 + pAttrList->AddAttribute( A2OUSTR("text:number-position"), A2OUSTR("right") );
19167 + else if( m_ePosition == enumXFLineNumberInner )
19168 + pAttrList->AddAttribute( A2OUSTR("text:number-position"), A2OUSTR("inner") );
19169 + else if( m_ePosition == enumXFLineNumberOutter )
19170 + pAttrList->AddAttribute( A2OUSTR("text:number-position"), A2OUSTR("outter") );
19172 + pAttrList->AddAttribute( A2OUSTR("text:increment"), Int32ToOUString(m_nIncrement) );
19174 + if( m_bRestartOnPage )
19175 + pAttrList->AddAttribute( A2OUSTR("text:restart-on-page"), A2OUSTR("true") );
19176 + else
19177 + pAttrList->AddAttribute( A2OUSTR("text:restart-on-page"), A2OUSTR("false") );
19179 + if( m_bCountEmptyLines )
19180 + pAttrList->AddAttribute( A2OUSTR("text:count-empty-lines"), A2OUSTR("true") );
19181 + else
19182 + pAttrList->AddAttribute( A2OUSTR("text:count-empty-lines"), A2OUSTR("false") );
19184 + if( m_bCountFrameLines )
19185 + pAttrList->AddAttribute( A2OUSTR("text:count-in-floating-frames"), A2OUSTR("true") );
19186 + else
19187 + pAttrList->AddAttribute( A2OUSTR("text:count-in-floating-frames"), A2OUSTR("false") );
19190 + pStrm->StartElement( A2OUSTR("text:linenumbering-configuration") );
19192 + pAttrList->Clear();
19193 + pAttrList->AddAttribute( A2OUSTR("text:increment"), Int32ToOUString(m_nSepIncrement) );
19194 + pStrm->StartElement( A2OUSTR("text:linenumbering-separator") );
19195 + pStrm->Characters(m_strSeparator);
19196 + pStrm->EndElement( A2OUSTR("text:linenumbering-separator") );
19198 + pStrm->EndElement( A2OUSTR("text:linenumbering-configuration") );
19202 +#endif
19203 \ No newline at end of file
19204 diff -urNp lotuswordpro.bak/source/filter/xfilter/xflist.cxx lotuswordpro/source/filter/xfilter/xflist.cxx
19205 --- lotuswordpro.bak/source/filter/xfilter/xflist.cxx 1970-01-01 08:00:00.000000000 +0800
19206 +++ lotuswordpro/source/filter/xfilter/xflist.cxx 2008-10-22 11:42:34.000000000 +0800
19207 @@ -0,0 +1,189 @@
19208 +/*************************************************************************
19210 + * The Contents of this file are made available subject to the terms of
19211 + * either of the following licenses
19213 + * - GNU Lesser General Public License Version 2.1
19214 + * - Sun Industry Standards Source License Version 1.1
19216 + * Sun Microsystems Inc., October, 2000
19218 + * GNU Lesser General Public License Version 2.1
19219 + * =============================================
19220 + * Copyright 2000 by Sun Microsystems, Inc.
19221 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
19223 + * This library is free software; you can redistribute it and/or
19224 + * modify it under the terms of the GNU Lesser General Public
19225 + * License version 2.1, as published by the Free Software Foundation.
19227 + * This library is distributed in the hope that it will be useful,
19228 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
19229 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19230 + * Lesser General Public License for more details.
19232 + * You should have received a copy of the GNU Lesser General Public
19233 + * License along with this library; if not, write to the Free Software
19234 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
19235 + * MA 02111-1307 USA
19238 + * Sun Industry Standards Source License Version 1.1
19239 + * =================================================
19240 + * The contents of this file are subject to the Sun Industry Standards
19241 + * Source License Version 1.1 (the "License"); You may not use this file
19242 + * except in compliance with the License. You may obtain a copy of the
19243 + * License at http://www.openoffice.org/license.html.
19245 + * Software provided under this License is provided on an "AS IS" basis,
19246 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
19247 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
19248 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
19249 + * See the License for the specific provisions governing your rights and
19250 + * obligations concerning the Software.
19252 + * The Initial Developer of the Original Code is: IBM Corporation
19254 + * Copyright: 2008 by IBM Corporation
19256 + * All Rights Reserved.
19258 + * Contributor(s): _______________________________________
19261 + ************************************************************************/
19262 +/*************************************************************************
19263 + * @file
19264 + * List object.
19265 + ************************************************************************/
19266 +/*************************************************************************
19267 + * Change History
19268 + * 2005-01-17 create this file.
19269 + ************************************************************************/
19270 +#include "xflist.hxx"
19271 +#include "xflistitem.hxx"
19272 +#include "ixfstream.hxx"
19273 +#include "ixfattrlist.hxx"
19275 +XFList::XFList()
19277 + m_bOrdered = sal_True;
19278 + m_bContinueNumber = sal_False;
19279 + m_pHeader = NULL;
19282 +XFList::XFList(sal_Bool ordered)
19284 + m_bOrdered = ordered;
19285 + m_bContinueNumber = sal_False;
19288 +XFList::~XFList()
19292 +void XFList::AddItem(XFListItem *pItem)
19294 + assert(pItem);
19295 + assert(pItem->GetContentType()!=enumXFContentUnknown);
19297 + Add(pItem);
19300 +void XFList::AddItem(rtl::OUString text)
19302 + XFListItem *pItem = new XFListItem();
19303 + pItem->Add(text);
19304 + AddItem(pItem);
19307 +void XFList::SetHeader(XFListItem *pItem)
19309 + if( m_pHeader )
19310 + delete m_pHeader;
19311 + pItem->SetIsHeader(sal_True);
19312 + m_pHeader = pItem;
19315 +void XFList::ToXml(IXFStream *pStrm)
19317 + IXFAttrList *pAttrList = pStrm->GetAttrList();
19318 + assert(NULL!=pAttrList);
19320 + pAttrList->Clear();
19321 + if( GetStyleName().getLength() )
19322 + pAttrList->AddAttribute( A2OUSTR("text:style-name"), GetStyleName() );
19323 + if( m_bContinueNumber )
19324 + pAttrList->AddAttribute( A2OUSTR("text:continue-numbering"), A2OUSTR("true") );
19326 + if( m_bOrdered )
19327 + pStrm->StartElement( A2OUSTR("text:ordered-list") );
19328 + else
19329 + pStrm->StartElement( A2OUSTR("text:unordered-list") );
19331 + if( m_pHeader )
19333 + m_pHeader->ToXml(pStrm);
19335 + XFContentContainer::ToXml(pStrm);
19337 + if( m_bOrdered )
19338 + pStrm->EndElement( A2OUSTR("text:ordered-list") );
19339 + else
19340 + pStrm->EndElement( A2OUSTR("text:unordered-list") );
19343 +void XFList::StartList(IXFStream *pStrm, sal_Bool bContinueNumber)
19345 + IXFAttrList *pAttrList = pStrm->GetAttrList();
19346 + assert(NULL!=pAttrList);
19348 + pAttrList->Clear();
19349 + if( GetStyleName().getLength() )
19350 + pAttrList->AddAttribute( A2OUSTR("text:style-name"), GetStyleName() );
19351 + if( bContinueNumber )
19352 + pAttrList->AddAttribute( A2OUSTR("text:continue-numbering"), A2OUSTR("true") );
19354 + if( m_bOrdered )
19355 + pStrm->StartElement( A2OUSTR("text:ordered-list") );
19356 + else
19357 + pStrm->StartElement( A2OUSTR("text:unordered-list") );
19360 +void XFList::EndList(IXFStream *pStrm)
19362 + if( m_bOrdered )
19363 + pStrm->EndElement( A2OUSTR("text:ordered-list") );
19364 + else
19365 + pStrm->EndElement( A2OUSTR("text:unordered-list") );
19368 +void XFList::StartListHeader(IXFStream *pStrm)
19370 + IXFAttrList *pAttrList = pStrm->GetAttrList();
19371 + pAttrList->Clear();
19373 + pStrm->StartElement( A2OUSTR("text:list-header") );
19376 +void XFList::EndListHeader(IXFStream *pStrm)
19378 + IXFAttrList *pAttrList = pStrm->GetAttrList();
19379 + pAttrList->Clear();
19381 + pStrm->EndElement( A2OUSTR("text:list-header") );
19384 +void XFList::StartListItem(IXFStream *pStrm)
19386 + IXFAttrList *pAttrList = pStrm->GetAttrList();
19387 + assert(NULL!=pAttrList);
19389 + pAttrList->Clear();
19390 + pStrm->StartElement( A2OUSTR("text:list-item") );
19393 +void XFList::EndListItem(IXFStream *pStrm)
19395 + pStrm->EndElement( A2OUSTR("text:list-item") );
19397 \ No newline at end of file
19398 diff -urNp lotuswordpro.bak/source/filter/xfilter/xflist.hxx lotuswordpro/source/filter/xfilter/xflist.hxx
19399 --- lotuswordpro.bak/source/filter/xfilter/xflist.hxx 1970-01-01 08:00:00.000000000 +0800
19400 +++ lotuswordpro/source/filter/xfilter/xflist.hxx 2008-10-22 11:42:34.000000000 +0800
19401 @@ -0,0 +1,163 @@
19402 +/*************************************************************************
19404 + * The Contents of this file are made available subject to the terms of
19405 + * either of the following licenses
19407 + * - GNU Lesser General Public License Version 2.1
19408 + * - Sun Industry Standards Source License Version 1.1
19410 + * Sun Microsystems Inc., October, 2000
19412 + * GNU Lesser General Public License Version 2.1
19413 + * =============================================
19414 + * Copyright 2000 by Sun Microsystems, Inc.
19415 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
19417 + * This library is free software; you can redistribute it and/or
19418 + * modify it under the terms of the GNU Lesser General Public
19419 + * License version 2.1, as published by the Free Software Foundation.
19421 + * This library is distributed in the hope that it will be useful,
19422 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
19423 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19424 + * Lesser General Public License for more details.
19426 + * You should have received a copy of the GNU Lesser General Public
19427 + * License along with this library; if not, write to the Free Software
19428 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
19429 + * MA 02111-1307 USA
19432 + * Sun Industry Standards Source License Version 1.1
19433 + * =================================================
19434 + * The contents of this file are subject to the Sun Industry Standards
19435 + * Source License Version 1.1 (the "License"); You may not use this file
19436 + * except in compliance with the License. You may obtain a copy of the
19437 + * License at http://www.openoffice.org/license.html.
19439 + * Software provided under this License is provided on an "AS IS" basis,
19440 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
19441 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
19442 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
19443 + * See the License for the specific provisions governing your rights and
19444 + * obligations concerning the Software.
19446 + * The Initial Developer of the Original Code is: IBM Corporation
19448 + * Copyright: 2008 by IBM Corporation
19450 + * All Rights Reserved.
19452 + * Contributor(s): _______________________________________
19455 + ************************************************************************/
19456 +/*************************************************************************
19457 + * @file
19458 + * Base list object.
19459 + ************************************************************************/
19460 +/*************************************************************************
19461 + * Change History
19462 + * 2005-01-17 create this file.
19463 + ************************************************************************/
19464 +#ifndef _XFLIST_HXX
19465 +#define _XFLIST_HXX
19467 +#include "xflistitem.hxx"
19468 +#include "xfcontentcontainer.hxx"
19470 +class XFListItem;
19472 +/**
19473 + * @brief
19474 + * list obejct for order-list and unordered-list.
19475 + */
19476 +class XFList : public XFContentContainer
19478 +public:
19479 + XFList();
19481 + XFList(sal_Bool ordered);
19483 + virtual ~XFList();
19485 +public:
19486 + /**
19487 + * @descr Set whether it's an ordered list or an unordered list.
19488 + */
19489 + void SetOrdered(sal_Bool ordered);
19491 + /**
19492 + * @descr Set whether to continue to number list.
19493 + */
19494 + void SetContinueNumber(sal_Bool bContinueNumber=sal_False);
19496 + /**
19497 + * @descr Add a list item.
19498 + */
19499 + void AddItem(XFListItem *pItem);
19501 + /**
19502 + * @descr Add a simple text list item.
19503 + */
19504 + void AddItem(rtl::OUString text);
19506 + /**
19507 + * @descr Set the header list item. There can only be one list header.
19508 + */
19509 + void SetHeader(XFListItem *pItem);
19511 + /**
19512 + * @descr Output list obejct.
19513 + */
19514 + virtual void ToXml(IXFStream *pStrm);
19516 + virtual void StartList(IXFStream *pStrm, sal_Bool bContinueNumber = sal_False);
19518 + virtual void EndList(IXFStream *pStrm);
19520 + static void StartListHeader(IXFStream *pStrm);
19522 + static void EndListHeader(IXFStream *pStrm);
19524 + static void StartListItem(IXFStream *pStrm);
19526 + static void EndListItem(IXFStream *pStrm);
19528 +private:
19529 + sal_Bool m_bOrdered;
19530 + sal_Bool m_bContinueNumber;
19531 + XFListItem *m_pHeader;
19535 +class XFUnorderedList : public XFList
19537 +public:
19538 + XFUnorderedList()
19540 + SetOrdered(sal_False);
19544 +class XFOrderedList : public XFList
19546 +public:
19547 + XFOrderedList()
19549 + SetOrdered(sal_True);
19553 +inline void XFList::SetOrdered(sal_Bool ordered)
19555 + m_bOrdered = ordered;
19558 +inline void XFList::SetContinueNumber(sal_Bool bContinueNumber)
19560 + m_bContinueNumber = bContinueNumber;
19563 +#endif
19565 diff -urNp lotuswordpro.bak/source/filter/xfilter/xflistitem.hxx lotuswordpro/source/filter/xfilter/xflistitem.hxx
19566 --- lotuswordpro.bak/source/filter/xfilter/xflistitem.hxx 1970-01-01 08:00:00.000000000 +0800
19567 +++ lotuswordpro/source/filter/xfilter/xflistitem.hxx 2008-10-22 11:42:34.000000000 +0800
19568 @@ -0,0 +1,118 @@
19569 +/*************************************************************************
19571 + * The Contents of this file are made available subject to the terms of
19572 + * either of the following licenses
19574 + * - GNU Lesser General Public License Version 2.1
19575 + * - Sun Industry Standards Source License Version 1.1
19577 + * Sun Microsystems Inc., October, 2000
19579 + * GNU Lesser General Public License Version 2.1
19580 + * =============================================
19581 + * Copyright 2000 by Sun Microsystems, Inc.
19582 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
19584 + * This library is free software; you can redistribute it and/or
19585 + * modify it under the terms of the GNU Lesser General Public
19586 + * License version 2.1, as published by the Free Software Foundation.
19588 + * This library is distributed in the hope that it will be useful,
19589 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
19590 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19591 + * Lesser General Public License for more details.
19593 + * You should have received a copy of the GNU Lesser General Public
19594 + * License along with this library; if not, write to the Free Software
19595 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
19596 + * MA 02111-1307 USA
19599 + * Sun Industry Standards Source License Version 1.1
19600 + * =================================================
19601 + * The contents of this file are subject to the Sun Industry Standards
19602 + * Source License Version 1.1 (the "License"); You may not use this file
19603 + * except in compliance with the License. You may obtain a copy of the
19604 + * License at http://www.openoffice.org/license.html.
19606 + * Software provided under this License is provided on an "AS IS" basis,
19607 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
19608 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
19609 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
19610 + * See the License for the specific provisions governing your rights and
19611 + * obligations concerning the Software.
19613 + * The Initial Developer of the Original Code is: IBM Corporation
19615 + * Copyright: 2008 by IBM Corporation
19617 + * All Rights Reserved.
19619 + * Contributor(s): _______________________________________
19622 + ************************************************************************/
19623 +/*************************************************************************
19624 + * @file
19625 + * List item.
19626 + ************************************************************************/
19627 +/*************************************************************************
19628 + * Change History
19629 + * 2005-02-17 create this file.
19630 + ************************************************************************/
19631 +#ifndef _XFLISTITEM_HXX
19632 +#define _XFLISTITEM_HXX
19634 +#include "xfcontent.hxx"
19635 +#include "xfcontentcontainer.hxx"
19636 +#include "xfparagraph.hxx"
19638 +class XFListItem : public XFContentContainer
19640 +public:
19641 + XFListItem();
19643 +public:
19644 + void SetIsHeader(sal_Bool isHeader=sal_True);
19646 + virtual void ToXml(IXFStream *pStrm);
19648 +private:
19649 + sal_Bool m_bIsHeader;
19652 +inline XFListItem::XFListItem()
19654 + m_bIsHeader = sal_False;
19657 +inline void XFListItem::SetIsHeader(sal_Bool isHeader)
19659 + m_bIsHeader = isHeader;
19662 +inline void XFListItem::ToXml(IXFStream *pStrm)
19664 + IXFAttrList *pAttrList = pStrm->GetAttrList();
19665 + pAttrList->Clear();
19667 + if( GetStyleName().getLength() > 0 )
19668 + pAttrList->AddAttribute( A2OUSTR("text:style-name"), GetStyleName() );
19670 + if( !m_bIsHeader )
19672 + pStrm->StartElement( A2OUSTR("text:list-item") );
19673 + XFContentContainer::ToXml(pStrm);
19674 + pStrm->EndElement( A2OUSTR("text:list-item") );
19676 + else
19678 + pStrm->StartElement( A2OUSTR("text:list-header") );
19679 + XFContentContainer::ToXml(pStrm);
19680 + pStrm->EndElement( A2OUSTR("text:list-header") );
19686 +#endif
19687 \ No newline at end of file
19688 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfliststyle.cxx lotuswordpro/source/filter/xfilter/xfliststyle.cxx
19689 --- lotuswordpro.bak/source/filter/xfilter/xfliststyle.cxx 1970-01-01 08:00:00.000000000 +0800
19690 +++ lotuswordpro/source/filter/xfilter/xfliststyle.cxx 2008-10-22 11:42:34.000000000 +0800
19691 @@ -0,0 +1,346 @@
19692 +/*************************************************************************
19694 + * The Contents of this file are made available subject to the terms of
19695 + * either of the following licenses
19697 + * - GNU Lesser General Public License Version 2.1
19698 + * - Sun Industry Standards Source License Version 1.1
19700 + * Sun Microsystems Inc., October, 2000
19702 + * GNU Lesser General Public License Version 2.1
19703 + * =============================================
19704 + * Copyright 2000 by Sun Microsystems, Inc.
19705 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
19707 + * This library is free software; you can redistribute it and/or
19708 + * modify it under the terms of the GNU Lesser General Public
19709 + * License version 2.1, as published by the Free Software Foundation.
19711 + * This library is distributed in the hope that it will be useful,
19712 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
19713 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19714 + * Lesser General Public License for more details.
19716 + * You should have received a copy of the GNU Lesser General Public
19717 + * License along with this library; if not, write to the Free Software
19718 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
19719 + * MA 02111-1307 USA
19722 + * Sun Industry Standards Source License Version 1.1
19723 + * =================================================
19724 + * The contents of this file are subject to the Sun Industry Standards
19725 + * Source License Version 1.1 (the "License"); You may not use this file
19726 + * except in compliance with the License. You may obtain a copy of the
19727 + * License at http://www.openoffice.org/license.html.
19729 + * Software provided under this License is provided on an "AS IS" basis,
19730 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
19731 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
19732 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
19733 + * See the License for the specific provisions governing your rights and
19734 + * obligations concerning the Software.
19736 + * The Initial Developer of the Original Code is: IBM Corporation
19738 + * Copyright: 2008 by IBM Corporation
19740 + * All Rights Reserved.
19742 + * Contributor(s): _______________________________________
19745 + ************************************************************************/
19746 +/*************************************************************************
19747 + * @file
19748 + * Styles for ordered list and unordered list.
19749 + ************************************************************************/
19750 +/*************************************************************************
19751 + * Change History
19752 + * 2005-01-07 create the file.
19753 + * 2005-01-20 use XFNumFmt to fill XFListLevelNumber.
19754 + ************************************************************************/
19755 +#include "xfliststyle.hxx"
19757 +XFListLevel::XFListLevel()
19759 + m_nLevel = 0;
19760 + m_nDisplayLevel = 0;
19761 + m_fIndent = 0;
19762 + m_fMinLabelWidth = 0.499;
19763 + m_fMinLabelDistance = 0;
19764 + m_eAlign = enumXFAlignStart;
19765 + m_eListType = enumXFListLevelNumber;
19768 +void XFListLevel::ToXml(IXFStream *pStrm)
19772 +//----------------------------------------------------
19774 +void XFListlevelNumber::ToXml(IXFStream *pStrm)
19776 + IXFAttrList *pAttrList = pStrm->GetAttrList();
19778 + pAttrList->Clear();
19779 + pAttrList->AddAttribute( A2OUSTR("text:level"), Int16ToOUString(m_nLevel) );
19780 + //text:style-name,ignore now.
19781 + m_aNumFmt.ToXml(pStrm);
19782 + if( m_nDisplayLevel )
19783 + pAttrList->AddAttribute( A2OUSTR("text:display-levels"), Int16ToOUString(m_nDisplayLevel) );
19785 + pStrm->StartElement( A2OUSTR("text:list-level-style-number") );
19787 + //<style:properties>...</style:properties>
19788 + pAttrList->Clear();
19789 + if( m_fIndent > FLOAT_MIN )
19791 + pAttrList->AddAttribute( A2OUSTR("text:space-before"), DoubleToOUString(m_fIndent) + A2OUSTR("cm") );
19793 + if( m_fMinLabelWidth > FLOAT_MIN )
19795 + pAttrList->AddAttribute( A2OUSTR("text:min-label-width"), DoubleToOUString(m_fMinLabelWidth) + A2OUSTR("cm") );
19797 + if( m_fMinLabelDistance > FLOAT_MIN )
19799 + pAttrList->AddAttribute( A2OUSTR("text:min-label-distance"), DoubleToOUString(m_fMinLabelDistance) + A2OUSTR("cm") );
19801 + pAttrList->AddAttribute( A2OUSTR("fo:text-align"), GetAlignName(m_eAlign) );
19804 + pStrm->StartElement( A2OUSTR("style:properties") );
19805 + pStrm->EndElement( A2OUSTR("style:properties") );
19807 + pStrm->EndElement( A2OUSTR("text:list-level-style-number") );
19810 +void XFListLevelBullet::ToXml(IXFStream *pStrm)
19812 + IXFAttrList *pAttrList = pStrm->GetAttrList();
19814 + pAttrList->Clear();
19815 + pAttrList->AddAttribute( A2OUSTR("text:level"), Int16ToOUString(m_nLevel) );
19816 + //text:style-name,ignore now.
19817 + m_aNumFmt.ToXml(pStrm);
19818 + //bullet-char
19819 + rtl::OUString bullet(m_chBullet);
19820 + pAttrList->AddAttribute( A2OUSTR("text:bullet-char"), bullet );
19822 + pStrm->StartElement( A2OUSTR("text:list-level-style-bullet") );
19824 + //<style:properties>...</style:properties>
19825 + pAttrList->Clear();
19826 + if( m_fIndent != 0 )
19828 + pAttrList->AddAttribute( A2OUSTR("text:space-before"), DoubleToOUString(m_fIndent) + A2OUSTR("cm") );
19830 + if( m_fMinLabelWidth != 0 )
19832 + pAttrList->AddAttribute( A2OUSTR("text:min-label-width"), DoubleToOUString(m_fMinLabelWidth) + A2OUSTR("cm") );
19834 + if( m_fMinLabelDistance != 0 )
19836 + pAttrList->AddAttribute( A2OUSTR("text:min-label-distance"), DoubleToOUString(m_fMinLabelDistance) + A2OUSTR("cm") );
19839 + pAttrList->AddAttribute( A2OUSTR("fo:text-align"), GetAlignName(m_eAlign) );
19841 + if( m_strFontName.getLength() > 0 )
19843 + pAttrList->AddAttribute( A2OUSTR("style:font-name"), m_strFontName );
19845 + pStrm->StartElement( A2OUSTR("style:properties") );
19846 + pStrm->EndElement( A2OUSTR("style:properties") );
19848 + pStrm->EndElement( A2OUSTR("text:list-level-style-bullet") );
19851 +//----------------------------------------------------
19852 +XFListStyle::XFListStyle()
19854 + XFNumFmt nf;
19855 + nf.SetSuffix( A2OUSTR(".") );
19856 + nf.SetFormat( A2OUSTR("1") );
19858 + for( int i=0; i<10; i++ )
19860 + m_pListLevels[i] = new XFListlevelNumber();
19861 + m_pListLevels[i]->SetListlevelType(enumXFListLevelNumber);
19862 + m_pListLevels[i]->SetMinLabelWidth(0.499);
19863 + m_pListLevels[i]->SetIndent(0.501*(i+1));
19864 + m_pListLevels[i]->SetLevel(i+1);
19865 + ( (XFListlevelNumber*)m_pListLevels[i])->SetNumFmt(nf);
19866 + }
19869 +XFListStyle::XFListStyle(const XFListStyle& other)
19871 + enumXFListLevel type;
19872 + for( int i=0; i<10; i++ )
19874 + type = other.m_pListLevels[i]->m_eListType;
19875 + if( type == enumXFListLevelNumber )
19877 + XFListlevelNumber *pNum = (XFListlevelNumber*)other.m_pListLevels[i];
19878 + m_pListLevels[i] = new XFListlevelNumber(*pNum);
19880 + else if( type == enumXFListLevelBullet )
19882 + XFListLevelBullet *pBullet = (XFListLevelBullet*)other.m_pListLevels[i];
19883 + m_pListLevels[i] = new XFListLevelBullet(*pBullet);
19885 + else
19886 + m_pListLevels[i] = NULL;
19890 +XFListStyle& XFListStyle::operator=(const XFListStyle& other)
19892 + enumXFListLevel type;
19893 + for( int i=0; i<10; i++ )
19895 + type = other.m_pListLevels[i]->m_eListType;
19896 + if( type == enumXFListLevelNumber )
19898 + XFListlevelNumber *pNum = (XFListlevelNumber*)m_pListLevels[i];
19899 + m_pListLevels[i] = new XFListlevelNumber(*pNum);
19901 + else if( type == enumXFListLevelBullet )
19903 + XFListLevelBullet *pBullet = (XFListLevelBullet*)m_pListLevels[i];
19904 + m_pListLevels[i] = new XFListLevelBullet(*pBullet);
19906 + else
19907 + m_pListLevels[i] = NULL;
19909 + return *this;
19912 +XFListStyle::~XFListStyle()
19914 + for( int i=0; i<10; i++ )
19916 + if( m_pListLevels[i] )
19917 + delete m_pListLevels[i];
19921 +void XFListStyle::SetDisplayLevel(sal_Int32 level, sal_Int16 nDisplayLevel)
19923 + assert(level>=1&&level<=10);
19925 + XFListLevel *pLevel = m_pListLevels[level-1];
19926 + if( !pLevel )
19928 + pLevel = new XFListlevelNumber();
19929 + pLevel->SetListlevelType(enumXFListLevelNumber);
19930 + pLevel->SetLevel(level+1);
19931 + pLevel->SetMinLabelWidth(0.499);
19932 + pLevel->SetIndent(0.501*(level+1));
19933 + pLevel->SetDisplayLevel(nDisplayLevel);
19934 + m_pListLevels[level-1] = pLevel;
19936 + else
19937 + pLevel->SetDisplayLevel(nDisplayLevel);
19940 +void XFListStyle::SetListPosition(sal_Int32 level,
19941 + double indent,
19942 + double minLabelWidth,
19943 + double minLabelDistance,
19944 + enumXFAlignType align
19947 + assert(level>=1&&level<=10);
19949 + XFListLevel *pLevel = m_pListLevels[level-1];
19950 + if( !pLevel )
19952 + XFListLevelBullet * pLevel = new XFListLevelBullet();
19953 + pLevel->SetListlevelType(enumXFListLevelNumber);
19954 + pLevel->SetLevel(level+1);
19955 + pLevel->SetIndent(indent);
19956 + pLevel->SetMinLabelWidth(minLabelWidth);
19957 + pLevel->SetMinLabelDistance(minLabelDistance);
19958 + pLevel->SetAlignType(align);
19959 + m_pListLevels[level-1] = pLevel;
19961 + else
19963 + pLevel->SetIndent(indent);
19964 + pLevel->SetMinLabelWidth(minLabelWidth);
19965 + pLevel->SetMinLabelDistance(minLabelDistance);
19966 + pLevel->SetAlignType(align);
19970 +void XFListStyle::SetListBullet(sal_Int32 level,
19971 + UChar32 bullet,
19972 + rtl::OUString fontname,
19973 + rtl::OUString prefix,
19974 + rtl::OUString suffix
19977 + assert(level>=1&&level<=10);
19979 + if( m_pListLevels[level-1] )
19980 + delete m_pListLevels[level-1];
19982 + XFListLevelBullet *pLevel = new XFListLevelBullet();
19983 + pLevel->SetPrefix(prefix);
19984 + pLevel->SetSuffix(suffix);
19985 + pLevel->SetBulletChar(bullet);
19986 + pLevel->SetFontName(fontname);
19987 + //
19988 + pLevel->SetListlevelType(enumXFListLevelBullet);
19989 + pLevel->SetMinLabelWidth(0.499);
19990 + pLevel->SetIndent(0.501*level);
19991 + pLevel->SetLevel(level);
19992 + m_pListLevels[level-1] = pLevel;
19995 +void XFListStyle::SetListNumber(sal_Int32 level, XFNumFmt& fmt, sal_Int16 start )
19997 + assert(level>=1&&level<=10);
19999 + if( m_pListLevels[level-1] )
20000 + delete m_pListLevels[level-1];
20002 + XFListlevelNumber *pLevel = new XFListlevelNumber();
20003 + pLevel->SetNumFmt(fmt);
20004 + pLevel->SetStartValue(start);
20005 + //
20006 + pLevel->SetListlevelType(enumXFListLevelNumber);
20007 + pLevel->SetMinLabelWidth(0.499);
20008 + pLevel->SetIndent(0.501*level);
20009 + pLevel->SetLevel(level);
20010 + m_pListLevels[level-1] = pLevel;
20013 +void XFListStyle::ToXml(IXFStream *pStrm)
20015 + std::vector<XFListLevel*>::iterator it;
20016 + IXFAttrList *pAttrList = pStrm->GetAttrList();
20018 + pAttrList->Clear();
20019 + pAttrList->AddAttribute( A2OUSTR("style:name"), GetStyleName() );
20020 + if( GetParentStyleName().getLength() > 0 )
20021 + pAttrList->AddAttribute(A2OUSTR("style:parent-style-name"),GetParentStyleName());
20022 + pStrm->StartElement( A2OUSTR("text:list-style") );
20024 + for( int i=0; i<10; i++ )
20026 + XFListLevel *pLevel = m_pListLevels[i];
20027 + if( pLevel )
20028 + pLevel->ToXml(pStrm);
20031 + pStrm->EndElement( A2OUSTR("text:list-style") );
20038 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfliststyle.hxx lotuswordpro/source/filter/xfilter/xfliststyle.hxx
20039 --- lotuswordpro.bak/source/filter/xfilter/xfliststyle.hxx 1970-01-01 08:00:00.000000000 +0800
20040 +++ lotuswordpro/source/filter/xfilter/xfliststyle.hxx 2008-10-22 11:42:34.000000000 +0800
20041 @@ -0,0 +1,269 @@
20042 +/*************************************************************************
20044 + * The Contents of this file are made available subject to the terms of
20045 + * either of the following licenses
20047 + * - GNU Lesser General Public License Version 2.1
20048 + * - Sun Industry Standards Source License Version 1.1
20050 + * Sun Microsystems Inc., October, 2000
20052 + * GNU Lesser General Public License Version 2.1
20053 + * =============================================
20054 + * Copyright 2000 by Sun Microsystems, Inc.
20055 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
20057 + * This library is free software; you can redistribute it and/or
20058 + * modify it under the terms of the GNU Lesser General Public
20059 + * License version 2.1, as published by the Free Software Foundation.
20061 + * This library is distributed in the hope that it will be useful,
20062 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
20063 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20064 + * Lesser General Public License for more details.
20066 + * You should have received a copy of the GNU Lesser General Public
20067 + * License along with this library; if not, write to the Free Software
20068 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20069 + * MA 02111-1307 USA
20072 + * Sun Industry Standards Source License Version 1.1
20073 + * =================================================
20074 + * The contents of this file are subject to the Sun Industry Standards
20075 + * Source License Version 1.1 (the "License"); You may not use this file
20076 + * except in compliance with the License. You may obtain a copy of the
20077 + * License at http://www.openoffice.org/license.html.
20079 + * Software provided under this License is provided on an "AS IS" basis,
20080 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
20081 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
20082 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
20083 + * See the License for the specific provisions governing your rights and
20084 + * obligations concerning the Software.
20086 + * The Initial Developer of the Original Code is: IBM Corporation
20088 + * Copyright: 2008 by IBM Corporation
20090 + * All Rights Reserved.
20092 + * Contributor(s): _______________________________________
20095 + ************************************************************************/
20096 +/*************************************************************************
20097 +* @file
20098 +* Styles for ordered list and unordered list.
20099 +************************************************************************/
20100 +/*************************************************************************
20101 +* Change History
20102 +* 2005-1-7 create the file.
20103 +************************************************************************/
20104 +#ifndef _XFLISTSTYLE_HXX
20105 +#define _XFLISTSTYLE_HXX
20107 +#include "xfglobal.hxx"
20108 +#include "xfstyle.hxx"
20109 +#include "xfnumfmt.hxx"
20110 +#include "unicode/utypes.h"
20111 +#include <vector>
20113 +class IXFStream;
20115 +enum enumXFListLevel
20117 + enumXFListLevelBullet,
20118 + enumXFListLevelNumber,
20119 + enumXFListLevelImage
20122 +/**************************************************************************
20123 + * @descr
20124 + * Bullet style wrapper,the underline bullet type can be:
20125 + * number,image,or bullet.
20126 + *************************************************************************/
20127 +class XFListLevel
20129 +public:
20130 + XFListLevel();
20132 + virtual ~XFListLevel(){}
20134 + void SetListlevelType(enumXFListLevel type);
20136 + void SetLevel(sal_Int16 level);
20138 + void SetDisplayLevel(sal_Int16 nDisplayLevel);
20140 + void SetIndent(double indent);
20142 + void SetMinLabelWidth(double labelWidth);
20144 + void SetMinLabelDistance(double distance);
20146 + void SetAlignType(enumXFAlignType align);
20148 + virtual void ToXml(IXFStream *pStrm);
20150 + friend class XFListStyle;
20151 +protected:
20152 + sal_Int16 m_nLevel;
20153 + sal_Int16 m_nDisplayLevel;
20154 + double m_fIndent;
20155 + double m_fMinLabelWidth;
20156 + double m_fMinLabelDistance;
20157 + enumXFAlignType m_eAlign;
20158 + enumXFListLevel m_eListType;
20161 +class XFListlevelNumber : public XFListLevel
20163 +public:
20164 + XFListlevelNumber()
20165 + {
20166 + m_eListType = enumXFListLevelNumber;
20168 +public:
20169 + void SetNumFmt(XFNumFmt& fmt)
20171 + m_aNumFmt = fmt;
20174 + void SetStartValue(sal_Int16 start)
20176 + m_aNumFmt.SetStartValue(start);
20179 + virtual void ToXml(IXFStream *pStrm);
20180 +private:
20181 + XFNumFmt m_aNumFmt;
20185 +class XFListLevelBullet : public XFListLevel
20187 +public:
20188 + XFListLevelBullet()
20190 + m_eListType = enumXFListLevelBullet;
20193 + void SetBulletChar(UChar32 ch)
20194 + {
20195 + m_chBullet = ch;
20197 + void SetPrefix(rtl::OUString prefix)
20199 + m_aNumFmt.SetPrefix(prefix);
20201 + void SetSuffix(rtl::OUString suffix)
20203 + m_aNumFmt.SetSuffix(suffix);
20205 + void SetFontName(rtl::OUString name)
20207 + m_strFontName = name;
20210 + virtual void ToXml(IXFStream *pStrm);
20211 +private:
20212 + XFNumFmt m_aNumFmt;
20213 + int32_t m_chBullet;
20214 + rtl::OUString m_strFontName;
20217 +//not complete.
20218 +class XFListLevelImage : public XFListLevel
20220 +public:
20221 + virtual void ToXml(IXFStream *pStrm);
20222 +private:
20223 + sal_Int16 m_nWidth;
20224 + sal_Int16 m_nHeight;
20225 + rtl::OUString m_strBinaryData;
20229 +class XFListStyle : public XFStyle
20231 +public:
20232 + XFListStyle();
20234 + XFListStyle(const XFListStyle& other);
20236 + XFListStyle& operator=(const XFListStyle& other);
20238 + virtual ~XFListStyle();
20240 +public:
20241 + void SetDisplayLevel(sal_Int32 level, sal_Int16 nShowLevel);
20243 + void SetListPosition(sal_Int32 level,
20244 + double indent,
20245 + double minLabelWidth,
20246 + double minLabelDistance,
20247 + enumXFAlignType align=enumXFAlignStart
20248 + );
20250 + void SetListBullet(sal_Int32 level,
20251 + UChar32 bullet_char,
20252 + rtl::OUString fontname = A2OUSTR(""),
20253 + rtl::OUString prefix = A2OUSTR(""),
20254 + rtl::OUString suffix = A2OUSTR("")
20255 + );
20257 + void SetListNumber( sal_Int32 level, XFNumFmt& numFmt, sal_Int16 nStartValue = 1 );
20259 + //not implemented now.
20260 + void SetListImage(){}
20262 + virtual enumXFStyle GetStyleFamily()
20264 + return enumXFStyleList;
20266 + virtual void ToXml(IXFStream *pStrm);
20268 +private:
20269 + XFListLevel *m_pListLevels[10];
20274 +inline void XFListLevel::SetListlevelType(enumXFListLevel type)
20276 + m_eListType = type;
20279 +inline void XFListLevel::SetAlignType(enumXFAlignType align)
20281 + m_eAlign = align;
20284 +inline void XFListLevel::SetLevel(sal_Int16 level)
20286 + m_nLevel = level;
20289 +inline void XFListLevel::SetDisplayLevel(sal_Int16 nDisplayLevel)
20291 + m_nDisplayLevel = nDisplayLevel;
20294 +inline void XFListLevel::SetIndent(double indent)
20296 + m_fIndent = indent;
20299 +inline void XFListLevel::SetMinLabelWidth(double labelWidth)
20301 + m_fMinLabelWidth = labelWidth;
20304 +inline void XFListLevel::SetMinLabelDistance(double distance)
20306 + m_fMinLabelDistance = distance;
20309 +#endif
20311 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfmargins.cxx lotuswordpro/source/filter/xfilter/xfmargins.cxx
20312 --- lotuswordpro.bak/source/filter/xfilter/xfmargins.cxx 1970-01-01 08:00:00.000000000 +0800
20313 +++ lotuswordpro/source/filter/xfilter/xfmargins.cxx 2008-10-22 11:42:34.000000000 +0800
20314 @@ -0,0 +1,129 @@
20315 +/*************************************************************************
20317 + * The Contents of this file are made available subject to the terms of
20318 + * either of the following licenses
20320 + * - GNU Lesser General Public License Version 2.1
20321 + * - Sun Industry Standards Source License Version 1.1
20323 + * Sun Microsystems Inc., October, 2000
20325 + * GNU Lesser General Public License Version 2.1
20326 + * =============================================
20327 + * Copyright 2000 by Sun Microsystems, Inc.
20328 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
20330 + * This library is free software; you can redistribute it and/or
20331 + * modify it under the terms of the GNU Lesser General Public
20332 + * License version 2.1, as published by the Free Software Foundation.
20334 + * This library is distributed in the hope that it will be useful,
20335 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
20336 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20337 + * Lesser General Public License for more details.
20339 + * You should have received a copy of the GNU Lesser General Public
20340 + * License along with this library; if not, write to the Free Software
20341 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20342 + * MA 02111-1307 USA
20345 + * Sun Industry Standards Source License Version 1.1
20346 + * =================================================
20347 + * The contents of this file are subject to the Sun Industry Standards
20348 + * Source License Version 1.1 (the "License"); You may not use this file
20349 + * except in compliance with the License. You may obtain a copy of the
20350 + * License at http://www.openoffice.org/license.html.
20352 + * Software provided under this License is provided on an "AS IS" basis,
20353 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
20354 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
20355 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
20356 + * See the License for the specific provisions governing your rights and
20357 + * obligations concerning the Software.
20359 + * The Initial Developer of the Original Code is: IBM Corporation
20361 + * Copyright: 2008 by IBM Corporation
20363 + * All Rights Reserved.
20365 + * Contributor(s): _______________________________________
20368 + ************************************************************************/
20369 +/*************************************************************************
20370 + * @file
20371 + * Margins object, include left margin,right margin,top margin and bottom margin.
20372 + ************************************************************************/
20373 +/*************************************************************************
20374 + * Change History
20375 + * 2005-01-19 create this file.
20376 + ************************************************************************/
20379 +#include "xfmargins.hxx"
20381 +XFMargins::XFMargins()
20383 + Reset();
20386 +void XFMargins::Reset()
20388 + m_fLeft = 0;
20389 + m_fRight = 0;
20390 + m_fTop = 0;
20391 + m_fBottom = 0;
20392 + m_nFlag = 0;
20395 +void XFMargins::ToXml(IXFStream *pStrm)
20397 + IXFAttrList *pAttrList = pStrm->GetAttrList();
20398 + //margin left:
20399 + if( m_nFlag&XFMARGINS_FLAG_LEFT )
20401 + pAttrList->AddAttribute( A2OUSTR("fo:margin-left"), DoubleToOUString(m_fLeft) + A2OUSTR("cm") );
20403 + //margin right:
20404 + if( m_nFlag&XFMARGINS_FLAG_RIGHT )
20406 + pAttrList->AddAttribute(A2OUSTR("fo:margin-right"), DoubleToOUString(m_fRight) + A2OUSTR("cm") );
20407 + }
20408 + //margin top:
20409 + if( m_nFlag&XFMARGINS_FLAG_TOP )
20411 + pAttrList->AddAttribute(A2OUSTR("fo:margin-top"), DoubleToOUString(m_fTop) + A2OUSTR("cm") );
20413 + //margin bottom:
20414 + if( m_nFlag&XFMARGINS_FLAG_BOTTOM )
20416 + pAttrList->AddAttribute(A2OUSTR("fo:margin-bottom"), DoubleToOUString(m_fBottom) + A2OUSTR("cm") );
20420 +bool operator==(XFMargins& indent1, XFMargins& indent2)
20422 + return (
20423 + (indent1.m_nFlag == indent2.m_nFlag) &&
20424 + (indent1.m_fLeft == indent2.m_fLeft) &&
20425 + (indent1.m_fRight == indent2.m_fRight) &&
20426 + (indent1.m_fTop == indent2.m_fTop) &&
20427 + (indent1.m_fBottom == indent2.m_fBottom)
20428 + );
20430 +bool operator!=(XFMargins& indent1, XFMargins& indent2)
20432 + return !(indent1==indent2);
20435 +XFMargins& XFMargins::operator=(XFMargins& other)
20437 + m_nFlag = other.m_nFlag;
20438 + m_fLeft = other.m_fLeft;
20439 + m_fRight = other.m_fRight;
20440 + m_fTop = other.m_fTop;
20441 + m_fBottom = other.m_fBottom;
20442 + return *this;
20444 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfmargins.hxx lotuswordpro/source/filter/xfilter/xfmargins.hxx
20445 --- lotuswordpro.bak/source/filter/xfilter/xfmargins.hxx 1970-01-01 08:00:00.000000000 +0800
20446 +++ lotuswordpro/source/filter/xfilter/xfmargins.hxx 2008-10-22 11:42:34.000000000 +0800
20447 @@ -0,0 +1,147 @@
20448 +/*************************************************************************
20450 + * The Contents of this file are made available subject to the terms of
20451 + * either of the following licenses
20453 + * - GNU Lesser General Public License Version 2.1
20454 + * - Sun Industry Standards Source License Version 1.1
20456 + * Sun Microsystems Inc., October, 2000
20458 + * GNU Lesser General Public License Version 2.1
20459 + * =============================================
20460 + * Copyright 2000 by Sun Microsystems, Inc.
20461 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
20463 + * This library is free software; you can redistribute it and/or
20464 + * modify it under the terms of the GNU Lesser General Public
20465 + * License version 2.1, as published by the Free Software Foundation.
20467 + * This library is distributed in the hope that it will be useful,
20468 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
20469 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20470 + * Lesser General Public License for more details.
20472 + * You should have received a copy of the GNU Lesser General Public
20473 + * License along with this library; if not, write to the Free Software
20474 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20475 + * MA 02111-1307 USA
20478 + * Sun Industry Standards Source License Version 1.1
20479 + * =================================================
20480 + * The contents of this file are subject to the Sun Industry Standards
20481 + * Source License Version 1.1 (the "License"); You may not use this file
20482 + * except in compliance with the License. You may obtain a copy of the
20483 + * License at http://www.openoffice.org/license.html.
20485 + * Software provided under this License is provided on an "AS IS" basis,
20486 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
20487 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
20488 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
20489 + * See the License for the specific provisions governing your rights and
20490 + * obligations concerning the Software.
20492 + * The Initial Developer of the Original Code is: IBM Corporation
20494 + * Copyright: 2008 by IBM Corporation
20496 + * All Rights Reserved.
20498 + * Contributor(s): _______________________________________
20501 + ************************************************************************/
20502 +/*************************************************************************
20503 + * @file
20504 + * Margins object, include left margin,right margin,top margin and bottom margin.
20505 + ************************************************************************/
20506 +/*************************************************************************
20507 + * Change History
20508 + * 2005-01-19 create this file.
20509 + ************************************************************************/
20510 +#ifndef _XFMARGINS_HXX
20511 +#define _XFMARGINS_HXX
20513 +#include "xfglobal.hxx"
20514 +#include "ixfproperty.hxx"
20516 +#define XFMARGINS_FLAG_LEFT 0x00000001
20517 +#define XFMARGINS_FLAG_RIGHT 0x00000002
20518 +#define XFMARGINS_FLAG_TOP 0x00000004
20519 +#define XFMARGINS_FLAG_BOTTOM 0x00000008
20521 +class XFMargins : public IXFProperty
20523 +public:
20524 + XFMargins();
20525 +public:
20526 + void Reset();
20527 + void SetLeft(double left);
20528 + void SetRight(double right);
20529 + void SetTop(double top);
20530 + void SetBottom(double bottom);
20532 + double GetLeft();
20533 + double GetRight();
20534 + double GetTop();
20535 + double GetBottom();
20537 + virtual void ToXml(IXFStream *pStrm);
20539 + friend bool operator==(XFMargins& indent1, XFMargins& indent2);
20540 + friend bool operator!=(XFMargins& indent1, XFMargins& indent2);
20541 + XFMargins& operator=(XFMargins& other);
20542 +private:
20543 + double m_fLeft;
20544 + double m_fRight;
20545 + double m_fTop;
20546 + double m_fBottom;
20547 + int m_nFlag;
20550 +inline void XFMargins::SetLeft(double left)
20552 + m_fLeft = left;
20553 + m_nFlag |= XFMARGINS_FLAG_LEFT;
20556 +inline void XFMargins::SetRight(double right)
20558 + m_fRight = right;
20559 + m_nFlag |= XFMARGINS_FLAG_RIGHT;
20562 +inline void XFMargins::SetTop(double top)
20564 + m_fTop = top;
20565 + m_nFlag |= XFMARGINS_FLAG_TOP;
20568 +inline void XFMargins::SetBottom(double bottom)
20570 + m_fBottom = bottom;
20571 + m_nFlag |= XFMARGINS_FLAG_BOTTOM;
20574 +inline double XFMargins::GetLeft()
20576 + return m_fLeft;
20579 +inline double XFMargins::GetRight()
20581 + return m_fRight;
20584 +inline double XFMargins::GetTop()
20586 + return m_fTop;
20589 +inline double XFMargins::GetBottom()
20591 + return m_fBottom;
20594 +#endif
20595 \ No newline at end of file
20596 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfmasterpage.cxx lotuswordpro/source/filter/xfilter/xfmasterpage.cxx
20597 --- lotuswordpro.bak/source/filter/xfilter/xfmasterpage.cxx 1970-01-01 08:00:00.000000000 +0800
20598 +++ lotuswordpro/source/filter/xfilter/xfmasterpage.cxx 2008-10-22 11:42:34.000000000 +0800
20599 @@ -0,0 +1,132 @@
20600 +/*************************************************************************
20602 + * The Contents of this file are made available subject to the terms of
20603 + * either of the following licenses
20605 + * - GNU Lesser General Public License Version 2.1
20606 + * - Sun Industry Standards Source License Version 1.1
20608 + * Sun Microsystems Inc., October, 2000
20610 + * GNU Lesser General Public License Version 2.1
20611 + * =============================================
20612 + * Copyright 2000 by Sun Microsystems, Inc.
20613 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
20615 + * This library is free software; you can redistribute it and/or
20616 + * modify it under the terms of the GNU Lesser General Public
20617 + * License version 2.1, as published by the Free Software Foundation.
20619 + * This library is distributed in the hope that it will be useful,
20620 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
20621 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20622 + * Lesser General Public License for more details.
20624 + * You should have received a copy of the GNU Lesser General Public
20625 + * License along with this library; if not, write to the Free Software
20626 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20627 + * MA 02111-1307 USA
20630 + * Sun Industry Standards Source License Version 1.1
20631 + * =================================================
20632 + * The contents of this file are subject to the Sun Industry Standards
20633 + * Source License Version 1.1 (the "License"); You may not use this file
20634 + * except in compliance with the License. You may obtain a copy of the
20635 + * License at http://www.openoffice.org/license.html.
20637 + * Software provided under this License is provided on an "AS IS" basis,
20638 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
20639 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
20640 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
20641 + * See the License for the specific provisions governing your rights and
20642 + * obligations concerning the Software.
20644 + * The Initial Developer of the Original Code is: IBM Corporation
20646 + * Copyright: 2008 by IBM Corporation
20648 + * All Rights Reserved.
20650 + * Contributor(s): _______________________________________
20653 + ************************************************************************/
20654 +/*************************************************************************
20655 + * @file
20656 + * Master page object which was used to apply a layout to the pages.
20657 + ************************************************************************/
20658 +/*************************************************************************
20659 + * Change History
20660 + * 2004-12-23 create this file.
20661 + ************************************************************************/
20662 +#include "xfmasterpage.hxx"
20663 +#include "xfpagemaster.hxx"
20664 +#include "xfstylemanager.hxx"
20665 +#include "xffooter.hxx"
20666 +#include "xfheader.hxx"
20667 +#include "../lwpglobalmgr.hxx"
20668 +XFMasterPage::XFMasterPage()
20670 + m_pHeader = NULL;
20671 + m_pFooter = NULL;
20674 +XFMasterPage::~XFMasterPage()
20676 + if( m_pHeader )
20677 + delete m_pHeader;
20678 + if( m_pFooter )
20679 + delete m_pFooter;
20682 +void XFMasterPage::SetHeader(XFHeader *pHeader)
20684 + if( m_pHeader )
20685 + delete m_pHeader;
20686 + m_pHeader = pHeader;
20689 +void XFMasterPage::SetFooter(XFFooter *pFooter)
20691 + if( m_pFooter )
20692 + delete m_pFooter;
20693 + m_pFooter = pFooter;
20696 +enumXFStyle XFMasterPage::GetStyleFamily()
20698 + return enumXFStyleMasterPage;
20702 +void XFMasterPage::SetPageMaster(rtl::OUString pm)
20704 + m_strPageMaster = pm;
20707 +void XFMasterPage::SetPageMaster(XFPageMaster *pPM)
20709 + if( pPM->GetStyleName().getLength() > 0 )
20710 + m_strPageMaster = pPM->GetStyleName();
20711 + else
20713 + XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
20714 + m_strPageMaster = pXFStyleManager->AddStyle(pPM)->GetStyleName();
20718 +void XFMasterPage::ToXml(IXFStream *pStrm)
20720 + IXFAttrList *pAttrList = pStrm->GetAttrList();
20722 + pAttrList->Clear();
20723 + pAttrList->AddAttribute( A2OUSTR("style:name"), m_strStyleName );
20724 + pAttrList->AddAttribute( A2OUSTR("style:page-master-name"), m_strPageMaster );
20725 + pStrm->StartElement( A2OUSTR("style:master-page") );
20726 + if( m_pHeader )
20727 + m_pHeader->ToXml(pStrm);
20728 + if( m_pFooter )
20729 + m_pFooter->ToXml(pStrm);
20730 + pStrm->EndElement( A2OUSTR("style:master-page") );
20732 \ No newline at end of file
20733 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfmasterpage.hxx lotuswordpro/source/filter/xfilter/xfmasterpage.hxx
20734 --- lotuswordpro.bak/source/filter/xfilter/xfmasterpage.hxx 1970-01-01 08:00:00.000000000 +0800
20735 +++ lotuswordpro/source/filter/xfilter/xfmasterpage.hxx 2008-10-22 11:42:34.000000000 +0800
20736 @@ -0,0 +1,99 @@
20737 +/*************************************************************************
20739 + * The Contents of this file are made available subject to the terms of
20740 + * either of the following licenses
20742 + * - GNU Lesser General Public License Version 2.1
20743 + * - Sun Industry Standards Source License Version 1.1
20745 + * Sun Microsystems Inc., October, 2000
20747 + * GNU Lesser General Public License Version 2.1
20748 + * =============================================
20749 + * Copyright 2000 by Sun Microsystems, Inc.
20750 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
20752 + * This library is free software; you can redistribute it and/or
20753 + * modify it under the terms of the GNU Lesser General Public
20754 + * License version 2.1, as published by the Free Software Foundation.
20756 + * This library is distributed in the hope that it will be useful,
20757 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
20758 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20759 + * Lesser General Public License for more details.
20761 + * You should have received a copy of the GNU Lesser General Public
20762 + * License along with this library; if not, write to the Free Software
20763 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20764 + * MA 02111-1307 USA
20767 + * Sun Industry Standards Source License Version 1.1
20768 + * =================================================
20769 + * The contents of this file are subject to the Sun Industry Standards
20770 + * Source License Version 1.1 (the "License"); You may not use this file
20771 + * except in compliance with the License. You may obtain a copy of the
20772 + * License at http://www.openoffice.org/license.html.
20774 + * Software provided under this License is provided on an "AS IS" basis,
20775 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
20776 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
20777 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
20778 + * See the License for the specific provisions governing your rights and
20779 + * obligations concerning the Software.
20781 + * The Initial Developer of the Original Code is: IBM Corporation
20783 + * Copyright: 2008 by IBM Corporation
20785 + * All Rights Reserved.
20787 + * Contributor(s): _______________________________________
20790 + ************************************************************************/
20791 +/*************************************************************************
20792 + * @file
20793 + * Master page object which was used to apply a layout to the pages.
20794 + ************************************************************************/
20795 +/*************************************************************************
20796 + * Change History
20797 + * 2004-12-23 create this file.
20798 + ************************************************************************/
20799 +#ifndef _XFMASTERPAGE_HXX
20800 +#define _XFMASTERPAGE_HXX
20802 +#include "xfstyle.hxx"
20803 +#include "xfcontentcontainer.hxx"
20805 +class XFPageMaster;
20806 +class XFFooter;
20807 +class XFHeader;
20808 +class XFMasterPage : public XFStyle
20810 +public:
20811 + XFMasterPage();
20813 + virtual ~XFMasterPage();
20815 +public:
20816 + void SetPageMaster(rtl::OUString pm);
20818 + void SetPageMaster(XFPageMaster *pPM);
20820 + void SetHeader(XFHeader *pHeader);
20822 + void SetFooter(XFFooter *pFooter);
20824 + virtual enumXFStyle GetStyleFamily();
20826 + virtual void ToXml(IXFStream *pStrm);
20828 +private:
20829 + rtl::OUString m_strPageMaster;
20830 + XFHeader *m_pHeader;
20831 + XFFooter *m_pFooter;
20834 +#endif
20836 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfnumberstyle.cxx lotuswordpro/source/filter/xfilter/xfnumberstyle.cxx
20837 --- lotuswordpro.bak/source/filter/xfilter/xfnumberstyle.cxx 1970-01-01 08:00:00.000000000 +0800
20838 +++ lotuswordpro/source/filter/xfilter/xfnumberstyle.cxx 2008-10-22 11:42:34.000000000 +0800
20839 @@ -0,0 +1,388 @@
20840 +/*************************************************************************
20842 + * The Contents of this file are made available subject to the terms of
20843 + * either of the following licenses
20845 + * - GNU Lesser General Public License Version 2.1
20846 + * - Sun Industry Standards Source License Version 1.1
20848 + * Sun Microsystems Inc., October, 2000
20850 + * GNU Lesser General Public License Version 2.1
20851 + * =============================================
20852 + * Copyright 2000 by Sun Microsystems, Inc.
20853 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
20855 + * This library is free software; you can redistribute it and/or
20856 + * modify it under the terms of the GNU Lesser General Public
20857 + * License version 2.1, as published by the Free Software Foundation.
20859 + * This library is distributed in the hope that it will be useful,
20860 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
20861 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20862 + * Lesser General Public License for more details.
20864 + * You should have received a copy of the GNU Lesser General Public
20865 + * License along with this library; if not, write to the Free Software
20866 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20867 + * MA 02111-1307 USA
20870 + * Sun Industry Standards Source License Version 1.1
20871 + * =================================================
20872 + * The contents of this file are subject to the Sun Industry Standards
20873 + * Source License Version 1.1 (the "License"); You may not use this file
20874 + * except in compliance with the License. You may obtain a copy of the
20875 + * License at http://www.openoffice.org/license.html.
20877 + * Software provided under this License is provided on an "AS IS" basis,
20878 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
20879 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
20880 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
20881 + * See the License for the specific provisions governing your rights and
20882 + * obligations concerning the Software.
20884 + * The Initial Developer of the Original Code is: IBM Corporation
20886 + * Copyright: 2008 by IBM Corporation
20888 + * All Rights Reserved.
20890 + * Contributor(s): _______________________________________
20893 + ************************************************************************/
20894 +/*************************************************************************
20895 + * @file
20896 + * Number style for table cell.
20897 + ************************************************************************/
20898 +/*************************************************************************
20899 + * Change History
20900 + * 2005-03-23 create this file.
20901 + ************************************************************************/
20902 +#include "xfnumberstyle.hxx"
20904 +XFNumberStyle::XFNumberStyle():m_aColor(0,0,0),m_aNegativeColor(255,0,0)
20906 + m_eType = enumXFNumberNumber;
20907 + m_nDecimalDigits = 0;
20908 + m_nMinInteger = 1;
20909 + m_nMinExponent = 2;
20910 + m_bGroup = sal_False;
20911 + m_bRedIfNegative = sal_False;
20912 + m_bCurrencySymbolPost = sal_False;
20915 +XFNumberStyle::XFNumberStyle(enumXFNumberType type)
20917 + m_eType = type;
20918 + m_nDecimalDigits = 0;
20919 + m_nMinInteger = 1;
20920 + m_nMinExponent = 1;
20921 + m_bRedIfNegative = sal_False;
20922 + m_bCurrencySymbolPost = sal_False;
20925 +enumXFStyle XFNumberStyle::GetStyleFamily()
20927 + return enumXFStyleNumber;
20930 +sal_Bool XFNumberStyle::Equal(IXFStyle *pStyle)
20932 + if( !pStyle || pStyle->GetStyleFamily() != enumXFStyleNumber )
20933 + return sal_False;
20934 + XFNumberStyle *pOther = (XFNumberStyle*)pStyle;
20935 + if( !pOther )
20936 + return sal_False;
20938 + if( m_eType != pOther->m_eType )
20939 + return sal_False;
20940 + if( m_nDecimalDigits != pOther->m_nDecimalDigits )
20941 + return sal_False;
20942 + if( m_nMinInteger != pOther->m_nMinInteger )
20943 + return sal_False;
20944 + if( m_bRedIfNegative != pOther->m_bRedIfNegative )
20945 + return sal_False;
20946 + if( m_bGroup != pOther->m_bGroup )
20947 + return sal_False;
20948 + if( m_aColor != pOther->m_aColor )
20949 + return sal_False;
20950 + if( m_strPrefix != pOther->m_strPrefix )
20951 + return sal_False;
20952 + if( m_strSuffix != pOther->m_strSuffix )
20953 + return sal_False;
20955 + //When category of number format is scientific, the number can not be displayed normally in table.
20956 + if ( m_nMinExponent != pOther->m_nMinExponent )
20957 + return sal_False;
20959 + if( m_bRedIfNegative )
20961 + if( m_aNegativeColor != pOther->m_aNegativeColor )
20962 + return sal_False;
20963 + if( m_strNegativePrefix != pOther->m_strNegativePrefix )
20964 + return sal_False;
20965 + if( m_strNegativeSuffix != pOther->m_strNegativeSuffix )
20966 + return sal_False;
20969 + if( m_eType == enuMXFNumberCurrency )
20971 + if( m_bCurrencySymbolPost != pOther->m_bCurrencySymbolPost )
20972 + return sal_False;
20973 + if( m_strCurrencySymbol != pOther->m_strCurrencySymbol )
20974 + return sal_False;
20977 + return sal_True;
20980 +void XFNumberStyle::ToXml(IXFStream *pStrm)
20982 + // for Text content number format
20983 + if (m_eType == enumXFText)
20985 + ToXml_StartElement(pStrm);
20986 + ToXml_EndElement(pStrm);
20987 + return;
20989 + // END for Text content number format
20991 + if( !m_bRedIfNegative )
20993 + ToXml_Normal(pStrm);
20995 + else
20997 + ToXml_Negative(pStrm);
20998 + }
21001 +void XFNumberStyle::ToXml_StartElement(IXFStream *pStrm)
21003 + IXFAttrList *pAttrList = pStrm->GetAttrList();
21004 + pAttrList->Clear();
21006 + pAttrList->AddAttribute( A2OUSTR("style:name"), GetStyleName() );
21007 + if( GetParentStyleName().getLength() > 0 )
21008 + pAttrList->AddAttribute(A2OUSTR("style:parent-style-name"),GetParentStyleName());
21010 + pAttrList->AddAttribute( A2OUSTR("style:family"), A2OUSTR("data-style") );
21012 + if( m_eType == enumXFNumberNumber )
21014 + pStrm->StartElement( A2OUSTR("number:number-style") );
21016 + else if( m_eType == enumXFNumberPercent )
21018 + pStrm->StartElement( A2OUSTR("number:percentage-style") );
21020 + else if( m_eType == enuMXFNumberCurrency )
21021 + {
21022 + pStrm->StartElement( A2OUSTR("number:currency-style") );
21024 + else if( m_eType == enumXFNumberScientific )
21026 + pStrm->StartElement( A2OUSTR("number:number-style") );
21028 + // for Text content number format
21029 + else if (m_eType == enumXFText)
21031 + pStrm->StartElement( A2OUSTR("number:text-content"));
21033 + // END for Text content number format
21037 +void XFNumberStyle::ToXml_EndElement(IXFStream *pStrm)
21039 + IXFAttrList *pAttrList = pStrm->GetAttrList();
21040 + pAttrList->Clear();
21042 + pAttrList->AddAttribute( A2OUSTR("style:name"), GetStyleName() );
21043 + pAttrList->AddAttribute( A2OUSTR("style:family"), A2OUSTR("data-style") );
21045 + if( m_eType == enumXFNumberNumber )
21047 + pStrm->EndElement( A2OUSTR("number:number-style") );
21049 + else if( m_eType == enumXFNumberPercent )
21051 + pStrm->EndElement( A2OUSTR("number:percentage-style") );
21053 + else if( m_eType == enuMXFNumberCurrency )
21054 + {
21055 + pStrm->EndElement( A2OUSTR("number:currency-style") );
21057 + else if( m_eType == enumXFNumberScientific )
21059 + pStrm->EndElement( A2OUSTR("number:number-style") );
21061 + // for Text content number format
21062 + else if (m_eType == enumXFText)
21064 + pStrm->EndElement( A2OUSTR("number:text-content"));
21066 + // END for Text content number format
21069 +void XFNumberStyle::ToXml_Normal(IXFStream *pStrm)
21071 + ToXml_StartElement(pStrm);
21073 + ToXml_Content(pStrm,sal_False);
21075 + ToXml_EndElement(pStrm);
21078 +void XFNumberStyle::ToXml_Negative(IXFStream *pStrm)
21080 + IXFAttrList *pAttrList = pStrm->GetAttrList();
21081 + pAttrList->Clear();
21083 + rtl::OUString strStyleName = GetStyleName();
21084 + rtl::OUString strGEStyle = strStyleName + A2OUSTR("PO");
21086 + SetStyleName(strGEStyle);
21087 + ToXml_Normal(pStrm);
21088 + SetStyleName(strStyleName);
21090 + ToXml_StartElement(pStrm);
21092 + ToXml_Content(pStrm,sal_True);
21094 + pAttrList->Clear();
21095 + pAttrList->AddAttribute( A2OUSTR("style:condition"), A2OUSTR("value()>=0") );
21096 + pAttrList->AddAttribute( A2OUSTR("style:apply-style-name"), strGEStyle );
21097 + pStrm->StartElement( A2OUSTR("style:map") );
21098 + pStrm->EndElement( A2OUSTR("style:map") );
21100 + ToXml_EndElement(pStrm);
21103 +void XFNumberStyle::ToXml_Content(IXFStream *pStrm, sal_Bool nagetive)
21105 + IXFAttrList *pAttrList = pStrm->GetAttrList();
21106 + pAttrList->Clear();
21107 + //color:
21108 + if( !nagetive )
21109 + pAttrList->AddAttribute( A2OUSTR("fo:color"), m_aColor.ToString() );
21110 + else
21111 + pAttrList->AddAttribute( A2OUSTR("fo:color"), m_aNegativeColor.ToString() );
21113 + pStrm->StartElement( A2OUSTR("style:properties") );
21114 + pStrm->EndElement( A2OUSTR("style:properties") );
21116 + if( !nagetive )
21118 + if( m_strPrefix.getLength()>0 )
21120 + pStrm->StartElement( A2OUSTR("number:text") );
21121 + pStrm->Characters(m_strPrefix);
21122 + pStrm->EndElement( A2OUSTR("number:text") );
21125 + else
21127 + if( m_strNegativePrefix.getLength() == 0 )
21128 + m_strNegativePrefix = m_strPrefix;
21129 + if( m_strNegativePrefix.getLength()>0 )
21131 + pStrm->StartElement( A2OUSTR("number:text") );
21132 + // pStrm->Characters(m_strNegativePrefix);
21133 + pStrm->Characters(m_strNegativePrefix + A2OUSTR("-"));
21134 + pStrm->EndElement( A2OUSTR("number:text") );
21136 + else
21138 + pStrm->StartElement( A2OUSTR("number:text") );
21139 + pStrm->Characters(A2OUSTR("-"));
21140 + pStrm->EndElement( A2OUSTR("number:text") );
21144 + if( m_eType == enuMXFNumberCurrency && !m_bCurrencySymbolPost )
21145 + {
21146 + if( m_strCurrencySymbol.getLength() > 0 )
21148 + pStrm->StartElement( A2OUSTR("number:currency-symbol") );
21149 + pStrm->Characters(m_strCurrencySymbol);
21150 + pStrm->EndElement( A2OUSTR("number:currency-symbol") );
21154 + //When category of number format is scientific, the number can not be displayed normally in table.
21155 + if ( m_eType == enumXFNumberScientific )
21157 + pAttrList->Clear();
21158 + pAttrList->AddAttribute(A2OUSTR("number:decimal-places"), Int32ToOUString(m_nDecimalDigits));
21159 + pAttrList->AddAttribute(A2OUSTR("number:min-integer-digits"), Int32ToOUString(m_nMinInteger));
21160 + pAttrList->AddAttribute(A2OUSTR("number:min-exponent-digits"), Int32ToOUString(m_nMinExponent));
21161 + pStrm->StartElement( A2OUSTR("number:scientific-number") );
21162 + pStrm->EndElement( A2OUSTR("number:scientific-number") );
21164 + else
21166 + pAttrList->Clear();
21167 + pAttrList->AddAttribute(A2OUSTR("number:decimal-places"),Int32ToOUString(m_nDecimalDigits));
21168 + pAttrList->AddAttribute(A2OUSTR("number:min-integer-digits"),Int32ToOUString(m_nMinInteger));
21170 + if( m_bGroup )
21171 + pAttrList->AddAttribute(A2OUSTR("number:grouping"),A2OUSTR("true"));
21172 + else
21173 + pAttrList->AddAttribute(A2OUSTR("number:grouping"),A2OUSTR("false"));
21175 + pStrm->StartElement( A2OUSTR("number:number") );
21176 + pStrm->EndElement( A2OUSTR("number:number") );
21179 + if( m_eType == enuMXFNumberCurrency && m_bCurrencySymbolPost )
21180 + {
21181 + if( m_strCurrencySymbol.getLength()>0 )
21183 + pStrm->StartElement( A2OUSTR("number:currency-symbol") );
21184 + pStrm->Characters(m_strCurrencySymbol);
21185 + pStrm->EndElement( A2OUSTR("number:currency-symbol") );
21189 + if( !nagetive )
21191 + if( m_strSuffix.getLength()>0 )
21193 + pStrm->StartElement( A2OUSTR("number:text") );
21194 + pStrm->Characters(m_strSuffix);
21195 + pStrm->EndElement( A2OUSTR("number:text") );
21197 + else
21199 + if( m_eType == enumXFNumberPercent )
21201 + pStrm->StartElement( A2OUSTR("number:text") );
21202 + pStrm->Characters(A2OUSTR("%"));
21203 + pStrm->EndElement( A2OUSTR("number:text") );
21207 + else
21209 + if( m_strNegativeSuffix.getLength() == 0 )
21210 + m_strNegativeSuffix = m_strSuffix;
21211 + if( m_strNegativeSuffix.getLength()>0 )
21213 + pStrm->StartElement( A2OUSTR("number:text") );
21214 + pStrm->Characters(m_strNegativeSuffix);
21215 + pStrm->EndElement( A2OUSTR("number:text") );
21217 + else
21219 + if( m_eType == enumXFNumberPercent )
21221 + pStrm->StartElement( A2OUSTR("number:text") );
21222 + pStrm->Characters(A2OUSTR("%"));
21223 + pStrm->EndElement( A2OUSTR("number:text") );
21228 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfnumberstyle.hxx lotuswordpro/source/filter/xfilter/xfnumberstyle.hxx
21229 --- lotuswordpro.bak/source/filter/xfilter/xfnumberstyle.hxx 1970-01-01 08:00:00.000000000 +0800
21230 +++ lotuswordpro/source/filter/xfilter/xfnumberstyle.hxx 2008-10-22 11:42:34.000000000 +0800
21231 @@ -0,0 +1,197 @@
21232 +/*************************************************************************
21234 + * The Contents of this file are made available subject to the terms of
21235 + * either of the following licenses
21237 + * - GNU Lesser General Public License Version 2.1
21238 + * - Sun Industry Standards Source License Version 1.1
21240 + * Sun Microsystems Inc., October, 2000
21242 + * GNU Lesser General Public License Version 2.1
21243 + * =============================================
21244 + * Copyright 2000 by Sun Microsystems, Inc.
21245 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
21247 + * This library is free software; you can redistribute it and/or
21248 + * modify it under the terms of the GNU Lesser General Public
21249 + * License version 2.1, as published by the Free Software Foundation.
21251 + * This library is distributed in the hope that it will be useful,
21252 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
21253 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21254 + * Lesser General Public License for more details.
21256 + * You should have received a copy of the GNU Lesser General Public
21257 + * License along with this library; if not, write to the Free Software
21258 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21259 + * MA 02111-1307 USA
21262 + * Sun Industry Standards Source License Version 1.1
21263 + * =================================================
21264 + * The contents of this file are subject to the Sun Industry Standards
21265 + * Source License Version 1.1 (the "License"); You may not use this file
21266 + * except in compliance with the License. You may obtain a copy of the
21267 + * License at http://www.openoffice.org/license.html.
21269 + * Software provided under this License is provided on an "AS IS" basis,
21270 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
21271 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
21272 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
21273 + * See the License for the specific provisions governing your rights and
21274 + * obligations concerning the Software.
21276 + * The Initial Developer of the Original Code is: IBM Corporation
21278 + * Copyright: 2008 by IBM Corporation
21280 + * All Rights Reserved.
21282 + * Contributor(s): _______________________________________
21285 + ************************************************************************/
21286 +/*************************************************************************
21287 + * @file
21288 + * Number style for table cell.
21289 + ************************************************************************/
21290 +/*************************************************************************
21291 + * Change History
21292 + * 2005-03-23 create this file.
21293 + ************************************************************************/
21294 +#ifndef _XFNUMBERSTYLE_HXX
21295 +#define _XFNUMBERSTYLE_HXX
21297 +#include "xfstyle.hxx"
21298 +#include "xfstylemanager.hxx"
21299 +#include "xfcolor.hxx"
21300 +#include <rtl/ustring.hxx>
21302 +class XFNumberStyle : public XFStyle
21304 +public:
21305 + XFNumberStyle();
21307 + XFNumberStyle(enumXFNumberType type );
21309 +public:
21310 + void SetDecimalDigits(sal_Int32 decimal);
21312 + void SetMinInteger(sal_Int32 integer);
21314 + void SetMinExponent(sal_Int32 exponent);
21316 + void SetGroup(sal_Bool group = sal_True);
21318 + void SetColor(const XFColor& color);
21319 + XFColor GetColor(){return m_aColor;}//add by ,2005/11/30
21321 + void SetPrefix(rtl::OUString prefix);
21323 + void SetSurfix(rtl::OUString surfix);
21325 + void SetNegativeStyle(rtl::OUString prefix, rtl::OUString suffix, const XFColor& color=XFColor(255,0,0));
21327 + void SetNumberType(enumXFNumberType type);
21329 + void SetCurrencySymbol(sal_Bool post, rtl::OUString symbol, sal_Bool bShowSpace=sal_False);
21331 + virtual enumXFStyle GetStyleFamily();
21333 + virtual sal_Bool Equal(IXFStyle *pStyle);
21335 + virtual void ToXml(IXFStream *pStrm);
21337 +protected:
21338 + void ToXml_StartElement(IXFStream *pStrm);
21340 + void ToXml_EndElement(IXFStream *pStrm);
21342 + void ToXml_Normal(IXFStream *pStrm);
21344 + void ToXml_Negative(IXFStream *pStrm);
21346 + void ToXml_Content(IXFStream *pStrm, sal_Bool nagetive);
21348 +protected:
21349 + enumXFNumberType m_eType;
21350 + sal_Int32 m_nDecimalDigits;
21351 + sal_Int32 m_nMinInteger;
21352 + sal_Int32 m_nMinExponent;
21353 + sal_Bool m_bGroup;
21354 + XFColor m_aColor;
21355 + sal_Bool m_bCurrencySymbolPost;
21356 + rtl::OUString m_strCurrencySymbol;
21357 + rtl::OUString m_strPrefix;
21358 + rtl::OUString m_strSuffix;
21360 + sal_Bool m_bRedIfNegative;
21361 + XFColor m_aNegativeColor;
21362 + rtl::OUString m_strNegativePrefix;
21363 + rtl::OUString m_strNegativeSuffix;
21366 +inline void XFNumberStyle::SetDecimalDigits(sal_Int32 decimal)
21368 + m_nDecimalDigits = decimal;
21371 +inline void XFNumberStyle::SetMinInteger(sal_Int32 integer)
21373 + m_nMinInteger = integer;
21376 +inline void XFNumberStyle::SetMinExponent(sal_Int32 exponent)
21378 + m_nMinExponent = exponent;
21381 +inline void XFNumberStyle::SetNegativeStyle(rtl::OUString prefix, rtl::OUString suffix, const XFColor& color)
21383 + m_bRedIfNegative = sal_True;
21384 + m_aNegativeColor = color;
21385 + m_strNegativePrefix = prefix;
21386 + m_strNegativeSuffix = suffix;
21389 +inline void XFNumberStyle::SetGroup(sal_Bool group)
21391 + m_bGroup = group;
21394 +inline void XFNumberStyle::SetColor(const XFColor& color)
21396 + m_aColor = color;
21399 +inline void XFNumberStyle::SetNumberType(enumXFNumberType type)
21401 + m_eType = type;
21404 +inline void XFNumberStyle::SetPrefix(rtl::OUString prefix)
21406 + m_strPrefix = prefix;
21409 +inline void XFNumberStyle::SetSurfix(rtl::OUString surfix)
21411 + m_strSuffix = surfix;
21414 +inline void XFNumberStyle::SetCurrencySymbol(sal_Bool post, rtl::OUString symbol, sal_Bool bShowSpace)
21416 + m_bCurrencySymbolPost = post;
21417 + m_strCurrencySymbol = symbol;
21419 + if( bShowSpace )
21421 + if( post )
21422 + m_strCurrencySymbol = A2OUSTR(" ") + m_strCurrencySymbol;
21423 + else
21424 + m_strCurrencySymbol += A2OUSTR(" ");
21428 +#endif
21429 \ No newline at end of file
21430 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfnumfmt.hxx lotuswordpro/source/filter/xfilter/xfnumfmt.hxx
21431 --- lotuswordpro.bak/source/filter/xfilter/xfnumfmt.hxx 1970-01-01 08:00:00.000000000 +0800
21432 +++ lotuswordpro/source/filter/xfilter/xfnumfmt.hxx 2008-10-22 11:42:34.000000000 +0800
21433 @@ -0,0 +1,153 @@
21434 +/*************************************************************************
21436 + * The Contents of this file are made available subject to the terms of
21437 + * either of the following licenses
21439 + * - GNU Lesser General Public License Version 2.1
21440 + * - Sun Industry Standards Source License Version 1.1
21442 + * Sun Microsystems Inc., October, 2000
21444 + * GNU Lesser General Public License Version 2.1
21445 + * =============================================
21446 + * Copyright 2000 by Sun Microsystems, Inc.
21447 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
21449 + * This library is free software; you can redistribute it and/or
21450 + * modify it under the terms of the GNU Lesser General Public
21451 + * License version 2.1, as published by the Free Software Foundation.
21453 + * This library is distributed in the hope that it will be useful,
21454 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
21455 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21456 + * Lesser General Public License for more details.
21458 + * You should have received a copy of the GNU Lesser General Public
21459 + * License along with this library; if not, write to the Free Software
21460 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21461 + * MA 02111-1307 USA
21464 + * Sun Industry Standards Source License Version 1.1
21465 + * =================================================
21466 + * The contents of this file are subject to the Sun Industry Standards
21467 + * Source License Version 1.1 (the "License"); You may not use this file
21468 + * except in compliance with the License. You may obtain a copy of the
21469 + * License at http://www.openoffice.org/license.html.
21471 + * Software provided under this License is provided on an "AS IS" basis,
21472 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
21473 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
21474 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
21475 + * See the License for the specific provisions governing your rights and
21476 + * obligations concerning the Software.
21478 + * The Initial Developer of the Original Code is: IBM Corporation
21480 + * Copyright: 2008 by IBM Corporation
21482 + * All Rights Reserved.
21484 + * Contributor(s): _______________________________________
21487 + ************************************************************************/
21488 +/*************************************************************************
21489 + * @file
21490 + * Number format. a),A),i),1),(1)
21491 + ************************************************************************/
21492 +/*************************************************************************
21493 + * Change History
21494 + * 2005-01-17 create this file.
21495 + ************************************************************************/
21497 +#ifndef _XFNUMFMT_HXX
21498 +#define _XFNUMFMT_HXX
21500 +#include "xfglobal.hxx"
21501 +#include "ixfproperty.hxx"
21503 +/**
21504 + * @brief
21505 + * Bullet number format.
21506 + */
21507 +class XFNumFmt : public IXFProperty
21509 +public:
21510 + XFNumFmt()
21512 + m_nStartValue = 0;
21515 +public:
21516 + /**********************************************************************
21517 + * @descr: set the prefix of the number format,that the '(' of output
21518 + (1 item1
21519 + (2 item2
21520 + * @param: prefix
21521 + *********************************************************************/
21522 + void SetPrefix(rtl::OUString prefix)
21524 + m_strPrefix = prefix;
21527 + /**********************************************************************
21528 + * @descr: set the suffix of the number format,that the ')' of output
21529 + 1) item1
21530 + 2) item2
21531 + * @param: prefix
21532 + *********************************************************************/
21533 + void SetSuffix(rtl::OUString suffix)
21535 + m_strSuffix = suffix;
21538 + /**********************************************************************
21539 + * @descr: set the display value. ie. if you set format to '1',then
21540 + the ouput would be:
21541 + 1 item1
21542 + 2 item2
21543 + or if you set the format to 'a', then the output would be:
21544 + a item1
21545 + b item2
21546 + some sepecial, if you set the format to a sequence,ie. "Ò»,¶þ,Èý,..."
21547 + the output would be:
21548 + Ò» item1
21549 + ¶þ item2
21550 + Èý item3
21552 + Of cource, for unordered-list, you can also set the format to
21553 + be a bullet char,ie:
21554 + '','','','','',
21555 + * @param: prefix
21556 + *********************************************************************/
21557 + void SetFormat(rtl::OUString format)
21559 + m_strFormat = format;
21562 + void SetStartValue(sal_Int16 start)
21564 + m_nStartValue = start;
21567 + virtual void ToXml(IXFStream *pStrm)
21568 + {
21569 + IXFAttrList *pAttrList = pStrm->GetAttrList();
21571 + if( m_strPrefix.getLength() > 0 )
21572 + pAttrList->AddAttribute( A2OUSTR("style:num-prefix"), m_strPrefix );
21573 + if( m_strSuffix.getLength() > 0 )
21574 + pAttrList->AddAttribute( A2OUSTR("style:num-suffix"), m_strSuffix );
21575 + pAttrList->AddAttribute( A2OUSTR("style:num-format"), m_strFormat );
21576 + if( m_nStartValue != 0 )
21577 + pAttrList->AddAttribute( A2OUSTR("text:start-value"), Int16ToOUString(m_nStartValue) );
21579 +private:
21580 + rtl::OUString m_strPrefix;
21581 + rtl::OUString m_strSuffix;
21582 + rtl::OUString m_strFormat;
21583 + sal_Int16 m_nStartValue;
21586 +#endif
21587 \ No newline at end of file
21588 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfofficemeta.cxx lotuswordpro/source/filter/xfilter/xfofficemeta.cxx
21589 --- lotuswordpro.bak/source/filter/xfilter/xfofficemeta.cxx 1970-01-01 08:00:00.000000000 +0800
21590 +++ lotuswordpro/source/filter/xfilter/xfofficemeta.cxx 2008-10-22 11:42:34.000000000 +0800
21591 @@ -0,0 +1,150 @@
21592 +/*************************************************************************
21594 + * The Contents of this file are made available subject to the terms of
21595 + * either of the following licenses
21597 + * - GNU Lesser General Public License Version 2.1
21598 + * - Sun Industry Standards Source License Version 1.1
21600 + * Sun Microsystems Inc., October, 2000
21602 + * GNU Lesser General Public License Version 2.1
21603 + * =============================================
21604 + * Copyright 2000 by Sun Microsystems, Inc.
21605 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
21607 + * This library is free software; you can redistribute it and/or
21608 + * modify it under the terms of the GNU Lesser General Public
21609 + * License version 2.1, as published by the Free Software Foundation.
21611 + * This library is distributed in the hope that it will be useful,
21612 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
21613 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21614 + * Lesser General Public License for more details.
21616 + * You should have received a copy of the GNU Lesser General Public
21617 + * License along with this library; if not, write to the Free Software
21618 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21619 + * MA 02111-1307 USA
21622 + * Sun Industry Standards Source License Version 1.1
21623 + * =================================================
21624 + * The contents of this file are subject to the Sun Industry Standards
21625 + * Source License Version 1.1 (the "License"); You may not use this file
21626 + * except in compliance with the License. You may obtain a copy of the
21627 + * License at http://www.openoffice.org/license.html.
21629 + * Software provided under this License is provided on an "AS IS" basis,
21630 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
21631 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
21632 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
21633 + * See the License for the specific provisions governing your rights and
21634 + * obligations concerning the Software.
21636 + * The Initial Developer of the Original Code is: IBM Corporation
21638 + * Copyright: 2008 by IBM Corporation
21640 + * All Rights Reserved.
21642 + * Contributor(s): _______________________________________
21645 + ************************************************************************/
21646 +/*************************************************************************
21647 + * @file
21648 + * Implemention file for Meta data,pls reference to the header file.
21649 + ************************************************************************/
21650 +/*************************************************************************
21651 + * Change History
21652 + * 2004-12-26 create this file.
21653 + * 2004-01-05 it works now.
21654 + ************************************************************************/
21655 +#include "xfofficemeta.hxx"
21656 +#include "ixfstream.hxx"
21657 +#include "ixfattrlist.hxx"
21659 +void XFOfficeMeta::SetGenerator(rtl::OUString generator)
21661 + m_strGenerator = generator;
21664 +void XFOfficeMeta::SetTitle(rtl::OUString title)
21666 + m_strTitle = title;
21669 +void XFOfficeMeta::SetCreator(rtl::OUString creator)
21671 + m_strCreator = creator;
21673 +void XFOfficeMeta::SetDescription(rtl::OUString dsr)
21675 + m_strDsr = dsr;
21677 +void XFOfficeMeta::SetKeywords(rtl::OUString keywords)
21679 + m_strKeywords = keywords;
21681 +void XFOfficeMeta::SetCreationTime(rtl::OUString crtime)
21683 + m_strCrtime = crtime;
21685 +void XFOfficeMeta::SetLastTime(rtl::OUString lstime)
21687 + m_strLstime = lstime;
21689 +void XFOfficeMeta::SetEditTime(rtl::OUString edtime)
21691 + m_strEdtime = edtime;
21693 +void XFOfficeMeta::ToXml(IXFStream *pStream)
21695 + IXFAttrList *pAttrList = pStream->GetAttrList();
21697 + pAttrList->Clear();
21698 + pStream->StartElement( A2OUSTR("office:meta") );
21700 + //generator:
21701 + pStream->StartElement( A2OUSTR("meta:generator") );
21702 + pStream->Characters( m_strGenerator );
21703 + pStream->EndElement( A2OUSTR("meta:generator") );
21705 + //title
21706 + pStream->StartElement( A2OUSTR("dc:title") );
21707 + pStream->Characters( m_strTitle );
21708 + pStream->EndElement( A2OUSTR("dc:title") );
21710 + //keywords
21711 + pStream->StartElement( A2OUSTR("meta:keywords") );
21712 + pStream->StartElement( A2OUSTR("meta:keyword") );
21713 + pStream->Characters( m_strKeywords );
21714 + pStream->EndElement( A2OUSTR("meta:keyword") );
21715 + pStream->EndElement( A2OUSTR("meta:keywords") );
21717 + //creation time
21718 + pStream->StartElement( A2OUSTR("meta:creation-date") );
21719 + pStream->Characters( m_strCrtime);
21720 + pStream->EndElement( A2OUSTR("meta:creation-date") );
21722 + //last revision time
21723 + pStream->StartElement( A2OUSTR("dc:date") );
21724 + pStream->Characters( m_strLstime);
21725 + pStream->EndElement( A2OUSTR("dc:date") );
21726 + //total edit time
21727 + pStream->StartElement( A2OUSTR("meta:editing-duration") );
21728 + pStream->Characters( m_strEdtime);
21729 + pStream->EndElement( A2OUSTR("meta:editing-duration") );
21731 + //description
21732 + pStream->StartElement( A2OUSTR("dc:description") );
21733 + pStream->Characters( m_strDsr );
21734 + pStream->EndElement( A2OUSTR("dc:description") );
21735 + //creator
21736 + pStream->StartElement( A2OUSTR("meta:initial-creator") );
21737 + pStream->Characters( m_strCreator );
21738 + pStream->EndElement( A2OUSTR("meta:initial-creator") );
21740 + pStream->EndElement( A2OUSTR("office:meta") );
21742 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfofficemeta.hxx lotuswordpro/source/filter/xfilter/xfofficemeta.hxx
21743 --- lotuswordpro.bak/source/filter/xfilter/xfofficemeta.hxx 1970-01-01 08:00:00.000000000 +0800
21744 +++ lotuswordpro/source/filter/xfilter/xfofficemeta.hxx 2008-10-22 11:42:34.000000000 +0800
21745 @@ -0,0 +1,98 @@
21746 +/*************************************************************************
21748 + * The Contents of this file are made available subject to the terms of
21749 + * either of the following licenses
21751 + * - GNU Lesser General Public License Version 2.1
21752 + * - Sun Industry Standards Source License Version 1.1
21754 + * Sun Microsystems Inc., October, 2000
21756 + * GNU Lesser General Public License Version 2.1
21757 + * =============================================
21758 + * Copyright 2000 by Sun Microsystems, Inc.
21759 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
21761 + * This library is free software; you can redistribute it and/or
21762 + * modify it under the terms of the GNU Lesser General Public
21763 + * License version 2.1, as published by the Free Software Foundation.
21765 + * This library is distributed in the hope that it will be useful,
21766 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
21767 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21768 + * Lesser General Public License for more details.
21770 + * You should have received a copy of the GNU Lesser General Public
21771 + * License along with this library; if not, write to the Free Software
21772 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21773 + * MA 02111-1307 USA
21776 + * Sun Industry Standards Source License Version 1.1
21777 + * =================================================
21778 + * The contents of this file are subject to the Sun Industry Standards
21779 + * Source License Version 1.1 (the "License"); You may not use this file
21780 + * except in compliance with the License. You may obtain a copy of the
21781 + * License at http://www.openoffice.org/license.html.
21783 + * Software provided under this License is provided on an "AS IS" basis,
21784 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
21785 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
21786 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
21787 + * See the License for the specific provisions governing your rights and
21788 + * obligations concerning the Software.
21790 + * The Initial Developer of the Original Code is: IBM Corporation
21792 + * Copyright: 2008 by IBM Corporation
21794 + * All Rights Reserved.
21796 + * Contributor(s): _______________________________________
21799 + ************************************************************************/
21800 +/*************************************************************************
21801 + * @file
21802 + * Meta info for the full document.
21803 + * You can see this by click: File->Properties.
21804 + ************************************************************************/
21805 +/*************************************************************************
21806 + * Change History
21807 + * 2004-12-26 create this file.
21808 + ************************************************************************/
21809 +#ifndef _XFOFFICEMETA_HXX
21810 +#define _XFOFFICEMETA_HXX
21812 +#include "xfglobal.hxx"
21814 +class XFOfficeMeta : public IXFObject
21816 +public:
21817 + XFOfficeMeta(){};
21818 + virtual ~XFOfficeMeta(){};
21820 + void SetGenerator(rtl::OUString generator);
21821 + void SetTitle(rtl::OUString title);
21822 + void SetCreator(rtl::OUString creator);
21823 + void SetDescription(rtl::OUString dsr);
21824 + void SetKeywords(rtl::OUString keywords);
21825 + void SetCreationTime(rtl::OUString crtime);
21826 + void SetLastTime(rtl::OUString lstime);
21827 + void SetEditTime(rtl::OUString edtime);
21829 + virtual void ToXml(IXFStream *pStream);
21830 +private:
21831 + rtl::OUString m_strGenerator;
21832 + rtl::OUString m_strTitle;
21833 + rtl::OUString m_strCreator;
21834 + rtl::OUString m_strDsr;
21835 + rtl::OUString m_strKeywords;
21836 + rtl::OUString m_strCrtime;
21837 + rtl::OUString m_strLstime;
21838 + rtl::OUString m_strEdtime;
21842 +#endif
21844 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfoleobj.cxx lotuswordpro/source/filter/xfilter/xfoleobj.cxx
21845 --- lotuswordpro.bak/source/filter/xfilter/xfoleobj.cxx 1970-01-01 08:00:00.000000000 +0800
21846 +++ lotuswordpro/source/filter/xfilter/xfoleobj.cxx 2008-10-22 11:42:34.000000000 +0800
21847 @@ -0,0 +1,118 @@
21848 +/*************************************************************************
21850 + * The Contents of this file are made available subject to the terms of
21851 + * either of the following licenses
21853 + * - GNU Lesser General Public License Version 2.1
21854 + * - Sun Industry Standards Source License Version 1.1
21856 + * Sun Microsystems Inc., October, 2000
21858 + * GNU Lesser General Public License Version 2.1
21859 + * =============================================
21860 + * Copyright 2000 by Sun Microsystems, Inc.
21861 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
21863 + * This library is free software; you can redistribute it and/or
21864 + * modify it under the terms of the GNU Lesser General Public
21865 + * License version 2.1, as published by the Free Software Foundation.
21867 + * This library is distributed in the hope that it will be useful,
21868 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
21869 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21870 + * Lesser General Public License for more details.
21872 + * You should have received a copy of the GNU Lesser General Public
21873 + * License along with this library; if not, write to the Free Software
21874 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21875 + * MA 02111-1307 USA
21878 + * Sun Industry Standards Source License Version 1.1
21879 + * =================================================
21880 + * The contents of this file are subject to the Sun Industry Standards
21881 + * Source License Version 1.1 (the "License"); You may not use this file
21882 + * except in compliance with the License. You may obtain a copy of the
21883 + * License at http://www.openoffice.org/license.html.
21885 + * Software provided under this License is provided on an "AS IS" basis,
21886 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
21887 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
21888 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
21889 + * See the License for the specific provisions governing your rights and
21890 + * obligations concerning the Software.
21892 + * The Initial Developer of the Original Code is: IBM Corporation
21894 + * Copyright: 2008 by IBM Corporation
21896 + * All Rights Reserved.
21898 + * Contributor(s): _______________________________________
21901 + ************************************************************************/
21902 +/*************************************************************************
21903 + * Change History
21904 + 2005-02-25 Created
21905 + ************************************************************************/
21906 +#include "xfoleobj.hxx"
21907 +#include "xfbase64.hxx"
21909 +XFOleObject::XFOleObject()
21913 +void XFOleObject::SetOleData(sal_uInt8 *buf, int len)
21915 + m_strData = XFBase64::Encode(buf, len);
21918 +void XFOleObject::ToXml(IXFStream *pStrm)
21920 + IXFAttrList *pAttrList = pStrm->GetAttrList();
21922 + if( GetStyleName().getLength() )
21923 + pAttrList->AddAttribute( A2OUSTR("draw:style-name"), GetStyleName() );
21925 + assert(m_strName.getLength()>0); //name should not be null.
21926 + if( m_strName.getLength() )
21927 + pAttrList->AddAttribute( A2OUSTR("draw:name"), m_strName );
21928 + //anchor type:
21929 + switch( m_eAnchor )
21931 + case enumXFAnchorPara:
21932 + pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("paragraph") );
21933 + break;
21934 + case enumXFAnchorPage:
21935 + pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("page") );
21936 + pAttrList->AddAttribute( A2OUSTR("text:anchor-page-number"), Int32ToOUString(m_nAnchorPage) );
21937 + break;
21938 + case enumXFAnchorChar:
21939 + pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("char") );
21940 + break;
21941 + case enumXFAnchorAsChar:
21942 + pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("as-char") );
21943 + break;
21944 + case enumXFAnchorFrame:
21945 + pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("frame") );
21946 + break;
21948 + pAttrList->AddAttribute( A2OUSTR("svg:x"), DoubleToOUString(m_aRect.GetX()) + A2OUSTR("cm") );
21949 + pAttrList->AddAttribute( A2OUSTR("svg:y"), DoubleToOUString(m_aRect.GetY()) + A2OUSTR("cm") );
21950 + pAttrList->AddAttribute( A2OUSTR("svg:width"), DoubleToOUString(m_aRect.GetWidth()) + A2OUSTR("cm") );
21951 + pAttrList->AddAttribute( A2OUSTR("svg:height"), DoubleToOUString(m_aRect.GetHeight()) + A2OUSTR("cm") );
21952 + pAttrList->AddAttribute( A2OUSTR("draw:z-index"), Int32ToOUString(m_nZIndex) );
21954 + if( m_strNextLink.getLength() > 0 )
21955 + pAttrList->AddAttribute( A2OUSTR("draw:chain-next-name"), m_strNextLink );
21957 + pStrm->StartElement( A2OUSTR("draw:object-ole") );
21959 + pAttrList->Clear();
21960 + pStrm->StartElement( A2OUSTR("office:binary-data") );
21961 + pStrm->Characters(m_strData);
21962 + pStrm->EndElement( A2OUSTR("office:binary-data") );
21964 + pStrm->EndElement( A2OUSTR("draw:object-ole") );
21966 \ No newline at end of file
21967 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfoleobj.hxx lotuswordpro/source/filter/xfilter/xfoleobj.hxx
21968 --- lotuswordpro.bak/source/filter/xfilter/xfoleobj.hxx 1970-01-01 08:00:00.000000000 +0800
21969 +++ lotuswordpro/source/filter/xfilter/xfoleobj.hxx 2008-10-22 11:42:34.000000000 +0800
21970 @@ -0,0 +1,89 @@
21971 +/*************************************************************************
21973 + * The Contents of this file are made available subject to the terms of
21974 + * either of the following licenses
21976 + * - GNU Lesser General Public License Version 2.1
21977 + * - Sun Industry Standards Source License Version 1.1
21979 + * Sun Microsystems Inc., October, 2000
21981 + * GNU Lesser General Public License Version 2.1
21982 + * =============================================
21983 + * Copyright 2000 by Sun Microsystems, Inc.
21984 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
21986 + * This library is free software; you can redistribute it and/or
21987 + * modify it under the terms of the GNU Lesser General Public
21988 + * License version 2.1, as published by the Free Software Foundation.
21990 + * This library is distributed in the hope that it will be useful,
21991 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
21992 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21993 + * Lesser General Public License for more details.
21995 + * You should have received a copy of the GNU Lesser General Public
21996 + * License along with this library; if not, write to the Free Software
21997 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21998 + * MA 02111-1307 USA
22001 + * Sun Industry Standards Source License Version 1.1
22002 + * =================================================
22003 + * The contents of this file are subject to the Sun Industry Standards
22004 + * Source License Version 1.1 (the "License"); You may not use this file
22005 + * except in compliance with the License. You may obtain a copy of the
22006 + * License at http://www.openoffice.org/license.html.
22008 + * Software provided under this License is provided on an "AS IS" basis,
22009 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
22010 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
22011 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
22012 + * See the License for the specific provisions governing your rights and
22013 + * obligations concerning the Software.
22015 + * The Initial Developer of the Original Code is: IBM Corporation
22017 + * Copyright: 2008 by IBM Corporation
22019 + * All Rights Reserved.
22021 + * Contributor(s): _______________________________________
22024 + ************************************************************************/
22025 +/*************************************************************************
22026 + * Change History
22027 + 2005-02-25 Created
22028 + ************************************************************************/
22029 +#ifndef _XFOLEOBJ_HXX
22030 +#define _XFOLEOBJ_HXX
22032 +#include "xfframe.hxx"
22034 +/**
22035 + * @brief
22036 + * Ole object.
22037 + * Ole object is a frame object, it inherits all properties of frame obejct.
22038 + */
22039 +class XFOleObject : public XFFrame
22041 +public:
22042 + XFOleObject();
22044 +public:
22045 + /**
22046 + * @descr Set ole object data. The data will be base64 encoded before sent to SODC.
22047 + */
22048 + void SetOleData(sal_uInt8 *buf, int len);
22050 + /**
22051 + * @descr output ole obejct.
22052 + */
22053 + virtual void ToXml(IXFStream *pStrm);
22055 +private:
22056 + rtl::OUString m_strData;
22059 +#endif
22060 \ No newline at end of file
22061 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfoutlinestyle.cxx lotuswordpro/source/filter/xfilter/xfoutlinestyle.cxx
22062 --- lotuswordpro.bak/source/filter/xfilter/xfoutlinestyle.cxx 1970-01-01 08:00:00.000000000 +0800
22063 +++ lotuswordpro/source/filter/xfilter/xfoutlinestyle.cxx 2008-10-22 11:42:34.000000000 +0800
22064 @@ -0,0 +1,131 @@
22065 +/*************************************************************************
22067 + * The Contents of this file are made available subject to the terms of
22068 + * either of the following licenses
22070 + * - GNU Lesser General Public License Version 2.1
22071 + * - Sun Industry Standards Source License Version 1.1
22073 + * Sun Microsystems Inc., October, 2000
22075 + * GNU Lesser General Public License Version 2.1
22076 + * =============================================
22077 + * Copyright 2000 by Sun Microsystems, Inc.
22078 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
22080 + * This library is free software; you can redistribute it and/or
22081 + * modify it under the terms of the GNU Lesser General Public
22082 + * License version 2.1, as published by the Free Software Foundation.
22084 + * This library is distributed in the hope that it will be useful,
22085 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
22086 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22087 + * Lesser General Public License for more details.
22089 + * You should have received a copy of the GNU Lesser General Public
22090 + * License along with this library; if not, write to the Free Software
22091 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
22092 + * MA 02111-1307 USA
22095 + * Sun Industry Standards Source License Version 1.1
22096 + * =================================================
22097 + * The contents of this file are subject to the Sun Industry Standards
22098 + * Source License Version 1.1 (the "License"); You may not use this file
22099 + * except in compliance with the License. You may obtain a copy of the
22100 + * License at http://www.openoffice.org/license.html.
22102 + * Software provided under this License is provided on an "AS IS" basis,
22103 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
22104 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
22105 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
22106 + * See the License for the specific provisions governing your rights and
22107 + * obligations concerning the Software.
22109 + * The Initial Developer of the Original Code is: IBM Corporation
22111 + * Copyright: 2008 by IBM Corporation
22113 + * All Rights Reserved.
22115 + * Contributor(s): _______________________________________
22118 + ************************************************************************/
22119 +/*************************************************************************
22120 + * @file
22121 + * Outline style for the full document.
22122 + ************************************************************************/
22123 +/*************************************************************************
22124 + * Change History
22125 + * 2005-02-2 create and implements.
22126 + ************************************************************************/
22127 +#include "xfoutlinestyle.hxx"
22129 +XFOutlineLevelStyle::XFOutlineLevelStyle()
22131 + m_nLevel = 0;
22132 + m_fIndent = 0;
22133 + m_fMinLabelWidth = 0;
22134 + m_fMinLabelDistance = 0;
22135 + m_eAlign = enumXFAlignNone;
22136 + m_pNumFmt = NULL;
22139 +XFOutlineLevelStyle::~XFOutlineLevelStyle()
22141 + if( m_pNumFmt )
22142 + delete m_pNumFmt;
22145 +void XFOutlineLevelStyle::ToXml(IXFStream *pStrm)
22147 + IXFAttrList *pAttrList = pStrm->GetAttrList();
22148 + pAttrList->Clear();
22150 + assert(m_nLevel>0);
22151 + pAttrList->AddAttribute( A2OUSTR("text:level"), Int32ToOUString(m_nLevel) );
22152 + if( GetStyleName().getLength() > 0 )
22153 + pAttrList->AddAttribute( A2OUSTR("text:style-name"), GetStyleName() );
22154 + if( m_pNumFmt )
22155 + m_pNumFmt->ToXml(pStrm);
22156 + else
22157 + pAttrList->AddAttribute( A2OUSTR("style:num-format"), A2OUSTR("") );
22158 + pStrm->StartElement( A2OUSTR("text:outline-level-style") );
22160 + pAttrList->Clear();
22161 + if( m_fIndent )
22162 + pAttrList->AddAttribute( A2OUSTR("text:space-before"), DoubleToOUString(m_fIndent) + A2OUSTR("cm") );
22163 + if( m_fMinLabelWidth )
22164 + pAttrList->AddAttribute( A2OUSTR("text:min-label-width"), DoubleToOUString(m_fMinLabelWidth) + A2OUSTR("cm") );
22165 + if( m_fMinLabelDistance )
22166 + pAttrList->AddAttribute( A2OUSTR("text:min-label-distance"), DoubleToOUString(m_fMinLabelDistance) + A2OUSTR("cm") );
22167 + if( enumXFAlignNone != m_eAlign )
22168 + pAttrList->AddAttribute( A2OUSTR("fo:text-align"), GetAlignName(m_eAlign) );
22169 + pStrm->StartElement( A2OUSTR("style:properties") );
22170 + pStrm->EndElement( A2OUSTR("style:properties") );
22172 + pStrm->EndElement( A2OUSTR("text:outline-level-style") );
22175 +XFOutlineStyle::XFOutlineStyle()
22177 + for( int i=0; i<10; i++ )
22178 + m_aLevels[i].SetLevel(i+1);
22181 +enumXFStyle XFOutlineStyle::GetStyleFamily()
22183 + return enumXFStyleOutline;
22186 +void XFOutlineStyle::ToXml(IXFStream *pStrm)
22188 + IXFAttrList *pAttrList = pStrm->GetAttrList();
22189 + pAttrList->Clear();
22191 + pStrm->StartElement( A2OUSTR("text:outline-style") );
22192 + for( int i=0; i<10; i++ )
22193 + m_aLevels[i].ToXml(pStrm);
22194 + pStrm->EndElement( A2OUSTR("text:outline-style") );
22196 \ No newline at end of file
22197 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfoutlinestyle.hxx lotuswordpro/source/filter/xfilter/xfoutlinestyle.hxx
22198 --- lotuswordpro.bak/source/filter/xfilter/xfoutlinestyle.hxx 1970-01-01 08:00:00.000000000 +0800
22199 +++ lotuswordpro/source/filter/xfilter/xfoutlinestyle.hxx 2008-10-22 11:42:34.000000000 +0800
22200 @@ -0,0 +1,191 @@
22201 +/*************************************************************************
22203 + * The Contents of this file are made available subject to the terms of
22204 + * either of the following licenses
22206 + * - GNU Lesser General Public License Version 2.1
22207 + * - Sun Industry Standards Source License Version 1.1
22209 + * Sun Microsystems Inc., October, 2000
22211 + * GNU Lesser General Public License Version 2.1
22212 + * =============================================
22213 + * Copyright 2000 by Sun Microsystems, Inc.
22214 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
22216 + * This library is free software; you can redistribute it and/or
22217 + * modify it under the terms of the GNU Lesser General Public
22218 + * License version 2.1, as published by the Free Software Foundation.
22220 + * This library is distributed in the hope that it will be useful,
22221 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
22222 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22223 + * Lesser General Public License for more details.
22225 + * You should have received a copy of the GNU Lesser General Public
22226 + * License along with this library; if not, write to the Free Software
22227 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
22228 + * MA 02111-1307 USA
22231 + * Sun Industry Standards Source License Version 1.1
22232 + * =================================================
22233 + * The contents of this file are subject to the Sun Industry Standards
22234 + * Source License Version 1.1 (the "License"); You may not use this file
22235 + * except in compliance with the License. You may obtain a copy of the
22236 + * License at http://www.openoffice.org/license.html.
22238 + * Software provided under this License is provided on an "AS IS" basis,
22239 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
22240 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
22241 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
22242 + * See the License for the specific provisions governing your rights and
22243 + * obligations concerning the Software.
22245 + * The Initial Developer of the Original Code is: IBM Corporation
22247 + * Copyright: 2008 by IBM Corporation
22249 + * All Rights Reserved.
22251 + * Contributor(s): _______________________________________
22254 + ************************************************************************/
22255 +/*************************************************************************
22256 + * @file
22257 + * Outline style for the full document.
22258 + ************************************************************************/
22259 +/*************************************************************************
22260 + * Change History
22261 + * 2005-02-2 create and implements.
22262 + ************************************************************************/
22263 +#ifndef _XFOUTLINESTYLE_HXX
22264 +#define _XFOUTLINESTYLE_HXX
22266 +#include "xfstyle.hxx"
22267 +#include "xfnumfmt.hxx"
22269 +class XFNumFmt;
22270 +class XFOutlineLevelStyle : public XFStyle
22272 +public:
22273 + XFOutlineLevelStyle();
22275 + virtual ~XFOutlineLevelStyle();
22277 +public:
22278 + void SetNumFmt(XFNumFmt& fmt);
22280 + void SetLevel(sal_Int16 level);
22282 + void SetIndent(double indent);
22284 + void SetMinLabelWidth(double labelWidth);
22286 + void SetMinLabelDistance(double distance);
22288 + void SetTextAlign(enumXFAlignType align);
22290 + virtual void ToXml(IXFStream *pStrm);
22291 +private:
22292 + XFNumFmt *m_pNumFmt;
22293 + sal_Int16 m_nLevel;
22294 + double m_fIndent;
22295 + double m_fMinLabelWidth;
22296 + double m_fMinLabelDistance;
22297 + enumXFAlignType m_eAlign;
22300 +class XFOutlineStyle : public XFStyle
22302 +public:
22303 + XFOutlineStyle();
22305 +public:
22306 + void SetNumFmt(sal_Int32 level, XFNumFmt& fmt);
22308 + void SetIndent(sal_Int32 level, double indent);
22310 + void SetMinLabelWidth(sal_Int32 level, double labelWidth);
22312 + void SetMinLabelDistance(sal_Int32 level, double distance);
22314 + void SetTextAlign(sal_Int32 level, enumXFAlignType align);
22316 + virtual enumXFStyle GetStyleFamily();
22318 + virtual void ToXml(IXFStream *pStrm);
22320 +private:
22321 + XFOutlineLevelStyle m_aLevels[10];
22326 +//XFOutlineLevelStyle:
22328 +inline void XFOutlineLevelStyle::SetNumFmt(XFNumFmt& fmt)
22330 + m_pNumFmt = new XFNumFmt(fmt);
22333 +inline void XFOutlineLevelStyle::SetLevel(sal_Int16 level)
22335 + m_nLevel = level;
22338 +inline void XFOutlineLevelStyle::SetIndent(double indent)
22340 + m_fIndent = indent;
22343 +inline void XFOutlineLevelStyle::SetMinLabelWidth(double width)
22345 + m_fMinLabelWidth = width;
22348 +inline void XFOutlineLevelStyle::SetMinLabelDistance(double distance)
22350 + m_fMinLabelDistance = distance;
22353 +inline void XFOutlineLevelStyle::SetTextAlign(enumXFAlignType align)
22355 + m_eAlign = align;
22359 +//XFOutlineStyle:
22361 +inline void XFOutlineStyle::SetNumFmt(sal_Int32 level, XFNumFmt& fmt)
22363 + assert(level>=1&&level<=10);
22364 + m_aLevels[level].SetNumFmt(fmt);
22367 +inline void XFOutlineStyle::SetIndent(sal_Int32 level, double indent)
22369 + assert(level>=1&&level<=10);
22370 + m_aLevels[level].SetIndent(indent);
22373 +inline void XFOutlineStyle::SetMinLabelWidth(sal_Int32 level, double width)
22375 + assert(level>=1&&level<=10);
22376 + m_aLevels[level].SetMinLabelWidth(width);
22379 +inline void XFOutlineStyle::SetMinLabelDistance(sal_Int32 level, double distance)
22381 + assert(level>=1&&level<=10);
22382 + m_aLevels[level].SetMinLabelDistance(distance);
22385 +inline void XFOutlineStyle::SetTextAlign(sal_Int32 level, enumXFAlignType align)
22387 + assert(level>=1&&level<=10);
22388 + m_aLevels[level].SetTextAlign(align);
22391 +#endif
22392 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfpadding.hxx lotuswordpro/source/filter/xfilter/xfpadding.hxx
22393 --- lotuswordpro.bak/source/filter/xfilter/xfpadding.hxx 1970-01-01 08:00:00.000000000 +0800
22394 +++ lotuswordpro/source/filter/xfilter/xfpadding.hxx 2008-10-22 11:42:34.000000000 +0800
22395 @@ -0,0 +1,210 @@
22396 +/*************************************************************************
22398 + * The Contents of this file are made available subject to the terms of
22399 + * either of the following licenses
22401 + * - GNU Lesser General Public License Version 2.1
22402 + * - Sun Industry Standards Source License Version 1.1
22404 + * Sun Microsystems Inc., October, 2000
22406 + * GNU Lesser General Public License Version 2.1
22407 + * =============================================
22408 + * Copyright 2000 by Sun Microsystems, Inc.
22409 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
22411 + * This library is free software; you can redistribute it and/or
22412 + * modify it under the terms of the GNU Lesser General Public
22413 + * License version 2.1, as published by the Free Software Foundation.
22415 + * This library is distributed in the hope that it will be useful,
22416 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
22417 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22418 + * Lesser General Public License for more details.
22420 + * You should have received a copy of the GNU Lesser General Public
22421 + * License along with this library; if not, write to the Free Software
22422 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
22423 + * MA 02111-1307 USA
22426 + * Sun Industry Standards Source License Version 1.1
22427 + * =================================================
22428 + * The contents of this file are subject to the Sun Industry Standards
22429 + * Source License Version 1.1 (the "License"); You may not use this file
22430 + * except in compliance with the License. You may obtain a copy of the
22431 + * License at http://www.openoffice.org/license.html.
22433 + * Software provided under this License is provided on an "AS IS" basis,
22434 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
22435 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
22436 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
22437 + * See the License for the specific provisions governing your rights and
22438 + * obligations concerning the Software.
22440 + * The Initial Developer of the Original Code is: IBM Corporation
22442 + * Copyright: 2008 by IBM Corporation
22444 + * All Rights Reserved.
22446 + * Contributor(s): _______________________________________
22449 + ************************************************************************/
22450 +/*************************************************************************
22451 + * @file
22452 + * Padding for paragraph.
22453 + ************************************************************************/
22454 +/*************************************************************************
22455 + * Change History
22456 + * 2005-01-28 move some structure out of this file.
22457 + ************************************************************************/
22458 +#ifndef _XFPADDING_HXX
22459 +#define _XFPADDING_HXX
22461 +#include "xfglobal.hxx"
22462 +#include "ixfproperty.hxx"
22464 +#define XFPADDING_FLAG_LEFT 0X00000001
22465 +#define XFPADDING_FLAG_RIGHT 0X00000002
22466 +#define XFPADDING_FLAG_TOP 0X00000004
22467 +#define XFPADDING_FLAG_BOTTOM 0X00000008
22469 +/**
22470 + * @brief
22471 + * Padings for paragraph,frame,...
22472 + */
22473 +class XFPadding : public IXFProperty
22475 +public:
22476 + XFPadding();
22478 +public:
22479 + /**
22480 + * @descr Reset all values.
22481 + */
22482 + void Reset();
22484 + /**
22485 + * @descr Set padding left.
22486 + */
22487 + void SetLeft(double left);
22489 + /**
22490 + * @descr Set padding right.
22491 + */
22492 + void SetRight(double right);
22494 + /**
22495 + * @descr Set padding top.
22496 + */
22497 + void SetTop(double top);
22499 + /**
22500 + * @descr Set padding bottom.
22501 + */
22502 + void SetBottom(double bottom);
22504 + /**
22505 + * @descr Output padding properties.
22506 + */
22507 + virtual void ToXml(IXFStream *pStrm);
22509 + friend bool operator==(XFPadding& p1, XFPadding& p2);
22510 + friend bool operator!=(XFPadding& p1, XFPadding& p2);
22511 +private:
22512 + int m_nFlag;
22513 + double m_fLeft;
22514 + double m_fRight;
22515 + double m_fTop;
22516 + double m_fBottom;
22520 +inline XFPadding::XFPadding()
22522 + Reset();
22525 +inline void XFPadding::Reset()
22527 + m_nFlag = 0;
22528 + m_fLeft = 0;
22529 + m_fRight = 0;
22530 + m_fTop = 0;
22531 + m_fBottom = 0;
22534 +inline void XFPadding::SetLeft(double left)
22536 + m_fLeft = left;
22537 + m_nFlag |= XFPADDING_FLAG_LEFT;
22540 +inline void XFPadding::SetRight(double right)
22542 + m_fRight = right;
22543 + m_nFlag |= XFPADDING_FLAG_RIGHT;
22546 +inline void XFPadding::SetTop(double top)
22548 + m_fTop = top;
22549 + m_nFlag |= XFPADDING_FLAG_TOP;
22552 +inline void XFPadding::SetBottom(double bottom)
22554 + m_fBottom = bottom;
22555 + m_nFlag |= XFPADDING_FLAG_BOTTOM;
22558 +inline void XFPadding::ToXml(IXFStream *pStrm)
22560 + IXFAttrList *pAttrList = pStrm->GetAttrList();
22562 + if( (m_fLeft == m_fRight) && (m_fLeft == m_fTop) && (m_fLeft== m_fBottom ) && m_nFlag == 0x00000015 )
22564 + pAttrList->AddAttribute( A2OUSTR("fo:padding"), DoubleToOUString(m_fLeft) + A2OUSTR("cm") );
22565 + return;
22567 + //margin left:
22568 + if( m_nFlag&XFPADDING_FLAG_LEFT )
22570 + pAttrList->AddAttribute( A2OUSTR("fo:padding-left"), DoubleToOUString(m_fLeft) + A2OUSTR("cm") );
22572 + //margin right:
22573 + if( m_nFlag&XFPADDING_FLAG_RIGHT )
22575 + pAttrList->AddAttribute(A2OUSTR("fo:padding-right"), DoubleToOUString(m_fRight) + A2OUSTR("cm") );
22576 + }
22577 + //margin top:
22578 + if( m_nFlag&XFPADDING_FLAG_TOP )
22580 + pAttrList->AddAttribute(A2OUSTR("fo:padding-top"), DoubleToOUString(m_fTop) + A2OUSTR("cm") );
22582 + //margin bottom:
22583 + if( m_nFlag&XFPADDING_FLAG_BOTTOM )
22585 + pAttrList->AddAttribute(A2OUSTR("fo:padding-bottom"), DoubleToOUString(m_fBottom) + A2OUSTR("cm") );
22589 +inline bool operator==(XFPadding& p1, XFPadding& p2)
22591 + return (
22592 + (p1.m_nFlag == p2.m_nFlag) &&
22593 + (p1.m_fLeft == p2.m_fLeft) &&
22594 + (p1.m_fRight == p2.m_fRight) &&
22595 + (p1.m_fTop == p2.m_fTop) &&
22596 + (p1.m_fBottom == p2.m_fBottom)
22597 + );
22600 +inline bool operator!=(XFPadding& p1, XFPadding& p2)
22602 + return !(p1==p2);
22605 +#endif
22606 \ No newline at end of file
22607 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfpagecount.hxx lotuswordpro/source/filter/xfilter/xfpagecount.hxx
22608 --- lotuswordpro.bak/source/filter/xfilter/xfpagecount.hxx 1970-01-01 08:00:00.000000000 +0800
22609 +++ lotuswordpro/source/filter/xfilter/xfpagecount.hxx 2008-10-22 11:42:34.000000000 +0800
22610 @@ -0,0 +1,89 @@
22611 +/*************************************************************************
22613 + * The Contents of this file are made available subject to the terms of
22614 + * either of the following licenses
22616 + * - GNU Lesser General Public License Version 2.1
22617 + * - Sun Industry Standards Source License Version 1.1
22619 + * Sun Microsystems Inc., October, 2000
22621 + * GNU Lesser General Public License Version 2.1
22622 + * =============================================
22623 + * Copyright 2000 by Sun Microsystems, Inc.
22624 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
22626 + * This library is free software; you can redistribute it and/or
22627 + * modify it under the terms of the GNU Lesser General Public
22628 + * License version 2.1, as published by the Free Software Foundation.
22630 + * This library is distributed in the hope that it will be useful,
22631 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
22632 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22633 + * Lesser General Public License for more details.
22635 + * You should have received a copy of the GNU Lesser General Public
22636 + * License along with this library; if not, write to the Free Software
22637 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
22638 + * MA 02111-1307 USA
22641 + * Sun Industry Standards Source License Version 1.1
22642 + * =================================================
22643 + * The contents of this file are subject to the Sun Industry Standards
22644 + * Source License Version 1.1 (the "License"); You may not use this file
22645 + * except in compliance with the License. You may obtain a copy of the
22646 + * License at http://www.openoffice.org/license.html.
22648 + * Software provided under this License is provided on an "AS IS" basis,
22649 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
22650 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
22651 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
22652 + * See the License for the specific provisions governing your rights and
22653 + * obligations concerning the Software.
22655 + * The Initial Developer of the Original Code is: IBM Corporation
22657 + * Copyright: 2008 by IBM Corporation
22659 + * All Rights Reserved.
22661 + * Contributor(s): _______________________________________
22664 + ************************************************************************/
22665 +/*************************************************************************
22666 + * @file
22667 + * Page number field.
22668 + ************************************************************************/
22669 +/*************************************************************************
22670 + * Change History
22671 + * 2005-01-31 create this file.
22672 + ************************************************************************/
22673 +#ifndef _XFPAGECOUNT_HXX
22674 +#define _XFPAGECOUNT_HXX
22676 +#include "xfglobal.hxx"
22677 +#include "xfcontent.hxx"
22678 +#include "xfnumfmt.hxx"
22680 +/**
22681 + * @brief
22682 + * Page count field.
22683 + */
22684 +class XFPageCount : public XFContent
22686 +public:
22687 + virtual void ToXml(IXFStream *pStrm);
22690 +inline void XFPageCount::ToXml(IXFStream *pStrm)
22692 + IXFAttrList *pAttrList = pStrm->GetAttrList();
22693 + pAttrList->Clear();
22695 + pStrm->StartElement( A2OUSTR("text:page-count") );
22696 + pStrm->EndElement( A2OUSTR("text:page-count") );
22699 +#endif
22700 \ No newline at end of file
22701 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfpagemaster.cxx lotuswordpro/source/filter/xfilter/xfpagemaster.cxx
22702 --- lotuswordpro.bak/source/filter/xfilter/xfpagemaster.cxx 1970-01-01 08:00:00.000000000 +0800
22703 +++ lotuswordpro/source/filter/xfilter/xfpagemaster.cxx 2008-10-22 11:42:34.000000000 +0800
22704 @@ -0,0 +1,300 @@
22705 +/*************************************************************************
22707 + * The Contents of this file are made available subject to the terms of
22708 + * either of the following licenses
22710 + * - GNU Lesser General Public License Version 2.1
22711 + * - Sun Industry Standards Source License Version 1.1
22713 + * Sun Microsystems Inc., October, 2000
22715 + * GNU Lesser General Public License Version 2.1
22716 + * =============================================
22717 + * Copyright 2000 by Sun Microsystems, Inc.
22718 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
22720 + * This library is free software; you can redistribute it and/or
22721 + * modify it under the terms of the GNU Lesser General Public
22722 + * License version 2.1, as published by the Free Software Foundation.
22724 + * This library is distributed in the hope that it will be useful,
22725 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
22726 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22727 + * Lesser General Public License for more details.
22729 + * You should have received a copy of the GNU Lesser General Public
22730 + * License along with this library; if not, write to the Free Software
22731 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
22732 + * MA 02111-1307 USA
22735 + * Sun Industry Standards Source License Version 1.1
22736 + * =================================================
22737 + * The contents of this file are subject to the Sun Industry Standards
22738 + * Source License Version 1.1 (the "License"); You may not use this file
22739 + * except in compliance with the License. You may obtain a copy of the
22740 + * License at http://www.openoffice.org/license.html.
22742 + * Software provided under this License is provided on an "AS IS" basis,
22743 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
22744 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
22745 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
22746 + * See the License for the specific provisions governing your rights and
22747 + * obligations concerning the Software.
22749 + * The Initial Developer of the Original Code is: IBM Corporation
22751 + * Copyright: 2008 by IBM Corporation
22753 + * All Rights Reserved.
22755 + * Contributor(s): _______________________________________
22758 + ************************************************************************/
22759 +/*************************************************************************
22760 + * @file
22761 + * Page master used bye XFMasterPage.
22762 + * It is the real object to define header and footer of pages.
22763 + ************************************************************************/
22764 +/*************************************************************************
22765 + * Change History
22766 + * 2005-01-17 create this file.
22767 + ************************************************************************/
22768 +#include "xfpagemaster.hxx"
22769 +#include "ixfstream.hxx"
22770 +#include "ixfattrlist.hxx"
22771 +#include "xfborders.hxx"
22772 +#include "xfshadow.hxx"
22773 +#include "xfcolumns.hxx"
22774 +#include "xfheaderstyle.hxx"
22775 +#include "xffooterstyle.hxx"
22776 +#include "xfbgimage.hxx"
22778 +XFPageMaster::XFPageMaster()
22780 + m_fPageWidth = 0;
22781 + m_fPageHeight = 0;
22782 + m_eUsage = enumXFPageUsageNone;
22783 + m_eTextDir = enumXFTextDirNone;
22784 + m_bPrintOrient = sal_True;
22785 + m_pBorders = NULL;
22786 + m_pShadow = NULL;
22787 + m_pColumns = NULL;
22788 + m_pBGImage = NULL;
22790 + m_pHeaderStyle = NULL;
22791 + m_pFooterStyle = NULL;
22793 + m_eSepAlign = enumXFAlignNone;
22794 + m_fSepWidth = 0;
22795 + m_aSepColor = 0;
22796 + m_fSepSpaceAbove = 0;
22797 + m_fSepSpaceBelow = 0;
22798 + m_nSepLengthPercent = 0;
22801 +XFPageMaster::~XFPageMaster()
22803 + if( m_pBorders )
22804 + delete m_pBorders;
22805 + if( m_pShadow )
22806 + delete m_pShadow;
22807 + if( m_pColumns )
22808 + delete m_pColumns;
22809 + if( m_pHeaderStyle )
22810 + delete m_pHeaderStyle;
22811 + if( m_pFooterStyle )
22812 + delete m_pFooterStyle;
22813 + if( m_pBGImage )
22814 + delete m_pBGImage;
22817 +enumXFStyle XFPageMaster::GetStyleFamily()
22819 + return enumXFStylePageMaster;
22822 +void XFPageMaster::SetPageWidth(double width)
22824 + m_fPageWidth = width;
22827 +void XFPageMaster::SetPageHeight(double height)
22829 + m_fPageHeight = height;
22832 +void XFPageMaster::SetMargins(double left, double right,double top, double bottom)
22834 + if( left != -1 )
22835 + m_aMargin.SetLeft(left);
22836 + if( right != -1 )
22837 + m_aMargin.SetRight(right);
22838 + if( top != -1 )
22839 + m_aMargin.SetTop(top);
22840 + if( bottom != -1 )
22841 + m_aMargin.SetBottom(bottom);
22844 +void XFPageMaster::SetBorders(XFBorders *pBorders)
22846 + if( m_pBorders && (pBorders != m_pBorders) )
22847 + delete m_pBorders;
22848 + m_pBorders = pBorders;
22851 +void XFPageMaster::SetShadow(XFShadow *pShadow)
22853 + if( m_pShadow && (pShadow != m_pShadow) )
22854 + delete m_pShadow;
22855 + m_pShadow = pShadow;
22858 +void XFPageMaster::SetBackColor(XFColor color)
22860 + m_aBackColor = color;
22863 +void XFPageMaster::SetBackImage(XFBGImage *image)
22865 + if( m_pBGImage )
22866 + delete m_pBGImage;
22867 + m_pBGImage = image;
22870 +void XFPageMaster::SetColumns(XFColumns *pColumns)
22872 + if( m_pColumns && (pColumns != m_pColumns) )
22873 + delete m_pColumns;
22874 + m_pColumns = pColumns;
22877 + void XFPageMaster::SetHeaderStyle(XFHeaderStyle *pHeaderStyle)
22879 + if( m_pHeaderStyle && (pHeaderStyle != m_pHeaderStyle) )
22880 + delete m_pHeaderStyle;
22881 + m_pHeaderStyle = pHeaderStyle;
22884 +void XFPageMaster::SetFooterStyle(XFFooterStyle *pFooterStyle)
22886 + if( m_pFooterStyle && (pFooterStyle != m_pFooterStyle) )
22887 + delete m_pFooterStyle;
22888 + m_pFooterStyle = pFooterStyle;
22891 +void XFPageMaster::SetFootNoteSeparator(
22892 + enumXFAlignType align,
22893 + double width,
22894 + sal_Int32 lengthPercent,
22895 + double spaceAbove,
22896 + double spaceBelow,
22897 + XFColor color
22900 + m_eSepAlign = align;
22901 + m_fSepWidth = width;
22902 + m_nSepLengthPercent = lengthPercent;
22903 + m_fSepSpaceAbove = spaceAbove;
22904 + m_fSepSpaceBelow = spaceBelow;
22905 + m_aSepColor = color;
22908 +/**
22910 + <style:page-master style:name="pm1">
22911 + <style:properties fo:page-width="20.999cm" fo:page-height="29.699cm" style:num-format="1"
22912 + style:print-orientation="portrait" fo:margin-top="1.249cm" fo:margin-bottom="1.249cm"
22913 + fo:margin-left="3.175cm" fo:margin-right="3.175cm" style:writing-mode="lr-tb"
22914 + style:layout-grid-color="#c0c0c0" style:layout-grid-lines="42"
22915 + style:layout-grid-base-height="0.494cm" style:layout-grid-ruby-height="0.141cm"
22916 + style:layout-grid-mode="none" style:layout-grid-ruby-below="false" style:layout-grid-print="false"
22917 + style:layout-grid-display="false" style:footnote-max-height="0cm">
22918 + <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm"
22919 + style:distance-after-sep="0.101cm" style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
22920 + </style:properties>
22921 + <style:header-style>
22922 + <style:properties fo:min-height="1.291cm" fo:margin-bottom="0.792cm" style:dynamic-spacing="true"/>
22923 + </style:header-style>
22924 + <style:footer-style>
22925 + <style:properties fo:min-height="1.291cm" fo:margin-top="0.792cm" style:dynamic-spacing="true"/>
22926 + </style:footer-style>
22927 + </style:page-master>
22929 + */
22930 +void XFPageMaster::ToXml(IXFStream *pStream)
22932 + IXFAttrList *pAttrList = pStream->GetAttrList();
22934 + pAttrList->Clear();
22935 + pAttrList->AddAttribute(A2OUSTR("style:name"),GetStyleName());
22937 + if( m_eUsage != enumXFPageUsageNone )
22938 + pAttrList->AddAttribute(A2OUSTR("style:page-usage"), GetPageUsageName(m_eUsage));
22940 + pStream->StartElement( A2OUSTR("style:page-master") );
22942 + //style:properties
22943 + pAttrList->Clear();
22944 + if( m_fPageWidth != 0 )
22945 + pAttrList->AddAttribute( A2OUSTR("fo:page-width"), DoubleToOUString(m_fPageWidth) + A2OUSTR("cm") );
22946 + if( m_fPageHeight != 0 )
22947 + pAttrList->AddAttribute( A2OUSTR("fo:page-height"), DoubleToOUString(m_fPageHeight) + A2OUSTR("cm") );
22949 + m_aMargin.ToXml(pStream);
22951 + if( m_bPrintOrient )
22952 + pAttrList->AddAttribute( A2OUSTR("style:print-orientation"), A2OUSTR("portrait") );
22953 + else
22954 + pAttrList->AddAttribute( A2OUSTR("style:print-orientation"), A2OUSTR("landscape") );
22956 + if( m_pBorders )
22957 + m_pBorders->ToXml(pStream);
22958 + if( m_pShadow )
22959 + pAttrList->AddAttribute( A2OUSTR("style:shadow"), m_pShadow->ToString() );
22961 + if( m_aBackColor.IsValid() )
22962 + pAttrList->AddAttribute( A2OUSTR("fo:background-color"), m_aBackColor.ToString() );
22964 + //text directory
22965 + if( m_eTextDir != enumXFTextDirNone )
22966 + pAttrList->AddAttribute( A2OUSTR("style:writing-mode"), GetTextDirName(m_eTextDir) );
22968 + pStream->StartElement( A2OUSTR("style:properties") );
22969 + if( m_pColumns )
22970 + m_pColumns->ToXml(pStream);
22972 + if( m_pBGImage )
22973 + m_pBGImage->ToXml(pStream);
22975 + if( m_eSepAlign || m_nSepLengthPercent>0 || m_fSepSpaceAbove>0 || m_fSepSpaceBelow>0 )
22977 + pAttrList->Clear();
22978 + pAttrList->AddAttribute( A2OUSTR("style:width"), DoubleToOUString(m_fSepWidth) + A2OUSTR("cm") );
22979 + pAttrList->AddAttribute( A2OUSTR("style:distance-before-sep"), DoubleToOUString(m_fSepSpaceAbove) + A2OUSTR("cm") );
22980 + pAttrList->AddAttribute( A2OUSTR("style:distance-after-sep"), DoubleToOUString(m_fSepSpaceBelow) + A2OUSTR("cm") );
22981 + pAttrList->AddAttribute( A2OUSTR("style:color"), m_aSepColor.ToString() );
22982 + if( m_eSepAlign == enumXFAlignStart )
22983 + pAttrList->AddAttribute( A2OUSTR("style:adjustment"), A2OUSTR("left") );
22984 + else if( m_eSepAlign == enumXFAlignCenter )
22985 + pAttrList->AddAttribute( A2OUSTR("style:adjustment"), A2OUSTR("center") );
22986 + else if( m_eSepAlign == enumXFAlignEnd )
22987 + pAttrList->AddAttribute( A2OUSTR("style:adjustment"), A2OUSTR("right") );
22988 + pAttrList->AddAttribute( A2OUSTR("style:rel-width"), Int32ToOUString(m_nSepLengthPercent) + A2OUSTR("%") );
22989 + pStream->StartElement( A2OUSTR("style:footnote-sep") );
22990 + pStream->EndElement( A2OUSTR("style:footnote-sep") );
22993 + pStream->EndElement( A2OUSTR("style:properties") );
22995 + //header style:
22996 + if( m_pHeaderStyle )
22997 + m_pHeaderStyle->ToXml(pStream);
22998 + //footer style:
22999 + if( m_pFooterStyle )
23000 + m_pFooterStyle->ToXml(pStream);
23002 + pStream->EndElement( A2OUSTR("style:page-master") );
23005 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfpagemaster.hxx lotuswordpro/source/filter/xfilter/xfpagemaster.hxx
23006 --- lotuswordpro.bak/source/filter/xfilter/xfpagemaster.hxx 1970-01-01 08:00:00.000000000 +0800
23007 +++ lotuswordpro/source/filter/xfilter/xfpagemaster.hxx 2008-10-22 11:42:34.000000000 +0800
23008 @@ -0,0 +1,169 @@
23009 +/*************************************************************************
23011 + * The Contents of this file are made available subject to the terms of
23012 + * either of the following licenses
23014 + * - GNU Lesser General Public License Version 2.1
23015 + * - Sun Industry Standards Source License Version 1.1
23017 + * Sun Microsystems Inc., October, 2000
23019 + * GNU Lesser General Public License Version 2.1
23020 + * =============================================
23021 + * Copyright 2000 by Sun Microsystems, Inc.
23022 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
23024 + * This library is free software; you can redistribute it and/or
23025 + * modify it under the terms of the GNU Lesser General Public
23026 + * License version 2.1, as published by the Free Software Foundation.
23028 + * This library is distributed in the hope that it will be useful,
23029 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
23030 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23031 + * Lesser General Public License for more details.
23033 + * You should have received a copy of the GNU Lesser General Public
23034 + * License along with this library; if not, write to the Free Software
23035 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
23036 + * MA 02111-1307 USA
23039 + * Sun Industry Standards Source License Version 1.1
23040 + * =================================================
23041 + * The contents of this file are subject to the Sun Industry Standards
23042 + * Source License Version 1.1 (the "License"); You may not use this file
23043 + * except in compliance with the License. You may obtain a copy of the
23044 + * License at http://www.openoffice.org/license.html.
23046 + * Software provided under this License is provided on an "AS IS" basis,
23047 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
23048 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
23049 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
23050 + * See the License for the specific provisions governing your rights and
23051 + * obligations concerning the Software.
23053 + * The Initial Developer of the Original Code is: IBM Corporation
23055 + * Copyright: 2008 by IBM Corporation
23057 + * All Rights Reserved.
23059 + * Contributor(s): _______________________________________
23062 + ************************************************************************/
23063 +/*************************************************************************
23064 + * @file
23065 + * Page master used bye XFMasterPage.
23066 + * It is the real object to define header and footer of pages.
23067 + ************************************************************************/
23068 +/*************************************************************************
23069 + * Change History
23070 + * 2005-01-17 create this file.
23071 + ************************************************************************/
23072 +#ifndef _XFPAGEMASTER_HXX
23073 +#define _XFPAGEMASTER_HXX
23075 +#include "xfglobal.hxx"
23076 +#include "xfstyle.hxx"
23077 +#include "xfcolor.hxx"
23078 +#include "xfmargins.hxx"
23080 +class XFBorders;
23081 +class XFShadow;
23082 +class XFColumns;
23083 +class XFHeaderStyle;
23084 +class XFFooterStyle;
23085 +class XFBGImage;
23087 +class XFPageMaster : public XFStyle
23089 +public:
23090 + XFPageMaster();
23092 + virtual ~XFPageMaster();
23094 +public:
23095 + void SetPageWidth(double width);
23097 + void SetPageHeight(double height);
23099 + void SetMargins(double left=-1, double right=-1,double top=-1, double bottom=-1);
23101 + void SetPageUsage(enumXFPageUsage usage);
23103 + void SetPrintOrient(sal_Bool bUseWidth=sal_True);
23105 + void SetBorders(XFBorders *pBorders);
23107 + void SetShadow(XFShadow *pShadow);
23109 + void SetBackColor(XFColor color);
23111 + void SetBackImage(XFBGImage *image);
23113 + void SetColumns(XFColumns *pColumns);
23115 + void SetHeaderStyle(XFHeaderStyle *pHeaderStyle);
23117 + void SetFooterStyle(XFFooterStyle *pFooterStyle);
23119 + void SetTextDir(enumXFTextDir dir);
23121 + void SetFootNoteSeparator(enumXFAlignType align = enumXFAlignStart,
23122 + double width = 0.05,
23123 + sal_Int32 lengthPercent = 25,
23124 + double spaceAbove = 0.1,
23125 + double spaceBelow = 0.1,
23126 + XFColor color=XFColor(0,0,0)
23127 + );
23129 + virtual enumXFStyle GetStyleFamily();
23131 + virtual void ToXml(IXFStream *pStream);
23133 +private:
23134 + double m_fPageWidth;
23135 + double m_fPageHeight;
23137 + XFMargins m_aMargin;
23139 + enumXFPageUsage m_eUsage;
23140 + enumXFTextDir m_eTextDir;
23141 + sal_Bool m_bPrintOrient;
23143 + XFBorders *m_pBorders;
23144 + XFShadow *m_pShadow;
23145 + XFColor m_aBackColor;
23146 + XFColumns *m_pColumns;
23147 + XFBGImage *m_pBGImage;
23149 + XFHeaderStyle *m_pHeaderStyle;
23150 + XFFooterStyle *m_pFooterStyle;
23151 + //seperator:
23152 + enumXFAlignType m_eSepAlign;
23153 + double m_fSepWidth;
23154 + XFColor m_aSepColor;
23155 + double m_fSepSpaceAbove;
23156 + double m_fSepSpaceBelow;
23157 + sal_Int32 m_nSepLengthPercent;
23161 +inline void XFPageMaster::SetPageUsage(enumXFPageUsage usage)
23163 + this->m_eUsage = usage;
23166 +inline void XFPageMaster::SetPrintOrient(sal_Bool bUseWidth)
23168 + m_bPrintOrient = bUseWidth;
23171 +inline void XFPageMaster::SetTextDir(enumXFTextDir dir)
23173 + m_eTextDir = dir;
23176 +#endif
23178 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfpagenumber.hxx lotuswordpro/source/filter/xfilter/xfpagenumber.hxx
23179 --- lotuswordpro.bak/source/filter/xfilter/xfpagenumber.hxx 1970-01-01 08:00:00.000000000 +0800
23180 +++ lotuswordpro/source/filter/xfilter/xfpagenumber.hxx 2008-10-22 11:42:34.000000000 +0800
23181 @@ -0,0 +1,101 @@
23182 +/*************************************************************************
23184 + * The Contents of this file are made available subject to the terms of
23185 + * either of the following licenses
23187 + * - GNU Lesser General Public License Version 2.1
23188 + * - Sun Industry Standards Source License Version 1.1
23190 + * Sun Microsystems Inc., October, 2000
23192 + * GNU Lesser General Public License Version 2.1
23193 + * =============================================
23194 + * Copyright 2000 by Sun Microsystems, Inc.
23195 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
23197 + * This library is free software; you can redistribute it and/or
23198 + * modify it under the terms of the GNU Lesser General Public
23199 + * License version 2.1, as published by the Free Software Foundation.
23201 + * This library is distributed in the hope that it will be useful,
23202 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
23203 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23204 + * Lesser General Public License for more details.
23206 + * You should have received a copy of the GNU Lesser General Public
23207 + * License along with this library; if not, write to the Free Software
23208 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
23209 + * MA 02111-1307 USA
23212 + * Sun Industry Standards Source License Version 1.1
23213 + * =================================================
23214 + * The contents of this file are subject to the Sun Industry Standards
23215 + * Source License Version 1.1 (the "License"); You may not use this file
23216 + * except in compliance with the License. You may obtain a copy of the
23217 + * License at http://www.openoffice.org/license.html.
23219 + * Software provided under this License is provided on an "AS IS" basis,
23220 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
23221 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
23222 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
23223 + * See the License for the specific provisions governing your rights and
23224 + * obligations concerning the Software.
23226 + * The Initial Developer of the Original Code is: IBM Corporation
23228 + * Copyright: 2008 by IBM Corporation
23230 + * All Rights Reserved.
23232 + * Contributor(s): _______________________________________
23235 + ************************************************************************/
23236 +/*************************************************************************
23237 + * @file
23238 + * Page number field.
23239 + ************************************************************************/
23240 +/*************************************************************************
23241 + * Change History
23242 + * 2005-01-31 create this file.
23243 + ************************************************************************/
23244 +#ifndef _XFPAGENUMBER_HXX
23245 +#define _XFPAGENUMBER_HXX
23247 +#include "xfglobal.hxx"
23248 +#include "xfcontent.hxx"
23249 +#include "xfnumfmt.hxx"
23251 +/**
23252 + * @brief
23253 + * Page number field.
23254 + */
23255 +class XFPageNumber : public XFContent
23257 +public:
23258 + void SetNumFmt(rtl::OUString fmt);
23260 + virtual void ToXml(IXFStream *pStrm);
23262 +private:
23263 + XFNumFmt m_aNumFmt;
23266 +inline void XFPageNumber::SetNumFmt(rtl::OUString fmt)
23268 + m_aNumFmt.SetFormat(fmt);
23271 +inline void XFPageNumber::ToXml(IXFStream *pStrm)
23273 + IXFAttrList *pAttrList = pStrm->GetAttrList();
23274 + pAttrList->Clear();
23276 + m_aNumFmt.ToXml(pStrm);
23277 + pAttrList->AddAttribute( A2OUSTR("text:select-page"), A2OUSTR("current") );
23278 + pStrm->StartElement( A2OUSTR("text:page-number") );
23279 + pStrm->EndElement( A2OUSTR("text:page-number") );
23282 +#endif
23283 \ No newline at end of file
23284 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfparagraph.cxx lotuswordpro/source/filter/xfilter/xfparagraph.cxx
23285 --- lotuswordpro.bak/source/filter/xfilter/xfparagraph.cxx 1970-01-01 08:00:00.000000000 +0800
23286 +++ lotuswordpro/source/filter/xfilter/xfparagraph.cxx 2008-10-22 11:42:34.000000000 +0800
23287 @@ -0,0 +1,123 @@
23288 +/*************************************************************************
23290 + * The Contents of this file are made available subject to the terms of
23291 + * either of the following licenses
23293 + * - GNU Lesser General Public License Version 2.1
23294 + * - Sun Industry Standards Source License Version 1.1
23296 + * Sun Microsystems Inc., October, 2000
23298 + * GNU Lesser General Public License Version 2.1
23299 + * =============================================
23300 + * Copyright 2000 by Sun Microsystems, Inc.
23301 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
23303 + * This library is free software; you can redistribute it and/or
23304 + * modify it under the terms of the GNU Lesser General Public
23305 + * License version 2.1, as published by the Free Software Foundation.
23307 + * This library is distributed in the hope that it will be useful,
23308 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
23309 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23310 + * Lesser General Public License for more details.
23312 + * You should have received a copy of the GNU Lesser General Public
23313 + * License along with this library; if not, write to the Free Software
23314 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
23315 + * MA 02111-1307 USA
23318 + * Sun Industry Standards Source License Version 1.1
23319 + * =================================================
23320 + * The contents of this file are subject to the Sun Industry Standards
23321 + * Source License Version 1.1 (the "License"); You may not use this file
23322 + * except in compliance with the License. You may obtain a copy of the
23323 + * License at http://www.openoffice.org/license.html.
23325 + * Software provided under this License is provided on an "AS IS" basis,
23326 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
23327 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
23328 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
23329 + * See the License for the specific provisions governing your rights and
23330 + * obligations concerning the Software.
23332 + * The Initial Developer of the Original Code is: IBM Corporation
23334 + * Copyright: 2008 by IBM Corporation
23336 + * All Rights Reserved.
23338 + * Contributor(s): _______________________________________
23341 + ************************************************************************/
23342 +/*************************************************************************
23343 + * @file
23344 + * Paragraph object of OOo, it will output <text:p >...</text:p> element.
23345 + ************************************************************************/
23346 +/*************************************************************************
23347 + * Change History
23348 + * 2004-12-26 create this file.
23349 + ************************************************************************/
23350 +#include "xfparagraph.hxx"
23351 +#include "ixfstream.hxx"
23352 +#include "ixfattrlist.hxx"
23353 +#include "xftextcontent.hxx"
23355 +XFParagraph::XFParagraph()
23360 +XFParagraph::XFParagraph(rtl::OUString& text,rtl::OUString& style)
23362 + IXFContent *pText = new XFTextContent(text);
23363 + Add(pText);
23365 + SetStyleName(style);
23368 +XFParagraph::~XFParagraph()
23372 +enumXFContent XFParagraph::GetContentType()
23374 + return enumXFContentPara;
23377 +/**
23378 + * The paragraph obejct serial function,the ouput will be like:
23379 + * <text:p>
23380 + * <text:span text:style-name="T1">text content</text:span>
23381 + * text.
23382 + * <text:span text:style-name="T1">text content</text:span>
23383 + * </text:p>
23384 + */
23385 +void XFParagraph::ToXml(IXFStream *pStrm)
23387 + IXFAttrList *pAttrList = pStrm->GetAttrList();
23389 + assert(pAttrList);
23391 + pAttrList->Clear();
23392 + if( GetStyleName().getLength() > 0 )
23393 + pAttrList->AddAttribute( A2OUSTR("text:style-name"), GetStyleName() );
23394 + pStrm->StartElement( A2OUSTR("text:p") );
23396 + XFContentContainer::ToXml(pStrm);
23398 + pStrm->EndElement( A2OUSTR("text:p") );
23401 +void XFParagraph::ClearContents()
23403 + Reset();
23406 +sal_Bool XFParagraph::HasContents()
23408 + return GetCount()>0;
23411 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfparagraph.hxx lotuswordpro/source/filter/xfilter/xfparagraph.hxx
23412 --- lotuswordpro.bak/source/filter/xfilter/xfparagraph.hxx 1970-01-01 08:00:00.000000000 +0800
23413 +++ lotuswordpro/source/filter/xfilter/xfparagraph.hxx 2008-10-22 11:42:34.000000000 +0800
23414 @@ -0,0 +1,99 @@
23415 +/*************************************************************************
23417 + * The Contents of this file are made available subject to the terms of
23418 + * either of the following licenses
23420 + * - GNU Lesser General Public License Version 2.1
23421 + * - Sun Industry Standards Source License Version 1.1
23423 + * Sun Microsystems Inc., October, 2000
23425 + * GNU Lesser General Public License Version 2.1
23426 + * =============================================
23427 + * Copyright 2000 by Sun Microsystems, Inc.
23428 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
23430 + * This library is free software; you can redistribute it and/or
23431 + * modify it under the terms of the GNU Lesser General Public
23432 + * License version 2.1, as published by the Free Software Foundation.
23434 + * This library is distributed in the hope that it will be useful,
23435 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
23436 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23437 + * Lesser General Public License for more details.
23439 + * You should have received a copy of the GNU Lesser General Public
23440 + * License along with this library; if not, write to the Free Software
23441 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
23442 + * MA 02111-1307 USA
23445 + * Sun Industry Standards Source License Version 1.1
23446 + * =================================================
23447 + * The contents of this file are subject to the Sun Industry Standards
23448 + * Source License Version 1.1 (the "License"); You may not use this file
23449 + * except in compliance with the License. You may obtain a copy of the
23450 + * License at http://www.openoffice.org/license.html.
23452 + * Software provided under this License is provided on an "AS IS" basis,
23453 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
23454 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
23455 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
23456 + * See the License for the specific provisions governing your rights and
23457 + * obligations concerning the Software.
23459 + * The Initial Developer of the Original Code is: IBM Corporation
23461 + * Copyright: 2008 by IBM Corporation
23463 + * All Rights Reserved.
23465 + * Contributor(s): _______________________________________
23468 + ************************************************************************/
23469 +/*************************************************************************
23470 + * @file
23471 + * Paragraph object of OOo, it will output <text:p >...</text:p> element.
23472 + ************************************************************************/
23473 +/*************************************************************************
23474 + * Change History
23475 + * 2004-12-26 create this file.
23476 + ************************************************************************/
23477 +#ifndef _XFPARAGRAPH_HXX
23478 +#define _XFPARAGRAPH_HXX
23480 +#include "xfglobal.hxx"
23481 +#include "xfcontentcontainer.hxx"
23482 +#include <vector>
23484 +class IXFStream;
23485 +class IXFTextSpan;
23487 +/**
23488 + * @brief
23489 + * Paragraph object for SODC.
23490 + * You can call Add() to add text span or drawing obejcts to XFParagraph.
23491 + */
23492 +class XFParagraph : public XFContentContainer
23494 +public:
23495 + XFParagraph();
23497 + XFParagraph(rtl::OUString& text, rtl::OUString& style);
23499 + virtual ~XFParagraph();
23501 +public:
23502 + void ClearContents();
23504 + sal_Bool HasContents();
23506 + virtual enumXFContent GetContentType();
23508 + virtual void ToXml(IXFStream *pStrm);
23512 +#endif
23514 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfparastyle.cxx lotuswordpro/source/filter/xfilter/xfparastyle.cxx
23515 --- lotuswordpro.bak/source/filter/xfilter/xfparastyle.cxx 1970-01-01 08:00:00.000000000 +0800
23516 +++ lotuswordpro/source/filter/xfilter/xfparastyle.cxx 2008-10-22 11:42:34.000000000 +0800
23517 @@ -0,0 +1,527 @@
23518 +/*************************************************************************
23520 + * The Contents of this file are made available subject to the terms of
23521 + * either of the following licenses
23523 + * - GNU Lesser General Public License Version 2.1
23524 + * - Sun Industry Standards Source License Version 1.1
23526 + * Sun Microsystems Inc., October, 2000
23528 + * GNU Lesser General Public License Version 2.1
23529 + * =============================================
23530 + * Copyright 2000 by Sun Microsystems, Inc.
23531 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
23533 + * This library is free software; you can redistribute it and/or
23534 + * modify it under the terms of the GNU Lesser General Public
23535 + * License version 2.1, as published by the Free Software Foundation.
23537 + * This library is distributed in the hope that it will be useful,
23538 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
23539 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23540 + * Lesser General Public License for more details.
23542 + * You should have received a copy of the GNU Lesser General Public
23543 + * License along with this library; if not, write to the Free Software
23544 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
23545 + * MA 02111-1307 USA
23548 + * Sun Industry Standards Source License Version 1.1
23549 + * =================================================
23550 + * The contents of this file are subject to the Sun Industry Standards
23551 + * Source License Version 1.1 (the "License"); You may not use this file
23552 + * except in compliance with the License. You may obtain a copy of the
23553 + * License at http://www.openoffice.org/license.html.
23555 + * Software provided under this License is provided on an "AS IS" basis,
23556 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
23557 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
23558 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
23559 + * See the License for the specific provisions governing your rights and
23560 + * obligations concerning the Software.
23562 + * The Initial Developer of the Original Code is: IBM Corporation
23564 + * Copyright: 2008 by IBM Corporation
23566 + * All Rights Reserved.
23568 + * Contributor(s): _______________________________________
23571 + ************************************************************************/
23572 +/*************************************************************************
23573 + * @file
23574 + * Styles for paragraph.
23575 + * Styles for paragraph may include many style,include font,indent,margin,
23576 + * shadow,line height,and so on.
23577 + ************************************************************************/
23578 +/*************************************************************************
23579 + * Change History
23580 + * 2005-01-10 create this file.
23581 + * 2005-01-20 move some structure out of this file.
23582 + ************************************************************************/
23583 +#include "xfparastyle.hxx"
23584 +#include "xffont.hxx"
23585 +#include "xfborders.hxx"
23586 +#include "xftabstyle.hxx"
23587 +#include "xfbgimage.hxx"
23589 +XFParaStyle::XFParaStyle()
23591 + //init member variables:
23592 + m_nFlag = 0;
23593 + m_eAlignType = enumXFAlignNone;
23594 + m_eLastLineAlign = enumXFAlignNone;
23595 + m_bJustSingleWord = sal_False;
23596 + m_bKeepWithNext = sal_False;
23597 + m_nPageNumber = 0;
23598 + m_fTextIndent = 0;
23600 + m_pFont = NULL;
23601 + m_pBorders = NULL;
23602 + m_pBGImage = NULL;
23604 + m_nLineNumberRestart = 0;
23605 + m_bNumberLines = sal_True;
23606 + m_bNumberRight = sal_False;
23609 +XFParaStyle::XFParaStyle(XFParaStyle& other)
23611 + m_strParentStyleName = other.m_strParentStyleName;
23612 + m_nFlag = other.m_nFlag;
23613 + m_eAlignType = other.m_eAlignType;
23614 + m_fTextIndent = other.m_fTextIndent;
23615 + m_bNumberLines = other.m_bNumberLines;
23616 + m_nLineNumberRestart = other.m_nLineNumberRestart;
23617 + m_bNumberRight = other.m_bNumberRight;
23619 + if( other.m_pFont )
23620 + m_pFont = other.m_pFont;
23621 + else
23622 + m_pFont = NULL;
23624 + if( other.m_pBorders )
23625 + m_pBorders = new XFBorders(*other.m_pBorders);
23626 + else
23627 + m_pBorders = NULL;
23628 + m_aBackColor = other.m_aBackColor;
23629 + if( other.m_pBGImage )
23630 + m_pBGImage = new XFBGImage(*other.m_pBGImage);
23631 + else
23632 + m_pBGImage = NULL;
23634 + m_aShadow = other.m_aShadow;
23635 + m_aMargin = other.m_aMargin;
23636 + m_aDropcap = other.m_aDropcap;
23637 + m_aLineHeight = other.m_aLineHeight;
23638 + m_aPadding = other.m_aPadding;
23639 + m_aBreaks = other.m_aBreaks;
23640 +// m_aTabs = other.m_aTabs;
23641 + for( int i=0; i<other.m_aTabs.GetCount(); i++ )
23643 + IXFStyle *pStyle = other.m_aTabs.Item(i);
23644 + if( pStyle )
23646 + XFTabStyle *pTabStyle = (XFTabStyle*)(pStyle);
23647 + if( pTabStyle )
23649 + XFTabStyle *pCopyStyle = new XFTabStyle(*pTabStyle);
23650 + m_aTabs.AddStyle(pCopyStyle);
23656 +XFParaStyle& XFParaStyle::operator=(XFParaStyle& other)
23658 + m_strParentStyleName = other.m_strParentStyleName;
23659 + m_nFlag = other.m_nFlag;
23660 + m_eAlignType = other.m_eAlignType;
23661 + m_fTextIndent = other.m_fTextIndent;
23662 + m_bNumberLines = other.m_bNumberLines;
23663 + m_nLineNumberRestart = other.m_nLineNumberRestart;
23664 + m_bNumberRight = other.m_bNumberRight;
23666 + if( other.m_pFont )
23667 + m_pFont = other.m_pFont;
23668 + else
23669 + m_pFont = NULL;
23671 + if( other.m_pBorders )
23672 + m_pBorders = new XFBorders(*other.m_pBorders);
23673 + else
23674 + m_pBorders = NULL;
23675 + m_aBackColor = other.m_aBackColor;
23676 + if( other.m_pBGImage )
23677 + m_pBGImage = new XFBGImage(*other.m_pBGImage);
23678 + else
23679 + m_pBGImage = NULL;
23681 + m_aShadow = other.m_aShadow;
23682 + m_aMargin = other.m_aMargin;
23683 + m_aDropcap = other.m_aDropcap;
23684 + m_aLineHeight = other.m_aLineHeight;
23685 + m_aPadding = other.m_aPadding;
23686 + m_aBreaks = other.m_aBreaks;
23687 + // m_aTabs = other.m_aTabs;
23688 + for( int i=0; i<other.m_aTabs.GetCount(); i++ )
23690 + IXFStyle *pStyle = other.m_aTabs.Item(i);
23691 + if( pStyle )
23693 + XFTabStyle *pTabStyle = (XFTabStyle*)(pStyle);
23694 + if( pTabStyle )
23696 + XFTabStyle *pCopyStyle = new XFTabStyle(*pTabStyle);
23697 + m_aTabs.AddStyle(pCopyStyle);
23702 + return *this;
23705 +XFParaStyle::~XFParaStyle()
23707 + if( m_pBorders )
23708 + delete m_pBorders;
23709 + if( m_pBGImage )
23710 + delete m_pBGImage;
23713 +enumXFStyle XFParaStyle::GetStyleFamily()
23715 + return enumXFStylePara;
23718 +void XFParaStyle::SetFont(XFFont *pFont)
23720 + m_pFont = pFont;
23723 +void XFParaStyle::SetIndent(double indent )
23725 + m_fTextIndent = indent;
23728 +void XFParaStyle::SetMargins(double left, double right, double top, double bottom)
23730 + if( left != -1 )
23731 + m_aMargin.SetLeft(left);
23732 + if( right != -1 )
23733 + m_aMargin.SetRight(right);
23734 + if( top != -1 )
23735 + m_aMargin.SetTop(top);
23736 + if( bottom != -1 )
23737 + m_aMargin.SetBottom( bottom );
23740 +void XFParaStyle::SetShadow(enumXFShadowPos pos, double offset, XFColor& color)
23742 + m_aShadow.SetPosition(pos);
23743 + m_aShadow.SetOffset(offset);
23744 + m_aShadow.SetColor(color);
23747 +void XFParaStyle::SetBackColor(XFColor& color)
23749 + m_aBackColor = color;
23750 + m_nFlag |= XFPARA_FLAG_BACKCOLOR;
23753 +void XFParaStyle::SetBackImage(XFBGImage *image)
23755 + if( m_pBGImage )
23756 + delete m_pBGImage;
23757 + m_pBGImage = image;
23760 +void XFParaStyle::SetBorders(XFBorders *pBorders)
23762 + if( m_pBorders )
23763 + delete m_pBorders;
23764 + m_pBorders = pBorders;
23767 +void XFParaStyle::SetDropCap(sal_Int16 nLength,
23768 + sal_Int16 nLines,
23769 + double fDistance
23772 + assert(nLength>=1);
23773 + assert(nLines>=2);
23774 + assert(fDistance>=0);
23776 + m_aDropcap.SetCharCount(nLength);
23777 + m_aDropcap.SetLines(nLines);
23778 + m_aDropcap.SetDistance(fDistance);
23781 +void XFParaStyle::SetLineHeight(enumLHType type, double value)
23783 + if( type == enumLHNone )
23784 + {
23785 + return;
23787 + switch(type)
23789 + case enumLHHeight:
23790 + m_aLineHeight.SetHeight(value) ;
23791 + break;
23792 + case enumLHLeast:
23793 + m_aLineHeight.SetLeastHeight(value);
23794 + break;
23795 + case enumLHPercent: //perhaps i should redesign the interface here,ohm..
23796 + m_aLineHeight.SetPercent((sal_Int32)value);
23797 + break;
23798 + case enumLHSpace:
23799 + m_aLineHeight.SetSpace(value*0.5666); //don't known why,just suspect.
23800 + break;
23804 +void XFParaStyle::AddTabStyle(enumXFTab type, double len, sal_Unicode leader, sal_Unicode delimiter)
23806 + XFTabStyle *tab = new XFTabStyle();
23807 + tab->SetTabType(type);
23808 + tab->SetLength(len);
23809 + tab->SetLeaderChar(leader);
23810 + tab->SetDelimiter(delimiter);
23811 + m_aTabs.AddStyle(tab);
23814 +/**
23815 + *Affirm whether two XFParaStyle objects are equal.
23816 + */
23817 +sal_Bool XFParaStyle::Equal(IXFStyle *pStyle)
23819 + if( this == pStyle )
23820 + return sal_True;
23821 + if( !pStyle || pStyle->GetStyleFamily() != enumXFStylePara )
23822 + return sal_False;
23824 + XFParaStyle *pOther = (XFParaStyle*)(pStyle);
23825 + if( !pOther )
23826 + return sal_False;
23828 + if( m_nFlag != pOther->m_nFlag )
23829 + return sal_False;
23830 + if( m_strParentStyleName != pOther->m_strParentStyleName )
23831 + return sal_False;
23832 + if( m_strMasterPage != pOther->m_strMasterPage )
23833 + return sal_False;
23834 + if( m_fTextIndent != pOther->m_fTextIndent )
23835 + return sal_False;
23836 + if( m_bJustSingleWord != pOther->m_bJustSingleWord )
23837 + return sal_False;
23838 + if( m_bKeepWithNext != pOther->m_bKeepWithNext )
23839 + return sal_False;
23840 + //line number:
23841 + if( m_bNumberLines != pOther->m_bNumberLines )
23842 + return sal_False;
23843 + if( m_nLineNumberRestart != pOther->m_nLineNumberRestart )
23844 + return sal_False;
23845 + //align:
23846 + if( m_eAlignType != pOther->m_eAlignType )
23847 + return sal_False;
23848 + //last line align:
23849 + if( m_eLastLineAlign != pOther->m_eLastLineAlign )
23850 + return sal_False;
23852 + //shadow:
23853 + if( m_aShadow != pOther->m_aShadow )
23854 + return sal_False;
23855 + //margin:
23856 + if( m_aMargin != pOther->m_aMargin )
23857 + return sal_False;
23859 + if( m_aPadding != pOther->m_aPadding )
23860 + return sal_False;
23862 + //dropcap:
23863 + if( m_aDropcap != pOther->m_aDropcap )
23864 + return sal_False;
23865 + //line height:
23866 + if( m_aLineHeight != pOther->m_aLineHeight )
23867 + return sal_False;
23868 + //breaks:
23869 + if( m_aBreaks != pOther->m_aBreaks )
23870 + return sal_False;
23871 + if( m_nPageNumber != pOther->m_nPageNumber )
23872 + return sal_False;
23873 + if( m_aTabs != pOther->m_aTabs )
23874 + return sal_False;
23876 + //font:
23877 + if( m_pFont )
23879 + if( !pOther->m_pFont )
23880 + return sal_False;
23881 + if(*m_pFont != *pOther->m_pFont )
23882 + return sal_False;
23884 + else if( pOther->m_pFont )
23885 + return sal_False;
23887 + //border:
23888 + if( m_pBorders )
23890 + if( !pOther->m_pBorders )
23891 + return sal_False;
23892 + if( *m_pBorders != *pOther->m_pBorders )
23893 + return sal_False;
23895 + else if( pOther->m_pBorders )
23896 + return sal_False;
23898 + if( m_pBGImage )
23900 + if( !pOther->m_pBGImage )
23901 + return sal_False;
23902 + if( *m_pBGImage != *pOther->m_pBGImage )
23903 + return sal_False;
23905 + else if( pOther->m_pBGImage )
23906 + return sal_False;//add end
23908 + //number right
23909 + if ( m_bNumberRight != pOther->m_bNumberRight)
23910 + return sal_False;
23912 + return sal_True;
23915 +void XFParaStyle::ToXml(IXFStream *pStrm)
23917 + IXFAttrList *pAttrList = pStrm->GetAttrList();
23918 + rtl::OUString style = GetStyleName();
23920 + pAttrList->Clear();
23921 + if( style.getLength() )
23922 + pAttrList->AddAttribute(A2OUSTR("style:name"),GetStyleName());
23923 + pAttrList->AddAttribute(A2OUSTR("style:family"), A2OUSTR("paragraph"));
23924 + if( GetParentStyleName().getLength() > 0 )
23925 + pAttrList->AddAttribute(A2OUSTR("style:parent-style-name"),GetParentStyleName());
23927 + if( m_strMasterPage.getLength() > 0 )
23928 + pAttrList->AddAttribute(A2OUSTR("style:master-page-name"),m_strMasterPage);
23929 + pStrm->StartElement(A2OUSTR("style:style"));
23931 + //Paragraph properties:
23932 + pAttrList->Clear();
23934 + //text indent:
23935 + if( m_fTextIndent )
23937 + pAttrList->AddAttribute(A2OUSTR("fo:text-indent"), DoubleToOUString(m_fTextIndent) + A2OUSTR("cm") );
23939 + //padding:
23940 + m_aPadding.ToXml(pStrm);
23941 + //margin:
23942 + m_aMargin.ToXml(pStrm);
23944 + //text align:
23945 + if( m_eAlignType != enumXFAlignNone )
23947 + pAttrList->AddAttribute(A2OUSTR("fo:text-align"), GetAlignName(m_eAlignType) );
23949 + //last line align:
23950 + if( m_eLastLineAlign != enumXFAlignNone )
23952 + pAttrList->AddAttribute(A2OUSTR("fo:fo:text-align-last"), GetAlignName(m_eLastLineAlign) );
23953 + if( m_bJustSingleWord )
23954 + pAttrList->AddAttribute(A2OUSTR("style:justify-single-word"), A2OUSTR("true") );
23956 + //line number:
23957 + if( m_bNumberLines )
23959 + pAttrList->AddAttribute( A2OUSTR("text:number-lines"), A2OUSTR("true") );
23960 + pAttrList->AddAttribute( A2OUSTR("text:line-number"), Int32ToOUString(m_nLineNumberRestart) );
23962 + else
23964 + pAttrList->AddAttribute( A2OUSTR("text:number-lines"), A2OUSTR("false") );
23965 + assert(m_nLineNumberRestart>0);
23966 + pAttrList->AddAttribute( A2OUSTR("text:line-number"), A2OUSTR("0") );
23969 + //shadow:
23970 + m_aShadow.ToXml(pStrm);
23971 + //borders:
23972 + if( m_pBorders )
23973 + m_pBorders->ToXml(pStrm);
23974 + //line height:
23975 + m_aLineHeight.ToXml(pStrm);
23977 + //background color:
23978 + if( m_nFlag&XFPARA_FLAG_BACKCOLOR && m_aBackColor.IsValid() )
23980 + pAttrList->AddAttribute(A2OUSTR("fo:background-color"), m_aBackColor.ToString() );
23982 + //Font properties:
23983 + if( m_pFont )
23984 + m_pFont->ToXml(pStrm);
23986 + //page number:
23987 + if( m_nPageNumber )
23988 + pAttrList->AddAttribute(A2OUSTR("fo:page-number"), Int32ToOUString(m_nPageNumber) );
23989 + //page breaks:
23990 + m_aBreaks.ToXml(pStrm);
23992 + if( m_bKeepWithNext )
23993 + pAttrList->AddAttribute(A2OUSTR("fo:fo:keep-with-next"), A2OUSTR("true") );
23995 + pStrm->StartElement(A2OUSTR("style:properties"));
23997 + //dropcap:
23998 + m_aDropcap.ToXml(pStrm);
24000 + //tabs:
24001 + if( m_aTabs.GetCount() > 0 )
24003 + pAttrList->Clear();
24004 + pStrm->StartElement( A2OUSTR("style:tab-stops") );
24005 + m_aTabs.ToXml(pStrm);
24006 + pStrm->EndElement( A2OUSTR("style:tab-stops") );
24009 + //background color:
24010 + if( m_pBGImage )
24011 + m_pBGImage->ToXml(pStrm);
24013 + pStrm->EndElement(A2OUSTR("style:properties"));
24015 + pStrm->EndElement(A2OUSTR("style:style"));
24018 +XFDefaultParaStyle::XFDefaultParaStyle()
24020 + m_fTabDistance = 1.28;
24023 +enumXFStyle XFDefaultParaStyle::GetStyleFamily()
24025 + return enumXFStyleDefaultPara;
24029 +void XFDefaultParaStyle::ToXml(IXFStream * pStrm)
24031 + IXFAttrList *pAttrList = pStrm->GetAttrList();
24032 + pAttrList->Clear();
24033 + pAttrList->AddAttribute(A2OUSTR("style:family"), A2OUSTR("paragraph"));
24034 + pStrm->StartElement(A2OUSTR("style:default-style"));
24036 + //Paragraph properties:
24037 + pAttrList->Clear();
24039 + pAttrList->AddAttribute(A2OUSTR("style:tab-stop-distance"), DoubleToOUString(m_fTabDistance) + A2OUSTR("cm") );
24041 + pStrm->StartElement(A2OUSTR("style:properties"));
24042 + pStrm->EndElement(A2OUSTR("style:properties"));
24043 + pStrm->EndElement(A2OUSTR("style:default-style"));
24045 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfparastyle.hxx lotuswordpro/source/filter/xfilter/xfparastyle.hxx
24046 --- lotuswordpro.bak/source/filter/xfilter/xfparastyle.hxx 1970-01-01 08:00:00.000000000 +0800
24047 +++ lotuswordpro/source/filter/xfilter/xfparastyle.hxx 2008-10-22 11:42:34.000000000 +0800
24048 @@ -0,0 +1,364 @@
24049 +/*************************************************************************
24051 + * The Contents of this file are made available subject to the terms of
24052 + * either of the following licenses
24054 + * - GNU Lesser General Public License Version 2.1
24055 + * - Sun Industry Standards Source License Version 1.1
24057 + * Sun Microsystems Inc., October, 2000
24059 + * GNU Lesser General Public License Version 2.1
24060 + * =============================================
24061 + * Copyright 2000 by Sun Microsystems, Inc.
24062 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
24064 + * This library is free software; you can redistribute it and/or
24065 + * modify it under the terms of the GNU Lesser General Public
24066 + * License version 2.1, as published by the Free Software Foundation.
24068 + * This library is distributed in the hope that it will be useful,
24069 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
24070 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24071 + * Lesser General Public License for more details.
24073 + * You should have received a copy of the GNU Lesser General Public
24074 + * License along with this library; if not, write to the Free Software
24075 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
24076 + * MA 02111-1307 USA
24079 + * Sun Industry Standards Source License Version 1.1
24080 + * =================================================
24081 + * The contents of this file are subject to the Sun Industry Standards
24082 + * Source License Version 1.1 (the "License"); You may not use this file
24083 + * except in compliance with the License. You may obtain a copy of the
24084 + * License at http://www.openoffice.org/license.html.
24086 + * Software provided under this License is provided on an "AS IS" basis,
24087 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
24088 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
24089 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
24090 + * See the License for the specific provisions governing your rights and
24091 + * obligations concerning the Software.
24093 + * The Initial Developer of the Original Code is: IBM Corporation
24095 + * Copyright: 2008 by IBM Corporation
24097 + * All Rights Reserved.
24099 + * Contributor(s): _______________________________________
24102 + ************************************************************************/
24103 +/*************************************************************************
24104 + * @file
24105 + * Styles for paragraph.
24106 + * Styles for paragraph may include many style,include font,indent,margin,
24107 + * shadow,line height,and so on.
24108 + ************************************************************************/
24109 +/*************************************************************************
24110 + * Change History
24111 + * 2005-01-10 create this file.
24112 + * 2005-01-20 move some structure out of this file.
24113 + ************************************************************************/
24114 +#ifndef _XFPARASTYLE_HXX
24115 +#define _XFPARASTYLE_HXX
24117 +#include "xfglobal.hxx"
24118 +#include "xfstyle.hxx"
24119 +#include "xfcolor.hxx"
24120 +#include "xfmargins.hxx"
24121 +#include "xfbreaks.hxx"
24122 +#include "xfpadding.hxx"
24123 +#include "xfshadow.hxx"
24124 +#include "xfdropcap.hxx"
24125 +#include "xfstylecont.hxx"
24126 +#include "xflineheight.hxx"
24128 +#define XFPARA_FLAG_FONT 0X00000001
24129 +#define XFPARA_FLAG_DROPCAP 0X00000002
24130 +#define XFPARA_FLAG_BACKCOLOR 0X00000004
24132 +class XFFont;
24133 +class XFBorders;
24134 +class XFBGImage;
24136 +/**
24137 + * @brief
24138 + * Style object for aragraph.
24139 + */
24140 +class XFParaStyle : public XFStyle
24142 +public:
24143 + XFParaStyle();
24145 + XFParaStyle(XFParaStyle& other);
24147 + XFParaStyle& operator=(XFParaStyle& other);
24149 + virtual ~XFParaStyle();
24151 +public:
24152 + /**
24153 + * @descr Set layout for the paragraph.When such property was setted, this paragraph will
24154 + * start at an new page.
24155 + */
24156 + void SetMasterPage(rtl::OUString master);
24158 + rtl::OUString GetMasterPage();
24160 + /**
24161 + * @descr set the paragraph defaut font.
24162 + * @param font font obejct to be setted.Font object are deleted by font-factory,so
24163 + * dont't delete it in the destructure function of para style.
24164 + */
24165 + void SetFont(XFFont *font);
24167 + /**
24168 + * @descr get the font object.
24169 + */
24170 + XFFont* GetFont(){ return m_pFont; }
24172 + /**
24173 + * @descr Set the indent of the paragraph.This is the indent for
24174 + the first line.
24175 + * @param indent value of the first-line indent.
24176 + */
24177 + void SetIndent(double indent );
24179 + /**
24180 + * @descr Set line number style.
24181 + */
24182 + void SetLineNumber(sal_Bool show, sal_Int32 restart=1);
24183 + /**
24184 + * @descr Set the pading of the paragraph.This is the distance
24185 + between the border and the top of the text.
24186 + * @param indent value of the padding.
24187 + */
24188 + void SetPadding(double left, double right = -1, double top = -1, double bottom = -1);
24190 + /**
24191 + * @descr Set the Margins of the paragraph.
24192 + * @param -1: don't change.
24193 + other: set value.
24194 + */
24195 + void SetMargins(double left, double right=-1,double top=-1, double bottom=-1);
24197 + /**
24198 + * @descr Set alignment property of the paragraph.
24199 + * @param eAlign alignment type,left,right,center or justify.
24200 + */
24201 + void SetAlignType(enumXFAlignType eAlign);
24203 + enumXFAlignType GetAlighType();
24206 + /**
24207 + * @descr Set last line alignment property of the paragraph.
24208 + * @param eAlign alignment type,left,right,center or justify.
24209 + eJustSingleWord If chars of the last-line'word should be
24210 + stretched.
24211 + */
24212 + void SetLastLineAlign(enumXFAlignType align,sal_Bool bJustSingleWord = sal_False);
24214 + /**
24215 + * @descr Set the shadow of the paragraph.there is 4 postions, you
24216 + can find it in the definition of enumShadowPos.
24217 + * @param pos
24218 + * @param offset the distance between the paragraph border and the shadow.
24219 + * @param color color to fill the shadow.
24220 + */
24221 + void SetShadow(enumXFShadowPos pos, double offset, XFColor& color);
24223 + /**
24224 + * @descr The borders is complex,so you have to create one before use.
24225 + Very few paragraphs will readly have borders property,this way
24226 + we can save much memory.
24227 + * @param pBorders borders of the paragraph,please reference the XFBorders.
24228 + */
24229 + void SetBorders(XFBorders *pBorders);
24231 + /**
24232 + * @descr Set drop caption of the paragraph.
24233 + * @param nLength number of chars to be droped.
24234 + * @param nLines line of which the droped chars will occupy.
24235 + */
24236 + void SetDropCap(sal_Int16 nLength = 1,sal_Int16 nLines = 3,double fDistance = 0);
24238 + /**
24239 + * @descr Set line height of the paragraph.
24240 + * @param type type of line height,fixed,space,percent or cm.
24241 + * @param value value of the line height
24242 + */
24243 + void SetLineHeight(enumLHType type, double value);
24245 + /**
24246 + * @descr Set background color of the paragraph.
24247 + * @param color value of the back color.
24248 + */
24249 + void SetBackColor(XFColor& color);
24251 + /**
24252 + * @descr Set background image of the paragraph.
24253 + * @param image the background image to set.
24254 + */
24255 + void SetBackImage(XFBGImage *image);
24257 + /**
24258 + * descr You can only set one break property for every para style object.
24259 + */
24260 + void SetBreaks(enumXFBreaks breaks);
24262 + /**
24263 + * @descr For paragraph numbering.
24264 + */
24265 + void SetPageNumber(sal_Int32 num);
24267 + /**
24268 + * @descr Add a tab style.
24269 + */
24270 + void AddTabStyle(enumXFTab type, double len, sal_Unicode leader = '*', sal_Unicode delimiter='.');
24272 + /**
24273 + * @descr for para style copy operator,sometimes you may need to override tab styles.
24274 + */
24275 + void ClearTabStyles();
24277 + /**
24278 + * descr set the paragraph to be in the same page with the next paragraph.
24279 + * If that can't be insured,the paragraph will start with a new page.
24280 + */
24281 + void SetKeepWithNext(sal_Bool keepWithNext);
24283 + sal_uInt32 GetFlag(){ return m_nFlag; }
24285 + /**
24286 + * @descr return margins.
24287 + */
24288 + XFMargins GetMargins(){return m_aMargin;}
24290 + virtual enumXFStyle GetStyleFamily();
24292 + virtual sal_Bool Equal(IXFStyle *pStyle);
24294 + virtual void ToXml(IXFStream *strm);
24296 + void SetNumberRight(sal_Bool bFlag){m_bNumberRight = bFlag;}
24297 + sal_Bool GetNumberRight(){return m_bNumberRight;}
24299 +protected:
24300 + rtl::OUString m_strMasterPage;
24301 + enumXFAlignType m_eAlignType;
24302 + enumXFAlignType m_eLastLineAlign;
24303 + sal_Bool m_bJustSingleWord;
24304 + sal_Bool m_bKeepWithNext;
24306 + double m_fTextIndent;
24307 + XFColor m_aBackColor;
24308 + XFMargins m_aMargin;
24309 + XFPadding m_aPadding;
24310 + XFStyleContainer m_aTabs;
24311 + XFFont *m_pFont;
24312 + XFShadow m_aShadow;
24313 + XFBorders *m_pBorders;
24314 + XFBGImage *m_pBGImage;
24315 + XFDropcap m_aDropcap;
24316 + XFLineHeight m_aLineHeight;
24317 + XFBreaks m_aBreaks;
24318 + sal_Int32 m_nPageNumber;
24319 + sal_Bool m_bNumberLines;
24320 + sal_Int32 m_nLineNumberRestart;
24322 + sal_uInt32 m_nFlag;
24323 + sal_Bool m_bNumberRight;
24326 +inline void XFParaStyle::SetMasterPage(rtl::OUString master)
24328 + m_strMasterPage = master;
24331 +inline void XFParaStyle::SetBreaks(enumXFBreaks breaks)
24333 + m_aBreaks.SetBreakType(breaks);
24336 +inline void XFParaStyle::SetPageNumber(sal_Int32 num)
24338 + assert(num>0);
24339 + m_nPageNumber = num;
24342 +inline void XFParaStyle::SetLineNumber(sal_Bool show, sal_Int32 restart)
24344 + m_bNumberLines = show;
24345 + m_nLineNumberRestart = restart;
24348 +inline void XFParaStyle::SetPadding(double left, double right, double top, double bottom)
24350 + m_aPadding.SetLeft(left);
24351 + if( right == -1 )
24352 + m_aPadding.SetRight(left);
24353 + else
24354 + m_aPadding.SetRight(right);
24355 + if( top == -1 )
24356 + m_aPadding.SetTop(left);
24357 + else
24358 + m_aPadding.SetTop(top);
24359 + if( bottom == -1 )
24360 + m_aPadding.SetBottom(left);
24361 + else
24362 + m_aPadding.SetBottom(bottom);
24365 +inline void XFParaStyle::SetAlignType(enumXFAlignType eAlign)
24367 + m_eAlignType = eAlign;
24370 +inline void XFParaStyle::SetLastLineAlign(enumXFAlignType align, sal_Bool bJustSingleWord)
24372 + m_eLastLineAlign = align;
24373 + m_bJustSingleWord = bJustSingleWord;
24376 +inline void XFParaStyle::SetKeepWithNext(sal_Bool keep)
24378 + m_bKeepWithNext = keep;
24381 +inline void XFParaStyle::ClearTabStyles()
24383 + m_aTabs.Reset();
24386 +inline rtl::OUString XFParaStyle::GetMasterPage()
24388 + return m_strMasterPage;
24391 +inline enumXFAlignType XFParaStyle::GetAlighType()
24393 + return m_eAlignType;
24396 +class XFDefaultParaStyle : public XFStyle
24398 +public:
24399 + XFDefaultParaStyle();
24400 + void SetTabDistance(double len);
24401 + enumXFStyle GetStyleFamily();
24402 + virtual void ToXml(IXFStream *pStrm);
24403 +private:
24404 + double m_fTabDistance;
24407 +inline void XFDefaultParaStyle::SetTabDistance(double len)
24409 + m_fTabDistance = len;
24412 +#endif
24413 \ No newline at end of file
24414 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfplaceholder.hxx lotuswordpro/source/filter/xfilter/xfplaceholder.hxx
24415 --- lotuswordpro.bak/source/filter/xfilter/xfplaceholder.hxx 1970-01-01 08:00:00.000000000 +0800
24416 +++ lotuswordpro/source/filter/xfilter/xfplaceholder.hxx 2008-10-22 11:42:34.000000000 +0800
24417 @@ -0,0 +1,144 @@
24418 +/*************************************************************************
24420 + * The Contents of this file are made available subject to the terms of
24421 + * either of the following licenses
24423 + * - GNU Lesser General Public License Version 2.1
24424 + * - Sun Industry Standards Source License Version 1.1
24426 + * Sun Microsystems Inc., October, 2000
24428 + * GNU Lesser General Public License Version 2.1
24429 + * =============================================
24430 + * Copyright 2000 by Sun Microsystems, Inc.
24431 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
24433 + * This library is free software; you can redistribute it and/or
24434 + * modify it under the terms of the GNU Lesser General Public
24435 + * License version 2.1, as published by the Free Software Foundation.
24437 + * This library is distributed in the hope that it will be useful,
24438 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
24439 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24440 + * Lesser General Public License for more details.
24442 + * You should have received a copy of the GNU Lesser General Public
24443 + * License along with this library; if not, write to the Free Software
24444 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
24445 + * MA 02111-1307 USA
24448 + * Sun Industry Standards Source License Version 1.1
24449 + * =================================================
24450 + * The contents of this file are subject to the Sun Industry Standards
24451 + * Source License Version 1.1 (the "License"); You may not use this file
24452 + * except in compliance with the License. You may obtain a copy of the
24453 + * License at http://www.openoffice.org/license.html.
24455 + * Software provided under this License is provided on an "AS IS" basis,
24456 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
24457 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
24458 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
24459 + * See the License for the specific provisions governing your rights and
24460 + * obligations concerning the Software.
24462 + * The Initial Developer of the Original Code is: IBM Corporation
24464 + * Copyright: 2008 by IBM Corporation
24466 + * All Rights Reserved.
24468 + * Contributor(s): _______________________________________
24471 + ************************************************************************/
24472 +/*************************************************************************
24473 + * @file
24474 + * place holder object.
24475 + ************************************************************************/
24476 +/*************************************************************************
24477 + * Change History
24478 + * 2005-05-24 create this file.
24479 + ************************************************************************/
24481 +#ifndef _XFPLACEHOLDER_HXX
24482 +#define _XFPLACEHOLDER_HXX
24484 +#include "xfcontent.hxx"
24486 +/**
24487 + * @brief
24488 + * Index entry obejct.
24489 + */
24490 +class XFHolderStart : public XFContent
24492 +public:
24493 + XFHolderStart();
24494 + ~XFHolderStart();
24495 + void SetType(rtl::OUString sType);
24496 + void SetDesc(rtl::OUString sDesc);
24497 + void SetPrompt(rtl::OUString sText);
24498 + void ToXml(IXFStream *pStrm);
24499 +private:
24500 + rtl::OUString m_strType;
24501 + rtl::OUString m_strDesc;
24502 + rtl::OUString m_strText;
24505 +XFHolderStart::XFHolderStart()
24509 +XFHolderStart::~XFHolderStart()
24513 +inline void XFHolderStart::SetType(rtl::OUString sType)
24515 + m_strType = sType;
24518 +inline void XFHolderStart::SetDesc(rtl::OUString sDesc)
24520 + m_strDesc = sDesc;
24523 +inline void XFHolderStart::SetPrompt(rtl::OUString sText)
24525 + m_strText = sText;
24528 +inline void XFHolderStart::ToXml(IXFStream *pStrm)
24530 + IXFAttrList *pAttrList = pStrm->GetAttrList();
24531 + pAttrList->Clear();
24532 + pAttrList->AddAttribute( A2OUSTR("text:placeholder-type"),m_strType);
24533 + if (m_strDesc.getLength()>0)
24534 + pAttrList->AddAttribute( A2OUSTR("text:description"), m_strDesc);
24535 + pStrm->StartElement( A2OUSTR("text:placeholder") );
24536 + if( m_strText.getLength()>0)
24537 + pStrm->Characters(m_strText);
24540 +class XFHolderEnd : public XFContent
24542 +public:
24543 + XFHolderEnd();
24544 + ~XFHolderEnd();
24545 + void ToXml(IXFStream *pStrm);
24548 +XFHolderEnd::XFHolderEnd()
24552 +XFHolderEnd::~XFHolderEnd()
24556 +inline void XFHolderEnd::ToXml(IXFStream *pStrm)
24558 + pStrm->EndElement( A2OUSTR("text:placeholder") );
24561 +#endif
24562 \ No newline at end of file
24563 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfpoint.hxx lotuswordpro/source/filter/xfilter/xfpoint.hxx
24564 --- lotuswordpro.bak/source/filter/xfilter/xfpoint.hxx 1970-01-01 08:00:00.000000000 +0800
24565 +++ lotuswordpro/source/filter/xfilter/xfpoint.hxx 2008-10-22 11:42:34.000000000 +0800
24566 @@ -0,0 +1,106 @@
24567 +/*************************************************************************
24569 + * The Contents of this file are made available subject to the terms of
24570 + * either of the following licenses
24572 + * - GNU Lesser General Public License Version 2.1
24573 + * - Sun Industry Standards Source License Version 1.1
24575 + * Sun Microsystems Inc., October, 2000
24577 + * GNU Lesser General Public License Version 2.1
24578 + * =============================================
24579 + * Copyright 2000 by Sun Microsystems, Inc.
24580 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
24582 + * This library is free software; you can redistribute it and/or
24583 + * modify it under the terms of the GNU Lesser General Public
24584 + * License version 2.1, as published by the Free Software Foundation.
24586 + * This library is distributed in the hope that it will be useful,
24587 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
24588 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24589 + * Lesser General Public License for more details.
24591 + * You should have received a copy of the GNU Lesser General Public
24592 + * License along with this library; if not, write to the Free Software
24593 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
24594 + * MA 02111-1307 USA
24597 + * Sun Industry Standards Source License Version 1.1
24598 + * =================================================
24599 + * The contents of this file are subject to the Sun Industry Standards
24600 + * Source License Version 1.1 (the "License"); You may not use this file
24601 + * except in compliance with the License. You may obtain a copy of the
24602 + * License at http://www.openoffice.org/license.html.
24604 + * Software provided under this License is provided on an "AS IS" basis,
24605 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
24606 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
24607 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
24608 + * See the License for the specific provisions governing your rights and
24609 + * obligations concerning the Software.
24611 + * The Initial Developer of the Original Code is: IBM Corporation
24613 + * Copyright: 2008 by IBM Corporation
24615 + * All Rights Reserved.
24617 + * Contributor(s): _______________________________________
24620 + ************************************************************************/
24621 +/*************************************************************************
24622 + * @file
24623 + * Reperesent a point.
24624 + ************************************************************************/
24625 +/*************************************************************************
24626 + * Change History
24627 + * 2004-2-18 create this file.
24628 + ************************************************************************/
24629 +#ifndef _XFPOINT_HXX
24630 +#define _XFPOINT_HXX
24632 +class XFPoint
24634 +public:
24635 + XFPoint()
24637 + m_fX = m_fY = 0;
24640 + XFPoint(double x, double y)
24642 + m_fX = x;
24643 + m_fY = y;
24646 +public:
24647 + void SetX(double x)
24649 + m_fX = x;
24652 + void SetY(double y)
24654 + m_fY = y;
24657 + double GetX() const
24659 + return m_fX;
24662 + double GetY() const
24664 + return m_fY;
24667 +private:
24668 + double m_fX;
24669 + double m_fY;
24672 +#endif
24673 \ No newline at end of file
24674 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfpvector.hxx lotuswordpro/source/filter/xfilter/xfpvector.hxx
24675 --- lotuswordpro.bak/source/filter/xfilter/xfpvector.hxx 1970-01-01 08:00:00.000000000 +0800
24676 +++ lotuswordpro/source/filter/xfilter/xfpvector.hxx 2008-10-22 11:42:34.000000000 +0800
24677 @@ -0,0 +1,100 @@
24678 +/*************************************************************************
24680 + * The Contents of this file are made available subject to the terms of
24681 + * either of the following licenses
24683 + * - GNU Lesser General Public License Version 2.1
24684 + * - Sun Industry Standards Source License Version 1.1
24686 + * Sun Microsystems Inc., October, 2000
24688 + * GNU Lesser General Public License Version 2.1
24689 + * =============================================
24690 + * Copyright 2000 by Sun Microsystems, Inc.
24691 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
24693 + * This library is free software; you can redistribute it and/or
24694 + * modify it under the terms of the GNU Lesser General Public
24695 + * License version 2.1, as published by the Free Software Foundation.
24697 + * This library is distributed in the hope that it will be useful,
24698 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
24699 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24700 + * Lesser General Public License for more details.
24702 + * You should have received a copy of the GNU Lesser General Public
24703 + * License along with this library; if not, write to the Free Software
24704 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
24705 + * MA 02111-1307 USA
24708 + * Sun Industry Standards Source License Version 1.1
24709 + * =================================================
24710 + * The contents of this file are subject to the Sun Industry Standards
24711 + * Source License Version 1.1 (the "License"); You may not use this file
24712 + * except in compliance with the License. You may obtain a copy of the
24713 + * License at http://www.openoffice.org/license.html.
24715 + * Software provided under this License is provided on an "AS IS" basis,
24716 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
24717 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
24718 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
24719 + * See the License for the specific provisions governing your rights and
24720 + * obligations concerning the Software.
24722 + * The Initial Developer of the Original Code is: IBM Corporation
24724 + * Copyright: 2008 by IBM Corporation
24726 + * All Rights Reserved.
24728 + * Contributor(s): _______________________________________
24731 + ************************************************************************/
24732 +/*************************************************************************
24733 + * @file
24734 + * Pointer vector.
24735 + ************************************************************************/
24736 +/*************************************************************************
24737 + * Change History
24738 + * 2004-12-23 create this file.
24739 + ************************************************************************/
24740 +#ifndef _XFPVECTOR_HXX
24741 +#define _XFPVECTOR_HXX
24743 +#include <vector>
24745 +template<class T>
24746 +class XFPVector : public std::vector<T>
24748 +public:
24749 + ~XFPVector()
24751 + std::vector<T>::iterator it;
24752 + for( it=begin(); it != end(); it++ )
24754 + T pT = *it;
24755 + if( pT )
24757 + delete pT;
24762 + void Reset()
24764 + std::vector<T>::iterator it;
24765 + for( it=begin(); it != end(); it++ )
24767 + T *pT = *it;
24768 + if( pT )
24770 + delete pT;
24773 + clear();
24777 +#endif
24778 \ No newline at end of file
24779 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfrect.hxx lotuswordpro/source/filter/xfilter/xfrect.hxx
24780 --- lotuswordpro.bak/source/filter/xfilter/xfrect.hxx 1970-01-01 08:00:00.000000000 +0800
24781 +++ lotuswordpro/source/filter/xfilter/xfrect.hxx 2008-10-22 11:42:34.000000000 +0800
24782 @@ -0,0 +1,140 @@
24783 +/*************************************************************************
24785 + * The Contents of this file are made available subject to the terms of
24786 + * either of the following licenses
24788 + * - GNU Lesser General Public License Version 2.1
24789 + * - Sun Industry Standards Source License Version 1.1
24791 + * Sun Microsystems Inc., October, 2000
24793 + * GNU Lesser General Public License Version 2.1
24794 + * =============================================
24795 + * Copyright 2000 by Sun Microsystems, Inc.
24796 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
24798 + * This library is free software; you can redistribute it and/or
24799 + * modify it under the terms of the GNU Lesser General Public
24800 + * License version 2.1, as published by the Free Software Foundation.
24802 + * This library is distributed in the hope that it will be useful,
24803 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
24804 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24805 + * Lesser General Public License for more details.
24807 + * You should have received a copy of the GNU Lesser General Public
24808 + * License along with this library; if not, write to the Free Software
24809 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
24810 + * MA 02111-1307 USA
24813 + * Sun Industry Standards Source License Version 1.1
24814 + * =================================================
24815 + * The contents of this file are subject to the Sun Industry Standards
24816 + * Source License Version 1.1 (the "License"); You may not use this file
24817 + * except in compliance with the License. You may obtain a copy of the
24818 + * License at http://www.openoffice.org/license.html.
24820 + * Software provided under this License is provided on an "AS IS" basis,
24821 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
24822 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
24823 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
24824 + * See the License for the specific provisions governing your rights and
24825 + * obligations concerning the Software.
24827 + * The Initial Developer of the Original Code is: IBM Corporation
24829 + * Copyright: 2008 by IBM Corporation
24831 + * All Rights Reserved.
24833 + * Contributor(s): _______________________________________
24836 + ************************************************************************/
24837 +/*************************************************************************
24838 + * @file
24839 + * Rect object
24840 + ************************************************************************/
24841 +/*************************************************************************
24842 + * Change History
24843 + * 2004-2-18 create this file.
24844 + ************************************************************************/
24845 +#ifndef _XFRECT_HXX
24846 +#define _XFRECT_HXX
24848 +#include "xfpoint.hxx"
24850 +class XFRect
24852 +public:
24853 + XFRect()
24855 + m_fWidth = m_fHeight = 0;
24858 + XFRect(double x, double y, double width, double height):m_aPoint(x,y)
24860 + m_fWidth = width;
24861 + m_fHeight = height;
24864 +public:
24865 + void SetX(double x)
24867 + m_aPoint.SetX(x);
24870 + double GetX() const
24872 + return m_aPoint.GetX();
24875 + void SetY(double y)
24877 + m_aPoint.SetY(y);
24880 + double GetY() const
24882 + return m_aPoint.GetY();
24885 + void SetWidth(double width)
24887 + m_fWidth = width;
24890 + double GetWidth() const
24892 + return m_fWidth;
24895 + void SetHeight(double height)
24897 + m_fHeight = height;
24900 + double GetHeight() const
24902 + return m_fHeight;
24905 + void SetStartPoint(XFPoint pt)
24907 + m_aPoint = pt;
24910 + void SetSize(double width, double height)
24912 + m_fWidth = width;
24913 + m_fHeight = height;
24916 +public:
24917 + XFPoint m_aPoint;
24918 + double m_fWidth;
24919 + double m_fHeight;
24922 +#endif
24923 \ No newline at end of file
24924 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfrow.cxx lotuswordpro/source/filter/xfilter/xfrow.cxx
24925 --- lotuswordpro.bak/source/filter/xfilter/xfrow.cxx 1970-01-01 08:00:00.000000000 +0800
24926 +++ lotuswordpro/source/filter/xfilter/xfrow.cxx 2008-10-22 11:42:34.000000000 +0800
24927 @@ -0,0 +1,185 @@
24928 +/*************************************************************************
24930 + * The Contents of this file are made available subject to the terms of
24931 + * either of the following licenses
24933 + * - GNU Lesser General Public License Version 2.1
24934 + * - Sun Industry Standards Source License Version 1.1
24936 + * Sun Microsystems Inc., October, 2000
24938 + * GNU Lesser General Public License Version 2.1
24939 + * =============================================
24940 + * Copyright 2000 by Sun Microsystems, Inc.
24941 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
24943 + * This library is free software; you can redistribute it and/or
24944 + * modify it under the terms of the GNU Lesser General Public
24945 + * License version 2.1, as published by the Free Software Foundation.
24947 + * This library is distributed in the hope that it will be useful,
24948 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
24949 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24950 + * Lesser General Public License for more details.
24952 + * You should have received a copy of the GNU Lesser General Public
24953 + * License along with this library; if not, write to the Free Software
24954 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
24955 + * MA 02111-1307 USA
24958 + * Sun Industry Standards Source License Version 1.1
24959 + * =================================================
24960 + * The contents of this file are subject to the Sun Industry Standards
24961 + * Source License Version 1.1 (the "License"); You may not use this file
24962 + * except in compliance with the License. You may obtain a copy of the
24963 + * License at http://www.openoffice.org/license.html.
24965 + * Software provided under this License is provided on an "AS IS" basis,
24966 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
24967 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
24968 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
24969 + * See the License for the specific provisions governing your rights and
24970 + * obligations concerning the Software.
24972 + * The Initial Developer of the Original Code is: IBM Corporation
24974 + * Copyright: 2008 by IBM Corporation
24976 + * All Rights Reserved.
24978 + * Contributor(s): _______________________________________
24981 + ************************************************************************/
24982 +/*************************************************************************
24983 + * @file
24984 + * Table object.
24985 + ************************************************************************/
24986 +/*************************************************************************
24987 + * Change History
24988 + * 2005-01-24 create and implements.
24989 + ************************************************************************/
24990 +#include "xfrow.hxx"
24991 +#include "xfcell.hxx"
24992 +#include "xftable.hxx"
24994 +XFRow::XFRow()
24996 + m_nRepeat = 0;
24997 + m_nRow = 0;
25000 +XFRow::XFRow(const XFRow& other)
25002 + m_pOwnerTable = NULL;
25003 + m_nRepeat = other.m_nRepeat;
25004 + m_nRow = other.m_nRow;
25006 + for( int i=1; i<=other.GetCellCount(); i++ )
25008 + XFCell *pCell = new XFCell;
25009 + *pCell = *other.GetCell(i);
25010 + AddCell(pCell);
25014 +XFRow& XFRow::operator=(const XFRow& other)
25016 + m_pOwnerTable = NULL;
25017 + m_nRepeat = other.m_nRepeat;
25018 + m_nRow = other.m_nRow;
25020 + for( int i=1; i<=other.GetCellCount(); i++ )
25022 + XFCell *pCell = new XFCell;
25023 + *pCell = *other.GetCell(i);
25024 + AddCell(pCell);
25026 + return *this;
25030 +XFRow::~XFRow()
25032 + std::map<sal_Int32,XFCell*>::iterator it;
25033 + for( it=m_aCells.begin(); it!=m_aCells.end(); it++ )
25035 + XFCell *pCell = (*it).second;
25036 + if( pCell )
25037 + delete pCell;
25041 +void XFRow::AddCell(XFCell *pCell)
25043 + if( !pCell )
25044 + return;
25045 +/* sal_Int32 col = pCell->GetCol();
25046 + if( col<1 )
25048 + pCell->SetCol(m_aCells.size()+1);
25051 + col = pCell->GetCol();
25052 + if( m_aCells.find(col) != m_aCells.end() )
25053 + delete m_aCells[col];
25055 + sal_Int32 col = m_aCells.size()+1;
25056 + pCell->SetCol(col);
25057 + pCell->SetOwnerRow(this);
25058 + m_aCells[col]=pCell;
25061 +sal_Int32 XFRow::GetCellCount() const
25063 + return m_aCells.size();
25066 +XFCell* XFRow::GetCell(sal_Int32 col) const
25068 + if( m_aCells.find(col) == m_aCells.end() )
25069 + return NULL;
25070 + else
25071 + return m_aCells.find(col)->second;
25074 +rtl::OUString XFRow::GetRowName()
25076 + if( m_pOwnerTable && m_pOwnerTable->IsSubTable() )
25077 + return m_pOwnerTable->GetTableName();
25078 + return A2OUSTR("");
25081 +void XFRow::ToXml(IXFStream *pStrm)
25083 + sal_Int32 lastCol = 0;
25084 + IXFAttrList *pAttrList = pStrm->GetAttrList();
25086 + pAttrList->Clear();
25087 + if( GetStyleName().getLength() )
25088 + pAttrList->AddAttribute( A2OUSTR("table:style-name"), GetStyleName() );
25089 + if( m_nRepeat )
25090 + pAttrList->AddAttribute( A2OUSTR("table:number-rows-repeated"), Int32ToOUString(m_nRepeat) );
25091 + pStrm->StartElement( A2OUSTR("table:table-row") );
25093 + std::map<sal_Int32,XFCell*>::iterator it = m_aCells.begin();
25094 + for( ; it!=m_aCells.end(); it++ )
25096 + int col = (*it).first;
25097 + XFCell *pCell = (*it).second;
25098 + if( !pCell )
25099 + continue;
25100 + if( col>lastCol+1 )
25101 + {
25102 + XFCell *pNULLCell = new XFCell();
25103 + if( col>lastCol+2 )
25104 + pNULLCell->SetRepeated(col-lastCol-1);
25105 + pNULLCell->ToXml(pStrm);
25106 + }
25107 + pCell->ToXml(pStrm);
25108 + lastCol = col;
25111 + pStrm->EndElement( A2OUSTR("table:table-row") );
25113 \ No newline at end of file
25114 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfrow.hxx lotuswordpro/source/filter/xfilter/xfrow.hxx
25115 --- lotuswordpro.bak/source/filter/xfilter/xfrow.hxx 1970-01-01 08:00:00.000000000 +0800
25116 +++ lotuswordpro/source/filter/xfilter/xfrow.hxx 2008-10-22 11:42:34.000000000 +0800
25117 @@ -0,0 +1,142 @@
25118 +/*************************************************************************
25120 + * The Contents of this file are made available subject to the terms of
25121 + * either of the following licenses
25123 + * - GNU Lesser General Public License Version 2.1
25124 + * - Sun Industry Standards Source License Version 1.1
25126 + * Sun Microsystems Inc., October, 2000
25128 + * GNU Lesser General Public License Version 2.1
25129 + * =============================================
25130 + * Copyright 2000 by Sun Microsystems, Inc.
25131 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
25133 + * This library is free software; you can redistribute it and/or
25134 + * modify it under the terms of the GNU Lesser General Public
25135 + * License version 2.1, as published by the Free Software Foundation.
25137 + * This library is distributed in the hope that it will be useful,
25138 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
25139 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25140 + * Lesser General Public License for more details.
25142 + * You should have received a copy of the GNU Lesser General Public
25143 + * License along with this library; if not, write to the Free Software
25144 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
25145 + * MA 02111-1307 USA
25148 + * Sun Industry Standards Source License Version 1.1
25149 + * =================================================
25150 + * The contents of this file are subject to the Sun Industry Standards
25151 + * Source License Version 1.1 (the "License"); You may not use this file
25152 + * except in compliance with the License. You may obtain a copy of the
25153 + * License at http://www.openoffice.org/license.html.
25155 + * Software provided under this License is provided on an "AS IS" basis,
25156 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
25157 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
25158 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
25159 + * See the License for the specific provisions governing your rights and
25160 + * obligations concerning the Software.
25162 + * The Initial Developer of the Original Code is: IBM Corporation
25164 + * Copyright: 2008 by IBM Corporation
25166 + * All Rights Reserved.
25168 + * Contributor(s): _______________________________________
25171 + ************************************************************************/
25172 +/*************************************************************************
25173 + * @file
25174 + * Table row object. A table is consist by rows.
25175 + ************************************************************************/
25176 +/*************************************************************************
25177 + * Change History
25178 + * 2005-01-28 create and implements.
25179 + ************************************************************************/
25180 +#ifndef _XFROW_HXX
25181 +#define _XFROW_HXX
25183 +#include "xfcontent.hxx"
25184 +#include <map>
25186 +class XFCell;
25187 +class XFTable;
25188 +class XFRow : public XFContent
25190 +public:
25191 + XFRow();
25193 + XFRow(const XFRow& other);
25195 + XFRow& operator=(const XFRow& other);
25197 + virtual ~XFRow();
25199 +public:
25200 + void AddCell(XFCell *pCell);
25202 + void SetRepeated(sal_Int32 repeat);
25204 + void SetRow(sal_Int32 row);
25206 + void SetOwnerTable(XFTable *pTable);
25208 + sal_Int32 GetRow();
25210 + sal_Int32 GetCellCount() const;
25212 + XFCell* GetCell(sal_Int32 col) const;
25214 + XFTable* GetOwnerTable();
25216 + rtl::OUString GetRowName();
25218 + virtual void ToXml(IXFStream *pStrm);
25220 + void RemoveCell(sal_Int32 cell);
25222 +private:
25223 + XFTable *m_pOwnerTable;
25224 + std::map<sal_Int32,XFCell*> m_aCells;
25225 + sal_Int32 m_nRepeat;
25226 + sal_Int32 m_nRow;
25229 +inline void XFRow::SetRepeated(sal_Int32 repeat)
25231 + m_nRepeat = repeat;
25234 +inline void XFRow::SetRow(sal_Int32 row)
25236 + m_nRow = row;
25239 +inline void XFRow::SetOwnerTable(XFTable *pTable)
25241 + m_pOwnerTable = pTable;
25244 +inline sal_Int32 XFRow::GetRow()
25246 + return m_nRow;
25249 +inline XFTable* XFRow::GetOwnerTable()
25251 + return m_pOwnerTable;
25254 +inline void XFRow::RemoveCell(sal_Int32 cell)
25256 + m_aCells.erase(cell);
25259 +#endif
25260 \ No newline at end of file
25261 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfrowstyle.cxx lotuswordpro/source/filter/xfilter/xfrowstyle.cxx
25262 --- lotuswordpro.bak/source/filter/xfilter/xfrowstyle.cxx 1970-01-01 08:00:00.000000000 +0800
25263 +++ lotuswordpro/source/filter/xfilter/xfrowstyle.cxx 2008-10-22 11:42:34.000000000 +0800
25264 @@ -0,0 +1,129 @@
25265 +/*************************************************************************
25267 + * The Contents of this file are made available subject to the terms of
25268 + * either of the following licenses
25270 + * - GNU Lesser General Public License Version 2.1
25271 + * - Sun Industry Standards Source License Version 1.1
25273 + * Sun Microsystems Inc., October, 2000
25275 + * GNU Lesser General Public License Version 2.1
25276 + * =============================================
25277 + * Copyright 2000 by Sun Microsystems, Inc.
25278 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
25280 + * This library is free software; you can redistribute it and/or
25281 + * modify it under the terms of the GNU Lesser General Public
25282 + * License version 2.1, as published by the Free Software Foundation.
25284 + * This library is distributed in the hope that it will be useful,
25285 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
25286 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25287 + * Lesser General Public License for more details.
25289 + * You should have received a copy of the GNU Lesser General Public
25290 + * License along with this library; if not, write to the Free Software
25291 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
25292 + * MA 02111-1307 USA
25295 + * Sun Industry Standards Source License Version 1.1
25296 + * =================================================
25297 + * The contents of this file are subject to the Sun Industry Standards
25298 + * Source License Version 1.1 (the "License"); You may not use this file
25299 + * except in compliance with the License. You may obtain a copy of the
25300 + * License at http://www.openoffice.org/license.html.
25302 + * Software provided under this License is provided on an "AS IS" basis,
25303 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
25304 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
25305 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
25306 + * See the License for the specific provisions governing your rights and
25307 + * obligations concerning the Software.
25309 + * The Initial Developer of the Original Code is: IBM Corporation
25311 + * Copyright: 2008 by IBM Corporation
25313 + * All Rights Reserved.
25315 + * Contributor(s): _______________________________________
25318 + ************************************************************************/
25319 +/*************************************************************************
25320 + * @file
25321 + * Table row style, ie. table row height.
25322 + ************************************************************************/
25323 +/*************************************************************************
25324 + * Change History
25325 + * 2005-01-28 create and implements.
25326 + ************************************************************************/
25327 +#include "xfrowstyle.hxx"
25328 +#include "xfbgimage.hxx"
25330 +XFRowStyle::XFRowStyle():m_fHeight(0)
25332 + m_fHeight = 0;
25333 + m_fMinHeight = 0;
25334 + m_pBGImage = NULL;
25338 +void XFRowStyle::SetbackImage(XFBGImage *pImage)
25340 + if( m_pBGImage )
25341 + delete m_pBGImage;
25342 + m_pBGImage = pImage;
25345 +enumXFStyle XFRowStyle::GetStyleFamily()
25347 + return enumXFStyleTableRow;
25350 +void XFRowStyle::ToXml(IXFStream *pStrm)
25352 + IXFAttrList *pAttrList = pStrm->GetAttrList();
25353 + pAttrList->Clear();
25355 + pAttrList->AddAttribute( A2OUSTR("style:name"), GetStyleName() );
25356 + if( GetParentStyleName().getLength() > 0 )
25357 + pAttrList->AddAttribute(A2OUSTR("style:parent-style-name"),GetParentStyleName());
25359 + pAttrList->AddAttribute( A2OUSTR("style:family"), A2OUSTR("table-row") );
25360 + pStrm->StartElement( A2OUSTR("style:style") );
25362 + pAttrList->Clear();
25363 + if( m_fMinHeight )
25364 + pAttrList->AddAttribute( A2OUSTR("style:min-row-height"), DoubleToOUString(m_fMinHeight) + A2OUSTR("cm") );
25365 + else if( m_fHeight )
25366 + pAttrList->AddAttribute( A2OUSTR("style:row-height"), DoubleToOUString(m_fHeight) + A2OUSTR("cm") );
25368 + if( m_aBackColor.IsValid() && !m_pBGImage )
25369 + pAttrList->AddAttribute( A2OUSTR("fo:background-color"), m_aBackColor.ToString() );
25370 + pStrm->StartElement( A2OUSTR("style:properties") );
25371 + if( m_pBGImage )
25372 + m_pBGImage->ToXml(pStrm);
25373 + pStrm->EndElement( A2OUSTR("style:properties") );
25375 + pStrm->EndElement( A2OUSTR("style:style") );
25378 +XFRowStyle& XFRowStyle::operator=(XFRowStyle& other)
25380 + m_fHeight = other.m_fHeight;
25381 + m_fMinHeight = other.m_fMinHeight;
25382 + m_aBackColor = other.m_aBackColor;
25384 + if( m_pBGImage )
25385 + delete m_pBGImage;
25387 + if( other.m_pBGImage )
25388 + m_pBGImage = new XFBGImage(*other.m_pBGImage);
25389 + else
25390 + m_pBGImage = NULL;
25391 + return *this;
25394 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfrowstyle.hxx lotuswordpro/source/filter/xfilter/xfrowstyle.hxx
25395 --- lotuswordpro.bak/source/filter/xfilter/xfrowstyle.hxx 1970-01-01 08:00:00.000000000 +0800
25396 +++ lotuswordpro/source/filter/xfilter/xfrowstyle.hxx 2008-10-22 11:42:34.000000000 +0800
25397 @@ -0,0 +1,126 @@
25398 +/*************************************************************************
25400 + * The Contents of this file are made available subject to the terms of
25401 + * either of the following licenses
25403 + * - GNU Lesser General Public License Version 2.1
25404 + * - Sun Industry Standards Source License Version 1.1
25406 + * Sun Microsystems Inc., October, 2000
25408 + * GNU Lesser General Public License Version 2.1
25409 + * =============================================
25410 + * Copyright 2000 by Sun Microsystems, Inc.
25411 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
25413 + * This library is free software; you can redistribute it and/or
25414 + * modify it under the terms of the GNU Lesser General Public
25415 + * License version 2.1, as published by the Free Software Foundation.
25417 + * This library is distributed in the hope that it will be useful,
25418 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
25419 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25420 + * Lesser General Public License for more details.
25422 + * You should have received a copy of the GNU Lesser General Public
25423 + * License along with this library; if not, write to the Free Software
25424 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
25425 + * MA 02111-1307 USA
25428 + * Sun Industry Standards Source License Version 1.1
25429 + * =================================================
25430 + * The contents of this file are subject to the Sun Industry Standards
25431 + * Source License Version 1.1 (the "License"); You may not use this file
25432 + * except in compliance with the License. You may obtain a copy of the
25433 + * License at http://www.openoffice.org/license.html.
25435 + * Software provided under this License is provided on an "AS IS" basis,
25436 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
25437 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
25438 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
25439 + * See the License for the specific provisions governing your rights and
25440 + * obligations concerning the Software.
25442 + * The Initial Developer of the Original Code is: IBM Corporation
25444 + * Copyright: 2008 by IBM Corporation
25446 + * All Rights Reserved.
25448 + * Contributor(s): _______________________________________
25451 + ************************************************************************/
25452 +/*************************************************************************
25453 + * @file
25454 + * Table row style, ie. table row height.
25455 + ************************************************************************/
25456 +/*************************************************************************
25457 + * Change History
25458 + * 2005-01-28 create and implements.
25459 + ************************************************************************/
25460 +#ifndef _XFROWSTYLE_HXX
25461 +#define _XFROWSTYLE_HXX
25463 +#include "xfglobal.hxx"
25464 +#include "xfstyle.hxx"
25465 +#include "xfcolor.hxx"
25467 +class XFBGImage;
25468 +class XFRowStyle : public XFStyle
25470 +public:
25471 + XFRowStyle();
25472 + XFRowStyle& operator=(XFRowStyle& other);
25474 +public:
25475 + void SetRowHeight(double height);
25477 + double GetRowHeight();
25479 + void SetMinRowHeight(double height);
25481 + void SetBackColor(XFColor& color);
25483 + void SetbackImage(XFBGImage *pImage);
25485 + virtual enumXFStyle GetStyleFamily();
25487 + virtual void ToXml(IXFStream *pStrm);
25489 +private:
25490 + double m_fHeight;
25491 + double m_fMinHeight;
25492 + XFColor m_aBackColor;
25493 + XFBGImage *m_pBGImage;
25496 +inline void XFRowStyle::SetRowHeight(double height)
25498 + m_fHeight = height;
25501 +inline void XFRowStyle::SetMinRowHeight(double height)
25503 + m_fMinHeight = height;
25506 +inline void XFRowStyle::SetBackColor(XFColor& color)
25508 + m_aBackColor = color;
25510 +inline double XFRowStyle::GetRowHeight()
25512 + if (m_fMinHeight > FLOAT_MIN)
25514 + return m_fMinHeight;
25517 + else if (m_fHeight > FLOAT_MIN)
25519 + return m_fHeight;
25521 + return 0;
25523 +#endif
25524 \ No newline at end of file
25525 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfruby.hxx lotuswordpro/source/filter/xfilter/xfruby.hxx
25526 --- lotuswordpro.bak/source/filter/xfilter/xfruby.hxx 1970-01-01 08:00:00.000000000 +0800
25527 +++ lotuswordpro/source/filter/xfilter/xfruby.hxx 2008-10-22 11:42:34.000000000 +0800
25528 @@ -0,0 +1,113 @@
25529 +/*************************************************************************
25531 + * The Contents of this file are made available subject to the terms of
25532 + * either of the following licenses
25534 + * - GNU Lesser General Public License Version 2.1
25535 + * - Sun Industry Standards Source License Version 1.1
25537 + * Sun Microsystems Inc., October, 2000
25539 + * GNU Lesser General Public License Version 2.1
25540 + * =============================================
25541 + * Copyright 2000 by Sun Microsystems, Inc.
25542 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
25544 + * This library is free software; you can redistribute it and/or
25545 + * modify it under the terms of the GNU Lesser General Public
25546 + * License version 2.1, as published by the Free Software Foundation.
25548 + * This library is distributed in the hope that it will be useful,
25549 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
25550 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25551 + * Lesser General Public License for more details.
25553 + * You should have received a copy of the GNU Lesser General Public
25554 + * License along with this library; if not, write to the Free Software
25555 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
25556 + * MA 02111-1307 USA
25559 + * Sun Industry Standards Source License Version 1.1
25560 + * =================================================
25561 + * The contents of this file are subject to the Sun Industry Standards
25562 + * Source License Version 1.1 (the "License"); You may not use this file
25563 + * except in compliance with the License. You may obtain a copy of the
25564 + * License at http://www.openoffice.org/license.html.
25566 + * Software provided under this License is provided on an "AS IS" basis,
25567 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
25568 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
25569 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
25570 + * See the License for the specific provisions governing your rights and
25571 + * obligations concerning the Software.
25573 + * The Initial Developer of the Original Code is: IBM Corporation
25575 + * Copyright: 2008 by IBM Corporation
25577 + * All Rights Reserved.
25579 + * Contributor(s): _______________________________________
25582 + ************************************************************************/
25583 +/*************************************************************************
25584 + * @file
25585 + * ruby text.
25586 + ************************************************************************/
25587 +/*************************************************************************
25588 + * Change History
25589 + * 2005-06-21 create this file.
25590 + ************************************************************************/
25591 +#ifndef _XFRUBY_HXX
25592 +#define _XFRUBY_HXX
25594 +#include "xfcontent.hxx"
25596 +class XFRubyStart : public XFContent
25598 +public:
25599 + virtual void ToXml(IXFStream *pStrm);
25602 +class XFRubyEnd : public XFContent
25604 +public:
25605 + void SetText(rtl::OUString sText);
25606 + virtual void ToXml(IXFStream *pStrm);
25607 +private:
25608 + rtl::OUString m_strText;
25611 +void XFRubyStart::ToXml(IXFStream *pStrm)
25613 + IXFAttrList *pAttrList = pStrm->GetAttrList();
25614 + pAttrList->Clear();
25615 + if( GetStyleName().getLength())
25616 + pAttrList->AddAttribute( A2OUSTR("text:style-name"), GetStyleName());
25617 + pStrm->StartElement( A2OUSTR("text:ruby") );
25618 + pAttrList->Clear();
25619 + pStrm->StartElement( A2OUSTR("text:ruby-base") );
25622 +void XFRubyEnd::SetText(rtl::OUString sText)
25624 + m_strText = sText;
25627 +void XFRubyEnd::ToXml(IXFStream *pStrm)
25629 + pStrm->EndElement( A2OUSTR("text:ruby-base") );
25630 + IXFAttrList *pAttrList = pStrm->GetAttrList();
25631 + pAttrList->Clear();
25632 + if( GetStyleName().getLength())
25633 + pAttrList->AddAttribute( A2OUSTR("text:style-name"), GetStyleName());
25634 + pStrm->StartElement( A2OUSTR("text:ruby-text") );
25635 + if( m_strText.getLength() )
25636 + pStrm->Characters(m_strText);
25637 + pStrm->EndElement( A2OUSTR("text:ruby-text") );
25638 + pStrm->EndElement( A2OUSTR("text:ruby") );
25641 +#endif
25642 \ No newline at end of file
25643 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfrubystyle.hxx lotuswordpro/source/filter/xfilter/xfrubystyle.hxx
25644 --- lotuswordpro.bak/source/filter/xfilter/xfrubystyle.hxx 1970-01-01 08:00:00.000000000 +0800
25645 +++ lotuswordpro/source/filter/xfilter/xfrubystyle.hxx 2008-10-22 11:42:34.000000000 +0800
25646 @@ -0,0 +1,143 @@
25647 +/*************************************************************************
25649 + * The Contents of this file are made available subject to the terms of
25650 + * either of the following licenses
25652 + * - GNU Lesser General Public License Version 2.1
25653 + * - Sun Industry Standards Source License Version 1.1
25655 + * Sun Microsystems Inc., October, 2000
25657 + * GNU Lesser General Public License Version 2.1
25658 + * =============================================
25659 + * Copyright 2000 by Sun Microsystems, Inc.
25660 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
25662 + * This library is free software; you can redistribute it and/or
25663 + * modify it under the terms of the GNU Lesser General Public
25664 + * License version 2.1, as published by the Free Software Foundation.
25666 + * This library is distributed in the hope that it will be useful,
25667 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
25668 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25669 + * Lesser General Public License for more details.
25671 + * You should have received a copy of the GNU Lesser General Public
25672 + * License along with this library; if not, write to the Free Software
25673 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
25674 + * MA 02111-1307 USA
25677 + * Sun Industry Standards Source License Version 1.1
25678 + * =================================================
25679 + * The contents of this file are subject to the Sun Industry Standards
25680 + * Source License Version 1.1 (the "License"); You may not use this file
25681 + * except in compliance with the License. You may obtain a copy of the
25682 + * License at http://www.openoffice.org/license.html.
25684 + * Software provided under this License is provided on an "AS IS" basis,
25685 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
25686 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
25687 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
25688 + * See the License for the specific provisions governing your rights and
25689 + * obligations concerning the Software.
25691 + * The Initial Developer of the Original Code is: IBM Corporation
25693 + * Copyright: 2008 by IBM Corporation
25695 + * All Rights Reserved.
25697 + * Contributor(s): _______________________________________
25700 + ************************************************************************/
25701 +/*************************************************************************
25702 + * @file
25703 + * ruby style.
25704 + ************************************************************************/
25705 +/*************************************************************************
25706 + * Change History
25707 + * 2005-06-21 create this file.
25708 + ************************************************************************/
25709 +#ifndef _XFRUBYSTYLE_HXX
25710 +#define _XFRUBYSTYLE_HXX
25712 +#include "xfglobal.hxx"
25713 +#include "xfstyle.hxx"
25714 +#include "xfdefs.hxx"
25716 +class XFRubyStyle : public XFStyle
25718 +public:
25719 + XFRubyStyle(){};
25720 + virtual ~XFRubyStyle(){};
25721 + virtual void ToXml(IXFStream *strm);
25722 + void SetPosition(enumXFRubyPosition ePosition);
25723 + void SetAlignment(enumXFRubyPosition eAlignment);
25724 + enumXFStyle GetStyleFamily();
25726 +private:
25727 + enumXFRubyPosition m_ePos;
25728 + enumXFRubyPosition m_eAlign;
25731 +void XFRubyStyle::SetPosition(enumXFRubyPosition ePosition)
25733 + m_ePos = ePosition;
25735 +void XFRubyStyle::SetAlignment(enumXFRubyPosition eAlignment)
25737 + m_eAlign = eAlignment;
25739 +enumXFStyle XFRubyStyle::GetStyleFamily()
25741 + return enumXFStyleRuby;
25743 +void XFRubyStyle::ToXml(IXFStream *pStrm)
25745 + IXFAttrList *pAttrList = pStrm->GetAttrList();
25746 + rtl::OUString style = GetStyleName();
25748 + pAttrList->Clear();
25749 + if( style.getLength() )
25750 + pAttrList->AddAttribute(A2OUSTR("style:name"),GetStyleName());
25751 + pAttrList->AddAttribute(A2OUSTR("style:family"), A2OUSTR("ruby"));
25752 + pStrm->StartElement(A2OUSTR("style:style"));
25754 + pAttrList->Clear();
25756 + OUString sPos;
25757 + if (m_eAlign == enumXFRubyLeft)
25759 + sPos = A2OUSTR("left");
25761 + else if(m_eAlign == enumXFRubyRight)
25763 + sPos = A2OUSTR("right");
25765 + else if(m_eAlign == enumXFRubyCenter)
25767 + sPos = A2OUSTR("center");
25769 + if (sPos.getLength()>0)
25770 + pAttrList->AddAttribute(A2OUSTR("style:ruby-align"),sPos);
25772 + OUString sAlign;
25773 + if (m_ePos == enumXFRubyTop)
25775 + sAlign = A2OUSTR("above");
25777 + else if(m_ePos == enumXFRubyBottom)
25779 + sAlign = A2OUSTR("below");
25781 + if (sAlign.getLength()>0)
25782 + pAttrList->AddAttribute(A2OUSTR("style:ruby-position"),sAlign);
25784 + pStrm->StartElement(A2OUSTR("style:properties"));
25785 + pStrm->EndElement(A2OUSTR("style:properties"));
25786 + pStrm->EndElement(A2OUSTR("style:style"));
25789 +#endif
25790 \ No newline at end of file
25791 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfsaxattrlist.cxx lotuswordpro/source/filter/xfilter/xfsaxattrlist.cxx
25792 --- lotuswordpro.bak/source/filter/xfilter/xfsaxattrlist.cxx 1970-01-01 08:00:00.000000000 +0800
25793 +++ lotuswordpro/source/filter/xfilter/xfsaxattrlist.cxx 2008-10-22 11:42:34.000000000 +0800
25794 @@ -0,0 +1,88 @@
25795 +/*************************************************************************
25797 + * The Contents of this file are made available subject to the terms of
25798 + * either of the following licenses
25800 + * - GNU Lesser General Public License Version 2.1
25801 + * - Sun Industry Standards Source License Version 1.1
25803 + * Sun Microsystems Inc., October, 2000
25805 + * GNU Lesser General Public License Version 2.1
25806 + * =============================================
25807 + * Copyright 2000 by Sun Microsystems, Inc.
25808 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
25810 + * This library is free software; you can redistribute it and/or
25811 + * modify it under the terms of the GNU Lesser General Public
25812 + * License version 2.1, as published by the Free Software Foundation.
25814 + * This library is distributed in the hope that it will be useful,
25815 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
25816 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25817 + * Lesser General Public License for more details.
25819 + * You should have received a copy of the GNU Lesser General Public
25820 + * License along with this library; if not, write to the Free Software
25821 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
25822 + * MA 02111-1307 USA
25825 + * Sun Industry Standards Source License Version 1.1
25826 + * =================================================
25827 + * The contents of this file are subject to the Sun Industry Standards
25828 + * Source License Version 1.1 (the "License"); You may not use this file
25829 + * except in compliance with the License. You may obtain a copy of the
25830 + * License at http://www.openoffice.org/license.html.
25832 + * Software provided under this License is provided on an "AS IS" basis,
25833 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
25834 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
25835 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
25836 + * See the License for the specific provisions governing your rights and
25837 + * obligations concerning the Software.
25839 + * The Initial Developer of the Original Code is: IBM Corporation
25841 + * Copyright: 2008 by IBM Corporation
25843 + * All Rights Reserved.
25845 + * Contributor(s): _______________________________________
25848 + ************************************************************************/
25849 +/*************************************************************************
25850 + * @file
25851 + * Document object of the xml filter framework.
25852 + ************************************************************************/
25853 +/*************************************************************************
25854 + * Change History
25855 + * 2004-12-23 create this file.
25856 + ************************************************************************/
25858 +#include "xfsaxattrlist.hxx"
25859 +#include "xmloff/attrlist.hxx"
25861 +XFSaxAttrList::XFSaxAttrList()
25863 + m_pSvAttrList = new SvXMLAttributeList();
25864 + m_xAttrList.set(m_pSvAttrList);
25867 +XFSaxAttrList::~XFSaxAttrList()
25869 + //pls don't delete m_pSvAttrList,because when m_xAttrList release,the object will be automatic deleted.
25870 +// if( m_pSvAttrList )
25871 +// delete m_pSvAttrList;
25874 +void XFSaxAttrList::AddAttribute(const rtl::OUString& name, const rtl::OUString& value)
25876 + m_pSvAttrList->AddAttribute(name,value);
25879 +void XFSaxAttrList::Clear()
25881 + m_pSvAttrList->Clear();
25883 \ No newline at end of file
25884 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfsaxattrlist.hxx lotuswordpro/source/filter/xfilter/xfsaxattrlist.hxx
25885 --- lotuswordpro.bak/source/filter/xfilter/xfsaxattrlist.hxx 1970-01-01 08:00:00.000000000 +0800
25886 +++ lotuswordpro/source/filter/xfilter/xfsaxattrlist.hxx 2008-10-22 11:42:34.000000000 +0800
25887 @@ -0,0 +1,101 @@
25888 +/*************************************************************************
25890 + * The Contents of this file are made available subject to the terms of
25891 + * either of the following licenses
25893 + * - GNU Lesser General Public License Version 2.1
25894 + * - Sun Industry Standards Source License Version 1.1
25896 + * Sun Microsystems Inc., October, 2000
25898 + * GNU Lesser General Public License Version 2.1
25899 + * =============================================
25900 + * Copyright 2000 by Sun Microsystems, Inc.
25901 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
25903 + * This library is free software; you can redistribute it and/or
25904 + * modify it under the terms of the GNU Lesser General Public
25905 + * License version 2.1, as published by the Free Software Foundation.
25907 + * This library is distributed in the hope that it will be useful,
25908 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
25909 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25910 + * Lesser General Public License for more details.
25912 + * You should have received a copy of the GNU Lesser General Public
25913 + * License along with this library; if not, write to the Free Software
25914 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
25915 + * MA 02111-1307 USA
25918 + * Sun Industry Standards Source License Version 1.1
25919 + * =================================================
25920 + * The contents of this file are subject to the Sun Industry Standards
25921 + * Source License Version 1.1 (the "License"); You may not use this file
25922 + * except in compliance with the License. You may obtain a copy of the
25923 + * License at http://www.openoffice.org/license.html.
25925 + * Software provided under this License is provided on an "AS IS" basis,
25926 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
25927 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
25928 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
25929 + * See the License for the specific provisions governing your rights and
25930 + * obligations concerning the Software.
25932 + * The Initial Developer of the Original Code is: IBM Corporation
25934 + * Copyright: 2008 by IBM Corporation
25936 + * All Rights Reserved.
25938 + * Contributor(s): _______________________________________
25941 + ************************************************************************/
25942 +/*************************************************************************
25943 + * @file
25944 + * Wrapper the attibute list of a xml element.
25945 + ************************************************************************/
25946 +/*************************************************************************
25947 + * Change History
25948 + * 2004-12-23 create this file.
25949 + ************************************************************************/
25950 +#ifndef _XFSAXATTRLIST_HXX
25951 +#define _XFSAXATTRLIST_HXX
25953 +#include "ixfattrlist.hxx"
25954 +#include "xmloff/attrlist.hxx"
25955 +#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
25957 +using namespace ::com::sun::star::uno;
25958 +using namespace ::com::sun::star::xml::sax;
25960 +class XFSaxAttrList : public IXFAttrList
25962 +public:
25963 + XFSaxAttrList();
25965 + virtual ~XFSaxAttrList();
25967 +public:
25968 + //Interface ISaxAttributeList:
25969 + virtual void AddAttribute(const rtl::OUString& name, const rtl::OUString& value);
25971 + virtual void Clear();
25973 + Reference<XAttributeList> GetAttributeList();
25975 + friend class XFSaxStream;
25976 +private:
25977 + SvXMLAttributeList *m_pSvAttrList;
25978 + Reference<XAttributeList> m_xAttrList;
25982 +inline Reference<XAttributeList> XFSaxAttrList::GetAttributeList()
25984 + return m_xAttrList;
25987 +#endif //XFSAXATTRLIST_INC
25989 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfsaxstream.cxx lotuswordpro/source/filter/xfilter/xfsaxstream.cxx
25990 --- lotuswordpro.bak/source/filter/xfilter/xfsaxstream.cxx 1970-01-01 08:00:00.000000000 +0800
25991 +++ lotuswordpro/source/filter/xfilter/xfsaxstream.cxx 2008-10-22 11:42:34.000000000 +0800
25992 @@ -0,0 +1,130 @@
25993 +/*************************************************************************
25995 + * The Contents of this file are made available subject to the terms of
25996 + * either of the following licenses
25998 + * - GNU Lesser General Public License Version 2.1
25999 + * - Sun Industry Standards Source License Version 1.1
26001 + * Sun Microsystems Inc., October, 2000
26003 + * GNU Lesser General Public License Version 2.1
26004 + * =============================================
26005 + * Copyright 2000 by Sun Microsystems, Inc.
26006 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
26008 + * This library is free software; you can redistribute it and/or
26009 + * modify it under the terms of the GNU Lesser General Public
26010 + * License version 2.1, as published by the Free Software Foundation.
26012 + * This library is distributed in the hope that it will be useful,
26013 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
26014 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
26015 + * Lesser General Public License for more details.
26017 + * You should have received a copy of the GNU Lesser General Public
26018 + * License along with this library; if not, write to the Free Software
26019 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
26020 + * MA 02111-1307 USA
26023 + * Sun Industry Standards Source License Version 1.1
26024 + * =================================================
26025 + * The contents of this file are subject to the Sun Industry Standards
26026 + * Source License Version 1.1 (the "License"); You may not use this file
26027 + * except in compliance with the License. You may obtain a copy of the
26028 + * License at http://www.openoffice.org/license.html.
26030 + * Software provided under this License is provided on an "AS IS" basis,
26031 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
26032 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
26033 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
26034 + * See the License for the specific provisions governing your rights and
26035 + * obligations concerning the Software.
26037 + * The Initial Developer of the Original Code is: IBM Corporation
26039 + * Copyright: 2008 by IBM Corporation
26041 + * All Rights Reserved.
26043 + * Contributor(s): _______________________________________
26046 + ************************************************************************/
26047 +/*************************************************************************
26048 + * @file
26049 + * Tool for sax writer.
26050 + ************************************************************************/
26051 +/*************************************************************************
26052 + * Change History
26053 + * 2005-12-23 create this file.
26054 + ************************************************************************/
26055 +#include "xfsaxstream.hxx"
26056 +#include "xfsaxattrlist.hxx"
26058 +#include <cppuhelper/implbase1.hxx>
26059 +#include <cppuhelper/implbase3.hxx>
26060 +#include <cppuhelper/factory.hxx>
26062 +#include <com/sun/star/document/XFilter.hpp>
26063 +#include <com/sun/star/document/XImporter.hpp>
26064 +#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
26065 +#include <com/sun/star/lang/XServiceInfo.hpp>
26066 +#include <com/sun/star/io/XInputStream.hpp>
26068 +using namespace ::rtl;
26069 +using namespace ::cppu;
26070 +using namespace ::com::sun::star::lang;
26071 +using namespace ::com::sun::star::io;
26072 +using namespace ::com::sun::star::registry;
26073 +using namespace ::com::sun::star::document;
26074 +using namespace ::com::sun::star::beans;
26075 +using namespace ::com::sun::star::xml::sax;
26076 +using namespace ::com::sun::star::uno;
26078 +XFSaxStream::XFSaxStream(Reference<XDocumentHandler>& xHandler)
26080 + m_aHandler = xHandler;
26081 + m_pAttrList = new XFSaxAttrList();
26084 +XFSaxStream::~XFSaxStream()
26086 + if( m_pAttrList )
26087 + delete m_pAttrList;
26090 +void XFSaxStream::StartDocument()
26092 + m_aHandler->startDocument();
26095 +void XFSaxStream::EndDocument()
26097 + m_aHandler->endDocument();
26100 +void XFSaxStream::StartElement(const rtl::OUString& oustr)
26102 + m_aHandler->startElement( oustr, m_pAttrList->GetAttributeList() );
26103 + m_pAttrList->Clear();
26106 +void XFSaxStream::EndElement(const rtl::OUString& oustr)
26108 + m_aHandler->endElement(oustr);
26110 + if( m_pAttrList )
26111 + m_pAttrList->Clear();
26114 +void XFSaxStream::Characters(const rtl::OUString& oustr)
26116 + m_aHandler->characters(oustr);
26119 +IXFAttrList* XFSaxStream::GetAttrList()
26121 + return m_pAttrList;
26123 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfsaxstream.hxx lotuswordpro/source/filter/xfilter/xfsaxstream.hxx
26124 --- lotuswordpro.bak/source/filter/xfilter/xfsaxstream.hxx 1970-01-01 08:00:00.000000000 +0800
26125 +++ lotuswordpro/source/filter/xfilter/xfsaxstream.hxx 2008-10-22 11:42:34.000000000 +0800
26126 @@ -0,0 +1,138 @@
26127 +/*************************************************************************
26129 + * The Contents of this file are made available subject to the terms of
26130 + * either of the following licenses
26132 + * - GNU Lesser General Public License Version 2.1
26133 + * - Sun Industry Standards Source License Version 1.1
26135 + * Sun Microsystems Inc., October, 2000
26137 + * GNU Lesser General Public License Version 2.1
26138 + * =============================================
26139 + * Copyright 2000 by Sun Microsystems, Inc.
26140 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
26142 + * This library is free software; you can redistribute it and/or
26143 + * modify it under the terms of the GNU Lesser General Public
26144 + * License version 2.1, as published by the Free Software Foundation.
26146 + * This library is distributed in the hope that it will be useful,
26147 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
26148 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
26149 + * Lesser General Public License for more details.
26151 + * You should have received a copy of the GNU Lesser General Public
26152 + * License along with this library; if not, write to the Free Software
26153 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
26154 + * MA 02111-1307 USA
26157 + * Sun Industry Standards Source License Version 1.1
26158 + * =================================================
26159 + * The contents of this file are subject to the Sun Industry Standards
26160 + * Source License Version 1.1 (the "License"); You may not use this file
26161 + * except in compliance with the License. You may obtain a copy of the
26162 + * License at http://www.openoffice.org/license.html.
26164 + * Software provided under this License is provided on an "AS IS" basis,
26165 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
26166 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
26167 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
26168 + * See the License for the specific provisions governing your rights and
26169 + * obligations concerning the Software.
26171 + * The Initial Developer of the Original Code is: IBM Corporation
26173 + * Copyright: 2008 by IBM Corporation
26175 + * All Rights Reserved.
26177 + * Contributor(s): _______________________________________
26180 + ************************************************************************/
26181 +/*************************************************************************
26182 + * @file
26183 + * Tool for sax writer.
26184 + ************************************************************************/
26185 +/*************************************************************************
26186 + * Change History
26187 + * 2005-12-23 create this file.
26188 + ************************************************************************/
26189 +#ifndef _XFSAXSTREAM_HXX
26190 +#define _XFSAXSTREAM_HXX
26192 +#include "ixfstream.hxx"
26194 +#include <cppuhelper/implbase1.hxx>
26195 +#include <cppuhelper/implbase3.hxx>
26196 +#include <cppuhelper/factory.hxx>
26197 +#include <com/sun/star/document/XFilter.hpp>
26198 +#include <com/sun/star/document/XImporter.hpp>
26199 +#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
26200 +#include <com/sun/star/lang/XServiceInfo.hpp>
26201 +#include <com/sun/star/io/XInputStream.hpp>
26203 +using namespace ::rtl;
26204 +using namespace ::cppu;
26205 +using namespace ::com::sun::star::lang;
26206 +using namespace ::com::sun::star::io;
26207 +using namespace ::com::sun::star::registry;
26208 +using namespace ::com::sun::star::document;
26209 +using namespace ::com::sun::star::beans;
26210 +using namespace ::com::sun::star::xml::sax;
26211 +using namespace ::com::sun::star::uno;
26213 +class XFSaxAttrList;
26214 +class IXFAttrList;
26216 +/**
26217 + * @brief
26218 + * Sax stream object, XDocumentHandler wrapper.
26219 + */
26220 +class XFSaxStream : public IXFStream
26222 +public:
26223 + XFSaxStream(Reference<XDocumentHandler>& xHandler);
26225 + virtual ~XFSaxStream();
26227 +public:
26228 + /**
26229 + * @descr Start document callback.
26230 + */
26231 + virtual void StartDocument();
26233 + /**
26234 + * @descr End document callback.
26235 + */
26236 + virtual void EndDocument();
26238 + /**
26239 + * @descr Start output element.
26240 + */
26241 + virtual void StartElement(const rtl::OUString& oustr);
26243 + /**
26244 + * @descr End output element.
26245 + */
26246 + virtual void EndElement(const rtl::OUString& oustr);
26248 + /**
26249 + * @descr Output Character section.
26250 + */
26251 + virtual void Characters(const rtl::OUString& oustr);
26253 + /**
26254 + * @descr Get the attribute list interface.
26255 + */
26256 + virtual IXFAttrList* GetAttrList();
26258 +public:
26259 + Reference<XDocumentHandler> m_aHandler;
26260 + XFSaxAttrList *m_pAttrList;
26263 +#endif //XFSAXSTREAM_INC
26265 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfsection.cxx lotuswordpro/source/filter/xfilter/xfsection.cxx
26266 --- lotuswordpro.bak/source/filter/xfilter/xfsection.cxx 1970-01-01 08:00:00.000000000 +0800
26267 +++ lotuswordpro/source/filter/xfilter/xfsection.cxx 2008-10-22 11:42:34.000000000 +0800
26268 @@ -0,0 +1,155 @@
26269 +/*************************************************************************
26271 + * The Contents of this file are made available subject to the terms of
26272 + * either of the following licenses
26274 + * - GNU Lesser General Public License Version 2.1
26275 + * - Sun Industry Standards Source License Version 1.1
26277 + * Sun Microsystems Inc., October, 2000
26279 + * GNU Lesser General Public License Version 2.1
26280 + * =============================================
26281 + * Copyright 2000 by Sun Microsystems, Inc.
26282 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
26284 + * This library is free software; you can redistribute it and/or
26285 + * modify it under the terms of the GNU Lesser General Public
26286 + * License version 2.1, as published by the Free Software Foundation.
26288 + * This library is distributed in the hope that it will be useful,
26289 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
26290 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
26291 + * Lesser General Public License for more details.
26293 + * You should have received a copy of the GNU Lesser General Public
26294 + * License along with this library; if not, write to the Free Software
26295 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
26296 + * MA 02111-1307 USA
26299 + * Sun Industry Standards Source License Version 1.1
26300 + * =================================================
26301 + * The contents of this file are subject to the Sun Industry Standards
26302 + * Source License Version 1.1 (the "License"); You may not use this file
26303 + * except in compliance with the License. You may obtain a copy of the
26304 + * License at http://www.openoffice.org/license.html.
26306 + * Software provided under this License is provided on an "AS IS" basis,
26307 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
26308 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
26309 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
26310 + * See the License for the specific provisions governing your rights and
26311 + * obligations concerning the Software.
26313 + * The Initial Developer of the Original Code is: IBM Corporation
26315 + * Copyright: 2008 by IBM Corporation
26317 + * All Rights Reserved.
26319 + * Contributor(s): _______________________________________
26322 + ************************************************************************/
26323 +/*************************************************************************
26324 + * @file
26325 + * Section object.
26326 + ************************************************************************/
26327 +/*************************************************************************
26328 + * Change History
26329 + * 2005-12-28 create this file.
26330 + ************************************************************************/
26331 +#include "xfsection.hxx"
26333 +XFSection::XFSection()
26335 + m_bProtected = sal_False;
26336 + m_bHiden = sal_False;
26337 + m_strSectionName = XFGlobal::GenSectionName();
26340 +XFSection::~XFSection()
26344 +void XFSection::SetSectionName(rtl::OUString name)
26346 + m_strSectionName = name;
26349 +void XFSection::SetSourceLink( rtl::OUString link)
26351 + m_strSourceLink = link;
26354 +void XFSection::SetProtected(sal_Bool bProtected)
26356 + m_bProtected = bProtected;
26359 +void XFSection::SetHiden(sal_Bool hiden)
26361 + m_bHiden = hiden;
26364 +void XFSection::ToXml(IXFStream *pStrm)
26366 + assert(m_strSectionName.getLength() > 0 );
26368 + IXFAttrList *pAttrList = pStrm->GetAttrList();
26370 + pAttrList->Clear();
26371 + rtl::OUString style = GetStyleName();
26372 + if( style.getLength() )
26373 + pAttrList->AddAttribute( A2OUSTR("text:style-name"), style);
26374 + //section name
26375 + if( m_strSectionName.getLength() )
26376 + pAttrList->AddAttribute( A2OUSTR("text:name"), m_strSectionName);
26377 + if( m_bProtected )
26378 + pAttrList->AddAttribute( A2OUSTR("text:protected"), A2OUSTR("true") );
26379 + if( m_bHiden )
26380 + pAttrList->AddAttribute( A2OUSTR("text:display"), A2OUSTR("none") );
26382 + pStrm->StartElement( A2OUSTR("text:section") );
26383 + if( m_strSourceLink.getLength() )
26385 + pAttrList->Clear();
26386 + pAttrList->AddAttribute( A2OUSTR("xlink:href"), m_strSourceLink);
26387 + pAttrList->AddAttribute( A2OUSTR("text:filter-name"), A2OUSTR("wordpro"));
26388 + pStrm->StartElement( A2OUSTR("text:section-source") );
26389 + pStrm->EndElement( A2OUSTR("text:section-source") );
26392 + XFContentContainer::ToXml(pStrm);
26394 + pStrm->EndElement( A2OUSTR("text:section") );
26398 +void XFSection::ToXmlHeader(IXFStream *pStrm)
26400 + assert(m_strSectionName.getLength() > 0 );
26402 + IXFAttrList *pAttrList = pStrm->GetAttrList();
26404 + pAttrList->Clear();
26405 + rtl::OUString style = GetStyleName();
26406 + if( style.getLength() )
26407 + pAttrList->AddAttribute( A2OUSTR("text:style-name"), style);
26408 + //section name
26409 + if( m_strSectionName.getLength() )
26410 + pAttrList->AddAttribute( A2OUSTR("text:name"), m_strSectionName);
26411 + if( m_bProtected )
26412 + pAttrList->AddAttribute( A2OUSTR("text:protected"), A2OUSTR("true") );
26413 + if( m_bHiden )
26414 + pAttrList->AddAttribute( A2OUSTR("text:display"), A2OUSTR("none") );
26416 + pStrm->StartElement( A2OUSTR("text:section") );
26419 +void XFSection::ToXmlTail(IXFStream *pStrm)
26421 + pStrm->EndElement( A2OUSTR("text:section") );
26424 \ No newline at end of file
26425 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfsection.hxx lotuswordpro/source/filter/xfilter/xfsection.hxx
26426 --- lotuswordpro.bak/source/filter/xfilter/xfsection.hxx 1970-01-01 08:00:00.000000000 +0800
26427 +++ lotuswordpro/source/filter/xfilter/xfsection.hxx 2008-10-22 11:42:34.000000000 +0800
26428 @@ -0,0 +1,121 @@
26429 +/*************************************************************************
26431 + * The Contents of this file are made available subject to the terms of
26432 + * either of the following licenses
26434 + * - GNU Lesser General Public License Version 2.1
26435 + * - Sun Industry Standards Source License Version 1.1
26437 + * Sun Microsystems Inc., October, 2000
26439 + * GNU Lesser General Public License Version 2.1
26440 + * =============================================
26441 + * Copyright 2000 by Sun Microsystems, Inc.
26442 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
26444 + * This library is free software; you can redistribute it and/or
26445 + * modify it under the terms of the GNU Lesser General Public
26446 + * License version 2.1, as published by the Free Software Foundation.
26448 + * This library is distributed in the hope that it will be useful,
26449 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
26450 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
26451 + * Lesser General Public License for more details.
26453 + * You should have received a copy of the GNU Lesser General Public
26454 + * License along with this library; if not, write to the Free Software
26455 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
26456 + * MA 02111-1307 USA
26459 + * Sun Industry Standards Source License Version 1.1
26460 + * =================================================
26461 + * The contents of this file are subject to the Sun Industry Standards
26462 + * Source License Version 1.1 (the "License"); You may not use this file
26463 + * except in compliance with the License. You may obtain a copy of the
26464 + * License at http://www.openoffice.org/license.html.
26466 + * Software provided under this License is provided on an "AS IS" basis,
26467 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
26468 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
26469 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
26470 + * See the License for the specific provisions governing your rights and
26471 + * obligations concerning the Software.
26473 + * The Initial Developer of the Original Code is: IBM Corporation
26475 + * Copyright: 2008 by IBM Corporation
26477 + * All Rights Reserved.
26479 + * Contributor(s): _______________________________________
26482 + ************************************************************************/
26483 +/*************************************************************************
26484 + * @file
26485 + * Section object.
26486 + ************************************************************************/
26487 +/*************************************************************************
26488 + * Change History
26489 + * 2005-12-28 create this file.
26490 + ************************************************************************/
26491 +#ifndef _XFSECTION_HXX
26492 +#define _XFSECTION_HXX
26494 +#include "xfcontentcontainer.hxx"
26495 +#include "xfcontent.hxx"
26496 +#include "xfcolor.hxx"
26497 +#include <vector>
26499 +/**
26500 + * @brief
26501 + * Section object.
26502 + */
26503 +class XFSection : public XFContentContainer
26505 +public:
26506 + XFSection();
26508 + virtual ~XFSection();
26510 +public:
26511 + /**
26512 + * @descr Set section name. If not setted, i'll generate a name for it.
26513 + */
26514 + void SetSectionName(rtl::OUString name);
26516 + void SetSourceLink(rtl::OUString link);
26518 + /**
26519 + * @descr Set protected.
26520 + */
26521 + void SetProtected(sal_Bool bProtected);
26523 + /**
26524 + * @descr Set hidden.
26525 + */
26526 + void SetHiden(sal_Bool hiden);
26528 + /**
26529 + * @descr Output section obejct.
26530 + */
26531 + virtual void ToXml(IXFStream *pStrm);
26533 +private:
26534 + void ToXmlHeader(IXFStream *pStrm);
26536 + void ToXmlTail(IXFStream *pStrm);
26538 +private:
26539 + rtl::OUString m_strSectionName;
26540 + sal_Bool m_bProtected;
26541 + sal_Bool m_bHiden;
26542 + XFColor m_aBackColor;
26543 + double m_fMarginLeft;
26544 + double m_fMarginRight;
26545 + rtl::OUString m_strSourceLink;
26548 +#endif
26550 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfsectionstyle.cxx lotuswordpro/source/filter/xfilter/xfsectionstyle.cxx
26551 --- lotuswordpro.bak/source/filter/xfilter/xfsectionstyle.cxx 1970-01-01 08:00:00.000000000 +0800
26552 +++ lotuswordpro/source/filter/xfilter/xfsectionstyle.cxx 2008-10-22 11:42:34.000000000 +0800
26553 @@ -0,0 +1,156 @@
26554 +/*************************************************************************
26556 + * The Contents of this file are made available subject to the terms of
26557 + * either of the following licenses
26559 + * - GNU Lesser General Public License Version 2.1
26560 + * - Sun Industry Standards Source License Version 1.1
26562 + * Sun Microsystems Inc., October, 2000
26564 + * GNU Lesser General Public License Version 2.1
26565 + * =============================================
26566 + * Copyright 2000 by Sun Microsystems, Inc.
26567 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
26569 + * This library is free software; you can redistribute it and/or
26570 + * modify it under the terms of the GNU Lesser General Public
26571 + * License version 2.1, as published by the Free Software Foundation.
26573 + * This library is distributed in the hope that it will be useful,
26574 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
26575 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
26576 + * Lesser General Public License for more details.
26578 + * You should have received a copy of the GNU Lesser General Public
26579 + * License along with this library; if not, write to the Free Software
26580 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
26581 + * MA 02111-1307 USA
26584 + * Sun Industry Standards Source License Version 1.1
26585 + * =================================================
26586 + * The contents of this file are subject to the Sun Industry Standards
26587 + * Source License Version 1.1 (the "License"); You may not use this file
26588 + * except in compliance with the License. You may obtain a copy of the
26589 + * License at http://www.openoffice.org/license.html.
26591 + * Software provided under this License is provided on an "AS IS" basis,
26592 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
26593 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
26594 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
26595 + * See the License for the specific provisions governing your rights and
26596 + * obligations concerning the Software.
26598 + * The Initial Developer of the Original Code is: IBM Corporation
26600 + * Copyright: 2008 by IBM Corporation
26602 + * All Rights Reserved.
26604 + * Contributor(s): _______________________________________
26607 + ************************************************************************/
26608 +/*************************************************************************
26609 + * @file
26610 + * Section style,whose family is "section"
26611 + ************************************************************************/
26612 +/*************************************************************************
26613 + * Change History
26614 + * 2005-01-10 create this file.
26615 + ************************************************************************/
26616 +#include "xfsectionstyle.hxx"
26617 +#include "xfcolumns.hxx"
26619 +XFSectionStyle::XFSectionStyle()
26621 + m_fMarginLeft = 0;
26622 + m_fMarginRight = 0;
26623 + m_pBackImage = NULL;
26624 + m_pColumns = NULL;
26627 +XFSectionStyle::~XFSectionStyle()
26629 + if( m_pColumns )
26630 + delete m_pColumns;
26631 + if( m_pBackImage )
26632 + delete m_pBackImage;
26635 +enumXFStyle XFSectionStyle::GetStyleFamily()
26637 + return enumXFStyleSection;
26640 +void XFSectionStyle::SetMarginLeft(double left)
26642 + m_fMarginLeft = left;
26645 +void XFSectionStyle::SetMarginRight(double right)
26647 + m_fMarginRight = right;
26650 +void XFSectionStyle::SetBackColor(const XFColor& color)
26652 + m_aBackColor = color;
26655 +void XFSectionStyle::SetColumns(XFColumns *pColumns)
26657 + if( m_pColumns )
26658 + delete m_pColumns;
26659 + m_pColumns = pColumns;
26662 +void XFSectionStyle::SetBackImage(XFBGImage *image)
26664 + if( m_pBackImage )
26665 + delete m_pBackImage;
26666 + m_pBackImage = image;
26669 +void XFSectionStyle::ToXml(IXFStream *pStrm)
26671 + IXFAttrList *pAttrList = pStrm->GetAttrList();
26673 + pAttrList->Clear();
26674 + pAttrList->AddAttribute( A2OUSTR("style:name"), GetStyleName() );
26675 + pAttrList->AddAttribute( A2OUSTR("style:family"), A2OUSTR("section") );
26677 + pStrm->StartElement( A2OUSTR("style:style") );
26679 + pAttrList->Clear();
26680 + if( m_fMarginLeft != 0 )
26682 + pAttrList->AddAttribute( A2OUSTR("fo:margin-left"), DoubleToOUString(m_fMarginLeft) + A2OUSTR("cm") );
26684 + if( m_fMarginRight != 0 )
26686 + pAttrList->AddAttribute( A2OUSTR("fo:margin-right"), DoubleToOUString(m_fMarginRight) + A2OUSTR("cm") );
26688 + if( m_aBackColor.IsValid() && !m_pBackImage )
26690 + pAttrList->AddAttribute( A2OUSTR("fo:background-color"), m_aBackColor.ToString() );
26692 + else
26694 + pAttrList->AddAttribute( A2OUSTR("fo:background-color"), A2OUSTR("transparent") );
26697 + pStrm->StartElement( A2OUSTR("style:properties") );
26699 + if( m_pColumns )
26700 + m_pColumns->ToXml(pStrm);
26701 + if( m_pBackImage )
26702 + m_pBackImage->ToXml(pStrm);
26704 + pStrm->EndElement( A2OUSTR("style:properties") );
26706 + pStrm->EndElement( A2OUSTR("style:style") );
26710 \ No newline at end of file
26711 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfsectionstyle.hxx lotuswordpro/source/filter/xfilter/xfsectionstyle.hxx
26712 --- lotuswordpro.bak/source/filter/xfilter/xfsectionstyle.hxx 1970-01-01 08:00:00.000000000 +0800
26713 +++ lotuswordpro/source/filter/xfilter/xfsectionstyle.hxx 2008-10-22 11:42:34.000000000 +0800
26714 @@ -0,0 +1,107 @@
26715 +/*************************************************************************
26717 + * The Contents of this file are made available subject to the terms of
26718 + * either of the following licenses
26720 + * - GNU Lesser General Public License Version 2.1
26721 + * - Sun Industry Standards Source License Version 1.1
26723 + * Sun Microsystems Inc., October, 2000
26725 + * GNU Lesser General Public License Version 2.1
26726 + * =============================================
26727 + * Copyright 2000 by Sun Microsystems, Inc.
26728 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
26730 + * This library is free software; you can redistribute it and/or
26731 + * modify it under the terms of the GNU Lesser General Public
26732 + * License version 2.1, as published by the Free Software Foundation.
26734 + * This library is distributed in the hope that it will be useful,
26735 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
26736 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
26737 + * Lesser General Public License for more details.
26739 + * You should have received a copy of the GNU Lesser General Public
26740 + * License along with this library; if not, write to the Free Software
26741 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
26742 + * MA 02111-1307 USA
26745 + * Sun Industry Standards Source License Version 1.1
26746 + * =================================================
26747 + * The contents of this file are subject to the Sun Industry Standards
26748 + * Source License Version 1.1 (the "License"); You may not use this file
26749 + * except in compliance with the License. You may obtain a copy of the
26750 + * License at http://www.openoffice.org/license.html.
26752 + * Software provided under this License is provided on an "AS IS" basis,
26753 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
26754 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
26755 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
26756 + * See the License for the specific provisions governing your rights and
26757 + * obligations concerning the Software.
26759 + * The Initial Developer of the Original Code is: IBM Corporation
26761 + * Copyright: 2008 by IBM Corporation
26763 + * All Rights Reserved.
26765 + * Contributor(s): _______________________________________
26768 + ************************************************************************/
26769 +/*************************************************************************
26770 + * @file
26771 + * Section style,whose family is "section"
26772 + ************************************************************************/
26773 +/*************************************************************************
26774 + * Change History
26775 + * 2005-01-10 create this file.
26776 + ************************************************************************/
26777 +#ifndef _XFSECTIONSTYLE_HXX
26778 +#define _XFSECTIONSTYLE_HXX
26780 +#include "xfglobal.hxx"
26781 +#include "xfstyle.hxx"
26782 +#include "xfbgimage.hxx"
26783 +#include "xfcolor.hxx"
26785 +class XFColumns;
26787 + * @descr
26788 + * Section style, include background color,background image, columns and margins.
26789 + */
26790 +class XFSectionStyle : public XFStyle
26792 +public:
26793 + XFSectionStyle();
26795 + virtual ~XFSectionStyle();
26797 +public:
26798 + void SetMarginLeft(double left);
26800 + void SetMarginRight(double right);
26802 + void SetBackColor(const XFColor& color);
26804 + void SetColumns(XFColumns *pColumns);
26806 + void SetBackImage(XFBGImage *image);
26808 + virtual enumXFStyle GetStyleFamily();
26810 + virtual void ToXml(IXFStream *pStrm);
26812 +private:
26813 + double m_fMarginLeft;
26814 + double m_fMarginRight;
26815 + XFColor m_aBackColor;
26816 + XFColumns *m_pColumns;
26817 + XFBGImage *m_pBackImage;
26820 +#endif
26822 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfshadow.cxx lotuswordpro/source/filter/xfilter/xfshadow.cxx
26823 --- lotuswordpro.bak/source/filter/xfilter/xfshadow.cxx 1970-01-01 08:00:00.000000000 +0800
26824 +++ lotuswordpro/source/filter/xfilter/xfshadow.cxx 2008-10-22 11:42:34.000000000 +0800
26825 @@ -0,0 +1,128 @@
26826 +/*************************************************************************
26828 + * The Contents of this file are made available subject to the terms of
26829 + * either of the following licenses
26831 + * - GNU Lesser General Public License Version 2.1
26832 + * - Sun Industry Standards Source License Version 1.1
26834 + * Sun Microsystems Inc., October, 2000
26836 + * GNU Lesser General Public License Version 2.1
26837 + * =============================================
26838 + * Copyright 2000 by Sun Microsystems, Inc.
26839 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
26841 + * This library is free software; you can redistribute it and/or
26842 + * modify it under the terms of the GNU Lesser General Public
26843 + * License version 2.1, as published by the Free Software Foundation.
26845 + * This library is distributed in the hope that it will be useful,
26846 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
26847 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
26848 + * Lesser General Public License for more details.
26850 + * You should have received a copy of the GNU Lesser General Public
26851 + * License along with this library; if not, write to the Free Software
26852 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
26853 + * MA 02111-1307 USA
26856 + * Sun Industry Standards Source License Version 1.1
26857 + * =================================================
26858 + * The contents of this file are subject to the Sun Industry Standards
26859 + * Source License Version 1.1 (the "License"); You may not use this file
26860 + * except in compliance with the License. You may obtain a copy of the
26861 + * License at http://www.openoffice.org/license.html.
26863 + * Software provided under this License is provided on an "AS IS" basis,
26864 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
26865 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
26866 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
26867 + * See the License for the specific provisions governing your rights and
26868 + * obligations concerning the Software.
26870 + * The Initial Developer of the Original Code is: IBM Corporation
26872 + * Copyright: 2008 by IBM Corporation
26874 + * All Rights Reserved.
26876 + * Contributor(s): _______________________________________
26879 + ************************************************************************/
26880 +/*************************************************************************
26881 + * @file
26882 + * Shadow object,now only used by paragraph object.
26883 + ************************************************************************/
26884 +/*************************************************************************
26885 + * Change History
26886 + * 2004-12-23 create this file.
26887 + ************************************************************************/
26888 +#include "xfshadow.hxx"
26890 +XFShadow::XFShadow():m_aColor(128,128,0)
26892 + m_ePosition = enumXFShadowNone;
26893 + m_fOffset = 0.18;
26896 +XFShadow::~XFShadow()
26900 +rtl::OUString XFShadow::ToString()
26902 + rtl::OUString buf;
26903 + rtl::OUString strOff = DoubleToOUString(m_fOffset);
26905 + buf = m_aColor.ToString();
26906 + switch(m_ePosition)
26908 + case enumXFShadowRightBottom:
26909 + buf += A2OUSTR(" ") + strOff + A2OUSTR("cm") + A2OUSTR(" ") + strOff + A2OUSTR("cm");
26910 + break;
26911 + case enumXFShadowRightTop:
26912 + buf += A2OUSTR(" ") + strOff + A2OUSTR("cm") + A2OUSTR(" -") + strOff + A2OUSTR("cm");
26913 + break;
26914 + case enumXFShadowLeftBottom:
26915 + buf += A2OUSTR(" -") + strOff + A2OUSTR("cm") + A2OUSTR(" ") + strOff + A2OUSTR("cm");
26916 + break;
26917 + case enumXFShadowLeftTop:
26918 + buf += A2OUSTR(" -") + strOff + A2OUSTR("cm") + A2OUSTR(" -") + strOff + A2OUSTR("cm");
26919 + break;
26922 + return buf;
26925 +void XFShadow::Reset()
26927 + m_ePosition = enumXFShadowNone;
26928 + m_fOffset = 0;
26931 +void XFShadow::ToXml(IXFStream *pStrm)
26933 + IXFAttrList *pAttrList = pStrm->GetAttrList();
26934 + if( m_ePosition == enumXFShadowNone )
26935 + return;
26936 + else
26937 + pAttrList->AddAttribute( A2OUSTR("style:shadow"), ToString() );
26940 +sal_Bool operator==(XFShadow& s1, XFShadow& s2)
26942 + if( (s1.m_ePosition == s2.m_ePosition) &&
26943 + (s1.m_fOffset == s2.m_fOffset) &&
26944 + (s1.m_aColor == s2.m_aColor)
26946 + return sal_True;
26947 + return sal_False;
26950 +sal_Bool operator!=(XFShadow& s1, XFShadow& s2)
26952 + return !(s1==s2);
26954 \ No newline at end of file
26955 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfshadow.hxx lotuswordpro/source/filter/xfilter/xfshadow.hxx
26956 --- lotuswordpro.bak/source/filter/xfilter/xfshadow.hxx 1970-01-01 08:00:00.000000000 +0800
26957 +++ lotuswordpro/source/filter/xfilter/xfshadow.hxx 2008-10-22 11:42:34.000000000 +0800
26958 @@ -0,0 +1,157 @@
26959 +/*************************************************************************
26961 + * The Contents of this file are made available subject to the terms of
26962 + * either of the following licenses
26964 + * - GNU Lesser General Public License Version 2.1
26965 + * - Sun Industry Standards Source License Version 1.1
26967 + * Sun Microsystems Inc., October, 2000
26969 + * GNU Lesser General Public License Version 2.1
26970 + * =============================================
26971 + * Copyright 2000 by Sun Microsystems, Inc.
26972 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
26974 + * This library is free software; you can redistribute it and/or
26975 + * modify it under the terms of the GNU Lesser General Public
26976 + * License version 2.1, as published by the Free Software Foundation.
26978 + * This library is distributed in the hope that it will be useful,
26979 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
26980 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
26981 + * Lesser General Public License for more details.
26983 + * You should have received a copy of the GNU Lesser General Public
26984 + * License along with this library; if not, write to the Free Software
26985 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
26986 + * MA 02111-1307 USA
26989 + * Sun Industry Standards Source License Version 1.1
26990 + * =================================================
26991 + * The contents of this file are subject to the Sun Industry Standards
26992 + * Source License Version 1.1 (the "License"); You may not use this file
26993 + * except in compliance with the License. You may obtain a copy of the
26994 + * License at http://www.openoffice.org/license.html.
26996 + * Software provided under this License is provided on an "AS IS" basis,
26997 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
26998 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
26999 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
27000 + * See the License for the specific provisions governing your rights and
27001 + * obligations concerning the Software.
27003 + * The Initial Developer of the Original Code is: IBM Corporation
27005 + * Copyright: 2008 by IBM Corporation
27007 + * All Rights Reserved.
27009 + * Contributor(s): _______________________________________
27012 + ************************************************************************/
27013 +/*************************************************************************
27014 + * @file
27015 + * Shadow object,now only used by paragraph object.
27016 + ************************************************************************/
27017 +/*************************************************************************
27018 + * Change History
27019 + * 2004-12-23 create this file.
27020 + ************************************************************************/
27021 +#ifndef _XFSHADOW_HXX
27022 +#define _XFSHADOW_HXX
27024 +#include "xfglobal.hxx"
27025 +#include "ixfproperty.hxx"
27026 +#include "xfcolor.hxx"
27028 +/**
27029 + * @brief
27030 + * Shadow object.
27031 + */
27032 +class XFShadow : public IXFProperty
27034 +public:
27035 + XFShadow();
27037 + virtual ~XFShadow();
27039 +public:
27040 + /**
27041 + * @descr set shadow position. You can refer to enumXFShadowPos to get all posible positions.
27042 + */
27043 + void SetPosition(enumXFShadowPos pos);
27045 + /**
27046 + * @descr return shadow position.
27047 + */
27048 + enumXFShadowPos GetPosition();
27050 + /**
27051 + * @descr Set shadow offset from owner obejct.
27052 + */
27053 + void SetOffset(double offset);
27055 + /**
27056 + * @descr return shadow offset.
27057 + */
27058 + double GetOffset();
27060 + /**
27061 + * @descr Set shadow color.
27062 + */
27063 + void SetColor(const XFColor& color);
27065 + /**
27066 + * @descr return shadow color.
27067 + */
27068 + XFColor GetColor();
27070 + void Reset();
27072 + rtl::OUString ToString();
27074 + virtual void ToXml(IXFStream *pStrm);
27076 + friend sal_Bool operator==(XFShadow& s1, XFShadow& s2);
27077 + friend sal_Bool operator!=(XFShadow& s1, XFShadow& s2);
27078 +private:
27079 + enumXFShadowPos m_ePosition;
27080 + double m_fOffset;
27081 + XFColor m_aColor;
27085 +inline void XFShadow::SetPosition(enumXFShadowPos pos)
27087 + m_ePosition = pos;
27090 +inline enumXFShadowPos XFShadow::GetPosition()
27092 + return m_ePosition;
27095 +inline void XFShadow::SetOffset(double offset)
27097 + m_fOffset = offset;
27100 +inline double XFShadow::GetOffset()
27102 + return m_fOffset;
27105 +inline void XFShadow::SetColor(const XFColor& color)
27107 + m_aColor = color;
27110 +inline XFColor XFShadow::GetColor()
27112 + return m_aColor;
27115 +#endif
27116 \ No newline at end of file
27117 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfstylecont.cxx lotuswordpro/source/filter/xfilter/xfstylecont.cxx
27118 --- lotuswordpro.bak/source/filter/xfilter/xfstylecont.cxx 1970-01-01 08:00:00.000000000 +0800
27119 +++ lotuswordpro/source/filter/xfilter/xfstylecont.cxx 2008-10-22 11:42:34.000000000 +0800
27120 @@ -0,0 +1,299 @@
27121 +/*************************************************************************
27123 + * The Contents of this file are made available subject to the terms of
27124 + * either of the following licenses
27126 + * - GNU Lesser General Public License Version 2.1
27127 + * - Sun Industry Standards Source License Version 1.1
27129 + * Sun Microsystems Inc., October, 2000
27131 + * GNU Lesser General Public License Version 2.1
27132 + * =============================================
27133 + * Copyright 2000 by Sun Microsystems, Inc.
27134 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
27136 + * This library is free software; you can redistribute it and/or
27137 + * modify it under the terms of the GNU Lesser General Public
27138 + * License version 2.1, as published by the Free Software Foundation.
27140 + * This library is distributed in the hope that it will be useful,
27141 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
27142 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27143 + * Lesser General Public License for more details.
27145 + * You should have received a copy of the GNU Lesser General Public
27146 + * License along with this library; if not, write to the Free Software
27147 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27148 + * MA 02111-1307 USA
27151 + * Sun Industry Standards Source License Version 1.1
27152 + * =================================================
27153 + * The contents of this file are subject to the Sun Industry Standards
27154 + * Source License Version 1.1 (the "License"); You may not use this file
27155 + * except in compliance with the License. You may obtain a copy of the
27156 + * License at http://www.openoffice.org/license.html.
27158 + * Software provided under this License is provided on an "AS IS" basis,
27159 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
27160 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
27161 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
27162 + * See the License for the specific provisions governing your rights and
27163 + * obligations concerning the Software.
27165 + * The Initial Developer of the Original Code is: IBM Corporation
27167 + * Copyright: 2008 by IBM Corporation
27169 + * All Rights Reserved.
27171 + * Contributor(s): _______________________________________
27174 + ************************************************************************/
27175 +/*************************************************************************
27176 + * @file
27177 + * Font object to serial to xml filter.
27178 + ************************************************************************/
27179 +/*************************************************************************
27180 + * Change History
27181 + * 2004-12-23 create this file.
27182 + ************************************************************************/
27183 +#include "xfstylecont.hxx"
27184 +#include "ixfstyle.hxx"
27185 +#include "xffont.hxx"
27186 +#include "xftextstyle.hxx"
27187 +#include "xfparastyle.hxx"
27188 +#include "xffontfactory.hxx"
27189 +#include "../lwpglobalmgr.hxx"
27191 +XFStyleContainer::XFStyleContainer(const rtl::OUString& strStyleNamePrefix)
27192 + :m_strStyleNamePrefix(strStyleNamePrefix)
27196 +XFStyleContainer::XFStyleContainer(const XFStyleContainer& other)
27197 + :m_strStyleNamePrefix(other.m_strStyleNamePrefix)
27199 + this->m_aStyles = other.m_aStyles;
27202 +XFStyleContainer& XFStyleContainer::operator=(const XFStyleContainer& other)
27204 + this->m_strStyleNamePrefix = other.m_strStyleNamePrefix;
27205 + this->m_aStyles = other.m_aStyles;
27206 + return *this;
27209 +XFStyleContainer::~XFStyleContainer()
27211 + std::vector<IXFStyle*>::iterator it;
27212 + for( it = m_aStyles.begin(); it != m_aStyles.end(); it++ )
27214 + IXFStyle *pStyle = *it;
27215 + if( pStyle )
27216 + delete pStyle;
27221 +void XFStyleContainer::Reset()
27223 + std::vector<IXFStyle*>::iterator it;
27225 + for( it = m_aStyles.begin(); it != m_aStyles.end(); it++ )
27227 + IXFStyle *pStyle = *it;
27228 + if( pStyle )
27229 + delete pStyle;
27231 + m_aStyles.clear();
27234 +IXFStyle* XFStyleContainer::AddStyle(IXFStyle *pStyle)
27236 + IXFStyle *pConStyle = NULL;
27237 + rtl::OUString name;
27239 + if( !pStyle )
27240 + return NULL;
27241 + //no matter we want to delete the style or not,XFFont obejct should be saved first.
27242 + ManageStyleFont(pStyle);
27244 + if( pStyle->GetStyleName().getLength()==0 )
27245 + pConStyle = FindSameStyle(pStyle);
27247 + if( pConStyle )//such a style has exist:
27249 + delete pStyle;
27250 + return pConStyle;
27252 + else
27254 + if( pStyle->GetStyleName().getLength() == 0 )
27256 + name = m_strStyleNamePrefix + Int32ToOUString(m_aStyles.size()+1);
27257 + pStyle->SetStyleName(name);
27259 + else
27261 + name = pStyle->GetStyleName();
27262 + //for name conflict
27263 + if(FindStyle( name))
27265 + name = name + Int32ToOUString(m_aStyles.size()+1);
27266 + pStyle->SetStyleName(name);
27271 + m_aStyles.push_back(pStyle);
27272 + //transform the font object to XFFontFactory
27274 + return pStyle;
27275 + }
27278 +IXFStyle* XFStyleContainer::FindSameStyle(IXFStyle *pStyle)
27280 + std::vector<IXFStyle*>::iterator it;
27281 + for( it = m_aStyles.begin(); it != m_aStyles.end(); it++ )
27283 + IXFStyle *pConStyle = *it;
27284 + if( !pConStyle )
27285 + continue;
27287 + if( pConStyle->Equal(pStyle) )
27288 + return pConStyle;
27291 + return NULL;
27294 +IXFStyle* XFStyleContainer::FindStyle(rtl::OUString name)
27296 + std::vector<IXFStyle*>::iterator it;
27297 + for( it = m_aStyles.begin(); it != m_aStyles.end(); it++ )
27299 + IXFStyle *pConStyle = *it;
27300 + if( !pConStyle )
27301 + continue;
27303 + if( pConStyle->GetStyleName() == name )
27304 + return pConStyle;
27307 + return NULL;
27310 +IXFStyle* XFStyleContainer::Item(int index)
27312 + assert(index>=0&&index<m_aStyles.size());
27313 + if( index >=0 && index < m_aStyles.size() )
27315 + return m_aStyles[index];
27317 + return NULL;
27320 +void XFStyleContainer::ToXml(IXFStream *pStrm)
27322 + std::vector<IXFStyle*>::iterator it;
27324 + for( it = m_aStyles.begin(); it != m_aStyles.end(); it++ )
27326 + IXFStyle *pStyle = *it;
27328 + assert(pStyle);
27329 + if( !pStyle )
27330 + continue;
27332 + pStyle->ToXml(pStrm);
27337 +void XFStyleContainer::ManageStyleFont(IXFStyle *pStyle)
27339 + XFFont *pStyleFont = NULL;
27340 + XFFont *pFactoryFont = NULL;
27342 + if( !pStyle )
27343 + return;
27345 + if( pStyle->GetStyleFamily() == enumXFStyleText )
27347 + XFTextStyle *pTS = (XFTextStyle*)pStyle;
27348 + pStyleFont = pTS->GetFont();
27349 + if( !pStyleFont )
27350 + return;
27351 + LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance();
27352 + XFFontFactory* pFontFactory = pGlobal->GetXFFontFactory();
27353 + pFactoryFont = pFontFactory->FindSameFont(pStyleFont);
27354 + //this font has been exists in the factory:
27355 + if( pFactoryFont )
27357 + pTS->SetFont(pFactoryFont);
27358 + if( pStyleFont != pFactoryFont )
27359 + delete pStyleFont;
27361 + else
27363 + pFontFactory->AddFont(pStyleFont);
27366 + else if( pStyle->GetStyleFamily() == enumXFStylePara )
27368 + XFParaStyle *pPS = (XFParaStyle*)pStyle;
27369 + pStyleFont = pPS->GetFont();
27370 + if( !pStyleFont )
27371 + return;
27372 + LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance();
27373 + XFFontFactory* pFontFactory = pGlobal->GetXFFontFactory();
27374 + pFactoryFont = pFontFactory->FindSameFont(pStyleFont);
27375 + //this font has been exists in the factory:
27376 + if( pFactoryFont )
27378 + pPS->SetFont(pFactoryFont);
27379 + if( pFactoryFont != pStyleFont )
27380 + delete pStyleFont;
27382 + else
27384 + pFontFactory->AddFont(pStyleFont);
27386 + }
27389 +bool operator==(XFStyleContainer& b1, XFStyleContainer& b2)
27391 + if( b1.m_strStyleNamePrefix != b2.m_strStyleNamePrefix )
27392 + return false;
27393 + if( b1.m_aStyles.size() != b2.m_aStyles.size() )
27394 + return false;
27395 + for( int i=0; i<b1.m_aStyles.size(); i++ )
27397 + IXFStyle *pS1 = b1.m_aStyles[i];
27398 + IXFStyle *pS2 = b2.m_aStyles[i];
27400 + if( pS1 )
27402 + if( !pS2 )
27403 + return false;
27404 + if( !pS1->Equal(pS2) )
27405 + return false;
27407 + else
27409 + if( pS2 )
27410 + return false;
27413 + return true;
27416 +bool operator!=(XFStyleContainer& b1, XFStyleContainer& b2)
27418 + return !(b1==b2);
27420 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfstylecont.hxx lotuswordpro/source/filter/xfilter/xfstylecont.hxx
27421 --- lotuswordpro.bak/source/filter/xfilter/xfstylecont.hxx 1970-01-01 08:00:00.000000000 +0800
27422 +++ lotuswordpro/source/filter/xfilter/xfstylecont.hxx 2008-10-22 11:42:34.000000000 +0800
27423 @@ -0,0 +1,140 @@
27424 +/*************************************************************************
27426 + * The Contents of this file are made available subject to the terms of
27427 + * either of the following licenses
27429 + * - GNU Lesser General Public License Version 2.1
27430 + * - Sun Industry Standards Source License Version 1.1
27432 + * Sun Microsystems Inc., October, 2000
27434 + * GNU Lesser General Public License Version 2.1
27435 + * =============================================
27436 + * Copyright 2000 by Sun Microsystems, Inc.
27437 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
27439 + * This library is free software; you can redistribute it and/or
27440 + * modify it under the terms of the GNU Lesser General Public
27441 + * License version 2.1, as published by the Free Software Foundation.
27443 + * This library is distributed in the hope that it will be useful,
27444 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
27445 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27446 + * Lesser General Public License for more details.
27448 + * You should have received a copy of the GNU Lesser General Public
27449 + * License along with this library; if not, write to the Free Software
27450 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27451 + * MA 02111-1307 USA
27454 + * Sun Industry Standards Source License Version 1.1
27455 + * =================================================
27456 + * The contents of this file are subject to the Sun Industry Standards
27457 + * Source License Version 1.1 (the "License"); You may not use this file
27458 + * except in compliance with the License. You may obtain a copy of the
27459 + * License at http://www.openoffice.org/license.html.
27461 + * Software provided under this License is provided on an "AS IS" basis,
27462 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
27463 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
27464 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
27465 + * See the License for the specific provisions governing your rights and
27466 + * obligations concerning the Software.
27468 + * The Initial Developer of the Original Code is: IBM Corporation
27470 + * Copyright: 2008 by IBM Corporation
27472 + * All Rights Reserved.
27474 + * Contributor(s): _______________________________________
27477 + ************************************************************************/
27478 +/*************************************************************************
27479 + * @file
27480 + * Style container,which response for special style,ie. text style.
27481 + ************************************************************************/
27482 +/*************************************************************************
27483 + * Change History
27484 + * 2004-12-23 create this file.
27485 + ************************************************************************/
27486 +#ifndef _XFSTYLECONTAINER_HXX
27487 +#define _XFSTYLECONTAINER_HXX
27489 +#include "xfglobal.hxx"
27490 +#include <vector>
27492 +class IXFStyle;
27494 +/**
27495 + * @descr container obejct for styles.
27496 + * All styles can be placed into an style container.
27497 + */
27498 +class XFStyleContainer : public IXFObject
27500 +public:
27501 + XFStyleContainer(){};
27503 + XFStyleContainer(const rtl::OUString& strStyleNamePrefix);
27505 + XFStyleContainer(const XFStyleContainer& other);
27507 + XFStyleContainer& operator=(const XFStyleContainer& other);
27509 + virtual ~XFStyleContainer();
27511 +public:
27512 + /**
27513 + * @descr Add style to container.
27514 + * If the same style has exist, then pStyle will be deleted, and the same style will be return.
27515 + */
27516 + IXFStyle* AddStyle(IXFStyle *pStyle);
27518 + /**
27519 + * @descr Find the same style.
27520 + */
27521 + IXFStyle* FindSameStyle(IXFStyle *pStyle);
27523 + /**
27524 + * @descr get style by name.
27525 + */
27526 + IXFStyle* FindStyle(rtl::OUString name);
27528 + /**
27529 + * @descr clear container.
27530 + */
27531 + void Reset();
27533 + /**
27534 + * @descr get count of styles in the container.
27535 + */
27536 + sal_Int32 GetCount();
27538 + /**
27539 + * @descr get style by index.
27540 + */
27541 + IXFStyle* Item(int index);
27543 + /**
27544 + * @descr Output all style.
27545 + */
27546 + virtual void ToXml(IXFStream *pStrm);
27548 + friend bool operator==(XFStyleContainer& b1, XFStyleContainer& b2);
27549 + friend bool operator!=(XFStyleContainer& b1, XFStyleContainer& b2);
27550 +private:
27551 + static void ManageStyleFont(IXFStyle *pStyle);
27552 +private:
27553 + std::vector<IXFStyle*> m_aStyles;
27554 + rtl::OUString m_strStyleNamePrefix;
27557 +inline sal_Int32 XFStyleContainer::GetCount()
27559 + return m_aStyles.size();
27562 +#endif
27564 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfstyle.cxx lotuswordpro/source/filter/xfilter/xfstyle.cxx
27565 --- lotuswordpro.bak/source/filter/xfilter/xfstyle.cxx 1970-01-01 08:00:00.000000000 +0800
27566 +++ lotuswordpro/source/filter/xfilter/xfstyle.cxx 2008-10-22 11:42:34.000000000 +0800
27567 @@ -0,0 +1,107 @@
27568 +/*************************************************************************
27570 + * The Contents of this file are made available subject to the terms of
27571 + * either of the following licenses
27573 + * - GNU Lesser General Public License Version 2.1
27574 + * - Sun Industry Standards Source License Version 1.1
27576 + * Sun Microsystems Inc., October, 2000
27578 + * GNU Lesser General Public License Version 2.1
27579 + * =============================================
27580 + * Copyright 2000 by Sun Microsystems, Inc.
27581 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
27583 + * This library is free software; you can redistribute it and/or
27584 + * modify it under the terms of the GNU Lesser General Public
27585 + * License version 2.1, as published by the Free Software Foundation.
27587 + * This library is distributed in the hope that it will be useful,
27588 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
27589 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27590 + * Lesser General Public License for more details.
27592 + * You should have received a copy of the GNU Lesser General Public
27593 + * License along with this library; if not, write to the Free Software
27594 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27595 + * MA 02111-1307 USA
27598 + * Sun Industry Standards Source License Version 1.1
27599 + * =================================================
27600 + * The contents of this file are subject to the Sun Industry Standards
27601 + * Source License Version 1.1 (the "License"); You may not use this file
27602 + * except in compliance with the License. You may obtain a copy of the
27603 + * License at http://www.openoffice.org/license.html.
27605 + * Software provided under this License is provided on an "AS IS" basis,
27606 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
27607 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
27608 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
27609 + * See the License for the specific provisions governing your rights and
27610 + * obligations concerning the Software.
27612 + * The Initial Developer of the Original Code is: IBM Corporation
27614 + * Copyright: 2008 by IBM Corporation
27616 + * All Rights Reserved.
27618 + * Contributor(s): _______________________________________
27621 + ************************************************************************/
27622 +/*************************************************************************
27623 + * @file
27624 + * Base style object .
27625 + ************************************************************************/
27626 +/*************************************************************************
27627 + * Change History
27628 + * 2004-12-28 create this file.
27629 + ************************************************************************/
27630 +#include "xfstyle.hxx"
27632 +XFStyle::XFStyle()
27637 +XFStyle::~XFStyle()
27641 +rtl::OUString XFStyle::GetStyleName()
27643 + return m_strStyleName;
27646 +void XFStyle::SetStyleName(const rtl::OUString& styleName)
27648 + m_strStyleName = styleName;
27651 +rtl::OUString XFStyle::GetParentStyleName()
27653 + return m_strParentStyleName;
27656 +void XFStyle::SetParentStyleName(const rtl::OUString& styleName)
27658 + m_strParentStyleName = styleName;
27661 +enumXFStyle XFStyle::GetStyleFamily()
27663 + return enumXFStyleUnknown;
27666 +void XFStyle::SetStyleFamily(enumXFStyle family)
27668 + m_enumFamily = family;
27671 +sal_Bool XFStyle::Equal(IXFStyle *pStyle)
27673 + return sal_False;
27675 \ No newline at end of file
27676 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfstylefamily.hxx lotuswordpro/source/filter/xfilter/xfstylefamily.hxx
27677 --- lotuswordpro.bak/source/filter/xfilter/xfstylefamily.hxx 1970-01-01 08:00:00.000000000 +0800
27678 +++ lotuswordpro/source/filter/xfilter/xfstylefamily.hxx 2008-10-22 11:42:34.000000000 +0800
27679 @@ -0,0 +1,72 @@
27680 +/*************************************************************************
27682 + * The Contents of this file are made available subject to the terms of
27683 + * either of the following licenses
27685 + * - GNU Lesser General Public License Version 2.1
27686 + * - Sun Industry Standards Source License Version 1.1
27688 + * Sun Microsystems Inc., October, 2000
27690 + * GNU Lesser General Public License Version 2.1
27691 + * =============================================
27692 + * Copyright 2000 by Sun Microsystems, Inc.
27693 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
27695 + * This library is free software; you can redistribute it and/or
27696 + * modify it under the terms of the GNU Lesser General Public
27697 + * License version 2.1, as published by the Free Software Foundation.
27699 + * This library is distributed in the hope that it will be useful,
27700 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
27701 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27702 + * Lesser General Public License for more details.
27704 + * You should have received a copy of the GNU Lesser General Public
27705 + * License along with this library; if not, write to the Free Software
27706 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27707 + * MA 02111-1307 USA
27710 + * Sun Industry Standards Source License Version 1.1
27711 + * =================================================
27712 + * The contents of this file are subject to the Sun Industry Standards
27713 + * Source License Version 1.1 (the "License"); You may not use this file
27714 + * except in compliance with the License. You may obtain a copy of the
27715 + * License at http://www.openoffice.org/license.html.
27717 + * Software provided under this License is provided on an "AS IS" basis,
27718 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
27719 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
27720 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
27721 + * See the License for the specific provisions governing your rights and
27722 + * obligations concerning the Software.
27724 + * The Initial Developer of the Original Code is: IBM Corporation
27726 + * Copyright: 2008 by IBM Corporation
27728 + * All Rights Reserved.
27730 + * Contributor(s): _______________________________________
27733 + ************************************************************************/
27734 +#ifndef _XFSTYLEFAMILY_HXX
27735 +#define _XFSTYLEFAMILY_HXX
27737 +enum enumXFStyleFamily
27739 + enumXFStyleUnknown,
27740 + enumXFStyleText,
27741 + enumXFStylePara,
27742 + enumXFStyleList,
27743 + enumXFStyleSection,
27744 + enumXFStyleGraphics,
27745 + enumXFStylePageMaster,
27746 + enumXFStyleMasterPage,
27747 + enumXFStyleDate
27750 +#endif
27752 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfstyle.hxx lotuswordpro/source/filter/xfilter/xfstyle.hxx
27753 --- lotuswordpro.bak/source/filter/xfilter/xfstyle.hxx 1970-01-01 08:00:00.000000000 +0800
27754 +++ lotuswordpro/source/filter/xfilter/xfstyle.hxx 2008-10-22 11:42:34.000000000 +0800
27755 @@ -0,0 +1,122 @@
27756 +/*************************************************************************
27758 + * The Contents of this file are made available subject to the terms of
27759 + * either of the following licenses
27761 + * - GNU Lesser General Public License Version 2.1
27762 + * - Sun Industry Standards Source License Version 1.1
27764 + * Sun Microsystems Inc., October, 2000
27766 + * GNU Lesser General Public License Version 2.1
27767 + * =============================================
27768 + * Copyright 2000 by Sun Microsystems, Inc.
27769 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
27771 + * This library is free software; you can redistribute it and/or
27772 + * modify it under the terms of the GNU Lesser General Public
27773 + * License version 2.1, as published by the Free Software Foundation.
27775 + * This library is distributed in the hope that it will be useful,
27776 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
27777 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27778 + * Lesser General Public License for more details.
27780 + * You should have received a copy of the GNU Lesser General Public
27781 + * License along with this library; if not, write to the Free Software
27782 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27783 + * MA 02111-1307 USA
27786 + * Sun Industry Standards Source License Version 1.1
27787 + * =================================================
27788 + * The contents of this file are subject to the Sun Industry Standards
27789 + * Source License Version 1.1 (the "License"); You may not use this file
27790 + * except in compliance with the License. You may obtain a copy of the
27791 + * License at http://www.openoffice.org/license.html.
27793 + * Software provided under this License is provided on an "AS IS" basis,
27794 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
27795 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
27796 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
27797 + * See the License for the specific provisions governing your rights and
27798 + * obligations concerning the Software.
27800 + * The Initial Developer of the Original Code is: IBM Corporation
27802 + * Copyright: 2008 by IBM Corporation
27804 + * All Rights Reserved.
27806 + * Contributor(s): _______________________________________
27809 + ************************************************************************/
27810 +/*************************************************************************
27811 + * @file
27812 + * Base style object .
27813 + ************************************************************************/
27814 +/*************************************************************************
27815 + * Change History
27816 + * 2004-12-28 create this file.
27817 + ************************************************************************/
27818 +#ifndef _XFSTYLE_HXX
27819 +#define _XFSTYLE_HXX
27821 +#include "ixfstyle.hxx"
27823 +/**
27824 + * @brief
27825 + * implements ixfstyle interface. This is the base class for all concentrate style.
27826 + */
27827 +class XFStyle : public IXFStyle
27829 +public:
27830 + XFStyle();
27832 + virtual ~XFStyle();
27834 +public:
27835 + /**
27836 + * @descr get style name.
27837 + */
27838 + virtual rtl::OUString GetStyleName();
27840 + /**
27841 + * @descr set style name.
27842 + */
27843 + virtual void SetStyleName(const rtl::OUString& styleName);
27845 + /**
27846 + * @descr Set parent style name.
27847 + */
27848 + virtual rtl::OUString GetParentStyleName();
27850 + /**
27851 + * @descr return parent style name.
27852 + */
27853 + virtual void SetParentStyleName(const rtl::OUString& styleName);
27855 + /**
27856 + * @descr get styel family.
27857 + */
27858 + virtual enumXFStyle GetStyleFamily();
27860 + /**
27861 + * @descr set style family.
27862 + */
27863 + virtual void SetStyleFamily(enumXFStyle family);
27865 + /**
27866 + * @descr decide whether two style are equal.
27867 + */
27868 + virtual sal_Bool Equal(IXFStyle *pStyle);
27870 +protected:
27871 + rtl::OUString m_strStyleName;
27872 + rtl::OUString m_strParentStyleName;
27873 + enumXFStyle m_enumFamily;
27876 +#endif
27878 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfstylemanager.cxx lotuswordpro/source/filter/xfilter/xfstylemanager.cxx
27879 --- lotuswordpro.bak/source/filter/xfilter/xfstylemanager.cxx 1970-01-01 08:00:00.000000000 +0800
27880 +++ lotuswordpro/source/filter/xfilter/xfstylemanager.cxx 2008-10-22 11:42:34.000000000 +0800
27881 @@ -0,0 +1,388 @@
27882 +/*************************************************************************
27884 + * The Contents of this file are made available subject to the terms of
27885 + * either of the following licenses
27887 + * - GNU Lesser General Public License Version 2.1
27888 + * - Sun Industry Standards Source License Version 1.1
27890 + * Sun Microsystems Inc., October, 2000
27892 + * GNU Lesser General Public License Version 2.1
27893 + * =============================================
27894 + * Copyright 2000 by Sun Microsystems, Inc.
27895 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
27897 + * This library is free software; you can redistribute it and/or
27898 + * modify it under the terms of the GNU Lesser General Public
27899 + * License version 2.1, as published by the Free Software Foundation.
27901 + * This library is distributed in the hope that it will be useful,
27902 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
27903 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27904 + * Lesser General Public License for more details.
27906 + * You should have received a copy of the GNU Lesser General Public
27907 + * License along with this library; if not, write to the Free Software
27908 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27909 + * MA 02111-1307 USA
27912 + * Sun Industry Standards Source License Version 1.1
27913 + * =================================================
27914 + * The contents of this file are subject to the Sun Industry Standards
27915 + * Source License Version 1.1 (the "License"); You may not use this file
27916 + * except in compliance with the License. You may obtain a copy of the
27917 + * License at http://www.openoffice.org/license.html.
27919 + * Software provided under this License is provided on an "AS IS" basis,
27920 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
27921 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
27922 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
27923 + * See the License for the specific provisions governing your rights and
27924 + * obligations concerning the Software.
27926 + * The Initial Developer of the Original Code is: IBM Corporation
27928 + * Copyright: 2008 by IBM Corporation
27930 + * All Rights Reserved.
27932 + * Contributor(s): _______________________________________
27935 + ************************************************************************/
27936 +/*************************************************************************
27937 + * @file
27938 + * Style manager for the filter.
27939 + ************************************************************************/
27940 +/*************************************************************************
27941 + * Change History
27942 + * 2004-12-23 create this file.
27943 + ************************************************************************/
27944 +#include "xfstylemanager.hxx"
27945 +#include "ixfstyle.hxx"
27947 +XFStyleManager::XFStyleManager() : s_aStdArrowStyles( A2OUSTR("arrow") ),s_aListStyles( A2OUSTR("L") ),
27948 + s_aTextStyles( A2OUSTR("T") ),s_aParaStyles( A2OUSTR("P") ),s_aSectionStyles( A2OUSTR("Sect") ),
27949 + s_aPageMasters( A2OUSTR("PM") ),s_aMasterpages( A2OUSTR("MP") ),s_aDateStyles( A2OUSTR("N") ),
27950 + s_aGraphicsStyles( A2OUSTR("fr") ),s_aTableStyles( A2OUSTR("table") ),s_aTableCellStyles( A2OUSTR("cell") ),
27951 + s_aTableRowStyles( A2OUSTR("row") ),s_aTableColStyles( A2OUSTR("col") ),s_pOutlineStyle(NULL)
27955 +XFStyleManager::~XFStyleManager()
27957 + Reset();
27960 +void XFStyleManager::Reset()
27962 + if( s_pOutlineStyle )
27964 + delete s_pOutlineStyle;
27965 + s_pOutlineStyle = NULL;
27968 + s_aStdTextStyles.Reset();
27969 + s_aStdParaStyles.Reset();
27970 + s_aStdStrokeDashStyles.Reset();
27971 + s_aStdAreaStyles.Reset();
27972 + s_aStdArrowStyles.Reset();
27973 + s_aTextStyles.Reset();
27974 + s_aParaStyles.Reset();
27975 + s_aListStyles.Reset();
27976 + s_aSectionStyles.Reset();
27977 + s_aPageMasters.Reset();
27978 + s_aMasterpages.Reset();
27979 + s_aDateStyles.Reset();
27980 + s_aGraphicsStyles.Reset();
27981 + s_aConfigManager.Reset();
27982 + //must clear all static containers.
27983 + s_aFontDecls.clear();
27986 +void XFStyleManager::AddFontDecl(rtl::OUString name, rtl::OUString family, sal_Bool fixed)
27988 + s_aFontDecls.push_back( XFFontDecl(name, family, fixed) );
27991 +void XFStyleManager::AddFontDecl(XFFontDecl& aFontDecl)
27993 + s_aFontDecls.push_back(aFontDecl);
27996 +IXFStyle* XFStyleManager::AddStyle(IXFStyle *pStyle)
27998 + assert(pStyle);
27999 + rtl::OUString name;
28000 + IXFStyle *pStyleRet = NULL;
28002 + if( !pStyle )
28003 + return NULL;
28004 + name = pStyle->GetStyleName();
28006 + if( pStyle->GetStyleFamily() == enumXFStyleText )
28008 + if( name.getLength() )
28010 + pStyleRet = s_aStdTextStyles.AddStyle(pStyle);
28012 + else
28013 + pStyleRet = s_aTextStyles.AddStyle(pStyle);
28015 + else if( pStyle->GetStyleFamily() == enumXFStylePara )
28017 + if( name.getLength() )
28019 + pStyleRet = s_aStdParaStyles.AddStyle(pStyle);
28021 + else
28022 + pStyleRet = s_aParaStyles.AddStyle(pStyle);
28024 + else if( pStyle->GetStyleFamily() == enumXFStyleDefaultPara )
28026 + pStyleRet = s_aStdParaStyles.AddStyle(pStyle);
28028 + else if( pStyle->GetStyleFamily() == enumXFStyleList )
28030 + pStyleRet = s_aListStyles.AddStyle(pStyle);
28032 + else if( pStyle->GetStyleFamily() == enumXFStyleSection )
28034 + pStyleRet = s_aSectionStyles.AddStyle(pStyle);
28036 + else if( pStyle->GetStyleFamily() == enumXFStylePageMaster )
28038 + pStyleRet = s_aPageMasters.AddStyle(pStyle);
28040 + else if( pStyle->GetStyleFamily() == enumXFStyleMasterPage )
28042 + //Master page don't need name.
28043 + pStyleRet = s_aMasterpages.AddStyle(pStyle);
28045 + else if( pStyle->GetStyleFamily() == enumXFStyleDate )
28047 + pStyleRet = s_aDateStyles.AddStyle(pStyle);
28049 + else if( pStyle->GetStyleFamily() == enumXFStyleTime )
28051 + pStyleRet = s_aDateStyles.AddStyle(pStyle);
28053 + else if( pStyle->GetStyleFamily() == enumXFStyleNumber )
28055 + pStyleRet = s_aDateStyles.AddStyle(pStyle);
28057 + else if( pStyle->GetStyleFamily() == enumXFStylePercent )
28059 + pStyleRet = s_aDateStyles.AddStyle(pStyle);
28061 + else if( pStyle->GetStyleFamily() == enumXFStyleCurrency )
28063 + pStyleRet = s_aDateStyles.AddStyle(pStyle);
28065 + else if( pStyle->GetStyleFamily() == enumXFStyleGraphics )
28067 + pStyleRet = s_aGraphicsStyles.AddStyle(pStyle);
28069 + else if( pStyle->GetStyleFamily() == enumXFStyleTable )
28071 + pStyleRet = s_aTableStyles.AddStyle(pStyle);
28073 + else if( pStyle->GetStyleFamily() == enumXFStyleTableCell )
28075 + pStyleRet = s_aTableCellStyles.AddStyle(pStyle);
28077 + else if( pStyle->GetStyleFamily() == enumXFStyleTableRow )
28079 + pStyleRet = s_aTableRowStyles.AddStyle(pStyle);
28081 + else if( pStyle->GetStyleFamily() == enumXFStyleTableCol )
28083 + pStyleRet = s_aTableColStyles.AddStyle(pStyle);
28085 + else if( pStyle->GetStyleFamily() == enumXFStyleOutline )
28087 + if( s_pOutlineStyle )
28088 + delete s_pOutlineStyle;
28089 + s_pOutlineStyle = pStyle;
28091 + else if( pStyle->GetStyleFamily() == enumXFStyleStrokeDash )
28093 + pStyleRet = s_aStdStrokeDashStyles.AddStyle(pStyle);
28095 + else if( pStyle->GetStyleFamily() == enumXFStyleArea )
28097 + pStyleRet = s_aStdAreaStyles.AddStyle(pStyle);
28099 + else if( pStyle->GetStyleFamily() == enumXFStyleArrow )
28101 + pStyleRet = s_aStdArrowStyles.AddStyle(pStyle);
28103 + else if (pStyle->GetStyleFamily() == enumXFStyleRuby)
28105 + pStyleRet = s_aRubyStyles.AddStyle(pStyle);
28108 + return pStyleRet;
28111 +IXFStyle* XFStyleManager::FindStyle(rtl::OUString name)
28113 + IXFStyle *pStyle = (IXFStyle*)FindParaStyle(name);
28114 + if( pStyle )
28115 + return pStyle;
28116 + pStyle = (IXFStyle*)FindTextStyle(name);
28117 + if( pStyle )
28118 + return pStyle;
28119 + pStyle = s_aListStyles.FindStyle(name);
28120 + if( pStyle )
28121 + return pStyle;
28122 + pStyle = s_aSectionStyles.FindStyle(name);
28123 + if( pStyle )
28124 + return pStyle;
28125 + pStyle = s_aPageMasters.FindStyle(name);
28126 + if( pStyle )
28127 + return pStyle;
28128 + pStyle = s_aMasterpages.FindStyle(name);
28129 + if( pStyle )
28130 + return pStyle;
28131 + pStyle = s_aDateStyles.FindStyle(name);
28132 + if( pStyle )
28133 + return pStyle;
28134 + pStyle = s_aGraphicsStyles.FindStyle(name);
28135 + if( pStyle )
28136 + return pStyle;
28137 + pStyle = s_aTableStyles.FindStyle(name);
28138 + if( pStyle )
28139 + return pStyle;
28140 + pStyle = s_aTableCellStyles.FindStyle(name);
28141 + if( pStyle )
28142 + return pStyle;
28143 + pStyle = s_aTableRowStyles.FindStyle(name);
28144 + if( pStyle )
28145 + return pStyle;
28146 + pStyle = s_aTableColStyles.FindStyle(name);
28147 + if( pStyle )
28148 + return pStyle;
28149 + if(s_pOutlineStyle && s_pOutlineStyle->GetStyleName() == name )
28150 + return s_pOutlineStyle;
28151 + pStyle = s_aStdStrokeDashStyles.FindStyle(name);
28152 + if( pStyle )
28153 + return pStyle;
28154 + pStyle = s_aStdAreaStyles.FindStyle(name);
28155 + if( pStyle )
28156 + return pStyle;
28157 + pStyle = s_aStdArrowStyles.FindStyle(name);
28158 + if( pStyle )
28159 + return pStyle;
28161 + return NULL;
28164 +XFParaStyle* XFStyleManager::FindParaStyle(rtl::OUString name)
28166 + IXFStyle *pStyle = s_aParaStyles.FindStyle(name);
28167 + if( pStyle )
28168 + return (XFParaStyle*)pStyle;
28169 + else
28170 + return (XFParaStyle*)s_aStdParaStyles.FindStyle(name);
28173 +XFTextStyle* XFStyleManager::FindTextStyle(rtl::OUString name)
28175 + IXFStyle *pStyle = s_aTextStyles.FindStyle(name);
28176 + if( pStyle )
28177 + return (XFTextStyle*)pStyle;
28178 + else
28179 + return (XFTextStyle*)s_aStdTextStyles.FindStyle(name);
28182 +void XFStyleManager::SetLineNumberConfig(XFLineNumberConfig *pLNConf)
28184 + s_aConfigManager.SetLineNumberConfig(pLNConf);
28187 +void XFStyleManager::SetFootnoteConfig(XFFootnoteConfig *pFNConfig)
28189 + s_aConfigManager.SetFootnoteConfig(pFNConfig);
28192 +void XFStyleManager::SetEndnoteConfig(XFEndnoteConfig *pENConfig)
28194 + s_aConfigManager.SetEndnoteConfig(pENConfig);
28197 +void XFStyleManager::ToXml(IXFStream *pStrm)
28199 + std::vector<XFFontDecl>::iterator itDecl;
28200 + IXFAttrList *pAttrList = pStrm->GetAttrList();
28202 + pAttrList->Clear();
28203 + pStrm->StartElement( A2OUSTR("office:font-decls") );
28205 + //font declarations:
28206 + for( itDecl = s_aFontDecls.begin(); itDecl != s_aFontDecls.end(); itDecl++ )
28208 + XFFontDecl &f = *itDecl;
28210 + pAttrList->Clear();
28211 + pAttrList->AddAttribute( A2OUSTR("style:name"), f.GetFontName() );
28212 + pAttrList->AddAttribute( A2OUSTR("fo:font-family"), f.GetFontFamily() );
28213 + if( f.GetFontPitchFixed() )
28214 + pAttrList->AddAttribute( A2OUSTR("style:font-pitch"), A2OUSTR("fixed") );
28215 + else
28216 + pAttrList->AddAttribute( A2OUSTR("style:font-pitch"), A2OUSTR("variable") );
28217 + pStrm->StartElement( A2OUSTR("style:font-decl") );
28218 + pStrm->EndElement( A2OUSTR("style:font-decl") );
28221 + pStrm->EndElement( A2OUSTR("office:font-decls") );
28223 + //office:styles:
28224 + pAttrList->Clear();
28225 + pStrm->StartElement( A2OUSTR("office:styles") );
28227 + s_aStdParaStyles.ToXml(pStrm);
28228 + s_aStdTextStyles.ToXml(pStrm);
28229 + s_aStdStrokeDashStyles.ToXml(pStrm);
28230 + s_aStdAreaStyles.ToXml(pStrm);
28231 + s_aStdArrowStyles.ToXml(pStrm);
28232 + //date,time styles:
28233 + s_aDateStyles.ToXml(pStrm);
28234 + s_aConfigManager.ToXml(pStrm);
28235 + //for optimist.
28236 + s_aListStyles.ToXml(pStrm);
28238 + if( s_pOutlineStyle )
28239 + s_pOutlineStyle->ToXml(pStrm);
28241 + pStrm->EndElement( A2OUSTR("office:styles") );
28243 + //automatic styles:
28244 + pAttrList->Clear();
28245 + pStrm->StartElement( A2OUSTR("office:automatic-styles") );
28247 + s_aTableStyles.ToXml(pStrm);
28248 + s_aTableCellStyles.ToXml(pStrm);
28249 + s_aTableRowStyles.ToXml(pStrm);
28250 + s_aTableColStyles.ToXml(pStrm);
28251 + s_aParaStyles.ToXml(pStrm);
28252 + s_aTextStyles.ToXml(pStrm);
28253 + s_aSectionStyles.ToXml(pStrm);
28254 + s_aPageMasters.ToXml(pStrm);
28255 + s_aRubyStyles.ToXml(pStrm);
28256 + //graphics:
28257 + s_aGraphicsStyles.ToXml(pStrm);
28259 + pStrm->EndElement( A2OUSTR("office:automatic-styles") );
28261 + //master:styles
28262 + pAttrList->Clear();
28263 + pStrm->StartElement( A2OUSTR("office:master-styles") );
28264 + //masters pages:
28265 + s_aMasterpages.ToXml(pStrm);
28267 + pStrm->EndElement( A2OUSTR("office:master-styles") );
28270 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfstylemanager.hxx lotuswordpro/source/filter/xfilter/xfstylemanager.hxx
28271 --- lotuswordpro.bak/source/filter/xfilter/xfstylemanager.hxx 1970-01-01 08:00:00.000000000 +0800
28272 +++ lotuswordpro/source/filter/xfilter/xfstylemanager.hxx 2008-10-22 11:42:34.000000000 +0800
28273 @@ -0,0 +1,149 @@
28274 +/*************************************************************************
28276 + * The Contents of this file are made available subject to the terms of
28277 + * either of the following licenses
28279 + * - GNU Lesser General Public License Version 2.1
28280 + * - Sun Industry Standards Source License Version 1.1
28282 + * Sun Microsystems Inc., October, 2000
28284 + * GNU Lesser General Public License Version 2.1
28285 + * =============================================
28286 + * Copyright 2000 by Sun Microsystems, Inc.
28287 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
28289 + * This library is free software; you can redistribute it and/or
28290 + * modify it under the terms of the GNU Lesser General Public
28291 + * License version 2.1, as published by the Free Software Foundation.
28293 + * This library is distributed in the hope that it will be useful,
28294 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
28295 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28296 + * Lesser General Public License for more details.
28298 + * You should have received a copy of the GNU Lesser General Public
28299 + * License along with this library; if not, write to the Free Software
28300 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
28301 + * MA 02111-1307 USA
28304 + * Sun Industry Standards Source License Version 1.1
28305 + * =================================================
28306 + * The contents of this file are subject to the Sun Industry Standards
28307 + * Source License Version 1.1 (the "License"); You may not use this file
28308 + * except in compliance with the License. You may obtain a copy of the
28309 + * License at http://www.openoffice.org/license.html.
28311 + * Software provided under this License is provided on an "AS IS" basis,
28312 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
28313 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
28314 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
28315 + * See the License for the specific provisions governing your rights and
28316 + * obligations concerning the Software.
28318 + * The Initial Developer of the Original Code is: IBM Corporation
28320 + * Copyright: 2008 by IBM Corporation
28322 + * All Rights Reserved.
28324 + * Contributor(s): _______________________________________
28327 + ************************************************************************/
28328 +/*************************************************************************
28329 + * @file
28330 + * Style manager for the filter.
28331 + ************************************************************************/
28332 +/*************************************************************************
28333 + * Change History
28334 + * 2004-12-23 create this file.
28335 + ************************************************************************/
28336 +#ifndef _XFSTYLEMANAGER_HXX
28337 +#define _XFSTYLEMANAGER_HXX
28339 +#include "xfglobal.hxx"
28340 +#include "xffontdecl.hxx"
28341 +#include "xfstylecont.hxx"
28342 +#include "xfconfigmanager.hxx"
28343 +#include <map>
28344 +#include <vector>
28346 +class IXFStream;
28347 +class IXFStyle;
28348 +class XFOutlineStyle;
28349 +class XFParaStyle;
28350 +class XFTextStyle;
28351 +class XFLineNumberConfig;
28352 +class XFFootnoteConfig;
28353 +class XFEndnoteConfig;
28355 +/**
28356 + * @brief
28357 + * Style manager for the filter.
28358 + * This is a global obejct, all styles will be placed here before output.
28359 + */
28360 +class XFStyleManager// : public IXFObject
28362 +public:
28363 + XFStyleManager();
28364 + ~XFStyleManager();
28365 + XFStyleManager(XFStyleManager& other){}
28367 + XFStyleManager operator=(XFStyleManager& other){}
28369 +public:
28370 + /**
28371 + * @descr clear all styles, called before load file.
28372 + */
28373 + void Reset();
28375 + void AddFontDecl(XFFontDecl& aFontDecl);
28377 + void AddFontDecl(rtl::OUString name, rtl::OUString family, sal_Bool fixed = false);
28379 + IXFStyle* AddStyle(IXFStyle *pStyle);
28381 + IXFStyle* FindStyle(rtl::OUString name);
28383 + XFParaStyle* FindParaStyle(rtl::OUString name);
28385 + XFTextStyle* FindTextStyle(rtl::OUString name);
28387 + void SetLineNumberConfig(XFLineNumberConfig *pLNConfig);
28389 + void SetFootnoteConfig(XFFootnoteConfig *pFNConfig);
28391 + void SetEndnoteConfig(XFEndnoteConfig *pFNConfig);
28393 + void ToXml(IXFStream *strm);
28395 +private:
28396 + std::vector<XFFontDecl> s_aFontDecls;
28397 + //standard styles that can be inherited,<office:styles>
28398 + XFStyleContainer s_aStdTextStyles;
28399 + XFStyleContainer s_aStdParaStyles;
28400 + XFStyleContainer s_aStdStrokeDashStyles;
28401 + XFStyleContainer s_aStdAreaStyles;
28402 + XFStyleContainer s_aStdArrowStyles;
28403 + XFConfigManager s_aConfigManager;
28404 + //automatic styles,<office:automatic-styles>
28405 + XFStyleContainer s_aTextStyles;
28406 + XFStyleContainer s_aParaStyles;
28407 + XFStyleContainer s_aListStyles;
28408 + XFStyleContainer s_aSectionStyles;
28409 + XFStyleContainer s_aPageMasters;
28410 + XFStyleContainer s_aMasterpages;
28411 + XFStyleContainer s_aDateStyles;
28412 + XFStyleContainer s_aGraphicsStyles;
28413 + XFStyleContainer s_aTableStyles;
28414 + XFStyleContainer s_aTableCellStyles;
28415 + XFStyleContainer s_aTableRowStyles;
28416 + XFStyleContainer s_aTableColStyles;
28417 + IXFStyle *s_pOutlineStyle;
28418 + XFStyleContainer s_aRubyStyles;
28421 +#endif
28423 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfsubject.hxx lotuswordpro/source/filter/xfilter/xfsubject.hxx
28424 --- lotuswordpro.bak/source/filter/xfilter/xfsubject.hxx 1970-01-01 08:00:00.000000000 +0800
28425 +++ lotuswordpro/source/filter/xfilter/xfsubject.hxx 2008-10-22 11:42:34.000000000 +0800
28426 @@ -0,0 +1,85 @@
28427 +/*************************************************************************
28429 + * The Contents of this file are made available subject to the terms of
28430 + * either of the following licenses
28432 + * - GNU Lesser General Public License Version 2.1
28433 + * - Sun Industry Standards Source License Version 1.1
28435 + * Sun Microsystems Inc., October, 2000
28437 + * GNU Lesser General Public License Version 2.1
28438 + * =============================================
28439 + * Copyright 2000 by Sun Microsystems, Inc.
28440 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
28442 + * This library is free software; you can redistribute it and/or
28443 + * modify it under the terms of the GNU Lesser General Public
28444 + * License version 2.1, as published by the Free Software Foundation.
28446 + * This library is distributed in the hope that it will be useful,
28447 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
28448 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28449 + * Lesser General Public License for more details.
28451 + * You should have received a copy of the GNU Lesser General Public
28452 + * License along with this library; if not, write to the Free Software
28453 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
28454 + * MA 02111-1307 USA
28457 + * Sun Industry Standards Source License Version 1.1
28458 + * =================================================
28459 + * The contents of this file are subject to the Sun Industry Standards
28460 + * Source License Version 1.1 (the "License"); You may not use this file
28461 + * except in compliance with the License. You may obtain a copy of the
28462 + * License at http://www.openoffice.org/license.html.
28464 + * Software provided under this License is provided on an "AS IS" basis,
28465 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
28466 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
28467 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
28468 + * See the License for the specific provisions governing your rights and
28469 + * obligations concerning the Software.
28471 + * The Initial Developer of the Original Code is: IBM Corporation
28473 + * Copyright: 2008 by IBM Corporation
28475 + * All Rights Reserved.
28477 + * Contributor(s): _______________________________________
28480 + ************************************************************************/
28481 +/*************************************************************************
28482 + * @file
28483 + * Page number field.
28484 + ************************************************************************/
28485 +/*************************************************************************
28486 + * Change History
28487 + * 2005-01-31 create this file.
28488 + ************************************************************************/
28489 +#ifndef _XFSUBJECT_HXX
28490 +#define _XFSUBJECT_HXX
28492 +#include "xfglobal.hxx"
28493 +#include "xfcontent.hxx"
28494 +#include "xfnumfmt.hxx"
28496 +class XFSubject : public XFContent
28498 +public:
28499 + virtual void ToXml(IXFStream *pStrm);
28502 +inline void XFSubject::ToXml(IXFStream *pStrm)
28504 + IXFAttrList *pAttrList = pStrm->GetAttrList();
28505 + pAttrList->Clear();
28507 + pStrm->StartElement( A2OUSTR("text:subject") );
28508 + pStrm->EndElement( A2OUSTR("text:subject") );
28511 +#endif
28512 \ No newline at end of file
28513 diff -urNp lotuswordpro.bak/source/filter/xfilter/xftable.cxx lotuswordpro/source/filter/xfilter/xftable.cxx
28514 --- lotuswordpro.bak/source/filter/xfilter/xftable.cxx 1970-01-01 08:00:00.000000000 +0800
28515 +++ lotuswordpro/source/filter/xfilter/xftable.cxx 2008-10-22 11:42:34.000000000 +0800
28516 @@ -0,0 +1,319 @@
28517 +/*************************************************************************
28519 + * The Contents of this file are made available subject to the terms of
28520 + * either of the following licenses
28522 + * - GNU Lesser General Public License Version 2.1
28523 + * - Sun Industry Standards Source License Version 1.1
28525 + * Sun Microsystems Inc., October, 2000
28527 + * GNU Lesser General Public License Version 2.1
28528 + * =============================================
28529 + * Copyright 2000 by Sun Microsystems, Inc.
28530 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
28532 + * This library is free software; you can redistribute it and/or
28533 + * modify it under the terms of the GNU Lesser General Public
28534 + * License version 2.1, as published by the Free Software Foundation.
28536 + * This library is distributed in the hope that it will be useful,
28537 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
28538 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28539 + * Lesser General Public License for more details.
28541 + * You should have received a copy of the GNU Lesser General Public
28542 + * License along with this library; if not, write to the Free Software
28543 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
28544 + * MA 02111-1307 USA
28547 + * Sun Industry Standards Source License Version 1.1
28548 + * =================================================
28549 + * The contents of this file are subject to the Sun Industry Standards
28550 + * Source License Version 1.1 (the "License"); You may not use this file
28551 + * except in compliance with the License. You may obtain a copy of the
28552 + * License at http://www.openoffice.org/license.html.
28554 + * Software provided under this License is provided on an "AS IS" basis,
28555 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
28556 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
28557 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
28558 + * See the License for the specific provisions governing your rights and
28559 + * obligations concerning the Software.
28561 + * The Initial Developer of the Original Code is: IBM Corporation
28563 + * Copyright: 2008 by IBM Corporation
28565 + * All Rights Reserved.
28567 + * Contributor(s): _______________________________________
28570 + ************************************************************************/
28571 +/*************************************************************************
28572 + * @file
28573 + * Table object.
28574 + ************************************************************************/
28575 +/*************************************************************************
28576 + * Change History
28577 + * 2005-01-24 create and implements.
28578 + ************************************************************************/
28579 +#include "xftable.hxx"
28580 +#include "xfrow.hxx"
28581 +#include "xfcolstyle.hxx"
28582 +#include "xfstylemanager.hxx"
28583 +#include <cassert>
28585 +XFTable::XFTable()
28587 + m_strName = XFGlobal::GenTableName();
28588 + m_bSubTable = sal_False;
28589 + m_pOwnerCell = NULL;
28592 +XFTable::XFTable(const XFTable& other)
28594 + m_strName = other.m_strName;
28595 + m_bSubTable = other.m_bSubTable;
28596 + m_pOwnerCell = NULL;
28597 + for( int i=1; i<=other.m_aHeaderRows.GetCount(); i++ )
28599 + XFRow *pRow = (XFRow*)other.m_aHeaderRows.GetContent(i+1);
28600 + if( pRow )
28602 + m_aHeaderRows.Add( new XFRow(*pRow) );
28606 + m_aColumns = other.m_aColumns;
28607 + m_strDefCellStyle = other.m_strDefCellStyle;
28608 + m_strDefRowStyle = other.m_strDefRowStyle;
28609 + m_strDefColStyle = other.m_strDefColStyle;
28612 +XFTable& XFTable::operator =(const XFTable& other)
28614 + m_strName = other.m_strName;
28615 + m_bSubTable = other.m_bSubTable;
28616 + m_pOwnerCell = NULL;
28617 + for( int i=1; i<=other.m_aHeaderRows.GetCount(); i++ )
28619 + XFRow *pRow = (XFRow*)other.m_aHeaderRows.GetContent(i);
28620 + if( pRow )
28622 + m_aHeaderRows.Add( new XFRow(*pRow) );
28626 + m_aColumns = other.m_aColumns;
28627 + m_strDefCellStyle = other.m_strDefCellStyle;
28628 + m_strDefRowStyle = other.m_strDefRowStyle;
28629 + m_strDefColStyle = other.m_strDefColStyle;
28630 + return *this;
28635 +XFTable::~XFTable()
28637 + std::map<sal_Int32,XFRow*>::iterator it;
28638 + for( it=m_aRows.begin(); it!=m_aRows.end(); it++ )
28640 + XFRow *pRow = (*it).second;
28641 + if( pRow )
28642 + delete pRow;
28644 + m_aRows.clear();
28645 + m_aColumns.clear();
28648 +void XFTable::SetColumnStyle(sal_Int32 col, rtl::OUString style)
28650 + m_aColumns[col] = style;
28653 +void XFTable::AddRow(XFRow *pRow)
28655 + assert(pRow);
28656 + if( !pRow )
28657 + return;
28659 + int row = pRow->GetRow();
28661 + if( row<1 )
28662 + pRow->SetRow(m_aRows.size()+1);
28664 + row = pRow->GetRow();
28665 + if( m_aRows.find(row) != m_aRows.end() )
28666 + delete m_aRows[row];
28668 + pRow->SetOwnerTable(this);
28669 + m_aRows[row] = pRow;
28672 +void XFTable::AddHeaderRow(XFRow *pRow)
28674 + if( !pRow )
28675 + return;
28676 + m_aHeaderRows.Add(pRow);
28679 +rtl::OUString XFTable::GetTableName()
28681 + if( m_bSubTable )
28683 + return m_pOwnerCell->GetCellName();
28685 + else
28686 + return m_strName;
28689 +sal_Int32 XFTable::GetRowCount()
28691 + sal_Int32 rowMax = -1;
28692 + std::map<sal_Int32,XFRow*>::iterator it;
28693 + for( it=m_aRows.begin(); it!=m_aRows.end(); it++ )
28695 + if( it->first>rowMax )
28696 + rowMax = it->first;
28699 + return rowMax;
28700 +/*
28701 + if( m_aRows.size()<1 )
28702 + return 0;
28703 + std::map<sal_Int32,XFRow*>::iterator it = m_aRows.end();
28704 + it--;
28705 + return it->first;*/
28708 +XFRow* XFTable::GetRow(sal_Int32 row)
28710 + return m_aRows[row];
28713 +sal_Int32 XFTable::GetColumnCount()
28715 + int colMax = -1;
28716 + std::map<sal_Int32,rtl::OUString>::iterator it;
28717 + for( it=m_aColumns.begin(); it!=m_aColumns.end(); it++ )
28719 + if( it->first>colMax )
28720 + colMax = it->first;
28722 + return colMax;
28723 +/*
28724 + if( m_aColumns.size()<1 )
28725 + return 0;
28726 + std::map<sal_Int32,rtl::OUString>::iterator it = m_aColumns.end();
28727 + it--;
28728 + return it->first;*/
28731 +rtl::OUString XFTable::GetColumnStyle(sal_Int32 col)
28733 + if( m_aColumns.find(col) != m_aColumns.end() )
28734 + return m_aColumns[col];
28735 + return A2OUSTR("");
28738 +enumXFContent XFTable::GetContentType()
28740 + return enumXFContentTable;
28743 +void XFTable::ToXml(IXFStream *pStrm)
28745 + IXFAttrList *pAttrList = pStrm->GetAttrList();
28747 + pAttrList->Clear();
28748 + //sub table shouldn't use table name.
28749 + if( !m_bSubTable )
28750 + pAttrList->AddAttribute( A2OUSTR("table:name"), m_strName);
28752 + if( GetStyleName().getLength() )
28753 + pAttrList->AddAttribute( A2OUSTR("table:style-name"), GetStyleName() );
28755 + if( m_bSubTable )
28756 + pStrm->StartElement( A2OUSTR("table:sub-table") );
28757 + else
28758 + pStrm->StartElement( A2OUSTR("table:table") );
28760 + //test code
28761 +// sal_Int32 rowMax = GetRowCount();
28762 +// sal_Int32 colMax = GetColumnCount();
28763 + //output columns:
28765 + int lastCol = 0;
28766 + std::map<sal_Int32,rtl::OUString>::iterator it;
28767 + for( it=m_aColumns.begin(); it!=m_aColumns.end(); it++ )
28769 + sal_Int32 col = (*it).first;
28770 + rtl::OUString style = m_aColumns[col];
28772 + //default col repeated:
28773 + if( col >lastCol+1 )
28775 + if( col > lastCol + 2 )
28777 + if( m_strDefColStyle.getLength() > 0 )
28779 + pAttrList->AddAttribute( A2OUSTR("table:style-name"), m_strDefColStyle );
28781 + pAttrList->AddAttribute( A2OUSTR("table:number-columns-repeated"), Int32ToOUString(col-lastCol-1) );
28783 + pStrm->StartElement( A2OUSTR("table:table-column") );
28784 + pStrm->EndElement( A2OUSTR("table:table-column") );
28787 + if( style.getLength() > 0 )
28789 + pAttrList->AddAttribute( A2OUSTR("table:style-name"), style );
28791 + pStrm->StartElement( A2OUSTR("table:table-column") );
28792 + pStrm->EndElement( A2OUSTR("table:table-column") );
28793 + lastCol = col;
28797 + if( m_aHeaderRows.GetCount()>0 )
28799 + pStrm->StartElement( A2OUSTR("table:table-header-rows") );
28800 + m_aHeaderRows.ToXml(pStrm);
28801 + pStrm->EndElement( A2OUSTR("table:table-header-rows") );
28803 + //output rows:
28805 + int lastRow = 0;
28806 + IXFAttrList *pAttrList = pStrm->GetAttrList();
28808 + std::map<sal_Int32,XFRow* >::iterator it = m_aRows.begin();
28809 + for( ; it!=m_aRows.end(); it++ )
28810 + {
28811 + int row = (*it).first;
28812 + XFRow *pRow = (*it).second;
28814 + //null row repeated:
28815 + if( row>lastRow+1 )
28817 + XFRow *pNullRow = new XFRow();
28818 + pNullRow->SetStyleName(m_strDefRowStyle);
28819 + if( row>lastRow+2)
28820 + pNullRow->SetRepeated(row-lastRow-1);
28821 + XFCell *pCell = new XFCell();
28822 + pCell->SetStyleName(m_strDefCellStyle);
28823 + pNullRow->AddCell(pCell);
28824 + pNullRow->ToXml(pStrm);
28825 + }
28826 + pRow->ToXml(pStrm);
28827 + lastRow = row;
28831 + if( m_bSubTable )
28832 + pStrm->EndElement( A2OUSTR("table:sub-table") );
28833 + else
28834 + pStrm->EndElement( A2OUSTR("table:table") );
28836 \ No newline at end of file
28837 diff -urNp lotuswordpro.bak/source/filter/xfilter/xftable.hxx lotuswordpro/source/filter/xfilter/xftable.hxx
28838 --- lotuswordpro.bak/source/filter/xfilter/xftable.hxx 1970-01-01 08:00:00.000000000 +0800
28839 +++ lotuswordpro/source/filter/xfilter/xftable.hxx 2008-10-22 11:42:34.000000000 +0800
28840 @@ -0,0 +1,172 @@
28841 +/*************************************************************************
28843 + * The Contents of this file are made available subject to the terms of
28844 + * either of the following licenses
28846 + * - GNU Lesser General Public License Version 2.1
28847 + * - Sun Industry Standards Source License Version 1.1
28849 + * Sun Microsystems Inc., October, 2000
28851 + * GNU Lesser General Public License Version 2.1
28852 + * =============================================
28853 + * Copyright 2000 by Sun Microsystems, Inc.
28854 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
28856 + * This library is free software; you can redistribute it and/or
28857 + * modify it under the terms of the GNU Lesser General Public
28858 + * License version 2.1, as published by the Free Software Foundation.
28860 + * This library is distributed in the hope that it will be useful,
28861 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
28862 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28863 + * Lesser General Public License for more details.
28865 + * You should have received a copy of the GNU Lesser General Public
28866 + * License along with this library; if not, write to the Free Software
28867 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
28868 + * MA 02111-1307 USA
28871 + * Sun Industry Standards Source License Version 1.1
28872 + * =================================================
28873 + * The contents of this file are subject to the Sun Industry Standards
28874 + * Source License Version 1.1 (the "License"); You may not use this file
28875 + * except in compliance with the License. You may obtain a copy of the
28876 + * License at http://www.openoffice.org/license.html.
28878 + * Software provided under this License is provided on an "AS IS" basis,
28879 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
28880 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
28881 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
28882 + * See the License for the specific provisions governing your rights and
28883 + * obligations concerning the Software.
28885 + * The Initial Developer of the Original Code is: IBM Corporation
28887 + * Copyright: 2008 by IBM Corporation
28889 + * All Rights Reserved.
28891 + * Contributor(s): _______________________________________
28894 + ************************************************************************/
28895 +/*************************************************************************
28896 + * @file
28897 + * Table object.
28898 + ************************************************************************/
28899 +/*************************************************************************
28900 + * Change History
28901 + * 2005-01-24 create and implements.
28902 + ************************************************************************/
28903 +#ifndef _XFTABLE_HXX
28904 +#define _XFTABLE_HXX
28906 +#include "xfcontent.hxx"
28907 +#include "xfrow.hxx"
28908 +#include "xfcell.hxx"
28909 +#include "xfcontentcontainer.hxx"
28910 +#include <map>
28911 +#include <vector>
28913 +class XFTable : public XFContent
28915 +public:
28916 + XFTable();
28918 + XFTable(const XFTable& other);
28920 + XFTable& operator=(const XFTable& other);
28922 + virtual ~XFTable();
28924 +public:
28925 + void SetTableName(rtl::OUString name);
28927 + void SetColumnStyle(sal_Int32 col, rtl::OUString style);
28929 + void AddRow(XFRow *pRow);
28931 + void AddHeaderRow(XFRow *pRow);
28933 + void SetDefaultCellStyle(rtl::OUString style);
28935 + void SetDefaultRowStyle(rtl::OUString style);
28937 + void SetDefaultColStyle(rtl::OUString style);
28939 +public:
28940 + void SetOwnerCell(XFCell *pCell);
28942 + rtl::OUString GetTableName();
28944 + sal_Int32 GetRowCount();
28946 + XFRow* GetRow(sal_Int32 row);
28948 + sal_Int32 GetColumnCount();
28950 + rtl::OUString GetColumnStyle(sal_Int32 col);
28952 + sal_Bool IsSubTable();
28954 + void Normalize();
28956 + enumXFContent GetContentType();
28958 + virtual void ToXml(IXFStream *pStrm);
28960 + void RemoveRow(sal_Int32 row);
28962 +private:
28963 + rtl::OUString m_strName;
28964 + sal_Bool m_bSubTable;
28965 + XFCell *m_pOwnerCell;
28966 + XFContentContainer m_aHeaderRows;
28967 + std::map<sal_Int32,XFRow*> m_aRows;
28968 + std::map<sal_Int32,rtl::OUString> m_aColumns;
28969 + rtl::OUString m_strDefCellStyle;
28970 + rtl::OUString m_strDefRowStyle;
28971 + rtl::OUString m_strDefColStyle;
28974 +inline void XFTable::SetTableName(rtl::OUString name)
28976 + m_strName = name;
28979 +inline void XFTable::SetOwnerCell(XFCell *pCell)
28981 + m_pOwnerCell = pCell;
28982 + m_bSubTable = (pCell!=NULL);
28985 +inline sal_Bool XFTable::IsSubTable()
28987 + return m_bSubTable;
28991 +inline void XFTable::SetDefaultCellStyle(rtl::OUString style)
28993 + m_strDefCellStyle = style;
28996 +inline void XFTable::SetDefaultRowStyle(rtl::OUString style)
28998 + m_strDefRowStyle = style;
29001 +inline void XFTable::SetDefaultColStyle(rtl::OUString style)
29003 + m_strDefColStyle = style;
29006 +inline void XFTable::RemoveRow(sal_Int32 row)
29008 + m_aRows.erase(row);
29011 +#endif
29013 diff -urNp lotuswordpro.bak/source/filter/xfilter/xftablestyle.cxx lotuswordpro/source/filter/xfilter/xftablestyle.cxx
29014 --- lotuswordpro.bak/source/filter/xfilter/xftablestyle.cxx 1970-01-01 08:00:00.000000000 +0800
29015 +++ lotuswordpro/source/filter/xfilter/xftablestyle.cxx 2008-10-22 11:42:34.000000000 +0800
29016 @@ -0,0 +1,139 @@
29017 +/*************************************************************************
29019 + * The Contents of this file are made available subject to the terms of
29020 + * either of the following licenses
29022 + * - GNU Lesser General Public License Version 2.1
29023 + * - Sun Industry Standards Source License Version 1.1
29025 + * Sun Microsystems Inc., October, 2000
29027 + * GNU Lesser General Public License Version 2.1
29028 + * =============================================
29029 + * Copyright 2000 by Sun Microsystems, Inc.
29030 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
29032 + * This library is free software; you can redistribute it and/or
29033 + * modify it under the terms of the GNU Lesser General Public
29034 + * License version 2.1, as published by the Free Software Foundation.
29036 + * This library is distributed in the hope that it will be useful,
29037 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
29038 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
29039 + * Lesser General Public License for more details.
29041 + * You should have received a copy of the GNU Lesser General Public
29042 + * License along with this library; if not, write to the Free Software
29043 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29044 + * MA 02111-1307 USA
29047 + * Sun Industry Standards Source License Version 1.1
29048 + * =================================================
29049 + * The contents of this file are subject to the Sun Industry Standards
29050 + * Source License Version 1.1 (the "License"); You may not use this file
29051 + * except in compliance with the License. You may obtain a copy of the
29052 + * License at http://www.openoffice.org/license.html.
29054 + * Software provided under this License is provided on an "AS IS" basis,
29055 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
29056 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
29057 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
29058 + * See the License for the specific provisions governing your rights and
29059 + * obligations concerning the Software.
29061 + * The Initial Developer of the Original Code is: IBM Corporation
29063 + * Copyright: 2008 by IBM Corporation
29065 + * All Rights Reserved.
29067 + * Contributor(s): _______________________________________
29070 + ************************************************************************/
29071 +/*************************************************************************
29072 + * @file
29073 + * Table style.
29074 + ************************************************************************/
29075 +/*************************************************************************
29076 + * Change History
29077 + * 2005-01-24 create and implements.
29078 + ************************************************************************/
29079 +#include "xftablestyle.hxx"
29080 +#include "xfbgimage.hxx"
29082 +XFTableStyle::XFTableStyle()
29084 + m_fWidth = 2;
29085 + m_eAlign = enumXFAlignStart;
29086 + m_pBGImage = NULL;
29089 +XFTableStyle::~XFTableStyle()
29091 + if( m_pBGImage )
29092 + delete m_pBGImage;
29095 +void XFTableStyle::SetBackImage(XFBGImage *pImage)
29097 + if( m_pBGImage )
29098 + delete m_pBGImage;
29100 + m_pBGImage = pImage;
29103 +enumXFStyle XFTableStyle::GetStyleFamily()
29105 + return enumXFStyleTable;
29108 +void XFTableStyle::ToXml(IXFStream *pStrm)
29110 + IXFAttrList *pAttrList = pStrm->GetAttrList();
29111 + pAttrList->Clear();
29113 + pAttrList->AddAttribute( A2OUSTR("style:name"), GetStyleName() );
29114 + if( GetParentStyleName().getLength() > 0 )
29115 + pAttrList->AddAttribute(A2OUSTR("style:parent-style-name"),GetParentStyleName());
29116 + pAttrList->AddAttribute( A2OUSTR("style:family"), A2OUSTR("table") );
29117 + pStrm->StartElement( A2OUSTR("style:style") );
29119 + pAttrList->Clear();
29120 + pAttrList->AddAttribute( A2OUSTR("style:width"), DoubleToOUString(m_fWidth) + A2OUSTR("cm") );
29121 + //text align:
29122 + if( m_eAlign == enumXFAlignStart )
29124 + pAttrList->AddAttribute(A2OUSTR("table:align"),A2OUSTR("left"));
29126 + else if( m_eAlign == enumXFAlignCenter )
29128 + pAttrList->AddAttribute(A2OUSTR("table:align"),A2OUSTR("center"));
29130 + else if( m_eAlign == enumXFAlignEnd )
29132 + pAttrList->AddAttribute(A2OUSTR("table:align"),A2OUSTR("right"));
29134 + else if( m_eAlign == enumXFALignMargins )
29136 + pAttrList->AddAttribute(A2OUSTR("table:align"),A2OUSTR("margins"));
29138 + //background color:
29139 + if( m_aBackColor.IsValid() && !m_pBGImage )
29140 + pAttrList->AddAttribute(A2OUSTR("fo:background-color"), m_aBackColor.ToString() );
29141 + //shadow:
29142 + m_aShadow.ToXml(pStrm);
29143 + //margin:
29144 + m_aMargins.ToXml(pStrm);
29145 + //breaks:
29146 + m_aBreaks.ToXml(pStrm);
29148 + pStrm->StartElement( A2OUSTR("style:properties") );
29149 + if( m_pBGImage )
29150 + m_pBGImage->ToXml(pStrm);
29152 + pStrm->EndElement( A2OUSTR("style:properties") );
29154 + pStrm->EndElement( A2OUSTR("style:style") );
29156 \ No newline at end of file
29157 diff -urNp lotuswordpro.bak/source/filter/xfilter/xftablestyle.hxx lotuswordpro/source/filter/xfilter/xftablestyle.hxx
29158 --- lotuswordpro.bak/source/filter/xfilter/xftablestyle.hxx 1970-01-01 08:00:00.000000000 +0800
29159 +++ lotuswordpro/source/filter/xfilter/xftablestyle.hxx 2008-10-22 11:42:34.000000000 +0800
29160 @@ -0,0 +1,155 @@
29161 +/*************************************************************************
29163 + * The Contents of this file are made available subject to the terms of
29164 + * either of the following licenses
29166 + * - GNU Lesser General Public License Version 2.1
29167 + * - Sun Industry Standards Source License Version 1.1
29169 + * Sun Microsystems Inc., October, 2000
29171 + * GNU Lesser General Public License Version 2.1
29172 + * =============================================
29173 + * Copyright 2000 by Sun Microsystems, Inc.
29174 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
29176 + * This library is free software; you can redistribute it and/or
29177 + * modify it under the terms of the GNU Lesser General Public
29178 + * License version 2.1, as published by the Free Software Foundation.
29180 + * This library is distributed in the hope that it will be useful,
29181 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
29182 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
29183 + * Lesser General Public License for more details.
29185 + * You should have received a copy of the GNU Lesser General Public
29186 + * License along with this library; if not, write to the Free Software
29187 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29188 + * MA 02111-1307 USA
29191 + * Sun Industry Standards Source License Version 1.1
29192 + * =================================================
29193 + * The contents of this file are subject to the Sun Industry Standards
29194 + * Source License Version 1.1 (the "License"); You may not use this file
29195 + * except in compliance with the License. You may obtain a copy of the
29196 + * License at http://www.openoffice.org/license.html.
29198 + * Software provided under this License is provided on an "AS IS" basis,
29199 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
29200 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
29201 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
29202 + * See the License for the specific provisions governing your rights and
29203 + * obligations concerning the Software.
29205 + * The Initial Developer of the Original Code is: IBM Corporation
29207 + * Copyright: 2008 by IBM Corporation
29209 + * All Rights Reserved.
29211 + * Contributor(s): _______________________________________
29214 + ************************************************************************/
29215 +/*************************************************************************
29216 + * @file
29217 + * Table style.
29218 + ************************************************************************/
29219 +/*************************************************************************
29220 + * Change History
29221 + * 2005-01-24 create and implements.
29222 + ************************************************************************/
29223 +#ifndef _XFTABLESTYLE_HXX
29224 +#define _XFTABLESTYLE_HXX
29226 +#include "xfstyle.hxx"
29227 +#include "xfmargins.hxx"
29228 +#include "xfshadow.hxx"
29229 +#include "xfcolor.hxx"
29230 +#include "xfbreaks.hxx"
29232 +class XFBGImage;
29233 +class XFTableStyle : public XFStyle
29235 +public:
29236 + XFTableStyle();
29238 + virtual ~XFTableStyle();
29240 +public:
29241 + void SetWidth(double width);
29243 + void SetAlign(enumXFAlignType eAlign, double offset = 0);
29245 + void SetShadow(enumXFShadowPos pos, double offset = 0.18, XFColor color=XFColor(128,128,0) );
29247 + void SetMargins(double left=-1, double right=-1, double top=-1, double bottom=-1);
29249 + void SetBackColor(XFColor& color);
29251 + void SetBackImage(XFBGImage *pImage);
29253 + void SetBreaks(enumXFBreaks breaks);
29255 + virtual void ToXml(IXFStream *pStrm);
29257 + virtual enumXFStyle GetStyleFamily();
29259 +private:
29260 + double m_fWidth;
29261 + XFColor m_aBackColor;
29262 + XFBGImage *m_pBGImage;
29263 + XFShadow m_aShadow;
29264 + XFMargins m_aMargins;
29265 + XFBreaks m_aBreaks;
29266 + enumXFAlignType m_eAlign;
29269 +inline void XFTableStyle::SetWidth(double width)
29271 + m_fWidth = width;
29274 +inline void XFTableStyle::SetAlign(enumXFAlignType eAlign, double offset)
29276 + m_eAlign = eAlign;
29277 + if( m_eAlign == enumXFAlignStart )
29279 + m_aMargins.SetLeft(offset);
29280 + m_aMargins.SetRight(0);
29281 + m_aMargins.SetTop(0);
29282 + m_aMargins.SetBottom(0);
29286 +inline void XFTableStyle::SetShadow(enumXFShadowPos pos, double offset, XFColor color)
29288 + m_aShadow.SetColor(color);
29289 + m_aShadow.SetOffset(offset);
29290 + m_aShadow.SetPosition(pos);
29293 +inline void XFTableStyle::SetMargins(double left, double right, double top, double bottom)
29295 + if( left != -1 )
29296 + m_aMargins.SetLeft(left);
29297 + if( right != -1 )
29298 + m_aMargins.SetRight(right);
29299 + if( top != -1 )
29300 + m_aMargins.SetTop(top);
29301 + if( bottom != -1 )
29302 + m_aMargins.SetBottom(bottom);
29305 +inline void XFTableStyle::SetBackColor(XFColor& color)
29307 + m_aBackColor = color;
29310 +inline void XFTableStyle::SetBreaks(enumXFBreaks breaks)
29312 + m_aBreaks.SetBreakType(breaks);
29315 +#endif
29316 diff -urNp lotuswordpro.bak/source/filter/xfilter/xftabstop.hxx lotuswordpro/source/filter/xfilter/xftabstop.hxx
29317 --- lotuswordpro.bak/source/filter/xfilter/xftabstop.hxx 1970-01-01 08:00:00.000000000 +0800
29318 +++ lotuswordpro/source/filter/xfilter/xftabstop.hxx 2008-10-22 11:42:34.000000000 +0800
29319 @@ -0,0 +1,84 @@
29320 +/*************************************************************************
29322 + * The Contents of this file are made available subject to the terms of
29323 + * either of the following licenses
29325 + * - GNU Lesser General Public License Version 2.1
29326 + * - Sun Industry Standards Source License Version 1.1
29328 + * Sun Microsystems Inc., October, 2000
29330 + * GNU Lesser General Public License Version 2.1
29331 + * =============================================
29332 + * Copyright 2000 by Sun Microsystems, Inc.
29333 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
29335 + * This library is free software; you can redistribute it and/or
29336 + * modify it under the terms of the GNU Lesser General Public
29337 + * License version 2.1, as published by the Free Software Foundation.
29339 + * This library is distributed in the hope that it will be useful,
29340 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
29341 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
29342 + * Lesser General Public License for more details.
29344 + * You should have received a copy of the GNU Lesser General Public
29345 + * License along with this library; if not, write to the Free Software
29346 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29347 + * MA 02111-1307 USA
29350 + * Sun Industry Standards Source License Version 1.1
29351 + * =================================================
29352 + * The contents of this file are subject to the Sun Industry Standards
29353 + * Source License Version 1.1 (the "License"); You may not use this file
29354 + * except in compliance with the License. You may obtain a copy of the
29355 + * License at http://www.openoffice.org/license.html.
29357 + * Software provided under this License is provided on an "AS IS" basis,
29358 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
29359 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
29360 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
29361 + * See the License for the specific provisions governing your rights and
29362 + * obligations concerning the Software.
29364 + * The Initial Developer of the Original Code is: IBM Corporation
29366 + * Copyright: 2008 by IBM Corporation
29368 + * All Rights Reserved.
29370 + * Contributor(s): _______________________________________
29373 + ************************************************************************/
29374 +/**************************************************************************
29375 + * @file
29376 + * Tab stop object,<text:tab-stop/>
29377 + *************************************************************************/
29378 +/**************************************************************************
29379 + * Change History
29380 + * 2004-01-11 create this file.
29381 + *************************************************************************/
29382 +#ifndef _XFTABSTOP_HXX
29383 +#define _XFTABSTOP_HXX
29385 +#include "xfglobal.hxx"
29386 +#include "xfcontent.hxx"
29388 +class XFTabStop : public XFContent
29390 +public:
29391 + virtual void ToXml(IXFStream *pStrm);
29394 +inline void XFTabStop::ToXml(IXFStream *pStrm)
29396 + IXFAttrList *pAttrList = pStrm->GetAttrList();
29398 + pAttrList->Clear();
29399 + pStrm->StartElement( A2OUSTR("text:tab-stop") );
29400 + pStrm->EndElement( A2OUSTR("text:tab-stop") );
29403 +#endif
29404 \ No newline at end of file
29405 diff -urNp lotuswordpro.bak/source/filter/xfilter/xftabstyle.cxx lotuswordpro/source/filter/xfilter/xftabstyle.cxx
29406 --- lotuswordpro.bak/source/filter/xfilter/xftabstyle.cxx 1970-01-01 08:00:00.000000000 +0800
29407 +++ lotuswordpro/source/filter/xfilter/xftabstyle.cxx 2008-10-22 11:42:34.000000000 +0800
29408 @@ -0,0 +1,102 @@
29409 +/*************************************************************************
29411 + * The Contents of this file are made available subject to the terms of
29412 + * either of the following licenses
29414 + * - GNU Lesser General Public License Version 2.1
29415 + * - Sun Industry Standards Source License Version 1.1
29417 + * Sun Microsystems Inc., October, 2000
29419 + * GNU Lesser General Public License Version 2.1
29420 + * =============================================
29421 + * Copyright 2000 by Sun Microsystems, Inc.
29422 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
29424 + * This library is free software; you can redistribute it and/or
29425 + * modify it under the terms of the GNU Lesser General Public
29426 + * License version 2.1, as published by the Free Software Foundation.
29428 + * This library is distributed in the hope that it will be useful,
29429 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
29430 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
29431 + * Lesser General Public License for more details.
29433 + * You should have received a copy of the GNU Lesser General Public
29434 + * License along with this library; if not, write to the Free Software
29435 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29436 + * MA 02111-1307 USA
29439 + * Sun Industry Standards Source License Version 1.1
29440 + * =================================================
29441 + * The contents of this file are subject to the Sun Industry Standards
29442 + * Source License Version 1.1 (the "License"); You may not use this file
29443 + * except in compliance with the License. You may obtain a copy of the
29444 + * License at http://www.openoffice.org/license.html.
29446 + * Software provided under this License is provided on an "AS IS" basis,
29447 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
29448 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
29449 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
29450 + * See the License for the specific provisions governing your rights and
29451 + * obligations concerning the Software.
29453 + * The Initial Developer of the Original Code is: IBM Corporation
29455 + * Copyright: 2008 by IBM Corporation
29457 + * All Rights Reserved.
29459 + * Contributor(s): _______________________________________
29462 + ************************************************************************/
29463 +/*************************************************************************
29464 + * @file
29465 + * Tab style for paragraph.include tab offset and tab char properties.
29466 + ************************************************************************/
29467 +/*************************************************************************
29468 + * Change History
29469 + * 2005-01-27 create this file.
29470 + ************************************************************************/
29471 +#include "xftabstyle.hxx"
29473 +XFTabStyle::XFTabStyle()
29475 + m_eType = enumXFTabNone;
29476 + m_fLength = 0;
29479 +void XFTabStyle::ToXml(IXFStream *pStrm)
29481 + assert(m_fLength>0);
29482 + IXFAttrList *pAttrList = pStrm->GetAttrList();
29483 + pAttrList->Clear();
29485 + pAttrList->AddAttribute( A2OUSTR("style:position"), DoubleToOUString(m_fLength) + A2OUSTR("cm") );
29486 + switch(m_eType)
29488 + case enumXFTabLeft:
29489 + pAttrList->AddAttribute( A2OUSTR("style:type"), A2OUSTR("left") );
29490 + break;
29491 + case enumXFTabCenter:
29492 + pAttrList->AddAttribute( A2OUSTR("style:type"), A2OUSTR("center") );
29493 + break;
29494 + case enumXFTabRight:
29495 + pAttrList->AddAttribute( A2OUSTR("style:type"), A2OUSTR("right") );
29496 + break;
29497 + case enumXFTabChar:
29498 + pAttrList->AddAttribute( A2OUSTR("style:type"), A2OUSTR("char") );
29499 + break;
29501 + //delimiter:
29502 + if( m_eType == enumXFTabChar )
29503 + pAttrList->AddAttribute( A2OUSTR("style:char"), m_strDelimiter );
29504 + //leader char:
29505 + if( m_strLeader.getLength() )
29506 + pAttrList->AddAttribute( A2OUSTR("style:leader-char"), m_strLeader );
29508 + pStrm->StartElement( A2OUSTR("style:tab-stop") );
29509 + pStrm->EndElement( A2OUSTR("style:tab-stop") );
29511 \ No newline at end of file
29512 diff -urNp lotuswordpro.bak/source/filter/xfilter/xftabstyle.hxx lotuswordpro/source/filter/xfilter/xftabstyle.hxx
29513 --- lotuswordpro.bak/source/filter/xfilter/xftabstyle.hxx 1970-01-01 08:00:00.000000000 +0800
29514 +++ lotuswordpro/source/filter/xfilter/xftabstyle.hxx 2008-10-22 11:42:34.000000000 +0800
29515 @@ -0,0 +1,122 @@
29516 +/*************************************************************************
29518 + * The Contents of this file are made available subject to the terms of
29519 + * either of the following licenses
29521 + * - GNU Lesser General Public License Version 2.1
29522 + * - Sun Industry Standards Source License Version 1.1
29524 + * Sun Microsystems Inc., October, 2000
29526 + * GNU Lesser General Public License Version 2.1
29527 + * =============================================
29528 + * Copyright 2000 by Sun Microsystems, Inc.
29529 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
29531 + * This library is free software; you can redistribute it and/or
29532 + * modify it under the terms of the GNU Lesser General Public
29533 + * License version 2.1, as published by the Free Software Foundation.
29535 + * This library is distributed in the hope that it will be useful,
29536 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
29537 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
29538 + * Lesser General Public License for more details.
29540 + * You should have received a copy of the GNU Lesser General Public
29541 + * License along with this library; if not, write to the Free Software
29542 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29543 + * MA 02111-1307 USA
29546 + * Sun Industry Standards Source License Version 1.1
29547 + * =================================================
29548 + * The contents of this file are subject to the Sun Industry Standards
29549 + * Source License Version 1.1 (the "License"); You may not use this file
29550 + * except in compliance with the License. You may obtain a copy of the
29551 + * License at http://www.openoffice.org/license.html.
29553 + * Software provided under this License is provided on an "AS IS" basis,
29554 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
29555 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
29556 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
29557 + * See the License for the specific provisions governing your rights and
29558 + * obligations concerning the Software.
29560 + * The Initial Developer of the Original Code is: IBM Corporation
29562 + * Copyright: 2008 by IBM Corporation
29564 + * All Rights Reserved.
29566 + * Contributor(s): _______________________________________
29569 + ************************************************************************/
29570 +/*************************************************************************
29571 + * @file
29572 + * Tab style for paragraph.include tab offset and tab char properties.
29573 + ************************************************************************/
29574 +/*************************************************************************
29575 + * Change History
29576 + * 2005-01-27 create this file.
29577 + ************************************************************************/
29578 +#ifndef _XFTABSSTYLE_HXX
29579 +#define _XFTABSSTYLE_HXX
29581 +#include "xfglobal.hxx"
29582 +#include "xfstyle.hxx"
29583 +#include <vector>
29585 +class XFTabStyle : public XFStyle
29587 +public:
29588 + XFTabStyle();
29590 +public:
29591 + void SetTabType(enumXFTab type);
29593 + void SetLength(double len);
29595 + void SetDelimiter(sal_Unicode delimiter);
29597 + void SetLeaderChar(sal_Unicode leader);
29599 + virtual void ToXml(IXFStream *pStrm);
29601 +private:
29602 + enumXFTab m_eType;
29603 + double m_fLength;
29604 + rtl::OUString m_strDelimiter;
29605 + rtl::OUString m_strLeader;
29608 +inline void XFTabStyle::SetTabType(enumXFTab type)
29610 + m_eType = type;
29613 +inline void XFTabStyle::SetLength(double len)
29615 + m_fLength = len;
29618 +inline void XFTabStyle::SetDelimiter(sal_Unicode delimiter)
29620 + sal_Unicode chs[2];
29621 + chs[0] = delimiter;
29622 + chs[1] = 0;
29624 + m_strDelimiter = rtl::OUString(chs);
29627 +inline void XFTabStyle::SetLeaderChar(sal_Unicode leader)
29629 + sal_Unicode chs[2];
29630 + chs[0] = leader;
29631 + chs[1] = 0;
29633 + m_strLeader = rtl::OUString(chs);
29637 +#endif
29638 \ No newline at end of file
29639 diff -urNp lotuswordpro.bak/source/filter/xfilter/xftextboxstyle.cxx lotuswordpro/source/filter/xfilter/xftextboxstyle.cxx
29640 --- lotuswordpro.bak/source/filter/xfilter/xftextboxstyle.cxx 1970-01-01 08:00:00.000000000 +0800
29641 +++ lotuswordpro/source/filter/xfilter/xftextboxstyle.cxx 2008-10-22 11:42:34.000000000 +0800
29642 @@ -0,0 +1,102 @@
29643 +/*************************************************************************
29645 + * The Contents of this file are made available subject to the terms of
29646 + * either of the following licenses
29648 + * - GNU Lesser General Public License Version 2.1
29649 + * - Sun Industry Standards Source License Version 1.1
29651 + * Sun Microsystems Inc., October, 2000
29653 + * GNU Lesser General Public License Version 2.1
29654 + * =============================================
29655 + * Copyright 2000 by Sun Microsystems, Inc.
29656 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
29658 + * This library is free software; you can redistribute it and/or
29659 + * modify it under the terms of the GNU Lesser General Public
29660 + * License version 2.1, as published by the Free Software Foundation.
29662 + * This library is distributed in the hope that it will be useful,
29663 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
29664 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
29665 + * Lesser General Public License for more details.
29667 + * You should have received a copy of the GNU Lesser General Public
29668 + * License along with this library; if not, write to the Free Software
29669 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29670 + * MA 02111-1307 USA
29673 + * Sun Industry Standards Source License Version 1.1
29674 + * =================================================
29675 + * The contents of this file are subject to the Sun Industry Standards
29676 + * Source License Version 1.1 (the "License"); You may not use this file
29677 + * except in compliance with the License. You may obtain a copy of the
29678 + * License at http://www.openoffice.org/license.html.
29680 + * Software provided under this License is provided on an "AS IS" basis,
29681 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
29682 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
29683 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
29684 + * See the License for the specific provisions governing your rights and
29685 + * obligations concerning the Software.
29687 + * The Initial Developer of the Original Code is: IBM Corporation
29689 + * Copyright: 2008 by IBM Corporation
29691 + * All Rights Reserved.
29693 + * Contributor(s): _______________________________________
29696 + ************************************************************************/
29697 +#include "xftextboxstyle.hxx"
29698 +#include "xfcolumns.hxx"
29699 +#include "xfborders.hxx"
29700 +#include "xfshadow.hxx"
29701 +#include "xfbgimage.hxx"
29703 +XFTextBoxStyle::XFTextBoxStyle()
29707 +XFTextBoxStyle::~XFTextBoxStyle()
29711 +enumXFStyle XFTextBoxStyle::GetStyleFamily()
29713 + return enumXFStyleGraphics;
29716 +void XFTextBoxStyle::ToXml(IXFStream *pStrm)
29718 + IXFAttrList *pAttrList = pStrm->GetAttrList();
29720 + pAttrList->Clear();
29721 + pAttrList->AddAttribute( A2OUSTR("style:name"), GetStyleName() );
29722 + if( GetParentStyleName().getLength() > 0 )
29723 + pAttrList->AddAttribute(A2OUSTR("style:parent-style-name"),GetParentStyleName());
29724 + pAttrList->AddAttribute( A2OUSTR("style:family"), A2OUSTR("graphics") );
29725 + //parent style name ignore now.
29726 + pStrm->StartElement( A2OUSTR("style:style") );
29728 + pAttrList->Clear();
29729 + pAttrList->AddAttribute( A2OUSTR("draw:stroke"), A2OUSTR("none") );
29730 + pAttrList->AddAttribute( A2OUSTR("svg:stroke-color"), A2OUSTR("#000000") );
29731 + pAttrList->AddAttribute( A2OUSTR("draw:fill"), A2OUSTR("none") );
29732 + pAttrList->AddAttribute( A2OUSTR("draw:fill-color"), A2OUSTR("#ffffff") );
29733 + pAttrList->AddAttribute( A2OUSTR("draw:auto-grow-height"), A2OUSTR("true") );
29734 + pAttrList->AddAttribute( A2OUSTR("style:run-through"), A2OUSTR("foreground") );
29735 + pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("run-through") );
29736 + pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("run-through") );
29737 + pAttrList->AddAttribute( A2OUSTR("style:number-wrapped-paragraphs"), A2OUSTR("no-limit") );
29738 + pAttrList->AddAttribute( A2OUSTR("style:wrap-contour"), A2OUSTR("false") );
29740 + pStrm->StartElement( A2OUSTR("style:properties") );
29741 + pStrm->EndElement( A2OUSTR("style:properties") );
29743 + pStrm->EndElement( A2OUSTR("style:style") );
29745 \ No newline at end of file
29746 diff -urNp lotuswordpro.bak/source/filter/xfilter/xftextboxstyle.hxx lotuswordpro/source/filter/xfilter/xftextboxstyle.hxx
29747 --- lotuswordpro.bak/source/filter/xfilter/xftextboxstyle.hxx 1970-01-01 08:00:00.000000000 +0800
29748 +++ lotuswordpro/source/filter/xfilter/xftextboxstyle.hxx 2008-10-22 11:42:34.000000000 +0800
29749 @@ -0,0 +1,89 @@
29750 +/*************************************************************************
29752 + * The Contents of this file are made available subject to the terms of
29753 + * either of the following licenses
29755 + * - GNU Lesser General Public License Version 2.1
29756 + * - Sun Industry Standards Source License Version 1.1
29758 + * Sun Microsystems Inc., October, 2000
29760 + * GNU Lesser General Public License Version 2.1
29761 + * =============================================
29762 + * Copyright 2000 by Sun Microsystems, Inc.
29763 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
29765 + * This library is free software; you can redistribute it and/or
29766 + * modify it under the terms of the GNU Lesser General Public
29767 + * License version 2.1, as published by the Free Software Foundation.
29769 + * This library is distributed in the hope that it will be useful,
29770 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
29771 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
29772 + * Lesser General Public License for more details.
29774 + * You should have received a copy of the GNU Lesser General Public
29775 + * License along with this library; if not, write to the Free Software
29776 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29777 + * MA 02111-1307 USA
29780 + * Sun Industry Standards Source License Version 1.1
29781 + * =================================================
29782 + * The contents of this file are subject to the Sun Industry Standards
29783 + * Source License Version 1.1 (the "License"); You may not use this file
29784 + * except in compliance with the License. You may obtain a copy of the
29785 + * License at http://www.openoffice.org/license.html.
29787 + * Software provided under this License is provided on an "AS IS" basis,
29788 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
29789 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
29790 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
29791 + * See the License for the specific provisions governing your rights and
29792 + * obligations concerning the Software.
29794 + * The Initial Developer of the Original Code is: IBM Corporation
29796 + * Copyright: 2008 by IBM Corporation
29798 + * All Rights Reserved.
29800 + * Contributor(s): _______________________________________
29803 + ************************************************************************/
29804 +#ifndef _XFTEXTBOXSTYLE_HXX
29805 +#define _XFTEXTBOXSTYLE_HXX
29807 +#include "xfglobal.hxx"
29808 +#include "xfstyle.hxx"
29809 +#include "xfmargins.hxx"
29810 +#include "xfcolor.hxx"
29811 +#include "xfpadding.hxx"
29813 +class XFBorders;
29814 +class XFColumns;
29815 +class XFShadow;
29816 +class XFBGImage;
29818 +/**
29819 +* @brief
29820 +* Style for all frame obejcts.
29822 +class XFTextBoxStyle : public XFStyle
29824 +public:
29825 + XFTextBoxStyle();
29827 + virtual ~XFTextBoxStyle();
29829 +public:
29831 + virtual enumXFStyle GetStyleFamily();
29833 + virtual void ToXml(IXFStream *pStrm);
29835 +protected:
29838 +#endif
29839 diff -urNp lotuswordpro.bak/source/filter/xfilter/xftextcontent.cxx lotuswordpro/source/filter/xfilter/xftextcontent.cxx
29840 --- lotuswordpro.bak/source/filter/xfilter/xftextcontent.cxx 1970-01-01 08:00:00.000000000 +0800
29841 +++ lotuswordpro/source/filter/xfilter/xftextcontent.cxx 2008-10-22 11:42:34.000000000 +0800
29842 @@ -0,0 +1,125 @@
29843 +/*************************************************************************
29845 + * The Contents of this file are made available subject to the terms of
29846 + * either of the following licenses
29848 + * - GNU Lesser General Public License Version 2.1
29849 + * - Sun Industry Standards Source License Version 1.1
29851 + * Sun Microsystems Inc., October, 2000
29853 + * GNU Lesser General Public License Version 2.1
29854 + * =============================================
29855 + * Copyright 2000 by Sun Microsystems, Inc.
29856 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
29858 + * This library is free software; you can redistribute it and/or
29859 + * modify it under the terms of the GNU Lesser General Public
29860 + * License version 2.1, as published by the Free Software Foundation.
29862 + * This library is distributed in the hope that it will be useful,
29863 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
29864 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
29865 + * Lesser General Public License for more details.
29867 + * You should have received a copy of the GNU Lesser General Public
29868 + * License along with this library; if not, write to the Free Software
29869 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29870 + * MA 02111-1307 USA
29873 + * Sun Industry Standards Source License Version 1.1
29874 + * =================================================
29875 + * The contents of this file are subject to the Sun Industry Standards
29876 + * Source License Version 1.1 (the "License"); You may not use this file
29877 + * except in compliance with the License. You may obtain a copy of the
29878 + * License at http://www.openoffice.org/license.html.
29880 + * Software provided under this License is provided on an "AS IS" basis,
29881 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
29882 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
29883 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
29884 + * See the License for the specific provisions governing your rights and
29885 + * obligations concerning the Software.
29887 + * The Initial Developer of the Original Code is: IBM Corporation
29889 + * Copyright: 2008 by IBM Corporation
29891 + * All Rights Reserved.
29893 + * Contributor(s): _______________________________________
29896 + ************************************************************************/
29897 +/*************************************************************************
29898 + * @file
29899 + * Text content, it's an adapter for string to IXFObject.
29900 + ************************************************************************/
29901 +/*************************************************************************
29902 + * Change History
29903 + 2005-02-02 create and implemente.
29904 + ************************************************************************/
29905 +#include "xftextcontent.hxx"
29906 +#include "ixfstream.hxx"
29908 +XFTextContent::XFTextContent(rtl::OUString text):m_strText(text)
29912 +XFTextContent::~XFTextContent()
29916 +enumXFContent XFTextContent::GetContentType()
29918 + return enumXFContentText;
29921 +void XFTextContent::SetText(const rtl::OUString& text)
29923 + m_strText = text;
29926 +rtl::OUString XFTextContent::GetText()
29928 + return m_strText;
29931 +void XFTextContent::ToXml(IXFStream *pStrm)
29933 +// pStrm->Characters(m_strText);
29934 + rtl::OUString sSpaceToken = rtl::OUString::createFromAscii(" ");
29935 + sSpaceToken += rtl::OUString::createFromAscii(" ");
29936 + rtl::OUString sSubString;
29937 + sal_Int32 nIndex = 0;
29938 + sal_Int32 nSize = m_strText.getLength();
29939 + sal_Int32 i,j;
29940 + for (i=0; i<nSize;)
29942 + sSubString = m_strText.copy(i,nSize-i);
29943 + nIndex = sSubString.indexOf(sSpaceToken);
29944 + if (nIndex == -1)
29946 + pStrm->Characters(sSubString);
29947 + return;
29949 + else
29951 + if (nIndex != 0)
29952 + pStrm->Characters(sSubString.copy(0,nIndex));
29953 + for (j=nIndex+1;j<nSize-i;j++)
29955 + if (sSubString[j] != sal_Char(' '))
29956 + break;
29958 + IXFAttrList *pAttrList = pStrm->GetAttrList();
29959 + pAttrList->Clear();
29960 + pAttrList->AddAttribute( A2OUSTR("text:c"), rtl::OUString::valueOf(j-nIndex) );
29961 + pStrm->StartElement( A2OUSTR("text:s") );
29962 + pStrm->EndElement( A2OUSTR("text:s") );
29964 + i+=j;
29965 + }
29968 diff -urNp lotuswordpro.bak/source/filter/xfilter/xftextcontent.hxx lotuswordpro/source/filter/xfilter/xftextcontent.hxx
29969 --- lotuswordpro.bak/source/filter/xfilter/xftextcontent.hxx 1970-01-01 08:00:00.000000000 +0800
29970 +++ lotuswordpro/source/filter/xfilter/xftextcontent.hxx 2008-10-22 11:42:34.000000000 +0800
29971 @@ -0,0 +1,105 @@
29972 +/*************************************************************************
29974 + * The Contents of this file are made available subject to the terms of
29975 + * either of the following licenses
29977 + * - GNU Lesser General Public License Version 2.1
29978 + * - Sun Industry Standards Source License Version 1.1
29980 + * Sun Microsystems Inc., October, 2000
29982 + * GNU Lesser General Public License Version 2.1
29983 + * =============================================
29984 + * Copyright 2000 by Sun Microsystems, Inc.
29985 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
29987 + * This library is free software; you can redistribute it and/or
29988 + * modify it under the terms of the GNU Lesser General Public
29989 + * License version 2.1, as published by the Free Software Foundation.
29991 + * This library is distributed in the hope that it will be useful,
29992 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
29993 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
29994 + * Lesser General Public License for more details.
29996 + * You should have received a copy of the GNU Lesser General Public
29997 + * License along with this library; if not, write to the Free Software
29998 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29999 + * MA 02111-1307 USA
30002 + * Sun Industry Standards Source License Version 1.1
30003 + * =================================================
30004 + * The contents of this file are subject to the Sun Industry Standards
30005 + * Source License Version 1.1 (the "License"); You may not use this file
30006 + * except in compliance with the License. You may obtain a copy of the
30007 + * License at http://www.openoffice.org/license.html.
30009 + * Software provided under this License is provided on an "AS IS" basis,
30010 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
30011 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
30012 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
30013 + * See the License for the specific provisions governing your rights and
30014 + * obligations concerning the Software.
30016 + * The Initial Developer of the Original Code is: IBM Corporation
30018 + * Copyright: 2008 by IBM Corporation
30020 + * All Rights Reserved.
30022 + * Contributor(s): _______________________________________
30025 + ************************************************************************/
30026 +/*************************************************************************
30027 + * @file
30028 + * Text content, it's an adapter for string to IXFObject.
30029 + ************************************************************************/
30030 +/*************************************************************************
30031 + * Change History
30032 + 2005-02-02 create and implemente.
30033 + ************************************************************************/
30034 +#ifndef _XFTEXTCONTENT_HXX
30035 +#define _XFTEXTCONTENT_HXX
30037 +#include "xfglobal.hxx"
30038 +#include "xfcontent.hxx"
30040 +class IXFStream;
30042 +/**
30043 + * @brief
30044 + * Adapter for text to content.
30045 + */
30046 +class XFTextContent : public XFContent
30048 +public:
30049 + XFTextContent(){}
30051 + XFTextContent(rtl::OUString text);
30053 + virtual ~XFTextContent();
30055 +public:
30056 + /**
30057 + * @descr Set the text.
30058 + */
30059 + void SetText(const rtl::OUString& text);
30061 + /**
30062 + * @descr return the content.
30063 + * @return text content.
30064 + */
30065 + rtl::OUString GetText();
30067 + virtual enumXFContent GetContentType();
30069 + virtual void ToXml(IXFStream *pStrm);
30071 +private:
30072 + rtl::OUString m_strText;
30075 +#endif
30077 diff -urNp lotuswordpro.bak/source/filter/xfilter/xftextheading.cxx lotuswordpro/source/filter/xfilter/xftextheading.cxx
30078 --- lotuswordpro.bak/source/filter/xfilter/xftextheading.cxx 1970-01-01 08:00:00.000000000 +0800
30079 +++ lotuswordpro/source/filter/xfilter/xftextheading.cxx 2008-10-22 11:42:34.000000000 +0800
30080 @@ -0,0 +1,108 @@
30081 +/*************************************************************************
30083 + * The Contents of this file are made available subject to the terms of
30084 + * either of the following licenses
30086 + * - GNU Lesser General Public License Version 2.1
30087 + * - Sun Industry Standards Source License Version 1.1
30089 + * Sun Microsystems Inc., October, 2000
30091 + * GNU Lesser General Public License Version 2.1
30092 + * =============================================
30093 + * Copyright 2000 by Sun Microsystems, Inc.
30094 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
30096 + * This library is free software; you can redistribute it and/or
30097 + * modify it under the terms of the GNU Lesser General Public
30098 + * License version 2.1, as published by the Free Software Foundation.
30100 + * This library is distributed in the hope that it will be useful,
30101 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
30102 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
30103 + * Lesser General Public License for more details.
30105 + * You should have received a copy of the GNU Lesser General Public
30106 + * License along with this library; if not, write to the Free Software
30107 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
30108 + * MA 02111-1307 USA
30111 + * Sun Industry Standards Source License Version 1.1
30112 + * =================================================
30113 + * The contents of this file are subject to the Sun Industry Standards
30114 + * Source License Version 1.1 (the "License"); You may not use this file
30115 + * except in compliance with the License. You may obtain a copy of the
30116 + * License at http://www.openoffice.org/license.html.
30118 + * Software provided under this License is provided on an "AS IS" basis,
30119 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
30120 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
30121 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
30122 + * See the License for the specific provisions governing your rights and
30123 + * obligations concerning the Software.
30125 + * The Initial Developer of the Original Code is: IBM Corporation
30127 + * Copyright: 2008 by IBM Corporation
30129 + * All Rights Reserved.
30131 + * Contributor(s): _______________________________________
30134 + ************************************************************************/
30135 +/*************************************************************************
30136 + * @file
30137 + * Heading text for OOo.
30138 + ************************************************************************/
30139 +/*************************************************************************
30140 + * Change History
30141 + * 2005-01-07 create this file.
30142 + * 2005-01-10 it works now.
30143 + ************************************************************************/
30144 +#include "xftextheading.hxx"
30145 +#include "xftextcontent.hxx"
30147 +XFTextHeading::XFTextHeading()
30149 + m_pContent = NULL;
30150 + m_nLevel = 0;
30153 +XFTextHeading::~XFTextHeading()
30155 + if( m_pContent )
30156 + delete m_pContent;
30159 +enumXFContent XFTextHeading::GetContentType()
30161 + return enumXFContentHeading;
30164 +void XFTextHeading::SetLevel(sal_Int16 level)
30166 + m_nLevel = level;
30169 +void XFTextHeading::SetText(rtl::OUString text)
30171 + m_pContent = new XFTextContent(text);
30174 +void XFTextHeading::ToXml(IXFStream *pStrm)
30176 + rtl::OUString style = GetStyleName();
30177 + IXFAttrList *pAttrList = pStrm->GetAttrList();
30179 + assert(m_nLevel>0);
30180 + pAttrList->Clear();
30181 + if( style.getLength() )
30182 + pAttrList->AddAttribute( A2OUSTR("text:style-name"), style );
30183 + pAttrList->AddAttribute( A2OUSTR("text:level"), Int16ToOUString(m_nLevel) );
30185 + pStrm->StartElement( A2OUSTR("text:h") );
30186 + m_pContent->ToXml(pStrm);
30187 + pStrm->EndElement( A2OUSTR("text:h") );
30189 \ No newline at end of file
30190 diff -urNp lotuswordpro.bak/source/filter/xfilter/xftextheading.hxx lotuswordpro/source/filter/xfilter/xftextheading.hxx
30191 --- lotuswordpro.bak/source/filter/xfilter/xftextheading.hxx 1970-01-01 08:00:00.000000000 +0800
30192 +++ lotuswordpro/source/filter/xfilter/xftextheading.hxx 2008-10-22 11:42:34.000000000 +0800
30193 @@ -0,0 +1,93 @@
30194 +/*************************************************************************
30196 + * The Contents of this file are made available subject to the terms of
30197 + * either of the following licenses
30199 + * - GNU Lesser General Public License Version 2.1
30200 + * - Sun Industry Standards Source License Version 1.1
30202 + * Sun Microsystems Inc., October, 2000
30204 + * GNU Lesser General Public License Version 2.1
30205 + * =============================================
30206 + * Copyright 2000 by Sun Microsystems, Inc.
30207 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
30209 + * This library is free software; you can redistribute it and/or
30210 + * modify it under the terms of the GNU Lesser General Public
30211 + * License version 2.1, as published by the Free Software Foundation.
30213 + * This library is distributed in the hope that it will be useful,
30214 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
30215 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
30216 + * Lesser General Public License for more details.
30218 + * You should have received a copy of the GNU Lesser General Public
30219 + * License along with this library; if not, write to the Free Software
30220 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
30221 + * MA 02111-1307 USA
30224 + * Sun Industry Standards Source License Version 1.1
30225 + * =================================================
30226 + * The contents of this file are subject to the Sun Industry Standards
30227 + * Source License Version 1.1 (the "License"); You may not use this file
30228 + * except in compliance with the License. You may obtain a copy of the
30229 + * License at http://www.openoffice.org/license.html.
30231 + * Software provided under this License is provided on an "AS IS" basis,
30232 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
30233 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
30234 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
30235 + * See the License for the specific provisions governing your rights and
30236 + * obligations concerning the Software.
30238 + * The Initial Developer of the Original Code is: IBM Corporation
30240 + * Copyright: 2008 by IBM Corporation
30242 + * All Rights Reserved.
30244 + * Contributor(s): _______________________________________
30247 + ************************************************************************/
30248 +/*************************************************************************
30249 + * @file
30250 + * Heading text for OOo.
30251 + ************************************************************************/
30252 +/*************************************************************************
30253 + * Change History
30254 + * 2005-01-07 create this file.
30255 + * 2005-01-10 it works now.
30256 + ************************************************************************/
30257 +#ifndef _XFTEXTHEADING_HXX
30258 +#define _XFTEXTHEADING_HXX
30260 +#include "xfglobal.hxx"
30261 +#include "xfcontent.hxx"
30263 +class XFTextContent;
30264 +/**
30265 + * @descr
30266 + * <text:h> object. It has a single property text:level.
30267 + * This object use the same style type with <text:p>
30268 + */
30269 +class XFTextHeading : public XFContent
30271 +public:
30272 + XFTextHeading();
30273 + virtual ~XFTextHeading();
30275 + void SetLevel(sal_Int16 level);
30276 + void SetText(rtl::OUString text);
30278 + virtual enumXFContent GetContentType();
30279 + virtual void ToXml(IXFStream *pStrm);
30280 +private:
30281 + XFTextContent *m_pContent;
30282 + sal_Int16 m_nLevel;
30285 +#endif
30287 diff -urNp lotuswordpro.bak/source/filter/xfilter/xftextspan.cxx lotuswordpro/source/filter/xfilter/xftextspan.cxx
30288 --- lotuswordpro.bak/source/filter/xfilter/xftextspan.cxx 1970-01-01 08:00:00.000000000 +0800
30289 +++ lotuswordpro/source/filter/xfilter/xftextspan.cxx 2008-10-22 11:42:34.000000000 +0800
30290 @@ -0,0 +1,191 @@
30291 +/*************************************************************************
30293 + * The Contents of this file are made available subject to the terms of
30294 + * either of the following licenses
30296 + * - GNU Lesser General Public License Version 2.1
30297 + * - Sun Industry Standards Source License Version 1.1
30299 + * Sun Microsystems Inc., October, 2000
30301 + * GNU Lesser General Public License Version 2.1
30302 + * =============================================
30303 + * Copyright 2000 by Sun Microsystems, Inc.
30304 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
30306 + * This library is free software; you can redistribute it and/or
30307 + * modify it under the terms of the GNU Lesser General Public
30308 + * License version 2.1, as published by the Free Software Foundation.
30310 + * This library is distributed in the hope that it will be useful,
30311 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
30312 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
30313 + * Lesser General Public License for more details.
30315 + * You should have received a copy of the GNU Lesser General Public
30316 + * License along with this library; if not, write to the Free Software
30317 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
30318 + * MA 02111-1307 USA
30321 + * Sun Industry Standards Source License Version 1.1
30322 + * =================================================
30323 + * The contents of this file are subject to the Sun Industry Standards
30324 + * Source License Version 1.1 (the "License"); You may not use this file
30325 + * except in compliance with the License. You may obtain a copy of the
30326 + * License at http://www.openoffice.org/license.html.
30328 + * Software provided under this License is provided on an "AS IS" basis,
30329 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
30330 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
30331 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
30332 + * See the License for the specific provisions governing your rights and
30333 + * obligations concerning the Software.
30335 + * The Initial Developer of the Original Code is: IBM Corporation
30337 + * Copyright: 2008 by IBM Corporation
30339 + * All Rights Reserved.
30341 + * Contributor(s): _______________________________________
30344 + ************************************************************************/
30345 +/*************************************************************************
30346 + * @file
30347 + * An span of text with style.
30348 + ************************************************************************/
30349 +/*************************************************************************
30350 + * Change History
30351 + * 2004-12-23 create this file.
30352 + ************************************************************************/
30353 +#include "xftextspan.hxx"
30354 +#include "ixfstream.hxx"
30355 +#include "ixfattrlist.hxx"
30356 +#include "xftextcontent.hxx"
30358 +XFTextSpan::XFTextSpan()
30363 +XFTextSpan::XFTextSpan(rtl::OUString& text,
30364 + rtl::OUString& style
30367 + Add(text);
30368 + SetStyleName(style);
30371 +XFTextSpan::~XFTextSpan()
30373 + std::vector<IXFContent*>::iterator it;
30374 + for( it = m_aContents.begin(); it != m_aContents.end(); it++ )
30376 + IXFContent *pContent = *it;
30377 + if( pContent )
30379 + delete pContent;
30382 + m_aContents.clear();
30385 +enumXFContent XFTextSpan::GetContentType()
30387 + return enumXFContentSpan;
30390 +void XFTextSpan::SetText(rtl::OUString& text)
30392 + m_aContents.clear();
30393 + Add(text);
30396 +rtl::OUString XFTextSpan::GetText()
30398 + rtl::OUString text;
30399 + std::vector<IXFContent*>::iterator it;
30401 + it = m_aContents.begin();
30402 + if( it != m_aContents.end() )
30404 + IXFContent *pContent = *it;
30405 + if( pContent->GetContentType() != enumXFContentText )
30407 + assert(false);
30409 + XFTextContent *pText = (XFTextContent*)pContent;
30410 + if( pText )
30411 + text = pText->GetText();
30414 + return text;
30417 +void XFTextSpan::Add(IXFContent *pContent)
30419 + m_aContents.push_back(pContent);
30422 +void XFTextSpan::Add(rtl::OUString& text)
30424 + IXFContent *pText = new XFTextContent(text);
30425 + Add(pText);
30428 +void XFTextSpan::ToXml(IXFStream *pStrm)
30430 + rtl::OUString style = GetStyleName();
30431 + IXFAttrList *pAttrList = pStrm->GetAttrList();
30433 + assert(pAttrList);
30435 + pAttrList->Clear();
30436 + if( style.getLength() )
30437 + pAttrList->AddAttribute( A2OUSTR("text:style-name"), GetStyleName() );
30438 + pStrm->StartElement( A2OUSTR("text:span") );
30440 + std::vector<IXFContent*>::iterator it;
30441 + for( it= m_aContents.begin(); it!= m_aContents.end(); it++ )
30443 + IXFContent *pContent = *it;
30444 + if( pContent )
30445 + pContent->ToXml(pStrm);
30448 + pStrm->EndElement( A2OUSTR("text:span") );
30451 +void XFTextSpanStart::ToXml(IXFStream *pStrm)
30453 + rtl::OUString style = GetStyleName();
30454 + IXFAttrList *pAttrList = pStrm->GetAttrList();
30456 + assert(pAttrList);
30458 + pAttrList->Clear();
30459 + if( style.getLength() )
30460 + pAttrList->AddAttribute( A2OUSTR("text:style-name"), GetStyleName() );
30461 + pStrm->StartElement( A2OUSTR("text:span") );
30463 + std::vector<IXFContent*>::iterator it;
30464 + for( it= m_aContents.begin(); it!= m_aContents.end(); it++ )
30466 + IXFContent *pContent = *it;
30467 + if( pContent )
30468 + pContent->ToXml(pStrm);
30469 + }
30471 +void XFTextSpanEnd::ToXml(IXFStream *pStrm)
30473 + std::vector<IXFContent*>::iterator it;
30474 + for( it= m_aContents.begin(); it!= m_aContents.end(); it++ )
30476 + IXFContent *pContent = *it;
30477 + if( pContent )
30478 + pContent->ToXml(pStrm);
30479 + }
30480 + pStrm->EndElement( A2OUSTR("text:span") );
30482 diff -urNp lotuswordpro.bak/source/filter/xfilter/xftextspan.hxx lotuswordpro/source/filter/xfilter/xftextspan.hxx
30483 --- lotuswordpro.bak/source/filter/xfilter/xftextspan.hxx 1970-01-01 08:00:00.000000000 +0800
30484 +++ lotuswordpro/source/filter/xfilter/xftextspan.hxx 2008-10-22 11:42:34.000000000 +0800
30485 @@ -0,0 +1,103 @@
30486 +/*************************************************************************
30488 + * The Contents of this file are made available subject to the terms of
30489 + * either of the following licenses
30491 + * - GNU Lesser General Public License Version 2.1
30492 + * - Sun Industry Standards Source License Version 1.1
30494 + * Sun Microsystems Inc., October, 2000
30496 + * GNU Lesser General Public License Version 2.1
30497 + * =============================================
30498 + * Copyright 2000 by Sun Microsystems, Inc.
30499 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
30501 + * This library is free software; you can redistribute it and/or
30502 + * modify it under the terms of the GNU Lesser General Public
30503 + * License version 2.1, as published by the Free Software Foundation.
30505 + * This library is distributed in the hope that it will be useful,
30506 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
30507 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
30508 + * Lesser General Public License for more details.
30510 + * You should have received a copy of the GNU Lesser General Public
30511 + * License along with this library; if not, write to the Free Software
30512 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
30513 + * MA 02111-1307 USA
30516 + * Sun Industry Standards Source License Version 1.1
30517 + * =================================================
30518 + * The contents of this file are subject to the Sun Industry Standards
30519 + * Source License Version 1.1 (the "License"); You may not use this file
30520 + * except in compliance with the License. You may obtain a copy of the
30521 + * License at http://www.openoffice.org/license.html.
30523 + * Software provided under this License is provided on an "AS IS" basis,
30524 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
30525 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
30526 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
30527 + * See the License for the specific provisions governing your rights and
30528 + * obligations concerning the Software.
30530 + * The Initial Developer of the Original Code is: IBM Corporation
30532 + * Copyright: 2008 by IBM Corporation
30534 + * All Rights Reserved.
30536 + * Contributor(s): _______________________________________
30539 + ************************************************************************/
30540 +/*************************************************************************
30541 + * @file
30542 + * An span of text with style.
30543 + ************************************************************************/
30544 +/*************************************************************************
30545 + * Change History
30546 + * 2004-12-23 create this file.
30547 + ************************************************************************/
30548 +#ifndef _XFTEXTSPAN_HXX
30549 +#define _XFTEXTSPAN_HXX
30551 +#include "xfglobal.hxx"
30552 +#include "xfcontent.hxx"
30553 +#include <vector>
30555 +class IXFStream;
30557 +class XFTextSpan : public XFContent
30559 +public:
30560 + XFTextSpan();
30561 + XFTextSpan(rtl::OUString& text, rtl::OUString& style );
30563 + virtual ~XFTextSpan();
30565 + void SetText(rtl::OUString& text);
30566 + rtl::OUString GetText();
30567 + void Add(IXFContent *pContent);
30568 + void Add(rtl::OUString& text);
30570 + virtual enumXFContent GetContentType();
30571 + virtual void ToXml(IXFStream *pStrm);
30572 +protected:
30573 + std::vector<IXFContent*> m_aContents;
30576 +class XFTextSpanStart : public XFTextSpan //for adding style of power field
30578 +public:
30579 + virtual void ToXml(IXFStream *pStrm);
30581 +class XFTextSpanEnd : public XFTextSpan //for adding style of power field
30583 +public:
30584 + virtual void ToXml(IXFStream *pStrm);
30587 +#endif
30589 diff -urNp lotuswordpro.bak/source/filter/xfilter/xftextstyle.cxx lotuswordpro/source/filter/xfilter/xftextstyle.cxx
30590 --- lotuswordpro.bak/source/filter/xfilter/xftextstyle.cxx 1970-01-01 08:00:00.000000000 +0800
30591 +++ lotuswordpro/source/filter/xfilter/xftextstyle.cxx 2008-10-22 11:42:34.000000000 +0800
30592 @@ -0,0 +1,142 @@
30593 +/*************************************************************************
30595 + * The Contents of this file are made available subject to the terms of
30596 + * either of the following licenses
30598 + * - GNU Lesser General Public License Version 2.1
30599 + * - Sun Industry Standards Source License Version 1.1
30601 + * Sun Microsystems Inc., October, 2000
30603 + * GNU Lesser General Public License Version 2.1
30604 + * =============================================
30605 + * Copyright 2000 by Sun Microsystems, Inc.
30606 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
30608 + * This library is free software; you can redistribute it and/or
30609 + * modify it under the terms of the GNU Lesser General Public
30610 + * License version 2.1, as published by the Free Software Foundation.
30612 + * This library is distributed in the hope that it will be useful,
30613 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
30614 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
30615 + * Lesser General Public License for more details.
30617 + * You should have received a copy of the GNU Lesser General Public
30618 + * License along with this library; if not, write to the Free Software
30619 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
30620 + * MA 02111-1307 USA
30623 + * Sun Industry Standards Source License Version 1.1
30624 + * =================================================
30625 + * The contents of this file are subject to the Sun Industry Standards
30626 + * Source License Version 1.1 (the "License"); You may not use this file
30627 + * except in compliance with the License. You may obtain a copy of the
30628 + * License at http://www.openoffice.org/license.html.
30630 + * Software provided under this License is provided on an "AS IS" basis,
30631 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
30632 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
30633 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
30634 + * See the License for the specific provisions governing your rights and
30635 + * obligations concerning the Software.
30637 + * The Initial Developer of the Original Code is: IBM Corporation
30639 + * Copyright: 2008 by IBM Corporation
30641 + * All Rights Reserved.
30643 + * Contributor(s): _______________________________________
30646 + ************************************************************************/
30647 +/*************************************************************************
30648 + * @file
30649 + * Style for <text:p> or <text:h> or <text:span>
30650 + * Now we have only font attributes.
30651 + ************************************************************************/
30652 +/*************************************************************************
30653 + * Change History
30654 + * 2004-12-26 create this file.
30655 + ************************************************************************/
30656 +#include "xftextstyle.hxx"
30657 +#include "ixfattrlist.hxx"
30658 +#include "ixfstream.hxx"
30659 +#include "xffont.hxx"
30660 +#include "xfutil.hxx"
30662 +XFTextStyle::XFTextStyle()
30664 + m_pFont = NULL;
30667 +XFTextStyle::~XFTextStyle()
30671 +void XFTextStyle::SetFont(XFFont *font)
30673 + m_pFont = font;
30676 +sal_Bool XFTextStyle::Equal(IXFStyle *pStyle)
30678 + if( !pStyle || pStyle->GetStyleFamily() != enumXFStyleText )
30680 + return sal_False;
30683 + XFTextStyle *pOther = (XFTextStyle*)pStyle;
30684 + if( !pOther )
30686 + return sal_False;
30689 + if( m_pFont )
30691 + if( !pOther->m_pFont )
30692 + return sal_False;
30693 + if( *m_pFont != *pOther->m_pFont )
30694 + return sal_False;
30696 + else if( pOther->m_pFont )
30697 + return sal_False;
30699 + return sal_True;
30702 +enumXFStyle XFTextStyle::GetStyleFamily()
30704 + return enumXFStyleText;
30707 +void XFTextStyle::ToXml(IXFStream *strm)
30709 + IXFAttrList *pAttrList = strm->GetAttrList();
30710 + rtl::OUString style = GetStyleName();
30712 + pAttrList->Clear();
30713 + if( style.getLength() )
30714 + pAttrList->AddAttribute(rtl::OUString::createFromAscii("style:name"),GetStyleName());
30715 + if( GetParentStyleName().getLength() > 0 )
30716 + pAttrList->AddAttribute(A2OUSTR("style:parent-style-name"),GetParentStyleName());
30718 + pAttrList->AddAttribute(rtl::OUString::createFromAscii("style:family"),A2OUSTR("text") );
30719 + strm->StartElement(rtl::OUString::createFromAscii("style:style"));
30721 + //Font properties:
30722 + pAttrList->Clear();
30723 + //font name:
30724 + if( m_pFont )
30725 + m_pFont->ToXml(strm);
30727 + strm->StartElement(rtl::OUString::createFromAscii("style:properties"));
30728 + strm->EndElement(rtl::OUString::createFromAscii("style:properties"));
30730 + strm->EndElement(rtl::OUString::createFromAscii("style:style"));
30735 diff -urNp lotuswordpro.bak/source/filter/xfilter/xftextstyle.hxx lotuswordpro/source/filter/xfilter/xftextstyle.hxx
30736 --- lotuswordpro.bak/source/filter/xfilter/xftextstyle.hxx 1970-01-01 08:00:00.000000000 +0800
30737 +++ lotuswordpro/source/filter/xfilter/xftextstyle.hxx 2008-10-22 11:42:34.000000000 +0800
30738 @@ -0,0 +1,123 @@
30739 +/*************************************************************************
30741 + * The Contents of this file are made available subject to the terms of
30742 + * either of the following licenses
30744 + * - GNU Lesser General Public License Version 2.1
30745 + * - Sun Industry Standards Source License Version 1.1
30747 + * Sun Microsystems Inc., October, 2000
30749 + * GNU Lesser General Public License Version 2.1
30750 + * =============================================
30751 + * Copyright 2000 by Sun Microsystems, Inc.
30752 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
30754 + * This library is free software; you can redistribute it and/or
30755 + * modify it under the terms of the GNU Lesser General Public
30756 + * License version 2.1, as published by the Free Software Foundation.
30758 + * This library is distributed in the hope that it will be useful,
30759 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
30760 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
30761 + * Lesser General Public License for more details.
30763 + * You should have received a copy of the GNU Lesser General Public
30764 + * License along with this library; if not, write to the Free Software
30765 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
30766 + * MA 02111-1307 USA
30769 + * Sun Industry Standards Source License Version 1.1
30770 + * =================================================
30771 + * The contents of this file are subject to the Sun Industry Standards
30772 + * Source License Version 1.1 (the "License"); You may not use this file
30773 + * except in compliance with the License. You may obtain a copy of the
30774 + * License at http://www.openoffice.org/license.html.
30776 + * Software provided under this License is provided on an "AS IS" basis,
30777 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
30778 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
30779 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
30780 + * See the License for the specific provisions governing your rights and
30781 + * obligations concerning the Software.
30783 + * The Initial Developer of the Original Code is: IBM Corporation
30785 + * Copyright: 2008 by IBM Corporation
30787 + * All Rights Reserved.
30789 + * Contributor(s): _______________________________________
30792 + ************************************************************************/
30793 +/*************************************************************************
30794 + * @file
30795 + * Style for <text:p> or <text:h> or <text:span>
30796 + * Now we have only font attributes.
30797 + ************************************************************************/
30798 +/*************************************************************************
30799 + * Change History
30800 + * 2004-12-26 create this file.
30801 + * 2005-01-04 Change the static style id.
30802 + * 2005-01-20 Get rid of the static id.
30803 + ************************************************************************/
30804 +#ifndef _XFTEXTSTYLE_HXX
30805 +#define _XFTEXTSTYLE_HXX
30807 +#include "xfglobal.hxx"
30808 +#include "xfstyle.hxx"
30810 +class IXFStream;
30811 +class XFFont;
30813 +class XFTextStyle : public XFStyle
30815 +public:
30816 + XFTextStyle();
30818 + virtual ~XFTextStyle();
30820 +public:
30821 + /**
30822 + * @descr: set the font for the text span.
30823 + */
30824 + void SetFont(XFFont *font);
30826 + XFFont* GetFont(){ return m_pFont; }
30829 + virtual enumXFStyle GetStyleFamily();
30831 + virtual sal_Bool Equal(IXFStyle *pStyle);
30833 + virtual void ToXml(IXFStream *strm);
30835 +private:
30836 + XFFont *m_pFont;
30839 +#endif
30862 diff -urNp lotuswordpro.bak/source/filter/xfilter/xftexttable.cxx lotuswordpro/source/filter/xfilter/xftexttable.cxx
30863 --- lotuswordpro.bak/source/filter/xfilter/xftexttable.cxx 1970-01-01 08:00:00.000000000 +0800
30864 +++ lotuswordpro/source/filter/xfilter/xftexttable.cxx 2008-10-22 11:42:34.000000000 +0800
30865 @@ -0,0 +1,142 @@
30866 +/*************************************************************************
30868 + * The Contents of this file are made available subject to the terms of
30869 + * either of the following licenses
30871 + * - GNU Lesser General Public License Version 2.1
30872 + * - Sun Industry Standards Source License Version 1.1
30874 + * Sun Microsystems Inc., October, 2000
30876 + * GNU Lesser General Public License Version 2.1
30877 + * =============================================
30878 + * Copyright 2000 by Sun Microsystems, Inc.
30879 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
30881 + * This library is free software; you can redistribute it and/or
30882 + * modify it under the terms of the GNU Lesser General Public
30883 + * License version 2.1, as published by the Free Software Foundation.
30885 + * This library is distributed in the hope that it will be useful,
30886 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
30887 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
30888 + * Lesser General Public License for more details.
30890 + * You should have received a copy of the GNU Lesser General Public
30891 + * License along with this library; if not, write to the Free Software
30892 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
30893 + * MA 02111-1307 USA
30896 + * Sun Industry Standards Source License Version 1.1
30897 + * =================================================
30898 + * The contents of this file are subject to the Sun Industry Standards
30899 + * Source License Version 1.1 (the "License"); You may not use this file
30900 + * except in compliance with the License. You may obtain a copy of the
30901 + * License at http://www.openoffice.org/license.html.
30903 + * Software provided under this License is provided on an "AS IS" basis,
30904 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
30905 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
30906 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
30907 + * See the License for the specific provisions governing your rights and
30908 + * obligations concerning the Software.
30910 + * The Initial Developer of the Original Code is: IBM Corporation
30912 + * Copyright: 2008 by IBM Corporation
30914 + * All Rights Reserved.
30916 + * Contributor(s): _______________________________________
30919 + ************************************************************************/
30920 +/*************************************************************************
30921 + * @file
30922 + * Text table object. It's the table used in writer.
30923 + ************************************************************************/
30924 +/*************************************************************************
30925 + * Change History
30926 + * 2005-03-31 create and implements.
30927 + ************************************************************************/
30928 +#include "xftexttable.hxx"
30930 +XFTextTable::XFTextTable()
30935 +void XFTextTable::SetColCount(sal_Int32 col)
30937 + m_nColCount = col;
30940 +void XFTextTable::SetRowCount(sal_Int32 row)
30942 + m_nRowCount = row;
30945 +void XFTextTable::SetCell(sal_Int32 row, sal_Int32 col, XFCell *pCell)
30947 + if( row<0 || col<0 || !pCell )
30948 + return;
30950 + XFRow *pRow = GetRow(row);
30951 + if( !pRow )
30953 + pRow = new XFRow();
30954 + pRow->SetRow(row);
30955 + AddRow(pRow);
30957 + pRow = GetRow(row);
30959 + if( !pRow )
30960 + return;
30961 + pCell->SetCol(col);
30963 + pRow->AddCell(pCell);
30966 +virtual void XFTextTable::ToXml(IXFStream *pStrm)
30968 + for( int i=0; i<m_nColCount; i++ )
30970 + rtl::OUString strColStyle = GetColumnStyle(i);
30971 + if( strColStyle.getLength()>0 )
30972 + SetColumnStyle(col, m_strDefColStyle);
30975 + for( int i=0; i<m_nRowCount; i++ )
30977 + XFRow *pRow = GetRow(i);
30978 + if( !pRow )
30980 + pRow = new XFRow();
30981 + pRow->SetRow(i);
30982 + pRow->SetStyleName(m_strDefRowStyle);
30984 + XFCell *pCell = new XFCell();
30985 + pCell->SetColumnSpaned(m_nColCount);
30986 + pRow->AddCell(pCell);
30988 + SetRow(i, pRow);
30990 + else
30992 + for( int j=0; j<m_nColCount; j++ )
30994 + XFCell *pCell = pRow->GetCell(j);
30995 + if( !pCell )
30997 + pCell = new XFCell();
30998 + pCell->SetCol(j);
30999 + pCell->SetStyleName(m_strDefCellStyle);
31000 + pRow->AddCell(pCell);
31006 + XFTable::ToXml(pStrm);
31008 \ No newline at end of file
31009 diff -urNp lotuswordpro.bak/source/filter/xfilter/xftexttable.hxx lotuswordpro/source/filter/xfilter/xftexttable.hxx
31010 --- lotuswordpro.bak/source/filter/xfilter/xftexttable.hxx 1970-01-01 08:00:00.000000000 +0800
31011 +++ lotuswordpro/source/filter/xfilter/xftexttable.hxx 2008-10-22 11:42:34.000000000 +0800
31012 @@ -0,0 +1,87 @@
31013 +/*************************************************************************
31015 + * The Contents of this file are made available subject to the terms of
31016 + * either of the following licenses
31018 + * - GNU Lesser General Public License Version 2.1
31019 + * - Sun Industry Standards Source License Version 1.1
31021 + * Sun Microsystems Inc., October, 2000
31023 + * GNU Lesser General Public License Version 2.1
31024 + * =============================================
31025 + * Copyright 2000 by Sun Microsystems, Inc.
31026 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
31028 + * This library is free software; you can redistribute it and/or
31029 + * modify it under the terms of the GNU Lesser General Public
31030 + * License version 2.1, as published by the Free Software Foundation.
31032 + * This library is distributed in the hope that it will be useful,
31033 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
31034 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
31035 + * Lesser General Public License for more details.
31037 + * You should have received a copy of the GNU Lesser General Public
31038 + * License along with this library; if not, write to the Free Software
31039 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31040 + * MA 02111-1307 USA
31043 + * Sun Industry Standards Source License Version 1.1
31044 + * =================================================
31045 + * The contents of this file are subject to the Sun Industry Standards
31046 + * Source License Version 1.1 (the "License"); You may not use this file
31047 + * except in compliance with the License. You may obtain a copy of the
31048 + * License at http://www.openoffice.org/license.html.
31050 + * Software provided under this License is provided on an "AS IS" basis,
31051 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
31052 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
31053 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
31054 + * See the License for the specific provisions governing your rights and
31055 + * obligations concerning the Software.
31057 + * The Initial Developer of the Original Code is: IBM Corporation
31059 + * Copyright: 2008 by IBM Corporation
31061 + * All Rights Reserved.
31063 + * Contributor(s): _______________________________________
31066 + ************************************************************************/
31067 +/*************************************************************************
31068 + * @file
31069 + * Text table object. It's the table used in writer.
31070 + ************************************************************************/
31071 +/*************************************************************************
31072 + * Change History
31073 + * 2005-03-31 create and implements.
31074 + ************************************************************************/
31075 +#ifndef _XFTEXTTABLE_HXX
31076 +#define _XFTEXTTABLE_HXX
31078 +#include "xftable.hxx"
31080 +class XFTextTable : public XFTable
31082 +public:
31083 + XFTextTable();
31085 +private:
31086 + void SetRowCount(sal_Int32 row);
31088 + void SetColCount(sal_Int32 col);
31090 + rtl::OUString SetCell(sal_Int32 row, sal_Int32 col, XFCell *pCell);
31092 + virtual void ToXml(IXFStream *pStrm);
31094 +private:
31095 + sal_Int32 m_nColCount;
31096 + sal_Int32 m_nRowCount;
31099 +#endif
31100 \ No newline at end of file
31101 diff -urNp lotuswordpro.bak/source/filter/xfilter/xftime.cxx lotuswordpro/source/filter/xfilter/xftime.cxx
31102 --- lotuswordpro.bak/source/filter/xfilter/xftime.cxx 1970-01-01 08:00:00.000000000 +0800
31103 +++ lotuswordpro/source/filter/xfilter/xftime.cxx 2008-10-22 11:42:34.000000000 +0800
31104 @@ -0,0 +1,91 @@
31105 +/*************************************************************************
31107 + * The Contents of this file are made available subject to the terms of
31108 + * either of the following licenses
31110 + * - GNU Lesser General Public License Version 2.1
31111 + * - Sun Industry Standards Source License Version 1.1
31113 + * Sun Microsystems Inc., October, 2000
31115 + * GNU Lesser General Public License Version 2.1
31116 + * =============================================
31117 + * Copyright 2000 by Sun Microsystems, Inc.
31118 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
31120 + * This library is free software; you can redistribute it and/or
31121 + * modify it under the terms of the GNU Lesser General Public
31122 + * License version 2.1, as published by the Free Software Foundation.
31124 + * This library is distributed in the hope that it will be useful,
31125 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
31126 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
31127 + * Lesser General Public License for more details.
31129 + * You should have received a copy of the GNU Lesser General Public
31130 + * License along with this library; if not, write to the Free Software
31131 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31132 + * MA 02111-1307 USA
31135 + * Sun Industry Standards Source License Version 1.1
31136 + * =================================================
31137 + * The contents of this file are subject to the Sun Industry Standards
31138 + * Source License Version 1.1 (the "License"); You may not use this file
31139 + * except in compliance with the License. You may obtain a copy of the
31140 + * License at http://www.openoffice.org/license.html.
31142 + * Software provided under this License is provided on an "AS IS" basis,
31143 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
31144 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
31145 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
31146 + * See the License for the specific provisions governing your rights and
31147 + * obligations concerning the Software.
31149 + * The Initial Developer of the Original Code is: IBM Corporation
31151 + * Copyright: 2008 by IBM Corporation
31153 + * All Rights Reserved.
31155 + * Contributor(s): _______________________________________
31158 + ************************************************************************/
31159 +/*************************************************************************
31160 + * @file
31161 + * Time field with time style.
31162 + ************************************************************************/
31163 +/*************************************************************************
31164 + * Change History
31165 + * 2005-01-21 create this file.
31166 + ************************************************************************/
31167 +#include "xftime.hxx"
31169 +XFTime::XFTime()
31171 + m_bFixed = 0;
31172 + rtl_zeroMemory(&m_aDateTime,sizeof(m_aDateTime));
31175 +XFTime::~XFTime()
31179 +void XFTime::ToXml(IXFStream *pStrm)
31181 + IXFAttrList *pAttrList = pStrm->GetAttrList();
31183 + pAttrList->Clear();
31184 + if( GetStyleName().getLength() > 0 )
31185 + pAttrList->AddAttribute( A2OUSTR("style:data-style-name"), GetStyleName() );
31186 + pAttrList->AddAttribute( A2OUSTR("text:time-value"), DateTimeToOUString(m_aDateTime) );
31187 + if( m_bFixed )
31188 + pAttrList->AddAttribute( A2OUSTR("text:fixed"), A2OUSTR("true") );
31190 + pStrm->StartElement( A2OUSTR("text:time") );
31191 + pStrm->Characters(m_strText);
31192 + pStrm->EndElement( A2OUSTR("text:time") );
31196 diff -urNp lotuswordpro.bak/source/filter/xfilter/xftime.hxx lotuswordpro/source/filter/xfilter/xftime.hxx
31197 --- lotuswordpro.bak/source/filter/xfilter/xftime.hxx 1970-01-01 08:00:00.000000000 +0800
31198 +++ lotuswordpro/source/filter/xfilter/xftime.hxx 2008-10-22 11:42:34.000000000 +0800
31199 @@ -0,0 +1,109 @@
31200 +/*************************************************************************
31202 + * The Contents of this file are made available subject to the terms of
31203 + * either of the following licenses
31205 + * - GNU Lesser General Public License Version 2.1
31206 + * - Sun Industry Standards Source License Version 1.1
31208 + * Sun Microsystems Inc., October, 2000
31210 + * GNU Lesser General Public License Version 2.1
31211 + * =============================================
31212 + * Copyright 2000 by Sun Microsystems, Inc.
31213 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
31215 + * This library is free software; you can redistribute it and/or
31216 + * modify it under the terms of the GNU Lesser General Public
31217 + * License version 2.1, as published by the Free Software Foundation.
31219 + * This library is distributed in the hope that it will be useful,
31220 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
31221 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
31222 + * Lesser General Public License for more details.
31224 + * You should have received a copy of the GNU Lesser General Public
31225 + * License along with this library; if not, write to the Free Software
31226 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31227 + * MA 02111-1307 USA
31230 + * Sun Industry Standards Source License Version 1.1
31231 + * =================================================
31232 + * The contents of this file are subject to the Sun Industry Standards
31233 + * Source License Version 1.1 (the "License"); You may not use this file
31234 + * except in compliance with the License. You may obtain a copy of the
31235 + * License at http://www.openoffice.org/license.html.
31237 + * Software provided under this License is provided on an "AS IS" basis,
31238 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
31239 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
31240 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
31241 + * See the License for the specific provisions governing your rights and
31242 + * obligations concerning the Software.
31244 + * The Initial Developer of the Original Code is: IBM Corporation
31246 + * Copyright: 2008 by IBM Corporation
31248 + * All Rights Reserved.
31250 + * Contributor(s): _______________________________________
31253 + ************************************************************************/
31254 +/*************************************************************************
31255 + * @file
31256 + * Time field with time style.
31257 + ************************************************************************/
31258 +/*************************************************************************
31259 + * Change History
31260 + * 2005-01-21 create this file.
31261 + ************************************************************************/
31262 +#ifndef _XFTIME_HXX
31263 +#define _XFTIME_HXX
31265 +#include "xfglobal.hxx"
31266 +#include "xfcontent.hxx"
31268 +class XFTime : public XFContent
31270 +public:
31271 + XFTime();
31273 + virtual ~XFTime();
31275 +public:
31276 + void SetDate(XFDateTime& dt);
31278 + void SetText(rtl::OUString& text);
31280 + void SetFixed(sal_Bool fixed = sal_True);
31282 + virtual void ToXml(IXFStream *pStrm);
31284 +private:
31285 + sal_Bool m_bFixed;
31287 + rtl::OUString m_strText;
31289 + XFDateTime m_aDateTime;
31292 +inline void XFTime::SetDate(XFDateTime& dt)
31294 + m_aDateTime = dt;
31297 +inline void XFTime::SetText(rtl::OUString& text)
31299 + m_strText = text;
31302 +inline void XFTime::SetFixed(sal_Bool fixed)
31304 + m_bFixed = fixed;
31307 +#endif
31309 diff -urNp lotuswordpro.bak/source/filter/xfilter/xftimestyle.cxx lotuswordpro/source/filter/xfilter/xftimestyle.cxx
31310 --- lotuswordpro.bak/source/filter/xfilter/xftimestyle.cxx 1970-01-01 08:00:00.000000000 +0800
31311 +++ lotuswordpro/source/filter/xfilter/xftimestyle.cxx 2008-10-22 11:42:34.000000000 +0800
31312 @@ -0,0 +1,152 @@
31313 +/*************************************************************************
31315 + * The Contents of this file are made available subject to the terms of
31316 + * either of the following licenses
31318 + * - GNU Lesser General Public License Version 2.1
31319 + * - Sun Industry Standards Source License Version 1.1
31321 + * Sun Microsystems Inc., October, 2000
31323 + * GNU Lesser General Public License Version 2.1
31324 + * =============================================
31325 + * Copyright 2000 by Sun Microsystems, Inc.
31326 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
31328 + * This library is free software; you can redistribute it and/or
31329 + * modify it under the terms of the GNU Lesser General Public
31330 + * License version 2.1, as published by the Free Software Foundation.
31332 + * This library is distributed in the hope that it will be useful,
31333 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
31334 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
31335 + * Lesser General Public License for more details.
31337 + * You should have received a copy of the GNU Lesser General Public
31338 + * License along with this library; if not, write to the Free Software
31339 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31340 + * MA 02111-1307 USA
31343 + * Sun Industry Standards Source License Version 1.1
31344 + * =================================================
31345 + * The contents of this file are subject to the Sun Industry Standards
31346 + * Source License Version 1.1 (the "License"); You may not use this file
31347 + * except in compliance with the License. You may obtain a copy of the
31348 + * License at http://www.openoffice.org/license.html.
31350 + * Software provided under this License is provided on an "AS IS" basis,
31351 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
31352 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
31353 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
31354 + * See the License for the specific provisions governing your rights and
31355 + * obligations concerning the Software.
31357 + * The Initial Developer of the Original Code is: IBM Corporation
31359 + * Copyright: 2008 by IBM Corporation
31361 + * All Rights Reserved.
31363 + * Contributor(s): _______________________________________
31366 + ************************************************************************/
31367 +/*************************************************************************
31368 + * @file
31369 + * Time style. The TIme format for time field.
31370 + ************************************************************************/
31371 +/*************************************************************************
31372 + * Change History
31373 + * 2005-01-20 create this file.
31374 + ************************************************************************/
31376 +#include "xftimestyle.hxx"
31378 +XFTimePart::XFTimePart()
31380 + m_nDecimalPos = 0;
31383 +void XFTimePart::ToXml(IXFStream *pStrm)
31385 + IXFAttrList *pAttrList = pStrm->GetAttrList();
31387 + switch(m_ePart)
31389 + case enumXFDateHour:
31390 + pAttrList->Clear();
31391 + if( m_bLongFmt )
31392 + pAttrList->AddAttribute( A2OUSTR("number:style"), A2OUSTR("long") );
31393 + pStrm->StartElement( A2OUSTR("number:hours") );
31394 + pStrm->EndElement( A2OUSTR("number:hours") );
31395 + break;
31396 + case enumXFDateMinute:
31397 + pAttrList->Clear();
31398 + if( m_bLongFmt )
31399 + pAttrList->AddAttribute( A2OUSTR("number:style"), A2OUSTR("long") );
31400 + if( m_nDecimalPos>0 )
31401 + pAttrList->AddAttribute( A2OUSTR("number:decimal-places"), Int32ToOUString(m_nDecimalPos) );
31403 + pStrm->StartElement( A2OUSTR("number:minutes") );
31404 + pStrm->EndElement( A2OUSTR("number:minutes") );
31405 + break;
31406 + case enumXFDateSecond:
31407 + pAttrList->Clear();
31408 + if( m_bLongFmt )
31409 + pAttrList->AddAttribute( A2OUSTR("number:style"), A2OUSTR("long") );
31410 + pStrm->StartElement( A2OUSTR("number:seconds") );
31411 + pStrm->EndElement( A2OUSTR("number:seconds") );
31412 + break;
31413 + case enumXFDateText:
31414 + pAttrList->Clear();
31415 + pStrm->StartElement( A2OUSTR("number:text") );
31416 + pStrm->Characters( m_strText );
31417 + pStrm->EndElement( A2OUSTR("number:text") );
31418 + break;
31422 +XFTimeStyle::XFTimeStyle()
31424 + m_bFixed = sal_True;
31425 + m_bAmPm = sal_False;
31426 + m_bTruncate = sal_True;
31429 +XFTimeStyle::~XFTimeStyle()
31433 +enumXFStyle XFTimeStyle::GetStyleFamily()
31435 + return enumXFStyleTime;
31439 +void XFTimeStyle::ToXml(IXFStream *pStrm)
31441 + IXFAttrList *pAttrList = pStrm->GetAttrList();
31443 + pAttrList->Clear();
31444 + pAttrList->AddAttribute( A2OUSTR("style:name"), GetStyleName() );
31445 + if( GetParentStyleName().getLength() > 0 )
31446 + pAttrList->AddAttribute(A2OUSTR("style:parent-style-name"),GetParentStyleName());
31447 + pAttrList->AddAttribute( A2OUSTR("style:family"), A2OUSTR("data-style") );
31448 + if (!m_bTruncate)
31449 + pAttrList->AddAttribute( A2OUSTR("number:truncate-on-overflow"), A2OUSTR("false") );
31450 + pStrm->StartElement( A2OUSTR("number:time-style") );
31452 + std::vector<XFTimePart>::iterator it;
31453 + for( it = m_aParts.begin(); it != m_aParts.end(); it++ )
31455 + (*it).ToXml(pStrm);
31457 + if( m_bAmPm )
31459 + pAttrList->Clear();
31460 + pStrm->StartElement( A2OUSTR("number:am-pm") );
31461 + pStrm->EndElement( A2OUSTR("number:am-pm") );
31463 + pStrm->EndElement( A2OUSTR("number:time-style") );
31465 \ No newline at end of file
31466 diff -urNp lotuswordpro.bak/source/filter/xfilter/xftimestyle.hxx lotuswordpro/source/filter/xfilter/xftimestyle.hxx
31467 --- lotuswordpro.bak/source/filter/xfilter/xftimestyle.hxx 1970-01-01 08:00:00.000000000 +0800
31468 +++ lotuswordpro/source/filter/xfilter/xftimestyle.hxx 2008-10-22 11:42:34.000000000 +0800
31469 @@ -0,0 +1,205 @@
31470 +/*************************************************************************
31472 + * The Contents of this file are made available subject to the terms of
31473 + * either of the following licenses
31475 + * - GNU Lesser General Public License Version 2.1
31476 + * - Sun Industry Standards Source License Version 1.1
31478 + * Sun Microsystems Inc., October, 2000
31480 + * GNU Lesser General Public License Version 2.1
31481 + * =============================================
31482 + * Copyright 2000 by Sun Microsystems, Inc.
31483 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
31485 + * This library is free software; you can redistribute it and/or
31486 + * modify it under the terms of the GNU Lesser General Public
31487 + * License version 2.1, as published by the Free Software Foundation.
31489 + * This library is distributed in the hope that it will be useful,
31490 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
31491 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
31492 + * Lesser General Public License for more details.
31494 + * You should have received a copy of the GNU Lesser General Public
31495 + * License along with this library; if not, write to the Free Software
31496 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31497 + * MA 02111-1307 USA
31500 + * Sun Industry Standards Source License Version 1.1
31501 + * =================================================
31502 + * The contents of this file are subject to the Sun Industry Standards
31503 + * Source License Version 1.1 (the "License"); You may not use this file
31504 + * except in compliance with the License. You may obtain a copy of the
31505 + * License at http://www.openoffice.org/license.html.
31507 + * Software provided under this License is provided on an "AS IS" basis,
31508 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
31509 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
31510 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
31511 + * See the License for the specific provisions governing your rights and
31512 + * obligations concerning the Software.
31514 + * The Initial Developer of the Original Code is: IBM Corporation
31516 + * Copyright: 2008 by IBM Corporation
31518 + * All Rights Reserved.
31520 + * Contributor(s): _______________________________________
31523 + ************************************************************************/
31524 +/*************************************************************************
31525 + * @file
31526 + * Time style. The TIme format for time field.
31527 + ************************************************************************/
31528 +/*************************************************************************
31529 + * Change History
31530 + * 2005-01-20 create this file.
31531 + ************************************************************************/
31532 +#ifndef _XFTIMESTYLE_HXX
31533 +#define _XFTIMESTYLE_HXX
31535 +#include "xfglobal.hxx"
31536 +#include "xfstyle.hxx"
31537 +#include "ixfproperty.hxx"
31538 +#include <vector>
31540 +class XFDateTimePart : public XFStyle
31542 +public:
31543 + XFDateTimePart()
31545 + m_ePart = enumXFDateUnknown;
31546 + m_bLongFmt = sal_False;
31549 + virtual ~XFDateTimePart(){}
31550 +public:
31551 + void SetPartType(enumXFDatePart ePart);
31553 + void SetLongFmt(sal_Bool bLongFmt);
31555 + void SetText(rtl::OUString& text);
31557 +protected:
31558 + enumXFDatePart m_ePart;
31559 + sal_Bool m_bLongFmt;
31560 + rtl::OUString m_strText;
31563 +class XFTimePart : public XFDateTimePart
31565 +public:
31566 + XFTimePart();
31568 + virtual ~XFTimePart(){}
31569 +public:
31570 + void SetDecimalPos(sal_Int32 pos);
31572 + virtual void ToXml(IXFStream *pStrm);
31574 +protected:
31575 + sal_Int32 m_nDecimalPos;
31578 +class XFTimeStyle : public XFStyle
31580 +public:
31581 + XFTimeStyle();
31583 + virtual ~XFTimeStyle();
31585 +public:
31587 + void AddHour( sal_Bool bLongFmt = sal_True );
31589 + void AddMinute( sal_Bool bLongFmt = sal_True );
31591 + void AddSecond( sal_Bool bLongFmt = sal_True, sal_Int16 nDecimalPos = 2);
31593 + void SetAmPm(sal_Bool bAmPm);
31595 + void AddText( rtl::OUString part );
31597 + virtual enumXFStyle GetStyleFamily();
31599 + virtual void ToXml(IXFStream *pStrm);
31601 + void SetTruncate(sal_Bool bTrunc);
31603 +private:
31604 + sal_Bool m_bFixed;
31605 + sal_Bool m_bAmPm;
31606 + std::vector<XFTimePart> m_aParts;
31607 + sal_Bool m_bTruncate;
31611 +inline void XFDateTimePart::SetPartType(enumXFDatePart ePart)
31613 + m_ePart = ePart;
31616 +inline void XFDateTimePart::SetLongFmt(sal_Bool bLongFmt)
31618 + m_bLongFmt = bLongFmt;
31621 +inline void XFDateTimePart::SetText(rtl::OUString& text)
31623 + m_strText = text;
31626 +inline void XFTimePart::SetDecimalPos(sal_Int32 pos)
31628 + m_nDecimalPos = pos;
31631 +inline void XFTimeStyle::AddHour( sal_Bool bLongFmt )
31633 + XFTimePart part;
31634 + part.SetPartType(enumXFDateHour);
31635 + part.SetLongFmt(bLongFmt);
31636 + m_aParts.push_back(part);
31639 +inline void XFTimeStyle::AddMinute( sal_Bool bLongFmt )
31641 + XFTimePart part;
31642 + part.SetPartType(enumXFDateMinute);
31643 + part.SetLongFmt(bLongFmt);
31644 + m_aParts.push_back(part);
31647 +inline void XFTimeStyle::AddSecond( sal_Bool bLongFmt, sal_Int16 pos)
31649 + XFTimePart part;
31650 + part.SetPartType(enumXFDateSecond);
31651 + part.SetLongFmt(bLongFmt);
31652 + part.SetDecimalPos(pos);
31653 + m_aParts.push_back(part);
31656 +inline void XFTimeStyle::SetAmPm(sal_Bool bAmPm)
31658 + m_bAmPm = bAmPm;
31661 +inline void XFTimeStyle::AddText( rtl::OUString text )
31663 + XFTimePart part;
31664 + part.SetPartType(enumXFDateText);
31665 + part.SetText(text);
31666 + m_aParts.push_back(part);
31669 +inline void XFTimeStyle::SetTruncate(sal_Bool bTrunc)
31671 + m_bTruncate = bTrunc;
31674 +#endif
31675 diff -urNp lotuswordpro.bak/source/filter/xfilter/xftitle.hxx lotuswordpro/source/filter/xfilter/xftitle.hxx
31676 --- lotuswordpro.bak/source/filter/xfilter/xftitle.hxx 1970-01-01 08:00:00.000000000 +0800
31677 +++ lotuswordpro/source/filter/xfilter/xftitle.hxx 2008-10-22 11:42:34.000000000 +0800
31678 @@ -0,0 +1,89 @@
31679 +/*************************************************************************
31681 + * The Contents of this file are made available subject to the terms of
31682 + * either of the following licenses
31684 + * - GNU Lesser General Public License Version 2.1
31685 + * - Sun Industry Standards Source License Version 1.1
31687 + * Sun Microsystems Inc., October, 2000
31689 + * GNU Lesser General Public License Version 2.1
31690 + * =============================================
31691 + * Copyright 2000 by Sun Microsystems, Inc.
31692 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
31694 + * This library is free software; you can redistribute it and/or
31695 + * modify it under the terms of the GNU Lesser General Public
31696 + * License version 2.1, as published by the Free Software Foundation.
31698 + * This library is distributed in the hope that it will be useful,
31699 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
31700 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
31701 + * Lesser General Public License for more details.
31703 + * You should have received a copy of the GNU Lesser General Public
31704 + * License along with this library; if not, write to the Free Software
31705 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31706 + * MA 02111-1307 USA
31709 + * Sun Industry Standards Source License Version 1.1
31710 + * =================================================
31711 + * The contents of this file are subject to the Sun Industry Standards
31712 + * Source License Version 1.1 (the "License"); You may not use this file
31713 + * except in compliance with the License. You may obtain a copy of the
31714 + * License at http://www.openoffice.org/license.html.
31716 + * Software provided under this License is provided on an "AS IS" basis,
31717 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
31718 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
31719 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
31720 + * See the License for the specific provisions governing your rights and
31721 + * obligations concerning the Software.
31723 + * The Initial Developer of the Original Code is: IBM Corporation
31725 + * Copyright: 2008 by IBM Corporation
31727 + * All Rights Reserved.
31729 + * Contributor(s): _______________________________________
31732 + ************************************************************************/
31733 +/*************************************************************************
31734 + * @file
31735 + * Page number field.
31736 + ************************************************************************/
31737 +/*************************************************************************
31738 + * Change History
31739 + * 2005-01-31 create this file.
31740 + ************************************************************************/
31741 +#ifndef _XFTITLE_HXX
31742 +#define _XFTITLE_HXX
31744 +#include "xfglobal.hxx"
31745 +#include "xfcontent.hxx"
31746 +#include "xfnumfmt.hxx"
31748 +/**
31749 + * @brief
31750 + * Title field.
31751 + */
31752 +class XFTitle : public XFContent
31754 +public:
31755 + virtual void ToXml(IXFStream *pStrm);
31758 +inline void XFTitle::ToXml(IXFStream *pStrm)
31760 + IXFAttrList *pAttrList = pStrm->GetAttrList();
31761 + pAttrList->Clear();
31763 + pStrm->StartElement( A2OUSTR("text:title") );
31764 + pStrm->EndElement( A2OUSTR("text:title") );
31767 +#endif
31768 \ No newline at end of file
31769 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfutil.cxx lotuswordpro/source/filter/xfilter/xfutil.cxx
31770 --- lotuswordpro.bak/source/filter/xfilter/xfutil.cxx 1970-01-01 08:00:00.000000000 +0800
31771 +++ lotuswordpro/source/filter/xfilter/xfutil.cxx 2008-10-22 11:42:34.000000000 +0800
31772 @@ -0,0 +1,562 @@
31773 +/*************************************************************************
31775 + * The Contents of this file are made available subject to the terms of
31776 + * either of the following licenses
31778 + * - GNU Lesser General Public License Version 2.1
31779 + * - Sun Industry Standards Source License Version 1.1
31781 + * Sun Microsystems Inc., October, 2000
31783 + * GNU Lesser General Public License Version 2.1
31784 + * =============================================
31785 + * Copyright 2000 by Sun Microsystems, Inc.
31786 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
31788 + * This library is free software; you can redistribute it and/or
31789 + * modify it under the terms of the GNU Lesser General Public
31790 + * License version 2.1, as published by the Free Software Foundation.
31792 + * This library is distributed in the hope that it will be useful,
31793 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
31794 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
31795 + * Lesser General Public License for more details.
31797 + * You should have received a copy of the GNU Lesser General Public
31798 + * License along with this library; if not, write to the Free Software
31799 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31800 + * MA 02111-1307 USA
31803 + * Sun Industry Standards Source License Version 1.1
31804 + * =================================================
31805 + * The contents of this file are subject to the Sun Industry Standards
31806 + * Source License Version 1.1 (the "License"); You may not use this file
31807 + * except in compliance with the License. You may obtain a copy of the
31808 + * License at http://www.openoffice.org/license.html.
31810 + * Software provided under this License is provided on an "AS IS" basis,
31811 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
31812 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
31813 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
31814 + * See the License for the specific provisions governing your rights and
31815 + * obligations concerning the Software.
31817 + * The Initial Developer of the Original Code is: IBM Corporation
31819 + * Copyright: 2008 by IBM Corporation
31821 + * All Rights Reserved.
31823 + * Contributor(s): _______________________________________
31826 + ************************************************************************/
31827 +/*************************************************************************
31828 + * @file
31829 + * Util functions for xml filter.
31830 + ************************************************************************/
31831 +/*************************************************************************
31832 + * Change History
31833 + * 2004-12-23 create this file.
31834 + * 2005-01-24 add some enum tool funtion here.
31835 + ************************************************************************/
31836 +#include <stdio.h>
31837 +#include "xfutil.hxx"
31838 +#include "xfparagraph.hxx"
31839 +#include "xfcontentcontainer.hxx"
31840 +#include <rtl/ustrbuf.hxx>
31841 +#include <sstream>
31843 +rtl::OUString Int32ToOUString(sal_Int32 num)
31845 + /*std::stringstream sstrm;
31847 + sstrm<<(int)num;
31848 + return rtl::OUString::createFromAscii(sstrm.str().c_str());
31849 + */
31850 + return rtl::OUString::valueOf(num);
31853 +rtl::OUString Int16ToOUString(sal_Int16 num)
31855 + /*std::stringstream sstrm;
31857 + sstrm<<(int)num;
31858 + return rtl::OUString::createFromAscii(sstrm.str().c_str());
31859 + */
31860 + sal_Int32 nNum = static_cast<sal_Int32>(num);
31861 + return rtl::OUString::valueOf(nNum);
31864 +rtl::OUString FloatToOUString(float num, sal_Int32 precision)
31866 + /*std::stringstream sstrm;
31867 + std::string strRet;
31869 + sstrm.precision(precision);
31870 + sstrm<<num;
31871 + return rtl::OUString::createFromAscii(sstrm.str().c_str());
31872 + */
31873 + return rtl::OUString::valueOf(num);
31876 +rtl::OUString DoubleToOUString(double num, sal_Int32 precision)
31878 + /*std::stringstream sstrm;
31879 + std::string strRet;
31881 + sstrm.precision(precision);
31882 + sstrm<<num;
31883 + return rtl::OUString::createFromAscii(sstrm.str().c_str());
31884 + */
31885 + return rtl::OUString::valueOf(num);
31888 +rtl::OUString OEMToOUString(const std::string& str)
31890 + return rtl::OUString();
31893 +rtl::OUString ColorToOUString( sal_uInt32 color)
31895 + unsigned int c = color&0x00ffffff;
31896 + unsigned char r;
31897 + unsigned char g;
31898 + unsigned char b;
31899 + char buf[8];
31901 + unsigned int temp = c;
31902 + r = temp&0x000000ff;
31904 + temp = c;
31905 + g = (temp&0x0000ff00)>>8;
31907 + temp = c;
31908 + b = (temp&0x00ff0000)>>16;
31910 + rtl_zeroMemory(buf,8);
31911 + sprintf(buf,"#%2x%2x%2x",r,g,b);
31912 + for( int i=0; i<6; i++ )
31914 + if( buf[i] == ' ' )
31915 + buf[i] = '0';
31917 + return rtl::OUString::createFromAscii(buf);
31920 +rtl::OUString DateTimeToOUString(XFDateTime& dt)
31922 + rtl::OUStringBuffer buf;
31923 + buf.append(dt.nYear);
31924 + buf.append( A2OUSTR("-") );
31925 + buf.append(dt.nMonth);
31926 + buf.append( A2OUSTR("-") );
31927 + buf.append(dt.nDay);
31928 + buf.append( A2OUSTR("T") );
31929 + buf.append(dt.nHour);
31930 + buf.append( A2OUSTR(":") );
31931 + buf.append(dt.nMinute);
31932 + buf.append( A2OUSTR(":") );
31933 + buf.append(dt.nSecond);
31934 + buf.append( A2OUSTR(".") );
31935 + buf.append(dt.nMillSecond);
31937 + return buf.makeStringAndClear();
31940 +rtl::OUString GetTableColName(sal_Int32 col)
31942 + int remain;
31943 + char ch;
31944 + std::string strOut;
31946 + if( col <= 26 )
31948 + ch = 'A' + col -1;
31949 + strOut += ch;
31950 + return A2OUSTR(strOut.c_str());
31953 + while( col>26 )
31955 + remain = col%26;
31956 + col = col/26;
31957 + ch = 'A' + remain -1;
31958 + strOut += ch;
31961 + ch = 'A' + remain -1;
31962 + strOut += ch;
31963 + return A2OUSTR(strOut.c_str());
31966 +//tool functions:
31967 +rtl::OUString GetUnderlineName(enumXFUnderline type)
31969 + switch(type)
31971 + case enumXFUnderlineNone:
31972 + return A2OUSTR("none");
31973 + break;
31974 + case enumXFUnderlineSingle:
31975 + return A2OUSTR("single");
31976 + break;
31977 + case enumXFUnderlineDouble:
31978 + return A2OUSTR("double");
31979 + break;
31980 + case enumXFUnderlineDotted:
31981 + return A2OUSTR("dotted");
31982 + break;
31983 + case enumXFUnderlineDash:
31984 + return A2OUSTR("dash");
31985 + break;
31986 + case enumXFUnderlineLongDash:
31987 + return A2OUSTR("long-dash");
31988 + break;
31989 + case enumXFUnderlineDotDash:
31990 + return A2OUSTR("dot-dash");
31991 + break;
31992 + case enumXFUnderlineDotDotDash:
31993 + return A2OUSTR("dot-dot-dash");
31994 + break;
31995 + case enumXFUnderlineWave:
31996 + return A2OUSTR("wave");
31997 + break;
31998 + case enumXFUnderlineBold:
31999 + return A2OUSTR("bold");
32000 + break;
32001 + case enumXFUnderlineBoldDotted:
32002 + return A2OUSTR("bold-dotted");
32003 + break;
32004 + case enumXFUnderlineBoldDash:
32005 + return A2OUSTR("bold-dash");
32006 + break;
32007 + case enumXFUnderlineBoldLongDash:
32008 + return A2OUSTR("bold-long-dash");
32009 + break;
32010 + case enumXFUnderlineBoldDotDash:
32011 + return A2OUSTR("bold-dot-dash");
32012 + break;
32013 + case enumXFUnderlineBoldDotDotDash:
32014 + return A2OUSTR("bold-dot-dot-dash");
32015 + break;
32016 + case enumXFUnderlineBoldWave:
32017 + return A2OUSTR("bold-wave");
32018 + break;
32019 + case enumXFUnderlineDoubleWave:
32020 + return A2OUSTR("double-wave");
32021 + break;
32022 + case enumXFUnderlineSmallWave:
32023 + return A2OUSTR("samll-wave");
32024 + break;
32026 + return A2OUSTR("");
32029 +rtl::OUString GetReliefName(enumXFRelief type)
32031 + switch(type)
32033 + case enumXFReliefEngraved:
32034 + return A2OUSTR("engraved");
32035 + break;
32036 + case enumXFReliefEmbossed:
32037 + return A2OUSTR("embossed");
32038 + break;
32040 + return A2OUSTR("");
32043 +rtl::OUString GetCrossoutName(enumXFCrossout type)
32045 + switch(type)
32047 + case enumXFCrossoutSignel:
32048 + return A2OUSTR("single-line");
32049 + break;
32050 + case enumXFCrossoutDouble:
32051 + return A2OUSTR("double-line");
32052 + break;
32053 + case enumXFCrossoutThick:
32054 + return A2OUSTR("thick-line");
32055 + break;
32056 + case enumXFCrossoutSlash:
32057 + return A2OUSTR("slash");
32058 + break;
32059 + case enumXFCrossoutX:
32060 + return A2OUSTR("X");
32061 + break;
32066 +rtl::OUString GetTransformName(enumXFTransform type)
32068 + switch(type) {
32069 + case enumXFTransformUpper:
32070 + return A2OUSTR("uppercase");
32071 + break;
32072 + case enumXFTransformLower:
32073 + return A2OUSTR("lowercase");
32074 + break;
32075 + case enumXFTransformCapitalize:
32076 + return A2OUSTR("capitalize");
32077 + break;
32078 + case enumXFTransformSmallCaps:
32079 + return A2OUSTR("small-caps");
32080 + break;
32082 + return A2OUSTR("");
32085 +rtl::OUString GetEmphasizeName(enumXFEmphasize type)
32087 + switch(type) {
32088 + case enumXFEmphasizeDot:
32089 + return A2OUSTR("dot");
32090 + break;
32091 + case enumXFEmphasizeCircle:
32092 + return A2OUSTR("circle");
32093 + break;
32094 + case enumXFEmphasizeDisc:
32095 + return A2OUSTR("disc");
32096 + break;
32097 + case enumXFEmphasizeAccent:
32098 + return A2OUSTR("accent");
32099 + break;
32101 + return A2OUSTR("");
32104 +rtl::OUString GetTextDirName(enumXFTextDir dir)
32106 + switch(dir)
32108 + case enumXFTextDirLR:
32109 + return A2OUSTR("lr");
32110 + break;
32111 + case enumXFTextDirLR_TB:
32112 + return A2OUSTR("lr-tb");
32113 + break;
32114 + case enumXFTextDirPage:
32115 + return A2OUSTR("page");
32116 + break;
32117 + case enumXFTextDirRL:
32118 + return A2OUSTR("rl");
32119 + break;
32120 + case enumXFTextDirRL_TB:
32121 + return A2OUSTR("rl-tb");
32122 + break;
32123 + case enumXFTextDirTB:
32124 + return A2OUSTR("tb");
32125 + break;
32126 + case enumXFTextDirTB_LR:
32127 + return A2OUSTR("tb-lr");
32128 + break;
32129 + case enumXFTextDirTB_RL:
32130 + return A2OUSTR("tb-rl");
32131 + break;
32133 + return A2OUSTR("");
32136 +rtl::OUString GetFrameXPos(enumXFFrameXPos pos)
32138 + switch(pos)
32140 + case enumXFFrameXPosLeft:
32141 + return A2OUSTR("left");
32142 + break;
32143 + case enumXFFrameXPosRight:
32144 + return A2OUSTR("right");
32145 + break;
32146 + case enumXFFrameXPosCenter:
32147 + return A2OUSTR("center");
32148 + break;
32149 + case enumXFFrameXPosFromLeft:
32150 + return A2OUSTR("from-left");
32151 + break;
32153 + return A2OUSTR("");
32156 +rtl::OUString GetFrameXRel(enumXFFrameXRel rel)
32158 + switch(rel)
32160 + case enumXFFrameXRelPage:
32161 + return A2OUSTR("page");
32162 + break;
32163 + case enumXFFrameXRelPageContent:
32164 + return A2OUSTR("page-content");
32165 + break;
32166 + case enumXFFrameXRelPageEndMargin:
32167 + return A2OUSTR("page-end-margin");
32168 + break;
32169 + case enumXFFrameXRelPageStartMargin:
32170 + return A2OUSTR("page-start-margin");
32171 + break;
32172 + case enumXFFrameXRelPara:
32173 + return A2OUSTR("paragraph");
32174 + break;
32175 + case enumXFFrameXRelParaContent:
32176 + return A2OUSTR("paragraph-content");
32177 + break;
32178 + case enumXFFrameXRelParaEndMargin:
32179 + return A2OUSTR("paragraph-end-margin");
32180 + break;
32181 + case enumXFFrameXRelParaStartMargin:
32182 + return A2OUSTR("paragraph-start-margin");
32183 + break;
32184 + case enumXFFrameXRelChar:
32185 + return A2OUSTR("char");
32186 + break;
32187 + case enumXFFrameXRelFrame:
32188 + return A2OUSTR("frame");
32189 + break;
32190 + case enumXFFrameXRelFrameContent:
32191 + return A2OUSTR("frame-content");
32192 + break;
32193 + case enumXFFrameXRelFrameEndMargin:
32194 + return A2OUSTR("frame-end-margin");
32195 + break;
32196 + case enumXFFrameXRelFrameStartMargin:
32197 + return A2OUSTR("frame-start-margin");
32198 + break;
32202 +rtl::OUString GetFrameYPos(enumXFFrameYPos pos)
32204 + switch(pos)
32206 + case enumXFFrameYPosTop:
32207 + return A2OUSTR("top");
32208 + case enumXFFrameYPosMiddle:
32209 + return A2OUSTR("middle");
32210 + case enumXFFrameYPosBottom:
32211 + return A2OUSTR("bottom");
32212 + case enumXFFrameYPosFromTop:
32213 + return A2OUSTR("from-top");
32214 + case enumXFFrameYPosBelow:
32215 + return A2OUSTR("below");
32217 + return A2OUSTR("");
32220 +rtl::OUString GetFrameYRel(enumXFFrameYRel rel)
32222 + switch(rel)
32224 + case enumXFFrameYRelBaseLine:
32225 + return A2OUSTR("baseline");
32226 + case enumXFFrameYRelChar:
32227 + return A2OUSTR("char");
32228 + case enumXFFrameYRelFrame:
32229 + return A2OUSTR("frame");
32230 + case enumXFFrameYRelFrameContent:
32231 + return A2OUSTR("frame-content");
32232 + case enumXFFrameYRelLine:
32233 + return A2OUSTR("line");
32234 + case enumXFFrameYRelPage:
32235 + return A2OUSTR("page");
32236 + case enumXFFrameYRelPageContent:
32237 + return A2OUSTR("page-content");
32238 + case enumXFFrameYRelPara:
32239 + return A2OUSTR("paragraph");
32240 + case enumXFFrameYRelParaContent:
32241 + return A2OUSTR("paragraph-content");
32242 + case enumXFFrameYRelText:
32243 + return A2OUSTR("text");
32245 + return A2OUSTR("");
32248 +rtl::OUString GetAlignName(enumXFAlignType align)
32250 + if( align == enumXFAlignStart )
32251 + return A2OUSTR("start");
32252 + else if( align == enumXFAlignCenter )
32253 + return A2OUSTR("center");
32254 + else if( align == enumXFAlignEnd )
32255 + return A2OUSTR("end");
32256 + else if( align == enumXFAlignJustify )
32257 + return A2OUSTR("justify");
32258 + else if( align == enumXFAlignBottom )
32259 + return A2OUSTR("bottom");
32260 + else if( align == enumXFAlignTop )
32261 + return A2OUSTR("top");
32262 + else if( align == enumXFAlignMiddle )
32263 + return A2OUSTR("middle");
32264 + else if( align == enumXFALignMargins )
32265 + return A2OUSTR("margins");
32267 + return A2OUSTR("");
32270 +rtl::OUString GetDrawKind(enumXFDrawKind kind)
32272 + if( kind == enumXFDrawKindFull )
32273 + return A2OUSTR("full");
32274 + else if( kind == enumXFDrawKindSection )
32275 + return A2OUSTR("section");
32276 + else if( kind == enumXFDrawKindCut )
32277 + return A2OUSTR("cut");
32278 + else //( kind == enumXFDrawKindArc )
32279 + return A2OUSTR("arc");
32282 +rtl::OUString GetPageUsageName(enumXFPageUsage usage)
32284 + switch(usage)
32286 + case enumXFPageUsageAll:
32287 + return A2OUSTR("all");
32288 + case enumXFPageUsageLeft:
32289 + return A2OUSTR("left");
32290 + case enumXFPageUsageRight:
32291 + return A2OUSTR("right");
32292 + case enumXFPageUsageMirror:
32293 + return A2OUSTR("mirrored");
32295 + return A2OUSTR("");
32298 +rtl::OUString GetValueType(enumXFValueType type)
32300 + switch(type)
32302 + case enumXFValueTypeBoolean:
32303 + return A2OUSTR("boolean");
32304 + case enumXFValueTypeCurrency:
32305 + return A2OUSTR("currency");
32306 + case enumXFValueTypeDate:
32307 + return A2OUSTR("date");
32308 + case enumXFValueTypeFloat:
32309 + return A2OUSTR("float");
32310 + case enumXFValueTypePercentage:
32311 + return A2OUSTR("percentage");
32312 + case enumXFValueTypeString:
32313 + return A2OUSTR("string");
32314 + case enumXFValueTypeTime:
32315 + return A2OUSTR("time");
32317 + return A2OUSTR("");
32320 +rtl::OUString GetColorMode(enumXFColorMode mode)
32322 + switch(mode)
32324 + case enumXFColorStandard:
32325 + return A2OUSTR("standard");
32326 + case enumXFColorGreyscale:
32327 + return A2OUSTR("greyscale");
32328 + case enumXFColorWatermark:
32329 + return A2OUSTR("watermark");
32330 + case enumXFColorMono:
32331 + return A2OUSTR("mono");
32333 + return A2OUSTR("");
32335 diff -urNp lotuswordpro.bak/source/filter/xfilter/xfutil.hxx lotuswordpro/source/filter/xfilter/xfutil.hxx
32336 --- lotuswordpro.bak/source/filter/xfilter/xfutil.hxx 1970-01-01 08:00:00.000000000 +0800
32337 +++ lotuswordpro/source/filter/xfilter/xfutil.hxx 2008-10-22 11:42:34.000000000 +0800
32338 @@ -0,0 +1,122 @@
32339 +/*************************************************************************
32341 + * The Contents of this file are made available subject to the terms of
32342 + * either of the following licenses
32344 + * - GNU Lesser General Public License Version 2.1
32345 + * - Sun Industry Standards Source License Version 1.1
32347 + * Sun Microsystems Inc., October, 2000
32349 + * GNU Lesser General Public License Version 2.1
32350 + * =============================================
32351 + * Copyright 2000 by Sun Microsystems, Inc.
32352 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
32354 + * This library is free software; you can redistribute it and/or
32355 + * modify it under the terms of the GNU Lesser General Public
32356 + * License version 2.1, as published by the Free Software Foundation.
32358 + * This library is distributed in the hope that it will be useful,
32359 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
32360 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
32361 + * Lesser General Public License for more details.
32363 + * You should have received a copy of the GNU Lesser General Public
32364 + * License along with this library; if not, write to the Free Software
32365 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
32366 + * MA 02111-1307 USA
32369 + * Sun Industry Standards Source License Version 1.1
32370 + * =================================================
32371 + * The contents of this file are subject to the Sun Industry Standards
32372 + * Source License Version 1.1 (the "License"); You may not use this file
32373 + * except in compliance with the License. You may obtain a copy of the
32374 + * License at http://www.openoffice.org/license.html.
32376 + * Software provided under this License is provided on an "AS IS" basis,
32377 + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
32378 + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
32379 + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
32380 + * See the License for the specific provisions governing your rights and
32381 + * obligations concerning the Software.
32383 + * The Initial Developer of the Original Code is: IBM Corporation
32385 + * Copyright: 2008 by IBM Corporation
32387 + * All Rights Reserved.
32389 + * Contributor(s): _______________________________________
32392 + ************************************************************************/
32393 +/*************************************************************************
32394 + * @file
32395 + * Tool funtions for xml filter.
32396 + * Don't use any template for the ***TOOUString function list for easy.
32397 + ************************************************************************/
32398 +/*************************************************************************
32399 + * Change History
32400 + * 2004-12-23 create this file.
32401 + ************************************************************************/
32402 +#ifndef _XFUTIL_HXX
32403 +#define _XFUTIL_HXX
32405 +#include "xfdefs.hxx"
32406 +#include <rtl/ustring.hxx>
32407 +#include <rtl/memory.h>
32408 +#include <string>
32411 +#define A2OUSTR(str) rtl::OUString::createFromAscii(str)
32413 +rtl::OUString Int32ToOUString(sal_Int32 num);
32415 +rtl::OUString Int16ToOUString(sal_Int16 num);
32417 +rtl::OUString FloatToOUString(float num, sal_Int32 precision=6);
32419 +rtl::OUString DoubleToOUString(double num, sal_Int32 precision=6);
32421 +rtl::OUString OEMToOUString(const std::string& str);
32423 +rtl::OUString ColorToOUString( sal_uInt32 color);
32425 +rtl::OUString DateTimeToOUString(XFDateTime& dt);
32427 +rtl::OUString GetTableColName(sal_Int32 col);
32429 +rtl::OUString GetUnderlineName(enumXFUnderline type);
32431 +rtl::OUString GetReliefName(enumXFRelief type);
32433 +rtl::OUString GetCrossoutName(enumXFCrossout type);
32435 +rtl::OUString GetTransformName(enumXFTransform type);
32437 +rtl::OUString GetEmphasizeName(enumXFEmphasize type);
32439 +rtl::OUString GetTextDirName(enumXFTextDir dir);
32441 +rtl::OUString GetFrameXPos(enumXFFrameXPos pos);
32443 +rtl::OUString GetFrameXRel(enumXFFrameXRel rel);
32445 +rtl::OUString GetFrameYPos(enumXFFrameYPos pos);
32447 +rtl::OUString GetFrameYRel(enumXFFrameYRel rel);
32449 +rtl::OUString GetAlignName(enumXFAlignType align);
32451 +rtl::OUString GetDrawKind(enumXFDrawKind kind);
32453 +rtl::OUString GetPageUsageName(enumXFPageUsage usage);
32455 +rtl::OUString GetValueType(enumXFValueType type);
32457 +rtl::OUString GetColorMode(enumXFColorMode mode);
32459 +#endif