LibreOffice Module sc (master) 1
sharedstringsfragment.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
21#include <biffhelper.hxx>
22
23#include <richstringcontext.hxx>
25#include <oox/token/namespaces.hxx>
26
27namespace oox::xls {
28
29using namespace ::oox::core;
30
32 const WorkbookHelper& rHelper, const OUString& rFragmentPath ) :
33 WorkbookFragmentBase( rHelper, rFragmentPath )
34{
35}
36
38{
39 switch( getCurrentElement() )
40 {
42 if( nElement == XLS_TOKEN( sst ) )
43 return this;
44 break;
45
46 case XLS_TOKEN( sst ):
47 if( nElement == XLS_TOKEN( si ) )
48 return new RichStringContext( *this, getSharedStrings().createRichString() );
49 break;
50 }
51 return nullptr;
52}
53
55{
56 switch( getCurrentElement() )
57 {
59 if( nRecId == BIFF12_ID_SST )
60 return this;
61 break;
62
63 case BIFF12_ID_SST:
64 if( nRecId == BIFF12_ID_SI )
65 getSharedStrings().createRichString()->importString( rStrm, true, *this );
66 break;
67 }
68 return nullptr;
69}
70
72{
73 static const RecordInfo spRecInfos[] =
74 {
76 { -1, -1 }
77 };
78 return spRecInfos;
79}
80
82{
84}
85
86} // namespace oox::xls
87
88/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
RichStringRef createRichString()
Creates and returns a new string entry.
void finalizeImport()
Final processing after import of all strings.
virtual void finalizeImport() override
virtual ::oox::core::ContextHandlerRef onCreateRecordContext(sal_Int32 nRecId, SequenceInputStream &rStrm) override
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
virtual const ::oox::core::RecordInfo * getRecordInfos() const override
SharedStringsFragment(const WorkbookHelper &rHelper, const OUString &rFragmentPath)
Fragment handler derived from the WorkbookHelper helper class.
Helper class to provide access to global workbook data.
SharedStringsBuffer & getSharedStrings() const
Returns the shared strings read from the shared strings substream.
void SvStream & rStrm
const sal_Int32 XML_ROOT_CONTEXT
const sal_Int32 BIFF12_ID_SI
Definition: biffhelper.hxx:222
const sal_Int32 BIFF12_ID_SST
Definition: biffhelper.hxx:223