1 /**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sc.hxx"
26
27
28
29 // INCLUDE ---------------------------------------------------------------
30 #include "XMLTableShapesContext.hxx"
31 #include "XMLTableShapeImportHelper.hxx"
32 #include "xmlimprt.hxx"
33 #include "document.hxx"
34 #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
35
36 using namespace com::sun::star;
37
38 //------------------------------------------------------------------
39
ScXMLTableShapesContext(ScXMLImport & rImport,sal_uInt16 nPrfx,const::rtl::OUString & rLName,const::com::sun::star::uno::Reference<::com::sun::star::xml::sax::XAttributeList> &)40 ScXMLTableShapesContext::ScXMLTableShapesContext( ScXMLImport& rImport,
41 sal_uInt16 nPrfx,
42 const ::rtl::OUString& rLName,
43 const ::com::sun::star::uno::Reference<
44 ::com::sun::star::xml::sax::XAttributeList>& /* xAttrList */ ) :
45 SvXMLImportContext( rImport, nPrfx, rLName )
46 {
47 // here are no attributes
48 }
49
~ScXMLTableShapesContext()50 ScXMLTableShapesContext::~ScXMLTableShapesContext()
51 {
52 }
53
CreateChildContext(sal_uInt16 nPrefix,const::rtl::OUString & rLName,const::com::sun::star::uno::Reference<::com::sun::star::xml::sax::XAttributeList> & xAttrList)54 SvXMLImportContext *ScXMLTableShapesContext::CreateChildContext( sal_uInt16 nPrefix,
55 const ::rtl::OUString& rLName,
56 const ::com::sun::star::uno::Reference<
57 ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
58 {
59 SvXMLImportContext *pContext(0);
60
61 if (!pContext)
62 {
63 ScXMLImport& rXMLImport(GetScImport());
64 uno::Reference<drawing::XShapes> xShapes (rXMLImport.GetTables().GetCurrentXShapes());
65 if (xShapes.is())
66 {
67 XMLTableShapeImportHelper* pTableShapeImport((XMLTableShapeImportHelper*)rXMLImport.GetShapeImport().get());
68 pTableShapeImport->SetOnTable(sal_True);
69 pContext = rXMLImport.GetShapeImport()->CreateGroupChildContext(
70 rXMLImport, nPrefix, rLName, xAttrList, xShapes);
71 }
72 }
73
74 if( !pContext )
75 pContext = new SvXMLImportContext( GetImport(), nPrefix, rLName );
76
77 return pContext;
78 }
79
EndElement()80 void ScXMLTableShapesContext::EndElement()
81 {
82 }
83
84