Files
libreoffice/xmloff/source/style/xmlnumi.cxx

1386 lines
51 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2000-09-18 16:07:07 +00:00
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2000-09-18 16:07:07 +00:00
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
2000-09-18 16:07:07 +00:00
*
* OpenOffice.org - a multi-platform office productivity suite
2000-09-18 16:07:07 +00:00
*
* This file is part of OpenOffice.org.
2000-09-18 16:07:07 +00:00
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
2000-09-18 16:07:07 +00:00
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
2000-09-18 16:07:07 +00:00
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
2000-09-18 16:07:07 +00:00
*
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_xmloff.hxx"
2000-09-18 16:07:07 +00:00
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/awt/FontDescriptor.hpp>
#include <com/sun/star/text/HoriOrientation.hpp>
#include <com/sun/star/text/VertOrientation.hpp>
#include <com/sun/star/text/PositionAndSpaceMode.hpp>
#include <com/sun/star/text/LabelFollow.hpp>
2000-09-18 16:07:07 +00:00
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/style/XStyle.hpp>
2001-06-19 14:21:16 +00:00
#include <com/sun/star/io/XOutputStream.hpp>
#include <rtl/ustrbuf.hxx>
#include <tools/urlobj.hxx>
#include <tools/debug.hxx>
#include <tools/fontenum.hxx>
#include <xmloff/xmltkmap.hxx>
#include <xmloff/nmspmap.hxx>
#include "xmlnmspe.hxx"
#include <xmloff/xmlimp.hxx>
#include <xmloff/XMLBase64ImportContext.hxx>
#include <xmloff/xmltoken.hxx>
2000-09-18 16:07:07 +00:00
#include "i18nmap.hxx"
#include <xmloff/xmluconv.hxx>
2000-09-18 16:07:07 +00:00
#include "fonthdl.hxx"
#include <xmloff/XMLFontStylesContext.hxx>
#include <xmloff/families.hxx>
#include <xmloff/maptype.hxx>
2000-09-18 16:07:07 +00:00
#include <xmloff/xmlnumi.hxx>
2000-09-18 16:07:07 +00:00
#define _SVSTDARR_USHORTS
#include <svl/svstdarr.hxx>
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
2000-09-18 16:07:07 +00:00
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::style;
using namespace ::com::sun::star::text;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::frame;
using namespace ::xmloff::token;
2001-06-19 14:21:16 +00:00
using namespace ::com::sun::star::io;
2000-09-18 16:07:07 +00:00
2010-10-15 12:10:06 -05:00
using rtl::OUString;
using rtl::OUStringBuffer;
2000-09-18 16:07:07 +00:00
static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_SYMBOL_TEXT_DISTANCE[] =
"SymbolTextDistance";
static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_PARENT_NUMBERING[] =
"ParentNumbering";
static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_CHAR_STYLE_NAME[] =
"CharStyleName";
static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_BULLET_CHAR[] ="BulletChar";
2000-12-01 17:59:51 +00:00
static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_BULLET_RELSIZE[] = "BulletRelSize";
2000-09-18 16:07:07 +00:00
static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_GRAPHIC_SIZE[] =
"GraphicSize";
static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_VERT_ORIENT[] ="VertOrient";
static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_NUMBERINGTYPE[] = "NumberingType";
static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_PREFIX[] = "Prefix";
static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_SUFFIX[] = "Suffix";
static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_ADJUST[] = "Adjust";
static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_LEFT_MARGIN[] = "LeftMargin";
static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_FIRST_LINE_OFFSET[] =
"FirstLineOffset";
static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_BULLET_FONT[] = "BulletFont";
static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_GRAPHICURL[] = "GraphicURL";
static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_START_WITH[] = "StartWith";
static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_BULLET_COLOR[] = "BulletColor";
static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_POSITION_AND_SPACE_MODE[] = "PositionAndSpaceMode";
static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_LABEL_FOLLOWED_BY[] = "LabelFollowedBy";
static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_LISTTAB_STOP_POSITION[] = "ListtabStopPosition";
static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_FIRST_LINE_INDENT[] = "FirstLineIndent";
static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_INDENT_AT[] = "IndentAt";
2000-09-18 16:07:07 +00:00
// ---------------------------------------------------------------------
class SvxXMLListLevelStyleContext_Impl;
class SvxXMLListLevelStyleAttrContext_Impl : public SvXMLImportContext
{
SvxXMLListLevelStyleContext_Impl& rListLevel;
public:
SvxXMLListLevelStyleAttrContext_Impl(
SvXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& rLName,
const Reference< xml::sax::XAttributeList >& xAttrList,
SvxXMLListLevelStyleContext_Impl& rLLevel );
virtual ~SvxXMLListLevelStyleAttrContext_Impl();
virtual SvXMLImportContext *CreateChildContext(
sal_uInt16 nPrefix, const OUString& rLocalName,
const Reference< xml::sax::XAttributeList > & xAttrList );
};
// ---------------------------------------------------------------------
class SvxXMLListLevelStyleLabelAlignmentAttrContext_Impl : public SvXMLImportContext
{
SvxXMLListLevelStyleContext_Impl& rListLevel;
public:
SvxXMLListLevelStyleLabelAlignmentAttrContext_Impl(
SvXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& rLName,
const Reference< xml::sax::XAttributeList >& xAttrList,
SvxXMLListLevelStyleContext_Impl& rLLevel );
virtual ~SvxXMLListLevelStyleLabelAlignmentAttrContext_Impl();
2000-09-18 16:07:07 +00:00
};
// ---------------------------------------------------------------------
enum SvxXMLTextListLevelStyleAttrTokens
{
XML_TOK_TEXT_LEVEL_ATTR_LEVEL,
XML_TOK_TEXT_LEVEL_ATTR_STYLE_NAME,
XML_TOK_TEXT_LEVEL_ATTR_BULLET_CHAR,
XML_TOK_TEXT_LEVEL_ATTR_HREF,
XML_TOK_TEXT_LEVEL_ATTR_TYPE,
XML_TOK_TEXT_LEVEL_ATTR_SHOW,
XML_TOK_TEXT_LEVEL_ATTR_ACTUATE,
XML_TOK_TEXT_LEVEL_ATTR_NUM_FORMAT,
XML_TOK_TEXT_LEVEL_ATTR_NUM_PREFIX,
XML_TOK_TEXT_LEVEL_ATTR_NUM_SUFFIX,
XML_TOK_TEXT_LEVEL_ATTR_NUM_LETTER_SYNC,
XML_TOK_TEXT_LEVEL_ATTR_START_VALUE,
XML_TOK_TEXT_LEVEL_ATTR_DISPLAY_LEVELS,
XML_TOK_TEXT_LEVEL_ATTR_END=XML_TOK_UNKNOWN
};
CWS-TOOLING: integrate CWS dbaperf1 2009-04-02 09:12:25 +0200 oj r270372 : CWS-TOOLING: rebase CWS dbaperf1 to trunk@270033 (milestone: DEV300:m45) 2009-03-17 10:20:34 +0100 oj r269577 : add parameter 2009-03-17 10:20:05 +0100 oj r269576 : add parameter 2009-03-12 12:32:24 +0100 oj r269387 : add missing ++ 2009-03-11 12:53:35 +0100 oj r269315 : compile error 2009-03-06 08:52:11 +0100 oj r268968 : #i99264# remove duplicate code 2009-03-06 08:20:08 +0100 oj r268966 : add missingheader 2009-03-06 08:17:41 +0100 oj r268965 : add header 2009-03-06 08:15:07 +0100 oj r268964 : #i99708# remove duplicate code 2009-03-06 07:24:11 +0100 oj r268963 : #i99708# remove duplicate code 2009-03-06 07:22:24 +0100 oj r268962 : #i99708# use tenary operator 2009-03-06 07:19:21 +0100 oj r268961 : remove unused rtl_logs 2009-03-06 07:15:55 +0100 oj r268960 : #i99708# extract getLength from for loop 2009-03-06 07:15:35 +0100 oj r268959 : #i99708# extract getLength from for loop 2009-03-06 07:14:57 +0100 oj r268958 : remove unused rtl_logs 2009-03-06 07:13:01 +0100 oj r268957 : insert DBG_ helper 2009-03-06 07:12:17 +0100 oj r268956 : remove unused rtl_logs 2009-03-06 07:10:26 +0100 oj r268955 : remove unused rtl_logs 2009-03-06 07:04:51 +0100 oj r268954 : #i99708# use tenary operator 2009-03-05 12:04:46 +0100 oj r268895 : comment RTL_LOG out 2009-03-05 09:05:07 +0100 oj r268874 : add rtl logfile 2009-03-04 14:21:18 +0100 oj r268828 : #i99708# make static inplace and some method calls in for loop removed 2009-03-04 14:20:34 +0100 oj r268827 : #i99708# impl double check pattern for getInfohelper 2009-03-02 09:31:42 +0100 oj r268636 : add rtl logfile 2009-03-02 08:18:37 +0100 oj r268633 : add rtl logfile 2009-02-27 11:22:16 +0100 oj r268570 : #i99709# change algorithm for marking objects 2009-02-27 11:17:04 +0100 oj r268568 : #i99708# some improvements to load forms, controls faster and replacement of size() call with !empty() which is much faster 2009-02-24 10:09:35 +0100 sb r268383 : #i99290# no longer care to set a sensible context class loader for native threads attached to the VM 2009-02-23 13:44:04 +0100 oj r268354 : #i76606# seekrow changes 2009-02-23 12:27:30 +0100 oj r268349 : deleted 2009-02-20 15:14:23 +0100 oj r268325 : #i76606# some code changes 2009-02-19 14:15:25 +0100 oj r268284 : #i76606# use of simple prep stmt instead of full blown rowset, when source and dest connection are the same use insert into ... ( select ... ) 2009-02-19 11:27:55 +0100 oj r268265 : #i76606# insert some RTL_LOG and setObject impl 2009-02-18 14:45:37 +0100 oj r268222 : #i99363# insert RTL_LOG 2009-02-18 14:45:18 +0100 oj r268221 : #i99363# insert RTL_LOG 2009-02-18 11:14:54 +0100 oj r268207 : #i99363# call some impl_ methods to avoid duplicate cechCache calls 2009-02-18 11:10:47 +0100 oj r268206 : #i99363# make isCount inline 2009-02-18 10:33:22 +0100 oj r268203 : #i99363# use bookmarkable if available and inserted some RTL_LOG 2009-02-18 10:32:57 +0100 oj r268202 : #i99363# use bookmarkable if available and inserted some RTL_LOG 2009-02-17 07:29:05 +0100 oj r267843 : #i96897# remove some dll public 2009-02-16 15:01:04 +0100 oj r267816 : #i96897# remove some dll public 2009-02-16 14:25:53 +0100 oj r267810 : #i99264# remove duplicate code 2009-02-16 14:25:33 +0100 oj r267809 : #i99264# remove duplicate code 2009-02-16 14:24:59 +0100 oj r267808 : #i99264# remove duplicate code 2009-02-13 10:56:17 +0100 oj r267703 : #i99191# comment the contextclassloader 2009-02-13 10:32:40 +0100 oj r267700 : reduce call to resultset meta data 2009-02-13 10:27:31 +0100 oj r267699 : reduce call to resultset meta data 2009-02-13 10:27:08 +0100 oj r267698 : reduce call to resultset meta data
2009-04-23 10:42:05 +00:00
const SvXMLTokenMapEntry* lcl_getLevelAttrTokenMap()
2000-09-18 16:07:07 +00:00
{
CWS-TOOLING: integrate CWS dbaperf1 2009-04-02 09:12:25 +0200 oj r270372 : CWS-TOOLING: rebase CWS dbaperf1 to trunk@270033 (milestone: DEV300:m45) 2009-03-17 10:20:34 +0100 oj r269577 : add parameter 2009-03-17 10:20:05 +0100 oj r269576 : add parameter 2009-03-12 12:32:24 +0100 oj r269387 : add missing ++ 2009-03-11 12:53:35 +0100 oj r269315 : compile error 2009-03-06 08:52:11 +0100 oj r268968 : #i99264# remove duplicate code 2009-03-06 08:20:08 +0100 oj r268966 : add missingheader 2009-03-06 08:17:41 +0100 oj r268965 : add header 2009-03-06 08:15:07 +0100 oj r268964 : #i99708# remove duplicate code 2009-03-06 07:24:11 +0100 oj r268963 : #i99708# remove duplicate code 2009-03-06 07:22:24 +0100 oj r268962 : #i99708# use tenary operator 2009-03-06 07:19:21 +0100 oj r268961 : remove unused rtl_logs 2009-03-06 07:15:55 +0100 oj r268960 : #i99708# extract getLength from for loop 2009-03-06 07:15:35 +0100 oj r268959 : #i99708# extract getLength from for loop 2009-03-06 07:14:57 +0100 oj r268958 : remove unused rtl_logs 2009-03-06 07:13:01 +0100 oj r268957 : insert DBG_ helper 2009-03-06 07:12:17 +0100 oj r268956 : remove unused rtl_logs 2009-03-06 07:10:26 +0100 oj r268955 : remove unused rtl_logs 2009-03-06 07:04:51 +0100 oj r268954 : #i99708# use tenary operator 2009-03-05 12:04:46 +0100 oj r268895 : comment RTL_LOG out 2009-03-05 09:05:07 +0100 oj r268874 : add rtl logfile 2009-03-04 14:21:18 +0100 oj r268828 : #i99708# make static inplace and some method calls in for loop removed 2009-03-04 14:20:34 +0100 oj r268827 : #i99708# impl double check pattern for getInfohelper 2009-03-02 09:31:42 +0100 oj r268636 : add rtl logfile 2009-03-02 08:18:37 +0100 oj r268633 : add rtl logfile 2009-02-27 11:22:16 +0100 oj r268570 : #i99709# change algorithm for marking objects 2009-02-27 11:17:04 +0100 oj r268568 : #i99708# some improvements to load forms, controls faster and replacement of size() call with !empty() which is much faster 2009-02-24 10:09:35 +0100 sb r268383 : #i99290# no longer care to set a sensible context class loader for native threads attached to the VM 2009-02-23 13:44:04 +0100 oj r268354 : #i76606# seekrow changes 2009-02-23 12:27:30 +0100 oj r268349 : deleted 2009-02-20 15:14:23 +0100 oj r268325 : #i76606# some code changes 2009-02-19 14:15:25 +0100 oj r268284 : #i76606# use of simple prep stmt instead of full blown rowset, when source and dest connection are the same use insert into ... ( select ... ) 2009-02-19 11:27:55 +0100 oj r268265 : #i76606# insert some RTL_LOG and setObject impl 2009-02-18 14:45:37 +0100 oj r268222 : #i99363# insert RTL_LOG 2009-02-18 14:45:18 +0100 oj r268221 : #i99363# insert RTL_LOG 2009-02-18 11:14:54 +0100 oj r268207 : #i99363# call some impl_ methods to avoid duplicate cechCache calls 2009-02-18 11:10:47 +0100 oj r268206 : #i99363# make isCount inline 2009-02-18 10:33:22 +0100 oj r268203 : #i99363# use bookmarkable if available and inserted some RTL_LOG 2009-02-18 10:32:57 +0100 oj r268202 : #i99363# use bookmarkable if available and inserted some RTL_LOG 2009-02-17 07:29:05 +0100 oj r267843 : #i96897# remove some dll public 2009-02-16 15:01:04 +0100 oj r267816 : #i96897# remove some dll public 2009-02-16 14:25:53 +0100 oj r267810 : #i99264# remove duplicate code 2009-02-16 14:25:33 +0100 oj r267809 : #i99264# remove duplicate code 2009-02-16 14:24:59 +0100 oj r267808 : #i99264# remove duplicate code 2009-02-13 10:56:17 +0100 oj r267703 : #i99191# comment the contextclassloader 2009-02-13 10:32:40 +0100 oj r267700 : reduce call to resultset meta data 2009-02-13 10:27:31 +0100 oj r267699 : reduce call to resultset meta data 2009-02-13 10:27:08 +0100 oj r267698 : reduce call to resultset meta data
2009-04-23 10:42:05 +00:00
static __FAR_DATA SvXMLTokenMapEntry aLevelAttrTokenMap[] =
{
{ XML_NAMESPACE_TEXT, XML_LEVEL, XML_TOK_TEXT_LEVEL_ATTR_LEVEL },
{ XML_NAMESPACE_TEXT, XML_STYLE_NAME, XML_TOK_TEXT_LEVEL_ATTR_STYLE_NAME },
{ XML_NAMESPACE_TEXT, XML_BULLET_CHAR, XML_TOK_TEXT_LEVEL_ATTR_BULLET_CHAR },
{ XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_TEXT_LEVEL_ATTR_HREF },
{ XML_NAMESPACE_XLINK, XML_TYPE, XML_TOK_TEXT_LEVEL_ATTR_TYPE },
{ XML_NAMESPACE_XLINK, XML_SHOW, XML_TOK_TEXT_LEVEL_ATTR_SHOW },
{ XML_NAMESPACE_XLINK, XML_ACTUATE, XML_TOK_TEXT_LEVEL_ATTR_ACTUATE },
{ XML_NAMESPACE_STYLE, XML_NUM_FORMAT, XML_TOK_TEXT_LEVEL_ATTR_NUM_FORMAT },
{ XML_NAMESPACE_STYLE, XML_NUM_PREFIX, XML_TOK_TEXT_LEVEL_ATTR_NUM_PREFIX },
{ XML_NAMESPACE_STYLE, XML_NUM_SUFFIX, XML_TOK_TEXT_LEVEL_ATTR_NUM_SUFFIX },
{ XML_NAMESPACE_STYLE, XML_NUM_LETTER_SYNC, XML_TOK_TEXT_LEVEL_ATTR_NUM_LETTER_SYNC },
{ XML_NAMESPACE_TEXT, XML_START_VALUE, XML_TOK_TEXT_LEVEL_ATTR_START_VALUE },
{ XML_NAMESPACE_TEXT, XML_DISPLAY_LEVELS, XML_TOK_TEXT_LEVEL_ATTR_DISPLAY_LEVELS },
XML_TOKEN_MAP_END
};
return aLevelAttrTokenMap;
}
2000-09-18 16:07:07 +00:00
class SvxXMLListLevelStyleContext_Impl : public SvXMLImportContext
{
friend class SvxXMLListLevelStyleAttrContext_Impl;
const OUString sStarBats;
const OUString sStarMath;
2000-09-18 16:07:07 +00:00
OUString sPrefix;
OUString sSuffix;
OUString sTextStyleName;
OUString sNumFormat;
OUString sNumLetterSync;
OUString sBulletFontName;
OUString sBulletFontStyleName;
OUString sImageURL;
2001-06-19 14:21:16 +00:00
Reference < XOutputStream > xBase64Stream;
2000-09-18 16:07:07 +00:00
sal_Int32 nLevel;
sal_Int32 nSpaceBefore;
sal_Int32 nMinLabelWidth;
sal_Int32 nMinLabelDist;
sal_Int32 nImageWidth;
sal_Int32 nImageHeight;
sal_Int16 nNumStartValue;
sal_Int16 nNumDisplayLevels;
sal_Int16 eAdjust;
sal_Int16 eBulletFontFamily;
sal_Int16 eBulletFontPitch;
rtl_TextEncoding eBulletFontEncoding;
sal_Int16 eImageVertOrient;
sal_Unicode cBullet;
sal_Int16 nRelSize;
Color aColor;
2000-09-18 16:07:07 +00:00
sal_Int16 ePosAndSpaceMode;
sal_Int16 eLabelFollowedBy;
sal_Int32 nListtabStopPosition;
sal_Int32 nFirstLineIndent;
sal_Int32 nIndentAt;
2000-09-18 16:07:07 +00:00
sal_Bool bBullet : 1;
sal_Bool bImage : 1;
sal_Bool bNum : 1;
sal_Bool bHasColor : 1;
2000-09-18 16:07:07 +00:00
void SetRelSize( sal_Int16 nRel ) { nRelSize = nRel; }
void SetColor( sal_Int32 _aColor ) { aColor = _aColor; bHasColor = sal_True; }
2000-09-18 16:07:07 +00:00
void SetSpaceBefore( sal_Int32 nSet ) { nSpaceBefore = nSet; }
void SetMinLabelWidth( sal_Int32 nSet ) { nMinLabelWidth = nSet; }
void SetMinLabelDist( sal_Int32 nSet ) { nMinLabelDist = nSet; }
void SetAdjust( sal_Int16 eSet ) { eAdjust = eSet; }
void SetBulletFontName( const OUString& rSet ) { sBulletFontName = rSet; }
void SetBulletFontStyleName( const OUString& rSet )
{ sBulletFontStyleName = rSet; }
void SetBulletFontFamily( sal_Int16 eSet ) { eBulletFontFamily = eSet; }
void SetBulletFontPitch( sal_Int16 eSet ) { eBulletFontPitch = eSet; }
void SetBulletFontEncoding( rtl_TextEncoding eSet )
{ eBulletFontEncoding = eSet; }
void SetImageWidth( sal_Int32 nSet ) { nImageWidth = nSet; }
void SetImageHeight( sal_Int32 nSet ) { nImageHeight = nSet; }
void SetImageVertOrient( sal_Int16 eSet )
{ eImageVertOrient = eSet; }
public:
SvxXMLListLevelStyleContext_Impl(
SvXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& rLName,
const Reference< xml::sax::XAttributeList > & xAttrList );
virtual ~SvxXMLListLevelStyleContext_Impl();
virtual SvXMLImportContext *CreateChildContext(
sal_uInt16 nPrefix, const OUString& rLocalName,
const Reference< xml::sax::XAttributeList > & xAttrList );
sal_Int32 GetLevel() const { return nLevel; }
Sequence<beans::PropertyValue> GetProperties(
2000-12-02 09:26:15 +00:00
const SvI18NMap *pI18NMap=0 );
inline void SetPosAndSpaceMode( sal_Int16 eValue )
{
ePosAndSpaceMode = eValue;
}
inline void SetLabelFollowedBy( sal_Int16 eValue )
{
eLabelFollowedBy = eValue;
}
inline void SetListtabStopPosition( sal_Int32 nValue )
{
nListtabStopPosition = nValue;
}
inline void SetFirstLineIndent( sal_Int32 nValue )
{
nFirstLineIndent = nValue;
}
inline void SetIndentAt( sal_Int32 nValue )
{
nIndentAt = nValue;
}
2000-09-18 16:07:07 +00:00
};
SvxXMLListLevelStyleContext_Impl::SvxXMLListLevelStyleContext_Impl(
SvXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& rLName,
const Reference< xml::sax::XAttributeList > & xAttrList )
2000-09-18 16:07:07 +00:00
: SvXMLImportContext( rImport, nPrfx, rLName )
, sStarBats( RTL_CONSTASCII_USTRINGPARAM( "StarBats" ) )
, sStarMath( RTL_CONSTASCII_USTRINGPARAM( "StarMath" ) )
, sNumFormat( OUString(RTL_CONSTASCII_USTRINGPARAM("1")) )
, nLevel( -1L )
, nSpaceBefore( 0L )
, nMinLabelWidth( 0L )
, nMinLabelDist( 0L )
, nImageWidth( 0L )
, nImageHeight( 0L )
, nNumStartValue( 1 )
, nNumDisplayLevels( 1 )
, eAdjust( HoriOrientation::LEFT )
, eBulletFontFamily( FAMILY_DONTKNOW )
, eBulletFontPitch( PITCH_DONTKNOW )
, eBulletFontEncoding( RTL_TEXTENCODING_DONTKNOW )
, eImageVertOrient(0)
, cBullet( 0 )
, nRelSize(0)
, aColor( 0 )
, ePosAndSpaceMode( PositionAndSpaceMode::LABEL_WIDTH_AND_POSITION )
, eLabelFollowedBy( LabelFollow::LISTTAB )
, nListtabStopPosition( 0 )
, nFirstLineIndent( 0 )
, nIndentAt( 0 )
, bBullet( sal_False )
, bImage( sal_False )
, bNum( sal_False )
, bHasColor( sal_False )
2000-09-18 16:07:07 +00:00
{
if( IsXMLToken( rLName, XML_LIST_LEVEL_STYLE_NUMBER ) ||
IsXMLToken( rLName, XML_OUTLINE_LEVEL_STYLE ) )
2000-09-18 16:07:07 +00:00
bNum = sal_True;
else if( IsXMLToken( rLName, XML_LIST_LEVEL_STYLE_BULLET ) )
2000-09-18 16:07:07 +00:00
bBullet = sal_True;
else if( IsXMLToken( rLName, XML_LIST_LEVEL_STYLE_IMAGE ) )
2000-09-18 16:07:07 +00:00
bImage = sal_True;
CWS-TOOLING: integrate CWS dbaperf1 2009-04-02 09:12:25 +0200 oj r270372 : CWS-TOOLING: rebase CWS dbaperf1 to trunk@270033 (milestone: DEV300:m45) 2009-03-17 10:20:34 +0100 oj r269577 : add parameter 2009-03-17 10:20:05 +0100 oj r269576 : add parameter 2009-03-12 12:32:24 +0100 oj r269387 : add missing ++ 2009-03-11 12:53:35 +0100 oj r269315 : compile error 2009-03-06 08:52:11 +0100 oj r268968 : #i99264# remove duplicate code 2009-03-06 08:20:08 +0100 oj r268966 : add missingheader 2009-03-06 08:17:41 +0100 oj r268965 : add header 2009-03-06 08:15:07 +0100 oj r268964 : #i99708# remove duplicate code 2009-03-06 07:24:11 +0100 oj r268963 : #i99708# remove duplicate code 2009-03-06 07:22:24 +0100 oj r268962 : #i99708# use tenary operator 2009-03-06 07:19:21 +0100 oj r268961 : remove unused rtl_logs 2009-03-06 07:15:55 +0100 oj r268960 : #i99708# extract getLength from for loop 2009-03-06 07:15:35 +0100 oj r268959 : #i99708# extract getLength from for loop 2009-03-06 07:14:57 +0100 oj r268958 : remove unused rtl_logs 2009-03-06 07:13:01 +0100 oj r268957 : insert DBG_ helper 2009-03-06 07:12:17 +0100 oj r268956 : remove unused rtl_logs 2009-03-06 07:10:26 +0100 oj r268955 : remove unused rtl_logs 2009-03-06 07:04:51 +0100 oj r268954 : #i99708# use tenary operator 2009-03-05 12:04:46 +0100 oj r268895 : comment RTL_LOG out 2009-03-05 09:05:07 +0100 oj r268874 : add rtl logfile 2009-03-04 14:21:18 +0100 oj r268828 : #i99708# make static inplace and some method calls in for loop removed 2009-03-04 14:20:34 +0100 oj r268827 : #i99708# impl double check pattern for getInfohelper 2009-03-02 09:31:42 +0100 oj r268636 : add rtl logfile 2009-03-02 08:18:37 +0100 oj r268633 : add rtl logfile 2009-02-27 11:22:16 +0100 oj r268570 : #i99709# change algorithm for marking objects 2009-02-27 11:17:04 +0100 oj r268568 : #i99708# some improvements to load forms, controls faster and replacement of size() call with !empty() which is much faster 2009-02-24 10:09:35 +0100 sb r268383 : #i99290# no longer care to set a sensible context class loader for native threads attached to the VM 2009-02-23 13:44:04 +0100 oj r268354 : #i76606# seekrow changes 2009-02-23 12:27:30 +0100 oj r268349 : deleted 2009-02-20 15:14:23 +0100 oj r268325 : #i76606# some code changes 2009-02-19 14:15:25 +0100 oj r268284 : #i76606# use of simple prep stmt instead of full blown rowset, when source and dest connection are the same use insert into ... ( select ... ) 2009-02-19 11:27:55 +0100 oj r268265 : #i76606# insert some RTL_LOG and setObject impl 2009-02-18 14:45:37 +0100 oj r268222 : #i99363# insert RTL_LOG 2009-02-18 14:45:18 +0100 oj r268221 : #i99363# insert RTL_LOG 2009-02-18 11:14:54 +0100 oj r268207 : #i99363# call some impl_ methods to avoid duplicate cechCache calls 2009-02-18 11:10:47 +0100 oj r268206 : #i99363# make isCount inline 2009-02-18 10:33:22 +0100 oj r268203 : #i99363# use bookmarkable if available and inserted some RTL_LOG 2009-02-18 10:32:57 +0100 oj r268202 : #i99363# use bookmarkable if available and inserted some RTL_LOG 2009-02-17 07:29:05 +0100 oj r267843 : #i96897# remove some dll public 2009-02-16 15:01:04 +0100 oj r267816 : #i96897# remove some dll public 2009-02-16 14:25:53 +0100 oj r267810 : #i99264# remove duplicate code 2009-02-16 14:25:33 +0100 oj r267809 : #i99264# remove duplicate code 2009-02-16 14:24:59 +0100 oj r267808 : #i99264# remove duplicate code 2009-02-13 10:56:17 +0100 oj r267703 : #i99191# comment the contextclassloader 2009-02-13 10:32:40 +0100 oj r267700 : reduce call to resultset meta data 2009-02-13 10:27:31 +0100 oj r267699 : reduce call to resultset meta data 2009-02-13 10:27:08 +0100 oj r267698 : reduce call to resultset meta data
2009-04-23 10:42:05 +00:00
SvXMLTokenMap aTokenMap( lcl_getLevelAttrTokenMap() );
2000-09-18 16:07:07 +00:00
sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
for( sal_Int16 i=0; i < nAttrCount; i++ )
{
const OUString& rAttrName = xAttrList->getNameByIndex( i );
OUString aLocalName;
sal_uInt16 nPrefix =
GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName,
&aLocalName );
const OUString& rValue = xAttrList->getValueByIndex( i );
switch( aTokenMap.Get( nPrefix, aLocalName ) )
{
case XML_TOK_TEXT_LEVEL_ATTR_LEVEL:
nLevel = rValue.toInt32();
if( nLevel >= 1L )
nLevel--;
else
nLevel = 0L;
break;
case XML_TOK_TEXT_LEVEL_ATTR_STYLE_NAME:
sTextStyleName = rValue;
break;
case XML_TOK_TEXT_LEVEL_ATTR_BULLET_CHAR:
2001-06-29 11:34:19 +00:00
cBullet = rValue[0];
2000-09-18 16:07:07 +00:00
break;
case XML_TOK_TEXT_LEVEL_ATTR_HREF:
if( bImage )
sImageURL = rValue;
break;
case XML_TOK_TEXT_LEVEL_ATTR_TYPE:
case XML_TOK_TEXT_LEVEL_ATTR_SHOW:
case XML_TOK_TEXT_LEVEL_ATTR_ACTUATE:
// This properties will be ignored
break;
case XML_TOK_TEXT_LEVEL_ATTR_NUM_FORMAT:
if( bNum )
sNumFormat = rValue;
break;
case XML_TOK_TEXT_LEVEL_ATTR_NUM_PREFIX:
sPrefix = rValue;
break;
case XML_TOK_TEXT_LEVEL_ATTR_NUM_SUFFIX:
sSuffix = rValue;
break;
case XML_TOK_TEXT_LEVEL_ATTR_NUM_LETTER_SYNC:
if( bNum )
sNumLetterSync = rValue;
break;
case XML_TOK_TEXT_LEVEL_ATTR_START_VALUE:
if( bNum )
{
sal_Int32 nTmp = rValue.toInt32();
nNumStartValue =
2001-08-21 15:33:20 +00:00
(nTmp < 0L) ? 1 : ( (nTmp>SHRT_MAX) ? SHRT_MAX
2000-09-18 16:07:07 +00:00
: (sal_Int16)nTmp );
}
break;
case XML_TOK_TEXT_LEVEL_ATTR_DISPLAY_LEVELS:
if( bNum )
{
sal_Int32 nTmp = rValue.toInt32();
nNumDisplayLevels =
(nTmp < 1L) ? 1 : ( (nTmp>SHRT_MAX) ? SHRT_MAX
: (sal_Int16)nTmp );
}
break;
}
}
}
SvxXMLListLevelStyleContext_Impl::~SvxXMLListLevelStyleContext_Impl()
{
}
SvXMLImportContext *SvxXMLListLevelStyleContext_Impl::CreateChildContext(
sal_uInt16 nPrefix, const OUString& rLocalName,
const Reference< xml::sax::XAttributeList > & xAttrList )
{
SvXMLImportContext *pContext = 0;
2000-09-18 16:07:07 +00:00
if( XML_NAMESPACE_STYLE == nPrefix &&
( IsXMLToken( rLocalName, XML_LIST_LEVEL_PROPERTIES ) ||
IsXMLToken( rLocalName, XML_TEXT_PROPERTIES ) ) )
2000-09-18 16:07:07 +00:00
{
pContext = new SvxXMLListLevelStyleAttrContext_Impl( GetImport(),
nPrefix,
rLocalName,
xAttrList,
*this );
}
else if( (XML_NAMESPACE_OFFICE == nPrefix) && xmloff::token::IsXMLToken( rLocalName,
2001-06-19 14:21:16 +00:00
xmloff::token::XML_BINARY_DATA ) )
{
if( bImage && !sImageURL.getLength() && !xBase64Stream.is() )
{
xBase64Stream = GetImport().GetStreamForGraphicObjectURLFromBase64();
if( xBase64Stream.is() )
pContext = new XMLBase64ImportContext( GetImport(), nPrefix,
rLocalName, xAttrList,
xBase64Stream );
}
}
if( !pContext )
2000-09-18 16:07:07 +00:00
{
pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
}
return pContext;
}
Sequence<beans::PropertyValue> SvxXMLListLevelStyleContext_Impl::GetProperties(
2000-12-02 09:26:15 +00:00
const SvI18NMap *pI18NMap )
2000-09-18 16:07:07 +00:00
{
sal_Int16 eType;
sal_Int32 nCount = 0L;
2001-06-29 11:34:19 +00:00
if( bBullet )
2000-09-18 16:07:07 +00:00
{
eType = NumberingType::CHAR_SPECIAL;
nCount = cBullet ? 15 : 14;
2000-09-18 16:07:07 +00:00
}
if( bImage )
2000-09-18 16:07:07 +00:00
{
eType = NumberingType::BITMAP;
nCount = 15L;
if( (sImageURL.getLength() > 0L) || xBase64Stream.is() )
nCount++;
2000-09-18 16:07:07 +00:00
}
if( bNum )
{
2001-03-19 08:41:43 +00:00
eType = NumberingType::ARABIC;
GetImport().GetMM100UnitConverter().convertNumFormat(
eType, sNumFormat, sNumLetterSync, sal_True );
nCount = 15L;
2000-09-18 16:07:07 +00:00
}
if( ( bBullet || bNum ) && nRelSize )
nCount++;
if( !bImage && bHasColor )
{
nCount++;
}
2000-09-18 16:07:07 +00:00
Sequence<beans::PropertyValue> aPropSeq( nCount );
if( nCount > 0 )
{
beans::PropertyValue *pProps = aPropSeq.getArray();
sal_Int32 nPos = 0L;
pProps[nPos].Name =
OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_NUMBERINGTYPE ));
2000-09-18 16:07:07 +00:00
pProps[nPos++].Value <<= (sal_Int16)eType ;
pProps[nPos].Name = OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_PREFIX ));
2000-09-18 16:07:07 +00:00
pProps[nPos++].Value <<= sPrefix;
pProps[nPos].Name = OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_SUFFIX ));
2000-09-18 16:07:07 +00:00
pProps[nPos++].Value <<= sSuffix;
pProps[nPos].Name = OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_ADJUST ));
2000-09-18 16:07:07 +00:00
pProps[nPos++].Value <<= eAdjust;
sal_Int32 nLeftMargin = nSpaceBefore + nMinLabelWidth;
pProps[nPos].Name =
OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_LEFT_MARGIN ));
2000-09-18 16:07:07 +00:00
pProps[nPos++].Value <<= (sal_Int32)nLeftMargin;
sal_Int32 nFirstLineOffset = -nMinLabelWidth;
2000-09-18 16:07:07 +00:00
pProps[nPos].Name =
OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_FIRST_LINE_OFFSET ));
2000-09-18 16:07:07 +00:00
pProps[nPos++].Value <<= (sal_Int32)nFirstLineOffset;
pProps[nPos].Name =
OUString(RTL_CONSTASCII_USTRINGPARAM(XML_UNO_NAME_NRULE_SYMBOL_TEXT_DISTANCE));
2000-09-18 16:07:07 +00:00
pProps[nPos++].Value <<= (sal_Int16)nMinLabelDist;
pProps[nPos].Name =
OUString(RTL_CONSTASCII_USTRINGPARAM(XML_UNO_NAME_NRULE_POSITION_AND_SPACE_MODE));
pProps[nPos++].Value <<= (sal_Int16)ePosAndSpaceMode;
pProps[nPos].Name =
OUString(RTL_CONSTASCII_USTRINGPARAM(XML_UNO_NAME_NRULE_LABEL_FOLLOWED_BY));
pProps[nPos++].Value <<= (sal_Int16)eLabelFollowedBy;
pProps[nPos].Name =
OUString(RTL_CONSTASCII_USTRINGPARAM(XML_UNO_NAME_NRULE_LISTTAB_STOP_POSITION));
pProps[nPos++].Value <<= (sal_Int32)nListtabStopPosition;
pProps[nPos].Name =
OUString(RTL_CONSTASCII_USTRINGPARAM(XML_UNO_NAME_NRULE_FIRST_LINE_INDENT));
pProps[nPos++].Value <<= (sal_Int32)nFirstLineIndent;
pProps[nPos].Name =
OUString(RTL_CONSTASCII_USTRINGPARAM(XML_UNO_NAME_NRULE_INDENT_AT));
pProps[nPos++].Value <<= (sal_Int32)nIndentAt;
OUString sDisplayTextStyleName = GetImport().GetStyleDisplayName(
XML_STYLE_FAMILY_TEXT_TEXT, sTextStyleName );
OUString sStyleName = sDisplayTextStyleName;
2000-09-18 16:07:07 +00:00
if( sStyleName.getLength() && pI18NMap )
sStyleName = pI18NMap->Get( SFX_STYLE_FAMILY_CHAR, sStyleName );
pProps[nPos].Name =
OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_CHAR_STYLE_NAME ));
pProps[nPos++].Value <<= sDisplayTextStyleName;
2000-09-18 16:07:07 +00:00
if( bBullet )
{
awt::FontDescriptor aFDesc;
aFDesc.Name = sBulletFontName;
if( sBulletFontName.getLength() )
{
aFDesc.StyleName = sBulletFontStyleName;
aFDesc.Family = eBulletFontFamily;
aFDesc.Pitch = eBulletFontPitch;
aFDesc.CharSet = eBulletFontEncoding;
aFDesc.Weight = WEIGHT_DONTKNOW;
//aFDesc.Transparant = sal_True;
sal_Bool bStarSymbol = sal_False;
if( aFDesc.Name.equalsIgnoreAsciiCase( sStarBats ) )
{
cBullet = GetImport().ConvStarBatsCharToStarSymbol( cBullet );
bStarSymbol = sal_True;
}
else if( aFDesc.Name.equalsIgnoreAsciiCase( sStarMath ) )
{
cBullet = GetImport().ConvStarMathCharToStarSymbol( cBullet );
bStarSymbol = sal_True;
}
if( bStarSymbol )
aFDesc.Name =
OUString( RTL_CONSTASCII_USTRINGPARAM("StarSymbol" ) );
2000-09-18 16:07:07 +00:00
}
2001-06-29 11:34:19 +00:00
if( cBullet )
{
OUStringBuffer sTmp(1);
sTmp.append( cBullet );
pProps[nPos].Name =
OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_BULLET_CHAR ));
2001-06-29 11:34:19 +00:00
pProps[nPos++].Value <<= sTmp.makeStringAndClear();
}
2000-09-18 16:07:07 +00:00
pProps[nPos].Name =
OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_BULLET_FONT ));
2000-09-18 16:07:07 +00:00
pProps[nPos++].Value <<= aFDesc;
2000-12-01 17:59:51 +00:00
2000-09-18 16:07:07 +00:00
}
if( bImage )
{
OUString sStr( sImageURL );
2001-06-19 14:21:16 +00:00
if( sImageURL.getLength() )
{
sStr = GetImport().ResolveGraphicObjectURL( sImageURL,
2001-06-19 14:21:16 +00:00
sal_False );
}
else if( xBase64Stream.is() )
{
sStr = GetImport().ResolveGraphicObjectURLFromBase64( xBase64Stream );
2001-08-23 12:03:43 +00:00
// xBase64Stream = 0;
2001-06-19 14:21:16 +00:00
}
2001-08-23 12:03:43 +00:00
if( sStr.getLength() )
{
pProps[nPos].Name =
OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_GRAPHICURL ));
pProps[nPos++].Value <<= sStr;
}
2000-09-18 16:07:07 +00:00
awt::Size aSize( nImageWidth, nImageHeight );
pProps[nPos].Name =
OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_GRAPHIC_SIZE ));
2000-09-18 16:07:07 +00:00
pProps[nPos++].Value <<= aSize;
pProps[nPos].Name =
OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_VERT_ORIENT ));
2000-09-18 16:07:07 +00:00
pProps[nPos++].Value <<= (sal_Int16)eImageVertOrient;
}
if( bNum )
{
pProps[nPos].Name =
OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_START_WITH ));
2000-09-18 16:07:07 +00:00
pProps[nPos++].Value <<= (sal_Int16)nNumStartValue;
pProps[nPos].Name =
OUString(RTL_CONSTASCII_USTRINGPARAM(XML_UNO_NAME_NRULE_PARENT_NUMBERING));
2000-09-18 16:07:07 +00:00
pProps[nPos++].Value <<= (sal_Int16)nNumDisplayLevels;
}
if( ( bNum || bBullet ) && nRelSize )
{
pProps[nPos].Name =
OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_BULLET_RELSIZE ));
pProps[nPos++].Value <<= nRelSize;
}
if( !bImage && bHasColor )
{
pProps[nPos].Name = OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_BULLET_COLOR ));
pProps[nPos++].Value <<= (sal_Int32)aColor.GetColor();
}
2000-09-18 16:07:07 +00:00
DBG_ASSERT( nPos == nCount, "array under/overflow" );
}
return aPropSeq;
}
// ---------------------------------------------------------------------
enum SvxXMLStyleAttributesAttrTokens
{
XML_TOK_STYLE_ATTRIBUTES_ATTR_SPACE_BEFORE,
XML_TOK_STYLE_ATTRIBUTES_ATTR_MIN_LABEL_WIDTH,
XML_TOK_STYLE_ATTRIBUTES_ATTR_MIN_LABEL_DIST,
XML_TOK_STYLE_ATTRIBUTES_ATTR_TEXT_ALIGN,
XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_NAME,
2000-09-18 16:07:07 +00:00
XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_FAMILY,
XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_FAMILY_GENERIC,
XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_STYLENAME,
XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_PITCH,
XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_CHARSET,
XML_TOK_STYLE_ATTRIBUTES_ATTR_VERTICAL_POS,
XML_TOK_STYLE_ATTRIBUTES_ATTR_VERTICAL_REL,
XML_TOK_STYLE_ATTRIBUTES_ATTR_WIDTH,
XML_TOK_STYLE_ATTRIBUTES_ATTR_HEIGHT,
2001-01-17 15:23:54 +00:00
XML_TOK_STYLE_ATTRIBUTES_ATTR_COLOR,
XML_TOK_STYLE_ATTRIBUTES_ATTR_WINDOW_FONT_COLOR,
2001-01-17 15:23:54 +00:00
XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_SIZE,
XML_TOK_STYLE_ATTRIBUTES_ATTR_POSITION_AND_SPACE_MODE,
2000-09-18 16:07:07 +00:00
XML_TOK_STYLE_ATTRIBUTES_ATTR_END=XML_TOK_UNKNOWN
};
CWS-TOOLING: integrate CWS dbaperf1 2009-04-02 09:12:25 +0200 oj r270372 : CWS-TOOLING: rebase CWS dbaperf1 to trunk@270033 (milestone: DEV300:m45) 2009-03-17 10:20:34 +0100 oj r269577 : add parameter 2009-03-17 10:20:05 +0100 oj r269576 : add parameter 2009-03-12 12:32:24 +0100 oj r269387 : add missing ++ 2009-03-11 12:53:35 +0100 oj r269315 : compile error 2009-03-06 08:52:11 +0100 oj r268968 : #i99264# remove duplicate code 2009-03-06 08:20:08 +0100 oj r268966 : add missingheader 2009-03-06 08:17:41 +0100 oj r268965 : add header 2009-03-06 08:15:07 +0100 oj r268964 : #i99708# remove duplicate code 2009-03-06 07:24:11 +0100 oj r268963 : #i99708# remove duplicate code 2009-03-06 07:22:24 +0100 oj r268962 : #i99708# use tenary operator 2009-03-06 07:19:21 +0100 oj r268961 : remove unused rtl_logs 2009-03-06 07:15:55 +0100 oj r268960 : #i99708# extract getLength from for loop 2009-03-06 07:15:35 +0100 oj r268959 : #i99708# extract getLength from for loop 2009-03-06 07:14:57 +0100 oj r268958 : remove unused rtl_logs 2009-03-06 07:13:01 +0100 oj r268957 : insert DBG_ helper 2009-03-06 07:12:17 +0100 oj r268956 : remove unused rtl_logs 2009-03-06 07:10:26 +0100 oj r268955 : remove unused rtl_logs 2009-03-06 07:04:51 +0100 oj r268954 : #i99708# use tenary operator 2009-03-05 12:04:46 +0100 oj r268895 : comment RTL_LOG out 2009-03-05 09:05:07 +0100 oj r268874 : add rtl logfile 2009-03-04 14:21:18 +0100 oj r268828 : #i99708# make static inplace and some method calls in for loop removed 2009-03-04 14:20:34 +0100 oj r268827 : #i99708# impl double check pattern for getInfohelper 2009-03-02 09:31:42 +0100 oj r268636 : add rtl logfile 2009-03-02 08:18:37 +0100 oj r268633 : add rtl logfile 2009-02-27 11:22:16 +0100 oj r268570 : #i99709# change algorithm for marking objects 2009-02-27 11:17:04 +0100 oj r268568 : #i99708# some improvements to load forms, controls faster and replacement of size() call with !empty() which is much faster 2009-02-24 10:09:35 +0100 sb r268383 : #i99290# no longer care to set a sensible context class loader for native threads attached to the VM 2009-02-23 13:44:04 +0100 oj r268354 : #i76606# seekrow changes 2009-02-23 12:27:30 +0100 oj r268349 : deleted 2009-02-20 15:14:23 +0100 oj r268325 : #i76606# some code changes 2009-02-19 14:15:25 +0100 oj r268284 : #i76606# use of simple prep stmt instead of full blown rowset, when source and dest connection are the same use insert into ... ( select ... ) 2009-02-19 11:27:55 +0100 oj r268265 : #i76606# insert some RTL_LOG and setObject impl 2009-02-18 14:45:37 +0100 oj r268222 : #i99363# insert RTL_LOG 2009-02-18 14:45:18 +0100 oj r268221 : #i99363# insert RTL_LOG 2009-02-18 11:14:54 +0100 oj r268207 : #i99363# call some impl_ methods to avoid duplicate cechCache calls 2009-02-18 11:10:47 +0100 oj r268206 : #i99363# make isCount inline 2009-02-18 10:33:22 +0100 oj r268203 : #i99363# use bookmarkable if available and inserted some RTL_LOG 2009-02-18 10:32:57 +0100 oj r268202 : #i99363# use bookmarkable if available and inserted some RTL_LOG 2009-02-17 07:29:05 +0100 oj r267843 : #i96897# remove some dll public 2009-02-16 15:01:04 +0100 oj r267816 : #i96897# remove some dll public 2009-02-16 14:25:53 +0100 oj r267810 : #i99264# remove duplicate code 2009-02-16 14:25:33 +0100 oj r267809 : #i99264# remove duplicate code 2009-02-16 14:24:59 +0100 oj r267808 : #i99264# remove duplicate code 2009-02-13 10:56:17 +0100 oj r267703 : #i99191# comment the contextclassloader 2009-02-13 10:32:40 +0100 oj r267700 : reduce call to resultset meta data 2009-02-13 10:27:31 +0100 oj r267699 : reduce call to resultset meta data 2009-02-13 10:27:08 +0100 oj r267698 : reduce call to resultset meta data
2009-04-23 10:42:05 +00:00
const SvXMLTokenMapEntry* lcl_getStyleAttributesAttrTokenMap()
2000-09-18 16:07:07 +00:00
{
CWS-TOOLING: integrate CWS dbaperf1 2009-04-02 09:12:25 +0200 oj r270372 : CWS-TOOLING: rebase CWS dbaperf1 to trunk@270033 (milestone: DEV300:m45) 2009-03-17 10:20:34 +0100 oj r269577 : add parameter 2009-03-17 10:20:05 +0100 oj r269576 : add parameter 2009-03-12 12:32:24 +0100 oj r269387 : add missing ++ 2009-03-11 12:53:35 +0100 oj r269315 : compile error 2009-03-06 08:52:11 +0100 oj r268968 : #i99264# remove duplicate code 2009-03-06 08:20:08 +0100 oj r268966 : add missingheader 2009-03-06 08:17:41 +0100 oj r268965 : add header 2009-03-06 08:15:07 +0100 oj r268964 : #i99708# remove duplicate code 2009-03-06 07:24:11 +0100 oj r268963 : #i99708# remove duplicate code 2009-03-06 07:22:24 +0100 oj r268962 : #i99708# use tenary operator 2009-03-06 07:19:21 +0100 oj r268961 : remove unused rtl_logs 2009-03-06 07:15:55 +0100 oj r268960 : #i99708# extract getLength from for loop 2009-03-06 07:15:35 +0100 oj r268959 : #i99708# extract getLength from for loop 2009-03-06 07:14:57 +0100 oj r268958 : remove unused rtl_logs 2009-03-06 07:13:01 +0100 oj r268957 : insert DBG_ helper 2009-03-06 07:12:17 +0100 oj r268956 : remove unused rtl_logs 2009-03-06 07:10:26 +0100 oj r268955 : remove unused rtl_logs 2009-03-06 07:04:51 +0100 oj r268954 : #i99708# use tenary operator 2009-03-05 12:04:46 +0100 oj r268895 : comment RTL_LOG out 2009-03-05 09:05:07 +0100 oj r268874 : add rtl logfile 2009-03-04 14:21:18 +0100 oj r268828 : #i99708# make static inplace and some method calls in for loop removed 2009-03-04 14:20:34 +0100 oj r268827 : #i99708# impl double check pattern for getInfohelper 2009-03-02 09:31:42 +0100 oj r268636 : add rtl logfile 2009-03-02 08:18:37 +0100 oj r268633 : add rtl logfile 2009-02-27 11:22:16 +0100 oj r268570 : #i99709# change algorithm for marking objects 2009-02-27 11:17:04 +0100 oj r268568 : #i99708# some improvements to load forms, controls faster and replacement of size() call with !empty() which is much faster 2009-02-24 10:09:35 +0100 sb r268383 : #i99290# no longer care to set a sensible context class loader for native threads attached to the VM 2009-02-23 13:44:04 +0100 oj r268354 : #i76606# seekrow changes 2009-02-23 12:27:30 +0100 oj r268349 : deleted 2009-02-20 15:14:23 +0100 oj r268325 : #i76606# some code changes 2009-02-19 14:15:25 +0100 oj r268284 : #i76606# use of simple prep stmt instead of full blown rowset, when source and dest connection are the same use insert into ... ( select ... ) 2009-02-19 11:27:55 +0100 oj r268265 : #i76606# insert some RTL_LOG and setObject impl 2009-02-18 14:45:37 +0100 oj r268222 : #i99363# insert RTL_LOG 2009-02-18 14:45:18 +0100 oj r268221 : #i99363# insert RTL_LOG 2009-02-18 11:14:54 +0100 oj r268207 : #i99363# call some impl_ methods to avoid duplicate cechCache calls 2009-02-18 11:10:47 +0100 oj r268206 : #i99363# make isCount inline 2009-02-18 10:33:22 +0100 oj r268203 : #i99363# use bookmarkable if available and inserted some RTL_LOG 2009-02-18 10:32:57 +0100 oj r268202 : #i99363# use bookmarkable if available and inserted some RTL_LOG 2009-02-17 07:29:05 +0100 oj r267843 : #i96897# remove some dll public 2009-02-16 15:01:04 +0100 oj r267816 : #i96897# remove some dll public 2009-02-16 14:25:53 +0100 oj r267810 : #i99264# remove duplicate code 2009-02-16 14:25:33 +0100 oj r267809 : #i99264# remove duplicate code 2009-02-16 14:24:59 +0100 oj r267808 : #i99264# remove duplicate code 2009-02-13 10:56:17 +0100 oj r267703 : #i99191# comment the contextclassloader 2009-02-13 10:32:40 +0100 oj r267700 : reduce call to resultset meta data 2009-02-13 10:27:31 +0100 oj r267699 : reduce call to resultset meta data 2009-02-13 10:27:08 +0100 oj r267698 : reduce call to resultset meta data
2009-04-23 10:42:05 +00:00
static __FAR_DATA SvXMLTokenMapEntry aStyleAttributesAttrTokenMap[] =
{
{ XML_NAMESPACE_TEXT, XML_SPACE_BEFORE,
XML_TOK_STYLE_ATTRIBUTES_ATTR_SPACE_BEFORE },
{ XML_NAMESPACE_TEXT, XML_MIN_LABEL_WIDTH,
XML_TOK_STYLE_ATTRIBUTES_ATTR_MIN_LABEL_WIDTH },
{ XML_NAMESPACE_TEXT, XML_MIN_LABEL_DISTANCE,
XML_TOK_STYLE_ATTRIBUTES_ATTR_MIN_LABEL_DIST },
{ XML_NAMESPACE_FO, XML_TEXT_ALIGN,
XML_TOK_STYLE_ATTRIBUTES_ATTR_TEXT_ALIGN },
{ XML_NAMESPACE_STYLE, XML_FONT_NAME,
XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_NAME },
{ XML_NAMESPACE_FO, XML_FONT_FAMILY,
XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_FAMILY },
{ XML_NAMESPACE_STYLE, XML_FONT_FAMILY_GENERIC,
XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_FAMILY_GENERIC },
{ XML_NAMESPACE_STYLE, XML_FONT_STYLE_NAME,
XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_STYLENAME },
{ XML_NAMESPACE_STYLE, XML_FONT_PITCH,
XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_PITCH },
{ XML_NAMESPACE_STYLE, XML_FONT_CHARSET,
XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_CHARSET },
{ XML_NAMESPACE_STYLE, XML_VERTICAL_POS,
XML_TOK_STYLE_ATTRIBUTES_ATTR_VERTICAL_POS },
{ XML_NAMESPACE_STYLE, XML_VERTICAL_REL,
XML_TOK_STYLE_ATTRIBUTES_ATTR_VERTICAL_REL },
{ XML_NAMESPACE_FO, XML_WIDTH,
XML_TOK_STYLE_ATTRIBUTES_ATTR_WIDTH },
{ XML_NAMESPACE_FO, XML_HEIGHT,
XML_TOK_STYLE_ATTRIBUTES_ATTR_HEIGHT },
{ XML_NAMESPACE_FO, XML_COLOR,
XML_TOK_STYLE_ATTRIBUTES_ATTR_COLOR },
{ XML_NAMESPACE_STYLE, XML_USE_WINDOW_FONT_COLOR,
XML_TOK_STYLE_ATTRIBUTES_ATTR_WINDOW_FONT_COLOR },
{ XML_NAMESPACE_FO, XML_FONT_SIZE,
XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_SIZE },
{ XML_NAMESPACE_TEXT, XML_LIST_LEVEL_POSITION_AND_SPACE_MODE,
XML_TOK_STYLE_ATTRIBUTES_ATTR_POSITION_AND_SPACE_MODE },
XML_TOKEN_MAP_END
};
return aStyleAttributesAttrTokenMap;
}
2000-09-18 16:07:07 +00:00
SvxXMLListLevelStyleAttrContext_Impl::SvxXMLListLevelStyleAttrContext_Impl(
SvXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& rLName,
const Reference< xml::sax::XAttributeList > & xAttrList,
SvxXMLListLevelStyleContext_Impl& rLLevel ) :
SvXMLImportContext( rImport, nPrfx, rLName ),
rListLevel( rLLevel )
{
CWS-TOOLING: integrate CWS dbaperf1 2009-04-02 09:12:25 +0200 oj r270372 : CWS-TOOLING: rebase CWS dbaperf1 to trunk@270033 (milestone: DEV300:m45) 2009-03-17 10:20:34 +0100 oj r269577 : add parameter 2009-03-17 10:20:05 +0100 oj r269576 : add parameter 2009-03-12 12:32:24 +0100 oj r269387 : add missing ++ 2009-03-11 12:53:35 +0100 oj r269315 : compile error 2009-03-06 08:52:11 +0100 oj r268968 : #i99264# remove duplicate code 2009-03-06 08:20:08 +0100 oj r268966 : add missingheader 2009-03-06 08:17:41 +0100 oj r268965 : add header 2009-03-06 08:15:07 +0100 oj r268964 : #i99708# remove duplicate code 2009-03-06 07:24:11 +0100 oj r268963 : #i99708# remove duplicate code 2009-03-06 07:22:24 +0100 oj r268962 : #i99708# use tenary operator 2009-03-06 07:19:21 +0100 oj r268961 : remove unused rtl_logs 2009-03-06 07:15:55 +0100 oj r268960 : #i99708# extract getLength from for loop 2009-03-06 07:15:35 +0100 oj r268959 : #i99708# extract getLength from for loop 2009-03-06 07:14:57 +0100 oj r268958 : remove unused rtl_logs 2009-03-06 07:13:01 +0100 oj r268957 : insert DBG_ helper 2009-03-06 07:12:17 +0100 oj r268956 : remove unused rtl_logs 2009-03-06 07:10:26 +0100 oj r268955 : remove unused rtl_logs 2009-03-06 07:04:51 +0100 oj r268954 : #i99708# use tenary operator 2009-03-05 12:04:46 +0100 oj r268895 : comment RTL_LOG out 2009-03-05 09:05:07 +0100 oj r268874 : add rtl logfile 2009-03-04 14:21:18 +0100 oj r268828 : #i99708# make static inplace and some method calls in for loop removed 2009-03-04 14:20:34 +0100 oj r268827 : #i99708# impl double check pattern for getInfohelper 2009-03-02 09:31:42 +0100 oj r268636 : add rtl logfile 2009-03-02 08:18:37 +0100 oj r268633 : add rtl logfile 2009-02-27 11:22:16 +0100 oj r268570 : #i99709# change algorithm for marking objects 2009-02-27 11:17:04 +0100 oj r268568 : #i99708# some improvements to load forms, controls faster and replacement of size() call with !empty() which is much faster 2009-02-24 10:09:35 +0100 sb r268383 : #i99290# no longer care to set a sensible context class loader for native threads attached to the VM 2009-02-23 13:44:04 +0100 oj r268354 : #i76606# seekrow changes 2009-02-23 12:27:30 +0100 oj r268349 : deleted 2009-02-20 15:14:23 +0100 oj r268325 : #i76606# some code changes 2009-02-19 14:15:25 +0100 oj r268284 : #i76606# use of simple prep stmt instead of full blown rowset, when source and dest connection are the same use insert into ... ( select ... ) 2009-02-19 11:27:55 +0100 oj r268265 : #i76606# insert some RTL_LOG and setObject impl 2009-02-18 14:45:37 +0100 oj r268222 : #i99363# insert RTL_LOG 2009-02-18 14:45:18 +0100 oj r268221 : #i99363# insert RTL_LOG 2009-02-18 11:14:54 +0100 oj r268207 : #i99363# call some impl_ methods to avoid duplicate cechCache calls 2009-02-18 11:10:47 +0100 oj r268206 : #i99363# make isCount inline 2009-02-18 10:33:22 +0100 oj r268203 : #i99363# use bookmarkable if available and inserted some RTL_LOG 2009-02-18 10:32:57 +0100 oj r268202 : #i99363# use bookmarkable if available and inserted some RTL_LOG 2009-02-17 07:29:05 +0100 oj r267843 : #i96897# remove some dll public 2009-02-16 15:01:04 +0100 oj r267816 : #i96897# remove some dll public 2009-02-16 14:25:53 +0100 oj r267810 : #i99264# remove duplicate code 2009-02-16 14:25:33 +0100 oj r267809 : #i99264# remove duplicate code 2009-02-16 14:24:59 +0100 oj r267808 : #i99264# remove duplicate code 2009-02-13 10:56:17 +0100 oj r267703 : #i99191# comment the contextclassloader 2009-02-13 10:32:40 +0100 oj r267700 : reduce call to resultset meta data 2009-02-13 10:27:31 +0100 oj r267699 : reduce call to resultset meta data 2009-02-13 10:27:08 +0100 oj r267698 : reduce call to resultset meta data
2009-04-23 10:42:05 +00:00
SvXMLTokenMap aTokenMap( lcl_getStyleAttributesAttrTokenMap() );
2001-03-19 08:41:43 +00:00
SvXMLUnitConverter& rUnitConv = GetImport().GetMM100UnitConverter();
2000-09-18 16:07:07 +00:00
OUString sFontName, sFontFamily, sFontStyleName, sFontFamilyGeneric,
2000-09-18 16:07:07 +00:00
sFontPitch, sFontCharset;
OUString sVerticalPos, sVerticalRel;
sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
for( sal_Int16 i=0; i < nAttrCount; i++ )
{
const OUString& rAttrName = xAttrList->getNameByIndex( i );
OUString aLocalName;
sal_uInt16 nPrefix =
GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName,
&aLocalName );
const OUString& rValue = xAttrList->getValueByIndex( i );
sal_Int32 nVal;
switch( aTokenMap.Get( nPrefix, aLocalName ) )
{
case XML_TOK_STYLE_ATTRIBUTES_ATTR_SPACE_BEFORE:
if( rUnitConv.convertMeasure( nVal, rValue, SHRT_MIN, SHRT_MAX ) )
2000-09-18 16:07:07 +00:00
rListLevel.SetSpaceBefore( nVal );
break;
case XML_TOK_STYLE_ATTRIBUTES_ATTR_MIN_LABEL_WIDTH:
2001-03-19 08:41:43 +00:00
if( rUnitConv.convertMeasure( nVal, rValue, 0, SHRT_MAX ) )
2000-09-18 16:07:07 +00:00
rListLevel.SetMinLabelWidth( nVal );
break;
case XML_TOK_STYLE_ATTRIBUTES_ATTR_MIN_LABEL_DIST:
2001-03-19 08:41:43 +00:00
if( rUnitConv.convertMeasure( nVal, rValue, 0, USHRT_MAX ) )
2000-09-18 16:07:07 +00:00
rListLevel.SetMinLabelDist( nVal );
break;
case XML_TOK_STYLE_ATTRIBUTES_ATTR_TEXT_ALIGN:
if( rValue.getLength() )
{
sal_Int16 eAdjust = HoriOrientation::LEFT;
if( IsXMLToken( rValue, XML_CENTER ) )
2000-09-18 16:07:07 +00:00
eAdjust = HoriOrientation::CENTER;
else if( IsXMLToken( rValue, XML_END ) )
2000-09-18 16:07:07 +00:00
eAdjust = HoriOrientation::RIGHT;
rListLevel.SetAdjust( eAdjust );
}
break;
case XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_NAME:
sFontName = rValue;
break;
2000-09-18 16:07:07 +00:00
case XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_FAMILY:
sFontFamily = rValue;
break;
case XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_FAMILY_GENERIC:
sFontFamilyGeneric = rValue;
break;
case XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_STYLENAME:
sFontStyleName = rValue;
break;
case XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_PITCH:
sFontPitch = rValue;
break;
case XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_CHARSET:
sFontCharset = rValue;
break;
case XML_TOK_STYLE_ATTRIBUTES_ATTR_VERTICAL_POS:
sVerticalPos = rValue;
break;
case XML_TOK_STYLE_ATTRIBUTES_ATTR_VERTICAL_REL:
sVerticalRel = rValue;
break;
case XML_TOK_STYLE_ATTRIBUTES_ATTR_WIDTH:
if( rUnitConv.convertMeasure( nVal, rValue, 0, SAL_MAX_INT32) )
2000-09-18 16:07:07 +00:00
rListLevel.SetImageWidth( nVal );
break;
case XML_TOK_STYLE_ATTRIBUTES_ATTR_HEIGHT:
if( rUnitConv.convertMeasure( nVal, rValue, 0, SAL_MAX_INT32) )
2000-09-18 16:07:07 +00:00
rListLevel.SetImageHeight( nVal );
break;
2001-01-17 15:23:54 +00:00
case XML_TOK_STYLE_ATTRIBUTES_ATTR_COLOR:
{
Color aColor;
if( SvXMLUnitConverter::convertColor( aColor, rValue ) )
rListLevel.SetColor( (sal_Int32)aColor.GetColor() );
}
2000-09-18 16:07:07 +00:00
break;
case XML_TOK_STYLE_ATTRIBUTES_ATTR_WINDOW_FONT_COLOR:
{
if( IsXMLToken( rValue, XML_TRUE ) )
rListLevel.SetColor( (sal_Int32)0xffffffff );
}
break;
2001-01-17 15:23:54 +00:00
case XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_SIZE:
if(SvXMLUnitConverter::convertPercent( nVal, rValue ) )
rListLevel.SetRelSize( (sal_Int16)nVal );
break;
case XML_TOK_STYLE_ATTRIBUTES_ATTR_POSITION_AND_SPACE_MODE:
{
sal_Int16 ePosAndSpaceMode = PositionAndSpaceMode::LABEL_WIDTH_AND_POSITION;
if( IsXMLToken( rValue, XML_LABEL_ALIGNMENT ) )
ePosAndSpaceMode = PositionAndSpaceMode::LABEL_ALIGNMENT;
rListLevel.SetPosAndSpaceMode( ePosAndSpaceMode );
}
break;
2000-09-18 16:07:07 +00:00
}
}
if( sFontName.getLength() )
{
const XMLFontStylesContext *pFontDecls =
GetImport().GetTextImport()->GetFontDecls();
if( pFontDecls )
{
::std::vector < XMLPropertyState > aProps;
if( pFontDecls->FillProperties( sFontName, aProps, 0, 1, 2, 3, 4 ) )
{
OUString sTmp;
sal_Int16 nTmp = 0;
::std::vector< XMLPropertyState >::iterator i;
for( i = aProps.begin(); i != aProps.end(); i++ )
{
switch( i->mnIndex )
{
case 0:
i->maValue >>= sTmp;
rListLevel.SetBulletFontName( sTmp);
break;
case 1:
i->maValue >>= sTmp;
rListLevel.SetBulletFontStyleName( sTmp );
break;
case 2:
i->maValue >>= nTmp;
rListLevel.SetBulletFontFamily( nTmp );
break;
case 3:
i->maValue >>= nTmp;
rListLevel.SetBulletFontPitch( nTmp );
break;
case 4:
i->maValue >>= nTmp;
rListLevel.SetBulletFontEncoding( nTmp );
break;
}
}
}
}
}
2000-09-18 16:07:07 +00:00
if( sFontFamily.getLength() )
{
String sEmpty;
Any aAny;
XMLFontFamilyNamePropHdl aFamilyNameHdl;
2001-03-19 08:41:43 +00:00
if( aFamilyNameHdl.importXML( sFontFamily, aAny, rUnitConv ) )
2000-09-18 16:07:07 +00:00
{
OUString sTmp;
aAny >>= sTmp;
rListLevel.SetBulletFontName( sTmp);
}
XMLFontFamilyPropHdl aFamilyHdl;
if( sFontFamilyGeneric.getLength() &&
2001-03-19 08:41:43 +00:00
aFamilyHdl.importXML( sFontFamilyGeneric, aAny, rUnitConv ) )
2000-09-18 16:07:07 +00:00
{
sal_Int16 nTmp = 0;
2000-09-18 16:07:07 +00:00
aAny >>= nTmp;
rListLevel.SetBulletFontFamily( nTmp );
}
if( sFontStyleName.getLength() )
rListLevel.SetBulletFontStyleName( sFontStyleName );
XMLFontPitchPropHdl aPitchHdl;
if( sFontPitch.getLength() &&
2001-03-19 08:41:43 +00:00
aPitchHdl.importXML( sFontPitch, aAny, rUnitConv ) )
2000-09-18 16:07:07 +00:00
{
sal_Int16 nTmp = 0;
2000-09-18 16:07:07 +00:00
aAny >>= nTmp;
rListLevel.SetBulletFontPitch( nTmp );
}
XMLFontEncodingPropHdl aEncHdl;
if( sFontCharset.getLength() &&
2001-03-19 08:41:43 +00:00
aEncHdl.importXML( sFontCharset, aAny, rUnitConv ) )
2000-09-18 16:07:07 +00:00
{
sal_Int16 nTmp = 0;
2000-09-18 16:07:07 +00:00
aAny >>= nTmp;
rListLevel.SetBulletFontEncoding( nTmp );
}
}
sal_Int16 eVertOrient = VertOrientation::LINE_CENTER;
if( sVerticalPos.getLength() )
{
if( IsXMLToken( sVerticalPos, XML_TOP ) )
2000-09-18 16:07:07 +00:00
eVertOrient = VertOrientation::LINE_TOP;
else if( IsXMLToken( sVerticalPos, XML_BOTTOM ) )
2000-09-18 16:07:07 +00:00
eVertOrient = VertOrientation::LINE_BOTTOM;
}
if( sVerticalRel.getLength() )
{
if( IsXMLToken( sVerticalRel, XML_BASELINE ) )
2000-09-18 16:07:07 +00:00
{
// TOP and BOTTOM are exchanged for a baseline relation
switch( eVertOrient )
{
case VertOrientation::LINE_TOP:
eVertOrient = VertOrientation::BOTTOM;
break;
case VertOrientation::LINE_CENTER:
eVertOrient = VertOrientation::CENTER;
break;
case VertOrientation::LINE_BOTTOM:
eVertOrient = VertOrientation::TOP;
break;
}
}
else if( IsXMLToken( sVerticalRel, XML_CHAR ) )
2000-09-18 16:07:07 +00:00
{
switch( eVertOrient )
{
case VertOrientation::LINE_TOP:
eVertOrient = VertOrientation::CHAR_TOP;
break;
case VertOrientation::LINE_CENTER:
eVertOrient = VertOrientation::CHAR_CENTER;
break;
case VertOrientation::LINE_BOTTOM:
eVertOrient = VertOrientation::CHAR_BOTTOM;
break;
}
}
}
rListLevel.SetImageVertOrient( eVertOrient );
}
SvxXMLListLevelStyleAttrContext_Impl::~SvxXMLListLevelStyleAttrContext_Impl()
{
}
SvXMLImportContext* SvxXMLListLevelStyleAttrContext_Impl::CreateChildContext(
sal_uInt16 nPrefix, const OUString& rLocalName,
const Reference< xml::sax::XAttributeList > & xAttrList )
{
SvXMLImportContext *pContext = 0;
if ( XML_NAMESPACE_STYLE == nPrefix &&
IsXMLToken( rLocalName, XML_LIST_LEVEL_LABEL_ALIGNMENT ) )
{
pContext = new SvxXMLListLevelStyleLabelAlignmentAttrContext_Impl( GetImport(),
nPrefix,
rLocalName,
xAttrList,
rListLevel );
}
if( !pContext )
{
pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
}
return pContext;
}
// ---------------------------------------------------------------------
enum SvxXMLStyleAttributesLabelAlignmentAttrTokens
{
XML_TOK_STYLE_ATTRIBUTES_ATTR_LABEL_FOLLOWED_BY,
XML_TOK_STYLE_ATTRIBUTES_ATTR_LISTTAB_STOP_POSITION,
XML_TOK_STYLE_ATTRIBUTES_ATTR_FIRST_LINE_INDENT,
XML_TOK_STYLE_ATTRIBUTES_ATTR_INDENT_AT,
XML_TOK_STYLE_ATTRIBUTES_LABEL_ALIGNMENT_ATTR_END=XML_TOK_UNKNOWN
};
CWS-TOOLING: integrate CWS dbaperf1 2009-04-02 09:12:25 +0200 oj r270372 : CWS-TOOLING: rebase CWS dbaperf1 to trunk@270033 (milestone: DEV300:m45) 2009-03-17 10:20:34 +0100 oj r269577 : add parameter 2009-03-17 10:20:05 +0100 oj r269576 : add parameter 2009-03-12 12:32:24 +0100 oj r269387 : add missing ++ 2009-03-11 12:53:35 +0100 oj r269315 : compile error 2009-03-06 08:52:11 +0100 oj r268968 : #i99264# remove duplicate code 2009-03-06 08:20:08 +0100 oj r268966 : add missingheader 2009-03-06 08:17:41 +0100 oj r268965 : add header 2009-03-06 08:15:07 +0100 oj r268964 : #i99708# remove duplicate code 2009-03-06 07:24:11 +0100 oj r268963 : #i99708# remove duplicate code 2009-03-06 07:22:24 +0100 oj r268962 : #i99708# use tenary operator 2009-03-06 07:19:21 +0100 oj r268961 : remove unused rtl_logs 2009-03-06 07:15:55 +0100 oj r268960 : #i99708# extract getLength from for loop 2009-03-06 07:15:35 +0100 oj r268959 : #i99708# extract getLength from for loop 2009-03-06 07:14:57 +0100 oj r268958 : remove unused rtl_logs 2009-03-06 07:13:01 +0100 oj r268957 : insert DBG_ helper 2009-03-06 07:12:17 +0100 oj r268956 : remove unused rtl_logs 2009-03-06 07:10:26 +0100 oj r268955 : remove unused rtl_logs 2009-03-06 07:04:51 +0100 oj r268954 : #i99708# use tenary operator 2009-03-05 12:04:46 +0100 oj r268895 : comment RTL_LOG out 2009-03-05 09:05:07 +0100 oj r268874 : add rtl logfile 2009-03-04 14:21:18 +0100 oj r268828 : #i99708# make static inplace and some method calls in for loop removed 2009-03-04 14:20:34 +0100 oj r268827 : #i99708# impl double check pattern for getInfohelper 2009-03-02 09:31:42 +0100 oj r268636 : add rtl logfile 2009-03-02 08:18:37 +0100 oj r268633 : add rtl logfile 2009-02-27 11:22:16 +0100 oj r268570 : #i99709# change algorithm for marking objects 2009-02-27 11:17:04 +0100 oj r268568 : #i99708# some improvements to load forms, controls faster and replacement of size() call with !empty() which is much faster 2009-02-24 10:09:35 +0100 sb r268383 : #i99290# no longer care to set a sensible context class loader for native threads attached to the VM 2009-02-23 13:44:04 +0100 oj r268354 : #i76606# seekrow changes 2009-02-23 12:27:30 +0100 oj r268349 : deleted 2009-02-20 15:14:23 +0100 oj r268325 : #i76606# some code changes 2009-02-19 14:15:25 +0100 oj r268284 : #i76606# use of simple prep stmt instead of full blown rowset, when source and dest connection are the same use insert into ... ( select ... ) 2009-02-19 11:27:55 +0100 oj r268265 : #i76606# insert some RTL_LOG and setObject impl 2009-02-18 14:45:37 +0100 oj r268222 : #i99363# insert RTL_LOG 2009-02-18 14:45:18 +0100 oj r268221 : #i99363# insert RTL_LOG 2009-02-18 11:14:54 +0100 oj r268207 : #i99363# call some impl_ methods to avoid duplicate cechCache calls 2009-02-18 11:10:47 +0100 oj r268206 : #i99363# make isCount inline 2009-02-18 10:33:22 +0100 oj r268203 : #i99363# use bookmarkable if available and inserted some RTL_LOG 2009-02-18 10:32:57 +0100 oj r268202 : #i99363# use bookmarkable if available and inserted some RTL_LOG 2009-02-17 07:29:05 +0100 oj r267843 : #i96897# remove some dll public 2009-02-16 15:01:04 +0100 oj r267816 : #i96897# remove some dll public 2009-02-16 14:25:53 +0100 oj r267810 : #i99264# remove duplicate code 2009-02-16 14:25:33 +0100 oj r267809 : #i99264# remove duplicate code 2009-02-16 14:24:59 +0100 oj r267808 : #i99264# remove duplicate code 2009-02-13 10:56:17 +0100 oj r267703 : #i99191# comment the contextclassloader 2009-02-13 10:32:40 +0100 oj r267700 : reduce call to resultset meta data 2009-02-13 10:27:31 +0100 oj r267699 : reduce call to resultset meta data 2009-02-13 10:27:08 +0100 oj r267698 : reduce call to resultset meta data
2009-04-23 10:42:05 +00:00
const SvXMLTokenMapEntry* lcl_getStyleAlignmentAttributesAttrTokenMap()
{
CWS-TOOLING: integrate CWS dbaperf1 2009-04-02 09:12:25 +0200 oj r270372 : CWS-TOOLING: rebase CWS dbaperf1 to trunk@270033 (milestone: DEV300:m45) 2009-03-17 10:20:34 +0100 oj r269577 : add parameter 2009-03-17 10:20:05 +0100 oj r269576 : add parameter 2009-03-12 12:32:24 +0100 oj r269387 : add missing ++ 2009-03-11 12:53:35 +0100 oj r269315 : compile error 2009-03-06 08:52:11 +0100 oj r268968 : #i99264# remove duplicate code 2009-03-06 08:20:08 +0100 oj r268966 : add missingheader 2009-03-06 08:17:41 +0100 oj r268965 : add header 2009-03-06 08:15:07 +0100 oj r268964 : #i99708# remove duplicate code 2009-03-06 07:24:11 +0100 oj r268963 : #i99708# remove duplicate code 2009-03-06 07:22:24 +0100 oj r268962 : #i99708# use tenary operator 2009-03-06 07:19:21 +0100 oj r268961 : remove unused rtl_logs 2009-03-06 07:15:55 +0100 oj r268960 : #i99708# extract getLength from for loop 2009-03-06 07:15:35 +0100 oj r268959 : #i99708# extract getLength from for loop 2009-03-06 07:14:57 +0100 oj r268958 : remove unused rtl_logs 2009-03-06 07:13:01 +0100 oj r268957 : insert DBG_ helper 2009-03-06 07:12:17 +0100 oj r268956 : remove unused rtl_logs 2009-03-06 07:10:26 +0100 oj r268955 : remove unused rtl_logs 2009-03-06 07:04:51 +0100 oj r268954 : #i99708# use tenary operator 2009-03-05 12:04:46 +0100 oj r268895 : comment RTL_LOG out 2009-03-05 09:05:07 +0100 oj r268874 : add rtl logfile 2009-03-04 14:21:18 +0100 oj r268828 : #i99708# make static inplace and some method calls in for loop removed 2009-03-04 14:20:34 +0100 oj r268827 : #i99708# impl double check pattern for getInfohelper 2009-03-02 09:31:42 +0100 oj r268636 : add rtl logfile 2009-03-02 08:18:37 +0100 oj r268633 : add rtl logfile 2009-02-27 11:22:16 +0100 oj r268570 : #i99709# change algorithm for marking objects 2009-02-27 11:17:04 +0100 oj r268568 : #i99708# some improvements to load forms, controls faster and replacement of size() call with !empty() which is much faster 2009-02-24 10:09:35 +0100 sb r268383 : #i99290# no longer care to set a sensible context class loader for native threads attached to the VM 2009-02-23 13:44:04 +0100 oj r268354 : #i76606# seekrow changes 2009-02-23 12:27:30 +0100 oj r268349 : deleted 2009-02-20 15:14:23 +0100 oj r268325 : #i76606# some code changes 2009-02-19 14:15:25 +0100 oj r268284 : #i76606# use of simple prep stmt instead of full blown rowset, when source and dest connection are the same use insert into ... ( select ... ) 2009-02-19 11:27:55 +0100 oj r268265 : #i76606# insert some RTL_LOG and setObject impl 2009-02-18 14:45:37 +0100 oj r268222 : #i99363# insert RTL_LOG 2009-02-18 14:45:18 +0100 oj r268221 : #i99363# insert RTL_LOG 2009-02-18 11:14:54 +0100 oj r268207 : #i99363# call some impl_ methods to avoid duplicate cechCache calls 2009-02-18 11:10:47 +0100 oj r268206 : #i99363# make isCount inline 2009-02-18 10:33:22 +0100 oj r268203 : #i99363# use bookmarkable if available and inserted some RTL_LOG 2009-02-18 10:32:57 +0100 oj r268202 : #i99363# use bookmarkable if available and inserted some RTL_LOG 2009-02-17 07:29:05 +0100 oj r267843 : #i96897# remove some dll public 2009-02-16 15:01:04 +0100 oj r267816 : #i96897# remove some dll public 2009-02-16 14:25:53 +0100 oj r267810 : #i99264# remove duplicate code 2009-02-16 14:25:33 +0100 oj r267809 : #i99264# remove duplicate code 2009-02-16 14:24:59 +0100 oj r267808 : #i99264# remove duplicate code 2009-02-13 10:56:17 +0100 oj r267703 : #i99191# comment the contextclassloader 2009-02-13 10:32:40 +0100 oj r267700 : reduce call to resultset meta data 2009-02-13 10:27:31 +0100 oj r267699 : reduce call to resultset meta data 2009-02-13 10:27:08 +0100 oj r267698 : reduce call to resultset meta data
2009-04-23 10:42:05 +00:00
static __FAR_DATA SvXMLTokenMapEntry aStyleAlignmentAttributesAttrTokenMap[] =
{
{ XML_NAMESPACE_TEXT, XML_LABEL_FOLLOWED_BY,
XML_TOK_STYLE_ATTRIBUTES_ATTR_LABEL_FOLLOWED_BY },
{ XML_NAMESPACE_TEXT, XML_LIST_TAB_STOP_POSITION,
XML_TOK_STYLE_ATTRIBUTES_ATTR_LISTTAB_STOP_POSITION },
{ XML_NAMESPACE_FO, XML_TEXT_INDENT,
XML_TOK_STYLE_ATTRIBUTES_ATTR_FIRST_LINE_INDENT },
{ XML_NAMESPACE_FO, XML_MARGIN_LEFT,
XML_TOK_STYLE_ATTRIBUTES_ATTR_INDENT_AT },
XML_TOKEN_MAP_END
};
return aStyleAlignmentAttributesAttrTokenMap;
}
SvxXMLListLevelStyleLabelAlignmentAttrContext_Impl::SvxXMLListLevelStyleLabelAlignmentAttrContext_Impl(
SvXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& rLName,
const Reference< xml::sax::XAttributeList > & xAttrList,
SvxXMLListLevelStyleContext_Impl& rLLevel ) :
SvXMLImportContext( rImport, nPrfx, rLName ),
rListLevel( rLLevel )
{
CWS-TOOLING: integrate CWS dbaperf1 2009-04-02 09:12:25 +0200 oj r270372 : CWS-TOOLING: rebase CWS dbaperf1 to trunk@270033 (milestone: DEV300:m45) 2009-03-17 10:20:34 +0100 oj r269577 : add parameter 2009-03-17 10:20:05 +0100 oj r269576 : add parameter 2009-03-12 12:32:24 +0100 oj r269387 : add missing ++ 2009-03-11 12:53:35 +0100 oj r269315 : compile error 2009-03-06 08:52:11 +0100 oj r268968 : #i99264# remove duplicate code 2009-03-06 08:20:08 +0100 oj r268966 : add missingheader 2009-03-06 08:17:41 +0100 oj r268965 : add header 2009-03-06 08:15:07 +0100 oj r268964 : #i99708# remove duplicate code 2009-03-06 07:24:11 +0100 oj r268963 : #i99708# remove duplicate code 2009-03-06 07:22:24 +0100 oj r268962 : #i99708# use tenary operator 2009-03-06 07:19:21 +0100 oj r268961 : remove unused rtl_logs 2009-03-06 07:15:55 +0100 oj r268960 : #i99708# extract getLength from for loop 2009-03-06 07:15:35 +0100 oj r268959 : #i99708# extract getLength from for loop 2009-03-06 07:14:57 +0100 oj r268958 : remove unused rtl_logs 2009-03-06 07:13:01 +0100 oj r268957 : insert DBG_ helper 2009-03-06 07:12:17 +0100 oj r268956 : remove unused rtl_logs 2009-03-06 07:10:26 +0100 oj r268955 : remove unused rtl_logs 2009-03-06 07:04:51 +0100 oj r268954 : #i99708# use tenary operator 2009-03-05 12:04:46 +0100 oj r268895 : comment RTL_LOG out 2009-03-05 09:05:07 +0100 oj r268874 : add rtl logfile 2009-03-04 14:21:18 +0100 oj r268828 : #i99708# make static inplace and some method calls in for loop removed 2009-03-04 14:20:34 +0100 oj r268827 : #i99708# impl double check pattern for getInfohelper 2009-03-02 09:31:42 +0100 oj r268636 : add rtl logfile 2009-03-02 08:18:37 +0100 oj r268633 : add rtl logfile 2009-02-27 11:22:16 +0100 oj r268570 : #i99709# change algorithm for marking objects 2009-02-27 11:17:04 +0100 oj r268568 : #i99708# some improvements to load forms, controls faster and replacement of size() call with !empty() which is much faster 2009-02-24 10:09:35 +0100 sb r268383 : #i99290# no longer care to set a sensible context class loader for native threads attached to the VM 2009-02-23 13:44:04 +0100 oj r268354 : #i76606# seekrow changes 2009-02-23 12:27:30 +0100 oj r268349 : deleted 2009-02-20 15:14:23 +0100 oj r268325 : #i76606# some code changes 2009-02-19 14:15:25 +0100 oj r268284 : #i76606# use of simple prep stmt instead of full blown rowset, when source and dest connection are the same use insert into ... ( select ... ) 2009-02-19 11:27:55 +0100 oj r268265 : #i76606# insert some RTL_LOG and setObject impl 2009-02-18 14:45:37 +0100 oj r268222 : #i99363# insert RTL_LOG 2009-02-18 14:45:18 +0100 oj r268221 : #i99363# insert RTL_LOG 2009-02-18 11:14:54 +0100 oj r268207 : #i99363# call some impl_ methods to avoid duplicate cechCache calls 2009-02-18 11:10:47 +0100 oj r268206 : #i99363# make isCount inline 2009-02-18 10:33:22 +0100 oj r268203 : #i99363# use bookmarkable if available and inserted some RTL_LOG 2009-02-18 10:32:57 +0100 oj r268202 : #i99363# use bookmarkable if available and inserted some RTL_LOG 2009-02-17 07:29:05 +0100 oj r267843 : #i96897# remove some dll public 2009-02-16 15:01:04 +0100 oj r267816 : #i96897# remove some dll public 2009-02-16 14:25:53 +0100 oj r267810 : #i99264# remove duplicate code 2009-02-16 14:25:33 +0100 oj r267809 : #i99264# remove duplicate code 2009-02-16 14:24:59 +0100 oj r267808 : #i99264# remove duplicate code 2009-02-13 10:56:17 +0100 oj r267703 : #i99191# comment the contextclassloader 2009-02-13 10:32:40 +0100 oj r267700 : reduce call to resultset meta data 2009-02-13 10:27:31 +0100 oj r267699 : reduce call to resultset meta data 2009-02-13 10:27:08 +0100 oj r267698 : reduce call to resultset meta data
2009-04-23 10:42:05 +00:00
SvXMLTokenMap aTokenMap( lcl_getStyleAlignmentAttributesAttrTokenMap() );
SvXMLUnitConverter& rUnitConv = GetImport().GetMM100UnitConverter();
sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
for( sal_Int16 i=0; i < nAttrCount; i++ )
{
const OUString& rAttrName = xAttrList->getNameByIndex( i );
OUString aLocalName;
sal_uInt16 nPrefix =
GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName,
&aLocalName );
const OUString& rValue = xAttrList->getValueByIndex( i );
sal_Int32 nVal;
switch( aTokenMap.Get( nPrefix, aLocalName ) )
{
case XML_TOK_STYLE_ATTRIBUTES_ATTR_LABEL_FOLLOWED_BY:
{
sal_Int16 eLabelFollowedBy = LabelFollow::LISTTAB;
if( IsXMLToken( rValue, XML_SPACE ) )
eLabelFollowedBy = LabelFollow::SPACE;
else if( IsXMLToken( rValue, XML_NOTHING ) )
eLabelFollowedBy = LabelFollow::NOTHING;
rListLevel.SetLabelFollowedBy( eLabelFollowedBy );
}
break;
case XML_TOK_STYLE_ATTRIBUTES_ATTR_LISTTAB_STOP_POSITION:
if( rUnitConv.convertMeasure( nVal, rValue, 0, SHRT_MAX ) )
rListLevel.SetListtabStopPosition( nVal );
break;
case XML_TOK_STYLE_ATTRIBUTES_ATTR_FIRST_LINE_INDENT:
if( rUnitConv.convertMeasure( nVal, rValue, SHRT_MIN, SHRT_MAX ) )
rListLevel.SetFirstLineIndent( nVal );
break;
case XML_TOK_STYLE_ATTRIBUTES_ATTR_INDENT_AT:
if( rUnitConv.convertMeasure( nVal, rValue, SHRT_MIN, SHRT_MAX ) )
rListLevel.SetIndentAt( nVal );
break;
}
}
}
SvxXMLListLevelStyleLabelAlignmentAttrContext_Impl::~SvxXMLListLevelStyleLabelAlignmentAttrContext_Impl()
{
}
2000-09-18 16:07:07 +00:00
// ---------------------------------------------------------------------
typedef SvxXMLListLevelStyleContext_Impl *SvxXMLListLevelStyleContext_ImplPtr;
SV_DECL_PTRARR( SvxXMLListStyle_Impl, SvxXMLListLevelStyleContext_ImplPtr,
10, 5 )
void SvxXMLListStyleContext::SetAttribute( sal_uInt16 nPrefixKey,
const OUString& rLocalName,
const OUString& rValue )
{
if( XML_NAMESPACE_TEXT == nPrefixKey &&
IsXMLToken( rLocalName, XML_CONSECUTIVE_NUMBERING ) )
2000-09-18 16:07:07 +00:00
{
bConsecutive = IsXMLToken( rValue, XML_TRUE );
2000-09-18 16:07:07 +00:00
}
else
{
SvXMLStyleContext::SetAttribute( nPrefixKey, rLocalName, rValue );
}
}
SvxXMLListStyleContext::SvxXMLListStyleContext( SvXMLImport& rImport,
sal_uInt16 nPrfx,
const OUString& rLName,
const Reference< xml::sax::XAttributeList > & xAttrList,
sal_Bool bOutl )
: SvXMLStyleContext( rImport, nPrfx, rLName, xAttrList, bOutl ? XML_STYLE_FAMILY_TEXT_OUTLINE : XML_STYLE_FAMILY_TEXT_LIST )
, sIsPhysical( RTL_CONSTASCII_USTRINGPARAM( "IsPhysical" ) )
, sNumberingRules( RTL_CONSTASCII_USTRINGPARAM( "NumberingRules" ) )
, sName( RTL_CONSTASCII_USTRINGPARAM( "Name" ) )
, sIsContinuousNumbering( RTL_CONSTASCII_USTRINGPARAM( "IsContinuousNumbering" ) )
, pLevelStyles( 0 )
, nLevels( 0 )
, bConsecutive( sal_False )
, bOutline( bOutl )
2000-09-18 16:07:07 +00:00
{
}
SvxXMLListStyleContext::~SvxXMLListStyleContext()
{
if( pLevelStyles )
{
while( pLevelStyles->Count() )
{
sal_uInt16 n = pLevelStyles->Count() - 1;
SvxXMLListLevelStyleContext_Impl *pStyle = (*pLevelStyles)[n];
pLevelStyles->Remove( n, 1 );
pStyle->ReleaseRef();
}
}
delete pLevelStyles;
}
TYPEINIT1( SvxXMLListStyleContext, SvXMLStyleContext );
SvXMLImportContext *SvxXMLListStyleContext::CreateChildContext(
sal_uInt16 nPrefix,
const OUString& rLocalName,
const Reference< xml::sax::XAttributeList > & xAttrList )
{
SvXMLImportContext *pContext = 0;
if( XML_NAMESPACE_TEXT == nPrefix &&
( bOutline
? IsXMLToken( rLocalName, XML_OUTLINE_LEVEL_STYLE )
: ( IsXMLToken( rLocalName, XML_LIST_LEVEL_STYLE_NUMBER ) ||
IsXMLToken( rLocalName, XML_LIST_LEVEL_STYLE_BULLET ) ||
IsXMLToken( rLocalName, XML_LIST_LEVEL_STYLE_IMAGE ) ) ) )
2000-09-18 16:07:07 +00:00
{
SvxXMLListLevelStyleContext_Impl *pLevelStyle =
new SvxXMLListLevelStyleContext_Impl( GetImport(), nPrefix,
rLocalName, xAttrList );
if( !pLevelStyles )
pLevelStyles = new SvxXMLListStyle_Impl;
pLevelStyles->Insert( pLevelStyle, pLevelStyles->Count() );
pLevelStyle->AddRef();
pContext = pLevelStyle;
}
else
{
pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
}
return pContext;
}
void SvxXMLListStyleContext::FillUnoNumRule(
const Reference< container::XIndexReplace > & rNumRule,
const SvI18NMap *pI18NMap ) const
{
try
2000-09-18 16:07:07 +00:00
{
if( pLevelStyles && rNumRule.is() )
2000-09-18 16:07:07 +00:00
{
sal_uInt16 nCount = pLevelStyles->Count();
sal_Int32 l_nLevels = rNumRule->getCount();
for( sal_uInt16 i=0; i < nCount; i++ )
2000-09-18 16:07:07 +00:00
{
SvxXMLListLevelStyleContext_Impl *pLevelStyle =
(*pLevelStyles)[i];
sal_Int32 nLevel = pLevelStyle->GetLevel();
if( nLevel >= 0 && nLevel < l_nLevels )
{
Sequence<beans::PropertyValue> aProps =
pLevelStyle->GetProperties( pI18NMap );
Any aAny;
aAny <<= aProps;
rNumRule->replaceByIndex( nLevel, aAny );
}
2000-09-18 16:07:07 +00:00
}
}
Reference < XPropertySet > xPropSet( rNumRule, UNO_QUERY );
Reference< XPropertySetInfo > xPropSetInfo;
if (xPropSet.is())
xPropSetInfo = xPropSet->getPropertySetInfo();
if( xPropSetInfo.is() &&
xPropSetInfo->hasPropertyByName( sIsContinuousNumbering ) )
{
Any aAny;
sal_Bool bTmp = bConsecutive;
aAny.setValue( &bTmp, ::getBooleanCppuType() );
xPropSet->setPropertyValue( sIsContinuousNumbering, aAny );
}
}
catch( Exception& )
2000-09-18 16:07:07 +00:00
{
DBG_ERROR( "SvxXMLListStyleContext::FillUnoNumRule - Exception catched" );
2000-09-18 16:07:07 +00:00
}
}
void SvxXMLListStyleContext::CreateAndInsertLate( sal_Bool bOverwrite )
{
if( bOutline )
{
if( bOverwrite )
{
const Reference< XIndexReplace >& rNumRule =
GetImport().GetTextImport()->GetChapterNumbering();
2000-10-23 08:37:16 +00:00
// We don't set xNumberingRules here, to avoid using them
// as numbering rules.
2000-09-18 16:07:07 +00:00
if( rNumRule.is() )
FillUnoNumRule( rNumRule, 0 );
}
}
else
{
Reference < XStyle > xStyle;
const OUString& rName = GetDisplayName();
2000-09-18 16:07:07 +00:00
if( 0 == rName.getLength() )
{
SetValid( sal_False );
return;
}
const Reference < XNameContainer >& rNumStyles =
GetImport().GetTextImport()->GetNumberingStyles();
if( !rNumStyles.is() )
{
SetValid( sal_False );
return;
}
sal_Bool bNew = sal_False;
if( rNumStyles->hasByName( rName ) )
{
Any aAny = rNumStyles->getByName( rName );
aAny >>= xStyle;
}
else
{
Reference< XMultiServiceFactory > xFactory( GetImport().GetModel(),
UNO_QUERY );
DBG_ASSERT( xFactory.is(), "no factory" );
if( !xFactory.is() )
return;
Reference < XInterface > xIfc = xFactory->createInstance(OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.style.NumberingStyle")) );
if( !xIfc.is() )
return;
Reference < XStyle > xTmp( xIfc, UNO_QUERY );
xStyle = xTmp;
if( !xStyle.is() )
return;
Any aAny;
aAny <<= xStyle;
rNumStyles->insertByName( rName, aAny );
bNew = sal_True;
}
Reference < XPropertySet > xPropSet( xStyle, UNO_QUERY );
Reference< XPropertySetInfo > xPropSetInfo =
xPropSet->getPropertySetInfo();
if( !bNew && xPropSetInfo->hasPropertyByName( sIsPhysical ) )
{
Any aAny = xPropSet->getPropertyValue( sIsPhysical );
bNew = !*(sal_Bool *)aAny.getValue();
}
if( rName != GetName() )
GetImport().AddStyleDisplayName( XML_STYLE_FAMILY_TEXT_LIST,
GetName(), rName );
2000-09-18 16:07:07 +00:00
Any aAny = xPropSet->getPropertyValue( sNumberingRules );
2000-10-23 08:37:16 +00:00
aAny >>= xNumRules;
nLevels = xNumRules->getCount();
2000-09-18 16:07:07 +00:00
if( bOverwrite || bNew )
{
2000-10-23 08:37:16 +00:00
FillUnoNumRule( xNumRules, 0 );
aAny <<= xNumRules;
2000-09-18 16:07:07 +00:00
xPropSet->setPropertyValue( sNumberingRules, aAny );
}
else
{
SetValid( sal_False );
}
SetNew( bNew );
}
}
void SvxXMLListStyleContext::CreateAndInsertAuto() const
{
DBG_ASSERT( !bOutline, "Outlines cannot be inserted here" );
2000-10-23 08:37:16 +00:00
DBG_ASSERT( !xNumRules.is(), "Numbering Rule is existing already" );
2000-09-18 16:07:07 +00:00
const OUString& rName = GetName();
2000-10-23 08:37:16 +00:00
if( bOutline || xNumRules.is() || 0 == rName.getLength() )
2000-09-18 16:07:07 +00:00
{
((SvxXMLListStyleContext *)this)->SetValid( sal_False );
return;
}
2000-10-23 08:37:16 +00:00
((SvxXMLListStyleContext *)this)->xNumRules = CreateNumRule(
GetImport().GetModel() );
((SvxXMLListStyleContext *)this)->nLevels = xNumRules->getCount();
2000-09-18 16:07:07 +00:00
2000-10-23 08:37:16 +00:00
FillUnoNumRule( xNumRules, 0 );
2000-09-18 16:07:07 +00:00
}
Reference < XIndexReplace > SvxXMLListStyleContext::CreateNumRule(
const Reference < XModel > & rModel )
{
Reference<XIndexReplace> xNumRule;
Reference< XMultiServiceFactory > xFactory( rModel, UNO_QUERY );
DBG_ASSERT( xFactory.is(), "no factory" );
if( !xFactory.is() )
return xNumRule;
2000-10-23 08:37:16 +00:00
Reference < XInterface > xIfc = xFactory->createInstance(OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.NumberingRules")) );
2000-09-18 16:07:07 +00:00
if( !xIfc.is() )
return xNumRule;
xNumRule = Reference<XIndexReplace>( xIfc, UNO_QUERY );
DBG_ASSERT( xNumRule.is(), "go no numbering rule" );
return xNumRule;
}
void SvxXMLListStyleContext::SetDefaultStyle(
const Reference < XIndexReplace > & rNumRule,
sal_Int16 nLevel,
sal_Bool bOrdered )
{
Sequence<beans::PropertyValue> aPropSeq( bOrdered ? 1 : 4 );
beans::PropertyValue *pProps = aPropSeq.getArray();
pProps->Name =
OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_NUMBERINGTYPE ));
2000-09-18 16:07:07 +00:00
(pProps++)->Value <<= (sal_Int16)(bOrdered ? NumberingType::ARABIC
: NumberingType::CHAR_SPECIAL );
if( !bOrdered )
{
// TODO: Bullet-Font
//aNumFmt.SetBulletFont( &SwNumRule::GetDefBulletFont() );
awt::FontDescriptor aFDesc;
aFDesc.Name = OUString(
#if defined UNX
RTL_CONSTASCII_USTRINGPARAM( "starbats" )
#else
RTL_CONSTASCII_USTRINGPARAM( "StarBats" )
#endif
);
aFDesc.Family = FAMILY_DONTKNOW ;
aFDesc.Pitch = PITCH_DONTKNOW ;
aFDesc.CharSet = RTL_TEXTENCODING_SYMBOL ;
aFDesc.Weight = WEIGHT_DONTKNOW;
//aFDesc.Transparant = sal_True;
pProps->Name =
OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_BULLET_FONT ));
2000-09-18 16:07:07 +00:00
(pProps++)->Value <<= aFDesc;
OUStringBuffer sTmp(1);
sTmp.append( (sal_Unicode)(0xF000 + 149) );
pProps->Name =
OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_BULLET_CHAR ));
2000-09-18 16:07:07 +00:00
(pProps++)->Value <<= sTmp.makeStringAndClear();
pProps->Name =
OUString(RTL_CONSTASCII_USTRINGPARAM( XML_UNO_NAME_NRULE_CHAR_STYLE_NAME ));
2000-09-18 16:07:07 +00:00
(pProps++)->Value <<=
OUString( RTL_CONSTASCII_USTRINGPARAM( "Numbering Symbols" ) );
}
Any aAny;
aAny <<= aPropSeq;
rNumRule->replaceByIndex( nLevel, aAny );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */