1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: texttabstoplistcontext.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
34 #include <rtl/ustring.hxx>
36 #include "oox/core/namespaces.hxx"
37 #include "oox/drawingml/drawingmltypes.hxx"
38 #include "texttabstoplistcontext.hxx"
41 using ::rtl::OUString
;
42 using namespace ::oox::core
;
43 using namespace ::com::sun::star::uno
;
44 using namespace ::com::sun::star::style
;
45 using namespace ::com::sun::star::xml::sax
;
47 namespace oox
{ namespace drawingml
{
49 TextTabStopListContext::TextTabStopListContext( ContextHandler
& rParent
, std::list
< TabStop
> & aTabList
)
50 : ContextHandler( rParent
)
51 , maTabList( aTabList
)
55 TextTabStopListContext::~TextTabStopListContext()
59 void SAL_CALL
TextTabStopListContext::endFastElement( ::sal_Int32
/*Element*/ )
60 throw ( SAXException
, RuntimeException
)
65 Reference
< ::XFastContextHandler
> TextTabStopListContext::createFastChildContext( ::sal_Int32 aElement
,
66 const Reference
< XFastAttributeList
>& xAttribs
)
67 throw (SAXException
, RuntimeException
)
69 Reference
< XFastContextHandler
> xRet
;
72 case NMSP_DRAWINGML
|XML_tab
:
76 sValue
= xAttribs
->getOptionalValue( XML_pos
);
77 if( sValue
.getLength() )
79 aTabStop
.Position
= GetCoordinate( sValue
);
81 sal_Int32 aToken
= xAttribs
->getOptionalValueToken( XML_algn
, 0 );
84 aTabStop
.Alignment
= GetTabAlign( aToken
);
86 maTabList
.push_back(aTabStop
);